@alfadocs/ui-kit-debug 1.41.1 → 1.43.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/{calendar-workspace-Bx8xxvic.js → calendar-workspace-DhXqqu-D.js} +1981 -1968
- package/dist/_chunks/calendar-workspace-DhXqqu-D.js.map +1 -0
- package/dist/_chunks/control-room-rail-Cv7GpMqX.js +354 -0
- package/dist/_chunks/control-room-rail-Cv7GpMqX.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-D_g9BaDI.js → marketplace-app-shell-DdwPj03y.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-D_g9BaDI.js.map → marketplace-app-shell-DdwPj03y.js.map} +1 -1
- package/dist/_chunks/{notes-panel-Daq5T_cS.js → notes-panel-CRAovkjx.js} +84 -68
- package/dist/_chunks/notes-panel-CRAovkjx.js.map +1 -0
- package/dist/_chunks/{sidebar-ClTY9lLI.js → sidebar-DbZXLl8h.js} +2 -2
- package/dist/_chunks/{sidebar-ClTY9lLI.js.map → sidebar-DbZXLl8h.js.map} +1 -1
- package/dist/_chunks/tab-bar-Cw9UK18Z.js +228 -0
- package/dist/_chunks/tab-bar-Cw9UK18Z.js.map +1 -0
- package/dist/_chunks/{tool-rail-D89USYE6.js → tool-rail-CCFqDfAn.js} +282 -276
- package/dist/_chunks/tool-rail-CCFqDfAn.js.map +1 -0
- package/dist/_chunks/use-edge-resize-BHesP0kg.js +149 -0
- package/dist/_chunks/use-edge-resize-BHesP0kg.js.map +1 -0
- package/dist/_chunks/use-scroll-overflow-UbLrUfBo.js +72 -0
- package/dist/_chunks/use-scroll-overflow-UbLrUfBo.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/control-room-rail/control-room-rail.d.ts +9 -0
- package/dist/components/control-room-rail/control-room-rail.d.ts.map +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +32 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts +16 -0
- package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +35 -32
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-edge-resize.d.ts +13 -1
- package/dist/hooks/use-edge-resize.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/patterns/calendar/calendar.journey.d.ts +11 -0
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +20 -0
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/calendar-workspace-Bx8xxvic.js.map +0 -1
- package/dist/_chunks/control-room-rail-CnNZusR5.js +0 -337
- package/dist/_chunks/control-room-rail-CnNZusR5.js.map +0 -1
- package/dist/_chunks/notes-panel-Daq5T_cS.js.map +0 -1
- package/dist/_chunks/tab-bar-rDkLiaA6.js +0 -268
- package/dist/_chunks/tab-bar-rDkLiaA6.js.map +0 -1
- package/dist/_chunks/tool-rail-D89USYE6.js.map +0 -1
- package/dist/_chunks/use-edge-resize-ZnGG7gyO.js +0 -139
- package/dist/_chunks/use-edge-resize-ZnGG7gyO.js.map +0 -1
- package/dist/_chunks/use-overflow-collapse-BIOzKbni.js +0 -32
- package/dist/_chunks/use-overflow-collapse-BIOzKbni.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-rail-CCFqDfAn.js","sources":["../../src/components/tool-rail/tool-rail.agent.ts","../../src/components/tool-rail/tool-rail.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ToolRail. */\n/* */\n/* Rail-level surface: open / close a tool's panel and read which tool */\n/* is active. State is strictly the active tool id — never any tool's */\n/* panel CONTENT (which may carry PHI). Tool ids + badge counts are */\n/* supplied by the host via props, not derived from panel bodies. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ToolRailHandle } from './tool-rail';\n\nexport const toolRailAgent: AgentAdapter<ToolRailHandle> = {\n id: 'tool-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 },\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 shape is intentionally pre-existing — already resolves to\n // real multi-locale translations; do not canonicalise.\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: 'tool-rail',\n description: 'Marks the ToolRail 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 forwardRef,\n Fragment,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { IconButton } from '../button/icon-button';\nimport { ScrollArea } from '../scroll-area/scroll-area';\nimport { TooltipProvider } from '../tooltip/tooltip';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useEdgeResize } from '../../hooks/use-edge-resize';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { REFLOW_ROW_CLASS, useListReflow } from '../../hooks/use-list-reflow';\nimport { useExitTransition } from '../../hooks/use-exit-transition';\nimport { usePrefersReducedMotion } from '../../hooks/use-prefers-reduced-motion';\nimport { usePresenceTransition } from '../../hooks/use-presence-transition';\nimport { useTheme } from '../../hooks/use-theme';\nimport { useAgentRegistration } from '../../agent/registry';\nimport type { AgentAdapter } from '../../agent/types';\nimport { toolRailAgent } from './tool-rail.agent';\n\n/* ------------------------------------------------------------------ */\n/* Tokenised widths */\n/* */\n/* Fixed + tokenised so the rail stays constraint-compliant — no */\n/* prop-driven inline styles. Bare `[inline-size:…]` is NOT a */\n/* recognised utility under the `ds:` prefix; it must carry the */\n/* prefix or Tailwind emits no rule. Consumers needing a different */\n/* size wrap the rail and override via CSS. */\n/* ------------------------------------------------------------------ */\nconst RAIL_WIDTH = 'ds:[inline-size:3rem]';\n// Panel width rides a consumer-overridable custom property (set\n// `--tool-rail-panel-inline-size` on the rail or a wrapper) so\n// content-heavy tools (e.g. an inbox feed) can widen their panel\n// without inline styles. Defaults to the 22rem tray-family width.\n// `--ai-tools-rail-panel-inline-size` is the deprecated alias var read\n// here as a fallback so external consumers that set the pre-rename name\n// keep working for one release; the resize hook only ever writes the new\n// `--tool-rail-panel-inline-size`.\nconst PANEL_WIDTH =\n 'ds:[inline-size:var(--tool-rail-panel-inline-size,var(--ai-tools-rail-panel-inline-size,22rem))]';\n// The custom property PANEL_WIDTH reads. The resize hook writes the\n// committed px width here (on the panel element, so it beats consumer\n// class overrides on the root) and removes it on reset.\nconst PANEL_SIZE_PROPERTY = '--tool-rail-panel-inline-size';\n// Resize clamp + nominal default, px (352px = the 22rem token default).\n// The ceiling is 880 so a form panel can reach a three-column layout:\n// pairing fields is the only way to shorten a long form without\n// shrinking a 44px target, and that needs real inline size.\nconst PANEL_MIN_SIZE = 288;\nconst PANEL_MAX_SIZE = 880;\nconst PANEL_DEFAULT_SIZE = 352;\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface ToolRailTool {\n /** Stable tool id — used in `data-active`, the imperative handle, and\n * to label the open panel region. */\n id: string;\n /** Accessible name for the strip icon + tooltip, and the open panel's\n * region label. Never rendered as visible body text. */\n label: string;\n /** lucide-react glyph (rendered `aria-hidden` inside the IconButton). */\n icon: ReactNode;\n /** Panel body for this tool. Rendered inline-start of the strip when\n * `side='end'` (mirrored for `'start'`). The consumer composes it. */\n panel: ReactNode;\n /**\n * Optional non-scrolling header for this tool's panel. Rendered pinned at\n * the top of the open panel — above the scroll region — so a tool's title /\n * filters stay visible as the body scrolls. This is the rail-level home for\n * a sticky tool header; every tool gets it for free.\n */\n header?: ReactNode;\n /**\n * When true the panel body is NOT wrapped in the rail's `ScrollArea` — the\n * tool fills the (height-bounded) panel and owns its own scroll/layout.\n * Use for self-scrolling tools (e.g. `AppointmentTimeline`, whose infinite\n * scroll + today-anchoring + edge fades require it to be the scroll\n * container). Default `false` (the rail scrolls the body).\n */\n fill?: boolean;\n /** Optional unseen / notification count shown on the strip icon. */\n badgeCount?: number;\n /** When true the icon is non-interactive and skipped by roving focus. */\n disabled?: boolean;\n /**\n * Scope tier (drives the two-group divider). The two scope values render in\n * array order with a divider at the boundary between them — order the array\n * so the groups stay contiguous. A divider only appears when BOTH groups are\n * present; omit `scope` on every tool for an ungrouped strip (legacy). The\n * rail attaches no meaning beyond grouping — the host decides which value\n * leads (e.g. the Control Room pins favourites first).\n */\n scope?: 'global' | 'contextual';\n /**\n * When true this icon joins the drag-and-drop / `Alt`+Arrow reorder run.\n * The host supplies `onReorder` and owns the resulting order. Moves are\n * confined to the contiguous run of `reorderable` tools — so if EVERY tool\n * is `reorderable` the run is the whole strip and a tool can be dragged\n * across the scope divider; the host's `onReorder` decides what crossing it\n * means (e.g. the Control Room reads it as pin / unpin). Reordering never\n * changes focus roving — focus follows the moved tool to its new slot.\n */\n reorderable?: boolean;\n}\n\n/**\n * Curated imperative handle for ToolRail. Exposed as the forwardRef\n * target so a future agent / MCP UI bridge can drive the rail without\n * touching the DOM. See `tool-rail.agent.ts`.\n *\n * State surfaced here is strictly identifiers + counts — never any\n * tool's panel content (which may carry PHI).\n */\nexport interface ToolRailHandle {\n /** Currently-active tool id, or null when collapsed to strip-only. */\n getActiveToolId: () => string | null;\n /** Activate a tool by id (opens its panel), or null to collapse. */\n setActiveTool: (id: string | null) => void;\n /** Activate a tool by id (opens its panel). */\n open: (id: string) => void;\n /** Collapse to strip-only (no active tool). */\n close: () => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA — `side` drives the dock edge + which shadow faces main content */\n/* ------------------------------------------------------------------ */\n\nconst railVariants = cva(\n ['ds:flex ds:shrink-0 ds:h-full', 'ds:bg-[var(--background)]'].join(' '),\n {\n variants: {\n side: {\n // Strip docks inline-end; the panel mounts inline-start of it\n // (flex-row, panel rendered first). Shadow faces the main area —\n // no border against main (the rail stays line-free; the only seam\n // is the strip↔panel divider on the open panel, see render).\n // Accessible (AAA) theme swaps the soft chrome shadow for a solid 1px\n // border on the content-facing edge (border-s for end-docked).\n end: 'ds:flex-row ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n // Strip docks inline-start; the panel mounts inline-end of it.\n start:\n 'ds:flex-row-reverse ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n },\n },\n defaultVariants: { side: 'end' },\n },\n);\n\nconst stripVariants = cva(\n [\n 'ds:flex ds:shrink-0 ds:flex-col ds:items-center',\n 'ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]',\n 'ds:gap-[var(--spacing-xs)]',\n RAIL_WIDTH,\n ].join(' '),\n);\n\nconst panelVariants = cva(\n [\n 'ds:relative ds:flex ds:min-h-0 ds:flex-col ds:h-full',\n 'ds:bg-[var(--background)]',\n PANEL_WIDTH,\n // Open / collapse: the panel fades and slides from the strip. The WIDTH\n // snaps on purpose — animating it would re-lay-out the main area (a\n // calendar grid) on every frame. Declared at rest so both directions\n // have a value to move from.\n 'ds:transition-[opacity,translate] ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n 'ds:data-[presence=entering]:opacity-0 ds:data-[presence=leaving]:opacity-0',\n 'ds:data-[presence=leaving]:pointer-events-none',\n 'ds:data-[resizing]:transition-none',\n ].join(' '),\n {\n variants: {\n // Slide toward the strip the panel belongs to, mirrored in RTL.\n side: {\n end: 'ds:data-[presence=entering]:translate-x-[var(--spacing-md)] ds:data-[presence=leaving]:translate-x-[var(--spacing-md)] ds:rtl:data-[presence=entering]:-translate-x-[var(--spacing-md)] ds:rtl:data-[presence=leaving]:-translate-x-[var(--spacing-md)]',\n start:\n 'ds:data-[presence=entering]:-translate-x-[var(--spacing-md)] ds:data-[presence=leaving]:-translate-x-[var(--spacing-md)] ds:rtl:data-[presence=entering]:translate-x-[var(--spacing-md)] ds:rtl:data-[presence=leaving]:translate-x-[var(--spacing-md)]',\n },\n },\n defaultVariants: { side: 'end' },\n },\n);\n\n/* The box the tool bodies share: a swap stacks two of them here, so the panel\n keeps one height. `clip`, not `hidden`: the swap's short slide must not\n make this a scroll container that a focus call could scroll sideways. */\nconst panelBodiesClass =\n 'ds:relative ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:overflow-clip';\n\n/* Tool-to-tool swap is a short directional push: the new body fades in from\n the inline end over a picture of the old one, which fades out toward the\n inline start. One --animation-duration; the picture's animations are stilled. */\nconst panelBodyVariants = cva(\n [\n 'ds:flex ds:min-h-0 ds:flex-col',\n 'ds:transition-[opacity,translate] ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n 'ds:data-[presence=entering]:opacity-0 ds:data-[presence=leaving]:opacity-0',\n ].join(' '),\n {\n variants: {\n // Same small distance as the panel's own entrance, mirrored in RTL.\n layer: {\n live: [\n 'ds:relative ds:z-[1] ds:flex-1',\n 'ds:data-[presence=entering]:translate-x-[var(--spacing-md)]',\n 'ds:rtl:data-[presence=entering]:-translate-x-[var(--spacing-md)]',\n ].join(' '),\n leaving: [\n 'ds:pointer-events-none ds:absolute ds:inset-0 ds:z-0 ds:[&_*]:!animate-none',\n 'ds:data-[presence=leaving]:-translate-x-[var(--spacing-md)]',\n 'ds:rtl:data-[presence=leaving]:translate-x-[var(--spacing-md)]',\n ].join(' '),\n },\n },\n defaultVariants: { layer: 'live' },\n },\n);\n\n/** Longest a picture waits for its `transitionend` before it is dropped. */\nconst LEAVING_BODY_FALLBACK_MS = 500;\n\n/** A picture of a body on its way out of a swap. `exitId` is unique per swap. */\ninterface LeavingBody {\n exitId: string;\n toolId: string;\n /** Detached, sanitised clones of the old body's children. */\n nodes: Node[];\n /** Scroll offsets to restore once the clones are in the document. */\n scrolls: Array<[Element, number, number]>;\n}\n\n/* Attributes that would make a clone answer for the real thing: ids, form\n group names, kit markers and test handles. */\nconst CLONE_STRIPPED_ATTRIBUTES = [\n 'id',\n 'name',\n 'for',\n 'data-component',\n 'data-component-id',\n 'data-testid',\n];\n\n/** Whether the element's resolved transition lasts any time at all. */\nfunction hasTransition(node: HTMLElement): boolean {\n return window\n .getComputedStyle(node)\n .transitionDuration.split(',')\n .some((part) => Number.parseFloat(part) > 0);\n}\n\n/**\n * A picture of a tool body: deep clones of its children with nothing live in\n * them. The old body itself unmounts at once, exactly as it did before the\n * crossfade, so its effects, guards and pending work never outlive the swap.\n */\nfunction snapshotBody(\n body: HTMLElement,\n): Pick<LeavingBody, 'nodes' | 'scrolls'> {\n const holder = body.cloneNode(true) as HTMLElement;\n const originals = body.querySelectorAll('*');\n const clones = holder.querySelectorAll('*');\n const scrolls: LeavingBody['scrolls'] = [];\n originals.forEach((original, index) => {\n const clone = clones[index];\n if (!clone) return;\n if (original.scrollTop !== 0 || original.scrollLeft !== 0) {\n scrolls.push([clone, original.scrollTop, original.scrollLeft]);\n }\n if (\n original instanceof HTMLCanvasElement &&\n clone instanceof HTMLCanvasElement\n ) {\n try {\n clone.getContext('2d')?.drawImage(original, 0, 0);\n } catch {\n // A canvas that cannot be read back simply fades out blank.\n }\n }\n });\n clones.forEach((clone) => {\n // An svg keeps its ids: gradients and clips are wired by `url(#id)`.\n const inSvg = clone instanceof SVGElement;\n for (const name of CLONE_STRIPPED_ATTRIBUTES) {\n if (!(inSvg && name === 'id')) clone.removeAttribute(name);\n }\n // Nothing in a picture may load, play or run.\n if (clone.matches('iframe, video, audio, embed, object, source')) {\n for (const name of ['src', 'srcdoc', 'data', 'autoplay']) {\n clone.removeAttribute(name);\n }\n }\n });\n return { nodes: Array.from(holder.childNodes), scrolls };\n}\n\n// Resize handle on the panel's inner edge — mirrors Resizable's Handle\n// (::before hit area to --min-target-size, hover/focus/drag accent, token\n// focus ring) but absolutely positioned over the panel edge. Like the\n// Sidebar's handle it stays TRANSPARENT at rest: the rail root's\n// `shadow-chrome-*` (which faces the main content) carries the resting seam,\n// exactly as the start-docked Sidebar leans on its own shadow — so the rail\n// never shows the constant coloured bar it used to. The strip only tints\n// accent on hover / focus / drag.\nconst panelResizeHandleVariants = cva(\n [\n 'ds:absolute ds:[inset-block:0] ds:z-[1] ds:select-none ds:touch-none',\n 'ds:[inline-size:var(--resizable-handle-size)] ds:cursor-col-resize',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[var(--accent)] ds:focus-visible:bg-[var(--accent)] ds:data-[resizing]:bg-[var(--accent)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n \"ds:before:absolute ds:before:content-['']\",\n 'ds:before:[block-size:100%]',\n 'ds:before:[inline-size:var(--min-target-size)]',\n 'ds:before:[inset-block:0]',\n 'ds:before:[inset-inline:calc(0px_-_(var(--min-target-size)_-_var(--resizable-handle-size))_/_2)]',\n ],\n {\n variants: {\n edge: {\n 'inline-start': 'ds:start-0',\n 'inline-end': 'ds:end-0',\n },\n },\n defaultVariants: { edge: 'inline-start' },\n },\n);\n\n// Hand-rolled overlay count chip — mirrors the AliaSidebar / MessageTray\n// badge markup. A <Badge> would re-introduce its own landmark/role; the\n// strip icon already carries the count in its accessible name, so this\n// span is purely decorative (`aria-hidden`).\nconst badgeVariants = cva(\n [\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none',\n 'ds:pointer-events-none ds:select-none',\n 'ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]',\n ].join(' '),\n);\n\n// Per-icon slot — the positioned box that hosts the IconButton, its badge and\n// the optional affordance overlay. CVA carries the drag states: the dragged\n// icon dims; a hovered drop target shows a dashed accent ring (logical offset),\n// mirroring the Sidebar's favourite-row affordance.\nconst toolSlotVariants = cva(\n // `group/rail-tool` lets an affordance overlay (e.g. a pin star) reveal on\n // hover / focus-within of the whole slot.\n ['ds:group/rail-tool ds:relative', 'ds:rounded-[var(--radius-sm)]'],\n {\n variants: {\n dragging: { true: 'ds:opacity-60', false: '' },\n dropTarget: {\n true: 'ds:outline-[length:var(--focus-ring-width)] ds:outline-dashed ds:outline-[var(--accent)] ds:outline-offset-[length:var(--focus-ring-offset)]',\n false: '',\n },\n reorderable: {\n true: 'ds:cursor-grab ds:active:cursor-grabbing',\n false: '',\n },\n },\n defaultVariants: {\n dragging: false,\n dropTarget: false,\n reorderable: false,\n },\n },\n);\n\n/* A departing tool slot fades in place; the reflow hook then slides the\n surviving icons to close the gap. Declared at rest so the transition\n has a value to animate from the moment the leaving class lands. */\nconst toolLeavingClass = 'ds:opacity-0';\nconst toolElevationClass = [\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface ToolRailProps extends VariantProps<typeof railVariants> {\n /** Stable instance id, surfaced on the root as `data-component-id`. */\n id?: string;\n /** The tools shown as icons on the strip. */\n tools: ToolRailTool[];\n /** Controlled active tool id (null = collapsed / strip-only). */\n activeToolId?: string | null;\n /** Uncontrolled initial active tool id (default null). */\n defaultActiveToolId?: string | null;\n /** Fires whenever the active tool changes (incl. → null on collapse). */\n onActiveToolChange?: (id: string | null) => void;\n /** Which edge the rail docks to. Default `'end'` (inline-end). */\n side?: 'start' | 'end';\n /** Accessible label for the toolbar strip. */\n railLabel?: string;\n /**\n * Opt-in resize affordance for the open tool panel. Renders a\n * `role=\"separator\"` drag handle on the panel's inner edge (the edge\n * facing the main content). The committed width is written to\n * `--tool-rail-panel-inline-size` on the panel element (288–880px);\n * Enter / double-click resets to the token-driven default. Default `false`.\n */\n resizablePanel?: boolean;\n /**\n * Controlled committed panel width, px; `null` for the token-driven\n * default. Only meaningful when `resizablePanel` is `true` — the width\n * has nothing to resize without the handle. Applied to\n * `--tool-rail-panel-inline-size` on mount and whenever it changes,\n * clamped to 288–880px. Omit for uncontrolled sizing (the rail owns the\n * committed width internally, the existing behaviour).\n */\n panelWidth?: number | null;\n /**\n * Fires with the committed px width on every commit — pointer release,\n * a keyboard step, or `null` on reset (Enter / double-click). Fires\n * whether or not `panelWidth` is controlled, so an uncontrolled host can\n * still observe the width to persist it.\n */\n onPanelWidthChange?: (px: number | null) => void;\n /**\n * Fires when the user reorders the `reorderable` run (drag-drop or\n * `Alt`+Arrow). `from` / `to` are indices into `tools`; the host applies the\n * move to the array it passes back. Reordering is enabled when this callback\n * is supplied AND at least one tool is `reorderable`. When the whole strip is\n * reorderable, `to` may land in the other scope group — the host interprets\n * the crossing (and may treat it as a no-op, e.g. reordering within a\n * host-ordered group).\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * Optional override for the polite live-region message announced after a\n * reorder. Lets the host phrase membership-aware moves (e.g. \"Pinned X to\n * favourites\") instead of the generic \"moved to position N\". Return an empty\n * string to stay silent (e.g. for a move the host treats as a no-op). When\n * omitted, the rail announces the generic run-relative position.\n */\n formatReorderAnnouncement?: (args: {\n tool: ToolRailTool;\n from: number;\n to: number;\n }) => string;\n /**\n * Optional per-icon overlay control, rendered as a sibling of each strip\n * IconButton (the same positioned box the notification badge uses). Use for\n * a small affordance such as a pin toggle — the rail attaches no meaning to\n * what it renders. Receives the tool and its index / active state.\n */\n renderToolAffordance?: (\n tool: ToolRailTool,\n context: { index: number; isActive: boolean; isRovingTarget: boolean },\n ) => ReactNode;\n /**\n * Optional non-scrolling header rendered at the top of the OPEN tool panel,\n * above its scroll region. Host-owned content (e.g. a pin / unpin control) —\n * the rail attaches no meaning. Receives the active tool.\n */\n renderPanelHeader?: (\n tool: ToolRailTool,\n context: { isActive: boolean },\n ) => ReactNode;\n /**\n * Identity override for the root's `data-component` attribute. Defaults to\n * `'tool-rail'`. A product wrapper (e.g. ControlRoomRail) passes its own\n * kebab id so the DOM / cascade boundary — and an agent's `domHooks.root` —\n * can tell its surface apart from a bare ToolRail, without the engine ever\n * importing the wrapper.\n */\n dataComponent?: string;\n /**\n * Agent adapter registered for this rail instance. Defaults to\n * `toolRailAgent`. A wrapper passes its own adapter (matching\n * `dataComponent`) so the rail registers under the wrapper's identity. The\n * instance id is sourced from the `id` prop (also stamped as\n * `data-component-id`).\n */\n agentAdapter?: AgentAdapter<ToolRailHandle>;\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number, overflowLabel: string): string {\n return count > 99 ? overflowLabel : String(count);\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const ToolRail = forwardRef<ToolRailHandle, ToolRailProps>(\n (\n {\n id,\n tools,\n activeToolId,\n defaultActiveToolId = null,\n onActiveToolChange,\n side = 'end',\n railLabel,\n resizablePanel = false,\n panelWidth,\n onPanelWidthChange,\n onReorder,\n formatReorderAnnouncement,\n renderToolAffordance,\n renderPanelHeader,\n dataComponent = 'tool-rail',\n agentAdapter = toolRailAgent,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n // Controlled / uncontrolled bridge — the same hook MessageTray uses.\n const [activeRaw, setActiveRaw] = useControllableState<string | null>({\n value: activeToolId,\n defaultValue: defaultActiveToolId,\n onChange: onActiveToolChange,\n });\n const activeId = activeRaw ?? null;\n\n // Roving-tabindex bookkeeping for the vertical toolbar strip.\n const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const panelRef = useRef<HTMLElement | null>(null);\n const [focusIndex, setFocusIndex] = useState(0);\n // Distinguishes keyboard activation (auto-focus into the panel) from\n // pointer activation (focus stays on the icon — less jarring).\n const activatedByKeyboardRef = useRef(false);\n // Set on Enter/Space keydown, read by the click handler that follows,\n // cleared on keyup — so a subsequent mouse click never inherits it.\n const keyboardActivateRef = useRef(false);\n\n const activeIndex = useMemo(\n () => tools.findIndex((tl) => tl.id === activeId),\n [tools, activeId],\n );\n const activeTool = activeIndex >= 0 ? tools[activeIndex] : null;\n // The panel outlives `activeTool` by one exit, so it keeps the last tool\n // it showed to have something to fade out.\n const lastToolRef = useRef<ToolRailTool | null>(activeTool);\n if (activeTool) lastToolRef.current = activeTool;\n\n // First non-disabled index — the resting roving stop when none active.\n const firstEnabledIndex = useMemo(\n () => tools.findIndex((tl) => !tl.disabled),\n [tools],\n );\n\n // Scope grouping: a divider marks the boundary between the two scope groups,\n // whichever order they appear in. The array is always grouped (all of one\n // scope, then the other); the divider precedes the first tool whose scope\n // differs from the lead tool's. `boundary > 0` guarantees both groups are\n // present. Render-only (not a `tools[]` member) so roving focus is untouched;\n // a legacy strip with no `scope` set stays ungrouped.\n const scopeDividerIndex = useMemo(() => {\n const lead = tools[0]?.scope;\n if (!lead) return -1;\n return tools.findIndex((tl) => tl.scope && tl.scope !== lead);\n }, [tools]);\n const showScopeDivider = scopeDividerIndex > 0;\n\n /* ---- Reorder (drag-and-drop + Alt+Arrow keyboard) ------------- */\n // The contiguous run of `reorderable` tools — a tool only moves within it.\n const reorderRun = useMemo(() => {\n const first = tools.findIndex((tl) => tl.reorderable);\n if (first < 0) return null;\n let last = first;\n while (last + 1 < tools.length && tools[last + 1]?.reorderable) last += 1;\n return { first, last };\n }, [tools]);\n const reorderEnabled = !!onReorder && reorderRun !== null;\n const reorderInstructionsId = useId();\n\n const [dragIndex, setDragIndex] = useState<number | null>(null);\n const [dropIndex, setDropIndex] = useState<number | null>(null);\n\n /* ---- Strip enter / exit / reflow animations ------------------ */\n /* The same hooks the note/task panels use, applied to the icon strip:\n when a contextual tool appears or disappears (e.g. selecting an\n appointment adds Notes + Details), surviving icons slide to their\n new positions and departing icons fade out in place. */\n const { resolvedTheme } = useTheme();\n const reduceMotion = resolvedTheme.endsWith('-accessible') || undefined;\n\n const { containerRef: reflowRef } = useListReflow<HTMLDivElement>({\n key: tools.map((tl) => tl.id).join(),\n reduceMotion,\n });\n\n const exit = useExitTransition({ reduceMotion });\n\n /* ---- Panel open / collapse, and tool-to-tool swap ------------- */\n const panelPresence = usePresenceTransition<HTMLElement>(\n activeTool !== null,\n { reduceMotion },\n );\n const panelLeaving = activeTool === null && panelPresence.mounted;\n const shownTool = activeTool ?? (panelLeaving ? lastToolRef.current : null);\n const { ref: presenceRef } = panelPresence;\n const setPanelNode = useCallback(\n (node: HTMLElement | null) => {\n panelRef.current = node;\n presenceRef(node);\n },\n [presenceRef],\n );\n // `inert` set on the node, not as a prop: React 18 has no boolean for it.\n useIsomorphicLayoutEffect(() => {\n const node = panelRef.current;\n if (!node) return;\n // Nothing focused may sit inside a hidden subtree. If focus was in the\n // panel, hand it to the tool's own icon in this same commit; the Escape\n // and close paths then find it already there.\n const active = document.activeElement;\n if (\n panelLeaving &&\n active instanceof HTMLElement &&\n node.contains(active)\n ) {\n const returnId = lastToolRef.current?.id;\n const icon = returnId\n ? rootRef.current?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(returnId)}\"]`,\n )\n : null;\n active.blur();\n node.setAttribute('inert', '');\n icon?.focus();\n return;\n }\n node.toggleAttribute('inert', panelLeaving);\n }, [panelLeaving]);\n // The body fades in when a tool replaces another in an already-open\n // panel; the panel's own entrance covers a first open. DERIVED during\n // render from the last tool that settled, so the new body's first commit\n // is already `entering` and the fade never starts from the wrong end.\n const systemReducedMotion = usePrefersReducedMotion();\n const [settledToolId, setSettledToolId] = useState<string | null>(\n activeTool?.id ?? null,\n );\n const shownActiveId = activeTool?.id ?? null;\n const bodyEntering =\n !reduceMotion &&\n !systemReducedMotion &&\n shownActiveId !== null &&\n settledToolId !== null &&\n settledToolId !== shownActiveId;\n useIsomorphicLayoutEffect(() => {\n if (settledToolId === shownActiveId) return undefined;\n if (!bodyEntering) {\n setSettledToolId(shownActiveId);\n return undefined;\n }\n // Two frames to paint `entering` and move off it; the timer covers a\n // hidden tab, which gets no frames.\n let inner = 0;\n const settle = () => setSettledToolId(shownActiveId);\n const outer = requestAnimationFrame(() => {\n inner = requestAnimationFrame(settle);\n });\n const fallback = window.setTimeout(settle, 64);\n return () => {\n cancelAnimationFrame(outer);\n cancelAnimationFrame(inner);\n window.clearTimeout(fallback);\n };\n }, [shownActiveId, settledToolId, bodyEntering]);\n\n // The crossfade's other half: a picture of the body being replaced, held\n // under the new one until its fade has played. Taken DURING render, so the\n // commit that mounts the new body already has it and is never blank.\n const motionOff = !!reduceMotion || systemReducedMotion;\n const bodiesRef = useRef<HTMLDivElement>(null);\n const [bodySwap, setBodySwap] = useState<{\n liveId: string | null;\n serial: number;\n /** The replaced body held focus, which its unmount is about to drop. */\n focusLost: boolean;\n leaving: LeavingBody[];\n }>({ liveId: shownActiveId, serial: 0, focusLost: false, leaving: [] });\n if (bodySwap.liveId !== shownActiveId) {\n const previous =\n bodySwap.liveId !== null && shownActiveId !== null\n ? (bodiesRef.current?.querySelector<HTMLElement>(\n ':scope > [data-tool-rail-layer=\"live\"]',\n ) ?? null)\n : null;\n const carried = bodySwap.leaving.filter(\n (body) => body.toolId !== shownActiveId,\n );\n setBodySwap({\n liveId: shownActiveId,\n serial: bodySwap.serial + 1,\n focusLost: previous?.contains(document.activeElement) ?? false,\n leaving:\n previous && !motionOff\n ? [\n ...carried.filter((body) => body.toolId !== bodySwap.liveId),\n {\n exitId: `${bodySwap.liveId}:${bodySwap.serial}`,\n toolId: bodySwap.liveId as string,\n ...snapshotBody(previous),\n },\n ]\n : carried,\n });\n }\n // A picture goes when its own fade ends. The timer is the fallback for a\n // hidden tab, which runs no transitions; it is longer than the fade so it\n // never cuts one short.\n const dropLeavingBody = useCallback((exitId: string) => {\n setBodySwap((current) =>\n current.leaving.some((body) => body.exitId === exitId)\n ? {\n ...current,\n leaving: current.leaving.filter((body) => body.exitId !== exitId),\n }\n : current,\n );\n }, []);\n const { leave: leaveBody } = useExitTransition({\n reduceMotion,\n durationMs: LEAVING_BODY_FALLBACK_MS,\n });\n useEffect(() => {\n for (const { exitId } of bodySwap.leaving) {\n leaveBody(exitId, () => dropLeavingBody(exitId));\n }\n }, [bodySwap.leaving, leaveBody, dropLeavingBody]);\n const leavingBodies = shownTool ? bodySwap.leaving : [];\n const heldBodyId =\n bodySwap.leaving[bodySwap.leaving.length - 1]?.exitId ?? null;\n // Fills a leaving layer once, as it mounts: `inert` (React 18 has no prop\n // for it), then the picture, then the scroll offsets it was taken at.\n const leavingRef = useRef(bodySwap.leaving);\n leavingRef.current = bodySwap.leaving;\n const fillLeavingBody = useCallback(\n (node: HTMLDivElement | null) => {\n if (!node || node.childNodes.length > 0) return;\n const body = leavingRef.current.find(\n (item) => item.exitId === node.dataset.exitId,\n );\n if (!body) return;\n // No fade to play (a 0ms token, or no kit stylesheet at all): the\n // picture has no job, so it goes at once rather than wait for the timer.\n if (!hasTransition(node)) {\n dropLeavingBody(body.exitId);\n return;\n }\n node.setAttribute('inert', '');\n node.append(...body.nodes);\n for (const [element, top, left] of body.scrolls) {\n element.scrollTop = top;\n element.scrollLeft = left;\n }\n },\n [dropLeavingBody],\n );\n // The old body took focus with it when it unmounted. Unless something in\n // the new tool has claimed it already, it goes to the new tool's icon.\n useIsomorphicLayoutEffect(() => {\n if (!bodySwap.focusLost || !shownActiveId) return;\n const active = document.activeElement;\n if (active && active !== document.body) return;\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(shownActiveId)}\"]`,\n )\n ?.focus();\n }, [bodySwap.serial]);\n\n // Tools that were in the previous render but are gone now, kept around\n // until their exit fade completes. Rendered after the current tools\n // WITHOUT `data-reflow-id` so the reflow hook ignores them — they fade\n // out at the bottom of the strip while the surviving icons reflow.\n const [leavingTools, setLeavingTools] = useState<ToolRailTool[]>([]);\n const prevToolsRef = useRef<ToolRailTool[]>(tools);\n useEffect(() => {\n const prev = prevToolsRef.current;\n const currentIds = new Set(tools.map((tl) => tl.id));\n const removed = prev.filter((tl) => !currentIds.has(tl.id));\n if (removed.length > 0) {\n setLeavingTools((existing) => {\n const existingIds = new Set(existing.map((tl) => tl.id));\n return [\n ...existing,\n ...removed.filter((tl) => !existingIds.has(tl.id)),\n ];\n });\n for (const tl of removed) {\n exit.leave(tl.id, () => {\n setLeavingTools((existing) =>\n existing.filter((item) => item.id !== tl.id),\n );\n });\n }\n }\n prevToolsRef.current = tools;\n }, [tools, exit]);\n\n // sr-only announcement. The zero-width-space toggle forces a re-announce of\n // an identical message (e.g. moving the same item twice) — same technique\n // the Sidebar uses for its reorder live region.\n const [reorderMessage, setReorderMessage] = useState('');\n const announceToggle = useRef(false);\n const commitReorder = useCallback(\n (from: number, to: number) => {\n if (!onReorder || !reorderRun) return;\n const clamped = Math.max(\n reorderRun.first,\n Math.min(reorderRun.last, to),\n );\n if (clamped === from) return;\n onReorder(from, clamped);\n const moved = tools[from];\n if (moved) {\n // The host can phrase membership-aware moves (e.g. pin / unpin) and\n // can return '' to stay silent for a move it treats as a no-op.\n const text = formatReorderAnnouncement\n ? formatReorderAnnouncement({ tool: moved, from, to: clamped })\n : t('toolRail.reorderAnnounce', {\n tool: moved.label,\n to: clamped - reorderRun.first + 1,\n total: reorderRun.last - reorderRun.first + 1,\n defaultValue: '{{tool}} moved to position {{to}} of {{total}}',\n });\n if (text) {\n announceToggle.current = !announceToggle.current;\n setReorderMessage(announceToggle.current ? text : `${text}\\u200b`);\n }\n }\n },\n [onReorder, reorderRun, tools, t, formatReorderAnnouncement],\n );\n\n // The roving tab stop: the active icon when a tool is open, else the\n // index the user last focused, else the first enabled icon.\n const rovingIndex =\n activeIndex >= 0\n ? activeIndex\n : focusIndex >= 0 && !tools[focusIndex]?.disabled\n ? focusIndex\n : firstEnabledIndex;\n\n const selectTool = useCallback(\n (toolId: string, fromKeyboard: boolean) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = fromKeyboard;\n // Clicking / activating the active tool collapses to strip-only.\n setActiveRaw(activeId === toolId ? null : toolId);\n },\n [tools, activeId, setActiveRaw],\n );\n\n /* ---- Roving arrow-key navigation (vertical toolbar) ----------- */\n const handleStripKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>) => {\n const count = tools.length;\n if (count === 0) return;\n // Alt+Arrow is reserved for reordering (handled on the icon); never\n // let it move focus roving as well.\n if (event.altKey) return;\n\n let next: number | null = null;\n if (event.key === 'ArrowDown') next = (rovingIndex + 1) % count;\n else if (event.key === 'ArrowUp')\n next = (rovingIndex - 1 + count) % count;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = count - 1;\n if (next === null) return;\n\n // Skip disabled icons in the travel direction.\n const goingBack = event.key === 'ArrowUp' || event.key === 'End';\n let candidate = next;\n let attempts = 0;\n while (attempts < count && tools[candidate]?.disabled) {\n candidate = goingBack\n ? (candidate - 1 + count) % count\n : (candidate + 1) % count;\n attempts += 1;\n }\n if (tools[candidate]?.disabled) return;\n\n event.preventDefault();\n setFocusIndex(candidate);\n buttonsRef.current[candidate]?.focus();\n },\n [tools, rovingIndex],\n );\n\n /* ---- Esc collapses + returns focus to the active tool's icon -- */\n // Attached imperatively via the root ref (not a JSX onKeyDown on the\n // static container) so the Escape shortcut works from anywhere inside the\n // open panel without an interaction handler on a non-interactive element.\n const rootRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const node = rootRef.current;\n if (!node) return undefined;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n if (activeIndex < 0) return;\n event.preventDefault();\n const returnIndex = activeIndex;\n setActiveRaw(null);\n setFocusIndex(returnIndex);\n // Defer until after the panel unmounts so focus lands cleanly.\n requestAnimationFrame(() => {\n buttonsRef.current[returnIndex]?.focus();\n });\n };\n node.addEventListener('keydown', onKeyDown);\n return () => node.removeEventListener('keydown', onKeyDown);\n }, [activeIndex, setActiveRaw]);\n\n /* ---- Move focus into the panel when opened by keyboard -------- */\n useIsomorphicLayoutEffect(() => {\n if (activeTool && activatedByKeyboardRef.current) {\n panelRef.current?.focus();\n }\n activatedByKeyboardRef.current = false;\n }, [activeTool]);\n\n /* ---- Opt-in panel resize (inner edge) -------------------------- */\n // The handle sits on the edge facing the main content: the panel's\n // inline-start edge for an end-docked rail, inline-end for start.\n const panelEdge = side === 'end' ? 'inline-start' : 'inline-end';\n const { separatorProps, isResizing, isResized } = useEdgeResize({\n edge: panelEdge,\n targetRef: panelRef,\n cssProperty: PANEL_SIZE_PROPERTY,\n minSize: PANEL_MIN_SIZE,\n maxSize: PANEL_MAX_SIZE,\n defaultSize: PANEL_DEFAULT_SIZE,\n disabled: !resizablePanel,\n // A width the user cannot change or reset is a trap: the controlled\n // value applies only while the handle is on.\n size: resizablePanel ? panelWidth : undefined,\n onResize: onPanelWidthChange,\n });\n\n // The aside unmounts on collapse, dropping the hook's inline override.\n // Re-assert the committed width when a panel (re)mounts so a reopened\n // panel keeps the user's chosen size.\n const committedPanelWidth = separatorProps['aria-valuenow'];\n useIsomorphicLayoutEffect(() => {\n if (!resizablePanel || !isResized || !activeTool) return;\n panelRef.current?.style.setProperty(\n PANEL_SIZE_PROPERTY,\n `${committedPanelWidth}px`,\n );\n }, [activeTool, resizablePanel, isResized, committedPanelWidth]);\n\n /* ---- Curated imperative handle for agent integration ---------- */\n const activeIdRef = useRef<string | null>(activeId);\n activeIdRef.current = activeId;\n\n const handle = useMemo<ToolRailHandle>(\n () => ({\n getActiveToolId: () => activeIdRef.current,\n setActiveTool: (toolId) => {\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n open: (toolId) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n close: () => {\n const returnId = activeIdRef.current;\n activatedByKeyboardRef.current = false;\n setActiveRaw(null);\n // Return focus to the closed tool's strip icon (mirrors Escape) so a\n // close-button / pointer collapse never drops focus to <body>.\n if (returnId != null) {\n requestAnimationFrame(() => {\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(returnId)}\"]`,\n )\n ?.focus();\n });\n }\n },\n }),\n [tools, setActiveRaw],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(agentAdapter, handle, id);\n\n const overflowLabel = t('toolRail.badgeCountOverflow', {\n defaultValue: '99+',\n });\n\n return (\n <div\n ref={rootRef}\n data-component={dataComponent}\n data-component-id={id}\n data-side={side}\n className={[railVariants({ side }), className]\n .filter(Boolean)\n .join(' ')}\n >\n {/* Reorder a11y: a polite live region announcing each move. Each\n reorderable icon carries its own keyboard instruction (rendered in\n its slot, referenced via aria-describedby). */}\n {reorderEnabled ? (\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {reorderMessage}\n </span>\n ) : null}\n {/* The OPEN panel is the single complementary landmark, named by\n the active tool. Rendered only while a tool is active so two\n unnamed regions never coexist. */}\n {shownTool ? (\n <aside\n ref={setPanelNode}\n tabIndex={-1}\n aria-label={t('toolRail.panelLabel', {\n tool: shownTool.label,\n defaultValue: '{{tool}} panel',\n })}\n // A leaving panel is already closed to the user: out of the\n // accessibility tree, and `inert` (set above) while it fades.\n aria-hidden={panelLeaving || undefined}\n data-tool-rail-state={panelLeaving ? 'collapsing' : 'expanded'}\n data-presence={panelPresence.phase}\n data-active-tool={shownTool.id}\n data-resizing={isResizing ? '' : undefined}\n className={[\n panelVariants({ side }),\n // Subtle shadow — not a line — separating the panel from the\n // icon strip (the tab row). The panel casts a soft chrome\n // shadow toward the strip on its strip-facing edge. `z-[1]`\n // lifts it above the adjacent strip (the panel is already\n // `relative`) so the shadow paints at the seam instead of being\n // covered by the strip's opaque background. Only renders while\n // the panel is open (the aside is unmounted when collapsed), so\n // it never doubles as a rail↔main seam. In the accessible (AAA)\n // theme the soft shadow becomes a solid 1px border on that same\n // strip-facing edge.\n 'ds:z-[1]',\n side === 'end'\n ? 'ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none'\n : 'ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n 'ds:focus-visible:outline-none',\n ].join(' ')}\n >\n {/* Optional host-owned, non-scrolling panel header (e.g. the\n Control Room's add / remove favourite control). Sits above the\n scroll region so it stays put as the panel body scrolls. */}\n {renderPanelHeader\n ? renderPanelHeader(shownTool, { isActive: !panelLeaving })\n : null}\n <div ref={bodiesRef} className={panelBodiesClass}>\n {/* Pictures of replaced bodies (see `snapshotBody`). The one just\n replaced holds at rest for the two frames the new body waits\n at `entering`, so both fades start together and sum to one. */}\n {leavingBodies.map((body) => (\n <div\n key={body.exitId}\n ref={fillLeavingBody}\n aria-hidden=\"true\"\n data-exit-id={body.exitId}\n data-tool-rail-body={body.toolId}\n data-tool-rail-layer=\"leaving\"\n data-presence={\n bodyEntering && body.exitId === heldBodyId\n ? 'present'\n : 'leaving'\n }\n className={panelBodyVariants({ layer: 'leaving' })}\n onTransitionEnd={(event) => {\n if (event.target === event.currentTarget)\n dropLeavingBody(body.exitId);\n }}\n />\n ))}\n <div\n key={shownTool.id}\n data-tool-rail-body={shownTool.id}\n data-tool-rail-layer=\"live\"\n data-presence={bodyEntering ? 'entering' : 'present'}\n className={panelBodyVariants({ layer: 'live' })}\n >\n {/* Optional per-tool pinned header — the rail-level home for a\n sticky tool header (title / filters). Non-scrolling, above\n the body, so it stays visible for every tool. */}\n {shownTool.header ? (\n <div className=\"ds:shrink-0\">{shownTool.header}</div>\n ) : null}\n {/* Body: a self-scrolling `fill` tool owns its own scroll inside\n the height-bounded panel; otherwise the rail scrolls it. */}\n {shownTool.fill ? (\n // data-tool-fill: a self-scrolling panel owns its own native\n // scroll, so a token rule paints its scrollbar to match the\n // 8px overlay. See tokens/index.css.\n <div data-tool-fill=\"\" className=\"ds:flex-1 ds:min-h-0\">\n {shownTool.panel}\n </div>\n ) : (\n <ScrollArea\n orientation=\"vertical\"\n className=\"ds:flex-1 ds:min-h-0\"\n >\n {shownTool.panel}\n </ScrollArea>\n )}\n </div>\n </div>\n {/* Inside the aside (so it belongs to the complementary\n landmark) and outside the toolbar strip — the strip's\n roving handlers never see its key events, and Escape\n still bubbles to the root to collapse, as everywhere\n else in the panel. No stopPropagation needed. */}\n {resizablePanel ? (\n <div\n {...separatorProps}\n aria-label={t('toolRail.resizePanel', {\n defaultValue: 'Resize tool panel',\n })}\n data-resizing={isResizing ? '' : undefined}\n className={panelResizeHandleVariants({ edge: panelEdge })}\n />\n ) : null}\n </aside>\n ) : null}\n\n {/* The 3rem icon strip — a vertical toolbar with roving tabindex.\n Self-contained TooltipProvider so consumers needn't mount one;\n Radix providers compose, so a host-level provider still works. */}\n <TooltipProvider>\n <div\n ref={reflowRef}\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n aria-label={\n railLabel ?? t('toolRail.railLabel', { defaultValue: 'Tools' })\n }\n className={stripVariants()}\n onKeyDown={handleStripKeyDown}\n >\n {tools.map((tool, index) => {\n const isActive = tool.id === activeId;\n const showBadge =\n typeof tool.badgeCount === 'number' && tool.badgeCount > 0;\n // Fold the count into the accessible name so SR users hear it\n // without relying on the decorative chip.\n const accessibleName = showBadge\n ? t('toolRail.toolWithCount', {\n tool: tool.label,\n count: tool.badgeCount,\n defaultValue: '{{tool}}, {{count}} updates',\n })\n : tool.label;\n const canReorderTool =\n reorderEnabled && !!tool.reorderable && !tool.disabled;\n const reorderDescId = canReorderTool\n ? `${reorderInstructionsId}-${tool.id}`\n : undefined;\n return (\n <Fragment key={tool.id}>\n {showScopeDivider && index === scopeDividerIndex ? (\n <div\n role=\"separator\"\n aria-orientation=\"horizontal\"\n className=\"ds:my-[var(--spacing-2xs)] ds:h-px ds:w-[var(--spacing-lg)] ds:shrink-0 ds:bg-[var(--border)] ds:forced-colors:bg-[CanvasText]\"\n />\n ) : null}\n <div\n className={[\n toolSlotVariants({\n dragging: dragIndex === index,\n dropTarget: dropIndex === index && dragIndex !== index,\n reorderable: canReorderTool,\n }),\n toolElevationClass,\n REFLOW_ROW_CLASS,\n ]\n .filter(Boolean)\n .join(' ')}\n data-reflow-id={tool.id}\n data-dragging={dragIndex === index ? '' : undefined}\n // Drag the whole slot — the icon button is an unreliable\n // HTML5 drag source across browsers. The button keeps its\n // click + Alt+Arrow keyboard reorder; drag is pointer-only.\n draggable={canReorderTool || undefined}\n onDragStart={\n canReorderTool\n ? (event) => {\n setDragIndex(index);\n event.dataTransfer.effectAllowed = 'move';\n // Firefox needs data set to initiate a drag.\n event.dataTransfer.setData(\n 'text/plain',\n String(index),\n );\n }\n : undefined\n }\n onDragOver={\n canReorderTool\n ? (event) => {\n if (dragIndex === null) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n if (dropIndex !== index) setDropIndex(index);\n }\n : undefined\n }\n onDragLeave={\n canReorderTool\n ? () =>\n setDropIndex((cur) => (cur === index ? null : cur))\n : undefined\n }\n onDrop={\n canReorderTool\n ? (event) => {\n event.preventDefault();\n const from = dragIndex;\n setDropIndex(null);\n setDragIndex(null);\n if (from === null || from === index) return;\n commitReorder(from, index);\n }\n : undefined\n }\n onDragEnd={\n canReorderTool\n ? () => {\n setDragIndex(null);\n setDropIndex(null);\n }\n : undefined\n }\n >\n <IconButton\n ref={(el) => {\n buttonsRef.current[index] = el;\n }}\n icon={tool.icon}\n tooltip={tool.label}\n aria-label={accessibleName}\n intent=\"ghost\"\n size=\"sm\"\n disabled={tool.disabled}\n aria-pressed={isActive}\n aria-expanded={isActive}\n data-active={isActive ? tool.id : undefined}\n data-tool-id={tool.id}\n aria-describedby={reorderDescId}\n aria-keyshortcuts={\n canReorderTool ? 'Alt+ArrowUp Alt+ArrowDown' : undefined\n }\n tabIndex={index === rovingIndex ? 0 : -1}\n onFocus={() => {\n if (!tool.disabled) setFocusIndex(index);\n }}\n onClick={() =>\n selectTool(tool.id, keyboardActivateRef.current)\n }\n onKeyDown={(event) => {\n // Enter/Space activate via the native button's click,\n // which fires AFTER this keydown. Flag the upcoming\n // click as keyboard-driven so focus moves into the\n // panel; reset on keyup so a later mouse click doesn't\n // inherit the flag.\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = true;\n return;\n }\n // Alt+Arrow / Alt+Home / Alt+End reorder within the run.\n // Focus follows the moved icon to its new index; roving\n // ignores Alt (see handleStripKeyDown).\n if (canReorderTool && event.altKey && reorderRun) {\n let target: number | null = null;\n if (event.key === 'ArrowUp') target = index - 1;\n else if (event.key === 'ArrowDown')\n target = index + 1;\n else if (event.key === 'Home')\n target = reorderRun.first;\n else if (event.key === 'End')\n target = reorderRun.last;\n if (target !== null) {\n event.preventDefault();\n const dest = Math.max(\n reorderRun.first,\n Math.min(reorderRun.last, target),\n );\n // Focus follows the moved TOOL (by id), not the\n // slot index — so it lands correctly however the\n // host reinterprets the move (reorder, cross-group\n // pin / unpin, or a no-op that leaves it in place).\n const movedId = tool.id;\n commitReorder(index, dest);\n requestAnimationFrame(() => {\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(movedId)}\"]`,\n )\n ?.focus();\n });\n }\n }\n }}\n onKeyUp={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = false;\n }\n }}\n />\n {showBadge ? (\n <span aria-hidden=\"true\" className={badgeVariants()}>\n {formatBadgeCount(\n tool.badgeCount as number,\n overflowLabel,\n )}\n </span>\n ) : null}\n {renderToolAffordance?.(tool, {\n index,\n isActive,\n isRovingTarget: index === rovingIndex,\n })}\n {reorderDescId ? (\n <span id={reorderDescId} className=\"ds:sr-only\">\n {t('toolRail.reorderInstructions', {\n tool: tool.label,\n defaultValue:\n 'Reorder {{tool}}. Press Alt + Up or Alt + Down to move.',\n })}\n </span>\n ) : null}\n </div>\n </Fragment>\n );\n })}\n {/* Departing tools: rendered without `data-reflow-id` so the\n reflow hook ignores them. They fade out here while the\n surviving icons above reflow to their new positions. */}\n {leavingTools.map((tool) =>\n exit.isLeaving(tool.id) ? (\n <div\n key={tool.id}\n className={[\n toolSlotVariants({\n dragging: false,\n dropTarget: false,\n reorderable: false,\n }),\n toolElevationClass,\n toolLeavingClass,\n ]\n .filter(Boolean)\n .join(' ')}\n aria-hidden=\"true\"\n >\n <IconButton\n icon={tool.icon}\n intent=\"ghost\"\n size=\"sm\"\n disabled\n tabIndex={-1}\n />\n </div>\n ) : null,\n )}\n </div>\n </TooltipProvider>\n </div>\n );\n },\n);\n\nToolRail.displayName = 'ToolRail';\n"],"names":["toolRailAgent","handle","args","RAIL_WIDTH","PANEL_WIDTH","PANEL_SIZE_PROPERTY","PANEL_MIN_SIZE","PANEL_MAX_SIZE","PANEL_DEFAULT_SIZE","railVariants","cva","stripVariants","panelVariants","panelBodiesClass","panelBodyVariants","LEAVING_BODY_FALLBACK_MS","CLONE_STRIPPED_ATTRIBUTES","hasTransition","node","part","snapshotBody","body","holder","originals","clones","scrolls","original","index","clone","_a","inSvg","name","panelResizeHandleVariants","badgeVariants","toolSlotVariants","toolLeavingClass","toolElevationClass","formatBadgeCount","count","overflowLabel","ToolRail","forwardRef","id","tools","activeToolId","defaultActiveToolId","onActiveToolChange","side","railLabel","resizablePanel","panelWidth","onPanelWidthChange","onReorder","formatReorderAnnouncement","renderToolAffordance","renderPanelHeader","dataComponent","agentAdapter","className","ref","t","useTranslation","activeRaw","setActiveRaw","useControllableState","activeId","buttonsRef","useRef","panelRef","focusIndex","setFocusIndex","useState","activatedByKeyboardRef","keyboardActivateRef","activeIndex","useMemo","tl","activeTool","lastToolRef","firstEnabledIndex","scopeDividerIndex","lead","showScopeDivider","reorderRun","first","last","reorderEnabled","reorderInstructionsId","useId","dragIndex","setDragIndex","dropIndex","setDropIndex","resolvedTheme","useTheme","reduceMotion","reflowRef","useListReflow","exit","useExitTransition","panelPresence","usePresenceTransition","panelLeaving","shownTool","presenceRef","setPanelNode","useCallback","useIsomorphicLayoutEffect","active","returnId","icon","_b","rootRef","systemReducedMotion","usePrefersReducedMotion","settledToolId","setSettledToolId","shownActiveId","bodyEntering","inner","settle","outer","fallback","motionOff","bodiesRef","bodySwap","setBodySwap","previous","carried","dropLeavingBody","exitId","current","leaveBody","useEffect","leavingBodies","heldBodyId","leavingRef","fillLeavingBody","item","element","top","left","leavingTools","setLeavingTools","prevToolsRef","prev","currentIds","removed","existing","existingIds","reorderMessage","setReorderMessage","announceToggle","commitReorder","from","to","clamped","moved","text","rovingIndex","_c","selectTool","toolId","fromKeyboard","tool","handleStripKeyDown","event","next","goingBack","candidate","attempts","onKeyDown","returnIndex","panelEdge","separatorProps","isResizing","isResized","useEdgeResize","committedPanelWidth","activeIdRef","useImperativeHandle","useAgentRegistration","jsxs","jsx","ScrollArea","TooltipProvider","isActive","showBadge","accessibleName","canReorderTool","reorderDescId","Fragment","REFLOW_ROW_CLASS","cur","IconButton","el","target","dest","movedId"],"mappings":";;;;;;;;;;;;;;;AAYO,MAAMA,KAA8C;AAAA,EACzD,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,EAC3C;AAAA,EAEF,SAAS;AAAA,IACP,M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EAAuB8G,GAAM;AAAA,4BAC5B,OAAAzI;AAAA,4BACA,UAAA+J;AAAA,4BACA,gBAAgB/J,MAAUoI;AAAA,0BAAA;AAAA,0BAE3B+B,sBACE,QAAA,EAAK,IAAIA,GAAe,WAAU,cAChC,YAAE,gCAAgC;AAAA,4BACjC,MAAM1B,EAAK;AAAA,4BACX,cACE;AAAA,0BAAA,CACH,GACH,IACE;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACN,EAAA,GA7KaA,EAAK,EA8KpB;AAAA,gBAEJ,CAAC;AAAA,gBAIAtB,GAAa;AAAA,kBAAI,CAACsB,MACjBlE,GAAK,UAAUkE,EAAK,EAAE,IACpB,gBAAAmB;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBAEC,WAAW;AAAA,wBACTrJ,GAAiB;AAAA,0BACf,UAAU;AAAA,0BACV,YAAY;AAAA,0BACZ,aAAa;AAAA,wBAAA,CACd;AAAA,wBACDE;AAAA,wBACAD;AAAA,sBAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,sBACX,eAAY;AAAA,sBAEZ,UAAA,gBAAAoJ;AAAA,wBAACW;AAAA,wBAAA;AAAA,0BACC,MAAM9B,EAAK;AAAA,0BACX,QAAO;AAAA,0BACP,MAAK;AAAA,0BACL,UAAQ;AAAA,0BACR,UAAU;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACZ;AAAA,oBApBKA,EAAK;AAAA,kBAAA,IAsBV;AAAA,gBAAA;AAAA,cACN;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA5H,GAAS,cAAc;"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { useState as T, useRef as b, useCallback as o } from "react";
|
|
2
|
+
import { useTranslation as Y } from "react-i18next";
|
|
3
|
+
import { u as A } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
4
|
+
const $ = 16, H = 64;
|
|
5
|
+
function j({
|
|
6
|
+
edge: P,
|
|
7
|
+
targetRef: n,
|
|
8
|
+
cssProperty: c,
|
|
9
|
+
minSize: p,
|
|
10
|
+
maxSize: d,
|
|
11
|
+
defaultSize: k,
|
|
12
|
+
disabled: l = !1,
|
|
13
|
+
onResize: u,
|
|
14
|
+
size: f
|
|
15
|
+
}) {
|
|
16
|
+
const { t: K } = Y(), E = f !== void 0, [h, g] = T(
|
|
17
|
+
E ? f : null
|
|
18
|
+
), [M, x] = T(!1), m = b(null), w = b(null);
|
|
19
|
+
A(() => {
|
|
20
|
+
const t = n.current;
|
|
21
|
+
if (!t) return;
|
|
22
|
+
const r = t.getBoundingClientRect().width;
|
|
23
|
+
r > 0 && (m.current = r);
|
|
24
|
+
});
|
|
25
|
+
const I = o(
|
|
26
|
+
(t) => Math.min(d, Math.max(p, t)),
|
|
27
|
+
[p, d]
|
|
28
|
+
);
|
|
29
|
+
A(() => {
|
|
30
|
+
var r, e;
|
|
31
|
+
if (!E) return;
|
|
32
|
+
const t = f === null ? null : I(f);
|
|
33
|
+
g(t), t === null ? ((r = n.current) == null || r.style.removeProperty(c), m.current = null) : (e = n.current) == null || e.style.setProperty(c, `${t}px`);
|
|
34
|
+
}, [E, f, I, c, n]);
|
|
35
|
+
const s = o(() => {
|
|
36
|
+
if (h !== null) return h;
|
|
37
|
+
const t = n.current;
|
|
38
|
+
if (t) {
|
|
39
|
+
const r = t.getBoundingClientRect().width;
|
|
40
|
+
if (r > 0)
|
|
41
|
+
return m.current = r, r;
|
|
42
|
+
}
|
|
43
|
+
return m.current ?? k;
|
|
44
|
+
}, [h, k, n]), a = o(
|
|
45
|
+
(t) => {
|
|
46
|
+
var e;
|
|
47
|
+
const r = I(t);
|
|
48
|
+
return g(r), (e = n.current) == null || e.style.setProperty(c, `${r}px`), r;
|
|
49
|
+
},
|
|
50
|
+
[I, c, n]
|
|
51
|
+
), C = o(() => {
|
|
52
|
+
var t;
|
|
53
|
+
g(null), (t = n.current) == null || t.style.removeProperty(c), m.current = null, u == null || u(null);
|
|
54
|
+
}, [c, u, n]), y = o(() => {
|
|
55
|
+
const t = n.current, r = t ? getComputedStyle(t).direction === "rtl" : !1;
|
|
56
|
+
return (P === "inline-end" ? 1 : -1) * (r ? -1 : 1);
|
|
57
|
+
}, [P, n]), v = o(
|
|
58
|
+
(t) => {
|
|
59
|
+
l || !t.isPrimary || (t.currentTarget.setPointerCapture(t.pointerId), w.current = {
|
|
60
|
+
pointerId: t.pointerId,
|
|
61
|
+
startX: t.clientX,
|
|
62
|
+
startSize: s(),
|
|
63
|
+
sign: y()
|
|
64
|
+
}, x(!0));
|
|
65
|
+
},
|
|
66
|
+
[l, s, y]
|
|
67
|
+
), _ = o(
|
|
68
|
+
(t) => {
|
|
69
|
+
const r = w.current;
|
|
70
|
+
!r || t.pointerId !== r.pointerId || a(r.startSize + r.sign * (t.clientX - r.startX));
|
|
71
|
+
},
|
|
72
|
+
[a]
|
|
73
|
+
), D = o(
|
|
74
|
+
(t) => {
|
|
75
|
+
const r = w.current;
|
|
76
|
+
if (!r || t.pointerId !== r.pointerId) return;
|
|
77
|
+
t.currentTarget.releasePointerCapture(t.pointerId), w.current = null, x(!1);
|
|
78
|
+
const e = a(
|
|
79
|
+
r.startSize + r.sign * (t.clientX - r.startX)
|
|
80
|
+
);
|
|
81
|
+
u == null || u(e);
|
|
82
|
+
},
|
|
83
|
+
[a, u]
|
|
84
|
+
), B = o(
|
|
85
|
+
(t) => {
|
|
86
|
+
if (l) return;
|
|
87
|
+
const r = t.shiftKey ? H : $, e = y();
|
|
88
|
+
let i = null;
|
|
89
|
+
switch (t.key) {
|
|
90
|
+
case "ArrowRight":
|
|
91
|
+
i = s() + e * r;
|
|
92
|
+
break;
|
|
93
|
+
case "ArrowLeft":
|
|
94
|
+
i = s() - e * r;
|
|
95
|
+
break;
|
|
96
|
+
case "Home":
|
|
97
|
+
i = p;
|
|
98
|
+
break;
|
|
99
|
+
case "End":
|
|
100
|
+
i = d;
|
|
101
|
+
break;
|
|
102
|
+
case "Enter":
|
|
103
|
+
t.preventDefault(), C();
|
|
104
|
+
return;
|
|
105
|
+
default:
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (i === null) return;
|
|
109
|
+
t.preventDefault();
|
|
110
|
+
const L = a(i);
|
|
111
|
+
u == null || u(L);
|
|
112
|
+
},
|
|
113
|
+
[
|
|
114
|
+
a,
|
|
115
|
+
s,
|
|
116
|
+
l,
|
|
117
|
+
d,
|
|
118
|
+
p,
|
|
119
|
+
u,
|
|
120
|
+
C,
|
|
121
|
+
y
|
|
122
|
+
]
|
|
123
|
+
), X = Math.round(s());
|
|
124
|
+
return {
|
|
125
|
+
separatorProps: {
|
|
126
|
+
role: "separator",
|
|
127
|
+
tabIndex: l ? -1 : 0,
|
|
128
|
+
"aria-orientation": "vertical",
|
|
129
|
+
"aria-valuemin": p,
|
|
130
|
+
"aria-valuemax": d,
|
|
131
|
+
"aria-valuenow": X,
|
|
132
|
+
"aria-valuetext": K("resizable.widthAnnounce", { width: X }),
|
|
133
|
+
"aria-disabled": l || void 0,
|
|
134
|
+
onPointerDown: v,
|
|
135
|
+
onPointerMove: _,
|
|
136
|
+
onPointerUp: D,
|
|
137
|
+
onPointerCancel: D,
|
|
138
|
+
onKeyDown: B,
|
|
139
|
+
onDoubleClick: C
|
|
140
|
+
},
|
|
141
|
+
isResizing: M,
|
|
142
|
+
isResized: h !== null,
|
|
143
|
+
reset: C
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
j as u
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=use-edge-resize-BHesP0kg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-edge-resize-BHesP0kg.js","sources":["../../src/hooks/use-edge-resize.ts"],"sourcesContent":["/**\n * Pixel-based edge-resize for fixed-width chrome surfaces (the Sidebar's\n * inline-end edge, the ToolRail panel's inner edge). Mirrors the\n * separator semantics of `Resizable`'s Handle — `role=\"separator\"`,\n * arrow keys with RTL flip, Shift for coarse steps, Home/End to the\n * extremes, Enter or double-click to reset — but sizes a single target\n * element in pixels instead of distributing percentages across a panel\n * group.\n *\n * The hook owns the interaction and writes the resolved width to a CSS\n * custom property on the target element (the same property the\n * component's width classes already read), so the component keeps its\n * `var(--…)`-driven classes and no inline `width` ever appears. Reset\n * removes the override entirely, returning the surface to its\n * token-driven default.\n */\nimport {\n useCallback,\n useRef,\n useState,\n type KeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n type RefObject,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';\n\n/** Fine / coarse keyboard steps, in px (coarse = Shift held). */\nconst KEY_STEP = 16;\nconst KEY_STEP_COARSE = 64;\n\nexport interface UseEdgeResizeOptions {\n /**\n * Which logical edge of the target carries the handle. `inline-end`\n * for a start-docked surface (Sidebar); `inline-start` for an\n * end-docked one (ToolRail panel with `side=\"end\"`).\n */\n edge: 'inline-start' | 'inline-end';\n /** The element being resized. The width override lands on its style. */\n targetRef: RefObject<HTMLElement | null>;\n /**\n * CSS custom property the target's width classes read\n * (e.g. `--sidebar-modern-expanded-size`). Written as `<px>px` on\n * resize, removed on reset.\n */\n cssProperty: string;\n /** Clamp floor, px. */\n minSize: number;\n /** Clamp ceiling, px. */\n maxSize: number;\n /**\n * Nominal default width, px — used for `aria-valuenow` before the\n * element has been measured (SSR / jsdom) and as the reset target.\n */\n defaultSize: number;\n /** Disables the interaction (handlers no-op, `aria-disabled` set). */\n disabled?: boolean;\n /** Fired with the committed px width; `null` means reset-to-default. */\n onResize?: (size: number | null) => void;\n /**\n * Controlled committed width, px; `null` for the token-driven default.\n * When provided (including `null`), the hook applies it to the target's\n * CSS property on mount and on every change — mirroring the \"re-assert\n * on remount\" effect components already run for the uncontrolled case.\n * Dragging and keyboard steps still update the CSS property and fire\n * `onResize` immediately for a responsive handle; the host is expected\n * to feed the committed value back through `size` on its next render,\n * the same contract as a controlled form input. Omit for uncontrolled\n * (internally-owned) sizing — the hook's default and existing behaviour.\n */\n size?: number | null;\n}\n\nexport interface EdgeResizeSeparatorProps {\n role: 'separator';\n tabIndex: number;\n 'aria-orientation': 'vertical';\n 'aria-valuemin': number;\n 'aria-valuemax': number;\n 'aria-valuenow': number;\n 'aria-valuetext': string;\n 'aria-disabled': boolean | undefined;\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;\n onPointerMove: (event: ReactPointerEvent<HTMLElement>) => void;\n onPointerUp: (event: ReactPointerEvent<HTMLElement>) => void;\n onPointerCancel: (event: ReactPointerEvent<HTMLElement>) => void;\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n onDoubleClick: () => void;\n}\n\nexport interface UseEdgeResizeReturn {\n /**\n * Spread onto the handle element (a plain `<div>`). Add `aria-label`,\n * and give the handle a `ds:touch-none` class — touch browsers decide\n * scroll-vs-drag at gesture start, before any pointer handler runs.\n */\n separatorProps: EdgeResizeSeparatorProps;\n /** True while a pointer drag is in flight — suppress width transitions. */\n isResizing: boolean;\n /** True once the user has overridden the token-driven default. */\n isResized: boolean;\n /** Programmatic reset to the token-driven default width. */\n reset: () => void;\n}\n\nexport function useEdgeResize({\n edge,\n targetRef,\n cssProperty,\n minSize,\n maxSize,\n defaultSize,\n disabled = false,\n onResize,\n size: controlledSize,\n}: UseEdgeResizeOptions): UseEdgeResizeReturn {\n const { t } = useTranslation();\n const isControlled = controlledSize !== undefined;\n const [size, setSize] = useState<number | null>(\n isControlled ? controlledSize : null,\n );\n const [isResizing, setIsResizing] = useState(false);\n const measuredRef = useRef<number | null>(null);\n const dragRef = useRef<{\n pointerId: number;\n startX: number;\n startSize: number;\n sign: number;\n } | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n const el = targetRef.current;\n if (!el) return;\n const width = el.getBoundingClientRect().width;\n if (width > 0) measuredRef.current = width;\n });\n\n const clamp = useCallback(\n (px: number) => Math.min(maxSize, Math.max(minSize, px)),\n [minSize, maxSize],\n );\n\n // Controlled mode: apply the host's committed width on mount and on\n // every change, the same \"re-assert on remount\" contract components\n // already run for the uncontrolled case. `null` clears the override\n // and returns the surface to its token-driven default.\n useIsomorphicLayoutEffect(() => {\n if (!isControlled) return;\n const next = controlledSize === null ? null : clamp(controlledSize);\n setSize(next);\n if (next === null) {\n targetRef.current?.style.removeProperty(cssProperty);\n measuredRef.current = null;\n } else {\n targetRef.current?.style.setProperty(cssProperty, `${next}px`);\n }\n }, [isControlled, controlledSize, clamp, cssProperty, targetRef]);\n\n // Live read at interaction time: the mount-time measure can catch the\n // target mid-animation (e.g. a panel still opening at width 0), so a\n // resize must start from the width the element actually has NOW.\n const currentSize = useCallback(() => {\n if (size !== null) return size;\n const el = targetRef.current;\n if (el) {\n const width = el.getBoundingClientRect().width;\n if (width > 0) {\n measuredRef.current = width;\n return width;\n }\n }\n return measuredRef.current ?? defaultSize;\n }, [size, defaultSize, targetRef]);\n\n const apply = useCallback(\n (px: number) => {\n const next = clamp(px);\n setSize(next);\n targetRef.current?.style.setProperty(cssProperty, `${next}px`);\n return next;\n },\n [clamp, cssProperty, targetRef],\n );\n\n const reset = useCallback(() => {\n setSize(null);\n targetRef.current?.style.removeProperty(cssProperty);\n measuredRef.current = null;\n onResize?.(null);\n }, [cssProperty, onResize, targetRef]);\n\n // Pointer-drag delta → width delta. The boundary the handle moves is\n // physical, so the logical edge and the writing direction both flip\n // the sign: dragging right grows a start-docked surface in LTR but\n // shrinks it in RTL, and vice versa for an end-docked one. Direction\n // is resolved at INTERACTION time from the target's computed style —\n // a mount-time read can be stale (the target may be unmounted while a\n // panel is closed, and `dir` lives on a subtree wrapper, not <html>).\n const resolveSign = useCallback(() => {\n const el = targetRef.current;\n const rtl = el ? getComputedStyle(el).direction === 'rtl' : false;\n return (edge === 'inline-end' ? 1 : -1) * (rtl ? -1 : 1);\n }, [edge, targetRef]);\n\n const onPointerDown = useCallback(\n (event: ReactPointerEvent<HTMLElement>) => {\n if (disabled || !event.isPrimary) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n dragRef.current = {\n pointerId: event.pointerId,\n startX: event.clientX,\n startSize: currentSize(),\n sign: resolveSign(),\n };\n setIsResizing(true);\n },\n [disabled, currentSize, resolveSign],\n );\n\n const onPointerMove = useCallback(\n (event: ReactPointerEvent<HTMLElement>) => {\n const drag = dragRef.current;\n if (!drag || event.pointerId !== drag.pointerId) return;\n apply(drag.startSize + drag.sign * (event.clientX - drag.startX));\n },\n [apply],\n );\n\n const endDrag = useCallback(\n (event: ReactPointerEvent<HTMLElement>) => {\n const drag = dragRef.current;\n if (!drag || event.pointerId !== drag.pointerId) return;\n event.currentTarget.releasePointerCapture(event.pointerId);\n dragRef.current = null;\n setIsResizing(false);\n // Re-apply from the up-event coordinates so the committed width,\n // the rendered width, and aria-valuenow all agree even when the\n // pointer-up lands at a different X than the last move.\n const committed = apply(\n drag.startSize + drag.sign * (event.clientX - drag.startX),\n );\n onResize?.(committed);\n },\n [apply, onResize],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n if (disabled) return;\n const step = event.shiftKey ? KEY_STEP_COARSE : KEY_STEP;\n const sign = resolveSign();\n let next: number | null = null;\n switch (event.key) {\n case 'ArrowRight':\n next = currentSize() + sign * step;\n break;\n case 'ArrowLeft':\n next = currentSize() - sign * step;\n break;\n case 'Home':\n next = minSize;\n break;\n case 'End':\n next = maxSize;\n break;\n case 'Enter':\n event.preventDefault();\n reset();\n return;\n default:\n return;\n }\n if (next === null) return;\n event.preventDefault();\n // Evaluate apply() unconditionally — `onResize?.(apply(next))`\n // would short-circuit the argument away when no callback is set.\n const committed = apply(next);\n onResize?.(committed);\n },\n [\n apply,\n currentSize,\n disabled,\n maxSize,\n minSize,\n onResize,\n reset,\n resolveSign,\n ],\n );\n\n const valueNow = Math.round(currentSize());\n\n return {\n separatorProps: {\n role: 'separator',\n tabIndex: disabled ? -1 : 0,\n 'aria-orientation': 'vertical',\n 'aria-valuemin': minSize,\n 'aria-valuemax': maxSize,\n 'aria-valuenow': valueNow,\n 'aria-valuetext': t('resizable.widthAnnounce', { width: valueNow }),\n 'aria-disabled': disabled || undefined,\n onPointerDown,\n onPointerMove,\n onPointerUp: endDrag,\n onPointerCancel: endDrag,\n onKeyDown,\n onDoubleClick: reset,\n },\n isResizing,\n isResized: size !== null,\n reset,\n };\n}\n"],"names":["KEY_STEP","KEY_STEP_COARSE","useEdgeResize","edge","targetRef","cssProperty","minSize","maxSize","defaultSize","disabled","onResize","controlledSize","t","useTranslation","isControlled","size","setSize","useState","isResizing","setIsResizing","measuredRef","useRef","dragRef","useIsomorphicLayoutEffect","el","width","clamp","useCallback","px","next","_a","_b","currentSize","apply","reset","resolveSign","rtl","onPointerDown","event","onPointerMove","drag","endDrag","committed","onKeyDown","step","sign","valueNow"],"mappings":";;;AA4BA,MAAMA,IAAW,IACXC,IAAkB;AA4EjB,SAASC,EAAc;AAAA,EAC5B,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,MAAMC;AACR,GAA8C;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAeH,MAAmB,QAClC,CAACI,GAAMC,CAAO,IAAIC;AAAA,IACtBH,IAAeH,IAAiB;AAAA,EAAA,GAE5B,CAACO,GAAYC,CAAa,IAAIF,EAAS,EAAK,GAC5CG,IAAcC,EAAsB,IAAI,GACxCC,IAAUD,EAKN,IAAI;AAEd,EAAAE,EAA0B,MAAM;AAC9B,UAAMC,IAAKpB,EAAU;AACrB,QAAI,CAACoB,EAAI;AACT,UAAMC,IAAQD,EAAG,sBAAA,EAAwB;AACzC,IAAIC,IAAQ,MAAGL,EAAY,UAAUK;AAAA,EACvC,CAAC;AAED,QAAMC,IAAQC;AAAA,IACZ,CAACC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back as v } from "react";
|
|
2
|
+
import { u as R } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
3
|
+
function b(l = !0) {
|
|
4
|
+
const i = m(null), [o, a] = h(null), d = v(
|
|
5
|
+
(e) => {
|
|
6
|
+
l && a(e);
|
|
7
|
+
},
|
|
8
|
+
[l]
|
|
9
|
+
), [t, n] = h(!1), r = m(null);
|
|
10
|
+
return R(() => {
|
|
11
|
+
if (!l) {
|
|
12
|
+
r.current = null, n((c) => c && !1);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const e = i.current;
|
|
16
|
+
if (!e) return;
|
|
17
|
+
const u = () => {
|
|
18
|
+
o && (r.current = o.scrollWidth);
|
|
19
|
+
const c = r.current;
|
|
20
|
+
if (c == null) return;
|
|
21
|
+
const f = c - e.clientWidth > 1;
|
|
22
|
+
n((w) => w === f ? w : f);
|
|
23
|
+
};
|
|
24
|
+
if (u(), typeof ResizeObserver > "u") return;
|
|
25
|
+
const s = new ResizeObserver(u);
|
|
26
|
+
return s.observe(e), o && s.observe(o), () => s.disconnect();
|
|
27
|
+
}, [l, o]), { containerRef: i, contentRef: d, isOverflowing: t };
|
|
28
|
+
}
|
|
29
|
+
function y(l = !0) {
|
|
30
|
+
const i = m(null), [o, a] = h({ start: !1, end: !1 });
|
|
31
|
+
R(() => {
|
|
32
|
+
const t = i.current;
|
|
33
|
+
if (!t || !l) {
|
|
34
|
+
a(
|
|
35
|
+
(e) => e.start || e.end ? { start: !1, end: !1 } : e
|
|
36
|
+
);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const n = () => {
|
|
40
|
+
const e = Math.abs(t.scrollLeft), u = t.scrollWidth - t.clientWidth, s = e > 1, c = u - e > 1;
|
|
41
|
+
a(
|
|
42
|
+
(f) => f.start === s && f.end === c ? f : { start: s, end: c }
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
n(), t.addEventListener("scroll", n, { passive: !0 });
|
|
46
|
+
let r;
|
|
47
|
+
return typeof ResizeObserver < "u" && (r = new ResizeObserver(n), r.observe(t), t.firstElementChild && r.observe(t.firstElementChild)), () => {
|
|
48
|
+
t.removeEventListener("scroll", n), r == null || r.disconnect();
|
|
49
|
+
};
|
|
50
|
+
}, [l]);
|
|
51
|
+
const d = v((t) => {
|
|
52
|
+
var s;
|
|
53
|
+
const n = i.current;
|
|
54
|
+
if (!n || typeof window > "u") return;
|
|
55
|
+
const r = window.getComputedStyle(n).direction === "rtl", e = (s = window.matchMedia) == null ? void 0 : s.call(
|
|
56
|
+
window,
|
|
57
|
+
"(prefers-reduced-motion: reduce)"
|
|
58
|
+
).matches, u = n.clientWidth * 0.85 * t * (r ? -1 : 1);
|
|
59
|
+
n.scrollBy({ left: u, behavior: e ? "auto" : "smooth" });
|
|
60
|
+
}, []);
|
|
61
|
+
return {
|
|
62
|
+
ref: i,
|
|
63
|
+
canScrollStart: o.start,
|
|
64
|
+
canScrollEnd: o.end,
|
|
65
|
+
scrollByPage: d
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
y as a,
|
|
70
|
+
b as u
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=use-scroll-overflow-UbLrUfBo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scroll-overflow-UbLrUfBo.js","sources":["../../src/hooks/use-overflow-collapse.ts","../../src/hooks/use-scroll-overflow.ts"],"sourcesContent":["import { useCallback, useRef, useState, type RefObject } from 'react';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';\n\nexport interface UseOverflowCollapseReturn<\n C extends HTMLElement,\n N extends HTMLElement,\n> {\n /**\n * Attach to the element whose inner width caps the content — the available\n * space. It must stay mounted in BOTH the expanded and the collapsed render\n * (it is the only thing left to measure once the content is swapped out).\n */\n containerRef: RefObject<C | null>;\n /**\n * Attach (as `ref={contentRef}`) to the natural-width content — its\n * `scrollWidth` is the space it needs. A callback ref, so the hook re-measures\n * the instant the content mounts or unmounts. Present only while expanded; the\n * hook remembers its last width so the collapsed branch keeps a threshold.\n */\n contentRef: (node: N | null) => void;\n /** The content does not fit the container — swap to the compact form. */\n isOverflowing: boolean;\n}\n\n/**\n * Reports whether a row of content is wider than the box it lives in, so a\n * caller can swap an overflowing strip for a compact form (a horizontal nav for\n * a dropdown, a toolbar for a \"more\" menu). Unlike a viewport media query, this\n * reacts to the CONTAINER — the same strip collapses in a narrow column on a\n * wide screen (e.g. a page squeezed between two sidebars) as on a small one.\n *\n * The catch with collapse-on-overflow is reversibility: once the content is\n * swapped out there is nothing left to measure, so a naive check can never\n * un-collapse. This remembers the content's width from the last frame it was\n * mounted (`naturalWidthRef`) — captured at the moment it overflowed, that is\n * its true min-content width — and keeps comparing it against the still-mounted\n * container, so the strip restores the instant the container grows back.\n *\n * The content is tracked as STATE via a callback ref (not a plain ref), so the\n * measurement effect re-subscribes whenever the content mounts/unmounts — for\n * ANY reason, not just an overflow-driven flip. A caller may collapse on a\n * second signal this hook can't see (a viewport media query *as well as*\n * overflow); keying re-subscription on the actual content node, rather than on\n * `isOverflowing`, keeps the observer attached across those transitions too.\n * `enabled` switches it off — e.g. when the host never collapses this strip —\n * clearing the flag so it renders expanded.\n *\n * Purely a layout decision; the content swap it drives stays fully in the DOM\n * and keyboard-reachable in either form, so assistive tech is unaffected.\n */\nexport function useOverflowCollapse<\n C extends HTMLElement,\n N extends HTMLElement,\n>(enabled = true): UseOverflowCollapseReturn<C, N> {\n const containerRef = useRef<C>(null);\n const [contentNode, setContentNode] = useState<N | null>(null);\n // Gate on `enabled`: a disabled host never collapses, so it never needs the\n // content tracked. Skipping the setState there keeps a non-collapsing consumer\n // from paying an extra mount render (and from re-running a render-prop on it).\n const contentRef = useCallback(\n (node: N | null) => {\n if (enabled) setContentNode(node);\n },\n [enabled],\n );\n const [isOverflowing, setIsOverflowing] = useState(false);\n const naturalWidthRef = useRef<number | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n if (!enabled) {\n naturalWidthRef.current = null;\n setIsOverflowing((prev) => (prev ? false : prev));\n return;\n }\n const container = containerRef.current;\n if (!container) return;\n const measure = () => {\n // While the content is mounted (expanded) its scrollWidth is the space it\n // needs; remember it so the collapsed branch still has a threshold.\n if (contentNode) naturalWidthRef.current = contentNode.scrollWidth;\n const natural = naturalWidthRef.current;\n if (natural == null) return;\n // +1 tolerates sub-pixel rounding between scroll/client widths.\n const next = natural - container.clientWidth > 1;\n // Bail to the same value when nothing changed, so an idle resize callback\n // never triggers a re-render. This also settles the collapse flip in a\n // single cycle: the content unmounts → effect re-runs → measure recomputes\n // the same value from the remembered width → bail.\n setIsOverflowing((prev) => (prev === next ? prev : next));\n };\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(measure);\n observer.observe(container);\n // Observe the content too when present: a longer label / added item grows\n // the content without resizing the container.\n if (contentNode) observer.observe(contentNode);\n return () => observer.disconnect();\n }, [enabled, contentNode]);\n\n return { containerRef, contentRef, isOverflowing };\n}\n","import { useCallback, useRef, useState, type RefObject } from 'react';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';\n\nexport interface UseScrollOverflowReturn<T extends HTMLElement> {\n /** Attach to the horizontally-scrollable element (the `overflow-x-auto` box). */\n ref: RefObject<T | null>;\n /** Content is hidden past the inline-START edge (scrolled away from the start). */\n canScrollStart: boolean;\n /** Content is hidden past the inline-END edge (more to reveal toward the end). */\n canScrollEnd: boolean;\n /**\n * Scroll by ~one viewport toward the inline start (`-1`) or end (`+1`),\n * smoothly unless the user prefers reduced motion. Direction-agnostic: works\n * in both LTR and RTL.\n */\n scrollByPage: (direction: -1 | 1) => void;\n}\n\n/**\n * Reports whether a horizontally-scrollable element has hidden content at its\n * inline-start / inline-end edges, and exposes a paged scroll action — the\n * plumbing behind a scroll strip's edge affordances (fade + chevron buttons).\n *\n * Direction-agnostic: distance-from-start is read as `Math.abs(scrollLeft)`,\n * which is correct in both LTR (`0…max`) and modern RTL (`0…-max`), so the two\n * edges are reported on the right logical side without branching. `scrollByPage`\n * flips its physical sign from the element's computed `direction`.\n *\n * Re-measures on element resize AND on content-size change (a tab added past the\n * fold widens the content without changing the container) by observing both the\n * scroll box and its first child. `enabled` switches measurement off — e.g. when\n * the host collapses the strip into a menu and there is nothing to scroll.\n *\n * Because the scrolled content stays in the DOM and is reachable by keyboard\n * (focus scrolls it into view), the affordance this drives is a sighted-pointer\n * convenience; assistive tech is unaffected.\n */\nexport function useScrollOverflow<T extends HTMLElement>(\n enabled = true,\n): UseScrollOverflowReturn<T> {\n const ref = useRef<T>(null);\n const [edges, setEdges] = useState({ start: false, end: false });\n\n useIsomorphicLayoutEffect(() => {\n const el = ref.current;\n if (!el || !enabled) {\n setEdges((prev) =>\n prev.start || prev.end ? { start: false, end: false } : prev,\n );\n return;\n }\n const measure = () => {\n // Math.abs() makes this direction-agnostic: modern RTL reports scrollLeft\n // as 0 at the start and negative toward the end, so |scrollLeft| is the\n // distance scrolled from the start in both writing directions.\n const distanceFromStart = Math.abs(el.scrollLeft);\n const maxScroll = el.scrollWidth - el.clientWidth;\n // +1 tolerates sub-pixel rounding between scroll/client widths.\n const start = distanceFromStart > 1;\n const end = maxScroll - distanceFromStart > 1;\n // Bail to the same reference when nothing changed, so neither the initial\n // no-overflow measure nor an idle scroll event triggers a re-render.\n setEdges((prev) =>\n prev.start === start && prev.end === end ? prev : { start, end },\n );\n };\n measure();\n el.addEventListener('scroll', measure, { passive: true });\n let observer: ResizeObserver | undefined;\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(measure);\n // The container catches viewport-width changes; its first child (the\n // content row) catches a tab added/removed past the fold, which grows the\n // scroll width without resizing the container.\n observer.observe(el);\n if (el.firstElementChild) observer.observe(el.firstElementChild);\n }\n return () => {\n el.removeEventListener('scroll', measure);\n observer?.disconnect();\n };\n }, [enabled]);\n\n const scrollByPage = useCallback((direction: -1 | 1) => {\n const el = ref.current;\n if (!el || typeof window === 'undefined') return;\n const isRtl = window.getComputedStyle(el).direction === 'rtl';\n const reduceMotion = window.matchMedia?.(\n '(prefers-reduced-motion: reduce)',\n ).matches;\n // ~85% of the viewport so a sliver of context carries across pages. The\n // physical sign flips in RTL (scrollLeft runs toward negative).\n const amount = el.clientWidth * 0.85 * direction * (isRtl ? -1 : 1);\n el.scrollBy({ left: amount, behavior: reduceMotion ? 'auto' : 'smooth' });\n }, []);\n\n return {\n ref,\n canScrollStart: edges.start,\n canScrollEnd: edges.end,\n scrollByPage,\n };\n}\n"],"names":["useOverflowCollapse","enabled","containerRef","useRef","contentNode","setContentNode","useState","contentRef","useCallback","node","isOverflowing","setIsOverflowing","naturalWidthRef","useIsomorphicLayoutEffect","prev","container","measure","natural","next","observer","useScrollOverflow","ref","edges","setEdges","el","distanceFromStart","maxScroll","start","end","scrollByPage","direction","isRtl","reduceMotion","_a","amount"],"mappings":";;AAkDO,SAASA,EAGdC,IAAU,IAAuC;AACjD,QAAMC,IAAeC,EAAU,IAAI,GAC7B,CAACC,GAAaC,CAAc,IAAIC,EAAmB,IAAI,GAIvDC,IAAaC;AAAA,IACjB,CAACC,MAAmB;AAClB,MAAIR,OAAwBQ,CAAI;AAAA,IAClC;AAAA,IACA,CAACR,CAAO;AAAA,EAAA,GAEJ,CAACS,GAAeC,CAAgB,IAAIL,EAAS,EAAK,GAClDM,IAAkBT,EAAsB,IAAI;AAElD,SAAAU,EAA0B,MAAM;AAC9B,QAAI,CAACZ,GAAS;AACZ,MAAAW,EAAgB,UAAU,MAC1BD,EAAiB,CAACG,MAAUA,KAAO,EAAa;AAChD;AAAA,IACF;AACA,UAAMC,IAAYb,EAAa;AAC/B,QAAI,CAACa,EAAW;AAChB,UAAMC,IAAU,MAAM;AAGpB,MAAIZ,MAAaQ,EAAgB,UAAUR,EAAY;AACvD,YAAMa,IAAUL,EAAgB;AAChC,UAAIK,KAAW,KAAM;AAErB,YAAMC,IAAOD,IAAUF,EAAU,cAAc;AAK/C,MAAAJ,EAAiB,CAACG,MAAUA,MAAS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AAUR,CAAO,GACxCG,KAAA,QAAAA,EAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAAClB,CAAO,CAAC;AAEZ,QAAM4B,IAAerB,EAAY,CAACsB,MAAsB;;AACtD,UAAMN,IAAKH,EAAI;AACf,QAAI,CAACG,KAAM,OAAO,SAAW,IAAa;AAC1C,UAAMO,IAAQ,OAAO,iBAAiBP,CAAE,EAAE,cAAc,OAClDQ,KAAeC,IAAA,OAAO,eAAP,gBAAAA,EAAA;AAAA;AAAA,MACnB;AAAA,MACA,SAGIC,IAASV,EAAG,cAAc,OAAOM,KAAaC,IAAQ,KAAK;AACjE,IAAAP,EAAG,SAAS,EAAE,MAAMU,GAAQ,UAAUF,IAAe,SAAS,UAAU;AAAA,EAC1E,GAAG,CAAA,CAAE;AAEL,SAAO;AAAA,IACL,KAAAX;AAAA,IACA,gBAAgBC,EAAM;AAAA,IACtB,cAAcA,EAAM;AAAA,IACpB,cAAAO;AAAA,EAAA;AAEJ;"}
|
package/dist/agent-catalog.json
CHANGED
|
@@ -39,6 +39,15 @@ export interface ControlRoomRailProps extends Omit<ToolRailProps, 'tools' | 'onR
|
|
|
39
39
|
onFavoriteIdsChange?: (next: string[]) => void;
|
|
40
40
|
/** localStorage key for the uncontrolled favourites. */
|
|
41
41
|
persistFavoritesKey?: string;
|
|
42
|
+
/**
|
|
43
|
+
* localStorage key for the uncontrolled committed panel width, mirroring
|
|
44
|
+
* `persistFavoritesKey`: when set and `panelWidth` is absent, the rail
|
|
45
|
+
* seeds its width from storage on mount and writes each commit back.
|
|
46
|
+
* Unlike `persistFavoritesKey` this has no default — persistence is
|
|
47
|
+
* opt-in. Only meaningful with `resizablePanel` — there is nothing to
|
|
48
|
+
* persist without the resize handle.
|
|
49
|
+
*/
|
|
50
|
+
persistPanelWidthKey?: string;
|
|
42
51
|
}
|
|
43
52
|
export declare const ControlRoomRail: import("react").ForwardRefExoticComponent<ControlRoomRailProps & import("react").RefAttributes<ToolRailHandle>>;
|
|
44
53
|
//# sourceMappingURL=control-room-rail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-room-rail.d.ts","sourceRoot":"","sources":["../../../src/components/control-room-rail/control-room-rail.tsx"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAqCtB,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEnD,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAChD,aAAa,EACX,OAAO,GACP,WAAW,GACX,2BAA2B,GAC3B,sBAAsB,GACtB,mBAAmB,CACtB;IACC;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/C,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"control-room-rail.d.ts","sourceRoot":"","sources":["../../../src/components/control-room-rail/control-room-rail.tsx"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAqCtB,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEnD,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAChD,aAAa,EACX,OAAO,GACP,WAAW,GACX,2BAA2B,GAC3B,sBAAsB,GACtB,mBAAmB,CACtB;IACC;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/C,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;;OAOG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,iHAsU1B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as r, a as l, c as a, u as t, b as e, d as n } from "../../_chunks/control-room-rail-
|
|
1
|
+
import { C as r, a as l, c as a, u as t, b as e, d as n } from "../../_chunks/control-room-rail-Cv7GpMqX.js";
|
|
2
2
|
export {
|
|
3
3
|
r as ControlRoomProvider,
|
|
4
4
|
l as ControlRoomRail,
|
|
@@ -145,6 +145,38 @@ export interface NotesPanelProps extends Omit<HTMLAttributes<HTMLElement>, 'titl
|
|
|
145
145
|
* neither affordance).
|
|
146
146
|
*/
|
|
147
147
|
aiConsent?: AiConsentGate;
|
|
148
|
+
/**
|
|
149
|
+
* Template variables for the rich composer's "Insert variable" menu and
|
|
150
|
+
* `[[TOKEN]]` chip rendering. Forwarded straight to `RichTextEditor`.
|
|
151
|
+
* Ignored by the `'plain'` composer.
|
|
152
|
+
*/
|
|
153
|
+
variables?: RichTextEditorProps['variables'];
|
|
154
|
+
/** Decide whether a `[[TOKEN]]` is valid. See `RichTextEditor`. */
|
|
155
|
+
validateVariable?: RichTextEditorProps['validateVariable'];
|
|
156
|
+
/** The invalid `[[TOKEN]]`s in the draft, reported by the rich composer. */
|
|
157
|
+
onVariableValidityChange?: RichTextEditorProps['onVariableValidityChange'];
|
|
158
|
+
/**
|
|
159
|
+
* Bring your own Help-me-write surface (e.g. practice templates) into the
|
|
160
|
+
* composer, forwarded straight to `RichTextEditor`. See
|
|
161
|
+
* `RichTextEditorProps['renderHelpMeWrite']`.
|
|
162
|
+
*/
|
|
163
|
+
renderHelpMeWrite?: RichTextEditorProps['renderHelpMeWrite'];
|
|
164
|
+
/** Upload an image yourself and resolve its URL. See `RichTextEditor`. */
|
|
165
|
+
onUploadImage?: RichTextEditorProps['onUploadImage'];
|
|
166
|
+
/** An AI call ran out of credits. See `RichTextEditor`. */
|
|
167
|
+
onAiCreditsExhausted?: RichTextEditorProps['onAiCreditsExhausted'];
|
|
168
|
+
/**
|
|
169
|
+
* Rendered just above the composer — e.g. the Help-me-write templates
|
|
170
|
+
* pattern's `undoNotice`. Renders in both add and edit mode, whenever the
|
|
171
|
+
* composer itself is mounted.
|
|
172
|
+
*/
|
|
173
|
+
composerBefore?: ReactNode;
|
|
174
|
+
/**
|
|
175
|
+
* Rendered just after the composer — e.g. the Help-me-write templates
|
|
176
|
+
* pattern's `manager` dialog. Renders in both add and edit mode, whenever
|
|
177
|
+
* the composer itself is mounted.
|
|
178
|
+
*/
|
|
179
|
+
composerAfter?: ReactNode;
|
|
148
180
|
/** Toggle a note's pinned state — renders an inline pin button per note. */
|
|
149
181
|
onTogglePin?: (id: string) => void;
|
|
150
182
|
/** Toggle a note's flagged state — renders an inline flag button per note. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes-panel.d.ts","sourceRoot":"","sources":["../../../src/components/notes-panel/notes-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAA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C,EAAE,MAAM,CAAC;CACvB;AAoED,eAAO,MAAM,UAAU,yGA+
|
|
1
|
+
{"version":3,"file":"notes-panel.d.ts","sourceRoot":"","sources":["../../../src/components/notes-panel/notes-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,KAAK,EAEV,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,aAAa,EACd,MAAM,qBAAqB,CAAC;AA4B7B;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,qBAAqB,EACnB,IAAI,GACJ,SAAS,GACT,cAAc,GACd,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,SAAS,GACT,eAAe,GACf,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,SAAS,GACT,cAAc,CACjB,GAAG;IACF,uDAAuD;IACvD,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC,CAAC;AAEF;4DAC4D;AAC5D,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,QAAQ,EAAE,MAAM,KAAK,CAAC;QACpB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;IACH,4DAA4D;IAC5D,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,mEAAmE;IACnE,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,MAAM,GAA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