🚧 Refactor markdown preview extension

This commit is contained in:
2025-11-30 01:09:31 +08:00
parent 1ef5350b3f
commit 60d1494d45
34 changed files with 3109 additions and 6758 deletions

View File

@@ -6,6 +6,7 @@ import { useConfigStore } from './configStore';
import { useEditorStore } from './editorStore';
import type { ThemeColors } from '@/views/editor/theme/types';
import { cloneThemeColors, FALLBACK_THEME_NAME, themePresetList, themePresetMap } from '@/views/editor/theme/presets';
import { refreshMermaidTheme } from '@/views/editor/extensions/markdown/plugins/mermaid';
type ThemeOption = { name: string; type: ThemeType };
@@ -139,6 +140,9 @@ export const useThemeStore = defineStore('theme', () => {
const refreshEditorTheme = () => {
applyThemeToDOM(currentTheme.value);
// Refresh mermaid diagrams with new theme
refreshMermaidTheme();
const editorStore = useEditorStore();
editorStore?.applyThemeSettings();
};