@@ -56,6 +56,7 @@ const PyodideRunner = (props) => {
5656 const settings = useContext ( SettingsContext ) ;
5757 const isMobile = useMediaQuery ( { query : MOBILE_MEDIA_QUERY } ) ;
5858 const senseHatAlways = useSelector ( ( s ) => s . editor . senseHatAlwaysEnabled ) ;
59+ const isOutputOnly = useSelector ( ( state ) => state . editor . isOutputOnly ) ;
5960 const queryParams = new URLSearchParams ( window . location . search ) ;
6061 const showVisualTab = queryParams . get ( "show_visual_tab" ) === "true" ;
6162 const [ hasVisual , setHasVisual ] = useState ( showVisualTab || senseHatAlways ) ;
@@ -78,6 +79,10 @@ const PyodideRunner = (props) => {
7879 } ;
7980 const [ inputStackIndex , setInputStackIndex ] = useState ( 0 ) ;
8081
82+ useEffect ( ( ) => {
83+ console . log ( "isOutputOnly" , isOutputOnly ) ;
84+ } ) ;
85+
8186 useEffect ( ( ) => {
8287 const handleKeyDown = ( event ) => {
8388 if ( event . key === "ArrowUp" ) {
@@ -414,6 +419,11 @@ const PyodideRunner = (props) => {
414419 { t ( "output.textOutput" ) }
415420 </ span >
416421 </ Tab >
422+ { ! isOutputOnly && (
423+ < Tab key = { 1 } >
424+ < span className = "react-tabs__tab-text" > Console</ span >
425+ </ Tab >
426+ ) }
417427 </ TabList >
418428 { ! hasVisual && ! isEmbedded && isMobile && (
419429 < RunnerControls skinny />
@@ -427,6 +437,16 @@ const PyodideRunner = (props) => {
427437 ref = { output }
428438 > </ pre >
429439 </ TabPanel >
440+ { ! isOutputOnly && (
441+ < TabPanel key = { 1 } >
442+ < iframe
443+ title = "console"
444+ src = "http://localhost:3012/en/embed/viewer/ipython-console?browserPreview=true& autoRun = true "
445+ crossOrigin
446+ style = { { width : "100%" , height : "100%" } }
447+ />
448+ </ TabPanel >
449+ ) }
430450 </ Tabs >
431451 </ div >
432452 </ >
@@ -446,6 +466,11 @@ const PyodideRunner = (props) => {
446466 { t ( "output.textOutput" ) }
447467 </ span >
448468 </ Tab >
469+ { /* {!isOutputOnly && (
470+ <Tab key={2}>
471+ <span className="react-tabs__tab-text">Console</span>
472+ </Tab>
473+ )} */ }
449474 </ TabList >
450475 { ! isEmbedded && hasVisual && < OutputViewToggle /> }
451476 { ! isEmbedded && isMobile && < RunnerControls skinny /> }
@@ -463,6 +488,20 @@ const PyodideRunner = (props) => {
463488 ref = { output }
464489 > </ pre >
465490 </ TabPanel >
491+ { /* {!isOutputOnly && (
492+ <TabPanel key={2}>
493+ <editor-wc
494+ autoRun={true}
495+ class="c-editor__wc"
496+ code={`from IPython import embed\nembed()`}
497+ load_remix_disabled={true}
498+ embedded={false}
499+ output_only={true}
500+ output_split_view={false}
501+ use_editor_styles={true}
502+ ></editor-wc>
503+ </TabPanel>
504+ )} */ }
466505 </ Tabs >
467506 ) }
468507 </ div >
0 commit comments