@alfadocs/ui-kit-debug 1.75.1 → 1.77.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/_chunks/{balance-badge-cell-B49xgL6H.js → balance-badge-cell-Dzd-Z_5W.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-B49xgL6H.js.map → balance-badge-cell-Dzd-Z_5W.js.map} +1 -1
- package/dist/_chunks/booking-Cz_QjIJe.js +4051 -0
- package/dist/_chunks/booking-Cz_QjIJe.js.map +1 -0
- package/dist/_chunks/{breadcrumb-Boan-5n8.js → breadcrumb-Bn29NCnf.js} +8 -8
- package/dist/_chunks/breadcrumb-Bn29NCnf.js.map +1 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-B4My4eiB.js → calendar-appointment-editor-dialog-cvUpUjj-.js} +4 -4
- package/dist/_chunks/{calendar-appointment-editor-dialog-B4My4eiB.js.map → calendar-appointment-editor-dialog-cvUpUjj-.js.map} +1 -1
- package/dist/_chunks/{control-room-rail-CKZ2nemY.js → control-room-rail-DcJpHbp4.js} +2 -2
- package/dist/_chunks/{control-room-rail-CKZ2nemY.js.map → control-room-rail-DcJpHbp4.js.map} +1 -1
- package/dist/_chunks/{data-table-DTKGWUQm.js → data-table-BlONA1rP.js} +2 -2
- package/dist/_chunks/{data-table-DTKGWUQm.js.map → data-table-BlONA1rP.js.map} +1 -1
- package/dist/_chunks/{file-manager-Ct5QpZZI.js → file-manager-C9iJjDZt.js} +3 -3
- package/dist/_chunks/{file-manager-Ct5QpZZI.js.map → file-manager-C9iJjDZt.js.map} +1 -1
- package/dist/_chunks/{header-settings-Coh1r41O.js → header-settings-BYpVmLip.js} +2 -2
- package/dist/_chunks/{header-settings-Coh1r41O.js.map → header-settings-BYpVmLip.js.map} +1 -1
- package/dist/_chunks/{heatmap-Ba9cgfSY.js → heatmap-C2Rg-SV_.js} +2 -2
- package/dist/_chunks/{heatmap-Ba9cgfSY.js.map → heatmap-C2Rg-SV_.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-Ck5NVJcO.js → marketplace-app-shell-mS7Q2-81.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-Ck5NVJcO.js.map → marketplace-app-shell-mS7Q2-81.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CxjMovCh.js → notes-panel-CZO1qsD-.js} +2 -2
- package/dist/_chunks/{notes-panel-CxjMovCh.js.map → notes-panel-CZO1qsD-.js.map} +1 -1
- package/dist/_chunks/{otp-input-CGMu30_e.js → otp-input-BgEZi0py.js} +54 -53
- package/dist/_chunks/otp-input-BgEZi0py.js.map +1 -0
- package/dist/_chunks/{practice-results-B4Z5q46r.js → practice-results-By2BZFCz.js} +820 -783
- package/dist/_chunks/practice-results-By2BZFCz.js.map +1 -0
- package/dist/_chunks/{recaptcha-widget-CsvwlYTE.js → recaptcha-widget-iglUBIF3.js} +2 -2
- package/dist/_chunks/{recaptcha-widget-CsvwlYTE.js.map → recaptcha-widget-iglUBIF3.js.map} +1 -1
- package/dist/_chunks/{registration-form-DeK2QiJu.js → registration-form-xORq2s4p.js} +3 -3
- package/dist/_chunks/{registration-form-DeK2QiJu.js.map → registration-form-xORq2s4p.js.map} +1 -1
- package/dist/_chunks/signature-request-DjY-X62H.js +2448 -0
- package/dist/_chunks/signature-request-DjY-X62H.js.map +1 -0
- package/dist/_chunks/{tasks-panel-Cmr0oMvc.js → tasks-panel-BkjtgjQ8.js} +2 -2
- package/dist/_chunks/{tasks-panel-Cmr0oMvc.js.map → tasks-panel-BkjtgjQ8.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-DTrUzIBG.js → theme-toggle-DKpzb0-M.js} +2 -2
- package/dist/_chunks/{theme-toggle-DTrUzIBG.js.map → theme-toggle-DKpzb0-M.js.map} +1 -1
- package/dist/_chunks/{tool-rail-C_9lm0TC.js → tool-rail-Kup1b7xI.js} +2 -2
- package/dist/_chunks/{tool-rail-C_9lm0TC.js.map → tool-rail-Kup1b7xI.js.map} +1 -1
- package/dist/_chunks/use-theme-CYGyzFgZ.js +196 -0
- package/dist/_chunks/use-theme-CYGyzFgZ.js.map +1 -0
- package/dist/agent-catalog.json +46 -10
- package/dist/agent-i18n/en.json +5 -4
- package/dist/components/booking/booking-types.d.ts +22 -1
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.agent.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/code-step.d.ts +6 -0
- package/dist/components/booking/code-step.d.ts.map +1 -0
- package/dist/components/booking/index.d.ts +1 -1
- package/dist/components/booking/index.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/step-focus.d.ts +9 -0
- package/dist/components/booking/step-focus.d.ts.map +1 -0
- package/dist/components/booking/use-booking-payment.d.ts +6 -3
- package/dist/components/booking/use-booking-payment.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -0
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/practice-results/index.d.ts +1 -1
- package/dist/components/practice-results/index.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.agent.d.ts.map +1 -1
- package/dist/components/practice-results/practice-results.d.ts +4 -0
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +88 -86
- package/dist/hooks/use-theme.d.ts +9 -0
- package/dist/hooks/use-theme.d.ts.map +1 -1
- package/dist/host-compat.css +4 -1
- package/dist/i18n/locales/ar.d.ts +29 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +30 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +29 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +30 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +29 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +30 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +29 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +30 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +29 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +30 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +29 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +30 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +29 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +30 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +29 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +30 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +29 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +30 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +29 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +30 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +29 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +30 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +29 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +30 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +29 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +30 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +29 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +30 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +29 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +30 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +29 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +30 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +29 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +30 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +29 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +30 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1209 -1207
- package/dist/locales/ar.json +30 -1
- package/dist/locales/de.json +30 -1
- package/dist/locales/el.json +30 -1
- package/dist/locales/en.json +30 -1
- package/dist/locales/es.json +30 -1
- package/dist/locales/fr.json +30 -1
- package/dist/locales/hi.json +30 -1
- package/dist/locales/it.json +30 -1
- package/dist/locales/ja.json +30 -1
- package/dist/locales/nl.json +30 -1
- package/dist/locales/pl.json +30 -1
- package/dist/locales/pt.json +30 -1
- package/dist/locales/ro.json +30 -1
- package/dist/locales/ru.json +30 -1
- package/dist/locales/sq.json +30 -1
- package/dist/locales/sv.json +30 -1
- package/dist/locales/tr.json +30 -1
- package/dist/locales/zh.json +30 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/channel-meta.d.ts +8 -2
- package/dist/patterns/signature-request/channel-meta.d.ts.map +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signature-request/minor-patient.d.ts +41 -0
- package/dist/patterns/signature-request/minor-patient.d.ts.map +1 -0
- package/dist/patterns/signature-request/required-documents.d.ts +4 -3
- package/dist/patterns/signature-request/required-documents.d.ts.map +1 -1
- package/dist/patterns/signature-request/signature-request.d.ts +62 -12
- package/dist/patterns/signature-request/signature-request.d.ts.map +1 -1
- package/dist/theme-boot.js +26 -0
- package/dist/tokens.css +1 -1
- package/package.json +4 -2
- package/dist/_chunks/booking-D2r19Lia.js +0 -3901
- package/dist/_chunks/booking-D2r19Lia.js.map +0 -1
- package/dist/_chunks/breadcrumb-Boan-5n8.js.map +0 -1
- package/dist/_chunks/otp-input-CGMu30_e.js.map +0 -1
- package/dist/_chunks/practice-results-B4Z5q46r.js.map +0 -1
- package/dist/_chunks/signature-request-ldmXj2X6.js +0 -2221
- package/dist/_chunks/signature-request-ldmXj2X6.js.map +0 -1
- package/dist/_chunks/use-theme-CAuo6EYT.js +0 -159
- package/dist/_chunks/use-theme-CAuo6EYT.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { useState as D, useCallback as R, useMemo as x, useRef as O, useEffect a
|
|
|
3
3
|
import { useTranslation as Ao } from "react-i18next";
|
|
4
4
|
import { I as F } from "./icon-button-S8_weU3g.js";
|
|
5
5
|
import { a as Mo } from "./panel-header-CbtlTe85.js";
|
|
6
|
-
import { T as xo } from "./tool-rail-
|
|
6
|
+
import { T as xo } from "./tool-rail-Kup1b7xI.js";
|
|
7
7
|
import { u as W } from "./use-persistent-state-nZwZAnE9.js";
|
|
8
8
|
import { S as ko } from "./star-Bf9L2Uot.js";
|
|
9
9
|
import { X as So } from "./x-B5YnXwCz.js";
|
|
@@ -413,4 +413,4 @@ export {
|
|
|
413
413
|
$o as d,
|
|
414
414
|
Go as u
|
|
415
415
|
};
|
|
416
|
-
//# sourceMappingURL=control-room-rail-
|
|
416
|
+
//# sourceMappingURL=control-room-rail-DcJpHbp4.js.map
|
package/dist/_chunks/{control-room-rail-CKZ2nemY.js.map → control-room-rail-DcJpHbp4.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-room-rail-CKZ2nemY.js","sources":["../../src/components/control-room-rail/control-room-rail.agent.ts","../../src/components/control-room-rail/control-room-context.tsx","../../src/components/control-room-rail/control-room-rail.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ControlRoomRail. */\n/* */\n/* The product surface built on ToolRail: the docked \"Control Room\". */\n/* It claims its OWN agent identity ('control-room-rail') so an agent and */\n/* the DOM / cascade boundary can tell the Control Room apart from a bare */\n/* ToolRail. Generic rail surface only: open / close a tool's panel and */\n/* read which tool is active. State is strictly the active tool id — never */\n/* any tool's panel CONTENT (which may carry PHI). */\n/* */\n/* The descriptionKeys deliberately REUSE the existing */\n/* `ui.toolRail.agent.*` translations — no new i18n keys are coined this */\n/* pass. */\n/* */\n/* NOTE: pin / unpin / reorder favourites are intentionally NOT yet an */\n/* agent capability. Exposing them is a deferred follow-up: it needs a */\n/* closed-vocabulary capability addition (DS-maintainer approval per */\n/* src/docs/26-agent-readiness.mdx) plus its own 18-locale descriptionKeys */\n/* — neither of which this pass introduces. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ControlRoomRailHandle } from './control-room-rail';\n\nexport const controlRoomRailAgent: AgentAdapter<ControlRoomRailHandle> = {\n id: 'control-room-rail',\n capabilities: ['open', 'close', 'select_single'],\n state: {\n activeToolId: {\n type: 'string | null',\n descriptionKey: 'ui.toolRail.agent.state.activeToolId',\n description:\n 'Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.',\n read: (handle) => handle.getActiveToolId(),\n },\n panelMode: {\n type: \"'docked' | 'overlay' | 'full-screen'\",\n descriptionKey: 'ui.agent.controlRoomRail.state.panelMode',\n description:\n 'How an open panel shows: docked beside the content, over it because the frame keeps a minimum width for main, or full screen on a phone.',\n read: (handle) => handle.getPanelMode(),\n },\n },\n actions: {\n open: {\n // Pure ephemeral panel state (open) — no data loss, no external effect.\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.open',\n description: \"Open the given tool's panel.\",\n examples: [{ args: { id: 'inbox' }, note: 'Open the inbox tool panel.' }],\n invoke: (handle, args: { id: string }) => {\n handle.open(args.id);\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.close',\n description: 'Collapse the rail to its strip (no active tool).',\n invoke: (handle) => {\n handle.close();\n },\n },\n select_tool: {\n safety: 'read',\n argsType: '{ id: string | null }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: ['string', 'null'] } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.selectTool',\n description:\n 'Set the active tool by id (opens its panel), or pass null to collapse.',\n invoke: (handle, args: { id: string | null }) => {\n handle.setActiveTool(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'control-room-rail',\n description: 'Marks the ControlRoomRail wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific rail from the agent.',\n },\n item: {\n attr: 'data-tool-id',\n description:\n 'Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id.',\n },\n },\n};\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport type { ToolRailHandle, ToolRailTool } from '../tool-rail';\n\n/* ------------------------------------------------------------------ */\n/* Control Room context — the scope mechanism */\n/* */\n/* The DS provides the plumbing; the CONSUMER declares scope by which */\n/* API it reaches for: */\n/* - <ControlRoomProvider globalTools={…}> → `global` tools, set */\n/* once at the app shell, persist across navigation. */\n/* - useControlRoomTools([…]) → `contextual` tools, */\n/* registered per-page, swap with the open entity. */\n/* `<ControlRoomRail>` reads the merged set; `global` tools seed the */\n/* default favourites (pinned on top), `contextual` tools fall below */\n/* the divider. The rail renders the divider between the two groups. */\n/* ------------------------------------------------------------------ */\n\ninterface ControlRoomContextValue {\n globalTools: ToolRailTool[];\n contextualTools: ToolRailTool[];\n registerContextualTools: (id: string, tools: ToolRailTool[]) => void;\n unregisterContextualTools: (id: string) => void;\n // The rail registers its imperative handle here so pages can drive it\n // (e.g. open the X-ray panel when a tooth is clicked). Null until mounted.\n registerRail: RegisterRail;\n openTool: (id: string) => void;\n closeTool: () => void;\n}\n\n/** The rail's handle, and whether it currently holds a given tool. */\ntype RegisterRail = (\n handle: ToolRailHandle | null,\n hasTool?: (id: string) => boolean,\n) => void;\n\n/** How long a queued `openTool` waits for its tool and the rail to register\n * before it is dropped, so a tool added much later never pops open. */\nexport const QUEUED_OPEN_TIMEOUT_MS = 1000;\n\nconst ControlRoomContext = createContext<ControlRoomContextValue | null>(null);\n\nexport interface ControlRoomProviderProps {\n /**\n * Tools valid in every context (Alia, Inbox). Set once at the app shell —\n * they pin to the rail's far end and persist across navigation. Memoise\n * this array so it doesn't re-register every render.\n */\n globalTools?: ToolRailTool[];\n children: ReactNode;\n}\n\n/**\n * Holds the Control Room's global tools and the registry of per-context\n * contextual tools. Mount once at the app shell, inside the frame that also\n * renders `<ControlRoomRail>`.\n */\nexport function ControlRoomProvider({\n globalTools = [],\n children,\n}: ControlRoomProviderProps) {\n // id → that registration's contextual tools. Multiple concurrent\n // registrations merge in insertion order (rare, but composes cleanly).\n const [registry, setRegistry] = useState<Map<string, ToolRailTool[]>>(\n () => new Map(),\n );\n\n const registerContextualTools = useCallback(\n (id: string, tools: ToolRailTool[]) => {\n setRegistry((prev) => {\n const next = new Map(prev);\n next.set(id, tools);\n return next;\n });\n },\n [],\n );\n\n const unregisterContextualTools = useCallback((id: string) => {\n setRegistry((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Map(prev);\n next.delete(id);\n return next;\n });\n }, []);\n\n const contextualTools = useMemo(\n () => Array.from(registry.values()).flat(),\n [registry],\n );\n\n // The rail's imperative handle, registered by <ControlRoomRail> on mount.\n // openTool/closeTool drive it so a page can open a panel (e.g. the X-ray\n // viewer when a tooth is clicked) without holding a ref to the rail itself.\n const railRef = useRef<{\n handle: ToolRailHandle;\n hasTool: (id: string) => boolean;\n } | null>(null);\n // An open asked for before its rail or tool is there (a page that mounts\n // the rail or adds a tool and opens it in one click). It opens once both\n // are there, or is dropped after QUEUED_OPEN_TIMEOUT_MS.\n const pendingRef = useRef<{\n id: string;\n timer: ReturnType<typeof setTimeout>;\n } | null>(null);\n const dropPending = useCallback(() => {\n if (pendingRef.current) clearTimeout(pendingRef.current.timer);\n pendingRef.current = null;\n }, []);\n const registerRail = useCallback<RegisterRail>(\n (handle, hasTool = () => true) => {\n if (handle) {\n railRef.current = { handle, hasTool };\n const pending = pendingRef.current;\n if (pending && hasTool(pending.id)) {\n dropPending();\n handle.setActiveTool(pending.id);\n }\n return;\n }\n railRef.current = null;\n // The rail re-registers in the same commit whenever its tools change;\n // drop the queued open only if it is really gone.\n queueMicrotask(() => {\n if (!railRef.current) dropPending();\n });\n },\n [dropPending],\n );\n useEffect(() => dropPending, [dropPending]);\n const openTool = useCallback(\n (id: string) => {\n dropPending();\n const rail = railRef.current;\n // A mounted rail without the tool (absent or disabled) waits too, so\n // the id cannot open a tool that turns up minutes later.\n if (rail && rail.hasTool(id)) {\n rail.handle.setActiveTool(id);\n return;\n }\n pendingRef.current = {\n id,\n timer: setTimeout(dropPending, QUEUED_OPEN_TIMEOUT_MS),\n };\n },\n [dropPending],\n );\n const closeTool = useCallback(() => {\n dropPending();\n railRef.current?.handle.setActiveTool(null);\n }, [dropPending]);\n\n const value = useMemo<ControlRoomContextValue>(\n () => ({\n globalTools,\n contextualTools,\n registerContextualTools,\n unregisterContextualTools,\n registerRail,\n openTool,\n closeTool,\n }),\n [\n globalTools,\n contextualTools,\n registerContextualTools,\n unregisterContextualTools,\n registerRail,\n openTool,\n closeTool,\n ],\n );\n\n return (\n <ControlRoomContext.Provider value={value}>\n {children}\n </ControlRoomContext.Provider>\n );\n}\n\n/**\n * Register this context's **contextual** tools (Notes, Appointments, the entity\n * summary). They sit below the favourites divider and unregister automatically\n * when the calling component unmounts (i.e. when you leave the context).\n *\n * Pass a **stable / memoised** array — like `useEffect` deps, a fresh array\n * every render re-registers every render. Wrap it in `useMemo`.\n *\n * No-op when rendered outside a `<ControlRoomProvider>`.\n */\nexport function useControlRoomTools(tools: ToolRailTool[]): void {\n const ctx = useContext(ControlRoomContext);\n // Depend on the STABLE register/unregister callbacks, never the whole\n // context value: the value object changes every time the registry updates\n // (which this very effect triggers), so depending on `ctx` would re-register\n // on every change — an infinite loop. The callbacks are `useCallback([])`.\n const register = ctx?.registerContextualTools;\n const unregister = ctx?.unregisterContextualTools;\n const id = useId();\n useEffect(() => {\n if (!register || !unregister) return undefined;\n register(id, tools);\n return () => unregister(id);\n }, [register, unregister, id, tools]);\n}\n\n/**\n * The merged tool set the rail consumes: contextual tools (auto-tagged\n * `scope: 'contextual'`) then globals (`scope: 'global'`). Scope is assigned\n * here by which API registered the tool — `global` seeds the Control Room's\n * default favourites (pinned on top); `contextual` falls below the divider.\n * `ControlRoomRail` re-groups by favourite membership for the final order.\n * Returns `[]` outside a provider.\n */\nexport function useControlRoomMergedTools(): ToolRailTool[] {\n const ctx = useContext(ControlRoomContext);\n return useMemo(() => {\n if (!ctx) return [];\n const contextual = ctx.contextualTools.map((tool) => ({\n ...tool,\n scope: 'contextual' as const,\n }));\n const global = ctx.globalTools.map((tool) => ({\n ...tool,\n scope: 'global' as const,\n }));\n return [...contextual, ...global];\n }, [ctx]);\n}\n\n/**\n * Open a tool's panel from a page, or collapse it; stable, and a no-op outside\n * a `<ControlRoomProvider>`. An `openTool` for a tool the rail does not hold\n * yet waits up to `QUEUED_OPEN_TIMEOUT_MS`, then is dropped.\n */\nexport function useControlRoomActions(): {\n openTool: (id: string) => void;\n closeTool: () => void;\n} {\n const ctx = useContext(ControlRoomContext);\n const noop = useCallback(() => {}, []);\n return {\n openTool: ctx?.openTool ?? noop,\n closeTool: ctx?.closeTool ?? noop,\n };\n}\n\n/**\n * Internal: the rail registers its imperative handle with the provider so\n * `useControlRoomActions().openTool` can drive it. Returns the stable\n * `registerRail` callback (or a no-op outside a provider).\n */\nexport function useControlRoomRailRegister(): RegisterRail {\n const ctx = useContext(ControlRoomContext);\n const noop = useCallback<RegisterRail>(() => {}, []);\n return ctx?.registerRail ?? noop;\n}\n","import {\n forwardRef,\n useCallback,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Star, X } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { PanelHeaderActionsProvider } from '../panel-header/panel-header';\nimport {\n ToolRail,\n type ToolRailHandle,\n type ToolRailProps,\n type ToolRailTool,\n} from '../tool-rail';\nimport { usePersistentState } from '../../hooks/use-persistent-state';\nimport { controlRoomRailAgent } from './control-room-rail.agent';\nimport {\n useControlRoomMergedTools,\n useControlRoomRailRegister,\n} from './control-room-context';\n\n/* ------------------------------------------------------------------ */\n/* ControlRoomRail — the unified, contextual workspace rail. */\n/* */\n/* The docked right-hand \"Control Room\": the single home for the */\n/* assistant, inbox, notes, appointments and entity summaries */\n/* alongside the main work surface. One panel open at a time, */\n/* non-modal. */\n/* */\n/* It layers a FAVOURITES model over the proven ToolRail (its prior */\n/* name): favourited tools form a pinned group at the TOP of the strip */\n/* above a divider, then everything else below. The default favourites */\n/* are the host's `global` tools (Alia, Inbox) — so the rail opens with */\n/* notifications + Alia on top, the Control Room's default arrangement. */\n/* */\n/* Favouriting is DRAG-FIRST, no per-icon star: drag a tool up across */\n/* the divider to pin it (and drop it where you want in the order), */\n/* drag a favourite back down to unpin. The keyboard equivalent is */\n/* `Alt`+Arrow (crossing the divider pins / unpins, announced). The */\n/* non-drag pointer path — and the discoverable entry point — is an */\n/* add / remove control in each open tool's panel header. */\n/* */\n/* ToolRail stays favourite-agnostic: this layer maps favourite */\n/* membership onto the rail's generic `scope` grouping + (whole-strip) */\n/* `reorderable` run, reads cross-divider moves as pin / unpin, and */\n/* injects the favourite + close controls into the active panel's */\n/* PanelHeader via <PanelHeaderActionsProvider> (no separate header */\n/* row — the controls live inline-end of the panel's title row). */\n/* ------------------------------------------------------------------ */\n\n/** A Control Room tool — the rail tool descriptor, `scope`-aware. */\nexport type ControlRoomTool = ToolRailTool;\n\n/** Imperative handle — open / collapse a tool panel without the DOM. */\nexport type ControlRoomRailHandle = ToolRailHandle;\n\n/** What one favourites write did, for the tool the user acted on. */\nexport interface ControlRoomFavoriteChange {\n toolId: string;\n action: 'pin' | 'unpin' | 'reorder';\n}\n\n/* A hard-pinned id re-pins on the next render, so unpinning it changes\n nothing and reports nothing. */\nfunction favoriteChangeOf(\n toolId: string,\n previous: readonly string[],\n next: readonly string[],\n hardPinned: readonly string[] | undefined,\n): ControlRoomFavoriteChange | undefined {\n const was = previous.includes(toolId);\n const is = next.includes(toolId);\n if (!was && is) return { toolId, action: 'pin' };\n if (was && !is)\n return hardPinned?.includes(toolId)\n ? undefined\n : { toolId, action: 'unpin' };\n /* Compare what the rail shows: hard-pinned ids always lead. */\n const shown = (list: readonly string[]) =>\n hardPinned?.length\n ? [...hardPinned, ...list.filter((id) => !hardPinned.includes(id))]\n : list;\n const before = shown(previous);\n const after = shown(next);\n const reordered =\n before.length !== after.length ||\n before.some((id, index) => after[index] !== id);\n return reordered ? { toolId, action: 'reorder' } : undefined;\n}\n\n/* A write sees only the favourites whose tools are present. This puts the\n absent ones back: each follows the nearest earlier favourite the write\n kept, or leads the list. A write that changes nothing stays unchanged. */\nfunction keepAbsentFavorites(\n all: readonly string[],\n isPresent: (id: string) => boolean,\n nextPresent: readonly string[],\n): string[] {\n const kept = new Set(nextPresent);\n const leading: string[] = [];\n const after = new Map<string, string[]>();\n let anchor: string | null = null;\n for (const id of all) {\n if (isPresent(id)) {\n if (kept.has(id)) anchor = id;\n } else if (anchor === null) {\n leading.push(id);\n } else {\n after.set(anchor, [...(after.get(anchor) ?? []), id]);\n }\n }\n const merged = [\n ...leading,\n ...nextPresent.flatMap((id) => [id, ...(after.get(id) ?? [])]),\n ];\n return Array.from(new Set(merged));\n}\n\nexport interface ControlRoomRailProps extends Omit<\n ToolRailProps,\n | 'tools'\n | 'onReorder'\n | 'formatReorderAnnouncement'\n | 'renderToolAffordance'\n | 'renderPanelHeader'\n> {\n /**\n * Explicit tool set. Omit to read the merged global + contextual tools from\n * the nearest `<ControlRoomProvider>` (+ `useControlRoomTools`).\n */\n tools?: ControlRoomTool[];\n /**\n * Enable the favourites model: a pinned top group, drag / `Alt`+Arrow\n * reordering, and the panel-header add / remove control. Default `true`. Set\n * `false` for the legacy flat strip (tools render in the order / `scope` you\n * pass, no drag, no panel-header control).\n */\n reorderable?: boolean;\n /**\n * Controlled favourite tool ids, in pinned order. When set, the rail does not\n * persist — the host owns the value and is notified via `onFavoriteIdsChange`.\n * Ids of tools that are not in `tools` right now are allowed: the rail hides\n * them and hands them back in `next`.\n */\n favoriteIds?: string[];\n /**\n * HARD-PINNED favourite ids — always rendered at the very START of the\n * pinned group, ahead of (and deduped from) user favourites, in both\n * controlled and uncontrolled modes. Immune to unpin: removing one via\n * the panel-header control or a drag is a no-op (it re-pins on the next\n * render). For tools the product wants permanently one glance away —\n * e.g. notifications at the top of the strip.\n */\n pinnedFavoriteIds?: string[];\n /**\n * Uncontrolled initial favourites. Defaults to the ids of the tools the host\n * marked `scope: 'global'` (Alia, Inbox) — pinning them on top by default.\n * Read once, on the first mount, and only when storage holds nothing: a\n * rail that first mounts before its tools arrive seeds no favourites, so\n * mount it with its tools or pass this.\n */\n defaultFavoriteIds?: string[];\n /** Fires with the next favourites order whenever the user pins / reorders.\n * `next` keeps the favourites of tools that are absent right now, in\n * their places, so store it as given. `change` names the tool acted on\n * and what happened to it; it is absent when the write changed nothing. */\n onFavoriteIdsChange?: (\n next: string[],\n change?: ControlRoomFavoriteChange,\n ) => void;\n /** localStorage key for the uncontrolled favourites. Favourites of tools\n * that are absent right now stay in storage and come back with the tool.\n * Read once, on the first mount: a later change writes the current\n * favourites under the new key instead of reading it. Pass the final\n * (per-user) key from the first render, or remount with\n * `key={persistFavoritesKey}`. */\n persistFavoritesKey?: string;\n /**\n * localStorage key for the uncontrolled committed panel width, mirroring\n * `persistFavoritesKey`: when set and `panelWidth` is absent, the rail\n * seeds its width from storage on mount and writes each commit back.\n * Unlike `persistFavoritesKey` this has no default — persistence is\n * opt-in. Only meaningful with `resizablePanel` — there is nothing to\n * persist without the resize handle.\n */\n persistPanelWidthKey?: string;\n}\n\nexport const ControlRoomRail = forwardRef<\n ControlRoomRailHandle,\n ControlRoomRailProps\n>(function ControlRoomRail(\n {\n tools,\n railLabel,\n reorderable = true,\n favoriteIds,\n defaultFavoriteIds,\n pinnedFavoriteIds,\n onFavoriteIdsChange,\n persistFavoritesKey = 'ui.controlRoom.favorites',\n activeToolId,\n defaultActiveToolId = null,\n onActiveToolChange,\n panelWidth,\n onPanelWidthChange,\n persistPanelWidthKey,\n ...rest\n },\n ref,\n) {\n const { t } = useTranslation('ui');\n\n // Mirror the active tool id so the rail can build the panel-header controls\n // (favourite + close) for whichever tool is open. Controlled hosts own the\n // value via `activeToolId`; otherwise we seed from `defaultActiveToolId` and\n // track subsequent changes through the intercepted `onActiveToolChange`.\n const [activeTracked, setActiveTracked] = useState<string | null>(\n activeToolId ?? defaultActiveToolId ?? null,\n );\n const activeId = activeToolId !== undefined ? activeToolId : activeTracked;\n const handleActiveToolChange = useCallback(\n (id: string | null) => {\n if (activeToolId === undefined) setActiveTracked(id);\n onActiveToolChange?.(id);\n },\n [activeToolId, onActiveToolChange],\n );\n // Provider-driven tools when none are passed explicitly. Calling the hook\n // unconditionally is safe — it returns [] outside a provider.\n const merged = useControlRoomMergedTools();\n const resolved = tools ?? merged;\n\n const isControlled = favoriteIds !== undefined;\n // Uncontrolled favourites persist to localStorage; the lazy initial seeds\n // from the host's `global` tools on first mount only (later tool changes\n // don't re-seed — favourites are user-owned once set). When controlled, the\n // hook is disabled so it never reads or writes storage.\n const [storedFavorites, setStoredFavorites] = usePersistentState<string[]>(\n persistFavoritesKey,\n () =>\n defaultFavoriteIds ??\n resolved.filter((tl) => tl.scope === 'global').map((tl) => tl.id),\n { disabled: isControlled },\n );\n const userFavorites = isControlled ? favoriteIds : storedFavorites;\n /* Hard-pinned ids lead the group every render — user favourites follow,\n deduped. Because the merge happens HERE (not in storage), an unpin\n write simply has no effect on a pinned id. */\n const favorites = useMemo(() => {\n if (!pinnedFavoriteIds?.length) return userFavorites;\n return [\n ...pinnedFavoriteIds,\n ...userFavorites.filter((id) => !pinnedFavoriteIds.includes(id)),\n ];\n }, [pinnedFavoriteIds, userFavorites]);\n\n // Uncontrolled panel-width persistence mirrors favourites, but is opt-in\n // (no default key) since not every rail wants its width remembered.\n // The hook is called unconditionally — `disabled` just keeps it from\n // touching storage when controlled or when no key was given.\n const isWidthControlled = panelWidth !== undefined;\n const [storedPanelWidth, setStoredPanelWidth] = usePersistentState<\n number | null\n >(persistPanelWidthKey ?? 'ui.controlRoom.panelWidth.unused', null, {\n disabled: isWidthControlled || !persistPanelWidthKey,\n });\n const resolvedPanelWidth = isWidthControlled\n ? panelWidth\n : persistPanelWidthKey\n ? storedPanelWidth\n : undefined;\n const handlePanelWidthChange = useCallback(\n (next: number | null) => {\n if (!isWidthControlled && persistPanelWidthKey) {\n setStoredPanelWidth(next);\n }\n onPanelWidthChange?.(next);\n },\n [\n isWidthControlled,\n persistPanelWidthKey,\n setStoredPanelWidth,\n onPanelWidthChange,\n ],\n );\n\n const byId = useMemo(() => {\n const map = new Map<string, ControlRoomTool>();\n for (const tl of resolved) map.set(tl.id, tl);\n return map;\n }, [resolved]);\n\n // Favourites filtered to currently-present tools. Absent ids are hidden,\n // never dropped: a tool that needs a selection comes back to its place.\n const favoriteSet = useMemo(\n () => new Set(favorites.filter((id) => byId.has(id))),\n [favorites, byId],\n );\n\n const updateFavorites = (\n toolId: string,\n updater: (prev: string[]) => string[],\n ) => {\n // `updater` must be pure — it is invoked twice (once to compute the\n // reported `next`, once inside the functional setState below). It sees\n // present tools only; keepAbsentFavorites restores the rest.\n const isPresent = (id: string) => byId.has(id);\n const previous = favorites.filter(isPresent);\n const next = updater(previous);\n // Persist via a functional update so rapid pin/reorder events compose\n // (mirrors the Sidebar's useFavorites); controlled hosts own the value.\n if (!isControlled)\n setStoredFavorites((prev) =>\n keepAbsentFavorites(prev, isPresent, updater(prev.filter(isPresent))),\n );\n onFavoriteIdsChange?.(\n keepAbsentFavorites(favorites, isPresent, next),\n favoriteChangeOf(toolId, previous, next, pinnedFavoriteIds),\n );\n };\n\n // Re-group into the pinned run (favourites order, tagged so ToolRail draws\n // the divider) followed by the rest. EVERY tool is `reorderable` so the rail's\n // reorder run spans the whole strip — that's what lets a drag / Alt+Arrow\n // cross the divider; `handleReorder` reads the crossing as pin / unpin.\n const railTools = useMemo<ControlRoomTool[]>(() => {\n if (!reorderable) return resolved;\n const favTools = favorites\n .filter((id) => byId.has(id))\n .map((id) => ({\n ...(byId.get(id) as ControlRoomTool),\n scope: 'global' as const,\n reorderable: true,\n }));\n const rest = resolved\n .filter((tl) => !favoriteSet.has(tl.id))\n .map((tl) => ({\n ...tl,\n scope: 'contextual' as const,\n reorderable: true,\n }));\n return [...favTools, ...rest];\n }, [reorderable, resolved, favorites, byId, favoriteSet]);\n\n // The drag / Alt+Arrow path announces through the rail's own reorder live\n // region; the panel-header button toggles outside it, so it needs its own\n // polite announcement. The zero-width-space toggle forces a re-announce of an\n // identical message (e.g. pin → unpin → pin the same tool).\n const [pinMessage, setPinMessage] = useState('');\n const pinAnnounceToggle = useRef(false);\n const announcePinChange = (label: string, willPin: boolean) => {\n const text = willPin\n ? t('controlRoom.pinnedAnnounce', {\n tool: label,\n defaultValue: 'Pinned {{tool}} to favourites',\n })\n : t('controlRoom.unpinnedAnnounce', {\n tool: label,\n defaultValue: 'Removed {{tool}} from favourites',\n });\n pinAnnounceToggle.current = !pinAnnounceToggle.current;\n setPinMessage(pinAnnounceToggle.current ? text : `${text}\\u200B`);\n };\n\n const togglePin = (id: string) => {\n announcePinChange(byId.get(id)?.label ?? id, !favoriteSet.has(id));\n updateFavorites(id, (prev) =>\n prev.includes(id) ? prev.filter((p) => p !== id) : [...prev, id],\n );\n };\n\n // The rail fires `onReorder` with indices into `railTools` (favourites first,\n // then the rest). The divider sits at `favCount`, so the index either side of\n // it tells us whether a move is a reorder, a pin, an unpin, or a no-op.\n const handleReorder = (from: number, to: number) => {\n const movedId = railTools[from]?.id;\n if (movedId === undefined) return;\n updateFavorites(movedId, (prev) => {\n const present = prev.filter((id) => byId.has(id));\n const favCount = present.length;\n const wasFav = from < favCount;\n if (wasFav) {\n // Dropped below the divider → unpin.\n if (to >= favCount) return present.filter((id) => id !== movedId);\n // Reorder within favourites (full-strip index == favourites index).\n const next = present.slice();\n next.splice(from, 1);\n next.splice(to, 0, movedId);\n return next;\n }\n // A contextual tool dropped onto / above the divider → pin at that slot.\n if (to <= favCount) {\n const next = present.slice();\n next.splice(Math.min(to, favCount), 0, movedId);\n return next;\n }\n // Contextual → contextual: that group is host-ordered, so nothing to do.\n return prev;\n });\n };\n\n // Membership-aware live-region phrasing for the rail's reorder announcer.\n const formatReorderAnnouncement = ({\n tool,\n from,\n to,\n }: {\n tool: ControlRoomTool;\n from: number;\n to: number;\n }): string => {\n const favCount = favoriteSet.size;\n const wasFav = from < favCount;\n if (wasFav && to >= favCount)\n return t('controlRoom.unpinnedAnnounce', {\n tool: tool.label,\n defaultValue: 'Removed {{tool}} from favourites',\n });\n if (!wasFav && to <= favCount)\n return t('controlRoom.pinnedAnnounce', {\n tool: tool.label,\n defaultValue: 'Pinned {{tool}} to favourites',\n });\n if (wasFav && to < favCount)\n return t('controlRoom.reorderAnnounce', {\n tool: tool.label,\n to: to + 1,\n total: favCount,\n defaultValue: '{{tool}} moved to position {{to}} of {{total}}',\n });\n // Contextual → contextual is a no-op; stay silent.\n return '';\n };\n\n // Register the rail's imperative handle with the provider (so a page's\n // useControlRoomActions().openTool can drive it) AND forward it to the\n // consumer's ref. A callback ref does both; no-op without a provider. We also\n // stash it locally so the injected close control can collapse the panel.\n const railHandleRef = useRef<ToolRailHandle | null>(null);\n const registerRail = useControlRoomRailRegister();\n // Lets a queued openTool wait until its tool is here. The handle changes\n // with the tools, so the rail re-registers each time they change.\n const byIdRef = useRef(byId);\n byIdRef.current = byId;\n const hasTool = useCallback((id: string) => {\n const tool = byIdRef.current.get(id);\n return tool !== undefined && !tool.disabled;\n }, []);\n const setRefs = useCallback(\n (handle: ToolRailHandle | null) => {\n railHandleRef.current = handle;\n registerRail(handle, hasTool);\n if (typeof ref === 'function') ref(handle);\n else if (ref) ref.current = handle;\n },\n [registerRail, hasTool, ref],\n );\n\n // The active tool's panel-header controls, injected into its PanelHeader's\n // action cluster (inline-end of the title row) via context — no separate\n // header row. When a tool is open: an icon-only favourite toggle (only when\n // reorderable; pressed state via aria-pressed + the filled star) followed by\n // a close control that collapses the panel. Nothing injected when collapsed\n // or where the panel renders no PanelHeader.\n const activeTool = activeId != null ? (byId.get(activeId) ?? null) : null;\n const injectedActions: ReactNode = activeTool ? (\n <>\n {reorderable\n ? (() => {\n const pinned = favoriteSet.has(activeTool.id);\n return (\n <IconButton\n icon={\n <Star\n aria-hidden=\"true\"\n fill={pinned ? 'currentColor' : 'none'}\n className={\n pinned ? 'ds:text-[color:var(--accent)]' : undefined\n }\n />\n }\n intent=\"ghost\"\n size=\"sm\"\n aria-pressed={pinned}\n aria-label={t('controlRoom.favorite', {\n defaultValue: 'Favourite',\n })}\n onClick={() => togglePin(activeTool.id)}\n />\n );\n })()\n : null}\n <IconButton\n icon={<X aria-hidden=\"true\" />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('controlRoom.close', { defaultValue: 'Close' })}\n onClick={() => railHandleRef.current?.close()}\n />\n </>\n ) : null;\n return (\n <PanelHeaderActionsProvider actions={injectedActions}>\n <ToolRail\n ref={setRefs}\n dataComponent=\"control-room-rail\"\n agentAdapter={controlRoomRailAgent}\n tools={railTools}\n activeToolId={activeToolId}\n defaultActiveToolId={defaultActiveToolId}\n onActiveToolChange={handleActiveToolChange}\n panelWidth={resolvedPanelWidth}\n onPanelWidthChange={handlePanelWidthChange}\n railLabel={\n railLabel ??\n t('controlRoom.railLabel', { defaultValue: 'Control room' })\n }\n onReorder={reorderable ? handleReorder : undefined}\n formatReorderAnnouncement={\n reorderable ? formatReorderAnnouncement : undefined\n }\n {...rest}\n />\n {/* Polite announcement for the panel-header pin / unpin button (the\n drag / Alt+Arrow path announces via the rail's own reorder region). */}\n {reorderable ? (\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {pinMessage}\n </span>\n ) : null}\n </PanelHeaderActionsProvider>\n );\n});\n"],"names":["controlRoomRailAgent","handle","args","QUEUED_OPEN_TIMEOUT_MS","ControlRoomContext","createContext","ControlRoomProvider","globalTools","children","registry","setRegistry","useState","registerContextualTools","useCallback","id","tools","prev","next","unregisterContextualTools","contextualTools","useMemo","railRef","useRef","pendingRef","dropPending","registerRail","hasTool","pending","useEffect","openTool","rail","closeTool","_a","value","jsx","useControlRoomTools","ctx","useContext","register","unregister","useId","useControlRoomMergedTools","contextual","tool","global","useControlRoomActions","noop","useControlRoomRailRegister","favoriteChangeOf","toolId","previous","hardPinned","was","is","shown","list","before","after","index","keepAbsentFavorites","all","isPresent","nextPresent","kept","leading","anchor","merged","ControlRoomRail","forwardRef","railLabel","reorderable","favoriteIds","defaultFavoriteIds","pinnedFavoriteIds","onFavoriteIdsChange","persistFavoritesKey","activeToolId","defaultActiveToolId","onActiveToolChange","panelWidth","onPanelWidthChange","persistPanelWidthKey","rest","ref","t","useTranslation","activeTracked","setActiveTracked","activeId","handleActiveToolChange","resolved","isControlled","storedFavorites","setStoredFavorites","usePersistentState","tl","userFavorites","favorites","isWidthControlled","storedPanelWidth","setStoredPanelWidth","resolvedPanelWidth","handlePanelWidthChange","byId","map","favoriteSet","updateFavorites","updater","railTools","favTools","pinMessage","setPinMessage","pinAnnounceToggle","announcePinChange","label","willPin","text","togglePin","p","handleReorder","from","to","movedId","present","favCount","formatReorderAnnouncement","wasFav","railHandleRef","byIdRef","setRefs","activeTool","injectedActions","jsxs","Fragment","pinned","IconButton","Star","X","PanelHeaderActionsProvider","ToolRail"],"mappings":";;;;;;;;;AAwBO,MAAMA,KAA4D;AAAA,EACvE,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,SAAS,eAAe;AAAA,EAC/C,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,gBAAA;AAAA,IAAgB;AAAA,IAE3C,WAAW;AAAA,MACT,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,aAAA;AAAA,IAAa;AAAA,EACxC;AAAA,EAEF,SAAS;AAAA,IACP,MAAM;AAAA;AAAA,MAEJ,QAAQ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QACL,eAAc;AAAA,QACd,cAAcjI;AAAA,QACd,OAAO4G;AAAA,QACP,cAAAhC;AAAA,QACA,qBAAAC;AAAA,QACA,oBAAoBY;AAAA,QACpB,YAAYY;AAAA,QACZ,oBAAoBC;AAAA,QACpB,WACEjC,KACAe,EAAE,yBAAyB,EAAE,cAAc,gBAAgB;AAAA,QAE7D,WAAWd,IAAciD,KAAgB;AAAA,QACzC,2BACEjD,IAAcuD,KAA4B;AAAA,QAE3C,GAAG3C;AAAA,MAAA;AAAA,IAAA;AAAA,IAILZ,IACC,gBAAApC,EAAC,QAAA,EAAK,MAAK,UAAS,aAAU,UAAS,WAAU,cAC9C,UAAA4E,GAAA,CACH,IACE;AAAA,EAAA,GACN;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"control-room-rail-DcJpHbp4.js","sources":["../../src/components/control-room-rail/control-room-rail.agent.ts","../../src/components/control-room-rail/control-room-context.tsx","../../src/components/control-room-rail/control-room-rail.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ControlRoomRail. */\n/* */\n/* The product surface built on ToolRail: the docked \"Control Room\". */\n/* It claims its OWN agent identity ('control-room-rail') so an agent and */\n/* the DOM / cascade boundary can tell the Control Room apart from a bare */\n/* ToolRail. Generic rail surface only: open / close a tool's panel and */\n/* read which tool is active. State is strictly the active tool id — never */\n/* any tool's panel CONTENT (which may carry PHI). */\n/* */\n/* The descriptionKeys deliberately REUSE the existing */\n/* `ui.toolRail.agent.*` translations — no new i18n keys are coined this */\n/* pass. */\n/* */\n/* NOTE: pin / unpin / reorder favourites are intentionally NOT yet an */\n/* agent capability. Exposing them is a deferred follow-up: it needs a */\n/* closed-vocabulary capability addition (DS-maintainer approval per */\n/* src/docs/26-agent-readiness.mdx) plus its own 18-locale descriptionKeys */\n/* — neither of which this pass introduces. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ControlRoomRailHandle } from './control-room-rail';\n\nexport const controlRoomRailAgent: AgentAdapter<ControlRoomRailHandle> = {\n id: 'control-room-rail',\n capabilities: ['open', 'close', 'select_single'],\n state: {\n activeToolId: {\n type: 'string | null',\n descriptionKey: 'ui.toolRail.agent.state.activeToolId',\n description:\n 'Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.',\n read: (handle) => handle.getActiveToolId(),\n },\n panelMode: {\n type: \"'docked' | 'overlay' | 'full-screen'\",\n descriptionKey: 'ui.agent.controlRoomRail.state.panelMode',\n description:\n 'How an open panel shows: docked beside the content, over it because the frame keeps a minimum width for main, or full screen on a phone.',\n read: (handle) => handle.getPanelMode(),\n },\n },\n actions: {\n open: {\n // Pure ephemeral panel state (open) — no data loss, no external effect.\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.open',\n description: \"Open the given tool's panel.\",\n examples: [{ args: { id: 'inbox' }, note: 'Open the inbox tool panel.' }],\n invoke: (handle, args: { id: string }) => {\n handle.open(args.id);\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.close',\n description: 'Collapse the rail to its strip (no active tool).',\n invoke: (handle) => {\n handle.close();\n },\n },\n select_tool: {\n safety: 'read',\n argsType: '{ id: string | null }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: ['string', 'null'] } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.selectTool',\n description:\n 'Set the active tool by id (opens its panel), or pass null to collapse.',\n invoke: (handle, args: { id: string | null }) => {\n handle.setActiveTool(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'control-room-rail',\n description: 'Marks the ControlRoomRail wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific rail from the agent.',\n },\n item: {\n attr: 'data-tool-id',\n description:\n 'Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id.',\n },\n },\n};\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport type { ToolRailHandle, ToolRailTool } from '../tool-rail';\n\n/* ------------------------------------------------------------------ */\n/* Control Room context — the scope mechanism */\n/* */\n/* The DS provides the plumbing; the CONSUMER declares scope by which */\n/* API it reaches for: */\n/* - <ControlRoomProvider globalTools={…}> → `global` tools, set */\n/* once at the app shell, persist across navigation. */\n/* - useControlRoomTools([…]) → `contextual` tools, */\n/* registered per-page, swap with the open entity. */\n/* `<ControlRoomRail>` reads the merged set; `global` tools seed the */\n/* default favourites (pinned on top), `contextual` tools fall below */\n/* the divider. The rail renders the divider between the two groups. */\n/* ------------------------------------------------------------------ */\n\ninterface ControlRoomContextValue {\n globalTools: ToolRailTool[];\n contextualTools: ToolRailTool[];\n registerContextualTools: (id: string, tools: ToolRailTool[]) => void;\n unregisterContextualTools: (id: string) => void;\n // The rail registers its imperative handle here so pages can drive it\n // (e.g. open the X-ray panel when a tooth is clicked). Null until mounted.\n registerRail: RegisterRail;\n openTool: (id: string) => void;\n closeTool: () => void;\n}\n\n/** The rail's handle, and whether it currently holds a given tool. */\ntype RegisterRail = (\n handle: ToolRailHandle | null,\n hasTool?: (id: string) => boolean,\n) => void;\n\n/** How long a queued `openTool` waits for its tool and the rail to register\n * before it is dropped, so a tool added much later never pops open. */\nexport const QUEUED_OPEN_TIMEOUT_MS = 1000;\n\nconst ControlRoomContext = createContext<ControlRoomContextValue | null>(null);\n\nexport interface ControlRoomProviderProps {\n /**\n * Tools valid in every context (Alia, Inbox). Set once at the app shell —\n * they pin to the rail's far end and persist across navigation. Memoise\n * this array so it doesn't re-register every render.\n */\n globalTools?: ToolRailTool[];\n children: ReactNode;\n}\n\n/**\n * Holds the Control Room's global tools and the registry of per-context\n * contextual tools. Mount once at the app shell, inside the frame that also\n * renders `<ControlRoomRail>`.\n */\nexport function ControlRoomProvider({\n globalTools = [],\n children,\n}: ControlRoomProviderProps) {\n // id → that registration's contextual tools. Multiple concurrent\n // registrations merge in insertion order (rare, but composes cleanly).\n const [registry, setRegistry] = useState<Map<string, ToolRailTool[]>>(\n () => new Map(),\n );\n\n const registerContextualTools = useCallback(\n (id: string, tools: ToolRailTool[]) => {\n setRegistry((prev) => {\n const next = new Map(prev);\n next.set(id, tools);\n return next;\n });\n },\n [],\n );\n\n const unregisterContextualTools = useCallback((id: string) => {\n setRegistry((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Map(prev);\n next.delete(id);\n return next;\n });\n }, []);\n\n const contextualTools = useMemo(\n () => Array.from(registry.values()).flat(),\n [registry],\n );\n\n // The rail's imperative handle, registered by <ControlRoomRail> on mount.\n // openTool/closeTool drive it so a page can open a panel (e.g. the X-ray\n // viewer when a tooth is clicked) without holding a ref to the rail itself.\n const railRef = useRef<{\n handle: ToolRailHandle;\n hasTool: (id: string) => boolean;\n } | null>(null);\n // An open asked for before its rail or tool is there (a page that mounts\n // the rail or adds a tool and opens it in one click). It opens once both\n // are there, or is dropped after QUEUED_OPEN_TIMEOUT_MS.\n const pendingRef = useRef<{\n id: string;\n timer: ReturnType<typeof setTimeout>;\n } | null>(null);\n const dropPending = useCallback(() => {\n if (pendingRef.current) clearTimeout(pendingRef.current.timer);\n pendingRef.current = null;\n }, []);\n const registerRail = useCallback<RegisterRail>(\n (handle, hasTool = () => true) => {\n if (handle) {\n railRef.current = { handle, hasTool };\n const pending = pendingRef.current;\n if (pending && hasTool(pending.id)) {\n dropPending();\n handle.setActiveTool(pending.id);\n }\n return;\n }\n railRef.current = null;\n // The rail re-registers in the same commit whenever its tools change;\n // drop the queued open only if it is really gone.\n queueMicrotask(() => {\n if (!railRef.current) dropPending();\n });\n },\n [dropPending],\n );\n useEffect(() => dropPending, [dropPending]);\n const openTool = useCallback(\n (id: string) => {\n dropPending();\n const rail = railRef.current;\n // A mounted rail without the tool (absent or disabled) waits too, so\n // the id cannot open a tool that turns up minutes later.\n if (rail && rail.hasTool(id)) {\n rail.handle.setActiveTool(id);\n return;\n }\n pendingRef.current = {\n id,\n timer: setTimeout(dropPending, QUEUED_OPEN_TIMEOUT_MS),\n };\n },\n [dropPending],\n );\n const closeTool = useCallback(() => {\n dropPending();\n railRef.current?.handle.setActiveTool(null);\n }, [dropPending]);\n\n const value = useMemo<ControlRoomContextValue>(\n () => ({\n globalTools,\n contextualTools,\n registerContextualTools,\n unregisterContextualTools,\n registerRail,\n openTool,\n closeTool,\n }),\n [\n globalTools,\n contextualTools,\n registerContextualTools,\n unregisterContextualTools,\n registerRail,\n openTool,\n closeTool,\n ],\n );\n\n return (\n <ControlRoomContext.Provider value={value}>\n {children}\n </ControlRoomContext.Provider>\n );\n}\n\n/**\n * Register this context's **contextual** tools (Notes, Appointments, the entity\n * summary). They sit below the favourites divider and unregister automatically\n * when the calling component unmounts (i.e. when you leave the context).\n *\n * Pass a **stable / memoised** array — like `useEffect` deps, a fresh array\n * every render re-registers every render. Wrap it in `useMemo`.\n *\n * No-op when rendered outside a `<ControlRoomProvider>`.\n */\nexport function useControlRoomTools(tools: ToolRailTool[]): void {\n const ctx = useContext(ControlRoomContext);\n // Depend on the STABLE register/unregister callbacks, never the whole\n // context value: the value object changes every time the registry updates\n // (which this very effect triggers), so depending on `ctx` would re-register\n // on every change — an infinite loop. The callbacks are `useCallback([])`.\n const register = ctx?.registerContextualTools;\n const unregister = ctx?.unregisterContextualTools;\n const id = useId();\n useEffect(() => {\n if (!register || !unregister) return undefined;\n register(id, tools);\n return () => unregister(id);\n }, [register, unregister, id, tools]);\n}\n\n/**\n * The merged tool set the rail consumes: contextual tools (auto-tagged\n * `scope: 'contextual'`) then globals (`scope: 'global'`). Scope is assigned\n * here by which API registered the tool — `global` seeds the Control Room's\n * default favourites (pinned on top); `contextual` falls below the divider.\n * `ControlRoomRail` re-groups by favourite membership for the final order.\n * Returns `[]` outside a provider.\n */\nexport function useControlRoomMergedTools(): ToolRailTool[] {\n const ctx = useContext(ControlRoomContext);\n return useMemo(() => {\n if (!ctx) return [];\n const contextual = ctx.contextualTools.map((tool) => ({\n ...tool,\n scope: 'contextual' as const,\n }));\n const global = ctx.globalTools.map((tool) => ({\n ...tool,\n scope: 'global' as const,\n }));\n return [...contextual, ...global];\n }, [ctx]);\n}\n\n/**\n * Open a tool's panel from a page, or collapse it; stable, and a no-op outside\n * a `<ControlRoomProvider>`. An `openTool` for a tool the rail does not hold\n * yet waits up to `QUEUED_OPEN_TIMEOUT_MS`, then is dropped.\n */\nexport function useControlRoomActions(): {\n openTool: (id: string) => void;\n closeTool: () => void;\n} {\n const ctx = useContext(ControlRoomContext);\n const noop = useCallback(() => {}, []);\n return {\n openTool: ctx?.openTool ?? noop,\n closeTool: ctx?.closeTool ?? noop,\n };\n}\n\n/**\n * Internal: the rail registers its imperative handle with the provider so\n * `useControlRoomActions().openTool` can drive it. Returns the stable\n * `registerRail` callback (or a no-op outside a provider).\n */\nexport function useControlRoomRailRegister(): RegisterRail {\n const ctx = useContext(ControlRoomContext);\n const noop = useCallback<RegisterRail>(() => {}, []);\n return ctx?.registerRail ?? noop;\n}\n","import {\n forwardRef,\n useCallback,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Star, X } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { PanelHeaderActionsProvider } from '../panel-header/panel-header';\nimport {\n ToolRail,\n type ToolRailHandle,\n type ToolRailProps,\n type ToolRailTool,\n} from '../tool-rail';\nimport { usePersistentState } from '../../hooks/use-persistent-state';\nimport { controlRoomRailAgent } from './control-room-rail.agent';\nimport {\n useControlRoomMergedTools,\n useControlRoomRailRegister,\n} from './control-room-context';\n\n/* ------------------------------------------------------------------ */\n/* ControlRoomRail — the unified, contextual workspace rail. */\n/* */\n/* The docked right-hand \"Control Room\": the single home for the */\n/* assistant, inbox, notes, appointments and entity summaries */\n/* alongside the main work surface. One panel open at a time, */\n/* non-modal. */\n/* */\n/* It layers a FAVOURITES model over the proven ToolRail (its prior */\n/* name): favourited tools form a pinned group at the TOP of the strip */\n/* above a divider, then everything else below. The default favourites */\n/* are the host's `global` tools (Alia, Inbox) — so the rail opens with */\n/* notifications + Alia on top, the Control Room's default arrangement. */\n/* */\n/* Favouriting is DRAG-FIRST, no per-icon star: drag a tool up across */\n/* the divider to pin it (and drop it where you want in the order), */\n/* drag a favourite back down to unpin. The keyboard equivalent is */\n/* `Alt`+Arrow (crossing the divider pins / unpins, announced). The */\n/* non-drag pointer path — and the discoverable entry point — is an */\n/* add / remove control in each open tool's panel header. */\n/* */\n/* ToolRail stays favourite-agnostic: this layer maps favourite */\n/* membership onto the rail's generic `scope` grouping + (whole-strip) */\n/* `reorderable` run, reads cross-divider moves as pin / unpin, and */\n/* injects the favourite + close controls into the active panel's */\n/* PanelHeader via <PanelHeaderActionsProvider> (no separate header */\n/* row — the controls live inline-end of the panel's title row). */\n/* ------------------------------------------------------------------ */\n\n/** A Control Room tool — the rail tool descriptor, `scope`-aware. */\nexport type ControlRoomTool = ToolRailTool;\n\n/** Imperative handle — open / collapse a tool panel without the DOM. */\nexport type ControlRoomRailHandle = ToolRailHandle;\n\n/** What one favourites write did, for the tool the user acted on. */\nexport interface ControlRoomFavoriteChange {\n toolId: string;\n action: 'pin' | 'unpin' | 'reorder';\n}\n\n/* A hard-pinned id re-pins on the next render, so unpinning it changes\n nothing and reports nothing. */\nfunction favoriteChangeOf(\n toolId: string,\n previous: readonly string[],\n next: readonly string[],\n hardPinned: readonly string[] | undefined,\n): ControlRoomFavoriteChange | undefined {\n const was = previous.includes(toolId);\n const is = next.includes(toolId);\n if (!was && is) return { toolId, action: 'pin' };\n if (was && !is)\n return hardPinned?.includes(toolId)\n ? undefined\n : { toolId, action: 'unpin' };\n /* Compare what the rail shows: hard-pinned ids always lead. */\n const shown = (list: readonly string[]) =>\n hardPinned?.length\n ? [...hardPinned, ...list.filter((id) => !hardPinned.includes(id))]\n : list;\n const before = shown(previous);\n const after = shown(next);\n const reordered =\n before.length !== after.length ||\n before.some((id, index) => after[index] !== id);\n return reordered ? { toolId, action: 'reorder' } : undefined;\n}\n\n/* A write sees only the favourites whose tools are present. This puts the\n absent ones back: each follows the nearest earlier favourite the write\n kept, or leads the list. A write that changes nothing stays unchanged. */\nfunction keepAbsentFavorites(\n all: readonly string[],\n isPresent: (id: string) => boolean,\n nextPresent: readonly string[],\n): string[] {\n const kept = new Set(nextPresent);\n const leading: string[] = [];\n const after = new Map<string, string[]>();\n let anchor: string | null = null;\n for (const id of all) {\n if (isPresent(id)) {\n if (kept.has(id)) anchor = id;\n } else if (anchor === null) {\n leading.push(id);\n } else {\n after.set(anchor, [...(after.get(anchor) ?? []), id]);\n }\n }\n const merged = [\n ...leading,\n ...nextPresent.flatMap((id) => [id, ...(after.get(id) ?? [])]),\n ];\n return Array.from(new Set(merged));\n}\n\nexport interface ControlRoomRailProps extends Omit<\n ToolRailProps,\n | 'tools'\n | 'onReorder'\n | 'formatReorderAnnouncement'\n | 'renderToolAffordance'\n | 'renderPanelHeader'\n> {\n /**\n * Explicit tool set. Omit to read the merged global + contextual tools from\n * the nearest `<ControlRoomProvider>` (+ `useControlRoomTools`).\n */\n tools?: ControlRoomTool[];\n /**\n * Enable the favourites model: a pinned top group, drag / `Alt`+Arrow\n * reordering, and the panel-header add / remove control. Default `true`. Set\n * `false` for the legacy flat strip (tools render in the order / `scope` you\n * pass, no drag, no panel-header control).\n */\n reorderable?: boolean;\n /**\n * Controlled favourite tool ids, in pinned order. When set, the rail does not\n * persist — the host owns the value and is notified via `onFavoriteIdsChange`.\n * Ids of tools that are not in `tools` right now are allowed: the rail hides\n * them and hands them back in `next`.\n */\n favoriteIds?: string[];\n /**\n * HARD-PINNED favourite ids — always rendered at the very START of the\n * pinned group, ahead of (and deduped from) user favourites, in both\n * controlled and uncontrolled modes. Immune to unpin: removing one via\n * the panel-header control or a drag is a no-op (it re-pins on the next\n * render). For tools the product wants permanently one glance away —\n * e.g. notifications at the top of the strip.\n */\n pinnedFavoriteIds?: string[];\n /**\n * Uncontrolled initial favourites. Defaults to the ids of the tools the host\n * marked `scope: 'global'` (Alia, Inbox) — pinning them on top by default.\n * Read once, on the first mount, and only when storage holds nothing: a\n * rail that first mounts before its tools arrive seeds no favourites, so\n * mount it with its tools or pass this.\n */\n defaultFavoriteIds?: string[];\n /** Fires with the next favourites order whenever the user pins / reorders.\n * `next` keeps the favourites of tools that are absent right now, in\n * their places, so store it as given. `change` names the tool acted on\n * and what happened to it; it is absent when the write changed nothing. */\n onFavoriteIdsChange?: (\n next: string[],\n change?: ControlRoomFavoriteChange,\n ) => void;\n /** localStorage key for the uncontrolled favourites. Favourites of tools\n * that are absent right now stay in storage and come back with the tool.\n * Read once, on the first mount: a later change writes the current\n * favourites under the new key instead of reading it. Pass the final\n * (per-user) key from the first render, or remount with\n * `key={persistFavoritesKey}`. */\n persistFavoritesKey?: string;\n /**\n * localStorage key for the uncontrolled committed panel width, mirroring\n * `persistFavoritesKey`: when set and `panelWidth` is absent, the rail\n * seeds its width from storage on mount and writes each commit back.\n * Unlike `persistFavoritesKey` this has no default — persistence is\n * opt-in. Only meaningful with `resizablePanel` — there is nothing to\n * persist without the resize handle.\n */\n persistPanelWidthKey?: string;\n}\n\nexport const ControlRoomRail = forwardRef<\n ControlRoomRailHandle,\n ControlRoomRailProps\n>(function ControlRoomRail(\n {\n tools,\n railLabel,\n reorderable = true,\n favoriteIds,\n defaultFavoriteIds,\n pinnedFavoriteIds,\n onFavoriteIdsChange,\n persistFavoritesKey = 'ui.controlRoom.favorites',\n activeToolId,\n defaultActiveToolId = null,\n onActiveToolChange,\n panelWidth,\n onPanelWidthChange,\n persistPanelWidthKey,\n ...rest\n },\n ref,\n) {\n const { t } = useTranslation('ui');\n\n // Mirror the active tool id so the rail can build the panel-header controls\n // (favourite + close) for whichever tool is open. Controlled hosts own the\n // value via `activeToolId`; otherwise we seed from `defaultActiveToolId` and\n // track subsequent changes through the intercepted `onActiveToolChange`.\n const [activeTracked, setActiveTracked] = useState<string | null>(\n activeToolId ?? defaultActiveToolId ?? null,\n );\n const activeId = activeToolId !== undefined ? activeToolId : activeTracked;\n const handleActiveToolChange = useCallback(\n (id: string | null) => {\n if (activeToolId === undefined) setActiveTracked(id);\n onActiveToolChange?.(id);\n },\n [activeToolId, onActiveToolChange],\n );\n // Provider-driven tools when none are passed explicitly. Calling the hook\n // unconditionally is safe — it returns [] outside a provider.\n const merged = useControlRoomMergedTools();\n const resolved = tools ?? merged;\n\n const isControlled = favoriteIds !== undefined;\n // Uncontrolled favourites persist to localStorage; the lazy initial seeds\n // from the host's `global` tools on first mount only (later tool changes\n // don't re-seed — favourites are user-owned once set). When controlled, the\n // hook is disabled so it never reads or writes storage.\n const [storedFavorites, setStoredFavorites] = usePersistentState<string[]>(\n persistFavoritesKey,\n () =>\n defaultFavoriteIds ??\n resolved.filter((tl) => tl.scope === 'global').map((tl) => tl.id),\n { disabled: isControlled },\n );\n const userFavorites = isControlled ? favoriteIds : storedFavorites;\n /* Hard-pinned ids lead the group every render — user favourites follow,\n deduped. Because the merge happens HERE (not in storage), an unpin\n write simply has no effect on a pinned id. */\n const favorites = useMemo(() => {\n if (!pinnedFavoriteIds?.length) return userFavorites;\n return [\n ...pinnedFavoriteIds,\n ...userFavorites.filter((id) => !pinnedFavoriteIds.includes(id)),\n ];\n }, [pinnedFavoriteIds, userFavorites]);\n\n // Uncontrolled panel-width persistence mirrors favourites, but is opt-in\n // (no default key) since not every rail wants its width remembered.\n // The hook is called unconditionally — `disabled` just keeps it from\n // touching storage when controlled or when no key was given.\n const isWidthControlled = panelWidth !== undefined;\n const [storedPanelWidth, setStoredPanelWidth] = usePersistentState<\n number | null\n >(persistPanelWidthKey ?? 'ui.controlRoom.panelWidth.unused', null, {\n disabled: isWidthControlled || !persistPanelWidthKey,\n });\n const resolvedPanelWidth = isWidthControlled\n ? panelWidth\n : persistPanelWidthKey\n ? storedPanelWidth\n : undefined;\n const handlePanelWidthChange = useCallback(\n (next: number | null) => {\n if (!isWidthControlled && persistPanelWidthKey) {\n setStoredPanelWidth(next);\n }\n onPanelWidthChange?.(next);\n },\n [\n isWidthControlled,\n persistPanelWidthKey,\n setStoredPanelWidth,\n onPanelWidthChange,\n ],\n );\n\n const byId = useMemo(() => {\n const map = new Map<string, ControlRoomTool>();\n for (const tl of resolved) map.set(tl.id, tl);\n return map;\n }, [resolved]);\n\n // Favourites filtered to currently-present tools. Absent ids are hidden,\n // never dropped: a tool that needs a selection comes back to its place.\n const favoriteSet = useMemo(\n () => new Set(favorites.filter((id) => byId.has(id))),\n [favorites, byId],\n );\n\n const updateFavorites = (\n toolId: string,\n updater: (prev: string[]) => string[],\n ) => {\n // `updater` must be pure — it is invoked twice (once to compute the\n // reported `next`, once inside the functional setState below). It sees\n // present tools only; keepAbsentFavorites restores the rest.\n const isPresent = (id: string) => byId.has(id);\n const previous = favorites.filter(isPresent);\n const next = updater(previous);\n // Persist via a functional update so rapid pin/reorder events compose\n // (mirrors the Sidebar's useFavorites); controlled hosts own the value.\n if (!isControlled)\n setStoredFavorites((prev) =>\n keepAbsentFavorites(prev, isPresent, updater(prev.filter(isPresent))),\n );\n onFavoriteIdsChange?.(\n keepAbsentFavorites(favorites, isPresent, next),\n favoriteChangeOf(toolId, previous, next, pinnedFavoriteIds),\n );\n };\n\n // Re-group into the pinned run (favourites order, tagged so ToolRail draws\n // the divider) followed by the rest. EVERY tool is `reorderable` so the rail's\n // reorder run spans the whole strip — that's what lets a drag / Alt+Arrow\n // cross the divider; `handleReorder` reads the crossing as pin / unpin.\n const railTools = useMemo<ControlRoomTool[]>(() => {\n if (!reorderable) return resolved;\n const favTools = favorites\n .filter((id) => byId.has(id))\n .map((id) => ({\n ...(byId.get(id) as ControlRoomTool),\n scope: 'global' as const,\n reorderable: true,\n }));\n const rest = resolved\n .filter((tl) => !favoriteSet.has(tl.id))\n .map((tl) => ({\n ...tl,\n scope: 'contextual' as const,\n reorderable: true,\n }));\n return [...favTools, ...rest];\n }, [reorderable, resolved, favorites, byId, favoriteSet]);\n\n // The drag / Alt+Arrow path announces through the rail's own reorder live\n // region; the panel-header button toggles outside it, so it needs its own\n // polite announcement. The zero-width-space toggle forces a re-announce of an\n // identical message (e.g. pin → unpin → pin the same tool).\n const [pinMessage, setPinMessage] = useState('');\n const pinAnnounceToggle = useRef(false);\n const announcePinChange = (label: string, willPin: boolean) => {\n const text = willPin\n ? t('controlRoom.pinnedAnnounce', {\n tool: label,\n defaultValue: 'Pinned {{tool}} to favourites',\n })\n : t('controlRoom.unpinnedAnnounce', {\n tool: label,\n defaultValue: 'Removed {{tool}} from favourites',\n });\n pinAnnounceToggle.current = !pinAnnounceToggle.current;\n setPinMessage(pinAnnounceToggle.current ? text : `${text}\\u200B`);\n };\n\n const togglePin = (id: string) => {\n announcePinChange(byId.get(id)?.label ?? id, !favoriteSet.has(id));\n updateFavorites(id, (prev) =>\n prev.includes(id) ? prev.filter((p) => p !== id) : [...prev, id],\n );\n };\n\n // The rail fires `onReorder` with indices into `railTools` (favourites first,\n // then the rest). The divider sits at `favCount`, so the index either side of\n // it tells us whether a move is a reorder, a pin, an unpin, or a no-op.\n const handleReorder = (from: number, to: number) => {\n const movedId = railTools[from]?.id;\n if (movedId === undefined) return;\n updateFavorites(movedId, (prev) => {\n const present = prev.filter((id) => byId.has(id));\n const favCount = present.length;\n const wasFav = from < favCount;\n if (wasFav) {\n // Dropped below the divider → unpin.\n if (to >= favCount) return present.filter((id) => id !== movedId);\n // Reorder within favourites (full-strip index == favourites index).\n const next = present.slice();\n next.splice(from, 1);\n next.splice(to, 0, movedId);\n return next;\n }\n // A contextual tool dropped onto / above the divider → pin at that slot.\n if (to <= favCount) {\n const next = present.slice();\n next.splice(Math.min(to, favCount), 0, movedId);\n return next;\n }\n // Contextual → contextual: that group is host-ordered, so nothing to do.\n return prev;\n });\n };\n\n // Membership-aware live-region phrasing for the rail's reorder announcer.\n const formatReorderAnnouncement = ({\n tool,\n from,\n to,\n }: {\n tool: ControlRoomTool;\n from: number;\n to: number;\n }): string => {\n const favCount = favoriteSet.size;\n const wasFav = from < favCount;\n if (wasFav && to >= favCount)\n return t('controlRoom.unpinnedAnnounce', {\n tool: tool.label,\n defaultValue: 'Removed {{tool}} from favourites',\n });\n if (!wasFav && to <= favCount)\n return t('controlRoom.pinnedAnnounce', {\n tool: tool.label,\n defaultValue: 'Pinned {{tool}} to favourites',\n });\n if (wasFav && to < favCount)\n return t('controlRoom.reorderAnnounce', {\n tool: tool.label,\n to: to + 1,\n total: favCount,\n defaultValue: '{{tool}} moved to position {{to}} of {{total}}',\n });\n // Contextual → contextual is a no-op; stay silent.\n return '';\n };\n\n // Register the rail's imperative handle with the provider (so a page's\n // useControlRoomActions().openTool can drive it) AND forward it to the\n // consumer's ref. A callback ref does both; no-op without a provider. We also\n // stash it locally so the injected close control can collapse the panel.\n const railHandleRef = useRef<ToolRailHandle | null>(null);\n const registerRail = useControlRoomRailRegister();\n // Lets a queued openTool wait until its tool is here. The handle changes\n // with the tools, so the rail re-registers each time they change.\n const byIdRef = useRef(byId);\n byIdRef.current = byId;\n const hasTool = useCallback((id: string) => {\n const tool = byIdRef.current.get(id);\n return tool !== undefined && !tool.disabled;\n }, []);\n const setRefs = useCallback(\n (handle: ToolRailHandle | null) => {\n railHandleRef.current = handle;\n registerRail(handle, hasTool);\n if (typeof ref === 'function') ref(handle);\n else if (ref) ref.current = handle;\n },\n [registerRail, hasTool, ref],\n );\n\n // The active tool's panel-header controls, injected into its PanelHeader's\n // action cluster (inline-end of the title row) via context — no separate\n // header row. When a tool is open: an icon-only favourite toggle (only when\n // reorderable; pressed state via aria-pressed + the filled star) followed by\n // a close control that collapses the panel. Nothing injected when collapsed\n // or where the panel renders no PanelHeader.\n const activeTool = activeId != null ? (byId.get(activeId) ?? null) : null;\n const injectedActions: ReactNode = activeTool ? (\n <>\n {reorderable\n ? (() => {\n const pinned = favoriteSet.has(activeTool.id);\n return (\n <IconButton\n icon={\n <Star\n aria-hidden=\"true\"\n fill={pinned ? 'currentColor' : 'none'}\n className={\n pinned ? 'ds:text-[color:var(--accent)]' : undefined\n }\n />\n }\n intent=\"ghost\"\n size=\"sm\"\n aria-pressed={pinned}\n aria-label={t('controlRoom.favorite', {\n defaultValue: 'Favourite',\n })}\n onClick={() => togglePin(activeTool.id)}\n />\n );\n })()\n : null}\n <IconButton\n icon={<X aria-hidden=\"true\" />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('controlRoom.close', { defaultValue: 'Close' })}\n onClick={() => railHandleRef.current?.close()}\n />\n </>\n ) : null;\n return (\n <PanelHeaderActionsProvider actions={injectedActions}>\n <ToolRail\n ref={setRefs}\n dataComponent=\"control-room-rail\"\n agentAdapter={controlRoomRailAgent}\n tools={railTools}\n activeToolId={activeToolId}\n defaultActiveToolId={defaultActiveToolId}\n onActiveToolChange={handleActiveToolChange}\n panelWidth={resolvedPanelWidth}\n onPanelWidthChange={handlePanelWidthChange}\n railLabel={\n railLabel ??\n t('controlRoom.railLabel', { defaultValue: 'Control room' })\n }\n onReorder={reorderable ? handleReorder : undefined}\n formatReorderAnnouncement={\n reorderable ? formatReorderAnnouncement : undefined\n }\n {...rest}\n />\n {/* Polite announcement for the panel-header pin / unpin button (the\n drag / Alt+Arrow path announces via the rail's own reorder region). */}\n {reorderable ? (\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {pinMessage}\n </span>\n ) : null}\n </PanelHeaderActionsProvider>\n );\n});\n"],"names":["controlRoomRailAgent","handle","args","QUEUED_OPEN_TIMEOUT_MS","ControlRoomContext","createContext","ControlRoomProvider","globalTools","children","registry","setRegistry","useState","registerContextualTools","useCallback","id","tools","prev","next","unregisterContextualTools","contextualTools","useMemo","railRef","useRef","pendingRef","dropPending","registerRail","hasTool","pending","useEffect","openTool","rail","closeTool","_a","value","jsx","useControlRoomTools","ctx","useContext","register","unregister","useId","useControlRoomMergedTools","contextual","tool","global","useControlRoomActions","noop","useControlRoomRailRegister","favoriteChangeOf","toolId","previous","hardPinned","was","is","shown","list","before","after","index","keepAbsentFavorites","all","isPresent","nextPresent","kept","leading","anchor","merged","ControlRoomRail","forwardRef","railLabel","reorderable","favoriteIds","defaultFavoriteIds","pinnedFavoriteIds","onFavoriteIdsChange","persistFavoritesKey","activeToolId","defaultActiveToolId","onActiveToolChange","panelWidth","onPanelWidthChange","persistPanelWidthKey","rest","ref","t","useTranslation","activeTracked","setActiveTracked","activeId","handleActiveToolChange","resolved","isControlled","storedFavorites","setStoredFavorites","usePersistentState","tl","userFavorites","favorites","isWidthControlled","storedPanelWidth","setStoredPanelWidth","resolvedPanelWidth","handlePanelWidthChange","byId","map","favoriteSet","updateFavorites","updater","railTools","favTools","pinMessage","setPinMessage","pinAnnounceToggle","announcePinChange","label","willPin","text","togglePin","p","handleReorder","from","to","movedId","present","favCount","formatReorderAnnouncement","wasFav","railHandleRef","byIdRef","setRefs","activeTool","injectedActions","jsxs","Fragment","pinned","IconButton","Star","X","PanelHeaderActionsProvider","ToolRail"],"mappings":";;;;;;;;;AAwBO,MAAMA,KAA4D;AAAA,EACvE,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,SAAS,eAAe;AAAA,EAC/C,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,gBAAA;AAAA,IAAgB;AAAA,IAE3C,WAAW;AAAA,MACT,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,aAAA;AAAA,IAAa;AAAA,EACxC;AAAA,EAEF,SAAS;AAAA,IACP,MAAM;AAAA;AAAA,MAEJ,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY,EAAE,IAAI,EAAE,MAAM,WAAS;AAAA,QACnC,UAAU,CAAC,IAAI;AA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,QACZ,oBAAoBC;AAAA,QACpB,WACEjC,KACAe,EAAE,yBAAyB,EAAE,cAAc,gBAAgB;AAAA,QAE7D,WAAWd,IAAciD,KAAgB;AAAA,QACzC,2BACEjD,IAAcuD,KAA4B;AAAA,QAE3C,GAAG3C;AAAA,MAAA;AAAA,IAAA;AAAA,IAILZ,IACC,gBAAApC,EAAC,QAAA,EAAK,MAAK,UAAS,aAAU,UAAS,WAAU,cAC9C,UAAA4E,GAAA,CACH,IACE;AAAA,EAAA,GACN;AAEJ,CAAC;"}
|
|
@@ -28,7 +28,7 @@ import { S as Ke } from "./state-backed-text-input-Cgh4ms3p.js";
|
|
|
28
28
|
import { S as ea } from "./select-4S-eYZUf.js";
|
|
29
29
|
import { u as ta } from "./registry-DvAUVLHh.js";
|
|
30
30
|
import { u as aa } from "./use-prefers-reduced-motion-BMwIQRjB.js";
|
|
31
|
-
import { u as ra } from "./use-theme-
|
|
31
|
+
import { u as ra } from "./use-theme-CYGyzFgZ.js";
|
|
32
32
|
import { f as na } from "./intl-locale-FWh-Y5_3.js";
|
|
33
33
|
/**
|
|
34
34
|
* @license lucide-react v1.22.0 - ISC
|
|
@@ -1990,4 +1990,4 @@ export {
|
|
|
1990
1990
|
Cr as h,
|
|
1991
1991
|
B as i
|
|
1992
1992
|
};
|
|
1993
|
-
//# sourceMappingURL=data-table-
|
|
1993
|
+
//# sourceMappingURL=data-table-BlONA1rP.js.map
|