mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
feat: add Python support with Pyodide integration
GitOrigin-RevId: 382ce102c43050aace691dd89d825a94abf347a8
This commit is contained in:
committed by
Copybot
parent
bb5d90a332
commit
138f7f8023
@@ -9,12 +9,16 @@ import { Suspense } from 'react'
|
||||
import { FullSizeLoadingSpinner } from '@/shared/components/loading-spinner'
|
||||
import SymbolPalettePane from '@/features/ide-react/components/editor/symbol-palette-pane'
|
||||
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
||||
import { PythonEditorSplit } from '@/features/ide-react/components/layout/python-editor-split'
|
||||
|
||||
export const Editor = () => {
|
||||
const { opening, errorState, showSymbolPalette } =
|
||||
useEditorPropertiesContext()
|
||||
const { selectedEntityCount, openEntity } = useFileTreeOpenContext()
|
||||
const { currentDocumentId, currentDocument } = useEditorOpenDocContext()
|
||||
const isPythonDocument =
|
||||
openEntity?.type === 'doc' &&
|
||||
openEntity.entity.name.toLowerCase().endsWith('.py')
|
||||
|
||||
if (!currentDocumentId) {
|
||||
return null
|
||||
@@ -39,7 +43,7 @@ export const Editor = () => {
|
||||
order={1}
|
||||
className="ide-redesign-editor-panel"
|
||||
>
|
||||
<SourceEditor />
|
||||
{isPythonDocument ? <PythonEditorSplit /> : <SourceEditor />}
|
||||
{isLoading && <EditorLoadingPane />}
|
||||
</Panel>
|
||||
{showSymbolPalette && (
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Panel, PanelGroup } from 'react-resizable-panels'
|
||||
import { VerticalResizeHandle } from '@/features/ide-react/components/resize/vertical-resize-handle'
|
||||
import PythonOutputPane from '@/features/ide-react/components/editor/python/python-output-pane'
|
||||
import SourceEditor from '@/features/source-editor/components/source-editor'
|
||||
|
||||
export const PythonEditorSplit = () => {
|
||||
return (
|
||||
<PanelGroup
|
||||
autoSaveId="ide-redesign-editor-python-output"
|
||||
direction="vertical"
|
||||
className="ide-redesign-python-editor-split"
|
||||
>
|
||||
<Panel id="ide-redesign-panel-source-editor-content" order={1}>
|
||||
<SourceEditor />
|
||||
</Panel>
|
||||
<VerticalResizeHandle id="ide-redesign-editor-python-output" />
|
||||
<Panel
|
||||
id="ide-redesign-panel-python-output"
|
||||
order={2}
|
||||
defaultSize={35}
|
||||
minSize={10}
|
||||
>
|
||||
<PythonOutputPane />
|
||||
</Panel>
|
||||
</PanelGroup>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user