1
1
import { getAssetsStore , isAssetUrl } from '@codeimage/store/assets/assets' ;
2
2
import { AssetsImage } from '@codeimage/store/assets/AssetsImage' ;
3
+ import { getExportCanvasStore } from '@codeimage/store/canvas' ;
3
4
import { getRootEditorStore } from '@codeimage/store/editor' ;
4
5
import { getActiveEditorStore } from '@codeimage/store/editor/activeEditor' ;
6
+ import { EditorConfigStore } from '@codeimage/store/editor/config.store' ;
5
7
import { getFrameState } from '@codeimage/store/editor/frame' ;
6
8
import { getTerminalState } from '@codeimage/store/editor/terminal' ;
7
9
import { dispatchCopyToClipboard } from '@codeimage/store/effects/onCopyToClipboard' ;
@@ -17,6 +19,7 @@ import {
17
19
VoidProps ,
18
20
} from 'solid-js' ;
19
21
import { Portal } from 'solid-js/web' ;
22
+ import { provideState } from 'statebuilder' ;
20
23
import { setPreviewEditorView } from '../../hooks/export-snippet' ;
21
24
import { useHotkey } from '../../hooks/use-hotkey' ;
22
25
import { DynamicTerminal } from '../Terminal/DynamicTerminal/DynamicTerminal' ;
@@ -32,9 +35,13 @@ const PreviewExportEditor = lazy(
32
35
) ;
33
36
34
37
function PreviewPortal ( props : ParentProps ) {
38
+ const config = provideState ( EditorConfigStore ) ;
35
39
return (
36
40
< Portal >
37
- < div class = { styles . previewPortal } >
41
+ < div
42
+ data-dev-mode = { config . get . devMode ? '' : undefined }
43
+ class = { styles . previewPortal }
44
+ >
38
45
< Suspense fallback = { < FrameSkeleton /> } > { props . children } </ Suspense >
39
46
</ div >
40
47
</ Portal >
@@ -47,6 +54,7 @@ export function PreviewFrame(props: VoidProps<PreviewFrameProps>) {
47
54
const terminal = getTerminalState ( ) . state ;
48
55
const editor = getRootEditorStore ( ) ;
49
56
const assetsStore = getAssetsStore ( ) ;
57
+ const exportCanvasStore = getExportCanvasStore ( ) ;
50
58
51
59
const filterHotKey = ( ) =>
52
60
editor . state . options . focused ||
@@ -112,6 +120,7 @@ export function PreviewFrame(props: VoidProps<PreviewFrameProps>) {
112
120
type = { terminal . type }
113
121
readonlyTab = { true }
114
122
showTab = { true }
123
+ showOnlyActiveTab = { exportCanvasStore . get . showOnlyActiveTab }
115
124
shadow = { terminal . shadow }
116
125
background = { terminal . background }
117
126
accentVisible = { terminal . accentVisible }
0 commit comments