@@ -8,6 +8,7 @@ import type { ITerminal } from '../utils/terminal.js';
8
8
import { bootStatus , unblockBoot , type BootStatus } from '../webcontainer/on-demand-boot.js' ;
9
9
import type { PreviewInfo } from '../webcontainer/preview-info.js' ;
10
10
import { StepsController } from '../webcontainer/steps.js' ;
11
+ import type { EditorConfig } from '../webcontainer/editor-config.js' ;
11
12
import type { TerminalConfig } from '../webcontainer/terminal-config.js' ;
12
13
import { EditorStore , type EditorDocument , type EditorDocuments , type ScrollPosition } from './editor.js' ;
13
14
import { PreviewsStore } from './previews.js' ;
@@ -141,6 +142,7 @@ export class TutorialStore {
141
142
142
143
this . _previewsStore . setPreviews ( lesson . data . previews ?? true ) ;
143
144
this . _terminalStore . setTerminalConfiguration ( lesson . data . terminal ) ;
145
+ this . _editorStore . setEditorConfig ( lesson . data . editor ) ;
144
146
this . _runner . setCommands ( lesson . data ) ;
145
147
this . _editorStore . setDocuments ( lesson . files ) ;
146
148
@@ -195,6 +197,10 @@ export class TutorialStore {
195
197
return this . _terminalStore . terminalConfig ;
196
198
}
197
199
200
+ get editorConfig ( ) : ReadableAtom < EditorConfig > {
201
+ return this . _editorStore . editorConfig ;
202
+ }
203
+
198
204
get currentDocument ( ) : ReadableAtom < EditorDocument | undefined > {
199
205
return this . _editorStore . currentDocument ;
200
206
}
@@ -243,19 +249,15 @@ export class TutorialStore {
243
249
return false ;
244
250
}
245
251
246
- const { editor } = this . _lesson . data ;
247
-
248
- return editor === undefined || editor === true || ( editor !== false && editor ?. fileTree !== false ) ;
252
+ return this . editorConfig . get ( ) . fileTree . visible ;
249
253
}
250
254
251
255
hasEditor ( ) : boolean {
252
256
if ( ! this . _lesson ) {
253
257
return false ;
254
258
}
255
259
256
- const { editor } = this . _lesson . data ;
257
-
258
- return editor !== false ;
260
+ return this . editorConfig . get ( ) . visible ;
259
261
}
260
262
261
263
hasPreviews ( ) : boolean {
0 commit comments