@fuzdev/fuz_ui 0.188.0 → 0.189.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/ColorSchemeInput.svelte +4 -2
- package/dist/ColorSchemeInput.svelte.d.ts.map +1 -1
- package/dist/ContextmenuEntry.svelte +4 -2
- package/dist/ContextmenuEntry.svelte.d.ts.map +1 -1
- package/dist/ContextmenuLinkEntry.svelte +4 -2
- package/dist/ContextmenuLinkEntry.svelte.d.ts.map +1 -1
- package/dist/ContextmenuRoot.svelte +1 -9
- package/dist/ContextmenuRoot.svelte.d.ts +0 -8
- package/dist/ContextmenuRoot.svelte.d.ts.map +1 -1
- package/dist/ContextmenuRootForSafariCompatibility.svelte +1 -9
- package/dist/ContextmenuRootForSafariCompatibility.svelte.d.ts +0 -8
- package/dist/ContextmenuRootForSafariCompatibility.svelte.d.ts.map +1 -1
- package/dist/ContextmenuSubmenu.svelte +6 -4
- package/dist/ContextmenuSubmenu.svelte.d.ts.map +1 -1
- package/dist/Docs.svelte +2 -2
- package/dist/LibraryDetail.svelte +7 -7
- package/dist/LibraryDetail.svelte.d.ts +1 -1
- package/dist/LibraryDetail.svelte.d.ts.map +1 -1
- package/dist/LibrarySummary.svelte +7 -7
- package/dist/LibrarySummary.svelte.d.ts +1 -1
- package/dist/LibrarySummary.svelte.d.ts.map +1 -1
- package/dist/PendingButton.svelte +0 -3
- package/dist/PendingButton.svelte.d.ts +0 -3
- package/dist/PendingButton.svelte.d.ts.map +1 -1
- package/dist/Redirect.svelte +6 -8
- package/dist/Redirect.svelte.d.ts +2 -5
- package/dist/Redirect.svelte.d.ts.map +1 -1
- package/dist/ThemeInput.svelte +4 -2
- package/dist/ThemeInput.svelte.d.ts.map +1 -1
- package/dist/{Themed.svelte → ThemeRoot.svelte} +22 -21
- package/dist/{Themed.svelte.d.ts → ThemeRoot.svelte.d.ts} +11 -10
- package/dist/ThemeRoot.svelte.d.ts.map +1 -0
- package/dist/TomeContent.svelte +1 -1
- package/dist/TomeHeader.svelte +8 -9
- package/dist/TomeHeader.svelte.d.ts.map +1 -1
- package/dist/TomeSection.svelte +7 -6
- package/dist/TomeSection.svelte.d.ts +1 -1
- package/dist/TomeSection.svelte.d.ts.map +1 -1
- package/dist/TomeSectionHeader.svelte +7 -11
- package/dist/TomeSectionHeader.svelte.d.ts +1 -1
- package/dist/TomeSectionHeader.svelte.d.ts.map +1 -1
- package/dist/contextmenu_state.svelte.d.ts +3 -3
- package/dist/contextmenu_state.svelte.d.ts.map +1 -1
- package/dist/library.svelte.d.ts +1 -1
- package/dist/mdz_lexer.js +2 -2
- package/dist/{themer.svelte.d.ts → theme_state.svelte.d.ts} +10 -10
- package/dist/theme_state.svelte.d.ts.map +1 -0
- package/dist/{themer.svelte.js → theme_state.svelte.js} +3 -3
- package/dist/tome.d.ts +6 -62
- package/dist/tome.d.ts.map +1 -1
- package/dist/tome.js +2 -2
- package/package.json +4 -3
- package/src/lib/contextmenu_state.svelte.ts +1 -1
- package/src/lib/mdz_lexer.ts +4 -4
- package/src/lib/{themer.svelte.ts → theme_state.svelte.ts} +7 -7
- package/src/lib/tome.ts +4 -4
- package/dist/Themed.svelte.d.ts.map +0 -1
- package/dist/themer.svelte.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -59,10 +59,10 @@ import '@fuzdev/fuz_css/theme.css'; // or bring your own
|
|
|
59
59
|
import '$routes/fuz.css';
|
|
60
60
|
|
|
61
61
|
// then import Fuz Svelte components:
|
|
62
|
-
import
|
|
62
|
+
import ThemeRoot from '@fuzdev/fuz_ui/ThemeRoot.svelte';
|
|
63
63
|
|
|
64
64
|
// and Fuz TypeScript modules:
|
|
65
|
-
import {type Theme,
|
|
65
|
+
import {type Theme, theme_state_context} from '@fuzdev/fuz_ui/theme_state.svelte.js';
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
See [the library](https://ui.fuz.dev/docs) for more.
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
import {color_schemes, type ColorScheme} from '@fuzdev/fuz_css/theme.js';
|
|
4
4
|
import type {SvelteHTMLElements} from 'svelte/elements';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {theme_state_context} from './theme_state.svelte.js';
|
|
7
|
+
|
|
8
|
+
const get_theme_state = theme_state_context.get();
|
|
7
9
|
|
|
8
10
|
const {
|
|
9
|
-
value =
|
|
11
|
+
value = get_theme_state(),
|
|
10
12
|
...rest
|
|
11
13
|
}: SvelteHTMLElements['menu'] & {
|
|
12
14
|
value?: {color_scheme: ColorScheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSchemeInput.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ColorSchemeInput.svelte"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAIvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG;IACrD,KAAK,CAAC,EAAE;QAAC,YAAY,EAAE,WAAW,CAAA;KAAC,CAAC;CACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorSchemeInput.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ColorSchemeInput.svelte"],"names":[],"mappings":"AAIA,OAAO,EAAgB,KAAK,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAIvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG;IACrD,KAAK,CAAC,EAAE;QAAC,YAAY,EAAE,WAAW,CAAA;KAAC,CAAC;CACpC,CAAC;AAmCH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
} = $props();
|
|
19
19
|
|
|
20
|
-
const
|
|
20
|
+
const get_contextmenu = contextmenu_context.get();
|
|
21
|
+
const contextmenu = $derived(get_contextmenu());
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
// add_entry registers on the current instance at init — not reactive to contextmenu getter changes
|
|
24
|
+
const entry = get_contextmenu().add_entry(
|
|
23
25
|
() => run,
|
|
24
26
|
() => disabled_prop,
|
|
25
27
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAIpC,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAEtF,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAIpC,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAEtF,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA2DH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -20,13 +20,15 @@
|
|
|
20
20
|
external_rel?: string;
|
|
21
21
|
} = $props();
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const get_contextmenu = contextmenu_context.get();
|
|
24
|
+
const contextmenu = $derived(get_contextmenu());
|
|
24
25
|
|
|
25
26
|
let anchor_el: HTMLAnchorElement | undefined = $state();
|
|
26
27
|
|
|
27
28
|
// Register with state management for keyboard navigation
|
|
28
29
|
// When activated via keyboard, programmatically click the anchor to trigger navigation
|
|
29
|
-
|
|
30
|
+
// add_entry registers on the current instance at init — not reactive to contextmenu getter changes
|
|
31
|
+
const entry = get_contextmenu().add_entry(
|
|
30
32
|
() => () => {
|
|
31
33
|
if (anchor_el) anchor_el.click();
|
|
32
34
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuLinkEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuLinkEntry.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKnC,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuLinkEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuLinkEntry.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKnC,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAkFH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
|
|
@@ -55,14 +55,6 @@
|
|
|
55
55
|
separator_entry = separator_entry_default,
|
|
56
56
|
children,
|
|
57
57
|
}: {
|
|
58
|
-
/**
|
|
59
|
-
* The `contextmenu` prop is not reactive because that's a rare corner case and
|
|
60
|
-
* it's easier to put the `contextmenu` directly in the context
|
|
61
|
-
* rather than wrapping with a store or other reactivity.
|
|
62
|
-
* If you need to change the contextmenu prop for some reason, use a `{#key contextmenu}` block:
|
|
63
|
-
* https://svelte.dev/docs#template-syntax-key
|
|
64
|
-
* @nonreactive
|
|
65
|
-
*/
|
|
66
58
|
contextmenu?: ContextmenuState;
|
|
67
59
|
/**
|
|
68
60
|
* The number of pixels to offset from the pointer X position when opened.
|
|
@@ -117,7 +109,7 @@
|
|
|
117
109
|
children: Snippet;
|
|
118
110
|
} = $props();
|
|
119
111
|
|
|
120
|
-
contextmenu_context.set(contextmenu);
|
|
112
|
+
contextmenu_context.set(() => contextmenu);
|
|
121
113
|
|
|
122
114
|
if (DEV) contextmenu_check_global_root(() => scoped); // TODO @many is this import tree-shaken?
|
|
123
115
|
|
|
@@ -4,14 +4,6 @@ import ContextmenuLinkEntry from './ContextmenuLinkEntry.svelte';
|
|
|
4
4
|
import ContextmenuTextEntry from './ContextmenuTextEntry.svelte';
|
|
5
5
|
import ContextmenuSeparator from './ContextmenuSeparator.svelte';
|
|
6
6
|
type $$ComponentProps = {
|
|
7
|
-
/**
|
|
8
|
-
* The `contextmenu` prop is not reactive because that's a rare corner case and
|
|
9
|
-
* it's easier to put the `contextmenu` directly in the context
|
|
10
|
-
* rather than wrapping with a store or other reactivity.
|
|
11
|
-
* If you need to change the contextmenu prop for some reason, use a `{#key contextmenu}` block:
|
|
12
|
-
* https://svelte.dev/docs#template-syntax-key
|
|
13
|
-
* @nonreactive
|
|
14
|
-
*/
|
|
15
7
|
contextmenu?: ContextmenuState;
|
|
16
8
|
/**
|
|
17
9
|
* The number of pixels to offset from the pointer X position when opened.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuRoot.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuRoot.svelte"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAC,cAAc,EAAE,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAGL,gBAAgB,EAGhB,MAAM,+BAA+B,CAAC;AACxC,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AAahE,KAAK,gBAAgB,GAAI;IACxB
|
|
1
|
+
{"version":3,"file":"ContextmenuRoot.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuRoot.svelte"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAC,cAAc,EAAE,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAGL,gBAAgB,EAGhB,MAAM,+BAA+B,CAAC;AACxC,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AAahE,KAAK,gBAAgB,GAAI;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC3E;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC3E;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAChF,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAsOH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -61,14 +61,6 @@
|
|
|
61
61
|
separator_entry = separator_entry_default,
|
|
62
62
|
children,
|
|
63
63
|
}: {
|
|
64
|
-
/**
|
|
65
|
-
* The `contextmenu` prop is not reactive because that's a rare corner case and
|
|
66
|
-
* it's easier to put the `contextmenu` directly in the context
|
|
67
|
-
* rather than wrapping with a store or other reactivity.
|
|
68
|
-
* If you need to change the contextmenu prop for some reason, use a `{#key contextmenu}` block:
|
|
69
|
-
* https://svelte.dev/docs#template-syntax-key
|
|
70
|
-
* @nonreactive
|
|
71
|
-
*/
|
|
72
64
|
contextmenu?: ContextmenuState;
|
|
73
65
|
/**
|
|
74
66
|
* The number of pixels the pointer can be moved without canceling `longpress`.
|
|
@@ -131,7 +123,7 @@
|
|
|
131
123
|
children: Snippet;
|
|
132
124
|
} = $props();
|
|
133
125
|
|
|
134
|
-
contextmenu_context.set(contextmenu);
|
|
126
|
+
contextmenu_context.set(() => contextmenu);
|
|
135
127
|
|
|
136
128
|
if (DEV) contextmenu_check_global_root(() => scoped); // TODO @many is this import tree-shaken?
|
|
137
129
|
|
|
@@ -4,14 +4,6 @@ import ContextmenuLinkEntry from './ContextmenuLinkEntry.svelte';
|
|
|
4
4
|
import ContextmenuTextEntry from './ContextmenuTextEntry.svelte';
|
|
5
5
|
import ContextmenuSeparator from './ContextmenuSeparator.svelte';
|
|
6
6
|
type $$ComponentProps = {
|
|
7
|
-
/**
|
|
8
|
-
* The `contextmenu` prop is not reactive because that's a rare corner case and
|
|
9
|
-
* it's easier to put the `contextmenu` directly in the context
|
|
10
|
-
* rather than wrapping with a store or other reactivity.
|
|
11
|
-
* If you need to change the contextmenu prop for some reason, use a `{#key contextmenu}` block:
|
|
12
|
-
* https://svelte.dev/docs#template-syntax-key
|
|
13
|
-
* @nonreactive
|
|
14
|
-
*/
|
|
15
7
|
contextmenu?: ContextmenuState;
|
|
16
8
|
/**
|
|
17
9
|
* The number of pixels the pointer can be moved without canceling `longpress`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuRootForSafariCompatibility.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuRootForSafariCompatibility.svelte"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAC,cAAc,EAAE,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAGL,gBAAgB,EAGhB,MAAM,+BAA+B,CAAC;AACxC,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AAehE,KAAK,gBAAgB,GAAI;IACxB
|
|
1
|
+
{"version":3,"file":"ContextmenuRootForSafariCompatibility.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuRootForSafariCompatibility.svelte"],"names":[],"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AC;AACtG,eAAe,qCAAqC,CAAC"}
|
|
@@ -15,13 +15,15 @@
|
|
|
15
15
|
children: Snippet;
|
|
16
16
|
} = $props();
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const get_contextmenu = contextmenu_context.get();
|
|
19
|
+
const contextmenu = $derived(get_contextmenu());
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
// add_submenu registers on the current instance at init — not reactive to contextmenu getter changes
|
|
22
|
+
const submenu = get_contextmenu().add_submenu();
|
|
21
23
|
|
|
22
|
-
const {layout} = contextmenu;
|
|
24
|
+
const {layout} = $derived(contextmenu);
|
|
23
25
|
|
|
24
|
-
const selected = $derived(submenu
|
|
26
|
+
const {selected} = $derived(submenu);
|
|
25
27
|
|
|
26
28
|
let el: HTMLElement | undefined = $state();
|
|
27
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuSubmenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuSubmenu.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAMnC,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuSubmenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuSubmenu.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAMnC,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAoFH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
package/dist/Docs.svelte
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
} = $props();
|
|
28
28
|
|
|
29
29
|
// TODO this API is messy, inconsistent usage of props/context
|
|
30
|
-
const tomes_by_name = new Map(tomes.map((t) => [t.name, t]));
|
|
31
|
-
tomes_context.set(tomes_by_name);
|
|
30
|
+
const tomes_by_name = $derived(new Map(tomes.map((t) => [t.name, t])));
|
|
31
|
+
tomes_context.set(() => tomes_by_name);
|
|
32
32
|
|
|
33
33
|
// TODO @many dialog navs - this is messy to satisfy SSR with the current design that puts the secondary nav in a dialog
|
|
34
34
|
const TERTIARY_NAV_BREAKPOINT = 1000;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
library,
|
|
20
20
|
repo_name,
|
|
21
21
|
description,
|
|
22
|
-
|
|
22
|
+
tagline,
|
|
23
23
|
npm_url,
|
|
24
24
|
homepage_url,
|
|
25
25
|
children,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
library: Library;
|
|
28
28
|
repo_name?: Snippet<[repo_name: string]>;
|
|
29
29
|
description?: Snippet<[description: string]>;
|
|
30
|
-
|
|
30
|
+
tagline?: Snippet<[description: string]>;
|
|
31
31
|
npm_url?: Snippet<[npm_url: string]>;
|
|
32
32
|
homepage_url?: Snippet<[homepage_url: string]>;
|
|
33
33
|
children?: Snippet<[library: Library]>;
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
<div class="description">{package_json.description}</div>
|
|
69
69
|
{/if}
|
|
70
70
|
{/if}
|
|
71
|
-
{#if package_json.
|
|
72
|
-
{#if
|
|
73
|
-
{@render
|
|
71
|
+
{#if package_json.tagline}
|
|
72
|
+
{#if tagline}
|
|
73
|
+
{@render tagline(package_json.tagline)}
|
|
74
74
|
{:else}
|
|
75
|
-
<div class="
|
|
75
|
+
<div class="tagline">{package_json.tagline}</div>
|
|
76
76
|
{/if}
|
|
77
77
|
{/if}
|
|
78
78
|
{#if library.npm_url}
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
.description {
|
|
246
246
|
margin-bottom: var(--space_lg);
|
|
247
247
|
}
|
|
248
|
-
.
|
|
248
|
+
.tagline {
|
|
249
249
|
margin-bottom: var(--space_lg);
|
|
250
250
|
}
|
|
251
251
|
.properties {
|
|
@@ -4,7 +4,7 @@ type $$ComponentProps = {
|
|
|
4
4
|
library: Library;
|
|
5
5
|
repo_name?: Snippet<[repo_name: string]>;
|
|
6
6
|
description?: Snippet<[description: string]>;
|
|
7
|
-
|
|
7
|
+
tagline?: Snippet<[description: string]>;
|
|
8
8
|
npm_url?: Snippet<[npm_url: string]>;
|
|
9
9
|
homepage_url?: Snippet<[homepage_url: string]>;
|
|
10
10
|
children?: Snippet<[library: Library]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibraryDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibraryDetail.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAYhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,
|
|
1
|
+
{"version":3,"file":"LibraryDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibraryDetail.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAYhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;CACvC,CAAC;AAuKH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
library,
|
|
11
11
|
repo_name,
|
|
12
12
|
logo,
|
|
13
|
-
|
|
13
|
+
tagline,
|
|
14
14
|
description,
|
|
15
15
|
npm_url,
|
|
16
16
|
homepage_url,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
library: Library;
|
|
20
20
|
repo_name?: Snippet<[repo_name: string]>;
|
|
21
21
|
logo?: Snippet<[logo_url: string, logo_alt: string]>;
|
|
22
|
-
|
|
22
|
+
tagline?: Snippet<[tagline: string, glyph?: string]>;
|
|
23
23
|
description?: Snippet<[description: string, glyph?: string]>;
|
|
24
24
|
npm_url?: Snippet<[npm_url: string]>;
|
|
25
25
|
homepage_url?: Snippet<[homepage_url: string]>;
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
{/if}
|
|
52
52
|
{/if}
|
|
53
53
|
</header>
|
|
54
|
-
{#if package_json.
|
|
55
|
-
{#if
|
|
56
|
-
{@render
|
|
54
|
+
{#if package_json.tagline}
|
|
55
|
+
{#if tagline}
|
|
56
|
+
{@render tagline(package_json.tagline, package_json.glyph)}
|
|
57
57
|
{:else}
|
|
58
58
|
<p class="panel py_md px_xl">
|
|
59
|
-
{package_json.
|
|
59
|
+
{package_json.tagline}
|
|
60
60
|
{package_json.glyph}
|
|
61
61
|
</p>
|
|
62
62
|
{/if}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
{:else}
|
|
68
68
|
<p class="text-align:center">
|
|
69
69
|
{package_json.description}
|
|
70
|
-
{#if !package_json.
|
|
70
|
+
{#if !package_json.tagline}
|
|
71
71
|
{package_json.glyph}
|
|
72
72
|
{/if}
|
|
73
73
|
</p>
|
|
@@ -4,7 +4,7 @@ type $$ComponentProps = {
|
|
|
4
4
|
library: Library;
|
|
5
5
|
repo_name?: Snippet<[repo_name: string]>;
|
|
6
6
|
logo?: Snippet<[logo_url: string, logo_alt: string]>;
|
|
7
|
-
|
|
7
|
+
tagline?: Snippet<[tagline: string, glyph?: string]>;
|
|
8
8
|
description?: Snippet<[description: string, glyph?: string]>;
|
|
9
9
|
npm_url?: Snippet<[npm_url: string]>;
|
|
10
10
|
homepage_url?: Snippet<[homepage_url: string]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibrarySummary.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibrarySummary.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,
|
|
1
|
+
{"version":3,"file":"LibrarySummary.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibrarySummary.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA2GH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -2,10 +2,7 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
3
3
|
type $$ComponentProps = SvelteHTMLElements['button'] & {
|
|
4
4
|
pending: boolean;
|
|
5
|
-
onclick: () => void;
|
|
6
5
|
running?: boolean;
|
|
7
|
-
title?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
6
|
animation?: Snippet;
|
|
10
7
|
children: Snippet;
|
|
11
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingButton.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,
|
|
1
|
+
{"version":3,"file":"PendingButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingButton.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA4CH,QAAA,MAAM,aAAa;sBAxBQ,YAAY,KAAG,IAAI;MAwBa,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
package/dist/Redirect.svelte
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import {page} from '$app/state';
|
|
3
3
|
import {strip_start} from '@fuzdev/fuz_util/string.js';
|
|
4
4
|
import {goto} from '$app/navigation';
|
|
5
|
-
import type
|
|
6
|
-
import {BROWSER} from 'esm-env';
|
|
5
|
+
import {onMount, type Snippet} from 'svelte';
|
|
7
6
|
|
|
8
7
|
const {
|
|
9
8
|
host = '',
|
|
@@ -12,26 +11,25 @@
|
|
|
12
11
|
children,
|
|
13
12
|
}: {
|
|
14
13
|
/**
|
|
15
|
-
* The target host to redirect to. Defaults to
|
|
16
|
-
* @nonreactive
|
|
14
|
+
* The target host to redirect to. Defaults to `''` (relative URL).
|
|
17
15
|
*/
|
|
18
16
|
host?: string;
|
|
19
17
|
/**
|
|
20
18
|
* The target path to redirect to. Defaults to the current `location.pathname`.
|
|
21
|
-
* @nonreactive
|
|
22
19
|
*/
|
|
23
20
|
path?: string;
|
|
24
21
|
/**
|
|
25
22
|
* Should the redirect happen automatically without user input? Defaults to `true`.
|
|
26
|
-
* @nonreactive
|
|
27
23
|
*/
|
|
28
24
|
auto?: boolean;
|
|
29
25
|
children?: Snippet<[url: string]>;
|
|
30
26
|
} = $props();
|
|
31
27
|
|
|
32
|
-
const url = host + path;
|
|
28
|
+
const url = $derived(host + path);
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
onMount(() => {
|
|
31
|
+
if (auto) void goto(url, {replaceState: true}); // eslint-disable-line svelte/no-navigation-without-resolve
|
|
32
|
+
});
|
|
35
33
|
</script>
|
|
36
34
|
|
|
37
35
|
<svelte:head>
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
/**
|
|
4
|
-
* The target host to redirect to. Defaults to
|
|
5
|
-
* @nonreactive
|
|
4
|
+
* The target host to redirect to. Defaults to `''` (relative URL).
|
|
6
5
|
*/
|
|
7
6
|
host?: string;
|
|
8
7
|
/**
|
|
9
8
|
* The target path to redirect to. Defaults to the current `location.pathname`.
|
|
10
|
-
* @nonreactive
|
|
11
9
|
*/
|
|
12
10
|
path?: string;
|
|
13
11
|
/**
|
|
14
12
|
* Should the redirect happen automatically without user input? Defaults to `true`.
|
|
15
|
-
* @nonreactive
|
|
16
13
|
*/
|
|
17
14
|
auto?: boolean;
|
|
18
15
|
children?: Snippet<[url: string]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Redirect.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Redirect.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Redirect.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Redirect.svelte"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAE5C,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;CAClC,CAAC;AAgCH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
package/dist/ThemeInput.svelte
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
import {default_themes} from '@fuzdev/fuz_css/themes.js';
|
|
5
5
|
import type {SvelteHTMLElements} from 'svelte/elements';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {theme_state_context} from './theme_state.svelte.js';
|
|
8
|
+
|
|
9
|
+
const get_theme_state = theme_state_context.get();
|
|
8
10
|
|
|
9
11
|
const {
|
|
10
|
-
selected_theme =
|
|
12
|
+
selected_theme = get_theme_state(),
|
|
11
13
|
themes = default_themes,
|
|
12
14
|
enable_editing = false,
|
|
13
15
|
select = (theme) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeInput.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ThemeInput.sv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C,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAChC,CAAC;AAmDH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
sync_color_scheme as default_sync_color_scheme,
|
|
15
15
|
save_theme as default_save_theme,
|
|
16
16
|
load_theme as default_load_theme,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} from './
|
|
17
|
+
theme_state_context,
|
|
18
|
+
ThemeState,
|
|
19
|
+
} from './theme_state.svelte.js';
|
|
20
20
|
import {effect_with_count} from './rune_helpers.svelte.js';
|
|
21
21
|
|
|
22
22
|
const {
|
|
@@ -26,8 +26,10 @@
|
|
|
26
26
|
load_theme = default_load_theme,
|
|
27
27
|
save_theme = default_save_theme,
|
|
28
28
|
theme_fallback,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
theme_state = new ThemeState({
|
|
30
|
+
theme: load_theme(theme_fallback),
|
|
31
|
+
color_scheme: load_color_scheme(),
|
|
32
|
+
}),
|
|
31
33
|
children,
|
|
32
34
|
}: {
|
|
33
35
|
sync_color_scheme?: typeof default_sync_color_scheme;
|
|
@@ -39,19 +41,18 @@
|
|
|
39
41
|
/**
|
|
40
42
|
* A reactive class containing the selected theme and color scheme.
|
|
41
43
|
* Defaults to the first default theme.
|
|
42
|
-
* The class reference is not reactive
|
|
43
|
-
* because it's set in context without a wrapper, use `{#key theme}` if it changes.
|
|
44
|
-
* @nonreactive
|
|
45
44
|
*/
|
|
46
|
-
|
|
47
|
-
children: Snippet<
|
|
45
|
+
theme_state?: ThemeState;
|
|
46
|
+
children: Snippet<
|
|
47
|
+
[theme_state: ThemeState, style: string | null, theme_style_html: string | null]
|
|
48
|
+
>;
|
|
48
49
|
} = $props();
|
|
49
50
|
|
|
50
|
-
// In dev mode only, warn about misuse of the singleton `
|
|
51
|
+
// In dev mode only, warn about misuse of the singleton `ThemeRoot`.
|
|
51
52
|
if (DEV) {
|
|
52
53
|
onMount(() => {
|
|
53
54
|
if (mounted) {
|
|
54
|
-
console.warn('more than one
|
|
55
|
+
console.warn('more than one ThemeRoot was mounted'); // eslint-disable-line no-console
|
|
55
56
|
}
|
|
56
57
|
mounted = true;
|
|
57
58
|
return () => {
|
|
@@ -61,34 +62,34 @@
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
|
-
* `
|
|
65
|
-
* It also sets in the Svelte context a reactive `
|
|
65
|
+
* `ThemeRoot` adds global color scheme and theme support to the page.
|
|
66
|
+
* It also sets in the Svelte context a reactive `theme_state` containing the theme and color scheme.
|
|
66
67
|
*
|
|
67
68
|
* @module
|
|
68
69
|
*/
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
theme_state_context.set(() => theme_state);
|
|
71
72
|
|
|
72
|
-
const selected_theme_name = $derived(
|
|
73
|
+
const selected_theme_name = $derived(theme_state.theme.name);
|
|
73
74
|
const style = $derived(
|
|
74
75
|
selected_theme_name === DEFAULT_THEME.name // TODO @many proper equality check, won't work when we allow editing, need an id or unique names and a deep equality check
|
|
75
76
|
? null
|
|
76
|
-
: render_theme_style(
|
|
77
|
+
: render_theme_style(theme_state.theme),
|
|
77
78
|
);
|
|
78
79
|
const theme_style_html = $derived(style ? `<style>${style}</style>` : null);
|
|
79
80
|
|
|
80
81
|
effect_with_count((count) => {
|
|
81
|
-
const v =
|
|
82
|
+
const v = theme_state.color_scheme;
|
|
82
83
|
if (count === 1) return;
|
|
83
84
|
sync_color_scheme(v);
|
|
84
85
|
});
|
|
85
86
|
effect_with_count((count) => {
|
|
86
|
-
const v =
|
|
87
|
+
const v = theme_state.color_scheme;
|
|
87
88
|
if (count === 1) return;
|
|
88
89
|
save_color_scheme(v); // helper may change, so is separate from `sync_color_scheme`
|
|
89
90
|
});
|
|
90
91
|
effect_with_count((count) => {
|
|
91
|
-
const v =
|
|
92
|
+
const v = theme_state.theme;
|
|
92
93
|
if (count === 1) return;
|
|
93
94
|
save_theme(v);
|
|
94
95
|
});
|
|
@@ -101,4 +102,4 @@
|
|
|
101
102
|
{#if theme_style_html}{@html theme_style_html}{/if}
|
|
102
103
|
</svelte:head>
|
|
103
104
|
|
|
104
|
-
{@render children(
|
|
105
|
+
{@render children(theme_state, style, theme_style_html)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
2
|
import { type Theme } from '@fuzdev/fuz_css/theme.js';
|
|
3
|
-
import { load_color_scheme as default_load_color_scheme, save_color_scheme as default_save_color_scheme, sync_color_scheme as default_sync_color_scheme, save_theme as default_save_theme, load_theme as default_load_theme,
|
|
3
|
+
import { load_color_scheme as default_load_color_scheme, save_color_scheme as default_save_color_scheme, sync_color_scheme as default_sync_color_scheme, save_theme as default_save_theme, load_theme as default_load_theme, ThemeState } from './theme_state.svelte.js';
|
|
4
4
|
type $$ComponentProps = {
|
|
5
5
|
sync_color_scheme?: typeof default_sync_color_scheme;
|
|
6
6
|
load_color_scheme?: typeof default_load_color_scheme;
|
|
@@ -11,14 +11,15 @@ type $$ComponentProps = {
|
|
|
11
11
|
/**
|
|
12
12
|
* A reactive class containing the selected theme and color scheme.
|
|
13
13
|
* Defaults to the first default theme.
|
|
14
|
-
* The class reference is not reactive
|
|
15
|
-
* because it's set in context without a wrapper, use `{#key theme}` if it changes.
|
|
16
|
-
* @nonreactive
|
|
17
14
|
*/
|
|
18
|
-
|
|
19
|
-
children: Snippet<[
|
|
15
|
+
theme_state?: ThemeState;
|
|
16
|
+
children: Snippet<[
|
|
17
|
+
theme_state: ThemeState,
|
|
18
|
+
style: string | null,
|
|
19
|
+
theme_style_html: string | null
|
|
20
|
+
]>;
|
|
20
21
|
};
|
|
21
|
-
declare const
|
|
22
|
-
type
|
|
23
|
-
export default
|
|
24
|
-
//# sourceMappingURL=
|
|
22
|
+
declare const ThemeRoot: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
23
|
+
type ThemeRoot = ReturnType<typeof ThemeRoot>;
|
|
24
|
+
export default ThemeRoot;
|
|
25
|
+
//# sourceMappingURL=ThemeRoot.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeRoot.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ThemeRoot.svelte"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAqB,KAAK,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAIxE,OAAO,EACL,iBAAiB,IAAI,yBAAyB,EAC9C,iBAAiB,IAAI,yBAAyB,EAC9C,iBAAiB,IAAI,yBAAyB,EAC9C,UAAU,IAAI,kBAAkB,EAChC,UAAU,IAAI,kBAAkB,EAEhC,UAAU,EACV,MAAM,yBAAyB,CAAC;AAGjC,KAAK,gBAAgB,GAAI;IACxB,iBAAiB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACrD,iBAAiB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACrD,iBAAiB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACrD,UAAU,CAAC,EAAE,OAAO,kBAAkB,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,kBAAkB,CAAC;IACvC,cAAc,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,QAAQ,EAAE,OAAO,CAChB;QAAC,WAAW,EAAE,UAAU;QAAE,KAAK,EAAE,MAAM,GAAG,IAAI;QAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI;KAAC,CAChF,CAAC;CACF,CAAC;AAoFH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
package/dist/TomeContent.svelte
CHANGED
package/dist/TomeHeader.svelte
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {page} from '$app/state';
|
|
3
|
-
import {onDestroy} from 'svelte';
|
|
4
3
|
import {DEV} from 'esm-env';
|
|
5
4
|
import type {SvelteHTMLElements} from 'svelte/elements';
|
|
6
5
|
|
|
@@ -11,17 +10,17 @@
|
|
|
11
10
|
// eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
|
|
12
11
|
const props: SvelteHTMLElements['h1'] | SvelteHTMLElements['h2'] = $props();
|
|
13
12
|
|
|
14
|
-
const
|
|
15
|
-
if (DEV && !
|
|
13
|
+
const get_tome = tome_context.get();
|
|
14
|
+
if (DEV && !get_tome) throw Error('TomeHeader expects a tome in context'); // eslint-disable-line @typescript-eslint/no-unnecessary-condition
|
|
15
|
+
const tome = $derived(get_tome());
|
|
16
16
|
|
|
17
17
|
const docs_links = docs_links_context.get();
|
|
18
18
|
|
|
19
|
-
const fragment = docs_slugify(tome.name);
|
|
20
|
-
const path_slug = docs_slugify(tome.name);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
docs_links.remove(id);
|
|
19
|
+
const fragment = $derived(docs_slugify(tome.name));
|
|
20
|
+
const path_slug = $derived(docs_slugify(tome.name));
|
|
21
|
+
$effect(() => {
|
|
22
|
+
const id = docs_links.add(fragment, tome.name, page.url.pathname);
|
|
23
|
+
return () => docs_links.remove(id);
|
|
25
24
|
});
|
|
26
25
|
|
|
27
26
|
const {path, path_is_selected} = $derived(to_docs_path_info(path_slug, page.url.pathname));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TomeHeader.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeHeader.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TomeHeader.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeHeader.svelte"],"names":[],"mappings":"AA0DA,QAAA,MAAM,UAAU,kGAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
package/dist/TomeSection.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import {create_context} from './context_helpers.js';
|
|
3
3
|
|
|
4
|
-
export type RegisterSectionHeader = (
|
|
4
|
+
export type RegisterSectionHeader = (get_fragment: () => string) => string | undefined;
|
|
5
5
|
export const register_section_header_context = create_context<RegisterSectionHeader>();
|
|
6
6
|
export const section_depth_context = create_context(() => 0);
|
|
7
7
|
export const section_id_context = create_context<string | undefined>();
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
// Provide own section ID to direct children (header) via context
|
|
40
40
|
section_id_context.set(section_id);
|
|
41
41
|
|
|
42
|
-
let
|
|
42
|
+
let get_fragment: (() => string) | undefined = $state();
|
|
43
43
|
|
|
44
|
-
register_section_header_context.set((
|
|
45
|
-
if (DEV &&
|
|
44
|
+
register_section_header_context.set((gf) => {
|
|
45
|
+
if (DEV && get_fragment !== undefined) {
|
|
46
46
|
throw Error(
|
|
47
|
-
`TomeSection already has header "${
|
|
47
|
+
`TomeSection already has header "${get_fragment()}", cannot add "${gf()}". Did you forget to wrap a TomeSectionHeader in its own TomeSection?`,
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
get_fragment = gf;
|
|
51
51
|
return parent_section_id; // Return parent section ID to header
|
|
52
52
|
});
|
|
53
53
|
</script>
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
<section
|
|
56
56
|
{...rest}
|
|
57
57
|
{@attach intersect(() => ({intersecting}) => {
|
|
58
|
+
const fragment = get_fragment?.();
|
|
58
59
|
if (!fragment) {
|
|
59
60
|
if (DEV) console.error('TomeSectionHeader must be a child of TomeSection'); // eslint-disable-line no-console
|
|
60
61
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type RegisterSectionHeader = (
|
|
1
|
+
export type RegisterSectionHeader = (get_fragment: () => string) => string | undefined;
|
|
2
2
|
export declare const register_section_header_context: {
|
|
3
3
|
get: (error_message?: string) => RegisterSectionHeader;
|
|
4
4
|
get_maybe: () => RegisterSectionHeader | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TomeSection.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeSection.svelte"],"names":[],"mappings":"AAKC,MAAM,MAAM,qBAAqB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"TomeSection.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeSection.svelte"],"names":[],"mappings":"AAKC,MAAM,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,MAAM,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AACvF,eAAO,MAAM,+BAA+B;;;;CAA0C,CAAC;AACvF,eAAO,MAAM,qBAAqB;;;CAA0B,CAAC;AAC7D,eAAO,MAAM,kBAAkB;;;;CAAuC,CAAC;AAGxE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAMvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG;IACxD,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA+DH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import type {Snippet} from 'svelte';
|
|
3
3
|
import type {SvelteHTMLElements} from 'svelte/elements';
|
|
4
4
|
import {page} from '$app/state';
|
|
5
5
|
import {resolve} from '$app/paths';
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
const my_section_id = section_id_context.get();
|
|
42
42
|
|
|
43
43
|
// Register with parent section to get parent's ID back
|
|
44
|
-
const parent_section_id = register_section_header(fragment);
|
|
44
|
+
const parent_section_id = register_section_header(() => fragment);
|
|
45
45
|
|
|
46
|
-
// Register with docs_links
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
id = docs_links.add(
|
|
46
|
+
// Register with docs_links — re-registers when reactive values change
|
|
47
|
+
$effect(() => {
|
|
48
|
+
if (page.url.pathname === resolve(docs_links.root_path as any)) return;
|
|
49
|
+
const id = docs_links.add(
|
|
50
50
|
fragment,
|
|
51
51
|
text,
|
|
52
52
|
page.url.pathname,
|
|
@@ -55,11 +55,7 @@
|
|
|
55
55
|
parent_section_id,
|
|
56
56
|
my_section_id,
|
|
57
57
|
);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// Cleanup on unmount
|
|
61
|
-
onDestroy(() => {
|
|
62
|
-
if (id) docs_links.remove(id);
|
|
58
|
+
return () => docs_links.remove(id);
|
|
63
59
|
});
|
|
64
60
|
</script>
|
|
65
61
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
3
3
|
import { type DocsLinkTag } from './docs_helpers.svelte.js';
|
|
4
4
|
type $$ComponentProps = // eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TomeSectionHeader.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeSectionHeader.svelte"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"TomeSectionHeader.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeSectionHeader.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAUxD,OAAO,EAAmC,KAAK,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAE3F,KAAK,gBAAgB,GACrB,AADyB,6EAA6E;AACtG,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAsEH,QAAA,MAAM,iBAAiB,sDAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -129,9 +129,9 @@ export interface ContextmenuOpenOptions {
|
|
|
129
129
|
*/
|
|
130
130
|
export declare const contextmenu_open: (target: HTMLElement | SVGElement, x: number, y: number, contextmenu: ContextmenuState, options?: ContextmenuOpenOptions) => boolean;
|
|
131
131
|
export declare const contextmenu_context: {
|
|
132
|
-
get: (error_message?: string) => ContextmenuState;
|
|
133
|
-
get_maybe: () => ContextmenuState | undefined;
|
|
134
|
-
set: (value: ContextmenuState) => ContextmenuState;
|
|
132
|
+
get: (error_message?: string) => () => ContextmenuState;
|
|
133
|
+
get_maybe: () => (() => ContextmenuState) | undefined;
|
|
134
|
+
set: (value: () => ContextmenuState) => () => ContextmenuState;
|
|
135
135
|
};
|
|
136
136
|
export declare const contextmenu_submenu_context: {
|
|
137
137
|
get: (error_message?: string) => SubmenuState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextmenu_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/contextmenu_state.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAC,MAAM,EAAC,MAA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G,IAAI,GAAG,SAAS,KAC1B,UAAU,CAAC,WAAW,GAAG,UAAU,CAiBrC,CAAC;AAIH,MAAM,WAAW,sBAAsB;IACtC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAC5B,QAAQ,WAAW,GAAG,UAAU,EAChC,GAAG,MAAM,EACT,GAAG,MAAM,EACT,aAAa,gBAAgB,EAC7B,UAAU,sBAAsB,KAC9B,OA8BF,CAAC;AAmDF,eAAO,MAAM,mBAAmB;2CAAwB,gBAAgB;4BAAhB,gBAAgB;uBAAhB,gBAAgB,WAAhB,gBAAgB;CAAG,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;CAAiC,CAAC;AAE1E,eAAO,MAAM,8BAA8B;;;CAAyC,CAAC;AAKrF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GAAI,YAAY,MAAM,OAAO,KAAG,IAuBzE,CAAC"}
|
package/dist/library.svelte.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class Library {
|
|
|
28
28
|
version: string;
|
|
29
29
|
private?: boolean | undefined;
|
|
30
30
|
description?: string | undefined;
|
|
31
|
-
|
|
31
|
+
tagline?: string | undefined;
|
|
32
32
|
glyph?: string | undefined;
|
|
33
33
|
logo?: string | undefined;
|
|
34
34
|
logo_alt?: string | undefined;
|
package/dist/mdz_lexer.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { mdz_is_url } from './mdz.js';
|
|
10
10
|
import { is_letter, is_tag_name_char, is_word_char, is_valid_path_char, trim_trailing_punctuation, BACKTICK, ASTERISK, UNDERSCORE, TILDE, NEWLINE, HYPHEN, HASH, SPACE, TAB, LEFT_ANGLE, RIGHT_ANGLE, SLASH, PERIOD, LEFT_BRACKET, LEFT_PAREN, RIGHT_PAREN, RIGHT_BRACKET, A_UPPER, Z_UPPER, HR_HYPHEN_COUNT, MIN_CODEBLOCK_BACKTICKS, MAX_HEADING_LEVEL, HTTPS_PREFIX_LENGTH, HTTP_PREFIX_LENGTH, is_at_absolute_path, is_at_relative_path, } from './mdz_helpers.js';
|
|
11
|
-
//
|
|
11
|
+
//
|
|
12
12
|
// Lexer
|
|
13
|
-
//
|
|
13
|
+
//
|
|
14
14
|
export class MdzLexer {
|
|
15
15
|
#text;
|
|
16
16
|
#index = 0;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { type ColorScheme, type Theme } from '@fuzdev/fuz_css/theme.js';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ThemeStateJson {
|
|
3
3
|
theme: Theme;
|
|
4
4
|
color_scheme: ColorScheme;
|
|
5
5
|
}
|
|
6
|
-
export type
|
|
7
|
-
export declare class
|
|
6
|
+
export type ThemeStateOptions = Partial<ThemeStateJson>;
|
|
7
|
+
export declare class ThemeState {
|
|
8
8
|
theme: Theme;
|
|
9
9
|
color_scheme: ColorScheme;
|
|
10
|
-
constructor(options?:
|
|
11
|
-
toJSON():
|
|
10
|
+
constructor(options?: ThemeStateOptions);
|
|
11
|
+
toJSON(): ThemeStateJson;
|
|
12
12
|
}
|
|
13
|
-
export declare const
|
|
14
|
-
get: (error_message?: string) =>
|
|
15
|
-
get_maybe: () =>
|
|
16
|
-
set: (value:
|
|
13
|
+
export declare const theme_state_context: {
|
|
14
|
+
get: (error_message?: string) => () => ThemeState;
|
|
15
|
+
get_maybe: () => (() => ThemeState) | undefined;
|
|
16
|
+
set: (value: () => ThemeState) => () => ThemeState;
|
|
17
17
|
};
|
|
18
18
|
export declare const sync_color_scheme: (color_scheme: ColorScheme | null) => void;
|
|
19
19
|
export declare const COLOR_SCHEME_STORAGE_KEY = "fuz:color-scheme";
|
|
@@ -22,4 +22,4 @@ export declare const save_color_scheme: (color_scheme: ColorScheme | null, key?:
|
|
|
22
22
|
export declare const load_color_scheme: (fallback?: ColorScheme, key?: string) => ColorScheme;
|
|
23
23
|
export declare const save_theme: (theme: Theme | null, key?: string) => void;
|
|
24
24
|
export declare const load_theme: (fallback?: Theme, key?: string) => Theme;
|
|
25
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=theme_state.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme_state.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/theme_state.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAOrF,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,WAAW,CAAC;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAExD,qBAAa,UAAU;IACtB,KAAK,EAAE,KAAK,CAAa;IACzB,YAAY,EAAE,WAAW,CAAa;gBAE1B,OAAO,CAAC,EAAE,iBAAiB;IAUvC,MAAM,IAAI,cAAc;CAMxB;AACD,eAAO,MAAM,mBAAmB;2CAAwB,UAAU;4BAAV,UAAU;uBAAV,UAAU,WAAV,UAAU;CAAG,CAAC;AAEtE,eAAO,MAAM,iBAAiB,GAAI,cAAc,WAAW,GAAG,IAAI,KAAG,IAOpE,CAAC;AAEF,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAC3D,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAE7C,eAAO,MAAM,iBAAiB,GAC7B,cAAc,WAAW,GAAG,IAAI,EAChC,YAA8B,KAC5B,IAEF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC7B,WAAU,WAAoB,EAC9B,YAA8B,KAC5B,WAA4E,CAAC;AAEhF,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,GAAG,IAAI,EAAE,YAAuB,KAAG,IAEzE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,WAAU,KAA0B,EAAE,YAAuB,KAAG,KAC3C,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { default_themes } from '@fuzdev/fuz_css/themes.js';
|
|
|
3
3
|
import { BROWSER } from 'esm-env';
|
|
4
4
|
import { create_context } from './context_helpers.js';
|
|
5
5
|
import { load_from_storage, save_to_storage } from './storage.js';
|
|
6
|
-
export class
|
|
6
|
+
export class ThemeState {
|
|
7
7
|
theme = $state();
|
|
8
8
|
color_scheme = $state();
|
|
9
9
|
constructor(options) {
|
|
@@ -13,7 +13,7 @@ export class Themer {
|
|
|
13
13
|
throw Error('unknown color scheme: ' + color_scheme);
|
|
14
14
|
}
|
|
15
15
|
this.theme = theme;
|
|
16
|
-
this.color_scheme = color_scheme; // TODO `resolved_color_scheme` if auto? users could then do different things based on the final value - would not be added to `
|
|
16
|
+
this.color_scheme = color_scheme; // TODO `resolved_color_scheme` if auto? users could then do different things based on the final value - would not be added to `ThemeStateJson`
|
|
17
17
|
}
|
|
18
18
|
toJSON() {
|
|
19
19
|
return {
|
|
@@ -22,7 +22,7 @@ export class Themer {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const
|
|
25
|
+
export const theme_state_context = create_context();
|
|
26
26
|
export const sync_color_scheme = (color_scheme) => {
|
|
27
27
|
if (!BROWSER)
|
|
28
28
|
return;
|
package/dist/tome.d.ts
CHANGED
|
@@ -14,70 +14,14 @@ export type Tome = z.infer<typeof Tome>;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const to_tome_pathname: (item: Tome | string, docs_path?: string, hash?: string) => string;
|
|
16
16
|
export declare const tomes_context: {
|
|
17
|
-
get: (error_message?: string) => Map<string,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Component: Component<any, any, string>;
|
|
21
|
-
related_tomes: string[];
|
|
22
|
-
related_modules: string[];
|
|
23
|
-
related_declarations: string[];
|
|
24
|
-
}>;
|
|
25
|
-
get_maybe: () => Map<string, {
|
|
26
|
-
name: string;
|
|
27
|
-
category: string;
|
|
28
|
-
Component: Component<any, any, string>;
|
|
29
|
-
related_tomes: string[];
|
|
30
|
-
related_modules: string[];
|
|
31
|
-
related_declarations: string[];
|
|
32
|
-
}> | undefined;
|
|
33
|
-
set: (value: Map<string, {
|
|
34
|
-
name: string;
|
|
35
|
-
category: string;
|
|
36
|
-
Component: Component<any, any, string>;
|
|
37
|
-
related_tomes: string[];
|
|
38
|
-
related_modules: string[];
|
|
39
|
-
related_declarations: string[];
|
|
40
|
-
}>) => Map<string, {
|
|
41
|
-
name: string;
|
|
42
|
-
category: string;
|
|
43
|
-
Component: Component<any, any, string>;
|
|
44
|
-
related_tomes: string[];
|
|
45
|
-
related_modules: string[];
|
|
46
|
-
related_declarations: string[];
|
|
47
|
-
}>;
|
|
17
|
+
get: (error_message?: string) => () => Map<string, Tome>;
|
|
18
|
+
get_maybe: () => (() => Map<string, Tome>) | undefined;
|
|
19
|
+
set: (value: () => Map<string, Tome>) => () => Map<string, Tome>;
|
|
48
20
|
};
|
|
49
21
|
export declare const get_tome_by_name: (name: string) => Tome;
|
|
50
22
|
export declare const tome_context: {
|
|
51
|
-
get: (error_message?: string) =>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Component: Component<any, any, string>;
|
|
55
|
-
related_tomes: string[];
|
|
56
|
-
related_modules: string[];
|
|
57
|
-
related_declarations: string[];
|
|
58
|
-
};
|
|
59
|
-
get_maybe: () => {
|
|
60
|
-
name: string;
|
|
61
|
-
category: string;
|
|
62
|
-
Component: Component<any, any, string>;
|
|
63
|
-
related_tomes: string[];
|
|
64
|
-
related_modules: string[];
|
|
65
|
-
related_declarations: string[];
|
|
66
|
-
} | undefined;
|
|
67
|
-
set: (value: {
|
|
68
|
-
name: string;
|
|
69
|
-
category: string;
|
|
70
|
-
Component: Component<any, any, string>;
|
|
71
|
-
related_tomes: string[];
|
|
72
|
-
related_modules: string[];
|
|
73
|
-
related_declarations: string[];
|
|
74
|
-
}) => {
|
|
75
|
-
name: string;
|
|
76
|
-
category: string;
|
|
77
|
-
Component: Component<any, any, string>;
|
|
78
|
-
related_tomes: string[];
|
|
79
|
-
related_modules: string[];
|
|
80
|
-
related_declarations: string[];
|
|
81
|
-
};
|
|
23
|
+
get: (error_message?: string) => () => Tome;
|
|
24
|
+
get_maybe: () => (() => Tome) | undefined;
|
|
25
|
+
set: (value: () => Tome) => () => Tome;
|
|
82
26
|
};
|
|
83
27
|
//# sourceMappingURL=tome.d.ts.map
|
package/dist/tome.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tome.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/tome.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB,eAAO,MAAM,IAAI;;;;;;;iBAQf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC5B,MAAM,IAAI,GAAG,MAAM,EACnB,kBAA6B,EAC7B,OAAO,MAAM,KACX,MAIF,CAAC;AAEF,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"tome.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/tome.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB,eAAO,MAAM,IAAI;;;;;;;iBAQf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC5B,MAAM,IAAI,GAAG,MAAM,EACnB,kBAA6B,EAC7B,OAAO,MAAM,KACX,MAIF,CAAC;AAEF,eAAO,MAAM,aAAa;2CAAwB,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;4BAAjB,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;uBAAjB,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,WAAjB,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;CAAG,CAAC;AAEvE,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,IAK/C,CAAC;AAEF,eAAO,MAAM,YAAY;2CAAwB,IAAI;4BAAJ,IAAI;uBAAJ,IAAI,WAAJ,IAAI;CAAG,CAAC"}
|
package/dist/tome.js
CHANGED
|
@@ -22,8 +22,8 @@ export const to_tome_pathname = (item, docs_path = DOCS_PATH_DEFAULT, hash) => {
|
|
|
22
22
|
};
|
|
23
23
|
export const tomes_context = create_context();
|
|
24
24
|
export const get_tome_by_name = (name) => {
|
|
25
|
-
const
|
|
26
|
-
const tome =
|
|
25
|
+
const get_tomes = tomes_context.get();
|
|
26
|
+
const tome = get_tomes().get(name);
|
|
27
27
|
if (!tome)
|
|
28
28
|
throw Error(`unable to find tome "${name}"`);
|
|
29
29
|
return tome;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.189.1",
|
|
4
4
|
"description": "Svelte UI library",
|
|
5
|
-
"
|
|
5
|
+
"tagline": "friendly user zystem",
|
|
6
6
|
"glyph": "🧶",
|
|
7
7
|
"logo": "logo.svg",
|
|
8
8
|
"logo_alt": "a friendly brown spider facing you",
|
|
@@ -81,10 +81,11 @@
|
|
|
81
81
|
"@changesets/changelog-git": "^0.2.1",
|
|
82
82
|
"@fuzdev/fuz_code": "^0.45.1",
|
|
83
83
|
"@fuzdev/fuz_css": "^0.55.0",
|
|
84
|
-
"@fuzdev/fuz_util": "^0.
|
|
84
|
+
"@fuzdev/fuz_util": "^0.54.0",
|
|
85
85
|
"@fuzdev/gro": "^0.197.0",
|
|
86
86
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
87
87
|
"@ryanatkn/eslint-config": "^0.10.1",
|
|
88
|
+
"@sveltejs/acorn-typescript": "^1.0.9",
|
|
88
89
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
89
90
|
"@sveltejs/kit": "^2.53.4",
|
|
90
91
|
"@sveltejs/package": "^2.5.7",
|
|
@@ -474,7 +474,7 @@ const contextmenu_query_params = (
|
|
|
474
474
|
return params;
|
|
475
475
|
};
|
|
476
476
|
|
|
477
|
-
export const contextmenu_context = create_context<ContextmenuState>();
|
|
477
|
+
export const contextmenu_context = create_context<() => ContextmenuState>();
|
|
478
478
|
|
|
479
479
|
export const contextmenu_submenu_context = create_context<SubmenuState>();
|
|
480
480
|
|
package/src/lib/mdz_lexer.ts
CHANGED
|
@@ -42,9 +42,9 @@ import {
|
|
|
42
42
|
is_at_relative_path,
|
|
43
43
|
} from './mdz_helpers.js';
|
|
44
44
|
|
|
45
|
-
//
|
|
45
|
+
//
|
|
46
46
|
// Token types
|
|
47
|
-
//
|
|
47
|
+
//
|
|
48
48
|
|
|
49
49
|
export interface MdzTokenBase {
|
|
50
50
|
start: number;
|
|
@@ -167,9 +167,9 @@ export interface MdzTokenParagraphBreak extends MdzTokenBase {
|
|
|
167
167
|
type: 'paragraph_break';
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
//
|
|
170
|
+
//
|
|
171
171
|
// Lexer
|
|
172
|
-
//
|
|
172
|
+
//
|
|
173
173
|
|
|
174
174
|
export class MdzLexer {
|
|
175
175
|
#text: string;
|
|
@@ -5,35 +5,35 @@ import {BROWSER} from 'esm-env';
|
|
|
5
5
|
import {create_context} from './context_helpers.js';
|
|
6
6
|
import {load_from_storage, save_to_storage} from './storage.js';
|
|
7
7
|
|
|
8
|
-
export interface
|
|
8
|
+
export interface ThemeStateJson {
|
|
9
9
|
theme: Theme;
|
|
10
10
|
color_scheme: ColorScheme;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export type
|
|
13
|
+
export type ThemeStateOptions = Partial<ThemeStateJson>;
|
|
14
14
|
|
|
15
|
-
export class
|
|
15
|
+
export class ThemeState {
|
|
16
16
|
theme: Theme = $state()!;
|
|
17
17
|
color_scheme: ColorScheme = $state()!;
|
|
18
18
|
|
|
19
|
-
constructor(options?:
|
|
19
|
+
constructor(options?: ThemeStateOptions) {
|
|
20
20
|
const theme = options?.theme ?? default_themes[0]!;
|
|
21
21
|
const color_scheme = options?.color_scheme ?? 'auto';
|
|
22
22
|
if (parse_color_scheme(color_scheme) === null) {
|
|
23
23
|
throw Error('unknown color scheme: ' + color_scheme);
|
|
24
24
|
}
|
|
25
25
|
this.theme = theme;
|
|
26
|
-
this.color_scheme = color_scheme; // TODO `resolved_color_scheme` if auto? users could then do different things based on the final value - would not be added to `
|
|
26
|
+
this.color_scheme = color_scheme; // TODO `resolved_color_scheme` if auto? users could then do different things based on the final value - would not be added to `ThemeStateJson`
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
toJSON():
|
|
29
|
+
toJSON(): ThemeStateJson {
|
|
30
30
|
return {
|
|
31
31
|
theme: this.theme,
|
|
32
32
|
color_scheme: this.color_scheme,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
export const
|
|
36
|
+
export const theme_state_context = create_context<() => ThemeState>();
|
|
37
37
|
|
|
38
38
|
export const sync_color_scheme = (color_scheme: ColorScheme | null): void => {
|
|
39
39
|
if (!BROWSER) return;
|
package/src/lib/tome.ts
CHANGED
|
@@ -30,13 +30,13 @@ export const to_tome_pathname = (
|
|
|
30
30
|
return resolve((hash ? path + ensure_start(hash, '#') : path) as any);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
export const tomes_context = create_context<Map<string, Tome>>();
|
|
33
|
+
export const tomes_context = create_context<() => Map<string, Tome>>();
|
|
34
34
|
|
|
35
35
|
export const get_tome_by_name = (name: string): Tome => {
|
|
36
|
-
const
|
|
37
|
-
const tome =
|
|
36
|
+
const get_tomes = tomes_context.get();
|
|
37
|
+
const tome = get_tomes().get(name);
|
|
38
38
|
if (!tome) throw Error(`unable to find tome "${name}"`);
|
|
39
39
|
return tome;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export const tome_context = create_context<Tome>();
|
|
42
|
+
export const tome_context = create_context<() => Tome>();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Themed.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Themed.svelte"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAqB,KAAK,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAIxE,OAAO,EACL,iBAAiB,IAAI,yBAAyB,EAC9C,iBAAiB,IAAI,yBAAyB,EAC9C,iBAAiB,IAAI,yBAAyB,EAC9C,UAAU,IAAI,kBAAkB,EAChC,UAAU,IAAI,kBAAkB,EAEhC,MAAM,EACN,MAAM,oBAAoB,CAAC;AAG5B,KAAK,gBAAgB,GAAI;IACxB,iBAAiB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACrD,iBAAiB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACrD,iBAAiB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACrD,UAAU,CAAC,EAAE,OAAO,kBAAkB,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,kBAAkB,CAAC;IACvC,cAAc,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAC3F,CAAC;A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