@lmzhen/dsh-evolution-ui 0.32.2 → 0.32.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/README.md +2 -2
- package/lib/client.js +46 -31
- package/lib/types/panels/history/client/document.d.ts +6 -0
- package/lib/types/panels/settings/PendingCard.d.ts +2 -2
- package/lib/types/panels/settings/generated-about.d.ts +2 -2
- package/lib/types/panels/settings/seam.d.ts +7 -25
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @lmzhen/dsh-evolution-ui
|
|
2
2
|
|
|
3
|
-
Web UI umbrella for the evolution family.
|
|
3
|
+
Web UI umbrella for the evolution family. This package registers two client panels: the settings section and skill history.
|
|
4
4
|
|
|
5
5
|
## Known Limitations and Deferred Work
|
|
6
6
|
|
|
7
|
-
- The merge panel is
|
|
7
|
+
- The merge panel is the separate client-only `@lmzhen/dsh-evolution-merge-ui` package; it is not mounted by this umbrella.
|
|
8
8
|
- The skill-health panel stays a separate disabled row; it is not enabled by this umbrella.
|
package/lib/client.js
CHANGED
|
@@ -195,21 +195,13 @@ window.__ModuleLoader__.load({
|
|
|
195
195
|
{
|
|
196
196
|
id: "approvalConfirm",
|
|
197
197
|
group: "write-caps",
|
|
198
|
-
doc: "What the confirmation before an APPROVE does:
|
|
198
|
+
doc: "What the confirmation before an APPROVE does: execute immediately, or ask first.",
|
|
199
199
|
label: "批准前先确认",
|
|
200
|
-
hint: "点「批准」时要不要再确认一次:直接执行 /
|
|
200
|
+
hint: "点「批准」时要不要再确认一次:直接执行 / 先确认。默认直接执行(不打断批量批准)。",
|
|
201
201
|
control: "select",
|
|
202
202
|
unit: "",
|
|
203
|
-
values: [
|
|
204
|
-
|
|
205
|
-
"ask",
|
|
206
|
-
"timeout"
|
|
207
|
-
],
|
|
208
|
-
valueLabels: [
|
|
209
|
-
"直接执行",
|
|
210
|
-
"先确认",
|
|
211
|
-
"等待超时即取消"
|
|
212
|
-
],
|
|
203
|
+
values: ["auto", "ask"],
|
|
204
|
+
valueLabels: ["直接执行", "先确认"],
|
|
213
205
|
atLeast: ""
|
|
214
206
|
}
|
|
215
207
|
]
|
|
@@ -906,7 +898,7 @@ window.__ModuleLoader__.load({
|
|
|
906
898
|
*/
|
|
907
899
|
function confirmModeFrom(user) {
|
|
908
900
|
const value = typeof user === "object" && user !== null ? user.approvalConfirm : void 0;
|
|
909
|
-
return value === "ask" || value === "timeout" ?
|
|
901
|
+
return value === "ask" || value === "timeout" ? "ask" : "auto";
|
|
910
902
|
}
|
|
911
903
|
/** Which word one age bucket gets; an unknown bucket falls back to the count form. */
|
|
912
904
|
const AGE_KEYS = Object.freeze({
|
|
@@ -2168,7 +2160,7 @@ window.__ModuleLoader__.load({
|
|
|
2168
2160
|
* @returns the section element.
|
|
2169
2161
|
*/
|
|
2170
2162
|
function SettingsSection(face) {
|
|
2171
|
-
return (0, react.createElement)("div", { className: "evolution-params" }, (0, react.createElement)("h2", { className: "evolution-params-title" }, face.t("title")), (0, react.createElement)("p", { className: "evolution-params-subtitle" }, face.t("subtitle")), (0, react.createElement)("p", { className: "evolution-params-about" }, "0.32.
|
|
2163
|
+
return (0, react.createElement)("div", { className: "evolution-params" }, (0, react.createElement)("h2", { className: "evolution-params-title" }, face.t("title")), (0, react.createElement)("p", { className: "evolution-params-subtitle" }, face.t("subtitle")), (0, react.createElement)("p", { className: "evolution-params-about" }, "0.32.4 · Web UI umbrella for the evolution family: settings and skill-history panels"), (0, react.createElement)("div", {
|
|
2172
2164
|
key: PENDING_CARD_KEY,
|
|
2173
2165
|
className: "evolution-params-group"
|
|
2174
2166
|
}, face.renderSlot(CARD_SLOT, {}, { entryKey: PENDING_CARD_KEY })), (0, react.createElement)("div", {
|
|
@@ -2294,7 +2286,7 @@ window.__ModuleLoader__.load({
|
|
|
2294
2286
|
function injectStyles$1(host) {
|
|
2295
2287
|
const doc = host ?? globalThis.document;
|
|
2296
2288
|
if (doc === void 0) return () => {};
|
|
2297
|
-
|
|
2289
|
+
doc.querySelector("style[data-plugin-css=\"@lmzhen/dsh-evolution-ui/settings.css\"]")?.remove?.();
|
|
2298
2290
|
const tag = doc.createElement("style");
|
|
2299
2291
|
tag.dataset.plugin = "@lmzhen/dsh-evolution-ui";
|
|
2300
2292
|
tag.dataset.pluginCss = CSS_TAG_ID$1;
|
|
@@ -2428,7 +2420,7 @@ window.__ModuleLoader__.load({
|
|
|
2428
2420
|
}
|
|
2429
2421
|
function injectStyles(doc, css, tagId) {
|
|
2430
2422
|
if (doc === void 0) return () => {};
|
|
2431
|
-
|
|
2423
|
+
doc.querySelector("style[data-plugin-css=\"" + tagId + "\"]")?.remove();
|
|
2432
2424
|
const tag = doc.createElement("style");
|
|
2433
2425
|
tag.setAttribute("data-plugin-css", tagId);
|
|
2434
2426
|
tag.textContent = css;
|
|
@@ -2566,6 +2558,11 @@ window.__ModuleLoader__.load({
|
|
|
2566
2558
|
loading: "读取中…",
|
|
2567
2559
|
refresh: "刷新",
|
|
2568
2560
|
undo: "回退到此版",
|
|
2561
|
+
failureUnauthorized: "需要登录:重新打开这个页面完成登录后再试。",
|
|
2562
|
+
failureForbidden: "平台拒绝了这个请求(身份不是 owner)。",
|
|
2563
|
+
failureUnmounted: "该功能没有挂载。",
|
|
2564
|
+
failureServer: "读取失败,可以重试。",
|
|
2565
|
+
fallbackHint: "可以改用命令:{command}",
|
|
2569
2566
|
"failure.unauthorized": "需要登录:重新打开这个页面完成登录后再试。",
|
|
2570
2567
|
"failure.forbidden": "平台拒绝了这个请求(身份不是 owner)。",
|
|
2571
2568
|
"failure.unmounted": "该功能没有挂载。",
|
|
@@ -2647,6 +2644,11 @@ window.__ModuleLoader__.load({
|
|
|
2647
2644
|
loading: "Loading…",
|
|
2648
2645
|
refresh: "Refresh",
|
|
2649
2646
|
undo: "Restore this version",
|
|
2647
|
+
failureUnauthorized: "Sign-in is required: reopen this page and sign in, then retry.",
|
|
2648
|
+
failureForbidden: "The platform refused this request (not the owner principal).",
|
|
2649
|
+
failureUnmounted: "This feature is not mounted.",
|
|
2650
|
+
failureServer: "The read failed; you can retry.",
|
|
2651
|
+
fallbackHint: "Command fallback: {command}",
|
|
2650
2652
|
"failure.unauthorized": "Sign-in is required: reopen this page and sign in, then retry.",
|
|
2651
2653
|
"failure.forbidden": "The platform refused this request (not the owner principal).",
|
|
2652
2654
|
"failure.unmounted": "This feature is not mounted.",
|
|
@@ -3468,46 +3470,56 @@ window.__ModuleLoader__.load({
|
|
|
3468
3470
|
const ticket = readTicket.current + 1;
|
|
3469
3471
|
readTicket.current = ticket;
|
|
3470
3472
|
if (kind === "diff") {
|
|
3471
|
-
setDiffs((current) => new Map(current).set(v, {
|
|
3473
|
+
setDiffs((current) => new Map(current).set(v, {
|
|
3474
|
+
kind: "loading",
|
|
3475
|
+
ticket
|
|
3476
|
+
}));
|
|
3472
3477
|
face.loadDiff(name, v).then((diff) => {
|
|
3473
3478
|
if (readTicket.current !== ticket) {
|
|
3474
|
-
setDiffs((current) =>
|
|
3479
|
+
setDiffs((current) => dropIfTicket(current, v, ticket));
|
|
3475
3480
|
return;
|
|
3476
3481
|
}
|
|
3477
3482
|
setDiffs((current) => new Map(current).set(v, {
|
|
3478
3483
|
kind: "ready",
|
|
3479
|
-
diff
|
|
3484
|
+
diff,
|
|
3485
|
+
ticket
|
|
3480
3486
|
}));
|
|
3481
3487
|
}).catch((error) => {
|
|
3482
3488
|
if (readTicket.current !== ticket) {
|
|
3483
|
-
setDiffs((current) =>
|
|
3489
|
+
setDiffs((current) => dropIfTicket(current, v, ticket));
|
|
3484
3490
|
return;
|
|
3485
3491
|
}
|
|
3486
3492
|
setDiffs((current) => new Map(current).set(v, {
|
|
3487
3493
|
kind: "failed",
|
|
3488
|
-
message: failedMessage(error)
|
|
3494
|
+
message: failedMessage(error),
|
|
3495
|
+
ticket
|
|
3489
3496
|
}));
|
|
3490
3497
|
});
|
|
3491
3498
|
return;
|
|
3492
3499
|
}
|
|
3493
|
-
setBodies((current) => new Map(current).set(v, {
|
|
3500
|
+
setBodies((current) => new Map(current).set(v, {
|
|
3501
|
+
kind: "loading",
|
|
3502
|
+
ticket
|
|
3503
|
+
}));
|
|
3494
3504
|
face.loadBody(name, v).then((body) => {
|
|
3495
3505
|
if (readTicket.current !== ticket) {
|
|
3496
|
-
setBodies((current) =>
|
|
3506
|
+
setBodies((current) => dropIfTicket(current, v, ticket));
|
|
3497
3507
|
return;
|
|
3498
3508
|
}
|
|
3499
3509
|
setBodies((current) => new Map(current).set(v, {
|
|
3500
3510
|
kind: "ready",
|
|
3501
|
-
body
|
|
3511
|
+
body,
|
|
3512
|
+
ticket
|
|
3502
3513
|
}));
|
|
3503
3514
|
}).catch((error) => {
|
|
3504
3515
|
if (readTicket.current !== ticket) {
|
|
3505
|
-
setBodies((current) =>
|
|
3516
|
+
setBodies((current) => dropIfTicket(current, v, ticket));
|
|
3506
3517
|
return;
|
|
3507
3518
|
}
|
|
3508
3519
|
setBodies((current) => new Map(current).set(v, {
|
|
3509
3520
|
kind: "failed",
|
|
3510
|
-
message: failedMessage(error)
|
|
3521
|
+
message: failedMessage(error),
|
|
3522
|
+
ticket
|
|
3511
3523
|
}));
|
|
3512
3524
|
});
|
|
3513
3525
|
};
|
|
@@ -3561,15 +3573,18 @@ window.__ModuleLoader__.load({
|
|
|
3561
3573
|
}, face.t("hint"))] : loaded ? null : emptyState(versionsFailed === void 0 ? face.t("loading") : `${face.t("empty.versions.failed")} — ${versionsFailed}`), loaded ? (0, react.createElement)("div", null, group(face.t("group.content"), payload.content, void 0), group(face.t("group.support"), payload.support, face.t("group.support.note")), payload.content.length === 0 && payload.support.length === 0 ? (0, react.createElement)("p", { className: "evo-hist-hint" }, face.t("empty.versions")) : null) : null));
|
|
3562
3574
|
}
|
|
3563
3575
|
/**
|
|
3564
|
-
*
|
|
3576
|
+
* Drop a superseded lazy read ONLY if the entry still belongs to that read.
|
|
3565
3577
|
*
|
|
3566
|
-
*
|
|
3567
|
-
*
|
|
3568
|
-
* later read of that row and leave it saying \u201cloading\u201d until the page is reloaded.
|
|
3578
|
+
* P2-30: deleting by version key alone let a stale reply erase a NEWER read that
|
|
3579
|
+
* had already reached `ready`, leaving the expanded row blank with no retry path.
|
|
3569
3580
|
* @param current - the cache.
|
|
3570
3581
|
* @param key - the version whose entry is dropped.
|
|
3571
|
-
* @
|
|
3582
|
+
* @param ticket - the read that is being abandoned.
|
|
3583
|
+
* @returns a new cache without that entry, or the current cache when it is not ours.
|
|
3572
3584
|
*/
|
|
3585
|
+
function dropIfTicket(current, key, ticket) {
|
|
3586
|
+
return current.get(key)?.ticket === ticket ? without(current, key) : current;
|
|
3587
|
+
}
|
|
3573
3588
|
function without(current, key) {
|
|
3574
3589
|
const next = new Map(current);
|
|
3575
3590
|
next.delete(key);
|
|
@@ -22,22 +22,28 @@ import { type MarkdownWords } from './markdown.ts';
|
|
|
22
22
|
/** What one expanded diff holds: the change, still loading, or a refusal. */
|
|
23
23
|
export type DiffState = {
|
|
24
24
|
kind: 'loading';
|
|
25
|
+
ticket?: number;
|
|
25
26
|
} | {
|
|
26
27
|
kind: 'ready';
|
|
27
28
|
diff: VersionDiffRow;
|
|
29
|
+
ticket?: number;
|
|
28
30
|
} | {
|
|
29
31
|
kind: 'failed';
|
|
30
32
|
message: string;
|
|
33
|
+
ticket?: number;
|
|
31
34
|
};
|
|
32
35
|
/** What one expanded preview holds. */
|
|
33
36
|
export type BodyState = {
|
|
34
37
|
kind: 'loading';
|
|
38
|
+
ticket?: number;
|
|
35
39
|
} | {
|
|
36
40
|
kind: 'ready';
|
|
37
41
|
body: VersionBodyRow;
|
|
42
|
+
ticket?: number;
|
|
38
43
|
} | {
|
|
39
44
|
kind: 'failed';
|
|
40
45
|
message: string;
|
|
46
|
+
ticket?: number;
|
|
41
47
|
};
|
|
42
48
|
/** What the reading face needs: the dictionary seat, plus the two words the platform renderer takes. */
|
|
43
49
|
export interface DocumentFace extends Copy {
|
|
@@ -24,7 +24,7 @@ export interface PendingCardFace {
|
|
|
24
24
|
* U-6 (registry `approvalConfirm`): read PER RENDER, like the entry's own seat probe — a value
|
|
25
25
|
* captured once would pin the gate for the life of the fiber. Absent ⇒ the shipped default `auto`.
|
|
26
26
|
*/
|
|
27
|
-
confirmMode?: () => 'auto' | 'ask'
|
|
27
|
+
confirmMode?: () => 'auto' | 'ask';
|
|
28
28
|
/** G5/W7 S4: the command-face fallback rendered with an unreachable/unauthenticated failure. */
|
|
29
29
|
fallback?: FallbackHint | undefined;
|
|
30
30
|
}
|
|
@@ -35,7 +35,7 @@ export interface PendingCardFace {
|
|
|
35
35
|
* future version must not silently turn the confirmation ON, and a typo must not turn it off. The
|
|
36
36
|
* independent review flagged that this reader had no case at all (P2-11).
|
|
37
37
|
*/
|
|
38
|
-
export declare function confirmModeFrom(user: unknown): 'auto' | 'ask'
|
|
38
|
+
export declare function confirmModeFrom(user: unknown): 'auto' | 'ask';
|
|
39
39
|
/**
|
|
40
40
|
* Render the pending window.
|
|
41
41
|
* @param props - the copy seat and the host calls.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* description, so the settings surface can state both without a hand-written copy.
|
|
6
6
|
*/
|
|
7
7
|
/** The family version this surface belongs to. */
|
|
8
|
-
export declare const FAMILY_VERSION = "0.32.
|
|
8
|
+
export declare const FAMILY_VERSION = "0.32.4";
|
|
9
9
|
/** What this surface is for, in one line. */
|
|
10
|
-
export declare const PACKAGE_PURPOSE = "Web UI umbrella for the evolution family: settings
|
|
10
|
+
export declare const PACKAGE_PURPOSE = "Web UI umbrella for the evolution family: settings and skill-history panels";
|
|
11
11
|
//# sourceMappingURL=generated-about.d.ts.map
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* @module @lmzhen/dsh-evolution-ui/panels/settings/client
|
|
12
12
|
*/
|
|
13
13
|
import type { ReactNode } from 'react';
|
|
14
|
+
import type { ConfigFormLike as KitConfigFormLike, ConfigFormSnapshotLike as KitConfigFormSnapshotLike, ConfigPathOpLike } from '@lmzhen/dsh-evolution-client-kit';
|
|
14
15
|
/** Our card slot, hosted by the section this bundle registers. */
|
|
15
16
|
export declare const CARD_SLOT = "evolution.namespace.card";
|
|
16
17
|
/** The Plugins page's per-row configuration seat (declared by `ui-plugin-manager`). */
|
|
@@ -68,31 +69,12 @@ export interface ParamSectionSource {
|
|
|
68
69
|
*/
|
|
69
70
|
revive(): void;
|
|
70
71
|
}
|
|
71
|
-
/** One ordered field operation
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/** One row's client form state, as `configForms.get(entryId)` reports it. */
|
|
78
|
-
export interface ConfigFormSnapshotLike<T = Record<string, unknown>> {
|
|
79
|
-
status: 'loading' | 'ready' | 'unavailable';
|
|
80
|
-
value: T | undefined;
|
|
81
|
-
/** Composition layer the Host resolved `value` over; what a cleared field reverts to. */
|
|
82
|
-
base: unknown;
|
|
83
|
-
/** Raw user layer: a key's PRESENCE marks the override. */
|
|
84
|
-
user: unknown;
|
|
85
|
-
revision: number | undefined;
|
|
86
|
-
writable: boolean;
|
|
87
|
-
}
|
|
88
|
-
/** One row's client write face (0.2.x `configForms`). */
|
|
89
|
-
export interface ConfigFormLike<T = Record<string, unknown>> {
|
|
90
|
-
getSnapshot(): ConfigFormSnapshotLike<T>;
|
|
91
|
-
subscribe(listener: () => void): () => void;
|
|
92
|
-
set(field: string, value: unknown): Promise<boolean>;
|
|
93
|
-
unset(field: string): Promise<boolean>;
|
|
94
|
-
mutate(ops: readonly SettingsPathOpLike[], expectedRevision?: number): Promise<boolean>;
|
|
95
|
-
}
|
|
72
|
+
/** One ordered field operation; client-kit owns the shape. */
|
|
73
|
+
export type SettingsPathOpLike = ConfigPathOpLike;
|
|
74
|
+
/** One row's client form state; client-kit owns the shape. */
|
|
75
|
+
export type ConfigFormSnapshotLike<T = Record<string, unknown>> = KitConfigFormSnapshotLike<T>;
|
|
76
|
+
/** One row's client write face; client-kit owns the shape. */
|
|
77
|
+
export type ConfigFormLike<T = Record<string, unknown>> = KitConfigFormLike<T>;
|
|
96
78
|
/**
|
|
97
79
|
* The client settings seat, probed rather than injected: a deployment may compose the
|
|
98
80
|
* family without the settings surface, and a REQUIRED inject for a missing service
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-ui",
|
|
3
|
-
"description": "Web UI umbrella for the evolution family: settings
|
|
4
|
-
"version": "0.32.
|
|
3
|
+
"description": "Web UI umbrella for the evolution family: settings and skill-history panels (community build)",
|
|
4
|
+
"version": "0.32.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"react": "^18.2.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@lmzhen/dsh-evolution-client-kit": "^0.32.
|
|
49
|
-
"@lmzhen/dsh-evolution-core": "^0.32.
|
|
50
|
-
"@lmzhen/dsh-evolution-curator": "^0.32.
|
|
48
|
+
"@lmzhen/dsh-evolution-client-kit": "^0.32.4",
|
|
49
|
+
"@lmzhen/dsh-evolution-core": "^0.32.4",
|
|
50
|
+
"@lmzhen/dsh-evolution-curator": "^0.32.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "~18.3.1",
|