22import SplitPane from ' ./SplitPane.vue'
33import Output from ' ./output/Output.vue'
44import { 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'
711import EditorContainer from ' ./editor/EditorContainer.vue'
812
913export interface Props {
@@ -32,7 +36,7 @@ export interface Props {
3236 showRuntimeWarning? : boolean
3337 }
3438 editorOptions? : {
35- ShowErrorText ? : string
39+ showErrorText ? : string
3640 }
3741}
3842
@@ -60,9 +64,7 @@ const props = withDefaults(defineProps<Props>(), {
6064 showRuntimeWarning: true ,
6165 }),
6266 layout: ' horizontal' ,
63- editorOptions : () => ({
64- ShowErrorText: ' Show Error' ,
65- }),
67+ editorOptions : () => ({}),
6668})
6769
6870if (! props .editor ) {
@@ -76,17 +78,11 @@ props.store.init()
7678const editorSlotName = computed (() => (props .layoutReverse ? ' right' : ' left' ))
7779const outputSlotName = computed (() => (props .layoutReverse ? ' left' : ' right' ))
7880
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+ )
9086
9187/**
9288 * Reload the preview iframe
0 commit comments