@lmzhen/dsh-evolution-ui 0.32.6 → 0.33.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.
@@ -6,29 +6,20 @@
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';
9
10
  /** Stable page id used by the sidebar row, the page slot key, and navigation params. */
10
11
  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
12
  /** Injected face: copy plus the history view's data callbacks. */
18
13
  export interface WorkbenchFace {
19
14
  readonly t: (key: string) => string;
20
15
  readonly history: PanelFace;
21
16
  readonly pending: PendingCardFace;
17
+ readonly diagnostics: DiagnosticsCardFace;
22
18
  /** Whether a feature view is actually mounted (health is disabled by default). */
23
19
  readonly hasView?: (view: 'merge' | 'health') => boolean;
24
20
  }
25
21
  /** The two views the workbench owns today. */
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
- }
22
+ export type WorkbenchView = 'history' | 'pending' | 'merge' | 'health' | 'diagnostics';
32
23
  /** Sidebar row injected face. */
33
24
  export interface WorkbenchNavFace {
34
25
  readonly t: (key: string) => string;
@@ -39,15 +30,14 @@ export interface WorkbenchNavFace {
39
30
  * @param props - page owner props plus the injected history face.
40
31
  * @returns the page surface.
41
32
  */
42
- export declare function WorkbenchPage(props: WorkbenchOwner & WorkbenchFace & {
33
+ export declare function WorkbenchPage(props: WorkbenchFace & {
43
34
  readonly renderSlot?: (name: string, owner: Record<string, unknown>) => ReactNode;
44
35
  }): ReactNode;
45
- /**
46
- * Render the sidebar entry that opens the workbench.
47
- * @param props - active page id, opener, and copy.
48
- * @returns the row button.
49
- */
50
- export declare function WorkbenchNav(props: WorkbenchNavOwner & WorkbenchNavFace): ReactNode;
36
+ /** The sidebar icon; the platform renders the row label, tooltip and active state. */
37
+ export declare function WorkbenchIcon(props: {
38
+ size?: number;
39
+ active?: boolean;
40
+ }): ReactNode;
51
41
  /** Workbench shell and sidebar row; colours come from the platform tokens. */
52
42
  export declare const WORKBENCH_CSS: string;
53
43
  //# sourceMappingURL=Workbench.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 page, and its sidebar entry.
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.32.6";
8
+ export declare const FAMILY_VERSION = "0.33.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,13 @@ 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 saveConflict: "这个值没有被接受:设置已被其他页面修改。请重读后再保存。";
41
44
  readonly resetDone: "已恢复默认值。";
42
45
  readonly refused: "这个值没有被接受(界面上保持原样)。想看原因:在对话里让它说明。";
43
46
  readonly resetRefused: "恢复默认值没有生效(这一行还是你的值)。想看原因:在对话里让它说明。";
@@ -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';
@@ -85,6 +92,15 @@ export interface PluginItemRegisterOptions {
85
92
  locale: string;
86
93
  inject: () => unknown;
87
94
  }
95
+ /** Options a `settings.plugins.tab` contribution carries (rc.3 plugin settings page). */
96
+ export interface PluginsTabRegisterOptions {
97
+ name: 'settings.plugins.tab';
98
+ id: string;
99
+ order: number;
100
+ label: () => string;
101
+ locale: string;
102
+ inject: () => unknown;
103
+ }
88
104
  /** Options a `settings.section` registration carries (the shell's own shape). */
89
105
  export interface SectionRegisterOptions {
90
106
  name: 'settings.section';
@@ -138,7 +154,7 @@ export interface LocaleSeat {
138
154
  export interface ClientSeam {
139
155
  slots: {
140
156
  inject(name: string, callback: () => Generator<unknown, void, unknown>): unknown;
141
- register(options: SlotRegisterOptions | PluginItemRegisterOptions | SectionRegisterOptions, component: (props: never) => unknown): () => void;
157
+ register(options: SlotRegisterOptions | PluginItemRegisterOptions | PluginsTabRegisterOptions | SectionRegisterOptions, component: (props: never) => unknown): () => void;
142
158
  };
143
159
  locale: LocaleSeat;
144
160
  }
@@ -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.32.6",
4
+ "version": "0.33.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.32.6",
49
- "@lmzhen/dsh-evolution-core": "^0.32.6",
50
- "@lmzhen/dsh-evolution-curator": "^0.32.6"
48
+ "@lmzhen/dsh-evolution-client-kit": "^0.33.0",
49
+ "@lmzhen/dsh-evolution-core": "^0.33.0",
50
+ "@lmzhen/dsh-evolution-curator": "^0.33.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "~18.3.1",