react-panel-layout 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/dist/{FloatingPanelFrame-SgYLc6Ud.js → FloatingPanelFrame-3eU9AwPo.js} +2 -2
  2. package/dist/{FloatingPanelFrame-SgYLc6Ud.js.map → FloatingPanelFrame-3eU9AwPo.js.map} +1 -1
  3. package/dist/FloatingWindow-CUXnEtrb.js +827 -0
  4. package/dist/FloatingWindow-CUXnEtrb.js.map +1 -0
  5. package/dist/FloatingWindow-DMwyK0eK.cjs +2 -0
  6. package/dist/FloatingWindow-DMwyK0eK.cjs.map +1 -0
  7. package/dist/GridLayout-DKTg_N61.cjs +2 -0
  8. package/dist/{GridLayout-B4VRsC0r.cjs.map → GridLayout-DKTg_N61.cjs.map} +1 -1
  9. package/dist/{GridLayout-BltqeCPK.js → GridLayout-UWNxXw77.js} +34 -35
  10. package/dist/{GridLayout-BltqeCPK.js.map → GridLayout-UWNxXw77.js.map} +1 -1
  11. package/dist/{HorizontalDivider-WF1k_qND.js → HorizontalDivider-DdxzfV0l.js} +3 -3
  12. package/dist/{HorizontalDivider-WF1k_qND.js.map → HorizontalDivider-DdxzfV0l.js.map} +1 -1
  13. package/dist/{HorizontalDivider-B5Z-KZLk.cjs → HorizontalDivider-_pgV4Mcv.cjs} +2 -2
  14. package/dist/{HorizontalDivider-B5Z-KZLk.cjs.map → HorizontalDivider-_pgV4Mcv.cjs.map} +1 -1
  15. package/dist/{PanelSystem-Dr1TBhxM.js → PanelSystem-BqUzNtf2.js} +5 -5
  16. package/dist/{PanelSystem-Dr1TBhxM.js.map → PanelSystem-BqUzNtf2.js.map} +1 -1
  17. package/dist/{PanelSystem-Bs8bQwQF.cjs → PanelSystem-D603LKKv.cjs} +2 -2
  18. package/dist/{PanelSystem-Bs8bQwQF.cjs.map → PanelSystem-D603LKKv.cjs.map} +1 -1
  19. package/dist/ResizeHandle-CBcAS918.cjs +2 -0
  20. package/dist/{ResizeHandle-CScipO5l.cjs.map → ResizeHandle-CBcAS918.cjs.map} +1 -1
  21. package/dist/{ResizeHandle-CdA_JYfN.js → ResizeHandle-CXjc1meV.js} +28 -29
  22. package/dist/{ResizeHandle-CdA_JYfN.js.map → ResizeHandle-CXjc1meV.js.map} +1 -1
  23. package/dist/SwipePivotTabBar-DWrCuwEI.js +411 -0
  24. package/dist/SwipePivotTabBar-DWrCuwEI.js.map +1 -0
  25. package/dist/SwipePivotTabBar-fjjXkpj7.cjs +2 -0
  26. package/dist/SwipePivotTabBar-fjjXkpj7.cjs.map +1 -0
  27. package/dist/components/gesture/SwipeSafeZone.d.ts +40 -0
  28. package/dist/components/window/Drawer.d.ts +3 -1
  29. package/dist/components/window/DrawerLayers.d.ts +1 -1
  30. package/dist/components/window/drawerStyles.d.ts +69 -0
  31. package/dist/components/window/drawerSwipeConfig.d.ts +29 -0
  32. package/dist/components/window/useDrawerSwipeTransform.d.ts +23 -0
  33. package/dist/config.cjs +1 -1
  34. package/dist/config.js +3 -3
  35. package/dist/constants/styles.d.ts +17 -0
  36. package/dist/dialog/index.d.ts +69 -0
  37. package/dist/floating.js +1 -1
  38. package/dist/grid.cjs +1 -1
  39. package/dist/grid.js +2 -2
  40. package/dist/hooks/gesture/testing/createGestureSimulator.d.ts +7 -0
  41. package/dist/hooks/gesture/types.d.ts +48 -5
  42. package/dist/hooks/gesture/utils.d.ts +19 -0
  43. package/dist/hooks/useAnimationFrame.d.ts +2 -0
  44. package/dist/hooks/useOperationContinuity.d.ts +64 -0
  45. package/dist/hooks/useResizeObserver.d.ts +33 -1
  46. package/dist/hooks/useSharedElementTransition.d.ts +112 -0
  47. package/dist/hooks/useSwipeContentTransform.d.ts +9 -2
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.js +7 -7
  50. package/dist/modules/dialog/AlertDialog.d.ts +9 -0
  51. package/dist/modules/dialog/DialogContainer.d.ts +37 -0
  52. package/dist/modules/dialog/Modal.d.ts +26 -0
  53. package/dist/modules/dialog/SwipeDialogContainer.d.ts +16 -0
  54. package/dist/modules/dialog/dialogAnimationUtils.d.ts +113 -0
  55. package/dist/modules/dialog/types.d.ts +183 -0
  56. package/dist/modules/dialog/useDialog.d.ts +39 -0
  57. package/dist/modules/dialog/useDialogContainer.d.ts +47 -0
  58. package/dist/modules/dialog/useDialogSwipeInput.d.ts +70 -0
  59. package/dist/modules/dialog/useDialogTransform.d.ts +82 -0
  60. package/dist/modules/drawer/types.d.ts +74 -0
  61. package/dist/modules/drawer/useDrawerSwipeInput.d.ts +24 -0
  62. package/dist/modules/pivot/SwipePivotTabBar.d.ts +3 -0
  63. package/dist/modules/stack/SwipeStackContent.d.ts +6 -3
  64. package/dist/modules/stack/SwipeStackOutlet.d.ts +4 -4
  65. package/dist/modules/stack/computeSwipeStackTransform.d.ts +1 -1
  66. package/dist/panels.cjs +1 -1
  67. package/dist/panels.js +1 -1
  68. package/dist/pivot.cjs +1 -1
  69. package/dist/pivot.js +1 -1
  70. package/dist/resizer.cjs +1 -1
  71. package/dist/resizer.js +2 -2
  72. package/dist/stack.cjs +1 -1
  73. package/dist/stack.cjs.map +1 -1
  74. package/dist/stack.js +503 -762
  75. package/dist/stack.js.map +1 -1
  76. package/dist/sticky-header/calculateStickyMetrics.d.ts +28 -0
  77. package/dist/sticky-header.cjs +1 -1
  78. package/dist/sticky-header.cjs.map +1 -1
  79. package/dist/sticky-header.js +59 -51
  80. package/dist/sticky-header.js.map +1 -1
  81. package/dist/{styles-DPPuJ0sf.js → styles-NkjuMOVS.js} +13 -13
  82. package/dist/{styles-DPPuJ0sf.js.map → styles-NkjuMOVS.js.map} +1 -1
  83. package/dist/styles-qf6ptVLD.cjs.map +1 -1
  84. package/dist/types.d.ts +16 -0
  85. package/dist/useDocumentPointerEvents-DXxw3qWj.js +54 -0
  86. package/dist/useDocumentPointerEvents-DXxw3qWj.js.map +1 -0
  87. package/dist/useDocumentPointerEvents-DxDSOtip.cjs +2 -0
  88. package/dist/useDocumentPointerEvents-DxDSOtip.cjs.map +1 -0
  89. package/dist/useNativeGestureGuard-C7TSqEkr.cjs +2 -0
  90. package/dist/useNativeGestureGuard-C7TSqEkr.cjs.map +1 -0
  91. package/dist/useNativeGestureGuard-CGYo6O0r.js +347 -0
  92. package/dist/useNativeGestureGuard-CGYo6O0r.js.map +1 -0
  93. package/dist/window/index.d.ts +2 -0
  94. package/dist/window.cjs +1 -1
  95. package/dist/window.cjs.map +1 -1
  96. package/dist/window.js +114 -103
  97. package/dist/window.js.map +1 -1
  98. package/package.json +6 -1
  99. package/src/components/gesture/SwipeSafeZone.tsx +69 -0
  100. package/src/components/window/Drawer.tsx +249 -162
  101. package/src/components/window/DrawerLayers.tsx +13 -3
  102. package/src/components/window/drawerStyles.spec.ts +263 -0
  103. package/src/components/window/drawerStyles.ts +228 -0
  104. package/src/components/window/drawerSwipeConfig.spec.ts +131 -0
  105. package/src/components/window/drawerSwipeConfig.ts +112 -0
  106. package/src/components/window/useDrawerSwipeTransform.spec.ts +234 -0
  107. package/src/components/window/useDrawerSwipeTransform.ts +129 -0
  108. package/src/constants/styles.ts +19 -0
  109. package/src/demo/pages/Dialog/alerts/index.tsx +22 -0
  110. package/src/demo/pages/Dialog/card/index.tsx +22 -0
  111. package/src/demo/pages/Dialog/components/AlertDialogDemo.tsx +124 -0
  112. package/src/demo/pages/Dialog/components/CardExpandDemo.module.css +243 -0
  113. package/src/demo/pages/Dialog/components/CardExpandDemo.tsx +204 -0
  114. package/src/demo/pages/Dialog/components/CustomAlertDialogDemo.tsx +219 -0
  115. package/src/demo/pages/Dialog/components/DialogDemos.module.css +77 -0
  116. package/src/demo/pages/Dialog/components/ModalBasics.tsx +45 -0
  117. package/src/demo/pages/Dialog/components/SwipeDialogDemo.module.css +77 -0
  118. package/src/demo/pages/Dialog/components/SwipeDialogDemo.tsx +181 -0
  119. package/src/demo/pages/Dialog/custom-alert/index.tsx +22 -0
  120. package/src/demo/pages/Dialog/modal/index.tsx +17 -0
  121. package/src/demo/pages/Dialog/swipe/index.tsx +22 -0
  122. package/src/demo/pages/Drawer/components/DrawerSwipe.module.css +316 -0
  123. package/src/demo/pages/Drawer/components/DrawerSwipe.tsx +178 -0
  124. package/src/demo/pages/Drawer/swipe/index.tsx +17 -0
  125. package/src/demo/pages/Pivot/components/SwipeTabsPivot.tsx +54 -23
  126. package/src/demo/pages/Pivot/swipe-debug/index.tsx +1 -1
  127. package/src/demo/pages/Stack/components/StackBasics.spec.tsx +152 -0
  128. package/src/demo/pages/Stack/components/StackBasics.tsx +179 -95
  129. package/src/demo/pages/Stack/components/StackTablet.spec.tsx +120 -0
  130. package/src/demo/pages/Stack/components/StackTablet.tsx +42 -21
  131. package/src/demo/routes.tsx +22 -1
  132. package/src/dialog/index.ts +85 -0
  133. package/src/hooks/gesture/testing/createGestureSimulator.spec.ts +68 -64
  134. package/src/hooks/gesture/testing/createGestureSimulator.ts +112 -37
  135. package/src/hooks/gesture/types.ts +83 -6
  136. package/src/hooks/gesture/useEdgeSwipeInput.spec.ts +22 -14
  137. package/src/hooks/gesture/useNativeGestureGuard.spec.ts +91 -31
  138. package/src/hooks/gesture/useNativeGestureGuard.ts +3 -1
  139. package/src/hooks/gesture/utils.ts +91 -0
  140. package/src/hooks/useAnimatedVisibility.spec.ts +44 -24
  141. package/src/hooks/useAnimatedVisibility.ts +28 -2
  142. package/src/hooks/useAnimationFrame.ts +8 -0
  143. package/src/hooks/useOperationContinuity.spec.ts +387 -0
  144. package/src/hooks/useOperationContinuity.ts +135 -0
  145. package/src/hooks/useResizeObserver.spec.tsx +277 -0
  146. package/src/hooks/useResizeObserver.tsx +108 -39
  147. package/src/hooks/useScrollContainer.ts +4 -10
  148. package/src/hooks/useSharedElementTransition.ts +333 -0
  149. package/src/hooks/useSwipeContentTransform.spec.ts +18 -18
  150. package/src/hooks/useSwipeContentTransform.ts +166 -28
  151. package/src/modules/dialog/AlertDialog.spec.tsx +387 -0
  152. package/src/modules/dialog/AlertDialog.tsx +221 -0
  153. package/src/modules/dialog/DialogContainer.spec.tsx +228 -0
  154. package/src/modules/dialog/DialogContainer.tsx +188 -0
  155. package/src/modules/dialog/Modal.spec.tsx +220 -0
  156. package/src/modules/dialog/Modal.tsx +182 -0
  157. package/src/modules/dialog/SwipeDialogContainer.tsx +208 -0
  158. package/src/modules/dialog/dialogAnimationUtils.spec.ts +253 -0
  159. package/src/modules/dialog/dialogAnimationUtils.ts +297 -0
  160. package/src/modules/dialog/types.ts +186 -0
  161. package/src/modules/dialog/useDialog.spec.tsx +447 -0
  162. package/src/modules/dialog/useDialog.ts +214 -0
  163. package/src/modules/dialog/useDialogContainer.spec.ts +331 -0
  164. package/src/modules/dialog/useDialogContainer.ts +150 -0
  165. package/src/modules/dialog/useDialogSwipeInput.spec.ts +157 -0
  166. package/src/modules/dialog/useDialogSwipeInput.ts +319 -0
  167. package/src/modules/dialog/useDialogTransform.spec.ts +370 -0
  168. package/src/modules/dialog/useDialogTransform.ts +407 -0
  169. package/src/modules/drawer/types.ts +102 -0
  170. package/src/modules/drawer/useDrawerSwipeInput.spec.ts +566 -0
  171. package/src/modules/drawer/useDrawerSwipeInput.ts +399 -0
  172. package/src/modules/panels/rendering/ContentRegistry.spec.tsx +21 -14
  173. package/src/modules/pivot/SwipePivotContent.position.spec.tsx +12 -8
  174. package/src/modules/pivot/SwipePivotContent.spec.tsx +55 -25
  175. package/src/modules/pivot/SwipePivotContent.tsx +2 -2
  176. package/src/modules/pivot/SwipePivotTabBar.spec.tsx +85 -68
  177. package/src/modules/pivot/SwipePivotTabBar.tsx +75 -15
  178. package/src/modules/pivot/scaleInputState.spec.ts +11 -2
  179. package/src/modules/pivot/usePivot.spec.ts +17 -3
  180. package/src/modules/pivot/usePivotSwipeInput.spec.ts +182 -123
  181. package/src/modules/stack/SwipeStackContent.spec.tsx +387 -100
  182. package/src/modules/stack/SwipeStackContent.tsx +43 -33
  183. package/src/modules/stack/SwipeStackOutlet.spec.tsx +14 -16
  184. package/src/modules/stack/SwipeStackOutlet.tsx +6 -6
  185. package/src/modules/stack/computeSwipeStackTransform.spec.ts +5 -5
  186. package/src/modules/stack/computeSwipeStackTransform.ts +3 -3
  187. package/src/modules/stack/swipeTransitionContinuity.spec.tsx +1133 -0
  188. package/src/modules/stack/useStackAnimationState.spec.ts +3 -1
  189. package/src/modules/stack/useStackAnimationState.ts +18 -13
  190. package/src/modules/stack/useStackNavigation.spec.ts +198 -3
  191. package/src/modules/stack/useStackNavigation.tsx +113 -56
  192. package/src/modules/stack/useStackSwipeInput.spec.ts +65 -32
  193. package/src/modules/stack/useStackSwipeInput.ts +1 -1
  194. package/src/sticky-header/StickyArea.tsx +29 -57
  195. package/src/sticky-header/calculateStickyMetrics.spec.ts +105 -0
  196. package/src/sticky-header/calculateStickyMetrics.ts +50 -0
  197. package/src/types.ts +18 -0
  198. package/src/window/index.ts +2 -0
  199. package/dist/FloatingWindow-BpdOpg_L.js +0 -400
  200. package/dist/FloatingWindow-BpdOpg_L.js.map +0 -1
  201. package/dist/FloatingWindow-TCDNY5gE.cjs +0 -2
  202. package/dist/FloatingWindow-TCDNY5gE.cjs.map +0 -1
  203. package/dist/GridLayout-B4VRsC0r.cjs +0 -2
  204. package/dist/ResizeHandle-CScipO5l.cjs +0 -2
  205. package/dist/SwipePivotTabBar-BGO9X94m.js +0 -407
  206. package/dist/SwipePivotTabBar-BGO9X94m.js.map +0 -1
  207. package/dist/SwipePivotTabBar-BrQismcZ.cjs +0 -2
  208. package/dist/SwipePivotTabBar-BrQismcZ.cjs.map +0 -1
  209. package/dist/useDocumentPointerEvents-CKdhGXd0.js +0 -46
  210. package/dist/useDocumentPointerEvents-CKdhGXd0.js.map +0 -1
  211. package/dist/useDocumentPointerEvents-ChqrKXDk.cjs +0 -2
  212. package/dist/useDocumentPointerEvents-ChqrKXDk.cjs.map +0 -1
  213. package/dist/useEffectEvent-Dp7HLCf0.js +0 -13
  214. package/dist/useEffectEvent-Dp7HLCf0.js.map +0 -1
  215. package/dist/useEffectEvent-huSsGUnl.cjs +0 -2
  216. package/dist/useEffectEvent-huSsGUnl.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"FloatingWindow-TCDNY5gE.cjs","sources":["../src/components/window/Drawer.tsx","../src/hooks/useTransitionState.ts","../src/modules/window/useDrawerState.ts","../src/components/window/DrawerLayers.tsx","../src/modules/grid/GridLayoutContext.tsx","../src/PanelSystemContext.tsx","../src/modules/grid/LayerInstanceContext.tsx","../src/components/window/PopupLayerPortal.tsx","../src/components/window/FloatingWindow.tsx"],"sourcesContent":["/**\n * @file Drawer component\n *\n * Mobile-friendly slide-in panel with backdrop support.\n */\nimport * as React from \"react\";\nimport type { DrawerBehavior, WindowPosition } from \"../../types\";\nimport {\n FloatingPanelCloseButton,\n FloatingPanelContent,\n FloatingPanelFrame,\n FloatingPanelHeader,\n FloatingPanelTitle,\n} from \"../paneling/FloatingPanelFrame\";\nimport {\n DRAWER_HEADER_PADDING_Y,\n DRAWER_HEADER_PADDING_X,\n DRAWER_HEADER_GAP,\n DRAWER_CONTENT_PADDING,\n COLOR_DRAWER_BACKDROP,\n DRAWER_TRANSITION_DURATION,\n DRAWER_TRANSITION_EASING,\n} from \"../../constants/styles\";\n\nconst drawerBackdropStyle: React.CSSProperties = {\n position: \"fixed\",\n inset: 0,\n background: COLOR_DRAWER_BACKDROP,\n};\n\nconst drawerBaseStyle: React.CSSProperties = {\n willChange: \"transform\",\n};\n\nconst drawerPlacementStyles: Record<string, React.CSSProperties> = {\n left: {\n top: 0,\n bottom: 0,\n left: 0,\n transform: \"translateX(-100%)\",\n },\n right: {\n top: 0,\n bottom: 0,\n right: 0,\n transform: \"translateX(100%)\",\n },\n top: {\n top: 0,\n left: 0,\n right: 0,\n transform: \"translateY(-100%)\",\n },\n bottom: {\n bottom: 0,\n left: 0,\n right: 0,\n transform: \"translateY(100%)\",\n },\n};\n\nconst computeTransitionValue = (\n mode: DrawerBehavior[\"transitionMode\"] | undefined,\n duration: DrawerBehavior[\"transitionDuration\"],\n easing: DrawerBehavior[\"transitionEasing\"],\n): string | undefined => {\n if (mode === \"none\") {\n return undefined;\n }\n\n const durationValue = duration ?? DRAWER_TRANSITION_DURATION;\n const easingValue = easing ?? DRAWER_TRANSITION_EASING;\n\n return `transform ${durationValue} ${easingValue}`;\n};\n\nexport type DrawerProps = {\n id: string;\n config: DrawerBehavior;\n isOpen: boolean;\n onClose: () => void;\n children: React.ReactNode;\n zIndex?: number;\n width?: string | number;\n height?: string | number;\n position?: WindowPosition;\n};\n\nconst shouldShowCloseButton = (dismissible: boolean, showClose: boolean): boolean => {\n if (!dismissible) {\n return false;\n }\n return showClose;\n};\n\ntype DrawerContentProps = {\n chrome: boolean;\n frameStyle: React.CSSProperties;\n header?: DrawerBehavior[\"header\"];\n dismissible: boolean;\n onClose: () => void;\n children: React.ReactNode;\n};\n\nconst DrawerContent: React.FC<DrawerContentProps> = ({ chrome, frameStyle, header, dismissible, onClose, children }) => {\n if (!chrome) {\n return <>{children}</>;\n }\n return (\n <FloatingPanelFrame style={frameStyle}>\n <DrawerHeaderView header={header} dismissible={dismissible} onClose={onClose} />\n <FloatingPanelContent\n style={{ padding: DRAWER_CONTENT_PADDING, flex: 1, display: \"flex\", flexDirection: \"column\" }}\n >\n {children}\n </FloatingPanelContent>\n </FloatingPanelFrame>\n );\n};\n\nconst DrawerHeaderView: React.FC<{\n header?: DrawerBehavior[\"header\"];\n dismissible: boolean;\n onClose: () => void;\n}> = ({ header, dismissible, onClose }) => {\n if (!header) {\n return null;\n }\n\n const showCloseButton = header.showCloseButton ?? true;\n const shouldShowClose = shouldShowCloseButton(dismissible, showCloseButton);\n\n return (\n <React.Activity mode={header ? \"visible\" : \"hidden\"}>\n <FloatingPanelHeader\n style={{ padding: `${DRAWER_HEADER_PADDING_Y} ${DRAWER_HEADER_PADDING_X}`, gap: DRAWER_HEADER_GAP }}\n >\n <React.Activity mode={header ? \"visible\" : \"hidden\"}>\n <FloatingPanelTitle>{header.title}</FloatingPanelTitle>\n </React.Activity>\n <React.Activity mode={shouldShowClose ? \"visible\" : \"hidden\"}>\n <FloatingPanelCloseButton\n onClick={onClose}\n aria-label=\"Close drawer\"\n style={{ marginLeft: \"auto\" }}\n />\n </React.Activity>\n </FloatingPanelHeader>\n </React.Activity>\n );\n};\n\nexport const Drawer: React.FC<DrawerProps> = ({\n id,\n config,\n isOpen,\n onClose,\n children,\n zIndex,\n width,\n height,\n position,\n}) => {\n const {\n dismissible = true,\n header,\n chrome = true,\n inline = false,\n transitionMode = \"css\",\n transitionDuration,\n transitionEasing,\n } = config;\n\n const resolvePlacement = React.useCallback(\n (anchor?: DrawerBehavior[\"anchor\"], pos?: WindowPosition): \"left\" | \"right\" | \"top\" | \"bottom\" => {\n // Prefer explicit anchor from config\n if (anchor) {\n return anchor;\n }\n // Fall back to inferring from position\n if (!pos) {\n return \"right\";\n }\n if (pos.left !== undefined) {\n return \"left\";\n }\n if (pos.right !== undefined) {\n return \"right\";\n }\n if (pos.top !== undefined) {\n return \"top\";\n }\n if (pos.bottom !== undefined) {\n return \"bottom\";\n }\n return \"right\";\n },\n [],\n );\n\n const placement = resolvePlacement(config.anchor, position);\n\n const openTransforms: Record<string, string> = {\n left: \"translateX(0)\",\n right: \"translateX(0)\",\n top: \"translateY(0)\",\n bottom: \"translateY(0)\",\n };\n\n const drawerStyle = React.useMemo((): React.CSSProperties => {\n const transitionValue = computeTransitionValue(transitionMode, transitionDuration, transitionEasing);\n\n const style: React.CSSProperties = {\n ...drawerBaseStyle,\n ...(inline ? { position: \"absolute\" } : { position: \"fixed\" }),\n ...drawerPlacementStyles[placement],\n transform: isOpen ? openTransforms[placement] : drawerPlacementStyles[placement].transform,\n transition: transitionValue,\n };\n\n if (zIndex !== undefined) {\n style.zIndex = zIndex;\n }\n\n if (width !== undefined) {\n style.width = typeof width === \"number\" ? `${width}px` : width;\n }\n if (height !== undefined) {\n style.height = typeof height === \"number\" ? `${height}px` : height;\n }\n\n return style;\n }, [height, inline, isOpen, placement, transitionDuration, transitionEasing, transitionMode, width, zIndex]);\n\n const ariaLabel = header?.title ?? config.ariaLabel ?? \"Drawer\";\n\n const backdropStyle = React.useMemo((): React.CSSProperties => {\n const base = inline ? { ...drawerBackdropStyle, position: \"absolute\" as const } : drawerBackdropStyle;\n const transitionValue = transitionMode === \"none\" ? undefined : `opacity ${transitionDuration ?? \"220ms\"} ease`;\n return {\n ...base,\n opacity: isOpen ? 1 : 0,\n pointerEvents: isOpen ? \"auto\" : \"none\",\n transition: transitionValue,\n zIndex: zIndex !== undefined ? zIndex - 1 : undefined,\n };\n }, [inline, isOpen, transitionDuration, transitionMode, zIndex]);\n\n const frameStyle = React.useMemo((): React.CSSProperties => {\n const isVertical = placement === \"left\" || placement === \"right\";\n const style: React.CSSProperties = { borderRadius: 0 };\n if (isVertical) {\n style.height = \"100%\";\n }\n return style;\n }, [placement]);\n\n return (\n <>\n <div style={backdropStyle} onClick={dismissible ? onClose : undefined} />\n <div\n data-layer-id={id}\n data-placement={placement}\n style={drawerStyle}\n role=\"dialog\"\n aria-modal={dismissible ? true : undefined}\n aria-hidden={isOpen ? undefined : true}\n aria-label={ariaLabel}\n >\n <DrawerContent\n chrome={chrome}\n frameStyle={frameStyle}\n header={header}\n dismissible={dismissible}\n onClose={onClose}\n >\n {children}\n </DrawerContent>\n </div>\n </>\n );\n};\n","/**\n * @file Generic transition state management with animation support.\n */\nimport * as React from \"react\";\n\nexport type TransitionMode = \"none\" | \"css\";\n\nexport type TransitionOptions = {\n mode?: TransitionMode;\n element?: React.RefObject<HTMLElement>;\n duration?: number;\n};\n\nexport type UseTransitionStateOptions = {\n onOpen?: (id: string) => void;\n onClose?: (id: string) => void;\n onTransitionEnd?: (id: string, isOpen: boolean) => void;\n};\n\nconst waitForTransitionEnd = (el: HTMLElement, timeout: number): Promise<void> =>\n new Promise((resolve) => {\n // eslint-disable-next-line no-restricted-syntax -- mutable flag needed for deduplication\n let resolved = false;\n const done = () => {\n if (resolved) {return;}\n resolved = true;\n el.removeEventListener(\"transitionend\", handler);\n resolve();\n };\n const handler = (e: TransitionEvent) => {\n if (e.target === el) {done();}\n };\n el.addEventListener(\"transitionend\", handler);\n setTimeout(done, timeout + 50);\n });\n\nexport const runTransition = async (\n update: () => void,\n mode: TransitionMode,\n el: HTMLElement | null | undefined,\n duration: number,\n): Promise<void> => {\n switch (mode) {\n case \"none\":\n update();\n return;\n\n case \"css\":\n update();\n if (el) {await waitForTransitionEnd(el, duration);}\n return;\n }\n};\n\nexport const useTransitionState = (options?: UseTransitionStateOptions) => {\n const [states, setStates] = React.useState<Record<string, boolean>>({});\n const optionsRef = React.useRef(options);\n optionsRef.current = options;\n\n const update = React.useCallback(\n async (id: string, isOpen: boolean, transitionOptions?: TransitionOptions) => {\n const { mode = \"none\", element, duration = 300 } = transitionOptions ?? {};\n\n const applyState = () => {\n setStates((prev) => {\n if (prev[id] === isOpen) {return prev;}\n return { ...prev, [id]: isOpen };\n });\n };\n\n await runTransition(applyState, mode, element?.current, duration);\n\n const opts = optionsRef.current;\n if (isOpen) {\n opts?.onOpen?.(id);\n } else {\n opts?.onClose?.(id);\n }\n opts?.onTransitionEnd?.(id, isOpen);\n },\n [],\n );\n\n const state = React.useCallback((id: string): boolean => states[id] ?? false, [states]);\n const open = React.useCallback(\n (id: string, opts?: TransitionOptions) => update(id, true, opts),\n [update],\n );\n const close = React.useCallback(\n (id: string, opts?: TransitionOptions) => update(id, false, opts),\n [update],\n );\n\n return { state, open, close };\n};\n","/**\n * @file Hook for managing drawer state (controlled/uncontrolled)\n */\nimport * as React from \"react\";\nimport {\n type TransitionMode,\n type TransitionOptions,\n runTransition,\n} from \"../../hooks/useTransitionState\";\nimport type { LayerDefinition } from \"../../types\";\n\nconst parseDuration = (value: string | undefined): number => {\n if (!value) {return 300;}\n const match = value.match(/(\\d+)/);\n return match ? parseInt(match[1], 10) : 300;\n};\n\nexport const useDrawerState = (layers: LayerDefinition[]) => {\n const [drawerStates, setDrawerStates] = React.useState<Record<string, boolean>>(() => {\n const initial: Record<string, boolean> = {};\n layers.forEach((layer) => {\n if (layer.drawer) {\n initial[layer.id] = layer.drawer.defaultOpen ?? false;\n }\n });\n return initial;\n });\n\n const layerMap = React.useMemo(() => {\n const map = new Map<string, LayerDefinition>();\n layers.forEach((layer) => map.set(layer.id, layer));\n return map;\n }, [layers]);\n\n const updateState = React.useCallback(\n async (layerId: string, isOpen: boolean, options?: TransitionOptions) => {\n const layer = layerMap.get(layerId);\n if (!layer?.drawer) {return;}\n\n const mode: TransitionMode = options?.mode ?? layer.drawer.transitionMode ?? \"css\";\n const duration = options?.duration ?? parseDuration(layer.drawer.transitionDuration);\n const element = options?.element?.current;\n\n const applyState = () => {\n if (layer.drawer?.open === undefined) {\n setDrawerStates((prev) => {\n if (prev[layerId] === isOpen) {return prev;}\n return { ...prev, [layerId]: isOpen };\n });\n }\n layer.drawer?.onStateChange?.(isOpen);\n };\n\n await runTransition(applyState, mode, element, duration);\n },\n [layerMap],\n );\n\n const state = React.useCallback(\n (layerId: string): boolean => {\n const layer = layerMap.get(layerId);\n if (layer?.drawer?.open !== undefined) {\n return layer.drawer.open;\n }\n return drawerStates[layerId] ?? false;\n },\n [layerMap, drawerStates],\n );\n\n const open = React.useCallback(\n (id: string, options?: TransitionOptions) => updateState(id, true, options),\n [updateState],\n );\n\n const close = React.useCallback(\n (id: string, options?: TransitionOptions) => updateState(id, false, options),\n [updateState],\n );\n\n return { state, open, close };\n};\n","/**\n * @file DrawerLayers component\n */\nimport * as React from \"react\";\nimport type { LayerDefinition } from \"../../types\";\nimport { Drawer } from \"./Drawer\";\nimport { useDrawerState } from \"../../modules/window/useDrawerState\";\n\nexport type DrawerLayersProps = {\n layers: LayerDefinition[];\n};\n\nexport const DrawerLayers: React.FC<DrawerLayersProps> = ({ layers }) => {\n const drawer = useDrawerState(layers);\n\n const drawerLayers = React.useMemo(() => layers.filter((layer) => layer.drawer), [layers]);\n\n const closeHandlers = React.useMemo(() => {\n const handlers = new Map<string, () => void>();\n drawerLayers.forEach((layer) => {\n handlers.set(layer.id, () => drawer.close(layer.id));\n });\n return handlers;\n }, [drawerLayers, drawer.close]);\n\n return (\n <>\n {drawerLayers.map((layer) => {\n if (!layer.drawer) {\n return null;\n }\n\n const isOpen = drawer.state(layer.id);\n const onClose = closeHandlers.get(layer.id);\n\n if (!onClose) {\n return null;\n }\n\n return (\n <Drawer\n key={layer.id}\n id={layer.id}\n config={layer.drawer}\n isOpen={isOpen}\n onClose={onClose}\n zIndex={layer.zIndex}\n width={layer.width}\n height={layer.height}\n position={layer.position}\n >\n {layer.component}\n </Drawer>\n );\n })}\n </>\n );\n};\n","/**\n * @file Context provider for grid layer rendering helpers.\n */\nimport * as React from \"react\";\nimport type { LayerDefinition } from \"../../types\";\n\nexport type GridLayerHandleProps = React.HTMLAttributes<HTMLElement> & {\n \"data-drag-handle\": \"true\";\n};\n\nexport type ResizeHandleConfig =\n | {\n key: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n variant: \"corner\";\n horizontal: \"left\" | \"right\";\n vertical: \"top\" | \"bottom\";\n }\n | {\n key: \"left\" | \"right\" | \"top\" | \"bottom\";\n variant: \"edge\";\n horizontal?: \"left\" | \"right\";\n vertical?: \"top\" | \"bottom\";\n };\n\nexport type GridLayerRenderState = {\n style: React.CSSProperties;\n isResizable: boolean;\n isResizing: boolean;\n onResizeHandlePointerDown: (config: ResizeHandleConfig, event: React.PointerEvent<HTMLDivElement>) => void;\n};\n\nexport type GridLayoutContextValue = {\n handleLayerPointerDown: (event: React.PointerEvent<HTMLDivElement>) => void;\n getLayerRenderState: (layer: LayerDefinition) => GridLayerRenderState;\n getLayerHandleProps: (layerId: string) => GridLayerHandleProps;\n /**\n * Whether the GridLayout is mounted at root level.\n * When true, scrollable layers should delegate to browser's native scroll.\n */\n isRootLevel: boolean;\n};\n\nconst GridLayoutContext = React.createContext<GridLayoutContextValue | null>(null);\n\nexport const GridLayoutProvider: React.FC<\n React.PropsWithChildren<{ value: GridLayoutContextValue }>\n> = ({ value, children }) => {\n return <GridLayoutContext.Provider value={value}>{children}</GridLayoutContext.Provider>;\n};\n\nexport const useGridLayoutContext = (): GridLayoutContextValue => {\n const context = React.useContext(GridLayoutContext);\n if (!context) {\n throw new Error(\"useGridLayoutContext must be used within a GridLayoutProvider.\");\n }\n return context;\n};\n","/**\n * @file PanelSystemContext\n *\n * Core provider for panel definitions and registry. Grid-specific layout and\n * interactions are composed by UI layers (e.g., GridLayout) on top of this.\n *\n * Includes content caching to preserve React component state across re-renders.\n * This is essential for maintaining internal state when parent components\n * re-create the layers array.\n */\nimport * as React from \"react\";\nimport type { PanelLayoutConfig, LayerDefinition } from \"./types\";\nimport { useContentCache } from \"./hooks/useContentCache\";\n\nexport type PanelSystemContextValue = {\n config: PanelLayoutConfig;\n style?: React.CSSProperties;\n layers: {\n /** Raw panel definitions (no grid normalization). */\n defs: LayerDefinition[];\n /** Fast lookup map by id for consumers. */\n layerById: Map<string, LayerDefinition>;\n };\n /**\n * Get cached content for a layer. Returns the same ReactNode reference\n * for the same layer ID to prevent remounting on parent re-renders.\n */\n getCachedContent: (layerId: string) => React.ReactNode | null;\n};\n\nconst PanelSystemContext = React.createContext<PanelSystemContextValue | null>(null);\n\nexport const usePanelSystem = (): PanelSystemContextValue => {\n const ctx = React.useContext(PanelSystemContext);\n if (!ctx) {\n throw new Error(\"usePanelSystem must be used within a PanelSystemProvider.\");\n }\n return ctx;\n};\n\nexport type PanelSystemProviderProps = React.PropsWithChildren<{\n config: PanelLayoutConfig;\n layers: LayerDefinition[];\n style?: React.CSSProperties;\n}>;\n\nexport const PanelSystemProvider: React.FC<PanelSystemProviderProps> = ({ config, layers, style, children }) => {\n const layerById = React.useMemo(() => {\n const map = new Map<string, LayerDefinition>();\n layers.forEach((layer) => {\n map.set(layer.id, layer);\n });\n return map;\n }, [layers]);\n\n // Content resolver for useContentCache\n const resolveContent = React.useCallback(\n (layerId: string): React.ReactNode | null => {\n const layer = layerById.get(layerId);\n return layer?.component ?? null;\n },\n [layerById],\n );\n\n // Valid IDs for cache cleanup\n const validIds = React.useMemo(() => layers.map((l) => l.id), [layers]);\n\n // Use shared content cache hook\n const { getCachedContent } = useContentCache({\n resolveContent,\n validIds,\n });\n\n const value = React.useMemo<PanelSystemContextValue>(\n () => ({\n config,\n style,\n layers: {\n defs: layers,\n layerById,\n },\n getCachedContent,\n }),\n [config, style, layers, layerById, getCachedContent],\n );\n\n return <PanelSystemContext.Provider value={value}>{children}</PanelSystemContext.Provider>;\n};\n","/**\n * @file Context exposing the current grid layer id and helpers to child components.\n */\nimport * as React from \"react\";\nimport type { LayerDefinition } from \"../../types\";\nimport { usePanelSystem } from \"../../PanelSystemContext\";\nimport { useGridLayoutContext, type GridLayerHandleProps } from \"./GridLayoutContext\";\n\ntype LayerInstanceContextValue = {\n layerId: string;\n};\n\nconst LayerInstanceContext = React.createContext<LayerInstanceContextValue | null>(null);\n\nexport type LayerInstanceProviderProps = React.PropsWithChildren<LayerInstanceContextValue>;\n\nexport const LayerInstanceProvider: React.FC<LayerInstanceProviderProps> = ({ layerId, children }) => {\n const value = React.useMemo(() => ({ layerId }), [layerId]);\n return <LayerInstanceContext.Provider value={value}>{children}</LayerInstanceContext.Provider>;\n};\n\nexport const useLayerInstance = (): LayerInstanceContextValue => {\n const value = React.useContext(LayerInstanceContext);\n if (!value) {\n throw new Error(\"useLayerInstance must be used within a LayerInstanceProvider.\");\n }\n return value;\n};\n\n/**\n * Convenience: read the current layer definition from the core registry.\n */\nexport const useCurrentLayerDefinition = (): LayerDefinition => {\n const { layerId } = useLayerInstance();\n const { layers } = usePanelSystem();\n const def = layers.layerById.get(layerId);\n if (!def) {\n throw new Error(`Layer definition not found for id: ${layerId}`);\n }\n return def;\n};\n\n/**\n * Convenience: get drag handle props, pre-bound to the current layer.\n */\nexport const useCurrentLayerHandleProps = (): GridLayerHandleProps => {\n const { layerId } = useLayerInstance();\n const { getLayerHandleProps } = useGridLayoutContext();\n return React.useMemo(() => getLayerHandleProps(layerId), [getLayerHandleProps, layerId]);\n};\n\n/**\n * Compatibility helper for existing code using useLayerDragHandle.\n * Prefer useCurrentLayerHandleProps for direct access.\n */\nexport const useLayerDragHandleProps = useCurrentLayerHandleProps;\n","/**\n * @file Renders floating layers inside a dedicated browser popup window.\n */\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type { LayerDefinition, PopupWindowOptions, WindowPosition, WindowBounds } from \"../../types\";\nimport { LayerInstanceProvider } from \"../../modules/grid/LayerInstanceContext\";\n\nconst ensureNumericOffset = (value: number | string | undefined, key: keyof WindowPosition, layerId: string): number => {\n if (typeof value === \"number\" && Number.isFinite(value)) {\n return value;\n }\n throw new Error(`Popup layer \"${layerId}\" requires a numeric \"${key}\" value.`);\n};\n\nconst resolvePopupAnchor = (position: WindowPosition | undefined, layerId: string): { left: number; top: number } => {\n if (!position) {\n throw new Error(`Popup layer \"${layerId}\" must define position (left/top).`);\n }\n return {\n left: ensureNumericOffset(position.left, \"left\", layerId),\n top: ensureNumericOffset(position.top, \"top\", layerId),\n };\n};\n\nconst numericFeature = (value: number): string => {\n return `${Math.round(value)}`;\n};\n\nconst booleanFeature = (value: boolean | undefined): string | undefined => {\n if (value === undefined) {\n return undefined;\n }\n return value ? \"yes\" : \"no\";\n};\n\nconst buildWindowFeatures = (\n layerId: string,\n position: WindowPosition | undefined,\n width: number | string | undefined,\n height: number | string | undefined,\n options: PopupWindowOptions | undefined,\n): string => {\n const features: Record<string, string> = {};\n const anchor = resolvePopupAnchor(position, layerId);\n\n if (typeof width !== \"number\" || typeof height !== \"number\") {\n throw new Error(`Popup layer \"${layerId}\" requires numeric width/height.`);\n }\n features.width = numericFeature(width);\n features.height = numericFeature(height);\n features.left = numericFeature(anchor.left);\n features.top = numericFeature(anchor.top);\n\n const overrides = options?.features;\n if (overrides) {\n const toolbar = booleanFeature(overrides.toolbar);\n const menubar = booleanFeature(overrides.menubar);\n const location = booleanFeature(overrides.location);\n const status = booleanFeature(overrides.status);\n const resizable = booleanFeature(overrides.resizable);\n const scrollbars = booleanFeature(overrides.scrollbars);\n\n if (toolbar !== undefined) {\n features.toolbar = toolbar;\n }\n if (menubar !== undefined) {\n features.menubar = menubar;\n }\n if (location !== undefined) {\n features.location = location;\n }\n if (status !== undefined) {\n features.status = status;\n }\n if (resizable !== undefined) {\n features.resizable = resizable;\n }\n if (scrollbars !== undefined) {\n features.scrollbars = scrollbars;\n }\n }\n\n return Object.entries(features)\n .map(([key, value]) => `${key}=${value}`)\n .join(\",\");\n};\n\nconst applyBoundsToWindow = (\n popupWindow: Window,\n layerId: string,\n position: WindowPosition | undefined,\n width: number | string | undefined,\n height: number | string | undefined,\n) => {\n const anchor = resolvePopupAnchor(position, layerId);\n if (typeof width !== \"number\" || typeof height !== \"number\") {\n throw new Error(`Popup layer \"${layerId}\" requires numeric width/height.`);\n }\n popupWindow.moveTo(Math.round(anchor.left), Math.round(anchor.top));\n popupWindow.resizeTo(Math.round(width), Math.round(height));\n};\n\ntype PopupLayerPortalProps = {\n layer: LayerDefinition;\n};\n\nexport const PopupLayerPortal: React.FC<PopupLayerPortalProps> = ({ layer }) => {\n const floating = layer.floating;\n if (!floating) {\n throw new Error(`Layer \"${layer.id}\" is missing floating configuration required for popup mode.`);\n }\n const mode = floating.mode ?? \"embedded\";\n if (mode !== \"popup\") {\n throw new Error(`PopupLayerPortal received layer \"${layer.id}\" that is not configured for popup mode.`);\n }\n\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const popupWindowRef = React.useRef<Window | null>(null);\n const [isMounted, setIsMounted] = React.useState(false);\n\n React.useEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n const features = buildWindowFeatures(layer.id, layer.position, layer.width, layer.height, floating.popup);\n const windowName = floating.popup?.name ?? layer.id;\n const createdWindow = resolvePopupWindow(\n windowName,\n features,\n {\n position: layer.position,\n size: { width: layer.width as number, height: layer.height as number },\n },\n floating.popup,\n );\n\n if (!createdWindow) {\n throw new Error(`Failed to open popup window for layer \"${layer.id}\".`);\n }\n\n const openedWindow = createdWindow;\n\n popupWindowRef.current = openedWindow;\n\n if (floating.popup?.focus !== false) {\n openedWindow.focus();\n }\n\n if (!openedWindow.document.title) {\n openedWindow.document.title = layer.id;\n }\n openedWindow.document.body.innerHTML = \"\";\n const mountNode = openedWindow.document.createElement(\"div\");\n mountNode.dataset.layerId = layer.id;\n openedWindow.document.body.appendChild(mountNode);\n containerRef.current = mountNode;\n setIsMounted(true);\n\n applyBoundsToWindow(openedWindow, layer.id, layer.position, layer.width, layer.height);\n\n const handleBeforeUnload = () => {\n popupWindowRef.current = null;\n containerRef.current = null;\n setIsMounted(false);\n };\n openedWindow.addEventListener(\"beforeunload\", handleBeforeUnload);\n\n return () => {\n openedWindow.removeEventListener(\"beforeunload\", handleBeforeUnload);\n if (floating.popup?.closeOnUnmount !== false) {\n openedWindow.close();\n }\n popupWindowRef.current = null;\n containerRef.current = null;\n setIsMounted(false);\n };\n }, [\n floating.popup?.closeOnUnmount,\n floating.popup?.features?.location,\n floating.popup?.features?.menubar,\n floating.popup?.features?.resizable,\n floating.popup?.features?.scrollbars,\n floating.popup?.features?.status,\n floating.popup?.features?.toolbar,\n floating.popup?.focus,\n floating.popup?.name,\n layer.id,\n ]);\n\n React.useEffect(() => {\n const popupWindow = popupWindowRef.current;\n if (!popupWindow) {\n return;\n }\n applyBoundsToWindow(popupWindow, layer.id, layer.position, layer.width, layer.height);\n }, [layer.position?.left, layer.position?.top, layer.height, layer.width, layer.id]);\n\n if (!isMounted || !containerRef.current) {\n return null;\n }\n\n return createPortal(<LayerInstanceProvider layerId={layer.id}>{layer.component}</LayerInstanceProvider>, containerRef.current);\n};\n\nconst resolvePopupWindow = (\n windowName: string,\n features: string,\n bounds: WindowBounds,\n options: PopupWindowOptions | undefined,\n): Window | null => {\n const customFactory = options?.createWindow;\n if (customFactory) {\n return customFactory({ name: windowName, features, bounds });\n }\n return window.open(\"\", windowName, features);\n};\n","/**\n * @file FloatingWindow component with chrome support\n *\n * Renders floating panel content with optional built-in chrome (FloatingPanelFrame).\n * When chrome is enabled and header is provided, header becomes the drag handle.\n */\nimport * as React from \"react\";\nimport type { FloatingBehavior } from \"../../types\";\nimport {\n FloatingPanelCloseButton,\n FloatingPanelFrame,\n FloatingPanelHeader,\n FloatingPanelTitle,\n FloatingPanelControls,\n FloatingPanelContent,\n} from \"../paneling/FloatingPanelFrame\";\n\nexport type FloatingWindowProps = {\n id: string;\n config: FloatingBehavior;\n onClose: () => void;\n children: React.ReactNode;\n};\n\ntype CloseButtonProps = {\n onClick: () => void;\n};\n\nconst CloseButton: React.FC<CloseButtonProps> = ({ onClick }) => (\n <FloatingPanelControls>\n <FloatingPanelCloseButton onClick={onClick} aria-label=\"Close window\" data-drag-ignore=\"true\" />\n </FloatingPanelControls>\n);\n\ntype FloatingWindowHeaderProps = {\n header?: FloatingBehavior[\"header\"];\n draggable?: boolean;\n onClose: () => void;\n};\n\nconst FloatingWindowHeader: React.FC<FloatingWindowHeaderProps> = ({ header, draggable, onClose }) => {\n if (!header) {\n return null;\n }\n\n const showCloseButton = header.showCloseButton ?? false;\n const dragHandleProps = draggable ? { \"data-drag-handle\": \"true\" } : {};\n const cursorStyle = draggable ? \"grab\" : undefined;\n\n return (\n <FloatingPanelHeader {...dragHandleProps} style={{ cursor: cursorStyle }}>\n {header.title ? <FloatingPanelTitle>{header.title}</FloatingPanelTitle> : null}\n {showCloseButton ? <CloseButton onClick={onClose} /> : null}\n </FloatingPanelHeader>\n );\n};\n\ntype FloatingWindowViewProps = {\n header?: FloatingBehavior[\"header\"];\n draggable?: boolean;\n chrome: boolean;\n onClose: () => void;\n children: React.ReactNode;\n};\n\nconst FloatingWindowView: React.FC<FloatingWindowViewProps> = ({ header, draggable, chrome, onClose, children }) => {\n if (!chrome) {\n return <>{children}</>;\n }\n\n return (\n <FloatingPanelFrame style={{ height: \"100%\", width: \"100%\" }}>\n <FloatingWindowHeader header={header} draggable={draggable} onClose={onClose} />\n <FloatingPanelContent style={{ flex: 1, display: \"flex\", flexDirection: \"column\" }}>\n {children}\n </FloatingPanelContent>\n </FloatingPanelFrame>\n );\n};\n\nexport const FloatingWindow: React.FC<FloatingWindowProps> = ({ id, config, onClose, children }) => {\n const chrome = config.chrome ?? false;\n const draggable = config.draggable ?? false;\n const ariaLabel = config.header?.title ?? config.ariaLabel ?? \"Floating window\";\n\n return (\n <div data-floating-window={id} role=\"dialog\" aria-label={ariaLabel} style={{ height: \"100%\", width: \"100%\" }}>\n <FloatingWindowView header={config.header} draggable={draggable} chrome={chrome} onClose={onClose}>\n {children}\n </FloatingWindowView>\n </div>\n );\n};\n\nFloatingWindow.displayName = \"FloatingWindow\";\n"],"names":["drawerBackdropStyle","COLOR_DRAWER_BACKDROP","drawerBaseStyle","drawerPlacementStyles","computeTransitionValue","mode","duration","easing","durationValue","DRAWER_TRANSITION_DURATION","easingValue","DRAWER_TRANSITION_EASING","shouldShowCloseButton","dismissible","showClose","DrawerContent","chrome","frameStyle","header","onClose","children","jsxs","FloatingPanelFrame","jsx","DrawerHeaderView","FloatingPanelContent","DRAWER_CONTENT_PADDING","showCloseButton","shouldShowClose","React","FloatingPanelHeader","DRAWER_HEADER_PADDING_Y","DRAWER_HEADER_PADDING_X","DRAWER_HEADER_GAP","FloatingPanelTitle","FloatingPanelCloseButton","Drawer","id","config","isOpen","zIndex","width","height","position","inline","transitionMode","transitionDuration","transitionEasing","placement","anchor","pos","openTransforms","drawerStyle","transitionValue","style","ariaLabel","backdropStyle","base","isVertical","Fragment","waitForTransitionEnd","el","timeout","resolve","resolved","done","handler","e","runTransition","update","useTransitionState","options","states","setStates","optionsRef","transitionOptions","element","prev","opts","state","open","close","parseDuration","value","match","useDrawerState","layers","drawerStates","setDrawerStates","initial","layer","layerMap","map","updateState","layerId","DrawerLayers","drawer","drawerLayers","closeHandlers","handlers","GridLayoutContext","GridLayoutProvider","useGridLayoutContext","context","PanelSystemContext","usePanelSystem","ctx","PanelSystemProvider","layerById","resolveContent","validIds","l","getCachedContent","useContentCache","LayerInstanceContext","LayerInstanceProvider","useLayerInstance","ensureNumericOffset","key","resolvePopupAnchor","numericFeature","booleanFeature","buildWindowFeatures","features","overrides","toolbar","menubar","location","status","resizable","scrollbars","applyBoundsToWindow","popupWindow","PopupLayerPortal","floating","containerRef","popupWindowRef","isMounted","setIsMounted","windowName","createdWindow","resolvePopupWindow","openedWindow","mountNode","handleBeforeUnload","createPortal","bounds","customFactory","CloseButton","onClick","FloatingPanelControls","FloatingWindowHeader","draggable","dragHandleProps","cursorStyle","FloatingWindowView","FloatingWindow"],"mappings":"ofAwBMA,EAA2C,CAC/C,SAAU,QACV,MAAO,EACP,WAAYC,EAAAA,qBACd,EAEMC,EAAuC,CAC3C,WAAY,WACd,EAEMC,EAA6D,CACjE,KAAM,CACJ,IAAK,EACL,OAAQ,EACR,KAAM,EACN,UAAW,mBAAA,EAEb,MAAO,CACL,IAAK,EACL,OAAQ,EACR,MAAO,EACP,UAAW,kBAAA,EAEb,IAAK,CACH,IAAK,EACL,KAAM,EACN,MAAO,EACP,UAAW,mBAAA,EAEb,OAAQ,CACN,OAAQ,EACR,KAAM,EACN,MAAO,EACP,UAAW,kBAAA,CAEf,EAEMC,EAAyB,CAC7BC,EACAC,EACAC,IACuB,CACvB,GAAIF,IAAS,OACX,OAGF,MAAMG,EAAgBF,GAAYG,EAAAA,2BAC5BC,EAAcH,GAAUI,EAAAA,yBAE9B,MAAO,aAAaH,CAAa,IAAIE,CAAW,EAClD,EAcME,EAAwB,CAACC,EAAsBC,IAC9CD,EAGEC,EAFE,GAcLC,EAA8C,CAAC,CAAE,OAAAC,EAAQ,WAAAC,EAAY,OAAAC,EAAQ,YAAAL,EAAa,QAAAM,EAAS,SAAAC,KAClGJ,EAIHK,EAAAA,KAACC,EAAAA,mBAAA,CAAmB,MAAOL,EACzB,SAAA,CAAAM,EAAAA,IAACC,EAAA,CAAiB,OAAAN,EAAgB,YAAAL,EAA0B,QAAAM,CAAA,CAAkB,EAC9EI,E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Q,UAAAsI,EAAW,OAAAxI,EAAQ,QAAAG,EAAS,SAAAC,KAC9FJ,EAKHK,EAAAA,KAACC,sBAAmB,MAAO,CAAE,OAAQ,OAAQ,MAAO,QAClD,SAAA,CAAAC,EAAAA,IAACgI,GAAA,CAAqB,OAAArI,EAAgB,UAAAsI,EAAsB,QAAArI,CAAA,CAAkB,EAC9EI,EAAAA,IAACE,EAAAA,qBAAA,CAAqB,MAAO,CAAE,KAAM,EAAG,QAAS,OAAQ,cAAe,QAAA,EACrE,SAAAL,CAAA,CACH,CAAA,EACF,oBATU,SAAAA,EAAS,EAaVwI,EAAgD,CAAC,CAAE,GAAAvH,EAAI,OAAAC,EAAQ,QAAAnB,EAAS,SAAAC,KAAe,CAClG,MAAMJ,EAASsB,EAAO,QAAU,GAC1BkH,EAAYlH,EAAO,WAAa,GAChCiB,EAAYjB,EAAO,QAAQ,OAASA,EAAO,WAAa,kBAE9D,OACEf,EAAAA,IAAC,MAAA,CAAI,uBAAsBc,EAAI,KAAK,SAAS,aAAYkB,EAAW,MAAO,CAAE,OAAQ,OAAQ,MAAO,MAAA,EAClG,SAAAhC,EAAAA,IAACoI,GAAA,CAAmB,OAAQrH,EAAO,OAAQ,UAAAkH,EAAsB,OAAAxI,EAAgB,QAAAG,EAC9E,SAAAC,CAAA,CACH,CAAA,CACF,CAEJ,EAEAwI,EAAe,YAAc"}
@@ -1,2 +0,0 @@
1
- "use strict";const S=require("react/jsx-runtime"),Tt=require("react"),L=require("./FloatingWindow-TCDNY5gE.cjs"),v=require("./styles-qf6ptVLD.cjs"),Lt=require("./SwipePivotTabBar-BrQismcZ.cjs"),xt=require("./ResizeHandle-CScipO5l.cjs"),pt=require("./useIsomorphicLayoutEffect-DGRNF4Lf.cjs"),ot=require("./useDocumentPointerEvents-ChqrKXDk.cjs"),st=require("./useEffectEvent-huSsGUnl.cjs");function _t(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const d=_t(Tt),Ht=()=>{const t=new Map;return e=>{if(!e)return;const n=t.get(e);if(n!==void 0)return n;const r=t.size;return t.set(e,r),r}},Pt=Ht(),X=new Map,Mt=t=>{const e=`ovs-threshold:${t.threshold}-rootMargin:${t.rootMargin}-root:${Pt(t.root)}`;if(X.has(e))return X.get(e);const n=new class{#t=new Map;#e=new IntersectionObserver(r=>{r.forEach(o=>{const s=this.#t.get(o.target);s&&s(o)})},t);observe(r,o){return this.#t.set(r,o),this.#e.observe(r),()=>{this.#t.delete(r),this.#e.unobserve(r)}}};return X.set(e,n),n},it=Object.freeze({x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0});function Dt(t,{threshold:e=0,rootMargin:n="0px",root:r=null}){const[o,s]=d.useState(null);return d.useEffect(()=>{const a=t.current;return a?Mt({threshold:e,rootMargin:n,root:r}).observe(a,u=>{s({isIntersecting:u.isIntersecting,boundingClientRect:u.boundingClientRect,intersectionRatio:u.intersectionRatio,intersectionRect:u.intersectionRect,rootBounds:u.rootBounds,target:u.target,time:u.time})}):void 0},[t,e,n,r]),d.useMemo(()=>({isIntersecting:o?.isIntersecting??!1,boundingClientRect:o?.boundingClientRect??it,intersectionRatio:o?.intersectionRatio??0,intersectionRect:o?.intersectionRect??it,rootBounds:o?.rootBounds??null,target:o?.target??t.current,time:o?.time??0}),[o,t])}const bt={position:"absolute",pointerEvents:"auto",boxSizing:"border-box",background:"transparent",border:"none"},Gt={...bt,width:v.GRID_LAYER_CORNER_HIT_SIZE,height:v.GRID_LAYER_CORNER_HIT_SIZE,zIndex:2},Nt={...bt,zIndex:1},kt={"top-left":{top:0,left:0,transform:"translate(-50%, -50%)",cursor:"nwse-resize"},"top-right":{top:0,right:0,transform:"translate(50%, -50%)",cursor:"nesw-resize"},"bottom-left":{bottom:0,left:0,transform:"translate(-50%, 50%)",cursor:"nesw-resize"},"bottom-right":{bottom:0,right:0,transform:"translate(50%, 50%)",cursor:"nwse-resize"}},At={left:{top:v.GRID_LAYER_CORNER_HIT_SIZE,bottom:v.GRID_LAYER_CORNER_HIT_SIZE,left:0,width:v.GRID_LAYER_EDGE_HIT_THICKNESS,transform:"translateX(-50%)",cursor:"ew-resize"},right:{top:v.GRID_LAYER_CORNER_HIT_SIZE,bottom:v.GRID_LAYER_CORNER_HIT_SIZE,right:0,width:v.GRID_LAYER_EDGE_HIT_THICKNESS,transform:"translateX(50%)",cursor:"ew-resize"},top:{left:v.GRID_LAYER_CORNER_HIT_SIZE,right:v.GRID_LAYER_CORNER_HIT_SIZE,top:0,height:v.GRID_LAYER_EDGE_HIT_THICKNESS,transform:"translateY(-50%)",cursor:"ns-resize"},bottom:{left:v.GRID_LAYER_CORNER_HIT_SIZE,right:v.GRID_LAYER_CORNER_HIT_SIZE,bottom:0,height:v.GRID_LAYER_EDGE_HIT_THICKNESS,transform:"translateY(50%)",cursor:"ns-resize"}},jt=[{key:"top-left",variant:"corner",horizontal:"left",vertical:"top"},{key:"top-right",variant:"corner",horizontal:"right",vertical:"top"},{key:"bottom-left",variant:"corner",horizontal:"left",vertical:"bottom"},{key:"bottom-right",variant:"corner",horizontal:"right",vertical:"bottom"},{key:"left",variant:"edge",horizontal:"left"},{key:"right",variant:"edge",horizontal:"right"},{key:"top",variant:"edge",vertical:"top"},{key:"bottom",variant:"edge",vertical:"bottom"}],St=({layerId:t,onPointerDown:e})=>S.jsx(S.Fragment,{children:jt.map(n=>{const r=n.variant==="corner"?Gt:Nt,o=n.variant==="corner"?kt[n.key]:At[n.key],s={...r,...o},a=n.variant==="corner"?{"data-resize-corner":n.key}:{"data-resize-edge":n.key};return S.jsx("div",{role:"presentation","aria-hidden":"true",style:s,...a,"data-layer-id":t,onPointerDown:l=>e(n,l)},n.key)})}),Ot=({pivot:t})=>{const{Outlet:e}=Lt.usePivot({items:t.items,activeId:t.activeId,defaultActiveId:t.defaultActiveId,onActiveChange:t.onActiveChange,transitionMode:t.transitionMode});return S.jsx(e,{})},Yt=(t,e)=>t.pivot?S.jsx(Ot,{pivot:t.pivot}):t.cache?e(t.id):t.component,zt=d.memo(({layer:t,onClose:e})=>{const{getCachedContent:n}=L.usePanelSystem(),r=Yt(t,n);return t.floating?.chrome?S.jsx(L.FloatingWindow,{id:t.id,config:t.floating,onClose:e,children:r}):r});zt.displayName="LayerContentRenderer";const wt=d.memo(({layerId:t,isResizable:e,onPointerDown:n})=>e?S.jsx(St,{layerId:t,onPointerDown:n}):null);wt.displayName="LayerResizeHandles";const $t=(t,e)=>t?"auto":e?"visible":"hidden",Et=d.memo(({layer:t,handleLayerPointerDown:e})=>{const{getLayerRenderState:n}=L.useGridLayoutContext(),{style:r,isResizable:o,isResizing:s,onResizeHandlePointerDown:a}=n(t),l=d.useMemo(()=>{const f={};return t.gridArea&&(f.gridArea=t.gridArea),t.gridRow&&(f.gridRow=t.gridRow),t.gridColumn&&(f.gridColumn=t.gridColumn),f},[t.gridArea,t.gridRow,t.gridColumn]),u=d.useMemo(()=>{const f=!!t.floating,g=$t(t.scrollable,f),b={...r,...l,minWidth:0,minHeight:0,overflow:g};return o?{...b,position:"relative"}:b},[r,l,o,t.scrollable,t.floating]),p=d.useCallback(()=>{t.floating?.onClose?.()},[t.floating]);return S.jsxs("div",{"data-layer-id":t.id,"data-draggable":!!t.floating?.draggable,"data-resizable":o,"data-resizing":s,style:u,onPointerDown:e,children:[S.jsx(L.LayerInstanceProvider,{layerId:t.id,children:S.jsx(zt,{layer:t,onClose:p})}),S.jsx(wt,{layerId:t.id,isResizable:o,onPointerDown:a})]})});Et.displayName="EmbeddedLayer";const Rt=({layers:t})=>{const{handleLayerPointerDown:e}=L.useGridLayoutContext();return S.jsx(S.Fragment,{children:t.map(n=>{const r=n.floating?.mode??"embedded";return n.floating&&r==="popup"?S.jsx(L.PopupLayerPortal,{layer:n},n.id):S.jsx(Et,{layer:n,handleLayerPointerDown:e},n.id)})})},at={position:"absolute",pointerEvents:"auto"},K=({direction:t,trackIndex:e,align:n,gap:r,span:o,onResize:s})=>{const a=t==="col"?"vertical":"horizontal",l=d.useCallback(f=>{const g=n==="start"?-f:f;s(t,e,g)},[n,t,e,s]),u=d.useMemo(()=>t==="col"?{gridColumn:`${e+1} / ${e+2}`,gridRow:`${o.start} / ${o.end}`}:{gridRow:`${e+1} / ${e+2}`,gridColumn:`${o.start} / ${o.end}`},[t,e,o]),p=d.useMemo(()=>{const g=Math.max(0,r)/2+v.GRID_HANDLE_THICKNESS/2;return t==="col"?{...at,width:v.GRID_HANDLE_THICKNESS,height:"100%",top:0,bottom:0,...n==="start"?{left:-g}:{right:-g}}:{...at,width:"100%",height:v.GRID_HANDLE_THICKNESS,left:0,right:0,...n==="start"?{top:-g}:{bottom:-g}}},[n,t,r]);return S.jsx("div",{"data-resizable":"true",style:{...u,position:"relative",pointerEvents:"none"},children:S.jsx("div",{"data-direction":a,"data-align":n,"data-handle":"true",style:p,children:S.jsx(xt.ResizeHandle,{direction:a,onResize:l})})})},Ft=t=>{const e=new Map;t.forEach((r,o)=>{r.forEach((s,a)=>{if(!s||s===".")return;const l=e.get(s);if(l){const p={rowStart:Math.min(l.rowStart,o),rowEnd:Math.max(l.rowEnd,o),colStart:Math.min(l.colStart,a),colEnd:Math.max(l.colEnd,a)};e.set(s,p);return}const u={rowStart:o,rowEnd:o,colStart:a,colEnd:a};e.set(s,u)})});const n=new Map;return e.forEach((r,o)=>{const s=r.rowStart+1,a=r.rowEnd+2,l=r.colStart+1,u=r.colEnd+2,p={gridArea:o,gridRow:`${s} / ${a}`,gridColumn:`${l} / ${u}`};n.set(o,p)}),n},Bt=(t,e)=>{if((t.positionMode??"grid")!=="grid")return t;const r=t.gridArea??t.id,o=e.get(r);if(!o)return t;const s=!t.gridArea,a=!t.gridRow,l=!t.gridColumn;return!s&&!a&&!l?t:{...t,gridArea:s?o.gridArea:t.gridArea,gridRow:a?o.gridRow:t.gridRow,gridColumn:l?o.gridColumn:t.gridColumn}},vt=(t,e)=>{const n=d.useMemo(()=>Ft(t.areas),[t.areas]),r=d.useMemo(()=>e.map(l=>Bt(l,n)),[e,n]),o=d.useMemo(()=>r.filter(l=>l.visible!==!1),[r]),s=d.useMemo(()=>o.filter(l=>!l.drawer),[o]),a=d.useMemo(()=>{const l=new Map;return r.forEach(u=>{l.set(u.id,u)}),l},[r]);return{normalizedLayers:r,visibleLayers:o,regularLayers:s,layerById:a}},Wt=t=>{if(!t)return{rowGap:0,columnGap:0};const e=t.split(/\s+/).map(r=>r.trim()).filter(Boolean),n=r=>{const o=r.match(/^(-?\d+(?:\.\d+)?)px$/);return o?Number.parseFloat(o[1]):0};if(e.length===1){const r=n(e[0]);return{rowGap:r,columnGap:r}}return{rowGap:n(e[0]),columnGap:n(e[1])}},Xt=(t,e)=>{if(!t)return[];const n=getComputedStyle(t);return(e==="col"?n.gridTemplateColumns:n.gridTemplateRows).split(/\s+/).map(o=>parseFloat(o)).filter(o=>!Number.isNaN(o))},V=(t,e=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY)=>Math.min(Math.max(t,e),n),Kt=(t,e)=>typeof t!="number"||!Number.isFinite(t)?e:t,$=(t,e)=>`${t}-${e}`,Zt=(t,e,n,r)=>{const o=$(n,r),s=e[o];return s!==void 0?`minmax(${t.minSize??0}px, ${s}px)`:t.size},ct=(t,e,n)=>t.map((r,o)=>Zt(r,e,n,o)).join(" "),j=(t,e)=>t.reduce((n,r,o)=>(r.resizable&&r.size.endsWith("px")&&(n[$(e,o)]=parseInt(r.size,10)),n),{}),Vt=({trackSizes:t,track:e,direction:n,trackIndex:r,containerRef:o})=>{const s=$(n,r),a=t[s];if(a!==void 0)return a;const u=Xt(o?.current??null,n)[r];return u!==void 0&&u>0?u:e.size.endsWith("px")?Number.parseInt(e.size,10):300},qt=(t,e)=>t.reduce((n,r,o)=>o===e?n:r.size.includes("fr")?n+100:n+(r.minSize??50),0),Ut=({track:t,tracks:e,trackIndex:n,direction:r,containerRef:o,gapSizes:s})=>{if(!o?.current)return t.maxSize;const a=r==="col"?o.current.offsetWidth:o.current.offsetHeight,l=qt(e,n),u=e.length-1,p=r==="col"?s.columnGap:s.rowGap,f=u*p,g=a-l-f;return t.maxSize!==void 0?Math.min(t.maxSize,g):g},Jt=(t,e,n)=>V(t,e??Number.NEGATIVE_INFINITY,n??Number.POSITIVE_INFINITY),lt=(t,e)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const l=t[a],u=l[e],p=l[e+1];u!==p&&r.push(a)}if(r.length===0)return{start:1,end:n+1};const o=Math.min(...r),s=Math.max(...r);return{start:o+1,end:s+2}},ut=(t,e)=>{const n=t[e],r=t[e+1],o=n?.length??0,s=[];for(let u=0;u<o;u++){const p=n?.[u],f=r?.[u];p!==f&&s.push(u)}if(s.length===0)return{start:1,end:o+1};const a=Math.min(...s),l=Math.max(...s);return{start:a+1,end:l+2}},Qt=(t,e)=>{if(t.length===0)return[];const n=e.length;if(t.length===1)return t[0]?.resizable?[{trackIndex:0,align:"end",span:{start:1,end:n+1}}]:[];const r=[];return Array.from({length:t.length-1},(s,a)=>a).forEach(s=>{const a=t[s];if(t[s+1]?.resizable){const u=lt(e,s);r.push({trackIndex:s+1,align:"start",span:u});return}if(a?.resizable){const u=lt(e,s);r.push({trackIndex:s,align:"end",span:u})}}),r},te=(t,e)=>{if(t.length===0)return[];const n=e[0]?.length??0;if(t.length===1)return t[0]?.resizable?[{trackIndex:0,align:"end",span:{start:1,end:n+1}}]:[];const r=[];return Array.from({length:t.length-1},(s,a)=>a).forEach(s=>{const a=t[s];if(t[s+1]?.resizable){const u=ut(e,s);r.push({trackIndex:s+1,align:"start",span:u});return}if(a?.resizable){const u=ut(e,s);r.push({trackIndex:s,align:"end",span:u})}}),r},ee=t=>t!==void 0?{gap:t}:{},ne=(t,e)=>{const n=Object.keys(e),r={};for(const f of n)r[f]=t[f]??e[f];const o=Object.keys(t),s=o.length!==n.length,a=o.some(f=>!Object.prototype.hasOwnProperty.call(r,f)),l=s?!0:a,u=n.some(f=>t[f]!==r[f]);return(l?!0:u)?r:null},Ct=(t,e,n)=>{const[r,o]=d.useState(()=>({...j(t.columns,"col"),...j(t.rows,"row")}));pt.useIsomorphicLayoutEffect(()=>{const g={...j(t.columns,"col"),...j(t.rows,"row")};o(b=>ne(b,g)??b)},[t.columns,t.rows]);const s=d.useMemo(()=>t.areas.map(g=>`"${g.join(" ")}"`).join(" "),[t.areas]),a=d.useMemo(()=>Wt(t.gap),[t.gap]),l=d.useMemo(()=>Qt(t.columns,t.areas),[t.columns,t.areas]),u=d.useMemo(()=>te(t.rows,t.areas),[t.rows,t.areas]),p=d.useMemo(()=>({...t.style,...e,gridTemplateAreas:s,gridTemplateRows:ct(t.rows,r,"row"),gridTemplateColumns:ct(t.columns,r,"col"),...ee(t.gap)}),[s,t.columns,t.gap,t.rows,t.style,e,r]),f=d.useCallback((g,b,E)=>{const I=g==="row"?t.rows:t.columns,C=I[b];if(!C||!C.resizable)return;const _=Vt({trackSizes:r,track:C,direction:g,trackIndex:b,containerRef:n}),H=Ut({track:C,tracks:I,trackIndex:b,direction:g,containerRef:n,gapSizes:a}),P=$(g,b);o(N=>{const y=_+E,T=Jt(y,C.minSize,H);return{...N,[P]:T}})},[t.columns,t.rows,r,n,a]);return{columnHandles:l,rowHandles:u,gapSizes:a,gridStyle:p,handleResize:f}},re=t=>t.positionMode?t.positionMode:t.floating?(t.floating.mode??"embedded")==="embedded"?"absolute":"relative":"grid",oe=t=>({position:t==="grid"?"relative":t}),se=(t,e)=>e!=="grid"?{}:{gridArea:t.gridArea,gridRow:t.gridRow,gridColumn:t.gridColumn},ie=t=>t?{top:t.top,right:t.right,bottom:t.bottom,left:t.left}:{},ae=t=>t!==void 0?{zIndex:t}:{},ce=(t,e)=>({width:t,height:e}),le=(t,e)=>t.pointerEvents!==void 0?typeof t.pointerEvents=="boolean"?{pointerEvents:t.pointerEvents?"auto":"none"}:{pointerEvents:t.pointerEvents}:e==="absolute"||e==="fixed"?{pointerEvents:"auto"}:{},ue=t=>t.floating?t.floating.position??t.floating.defaultPosition??t.position:t.position,de=t=>{if(t.floating){const e=t.floating.size??t.floating.defaultSize;if(e)return{width:e.width,height:e.height}}return{width:t.width,height:t.height}},ge=t=>t.floating?.zIndex!==void 0?t.floating.zIndex:t.zIndex,he=t=>{const e=re(t),n=ue(t),r=de(t),o=ge(t);return{...t.style,...oe(e),...se(t,e),...ie(n),...ae(o),...ce(r.width,r.height),...le(t,e)}},fe=t=>{const e=t.floating;return e?e.mode??"embedded":null},D=t=>fe(t)!=="embedded"?null:t.floating??null,dt=t=>t instanceof HTMLElement?["INPUT","TEXTAREA","SELECT","BUTTON"].includes(t.tagName):!1,gt=(t,e,n)=>{const r=e??Number.NEGATIVE_INFINITY,o=n??Number.POSITIVE_INFINITY;return V(t,r,o)},ht=(t,e,n)=>{if(typeof t=="number"&&Number.isFinite(t))return t;throw new Error(`Floating layer "${n}" must provide a numeric "${e}" value when draggable mode is enabled.`)},ft=t=>{const e=D(t);if(!e)throw new Error(`Floating layer "${t.id}" is missing floating configuration required for dragging.`);const n=e.position??e.defaultPosition??t.position;if(!n)throw new Error(`Floating layer "${t.id}" must define position with left and top values.`);return{left:ht(n.left,"left",t.id),top:ht(n.top,"top",t.id)}},me=t=>{const e=D(t);return e?e.constraints??{}:{}},pe=(t,e,n)=>t?t==="left"?e-n:e+n:e,be=(t,e,n)=>t?t==="top"?e-n:e+n:e,Se=(t,e,n)=>!t||t==="right"?e:e+n,ze=(t,e,n)=>!t||t==="bottom"?e:e+n,Z=(t,e)=>t?t.dataset.layerId===e?t:Z(t.parentElement,e):null,q=(t,e,n)=>!t||n?.(t)?null:e(t)?t:q(t.parentElement,e,n),we=t=>t instanceof HTMLElement?q(t,e=>e.dataset.dragHandle==="true",e=>e.dataset.dragIgnore==="true"):null,mt=t=>t instanceof HTMLElement?q(t,e=>e.dataset.resizeCorner!==void 0||e.dataset.resizeEdge!==void 0)!==null:!1,O=t=>{const e=D(t);return e?e.resizable===!0:!1},Y=t=>{if(!D(t))return null;const n=ve(t);if(!n)throw new Error(`Floating layer "${t.id}" must define width and height when resizable or draggable.`);return{width:n.width,height:n.height}},Ee=(t,e,n)=>{const r=t.filter(O).reduce((g,b)=>{if(n===b.id){const I=e[b.id];if(I)return g[b.id]=I,g}const E=Y(b);return E&&(g[b.id]=E),g},{}),o=Object.keys(e),s=Object.keys(r),a=o.length!==s.length,l=o.some(g=>!Object.prototype.hasOwnProperty.call(r,g)),u=a?!0:l,p=s.some(g=>{const b=e[g],E=r[g];return!b||!E?!0:b.width!==E.width||b.height!==E.height});return{sizes:r,changed:u?!0:p}},Re=({layers:t,layerById:e,isRootLevel:n})=>{const[r,o]=d.useState(null),[s,a]=d.useState(null),[l,u]=d.useState({}),[p,f]=d.useState({}),g=d.useRef(null),b=d.useRef(null),E=st.useEffectEvent((c,i)=>{e.get(c)?.floating?.onMove?.(i)}),I=st.useEffectEvent((c,i)=>{e.get(c)?.floating?.onResize?.(i)});pt.useIsomorphicLayoutEffect(()=>{const{sizes:c,changed:i}=Ee(t,p,s);i&&f(c)},[t,s]);const C=d.useCallback((c,i,h,m)=>{const z=ft(i),R=l[c]??{x:0,y:0},w={pointerStartX:m.clientX,pointerStartY:m.clientY,initialTranslationX:R.x,initialTranslationY:R.y,baseLeft:z.left,baseTop:z.top,layerId:c,pointerId:m.pointerId,target:h};if(w.target.setPointerCapture)try{w.target.setPointerCapture(w.pointerId)}catch{}g.current=w,o(c)},[l]),_=d.useCallback(c=>{const i=c.target,h=we(i);if(!h)return;const m=h.closest("[data-layer-id]")?.getAttribute("data-layer-id");if(!m)return;const z=e.get(m);if(!z)return;const R=D(z);if(!(!R||R.draggable!==!0)&&!dt(c.target)&&!mt(c.target)&&h){const w=Z(h,m);if(!w)return;C(m,z,w,c);return}},[C,e]),H=d.useCallback((c,i)=>{const h=e.get(c),m=h?D(h):null;if(!h||!m||m.draggable!==!0||dt(i.target)||mt(i.target))return;const z=Z(i.currentTarget,c);z&&C(c,h,z,i)},[C,e]),P=d.useCallback((c,i,h)=>{const m=e.get(c);if(!m||!O(m))return;const z=p[c]??Y(m);if(!z)return;const R=ft(m),w=me(m),x=l[c]??{x:0,y:0};if(h.stopPropagation(),h.preventDefault(),h.currentTarget.setPointerCapture)try{h.currentTarget.setPointerCapture(h.pointerId)}catch{}b.current={layerId:c,pointerId:h.pointerId,horizontalEdge:i.horizontal,verticalEdge:i.vertical,startX:h.clientX,startY:h.clientY,startWidth:z.width,startHeight:z.height,startPosition:x,baseLeft:R.left,baseTop:R.top,minWidth:w.minWidth,maxWidth:w.maxWidth,minHeight:w.minHeight,maxHeight:w.maxHeight,target:h.currentTarget},a(c)},[e,l,p]),N=d.useCallback(c=>{const i=g.current;if(!i)return;const h=c.clientX-i.pointerStartX,m=c.clientY-i.pointerStartY,z={x:i.initialTranslationX+h,y:i.initialTranslationY+m};u(R=>({...R,[i.layerId]:z})),E(i.layerId,{left:i.baseLeft+z.x,top:i.baseTop+z.y})},[E]),y=d.useCallback(c=>{const i=b.current;if(!i||i.pointerId!==c.pointerId||!e.get(i.layerId))return;const m=c.clientX-i.startX,z=c.clientY-i.startY,R=pe(i.horizontalEdge,i.startWidth,m),w=be(i.verticalEdge,i.startHeight,z),x=gt(R,i.minWidth,i.maxWidth),M=gt(w,i.minHeight,i.maxHeight),k=i.startWidth-x,F=i.startHeight-M,et=Se(i.horizontalEdge,i.startPosition.x,k),yt=ze(i.verticalEdge,i.startPosition.y,F),B=p[i.layerId],nt={width:x,height:M};(!B||B.width!==x||B.height!==M)&&(f(W=>({...W,[i.layerId]:nt})),I(i.layerId,nt));const rt=l[i.layerId]??{x:0,y:0},A={x:et,y:yt};(rt.x!==A.x||rt.y!==A.y)&&(u(W=>({...W,[i.layerId]:A})),E(i.layerId,{left:i.baseLeft+A.x,top:i.baseTop+A.y}))},[e,l,p,E,I]),T=d.useCallback(c=>{const i=g.current;if(i){if(i.pointerId===c.pointerId&&i.target.releasePointerCapture)try{i.target.releasePointerCapture(i.pointerId)}catch{}g.current=null}o(null)},[]),G=d.useCallback(c=>{const i=b.current;if(i){if(i.pointerId===c.pointerId&&i.target.releasePointerCapture)try{i.target.releasePointerCapture(i.pointerId)}catch{}b.current=null}a(null)},[]);ot.useDocumentPointerEvents(r!==null,{onMove:N,onUp:T,onCancel:T}),ot.useDocumentPointerEvents(s!==null,{onMove:y,onUp:G,onCancel:G});const U=d.useCallback(c=>{const i=he(c),h=D(c);if(!h||h.draggable!==!0)return i;const m=l[c.id],z=r===c.id,R=s===c.id,w=m?{transform:`translate(${m.x}px, ${m.y}px)`}:{},x=p[c.id],M=O(c)?Y(c):null,k=x??M,F=k?{width:`${k.width}px`,height:`${k.height}px`}:{};return{...i,...F,...w,...z||R?{cursor:"grabbing"}:{}}},[r,l,p,s]),J=d.useCallback(c=>{if(!O(c))return{isResizable:!1};const h=p[c.id],m=Y(c);return(h??m)!==null?{isResizable:!0,onPointerDown:(x,M)=>{P(c.id,x,M)}}:{isResizable:!1}},[P,p]),Q=d.useCallback(c=>{const{isResizable:i,onPointerDown:h}=J(c),m=U(c),z=s===c.id;return{style:m,isResizable:i,isResizing:z,onResizeHandlePointerDown:(R,w)=>{h&&h(R,w)}}},[U,J,s]),tt=d.useCallback(c=>({"data-drag-handle":"true",role:"button","aria-roledescription":"Drag handle","aria-label":"Drag layer",onPointerDown:i=>{H(c,i)}}),[H]);return{providerValue:d.useMemo(()=>({handleLayerPointerDown:_,getLayerRenderState:Q,getLayerHandleProps:tt,isRootLevel:n}),[tt,Q,_,n]),draggingLayerId:r,resizingLayerId:s}},ve=t=>{if(t.floating){const e=t.floating.size??t.floating.defaultSize;if(e)return{width:e.width,height:e.height}}if(typeof t.width=="number"&&typeof t.height=="number")return{width:t.width,height:t.height}},It={display:"grid",width:"100%",height:"100%",overflow:"hidden"},Ce={touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"},Ie={...It,overflow:"visible",height:"auto",minHeight:"100%"},ye=t=>t?Ie:It,Te=({config:t,layers:e,style:n,root:r=!1})=>{const o=d.useRef(null),{isIntersecting:s}=Dt(o,{threshold:0});return S.jsx(L.PanelSystemProvider,{config:t,layers:e,style:n,children:S.jsx(Le,{gridRef:o,isIntersecting:s,isRoot:r})})},Le=({gridRef:t,isIntersecting:e,isRoot:n})=>{const{config:r,style:o,layers:s}=L.usePanelSystem(),{normalizedLayers:a,visibleLayers:l,regularLayers:u,layerById:p}=vt(r,s.defs),{columnHandles:f,rowHandles:g,gapSizes:b,gridStyle:E,handleResize:I}=Ct(r,o,t),{providerValue:C,draggingLayerId:_,resizingLayerId:H}=Re({layers:a,layerById:p,isRootLevel:n}),P=_?!0:!!H,N=d.useMemo(()=>({...ye(n),...E,...P?Ce:{}}),[E,P,n]);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{ref:t,style:N,"data-dragging":!!_,"data-resizing":!!H,"data-visible":e,children:[S.jsx(L.GridLayoutProvider,{value:C,children:S.jsx(Rt,{layers:u})}),f.map(({trackIndex:y,align:T,span:G})=>S.jsx(K,{direction:"col",trackIndex:y,align:T,gap:b.columnGap,span:G,onResize:I},`col-${y}:${T}`)),g.map(({trackIndex:y,align:T,span:G})=>S.jsx(K,{direction:"row",trackIndex:y,align:T,gap:b.rowGap,span:G,onResize:I},`row-${y}:${T}`))]}),S.jsx(L.DrawerLayers,{layers:l})]})};exports.GridLayerList=Rt;exports.GridLayerResizeHandles=St;exports.GridLayout=Te;exports.GridTrackResizeHandle=K;exports.clampNumber=V;exports.toFiniteNumberOr=Kt;exports.useGridPlacements=vt;exports.useGridTracks=Ct;
2
- //# sourceMappingURL=GridLayout-B4VRsC0r.cjs.map
@@ -1,2 +0,0 @@
1
- "use strict";const R=require("react/jsx-runtime"),C=require("react"),I=require("./useDocumentPointerEvents-ChqrKXDk.cjs"),b=require("./useEffectEvent-huSsGUnl.cjs"),u=require("./styles-qf6ptVLD.cjs");function h(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const t=h(C),v=e=>{const n=t.useRef(null),r=t.useRef(null),s=t.useRef(0),[a,c]=t.useState(!1),l=b.useEffectEvent(o=>{e.onResize?.(o)}),i=t.useCallback(o=>e.axis==="x"?o.clientX:o.clientY,[e.axis]),p=t.useCallback(o=>{o.preventDefault(),n.current=o.currentTarget,r.current=o.pointerId,s.current=i(o),c(!0)},[i]),d=t.useCallback(o=>{const E=i(o),g=E-s.current;g!==0&&(s.current=E,l(g))},[i,l]),f=t.useCallback(()=>{c(!1),r.current=null},[]);return I.useDragPointerEvents(n,a,{onMove:d,onUp:f,pointerId:r.current??void 0,capturePointer:!0,preventDefaults:!1}),{ref:n,onPointerDown:p,isDragging:a}},m=({element:e,component:n})=>t.forwardRef(({children:r,...s},a)=>e?t.cloneElement(e,{...s,ref:a},r??e.props.children):n?R.jsx(n,{...s,ref:a,children:r}):R.jsx("div",{...s,ref:a,children:r}));function _({element:e,component:n}){return t.useMemo(()=>m({element:e,component:n}),[n,e])}const z={position:"absolute",zIndex:u.RESIZE_HANDLE_Z_INDEX},H={vertical:{width:u.RESIZE_HANDLE_THICKNESS,height:"100%",top:0,cursor:"col-resize"},horizontal:{width:"100%",height:u.RESIZE_HANDLE_THICKNESS,left:0,cursor:"row-resize"}},P={idle:u.COLOR_RESIZE_HANDLE_IDLE,hovered:u.COLOR_RESIZE_HANDLE_HOVER,dragging:u.COLOR_RESIZE_HANDLE_ACTIVE},L=({direction:e,onResize:n,component:r,element:s,children:a})=>{const c=e==="vertical"?"x":"y",{ref:l,isDragging:i,onPointerDown:p}=v({axis:c,onResize:n}),[d,f]=t.useState(!1),o=t.useCallback(()=>{f(!0)},[]),E=t.useCallback(()=>{f(!1)},[]),g=_({element:s,component:r}),D=t.useMemo(()=>i?"dragging":d?"hovered":"idle",[i,d]),S=t.useMemo(()=>({...z,...H[e],backgroundColor:P[D],touchAction:"none"}),[e,D]);return R.jsx(g,{ref:l,style:S,role:"separator","aria-orientation":e,"aria-hidden":void 0,"data-resize-handle":"true","data-direction":e,"data-is-dragging":i?"true":void 0,onPointerDown:p,onPointerEnter:o,onPointerLeave:E,children:a})};exports.ResizeHandle=L;exports.useElementComponentWrapper=_;exports.useResizeDrag=v;
2
- //# sourceMappingURL=ResizeHandle-CScipO5l.cjs.map
@@ -1,407 +0,0 @@
1
- import { jsx as R, Fragment as H, jsxs as L } from "react/jsx-runtime";
2
- import * as e from "react";
3
- import { P as J, r as X } from "./styles-DPPuJ0sf.js";
4
- import { u as K } from "./useContentCache-CO3LYNmz.js";
5
- const Q = 1e3;
6
- function Z({
7
- isVisible: s,
8
- leaveAnimation: o,
9
- skipAnimation: r = !1,
10
- animationTimeout: h = Q
11
- }) {
12
- const u = e.useRef(s), [n, a] = e.useState(!1), l = e.useRef(null);
13
- e.useEffect(() => () => {
14
- l.current && clearTimeout(l.current);
15
- }, []), e.useEffect(() => {
16
- const i = u.current;
17
- u.current = s, l.current && (clearTimeout(l.current), l.current = null), i && !s ? r || !o || o === "none" ? a(!1) : (a(!0), l.current = setTimeout(() => {
18
- a(!1);
19
- }, h)) : !i && s && a(!1);
20
- }, [s, o, r, h]);
21
- const b = e.useCallback(
22
- (i) => {
23
- i.target === i.currentTarget && n && (l.current && (clearTimeout(l.current), l.current = null), a(!1));
24
- },
25
- [n]
26
- ), y = s || n;
27
- return {
28
- state: {
29
- shouldDisplay: y,
30
- isAnimatingOut: n
31
- },
32
- props: {
33
- onAnimationEnd: b
34
- },
35
- style: {
36
- display: y ? "block" : "none"
37
- }
38
- };
39
- }
40
- const W = {
41
- position: "absolute",
42
- inset: 0,
43
- width: "100%",
44
- height: "100%"
45
- }, tt = e.memo(({ id: s, isActive: o, transitionMode: r, children: h }) => {
46
- const u = Z({
47
- isVisible: o,
48
- leaveAnimation: r === "css" ? X : void 0,
49
- skipAnimation: r !== "css"
50
- }), n = e.useMemo(() => {
51
- const l = {
52
- ...W,
53
- ...u.style,
54
- pointerEvents: o ? "auto" : "none"
55
- };
56
- return r === "css" && (l.animation = o ? J : X), l;
57
- }, [o, r, u.style]), a = /* @__PURE__ */ R(
58
- "div",
59
- {
60
- "data-pivot-content": s,
61
- "data-active": o ? "true" : "false",
62
- style: n,
63
- ...u.props,
64
- children: h
65
- }
66
- );
67
- return r === "none" ? /* @__PURE__ */ R(e.Activity, { mode: o ? "visible" : "hidden", children: a }) : a;
68
- }), B = e.createContext(null), et = e.memo(() => {
69
- const s = e.useContext(B);
70
- if (!s)
71
- throw new Error("PivotOutlet must be used within usePivot");
72
- const [, o] = e.useReducer((n) => n + 1, 0);
73
- e.useEffect(() => s.subscribe(o), [s]);
74
- const { items: r, activeId: h, transitionMode: u } = s.getState();
75
- return /* @__PURE__ */ R(H, { children: r.map((n) => /* @__PURE__ */ R(tt, { id: n.id, isActive: n.id === h, transitionMode: u, children: n.cache ? s.getCachedContent(n.id) : n.content }, n.id)) });
76
- });
77
- function ut(s) {
78
- const { items: o, activeId: r, defaultActiveId: h, onActiveChange: u, transitionMode: n = "css", navigationMode: a = "linear" } = s, l = r !== void 0, [b, y] = e.useState(() => {
79
- if (h !== void 0)
80
- return h;
81
- const t = o.find((c) => c.disabled !== !0);
82
- if (!t)
83
- throw new Error("usePivot: No enabled items provided");
84
- return t.id;
85
- }), i = l ? r : b, [v, S] = e.useState(!1), O = e.useCallback(
86
- (t, c) => {
87
- const p = o.find((M) => M.id === t);
88
- if (!p || p.disabled)
89
- return;
90
- const g = c?.animated ?? n === "css";
91
- S(g), l || y(t), u?.(t);
92
- },
93
- [o, l, u, n]
94
- ), w = e.useCallback(() => {
95
- S(!1);
96
- }, []), x = e.useCallback((t) => t === i, [i]), I = e.useMemo(
97
- () => o.filter((t) => t.disabled !== !0),
98
- [o]
99
- ), f = e.useMemo(() => {
100
- const t = I.findIndex((c) => c.id === i);
101
- return t === -1 ? 0 : t;
102
- }, [I, i]), d = I.length, k = e.useCallback(
103
- (t) => {
104
- if (t === 0)
105
- return !1;
106
- if (a === "loop")
107
- return d >= 2;
108
- const c = f + t;
109
- return c >= 0 && c < d;
110
- },
111
- [f, d, a]
112
- ), _ = e.useCallback(
113
- (t) => {
114
- const c = f + t;
115
- return a === "loop" ? (c % d + d) % d : c;
116
- },
117
- [f, a, d]
118
- ), C = e.useCallback(
119
- (t, c) => {
120
- if (!k(t))
121
- return;
122
- const p = _(t), g = I[p];
123
- g && O(g.id, c);
124
- },
125
- [k, _, I, O]
126
- ), D = e.useCallback(
127
- (t) => {
128
- const c = I.findIndex((g) => g.id === t);
129
- if (c === -1)
130
- return null;
131
- if (a === "linear") {
132
- const g = c - f;
133
- return Math.abs(g) > 1 ? null : g;
134
- }
135
- const p = ((c - f) % d + d) % d;
136
- return p === 0 ? 0 : p === 1 ? 1 : d - p === 1 ? -1 : null;
137
- },
138
- [I, f, a, d]
139
- ), F = e.useCallback(
140
- (t) => {
141
- const c = I.findIndex((M) => M.id === t);
142
- if (c === -1)
143
- return null;
144
- if (a === "linear")
145
- return c - f;
146
- const p = ((c - f) % d + d) % d, g = d - p;
147
- return p <= g ? p : -g;
148
- },
149
- [I, f, a, d]
150
- ), q = e.useCallback(
151
- (t) => ({
152
- "data-pivot-item": t,
153
- "data-active": t === i ? "true" : "false",
154
- "aria-selected": t === i,
155
- tabIndex: t === i ? 0 : -1,
156
- onClick: () => {
157
- O(t);
158
- }
159
- }),
160
- [i, O]
161
- ), U = e.useMemo(
162
- () => ({
163
- position: "relative",
164
- width: "100%",
165
- height: "100%"
166
- }),
167
- []
168
- ), T = e.useRef({
169
- items: o,
170
- activeId: i,
171
- transitionMode: n
172
- });
173
- T.current = {
174
- items: o,
175
- activeId: i,
176
- transitionMode: n
177
- };
178
- const N = e.useRef(/* @__PURE__ */ new Set());
179
- e.useEffect(() => {
180
- N.current.forEach((t) => t());
181
- }, [i, n]);
182
- const z = e.useCallback(
183
- (t) => T.current.items.find((p) => p.id === t)?.content ?? null,
184
- []
185
- ), m = e.useMemo(() => o.map((t) => t.id), [o]), { getCachedContent: A } = K({
186
- resolveContent: z,
187
- validIds: m
188
- }), P = e.useMemo(
189
- () => ({
190
- getState: () => T.current,
191
- subscribe: (t) => (N.current.add(t), () => N.current.delete(t)),
192
- getCachedContent: A
193
- }),
194
- [A]
195
- ), E = e.useMemo(() => {
196
- const t = () => /* @__PURE__ */ R(B.Provider, { value: P, children: /* @__PURE__ */ R("div", { style: U, "data-pivot-container": !0, children: /* @__PURE__ */ R(et, {}) }) });
197
- return t.displayName = "PivotOutlet", t;
198
- }, [P, U]);
199
- return { activeId: i, setActiveId: O, isActive: x, getItemProps: q, Outlet: E, go: C, canGo: k, activeIndex: f, itemCount: d, isAnimating: v, endAnimation: w, navigationMode: a, getVirtualPosition: D, getItemPosition: F };
200
- }
201
- const nt = 300, rt = (s, o) => s.phase === "idle" ? 0 : o === "horizontal" ? s.displacement.x : s.displacement.y, G = (s, o) => (s % o + o) % o, st = (s, o, r, h) => {
202
- const u = o + s;
203
- return h === "linear" ? u < 0 || u >= r ? null : u : G(u, r);
204
- }, ot = e.memo(({
205
- slotPosition: s,
206
- item: o,
207
- itemIndex: r,
208
- isActive: h,
209
- centerX: u,
210
- tabWidth: n,
211
- viewportWidth: a,
212
- offsetPx: l,
213
- axis: b,
214
- renderTab: y
215
- }) => {
216
- const i = s * n, v = u + i + l, S = v + n > 0 && v < a, O = b === "horizontal" ? "translateX" : "translateY";
217
- return /* @__PURE__ */ R(
218
- "div",
219
- {
220
- "data-pivot-tab": o.id,
221
- "data-slot": s,
222
- "data-active": h ? "true" : "false",
223
- style: {
224
- position: "absolute",
225
- left: u,
226
- top: 0,
227
- width: n,
228
- height: "100%",
229
- visibility: S ? "visible" : "hidden",
230
- willChange: "transform",
231
- transform: `${O}(${i + l}px)`
232
- },
233
- children: y(o, h, r)
234
- }
235
- );
236
- }), $ = (s) => s === 1 ? 1 : 1 - Math.pow(2, -10 * s);
237
- function lt({
238
- items: s,
239
- activeId: o,
240
- activeIndex: r,
241
- itemCount: h,
242
- inputState: u,
243
- tabWidth: n,
244
- viewportWidth: a,
245
- navigationMode: l = "linear",
246
- axis: b = "horizontal",
247
- renderTab: y,
248
- animationDuration: i = nt,
249
- fixedTabs: v = !1,
250
- renderIndicator: S
251
- }) {
252
- const O = rt(u, b), w = u.phase === "swiping" || u.phase === "tracking", [x, I] = e.useState(0), f = e.useRef(null), [d, k] = e.useState(r * n), _ = e.useRef(r * n), C = e.useRef(null), D = e.useRef(null);
253
- e.useEffect(() => {
254
- _.current = d;
255
- }, [d]);
256
- const F = e.useRef(r), q = Math.ceil(a / n / 2) + 1, U = (a - n) / 2;
257
- e.useEffect(() => {
258
- if (!v || !w) return;
259
- const m = r * n - O;
260
- D.current = m, k(m);
261
- }, [v, w, r, n, O]), e.useEffect(() => {
262
- if (!v || w) return;
263
- const m = r * n, A = D.current ?? _.current;
264
- if (D.current = null, Math.abs(A - m) < 1) {
265
- k(m);
266
- return;
267
- }
268
- C.current && cancelAnimationFrame(C.current.rafId);
269
- const P = performance.now(), E = A, t = (c) => {
270
- const p = c - P, g = Math.min(p / i, 1), M = $(g), V = E + (m - E) * M;
271
- k(V), g < 1 ? C.current = {
272
- rafId: requestAnimationFrame(t)
273
- } : (C.current = null, k(m));
274
- };
275
- C.current = {
276
- rafId: requestAnimationFrame(t)
277
- };
278
- }, [v, w, r, n, i]), e.useEffect(() => {
279
- if (v || F.current === r)
280
- return;
281
- const m = F.current;
282
- F.current = r;
283
- let A;
284
- if (l === "loop") {
285
- const p = G(r - m, h), g = h - p;
286
- A = p <= g ? p : -g;
287
- } else
288
- A = r - m;
289
- const P = -A * n, E = w ? O : x;
290
- if (f.current && cancelAnimationFrame(f.current.rafId), Math.abs(E - P) < 1) {
291
- I(0);
292
- return;
293
- }
294
- const t = performance.now(), c = (p) => {
295
- const g = p - t, M = Math.min(g / i, 1), V = $(M), j = E - P, Y = j * (1 - V);
296
- I(Y), M < 1 ? f.current = {
297
- startTime: t,
298
- startOffset: j,
299
- targetOffset: 0,
300
- rafId: requestAnimationFrame(c)
301
- } : (f.current = null, I(0));
302
- };
303
- f.current = {
304
- startTime: t,
305
- startOffset: E - P,
306
- targetOffset: 0,
307
- rafId: requestAnimationFrame(c)
308
- };
309
- }, [v, r, h, n, i, l, O, w, x]), e.useEffect(() => {
310
- v && (F.current = r);
311
- }, [v, r]), e.useEffect(() => () => {
312
- f.current && cancelAnimationFrame(f.current.rafId), C.current && cancelAnimationFrame(C.current.rafId);
313
- }, []);
314
- const T = w ? O : x, N = f.current !== null || C.current !== null;
315
- if (e.useEffect(() => {
316
- w && f.current && (cancelAnimationFrame(f.current.rafId), f.current = null, I(0));
317
- }, [w]), v) {
318
- const m = s.length * n, A = (a - m) / 2;
319
- return /* @__PURE__ */ L(
320
- "div",
321
- {
322
- style: {
323
- position: "relative",
324
- width: "100%",
325
- height: "100%",
326
- overflow: "hidden",
327
- display: "flex",
328
- justifyContent: "center"
329
- },
330
- children: [
331
- S?.({
332
- offsetPx: d,
333
- tabWidth: n,
334
- centerX: A,
335
- isSwiping: w,
336
- isAnimating: N
337
- }),
338
- s.map((P, E) => /* @__PURE__ */ R(
339
- "div",
340
- {
341
- "data-pivot-tab": P.id,
342
- "data-active": E === r ? "true" : "false",
343
- style: {
344
- position: "relative",
345
- width: n,
346
- height: "100%",
347
- flexShrink: 0
348
- },
349
- children: y(P, E === r, E)
350
- },
351
- P.id
352
- ))
353
- ]
354
- }
355
- );
356
- }
357
- const z = [];
358
- for (let m = -q; m <= q; m++) {
359
- const A = st(m, r, h, l);
360
- A !== null && z.push({
361
- slotPosition: m,
362
- itemIndex: A,
363
- item: s[A]
364
- });
365
- }
366
- return /* @__PURE__ */ L(
367
- "div",
368
- {
369
- style: {
370
- position: "relative",
371
- width: "100%",
372
- height: "100%",
373
- overflow: "hidden"
374
- },
375
- children: [
376
- S?.({
377
- offsetPx: T,
378
- tabWidth: n,
379
- centerX: U,
380
- isSwiping: w,
381
- isAnimating: N
382
- }),
383
- z.map(({ slotPosition: m, itemIndex: A, item: P }) => /* @__PURE__ */ R(
384
- ot,
385
- {
386
- slotPosition: m,
387
- item: P,
388
- itemIndex: A,
389
- isActive: A === r,
390
- centerX: U,
391
- tabWidth: n,
392
- viewportWidth: a,
393
- offsetPx: T,
394
- axis: b,
395
- renderTab: y
396
- },
397
- m
398
- ))
399
- ]
400
- }
401
- );
402
- }
403
- export {
404
- lt as S,
405
- ut as u
406
- };
407
- //# sourceMappingURL=SwipePivotTabBar-BGO9X94m.js.map