@fuzdev/fuz_ui 0.207.0 → 0.209.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/README.md +1 -1
- package/dist/ApiIndex.svelte +9 -9
- package/dist/ApiModule.svelte +4 -4
- package/dist/DeclarationDetail.svelte +26 -5
- package/dist/DeclarationDetail.svelte.d.ts +1 -1
- package/dist/DeclarationDetail.svelte.d.ts.map +1 -1
- package/dist/EcosystemLinks.svelte +2 -2
- package/dist/ProjectLinks.svelte +3 -31
- package/dist/ProjectLinks.svelte.d.ts.map +1 -1
- package/dist/TypeLink.svelte +11 -0
- package/dist/TypeLink.svelte.d.ts +9 -0
- package/dist/TypeLink.svelte.d.ts.map +1 -1
- package/dist/api_search.svelte.d.ts +17 -20
- package/dist/api_search.svelte.d.ts.map +1 -1
- package/dist/api_search.svelte.js +32 -63
- package/dist/csp.d.ts +19 -1
- package/dist/csp.d.ts.map +1 -1
- package/dist/csp.js +26 -1
- package/dist/declaration.svelte.d.ts +25 -1
- package/dist/declaration.svelte.d.ts.map +1 -1
- package/dist/declaration.svelte.js +43 -3
- package/dist/logos.d.ts +1 -1
- package/dist/logos.d.ts.map +1 -1
- package/dist/logos.js +1 -1
- package/dist/projects.d.ts +0 -3
- package/dist/projects.d.ts.map +1 -1
- package/dist/projects.js +3 -3
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/package.json +7 -7
- package/src/lib/api_search.svelte.ts +34 -82
- package/src/lib/csp.ts +27 -1
- package/src/lib/declaration.svelte.ts +49 -3
- package/src/lib/logos.ts +1 -1
- package/src/lib/projects.ts +3 -6
- package/src/lib/sparkline.ts +1 -1
- package/dist/ProjectActivityChart.svelte +0 -137
- package/dist/ProjectActivityChart.svelte.d.ts +0 -30
- package/dist/ProjectActivityChart.svelte.d.ts.map +0 -1
- package/dist/project_stats.d.ts +0 -121
- package/dist/project_stats.d.ts.map +0 -1
- package/dist/project_stats.js +0 -153
- package/dist/project_stats_data.d.ts +0 -3
- package/dist/project_stats_data.d.ts.map +0 -1
- package/dist/project_stats_data.js +0 -469
- package/dist/project_stats_update.task.d.ts +0 -4
- package/dist/project_stats_update.task.d.ts.map +0 -1
- package/dist/project_stats_update.task.js +0 -50
- package/dist/publish.task.d.ts +0 -3
- package/dist/publish.task.d.ts.map +0 -1
- package/dist/publish.task.js +0 -23
- package/src/lib/project_stats.ts +0 -220
- package/src/lib/project_stats_data.ts +0 -472
- package/src/lib/project_stats_update.task.ts +0 -53
- package/src/lib/publish.task.ts +0 -22
package/README.md
CHANGED
package/dist/ApiIndex.svelte
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import DocsSearch from './DocsSearch.svelte';
|
|
7
7
|
import ApiModulesList from './ApiModulesList.svelte';
|
|
8
8
|
import ApiDeclarationList from './ApiDeclarationList.svelte';
|
|
9
|
-
import {
|
|
9
|
+
import { ApiSearchState } from './api_search.svelte.js';
|
|
10
10
|
|
|
11
11
|
const {
|
|
12
12
|
library: library_prop,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
const get_library = set_library_context_with_fallback(() => library_prop, 'ApiIndex');
|
|
34
34
|
const library = $derived(get_library());
|
|
35
35
|
|
|
36
|
-
const search = $derived(
|
|
36
|
+
const search = $derived(new ApiSearchState(library));
|
|
37
37
|
</script>
|
|
38
38
|
|
|
39
39
|
<svelte:head>
|
|
@@ -49,21 +49,21 @@
|
|
|
49
49
|
<section>
|
|
50
50
|
<p>{library.pkg_json.description}</p>
|
|
51
51
|
|
|
52
|
-
{#if search.modules.
|
|
52
|
+
{#if search.modules.length + search.declarations.length > 1}
|
|
53
53
|
<DocsSearch
|
|
54
|
-
module_count={search.modules.
|
|
55
|
-
declaration_count={search.declarations.
|
|
56
|
-
filtered_module_count={search.query.trim() ? search.
|
|
54
|
+
module_count={search.modules.length}
|
|
55
|
+
declaration_count={search.declarations.length}
|
|
56
|
+
filtered_module_count={search.query.trim() ? search.modules_filtered.length : undefined}
|
|
57
57
|
filtered_declaration_count={search.query.trim()
|
|
58
|
-
? search.
|
|
58
|
+
? search.declarations_filtered.length
|
|
59
59
|
: undefined}
|
|
60
60
|
bind:search_query={search.query}
|
|
61
61
|
/>
|
|
62
62
|
{/if}
|
|
63
63
|
</section>
|
|
64
64
|
|
|
65
|
-
<ApiModulesList modules={search.
|
|
65
|
+
<ApiModulesList modules={search.modules_filtered} search_query={search.query} />
|
|
66
66
|
|
|
67
|
-
<ApiDeclarationList declarations={search.
|
|
67
|
+
<ApiDeclarationList declarations={search.declarations_filtered} search_query={search.query} />
|
|
68
68
|
{/if}
|
|
69
69
|
</TomeContent>
|
package/dist/ApiModule.svelte
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import DocsLink from './DocsLink.svelte';
|
|
18
18
|
import DeclarationLink from './DeclarationLink.svelte';
|
|
19
19
|
import ApiDeclarationList from './ApiDeclarationList.svelte';
|
|
20
|
-
import {
|
|
20
|
+
import { DeclarationSearchState } from './api_search.svelte.js';
|
|
21
21
|
|
|
22
22
|
const {
|
|
23
23
|
module_path: module_path_param,
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
module?.path || (directory_modules ? module_path : '[missing module]')
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
-
const search = $derived(
|
|
67
|
+
const search = $derived(new DeclarationSearchState(module?.declarations ?? []));
|
|
68
68
|
|
|
69
69
|
// GitHub source URL for the module
|
|
70
70
|
const source_url = $derived(module?.url_github);
|
|
@@ -117,11 +117,11 @@
|
|
|
117
117
|
<TomeSection>
|
|
118
118
|
<TomeSectionHeader text="Declarations" />
|
|
119
119
|
|
|
120
|
-
{#if search.
|
|
120
|
+
{#if search.declarations.length > 1}
|
|
121
121
|
<section>
|
|
122
122
|
<DocsSearch
|
|
123
123
|
placeholder="search declarations in this module..."
|
|
124
|
-
declaration_count={search.
|
|
124
|
+
declaration_count={search.declarations.length}
|
|
125
125
|
filtered_declaration_count={search.query.trim() ? search.filtered.length : undefined}
|
|
126
126
|
bind:search_query={search.query}
|
|
127
127
|
/>
|
|
@@ -7,7 +7,7 @@ type, variable, enum, component, snippet) and their kind-specific fields
|
|
|
7
7
|
including parameters, props, members, overloads, external types, and more.
|
|
8
8
|
|
|
9
9
|
@see `declaration.svelte.ts` for the `Declaration` wrapper class
|
|
10
|
-
@see {@link https://github.com/
|
|
10
|
+
@see {@link https://github.com/fuzdev/svelte-docinfo svelte-docinfo} for the analysis library
|
|
11
11
|
-->
|
|
12
12
|
<script lang="ts">
|
|
13
13
|
import Code from '@fuzdev/fuz_code/Code.svelte';
|
|
@@ -50,6 +50,7 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
50
50
|
// sections for the same fields instead).
|
|
51
51
|
interface DocExtras {
|
|
52
52
|
deprecatedMessage?: string;
|
|
53
|
+
internalMessage?: string;
|
|
53
54
|
since?: string;
|
|
54
55
|
examples?: Array<string>;
|
|
55
56
|
seeAlso?: Array<string>;
|
|
@@ -96,7 +97,7 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
96
97
|
</div>
|
|
97
98
|
{/snippet}
|
|
98
99
|
|
|
99
|
-
<!-- Compact prose metadata for props and members (deprecated, since, examples, see also, throws). -->
|
|
100
|
+
<!-- Compact prose metadata for props and members (deprecated, internal, since, examples, see also, throws). -->
|
|
100
101
|
{#snippet doc_extras(item: DocExtras)}
|
|
101
102
|
<!-- eslint-disable-next-line @typescript-eslint/no-deprecated -->
|
|
102
103
|
{#if item.deprecatedMessage !== undefined}
|
|
@@ -106,6 +107,12 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
106
107
|
{#if item.deprecatedMessage}{item.deprecatedMessage}{/if}
|
|
107
108
|
</p>
|
|
108
109
|
{/if}
|
|
110
|
+
{#if item.internalMessage !== undefined}
|
|
111
|
+
<p class="row gap_md">
|
|
112
|
+
<span class="chip">internal</span>
|
|
113
|
+
{#if item.internalMessage}{item.internalMessage}{/if}
|
|
114
|
+
</p>
|
|
115
|
+
{/if}
|
|
109
116
|
{#if item.since}
|
|
110
117
|
<p><strong>since</strong> {item.since}</p>
|
|
111
118
|
{/if}
|
|
@@ -159,8 +166,10 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
159
166
|
<!-- chips -->
|
|
160
167
|
<!-- eslint-disable-next-line @typescript-eslint/no-deprecated -->
|
|
161
168
|
{#if declaration.is_deprecated ||
|
|
169
|
+
declaration.is_internal ||
|
|
162
170
|
declaration.reactivity ||
|
|
163
171
|
declaration.accepts_children ||
|
|
172
|
+
declaration.merged_value ||
|
|
164
173
|
declaration.alias_of
|
|
165
174
|
}
|
|
166
175
|
<p class="row gap_md flex-wrap:wrap">
|
|
@@ -168,12 +177,18 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
168
177
|
{#if declaration.is_deprecated}
|
|
169
178
|
<span class="chip">⚠️ deprecated</span>
|
|
170
179
|
{/if}
|
|
180
|
+
{#if declaration.is_internal}
|
|
181
|
+
<span class="chip">internal</span>
|
|
182
|
+
{/if}
|
|
171
183
|
{#if declaration.reactivity}
|
|
172
184
|
<span class="chip">{declaration.reactivity}</span>
|
|
173
185
|
{/if}
|
|
174
186
|
{#if declaration.accepts_children}
|
|
175
187
|
<span class="chip">accepts children</span>
|
|
176
188
|
{/if}
|
|
189
|
+
{#if declaration.merged_value}
|
|
190
|
+
<span class="chip">value + type</span>
|
|
191
|
+
{/if}
|
|
177
192
|
{#if declaration.alias_of}
|
|
178
193
|
<span class="chip">
|
|
179
194
|
alias of {declaration.alias_of.name}{#if declaration.alias_of.module}
|
|
@@ -202,17 +217,23 @@ including parameters, props, members, overloads, external types, and more.
|
|
|
202
217
|
</p>
|
|
203
218
|
{/if}
|
|
204
219
|
|
|
220
|
+
{#if declaration.internal_message}
|
|
221
|
+
<p>{declaration.internal_message}</p>
|
|
222
|
+
{/if}
|
|
223
|
+
|
|
205
224
|
<!-- type signature -->
|
|
206
225
|
{#if declaration.type_signature}
|
|
207
226
|
<Code lang="ts" content={declaration.type_signature} />
|
|
208
227
|
{/if}
|
|
209
228
|
|
|
210
229
|
<!-- structured type (variables and type aliases; carries what the flat
|
|
211
|
-
signature lost — union members, recovered alias names — with links)
|
|
212
|
-
|
|
230
|
+
signature lost — union members, recovered alias names — with links);
|
|
231
|
+
`type_info_expanded` strips a self-aliased root so a union alias expands
|
|
232
|
+
into its members here instead of linking circularly to itself -->
|
|
233
|
+
{#if declaration.type_info_expanded}
|
|
213
234
|
<p class="row gap_md">
|
|
214
235
|
<strong>type</strong>
|
|
215
|
-
<TypeJsonView type_info={declaration.
|
|
236
|
+
<TypeJsonView type_info={declaration.type_info_expanded} title={declaration.type_signature} />
|
|
216
237
|
</p>
|
|
217
238
|
{/if}
|
|
218
239
|
|
|
@@ -9,7 +9,7 @@ type $$ComponentProps = {
|
|
|
9
9
|
* including parameters, props, members, overloads, external types, and more.
|
|
10
10
|
*
|
|
11
11
|
* @see `declaration.svelte.ts` for the `Declaration` wrapper class
|
|
12
|
-
* @see {@link https://github.com/
|
|
12
|
+
* @see {@link https://github.com/fuzdev/svelte-docinfo svelte-docinfo} for the analysis library
|
|
13
13
|
*/
|
|
14
14
|
declare const DeclarationDetail: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
15
15
|
type DeclarationDetail = ReturnType<typeof DeclarationDetail>;
|
|
@@ -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;AAkB1D,KAAK,gBAAgB,GAAI;IAAE,WAAW,EAAE,WAAW,CAAA;CAAE,CAAC;AAigBvD;;;;;;;;GAQG;AACH,QAAA,MAAM,iBAAiB,sDAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
<ul {...rest}>
|
|
15
15
|
<li>
|
|
16
16
|
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
17
|
-
<a rel="me" href={FUZ_DEV_URL} class={{ selected: selected === 'fuz.dev' }}>fuz.dev</a>
|
|
18
|
-
|
|
17
|
+
<a rel="me" href={FUZ_DEV_URL} class={{ selected: selected === 'fuz.dev' }}>fuz.dev</a> - the
|
|
18
|
+
Fuz stack homepage{#if selected === 'fuz.dev'}, you are here{/if}
|
|
19
19
|
</li>
|
|
20
20
|
<li>
|
|
21
21
|
GitHub as <a rel="me" href="https://github.com/fuzdev">@fuzdev</a>
|
package/dist/ProjectLinks.svelte
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Svg from './Svg.svelte';
|
|
3
|
-
import Sparkline from './Sparkline.svelte';
|
|
4
3
|
import { project_items, type ProjectItem } from './projects.js';
|
|
5
|
-
import { project_stats_data } from './project_stats_data.js';
|
|
6
|
-
import { project_stats_label, project_stats_to_monthly_series } from './project_stats.js';
|
|
7
|
-
|
|
8
|
-
const { series, max } = project_stats_to_monthly_series(project_stats_data);
|
|
9
|
-
const series_by_name = new Map(series.map((s) => [s.name, s.counts]));
|
|
10
|
-
const label_by_name = new Map(
|
|
11
|
-
project_stats_data.projects.map((p) => [p.name, project_stats_label(p)])
|
|
12
|
-
);
|
|
13
4
|
</script>
|
|
14
5
|
|
|
15
6
|
<h2 class="mt_0 mb_xl2">Packages</h2>
|
|
@@ -18,35 +9,19 @@
|
|
|
18
9
|
{@render package_thumbnail(project_item)}
|
|
19
10
|
{/each}
|
|
20
11
|
</menu>
|
|
21
|
-
<small class="display:block text-align:right">
|
|
22
|
-
the charts show public commit activity<br />since Gro planted on August 7, 2019
|
|
23
|
-
</small>
|
|
24
12
|
|
|
25
13
|
{#snippet package_thumbnail(project_item: ProjectItem)}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<a
|
|
29
|
-
class="thumbnail row align-items:start shade_00 px_md py_xs border_radius_sm mb_lg"
|
|
30
|
-
href={project_item.url}
|
|
31
|
-
>
|
|
14
|
+
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
15
|
+
<a class="thumbnail row shade_00 px_md py_xs border_radius_sm mb_lg" href={project_item.url}>
|
|
32
16
|
<Svg shrink={false} data={project_item.logo} size="var(--icon_size_lg)" />
|
|
33
17
|
<div class="pl_lg width_atmost_sm">
|
|
34
|
-
<div class="thumbnail-name
|
|
35
|
-
{project_item.name}
|
|
36
|
-
{#if counts}
|
|
37
|
-
{@const stats_label = label_by_name.get(project_item.name)}
|
|
38
|
-
<div class="thumbnail-sparkline pl_md {project_item.color_class}" title={stats_label}>
|
|
39
|
-
<Sparkline values={counts} {max} scale={1 / 3} end_dot label={stats_label} />
|
|
40
|
-
</div>
|
|
41
|
-
{/if}
|
|
42
|
-
</div>
|
|
18
|
+
<div class="thumbnail-name {project_item.color_class}">{project_item.name}</div>
|
|
43
19
|
<div class="thumbnail-description font_size_md text_70 font-weight:500">
|
|
44
20
|
{project_item.description}
|
|
45
21
|
{project_item.glyph}
|
|
46
22
|
</div>
|
|
47
23
|
</div>
|
|
48
24
|
</a>
|
|
49
|
-
<!-- eslint-enable svelte/no-navigation-without-resolve -->
|
|
50
25
|
{/snippet}
|
|
51
26
|
|
|
52
27
|
<style>
|
|
@@ -83,7 +58,4 @@
|
|
|
83
58
|
transparent
|
|
84
59
|
);
|
|
85
60
|
}
|
|
86
|
-
.thumbnail-sparkline {
|
|
87
|
-
margin-left: auto;
|
|
88
|
-
}
|
|
89
61
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ProjectLinks.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProjectLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ProjectLinks.svelte"],"names":[],"mappings":"AAoCA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,YAAY;;kBAA+E,CAAC;AAChF,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAe,YAAY,CAAC"}
|
package/dist/TypeLink.svelte
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
|
|
4
|
+
Renders a type reference, linking the parts that resolve to library declarations.
|
|
5
|
+
|
|
6
|
+
With `type_info` it delegates to `TypeJsonView`, which renders the structured
|
|
7
|
+
tree — reference names become `DeclarationLink`s and everything else is
|
|
8
|
+
syntax-highlighted in place, so `Map<string, Tome> | null` links `Map` and
|
|
9
|
+
`Tome` independently, with the flat `type` as hover text. Without it the whole
|
|
10
|
+
`type` string links only when it names a declaration outright.
|
|
11
|
+
-->
|
|
1
12
|
<script lang="ts">
|
|
2
13
|
import Code from '@fuzdev/fuz_code/Code.svelte';
|
|
3
14
|
import type { HTMLAttributes, SvelteHTMLElements } from 'svelte/elements';
|
|
@@ -19,6 +19,15 @@ HTMLAttributes<HTMLElement> & {
|
|
|
19
19
|
/** Code attributes, applied only to the fallback `Code` when the type doesn't resolve. */
|
|
20
20
|
code_attrs?: SvelteHTMLElements['code'];
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Renders a type reference, linking the parts that resolve to library declarations.
|
|
24
|
+
*
|
|
25
|
+
* With `type_info` it delegates to `TypeJsonView`, which renders the structured
|
|
26
|
+
* tree — reference names become `DeclarationLink`s and everything else is
|
|
27
|
+
* syntax-highlighted in place, so `Map<string, Tome> | null` links `Map` and
|
|
28
|
+
* `Tome` independently, with the flat `type` as hover text. Without it the whole
|
|
29
|
+
* `type` string links only when it names a declaration outright.
|
|
30
|
+
*/
|
|
22
31
|
declare const TypeLink: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
23
32
|
type TypeLink = ReturnType<typeof TypeLink>;
|
|
24
33
|
export default TypeLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TypeLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMvD,KAAK,gBAAgB,GACpB,AADwB,0JAA0J;AAClL,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,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;
|
|
1
|
+
{"version":3,"file":"TypeLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/TypeLink.svelte"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAMvD,KAAK,gBAAgB,GACpB,AADwB,0JAA0J;AAClL,cAAc,CAAC,WAAW,CAAC,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,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;AAqCJ;;;;;;;;GAQG;AACH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import type { Declaration } from './declaration.svelte.js';
|
|
2
2
|
import type { Library } from './library.svelte.js';
|
|
3
3
|
import type { Module } from './module.svelte.js';
|
|
4
|
-
export interface DeclarationSearchState {
|
|
5
|
-
query: string;
|
|
6
|
-
all: Array<Declaration>;
|
|
7
|
-
filtered: Array<Declaration>;
|
|
8
|
-
}
|
|
9
|
-
export interface ApiSearchState {
|
|
10
|
-
query: string;
|
|
11
|
-
modules: {
|
|
12
|
-
all: Array<Module>;
|
|
13
|
-
filtered: Array<Module>;
|
|
14
|
-
};
|
|
15
|
-
declarations: {
|
|
16
|
-
all: Array<Declaration>;
|
|
17
|
-
filtered: Array<Declaration>;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
4
|
/**
|
|
21
|
-
*
|
|
5
|
+
* Unified search state for the API index page (modules and declarations).
|
|
22
6
|
*/
|
|
23
|
-
export declare
|
|
7
|
+
export declare class ApiSearchState {
|
|
8
|
+
readonly library: Library;
|
|
9
|
+
query: string;
|
|
10
|
+
readonly modules: Array<Module>;
|
|
11
|
+
readonly modules_filtered: Array<Module>;
|
|
12
|
+
readonly declarations: Array<Declaration>;
|
|
13
|
+
readonly declarations_filtered: Array<Declaration>;
|
|
14
|
+
constructor(library: Library);
|
|
15
|
+
}
|
|
24
16
|
/**
|
|
25
|
-
*
|
|
17
|
+
* Search state for a module-specific declaration list.
|
|
26
18
|
*/
|
|
27
|
-
export declare
|
|
19
|
+
export declare class DeclarationSearchState {
|
|
20
|
+
readonly declarations: Array<Declaration>;
|
|
21
|
+
query: string;
|
|
22
|
+
readonly filtered: Array<Declaration>;
|
|
23
|
+
constructor(declarations: Array<Declaration>);
|
|
24
|
+
}
|
|
28
25
|
//# sourceMappingURL=api_search.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_search.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/api_search.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,
|
|
1
|
+
{"version":3,"file":"api_search.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/api_search.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;GAEG;AACH,qBAAa,cAAc;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,KAAK,EAAE,MAAM,CAAc;IAE3B,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAkD;IAEjF,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAQrC;IAEH,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAgD;IAEzF,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,WAAW,CAAC,CAM/C;gBAES,OAAO,EAAE,OAAO;CAG5B;AAED;;GAEG;AACH,qBAAa,sBAAsB;IAClC,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAE1C,KAAK,EAAE,MAAM,CAAc;IAE3B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAmBlC;gBAES,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC;CAG5C"}
|
|
@@ -1,65 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Unified search state for the API index page (modules and declarations).
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (!query.trim())
|
|
10
|
-
return
|
|
11
|
-
const terms = query.trim().toLowerCase().split(/\s+/);
|
|
12
|
-
return
|
|
4
|
+
export class ApiSearchState {
|
|
5
|
+
library;
|
|
6
|
+
query = $state('');
|
|
7
|
+
modules = $derived.by(() => this.library.modules_sorted);
|
|
8
|
+
modules_filtered = $derived.by(() => {
|
|
9
|
+
if (!this.query.trim())
|
|
10
|
+
return this.modules;
|
|
11
|
+
const terms = this.query.trim().toLowerCase().split(/\s+/);
|
|
12
|
+
return this.modules.filter((m) => {
|
|
13
13
|
const path_lower = m.path.toLowerCase();
|
|
14
14
|
const comment_lower = m.module_comment?.toLowerCase() ?? '';
|
|
15
15
|
return terms.every((term) => path_lower.includes(term) || comment_lower.includes(term));
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
declarations = $derived.by(() => this.library.declarations);
|
|
19
|
+
declarations_filtered = $derived.by(() => {
|
|
20
|
+
const items = this.query.trim()
|
|
21
|
+
? this.library.search_declarations(this.query)
|
|
22
|
+
: this.declarations;
|
|
22
23
|
// spread before sort — `items` may be the shared source array
|
|
23
24
|
return [...items].sort((a, b) => a.name.localeCompare(b.name));
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
set query(v) {
|
|
30
|
-
query = v;
|
|
31
|
-
},
|
|
32
|
-
modules: {
|
|
33
|
-
get all() {
|
|
34
|
-
return all_modules;
|
|
35
|
-
},
|
|
36
|
-
get filtered() {
|
|
37
|
-
return filtered_modules;
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
declarations: {
|
|
41
|
-
get all() {
|
|
42
|
-
return all_declarations;
|
|
43
|
-
},
|
|
44
|
-
get filtered() {
|
|
45
|
-
return filtered_declarations;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
};
|
|
26
|
+
constructor(library) {
|
|
27
|
+
this.library = library;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
50
30
|
/**
|
|
51
|
-
*
|
|
31
|
+
* Search state for a module-specific declaration list.
|
|
52
32
|
*/
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const trimmed_query = query.trim();
|
|
58
|
-
// spread before sort — `
|
|
33
|
+
export class DeclarationSearchState {
|
|
34
|
+
declarations;
|
|
35
|
+
query = $state('');
|
|
36
|
+
filtered = $derived.by(() => {
|
|
37
|
+
const trimmed_query = this.query.trim();
|
|
38
|
+
// spread before sort — `declarations` is the shared source array
|
|
59
39
|
if (!trimmed_query)
|
|
60
|
-
return [...
|
|
40
|
+
return [...this.declarations].sort((a, b) => a.name.localeCompare(b.name));
|
|
61
41
|
const terms = trimmed_query.toLowerCase().split(/\s+/);
|
|
62
|
-
const items =
|
|
42
|
+
const items = this.declarations.filter((d) => {
|
|
63
43
|
const name_lower = d.name.toLowerCase();
|
|
64
44
|
const kind_lower = d.kind.toLowerCase();
|
|
65
45
|
const module_path_lower = d.module_path.toLowerCase();
|
|
@@ -67,18 +47,7 @@ export const create_module_declaration_search = (declarations) => {
|
|
|
67
47
|
});
|
|
68
48
|
return items.sort((a, b) => a.name.localeCompare(b.name));
|
|
69
49
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
set query(v) {
|
|
75
|
-
query = v;
|
|
76
|
-
},
|
|
77
|
-
get all() {
|
|
78
|
-
return all;
|
|
79
|
-
},
|
|
80
|
-
get filtered() {
|
|
81
|
-
return filtered;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
};
|
|
50
|
+
constructor(declarations) {
|
|
51
|
+
this.declarations = declarations;
|
|
52
|
+
}
|
|
53
|
+
}
|
package/dist/csp.d.ts
CHANGED
|
@@ -83,7 +83,25 @@ export declare const create_csp_directives: (options?: CreateCspDirectivesOption
|
|
|
83
83
|
export type CspDirective = keyof CspDirectives;
|
|
84
84
|
export declare const parse_csp_directive: (directive: unknown) => CspDirective | null;
|
|
85
85
|
export type CspDirectiveValue<T extends CspDirective> = Defined<CspDirectives[T]>;
|
|
86
|
-
|
|
86
|
+
/**
|
|
87
|
+
* The exact body of the color-scheme loader `<script>` in `app.html`, the inline script
|
|
88
|
+
* `COLOR_SCHEME_SCRIPT_HASH` admits.
|
|
89
|
+
*
|
|
90
|
+
* The loader has to run before first paint to avoid a flash of the wrong scheme, so it is inline
|
|
91
|
+
* rather than a render-blocking `src`, and CSP admits it by hash. That makes its bytes
|
|
92
|
+
* load-bearing: whitespace, quoting, and trailing commas all move the hash, so a formatter that
|
|
93
|
+
* reflows `app.html` breaks the theme on every cold load with nothing but a console violation to
|
|
94
|
+
* show for it. Consumers can guard their own `app.html` against this constant.
|
|
95
|
+
*/
|
|
96
|
+
export declare const COLOR_SCHEME_SCRIPT = "\n\t\t\tdocument.documentElement.classList.add(\n\t\t\t\t((c) =>\n\t\t\t\t\tc === 'dark' || (c !== 'light' && matchMedia('(prefers-color-scheme:dark)').matches)\n\t\t\t\t\t\t? 'dark'\n\t\t\t\t\t\t: 'light')(localStorage.getItem('fuz:color-scheme'))\n\t\t\t);\n\t\t";
|
|
97
|
+
/**
|
|
98
|
+
* The `sha256-` CSP source for `COLOR_SCHEME_SCRIPT`, carried by the `script-src` and
|
|
99
|
+
* `script-src-elem` defaults so the loader runs under the library CSP.
|
|
100
|
+
*
|
|
101
|
+
* Regenerate after any edit to `COLOR_SCHEME_SCRIPT` — `src/test/csp.color_scheme.test.ts`
|
|
102
|
+
* reports the expected value when the two disagree.
|
|
103
|
+
*/
|
|
104
|
+
export declare const COLOR_SCHEME_SCRIPT_HASH = "sha256-CkhymyixntvSTuePGizI3BFtnRFlWWg95YBmBOCFxfY=";
|
|
87
105
|
/**
|
|
88
106
|
* The library CSP directive defaults — directives enabled out of the box.
|
|
89
107
|
* Prioritizes safety but loosens around media and styles, relying on defense-in-depth.
|
package/dist/csp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csp.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/csp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIzD;;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AAC;IACpE,OAAO,CAAC,EAAE,KAAK,CACZ,yCAAyC,GACzC,aAAa,GACb,cAAc,GACd,wBAAwB,GACxB,oBAAoB,GACpB,cAAc,GACd,gCAAgC,GAChC,oBAAoB,GACpB,mBAAmB,GACnB,eAAe,GACf,yCAAyC,GACzC,sBAAsB,GACtB,yCAAyC,CAC3C,CAAC;CACF"}
|
package/dist/csp.js
CHANGED
|
@@ -152,7 +152,32 @@ const for_each_directive = (source, source_label, fn) => {
|
|
|
152
152
|
fn(directive, value);
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
|
-
|
|
155
|
+
/**
|
|
156
|
+
* The exact body of the color-scheme loader `<script>` in `app.html`, the inline script
|
|
157
|
+
* `COLOR_SCHEME_SCRIPT_HASH` admits.
|
|
158
|
+
*
|
|
159
|
+
* The loader has to run before first paint to avoid a flash of the wrong scheme, so it is inline
|
|
160
|
+
* rather than a render-blocking `src`, and CSP admits it by hash. That makes its bytes
|
|
161
|
+
* load-bearing: whitespace, quoting, and trailing commas all move the hash, so a formatter that
|
|
162
|
+
* reflows `app.html` breaks the theme on every cold load with nothing but a console violation to
|
|
163
|
+
* show for it. Consumers can guard their own `app.html` against this constant.
|
|
164
|
+
*/
|
|
165
|
+
export const COLOR_SCHEME_SCRIPT = `
|
|
166
|
+
document.documentElement.classList.add(
|
|
167
|
+
((c) =>
|
|
168
|
+
c === 'dark' || (c !== 'light' && matchMedia('(prefers-color-scheme:dark)').matches)
|
|
169
|
+
? 'dark'
|
|
170
|
+
: 'light')(localStorage.getItem('fuz:color-scheme'))
|
|
171
|
+
);
|
|
172
|
+
`;
|
|
173
|
+
/**
|
|
174
|
+
* The `sha256-` CSP source for `COLOR_SCHEME_SCRIPT`, carried by the `script-src` and
|
|
175
|
+
* `script-src-elem` defaults so the loader runs under the library CSP.
|
|
176
|
+
*
|
|
177
|
+
* Regenerate after any edit to `COLOR_SCHEME_SCRIPT` — `src/test/csp.color_scheme.test.ts`
|
|
178
|
+
* reports the expected value when the two disagree.
|
|
179
|
+
*/
|
|
180
|
+
export const COLOR_SCHEME_SCRIPT_HASH = 'sha256-CkhymyixntvSTuePGizI3BFtnRFlWWg95YBmBOCFxfY=';
|
|
156
181
|
/**
|
|
157
182
|
* The library CSP directive defaults — directives enabled out of the box.
|
|
158
183
|
* Prioritizes safety but loosens around media and styles, relying on defense-in-depth.
|
|
@@ -10,7 +10,7 @@ import type { Module } from './module.svelte.js';
|
|
|
10
10
|
* Computed properties are plain getters rather than `$derived` — see
|
|
11
11
|
* `Library` for why.
|
|
12
12
|
*
|
|
13
|
-
* @see {@link https://github.com/
|
|
13
|
+
* @see {@link https://github.com/fuzdev/svelte-docinfo svelte-docinfo} for the analysis library
|
|
14
14
|
* @see `DeclarationDetail.svelte` for the rendering component
|
|
15
15
|
*/
|
|
16
16
|
export declare class Declaration {
|
|
@@ -50,6 +50,16 @@ export declare class Declaration {
|
|
|
50
50
|
* is the whole story. Present on `variable` and `type` kinds only.
|
|
51
51
|
*/
|
|
52
52
|
get type_info(): TypeJson | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* `type_info` prepared for rendering at the declaration itself. A type
|
|
55
|
+
* alias's tree carries the alias's own name at the root
|
|
56
|
+
* (`type A = 'a' | 'b'` → `{kind: 'union', alias: 'A', members: [...]}`),
|
|
57
|
+
* which `typeJsonToTokens` collapses to the bare name — right where `A` is
|
|
58
|
+
* composed into another type, circular at `A`'s own declaration. Strips
|
|
59
|
+
* that self-alias so the root expands into its members; every other tree
|
|
60
|
+
* passes through unchanged.
|
|
61
|
+
*/
|
|
62
|
+
get type_info_expanded(): TypeJson | undefined;
|
|
53
63
|
/**
|
|
54
64
|
* Default value documented via `@default`; the authoritative initializer
|
|
55
65
|
* (when human-readable) is in `type_signature`. Present on `variable` kind
|
|
@@ -87,6 +97,13 @@ export declare class Declaration {
|
|
|
87
97
|
* Present on `component`, `type`, `interface`, and `class` kinds.
|
|
88
98
|
*/
|
|
89
99
|
get external_types(): Array<string> | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Whether the exported name also carries a value meaning — a merged
|
|
102
|
+
* value+type symbol like `const Foo = z.strictObject({...})` beside
|
|
103
|
+
* `type Foo = z.infer<typeof Foo>`, where the type wins the declaration slot.
|
|
104
|
+
* Present on `type` and `interface` kinds.
|
|
105
|
+
*/
|
|
106
|
+
get merged_value(): boolean | undefined;
|
|
90
107
|
/**
|
|
91
108
|
* Whether a component accepts children via props or template usage.
|
|
92
109
|
* Present on `component` kind only.
|
|
@@ -111,6 +128,12 @@ export declare class Declaration {
|
|
|
111
128
|
* Mutation documentation from `@mutates` tags, mapping parameter names to descriptions.
|
|
112
129
|
*/
|
|
113
130
|
get mutates(): DeclarationJsonInput['mutates'];
|
|
131
|
+
/**
|
|
132
|
+
* Internal-API marker from the `@internal` tag. Presence means the tag was
|
|
133
|
+
* written; an empty string is a bare tag with no trailing prose. A marker,
|
|
134
|
+
* not an exclusion — the declaration stays documented.
|
|
135
|
+
*/
|
|
136
|
+
get internal_message(): string | undefined;
|
|
114
137
|
/**
|
|
115
138
|
* Svelte reactivity flavor (`$state`, `$state.raw`, `$derived`, `$derived.by`)
|
|
116
139
|
* when this variable is initialized with a value-producing rune.
|
|
@@ -119,6 +142,7 @@ export declare class Declaration {
|
|
|
119
142
|
get reactivity(): Reactivity | undefined;
|
|
120
143
|
get has_examples(): boolean;
|
|
121
144
|
get is_deprecated(): boolean;
|
|
145
|
+
get is_internal(): boolean;
|
|
122
146
|
get has_documentation(): boolean;
|
|
123
147
|
get has_parameters(): boolean;
|
|
124
148
|
get has_props(): boolean;
|