@fuzdev/fuz_ui 0.177.0 โ†’ 0.178.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 (65) hide show
  1. package/README.md +9 -9
  2. package/dist/ApiDeclarationList.svelte +1 -1
  3. package/dist/ApiIndex.svelte +1 -1
  4. package/dist/ContextmenuRoot.svelte +2 -2
  5. package/dist/ContextmenuRootForSafariCompatibility.svelte +2 -2
  6. package/dist/DeclarationDetail.svelte +7 -7
  7. package/dist/DeclarationLink.svelte +5 -1
  8. package/dist/DeclarationLink.svelte.d.ts +2 -0
  9. package/dist/DeclarationLink.svelte.d.ts.map +1 -1
  10. package/dist/DocsContent.svelte +1 -1
  11. package/dist/DocsLink.svelte +5 -2
  12. package/dist/DocsLink.svelte.d.ts +2 -0
  13. package/dist/DocsLink.svelte.d.ts.map +1 -1
  14. package/dist/DocsPageLinks.svelte +1 -1
  15. package/dist/DocsSearch.svelte +2 -2
  16. package/dist/GithubLink.svelte +8 -5
  17. package/dist/GithubLink.svelte.d.ts +2 -0
  18. package/dist/GithubLink.svelte.d.ts.map +1 -1
  19. package/dist/Glyph.svelte +1 -1
  20. package/dist/ImgOrSvg.svelte +1 -1
  21. package/dist/LibraryDetail.svelte +1 -1
  22. package/dist/LibrarySummary.svelte +1 -1
  23. package/dist/MdnLink.svelte +9 -5
  24. package/dist/MdnLink.svelte.d.ts +2 -0
  25. package/dist/MdnLink.svelte.d.ts.map +1 -1
  26. package/dist/Mdz.svelte +1 -2
  27. package/dist/ModuleLink.svelte +5 -1
  28. package/dist/ModuleLink.svelte.d.ts +2 -0
  29. package/dist/ModuleLink.svelte.d.ts.map +1 -1
  30. package/dist/PendingAnimation.svelte +3 -4
  31. package/dist/PendingAnimation.svelte.d.ts.map +1 -1
  32. package/dist/ProjectLinks.svelte +2 -2
  33. package/dist/Svg.svelte +11 -3
  34. package/dist/Svg.svelte.d.ts.map +1 -1
  35. package/dist/TomeContent.svelte +3 -3
  36. package/dist/TomeLink.svelte +6 -1
  37. package/dist/TomeLink.svelte.d.ts +1 -0
  38. package/dist/TomeLink.svelte.d.ts.map +1 -1
  39. package/dist/TomeSectionHeader.svelte +3 -3
  40. package/dist/TypeLink.svelte +10 -3
  41. package/dist/TypeLink.svelte.d.ts +2 -0
  42. package/dist/TypeLink.svelte.d.ts.map +1 -1
  43. package/dist/constants.js +1 -1
  44. package/dist/contextmenu_helpers.d.ts.map +1 -1
  45. package/dist/contextmenu_helpers.js +6 -8
  46. package/dist/library.svelte.d.ts +1 -0
  47. package/dist/library.svelte.d.ts.map +1 -1
  48. package/dist/library_analysis.d.ts +1 -1
  49. package/dist/library_analysis.js +1 -1
  50. package/dist/library_gen.d.ts.map +1 -1
  51. package/dist/library_gen.js +1 -0
  52. package/dist/logos.js +1 -1
  53. package/dist/module_helpers.d.ts +2 -2
  54. package/dist/module_helpers.js +1 -1
  55. package/dist/tome.d.ts +3 -0
  56. package/dist/tome.d.ts.map +1 -1
  57. package/dist/tome.js +5 -1
  58. package/package.json +5 -4
  59. package/src/lib/constants.ts +1 -1
  60. package/src/lib/contextmenu_helpers.ts +3 -5
  61. package/src/lib/library_analysis.ts +1 -1
  62. package/src/lib/library_gen.ts +1 -0
  63. package/src/lib/logos.ts +1 -1
  64. package/src/lib/module_helpers.ts +2 -2
  65. package/src/lib/tome.ts +5 -1
package/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  > friendly user zystem ๐Ÿงถ [fuz.dev](https://ui.fuz.dev/)
6
6
 
7
- Fuz UI is a [Svelte](https://svelte.dev/) UI library
7
+ fuz_ui is a [Svelte](https://svelte.dev/) UI library
8
8
  with components and helpers for making zippy websites.
9
9
  It's in early alpha and it will go through many breaking changes.
10
10
 
11
- Fuz UI is being made to support
11
+ fuz_ui is being made to support
12
12
  [my other projects](https://www.ryanatkn.com/)
13
13
  that focus on end-users.
14
14
  Fuz emphasizes capability and efficiency and tries to be simple for those goals.
@@ -19,9 +19,9 @@ Feel free to take the ideas and code for your own purposes.
19
19
 
20
20
  The Svelte components and helpers:
21
21
 
22
- - builds on [Fuz CSS](https://github.com/fuzdev/fuz_css)
22
+ - builds on [fuz_css](https://github.com/fuzdev/fuz_css)
23
23
  - plain CSS and minimal abstraction
24
- - near-zero dependencies except for Svelte, SvelteKit, Fuz CSS,
24
+ - near-zero dependencies except for Svelte, SvelteKit, fuz_css,
25
25
  and my utility library [`@fuzdev/fuz_util`](https://github.com/fuzdev/fuz_util)
26
26
  (not all components require SvelteKit but some do import its modules, needs more consideration)
27
27
  - not a fully-featured enterprise-ready set of components,
@@ -36,7 +36,7 @@ The Svelte components and helpers:
36
36
  > thank you see [contributing.md](contributing.md), your input is appreciated.
37
37
  >
38
38
  > If you feel comfortable looking at the source code,
39
- > Fuz UI is ready to use in your own projects,
39
+ > fuz_ui is ready to use in your own projects,
40
40
  > with the major caveat that there will be a lot of breaking changes ahead.
41
41
  > The code is significantly incomplete but I think it's stable enough to use
42
42
  > if you're willing to keep up with the relatively fast-moving changelog.
@@ -45,17 +45,17 @@ The Svelte components and helpers:
45
45
  npm i -D @fuzdev/fuz_ui
46
46
  ```
47
47
 
48
- Fuz uses my style framework [Fuz CSS](https://github.com/fuzdev/fuz_css).
48
+ Fuz uses my style framework [fuz_css](https://github.com/fuzdev/fuz_css).
49
49
  Import modules at their full paths:
50
50
 
51
51
  ```ts
52
- // Fuz CSS has one main plain CSS stylesheet:
52
+ // fuz_css has one main plain CSS stylesheet:
53
53
  import '@fuzdev/fuz_css/style.css';
54
54
 
55
- // and import a Fuz CSS theme:
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:
58
+ // using Gro generates fuz_css' utility classes stylesheet by default:
59
59
  import '$routes/fuz.css';
60
60
 
61
61
  // then import Fuz Svelte components:
@@ -25,7 +25,7 @@
25
25
  {#each declarations as declaration (`${declaration.module_path}:${declaration.name}`)}
26
26
  <TomeSection>
27
27
  <TomeSectionHeader text={declaration.name}>
28
- <div class="word_break_break_all">{declaration.name}</div>
28
+ <div class="word-break:break-all">{declaration.name}</div>
29
29
  </TomeSectionHeader>
30
30
  <article id={declaration.name}>
31
31
  <DeclarationDetail {declaration} />
@@ -31,7 +31,7 @@
31
31
  minimal?: boolean;
32
32
  } = $props();
33
33
 
34
- const search = create_declaration_search(library);
34
+ const search = $derived(create_declaration_search(library));
35
35
  </script>
36
36
 
37
37
  <svelte:head>
@@ -267,8 +267,8 @@
267
267
  }
268
268
  };
269
269
 
270
- const keyboard_handlers = contextmenu_create_keyboard_handlers(contextmenu);
271
- const keydown = contextmenu_create_keydown_handler(keyboard_handlers);
270
+ const keyboard_handlers = $derived(contextmenu_create_keyboard_handlers(contextmenu));
271
+ const keydown = $derived(contextmenu_create_keydown_handler(keyboard_handlers));
272
272
  </script>
273
273
 
274
274
  <svelte:window
@@ -376,8 +376,8 @@
376
376
  }
377
377
  };
378
378
 
379
- const keyboard_handlers = contextmenu_create_keyboard_handlers(contextmenu);
380
- const keydown = contextmenu_create_keydown_handler(keyboard_handlers);
379
+ const keyboard_handlers = $derived(contextmenu_create_keyboard_handlers(contextmenu));
380
+ const keydown = $derived(contextmenu_create_keydown_handler(keyboard_handlers));
381
381
 
382
382
  /**
383
383
  * Creates an attachment that registers touch event listeners with { passive: false }
@@ -12,7 +12,7 @@
12
12
  </script>
13
13
 
14
14
  <!-- Metadata -->
15
- <p class="row justify_content_space_between">
15
+ <p class="row justify-content:space-between">
16
16
  <ModuleLink module_path={declaration.module_path} />
17
17
  {#if declaration.url_github}
18
18
  <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
@@ -31,7 +31,7 @@
31
31
 
32
32
  <!-- type signature -->
33
33
  {#if declaration.type_signature}
34
- <Code content={declaration.type_signature} lang="ts" class="mb_lg" />
34
+ <Code lang="ts" content={declaration.type_signature} />
35
35
  {/if}
36
36
 
37
37
  <!-- documentation -->
@@ -63,7 +63,7 @@
63
63
  {/if}
64
64
  {#if param.default_value}
65
65
  <strong>default</strong>
66
- <Code content={param.default_value} lang="ts" />
66
+ <Code lang="ts" content={param.default_value} />
67
67
  {/if}
68
68
  </div>
69
69
  {/if}
@@ -99,7 +99,7 @@
99
99
  {/if}
100
100
  {#if prop.default_value}
101
101
  <strong>default</strong>
102
- <Code content={prop.default_value} lang="ts" />
102
+ <Code lang="ts" content={prop.default_value} />
103
103
  {/if}
104
104
  </div>
105
105
  {/if}
@@ -112,7 +112,7 @@
112
112
  {#if declaration.return_type}
113
113
  <section>
114
114
  <h4>returns</h4>
115
- <Code content={declaration.return_type} lang="ts" />
115
+ <Code lang="ts" content={declaration.return_type} />
116
116
  {#if declaration.return_description}
117
117
  <Mdz content={declaration.return_description} />
118
118
  {/if}
@@ -203,7 +203,7 @@
203
203
  {#each declaration.examples as example, i (example)}
204
204
  <Details>
205
205
  {#snippet summary()}Example {i + 1}{/snippet}
206
- <Code content={example} lang="ts" />
206
+ <Code lang="ts" content={example} />
207
207
  </Details>
208
208
  {/each}
209
209
  </section>
@@ -273,7 +273,7 @@
273
273
  {/if}
274
274
  {#if param.default_value}
275
275
  <strong>default</strong>
276
- <Code content={param.default_value} lang="ts" />
276
+ <Code lang="ts" content={param.default_value} />
277
277
  {/if}
278
278
  </div>
279
279
  {/if}
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type {SvelteHTMLElements} from 'svelte/elements';
3
+ import {ensure_start} from '@fuzdev/fuz_util/string.js';
3
4
 
4
5
  import {library_context} from './library.svelte.js';
5
6
  import {contextmenu_attachment} from './contextmenu_state.svelte.js';
@@ -7,11 +8,14 @@
7
8
 
8
9
  const {
9
10
  name,
11
+ hash,
10
12
  children,
11
13
  class: class_prop = 'chip',
12
14
  ...rest
13
15
  }: SvelteHTMLElements['a'] & {
14
16
  name: string;
17
+ /** URL fragment to append, with or without the `#`. */
18
+ hash?: string;
15
19
  } = $props();
16
20
 
17
21
  const library = library_context.get();
@@ -31,7 +35,7 @@
31
35
  <a
32
36
  {...rest}
33
37
  class="declaration_link {class_prop}"
34
- href={declaration.url_api}
38
+ href={declaration.url_api + (hash ? ensure_start(hash, '#') : '')}
35
39
  {@attach contextmenu_attachment(contextmenu_entries)}
36
40
  >
37
41
  {#if children}
@@ -1,6 +1,8 @@
1
1
  import type { SvelteHTMLElements } from 'svelte/elements';
2
2
  type $$ComponentProps = SvelteHTMLElements['a'] & {
3
3
  name: string;
4
+ /** URL fragment to append, with or without the `#`. */
5
+ hash?: string;
4
6
  };
5
7
  declare const DeclarationLink: import("svelte").Component<$$ComponentProps, {}, "">;
6
8
  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;AAMvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AA+CH,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;CACd,CAAC;AAiDH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -22,7 +22,7 @@
22
22
  } = $props();
23
23
  </script>
24
24
 
25
- <div {...rest} class="width_upto_md {rest.class}">
25
+ <div {...rest} class="width_atmost_md {rest.class}">
26
26
  {#if header}
27
27
  {@render header()}
28
28
  {:else}
@@ -9,10 +9,13 @@
9
9
 
10
10
  const {
11
11
  reference,
12
+ hash,
12
13
  display_text,
13
14
  children: children_prop,
14
15
  }: {
15
16
  reference: string;
17
+ /** URL fragment to append, with or without the `#`. */
18
+ hash?: string;
16
19
  display_text?: string | null;
17
20
  children?: Snippet<[Declaration | undefined, Module | undefined]>;
18
21
  } = $props();
@@ -24,11 +27,11 @@
24
27
  </script>
25
28
 
26
29
  {#if declaration}
27
- <DeclarationLink name={reference}>
30
+ <DeclarationLink name={reference} {hash}>
28
31
  {@render children()}
29
32
  </DeclarationLink>
30
33
  {:else if module}
31
- <ModuleLink module_path={module.path}>
34
+ <ModuleLink module_path={module.path} {hash}>
32
35
  {@render children()}
33
36
  </ModuleLink>
34
37
  {:else}
@@ -3,6 +3,8 @@ import type { Declaration } from './declaration.svelte.js';
3
3
  import type { Module } from './module.svelte.js';
4
4
  type $$ComponentProps = {
5
5
  reference: string;
6
+ /** URL fragment to append, with or without the `#`. */
7
+ hash?: string;
6
8
  display_text?: string | null;
7
9
  children?: Snippet<[Declaration | undefined, Module | undefined]>;
8
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DocsLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE9C,KAAK,gBAAgB,GAAI;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAClE,CAAC;AAyCH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"DocsLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE9C,KAAK,gBAAgB,GAAI;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAClE,CAAC;AA0CH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -30,7 +30,7 @@
30
30
  </DocsList>
31
31
 
32
32
  {#snippet content()}
33
- <nav aria-label="on this page" class="width_100">
33
+ <nav aria-label="on this page" class="width:100%">
34
34
  <ul class="unstyled">
35
35
  {#each docs_links.docs_links as item (item.id)}
36
36
  <li
@@ -23,12 +23,12 @@
23
23
  const has_search = $derived(search_query.trim().length > 0);
24
24
  </script>
25
25
 
26
- <label class="display_block position_relative">
26
+ <label class="display:block position:relative">
27
27
  <input {...rest} type="search" {placeholder} bind:value={search_query} />
28
28
  {#if has_search}
29
29
  <button
30
30
  type="button"
31
- class="plain icon_button position_absolute right_0 top_0"
31
+ class="plain icon_button position:absolute right:0 top:0"
32
32
  onclick={() => {
33
33
  search_query = '';
34
34
  }}
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import {strip_start} from '@fuzdev/fuz_util/string.js';
2
+ import {ensure_start, strip_start} from '@fuzdev/fuz_util/string.js';
3
3
  import type {SvelteHTMLElements} from 'svelte/elements';
4
4
  import {DEV} from 'esm-env';
5
5
 
@@ -8,6 +8,7 @@
8
8
 
9
9
  const {
10
10
  path,
11
+ hash,
11
12
  href: href_prop,
12
13
  children,
13
14
  ...rest
@@ -19,6 +20,8 @@
19
20
  * @example https://github.com/fuzdev/fuz_ui/issues/123
20
21
  */
21
22
  path?: string;
23
+ /** URL fragment to append, with or without the `#`. */
24
+ hash?: string;
22
25
  } = $props();
23
26
 
24
27
  if (DEV) {
@@ -30,12 +33,12 @@
30
33
  }
31
34
 
32
35
  const href = $derived(
33
- href_prop ??
36
+ (href_prop ??
34
37
  (path
35
38
  ? path.startsWith('https://')
36
39
  ? path
37
40
  : `https://github.com/${strip_start(path, '/')}`
38
- : ''),
41
+ : '')) + (hash ? ensure_start(hash, '#') : ''),
39
42
  );
40
43
 
41
44
  // extract meaningful display text from the path
@@ -63,8 +66,8 @@
63
66
 
64
67
  <!-- TODO -next-line doesnt work? -->
65
68
  <!-- eslint-disable svelte/no-navigation-without-resolve -->
66
- <a {...rest} {href} class="github_link white_space_nowrap {rest.class}" rel="noopener"
67
- ><Svg data={logo_github} inline size="var(--icon_size_xs)" class="mx_xs3 vertical_align_middle" />
69
+ <a {...rest} {href} class="github_link white-space:nowrap {rest.class}" rel="noopener"
70
+ ><Svg data={logo_github} inline size="var(--icon_size_xs)" class="mx_xs3 vertical-align:middle" />
68
71
  {#if typeof final_children === 'string'}
69
72
  <span class="font_family_mono">{final_children}</span>
70
73
  {:else if final_children}
@@ -7,6 +7,8 @@ type $$ComponentProps = SvelteHTMLElements['a'] & {
7
7
  * @example https://github.com/fuzdev/fuz_ui/issues/123
8
8
  */
9
9
  path?: string;
10
+ /** URL fragment to append, with or without the `#`. */
11
+ hash?: string;
10
12
  };
11
13
  declare const GithubLink: import("svelte").Component<$$ComponentProps, {}, "">;
12
14
  type GithubLink = ReturnType<typeof GithubLink>;
@@ -1 +1 @@
1
- {"version":3,"file":"GithubLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/GithubLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAMvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAmEH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"GithubLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/GithubLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAMvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAoEH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
package/dist/Glyph.svelte CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  <span
20
20
  {...rest}
21
- class="glyph display_inline_block text_align_center line_height_1 white_space_nowrap font_weight_400 {rest.class}"
21
+ class="glyph display:inline-block text-align:center line-height:1 white-space:nowrap font-weight:400 {rest.class}"
22
22
  style:width={final_size}
23
23
  style:height={final_size}
24
24
  style:min-width={final_size}
@@ -44,7 +44,7 @@
44
44
  style:width={final_width}
45
45
  style:height={final_height}
46
46
  >
47
- <image href={src} class="width_100 height_100" />
47
+ <image href={src} class="width:100% height:100%" />
48
48
  </svg>
49
49
  {:else}
50
50
  <img
@@ -48,7 +48,7 @@
48
48
  <div class="library_detail">
49
49
  <!-- TODO maybe continue this snippet pattern, or maybe simplify? -->
50
50
  <div class="info">
51
- <div class="display_flex flex_1">
51
+ <div class="display:flex flex:1">
52
52
  <!-- add yet another wrapper so it flows like we want -->
53
53
  <div>
54
54
  <header>
@@ -65,7 +65,7 @@
65
65
  {#if description}
66
66
  {@render description(package_json.description, package_json.glyph)}
67
67
  {:else}
68
- <p class="text_align_center">
68
+ <p class="text-align:center">
69
69
  {package_json.description}
70
70
  {#if !package_json.motto}
71
71
  {package_json.glyph}
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import {strip_end, strip_start} from '@fuzdev/fuz_util/string.js';
2
+ import {ensure_start, strip_end, strip_start} from '@fuzdev/fuz_util/string.js';
3
3
  import type {SvelteHTMLElements} from 'svelte/elements';
4
4
 
5
5
  import Svg from './Svg.svelte';
@@ -7,16 +7,20 @@
7
7
 
8
8
  const {
9
9
  path,
10
+ hash,
10
11
  children,
11
12
  ...rest
12
13
  }: SvelteHTMLElements['a'] & {
13
14
  path: string;
15
+ /** URL fragment to append, with or without the `#`. */
16
+ hash?: string;
14
17
  } = $props();
15
18
 
16
19
  const href = $derived(
17
- path.startsWith('https://')
20
+ (path.startsWith('https://')
18
21
  ? path
19
- : `https://developer.mozilla.org/en-US/docs/${strip_start(path, '/')}`,
22
+ : `https://developer.mozilla.org/en-US/docs/${strip_start(path, '/')}`) +
23
+ (hash ? ensure_start(hash, '#') : ''),
20
24
  );
21
25
 
22
26
  const final_children = $derived(children ?? strip_end(path, '/').split('/').at(-1)!);
@@ -24,8 +28,8 @@
24
28
 
25
29
  <!-- TODO -next-line doesnt work? -->
26
30
  <!-- eslint-disable svelte/no-navigation-without-resolve -->
27
- <a {...rest} {href} class="mdn_link white_space_nowrap {rest.class}" rel="noopener"
28
- ><Svg data={logo_mdn} inline size="var(--icon_size_xs)" class="mx_xs3 vertical_align_middle" />
31
+ <a {...rest} {href} class="mdn_link white-space:nowrap {rest.class}" rel="noopener"
32
+ ><Svg data={logo_mdn} inline size="var(--icon_size_xs)" class="mx_xs3 vertical-align:middle" />
29
33
  {#if typeof final_children === 'string'}
30
34
  <span class="font_family_mono">{final_children}</span>
31
35
  {:else}
@@ -1,6 +1,8 @@
1
1
  import type { SvelteHTMLElements } from 'svelte/elements';
2
2
  type $$ComponentProps = SvelteHTMLElements['a'] & {
3
3
  path: string;
4
+ /** URL fragment to append, with or without the `#`. */
5
+ hash?: string;
4
6
  };
5
7
  declare const MdnLink: import("svelte").Component<$$ComponentProps, {}, "">;
6
8
  type MdnLink = ReturnType<typeof MdnLink>;
@@ -1 +1 @@
1
- {"version":3,"file":"MdnLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/MdnLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAkCH,QAAA,MAAM,OAAO,sDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"MdnLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/MdnLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAoCH,QAAA,MAAM,OAAO,sDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
package/dist/Mdz.svelte CHANGED
@@ -21,8 +21,7 @@
21
21
  <svelte:element
22
22
  this={inline ? 'span' : 'div'}
23
23
  {...rest}
24
- class:white_space_pre={nowrap}
25
- class:white_space_pre_wrap={!nowrap}
24
+ class="{rest.class} {nowrap ? 'white-space:pre' : 'white-space:pre-wrap'}"
26
25
  >
27
26
  {#each nodes as node (node)}
28
27
  <MdzNodeView {node} />
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type {SvelteHTMLElements} from 'svelte/elements';
3
+ import {ensure_start} from '@fuzdev/fuz_util/string.js';
3
4
 
4
5
  import {library_context} from './library.svelte.js';
5
6
  import {contextmenu_attachment} from './contextmenu_state.svelte.js';
@@ -7,11 +8,14 @@
7
8
 
8
9
  const {
9
10
  module_path,
11
+ hash,
10
12
  children,
11
13
  class: class_prop = 'chip',
12
14
  ...rest
13
15
  }: SvelteHTMLElements['a'] & {
14
16
  module_path: string; // TODO maybe rename?
17
+ /** URL fragment to append, with or without the `#`. */
18
+ hash?: string;
15
19
  } = $props();
16
20
 
17
21
  const library = library_context.get();
@@ -28,7 +32,7 @@
28
32
  <a
29
33
  {...rest}
30
34
  class="module_link {class_prop}"
31
- href={module.url_api}
35
+ href={module.url_api + (hash ? ensure_start(hash, '#') : '')}
32
36
  {@attach contextmenu_attachment(contextmenu_entries)}
33
37
  >
34
38
  <!-- eslint-enable svelte/no-navigation-without-resolve -->
@@ -1,6 +1,8 @@
1
1
  import type { SvelteHTMLElements } from 'svelte/elements';
2
2
  type $$ComponentProps = SvelteHTMLElements['a'] & {
3
3
  module_path: string;
4
+ /** URL fragment to append, with or without the `#`. */
5
+ hash?: string;
4
6
  };
5
7
  declare const ModuleLink: import("svelte").Component<$$ComponentProps, {}, "">;
6
8
  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;AAMvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC;AA6CH,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;CACd,CAAC;AA+CH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -21,11 +21,10 @@
21
21
 
22
22
  <span
23
23
  {...rest}
24
- class="pending_animation {rest.class}"
24
+ class="pending_animation {rest.class} {inline
25
+ ? 'display:inline-flex align-items:center'
26
+ : 'display:flex'}"
25
27
  class:running
26
- class:display_flex={!inline}
27
- class:display_inline_flex={inline}
28
- class:align_items_center={inline}
29
28
  ><span {...item_attrs} style:animation-delay="0s"
30
29
  >{#if children}{@render children(0)}{:else}โ€ข{/if}</span
31
30
  ><span {...item_attrs} style:animation-delay="0.09s"
@@ -1 +1 @@
1
- {"version":3,"file":"PendingAnimation.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingAnimation.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACpC,CAAC;AAuBH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"PendingAnimation.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingAnimation.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACpC,CAAC;AAyBH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -46,9 +46,9 @@
46
46
  <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
47
47
  <a class="thumbnail row bg px_md py_xs border_radius_sm mb_lg" href={project_item.url}
48
48
  ><Svg shrink={false} data={project_item.logo} size="var(--icon_size_lg)" />
49
- <div class="pl_lg width_upto_sm">
49
+ <div class="pl_lg width_atmost_sm">
50
50
  <div class="thumbnail_name {project_item.color_class}">{project_item.name}</div>
51
- <div class="thumbnail_description font_size_md text_color_3 font_weight_500">
51
+ <div class="thumbnail_description font_size_md text_color_3 font-weight:500">
52
52
  {project_item.description}
53
53
  {project_item.glyph}
54
54
  </div>
package/dist/Svg.svelte CHANGED
@@ -81,11 +81,10 @@
81
81
  {...data.attrs}
82
82
  {...rest}
83
83
  aria-label={label ?? data.label}
84
- class:display_inline_block={inline}
85
- class:position_relative={inline}
84
+ class="{data.attrs?.class} {rest.class}"
85
+ class:inline
86
86
  style:width={final_width}
87
87
  style:height={final_height}
88
- style:top={inline ? '0.1em' : undefined}
89
88
  style:flex-shrink={shrink ? 1 : 0}
90
89
  {style}
91
90
  >
@@ -96,3 +95,12 @@
96
95
  {/each}
97
96
  {/if}
98
97
  </svg>
98
+
99
+ <style>
100
+ .inline {
101
+ display: inline-block;
102
+ position: relative;
103
+ /* TODO idk about this, but vertical align doesnt seem quite right either */
104
+ top: 0.1em;
105
+ }
106
+ </style>
@@ -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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 const fragment = $derived(docs_slugify(tome.name));
28
28
 
29
29
  const at_root = $derived(page.url.pathname === resolve(docs_path as any));
30
30
  </script>
31
31
 
32
32
  <section
33
- class="tome_content width_upto_md mb_xl9"
33
+ class="tome_content width_atmost_md mb_xl9"
34
34
  {@attach intersect(() =>
35
35
  at_root
36
36
  ? ({intersecting}) => {
@@ -44,7 +44,7 @@
44
44
  )}
45
45
  >
46
46
  <header
47
- class="mb_xl3 position_sticky top_0"
47
+ class="mb_xl3 position:sticky top:0"
48
48
  {@attach intersect(() =>
49
49
  at_root
50
50
  ? null
@@ -15,10 +15,15 @@
15
15
  }: SvelteHTMLElements['a'] & {
16
16
  name: string; // TODO type, generate from `tomes`?
17
17
  docs_path?: string;
18
+ /** URL fragment to append, with or without the `#`. */
18
19
  hash?: string;
19
20
  } = $props();
20
21
 
21
- if (DEV) get_tome_by_name(name); // throws if not found
22
+ if (DEV) {
23
+ $effect(() => {
24
+ get_tome_by_name(name); // throws if not found
25
+ });
26
+ }
22
27
 
23
28
  // TODO add contextmenu behavior
24
29
  </script>
@@ -2,6 +2,7 @@ import type { SvelteHTMLElements } from 'svelte/elements';
2
2
  type $$ComponentProps = SvelteHTMLElements['a'] & {
3
3
  name: string;
4
4
  docs_path?: string;
5
+ /** URL fragment to append, with or without the `#`. */
5
6
  hash?: string;
6
7
  };
7
8
  declare const TomeLink: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"TomeLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA2BH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"TomeLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA+BH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -24,7 +24,7 @@
24
24
  children?: Snippet;
25
25
  } = $props();
26
26
 
27
- const fragment = docs_slugify(text);
27
+ const fragment = $derived(docs_slugify(text));
28
28
 
29
29
  const register_section_header = register_section_header_context.get();
30
30
  if (!register_section_header) {
@@ -35,7 +35,7 @@
35
35
 
36
36
  // Auto-detect tag based on depth if not explicitly provided
37
37
  const depth = section_depth_context.get();
38
- const final_tag = tag ?? (depth === 1 ? 'h2' : depth === 2 ? 'h3' : 'h4');
38
+ const final_tag = $derived(tag ?? (depth === 1 ? 'h2' : depth === 2 ? 'h3' : 'h4'));
39
39
 
40
40
  // Get own section's ID from context
41
41
  const my_section_id = section_id_context.get();
@@ -65,7 +65,7 @@
65
65
 
66
66
  <header>
67
67
  <svelte:element this={final_tag} {...rest} class:tome_section_header={true}>
68
- <div class="flex_1">
68
+ <div class="flex:1">
69
69
  {#if children}
70
70
  {@render children()}
71
71
  {:else}
@@ -4,7 +4,14 @@
4
4
  import DeclarationLink from './DeclarationLink.svelte';
5
5
  import {library_context} from './library.svelte.js';
6
6
 
7
- const {type}: {type: string} = $props();
7
+ const {
8
+ type,
9
+ hash,
10
+ }: {
11
+ type: string;
12
+ /** URL fragment to append, with or without the `#`. */
13
+ hash?: string;
14
+ } = $props();
8
15
 
9
16
  const library = library_context.get();
10
17
 
@@ -13,7 +20,7 @@
13
20
  </script>
14
21
 
15
22
  {#if library.lookup_declaration(type)}
16
- <DeclarationLink name={type} />
23
+ <DeclarationLink name={type} {hash} />
17
24
  {:else}
18
- <Code inline content={type} lang="ts" />
25
+ <Code lang="ts" content={type} inline />
19
26
  {/if}
@@ -1,5 +1,7 @@
1
1
  type $$ComponentProps = {
2
2
  type: string;
3
+ /** URL fragment to append, with or without the `#`. */
4
+ hash?: string;
3
5
  };
4
6
  declare const TypeLink: import("svelte").Component<$$ComponentProps, {}, "">;
5
7
  type TypeLink = ReturnType<typeof TypeLink>;
@@ -1 +1 @@
1
- {"version":3,"file":"TypeLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TypeLink.svelte"],"names":[],"mappings":"AAQC,KAAK,gBAAgB,GAAI;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC;AAuBzC,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"TypeLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TypeLink.svelte"],"names":[],"mappings":"AAQC,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA0BH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
package/dist/constants.js CHANGED
@@ -1,3 +1,3 @@
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
- // see also the same issue in Fuz CSS
2
+ // see also the same issue in fuz_css
3
3
  export const MAIN_HEADER_MARGIN_TOP = 'calc(60px + var(--space_lg))';
@@ -1 +1 @@
1
- {"version":3,"file":"contextmenu_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/contextmenu_helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAGpE,eAAO,MAAM,iCAAiC,KAAK,CAAC;AACpD,eAAO,MAAM,iCAAiC,KAAK,CAAC;AACpD,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,yCAAyC,KAAK,CAAC;AAC5D,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAC1D,eAAO,MAAM,4CAA4C,KAAK,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,WAAW,GAAG,IAAI,EAC1B,UAAU,OAAO,KACf,MAAM,IAAI,WAAW,GAAG,UAIF,CAAC;AAI1B,eAAO,MAAM,oCAAoC,GAChD,aAAa,gBAAgB,KAC3B,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAWtB,CAAC;AAEJ,eAAO,MAAM,kCAAkC,GAC9C,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,KACxC,CAAC,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAO7B,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAC/C,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,cAAc,MAAM,KAClB,MAAoE,CAAC;AAExE,eAAO,MAAM,mCAAmC,GAC/C,QAAQ,MAAM,EACd,aAAa,MAAM,EACnB,eAAe,MAAM,KACnB,MAAsE,CAAC"}
1
+ {"version":3,"file":"contextmenu_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/contextmenu_helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAGpE,eAAO,MAAM,iCAAiC,KAAK,CAAC;AACpD,eAAO,MAAM,iCAAiC,KAAK,CAAC;AACpD,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,yCAAyC,KAAK,CAAC;AAC5D,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAC1D,eAAO,MAAM,4CAA4C,KAAK,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,WAAW,GAAG,IAAI,EAC1B,UAAU,OAAO,KACf,MAAM,IAAI,WAAW,GAAG,UAIF,CAAC;AAI1B,eAAO,MAAM,oCAAoC,GAChD,aAAa,gBAAgB,KAC3B,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAWtB,CAAC;AAEJ,eAAO,MAAM,kCAAkC,GAC7C,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,KAAG,CAAC,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAMxE,CAAC;AAEH,eAAO,MAAM,mCAAmC,GAC/C,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,cAAc,MAAM,KAClB,MAAoE,CAAC;AAExE,eAAO,MAAM,mCAAmC,GAC/C,QAAQ,MAAM,EACd,aAAa,MAAM,EACnB,eAAe,MAAM,KACnB,MAAsE,CAAC"}
@@ -26,14 +26,12 @@ export const contextmenu_create_keyboard_handlers = (contextmenu) => new Map([
26
26
  [' ', () => contextmenu.activate_selected()],
27
27
  ['Enter', () => contextmenu.activate_selected()],
28
28
  ]);
29
- export const contextmenu_create_keydown_handler = (keyboard_handlers) => {
30
- return (e) => {
31
- const handler = keyboard_handlers.get(e.key);
32
- if (!handler || is_editable(e.target))
33
- return;
34
- swallow(e);
35
- handler();
36
- };
29
+ export const contextmenu_create_keydown_handler = (keyboard_handlers) => (e) => {
30
+ const handler = keyboard_handlers.get(e.key);
31
+ if (!handler || is_editable(e.target))
32
+ return;
33
+ swallow(e);
34
+ handler();
37
35
  };
38
36
  export const contextmenu_calculate_constrained_x = (menu_x, menu_width, layout_width) => menu_x + Math.min(0, layout_width - (menu_x + menu_width));
39
37
  export const contextmenu_calculate_constrained_y = (menu_y, menu_height, layout_height) => menu_y + Math.min(0, layout_height - (menu_y + menu_height));
@@ -138,6 +138,7 @@ export declare class Library {
138
138
  module_comment?: string | undefined;
139
139
  dependencies?: string[] | undefined;
140
140
  dependents?: string[] | undefined;
141
+ star_exports?: string[] | undefined;
141
142
  }[] | undefined;
142
143
  };
143
144
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"library.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE1C;;;;;;;;GAQG;AACH,qBAAa,OAAO;IACnB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAiB;IAEnD,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA4C;IACxD,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA2C;IAEtD,IAAI,SAAoC;IACxC,SAAS,SAAyC;IAClD,QAAQ,wCAAwC;IAChD,UAAU,gBAA0C;IACpD,YAAY,+CAA4C;IACxD,QAAQ,+CAAwC;IAChD,QAAQ,SAAwC;IAChD,OAAO,+CAAuC;IAC9C,aAAa,+CAA6C;IAC1D,SAAS,UAAyC;IAElD;;OAEG;IACH,OAAO,gBAML;IAEF;;OAEG;IACH,OAAO,WAIL;IAEF;;OAEG;IACH,cAAc,WAA4E;IAE1F;;OAEG;IACH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;IAE1F;;OAEG;IACH,YAAY,gBAAmE;IAE/E;;OAEG;IACH,eAAe,2BAAgE;gBAEnE,YAAY,EAAE,WAAW;IAIrC;;OAEG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIzD;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAItC;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI/C;;OAEG;IACH,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC;CAGtD;AAED,eAAO,MAAM,eAAe;;;;CAA4B,CAAC"}
@@ -91,7 +91,7 @@ export interface ModuleAnalysis {
91
91
  * Analyze a source file and extract module metadata.
92
92
  *
93
93
  * Unified entry point that dispatches to the appropriate analyzer based on file type:
94
- * - TypeScript/JavaScript files โ†’ `ts_analyze_module`
94
+ * - TypeScript/JS files โ†’ `ts_analyze_module`
95
95
  * - Svelte components โ†’ `svelte_analyze_module`
96
96
  *
97
97
  * Returns raw analysis data including `nodocs` flags on declarations.
@@ -50,7 +50,7 @@ import { module_extract_path, } from './module_helpers.js';
50
50
  * Analyze a source file and extract module metadata.
51
51
  *
52
52
  * Unified entry point that dispatches to the appropriate analyzer based on file type:
53
- * - TypeScript/JavaScript files โ†’ `ts_analyze_module`
53
+ * - TypeScript/JS files โ†’ `ts_analyze_module`
54
54
  * - Svelte components โ†’ `svelte_analyze_module`
55
55
  *
56
56
  * Returns raw analysis data including `nodocs` flags on declarations.
@@ -1 +1 @@
1
- {"version":3,"file":"library_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_gen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AAExD,OAAO,EACN,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M,uBAAuB,CAAC;AAElF,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IACjC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC5D;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACrC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,UAAU,QAAQ,KAAG,cAY9D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2CAA2C,GACvD,WAAW,QAAQ,CAAC,QAAQ,CAAC,EAC7B,SAAS,mBAAmB,EAC5B,MAAM;IAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;CAAC,KACtF,KAAK,CAAC,cAAc,CA6BtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,iBAAiB,KAAG,GA2CzD,CAAC"}
@@ -91,6 +91,7 @@ export const library_collect_source_files_from_disknodes = (disknodes, options,
91
91
  */
92
92
  export const library_gen = (options) => {
93
93
  return {
94
+ dependencies: 'all',
94
95
  generate: async ({ log, filer }) => {
95
96
  log.info('generating library metadata with full TypeScript analysis...');
96
97
  // Build source options with project_root from cwd
package/dist/logos.js CHANGED
@@ -9,7 +9,7 @@ Logo colors are the midpoint between the light and dark versions of color varian
9
9
  --color_c: #d93636;
10
10
  --color_d: #8866cc;
11
11
  --color_e: #d8bc31;
12
- --color_f: #84522a; // TODO this one isn't the midpoint bc Fuz CSS's color needs tweaking, too light in dark mode
12
+ --color_f: #84522a; // TODO this one isn't the midpoint bc fuz_css's color needs tweaking, too light in dark mode
13
13
  --color_g: #e55d95;
14
14
  --color_h: #f4672f;
15
15
  --color_i: #36e2e2;
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Analyzer type for source files.
13
13
  *
14
- * - `'typescript'` - TypeScript/JavaScript files analyzed via TypeScript Compiler API
14
+ * - `'typescript'` - TypeScript/JS files analyzed via TypeScript Compiler API
15
15
  * - `'svelte'` - Svelte components analyzed via svelte2tsx + TypeScript Compiler API
16
16
  */
17
17
  export type AnalyzerType = 'typescript' | 'svelte';
@@ -243,7 +243,7 @@ export declare const module_get_component_name: (module_path: string) => string;
243
243
  */
244
244
  export declare const module_get_key: (module_path: string) => string;
245
245
  /**
246
- * Check if a path is a TypeScript or JavaScript file.
246
+ * Check if a path is a TypeScript or JS file.
247
247
  *
248
248
  * Includes both `.ts` and `.js` files since JS files are valid in TS projects.
249
249
  * Excludes `.d.ts` declaration files - use a custom `get_analyzer` to include them.
@@ -213,7 +213,7 @@ export const module_get_component_name = (module_path) => module_path.replace(/^
213
213
  */
214
214
  export const module_get_key = (module_path) => `./${module_path}`;
215
215
  /**
216
- * Check if a path is a TypeScript or JavaScript file.
216
+ * Check if a path is a TypeScript or JS file.
217
217
  *
218
218
  * Includes both `.ts` and `.js` files since JS files are valid in TS projects.
219
219
  * Excludes `.d.ts` declaration files - use a custom `get_analyzer` to include them.
package/dist/tome.d.ts CHANGED
@@ -9,6 +9,9 @@ export declare const Tome: z.ZodObject<{
9
9
  related_declarations: z.ZodArray<z.ZodString>;
10
10
  }, z.core.$strip>;
11
11
  export type Tome = z.infer<typeof Tome>;
12
+ /**
13
+ * @param hash - URL fragment to append, with or without the `#`.
14
+ */
12
15
  export declare const to_tome_pathname: (item: Tome | string, docs_path?: string, hash?: string) => string;
13
16
  export declare const tomes_context: {
14
17
  get: (error_message?: string) => Map<string, {
@@ -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;AAKtB,eAAO,MAAM,IAAI;;;;;;;iBAQf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,gBAAgB,GAC5B,MAAM,IAAI,GAAG,MAAM,EACnB,kBAA6B,EAC7B,OAAO,MAAM,KACX,MAIF,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,IAK/C,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAyB,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,IAK/C,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAyB,CAAC"}
package/dist/tome.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { resolve } from '$app/paths';
2
2
  import { z } from 'zod';
3
+ import { ensure_start } from '@fuzdev/fuz_util/string.js';
3
4
  import { create_context } from './context_helpers.js';
4
5
  import { DOCS_PATH_DEFAULT, docs_slugify } from './docs_helpers.svelte.js';
5
6
  export const Tome = z.object({
@@ -11,10 +12,13 @@ export const Tome = z.object({
11
12
  related_modules: z.array(z.string()),
12
13
  related_declarations: z.array(z.string()),
13
14
  });
15
+ /**
16
+ * @param hash - URL fragment to append, with or without the `#`.
17
+ */
14
18
  export const to_tome_pathname = (item, docs_path = DOCS_PATH_DEFAULT, hash) => {
15
19
  const name = typeof item === 'string' ? item : item.name;
16
20
  const path = docs_path + '/' + docs_slugify(name);
17
- return resolve((hash ? path + '#' + hash : path));
21
+ return resolve((hash ? path + ensure_start(hash, '#') : path));
18
22
  };
19
23
  export const tomes_context = create_context();
20
24
  export const get_tome_by_name = (name) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_ui",
3
- "version": "0.177.0",
3
+ "version": "0.178.0",
4
4
  "description": "Svelte UI library",
5
5
  "motto": "friendly user zystem",
6
6
  "glyph": "๐Ÿงถ",
@@ -61,9 +61,9 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@changesets/changelog-git": "^0.2.1",
64
- "@fuzdev/fuz_code": "^0.38.0",
65
- "@fuzdev/fuz_css": "^0.42.1",
66
- "@fuzdev/fuz_util": "^0.45.1",
64
+ "@fuzdev/fuz_code": "^0.39.0",
65
+ "@fuzdev/fuz_css": "^0.44.0",
66
+ "@fuzdev/fuz_util": "^0.45.3",
67
67
  "@jridgewell/trace-mapping": "^0.3.31",
68
68
  "@ryanatkn/eslint-config": "^0.9.0",
69
69
  "@ryanatkn/gro": "^0.183.0",
@@ -72,6 +72,7 @@
72
72
  "@sveltejs/package": "^2.5.7",
73
73
  "@sveltejs/vite-plugin-svelte": "^6.2.1",
74
74
  "@types/node": "^24.10.1",
75
+ "@webref/css": "^8.2.0",
75
76
  "eslint": "^9.39.1",
76
77
  "eslint-plugin-svelte": "^3.13.1",
77
78
  "esm-env": "^1.2.2",
@@ -1,3 +1,3 @@
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
- // see also the same issue in Fuz CSS
2
+ // see also the same issue in fuz_css
3
3
  export const MAIN_HEADER_MARGIN_TOP = 'calc(60px + var(--space_lg))';
@@ -39,16 +39,14 @@ export const contextmenu_create_keyboard_handlers = (
39
39
  ['Enter', () => contextmenu.activate_selected()],
40
40
  ]);
41
41
 
42
- export const contextmenu_create_keydown_handler = (
43
- keyboard_handlers: Map<string, () => void>,
44
- ): ((e: KeyboardEvent) => void) => {
45
- return (e: KeyboardEvent): void => {
42
+ export const contextmenu_create_keydown_handler =
43
+ (keyboard_handlers: Map<string, () => void>): ((e: KeyboardEvent) => void) =>
44
+ (e: KeyboardEvent): void => {
46
45
  const handler = keyboard_handlers.get(e.key);
47
46
  if (!handler || is_editable(e.target)) return;
48
47
  swallow(e);
49
48
  handler();
50
49
  };
51
- };
52
50
 
53
51
  export const contextmenu_calculate_constrained_x = (
54
52
  menu_x: number,
@@ -103,7 +103,7 @@ export interface ModuleAnalysis {
103
103
  * Analyze a source file and extract module metadata.
104
104
  *
105
105
  * Unified entry point that dispatches to the appropriate analyzer based on file type:
106
- * - TypeScript/JavaScript files โ†’ `ts_analyze_module`
106
+ * - TypeScript/JS files โ†’ `ts_analyze_module`
107
107
  * - Svelte components โ†’ `svelte_analyze_module`
108
108
  *
109
109
  * Returns raw analysis data including `nodocs` flags on declarations.
@@ -150,6 +150,7 @@ export const library_collect_source_files_from_disknodes = (
150
150
  */
151
151
  export const library_gen = (options?: LibraryGenOptions): Gen => {
152
152
  return {
153
+ dependencies: 'all',
153
154
  generate: async ({log, filer}) => {
154
155
  log.info('generating library metadata with full TypeScript analysis...');
155
156
 
package/src/lib/logos.ts CHANGED
@@ -12,7 +12,7 @@ Logo colors are the midpoint between the light and dark versions of color varian
12
12
  --color_c: #d93636;
13
13
  --color_d: #8866cc;
14
14
  --color_e: #d8bc31;
15
- --color_f: #84522a; // TODO this one isn't the midpoint bc Fuz CSS's color needs tweaking, too light in dark mode
15
+ --color_f: #84522a; // TODO this one isn't the midpoint bc fuz_css's color needs tweaking, too light in dark mode
16
16
  --color_g: #e55d95;
17
17
  --color_h: #f4672f;
18
18
  --color_i: #36e2e2;
@@ -12,7 +12,7 @@
12
12
  /**
13
13
  * Analyzer type for source files.
14
14
  *
15
- * - `'typescript'` - TypeScript/JavaScript files analyzed via TypeScript Compiler API
15
+ * - `'typescript'` - TypeScript/JS files analyzed via TypeScript Compiler API
16
16
  * - `'svelte'` - Svelte components analyzed via svelte2tsx + TypeScript Compiler API
17
17
  */
18
18
  export type AnalyzerType = 'typescript' | 'svelte';
@@ -362,7 +362,7 @@ export const module_get_component_name = (module_path: string): string =>
362
362
  export const module_get_key = (module_path: string): string => `./${module_path}`;
363
363
 
364
364
  /**
365
- * Check if a path is a TypeScript or JavaScript file.
365
+ * Check if a path is a TypeScript or JS file.
366
366
  *
367
367
  * Includes both `.ts` and `.js` files since JS files are valid in TS projects.
368
368
  * Excludes `.d.ts` declaration files - use a custom `get_analyzer` to include them.
package/src/lib/tome.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import {resolve} from '$app/paths';
2
2
  import type {Component} from 'svelte';
3
3
  import {z} from 'zod';
4
+ import {ensure_start} from '@fuzdev/fuz_util/string.js';
4
5
 
5
6
  import {create_context} from './context_helpers.js';
6
7
  import {DOCS_PATH_DEFAULT, docs_slugify} from './docs_helpers.svelte.js';
@@ -16,6 +17,9 @@ export const Tome = z.object({
16
17
  });
17
18
  export type Tome = z.infer<typeof Tome>;
18
19
 
20
+ /**
21
+ * @param hash - URL fragment to append, with or without the `#`.
22
+ */
19
23
  export const to_tome_pathname = (
20
24
  item: Tome | string,
21
25
  docs_path = DOCS_PATH_DEFAULT,
@@ -23,7 +27,7 @@ export const to_tome_pathname = (
23
27
  ): string => {
24
28
  const name = typeof item === 'string' ? item : item.name;
25
29
  const path = docs_path + '/' + docs_slugify(name);
26
- return resolve((hash ? path + '#' + hash : path) as any);
30
+ return resolve((hash ? path + ensure_start(hash, '#') : path) as any);
27
31
  };
28
32
 
29
33
  export const tomes_context = create_context<Map<string, Tome>>();