@fuzdev/fuz_ui 0.203.1 → 0.205.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.
- package/dist/Alert.svelte +31 -17
- package/dist/Alert.svelte.d.ts +8 -2
- package/dist/Alert.svelte.d.ts.map +1 -1
- package/dist/ApiModule.svelte +14 -1
- package/dist/ApiModule.svelte.d.ts.map +1 -1
- package/dist/Card.svelte +28 -10
- package/dist/Card.svelte.d.ts +7 -2
- package/dist/Card.svelte.d.ts.map +1 -1
- package/dist/CopyToClipboard.svelte +5 -1
- package/dist/CopyToClipboard.svelte.d.ts.map +1 -1
- package/dist/DeclarationDetail.svelte +15 -4
- package/dist/DeclarationDetail.svelte.d.ts.map +1 -1
- package/dist/DocsLink.svelte +15 -4
- package/dist/DocsLink.svelte.d.ts +8 -1
- package/dist/DocsLink.svelte.d.ts.map +1 -1
- package/dist/DocsMenu.svelte +1 -1
- package/dist/DocsPageLinks.svelte +1 -1
- package/dist/EcosystemLinks.svelte +5 -2
- package/dist/EcosystemLinks.svelte.d.ts +2 -1
- package/dist/EcosystemLinks.svelte.d.ts.map +1 -1
- package/dist/EcosystemLinksPanel.svelte +4 -2
- package/dist/EcosystemLinksPanel.svelte.d.ts +2 -1
- package/dist/EcosystemLinksPanel.svelte.d.ts.map +1 -1
- package/dist/Hashlink.svelte +1 -1
- package/dist/ImgOrSvg.svelte +6 -5
- package/dist/ImgOrSvg.svelte.d.ts +2 -1
- package/dist/ImgOrSvg.svelte.d.ts.map +1 -1
- package/dist/LibraryDetail.svelte +5 -2
- package/dist/LibraryDetail.svelte.d.ts +3 -1
- package/dist/LibraryDetail.svelte.d.ts.map +1 -1
- package/dist/LibrarySummary.svelte +4 -2
- package/dist/LibrarySummary.svelte.d.ts +2 -1
- package/dist/LibrarySummary.svelte.d.ts.map +1 -1
- package/dist/PasteFromClipboard.svelte +3 -1
- package/dist/PasteFromClipboard.svelte.d.ts.map +1 -1
- package/dist/PendingButton.svelte +0 -2
- package/dist/PendingButton.svelte.d.ts.map +1 -1
- package/dist/StyleVariableButton.svelte +5 -1
- package/dist/StyleVariableButton.svelte.d.ts.map +1 -1
- package/dist/Svg.svelte +1 -1
- package/dist/TomeContent.svelte +5 -2
- package/dist/TomeContent.svelte.d.ts +2 -1
- package/dist/TomeContent.svelte.d.ts.map +1 -1
- package/dist/TypeLink.svelte +13 -4
- package/dist/TypeLink.svelte.d.ts +7 -1
- package/dist/TypeLink.svelte.d.ts.map +1 -1
- package/package.json +12 -36
- package/dist/Mdz.svelte +0 -34
- package/dist/Mdz.svelte.d.ts +0 -11
- package/dist/Mdz.svelte.d.ts.map +0 -1
- package/dist/MdzNodeView.svelte +0 -107
- package/dist/MdzNodeView.svelte.d.ts +0 -9
- package/dist/MdzNodeView.svelte.d.ts.map +0 -1
- package/dist/MdzPrecompiled.svelte +0 -30
- package/dist/MdzPrecompiled.svelte.d.ts +0 -11
- package/dist/MdzPrecompiled.svelte.d.ts.map +0 -1
- package/dist/MdzRoot.svelte +0 -30
- package/dist/MdzRoot.svelte.d.ts +0 -12
- package/dist/MdzRoot.svelte.d.ts.map +0 -1
- package/dist/MdzStream.svelte +0 -32
- package/dist/MdzStream.svelte.d.ts +0 -12
- package/dist/MdzStream.svelte.d.ts.map +0 -1
- package/dist/MdzStreamNodeView.svelte +0 -106
- package/dist/MdzStreamNodeView.svelte.d.ts +0 -9
- package/dist/MdzStreamNodeView.svelte.d.ts.map +0 -1
- package/dist/mdz.d.ts +0 -112
- package/dist/mdz.d.ts.map +0 -1
- package/dist/mdz.js +0 -1186
- package/dist/mdz_components.d.ts +0 -63
- package/dist/mdz_components.d.ts.map +0 -1
- package/dist/mdz_components.js +0 -32
- package/dist/mdz_helpers.d.ts +0 -164
- package/dist/mdz_helpers.d.ts.map +0 -1
- package/dist/mdz_helpers.js +0 -424
- package/dist/mdz_lexer.d.ts +0 -93
- package/dist/mdz_lexer.d.ts.map +0 -1
- package/dist/mdz_lexer.js +0 -732
- package/dist/mdz_opcodes.d.ts +0 -174
- package/dist/mdz_opcodes.d.ts.map +0 -1
- package/dist/mdz_opcodes.js +0 -14
- package/dist/mdz_opcodes_to_nodes.d.ts +0 -20
- package/dist/mdz_opcodes_to_nodes.d.ts.map +0 -1
- package/dist/mdz_opcodes_to_nodes.js +0 -332
- package/dist/mdz_stream_parser.d.ts +0 -80
- package/dist/mdz_stream_parser.d.ts.map +0 -1
- package/dist/mdz_stream_parser.js +0 -354
- package/dist/mdz_stream_parser_block.d.ts +0 -76
- package/dist/mdz_stream_parser_block.d.ts.map +0 -1
- package/dist/mdz_stream_parser_block.js +0 -458
- package/dist/mdz_stream_parser_inline.d.ts +0 -52
- package/dist/mdz_stream_parser_inline.d.ts.map +0 -1
- package/dist/mdz_stream_parser_inline.js +0 -378
- package/dist/mdz_stream_parser_link.d.ts +0 -22
- package/dist/mdz_stream_parser_link.d.ts.map +0 -1
- package/dist/mdz_stream_parser_link.js +0 -215
- package/dist/mdz_stream_parser_state.d.ts +0 -187
- package/dist/mdz_stream_parser_state.d.ts.map +0 -1
- package/dist/mdz_stream_parser_state.js +0 -398
- package/dist/mdz_stream_parser_text.d.ts +0 -14
- package/dist/mdz_stream_parser_text.d.ts.map +0 -1
- package/dist/mdz_stream_parser_text.js +0 -50
- package/dist/mdz_stream_parser_url.d.ts +0 -60
- package/dist/mdz_stream_parser_url.d.ts.map +0 -1
- package/dist/mdz_stream_parser_url.js +0 -307
- package/dist/mdz_stream_state.svelte.d.ts +0 -44
- package/dist/mdz_stream_state.svelte.d.ts.map +0 -1
- package/dist/mdz_stream_state.svelte.js +0 -357
- package/dist/mdz_to_svelte.d.ts +0 -41
- package/dist/mdz_to_svelte.d.ts.map +0 -1
- package/dist/mdz_to_svelte.js +0 -100
- package/dist/mdz_token_parser.d.ts +0 -14
- package/dist/mdz_token_parser.d.ts.map +0 -1
- package/dist/mdz_token_parser.js +0 -344
- package/dist/svelte_preprocess_mdz.d.ts +0 -65
- package/dist/svelte_preprocess_mdz.d.ts.map +0 -1
- package/dist/svelte_preprocess_mdz.js +0 -529
- package/dist/tsdoc_mdz.d.ts +0 -45
- package/dist/tsdoc_mdz.d.ts.map +0 -1
- package/dist/tsdoc_mdz.js +0 -88
- package/src/lib/mdz.ts +0 -1532
- package/src/lib/mdz_components.ts +0 -64
- package/src/lib/mdz_helpers.ts +0 -449
- package/src/lib/mdz_lexer.ts +0 -1012
- package/src/lib/mdz_opcodes.ts +0 -205
- package/src/lib/mdz_opcodes_to_nodes.ts +0 -375
- package/src/lib/mdz_stream_parser.ts +0 -415
- package/src/lib/mdz_stream_parser_block.ts +0 -532
- package/src/lib/mdz_stream_parser_inline.ts +0 -414
- package/src/lib/mdz_stream_parser_link.ts +0 -271
- package/src/lib/mdz_stream_parser_state.ts +0 -539
- package/src/lib/mdz_stream_parser_text.ts +0 -77
- package/src/lib/mdz_stream_parser_url.ts +0 -365
- package/src/lib/mdz_stream_state.svelte.ts +0 -387
- package/src/lib/mdz_to_svelte.ts +0 -141
- package/src/lib/mdz_token_parser.ts +0 -434
- package/src/lib/svelte_preprocess_mdz.ts +0 -742
- package/src/lib/tsdoc_mdz.ts +0 -97
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
|
-
}:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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
|
|
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}
|
package/dist/Alert.svelte.d.ts
CHANGED
|
@@ -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 =
|
|
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;
|
|
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,cAAc,EAAE,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAuB,KAAK,WAAW,EAAC,MAAM,YAAY,CAAC;AAEjE,KAAK,gBAAgB,GAErB,AAFyB,wEAAwE;AAEjG,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,uDAAuD;IACvD,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3D,wFAAwF;IACxF,YAAY,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC5C,uFAAuF;IACvF,SAAS,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAkEH,QAAA,MAAM,KAAK,sDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
package/dist/ApiModule.svelte
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import Code from '@fuzdev/fuz_code/Code.svelte';
|
|
3
|
+
import Mdz from '@fuzdev/mdz/Mdz.svelte';
|
|
4
|
+
import {
|
|
5
|
+
mdz_code_context,
|
|
6
|
+
mdz_codeblock_context,
|
|
7
|
+
mdz_set_context_with_fallback,
|
|
8
|
+
} from '@fuzdev/mdz/mdz_contexts.js';
|
|
9
|
+
|
|
2
10
|
import {set_library_context_with_fallback, type Library} from './library.svelte.js';
|
|
3
11
|
import {tome_get_by_slug, type Tome} from './tome.js';
|
|
4
12
|
import TomeContent from './TomeContent.svelte';
|
|
@@ -6,8 +14,8 @@
|
|
|
6
14
|
import TomeSectionHeader from './TomeSectionHeader.svelte';
|
|
7
15
|
import DocsSearch from './DocsSearch.svelte';
|
|
8
16
|
import ModuleLink from './ModuleLink.svelte';
|
|
17
|
+
import DocsLink from './DocsLink.svelte';
|
|
9
18
|
import DeclarationLink from './DeclarationLink.svelte';
|
|
10
|
-
import Mdz from './Mdz.svelte';
|
|
11
19
|
import ApiDeclarationList from './ApiDeclarationList.svelte';
|
|
12
20
|
import {create_module_declaration_search} from './api_search.svelte.js';
|
|
13
21
|
|
|
@@ -35,6 +43,11 @@
|
|
|
35
43
|
const get_library = set_library_context_with_fallback(() => library_prop, 'ApiModule');
|
|
36
44
|
const library = $derived(get_library());
|
|
37
45
|
|
|
46
|
+
// render mdz inline `code` as API-linking `DocsLink` and fenced blocks as syntax-highlighted
|
|
47
|
+
// `Code`, matching the rest of the docs — the injection mdz core leaves open
|
|
48
|
+
mdz_set_context_with_fallback(mdz_code_context, () => DocsLink);
|
|
49
|
+
mdz_set_context_with_fallback(mdz_codeblock_context, () => Code);
|
|
50
|
+
|
|
38
51
|
// normalize module_path to string (could be array from [...module_path] route param)
|
|
39
52
|
const module_path = $derived(
|
|
40
53
|
Array.isArray(module_path_param) ? module_path_param.join('/') : module_path_param,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiModule.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModule.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiModule.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModule.svelte"],"names":[],"mappings":"AAWA,OAAO,EAAoC,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAWrD,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AA6LH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,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
|
-
}:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
package/dist/Card.svelte.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
type $$ComponentProps =
|
|
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":"
|
|
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"}
|
|
@@ -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={
|
|
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;
|
|
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"}
|
|
@@ -11,16 +11,27 @@ including parameters, props, members, overloads, intersects, and more.
|
|
|
11
11
|
-->
|
|
12
12
|
<script lang="ts">
|
|
13
13
|
import Code from '@fuzdev/fuz_code/Code.svelte';
|
|
14
|
+
import Mdz from '@fuzdev/mdz/Mdz.svelte';
|
|
15
|
+
import {mdz_from_tsdoc} from '@fuzdev/mdz/tsdoc_mdz.js';
|
|
16
|
+
import {
|
|
17
|
+
mdz_code_context,
|
|
18
|
+
mdz_codeblock_context,
|
|
19
|
+
mdz_set_context_with_fallback,
|
|
20
|
+
} from '@fuzdev/mdz/mdz_contexts.js';
|
|
14
21
|
import type {ParameterJsonInput} from 'svelte-docinfo/types.js';
|
|
15
22
|
|
|
16
23
|
import type {Declaration} from './declaration.svelte.js';
|
|
17
24
|
import TypeLink from './TypeLink.svelte';
|
|
18
25
|
import ModuleLink from './ModuleLink.svelte';
|
|
19
|
-
import
|
|
20
|
-
import {tsdoc_see_to_mdz} from './tsdoc_mdz.js';
|
|
26
|
+
import DocsLink from './DocsLink.svelte';
|
|
21
27
|
|
|
22
28
|
const {declaration}: {declaration: Declaration} = $props();
|
|
23
29
|
|
|
30
|
+
// render mdz inline `code` as API-linking `DocsLink` and fenced blocks as syntax-highlighted
|
|
31
|
+
// `Code`, matching the rest of the docs — the injection mdz core leaves open
|
|
32
|
+
mdz_set_context_with_fallback(mdz_code_context, () => DocsLink);
|
|
33
|
+
mdz_set_context_with_fallback(mdz_codeblock_context, () => Code);
|
|
34
|
+
|
|
24
35
|
// Optional prose metadata shared by component props and nested members,
|
|
25
36
|
// rendered in a compact form (the top-level declaration uses prominent
|
|
26
37
|
// sections for the same fields instead).
|
|
@@ -94,7 +105,7 @@ including parameters, props, members, overloads, intersects, and more.
|
|
|
94
105
|
<p><strong>see also</strong></p>
|
|
95
106
|
<ul>
|
|
96
107
|
{#each item.seeAlso as ref (ref)}
|
|
97
|
-
<li><Mdz content={
|
|
108
|
+
<li><Mdz content={mdz_from_tsdoc(ref)} /></li>
|
|
98
109
|
{/each}
|
|
99
110
|
</ul>
|
|
100
111
|
{/if}
|
|
@@ -392,7 +403,7 @@ including parameters, props, members, overloads, intersects, and more.
|
|
|
392
403
|
<ul>
|
|
393
404
|
{#each declaration.see_also as ref (ref)}
|
|
394
405
|
<li>
|
|
395
|
-
<Mdz content={
|
|
406
|
+
<Mdz content={mdz_from_tsdoc(ref)} />
|
|
396
407
|
</li>
|
|
397
408
|
{/each}
|
|
398
409
|
</ul>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclarationDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationDetail.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeclarationDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationDetail.svelte"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAgBxD,KAAK,gBAAgB,GAAI;IAAC,WAAW,EAAE,WAAW,CAAA;CAAC,CAAC;AA4brD;;;;;;;;GAQG;AACH,QAAA,MAAM,iBAAiB,sDAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
package/dist/DocsLink.svelte
CHANGED
|
@@ -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;
|
|
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;AACpC,OAAO,KAAK,EAAC,cAAc,EAAE,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAK1D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE9C,KAAK,gBAAgB,GAErB,AAFyB,wEAAwE;AAEjG,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,GAAG;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mGAAmG;IACnG,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAClC,iGAAiG;IACjG,UAAU,CAAC,EAAE,kBAAkB,CAAC,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"}
|
package/dist/DocsMenu.svelte
CHANGED
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcosystemLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/EcosystemLinks.svelte"],"names":[],"mappings":"
|
|
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
|
|
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;
|
|
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"}
|
package/dist/Hashlink.svelte
CHANGED
|
@@ -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}"
|
|
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>
|
package/dist/ImgOrSvg.svelte
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
svg_attrs,
|
|
11
11
|
img_attrs,
|
|
12
12
|
...rest
|
|
13
|
-
}:
|
|
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
|
|
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 =
|
|
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,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ImgOrSvg.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ImgOrSvg.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAEvD,KAAK,gBAAgB,GAErB,AAFyB,qFAAqF;AAE9G,kBAAkB,CAAC,KAAK,CAAC,GACxB,kBAAkB,CAAC,KAAK,CAAC,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;CACtC,CAAC;AA6BJ,QAAA,MAAM,QAAQ,sDAAwC,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,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"LibraryDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibraryDetail.svelte"],"names":[],"mappings":"AAKA,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;AAExD,OAAO,EAAkB,KAAK,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAOjE,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,KAAK,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}
|