@arbidocs/blocks 0.5.65 → 0.5.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/{ConnectedCallDock-GJAGY75U.cjs → ConnectedCallDock-FFIDDYGH.cjs} +6 -6
- package/dist/{ConnectedCallDock-GJAGY75U.cjs.map → ConnectedCallDock-FFIDDYGH.cjs.map} +1 -1
- package/dist/{ConnectedCallDock-DEAEFUUD.js → ConnectedCallDock-VMEBH4LG.js} +6 -6
- package/dist/{ConnectedCallDock-DEAEFUUD.js.map → ConnectedCallDock-VMEBH4LG.js.map} +1 -1
- package/dist/{ConnectedCallRoom-DI7UYRHE.js → ConnectedCallRoom-2FNSX2VG.js} +6 -6
- package/dist/{ConnectedCallRoom-DI7UYRHE.js.map → ConnectedCallRoom-2FNSX2VG.js.map} +1 -1
- package/dist/{ConnectedCallRoom-KLE2PCMQ.cjs → ConnectedCallRoom-HYRLJUIV.cjs} +6 -6
- package/dist/{ConnectedCallRoom-KLE2PCMQ.cjs.map → ConnectedCallRoom-HYRLJUIV.cjs.map} +1 -1
- package/dist/{ConnectedDocumentViewer-YSZWOVGN.cjs → ConnectedDocumentViewer-IQHDCAZ5.cjs} +12 -12
- package/dist/{ConnectedDocumentViewer-YSZWOVGN.cjs.map → ConnectedDocumentViewer-IQHDCAZ5.cjs.map} +1 -1
- package/dist/{ConnectedDocumentViewer-HKIBNGGG.js → ConnectedDocumentViewer-NIZBKBJN.js} +11 -11
- package/dist/{ConnectedDocumentViewer-HKIBNGGG.js.map → ConnectedDocumentViewer-NIZBKBJN.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-PSAP3Q7D.js → ConnectedNativeDocxComparison-FPW3BNBN.js} +6 -6
- package/dist/ConnectedNativeDocxComparison-FPW3BNBN.js.map +1 -0
- package/dist/{ConnectedNativeDocxComparison-L3R3ROPZ.cjs → ConnectedNativeDocxComparison-HJ4FTVH6.cjs} +7 -7
- package/dist/ConnectedNativeDocxComparison-HJ4FTVH6.cjs.map +1 -0
- package/dist/{ConnectedNativeDocxEditor-VDBC4XRT.cjs → ConnectedNativeDocxEditor-PF46MU5H.cjs} +7 -7
- package/dist/ConnectedNativeDocxEditor-PF46MU5H.cjs.map +1 -0
- package/dist/{ConnectedNativeDocxEditor-PI6QTPXZ.js → ConnectedNativeDocxEditor-S7NJMDSU.js} +5 -5
- package/dist/ConnectedNativeDocxEditor-S7NJMDSU.js.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-V4MTKVNE.js → ConnectedStreamedWordArtifact-5MHLV24V.js} +6 -6
- package/dist/ConnectedStreamedWordArtifact-5MHLV24V.js.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-YSW6D7AG.cjs → ConnectedStreamedWordArtifact-LNGW7YGV.cjs} +7 -7
- package/dist/ConnectedStreamedWordArtifact-LNGW7YGV.cjs.map +1 -0
- package/dist/{DocumentReviewCard-TQQADJ36.js → DocumentReviewCard-5U3TGJZA.js} +6 -6
- package/dist/{DocumentReviewCard-TQQADJ36.js.map → DocumentReviewCard-5U3TGJZA.js.map} +1 -1
- package/dist/{DocumentReviewCard-BQ6ZD5MD.cjs → DocumentReviewCard-VFNMJSK7.cjs} +6 -6
- package/dist/{DocumentReviewCard-BQ6ZD5MD.cjs.map → DocumentReviewCard-VFNMJSK7.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-GKMVTECZ.cjs → WorkspaceTableView-DHMCJRC6.cjs} +6 -6
- package/dist/{WorkspaceTableView-GKMVTECZ.cjs.map → WorkspaceTableView-DHMCJRC6.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-YFLVFRJL.js → WorkspaceTableView-EH5CEB44.js} +4 -4
- package/dist/{WorkspaceTableView-YFLVFRJL.js.map → WorkspaceTableView-EH5CEB44.js.map} +1 -1
- package/dist/agents/index.cjs +283 -283
- package/dist/agents/index.js +5 -5
- package/dist/calls/index.cjs +2 -2
- package/dist/calls/index.js +2 -2
- package/dist/chat/index.cjs +57 -57
- package/dist/chat/index.js +4 -4
- package/dist/{chunk-D27BBGUF.cjs → chunk-23ACBETH.cjs} +4 -4
- package/dist/{chunk-D27BBGUF.cjs.map → chunk-23ACBETH.cjs.map} +1 -1
- package/dist/{chunk-4CI42DCG.js → chunk-323R76RZ.js} +50 -5
- package/dist/chunk-323R76RZ.js.map +1 -0
- package/dist/{chunk-DJE2E7YH.cjs → chunk-3VFQYKB5.cjs} +3 -3
- package/dist/{chunk-DJE2E7YH.cjs.map → chunk-3VFQYKB5.cjs.map} +1 -1
- package/dist/{chunk-JSHBC47B.cjs → chunk-45Y7ASBC.cjs} +53 -47
- package/dist/chunk-45Y7ASBC.cjs.map +1 -0
- package/dist/{chunk-TVHTXO6V.cjs → chunk-56WWEK6I.cjs} +4 -4
- package/dist/{chunk-TVHTXO6V.cjs.map → chunk-56WWEK6I.cjs.map} +1 -1
- package/dist/{chunk-CGCTODPC.cjs → chunk-6PGTH2HD.cjs} +4 -4
- package/dist/{chunk-CGCTODPC.cjs.map → chunk-6PGTH2HD.cjs.map} +1 -1
- package/dist/{chunk-PBIFISDD.js → chunk-7P24MJQN.js} +3 -3
- package/dist/{chunk-PBIFISDD.js.map → chunk-7P24MJQN.js.map} +1 -1
- package/dist/{chunk-6QZ35CTZ.js → chunk-AD76WTGR.js} +3 -3
- package/dist/{chunk-6QZ35CTZ.js.map → chunk-AD76WTGR.js.map} +1 -1
- package/dist/{chunk-ROWJU4SK.cjs → chunk-AKGV6JUC.cjs} +12 -128
- package/dist/chunk-AKGV6JUC.cjs.map +1 -0
- package/dist/{chunk-UIUWCTIZ.js → chunk-APXW5XGA.js} +165 -4
- package/dist/chunk-APXW5XGA.js.map +1 -0
- package/dist/{chunk-SEVFIBF3.cjs → chunk-BFIHXDO6.cjs} +4 -4
- package/dist/{chunk-SEVFIBF3.cjs.map → chunk-BFIHXDO6.cjs.map} +1 -1
- package/dist/{chunk-6OMIIF76.js → chunk-BWWND4Y7.js} +3 -3
- package/dist/{chunk-6OMIIF76.js.map → chunk-BWWND4Y7.js.map} +1 -1
- package/dist/{chunk-EG3BB32W.cjs → chunk-CCSF7RI4.cjs} +3 -3
- package/dist/{chunk-EG3BB32W.cjs.map → chunk-CCSF7RI4.cjs.map} +1 -1
- package/dist/{chunk-QK546T4C.cjs → chunk-CKNUL4LM.cjs} +3 -3
- package/dist/{chunk-QK546T4C.cjs.map → chunk-CKNUL4LM.cjs.map} +1 -1
- package/dist/{chunk-TJ7QEGVP.cjs → chunk-COZDIUG7.cjs} +18 -18
- package/dist/{chunk-TJ7QEGVP.cjs.map → chunk-COZDIUG7.cjs.map} +1 -1
- package/dist/{chunk-YQEXBJVO.js → chunk-DF5X27QX.js} +42 -5
- package/dist/chunk-DF5X27QX.js.map +1 -0
- package/dist/{chunk-B3CRSCLK.cjs → chunk-EOIJ5JYP.cjs} +4 -4
- package/dist/{chunk-B3CRSCLK.cjs.map → chunk-EOIJ5JYP.cjs.map} +1 -1
- package/dist/{chunk-GPYLXEZO.js → chunk-FCOK73I3.js} +6 -120
- package/dist/chunk-FCOK73I3.js.map +1 -0
- package/dist/{chunk-CJF7B5A7.cjs → chunk-FHXXDPNU.cjs} +12 -12
- package/dist/{chunk-CJF7B5A7.cjs.map → chunk-FHXXDPNU.cjs.map} +1 -1
- package/dist/{chunk-ITRI47DF.cjs → chunk-GMGEAWFX.cjs} +41 -4
- package/dist/chunk-GMGEAWFX.cjs.map +1 -0
- package/dist/{chunk-LNH6NYG4.js → chunk-I3VBVP6R.js} +121 -6
- package/dist/chunk-I3VBVP6R.js.map +1 -0
- package/dist/{chunk-ZZHMJXM5.cjs → chunk-IXZCXK6Q.cjs} +122 -5
- package/dist/chunk-IXZCXK6Q.cjs.map +1 -0
- package/dist/{chunk-SBAM3UZX.js → chunk-JWRTUYLC.js} +3 -3
- package/dist/{chunk-SBAM3UZX.js.map → chunk-JWRTUYLC.js.map} +1 -1
- package/dist/{chunk-PLEMVK2W.js → chunk-KQLUMK56.js} +3 -3
- package/dist/{chunk-PLEMVK2W.js.map → chunk-KQLUMK56.js.map} +1 -1
- package/dist/{chunk-PNZVUH46.cjs → chunk-LAQ3Y5JP.cjs} +6 -6
- package/dist/{chunk-PNZVUH46.cjs.map → chunk-LAQ3Y5JP.cjs.map} +1 -1
- package/dist/{chunk-AESJLGMC.cjs → chunk-LEW4GUFW.cjs} +7 -7
- package/dist/{chunk-AESJLGMC.cjs.map → chunk-LEW4GUFW.cjs.map} +1 -1
- package/dist/{chunk-2LUA7UDE.js → chunk-NDVLCOWS.js} +7 -7
- package/dist/{chunk-2LUA7UDE.js.map → chunk-NDVLCOWS.js.map} +1 -1
- package/dist/{chunk-43IVRSFX.js → chunk-NVXNTHL4.js} +3 -3
- package/dist/{chunk-43IVRSFX.js.map → chunk-NVXNTHL4.js.map} +1 -1
- package/dist/{chunk-IRXPUQFP.js → chunk-OZL5ABLF.js} +3 -3
- package/dist/{chunk-IRXPUQFP.js.map → chunk-OZL5ABLF.js.map} +1 -1
- package/dist/{chunk-5EGTGHBW.js → chunk-PGKZBAJB.js} +12 -6
- package/dist/chunk-PGKZBAJB.js.map +1 -0
- package/dist/{chunk-KNOSLLTC.js → chunk-PKDPQS6Z.js} +3 -3
- package/dist/{chunk-KNOSLLTC.js.map → chunk-PKDPQS6Z.js.map} +1 -1
- package/dist/{chunk-VWM3J6ES.js → chunk-PVPGD6QR.js} +3 -3
- package/dist/{chunk-VWM3J6ES.js.map → chunk-PVPGD6QR.js.map} +1 -1
- package/dist/{chunk-C2S246BV.js → chunk-RAGITH2N.js} +4 -4
- package/dist/{chunk-C2S246BV.js.map → chunk-RAGITH2N.js.map} +1 -1
- package/dist/{chunk-4Q7ON335.js → chunk-RFKAE6WS.js} +5 -5
- package/dist/{chunk-4Q7ON335.js.map → chunk-RFKAE6WS.js.map} +1 -1
- package/dist/{chunk-2C4YUIVX.js → chunk-T2VGD4X6.js} +3 -3
- package/dist/{chunk-2C4YUIVX.js.map → chunk-T2VGD4X6.js.map} +1 -1
- package/dist/{chunk-CEKOZAGO.js → chunk-TAI23FCY.js} +3 -3
- package/dist/{chunk-CEKOZAGO.js.map → chunk-TAI23FCY.js.map} +1 -1
- package/dist/{chunk-WBLCPCWR.cjs → chunk-UDMII47W.cjs} +7 -7
- package/dist/{chunk-WBLCPCWR.cjs.map → chunk-UDMII47W.cjs.map} +1 -1
- package/dist/{chunk-SFTQO3TU.js → chunk-UO3FS6ZF.js} +3 -3
- package/dist/{chunk-SFTQO3TU.js.map → chunk-UO3FS6ZF.js.map} +1 -1
- package/dist/{chunk-BELZ2WD2.js → chunk-W5D5GFP2.js} +3 -3
- package/dist/{chunk-BELZ2WD2.js.map → chunk-W5D5GFP2.js.map} +1 -1
- package/dist/{chunk-LFS6UWSJ.cjs → chunk-XWUGPV7H.cjs} +5 -5
- package/dist/{chunk-LFS6UWSJ.cjs.map → chunk-XWUGPV7H.cjs.map} +1 -1
- package/dist/{chunk-K26RLK2Y.cjs → chunk-Y6ZNWC7E.cjs} +3 -3
- package/dist/{chunk-K26RLK2Y.cjs.map → chunk-Y6ZNWC7E.cjs.map} +1 -1
- package/dist/{chunk-F777MGVA.cjs → chunk-YBVBDVQX.cjs} +18 -18
- package/dist/{chunk-F777MGVA.cjs.map → chunk-YBVBDVQX.cjs.map} +1 -1
- package/dist/{chunk-OM5IVNEW.cjs → chunk-Z4KXF7WS.cjs} +165 -2
- package/dist/chunk-Z4KXF7WS.cjs.map +1 -0
- package/dist/{chunk-7MOQO6NO.cjs → chunk-ZIQGSFHG.cjs} +53 -5
- package/dist/chunk-ZIQGSFHG.cjs.map +1 -0
- package/dist/connect/docx.cjs +11 -11
- package/dist/connect/docx.js +7 -7
- package/dist/connect/index.cjs +1723 -1149
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +3 -0
- package/dist/connect/index.js +1191 -633
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +10 -10
- package/dist/connect/viewer.js +9 -9
- package/dist/connection/billing/index.d.ts +1 -0
- package/dist/connection/billing/payment-required.d.ts +45 -0
- package/dist/connection/runtime/ConnectedAppRuntime.d.ts +1 -1
- package/dist/connection/runtime/index.d.ts +1 -1
- package/dist/connection/runtime/requests.d.ts +8 -0
- package/dist/connection/runtime/useWelcomeDialog.d.ts +3 -0
- package/dist/connection/settings-page/ConnectedModelConnectionsSettings.d.ts +1 -0
- package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +3 -0
- package/dist/connection/settings-page/index.d.ts +2 -1
- package/dist/connection/tips/ConnectedGettingStarted.d.ts +20 -0
- package/dist/connection/tips/ConnectedTipBar.d.ts +49 -0
- package/dist/connection/tips/useGettingStarted.d.ts +51 -0
- package/dist/connection/workflows/useWorkflowsPageState.d.ts +1 -1
- package/dist/dashboards/index.cjs +1 -1
- package/dist/dashboards/index.js +1 -1
- package/dist/document-tools/index.cjs +17 -17
- package/dist/document-tools/index.js +2 -2
- package/dist/embed/index.cjs +9 -9
- package/dist/embed/index.js +6 -6
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/home/index.cjs +23 -178
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +3 -164
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +606 -634
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -62
- package/dist/index.js.map +1 -1
- package/dist/shell/index.cjs +73 -73
- package/dist/shell/index.js +4 -4
- package/dist/site/index.cjs +17 -17
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +10 -10
- package/dist/studio/index.js +7 -7
- package/dist/tips/index.d.ts +1 -1
- package/dist/tips/visibility.d.ts +7 -0
- package/dist/workflow-canvas/index.cjs +27 -27
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +12 -12
- package/dist/workflow-canvas/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedNativeDocxComparison-L3R3ROPZ.cjs.map +0 -1
- package/dist/ConnectedNativeDocxComparison-PSAP3Q7D.js.map +0 -1
- package/dist/ConnectedNativeDocxEditor-PI6QTPXZ.js.map +0 -1
- package/dist/ConnectedNativeDocxEditor-VDBC4XRT.cjs.map +0 -1
- package/dist/ConnectedStreamedWordArtifact-V4MTKVNE.js.map +0 -1
- package/dist/ConnectedStreamedWordArtifact-YSW6D7AG.cjs.map +0 -1
- package/dist/chunk-4CI42DCG.js.map +0 -1
- package/dist/chunk-5EGTGHBW.js.map +0 -1
- package/dist/chunk-7MOQO6NO.cjs.map +0 -1
- package/dist/chunk-GPYLXEZO.js.map +0 -1
- package/dist/chunk-ITRI47DF.cjs.map +0 -1
- package/dist/chunk-JSHBC47B.cjs.map +0 -1
- package/dist/chunk-LNH6NYG4.js.map +0 -1
- package/dist/chunk-OM5IVNEW.cjs.map +0 -1
- package/dist/chunk-ROWJU4SK.cjs.map +0 -1
- package/dist/chunk-UIUWCTIZ.js.map +0 -1
- package/dist/chunk-YQEXBJVO.js.map +0 -1
- package/dist/chunk-ZZHMJXM5.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/provider/TooltipScope.tsx","../src/lib/use-drawer.ts","../src/shell/Shell.tsx","../src/shell/ToolButton.tsx"],"names":["createContext","useContext","jsx","useRef","cn"],"mappings":";;;;;;AAGA,IAAM,mBAAA,GAAsB,cAAc,KAAK,CAAA;AAOxC,SAAS,qBAAA,CAAsB,EAAE,QAAA,EAAS,EAA4B;AAC3E,EAAA,MAAM,QAAA,GAAW,WAAW,mBAAmB,CAAA;AAC/C,EAAA,IAAI,QAAA,EAAU,uBAAO,GAAA,CAAA,QAAA,EAAA,EAAG,QAAA,EAAS,CAAA;AACjC,EAAA,uBACE,GAAA,CAAC,oBAAoB,QAAA,EAApB,EAA6B,OAAK,IAAA,EACjC,QAAA,kBAAA,GAAA,CAAC,eAAA,EAAA,EAAiB,Q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AM,KAAA,GAAQ,MAAA,GAAS,CAAA,CAAE,YAAA,GAAe,CAAA,CAAE,WAAA;AAC1C,EAAA,uBACEA,GAAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,OAAA,EAAS,QAAA;AAAA,MACT,SAAA,EAAU,kHAAA;AAAA,MACV,YAAA,EAAY,KAAA;AAAA,MACZ,KAAA,EAAO,KAAA;AAAA,MACP,aAAA,EAAa,MAAA;AAAA,MAEb,QAAA,kBAAAA,GAAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA,GAChC;AAEJ;AC1UO,SAAS,UAAA,CAAW;AAAA,EACzB,OAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA,GAAS,KAAA;AAAA,EACT,aAAA,EAAe,MAAA;AAAA,EACf;AACF,CAAA,EAAoB;AAClB,EAAA,uBACEA,GAAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,OAAA;AAAA,MACA,KAAA,EAAO,KAAA;AAAA,MACP,YAAA,EAAY,KAAA;AAAA,MACZ,WAAA,EAAU,aAAA;AAAA,MACV,aAAA,EAAa,MAAA;AAAA,MACb,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,GAAU,OAAA;AAAA,EACvB,CAAC,CAAA;AAED,EAAAA,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,QAAA,EAAU;AACf,IAAA,MAAM,SAAA,GAAY,CAAC,CAAA,KAAqB;AACtC,MAAA,IAAI,EAAE,GAAA,KAAQ,QAAA,IAAY,CAAC,CAAA,CAAE,gBAAA,aAA6B,OAAA,EAAQ;AAAA,IACpE,CAAA;AACA,IAAA,QAAA,CAAS,gBAAA,CAAiB,WAAW,SAAS,CAAA;AAC9C,IAAA,OAAO,MAAM,QAAA,CAAS,mBAAA,CAAoB,SAAA,EAAW,SAAS,CAAA;AAAA,EAChE,CAAA,EAAG,CAAC,QAAQ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A;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"]}
|