@@ -25,8 +25,8 @@ import EditorMenu from './EditorMenu';
2525import FileDropZone from '../common/FileDropZone' ;
2626import { SHORTCUT_KEYS } from '../../editor/shortcutKeys' ;
2727import ConnectionAwareListContext from '../../contexts/ConnectionAwareListContext' ;
28- import useThemeState from '../../hooks/settings/useThemeState ' ;
29- import CompiledOutputWindow from './CompiledOutputWindow ' ;
28+ import OutputWindow from './OutputPanel ' ;
29+ import OutputWindowContext from '../../contexts/OutputPanelContext ' ;
3030
3131export const DROP_ZONE_EXTENSIONS = [ '.blocks' , '.blocks.json' ] ;
3232
@@ -128,7 +128,6 @@ export default function Editor({hideMenu, onSetup, onChange, onSave, className,
128128 const events = useContext ( EventsContext ) ;
129129 const connectionAwareList = useContext ( ConnectionAwareListContext ) ;
130130
131- const [ theme ] = useThemeState ( ) ;
132131 const [ isOutputWindowVisible , setOutputWindowVisible ] = useState ( false ) ;
133132
134133 let editor = null ;
@@ -302,17 +301,27 @@ export default function Editor({hideMenu, onSetup, onChange, onSave, className,
302301 }
303302 } ;
304303
304+ const outputWindow = {
305+ isVisible : isOutputWindowVisible ,
306+ setVisible : setOutputWindowVisible ,
307+ } ;
308+
305309 return (
306310 < FileDropZone options = { { noClick : true , accept : DROP_ZONE_EXTENSIONS . join ( ',' ) } } onFileContent = { loadFileContent } >
307- < EditorContainer
308- className = { classNames ( 'node-editor d-flex flex-grow-1 flex-column' , 'theme-' + theme . id , theme . parts . map ( part => `theme-part-${ part } ` ) , className ) }
309- { ...others } >
310- { ! hideMenu && (
311- < EditorMenu getEditor = { ( ) => editor } onLoadFileContent = { loadFileContent } setOutputWindowVisible = { setOutputWindowVisible } />
312- ) }
313- < CompiledOutputWindow isVisible = { isOutputWindowVisible } setVisible = { setOutputWindowVisible } />
314- < div ref = { bindEditor } />
315- </ EditorContainer >
311+ < OutputWindowContext . Provider value = { outputWindow } >
312+ < EditorContainer
313+ className = { classNames ( 'node-editor d-flex flex-grow-1 flex-column' , className ) }
314+ { ...others } >
315+ { ! hideMenu && (
316+ < EditorMenu
317+ getEditor = { ( ) => editor }
318+ onLoadFileContent = { loadFileContent }
319+ />
320+ ) }
321+ < OutputWindow />
322+ < div ref = { bindEditor } />
323+ </ EditorContainer >
324+ </ OutputWindowContext . Provider >
316325 </ FileDropZone >
317326 ) ;
318327}
0 commit comments