11import { getAssetsStore , isAssetUrl } from '@codeimage/store/assets/assets' ;
22import { AssetsImage } from '@codeimage/store/assets/AssetsImage' ;
3+ import { getExportCanvasStore } from '@codeimage/store/canvas' ;
34import { getRootEditorStore } from '@codeimage/store/editor' ;
45import { getActiveEditorStore } from '@codeimage/store/editor/activeEditor' ;
6+ import { EditorConfigStore } from '@codeimage/store/editor/config.store' ;
57import { getFrameState } from '@codeimage/store/editor/frame' ;
68import { getTerminalState } from '@codeimage/store/editor/terminal' ;
79import { dispatchCopyToClipboard } from '@codeimage/store/effects/onCopyToClipboard' ;
@@ -17,6 +19,7 @@ import {
1719 VoidProps ,
1820} from 'solid-js' ;
1921import { Portal } from 'solid-js/web' ;
22+ import { provideState } from 'statebuilder' ;
2023import { setPreviewEditorView } from '../../hooks/export-snippet' ;
2124import { useHotkey } from '../../hooks/use-hotkey' ;
2225import { DynamicTerminal } from '../Terminal/DynamicTerminal/DynamicTerminal' ;
@@ -32,9 +35,13 @@ const PreviewExportEditor = lazy(
3235) ;
3336
3437function PreviewPortal ( props : ParentProps ) {
38+ const config = provideState ( EditorConfigStore ) ;
3539 return (
3640 < Portal >
37- < div class = { styles . previewPortal } >
41+ < div
42+ data-dev-mode = { config . get . devMode ? '' : undefined }
43+ class = { styles . previewPortal }
44+ >
3845 < Suspense fallback = { < FrameSkeleton /> } > { props . children } </ Suspense >
3946 </ div >
4047 </ Portal >
@@ -47,6 +54,7 @@ export function PreviewFrame(props: VoidProps<PreviewFrameProps>) {
4754 const terminal = getTerminalState ( ) . state ;
4855 const editor = getRootEditorStore ( ) ;
4956 const assetsStore = getAssetsStore ( ) ;
57+ const exportCanvasStore = getExportCanvasStore ( ) ;
5058
5159 const filterHotKey = ( ) =>
5260 editor . state . options . focused ||
@@ -112,6 +120,7 @@ export function PreviewFrame(props: VoidProps<PreviewFrameProps>) {
112120 type = { terminal . type }
113121 readonlyTab = { true }
114122 showTab = { true }
123+ showOnlyActiveTab = { exportCanvasStore . get . showOnlyActiveTab }
115124 shadow = { terminal . shadow }
116125 background = { terminal . background }
117126 accentVisible = { terminal . accentVisible }
0 commit comments