@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
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"declaration.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/declaration.svelte.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OAEG;IACH,IAAI,OAAO,IAAI,oBAAoB,CAAC,SAAS,CAAC,CAE7C;IAED;;;;OAIG;IACH,IAAI,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAEzC;IAED;;;;OAIG;IACH,IAAI,UAAU,IAAI,UAAU,GAAG,SAAS,CAEvC;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAGD,IAAI,aAAa,IAAI,OAAO,CAE3B;IAGD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,iBAAiB,IAAI,OAAO,CAE/B;IAED,IAAI,cAAc,IAAI,OAAO,CAG5B;IAED,IAAI,SAAS,IAAI,OAAO,CAGvB;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;gBAEW,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,oBAAoB;CAIlE"}
|
|
@@ -20,7 +20,7 @@ const field = (decl, key) => decl[key];
|
|
|
20
20
|
* Computed properties are plain getters rather than `$derived` — see
|
|
21
21
|
* `Library` for why.
|
|
22
22
|
*
|
|
23
|
-
* @see {@link https://github.com/
|
|
23
|
+
* @see {@link https://github.com/fuzdev/svelte-docinfo svelte-docinfo} for the analysis library
|
|
24
24
|
* @see `DeclarationDetail.svelte` for the rendering component
|
|
25
25
|
*/
|
|
26
26
|
export class Declaration {
|
|
@@ -60,8 +60,9 @@ export class Declaration {
|
|
|
60
60
|
* Generated TypeScript import statement.
|
|
61
61
|
*/
|
|
62
62
|
get import_statement() {
|
|
63
|
-
// `generateImport` reads only `name`/`kind`/path, none of
|
|
64
|
-
// arrays,
|
|
63
|
+
// `generateImport` reads only `name`/`kind`/`mergedValue`/path, none of
|
|
64
|
+
// the defaulted arrays, and treats an absent `mergedValue` as the stripped
|
|
65
|
+
// `false`, so asserting the parsed shape here is sound.
|
|
65
66
|
return (this.#import_statement ??= generateImport(this.declaration_json, this.module_path, this.library.pkg_json.name));
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
@@ -94,6 +95,24 @@ export class Declaration {
|
|
|
94
95
|
get type_info() {
|
|
95
96
|
return field(this.declaration_json, 'typeInfo');
|
|
96
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* `type_info` prepared for rendering at the declaration itself. A type
|
|
100
|
+
* alias's tree carries the alias's own name at the root
|
|
101
|
+
* (`type A = 'a' | 'b'` → `{kind: 'union', alias: 'A', members: [...]}`),
|
|
102
|
+
* which `typeJsonToTokens` collapses to the bare name — right where `A` is
|
|
103
|
+
* composed into another type, circular at `A`'s own declaration. Strips
|
|
104
|
+
* that self-alias so the root expands into its members; every other tree
|
|
105
|
+
* passes through unchanged.
|
|
106
|
+
*/
|
|
107
|
+
get type_info_expanded() {
|
|
108
|
+
const type_info = this.type_info;
|
|
109
|
+
if (type_info &&
|
|
110
|
+
(type_info.kind === 'union' || type_info.kind === 'intersection') &&
|
|
111
|
+
type_info.alias === this.name) {
|
|
112
|
+
return { ...type_info, alias: undefined };
|
|
113
|
+
}
|
|
114
|
+
return type_info;
|
|
115
|
+
}
|
|
97
116
|
/**
|
|
98
117
|
* Default value documented via `@default`; the authoritative initializer
|
|
99
118
|
* (when human-readable) is in `type_signature`. Present on `variable` kind
|
|
@@ -165,6 +184,15 @@ export class Declaration {
|
|
|
165
184
|
get external_types() {
|
|
166
185
|
return field(this.declaration_json, 'externalTypes');
|
|
167
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Whether the exported name also carries a value meaning — a merged
|
|
189
|
+
* value+type symbol like `const Foo = z.strictObject({...})` beside
|
|
190
|
+
* `type Foo = z.infer<typeof Foo>`, where the type wins the declaration slot.
|
|
191
|
+
* Present on `type` and `interface` kinds.
|
|
192
|
+
*/
|
|
193
|
+
get merged_value() {
|
|
194
|
+
return field(this.declaration_json, 'mergedValue');
|
|
195
|
+
}
|
|
168
196
|
/**
|
|
169
197
|
* Whether a component accepts children via props or template usage.
|
|
170
198
|
* Present on `component` kind only.
|
|
@@ -199,6 +227,14 @@ export class Declaration {
|
|
|
199
227
|
get mutates() {
|
|
200
228
|
return this.declaration_json.mutates;
|
|
201
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Internal-API marker from the `@internal` tag. Presence means the tag was
|
|
232
|
+
* written; an empty string is a bare tag with no trailing prose. A marker,
|
|
233
|
+
* not an exclusion — the declaration stays documented.
|
|
234
|
+
*/
|
|
235
|
+
get internal_message() {
|
|
236
|
+
return this.declaration_json.internalMessage;
|
|
237
|
+
}
|
|
202
238
|
/**
|
|
203
239
|
* Svelte reactivity flavor (`$state`, `$state.raw`, `$derived`, `$derived.by`)
|
|
204
240
|
* when this variable is initialized with a value-producing rune.
|
|
@@ -214,6 +250,10 @@ export class Declaration {
|
|
|
214
250
|
get is_deprecated() {
|
|
215
251
|
return this.deprecated_message !== undefined;
|
|
216
252
|
}
|
|
253
|
+
// presence, not truthiness — a bare `@internal` (no message text) arrives as `''`
|
|
254
|
+
get is_internal() {
|
|
255
|
+
return this.internal_message !== undefined;
|
|
256
|
+
}
|
|
217
257
|
get has_documentation() {
|
|
218
258
|
return !!this.doc_comment;
|
|
219
259
|
}
|
package/dist/logos.d.ts
CHANGED
package/dist/logos.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logos.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/logos.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,QAAQ;;;;;;CAgCF,CAAC;AAEpB,eAAO,MAAM,QAAQ;;;;;;CAQF,CAAC;AAEpB,eAAO,MAAM,YAAY;;;;;;CAIN,CAAC;AAEpB,eAAO,MAAM,YAAY;;;;;;;CAKN,CAAC;AAEpB,eAAO,MAAM,WAAW;;;;;;CAIL,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;CAIX,CAAC;AAEpB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"logos.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/logos.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,QAAQ;;;;;;CAgCF,CAAC;AAEpB,eAAO,MAAM,QAAQ;;;;;;CAQF,CAAC;AAEpB,eAAO,MAAM,YAAY;;;;;;CAIN,CAAC;AAEpB,eAAO,MAAM,YAAY;;;;;;;CAKN,CAAC;AAEpB,eAAO,MAAM,WAAW;;;;;;CAIL,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;CAIX,CAAC;AAEpB,eAAO,MAAM,cAAc;;;;;;CAIR,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,mBAAmB;;;;;;CAQb,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;CAQX,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAwBP,CAAC;AAEpB,eAAO,MAAM,QAAQ;;;;;;CAQF,CAAC;AAEpB,eAAO,MAAM,WAAW;;;;;;;;;CAWL,CAAC;AAEpB,eAAO,MAAM,QAAQ;;;;;;CAQF,CAAC"}
|
package/dist/logos.js
CHANGED
package/dist/projects.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { SvgData } from './svg.js';
|
|
2
2
|
/**
|
|
3
3
|
* Metadata for a project in the fuz.dev ecosystem, rendered by `ProjectLinks`.
|
|
4
|
-
*
|
|
5
|
-
* `name` doubles as the project's repo directory name, so the
|
|
6
|
-
* `project_stats_update` task can locate each repo as a sibling directory.
|
|
7
4
|
*/
|
|
8
5
|
export interface ProjectItem {
|
|
9
6
|
name: string;
|
package/dist/projects.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAkBxC
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAkBxC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,WAAW,CAa5C,CAAC"}
|
package/dist/projects.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
// TODO when fuz.dev is ready
|
|
3
3
|
// logo_fuz,
|
|
4
|
-
logo_fuz_ui, logo_fuz_code, logo_fuz_blog, logo_fuz_mastodon,
|
|
5
|
-
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding
|
|
4
|
+
logo_fuz_ui, logo_fuz_code, logo_fuz_blog, logo_fuz_mastodon, logo_fuz_repos, logo_fuz_template, logo_fuz_css, logo_fuz_util, logo_gro, logo_svelte_docinfo, logo_fuz_app, logo_tsv } from './logos.js';
|
|
5
|
+
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding fuz_repos to this repo is heavy
|
|
6
6
|
// prettier-ignore
|
|
7
7
|
export const project_items = [
|
|
8
8
|
{ name: 'fuz_app', url: 'https://app.fuz.dev/', logo: logo_fuz_app, description: '[pre-alpha] fullstack app library', glyph: '🗝', color_class: 'color_j_50' },
|
|
@@ -12,7 +12,7 @@ export const project_items = [
|
|
|
12
12
|
{ name: 'fuz_blog', url: 'https://blog.fuz.dev/', logo: logo_fuz_blog, description: 'blog software from scratch with SvelteKit', glyph: '🖊️', color_class: 'color_e_50' },
|
|
13
13
|
{ name: 'fuz_code', url: 'https://code.fuz.dev/', logo: logo_fuz_code, description: 'syntax styling utilities and components for TypeScript, Svelte, Markdown, and more', glyph: '🎨', color_class: 'color_g_50' },
|
|
14
14
|
{ name: 'fuz_mastodon', url: 'https://mastodon.fuz.dev/', logo: logo_fuz_mastodon, description: 'Mastodon components and helpers for Svelte, SvelteKit, and Fuz', glyph: '🦣', color_class: 'color_d_50' },
|
|
15
|
-
{ name: '
|
|
15
|
+
{ name: 'fuz_repos', url: 'https://repos.fuz.dev/', logo: logo_fuz_repos, description: 'a tool for managing many repos', glyph: '🪄', color_class: 'color_a_50' },
|
|
16
16
|
{ name: 'svelte-docinfo', url: 'https://svelte-docinfo.fuz.dev/', logo: logo_svelte_docinfo, description: 'static analysis for TypeScript and Svelte', glyph: '📜', color_class: 'color_i_50' },
|
|
17
17
|
{ name: 'fuz_util', url: 'https://util.fuz.dev/', logo: logo_fuz_util, description: 'utility belt for JS', glyph: '🦕', color_class: 'color_f_50' },
|
|
18
18
|
{ name: 'gro', url: 'https://github.com/fuzdev/gro', logo: logo_gro, description: 'task runner and toolkit extending SvelteKit', glyph: '🌰', color_class: 'color_f_50' },
|
package/dist/sparkline.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure geometry helpers behind `Sparkline
|
|
2
|
+
* Pure geometry helpers behind `Sparkline`.
|
|
3
3
|
*
|
|
4
4
|
* Computes polyline points, alpha-fade gradient stops, and the end-dot
|
|
5
5
|
* position for a series of values, so components stay thin and the math is
|
package/dist/sparkline.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure geometry helpers behind `Sparkline
|
|
2
|
+
* Pure geometry helpers behind `Sparkline`.
|
|
3
3
|
*
|
|
4
4
|
* Computes polyline points, alpha-fade gradient stops, and the end-dot
|
|
5
5
|
* position for a series of values, so components stay thin and the math is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.209.0",
|
|
4
4
|
"description": "Svelte UI library",
|
|
5
5
|
"tagline": "friendly user zystem",
|
|
6
6
|
"glyph": "🧶",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@changesets/changelog-git": "^0.2.1",
|
|
65
|
-
"@fuzdev/
|
|
65
|
+
"@fuzdev/blake3-wasm": "^0.2.0",
|
|
66
66
|
"@fuzdev/fuz_code": "^0.48.0",
|
|
67
|
-
"@fuzdev/fuz_css": "^0.
|
|
68
|
-
"@fuzdev/fuz_util": "^0.
|
|
69
|
-
"@fuzdev/gro": "^0.
|
|
67
|
+
"@fuzdev/fuz_css": "^0.64.0",
|
|
68
|
+
"@fuzdev/fuz_util": "^0.69.0",
|
|
69
|
+
"@fuzdev/gro": "^0.212.0",
|
|
70
70
|
"@fuzdev/mdz": "^0.3.0",
|
|
71
71
|
"@ryanatkn/eslint-config": "^0.12.2",
|
|
72
72
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
"jsdom": "^29.1.1",
|
|
82
82
|
"svelte": "^5.56.4",
|
|
83
83
|
"svelte-check": "^4.7.2",
|
|
84
|
-
"svelte-docinfo": "^0.
|
|
84
|
+
"svelte-docinfo": "^0.7.0",
|
|
85
85
|
"tslib": "^2.8.1",
|
|
86
86
|
"typescript": "^5.9.3",
|
|
87
87
|
"typescript-eslint": "^8.60.0",
|
|
88
88
|
"vite": "^7.3.6",
|
|
89
|
-
"vitest": "^
|
|
89
|
+
"vitest": "^5.0.0",
|
|
90
90
|
"zod": "^4.3.6"
|
|
91
91
|
},
|
|
92
92
|
"sideEffects": [
|
|
@@ -2,94 +2,57 @@ import type { Declaration } from './declaration.svelte.ts';
|
|
|
2
2
|
import type { Library } from './library.svelte.ts';
|
|
3
3
|
import type { Module } from './module.svelte.ts';
|
|
4
4
|
|
|
5
|
-
export interface DeclarationSearchState {
|
|
6
|
-
query: string;
|
|
7
|
-
all: Array<Declaration>;
|
|
8
|
-
filtered: Array<Declaration>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface ApiSearchState {
|
|
12
|
-
query: string;
|
|
13
|
-
modules: {
|
|
14
|
-
all: Array<Module>;
|
|
15
|
-
filtered: Array<Module>;
|
|
16
|
-
};
|
|
17
|
-
declarations: {
|
|
18
|
-
all: Array<Declaration>;
|
|
19
|
-
filtered: Array<Declaration>;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
5
|
/**
|
|
24
|
-
*
|
|
6
|
+
* Unified search state for the API index page (modules and declarations).
|
|
25
7
|
*/
|
|
26
|
-
export
|
|
27
|
-
|
|
8
|
+
export class ApiSearchState {
|
|
9
|
+
readonly library: Library;
|
|
10
|
+
|
|
11
|
+
query: string = $state('');
|
|
28
12
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (!query.trim()) return
|
|
33
|
-
const terms = query.trim().toLowerCase().split(/\s+/);
|
|
34
|
-
return
|
|
13
|
+
readonly modules: Array<Module> = $derived.by(() => this.library.modules_sorted);
|
|
14
|
+
|
|
15
|
+
readonly modules_filtered: Array<Module> = $derived.by(() => {
|
|
16
|
+
if (!this.query.trim()) return this.modules;
|
|
17
|
+
const terms = this.query.trim().toLowerCase().split(/\s+/);
|
|
18
|
+
return this.modules.filter((m) => {
|
|
35
19
|
const path_lower = m.path.toLowerCase();
|
|
36
20
|
const comment_lower = m.module_comment?.toLowerCase() ?? '';
|
|
37
21
|
return terms.every((term) => path_lower.includes(term) || comment_lower.includes(term));
|
|
38
22
|
});
|
|
39
23
|
});
|
|
40
24
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const items = query.trim()
|
|
25
|
+
readonly declarations: Array<Declaration> = $derived.by(() => this.library.declarations);
|
|
26
|
+
|
|
27
|
+
readonly declarations_filtered: Array<Declaration> = $derived.by(() => {
|
|
28
|
+
const items = this.query.trim()
|
|
29
|
+
? this.library.search_declarations(this.query)
|
|
30
|
+
: this.declarations;
|
|
45
31
|
// spread before sort — `items` may be the shared source array
|
|
46
32
|
return [...items].sort((a, b) => a.name.localeCompare(b.name));
|
|
47
33
|
});
|
|
48
34
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
set query(v: string) {
|
|
54
|
-
query = v;
|
|
55
|
-
},
|
|
56
|
-
modules: {
|
|
57
|
-
get all() {
|
|
58
|
-
return all_modules;
|
|
59
|
-
},
|
|
60
|
-
get filtered() {
|
|
61
|
-
return filtered_modules;
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
declarations: {
|
|
65
|
-
get all() {
|
|
66
|
-
return all_declarations;
|
|
67
|
-
},
|
|
68
|
-
get filtered() {
|
|
69
|
-
return filtered_declarations;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
};
|
|
35
|
+
constructor(library: Library) {
|
|
36
|
+
this.library = library;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
74
39
|
|
|
75
40
|
/**
|
|
76
|
-
*
|
|
41
|
+
* Search state for a module-specific declaration list.
|
|
77
42
|
*/
|
|
78
|
-
export
|
|
79
|
-
declarations: Array<Declaration
|
|
80
|
-
): DeclarationSearchState => {
|
|
81
|
-
let query = $state.raw('');
|
|
43
|
+
export class DeclarationSearchState {
|
|
44
|
+
readonly declarations: Array<Declaration>;
|
|
82
45
|
|
|
83
|
-
|
|
46
|
+
query: string = $state('');
|
|
84
47
|
|
|
85
|
-
|
|
86
|
-
const trimmed_query = query.trim();
|
|
87
|
-
// spread before sort — `
|
|
88
|
-
if (!trimmed_query) return [...
|
|
48
|
+
readonly filtered: Array<Declaration> = $derived.by(() => {
|
|
49
|
+
const trimmed_query = this.query.trim();
|
|
50
|
+
// spread before sort — `declarations` is the shared source array
|
|
51
|
+
if (!trimmed_query) return [...this.declarations].sort((a, b) => a.name.localeCompare(b.name));
|
|
89
52
|
|
|
90
53
|
const terms = trimmed_query.toLowerCase().split(/\s+/);
|
|
91
54
|
|
|
92
|
-
const items =
|
|
55
|
+
const items = this.declarations.filter((d) => {
|
|
93
56
|
const name_lower = d.name.toLowerCase();
|
|
94
57
|
const kind_lower = d.kind.toLowerCase();
|
|
95
58
|
const module_path_lower = d.module_path.toLowerCase();
|
|
@@ -103,18 +66,7 @@ export const create_module_declaration_search = (
|
|
|
103
66
|
return items.sort((a, b) => a.name.localeCompare(b.name));
|
|
104
67
|
});
|
|
105
68
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
set query(v: string) {
|
|
111
|
-
query = v;
|
|
112
|
-
},
|
|
113
|
-
get all() {
|
|
114
|
-
return all;
|
|
115
|
-
},
|
|
116
|
-
get filtered() {
|
|
117
|
-
return filtered;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
};
|
|
69
|
+
constructor(declarations: Array<Declaration>) {
|
|
70
|
+
this.declarations = declarations;
|
|
71
|
+
}
|
|
72
|
+
}
|
package/src/lib/csp.ts
CHANGED
|
@@ -254,7 +254,33 @@ const for_each_directive = <V>(
|
|
|
254
254
|
}
|
|
255
255
|
};
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
/**
|
|
258
|
+
* The exact body of the color-scheme loader `<script>` in `app.html`, the inline script
|
|
259
|
+
* `COLOR_SCHEME_SCRIPT_HASH` admits.
|
|
260
|
+
*
|
|
261
|
+
* The loader has to run before first paint to avoid a flash of the wrong scheme, so it is inline
|
|
262
|
+
* rather than a render-blocking `src`, and CSP admits it by hash. That makes its bytes
|
|
263
|
+
* load-bearing: whitespace, quoting, and trailing commas all move the hash, so a formatter that
|
|
264
|
+
* reflows `app.html` breaks the theme on every cold load with nothing but a console violation to
|
|
265
|
+
* show for it. Consumers can guard their own `app.html` against this constant.
|
|
266
|
+
*/
|
|
267
|
+
export const COLOR_SCHEME_SCRIPT = `
|
|
268
|
+
document.documentElement.classList.add(
|
|
269
|
+
((c) =>
|
|
270
|
+
c === 'dark' || (c !== 'light' && matchMedia('(prefers-color-scheme:dark)').matches)
|
|
271
|
+
? 'dark'
|
|
272
|
+
: 'light')(localStorage.getItem('fuz:color-scheme'))
|
|
273
|
+
);
|
|
274
|
+
`;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The `sha256-` CSP source for `COLOR_SCHEME_SCRIPT`, carried by the `script-src` and
|
|
278
|
+
* `script-src-elem` defaults so the loader runs under the library CSP.
|
|
279
|
+
*
|
|
280
|
+
* Regenerate after any edit to `COLOR_SCHEME_SCRIPT` — `src/test/csp.color_scheme.test.ts`
|
|
281
|
+
* reports the expected value when the two disagree.
|
|
282
|
+
*/
|
|
283
|
+
export const COLOR_SCHEME_SCRIPT_HASH = 'sha256-CkhymyixntvSTuePGizI3BFtnRFlWWg95YBmBOCFxfY=';
|
|
258
284
|
|
|
259
285
|
/**
|
|
260
286
|
* The library CSP directive defaults — directives enabled out of the box.
|
|
@@ -35,7 +35,7 @@ const field = <T>(decl: DeclarationJsonInput, key: string): T | undefined =>
|
|
|
35
35
|
* Computed properties are plain getters rather than `$derived` — see
|
|
36
36
|
* `Library` for why.
|
|
37
37
|
*
|
|
38
|
-
* @see {@link https://github.com/
|
|
38
|
+
* @see {@link https://github.com/fuzdev/svelte-docinfo svelte-docinfo} for the analysis library
|
|
39
39
|
* @see `DeclarationDetail.svelte` for the rendering component
|
|
40
40
|
*/
|
|
41
41
|
export class Declaration {
|
|
@@ -87,8 +87,9 @@ export class Declaration {
|
|
|
87
87
|
* Generated TypeScript import statement.
|
|
88
88
|
*/
|
|
89
89
|
get import_statement(): string {
|
|
90
|
-
// `generateImport` reads only `name`/`kind`/path, none of
|
|
91
|
-
// arrays,
|
|
90
|
+
// `generateImport` reads only `name`/`kind`/`mergedValue`/path, none of
|
|
91
|
+
// the defaulted arrays, and treats an absent `mergedValue` as the stripped
|
|
92
|
+
// `false`, so asserting the parsed shape here is sound.
|
|
92
93
|
return (this.#import_statement ??= generateImport(
|
|
93
94
|
this.declaration_json as DeclarationJson,
|
|
94
95
|
this.module_path,
|
|
@@ -131,6 +132,27 @@ export class Declaration {
|
|
|
131
132
|
return field<TypeJson>(this.declaration_json, 'typeInfo');
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
/**
|
|
136
|
+
* `type_info` prepared for rendering at the declaration itself. A type
|
|
137
|
+
* alias's tree carries the alias's own name at the root
|
|
138
|
+
* (`type A = 'a' | 'b'` → `{kind: 'union', alias: 'A', members: [...]}`),
|
|
139
|
+
* which `typeJsonToTokens` collapses to the bare name — right where `A` is
|
|
140
|
+
* composed into another type, circular at `A`'s own declaration. Strips
|
|
141
|
+
* that self-alias so the root expands into its members; every other tree
|
|
142
|
+
* passes through unchanged.
|
|
143
|
+
*/
|
|
144
|
+
get type_info_expanded(): TypeJson | undefined {
|
|
145
|
+
const type_info = this.type_info;
|
|
146
|
+
if (
|
|
147
|
+
type_info &&
|
|
148
|
+
(type_info.kind === 'union' || type_info.kind === 'intersection') &&
|
|
149
|
+
type_info.alias === this.name
|
|
150
|
+
) {
|
|
151
|
+
return { ...type_info, alias: undefined };
|
|
152
|
+
}
|
|
153
|
+
return type_info;
|
|
154
|
+
}
|
|
155
|
+
|
|
134
156
|
/**
|
|
135
157
|
* Default value documented via `@default`; the authoritative initializer
|
|
136
158
|
* (when human-readable) is in `type_signature`. Present on `variable` kind
|
|
@@ -219,6 +241,16 @@ export class Declaration {
|
|
|
219
241
|
return field<Array<string>>(this.declaration_json, 'externalTypes');
|
|
220
242
|
}
|
|
221
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Whether the exported name also carries a value meaning — a merged
|
|
246
|
+
* value+type symbol like `const Foo = z.strictObject({...})` beside
|
|
247
|
+
* `type Foo = z.infer<typeof Foo>`, where the type wins the declaration slot.
|
|
248
|
+
* Present on `type` and `interface` kinds.
|
|
249
|
+
*/
|
|
250
|
+
get merged_value(): boolean | undefined {
|
|
251
|
+
return field<boolean>(this.declaration_json, 'mergedValue');
|
|
252
|
+
}
|
|
253
|
+
|
|
222
254
|
/**
|
|
223
255
|
* Whether a component accepts children via props or template usage.
|
|
224
256
|
* Present on `component` kind only.
|
|
@@ -258,6 +290,15 @@ export class Declaration {
|
|
|
258
290
|
return this.declaration_json.mutates;
|
|
259
291
|
}
|
|
260
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Internal-API marker from the `@internal` tag. Presence means the tag was
|
|
295
|
+
* written; an empty string is a bare tag with no trailing prose. A marker,
|
|
296
|
+
* not an exclusion — the declaration stays documented.
|
|
297
|
+
*/
|
|
298
|
+
get internal_message(): string | undefined {
|
|
299
|
+
return this.declaration_json.internalMessage;
|
|
300
|
+
}
|
|
301
|
+
|
|
261
302
|
/**
|
|
262
303
|
* Svelte reactivity flavor (`$state`, `$state.raw`, `$derived`, `$derived.by`)
|
|
263
304
|
* when this variable is initialized with a value-producing rune.
|
|
@@ -276,6 +317,11 @@ export class Declaration {
|
|
|
276
317
|
return this.deprecated_message !== undefined;
|
|
277
318
|
}
|
|
278
319
|
|
|
320
|
+
// presence, not truthiness — a bare `@internal` (no message text) arrives as `''`
|
|
321
|
+
get is_internal(): boolean {
|
|
322
|
+
return this.internal_message !== undefined;
|
|
323
|
+
}
|
|
324
|
+
|
|
279
325
|
get has_documentation(): boolean {
|
|
280
326
|
return !!this.doc_comment;
|
|
281
327
|
}
|
package/src/lib/logos.ts
CHANGED
|
@@ -100,7 +100,7 @@ export const logo_fuz_mastodon = {
|
|
|
100
100
|
paths: logo_fuz.paths
|
|
101
101
|
} satisfies SvgData;
|
|
102
102
|
|
|
103
|
-
export const
|
|
103
|
+
export const logo_fuz_repos = {
|
|
104
104
|
label: 'a friendly blue spider facing you',
|
|
105
105
|
fill: '#6199d1',
|
|
106
106
|
paths: logo_fuz.paths
|
package/src/lib/projects.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
logo_fuz_code,
|
|
7
7
|
logo_fuz_blog,
|
|
8
8
|
logo_fuz_mastodon,
|
|
9
|
-
|
|
9
|
+
logo_fuz_repos,
|
|
10
10
|
logo_fuz_template,
|
|
11
11
|
logo_fuz_css,
|
|
12
12
|
logo_fuz_util,
|
|
@@ -18,9 +18,6 @@ import {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Metadata for a project in the fuz.dev ecosystem, rendered by `ProjectLinks`.
|
|
21
|
-
*
|
|
22
|
-
* `name` doubles as the project's repo directory name, so the
|
|
23
|
-
* `project_stats_update` task can locate each repo as a sibling directory.
|
|
24
21
|
*/
|
|
25
22
|
export interface ProjectItem {
|
|
26
23
|
name: string;
|
|
@@ -31,7 +28,7 @@ export interface ProjectItem {
|
|
|
31
28
|
color_class: string;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding
|
|
31
|
+
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding fuz_repos to this repo is heavy
|
|
35
32
|
// prettier-ignore
|
|
36
33
|
export const project_items: Array<ProjectItem> = [
|
|
37
34
|
{name: 'fuz_app', url: 'https://app.fuz.dev/', logo: logo_fuz_app, description: '[pre-alpha] fullstack app library', glyph: '🗝', color_class: 'color_j_50'},
|
|
@@ -41,7 +38,7 @@ export const project_items: Array<ProjectItem> = [
|
|
|
41
38
|
{name: 'fuz_blog', url: 'https://blog.fuz.dev/', logo: logo_fuz_blog, description: 'blog software from scratch with SvelteKit', glyph: '🖊️', color_class: 'color_e_50'},
|
|
42
39
|
{name: 'fuz_code', url: 'https://code.fuz.dev/', logo: logo_fuz_code, description: 'syntax styling utilities and components for TypeScript, Svelte, Markdown, and more', glyph: '🎨', color_class: 'color_g_50'},
|
|
43
40
|
{name: 'fuz_mastodon', url: 'https://mastodon.fuz.dev/', logo: logo_fuz_mastodon, description: 'Mastodon components and helpers for Svelte, SvelteKit, and Fuz', glyph: '🦣', color_class: 'color_d_50'},
|
|
44
|
-
{name: '
|
|
41
|
+
{name: 'fuz_repos', url: 'https://repos.fuz.dev/', logo: logo_fuz_repos, description: 'a tool for managing many repos', glyph: '🪄', color_class: 'color_a_50'},
|
|
45
42
|
{name: 'svelte-docinfo', url: 'https://svelte-docinfo.fuz.dev/', logo: logo_svelte_docinfo, description: 'static analysis for TypeScript and Svelte', glyph: '📜', color_class: 'color_i_50'},
|
|
46
43
|
{name: 'fuz_util', url: 'https://util.fuz.dev/', logo: logo_fuz_util, description: 'utility belt for JS', glyph: '🦕', color_class: 'color_f_50'},
|
|
47
44
|
{name: 'gro', url: 'https://github.com/fuzdev/gro', logo: logo_gro, description: 'task runner and toolkit extending SvelteKit', glyph: '🌰', color_class: 'color_f_50'},
|
package/src/lib/sparkline.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure geometry helpers behind `Sparkline
|
|
2
|
+
* Pure geometry helpers behind `Sparkline`.
|
|
3
3
|
*
|
|
4
4
|
* Computes polyline points, alpha-fade gradient stops, and the end-dot
|
|
5
5
|
* position for a series of values, so components stay thin and the math is
|