diff --git a/src/modules/helper/views/ai-code.vue b/src/modules/helper/views/ai-code.vue index 520c40b..eab0316 100644 --- a/src/modules/helper/views/ai-code.vue +++ b/src/modules/helper/views/ai-code.vue @@ -229,7 +229,8 @@
- { ], components: [ + // 依赖偏大,现用于“ai编码页面”,如不需要请注释组件 // 代码编辑器 https://www.npmjs.com/package/monaco-editor () => import("./components/monaco.vue") ] diff --git a/src/plugins/editor-monaco/index.ts b/src/plugins/editor-monaco/index.ts index 288c5c5..b597b4d 100644 --- a/src/plugins/editor-monaco/index.ts +++ b/src/plugins/editor-monaco/index.ts @@ -1 +1,2 @@ export * from "./utils/declare"; +export * from "./utils/theme"; diff --git a/src/plugins/editor-monaco/utils/theme.ts b/src/plugins/editor-monaco/utils/theme.ts index ee19830..03b32de 100644 --- a/src/plugins/editor-monaco/utils/theme.ts +++ b/src/plugins/editor-monaco/utils/theme.ts @@ -1,6 +1,6 @@ import { editor } from "monaco-editor"; -editor.defineTheme("default", { +defineTheme("default", { base: "vs", inherit: true, rules: [ @@ -348,3 +348,17 @@ editor.defineTheme("default", { "editor.selectionHighlightBorder": "#fafbfc" } }); + +defineTheme("ai-code--dark", { + base: "vs-dark", + inherit: true, + rules: [], + colors: { + "editor.background": "#0f151e", + "editor.inactiveSelectionBackground": "#0f151e" + } +}); + +export function defineTheme(name: string, data: editor.IStandaloneThemeData) { + editor.defineTheme(name, data); +}