react-panel-layout 0.5.2 → 0.6.1

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 (541) hide show
  1. package/dist/{FloatingPanelFrame-lLg-Lpg7.js → FloatingPanelFrame-3eU9AwPo.js} +11 -11
  2. package/dist/{FloatingPanelFrame-lLg-Lpg7.js.map → FloatingPanelFrame-3eU9AwPo.js.map} +1 -1
  3. package/dist/{FloatingPanelFrame-D9Cp2al1.cjs → FloatingPanelFrame-CEmXDvUA.cjs} +2 -2
  4. package/dist/{FloatingPanelFrame-D9Cp2al1.cjs.map → FloatingPanelFrame-CEmXDvUA.cjs.map} +1 -1
  5. package/dist/FloatingWindow-CUXnEtrb.js +827 -0
  6. package/dist/FloatingWindow-CUXnEtrb.js.map +1 -0
  7. package/dist/FloatingWindow-DMwyK0eK.cjs +2 -0
  8. package/dist/FloatingWindow-DMwyK0eK.cjs.map +1 -0
  9. package/dist/GridLayout-DKTg_N61.cjs +2 -0
  10. package/dist/GridLayout-DKTg_N61.cjs.map +1 -0
  11. package/dist/GridLayout-UWNxXw77.js +926 -0
  12. package/dist/GridLayout-UWNxXw77.js.map +1 -0
  13. package/dist/HorizontalDivider-DdxzfV0l.js +30 -0
  14. package/dist/HorizontalDivider-DdxzfV0l.js.map +1 -0
  15. package/dist/HorizontalDivider-_pgV4Mcv.cjs +2 -0
  16. package/dist/HorizontalDivider-_pgV4Mcv.cjs.map +1 -0
  17. package/dist/PanelSystem-BqUzNtf2.js +1946 -0
  18. package/dist/PanelSystem-BqUzNtf2.js.map +1 -0
  19. package/dist/PanelSystem-D603LKKv.cjs +3 -0
  20. package/dist/PanelSystem-D603LKKv.cjs.map +1 -0
  21. package/dist/ResizeHandle-CBcAS918.cjs +2 -0
  22. package/dist/ResizeHandle-CBcAS918.cjs.map +1 -0
  23. package/dist/ResizeHandle-CXjc1meV.js +119 -0
  24. package/dist/ResizeHandle-CXjc1meV.js.map +1 -0
  25. package/dist/SwipePivotTabBar-DWrCuwEI.js +411 -0
  26. package/dist/SwipePivotTabBar-DWrCuwEI.js.map +1 -0
  27. package/dist/SwipePivotTabBar-fjjXkpj7.cjs +2 -0
  28. package/dist/SwipePivotTabBar-fjjXkpj7.cjs.map +1 -0
  29. package/dist/components/gesture/SwipeSafeZone.d.ts +40 -0
  30. package/dist/components/window/Drawer.d.ts +3 -1
  31. package/dist/components/window/DrawerLayers.d.ts +1 -1
  32. package/dist/components/window/drawerStyles.d.ts +69 -0
  33. package/dist/components/window/drawerSwipeConfig.d.ts +29 -0
  34. package/dist/components/window/useDrawerSwipeTransform.d.ts +23 -0
  35. package/dist/config.cjs +1 -1
  36. package/dist/config.cjs.map +1 -1
  37. package/dist/config.js +11 -9
  38. package/dist/config.js.map +1 -1
  39. package/dist/constants/styles.d.ts +35 -4
  40. package/dist/dialog/index.d.ts +69 -0
  41. package/dist/floating.cjs +1 -1
  42. package/dist/floating.js +1 -1
  43. package/dist/grid/index.d.ts +58 -0
  44. package/dist/grid.cjs +2 -0
  45. package/dist/grid.cjs.map +1 -0
  46. package/dist/grid.js +13 -0
  47. package/dist/grid.js.map +1 -0
  48. package/dist/hooks/gesture/presets.d.ts +33 -0
  49. package/dist/hooks/gesture/testing/createGestureSimulator.d.ts +117 -0
  50. package/dist/hooks/gesture/thresholdValue.d.ts +44 -0
  51. package/dist/hooks/gesture/types.d.ts +297 -0
  52. package/dist/hooks/gesture/useDirectionalLock.d.ts +20 -0
  53. package/dist/hooks/gesture/useEdgeSwipeInput.d.ts +23 -0
  54. package/dist/hooks/gesture/useNativeGestureGuard.d.ts +23 -0
  55. package/dist/hooks/gesture/usePointerTracking.d.ts +22 -0
  56. package/dist/hooks/gesture/useScrollBoundary.d.ts +23 -0
  57. package/dist/hooks/gesture/useSwipeInput.d.ts +5 -0
  58. package/dist/hooks/gesture/utils.d.ts +59 -0
  59. package/dist/hooks/useAnimatedVisibility.d.ts +58 -0
  60. package/dist/hooks/useAnimationFrame.d.ts +86 -0
  61. package/dist/hooks/useOperationContinuity.d.ts +64 -0
  62. package/dist/hooks/useResizeObserver.d.ts +33 -1
  63. package/dist/hooks/useSharedElementTransition.d.ts +112 -0
  64. package/dist/hooks/useSnapAnimation.d.ts +54 -0
  65. package/dist/hooks/useSwipeContentTransform.d.ts +86 -0
  66. package/dist/index.cjs +1 -2
  67. package/dist/index.cjs.map +1 -1
  68. package/dist/index.d.ts +0 -1
  69. package/dist/index.js +25 -2006
  70. package/dist/index.js.map +1 -1
  71. package/dist/modules/dialog/AlertDialog.d.ts +9 -0
  72. package/dist/modules/dialog/DialogContainer.d.ts +37 -0
  73. package/dist/modules/dialog/Modal.d.ts +26 -0
  74. package/dist/modules/dialog/SwipeDialogContainer.d.ts +16 -0
  75. package/dist/modules/dialog/dialogAnimationUtils.d.ts +113 -0
  76. package/dist/modules/dialog/types.d.ts +183 -0
  77. package/dist/modules/dialog/useDialog.d.ts +39 -0
  78. package/dist/modules/dialog/useDialogContainer.d.ts +47 -0
  79. package/dist/modules/dialog/useDialogSwipeInput.d.ts +70 -0
  80. package/dist/modules/dialog/useDialogTransform.d.ts +82 -0
  81. package/dist/modules/drawer/types.d.ts +74 -0
  82. package/dist/modules/drawer/useDrawerSwipeInput.d.ts +24 -0
  83. package/dist/modules/pivot/PivotContent.d.ts +1 -1
  84. package/dist/modules/pivot/SwipePivotContent.d.ts +39 -0
  85. package/dist/modules/pivot/SwipePivotContent.debug.tmp.d.ts +25 -0
  86. package/dist/modules/pivot/SwipePivotContent.test.d.ts +1 -0
  87. package/dist/modules/pivot/SwipePivotTabBar.d.ts +92 -0
  88. package/dist/modules/pivot/index.d.ts +3 -0
  89. package/dist/modules/pivot/scaleInputState.d.ts +37 -0
  90. package/dist/modules/pivot/types.d.ts +67 -2
  91. package/dist/modules/pivot/usePivotSwipeInput.d.ts +68 -0
  92. package/dist/modules/stack/StackContent.d.ts +15 -0
  93. package/dist/modules/stack/SwipeStackContent.d.ts +66 -0
  94. package/dist/modules/stack/SwipeStackOutlet.d.ts +80 -0
  95. package/dist/modules/stack/computeStackContentState.d.ts +99 -0
  96. package/dist/modules/stack/computeSwipeStackTransform.d.ts +76 -0
  97. package/dist/modules/stack/types.d.ts +194 -0
  98. package/dist/modules/stack/useStackAnimationState.d.ts +32 -0
  99. package/dist/modules/stack/useStackNavigation.d.ts +23 -0
  100. package/dist/modules/stack/useStackSwipeInput.d.ts +27 -0
  101. package/dist/panels/index.d.ts +67 -0
  102. package/dist/panels.cjs +2 -0
  103. package/dist/panels.cjs.map +1 -0
  104. package/dist/panels.js +28 -0
  105. package/dist/panels.js.map +1 -0
  106. package/dist/pivot/index.d.ts +3 -0
  107. package/dist/pivot.cjs +1 -1
  108. package/dist/pivot.cjs.map +1 -1
  109. package/dist/pivot.js +20 -2
  110. package/dist/pivot.js.map +1 -1
  111. package/dist/resizer/index.d.ts +57 -0
  112. package/dist/resizer.cjs +2 -0
  113. package/dist/resizer.cjs.map +1 -0
  114. package/dist/resizer.js +8 -0
  115. package/dist/resizer.js.map +1 -0
  116. package/dist/stack/index.d.ts +72 -0
  117. package/dist/stack.cjs +2 -0
  118. package/dist/stack.cjs.map +1 -0
  119. package/dist/stack.js +721 -0
  120. package/dist/stack.js.map +1 -0
  121. package/dist/sticky-header/StickyArea.d.ts +38 -0
  122. package/dist/sticky-header/calculateStickyMetrics.d.ts +28 -0
  123. package/dist/sticky-header/index.d.ts +4 -4
  124. package/dist/sticky-header/types.d.ts +35 -22
  125. package/dist/sticky-header.cjs +1 -1
  126. package/dist/sticky-header.cjs.map +1 -1
  127. package/dist/sticky-header.js +73 -174
  128. package/dist/sticky-header.js.map +1 -1
  129. package/dist/styles-NkjuMOVS.js +57 -0
  130. package/dist/styles-NkjuMOVS.js.map +1 -0
  131. package/dist/styles-qf6ptVLD.cjs +2 -0
  132. package/dist/styles-qf6ptVLD.cjs.map +1 -0
  133. package/dist/types.d.ts +16 -0
  134. package/dist/useContentCache-CO3LYNmz.js +24 -0
  135. package/dist/useContentCache-CO3LYNmz.js.map +1 -0
  136. package/dist/useContentCache-DqXtLrLs.cjs +2 -0
  137. package/dist/useContentCache-DqXtLrLs.cjs.map +1 -0
  138. package/dist/useDocumentPointerEvents-DXxw3qWj.js +54 -0
  139. package/dist/useDocumentPointerEvents-DXxw3qWj.js.map +1 -0
  140. package/dist/useDocumentPointerEvents-DxDSOtip.cjs +2 -0
  141. package/dist/useDocumentPointerEvents-DxDSOtip.cjs.map +1 -0
  142. package/dist/useFloatingState-C4kRaW_R.cjs +2 -0
  143. package/dist/useFloatingState-C4kRaW_R.cjs.map +1 -0
  144. package/dist/useFloatingState-tEfA_wbc.js +74 -0
  145. package/dist/useFloatingState-tEfA_wbc.js.map +1 -0
  146. package/dist/useNativeGestureGuard-C7TSqEkr.cjs +2 -0
  147. package/dist/useNativeGestureGuard-C7TSqEkr.cjs.map +1 -0
  148. package/dist/useNativeGestureGuard-CGYo6O0r.js +347 -0
  149. package/dist/useNativeGestureGuard-CGYo6O0r.js.map +1 -0
  150. package/dist/window/index.d.ts +63 -0
  151. package/dist/window.cjs +2 -0
  152. package/dist/window.cjs.map +1 -0
  153. package/dist/window.js +160 -0
  154. package/dist/window.js.map +1 -0
  155. package/docs/design-tokens.md +405 -0
  156. package/package.json +34 -4
  157. package/src/PanelSystemContext.tsx +88 -0
  158. package/src/components/gesture/SwipeSafeZone.tsx +69 -0
  159. package/src/components/grid/GridLayerList.tsx +172 -0
  160. package/src/components/grid/GridLayerResizeHandles.tsx +145 -0
  161. package/src/components/grid/GridLayout.spec.tsx +743 -0
  162. package/src/components/grid/GridLayout.tsx +130 -0
  163. package/src/components/grid/GridTrackResizeHandle.tsx +87 -0
  164. package/src/components/paneling/FloatingPanelFrame.tsx +203 -0
  165. package/src/components/panels/DropSuggestOverlay.tsx +131 -0
  166. package/src/components/panels/PanelGroupView.tsx +112 -0
  167. package/src/components/pivot/PivotLayer.tsx +27 -0
  168. package/src/components/resizer/HorizontalDivider.tsx +52 -0
  169. package/src/components/resizer/ResizeHandle.tsx +118 -0
  170. package/src/components/tabs/TabBar.tsx +223 -0
  171. package/src/components/tabs/TabBarTab.tsx +133 -0
  172. package/src/components/tabs/TabDragOverlay.tsx +92 -0
  173. package/src/components/window/DialogOverlay.tsx +180 -0
  174. package/src/components/window/Drawer.tsx +369 -0
  175. package/src/components/window/DrawerLayers.tsx +68 -0
  176. package/src/components/window/FloatingWindow.tsx +95 -0
  177. package/src/components/window/PopupLayerPortal.tsx +218 -0
  178. package/src/components/window/drawerStyles.spec.ts +263 -0
  179. package/src/components/window/drawerStyles.ts +228 -0
  180. package/src/components/window/drawerSwipeConfig.spec.ts +131 -0
  181. package/src/components/window/drawerSwipeConfig.ts +112 -0
  182. package/src/components/window/useDrawerSwipeTransform.spec.ts +234 -0
  183. package/src/components/window/useDrawerSwipeTransform.ts +129 -0
  184. package/src/config/PanelContentDeclaration.tsx +427 -0
  185. package/src/config/index.tsx +52 -0
  186. package/src/config/panelJsx.spec.tsx +54 -0
  187. package/src/config/panelJsxConfig.spec.tsx +54 -0
  188. package/src/config/panelJsxDrawer.spec.tsx +33 -0
  189. package/src/config/panelRouter.spec.ts +68 -0
  190. package/src/config/panelRouter.tsx +155 -0
  191. package/src/constants/styles.ts +280 -0
  192. package/src/demo/Layout.module.css +258 -0
  193. package/src/demo/Layout.tsx +176 -0
  194. package/src/demo/components/CodeBlock.module.css +54 -0
  195. package/src/demo/components/CodeBlock.tsx +34 -0
  196. package/src/demo/components/CodePreview.module.css +37 -0
  197. package/src/demo/components/CodePreview.tsx +31 -0
  198. package/src/demo/components/DataPreview.module.css +177 -0
  199. package/src/demo/components/DataPreview.tsx +115 -0
  200. package/src/demo/components/Story.module.css +68 -0
  201. package/src/demo/components/Story.tsx +54 -0
  202. package/src/demo/components/layout/CodePanel.module.css +183 -0
  203. package/src/demo/components/layout/CodePanel.tsx +149 -0
  204. package/src/demo/components/layout/DemoPage.module.css +60 -0
  205. package/src/demo/components/layout/DemoPage.tsx +56 -0
  206. package/src/demo/components/layout/SingleSamplePage.module.css +11 -0
  207. package/src/demo/components/layout/SingleSamplePage.tsx +35 -0
  208. package/src/demo/components/layout/SplitDemoLayout.module.css +107 -0
  209. package/src/demo/components/layout/SplitDemoLayout.tsx +218 -0
  210. package/src/demo/components/layout/index.ts +11 -0
  211. package/src/demo/components/tab-styles/ChromeTabBar.module.css +75 -0
  212. package/src/demo/components/tab-styles/ChromeTabBar.tsx +111 -0
  213. package/src/demo/components/tab-styles/GitHubTabBar.module.css +81 -0
  214. package/src/demo/components/tab-styles/GitHubTabBar.tsx +109 -0
  215. package/src/demo/components/tab-styles/VSCodeTabBar.module.css +78 -0
  216. package/src/demo/components/tab-styles/VSCodeTabBar.tsx +109 -0
  217. package/src/demo/components/tab-styles/index.ts +6 -0
  218. package/src/demo/components/ui/DemoButton.module.css +63 -0
  219. package/src/demo/components/ui/DemoButton.tsx +32 -0
  220. package/src/demo/components/ui/DemoCard.module.css +15 -0
  221. package/src/demo/components/ui/DemoCard.tsx +30 -0
  222. package/src/demo/components/ui/DemoContainer.module.css +17 -0
  223. package/src/demo/components/ui/DemoContainer.tsx +30 -0
  224. package/src/demo/components/ui/DemoPanel.module.css +23 -0
  225. package/src/demo/components/ui/DemoPanel.tsx +33 -0
  226. package/src/demo/components/ui/PanelText.module.css +18 -0
  227. package/src/demo/components/ui/PanelText.tsx +29 -0
  228. package/src/demo/components/ui/PanelTitle.module.css +18 -0
  229. package/src/demo/components/ui/PanelTitle.tsx +31 -0
  230. package/src/demo/contexts/TabbarDemoConfig.tsx +218 -0
  231. package/src/demo/demo.css +172 -0
  232. package/src/demo/hooks/useMedia.ts +41 -0
  233. package/src/demo/hooks/useShikiHighlight.ts +55 -0
  234. package/src/demo/index.tsx +293 -0
  235. package/src/demo/pages/Dialog/alerts/index.tsx +22 -0
  236. package/src/demo/pages/Dialog/card/index.tsx +22 -0
  237. package/src/demo/pages/Dialog/components/AlertDialogDemo.tsx +124 -0
  238. package/src/demo/pages/Dialog/components/CardExpandDemo.module.css +243 -0
  239. package/src/demo/pages/Dialog/components/CardExpandDemo.tsx +204 -0
  240. package/src/demo/pages/Dialog/components/CustomAlertDialogDemo.tsx +219 -0
  241. package/src/demo/pages/Dialog/components/DialogDemos.module.css +77 -0
  242. package/src/demo/pages/Dialog/components/ModalBasics.tsx +45 -0
  243. package/src/demo/pages/Dialog/components/SwipeDialogDemo.module.css +77 -0
  244. package/src/demo/pages/Dialog/components/SwipeDialogDemo.tsx +181 -0
  245. package/src/demo/pages/Dialog/custom-alert/index.tsx +22 -0
  246. package/src/demo/pages/Dialog/modal/index.tsx +17 -0
  247. package/src/demo/pages/Dialog/swipe/index.tsx +22 -0
  248. package/src/demo/pages/Drawer/animations/index.tsx +22 -0
  249. package/src/demo/pages/Drawer/basics/index.tsx +17 -0
  250. package/src/demo/pages/Drawer/components/DrawerAnimations.module.css +125 -0
  251. package/src/demo/pages/Drawer/components/DrawerAnimations.tsx +118 -0
  252. package/src/demo/pages/Drawer/components/DrawerBasics.module.css +55 -0
  253. package/src/demo/pages/Drawer/components/DrawerBasics.tsx +76 -0
  254. package/src/demo/pages/Drawer/components/DrawerMenuLayout.module.css +332 -0
  255. package/src/demo/pages/Drawer/components/DrawerMenuLayout.tsx +199 -0
  256. package/src/demo/pages/Drawer/components/DrawerSwipe.module.css +316 -0
  257. package/src/demo/pages/Drawer/components/DrawerSwipe.tsx +178 -0
  258. package/src/demo/pages/Drawer/menu/index.tsx +17 -0
  259. package/src/demo/pages/Drawer/swipe/index.tsx +17 -0
  260. package/src/demo/pages/FloatingPanelFrame/ResizableFloatingPanelsPreview.module.css +163 -0
  261. package/src/demo/pages/FloatingPanelFrame/ResizableFloatingPanelsPreview.tsx +234 -0
  262. package/src/demo/pages/FloatingPanelFrame/basic/index.tsx +17 -0
  263. package/src/demo/pages/FloatingPanelFrame/complex/index.tsx +26 -0
  264. package/src/demo/pages/FloatingPanelFrame/components/BasicPanel.module.css +16 -0
  265. package/src/demo/pages/FloatingPanelFrame/components/BasicPanel.tsx +24 -0
  266. package/src/demo/pages/FloatingPanelFrame/components/ComplexPanel.module.css +54 -0
  267. package/src/demo/pages/FloatingPanelFrame/components/ComplexPanel.tsx +67 -0
  268. package/src/demo/pages/FloatingPanelFrame/components/PanelWithControls.module.css +21 -0
  269. package/src/demo/pages/FloatingPanelFrame/components/PanelWithControls.tsx +41 -0
  270. package/src/demo/pages/FloatingPanelFrame/components/PanelWithMeta.module.css +5 -0
  271. package/src/demo/pages/FloatingPanelFrame/components/PanelWithMeta.tsx +43 -0
  272. package/src/demo/pages/FloatingPanelFrame/components/ScrollablePanel.module.css +11 -0
  273. package/src/demo/pages/FloatingPanelFrame/components/ScrollablePanel.tsx +42 -0
  274. package/src/demo/pages/FloatingPanelFrame/index.tsx +80 -0
  275. package/src/demo/pages/FloatingPanelFrame/scrollable/index.tsx +30 -0
  276. package/src/demo/pages/FloatingPanelFrame/with-controls/index.tsx +30 -0
  277. package/src/demo/pages/FloatingPanelFrame/with-meta/index.tsx +17 -0
  278. package/src/demo/pages/HorizontalDivider/components/PanelsWithRichContent.module.css +112 -0
  279. package/src/demo/pages/HorizontalDivider/components/PanelsWithRichContent.tsx +56 -0
  280. package/src/demo/pages/HorizontalDivider/components/SimpleResizablePanels.module.css +46 -0
  281. package/src/demo/pages/HorizontalDivider/components/SimpleResizablePanels.tsx +29 -0
  282. package/src/demo/pages/HorizontalDivider/components/ThreePanelLayout.module.css +54 -0
  283. package/src/demo/pages/HorizontalDivider/components/ThreePanelLayout.tsx +30 -0
  284. package/src/demo/pages/HorizontalDivider/index.module.css +14 -0
  285. package/src/demo/pages/HorizontalDivider/index.tsx +64 -0
  286. package/src/demo/pages/HorizontalDivider/panels-with-rich-content/index.tsx +21 -0
  287. package/src/demo/pages/HorizontalDivider/simple-resizable-panels/index.tsx +21 -0
  288. package/src/demo/pages/HorizontalDivider/three-panel-layout/index.tsx +21 -0
  289. package/src/demo/pages/PanelLayout/PanelLayoutDemo.module.css +174 -0
  290. package/src/demo/pages/PanelLayout/PanelLayoutDemo.tsx +248 -0
  291. package/src/demo/pages/PanelLayout/components/DashboardLayout.module.css +115 -0
  292. package/src/demo/pages/PanelLayout/components/DashboardLayout.tsx +124 -0
  293. package/src/demo/pages/PanelLayout/components/DraggableOverlays.module.css +101 -0
  294. package/src/demo/pages/PanelLayout/components/DraggableOverlays.tsx +122 -0
  295. package/src/demo/pages/PanelLayout/components/IDELayout.module.css +104 -0
  296. package/src/demo/pages/PanelLayout/components/IDELayout.tsx +143 -0
  297. package/src/demo/pages/PanelLayout/components/SimpleGrid.module.css +19 -0
  298. package/src/demo/pages/PanelLayout/components/SimpleGrid.tsx +62 -0
  299. package/src/demo/pages/PanelLayout/dashboard/index.tsx +22 -0
  300. package/src/demo/pages/PanelLayout/draggable-overlays/index.tsx +22 -0
  301. package/src/demo/pages/PanelLayout/ide-layout/index.tsx +22 -0
  302. package/src/demo/pages/PanelLayout/index.tsx +94 -0
  303. package/src/demo/pages/PanelLayout/simple-grid/index.tsx +22 -0
  304. package/src/demo/pages/PanelSystem/PanelSystemPreview.module.css +20 -0
  305. package/src/demo/pages/PanelSystem/PanelSystemPreview.tsx +101 -0
  306. package/src/demo/pages/PanelSystem/preview/index.tsx +18 -0
  307. package/src/demo/pages/PanelSystem/tabbar/index.tsx +129 -0
  308. package/src/demo/pages/Pivot/basics/index.tsx +17 -0
  309. package/src/demo/pages/Pivot/components/Pivot.module.css +278 -0
  310. package/src/demo/pages/Pivot/components/PivotBasics.tsx +103 -0
  311. package/src/demo/pages/Pivot/components/PivotSidebar.tsx +168 -0
  312. package/src/demo/pages/Pivot/components/PivotTabs.tsx +129 -0
  313. package/src/demo/pages/Pivot/components/PivotTransitions.tsx +120 -0
  314. package/src/demo/pages/Pivot/components/SwipePivot.module.css +114 -0
  315. package/src/demo/pages/Pivot/components/SwipePivot.tsx +193 -0
  316. package/src/demo/pages/Pivot/components/SwipeTabsPivot.module.css +203 -0
  317. package/src/demo/pages/Pivot/components/SwipeTabsPivot.tsx +320 -0
  318. package/src/demo/pages/Pivot/sidebar/index.tsx +17 -0
  319. package/src/demo/pages/Pivot/swipe/index.tsx +16 -0
  320. package/src/demo/pages/Pivot/swipe-debug/index.tsx +287 -0
  321. package/src/demo/pages/Pivot/swipe-tabs/index.tsx +15 -0
  322. package/src/demo/pages/Pivot/tabs/index.tsx +17 -0
  323. package/src/demo/pages/Pivot/transitions/index.tsx +17 -0
  324. package/src/demo/pages/ResizeHandle/both-directions/index.tsx +17 -0
  325. package/src/demo/pages/ResizeHandle/components/BothDirectionsDemo.module.css +72 -0
  326. package/src/demo/pages/ResizeHandle/components/BothDirectionsDemo.tsx +41 -0
  327. package/src/demo/pages/ResizeHandle/components/HorizontalResizeDemo.module.css +61 -0
  328. package/src/demo/pages/ResizeHandle/components/HorizontalResizeDemo.tsx +33 -0
  329. package/src/demo/pages/ResizeHandle/components/NestedPanelsDemo.module.css +83 -0
  330. package/src/demo/pages/ResizeHandle/components/NestedPanelsDemo.tsx +53 -0
  331. package/src/demo/pages/ResizeHandle/components/VerticalResizeDemo.module.css +68 -0
  332. package/src/demo/pages/ResizeHandle/components/VerticalResizeDemo.tsx +33 -0
  333. package/src/demo/pages/ResizeHandle/horizontal/index.tsx +17 -0
  334. package/src/demo/pages/ResizeHandle/index.module.css +11 -0
  335. package/src/demo/pages/ResizeHandle/index.tsx +71 -0
  336. package/src/demo/pages/ResizeHandle/nested-panels/index.tsx +17 -0
  337. package/src/demo/pages/ResizeHandle/vertical/index.tsx +17 -0
  338. package/src/demo/pages/ResponsiveLayout/adaptive-workspace/index.tsx +22 -0
  339. package/src/demo/pages/ResponsiveLayout/components/ResponsiveWorkspace.module.css +423 -0
  340. package/src/demo/pages/ResponsiveLayout/components/ResponsiveWorkspace.tsx +398 -0
  341. package/src/demo/pages/Stack/basics/index.tsx +22 -0
  342. package/src/demo/pages/Stack/components/Stack.module.css +234 -0
  343. package/src/demo/pages/Stack/components/StackBasics.spec.tsx +152 -0
  344. package/src/demo/pages/Stack/components/StackBasics.tsx +301 -0
  345. package/src/demo/pages/Stack/components/StackTablet.module.css +299 -0
  346. package/src/demo/pages/Stack/components/StackTablet.spec.tsx +120 -0
  347. package/src/demo/pages/Stack/components/StackTablet.tsx +422 -0
  348. package/src/demo/pages/Stack/tablet/index.tsx +22 -0
  349. package/src/demo/pages/StickyHeader/basics/index.tsx +17 -0
  350. package/src/demo/pages/StickyHeader/components/StickyHeader.module.css +219 -0
  351. package/src/demo/pages/StickyHeader/components/StickyHeaderBasics.tsx +103 -0
  352. package/src/demo/routes.tsx +214 -0
  353. package/src/demo/styles/animations.css +68 -0
  354. package/src/demo/styles/stack-themes.css +35 -0
  355. package/src/demo/utils/createPanelView.tsx +58 -0
  356. package/src/dialog/index.ts +85 -0
  357. package/src/floating/index.ts +24 -0
  358. package/src/grid/index.ts +75 -0
  359. package/src/hooks/ContentCacheContext.tsx +87 -0
  360. package/src/hooks/gesture/presets.spec.ts +86 -0
  361. package/src/hooks/gesture/presets.ts +95 -0
  362. package/src/hooks/gesture/testing/createGestureSimulator.spec.ts +241 -0
  363. package/src/hooks/gesture/testing/createGestureSimulator.ts +385 -0
  364. package/src/hooks/gesture/thresholdValue.spec.ts +103 -0
  365. package/src/hooks/gesture/thresholdValue.ts +77 -0
  366. package/src/hooks/gesture/types.ts +367 -0
  367. package/src/hooks/gesture/useDirectionalLock.spec.ts +271 -0
  368. package/src/hooks/gesture/useDirectionalLock.ts +115 -0
  369. package/src/hooks/gesture/useEdgeSwipeInput.spec.ts +462 -0
  370. package/src/hooks/gesture/useEdgeSwipeInput.ts +131 -0
  371. package/src/hooks/gesture/useNativeGestureGuard.spec.ts +473 -0
  372. package/src/hooks/gesture/useNativeGestureGuard.ts +135 -0
  373. package/src/hooks/gesture/usePointerTracking.spec.ts +364 -0
  374. package/src/hooks/gesture/usePointerTracking.ts +134 -0
  375. package/src/hooks/gesture/useScrollBoundary.spec.ts +249 -0
  376. package/src/hooks/gesture/useScrollBoundary.ts +113 -0
  377. package/src/hooks/gesture/useSwipeInput.spec.ts +592 -0
  378. package/src/hooks/gesture/useSwipeInput.ts +310 -0
  379. package/src/hooks/gesture/utils.spec.ts +152 -0
  380. package/src/hooks/gesture/utils.ts +178 -0
  381. package/src/hooks/useAnimatedVisibility.spec.ts +277 -0
  382. package/src/hooks/useAnimatedVisibility.ts +172 -0
  383. package/src/hooks/useAnimationFrame.ts +208 -0
  384. package/src/hooks/useCSSMatrix.spec.ts +214 -0
  385. package/src/hooks/useCSSMatrix.ts +262 -0
  386. package/src/hooks/useClonedElementPreview.ts +28 -0
  387. package/src/hooks/useContainerScroll.ts +78 -0
  388. package/src/hooks/useContentCache.spec.tsx +232 -0
  389. package/src/hooks/useContentCache.tsx +127 -0
  390. package/src/hooks/useDocumentPointerEvents.ts +137 -0
  391. package/src/hooks/useDocumentScroll.ts +41 -0
  392. package/src/hooks/useEffectEvent.ts +40 -0
  393. package/src/hooks/useElementComponentWrapper.tsx +63 -0
  394. package/src/hooks/useIntersectionObserver.tsx +125 -0
  395. package/src/hooks/useIsomorphicLayoutEffect.ts +29 -0
  396. package/src/hooks/useOperationContinuity.spec.ts +387 -0
  397. package/src/hooks/useOperationContinuity.ts +135 -0
  398. package/src/hooks/useResizeObserver.spec.tsx +277 -0
  399. package/src/hooks/useResizeObserver.tsx +150 -0
  400. package/src/hooks/useScrollContainer.ts +73 -0
  401. package/src/hooks/useSharedElementTransition.ts +333 -0
  402. package/src/hooks/useSnapAnimation.ts +128 -0
  403. package/src/hooks/useSwipeContentTransform.spec.ts +133 -0
  404. package/src/hooks/useSwipeContentTransform.ts +373 -0
  405. package/src/hooks/useTransitionState.ts +95 -0
  406. package/src/index.tsx +88 -0
  407. package/src/modules/dialog/AlertDialog.spec.tsx +387 -0
  408. package/src/modules/dialog/AlertDialog.tsx +221 -0
  409. package/src/modules/dialog/DialogContainer.spec.tsx +228 -0
  410. package/src/modules/dialog/DialogContainer.tsx +188 -0
  411. package/src/modules/dialog/Modal.spec.tsx +220 -0
  412. package/src/modules/dialog/Modal.tsx +182 -0
  413. package/src/modules/dialog/SwipeDialogContainer.tsx +208 -0
  414. package/src/modules/dialog/dialogAnimationUtils.spec.ts +253 -0
  415. package/src/modules/dialog/dialogAnimationUtils.ts +297 -0
  416. package/src/modules/dialog/types.ts +186 -0
  417. package/src/modules/dialog/useDialog.spec.tsx +447 -0
  418. package/src/modules/dialog/useDialog.ts +214 -0
  419. package/src/modules/dialog/useDialogContainer.spec.ts +331 -0
  420. package/src/modules/dialog/useDialogContainer.ts +150 -0
  421. package/src/modules/dialog/useDialogSwipeInput.spec.ts +157 -0
  422. package/src/modules/dialog/useDialogSwipeInput.ts +319 -0
  423. package/src/modules/dialog/useDialogTransform.spec.ts +370 -0
  424. package/src/modules/dialog/useDialogTransform.ts +407 -0
  425. package/src/modules/drawer/types.ts +102 -0
  426. package/src/modules/drawer/useDrawerSwipeInput.spec.ts +566 -0
  427. package/src/modules/drawer/useDrawerSwipeInput.ts +399 -0
  428. package/src/modules/grid/GridLayoutContext.tsx +57 -0
  429. package/src/modules/grid/LayerInstanceContext.tsx +56 -0
  430. package/src/modules/grid/resizeHandles.ts +157 -0
  431. package/src/modules/grid/trackUtils.ts +146 -0
  432. package/src/modules/grid/useGridPlacements.ts +143 -0
  433. package/src/modules/grid/useGridTracks.ts +156 -0
  434. package/src/modules/grid/useLayerDragHandle.ts +16 -0
  435. package/src/modules/grid/useLayerInteractions.tsx +850 -0
  436. package/src/modules/keybindings/KeybindingsProvider.tsx +111 -0
  437. package/src/modules/panels/dom/DomRegistry.tsx +94 -0
  438. package/src/modules/panels/index.ts +45 -0
  439. package/src/modules/panels/interactions/InteractionsContext.test.tsx +330 -0
  440. package/src/modules/panels/interactions/InteractionsContext.tsx +394 -0
  441. package/src/modules/panels/interactions/dnd.ts +28 -0
  442. package/src/modules/panels/keybindings/KeybindingsInstaller.tsx +15 -0
  443. package/src/modules/panels/layout/adapter.ts +124 -0
  444. package/src/modules/panels/rendering/ContentRegistry.spec.tsx +311 -0
  445. package/src/modules/panels/rendering/ContentRegistry.tsx +205 -0
  446. package/src/modules/panels/rendering/GroupContainer.tsx +65 -0
  447. package/src/modules/panels/rendering/RenderBridge.tsx +115 -0
  448. package/src/modules/panels/rendering/RenderContext.tsx +31 -0
  449. package/src/modules/panels/state/PanelSplitHandles.tsx +147 -0
  450. package/src/modules/panels/state/PanelSystemContext.splitLimits.spec.tsx +50 -0
  451. package/src/modules/panels/state/PanelSystemContext.tsx +289 -0
  452. package/src/modules/panels/state/StateContext.tsx +12 -0
  453. package/src/modules/panels/state/cleanup.ts +37 -0
  454. package/src/modules/panels/state/commands.ts +53 -0
  455. package/src/modules/panels/state/focus/Context.tsx +25 -0
  456. package/src/modules/panels/state/focus/logic.ts +57 -0
  457. package/src/modules/panels/state/groups/Context.tsx +25 -0
  458. package/src/modules/panels/state/groups/logic.ts +105 -0
  459. package/src/modules/panels/state/splitLimits.spec.ts +46 -0
  460. package/src/modules/panels/state/splitLimits.ts +90 -0
  461. package/src/modules/panels/state/state.spec.ts +49 -0
  462. package/src/modules/panels/state/tree/Context.tsx +24 -0
  463. package/src/modules/panels/state/tree/logic.spec.ts +34 -0
  464. package/src/modules/panels/state/tree/logic.ts +138 -0
  465. package/src/modules/panels/state/types.ts +142 -0
  466. package/src/modules/panels/system/PanelSystem.empty-tabbar.spec.tsx +53 -0
  467. package/src/modules/panels/system/PanelSystem.tab-click-activates.spec.tsx +44 -0
  468. package/src/modules/panels/system/PanelSystem.tab-reorder.spec.tsx +64 -0
  469. package/src/modules/panels/system/PanelSystem.tabs-no-dup.spec.tsx +57 -0
  470. package/src/modules/panels/system/PanelSystem.tsx +206 -0
  471. package/src/modules/pivot/PivotContent.spec.tsx +179 -0
  472. package/src/modules/pivot/PivotContent.tsx +77 -0
  473. package/src/modules/pivot/SwipePivotContent.debug.tmp.tsx +237 -0
  474. package/src/modules/pivot/SwipePivotContent.position.spec.tsx +171 -0
  475. package/src/modules/pivot/SwipePivotContent.spec.tsx +494 -0
  476. package/src/modules/pivot/SwipePivotContent.test.tsx +502 -0
  477. package/src/modules/pivot/SwipePivotContent.tsx +197 -0
  478. package/src/modules/pivot/SwipePivotTabBar.spec.tsx +882 -0
  479. package/src/modules/pivot/SwipePivotTabBar.tsx +583 -0
  480. package/src/modules/pivot/index.ts +8 -0
  481. package/src/modules/pivot/scaleInputState.spec.ts +219 -0
  482. package/src/modules/pivot/scaleInputState.ts +66 -0
  483. package/src/modules/pivot/types.ts +139 -0
  484. package/src/modules/pivot/usePivot.spec.ts +635 -0
  485. package/src/modules/pivot/usePivot.spec.tsx +186 -0
  486. package/src/modules/pivot/usePivot.tsx +345 -0
  487. package/src/modules/pivot/usePivotSwipeInput.spec.ts +708 -0
  488. package/src/modules/pivot/usePivotSwipeInput.ts +136 -0
  489. package/src/modules/resizer/useResizeDrag.ts +94 -0
  490. package/src/modules/stack/StackContent.spec.tsx +264 -0
  491. package/src/modules/stack/StackContent.tsx +111 -0
  492. package/src/modules/stack/SwipeStackContent.spec.tsx +1564 -0
  493. package/src/modules/stack/SwipeStackContent.tsx +366 -0
  494. package/src/modules/stack/SwipeStackOutlet.spec.tsx +250 -0
  495. package/src/modules/stack/SwipeStackOutlet.tsx +221 -0
  496. package/src/modules/stack/computeStackContentState.spec.ts +281 -0
  497. package/src/modules/stack/computeStackContentState.ts +304 -0
  498. package/src/modules/stack/computeSwipeStackTransform.spec.ts +186 -0
  499. package/src/modules/stack/computeSwipeStackTransform.ts +145 -0
  500. package/src/modules/stack/swipeTransitionContinuity.spec.tsx +1133 -0
  501. package/src/modules/stack/types.ts +226 -0
  502. package/src/modules/stack/useStackAnimationState.spec.ts +188 -0
  503. package/src/modules/stack/useStackAnimationState.ts +143 -0
  504. package/src/modules/stack/useStackNavigation.spec.ts +672 -0
  505. package/src/modules/stack/useStackNavigation.tsx +393 -0
  506. package/src/modules/stack/useStackSwipeInput.spec.ts +309 -0
  507. package/src/modules/stack/useStackSwipeInput.ts +139 -0
  508. package/src/modules/window/useDrawerState.ts +81 -0
  509. package/src/modules/window/useFloatingState.spec.ts +252 -0
  510. package/src/modules/window/useFloatingState.ts +141 -0
  511. package/src/panels/index.ts +119 -0
  512. package/src/pivot/index.ts +19 -0
  513. package/src/resizer/index.ts +68 -0
  514. package/src/stack/index.ts +91 -0
  515. package/src/sticky-header/StickyArea.tsx +193 -0
  516. package/src/sticky-header/calculateStickyMetrics.spec.ts +105 -0
  517. package/src/sticky-header/calculateStickyMetrics.ts +50 -0
  518. package/src/sticky-header/index.ts +18 -0
  519. package/src/sticky-header/types.ts +68 -0
  520. package/src/types.ts +341 -0
  521. package/src/utils/CSSMatrix.ts +321 -0
  522. package/src/utils/css.ts +65 -0
  523. package/src/utils/dialogUtils.ts +43 -0
  524. package/src/utils/math.ts +18 -0
  525. package/src/utils/polyfills/createDialogPolyfill.ts +18 -0
  526. package/src/utils/typedActions.ts +103 -0
  527. package/src/vite-env.d.ts +6 -0
  528. package/src/window/index.ts +69 -0
  529. package/dist/GridLayout-BQQ63eA1.cjs +0 -2
  530. package/dist/GridLayout-BQQ63eA1.cjs.map +0 -1
  531. package/dist/GridLayout-CJTKq7Mp.js +0 -1465
  532. package/dist/GridLayout-CJTKq7Mp.js.map +0 -1
  533. package/dist/sticky-header/StickyHeader.d.ts +0 -53
  534. package/dist/styles-CA2_zLZt.js +0 -52
  535. package/dist/styles-CA2_zLZt.js.map +0 -1
  536. package/dist/styles-PsqGOEJP.cjs +0 -2
  537. package/dist/styles-PsqGOEJP.cjs.map +0 -1
  538. package/dist/usePivot-7ctin_P_.cjs +0 -2
  539. package/dist/usePivot-7ctin_P_.cjs.map +0 -1
  540. package/dist/usePivot-CgQxB8rc.js +0 -124
  541. package/dist/usePivot-CgQxB8rc.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,2010 +1,29 @@
1
- import { u as kt, a as Mt, b as _t, c as J, d as Ot, e as M, t as Bt, R as ot, G as st } from "./GridLayout-CJTKq7Mp.js";
2
- import { D as _n, f as On, F as Bn, r as Ln, g as Hn } from "./GridLayout-CJTKq7Mp.js";
3
- import { jsx as m, jsxs as H, Fragment as et } from "react/jsx-runtime";
4
- import * as u from "react";
5
- import { u as Lt, v as Ht, w as Nt, H as zt, z as $t, A as Ft, B as Xt, E as Yt, I as jt, J as Ut, T as Kt, K as Vt, L as Wt, M as qt, N as Zt, O as Jt, Q as Qt, S as te } from "./styles-CA2_zLZt.js";
6
- import { U as zn } from "./styles-CA2_zLZt.js";
7
- import { u as nt } from "./useIsomorphicLayoutEffect-DhmEnmZ_.js";
8
- import { createPortal as ee } from "react-dom";
9
- import { a as ne } from "./usePivot-CgQxB8rc.js";
10
- const re = (t) => ({
11
- width: zt,
12
- cursor: "col-resize",
13
- position: "relative",
14
- userSelect: "none",
15
- backgroundColor: t === "drag" ? Lt : t === "hover" ? Ht : Nt
16
- }), En = ({ onResize: t, component: e, element: n }) => {
17
- const { ref: r, isDragging: o, onPointerDown: s } = kt({
18
- axis: "x",
19
- onResize: t
20
- }), [a, i] = u.useState(!1), c = {
21
- ref: r,
22
- style: re(o ? "drag" : a ? "hover" : "idle"),
23
- role: "separator",
24
- "aria-orientation": "vertical",
25
- "data-dragging": o ? "true" : void 0,
26
- onPointerDown: s,
27
- onPointerEnter: () => i(!0),
28
- onPointerLeave: () => i(!1)
29
- };
30
- return n ? u.cloneElement(n, c) : e ? /* @__PURE__ */ m(e, { ...c }) : /* @__PURE__ */ m("div", { ...c });
31
- }, Rn = () => {
32
- const { layerId: t } = Mt(), { getLayerHandleProps: e } = _t();
33
- return u.useMemo(() => e(t), [e, t]);
34
- }, it = { left: 0, top: 0 }, at = { width: 400, height: 300 }, Pn = (t) => {
35
- const [e, n] = u.useState(() => {
36
- const l = {};
37
- return t.forEach((p) => {
38
- if (p.floating) {
39
- const g = p.floating;
40
- l[p.id] = {
41
- position: g.defaultPosition ?? it,
42
- size: g.defaultSize ?? at
43
- };
44
- }
45
- }), l;
46
- }), r = u.useMemo(() => {
47
- const l = /* @__PURE__ */ new Map();
48
- return t.forEach((p) => l.set(p.id, p)), l;
49
- }, [t]), o = u.useCallback(
50
- (l) => {
51
- const p = r.get(l);
52
- return p?.floating?.position !== void 0 ? p.floating.position : e[l]?.position ?? it;
53
- },
54
- [r, e]
55
- ), s = u.useCallback(
56
- (l) => {
57
- const p = r.get(l);
58
- return p?.floating?.size !== void 0 ? p.floating.size : e[l]?.size ?? at;
59
- },
60
- [r, e]
61
- ), a = u.useCallback(
62
- (l) => r.get(l)?.floating?.zIndex,
63
- [r]
64
- ), i = u.useCallback(
65
- (l, p) => {
66
- const g = r.get(l);
67
- g?.floating && (g.floating.position === void 0 && n((v) => {
68
- const b = v[l];
69
- return b ? {
70
- ...v,
71
- [l]: { ...b, position: p }
72
- } : v;
73
- }), g.floating.onMove?.(p));
74
- },
75
- [r]
76
- ), c = u.useCallback(
77
- (l, p) => {
78
- const g = r.get(l);
79
- g?.floating && (g.floating.size === void 0 && n((v) => {
80
- const b = v[l];
81
- return b ? {
82
- ...v,
83
- [l]: { ...b, size: p }
84
- } : v;
85
- }), g.floating.onResize?.(p));
86
- },
87
- [r]
88
- ), d = u.useCallback(
89
- (l) => {
90
- r.get(l)?.floating?.onClose?.();
91
- },
92
- [r]
93
- );
94
- return {
95
- getPosition: o,
96
- getSize: s,
97
- getZIndex: a,
98
- updatePosition: i,
99
- updateSize: c,
100
- close: d
101
- };
102
- }, ft = u.createContext(null), oe = () => {
103
- const t = u.useContext(ft);
104
- if (!t)
105
- throw new Error("useKeybindings must be used within KeybindingsProvider");
106
- return t;
107
- }, se = (t) => {
108
- const e = [];
109
- t.metaKey && e.push("Mod"), t.ctrlKey && e.push("Ctrl"), t.altKey && e.push("Alt"), t.shiftKey && e.push("Shift");
110
- const n = t.key.length === 1 ? t.key.toUpperCase() : t.key;
111
- return e.push(n), e.join("-");
112
- }, ie = ({ children: t, configure: e }) => {
113
- const n = u.useRef({}), r = u.useCallback((a, i) => {
114
- n.current = { ...n.current, [a]: i };
115
- }, []), o = u.useCallback((a) => {
116
- const i = { ...n.current };
117
- delete i[a], n.current = i;
118
- }, []);
119
- u.useEffect(() => {
120
- const a = (i) => {
121
- const c = se(i), d = n.current[c];
122
- d && d(i);
123
- };
124
- return window.addEventListener("keydown", a), () => {
125
- window.removeEventListener("keydown", a);
126
- };
127
- }, []);
128
- const s = u.useMemo(() => ({ register: r, unregister: o }), [r, o]);
129
- return u.useEffect(() => {
130
- e && e(s);
131
- }, [s, e]), /* @__PURE__ */ m(ft.Provider, { value: s, children: t });
132
- }, ae = (t, e) => {
133
- t.register("Mod-\\", (n) => {
134
- n.preventDefault(), e.splitFocused("vertical");
135
- }), t.register("Mod-Shift-\\", (n) => {
136
- n.preventDefault(), e.splitFocused("horizontal");
137
- });
138
- for (const n of [1, 2, 3, 4, 5, 6, 7, 8, 9])
139
- t.register(`Mod-${String(n)}`, (r) => {
140
- r.preventDefault(), e.focusGroupIndex(n);
141
- });
142
- t.register("Alt-ArrowRight", (n) => {
143
- n.preventDefault(), e.focusNextGroup();
144
- }), t.register("Alt-ArrowLeft", (n) => {
145
- n.preventDefault(), e.focusPrevGroup();
146
- });
147
- }, ce = (t) => t.type === "group", gt = (t, e = { x: 0, y: 0, w: 100, h: 100 }) => {
148
- const n = /* @__PURE__ */ new Map(), r = (o, s) => {
149
- if (ce(o)) {
150
- n.set(o.groupId, s);
151
- return;
152
- }
153
- if (o.direction === "vertical") {
154
- const c = s.w * o.ratio, d = s.w - c;
155
- r(o.a, { x: s.x, y: s.y, w: c, h: s.h }), r(o.b, { x: s.x + c, y: s.y, w: d, h: s.h });
156
- return;
157
- }
158
- const a = s.h * o.ratio, i = s.h - a;
159
- r(o.a, { x: s.x, y: s.y, w: s.w, h: a }), r(o.b, { x: s.x, y: s.y + a, w: s.w, h: i });
160
- };
161
- return r(t, e), n;
162
- }, ue = (t, e) => {
163
- const n = gt(t.tree), r = {
164
- areas: [["root"]],
165
- rows: [{ size: "1fr" }],
166
- columns: [{ size: "1fr" }],
167
- gap: "0px",
168
- style: { position: "relative" }
169
- }, o = Array.from(n.entries()).map(([s, a]) => {
170
- const i = {
171
- position: "absolute",
172
- left: `${a.x}%`,
173
- top: `${a.y}%`,
174
- width: `${a.w}%`,
175
- height: `${a.h}%`,
176
- overflow: "hidden",
177
- display: "flex",
178
- flexDirection: "column"
179
- };
180
- return {
181
- id: s,
182
- positionMode: "absolute",
183
- style: i,
184
- component: e(s)
185
- };
186
- });
187
- return { config: r, layers: o };
188
- }, le = (t, e, n) => {
189
- const r = gt(t.tree), o = Array.from(new Set(Array.from(r.values()).flatMap((b) => [b.x, b.x + b.w]))).sort((b, I) => b - I), s = Array.from(new Set(Array.from(r.values()).flatMap((b) => [b.y, b.y + b.h]))).sort((b, I) => b - I), a = o.slice(1).map((b, I) => `${b - o[I]}fr`), i = s.slice(1).map((b, I) => `${b - s[I]}fr`), c = a.map((b) => ({ size: b, resizable: n })), d = i.map((b) => ({ size: b, resizable: n })), l = (b, I, w, T) => {
190
- for (const [h, y] of r.entries())
191
- if (b >= y.x && I <= y.x + y.w && w >= y.y && T <= y.y + y.h)
192
- return h;
193
- return ".";
194
- }, p = [];
195
- for (let b = 0; b < s.length - 1; b += 1) {
196
- const I = [];
197
- for (let w = 0; w < o.length - 1; w += 1)
198
- I.push(l(o[w], o[w + 1], s[b], s[b + 1]));
199
- p.push(I);
200
- }
201
- const g = {
202
- areas: p,
203
- rows: d,
204
- columns: c,
205
- gap: "0px"
206
- }, v = Array.from(r.keys()).map((b) => ({
207
- id: b,
208
- gridArea: b,
209
- component: e(b)
210
- }));
211
- return { config: g, layers: v };
212
- }, bt = u.createContext(null), de = () => {
213
- const t = u.useContext(bt);
214
- if (!t)
215
- throw new Error("usePanelRenderContext must be used within PanelRenderProvider");
216
- return t;
217
- }, pe = ({ value: t, children: e }) => /* @__PURE__ */ m(bt.Provider, { value: t, children: e }), ht = u.createContext(null), mt = () => {
218
- const t = u.useContext(ht);
219
- if (!t)
220
- throw new Error("useDomRegistry must be used within DomRegistryProvider");
221
- return t;
222
- }, fe = ({ children: t }) => {
223
- const e = u.useRef(/* @__PURE__ */ new Map()), n = u.useCallback((c) => {
224
- const d = e.current.get(c);
225
- if (d)
226
- return d;
227
- const l = { group: null, tabbar: null, content: null };
228
- return e.current.set(c, l), l;
229
- }, []), r = u.useCallback(
230
- (c, d) => {
231
- const l = n(c);
232
- if (l.group = d, d === null) {
233
- const p = e.current.get(c);
234
- (p ? p.tabbar === null && p.content === null : !1) && e.current.delete(c);
235
- }
236
- },
237
- [n]
238
- ), o = u.useCallback(
239
- (c, d) => {
240
- const l = n(c);
241
- if (l.tabbar = d, d === null) {
242
- const p = e.current.get(c);
243
- (p ? p.group === null && p.content === null : !1) && e.current.delete(c);
244
- }
245
- },
246
- [n]
247
- ), s = u.useCallback(
248
- (c, d) => {
249
- const l = n(c);
250
- if (l.content = d, d === null) {
251
- const p = e.current.get(c);
252
- (p ? p.group === null && p.tabbar === null : !1) && e.current.delete(c);
253
- }
254
- },
255
- [n]
256
- ), a = u.useCallback(() => e.current, []), i = u.useMemo(() => ({ setGroupEl: r, setTabbarEl: o, setContentEl: s, getAll: a }), [r, o, s, a]);
257
- return /* @__PURE__ */ m(ht.Provider, { value: i, children: t });
258
- }, ge = {
259
- display: "flex",
260
- flexDirection: "column",
261
- width: "100%",
262
- height: "100%"
263
- }, be = {
264
- flex: "1 1 auto",
265
- minWidth: 0,
266
- minHeight: 0,
267
- position: "relative",
268
- overflow: "hidden"
269
- };
270
- function he(t, e, n, r) {
271
- return t ? u.cloneElement(t, n, r) : e ? /* @__PURE__ */ m(e, { ...n, children: r }) : /* @__PURE__ */ m("div", { ...n, children: r });
272
- }
273
- function me(t, e, n, r) {
274
- return t ? u.cloneElement(t, n, r) : e ? /* @__PURE__ */ m(e, { ...n, children: r }) : /* @__PURE__ */ m("div", { ...n, children: r });
275
- }
276
- const ve = ({
277
- group: t,
278
- tabbar: e,
279
- content: n,
280
- onContentPointerDown: r,
281
- groupRef: o,
282
- contentRef: s,
283
- component: a,
284
- element: i,
285
- contentComponent: c,
286
- contentElement: d
287
- }) => {
288
- const l = {
289
- ref: o,
290
- style: ge,
291
- "data-group-id": t.id
292
- }, g = he(d, c, {
293
- ref: s,
294
- style: be,
295
- "data-dnd-zone": "content",
296
- onPointerDown: r
297
- }, n);
298
- return me(i, a, l, /* @__PURE__ */ H(et, { children: [
299
- e,
300
- g
301
- ] }));
302
- }, vt = u.memo(ve, (t, e) => t.group.id !== e.group.id || t.group.activeTabId !== e.group.activeTabId || t.group.tabs.length !== e.group.tabs.length ? !1 : t.group.tabs === e.group.tabs);
303
- vt.displayName = "PanelGroupView";
304
- const U = (t, e, n) => {
305
- const r = t.left, o = t.top, s = t.width, a = t.height, i = e - r, c = n - o, d = s / 3, l = a / 3;
306
- return i > d && i < s - d && c > l && c < a - l ? "center" : i < c && i < s - i && c < a - c ? "left" : s - i < c && s - i < i && c < a - c ? "right" : c < i && c < a - c && i < s - i ? "top" : "bottom";
307
- };
308
- function A(t, e) {
309
- if (!e) {
310
- const r = (() => ({ type: t }));
311
- return Object.defineProperty(r, "type", {
312
- value: t,
313
- writable: !1,
314
- enumerable: !0
315
- }), r;
316
- }
317
- const n = ((...r) => {
318
- const o = e(...r);
319
- return typeof o > "u" ? { type: t } : { type: t, payload: o };
320
- });
321
- return Object.defineProperty(n, "type", {
322
- value: t,
323
- writable: !1,
324
- enumerable: !0
325
- }), n;
326
- }
327
- const Ie = (t, e) => {
328
- const n = {};
329
- return Object.keys(t).forEach((r) => {
330
- const o = t[r];
331
- n[r] = ((...s) => {
332
- const a = o(...s);
333
- return e(a), a;
334
- });
335
- }), n;
336
- }, It = (t, e) => {
337
- const n = {};
338
- return Object.keys(e).forEach((r) => {
339
- const o = e[r];
340
- if (!o)
341
- return;
342
- const s = t[r];
343
- if (!s)
344
- throw new Error(`Missing action creator for key "${String(r)}"`);
345
- n[s.type] = o;
346
- }), n;
347
- }, wt = { phase: { kind: "idle" }, suggest: null, pointer: null, tabbarHover: null, draggingTabElement: null }, D = {
348
- startContent: A(
349
- "START_CONTENT",
350
- (t) => t
351
- ),
352
- startTab: A(
353
- "START_TAB",
354
- (t) => t
355
- ),
356
- setSuggest: A("SET_SUGGEST", (t) => t),
357
- setPointer: A("SET_POINTER", (t) => t),
358
- setTabbarHover: A(
359
- "SET_TABBAR_HOVER",
360
- (t) => t
361
- ),
362
- reset: A("RESET")
363
- }, we = It(D, {
364
- startContent: (t, e) => ({
365
- phase: {
366
- kind: "content",
367
- startX: e.payload.x,
368
- startY: e.payload.y,
369
- fromGroupId: e.payload.groupId,
370
- tabId: e.payload.tabId,
371
- cache: e.payload.cache
372
- },
373
- suggest: null,
374
- pointer: null,
375
- tabbarHover: null,
376
- draggingTabElement: null
377
- }),
378
- startTab: (t, e) => ({
379
- phase: {
380
- kind: "tab",
381
- startX: e.payload.x,
382
- startY: e.payload.y,
383
- fromGroupId: e.payload.groupId,
384
- tabId: e.payload.tabId,
385
- cache: e.payload.cache
386
- },
387
- suggest: null,
388
- pointer: null,
389
- tabbarHover: null,
390
- draggingTabElement: e.payload.element
391
- }),
392
- setSuggest: (t, e) => ({ ...t, suggest: e.payload }),
393
- setPointer: (t, e) => ({ ...t, pointer: e.payload }),
394
- setTabbarHover: (t, e) => ({ ...t, tabbarHover: e.payload }),
395
- reset: () => wt
396
- }), ye = (t, e) => {
397
- const n = we[e.type];
398
- return n ? n(t, e, void 0) : t;
399
- }, yt = u.createContext(null), W = () => {
400
- const t = u.useContext(yt);
401
- if (!t)
402
- throw new Error("usePanelInteractions must be used within InteractionsProvider");
403
- return t;
404
- }, Te = ({
405
- containerRef: t,
406
- dragThresholdPx: e,
407
- onCommitContentDrop: n,
408
- onCommitTabDrop: r,
409
- isContentZoneAllowed: o,
410
- children: s
411
- }) => {
412
- const [a, i] = u.useReducer(ye, wt), c = mt(), d = u.useCallback(() => {
413
- const w = Array.from(c.getAll().entries()), T = w.map(([f, S]) => ({ gid: f, el: S.content ?? S.group })).filter((f) => !!f.el).map((f) => ({ ...f, rect: f.el.getBoundingClientRect() })), h = w.map(([f, S]) => ({ gid: f, el: S.tabbar })).filter((f) => !!f.el).map((f) => ({ ...f, rect: f.el.getBoundingClientRect() })), y = w.map(([f, S]) => ({ gid: f, el: S.content ?? S.group })).filter((f) => !!f.el).map((f) => ({ ...f, rect: f.el.getBoundingClientRect() }));
414
- return { groups: T, tabbars: h, contents: y };
415
- }, [c]), l = J((w) => {
416
- if (!t.current)
417
- return;
418
- const h = w.clientX, y = w.clientY, f = a.phase;
419
- if (f.kind === "idle")
420
- return;
421
- const S = Math.abs(h - f.startX), C = Math.abs(y - f.startY);
422
- if (S < e && C < e) {
423
- a.phase.kind === "content" && i(D.setSuggest(null)), i(D.setPointer(null)), i(D.setTabbarHover(null));
424
- return;
425
- }
426
- if (i(D.setPointer({ x: h, y })), f.kind === "content") {
427
- const G = f.cache.groups.find(({ rect: x }) => h >= x.left && h <= x.right && y >= x.top && y <= x.bottom);
428
- if (!G) {
429
- i(D.setSuggest(null));
430
- return;
431
- }
432
- const R = U(G.rect, h, y);
433
- if (o && !o({ targetGroupId: G.gid, zone: R })) {
434
- i(D.setSuggest(null));
435
- return;
436
- }
437
- i(D.setSuggest({ rect: G.rect, zone: R }));
438
- return;
439
- }
440
- if (f.kind === "tab") {
441
- const G = f.cache.tabbars.find(({ rect: E }) => h >= E.left && h <= E.right && y >= E.top && y <= E.bottom);
442
- if (G) {
443
- const k = Array.from(G.el.querySelectorAll("[role='tab']")).map((z) => z.getBoundingClientRect()), P = k.map((z) => z.left + z.width / 2), O = P.findIndex((z) => h < z), B = O === -1 ? P.length : O, At = k.length === 0 ? G.rect.left + 8 : B === 0 ? k[0].left : B === k.length ? k[k.length - 1].right : (k[B - 1].right + k[B].left) / 2;
444
- i(D.setTabbarHover({ groupId: G.gid, index: B, rect: G.rect, insertX: At }));
445
- } else
446
- i(D.setTabbarHover(null));
447
- const R = f.cache.contents.find(({ rect: E }) => h >= E.left && h <= E.right && y >= E.top && y <= E.bottom);
448
- if (!R) {
449
- i(D.setSuggest(null));
450
- return;
451
- }
452
- const x = U(R.rect, h, y);
453
- if (o && !o({ targetGroupId: R.gid, zone: x })) {
454
- i(D.setSuggest(null));
455
- return;
456
- }
457
- i(D.setSuggest({ rect: R.rect, zone: x }));
458
- }
459
- }), p = J((w) => {
460
- const T = t.current, h = a;
461
- if (i(D.reset()), !T)
462
- return;
463
- const y = w.clientX, f = w.clientY;
464
- if (h.phase.kind === "idle")
465
- return;
466
- const S = Math.abs(y - h.phase.startX), C = Math.abs(f - h.phase.startY);
467
- if (!(S < e && C < e)) {
468
- if (h.phase.kind === "content") {
469
- const G = h.phase.cache.groups.find(({ rect: E }) => y >= E.left && y <= E.right && f >= E.top && f <= E.bottom);
470
- if (!G)
471
- return;
472
- const R = G.gid ?? null;
473
- if (!R)
474
- return;
475
- const x = U(G.rect, y, f);
476
- if (o && !o({ targetGroupId: R, zone: x }))
477
- return;
478
- n({ fromGroupId: h.phase.fromGroupId, tabId: h.phase.tabId, targetGroupId: R, zone: x });
479
- return;
480
- }
481
- if (h.phase.kind === "tab") {
482
- const G = h.phase.cache.tabbars.find(({ rect: x }) => y >= x.left && y <= x.right && f >= x.top && f <= x.bottom);
483
- if (G) {
484
- const x = G.gid;
485
- if (!x)
486
- return;
487
- const k = Array.from(G.el.querySelectorAll("[role='tab']")).map((B) => {
488
- const Z = B.getBoundingClientRect();
489
- return Z.left + Z.width / 2;
490
- }), P = k.findIndex((B) => y < B), O = P === -1 ? k.length : P;
491
- r({ fromGroupId: h.phase.fromGroupId, tabId: h.phase.tabId, targetGroupId: x, targetIndex: O });
492
- return;
493
- }
494
- const R = h.phase.cache.contents.find(({ rect: x }) => y >= x.left && y <= x.right && f >= x.top && f <= x.bottom);
495
- if (R) {
496
- const x = R.gid ?? null;
497
- if (!x)
498
- return;
499
- const E = U(R.rect, y, f);
500
- if (o && !o({ targetGroupId: x, zone: E }))
501
- return;
502
- n({ fromGroupId: h.phase.fromGroupId, tabId: h.phase.tabId, targetGroupId: x, zone: E });
503
- }
504
- }
505
- }
506
- }), g = J(() => {
507
- i(D.reset());
508
- });
509
- u.useEffect(() => {
510
- if (a.phase.kind !== "idle")
511
- return window.addEventListener("pointermove", l), window.addEventListener("pointerup", p, { once: !0 }), window.addEventListener("pointercancel", g, { once: !0 }), () => {
512
- window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", p), window.removeEventListener("pointercancel", g);
513
- };
514
- }, [a.phase.kind]);
515
- const v = u.useCallback((w, T, h) => {
516
- if (h.button !== 0)
517
- return;
518
- h.currentTarget.setPointerCapture(h.pointerId);
519
- const y = d();
520
- i(D.startContent({ x: h.clientX, y: h.clientY, groupId: w, tabId: T, cache: y }));
521
- }, [d]), b = u.useCallback((w, T, h) => {
522
- if (h.button !== 0)
523
- return;
524
- const y = h.currentTarget;
525
- y && y.setPointerCapture(h.pointerId);
526
- const f = d();
527
- i(D.startTab({ x: h.clientX, y: h.clientY, groupId: T, tabId: w, cache: f, element: y }));
528
- }, [d]), I = u.useMemo(() => ({
529
- suggest: a.suggest,
530
- isTabDragging: a.phase.kind === "tab",
531
- draggingTabId: a.phase.kind === "tab" ? a.phase.tabId : null,
532
- dragPointer: a.pointer,
533
- tabbarHover: a.tabbarHover,
534
- draggingTabElement: a.draggingTabElement,
535
- onStartContentDrag: v,
536
- onStartTabDrag: b
537
- }), [a.suggest, a.pointer, a.tabbarHover, a.phase, a.draggingTabElement, v, b]);
538
- return /* @__PURE__ */ m(yt.Provider, { value: I, children: s });
539
- }, ct = {
540
- display: "inline-flex",
541
- alignItems: "center",
542
- userSelect: "none"
543
- }, Se = ({
544
- groupId: t,
545
- tab: e,
546
- active: n,
547
- dragging: r,
548
- onClickTab: o,
549
- onStartDrag: s,
550
- onCloseTab: a,
551
- tabComponent: i,
552
- tabElement: c,
553
- onDoubleClick: d
554
- }) => {
555
- const l = u.useEffectEvent(() => {
556
- o(e.id);
557
- }), p = u.useEffectEvent((I) => {
558
- s && I.button === 0 && s(e.id, t, I);
559
- }), g = () => {
560
- const I = !!a;
561
- return /* @__PURE__ */ m(u.Activity, { mode: I ? "visible" : "hidden", children: /* @__PURE__ */ m(
562
- "button",
563
- {
564
- type: "button",
565
- "aria-label": `Close tab ${e.title}`,
566
- onClick: (w) => {
567
- a && (w.stopPropagation(), a(t, e.id));
568
- },
569
- style: { marginLeft: 6 },
570
- tabIndex: I ? void 0 : -1,
571
- disabled: !I,
572
- "aria-hidden": I ? void 0 : !0,
573
- children: "×"
574
- }
575
- ) });
576
- }, v = {
577
- role: "tab",
578
- "aria-selected": n,
579
- tabIndex: n ? 0 : -1,
580
- style: ct,
581
- onClick: l,
582
- onPointerDown: p,
583
- onDoubleClick: d,
584
- "data-tab-id": e.id,
585
- "data-active": n ? "true" : "false",
586
- "data-dragging": r ? "true" : "false",
587
- children: /* @__PURE__ */ H(et, { children: [
588
- /* @__PURE__ */ m("span", { children: e.title }),
589
- g()
590
- ] })
591
- }, b = {
592
- type: "button",
593
- role: "tab",
594
- "aria-selected": n,
595
- tabIndex: n ? 0 : -1,
596
- style: ct,
597
- onClick: () => {
598
- o(e.id);
599
- },
600
- onPointerDown: (I) => {
601
- s && I.button === 0 && s(e.id, t, I);
602
- },
603
- onDoubleClick: d,
604
- children: /* @__PURE__ */ m("span", { children: e.title })
605
- };
606
- return c ? c(b) : i ? /* @__PURE__ */ m(i, { ...b }) : /* @__PURE__ */ m("div", { ...v });
607
- }, xe = {
608
- display: "flex",
609
- alignItems: "center"
610
- }, Ge = {
611
- flex: "1 1 auto",
612
- alignSelf: "stretch"
613
- }, Ce = ({
614
- group: t,
615
- onClickTab: e,
616
- onStartDrag: n,
617
- rootRef: r,
618
- component: o,
619
- element: s,
620
- tabComponent: a,
621
- tabElement: i,
622
- onAddTab: c,
623
- onCloseTab: d,
624
- doubleClickToAdd: l
625
- }) => {
626
- const { isTabDragging: p, draggingTabId: g } = W(), v = u.useRef(null), b = u.useCallback(
627
- (f) => {
628
- if (v.current = f, !!r) {
629
- if (typeof r == "function") {
630
- r(f);
631
- return;
632
- }
633
- try {
634
- r.current = f;
635
- } catch {
636
- }
637
- }
638
- },
639
- [r]
640
- ), I = u.useEffectEvent((f) => {
641
- const S = v.current ?? f.currentTarget;
642
- if (!S)
643
- return;
644
- const C = Array.from(S.querySelectorAll('[role="tab"]'));
645
- if (C.length === 0)
646
- return;
647
- const G = (P) => {
648
- const O = Math.max(0, Math.min(P, C.length - 1)), B = C[O];
649
- B && B.focus();
650
- }, R = document.activeElement, x = R ? C.indexOf(R) : C.findIndex((P) => P.getAttribute("data-tab-id") === t.activeTabId);
651
- if (f.key === "ArrowRight") {
652
- f.preventDefault();
653
- const P = x >= 0 ? x + 1 : 0;
654
- G(P >= C.length ? 0 : P);
655
- return;
656
- }
657
- if (f.key === "ArrowLeft") {
658
- f.preventDefault();
659
- const P = x >= 0 ? x - 1 : C.length - 1;
660
- G(P < 0 ? C.length - 1 : P);
661
- return;
662
- }
663
- if (f.key === "Home") {
664
- f.preventDefault(), G(0);
665
- return;
666
- }
667
- if (f.key === "End") {
668
- f.preventDefault(), G(C.length - 1);
669
- return;
670
- }
671
- if (f.key === "Enter" || f.key === " ") {
672
- f.preventDefault();
673
- const O = (x >= 0 ? C[x] : null)?.getAttribute("data-tab-id") ?? null;
674
- O && e(O);
675
- return;
676
- }
677
- if (f.key === "Delete" || f.key === "Backspace") {
678
- if (d) {
679
- f.preventDefault();
680
- const O = (x >= 0 ? C[x] : null)?.getAttribute("data-tab-id") ?? null;
681
- O && d(t.id, O);
682
- }
683
- return;
684
- }
685
- const E = (f.ctrlKey ? 1 : 0) + (f.metaKey ? 1 : 0) > 0, k = typeof f.key == "string" ? f.key.toLowerCase() : "";
686
- if (E && k === "t") {
687
- c && (f.preventDefault(), c(t.id));
688
- return;
689
- }
690
- });
691
- u.useEffect(() => {
692
- const f = v.current;
693
- if (!f)
694
- return;
695
- const S = f.querySelector(`[role="tab"][data-tab-id="${t.activeTabId}"]`);
696
- if (S === document.activeElement)
697
- return;
698
- !f.contains(document.activeElement) && S && S.focus();
699
- }, [t.activeTabId]);
700
- const w = {
701
- style: xe,
702
- role: "tablist",
703
- "data-tabbar": "true",
704
- "data-group-id": t.id,
705
- "data-dragging": p ? "true" : "false",
706
- onKeyDown: I
707
- }, T = Ot({
708
- element: s,
709
- component: o
710
- }), h = () => c ? /* @__PURE__ */ m(
711
- "button",
712
- {
713
- type: "button",
714
- "aria-label": "Add tab",
715
- onClick: () => {
716
- c(t.id);
717
- },
718
- children: "+"
719
- }
720
- ) : null, y = u.useCallback(() => {
721
- l && c && c(t.id);
722
- }, [l, c, t.id]);
723
- return /* @__PURE__ */ H(T, { ...w, ref: b, onDoubleClick: y, children: [
724
- t.tabs.map((f, S) => /* @__PURE__ */ m(
725
- Se,
726
- {
727
- groupId: t.id,
728
- tab: f,
729
- active: t.activeTabId === f.id,
730
- dragging: g === f.id,
731
- onClickTab: e,
732
- onStartDrag: n,
733
- onCloseTab: d,
734
- tabComponent: a,
735
- tabElement: i,
736
- onDoubleClick: (C) => C.stopPropagation()
737
- },
738
- `${t.id}:${f.id}:${S}`
739
- )),
740
- /* @__PURE__ */ m("span", { style: Ge }),
741
- h()
742
- ] });
743
- }, Ee = ({ id: t, TabBarComponent: e, PanelGroupComponent: n }) => {
744
- const { getGroup: r, getGroupContent: o, onClickTab: s, onAddTab: a, onCloseTab: i, onStartTabDrag: c, doubleClickToAdd: d, registerContentContainer: l } = de(), { setGroupEl: p, setTabbarEl: g, setContentEl: v } = mt(), b = u.useCallback(
745
- (S) => {
746
- p(t, S);
747
- },
748
- [t, p]
749
- ), I = u.useCallback(
750
- (S) => {
751
- v(t, S), l(t, S);
752
- },
753
- [t, v, l]
754
- ), w = u.useCallback(
755
- (S) => {
756
- g(t, S);
757
- },
758
- [t, g]
759
- ), T = r(t);
760
- if (!T)
761
- return null;
762
- const h = o(t);
763
- return /* @__PURE__ */ m(
764
- n ?? ((S) => /* @__PURE__ */ m(vt, { ...S })),
765
- {
766
- group: T,
767
- tabbar: /* @__PURE__ */ m(
768
- e ?? Ce,
769
- {
770
- rootRef: w,
771
- group: T,
772
- onClickTab: (S) => s(t, S),
773
- onAddTab: a,
774
- onCloseTab: i,
775
- onStartDrag: (S, C, G) => c(S, C, G),
776
- doubleClickToAdd: d
777
- }
778
- ),
779
- content: h,
780
- groupRef: b,
781
- contentRef: I
782
- }
783
- );
784
- }, Re = (t, e) => {
785
- const n = new Array(16);
786
- for (let r = 0; r < 4; r++)
787
- for (let o = 0; o < 4; o++)
788
- n[r * 4 + o] = t[0 + o] * e[r * 4 + 0] + t[4 + o] * e[r * 4 + 1] + t[8 + o] * e[r * 4 + 2] + t[12 + o] * e[r * 4 + 3];
789
- return n;
790
- }, K = (t) => {
791
- if (t.length !== 16)
792
- throw new Error("Matrix must have exactly 16 values");
793
- const e = Object.freeze([...t]), n = (r) => {
794
- const o = Re(e, r);
795
- return K(o);
796
- };
797
- return Object.freeze({
798
- translate: (r = 0, o = 0, s = 0) => n([
799
- 1,
800
- 0,
801
- 0,
802
- 0,
803
- 0,
804
- 1,
805
- 0,
806
- 0,
807
- 0,
808
- 0,
809
- 1,
810
- 0,
811
- r,
812
- o,
813
- s,
814
- 1
815
- ]),
816
- translate3d: (r, o, s) => n([
817
- 1,
818
- 0,
819
- 0,
820
- 0,
821
- 0,
822
- 1,
823
- 0,
824
- 0,
825
- 0,
826
- 0,
827
- 1,
828
- 0,
829
- r,
830
- o,
831
- s,
832
- 1
833
- ]),
834
- translateX: (r) => n([
835
- 1,
836
- 0,
837
- 0,
838
- 0,
839
- 0,
840
- 1,
841
- 0,
842
- 0,
843
- 0,
844
- 0,
845
- 1,
846
- 0,
847
- r,
848
- 0,
849
- 0,
850
- 1
851
- ]),
852
- translateY: (r) => n([
853
- 1,
854
- 0,
855
- 0,
856
- 0,
857
- 0,
858
- 1,
859
- 0,
860
- 0,
861
- 0,
862
- 0,
863
- 1,
864
- 0,
865
- 0,
866
- r,
867
- 0,
868
- 1
869
- ]),
870
- translateZ: (r) => n([
871
- 1,
872
- 0,
873
- 0,
874
- 0,
875
- 0,
876
- 1,
877
- 0,
878
- 0,
879
- 0,
880
- 0,
881
- 1,
882
- 0,
883
- 0,
884
- 0,
885
- r,
886
- 1
887
- ]),
888
- scale: (r = 1, o = 1, s = 1) => n([
889
- r,
890
- 0,
891
- 0,
892
- 0,
893
- 0,
894
- o,
895
- 0,
896
- 0,
897
- 0,
898
- 0,
899
- s,
900
- 0,
901
- 0,
902
- 0,
903
- 0,
904
- 1
905
- ]),
906
- scale3d: (r, o, s) => n([
907
- r,
908
- 0,
909
- 0,
910
- 0,
911
- 0,
912
- o,
913
- 0,
914
- 0,
915
- 0,
916
- 0,
917
- s,
918
- 0,
919
- 0,
920
- 0,
921
- 0,
922
- 1
923
- ]),
924
- scaleX: (r) => n([
925
- r,
926
- 0,
927
- 0,
928
- 0,
929
- 0,
930
- 1,
931
- 0,
932
- 0,
933
- 0,
934
- 0,
935
- 1,
936
- 0,
937
- 0,
938
- 0,
939
- 0,
940
- 1
941
- ]),
942
- scaleY: (r) => n([
943
- 1,
944
- 0,
945
- 0,
946
- 0,
947
- 0,
948
- r,
949
- 0,
950
- 0,
951
- 0,
952
- 0,
953
- 1,
954
- 0,
955
- 0,
956
- 0,
957
- 0,
958
- 1
959
- ]),
960
- scaleZ: (r) => n([
961
- 1,
962
- 0,
963
- 0,
964
- 0,
965
- 0,
966
- 1,
967
- 0,
968
- 0,
969
- 0,
970
- 0,
971
- r,
972
- 0,
973
- 0,
974
- 0,
975
- 0,
976
- 1
977
- ]),
978
- rotateX: (r) => {
979
- const o = Math.cos(r), s = Math.sin(r);
980
- return n([
981
- 1,
982
- 0,
983
- 0,
984
- 0,
985
- 0,
986
- o,
987
- s,
988
- 0,
989
- 0,
990
- -s,
991
- o,
992
- 0,
993
- 0,
994
- 0,
995
- 0,
996
- 1
997
- ]);
998
- },
999
- rotateY: (r) => {
1000
- const o = Math.cos(r), s = Math.sin(r);
1001
- return n([
1002
- o,
1003
- 0,
1004
- -s,
1005
- 0,
1006
- 0,
1007
- 1,
1008
- 0,
1009
- 0,
1010
- s,
1011
- 0,
1012
- o,
1013
- 0,
1014
- 0,
1015
- 0,
1016
- 0,
1017
- 1
1018
- ]);
1019
- },
1020
- rotateZ: (r) => {
1021
- const o = Math.cos(r), s = Math.sin(r);
1022
- return n([
1023
- o,
1024
- s,
1025
- 0,
1026
- 0,
1027
- -s,
1028
- o,
1029
- 0,
1030
- 0,
1031
- 0,
1032
- 0,
1033
- 1,
1034
- 0,
1035
- 0,
1036
- 0,
1037
- 0,
1038
- 1
1039
- ]);
1040
- },
1041
- rotate: (r, o, s, a) => {
1042
- const i = Math.sqrt(o * o + s * s + a * a);
1043
- if (i === 0)
1044
- return K(e);
1045
- o /= i, s /= i, a /= i;
1046
- const c = Math.cos(r), d = Math.sin(r), l = 1 - c;
1047
- return n([
1048
- l * o * o + c,
1049
- l * o * s + d * a,
1050
- l * o * a - d * s,
1051
- 0,
1052
- l * o * s - d * a,
1053
- l * s * s + c,
1054
- l * s * a + d * o,
1055
- 0,
1056
- l * o * a + d * s,
1057
- l * s * a - d * o,
1058
- l * a * a + c,
1059
- 0,
1060
- 0,
1061
- 0,
1062
- 0,
1063
- 1
1064
- ]);
1065
- },
1066
- rotate3d: (r, o, s, a) => {
1067
- const i = Math.sqrt(r * r + o * o + s * s);
1068
- if (i === 0)
1069
- return K(e);
1070
- r /= i, o /= i, s /= i;
1071
- const c = Math.cos(a), d = Math.sin(a), l = 1 - c;
1072
- return n([
1073
- l * r * r + c,
1074
- l * r * o + d * s,
1075
- l * r * s - d * o,
1076
- 0,
1077
- l * r * o - d * s,
1078
- l * o * o + c,
1079
- l * o * s + d * r,
1080
- 0,
1081
- l * r * s + d * o,
1082
- l * o * s - d * r,
1083
- l * s * s + c,
1084
- 0,
1085
- 0,
1086
- 0,
1087
- 0,
1088
- 1
1089
- ]);
1090
- },
1091
- skew: (r = 0, o = 0) => {
1092
- const s = Math.tan(r), a = Math.tan(o);
1093
- return n([
1094
- 1,
1095
- a,
1096
- 0,
1097
- 0,
1098
- s,
1099
- 1,
1100
- 0,
1101
- 0,
1102
- 0,
1103
- 0,
1104
- 1,
1105
- 0,
1106
- 0,
1107
- 0,
1108
- 0,
1109
- 1
1110
- ]);
1111
- },
1112
- skewX: (r) => {
1113
- const o = Math.tan(r);
1114
- return n([
1115
- 1,
1116
- 0,
1117
- 0,
1118
- 0,
1119
- o,
1120
- 1,
1121
- 0,
1122
- 0,
1123
- 0,
1124
- 0,
1125
- 1,
1126
- 0,
1127
- 0,
1128
- 0,
1129
- 0,
1130
- 1
1131
- ]);
1132
- },
1133
- skewY: (r) => {
1134
- const o = Math.tan(r);
1135
- return n([
1136
- 1,
1137
- o,
1138
- 0,
1139
- 0,
1140
- 0,
1141
- 1,
1142
- 0,
1143
- 0,
1144
- 0,
1145
- 0,
1146
- 1,
1147
- 0,
1148
- 0,
1149
- 0,
1150
- 0,
1151
- 1
1152
- ]);
1153
- },
1154
- perspective: (r) => {
1155
- if (r === 0)
1156
- throw new Error("Perspective distance cannot be zero");
1157
- return n([
1158
- 1,
1159
- 0,
1160
- 0,
1161
- 0,
1162
- 0,
1163
- 1,
1164
- 0,
1165
- 0,
1166
- 0,
1167
- 0,
1168
- 1,
1169
- -1 / r,
1170
- 0,
1171
- 0,
1172
- 0,
1173
- 1
1174
- ]);
1175
- },
1176
- toCSS: () => `matrix3d(${e.join(", ")})`,
1177
- toArray: () => e,
1178
- toString: () => [
1179
- `[${e[0]}, ${e[4]}, ${e[8]}, ${e[12]}]`,
1180
- `[${e[1]}, ${e[5]}, ${e[9]}, ${e[13]}]`,
1181
- `[${e[2]}, ${e[6]}, ${e[10]}, ${e[14]}]`,
1182
- `[${e[3]}, ${e[7]}, ${e[11]}, ${e[15]}]`
1183
- ].join(`
1184
- `)
1185
- });
1186
- }, Pe = () => K([
1187
- 1,
1188
- 0,
1189
- 0,
1190
- 0,
1191
- 0,
1192
- 1,
1193
- 0,
1194
- 0,
1195
- 0,
1196
- 0,
1197
- 1,
1198
- 0,
1199
- 0,
1200
- 0,
1201
- 0,
1202
- 1
1203
- ]), De = {
1204
- position: "fixed",
1205
- inset: 0,
1206
- pointerEvents: "none",
1207
- zIndex: $t
1208
- }, Ae = {
1209
- position: "absolute",
1210
- border: `${Yt} dashed ${jt}`,
1211
- background: Xt,
1212
- borderRadius: Ft,
1213
- transformOrigin: "top left"
1214
- }, L = (t, e) => e <= 0 ? 0 : M(t / e, 0), ke = (t, e, n) => {
1215
- const { width: r, height: o } = t, s = n / 2, a = r > 0 ? r : 1, i = o > 0 ? o : 1, c = {
1216
- translateX: n,
1217
- translateY: n,
1218
- scaleX: L(M(r - n * 2, 0), a),
1219
- scaleY: L(M(o - n * 2, 0), i)
1220
- }, d = {
1221
- translateX: n,
1222
- translateY: n,
1223
- scaleX: L(M(r / 2 - n * 1.5, 0), a),
1224
- scaleY: L(M(o - n * 2, 0), i)
1225
- }, l = {
1226
- translateX: r / 2 + s,
1227
- translateY: n,
1228
- scaleX: L(M(r / 2 - n * 1.5, 0), a),
1229
- scaleY: L(M(o - n * 2, 0), i)
1230
- }, p = {
1231
- translateX: n,
1232
- translateY: n,
1233
- scaleX: L(M(r - n * 2, 0), a),
1234
- scaleY: L(M(o / 2 - n * 1.5, 0), i)
1235
- }, g = {
1236
- translateX: n,
1237
- translateY: o / 2 + s,
1238
- scaleX: L(M(r - n * 2, 0), a),
1239
- scaleY: L(M(o / 2 - n * 1.5, 0), i)
1240
- }, v = {
1241
- center: c,
1242
- left: d,
1243
- right: l,
1244
- top: p,
1245
- bottom: g
1246
- }, { translateX: b, translateY: I, scaleX: w, scaleY: T } = v[e];
1247
- return Pe().translate(b, I, 0).scale(w, T, 1).toCSS();
1248
- }, Me = (t, e) => {
1249
- const n = Ut;
1250
- return {
1251
- ...Ae,
1252
- left: t.left,
1253
- top: t.top,
1254
- width: t.width,
1255
- height: t.height,
1256
- transform: ke(t, e, n)
1257
- };
1258
- }, _e = ({ suggest: t }) => {
1259
- if (!t)
1260
- return null;
1261
- const { rect: e, zone: n } = t, r = Me(e, n);
1262
- return /* @__PURE__ */ m("div", { style: De, children: /* @__PURE__ */ m("div", { style: r }) });
1263
- }, Oe = typeof window < "u" && typeof document < "u", Be = (t) => {
1264
- const [e, n] = u.useState(null), [r, o] = u.useState(null);
1265
- return nt(() => {
1266
- if (!Oe || !t) {
1267
- n(null), o(null);
1268
- return;
1269
- }
1270
- const s = t.getBoundingClientRect();
1271
- n({ width: s.width, height: s.height }), o(t.outerHTML);
1272
- }, [t]), { html: r, size: e };
1273
- }, Le = {
1274
- position: "fixed",
1275
- inset: 0,
1276
- pointerEvents: "none",
1277
- zIndex: Qt
1278
- }, He = {
1279
- position: "absolute",
1280
- width: Jt,
1281
- borderRadius: Zt,
1282
- background: qt,
1283
- boxShadow: Wt
1284
- }, Ne = () => {
1285
- const { isTabDragging: t, draggingTabId: e, dragPointer: n, tabbarHover: r, draggingTabElement: o } = W(), { html: s, size: a } = Be(o), i = n !== null && e !== null, c = u.useMemo(() => {
1286
- if (!(!i || !n))
1287
- return {
1288
- position: "absolute",
1289
- left: n.x,
1290
- top: n.y,
1291
- transform: `translate(${Kt}, ${Vt})`,
1292
- pointerEvents: "none"
1293
- };
1294
- }, [i, n]), d = u.useMemo(() => {
1295
- if (!(!c || !o))
1296
- return a ? { ...c, width: a.width, height: a.height } : c;
1297
- }, [c, o, a]), l = u.useMemo(() => {
1298
- if (r)
1299
- return {
1300
- ...He,
1301
- left: r.insertX,
1302
- top: r.rect.top + 4,
1303
- height: Math.max(0, r.rect.height - 8)
1304
- };
1305
- }, [r]);
1306
- return t ? /* @__PURE__ */ H("div", { style: Le, children: [
1307
- /* @__PURE__ */ m(u.Activity, { mode: d ? "visible" : "hidden", children: /* @__PURE__ */ m("div", { style: d, children: /* @__PURE__ */ m(
1308
- "div",
1309
- {
1310
- style: { width: "100%", height: "100%", pointerEvents: "none" },
1311
- dangerouslySetInnerHTML: { __html: s ?? "" }
1312
- }
1313
- ) }) }),
1314
- /* @__PURE__ */ m(u.Activity, { mode: l ? "visible" : "hidden", children: /* @__PURE__ */ m("div", { style: l }) })
1315
- ] }) : null;
1316
- }, _ = (t) => t.type === "group", Y = (t, e = []) => {
1317
- if (_(t))
1318
- return [...e, t.groupId];
1319
- const n = Y(t.a, e);
1320
- return Y(t.b, n);
1321
- }, q = (t, e) => e.reduce((n, r) => _(n) ? n : n[r], t), j = (t, e, n) => {
1322
- if (e.length === 0)
1323
- return n;
1324
- const [r, ...o] = e;
1325
- return _(t) ? t : r === "a" ? { ...t, a: j(t.a, o, n) } : { ...t, b: j(t.b, o, n) };
1326
- }, V = (t, e, n = []) => {
1327
- if (_(t))
1328
- return t.groupId === e ? { splitPath: null, side: null } : null;
1329
- if (_(t.a) && t.a.groupId === e)
1330
- return { splitPath: n, side: "a" };
1331
- if (_(t.b) && t.b.groupId === e)
1332
- return { splitPath: n, side: "b" };
1333
- const r = V(t.a, e, [...n, "a"]);
1334
- return r || V(t.b, e, [...n, "b"]);
1335
- }, Tt = (t, e, n, r) => {
1336
- const o = r(), s = V(t, e), a = {
1337
- type: "split",
1338
- direction: n,
1339
- ratio: 0.5,
1340
- a: { type: "group", groupId: e },
1341
- b: { type: "group", groupId: o }
1342
- };
1343
- if (!s || s.splitPath === null)
1344
- return { tree: a, newGroupId: o };
1345
- const i = s.splitPath, c = q(t, i);
1346
- if (_(c))
1347
- return { tree: a, newGroupId: o };
1348
- const d = s.side === "a" ? { ...c, a } : { ...c, b: a };
1349
- return { tree: j(t, i, d), newGroupId: o };
1350
- }, ze = (t, e) => {
1351
- const n = V(t, e);
1352
- if (!n || n.splitPath === null)
1353
- return { tree: t, survivorGroupId: e };
1354
- const r = n.splitPath, o = q(t, r);
1355
- if (_(o))
1356
- return { tree: t, survivorGroupId: e };
1357
- const s = n.side === "a" ? o.b : o.a, a = j(t, r, s), i = _(s) ? s.groupId : Y(s)[0] ?? null;
1358
- return { tree: a, survivorGroupId: i };
1359
- }, $e = (t, e, n) => {
1360
- const r = q(t, e);
1361
- if (_(r))
1362
- return t;
1363
- const o = { ...r, ratio: M(n, 0.05, 0.95) };
1364
- return j(t, e, o);
1365
- }, Q = (t) => {
1366
- if (Object.keys(t.groups).filter((o) => t.groups[o].tabIds.length === 0).length === 0)
1367
- return t;
1368
- const r = (o, s) => {
1369
- const a = o.groups[s];
1370
- if (!a || a.tabs.length > 0 || Object.keys(o.groups).length <= 1)
1371
- return o;
1372
- const { tree: c, survivorGroupId: d } = ze(o.tree, s), { [s]: l, ...p } = o.groups, g = Y(c), v = o.focusedGroupId === s ? d ?? g[0] ?? null : o.focusedGroupId;
1373
- return { ...o, tree: c, groups: p, groupOrder: g, focusedGroupId: v };
1374
- };
1375
- return t.groupOrder.reduce((o, s) => r(o, s), t);
1376
- }, Fe = (t) => ({ id: t, tabIds: [], tabs: [], activeTabId: null }), ut = (t, e, n, r) => {
1377
- const o = { ...t.groups }, s = o[e];
1378
- if (!s)
1379
- throw new Error(`Group ${e} does not exist.`);
1380
- const a = { ...t.panels, [n.id]: n }, i = [...s.tabIds, n.id], c = r ? n.id : s.activeTabId ?? n.id, d = i.map((p) => a[p]), l = { ...s, tabIds: i, tabs: d, activeTabId: c };
1381
- return o[e] = l, { ...t, panels: a, groups: o };
1382
- }, Xe = (t, e, n) => {
1383
- const r = { ...t.groups }, o = r[e];
1384
- if (!o)
1385
- throw new Error(`Group ${e} does not exist.`);
1386
- const s = o.tabIds.filter((c) => c !== n), a = s.map((c) => t.panels[c]), i = o.activeTabId === n ? s[0] ?? null : o.activeTabId;
1387
- return r[e] = { ...o, tabIds: s, tabs: a, activeTabId: i }, { ...t, groups: r };
1388
- }, lt = (t, e, n, r, o) => {
1389
- const s = t.groups[e], a = t.groups[n];
1390
- if (!s || !a)
1391
- throw new Error("moveTab: source or target group is missing.");
1392
- const i = { ...t.groups }, c = s.tabIds.filter((p) => p !== r), d = [...a.tabIds.filter((p) => p !== r), r], l = s.activeTabId === r ? c[0] ?? null : s.activeTabId;
1393
- return i[e] = { ...s, tabIds: c, tabs: c.map((p) => t.panels[p]), activeTabId: l }, i[n] = { ...a, tabIds: d, tabs: d.map((p) => t.panels[p]), activeTabId: r }, { ...t, groups: i };
1394
- }, St = (t, e, n) => {
1395
- const r = t.groups[e];
1396
- if (!r)
1397
- throw new Error(`setActiveTab: group ${e} not found.`);
1398
- if (!r.tabIds.some((s) => s === n))
1399
- throw new Error(`setActiveTab: tab ${n} not found in group ${e}.`);
1400
- const o = { ...t.groups, [e]: { ...r, activeTabId: n } };
1401
- return { ...t, groups: o, focusedGroupId: e };
1402
- }, dt = (t, e, n, r, o) => {
1403
- const s = t.groups[e];
1404
- if (!s)
1405
- throw new Error(`addTabToGroupAtIndex: group ${e} not found.`);
1406
- const a = { ...t.panels, [n.id]: n }, i = s.tabIds.slice(), c = Math.max(0, Math.min(r, i.length));
1407
- i.splice(c, 0, n.id);
1408
- const d = i.map((g) => a[g]), l = o ? n.id : s.activeTabId ?? n.id, p = { ...t.groups, [e]: { ...s, tabIds: i, tabs: d, activeTabId: l } };
1409
- return { ...t, panels: a, groups: p };
1410
- }, N = (t, e) => {
1411
- if (!t.groups[e])
1412
- throw new Error(`setFocusedGroup: group ${e} not found.`);
1413
- return { ...t, focusedGroupId: e };
1414
- }, Ye = (t, e) => {
1415
- const n = e - 1, r = t.groupOrder[n];
1416
- return r ? N(t, r) : t;
1417
- }, je = (t) => {
1418
- const e = t.groupOrder, n = t.focusedGroupId;
1419
- if (!n) {
1420
- const s = e[0];
1421
- return s ? N(t, s) : t;
1422
- }
1423
- const r = e.indexOf(n), o = e[(r + 1) % e.length];
1424
- return N(t, o);
1425
- }, Ue = (t) => {
1426
- const e = t.groupOrder, n = t.focusedGroupId;
1427
- if (!n) {
1428
- const s = e[e.length - 1];
1429
- return s ? N(t, s) : t;
1430
- }
1431
- const r = e.indexOf(n), o = e[(r - 1 + e.length) % e.length];
1432
- return N(t, o);
1433
- }, xt = (t, e, n, r) => {
1434
- const { tree: o, newGroupId: s } = Tt(t.tree, e, n, r), a = { ...t.groups, [s]: Fe(s) }, i = Y(o);
1435
- return { ...t, tree: o, groups: a, groupOrder: i, focusedGroupId: s };
1436
- }, Dn = (t) => {
1437
- const n = { type: "group", groupId: "g_1" }, r = Object.fromEntries(t.map((i) => [i.id, i])), s = { g_1: { id: "g_1", tabIds: t.map((i) => i.id), tabs: t, activeTabId: t[0]?.id ?? null } };
1438
- return { tree: n, panels: r, groups: s, groupOrder: ["g_1"], focusedGroupId: "g_1" };
1439
- }, Ke = u.createContext(null), Ve = ({ value: t, children: e }) => /* @__PURE__ */ m(Ke.Provider, { value: t, children: e }), Gt = u.createContext(null), We = () => {
1440
- const t = u.useContext(Gt);
1441
- if (!t)
1442
- throw new Error("useTree must be used within TreeProvider");
1443
- return t;
1444
- }, qe = ({ value: t, children: e }) => /* @__PURE__ */ m(Gt.Provider, { value: t, children: e }), Ze = u.createContext(null), Je = ({ value: t, children: e }) => /* @__PURE__ */ m(Ze.Provider, { value: t, children: e }), F = (t) => {
1445
- const e = Bt(t, Number.POSITIVE_INFINITY);
1446
- return M(e, 1);
1447
- }, Qe = (t) => typeof t == "object" && t !== null, tn = (t) => Qe(t) ? "rows" in t ? !0 : "cols" in t : !1, Ct = (t) => {
1448
- if (!t)
1449
- return {
1450
- rows: Number.POSITIVE_INFINITY,
1451
- cols: Number.POSITIVE_INFINITY
1452
- };
1453
- if (typeof t == "number") {
1454
- const n = F(t);
1455
- return { rows: n, cols: n };
1456
- }
1457
- if (tn(t))
1458
- return {
1459
- rows: F(t.rows),
1460
- cols: F(t.cols)
1461
- };
1462
- const e = t;
1463
- return {
1464
- rows: F(e.maxHorizontal),
1465
- cols: F(e.maxVertical)
1466
- };
1467
- }, tt = (t) => {
1468
- if (_(t))
1469
- return { horizontal: 1, vertical: 1 };
1470
- const e = tt(t.a), n = tt(t.b);
1471
- return t.direction === "horizontal" ? { horizontal: e.horizontal + n.horizontal, vertical: Math.max(e.vertical, n.vertical) } : { horizontal: Math.max(e.horizontal, n.horizontal), vertical: e.vertical + n.vertical };
1472
- }, en = (t, e, n) => {
1473
- const { tree: r } = Tt(t, e, n, () => "__preview__");
1474
- return r;
1475
- }, rt = (t, e, n, r) => {
1476
- if (!Number.isFinite(r.rows) && !Number.isFinite(r.cols))
1477
- return !0;
1478
- const o = en(t, e, n), s = tt(o);
1479
- return !(s.horizontal > r.rows || s.vertical > r.cols);
1480
- }, Et = {
1481
- splitFocused: A("panelState/splitFocused", (t) => ({ direction: t })),
1482
- focusGroupIndex: A("panelState/focusGroupIndex", (t) => ({ index1Based: t })),
1483
- focusNextGroup: A("panelState/focusNextGroup"),
1484
- focusPrevGroup: A("panelState/focusPrevGroup"),
1485
- setActiveTab: A("panelState/setActiveTab", (t, e) => ({ groupId: t, tabId: e })),
1486
- addTab: A(
1487
- "panelState/addTab",
1488
- (t) => t
1489
- ),
1490
- addNewTab: A(
1491
- "panelState/addNewTab",
1492
- (t) => t
1493
- ),
1494
- removeTab: A("panelState/removeTab", (t, e) => ({ groupId: t, tabId: e })),
1495
- contentDrop: A(
1496
- "panelState/contentDrop",
1497
- (t) => t
1498
- ),
1499
- tabDrop: A(
1500
- "panelState/tabDrop",
1501
- (t) => t
1502
- ),
1503
- adjustSplitRatio: A("panelState/adjustSplitRatio", (t) => t)
1504
- }, nn = (t, e, n) => {
1505
- const r = t.groups[e.fromGroupId], o = t.groups[e.targetGroupId];
1506
- if (!r || !o || !r.tabs.find((p) => p.id === e.tabId))
1507
- return t;
1508
- if (e.zone === "center" && e.fromGroupId === e.targetGroupId)
1509
- return St(t, e.fromGroupId, e.tabId);
1510
- if (e.zone === "center") {
1511
- const p = lt(t, e.fromGroupId, e.targetGroupId, e.tabId);
1512
- return N(p, e.targetGroupId);
1513
- }
1514
- const a = e.zone === "left" || e.zone === "right" ? "vertical" : "horizontal";
1515
- if (!rt(t.tree, e.targetGroupId, a, n.splitLimits))
1516
- return t;
1517
- const i = n.createGroupId(), c = xt(t, e.targetGroupId, a, () => i), d = e.zone === "left" || e.zone === "top" ? e.targetGroupId : i, l = lt(c, e.fromGroupId, d, e.tabId);
1518
- return N(l, d);
1519
- }, rn = (t, e) => {
1520
- const n = t.groups[e.fromGroupId], r = t.groups[e.targetGroupId];
1521
- if (!n || !r || !t.panels[e.tabId])
1522
- return t;
1523
- if (e.fromGroupId === e.targetGroupId) {
1524
- const g = n.tabIds.filter((T) => T !== e.tabId), v = Math.max(0, Math.min(e.targetIndex, g.length)), b = g.slice(0, v).concat([e.tabId], g.slice(v)), I = b.map((T) => t.panels[T]).filter(Boolean), w = { ...t.groups, [e.fromGroupId]: { ...n, tabIds: b, tabs: I } };
1525
- return { ...t, groups: w };
1526
- }
1527
- const s = { ...t.groups }, a = n.tabIds.filter((g) => g !== e.tabId), i = a.map((g) => t.panels[g]);
1528
- s[e.fromGroupId] = {
1529
- ...n,
1530
- tabIds: a,
1531
- tabs: i,
1532
- activeTabId: n.activeTabId === e.tabId ? i[0]?.id ?? null : n.activeTabId
1533
- };
1534
- const c = r.tabIds.filter((g) => g !== e.tabId), d = Math.max(0, Math.min(e.targetIndex, c.length)), l = c.slice(0, d).concat([e.tabId], c.slice(d)), p = l.map((g) => t.panels[g]).filter(Boolean);
1535
- return s[e.targetGroupId] = { ...r, tabIds: l, tabs: p, activeTabId: e.tabId }, { ...t, groups: s, focusedGroupId: e.targetGroupId };
1536
- }, on = It(Et, {
1537
- splitFocused: (t, e, n) => {
1538
- const r = t.focusedGroupId ?? t.groupOrder[0] ?? null;
1539
- return !r || !rt(t.tree, r, e.payload.direction, n.splitLimits) ? t : xt(t, r, e.payload.direction, n.createGroupId);
1540
- },
1541
- focusGroupIndex: (t, e) => Ye(t, e.payload.index1Based),
1542
- focusNextGroup: (t) => je(t),
1543
- focusPrevGroup: (t) => Ue(t),
1544
- setActiveTab: (t, e) => St(t, e.payload.groupId, e.payload.tabId),
1545
- addTab: (t, e) => {
1546
- const { groupId: n, tab: r, index: o, makeActive: s } = e.payload;
1547
- return typeof o == "number" ? dt(t, n, r, o, s ?? !0) : ut(t, n, r, s ?? !0);
1548
- },
1549
- addNewTab: (t, e, n) => {
1550
- if (!n.createPanelId)
1551
- throw new Error("addNewTab requires PanelSystemProvider.createPanelId");
1552
- const o = { id: n.createPanelId(), title: e.payload.title, render: () => e.payload.title }, { groupId: s, index: a, makeActive: i } = e.payload;
1553
- return typeof a == "number" ? dt(t, s, o, a, i ?? !0) : ut(t, s, o, i ?? !0);
1554
- },
1555
- removeTab: (t, e) => Xe(t, e.payload.groupId, e.payload.tabId),
1556
- contentDrop: (t, e, n) => nn(t, e.payload, n),
1557
- tabDrop: (t, e) => rn(t, e.payload),
1558
- adjustSplitRatio: (t, e) => {
1559
- const n = q(t.tree, e.payload.path);
1560
- if (_(n))
1561
- return t;
1562
- const r = $e(t.tree, e.payload.path, n.ratio + e.payload.deltaRatio);
1563
- return { ...t, tree: r };
1564
- }
1565
- }), pt = (t, e, n) => {
1566
- const r = on[e.type];
1567
- if (!r)
1568
- return t;
1569
- const o = r(t, e, n);
1570
- return Q(o);
1571
- }, Rt = u.createContext(null), $ = () => {
1572
- const t = u.useContext(Rt);
1573
- if (!t)
1574
- throw new Error("usePanelSystem must be used within PanelSystemProvider");
1575
- return t;
1576
- }, sn = ({
1577
- initialState: t,
1578
- createGroupId: e,
1579
- createPanelId: n,
1580
- state: r,
1581
- onStateChange: o,
1582
- splitLimits: s,
1583
- children: a
1584
- }) => {
1585
- const i = u.useMemo(() => Q(t), [t]), c = u.useMemo(() => Ct(s), [s]), d = u.useRef({ createGroupId: e, splitLimits: c, createPanelId: n });
1586
- d.current.createGroupId = e, d.current.splitLimits = c, d.current.createPanelId = n;
1587
- const [l, p] = u.useReducer(
1588
- (S, C) => pt(S, C, d.current),
1589
- i
1590
- ), g = u.useMemo(
1591
- () => r ? Q(r) : l,
1592
- [r, l]
1593
- ), v = u.useRef(g);
1594
- v.current = g;
1595
- const b = r !== void 0, I = u.useCallback(
1596
- (S) => {
1597
- if (b) {
1598
- const C = pt(v.current, S, d.current);
1599
- o?.(C);
1600
- return;
1601
- }
1602
- p(S);
1603
- },
1604
- [b, o, p]
1605
- ), w = u.useMemo(() => Ie(Et, I), [I]), T = u.useMemo(
1606
- () => ({
1607
- setActiveTab: w.setActiveTab,
1608
- tabDrop: w.tabDrop
1609
- }),
1610
- [w]
1611
- ), h = u.useMemo(
1612
- () => ({
1613
- adjustSplitRatio: w.adjustSplitRatio
1614
- }),
1615
- [w]
1616
- ), y = u.useMemo(
1617
- () => ({
1618
- focusGroupIndex: w.focusGroupIndex,
1619
- focusNextGroup: w.focusNextGroup,
1620
- focusPrevGroup: w.focusPrevGroup
1621
- }),
1622
- [w]
1623
- ), f = u.useMemo(
1624
- () => ({
1625
- state: g,
1626
- dispatch: I,
1627
- actions: w
1628
- }),
1629
- [g, I, w]
1630
- );
1631
- return /* @__PURE__ */ m(Rt.Provider, { value: f, children: /* @__PURE__ */ m(Ve, { value: T, children: /* @__PURE__ */ m(qe, { value: h, children: /* @__PURE__ */ m(Je, { value: y, children: a }) }) }) });
1632
- }, an = () => {
1633
- const { actions: t } = $();
1634
- return u.useMemo(
1635
- () => ({
1636
- splitFocused: (e) => {
1637
- t.splitFocused(e);
1638
- },
1639
- focusGroupIndex: (e) => {
1640
- t.focusGroupIndex(e);
1641
- },
1642
- focusNextGroup: () => {
1643
- t.focusNextGroup();
1644
- },
1645
- focusPrevGroup: () => {
1646
- t.focusPrevGroup();
1647
- },
1648
- closeFocusedGroup: () => {
1649
- }
1650
- }),
1651
- [t]
1652
- );
1653
- }, cn = () => {
1654
- const { actions: t } = $(), e = u.useCallback(
1655
- ({ fromGroupId: r, tabId: o, targetGroupId: s, zone: a }) => {
1656
- t.contentDrop({ fromGroupId: r, tabId: o, targetGroupId: s, zone: a });
1657
- },
1658
- [t]
1659
- ), n = u.useCallback(
1660
- ({ fromGroupId: r, tabId: o, targetGroupId: s, targetIndex: a }) => {
1661
- t.tabDrop({ fromGroupId: r, tabId: o, targetGroupId: s, targetIndex: a });
1662
- },
1663
- [t]
1664
- );
1665
- return { onCommitContentDrop: e, onCommitTabDrop: n };
1666
- }, un = () => {
1667
- const t = oe(), e = an();
1668
- return u.useEffect(() => {
1669
- ae(t, e);
1670
- }, [t, e]), null;
1671
- }, Pt = u.createContext(null), ln = () => {
1672
- const t = u.useContext(Pt);
1673
- if (!t)
1674
- throw new Error("useContentRegistry must be used within ContentRegistryProvider");
1675
- return t;
1676
- }, dn = (t) => {
1677
- const e = document.createElement("div");
1678
- return e.setAttribute("data-panel-wrapper", t), e.style.display = "contents", e;
1679
- }, pn = (t, e, n) => {
1680
- const [r] = u.useState(() => dn(t));
1681
- return nt(() => (r.style.display = n ? "contents" : "none", e && r.parentElement !== e && e.appendChild(r), () => {
1682
- r.parentElement?.removeChild(r);
1683
- }), [r, e, n]), r;
1684
- }, Dt = u.memo(
1685
- ({ panelId: t, content: e, placement: n, containerElement: r }) => {
1686
- const o = n?.isActive ?? !1, s = pn(t, r, o);
1687
- return ee(
1688
- /* @__PURE__ */ m(u.Activity, { mode: o ? "visible" : "hidden", children: e }),
1689
- s
1690
- );
1691
- }
1692
- );
1693
- Dt.displayName = "PanelContentHost";
1694
- const fn = ({
1695
- children: t,
1696
- panels: e,
1697
- placements: n
1698
- }) => {
1699
- const [r, o] = u.useState(/* @__PURE__ */ new Map()), s = u.useCallback((g, v) => {
1700
- o((b) => {
1701
- const I = new Map(b);
1702
- return v ? I.set(g, v) : I.delete(g), I;
1703
- });
1704
- }, []), a = u.useMemo(
1705
- () => ({ registerContentContainer: s }),
1706
- [s]
1707
- ), i = u.useRef(e);
1708
- i.current = e;
1709
- const c = u.useCallback((g) => {
1710
- const v = i.current[g];
1711
- return v ? v.render(v.id) : null;
1712
- }, []), d = u.useMemo(() => Object.keys(e), [e]), { getCachedContent: l } = ne({
1713
- resolveContent: c,
1714
- validIds: d
1715
- }), p = Object.keys(e);
1716
- return /* @__PURE__ */ H(Pt.Provider, { value: a, children: [
1717
- t,
1718
- p.map((g) => {
1719
- if (!e[g])
1720
- return null;
1721
- const b = n[g] ?? null, I = b ? r.get(b.groupId) ?? null : null, w = l(g);
1722
- return /* @__PURE__ */ m(
1723
- Dt,
1724
- {
1725
- panelId: g,
1726
- content: w,
1727
- placement: b,
1728
- containerElement: I
1729
- },
1730
- g
1731
- );
1732
- })
1733
- ] });
1734
- }, gn = ({
1735
- children: t,
1736
- emptyContentComponent: e,
1737
- doubleClickToAdd: n
1738
- }) => {
1739
- const r = W(), { state: o, actions: s } = $(), { registerContentContainer: a } = ln(), i = u.useCallback(() => u.createElement("div", { style: { color: "#888", fontSize: 12, padding: 12 } }, "No tabs"), []), c = e ?? i, d = u.useCallback(
1740
- (T) => {
1741
- const h = o.groups[T];
1742
- if (!h)
1743
- return null;
1744
- const y = h.tabIds.map((f) => o.panels[f]).filter(Boolean);
1745
- return { ...h, tabs: y };
1746
- },
1747
- [o.groups, o.panels]
1748
- ), l = u.useCallback(
1749
- (T) => {
1750
- const h = o.groups[T];
1751
- return !h || h.tabIds.length === 0 ? /* @__PURE__ */ m(c, {}) : null;
1752
- },
1753
- [o.groups, c]
1754
- ), p = u.useCallback((T, h) => {
1755
- s.setActiveTab(T, h);
1756
- }, [s]), g = u.useCallback((T) => {
1757
- s.addNewTab({ groupId: T, title: "New Tab", makeActive: !0 });
1758
- }, [s]), v = u.useCallback((T, h) => {
1759
- s.removeTab(T, h);
1760
- }, [s]), b = u.useCallback((T, h, y) => {
1761
- s.setActiveTab(h, T), r.onStartTabDrag(T, h, y);
1762
- }, [s, r]), I = u.useCallback((T, h) => {
1763
- const y = o.groups[T];
1764
- !y || !y.activeTabId || r.onStartContentDrag(T, y.activeTabId, h);
1765
- }, [o.groups, r]), w = u.useMemo(
1766
- () => ({ getGroup: d, getGroupContent: l, onClickTab: p, onAddTab: g, onCloseTab: v, onStartTabDrag: b, onStartContentDrag: I, doubleClickToAdd: n, registerContentContainer: a }),
1767
- [d, l, p, g, v, b, I, n, a]
1768
- );
1769
- return /* @__PURE__ */ m(pe, { value: w, children: t });
1770
- }, bn = ({
1771
- children: t,
1772
- emptyContentComponent: e,
1773
- doubleClickToAdd: n
1774
- }) => {
1775
- const { state: r } = $(), o = u.useMemo(() => {
1776
- const s = {};
1777
- for (const [a, i] of Object.entries(r.groups))
1778
- for (const c of i.tabIds)
1779
- s[c] = {
1780
- groupId: a,
1781
- isActive: c === i.activeTabId
1782
- };
1783
- return s;
1784
- }, [r.groups]);
1785
- return /* @__PURE__ */ m(fn, { panels: r.panels, placements: o, children: /* @__PURE__ */ m(gn, { emptyContentComponent: e, doubleClickToAdd: n, children: t }) });
1786
- }, X = (t, e, n, r) => {
1787
- if (_(t))
1788
- return r;
1789
- const o = t.direction, s = o === "vertical" ? n.x + n.w * t.ratio : n.y + n.h * t.ratio;
1790
- if (r.push({ path: e, direction: o, parentRect: n, linePos: s }), o === "vertical") {
1791
- const c = n.w * t.ratio, d = n.w - c;
1792
- return X(t.a, [...e, "a"], { x: n.x, y: n.y, w: c, h: n.h }, r), X(t.b, [...e, "b"], { x: n.x + c, y: n.y, w: d, h: n.h }, r), r;
1793
- }
1794
- const a = n.h * t.ratio, i = n.h - a;
1795
- return X(t.a, [...e, "a"], { x: n.x, y: n.y, w: n.w, h: a }, r), X(t.b, [...e, "b"], { x: n.x, y: n.y + a, w: n.w, h: i }, r), r;
1796
- }, hn = ({ containerRef: t }) => {
1797
- const { state: e } = $(), { adjustSplitRatio: n } = We(), r = u.useMemo(() => X(e.tree, [], { x: 0, y: 0, w: 100, h: 100 }, []), [e.tree]), [o, s] = u.useState(null);
1798
- if (nt(() => {
1799
- const i = t.current;
1800
- if (!i)
1801
- return;
1802
- const c = () => {
1803
- const v = i.getBoundingClientRect();
1804
- s({ left: v.left, top: v.top, width: v.width, height: v.height });
1805
- };
1806
- c();
1807
- function d() {
1808
- try {
1809
- const v = window.ResizeObserver;
1810
- return typeof v == "function" ? v : null;
1811
- } catch {
1812
- return null;
1813
- }
1814
- }
1815
- const l = d(), p = l ? new l(() => c()) : null;
1816
- p && p.observe(i);
1817
- const g = () => c();
1818
- return window.addEventListener("scroll", g, !0), () => {
1819
- window.removeEventListener("scroll", g, !0), p && p.disconnect();
1820
- };
1821
- }, [t, e.tree]), !o)
1822
- return null;
1823
- const a = (i, c) => {
1824
- const d = {
1825
- left: o.left + o.width * i.parentRect.x / 100,
1826
- top: o.top + o.height * i.parentRect.y / 100,
1827
- width: o.width * i.parentRect.w / 100,
1828
- height: o.height * i.parentRect.h / 100
1829
- }, l = te;
1830
- if (i.direction === "vertical") {
1831
- const b = d.left + d.width * (i.linePos - i.parentRect.x) / i.parentRect.w, I = {
1832
- position: "fixed",
1833
- left: `calc(${Math.round(b)}px - ${l} / 2)`,
1834
- top: Math.round(d.top),
1835
- width: l,
1836
- height: Math.round(d.height),
1837
- cursor: "col-resize",
1838
- pointerEvents: "auto"
1839
- };
1840
- return /* @__PURE__ */ m("div", { style: I, children: /* @__PURE__ */ m(ot, { direction: "vertical", onResize: (T) => {
1841
- const h = o.width * i.parentRect.w / 100, y = h === 0 ? 0 : T / h;
1842
- n({ path: i.path, deltaRatio: y });
1843
- } }) }, `split-${c}`);
1844
- }
1845
- const p = d.top + d.height * (i.linePos - i.parentRect.y) / i.parentRect.h, g = {
1846
- position: "fixed",
1847
- left: Math.round(d.left),
1848
- top: `calc(${Math.round(p)}px - ${l} / 2)`,
1849
- width: Math.round(d.width),
1850
- height: l,
1851
- cursor: "row-resize",
1852
- pointerEvents: "auto"
1853
- };
1854
- return /* @__PURE__ */ m("div", { style: g, children: /* @__PURE__ */ m(ot, { direction: "horizontal", onResize: (b) => {
1855
- const I = o.height * i.parentRect.h / 100, w = I === 0 ? 0 : b / I;
1856
- n({ path: i.path, deltaRatio: w });
1857
- } }) }, `split-${c}`);
1858
- };
1859
- return /* @__PURE__ */ m("div", { style: { position: "fixed", inset: 0, pointerEvents: "none" }, children: r.map((i, c) => a(i, c)) });
1860
- }, mn = {
1861
- position: "relative",
1862
- display: "flex",
1863
- width: "100%",
1864
- height: "100%"
1865
- }, vn = ({
1866
- state: t,
1867
- layoutMode: e,
1868
- gridTracksInteractive: n,
1869
- view: r,
1870
- tabBarComponent: o,
1871
- panelGroupComponent: s
1872
- }) => {
1873
- const a = (c) => r ? /* @__PURE__ */ m(r, { groupId: c }) : /* @__PURE__ */ m(Ee, { id: c, TabBarComponent: o, PanelGroupComponent: s });
1874
- if (e === "grid") {
1875
- const c = le(t, a, !!n);
1876
- return /* @__PURE__ */ m(st, { config: c.config, layers: c.layers });
1877
- }
1878
- const i = ue(t, a);
1879
- return /* @__PURE__ */ m(st, { config: i.config, layers: i.layers });
1880
- }, In = ({
1881
- containerRef: t,
1882
- layoutMode: e,
1883
- gridTracksInteractive: n,
1884
- dragThresholdPx: r,
1885
- view: o,
1886
- style: s,
1887
- className: a,
1888
- tabBarComponent: i,
1889
- panelGroupComponent: c,
1890
- splitLimits: d,
1891
- emptyContentComponent: l,
1892
- doubleClickToAdd: p
1893
- }) => {
1894
- const { state: g } = $(), { onCommitContentDrop: v, onCommitTabDrop: b } = cn(), I = u.useMemo(() => ({ ...mn, ...s }), [s]), w = u.useCallback(
1895
- ({ targetGroupId: T, zone: h }) => {
1896
- if (h === "center")
1897
- return !0;
1898
- const y = h === "left" || h === "right" ? "vertical" : "horizontal";
1899
- return rt(g.tree, T, y, d);
1900
- },
1901
- [g.tree, d]
1902
- );
1903
- return /* @__PURE__ */ m(fe, { children: /* @__PURE__ */ H(
1904
- Te,
1905
- {
1906
- containerRef: t,
1907
- dragThresholdPx: r,
1908
- onCommitContentDrop: v,
1909
- onCommitTabDrop: b,
1910
- isContentZoneAllowed: w,
1911
- children: [
1912
- /* @__PURE__ */ m(bn, { emptyContentComponent: l, doubleClickToAdd: p, children: /* @__PURE__ */ m("div", { ref: t, className: a, style: I, children: /* @__PURE__ */ m(
1913
- vn,
1914
- {
1915
- state: g,
1916
- layoutMode: e,
1917
- gridTracksInteractive: n,
1918
- view: o,
1919
- tabBarComponent: i,
1920
- panelGroupComponent: c
1921
- }
1922
- ) }) }),
1923
- /* @__PURE__ */ m(hn, { containerRef: t }),
1924
- /* @__PURE__ */ m(wn, {})
1925
- ]
1926
- }
1927
- ) });
1928
- }, wn = () => {
1929
- const t = W();
1930
- return /* @__PURE__ */ H(et, { children: [
1931
- /* @__PURE__ */ m(_e, { suggest: t.suggest }),
1932
- /* @__PURE__ */ m(Ne, {})
1933
- ] });
1934
- }, An = ({
1935
- initialState: t,
1936
- createGroupId: e,
1937
- createPanelId: n,
1938
- layoutMode: r,
1939
- gridTracksInteractive: o,
1940
- dragThresholdPx: s,
1941
- view: a,
1942
- emptyContentComponent: i,
1943
- state: c,
1944
- onStateChange: d,
1945
- className: l,
1946
- style: p,
1947
- tabBarComponent: g,
1948
- panelGroupComponent: v,
1949
- splitLimits: b,
1950
- doubleClickToAdd: I
1951
- }) => {
1952
- if (!t)
1953
- throw new Error("PanelSystem requires initialState.");
1954
- if (!e)
1955
- throw new Error("PanelSystem requires explicit createGroupId function.");
1956
- if (!r)
1957
- throw new Error("PanelSystem requires explicit layoutMode ('absolute' | 'grid').");
1958
- if (r === "grid" && o === void 0)
1959
- throw new Error("PanelSystem(layoutMode='grid') requires explicit 'gridTracksInteractive' flag.");
1960
- if (s === void 0)
1961
- throw new Error("PanelSystem requires explicit 'dragThresholdPx' value.");
1962
- const w = u.useRef(null), T = u.useMemo(() => Ct(b), [b]);
1963
- return /* @__PURE__ */ m(
1964
- sn,
1965
- {
1966
- initialState: t,
1967
- createGroupId: e,
1968
- createPanelId: n,
1969
- state: c,
1970
- onStateChange: d,
1971
- splitLimits: b,
1972
- children: /* @__PURE__ */ H(ie, { children: [
1973
- /* @__PURE__ */ m(un, {}),
1974
- /* @__PURE__ */ m(
1975
- In,
1976
- {
1977
- containerRef: w,
1978
- layoutMode: r,
1979
- gridTracksInteractive: o,
1980
- dragThresholdPx: s,
1981
- view: a,
1982
- style: p,
1983
- className: l,
1984
- tabBarComponent: g,
1985
- panelGroupComponent: v,
1986
- splitLimits: T,
1987
- emptyContentComponent: i,
1988
- doubleClickToAdd: I
1989
- }
1990
- )
1991
- ] })
1992
- }
1993
- );
1
+ import { G as m } from "./GridLayout-UWNxXw77.js";
2
+ import { a as e, u as t } from "./FloatingWindow-CUXnEtrb.js";
3
+ import { D as l, b as d, F as f, r as x, c as y } from "./FloatingWindow-CUXnEtrb.js";
4
+ import { H as L } from "./HorizontalDivider-DdxzfV0l.js";
5
+ import { R as D } from "./ResizeHandle-CXjc1meV.js";
6
+ import * as o from "react";
7
+ import { u as R } from "./useFloatingState-tEfA_wbc.js";
8
+ import { C as F } from "./styles-NkjuMOVS.js";
9
+ import { P, v as w } from "./PanelSystem-BqUzNtf2.js";
10
+ const n = () => {
11
+ const { layerId: r } = e(), { getLayerHandleProps: a } = t();
12
+ return o.useMemo(() => a(r), [a, r]);
1994
13
  };
1995
14
  export {
1996
- zn as CSS_VAR_PREFIX,
1997
- _n as Drawer,
1998
- On as DrawerLayers,
1999
- Bn as FloatingWindow,
2000
- st as GridLayout,
2001
- En as HorizontalDivider,
2002
- An as PanelSystem,
2003
- ot as ResizeHandle,
2004
- Dn as buildInitialState,
2005
- Ln as runTransition,
2006
- Pn as useFloatingState,
2007
- Rn as useLayerDragHandle,
2008
- Hn as useTransitionState
15
+ F as CSS_VAR_PREFIX,
16
+ l as Drawer,
17
+ d as DrawerLayers,
18
+ f as FloatingWindow,
19
+ m as GridLayout,
20
+ L as HorizontalDivider,
21
+ P as PanelSystem,
22
+ D as ResizeHandle,
23
+ w as buildInitialState,
24
+ x as runTransition,
25
+ R as useFloatingState,
26
+ n as useLayerDragHandle,
27
+ y as useTransitionState
2009
28
  };
2010
29
  //# sourceMappingURL=index.js.map