Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e953c320fb | ||
|
|
a4fe43572b | ||
|
|
732e44b6b9 |
+1
-1
@@ -65,7 +65,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@analytics/google-analytics": "1.0.3",
|
"@analytics/google-analytics": "1.0.3",
|
||||||
"@macfja/svelte-persistent-store": "1.3.0",
|
"@macfja/svelte-persistent-store": "2.0.0",
|
||||||
"analytics": "0.8.1",
|
"analytics": "0.8.1",
|
||||||
"analytics-plugin-plausible": "^0.0.6",
|
"analytics-plugin-plausible": "^0.0.6",
|
||||||
"daisyui": "2.24.0",
|
"daisyui": "2.24.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { derived, writable, get } from 'svelte/store';
|
import { derived, writable, get } from 'svelte/store';
|
||||||
import type { Readable, Writable } from 'svelte/store';
|
import type { Readable, Writable } from 'svelte/store';
|
||||||
import { persist, localStorage } from '@macfja/svelte-persistent-store';
|
import { persist, createLocalStorage } from '@macfja/svelte-persistent-store';
|
||||||
import { generateSlug } from 'random-word-slugs';
|
import { generateSlug } from 'random-word-slugs';
|
||||||
import type { HistoryEntry, HistoryType, Optional } from '$lib/types';
|
import type { HistoryEntry, HistoryType, Optional } from '$lib/types';
|
||||||
import { v4 as uuidV4 } from 'uuid';
|
import { v4 as uuidV4 } from 'uuid';
|
||||||
@@ -10,19 +10,19 @@ const MAX_AUTO_HISTORY_LENGTH = 30;
|
|||||||
|
|
||||||
export const historyModeStore: Writable<HistoryType> = persist(
|
export const historyModeStore: Writable<HistoryType> = persist(
|
||||||
writable('manual'),
|
writable('manual'),
|
||||||
localStorage(),
|
createLocalStorage(),
|
||||||
'autoHistoryMode'
|
'autoHistoryMode'
|
||||||
);
|
);
|
||||||
|
|
||||||
const autoHistoryStore: Writable<HistoryEntry[]> = persist(
|
const autoHistoryStore: Writable<HistoryEntry[]> = persist(
|
||||||
writable([]),
|
writable([]),
|
||||||
localStorage(),
|
createLocalStorage(),
|
||||||
'autoHistoryStore'
|
'autoHistoryStore'
|
||||||
);
|
);
|
||||||
|
|
||||||
const manualHistoryStore: Writable<HistoryEntry[]> = persist(
|
const manualHistoryStore: Writable<HistoryEntry[]> = persist(
|
||||||
writable([]),
|
writable([]),
|
||||||
localStorage(),
|
createLocalStorage(),
|
||||||
'manualHistoryStore'
|
'manualHistoryStore'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { writable, get, type Writable } from 'svelte/store';
|
import { writable, get, type Writable } from 'svelte/store';
|
||||||
import { persist, localStorage } from '@macfja/svelte-persistent-store';
|
import { persist, createLocalStorage } from '@macfja/svelte-persistent-store';
|
||||||
import { injectHistoryIDs } from '$lib/components/history/history';
|
import { injectHistoryIDs } from '$lib/components/history/history';
|
||||||
import { logEvent } from './stats';
|
import { logEvent } from './stats';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ const migrations: { [key: string]: () => void } = {
|
|||||||
|
|
||||||
const migrationStore: Writable<MigrationState> = persist(
|
const migrationStore: Writable<MigrationState> = persist(
|
||||||
writable({ version: -1 }),
|
writable({ version: -1 }),
|
||||||
localStorage(),
|
createLocalStorage(),
|
||||||
'migrations'
|
'migrations'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { writable, get, derived } from 'svelte/store';
|
import { writable, get, derived } from 'svelte/store';
|
||||||
import { persist, localStorage } from '@macfja/svelte-persistent-store';
|
import { persist, createLocalStorage } from '@macfja/svelte-persistent-store';
|
||||||
import { saveStatistics } from './stats';
|
import { saveStatistics } from './stats';
|
||||||
import { serializeState, deserializeState } from './serde';
|
import { serializeState, deserializeState } from './serde';
|
||||||
import { cmdKey } from './util';
|
import { cmdKey } from './util';
|
||||||
@@ -40,7 +40,7 @@ const urlParseFailedState = `graph TD
|
|||||||
click D href "https://github.com/mermaid-js/mermaid-live-editor/issues/new?assignees=&labels=bug&template=bug_report.md&title=Broken%20link" "Raise issue"`;
|
click D href "https://github.com/mermaid-js/mermaid-live-editor/issues/new?assignees=&labels=bug&template=bug_report.md&title=Broken%20link" "Raise issue"`;
|
||||||
|
|
||||||
// inputStateStore handles all updates and is shared externally when exporting via URL, History, etc.
|
// inputStateStore handles all updates and is shared externally when exporting via URL, History, etc.
|
||||||
export const inputStateStore = persist(writable(defaultState), localStorage(), 'codeStore');
|
export const inputStateStore = persist(writable(defaultState), createLocalStorage(), 'codeStore');
|
||||||
|
|
||||||
// All internal reads should be done via stateStore, but it should not be persisted/shared externally.
|
// All internal reads should be done via stateStore, but it should not be persisted/shared externally.
|
||||||
export const stateStore: Readable<ValidatedState> = derived([inputStateStore], ([state]) => {
|
export const stateStore: Readable<ValidatedState> = derived([inputStateStore], ([state]) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
import type { Writable } from 'svelte/store';
|
import type { Writable } from 'svelte/store';
|
||||||
import { persist, localStorage } from '@macfja/svelte-persistent-store';
|
import { persist, createLocalStorage } from '@macfja/svelte-persistent-store';
|
||||||
import { logEvent } from './stats';
|
import { logEvent } from './stats';
|
||||||
|
|
||||||
export interface ThemeConfig {
|
export interface ThemeConfig {
|
||||||
@@ -12,7 +12,7 @@ export const themeStore: Writable<ThemeConfig> = persist(
|
|||||||
writable({
|
writable({
|
||||||
isDark: false
|
isDark: false
|
||||||
}),
|
}),
|
||||||
localStorage(),
|
createLocalStorage(),
|
||||||
'themeStore'
|
'themeStore'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -245,13 +245,19 @@
|
|||||||
"@jridgewell/resolve-uri" "^3.0.3"
|
"@jridgewell/resolve-uri" "^3.0.3"
|
||||||
"@jridgewell/sourcemap-codec" "^1.4.10"
|
"@jridgewell/sourcemap-codec" "^1.4.10"
|
||||||
|
|
||||||
"@macfja/svelte-persistent-store@1.3.0":
|
"@macfja/serializer@^1.0.2":
|
||||||
version "1.3.0"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/@macfja/svelte-persistent-store/-/svelte-persistent-store-1.3.0.tgz#e3ef6440cde04657ab77284dacd447b12a89cb1e"
|
resolved "https://registry.yarnpkg.com/@macfja/serializer/-/serializer-1.0.2.tgz#9170d0a298787244d9c9b7d31bbbe64762dd1677"
|
||||||
integrity sha512-3lPsEAFe28zCNTyA+/pYfUgzRrH6KZvoG0i4IHVhYOs3Xzaqg9hN7LdHa+Qrv7GncXn/6XhDEpb36hB0f7CzXA==
|
integrity sha512-ORAF9M5DtarMV6RqZjvVdfsHQ0yTdBDgpA3dFmRBdg/A4TKIwPBjZ9NMjGFQZmJXt/GAHEEMhixu3Rkg5eGWuA==
|
||||||
|
|
||||||
|
"@macfja/svelte-persistent-store@2.0.0":
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@macfja/svelte-persistent-store/-/svelte-persistent-store-2.0.0.tgz#2505e1b0a66966355f26e29b1806aec8954ab4c1"
|
||||||
|
integrity sha512-JX9dre6pFG+lK0GiHefXv9xKEtkSSzHAWsjLj8Kgw/gW5KMzWKaTqvJ0e98Xiv72fzUWWWqgW5Dz5DpHVxbbwA==
|
||||||
dependencies:
|
dependencies:
|
||||||
|
"@macfja/serializer" "^1.0.2"
|
||||||
browser-cookies "^1.2.0"
|
browser-cookies "^1.2.0"
|
||||||
esserializer "^1.3.2"
|
cyrup "^0.8.1"
|
||||||
idb-keyval "^5.1.3"
|
idb-keyval "^5.1.3"
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
@@ -1442,6 +1448,11 @@ cypress@10.6.0:
|
|||||||
untildify "^4.0.0"
|
untildify "^4.0.0"
|
||||||
yauzl "^2.10.0"
|
yauzl "^2.10.0"
|
||||||
|
|
||||||
|
cyrup@^0.8.1:
|
||||||
|
version "0.8.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/cyrup/-/cyrup-0.8.1.tgz#f2be38ea4a6e2f52ebe96731d56c09c2cb8a0f45"
|
||||||
|
integrity sha512-nBtYqOSyaXLlUbr0KzDiHsvR6jqqrJmbyXBUur2dC1axZjlFm+v++2SYFXKMQC+Dj+0ywy+9WJjV8Eu+6vemYQ==
|
||||||
|
|
||||||
d3-array@1, d3-array@^1.1.1, d3-array@^1.2.0:
|
d3-array@1, d3-array@^1.1.1, d3-array@^1.2.0:
|
||||||
version "1.2.4"
|
version "1.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f"
|
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f"
|
||||||
@@ -2573,11 +2584,6 @@ esrecurse@^4.3.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
estraverse "^5.2.0"
|
estraverse "^5.2.0"
|
||||||
|
|
||||||
esserializer@^1.3.2:
|
|
||||||
version "1.3.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/esserializer/-/esserializer-1.3.2.tgz#4788444a7d08108a57ddc6a77602e8c853d3f8da"
|
|
||||||
integrity sha512-48xQjlQ9Wr6dUfjLAC1IQF0bMIk6m62mN7BH0PklRP0NDfm2ISY16EXM8t2Wfc6WcLKser+X8ggeeFwieBkufQ==
|
|
||||||
|
|
||||||
estraverse@^4.1.1:
|
estraverse@^4.1.1:
|
||||||
version "4.3.0"
|
version "4.3.0"
|
||||||
resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz"
|
resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user