@arbidocs/blocks 0.5.65 → 0.5.66

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.
Files changed (118) hide show
  1. package/dist/{ConnectedCallDock-GJAGY75U.cjs → ConnectedCallDock-FFIDDYGH.cjs} +6 -6
  2. package/dist/{ConnectedCallDock-GJAGY75U.cjs.map → ConnectedCallDock-FFIDDYGH.cjs.map} +1 -1
  3. package/dist/{ConnectedCallDock-DEAEFUUD.js → ConnectedCallDock-VMEBH4LG.js} +6 -6
  4. package/dist/{ConnectedCallDock-DEAEFUUD.js.map → ConnectedCallDock-VMEBH4LG.js.map} +1 -1
  5. package/dist/{ConnectedCallRoom-DI7UYRHE.js → ConnectedCallRoom-2FNSX2VG.js} +6 -6
  6. package/dist/{ConnectedCallRoom-DI7UYRHE.js.map → ConnectedCallRoom-2FNSX2VG.js.map} +1 -1
  7. package/dist/{ConnectedCallRoom-KLE2PCMQ.cjs → ConnectedCallRoom-HYRLJUIV.cjs} +6 -6
  8. package/dist/{ConnectedCallRoom-KLE2PCMQ.cjs.map → ConnectedCallRoom-HYRLJUIV.cjs.map} +1 -1
  9. package/dist/{ConnectedDocumentViewer-YSZWOVGN.cjs → ConnectedDocumentViewer-S6YKCCRN.cjs} +9 -9
  10. package/dist/{ConnectedDocumentViewer-YSZWOVGN.cjs.map → ConnectedDocumentViewer-S6YKCCRN.cjs.map} +1 -1
  11. package/dist/{ConnectedDocumentViewer-HKIBNGGG.js → ConnectedDocumentViewer-XFQDHVWM.js} +9 -9
  12. package/dist/{ConnectedDocumentViewer-HKIBNGGG.js.map → ConnectedDocumentViewer-XFQDHVWM.js.map} +1 -1
  13. package/dist/agents/index.cjs +260 -260
  14. package/dist/agents/index.js +3 -3
  15. package/dist/calls/index.cjs +2 -2
  16. package/dist/calls/index.js +2 -2
  17. package/dist/chat/index.cjs +57 -57
  18. package/dist/chat/index.js +4 -4
  19. package/dist/{chunk-F777MGVA.cjs → chunk-3SHZPTR2.cjs} +18 -18
  20. package/dist/{chunk-F777MGVA.cjs.map → chunk-3SHZPTR2.cjs.map} +1 -1
  21. package/dist/{chunk-TVHTXO6V.cjs → chunk-56WWEK6I.cjs} +4 -4
  22. package/dist/{chunk-TVHTXO6V.cjs.map → chunk-56WWEK6I.cjs.map} +1 -1
  23. package/dist/{chunk-CGCTODPC.cjs → chunk-6PGTH2HD.cjs} +4 -4
  24. package/dist/{chunk-CGCTODPC.cjs.map → chunk-6PGTH2HD.cjs.map} +1 -1
  25. package/dist/{chunk-6QZ35CTZ.js → chunk-AD76WTGR.js} +3 -3
  26. package/dist/{chunk-6QZ35CTZ.js.map → chunk-AD76WTGR.js.map} +1 -1
  27. package/dist/{chunk-ROWJU4SK.cjs → chunk-AKGV6JUC.cjs} +12 -128
  28. package/dist/chunk-AKGV6JUC.cjs.map +1 -0
  29. package/dist/{chunk-UIUWCTIZ.js → chunk-APXW5XGA.js} +165 -4
  30. package/dist/chunk-APXW5XGA.js.map +1 -0
  31. package/dist/{chunk-SEVFIBF3.cjs → chunk-BFIHXDO6.cjs} +4 -4
  32. package/dist/{chunk-SEVFIBF3.cjs.map → chunk-BFIHXDO6.cjs.map} +1 -1
  33. package/dist/{chunk-JSHBC47B.cjs → chunk-BP5KBZLX.cjs} +38 -38
  34. package/dist/{chunk-JSHBC47B.cjs.map → chunk-BP5KBZLX.cjs.map} +1 -1
  35. package/dist/{chunk-YQEXBJVO.js → chunk-DF5X27QX.js} +42 -5
  36. package/dist/chunk-DF5X27QX.js.map +1 -0
  37. package/dist/{chunk-CJF7B5A7.cjs → chunk-DRUNPUDT.cjs} +3 -3
  38. package/dist/{chunk-CJF7B5A7.cjs.map → chunk-DRUNPUDT.cjs.map} +1 -1
  39. package/dist/{chunk-6OMIIF76.js → chunk-EM4KOKE6.js} +3 -3
  40. package/dist/{chunk-6OMIIF76.js.map → chunk-EM4KOKE6.js.map} +1 -1
  41. package/dist/{chunk-GPYLXEZO.js → chunk-FCOK73I3.js} +6 -120
  42. package/dist/chunk-FCOK73I3.js.map +1 -0
  43. package/dist/{chunk-ITRI47DF.cjs → chunk-GMGEAWFX.cjs} +41 -4
  44. package/dist/chunk-GMGEAWFX.cjs.map +1 -0
  45. package/dist/{chunk-LNH6NYG4.js → chunk-I3VBVP6R.js} +121 -6
  46. package/dist/chunk-I3VBVP6R.js.map +1 -0
  47. package/dist/{chunk-ZZHMJXM5.cjs → chunk-IXZCXK6Q.cjs} +122 -5
  48. package/dist/chunk-IXZCXK6Q.cjs.map +1 -0
  49. package/dist/{chunk-C2S246BV.js → chunk-J6FRFIVL.js} +3 -3
  50. package/dist/{chunk-C2S246BV.js.map → chunk-J6FRFIVL.js.map} +1 -1
  51. package/dist/{chunk-PLEMVK2W.js → chunk-KQLUMK56.js} +3 -3
  52. package/dist/{chunk-PLEMVK2W.js.map → chunk-KQLUMK56.js.map} +1 -1
  53. package/dist/{chunk-PNZVUH46.cjs → chunk-LAQ3Y5JP.cjs} +6 -6
  54. package/dist/{chunk-PNZVUH46.cjs.map → chunk-LAQ3Y5JP.cjs.map} +1 -1
  55. package/dist/{chunk-AESJLGMC.cjs → chunk-NDKZ6OR3.cjs} +6 -6
  56. package/dist/{chunk-AESJLGMC.cjs.map → chunk-NDKZ6OR3.cjs.map} +1 -1
  57. package/dist/{chunk-43IVRSFX.js → chunk-NVXNTHL4.js} +3 -3
  58. package/dist/{chunk-43IVRSFX.js.map → chunk-NVXNTHL4.js.map} +1 -1
  59. package/dist/{chunk-5EGTGHBW.js → chunk-PMWZTVIY.js} +3 -3
  60. package/dist/{chunk-5EGTGHBW.js.map → chunk-PMWZTVIY.js.map} +1 -1
  61. package/dist/{chunk-7MOQO6NO.cjs → chunk-RB54N5I7.cjs} +53 -5
  62. package/dist/chunk-RB54N5I7.cjs.map +1 -0
  63. package/dist/{chunk-2C4YUIVX.js → chunk-T2VGD4X6.js} +3 -3
  64. package/dist/{chunk-2C4YUIVX.js.map → chunk-T2VGD4X6.js.map} +1 -1
  65. package/dist/{chunk-4Q7ON335.js → chunk-TCCJ5I6G.js} +3 -3
  66. package/dist/{chunk-4Q7ON335.js.map → chunk-TCCJ5I6G.js.map} +1 -1
  67. package/dist/{chunk-4CI42DCG.js → chunk-U52KPOXT.js} +50 -5
  68. package/dist/chunk-U52KPOXT.js.map +1 -0
  69. package/dist/{chunk-SFTQO3TU.js → chunk-UO3FS6ZF.js} +3 -3
  70. package/dist/{chunk-SFTQO3TU.js.map → chunk-UO3FS6ZF.js.map} +1 -1
  71. package/dist/{chunk-LFS6UWSJ.cjs → chunk-XWUGPV7H.cjs} +5 -5
  72. package/dist/{chunk-LFS6UWSJ.cjs.map → chunk-XWUGPV7H.cjs.map} +1 -1
  73. package/dist/{chunk-OM5IVNEW.cjs → chunk-Z4KXF7WS.cjs} +165 -2
  74. package/dist/chunk-Z4KXF7WS.cjs.map +1 -0
  75. package/dist/connect/index.cjs +564 -283
  76. package/dist/connect/index.cjs.map +1 -1
  77. package/dist/connect/index.d.ts +3 -0
  78. package/dist/connect/index.js +292 -19
  79. package/dist/connect/index.js.map +1 -1
  80. package/dist/connect/viewer.cjs +7 -7
  81. package/dist/connect/viewer.js +7 -7
  82. package/dist/connection/runtime/ConnectedAppRuntime.d.ts +1 -1
  83. package/dist/connection/runtime/index.d.ts +1 -1
  84. package/dist/connection/runtime/requests.d.ts +8 -0
  85. package/dist/connection/runtime/useWelcomeDialog.d.ts +3 -0
  86. package/dist/connection/tips/ConnectedGettingStarted.d.ts +20 -0
  87. package/dist/connection/tips/ConnectedTipBar.d.ts +49 -0
  88. package/dist/connection/tips/useGettingStarted.d.ts +51 -0
  89. package/dist/embed/index.cjs +1 -1
  90. package/dist/embed/index.js +1 -1
  91. package/dist/home/index.cjs +23 -178
  92. package/dist/home/index.cjs.map +1 -1
  93. package/dist/home/index.js +3 -164
  94. package/dist/home/index.js.map +1 -1
  95. package/dist/index.cjs +457 -485
  96. package/dist/index.cjs.map +1 -1
  97. package/dist/index.js +15 -54
  98. package/dist/index.js.map +1 -1
  99. package/dist/shell/index.cjs +73 -73
  100. package/dist/shell/index.js +4 -4
  101. package/dist/studio/index.cjs +8 -8
  102. package/dist/studio/index.js +5 -5
  103. package/dist/tips/index.d.ts +1 -1
  104. package/dist/tips/visibility.d.ts +7 -0
  105. package/dist/workflow-canvas/index.cjs +17 -17
  106. package/dist/workflow-canvas/index.js +4 -4
  107. package/node_modules/@arbidocs/coedit/package.json +1 -1
  108. package/package.json +5 -5
  109. package/dist/chunk-4CI42DCG.js.map +0 -1
  110. package/dist/chunk-7MOQO6NO.cjs.map +0 -1
  111. package/dist/chunk-GPYLXEZO.js.map +0 -1
  112. package/dist/chunk-ITRI47DF.cjs.map +0 -1
  113. package/dist/chunk-LNH6NYG4.js.map +0 -1
  114. package/dist/chunk-OM5IVNEW.cjs.map +0 -1
  115. package/dist/chunk-ROWJU4SK.cjs.map +0 -1
  116. package/dist/chunk-UIUWCTIZ.js.map +0 -1
  117. package/dist/chunk-YQEXBJVO.js.map +0 -1
  118. package/dist/chunk-ZZHMJXM5.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/AccountBanners.tsx","../src/shell/ShellSidebar.tsx","../src/shell/SidebarRowAction.tsx","../src/shell/AskField.tsx","../src/shell/MobileBars.tsx","../src/shell/use-install-prompt.ts","../src/shell/InstallPrompt.tsx","../src/shell/StatusRow.tsx","../src/shell/OfflinePill.tsx","../src/shell/RemoteControlPill.tsx","../src/shell/TipCard.tsx","../src/shell/InfoBar.tsx","../src/shell/SplitLayout.tsx"],"names":["canPersistSession","jsx","Banner","jsxs","Sidebar","useContext","SidebarRowHoverContext","cn","BlocksTooltipProvider","Tooltip","TooltipTrigger","TooltipContent","testIdOr","Sparkles","Button","Search","ArrowUp","X","Menu","Fragment","useRef","useShellBottomInset","ActionLink","prefixedTestId","useState","useEffect","useCallback","isIosDevice","getInstallInstructions","Download","STATUS_ROW_TONES","STATUS_ROW_BASE_CLASS","WifiOff","TriangleAlert","Refresh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AAAA,SACH;AAAA,wBACAN,cAAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,WAAA,EAAU,iBAAA;AAAA,YACV,SAAA,EAAWM,KAAAA;AAAA,cACT,uBAAA;AAAA,cACA,gBAAgB,aAAa,CAAA;AAAA,cAC7B,yBAAA,IAA6B,SAAA;AAAA,cAC7B,mBAAmB,cAAA,GAAiB,cAAA;AAAA,cACpC;AAAA,aACF;AAAA,YAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-ROWJU4SK.cjs","sourcesContent":["import { canPersistSession } from '@arbidocs/client'\nimport { Banner } from '../components/Banner'\n\nexport const DEFAULT_INSECURE_SESSION_BANNER_TEXT =\n 'This connection is not secure (no HTTPS), so your session is kept in memory only and you will be signed out when you reload. Use https:// or localhost for a persistent, encrypted session.'\n\nexport interface InsecureSessionBannerProps {\n text?: string\n className?: string\n}\n\n/**\n * Shown whenever the browser has no Web Crypto (a plain-HTTP origin other than localhost,\n * Tracking Prevention, some embedded webviews). Encryption at rest needs a non-extractable key,\n * so the session is held in memory only: everything works, but a reload signs the user out. Said\n * out loud rather than silently degrading. Renders nothing in a secure context.\n */\nexport function InsecureSessionBanner({\n text = DEFAULT_INSECURE_SESSION_BANNER_TEXT,\n className,\n}: InsecureSessionBannerProps) {\n if (canPersistSession()) return null\n return (\n <Banner\n variant=\"alert\"\n tone=\"warning\"\n text={text}\n className={className}\n testId=\"insecure-context-banner\"\n />\n )\n}\n\nexport const DEFAULT_ACCOUNT_DELETION_BANNER_TEXT = (date: string) =>\n `Account deletion requested on ${date}. Your account and all data will be permanently deleted shortly.`\n\nexport interface AccountDeletionBannerProps {\n /** When the user asked for the deletion (ISO timestamp, the user setting `deletion_requested_at`). */\n requestedAt: string\n /** The notice, given the formatted request date. */\n text?: (date: string) => string\n className?: string\n}\n\n/** The account is due for deletion: a standing notice until it goes. */\nexport function AccountDeletionBanner({\n requestedAt,\n text = DEFAULT_ACCOUNT_DELETION_BANNER_TEXT,\n className,\n}: AccountDeletionBannerProps) {\n const date = new Date(requestedAt).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n return (\n <Banner\n variant=\"alert\"\n tone=\"destructive\"\n text={text(date)}\n className={className}\n testId=\"account-deletion-banner\"\n />\n )\n}\n","import type { ReactNode } from 'react'\nimport { Sidebar, type SidebarRootProps } from './Sidebar'\nimport type { SidebarController } from './use-sidebar-controller'\nimport type { NavItem, NavSection } from './types'\n\nexport interface ShellSidebarProps extends Pick<\n SidebarRootProps,\n 'className' | 'aria-label' | 'labels' | 'backdropTestId'\n> {\n /** From `useSidebarController`: layout, hover/pin/drawer behaviour. */\n controller: SidebarController\n /** Brand mark of the phone drawer's header (logo + close). Omit for no drawer header. */\n drawerLogo?: ReactNode\n /** `data-testid` of the drawer's close button. */\n drawerCloseTestId?: string\n /** Top block (workspace switcher, ask field, pin toggle). Read `controller.expanded` for the rail. */\n header?: ReactNode\n /** Rows as data. */\n items?: NavItem[]\n /** Labelled groups of rows as data, after `items`. */\n sections?: NavSection[]\n navClassName?: string\n /**\n * Width-bound cards at the top of the footer (smart tips, notices): shown only once the panel\n * has settled open, and gone the instant it starts to close.\n */\n tips?: ReactNode\n /** The rest of the footer (status rows, account rows). */\n footer?: ReactNode\n /** Root `data-testid` (default `sidebar`). */\n 'data-testid'?: string\n}\n\n/**\n * The whole sidebar from a controller and data: `Sidebar.Root` in the resolved mode, the phone\n * drawer header, the header slot, the nav rows/groups and the footer. Renders nothing while the\n * layout is hidden (a phone with the drawer closed), so no clipped rows carry duplicate test ids.\n *\n * const sidebar = useSidebarController({ isPinned, onPinnedChange: setPinned })\n * <ShellSidebar controller={sidebar} header={…} items={nav} footer={…} />\n */\nexport function ShellSidebar({\n controller,\n drawerLogo,\n drawerCloseTestId,\n header,\n items,\n sections,\n navClassName,\n tips,\n footer,\n ...rootProps\n}: ShellSidebarProps) {\n if (controller.layout.hidden) return null\n return (\n <Sidebar.Root {...controller.rootProps} {...rootProps}>\n {controller.isDrawer && drawerLogo && (\n <Sidebar.DrawerHeader\n logo={drawerLogo}\n onClose={controller.closeDrawer}\n data-testid={drawerCloseTestId}\n />\n )}\n {header && <Sidebar.Header>{header}</Sidebar.Header>}\n <Sidebar.Nav items={items} sections={sections} className={navClassName} />\n {(tips || footer) && (\n <Sidebar.Footer>\n {controller.tipsVisible && tips}\n {footer}\n </Sidebar.Footer>\n )}\n </Sidebar.Root>\n )\n}\n","import { useContext, type ReactNode } from 'react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\nimport { SidebarRowHoverContext } from './Sidebar'\n\nexport type SidebarRowActionPulse = 'active' | 'success' | 'error'\n\nexport interface SidebarRowActionProps {\n /** The row this control sits on is selected: the glyph takes the selection ink. */\n active?: boolean\n onClick?: () => void\n /** Tooltip text and accessible label. */\n label: string\n /** Reflected as aria-pressed for toggle controls. */\n pressed?: boolean\n /**\n * Demand attention while the row is idle: `active` pulses primary (work in progress),\n * `success` pulses green (just finished), `error` is a steady red alert. A selected row wins.\n */\n pulse?: SidebarRowActionPulse | null\n 'data-testid'?: string\n children: ReactNode\n}\n\nconst PULSE_STYLES: Record<SidebarRowActionPulse, string> = {\n active: 'animate-pulse-attention text-primary',\n success: 'animate-pulse-attention text-green-text',\n // Steady (not animated) so a failure stays put and reads as a standing alert.\n error: 'text-red-text opacity-100',\n}\n\n/**\n * The secondary control at the right edge of a sidebar row: a small muted glyph. Always visible\n * (touch has no hover); hovering or focusing the row only brightens it a tone, through\n * SidebarRowHoverContext. Stops propagation so it never triggers the row's own click.\n */\nexport function SidebarRowAction({\n active = false,\n onClick,\n label,\n pressed,\n pulse = null,\n 'data-testid': testId,\n children,\n}: SidebarRowActionProps) {\n const rowHovered = useContext(SidebarRowHoverContext)\n\n const tone = active\n ? 'text-accent-foreground hover:bg-background/60'\n : pulse\n ? `${PULSE_STYLES[pulse]} hover:bg-muted`\n : cn(\n 'text-muted-foreground hover:bg-muted hover:text-foreground',\n rowHovered ? 'opacity-100' : 'opacity-70'\n )\n\n return (\n <BlocksTooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild onFocusCapture={(e) => e.stopPropagation()}>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick?.()\n }}\n aria-label={label}\n aria-pressed={pressed}\n data-slot=\"sidebar-row-action\"\n data-testid={testId}\n className={cn('rounded-md p-1 transition-colors pointer-coarse:p-2.5', tone)}\n >\n {children}\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"right\">{label}</TooltipContent>\n </Tooltip>\n </BlocksTooltipProvider>\n )\n}\n","import type { InputHTMLAttributes, KeyboardEvent, ReactNode, Ref } from 'react'\nimport { ArrowUp, Search, Sparkles, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the ask field, its trigger and the expanded row. */\nexport interface AskFieldLabels {\n /** Input placeholder (the `placeholder` prop wins). */\n placeholder: string\n /** The input's accessible name. */\n inputLabel: string\n search: string\n askAi: string\n /** The icon-only trigger. */\n askOrSearch: string\n closeSearch: string\n}\n\nexport const DEFAULT_ASK_FIELD_LABELS: AskFieldLabels = {\n placeholder: 'Ask or search…',\n inputLabel: 'Ask AI or search your documents',\n search: 'Search',\n askAi: 'Ask AI',\n askOrSearch: 'Ask AI or search',\n closeSearch: 'Close search',\n}\n\nexport interface AskFieldProps {\n value: string\n onValueChange: (value: string) => void\n /** Enter / the arrow button: ask AI. */\n onAsk: (text: string) => void\n /** The magnifier button: semantic search. */\n onSearch: (text: string) => void\n /** Intercept keys first (e.g. a slash menu); call `preventDefault` to stop the default Enter-asks. */\n onInputKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void\n /** Rendered just under the field at its width (a slash/autocomplete menu). */\n menu?: ReactNode\n inputRef?: Ref<HTMLInputElement>\n /** Extra attributes for the input, e.g. the combobox props of `useListKeyNav` for a slash menu. */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n placeholder?: string\n labels?: Partial<AskFieldLabels>\n autoFocus?: boolean\n className?: string\n /** Root id (default `workspace-ask-bar`); the input/search/submit ids are `<root>-input|search|submit`. */\n 'data-testid'?: string\n}\n\n/**\n * The compact one-line ask/search field: sparkle, input, then two icon doors (Search, Ask AI).\n * Text and the menu are controlled by the host, so the same field serves the sidebar, the phone\n * app bar and any custom shell.\n */\nexport function AskField({\n value,\n onValueChange,\n onAsk,\n onSearch,\n onInputKeyDown,\n menu,\n inputRef,\n inputProps,\n placeholder,\n labels,\n autoFocus = false,\n className,\n 'data-testid': testIdProp,\n}: AskFieldProps) {\n const testId = testIdOr(testIdProp, { testId: 'workspace-ask-bar' })\n const l = { ...DEFAULT_ASK_FIELD_LABELS, ...labels }\n const isEmpty = !value.trim()\n const submit = (handler: (text: string) => void) => {\n const text = value.trim()\n if (text) handler(text)\n }\n\n return (\n <div className={cn('relative', className)} data-slot=\"ask-field\" data-testid={testId}>\n {menu && <div className=\"absolute inset-x-0 top-9 z-30\">{menu}</div>}\n <div\n role=\"search\"\n className=\"flex h-9 items-center gap-0.5 rounded-md border border-border bg-background pl-2.5 pr-0.5 transition-colors focus-within:border-primary focus-within:ring-3 focus-within:ring-primary pointer-coarse:h-11\"\n >\n <Sparkles aria-hidden=\"true\" className=\"size-4 shrink-0 text-ai-ink\" />\n <input\n {...inputProps}\n ref={inputRef}\n type=\"text\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={(e) => {\n onInputKeyDown?.(e)\n // Enter asks (not mid-IME-composition). A plain div, not a <form>.\n if (e.defaultPrevented) return\n if (e.key === 'Enter' && !e.nativeEvent.isComposing) {\n e.preventDefault()\n submit(onAsk)\n }\n }}\n placeholder={placeholder ?? l.placeholder}\n aria-label={l.inputLabel}\n autoFocus={autoFocus}\n className=\"ml-1.5 h-8 min-w-0 flex-1 bg-transparent pointer-coarse:h-11 text-sm text-foreground outline-none placeholder:text-muted-foreground\"\n data-testid={`${testId}-input`}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onSearch)}\n title={l.search}\n aria-label={l.search}\n className=\"size-7 shrink-0 text-muted-foreground hover:text-foreground pointer-coarse:size-10\"\n data-testid={`${testId}-search`}\n >\n <Search className=\"size-4\" />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onAsk)}\n title={l.askAi}\n aria-label={l.askAi}\n className=\"!inline-flex size-7 shrink-0 text-ai-ink hover:bg-ai-soft hover:text-ai-ink pointer-coarse:size-10\"\n data-testid={`${testId}-submit`}\n >\n <ArrowUp className=\"size-4\" />\n </Button>\n </div>\n </div>\n )\n}\n\nexport interface AskTriggerProps {\n /** Opens the ask field (the single-action variants) or asks AI (`split`). */\n onClick: () => void\n /**\n * `rail`: the icon-only sidebar's bordered tile; `appbar`: the phone app bar's bare icon;\n * `split`: two icon buttons side by side, Search (`onSearch`) and Ask AI (`onClick`).\n */\n variant?: 'rail' | 'appbar' | 'split'\n /** The Search action of the `split` variant. */\n onSearch?: () => void\n labels?: Partial<Pick<AskFieldLabels, 'askOrSearch' | 'search' | 'askAi'>>\n /**\n * `split` only: show the Search and Ask AI texts beside the icons (from `sm` up; phones keep\n * icons, the texts stay as accessible names and tooltips) instead of icon-only buttons.\n */\n showLabels?: boolean\n /** Root id; the split buttons get `<root>-search` and `<root>-ask` unless overridden. */\n 'data-testid'?: string\n searchTestId?: string\n askTestId?: string\n}\n\n/** The icon that stands in for the field where there is no room for it. */\nexport function AskTrigger({\n onClick,\n variant = 'rail',\n onSearch,\n labels,\n showLabels = false,\n 'data-testid': testId,\n searchTestId,\n askTestId,\n}: AskTriggerProps) {\n const text = labels?.askOrSearch ?? DEFAULT_ASK_FIELD_LABELS.askOrSearch\n if (variant === 'split') {\n const searchText = labels?.search ?? DEFAULT_ASK_FIELD_LABELS.search\n const askText = labels?.askAi ?? DEFAULT_ASK_FIELD_LABELS.askAi\n return (\n <div\n role=\"group\"\n aria-label={text}\n data-slot=\"ask-trigger\"\n data-variant=\"split\"\n data-testid={testId}\n className=\"inline-flex items-center rounded-md border border-border bg-background\"\n >\n <button\n type=\"button\"\n onClick={onSearch}\n title={searchText}\n aria-label={searchText}\n data-testid={searchTestId ?? (testId ? `${testId}-search` : undefined)}\n className={cn(\n 'flex h-9 items-center justify-center gap-1.5 rounded-l-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground pointer-coarse:h-11',\n showLabels\n ? 'min-w-9 px-2.5 text-sm pointer-coarse:min-w-11'\n : 'w-9 pointer-coarse:w-11'\n )}\n >\n <Search className=\"size-4\" />\n {showLabels && <span className=\"hidden sm:inline\">{searchText}</span>}\n </button>\n <button\n type=\"button\"\n onClick={onClick}\n title={askText}\n aria-label={askText}\n data-testid={askTestId ?? (testId ? `${testId}-ask` : undefined)}\n className={cn(\n 'flex h-9 items-center justify-center gap-1.5 rounded-r-md border-l border-border text-ai-ink transition-colors hover:bg-ai-soft pointer-coarse:h-11',\n showLabels\n ? 'min-w-9 px-2.5 text-sm pointer-coarse:min-w-11'\n : 'w-9 pointer-coarse:w-11'\n )}\n >\n <Sparkles className=\"size-4\" />\n {showLabels && <span className=\"hidden sm:inline\">{askText}</span>}\n </button>\n </div>\n )\n }\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={text}\n aria-label={text}\n data-slot=\"ask-trigger\"\n data-testid={testId}\n className={cn(\n 'flex items-center justify-center rounded-md text-ai-ink transition-colors hover:bg-ai-soft',\n variant === 'rail'\n ? 'h-9 w-12 border border-border bg-background pointer-coarse:h-11'\n : 'size-11'\n )}\n >\n <Sparkles className={variant === 'rail' ? 'size-4' : 'size-5'} />\n </button>\n )\n}\n\nexport interface AskRowProps {\n /** The field (an AskField). */\n children: ReactNode\n onClose: () => void\n labels?: Partial<Pick<AskFieldLabels, 'closeSearch'>>\n /** Row id (default `workspace-ask-bar-expanded`). */\n 'data-testid'?: string\n /** Collapse button id (default `workspace-ask-bar-collapse`). */\n collapseTestId?: string\n}\n\n/** The phone's expanded ask row: takes over the app bar so there is room to type; Escape closes. */\nexport function AskRow({\n children,\n onClose,\n labels,\n 'data-testid': testId,\n collapseTestId,\n}: AskRowProps) {\n return (\n <div\n className=\"flex h-14 flex-shrink-0 items-center gap-1 bg-background px-3 pt-safe\"\n data-slot=\"ask-row\"\n data-testid={testIdOr(testId, { testId: 'workspace-ask-bar-expanded' })}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && !e.defaultPrevented) onClose()\n }}\n >\n <div className=\"min-w-0 flex-1\">{children}</div>\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={labels?.closeSearch ?? DEFAULT_ASK_FIELD_LABELS.closeSearch}\n data-testid={testIdOr(collapseTestId, { testId: 'workspace-ask-bar-collapse' })}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n )\n}\n","import { useRef, type ReactNode } from 'react'\nimport { Menu } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useShellBottomInset } from '../lib/bottom-inset'\nimport type { NavItem } from './types'\n\n/** Fixed strings of the phone bars. */\nexport interface MobileBarsLabels {\n /** The menu button (the `menuLabel` prop wins). */\n openNavigationMenu: string\n /** The tab bar's accessible name (the `label` prop wins). */\n workspaceSections: string\n}\n\nexport const DEFAULT_MOBILE_BARS_LABELS: MobileBarsLabels = {\n openNavigationMenu: 'Open navigation menu',\n workspaceSections: 'Workspace sections',\n}\n\nexport interface MobileAppBarProps {\n /** Show the menu button that opens the drawer (nothing to open on a list page with no sidebar). */\n showMenu?: boolean\n onMenu?: () => void\n /** Replaces the brand mark (e.g. the workspace switcher). */\n title?: ReactNode\n /** Brand mark shown when there is no `title`. */\n logo?: ReactNode\n /** Right-aligned controls that fit (ask, offline pill, bell, account). */\n actions?: ReactNode\n menuLabel?: string\n labels?: Partial<Pick<MobileBarsLabels, 'openNavigationMenu'>>\n className?: string\n 'data-testid'?: string\n /** Menu button id (default `mobile-nav-toggle`). */\n menuTestId?: string\n}\n\n/**\n * The slim phone app bar (56px): menu button, a title slot and an actions slot. The app mounts\n * it only on small screens; the controls that do not fit live in the drawer.\n */\nexport function MobileAppBar({\n showMenu = true,\n onMenu,\n title,\n logo,\n actions,\n menuLabel,\n labels,\n className,\n 'data-testid': testId,\n menuTestId,\n}: MobileAppBarProps) {\n return (\n <div\n data-slot=\"mobile-app-bar\"\n data-testid={testId}\n className={cn(\n 'sm:hidden flex h-14 flex-shrink-0 items-center gap-1 bg-background pl-1 pr-2 pt-safe',\n className\n )}\n >\n {showMenu && (\n <button\n type=\"button\"\n onClick={onMenu}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted\"\n aria-label={\n menuLabel ?? labels?.openNavigationMenu ?? DEFAULT_MOBILE_BARS_LABELS.openNavigationMenu\n }\n data-testid={testIdOr(menuTestId, { testId: 'mobile-nav-toggle' })}\n >\n <Menu className=\"size-5\" />\n </button>\n )}\n <div className={cn('flex min-w-0 flex-1 items-center', !showMenu && 'pl-3')}>\n {title ?? logo}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-0.5\">{actions}</div>}\n </div>\n )\n}\n\n/**\n * A tab's label. It wraps at word boundaries and is never clipped or cut with an ellipsis; a tab\n * narrower than 4.5rem sets it one size smaller so a long single word still fits, and an item with\n * a `shortLabel` shows that one while its tab is narrower than 5.5rem.\n */\nfunction TabLabel({ item }: { item: NavItem }) {\n const wrap =\n 'max-w-full text-balance px-0.5 text-center [overflow-wrap:normal] @max-[4.5rem]:text-[10px]'\n if (!item.shortLabel) return <span className={wrap}>{item.label}</span>\n return (\n <>\n <span data-slot=\"tab-short-label\" aria-hidden=\"true\" className={cn(wrap, '@[5.5rem]:hidden')}>\n {item.shortLabel}\n </span>\n <span className={cn(wrap, 'hidden @[5.5rem]:block')}>{item.label}</span>\n <span className=\"sr-only @[5.5rem]:hidden\">{item.label}</span>\n </>\n )\n}\n\nexport interface MobileTabBarProps {\n /** The workspace's main areas; test ids are `{testIdPrefix}-{id}` (prefix default `mobile-tab`). */\n items: NavItem[]\n label?: string\n labels?: Partial<Pick<MobileBarsLabels, 'workspaceSections'>>\n testIdPrefix?: string\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * Phone bottom navigation: a 64px tinted bar of the main areas. The drawer carries the same\n * destinations with counts, so nothing is reachable only here. The app mounts it on small\n * screens only.\n */\nexport function MobileTabBar({\n items,\n label,\n labels,\n testIdPrefix,\n className,\n 'data-testid': testId,\n}: MobileTabBarProps) {\n const navRef = useRef<HTMLElement>(null)\n // Floating elements (install prompt, toasts) read the bar's height from `--shell-bottom-inset`.\n useShellBottomInset(navRef)\n return (\n <nav\n ref={navRef}\n aria-label={\n label ?? labels?.workspaceSections ?? DEFAULT_MOBILE_BARS_LABELS.workspaceSections\n }\n data-slot=\"mobile-tab-bar\"\n data-testid={testIdOr(testId, { testId: 'mobile-tab-bar' })}\n className={cn(\n 'flex min-h-16 flex-shrink-0 items-stretch bg-sidebar px-2 pb-safe sm:hidden',\n className\n )}\n >\n {items.map((item) => (\n <ActionLink\n key={item.id}\n href={item.href}\n onSelect={item.onSelect}\n disabled={item.disabled}\n aria-current={item.active ? 'page' : undefined}\n className={cn(\n // Each tab is a size container: a `shortLabel` replaces the label when it is narrow.\n '@container flex min-h-12 min-w-0 flex-1 flex-col items-center justify-center gap-0.5 rounded-md text-[11px] leading-tight transition-colors',\n item.active\n ? 'font-semibold text-primary'\n : 'font-medium text-muted-foreground hover:text-foreground'\n )}\n data-testid={prefixedTestId(testIdPrefix, item.id, { testId: `mobile-tab-${item.id}` })}\n >\n {item.icon}\n <TabLabel item={item} />\n </ActionLink>\n ))}\n </nav>\n )\n}\n","import { useCallback, useEffect, useState } from 'react'\nimport { getInstallInstructions, isIosDevice, type InstallGuide } from './install-instructions'\n\n/** Non-standard Chromium event, not in lib.dom types. */\ninterface BeforeInstallPromptEvent extends Event {\n readonly platforms: string[]\n readonly userChoice: Promise<{ outcome: 'accepted' | 'dismissed'; platform: string }>\n prompt(): Promise<void>\n}\n\nlet deferredPrompt: BeforeInstallPromptEvent | null = null\nlet installed = false\nlet initialized = false\nlet autoPromptParam: string | null = null\n\nconst subscribers = new Set<() => void>()\nconst notify = () => subscribers.forEach((fn) => fn())\n\nfunction isStandalone(): boolean {\n if (typeof window === 'undefined') return false\n const iosStandalone = (navigator as Navigator & { standalone?: boolean }).standalone === true\n return window.matchMedia?.('(display-mode: standalone)').matches === true || iosStandalone\n}\n\nfunction wantsAutoPrompt(): boolean {\n if (!autoPromptParam) return false\n return new URLSearchParams(window.location.search).get(autoPromptParam) === 'true'\n}\n\nfunction onBeforeInstallPrompt(event: Event): void {\n event.preventDefault()\n deferredPrompt = event as BeforeInstallPromptEvent\n notify()\n if (wantsAutoPrompt()) void promptAppInstall()\n}\n\nfunction onAppInstalled(): void {\n installed = true\n deferredPrompt = null\n notify()\n}\n\n/**\n * Begin capturing install events. Idempotent. Chromium fires `beforeinstallprompt` once, early,\n * usually before a lazy route has mounted, so call this at app startup (before the first render);\n * `useInstallPrompt` also calls it, which is enough when the hook mounts at the root.\n *\n * `options.autoPromptParam`: a share link `/?{param}=true` opens the native dialog as soon as the\n * browser is ready (Chromium).\n */\nexport function initInstallPrompt(options: { autoPromptParam?: string } = {}): void {\n if (options.autoPromptParam) autoPromptParam = options.autoPromptParam\n if (initialized || typeof window === 'undefined') return\n initialized = true\n installed = isStandalone()\n\n window.addEventListener('beforeinstallprompt', onBeforeInstallPrompt)\n window.addEventListener('appinstalled', onAppInstalled)\n}\n\n/**\n * Open the browser's install dialog if one was captured. Returns false when there is none (the\n * caller then shows {@link getInstallInstructions}). A captured prompt works once.\n */\nexport async function promptAppInstall(): Promise<boolean> {\n if (!deferredPrompt) return false\n const prompt = deferredPrompt\n deferredPrompt = null\n notify()\n try {\n await prompt.prompt()\n } catch {\n // The user dismissed it or the browser rejected it: nothing actionable.\n }\n return true\n}\n\n/** Default storage key of the remembered dismissal. */\nexport const INSTALL_PROMPT_DISMISSED_KEY = 'arbi-blocks:install-prompt-dismissed'\nconst DAY_MS = 24 * 60 * 60 * 1000\n\nfunction readDismissedAt(key: string): number | null {\n try {\n const raw = window.localStorage.getItem(key)\n const at = raw ? Number(raw) : NaN\n return Number.isFinite(at) ? at : null\n } catch {\n return null\n }\n}\n\nexport interface UseInstallPromptOptions {\n /** localStorage key remembering a dismissal. */\n storageKey?: string\n /** Days a dismissal is remembered. Default 30. */\n dismissDays?: number\n /** Query param that turns a share link into a one-click install (`install` for `?install=true`). */\n autoPromptParam?: string\n /** App name used in the manual instructions. */\n appName?: string\n}\n\nexport interface UseInstallPromptResult {\n /** A native install dialog can be opened right now (Chromium, once the event fired). */\n canPrompt: boolean\n /** Running as an installed app, or `appinstalled` fired. */\n isInstalled: boolean\n /** iOS has no install API: offer manual instructions instead. */\n isIos: boolean\n /** The user dismissed the offer (remembered across visits). */\n isDismissed: boolean\n /** Open the native dialog; false when none is available. */\n promptInstall: () => Promise<boolean>\n /** Hide the offer and remember it. */\n dismiss: () => void\n /** Manual steps for this browser. */\n instructions: InstallGuide\n}\n\n/** The install state of the app, framework-neutral logic behind `InstallPrompt`. */\nexport function useInstallPrompt({\n storageKey = INSTALL_PROMPT_DISMISSED_KEY,\n dismissDays = 30,\n autoPromptParam: autoParam,\n appName,\n}: UseInstallPromptOptions = {}): UseInstallPromptResult {\n const [, forceRender] = useState(0)\n const [dismissedAt, setDismissedAt] = useState<number | null>(() =>\n typeof window === 'undefined' ? null : readDismissedAt(storageKey)\n )\n\n useEffect(() => {\n initInstallPrompt({ autoPromptParam: autoParam })\n const onChange = () => forceRender((n) => n + 1)\n subscribers.add(onChange)\n // The singleton may have started before this mount: pick up the current state.\n onChange()\n return () => {\n subscribers.delete(onChange)\n }\n }, [autoParam])\n\n const dismiss = useCallback(() => {\n const now = Date.now()\n setDismissedAt(now)\n try {\n window.localStorage.setItem(storageKey, String(now))\n } catch {\n // Storage blocked: the dismissal lasts for this page view only.\n }\n }, [storageKey])\n\n const isDismissed = dismissedAt !== null && Date.now() - dismissedAt < dismissDays * DAY_MS\n const isInstalled = installed || isStandalone()\n return {\n canPrompt: !isInstalled && deferredPrompt !== null,\n isInstalled,\n isIos: isIosDevice(),\n isDismissed,\n promptInstall: promptAppInstall,\n dismiss,\n instructions: getInstallInstructions({ appName }),\n }\n}\n\n/** Test seam: forget captured state (the singleton lives for the page). */\nexport function resetInstallPromptForTests(): void {\n if (typeof window !== 'undefined') {\n window.removeEventListener('beforeinstallprompt', onBeforeInstallPrompt)\n window.removeEventListener('appinstalled', onAppInstalled)\n }\n deferredPrompt = null\n installed = false\n initialized = false\n autoPromptParam = null\n subscribers.clear()\n}\n","import { useState } from 'react'\nimport { Download, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { useInstallPrompt, type UseInstallPromptOptions } from './use-install-prompt'\n\n/** Fixed strings of the install prompt. */\nexport interface InstallPromptLabels {\n /** The pill's text. */\n install: string\n /** The dismiss button's accessible name. */\n dismiss: string\n /** Accessible name of the pill (`{app}` is replaced by `appName`). */\n installAs: string\n}\n\nexport const DEFAULT_INSTALL_PROMPT_LABELS: InstallPromptLabels = {\n install: 'Install app',\n dismiss: 'Dismiss install prompt',\n installAs: 'Install {app} as an app',\n}\n\nexport interface InstallPromptProps extends UseInstallPromptOptions {\n /** Which bottom corner the pill sits in. Default `start` (clear of a bottom-right toaster). */\n placement?: 'start' | 'end'\n labels?: Partial<InstallPromptLabels>\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * A small floating \"Install app\" pill. Renders only while the app can be installed (the browser\n * fired `beforeinstallprompt`, or on iOS where it shows the Add to Home Screen steps), is not\n * already installed, and was not dismissed (the dismissal is remembered for `dismissDays`).\n *\n * It sits above whatever is pinned to the bottom of the screen: it reads `--shell-bottom-inset`\n * (set by `MobileTabBar` and the chat composer, see `useShellBottomInset`) plus the device\n * safe area, so it never covers the tab bar or the composer. In the start corner it also clears a\n * docked `Sidebar` (`--shell-start-inset`). Both controls are 44px tall on a phone.\n */\nexport function InstallPrompt({\n placement = 'start',\n labels,\n className,\n 'data-testid': testId,\n ...options\n}: InstallPromptProps) {\n const l = { ...DEFAULT_INSTALL_PROMPT_LABELS, ...labels }\n const install = useInstallPrompt(options)\n const [showSteps, setShowSteps] = useState(false)\n\n const isOffer = install.canPrompt || install.isIos\n if (install.isInstalled || install.isDismissed || !isOffer) return null\n\n const appName = options.appName ?? 'this app'\n const onInstall = async () => {\n if (install.canPrompt) await install.promptInstall()\n else setShowSteps((open) => !open)\n }\n\n return (\n <div\n data-slot=\"install-prompt\"\n data-testid={testIdOr(testId, { testId: 'install-app-prompt' })}\n className={cn(\n 'fixed z-30 flex max-w-[calc(100vw-1.5rem)] flex-col gap-2',\n // Above the bottom bars (tab bar / composer) and the home indicator on a phone, a plain\n // corner offset from `sm` up where the tab bar is gone.\n 'bottom-[calc(max(var(--shell-bottom-inset,0px),env(safe-area-inset-bottom,0px))+0.75rem)] sm:bottom-[calc(env(safe-area-inset-bottom,0px)+0.75rem)]',\n // From `sm` up, clear of a docked sidebar (its footer holds the account menu).\n placement === 'start'\n ? 'left-3 items-start sm:left-[calc(var(--shell-start-inset,0px)+0.75rem)]'\n : 'right-3 items-end',\n className\n )}\n >\n {showSteps && (\n <div\n data-slot=\"install-prompt-steps\"\n className=\"w-72 max-w-full rounded-lg border border-border bg-card p-3 text-sm text-card-foreground shadow-lg\"\n >\n <p className=\"font-medium\">{install.instructions.heading}</p>\n <ol className=\"mt-2 list-decimal space-y-1 pl-5 text-muted-foreground\">\n {install.instructions.steps.map((step) => (\n <li key={step}>{step}</li>\n ))}\n </ol>\n </div>\n )}\n <div className=\"inline-flex items-center rounded-full border border-border bg-card/95 text-foreground shadow-sm backdrop-blur\">\n <button\n type=\"button\"\n onClick={() => void onInstall()}\n aria-label={l.installAs.replace('{app}', appName)}\n aria-expanded={install.canPrompt ? undefined : showSteps}\n data-slot=\"install-prompt-action\"\n className=\"inline-flex min-h-11 items-center gap-1.5 rounded-full pl-4 pr-2 text-xs font-medium transition-colors hover:bg-accent sm:min-h-9 sm:pl-3\"\n >\n <Download className=\"size-3.5\" aria-hidden=\"true\" />\n {l.install}\n </button>\n <button\n type=\"button\"\n onClick={install.dismiss}\n aria-label={l.dismiss}\n data-slot=\"install-prompt-dismiss\"\n className=\"inline-flex size-11 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground sm:size-9\"\n >\n <X className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES } from './status-row-styles'\n\nexport type StatusRowTone = 'progress' | 'success' | 'error'\n\nexport interface StatusRowProps {\n tone: StatusRowTone\n /** e.g. \"Processing 3 files…\". Always the accessible name; hidden visually when `compact`. */\n label: string\n /** Opens the thing the status is about (the processing panel). */\n onClick: () => void\n /** Icon-only (the collapsed rail). */\n compact?: boolean\n /** Replaces the tone's default glyph. */\n icon?: ReactNode\n 'data-testid'?: string\n}\n\n/**\n * A live status line for the sidebar footer: a spinner and a short sentence that opens the\n * thing it reports on. The host renders it ONLY while the state is relevant (work running,\n * something failed), so a quiet app shows nothing. Announced politely to screen readers.\n */\nexport function StatusRow({\n tone,\n label,\n onClick,\n compact = false,\n icon,\n 'data-testid': testId,\n}: StatusRowProps) {\n const { className, Icon, spin } = STATUS_ROW_TONES[tone]\n return (\n <div role=\"status\" data-slot=\"status-row\" className={cn(compact && 'flex justify-center')}>\n <button\n type=\"button\"\n onClick={onClick}\n aria-label={label}\n title={label}\n data-testid={testId}\n data-tone={tone}\n className={cn(\n STATUS_ROW_BASE_CLASS,\n compact ? 'size-9 justify-center pointer-coarse:size-11' : 'w-full px-2.5 py-1.5',\n className\n )}\n >\n {icon ?? (\n <Icon\n className={cn('size-4 shrink-0', spin && 'animate-spin motion-reduce:animate-none')}\n />\n )}\n {!compact && <span className=\"min-w-0 flex-1 truncate text-left\">{label}</span>}\n </button>\n </div>\n )\n}\n\n/** Short live state at a navigation row's right edge, replacing inventory counts. */\nexport function StatusBadge({\n tone,\n label,\n onClick,\n onDismiss,\n 'data-testid': testId,\n}: {\n tone: StatusRowTone\n label: string\n onClick?: () => void\n onDismiss?: () => void\n 'data-testid'?: string\n}) {\n const className = cn(\n 'rounded-md px-1.5 py-0.5 text-xs font-medium whitespace-nowrap',\n STATUS_ROW_TONES[tone].className\n )\n return (\n <span\n role=\"status\"\n className={cn(\n 'ml-auto inline-flex items-center rounded-md',\n STATUS_ROW_TONES[tone].className\n )}\n data-testid={testId}\n data-tone={tone}\n >\n {onClick ? (\n <button\n type=\"button\"\n title={label}\n className={className}\n onClick={(event) => {\n event.stopPropagation()\n onClick()\n }}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {label}\n </button>\n ) : (\n <span className={className}>{label}</span>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n aria-label={`Dismiss ${label}`}\n title=\"Dismiss\"\n className=\"mr-1 rounded-sm p-0.5 opacity-60 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring\"\n onClick={(event) => {\n event.stopPropagation()\n onDismiss()\n }}\n onKeyDown={(event) => event.stopPropagation()}\n >\n <X className=\"size-3\" />\n </button>\n )}\n </span>\n )\n}\n","import { RefreshCw, TriangleAlert, WifiOff } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { SidebarRowHoverContext } from './Sidebar'\nimport { SidebarRowAction } from './SidebarRowAction'\n\nexport type OfflinePillTone = 'offline' | 'failed' | 'syncing'\n\n/** Fixed strings of the offline pill. */\nexport interface OfflinePillLabels {\n reconnect: string\n}\n\nexport const DEFAULT_OFFLINE_PILL_LABELS: OfflinePillLabels = {\n reconnect: 'Reconnect',\n}\n\nexport interface OfflinePillProps {\n tone: OfflinePillTone\n /** e.g. \"Offline · 3 pending\", \"2 failed to sync\", \"Syncing 4…\". */\n label: string\n /** Icon-only (the collapsed rail / app bar). */\n compact?: boolean\n /** Opens the pending-changes list. */\n onOpen: () => void\n /** Offered beside the pill (only when not compact); pass it only while it can do something. */\n onReconnect?: () => void\n labels?: Partial<OfflinePillLabels>\n /** Pill button id (default `offline-sync-status`). */\n 'data-testid'?: string\n /** Reconnect button id (default `offline-reconnect-button`). */\n reconnectTestId?: string\n}\n\nconst TONES: Record<OfflinePillTone, { className: string; Icon: typeof WifiOff }> = {\n offline: { className: 'bg-yellow-bg text-yellow-text', Icon: WifiOff },\n failed: { className: 'bg-red-bg text-red-text', Icon: TriangleAlert },\n syncing: { className: 'bg-blue-bg text-blue-text', Icon: RefreshCw },\n}\n\n/**\n * Connection + sync indicator: a status pill that opens the pending-changes list, plus an\n * optional Reconnect button beside it. The app renders it only when there is something to say\n * (offline, or changes waiting/failing), so online-and-synced stays clean.\n */\nexport function OfflinePill({\n tone,\n label,\n compact = false,\n onOpen,\n onReconnect,\n labels,\n 'data-testid': testId,\n reconnectTestId,\n}: OfflinePillProps) {\n const { className, Icon } = TONES[tone]\n return (\n <div\n className={cn('flex items-center gap-1', compact && 'justify-center')}\n data-slot=\"offline-pill\"\n >\n <button\n type=\"button\"\n data-testid={testIdOr(testId, { testId: 'offline-sync-status' })}\n aria-label={label}\n title={label}\n onClick={onOpen}\n className={cn(\n 'flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors hover:brightness-95 pointer-coarse:min-h-11',\n compact && 'flex-none justify-center',\n className\n )}\n >\n <Icon className={cn('size-4 shrink-0', tone === 'syncing' && 'animate-spin')} />\n {!compact && <span className=\"truncate\">{label}</span>}\n </button>\n {!compact && onReconnect && (\n // Forced visible (context true): there is no row to hover.\n <SidebarRowHoverContext.Provider value={true}>\n <SidebarRowAction\n label={labels?.reconnect ?? DEFAULT_OFFLINE_PILL_LABELS.reconnect}\n onClick={onReconnect}\n data-testid={testIdOr(reconnectTestId, { testId: 'offline-reconnect-button' })}\n >\n <RefreshCw className=\"size-5\" />\n </SidebarRowAction>\n </SidebarRowHoverContext.Provider>\n )}\n </div>\n )\n}\n","import { MousePointerClick, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the remote-control pill. */\nexport interface RemoteControlPillLabels {\n /** The disable button (the `disableLabel` prop wins). */\n turnOffRemoteControl: string\n}\n\nexport const DEFAULT_REMOTE_CONTROL_PILL_LABELS: RemoteControlPillLabels = {\n turnOffRemoteControl: 'Turn off remote control',\n}\n\nexport interface RemoteControlPillProps {\n /** A run is actively driving the screen (tinted + pulsing). */\n isActive: boolean\n label: string\n onDisable: () => void\n disableLabel?: string\n labels?: Partial<RemoteControlPillLabels>\n /** Root id (default `remote-control-indicator`). */\n 'data-testid'?: string\n /** Disable button id (default `remote-control-indicator-disable`). */\n disableTestId?: string\n}\n\n/**\n * Persistent, unobtrusive status pill shown while remote control is on or a run is executing,\n * with a one-click disable. The app decides when to mount it.\n */\nexport function RemoteControlPill({\n isActive,\n label,\n onDisable,\n disableLabel: disableLabelProp,\n labels,\n 'data-testid': testId,\n disableTestId,\n}: RemoteControlPillProps) {\n const disableLabel =\n disableLabelProp ??\n labels?.turnOffRemoteControl ??\n DEFAULT_REMOTE_CONTROL_PILL_LABELS.turnOffRemoteControl\n return (\n <div\n data-slot=\"remote-control-pill\"\n data-testid={testIdOr(testId, { testId: 'remote-control-indicator' })}\n className={cn(\n 'flex min-w-0 max-w-full items-center gap-1.5 rounded-full py-1 pl-2.5 pr-1 text-xs font-medium',\n isActive ? 'bg-accent text-accent-foreground' : 'bg-muted text-muted-foreground'\n )}\n >\n <MousePointerClick className={cn('size-3.5 shrink-0', isActive && 'animate-pulse')} />\n <span className=\"min-w-0 max-w-[16rem] truncate\">{label}</span>\n <button\n type=\"button\"\n onClick={onDisable}\n title={disableLabel}\n aria-label={disableLabel}\n data-testid={testIdOr(disableTestId, { testId: 'remote-control-indicator-disable' })}\n className=\"flex size-5 shrink-0 items-center justify-center rounded-full transition-colors hover:bg-foreground/10 hover:text-foreground pointer-coarse:size-8\"\n >\n <X className=\"size-3.5\" />\n </button>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { ChevronLeft, ChevronRight, Lightbulb, Pencil, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the tip card. */\nexport interface TipCardLabels {\n /** Default CTA text (the `ctaLabel` prop wins). */\n showMe: string\n previousTip: string\n nextTip: string\n editTip: string\n /** The card's heading and accessible name. */\n tip: string\n /** The dismiss button: it turns tips off (they come back from the account menu). */\n hideTips: string\n /** \"1 of 3\". */\n position: (index: number, count: number) => string\n}\n\nexport const DEFAULT_TIP_CARD_LABELS: TipCardLabels = {\n showMe: 'Show me',\n previousTip: 'Previous tip',\n nextTip: 'Next tip',\n editTip: 'Edit tip',\n tip: 'Tip',\n hideTips: 'Hide tips',\n position: (index, count) => `${index} of ${count}`,\n}\n\nexport interface TipCardProps {\n /** The tip text: one sentence. */\n message: ReactNode\n /** Which tip is showing (0-based) out of `count`; the pager appears when `count` > 1. */\n index?: number\n count?: number\n onPrev?: () => void\n onNext?: () => void\n /** The single primary action; omit when the tip has none. */\n ctaLabel?: string\n onCta?: () => void\n /** Turns tips off. The card is dismissible so it never becomes permanent furniture. */\n onDismiss?: () => void\n /** Dev-only edit affordance: the host passes it only in development builds. */\n onEdit?: () => void\n /** Hover pauses the host's tip rotation (desktop enhancement). */\n onHoverChange?: (hovered: boolean) => void\n labels?: Partial<TipCardLabels>\n className?: string\n /** Card id (default `tip-row`). */\n testId?: string\n /** Control ids; defaults are the current ids. */\n testIds?: Partial<Record<'prev' | 'next' | 'cta' | 'edit' | 'dismiss', string>>\n}\n\nconst ICON_BUTTON =\n 'flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11'\n\n/**\n * The Smart Tips card: a compact muted tile. Header (bulb, \"Tip\", dismiss), one sentence, then\n * ONE primary action with a quiet \"n of m\" pager. It is shown only while tips are on and a tip\n * applies; the host owns which tip is current, rotation and the on/off preference.\n */\nexport function TipCard({\n message,\n index = 0,\n count = 1,\n onPrev,\n onNext,\n ctaLabel,\n onCta,\n onDismiss,\n onEdit,\n onHoverChange,\n labels,\n className,\n testId,\n testIds,\n}: TipCardProps) {\n const l = { ...DEFAULT_TIP_CARD_LABELS, ...labels }\n const hasMany = count > 1\n\n return (\n <section\n data-slot=\"tip-card\"\n aria-label={l.tip}\n className={cn('min-w-0 rounded-lg bg-muted p-3 text-sm', className)}\n onMouseEnter={() => onHoverChange?.(true)}\n onMouseLeave={() => onHoverChange?.(false)}\n data-testid={testIdOr(testId, { testId: 'tip-row' })}\n >\n <div className=\"-my-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <Lightbulb className=\"size-4 shrink-0 text-primary\" aria-hidden />\n <span>{l.tip}</span>\n <span className=\"-mr-1.5 ml-auto flex items-center\">\n {onEdit && (\n <button\n type=\"button\"\n onClick={onEdit}\n aria-label={l.editTip}\n title={l.editTip}\n className={cn(ICON_BUTTON, 'text-red-text hover:bg-red-bg hover:text-red-text')}\n data-testid={testIdOr(testIds?.edit, { testId: 'tip-edit' })}\n >\n <Pencil className=\"size-3.5\" />\n </button>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label={l.hideTips}\n title={l.hideTips}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.dismiss, { testId: 'tip-dismiss' })}\n >\n <X className=\"size-4\" />\n </button>\n )}\n </span>\n </div>\n <p className=\"mt-2 text-foreground\">{message}</p>\n {(onCta || hasMany) && (\n <div className=\"mt-3 flex items-center justify-between gap-2\">\n {onCta ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={onCta}\n className=\"font-medium text-primary\"\n data-testid={testIdOr(testIds?.cta, { testId: 'page-header-info-cta' })}\n >\n {ctaLabel ?? l.showMe}\n </Button>\n ) : (\n <span />\n )}\n {hasMany && (\n <span className=\"-mr-1.5 flex items-center text-xs text-muted-foreground\">\n <button\n type=\"button\"\n onClick={onPrev}\n aria-label={l.previousTip}\n title={l.previousTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.prev, { testId: 'tip-prev' })}\n >\n <ChevronLeft className=\"size-4\" />\n </button>\n <span className=\"min-w-10 text-center tabular-nums\" aria-live=\"polite\">\n {l.position(index + 1, count)}\n </span>\n <button\n type=\"button\"\n onClick={onNext}\n aria-label={l.nextTip}\n title={l.nextTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.next, { testId: 'tip-next' })}\n >\n <ChevronRight className=\"size-4\" />\n </button>\n </span>\n )}\n </div>\n )}\n </section>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Info, Lightbulb, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\n\nexport type InfoBarVariant = 'info' | 'warning' | 'success' | 'hint'\n\nconst VARIANT_TONE: Record<InfoBarVariant, string> = {\n info: 'bg-blue-bg text-primary border-blue-border',\n warning: 'bg-yellow-bg text-yellow-text border-yellow-border',\n success: 'bg-green-bg text-green-text border-green-border',\n hint: 'bg-blue-bg text-foreground border-blue-border',\n}\n\nexport interface InfoBarProps {\n message: ReactNode\n variant?: InfoBarVariant\n /** Suppress the leading variant icon (e.g. tips render their own \"Tip:\" label). */\n hideIcon?: boolean\n /** Element pinned to the right of the bar (e.g. a reward balance). */\n rightSlot?: ReactNode\n cta?: { label: string; onClick: () => void; icon?: ReactNode }\n onDismiss?: () => void\n dismissLabel?: string\n className?: string\n}\n\n/** Full-width page banner: icon, message, optional right slot, CTA and dismiss. */\nexport function InfoBar({\n message,\n variant = 'info',\n hideIcon,\n rightSlot,\n cta,\n onDismiss,\n dismissLabel = 'Dismiss',\n className,\n}: InfoBarProps) {\n const VariantIcon = variant === 'hint' ? Lightbulb : Info\n return (\n <div\n className={cn('relative z-10 flex w-full items-center pt-1', className)}\n data-slot=\"info-bar\"\n >\n <div\n className={cn(\n 'flex w-full flex-wrap items-center gap-3 rounded-md border px-3 py-[7px]',\n VARIANT_TONE[variant]\n )}\n data-testid=\"page-header-info-box\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-3\">\n {!hideIcon && <VariantIcon className=\"hidden size-4 shrink-0 sm:block\" />}\n <div className=\"min-w-0 flex-1 text-sm\">{message}</div>\n </div>\n <div className=\"flex w-full items-center gap-2 sm:ml-auto sm:w-auto\">\n {rightSlot}\n {cta && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={cta.onClick}\n className=\"h-8 flex-1 shrink-0 sm:flex-initial pointer-coarse:h-11\"\n data-testid=\"page-header-info-cta\"\n >\n {cta.icon && <span className=\"mr-1\">{cta.icon}</span>}\n {cta.label}\n </Button>\n )}\n {onDismiss && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onDismiss}\n aria-label={dismissLabel}\n className=\"size-8 shrink-0 p-0 hover:bg-foreground/5 pointer-coarse:size-11\"\n data-testid=\"page-header-info-dismiss\"\n >\n <X className=\"size-4\" />\n </Button>\n )}\n </div>\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nconst SECONDARY_WIDTH = {\n sm: '@3xl:w-72',\n md: '@3xl:w-80',\n lg: '@3xl:w-96',\n xl: '@3xl:w-[28rem]',\n} as const\n\nexport interface SplitLayoutProps {\n /** The main pane (the detail, the form, the transcript): takes the remaining width. */\n primary: ReactNode\n /** The side pane (the list, the preview, the launcher): fixed width beside, full width below. */\n secondary: ReactNode\n /** Width of the side pane once beside the main one. Default `md` (20rem). */\n secondarySize?: keyof typeof SECONDARY_WIDTH\n /** Which side the secondary pane sits on once side by side. Default `end`. */\n secondaryPosition?: 'start' | 'end'\n /** When stacked, show the secondary pane first. Default false (primary first). */\n secondaryFirstWhenStacked?: boolean\n className?: string\n primaryClassName?: string\n secondaryClassName?: string\n testId?: string\n}\n\n/**\n * Two panes (list and detail, form and preview) that stack by the width of their CONTAINER,\n * not the viewport: side by side from 48rem of container width, stacked below. Inside\n * `Shell.Content` / `PageContainer` (both are containers) an open dock or a narrow window\n * therefore stacks the panes instead of squeezing the main one to a sliver. Every pane has\n * `min-w-0`, so long words and wide tables shrink instead of stretching the grid.\n */\nexport function SplitLayout({\n primary,\n secondary,\n secondarySize = 'md',\n secondaryPosition = 'end',\n secondaryFirstWhenStacked = false,\n className,\n primaryClassName,\n secondaryClassName,\n testId = 'split-layout',\n}: SplitLayoutProps) {\n const secondaryAtStart = secondaryPosition === 'start'\n return (\n <div\n data-slot=\"split-layout\"\n data-testid={testId}\n className={cn('flex flex-col gap-6 @3xl:flex-row @3xl:items-start', className)}\n >\n <div\n data-slot=\"split-primary\"\n className={cn(\n 'min-w-0 @3xl:flex-1',\n secondaryFirstWhenStacked && 'order-2',\n secondaryAtStart ? '@3xl:order-2' : '@3xl:order-1',\n primaryClassName\n )}\n >\n {primary}\n </div>\n <div\n data-slot=\"split-secondary\"\n className={cn(\n 'min-w-0 @3xl:shrink-0',\n SECONDARY_WIDTH[secondarySize],\n secondaryFirstWhenStacked && 'order-1',\n secondaryAtStart ? '@3xl:order-1' : '@3xl:order-2',\n secondaryClassName\n )}\n >\n {secondary}\n </div>\n </div>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/home/HomeLayout.tsx","../src/home/CreateTile.tsx","../src/home/DashboardParts.tsx","../src/home/FactsStrip.tsx","../src/home/RecentList.tsx"],"names":["cn","jsx","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AAA,CAAI,QAAA,EAAS,CAAA,GAAS;AAAA;AAAA,aAAA;AAAA,YAlCjE,GAAA,CAAI;AAAA,WAoCZ,CAAA,EACH;AAAA,SAAA,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-UIUWCTIZ.js","sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { Callout } from '../components/Callout'\n\n/** Column of the home page: greeting header, then the content. */\nexport function HomeFrame({\n testId = 'home-page',\n children,\n}: {\n testId?: string\n children: ReactNode\n}) {\n return (\n <div data-slot=\"home-frame\" data-testid={testId} className=\"flex h-full flex-col\">\n {children}\n </div>\n )\n}\n\n/** Content area under the header; the pages inside own their scrolling. */\nexport function HomeMain({ children }: { children: ReactNode }) {\n return (\n <main\n data-slot=\"home-main\"\n className=\"min-h-0 min-w-sidebar flex-1 overflow-hidden bg-background\"\n >\n {children}\n </main>\n )\n}\n\n/**\n * Scroll container that spans the full width (so its scrollbar rides the window edge) with the\n * content centred in a bounded column.\n */\nexport function HomeCenteredScroll({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"home-scroll\" className=\"h-full overflow-y-auto\">\n <div className=\"mx-auto max-w-6xl\">{children}</div>\n </div>\n )\n}\n\n/** Bounded, centred column for a full-height child (the workspaces table). */\nexport function HomeCenteredColumn({\n className,\n children,\n}: {\n className?: string\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"home-column\"\n className={cn('mx-auto h-full max-w-6xl px-4 pb-4 sm:px-8', className)}\n >\n {children}\n </div>\n )\n}\n\n/** Centred error notice for a page that could not load. */\nexport function HomeLoadError({\n title,\n body,\n testId,\n}: {\n title: string\n body: string\n testId?: string\n}) {\n return (\n <div\n data-slot=\"home-load-error\"\n className=\"flex h-full flex-col items-center justify-center p-8\"\n >\n <div className=\"w-full max-w-md\">\n <Callout variant=\"danger\" title={title} body={body} testId={testId} />\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Plus } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface CreateTileProps {\n /** Visible label, e.g. \"New workspace\". */\n label: string\n /** Accessible name; defaults to `label`. */\n ariaLabel?: string\n onSelect?: () => void\n /** One line explaining what is being created (first-run empty state). */\n help?: ReactNode\n /** When set, the tile is disabled and shows this explanation instead of `help`. */\n disabledReason?: string\n className?: string\n testId?: string\n}\n\n/**\n * The \"create\" tile. Sits in the grid beside the workspace tiles at the same\n * height, in the same tonal family: no dashed outline, no shadow.\n */\nexport function CreateTile({\n label,\n ariaLabel,\n onSelect,\n help,\n disabledReason,\n className,\n testId,\n}: CreateTileProps) {\n const disabled = !!disabledReason\n const select = disabled ? undefined : onSelect\n return (\n <div\n className={cn(\n 'flex min-h-40 w-full flex-col items-center justify-center gap-1 rounded-lg p-4 text-muted-foreground border border-border bg-card shadow-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n disabled\n ? 'cursor-not-allowed opacity-60'\n : 'cursor-pointer hover:border-ring/50 hover:bg-accent/40 hover:text-foreground',\n className\n )}\n onClick={select}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n select?.()\n }\n }}\n role=\"button\"\n tabIndex={0}\n aria-disabled={disabled || undefined}\n title={disabledReason}\n aria-label={ariaLabel ?? label}\n data-slot=\"create-tile\"\n data-testid={testId}\n >\n <span className=\"inline-flex flex-col items-center gap-2 text-sm font-medium\">\n <Plus className=\"size-6\" aria-hidden=\"true\" />\n {label}\n </span>\n {(disabledReason ?? help) && (\n <p className=\"max-w-64 px-4 text-center text-xs leading-snug text-muted-foreground\">\n {disabledReason ?? help}\n </p>\n )}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Button, cn } from '@arbidocs/react/ui'\n\n/** A section's quiet header action: ghost, small, still 44px on touch. */\nexport const DASHBOARD_QUIET_ACTION_CLASS =\n 'h-8 gap-1.5 px-2 text-sm bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground pointer-coarse:h-11'\n\n/** Column of the workspace dashboard's bands. A container, so children can use `@2xl:` queries. */\nexport function DashboardRoot({\n testId,\n className,\n children,\n}: {\n testId?: string\n className?: string\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"dashboard\"\n data-testid={testId}\n className={cn('flex flex-col gap-6', className)}\n >\n {children}\n </div>\n )\n}\n\n/** A dashboard band: `start` is the tiles under the identity bar, `recent` the lists with an eyebrow. */\nexport function DashboardBand({\n kind,\n children,\n}: {\n kind: 'start' | 'recent'\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"dashboard-band\"\n data-kind={kind}\n className={kind === 'start' ? 'mt-2' : 'mt-4 flex flex-col gap-3'}\n >\n {children}\n </div>\n )\n}\n\n/** Two equal columns from the `@2xl` container width, one below it. */\nexport function DashboardColumns({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"dashboard-columns\" className=\"grid gap-8 @2xl:grid-cols-2\">\n {children}\n </div>\n )\n}\n\n/** A fact row's mark: a quiet dot. */\nexport function FactMark() {\n return (\n <span\n data-slot=\"fact-mark\"\n className=\"mx-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/40\"\n aria-hidden\n />\n )\n}\n\nexport interface DashboardActionProps {\n /** `primary` is the page's one filled action; `quiet` the ghost header actions. */\n emphasis: 'primary' | 'quiet'\n icon: ReactNode\n label: string\n onClick: () => void\n testId?: string\n}\n\n/** Header action of a dashboard section (\"New chat\", \"New fact\"). */\nexport function DashboardAction({ emphasis, icon, label, onClick, testId }: DashboardActionProps) {\n return (\n <Button\n variant={emphasis === 'primary' ? 'default' : 'ghost'}\n size=\"sm\"\n className={\n emphasis === 'primary'\n ? 'h-8 gap-1.5 px-3 text-sm pointer-coarse:h-11'\n : DASHBOARD_QUIET_ACTION_CLASS\n }\n onClick={onClick}\n data-testid={testId}\n >\n {icon}\n {label}\n </Button>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { EmptyStrip, SectionHeader } from './sections'\n\nexport interface FactsStripRow {\n id: string\n leading?: ReactNode\n title: string\n /** Right-aligned stamp: a date or a time. */\n time?: string\n onSelect?: () => void\n}\n\nexport interface FactsStripGroup {\n /** Captions the group (\"Upcoming\", \"Created\"); an empty group is not rendered. */\n caption: string\n rows: FactsStripRow[]\n /** Test id of every row in this group. Defaults to `${testId}-row`. */\n rowTestId?: string\n}\n\nexport interface FactsStripEmpty {\n icon: LucideIcon\n label: ReactNode\n description?: ReactNode\n onSelect?: () => void\n testId?: string\n}\n\nexport interface FactsStripProps {\n icon?: LucideIcon\n title: string\n count?: number\n onOpen?: () => void\n action?: ReactNode\n groups: FactsStripGroup[]\n empty?: FactsStripEmpty\n className?: string\n /** Root test id; the title button gets `${testId}-open`. */\n testId?: string\n}\n\n/**\n * A glanceable band of captioned groups (facts: upcoming, recently created).\n * Not a third list page: callers hand it a few rows per group.\n */\nexport function FactsStrip({\n icon,\n title,\n count,\n onOpen,\n action,\n groups,\n empty,\n className,\n testId,\n}: FactsStripProps) {\n const filled = groups.filter((g) => g.rows.length > 0)\n return (\n <section\n className={cn('flex min-w-0 flex-col gap-1', className)}\n data-slot=\"facts-strip\"\n data-testid={testId}\n >\n <SectionHeader\n icon={icon}\n title={title}\n count={count}\n onOpen={onOpen}\n openTestId={testId && `${testId}-open`}\n action={action}\n />\n {filled.length === 0\n ? empty && (\n <EmptyStrip\n icon={empty.icon}\n label={empty.label}\n description={empty.description}\n onSelect={empty.onSelect}\n testId={empty.testId}\n />\n )\n : filled.map((group) => (\n <div key={group.caption} className=\"min-w-0\">\n <p className=\"px-3 pb-1 pt-1 text-right text-xs text-muted-foreground\">\n {group.caption}\n </p>\n <ul>\n {group.rows.map((row) => (\n <li key={row.id}>\n <button\n type=\"button\"\n onClick={row.onSelect}\n title={row.title}\n className=\"flex w-full min-w-0 items-center gap-3 rounded-md px-3 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:bg-muted pointer-coarse:min-h-11\"\n data-testid={group.rowTestId ?? (testId && `${testId}-row`)}\n >\n {row.leading}\n <span className=\"min-w-0 flex-1 truncate text-sm text-foreground\">\n {row.title}\n </span>\n {row.time && (\n <span className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {row.time}\n </span>\n )}\n </button>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </section>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { EmptyStrip, SectionHeader } from './sections'\n\n/** One listed item. Source-agnostic: a chat, a file. */\nexport interface RecentRow {\n id: string\n /** Bare entity mark (an icon carries its own identity; no tinted box). */\n leading?: ReactNode\n title: string\n subtitle?: string\n /** Pinned right on the title line, like a message time. Hidden when `trailing` is set. */\n time?: string\n onSelect?: () => void\n /** Real link target; `onSelect` still fires on a plain click (see `ActionLink`). */\n href?: string\n /** A control rendered beside the row, outside its button. */\n trailing?: ReactNode\n}\n\nexport interface RecentListEmpty {\n icon?: LucideIcon\n label: ReactNode\n description?: ReactNode\n /** Makes the empty strip an invitation button. */\n onSelect?: () => void\n}\n\nexport interface RecentListProps {\n icon?: LucideIcon\n title: string\n count?: number\n /** Opens the full list; makes the header title a button. */\n onOpen?: () => void\n /** Real link target of the header title (with `onOpen`, plain clicks call `onOpen`). */\n openHref?: string\n /** The section's one quiet header action. */\n action?: ReactNode\n rows: RecentRow[]\n /** Names the right-hand column (\"Added\", \"Messaged\"). */\n caption?: string\n /** What an empty section says. A plain muted line unless `onSelect` is set. */\n empty?: RecentListEmpty\n className?: string\n /** Root test id; derived ids: `-open`, `-caption`, `-row`, `-empty-action`. */\n testId?: string\n}\n\n/**\n * A titled list of recent items (files, chats): plain rows under a quiet\n * header. An empty list is one tonal strip that invites the first item.\n */\nexport function RecentList({\n icon,\n title,\n count,\n onOpen,\n openHref,\n action,\n rows,\n caption,\n empty,\n className,\n testId,\n}: RecentListProps) {\n return (\n <section\n className={cn('flex min-w-0 flex-col gap-1', className)}\n data-slot=\"recent-list\"\n data-testid={testId}\n >\n <SectionHeader\n icon={icon}\n title={title}\n count={count}\n onOpen={onOpen}\n openHref={openHref}\n openTestId={testId && `${testId}-open`}\n action={action}\n />\n {rows.length === 0 ? (\n empty?.onSelect ? (\n <EmptyStrip\n icon={empty.icon}\n label={empty.label}\n description={empty.description}\n onSelect={empty.onSelect}\n testId={testId && `${testId}-empty-action`}\n />\n ) : (\n <p className=\"px-1 py-3 text-sm text-muted-foreground\">\n {empty?.description ?? empty?.label}\n </p>\n )\n ) : (\n <>\n {caption && (\n <p className=\"sr-only\" data-testid={testId && `${testId}-caption`}>\n {caption}\n </p>\n )}\n <ul>\n {rows.map((row) => (\n <li\n key={row.id}\n className=\"relative flex items-center rounded-md transition-colors [&:hover]:bg-muted has-[:focus-visible]:bg-muted\"\n data-slot=\"recent-row\"\n >\n <ActionLink\n href={row.href}\n onSelect={row.onSelect}\n title={row.title}\n className={cn(\n 'flex min-w-0 flex-1 items-start gap-3 rounded-md px-3 py-2 text-left focus-visible:outline-none',\n row.onSelect && 'cursor-pointer',\n 'pointer-coarse:min-h-11'\n )}\n data-testid={testId && `${testId}-row`}\n >\n {row.leading}\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"min-w-0 flex-1 truncate text-sm font-medium text-foreground\">\n {row.title}\n </span>\n {!row.trailing && row.time && (\n <span className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {row.time}\n </span>\n )}\n </div>\n {row.subtitle && (\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {row.subtitle}\n </p>\n )}\n </div>\n </ActionLink>\n {row.trailing ? <div className=\"shrink-0 pr-3\">{row.trailing}</div> : null}\n </li>\n ))}\n </ul>\n </>\n )}\n </section>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/provider/TooltipScope.tsx","../src/lib/use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b,SAAA,EAAWE,EAAAA;AAAA,QACT,4JAAA;AAAA,QACA,SAAS,kCAAA,GAAqC;AAAA,OAChD;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ","file":"chunk-YQEXBJVO.js","sourcesContent":["import { createContext, useContext, type ReactNode } from 'react'\nimport { TooltipProvider } from '@arbidocs/react/ui'\n\nconst TooltipScopeContext = createContext(false)\n\n/**\n * A TooltipProvider that mounts once: inside another `BlocksTooltipProvider` (e.g. a Sidebar under\n * Shell.Root) it renders its children as-is, so tooltips share one delay group. Blocks that show\n * tooltips use this instead of the kit's provider.\n */\nexport function BlocksTooltipProvider({ children }: { children: ReactNode }) {\n const isNested = useContext(TooltipScopeContext)\n if (isNested) return <>{children}</>\n return (\n <TooltipScopeContext.Provider value>\n <TooltipProvider>{children}</TooltipProvider>\n </TooltipScopeContext.Provider>\n )\n}\n","import { useEffect, useRef, type RefObject } from 'react'\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n\nfunction focusableIn(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (el) => !el.closest('[inert]') && el.getAttribute('aria-hidden') !== 'true'\n )\n}\n\n/**\n * Behaviour of a modal surface (off-canvas drawer, full-screen dock) while it is open: the page\n * behind does not scroll, Escape closes it, focus moves inside and Tab/Shift+Tab cycle within it\n * (portalled popovers opened from inside stay reachable: only the wrap-around is intercepted),\n * and focus returns to the opener on close. Restores the previous body overflow on close/unmount.\n *\n * Pass `containerRef` (the element carrying `role=\"dialog\"`) to get the focus handling; without it\n * only scroll lock and Escape apply.\n */\nexport function useDrawerBehavior(\n isOpen: boolean,\n onClose: () => void,\n containerRef?: RefObject<HTMLElement | null>\n): void {\n // A fresh `onClose` identity per render must not re-run the effect (it would steal focus).\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n })\n\n useEffect(() => {\n if (!isOpen) return\n const previousOverflow = document.body.style.overflow\n const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null\n document.body.style.overflow = 'hidden'\n\n const container = containerRef?.current ?? null\n if (container) {\n const first = focusableIn(container)[0]\n if (first) first.focus()\n else {\n if (!container.hasAttribute('tabindex')) container.setAttribute('tabindex', '-1')\n container.focus()\n }\n }\n\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n onCloseRef.current()\n return\n }\n if (e.key !== 'Tab' || !container) return\n const items = focusableIn(container)\n if (items.length === 0) {\n e.preventDefault()\n return\n }\n const firstItem = items[0]\n const lastItem = items[items.length - 1]\n const active = document.activeElement\n if (!container.contains(active)) {\n e.preventDefault()\n firstItem.focus()\n } else if (e.shiftKey && active === firstItem) {\n e.preventDefault()\n lastItem.focus()\n } else if (!e.shiftKey && active === lastItem) {\n e.preventDefault()\n firstItem.focus()\n }\n }\n window.addEventListener('keydown', onKey)\n return () => {\n document.body.style.overflow = previousOverflow\n window.removeEventListener('keydown', onKey)\n if (opener?.isConnected) opener.focus()\n }\n }, [isOpen, containerRef])\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useRef,\n type MouseEventHandler,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { PanelLeft, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { useDrawerBehavior } from '../lib/use-drawer'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\n\n/** Default id of the element overlay-mode panels portal into (see `Shell.Content`). */\nexport const DEFAULT_OVERLAY_ZONE_ID = 'app-overlay-zone'\n\nconst OverlayZoneContext = createContext(DEFAULT_OVERLAY_ZONE_ID)\n\n/** The id of the enclosing `Shell.Content` overlay zone, for panels that portal into it. */\nexport function useOverlayZoneId(): string {\n return useContext(OverlayZoneContext)\n}\n\nexport interface ShellRootProps {\n /** Full-width strip above everything (e.g. a deletion-pending banner). */\n banner?: ReactNode\n /** Top chrome: a Shell.Topbar on list pages, a MobileAppBar on phones; omit for none. */\n topbar?: ReactNode\n /** The Sidebar.Root (and its drawer backdrop). */\n sidebar?: ReactNode\n /** Phone bottom navigation. */\n tabBar?: ReactNode\n /** Right-hand column beside the content: a `Shell.Dock` (chat, inspector...). */\n aside?: ReactNode\n /** Extra layers inside the body row (connection monitor, …). */\n overlays?: ReactNode\n /** The Shell.Content region. */\n children: ReactNode\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * The application frame: banner, top chrome, then a body row holding the sidebar beside the\n * content, then the phone tab bar. Every region is a slot, so a custom UI composes its own.\n */\nfunction ShellRoot({\n banner,\n topbar,\n sidebar,\n tabBar,\n aside,\n overlays,\n children,\n className,\n 'data-testid': testId,\n}: ShellRootProps) {\n return (\n <BlocksTooltipProvider>\n <div\n data-slot=\"shell\"\n data-testid={testId}\n className={cn('flex h-screen h-dvh flex-col', className)}\n >\n {banner}\n {topbar}\n {/* `relative` anchors the sidebar's slide-out overlays to this row. */}\n <div className=\"relative flex flex-1 overflow-hidden\">\n {sidebar}\n {children}\n {aside}\n {overlays}\n </div>\n {tabBar}\n </div>\n </BlocksTooltipProvider>\n )\n}\n\nexport interface ShellContentProps {\n children: ReactNode\n /** Scrolling element, for scroll restoration. */\n scrollRef?: Ref<HTMLDivElement>\n onClick?: MouseEventHandler<HTMLDivElement>\n /**\n * Overlay-mode panels portal into this id and cover the content column only. Defaults to\n * `DEFAULT_OVERLAY_ZONE_ID`; descendants read it with `useOverlayZoneId()`.\n */\n overlayZoneId?: string\n className?: string\n}\n\n/**\n * The content column beside the sidebar. It is `relative` so overlay-mode panels (portalled into\n * the overlay zone) cover this region only, leaving the sidebar and its actions interactive.\n */\nfunction ShellContent({\n children,\n scrollRef,\n onClick,\n overlayZoneId = DEFAULT_OVERLAY_ZONE_ID,\n className,\n}: ShellContentProps) {\n return (\n <div\n data-slot=\"shell-content\"\n className={cn('flex min-w-0 flex-1 flex-col', className)}\n onClick={onClick}\n >\n <div className=\"relative min-h-0 flex-1\">\n <OverlayZoneContext.Provider value={overlayZoneId}>\n {/* The content column is a CSS container: pages and parts size by its width with\n container variants (`@3xl:`...), so an open dock or a narrow window is honoured,\n which viewport breakpoints cannot do. */}\n <div ref={scrollRef} className=\"@container h-full overflow-auto\">\n {children}\n </div>\n </OverlayZoneContext.Provider>\n <div id={overlayZoneId} data-slot=\"overlay-zone\" />\n </div>\n </div>\n )\n}\n\nexport interface ShellTopbarProps {\n /** Left side: guidance / breadcrumbs, centred in the page column. */\n children?: ReactNode\n /** Right side: the action cluster. */\n actions?: ReactNode\n className?: string\n}\n\n/** A minimal white header for pages with no sidebar (the workspaces list). */\nfunction ShellTopbar({ children, actions, className }: ShellTopbarProps) {\n return (\n // `relative z-30` keeps dropdowns the header opens above the page region (a later sibling).\n <div\n data-slot=\"shell-topbar\"\n className={cn('relative z-30 flex h-14 shrink-0 items-center bg-background px-2', className)}\n >\n <div className=\"mx-auto flex w-full max-w-6xl items-center\">\n <div className=\"hidden min-w-0 flex-1 px-6 sm:block\">{children}</div>\n </div>\n <div className=\"absolute right-4 top-1/2 flex -translate-y-1/2 items-center gap-1\">\n {actions}\n </div>\n </div>\n )\n}\n\nexport interface ShellDockProps {\n isOpen: boolean\n /** Called with `false` by the mobile close button. */\n onOpenChange?: (isOpen: boolean) => void\n /** Desktop width (CSS length or px). Default 24rem. */\n width?: number | string\n /** Phone layout: the dock covers the screen instead of sitting beside the content. */\n isMobile?: boolean\n /** Accessible name of the dock. */\n label: string\n /** Mobile close button label. */\n closeLabel?: string\n children: ReactNode\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * A right-hand dock for a companion surface (chat, inspector). Controlled: the host owns\n * `isOpen`, the width and the mobile breakpoint. Pass it to `Shell.Root` as `aside`.\n */\nfunction ShellDock({\n isOpen,\n onOpenChange,\n width = '24rem',\n isMobile = false,\n label,\n closeLabel = 'Close',\n children,\n className,\n 'data-testid': testId,\n}: ShellDockProps) {\n // The phone dock covers the screen, so it is a modal: Escape closes, focus is trapped and\n // returns to the opener.\n const mobileRef = useRef<HTMLDivElement>(null)\n const closeMobile = useCallback(() => onOpenChange?.(false), [onOpenChange])\n useDrawerBehavior(isOpen && isMobile, closeMobile, mobileRef)\n if (!isOpen) return null\n if (isMobile) {\n return (\n <div\n ref={mobileRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={label}\n data-slot=\"shell-dock\"\n data-state=\"open\"\n data-mobile=\"true\"\n data-testid={testId}\n className={cn('fixed inset-0 z-40 flex flex-col bg-background', className)}\n >\n {onOpenChange && (\n <button\n type=\"button\"\n onClick={() => onOpenChange(false)}\n aria-label={closeLabel}\n className=\"absolute right-2 top-2 z-10 rounded-md p-2 text-muted-foreground hover:bg-muted\"\n >\n <X className=\"size-5\" />\n </button>\n )}\n {children}\n </div>\n )\n }\n return (\n <aside\n aria-label={label}\n data-slot=\"shell-dock\"\n data-state=\"open\"\n data-testid={testId}\n style={{ width }}\n className={cn(\n 'flex shrink-0 flex-col overflow-hidden border-l border-border bg-background',\n className\n )}\n >\n {children}\n </aside>\n )\n}\n\nexport const Shell = {\n Root: ShellRoot,\n Content: ShellContent,\n Topbar: ShellTopbar,\n Dock: ShellDock,\n}\n\nexport interface PageContainerProps {\n children: ReactNode\n /** Full width instead of the centred 72rem column. */\n wide?: boolean\n /** Stand-alone use: at least a screen tall, instead of filling the parent. */\n minScreen?: boolean\n /** Max width of the centred column (any Tailwind `max-w-*` class). Default `max-w-6xl`. */\n maxWidth?: string\n /**\n * Horizontal padding of the inner column (any Tailwind `px-*` classes, responsive variants\n * welcome). Default `px-4 sm:px-6 lg:px-8`; pass `px-0` for a full-bleed page, or the class\n * string of your own gutter. Use this prop, not `innerClassName`, to change the gutter: the\n * classes are concatenated without a merge step, so a second `px-*` would not reliably win.\n */\n padding?: string\n /** Extra classes for the inner column. */\n innerClassName?: string\n className?: string\n}\n\n/** Default gutter of {@link PageContainer}: tight on a phone, roomier from tablet up. */\nexport const DEFAULT_PAGE_CONTAINER_PADDING = 'px-4 sm:px-6 lg:px-8'\n\n/**\n * Page body wrapper: a white canvas with the standard 72rem column (or full width) and a responsive side gutter. Fills its\n * parent by default so sticky headers and h-full pages keep a definite height chain.\n *\n * NOT a CSS container: its content (a long thread) overflows it into the host's scroller, and\n * Chrome before ~v130 gives `container-type` layout containment, which turns that overflow into\n * ink overflow — the scroller sees no scroll height, so no scrollbar and a dead wheel. Container\n * queries resolve against the scroll surface instead (Shell.Content, the app's DockZone).\n */\nexport function PageContainer({\n children,\n wide = false,\n minScreen = false,\n maxWidth = 'max-w-6xl',\n padding = DEFAULT_PAGE_CONTAINER_PADDING,\n innerClassName,\n className,\n}: PageContainerProps) {\n return (\n <div\n data-slot=\"page-container\"\n className={cn(\n 'bg-background pb-safe',\n minScreen ? 'min-h-screen' : 'h-full min-h-0',\n className\n )}\n >\n <div\n className={cn(\n 'flex h-full w-full min-w-0 flex-col pb-safe',\n padding,\n !wide && cn('mx-auto', maxWidth),\n innerClassName\n )}\n >\n {children}\n </div>\n </div>\n )\n}\n\n/** Fixed strings of the sidebar toggle. */\nexport interface SidebarToggleButtonLabels {\n closeSidebar: string\n openSidebar: string\n}\n\nexport const DEFAULT_SIDEBAR_TOGGLE_BUTTON_LABELS: SidebarToggleButtonLabels = {\n closeSidebar: 'Close sidebar',\n openSidebar: 'Open sidebar',\n}\n\nexport interface SidebarToggleButtonProps {\n /** The sidebar is open (pinned). */\n isOpen: boolean\n onToggle: () => void\n labels?: Partial<SidebarToggleButtonLabels>\n 'data-testid'?: string\n}\n\n/** Opens/closes the sidebar from a page header, so the control sits in the same spot everywhere. */\nexport function SidebarToggleButton({\n isOpen,\n onToggle,\n labels,\n 'data-testid': testId = 'tabheader-sidebar-toggle',\n}: SidebarToggleButtonProps) {\n const l = { ...DEFAULT_SIDEBAR_TOGGLE_BUTTON_LABELS, ...labels }\n const label = isOpen ? l.closeSidebar : l.openSidebar\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n className=\"rounded-md p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground pointer-coarse:p-2.5\"\n aria-label={label}\n title={label}\n data-testid={testId}\n >\n <PanelLeft className=\"size-5\" />\n </button>\n )\n}\n","import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface ToolButtonProps {\n onClick: () => void\n /** Accessible name and native tooltip. */\n label: string\n /** The panel/page this opens is showing. */\n active?: boolean\n 'data-testid'?: string\n children: ReactNode\n}\n\n/** An icon button for a topbar or toolbar: 36px (44px coarse), selection tint while active. */\nexport function ToolButton({\n onClick,\n label,\n active = false,\n 'data-testid': testId,\n children,\n}: ToolButtonProps) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={label}\n aria-label={label}\n data-slot=\"tool-button\"\n data-testid={testId}\n className={cn(\n 'relative flex size-9 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-accent hover:text-accent-foreground pointer-coarse:size-11',\n active ? 'bg-accent text-accent-foreground' : 'text-muted-foreground'\n )}\n >\n {children}\n </button>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/use-close-on-escape.ts","../src/lib/sidebar-mode.ts","../src/shell/use-sidebar-controller.ts","../src/shell/reload-policy.ts","../src/shell/ActionCluster.tsx","../src/shell/DockZone.tsx","../src/shell/PanelModeSwitcher.tsx","../src/shell/panel-windows.ts","../src/shell/panel-host.ts","../src/shell/PanelPortal.tsx"],"names":["useRef","useEffect","useState","useControllableState","useIsPhone","useIsNarrow","useIsTouchScreen","useCallback","notify","useId","jsxs","jsx","containerWidth","cn","Button","Tooltip","TooltipTrigger","TooltipContent","useMediaQuery","X","ExternalLink","PanelRight","PictureInPicture2","useHost","createPortal","PortalContainerProvider","DEFAULT_OVERLAY_ZONE_ID"],"mappings":";;;;;;;;;;;;;AAOO,SAAS,gBAAA,CAAiB,UAAmB,OAAA,EAA2B;AAC7E,EAAA,MAAM,UAAA,GAAaA,aAAO,OAAO,CAAA;AACjC,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,UAAA,CAAW,OAAA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A,IAAI,IAAA,KAAS,YAAY,SAAA,EAAW;AAClC,IAAA,OAAOuB,qBAAA;AAAA,sBACLb,cAAAA,CAACc,0BAAA,EAAA,EAAwB,SAAA,EAAW,WAAY,QAAA,EAAS,CAAA;AAAA,MACzD;AAAA,KACF;AAAA,EACF;AAMA,EAAA,IAAI,SAAS,SAAA,EAAW;AACtB,IAAA,MAAM,WAAA,GAAc,QAAA,CAAS,cAAA,CAAeC,yCAAuB,CAAA;AACnE,IAAA,OAAOF,qBAAA;AAAA,sBACLb,cAAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UACA,SAAA;AAAA,UACA,OAAA;AAAA,UACA,YAAA;AAAA,UACA,QAAQ,WAAA,KAAgB,IAAA;AAAA,UAEvB;AAAA;AAAA,OACH;AAAA,MACA,eAAe,QAAA,CAAS;AAAA,KAC1B;AAAA,EACF;AAGA,EAAA,IAAI,SAAS,MAAA,EAAQ;AACnB,IAAA,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,WAAW,CAAA;AACpD,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAOa,qBAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,IACxC;AAAA,EACF;AAGA,EAAA,MAAM,QAAA,GAAW,QAAA,CAAS,cAAA,CAAe,WAAW,CAAA;AACpD,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,OAAOA,qBAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,EACxC;AAGA,EAAA,OAAO,IAAA;AACT","file":"chunk-ZZHMJXM5.cjs","sourcesContent":["import { useEffect, useRef } from 'react'\n\n/**\n * While `isActive`, Escape calls `onClose`. For surfaces that float over the page without being a\n * modal (no backdrop, no focus trap), so nothing else closes them from the keyboard. An Escape a\n * dialog already handled (`defaultPrevented`) is left alone so one press closes one layer.\n */\nexport function useCloseOnEscape(isActive: boolean, onClose: () => void): void {\n const onCloseRef = useRef(onClose)\n useEffect(() => {\n onCloseRef.current = onClose\n })\n\n useEffect(() => {\n if (!isActive) return\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && !e.defaultPrevented) onCloseRef.current()\n }\n document.addEventListener('keydown', onKeyDown)\n return () => document.removeEventListener('keydown', onKeyDown)\n }, [isActive])\n}\n","import { useEffect, useRef, useState } from 'react'\n\n/**\n * Headless sidebar behaviour (no DOM, no store): how the sidebar lays out for a given set of\n * inputs, and the settle timing that keeps labels/tips from squeezing during the width transition.\n *\n * - `drawer` small-screen off-canvas panel (opened by the app bar's menu button)\n * - `collapsed` hidden (width 0): a phone with the drawer closed, or `isCollapsed`\n * - `pinned` full width, inline, pushes the content\n * - `rail` icon strip that floats open to full width while hovered\n */\nexport type SidebarMode = 'drawer' | 'collapsed' | 'pinned' | 'rail'\n\nexport interface SidebarModeInput {\n isSmallScreen: boolean\n /** The phone drawer was requested open. */\n isDrawerRequested: boolean\n isCollapsed: boolean\n isPinned: boolean\n isHovering: boolean\n /**\n * Tablet-width viewport (above the phone drawer breakpoint but too narrow to give the content a\n * usable column next to a 255px panel): pinning is ignored and the sidebar stays an icon rail.\n */\n isNarrow?: boolean\n}\n\nexport interface SidebarLayout {\n mode: SidebarMode\n /** Labels should be shown (the panel is, or is becoming, full width). */\n expanded: boolean\n /** Phones: nothing is rendered until the drawer opens. */\n hidden: boolean\n /** Hover state that actually applies (never on touch-sized screens). */\n hovering: boolean\n}\n\nexport function resolveSidebarLayout(input: SidebarModeInput): SidebarLayout {\n const { isSmallScreen, isDrawerRequested, isCollapsed, isPinned, isHovering } = input\n const canPin = isPinned && !isSmallScreen && !input.isNarrow\n const drawerOpen = isSmallScreen && isDrawerRequested\n // Small screens are drawer-only: when it is closed the panel is fully off-canvas\n // regardless of pinning (pinning is a desktop concept), and hover never expands.\n const effectiveCollapsed = isCollapsed || (isSmallScreen && !drawerOpen)\n const hovering = isHovering && !isSmallScreen\n\n let mode: SidebarMode\n if (drawerOpen) mode = 'drawer'\n else if (effectiveCollapsed) mode = 'collapsed'\n else if (canPin) mode = 'pinned'\n else mode = 'rail'\n\n // `hovering`, not `isHovering`: a stale hover flag must not report a hidden phone sidebar as expanded.\n const expanded = drawerOpen || (!effectiveCollapsed && (canPin || hovering))\n\n return { mode, expanded, hidden: isSmallScreen && !drawerOpen, hovering }\n}\n\n/**\n * Settle timing around the width transition (default 300ms):\n * - `labelsExpanded` switches on immediately but off only after the transition, so labels do not\n * snap to icon-only while the panel is still wide;\n * - `tipsVisible` is the opposite: width-bound content (a tip card) appears only once the panel\n * has fully opened and disappears the instant collapse starts.\n */\nexport function useSidebarSettle(expanded: boolean, settleMs = 300) {\n const [labelsExpanded, setLabelsExpanded] = useState(expanded)\n const [tipsVisible, setTipsVisible] = useState(expanded)\n const labelsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n const tipsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(() => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n if (expanded) setLabelsExpanded(true)\n else labelsTimer.current = setTimeout(() => setLabelsExpanded(false), settleMs)\n return () => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n }\n }, [expanded, settleMs])\n\n useEffect(() => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n if (expanded) tipsTimer.current = setTimeout(() => setTipsVisible(true), settleMs)\n else setTipsVisible(false)\n return () => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n }\n }, [expanded, settleMs])\n\n return { labelsExpanded, tipsVisible }\n}\n","import { useCallback, useEffect, useRef } from 'react'\nimport { useControllableState } from '../lib/useControllableState'\nimport { useCloseOnEscape } from '../lib/use-close-on-escape'\nimport { useIsNarrow, useIsPhone, useIsTouchScreen } from '../lib/use-media-query'\nimport { resolveSidebarLayout, useSidebarSettle, type SidebarLayout } from '../lib/sidebar-mode'\nimport type { SidebarRootProps } from './Sidebar'\n\nexport interface UseSidebarControllerOptions {\n /** Pinned open (desktop). Controlled when set; otherwise kept here, seeded by `defaultPinned`. */\n isPinned?: boolean\n /** Default `true`. */\n defaultPinned?: boolean\n onPinnedChange?: (isPinned: boolean) => void\n /** The rail is floated open (hover, or its toggle at a narrow width). Controlled when set. */\n isHovering?: boolean\n onHoveringChange?: (isHovering: boolean) => void\n /** The phone drawer is open. Controlled when set (the app bar's menu button opens it). */\n isDrawerOpen?: boolean\n onDrawerOpenChange?: (isDrawerOpen: boolean) => void\n /**\n * Keep the sidebar a rail even when pinned, on top of the tablet width (for example while a\n * docked panel squeezes the content). The stored pin is left untouched.\n */\n forceRail?: boolean\n /**\n * Which rails expand on mouseenter. The default ignores narrow and emulated touch hover;\n * `all` retains hover expansion for a host whose narrow rail has no separate expand button.\n */\n hoverExpansion?: 'desktop-pointer' | 'all'\n}\n\n/** The `Sidebar.Root` props the controller resolves. */\nexport type SidebarControllerRootProps = Pick<\n SidebarRootProps,\n | 'mode'\n | 'expanded'\n | 'isHovering'\n | 'onBackdropClick'\n | 'hasRailBackdrop'\n | 'onMouseEnter'\n | 'onMouseLeave'\n>\n\nexport interface SidebarController {\n layout: SidebarLayout\n /** Labels shown (settled: they stay on until the closing transition ends). */\n expanded: boolean\n /** Width-bound content (tips, notices) may show: on once fully open, off as closing starts. */\n tipsVisible: boolean\n /** The phone drawer is showing. */\n isDrawer: boolean\n isSmallScreen: boolean\n /** Tablet width (or `forceRail`): pinning is ignored and the sidebar stays a rail. */\n isNarrow: boolean\n /** The pin as it applies (always off while narrow). */\n isPinned: boolean\n /** Spread onto `Sidebar.Root` (or pass the controller to `ShellSidebar`). */\n rootProps: SidebarControllerRootProps\n openDrawer: () => void\n closeDrawer: () => void\n /** The pin toggle: pins/unpins, or floats the rail open/closed while narrow. */\n togglePin: () => void\n /** Open from the rail (its ask button): pins, or floats the rail open while narrow. */\n expand: () => void\n /** After a nav row is chosen: closes the drawer, and a floated rail the pointer has left. */\n afterNavigate: () => void\n}\n\n// A menu opened from the rail (the account menu) is positioned against the sidebar's current\n// layout. Hovering that menu from the content would expand the rail, re-anchor the menu under\n// the pointer and move the item being clicked, so hover does not expand the rail while one is open.\nconst isMenuOpen = () =>\n typeof document !== 'undefined' &&\n document.querySelector('[role=\"menu\"][data-state=\"open\"]') !== null\n\n/**\n * Sidebar behaviour as one hook, shared by every shell: resolves the layout (drawer / pinned /\n * rail) for the viewport, settles labels and tips around the width transition, and owns the hover,\n * pin and drawer rules:\n * - touch: the rail opens only through its toggle, never by the emulated mouseenter of a tap;\n * - narrow: a pointer drifting over the rail does not float the labels over the content;\n * - Escape closes a floated rail; the drawer closes itself when the viewport grows past a phone;\n * - choosing a row closes the drawer, and a floated rail unless the pointer is still over it.\n *\n * State is controlled per field (`isPinned`, `isHovering`, `isDrawerOpen`) so an app can keep it\n * in its own store, or uncontrolled for a shell that does not care.\n */\nexport function useSidebarController(options: UseSidebarControllerOptions = {}): SidebarController {\n const [storedPinned, setPinned] = useControllableState(\n options.isPinned,\n options.defaultPinned ?? true,\n options.onPinnedChange\n )\n const [isHovering, setHovering] = useControllableState(\n options.isHovering,\n false,\n options.onHoveringChange\n )\n const [isDrawerOpen, setDrawerOpen] = useControllableState(\n options.isDrawerOpen,\n false,\n options.onDrawerOpenChange\n )\n\n const isSmallScreen = useIsPhone()\n const isNarrow = useIsNarrow() || !!options.forceRail\n const isTouch = useIsTouchScreen()\n\n const layout = resolveSidebarLayout({\n isSmallScreen,\n isDrawerRequested: isDrawerOpen,\n isCollapsed: false,\n isPinned: storedPinned,\n isHovering,\n isNarrow,\n })\n const isDrawer = layout.mode === 'drawer'\n const { labelsExpanded, tipsVisible } = useSidebarSettle(layout.expanded)\n\n // Whether the pointer is physically over the sidebar (decides if navigating closes the rail).\n const isPointerOver = useRef(false)\n\n const closeDrawer = useCallback(() => setDrawerOpen(false), [setDrawerOpen])\n const openDrawer = useCallback(() => setDrawerOpen(true), [setDrawerOpen])\n\n // The floated rail has no modal behaviour (the drawer gets Escape from `Sidebar.Root`).\n useCloseOnEscape(layout.mode === 'rail' && layout.hovering, () => setHovering(false))\n\n // A drawer left open when the viewport grows past a phone (rotate/resize) would be a stuck overlay.\n useEffect(() => {\n if (isDrawerOpen && !isSmallScreen) setDrawerOpen(false)\n }, [isDrawerOpen, isSmallScreen, setDrawerOpen])\n\n const onMouseEnter = () => {\n if (isTouch && options.hoverExpansion !== 'all') return\n isPointerOver.current = true\n if (\n !isSmallScreen &&\n (!isNarrow || options.hoverExpansion === 'all') &&\n (!isMenuOpen() || options.hoverExpansion === 'all')\n )\n setHovering(true)\n }\n const onMouseLeave = () => {\n if (isTouch && options.hoverExpansion !== 'all') return\n isPointerOver.current = false\n if (!isSmallScreen) setHovering(false)\n }\n\n return {\n layout,\n expanded: labelsExpanded,\n tipsVisible,\n isDrawer,\n isSmallScreen,\n isNarrow,\n isPinned: storedPinned && !isNarrow,\n rootProps: {\n mode: layout.mode,\n expanded: labelsExpanded,\n isHovering: layout.hovering,\n onBackdropClick: isDrawer ? closeDrawer : () => setHovering(false),\n hasRailBackdrop: isTouch,\n onMouseEnter,\n onMouseLeave,\n },\n openDrawer,\n closeDrawer,\n togglePin: () => (isNarrow ? setHovering(!isHovering) : setPinned(!storedPinned)),\n expand: () => (isNarrow ? setHovering(true) : setPinned(true)),\n afterNavigate: () => {\n if (!isPointerOver.current && !storedPinned) setHovering(false)\n if (isDrawer) closeDrawer()\n },\n }\n}\n","/**\n * One policy for every automatic reload: when the running build is out of date, pick a moment\n * that costs the user nothing.\n *\n * After a deploy (or mid-rollout, while old and new pods both serve) the previous build's hashed\n * chunks can 404. Vite reports that as `vite:preloadError`. Reloading fetches the current\n * index.html (served no-cache) and its chunks, but reloading at once throws away whatever the\n * user is typing, so:\n *\n * - A failed prefetch (`prefetchChunk`) never reloads. Nothing on screen depends on it.\n * - A failed chunk the user is waiting for reloads at once, unless the user is on a sign-in form\n * or has unsaved input (a focused or edited field, or a `[data-reload-guard]` region).\n * - Otherwise the reload waits: the next route navigation becomes a full page load of its target,\n * or the page reloads once the user is idle with nothing unsaved.\n * - Per tab, at most one policy reload a minute. A second failure right after one is not a stale\n * build (a genuinely missing chunk, say), so it surfaces to the error boundary instead of looping.\n */\n\nimport { notify } from '@arbidocs/react/shell'\n\nexport const CHUNK_RELOAD_KEY = 'arbi_chunk_reload_at'\n\n/** A second failure within this window after a reload is not a stale build: let it surface. */\nconst RELOAD_GUARD_MS = 60_000\n/** A deferred reload waits until the user has done nothing for this long. */\nconst IDLE_MS = 10_000\nconst IDLE_CHECK_MS = 2_000\n\n/** Sign-in pages, and regions a host marks as holding unsaved work. */\nconst GUARD_SELECTOR =\n '[data-slot=\"auth-layout\"], input[type=\"password\"], input[autocomplete=\"one-time-code\"], [data-reload-guard]'\nconst NON_TEXT_INPUTS = new Set([\n 'button',\n 'submit',\n 'reset',\n 'checkbox',\n 'radio',\n 'hidden',\n 'range',\n 'color',\n 'file',\n 'image',\n])\n\nexport interface ReloadPolicyDeps {\n /** Reload the current page. */\n reload: () => void\n /** Full page load of `url` (instead of a client-side navigation). */\n load: (url: string, replace: boolean) => void\n now: () => number\n}\n\nconst browserDeps: ReloadPolicyDeps = {\n reload: () => window.location.reload(),\n load: (url, replace) => (replace ? window.location.replace(url) : window.location.assign(url)),\n now: () => Date.now(),\n}\n\nlet deps = browserDeps\nlet installed = false\n/** The build is out of date: the next route navigation loads the page fresh. */\nlet stale = false\n/** A chunk the user needed failed: reload as soon as nothing would be lost. */\nlet reloadWanted = false\nlet lastActivity = 0\nlet idleTimer: ReturnType<typeof setInterval> | undefined\nlet restoreNavigation: (() => void) | null = null\n/** Fields the user typed into. */\nconst edited = new Set<Element>()\n/** Errors from `prefetchChunk` loads, so the preload-error handler can tell them apart. */\nconst prefetchFailures = new WeakSet<object>()\n\nfunction isTextField(el: Element): boolean {\n if (el instanceof HTMLInputElement) return !NON_TEXT_INPUTS.has(el.type)\n return el instanceof HTMLTextAreaElement || (el as HTMLElement).isContentEditable === true\n}\n\nfunction hasText(el: Element): boolean {\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {\n return el.value.trim() !== ''\n }\n return (el.textContent ?? '').trim() !== ''\n}\n\n/**\n * Whether reloading now could cost the user something: a sign-in form, a `[data-reload-guard]`\n * region, a focused text field, or a field they typed into that still holds text.\n */\nexport function hasUnsavedInput(doc: Document = document): boolean {\n if (doc.querySelector(GUARD_SELECTOR)) return true\n const active = doc.activeElement\n if (active && active !== doc.body && isTextField(active)) return true\n for (const el of edited) {\n if (!el.isConnected) edited.delete(el)\n else if (hasText(el)) return true\n }\n return false\n}\n\n/** Take this tab's reload slot. False within the guard window, or when storage can't record it. */\nfunction claimReload(): boolean {\n const now = deps.now()\n let last = 0\n try {\n last = Number(sessionStorage.getItem(CHUNK_RELOAD_KEY)) || 0\n } catch {\n // Unreadable: treat as never reloaded. Writing below decides.\n }\n if (last && now - last < RELOAD_GUARD_MS) return false\n try {\n sessionStorage.setItem(CHUNK_RELOAD_KEY, String(now))\n } catch {\n // Without the guard we can't tell a loop from a stale build: don't risk one.\n return false\n }\n return true\n}\n\nfunction guardHot(): boolean {\n try {\n const last = Number(sessionStorage.getItem(CHUNK_RELOAD_KEY)) || 0\n return !!last && deps.now() - last < RELOAD_GUARD_MS\n } catch {\n return false\n }\n}\n\nfunction settle(): void {\n stale = false\n reloadWanted = false\n if (idleTimer !== undefined) clearInterval(idleTimer)\n idleTimer = undefined\n restoreNavigation?.()\n restoreNavigation = null\n}\n\nfunction reloadNow(): boolean {\n if (!claimReload()) {\n settle()\n return false\n }\n settle()\n deps.reload()\n return true\n}\n\n/** A client-side navigation to `url` becomes a full page load of it while the build is stale. */\nfunction loadsFresh(url: string | URL | null | undefined): string | null {\n if (!stale || url == null) return null\n const target = new URL(String(url), window.location.href)\n if (target.pathname === window.location.pathname) return null\n // Leaving a sign-in page establishes the session: a full load there races its persistence.\n if (document.querySelector(GUARD_SELECTOR)) return null\n return target.href\n}\n\nfunction interceptNavigation(): void {\n if (restoreNavigation) return\n const history = window.history\n const push = history.pushState\n const replace = history.replaceState\n let shownPath = window.location.pathname\n const wrap = (original: History['pushState'], replaceEntry: boolean): History['pushState'] =>\n function (this: History, data, unused, url) {\n const target = loadsFresh(url)\n if (target && claimReload()) {\n settle()\n deps.load(target, replaceEntry)\n return\n }\n original.call(this, data, unused, url)\n shownPath = window.location.pathname\n }\n history.pushState = wrap(push, false)\n history.replaceState = wrap(replace, true)\n // Back/forward already changed the address: reloading loads that target.\n const onPopState = () => {\n if (window.location.pathname === shownPath) return\n shownPath = window.location.pathname\n if (!document.querySelector(GUARD_SELECTOR)) reloadNow()\n }\n window.addEventListener('popstate', onPopState)\n restoreNavigation = () => {\n history.pushState = push\n history.replaceState = replace\n window.removeEventListener('popstate', onPopState)\n }\n}\n\nfunction watchForIdle(): void {\n if (idleTimer !== undefined) return\n idleTimer = setInterval(() => {\n if (!reloadWanted) return\n const idle = document.visibilityState === 'hidden' || deps.now() - lastActivity >= IDLE_MS\n if (idle && !hasUnsavedInput()) reloadNow()\n }, IDLE_CHECK_MS)\n}\n\n/**\n * The running build is out of date (a chunk 404'd, or a new service worker took over): the next\n * route navigation loads its target fresh instead of rendering it client-side.\n */\nexport function markBuildStale(): void {\n stale = true\n interceptNavigation()\n}\n\nexport type ReloadOutcome = 'reloaded' | 'deferred' | 'guarded'\n\n/**\n * Reload onto the current build when nothing would be lost; otherwise defer to the next route\n * navigation or to the moment the user is idle with nothing unsaved. `guarded` means a policy\n * reload just happened in this tab, so the failure should surface instead.\n */\nexport function requestReload(): ReloadOutcome {\n if (guardHot()) return 'guarded'\n if (!hasUnsavedInput()) return reloadNow() ? 'reloaded' : 'guarded'\n reloadWanted = true\n markBuildStale()\n watchForIdle()\n return 'deferred'\n}\n\n/**\n * Load a chunk ahead of need (warming a route the user may open next). Never rejects, and a\n * failure never reloads the page: it only marks the build stale so the next navigation loads\n * fresh.\n */\nexport function prefetchChunk(load: () => Promise<unknown>): Promise<void> {\n let loading: Promise<unknown>\n try {\n loading = load()\n } catch (error) {\n loading = Promise.reject(error)\n }\n return loading.then(\n () => undefined,\n (error: unknown) => {\n if (typeof error === 'object' && error !== null) prefetchFailures.add(error)\n }\n )\n}\n\nfunction decide(payload: unknown): void {\n const prefetch = typeof payload === 'object' && payload !== null && prefetchFailures.has(payload)\n // Offline the chunk simply couldn't be downloaded (it isn't cached yet). Reloading can't fix\n // that and would throw away what's on screen; say what happened instead, and let the failed\n // import reach the nearest error boundary as usual.\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n if (!prefetch) {\n notify.warning(\"This part of ARBI isn't available offline yet\", {\n description: 'Reconnect to open it. Once you have, it will work offline too.',\n })\n }\n return\n }\n markBuildStale()\n if (prefetch) return\n const outcome = requestReload()\n console.warn(`[chunk] A code chunk failed to load (stale build?): ${outcome}`, payload)\n}\n\n/**\n * The `vite:preloadError` handler. Decides once the failed import's own handlers have run, so a\n * `prefetchChunk` failure is known as one. Never cancels the event: the import rejects as usual\n * and, if a reload follows, the page is replaced anyway.\n */\nexport function handleChunkLoadError(event: Event): void {\n const payload = (event as Event & { payload?: unknown }).payload\n setTimeout(() => decide(payload), 0)\n}\n\nfunction onActivity(event: Event): void {\n lastActivity = deps.now()\n if (event.type === 'input' && event.target instanceof Element && isTextField(event.target)) {\n edited.add(event.target)\n }\n}\n\nconst ACTIVITY_EVENTS = ['input', 'keydown', 'pointerdown', 'wheel', 'touchstart'] as const\n\n/** Install the reload policy. Call once at startup; later calls are no-ops. */\nexport function installReloadPolicy(overrides: Partial<ReloadPolicyDeps> = {}): void {\n deps = { ...browserDeps, ...overrides }\n if (installed || typeof window === 'undefined') return\n installed = true\n lastActivity = deps.now()\n window.addEventListener('vite:preloadError', handleChunkLoadError)\n for (const type of ACTIVITY_EVENTS) {\n document.addEventListener(type, onActivity, { capture: true, passive: true })\n }\n}\n\n/** Undo `installReloadPolicy` and forget all state (tests). */\nexport function resetReloadPolicy(): void {\n settle()\n edited.clear()\n if (installed) {\n window.removeEventListener('vite:preloadError', handleChunkLoadError)\n for (const type of ACTIVITY_EVENTS) document.removeEventListener(type, onActivity, true)\n }\n installed = false\n deps = browserDeps\n}\n","import { useId, type MouseEvent, type ReactNode } from 'react'\nimport type { ShellActionLayout } from './types'\n\nexport interface ActionClusterProps {\n /**\n * `bar`: one row for a page header or phone app bar (status, bell, contacts, account).\n * `sidebar`: the bottom of the expanded sidebar: the bell and contacts rows stacked above the\n * account row.\n * `rail`: the same stack on the icon-only rail (same order, icon-only rows).\n * `drawer`: the phone drawer's rows (bell and contacts only; the app bar carries the account).\n */\n layout?: ShellActionLayout\n /** Status pill (remote control); `bar` only. Other layouts show status in their own rows. */\n status?: ReactNode\n /** Report a problem (bug icon), first in the cluster. */\n report?: ReactNode\n /** Notification bell (the kit's NotificationBell, or a `Sidebar.BadgeRow`). */\n mail?: ReactNode\n /** Calendar entry (a `Sidebar.BadgeRow`), right after mail. */\n calendar?: ReactNode\n /** Databases entry (a `Sidebar.BadgeRow`), right after calendar. */\n databases?: ReactNode\n bell?: ReactNode\n /** Contacts / messages entry with its own badge (a `Sidebar.BadgeRow`). */\n contacts?: ReactNode\n /** Account menu (the kit's UserMenu). */\n account?: ReactNode\n /**\n * Names the cluster: the group's accessible name in every layout, and a visible heading above\n * the rows in the `drawer` layout (where phones otherwise get unlabelled rows).\n */\n label?: string\n 'data-testid'?: string\n}\n\n/**\n * The account area: notifications, contacts and the account menu, in one of four placements. In\n * the sidebar and on the rail the two badge rows are stacked above the account row in the same\n * order, so nothing moves when the rail expands; the account menu holds everything else (help,\n * settings, tips, processing).\n */\nexport function ActionCluster({\n layout = 'bar',\n status,\n report,\n mail,\n calendar,\n databases,\n bell,\n contacts,\n account,\n label,\n 'data-testid': testId = 'sidebar-actions',\n}: ActionClusterProps) {\n const labelId = useId()\n // Dashboard's content area resets focus on click, and Radix PORTALS bubble through the React\n // tree: stop clicks here or a dropdown item (e.g. \"View all\") would un-focus the panel it opened.\n const stop = (e: MouseEvent) => e.stopPropagation()\n\n if (layout === 'sidebar' || layout === 'rail' || layout === 'drawer') {\n const rail = layout === 'rail'\n return (\n <div\n className={rail ? 'flex flex-col items-center gap-0.5' : 'flex flex-col gap-0.5'}\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-labelledby={label && layout === 'drawer' ? labelId : undefined}\n aria-label={label && layout !== 'drawer' ? label : undefined}\n data-slot=\"action-cluster\"\n data-layout={layout}\n data-testid={testId}\n >\n {label && layout === 'drawer' && (\n <p\n id={labelId}\n className=\"px-3 pb-1 pt-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground\"\n data-slot=\"action-cluster-label\"\n >\n {label}\n </p>\n )}\n {report}\n {mail}\n {calendar}\n {databases}\n {bell}\n {contacts}\n {account && layout !== 'drawer' && (\n <div className={rail ? 'mt-1' : 'mt-1 min-w-0'}>{account}</div>\n )}\n </div>\n )\n }\n\n return (\n <div\n className=\"flex items-center gap-1\"\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-label={label}\n data-slot=\"action-cluster\"\n >\n {status}\n {report}\n {mail}\n {calendar}\n {databases}\n {bell}\n {contacts}\n {account}\n </div>\n )\n}\n","/**\n * DockZone Component\n *\n * Layout wrapper that provides a resizable right-hand panel area (#dock-zone)\n * where panels in 'docked' mode render via PanelPortal.\n *\n * Uses MutationObserver on the #dock-zone element to detect when content is\n * portaled in/out, so the split layout appears only when a panel is actually\n * mounted — not just when the store says a panel prefers 'docked' mode.\n *\n * The dock zone reads its initial width from the child's data-dock-width\n * attribute (pixels). If absent, defaults to 50% of the container.\n *\n * Below MOBILE_BREAKPOINT_PX, MIN_MAIN_PX + MIN_DOCK_PX (500px combined)\n * can't both fit — the clamp math still ran unconditionally and squeezed the\n * dock pane down to whatever sliver was left (as little as ~90px on a 390px\n * phone), rendering both panes as unusable slivers instead of showing either\n * one properly. Below that width this becomes a single full-width view that\n * swaps between main and docked content instead of splitting — same\n * principle as the Document Viewer's own view-swap (Edit ⇄ Track Changes).\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nconst MIN_DOCK_PX = 200\nconst MIN_MAIN_PX = 300\n// Standard right-panel width — matches the overlay sheet (sm:w-[34rem]) so a\n// panel is the same size whether it's pinned or floating. Pinned stays\n// draggable from here; floating is fixed.\nconst DEFAULT_DOCK_PX = 544\nconst MOBILE_BREAKPOINT_PX = 640\n\ninterface DockZoneProps {\n children: React.ReactNode\n 'data-testid'?: string\n}\n\nexport function DockZone({ children, ...props }: DockZoneProps) {\n const [hasDockedContent, setHasDockedContent] = useState(false)\n const [dockWidth, setDockWidth] = useState<number | null>(null)\n const [isResizing, setIsResizing] = useState(false)\n const [dragPosition, setDragPosition] = useState<number | null>(null)\n const [containerWidth, setContainerWidth] = useState(0)\n const containerRef = useRef<HTMLDivElement>(null)\n const dockZoneRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const el = containerRef.current\n if (!el) return\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width\n if (width !== undefined) setContainerWidth(width)\n })\n observer.observe(el)\n return () => observer.disconnect()\n }, [])\n\n const isMobile = containerWidth > 0 && containerWidth < MOBILE_BREAKPOINT_PX\n\n // Observe dock-zone children to know when content is actually portaled in\n // Also read initial width from the child's data-dock-width attribute\n useEffect(() => {\n const el = dockZoneRef.current\n if (!el) return\n\n const update = () => {\n const hasChildren = el.children.length > 0\n setHasDockedContent(hasChildren)\n if (hasChildren) {\n const requestedWidth = el.firstElementChild?.getAttribute('data-dock-width')\n if (requestedWidth) {\n setDockWidth(parseInt(requestedWidth, 10))\n }\n }\n }\n\n const observer = new MutationObserver(update)\n update()\n observer.observe(el, { childList: true })\n return () => observer.disconnect()\n }, [])\n\n const handleMouseDown = useCallback(() => {\n setIsResizing(true)\n setDragPosition(null)\n }, [])\n\n const handleMouseMove = useCallback(\n (e: MouseEvent) => {\n if (!isResizing || !containerRef.current) return\n const rect = containerRef.current.getBoundingClientRect()\n const x = e.clientX - rect.left\n // Clamp so neither pane gets too small\n const clamped = Math.min(Math.max(x, MIN_MAIN_PX), rect.width - MIN_DOCK_PX)\n setDragPosition(clamped)\n },\n [isResizing]\n )\n\n const handleMouseUp = useCallback(() => {\n if (dragPosition !== null && containerRef.current) {\n const containerWidth = containerRef.current.getBoundingClientRect().width\n setDockWidth(containerWidth - dragPosition)\n }\n setIsResizing(false)\n setDragPosition(null)\n }, [dragPosition])\n\n useEffect(() => {\n if (!isResizing) return\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing, handleMouseMove, handleMouseUp])\n\n // Below the mobile breakpoint there's no room to split at all — MIN_MAIN_PX\n // + MIN_DOCK_PX alone is 500px, wider than most phones. Show whichever\n // side is active at full width instead of squeezing both into slivers.\n const effectiveDockWidth =\n hasDockedContent && containerWidth > 0\n ? isMobile\n ? containerWidth\n : Math.min(\n Math.max(dockWidth ?? DEFAULT_DOCK_PX, MIN_DOCK_PX),\n containerWidth - MIN_MAIN_PX\n )\n : 0\n const mainHidden = isMobile && hasDockedContent\n\n return (\n <div ref={containerRef} className=\"h-full relative flex\" data-testid={props['data-testid']}>\n <div\n style={{\n width: mainHidden ? 0 : `calc(100% - ${effectiveDockWidth}px)`,\n // Reserve gutter space so the vertical scrollbar doesn't appear and\n // disappear as streaming content crosses the viewport boundary —\n // that toggle reflows the layout and reads as a screen-wide flicker.\n scrollbarGutter: 'stable',\n }}\n className={cn(\n // The CSS container for the page's @-variants (PageContainer must not be one; see there).\n '@container h-full overflow-auto',\n hasDockedContent && !isMobile && 'border-r',\n mainHidden && 'overflow-hidden',\n // Animate opening only. On close the portaled content has already\n // unmounted, so animating leaves an empty strip shrinking while the\n // page behind reflows — reads as flicker over heavy content like the\n // documents grid. Snap closed instead. Resizing is also instant so\n // the divider doesn't lag the cursor.\n hasDockedContent && !isResizing && 'transition-[width] duration-300 ease-in-out'\n )}\n aria-hidden={mainHidden}\n inert={mainHidden}\n data-scroll-container\n >\n {children}\n </div>\n\n {/* Wide grab zone with a visible grip, so the divider is findable and forgiving to hit */}\n {hasDockedContent && !isMobile && (\n <div\n className=\"group flex w-2 flex-shrink-0 cursor-col-resize items-center justify-center\"\n onMouseDown={handleMouseDown}\n data-testid=\"dock-resize-handle\"\n >\n <div className=\"h-12 w-1 rounded-full bg-muted-foreground/40 transition-colors group-hover:bg-primary\" />\n </div>\n )}\n\n <div\n ref={dockZoneRef}\n id=\"dock-zone\"\n style={{ width: effectiveDockWidth }}\n className={cn(\n 'h-full overflow-hidden flex-shrink-0',\n hasDockedContent && !isResizing && 'transition-[width] duration-300 ease-in-out'\n )}\n />\n\n {isResizing && dragPosition !== null && (\n <div\n className=\"absolute top-0 bottom-0 w-0.5 bg-primary z-50 pointer-events-none\"\n style={{ left: dragPosition }}\n />\n )}\n {isResizing && <div className=\"absolute inset-0 z-40 cursor-col-resize\" />}\n </div>\n )\n}\n","/**\n * PanelModeSwitcher Component\n *\n * User-selectable placements are: popped out, docked, or overlay. `main` is\n * NOT user-selectable — the system decides which surfaces render full-width\n * (e.g. the DM modal); the user just moves floating panels between popout /\n * docked / overlay. The switcher shows a button for each placement you're not\n * currently in (plus close):\n * - Popout/pop-in toggle (unless disablePopout).\n * - Split-screen button (when not docked).\n * - Float-as-overlay button (when not overlay).\n * - Popout mode shows just the pop-in toggle (the window has its own close).\n */\n\nimport { Button, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { ExternalLink, PanelRight, PictureInPicture2, X } from 'lucide-react'\nimport type { ReactNode } from 'react'\nimport type { ArbiPanelMode as PanelMode } from '@arbidocs/react'\nimport { useIsPhone, useMediaQuery } from '../lib/use-media-query'\n\nconst btnClass = 'h-7 w-7 p-0 text-muted-foreground hover:text-foreground'\n\ninterface SwitcherButtonProps {\n label: string\n /** True when rendered inside a popout window (see note below). */\n inPopout?: boolean\n onClick: () => void\n testId: string\n children: ReactNode\n}\n\n// Icon-only buttons get a visible tooltip with their label, so the icon's meaning\n// is readable on hover and on keyboard focus. Radix tooltips portal into the main\n// window, which would misplace them inside a popout window, so there we fall back\n// to a native title.\nfunction SwitcherButton({\n label,\n inPopout = false,\n onClick,\n testId,\n children,\n}: SwitcherButtonProps) {\n const button = (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={btnClass}\n aria-label={label}\n title={inPopout ? label : undefined}\n onClick={onClick}\n data-testid={testId}\n >\n {children}\n </Button>\n )\n if (inPopout) return button\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n )\n}\n\n// \"Open in new window\" (popout) and \"Float as overlay\" are desktop-only\n// window-management concepts — a tablet has no multi-window/overlay chrome to\n// pop into. 1024px mirrors the common tablet/small-laptop cutoff (Tailwind's\n// `lg`) and matches WorkspaceTopbar's own matchMedia convention for\n// viewport-driven chrome (as opposed to DocumentViewer's container-width\n// ResizeObserver, which fits ITS OWN toolbar buttons reflowing inside a panel\n// that can be split narrow on a wide desktop — PanelModeSwitcher instead needs\n// to know the actual device class, since popping into \"a new window\" or\n// \"floating overlay\" is meaningless on a touch tablet regardless of how the\n// panel happens to be sized in that moment). Deliberately separate from\n// `useIsPhone` (640px, phones only): this only needs to hide these two\n// buttons, not collapse the whole switcher, at tablet widths.\nconst TABLET_AND_BELOW_QUERY = '(max-width: 1024px)'\n\ninterface PanelModeSwitcherProps {\n mode: PanelMode\n onModeChange: (mode: PanelMode) => void\n onClose?: () => void\n /** When true, hides the popout button (e.g. for panels whose content breaks in a popup window) */\n disablePopout?: boolean\n /**\n * Override the close-button data-testid. Defaults to `dialog-close-button`\n * for backwards compatibility. Use a panel-specific value (e.g.\n * `close-viewer-button`) when there are multiple PanelModeSwitchers in the\n * DOM at once and tests need to disambiguate.\n */\n closeTestId?: string\n}\n\nexport function PanelModeSwitcher({\n mode,\n onModeChange,\n onClose,\n disablePopout,\n closeTestId = 'dialog-close-button',\n}: PanelModeSwitcherProps) {\n const isPopout = mode === 'popout'\n const isSmallScreen = useIsPhone()\n const isTabletAndBelow = useMediaQuery(TABLET_AND_BELOW_QUERY)\n\n const closeButton = onClose && (\n <SwitcherButton label=\"Close (Esc)\" onClick={onClose} testId={closeTestId}>\n <X className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )\n\n // Phones: every panel is an overlay and mode-switching is disabled, so only\n // the close ✕ is meaningful.\n if (isSmallScreen) {\n return <div className=\"flex items-center gap-0.5 flex-shrink-0\">{closeButton}</div>\n }\n\n return (\n <div className=\"flex items-center gap-0.5 flex-shrink-0\">\n {/* Popout / pop-in toggle — hidden when disablePopout is set, or on\n tablet-and-below where \"a new window\" isn't a real concept. */}\n {!disablePopout && !isTabletAndBelow && (\n <SwitcherButton\n label={isPopout ? 'Pop back in' : 'Open in new window'}\n inPopout={isPopout}\n onClick={() => onModeChange(isPopout ? 'docked' : 'popout')}\n testId={isPopout ? 'pop-into-main-window-button' : 'open-in-new-window-button'}\n >\n <ExternalLink className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* Split-screen (docked to the side) — shown when not already in it */}\n {!isPopout && mode !== 'docked' && (\n <SwitcherButton\n label=\"Split screen\"\n onClick={() => onModeChange('docked')}\n testId=\"dock-panel-button\"\n >\n <PanelRight className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* Float as an overlay sheet — shown when not already an overlay, and\n not on tablet-and-below (no floating-window chrome to speak of). */}\n {!isPopout && mode !== 'overlay' && !isTabletAndBelow && (\n <SwitcherButton\n label=\"Float as overlay\"\n onClick={() => onModeChange('overlay')}\n testId=\"overlay-panel-button\"\n >\n <PictureInPicture2 className=\"w-3.5 h-3.5\" />\n </SwitcherButton>\n )}\n\n {/* All non-popout modes: ✕ to close */}\n {!isPopout && closeButton}\n </div>\n )\n}\n","/**\n * Window Manager for Pop-out Panels\n *\n * Handles creating, managing, and communicating with popup windows\n */\n\ninterface PopupWindow {\n id: string\n window: Window\n panelId: string\n rootElement: HTMLElement | null\n onClose?: () => void\n}\n\n/** Window lifecycle port; hosts may share or replace the browser implementation. */\nexport interface PanelWindows {\n createPopupWindow(panelId: string, onClose?: () => void, title?: string): string | null\n getWindow(windowId: string): Window | null\n getRootElement(windowId: string): HTMLElement | null\n focusPanelWindow(panelId: string): boolean\n clearOnClose(windowId: string): void\n closeWindow(windowId: string): void\n closeAllWindows(): void\n}\n\nexport class PanelWindowManager implements PanelWindows {\n constructor(private readonly defaultTitle = 'Panel') {}\n private windows = new Map<string, PopupWindow>()\n\n createPopupWindow(panelId: string, onClose?: () => void, title?: string): string | null {\n const windowId = `panel-window-${panelId}`\n\n // Check if window already exists\n if (this.windows.has(windowId)) {\n const existing = this.windows.get(windowId)\n if (existing && !existing.window.closed) {\n existing.window.focus()\n return windowId\n } else {\n // Clean up closed window\n this.windows.delete(windowId)\n }\n }\n\n // Position popup in the right half of the screen\n const currentWidth = window.outerWidth\n const currentHeight = window.outerHeight\n const currentLeft = window.screenX ?? window.screenLeft ?? 0\n const currentTop = window.screenY ?? window.screenTop ?? 0\n\n // Calculate popup position (right half)\n const halfWidth = Math.floor(currentWidth / 2)\n const popupWidth = halfWidth\n const popupHeight = currentHeight\n const left = currentLeft + halfWidth\n const top = currentTop\n\n const popup = window.open(\n '',\n windowId,\n `width=${popupWidth},height=${popupHeight},left=${left},top=${top},scrollbars=yes,resizable=yes,menubar=no,toolbar=no,location=no,status=no`\n )\n\n if (!popup) {\n console.error('Failed to create popup window - popup blocked?')\n return null\n }\n\n // Set up the popup window HTML with proper CSS links\n const mainDocument = document\n const stylesheets = Array.from(\n mainDocument.head.querySelectorAll('link[rel=\"stylesheet\"], style')\n )\n .map((el) => el.outerHTML)\n .join('\\n')\n\n popup.document.write(`\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title></title>\n <!-- about:blank has no base, so copied @font-face / asset URLs (e.g.\n /assets/font.woff2) would resolve against nothing and render as\n tofu squares. Anchor relative URLs to the app origin. -->\n <base href=\"${window.location.origin}/\">\n ${stylesheets}\n <style>\n body {\n margin: 0;\n padding: 0;\n font-family: system-ui, -apple-system, sans-serif;\n }\n #panel-root {\n width: 100%;\n height: 100vh;\n overflow: hidden;\n }\n * {\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n <div id=\"panel-root\"></div>\n </body>\n </html>\n `)\n popup.document.close()\n // A host title is text, even when it contains HTML delimiters.\n popup.document.title = title || this.defaultTitle\n\n // Belt-and-suspenders: re-register the parent's already-loaded web fonts in\n // the popup's FontFaceSet, so glyphs render even if a copied @font-face\n // doesn't re-fetch. Best-effort — engines that reject a cross-document add\n // just fall back to the <base>-anchored @font-face rules above.\n try {\n mainDocument.fonts.forEach((font) => {\n try {\n popup.document.fonts.add(font)\n } catch {\n /* ignore per-font failures */\n }\n })\n } catch {\n /* FontFaceSet unavailable — ignore */\n }\n\n // Get root element after DOM is ready\n const rootElement = popup.document.getElementById('panel-root')\n\n // Store window reference\n const popupWindow: PopupWindow = {\n id: windowId,\n window: popup,\n panelId,\n rootElement,\n onClose,\n }\n this.windows.set(windowId, popupWindow)\n\n // Handle window close — read onClose from the map entry so clearOnClose() works\n const closeCheckInterval = setInterval(() => {\n if (popup.closed) {\n clearInterval(closeCheckInterval)\n const entry = this.windows.get(windowId)\n this.windows.delete(windowId)\n entry?.onClose?.()\n }\n }, 200)\n\n return windowId\n }\n\n getWindow(windowId: string): Window | null {\n const popup = this.windows.get(windowId)\n return popup && !popup.window.closed ? popup.window : null\n }\n\n getRootElement(windowId: string): HTMLElement | null {\n const popup = this.windows.get(windowId)\n return popup && !popup.window.closed ? popup.rootElement : null\n }\n\n /** Focus the popup window for a given panel ID. Returns true if focused. */\n focusPanelWindow(panelId: string): boolean {\n const windowId = `panel-window-panel-${panelId}`\n const popup = this.windows.get(windowId)\n if (popup && !popup.window.closed) {\n popup.window.focus()\n return true\n }\n return false\n }\n\n /** Remove the onClose callback so it won't fire when the window is closed programmatically. */\n clearOnClose(windowId: string): void {\n const popup = this.windows.get(windowId)\n if (popup) {\n popup.onClose = undefined\n }\n }\n\n closeWindow(windowId: string): void {\n const popup = this.windows.get(windowId)\n if (popup && !popup.window.closed) {\n popup.window.close()\n }\n this.windows.delete(windowId)\n }\n\n closeAllWindows(): void {\n for (const [, popup] of this.windows) {\n if (!popup.window.closed) {\n popup.window.close()\n }\n }\n this.windows.clear()\n }\n}\n\n/** A window registry shared by the host's panel controls and portal layer. */\nexport function createPanelWindowManager(options: { defaultTitle?: string } = {}) {\n return new PanelWindowManager(options.defaultTitle)\n}\n","import { useHost } from '../provider/host'\nimport { createPanelWindowManager, type PanelWindows } from './panel-windows'\n\n/** Browser windows and site-specific titles shared by a host's panel controls. */\nexport interface PanelHostSupport {\n windows?: PanelWindows\n popoutTitle?: (title: string) => string\n}\n\nconst defaultWindows = createPanelWindowManager()\nconst titleOnly = (title: string) => title\n\n/** Panel support from the existing ArbiHost; standalone panels share the browser defaults. */\nexport function usePanelHostSupport(): Required<PanelHostSupport> {\n const { panels } = useHost()\n return {\n windows: panels?.windows ?? defaultWindows,\n popoutTitle: panels?.popoutTitle ?? titleOnly,\n }\n}\n","/**\n * PanelPortal Component\n *\n * Thin portal layer that renders children into the right target based on panel mode:\n * - docked: portal to #dock-zone element\n * - overlay: portal to <body> as a slide-out sheet over a backdrop\n * - popout: portal to a separate browser window\n * - main: portal to #main-zone element\n *\n * Manages popup window lifecycle for popout mode.\n * Content-agnostic — just handles where things render.\n */\n\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { DEFAULT_OVERLAY_ZONE_ID } from './Shell'\nimport { usePanelHostSupport } from './panel-host'\nimport { PortalContainerProvider } from '@arbidocs/react/ui'\nimport type { FloatingPanelMode as PanelMode } from '../settings/FloatingPanel'\n\n// Overlay sheet sizing — defaults match the docked width (DEFAULT_DOCK_PX) so a\n// panel is the same size whether pinned or floating, and stays draggable here.\nconst OVERLAY_DEFAULT_PX = 544\nconst OVERLAY_MIN_PX = 360\n\nexport interface PanelPortalProps {\n panelId: string\n mode: PanelMode\n isOpen: boolean\n /** True while the overlay is animating out before unmounting. */\n isExiting?: boolean\n /** Called when popup window is closed externally (user closes the window) */\n onPopupClosed?: () => void\n /** Dismisses the panel — used by the overlay backdrop. */\n onClose?: () => void\n /** Window title for popout mode */\n popoutTitle?: string\n /** Initial overlay width in px (defaults to OVERLAY_DEFAULT_PX). */\n defaultWidth?: number\n children: React.ReactNode\n}\n\n/**\n * Overlay sheet — a slide-out panel over the still-visible page, resizable by\n * dragging its left edge. Slides in on mount and out (via isExiting) before\n * unmounting, mirroring the left sidebar's animation.\n */\nfunction OverlaySheet({\n panelId,\n isExiting,\n onClose,\n defaultWidth,\n scoped,\n children,\n}: {\n panelId: string\n isExiting?: boolean\n onClose?: () => void\n defaultWidth?: number\n /** Rendered inside the layout's overlay zone (below the topbar) rather than\n * over the whole viewport. */\n scoped?: boolean\n children: React.ReactNode\n}) {\n const [width, setWidth] = useState(defaultWidth ?? OVERLAY_DEFAULT_PX)\n const [isResizing, setIsResizing] = useState(false)\n // Live cursor position while dragging. The panel keeps its committed `width`\n // during the drag — only this thin preview line moves — so the heavy panel\n // content never reflows mid-drag (matching DockZone's split-screen handle).\n // The width is committed once on mouse-up.\n const [dragWidth, setDragWidth] = useState<number | null>(null)\n const dragWidthRef = useRef<number | null>(null)\n // Once the slide-in has played we drop the entry class, so later re-renders\n // don't restart the animation.\n const [hasEntered, setHasEntered] = useState(false)\n\n const handleResizeStart = useCallback((e: React.MouseEvent) => {\n e.preventDefault()\n setHasEntered(true)\n setIsResizing(true)\n setDragWidth(null)\n dragWidthRef.current = null\n }, [])\n\n useEffect(() => {\n if (!isResizing) return\n const handleMouseMove = (e: MouseEvent) => {\n // Anchored to the right edge — width grows as the cursor moves left.\n const max = window.innerWidth * 0.92\n const next = Math.min(Math.max(window.innerWidth - e.clientX, OVERLAY_MIN_PX), max)\n dragWidthRef.current = next\n setDragWidth(next)\n }\n const handleMouseUp = () => {\n if (dragWidthRef.current !== null) setWidth(dragWidthRef.current)\n setIsResizing(false)\n setDragWidth(null)\n dragWidthRef.current = null\n }\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing])\n\n return (\n // Scoped: absolute within the layout's overlay zone (below the topbar).\n // Unscoped fallback: fixed over the whole viewport, as before.\n <div\n className={scoped ? 'absolute inset-0 z-40' : 'fixed inset-0 z-50'}\n data-testid={`${panelId}-overlay`}\n >\n {/* In dark mode a 40% black veil crushes the light page text behind the sheet to\n mid-grey, so the veil is lighter there and the page stays readable underneath. */}\n <div\n className={`absolute inset-0 bg-black/40 dark:bg-black/20 duration-200 ${\n // fill-mode-forwards holds the exit end-state — without it the\n // element snaps back fully visible for the frames between the\n // animation finishing and React unmounting it (a flicker).\n isExiting ? 'animate-out fade-out fill-mode-forwards' : 'animate-in fade-in'\n }`}\n onClick={onClose}\n aria-hidden=\"true\"\n data-testid={`${panelId}-overlay-backdrop`}\n />\n <div\n style={{ width }}\n onAnimationEnd={() => !isExiting && setHasEntered(true)}\n className={`absolute right-0 top-0 bottom-0 flex max-w-[92vw] flex-col border-l max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 border-border bg-muted shadow-2xl duration-200 ${\n isExiting\n ? 'animate-out slide-out-to-right fill-mode-forwards'\n : // Suppress the slide transform once entered so it doesn't replay.\n hasEntered\n ? ''\n : 'animate-in slide-in-from-right'\n }`}\n >\n {/* Drag handle on the left edge to resize the sheet. */}\n <div\n className=\"absolute left-0 top-0 bottom-0 z-10 w-1.5 -translate-x-1/2 cursor-col-resize hover:bg-primary/40\"\n onMouseDown={handleResizeStart}\n data-testid={`${panelId}-overlay-resize-handle`}\n />\n {children}\n </div>\n\n {/* Preview line — tracks the cursor during the drag; the panel resizes\n to this position only on release. */}\n {isResizing && dragWidth !== null && (\n <div\n className=\"absolute top-0 bottom-0 z-[60] w-0.5 bg-primary pointer-events-none\"\n style={{ right: dragWidth }}\n />\n )}\n {/* Transparent capture layer so the drag isn't interrupted by elements\n (iframes, the grid) swallowing pointer events. */}\n {isResizing && <div className=\"absolute inset-0 z-[55] cursor-col-resize\" />}\n </div>\n )\n}\n\nexport function PanelPortal({\n panelId,\n mode,\n isOpen,\n isExiting,\n onPopupClosed,\n onClose,\n popoutTitle,\n defaultWidth,\n children,\n}: PanelPortalProps) {\n const { windows: windowManager } = usePanelHostSupport()\n const [popupRoot, setPopupRoot] = useState<HTMLElement | null>(null)\n const popupWindowIdRef = useRef<string | null>(null)\n\n // Open popup window when switching to popout mode\n useEffect(() => {\n if (!isOpen || mode !== 'popout') {\n // Close popup if we're leaving popout mode (intentional mode switch, not user closing)\n if (popupWindowIdRef.current) {\n // Clear the onClose callback before closing so it doesn't trigger onPopupClosed\n windowManager.clearOnClose(popupWindowIdRef.current)\n windowManager.closeWindow(popupWindowIdRef.current)\n popupWindowIdRef.current = null\n setPopupRoot(null)\n }\n return\n }\n\n // Already have a popup open\n if (popupWindowIdRef.current) return\n\n const windowId = windowManager.createPopupWindow(\n `panel-${panelId}`,\n () => {\n popupWindowIdRef.current = null\n setPopupRoot(null)\n onPopupClosed?.()\n },\n popoutTitle || panelId\n )\n\n if (windowId) {\n const rootElement = windowManager.getRootElement(windowId)\n if (rootElement) {\n popupWindowIdRef.current = windowId\n setPopupRoot(rootElement)\n windowManager.getWindow(windowId)?.focus()\n }\n }\n }, [isOpen, mode, panelId, popoutTitle, onPopupClosed, windowManager])\n\n // Clean up on unmount\n useEffect(() => {\n return () => {\n if (popupWindowIdRef.current) {\n windowManager.closeWindow(popupWindowIdRef.current)\n }\n }\n }, [windowManager])\n\n if (!isOpen && !isExiting) return null\n\n // Popout: render into popup window. Its dialogs and menus open there too, not in the window\n // behind it (where the Sign dialog used to open, out of sight).\n if (mode === 'popout' && popupRoot) {\n return createPortal(\n <PortalContainerProvider container={popupRoot}>{children}</PortalContainerProvider>,\n popupRoot\n )\n }\n\n // Overlay: a slide-out sheet over the still-visible page. Rendered into the\n // layout's #app-overlay-zone — the content region BELOW the app topbar — so\n // the bar stays visible and interactive above every overlay. Falls back to\n // <body> (viewport-covering) when no zone is mounted (e.g. embedded shells).\n if (mode === 'overlay') {\n const overlayZone = document.getElementById(DEFAULT_OVERLAY_ZONE_ID)\n return createPortal(\n <OverlaySheet\n panelId={panelId}\n isExiting={isExiting}\n onClose={onClose}\n defaultWidth={defaultWidth}\n scoped={overlayZone !== null}\n >\n {children}\n </OverlaySheet>,\n overlayZone ?? document.body\n )\n }\n\n // Main: render into main content zone\n if (mode === 'main') {\n const mainZone = document.getElementById('main-zone')\n if (mainZone) {\n return createPortal(children, mainZone)\n }\n }\n\n // Docked: render into dock zone\n const dockZone = document.getElementById('dock-zone')\n if (dockZone) {\n return createPortal(children, dockZone)\n }\n\n // No target zone mounted yet — render nothing\n return null\n}\n"]}