react-panel-layout 0.6.1 → 0.7.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 (115) hide show
  1. package/dist/FloatingWindow-Bw2djgpz.js +1542 -0
  2. package/dist/FloatingWindow-Bw2djgpz.js.map +1 -0
  3. package/dist/FloatingWindow-Cvyokf0m.cjs +2 -0
  4. package/dist/FloatingWindow-Cvyokf0m.cjs.map +1 -0
  5. package/dist/GridLayout-B4aCqSyd.js +947 -0
  6. package/dist/{GridLayout-UWNxXw77.js.map → GridLayout-B4aCqSyd.js.map} +1 -1
  7. package/dist/GridLayout-DNOClFzz.cjs +2 -0
  8. package/dist/{GridLayout-DKTg_N61.cjs.map → GridLayout-DNOClFzz.cjs.map} +1 -1
  9. package/dist/PanelSystem-B8Igvnb2.cjs +3 -0
  10. package/dist/PanelSystem-B8Igvnb2.cjs.map +1 -0
  11. package/dist/{PanelSystem-BqUzNtf2.js → PanelSystem-DDUSFjXD.js} +208 -247
  12. package/dist/PanelSystem-DDUSFjXD.js.map +1 -0
  13. package/dist/components/window/Drawer.d.ts +1 -0
  14. package/dist/components/window/DrawerRevealContext.d.ts +61 -0
  15. package/dist/components/window/drawerRevealAnimationUtils.d.ts +212 -0
  16. package/dist/components/window/drawerStyles.d.ts +5 -0
  17. package/dist/components/window/useDrawerSwipeTransform.d.ts +8 -2
  18. package/dist/components/window/useDrawerTransform.d.ts +68 -0
  19. package/dist/components/window/useRevealDrawerTransform.d.ts +56 -0
  20. package/dist/config.cjs +1 -1
  21. package/dist/config.cjs.map +1 -1
  22. package/dist/config.js +8 -7
  23. package/dist/config.js.map +1 -1
  24. package/dist/grid.cjs +1 -1
  25. package/dist/grid.js +2 -2
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.js +4 -4
  28. package/dist/modules/drawer/drawerStateMachine.d.ts +168 -0
  29. package/dist/modules/drawer/revealDrawerConstants.d.ts +33 -0
  30. package/dist/modules/drawer/revealDrawerStateMachine.d.ts +146 -0
  31. package/dist/modules/drawer/strategies/index.d.ts +8 -0
  32. package/dist/modules/drawer/strategies/overlayStrategy.d.ts +12 -0
  33. package/dist/modules/drawer/strategies/revealStrategy.d.ts +12 -0
  34. package/dist/modules/drawer/strategies/types.d.ts +116 -0
  35. package/dist/panels.cjs +1 -1
  36. package/dist/panels.js +1 -1
  37. package/dist/stack.cjs +1 -1
  38. package/dist/stack.cjs.map +1 -1
  39. package/dist/stack.js +306 -347
  40. package/dist/stack.js.map +1 -1
  41. package/dist/types.d.ts +14 -0
  42. package/dist/useAnimationFrame-BZ6D2lMq.cjs +2 -0
  43. package/dist/useAnimationFrame-BZ6D2lMq.cjs.map +1 -0
  44. package/dist/useAnimationFrame-Bg4e-H8O.js +394 -0
  45. package/dist/useAnimationFrame-Bg4e-H8O.js.map +1 -0
  46. package/dist/window.cjs +1 -1
  47. package/dist/window.js +1 -1
  48. package/package.json +1 -1
  49. package/src/components/gesture/SwipeSafeZone.tsx +1 -0
  50. package/src/components/grid/GridLayout.tsx +110 -38
  51. package/src/components/window/Drawer.tsx +114 -10
  52. package/src/components/window/DrawerLayers.tsx +48 -15
  53. package/src/components/window/DrawerRevealContext.spec.ts +20 -0
  54. package/src/components/window/DrawerRevealContext.tsx +99 -0
  55. package/src/components/window/drawerRevealAnimationUtils.spec.ts +375 -0
  56. package/src/components/window/drawerRevealAnimationUtils.ts +415 -0
  57. package/src/components/window/drawerStyles.spec.ts +39 -0
  58. package/src/components/window/drawerStyles.ts +24 -0
  59. package/src/components/window/useDrawerSwipeTransform.ts +28 -90
  60. package/src/components/window/useDrawerTransform.ts +505 -0
  61. package/src/components/window/useRevealDrawerTransform.spec.ts +1936 -0
  62. package/src/components/window/useRevealDrawerTransform.ts +105 -0
  63. package/src/demo/components/FullscreenDemoPage.tsx +47 -0
  64. package/src/demo/fullscreenRoutes.tsx +32 -0
  65. package/src/demo/index.tsx +5 -0
  66. package/src/demo/pages/Dialog/components/CardExpandDemo.tsx +23 -8
  67. package/src/demo/pages/Drawer/components/DrawerBasics.module.css +6 -1
  68. package/src/demo/pages/Drawer/components/DrawerBasics.tsx +14 -4
  69. package/src/demo/pages/Drawer/components/DrawerReveal.module.css +157 -0
  70. package/src/demo/pages/Drawer/components/DrawerReveal.tsx +128 -0
  71. package/src/demo/pages/Drawer/reveal/index.tsx +17 -0
  72. package/src/demo/pages/Drawer/reveal-fullscreen/index.tsx +135 -0
  73. package/src/demo/pages/Drawer/reveal-fullscreen/styles.module.css +233 -0
  74. package/src/demo/pages/Stack/components/StackBasics.spec.tsx +56 -52
  75. package/src/demo/pages/Stack/components/StackTablet.spec.tsx +39 -49
  76. package/src/demo/routes.tsx +2 -0
  77. package/src/hooks/gesture/testing/createGestureSimulator.ts +1 -0
  78. package/src/hooks/gesture/useNativeGestureGuard.spec.ts +10 -2
  79. package/src/hooks/gesture/utils.ts +15 -4
  80. package/src/hooks/useAnimatedVisibility.spec.ts +3 -3
  81. package/src/hooks/useOperationContinuity.spec.ts +17 -10
  82. package/src/hooks/useOperationContinuity.ts +5 -5
  83. package/src/hooks/useSharedElementTransition.ts +28 -7
  84. package/src/modules/dialog/dialogAnimationUtils.spec.ts +0 -1
  85. package/src/modules/dialog/useDialogContainer.spec.ts +11 -3
  86. package/src/modules/dialog/useDialogSwipeInput.spec.ts +49 -28
  87. package/src/modules/dialog/useDialogSwipeInput.ts +37 -6
  88. package/src/modules/dialog/useDialogTransform.spec.ts +63 -30
  89. package/src/modules/drawer/drawerStateMachine.ts +500 -0
  90. package/src/modules/drawer/revealDrawerConstants.ts +38 -0
  91. package/src/modules/drawer/revealDrawerStateMachine.spec.ts +558 -0
  92. package/src/modules/drawer/revealDrawerStateMachine.ts +197 -0
  93. package/src/modules/drawer/strategies/index.ts +9 -0
  94. package/src/modules/drawer/strategies/overlayStrategy.ts +133 -0
  95. package/src/modules/drawer/strategies/revealStrategy.ts +111 -0
  96. package/src/modules/drawer/strategies/types.ts +160 -0
  97. package/src/modules/drawer/useDrawerSwipeInput.ts +7 -4
  98. package/src/modules/pivot/SwipePivotContent.spec.tsx +48 -37
  99. package/src/modules/pivot/usePivotSwipeInput.spec.ts +8 -8
  100. package/src/modules/stack/swipeTransitionContinuity.spec.tsx +1 -1
  101. package/src/types.ts +15 -0
  102. package/dist/FloatingWindow-CUXnEtrb.js +0 -827
  103. package/dist/FloatingWindow-CUXnEtrb.js.map +0 -1
  104. package/dist/FloatingWindow-DMwyK0eK.cjs +0 -2
  105. package/dist/FloatingWindow-DMwyK0eK.cjs.map +0 -1
  106. package/dist/GridLayout-DKTg_N61.cjs +0 -2
  107. package/dist/GridLayout-UWNxXw77.js +0 -926
  108. package/dist/PanelSystem-BqUzNtf2.js.map +0 -1
  109. package/dist/PanelSystem-D603LKKv.cjs +0 -3
  110. package/dist/PanelSystem-D603LKKv.cjs.map +0 -1
  111. package/dist/useNativeGestureGuard-C7TSqEkr.cjs +0 -2
  112. package/dist/useNativeGestureGuard-C7TSqEkr.cjs.map +0 -1
  113. package/dist/useNativeGestureGuard-CGYo6O0r.js +0 -347
  114. package/dist/useNativeGestureGuard-CGYo6O0r.js.map +0 -1
  115. package/src/components/window/useDrawerSwipeTransform.spec.ts +0 -234
@@ -0,0 +1,212 @@
1
+ /**
2
+ * @file Drawer reveal animation utilities
3
+ *
4
+ * Provides transform calculations for reveal-mode drawer animations.
5
+ * The reveal mode creates a "pull out" effect where:
6
+ * - Drawer slides from partially hidden (-30%) to fully visible (0%)
7
+ * - Content slides away to reveal the drawer behind it
8
+ */
9
+ import type * as React from "react";
10
+ import type { DrawerPlacement } from "./drawerStyles.js";
11
+ /**
12
+ * Percentage offset for drawer when closed (creates "pull out" effect).
13
+ */
14
+ export declare const DRAWER_CLOSED_OFFSET_PERCENT = 30;
15
+ /**
16
+ * Default animation duration in milliseconds.
17
+ */
18
+ export declare const DEFAULT_ANIMATION_DURATION = 300;
19
+ /**
20
+ * Placement configuration for transforms.
21
+ */
22
+ export type PlacementConfig = {
23
+ axis: "X" | "Y";
24
+ sign: 1 | -1;
25
+ };
26
+ /**
27
+ * Get placement configuration for a drawer placement.
28
+ */
29
+ export declare function getPlacementConfig(placement: DrawerPlacement): PlacementConfig;
30
+ /**
31
+ * Transform values for reveal drawer animation.
32
+ */
33
+ export type RevealDrawerTransform = {
34
+ /** Drawer offset in percentage */
35
+ drawerOffsetPercent: number;
36
+ /** Content offset in pixels */
37
+ contentOffsetPx: number;
38
+ };
39
+ /**
40
+ * Compute progress from swipe displacement.
41
+ * Returns 0 (closed) to 1 (open).
42
+ *
43
+ * @param displacement - Current swipe displacement in pixels
44
+ * @param drawerSize - Size of the drawer in pixels
45
+ * @param isOpening - Whether the gesture is opening the drawer
46
+ * @param isClosing - Whether the gesture is closing the drawer
47
+ * @returns Progress value between 0 and 1
48
+ */
49
+ export declare function computeSwipeProgress(displacement: number, drawerSize: number, isOpening: boolean, isClosing: boolean): number;
50
+ /**
51
+ * Compute reveal drawer transforms from progress.
52
+ *
53
+ * @param progress - Animation progress (0 = closed, 1 = open)
54
+ * @param drawerSize - Size of the drawer in pixels
55
+ * @param placement - Drawer placement
56
+ * @returns Transform values for drawer and content
57
+ */
58
+ export declare function computeRevealTransform(progress: number, drawerSize: number, placement: DrawerPlacement): RevealDrawerTransform;
59
+ /**
60
+ * Build drawer transform string from progress.
61
+ *
62
+ * @param progress - Animation progress (0 = closed, 1 = open)
63
+ * @param placement - Drawer placement
64
+ * @returns CSS transform string
65
+ */
66
+ export declare function buildDrawerTransformString(progress: number, placement: DrawerPlacement): string;
67
+ /**
68
+ * Build content transform string from progress.
69
+ *
70
+ * @param progress - Animation progress (0 = closed, 1 = open)
71
+ * @param drawerSize - Size of the drawer in pixels
72
+ * @param placement - Drawer placement
73
+ * @returns CSS transform string
74
+ */
75
+ export declare function buildContentTransformString(progress: number, drawerSize: number, placement: DrawerPlacement): string;
76
+ /**
77
+ * Stacking context styles for content element.
78
+ * Applied during reveal animation to ensure proper z-index layering.
79
+ */
80
+ export type StackingContextStyles = {
81
+ position: string;
82
+ zIndex: string;
83
+ background: string;
84
+ };
85
+ /**
86
+ * Default stacking context styles.
87
+ */
88
+ export declare const STACKING_CONTEXT_STYLES: StackingContextStyles;
89
+ /**
90
+ * Apply stacking context styles to an element.
91
+ */
92
+ export declare function applyStackingContext(element: HTMLElement): void;
93
+ /**
94
+ * Clear stacking context styles from an element.
95
+ */
96
+ export declare function clearStackingContext(element: HTMLElement): void;
97
+ /**
98
+ * Apply overflow hidden to body to prevent scrolling during drawer open.
99
+ * This prevents both horizontal and vertical scrolling of the body
100
+ * while the drawer is open or animating.
101
+ */
102
+ export declare function applyOverflowHidden(): void;
103
+ /**
104
+ * Clear overflow hidden from body.
105
+ */
106
+ export declare function clearOverflowHidden(): void;
107
+ /**
108
+ * Get the content element to transform.
109
+ *
110
+ * @param inline - Whether drawer is inline mode
111
+ * @param gridRef - Grid container ref for inline mode
112
+ * @returns The content element or null
113
+ */
114
+ export declare function getContentElement(inline: boolean, gridRef?: React.RefObject<HTMLElement | null>): HTMLElement | null;
115
+ /**
116
+ * Tracked position for drawer and content elements in pixels.
117
+ */
118
+ export type RevealPositionPx = {
119
+ /** Drawer offset in pixels */
120
+ drawerPx: number;
121
+ /** Content offset in pixels */
122
+ contentPx: number;
123
+ };
124
+ /**
125
+ * Compute drawer offset in pixels from progress.
126
+ *
127
+ * For reveal mode, the drawer animates from an offset position to 0.
128
+ * The offset is DRAWER_CLOSED_OFFSET_PERCENT of the drawer's own size.
129
+ *
130
+ * @param progress - Animation progress (0 = closed, 1 = open)
131
+ * @param drawerSize - Drawer size in pixels
132
+ * @param placement - Drawer placement
133
+ * @returns Drawer offset in pixels
134
+ */
135
+ export declare function computeDrawerOffsetPx(progress: number, drawerSize: number, placement: DrawerPlacement): number;
136
+ /**
137
+ * Compute content offset in pixels from progress.
138
+ *
139
+ * Content moves from 0 (closed) to ±drawerSize (open).
140
+ *
141
+ * @param progress - Animation progress (0 = closed, 1 = open)
142
+ * @param drawerSize - Drawer size in pixels
143
+ * @param placement - Drawer placement
144
+ * @returns Content offset in pixels
145
+ */
146
+ export declare function computeContentOffsetPx(progress: number, drawerSize: number, placement: DrawerPlacement): number;
147
+ /**
148
+ * Compute both drawer and content offsets from progress.
149
+ *
150
+ * @param progress - Animation progress (0 = closed, 1 = open)
151
+ * @param drawerSize - Drawer size in pixels
152
+ * @param placement - Drawer placement
153
+ * @returns Position in pixels for both elements
154
+ */
155
+ export declare function computePositionFromProgress(progress: number, drawerSize: number, placement: DrawerPlacement): RevealPositionPx;
156
+ /**
157
+ * Compute target positions for open or closed state.
158
+ *
159
+ * @param isOpen - Whether target is the open state
160
+ * @param drawerSize - Drawer size in pixels
161
+ * @param placement - Drawer placement
162
+ * @returns Target positions in pixels
163
+ */
164
+ export declare function computeTargetPosition(isOpen: boolean, drawerSize: number, placement: DrawerPlacement): RevealPositionPx;
165
+ /**
166
+ * Compute position from swipe displacement.
167
+ *
168
+ * This is the main function for tracking position during swipe.
169
+ *
170
+ * @param displacement - Current swipe displacement in pixels
171
+ * @param drawerSize - Drawer size in pixels
172
+ * @param placement - Drawer placement
173
+ * @param isOpening - Whether opening via swipe
174
+ * @param isClosing - Whether closing via swipe
175
+ * @returns Current position in pixels
176
+ */
177
+ export declare function computePositionFromDisplacement(displacement: number, drawerSize: number, placement: DrawerPlacement, isOpening: boolean, isClosing: boolean): RevealPositionPx;
178
+ /**
179
+ * Build drawer transform string from pixel offset.
180
+ *
181
+ * @param drawerPx - Drawer offset in pixels
182
+ * @param placement - Drawer placement
183
+ * @returns CSS transform string
184
+ */
185
+ export declare function buildDrawerTransformPx(drawerPx: number, placement: DrawerPlacement): string;
186
+ /**
187
+ * Build content transform string from pixel offset.
188
+ *
189
+ * @param contentPx - Content offset in pixels
190
+ * @param placement - Drawer placement
191
+ * @returns CSS transform string
192
+ */
193
+ export declare function buildContentTransformPx(contentPx: number, placement: DrawerPlacement): string;
194
+ /**
195
+ * Show the drawer element.
196
+ */
197
+ export declare function showDrawer(element: HTMLElement): void;
198
+ /**
199
+ * Hide the drawer element.
200
+ */
201
+ export declare function hideDrawer(element: HTMLElement): void;
202
+ /**
203
+ * Clear drawer visibility styles.
204
+ */
205
+ export declare function clearDrawerVisibility(element: HTMLElement): void;
206
+ /**
207
+ * Apply stacking context styles with configurable background.
208
+ *
209
+ * @param element - Content element
210
+ * @param background - Background color (defaults to #fff)
211
+ */
212
+ export declare function applyStackingContextWithBackground(element: HTMLElement, background?: string): void;
@@ -29,6 +29,11 @@ export declare function getOpenTransform(placement: DrawerPlacement): string;
29
29
  * Get closed transform value.
30
30
  */
31
31
  export declare function getClosedTransform(placement: DrawerPlacement): string;
32
+ /**
33
+ * Get reveal mode transform based on open state.
34
+ * When closed, drawer is partially hidden. When open, fully visible.
35
+ */
36
+ export declare function getRevealTransform(placement: DrawerPlacement, isOpen: boolean): string;
32
37
  /**
33
38
  * Compute CSS transition value.
34
39
  */
@@ -1,7 +1,10 @@
1
1
  /**
2
- * @file Hook for applying real-time transform during drawer swipe gestures.
2
+ * @file Hook for applying real-time transform during drawer swipe gestures (backward-compatible wrapper).
3
3
  *
4
- * Handles DOM manipulation for smooth swipe animations.
4
+ * This hook is a thin wrapper around useDrawerTransform with mode="overlay".
5
+ * For new code, prefer using useDrawerTransform directly.
6
+ *
7
+ * @deprecated Use useDrawerTransform with mode="overlay" instead.
5
8
  */
6
9
  import * as React from "react";
7
10
  import type { ContinuousOperationState } from "../../hooks/gesture/types.js";
@@ -14,10 +17,13 @@ type UseDrawerSwipeTransformOptions = {
14
17
  displacement: number;
15
18
  isOpening: boolean;
16
19
  isClosing: boolean;
20
+ isOpen: boolean;
17
21
  enabled: boolean;
18
22
  };
19
23
  /**
20
24
  * Apply real-time transform to drawer and backdrop during swipe.
25
+ *
26
+ * @deprecated Use useDrawerTransform with mode="overlay" instead.
21
27
  */
22
28
  export declare function useDrawerSwipeTransform(options: UseDrawerSwipeTransformOptions): void;
23
29
  export {};
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @file Unified hook for drawer transform animations.
3
+ *
4
+ * This hook provides a single interface for both reveal and overlay drawer modes.
5
+ * It uses a strategy pattern internally to handle mode-specific position calculations
6
+ * and DOM operations while sharing the common state machine logic.
7
+ */
8
+ import * as React from "react";
9
+ import type { ContinuousOperationState } from "../../hooks/gesture/types.js";
10
+ import type { DrawerPlacement } from "./drawerStyles.js";
11
+ /**
12
+ * Drawer animation mode.
13
+ */
14
+ export type DrawerMode = "reveal" | "overlay";
15
+ /**
16
+ * Phase of drawer animation lifecycle.
17
+ */
18
+ export type DrawerAnimationPhase = "idle" | "opening" | "open" | "closing" | "closed";
19
+ /**
20
+ * Options for useDrawerTransform hook.
21
+ */
22
+ export type UseDrawerTransformOptions = {
23
+ /** Animation mode */
24
+ mode: DrawerMode;
25
+ /** Ref to the drawer element */
26
+ drawerRef: React.RefObject<HTMLElement | null>;
27
+ /** Ref to the content element (reveal mode) */
28
+ contentRef?: React.RefObject<HTMLElement | null>;
29
+ /** Ref to the backdrop element (overlay mode) */
30
+ backdropRef?: React.RefObject<HTMLElement | null>;
31
+ /** Drawer placement */
32
+ placement: DrawerPlacement;
33
+ /** Drawer size in pixels */
34
+ drawerSize: number;
35
+ /** Whether the drawer is open */
36
+ isOpen: boolean;
37
+ /** Current swipe state */
38
+ swipeState: ContinuousOperationState;
39
+ /** Current swipe displacement */
40
+ displacement: number;
41
+ /** Whether opening via swipe */
42
+ isOpening: boolean;
43
+ /** Whether closing via swipe */
44
+ isClosing: boolean;
45
+ /** Whether this hook is enabled */
46
+ enabled: boolean;
47
+ /** Whether drawer is inline (affects content element for reveal mode) */
48
+ inline?: boolean;
49
+ /** Grid container ref for inline mode (reveal mode) */
50
+ gridRef?: React.RefObject<HTMLElement | null>;
51
+ /** Content background color (reveal mode) */
52
+ contentBackground?: string;
53
+ };
54
+ /**
55
+ * Result from useDrawerTransform hook.
56
+ */
57
+ export type UseDrawerTransformResult = {
58
+ /** Current animation phase */
59
+ phase: DrawerAnimationPhase;
60
+ /** Whether any animation is running */
61
+ isAnimating: boolean;
62
+ };
63
+ /**
64
+ * Unified hook for drawer transform animations.
65
+ *
66
+ * Supports both reveal and overlay modes through a strategy pattern.
67
+ */
68
+ export declare function useDrawerTransform(options: UseDrawerTransformOptions): UseDrawerTransformResult;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @file Hook for managing reveal-mode drawer transform (backward-compatible wrapper).
3
+ *
4
+ * This hook is a thin wrapper around useDrawerTransform with mode="reveal".
5
+ * For new code, prefer using useDrawerTransform directly.
6
+ *
7
+ * @deprecated Use useDrawerTransform with mode="reveal" instead.
8
+ */
9
+ import * as React from "react";
10
+ import type { ContinuousOperationState } from "../../hooks/gesture/types.js";
11
+ import type { DrawerPlacement } from "./drawerStyles.js";
12
+ import { type DrawerAnimationPhase, type UseDrawerTransformResult } from "./useDrawerTransform.js";
13
+ /**
14
+ * Phase of reveal drawer animation lifecycle.
15
+ * @deprecated Use DrawerAnimationPhase from useDrawerTransform.ts
16
+ */
17
+ export type RevealDrawerAnimationPhase = DrawerAnimationPhase;
18
+ /**
19
+ * Options for useRevealDrawerTransform hook.
20
+ */
21
+ export type UseRevealDrawerTransformOptions = {
22
+ /** Ref to the drawer element */
23
+ drawerRef: React.RefObject<HTMLElement | null>;
24
+ /** Drawer placement */
25
+ placement: DrawerPlacement;
26
+ /** Drawer size in pixels */
27
+ drawerSize: number;
28
+ /** Whether the drawer is open */
29
+ isOpen: boolean;
30
+ /** Current swipe state */
31
+ swipeState: ContinuousOperationState;
32
+ /** Current swipe displacement */
33
+ displacement: number;
34
+ /** Whether opening via swipe */
35
+ isOpening: boolean;
36
+ /** Whether closing via swipe */
37
+ isClosing: boolean;
38
+ /** Whether this hook is enabled */
39
+ enabled: boolean;
40
+ /** Whether drawer is inline (affects target element) */
41
+ inline: boolean;
42
+ /** Grid container ref for inline mode */
43
+ gridRef?: React.RefObject<HTMLElement | null>;
44
+ /** Content background color for stacking context */
45
+ contentBackground?: string;
46
+ };
47
+ /**
48
+ * Result from useRevealDrawerTransform hook.
49
+ */
50
+ export type UseRevealDrawerTransformResult = UseDrawerTransformResult;
51
+ /**
52
+ * Hook for managing reveal-mode drawer transform.
53
+ *
54
+ * @deprecated Use useDrawerTransform with mode="reveal" instead.
55
+ */
56
+ export declare function useRevealDrawerTransform(options: UseRevealDrawerTransformOptions): UseRevealDrawerTransformResult;
package/dist/config.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),v=require("react"),b=require("./GridLayout-DKTg_N61.cjs");require("./FloatingPanelFrame-CEmXDvUA.cjs");require("./FloatingWindow-DMwyK0eK.cjs");function E(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}return t.default=r,Object.freeze(t)}const s=E(v),C=r=>{const t=z(r);if(t==="grid"&&!r.area)throw new Error(`PanelRoute ${r.id} must specify 'area' for grid placement.`);return{id:r.id,component:r.element,visible:r.visible,gridArea:r.area,positionMode:t,position:r.position,zIndex:r.zIndex,width:r.width,height:r.height,pointerEvents:r.pointerEvents,style:r.style,drawer:r.drawer,floating:r.floating,pivot:r.pivot,backdropStyle:r.backdropStyle}},z=r=>r.positionMode?r.positionMode:r.floating?"absolute":(r.drawer,"grid"),P=r=>{const t=[],n=i=>{t.push(i),i.children&&i.children.forEach(e=>n(e))};return r.forEach(i=>n(i)),t},I=r=>{const t=new Set;r.forEach(n=>{if(t.has(n.id))throw new Error(`Duplicate PanelRoute id detected: ${n.id}`);t.add(n.id)})},A=r=>{const t=P(r);return I(t),t.map(n=>C(n))},p=()=>null,x=()=>null,a=(r,t)=>s.isValidElement(r)?r.type===t:!1,d=r=>{const t=[],n=i=>{if(!(i==null||typeof i=="boolean")){if(Array.isArray(i)){i.forEach(n);return}if(a(i,p)){const e=i.props;if(!e.id)throw new Error("<Panel> requires an 'id' prop.");if(e.type==="grid"){if(!e.area)throw new Error(`<Panel id="${e.id}"> requires an explicit 'area' prop when type="grid".`);t.push({id:e.id,area:e.area,element:e.children??null,visible:e.visible,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style});return}if(e.type==="floating"){if(!e.position)throw new Error(`<Panel id="${e.id}"> requires a 'position' prop when type="floating".`);if(e.width===void 0||e.height===void 0)throw new Error(`<Panel id="${e.id}"> requires 'width' and 'height' when type="floating".`);t.push({id:e.id,element:e.children??null,visible:e.visible??!0,positionMode:"absolute",position:e.position,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style,floating:{mode:"embedded",draggable:e.draggable,resizable:e.resizable}});return}if(e.type==="drawer"){t.push({id:e.id,element:e.children??null,visible:e.visible??!0,positionMode:"relative",position:e.position,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style,drawer:e.drawer,backdropStyle:e.backdropStyle});return}if(e.type==="pivot"){if(!e.area)throw new Error(`<Panel id="${e.id}"> requires an explicit 'area' prop when type="pivot".`);const o=$(e.children);if(o.length===0)throw new Error(`<Panel id="${e.id}"> requires at least one <PivotItem> child when type="pivot".`);t.push({id:e.id,area:e.area,element:null,visible:e.visible,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style,pivot:{items:o,activeId:e.activeId,defaultActiveId:e.defaultActiveId,onActiveChange:e.onActiveChange}});return}throw new Error("<Panel> has unsupported type.")}if(s.isValidElement(i)){if(i.type===s.Fragment){n(i.props.children);return}return}}};return n(r),t},R=({config:r,style:t,children:n})=>{const i=s.useMemo(()=>d(n),[n]),e=s.useMemo(()=>A(i),[i]),o=s.useMemo(()=>{if(r)return r;const l=m(n);if(!l)throw new Error("Panel requires either 'config' prop or a JSX config (<Config><Rows/><Columns/><Areas/></Config>). ");return l},[n,r]);return y.jsx(b.GridLayout,{config:o,layers:e,style:t})},h=()=>null,q=()=>null,S=()=>null,f=()=>null,w=()=>null,g=()=>null,u=(r,t)=>{const n=[],i=e=>{if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){e.forEach(i);return}if(a(e,t)){const o=e.props;if(!o.size)throw new Error("Row/Col requires 'size' property.");n.push({size:o.size,resizable:o.resizable,minSize:o.minSize,maxSize:o.maxSize});return}s.isValidElement(e)&&i(e.props.children)}};return i(r),n},M=r=>{const t=c(r,h);if(!t)return null;const n=t.props,i=u(t.props.children,f),e=u(t.props.children,w),o=c(t.props.children,g),l=o?o.props.matrix:void 0;return{gap:n.gap,style:n.style,rows:i,columns:e,areas:l}},c=(r,t)=>{const n=i=>{if(i==null||typeof i=="boolean")return null;if(Array.isArray(i)){for(const e of i){const o=n(e);if(o)return o}return null}return a(i,t)?i:s.isValidElement(i)?n(i.props.children):null};return n(r)},$=r=>{const t=[],n=i=>{if(!(i==null||typeof i=="boolean")){if(Array.isArray(i)){i.forEach(n);return}if(a(i,x)){const e=i.props;if(!e.id)throw new Error("<PivotItem> requires an 'id' prop.");t.push({id:e.id,label:e.label,content:e.children??null,disabled:e.disabled});return}s.isValidElement(i)&&i.type===s.Fragment&&n(i.props.children)}};return n(r),t},m=r=>{const t=M(r);if(!t)return null;if(!t.rows||t.rows.length===0)throw new Error("Config must include at least one <Row size=...> inside <Config>.");if(!t.columns||t.columns.length===0)throw new Error("Config must include at least one <Col size=...> inside <Config>.");if(!t.areas||t.areas.length===0)throw new Error("Config must include <Areas matrix={...}> inside <Config>.");const n=t.areas.length,i=t.areas[0]?.length??0;if(n!==t.rows.length)throw new Error(`Areas row count (${n}) must match Rows count (${t.rows.length}).`);if(i!==t.columns.length)throw new Error(`Areas column count (${i}) must match Columns count (${t.columns.length}).`);return{areas:t.areas,rows:t.rows,columns:t.columns,gap:t.gap,style:t.style}};exports.Areas=g;exports.Col=w;exports.Columns=S;exports.Config=h;exports.Panel=p;exports.PanelLayout=R;exports.Row=f;exports.Rows=q;exports.buildConfigFromChildren=m;exports.buildRoutesFromChildren=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),v=require("react"),b=require("./GridLayout-DNOClFzz.cjs");require("react-dom");require("./FloatingPanelFrame-CEmXDvUA.cjs");require("./FloatingWindow-Cvyokf0m.cjs");function E(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const s=E(v),C=t=>{const r=z(t);if(r==="grid"&&!t.area)throw new Error(`PanelRoute ${t.id} must specify 'area' for grid placement.`);return{id:t.id,component:t.element,visible:t.visible,gridArea:t.area,positionMode:r,position:t.position,zIndex:t.zIndex,width:t.width,height:t.height,pointerEvents:t.pointerEvents,style:t.style,drawer:t.drawer,floating:t.floating,pivot:t.pivot,backdropStyle:t.backdropStyle}},z=t=>t.positionMode?t.positionMode:t.floating?"absolute":(t.drawer,"grid"),P=t=>{const r=[],n=i=>{r.push(i),i.children&&i.children.forEach(e=>n(e))};return t.forEach(i=>n(i)),r},I=t=>{const r=new Set;t.forEach(n=>{if(r.has(n.id))throw new Error(`Duplicate PanelRoute id detected: ${n.id}`);r.add(n.id)})},A=t=>{const r=P(t);return I(r),r.map(n=>C(n))},p=()=>null,x=()=>null,a=(t,r)=>s.isValidElement(t)?t.type===r:!1,d=t=>{const r=[],n=i=>{if(!(i==null||typeof i=="boolean")){if(Array.isArray(i)){i.forEach(n);return}if(a(i,p)){const e=i.props;if(!e.id)throw new Error("<Panel> requires an 'id' prop.");if(e.type==="grid"){if(!e.area)throw new Error(`<Panel id="${e.id}"> requires an explicit 'area' prop when type="grid".`);r.push({id:e.id,area:e.area,element:e.children??null,visible:e.visible,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style});return}if(e.type==="floating"){if(!e.position)throw new Error(`<Panel id="${e.id}"> requires a 'position' prop when type="floating".`);if(e.width===void 0||e.height===void 0)throw new Error(`<Panel id="${e.id}"> requires 'width' and 'height' when type="floating".`);r.push({id:e.id,element:e.children??null,visible:e.visible??!0,positionMode:"absolute",position:e.position,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style,floating:{mode:"embedded",draggable:e.draggable,resizable:e.resizable}});return}if(e.type==="drawer"){r.push({id:e.id,element:e.children??null,visible:e.visible??!0,positionMode:"relative",position:e.position,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style,drawer:e.drawer,backdropStyle:e.backdropStyle});return}if(e.type==="pivot"){if(!e.area)throw new Error(`<Panel id="${e.id}"> requires an explicit 'area' prop when type="pivot".`);const o=$(e.children);if(o.length===0)throw new Error(`<Panel id="${e.id}"> requires at least one <PivotItem> child when type="pivot".`);r.push({id:e.id,area:e.area,element:null,visible:e.visible,zIndex:e.zIndex,width:e.width,height:e.height,pointerEvents:e.pointerEvents,style:e.style,pivot:{items:o,activeId:e.activeId,defaultActiveId:e.defaultActiveId,onActiveChange:e.onActiveChange}});return}throw new Error("<Panel> has unsupported type.")}if(s.isValidElement(i)){if(i.type===s.Fragment){n(i.props.children);return}return}}};return n(t),r},R=({config:t,style:r,children:n})=>{const i=s.useMemo(()=>d(n),[n]),e=s.useMemo(()=>A(i),[i]),o=s.useMemo(()=>{if(t)return t;const l=m(n);if(!l)throw new Error("Panel requires either 'config' prop or a JSX config (<Config><Rows/><Columns/><Areas/></Config>). ");return l},[n,t]);return y.jsx(b.GridLayout,{config:o,layers:e,style:r})},h=()=>null,q=()=>null,S=()=>null,f=()=>null,w=()=>null,g=()=>null,u=(t,r)=>{const n=[],i=e=>{if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){e.forEach(i);return}if(a(e,r)){const o=e.props;if(!o.size)throw new Error("Row/Col requires 'size' property.");n.push({size:o.size,resizable:o.resizable,minSize:o.minSize,maxSize:o.maxSize});return}s.isValidElement(e)&&i(e.props.children)}};return i(t),n},M=t=>{const r=c(t,h);if(!r)return null;const n=r.props,i=u(r.props.children,f),e=u(r.props.children,w),o=c(r.props.children,g),l=o?o.props.matrix:void 0;return{gap:n.gap,style:n.style,rows:i,columns:e,areas:l}},c=(t,r)=>{const n=i=>{if(i==null||typeof i=="boolean")return null;if(Array.isArray(i)){for(const e of i){const o=n(e);if(o)return o}return null}return a(i,r)?i:s.isValidElement(i)?n(i.props.children):null};return n(t)},$=t=>{const r=[],n=i=>{if(!(i==null||typeof i=="boolean")){if(Array.isArray(i)){i.forEach(n);return}if(a(i,x)){const e=i.props;if(!e.id)throw new Error("<PivotItem> requires an 'id' prop.");r.push({id:e.id,label:e.label,content:e.children??null,disabled:e.disabled});return}s.isValidElement(i)&&i.type===s.Fragment&&n(i.props.children)}};return n(t),r},m=t=>{const r=M(t);if(!r)return null;if(!r.rows||r.rows.length===0)throw new Error("Config must include at least one <Row size=...> inside <Config>.");if(!r.columns||r.columns.length===0)throw new Error("Config must include at least one <Col size=...> inside <Config>.");if(!r.areas||r.areas.length===0)throw new Error("Config must include <Areas matrix={...}> inside <Config>.");const n=r.areas.length,i=r.areas[0]?.length??0;if(n!==r.rows.length)throw new Error(`Areas row count (${n}) must match Rows count (${r.rows.length}).`);if(i!==r.columns.length)throw new Error(`Areas column count (${i}) must match Columns count (${r.columns.length}).`);return{areas:r.areas,rows:r.rows,columns:r.columns,gap:r.gap,style:r.style}};exports.Areas=g;exports.Col=w;exports.Columns=S;exports.Config=h;exports.Panel=p;exports.PanelLayout=R;exports.Row=f;exports.Rows=q;exports.buildConfigFromChildren=m;exports.buildRoutesFromChildren=d;
2
2
  //# sourceMappingURL=config.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","sources":["../src/config/panelRouter.tsx","../src/config/PanelContentDeclaration.tsx"],"sourcesContent":["/**\n * @file Router-like builder for GridLayout\n *\n * Provides a React Router–style configuration API to declare panel layers.\n * Converts route objects to the existing GridLayout props without magic.\n */\nimport * as React from \"react\";\nimport type {\n DrawerBehavior,\n FloatingBehavior,\n LayerDefinition,\n LayerPositionMode,\n PanelLayoutConfig,\n PanelLayoutProps,\n PivotBehavior,\n WindowPosition,\n} from \"../types\";\nimport { GridLayout } from \"../components/grid/GridLayout\";\n\nexport type PanelRoute = {\n /** Unique id for the layer. Required. */\n id: string;\n /** React node to render for this layer. Required. */\n element: React.ReactNode;\n /** Visibility flag. Defaults to visible. */\n visible?: boolean;\n\n /**\n * Grid placement key. When using `positionMode: 'grid'` (default), this must be provided.\n * Using `area` mirrors React Router's route path intent but for grid cells.\n */\n area?: string;\n\n /** Explicit positioning mode; defaults to 'grid' unless floating/drawer implies otherwise. */\n positionMode?: LayerPositionMode;\n /** Offsets when using non-grid modes. */\n position?: WindowPosition;\n /** Optional stacking order. */\n zIndex?: number;\n /** Optional dimensions; required for resizable/draggable floating layers. */\n width?: number | string;\n height?: number | string;\n /** Pointer events control. */\n pointerEvents?: boolean | \"auto\" | \"none\";\n /** Optional style overrides. */\n style?: React.CSSProperties;\n /** Optional backdrop style (drawer). */\n backdropStyle?: React.CSSProperties;\n\n /** Drawer behavior for mobile-friendly panels. */\n drawer?: DrawerBehavior;\n /** Floating window configuration. */\n floating?: FloatingBehavior;\n /** Pivot behavior for content switching. */\n pivot?: PivotBehavior;\n\n /**\n * Optional child declarations; purely a grouping convenience.\n * Children are flattened; no implicit inheritance.\n */\n children?: PanelRoute[];\n};\n\nconst toLayer = (route: PanelRoute): LayerDefinition => {\n const inferredMode: LayerPositionMode = resolveRoutePositionMode(route);\n\n if (inferredMode === \"grid\") {\n if (!route.area) {\n throw new Error(`PanelRoute ${route.id} must specify 'area' for grid placement.`);\n }\n }\n\n return {\n id: route.id,\n component: route.element,\n visible: route.visible,\n gridArea: route.area,\n positionMode: inferredMode,\n position: route.position,\n zIndex: route.zIndex,\n width: route.width,\n height: route.height,\n pointerEvents: route.pointerEvents,\n style: route.style,\n drawer: route.drawer,\n floating: route.floating,\n pivot: route.pivot,\n backdropStyle: route.backdropStyle,\n } satisfies LayerDefinition;\n};\n\nconst resolveRoutePositionMode = (route: PanelRoute): LayerPositionMode => {\n if (route.positionMode) {\n return route.positionMode;\n }\n if (route.floating) {\n // Embedded => absolute, Popup => relative (handled by renderer); keep explicitness here.\n return \"absolute\";\n }\n if (route.drawer) {\n return \"grid\";\n }\n return \"grid\";\n};\n\nconst flattenRoutes = (routes: PanelRoute[]): PanelRoute[] => {\n const result: PanelRoute[] = [];\n const walk = (node: PanelRoute): void => {\n result.push(node);\n if (node.children) {\n node.children.forEach((child) => walk(child));\n }\n };\n routes.forEach((r) => walk(r));\n return result;\n};\n\nconst validateUniqueIds = (routes: PanelRoute[]): void => {\n const seen = new Set<string>();\n routes.forEach((r) => {\n if (seen.has(r.id)) {\n throw new Error(`Duplicate PanelRoute id detected: ${r.id}`);\n }\n seen.add(r.id);\n });\n};\n\nexport const buildLayersFromRoutes = (routes: PanelRoute[]): LayerDefinition[] => {\n const flat = flattenRoutes(routes);\n validateUniqueIds(flat);\n return flat.map((r) => toLayer(r));\n};\n\nexport const createPanelLayoutFromRoutes = (input: {\n config: PanelLayoutConfig;\n routes: PanelRoute[];\n style?: React.CSSProperties;\n}): PanelLayoutProps => {\n const layers = buildLayersFromRoutes(input.routes);\n return {\n config: input.config,\n layers,\n };\n};\n\nexport type PanelLayoutRouterProps = {\n config: PanelLayoutConfig;\n routes: PanelRoute[];\n style?: React.CSSProperties;\n};\n\nexport const PanelLayoutRouter: React.FC<PanelLayoutRouterProps> = ({ config, routes, style }) => {\n const layers = React.useMemo(() => buildLayersFromRoutes(routes), [routes]);\n return <GridLayout config={config} layers={layers} style={style} />;\n};\n","/**\n * @file PanelContentDeclaration (JSX DSL for content configuration ONLY)\n *\n * IMPORTANT: This file declares a JSX DSL to configure panel \"content\" and layout\n * tracks. It does NOT implement grid rendering, resizing, dragging, or drawers.\n * Those behaviors live in the existing layout/rendering modules. Keep this file\n * limited to declaration and conversion into GridLayout props.\n *\n * Usage (content declaration):\n * <PanelLayout>\n * <Config>\n * <Rows>...</Rows>\n * <Columns>...</Columns>\n * <Areas matrix={...}/>\n * </Config>\n * <Panel type=\"grid\" id=\"main\" area=\"main\">...</Panel>\n * <Panel type=\"floating\" id=\"preview\" position={{ left: 0, top: 0 }} width={300} height={200} />\n * <Panel type=\"drawer\" id=\"nav\" drawer={{ defaultOpen: true }} position={{ left: 0 }} />\n * </PanelLayout>\n */\nimport * as React from \"react\";\nimport { GridLayout } from \"../components/grid/GridLayout\";\nimport type { DrawerBehavior, GridTrack, PanelLayoutConfig, WindowPosition } from \"../types\";\nimport type { PanelRoute } from \"./panelRouter\";\nimport { buildLayersFromRoutes } from \"./panelRouter\";\n\nexport type PanelRootProps = {\n config?: PanelLayoutConfig;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\n// Unified child declaration: <Panel type=\"grid\" .../> or <Panel type=\"floating\" .../>...\ntype PanelCommonProps = {\n id: string;\n visible?: boolean;\n zIndex?: number;\n width?: number | string;\n height?: number | string;\n pointerEvents?: boolean | \"auto\" | \"none\";\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\nexport type PanelProps =\n | (PanelCommonProps & { type: \"grid\"; area: string })\n | (PanelCommonProps & {\n type: \"floating\";\n position: WindowPosition;\n width: number | string;\n height: number | string;\n draggable?: boolean;\n resizable?: boolean;\n })\n | (PanelCommonProps & {\n type: \"drawer\";\n drawer: DrawerBehavior;\n position?: WindowPosition;\n backdropStyle?: React.CSSProperties;\n })\n | (Omit<PanelCommonProps, \"children\"> & {\n type: \"pivot\";\n area: string;\n /** Currently active item ID (controlled mode) */\n activeId?: string;\n /** Default active item ID (uncontrolled mode) */\n defaultActiveId?: string;\n /** Callback when active item changes */\n onActiveChange?: (id: string) => void;\n children?: React.ReactNode;\n });\n\nexport const Panel: React.FC<PanelProps> = () => null;\n\n/**\n * PivotItem declaration for use inside <Panel type=\"pivot\">\n */\nexport type PivotItemDeclProps = {\n id: string;\n label?: string;\n disabled?: boolean;\n children?: React.ReactNode;\n};\n\nexport const PivotItem: React.FC<PivotItemDeclProps> = () => null;\n\nconst isElementOf = <P,>(element: unknown, component: React.FC<P>): element is React.ReactElement<P> => {\n if (!React.isValidElement<P>(element)) {\n return false;\n }\n return element.type === component;\n};\n\nexport const buildRoutesFromChildren = (children: React.ReactNode): PanelRoute[] => {\n const routes: PanelRoute[] = [];\n\n const visit = (node: React.ReactNode): void => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n // Unified <Panel type=\"...\" />\n if (isElementOf(node, Panel)) {\n const props = node.props as PanelProps;\n if (!props.id) {\n throw new Error(\"<Panel> requires an 'id' prop.\");\n }\n if (props.type === \"grid\") {\n if (!props.area) {\n throw new Error(`<Panel id=\"${props.id}\"> requires an explicit 'area' prop when type=\"grid\".`);\n }\n routes.push({\n id: props.id,\n area: props.area,\n element: props.children ?? null,\n visible: props.visible,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n });\n return;\n }\n if (props.type === \"floating\") {\n if (!props.position) {\n throw new Error(`<Panel id=\"${props.id}\"> requires a 'position' prop when type=\"floating\".`);\n }\n if (props.width === undefined || props.height === undefined) {\n throw new Error(`<Panel id=\"${props.id}\"> requires 'width' and 'height' when type=\"floating\".`);\n }\n routes.push({\n id: props.id,\n element: props.children ?? null,\n visible: props.visible ?? true,\n positionMode: \"absolute\",\n position: props.position,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n floating: { mode: \"embedded\", draggable: props.draggable, resizable: props.resizable },\n });\n return;\n }\n if (props.type === \"drawer\") {\n routes.push({\n id: props.id,\n element: props.children ?? null,\n visible: props.visible ?? true,\n positionMode: \"relative\",\n position: props.position,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n drawer: props.drawer,\n backdropStyle: props.backdropStyle,\n });\n return;\n }\n if (props.type === \"pivot\") {\n if (!props.area) {\n throw new Error(`<Panel id=\"${props.id}\"> requires an explicit 'area' prop when type=\"pivot\".`);\n }\n const pivotItems = collectPivotItems(props.children);\n if (pivotItems.length === 0) {\n throw new Error(`<Panel id=\"${props.id}\"> requires at least one <PivotItem> child when type=\"pivot\".`);\n }\n routes.push({\n id: props.id,\n area: props.area,\n element: null,\n visible: props.visible,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n pivot: {\n items: pivotItems,\n activeId: props.activeId,\n defaultActiveId: props.defaultActiveId,\n onActiveChange: props.onActiveChange,\n },\n });\n return;\n }\n // unknown type -> error for explicitness\n throw new Error(\"<Panel> has unsupported type.\");\n }\n\n if (React.isValidElement(node)) {\n if (node.type === React.Fragment) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n visit(el.props.children);\n return;\n }\n // Unknown element: ignore quietly to allow comments/wrappers.\n return;\n }\n // Primitive nodes (string/number) are ignored.\n };\n\n visit(children);\n return routes;\n};\n\n// Root container renamed to PanelLayout to avoid name collision with child <Panel/>\nexport const PanelLayout: React.FC<PanelRootProps> = ({ config, style, children }) => {\n const routes = React.useMemo(() => buildRoutesFromChildren(children), [children]);\n const layers = React.useMemo(() => buildLayersFromRoutes(routes), [routes]);\n const derivedConfig = React.useMemo(() => {\n if (config) {\n return config;\n }\n const built = buildConfigFromChildren(children);\n if (!built) {\n throw new Error(\"Panel requires either 'config' prop or a JSX config (<Config><Rows/><Columns/><Areas/></Config>). \");\n }\n return built;\n }, [children, config]);\n return <GridLayout config={derivedConfig} layers={layers} style={style} />;\n};\n\n// =============================\n// JSX Config Declarations\n// =============================\n\nexport type ConfigProps = {\n gap?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\nexport const Config: React.FC<ConfigProps> = () => {\n return null;\n};\n\nexport const Rows: React.FC<{ children?: React.ReactNode }> = () => {\n return null;\n};\n\nexport const Columns: React.FC<{ children?: React.ReactNode }> = () => {\n return null;\n};\n\nexport type RowProps = GridTrack;\nexport const Row: React.FC<RowProps> = () => {\n return null;\n};\n\nexport type ColumnProps = GridTrack;\nexport const Col: React.FC<ColumnProps> = () => {\n return null;\n};\n\nexport type AreasProps = {\n matrix: string[][];\n};\nexport const Areas: React.FC<AreasProps> = () => {\n return null;\n};\n\ntype CollectedConfig = {\n gap?: string;\n style?: React.CSSProperties;\n rows?: GridTrack[];\n columns?: GridTrack[];\n areas?: string[][];\n};\n\nconst collectTracks = <P extends GridTrack>(children: React.ReactNode, marker: React.FC<P>): GridTrack[] => {\n const result: GridTrack[] = [];\n const visit = (node: React.ReactNode): void => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n if (isElementOf(node, marker)) {\n const props = node.props as P;\n if (!props.size) {\n throw new Error(\"Row/Col requires 'size' property.\");\n }\n result.push({\n size: props.size,\n resizable: props.resizable,\n minSize: props.minSize,\n maxSize: props.maxSize,\n });\n return;\n }\n if (React.isValidElement(node)) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n visit(el.props.children);\n }\n };\n visit(children);\n return result;\n};\n\nconst collectConfigBlock = (children: React.ReactNode): CollectedConfig | null => {\n const node = findFirst(children, Config);\n if (!node) {\n return null;\n }\n const props = node.props as ConfigProps;\n const rows = collectTracks(node.props.children, Row);\n const columns = collectTracks(node.props.children, Col);\n const areasNode = findFirst(node.props.children, Areas);\n const areas = areasNode ? (areasNode.props as AreasProps).matrix : undefined;\n return {\n gap: props.gap,\n style: props.style,\n rows,\n columns,\n areas,\n };\n};\n\nconst findFirst = <P,>(children: React.ReactNode, marker: React.FC<P>): React.ReactElement<P> | null => {\n const visit = (node: React.ReactNode): React.ReactElement<P> | null => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return null;\n }\n if (Array.isArray(node)) {\n for (const item of node) {\n const found = visit(item);\n if (found) {\n return found;\n }\n }\n return null;\n }\n if (isElementOf(node, marker)) {\n return node as React.ReactElement<P>;\n }\n if (React.isValidElement(node)) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n return visit(el.props.children);\n }\n return null;\n };\n return visit(children);\n};\n\ntype CollectedPivotItem = {\n id: string;\n label?: string;\n content: React.ReactNode;\n disabled?: boolean;\n};\n\nconst collectPivotItems = (children: React.ReactNode): CollectedPivotItem[] => {\n const items: CollectedPivotItem[] = [];\n const visit = (node: React.ReactNode): void => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n if (isElementOf(node, PivotItem)) {\n const props = node.props as PivotItemDeclProps;\n if (!props.id) {\n throw new Error(\"<PivotItem> requires an 'id' prop.\");\n }\n items.push({\n id: props.id,\n label: props.label,\n content: props.children ?? null,\n disabled: props.disabled,\n });\n return;\n }\n if (React.isValidElement(node)) {\n if (node.type === React.Fragment) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n visit(el.props.children);\n }\n }\n };\n visit(children);\n return items;\n};\n\nexport const buildConfigFromChildren = (children: React.ReactNode): PanelLayoutConfig | null => {\n const collected = collectConfigBlock(children);\n if (!collected) {\n return null;\n }\n if (!collected.rows || collected.rows.length === 0) {\n throw new Error(\"Config must include at least one <Row size=...> inside <Config>.\");\n }\n if (!collected.columns || collected.columns.length === 0) {\n throw new Error(\"Config must include at least one <Col size=...> inside <Config>.\");\n }\n if (!collected.areas || collected.areas.length === 0) {\n throw new Error(\"Config must include <Areas matrix={...}> inside <Config>.\");\n }\n\n const rowCount = collected.areas.length;\n const colCount = collected.areas[0]?.length ?? 0;\n if (rowCount !== collected.rows.length) {\n throw new Error(`Areas row count (${rowCount}) must match Rows count (${collected.rows.length}).`);\n }\n if (colCount !== collected.columns.length) {\n throw new Error(`Areas column count (${colCount}) must match Columns count (${collected.columns.length}).`);\n }\n\n return {\n areas: collected.areas,\n rows: collected.rows,\n columns: collected.columns,\n gap: collected.gap,\n style: collected.style,\n } satisfies PanelLayoutConfig;\n};\n"],"names":["toLayer","route","inferredMode","resolveRoutePositionMode","flattenRoutes","routes","result","walk","node","child","r","validateUniqueIds","seen","buildLayersFromRoutes","flat","Panel","PivotItem","isElementOf","element","component","React","buildRoutesFromChildren","children","visit","props","pivotItems","collectPivotItems","PanelLayout","config","style","layers","derivedConfig","built","buildConfigFromChildren","jsx","GridLayout","Config","Rows","Columns","Row","Col","Areas","collectTracks","marker","collectConfigBlock","findFirst","rows","columns","areasNode","areas","item","found","items","collected","rowCount","colCount"],"mappings":"+hBA+DMA,EAAWC,GAAuC,CACtD,MAAMC,EAAkCC,EAAyBF,CAAK,EAEtE,GAAIC,IAAiB,QACf,CAACD,EAAM,KACT,MAAM,IAAI,MAAM,cAAcA,EAAM,EAAE,0CAA0C,EAIpF,MAAO,CACL,GAAIA,EAAM,GACV,UAAWA,EAAM,QACjB,QAASA,EAAM,QACf,SAAUA,EAAM,KAChB,aAAcC,EACd,SAAUD,EAAM,SAChB,OAAQA,EAAM,OACd,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,cAAeA,EAAM,cACrB,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,SAAUA,EAAM,SAChB,MAAOA,EAAM,MACb,cAAeA,EAAM,aAAA,CAEzB,EAEME,EAA4BF,GAC5BA,EAAM,aACDA,EAAM,aAEXA,EAAM,SAED,YAELA,EAAM,OACD,QAKLG,EAAiBC,GAAuC,CAC5D,MAAMC,EAAuB,CAAA,EACvBC,EAAQC,GAA2B,CACvCF,EAAO,KAAKE,CAAI,EACZA,EAAK,UACPA,EAAK,SAAS,QAASC,GAAUF,EAAKE,CAAK,CAAC,CAEhD,EACA,OAAAJ,EAAO,QAASK,GAAMH,EAAKG,CAAC,CAAC,EACtBJ,CACT,EAEMK,EAAqBN,GAA+B,CACxD,MAAMO,MAAW,IACjBP,EAAO,QAASK,GAAM,CACpB,GAAIE,EAAK,IAAIF,EA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AM,KAAK,CACT,GAAI5B,EAAM,GACV,MAAOA,EAAM,MACb,QAASA,EAAM,UAAY,KAC3B,SAAUA,EAAM,QAAA,CACjB,EACD,MACF,CACIJ,EAAM,eAAeZ,CAAI,GACvBA,EAAK,OAASY,EAAM,UAEtBG,EADWf,EACF,MAAM,QAAQ,EAG7B,EACA,OAAAe,EAAMD,CAAQ,EACP8B,CACT,EAEanB,EAA2BX,GAAwD,CAC9F,MAAM+B,EAAYT,EAAmBtB,CAAQ,EAC7C,GAAI,CAAC+B,EACH,OAAO,KAET,GAAI,CAACA,EAAU,MAAQA,EAAU,KAAK,SAAW,EAC/C,MAAM,IAAI,MAAM,kEAAkE,EAEpF,GAAI,CAACA,EAAU,SAAWA,EAAU,QAAQ,SAAW,EACrD,MAAM,IAAI,MAAM,kEAAkE,EAEpF,GAAI,CAACA,EAAU,OAASA,EAAU,MAAM,SAAW,EACjD,MAAM,IAAI,MAAM,2DAA2D,EAG7E,MAAMC,EAAWD,EAAU,MAAM,OAC3BE,EAAWF,EAAU,MAAM,CAAC,GAAG,QAAU,EAC/C,GAAIC,IAAaD,EAAU,KAAK,OAC9B,MAAM,IAAI,MAAM,oBAAoBC,CAAQ,4BAA4BD,EAAU,KAAK,MAAM,IAAI,EAEnG,GAAIE,IAAaF,EAAU,QAAQ,OACjC,MAAM,IAAI,MAAM,uBAAuBE,CAAQ,+BAA+BF,EAAU,QAAQ,MAAM,IAAI,EAG5G,MAAO,CACL,MAAOA,EAAU,MACjB,KAAMA,EAAU,KAChB,QAASA,EAAU,QACnB,IAAKA,EAAU,IACf,MAAOA,EAAU,KAAA,CAErB"}
1
+ {"version":3,"file":"config.cjs","sources":["../src/config/panelRouter.tsx","../src/config/PanelContentDeclaration.tsx"],"sourcesContent":["/**\n * @file Router-like builder for GridLayout\n *\n * Provides a React Router–style configuration API to declare panel layers.\n * Converts route objects to the existing GridLayout props without magic.\n */\nimport * as React from \"react\";\nimport type {\n DrawerBehavior,\n FloatingBehavior,\n LayerDefinition,\n LayerPositionMode,\n PanelLayoutConfig,\n PanelLayoutProps,\n PivotBehavior,\n WindowPosition,\n} from \"../types\";\nimport { GridLayout } from \"../components/grid/GridLayout\";\n\nexport type PanelRoute = {\n /** Unique id for the layer. Required. */\n id: string;\n /** React node to render for this layer. Required. */\n element: React.ReactNode;\n /** Visibility flag. Defaults to visible. */\n visible?: boolean;\n\n /**\n * Grid placement key. When using `positionMode: 'grid'` (default), this must be provided.\n * Using `area` mirrors React Router's route path intent but for grid cells.\n */\n area?: string;\n\n /** Explicit positioning mode; defaults to 'grid' unless floating/drawer implies otherwise. */\n positionMode?: LayerPositionMode;\n /** Offsets when using non-grid modes. */\n position?: WindowPosition;\n /** Optional stacking order. */\n zIndex?: number;\n /** Optional dimensions; required for resizable/draggable floating layers. */\n width?: number | string;\n height?: number | string;\n /** Pointer events control. */\n pointerEvents?: boolean | \"auto\" | \"none\";\n /** Optional style overrides. */\n style?: React.CSSProperties;\n /** Optional backdrop style (drawer). */\n backdropStyle?: React.CSSProperties;\n\n /** Drawer behavior for mobile-friendly panels. */\n drawer?: DrawerBehavior;\n /** Floating window configuration. */\n floating?: FloatingBehavior;\n /** Pivot behavior for content switching. */\n pivot?: PivotBehavior;\n\n /**\n * Optional child declarations; purely a grouping convenience.\n * Children are flattened; no implicit inheritance.\n */\n children?: PanelRoute[];\n};\n\nconst toLayer = (route: PanelRoute): LayerDefinition => {\n const inferredMode: LayerPositionMode = resolveRoutePositionMode(route);\n\n if (inferredMode === \"grid\") {\n if (!route.area) {\n throw new Error(`PanelRoute ${route.id} must specify 'area' for grid placement.`);\n }\n }\n\n return {\n id: route.id,\n component: route.element,\n visible: route.visible,\n gridArea: route.area,\n positionMode: inferredMode,\n position: route.position,\n zIndex: route.zIndex,\n width: route.width,\n height: route.height,\n pointerEvents: route.pointerEvents,\n style: route.style,\n drawer: route.drawer,\n floating: route.floating,\n pivot: route.pivot,\n backdropStyle: route.backdropStyle,\n } satisfies LayerDefinition;\n};\n\nconst resolveRoutePositionMode = (route: PanelRoute): LayerPositionMode => {\n if (route.positionMode) {\n return route.positionMode;\n }\n if (route.floating) {\n // Embedded => absolute, Popup => relative (handled by renderer); keep explicitness here.\n return \"absolute\";\n }\n if (route.drawer) {\n return \"grid\";\n }\n return \"grid\";\n};\n\nconst flattenRoutes = (routes: PanelRoute[]): PanelRoute[] => {\n const result: PanelRoute[] = [];\n const walk = (node: PanelRoute): void => {\n result.push(node);\n if (node.children) {\n node.children.forEach((child) => walk(child));\n }\n };\n routes.forEach((r) => walk(r));\n return result;\n};\n\nconst validateUniqueIds = (routes: PanelRoute[]): void => {\n const seen = new Set<string>();\n routes.forEach((r) => {\n if (seen.has(r.id)) {\n throw new Error(`Duplicate PanelRoute id detected: ${r.id}`);\n }\n seen.add(r.id);\n });\n};\n\nexport const buildLayersFromRoutes = (routes: PanelRoute[]): LayerDefinition[] => {\n const flat = flattenRoutes(routes);\n validateUniqueIds(flat);\n return flat.map((r) => toLayer(r));\n};\n\nexport const createPanelLayoutFromRoutes = (input: {\n config: PanelLayoutConfig;\n routes: PanelRoute[];\n style?: React.CSSProperties;\n}): PanelLayoutProps => {\n const layers = buildLayersFromRoutes(input.routes);\n return {\n config: input.config,\n layers,\n };\n};\n\nexport type PanelLayoutRouterProps = {\n config: PanelLayoutConfig;\n routes: PanelRoute[];\n style?: React.CSSProperties;\n};\n\nexport const PanelLayoutRouter: React.FC<PanelLayoutRouterProps> = ({ config, routes, style }) => {\n const layers = React.useMemo(() => buildLayersFromRoutes(routes), [routes]);\n return <GridLayout config={config} layers={layers} style={style} />;\n};\n","/**\n * @file PanelContentDeclaration (JSX DSL for content configuration ONLY)\n *\n * IMPORTANT: This file declares a JSX DSL to configure panel \"content\" and layout\n * tracks. It does NOT implement grid rendering, resizing, dragging, or drawers.\n * Those behaviors live in the existing layout/rendering modules. Keep this file\n * limited to declaration and conversion into GridLayout props.\n *\n * Usage (content declaration):\n * <PanelLayout>\n * <Config>\n * <Rows>...</Rows>\n * <Columns>...</Columns>\n * <Areas matrix={...}/>\n * </Config>\n * <Panel type=\"grid\" id=\"main\" area=\"main\">...</Panel>\n * <Panel type=\"floating\" id=\"preview\" position={{ left: 0, top: 0 }} width={300} height={200} />\n * <Panel type=\"drawer\" id=\"nav\" drawer={{ defaultOpen: true }} position={{ left: 0 }} />\n * </PanelLayout>\n */\nimport * as React from \"react\";\nimport { GridLayout } from \"../components/grid/GridLayout\";\nimport type { DrawerBehavior, GridTrack, PanelLayoutConfig, WindowPosition } from \"../types\";\nimport type { PanelRoute } from \"./panelRouter\";\nimport { buildLayersFromRoutes } from \"./panelRouter\";\n\nexport type PanelRootProps = {\n config?: PanelLayoutConfig;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\n// Unified child declaration: <Panel type=\"grid\" .../> or <Panel type=\"floating\" .../>...\ntype PanelCommonProps = {\n id: string;\n visible?: boolean;\n zIndex?: number;\n width?: number | string;\n height?: number | string;\n pointerEvents?: boolean | \"auto\" | \"none\";\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\nexport type PanelProps =\n | (PanelCommonProps & { type: \"grid\"; area: string })\n | (PanelCommonProps & {\n type: \"floating\";\n position: WindowPosition;\n width: number | string;\n height: number | string;\n draggable?: boolean;\n resizable?: boolean;\n })\n | (PanelCommonProps & {\n type: \"drawer\";\n drawer: DrawerBehavior;\n position?: WindowPosition;\n backdropStyle?: React.CSSProperties;\n })\n | (Omit<PanelCommonProps, \"children\"> & {\n type: \"pivot\";\n area: string;\n /** Currently active item ID (controlled mode) */\n activeId?: string;\n /** Default active item ID (uncontrolled mode) */\n defaultActiveId?: string;\n /** Callback when active item changes */\n onActiveChange?: (id: string) => void;\n children?: React.ReactNode;\n });\n\nexport const Panel: React.FC<PanelProps> = () => null;\n\n/**\n * PivotItem declaration for use inside <Panel type=\"pivot\">\n */\nexport type PivotItemDeclProps = {\n id: string;\n label?: string;\n disabled?: boolean;\n children?: React.ReactNode;\n};\n\nexport const PivotItem: React.FC<PivotItemDeclProps> = () => null;\n\nconst isElementOf = <P,>(element: unknown, component: React.FC<P>): element is React.ReactElement<P> => {\n if (!React.isValidElement<P>(element)) {\n return false;\n }\n return element.type === component;\n};\n\nexport const buildRoutesFromChildren = (children: React.ReactNode): PanelRoute[] => {\n const routes: PanelRoute[] = [];\n\n const visit = (node: React.ReactNode): void => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n // Unified <Panel type=\"...\" />\n if (isElementOf(node, Panel)) {\n const props = node.props as PanelProps;\n if (!props.id) {\n throw new Error(\"<Panel> requires an 'id' prop.\");\n }\n if (props.type === \"grid\") {\n if (!props.area) {\n throw new Error(`<Panel id=\"${props.id}\"> requires an explicit 'area' prop when type=\"grid\".`);\n }\n routes.push({\n id: props.id,\n area: props.area,\n element: props.children ?? null,\n visible: props.visible,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n });\n return;\n }\n if (props.type === \"floating\") {\n if (!props.position) {\n throw new Error(`<Panel id=\"${props.id}\"> requires a 'position' prop when type=\"floating\".`);\n }\n if (props.width === undefined || props.height === undefined) {\n throw new Error(`<Panel id=\"${props.id}\"> requires 'width' and 'height' when type=\"floating\".`);\n }\n routes.push({\n id: props.id,\n element: props.children ?? null,\n visible: props.visible ?? true,\n positionMode: \"absolute\",\n position: props.position,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n floating: { mode: \"embedded\", draggable: props.draggable, resizable: props.resizable },\n });\n return;\n }\n if (props.type === \"drawer\") {\n routes.push({\n id: props.id,\n element: props.children ?? null,\n visible: props.visible ?? true,\n positionMode: \"relative\",\n position: props.position,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n drawer: props.drawer,\n backdropStyle: props.backdropStyle,\n });\n return;\n }\n if (props.type === \"pivot\") {\n if (!props.area) {\n throw new Error(`<Panel id=\"${props.id}\"> requires an explicit 'area' prop when type=\"pivot\".`);\n }\n const pivotItems = collectPivotItems(props.children);\n if (pivotItems.length === 0) {\n throw new Error(`<Panel id=\"${props.id}\"> requires at least one <PivotItem> child when type=\"pivot\".`);\n }\n routes.push({\n id: props.id,\n area: props.area,\n element: null,\n visible: props.visible,\n zIndex: props.zIndex,\n width: props.width,\n height: props.height,\n pointerEvents: props.pointerEvents,\n style: props.style,\n pivot: {\n items: pivotItems,\n activeId: props.activeId,\n defaultActiveId: props.defaultActiveId,\n onActiveChange: props.onActiveChange,\n },\n });\n return;\n }\n // unknown type -> error for explicitness\n throw new Error(\"<Panel> has unsupported type.\");\n }\n\n if (React.isValidElement(node)) {\n if (node.type === React.Fragment) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n visit(el.props.children);\n return;\n }\n // Unknown element: ignore quietly to allow comments/wrappers.\n return;\n }\n // Primitive nodes (string/number) are ignored.\n };\n\n visit(children);\n return routes;\n};\n\n// Root container renamed to PanelLayout to avoid name collision with child <Panel/>\nexport const PanelLayout: React.FC<PanelRootProps> = ({ config, style, children }) => {\n const routes = React.useMemo(() => buildRoutesFromChildren(children), [children]);\n const layers = React.useMemo(() => buildLayersFromRoutes(routes), [routes]);\n const derivedConfig = React.useMemo(() => {\n if (config) {\n return config;\n }\n const built = buildConfigFromChildren(children);\n if (!built) {\n throw new Error(\"Panel requires either 'config' prop or a JSX config (<Config><Rows/><Columns/><Areas/></Config>). \");\n }\n return built;\n }, [children, config]);\n return <GridLayout config={derivedConfig} layers={layers} style={style} />;\n};\n\n// =============================\n// JSX Config Declarations\n// =============================\n\nexport type ConfigProps = {\n gap?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n};\n\nexport const Config: React.FC<ConfigProps> = () => {\n return null;\n};\n\nexport const Rows: React.FC<{ children?: React.ReactNode }> = () => {\n return null;\n};\n\nexport const Columns: React.FC<{ children?: React.ReactNode }> = () => {\n return null;\n};\n\nexport type RowProps = GridTrack;\nexport const Row: React.FC<RowProps> = () => {\n return null;\n};\n\nexport type ColumnProps = GridTrack;\nexport const Col: React.FC<ColumnProps> = () => {\n return null;\n};\n\nexport type AreasProps = {\n matrix: string[][];\n};\nexport const Areas: React.FC<AreasProps> = () => {\n return null;\n};\n\ntype CollectedConfig = {\n gap?: string;\n style?: React.CSSProperties;\n rows?: GridTrack[];\n columns?: GridTrack[];\n areas?: string[][];\n};\n\nconst collectTracks = <P extends GridTrack>(children: React.ReactNode, marker: React.FC<P>): GridTrack[] => {\n const result: GridTrack[] = [];\n const visit = (node: React.ReactNode): void => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n if (isElementOf(node, marker)) {\n const props = node.props as P;\n if (!props.size) {\n throw new Error(\"Row/Col requires 'size' property.\");\n }\n result.push({\n size: props.size,\n resizable: props.resizable,\n minSize: props.minSize,\n maxSize: props.maxSize,\n });\n return;\n }\n if (React.isValidElement(node)) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n visit(el.props.children);\n }\n };\n visit(children);\n return result;\n};\n\nconst collectConfigBlock = (children: React.ReactNode): CollectedConfig | null => {\n const node = findFirst(children, Config);\n if (!node) {\n return null;\n }\n const props = node.props as ConfigProps;\n const rows = collectTracks(node.props.children, Row);\n const columns = collectTracks(node.props.children, Col);\n const areasNode = findFirst(node.props.children, Areas);\n const areas = areasNode ? (areasNode.props as AreasProps).matrix : undefined;\n return {\n gap: props.gap,\n style: props.style,\n rows,\n columns,\n areas,\n };\n};\n\nconst findFirst = <P,>(children: React.ReactNode, marker: React.FC<P>): React.ReactElement<P> | null => {\n const visit = (node: React.ReactNode): React.ReactElement<P> | null => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return null;\n }\n if (Array.isArray(node)) {\n for (const item of node) {\n const found = visit(item);\n if (found) {\n return found;\n }\n }\n return null;\n }\n if (isElementOf(node, marker)) {\n return node as React.ReactElement<P>;\n }\n if (React.isValidElement(node)) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n return visit(el.props.children);\n }\n return null;\n };\n return visit(children);\n};\n\ntype CollectedPivotItem = {\n id: string;\n label?: string;\n content: React.ReactNode;\n disabled?: boolean;\n};\n\nconst collectPivotItems = (children: React.ReactNode): CollectedPivotItem[] => {\n const items: CollectedPivotItem[] = [];\n const visit = (node: React.ReactNode): void => {\n if (node === null || node === undefined || typeof node === \"boolean\") {\n return;\n }\n if (Array.isArray(node)) {\n node.forEach(visit);\n return;\n }\n if (isElementOf(node, PivotItem)) {\n const props = node.props as PivotItemDeclProps;\n if (!props.id) {\n throw new Error(\"<PivotItem> requires an 'id' prop.\");\n }\n items.push({\n id: props.id,\n label: props.label,\n content: props.children ?? null,\n disabled: props.disabled,\n });\n return;\n }\n if (React.isValidElement(node)) {\n if (node.type === React.Fragment) {\n const el = node as React.ReactElement<{ children?: React.ReactNode }>;\n visit(el.props.children);\n }\n }\n };\n visit(children);\n return items;\n};\n\nexport const buildConfigFromChildren = (children: React.ReactNode): PanelLayoutConfig | null => {\n const collected = collectConfigBlock(children);\n if (!collected) {\n return null;\n }\n if (!collected.rows || collected.rows.length === 0) {\n throw new Error(\"Config must include at least one <Row size=...> inside <Config>.\");\n }\n if (!collected.columns || collected.columns.length === 0) {\n throw new Error(\"Config must include at least one <Col size=...> inside <Config>.\");\n }\n if (!collected.areas || collected.areas.length === 0) {\n throw new Error(\"Config must include <Areas matrix={...}> inside <Config>.\");\n }\n\n const rowCount = collected.areas.length;\n const colCount = collected.areas[0]?.length ?? 0;\n if (rowCount !== collected.rows.length) {\n throw new Error(`Areas row count (${rowCount}) must match Rows count (${collected.rows.length}).`);\n }\n if (colCount !== collected.columns.length) {\n throw new Error(`Areas column count (${colCount}) must match Columns count (${collected.columns.length}).`);\n }\n\n return {\n areas: collected.areas,\n rows: collected.rows,\n columns: collected.columns,\n gap: collected.gap,\n style: collected.style,\n } satisfies PanelLayoutConfig;\n};\n"],"names":["toLayer","route","inferredMode","resolveRoutePositionMode","flattenRoutes","routes","result","walk","node","child","r","validateUniqueIds","seen","buildLayersFromRoutes","flat","Panel","PivotItem","isElementOf","element","component","React","buildRoutesFromChildren","children","visit","props","pivotItems","collectPivotItems","PanelLayout","config","style","layers","derivedConfig","built","buildConfigFromChildren","jsx","GridLayout","Config","Rows","Columns","Row","Col","Areas","collectTracks","marker","collectConfigBlock","findFirst","rows","columns","areasNode","areas","item","found","items","collected","rowCount","colCount"],"mappings":"ojBA+DMA,EAAWC,GAAuC,CACtD,MAAMC,EAAkCC,EAAyBF,CAAK,EAEtE,GAAIC,IAAiB,QACf,CAACD,EAAM,KACT,MAAM,IAAI,MAAM,cAAcA,EAAM,EAAE,0CAA0C,EAIpF,MAAO,CACL,GAAIA,EAAM,GACV,UAAWA,EAAM,QACjB,QAASA,EAAM,QACf,SAAUA,EAAM,KAChB,aAAcC,EACd,SAAUD,EAAM,SAChB,OAAQA,EAAM,OACd,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,cAAeA,EAAM,cACrB,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,SAAUA,EAAM,SAChB,MAAOA,EAAM,MACb,cAAeA,EAAM,aAAA,CAEzB,EAEME,EAA4BF,GAC5BA,EAAM,aACDA,EAAM,aAEXA,EAAM,SAED,YAELA,EAAM,OACD,QAKLG,EAAiBC,GAAuC,CAC5D,MAAMC,EAAuB,CAAA,EACvBC,EAAQC,GAA2B,CACvCF,EAAO,KAAKE,CAAI,EACZA,EAAK,UACPA,EAAK,SAAS,QAASC,GAAUF,EAAKE,CAAK,CAAC,CAEhD,EACA,OAAAJ,EAAO,QAASK,GAAMH,EAAKG,CAAC,CAAC,EACtBJ,CACT,EAEMK,EAAqBN,GAA+B,CACxD,MAAMO,MAAW,IACjBP,EAAO,QAASK,GAAM,CACpB,GAAIE,EAAK,IAAIF,EAAE,EAAE,EACf,MAAM,IAAI,MAAM,qCAAqCA,EAAE,EAAE,EAAE,E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M,UAAY,KAC3B,SAAUA,EAAM,QAAA,CACjB,EACD,MACF,CACIJ,EAAM,eAAeZ,CAAI,GACvBA,EAAK,OAASY,EAAM,UAEtBG,EADWf,EACF,MAAM,QAAQ,EAG7B,EACA,OAAAe,EAAMD,CAAQ,EACP8B,CACT,EAEanB,EAA2BX,GAAwD,CAC9F,MAAM+B,EAAYT,EAAmBtB,CAAQ,EAC7C,GAAI,CAAC+B,EACH,OAAO,KAET,GAAI,CAACA,EAAU,MAAQA,EAAU,KAAK,SAAW,EAC/C,MAAM,IAAI,MAAM,kEAAkE,EAEpF,GAAI,CAACA,EAAU,SAAWA,EAAU,QAAQ,SAAW,EACrD,MAAM,IAAI,MAAM,kEAAkE,EAEpF,GAAI,CAACA,EAAU,OAASA,EAAU,MAAM,SAAW,EACjD,MAAM,IAAI,MAAM,2DAA2D,EAG7E,MAAMC,EAAWD,EAAU,MAAM,OAC3BE,EAAWF,EAAU,MAAM,CAAC,GAAG,QAAU,EAC/C,GAAIC,IAAaD,EAAU,KAAK,OAC9B,MAAM,IAAI,MAAM,oBAAoBC,CAAQ,4BAA4BD,EAAU,KAAK,MAAM,IAAI,EAEnG,GAAIE,IAAaF,EAAU,QAAQ,OACjC,MAAM,IAAI,MAAM,uBAAuBE,CAAQ,+BAA+BF,EAAU,QAAQ,MAAM,IAAI,EAG5G,MAAO,CACL,MAAOA,EAAU,MACjB,KAAMA,EAAU,KAChB,QAASA,EAAU,QACnB,IAAKA,EAAU,IACf,MAAOA,EAAU,KAAA,CAErB"}
package/dist/config.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { G as d } from "./GridLayout-UWNxXw77.js";
3
+ import { G as d } from "./GridLayout-B4aCqSyd.js";
4
+ import "react-dom";
4
5
  import "./FloatingPanelFrame-3eU9AwPo.js";
5
- import "./FloatingWindow-CUXnEtrb.js";
6
+ import "./FloatingWindow-Bw2djgpz.js";
6
7
  const h = (i) => {
7
8
  const r = f(i);
8
9
  if (r === "grid" && !i.area)
@@ -140,7 +141,7 @@ const h = (i) => {
140
141
  }
141
142
  };
142
143
  return n(i), r;
143
- }, S = ({ config: i, style: r, children: n }) => {
144
+ }, k = ({ config: i, style: r, children: n }) => {
144
145
  const t = s.useMemo(() => E(n), [n]), e = s.useMemo(() => g(t), [t]), o = s.useMemo(() => {
145
146
  if (i)
146
147
  return i;
@@ -150,7 +151,7 @@ const h = (i) => {
150
151
  return l;
151
152
  }, [n, i]);
152
153
  return /* @__PURE__ */ u(d, { config: o, layers: e, style: r });
153
- }, b = () => null, k = () => null, F = () => null, z = () => null, C = () => null, I = () => null, p = (i, r) => {
154
+ }, b = () => null, F = () => null, V = () => null, z = () => null, C = () => null, I = () => null, p = (i, r) => {
154
155
  const n = [], t = (e) => {
155
156
  if (!(e == null || typeof e == "boolean")) {
156
157
  if (Array.isArray(e)) {
@@ -249,12 +250,12 @@ const h = (i) => {
249
250
  export {
250
251
  I as Areas,
251
252
  C as Col,
252
- F as Columns,
253
+ V as Columns,
253
254
  b as Config,
254
255
  v as Panel,
255
- S as PanelLayout,
256
+ k as PanelLayout,
256
257
  z as Row,
257
- k as Rows,
258
+ F as Rows,
258
259
  P as buildConfigFromChildren,
259
260
  E as buildRoutesFromChildren
260
261
  };