@fuzdev/fuz_ui 0.202.0 → 0.203.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 (71) hide show
  1. package/dist/ApiIndex.svelte +6 -3
  2. package/dist/ApiIndex.svelte.d.ts +1 -1
  3. package/dist/ApiIndex.svelte.d.ts.map +1 -1
  4. package/dist/ApiModule.svelte +72 -21
  5. package/dist/ApiModule.svelte.d.ts +1 -1
  6. package/dist/ApiModule.svelte.d.ts.map +1 -1
  7. package/dist/ContextmenuEntry.svelte +15 -16
  8. package/dist/ContextmenuEntry.svelte.d.ts +3 -2
  9. package/dist/ContextmenuEntry.svelte.d.ts.map +1 -1
  10. package/dist/ContextmenuIcon.svelte +30 -0
  11. package/dist/ContextmenuIcon.svelte.d.ts +9 -0
  12. package/dist/ContextmenuIcon.svelte.d.ts.map +1 -0
  13. package/dist/ContextmenuLinkEntry.svelte +23 -12
  14. package/dist/ContextmenuLinkEntry.svelte.d.ts +2 -1
  15. package/dist/ContextmenuLinkEntry.svelte.d.ts.map +1 -1
  16. package/dist/ContextmenuMenu.svelte +207 -0
  17. package/dist/ContextmenuMenu.svelte.d.ts +41 -0
  18. package/dist/ContextmenuMenu.svelte.d.ts.map +1 -0
  19. package/dist/ContextmenuRoot.svelte +58 -260
  20. package/dist/ContextmenuRoot.svelte.d.ts +2 -60
  21. package/dist/ContextmenuRoot.svelte.d.ts.map +1 -1
  22. package/dist/ContextmenuRootForSafariCompatibility.svelte +72 -283
  23. package/dist/ContextmenuRootForSafariCompatibility.svelte.d.ts +2 -58
  24. package/dist/ContextmenuRootForSafariCompatibility.svelte.d.ts.map +1 -1
  25. package/dist/ContextmenuSeparator.svelte +2 -1
  26. package/dist/ContextmenuSeparator.svelte.d.ts.map +1 -1
  27. package/dist/ContextmenuSubmenu.svelte +31 -25
  28. package/dist/ContextmenuSubmenu.svelte.d.ts +3 -2
  29. package/dist/ContextmenuSubmenu.svelte.d.ts.map +1 -1
  30. package/dist/ContextmenuTextEntry.svelte +6 -4
  31. package/dist/ContextmenuTextEntry.svelte.d.ts +3 -1
  32. package/dist/ContextmenuTextEntry.svelte.d.ts.map +1 -1
  33. package/dist/DeclarationLink.svelte +15 -2
  34. package/dist/DeclarationLink.svelte.d.ts +7 -0
  35. package/dist/DeclarationLink.svelte.d.ts.map +1 -1
  36. package/dist/DocsLink.svelte +3 -1
  37. package/dist/DocsLink.svelte.d.ts.map +1 -1
  38. package/dist/DocsTertiaryNav.svelte +2 -1
  39. package/dist/DocsTertiaryNav.svelte.d.ts.map +1 -1
  40. package/dist/LibraryDetail.svelte +9 -3
  41. package/dist/LibraryDetail.svelte.d.ts +1 -1
  42. package/dist/LibraryDetail.svelte.d.ts.map +1 -1
  43. package/dist/ModuleLink.svelte +2 -1
  44. package/dist/ModuleLink.svelte.d.ts.map +1 -1
  45. package/dist/TypeLink.svelte +2 -1
  46. package/dist/TypeLink.svelte.d.ts.map +1 -1
  47. package/dist/contextmenu_helpers.d.ts +324 -1
  48. package/dist/contextmenu_helpers.d.ts.map +1 -1
  49. package/dist/contextmenu_helpers.js +403 -2
  50. package/dist/contextmenu_state.svelte.d.ts +61 -15
  51. package/dist/contextmenu_state.svelte.d.ts.map +1 -1
  52. package/dist/contextmenu_state.svelte.js +206 -119
  53. package/dist/declaration.svelte.d.ts +1 -0
  54. package/dist/declaration.svelte.d.ts.map +1 -1
  55. package/dist/declaration.svelte.js +2 -1
  56. package/dist/icons.d.ts +15 -3
  57. package/dist/icons.d.ts.map +1 -1
  58. package/dist/icons.js +17 -3
  59. package/dist/library.svelte.d.ts +30 -3
  60. package/dist/library.svelte.d.ts.map +1 -1
  61. package/dist/library.svelte.js +38 -0
  62. package/dist/module.svelte.d.ts +62 -1
  63. package/dist/module.svelte.d.ts.map +1 -1
  64. package/dist/module.svelte.js +71 -1
  65. package/package.json +2 -2
  66. package/src/lib/contextmenu_helpers.ts +546 -3
  67. package/src/lib/contextmenu_state.svelte.ts +219 -119
  68. package/src/lib/declaration.svelte.ts +2 -1
  69. package/src/lib/icons.ts +19 -3
  70. package/src/lib/library.svelte.ts +43 -1
  71. package/src/lib/module.svelte.ts +97 -2
@@ -1,16 +1,19 @@
1
1
  <script lang="ts">
2
- import type {Snippet} from 'svelte';
2
+ import {onDestroy, type Snippet} from 'svelte';
3
3
  import {swallow} from '@fuzdev/fuz_util/dom.js';
4
4
 
5
5
  import {contextmenu_context, contextmenu_dimensions_context} from './contextmenu_state.svelte.js';
6
+ import {contextmenu_calculate_submenu_translate} from './contextmenu_helpers.js';
6
7
  import type {Dimensions} from './dimensions.svelte.js';
8
+ import type {SvgData} from './svg.js';
9
+ import ContextmenuIcon from './ContextmenuIcon.svelte';
7
10
 
8
11
  const {
9
12
  icon,
10
13
  menu,
11
14
  children,
12
15
  }: {
13
- icon?: Snippet;
16
+ icon?: SvgData | string | Snippet;
14
17
  menu: Snippet;
15
18
  children: Snippet;
16
19
  } = $props();
@@ -32,6 +35,10 @@
32
35
 
33
36
  let translate_x = $state.raw(0);
34
37
  let translate_y = $state.raw(0);
38
+ // Measure-and-correct loop: `update_position` reads `translate_x`/`translate_y`
39
+ // (subtracting them from the measured rect to recover the untranslated base position)
40
+ // and writes them back, so the effect re-runs after the transform applies -
41
+ // the second pass measures the same base and writes identical values, settling.
35
42
  $effect(() => {
36
43
  if (el) update_position(el, layout, parent_dimensions);
37
44
  });
@@ -39,23 +46,23 @@
39
46
  const {x, y, width, height} = el.getBoundingClientRect();
40
47
  dimensions.width = width;
41
48
  dimensions.height = height;
42
- const base_x = x - translate_x;
43
- const base_y = y - translate_y;
44
- const overflow_right = base_x + width + parent_dimensions.width - layout.width;
45
- if (overflow_right <= 0) {
46
- translate_x = parent_dimensions.width;
47
- } else {
48
- const overflow_left = width - base_x;
49
- if (overflow_left <= 0) {
50
- translate_x = -width;
51
- } else if (overflow_left > overflow_right) {
52
- translate_x = parent_dimensions.width - overflow_right;
53
- } else {
54
- translate_x = overflow_left - width;
55
- }
56
- }
57
- translate_y = Math.min(0, layout.height - (base_y + height));
49
+ const translate = contextmenu_calculate_submenu_translate({
50
+ base_x: x - translate_x,
51
+ base_y: y - translate_y,
52
+ width,
53
+ height,
54
+ parent_width: parent_dimensions.width,
55
+ layout_width: layout.width,
56
+ layout_height: layout.height,
57
+ });
58
+ translate_x = translate.x;
59
+ translate_y = translate.y;
58
60
  };
61
+
62
+ let select_timeout: NodeJS.Timeout | null = null;
63
+ onDestroy(() => {
64
+ if (select_timeout !== null) clearTimeout(select_timeout);
65
+ });
59
66
  </script>
60
67
 
61
68
  <li role="none" style:--contextmenu_depth={submenu.depth}>
@@ -64,7 +71,6 @@
64
71
  class="menuitem plain selectable"
65
72
  class:selected
66
73
  role="menuitem"
67
- aria-label="contextmenu submenmu"
68
74
  aria-haspopup="menu"
69
75
  tabindex="-1"
70
76
  onmouseenter={(e) => {
@@ -73,13 +79,17 @@
73
79
  // fires immediately when the contextmenu appears,
74
80
  // and then the newly mounted selected entry immediately receives a click event.
75
81
  // The timeout ensures the click event is not passed through.
76
- setTimeout(() => contextmenu.select(submenu));
82
+ if (select_timeout !== null) clearTimeout(select_timeout);
83
+ select_timeout = setTimeout(() => {
84
+ select_timeout = null;
85
+ contextmenu.select(submenu);
86
+ });
77
87
  }}
78
88
  aria-expanded={selected}
79
89
  >
80
90
  <div class="content">
81
91
  <div class="icon">
82
- {@render icon?.()}
92
+ <ContextmenuIcon {icon} />
83
93
  </div>
84
94
  <div class="title">{@render children()}</div>
85
95
  </div>
@@ -111,8 +121,4 @@
111
121
  max-width: var(--contextmenu_width);
112
122
  width: 100%;
113
123
  }
114
- /* TODO hacky, needed because the base `.menuitem` added z-index */
115
- .menuitem {
116
- z-index: unset;
117
- }
118
124
  </style>
@@ -1,6 +1,7 @@
1
- import type { Snippet } from 'svelte';
1
+ import { type Snippet } from 'svelte';
2
+ import type { SvgData } from './svg.js';
2
3
  type $$ComponentProps = {
3
- icon?: Snippet;
4
+ icon?: SvgData | string | Snippet;
4
5
  menu: Snippet;
5
6
  children: Snippet;
6
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContextmenuSubmenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuSubmenu.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAMnC,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAoFH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ContextmenuSubmenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuSubmenu.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAM/C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGrC,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA+FH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
@@ -1,21 +1,23 @@
1
1
  <script lang="ts">
2
+ import type {Snippet} from 'svelte';
3
+
4
+ import type {SvgData} from './svg.js';
2
5
  import ContextmenuEntry from './ContextmenuEntry.svelte';
3
6
  import type {ContextmenuRun} from './contextmenu_state.svelte.js';
4
7
 
5
8
  const {
6
9
  run,
7
10
  content,
8
- icon: icon_text,
11
+ icon,
9
12
  }: {
10
13
  run: ContextmenuRun;
11
14
  content: string; // TODO @many rethink this API
12
- icon: string; // TODO @many rethink this API
15
+ icon?: SvgData | string | Snippet;
13
16
  } = $props();
14
17
 
15
18
  // TODO consider making this the implicit default entry, so consumers can simply declare `{run, content}`
16
19
  </script>
17
20
 
18
- <ContextmenuEntry {run}>
19
- {#snippet icon()}{icon_text}{/snippet}
21
+ <ContextmenuEntry {run} {icon}>
20
22
  {content}
21
23
  </ContextmenuEntry>
@@ -1,8 +1,10 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { SvgData } from './svg.js';
1
3
  import type { ContextmenuRun } from './contextmenu_state.svelte.js';
2
4
  type $$ComponentProps = {
3
5
  run: ContextmenuRun;
4
6
  content: string;
5
- icon: string;
7
+ icon?: SvgData | string | Snippet;
6
8
  };
7
9
  declare const ContextmenuTextEntry: import("svelte").Component<$$ComponentProps, {}, "">;
8
10
  type ContextmenuTextEntry = ReturnType<typeof ContextmenuTextEntry>;
@@ -1 +1 @@
1
- {"version":3,"file":"ContextmenuTextEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuTextEntry.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAEjE,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAqBH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"ContextmenuTextEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuTextEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEtC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAEjE,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC,CAAC;AAuBH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
@@ -8,6 +8,7 @@
8
8
 
9
9
  const {
10
10
  name,
11
+ module_path,
11
12
  hash,
12
13
  full = false,
13
14
  children,
@@ -15,6 +16,13 @@
15
16
  ...rest
16
17
  }: SvelteHTMLElements['a'] & {
17
18
  name: string;
19
+ /**
20
+ * Module path of the declaration's defining module. When provided,
21
+ * resolution is scoped to that module's declarations — exact even when
22
+ * names collide across modules. Without it, resolution falls back to the
23
+ * library-wide by-name map.
24
+ */
25
+ module_path?: string;
18
26
  /** URL fragment to append, with or without the `#`. */
19
27
  hash?: string;
20
28
  /**
@@ -25,9 +33,14 @@
25
33
  full?: boolean;
26
34
  } = $props();
27
35
 
28
- const library = library_context.get();
36
+ const get_library = library_context.get();
37
+ const library = $derived(get_library());
29
38
 
30
- const declaration = $derived(library.declaration_by_name.get(name));
39
+ const declaration = $derived(
40
+ module_path === undefined
41
+ ? library.declaration_by_name.get(name)
42
+ : library.module_by_path.get(module_path)?.get_declaration_by_name(name),
43
+ );
31
44
 
32
45
  // When linking a foreign library's docs, prefer its full URL; fall back to
33
46
  // the site-local path if `homepage_url` is unavailable.
@@ -1,6 +1,13 @@
1
1
  import type { SvelteHTMLElements } from 'svelte/elements';
2
2
  type $$ComponentProps = SvelteHTMLElements['a'] & {
3
3
  name: string;
4
+ /**
5
+ * Module path of the declaration's defining module. When provided,
6
+ * resolution is scoped to that module's declarations — exact even when
7
+ * names collide across modules. Without it, resolution falls back to the
8
+ * library-wide by-name map.
9
+ */
10
+ module_path?: string;
4
11
  /** URL fragment to append, with or without the `#`. */
5
12
  hash?: string;
6
13
  /**
@@ -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;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"}
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;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AA0DH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -19,7 +19,9 @@
19
19
  display_text?: string | null;
20
20
  children?: Snippet<[Declaration | undefined, Module | undefined]>;
21
21
  } = $props();
22
- const library = library_context.get();
22
+
23
+ const get_library = library_context.get();
24
+ const library = $derived(get_library());
23
25
 
24
26
  // Try to find as declaration first, then module
25
27
  const declaration = $derived(library.declaration_by_name.get(reference));
@@ -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,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
+ {"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;AA4CH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -29,7 +29,8 @@
29
29
  .filter((t) => t !== undefined) ?? [],
30
30
  );
31
31
 
32
- const library = library_context.get();
32
+ const get_library = library_context.get();
33
+ const library = $derived(get_library());
33
34
 
34
35
  const modules_related_to_selected = $derived(
35
36
  selected_tome?.related_modules
@@ -1 +1 @@
1
- {"version":3,"file":"DocsTertiaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsTertiaryNav.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAmB,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAwFH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"DocsTertiaryNav.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DocsTertiaryNav.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EAAmB,IAAI,EAAC,MAAM,WAAW,CAAC;AAOhD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACtD,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAyFH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -12,7 +12,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
12
12
  import {format_url} from '@fuzdev/fuz_util/url.js';
13
13
  import type {Snippet} from 'svelte';
14
14
 
15
- import type {Library} from './library.svelte.js';
15
+ import {library_context, type Library} from './library.svelte.js';
16
16
  import ImgOrSvg from './ImgOrSvg.svelte';
17
17
  import DeclarationLink from './DeclarationLink.svelte';
18
18
  import ModuleLink from './ModuleLink.svelte';
@@ -44,6 +44,8 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
44
44
  children?: Snippet<[library: Library]>;
45
45
  } = $props();
46
46
 
47
+ library_context.set(() => library);
48
+
47
49
  // TODO show other data (lines of code)
48
50
 
49
51
  const {pkg_json} = $derived(library);
@@ -175,11 +177,15 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
175
177
  {module.path}
176
178
  </ModuleLink>
177
179
  </span>
178
- {#if module.declarations.length > 0}
180
+ {#if module.has_declarations}
179
181
  <ul class="declarations unstyled">
180
182
  {#each module.declarations as declaration (declaration.name)}
181
183
  <li>
182
- <DeclarationLink name={declaration.name} full={links_full} />
184
+ <DeclarationLink
185
+ name={declaration.name}
186
+ module_path={module.path}
187
+ full={links_full}
188
+ />
183
189
  </li>
184
190
  {/each}
185
191
  </ul>
@@ -1,5 +1,5 @@
1
1
  import type { Snippet } from 'svelte';
2
- import type { Library } from './library.svelte.js';
2
+ import { type Library } from './library.svelte.js';
3
3
  type $$ComponentProps = {
4
4
  library: Library;
5
5
  /**
@@ -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;;;;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;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,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAOjE,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;AAmKH;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -25,7 +25,8 @@
25
25
  full?: boolean;
26
26
  } = $props();
27
27
 
28
- const library = library_context.get();
28
+ const get_library = library_context.get();
29
+ const library = $derived(get_library());
29
30
 
30
31
  const module = $derived(library.module_by_path.get(module_path));
31
32
 
@@ -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;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
+ {"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;AAqDH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -13,7 +13,8 @@
13
13
  hash?: string;
14
14
  } = $props();
15
15
 
16
- const library = library_context.get();
16
+ const get_library = library_context.get();
17
+ const library = $derived(get_library());
17
18
 
18
19
  // TODO is not extensible
19
20
  // TODO maybe better name?
@@ -1 +1 @@
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"}
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;AA2BH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}