@lmzhen/dsh-evolution-client-kit 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.
- package/lib/index.js +3 -1
- package/lib/types/panel.d.ts +7 -0
- package/lib/types/panel.js +7 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -61,7 +61,9 @@ function registerSidebarPanel(ctx, spec) {
|
|
|
61
61
|
yield seam.slots.register({
|
|
62
62
|
name: "main",
|
|
63
63
|
key: spec.id,
|
|
64
|
-
inject: () => spec.body(t)
|
|
64
|
+
inject: () => spec.body(t),
|
|
65
|
+
...spec.children === void 0 ? {} : { children: spec.children },
|
|
66
|
+
...spec.store === void 0 ? {} : { store: spec.store }
|
|
65
67
|
}, spec.component);
|
|
66
68
|
});
|
|
67
69
|
}
|
package/lib/types/panel.d.ts
CHANGED
|
@@ -34,6 +34,13 @@ export interface SidebarPanelSpec<Face> {
|
|
|
34
34
|
component: (props: never) => ReactNode;
|
|
35
35
|
/** The body face factory; receives the bound translator. */
|
|
36
36
|
body: (t: Translate) => Face;
|
|
37
|
+
/** Child slots the main keyed occupant declares (the rc.3 main contract). */
|
|
38
|
+
children?: Readonly<Record<string, {
|
|
39
|
+
readonly kind: 'list' | 'keyed';
|
|
40
|
+
readonly scope: 'root';
|
|
41
|
+
}>>;
|
|
42
|
+
/** Optional store owned by this registration; the platform binds it to the occupant. */
|
|
43
|
+
store?: unknown;
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
46
|
* Register one sidebar row and its main body under one lifecycle.
|
package/lib/types/panel.js
CHANGED
|
@@ -52,7 +52,13 @@ export function registerSidebarPanel(ctx, spec) {
|
|
|
52
52
|
const label = () => lookup('entry.label');
|
|
53
53
|
seam.slots.inject('sidebar.panellist', function* () {
|
|
54
54
|
yield seam.slots.register({ name: 'sidebar.panellist', id: spec.id, order: spec.order, label }, spec.icon);
|
|
55
|
-
yield seam.slots.register({
|
|
55
|
+
yield seam.slots.register({
|
|
56
|
+
name: 'main',
|
|
57
|
+
key: spec.id,
|
|
58
|
+
inject: () => spec.body(t),
|
|
59
|
+
...(spec.children === undefined ? {} : { children: spec.children }),
|
|
60
|
+
...(spec.store === undefined ? {} : { store: spec.store }),
|
|
61
|
+
}, spec.component);
|
|
56
62
|
});
|
|
57
63
|
}
|
|
58
64
|
//# sourceMappingURL=panel.js.map
|
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.
|
|
4
|
+
"version": "0.33.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|