@ethisyscore/plugin-ui 1.52.0 → 1.54.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.
@@ -129,7 +129,11 @@ declare const SIDEBAR_MODE: {
129
129
  /** Discriminated input to `useHostSidebarActions`. `mode:"none"` suppresses all plugin-side
130
130
  * contributions without clobbering the static manifest actions. `mode:"actions"` is the
131
131
  * batch-2 Quick Actions shape. `mode:"detail"` is the full detail-nav replacement with title,
132
- * navigation items, back-arrow, and Quick Actions. */
132
+ * navigation items, back-arrow, and Quick Actions.
133
+ *
134
+ * `entityToken` is REQUIRED here — this is the published shape existing consumers narrow
135
+ * against (`input.entityToken` is a `string` after a mode check), unchanged. To let the
136
+ * hook derive the token instead, OMIT the property via {@link HostSidebarDerivedInput}. */
133
137
  type HostSidebarInput = {
134
138
  mode: "none";
135
139
  } | {
@@ -146,6 +150,30 @@ type HostSidebarInput = {
146
150
  backLabel: string;
147
151
  actions: HostSidebarAction[];
148
152
  };
153
+ /** Token-less authoring variants: the hook derives the host-mirrored entity token from the
154
+ * surface base + current location (`deriveHostEntityToken`) — correct by construction, since
155
+ * the host's token guard silently drops a mismatching publish. Prefer these unless you need
156
+ * the bare-entity-id form (which the host segment-matches across an entity's sub-pages).
157
+ * `entityToken?: undefined` (not just absence) is deliberate: an EXPLICIT `undefined`
158
+ * (e.g. `entityToken: maybeToken` with an unresolved token) keeps the long-standing
159
+ * "unresolved token → contribute nothing" semantic and is treated as `mode:"none"`, NOT
160
+ * derived — only a truly ABSENT property derives. */
161
+ type HostSidebarDerivedInput = {
162
+ mode: "actions";
163
+ entityToken?: undefined;
164
+ actions: HostSidebarAction[];
165
+ } | {
166
+ mode: "detail";
167
+ entityToken?: undefined;
168
+ title: string;
169
+ navSectionLabel: string;
170
+ navItems: HostSidebarNavItem[];
171
+ backHref: string;
172
+ backLabel: string;
173
+ actions: HostSidebarAction[];
174
+ };
175
+ /** What `useHostSidebarActions` accepts: the classic explicit-token shape or a derived-token variant. */
176
+ type HostSidebarHookInput = HostSidebarInput | HostSidebarDerivedInput;
149
177
  /**
150
178
  * Publish contextual sidebar contributions from a PlatformReact page to the host sidebar, and
151
179
  * receive click dispatch by id. Accepts a discriminated `HostSidebarInput`:
@@ -156,6 +184,6 @@ type HostSidebarInput = {
156
184
  * Serializable descriptors only cross to the host; the inline `onSelect` handlers stay in a
157
185
  * ref-map here and are always the latest closure. Fails closed (no publish/subscribe, no throw)
158
186
  * when the host predates or is incompatible with the seam. */
159
- declare function useHostSidebarActions(input: HostSidebarInput): void;
187
+ declare function useHostSidebarActions(input: HostSidebarHookInput): void;
160
188
 
161
- export { HOST_CHROME_CONTRACT_VERSION as H, SIDEBAR_MODE as S, type HostChromeDiagnostic as a, type HostSidebarAction as b, type HostSidebarActionDescriptor as c, type HostSidebarActionSlot as d, type HostSidebarActionVariant as e, type HostSidebarActionsApi as f, type HostSidebarActionsCapabilities as g, HostSidebarActionsContext as h, type HostSidebarActionsPageProps as i, type HostSidebarContribution as j, type HostSidebarInput as k, type HostSidebarNavItem as l, isHostChromeCompatible as m, reportHostChromeDiagnostic as r, setHostChromeDiagnosticSink as s, useHostSidebarActions as u };
189
+ export { HOST_CHROME_CONTRACT_VERSION as H, SIDEBAR_MODE as S, type HostChromeDiagnostic as a, type HostSidebarAction as b, type HostSidebarActionDescriptor as c, type HostSidebarActionSlot as d, type HostSidebarActionVariant as e, type HostSidebarActionsApi as f, type HostSidebarActionsCapabilities as g, HostSidebarActionsContext as h, type HostSidebarActionsPageProps as i, type HostSidebarContribution as j, type HostSidebarInput as k, type HostSidebarNavItem as l, isHostChromeCompatible as m, type HostSidebarHookInput as n, type HostSidebarDerivedInput as o, reportHostChromeDiagnostic as r, setHostChromeDiagnosticSink as s, useHostSidebarActions as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethisyscore/plugin-ui",
3
- "version": "1.52.0",
3
+ "version": "1.54.0",
4
4
  "description": "Plugin-UI umbrella SDK: client bridge + a11y/l10n primitives + brokered-MCP client (WI 4858).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",