@fuzdev/fuz_ui 0.176.1 → 0.177.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/ApiIndex.svelte +1 -1
  2. package/dist/ContextmenuRoot.svelte +2 -2
  3. package/dist/ContextmenuRootForSafariCompatibility.svelte +2 -2
  4. package/dist/DeclarationDetail.svelte +6 -6
  5. package/dist/DeclarationLink.svelte +5 -1
  6. package/dist/DeclarationLink.svelte.d.ts +2 -0
  7. package/dist/DeclarationLink.svelte.d.ts.map +1 -1
  8. package/dist/DocsLink.svelte +5 -2
  9. package/dist/DocsLink.svelte.d.ts +2 -0
  10. package/dist/DocsLink.svelte.d.ts.map +1 -1
  11. package/dist/GithubLink.svelte +6 -3
  12. package/dist/GithubLink.svelte.d.ts +2 -0
  13. package/dist/GithubLink.svelte.d.ts.map +1 -1
  14. package/dist/LibraryDetail.svelte +1 -1
  15. package/dist/MdnLink.svelte +7 -3
  16. package/dist/MdnLink.svelte.d.ts +2 -0
  17. package/dist/MdnLink.svelte.d.ts.map +1 -1
  18. package/dist/ModuleLink.svelte +5 -1
  19. package/dist/ModuleLink.svelte.d.ts +2 -0
  20. package/dist/ModuleLink.svelte.d.ts.map +1 -1
  21. package/dist/TomeContent.svelte +1 -1
  22. package/dist/TomeLink.svelte +6 -1
  23. package/dist/TomeLink.svelte.d.ts +1 -0
  24. package/dist/TomeLink.svelte.d.ts.map +1 -1
  25. package/dist/TomeSectionHeader.svelte +2 -2
  26. package/dist/TypeLink.svelte +10 -3
  27. package/dist/TypeLink.svelte.d.ts +2 -0
  28. package/dist/TypeLink.svelte.d.ts.map +1 -1
  29. package/dist/contextmenu_helpers.d.ts.map +1 -1
  30. package/dist/contextmenu_helpers.js +6 -8
  31. package/dist/declaration.svelte.js +1 -1
  32. package/dist/library_gen.d.ts +19 -40
  33. package/dist/library_gen.d.ts.map +1 -1
  34. package/dist/library_gen.js +30 -128
  35. package/dist/library_generate.d.ts +94 -0
  36. package/dist/library_generate.d.ts.map +1 -0
  37. package/dist/library_generate.js +147 -0
  38. package/dist/library_helpers.d.ts +35 -33
  39. package/dist/library_helpers.d.ts.map +1 -1
  40. package/dist/library_helpers.js +36 -65
  41. package/dist/{library_gen_output.d.ts → library_output.d.ts} +7 -6
  42. package/dist/library_output.d.ts.map +1 -0
  43. package/dist/{library_gen_output.js → library_output.js} +4 -3
  44. package/dist/{library_gen_helpers.d.ts → library_pipeline.d.ts} +7 -8
  45. package/dist/library_pipeline.d.ts.map +1 -0
  46. package/dist/{library_gen_helpers.js → library_pipeline.js} +6 -7
  47. package/dist/module.svelte.js +1 -1
  48. package/dist/package_helpers.d.ts +141 -0
  49. package/dist/package_helpers.d.ts.map +1 -0
  50. package/dist/package_helpers.js +172 -0
  51. package/dist/tome.d.ts +3 -0
  52. package/dist/tome.d.ts.map +1 -1
  53. package/dist/tome.js +5 -1
  54. package/package.json +2 -2
  55. package/src/lib/contextmenu_helpers.ts +3 -5
  56. package/src/lib/declaration.svelte.ts +1 -1
  57. package/src/lib/library_gen.ts +33 -163
  58. package/src/lib/library_generate.ts +215 -0
  59. package/src/lib/library_helpers.ts +37 -72
  60. package/src/lib/{library_gen_output.ts → library_output.ts} +7 -6
  61. package/src/lib/{library_gen_helpers.ts → library_pipeline.ts} +6 -7
  62. package/src/lib/module.svelte.ts +1 -1
  63. package/src/lib/package_helpers.ts +180 -0
  64. package/src/lib/tome.ts +5 -1
  65. package/dist/library_gen_helpers.d.ts.map +0 -1
  66. package/dist/library_gen_output.d.ts.map +0 -1
@@ -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 }
@@ -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"}
@@ -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"}
@@ -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
@@ -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"}
@@ -7,7 +7,7 @@
7
7
  import ImgOrSvg from './ImgOrSvg.svelte';
8
8
  import DeclarationLink from './DeclarationLink.svelte';
9
9
  import ModuleLink from './ModuleLink.svelte';
10
- import {url_github_file, repo_url_parse, url_well_known} from './library_helpers.js';
10
+ import {url_github_file, repo_url_parse, url_well_known} from './package_helpers.js';
11
11
  import {
12
12
  module_is_typescript,
13
13
  module_is_svelte,
@@ -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)!);
@@ -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"}
@@ -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"}
@@ -24,7 +24,7 @@
24
24
 
25
25
  tome_context.set(tome); // TODO make reactive?
26
26
 
27
- const fragment = docs_slugify(tome.name);
27
+ 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>
@@ -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();
@@ -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,KA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+ {"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));
@@ -1,5 +1,5 @@
1
1
  import { declaration_generate_import, declaration_get_display_name, } from '@fuzdev/fuz_util/source_json.js';
2
- import { url_github_file } from './library_helpers.js';
2
+ import { url_github_file } from './package_helpers.js';
3
3
  /**
4
4
  * Rich runtime representation of an exported declaration.
5
5
  */
@@ -1,33 +1,23 @@
1
1
  /**
2
- * Library metadata generator helper.
2
+ * Gro-specific library metadata generation.
3
3
  *
4
- * Generates package_json and source_json with rich metadata:
5
- * - JSDoc/TSDoc comments with full tag support
6
- * - Full type signatures
7
- * - Source code locations
8
- * - Parameter information with descriptions and defaults
9
- * - Return value documentation
10
- * - Usage examples
11
- * - Dependency graphs
12
- * - Svelte component props
4
+ * This module provides Gro integration for library generation. It wraps the generic
5
+ * `library_generate` function with Gro's `Gen` interface and provides adapters for
6
+ * converting Gro's `Disknode` to the build-tool agnostic `SourceFileInfo`.
13
7
  *
14
- * This file contains Gro-specific integration. The actual analysis logic is in
15
- * build-tool agnostic helpers that work with `SourceFileInfo`.
8
+ * For build-tool agnostic usage, see `library_generate.ts`.
16
9
  *
17
- * @see @fuzdev/fuz_util/source_json.js for type definitions
18
- * @see `library_analysis.ts` for the unified analysis entry point
19
- * @see `library_gen_helpers.ts` for pipeline orchestration helpers
20
- * @see `tsdoc_helpers.ts` for JSDoc/TSDoc parsing
21
- * @see `ts_helpers.ts` for TypeScript analysis
22
- * @see `svelte_helpers.ts` for Svelte component analysis
10
+ * @see library_generate.ts for the generic generation entry point
11
+ * @see library_pipeline.ts for pipeline helpers
12
+ * @see library_output.ts for output file generation
23
13
  *
24
14
  * @module
25
15
  */
26
16
  import type { Gen } from '@ryanatkn/gro';
27
17
  import type { Disknode } from '@ryanatkn/gro/disknode.js';
28
18
  import { type SourceFileInfo, type ModuleSourceOptions, type ModuleSourcePartial } from './module_helpers.js';
29
- import { type DuplicateInfo } from './library_gen_helpers.js';
30
- /** Options for library generation. */
19
+ import { type OnDuplicatesCallback } from './library_generate.js';
20
+ /** Options for Gro library generation. */
31
21
  export interface LibraryGenOptions {
32
22
  /**
33
23
  * Module source options for filtering and path extraction.
@@ -41,11 +31,11 @@ export interface LibraryGenOptions {
41
31
  * Callback invoked when duplicate declaration names are found.
42
32
  *
43
33
  * Consumers decide how to handle duplicates: throw, warn, or ignore.
44
- * Use `library_gen_throw_on_duplicates` for strict flat namespace enforcement.
34
+ * Use `library_throw_on_duplicates` for strict flat namespace enforcement.
45
35
  *
46
36
  * @example
47
37
  * // Throw on duplicates (strict flat namespace)
48
- * library_gen({ on_duplicates: library_gen_throw_on_duplicates });
38
+ * library_gen({ on_duplicates: library_throw_on_duplicates });
49
39
  *
50
40
  * // Warn but continue
51
41
  * library_gen({
@@ -58,24 +48,6 @@ export interface LibraryGenOptions {
58
48
  */
59
49
  on_duplicates?: OnDuplicatesCallback;
60
50
  }
61
- /**
62
- * Callback for handling duplicate declaration names.
63
- *
64
- * @param duplicates Map of declaration names to their occurrences across modules
65
- * @param log Logger for reporting
66
- */
67
- export type OnDuplicatesCallback = (duplicates: Map<string, Array<DuplicateInfo>>, log: {
68
- error: (...args: Array<unknown>) => void;
69
- }) => void;
70
- /**
71
- * Strict duplicate handler that throws on any duplicate declaration names.
72
- *
73
- * Use this callback with `library_gen({ on_duplicates: library_gen_throw_on_duplicates })`
74
- * to enforce a flat namespace where all declaration names must be unique.
75
- *
76
- * @throws Error if any duplicate declaration names are found
77
- */
78
- export declare const library_gen_throw_on_duplicates: OnDuplicatesCallback;
79
51
  /**
80
52
  * Convert Gro's Disknode to the build-tool agnostic SourceFileInfo interface.
81
53
  *
@@ -102,6 +74,13 @@ export declare const library_collect_source_files_from_disknodes: (disknodes: It
102
74
  /**
103
75
  * Creates a Gen object for generating library metadata with full TypeScript analysis.
104
76
  *
77
+ * This is the Gro-specific entry point. It handles:
78
+ * - Reading files from Gro's filer
79
+ * - Loading package.json via Gro utilities
80
+ * - Returning output in Gro's Gen format
81
+ *
82
+ * For build-tool agnostic usage, use `library_generate` directly.
83
+ *
105
84
  * Usage in a `.gen.ts` file:
106
85
  *
107
86
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"library_gen.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_gen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AAIxD,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAKxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAKN,KAAK,aAAa,EAClB,MAAM,0BAA0B,CAAC;AAIlC,sCAAsC;AACtC,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;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAClC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,EAC7C,GAAG,EAAE;IAAC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;CAAC,KAC3C,IAAI,CAAC;AAEV;;;;;;;GAOG;AACH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