From ac49c0f59b515f71bd932b83b9eb28774f56380c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 12 May 2025 18:15:19 +0300 Subject: [PATCH] refactor(server): remove dependency on codemirror project --- .../options/code_notes/code_theme.ts | 18 ++++++++++-------- apps/server/src/routes/api/options.ts | 9 --------- apps/server/src/routes/routes.ts | 1 - apps/server/tsconfig.app.json | 3 --- apps/server/tsconfig.json | 3 --- 5 files changed, 10 insertions(+), 24 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts b/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts index f56aff682..52818e11b 100644 --- a/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts +++ b/apps/client/src/widgets/type_widgets/options/code_notes/code_theme.ts @@ -4,6 +4,7 @@ import server from "../../../../services/server"; import CodeMirror, { getThemeById } from "@triliumnext/codemirror"; import { DEFAULT_PREFIX } from "../../abstract_code_type_widget"; import { t } from "../../../../services/i18n"; +import { ColorThemes } from "@triliumnext/codemirror"; // TODO: Deduplicate interface Theme { @@ -129,6 +130,15 @@ export default class CodeTheme extends OptionsWidget { const newTheme = String(this.$themeSelect.val()); await server.put(`options/codeNoteTheme/${newTheme}`); }); + + // Populate the list of themes. + for (const theme of ColorThemes) { + const option = $("