@lmzhen/dsh-evolution-skill-health 0.25.2 → 0.25.4
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/lib/client.js
CHANGED
|
@@ -120,6 +120,25 @@ window.__ModuleLoader__.load({
|
|
|
120
120
|
return (0, react.createElement)("section", null, (0, react.createElement)("p", null, t("counts").replace("{ok}", String(counts.get("ok") ?? 0)).replace("{warn}", String(counts.get("warn") ?? 0)).replace("{error}", String(counts.get("error") ?? 0)).replace("{unreadable}", String(counts.get("unreadable") ?? 0))), props.face.truncated ? (0, react.createElement)("p", null, t("loading.failed")) : null, props.face.rows.length === 0 ? (0, react.createElement)("p", null, t("empty.noneReported")) : null, (0, react.createElement)("h3", null, t("group.byRule")), ruleTable(props.face, t), props.face.rows.filter((row) => row.verdict === "unreadable").map((row) => (0, react.createElement)("p", { key: row.name + ":unreadable" }, row.name + " — " + t("unreadable.note"))));
|
|
121
121
|
}
|
|
122
122
|
//#endregion
|
|
123
|
+
//#region src/client/styles.ts
|
|
124
|
+
/**
|
|
125
|
+
* The panel stylesheet. The bundle is built outside the platform CSS-Modules pipeline, so it carries
|
|
126
|
+
* the text itself and injects one tagged <style> element; the tag id keeps a hot reload from stacking
|
|
127
|
+
* copies. Only the panel body is styled — the sidebar owns the row and its glyph slot.
|
|
128
|
+
*
|
|
129
|
+
* Every value comes from the generated family scale (`./tokens.ts`), so this file carries no literal.
|
|
130
|
+
* @module @lmzhen/dsh-evolution-skill-health/client
|
|
131
|
+
*/
|
|
132
|
+
/** Tag id for the injected <style>, so a hot reload replaces rather than stacks it. */
|
|
133
|
+
const CSS_TAG_ID = "dsh-evolution-skill-health";
|
|
134
|
+
/** The panel stylesheet text. */
|
|
135
|
+
const CSS = [
|
|
136
|
+
":where(.dsh-evolution-skill-health) { display: flex; flex-direction: column; gap: var(--evo-space-8); padding: var(--evo-space-12); }",
|
|
137
|
+
":where(.dsh-evolution-skill-health) { --evo-type-lg:calc(1em + 2px);--evo-type-body:1em;--evo-type-sm:calc(1em - 1px);--evo-type-xs:calc(1em - 2px);--evo-space-2:2px;--evo-space-4:4px;--evo-space-6:6px;--evo-space-8:8px;--evo-space-10:10px;--evo-space-12:12px;--evo-space-14:14px;--evo-space-16:16px;--evo-space-20:20px;--evo-radius-chip:4px;--evo-radius-control:8px;--evo-radius-surface:12px;--evo-radius-pill:999px;--evo-hairline-width:.5px;--evo-hairline-marker:2px;--evo-measure-read:80ch;--evo-leading-base:1.5;--evo-tone-quiet:var(--dsw-alias-label-secondary);--evo-tone-primary:var(--dsw-alias-brand-primary);--evo-tone-danger:var(--dsw-alias-state-error-primary);--evo-tone-success:var(--dsw-alias-state-success-primary);--evo-focus-ring:2px solid var(--dsw-alias-label-primary);--evo-focus-offset:-2px;--evo-cap-aside:280px;--evo-cap-block:260px }",
|
|
138
|
+
":where(.dsh-evolution-skill-health [data-role=\"row\"]) { display: flex; align-items: baseline; justify-content: space-between; gap: var(--evo-space-8); border-bottom: var(--evo-hairline-width) solid var(--evo-tone-quiet); }",
|
|
139
|
+
":where(.dsh-evolution-skill-health [data-role=\"note\"]) { color: var(--evo-tone-quiet); }"
|
|
140
|
+
].join(String.fromCharCode(10));
|
|
141
|
+
//#endregion
|
|
123
142
|
//#region src/client/index.ts
|
|
124
143
|
/** Required client services: the slot registry and the locale seat. */
|
|
125
144
|
const inject = ["slots", "locale"];
|
|
@@ -127,6 +146,26 @@ window.__ModuleLoader__.load({
|
|
|
127
146
|
* Register the row and the body.
|
|
128
147
|
* @param ctx - the client context; it must carry the two seats above.
|
|
129
148
|
*/
|
|
149
|
+
/**
|
|
150
|
+
* The row glyph. The sidebar hands every `sidebar.panellist` occupant `{ size, active }` and owns the
|
|
151
|
+
* slot around it, so this is a plain line glyph drawn in `currentColor`.
|
|
152
|
+
* @param props - the seat-provided size and active flag.
|
|
153
|
+
* @returns the glyph element.
|
|
154
|
+
*/
|
|
155
|
+
function PanelIcon(props = {}) {
|
|
156
|
+
const size = typeof props.size === "number" && props.size > 0 ? props.size : 16;
|
|
157
|
+
return (0, react.createElement)("svg", {
|
|
158
|
+
"aria-hidden": "true",
|
|
159
|
+
width: String(size),
|
|
160
|
+
height: String(size),
|
|
161
|
+
viewBox: "0 0 16 16",
|
|
162
|
+
fill: "none",
|
|
163
|
+
stroke: "currentColor",
|
|
164
|
+
strokeWidth: "1.5",
|
|
165
|
+
strokeLinecap: "round",
|
|
166
|
+
strokeLinejoin: "round"
|
|
167
|
+
}, (0, react.createElement)("path", { d: "M2 8h3l1.5-3.5L9 11.5 10.5 8H14" }));
|
|
168
|
+
}
|
|
130
169
|
function apply(ctx) {
|
|
131
170
|
const seam = ctx;
|
|
132
171
|
let registered = false;
|
|
@@ -143,6 +182,18 @@ window.__ModuleLoader__.load({
|
|
|
143
182
|
return () => {};
|
|
144
183
|
}
|
|
145
184
|
}, "evolution-skill-health: locale");
|
|
185
|
+
ctx.effect(() => {
|
|
186
|
+
if (document.querySelector("style[data-plugin-css=\"dsh-evolution-skill-health\"]") === null) {
|
|
187
|
+
const tag = document.createElement("style");
|
|
188
|
+
tag.setAttribute("data-plugin-css", CSS_TAG_ID);
|
|
189
|
+
tag.textContent = CSS;
|
|
190
|
+
document.head.append(tag);
|
|
191
|
+
return () => {
|
|
192
|
+
tag.remove();
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return () => {};
|
|
196
|
+
}, "evolution-skill-health: styles");
|
|
146
197
|
const label = () => {
|
|
147
198
|
const fallback = zh["entry.label"] ?? "技能健康";
|
|
148
199
|
if (!registered) return fallback;
|
|
@@ -158,7 +209,7 @@ window.__ModuleLoader__.load({
|
|
|
158
209
|
id: PANEL_ID,
|
|
159
210
|
order: 40,
|
|
160
211
|
label
|
|
161
|
-
},
|
|
212
|
+
}, PanelIcon);
|
|
162
213
|
yield seam.slots.register({
|
|
163
214
|
name: "main",
|
|
164
215
|
key: PANEL_ID,
|
|
@@ -12,9 +12,5 @@ import { type HealthFace } from './Panel.ts';
|
|
|
12
12
|
export declare const inject: string[];
|
|
13
13
|
/** The host half hands the panel a way to read its rows (a read-only route on the host side). */
|
|
14
14
|
export type HealthFaceLoader = () => Promise<HealthFace>;
|
|
15
|
-
/**
|
|
16
|
-
* Register the row and the body.
|
|
17
|
-
* @param ctx - the client context; it must carry the two seats above.
|
|
18
|
-
*/
|
|
19
15
|
export declare function apply(ctx: ClientContext): void;
|
|
20
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -40,7 +40,7 @@ export interface LocaleSeat {
|
|
|
40
40
|
/** The slot registry: a generator body may register (and is disposed when it unmounts). */
|
|
41
41
|
export interface SlotsSeat {
|
|
42
42
|
inject(name: string, body: () => Generator<() => void, void, void>): void;
|
|
43
|
-
register(options: PanelRowOptions | PanelBodyOptions, component: (props:
|
|
43
|
+
register(options: PanelRowOptions | PanelBodyOptions, component: (props: never) => ReactNode): () => void;
|
|
44
44
|
}
|
|
45
45
|
/** Everything this bundle asks the shell for. */
|
|
46
46
|
export interface ClientSeam {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panel stylesheet. The bundle is built outside the platform CSS-Modules pipeline, so it carries
|
|
3
|
+
* the text itself and injects one tagged <style> element; the tag id keeps a hot reload from stacking
|
|
4
|
+
* copies. Only the panel body is styled — the sidebar owns the row and its glyph slot.
|
|
5
|
+
*
|
|
6
|
+
* Every value comes from the generated family scale (`./tokens.ts`), so this file carries no literal.
|
|
7
|
+
* @module @lmzhen/dsh-evolution-skill-health/client
|
|
8
|
+
*/
|
|
9
|
+
/** Tag id for the injected <style>, so a hot reload replaces rather than stacks it. */
|
|
10
|
+
export declare const CSS_TAG_ID = "dsh-evolution-skill-health";
|
|
11
|
+
/** The panel stylesheet text. */
|
|
12
|
+
export declare const CSS: string;
|
|
13
|
+
//# sourceMappingURL=styles.d.ts.map
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
]
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"version": "0.25.
|
|
14
|
+
"version": "0.25.4",
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"types": "./lib/types/index.d.ts",
|
|
29
29
|
"default": "./lib/index.js"
|
|
30
30
|
},
|
|
31
|
+
"./client": {
|
|
32
|
+
"types": "./lib/types/client/index.d.ts",
|
|
33
|
+
"default": "./lib/client.js"
|
|
34
|
+
},
|
|
31
35
|
"./package.json": "./package.json"
|
|
32
36
|
},
|
|
33
37
|
"files": [
|
|
@@ -39,13 +43,13 @@
|
|
|
39
43
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
44
|
"@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.1",
|
|
41
45
|
"react": "^18.2.0",
|
|
42
|
-
"@lmzhen/dsh-evolution-curator": "^0.25.
|
|
46
|
+
"@lmzhen/dsh-evolution-curator": "^0.25.4"
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
49
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
46
50
|
"@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.1",
|
|
47
51
|
"@types/react": "~18.3.1",
|
|
48
52
|
"react": "^18.2.0",
|
|
49
|
-
"@lmzhen/dsh-evolution-curator": "^0.25.
|
|
53
|
+
"@lmzhen/dsh-evolution-curator": "^0.25.4"
|
|
50
54
|
}
|
|
51
55
|
}
|