mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Remove Replit support - Replit does not support to be sent code anymore. Looking for alternatives.
This commit is contained in:
+1
-1
@@ -164,7 +164,7 @@ For Developers:
|
||||
- **[Install Mobile APP](../docs/pixels/feature_pwa.png)** 📲 looks like native (@harlanlewis)
|
||||
- **[UI language](../docs/pixels/feature_language.png)** with auto-detect, and future app language! (@tbodyston)
|
||||
- **PDF Summarization** 🧩🤯 - ask questions to a PDF! (@fredliubojin)
|
||||
- **Code Execution: [Codepen](https://codepen.io/)/[Replit](https://replit.com/)** 💻 (@harlanlewis)
|
||||
- **Code Execution: [Codepen](https://codepen.io/)** 💻 (@harlanlewis)
|
||||
- **[SVG Drawing](../docs/pixels/feature_svg_drawing.png)** - draw with AI 🎨
|
||||
- Chats: multiple chats, AI titles, Import/Export, Selection mode
|
||||
- Rendering: Markdown, SVG, improved Code blocks
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { Button, Tooltip } from '@mui/joy';
|
||||
|
||||
interface CodeBlockProps {
|
||||
codeBlock: {
|
||||
code: string;
|
||||
language?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export function ButtonReplit({ codeBlock }: CodeBlockProps): React.JSX.Element {
|
||||
const { language } = codeBlock;
|
||||
|
||||
const replitLanguageMap: Record<string, string> = {
|
||||
python: 'python3',
|
||||
csharp: 'csharp',
|
||||
java: 'java',
|
||||
};
|
||||
|
||||
const handleOpenInReplit = () => {
|
||||
const replitLanguage = replitLanguageMap[language || 'python'];
|
||||
const url = new URL(`https://replit.com/languages/${replitLanguage}`);
|
||||
window.open(url.toString(), '_blank');
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip title={`Open in Replit (${codeBlock.language})`} variant='solid'>
|
||||
<Button variant='outlined' color='neutral' onClick={handleOpenInReplit}>
|
||||
Replit
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import { copyToClipboard } from '~/common/util/clipboardUtils';
|
||||
|
||||
import type { CodeBlock } from '../blocks';
|
||||
import { ButtonCodepen } from './ButtonCodepen';
|
||||
import { ButtonReplit } from './ButtonReplit';
|
||||
import { heuristicIsHtml, IFrameComponent } from '../RenderHtml';
|
||||
import { patchSvgString, RenderCodeMermaid } from './RenderCodeMermaid';
|
||||
|
||||
@@ -119,8 +118,6 @@ function RenderCodeImpl(props: {
|
||||
const languagesCodepen = ['html', 'css', 'javascript', 'json', 'typescript'];
|
||||
const canCodepen = isSVG || (!!inferredCodeLanguage && languagesCodepen.includes(inferredCodeLanguage));
|
||||
|
||||
const languagesReplit = ['python', 'java', 'csharp'];
|
||||
const canReplit = !!inferredCodeLanguage && languagesReplit.includes(inferredCodeLanguage);
|
||||
|
||||
const handleCopyToClipboard = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
@@ -214,7 +211,6 @@ function RenderCodeImpl(props: {
|
||||
</Tooltip>
|
||||
)}
|
||||
{canCodepen && <ButtonCodepen codeBlock={{ code: blockCode, language: inferredCodeLanguage || undefined }} />}
|
||||
{canReplit && <ButtonReplit codeBlock={{ code: blockCode, language: inferredCodeLanguage || undefined }} />}
|
||||
{props.noCopyButton !== true && (
|
||||
<Tooltip title='Copy Code'>
|
||||
<IconButton variant='soft' onClick={handleCopyToClipboard}>
|
||||
|
||||
Reference in New Issue
Block a user