@fuzdev/fuz_ui 0.219.0 โ 0.220.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/Card.svelte +7 -0
- package/dist/Card.svelte.d.ts +5 -0
- package/dist/Card.svelte.d.ts.map +1 -1
- package/dist/ContextmenuMenu.svelte +16 -8
- package/dist/ContextmenuMenu.svelte.d.ts +14 -0
- package/dist/ContextmenuMenu.svelte.d.ts.map +1 -1
- package/dist/DeclarationDetail.svelte +57 -1
- package/dist/DeclarationDetail.svelte.d.ts +2 -1
- package/dist/DeclarationDetail.svelte.d.ts.map +1 -1
- package/dist/Dialog.svelte +16 -15
- package/dist/Dialog.svelte.d.ts +14 -0
- package/dist/Dialog.svelte.d.ts.map +1 -1
- package/dist/LibraryDetail.svelte +1 -0
- package/dist/LibraryDetail.svelte.d.ts +1 -0
- package/dist/LibraryDetail.svelte.d.ts.map +1 -1
- package/dist/LibrarySummary.svelte +5 -0
- package/dist/LibrarySummary.svelte.d.ts +1 -0
- package/dist/LibrarySummary.svelte.d.ts.map +1 -1
- package/dist/PendingAnimation.svelte +9 -0
- package/dist/PendingAnimation.svelte.d.ts +7 -0
- package/dist/PendingAnimation.svelte.d.ts.map +1 -1
- package/dist/Sparkline.svelte +17 -21
- package/dist/Sparkline.svelte.d.ts +15 -0
- package/dist/Sparkline.svelte.d.ts.map +1 -1
- package/dist/declaration.svelte.d.ts +8 -1
- package/dist/declaration.svelte.d.ts.map +1 -1
- package/dist/declaration.svelte.js +9 -0
- package/dist/helpers.d.ts +10 -0
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +34 -0
- package/package.json +2 -2
- package/src/lib/declaration.svelte.ts +14 -0
- package/src/lib/helpers.ts +31 -0
package/dist/Card.svelte
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
@cssprop --card_width - width of the card
|
|
5
|
+
@cssprop --border_radius - corner radius of the card
|
|
6
|
+
@cssprop --shadow - box shadow of a linked card in every state, replacing its default inset shadows
|
|
7
|
+
-->
|
|
1
8
|
<script lang="ts">
|
|
2
9
|
import { page } from '$app/state';
|
|
3
10
|
import { DEV } from 'esm-env';
|
package/dist/Card.svelte.d.ts
CHANGED
|
@@ -25,6 +25,11 @@ HTMLAttributes<HTMLElement> & {
|
|
|
25
25
|
a_attrs?: SvelteHTMLElements['a'];
|
|
26
26
|
children: Snippet;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @cssprop --card_width - width of the card
|
|
30
|
+
* @cssprop --border_radius - corner radius of the card
|
|
31
|
+
* @cssprop --shadow - box shadow of a linked card in every state, replacing its default inset shadows
|
|
32
|
+
*/
|
|
28
33
|
declare const Card: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
29
34
|
type Card = ReturnType<typeof Card>;
|
|
30
35
|
export default Card;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Card.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIzE,KAAK,gBAAgB,GAEpB,AAFwB,uEAAuE;AAE/F,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,qBAAqB,GAAG,SAAS,CAAC;IAC9C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/B,gFAAgF;IAChF,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Card.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIzE,KAAK,gBAAgB,GAEpB,AAFwB,uEAAuE;AAE/F,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,qBAAqB,GAAG,SAAS,CAAC;IAC9C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC/B,gFAAgF;IAChF,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAuEJ;;;;GAIG;AACH,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
The menu surface shared by `ContextmenuRoot.svelte` and
|
|
5
|
+
`ContextmenuRootForSafariCompatibility.svelte`. Owns everything that happens while
|
|
6
|
+
the menu is open - positioning, keyboard navigation, dismissal on outside presses,
|
|
7
|
+
popover top-layer promotion, and entry rendering - while the roots own gesture
|
|
8
|
+
detection, i.e. how the menu opens. Holds no gesture state of its own; the
|
|
9
|
+
`open_guard` it consults is owned and armed by the root.
|
|
10
|
+
|
|
11
|
+
@cssprop --contextmenu_z_index - stacking order of the menu in browsers without the Popover API
|
|
12
|
+
@cssprop --contextmenu_border_width - width of the menu's border
|
|
13
|
+
@cssprop --contextmenu_border_style - style of the menu's border
|
|
14
|
+
@cssprop --contextmenu_border_color - color of the menu's border
|
|
15
|
+
@cssprop --contextmenu_border_radius - corner radius of the menu
|
|
16
|
+
-->
|
|
1
17
|
<script module lang="ts">
|
|
2
18
|
// The default entry snippets are shared by `ContextmenuRoot.svelte`
|
|
3
19
|
// and `ContextmenuRootForSafariCompatibility.svelte`.
|
|
@@ -5,14 +21,6 @@
|
|
|
5
21
|
</script>
|
|
6
22
|
|
|
7
23
|
<script lang="ts">
|
|
8
|
-
/**
|
|
9
|
-
* The menu surface shared by `ContextmenuRoot.svelte` and
|
|
10
|
-
* `ContextmenuRootForSafariCompatibility.svelte`. Owns everything that happens
|
|
11
|
-
* while the menu is open - positioning, keyboard navigation, dismissal on
|
|
12
|
-
* outside presses, popover top-layer promotion, and entry rendering - while
|
|
13
|
-
* the roots own gesture detection, i.e. how the menu opens. Holds no gesture
|
|
14
|
-
* state of its own; the `open_guard` it consults is owned and armed by the root.
|
|
15
|
-
*/
|
|
16
24
|
import { swallow } from '@fuzdev/fuz_util/dom.ts';
|
|
17
25
|
import type { ComponentProps, Snippet } from 'svelte';
|
|
18
26
|
|
|
@@ -35,6 +35,20 @@ type $$ComponentProps = {
|
|
|
35
35
|
declare const link_entry_default: (props: ComponentProps<typeof ContextmenuLinkEntry>) => ReturnType<import("svelte").Snippet>;
|
|
36
36
|
declare const text_entry_default: (props: ComponentProps<typeof ContextmenuTextEntry>) => ReturnType<import("svelte").Snippet>;
|
|
37
37
|
declare const separator_entry_default: (props: ComponentProps<typeof ContextmenuSeparator>) => ReturnType<import("svelte").Snippet>;
|
|
38
|
+
/**
|
|
39
|
+
* The menu surface shared by `ContextmenuRoot.svelte` and
|
|
40
|
+
* `ContextmenuRootForSafariCompatibility.svelte`. Owns everything that happens while
|
|
41
|
+
* the menu is open - positioning, keyboard navigation, dismissal on outside presses,
|
|
42
|
+
* popover top-layer promotion, and entry rendering - while the roots own gesture
|
|
43
|
+
* detection, i.e. how the menu opens. Holds no gesture state of its own; the
|
|
44
|
+
* `open_guard` it consults is owned and armed by the root.
|
|
45
|
+
*
|
|
46
|
+
* @cssprop --contextmenu_z_index - stacking order of the menu in browsers without the Popover API
|
|
47
|
+
* @cssprop --contextmenu_border_width - width of the menu's border
|
|
48
|
+
* @cssprop --contextmenu_border_style - style of the menu's border
|
|
49
|
+
* @cssprop --contextmenu_border_color - color of the menu's border
|
|
50
|
+
* @cssprop --contextmenu_border_radius - corner radius of the menu
|
|
51
|
+
*/
|
|
38
52
|
declare const ContextmenuMenu: import("svelte").Component<$$ComponentProps, {}, "el">;
|
|
39
53
|
type ContextmenuMenu = ReturnType<typeof ContextmenuMenu>;
|
|
40
54
|
export default ContextmenuMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuMenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuMenu.svelte"],"names":[],"mappings":"AAKC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuMenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuMenu.svelte"],"names":[],"mappings":"AAKC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,CAAC;AAI5E,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtD,OAAO,EAEL,KAAK,gBAAgB,EACrB,MAAM,+BAA+B,CAAC;AACxC,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,oBAAoB,MAAM,+BA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|
6
6
|
type, variable, enum, component, snippet) and their kind-specific fields
|
|
7
|
-
including parameters, props, members, overloads,
|
|
7
|
+
including parameters, props, CSS custom properties, members, overloads,
|
|
8
|
+
external types, and more.
|
|
8
9
|
|
|
9
10
|
@see `declaration.svelte.ts` for the `Declaration` wrapper class
|
|
10
11
|
@see {@link https://github.com/fuzdev/svelte-docinfo svelte-docinfo} for the analysis library
|
|
@@ -25,6 +26,7 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
25
26
|
import TypeJsonView from './TypeJsonView.svelte';
|
|
26
27
|
import ModuleLink from './ModuleLink.svelte';
|
|
27
28
|
import DocsLink from './DocsLink.svelte';
|
|
29
|
+
import { dedent_css_fallback } from './helpers.js';
|
|
28
30
|
|
|
29
31
|
const { declaration }: { declaration: Declaration } = $props();
|
|
30
32
|
|
|
@@ -40,6 +42,14 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
40
42
|
return filtered.length ? filtered : undefined;
|
|
41
43
|
});
|
|
42
44
|
|
|
45
|
+
// the "inferred" chip marks entries found by a `var()` fallback, which only
|
|
46
|
+
// distinguishes anything when the list also has `@cssprop`-documented ones
|
|
47
|
+
const css_property_chips_shown = $derived.by(() => {
|
|
48
|
+
const css_properties = declaration.css_custom_properties;
|
|
49
|
+
if (!css_properties) return false;
|
|
50
|
+
return css_properties.some((p) => p.documented) && css_properties.some((p) => !p.documented);
|
|
51
|
+
});
|
|
52
|
+
|
|
43
53
|
// render mdz inline `code` as API-linking `DocsLink` and fenced blocks as syntax-highlighted
|
|
44
54
|
// `Code`, matching the rest of the docs โ the injection mdz core leaves open
|
|
45
55
|
mdz_set_context_with_fallback(mdz_code_context, () => DocsLink);
|
|
@@ -318,6 +328,52 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
318
328
|
</section>
|
|
319
329
|
{/if}
|
|
320
330
|
|
|
331
|
+
<!-- CSS custom properties (for Svelte components): the styling API a
|
|
332
|
+
consumer sets on the component or an ancestor; `documented` entries come
|
|
333
|
+
from `@cssprop` tags and arrive first, the rest are inferred from `var()`
|
|
334
|
+
fallbacks in the component's styles, marked only when the list mixes both -->
|
|
335
|
+
{#if declaration.css_custom_properties?.length}
|
|
336
|
+
<section>
|
|
337
|
+
<h4>CSS custom properties</h4>
|
|
338
|
+
{#if css_property_chips_shown}
|
|
339
|
+
<p>
|
|
340
|
+
Properties marked <span class="chip">inferred</span> are found by their <code>var()</code>
|
|
341
|
+
fallback, not documented with <code>@cssprop</code>.
|
|
342
|
+
</p>
|
|
343
|
+
{/if}
|
|
344
|
+
{#each declaration.css_custom_properties as css_property (css_property.name)}
|
|
345
|
+
<section>
|
|
346
|
+
<div class="row gap_md">
|
|
347
|
+
<h5><code>{css_property.name}</code></h5>
|
|
348
|
+
{#if css_property_chips_shown && !css_property.documented}
|
|
349
|
+
<span class="chip">inferred</span>
|
|
350
|
+
{/if}
|
|
351
|
+
</div>
|
|
352
|
+
{#if css_property.description}
|
|
353
|
+
<Mdz content={css_property.description} />
|
|
354
|
+
{/if}
|
|
355
|
+
{#if css_property.syntax}
|
|
356
|
+
<div class="row gap_md mb_sm">
|
|
357
|
+
<strong>syntax</strong>
|
|
358
|
+
<code>{css_property.syntax}</code>
|
|
359
|
+
</div>
|
|
360
|
+
{/if}
|
|
361
|
+
{#if css_property.fallback !== undefined}
|
|
362
|
+
<div class="row gap_md">
|
|
363
|
+
<strong>fallback</strong>
|
|
364
|
+
{#if css_property.fallback}
|
|
365
|
+
<Code lang="css" content={dedent_css_fallback(css_property.fallback)} wrap />
|
|
366
|
+
{:else}
|
|
367
|
+
<!-- `var(--a,)`, a fallback of nothing -->
|
|
368
|
+
<span>empty</span>
|
|
369
|
+
{/if}
|
|
370
|
+
</div>
|
|
371
|
+
{/if}
|
|
372
|
+
</section>
|
|
373
|
+
{/each}
|
|
374
|
+
</section>
|
|
375
|
+
{/if}
|
|
376
|
+
|
|
321
377
|
<!-- overloads -->
|
|
322
378
|
{#if declaration.overloads?.length}
|
|
323
379
|
<section>
|
|
@@ -6,7 +6,8 @@ type $$ComponentProps = {
|
|
|
6
6
|
* Renders the full detail view for an exported declaration.
|
|
7
7
|
* Handles all svelte-docinfo declaration kinds (function, class, interface,
|
|
8
8
|
* type, variable, enum, component, snippet) and their kind-specific fields
|
|
9
|
-
* including parameters, props, members, overloads,
|
|
9
|
+
* including parameters, props, CSS custom properties, members, overloads,
|
|
10
|
+
* external types, and more.
|
|
10
11
|
*
|
|
11
12
|
* @see `declaration.svelte.ts` for the `Declaration` wrapper class
|
|
12
13
|
* @see {@link https://github.com/fuzdev/svelte-docinfo svelte-docinfo} for the analysis library
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclarationDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationDetail.svelte"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"DeclarationDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationDetail.svelte"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAoB1D,KAAK,gBAAgB,GAAI;IAAE,WAAW,EAAE,WAAW,CAAA;CAAE,CAAC;AAikBvD;;;;;;;;;GASG;AACH,QAAA,MAAM,iBAAiB,sDAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
package/dist/Dialog.svelte
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
Renders a native `<dialog>` opened with `showModal()`, which puts it in the top
|
|
5
|
+
layer. The top layer escapes ancestor stacking/overflow contexts (so no `Teleport`
|
|
6
|
+
is needed), traps focus, makes the rest of the page inert, closes on Escape, and
|
|
7
|
+
restores focus to the previously focused element on close -- all natively. The dim
|
|
8
|
+
background is the native `::backdrop`.
|
|
9
|
+
|
|
10
|
+
We render a full-viewport overlay inside the dialog rather than a content-sized
|
|
11
|
+
box, to preserve the scrolling and `align="top"` behaviors. The content surface
|
|
12
|
+
itself is the consumer's -- pair this with `DialogContent` for the default `.pane`
|
|
13
|
+
card and gutter, or render your own surface in `children`.
|
|
14
|
+
|
|
15
|
+
@cssprop --backdrop_color - color of the overlay behind the dialog's content, fuz_css's global token by default
|
|
16
|
+
-->
|
|
1
17
|
<script lang="ts">
|
|
2
18
|
import type { Snippet } from 'svelte';
|
|
3
19
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
@@ -6,21 +22,6 @@
|
|
|
6
22
|
|
|
7
23
|
import { dialog_context, type DialogContext, type DialogAlign } from './dialog.js';
|
|
8
24
|
|
|
9
|
-
/**
|
|
10
|
-
* This component renders a native `<dialog>` opened with `showModal()`, which
|
|
11
|
-
* puts it in the top layer. The top layer escapes ancestor stacking/overflow
|
|
12
|
-
* contexts (so no `Teleport` is needed), traps focus, makes the rest of the page
|
|
13
|
-
* inert, closes on Escape, and restores focus to the previously focused element
|
|
14
|
-
* on close -- all natively. The dim background is the native `::backdrop`.
|
|
15
|
-
*
|
|
16
|
-
* We render a full-viewport overlay inside the dialog rather than a content-sized
|
|
17
|
-
* box, to preserve the scrolling and `align="top"` behaviors. The content
|
|
18
|
-
* surface itself is the consumer's -- pair this with `DialogContent` for the
|
|
19
|
-
* default `.pane` card and gutter, or render your own surface in `children`.
|
|
20
|
-
*
|
|
21
|
-
* @module
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
25
|
const {
|
|
25
26
|
show = true,
|
|
26
27
|
align = 'center',
|
package/dist/Dialog.svelte.d.ts
CHANGED
|
@@ -55,6 +55,20 @@ type $$ComponentProps = Omit<SvelteHTMLElements['dialog'], 'children' | 'onclose
|
|
|
55
55
|
*/
|
|
56
56
|
children: Snippet<[dialog: DialogContext]>;
|
|
57
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Renders a native `<dialog>` opened with `showModal()`, which puts it in the top
|
|
60
|
+
* layer. The top layer escapes ancestor stacking/overflow contexts (so no `Teleport`
|
|
61
|
+
* is needed), traps focus, makes the rest of the page inert, closes on Escape, and
|
|
62
|
+
* restores focus to the previously focused element on close -- all natively. The dim
|
|
63
|
+
* background is the native `::backdrop`.
|
|
64
|
+
*
|
|
65
|
+
* We render a full-viewport overlay inside the dialog rather than a content-sized
|
|
66
|
+
* box, to preserve the scrolling and `align="top"` behaviors. The content surface
|
|
67
|
+
* itself is the consumer's -- pair this with `DialogContent` for the default `.pane`
|
|
68
|
+
* card and gutter, or render your own surface in `children`.
|
|
69
|
+
*
|
|
70
|
+
* @cssprop --backdrop_color - color of the overlay behind the dialog's content, fuz_css's global token by default
|
|
71
|
+
*/
|
|
58
72
|
declare const Dialog: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
59
73
|
type Dialog = ReturnType<typeof Dialog>;
|
|
60
74
|
export default Dialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Dialog.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI1D,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAElF,KAAK,gBAAgB,GAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IACrF;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B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coloring. Uses svelte-docinfo's file type predicates for module c
|
|
|
6
6
|
|
|
7
7
|
@see `library.svelte.ts` for the `Library` wrapper class
|
|
8
8
|
@see {@link https://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library
|
|
9
|
+
@cssprop --max_width - maximum width of the detail
|
|
9
10
|
-->
|
|
10
11
|
<script lang="ts">
|
|
11
12
|
import { page } from '$app/state';
|
|
@@ -23,6 +23,7 @@ type $$ComponentProps = OmitStrict<SvelteHTMLElements['div'], 'children'> & {
|
|
|
23
23
|
*
|
|
24
24
|
* @see `library.svelte.ts` for the `Library` wrapper class
|
|
25
25
|
* @see {@link https://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library
|
|
26
|
+
* @cssprop --max_width - maximum width of the detail
|
|
26
27
|
*/
|
|
27
28
|
declare const LibraryDetail: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
28
29
|
type LibraryDetail = ReturnType<typeof LibraryDetail>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibraryDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibraryDetail.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAOnE,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,C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,CAAC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;CACvC,CAAC;AAgLH;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,sDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -11,6 +11,7 @@ type $$ComponentProps = SvelteHTMLElements['div'] & {
|
|
|
11
11
|
homepage_url?: Snippet<[homepage_url: string]>;
|
|
12
12
|
children?: Snippet;
|
|
13
13
|
};
|
|
14
|
+
/** @cssprop --max_width - maximum width of the summary */
|
|
14
15
|
declare const LibrarySummary: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
16
|
type LibrarySummary = ReturnType<typeof LibrarySummary>;
|
|
16
17
|
export default LibrarySummary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibrarySummary.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibrarySummary.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGlD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,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,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C,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAgHH,0DAA0D;AAC1D,QAAA,MAAM,cAAc,sDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
@cssprop --font_size - size of the dots, inherited by default
|
|
5
|
+
@cssprop --scale_x - horizontal scale of a dot at rest, growing to 1 mid-cycle
|
|
6
|
+
@cssprop --scale_y - vertical scale of a dot at rest, growing to 1 mid-cycle
|
|
7
|
+
@cssprop --scale_z - depth scale of a dot at rest, growing to 1 mid-cycle
|
|
8
|
+
@cssprop --animation_duration - length of one animation cycle
|
|
9
|
+
-->
|
|
1
10
|
<script lang="ts">
|
|
2
11
|
import type { OmitStrict } from '@fuzdev/fuz_util/types.ts';
|
|
3
12
|
import type { Snippet } from 'svelte';
|
|
@@ -7,6 +7,13 @@ type $$ComponentProps = OmitStrict<SvelteHTMLElements['span'], 'children'> & {
|
|
|
7
7
|
item_attrs?: SvelteHTMLElements['span'];
|
|
8
8
|
children?: Snippet<[index: number]>;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* @cssprop --font_size - size of the dots, inherited by default
|
|
12
|
+
* @cssprop --scale_x - horizontal scale of a dot at rest, growing to 1 mid-cycle
|
|
13
|
+
* @cssprop --scale_y - vertical scale of a dot at rest, growing to 1 mid-cycle
|
|
14
|
+
* @cssprop --scale_z - depth scale of a dot at rest, growing to 1 mid-cycle
|
|
15
|
+
* @cssprop --animation_duration - length of one animation cycle
|
|
16
|
+
*/
|
|
10
17
|
declare const PendingAnimation: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
18
|
type PendingAnimation = ReturnType<typeof PendingAnimation>;
|
|
12
19
|
export default PendingAnimation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PendingAnimation.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingAnimation.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"PendingAnimation.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/PendingAnimation.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACpC,CAAC;AAqCH;;;;;;GAMG;AACH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
package/dist/Sparkline.svelte
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
Renders values as a small inline SVG line graph.
|
|
5
|
+
|
|
6
|
+
Designed for comparable small multiples: pass a shared `max` so a set of
|
|
7
|
+
sparklines renders at the same vertical scale instead of each stretching to fit.
|
|
8
|
+
The stroke uses `currentColor`, so color it by setting `color` on the component or
|
|
9
|
+
a parent (e.g. a fuz_css `color_*` class). Each point's stroke alpha scales with
|
|
10
|
+
its value, from `alpha_floor` at 0 up to 1 at `max`, de-emphasizing quiet stretches.
|
|
11
|
+
|
|
12
|
+
`scale` controls only the geometry: the nonlinear options compress the top of the
|
|
13
|
+
range so small values stay legible under a large shared `max`, while the alpha
|
|
14
|
+
fade keeps tracking the linear ratio so it still encodes true magnitude.
|
|
15
|
+
|
|
16
|
+
@cssprop --sparkline_bg - background behind the line, a light wash of `currentColor` by default
|
|
17
|
+
-->
|
|
1
18
|
<script lang="ts">
|
|
2
19
|
import type { OmitStrict } from '@fuzdev/fuz_util/types.ts';
|
|
3
20
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
4
21
|
|
|
5
22
|
import { sparkline_geometry, type SparklineScale } from './sparkline.js';
|
|
6
23
|
|
|
7
|
-
/**
|
|
8
|
-
* Renders values as a small inline SVG line graph.
|
|
9
|
-
*
|
|
10
|
-
* Designed for comparable small multiples: pass a shared `max` so a set of
|
|
11
|
-
* sparklines renders at the same vertical scale instead of each stretching
|
|
12
|
-
* to fit. The stroke uses `currentColor`, so color it by setting `color` on
|
|
13
|
-
* the component or a parent (e.g. a fuz_css `color_*` class). Each point's
|
|
14
|
-
* stroke alpha scales with its value, from `alpha_floor` at 0 up to 1 at
|
|
15
|
-
* `max`, de-emphasizing quiet stretches.
|
|
16
|
-
*
|
|
17
|
-
* `scale` controls only the geometry: the nonlinear options compress the
|
|
18
|
-
* top of the range so small values stay legible under a large shared
|
|
19
|
-
* `max`, while the alpha fade keeps tracking the linear ratio so it still
|
|
20
|
-
* encodes true magnitude.
|
|
21
|
-
*
|
|
22
|
-
* The background is a light wash of `currentColor`, overridable with the
|
|
23
|
-
* `--sparkline_bg` custom property.
|
|
24
|
-
*
|
|
25
|
-
* @module
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
24
|
const {
|
|
29
25
|
values,
|
|
30
26
|
max,
|
|
@@ -36,6 +36,21 @@ type $$ComponentProps = OmitStrict<SvelteHTMLElements['svg'], 'values' | 'width'
|
|
|
36
36
|
*/
|
|
37
37
|
label?: string;
|
|
38
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* Renders values as a small inline SVG line graph.
|
|
41
|
+
*
|
|
42
|
+
* Designed for comparable small multiples: pass a shared `max` so a set of
|
|
43
|
+
* sparklines renders at the same vertical scale instead of each stretching to fit.
|
|
44
|
+
* The stroke uses `currentColor`, so color it by setting `color` on the component or
|
|
45
|
+
* a parent (e.g. a fuz_css `color_*` class). Each point's stroke alpha scales with
|
|
46
|
+
* its value, from `alpha_floor` at 0 up to 1 at `max`, de-emphasizing quiet stretches.
|
|
47
|
+
*
|
|
48
|
+
* `scale` controls only the geometry: the nonlinear options compress the top of the
|
|
49
|
+
* range so small values stay legible under a large shared `max`, while the alpha
|
|
50
|
+
* fade keeps tracking the linear ratio so it still encodes true magnitude.
|
|
51
|
+
*
|
|
52
|
+
* @cssprop --sparkline_bg - background behind the line, a light wash of `currentColor` by default
|
|
53
|
+
*/
|
|
39
54
|
declare const Sparkline: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
40
55
|
type Sparkline = ReturnType<typeof Sparkline>;
|
|
41
56
|
export default Sparkline;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sparkline.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Sparkline.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAExE,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG;IACzG,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"Sparkline.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Sparkline.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAExE,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG;IACzG,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAgDH;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeclarationJsonInput, MemberJsonInput, ParameterJsonInput, ComponentPropJsonInput, OverloadJsonInput, Reactivity, TypeJson } from 'svelte-docinfo/types.js';
|
|
1
|
+
import type { DeclarationJsonInput, MemberJsonInput, ParameterJsonInput, ComponentPropJsonInput, ComponentCssPropertyJsonInput, OverloadJsonInput, Reactivity, TypeJson } from 'svelte-docinfo/types.js';
|
|
2
2
|
import type { Module } from './module.svelte.js';
|
|
3
3
|
/**
|
|
4
4
|
* Rich runtime representation of an exported declaration.
|
|
@@ -104,6 +104,13 @@ export declare class Declaration {
|
|
|
104
104
|
* Present on `type` and `interface` kinds.
|
|
105
105
|
*/
|
|
106
106
|
get merged_value(): boolean | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* The component's styling API: CSS custom properties its styles read with
|
|
109
|
+
* a `var()` fallback, plus any its doc comment documents with `@cssprop`
|
|
110
|
+
* tags (`documented`), the documented ones first.
|
|
111
|
+
* Present on `component` kind only.
|
|
112
|
+
*/
|
|
113
|
+
get css_custom_properties(): Array<ComponentCssPropertyJsonInput> | undefined;
|
|
107
114
|
/**
|
|
108
115
|
* Whether a component accepts children via props or template usage.
|
|
109
116
|
* Present on `component` kind only.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/declaration.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAcjD;;;;;;;;;;;;GAYG;AACH,qBAAa,WAAW;;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAiB;IACxC,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,CAAiB;IAEhE,IAAI,OAAO,IAAI,MAAM,CAAC,SAAS,CAAC,CAE/B;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAEvC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAQnC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAID;;OAEG;IACH,IAAI,gBAAgB,IAAI,MAAM,CAS7B;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAIrC;IAID;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAOzB;IAED,IAAI,cAAc,IAAI,MAAM,GAAG,SAAS,CAEvC;IAED;;;OAGG;IACH,IAAI,SAAS,IAAI,QAAQ,GAAG,SAAS,CAEpC;IAED;;;;;;;;OAQG;IACH,IAAI,kBAAkB,IAAI,QAAQ,GAAG,SAAS,CAU7C;IAED;;;;OAIG;IACH,IAAI,aAAa,IAAI,MAAM,GAAG,SA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,IAAI,OAAO,CAG5B;IAED,IAAI,SAAS,IAAI,OAAO,CAGvB;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;gBAEW,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,oBAAoB;CAIlE"}
|
|
@@ -193,6 +193,15 @@ export class Declaration {
|
|
|
193
193
|
get merged_value() {
|
|
194
194
|
return field(this.declaration_json, 'mergedValue');
|
|
195
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* The component's styling API: CSS custom properties its styles read with
|
|
198
|
+
* a `var()` fallback, plus any its doc comment documents with `@cssprop`
|
|
199
|
+
* tags (`documented`), the documented ones first.
|
|
200
|
+
* Present on `component` kind only.
|
|
201
|
+
*/
|
|
202
|
+
get css_custom_properties() {
|
|
203
|
+
return field(this.declaration_json, 'cssCustomProperties');
|
|
204
|
+
}
|
|
196
205
|
/**
|
|
197
206
|
* Whether a component accepts children via props or template usage.
|
|
198
207
|
* Present on `component` kind only.
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
export declare const render_value_to_string: (value: unknown) => string;
|
|
2
|
+
/**
|
|
3
|
+
* Strips the whitespace prefix that a CSS custom property's multi-line
|
|
4
|
+
* `fallback` shares across its continuation lines, so a value broken over
|
|
5
|
+
* several stylesheet lines renders without the stylesheet's indentation.
|
|
6
|
+
* Line endings normalize to `\n`, and whitespace-only lines become empty.
|
|
7
|
+
*
|
|
8
|
+
* @param fallback - the verbatim fallback source text
|
|
9
|
+
* @returns the fallback with its continuation lines dedented
|
|
10
|
+
*/
|
|
11
|
+
export declare const dedent_css_fallback: (fallback: string) => string;
|
|
2
12
|
//# sourceMappingURL=helpers.d.ts.map
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/helpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,MASvD,CAAC"}
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/helpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,MASvD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,KAAG,MAoBtD,CAAC"}
|
package/dist/helpers.js
CHANGED
|
@@ -14,3 +14,37 @@ export const render_value_to_string = (value) => {
|
|
|
14
14
|
return JSON.stringify(value);
|
|
15
15
|
return value + ''; // eslint-disable-line @typescript-eslint/no-base-to-string
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Strips the whitespace prefix that a CSS custom property's multi-line
|
|
19
|
+
* `fallback` shares across its continuation lines, so a value broken over
|
|
20
|
+
* several stylesheet lines renders without the stylesheet's indentation.
|
|
21
|
+
* Line endings normalize to `\n`, and whitespace-only lines become empty.
|
|
22
|
+
*
|
|
23
|
+
* @param fallback - the verbatim fallback source text
|
|
24
|
+
* @returns the fallback with its continuation lines dedented
|
|
25
|
+
*/
|
|
26
|
+
export const dedent_css_fallback = (fallback) => {
|
|
27
|
+
const lines = fallback.split(/\r?\n/);
|
|
28
|
+
if (lines.length === 1)
|
|
29
|
+
return fallback;
|
|
30
|
+
// svelte-docinfo trims the fallback, so the first line's original column is
|
|
31
|
+
// lost โ it stays as-is, and only the continuation lines are compared
|
|
32
|
+
let prefix;
|
|
33
|
+
for (let i = 1; i < lines.length; i++) {
|
|
34
|
+
const line = lines[i];
|
|
35
|
+
if (!line.trim())
|
|
36
|
+
continue;
|
|
37
|
+
const leading = /^[ \t]*/.exec(line)[0];
|
|
38
|
+
if (prefix === undefined) {
|
|
39
|
+
prefix = leading;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
let j = 0;
|
|
43
|
+
while (j < prefix.length && j < leading.length && prefix[j] === leading[j])
|
|
44
|
+
j++;
|
|
45
|
+
prefix = prefix.slice(0, j);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const width = prefix?.length ?? 0;
|
|
49
|
+
return lines.map((line, i) => (i === 0 ? line : line.trim() ? line.slice(width) : '')).join('\n');
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.220.0",
|
|
4
4
|
"description": "Svelte UI library",
|
|
5
5
|
"tagline": "friendly user zystem",
|
|
6
6
|
"glyph": "๐งถ",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"jsdom": "^29.1.1",
|
|
83
83
|
"svelte": "^5.57.2",
|
|
84
84
|
"svelte-check": "^4.7.6",
|
|
85
|
-
"svelte-docinfo": "^0.
|
|
85
|
+
"svelte-docinfo": "^0.16.0",
|
|
86
86
|
"tslib": "^2.8.1",
|
|
87
87
|
"typescript": "^6.0.3",
|
|
88
88
|
"typescript-eslint": "^8.71.1",
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
MemberJsonInput,
|
|
5
5
|
ParameterJsonInput,
|
|
6
6
|
ComponentPropJsonInput,
|
|
7
|
+
ComponentCssPropertyJsonInput,
|
|
7
8
|
OverloadJsonInput,
|
|
8
9
|
Reactivity,
|
|
9
10
|
TypeJson
|
|
@@ -251,6 +252,19 @@ export class Declaration {
|
|
|
251
252
|
return field<boolean>(this.declaration_json, 'mergedValue');
|
|
252
253
|
}
|
|
253
254
|
|
|
255
|
+
/**
|
|
256
|
+
* The component's styling API: CSS custom properties its styles read with
|
|
257
|
+
* a `var()` fallback, plus any its doc comment documents with `@cssprop`
|
|
258
|
+
* tags (`documented`), the documented ones first.
|
|
259
|
+
* Present on `component` kind only.
|
|
260
|
+
*/
|
|
261
|
+
get css_custom_properties(): Array<ComponentCssPropertyJsonInput> | undefined {
|
|
262
|
+
return field<Array<ComponentCssPropertyJsonInput>>(
|
|
263
|
+
this.declaration_json,
|
|
264
|
+
'cssCustomProperties'
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
254
268
|
/**
|
|
255
269
|
* Whether a component accepts children via props or template usage.
|
|
256
270
|
* Present on `component` kind only.
|
package/src/lib/helpers.ts
CHANGED
|
@@ -8,3 +8,34 @@ export const render_value_to_string = (value: unknown): string => {
|
|
|
8
8
|
if (type === 'object') return JSON.stringify(value);
|
|
9
9
|
return value + ''; // eslint-disable-line @typescript-eslint/no-base-to-string
|
|
10
10
|
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Strips the whitespace prefix that a CSS custom property's multi-line
|
|
14
|
+
* `fallback` shares across its continuation lines, so a value broken over
|
|
15
|
+
* several stylesheet lines renders without the stylesheet's indentation.
|
|
16
|
+
* Line endings normalize to `\n`, and whitespace-only lines become empty.
|
|
17
|
+
*
|
|
18
|
+
* @param fallback - the verbatim fallback source text
|
|
19
|
+
* @returns the fallback with its continuation lines dedented
|
|
20
|
+
*/
|
|
21
|
+
export const dedent_css_fallback = (fallback: string): string => {
|
|
22
|
+
const lines = fallback.split(/\r?\n/);
|
|
23
|
+
if (lines.length === 1) return fallback;
|
|
24
|
+
// svelte-docinfo trims the fallback, so the first line's original column is
|
|
25
|
+
// lost โ it stays as-is, and only the continuation lines are compared
|
|
26
|
+
let prefix: string | undefined;
|
|
27
|
+
for (let i = 1; i < lines.length; i++) {
|
|
28
|
+
const line = lines[i]!;
|
|
29
|
+
if (!line.trim()) continue;
|
|
30
|
+
const leading = /^[ \t]*/.exec(line)![0];
|
|
31
|
+
if (prefix === undefined) {
|
|
32
|
+
prefix = leading;
|
|
33
|
+
} else {
|
|
34
|
+
let j = 0;
|
|
35
|
+
while (j < prefix.length && j < leading.length && prefix[j] === leading[j]) j++;
|
|
36
|
+
prefix = prefix.slice(0, j);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const width = prefix?.length ?? 0;
|
|
40
|
+
return lines.map((line, i) => (i === 0 ? line : line.trim() ? line.slice(width) : '')).join('\n');
|
|
41
|
+
};
|