Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a367bf6499 | ||
|
|
01970da710 | ||
|
|
49b1ecdbfe | ||
|
|
9765dfb41a | ||
|
|
0eb8ba87fd | ||
|
|
b78322321a |
+1
-1
@@ -55,7 +55,7 @@
|
|||||||
"analytics": "^0.8.1",
|
"analytics": "^0.8.1",
|
||||||
"daisyui": "2.15.2",
|
"daisyui": "2.15.2",
|
||||||
"js-base64": "^3.7.2",
|
"js-base64": "^3.7.2",
|
||||||
"mermaid": "9.1.1",
|
"mermaid": "9.1.2",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
"monaco-editor": "^0.33.0",
|
"monaco-editor": "^0.33.0",
|
||||||
"monaco-mermaid": "^1.0.4",
|
"monaco-mermaid": "^1.0.4",
|
||||||
|
|||||||
@@ -103,11 +103,11 @@ export const updateConfig = (config: string, updateEditor: boolean): void => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setDiagramTheme = (theme: 'dark' | 'default' | 'forest'): void => {
|
export const toggleDarkTheme = (dark: boolean): void => {
|
||||||
codeStore.update((state) => {
|
codeStore.update((state) => {
|
||||||
const config = JSON.parse(state.mermaid);
|
const config = JSON.parse(state.mermaid);
|
||||||
if (!config.theme || ['dark', 'default', 'forest'].includes(config.theme)) {
|
if (!config.theme || ['dark', 'default'].includes(config.theme)) {
|
||||||
config.theme = theme;
|
config.theme = dark ? 'dark' : 'default';
|
||||||
}
|
}
|
||||||
|
|
||||||
return { ...state, mermaid: JSON.stringify(config, null, 2), updateEditor: true };
|
return { ...state, mermaid: JSON.stringify(config, null, 2), updateEditor: true };
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { loadingStateStore } from '$lib/util/loading';
|
import { loadingStateStore } from '$lib/util/loading';
|
||||||
import { setTheme, themeStore } from '$lib/util/theme';
|
import { setTheme, themeStore } from '$lib/util/theme';
|
||||||
import { setDiagramTheme } from '$lib/util/state';
|
import { toggleDarkTheme } from '$lib/util/state';
|
||||||
|
|
||||||
// This can be removed once https://github.com/sveltejs/kit/issues/1612 is fixed.
|
// This can be removed once https://github.com/sveltejs/kit/issues/1612 is fixed.
|
||||||
// Then move it into src and vite will bundle it automatically.
|
// Then move it into src and vite will bundle it automatically.
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
themeStore.subscribe(({ theme, isDark }) => {
|
themeStore.subscribe(({ theme, isDark }) => {
|
||||||
if (theme) {
|
if (theme) {
|
||||||
document.getElementsByTagName('html')[0].setAttribute('data-theme', theme);
|
document.getElementsByTagName('html')[0].setAttribute('data-theme', theme);
|
||||||
setDiagramTheme(isDark ? (theme === 'forest' ? 'forest' : 'dark') : 'default');
|
toggleDarkTheme(isDark);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -728,9 +728,9 @@ caniuse-api@^3.0.0:
|
|||||||
lodash.uniq "^4.5.0"
|
lodash.uniq "^4.5.0"
|
||||||
|
|
||||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335:
|
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335:
|
||||||
version "1.0.30001352"
|
version "1.0.30001354"
|
||||||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001352.tgz"
|
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001354.tgz"
|
||||||
integrity sha512-GUgH8w6YergqPQDGWhJGt8GDRnY0L/iJVQcU3eJ46GYf52R8tk0Wxp0PymuFVZboJYXGiCqwozAYZNRjVj6IcA==
|
integrity sha512-mImKeCkyGDAHNywYFA4bqnLAzTUvVkqPvhY4DV47X+Gl2c5Z8c3KNETnXp14GQt11LvxE8AwjzGxJ+rsikiOzg==
|
||||||
|
|
||||||
caseless@~0.12.0:
|
caseless@~0.12.0:
|
||||||
version "0.12.0"
|
version "0.12.0"
|
||||||
@@ -1810,10 +1810,10 @@ domhandler@^4.3.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
domelementtype "^2.2.0"
|
domelementtype "^2.2.0"
|
||||||
|
|
||||||
dompurify@2.3.6:
|
dompurify@2.3.8:
|
||||||
version "2.3.6"
|
version "2.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.6.tgz#2e019d7d7617aacac07cbbe3d88ae3ad354cf875"
|
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.8.tgz#224fe9ae57d7ebd9a1ae1ac18c1c1ca3f532226f"
|
||||||
integrity sha512-OFP2u/3T1R5CEgWCEONuJ1a5+MFKnOYpkywpUSxv/dj1LeBT1erK+JwM7zK0ROy2BRhqVCf0LRw/kHqKuMkVGg==
|
integrity sha512-eVhaWoVibIzqdGYjwsBWodIQIaXFSB+cKDf4cfxLMsK0xiud6SE+/WCVx/Xw/UwQsa4cS3T2eITcdtmTg2UKcw==
|
||||||
|
|
||||||
domutils@^2.8.0:
|
domutils@^2.8.0:
|
||||||
version "2.8.0"
|
version "2.8.0"
|
||||||
@@ -3109,16 +3109,16 @@ merge2@^1.3.0:
|
|||||||
resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz"
|
resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz"
|
||||||
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
||||||
|
|
||||||
mermaid@9.1.1:
|
mermaid@9.1.2:
|
||||||
version "9.1.1"
|
version "9.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-9.1.1.tgz#5d3d330ca4adf7f3c8ca51095f8bb2f0fb1a93bb"
|
resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-9.1.2.tgz#98cdc55603464240987fe1a15f68dd06304c07f1"
|
||||||
integrity sha512-2RVD+WkzZ4VDyO9gQvQAuQ/ux2gLigJtKDTlbwjYqOR/NwsVzTSfGm/kx648/qWJsg6Sv04tE9BWCO8s6a+pFA==
|
integrity sha512-RVf3hBKqiMfyORHboCaEjOAK1TomLO50hYRPvlTrZCXlCniM5pRpe8UlkHBjjpaLtioZnbdYv/vEVj7iKnwkJQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@braintree/sanitize-url" "^6.0.0"
|
"@braintree/sanitize-url" "^6.0.0"
|
||||||
d3 "^7.0.0"
|
d3 "^7.0.0"
|
||||||
dagre "^0.8.5"
|
dagre "^0.8.5"
|
||||||
dagre-d3 "^0.6.4"
|
dagre-d3 "^0.6.4"
|
||||||
dompurify "2.3.6"
|
dompurify "2.3.8"
|
||||||
graphlib "^2.1.8"
|
graphlib "^2.1.8"
|
||||||
khroma "^2.0.0"
|
khroma "^2.0.0"
|
||||||
moment-mini "^2.24.0"
|
moment-mini "^2.24.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user