@ethisyscore/components-react 1.48.0 → 1.49.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/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/navigation.ts","../src/toast.ts","../src/index.ts"],"names":[],"mappings":";;;AAmBO,SAAS,eAAe,EAAA,EAAkB;AAC/C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAM,KAAA,GAAQ,IAAI,WAAA,CAAY,kBAAA,EAAoB;AAAA,IAChD,MAAA,EAAQ,EAAE,EAAA,EAAG;AAAA,IACb,UAAA,EAAY;AAAA,GACb,CAAA;AACD,EAAA,MAAA,CAAO,cAAc,KAAK,CAAA;AAG1B,EAAA,IAAI,CAAC,MAAM,gBAAA,EAAkB;AAC3B,IAAA,MAAA,CAAO,QAAA,CAAS,OAAO,EAAE,CAAA;AAAA,EAC3B;AACF;;;ACFO,SAAS,UAAU,KAAA,EAA2B;AACnD,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAA,CAAO,aAAA,CAAc,IAAI,WAAA,CAA0B,eAAA,EAAiB,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAC,CAAA;AACxF;;;AC6HO,SAAS,wBACd,SAAA,EACkB;AAClB,EAAA,OAAO,SAAA;AACT","file":"index.cjs","sourcesContent":["/**\n * Host navigation bridge for PlatformReact pages (RFC 0003).\n *\n * PlatformReact pages run inside the host's React tree but cannot import the\n * host's `useNavigate` directly — that would couple the plugin's bundle to\n * the host's router internals and break the realm boundary the contract\n * preserves. Instead, plugins dispatch a `CustomEvent(\"ethisys:navigate\")`\n * on `window`; the host's `useExtensionNavigation` listener intercepts the\n * event and translates it into a React Router push.\n *\n * `cancelable: true` is load-bearing — without it the host's\n * `event.preventDefault()` is a no-op (CustomEvent defaults to\n * non-cancelable), so `defaultPrevented` stays `false`, the\n * `window.location.assign` fallback fires AFTER the SPA navigation has\n * already run, and the user sees an unwanted full-page reload. The flag is\n * the entire contract between plugin and host on this seam, which is why\n * the helper exists — getting it right per-plugin is exactly the kind of\n * detail that should be baked into the SDK rather than the README.\n */\nexport function emitNavigation(to: string): void {\n if (typeof window === \"undefined\") {\n return;\n }\n const event = new CustomEvent(\"ethisys:navigate\", {\n detail: { to },\n cancelable: true,\n });\n window.dispatchEvent(event);\n // Fallback for hosts that haven't wired the listener yet — full-document\n // navigation isn't ideal but keeps the page functional.\n if (!event.defaultPrevented) {\n window.location.assign(to);\n }\n}\n","/**\n * Host toast bridge for PlatformReact pages (RFC 0003).\n *\n * Symmetric with {@link emitNavigation}: a PlatformReact page runs\n * inside the host realm but cannot import the host's toast system directly — the\n * host renders toasts with a single app-global toaster (a module singleton) that\n * is not in the host module registry, so a plugin can neither import it nor\n * safely bundle its own (a second instance would dispatch to a different store\n * and nothing would show). Instead the plugin dispatches a typed\n * `CustomEvent<ToastRequest>` named `ethisys:toast` on `window`; the host\n * subscribes once at the authenticated shell (`useExtensionToast`) and forwards\n * each event to its toaster.\n *\n * Unlike navigation there is no fallback: a dropped toast (no host listener —\n * e.g. a Storybook/dev mount) is non-fatal UX, so the helper stays fire-and-forget.\n */\nexport type ToastVariant = \"default\" | \"success\" | \"error\" | \"warning\";\n\n/** The payload carried on the `ethisys:toast` event. */\nexport interface ToastRequest {\n /** Primary line. Required — an empty title is ignored by the host listener. */\n title: string;\n /** Optional secondary line. */\n description?: string;\n /** Visual style; the host maps it to its toaster's success/error/warning/default. */\n variant?: ToastVariant;\n}\n\n/**\n * Raise a host toast from a PlatformReact page. No-ops outside a browser (SSR).\n */\nexport function showToast(toast: ToastRequest): void {\n if (typeof window === \"undefined\") {\n return;\n }\n window.dispatchEvent(new CustomEvent<ToastRequest>(\"ethisys:toast\", { detail: toast }));\n}\n","import type { ComponentType } from \"react\";\n\n// ── Sidebar-actions structural types ──────────────────────────────\n// Declared here (the dependency-neutral package both the host and plugin-ui import)\n// so PlatformReactPageProps.hostSidebar is fully typed without a\n// components-react → plugin-ui import. plugin-ui's concrete HostSidebarActionsApi /\n// HostSidebarActionDescriptor are structurally assignable to these *Shape types;\n// plugin-ui's bridge casts once at the seam.\n\n/** Sidebar-action placement slot (dependency-neutral mirror of plugin-ui's `HostSidebarActionSlot`). */\nexport type HostSidebarActionSlotShape = \"primary\" | \"overflow\" | \"sidebar-only\";\n\n/** Sidebar-action visual variant (dependency-neutral mirror of plugin-ui's `HostSidebarActionVariant`). */\nexport type HostSidebarActionVariantShape = \"default\" | \"danger\";\n\n/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles). */\nexport type HostSidebarActionKindShape = \"navigate\" | \"dispatch\";\n\n/**\n * Serializable sidebar-action descriptor shape. Declared in `components-react`\n * (the dependency-neutral boundary) so `PlatformReactPageProps.hostSidebar` is\n * fully typed without a `components-react → plugin-ui` dependency.\n * `plugin-ui`'s concrete `HostSidebarActionDescriptor` discriminated union is\n * structurally assignable to this.\n */\nexport interface HostSidebarActionDescriptorShape {\n id: string;\n label: string;\n icon?: string;\n slot?: HostSidebarActionSlotShape;\n variant?: HostSidebarActionVariantShape;\n disabled?: boolean;\n active?: boolean;\n requiredPermission?: number;\n kind: HostSidebarActionKindShape;\n href?: string;\n}\n\n/**\n * Serializable navigation leaf shape (dependency-neutral mirror of plugin-ui's\n * `HostSidebarNavItem`). Extension-relative `href`; the host canonicalises it.\n */\nexport interface HostSidebarNavItemShape {\n id: string;\n label: string;\n icon?: string;\n href: string;\n}\n\n/**\n * Discriminated publish-payload shape mirroring plugin-ui's `HostSidebarContribution`.\n * Declared here so `HostSidebarActionsApiShape.publish` is fully typed without a\n * `components-react → plugin-ui` import. The concrete plugin-ui union is structurally\n * assignable to this shape.\n *\n * - `mode:\"none\"` — contribute nothing (do NOT clobber static manifest actions).\n * - `mode:\"actions\"` — batch-2 Quick Actions for a detail entity.\n * - `mode:\"detail\"` — full detail-nav replacement (title + nav items + back-arrow + Quick Actions).\n */\nexport type HostSidebarContributionShape =\n | { mode: \"none\" }\n | { mode: \"actions\"; entityToken: string; actions: HostSidebarActionDescriptorShape[] }\n | {\n mode: \"detail\";\n entityToken: string;\n title: string;\n navSectionLabel: string;\n navItems: HostSidebarNavItemShape[];\n backHref: string;\n backLabel: string;\n actions: HostSidebarActionDescriptorShape[];\n };\n\nexport interface HostSidebarActionsApiShape {\n publish(contribution: HostSidebarContributionShape): void;\n clear(): void;\n subscribe(onAction: (actionId: string) => void): () => void;\n readonly capabilities: { readonly contractVersion: string };\n}\n\n// ── Public contract ────────────────────────────────────────────────\n\n/**\n * The injected props every PlatformReact page component receives from the\n * host at surface mount time (RFC 0003).\n *\n * The host's surface mount (`PlatformReactSurfaceMount.tsx` in\n * `coreconnect-web`) reads each declared page's `exportName` from the loaded\n * module and renders it with these props. Plugin authors typing their page\n * components against this interface get strict type-checking for everything\n * the host actually supplies — no `any` at the seam.\n *\n * The shape is intentionally minimal. Additional context the host wires up\n * (theme, navigation, telemetry) reaches plugins via cross-cutting providers\n * the host wraps around the mounted component, not through this props\n * object — so growing the host's contextual surface does not change this\n * interface.\n */\nexport interface PlatformReactPageProps {\n /**\n * The extension's GUID as declared on the manifest's `id` field. Stable\n * across enable/disable lifecycle transitions within a tenant.\n */\n extensionId: string;\n /**\n * The active organisation. Plugins MUST scope every data read and write to\n * this id — the host enforces tenant isolation downstream, but propagating\n * the id keeps the dependency direction explicit and testable.\n */\n organisationId: string;\n /**\n * Optional tenant id. Present for tenant-bound deployments; absent for\n * platform-wide pages. Pages that branch on this MUST handle `undefined`.\n */\n tenantId?: string;\n /**\n * The host-side surface key for this page. Matches the `id` declared on\n * the manifest's `ui.platformReactPages[]` entry. Useful for telemetry tags\n * and for pages that share a component implementation across multiple\n * surfaces.\n */\n pageId: string;\n /**\n * The surface's mount path (`/extensions/<slug>/<pageId>`), when known to the\n * host. Plugins build in-surface URLs relative to it via `plugin-ui`\n * `useSurfaceUrl`, which derives it from runtime identifiers\n * (`normaliseSlug(extensionGroupCode)` + `pageId`) when this is absent.\n * Optional so the SDK stays compatible with hosts that predate it.\n */\n basePath?: string;\n /**\n * Host chrome sidebar-actions API. Present only on PlatformReact page surfaces\n * (server-restricted to first-party PlatformPlugins). A page publishes contextual\n * Quick Actions via `plugin-ui` `useHostSidebarActions`. Optional so the SDK\n * stays compatible with hosts that predate the seam.\n */\n hostSidebar?: HostSidebarActionsApiShape;\n}\n\n/**\n * Type-safe declaration helper for a PlatformReact page component.\n *\n * The plugin author exports the result of this call from the module path\n * referenced by the manifest's `moduleSpecifier`:\n *\n * @example\n * ```tsx\n * import { definePlatformReactPage, type PlatformReactPageProps } from \"@ethisyscore/components-react\";\n *\n * const Dashboard = ({ extensionId, organisationId }: PlatformReactPageProps) => (\n * <div>Dashboard for {extensionId} / {organisationId}</div>\n * );\n *\n * export default definePlatformReactPage(Dashboard);\n * ```\n *\n * The helper currently returns the input component unchanged — it exists as\n * a stable indirection point so future host integrations (boundary-injection,\n * suspense fallbacks, error contracts) can land transparently without every\n * plugin author updating their export.\n */\nexport function definePlatformReactPage<P extends PlatformReactPageProps>(\n component: ComponentType<P>,\n): ComponentType<P> {\n return component;\n}\n\nexport { emitNavigation } from \"./navigation\";\nexport { showToast } from \"./toast\";\nexport type { ToastRequest, ToastVariant } from \"./toast\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/navigation.ts","../src/toast.ts","../src/index.ts"],"names":[],"mappings":";;;AAmBO,SAAS,eAAe,EAAA,EAAkB;AAC/C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAM,KAAA,GAAQ,IAAI,WAAA,CAAY,kBAAA,EAAoB;AAAA,IAChD,MAAA,EAAQ,EAAE,EAAA,EAAG;AAAA,IACb,UAAA,EAAY;AAAA,GACb,CAAA;AACD,EAAA,MAAA,CAAO,cAAc,KAAK,CAAA;AAG1B,EAAA,IAAI,CAAC,MAAM,gBAAA,EAAkB;AAC3B,IAAA,MAAA,CAAO,QAAA,CAAS,OAAO,EAAE,CAAA;AAAA,EAC3B;AACF;;;ACFO,SAAS,UAAU,KAAA,EAA2B;AACnD,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAA,CAAO,aAAA,CAAc,IAAI,WAAA,CAA0B,eAAA,EAAiB,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAC,CAAA;AACxF;;;ACiIO,SAAS,wBACd,SAAA,EACkB;AAClB,EAAA,OAAO,SAAA;AACT","file":"index.cjs","sourcesContent":["/**\n * Host navigation bridge for PlatformReact pages (RFC 0003).\n *\n * PlatformReact pages run inside the host's React tree but cannot import the\n * host's `useNavigate` directly — that would couple the plugin's bundle to\n * the host's router internals and break the realm boundary the contract\n * preserves. Instead, plugins dispatch a `CustomEvent(\"ethisys:navigate\")`\n * on `window`; the host's `useExtensionNavigation` listener intercepts the\n * event and translates it into a React Router push.\n *\n * `cancelable: true` is load-bearing — without it the host's\n * `event.preventDefault()` is a no-op (CustomEvent defaults to\n * non-cancelable), so `defaultPrevented` stays `false`, the\n * `window.location.assign` fallback fires AFTER the SPA navigation has\n * already run, and the user sees an unwanted full-page reload. The flag is\n * the entire contract between plugin and host on this seam, which is why\n * the helper exists — getting it right per-plugin is exactly the kind of\n * detail that should be baked into the SDK rather than the README.\n */\nexport function emitNavigation(to: string): void {\n if (typeof window === \"undefined\") {\n return;\n }\n const event = new CustomEvent(\"ethisys:navigate\", {\n detail: { to },\n cancelable: true,\n });\n window.dispatchEvent(event);\n // Fallback for hosts that haven't wired the listener yet — full-document\n // navigation isn't ideal but keeps the page functional.\n if (!event.defaultPrevented) {\n window.location.assign(to);\n }\n}\n","/**\n * Host toast bridge for PlatformReact pages (RFC 0003).\n *\n * Symmetric with {@link emitNavigation}: a PlatformReact page runs\n * inside the host realm but cannot import the host's toast system directly — the\n * host renders toasts with a single app-global toaster (a module singleton) that\n * is not in the host module registry, so a plugin can neither import it nor\n * safely bundle its own (a second instance would dispatch to a different store\n * and nothing would show). Instead the plugin dispatches a typed\n * `CustomEvent<ToastRequest>` named `ethisys:toast` on `window`; the host\n * subscribes once at the authenticated shell (`useExtensionToast`) and forwards\n * each event to its toaster.\n *\n * Unlike navigation there is no fallback: a dropped toast (no host listener —\n * e.g. a Storybook/dev mount) is non-fatal UX, so the helper stays fire-and-forget.\n */\nexport type ToastVariant = \"default\" | \"success\" | \"error\" | \"warning\";\n\n/** The payload carried on the `ethisys:toast` event. */\nexport interface ToastRequest {\n /** Primary line. Required — an empty title is ignored by the host listener. */\n title: string;\n /** Optional secondary line. */\n description?: string;\n /** Visual style; the host maps it to its toaster's success/error/warning/default. */\n variant?: ToastVariant;\n}\n\n/**\n * Raise a host toast from a PlatformReact page. No-ops outside a browser (SSR).\n */\nexport function showToast(toast: ToastRequest): void {\n if (typeof window === \"undefined\") {\n return;\n }\n window.dispatchEvent(new CustomEvent<ToastRequest>(\"ethisys:toast\", { detail: toast }));\n}\n","import type { ComponentType } from \"react\";\n\n// ── Sidebar-actions structural types ──────────────────────────────\n// Declared here (the dependency-neutral package both the host and plugin-ui import)\n// so PlatformReactPageProps.hostSidebar is fully typed without a\n// components-react → plugin-ui import. plugin-ui's concrete HostSidebarActionsApi /\n// HostSidebarActionDescriptor are structurally assignable to these *Shape types;\n// plugin-ui's bridge casts once at the seam.\n\n/** Sidebar-action placement slot (dependency-neutral mirror of plugin-ui's `HostSidebarActionSlot`). */\nexport type HostSidebarActionSlotShape = \"primary\" | \"overflow\" | \"sidebar-only\";\n\n/** Sidebar-action visual variant (dependency-neutral mirror of plugin-ui's `HostSidebarActionVariant`). */\nexport type HostSidebarActionVariantShape = \"default\" | \"danger\";\n\n/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles;\n * group = a collapsible parent rendered as an accordion, its `children` are the leaves). */\nexport type HostSidebarActionKindShape = \"navigate\" | \"dispatch\" | \"group\";\n\n/**\n * Serializable sidebar-action descriptor shape. Declared in `components-react`\n * (the dependency-neutral boundary) so `PlatformReactPageProps.hostSidebar` is\n * fully typed without a `components-react → plugin-ui` dependency.\n * `plugin-ui`'s concrete `HostSidebarActionDescriptor` discriminated union is\n * structurally assignable to this.\n */\nexport interface HostSidebarActionDescriptorShape {\n id: string;\n label: string;\n icon?: string;\n slot?: HostSidebarActionSlotShape;\n variant?: HostSidebarActionVariantShape;\n disabled?: boolean;\n active?: boolean;\n requiredPermission?: number;\n kind: HostSidebarActionKindShape;\n href?: string;\n /** Present only for `kind:\"group\"` — the collapsible parent's child actions (each itself a\n * navigate/dispatch action, or a nested group; the type is recursive). */\n children?: HostSidebarActionDescriptorShape[];\n}\n\n/**\n * Serializable navigation leaf shape (dependency-neutral mirror of plugin-ui's\n * `HostSidebarNavItem`). Extension-relative `href`; the host canonicalises it.\n */\nexport interface HostSidebarNavItemShape {\n id: string;\n label: string;\n icon?: string;\n href: string;\n}\n\n/**\n * Discriminated publish-payload shape mirroring plugin-ui's `HostSidebarContribution`.\n * Declared here so `HostSidebarActionsApiShape.publish` is fully typed without a\n * `components-react → plugin-ui` import. The concrete plugin-ui union is structurally\n * assignable to this shape.\n *\n * - `mode:\"none\"` — contribute nothing (do NOT clobber static manifest actions).\n * - `mode:\"actions\"` — batch-2 Quick Actions for a detail entity.\n * - `mode:\"detail\"` — full detail-nav replacement (title + nav items + back-arrow + Quick Actions).\n */\nexport type HostSidebarContributionShape =\n | { mode: \"none\" }\n | { mode: \"actions\"; entityToken: string; actions: HostSidebarActionDescriptorShape[] }\n | {\n mode: \"detail\";\n entityToken: string;\n title: string;\n navSectionLabel: string;\n navItems: HostSidebarNavItemShape[];\n backHref: string;\n backLabel: string;\n actions: HostSidebarActionDescriptorShape[];\n };\n\nexport interface HostSidebarActionsApiShape {\n publish(contribution: HostSidebarContributionShape): void;\n clear(): void;\n subscribe(onAction: (actionId: string) => void): () => void;\n readonly capabilities: { readonly contractVersion: string };\n}\n\n// ── Public contract ────────────────────────────────────────────────\n\n/**\n * The injected props every PlatformReact page component receives from the\n * host at surface mount time (RFC 0003).\n *\n * The host's surface mount (`PlatformReactSurfaceMount.tsx` in\n * `coreconnect-web`) reads each declared page's `exportName` from the loaded\n * module and renders it with these props. Plugin authors typing their page\n * components against this interface get strict type-checking for everything\n * the host actually supplies — no `any` at the seam.\n *\n * The shape is intentionally minimal. Additional context the host wires up\n * (theme, navigation, telemetry) reaches plugins via cross-cutting providers\n * the host wraps around the mounted component, not through this props\n * object — so growing the host's contextual surface does not change this\n * interface.\n */\nexport interface PlatformReactPageProps {\n /**\n * The extension's GUID as declared on the manifest's `id` field. Stable\n * across enable/disable lifecycle transitions within a tenant.\n */\n extensionId: string;\n /**\n * The active organisation. Plugins MUST scope every data read and write to\n * this id — the host enforces tenant isolation downstream, but propagating\n * the id keeps the dependency direction explicit and testable.\n */\n organisationId: string;\n /**\n * Optional tenant id. Present for tenant-bound deployments; absent for\n * platform-wide pages. Pages that branch on this MUST handle `undefined`.\n */\n tenantId?: string;\n /**\n * The host-side surface key for this page. Matches the `id` declared on\n * the manifest's `ui.platformReactPages[]` entry. Useful for telemetry tags\n * and for pages that share a component implementation across multiple\n * surfaces.\n */\n pageId: string;\n /**\n * The surface's mount path (`/extensions/<slug>/<pageId>`), when known to the\n * host. Plugins build in-surface URLs relative to it via `plugin-ui`\n * `useSurfaceUrl`, which derives it from runtime identifiers\n * (`normaliseSlug(extensionGroupCode)` + `pageId`) when this is absent.\n * Optional so the SDK stays compatible with hosts that predate it.\n */\n basePath?: string;\n /**\n * Host chrome sidebar-actions API. Present only on PlatformReact page surfaces\n * (server-restricted to first-party PlatformPlugins). A page publishes contextual\n * Quick Actions via `plugin-ui` `useHostSidebarActions`. Optional so the SDK\n * stays compatible with hosts that predate the seam.\n */\n hostSidebar?: HostSidebarActionsApiShape;\n}\n\n/**\n * Type-safe declaration helper for a PlatformReact page component.\n *\n * The plugin author exports the result of this call from the module path\n * referenced by the manifest's `moduleSpecifier`:\n *\n * @example\n * ```tsx\n * import { definePlatformReactPage, type PlatformReactPageProps } from \"@ethisyscore/components-react\";\n *\n * const Dashboard = ({ extensionId, organisationId }: PlatformReactPageProps) => (\n * <div>Dashboard for {extensionId} / {organisationId}</div>\n * );\n *\n * export default definePlatformReactPage(Dashboard);\n * ```\n *\n * The helper currently returns the input component unchanged — it exists as\n * a stable indirection point so future host integrations (boundary-injection,\n * suspense fallbacks, error contracts) can land transparently without every\n * plugin author updating their export.\n */\nexport function definePlatformReactPage<P extends PlatformReactPageProps>(\n component: ComponentType<P>,\n): ComponentType<P> {\n return component;\n}\n\nexport { emitNavigation } from \"./navigation\";\nexport { showToast } from \"./toast\";\nexport type { ToastRequest, ToastVariant } from \"./toast\";\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -56,8 +56,9 @@ declare function showToast(toast: ToastRequest): void;
|
|
|
56
56
|
type HostSidebarActionSlotShape = "primary" | "overflow" | "sidebar-only";
|
|
57
57
|
/** Sidebar-action visual variant (dependency-neutral mirror of plugin-ui's `HostSidebarActionVariant`). */
|
|
58
58
|
type HostSidebarActionVariantShape = "default" | "danger";
|
|
59
|
-
/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles
|
|
60
|
-
|
|
59
|
+
/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles;
|
|
60
|
+
* group = a collapsible parent rendered as an accordion, its `children` are the leaves). */
|
|
61
|
+
type HostSidebarActionKindShape = "navigate" | "dispatch" | "group";
|
|
61
62
|
/**
|
|
62
63
|
* Serializable sidebar-action descriptor shape. Declared in `components-react`
|
|
63
64
|
* (the dependency-neutral boundary) so `PlatformReactPageProps.hostSidebar` is
|
|
@@ -76,6 +77,9 @@ interface HostSidebarActionDescriptorShape {
|
|
|
76
77
|
requiredPermission?: number;
|
|
77
78
|
kind: HostSidebarActionKindShape;
|
|
78
79
|
href?: string;
|
|
80
|
+
/** Present only for `kind:"group"` — the collapsible parent's child actions (each itself a
|
|
81
|
+
* navigate/dispatch action, or a nested group; the type is recursive). */
|
|
82
|
+
children?: HostSidebarActionDescriptorShape[];
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
85
|
* Serializable navigation leaf shape (dependency-neutral mirror of plugin-ui's
|
package/dist/index.d.ts
CHANGED
|
@@ -56,8 +56,9 @@ declare function showToast(toast: ToastRequest): void;
|
|
|
56
56
|
type HostSidebarActionSlotShape = "primary" | "overflow" | "sidebar-only";
|
|
57
57
|
/** Sidebar-action visual variant (dependency-neutral mirror of plugin-ui's `HostSidebarActionVariant`). */
|
|
58
58
|
type HostSidebarActionVariantShape = "default" | "danger";
|
|
59
|
-
/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles
|
|
60
|
-
|
|
59
|
+
/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles;
|
|
60
|
+
* group = a collapsible parent rendered as an accordion, its `children` are the leaves). */
|
|
61
|
+
type HostSidebarActionKindShape = "navigate" | "dispatch" | "group";
|
|
61
62
|
/**
|
|
62
63
|
* Serializable sidebar-action descriptor shape. Declared in `components-react`
|
|
63
64
|
* (the dependency-neutral boundary) so `PlatformReactPageProps.hostSidebar` is
|
|
@@ -76,6 +77,9 @@ interface HostSidebarActionDescriptorShape {
|
|
|
76
77
|
requiredPermission?: number;
|
|
77
78
|
kind: HostSidebarActionKindShape;
|
|
78
79
|
href?: string;
|
|
80
|
+
/** Present only for `kind:"group"` — the collapsible parent's child actions (each itself a
|
|
81
|
+
* navigate/dispatch action, or a nested group; the type is recursive). */
|
|
82
|
+
children?: HostSidebarActionDescriptorShape[];
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
85
|
* Serializable navigation leaf shape (dependency-neutral mirror of plugin-ui's
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/navigation.ts","../src/toast.ts","../src/index.ts"],"names":[],"mappings":";AAmBO,SAAS,eAAe,EAAA,EAAkB;AAC/C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAM,KAAA,GAAQ,IAAI,WAAA,CAAY,kBAAA,EAAoB;AAAA,IAChD,MAAA,EAAQ,EAAE,EAAA,EAAG;AAAA,IACb,UAAA,EAAY;AAAA,GACb,CAAA;AACD,EAAA,MAAA,CAAO,cAAc,KAAK,CAAA;AAG1B,EAAA,IAAI,CAAC,MAAM,gBAAA,EAAkB;AAC3B,IAAA,MAAA,CAAO,QAAA,CAAS,OAAO,EAAE,CAAA;AAAA,EAC3B;AACF;;;ACFO,SAAS,UAAU,KAAA,EAA2B;AACnD,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAA,CAAO,aAAA,CAAc,IAAI,WAAA,CAA0B,eAAA,EAAiB,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAC,CAAA;AACxF;;;AC6HO,SAAS,wBACd,SAAA,EACkB;AAClB,EAAA,OAAO,SAAA;AACT","file":"index.js","sourcesContent":["/**\n * Host navigation bridge for PlatformReact pages (RFC 0003).\n *\n * PlatformReact pages run inside the host's React tree but cannot import the\n * host's `useNavigate` directly — that would couple the plugin's bundle to\n * the host's router internals and break the realm boundary the contract\n * preserves. Instead, plugins dispatch a `CustomEvent(\"ethisys:navigate\")`\n * on `window`; the host's `useExtensionNavigation` listener intercepts the\n * event and translates it into a React Router push.\n *\n * `cancelable: true` is load-bearing — without it the host's\n * `event.preventDefault()` is a no-op (CustomEvent defaults to\n * non-cancelable), so `defaultPrevented` stays `false`, the\n * `window.location.assign` fallback fires AFTER the SPA navigation has\n * already run, and the user sees an unwanted full-page reload. The flag is\n * the entire contract between plugin and host on this seam, which is why\n * the helper exists — getting it right per-plugin is exactly the kind of\n * detail that should be baked into the SDK rather than the README.\n */\nexport function emitNavigation(to: string): void {\n if (typeof window === \"undefined\") {\n return;\n }\n const event = new CustomEvent(\"ethisys:navigate\", {\n detail: { to },\n cancelable: true,\n });\n window.dispatchEvent(event);\n // Fallback for hosts that haven't wired the listener yet — full-document\n // navigation isn't ideal but keeps the page functional.\n if (!event.defaultPrevented) {\n window.location.assign(to);\n }\n}\n","/**\n * Host toast bridge for PlatformReact pages (RFC 0003).\n *\n * Symmetric with {@link emitNavigation}: a PlatformReact page runs\n * inside the host realm but cannot import the host's toast system directly — the\n * host renders toasts with a single app-global toaster (a module singleton) that\n * is not in the host module registry, so a plugin can neither import it nor\n * safely bundle its own (a second instance would dispatch to a different store\n * and nothing would show). Instead the plugin dispatches a typed\n * `CustomEvent<ToastRequest>` named `ethisys:toast` on `window`; the host\n * subscribes once at the authenticated shell (`useExtensionToast`) and forwards\n * each event to its toaster.\n *\n * Unlike navigation there is no fallback: a dropped toast (no host listener —\n * e.g. a Storybook/dev mount) is non-fatal UX, so the helper stays fire-and-forget.\n */\nexport type ToastVariant = \"default\" | \"success\" | \"error\" | \"warning\";\n\n/** The payload carried on the `ethisys:toast` event. */\nexport interface ToastRequest {\n /** Primary line. Required — an empty title is ignored by the host listener. */\n title: string;\n /** Optional secondary line. */\n description?: string;\n /** Visual style; the host maps it to its toaster's success/error/warning/default. */\n variant?: ToastVariant;\n}\n\n/**\n * Raise a host toast from a PlatformReact page. No-ops outside a browser (SSR).\n */\nexport function showToast(toast: ToastRequest): void {\n if (typeof window === \"undefined\") {\n return;\n }\n window.dispatchEvent(new CustomEvent<ToastRequest>(\"ethisys:toast\", { detail: toast }));\n}\n","import type { ComponentType } from \"react\";\n\n// ── Sidebar-actions structural types ──────────────────────────────\n// Declared here (the dependency-neutral package both the host and plugin-ui import)\n// so PlatformReactPageProps.hostSidebar is fully typed without a\n// components-react → plugin-ui import. plugin-ui's concrete HostSidebarActionsApi /\n// HostSidebarActionDescriptor are structurally assignable to these *Shape types;\n// plugin-ui's bridge casts once at the seam.\n\n/** Sidebar-action placement slot (dependency-neutral mirror of plugin-ui's `HostSidebarActionSlot`). */\nexport type HostSidebarActionSlotShape = \"primary\" | \"overflow\" | \"sidebar-only\";\n\n/** Sidebar-action visual variant (dependency-neutral mirror of plugin-ui's `HostSidebarActionVariant`). */\nexport type HostSidebarActionVariantShape = \"default\" | \"danger\";\n\n/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles). */\nexport type HostSidebarActionKindShape = \"navigate\" | \"dispatch\";\n\n/**\n * Serializable sidebar-action descriptor shape. Declared in `components-react`\n * (the dependency-neutral boundary) so `PlatformReactPageProps.hostSidebar` is\n * fully typed without a `components-react → plugin-ui` dependency.\n * `plugin-ui`'s concrete `HostSidebarActionDescriptor` discriminated union is\n * structurally assignable to this.\n */\nexport interface HostSidebarActionDescriptorShape {\n id: string;\n label: string;\n icon?: string;\n slot?: HostSidebarActionSlotShape;\n variant?: HostSidebarActionVariantShape;\n disabled?: boolean;\n active?: boolean;\n requiredPermission?: number;\n kind: HostSidebarActionKindShape;\n href?: string;\n}\n\n/**\n * Serializable navigation leaf shape (dependency-neutral mirror of plugin-ui's\n * `HostSidebarNavItem`). Extension-relative `href`; the host canonicalises it.\n */\nexport interface HostSidebarNavItemShape {\n id: string;\n label: string;\n icon?: string;\n href: string;\n}\n\n/**\n * Discriminated publish-payload shape mirroring plugin-ui's `HostSidebarContribution`.\n * Declared here so `HostSidebarActionsApiShape.publish` is fully typed without a\n * `components-react → plugin-ui` import. The concrete plugin-ui union is structurally\n * assignable to this shape.\n *\n * - `mode:\"none\"` — contribute nothing (do NOT clobber static manifest actions).\n * - `mode:\"actions\"` — batch-2 Quick Actions for a detail entity.\n * - `mode:\"detail\"` — full detail-nav replacement (title + nav items + back-arrow + Quick Actions).\n */\nexport type HostSidebarContributionShape =\n | { mode: \"none\" }\n | { mode: \"actions\"; entityToken: string; actions: HostSidebarActionDescriptorShape[] }\n | {\n mode: \"detail\";\n entityToken: string;\n title: string;\n navSectionLabel: string;\n navItems: HostSidebarNavItemShape[];\n backHref: string;\n backLabel: string;\n actions: HostSidebarActionDescriptorShape[];\n };\n\nexport interface HostSidebarActionsApiShape {\n publish(contribution: HostSidebarContributionShape): void;\n clear(): void;\n subscribe(onAction: (actionId: string) => void): () => void;\n readonly capabilities: { readonly contractVersion: string };\n}\n\n// ── Public contract ────────────────────────────────────────────────\n\n/**\n * The injected props every PlatformReact page component receives from the\n * host at surface mount time (RFC 0003).\n *\n * The host's surface mount (`PlatformReactSurfaceMount.tsx` in\n * `coreconnect-web`) reads each declared page's `exportName` from the loaded\n * module and renders it with these props. Plugin authors typing their page\n * components against this interface get strict type-checking for everything\n * the host actually supplies — no `any` at the seam.\n *\n * The shape is intentionally minimal. Additional context the host wires up\n * (theme, navigation, telemetry) reaches plugins via cross-cutting providers\n * the host wraps around the mounted component, not through this props\n * object — so growing the host's contextual surface does not change this\n * interface.\n */\nexport interface PlatformReactPageProps {\n /**\n * The extension's GUID as declared on the manifest's `id` field. Stable\n * across enable/disable lifecycle transitions within a tenant.\n */\n extensionId: string;\n /**\n * The active organisation. Plugins MUST scope every data read and write to\n * this id — the host enforces tenant isolation downstream, but propagating\n * the id keeps the dependency direction explicit and testable.\n */\n organisationId: string;\n /**\n * Optional tenant id. Present for tenant-bound deployments; absent for\n * platform-wide pages. Pages that branch on this MUST handle `undefined`.\n */\n tenantId?: string;\n /**\n * The host-side surface key for this page. Matches the `id` declared on\n * the manifest's `ui.platformReactPages[]` entry. Useful for telemetry tags\n * and for pages that share a component implementation across multiple\n * surfaces.\n */\n pageId: string;\n /**\n * The surface's mount path (`/extensions/<slug>/<pageId>`), when known to the\n * host. Plugins build in-surface URLs relative to it via `plugin-ui`\n * `useSurfaceUrl`, which derives it from runtime identifiers\n * (`normaliseSlug(extensionGroupCode)` + `pageId`) when this is absent.\n * Optional so the SDK stays compatible with hosts that predate it.\n */\n basePath?: string;\n /**\n * Host chrome sidebar-actions API. Present only on PlatformReact page surfaces\n * (server-restricted to first-party PlatformPlugins). A page publishes contextual\n * Quick Actions via `plugin-ui` `useHostSidebarActions`. Optional so the SDK\n * stays compatible with hosts that predate the seam.\n */\n hostSidebar?: HostSidebarActionsApiShape;\n}\n\n/**\n * Type-safe declaration helper for a PlatformReact page component.\n *\n * The plugin author exports the result of this call from the module path\n * referenced by the manifest's `moduleSpecifier`:\n *\n * @example\n * ```tsx\n * import { definePlatformReactPage, type PlatformReactPageProps } from \"@ethisyscore/components-react\";\n *\n * const Dashboard = ({ extensionId, organisationId }: PlatformReactPageProps) => (\n * <div>Dashboard for {extensionId} / {organisationId}</div>\n * );\n *\n * export default definePlatformReactPage(Dashboard);\n * ```\n *\n * The helper currently returns the input component unchanged — it exists as\n * a stable indirection point so future host integrations (boundary-injection,\n * suspense fallbacks, error contracts) can land transparently without every\n * plugin author updating their export.\n */\nexport function definePlatformReactPage<P extends PlatformReactPageProps>(\n component: ComponentType<P>,\n): ComponentType<P> {\n return component;\n}\n\nexport { emitNavigation } from \"./navigation\";\nexport { showToast } from \"./toast\";\nexport type { ToastRequest, ToastVariant } from \"./toast\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/navigation.ts","../src/toast.ts","../src/index.ts"],"names":[],"mappings":";AAmBO,SAAS,eAAe,EAAA,EAAkB;AAC/C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAM,KAAA,GAAQ,IAAI,WAAA,CAAY,kBAAA,EAAoB;AAAA,IAChD,MAAA,EAAQ,EAAE,EAAA,EAAG;AAAA,IACb,UAAA,EAAY;AAAA,GACb,CAAA;AACD,EAAA,MAAA,CAAO,cAAc,KAAK,CAAA;AAG1B,EAAA,IAAI,CAAC,MAAM,gBAAA,EAAkB;AAC3B,IAAA,MAAA,CAAO,QAAA,CAAS,OAAO,EAAE,CAAA;AAAA,EAC3B;AACF;;;ACFO,SAAS,UAAU,KAAA,EAA2B;AACnD,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AACA,EAAA,MAAA,CAAO,aAAA,CAAc,IAAI,WAAA,CAA0B,eAAA,EAAiB,EAAE,MAAA,EAAQ,KAAA,EAAO,CAAC,CAAA;AACxF;;;ACiIO,SAAS,wBACd,SAAA,EACkB;AAClB,EAAA,OAAO,SAAA;AACT","file":"index.js","sourcesContent":["/**\n * Host navigation bridge for PlatformReact pages (RFC 0003).\n *\n * PlatformReact pages run inside the host's React tree but cannot import the\n * host's `useNavigate` directly — that would couple the plugin's bundle to\n * the host's router internals and break the realm boundary the contract\n * preserves. Instead, plugins dispatch a `CustomEvent(\"ethisys:navigate\")`\n * on `window`; the host's `useExtensionNavigation` listener intercepts the\n * event and translates it into a React Router push.\n *\n * `cancelable: true` is load-bearing — without it the host's\n * `event.preventDefault()` is a no-op (CustomEvent defaults to\n * non-cancelable), so `defaultPrevented` stays `false`, the\n * `window.location.assign` fallback fires AFTER the SPA navigation has\n * already run, and the user sees an unwanted full-page reload. The flag is\n * the entire contract between plugin and host on this seam, which is why\n * the helper exists — getting it right per-plugin is exactly the kind of\n * detail that should be baked into the SDK rather than the README.\n */\nexport function emitNavigation(to: string): void {\n if (typeof window === \"undefined\") {\n return;\n }\n const event = new CustomEvent(\"ethisys:navigate\", {\n detail: { to },\n cancelable: true,\n });\n window.dispatchEvent(event);\n // Fallback for hosts that haven't wired the listener yet — full-document\n // navigation isn't ideal but keeps the page functional.\n if (!event.defaultPrevented) {\n window.location.assign(to);\n }\n}\n","/**\n * Host toast bridge for PlatformReact pages (RFC 0003).\n *\n * Symmetric with {@link emitNavigation}: a PlatformReact page runs\n * inside the host realm but cannot import the host's toast system directly — the\n * host renders toasts with a single app-global toaster (a module singleton) that\n * is not in the host module registry, so a plugin can neither import it nor\n * safely bundle its own (a second instance would dispatch to a different store\n * and nothing would show). Instead the plugin dispatches a typed\n * `CustomEvent<ToastRequest>` named `ethisys:toast` on `window`; the host\n * subscribes once at the authenticated shell (`useExtensionToast`) and forwards\n * each event to its toaster.\n *\n * Unlike navigation there is no fallback: a dropped toast (no host listener —\n * e.g. a Storybook/dev mount) is non-fatal UX, so the helper stays fire-and-forget.\n */\nexport type ToastVariant = \"default\" | \"success\" | \"error\" | \"warning\";\n\n/** The payload carried on the `ethisys:toast` event. */\nexport interface ToastRequest {\n /** Primary line. Required — an empty title is ignored by the host listener. */\n title: string;\n /** Optional secondary line. */\n description?: string;\n /** Visual style; the host maps it to its toaster's success/error/warning/default. */\n variant?: ToastVariant;\n}\n\n/**\n * Raise a host toast from a PlatformReact page. No-ops outside a browser (SSR).\n */\nexport function showToast(toast: ToastRequest): void {\n if (typeof window === \"undefined\") {\n return;\n }\n window.dispatchEvent(new CustomEvent<ToastRequest>(\"ethisys:toast\", { detail: toast }));\n}\n","import type { ComponentType } from \"react\";\n\n// ── Sidebar-actions structural types ──────────────────────────────\n// Declared here (the dependency-neutral package both the host and plugin-ui import)\n// so PlatformReactPageProps.hostSidebar is fully typed without a\n// components-react → plugin-ui import. plugin-ui's concrete HostSidebarActionsApi /\n// HostSidebarActionDescriptor are structurally assignable to these *Shape types;\n// plugin-ui's bridge casts once at the seam.\n\n/** Sidebar-action placement slot (dependency-neutral mirror of plugin-ui's `HostSidebarActionSlot`). */\nexport type HostSidebarActionSlotShape = \"primary\" | \"overflow\" | \"sidebar-only\";\n\n/** Sidebar-action visual variant (dependency-neutral mirror of plugin-ui's `HostSidebarActionVariant`). */\nexport type HostSidebarActionVariantShape = \"default\" | \"danger\";\n\n/** Sidebar-action kind discriminant (navigate = host performs the nav; dispatch = plugin handles;\n * group = a collapsible parent rendered as an accordion, its `children` are the leaves). */\nexport type HostSidebarActionKindShape = \"navigate\" | \"dispatch\" | \"group\";\n\n/**\n * Serializable sidebar-action descriptor shape. Declared in `components-react`\n * (the dependency-neutral boundary) so `PlatformReactPageProps.hostSidebar` is\n * fully typed without a `components-react → plugin-ui` dependency.\n * `plugin-ui`'s concrete `HostSidebarActionDescriptor` discriminated union is\n * structurally assignable to this.\n */\nexport interface HostSidebarActionDescriptorShape {\n id: string;\n label: string;\n icon?: string;\n slot?: HostSidebarActionSlotShape;\n variant?: HostSidebarActionVariantShape;\n disabled?: boolean;\n active?: boolean;\n requiredPermission?: number;\n kind: HostSidebarActionKindShape;\n href?: string;\n /** Present only for `kind:\"group\"` — the collapsible parent's child actions (each itself a\n * navigate/dispatch action, or a nested group; the type is recursive). */\n children?: HostSidebarActionDescriptorShape[];\n}\n\n/**\n * Serializable navigation leaf shape (dependency-neutral mirror of plugin-ui's\n * `HostSidebarNavItem`). Extension-relative `href`; the host canonicalises it.\n */\nexport interface HostSidebarNavItemShape {\n id: string;\n label: string;\n icon?: string;\n href: string;\n}\n\n/**\n * Discriminated publish-payload shape mirroring plugin-ui's `HostSidebarContribution`.\n * Declared here so `HostSidebarActionsApiShape.publish` is fully typed without a\n * `components-react → plugin-ui` import. The concrete plugin-ui union is structurally\n * assignable to this shape.\n *\n * - `mode:\"none\"` — contribute nothing (do NOT clobber static manifest actions).\n * - `mode:\"actions\"` — batch-2 Quick Actions for a detail entity.\n * - `mode:\"detail\"` — full detail-nav replacement (title + nav items + back-arrow + Quick Actions).\n */\nexport type HostSidebarContributionShape =\n | { mode: \"none\" }\n | { mode: \"actions\"; entityToken: string; actions: HostSidebarActionDescriptorShape[] }\n | {\n mode: \"detail\";\n entityToken: string;\n title: string;\n navSectionLabel: string;\n navItems: HostSidebarNavItemShape[];\n backHref: string;\n backLabel: string;\n actions: HostSidebarActionDescriptorShape[];\n };\n\nexport interface HostSidebarActionsApiShape {\n publish(contribution: HostSidebarContributionShape): void;\n clear(): void;\n subscribe(onAction: (actionId: string) => void): () => void;\n readonly capabilities: { readonly contractVersion: string };\n}\n\n// ── Public contract ────────────────────────────────────────────────\n\n/**\n * The injected props every PlatformReact page component receives from the\n * host at surface mount time (RFC 0003).\n *\n * The host's surface mount (`PlatformReactSurfaceMount.tsx` in\n * `coreconnect-web`) reads each declared page's `exportName` from the loaded\n * module and renders it with these props. Plugin authors typing their page\n * components against this interface get strict type-checking for everything\n * the host actually supplies — no `any` at the seam.\n *\n * The shape is intentionally minimal. Additional context the host wires up\n * (theme, navigation, telemetry) reaches plugins via cross-cutting providers\n * the host wraps around the mounted component, not through this props\n * object — so growing the host's contextual surface does not change this\n * interface.\n */\nexport interface PlatformReactPageProps {\n /**\n * The extension's GUID as declared on the manifest's `id` field. Stable\n * across enable/disable lifecycle transitions within a tenant.\n */\n extensionId: string;\n /**\n * The active organisation. Plugins MUST scope every data read and write to\n * this id — the host enforces tenant isolation downstream, but propagating\n * the id keeps the dependency direction explicit and testable.\n */\n organisationId: string;\n /**\n * Optional tenant id. Present for tenant-bound deployments; absent for\n * platform-wide pages. Pages that branch on this MUST handle `undefined`.\n */\n tenantId?: string;\n /**\n * The host-side surface key for this page. Matches the `id` declared on\n * the manifest's `ui.platformReactPages[]` entry. Useful for telemetry tags\n * and for pages that share a component implementation across multiple\n * surfaces.\n */\n pageId: string;\n /**\n * The surface's mount path (`/extensions/<slug>/<pageId>`), when known to the\n * host. Plugins build in-surface URLs relative to it via `plugin-ui`\n * `useSurfaceUrl`, which derives it from runtime identifiers\n * (`normaliseSlug(extensionGroupCode)` + `pageId`) when this is absent.\n * Optional so the SDK stays compatible with hosts that predate it.\n */\n basePath?: string;\n /**\n * Host chrome sidebar-actions API. Present only on PlatformReact page surfaces\n * (server-restricted to first-party PlatformPlugins). A page publishes contextual\n * Quick Actions via `plugin-ui` `useHostSidebarActions`. Optional so the SDK\n * stays compatible with hosts that predate the seam.\n */\n hostSidebar?: HostSidebarActionsApiShape;\n}\n\n/**\n * Type-safe declaration helper for a PlatformReact page component.\n *\n * The plugin author exports the result of this call from the module path\n * referenced by the manifest's `moduleSpecifier`:\n *\n * @example\n * ```tsx\n * import { definePlatformReactPage, type PlatformReactPageProps } from \"@ethisyscore/components-react\";\n *\n * const Dashboard = ({ extensionId, organisationId }: PlatformReactPageProps) => (\n * <div>Dashboard for {extensionId} / {organisationId}</div>\n * );\n *\n * export default definePlatformReactPage(Dashboard);\n * ```\n *\n * The helper currently returns the input component unchanged — it exists as\n * a stable indirection point so future host integrations (boundary-injection,\n * suspense fallbacks, error contracts) can land transparently without every\n * plugin author updating their export.\n */\nexport function definePlatformReactPage<P extends PlatformReactPageProps>(\n component: ComponentType<P>,\n): ComponentType<P> {\n return component;\n}\n\nexport { emitNavigation } from \"./navigation\";\nexport { showToast } from \"./toast\";\nexport type { ToastRequest, ToastVariant } from \"./toast\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethisyscore/components-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.49.0",
|
|
4
4
|
"description": "Host-bound React contract for EthisysCore PlatformReact pages (RFC 0003). Provides the typed page-props contract and `definePlatformReactPage` helper so plugin authors get type-safe access to the host realm — extensionId, organisationId, mcp transport — without depending on the host app's internal modules.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|