@@ -3,6 +3,7 @@ import type { TutorialStore } from '@tutorialkit/runtime';
3
3
import type { I18n } from '@tutorialkit/types' ;
4
4
import { useCallback , useEffect , useRef , useState , type ComponentProps } from 'react' ;
5
5
import { Panel , PanelGroup , PanelResizeHandle , type ImperativePanelHandle } from 'react-resizable-panels' ;
6
+ import { DialogProvider } from '../core/Dialog.js' ;
6
7
import type { Theme } from '../core/types.js' ;
7
8
import resizePanelStyles from '../styles/resize-panel.module.css' ;
8
9
import { classNames } from '../utils/classnames.js' ;
@@ -17,9 +18,10 @@ type FileTreeChangeEvent = Parameters<NonNullable<ComponentProps<typeof EditorPa
17
18
interface Props {
18
19
tutorialStore : TutorialStore ;
19
20
theme : Theme ;
21
+ dialog : NonNullable < ComponentProps < typeof DialogProvider > [ 'value' ] > ;
20
22
}
21
23
22
- interface PanelProps extends Props {
24
+ interface PanelProps extends Omit < Props , 'dialog' > {
23
25
hasEditor : boolean ;
24
26
hasPreviews : boolean ;
25
27
hideTerminalPanel : boolean ;
@@ -33,7 +35,7 @@ interface TerminalProps extends PanelProps {
33
35
/**
34
36
* This component is the orchestrator between various interactive components.
35
37
*/
36
- export function WorkspacePanel ( { tutorialStore, theme } : Props ) {
38
+ export function WorkspacePanel ( { tutorialStore, theme, dialog } : Props ) {
37
39
/**
38
40
* Re-render when lesson changes.
39
41
* The `tutorialStore.hasEditor()` and other methods below access
@@ -50,13 +52,15 @@ export function WorkspacePanel({ tutorialStore, theme }: Props) {
50
52
51
53
return (
52
54
< PanelGroup className = { resizePanelStyles . PanelGroup } direction = "vertical" >
53
- < EditorSection
54
- theme = { theme }
55
- tutorialStore = { tutorialStore }
56
- hasEditor = { hasEditor }
57
- hasPreviews = { hasPreviews }
58
- hideTerminalPanel = { hideTerminalPanel }
59
- />
55
+ < DialogProvider value = { dialog } >
56
+ < EditorSection
57
+ theme = { theme }
58
+ tutorialStore = { tutorialStore }
59
+ hasEditor = { hasEditor }
60
+ hasPreviews = { hasPreviews }
61
+ hideTerminalPanel = { hideTerminalPanel }
62
+ />
63
+ </ DialogProvider >
60
64
61
65
< PanelResizeHandle
62
66
className = { resizePanelStyles . PanelResizeHandle }
0 commit comments