Feat(Tools): Support theme

This commit is contained in:
2024-09-20 11:53:57 +08:00
parent 60d1309610
commit 451225c1cf
11 changed files with 347 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ interface EditorProps {
options?: IEditorOptions
onJumpFile?: (fileName: string) => void
extraLibs?: ExtraLib[]
onEditorDidMount?: (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void
}
const Editor = ({
@@ -35,7 +36,8 @@ const Editor = ({
onChange,
options,
onJumpFile,
extraLibs = []
extraLibs = [],
onEditorDidMount
}: EditorProps) => {
const { styles } = useStyles()
const editorRef = useRef<editor.IStandaloneCodeEditor>()
@@ -98,6 +100,8 @@ const Editor = ({
monaco.languages.typescript.typescriptDefaults.addExtraLib(item.content, item.path)
)
onEditorDidMount?.(editor, monaco)
void autoLoadExtraLib(editor, monaco, file.value, onWatch)
}