react-panel-layout 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/dist/{FloatingPanelFrame-D9Cp2al1.cjs → FloatingPanelFrame-CEmXDvUA.cjs} +2 -2
  2. package/dist/{FloatingPanelFrame-D9Cp2al1.cjs.map → FloatingPanelFrame-CEmXDvUA.cjs.map} +1 -1
  3. package/dist/{FloatingPanelFrame-lLg-Lpg7.js → FloatingPanelFrame-SgYLc6Ud.js} +11 -11
  4. package/dist/{FloatingPanelFrame-lLg-Lpg7.js.map → FloatingPanelFrame-SgYLc6Ud.js.map} +1 -1
  5. package/dist/FloatingWindow-BpdOpg_L.js +400 -0
  6. package/dist/FloatingWindow-BpdOpg_L.js.map +1 -0
  7. package/dist/FloatingWindow-TCDNY5gE.cjs +2 -0
  8. package/dist/FloatingWindow-TCDNY5gE.cjs.map +1 -0
  9. package/dist/GridLayout-B4VRsC0r.cjs +2 -0
  10. package/dist/GridLayout-B4VRsC0r.cjs.map +1 -0
  11. package/dist/GridLayout-BltqeCPK.js +927 -0
  12. package/dist/GridLayout-BltqeCPK.js.map +1 -0
  13. package/dist/HorizontalDivider-B5Z-KZLk.cjs +2 -0
  14. package/dist/HorizontalDivider-B5Z-KZLk.cjs.map +1 -0
  15. package/dist/HorizontalDivider-WF1k_qND.js +30 -0
  16. package/dist/HorizontalDivider-WF1k_qND.js.map +1 -0
  17. package/dist/PanelSystem-Bs8bQwQF.cjs +3 -0
  18. package/dist/PanelSystem-Bs8bQwQF.cjs.map +1 -0
  19. package/dist/PanelSystem-Dr1TBhxM.js +1946 -0
  20. package/dist/PanelSystem-Dr1TBhxM.js.map +1 -0
  21. package/dist/ResizeHandle-CScipO5l.cjs +2 -0
  22. package/dist/ResizeHandle-CScipO5l.cjs.map +1 -0
  23. package/dist/ResizeHandle-CdA_JYfN.js +120 -0
  24. package/dist/ResizeHandle-CdA_JYfN.js.map +1 -0
  25. package/dist/SwipePivotTabBar-BGO9X94m.js +407 -0
  26. package/dist/SwipePivotTabBar-BGO9X94m.js.map +1 -0
  27. package/dist/SwipePivotTabBar-BrQismcZ.cjs +2 -0
  28. package/dist/SwipePivotTabBar-BrQismcZ.cjs.map +1 -0
  29. package/dist/config.cjs +1 -1
  30. package/dist/config.cjs.map +1 -1
  31. package/dist/config.js +11 -9
  32. package/dist/config.js.map +1 -1
  33. package/dist/constants/styles.d.ts +18 -4
  34. package/dist/floating.cjs +1 -1
  35. package/dist/floating.js +1 -1
  36. package/dist/grid/index.d.ts +58 -0
  37. package/dist/grid.cjs +2 -0
  38. package/dist/grid.cjs.map +1 -0
  39. package/dist/grid.js +13 -0
  40. package/dist/grid.js.map +1 -0
  41. package/dist/hooks/gesture/presets.d.ts +33 -0
  42. package/dist/hooks/gesture/testing/createGestureSimulator.d.ts +110 -0
  43. package/dist/hooks/gesture/thresholdValue.d.ts +44 -0
  44. package/dist/hooks/gesture/types.d.ts +254 -0
  45. package/dist/hooks/gesture/useDirectionalLock.d.ts +20 -0
  46. package/dist/hooks/gesture/useEdgeSwipeInput.d.ts +23 -0
  47. package/dist/hooks/gesture/useNativeGestureGuard.d.ts +23 -0
  48. package/dist/hooks/gesture/usePointerTracking.d.ts +22 -0
  49. package/dist/hooks/gesture/useScrollBoundary.d.ts +23 -0
  50. package/dist/hooks/gesture/useSwipeInput.d.ts +5 -0
  51. package/dist/hooks/gesture/utils.d.ts +40 -0
  52. package/dist/hooks/useAnimatedVisibility.d.ts +58 -0
  53. package/dist/hooks/useAnimationFrame.d.ts +84 -0
  54. package/dist/hooks/useSnapAnimation.d.ts +54 -0
  55. package/dist/hooks/useSwipeContentTransform.d.ts +79 -0
  56. package/dist/index.cjs +1 -2
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.d.ts +0 -1
  59. package/dist/index.js +25 -2006
  60. package/dist/index.js.map +1 -1
  61. package/dist/modules/pivot/PivotContent.d.ts +1 -1
  62. package/dist/modules/pivot/SwipePivotContent.d.ts +39 -0
  63. package/dist/modules/pivot/SwipePivotContent.debug.tmp.d.ts +25 -0
  64. package/dist/modules/pivot/SwipePivotContent.test.d.ts +1 -0
  65. package/dist/modules/pivot/SwipePivotTabBar.d.ts +89 -0
  66. package/dist/modules/pivot/index.d.ts +3 -0
  67. package/dist/modules/pivot/scaleInputState.d.ts +37 -0
  68. package/dist/modules/pivot/types.d.ts +67 -2
  69. package/dist/modules/pivot/usePivotSwipeInput.d.ts +68 -0
  70. package/dist/modules/stack/StackContent.d.ts +15 -0
  71. package/dist/modules/stack/SwipeStackContent.d.ts +63 -0
  72. package/dist/modules/stack/SwipeStackOutlet.d.ts +80 -0
  73. package/dist/modules/stack/computeStackContentState.d.ts +99 -0
  74. package/dist/modules/stack/computeSwipeStackTransform.d.ts +76 -0
  75. package/dist/modules/stack/types.d.ts +194 -0
  76. package/dist/modules/stack/useStackAnimationState.d.ts +32 -0
  77. package/dist/modules/stack/useStackNavigation.d.ts +23 -0
  78. package/dist/modules/stack/useStackSwipeInput.d.ts +27 -0
  79. package/dist/panels/index.d.ts +67 -0
  80. package/dist/panels.cjs +2 -0
  81. package/dist/panels.cjs.map +1 -0
  82. package/dist/panels.js +28 -0
  83. package/dist/panels.js.map +1 -0
  84. package/dist/pivot/index.d.ts +3 -0
  85. package/dist/pivot.cjs +1 -1
  86. package/dist/pivot.cjs.map +1 -1
  87. package/dist/pivot.js +20 -2
  88. package/dist/pivot.js.map +1 -1
  89. package/dist/resizer/index.d.ts +57 -0
  90. package/dist/resizer.cjs +2 -0
  91. package/dist/resizer.cjs.map +1 -0
  92. package/dist/resizer.js +8 -0
  93. package/dist/resizer.js.map +1 -0
  94. package/dist/stack/index.d.ts +72 -0
  95. package/dist/stack.cjs +2 -0
  96. package/dist/stack.cjs.map +1 -0
  97. package/dist/stack.js +980 -0
  98. package/dist/stack.js.map +1 -0
  99. package/dist/sticky-header/StickyArea.d.ts +38 -0
  100. package/dist/sticky-header/index.d.ts +4 -4
  101. package/dist/sticky-header/types.d.ts +35 -22
  102. package/dist/sticky-header.cjs +1 -1
  103. package/dist/sticky-header.cjs.map +1 -1
  104. package/dist/sticky-header.js +65 -174
  105. package/dist/sticky-header.js.map +1 -1
  106. package/dist/styles-DPPuJ0sf.js +57 -0
  107. package/dist/styles-DPPuJ0sf.js.map +1 -0
  108. package/dist/styles-qf6ptVLD.cjs +2 -0
  109. package/dist/styles-qf6ptVLD.cjs.map +1 -0
  110. package/dist/useContentCache-CO3LYNmz.js +24 -0
  111. package/dist/useContentCache-CO3LYNmz.js.map +1 -0
  112. package/dist/useContentCache-DqXtLrLs.cjs +2 -0
  113. package/dist/useContentCache-DqXtLrLs.cjs.map +1 -0
  114. package/dist/useDocumentPointerEvents-CKdhGXd0.js +46 -0
  115. package/dist/useDocumentPointerEvents-CKdhGXd0.js.map +1 -0
  116. package/dist/useDocumentPointerEvents-ChqrKXDk.cjs +2 -0
  117. package/dist/useDocumentPointerEvents-ChqrKXDk.cjs.map +1 -0
  118. package/dist/useEffectEvent-Dp7HLCf0.js +13 -0
  119. package/dist/useEffectEvent-Dp7HLCf0.js.map +1 -0
  120. package/dist/useEffectEvent-huSsGUnl.cjs +2 -0
  121. package/dist/useEffectEvent-huSsGUnl.cjs.map +1 -0
  122. package/dist/useFloatingState-C4kRaW_R.cjs +2 -0
  123. package/dist/useFloatingState-C4kRaW_R.cjs.map +1 -0
  124. package/dist/useFloatingState-tEfA_wbc.js +74 -0
  125. package/dist/useFloatingState-tEfA_wbc.js.map +1 -0
  126. package/dist/window/index.d.ts +61 -0
  127. package/dist/window.cjs +2 -0
  128. package/dist/window.cjs.map +1 -0
  129. package/dist/window.js +149 -0
  130. package/dist/window.js.map +1 -0
  131. package/docs/design-tokens.md +405 -0
  132. package/package.json +29 -4
  133. package/src/PanelSystemContext.tsx +88 -0
  134. package/src/components/grid/GridLayerList.tsx +172 -0
  135. package/src/components/grid/GridLayerResizeHandles.tsx +145 -0
  136. package/src/components/grid/GridLayout.spec.tsx +743 -0
  137. package/src/components/grid/GridLayout.tsx +130 -0
  138. package/src/components/grid/GridTrackResizeHandle.tsx +87 -0
  139. package/src/components/paneling/FloatingPanelFrame.tsx +203 -0
  140. package/src/components/panels/DropSuggestOverlay.tsx +131 -0
  141. package/src/components/panels/PanelGroupView.tsx +112 -0
  142. package/src/components/pivot/PivotLayer.tsx +27 -0
  143. package/src/components/resizer/HorizontalDivider.tsx +52 -0
  144. package/src/components/resizer/ResizeHandle.tsx +118 -0
  145. package/src/components/tabs/TabBar.tsx +223 -0
  146. package/src/components/tabs/TabBarTab.tsx +133 -0
  147. package/src/components/tabs/TabDragOverlay.tsx +92 -0
  148. package/src/components/window/DialogOverlay.tsx +180 -0
  149. package/src/components/window/Drawer.tsx +282 -0
  150. package/src/components/window/DrawerLayers.tsx +58 -0
  151. package/src/components/window/FloatingWindow.tsx +95 -0
  152. package/src/components/window/PopupLayerPortal.tsx +218 -0
  153. package/src/config/PanelContentDeclaration.tsx +427 -0
  154. package/src/config/index.tsx +52 -0
  155. package/src/config/panelJsx.spec.tsx +54 -0
  156. package/src/config/panelJsxConfig.spec.tsx +54 -0
  157. package/src/config/panelJsxDrawer.spec.tsx +33 -0
  158. package/src/config/panelRouter.spec.ts +68 -0
  159. package/src/config/panelRouter.tsx +155 -0
  160. package/src/constants/styles.ts +261 -0
  161. package/src/demo/Layout.module.css +258 -0
  162. package/src/demo/Layout.tsx +176 -0
  163. package/src/demo/components/CodeBlock.module.css +54 -0
  164. package/src/demo/components/CodeBlock.tsx +34 -0
  165. package/src/demo/components/CodePreview.module.css +37 -0
  166. package/src/demo/components/CodePreview.tsx +31 -0
  167. package/src/demo/components/DataPreview.module.css +177 -0
  168. package/src/demo/components/DataPreview.tsx +115 -0
  169. package/src/demo/components/Story.module.css +68 -0
  170. package/src/demo/components/Story.tsx +54 -0
  171. package/src/demo/components/layout/CodePanel.module.css +183 -0
  172. package/src/demo/components/layout/CodePanel.tsx +149 -0
  173. package/src/demo/components/layout/DemoPage.module.css +60 -0
  174. package/src/demo/components/layout/DemoPage.tsx +56 -0
  175. package/src/demo/components/layout/SingleSamplePage.module.css +11 -0
  176. package/src/demo/components/layout/SingleSamplePage.tsx +35 -0
  177. package/src/demo/components/layout/SplitDemoLayout.module.css +107 -0
  178. package/src/demo/components/layout/SplitDemoLayout.tsx +218 -0
  179. package/src/demo/components/layout/index.ts +11 -0
  180. package/src/demo/components/tab-styles/ChromeTabBar.module.css +75 -0
  181. package/src/demo/components/tab-styles/ChromeTabBar.tsx +111 -0
  182. package/src/demo/components/tab-styles/GitHubTabBar.module.css +81 -0
  183. package/src/demo/components/tab-styles/GitHubTabBar.tsx +109 -0
  184. package/src/demo/components/tab-styles/VSCodeTabBar.module.css +78 -0
  185. package/src/demo/components/tab-styles/VSCodeTabBar.tsx +109 -0
  186. package/src/demo/components/tab-styles/index.ts +6 -0
  187. package/src/demo/components/ui/DemoButton.module.css +63 -0
  188. package/src/demo/components/ui/DemoButton.tsx +32 -0
  189. package/src/demo/components/ui/DemoCard.module.css +15 -0
  190. package/src/demo/components/ui/DemoCard.tsx +30 -0
  191. package/src/demo/components/ui/DemoContainer.module.css +17 -0
  192. package/src/demo/components/ui/DemoContainer.tsx +30 -0
  193. package/src/demo/components/ui/DemoPanel.module.css +23 -0
  194. package/src/demo/components/ui/DemoPanel.tsx +33 -0
  195. package/src/demo/components/ui/PanelText.module.css +18 -0
  196. package/src/demo/components/ui/PanelText.tsx +29 -0
  197. package/src/demo/components/ui/PanelTitle.module.css +18 -0
  198. package/src/demo/components/ui/PanelTitle.tsx +31 -0
  199. package/src/demo/contexts/TabbarDemoConfig.tsx +218 -0
  200. package/src/demo/demo.css +172 -0
  201. package/src/demo/hooks/useMedia.ts +41 -0
  202. package/src/demo/hooks/useShikiHighlight.ts +55 -0
  203. package/src/demo/index.tsx +293 -0
  204. package/src/demo/pages/Drawer/animations/index.tsx +22 -0
  205. package/src/demo/pages/Drawer/basics/index.tsx +17 -0
  206. package/src/demo/pages/Drawer/components/DrawerAnimations.module.css +125 -0
  207. package/src/demo/pages/Drawer/components/DrawerAnimations.tsx +118 -0
  208. package/src/demo/pages/Drawer/components/DrawerBasics.module.css +55 -0
  209. package/src/demo/pages/Drawer/components/DrawerBasics.tsx +76 -0
  210. package/src/demo/pages/Drawer/components/DrawerMenuLayout.module.css +332 -0
  211. package/src/demo/pages/Drawer/components/DrawerMenuLayout.tsx +199 -0
  212. package/src/demo/pages/Drawer/menu/index.tsx +17 -0
  213. package/src/demo/pages/FloatingPanelFrame/ResizableFloatingPanelsPreview.module.css +163 -0
  214. package/src/demo/pages/FloatingPanelFrame/ResizableFloatingPanelsPreview.tsx +234 -0
  215. package/src/demo/pages/FloatingPanelFrame/basic/index.tsx +17 -0
  216. package/src/demo/pages/FloatingPanelFrame/complex/index.tsx +26 -0
  217. package/src/demo/pages/FloatingPanelFrame/components/BasicPanel.module.css +16 -0
  218. package/src/demo/pages/FloatingPanelFrame/components/BasicPanel.tsx +24 -0
  219. package/src/demo/pages/FloatingPanelFrame/components/ComplexPanel.module.css +54 -0
  220. package/src/demo/pages/FloatingPanelFrame/components/ComplexPanel.tsx +67 -0
  221. package/src/demo/pages/FloatingPanelFrame/components/PanelWithControls.module.css +21 -0
  222. package/src/demo/pages/FloatingPanelFrame/components/PanelWithControls.tsx +41 -0
  223. package/src/demo/pages/FloatingPanelFrame/components/PanelWithMeta.module.css +5 -0
  224. package/src/demo/pages/FloatingPanelFrame/components/PanelWithMeta.tsx +43 -0
  225. package/src/demo/pages/FloatingPanelFrame/components/ScrollablePanel.module.css +11 -0
  226. package/src/demo/pages/FloatingPanelFrame/components/ScrollablePanel.tsx +42 -0
  227. package/src/demo/pages/FloatingPanelFrame/index.tsx +80 -0
  228. package/src/demo/pages/FloatingPanelFrame/scrollable/index.tsx +30 -0
  229. package/src/demo/pages/FloatingPanelFrame/with-controls/index.tsx +30 -0
  230. package/src/demo/pages/FloatingPanelFrame/with-meta/index.tsx +17 -0
  231. package/src/demo/pages/HorizontalDivider/components/PanelsWithRichContent.module.css +112 -0
  232. package/src/demo/pages/HorizontalDivider/components/PanelsWithRichContent.tsx +56 -0
  233. package/src/demo/pages/HorizontalDivider/components/SimpleResizablePanels.module.css +46 -0
  234. package/src/demo/pages/HorizontalDivider/components/SimpleResizablePanels.tsx +29 -0
  235. package/src/demo/pages/HorizontalDivider/components/ThreePanelLayout.module.css +54 -0
  236. package/src/demo/pages/HorizontalDivider/components/ThreePanelLayout.tsx +30 -0
  237. package/src/demo/pages/HorizontalDivider/index.module.css +14 -0
  238. package/src/demo/pages/HorizontalDivider/index.tsx +64 -0
  239. package/src/demo/pages/HorizontalDivider/panels-with-rich-content/index.tsx +21 -0
  240. package/src/demo/pages/HorizontalDivider/simple-resizable-panels/index.tsx +21 -0
  241. package/src/demo/pages/HorizontalDivider/three-panel-layout/index.tsx +21 -0
  242. package/src/demo/pages/PanelLayout/PanelLayoutDemo.module.css +174 -0
  243. package/src/demo/pages/PanelLayout/PanelLayoutDemo.tsx +248 -0
  244. package/src/demo/pages/PanelLayout/components/DashboardLayout.module.css +115 -0
  245. package/src/demo/pages/PanelLayout/components/DashboardLayout.tsx +124 -0
  246. package/src/demo/pages/PanelLayout/components/DraggableOverlays.module.css +101 -0
  247. package/src/demo/pages/PanelLayout/components/DraggableOverlays.tsx +122 -0
  248. package/src/demo/pages/PanelLayout/components/IDELayout.module.css +104 -0
  249. package/src/demo/pages/PanelLayout/components/IDELayout.tsx +143 -0
  250. package/src/demo/pages/PanelLayout/components/SimpleGrid.module.css +19 -0
  251. package/src/demo/pages/PanelLayout/components/SimpleGrid.tsx +62 -0
  252. package/src/demo/pages/PanelLayout/dashboard/index.tsx +22 -0
  253. package/src/demo/pages/PanelLayout/draggable-overlays/index.tsx +22 -0
  254. package/src/demo/pages/PanelLayout/ide-layout/index.tsx +22 -0
  255. package/src/demo/pages/PanelLayout/index.tsx +94 -0
  256. package/src/demo/pages/PanelLayout/simple-grid/index.tsx +22 -0
  257. package/src/demo/pages/PanelSystem/PanelSystemPreview.module.css +20 -0
  258. package/src/demo/pages/PanelSystem/PanelSystemPreview.tsx +101 -0
  259. package/src/demo/pages/PanelSystem/preview/index.tsx +18 -0
  260. package/src/demo/pages/PanelSystem/tabbar/index.tsx +129 -0
  261. package/src/demo/pages/Pivot/basics/index.tsx +17 -0
  262. package/src/demo/pages/Pivot/components/Pivot.module.css +278 -0
  263. package/src/demo/pages/Pivot/components/PivotBasics.tsx +103 -0
  264. package/src/demo/pages/Pivot/components/PivotSidebar.tsx +168 -0
  265. package/src/demo/pages/Pivot/components/PivotTabs.tsx +129 -0
  266. package/src/demo/pages/Pivot/components/PivotTransitions.tsx +120 -0
  267. package/src/demo/pages/Pivot/components/SwipePivot.module.css +114 -0
  268. package/src/demo/pages/Pivot/components/SwipePivot.tsx +193 -0
  269. package/src/demo/pages/Pivot/components/SwipeTabsPivot.module.css +203 -0
  270. package/src/demo/pages/Pivot/components/SwipeTabsPivot.tsx +289 -0
  271. package/src/demo/pages/Pivot/sidebar/index.tsx +17 -0
  272. package/src/demo/pages/Pivot/swipe/index.tsx +16 -0
  273. package/src/demo/pages/Pivot/swipe-debug/index.tsx +287 -0
  274. package/src/demo/pages/Pivot/swipe-tabs/index.tsx +15 -0
  275. package/src/demo/pages/Pivot/tabs/index.tsx +17 -0
  276. package/src/demo/pages/Pivot/transitions/index.tsx +17 -0
  277. package/src/demo/pages/ResizeHandle/both-directions/index.tsx +17 -0
  278. package/src/demo/pages/ResizeHandle/components/BothDirectionsDemo.module.css +72 -0
  279. package/src/demo/pages/ResizeHandle/components/BothDirectionsDemo.tsx +41 -0
  280. package/src/demo/pages/ResizeHandle/components/HorizontalResizeDemo.module.css +61 -0
  281. package/src/demo/pages/ResizeHandle/components/HorizontalResizeDemo.tsx +33 -0
  282. package/src/demo/pages/ResizeHandle/components/NestedPanelsDemo.module.css +83 -0
  283. package/src/demo/pages/ResizeHandle/components/NestedPanelsDemo.tsx +53 -0
  284. package/src/demo/pages/ResizeHandle/components/VerticalResizeDemo.module.css +68 -0
  285. package/src/demo/pages/ResizeHandle/components/VerticalResizeDemo.tsx +33 -0
  286. package/src/demo/pages/ResizeHandle/horizontal/index.tsx +17 -0
  287. package/src/demo/pages/ResizeHandle/index.module.css +11 -0
  288. package/src/demo/pages/ResizeHandle/index.tsx +71 -0
  289. package/src/demo/pages/ResizeHandle/nested-panels/index.tsx +17 -0
  290. package/src/demo/pages/ResizeHandle/vertical/index.tsx +17 -0
  291. package/src/demo/pages/ResponsiveLayout/adaptive-workspace/index.tsx +22 -0
  292. package/src/demo/pages/ResponsiveLayout/components/ResponsiveWorkspace.module.css +423 -0
  293. package/src/demo/pages/ResponsiveLayout/components/ResponsiveWorkspace.tsx +398 -0
  294. package/src/demo/pages/Stack/basics/index.tsx +22 -0
  295. package/src/demo/pages/Stack/components/Stack.module.css +234 -0
  296. package/src/demo/pages/Stack/components/StackBasics.tsx +217 -0
  297. package/src/demo/pages/Stack/components/StackTablet.module.css +299 -0
  298. package/src/demo/pages/Stack/components/StackTablet.tsx +401 -0
  299. package/src/demo/pages/Stack/tablet/index.tsx +22 -0
  300. package/src/demo/pages/StickyHeader/basics/index.tsx +17 -0
  301. package/src/demo/pages/StickyHeader/components/StickyHeader.module.css +219 -0
  302. package/src/demo/pages/StickyHeader/components/StickyHeaderBasics.tsx +103 -0
  303. package/src/demo/routes.tsx +193 -0
  304. package/src/demo/styles/animations.css +68 -0
  305. package/src/demo/styles/stack-themes.css +35 -0
  306. package/src/demo/utils/createPanelView.tsx +58 -0
  307. package/src/floating/index.ts +24 -0
  308. package/src/grid/index.ts +75 -0
  309. package/src/hooks/ContentCacheContext.tsx +87 -0
  310. package/src/hooks/gesture/presets.spec.ts +86 -0
  311. package/src/hooks/gesture/presets.ts +95 -0
  312. package/src/hooks/gesture/testing/createGestureSimulator.spec.ts +237 -0
  313. package/src/hooks/gesture/testing/createGestureSimulator.ts +310 -0
  314. package/src/hooks/gesture/thresholdValue.spec.ts +103 -0
  315. package/src/hooks/gesture/thresholdValue.ts +77 -0
  316. package/src/hooks/gesture/types.ts +290 -0
  317. package/src/hooks/gesture/useDirectionalLock.spec.ts +271 -0
  318. package/src/hooks/gesture/useDirectionalLock.ts +115 -0
  319. package/src/hooks/gesture/useEdgeSwipeInput.spec.ts +454 -0
  320. package/src/hooks/gesture/useEdgeSwipeInput.ts +131 -0
  321. package/src/hooks/gesture/useNativeGestureGuard.spec.ts +413 -0
  322. package/src/hooks/gesture/useNativeGestureGuard.ts +133 -0
  323. package/src/hooks/gesture/usePointerTracking.spec.ts +364 -0
  324. package/src/hooks/gesture/usePointerTracking.ts +134 -0
  325. package/src/hooks/gesture/useScrollBoundary.spec.ts +249 -0
  326. package/src/hooks/gesture/useScrollBoundary.ts +113 -0
  327. package/src/hooks/gesture/useSwipeInput.spec.ts +592 -0
  328. package/src/hooks/gesture/useSwipeInput.ts +310 -0
  329. package/src/hooks/gesture/utils.spec.ts +152 -0
  330. package/src/hooks/gesture/utils.ts +87 -0
  331. package/src/hooks/useAnimatedVisibility.spec.ts +257 -0
  332. package/src/hooks/useAnimatedVisibility.ts +146 -0
  333. package/src/hooks/useAnimationFrame.ts +200 -0
  334. package/src/hooks/useCSSMatrix.spec.ts +214 -0
  335. package/src/hooks/useCSSMatrix.ts +262 -0
  336. package/src/hooks/useClonedElementPreview.ts +28 -0
  337. package/src/hooks/useContainerScroll.ts +78 -0
  338. package/src/hooks/useContentCache.spec.tsx +232 -0
  339. package/src/hooks/useContentCache.tsx +127 -0
  340. package/src/hooks/useDocumentPointerEvents.ts +137 -0
  341. package/src/hooks/useDocumentScroll.ts +41 -0
  342. package/src/hooks/useEffectEvent.ts +40 -0
  343. package/src/hooks/useElementComponentWrapper.tsx +63 -0
  344. package/src/hooks/useIntersectionObserver.tsx +125 -0
  345. package/src/hooks/useIsomorphicLayoutEffect.ts +29 -0
  346. package/src/hooks/useResizeObserver.tsx +81 -0
  347. package/src/hooks/useScrollContainer.ts +79 -0
  348. package/src/hooks/useSnapAnimation.ts +128 -0
  349. package/src/hooks/useSwipeContentTransform.spec.ts +133 -0
  350. package/src/hooks/useSwipeContentTransform.ts +235 -0
  351. package/src/hooks/useTransitionState.ts +95 -0
  352. package/src/index.tsx +88 -0
  353. package/src/modules/grid/GridLayoutContext.tsx +57 -0
  354. package/src/modules/grid/LayerInstanceContext.tsx +56 -0
  355. package/src/modules/grid/resizeHandles.ts +157 -0
  356. package/src/modules/grid/trackUtils.ts +146 -0
  357. package/src/modules/grid/useGridPlacements.ts +143 -0
  358. package/src/modules/grid/useGridTracks.ts +156 -0
  359. package/src/modules/grid/useLayerDragHandle.ts +16 -0
  360. package/src/modules/grid/useLayerInteractions.tsx +850 -0
  361. package/src/modules/keybindings/KeybindingsProvider.tsx +111 -0
  362. package/src/modules/panels/dom/DomRegistry.tsx +94 -0
  363. package/src/modules/panels/index.ts +45 -0
  364. package/src/modules/panels/interactions/InteractionsContext.test.tsx +330 -0
  365. package/src/modules/panels/interactions/InteractionsContext.tsx +394 -0
  366. package/src/modules/panels/interactions/dnd.ts +28 -0
  367. package/src/modules/panels/keybindings/KeybindingsInstaller.tsx +15 -0
  368. package/src/modules/panels/layout/adapter.ts +124 -0
  369. package/src/modules/panels/rendering/ContentRegistry.spec.tsx +304 -0
  370. package/src/modules/panels/rendering/ContentRegistry.tsx +205 -0
  371. package/src/modules/panels/rendering/GroupContainer.tsx +65 -0
  372. package/src/modules/panels/rendering/RenderBridge.tsx +115 -0
  373. package/src/modules/panels/rendering/RenderContext.tsx +31 -0
  374. package/src/modules/panels/state/PanelSplitHandles.tsx +147 -0
  375. package/src/modules/panels/state/PanelSystemContext.splitLimits.spec.tsx +50 -0
  376. package/src/modules/panels/state/PanelSystemContext.tsx +289 -0
  377. package/src/modules/panels/state/StateContext.tsx +12 -0
  378. package/src/modules/panels/state/cleanup.ts +37 -0
  379. package/src/modules/panels/state/commands.ts +53 -0
  380. package/src/modules/panels/state/focus/Context.tsx +25 -0
  381. package/src/modules/panels/state/focus/logic.ts +57 -0
  382. package/src/modules/panels/state/groups/Context.tsx +25 -0
  383. package/src/modules/panels/state/groups/logic.ts +105 -0
  384. package/src/modules/panels/state/splitLimits.spec.ts +46 -0
  385. package/src/modules/panels/state/splitLimits.ts +90 -0
  386. package/src/modules/panels/state/state.spec.ts +49 -0
  387. package/src/modules/panels/state/tree/Context.tsx +24 -0
  388. package/src/modules/panels/state/tree/logic.spec.ts +34 -0
  389. package/src/modules/panels/state/tree/logic.ts +138 -0
  390. package/src/modules/panels/state/types.ts +142 -0
  391. package/src/modules/panels/system/PanelSystem.empty-tabbar.spec.tsx +53 -0
  392. package/src/modules/panels/system/PanelSystem.tab-click-activates.spec.tsx +44 -0
  393. package/src/modules/panels/system/PanelSystem.tab-reorder.spec.tsx +64 -0
  394. package/src/modules/panels/system/PanelSystem.tabs-no-dup.spec.tsx +57 -0
  395. package/src/modules/panels/system/PanelSystem.tsx +206 -0
  396. package/src/modules/pivot/PivotContent.spec.tsx +179 -0
  397. package/src/modules/pivot/PivotContent.tsx +77 -0
  398. package/src/modules/pivot/SwipePivotContent.debug.tmp.tsx +237 -0
  399. package/src/modules/pivot/SwipePivotContent.position.spec.tsx +167 -0
  400. package/src/modules/pivot/SwipePivotContent.spec.tsx +464 -0
  401. package/src/modules/pivot/SwipePivotContent.test.tsx +502 -0
  402. package/src/modules/pivot/SwipePivotContent.tsx +197 -0
  403. package/src/modules/pivot/SwipePivotTabBar.spec.tsx +865 -0
  404. package/src/modules/pivot/SwipePivotTabBar.tsx +523 -0
  405. package/src/modules/pivot/index.ts +8 -0
  406. package/src/modules/pivot/scaleInputState.spec.ts +210 -0
  407. package/src/modules/pivot/scaleInputState.ts +66 -0
  408. package/src/modules/pivot/types.ts +139 -0
  409. package/src/modules/pivot/usePivot.spec.ts +621 -0
  410. package/src/modules/pivot/usePivot.spec.tsx +186 -0
  411. package/src/modules/pivot/usePivot.tsx +345 -0
  412. package/src/modules/pivot/usePivotSwipeInput.spec.ts +649 -0
  413. package/src/modules/pivot/usePivotSwipeInput.ts +136 -0
  414. package/src/modules/resizer/useResizeDrag.ts +94 -0
  415. package/src/modules/stack/StackContent.spec.tsx +264 -0
  416. package/src/modules/stack/StackContent.tsx +111 -0
  417. package/src/modules/stack/SwipeStackContent.spec.tsx +1277 -0
  418. package/src/modules/stack/SwipeStackContent.tsx +356 -0
  419. package/src/modules/stack/SwipeStackOutlet.spec.tsx +252 -0
  420. package/src/modules/stack/SwipeStackOutlet.tsx +221 -0
  421. package/src/modules/stack/computeStackContentState.spec.ts +281 -0
  422. package/src/modules/stack/computeStackContentState.ts +304 -0
  423. package/src/modules/stack/computeSwipeStackTransform.spec.ts +186 -0
  424. package/src/modules/stack/computeSwipeStackTransform.ts +145 -0
  425. package/src/modules/stack/types.ts +226 -0
  426. package/src/modules/stack/useStackAnimationState.spec.ts +186 -0
  427. package/src/modules/stack/useStackAnimationState.ts +138 -0
  428. package/src/modules/stack/useStackNavigation.spec.ts +477 -0
  429. package/src/modules/stack/useStackNavigation.tsx +336 -0
  430. package/src/modules/stack/useStackSwipeInput.spec.ts +276 -0
  431. package/src/modules/stack/useStackSwipeInput.ts +139 -0
  432. package/src/modules/window/useDrawerState.ts +81 -0
  433. package/src/modules/window/useFloatingState.spec.ts +252 -0
  434. package/src/modules/window/useFloatingState.ts +141 -0
  435. package/src/panels/index.ts +119 -0
  436. package/src/pivot/index.ts +19 -0
  437. package/src/resizer/index.ts +68 -0
  438. package/src/stack/index.ts +91 -0
  439. package/src/sticky-header/StickyArea.tsx +221 -0
  440. package/src/sticky-header/index.ts +18 -0
  441. package/src/sticky-header/types.ts +68 -0
  442. package/src/types.ts +323 -0
  443. package/src/utils/CSSMatrix.ts +321 -0
  444. package/src/utils/css.ts +65 -0
  445. package/src/utils/dialogUtils.ts +43 -0
  446. package/src/utils/math.ts +18 -0
  447. package/src/utils/polyfills/createDialogPolyfill.ts +18 -0
  448. package/src/utils/typedActions.ts +103 -0
  449. package/src/vite-env.d.ts +6 -0
  450. package/src/window/index.ts +67 -0
  451. package/dist/GridLayout-BQQ63eA1.cjs +0 -2
  452. package/dist/GridLayout-BQQ63eA1.cjs.map +0 -1
  453. package/dist/GridLayout-CJTKq7Mp.js +0 -1465
  454. package/dist/GridLayout-CJTKq7Mp.js.map +0 -1
  455. package/dist/sticky-header/StickyHeader.d.ts +0 -53
  456. package/dist/styles-CA2_zLZt.js +0 -52
  457. package/dist/styles-CA2_zLZt.js.map +0 -1
  458. package/dist/styles-PsqGOEJP.cjs +0 -2
  459. package/dist/styles-PsqGOEJP.cjs.map +0 -1
  460. package/dist/usePivot-7ctin_P_.cjs +0 -2
  461. package/dist/usePivot-7ctin_P_.cjs.map +0 -1
  462. package/dist/usePivot-CgQxB8rc.js +0 -124
  463. package/dist/usePivot-CgQxB8rc.js.map +0 -1
@@ -1,198 +1,89 @@
1
- import { jsxs as Y, jsx as T } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { u as j } from "./useIsomorphicLayoutEffect-DhmEnmZ_.js";
4
- function F(e) {
5
- const [t, r] = s.useState(() => typeof window > "u" ? { scrollTop: 0, scrollLeft: 0 } : e ? {
6
- scrollTop: e.scrollTop,
7
- scrollLeft: e.scrollLeft
8
- } : {
9
- scrollTop: window.scrollY,
10
- scrollLeft: window.scrollX
11
- });
12
- return s.useEffect(() => {
13
- const o = () => {
14
- r(e ? {
15
- scrollTop: e.scrollTop,
16
- scrollLeft: e.scrollLeft
17
- } : {
18
- scrollTop: window.scrollY,
19
- scrollLeft: window.scrollX
20
- });
21
- };
22
- o();
23
- const l = e ?? window;
24
- return l.addEventListener("scroll", o, { passive: !0 }), () => {
25
- l.removeEventListener("scroll", o);
26
- };
27
- }, [e]), t;
28
- }
29
- const L = /* @__PURE__ */ new Map(), q = (e) => {
30
- const { box: t = "content-box" } = e, r = `resize-box:${t}`, o = L.get(r);
31
- if (o)
32
- return o;
33
- const l = new class {
34
- #e = /* @__PURE__ */ new Map();
35
- #t = new ResizeObserver((i, u) => {
36
- i.forEach((f) => {
37
- const h = this.#e.get(f.target);
38
- h && h(f, u);
39
- });
40
- });
41
- observe(i, u) {
42
- return this.#e.set(i, u), this.#t.observe(i, e), () => {
43
- this.#e.delete(i), this.#t.unobserve(i);
44
- };
45
- }
46
- }();
47
- return L.set(r, l), l;
48
- };
49
- function D(e, { box: t }) {
50
- const [r, o] = s.useState(null), l = e.current;
51
- s.useEffect(() => l ? q({ box: t }).observe(l, (f) => {
52
- o(f);
53
- }) : void 0, [t, l]);
54
- const i = s.useMemo(() => {
55
- if (!r)
56
- return null;
57
- if (r.borderBoxSize?.length > 0) {
58
- const u = r.borderBoxSize[0];
59
- return new DOMRect(0, 0, u.inlineSize, u.blockSize);
60
- }
61
- return r.contentRect;
62
- }, [r]);
63
- return { entry: r, rect: i };
64
- }
65
- function K(e) {
66
- const t = getComputedStyle(e), r = t.overflowY, o = t.overflowX;
67
- return r === "scroll" || r === "auto" || o === "scroll" || o === "auto";
68
- }
69
- function P(e) {
70
- if (!e)
71
- return null;
72
- let t = e.parentElement;
73
- for (; t; ) {
74
- if (K(t))
75
- return t;
76
- t = t.parentElement;
77
- }
78
- return null;
79
- }
80
- function W(e) {
81
- const [t, r] = s.useState(null);
82
- return s.useEffect(() => {
83
- const o = e.current;
84
- if (!o) {
85
- r(null);
86
- return;
87
- }
88
- const l = P(o);
89
- r(l);
90
- }, [e]), t;
1
+ import { jsxs as F, jsx as y } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { u as O } from "./useIsomorphicLayoutEffect-DhmEnmZ_.js";
4
+ function C(o) {
5
+ return {
6
+ position: "relative",
7
+ paddingTop: o === "top" ? "env(safe-area-inset-top)" : void 0,
8
+ paddingBottom: o === "bottom" ? "env(safe-area-inset-bottom)" : void 0,
9
+ boxSizing: "border-box"
10
+ };
91
11
  }
92
- const B = {
93
- position: "relative"
94
- }, G = {
95
- position: "relative",
96
- paddingTop: "env(safe-area-inset-top)",
97
- boxSizing: "border-box"
98
- }, J = {
12
+ const I = {
99
13
  zIndex: 1
100
14
  };
101
- function Q(e) {
102
- return e ? {
103
- position: "fixed",
104
- top: 0,
105
- left: 0,
106
- right: 0,
15
+ function M(o) {
16
+ return {
107
17
  opacity: 0,
108
18
  zIndex: 0,
109
19
  userSelect: "none",
110
- pointerEvents: "none"
111
- } : {
112
- position: "absolute",
113
- top: 0,
20
+ pointerEvents: "none",
21
+ // Disable transitions to prevent jank - styles are updated via RAF
22
+ transition: "none",
23
+ // Enable GPU acceleration for smoother animations
24
+ willChange: "height, opacity",
25
+ transform: "translateZ(0)",
26
+ position: "fixed",
27
+ top: o === "top" ? 0 : void 0,
28
+ bottom: o === "bottom" ? 0 : void 0,
114
29
  left: 0,
115
- right: 0,
116
- opacity: 0,
117
- zIndex: 0,
118
- userSelect: "none",
119
- pointerEvents: "none"
30
+ right: 0
120
31
  };
121
32
  }
122
- function U(e) {
123
- return e ? B : {
124
- ...B,
125
- overflow: "hidden"
126
- };
127
- }
128
- const V = ({ cover: e, children: t, onStateChange: r }) => {
129
- const o = s.useRef(null), l = s.useRef(null), i = s.useRef(null), u = W(i), f = u === null, { scrollTop: h } = F(u), z = s.useRef(h);
130
- z.current = h;
131
- const w = s.useRef(null), { rect: C } = D(o, {});
132
- Object.is(w.current, C) || (w.current = C);
133
- const $ = s.useRef(null), [k, A] = s.useState({
33
+ const U = {
34
+ position: "relative"
35
+ }, N = ({
36
+ position: o = "top",
37
+ cover: R,
38
+ children: p,
39
+ onStateChange: v
40
+ }) => {
41
+ const g = a.useRef(null), x = a.useRef(null), [S, w] = a.useState({
134
42
  isStuck: !1,
135
- scrollOffset: 0,
136
- containerType: "document"
137
- }), E = s.useRef(k), x = s.useCallback(
138
- (a) => {
139
- const c = E.current;
140
- (c.isStuck !== a.isStuck || c.scrollOffset !== a.scrollOffset || c.containerType !== a.containerType) && (E.current = a, A(a), r?.(a));
43
+ scrollOffset: 0
44
+ }), b = a.useRef(S), h = a.useCallback(
45
+ (s) => {
46
+ const e = b.current;
47
+ (e.isStuck !== s.isStuck || e.scrollOffset !== s.scrollOffset) && (b.current = s, w(s), v?.(s));
141
48
  },
142
- [r]
49
+ [v]
143
50
  );
144
- j(() => {
145
- const a = o.current, c = l.current, H = i.current;
146
- if (!c || !a || !H)
51
+ O(() => {
52
+ const s = g.current, e = x.current;
53
+ if (!e || !s)
147
54
  return;
148
- let y = Number.NaN, b = null, S = !1;
149
- const I = () => {
150
- const n = w.current;
151
- if (!n)
152
- return;
153
- const v = z.current;
154
- if (f) {
155
- const p = n.height - v;
156
- p !== y && (c.style.opacity = "1", c.style.height = `${p}px`, y = p), (n.x >= 0 || n.y >= 0 || n.width > 0) && b !== n && (c.style.left = `${n.x}px`, c.style.top = `${n.y}px`, c.style.width = `${n.width}px`, b = n);
157
- const d = v > 0;
158
- d !== S && (S = d, x({
159
- isStuck: d,
160
- scrollOffset: v,
161
- containerType: "document"
162
- }));
55
+ let l = Number.NaN, c = Number.NaN, f = Number.NaN, d = !1, u = !0;
56
+ const $ = () => {
57
+ const t = s.getBoundingClientRect(), m = window.innerHeight;
58
+ if (o === "top") {
59
+ const i = Math.max(0, t.height + t.top);
60
+ i !== l && (e.style.opacity = i > 0 ? "1" : "0", e.style.height = `${i}px`, l = i), (t.left !== c || t.width !== f) && (e.style.left = `${t.left}px`, e.style.width = `${t.width}px`, c = t.left, f = t.width);
61
+ const r = t.top < 0, n = Math.max(0, -t.top);
62
+ (u ? !0 : r !== d) && (u = !1, d = r, h({ isStuck: r, scrollOffset: n }));
163
63
  } else {
164
- const p = u;
165
- if (!p)
166
- return;
167
- const d = p.getBoundingClientRect();
168
- $.current = d;
169
- const N = a.getBoundingClientRect().top - d.top + v, m = v - N, R = Math.max(0, n.height - m);
170
- R !== y && (c.style.opacity = "1", c.style.height = `${R}px`, y = R), b !== n && (c.style.left = "0", c.style.width = `${n.width}px`, b = n);
171
- const X = Math.max(0, m);
172
- c.style.top = `${X}px`;
173
- const g = m > 0;
174
- g !== S && (S = g, x({
175
- isStuck: g,
176
- scrollOffset: m,
177
- containerType: "container"
178
- }));
64
+ const i = m - t.bottom, r = Math.max(0, t.height + i);
65
+ r !== l && (e.style.opacity = r > 0 ? "1" : "0", e.style.height = `${r}px`, l = r), (t.left !== c || t.width !== f) && (e.style.left = `${t.left}px`, e.style.width = `${t.width}px`, c = t.left, f = t.width);
66
+ const n = t.bottom > m, A = Math.max(0, t.bottom - m);
67
+ (u ? !0 : n !== d) && (u = !1, d = n, h({ isStuck: n, scrollOffset: A }));
179
68
  }
180
69
  };
181
- let O = requestAnimationFrame(function n() {
182
- I(), O = requestAnimationFrame(n);
70
+ let k = requestAnimationFrame(function t() {
71
+ $(), k = requestAnimationFrame(t);
183
72
  });
184
73
  return () => {
185
- cancelAnimationFrame(O);
74
+ cancelAnimationFrame(k);
186
75
  };
187
- }, [f, u, x]);
188
- const M = typeof t == "function" ? t(k) : t;
189
- return /* @__PURE__ */ Y("div", { ref: i, style: U(f), children: [
190
- /* @__PURE__ */ T("div", { ref: l, style: Q(f), children: e }),
191
- /* @__PURE__ */ T("div", { ref: o, style: G, children: /* @__PURE__ */ T("div", { style: J, children: M }) })
76
+ }, [o, h]);
77
+ const H = typeof p == "function" ? p(S) : p;
78
+ return /* @__PURE__ */ F("div", { style: U, children: [
79
+ /* @__PURE__ */ y("div", { ref: x, style: M(o), children: R }),
80
+ /* @__PURE__ */ y("div", { ref: g, style: C(o), children: /* @__PURE__ */ y("div", { style: I, children: H }) })
192
81
  ] });
193
82
  };
194
- V.displayName = "StickyHeader";
83
+ N.displayName = "StickyArea";
84
+ const q = N;
195
85
  export {
196
- V as StickyHeader
86
+ N as StickyArea,
87
+ q as StickyHeader
197
88
  };
198
89
  //# sourceMappingURL=sticky-header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sticky-header.js","sources":["../src/hooks/useContainerScroll.ts","../src/hooks/useResizeObserver.tsx","../src/hooks/useScrollContainer.ts","../src/sticky-header/StickyHeader.tsx"],"sourcesContent":["/**\n * @file useContainerScroll - Track scroll position of a container or document\n *\n * Tracks scroll position for either a specific scroll container element\n * or the document (when container is null).\n */\nimport * as React from \"react\";\n\nexport type ScrollPosition = {\n /** Vertical scroll position */\n scrollTop: number;\n /** Horizontal scroll position */\n scrollLeft: number;\n};\n\n/**\n * Track scroll position of a container element or the document.\n *\n * @param container - Scroll container element, or null for document scroll\n * @returns Current scroll position\n *\n * @example\n * ```tsx\n * // For document scroll\n * const scroll = useContainerScroll(null);\n *\n * // For container scroll\n * const containerRef = useRef<HTMLDivElement>(null);\n * const scroll = useContainerScroll(containerRef.current);\n * ```\n */\nexport function useContainerScroll(container: HTMLElement | null): ScrollPosition {\n const [position, setPosition] = React.useState<ScrollPosition>(() => {\n if (typeof window === \"undefined\") {\n return { scrollTop: 0, scrollLeft: 0 };\n }\n\n if (container) {\n return {\n scrollTop: container.scrollTop,\n scrollLeft: container.scrollLeft,\n };\n }\n\n return {\n scrollTop: window.scrollY,\n scrollLeft: window.scrollX,\n };\n });\n\n React.useEffect(() => {\n const handleScroll = () => {\n if (container) {\n setPosition({\n scrollTop: container.scrollTop,\n scrollLeft: container.scrollLeft,\n });\n } else {\n setPosition({\n scrollTop: window.scrollY,\n scrollLeft: window.scrollX,\n });\n }\n };\n\n // Initialize position\n handleScroll();\n\n const target = container ?? window;\n target.addEventListener(\"scroll\", handleScroll, { passive: true });\n\n return () => {\n target.removeEventListener(\"scroll\", handleScroll);\n };\n }, [container]);\n\n return position;\n}\n","/**\n * @file Shared useResizeObserver hook with cached observer instances.\n */\nimport * as React from \"react\";\n\ntype Unobserve = () => void;\ntype Callback = (entry: ResizeObserverEntry, observer: ResizeObserver) => void;\ntype SharedObserver = {\n observe: (target: Element, callback: Callback) => Unobserve;\n};\nconst observerCache = new Map<string, SharedObserver>();\nconst getSharedObserver = (options: ResizeObserverOptions) => {\n const { box = \"content-box\" } = options;\n const observerKey = `resize-box:${box}`;\n const cached = observerCache.get(observerKey);\n if (cached) {\n return cached;\n }\n const observer = new (class {\n #callbackMap = new Map<Element, Callback>();\n #resizeObserver = new ResizeObserver((entries, observer) => {\n entries.forEach((entry) => {\n const callback = this.#callbackMap.get(entry.target);\n if (callback) {\n callback(entry, observer);\n }\n });\n });\n observe(target: Element, callback: Callback) {\n this.#callbackMap.set(target, callback);\n this.#resizeObserver.observe(target, options);\n return () => {\n this.#callbackMap.delete(target);\n this.#resizeObserver.unobserve(target);\n };\n }\n })();\n observerCache.set(observerKey, observer);\n\n return observer;\n};\n/**\n * Observe size changes for a given element reference using shared resize observers.\n *\n * @param ref - Ref holding the element whose size to monitor.\n * @param options - Resize observer configuration.\n * @returns Latest resize entry and a derived DOMRect snapshot.\n */\nexport function useResizeObserver<T extends HTMLElement>(\n ref: React.RefObject<T | null>,\n { box }: ResizeObserverOptions,\n) {\n const [entry, setEntry] = React.useState<ResizeObserverEntry | null>(null);\n const target = ref.current;\n\n React.useEffect(() => {\n if (!target) {\n return;\n }\n\n const observer = getSharedObserver({ box });\n return observer.observe(target, (nextEntry) => {\n setEntry(nextEntry);\n });\n }, [box, target]);\n\n const rect = React.useMemo(() => {\n if (!entry) {\n return null;\n }\n\n if (entry.borderBoxSize?.length > 0) {\n const size = entry.borderBoxSize[0];\n return new DOMRect(0, 0, size.inlineSize, size.blockSize);\n }\n\n return entry.contentRect;\n }, [entry]);\n\n return { entry, rect };\n}\n","/**\n * @file useScrollContainer - Detect the nearest scrollable ancestor\n *\n * Traverses the DOM tree to find the nearest ancestor with overflow: scroll/auto.\n * Returns null if the document is the scroll container.\n */\nimport * as React from \"react\";\n\n/**\n * Check if an element is a scroll container.\n */\nfunction isScrollContainer(element: Element): boolean {\n const style = getComputedStyle(element);\n const overflowY = style.overflowY;\n const overflowX = style.overflowX;\n\n return (\n overflowY === \"scroll\" ||\n overflowY === \"auto\" ||\n overflowX === \"scroll\" ||\n overflowX === \"auto\"\n );\n}\n\n/**\n * Find the nearest scrollable ancestor of an element.\n *\n * @param element - Starting element to search from\n * @returns The nearest scrollable ancestor, or null if document is the container\n */\nfunction findScrollContainer(element: Element | null): HTMLElement | null {\n if (!element) {\n return null;\n }\n\n // eslint-disable-next-line no-restricted-syntax -- DOM traversal requires let\n let current = element.parentElement;\n\n while (current) {\n if (isScrollContainer(current)) {\n return current;\n }\n current = current.parentElement;\n }\n\n return null;\n}\n\n/**\n * Hook to detect the nearest scrollable ancestor of a ref element.\n *\n * @param ref - Ref to the element to find scroll container for\n * @returns The nearest scrollable ancestor element, or null if document is the container\n *\n * @example\n * ```tsx\n * const elementRef = useRef<HTMLDivElement>(null);\n * const scrollContainer = useScrollContainer(elementRef);\n * // scrollContainer is HTMLElement if in nested scroll, null if document scroll\n * ```\n */\nexport function useScrollContainer<T extends HTMLElement>(\n ref: React.RefObject<T | null>,\n): HTMLElement | null {\n const [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n React.useEffect(() => {\n const element = ref.current;\n if (!element) {\n setContainer(null);\n return;\n }\n\n const scrollContainer = findScrollContainer(element);\n setContainer(scrollContainer);\n }, [ref]);\n\n return container;\n}\n","/**\n * @file StickyHeader component for native app-like overscroll experience.\n *\n * Displays cover content that expands during overscroll/bounce,\n * providing a native app-like pull effect commonly seen in iOS apps.\n *\n * This component is designed for SPAs, PWAs, and hybrid apps where\n * the browser's pull-to-refresh is disabled and bounce effects\n * should display content rather than empty space.\n *\n * Supports both document-level scroll and nested scroll containers.\n */\nimport * as React from \"react\";\nimport { useContainerScroll } from \"../hooks/useContainerScroll\";\nimport { useIsomorphicLayoutEffect } from \"../hooks/useIsomorphicLayoutEffect\";\nimport { useResizeObserver } from \"../hooks/useResizeObserver\";\nimport { useScrollContainer } from \"../hooks/useScrollContainer\";\nimport type { StickyHeaderProps, StickyHeaderState } from \"./types\";\n\nconst baseStyle: React.CSSProperties = {\n position: \"relative\",\n};\n\nconst headerStyle: React.CSSProperties = {\n position: \"relative\",\n paddingTop: \"env(safe-area-inset-top)\",\n boxSizing: \"border-box\",\n};\n\nconst bodyStyle: React.CSSProperties = {\n zIndex: 1,\n};\n\n/**\n * Get cover styles based on container type.\n */\nfunction getCoverStyle(isDocumentScroll: boolean): React.CSSProperties {\n if (isDocumentScroll) {\n return {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n opacity: 0,\n zIndex: 0,\n userSelect: \"none\",\n pointerEvents: \"none\",\n };\n }\n\n // For nested scroll containers, use absolute positioning\n return {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n opacity: 0,\n zIndex: 0,\n userSelect: \"none\",\n pointerEvents: \"none\",\n };\n}\n\n/**\n * Get wrapper styles for nested scroll containers.\n */\nfunction getWrapperStyle(isDocumentScroll: boolean): React.CSSProperties {\n if (isDocumentScroll) {\n return baseStyle;\n }\n\n return {\n ...baseStyle,\n overflow: \"hidden\",\n };\n}\n\n/**\n * StickyHeader provides a native app-like overscroll experience.\n *\n * When the user pulls down beyond the top of the page (overscroll/bounce),\n * the cover content expands to fill the visible area, similar to\n * native iOS/Android app behavior.\n *\n * Also supports nested scroll containers with overflow: scroll/auto.\n *\n * @example\n * ```tsx\n * // Basic usage\n * <StickyHeader cover={<img src=\"/hero.jpg\" alt=\"Hero\" />}>\n * <header>\n * <h1>My App</h1>\n * </header>\n * </StickyHeader>\n *\n * // With state callback\n * <StickyHeader\n * cover={<img src=\"/hero.jpg\" alt=\"Hero\" />}\n * onStateChange={({ isStuck }) => console.log('Stuck:', isStuck)}\n * >\n * <header>\n * <h1>My App</h1>\n * </header>\n * </StickyHeader>\n *\n * // With render function\n * <StickyHeader cover={<img src=\"/hero.jpg\" alt=\"Hero\" />}>\n * {({ isStuck }) => (\n * <header style={{ background: isStuck ? 'white' : 'transparent' }}>\n * <h1>My App</h1>\n * </header>\n * )}\n * </StickyHeader>\n * ```\n */\nexport const StickyHeader: React.FC<StickyHeaderProps> = ({ cover, children, onStateChange }) => {\n const headerRef = React.useRef<HTMLDivElement>(null);\n const coverAreaRef = React.useRef<HTMLDivElement>(null);\n const wrapperRef = React.useRef<HTMLDivElement>(null);\n\n // Detect scroll container\n const scrollContainer = useScrollContainer(wrapperRef);\n const isDocumentScroll = scrollContainer === null;\n\n // Track scroll position\n const { scrollTop } = useContainerScroll(scrollContainer);\n const scrollTopRef = React.useRef(scrollTop);\n scrollTopRef.current = scrollTop;\n\n // Track header bounds\n const headerBoundRef = React.useRef<DOMRectReadOnly | null>(null);\n const { rect: headerRect } = useResizeObserver(headerRef, {});\n if (!Object.is(headerBoundRef.current, headerRect)) {\n headerBoundRef.current = headerRect;\n }\n\n // Track container bounds for nested scroll\n const containerBoundRef = React.useRef<DOMRect | null>(null);\n\n // State for render function and callback\n const [state, setState] = React.useState<StickyHeaderState>({\n isStuck: false,\n scrollOffset: 0,\n containerType: \"document\",\n });\n\n // Update state when values change\n const stateRef = React.useRef(state);\n const updateState = React.useCallback(\n (newState: StickyHeaderState) => {\n const prev = stateRef.current;\n if (prev.isStuck !== newState.isStuck || prev.scrollOffset !== newState.scrollOffset || prev.containerType !== newState.containerType) {\n stateRef.current = newState;\n setState(newState);\n onStateChange?.(newState);\n }\n },\n [onStateChange],\n );\n\n useIsomorphicLayoutEffect(() => {\n const header = headerRef.current;\n const coverArea = coverAreaRef.current;\n const wrapper = wrapperRef.current;\n if (!coverArea || !header || !wrapper) {\n return;\n }\n\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let prevHeight = Number.NaN;\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let prevHeaderBound: DOMRectReadOnly | null = null;\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let prevIsStuck = false;\n\n const loop = () => {\n const headerBound = headerBoundRef.current;\n if (!headerBound) {\n return;\n }\n\n const currentScrollTop = scrollTopRef.current;\n\n if (isDocumentScroll) {\n // Document scroll mode (original behavior)\n const coverAreaHeight = headerBound.height - currentScrollTop;\n if (coverAreaHeight !== prevHeight) {\n coverArea.style.opacity = \"1\";\n coverArea.style.height = `${coverAreaHeight}px`;\n prevHeight = coverAreaHeight;\n }\n\n if ((headerBound.x >= 0 || headerBound.y >= 0 || headerBound.width > 0) && prevHeaderBound !== headerBound) {\n coverArea.style.left = `${headerBound.x}px`;\n coverArea.style.top = `${headerBound.y}px`;\n coverArea.style.width = `${headerBound.width}px`;\n prevHeaderBound = headerBound;\n }\n\n // Calculate stuck state\n const isStuck = currentScrollTop > 0;\n if (isStuck !== prevIsStuck) {\n prevIsStuck = isStuck;\n updateState({\n isStuck,\n scrollOffset: currentScrollTop,\n containerType: \"document\",\n });\n }\n } else {\n // Nested container scroll mode\n const container = scrollContainer;\n if (!container) {\n return;\n }\n\n // Get container bounds\n const containerBound = container.getBoundingClientRect();\n containerBoundRef.current = containerBound;\n\n // Calculate header position relative to container\n const headerTop = header.getBoundingClientRect().top - containerBound.top + currentScrollTop;\n\n // Calculate cover height based on scroll position\n const scrollOffset = currentScrollTop - headerTop;\n const coverAreaHeight = Math.max(0, headerBound.height - scrollOffset);\n\n if (coverAreaHeight !== prevHeight) {\n coverArea.style.opacity = \"1\";\n coverArea.style.height = `${coverAreaHeight}px`;\n prevHeight = coverAreaHeight;\n }\n\n // Position cover relative to scroll\n if (prevHeaderBound !== headerBound) {\n coverArea.style.left = \"0\";\n coverArea.style.width = `${headerBound.width}px`;\n prevHeaderBound = headerBound;\n }\n\n // Calculate top position to follow scroll\n const coverTop = Math.max(0, scrollOffset);\n coverArea.style.top = `${coverTop}px`;\n\n // Calculate stuck state\n const isStuck = scrollOffset > 0;\n if (isStuck !== prevIsStuck) {\n prevIsStuck = isStuck;\n updateState({\n isStuck,\n scrollOffset,\n containerType: \"container\",\n });\n }\n }\n };\n\n // eslint-disable-next-line no-restricted-syntax -- Performance: RAF id needs reassignment\n let id = requestAnimationFrame(function animate() {\n loop();\n id = requestAnimationFrame(animate);\n });\n\n return () => {\n cancelAnimationFrame(id);\n };\n }, [isDocumentScroll, scrollContainer, updateState]);\n\n // Render children\n const renderedChildren = typeof children === \"function\" ? children(state) : children;\n\n return (\n <div ref={wrapperRef} style={getWrapperStyle(isDocumentScroll)}>\n <div ref={coverAreaRef} style={getCoverStyle(isDocumentScroll)}>\n {cover}\n </div>\n <div ref={headerRef} style={headerStyle}>\n <div style={bodyStyle}>{renderedChildren}</div>\n </div>\n </div>\n );\n};\n\nStickyHeader.displayName = \"StickyHeader\";\n"],"names":["useContainerScroll","container","position","setPosition","React","handleScroll","target","observerCache","getSharedObserver","options","box","observerKey","cached","observer","#callbackMap","#resizeObserver","entries","entry","callback","useResizeObserver","ref","setEntry","nextEntry","rect","size","isScrollContainer","element","style","overflowY","overflowX","findScrollContainer","current","useScrollContainer","setContainer","scrollContainer","baseStyle","headerStyle","bodyStyle","getCoverStyle","isDocumentScroll","getWrapperStyle","StickyHeader","cover","children","onStateChange","headerRef","coverAreaRef","wrapperRef","scrollTop","scrollTopRef","headerBoundRef","headerRect","containerBoundRef","state","setState","stateRef","updateState","newState","prev","useIsomorphicLayoutEffect","header","coverArea","wrapper","prevHeight","prevHeaderBound","prevIsStuck","loop","headerBound","currentScrollTop","coverAreaHeight","isStuck","containerBound","headerTop","scrollOffset","coverTop","id","animate","renderedChildren","jsx"],"mappings":";;;AA+BO,SAASA,EAAmBC,GAA+C;AAChF,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAM,SAAyB,MACzD,OAAO,SAAW,MACb,EAAE,WAAW,GAAG,YAAY,EAAA,IAGjCH,IACK;AAAA,IACL,WAAWA,EAAU;AAAA,IACrB,YAAYA,EAAU;AAAA,EAAA,IAInB;AAAA,IACL,WAAW,OAAO;AAAA,IAClB,YAAY,OAAO;AAAA,EAAA,CAEtB;AAED,SAAAG,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAe,MAAM;AACzB,MACEF,EADEF,IACU;AAAA,QACV,WAAWA,EAAU;AAAA,QACrB,YAAYA,EAAU;AAAA,MAAA,IAGZ;AAAA,QACV,WAAW,OAAO;AAAA,QAClB,YAAY,OAAO;AAAA,MAAA,CAJpB;AAAA,IAOL;AAGA,IAAAI,EAAA;AAEA,UAAMC,IAASL,KAAa;AAC5B,WAAAK,E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"],"sourcesContent":["/**\n * @file StickyArea component for native app-like overscroll experience.\n *\n * Displays cover content that expands during overscroll/bounce,\n * providing a native app-like pull effect commonly seen in iOS apps.\n *\n * Supports both top (header) and bottom (footer) positions.\n * Works with document-level scroll only.\n */\nimport * as React from \"react\";\nimport { useIsomorphicLayoutEffect } from \"../hooks/useIsomorphicLayoutEffect\";\nimport type { StickyAreaProps, StickyAreaState } from \"./types\";\n\n/**\n * Get area styles based on position.\n */\nfunction getAreaStyle(position: \"top\" | \"bottom\"): React.CSSProperties {\n return {\n position: \"relative\",\n paddingTop: position === \"top\" ? \"env(safe-area-inset-top)\" : undefined,\n paddingBottom: position === \"bottom\" ? \"env(safe-area-inset-bottom)\" : undefined,\n boxSizing: \"border-box\",\n };\n}\n\nconst bodyStyle: React.CSSProperties = {\n zIndex: 1,\n};\n\n/**\n * Get cover styles based on position.\n * Explicitly disables transitions to prevent jank from inherited CSS.\n */\nfunction getCoverStyle(position: \"top\" | \"bottom\"): React.CSSProperties {\n return {\n opacity: 0,\n zIndex: 0,\n userSelect: \"none\",\n pointerEvents: \"none\",\n // Disable transitions to prevent jank - styles are updated via RAF\n transition: \"none\",\n // Enable GPU acceleration for smoother animations\n willChange: \"height, opacity\",\n transform: \"translateZ(0)\",\n position: \"fixed\",\n top: position === \"top\" ? 0 : undefined,\n bottom: position === \"bottom\" ? 0 : undefined,\n left: 0,\n right: 0,\n };\n}\n\nconst wrapperStyle: React.CSSProperties = {\n position: \"relative\",\n};\n\n/**\n * StickyArea provides a native app-like overscroll experience.\n *\n * When the user overscrolls (pulls beyond the edge), the cover content\n * expands to fill the visible area, similar to native iOS/Android app behavior.\n *\n * Supports both top (header) and bottom (footer) positions.\n * Works with document-level scroll only.\n *\n * @example\n * ```tsx\n * // Header (top) - expands on pull-down\n * <StickyArea position=\"top\" cover={<img src=\"/hero.jpg\" />}>\n * <header><h1>My App</h1></header>\n * </StickyArea>\n *\n * // Footer (bottom) - expands on pull-up\n * <StickyArea position=\"bottom\" cover={<div className=\"footer-bg\" />}>\n * <footer>Footer content</footer>\n * </StickyArea>\n * ```\n */\nexport const StickyArea: React.FC<StickyAreaProps> = ({\n position = \"top\",\n cover,\n children,\n onStateChange,\n}) => {\n const areaRef = React.useRef<HTMLDivElement>(null);\n const coverAreaRef = React.useRef<HTMLDivElement>(null);\n\n // State for render function and callback\n const [state, setState] = React.useState<StickyAreaState>({\n isStuck: false,\n scrollOffset: 0,\n });\n\n // Update state when values change\n const stateRef = React.useRef(state);\n const updateState = React.useCallback(\n (newState: StickyAreaState) => {\n const prev = stateRef.current;\n if (prev.isStuck !== newState.isStuck || prev.scrollOffset !== newState.scrollOffset) {\n stateRef.current = newState;\n setState(newState);\n onStateChange?.(newState);\n }\n },\n [onStateChange],\n );\n\n useIsomorphicLayoutEffect(() => {\n const area = areaRef.current;\n const coverArea = coverAreaRef.current;\n if (!coverArea || !area) {\n return;\n }\n\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let prevHeight = Number.NaN;\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let prevLeft = Number.NaN;\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let prevWidth = Number.NaN;\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let prevIsStuck = false;\n // eslint-disable-next-line no-restricted-syntax -- Performance: mutable state for RAF loop\n let isFirstRun = true;\n\n const loop = () => {\n const liveRect = area.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n\n if (position === \"top\") {\n // TOP: Cover expands upward during pull-down overscroll\n // liveRect.top > 0 means element moved down (overscroll)\n // liveRect.top < 0 means element scrolled up\n const coverAreaHeight = Math.max(0, liveRect.height + liveRect.top);\n\n if (coverAreaHeight !== prevHeight) {\n coverArea.style.opacity = coverAreaHeight > 0 ? \"1\" : \"0\";\n coverArea.style.height = `${coverAreaHeight}px`;\n prevHeight = coverAreaHeight;\n }\n\n if (liveRect.left !== prevLeft || liveRect.width !== prevWidth) {\n coverArea.style.left = `${liveRect.left}px`;\n coverArea.style.width = `${liveRect.width}px`;\n prevLeft = liveRect.left;\n prevWidth = liveRect.width;\n }\n\n const isStuck = liveRect.top < 0;\n const scrollOffset = Math.max(0, -liveRect.top);\n\n const shouldUpdateState = isFirstRun ? true : isStuck !== prevIsStuck;\n if (shouldUpdateState) {\n isFirstRun = false;\n prevIsStuck = isStuck;\n updateState({ isStuck, scrollOffset });\n }\n } else {\n // BOTTOM: Cover expands downward during pull-up overscroll\n // liveRect.bottom < viewportHeight means element moved up (overscroll at bottom)\n // liveRect.bottom > viewportHeight means element is below viewport\n const distanceFromBottom = viewportHeight - liveRect.bottom;\n const coverAreaHeight = Math.max(0, liveRect.height + distanceFromBottom);\n\n if (coverAreaHeight !== prevHeight) {\n coverArea.style.opacity = coverAreaHeight > 0 ? \"1\" : \"0\";\n coverArea.style.height = `${coverAreaHeight}px`;\n prevHeight = coverAreaHeight;\n }\n\n if (liveRect.left !== prevLeft || liveRect.width !== prevWidth) {\n coverArea.style.left = `${liveRect.left}px`;\n coverArea.style.width = `${liveRect.width}px`;\n prevLeft = liveRect.left;\n prevWidth = liveRect.width;\n }\n\n const isStuck = liveRect.bottom > viewportHeight;\n const scrollOffset = Math.max(0, liveRect.bottom - viewportHeight);\n\n const shouldUpdateState = isFirstRun ? true : isStuck !== prevIsStuck;\n if (shouldUpdateState) {\n isFirstRun = false;\n prevIsStuck = isStuck;\n updateState({ isStuck, scrollOffset });\n }\n }\n };\n\n // eslint-disable-next-line no-restricted-syntax -- Performance: RAF id needs reassignment\n let id = requestAnimationFrame(function animate() {\n loop();\n id = requestAnimationFrame(animate);\n });\n\n return () => {\n cancelAnimationFrame(id);\n };\n }, [position, updateState]);\n\n // Render children\n const renderedChildren = typeof children === \"function\" ? children(state) : children;\n\n return (\n <div style={wrapperStyle}>\n <div ref={coverAreaRef} style={getCoverStyle(position)}>\n {cover}\n </div>\n <div ref={areaRef} style={getAreaStyle(position)}>\n <div style={bodyStyle}>{renderedChildren}</div>\n </div>\n </div>\n );\n};\n\nStickyArea.displayName = \"StickyArea\";\n\n/**\n * @deprecated Use StickyArea with position=\"top\" instead\n */\nexport const StickyHeader = StickyArea;\n"],"names":["getAreaStyle","position","bodyStyle","getCoverStyle","wrapperStyle","StickyArea","cover","children","onStateChange","areaRef","React","coverAreaRef","state","setState","stateRef","updateState","newState","prev","useIsomorphicLayoutEffect","area","coverArea","prevHeight","prevLeft","prevWidth","prevIsStuck","isFirstRun","loop","liveRect","viewportHeight","coverAreaHeight","isStuck","scrollOffset","distanceFromBottom","id","animate","renderedChildren","jsxs","jsx","StickyHeader"],"mappings":";;;AAgBA,SAASA,EAAaC,GAAiD;AACrE,SAAO;AAAA,IACL,UAAU;AAAA,IACV,YAAYA,MAAa,QAAQ,6BAA6B;AAAA,IAC9D,eAAeA,MAAa,WAAW,gCAAgC;AAAA,IACvE,WAAW;AAAA,EAAA;AAEf;AAEA,MAAMC,IAAiC;AAAA,EACrC,QAAQ;AACV;AAMA,SAASC,EAAcF,GAAiD;AACtE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,eAAe;AAAA;AAAA,IAEf,YAAY;AAAA;AAAA,IAEZ,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,KAAKA,MAAa,QAAQ,IAAI;AAAA,IAC9B,QAAQA,MAAa,WAAW,IAAI;AAAA,IACpC,MAAM;AAAA,IACN,OAAO;AAAA,EAAA;AAEX;AAEA,MAAMG,IAAoC;AAAA,EACxC,UAAU;AACZ,GAwBaC,IAAwC,CAAC;AAAA,EACpD,UAAAJ,IAAW;AAAA,EACX,OAAAK;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACJ,QAAMC,IAAUC,EAAM,OAAuB,IAAI,GAC3CC,IAAeD,EAAM,OAAuB,IAAI,GAGhD,CAACE,GAAOC,CAAQ,IAAIH,EAAM,SAA0B;AAAA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57 @@
1
+ const N = "rpl", l = "var(--rpl-color-resize-handle-idle, rgba(255, 255, 255, 0.0))", T = "var(--rpl-color-resize-handle-hover, rgba(33, 150, 243, 0.35))", S = "var(--rpl-color-resize-handle-active, rgba(33, 150, 243, 0.55))", a = "var(--rpl-color-drop-suggest-border, rgba(90, 150, 255, 0.9))", _ = "var(--rpl-color-drop-suggest-bg, rgba(90, 150, 255, 0.15))", r = "var(--rpl-color-insert-guide, rgba(120, 160, 255, 0.95))", s = "var(--rpl-color-insert-guide-shadow, 0 0 0 2px rgba(120, 160, 255, 0.2))", E = "var(--rpl-color-surface, #fff)", o = "var(--rpl-color-surface-2, #fafafa)", n = "var(--rpl-color-border, #e5e7eb)", t = "var(--rpl-color-muted-fg, #6b7280)", R = "var(--rpl-shadow-card, 0 2px 10px rgba(0, 0, 0, 0.08))", i = "var(--rpl-color-drawer-backdrop, rgba(0, 0, 0, 0.5))", L = "var(--rpl-drawer-transition-duration, 220ms)", G = "var(--rpl-drawer-transition-easing, cubic-bezier(0.22, 1, 0.36, 1))", d = "var(--rpl-pivot-animation-enter, none)", v = "var(--rpl-pivot-animation-leave, none)", g = "var(--rpl-stack-animation-push, none)", C = "var(--rpl-stack-animation-pop, none)", P = "var(--rpl-stack-transition-duration, 350ms)", H = "var(--rpl-stack-transition-easing, cubic-bezier(0.32, 0.72, 0, 1))", e = "var(--rpl-radius-suggest, 6px)", A = "var(--rpl-size-suggest-border, 2px)";
2
+ const O = "var(--rpl-size-resize-handle-thickness, 4px)", p = "var(--rpl-size-split-handle-thickness, 6px)", c = "var(--rpl-z-overlay, 9998)", I = "var(--rpl-z-tabdrag-overlay, 9999)", D = "var(--rpl-z-dialog-overlay, 10000)", U = O, x = "var(--rpl-z-resize-handle, 1000)", b = 4, F = "var(--rpl-size-grid-layer-corner-hit, 14px)", f = "var(--rpl-size-grid-layer-edge-hit-thickness, 12px)", h = c, B = A, Z = e, u = a, z = _, W = 6, V = I, w = "var(--rpl-space-tab-drag-preview-offset-x, 12px)", K = "var(--rpl-space-tab-drag-preview-offset-y, 12px)", m = "var(--rpl-size-tab-drag-insert-guide-width, 2px)", Y = "var(--rpl-radius-tab-drag-insert-guide, 1px)", X = r, k = s, y = D, M = "var(--rpl-radius-floating-panel, 8px)", j = "var(--rpl-space-floating-panel-gap, 8px)", q = "var(--rpl-space-floating-panel-header-padding-y, 8px)", J = "var(--rpl-space-floating-panel-header-padding-x, 12px)", Q = "var(--rpl-space-floating-panel-content-padding, 12px)", $ = "var(--rpl-size-floating-panel-meta-font, 12px)", aa = "var(--rpl-space-floating-panel-controls-gap, 6px)", _a = "var(--rpl-size-floating-panel-close-button-font, 1.25rem)", ra = "var(--rpl-space-floating-panel-close-button-padding, 0.25rem 0.5rem)", sa = E, Ea = o, oa = n, na = t, ta = R, Ra = "var(--rpl-space-drawer-header-padding-y, 10px)", ea = "var(--rpl-space-drawer-header-padding-x, 12px)", Aa = "var(--rpl-space-drawer-header-gap, 8px)", Oa = "var(--rpl-space-drawer-content-padding, 12px)", pa = p, ca = "var(--rpl-size-horizontal-divider-width, 4px)";
3
+ export {
4
+ b as A,
5
+ H as B,
6
+ N as C,
7
+ y as D,
8
+ g as E,
9
+ ta as F,
10
+ f as G,
11
+ ca as H,
12
+ C as I,
13
+ h as J,
14
+ Z as K,
15
+ z as L,
16
+ B as M,
17
+ u as N,
18
+ W as O,
19
+ d as P,
20
+ K as Q,
21
+ U as R,
22
+ P as S,
23
+ w as T,
24
+ k as U,
25
+ X as V,
26
+ Y as W,
27
+ m as X,
28
+ V as Y,
29
+ pa as Z,
30
+ S as a,
31
+ T as b,
32
+ l as c,
33
+ M as d,
34
+ sa as e,
35
+ oa as f,
36
+ Q as g,
37
+ Ea as h,
38
+ q as i,
39
+ J as j,
40
+ j as k,
41
+ aa as l,
42
+ ra as m,
43
+ _a as n,
44
+ $ as o,
45
+ na as p,
46
+ x as q,
47
+ v as r,
48
+ i as s,
49
+ L as t,
50
+ G as u,
51
+ Oa as v,
52
+ Aa as w,
53
+ Ra as x,
54
+ ea as y,
55
+ F as z
56
+ };
57
+ //# sourceMappingURL=styles-DPPuJ0sf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles-DPPuJ0sf.js","sources":["../src/constants/styles.ts"],"sourcesContent":["/**\n * @file Style constants for library components\n *\n * All style values are defined here with CSS variable fallbacks.\n * Users can override these via CSS variables (--rpl-*).\n *\n * All CSS variables use the unified prefix: --rpl- (react-panel-layout)\n *\n * @example\n * // In your CSS:\n * :root {\n * --rpl-color-primary: #ff0000;\n * }\n */\n\n// ========================================\n// CSS VARIABLE PREFIX\n// ========================================\n\n/**\n * Unified CSS variable prefix for all react-panel-layout variables\n * All theme variables use this prefix: --rpl-*\n */\nexport const CSS_VAR_PREFIX = \"rpl\";\n\n// ========================================\n// COLORS\n// ========================================\n\n/**\n * Tab colors - used in TabBar component\n */\nexport const COLOR_TAB_FG = \"var(--rpl-color-tab-fg, #d5d7de)\";\nexport const COLOR_TAB_ACTIVE_BG = \"var(--rpl-color-tab-active-bg, #2b2d35)\";\nexport const COLOR_TABBAR_BG = \"var(--rpl-color-tabbar-bg, #1e1f24)\";\n\n/**\n * Panel colors - used in panel layouts\n */\nexport const COLOR_PANEL_BORDER = \"var(--rpl-color-panel-border, rgba(0, 0, 0, 0.3))\";\nexport const COLOR_PANEL_BG = \"var(--rpl-color-panel-bg, #0b0b0c)\";\n\n/**\n * Primary color - used for resize handles, highlights\n */\nexport const COLOR_PRIMARY = \"var(--rpl-color-primary, #2196f3)\";\nexport const COLOR_RESIZE_HANDLE_IDLE = \"var(--rpl-color-resize-handle-idle, rgba(255, 255, 255, 0.0))\";\nexport const COLOR_RESIZE_HANDLE_HOVER = \"var(--rpl-color-resize-handle-hover, rgba(33, 150, 243, 0.35))\";\nexport const COLOR_RESIZE_HANDLE_ACTIVE = \"var(--rpl-color-resize-handle-active, rgba(33, 150, 243, 0.55))\";\n\n/**\n * Drop suggestion overlay colors\n */\nexport const COLOR_DROP_SUGGEST_BORDER = \"var(--rpl-color-drop-suggest-border, rgba(90, 150, 255, 0.9))\";\nexport const COLOR_DROP_SUGGEST_BG = \"var(--rpl-color-drop-suggest-bg, rgba(90, 150, 255, 0.15))\";\n\n/**\n * Tab drag overlay colors\n */\nexport const COLOR_TABDRAG_BG = \"var(--rpl-color-tabdrag-bg, rgba(34, 36, 42, 0.95))\";\nexport const COLOR_TABDRAG_FG = \"var(--rpl-color-tabdrag-fg, #e9ebf0)\";\nexport const COLOR_TABDRAG_BORDER = \"var(--rpl-color-tabdrag-border, rgba(120, 160, 255, 0.6))\";\nexport const COLOR_TABDRAG_SHADOW = \"var(--rpl-color-tabdrag-shadow, 0 6px 20px rgba(0, 0, 0, 0.35))\";\n\n/**\n * Insert guide colors\n */\nexport const COLOR_INSERT_GUIDE = \"var(--rpl-color-insert-guide, rgba(120, 160, 255, 0.95))\";\nexport const COLOR_INSERT_GUIDE_SHADOW = \"var(--rpl-color-insert-guide-shadow, 0 0 0 2px rgba(120, 160, 255, 0.2))\";\n\n/**\n * Node editor / floating panel colors\n * These are used by Drawer and FloatingPanelFrame components\n */\nexport const COLOR_NODE_EDITOR_SURFACE = \"var(--rpl-color-surface, #fff)\";\nexport const COLOR_NODE_EDITOR_SURFACE_2 = \"var(--rpl-color-surface-2, #fafafa)\";\nexport const COLOR_NODE_EDITOR_BORDER = \"var(--rpl-color-border, #e5e7eb)\";\nexport const COLOR_NODE_EDITOR_MUTED_FG = \"var(--rpl-color-muted-fg, #6b7280)\";\nexport const COLOR_NODE_EDITOR_CARD_SHADOW = \"var(--rpl-shadow-card, 0 2px 10px rgba(0, 0, 0, 0.08))\";\nexport const COLOR_DRAWER_BACKDROP = \"var(--rpl-color-drawer-backdrop, rgba(0, 0, 0, 0.5))\";\n\n/**\n * Drawer transitions\n */\nexport const DRAWER_TRANSITION_DURATION = \"var(--rpl-drawer-transition-duration, 220ms)\";\nexport const DRAWER_TRANSITION_EASING = \"var(--rpl-drawer-transition-easing, cubic-bezier(0.22, 1, 0.36, 1))\";\n\n/**\n * Pivot animations\n * User defines @keyframes in their CSS and references via these tokens.\n * - Enter: Applied when content becomes active\n * - Leave: Applied when content becomes inactive\n */\nexport const PIVOT_ANIMATION_ENTER = \"var(--rpl-pivot-animation-enter, none)\";\nexport const PIVOT_ANIMATION_LEAVE = \"var(--rpl-pivot-animation-leave, none)\";\n\n/**\n * Pivot swipe animations\n * Used by SwipePivotContent for snap-back animation after swipe ends.\n */\nexport const PIVOT_SWIPE_SNAP_DURATION = \"var(--rpl-pivot-swipe-snap-duration, 300ms)\";\nexport const PIVOT_SWIPE_SNAP_EASING = \"var(--rpl-pivot-swipe-snap-easing, cubic-bezier(0.22, 1, 0.36, 1))\";\n\n/**\n * Stack animations\n * User defines @keyframes in their CSS and references via these tokens.\n * - Push: Applied when a new panel is pushed onto the stack\n * - Pop: Applied when a panel is popped from the stack\n */\nexport const STACK_ANIMATION_PUSH = \"var(--rpl-stack-animation-push, none)\";\nexport const STACK_ANIMATION_POP = \"var(--rpl-stack-animation-pop, none)\";\nexport const STACK_TRANSITION_DURATION = \"var(--rpl-stack-transition-duration, 350ms)\";\nexport const STACK_TRANSITION_EASING = \"var(--rpl-stack-transition-easing, cubic-bezier(0.32, 0.72, 0, 1))\";\n\n// ========================================\n// SIZING & SPACING\n// ========================================\n\n/**\n * Tab sizing\n */\nexport const SIZE_TAB_FONT = \"var(--rpl-size-tab-font, 12px)\";\nexport const SPACE_TAB_PADDING_Y = \"var(--rpl-space-tab-padding-y, 4px)\";\nexport const SPACE_TAB_PADDING_X = \"var(--rpl-space-tab-padding-x, 8px)\";\n\n/**\n * Tabbar spacing\n */\nexport const SPACE_TABBAR_GAP = \"var(--rpl-space-tabbar-gap, 6px)\";\nexport const SPACE_TABBAR_PADDING_Y = \"var(--rpl-space-tabbar-padding-y, 4px)\";\nexport const SPACE_TABBAR_PADDING_X = \"var(--rpl-space-tabbar-padding-x, 6px)\";\n\n/**\n * Border radius (decorative, using CSS variables)\n */\nexport const RADIUS_TAB = \"var(--rpl-radius-tab, 4px)\";\nexport const RADIUS_SUGGEST = \"var(--rpl-radius-suggest, 6px)\";\n\n/**\n * Border widths\n */\nexport const SIZE_SUGGEST_BORDER = \"var(--rpl-size-suggest-border, 2px)\";\n\n/**\n * Handle thicknesses\n * Note: SIZE_GRID_HANDLE_THICKNESS is kept as number for JavaScript calculations\n */\nexport const SIZE_GRID_HANDLE_THICKNESS = 4; // Used in GridTrackResizeHandle.tsx for offset calculation\nexport const SIZE_RESIZE_HANDLE_THICKNESS = \"var(--rpl-size-resize-handle-thickness, 4px)\";\nexport const SIZE_SPLIT_HANDLE_THICKNESS = \"var(--rpl-size-split-handle-thickness, 6px)\";\n\n/**\n * Drop suggest padding\n */\nexport const SPACE_DROP_SUGGEST_PADDING = \"var(--rpl-space-drop-suggest-padding, 6px)\";\n\n// ========================================\n// Z-INDEXES\n// ========================================\n\nexport const Z_OVERLAY = \"var(--rpl-z-overlay, 9998)\";\nexport const Z_TABDRAG_OVERLAY = \"var(--rpl-z-tabdrag-overlay, 9999)\";\nexport const Z_DIALOG_OVERLAY = \"var(--rpl-z-dialog-overlay, 10000)\";\n\n// ========================================\n// COMPONENT-SPECIFIC CONSTANTS\n// ========================================\n\n/**\n * Resize Handle\n */\nexport const RESIZE_HANDLE_THICKNESS = SIZE_RESIZE_HANDLE_THICKNESS;\nexport const RESIZE_HANDLE_Z_INDEX = \"var(--rpl-z-resize-handle, 1000)\";\n\n/**\n * Grid Track Resize Handle\n */\nexport const GRID_HANDLE_THICKNESS = SIZE_GRID_HANDLE_THICKNESS;\n\n/**\n * Grid Layer Resize Handles\n */\nexport const GRID_LAYER_CORNER_HIT_SIZE = \"var(--rpl-size-grid-layer-corner-hit, 14px)\";\nexport const GRID_LAYER_EDGE_HIT_THICKNESS = \"var(--rpl-size-grid-layer-edge-hit-thickness, 12px)\";\n\n/**\n * Drop Suggest Overlay\n */\nexport const DROP_SUGGEST_Z_INDEX = Z_OVERLAY;\nexport const DROP_SUGGEST_BORDER_WIDTH = SIZE_SUGGEST_BORDER;\nexport const DROP_SUGGEST_BORDER_RADIUS = RADIUS_SUGGEST;\nexport const DROP_SUGGEST_BORDER_COLOR = COLOR_DROP_SUGGEST_BORDER;\nexport const DROP_SUGGEST_BG_COLOR = COLOR_DROP_SUGGEST_BG;\nexport const DROP_SUGGEST_PADDING = SPACE_DROP_SUGGEST_PADDING;\nexport const DROP_SUGGEST_PADDING_PX = 6;\n\n/**\n * Tab Drag Overlay\n */\nexport const TAB_DRAG_OVERLAY_Z_INDEX = Z_TABDRAG_OVERLAY;\nexport const TAB_DRAG_PREVIEW_OFFSET_X = \"var(--rpl-space-tab-drag-preview-offset-x, 12px)\";\nexport const TAB_DRAG_PREVIEW_OFFSET_Y = \"var(--rpl-space-tab-drag-preview-offset-y, 12px)\";\nexport const TAB_DRAG_PREVIEW_BORDER_RADIUS = \"var(--rpl-radius-tab-drag-preview, 6px)\";\nexport const TAB_DRAG_PREVIEW_PADDING_Y = \"var(--rpl-space-tab-drag-preview-padding-y, 4px)\";\nexport const TAB_DRAG_PREVIEW_PADDING_X = \"var(--rpl-space-tab-drag-preview-padding-x, 8px)\";\nexport const TAB_DRAG_PREVIEW_FONT_SIZE = \"var(--rpl-size-tab-drag-preview-font, 12px)\";\nexport const TAB_DRAG_INSERT_GUIDE_WIDTH = \"var(--rpl-size-tab-drag-insert-guide-width, 2px)\";\nexport const TAB_DRAG_INSERT_GUIDE_BORDER_RADIUS = \"var(--rpl-radius-tab-drag-insert-guide, 1px)\";\nexport const TAB_DRAG_PREVIEW_BG_COLOR = COLOR_TABDRAG_BG;\nexport const TAB_DRAG_PREVIEW_FG_COLOR = COLOR_TABDRAG_FG;\nexport const TAB_DRAG_PREVIEW_BORDER_COLOR = COLOR_TABDRAG_BORDER;\nexport const TAB_DRAG_PREVIEW_SHADOW = COLOR_TABDRAG_SHADOW;\nexport const TAB_DRAG_INSERT_GUIDE_COLOR = COLOR_INSERT_GUIDE;\nexport const TAB_DRAG_INSERT_GUIDE_SHADOW = COLOR_INSERT_GUIDE_SHADOW;\n\n/**\n * Dialog Overlay\n */\nexport const DIALOG_OVERLAY_Z_INDEX = Z_DIALOG_OVERLAY;\n\n/**\n * Floating Panel Frame\n */\nexport const FLOATING_PANEL_BORDER_RADIUS = \"var(--rpl-radius-floating-panel, 8px)\";\nexport const FLOATING_PANEL_GAP = \"var(--rpl-space-floating-panel-gap, 8px)\";\nexport const FLOATING_PANEL_HEADER_PADDING_Y = \"var(--rpl-space-floating-panel-header-padding-y, 8px)\";\nexport const FLOATING_PANEL_HEADER_PADDING_X = \"var(--rpl-space-floating-panel-header-padding-x, 12px)\";\nexport const FLOATING_PANEL_CONTENT_PADDING = \"var(--rpl-space-floating-panel-content-padding, 12px)\";\nexport const FLOATING_PANEL_META_FONT_SIZE = \"var(--rpl-size-floating-panel-meta-font, 12px)\";\nexport const FLOATING_PANEL_CONTROLS_GAP = \"var(--rpl-space-floating-panel-controls-gap, 6px)\";\nexport const FLOATING_PANEL_CLOSE_BUTTON_FONT_SIZE = \"var(--rpl-size-floating-panel-close-button-font, 1.25rem)\";\nexport const FLOATING_PANEL_CLOSE_BUTTON_PADDING =\n \"var(--rpl-space-floating-panel-close-button-padding, 0.25rem 0.5rem)\";\nexport const FLOATING_PANEL_SURFACE_COLOR = COLOR_NODE_EDITOR_SURFACE;\nexport const FLOATING_PANEL_SURFACE_2_COLOR = COLOR_NODE_EDITOR_SURFACE_2;\nexport const FLOATING_PANEL_BORDER_COLOR = COLOR_NODE_EDITOR_BORDER;\nexport const FLOATING_PANEL_MUTED_FG_COLOR = COLOR_NODE_EDITOR_MUTED_FG;\nexport const FLOATING_PANEL_SHADOW = COLOR_NODE_EDITOR_CARD_SHADOW;\n\n/**\n * Drawer\n */\nexport const DRAWER_HEADER_PADDING_Y = \"var(--rpl-space-drawer-header-padding-y, 10px)\";\nexport const DRAWER_HEADER_PADDING_X = \"var(--rpl-space-drawer-header-padding-x, 12px)\";\nexport const DRAWER_HEADER_GAP = \"var(--rpl-space-drawer-header-gap, 8px)\";\nexport const DRAWER_CONTENT_PADDING = \"var(--rpl-space-drawer-content-padding, 12px)\";\nexport const DRAWER_CLOSE_BUTTON_FONT_SIZE = \"var(--rpl-size-drawer-close-button-font, 18px)\";\nexport const DRAWER_SURFACE_COLOR = COLOR_NODE_EDITOR_SURFACE;\nexport const DRAWER_BORDER_COLOR = COLOR_NODE_EDITOR_BORDER;\nexport const DRAWER_SHADOW = COLOR_NODE_EDITOR_CARD_SHADOW;\n\n/**\n * Split Handles\n */\nexport const SPLIT_HANDLE_THICKNESS = SIZE_SPLIT_HANDLE_THICKNESS;\n\n/**\n * HorizontalDivider\n */\nexport const HORIZONTAL_DIVIDER_WIDTH = \"var(--rpl-size-horizontal-divider-width, 4px)\";\nexport const HORIZONTAL_DIVIDER_HIT_AREA_OFFSET = \"var(--rpl-space-horizontal-divider-hit-area-offset, 4px)\";\n"],"names":["CSS_VAR_PREFIX","COLOR_RESIZE_HANDLE_IDLE","COLOR_RESIZE_HANDLE_HOVER","COLOR_RESIZE_HANDLE_ACTIVE","COLOR_DROP_SUGGEST_BORDER","COLOR_DROP_SUGGEST_BG","COLOR_INSERT_GUIDE","COLOR_INSERT_GUIDE_SHADOW","COLOR_NODE_EDITOR_SURFACE","COLOR_NODE_EDITOR_SURFACE_2","COLOR_NODE_EDITOR_BORDER","COLOR_NODE_EDITOR_MUTED_FG","COLOR_NODE_EDITOR_CARD_SHADOW","COLOR_DRAWER_BACKDROP","DRAWER_TRANSITION_DURATION","DRAWER_TRANSITION_EASING","PIVOT_ANIMATION_ENTER","PIVOT_ANIMATION_LEAVE","STACK_ANIMATION_PUSH","STACK_ANIMATION_POP","STACK_TRANSITION_DURATION","STACK_TRANSITION_EASING","RADIUS_SUGGEST","SIZE_SUGGEST_BORDER","SIZE_RESIZE_HANDLE_THICKNESS","SIZE_SPLIT_HANDLE_THICKNESS","Z_OVERLAY","Z_TABDRAG_OVERLAY","Z_DIALOG_OVERLAY","RESIZE_HANDLE_THICKNESS","RESIZE_HANDLE_Z_INDEX","GRID_HANDLE_THICKNESS","GRID_LAYER_CORNER_HIT_SIZE","GRID_LAYER_EDGE_HIT_THICKNESS","DROP_SUGGEST_Z_INDEX","DROP_SUGGEST_BORDER_WIDTH","DROP_SUGGEST_BORDER_RADIUS","DROP_SUGGEST_BORDER_COLOR","DROP_SUGGEST_BG_COLOR","DROP_SUGGEST_PADDING_PX","TAB_DRAG_OVERLAY_Z_INDEX","TAB_DRAG_PREVIEW_OFFSET_X","TAB_DRAG_PREVIEW_OFFSET_Y","TAB_DRAG_INSERT_GUIDE_WIDTH","TAB_DRAG_INSERT_GUIDE_BORDER_RADIUS","TAB_DRAG_INSERT_GUIDE_COLOR","TAB_DRAG_INSERT_GUIDE_SHADOW","DIALOG_OVERLAY_Z_INDEX","FLOATING_PANEL_BORDER_RADIUS","FLOATING_PANEL_GAP","FLOATING_PANEL_HEADER_PADDING_Y","FLOATING_PANEL_HEADER_PADDING_X","FLOATING_PANEL_CONTENT_PADDING","FLOATING_PANEL_META_FONT_SIZE","FLOATING_PANEL_CONTROLS_GAP","FLOATING_PANEL_CLOSE_BUTTON_FONT_SIZE","FLOATING_PANEL_CLOSE_BUTTON_PADDING","FLOATING_PANEL_SURFACE_COLOR","FLOATING_PANEL_SURFACE_2_COLOR","FLOATING_PANEL_BORDER_COLOR","FLOATING_PANEL_MUTED_FG_COLOR","FLOATING_PANEL_SHADOW","DRAWER_HEADER_PADDING_Y","DRAWER_HEADER_PADDING_X","DRAWER_HEADER_GAP","DRAWER_CONTENT_PADDING","SPLIT_HANDLE_THICKNESS","HORIZONTAL_DIVIDER_WIDTH"],"mappings":"AAuBO,MAAMA,IAAiB,OAuBjBC,IAA2B,iEAC3BC,IAA4B,kEAC5BC,IAA6B,mEAK7BC,IAA4B,iEAC5BC,IAAwB,8DAaxBC,IAAqB,4DACrBC,IAA4B,4EAM5BC,IAA4B,kCAC5BC,IAA8B,uCAC9BC,IAA2B,oCAC3BC,IAA6B,sCAC7BC,IAAgC,0DAChCC,IAAwB,wDAKxBC,IAA6B,gDAC7BC,IAA2B,uEAQ3BC,IAAwB,0CACxBC,IAAwB,0CAexBC,IAAuB,yCACvBC,IAAsB,wCACtBC,IAA4B,+CAC5BC,IAA0B,sEAwB1BC,IAAiB,kCAKjBC,IAAsB;AAO5B,MAAMC,IAA+B,gDAC/BC,IAA8B,+CAW9BC,IAAY,8BACZC,IAAoB,sCACpBC,IAAmB,sCASnBC,IAA0BL,GAC1BM,IAAwB,oCAKxBC,IAAwB,GAKxBC,IAA6B,+CAC7BC,IAAgC,uDAKhCC,IAAuBR,GACvBS,IAA4BZ,GAC5Ba,IAA6Bd,GAC7Be,IAA4BjC,GAC5BkC,IAAwBjC,GAExBkC,IAA0B,GAK1BC,IAA2Bb,GAC3Bc,IAA4B,oDAC5BC,IAA4B,oDAK5BC,IAA8B,oDAC9BC,IAAsC,gDAKtCC,IAA8BvC,GAC9BwC,IAA+BvC,GAK/BwC,IAAyBnB,GAKzBoB,IAA+B,yCAC/BC,IAAqB,4CACrBC,IAAkC,yDAClCC,IAAkC,0DAClCC,IAAiC,yDACjCC,IAAgC,kDAChCC,KAA8B,qDAC9BC,KAAwC,6DACxCC,KACX,wEACWC,KAA+BjD,GAC/BkD,KAAiCjD,GACjCkD,KAA8BjD,GAC9BkD,KAAgCjD,GAChCkD,KAAwBjD,GAKxBkD,KAA0B,kDAC1BC,KAA0B,kDAC1BC,KAAoB,2CACpBC,KAAyB,iDASzBC,KAAyBzC,GAKzB0C,KAA2B;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const _="var(--rpl-color-resize-handle-idle, rgba(255, 255, 255, 0.0))",E="var(--rpl-color-resize-handle-hover, rgba(33, 150, 243, 0.35))",A="var(--rpl-color-resize-handle-active, rgba(33, 150, 243, 0.55))",R="var(--rpl-color-drop-suggest-border, rgba(90, 150, 255, 0.9))",O="var(--rpl-color-drop-suggest-bg, rgba(90, 150, 255, 0.15))",I="var(--rpl-color-insert-guide, rgba(120, 160, 255, 0.95))",r="var(--rpl-color-insert-guide-shadow, 0 0 0 2px rgba(120, 160, 255, 0.2))",D="var(--rpl-color-surface, #fff)",N="var(--rpl-color-surface-2, #fafafa)",T="var(--rpl-color-border, #e5e7eb)",a="var(--rpl-color-muted-fg, #6b7280)",S="var(--rpl-shadow-card, 0 2px 10px rgba(0, 0, 0, 0.08))",n="var(--rpl-color-drawer-backdrop, rgba(0, 0, 0, 0.5))",o="var(--rpl-drawer-transition-duration, 220ms)",s="var(--rpl-drawer-transition-easing, cubic-bezier(0.22, 1, 0.36, 1))",t="var(--rpl-pivot-animation-enter, none)",L="var(--rpl-pivot-animation-leave, none)",G="var(--rpl-stack-animation-push, none)",e="var(--rpl-stack-animation-pop, none)",p="var(--rpl-stack-transition-duration, 350ms)",c="var(--rpl-stack-transition-easing, cubic-bezier(0.32, 0.72, 0, 1))",l="var(--rpl-radius-suggest, 6px)",P="var(--rpl-size-suggest-border, 2px)";const i="var(--rpl-size-resize-handle-thickness, 4px)",C="var(--rpl-size-split-handle-thickness, 6px)",d="var(--rpl-z-overlay, 9998)",H="var(--rpl-z-tabdrag-overlay, 9999)",v="var(--rpl-z-dialog-overlay, 10000)",g=i,F="var(--rpl-z-resize-handle, 1000)",U=4,B="var(--rpl-size-grid-layer-corner-hit, 14px)",Z="var(--rpl-size-grid-layer-edge-hit-thickness, 12px)",W=d,x=P,b=l,V=R,f=O,h=6,u=H,K="var(--rpl-space-tab-drag-preview-offset-x, 12px)",z="var(--rpl-space-tab-drag-preview-offset-y, 12px)",X="var(--rpl-size-tab-drag-insert-guide-width, 2px)",Y="var(--rpl-radius-tab-drag-insert-guide, 1px)",w=I,M=r,m=v,k="var(--rpl-radius-floating-panel, 8px)",y="var(--rpl-space-floating-panel-gap, 8px)",j="var(--rpl-space-floating-panel-header-padding-y, 8px)",q="var(--rpl-space-floating-panel-header-padding-x, 12px)",J="var(--rpl-space-floating-panel-content-padding, 12px)",Q="var(--rpl-size-floating-panel-meta-font, 12px)",$="var(--rpl-space-floating-panel-controls-gap, 6px)",__="var(--rpl-size-floating-panel-close-button-font, 1.25rem)",E_="var(--rpl-space-floating-panel-close-button-padding, 0.25rem 0.5rem)",A_=D,R_=N,O_=T,I_=a,r_=S,D_="var(--rpl-space-drawer-header-padding-y, 10px)",N_="var(--rpl-space-drawer-header-padding-x, 12px)",T_="var(--rpl-space-drawer-header-gap, 8px)",a_="var(--rpl-space-drawer-content-padding, 12px)",S_=C,n_="var(--rpl-size-horizontal-divider-width, 4px)";exports.COLOR_DRAWER_BACKDROP=n;exports.COLOR_RESIZE_HANDLE_ACTIVE=A;exports.COLOR_RESIZE_HANDLE_HOVER=E;exports.COLOR_RESIZE_HANDLE_IDLE=_;exports.CSS_VAR_PREFIX="rpl";exports.DIALOG_OVERLAY_Z_INDEX=m;exports.DRAWER_CONTENT_PADDING=a_;exports.DRAWER_HEADER_GAP=T_;exports.DRAWER_HEADER_PADDING_X=N_;exports.DRAWER_HEADER_PADDING_Y=D_;exports.DRAWER_TRANSITION_DURATION=o;exports.DRAWER_TRANSITION_EASING=s;exports.DROP_SUGGEST_BG_COLOR=f;exports.DROP_SUGGEST_BORDER_COLOR=V;exports.DROP_SUGGEST_BORDER_RADIUS=b;exports.DROP_SUGGEST_BORDER_WIDTH=x;exports.DROP_SUGGEST_PADDING_PX=h;exports.DROP_SUGGEST_Z_INDEX=W;exports.FLOATING_PANEL_BORDER_COLOR=O_;exports.FLOATING_PANEL_BORDER_RADIUS=k;exports.FLOATING_PANEL_CLOSE_BUTTON_FONT_SIZE=__;exports.FLOATING_PANEL_CLOSE_BUTTON_PADDING=E_;exports.FLOATING_PANEL_CONTENT_PADDING=J;exports.FLOATING_PANEL_CONTROLS_GAP=$;exports.FLOATING_PANEL_GAP=y;exports.FLOATING_PANEL_HEADER_PADDING_X=q;exports.FLOATING_PANEL_HEADER_PADDING_Y=j;exports.FLOATING_PANEL_META_FONT_SIZE=Q;exports.FLOATING_PANEL_MUTED_FG_COLOR=I_;exports.FLOATING_PANEL_SHADOW=r_;exports.FLOATING_PANEL_SURFACE_2_COLOR=R_;exports.FLOATING_PANEL_SURFACE_COLOR=A_;exports.GRID_HANDLE_THICKNESS=U;exports.GRID_LAYER_CORNER_HIT_SIZE=B;exports.GRID_LAYER_EDGE_HIT_THICKNESS=Z;exports.HORIZONTAL_DIVIDER_WIDTH=n_;exports.PIVOT_ANIMATION_ENTER=t;exports.PIVOT_ANIMATION_LEAVE=L;exports.RESIZE_HANDLE_THICKNESS=g;exports.RESIZE_HANDLE_Z_INDEX=F;exports.SPLIT_HANDLE_THICKNESS=S_;exports.STACK_ANIMATION_POP=e;exports.STACK_ANIMATION_PUSH=G;exports.STACK_TRANSITION_DURATION=p;exports.STACK_TRANSITION_EASING=c;exports.TAB_DRAG_INSERT_GUIDE_BORDER_RADIUS=Y;exports.TAB_DRAG_INSERT_GUIDE_COLOR=w;exports.TAB_DRAG_INSERT_GUIDE_SHADOW=M;exports.TAB_DRAG_INSERT_GUIDE_WIDTH=X;exports.TAB_DRAG_OVERLAY_Z_INDEX=u;exports.TAB_DRAG_PREVIEW_OFFSET_X=K;exports.TAB_DRAG_PREVIEW_OFFSET_Y=z;
2
+ //# sourceMappingURL=styles-qf6ptVLD.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles-qf6ptVLD.cjs","sources":["../src/constants/styles.ts"],"sourcesContent":["/**\n * @file Style constants for library components\n *\n * All style values are defined here with CSS variable fallbacks.\n * Users can override these via CSS variables (--rpl-*).\n *\n * All CSS variables use the unified prefix: --rpl- (react-panel-layout)\n *\n * @example\n * // In your CSS:\n * :root {\n * --rpl-color-primary: #ff0000;\n * }\n */\n\n// ========================================\n// CSS VARIABLE PREFIX\n// ========================================\n\n/**\n * Unified CSS variable prefix for all react-panel-layout variables\n * All theme variables use this prefix: --rpl-*\n */\nexport const CSS_VAR_PREFIX = \"rpl\";\n\n// ========================================\n// COLORS\n// ========================================\n\n/**\n * Tab colors - used in TabBar component\n */\nexport const COLOR_TAB_FG = \"var(--rpl-color-tab-fg, #d5d7de)\";\nexport const COLOR_TAB_ACTIVE_BG = \"var(--rpl-color-tab-active-bg, #2b2d35)\";\nexport const COLOR_TABBAR_BG = \"var(--rpl-color-tabbar-bg, #1e1f24)\";\n\n/**\n * Panel colors - used in panel layouts\n */\nexport const COLOR_PANEL_BORDER = \"var(--rpl-color-panel-border, rgba(0, 0, 0, 0.3))\";\nexport const COLOR_PANEL_BG = \"var(--rpl-color-panel-bg, #0b0b0c)\";\n\n/**\n * Primary color - used for resize handles, highlights\n */\nexport const COLOR_PRIMARY = \"var(--rpl-color-primary, #2196f3)\";\nexport const COLOR_RESIZE_HANDLE_IDLE = \"var(--rpl-color-resize-handle-idle, rgba(255, 255, 255, 0.0))\";\nexport const COLOR_RESIZE_HANDLE_HOVER = \"var(--rpl-color-resize-handle-hover, rgba(33, 150, 243, 0.35))\";\nexport const COLOR_RESIZE_HANDLE_ACTIVE = \"var(--rpl-color-resize-handle-active, rgba(33, 150, 243, 0.55))\";\n\n/**\n * Drop suggestion overlay colors\n */\nexport const COLOR_DROP_SUGGEST_BORDER = \"var(--rpl-color-drop-suggest-border, rgba(90, 150, 255, 0.9))\";\nexport const COLOR_DROP_SUGGEST_BG = \"var(--rpl-color-drop-suggest-bg, rgba(90, 150, 255, 0.15))\";\n\n/**\n * Tab drag overlay colors\n */\nexport const COLOR_TABDRAG_BG = \"var(--rpl-color-tabdrag-bg, rgba(34, 36, 42, 0.95))\";\nexport const COLOR_TABDRAG_FG = \"var(--rpl-color-tabdrag-fg, #e9ebf0)\";\nexport const COLOR_TABDRAG_BORDER = \"var(--rpl-color-tabdrag-border, rgba(120, 160, 255, 0.6))\";\nexport const COLOR_TABDRAG_SHADOW = \"var(--rpl-color-tabdrag-shadow, 0 6px 20px rgba(0, 0, 0, 0.35))\";\n\n/**\n * Insert guide colors\n */\nexport const COLOR_INSERT_GUIDE = \"var(--rpl-color-insert-guide, rgba(120, 160, 255, 0.95))\";\nexport const COLOR_INSERT_GUIDE_SHADOW = \"var(--rpl-color-insert-guide-shadow, 0 0 0 2px rgba(120, 160, 255, 0.2))\";\n\n/**\n * Node editor / floating panel colors\n * These are used by Drawer and FloatingPanelFrame components\n */\nexport const COLOR_NODE_EDITOR_SURFACE = \"var(--rpl-color-surface, #fff)\";\nexport const COLOR_NODE_EDITOR_SURFACE_2 = \"var(--rpl-color-surface-2, #fafafa)\";\nexport const COLOR_NODE_EDITOR_BORDER = \"var(--rpl-color-border, #e5e7eb)\";\nexport const COLOR_NODE_EDITOR_MUTED_FG = \"var(--rpl-color-muted-fg, #6b7280)\";\nexport const COLOR_NODE_EDITOR_CARD_SHADOW = \"var(--rpl-shadow-card, 0 2px 10px rgba(0, 0, 0, 0.08))\";\nexport const COLOR_DRAWER_BACKDROP = \"var(--rpl-color-drawer-backdrop, rgba(0, 0, 0, 0.5))\";\n\n/**\n * Drawer transitions\n */\nexport const DRAWER_TRANSITION_DURATION = \"var(--rpl-drawer-transition-duration, 220ms)\";\nexport const DRAWER_TRANSITION_EASING = \"var(--rpl-drawer-transition-easing, cubic-bezier(0.22, 1, 0.36, 1))\";\n\n/**\n * Pivot animations\n * User defines @keyframes in their CSS and references via these tokens.\n * - Enter: Applied when content becomes active\n * - Leave: Applied when content becomes inactive\n */\nexport const PIVOT_ANIMATION_ENTER = \"var(--rpl-pivot-animation-enter, none)\";\nexport const PIVOT_ANIMATION_LEAVE = \"var(--rpl-pivot-animation-leave, none)\";\n\n/**\n * Pivot swipe animations\n * Used by SwipePivotContent for snap-back animation after swipe ends.\n */\nexport const PIVOT_SWIPE_SNAP_DURATION = \"var(--rpl-pivot-swipe-snap-duration, 300ms)\";\nexport const PIVOT_SWIPE_SNAP_EASING = \"var(--rpl-pivot-swipe-snap-easing, cubic-bezier(0.22, 1, 0.36, 1))\";\n\n/**\n * Stack animations\n * User defines @keyframes in their CSS and references via these tokens.\n * - Push: Applied when a new panel is pushed onto the stack\n * - Pop: Applied when a panel is popped from the stack\n */\nexport const STACK_ANIMATION_PUSH = \"var(--rpl-stack-animation-push, none)\";\nexport const STACK_ANIMATION_POP = \"var(--rpl-stack-animation-pop, none)\";\nexport const STACK_TRANSITION_DURATION = \"var(--rpl-stack-transition-duration, 350ms)\";\nexport const STACK_TRANSITION_EASING = \"var(--rpl-stack-transition-easing, cubic-bezier(0.32, 0.72, 0, 1))\";\n\n// ========================================\n// SIZING & SPACING\n// ========================================\n\n/**\n * Tab sizing\n */\nexport const SIZE_TAB_FONT = \"var(--rpl-size-tab-font, 12px)\";\nexport const SPACE_TAB_PADDING_Y = \"var(--rpl-space-tab-padding-y, 4px)\";\nexport const SPACE_TAB_PADDING_X = \"var(--rpl-space-tab-padding-x, 8px)\";\n\n/**\n * Tabbar spacing\n */\nexport const SPACE_TABBAR_GAP = \"var(--rpl-space-tabbar-gap, 6px)\";\nexport const SPACE_TABBAR_PADDING_Y = \"var(--rpl-space-tabbar-padding-y, 4px)\";\nexport const SPACE_TABBAR_PADDING_X = \"var(--rpl-space-tabbar-padding-x, 6px)\";\n\n/**\n * Border radius (decorative, using CSS variables)\n */\nexport const RADIUS_TAB = \"var(--rpl-radius-tab, 4px)\";\nexport const RADIUS_SUGGEST = \"var(--rpl-radius-suggest, 6px)\";\n\n/**\n * Border widths\n */\nexport const SIZE_SUGGEST_BORDER = \"var(--rpl-size-suggest-border, 2px)\";\n\n/**\n * Handle thicknesses\n * Note: SIZE_GRID_HANDLE_THICKNESS is kept as number for JavaScript calculations\n */\nexport const SIZE_GRID_HANDLE_THICKNESS = 4; // Used in GridTrackResizeHandle.tsx for offset calculation\nexport const SIZE_RESIZE_HANDLE_THICKNESS = \"var(--rpl-size-resize-handle-thickness, 4px)\";\nexport const SIZE_SPLIT_HANDLE_THICKNESS = \"var(--rpl-size-split-handle-thickness, 6px)\";\n\n/**\n * Drop suggest padding\n */\nexport const SPACE_DROP_SUGGEST_PADDING = \"var(--rpl-space-drop-suggest-padding, 6px)\";\n\n// ========================================\n// Z-INDEXES\n// ========================================\n\nexport const Z_OVERLAY = \"var(--rpl-z-overlay, 9998)\";\nexport const Z_TABDRAG_OVERLAY = \"var(--rpl-z-tabdrag-overlay, 9999)\";\nexport const Z_DIALOG_OVERLAY = \"var(--rpl-z-dialog-overlay, 10000)\";\n\n// ========================================\n// COMPONENT-SPECIFIC CONSTANTS\n// ========================================\n\n/**\n * Resize Handle\n */\nexport const RESIZE_HANDLE_THICKNESS = SIZE_RESIZE_HANDLE_THICKNESS;\nexport const RESIZE_HANDLE_Z_INDEX = \"var(--rpl-z-resize-handle, 1000)\";\n\n/**\n * Grid Track Resize Handle\n */\nexport const GRID_HANDLE_THICKNESS = SIZE_GRID_HANDLE_THICKNESS;\n\n/**\n * Grid Layer Resize Handles\n */\nexport const GRID_LAYER_CORNER_HIT_SIZE = \"var(--rpl-size-grid-layer-corner-hit, 14px)\";\nexport const GRID_LAYER_EDGE_HIT_THICKNESS = \"var(--rpl-size-grid-layer-edge-hit-thickness, 12px)\";\n\n/**\n * Drop Suggest Overlay\n */\nexport const DROP_SUGGEST_Z_INDEX = Z_OVERLAY;\nexport const DROP_SUGGEST_BORDER_WIDTH = SIZE_SUGGEST_BORDER;\nexport const DROP_SUGGEST_BORDER_RADIUS = RADIUS_SUGGEST;\nexport const DROP_SUGGEST_BORDER_COLOR = COLOR_DROP_SUGGEST_BORDER;\nexport const DROP_SUGGEST_BG_COLOR = COLOR_DROP_SUGGEST_BG;\nexport const DROP_SUGGEST_PADDING = SPACE_DROP_SUGGEST_PADDING;\nexport const DROP_SUGGEST_PADDING_PX = 6;\n\n/**\n * Tab Drag Overlay\n */\nexport const TAB_DRAG_OVERLAY_Z_INDEX = Z_TABDRAG_OVERLAY;\nexport const TAB_DRAG_PREVIEW_OFFSET_X = \"var(--rpl-space-tab-drag-preview-offset-x, 12px)\";\nexport const TAB_DRAG_PREVIEW_OFFSET_Y = \"var(--rpl-space-tab-drag-preview-offset-y, 12px)\";\nexport const TAB_DRAG_PREVIEW_BORDER_RADIUS = \"var(--rpl-radius-tab-drag-preview, 6px)\";\nexport const TAB_DRAG_PREVIEW_PADDING_Y = \"var(--rpl-space-tab-drag-preview-padding-y, 4px)\";\nexport const TAB_DRAG_PREVIEW_PADDING_X = \"var(--rpl-space-tab-drag-preview-padding-x, 8px)\";\nexport const TAB_DRAG_PREVIEW_FONT_SIZE = \"var(--rpl-size-tab-drag-preview-font, 12px)\";\nexport const TAB_DRAG_INSERT_GUIDE_WIDTH = \"var(--rpl-size-tab-drag-insert-guide-width, 2px)\";\nexport const TAB_DRAG_INSERT_GUIDE_BORDER_RADIUS = \"var(--rpl-radius-tab-drag-insert-guide, 1px)\";\nexport const TAB_DRAG_PREVIEW_BG_COLOR = COLOR_TABDRAG_BG;\nexport const TAB_DRAG_PREVIEW_FG_COLOR = COLOR_TABDRAG_FG;\nexport const TAB_DRAG_PREVIEW_BORDER_COLOR = COLOR_TABDRAG_BORDER;\nexport const TAB_DRAG_PREVIEW_SHADOW = COLOR_TABDRAG_SHADOW;\nexport const TAB_DRAG_INSERT_GUIDE_COLOR = COLOR_INSERT_GUIDE;\nexport const TAB_DRAG_INSERT_GUIDE_SHADOW = COLOR_INSERT_GUIDE_SHADOW;\n\n/**\n * Dialog Overlay\n */\nexport const DIALOG_OVERLAY_Z_INDEX = Z_DIALOG_OVERLAY;\n\n/**\n * Floating Panel Frame\n */\nexport const FLOATING_PANEL_BORDER_RADIUS = \"var(--rpl-radius-floating-panel, 8px)\";\nexport const FLOATING_PANEL_GAP = \"var(--rpl-space-floating-panel-gap, 8px)\";\nexport const FLOATING_PANEL_HEADER_PADDING_Y = \"var(--rpl-space-floating-panel-header-padding-y, 8px)\";\nexport const FLOATING_PANEL_HEADER_PADDING_X = \"var(--rpl-space-floating-panel-header-padding-x, 12px)\";\nexport const FLOATING_PANEL_CONTENT_PADDING = \"var(--rpl-space-floating-panel-content-padding, 12px)\";\nexport const FLOATING_PANEL_META_FONT_SIZE = \"var(--rpl-size-floating-panel-meta-font, 12px)\";\nexport const FLOATING_PANEL_CONTROLS_GAP = \"var(--rpl-space-floating-panel-controls-gap, 6px)\";\nexport const FLOATING_PANEL_CLOSE_BUTTON_FONT_SIZE = \"var(--rpl-size-floating-panel-close-button-font, 1.25rem)\";\nexport const FLOATING_PANEL_CLOSE_BUTTON_PADDING =\n \"var(--rpl-space-floating-panel-close-button-padding, 0.25rem 0.5rem)\";\nexport const FLOATING_PANEL_SURFACE_COLOR = COLOR_NODE_EDITOR_SURFACE;\nexport const FLOATING_PANEL_SURFACE_2_COLOR = COLOR_NODE_EDITOR_SURFACE_2;\nexport const FLOATING_PANEL_BORDER_COLOR = COLOR_NODE_EDITOR_BORDER;\nexport const FLOATING_PANEL_MUTED_FG_COLOR = COLOR_NODE_EDITOR_MUTED_FG;\nexport const FLOATING_PANEL_SHADOW = COLOR_NODE_EDITOR_CARD_SHADOW;\n\n/**\n * Drawer\n */\nexport const DRAWER_HEADER_PADDING_Y = \"var(--rpl-space-drawer-header-padding-y, 10px)\";\nexport const DRAWER_HEADER_PADDING_X = \"var(--rpl-space-drawer-header-padding-x, 12px)\";\nexport const DRAWER_HEADER_GAP = \"var(--rpl-space-drawer-header-gap, 8px)\";\nexport const DRAWER_CONTENT_PADDING = \"var(--rpl-space-drawer-content-padding, 12px)\";\nexport const DRAWER_CLOSE_BUTTON_FONT_SIZE = \"var(--rpl-size-drawer-close-button-font, 18px)\";\nexport const DRAWER_SURFACE_COLOR = COLOR_NODE_EDITOR_SURFACE;\nexport const DRAWER_BORDER_COLOR = COLOR_NODE_EDITOR_BORDER;\nexport const DRAWER_SHADOW = COLOR_NODE_EDITOR_CARD_SHADOW;\n\n/**\n * Split Handles\n */\nexport const SPLIT_HANDLE_THICKNESS = SIZE_SPLIT_HANDLE_THICKNESS;\n\n/**\n * HorizontalDivider\n */\nexport const HORIZONTAL_DIVIDER_WIDTH = \"var(--rpl-size-horizontal-divider-width, 4px)\";\nexport const HORIZONTAL_DIVIDER_HIT_AREA_OFFSET = \"var(--rpl-space-horizontal-divider-hit-area-offset, 4px)\";\n"],"names":["COLOR_RESIZE_HANDLE_IDLE","COLOR_RESIZE_HANDLE_HOVER","COLOR_RESIZE_HANDLE_ACTIVE","COLOR_DROP_SUGGEST_BORDER","COLOR_DROP_SUGGEST_BG","COLOR_INSERT_GUIDE","COLOR_INSERT_GUIDE_SHADOW","COLOR_NODE_EDITOR_SURFACE","COLOR_NODE_EDITOR_SURFACE_2","COLOR_NODE_EDITOR_BORDER","COLOR_NODE_EDITOR_MUTED_FG","COLOR_NODE_EDITOR_CARD_SHADOW","COLOR_DRAWER_BACKDROP","DRAWER_TRANSITION_DURATION","DRAWER_TRANSITION_EASING","PIVOT_ANIMATION_ENTER","PIVOT_ANIMATION_LEAVE","STACK_ANIMATION_PUSH","STACK_ANIMATION_POP","STACK_TRANSITION_DURATION","STACK_TRANSITION_EASING","RADIUS_SUGGEST","SIZE_SUGGEST_BORDER","SIZE_RESIZE_HANDLE_THICKNESS","SIZE_SPLIT_HANDLE_THICKNESS","Z_OVERLAY","Z_TABDRAG_OVERLAY","Z_DIALOG_OVERLAY","RESIZE_HANDLE_THICKNESS","RESIZE_HANDLE_Z_INDEX","GRID_HANDLE_THICKNESS","GRID_LAYER_CORNER_HIT_SIZE","GRID_LAYER_EDGE_HIT_THICKNESS","DROP_SUGGEST_Z_INDEX","DROP_SUGGEST_BORDER_WIDTH","DROP_SUGGEST_BORDER_RADIUS","DROP_SUGGEST_BORDER_COLOR","DROP_SUGGEST_BG_COLOR","DROP_SUGGEST_PADDING_PX","TAB_DRAG_OVERLAY_Z_INDEX","TAB_DRAG_PREVIEW_OFFSET_X","TAB_DRAG_PREVIEW_OFFSET_Y","TAB_DRAG_INSERT_GUIDE_WIDTH","TAB_DRAG_INSERT_GUIDE_BORDER_RADIUS","TAB_DRAG_INSERT_GUIDE_COLOR","TAB_DRAG_INSERT_GUIDE_SHADOW","DIALOG_OVERLAY_Z_INDEX","FLOATING_PANEL_BORDER_RADIUS","FLOATING_PANEL_GAP","FLOATING_PANEL_HEADER_PADDING_Y","FLOATING_PANEL_HEADER_PADDING_X","FLOATING_PANEL_CONTENT_PADDING","FLOATING_PANEL_META_FONT_SIZE","FLOATING_PANEL_CONTROLS_GAP","FLOATING_PANEL_CLOSE_BUTTON_FONT_SIZE","FLOATING_PANEL_CLOSE_BUTTON_PADDING","FLOATING_PANEL_SURFACE_COLOR","FLOATING_PANEL_SURFACE_2_COLOR","FLOATING_PANEL_BORDER_COLOR","FLOATING_PANEL_MUTED_FG_COLOR","FLOATING_PANEL_SHADOW","DRAWER_HEADER_PADDING_Y","DRAWER_HEADER_PADDING_X","DRAWER_HEADER_GAP","DRAWER_CONTENT_PADDING","SPLIT_HANDLE_THICKNESS","HORIZONTAL_DIVIDER_WIDTH"],"mappings":"aA8CO,MAAMA,EAA2B,gEAC3BC,EAA4B,iEAC5BC,EAA6B,kEAK7BC,EAA4B,gEAC5BC,EAAwB,6DAaxBC,EAAqB,2DACrBC,EAA4B,2EAM5BC,EAA4B,iCAC5BC,EAA8B,sCAC9BC,EAA2B,mCAC3BC,EAA6B,qCAC7BC,EAAgC,yDAChCC,EAAwB,uDAKxBC,EAA6B,+CAC7BC,EAA2B,sEAQ3BC,EAAwB,yCACxBC,EAAwB,yCAexBC,EAAuB,wCACvBC,EAAsB,uCACtBC,EAA4B,8CAC5BC,EAA0B,qEAwB1BC,EAAiB,iCAKjBC,EAAsB,sCAO5B,MAAMC,EAA+B,+CAC/BC,EAA8B,8CAW9BC,EAAY,6BACZC,EAAoB,qCACpBC,EAAmB,qCASnBC,EAA0BL,EAC1BM,EAAwB,mCAKxBC,EAAwB,EAKxBC,EAA6B,8CAC7BC,EAAgC,sDAKhCC,EAAuBR,EACvBS,EAA4BZ,EAC5Ba,EAA6Bd,EAC7Be,EAA4BjC,EAC5BkC,EAAwBjC,EAExBkC,EAA0B,EAK1BC,EAA2Bb,EAC3Bc,EAA4B,mDAC5BC,EAA4B,mDAK5BC,EAA8B,mDAC9BC,EAAsC,+CAKtCC,EAA8BvC,EAC9BwC,EAA+BvC,EAK/BwC,EAAyBnB,EAKzBoB,EAA+B,wCAC/BC,EAAqB,2CACrBC,EAAkC,wDAClCC,EAAkC,yDAClCC,EAAiC,wDACjCC,EAAgC,iDAChCC,EAA8B,oDAC9BC,GAAwC,4DACxCC,GACX,uEACWC,GAA+BjD,EAC/BkD,GAAiCjD,EACjCkD,GAA8BjD,EAC9BkD,GAAgCjD,EAChCkD,GAAwBjD,EAKxBkD,GAA0B,iDAC1BC,GAA0B,iDAC1BC,GAAoB,0CACpBC,GAAyB,gDASzBC,GAAyBzC,EAKzB0C,GAA2B"}
@@ -0,0 +1,24 @@
1
+ import * as c from "react";
2
+ function C(u) {
3
+ const { resolveContent: s, validIds: o } = u, e = c.useRef(/* @__PURE__ */ new Map()), a = c.useRef(s);
4
+ a.current = s;
5
+ const f = c.useCallback((t) => {
6
+ const r = e.current.get(t);
7
+ if (r !== void 0)
8
+ return r;
9
+ const n = a.current(t);
10
+ return e.current.set(t, n), n;
11
+ }, []), l = c.useCallback(() => {
12
+ e.current.clear();
13
+ }, []);
14
+ return c.useEffect(() => {
15
+ const t = new Set(o);
16
+ e.current.forEach((r, n) => {
17
+ t.has(n) || e.current.delete(n);
18
+ });
19
+ }, [o]), { getCachedContent: f, clearCache: l };
20
+ }
21
+ export {
22
+ C as u
23
+ };
24
+ //# sourceMappingURL=useContentCache-CO3LYNmz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContentCache-CO3LYNmz.js","sources":["../src/hooks/useContentCache.tsx"],"sourcesContent":["/**\n * @file Shared content caching hook for preserving React component state.\n *\n * This hook provides a common pattern for caching ReactNode content by ID,\n * ensuring the same reference is returned for the same ID across re-renders.\n * This prevents component remounting when parent components re-create content arrays.\n *\n * Used by:\n * - PanelSystemContext (GridLayout layer content)\n * - usePivot (Pivot item content)\n * - ContentRegistry (Panel content)\n */\nimport * as React from \"react\";\n\n/**\n * Function type for resolving content by ID.\n * Called only when content is not already cached.\n */\nexport type ContentResolver<TId extends string = string> = (id: TId) => React.ReactNode | null;\n\n/**\n * Options for useContentCache hook.\n */\nexport type UseContentCacheOptions<TId extends string = string> = {\n /**\n * Function to resolve content by ID.\n * Called only when content is not already in cache.\n */\n resolveContent: ContentResolver<TId>;\n /**\n * Current valid IDs. Used to clean up stale cache entries.\n * When an ID is removed from this array, its cached content is deleted.\n */\n validIds: readonly TId[];\n};\n\n/**\n * Result from useContentCache hook.\n */\nexport type UseContentCacheResult<TId extends string = string> = {\n /**\n * Get cached content for an ID.\n * Returns the same ReactNode reference for the same ID.\n */\n getCachedContent: (id: TId) => React.ReactNode | null;\n /**\n * Clear all cached content.\n * Use when you need to force re-creation of all content.\n */\n clearCache: () => void;\n};\n\n/**\n * Hook for caching ReactNode content by ID.\n *\n * Ensures the same ReactNode reference is returned for the same ID,\n * preventing unnecessary component remounting when parent re-renders.\n *\n * @example\n * ```tsx\n * const { getCachedContent } = useContentCache({\n * resolveContent: (id) => items.find(i => i.id === id)?.content ?? null,\n * validIds: items.map(i => i.id),\n * });\n *\n * return items.map(item => (\n * <div key={item.id}>{getCachedContent(item.id)}</div>\n * ));\n * ```\n */\nexport function useContentCache<TId extends string = string>(\n options: UseContentCacheOptions<TId>,\n): UseContentCacheResult<TId> {\n const { resolveContent, validIds } = options;\n\n /**\n * Cache storage. Key: ID, Value: cached ReactNode.\n * Uses ref to persist across re-renders without triggering updates.\n */\n const cacheRef = React.useRef<Map<string, React.ReactNode>>(new Map());\n\n /**\n * Store resolveContent in a ref for stable getCachedContent function.\n * This allows getCachedContent to always use the latest resolver\n * without needing to be recreated.\n */\n const resolveContentRef = React.useRef(resolveContent);\n resolveContentRef.current = resolveContent;\n\n /**\n * Get or create cached content for an ID.\n * On first access, calls resolveContent and caches the result.\n * On subsequent accesses, returns the cached reference.\n */\n const getCachedContent = React.useCallback((id: TId): React.ReactNode | null => {\n const cached = cacheRef.current.get(id);\n if (cached !== undefined) {\n return cached;\n }\n\n const content = resolveContentRef.current(id);\n cacheRef.current.set(id, content);\n return content;\n }, []);\n\n /**\n * Clear all cached content.\n */\n const clearCache = React.useCallback((): void => {\n cacheRef.current.clear();\n }, []);\n\n /**\n * Clean up stale cache entries when validIds changes.\n * Removes entries for IDs that are no longer valid.\n */\n React.useEffect(() => {\n const currentValidIds = new Set<string>(validIds);\n cacheRef.current.forEach((_, id) => {\n if (!currentValidIds.has(id)) {\n cacheRef.current.delete(id);\n }\n });\n }, [validIds]);\n\n return { getCachedContent, clearCache };\n}\n"],"names":["useContentCache","options","resolveContent","validIds","cacheRef","React","resolveContentRef","getCachedContent","id","cached","content","clearCache","currentValidIds","_"],"mappings":";AAsEO,SAASA,EACdC,GAC4B;AAC5B,QAAM,EAAE,gBAAAC,GAAgB,UAAAC,EAAA,IAAaF,GAM/BG,IAAWC,EAAM,OAAqC,oBAAI,KAAK,GAO/DC,IAAoBD,EAAM,OAAOH,CAAc;AACrD,EAAAI,EAAkB,UAAUJ;AAO5B,QAAMK,IAAmBF,EAAM,YAAY,CAACG,MAAoC;AAC9E,UAAMC,IAASL,EAAS,QAAQ,IAAII,CAAE;AACtC,QAAIC,MAAW;AACb,aAAOA;AAGT,UAAMC,IAAUJ,EAAkB,QAAQE,CAAE;AAC5C,WAAAJ,EAAS,QAAQ,IAAII,GAAIE,CAAO,GACzBA;AAAA,EACT,GAAG,CAAA,CAAE,GAKCC,IAAaN,EAAM,YAAY,MAAY;AAC/C,IAAAD,EAAS,QAAQ,MAAA;AAAA,EACnB,GAAG,CAAA,CAAE;AAML,SAAAC,EAAM,UAAU,MAAM;AACpB,UAAMO,IAAkB,IAAI,IAAYT,CAAQ;AAChD,IAAAC,EAAS,QAAQ,QAAQ,CAACS,GAAGL,MAAO;AAClC,MAAKI,EAAgB,IAAIJ,CAAE,KACzBJ,EAAS,QAAQ,OAAOI,CAAE;AAAA,IAE9B,CAAC;AAAA,EACH,GAAG,CAACL,CAAQ,CAAC,GAEN,EAAE,kBAAAI,GAAkB,YAAAI,EAAA;AAC7B;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const i=require("react");function C(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(c,n,e.get?e:{enumerable:!0,get:()=>t[n]})}}return c.default=t,Object.freeze(c)}const s=C(i);function d(t){const{resolveContent:c,validIds:n}=t,e=s.useRef(new Map),a=s.useRef(c);a.current=c;const l=s.useCallback(r=>{const u=e.current.get(r);if(u!==void 0)return u;const o=a.current(r);return e.current.set(r,o),o},[]),f=s.useCallback(()=>{e.current.clear()},[]);return s.useEffect(()=>{const r=new Set(n);e.current.forEach((u,o)=>{r.has(o)||e.current.delete(o)})},[n]),{getCachedContent:l,clearCache:f}}exports.useContentCache=d;
2
+ //# sourceMappingURL=useContentCache-DqXtLrLs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContentCache-DqXtLrLs.cjs","sources":["../src/hooks/useContentCache.tsx"],"sourcesContent":["/**\n * @file Shared content caching hook for preserving React component state.\n *\n * This hook provides a common pattern for caching ReactNode content by ID,\n * ensuring the same reference is returned for the same ID across re-renders.\n * This prevents component remounting when parent components re-create content arrays.\n *\n * Used by:\n * - PanelSystemContext (GridLayout layer content)\n * - usePivot (Pivot item content)\n * - ContentRegistry (Panel content)\n */\nimport * as React from \"react\";\n\n/**\n * Function type for resolving content by ID.\n * Called only when content is not already cached.\n */\nexport type ContentResolver<TId extends string = string> = (id: TId) => React.ReactNode | null;\n\n/**\n * Options for useContentCache hook.\n */\nexport type UseContentCacheOptions<TId extends string = string> = {\n /**\n * Function to resolve content by ID.\n * Called only when content is not already in cache.\n */\n resolveContent: ContentResolver<TId>;\n /**\n * Current valid IDs. Used to clean up stale cache entries.\n * When an ID is removed from this array, its cached content is deleted.\n */\n validIds: readonly TId[];\n};\n\n/**\n * Result from useContentCache hook.\n */\nexport type UseContentCacheResult<TId extends string = string> = {\n /**\n * Get cached content for an ID.\n * Returns the same ReactNode reference for the same ID.\n */\n getCachedContent: (id: TId) => React.ReactNode | null;\n /**\n * Clear all cached content.\n * Use when you need to force re-creation of all content.\n */\n clearCache: () => void;\n};\n\n/**\n * Hook for caching ReactNode content by ID.\n *\n * Ensures the same ReactNode reference is returned for the same ID,\n * preventing unnecessary component remounting when parent re-renders.\n *\n * @example\n * ```tsx\n * const { getCachedContent } = useContentCache({\n * resolveContent: (id) => items.find(i => i.id === id)?.content ?? null,\n * validIds: items.map(i => i.id),\n * });\n *\n * return items.map(item => (\n * <div key={item.id}>{getCachedContent(item.id)}</div>\n * ));\n * ```\n */\nexport function useContentCache<TId extends string = string>(\n options: UseContentCacheOptions<TId>,\n): UseContentCacheResult<TId> {\n const { resolveContent, validIds } = options;\n\n /**\n * Cache storage. Key: ID, Value: cached ReactNode.\n * Uses ref to persist across re-renders without triggering updates.\n */\n const cacheRef = React.useRef<Map<string, React.ReactNode>>(new Map());\n\n /**\n * Store resolveContent in a ref for stable getCachedContent function.\n * This allows getCachedContent to always use the latest resolver\n * without needing to be recreated.\n */\n const resolveContentRef = React.useRef(resolveContent);\n resolveContentRef.current = resolveContent;\n\n /**\n * Get or create cached content for an ID.\n * On first access, calls resolveContent and caches the result.\n * On subsequent accesses, returns the cached reference.\n */\n const getCachedContent = React.useCallback((id: TId): React.ReactNode | null => {\n const cached = cacheRef.current.get(id);\n if (cached !== undefined) {\n return cached;\n }\n\n const content = resolveContentRef.current(id);\n cacheRef.current.set(id, content);\n return content;\n }, []);\n\n /**\n * Clear all cached content.\n */\n const clearCache = React.useCallback((): void => {\n cacheRef.current.clear();\n }, []);\n\n /**\n * Clean up stale cache entries when validIds changes.\n * Removes entries for IDs that are no longer valid.\n */\n React.useEffect(() => {\n const currentValidIds = new Set<string>(validIds);\n cacheRef.current.forEach((_, id) => {\n if (!currentValidIds.has(id)) {\n cacheRef.current.delete(id);\n }\n });\n }, [validIds]);\n\n return { getCachedContent, clearCache };\n}\n"],"names":["useContentCache","options","resolveContent","validIds","cacheRef","React","resolveContentRef","getCachedContent","id","cached","content","clearCache","currentValidIds","_"],"mappings":"gUAsEO,SAASA,EACdC,EAC4B,CAC5B,KAAM,CAAE,eAAAC,EAAgB,SAAAC,CAAA,EAAaF,EAM/BG,EAAWC,EAAM,OAAqC,IAAI,GAAK,EAO/DC,EAAoBD,EAAM,OAAOH,CAAc,EACrDI,EAAkB,QAAUJ,EAO5B,MAAMK,EAAmBF,EAAM,YAAaG,GAAoC,CAC9E,MAAMC,EAASL,EAAS,QAAQ,IAAII,CAAE,EACtC,GAAIC,IAAW,OACb,OAAOA,EAGT,MAAMC,EAAUJ,EAAkB,QAAQE,CAAE,EAC5C,OAAAJ,EAAS,QAAQ,IAAII,EAAIE,CAAO,EACzBA,CACT,EAAG,CAAA,CAAE,EAKCC,EAAaN,EAAM,YAAY,IAAY,CAC/CD,EAAS,QAAQ,MAAA,CACnB,EAAG,CAAA,CAAE,EAMLC,OAAAA,EAAM,UAAU,IAAM,CACpB,MAAMO,EAAkB,IAAI,IAAYT,CAAQ,EAChDC,EAAS,QAAQ,QAAQ,CAACS,EAAGL,IAAO,CAC7BI,EAAgB,IAAIJ,CAAE,GACzBJ,EAAS,QAAQ,OAAOI,CAAE,CAE9B,CAAC,CACH,EAAG,CAACL,CAAQ,CAAC,EAEN,CAAE,iBAAAI,EAAkB,WAAAI,CAAA,CAC7B"}
@@ -0,0 +1,46 @@
1
+ import * as c from "react";
2
+ import { u as i } from "./useEffectEvent-Dp7HLCf0.js";
3
+ function a(o, e) {
4
+ const t = i(e.onMove), n = i(e.onUp), r = i(e.onCancel);
5
+ c.useEffect(() => {
6
+ if (o)
7
+ return e.onMove && document.addEventListener("pointermove", t, { passive: !1 }), e.onUp && document.addEventListener("pointerup", n), e.onCancel && document.addEventListener("pointercancel", r), () => {
8
+ e.onMove && document.removeEventListener("pointermove", t), e.onUp && document.removeEventListener("pointerup", n), e.onCancel && document.removeEventListener("pointercancel", r);
9
+ };
10
+ }, [o, e.onMove, e.onUp, e.onCancel, t, n, r]);
11
+ }
12
+ function p(o, e, t) {
13
+ c.useEffect(() => {
14
+ const n = o.current;
15
+ if (!(!e || !n || t === void 0))
16
+ return n.setPointerCapture(t), () => {
17
+ n.hasPointerCapture && n.hasPointerCapture(t) && n.releasePointerCapture(t);
18
+ };
19
+ }, [o, e, t]);
20
+ }
21
+ function E(o, e, t = ["pointerdown", "pointermove", "pointerup"]) {
22
+ c.useEffect(() => {
23
+ const n = o.current;
24
+ if (!e || !n)
25
+ return;
26
+ const r = (u) => {
27
+ u.preventDefault();
28
+ };
29
+ return t.forEach((u) => {
30
+ n.addEventListener(u, r, { passive: !1 });
31
+ }), () => {
32
+ t.forEach((u) => {
33
+ n.removeEventListener(u, r);
34
+ });
35
+ };
36
+ }, [o, e, t]);
37
+ }
38
+ function l(o, e, t) {
39
+ const { onMove: n, onUp: r, onCancel: u, pointerId: s, capturePointer: v = !0, preventDefaults: f = !0 } = t;
40
+ a(e, { onMove: n, onUp: r, onCancel: u }), p(o, e ? v : !1, s), E(o, e ? f : !1);
41
+ }
42
+ export {
43
+ a,
44
+ l as u
45
+ };
46
+ //# sourceMappingURL=useDocumentPointerEvents-CKdhGXd0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDocumentPointerEvents-CKdhGXd0.js","sources":["../src/hooks/useDocumentPointerEvents.ts"],"sourcesContent":["/**\n * @file Hooks for managing document-level pointer events with proper cleanup\n */\nimport * as React from \"react\";\nimport { useEffectEvent } from \"./useEffectEvent\";\n\nexport type UseDocumentPointerEventsOptions = {\n onMove?: (e: PointerEvent) => void;\n onUp?: (e: PointerEvent) => void;\n onCancel?: (e: PointerEvent) => void;\n};\n\n/**\n * Custom hook for managing document-level pointer events with proper cleanup\n * This pattern is commonly used for drag operations that need to continue\n * even when the pointer moves outside the original element\n */\nexport function useDocumentPointerEvents(enabled: boolean, handlers: UseDocumentPointerEventsOptions) {\n const handleMoveEvent = useEffectEvent(handlers.onMove);\n const handleUpEvent = useEffectEvent(handlers.onUp);\n const handleCancelEvent = useEffectEvent(handlers.onCancel);\n\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n\n if (handlers.onMove) {\n document.addEventListener(\"pointermove\", handleMoveEvent, { passive: false });\n }\n if (handlers.onUp) {\n document.addEventListener(\"pointerup\", handleUpEvent);\n }\n if (handlers.onCancel) {\n document.addEventListener(\"pointercancel\", handleCancelEvent);\n }\n\n // Cleanup function\n return () => {\n if (handlers.onMove) {\n document.removeEventListener(\"pointermove\", handleMoveEvent);\n }\n if (handlers.onUp) {\n document.removeEventListener(\"pointerup\", handleUpEvent);\n }\n if (handlers.onCancel) {\n document.removeEventListener(\"pointercancel\", handleCancelEvent);\n }\n };\n }, [enabled, handlers.onMove, handlers.onUp, handlers.onCancel, handleMoveEvent, handleUpEvent, handleCancelEvent]);\n}\n\n/**\n * Hook for capturing pointer during drag operations\n * This ensures that pointer events are delivered to the capturing element\n * even when the pointer moves outside its boundaries\n */\nexport function usePointerCapture(elementRef: React.RefObject<HTMLElement | null>, enabled: boolean, pointerId?: number) {\n React.useEffect(() => {\n const element = elementRef.current;\n if (!enabled || !element || pointerId === undefined) {\n return;\n }\n\n // Capture pointer\n element.setPointerCapture(pointerId);\n\n // Release capture on cleanup\n return () => {\n if (element.hasPointerCapture && element.hasPointerCapture(pointerId)) {\n element.releasePointerCapture(pointerId);\n }\n };\n }, [elementRef, enabled, pointerId]);\n}\n\n/**\n * Hook for preventing default pointer events during operations\n * Useful for preventing text selection, context menus, etc. during drag operations\n */\nexport function usePreventPointerDefaults(\n elementRef: React.RefObject<HTMLElement | null>,\n enabled: boolean,\n events: string[] = [\"pointerdown\", \"pointermove\", \"pointerup\"],\n) {\n React.useEffect(() => {\n const element = elementRef.current;\n if (!enabled || !element) {\n return;\n }\n\n const preventDefault = (e: Event) => {\n e.preventDefault();\n };\n\n // Add listeners\n events.forEach((eventType) => {\n element.addEventListener(eventType, preventDefault, { passive: false });\n });\n\n // Cleanup\n return () => {\n events.forEach((eventType) => {\n element.removeEventListener(eventType, preventDefault);\n });\n };\n }, [elementRef, enabled, events]);\n}\n\n/**\n * Hook that combines multiple pointer event patterns for drag operations\n */\nexport function useDragPointerEvents(\n elementRef: React.RefObject<HTMLElement | null>,\n enabled: boolean,\n options: {\n onMove?: (e: PointerEvent) => void;\n onUp?: (e: PointerEvent) => void;\n onCancel?: (e: PointerEvent) => void;\n pointerId?: number;\n capturePointer?: boolean;\n preventDefaults?: boolean;\n },\n) {\n const { onMove, onUp, onCancel, pointerId, capturePointer = true, preventDefaults = true } = options;\n\n // Document-level event handlers\n useDocumentPointerEvents(enabled, { onMove, onUp, onCancel });\n\n // Pointer capture\n const shouldCapturePointer = enabled ? capturePointer : false;\n usePointerCapture(elementRef, shouldCapturePointer, pointerId);\n\n // Prevent defaults\n const shouldPreventDefaults = enabled ? preventDefaults : false;\n usePreventPointerDefaults(elementRef, shouldPreventDefaults);\n}\n"],"names":["useDocumentPointerEvents","enabled","handlers","handleMoveEvent","useEffectEvent","handleUpEvent","handleCancelEvent","React","usePointerCapture","elementRef","pointerId","element","usePreventPointerDefaults","events","preventDefault","e","eventType","useDragPointerEvents","options","onMove","onUp","onCancel","capturePointer","preventDefaults"],"mappings":";;AAiBO,SAASA,EAAyBC,GAAkBC,GAA2C;AACpG,QAAMC,IAAkBC,EAAeF,EAAS,MAAM,GAChDG,IAAgBD,EAAeF,EAAS,IAAI,GAC5CI,IAAoBF,EAAeF,EAAS,QAAQ;AAE1D,EAAAK,EAAM,UAAU,MAAM;AACpB,QAAKN;AAIL,aAAIC,EAAS,UACX,SAAS,iBAAiB,eAAeC,GAAiB,EAAE,SAAS,IAAO,GAE1ED,EAAS,QACX,SAAS,iBAAiB,aAAaG,CAAa,GAElDH,EAAS,YACX,SAAS,iBAAiB,iBAAiBI,CAAiB,GAIvD,MAAM;AACX,QAAIJ,EAAS,UACX,SAAS,oBAAoB,eAAeC,CAAe,GAEzDD,EAAS,QACX,SAAS,oBAAoB,aAAaG,CAAa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