@lmzhen/dsh-evolution-ui 0.32.6 → 0.34.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/lib/client.js +738 -595
- package/lib/types/panels/history/client/Workbench.d.ts +11 -24
- package/lib/types/panels/history/client/WorkbenchStore.d.ts +16 -0
- package/lib/types/panels/history/client/index.d.ts +1 -1
- package/lib/types/panels/settings/ParamCard.d.ts +4 -9
- package/lib/types/panels/settings/generated-about.d.ts +1 -1
- package/lib/types/panels/settings/messages.d.ts +6 -0
- package/lib/types/panels/settings/seam.d.ts +20 -2
- package/lib/types/panels/settings/source.d.ts +2 -1
- package/package.json +4 -4
|
@@ -6,48 +6,35 @@
|
|
|
6
6
|
import { type ReactNode } from 'react';
|
|
7
7
|
import { type PanelFace } from './Panel.ts';
|
|
8
8
|
import { type PendingCardFace } from '../../settings/PendingCard.ts';
|
|
9
|
+
import { type DiagnosticsCardFace } from '../../settings/DiagnosticsCard.ts';
|
|
10
|
+
import type { WorkbenchStore } from './WorkbenchStore.ts';
|
|
9
11
|
/** Stable page id used by the sidebar row, the page slot key, and navigation params. */
|
|
10
12
|
export declare const WORKBENCH_ID = "evolution.workbench";
|
|
11
|
-
/** Owner props supplied by the platform page slot. */
|
|
12
|
-
export interface WorkbenchOwner {
|
|
13
|
-
readonly pageId: string;
|
|
14
|
-
readonly params?: Readonly<Record<string, string | number | boolean | null>> | undefined;
|
|
15
|
-
readonly revision?: number | undefined;
|
|
16
|
-
}
|
|
17
13
|
/** Injected face: copy plus the history view's data callbacks. */
|
|
18
14
|
export interface WorkbenchFace {
|
|
19
15
|
readonly t: (key: string) => string;
|
|
16
|
+
readonly store: WorkbenchStore;
|
|
20
17
|
readonly history: PanelFace;
|
|
21
18
|
readonly pending: PendingCardFace;
|
|
19
|
+
readonly diagnostics: DiagnosticsCardFace;
|
|
22
20
|
/** Whether a feature view is actually mounted (health is disabled by default). */
|
|
23
21
|
readonly hasView?: (view: 'merge' | 'health') => boolean;
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
export type WorkbenchView = 'history' | 'pending' | 'merge' | 'health';
|
|
27
|
-
/** Sidebar row owner props supplied by the platform list slot. */
|
|
28
|
-
export interface WorkbenchNavOwner {
|
|
29
|
-
readonly activePageId: string | null;
|
|
30
|
-
readonly openPage: (pageId: string) => void;
|
|
31
|
-
}
|
|
32
|
-
/** Sidebar row injected face. */
|
|
33
|
-
export interface WorkbenchNavFace {
|
|
34
|
-
readonly t: (key: string) => string;
|
|
35
|
-
}
|
|
23
|
+
export type { WorkbenchView } from './WorkbenchStore.ts';
|
|
36
24
|
/**
|
|
37
25
|
* Render the workbench page. The platform keeps it mounted; this component only
|
|
38
26
|
* consumes a new explicit revision exactly once.
|
|
39
27
|
* @param props - page owner props plus the injected history face.
|
|
40
28
|
* @returns the page surface.
|
|
41
29
|
*/
|
|
42
|
-
export declare function WorkbenchPage(props:
|
|
30
|
+
export declare function WorkbenchPage(props: WorkbenchFace & {
|
|
43
31
|
readonly renderSlot?: (name: string, owner: Record<string, unknown>) => ReactNode;
|
|
44
32
|
}): ReactNode;
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export declare function WorkbenchNav(props: WorkbenchNavOwner & WorkbenchNavFace): ReactNode;
|
|
33
|
+
/** The sidebar icon; the platform renders the row label, tooltip and active state. */
|
|
34
|
+
export declare function WorkbenchIcon(props: {
|
|
35
|
+
size?: number;
|
|
36
|
+
active?: boolean;
|
|
37
|
+
}): ReactNode;
|
|
51
38
|
/** Workbench shell and sidebar row; colours come from the platform tokens. */
|
|
52
39
|
export declare const WORKBENCH_CSS: string;
|
|
53
40
|
//# sourceMappingURL=Workbench.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Registration-owned workbench navigation state. No module-level singleton. */
|
|
2
|
+
export type WorkbenchView = 'history' | 'pending' | 'merge' | 'health' | 'diagnostics';
|
|
3
|
+
export interface WorkbenchState {
|
|
4
|
+
readonly view: WorkbenchView;
|
|
5
|
+
readonly selectedSkill?: string;
|
|
6
|
+
readonly focusRevision: number;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkbenchStore {
|
|
9
|
+
getState(): WorkbenchState;
|
|
10
|
+
subscribe(listener: () => void): () => void;
|
|
11
|
+
setView(view: WorkbenchView): void;
|
|
12
|
+
openHistory(skill?: string): void;
|
|
13
|
+
clearSelection(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function createWorkbenchStore(initial?: WorkbenchState): WorkbenchStore;
|
|
16
|
+
//# sourceMappingURL=WorkbenchStore.d.ts.map
|
|
@@ -8,7 +8,7 @@ export { PANEL_ORDER };
|
|
|
8
8
|
/** Required client services: the slot registry and the locale seat. */
|
|
9
9
|
export declare const inject: string[];
|
|
10
10
|
/**
|
|
11
|
-
* Register the locale namespace, the workbench
|
|
11
|
+
* Register the locale namespace, the workbench main occupant and its sidebar row.
|
|
12
12
|
* @param ctx - client cordis context.
|
|
13
13
|
*/
|
|
14
14
|
export declare function apply(ctx: ClientContext): void;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { type ReactNode } from 'react';
|
|
17
17
|
import type { ClientParamField } from './generated-params.ts';
|
|
18
18
|
import { type MessageKey } from './messages.ts';
|
|
19
|
-
import type { ParamSectionSnapshot, ParamSectionSource, SettingsPathOpLike } from './seam.ts';
|
|
19
|
+
import type { ParamSectionSnapshot, ParamSectionSource, SettingsPathOpLike, SettingsSaveResult } from './seam.ts';
|
|
20
20
|
/**
|
|
21
21
|
* Injected face: plain data and callbacks, plus the hook seat.
|
|
22
22
|
*
|
|
@@ -34,6 +34,8 @@ export interface ParamCardFace {
|
|
|
34
34
|
/** ONE call per save, carrying every dirty field as one op list (T5-01/A56). The returned boolean IS
|
|
35
35
|
* the Host's verdict (contract C2/G5): `true` = accepted, `false` = refused after its recovery read. */
|
|
36
36
|
mutateOnce: (ops: readonly SettingsParamOp[]) => Promise<boolean>;
|
|
37
|
+
/** Structured write result; when present the card distinguishes acceptance from readback. */
|
|
38
|
+
saveOnce?: (ops: readonly SettingsParamOp[]) => Promise<SettingsSaveResult>;
|
|
37
39
|
clear: (field: string) => Promise<boolean>;
|
|
38
40
|
hooks: {
|
|
39
41
|
paramSection: ParamSectionSource;
|
|
@@ -91,6 +93,7 @@ export interface ParamCardViewProps {
|
|
|
91
93
|
lang?: () => ParamLanguage;
|
|
92
94
|
/** ONE call per save, carrying every dirty field as one op list (T5-01/A56). */
|
|
93
95
|
mutateOnce: (ops: readonly SettingsParamOp[]) => Promise<boolean>;
|
|
96
|
+
saveOnce?: (ops: readonly SettingsParamOp[]) => Promise<SettingsSaveResult>;
|
|
94
97
|
/** Ask the scope to drop one override; resolves when the scope answered, not when it landed. */
|
|
95
98
|
clear: (field: string) => Promise<boolean>;
|
|
96
99
|
/** The current row state, from whichever source owns it (the bound hook or the page). */
|
|
@@ -102,14 +105,6 @@ export interface ParamCardViewProps {
|
|
|
102
105
|
* @returns the card.
|
|
103
106
|
*/
|
|
104
107
|
export declare function ParamCardView(props: ParamCardViewProps): ReactNode;
|
|
105
|
-
/**
|
|
106
|
-
* Register a plugin-surface form source by namespace. The platform's
|
|
107
|
-
* `settings.plugin.item` slot does not bind the card's `hooks` compartment, so
|
|
108
|
-
* the owning settings apply hands the stable source here instead.
|
|
109
|
-
* @param namespace - settings namespace.
|
|
110
|
-
* @param source - the stable external-store source.
|
|
111
|
-
*/
|
|
112
|
-
export declare function registerPluginParamSource(namespace: string, source: ParamSectionSource): void;
|
|
113
108
|
export declare function PluginParamCard(props: ParamCardFace): ReactNode;
|
|
114
109
|
export declare function ParamCard(props: ParamCardProps): ReactNode;
|
|
115
110
|
//# sourceMappingURL=ParamCard.d.ts.map
|
|
@@ -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.
|
|
8
|
+
export declare const FAMILY_VERSION = "0.34.0";
|
|
9
9
|
/** What this surface is for, in one line. */
|
|
10
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
|
|
@@ -34,10 +34,14 @@ export declare const zh: {
|
|
|
34
34
|
readonly invalidSelect: "不在允许的取值里";
|
|
35
35
|
readonly invalidAtLeast: "不能小于同组的 {n}";
|
|
36
36
|
readonly approvalConfirmNamed: "即将批准:{n}";
|
|
37
|
+
readonly approvalRawSummary: "原始摘要";
|
|
37
38
|
readonly approvalConfirmYes: "确认批准";
|
|
38
39
|
readonly approvalConfirmNo: "取消";
|
|
39
40
|
readonly resetTo: "复位为 {value}";
|
|
40
41
|
readonly saved: "已保存。";
|
|
42
|
+
readonly saveReadbackFailed: "写入已被接受,但回读失败;点刷新重读后再确认。";
|
|
43
|
+
readonly readbackStale: "显示的是最后一次成功读取的值;当前回读失败,刷新后可能变化。";
|
|
44
|
+
readonly saveConflict: "这个值没有被接受:设置已被其他页面修改。请重读后再保存。";
|
|
41
45
|
readonly resetDone: "已恢复默认值。";
|
|
42
46
|
readonly refused: "这个值没有被接受(界面上保持原样)。想看原因:在对话里让它说明。";
|
|
43
47
|
readonly resetRefused: "恢复默认值没有生效(这一行还是你的值)。想看原因:在对话里让它说明。";
|
|
@@ -105,6 +109,8 @@ export declare const zh: {
|
|
|
105
109
|
readonly diagStatusUnknown: "未知";
|
|
106
110
|
readonly diagRemedy: "建议:";
|
|
107
111
|
readonly diagNoRows: "没有可显示的运行状态";
|
|
112
|
+
readonly diagPurpose: "用途:检查插件挂载、平台服务和数据面是否正常,不修改任何状态。";
|
|
113
|
+
readonly diagFooter: "诊断 schema v{version} · 生成于 {at}";
|
|
108
114
|
readonly stateLoading: "正在读取…";
|
|
109
115
|
readonly failureUnauthorized: "需要登录:重新打开这个页面完成登录后再试。";
|
|
110
116
|
readonly failureForbidden: "平台拒绝了这个请求(身份不是 owner)。";
|
|
@@ -24,6 +24,13 @@ export declare const CARD_SLOT = "evolution.namespace.card";
|
|
|
24
24
|
export declare const PENDING_CARD_KEY = "approval-pending";
|
|
25
25
|
/** The diagnostics card's slot key: read-only, no settings namespace (its data comes from HOST_ROUTES.diagnostics). */
|
|
26
26
|
export declare const DIAGNOSTICS_CARD_KEY = "diagnostics";
|
|
27
|
+
/** Structured result of one settings write, separating acceptance from readback. */
|
|
28
|
+
export interface SettingsSaveResult {
|
|
29
|
+
readonly written: boolean;
|
|
30
|
+
readonly readback: 'ok' | 'failed';
|
|
31
|
+
readonly kind?: 'conflict' | 'transport' | 'validation';
|
|
32
|
+
readonly failure?: unknown;
|
|
33
|
+
}
|
|
27
34
|
/** Snapshot of one settings row, as the client seat reports it. */
|
|
28
35
|
export interface ParamSectionSnapshot {
|
|
29
36
|
status: 'loading' | 'ready' | 'unavailable';
|
|
@@ -38,7 +45,9 @@ export interface ParamSectionSnapshot {
|
|
|
38
45
|
* all, or the seat is there and serves no such row. The two read differently to the
|
|
39
46
|
* operator (one is the UI's own gap, the other is a row that is not composed).
|
|
40
47
|
*/
|
|
41
|
-
reason?: 'seat-missing' | 'not-served' | 'projection-failed';
|
|
48
|
+
reason?: 'seat-missing' | 'not-served' | 'projection-failed' | 'readback-failed';
|
|
49
|
+
/** Last-known values are still shown; the row could not be re-read. */
|
|
50
|
+
stale?: boolean;
|
|
42
51
|
}
|
|
43
52
|
/** The reactive source the renderer binds to a `use<Name>` seat. */
|
|
44
53
|
export interface ParamSectionSource {
|
|
@@ -85,6 +94,15 @@ export interface PluginItemRegisterOptions {
|
|
|
85
94
|
locale: string;
|
|
86
95
|
inject: () => unknown;
|
|
87
96
|
}
|
|
97
|
+
/** Options a `settings.plugins.tab` contribution carries (rc.3 plugin settings page). */
|
|
98
|
+
export interface PluginsTabRegisterOptions {
|
|
99
|
+
name: 'settings.plugins.tab';
|
|
100
|
+
id: string;
|
|
101
|
+
order: number;
|
|
102
|
+
label: () => string;
|
|
103
|
+
locale: string;
|
|
104
|
+
inject: () => unknown;
|
|
105
|
+
}
|
|
88
106
|
/** Options a `settings.section` registration carries (the shell's own shape). */
|
|
89
107
|
export interface SectionRegisterOptions {
|
|
90
108
|
name: 'settings.section';
|
|
@@ -138,7 +156,7 @@ export interface LocaleSeat {
|
|
|
138
156
|
export interface ClientSeam {
|
|
139
157
|
slots: {
|
|
140
158
|
inject(name: string, callback: () => Generator<unknown, void, unknown>): unknown;
|
|
141
|
-
register(options: SlotRegisterOptions | PluginItemRegisterOptions | SectionRegisterOptions, component: (props: never) => unknown): () => void;
|
|
159
|
+
register(options: SlotRegisterOptions | PluginItemRegisterOptions | PluginsTabRegisterOptions | SectionRegisterOptions, component: (props: never) => unknown): () => void;
|
|
142
160
|
};
|
|
143
161
|
locale: LocaleSeat;
|
|
144
162
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* apply time would capture `undefined` for the whole life of the fiber.
|
|
23
23
|
* @module @lmzhen/dsh-evolution-ui/panels/settings/client
|
|
24
24
|
*/
|
|
25
|
-
import type { ConfigFormLike, ConfigFormSnapshotLike, ConfigFormsSeat, ParamSectionSnapshot, ParamSectionSource, SettingsPathOpLike } from './seam.ts';
|
|
25
|
+
import type { ConfigFormLike, ConfigFormSnapshotLike, ConfigFormsSeat, ParamSectionSnapshot, ParamSectionSource, SettingsPathOpLike, SettingsSaveResult } from './seam.ts';
|
|
26
26
|
/** What a card shows when this UI found no settings seat at all. */
|
|
27
27
|
export declare const SEAT_MISSING: ParamSectionSnapshot;
|
|
28
28
|
/** What a card shows when the seat served the row but projecting it failed. A frozen constant
|
|
@@ -67,6 +67,7 @@ export declare function sourceFor(probe: SeatProbe, namespace: string): ParamSec
|
|
|
67
67
|
*/
|
|
68
68
|
export declare function writeFaceFor(probe: SeatProbe, namespace: string): {
|
|
69
69
|
mutateOnce: (ops: readonly SettingsPathOpLike[]) => Promise<boolean>;
|
|
70
|
+
saveOnce: (ops: readonly SettingsPathOpLike[]) => Promise<SettingsSaveResult>;
|
|
70
71
|
clear: (field: string) => Promise<boolean>;
|
|
71
72
|
};
|
|
72
73
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-ui",
|
|
3
3
|
"description": "Web UI umbrella for the evolution family: settings and skill-history panels (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.0",
|
|
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.
|
|
49
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
50
|
-
"@lmzhen/dsh-evolution-curator": "^0.
|
|
48
|
+
"@lmzhen/dsh-evolution-client-kit": "^0.34.0",
|
|
49
|
+
"@lmzhen/dsh-evolution-core": "^0.34.0",
|
|
50
|
+
"@lmzhen/dsh-evolution-curator": "^0.34.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "~18.3.1",
|