@fuzdev/fuz_ui 0.218.0 → 0.219.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.
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Code from '@fuzdev/fuz_code/Code.svelte';
3
3
  import Mdz from '@fuzdev/mdz/Mdz.svelte';
4
+ import { mdz_from_tsdoc } from '@fuzdev/mdz/tsdoc_mdz.ts';
4
5
  import {
5
6
  mdz_code_context,
6
7
  mdz_codeblock_context,
@@ -8,6 +9,7 @@
8
9
  } from '@fuzdev/mdz/mdz_contexts.ts';
9
10
 
10
11
  import { set_library_context_with_fallback, type Library } from './library.svelte.js';
12
+ import type { Module } from './module.svelte.js';
11
13
  import { tome_get_by_slug, type Tome } from './tome.js';
12
14
  import TomeContent from './TomeContent.svelte';
13
15
  import TomeSection from './TomeSection.svelte';
@@ -70,6 +72,20 @@
70
72
  const source_url = $derived(module?.url_github);
71
73
  </script>
72
74
 
75
+ <!-- Marker chips from the module comment, shared by the module page and directory listings. -->
76
+ {#snippet doc_chips(m: Module)}
77
+ {#if m.is_deprecated || m.is_internal}
78
+ <p class="row gap_md flex-wrap:wrap">
79
+ {#if m.is_deprecated}
80
+ <span class="chip">⚠️ deprecated</span>
81
+ {/if}
82
+ {#if m.is_internal}
83
+ <span class="chip">internal</span>
84
+ {/if}
85
+ </p>
86
+ {/if}
87
+ {/snippet}
88
+
73
89
  <svelte:head>
74
90
  <title>{module_name} - API docs - {library.pkg_json.name}</title>
75
91
  </svelte:head>
@@ -92,6 +108,7 @@
92
108
  {#each directory_modules as child_module (child_module.path)}
93
109
  <li>
94
110
  <h3><ModuleLink module_path={child_module.path} /></h3>
111
+ {@render doc_chips(child_module)}
95
112
  {#if child_module.module_comment}
96
113
  <Mdz content={child_module.module_comment} />
97
114
  {/if}
@@ -101,9 +118,33 @@
101
118
  </section>
102
119
  {/if}
103
120
  {:else}
104
- {#if module.module_comment}
121
+ <!-- module comment: mirrors the compact `doc_extras` form in `DeclarationDetail` -->
122
+ {#if module.has_module_doc}
105
123
  <section>
106
- <Mdz content={module.module_comment} />
124
+ {@render doc_chips(module)}
125
+ {#if module.deprecated_message}
126
+ <p>{module.deprecated_message}</p>
127
+ {/if}
128
+ {#if module.internal_message}
129
+ <p>{module.internal_message}</p>
130
+ {/if}
131
+ {#if module.module_comment}
132
+ <Mdz content={module.module_comment} />
133
+ {/if}
134
+ {#if module.since}
135
+ <p><strong>since</strong> {module.since}</p>
136
+ {/if}
137
+ {#each module.examples as example (example)}
138
+ <Mdz content={example} />
139
+ {/each}
140
+ {#if module.see_also.length}
141
+ <p><strong>see also</strong></p>
142
+ <ul>
143
+ {#each module.see_also as ref (ref)}
144
+ <li><Mdz content={mdz_from_tsdoc(ref)} /></li>
145
+ {/each}
146
+ </ul>
147
+ {/if}
107
148
  </section>
108
149
  {/if}
109
150
  {#if source_url}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiModule.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModule.svelte"],"names":[],"mappings":"AAWA,OAAO,EAAqC,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAoB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAWvD,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAgMH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"ApiModule.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ApiModule.svelte"],"names":[],"mappings":"AAYA,OAAO,EAAqC,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEtF,OAAO,EAAoB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAWvD,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACZ,CAAC;AAyOH,QAAA,MAAM,SAAS,sDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -33,7 +33,22 @@ export declare class Module {
33
33
  * Import-style path with ./ prefix.
34
34
  */
35
35
  get path_import(): string;
36
+ /**
37
+ * Prose of the `@module` comment, tag lines removed. Absent for a tag-only
38
+ * comment, whose tags still populate the doc fields below.
39
+ */
36
40
  get module_comment(): string | undefined;
41
+ get deprecated_message(): string | undefined;
42
+ /**
43
+ * Internal-API marker from the module comment's `@internal` tag. Presence
44
+ * means the tag was written; an empty string is a bare tag.
45
+ */
46
+ get internal_message(): string | undefined;
47
+ get since(): string | undefined;
48
+ get examples(): NonNullable<ModuleJsonInput['examples']>;
49
+ get see_also(): NonNullable<ModuleJsonInput['seeAlso']>;
50
+ get is_deprecated(): boolean;
51
+ get is_internal(): boolean;
37
52
  /**
38
53
  * Array of `Declaration` instances. Filters out default exports.
39
54
  */
@@ -58,7 +73,12 @@ export declare class Module {
58
73
  * filter in `declarations`).
59
74
  */
60
75
  get has_declarations(): boolean;
61
- get has_module_comment(): boolean;
76
+ /**
77
+ * Whether the module comment documents anything — prose or any doc field.
78
+ * A tag-only comment (just `@see`, say) has no `module_comment` but still
79
+ * counts.
80
+ */
81
+ get has_module_doc(): boolean;
62
82
  /**
63
83
  * Modules this imports (paths relative to src/lib).
64
84
  */
@@ -1 +1 @@
1
- {"version":3,"file":"module.svel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;;;;OAKG;IACH,IAAI,YAAY,IAAI,WAAW,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAE9D;IAED,IAAI,gBAAgB,IAAI,OAAO,CAE9B;IAID;;;OAGG;IACH,IAAI,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAEhE;IAED;;;;OAIG;IACH,IAAI,mBAAmB,IAAI,WAAW,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC,CAE3E;IAED,IAAI,uBAAuB,IAAI,OAAO,CAErC;IAID;;;;OAIG;IACH,IAAI,gCAAgC,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAKpF;IAED;;;;OAIG;IACH,IAAI,qBAAqB,IAAI,WAAW,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAE/E;IAED,IAAI,yBAAyB,IAAI,OAAO,CAEvC;IAED;;;OAGG;IACH,IAAI,kBAAkB,IAAI,OAAO,CAOhC;gBAEW,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe;IAK1D;;OAEG;IACH,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;CAG9D"}
@@ -57,9 +57,40 @@ export class Module {
57
57
  get path_import() {
58
58
  return './' + this.path;
59
59
  }
60
+ /**
61
+ * Prose of the `@module` comment, tag lines removed. Absent for a tag-only
62
+ * comment, whose tags still populate the doc fields below.
63
+ */
60
64
  get module_comment() {
61
65
  return this.module_json.moduleComment;
62
66
  }
67
+ get deprecated_message() {
68
+ return this.module_json.deprecatedMessage;
69
+ }
70
+ /**
71
+ * Internal-API marker from the module comment's `@internal` tag. Presence
72
+ * means the tag was written; an empty string is a bare tag.
73
+ */
74
+ get internal_message() {
75
+ return this.module_json.internalMessage;
76
+ }
77
+ get since() {
78
+ return this.module_json.since;
79
+ }
80
+ get examples() {
81
+ return this.module_json.examples ?? EMPTY_ARRAY;
82
+ }
83
+ get see_also() {
84
+ return this.module_json.seeAlso ?? EMPTY_ARRAY;
85
+ }
86
+ // presence, not truthiness — a bare `@deprecated` (no message text) arrives as `''`
87
+ get is_deprecated() {
88
+ return this.deprecated_message !== undefined;
89
+ }
90
+ // presence, not truthiness — a bare `@internal` (no message text) arrives as `''`
91
+ get is_internal() {
92
+ return this.internal_message !== undefined;
93
+ }
63
94
  #declarations;
64
95
  /**
65
96
  * Array of `Declaration` instances. Filters out default exports.
@@ -99,8 +130,18 @@ export class Module {
99
130
  get has_declarations() {
100
131
  return this.declarations.length > 0;
101
132
  }
102
- get has_module_comment() {
103
- return !!this.module_comment;
133
+ /**
134
+ * Whether the module comment documents anything — prose or any doc field.
135
+ * A tag-only comment (just `@see`, say) has no `module_comment` but still
136
+ * counts.
137
+ */
138
+ get has_module_doc() {
139
+ return (!!this.module_comment ||
140
+ this.is_deprecated ||
141
+ this.is_internal ||
142
+ !!this.since ||
143
+ this.examples.length > 0 ||
144
+ this.see_also.length > 0);
104
145
  }
105
146
  /**
106
147
  * Modules this imports (paths relative to src/lib).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_ui",
3
- "version": "0.218.0",
3
+ "version": "0.219.0",
4
4
  "description": "Svelte UI library",
5
5
  "tagline": "friendly user zystem",
6
6
  "glyph": "🧶",
@@ -64,7 +64,7 @@
64
64
  "@changesets/changelog-git": "^0.2.1",
65
65
  "@fuzdev/blake3-wasm": "^0.2.0",
66
66
  "@fuzdev/fuz_code": "^0.54.0",
67
- "@fuzdev/fuz_css": "^0.70.0",
67
+ "@fuzdev/fuz_css": "^0.71.0",
68
68
  "@fuzdev/fuz_schema": "^0.5.0",
69
69
  "@fuzdev/fuz_util": "^0.77.0",
70
70
  "@fuzdev/gro": "^0.220.0",
@@ -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.13.0",
85
+ "svelte-docinfo": "^0.14.0",
86
86
  "tslib": "^2.8.1",
87
87
  "typescript": "^6.0.3",
88
88
  "typescript-eslint": "^8.71.1",
@@ -72,10 +72,48 @@ export class Module {
72
72
  return './' + this.path;
73
73
  }
74
74
 
75
+ /**
76
+ * Prose of the `@module` comment, tag lines removed. Absent for a tag-only
77
+ * comment, whose tags still populate the doc fields below.
78
+ */
75
79
  get module_comment(): string | undefined {
76
80
  return this.module_json.moduleComment;
77
81
  }
78
82
 
83
+ get deprecated_message(): string | undefined {
84
+ return this.module_json.deprecatedMessage;
85
+ }
86
+
87
+ /**
88
+ * Internal-API marker from the module comment's `@internal` tag. Presence
89
+ * means the tag was written; an empty string is a bare tag.
90
+ */
91
+ get internal_message(): string | undefined {
92
+ return this.module_json.internalMessage;
93
+ }
94
+
95
+ get since(): string | undefined {
96
+ return this.module_json.since;
97
+ }
98
+
99
+ get examples(): NonNullable<ModuleJsonInput['examples']> {
100
+ return this.module_json.examples ?? EMPTY_ARRAY;
101
+ }
102
+
103
+ get see_also(): NonNullable<ModuleJsonInput['seeAlso']> {
104
+ return this.module_json.seeAlso ?? EMPTY_ARRAY;
105
+ }
106
+
107
+ // presence, not truthiness — a bare `@deprecated` (no message text) arrives as `''`
108
+ get is_deprecated(): boolean {
109
+ return this.deprecated_message !== undefined;
110
+ }
111
+
112
+ // presence, not truthiness — a bare `@internal` (no message text) arrives as `''`
113
+ get is_internal(): boolean {
114
+ return this.internal_message !== undefined;
115
+ }
116
+
79
117
  #declarations: Array<Declaration> | undefined;
80
118
 
81
119
  /**
@@ -121,8 +159,20 @@ export class Module {
121
159
  return this.declarations.length > 0;
122
160
  }
123
161
 
124
- get has_module_comment(): boolean {
125
- return !!this.module_comment;
162
+ /**
163
+ * Whether the module comment documents anything — prose or any doc field.
164
+ * A tag-only comment (just `@see`, say) has no `module_comment` but still
165
+ * counts.
166
+ */
167
+ get has_module_doc(): boolean {
168
+ return (
169
+ !!this.module_comment ||
170
+ this.is_deprecated ||
171
+ this.is_internal ||
172
+ !!this.since ||
173
+ this.examples.length > 0 ||
174
+ this.see_also.length > 0
175
+ );
126
176
  }
127
177
 
128
178
  /**