@fuzdev/fuz_ui 0.196.0 → 0.198.0

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.
Files changed (57) hide show
  1. package/README.md +2 -2
  2. package/dist/Breadcrumb.svelte +15 -1
  3. package/dist/Breadcrumb.svelte.d.ts +4 -0
  4. package/dist/Breadcrumb.svelte.d.ts.map +1 -1
  5. package/dist/Contextmenu.svelte +3 -1
  6. package/dist/Contextmenu.svelte.d.ts.map +1 -1
  7. package/dist/DeclarationLink.svelte +12 -3
  8. package/dist/DeclarationLink.svelte.d.ts +6 -0
  9. package/dist/DeclarationLink.svelte.d.ts.map +1 -1
  10. package/dist/Docs.svelte +8 -21
  11. package/dist/Docs.svelte.d.ts +0 -3
  12. package/dist/Docs.svelte.d.ts.map +1 -1
  13. package/dist/DocsFooter.svelte +19 -10
  14. package/dist/DocsFooter.svelte.d.ts +7 -2
  15. package/dist/DocsFooter.svelte.d.ts.map +1 -1
  16. package/dist/DocsPrimaryNav.svelte +1 -12
  17. package/dist/DocsPrimaryNav.svelte.d.ts +0 -3
  18. package/dist/DocsPrimaryNav.svelte.d.ts.map +1 -1
  19. package/dist/DocsSearch.svelte +1 -1
  20. package/dist/EcosystemLinks.svelte +4 -1
  21. package/dist/EcosystemLinks.svelte.d.ts.map +1 -1
  22. package/dist/LibraryDetail.svelte +9 -2
  23. package/dist/LibraryDetail.svelte.d.ts +6 -0
  24. package/dist/LibraryDetail.svelte.d.ts.map +1 -1
  25. package/dist/ModuleLink.svelte +12 -3
  26. package/dist/ModuleLink.svelte.d.ts +6 -0
  27. package/dist/ModuleLink.svelte.d.ts.map +1 -1
  28. package/dist/ProjectLinks.svelte +2 -1
  29. package/dist/ProjectLinks.svelte.d.ts.map +1 -1
  30. package/dist/Svg.svelte +2 -24
  31. package/dist/Svg.svelte.d.ts +1 -23
  32. package/dist/Svg.svelte.d.ts.map +1 -1
  33. package/dist/constants.d.ts +4 -0
  34. package/dist/constants.d.ts.map +1 -1
  35. package/dist/constants.js +4 -0
  36. package/dist/library_helpers.d.ts +0 -30
  37. package/dist/library_helpers.d.ts.map +1 -1
  38. package/dist/library_helpers.js +0 -36
  39. package/dist/module.svelte.d.ts +7 -0
  40. package/dist/module.svelte.d.ts.map +1 -1
  41. package/dist/module.svelte.js +9 -0
  42. package/dist/site.svelte.d.ts +34 -0
  43. package/dist/site.svelte.d.ts.map +1 -0
  44. package/dist/site.svelte.js +18 -0
  45. package/dist/svg.d.ts +25 -0
  46. package/dist/svg.d.ts.map +1 -0
  47. package/dist/svg.js +1 -0
  48. package/package.json +7 -7
  49. package/src/lib/constants.ts +5 -0
  50. package/src/lib/library_helpers.ts +0 -45
  51. package/src/lib/logos.ts +1 -1
  52. package/src/lib/mdz_lexer.ts +2 -2
  53. package/src/lib/mdz_token_parser.ts +1 -1
  54. package/src/lib/module.svelte.ts +12 -0
  55. package/src/lib/site.svelte.ts +39 -0
  56. package/src/lib/storage.ts +1 -1
  57. package/src/lib/svg.ts +23 -0
package/README.md CHANGED
@@ -55,8 +55,8 @@ import '@fuzdev/fuz_css/style.css';
55
55
  // and import a fuz_css theme:
56
56
  import '@fuzdev/fuz_css/theme.css'; // or bring your own
57
57
 
58
- // using Gro generates fuz_css' utility classes stylesheet by default:
59
- import '$routes/fuz.css';
58
+ // the fuz_css Vite plugin exposes the generated utility classes as a virtual module:
59
+ import 'virtual:fuz.css';
60
60
 
61
61
  // then import Fuz Svelte components:
62
62
  import ThemeRoot from '@fuzdev/fuz_ui/ThemeRoot.svelte';
@@ -6,6 +6,9 @@
6
6
  import {strip_start, ensure_end} from '@fuzdev/fuz_util/string.js';
7
7
  import type {SvelteHTMLElements} from 'svelte/elements';
8
8
 
9
+ import Svg from './Svg.svelte';
10
+ import {site_context} from './site.svelte.js';
11
+
9
12
  const {
10
13
  path,
11
14
  selected_path,
@@ -29,9 +32,17 @@
29
32
  */
30
33
  base_path?: string;
31
34
  separator?: Snippet;
35
+ /**
36
+ * Content of the root link. Defaults to the `site_context` icon rendered as
37
+ * an `Svg`, then the `site_context` glyph, then `•`.
38
+ */
32
39
  children?: Snippet;
33
40
  } = $props();
34
41
 
42
+ const site = site_context.get_maybe();
43
+ const icon_data = $derived(site?.icon ?? null);
44
+ const glyph_text = $derived(site?.glyph ?? null);
45
+
35
46
  const final_base_path = $derived(base_path ?? resolve('/').slice(0, -1));
36
47
 
37
48
  const final_path = $derived(path ?? strip_start(page.url.pathname, final_base_path));
@@ -51,7 +62,10 @@
51
62
  <div {...rest} class="breadcrumb {rest.class}">
52
63
  <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
53
64
  <a href={root_path} class:selected={root_path === final_base_path + final_selected_path}
54
- >{#if children}{@render children()}{:else}•{/if}</a
65
+ >{#if children}{@render children()}{:else if icon_data}<Svg
66
+ data={icon_data}
67
+ size="1em"
68
+ />{:else if glyph_text}{glyph_text}{:else}•{/if}</a
55
69
  >{#each path_pieces as path_piece (path_piece)}{#if path_piece.type === 'piece'}<!-- eslint-disable-next-line svelte/no-navigation-without-resolve --><a
56
70
  href={final_base_path + path_piece.path}
57
71
  class:selected={path_piece.path === final_selected_path}>{path_piece.name}</a
@@ -16,6 +16,10 @@ type $$ComponentProps = SvelteHTMLElements['div'] & {
16
16
  */
17
17
  base_path?: string;
18
18
  separator?: Snippet;
19
+ /**
20
+ * Content of the root link. Defaults to the `site_context` icon rendered as
21
+ * an `Svg`, then the `site_context` glyph, then `•`.
22
+ */
19
23
  children?: Snippet;
20
24
  };
21
25
  declare const Breadcrumb: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Breadcrumb.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA2CH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Breadcrumb.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAkDH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -4,8 +4,10 @@
4
4
 
5
5
  import {contextmenu_attachment} from './contextmenu_state.svelte.js';
6
6
 
7
+ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
8
+
7
9
  const {
8
- tag = 'span' as T, // TODO why is casting needed?
10
+ tag = 'span' as any, // TODO why is casting needed?
9
11
  entries,
10
12
  children,
11
13
  ...rest
@@ -1 +1 @@
1
- {"version":3,"file":"Contextmenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Contextmenu.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAGxD,iBAAS,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;;cAOnC,CAAC;iBACE,OAAO;kBACN,OAAO;;;;;;EAkBsG;AACzH,cAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7C,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,MAAM,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClD,KAAK,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,QAAQ;IACR,OAAO;CACV;AAED,UAAU,qBAAqB;IAC3B,KAAK,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,C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C"}
@@ -9,6 +9,7 @@
9
9
  const {
10
10
  name,
11
11
  hash,
12
+ full = false,
12
13
  children,
13
14
  class: class_prop = 'chip',
14
15
  ...rest
@@ -16,17 +17,25 @@
16
17
  name: string;
17
18
  /** URL fragment to append, with or without the `#`. */
18
19
  hash?: string;
20
+ /**
21
+ * Link to the library's own deployed docs (`url_api_full`) instead of a
22
+ * site-local path (`url_api`). Use when rendering a foreign library on a
23
+ * different site, e.g. an aggregator, so links don't dangle locally.
24
+ */
25
+ full?: boolean;
19
26
  } = $props();
20
27
 
21
28
  const library = library_context.get();
22
29
 
23
30
  const declaration = $derived(library.declaration_by_name.get(name));
24
31
 
32
+ // When linking a foreign library's docs, prefer its full URL; fall back to
33
+ // the site-local path if `homepage_url` is unavailable.
34
+ const url_api = $derived((full && declaration?.url_api_full) || declaration?.url_api);
35
+
25
36
  const contextmenu_entries = $derived(
26
37
  declaration ? create_declaration_contextmenu(declaration) : undefined,
27
38
  );
28
-
29
- // TODO @many support full https:// url variants - automatic detection? library prop?
30
39
  </script>
31
40
 
32
41
  {#if declaration}
@@ -35,7 +44,7 @@
35
44
  <a
36
45
  {...rest}
37
46
  class="declaration-link {class_prop}"
38
- href={declaration.url_api + (hash ? ensure_start(hash, '#') : '')}
47
+ href={url_api + (hash ? ensure_start(hash, '#') : '')}
39
48
  {@attach contextmenu_attachment(contextmenu_entries)}
40
49
  >
41
50
  {#if children}
@@ -3,6 +3,12 @@ type $$ComponentProps = SvelteHTMLElements['a'] & {
3
3
  name: string;
4
4
  /** URL fragment to append, with or without the `#`. */
5
5
  hash?: string;
6
+ /**
7
+ * Link to the library's own deployed docs (`url_api_full`) instead of a
8
+ * site-local path (`url_api`). Use when rendering a foreign library on a
9
+ * different site, e.g. an aggregator, so links don't dangle locally.
10
+ */
11
+ full?: boolean;
6
12
  };
7
13
  declare const DeclarationLink: import("svelte").Component<$$ComponentProps, {}, "">;
8
14
  type DeclarationLink = ReturnType<typeof DeclarationLink>;
@@ -1 +1 @@
1
- {"version":3,"file":"DeclarationLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAiDH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"DeclarationLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAoDH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
package/dist/Docs.svelte CHANGED
@@ -4,7 +4,6 @@
4
4
  import {innerWidth} from 'svelte/reactivity/window';
5
5
  import {page} from '$app/state';
6
6
 
7
- import type {Library} from './library.svelte.js';
8
7
  import Breadcrumb from './Breadcrumb.svelte';
9
8
  import {Tome, tomes_context} from './tome.js';
10
9
  import DocsPrimaryNav from './DocsPrimaryNav.svelte';
@@ -12,20 +11,20 @@
12
11
  import DocsTertiaryNav from './DocsTertiaryNav.svelte';
13
12
  import Dialog from './Dialog.svelte';
14
13
  import DocsFooter from './DocsFooter.svelte';
14
+ import {site_context} from './site.svelte.js';
15
+ import {FUZ_DEV_URL} from './constants.js';
15
16
  import {DocsLinks, docs_links_context} from './docs_helpers.svelte.js';
16
17
 
17
18
  const {
18
19
  tomes,
19
- library,
20
- breadcrumb_children,
21
20
  children,
22
21
  }: {
23
22
  tomes: Array<Tome>;
24
- library: Library;
25
- breadcrumb_children?: Snippet<[is_primary_nav: boolean]>;
26
23
  children: Snippet;
27
24
  } = $props();
28
25
 
26
+ const site = site_context.get('`Docs` requires `site_context`; set it in your root layout');
27
+
29
28
  // TODO this API is messy, inconsistent usage of props/context
30
29
  const tomes_by_slug = $derived(new Map(tomes.map((t) => [t.slug, t])));
31
30
  tomes_context.set(() => tomes_by_slug);
@@ -51,7 +50,7 @@
51
50
  <svelte:window onhashchange={() => (show_secondary_nav_dialog = false)} />
52
51
 
53
52
  <div class="docs" style:--docs_menu_width={docs_menu_width}>
54
- <DocsPrimaryNav {library} {breadcrumb_children}>
53
+ <DocsPrimaryNav>
55
54
  <div class="nav-dialog-toggle">
56
55
  <button class="plain" type="button" onclick={() => toggle_secondary_nav_dialog()}>menu</button
57
56
  >
@@ -72,15 +71,9 @@
72
71
  <DocsTertiaryNav {tomes} {tomes_by_slug} />
73
72
  {/if}
74
73
  <section class="box">
75
- <DocsFooter {library} root_url="https://www.fuz.dev/">
74
+ <DocsFooter repo_url={site.repo_url} root_url={FUZ_DEV_URL}>
76
75
  <div class="mb_xl5">
77
- <Breadcrumb>
78
- {#if breadcrumb_children}
79
- {@render breadcrumb_children(false)}
80
- {:else}
81
- {library.package_json.glyph ?? '🏠'}
82
- {/if}
83
- </Breadcrumb>
76
+ <Breadcrumb />
84
77
  </div>
85
78
  </DocsFooter>
86
79
  </section>
@@ -92,13 +85,7 @@
92
85
  <Dialog onclose={() => (show_secondary_nav_dialog = false)}>
93
86
  <div class="pane" style:--docs_menu_width={docs_menu_width}>
94
87
  <div class="p_xl pb_0">
95
- <Breadcrumb>
96
- {#if breadcrumb_children}
97
- {@render breadcrumb_children(false)}
98
- {:else}
99
- {library.package_json.glyph ?? '🏠'}
100
- {/if}
101
- </Breadcrumb>
88
+ <Breadcrumb />
102
89
  </div>
103
90
  <div class="px_lg pb_xl">
104
91
  <DocsSecondaryNav {tomes} sidebar={false} />
@@ -1,10 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
- import type { Library } from './library.svelte.js';
3
2
  import { Tome } from './tome.js';
4
3
  type $$ComponentProps = {
5
4
  tomes: Array<Tome>;
6
- library: Library;
7
- breadcrumb_children?: Snippet<[is_primary_nav: boolean]>;
8
5
  children: Snippet;
9
6
  };
10
7
  declare const Docs: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"Docs.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Docs.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAC,IAAI,EAAgB,MAAM,WAAW,CAAC;AAQ7C,KAAK,gBAAgB,GAAI;IACxB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA6GH,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Docs.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Docs.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAMpC,OAAO,EAAC,IAAI,EAAgB,MAAM,WAAW,CAAC;AAU7C,KAAK,gBAAgB,GAAI;IACxB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAkGH,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -3,12 +3,11 @@
3
3
  import type {Snippet} from 'svelte';
4
4
  import type {SvelteHTMLElements} from 'svelte/elements';
5
5
 
6
- import type {Library} from './library.svelte.js';
7
6
  import Svg from './Svg.svelte';
8
7
  import {logo_github} from './logos.js';
9
8
 
10
9
  const {
11
- library,
10
+ repo_url,
12
11
  root_url = null,
13
12
  logo,
14
13
  logo_header,
@@ -16,8 +15,14 @@
16
15
  children,
17
16
  ...rest
18
17
  }: SvelteHTMLElements['footer'] & {
19
- library: Library;
18
+ /**
19
+ * Link target for the logo, e.g. the project's source repository.
20
+ */
21
+ repo_url?: Url | null;
20
22
  root_url?: Url | null;
23
+ /**
24
+ * Overrides the default GitHub logo mark, e.g. for repos hosted elsewhere.
25
+ */
21
26
  logo?: Snippet;
22
27
  logo_header?: Snippet;
23
28
  logo_footer?: Snippet;
@@ -28,13 +33,12 @@
28
33
  {@render children?.()}
29
34
  <div class="logo box panel p_lg shadow_inset_xs">
30
35
  {@render logo_header?.()}
31
- <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
32
- <a href={library.repo_url} rel="me" title="source code on GitHub"
33
- >{#if logo}{@render logo()}{:else}<Svg
34
- data={logo_github}
35
- size="var(--icon_size_lg)"
36
- />{/if}</a
37
- >
36
+ {#if repo_url}
37
+ <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
38
+ <a href={repo_url} rel="me" title="source code">{@render logo_mark()}</a>
39
+ {:else}
40
+ {@render logo_mark()}
41
+ {/if}
38
42
  {@render logo_footer?.()}
39
43
  </div>
40
44
  {#if root_url}
@@ -45,6 +49,11 @@
45
49
  {/if}
46
50
  </footer>
47
51
 
52
+ {#snippet logo_mark()}{#if logo}{@render logo()}{:else}<Svg
53
+ data={logo_github}
54
+ size="var(--icon_size_lg)"
55
+ />{/if}{/snippet}
56
+
48
57
  <style>
49
58
  /* TODO probably extract */
50
59
  .logo a {
@@ -1,10 +1,15 @@
1
1
  import { type Url } from '@fuzdev/fuz_util/url.js';
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { SvelteHTMLElements } from 'svelte/elements';
4
- import type { Library } from './library.svelte.js';
5
4
  type $$ComponentProps = SvelteHTMLElements['footer'] & {
6
- library: Library;
5
+ /**
6
+ * Link target for the logo, e.g. the project's source repository.
7
+ */
8
+ repo_url?: Url | null;
7
9
  root_url?: Url | null;
10
+ /**
11
+ * Overrides the default GitHub logo mark, e.g. for repos hosted elsewhere.
12
+ */
8
13
  logo?: Snippet;
9
14
  logo_header?: Snippet;
10
15
  logo_footer?: Snippet;
@@ -1 +1 @@
1
- {"version":3,"file":"DocsFooter.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsFooter.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,GAAG,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAIhD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAyCH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"DocsFooter.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsFooter.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,GAAG,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AA8CH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -4,17 +4,12 @@
4
4
  import {scrollY} from 'svelte/reactivity/window';
5
5
  import type {SvelteHTMLElements} from 'svelte/elements';
6
6
 
7
- import type {Library} from './library.svelte.js';
8
7
  import Breadcrumb from './Breadcrumb.svelte';
9
8
 
10
9
  const {
11
- library,
12
- breadcrumb_children,
13
10
  children,
14
11
  ...rest
15
12
  }: SvelteHTMLElements['div'] & {
16
- library: Library;
17
- breadcrumb_children?: Snippet<[is_primary_nav: boolean]>;
18
13
  children?: Snippet;
19
14
  } = $props();
20
15
 
@@ -29,13 +24,7 @@
29
24
  <div class="background" aria-hidden="true"></div>
30
25
  <div class="content">
31
26
  <nav aria-label="Primary nav">
32
- <Breadcrumb>
33
- {#if breadcrumb_children}
34
- {@render breadcrumb_children(true)}
35
- {:else}
36
- {library.package_json.glyph ?? '🏠'}
37
- {/if}
38
- </Breadcrumb>
27
+ <Breadcrumb />
39
28
  </nav>
40
29
  {@render children?.()}
41
30
  </div>
@@ -1,9 +1,6 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
- import type { Library } from './library.svelte.js';
4
3
  type $$ComponentProps = SvelteHTMLElements['div'] & {
5
- library: Library;
6
- breadcrumb_children?: Snippet<[is_primary_nav: boolean]>;
7
4
  children?: Snippet;
8
5
  };
9
6
  declare const DocsPrimaryNav: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"DocsPrimaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsPrimaryNav.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGhD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA6CH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"DocsPrimaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsPrimaryNav.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAIvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAoCH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -7,7 +7,7 @@
7
7
  declaration_count,
8
8
  filtered_module_count,
9
9
  filtered_declaration_count,
10
- search_query = $bindable(),
10
+ search_query = $bindable(), // eslint-disable-line @typescript-eslint/no-useless-default-assignment
11
11
  ...rest
12
12
  }: SvelteHTMLElements['input'] & {
13
13
  placeholder?: string;
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import {FUZ_DEV_URL} from './constants.js';
3
+
2
4
  const {
3
5
  selected,
4
6
  }: {
@@ -8,7 +10,8 @@
8
10
 
9
11
  <ul>
10
12
  <li>
11
- <a rel="me" href="https://www.fuz.dev/" class:selected={selected === 'fuz.dev'}>fuz.dev</a>
13
+ <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
14
+ <a rel="me" href={FUZ_DEV_URL} class:selected={selected === 'fuz.dev'}>fuz.dev</a>
12
15
  - the Fuz stack homepage{#if selected === 'fuz.dev'}, you are here{/if}
13
16
  </li>
14
17
  <li>
@@ -1 +1 @@
1
- {"version":3,"file":"EcosystemLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/EcosystemLinks.svelte"],"names":[],"mappings":"AAGC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAqBH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"EcosystemLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/EcosystemLinks.svelte"],"names":[],"mappings":"AAKC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAwBH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -21,6 +21,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
21
21
 
22
22
  const {
23
23
  library,
24
+ links_full = false,
24
25
  repo_name,
25
26
  description,
26
27
  tagline,
@@ -29,6 +30,12 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
29
30
  children,
30
31
  }: {
31
32
  library: Library;
33
+ /**
34
+ * Link the module/declaration index to the library's own deployed docs
35
+ * (`url_api_full`) instead of site-local paths. Use when rendering a
36
+ * foreign library on a different site, e.g. an aggregator.
37
+ */
38
+ links_full?: boolean;
32
39
  repo_name?: Snippet<[repo_name: string]>;
33
40
  description?: Snippet<[description: string]>;
34
41
  tagline?: Snippet<[description: string]>;
@@ -166,7 +173,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
166
173
  >
167
174
  <div class="module-content">
168
175
  <span class="font_size_xl">
169
- <ModuleLink module_path={module.path}>
176
+ <ModuleLink module_path={module.path} full={links_full}>
170
177
  {module.path}
171
178
  </ModuleLink>
172
179
  </span>
@@ -174,7 +181,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
174
181
  <ul class="declarations unstyled">
175
182
  {#each module.declarations as declaration (declaration.name)}
176
183
  <li>
177
- <DeclarationLink name={declaration.name} />
184
+ <DeclarationLink name={declaration.name} full={links_full} />
178
185
  </li>
179
186
  {/each}
180
187
  </ul>
@@ -2,6 +2,12 @@ import type { Snippet } from 'svelte';
2
2
  import type { Library } from './library.svelte.js';
3
3
  type $$ComponentProps = {
4
4
  library: Library;
5
+ /**
6
+ * Link the module/declaration index to the library's own deployed docs
7
+ * (`url_api_full`) instead of site-local paths. Use when rendering a
8
+ * foreign library on a different site, e.g. an aggregator.
9
+ */
10
+ links_full?: boolean;
5
11
  repo_name?: Snippet<[repo_name: string]>;
6
12
  description?: Snippet<[description: string]>;
7
13
  tagline?: Snippet<[description: string]>;
@@ -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;AAOhD,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;AAiKH;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
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;AAOhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,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;AAkKH;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -9,6 +9,7 @@
9
9
  const {
10
10
  module_path,
11
11
  hash,
12
+ full = false,
12
13
  children,
13
14
  class: class_prop = 'chip',
14
15
  ...rest
@@ -16,17 +17,25 @@
16
17
  module_path: string; // TODO maybe rename?
17
18
  /** URL fragment to append, with or without the `#`. */
18
19
  hash?: string;
20
+ /**
21
+ * Link to the library's own deployed docs (`url_api_full`) instead of a
22
+ * site-local path (`url_api`). Use when rendering a foreign library on a
23
+ * different site, e.g. an aggregator, so links don't dangle locally.
24
+ */
25
+ full?: boolean;
19
26
  } = $props();
20
27
 
21
28
  const library = library_context.get();
22
29
 
23
30
  const module = $derived(library.module_by_path.get(module_path));
24
31
 
32
+ // When linking a foreign library's docs, prefer its full URL; fall back to
33
+ // the site-local path if `homepage_url` is unavailable.
34
+ const url_api = $derived((full && module?.url_api_full) || module?.url_api);
35
+
25
36
  const color_class = $derived(module_path.endsWith('.svelte') ? 'color_h' : '');
26
37
 
27
38
  const contextmenu_entries = $derived(module ? create_module_contextmenu(module) : undefined);
28
-
29
- // TODO @many support full https:// url variants - automatic detection? library prop?
30
39
  </script>
31
40
 
32
41
  {#if module}
@@ -34,7 +43,7 @@
34
43
  <a
35
44
  {...rest}
36
45
  class="module-link {class_prop} {color_class}"
37
- href={module.url_api + (hash ? ensure_start(hash, '#') : '')}
46
+ href={url_api + (hash ? ensure_start(hash, '#') : '')}
38
47
  {@attach contextmenu_attachment(contextmenu_entries)}
39
48
  >
40
49
  <!-- eslint-enable svelte/no-navigation-without-resolve -->
@@ -3,6 +3,12 @@ type $$ComponentProps = SvelteHTMLElements['a'] & {
3
3
  module_path: string;
4
4
  /** URL fragment to append, with or without the `#`. */
5
5
  hash?: string;
6
+ /**
7
+ * Link to the library's own deployed docs (`url_api_full`) instead of a
8
+ * site-local path (`url_api`). Use when rendering a foreign library on a
9
+ * different site, e.g. an aggregator, so links don't dangle locally.
10
+ */
11
+ full?: boolean;
6
12
  };
7
13
  declare const ModuleLink: import("svelte").Component<$$ComponentProps, {}, "">;
8
14
  type ModuleLink = ReturnType<typeof ModuleLink>;
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ModuleLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAiDH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ModuleLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ModuleLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAoDH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
- import Svg, {type SvgData} from './Svg.svelte';
2
+ import Svg from './Svg.svelte';
3
+ import type {SvgData} from './svg.js';
3
4
  import {
4
5
  // TODO when fuz.dev is ready
5
6
  // logo_fuz,
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ProjectLinks.svelte"],"names":[],"mappings":"AA0EA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EA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GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,YAAY;;kBAA+E,CAAC;AAChF,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAe,YAAY,CAAC"}
package/dist/Svg.svelte CHANGED
@@ -1,31 +1,9 @@
1
- <script lang="ts" module>
1
+ <script lang="ts">
2
2
  import {ensure_end} from '@fuzdev/fuz_util/string.js';
3
3
  import type {SvelteHTMLElements} from 'svelte/elements';
4
4
 
5
- export interface SvgData {
6
- /**
7
- * Raw svg markup string that's inserted unsafely as a child of the `svg` element.
8
- * This is an escape hatch for non-`path` markup -
9
- * generally, you should instead use the `paths` property to avoid security/CSP implications.
10
- */
11
- raw?: string | null;
12
- /**
13
- * List of svg `path` attribute objects. The `d` attribute is required.
14
- */
15
- paths?: Array<{d: string} & SvelteHTMLElements['path']> | null;
16
- attrs?: SvelteHTMLElements['svg'] | null;
17
- fill?: string | null;
18
- width?: string | null;
19
- height?: string | null;
20
- label?: string | null;
21
- /**
22
- * Defaults to `"0 0 100 100"`.
23
- */
24
- viewBox?: string | null;
25
- }
26
- </script>
5
+ import type {SvgData} from './svg.js';
27
6
 
28
- <script lang="ts">
29
7
  const {
30
8
  data,
31
9
  fill,
@@ -1,27 +1,5 @@
1
1
  import type { SvelteHTMLElements } from 'svelte/elements';
2
- export interface SvgData {
3
- /**
4
- * Raw svg markup string that's inserted unsafely as a child of the `svg` element.
5
- * This is an escape hatch for non-`path` markup -
6
- * generally, you should instead use the `paths` property to avoid security/CSP implications.
7
- */
8
- raw?: string | null;
9
- /**
10
- * List of svg `path` attribute objects. The `d` attribute is required.
11
- */
12
- paths?: Array<{
13
- d: string;
14
- } & SvelteHTMLElements['path']> | null;
15
- attrs?: SvelteHTMLElements['svg'] | null;
16
- fill?: string | null;
17
- width?: string | null;
18
- height?: string | null;
19
- label?: string | null;
20
- /**
21
- * Defaults to `"0 0 100 100"`.
22
- */
23
- viewBox?: string | null;
24
- }
2
+ import type { SvgData } from './svg.js';
25
3
  type $$ComponentProps = SvelteHTMLElements['svg'] & {
26
4
  data: SvgData;
27
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Svg.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Svg.svelte"],"names":[],"mappings":"AAIC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,OAAO;IACvB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/D,KAAK,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AA2CH,QAAA,MAAM,GAAG,sDAAwC,CAAC;AAClD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;AAClC,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"Svg.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Svg.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAErC,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AA8CH,QAAA,MAAM,GAAG,sDAAwC,CAAC;AAClD,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;AAClC,eAAe,GAAG,CAAC"}
@@ -1,2 +1,6 @@
1
1
  export declare const MAIN_HEADER_MARGIN_TOP = "calc(60px + var(--space_lg))";
2
+ /**
3
+ * The Fuz ecosystem home url, e.g. for `DocsFooter`'s `root_url`.
4
+ */
5
+ export declare const FUZ_DEV_URL = "https://www.fuz.dev/";
2
6
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,iCAAiC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,WAAW,yBAAyB,CAAC"}
package/dist/constants.js CHANGED
@@ -1,3 +1,7 @@
1
1
  // TODO the 60px is a hack, need `--docs_primary_nav_height` exported or :root values from Fuz -- the --space_lg also needs to be kept in sync
2
2
  // see also the same issue in fuz_css
3
3
  export const MAIN_HEADER_MARGIN_TOP = 'calc(60px + var(--space_lg))';
4
+ /**
5
+ * The Fuz ecosystem home url, e.g. for `DocsFooter`'s `root_url`.
6
+ */
7
+ export const FUZ_DEV_URL = 'https://www.fuz.dev/';
@@ -8,36 +8,6 @@
8
8
  *
9
9
  * @module
10
10
  */
11
- /**
12
- * Build project-relative API documentation URL with hash anchor.
13
- *
14
- * @param declaration_name - name of the declaration to link to
15
- * @returns URL path like '/docs/api#declaration_name'
16
- */
17
- export declare const url_api_declaration: (declaration_name: string) => string;
18
- /**
19
- * Build full API documentation URL with domain and hash anchor.
20
- *
21
- * @param homepage - package homepage URL
22
- * @param declaration_name - name of the declaration to link to
23
- * @returns full URL like 'https://example.com/docs/api#declaration_name'
24
- */
25
- export declare const url_api_declaration_full: (homepage: string, declaration_name: string) => string;
26
- /**
27
- * Build project-relative module documentation URL.
28
- *
29
- * @param module_path - module path (e.g., 'helpers.ts')
30
- * @returns URL path like '/docs/api/helpers.ts'
31
- */
32
- export declare const url_api_module: (module_path: string) => string;
33
- /**
34
- * Build package logo URL with favicon.png fallback.
35
- *
36
- * @param homepage_url - package homepage URL, or null
37
- * @param logo_path - optional custom logo path (defaults to 'favicon.png')
38
- * @returns full URL to the logo, or null if no homepage
39
- */
40
- export declare const url_package_logo: (homepage_url: string | null, logo_path?: string) => string | null;
41
11
  /**
42
12
  * Convert a full URL to root-relative format by removing the origin.
43
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"library_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,kBAAkB,MAAM,KAAG,MACJ,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,kBAAkB,MAAM,KAAG,MACR,CAAC;AAE/E;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,aAAa,MAAM,KAAG,MAA2C,CAAC;AAEjG;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC5B,cAAc,MAAM,GAAG,IAAI,EAC3B,YAAY,MAAM,KAChB,MAAM,GAAG,IAIX,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,EAAE,SAAQ,MAAwB,KAAG,MAcpF,CAAC"}
1
+ {"version":3,"file":"library_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,EAAE,SAAQ,MAAwB,KAAG,MAcpF,CAAC"}
@@ -10,42 +10,6 @@
10
10
  */
11
11
  import { ensure_end, strip_start } from '@fuzdev/fuz_util/string.js';
12
12
  import { page } from '$app/state';
13
- import { DOCS_API_PATH, DOCS_PATH_DEFAULT } from './docs_helpers.svelte.js';
14
- /**
15
- * Build project-relative API documentation URL with hash anchor.
16
- *
17
- * @param declaration_name - name of the declaration to link to
18
- * @returns URL path like '/docs/api#declaration_name'
19
- */
20
- export const url_api_declaration = (declaration_name) => `${DOCS_API_PATH}#${encodeURIComponent(declaration_name)}`;
21
- /**
22
- * Build full API documentation URL with domain and hash anchor.
23
- *
24
- * @param homepage - package homepage URL
25
- * @param declaration_name - name of the declaration to link to
26
- * @returns full URL like 'https://example.com/docs/api#declaration_name'
27
- */
28
- export const url_api_declaration_full = (homepage, declaration_name) => `${homepage}${DOCS_PATH_DEFAULT}/api#${encodeURIComponent(declaration_name)}`;
29
- /**
30
- * Build project-relative module documentation URL.
31
- *
32
- * @param module_path - module path (e.g., 'helpers.ts')
33
- * @returns URL path like '/docs/api/helpers.ts'
34
- */
35
- export const url_api_module = (module_path) => `${DOCS_API_PATH}/${module_path}`;
36
- /**
37
- * Build package logo URL with favicon.png fallback.
38
- *
39
- * @param homepage_url - package homepage URL, or null
40
- * @param logo_path - optional custom logo path (defaults to 'favicon.png')
41
- * @returns full URL to the logo, or null if no homepage
42
- */
43
- export const url_package_logo = (homepage_url, logo_path) => {
44
- if (!homepage_url)
45
- return null;
46
- const path = logo_path ? strip_start(logo_path, '/') : 'favicon.png';
47
- return ensure_end(homepage_url, '/') + path;
48
- };
49
13
  /**
50
14
  * Convert a full URL to root-relative format by removing the origin.
51
15
  *
@@ -38,6 +38,13 @@ export declare class Module {
38
38
  * API documentation URL for this module.
39
39
  */
40
40
  url_api: string;
41
+ /**
42
+ * Public documentation link (if `homepage_url` is available).
43
+ *
44
+ * Absolute URL into the library's own deployed docs, for rendering a
45
+ * foreign library's modules on a different site (e.g. an aggregator).
46
+ */
47
+ url_api_full: string | undefined;
41
48
  /**
42
49
  * GitHub source URL.
43
50
  */
@@ -1 +1 @@
1
- {"version":3,"file":"module.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/module.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGjD;;;;;;;;GAQG;AACH,qBAAa,MAAM;IAClB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAiB;IAK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UAAU,WAA+C;gBAE7C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe;IAK1D;;OAEG;IACH,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;CAG9D"}
@@ -43,6 +43,15 @@ export class Module {
43
43
  * API documentation URL for this module.
44
44
  */
45
45
  url_api = $derived(`/docs/api${this.library.url_prefix}/${this.path}`);
46
+ /**
47
+ * Public documentation link (if `homepage_url` is available).
48
+ *
49
+ * Absolute URL into the library's own deployed docs, for rendering a
50
+ * foreign library's modules on a different site (e.g. an aggregator).
51
+ */
52
+ url_api_full = $derived(this.library.homepage_url
53
+ ? `${this.library.homepage_url.replace(/\/$/, '')}/docs/api/${this.path}`
54
+ : undefined);
46
55
  /**
47
56
  * GitHub source URL.
48
57
  */
@@ -0,0 +1,34 @@
1
+ import type { Url } from '@fuzdev/fuz_util/url.js';
2
+ import type { SvgData } from './svg.js';
3
+ export interface SiteStateOptions {
4
+ /**
5
+ * The site's icon, e.g. a logo from `logos.ts`.
6
+ */
7
+ icon?: SvgData | null;
8
+ /**
9
+ * The site's glyph, a single unicode character identifying the project.
10
+ */
11
+ glyph?: string | null;
12
+ /**
13
+ * The site's source repository url, e.g. for `DocsFooter` links.
14
+ */
15
+ repo_url?: Url | null;
16
+ }
17
+ /**
18
+ * Light site-identity values for app chrome - the icon, glyph, and repo url used
19
+ * by components like `Breadcrumb` and `DocsFooter`. Set once per app at the root
20
+ * layout. Distinct from `library_context`, which carries the heavy
21
+ * module/declaration metadata that only docs and API pages need.
22
+ */
23
+ export declare class SiteState {
24
+ icon: SvgData | null;
25
+ glyph: string | null;
26
+ repo_url: Url | null;
27
+ constructor(options?: SiteStateOptions);
28
+ }
29
+ export declare const site_context: {
30
+ get: (error_message?: string) => SiteState;
31
+ get_maybe: () => SiteState | undefined;
32
+ set: (value: SiteState) => SiteState;
33
+ };
34
+ //# sourceMappingURL=site.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/site.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,yBAAyB,CAAC;AAGjD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,qBAAa,SAAS;IACrB,IAAI,EAAE,OAAO,GAAG,IAAI,CAAoB;IACxC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAoB;IACxC,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAoB;gBAE5B,OAAO,GAAE,gBAAqB;CAK1C;AAED,eAAO,MAAM,YAAY;;;;CAA8B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { create_context } from './context_helpers.js';
2
+ /**
3
+ * Light site-identity values for app chrome - the icon, glyph, and repo url used
4
+ * by components like `Breadcrumb` and `DocsFooter`. Set once per app at the root
5
+ * layout. Distinct from `library_context`, which carries the heavy
6
+ * module/declaration metadata that only docs and API pages need.
7
+ */
8
+ export class SiteState {
9
+ icon = $state.raw(null);
10
+ glyph = $state.raw(null);
11
+ repo_url = $state.raw(null);
12
+ constructor(options = {}) {
13
+ this.icon = options.icon ?? null;
14
+ this.glyph = options.glyph ?? null;
15
+ this.repo_url = options.repo_url ?? null;
16
+ }
17
+ }
18
+ export const site_context = create_context();
package/dist/svg.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import type { SvelteHTMLElements } from 'svelte/elements';
2
+ export interface SvgData {
3
+ /**
4
+ * Raw svg markup string that's inserted unsafely as a child of the `svg` element.
5
+ * This is an escape hatch for non-`path` markup -
6
+ * generally, you should instead use the `paths` property to avoid security/CSP implications.
7
+ */
8
+ raw?: string | null;
9
+ /**
10
+ * List of svg `path` attribute objects. The `d` attribute is required.
11
+ */
12
+ paths?: Array<{
13
+ d: string;
14
+ } & SvelteHTMLElements['path']> | null;
15
+ attrs?: SvelteHTMLElements['svg'] | null;
16
+ fill?: string | null;
17
+ width?: string | null;
18
+ height?: string | null;
19
+ label?: string | null;
20
+ /**
21
+ * Defaults to `"0 0 100 100"`.
22
+ */
23
+ viewBox?: string | null;
24
+ }
25
+ //# sourceMappingURL=svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/svg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,OAAO;IACvB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/D,KAAK,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB"}
package/dist/svg.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_ui",
3
- "version": "0.196.0",
3
+ "version": "0.198.0",
4
4
  "description": "Svelte UI library",
5
5
  "tagline": "friendly user zystem",
6
6
  "glyph": "🧶",
@@ -80,9 +80,9 @@
80
80
  },
81
81
  "devDependencies": {
82
82
  "@changesets/changelog-git": "^0.2.1",
83
- "@fuzdev/blake3_wasm": "^0.1.0",
83
+ "@fuzdev/blake3_wasm": "^0.1.1",
84
84
  "@fuzdev/fuz_code": "^0.45.1",
85
- "@fuzdev/fuz_css": "^0.60.0",
85
+ "@fuzdev/fuz_css": "^0.61.1",
86
86
  "@fuzdev/fuz_util": "^0.63.0",
87
87
  "@fuzdev/gro": "^0.200.0",
88
88
  "@jridgewell/trace-mapping": "^0.3.31",
@@ -95,20 +95,20 @@
95
95
  "@types/estree": "^1.0.8",
96
96
  "@types/node": "^24.10.1",
97
97
  "@webref/css": "^8.2.0",
98
- "eslint": "^9.39.1",
99
- "eslint-plugin-svelte": "^3.13.1",
98
+ "eslint": "^9.39.4",
99
+ "eslint-plugin-svelte": "^3.19.0",
100
100
  "esm-env": "^1.2.2",
101
101
  "jsdom": "^27.2.0",
102
102
  "magic-string": "^0.30.21",
103
103
  "prettier": "^3.7.4",
104
104
  "prettier-plugin-svelte": "^3.5.1",
105
- "svelte": "^5.55.10",
105
+ "svelte": "^5.56.0",
106
106
  "svelte-check": "^4.4.8",
107
107
  "svelte-docinfo": "^0.2.0",
108
108
  "svelte2tsx": "^0.7.55",
109
109
  "tslib": "^2.8.1",
110
110
  "typescript": "^5.9.3",
111
- "typescript-eslint": "^8.48.1",
111
+ "typescript-eslint": "^8.60.0",
112
112
  "vite": "^7.3.1",
113
113
  "vitest": "^4.0.15",
114
114
  "zimmerframe": "^1.1.4",
@@ -1,3 +1,8 @@
1
1
  // TODO the 60px is a hack, need `--docs_primary_nav_height` exported or :root values from Fuz -- the --space_lg also needs to be kept in sync
2
2
  // see also the same issue in fuz_css
3
3
  export const MAIN_HEADER_MARGIN_TOP = 'calc(60px + var(--space_lg))';
4
+
5
+ /**
6
+ * The Fuz ecosystem home url, e.g. for `DocsFooter`'s `root_url`.
7
+ */
8
+ export const FUZ_DEV_URL = 'https://www.fuz.dev/';
@@ -12,51 +12,6 @@
12
12
  import {ensure_end, strip_start} from '@fuzdev/fuz_util/string.js';
13
13
  import {page} from '$app/state';
14
14
 
15
- import {DOCS_API_PATH, DOCS_PATH_DEFAULT} from './docs_helpers.svelte.js';
16
-
17
- /**
18
- * Build project-relative API documentation URL with hash anchor.
19
- *
20
- * @param declaration_name - name of the declaration to link to
21
- * @returns URL path like '/docs/api#declaration_name'
22
- */
23
- export const url_api_declaration = (declaration_name: string): string =>
24
- `${DOCS_API_PATH}#${encodeURIComponent(declaration_name)}`;
25
-
26
- /**
27
- * Build full API documentation URL with domain and hash anchor.
28
- *
29
- * @param homepage - package homepage URL
30
- * @param declaration_name - name of the declaration to link to
31
- * @returns full URL like 'https://example.com/docs/api#declaration_name'
32
- */
33
- export const url_api_declaration_full = (homepage: string, declaration_name: string): string =>
34
- `${homepage}${DOCS_PATH_DEFAULT}/api#${encodeURIComponent(declaration_name)}`;
35
-
36
- /**
37
- * Build project-relative module documentation URL.
38
- *
39
- * @param module_path - module path (e.g., 'helpers.ts')
40
- * @returns URL path like '/docs/api/helpers.ts'
41
- */
42
- export const url_api_module = (module_path: string): string => `${DOCS_API_PATH}/${module_path}`;
43
-
44
- /**
45
- * Build package logo URL with favicon.png fallback.
46
- *
47
- * @param homepage_url - package homepage URL, or null
48
- * @param logo_path - optional custom logo path (defaults to 'favicon.png')
49
- * @returns full URL to the logo, or null if no homepage
50
- */
51
- export const url_package_logo = (
52
- homepage_url: string | null,
53
- logo_path?: string,
54
- ): string | null => {
55
- if (!homepage_url) return null;
56
- const path = logo_path ? strip_start(logo_path, '/') : 'favicon.png';
57
- return ensure_end(homepage_url, '/') + path;
58
- };
59
-
60
15
  /**
61
16
  * Convert a full URL to root-relative format by removing the origin.
62
17
  *
package/src/lib/logos.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type {SvgData} from './Svg.svelte';
1
+ import type {SvgData} from './svg.js';
2
2
 
3
3
  // TODO these can be optimized during builds, helpers and gen files?
4
4
 
@@ -603,7 +603,7 @@ export class MdzLexer {
603
603
  const open_type = kind === 'italic' ? 'italic_open' : 'strikethrough_open';
604
604
  const close_type = kind === 'italic' ? 'italic_close' : 'strikethrough_close';
605
605
  const open_token_index = this.#tokens.length;
606
- this.#tokens.push({type: open_type, start, end: this.#index} as MdzToken);
606
+ this.#tokens.push({type: open_type, start, end: this.#index});
607
607
 
608
608
  // Set search boundary for nested parsers
609
609
  const saved_max = this.#max_search_index;
@@ -634,7 +634,7 @@ export class MdzLexer {
634
634
  type: close_type,
635
635
  start: close_index,
636
636
  end: close_index + 1,
637
- } as MdzToken);
637
+ });
638
638
  this.#index = close_index + 1;
639
639
  } else {
640
640
  // Convert opening to text
@@ -443,7 +443,7 @@ class MdzTokenParser {
443
443
  end: node.end,
444
444
  };
445
445
  } else {
446
- pending_text = {...node} as MdzTextNode;
446
+ pending_text = {...node};
447
447
  }
448
448
  } else {
449
449
  if (pending_text) {
@@ -55,6 +55,18 @@ export class Module {
55
55
  */
56
56
  url_api = $derived(`/docs/api${this.library.url_prefix}/${this.path}`);
57
57
 
58
+ /**
59
+ * Public documentation link (if `homepage_url` is available).
60
+ *
61
+ * Absolute URL into the library's own deployed docs, for rendering a
62
+ * foreign library's modules on a different site (e.g. an aggregator).
63
+ */
64
+ url_api_full = $derived(
65
+ this.library.homepage_url
66
+ ? `${this.library.homepage_url.replace(/\/$/, '')}/docs/api/${this.path}`
67
+ : undefined,
68
+ );
69
+
58
70
  /**
59
71
  * GitHub source URL.
60
72
  */
@@ -0,0 +1,39 @@
1
+ import type {Url} from '@fuzdev/fuz_util/url.js';
2
+
3
+ import {create_context} from './context_helpers.js';
4
+ import type {SvgData} from './svg.js';
5
+
6
+ export interface SiteStateOptions {
7
+ /**
8
+ * The site's icon, e.g. a logo from `logos.ts`.
9
+ */
10
+ icon?: SvgData | null;
11
+ /**
12
+ * The site's glyph, a single unicode character identifying the project.
13
+ */
14
+ glyph?: string | null;
15
+ /**
16
+ * The site's source repository url, e.g. for `DocsFooter` links.
17
+ */
18
+ repo_url?: Url | null;
19
+ }
20
+
21
+ /**
22
+ * Light site-identity values for app chrome - the icon, glyph, and repo url used
23
+ * by components like `Breadcrumb` and `DocsFooter`. Set once per app at the root
24
+ * layout. Distinct from `library_context`, which carries the heavy
25
+ * module/declaration metadata that only docs and API pages need.
26
+ */
27
+ export class SiteState {
28
+ icon: SvgData | null = $state.raw(null);
29
+ glyph: string | null = $state.raw(null);
30
+ repo_url: Url | null = $state.raw(null);
31
+
32
+ constructor(options: SiteStateOptions = {}) {
33
+ this.icon = options.icon ?? null;
34
+ this.glyph = options.glyph ?? null;
35
+ this.repo_url = options.repo_url ?? null;
36
+ }
37
+ }
38
+
39
+ export const site_context = create_context<SiteState>();
@@ -41,7 +41,7 @@ export const load_from_storage = <T>(
41
41
  return parse_fn(value);
42
42
  }
43
43
 
44
- return value as unknown as T;
44
+ return value;
45
45
  } catch (_) {
46
46
  return null;
47
47
  }
package/src/lib/svg.ts ADDED
@@ -0,0 +1,23 @@
1
+ import type {SvelteHTMLElements} from 'svelte/elements';
2
+
3
+ export interface SvgData {
4
+ /**
5
+ * Raw svg markup string that's inserted unsafely as a child of the `svg` element.
6
+ * This is an escape hatch for non-`path` markup -
7
+ * generally, you should instead use the `paths` property to avoid security/CSP implications.
8
+ */
9
+ raw?: string | null;
10
+ /**
11
+ * List of svg `path` attribute objects. The `d` attribute is required.
12
+ */
13
+ paths?: Array<{d: string} & SvelteHTMLElements['path']> | null;
14
+ attrs?: SvelteHTMLElements['svg'] | null;
15
+ fill?: string | null;
16
+ width?: string | null;
17
+ height?: string | null;
18
+ label?: string | null;
19
+ /**
20
+ * Defaults to `"0 0 100 100"`.
21
+ */
22
+ viewBox?: string | null;
23
+ }