MCPcopy Create free account
hub / github.com/SplootCode/splootcode / PythonEditorPanels

Function PythonEditorPanels

src/pages/python_editor_panels.tsx:29–75  ·  view source on GitHub ↗
(props: PythonEditorProps)

Source from the content-addressed store, hash-verified

27}
28
29export const PythonEditorPanels = (props: PythonEditorProps) => {
30 const { editorState, onSaveAs } = props
31 const [visibleView, setVisibleView] = useState('tray' as EditorSideMenuView)
32 const onlyPackage: SplootPackage = editorState.project.packages[0]
33 const startSize = window.outerWidth - 270 - 360
34
35 const editorHostingConfig = editorState.hostingConfig
36 const runtimeContextManager = editorState.runtimeContextManager
37
38 return (
39 <div className="editor">
40 <EditorSideMenu
41 currentView={visibleView}
42 onChangeView={(newView: EditorSideMenuView) => setVisibleView(newView)}
43 editorState={editorState}
44 />
45 <Allotment defaultSizes={[300, startSize, 360]} minSize={180} proportionalLayout={false}>
46 <Allotment.Pane visible={visibleView !== ''} snap>
47 <EditorSideMenuPane visibleView={visibleView} editorState={editorState} moduleTrayLoader={moduleTrayLoader} />
48 </Allotment.Pane>
49 <Allotment.Pane priority={LayoutPriority.High}>
50 <Editor
51 block={editorState.rootNode}
52 project={editorState.project}
53 pkg={onlyPackage}
54 selection={editorState.selection}
55 validationWatcher={editorState.validationWatcher}
56 banner={
57 editorState.project.isReadOnly ? <EditorBanner project={editorState.project} onSaveAs={onSaveAs} /> : null
58 }
59 editorHostingConfig={editorState.hostingConfig}
60 undoWatcher={editorState.undoWatcher}
61 />
62 </Allotment.Pane>
63 <Allotment.Pane preferredSize={360} priority={LayoutPriority.Low}>
64 <div className="python-preview-panel">
65 <PythonRuntimePanel
66 frameScheme={editorHostingConfig.FRAME_VIEW_SCHEME}
67 frameDomain={editorHostingConfig.FRAME_VIEW_DOMAIN}
68 runtimeContextManager={runtimeContextManager}
69 />
70 </div>
71 </Allotment.Pane>
72 </Allotment>
73 </div>
74 )
75}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected