@fuzdev/fuz_ui 0.206.7 → 0.206.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +3 -3
  2. package/dist/Alert.svelte +21 -25
  3. package/dist/Alert.svelte.d.ts.map +1 -1
  4. package/dist/ApiDeclarationList.svelte +2 -2
  5. package/dist/ApiDeclarationList.svelte.d.ts.map +1 -1
  6. package/dist/ApiIndex.svelte +4 -4
  7. package/dist/ApiIndex.svelte.d.ts.map +1 -1
  8. package/dist/ApiModule.svelte +13 -10
  9. package/dist/ApiModule.svelte.d.ts.map +1 -1
  10. package/dist/ApiModulesList.svelte +2 -2
  11. package/dist/ApiModulesList.svelte.d.ts.map +1 -1
  12. package/dist/Breadcrumb.svelte +31 -19
  13. package/dist/Breadcrumb.svelte.d.ts.map +1 -1
  14. package/dist/Card.svelte +17 -17
  15. package/dist/Card.svelte.d.ts.map +1 -1
  16. package/dist/ColorSchemeInput.svelte +6 -6
  17. package/dist/ColorSchemeInput.svelte.d.ts.map +1 -1
  18. package/dist/Contextmenu.svelte +6 -4
  19. package/dist/Contextmenu.svelte.d.ts.map +1 -1
  20. package/dist/ContextmenuEntry.svelte +8 -8
  21. package/dist/ContextmenuEntry.svelte.d.ts.map +1 -1
  22. package/dist/ContextmenuIcon.svelte +3 -3
  23. package/dist/ContextmenuIcon.svelte.d.ts.map +1 -1
  24. package/dist/ContextmenuLinkEntry.svelte +14 -14
  25. package/dist/ContextmenuLinkEntry.svelte.d.ts.map +1 -1
  26. package/dist/ContextmenuMenu.svelte +10 -10
  27. package/dist/ContextmenuMenu.svelte.d.ts.map +1 -1
  28. package/dist/ContextmenuRoot.svelte +7 -7
  29. package/dist/ContextmenuRootForSafariCompatibility.svelte +15 -15
  30. package/dist/ContextmenuSeparator.svelte +2 -2
  31. package/dist/ContextmenuSubmenu.svelte +15 -12
  32. package/dist/ContextmenuSubmenu.svelte.d.ts.map +1 -1
  33. package/dist/ContextmenuTextEntry.svelte +4 -4
  34. package/dist/ContextmenuTextEntry.svelte.d.ts.map +1 -1
  35. package/dist/CopyToClipboard.svelte +7 -7
  36. package/dist/CopyToClipboard.svelte.d.ts.map +1 -1
  37. package/dist/DeclarationDetail.svelte +35 -28
  38. package/dist/DeclarationDetail.svelte.d.ts.map +1 -1
  39. package/dist/DeclarationLink.svelte +7 -7
  40. package/dist/DeclarationLink.svelte.d.ts.map +1 -1
  41. package/dist/Details.svelte +3 -3
  42. package/dist/Details.svelte.d.ts.map +1 -1
  43. package/dist/Dialog.svelte +7 -7
  44. package/dist/Dialog.svelte.d.ts.map +1 -1
  45. package/dist/DialogContent.svelte +6 -6
  46. package/dist/DialogContent.svelte.d.ts.map +1 -1
  47. package/dist/Docs.svelte +14 -12
  48. package/dist/Docs.svelte.d.ts.map +1 -1
  49. package/dist/DocsContent.svelte +4 -4
  50. package/dist/DocsContent.svelte.d.ts.map +1 -1
  51. package/dist/DocsFooter.svelte +7 -8
  52. package/dist/DocsFooter.svelte.d.ts.map +1 -1
  53. package/dist/DocsLink.svelte +24 -21
  54. package/dist/DocsLink.svelte.d.ts.map +1 -1
  55. package/dist/DocsList.svelte +3 -3
  56. package/dist/DocsList.svelte.d.ts.map +1 -1
  57. package/dist/DocsMenu.svelte +13 -10
  58. package/dist/DocsMenu.svelte.d.ts.map +1 -1
  59. package/dist/DocsMenuHeader.svelte +2 -2
  60. package/dist/DocsMenuHeader.svelte.d.ts.map +1 -1
  61. package/dist/DocsPageLinks.svelte +9 -7
  62. package/dist/DocsPageLinks.svelte.d.ts.map +1 -1
  63. package/dist/DocsPrimaryNav.svelte +5 -5
  64. package/dist/DocsPrimaryNav.svelte.d.ts.map +1 -1
  65. package/dist/DocsSearch.svelte +3 -3
  66. package/dist/DocsSearch.svelte.d.ts.map +1 -1
  67. package/dist/DocsSecondaryNav.svelte +3 -3
  68. package/dist/DocsSecondaryNav.svelte.d.ts.map +1 -1
  69. package/dist/DocsTertiaryNav.svelte +8 -8
  70. package/dist/DocsTertiaryNav.svelte.d.ts.map +1 -1
  71. package/dist/EcosystemLinks.svelte +3 -3
  72. package/dist/EcosystemLinks.svelte.d.ts.map +1 -1
  73. package/dist/EcosystemLinksPanel.svelte +2 -2
  74. package/dist/EcosystemLinksPanel.svelte.d.ts.map +1 -1
  75. package/dist/GithubLink.svelte +10 -10
  76. package/dist/GithubLink.svelte.d.ts.map +1 -1
  77. package/dist/Glyph.svelte +4 -2
  78. package/dist/Glyph.svelte.d.ts.map +1 -1
  79. package/dist/Hashlink.svelte +5 -5
  80. package/dist/Hashlink.svelte.d.ts.map +1 -1
  81. package/dist/HueInput.svelte +5 -5
  82. package/dist/HueInput.svelte.d.ts.map +1 -1
  83. package/dist/ImgOrSvg.svelte +20 -20
  84. package/dist/ImgOrSvg.svelte.d.ts.map +1 -1
  85. package/dist/LibraryDetail.svelte +16 -16
  86. package/dist/LibraryDetail.svelte.d.ts.map +1 -1
  87. package/dist/LibrarySummary.svelte +10 -8
  88. package/dist/LibrarySummary.svelte.d.ts.map +1 -1
  89. package/dist/MdnLink.svelte +8 -8
  90. package/dist/MdnLink.svelte.d.ts.map +1 -1
  91. package/dist/ModuleLink.svelte +5 -5
  92. package/dist/ModuleLink.svelte.d.ts.map +1 -1
  93. package/dist/PasteFromClipboard.svelte +1 -1
  94. package/dist/PasteFromClipboard.svelte.d.ts.map +1 -1
  95. package/dist/PendingAnimation.svelte +12 -11
  96. package/dist/PendingAnimation.svelte.d.ts.map +1 -1
  97. package/dist/PendingButton.svelte +3 -3
  98. package/dist/PendingButton.svelte.d.ts.map +1 -1
  99. package/dist/ProjectLinks.svelte +7 -7
  100. package/dist/ProjectLinks.svelte.d.ts.map +1 -1
  101. package/dist/Redirect.svelte +12 -8
  102. package/dist/Redirect.svelte.d.ts.map +1 -1
  103. package/dist/Spiders.svelte +5 -5
  104. package/dist/Spiders.svelte.d.ts.map +1 -1
  105. package/dist/StyleVariableButton.svelte +6 -6
  106. package/dist/StyleVariableButton.svelte.d.ts.map +1 -1
  107. package/dist/Svg.svelte +5 -5
  108. package/dist/Svg.svelte.d.ts.map +1 -1
  109. package/dist/Teleport.svelte +2 -2
  110. package/dist/Teleport.svelte.d.ts.map +1 -1
  111. package/dist/ThemeInput.svelte +10 -8
  112. package/dist/ThemeInput.svelte.d.ts.map +1 -1
  113. package/dist/ThemeRoot.svelte +10 -11
  114. package/dist/ThemeRoot.svelte.d.ts.map +1 -1
  115. package/dist/TomeContent.svelte +11 -11
  116. package/dist/TomeContent.svelte.d.ts.map +1 -1
  117. package/dist/TomeHeader.svelte +6 -6
  118. package/dist/TomeLink.svelte +7 -7
  119. package/dist/TomeLink.svelte.d.ts.map +1 -1
  120. package/dist/TomeSection.svelte +8 -8
  121. package/dist/TomeSection.svelte.d.ts.map +1 -1
  122. package/dist/TomeSectionHeader.svelte +12 -12
  123. package/dist/TomeSectionHeader.svelte.d.ts.map +1 -1
  124. package/dist/TypeLink.svelte +11 -11
  125. package/dist/TypeLink.svelte.d.ts.map +1 -1
  126. package/dist/alert.js +1 -1
  127. package/dist/api_search.svelte.d.ts.map +1 -1
  128. package/dist/api_search.svelte.js +5 -7
  129. package/dist/autofocus.svelte.d.ts.map +1 -1
  130. package/dist/context_helpers.js +1 -1
  131. package/dist/contextmenu_helpers.d.ts.map +1 -1
  132. package/dist/contextmenu_helpers.js +3 -3
  133. package/dist/contextmenu_state.svelte.d.ts.map +1 -1
  134. package/dist/contextmenu_state.svelte.js +4 -4
  135. package/dist/csp.d.ts.map +1 -1
  136. package/dist/csp.js +27 -27
  137. package/dist/csp_of_fuzdev.d.ts.map +1 -1
  138. package/dist/csp_of_fuzdev.js +1 -1
  139. package/dist/declaration.svelte.d.ts +44 -256
  140. package/dist/declaration.svelte.d.ts.map +1 -1
  141. package/dist/declaration.svelte.js +132 -52
  142. package/dist/declaration_contextmenu.d.ts.map +1 -1
  143. package/dist/declaration_contextmenu.js +2 -2
  144. package/dist/docs_helpers.svelte.d.ts.map +1 -1
  145. package/dist/icons.js +200 -200
  146. package/dist/intersect.svelte.d.ts.map +1 -1
  147. package/dist/library.svelte.d.ts +31 -18
  148. package/dist/library.svelte.d.ts.map +1 -1
  149. package/dist/library.svelte.js +76 -21
  150. package/dist/logos.js +42 -42
  151. package/dist/module.svelte.d.ts +30 -37
  152. package/dist/module.svelte.d.ts.map +1 -1
  153. package/dist/module.svelte.js +88 -35
  154. package/dist/module_contextmenu.d.ts.map +1 -1
  155. package/dist/module_contextmenu.js +2 -2
  156. package/dist/site.svelte.d.ts.map +1 -1
  157. package/dist/style_variable_helpers.svelte.d.ts.map +1 -1
  158. package/dist/svg.d.ts.map +1 -1
  159. package/dist/theme_state.svelte.d.ts.map +1 -1
  160. package/dist/theme_state.svelte.js +1 -1
  161. package/dist/tome.d.ts.map +1 -1
  162. package/dist/tome.js +1 -1
  163. package/dist/vite_plugin_pkg_json.d.ts.map +1 -1
  164. package/dist/vite_plugin_pkg_json.js +1 -1
  165. package/package.json +3 -22
  166. package/src/lib/alert.ts +3 -3
  167. package/src/lib/api_search.svelte.ts +9 -11
  168. package/src/lib/autofocus.svelte.ts +2 -2
  169. package/src/lib/context_helpers.ts +2 -2
  170. package/src/lib/contextmenu_helpers.ts +21 -21
  171. package/src/lib/contextmenu_state.svelte.ts +32 -34
  172. package/src/lib/csp.ts +42 -54
  173. package/src/lib/csp_of_fuzdev.ts +2 -2
  174. package/src/lib/declaration.svelte.ts +157 -62
  175. package/src/lib/declaration_contextmenu.ts +5 -5
  176. package/src/lib/dialog.ts +1 -1
  177. package/src/lib/docs_helpers.svelte.ts +9 -9
  178. package/src/lib/icons.ts +205 -205
  179. package/src/lib/intersect.svelte.ts +5 -5
  180. package/src/lib/library.svelte.ts +103 -36
  181. package/src/lib/library_helpers.ts +2 -2
  182. package/src/lib/logos.ts +43 -43
  183. package/src/lib/module.svelte.ts +98 -49
  184. package/src/lib/module_contextmenu.ts +4 -4
  185. package/src/lib/site.svelte.ts +5 -5
  186. package/src/lib/storage.ts +2 -2
  187. package/src/lib/style_variable_helpers.svelte.ts +2 -2
  188. package/src/lib/svg.ts +2 -2
  189. package/src/lib/theme_state.svelte.ts +8 -8
  190. package/src/lib/tome.ts +8 -8
  191. package/src/lib/vite_plugin_pkg_json.ts +8 -8
@@ -5,12 +5,13 @@ import type {
5
5
  ParameterJsonInput,
6
6
  ComponentPropJsonInput,
7
7
  OverloadJsonInput,
8
- Reactivity,
8
+ Reactivity
9
9
  } from 'svelte-docinfo/types.js';
10
- import {generateImport, getDisplayName} from 'svelte-docinfo/declaration-helpers.js';
10
+ import { generateImport, getDisplayName } from 'svelte-docinfo/declaration-helpers.js';
11
+ import { EMPTY_ARRAY } from '@fuzdev/fuz_util/array.ts';
11
12
 
12
- import type {Module} from './module.svelte.ts';
13
- import {url_github_file} from '@fuzdev/fuz_util/package_helpers.ts';
13
+ import type { Module } from './module.svelte.ts';
14
+ import { url_github_file } from '@fuzdev/fuz_util/package_helpers.ts';
14
15
 
15
16
  // The `virtual:svelte-docinfo` module is serialized with svelte-docinfo's
16
17
  // `compactReplacer`, which strips empty default arrays — so the runtime data
@@ -27,9 +28,11 @@ const field = <T>(decl: DeclarationJsonInput, key: string): T | undefined =>
27
28
  * Rich runtime representation of an exported declaration.
28
29
  *
29
30
  * Wraps svelte-docinfo's `DeclarationJson` discriminated union (on `kind`)
30
- * with Svelte 5 reactive derivations and computed URLs.
31
- * Kind-specific fields are accessed via the `field()` helper since
32
- * not all fields exist on all variants.
31
+ * with computed properties and URLs. Kind-specific fields are accessed via
32
+ * the `field()` helper since not all fields exist on all variants.
33
+ *
34
+ * Computed properties are plain getters rather than `$derived` — see
35
+ * `Library` for why.
33
36
  *
34
37
  * @see {@link https://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library
35
38
  * @see `DeclarationDetail.svelte` for the rendering component
@@ -38,136 +41,228 @@ export class Declaration {
38
41
  readonly module: Module = $state.raw()!;
39
42
  readonly declaration_json: DeclarationJsonInput = $state.raw()!;
40
43
 
41
- library = $derived(this.module.library);
44
+ get library(): Module['library'] {
45
+ return this.module.library;
46
+ }
42
47
 
43
48
  /**
44
49
  * Module path where this declaration is defined.
45
50
  */
46
- module_path = $derived(this.module.path);
51
+ get module_path(): string {
52
+ return this.module.path;
53
+ }
54
+
55
+ get name(): string {
56
+ return this.declaration_json.name;
57
+ }
47
58
 
48
- name = $derived(this.declaration_json.name);
49
- kind = $derived(this.declaration_json.kind);
59
+ get kind(): DeclarationJsonInput['kind'] {
60
+ return this.declaration_json.kind;
61
+ }
50
62
 
51
63
  /**
52
64
  * GitHub source URL with line number.
53
65
  */
54
- url_github = $derived(
55
- this.library.repo_url && this.declaration_json.sourceLine
66
+ get url_github(): string | undefined {
67
+ return this.library.repo_url && this.declaration_json.sourceLine
56
68
  ? url_github_file(
57
69
  this.library.repo_url,
58
70
  `src/lib/${this.module_path}`,
59
- this.declaration_json.sourceLine,
71
+ this.declaration_json.sourceLine
60
72
  )
61
- : undefined,
62
- );
73
+ : undefined;
74
+ }
63
75
 
64
76
  /**
65
77
  * API documentation URL.
66
78
  */
67
- url_api = $derived(`/docs/api${this.library.url_prefix}/${this.module_path}#${this.name}`);
79
+ get url_api(): string {
80
+ return `/docs/api${this.library.url_prefix}/${this.module_path}#${this.name}`;
81
+ }
82
+
83
+ #import_statement: string | undefined;
68
84
 
69
85
  /**
70
86
  * Generated TypeScript import statement.
71
87
  */
72
- import_statement = $derived(
88
+ get import_statement(): string {
73
89
  // `generateImport` reads only `name`/`kind`/path, none of the defaulted
74
90
  // arrays, so asserting the parsed shape here is sound.
75
- generateImport(
91
+ return (this.#import_statement ??= generateImport(
76
92
  this.declaration_json as DeclarationJson,
77
93
  this.module_path,
78
- this.library.pkg_json.name,
79
- ),
80
- );
94
+ this.library.pkg_json.name
95
+ ));
96
+ }
81
97
 
82
98
  /**
83
99
  * Public documentation link (if homepage_url is available).
84
100
  */
85
- url_api_full = $derived(
86
- this.library.homepage_url
101
+ get url_api_full(): string | undefined {
102
+ return this.library.homepage_url
87
103
  ? `${this.library.homepage_url.replace(/\/$/, '')}/docs/api/${this.module_path}#${this.name}`
88
- : undefined,
89
- );
104
+ : undefined;
105
+ }
106
+
107
+ #display_name: string | undefined;
90
108
 
91
109
  /**
92
110
  * Display name with generic parameters.
93
111
  */
94
- // `getDisplayName` reads `genericParams` unguarded, so feed it the defaulted
95
- // value rather than the raw (possibly-absent) input field.
96
- display_name = $derived(
97
- getDisplayName({
112
+ get display_name(): string {
113
+ // `getDisplayName` reads `genericParams` unguarded, so feed it the defaulted
114
+ // value rather than the raw (possibly-absent) input field.
115
+ return (this.#display_name ??= getDisplayName({
98
116
  ...this.declaration_json,
99
- genericParams: this.declaration_json.genericParams ?? [],
100
- } as DeclarationJson),
101
- );
102
-
103
- type_signature = $derived(this.declaration_json.typeSignature);
104
- doc_comment = $derived(this.declaration_json.docComment);
105
- deprecated_message = $derived(this.declaration_json.deprecatedMessage);
106
- parameters = $derived(field<Array<ParameterJsonInput>>(this.declaration_json, 'parameters'));
107
- props = $derived(field<Array<ComponentPropJsonInput>>(this.declaration_json, 'props'));
108
- return_type = $derived(field<string>(this.declaration_json, 'returnType'));
109
- return_description = $derived(field<string>(this.declaration_json, 'returnDescription'));
110
- generic_params = $derived(this.declaration_json.genericParams ?? []);
111
- extends_type = $derived(field<string | Array<string>>(this.declaration_json, 'extends'));
112
- implements_types = $derived(field<Array<string>>(this.declaration_json, 'implements'));
113
- throws = $derived(this.declaration_json.throws ?? []);
114
- since = $derived(this.declaration_json.since);
115
- examples = $derived(this.declaration_json.examples ?? []);
116
- see_also = $derived(this.declaration_json.seeAlso ?? []);
117
+ genericParams: this.declaration_json.genericParams ?? []
118
+ } as DeclarationJson));
119
+ }
120
+
121
+ get type_signature(): string | undefined {
122
+ return this.declaration_json.typeSignature;
123
+ }
124
+
125
+ get doc_comment(): string | undefined {
126
+ return this.declaration_json.docComment;
127
+ }
128
+
129
+ get deprecated_message(): string | undefined {
130
+ return this.declaration_json.deprecatedMessage;
131
+ }
132
+
133
+ get parameters(): Array<ParameterJsonInput> | undefined {
134
+ return field<Array<ParameterJsonInput>>(this.declaration_json, 'parameters');
135
+ }
136
+
137
+ get props(): Array<ComponentPropJsonInput> | undefined {
138
+ return field<Array<ComponentPropJsonInput>>(this.declaration_json, 'props');
139
+ }
140
+
141
+ get return_type(): string | undefined {
142
+ return field<string>(this.declaration_json, 'returnType');
143
+ }
144
+
145
+ get return_description(): string | undefined {
146
+ return field<string>(this.declaration_json, 'returnDescription');
147
+ }
148
+
149
+ get generic_params(): NonNullable<DeclarationJsonInput['genericParams']> {
150
+ return this.declaration_json.genericParams ?? EMPTY_ARRAY;
151
+ }
152
+
153
+ get extends_type(): string | Array<string> | undefined {
154
+ return field<string | Array<string>>(this.declaration_json, 'extends');
155
+ }
156
+
157
+ get implements_types(): Array<string> | undefined {
158
+ return field<Array<string>>(this.declaration_json, 'implements');
159
+ }
160
+
161
+ get throws(): NonNullable<DeclarationJsonInput['throws']> {
162
+ return this.declaration_json.throws ?? EMPTY_ARRAY;
163
+ }
164
+
165
+ get since(): string | undefined {
166
+ return this.declaration_json.since;
167
+ }
168
+
169
+ get examples(): NonNullable<DeclarationJsonInput['examples']> {
170
+ return this.declaration_json.examples ?? EMPTY_ARRAY;
171
+ }
172
+
173
+ get see_also(): NonNullable<DeclarationJsonInput['seeAlso']> {
174
+ return this.declaration_json.seeAlso ?? EMPTY_ARRAY;
175
+ }
176
+
117
177
  /**
118
178
  * Nested members for classes, interfaces, types, and enums.
119
179
  */
120
- members = $derived(field<Array<MemberJsonInput>>(this.declaration_json, 'members'));
180
+ get members(): Array<MemberJsonInput> | undefined {
181
+ return field<Array<MemberJsonInput>>(this.declaration_json, 'members');
182
+ }
121
183
 
122
184
  /**
123
185
  * Intersection types whose properties are external (filtered out of props/members).
124
186
  * Present on `component` and `type` kinds.
125
187
  */
126
- intersects = $derived(field<Array<string>>(this.declaration_json, 'intersects'));
188
+ get intersects(): Array<string> | undefined {
189
+ return field<Array<string>>(this.declaration_json, 'intersects');
190
+ }
127
191
 
128
192
  /**
129
193
  * Whether a component accepts children via props or template usage.
130
194
  * Present on `component` kind only.
131
195
  */
132
- accepts_children = $derived(field<boolean>(this.declaration_json, 'acceptsChildren'));
196
+ get accepts_children(): boolean | undefined {
197
+ return field<boolean>(this.declaration_json, 'acceptsChildren');
198
+ }
133
199
 
134
200
  /**
135
201
  * Function overload signatures when multiple public overloads exist.
136
202
  * Present on `function` and `snippet` kinds, and on function/constructor members.
137
203
  */
138
- overloads = $derived(field<Array<OverloadJsonInput>>(this.declaration_json, 'overloads'));
204
+ get overloads(): Array<OverloadJsonInput> | undefined {
205
+ return field<Array<OverloadJsonInput>>(this.declaration_json, 'overloads');
206
+ }
139
207
 
140
208
  /**
141
209
  * Re-export alias info when this declaration is a renamed re-export.
142
210
  */
143
- alias_of = $derived(this.declaration_json.aliasOf);
211
+ get alias_of(): DeclarationJsonInput['aliasOf'] {
212
+ return this.declaration_json.aliasOf;
213
+ }
144
214
 
145
215
  /**
146
216
  * Other modules that also export this declaration (re-export paths
147
217
  * relative to src/lib). Absent when only exported from its defining module.
148
218
  * The back-link of those modules' `Module.re_exports` edges.
149
219
  */
150
- also_exported_from = $derived(this.declaration_json.alsoExportedFrom);
220
+ get also_exported_from(): DeclarationJsonInput['alsoExportedFrom'] {
221
+ return this.declaration_json.alsoExportedFrom;
222
+ }
151
223
 
152
224
  /**
153
225
  * Mutation documentation from `@mutates` tags, mapping parameter names to descriptions.
154
226
  */
155
- mutates = $derived(this.declaration_json.mutates);
227
+ get mutates(): DeclarationJsonInput['mutates'] {
228
+ return this.declaration_json.mutates;
229
+ }
156
230
 
157
231
  /**
158
232
  * Svelte reactivity flavor (`$state`, `$state.raw`, `$derived`, `$derived.by`)
159
233
  * when this variable is initialized with a value-producing rune.
160
234
  * Present on `variable` kind only.
161
235
  */
162
- reactivity = $derived(field<Reactivity>(this.declaration_json, 'reactivity'));
236
+ get reactivity(): Reactivity | undefined {
237
+ return field<Reactivity>(this.declaration_json, 'reactivity');
238
+ }
239
+
240
+ get has_examples(): boolean {
241
+ return this.examples.length > 0;
242
+ }
163
243
 
164
- has_examples = $derived(this.examples.length > 0);
165
244
  // presence, not truthiness — a bare `@deprecated` (no message text) arrives as `''`
166
- is_deprecated = $derived(this.deprecated_message !== undefined);
167
- has_documentation = $derived(!!this.doc_comment);
168
- has_parameters = $derived(!!(this.parameters && this.parameters.length > 0));
169
- has_props = $derived(!!(this.props && this.props.length > 0));
170
- has_generics = $derived(this.generic_params.length > 0);
245
+ get is_deprecated(): boolean {
246
+ return this.deprecated_message !== undefined;
247
+ }
248
+
249
+ get has_documentation(): boolean {
250
+ return !!this.doc_comment;
251
+ }
252
+
253
+ get has_parameters(): boolean {
254
+ const { parameters } = this;
255
+ return !!(parameters && parameters.length > 0);
256
+ }
257
+
258
+ get has_props(): boolean {
259
+ const { props } = this;
260
+ return !!(props && props.length > 0);
261
+ }
262
+
263
+ get has_generics(): boolean {
264
+ return this.generic_params.length > 0;
265
+ }
171
266
 
172
267
  constructor(module: Module, declaration_json: DeclarationJsonInput) {
173
268
  this.module = module;
@@ -1,10 +1,10 @@
1
- import type {Declaration} from './declaration.svelte.ts';
2
- import type {ContextmenuParams} from './contextmenu_state.svelte.ts';
1
+ import type { Declaration } from './declaration.svelte.ts';
2
+ import type { ContextmenuParams } from './contextmenu_state.svelte.ts';
3
3
 
4
4
  // TODO @many expand contextmenus for docs
5
5
 
6
6
  export const create_declaration_contextmenu = (
7
- declaration: Declaration,
7
+ declaration: Declaration
8
8
  ): Array<ContextmenuParams> => {
9
9
  const entries: Array<ContextmenuParams> = [];
10
10
 
@@ -13,8 +13,8 @@ export const create_declaration_contextmenu = (
13
13
  entries.push({
14
14
  snippet: 'link',
15
15
  props: {
16
- href: declaration.url_github,
17
- },
16
+ href: declaration.url_github
17
+ }
18
18
  });
19
19
  }
20
20
 
package/src/lib/dialog.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {create_context} from './context_helpers.ts';
1
+ import { create_context } from './context_helpers.ts';
2
2
 
3
3
  export type DialogAlign = 'center' | 'top';
4
4
  export const dialog_aligns: Array<DialogAlign> = ['center', 'top'];
@@ -1,8 +1,8 @@
1
- import {resolve} from '$app/paths';
2
- import {SvelteMap, SvelteSet} from 'svelte/reactivity';
3
- import {ensure_end, ensure_start} from '@fuzdev/fuz_util/string.ts';
1
+ import { resolve } from '$app/paths';
2
+ import { SvelteMap, SvelteSet } from 'svelte/reactivity';
3
+ import { ensure_end, ensure_start } from '@fuzdev/fuz_util/string.ts';
4
4
 
5
- import {create_context} from './context_helpers.ts';
5
+ import { create_context } from './context_helpers.ts';
6
6
 
7
7
  export const docs_links_context = create_context<DocsLinks>();
8
8
 
@@ -36,12 +36,12 @@ export const DOCS_API_PATH = DOCS_PATH + '/api';
36
36
  export const to_docs_path_info = (
37
37
  path_slug: string,
38
38
  pathname: string,
39
- root_path = DOCS_PATH_DEFAULT,
40
- ): {path: string; path_is_selected: boolean; path_segment: string | undefined} => {
39
+ root_path = DOCS_PATH_DEFAULT
40
+ ): { path: string; path_is_selected: boolean; path_segment: string | undefined } => {
41
41
  const path_segment = pathname.split('/').at(-1);
42
42
  const path = resolve((ensure_end(ensure_start(root_path, '/'), '/') + path_slug) as any);
43
43
  const path_is_selected = path_segment === path_slug; // messy but works
44
- return {path, path_is_selected, path_segment};
44
+ return { path, path_is_selected, path_segment };
45
45
  };
46
46
 
47
47
  export type DocsLinkTag = 'h2' | 'h3' | 'h4';
@@ -118,7 +118,7 @@ export class DocsLinks {
118
118
  tag?: DocsLinkTag,
119
119
  depth = 1,
120
120
  parent_id?: string,
121
- explicit_id?: string,
121
+ explicit_id?: string
122
122
  ): string {
123
123
  // Use explicit ID if provided, otherwise generate one
124
124
  const id = explicit_id ?? 'docs_link_' + this.#next_id++;
@@ -133,7 +133,7 @@ export class DocsLinks {
133
133
  this.#fragment_to_order.set(page_fragment_key, order);
134
134
  }
135
135
 
136
- this.links.set(id, {id, fragment, text, tag, depth, order, parent_id});
136
+ this.links.set(id, { id, fragment, text, tag, depth, order, parent_id });
137
137
  return id;
138
138
  }
139
139