2
2
import SplitPane from ' ./SplitPane.vue'
3
3
import Output from ' ./output/Output.vue'
4
4
import { type Store , useStore } from ' ./store'
5
- import { computed , provide , ref , toRef } from ' vue'
6
- import { type EditorComponentType , injectKeyStore } from ' ./types'
5
+ import { computed , provide , ref , toRefs } from ' vue'
6
+ import {
7
+ type EditorComponentType ,
8
+ injectKeyPreviewRef ,
9
+ injectKeyProps ,
10
+ } from ' ./types'
7
11
import EditorContainer from ' ./editor/EditorContainer.vue'
8
12
9
13
export interface Props {
@@ -32,7 +36,7 @@ export interface Props {
32
36
showRuntimeWarning? : boolean
33
37
}
34
38
editorOptions? : {
35
- ShowErrorText ? : string
39
+ showErrorText ? : string
36
40
}
37
41
}
38
42
@@ -60,9 +64,7 @@ const props = withDefaults(defineProps<Props>(), {
60
64
showRuntimeWarning: true ,
61
65
}),
62
66
layout: ' horizontal' ,
63
- editorOptions : () => ({
64
- ShowErrorText: ' Show Error' ,
65
- }),
67
+ editorOptions : () => ({}),
66
68
})
67
69
68
70
if (! props .editor ) {
@@ -76,17 +78,11 @@ props.store.init()
76
78
const editorSlotName = computed (() => (props .layoutReverse ? ' right' : ' left' ))
77
79
const outputSlotName = computed (() => (props .layoutReverse ? ' left' : ' right' ))
78
80
79
- provide (injectKeyStore , props .store )
80
- provide (' autoresize' , props .autoResize )
81
- provide (' autosave' , props .autoSave )
82
- provide (' import-map' , toRef (props , ' showImportMap' ))
83
- provide (' tsconfig' , toRef (props , ' showTsConfig' ))
84
- provide (' clear-console' , toRef (props , ' clearConsole' ))
85
- provide (' preview-options' , props .previewOptions )
86
- provide (' editor-options' , props .editorOptions )
87
- provide (' theme' , toRef (props , ' theme' ))
88
- provide (' preview-theme' , toRef (props , ' previewTheme' ))
89
- provide (' preview-ref' , () => outputRef .value ?.previewRef ?.container )
81
+ provide (injectKeyProps , toRefs (props ))
82
+ provide (
83
+ injectKeyPreviewRef ,
84
+ computed (() => outputRef .value ?.previewRef ?.container ),
85
+ )
90
86
91
87
/**
92
88
* Reload the preview iframe
0 commit comments