@lmzhen/dsh-evolution-client-kit 0.32.3 → 0.32.5
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 +16 -6
- package/lib/index.js +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/panel.js +4 -2
- package/lib/types/seam.d.ts +17 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# @lmzhen/dsh-evolution-client-kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
It owns the client contract types, generated route/state/contract tables, design tokens, and
|
|
5
|
-
one `registerSidebarPanel` entry point that installs the locale, stylesheet, row, and keyed
|
|
6
|
-
main body. It is a library, not a plugin row: it declares no `dsh.client` entry.
|
|
3
|
+
> 内部组件,支撑侧栏面板与接口。
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
## 你会看到
|
|
6
|
+
|
|
7
|
+
没有命令、面板或工具入口。
|
|
8
|
+
|
|
9
|
+
## 什么时候会用到
|
|
10
|
+
|
|
11
|
+
只在开发/排障面板时。
|
|
12
|
+
|
|
13
|
+
## 默认 / 前提
|
|
14
|
+
|
|
15
|
+
随客户端包自动工作。
|
|
16
|
+
|
|
17
|
+
## 边界
|
|
18
|
+
|
|
19
|
+
普通用户不需要知道。
|
package/lib/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function interpolate(text, values) {
|
|
|
10
10
|
}
|
|
11
11
|
function injectStyles(doc, css, tagId) {
|
|
12
12
|
if (doc === void 0) return () => {};
|
|
13
|
-
|
|
13
|
+
doc.querySelector("style[data-plugin-css=\"" + tagId + "\"]")?.remove();
|
|
14
14
|
const tag = doc.createElement("style");
|
|
15
15
|
tag.setAttribute("data-plugin-css", tagId);
|
|
16
16
|
tag.textContent = css;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Shared browser seams and panel lifecycle for the evolution family. */
|
|
2
|
-
export type { ClientSeam, ConfigFormLike, ConfigFormSnapshotLike, ConfigFormsSeat, LocaleSeat, PanelBodyOptions, PanelRowOptions, SettingsFace, SlotsSeat } from './seam.ts';
|
|
2
|
+
export type { ClientSeam, ConfigFormLike, ConfigFormSnapshotLike, ConfigFormsSeat, ConfigPathOpLike, LocaleSeat, PanelBodyOptions, PanelRowOptions, SettingsFace, SlotsSeat } from './seam.ts';
|
|
3
3
|
export { registerSidebarPanel, type SidebarPanelSpec, type Translate } from './panel.ts';
|
|
4
4
|
export { panelWorkspaceId } from './workspace.ts';
|
|
5
5
|
export { ROUTES } from './generated/routes.generated.ts';
|
package/lib/types/panel.js
CHANGED
|
@@ -6,8 +6,10 @@ function interpolate(text, values) {
|
|
|
6
6
|
function injectStyles(doc, css, tagId) {
|
|
7
7
|
if (doc === undefined)
|
|
8
8
|
return () => { };
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const previous = doc.querySelector('style[data-plugin-css="' + tagId + '"]');
|
|
10
|
+
// P2-29: a new owner must OUTLIVE the old owner's disposer. Replace the tag
|
|
11
|
+
// instead of reusing it: the old disposer then removes a detached node.
|
|
12
|
+
previous?.remove();
|
|
11
13
|
const tag = doc.createElement('style');
|
|
12
14
|
tag.setAttribute('data-plugin-css', tagId);
|
|
13
15
|
tag.textContent = css;
|
package/lib/types/seam.d.ts
CHANGED
|
@@ -40,18 +40,30 @@ export interface ClientSeam {
|
|
|
40
40
|
slots: SlotsSeat;
|
|
41
41
|
locale: LocaleSeat;
|
|
42
42
|
}
|
|
43
|
+
/** One atomic path operation on a config form (the platform's mutate vocabulary). */
|
|
44
|
+
export interface ConfigPathOpLike {
|
|
45
|
+
readonly op: 'set' | 'unset';
|
|
46
|
+
readonly path: readonly string[];
|
|
47
|
+
readonly value?: unknown;
|
|
48
|
+
}
|
|
43
49
|
/** One client settings row's readable/writable face (platform configForms). */
|
|
44
|
-
export interface ConfigFormSnapshotLike {
|
|
50
|
+
export interface ConfigFormSnapshotLike<T = Record<string, unknown>> {
|
|
45
51
|
status: 'loading' | 'ready' | 'unavailable';
|
|
46
|
-
value:
|
|
52
|
+
value: T | undefined;
|
|
53
|
+
/** Composition layer the Host resolved `value` over; what a cleared field reverts to. */
|
|
54
|
+
base: unknown;
|
|
55
|
+
/** Raw user layer: a key's PRESENCE marks the override. */
|
|
56
|
+
user: unknown;
|
|
47
57
|
writable: boolean;
|
|
48
|
-
revision
|
|
58
|
+
revision: number | undefined;
|
|
49
59
|
}
|
|
50
|
-
export interface ConfigFormLike {
|
|
51
|
-
getSnapshot(): ConfigFormSnapshotLike
|
|
60
|
+
export interface ConfigFormLike<T = Record<string, unknown>> {
|
|
61
|
+
getSnapshot(): ConfigFormSnapshotLike<T>;
|
|
52
62
|
subscribe(listener: () => void): () => void;
|
|
53
63
|
set(field: string, value: unknown): Promise<boolean>;
|
|
54
64
|
unset(field: string): Promise<boolean>;
|
|
65
|
+
/** Atomic multi-field save; `expectedRevision` is the read the caller is replacing. */
|
|
66
|
+
mutate(ops: readonly ConfigPathOpLike[], expectedRevision?: number): Promise<boolean>;
|
|
55
67
|
}
|
|
56
68
|
export interface ConfigFormsSeat {
|
|
57
69
|
get(entryId: string): ConfigFormLike;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-client-kit",
|
|
3
3
|
"description": "Shared browser seams and lifecycle for the evolution family sidebar panels (community build)",
|
|
4
|
-
"version": "0.32.
|
|
4
|
+
"version": "0.32.5",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|