@fuzdev/fuz_ui 0.203.0 → 0.204.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/Alert.svelte +31 -17
  2. package/dist/Alert.svelte.d.ts +8 -2
  3. package/dist/Alert.svelte.d.ts.map +1 -1
  4. package/dist/Card.svelte +28 -10
  5. package/dist/Card.svelte.d.ts +7 -2
  6. package/dist/Card.svelte.d.ts.map +1 -1
  7. package/dist/ContextmenuEntry.svelte +4 -6
  8. package/dist/ContextmenuEntry.svelte.d.ts +2 -1
  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 +2 -9
  14. package/dist/ContextmenuLinkEntry.svelte.d.ts.map +1 -1
  15. package/dist/ContextmenuSubmenu.svelte +4 -2
  16. package/dist/ContextmenuSubmenu.svelte.d.ts +2 -1
  17. package/dist/ContextmenuSubmenu.svelte.d.ts.map +1 -1
  18. package/dist/ContextmenuTextEntry.svelte +5 -7
  19. package/dist/ContextmenuTextEntry.svelte.d.ts +2 -1
  20. package/dist/ContextmenuTextEntry.svelte.d.ts.map +1 -1
  21. package/dist/CopyToClipboard.svelte +5 -1
  22. package/dist/CopyToClipboard.svelte.d.ts.map +1 -1
  23. package/dist/DocsLink.svelte +15 -4
  24. package/dist/DocsLink.svelte.d.ts +8 -1
  25. package/dist/DocsLink.svelte.d.ts.map +1 -1
  26. package/dist/DocsMenu.svelte +1 -1
  27. package/dist/DocsPageLinks.svelte +1 -1
  28. package/dist/EcosystemLinks.svelte +5 -2
  29. package/dist/EcosystemLinks.svelte.d.ts +2 -1
  30. package/dist/EcosystemLinks.svelte.d.ts.map +1 -1
  31. package/dist/EcosystemLinksPanel.svelte +4 -2
  32. package/dist/EcosystemLinksPanel.svelte.d.ts +2 -1
  33. package/dist/EcosystemLinksPanel.svelte.d.ts.map +1 -1
  34. package/dist/Hashlink.svelte +1 -1
  35. package/dist/ImgOrSvg.svelte +6 -5
  36. package/dist/ImgOrSvg.svelte.d.ts +2 -1
  37. package/dist/ImgOrSvg.svelte.d.ts.map +1 -1
  38. package/dist/LibraryDetail.svelte +5 -2
  39. package/dist/LibraryDetail.svelte.d.ts +3 -1
  40. package/dist/LibraryDetail.svelte.d.ts.map +1 -1
  41. package/dist/LibrarySummary.svelte +4 -2
  42. package/dist/LibrarySummary.svelte.d.ts +2 -1
  43. package/dist/LibrarySummary.svelte.d.ts.map +1 -1
  44. package/dist/PasteFromClipboard.svelte +3 -1
  45. package/dist/PasteFromClipboard.svelte.d.ts.map +1 -1
  46. package/dist/PendingButton.svelte +0 -2
  47. package/dist/PendingButton.svelte.d.ts.map +1 -1
  48. package/dist/StyleVariableButton.svelte +5 -1
  49. package/dist/StyleVariableButton.svelte.d.ts.map +1 -1
  50. package/dist/Svg.svelte +1 -1
  51. package/dist/TomeContent.svelte +5 -2
  52. package/dist/TomeContent.svelte.d.ts +2 -1
  53. package/dist/TomeContent.svelte.d.ts.map +1 -1
  54. package/dist/TypeLink.svelte +13 -4
  55. package/dist/TypeLink.svelte.d.ts +7 -1
  56. package/dist/TypeLink.svelte.d.ts.map +1 -1
  57. package/package.json +1 -1
package/dist/Alert.svelte CHANGED
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type {Snippet} from 'svelte';
3
- import type {SvelteHTMLElements} from 'svelte/elements';
3
+ import type {HTMLAttributes, SvelteHTMLElements} from 'svelte/elements';
4
4
 
5
5
  import {alert_status_options, type AlertStatus} from './alert.js';
6
6
 
@@ -18,21 +18,28 @@
18
18
  onclick,
19
19
  disabled,
20
20
  icon,
21
+ button_attrs,
22
+ div_attrs,
21
23
  children,
22
24
  ...rest
23
- }: SvelteHTMLElements['div'] &
24
- SvelteHTMLElements['button'] & {
25
- status?: AlertStatus;
26
- color?: string;
27
- // TODO this API is a mess in part because of the types, maybe an explicit `AlertButton` is better,
28
- // or rethink the design because `role="alert"` can't be put on buttons.
29
- // $props must be destructured, so we can't use a union with narrowing right?
30
- // so `disabled` only makes sense if `onclick` is defined, and we dont get the other HTMLButtonElement attributes
31
- onclick?: (() => void) | undefined;
32
- disabled?: boolean;
33
- icon?: string | Snippet<[icon: string]> | null | undefined; // TODO experimenting with this, gets complex in the impl
34
- children: Snippet;
35
- } = $props();
25
+ }: // generic element attrs, the common denominator of the rendered roots -
26
+ // branch-specific attributes go in `button_attrs`/`div_attrs`
27
+ HTMLAttributes<HTMLElement> & {
28
+ status?: AlertStatus;
29
+ color?: string;
30
+ // TODO maybe an explicit `AlertButton` is better,
31
+ // or rethink the design because `role="alert"` can't be put on buttons -
32
+ // `disabled` and `button_attrs` only make sense when `onclick` is defined
33
+ /** Renders the alert as a `<button>` when provided. */
34
+ onclick?: (() => void) | undefined;
35
+ disabled?: boolean;
36
+ icon?: string | Snippet<[icon: string]> | null | undefined; // TODO experimenting with this, gets complex in the impl
37
+ /** Button attributes, applied only when `onclick` renders the alert as a `<button>`. */
38
+ button_attrs?: SvelteHTMLElements['button'];
39
+ /** Div attributes, applied only when the alert renders as a `<div>` (no `onclick`). */
40
+ div_attrs?: SvelteHTMLElements['div'];
41
+ children: Snippet;
42
+ } = $props();
36
43
 
37
44
  const options = $derived(alert_status_options[status]);
38
45
  // TODO change this to use the hue and put transparency on the borders, or add a borderColor option
@@ -47,15 +54,22 @@
47
54
  <button
48
55
  type="button"
49
56
  {...rest}
50
- class="alert {rest.class}"
57
+ {...button_attrs}
58
+ class="alert {rest.class} {button_attrs?.class}"
51
59
  style:--text_color={final_color}
52
60
  {onclick}
53
- {disabled}
61
+ disabled={disabled ?? button_attrs?.disabled}
54
62
  >
55
63
  {@render content()}
56
64
  </button>
57
65
  {:else}
58
- <div role="alert" {...rest} class="alert panel {rest.class}" style:--text_color={final_color}>
66
+ <div
67
+ role="alert"
68
+ {...rest}
69
+ {...div_attrs}
70
+ class="alert panel {rest.class} {div_attrs?.class}"
71
+ style:--text_color={final_color}
72
+ >
59
73
  {@render content()}
60
74
  </div>
61
75
  {/if}
@@ -1,12 +1,18 @@
1
1
  import type { Snippet } from 'svelte';
2
- import type { SvelteHTMLElements } from 'svelte/elements';
2
+ import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
3
3
  import { type AlertStatus } from './alert.js';
4
- type $$ComponentProps = SvelteHTMLElements['div'] & SvelteHTMLElements['button'] & {
4
+ type $$ComponentProps = // generic element attrs, the common denominator of the rendered roots -
5
+ HTMLAttributes<HTMLElement> & {
5
6
  status?: AlertStatus;
6
7
  color?: string;
8
+ /** Renders the alert as a `<button>` when provided. */
7
9
  onclick?: (() => void) | undefined;
8
10
  disabled?: boolean;
9
11
  icon?: string | Snippet<[icon: string]> | null | undefined;
12
+ /** Button attributes, applied only when `onclick` renders the alert as a `<button>`. */
13
+ button_attrs?: SvelteHTMLElements['button'];
14
+ /** Div attributes, applied only when the alert renders as a `<div>` (no `onclick`). */
15
+ div_attrs?: SvelteHTMLElements['div'];
10
16
  children: Snippet;
11
17
  };
12
18
  declare const Alert: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Alert.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAuB,KAAK,WAAW,EAAC,MAAM,YAAY,CAAC;AAEjE,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GACjD,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,OAAO,CAAC,EAAE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AK,sDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
package/dist/Card.svelte CHANGED
@@ -1,7 +1,8 @@
1
1
  <script lang="ts">
2
2
  import {page} from '$app/state';
3
+ import {DEV} from 'esm-env';
3
4
  import type {Snippet} from 'svelte';
4
- import type {SvelteHTMLElements} from 'svelte/elements';
5
+ import type {HTMLAttributes, SvelteHTMLElements} from 'svelte/elements';
5
6
 
6
7
  // TODO think through Alert+Card APIs together, one can be a button and the other a link atm
7
8
 
@@ -10,20 +11,37 @@
10
11
  tag,
11
12
  align = 'left',
12
13
  icon,
14
+ a_attrs,
13
15
  children,
14
16
  ...rest
15
- }: SvelteHTMLElements['div'] &
16
- SvelteHTMLElements['a'] & {
17
- tag?: string | undefined;
18
- align?: 'left' | 'right' | 'above' | 'below';
19
- icon?: string | Snippet;
20
- children: Snippet;
21
- } = $props();
17
+ }: // generic element attrs, the common denominator of the rendered roots -
18
+ // branch-specific attributes go in `a_attrs`
19
+ HTMLAttributes<HTMLElement> & {
20
+ /** Renders the card as an `<a>` when provided. */
21
+ href?: string | undefined;
22
+ tag?: string | undefined;
23
+ align?: 'left' | 'right' | 'above' | 'below';
24
+ icon?: string | Snippet;
25
+ /** Anchor attributes, applied only when `href` renders the card as an `<a>`. */
26
+ a_attrs?: SvelteHTMLElements['a'];
27
+ children: Snippet;
28
+ } = $props();
22
29
 
23
30
  const link = $derived(!!href);
24
31
  const selected = $derived(link && page.url.pathname === href);
25
32
  const final_tag = $derived(tag ?? (link ? 'a' : 'div'));
26
- const inferred_attrs = $derived(link ? {href} : undefined);
33
+ const inferred_attrs = $derived(link ? {...a_attrs, href} : undefined);
34
+
35
+ if (DEV) {
36
+ $effect(() => {
37
+ if (href && final_tag !== 'a') {
38
+ // eslint-disable-next-line no-console
39
+ console.error(
40
+ `Card received href "${href}" with tag "${final_tag}" - href renders only on an anchor`,
41
+ );
42
+ }
43
+ });
44
+ }
27
45
 
28
46
  const left = $derived(align === 'left');
29
47
  const right = $derived(align === 'right');
@@ -37,7 +55,7 @@
37
55
  this={final_tag}
38
56
  {...rest}
39
57
  {...inferred_attrs}
40
- class="card {rest.class}"
58
+ class="card {rest.class} {inferred_attrs?.class}"
41
59
  class:link
42
60
  class:selected
43
61
  class:left
@@ -1,9 +1,14 @@
1
1
  import type { Snippet } from 'svelte';
2
- import type { SvelteHTMLElements } from 'svelte/elements';
3
- type $$ComponentProps = SvelteHTMLElements['div'] & SvelteHTMLElements['a'] & {
2
+ import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
3
+ type $$ComponentProps = // generic element attrs, the common denominator of the rendered roots -
4
+ HTMLAttributes<HTMLElement> & {
5
+ /** Renders the card as an `<a>` when provided. */
6
+ href?: string | undefined;
4
7
  tag?: string | undefined;
5
8
  align?: 'left' | 'right' | 'above' | 'below';
6
9
  icon?: string | Snippet;
10
+ /** Anchor attributes, applied only when `href` renders the card as an `<a>`. */
11
+ a_attrs?: SvelteHTMLElements['a'];
7
12
  children: Snippet;
8
13
  };
9
14
  declare const Card: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"Card.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Card.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GACjD,kBAAkB,CAAC,GAAG,CAAC,GAAG;IACzB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAyDJ,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Card.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Card.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,cAAc,EAAE,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvE,KAAK,gBAAgB,GAErB,AAFyB,wEAAwE;AAEjG,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7B,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,gFAAgF;IAChF,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAsEH,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -4,6 +4,8 @@
4
4
 
5
5
  import PendingAnimation from './PendingAnimation.svelte';
6
6
  import {contextmenu_context, type ContextmenuRun} from './contextmenu_state.svelte.js';
7
+ import type {SvgData} from './svg.js';
8
+ import ContextmenuIcon from './ContextmenuIcon.svelte';
7
9
 
8
10
  const {
9
11
  run,
@@ -12,7 +14,7 @@
12
14
  disabled: disabled_prop = false,
13
15
  }: {
14
16
  run: ContextmenuRun;
15
- icon?: string | Snippet;
17
+ icon?: SvgData | string | Snippet;
16
18
  children: Snippet;
17
19
  disabled?: boolean;
18
20
  } = $props();
@@ -65,11 +67,7 @@
65
67
  >
66
68
  <div class="content">
67
69
  <div class="icon">
68
- {#if typeof icon === 'string'}
69
- {icon}
70
- {:else if icon}
71
- {@render icon()}
72
- {/if}
70
+ <ContextmenuIcon {icon} />
73
71
  </div>
74
72
  <div class="title">{@render children()}</div>
75
73
  {#if pending}<PendingAnimation />{:else if error_message}⚠️{/if}
@@ -1,8 +1,9 @@
1
1
  import { type Snippet } from 'svelte';
2
2
  import { type ContextmenuRun } from './contextmenu_state.svelte.js';
3
+ import type { SvgData } from './svg.js';
3
4
  type $$ComponentProps = {
4
5
  run: ContextmenuRun;
5
- icon?: string | Snippet;
6
+ icon?: SvgData | string | Snippet;
6
7
  children: Snippet;
7
8
  disabled?: boolean;
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContextmenuEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAI/C,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAEtF,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAkEH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"ContextmenuEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAI/C,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACvF,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGrC,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAgEH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,30 @@
1
+ <script lang="ts">
2
+ import type {Snippet} from 'svelte';
3
+
4
+ import type {SvgData} from './svg.js';
5
+ import Svg from './Svg.svelte';
6
+
7
+ /**
8
+ * Renders a contextmenu entry's `icon` value, shared by `ContextmenuEntry`,
9
+ * `ContextmenuSubmenu`, and `ContextmenuLinkEntry`. Renders nothing when
10
+ * `icon` is `undefined`.
11
+ *
12
+ * @module
13
+ */
14
+
15
+ const {
16
+ icon,
17
+ }: {
18
+ icon?: SvgData | string | Snippet;
19
+ } = $props();
20
+ </script>
21
+
22
+ {#if typeof icon === 'string'}
23
+ {icon}
24
+ {:else if typeof icon === 'object'}
25
+ <!-- `SvgData` is a plain object; detect it positively by shape rather than
26
+ introspecting the snippet (whose runtime form is opaque/unsupported). -->
27
+ <Svg data={icon} />
28
+ {:else if icon}
29
+ {@render icon()}
30
+ {/if}
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { SvgData } from './svg.js';
3
+ type $$ComponentProps = {
4
+ icon?: SvgData | string | Snippet;
5
+ };
6
+ declare const ContextmenuIcon: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type ContextmenuIcon = ReturnType<typeof ContextmenuIcon>;
8
+ export default ContextmenuIcon;
9
+ //# sourceMappingURL=ContextmenuIcon.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextmenuIcon.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuIcon.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGrC,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC,CAAC;AA+BH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -8,6 +8,7 @@
8
8
  import {icon_external_link, icon_link} from './icons.js';
9
9
  import type {SvgData} from './svg.js';
10
10
  import Svg from './Svg.svelte';
11
+ import ContextmenuIcon from './ContextmenuIcon.svelte';
11
12
 
12
13
  const {
13
14
  href,
@@ -92,15 +93,7 @@
92
93
  <div class="content">
93
94
  <div class="icon">
94
95
  {#if icon}
95
- {#if typeof icon === 'string'}
96
- {icon}
97
- {:else if typeof icon === 'object'}
98
- <!-- `SvgData` is a plain object; detect it positively by shape rather than
99
- introspecting the snippet (whose runtime form is opaque/unsupported). -->
100
- <Svg data={icon} />
101
- {:else}
102
- {@render icon()}
103
- {/if}
96
+ <ContextmenuIcon {icon} />
104
97
  {:else}
105
98
  <Svg data={external ? icon_external_link : icon_link} />
106
99
  {/if}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextmenuLinkEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuLinkEntry.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGrC,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AA+FH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"ContextmenuLinkEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuLinkEntry.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAIrC,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAyFH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
@@ -5,13 +5,15 @@
5
5
  import {contextmenu_context, contextmenu_dimensions_context} from './contextmenu_state.svelte.js';
6
6
  import {contextmenu_calculate_submenu_translate} from './contextmenu_helpers.js';
7
7
  import type {Dimensions} from './dimensions.svelte.js';
8
+ import type {SvgData} from './svg.js';
9
+ import ContextmenuIcon from './ContextmenuIcon.svelte';
8
10
 
9
11
  const {
10
12
  icon,
11
13
  menu,
12
14
  children,
13
15
  }: {
14
- icon?: Snippet;
16
+ icon?: SvgData | string | Snippet;
15
17
  menu: Snippet;
16
18
  children: Snippet;
17
19
  } = $props();
@@ -87,7 +89,7 @@
87
89
  >
88
90
  <div class="content">
89
91
  <div class="icon">
90
- {@render icon?.()}
92
+ <ContextmenuIcon {icon} />
91
93
  </div>
92
94
  <div class="title">{@render children()}</div>
93
95
  </div>
@@ -1,6 +1,7 @@
1
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,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAO9C,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA6FH,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,25 +1,23 @@
1
1
  <script lang="ts">
2
+ import type {Snippet} from 'svelte';
3
+
2
4
  import type {SvgData} from './svg.js';
3
- import Svg from './Svg.svelte';
4
5
  import ContextmenuEntry from './ContextmenuEntry.svelte';
5
6
  import type {ContextmenuRun} from './contextmenu_state.svelte.js';
6
7
 
7
8
  const {
8
9
  run,
9
10
  content,
10
- icon: icon_value,
11
+ icon,
11
12
  }: {
12
13
  run: ContextmenuRun;
13
14
  content: string; // TODO @many rethink this API
14
- icon: SvgData | string;
15
+ icon?: SvgData | string | Snippet;
15
16
  } = $props();
16
17
 
17
18
  // TODO consider making this the implicit default entry, so consumers can simply declare `{run, content}`
18
19
  </script>
19
20
 
20
- <ContextmenuEntry {run}>
21
- {#snippet icon()}{#if typeof icon_value === 'string'}{icon_value}{:else}<Svg
22
- data={icon_value}
23
- />{/if}{/snippet}
21
+ <ContextmenuEntry {run} {icon}>
24
22
  {content}
25
23
  </ContextmenuEntry>
@@ -1,9 +1,10 @@
1
+ import type { Snippet } from 'svelte';
1
2
  import type { SvgData } from './svg.js';
2
3
  import type { ContextmenuRun } from './contextmenu_state.svelte.js';
3
4
  type $$ComponentProps = {
4
5
  run: ContextmenuRun;
5
6
  content: string;
6
- icon: SvgData | string;
7
+ icon?: SvgData | string | Snippet;
7
8
  };
8
9
  declare const ContextmenuTextEntry: import("svelte").Component<$$ComponentProps, {}, "">;
9
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":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGtC,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,OAAO,GAAG,MAAM,CAAC;CACvB,CAAC;AAuBH,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"}
@@ -17,6 +17,7 @@
17
17
  allow_copying_empty_string,
18
18
  icon_button = true,
19
19
  oncopy,
20
+ onclick,
20
21
  disabled: disabled_prop,
21
22
  children,
22
23
  ...rest
@@ -70,7 +71,10 @@
70
71
  class:copied
71
72
  class:failed
72
73
  class:color_c={failed}
73
- onclick={copy}
74
+ onclick={(e) => {
75
+ onclick?.(e); // before the internal handler, which is async
76
+ void copy(e);
77
+ }}
74
78
  disabled={disabled_prop ?? (allow_copying_empty_string ? text === null : !text)}
75
79
  >
76
80
  {#if children}
@@ -1 +1 @@
1
- {"version":3,"file":"CopyToClipboard.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/CopyToClipboard.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;AAMvD,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC/E,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD,CAAC;AAkEH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"CopyToClipboard.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/CopyToClipboard.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;AAMvD,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC/E,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD,CAAC;AAsEH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -1,5 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type {Snippet} from 'svelte';
3
+ import type {HTMLAttributes, SvelteHTMLElements} from 'svelte/elements';
4
+ import type {OmitStrict} from '@fuzdev/fuz_util/types.js';
3
5
 
4
6
  import ModuleLink from './ModuleLink.svelte';
5
7
  import DeclarationLink from './DeclarationLink.svelte';
@@ -11,12 +13,21 @@
11
13
  reference,
12
14
  hash,
13
15
  display_text,
16
+ a_attrs,
17
+ code_attrs,
14
18
  children: children_prop,
15
- }: {
19
+ ...rest
20
+ }: // generic element attrs, the common denominator of the rendered roots -
21
+ // assignable to the anchor rest of `DeclarationLink`/`ModuleLink` and exact for `<code>`
22
+ OmitStrict<HTMLAttributes<HTMLElement>, 'children'> & {
16
23
  reference: string;
17
24
  /** URL fragment to append, with or without the `#`. */
18
25
  hash?: string;
19
26
  display_text?: string | null;
27
+ /** Anchor attributes, applied only when the reference resolves to a declaration or module link. */
28
+ a_attrs?: SvelteHTMLElements['a'];
29
+ /** Code attributes, applied only to the fallback `<code>` when the reference doesn't resolve. */
30
+ code_attrs?: SvelteHTMLElements['code'];
20
31
  children?: Snippet<[Declaration | undefined, Module | undefined]>;
21
32
  } = $props();
22
33
 
@@ -29,15 +40,15 @@
29
40
  </script>
30
41
 
31
42
  {#if declaration}
32
- <DeclarationLink name={reference} {hash}>
43
+ <DeclarationLink {...rest} {...a_attrs} name={reference} {hash}>
33
44
  {@render children()}
34
45
  </DeclarationLink>
35
46
  {:else if module}
36
- <ModuleLink module_path={module.path} {hash}>
47
+ <ModuleLink {...rest} {...a_attrs} module_path={module.path} {hash}>
37
48
  {@render children()}
38
49
  </ModuleLink>
39
50
  {:else}
40
- <code>{@render children()}</code>
51
+ <code {...rest} {...code_attrs}>{@render children()}</code>
41
52
  {/if}
42
53
 
43
54
  {#snippet children()}{#if children_prop}{@render children_prop(
@@ -1,11 +1,18 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
3
+ import type { OmitStrict } from '@fuzdev/fuz_util/types.js';
2
4
  import type { Declaration } from './declaration.svelte.js';
3
5
  import type { Module } from './module.svelte.js';
4
- type $$ComponentProps = {
6
+ type $$ComponentProps = // generic element attrs, the common denominator of the rendered roots -
7
+ OmitStrict<HTMLAttributes<HTMLElement>, 'children'> & {
5
8
  reference: string;
6
9
  /** URL fragment to append, with or without the `#`. */
7
10
  hash?: string;
8
11
  display_text?: string | null;
12
+ /** Anchor attributes, applied only when the reference resolves to a declaration or module link. */
13
+ a_attrs?: SvelteHTMLElements['a'];
14
+ /** Code attributes, applied only to the fallback `<code>` when the reference doesn't resolve. */
15
+ code_attrs?: SvelteHTMLElements['code'];
9
16
  children?: Snippet<[Declaration | undefined, Module | undefined]>;
10
17
  };
11
18
  declare const DocsLink: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -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,M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MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAClE,CAAC;AAiDH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -29,7 +29,7 @@
29
29
 
30
30
  <!-- eslint-disable svelte/no-navigation-without-resolve -->
31
31
 
32
- <DocsList {...rest} {expand_width} margin={false} class="docs-menu">
32
+ <DocsList {...rest} {expand_width} margin={false} class="docs-menu {rest.class}">
33
33
  <ul class="unstyled">
34
34
  {#each Object.entries(tomes_by_category) as [category, tomes] (category)}
35
35
  <li class="category">
@@ -20,7 +20,7 @@
20
20
  const hash = $derived(page.url.hash.slice(1));
21
21
  </script>
22
22
 
23
- <DocsList {...rest} {expand_width} class="docs-page-links">
23
+ <DocsList {...rest} {expand_width} class="docs-page-links {rest.class}">
24
24
  <h4 class="mb_sm">on this page</h4>
25
25
  {#if sidebar}
26
26
  <div class="sidebar-wrapper">{@render content()}</div>
@@ -1,14 +1,17 @@
1
1
  <script lang="ts">
2
+ import type {SvelteHTMLElements} from 'svelte/elements';
3
+
2
4
  import {FUZ_DEV_URL} from './constants.js';
3
5
 
4
6
  const {
5
7
  selected,
6
- }: {
8
+ ...rest
9
+ }: SvelteHTMLElements['ul'] & {
7
10
  selected?: 'fuz.dev';
8
11
  } = $props();
9
12
  </script>
10
13
 
11
- <ul>
14
+ <ul {...rest}>
12
15
  <li>
13
16
  <!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
14
17
  <a rel="me" href={FUZ_DEV_URL} class:selected={selected === 'fuz.dev'}>fuz.dev</a>
@@ -1,4 +1,5 @@
1
- type $$ComponentProps = {
1
+ import type { SvelteHTMLElements } from 'svelte/elements';
2
+ type $$ComponentProps = SvelteHTMLElements['ul'] & {
2
3
  selected?: 'fuz.dev';
3
4
  };
4
5
  declare const EcosystemLinks: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"EcosystemLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/EcosystemLinks.svelte"],"names":[],"mappings":"AAKC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAwBH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"EcosystemLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/EcosystemLinks.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAIvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AA2BH,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -1,17 +1,19 @@
1
1
  <script lang="ts">
2
2
  import type {Snippet} from 'svelte';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
3
4
 
4
5
  import EcosystemLinks from './EcosystemLinks.svelte';
5
6
  import ProjectLinks from './ProjectLinks.svelte';
6
7
 
7
8
  const {
8
9
  children,
9
- }: {
10
+ ...rest
11
+ }: SvelteHTMLElements['section'] & {
10
12
  children?: Snippet;
11
13
  } = $props();
12
14
  </script>
13
15
 
14
- <section class="panel p_lg">
16
+ <section {...rest} class="panel p_lg {rest.class}">
15
17
  {#if children}
16
18
  {@render children()}
17
19
  {:else}
@@ -1,5 +1,6 @@
1
1
  import type { Snippet } from 'svelte';
2
- type $$ComponentProps = {
2
+ import type { SvelteHTMLElements } from 'svelte/elements';
3
+ type $$ComponentProps = SvelteHTMLElements['section'] & {
3
4
  children?: Snippet;
4
5
  };
5
6
  declare const EcosystemLinksPanel: import("svelte").Component<$$ComponentProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"EcosystemLinksPanel.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/EcosystemLinksPanel.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKnC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA4BH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"EcosystemLinksPanel.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/EcosystemLinksPanel.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA8BH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  const {fragment, children, ...rest}: SvelteHTMLElements['a'] & {fragment: string} = $props();
5
5
  </script>
6
6
 
7
- <a {...rest} class="hashlink {rest.class}" href="#{fragment}" aria-label="hashlink"
7
+ <a aria-label="hashlink" {...rest} class="hashlink {rest.class}" href="#{fragment}"
8
8
  >{#if children}{@render children()}{:else}#{/if}</a
9
9
  >
10
10
  <span class="hashlink-scroll-target" id={fragment} aria-hidden="true"></span>
@@ -10,7 +10,9 @@
10
10
  svg_attrs,
11
11
  img_attrs,
12
12
  ...rest
13
- }: SvelteHTMLElements['img'] &
13
+ }: // the intersection makes rest shared attributes valid for whichever branch renders -
14
+ // branch-specific attributes go in `svg_attrs`/`img_attrs`
15
+ SvelteHTMLElements['img'] &
14
16
  SvelteHTMLElements['svg'] & {
15
17
  src: string;
16
18
  label?: string;
@@ -28,7 +30,6 @@
28
30
  height?: string;
29
31
  svg_attrs?: SvelteHTMLElements['svg'];
30
32
  img_attrs?: SvelteHTMLElements['img'];
31
- /** Shared attributes for both img and svg. */
32
33
  } = $props();
33
34
 
34
35
  const final_width = $derived(width ?? size);
@@ -38,9 +39,9 @@
38
39
  {#if src.endsWith('.svg')}
39
40
  <svg
40
41
  role="img"
41
- {...rest as SvelteHTMLElements['svg']}
42
+ {...rest}
42
43
  {...svg_attrs}
43
- aria-label={label}
44
+ aria-label={label ?? svg_attrs?.['aria-label'] ?? rest['aria-label']}
44
45
  style:width={final_width}
45
46
  style:height={final_height}
46
47
  >
@@ -51,7 +52,7 @@
51
52
  {...rest}
52
53
  {...img_attrs}
53
54
  {src}
54
- alt={label}
55
+ alt={label ?? img_attrs?.alt ?? rest.alt}
55
56
  style:width={final_width}
56
57
  style:height={final_height}
57
58
  />
@@ -1,5 +1,6 @@
1
1
  import type { SvelteHTMLElements } from 'svelte/elements';
2
- type $$ComponentProps = SvelteHTMLElements['img'] & SvelteHTMLElements['svg'] & {
2
+ type $$ComponentProps = // the intersection makes rest shared attributes valid for whichever branch renders -
3
+ SvelteHTMLElements['img'] & SvelteHTMLElements['svg'] & {
3
4
  src: string;
4
5
  label?: string;
5
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ImgOrSvg.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ImgOrSvg.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBA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C,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -10,7 +10,9 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
10
10
  <script lang="ts">
11
11
  import {page} from '$app/state';
12
12
  import {format_url} from '@fuzdev/fuz_util/url.js';
13
+ import type {OmitStrict} from '@fuzdev/fuz_util/types.js';
13
14
  import type {Snippet} from 'svelte';
15
+ import type {SvelteHTMLElements} from 'svelte/elements';
14
16
 
15
17
  import {library_context, type Library} from './library.svelte.js';
16
18
  import ImgOrSvg from './ImgOrSvg.svelte';
@@ -28,7 +30,8 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
28
30
  npm_url,
29
31
  homepage_url,
30
32
  children,
31
- }: {
33
+ ...rest
34
+ }: OmitStrict<SvelteHTMLElements['div'], 'children'> & {
32
35
  library: Library;
33
36
  /**
34
37
  * Link the module/declaration index to the library's own deployed docs
@@ -57,7 +60,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
57
60
 
58
61
  <!-- eslint-disable svelte/no-navigation-without-resolve -->
59
62
 
60
- <div class="library-detail">
63
+ <div {...rest} class="library-detail {rest.class}">
61
64
  <!-- TODO maybe continue this snippet pattern, or maybe simplify? -->
62
65
  <div class="info">
63
66
  <div class="display:flex flex:1">
@@ -1,6 +1,8 @@
1
+ import type { OmitStrict } from '@fuzdev/fuz_util/types.js';
1
2
  import type { Snippet } from 'svelte';
3
+ import type { SvelteHTMLElements } from 'svelte/elements';
2
4
  import { type Library } from './library.svelte.js';
3
- type $$ComponentProps = {
5
+ type $$ComponentProps = OmitStrict<SvelteHTMLElements['div'], 'children'> & {
4
6
  library: Library;
5
7
  /**
6
8
  * Link the module/declaration index to the library's own deployed docs
@@ -1 +1 @@
1
- {"version":3,"file":"LibraryDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibraryDetail.svelte"],"names":[],"mappings":"AAKA,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CAAC,EAAE,UAAU,CAAC,GAAG;IAC5E,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;AAsKH;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import {page} from '$app/state';
3
3
  import type {Snippet} from 'svelte';
4
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
5
  import {format_url} from '@fuzdev/fuz_util/url.js';
5
6
 
6
7
  import type {Library} from './library.svelte.js';
@@ -15,7 +16,8 @@
15
16
  npm_url,
16
17
  homepage_url,
17
18
  children,
18
- }: {
19
+ ...rest
20
+ }: SvelteHTMLElements['div'] & {
19
21
  library: Library;
20
22
  repo_name?: Snippet<[repo_name: string]>;
21
23
  logo?: Snippet<[logo_url: string, logo_alt: string]>;
@@ -29,7 +31,7 @@
29
31
  const {pkg_json} = $derived(library);
30
32
  </script>
31
33
 
32
- <div class="library-summary">
34
+ <div {...rest} class="library-summary {rest.class}">
33
35
  <!-- TODO maybe continue this snippet pattern, or maybe simplify? -->
34
36
  <header class="box mb_lg">
35
37
  {#if repo_name}
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { SvelteHTMLElements } from 'svelte/elements';
2
3
  import type { Library } from './library.svelte.js';
3
- type $$ComponentProps = {
4
+ type $$ComponentProps = SvelteHTMLElements['div'] & {
4
5
  library: Library;
5
6
  repo_name?: Snippet<[repo_name: string]>;
6
7
  logo?: Snippet<[logo_url: string, logo_alt: string]>;
@@ -1 +1 @@
1
- {"version":3,"file":"LibrarySummary.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibrarySummary.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA2GH,QAAA,MAAM,cAA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  onclipboardtext,
8
8
  onerror,
9
+ onclick,
9
10
  children,
10
11
  ...rest
11
12
  }: SvelteHTMLElements['button'] & {
@@ -21,7 +22,8 @@
21
22
  title="paste from clipboard"
22
23
  {...rest}
23
24
  class="paste-from-clipboard {rest.class}"
24
- onclick={async () => {
25
+ onclick={async (e) => {
26
+ onclick?.(e); // before the await, so it stays in the user gesture context
25
27
  try {
26
28
  const text = await navigator.clipboard.readText();
27
29
  onclipboardtext(text);
@@ -1 +1 @@
1
- {"version":3,"file":"PasteFromClipboard.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PasteFromClipboard.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACjC,CAAC;AA6BH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"PasteFromClipboard.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PasteFromClipboard.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACjC,CAAC;AA+BH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
@@ -8,7 +8,6 @@
8
8
  pending,
9
9
  onclick,
10
10
  running,
11
- title: title_prop,
12
11
  disabled: disabled_prop,
13
12
  animation,
14
13
  children,
@@ -33,7 +32,6 @@
33
32
  {...rest}
34
33
  class="pending-button {rest.class}"
35
34
  disabled={disabled_prop ?? pending}
36
- title={title_prop}
37
35
  class:pending
38
36
  {onclick}
39
37
  >
@@ -1 +1 @@
1
- {"version":3,"file":"PendingButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingButton.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA4CH,QAAA,MAAM,aAAa;sBAxBQ,YAAY,KAAG,IAAI;MAwBa,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"PendingButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingButton.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAGpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA2CH,QAAA,MAAM,aAAa;sBAxBQ,YAAY,KAAG,IAAI;MAwBa,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -8,6 +8,7 @@
8
8
  name,
9
9
  inline = false,
10
10
  plain = true,
11
+ onclick,
11
12
  children,
12
13
  ...rest
13
14
  }: SvelteHTMLElements['button'] & {
@@ -32,7 +33,10 @@
32
33
  {...rest}
33
34
  class:inline
34
35
  class:plain
35
- onclick={() => (selected_variable.value = variable)}
36
+ onclick={(e) => {
37
+ selected_variable.value = variable;
38
+ onclick?.(e);
39
+ }}
36
40
  >{#if children}{@render children()}{:else}<span class="font_family_mono">{name}</span
37
41
  >{/if}</button
38
42
  >
@@ -1 +1 @@
1
- {"version":3,"file":"StyleVariableButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/StyleVariableButton.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAgCH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"StyleVariableButton.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/StyleVariableButton.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAoCH,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
package/dist/Svg.svelte CHANGED
@@ -78,7 +78,7 @@
78
78
  <svg
79
79
  viewBox={data.viewBox ?? '0 0 100 100'}
80
80
  {...rest}
81
- aria-label={label ?? data.label}
81
+ aria-label={label ?? data.label ?? rest['aria-label']}
82
82
  class:inline
83
83
  style:width={final_width}
84
84
  style:height={final_height}
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import type {Snippet} from 'svelte';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
3
4
  import {page} from '$app/state';
4
5
  import {resolve} from '$app/paths';
5
6
 
@@ -13,7 +14,8 @@
13
14
  docs_path = DOCS_PATH_DEFAULT,
14
15
  header,
15
16
  children,
16
- }: {
17
+ ...rest
18
+ }: SvelteHTMLElements['section'] & {
17
19
  tome: Tome;
18
20
  docs_path?: string;
19
21
  header?: Snippet;
@@ -30,7 +32,8 @@
30
32
  </script>
31
33
 
32
34
  <section
33
- class="tome-content width_atmost_md mb_xl9"
35
+ {...rest}
36
+ class="tome-content width_atmost_md mb_xl9 {rest.class}"
34
37
  {@attach intersect(() =>
35
38
  at_root
36
39
  ? ({intersecting}) => {
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { SvelteHTMLElements } from 'svelte/elements';
2
3
  import { type Tome } from './tome.js';
3
- type $$ComponentProps = {
4
+ type $$ComponentProps = SvelteHTMLElements['section'] & {
4
5
  tome: Tome;
5
6
  docs_path?: string;
6
7
  header?: Snippet;
@@ -1 +1 @@
1
- {"version":3,"file":"TomeContent.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeContent.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,EAAe,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIjD,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA4DH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"TomeContent.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TomeContent.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKxD,OAAO,EAAe,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIjD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG;IACxD,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA8DH,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -1,5 +1,6 @@
1
1
  <script lang="ts">
2
2
  import Code from '@fuzdev/fuz_code/Code.svelte';
3
+ import type {HTMLAttributes, SvelteHTMLElements} from 'svelte/elements';
3
4
 
4
5
  import DeclarationLink from './DeclarationLink.svelte';
5
6
  import {library_context} from './library.svelte.js';
@@ -7,21 +8,29 @@
7
8
  const {
8
9
  type,
9
10
  hash,
10
- }: {
11
+ a_attrs,
12
+ code_attrs,
13
+ ...rest
14
+ }: // generic element attrs, the common denominator of the rendered roots -
15
+ // assignable to the anchor rest of `DeclarationLink` and the code rest of `Code`
16
+ HTMLAttributes<HTMLElement> & {
11
17
  type: string;
12
18
  /** URL fragment to append, with or without the `#`. */
13
19
  hash?: string;
20
+ /** Anchor attributes, applied only when the type resolves to a declaration link. */
21
+ a_attrs?: SvelteHTMLElements['a'];
22
+ /** Code attributes, applied only to the fallback `Code` when the type doesn't resolve. */
23
+ code_attrs?: SvelteHTMLElements['code'];
14
24
  } = $props();
15
25
 
16
26
  const get_library = library_context.get();
17
27
  const library = $derived(get_library());
18
28
 
19
- // TODO is not extensible
20
29
  // TODO maybe better name?
21
30
  </script>
22
31
 
23
32
  {#if library.declaration_by_name.has(type)}
24
- <DeclarationLink name={type} {hash} />
33
+ <DeclarationLink {...rest} {...a_attrs} name={type} {hash} />
25
34
  {:else}
26
- <Code lang="ts" content={type} inline />
35
+ <Code {...rest} {...code_attrs} lang="ts" content={type} inline />
27
36
  {/if}
@@ -1,7 +1,13 @@
1
- type $$ComponentProps = {
1
+ import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
2
+ type $$ComponentProps = // generic element attrs, the common denominator of the rendered roots -
3
+ HTMLAttributes<HTMLElement> & {
2
4
  type: string;
3
5
  /** URL fragment to append, with or without the `#`. */
4
6
  hash?: string;
7
+ /** Anchor attributes, applied only when the type resolves to a declaration link. */
8
+ a_attrs?: SvelteHTMLElements['a'];
9
+ /** Code attributes, applied only to the fallback `Code` when the type doesn't resolve. */
10
+ code_attrs?: SvelteHTMLElements['code'];
5
11
  };
6
12
  declare const TypeLink: import("svelte").Component<$$ComponentProps, {}, "">;
7
13
  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;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"}
1
+ {"version":3,"file":"TypeLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TypeLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,cAAc,EAAE,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAKvE,KAAK,gBAAgB,GAErB,AAFyB,wEAAwE;AAEjG,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAClC,0FAA0F;IAC1F,UAAU,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;CACxC,CAAC;AA8BH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_ui",
3
- "version": "0.203.0",
3
+ "version": "0.204.0",
4
4
  "description": "Svelte UI library",
5
5
  "tagline": "friendly user zystem",
6
6
  "glyph": "🧶",