react-resizable-panels 0.0.38 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +22 -0
- package/CHANGELOG.md +6 -0
- package/README.md +2 -0
- package/dist/react-resizable-panels.d.ts +4 -4
- package/dist/react-resizable-panels.d.ts.map +1 -1
- package/dist/react-resizable-panels.js +104 -75
- package/dist/react-resizable-panels.js.map +1 -1
- package/dist/react-resizable-panels.module.js +104 -75
- package/dist/react-resizable-panels.module.js.map +1 -1
- package/package.json +6 -2
- package/src/Panel.ts +2 -2
- package/src/PanelContexts.ts +1 -1
- package/src/PanelGroup.ts +10 -10
- package/src/PanelResizeHandle.ts +5 -5
- package/src/hooks/useIsomorphicEffect.ts +1 -1
- package/src/hooks/useUniqueId.ts +4 -8
- package/src/hooks/useWindowSplitterBehavior.ts +16 -6
- package/src/types.ts +2 -2
- package/src/utils/assert.ts +10 -0
- package/src/utils/coordinates.ts +2 -2
- package/src/utils/debounce.ts +3 -1
- package/src/utils/group.ts +15 -3
- package/src/vendor/react.ts +61 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ignorePatterns": [".parcel-cache", "dist", "node_modules"],
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"parserOptions": { "project": ["../../tsconfig.json"] },
|
|
5
|
+
"plugins": ["@typescript-eslint", "no-restricted-imports", "react-hooks"],
|
|
6
|
+
"root": true,
|
|
7
|
+
"rules": {
|
|
8
|
+
"no-restricted-imports": [
|
|
9
|
+
"error",
|
|
10
|
+
{
|
|
11
|
+
"paths": ["react"]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"react-hooks/rules-of-hooks": "error",
|
|
15
|
+
"react-hooks/exhaustive-deps": [
|
|
16
|
+
"warn",
|
|
17
|
+
{
|
|
18
|
+
"additionalHooks": "(useIsomorphicLayoutEffect)"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.40
|
|
4
|
+
* README changes
|
|
5
|
+
|
|
6
|
+
## 0.0.39
|
|
7
|
+
* [#118](https://github.com/bvaughn/react-resizable-panels/issues/118): Fix import regression from 0.0.38.
|
|
8
|
+
|
|
3
9
|
## 0.0.38
|
|
4
10
|
* [#117](https://github.com/bvaughn/react-resizable-panels/issues/117): `Panel` collapse behavior works better near viewport edges.
|
|
5
11
|
* [#115](https://github.com/bvaughn/react-resizable-panels/pull/115): `PanelResizeHandle` logic calls `event.preventDefault` for events it handles.
|
package/README.md
CHANGED
|
@@ -19,6 +19,8 @@ import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
|
|
19
19
|
</PanelGroup>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
### If you like this project, 🎉 [become a sponsor](https://github.com/sponsors/bvaughn/) or ☕ [buy me a coffee](http://givebrian.coffee/)
|
|
23
|
+
|
|
22
24
|
## Props
|
|
23
25
|
|
|
24
26
|
### `PanelGroup`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSProperties, ElementType, ReactNode, RefObject } from "react";
|
|
2
2
|
type Direction = "horizontal" | "vertical";
|
|
3
3
|
export type PanelGroupStorage = {
|
|
4
4
|
getItem(name: string): string | null;
|
|
@@ -14,7 +14,7 @@ type PanelData = {
|
|
|
14
14
|
onResize: PanelOnResize | null;
|
|
15
15
|
}>;
|
|
16
16
|
collapsible: boolean;
|
|
17
|
-
defaultSize: number;
|
|
17
|
+
defaultSize: number | null;
|
|
18
18
|
id: string;
|
|
19
19
|
maxSize: number;
|
|
20
20
|
minSize: number;
|
|
@@ -56,7 +56,7 @@ export type PanelGroupProps = {
|
|
|
56
56
|
tagName?: ElementType;
|
|
57
57
|
};
|
|
58
58
|
export function PanelGroup({ autoSaveId, children, className: classNameFromProps, direction, disablePointerEventsDuringResize, id: idFromProps, onLayout, storage, style: styleFromProps, tagName: Type, }: PanelGroupProps): import("react").FunctionComponentElement<import("react").ProviderProps<{
|
|
59
|
-
activeHandleId: string;
|
|
59
|
+
activeHandleId: string | null;
|
|
60
60
|
collapsePanel: (id: string) => void;
|
|
61
61
|
direction: "horizontal" | "vertical";
|
|
62
62
|
expandPanel: (id: string) => void;
|
|
@@ -68,7 +68,7 @@ export function PanelGroup({ autoSaveId, children, className: classNameFromProps
|
|
|
68
68
|
startDragging: (id: string, event: ResizeEvent) => void;
|
|
69
69
|
stopDragging: () => void;
|
|
70
70
|
unregisterPanel: (id: string) => void;
|
|
71
|
-
}>>;
|
|
71
|
+
} | null>>;
|
|
72
72
|
export type PanelResizeHandleProps = {
|
|
73
73
|
children?: ReactNode;
|
|
74
74
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";
|
|
1
|
+
{"mappings":"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","sources":["packages/react-resizable-panels/src/src/vendor/react.ts","packages/react-resizable-panels/src/src/hooks/useIsomorphicEffect.ts","packages/react-resizable-panels/src/src/hooks/useUniqueId.ts","packages/react-resizable-panels/src/src/types.ts","packages/react-resizable-panels/src/src/PanelContexts.ts","packages/react-resizable-panels/src/src/Panel.ts","packages/react-resizable-panels/src/src/utils/serialization.ts","packages/react-resizable-panels/src/src/constants.ts","packages/react-resizable-panels/src/src/utils/group.ts","packages/react-resizable-panels/src/src/utils/coordinates.ts","packages/react-resizable-panels/src/src/utils/assert.ts","packages/react-resizable-panels/src/src/hooks/useWindowSplitterBehavior.ts","packages/react-resizable-panels/src/src/utils/cursor.ts","packages/react-resizable-panels/src/src/utils/debounce.ts","packages/react-resizable-panels/src/src/utils/arrays.ts","packages/react-resizable-panels/src/src/PanelGroup.ts","packages/react-resizable-panels/src/src/PanelResizeHandle.ts","packages/react-resizable-panels/src/src/index.ts","packages/react-resizable-panels/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"import { Panel } from \"./Panel\";\nimport { PanelGroup } from \"./PanelGroup\";\nimport { PanelResizeHandle } from \"./PanelResizeHandle\";\n\nimport type { ImperativePanelHandle, PanelProps } from \"./Panel\";\nimport type { PanelGroupProps } from \"./PanelGroup\";\nimport type { PanelResizeHandleProps } from \"./PanelResizeHandle\";\nimport type { PanelGroupStorage } from \"./types\";\n\nexport {\n Panel,\n PanelGroup,\n PanelResizeHandle,\n\n // TypeScript types\n ImperativePanelHandle,\n PanelGroupProps,\n PanelGroupStorage,\n PanelProps,\n PanelResizeHandleProps,\n};\n"],"names":[],"version":3,"file":"react-resizable-panels.d.ts.map"}
|
|
@@ -7,29 +7,37 @@ function $parcel$export(e, n, v, s) {
|
|
|
7
7
|
$parcel$export(module.exports, "Panel", () => $45da0e827c614f1d$export$2ddb90ad54e5f587);
|
|
8
8
|
$parcel$export(module.exports, "PanelGroup", () => $cec4cafe75f3db78$export$1d05749f6f573bb);
|
|
9
9
|
$parcel$export(module.exports, "PanelResizeHandle", () => $3a26a712c9163348$export$8829ecf6b6b15484);
|
|
10
|
+
// This module exists to work around Webpack issue https://github.com/webpack/webpack/issues/14814
|
|
11
|
+
// and limitations with ParcelJS parsing of the useId workaround (used below).
|
|
12
|
+
// For the time being, all react-resizable-panels must import "react" with the "* as React" syntax.
|
|
13
|
+
// To avoid mistakes, we use the ESLint "no-restricted-imports" to prevent "react" imports except in this file.
|
|
14
|
+
// See https://github.com/bvaughn/react-resizable-panels/issues/118
|
|
15
|
+
// eslint-disable-next-line no-restricted-imports
|
|
16
|
+
|
|
17
|
+
const { createElement: $6e687094f9ca8395$export$c8a8987d4410bf2d , createContext: $6e687094f9ca8395$export$fd42f52fd3ae1109 , forwardRef: $6e687094f9ca8395$export$257a8862b851cb5b , useCallback: $6e687094f9ca8395$export$35808ee640e87ca7 , useContext: $6e687094f9ca8395$export$fae74005e78b1a27 , useEffect: $6e687094f9ca8395$export$6d9c69b0de29b591 , useImperativeHandle: $6e687094f9ca8395$export$d5a552a76deda3c2 , useLayoutEffect: $6e687094f9ca8395$export$e5c5a5f917a5871c , useMemo: $6e687094f9ca8395$export$1538c33de8887b59 , useRef: $6e687094f9ca8395$export$b8f5890fc79d6aca , useState: $6e687094f9ca8395$export$60241385465d0a34 } = $2IMI0$react;
|
|
18
|
+
// `toString()` prevents bundlers from trying to `import { useId } from 'react'`
|
|
19
|
+
const $6e687094f9ca8395$export$f680877a34711e37 = $2IMI0$react["useId".toString()];
|
|
20
|
+
|
|
10
21
|
|
|
11
22
|
|
|
12
23
|
const $129b5b9a317dcc10$var$canUseEffectHooks = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
13
|
-
const $129b5b9a317dcc10$var$useIsomorphicLayoutEffect = $129b5b9a317dcc10$var$canUseEffectHooks ? (0, $
|
|
24
|
+
const $129b5b9a317dcc10$var$useIsomorphicLayoutEffect = $129b5b9a317dcc10$var$canUseEffectHooks ? (0, $6e687094f9ca8395$export$e5c5a5f917a5871c) : ()=>{};
|
|
14
25
|
var $129b5b9a317dcc10$export$2e2bcd8739ae039 = $129b5b9a317dcc10$var$useIsomorphicLayoutEffect;
|
|
15
26
|
|
|
16
27
|
|
|
17
28
|
|
|
18
|
-
|
|
19
|
-
// Support React versions older than 18.0
|
|
20
|
-
// Workaround for https://github.com/webpack/webpack/issues/14814
|
|
21
|
-
const $b1693d8d8f570e9c$var$useId = $2IMI0$react["useId".toString()];
|
|
29
|
+
const $b1693d8d8f570e9c$var$wrappedUseId = typeof (0, $6e687094f9ca8395$export$f680877a34711e37) === "function" ? (0, $6e687094f9ca8395$export$f680877a34711e37) : ()=>null;
|
|
22
30
|
let $b1693d8d8f570e9c$var$counter = 0;
|
|
23
31
|
function $b1693d8d8f570e9c$export$2e2bcd8739ae039(idFromParams = null) {
|
|
24
|
-
const idFromUseId =
|
|
25
|
-
const idRef = (0, $
|
|
32
|
+
const idFromUseId = $b1693d8d8f570e9c$var$wrappedUseId();
|
|
33
|
+
const idRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)(idFromParams || idFromUseId || null);
|
|
26
34
|
if (idRef.current === null) idRef.current = "" + $b1693d8d8f570e9c$var$counter++;
|
|
27
35
|
return idRef.current;
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
|
|
31
39
|
|
|
32
|
-
const $b9cf028330e7f243$export$7d8c6d083caec74a = (0, $
|
|
40
|
+
const $b9cf028330e7f243$export$7d8c6d083caec74a = (0, $6e687094f9ca8395$export$fd42f52fd3ae1109)(null);
|
|
33
41
|
// Workaround for Parcel scope hoisting (which renames objects/functions).
|
|
34
42
|
// Casting to :any is required to avoid corrupting the generated TypeScript types.
|
|
35
43
|
// See github.com/parcel-bundler/parcel/issues/8724
|
|
@@ -37,16 +45,16 @@ $b9cf028330e7f243$export$7d8c6d083caec74a.displayName = "PanelGroupContext";
|
|
|
37
45
|
|
|
38
46
|
|
|
39
47
|
function $45da0e827c614f1d$var$PanelWithForwardedRef({ children: children = null , className: classNameFromProps = "" , collapsible: collapsible = false , defaultSize: defaultSize = null , forwardedRef: forwardedRef , id: idFromProps = null , maxSize: maxSize = 100 , minSize: minSize = 10 , onCollapse: onCollapse = null , onResize: onResize = null , order: order = null , style: styleFromProps = {} , tagName: Type = "div" }) {
|
|
40
|
-
const context = (0, $
|
|
48
|
+
const context = (0, $6e687094f9ca8395$export$fae74005e78b1a27)((0, $b9cf028330e7f243$export$7d8c6d083caec74a));
|
|
41
49
|
if (context === null) throw Error(`Panel components must be rendered within a PanelGroup container`);
|
|
42
50
|
const panelId = (0, $b1693d8d8f570e9c$export$2e2bcd8739ae039)(idFromProps);
|
|
43
51
|
const { collapsePanel: collapsePanel , expandPanel: expandPanel , getPanelStyle: getPanelStyle , registerPanel: registerPanel , resizePanel: resizePanel , unregisterPanel: unregisterPanel } = context;
|
|
44
52
|
// Use a ref to guard against users passing inline props
|
|
45
|
-
const callbacksRef = (0, $
|
|
53
|
+
const callbacksRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)({
|
|
46
54
|
onCollapse: onCollapse,
|
|
47
55
|
onResize: onResize
|
|
48
56
|
});
|
|
49
|
-
(0, $
|
|
57
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
50
58
|
callbacksRef.current.onCollapse = onCollapse;
|
|
51
59
|
callbacksRef.current.onResize = onResize;
|
|
52
60
|
});
|
|
@@ -85,13 +93,13 @@ function $45da0e827c614f1d$var$PanelWithForwardedRef({ children: children = null
|
|
|
85
93
|
unregisterPanel
|
|
86
94
|
]);
|
|
87
95
|
const style = getPanelStyle(panelId);
|
|
88
|
-
const committedValuesRef = (0, $
|
|
96
|
+
const committedValuesRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)({
|
|
89
97
|
size: $45da0e827c614f1d$var$parseSizeFromStyle(style)
|
|
90
98
|
});
|
|
91
99
|
(0, $129b5b9a317dcc10$export$2e2bcd8739ae039)(()=>{
|
|
92
100
|
committedValuesRef.current.size = $45da0e827c614f1d$var$parseSizeFromStyle(style);
|
|
93
101
|
});
|
|
94
|
-
(0, $
|
|
102
|
+
(0, $6e687094f9ca8395$export$d5a552a76deda3c2)(forwardedRef, ()=>({
|
|
95
103
|
collapse: ()=>collapsePanel(panelId),
|
|
96
104
|
expand: ()=>expandPanel(panelId),
|
|
97
105
|
getCollapsed () {
|
|
@@ -107,7 +115,7 @@ function $45da0e827c614f1d$var$PanelWithForwardedRef({ children: children = null
|
|
|
107
115
|
panelId,
|
|
108
116
|
resizePanel
|
|
109
117
|
]);
|
|
110
|
-
return (0, $
|
|
118
|
+
return (0, $6e687094f9ca8395$export$c8a8987d4410bf2d)(Type, {
|
|
111
119
|
children: children,
|
|
112
120
|
className: classNameFromProps,
|
|
113
121
|
"data-panel": "",
|
|
@@ -121,7 +129,7 @@ function $45da0e827c614f1d$var$PanelWithForwardedRef({ children: children = null
|
|
|
121
129
|
}
|
|
122
130
|
});
|
|
123
131
|
}
|
|
124
|
-
const $45da0e827c614f1d$export$2ddb90ad54e5f587 = (0, $
|
|
132
|
+
const $45da0e827c614f1d$export$2ddb90ad54e5f587 = (0, $6e687094f9ca8395$export$257a8862b851cb5b)((props, ref)=>(0, $6e687094f9ca8395$export$c8a8987d4410bf2d)($45da0e827c614f1d$var$PanelWithForwardedRef, {
|
|
125
133
|
...props,
|
|
126
134
|
forwardedRef: ref
|
|
127
135
|
}));
|
|
@@ -215,34 +223,34 @@ function $cda3cc4b1114cf23$export$f50bae335f53943c(event, panels, idBefore, idAf
|
|
|
215
223
|
delta = delta < 0 ? baseSize - nextSize : nextSize - baseSize;
|
|
216
224
|
}
|
|
217
225
|
}
|
|
218
|
-
let
|
|
219
|
-
let
|
|
226
|
+
let pivotId = delta < 0 ? idBefore : idAfter;
|
|
227
|
+
let index = panelsArray.findIndex((panel)=>panel.id === pivotId);
|
|
220
228
|
while(true){
|
|
221
|
-
const
|
|
222
|
-
const
|
|
229
|
+
const panel = panelsArray[index];
|
|
230
|
+
const baseSize = baseSizes[index];
|
|
223
231
|
const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
if (
|
|
227
|
-
deltaApplied +=
|
|
228
|
-
nextSizes[
|
|
232
|
+
const nextSize = $cda3cc4b1114cf23$var$safeResizePanel(panel, 0 - deltaRemaining, baseSize, event);
|
|
233
|
+
if (baseSize !== nextSize) {
|
|
234
|
+
if (nextSize === 0 && baseSize > 0) panelSizeBeforeCollapse.set(panel.id, baseSize);
|
|
235
|
+
deltaApplied += baseSize - nextSize;
|
|
236
|
+
nextSizes[index] = nextSize;
|
|
229
237
|
if (deltaApplied.toPrecision((0, $9abd79656a89cd3a$export$d6d3992f3becc879)).localeCompare(Math.abs(delta).toPrecision((0, $9abd79656a89cd3a$export$d6d3992f3becc879)), undefined, {
|
|
230
238
|
numeric: true
|
|
231
239
|
}) >= 0) break;
|
|
232
240
|
}
|
|
233
241
|
if (delta < 0) {
|
|
234
|
-
if (--
|
|
242
|
+
if (--index < 0) break;
|
|
235
243
|
} else {
|
|
236
|
-
if (++
|
|
244
|
+
if (++index >= panelsArray.length) break;
|
|
237
245
|
}
|
|
238
246
|
}
|
|
239
247
|
// If we were unable to resize any of the panels panels, return the previous state.
|
|
240
248
|
// This will essentially bailout and ignore the "mousemove" event.
|
|
241
249
|
if (deltaApplied === 0) return baseSizes;
|
|
242
250
|
// Adjust the pivot panel before, but only by the amount that surrounding panels were able to shrink/contract.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
nextSizes[
|
|
251
|
+
pivotId = delta < 0 ? idAfter : idBefore;
|
|
252
|
+
index = panelsArray.findIndex((panel)=>panel.id === pivotId);
|
|
253
|
+
nextSizes[index] = baseSizes[index] + deltaApplied;
|
|
246
254
|
return nextSizes;
|
|
247
255
|
}
|
|
248
256
|
function $cda3cc4b1114cf23$export$b8e48269e4faa934(panelsArray, prevSizes, nextSizes) {
|
|
@@ -317,7 +325,7 @@ function $cda3cc4b1114cf23$export$68d3a33c21dfbe27(groupId, handleId, panelsArra
|
|
|
317
325
|
var _panelsArray_index, _panelsArray_;
|
|
318
326
|
const handle = $cda3cc4b1114cf23$export$2e27d3a347680388(handleId);
|
|
319
327
|
const handles = $cda3cc4b1114cf23$export$ae14931f0a0256a3(groupId);
|
|
320
|
-
const index = handles.indexOf(handle);
|
|
328
|
+
const index = handle ? handles.indexOf(handle) : -1;
|
|
321
329
|
var _panelsArray_index_id;
|
|
322
330
|
const idBefore = (_panelsArray_index_id = (_panelsArray_index = panelsArray[index]) === null || _panelsArray_index === void 0 ? void 0 : _panelsArray_index.id) !== null && _panelsArray_index_id !== void 0 ? _panelsArray_index_id : null;
|
|
323
331
|
var _panelsArray__id;
|
|
@@ -328,7 +336,14 @@ function $cda3cc4b1114cf23$export$68d3a33c21dfbe27(groupId, handleId, panelsArra
|
|
|
328
336
|
];
|
|
329
337
|
}
|
|
330
338
|
function $cda3cc4b1114cf23$export$a861c0ad45885494(panels) {
|
|
331
|
-
return Array.from(panels.values()).sort((
|
|
339
|
+
return Array.from(panels.values()).sort((panelA, panelB)=>{
|
|
340
|
+
const orderA = panelA.order;
|
|
341
|
+
const orderB = panelB.order;
|
|
342
|
+
if (orderA == null && orderB == null) return 0;
|
|
343
|
+
else if (orderA == null) return -1;
|
|
344
|
+
else if (orderB == null) return 1;
|
|
345
|
+
else return orderA - orderB;
|
|
346
|
+
});
|
|
332
347
|
}
|
|
333
348
|
function $cda3cc4b1114cf23$var$safeResizePanel(panel, delta, prevSize, event) {
|
|
334
349
|
const nextSizeUnsafe = prevSize + delta;
|
|
@@ -429,8 +444,16 @@ function $47eee9224cfec8e8$export$c4dfce035d43d1e0(event) {
|
|
|
429
444
|
|
|
430
445
|
|
|
431
446
|
|
|
447
|
+
function $3b727a2145ecd6f8$export$a7a9523472993e97(expectedCondition, message = "Assertion failed!") {
|
|
448
|
+
if (!expectedCondition) {
|
|
449
|
+
console.error(message);
|
|
450
|
+
throw Error(message);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
|
|
432
455
|
function $a695670cc57a5969$export$d9fcbe062527d159({ committedValuesRef: committedValuesRef , groupId: groupId , panels: panels , setSizes: setSizes , sizes: sizes , panelSizeBeforeCollapse: panelSizeBeforeCollapse }) {
|
|
433
|
-
(0, $
|
|
456
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
434
457
|
const { direction: direction , panels: panels } = committedValuesRef.current;
|
|
435
458
|
const groupElement = (0, $cda3cc4b1114cf23$export$5e67632cf3550a9c)(groupId);
|
|
436
459
|
const { height: height , width: width } = groupElement.getBoundingClientRect();
|
|
@@ -497,13 +520,16 @@ function $a695670cc57a5969$export$d9fcbe062527d159({ committedValuesRef: committ
|
|
|
497
520
|
cleanupFunctions.forEach((cleanupFunction)=>cleanupFunction());
|
|
498
521
|
};
|
|
499
522
|
}, [
|
|
523
|
+
committedValuesRef,
|
|
500
524
|
groupId,
|
|
501
525
|
panels,
|
|
526
|
+
panelSizeBeforeCollapse,
|
|
527
|
+
setSizes,
|
|
502
528
|
sizes
|
|
503
529
|
]);
|
|
504
530
|
}
|
|
505
531
|
function $a695670cc57a5969$export$33b0bea6ac3ffb03({ disabled: disabled , handleId: handleId , resizeHandler: resizeHandler }) {
|
|
506
|
-
(0, $
|
|
532
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
507
533
|
if (disabled || resizeHandler == null) return;
|
|
508
534
|
const handleElement = (0, $cda3cc4b1114cf23$export$2e27d3a347680388)(handleId);
|
|
509
535
|
if (handleElement == null) return;
|
|
@@ -524,6 +550,7 @@ function $a695670cc57a5969$export$33b0bea6ac3ffb03({ disabled: disabled , handle
|
|
|
524
550
|
event.preventDefault();
|
|
525
551
|
const handles = (0, $cda3cc4b1114cf23$export$8d0cd3c32ddc045e)();
|
|
526
552
|
const index = (0, $cda3cc4b1114cf23$export$96a40be80fb6c3c8)(handleId);
|
|
553
|
+
(0, $3b727a2145ecd6f8$export$a7a9523472993e97)(index !== null);
|
|
527
554
|
const nextIndex = event.shiftKey ? index > 0 ? index - 1 : handles.length - 1 : index + 1 < handles.length ? index + 1 : 0;
|
|
528
555
|
const nextHandle = handles[nextIndex];
|
|
529
556
|
nextHandle.focus();
|
|
@@ -583,7 +610,7 @@ function $08745f7373322b05$export$d395b5dfd066a659(state) {
|
|
|
583
610
|
function $2e8572579e31d898$export$2e2bcd8739ae039(callback, durationMs = 10) {
|
|
584
611
|
let timeoutId = null;
|
|
585
612
|
let callable = (...args)=>{
|
|
586
|
-
clearTimeout(timeoutId);
|
|
613
|
+
if (timeoutId !== null) clearTimeout(timeoutId);
|
|
587
614
|
timeoutId = setTimeout(()=>{
|
|
588
615
|
callback(...args);
|
|
589
616
|
}, durationMs);
|
|
@@ -610,28 +637,28 @@ const $cec4cafe75f3db78$var$defaultStorage = {
|
|
|
610
637
|
getItem: typeof localStorage !== "undefined" ? (name)=>localStorage.getItem(name) : $cec4cafe75f3db78$var$throwServerError,
|
|
611
638
|
setItem: typeof localStorage !== "undefined" ? (name, value)=>localStorage.setItem(name, value) : $cec4cafe75f3db78$var$throwServerError
|
|
612
639
|
};
|
|
613
|
-
function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , children: children = null , className: classNameFromProps = "" , direction: direction , disablePointerEventsDuringResize: disablePointerEventsDuringResize = false , id: idFromProps = null , onLayout: onLayout
|
|
640
|
+
function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , children: children = null , className: classNameFromProps = "" , direction: direction , disablePointerEventsDuringResize: disablePointerEventsDuringResize = false , id: idFromProps = null , onLayout: onLayout , storage: storage = $cec4cafe75f3db78$var$defaultStorage , style: styleFromProps = {} , tagName: Type = "div" }) {
|
|
614
641
|
const groupId = (0, $b1693d8d8f570e9c$export$2e2bcd8739ae039)(idFromProps);
|
|
615
|
-
const [activeHandleId, setActiveHandleId] = (0, $
|
|
616
|
-
const [panels, setPanels] = (0, $
|
|
642
|
+
const [activeHandleId, setActiveHandleId] = (0, $6e687094f9ca8395$export$60241385465d0a34)(null);
|
|
643
|
+
const [panels, setPanels] = (0, $6e687094f9ca8395$export$60241385465d0a34)(new Map());
|
|
617
644
|
// When resizing is done via mouse/touch event–
|
|
618
645
|
// We store the initial Panel sizes in this ref, and apply move deltas to them instead of to the current sizes.
|
|
619
646
|
// This has the benefit of causing force-collapsed panels to spring back open if drag is reversed.
|
|
620
|
-
const initialDragStateRef = (0, $
|
|
647
|
+
const initialDragStateRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)(null);
|
|
621
648
|
// Use a ref to guard against users passing inline props
|
|
622
|
-
const callbacksRef = (0, $
|
|
649
|
+
const callbacksRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)({
|
|
623
650
|
onLayout: onLayout
|
|
624
651
|
});
|
|
625
|
-
(0, $
|
|
652
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
626
653
|
callbacksRef.current.onLayout = onLayout;
|
|
627
654
|
});
|
|
628
655
|
// 0-1 values representing the relative size of each panel.
|
|
629
|
-
const [sizes, setSizes] = (0, $
|
|
656
|
+
const [sizes, setSizes] = (0, $6e687094f9ca8395$export$60241385465d0a34)([]);
|
|
630
657
|
// Used to support imperative collapse/expand API.
|
|
631
|
-
const panelSizeBeforeCollapse = (0, $
|
|
632
|
-
const prevDeltaRef = (0, $
|
|
658
|
+
const panelSizeBeforeCollapse = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)(new Map());
|
|
659
|
+
const prevDeltaRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)(0);
|
|
633
660
|
// Store committed values to avoid unnecessarily re-running memoization/effects functions.
|
|
634
|
-
const committedValuesRef = (0, $
|
|
661
|
+
const committedValuesRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)({
|
|
635
662
|
direction: direction,
|
|
636
663
|
panels: panels,
|
|
637
664
|
sizes: sizes
|
|
@@ -650,7 +677,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
650
677
|
panelSizeBeforeCollapse: panelSizeBeforeCollapse
|
|
651
678
|
});
|
|
652
679
|
// Notify external code when sizes have changed.
|
|
653
|
-
(0, $
|
|
680
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
654
681
|
const { onLayout: onLayout } = callbacksRef.current;
|
|
655
682
|
if (onLayout) {
|
|
656
683
|
const { sizes: sizes } = committedValuesRef.current;
|
|
@@ -662,7 +689,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
662
689
|
]);
|
|
663
690
|
// Notify Panel listeners about their initial sizes and collapsed state after mount.
|
|
664
691
|
// Subsequent changes will be called by the resizeHandler.
|
|
665
|
-
const didNotifyCallbacksAfterMountRef = (0, $
|
|
692
|
+
const didNotifyCallbacksAfterMountRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)(false);
|
|
666
693
|
(0, $129b5b9a317dcc10$export$2e2bcd8739ae039)(()=>{
|
|
667
694
|
if (didNotifyCallbacksAfterMountRef.current) return;
|
|
668
695
|
const { panels: panels , sizes: sizes } = committedValuesRef.current;
|
|
@@ -683,14 +710,14 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
683
710
|
return;
|
|
684
711
|
// If this panel has been configured to persist sizing information,
|
|
685
712
|
// default size should be restored from local storage if possible.
|
|
686
|
-
let defaultSizes =
|
|
713
|
+
let defaultSizes = null;
|
|
687
714
|
if (autoSaveId) {
|
|
688
715
|
const panelsArray = (0, $cda3cc4b1114cf23$export$a861c0ad45885494)(panels);
|
|
689
716
|
defaultSizes = (0, $f9cb001fbb908626$export$9c80c6617f0386da)(autoSaveId, panelsArray, storage);
|
|
690
717
|
}
|
|
691
718
|
if (defaultSizes != null) setSizes(defaultSizes);
|
|
692
719
|
else {
|
|
693
|
-
const
|
|
720
|
+
const panelsArray = (0, $cda3cc4b1114cf23$export$a861c0ad45885494)(panels);
|
|
694
721
|
let panelsWithNullDefaultSize = 0;
|
|
695
722
|
let totalDefaultSize = 0;
|
|
696
723
|
let totalMinSize = 0;
|
|
@@ -698,23 +725,24 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
698
725
|
// Implicit default size calculations below do not account for inferred min/max size values.
|
|
699
726
|
// e.g. if Panel A has a maxSize of 40 then Panels A and B can't both have an implicit default size of 50.
|
|
700
727
|
// For now, these logic edge cases are left to the user to handle via props.
|
|
701
|
-
|
|
728
|
+
panelsArray.forEach((panel)=>{
|
|
702
729
|
totalMinSize += panel.minSize;
|
|
703
730
|
if (panel.defaultSize === null) panelsWithNullDefaultSize++;
|
|
704
731
|
else totalDefaultSize += panel.defaultSize;
|
|
705
732
|
});
|
|
706
733
|
if (totalDefaultSize > 100) throw new Error(`The sum of the defaultSize of all panels in a group cannot exceed 100.`);
|
|
707
734
|
else if (totalMinSize > 100) throw new Error(`The sum of the minSize of all panels in a group cannot exceed 100.`);
|
|
708
|
-
setSizes(
|
|
735
|
+
setSizes(panelsArray.map((panel)=>{
|
|
709
736
|
if (panel.defaultSize === null) return (100 - totalDefaultSize) / panelsWithNullDefaultSize;
|
|
710
737
|
return panel.defaultSize;
|
|
711
738
|
}));
|
|
712
739
|
}
|
|
713
740
|
}, [
|
|
714
741
|
autoSaveId,
|
|
715
|
-
panels
|
|
742
|
+
panels,
|
|
743
|
+
storage
|
|
716
744
|
]);
|
|
717
|
-
(0, $
|
|
745
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
718
746
|
// If this panel has been configured to persist sizing information, save sizes to local storage.
|
|
719
747
|
if (autoSaveId) {
|
|
720
748
|
if (sizes.length === 0 || sizes.length !== panels.size) return;
|
|
@@ -724,9 +752,10 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
724
752
|
}, [
|
|
725
753
|
autoSaveId,
|
|
726
754
|
panels,
|
|
727
|
-
sizes
|
|
755
|
+
sizes,
|
|
756
|
+
storage
|
|
728
757
|
]);
|
|
729
|
-
const getPanelStyle = (0, $
|
|
758
|
+
const getPanelStyle = (0, $6e687094f9ca8395$export$35808ee640e87ca7)((id)=>{
|
|
730
759
|
const { panels: panels } = committedValuesRef.current;
|
|
731
760
|
// Before mounting, Panels will not yet have registered themselves.
|
|
732
761
|
// This includes server rendering.
|
|
@@ -751,10 +780,10 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
751
780
|
};
|
|
752
781
|
}, [
|
|
753
782
|
activeHandleId,
|
|
754
|
-
|
|
783
|
+
disablePointerEventsDuringResize,
|
|
755
784
|
sizes
|
|
756
785
|
]);
|
|
757
|
-
const registerPanel = (0, $
|
|
786
|
+
const registerPanel = (0, $6e687094f9ca8395$export$35808ee640e87ca7)((id, panel)=>{
|
|
758
787
|
setPanels((prevPanels)=>{
|
|
759
788
|
if (prevPanels.has(id)) return prevPanels;
|
|
760
789
|
const nextPanels = new Map(prevPanels);
|
|
@@ -762,7 +791,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
762
791
|
return nextPanels;
|
|
763
792
|
});
|
|
764
793
|
}, []);
|
|
765
|
-
const registerResizeHandle = (0, $
|
|
794
|
+
const registerResizeHandle = (0, $6e687094f9ca8395$export$35808ee640e87ca7)((handleId)=>{
|
|
766
795
|
const resizeHandler = (event)=>{
|
|
767
796
|
event.preventDefault();
|
|
768
797
|
const { direction: direction , panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
@@ -805,7 +834,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
805
834
|
}, [
|
|
806
835
|
groupId
|
|
807
836
|
]);
|
|
808
|
-
const unregisterPanel = (0, $
|
|
837
|
+
const unregisterPanel = (0, $6e687094f9ca8395$export$35808ee640e87ca7)((id)=>{
|
|
809
838
|
setPanels((prevPanels)=>{
|
|
810
839
|
if (!prevPanels.has(id)) return prevPanels;
|
|
811
840
|
const nextPanels = new Map(prevPanels);
|
|
@@ -813,7 +842,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
813
842
|
return nextPanels;
|
|
814
843
|
});
|
|
815
844
|
}, []);
|
|
816
|
-
const collapsePanel = (0, $
|
|
845
|
+
const collapsePanel = (0, $6e687094f9ca8395$export$35808ee640e87ca7)((id)=>{
|
|
817
846
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
818
847
|
const panel = panels.get(id);
|
|
819
848
|
if (panel == null || !panel.collapsible) return;
|
|
@@ -835,7 +864,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
835
864
|
setSizes(nextSizes);
|
|
836
865
|
}
|
|
837
866
|
}, []);
|
|
838
|
-
const expandPanel = (0, $
|
|
867
|
+
const expandPanel = (0, $6e687094f9ca8395$export$35808ee640e87ca7)((id)=>{
|
|
839
868
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
840
869
|
const panel = panels.get(id);
|
|
841
870
|
if (panel == null) return;
|
|
@@ -858,7 +887,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
858
887
|
setSizes(nextSizes);
|
|
859
888
|
}
|
|
860
889
|
}, []);
|
|
861
|
-
const resizePanel = (0, $
|
|
890
|
+
const resizePanel = (0, $6e687094f9ca8395$export$35808ee640e87ca7)((id, nextSize)=>{
|
|
862
891
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
863
892
|
const panel = panels.get(id);
|
|
864
893
|
if (panel == null) return;
|
|
@@ -880,7 +909,7 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
880
909
|
setSizes(nextSizes);
|
|
881
910
|
}
|
|
882
911
|
}, []);
|
|
883
|
-
const context = (0, $
|
|
912
|
+
const context = (0, $6e687094f9ca8395$export$1538c33de8887b59)(()=>({
|
|
884
913
|
activeHandleId: activeHandleId,
|
|
885
914
|
collapsePanel: collapsePanel,
|
|
886
915
|
direction: direction,
|
|
@@ -926,8 +955,8 @@ function $cec4cafe75f3db78$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
926
955
|
overflow: "hidden",
|
|
927
956
|
width: "100%"
|
|
928
957
|
};
|
|
929
|
-
return (0, $
|
|
930
|
-
children: (0, $
|
|
958
|
+
return (0, $6e687094f9ca8395$export$c8a8987d4410bf2d)((0, $b9cf028330e7f243$export$7d8c6d083caec74a).Provider, {
|
|
959
|
+
children: (0, $6e687094f9ca8395$export$c8a8987d4410bf2d)(Type, {
|
|
931
960
|
children: children,
|
|
932
961
|
className: classNameFromProps,
|
|
933
962
|
"data-panel-group": "",
|
|
@@ -952,23 +981,23 @@ $cec4cafe75f3db78$export$1d05749f6f573bb.displayName = "PanelGroup";
|
|
|
952
981
|
|
|
953
982
|
|
|
954
983
|
|
|
955
|
-
function $3a26a712c9163348$export$8829ecf6b6b15484({ children: children = null , className: classNameFromProps = "" , disabled: disabled = false , id: idFromProps = null , onDragging: onDragging
|
|
956
|
-
const divElementRef = (0, $
|
|
984
|
+
function $3a26a712c9163348$export$8829ecf6b6b15484({ children: children = null , className: classNameFromProps = "" , disabled: disabled = false , id: idFromProps = null , onDragging: onDragging , style: styleFromProps = {} , tagName: Type = "div" }) {
|
|
985
|
+
const divElementRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)(null);
|
|
957
986
|
// Use a ref to guard against users passing inline props
|
|
958
|
-
const callbacksRef = (0, $
|
|
987
|
+
const callbacksRef = (0, $6e687094f9ca8395$export$b8f5890fc79d6aca)({
|
|
959
988
|
onDragging: onDragging
|
|
960
989
|
});
|
|
961
|
-
(0, $
|
|
990
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
962
991
|
callbacksRef.current.onDragging = onDragging;
|
|
963
992
|
});
|
|
964
|
-
const panelGroupContext = (0, $
|
|
993
|
+
const panelGroupContext = (0, $6e687094f9ca8395$export$fae74005e78b1a27)((0, $b9cf028330e7f243$export$7d8c6d083caec74a));
|
|
965
994
|
if (panelGroupContext === null) throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);
|
|
966
995
|
const { activeHandleId: activeHandleId , direction: direction , groupId: groupId , registerResizeHandle: registerResizeHandle , startDragging: startDragging , stopDragging: stopDragging } = panelGroupContext;
|
|
967
996
|
const resizeHandleId = (0, $b1693d8d8f570e9c$export$2e2bcd8739ae039)(idFromProps);
|
|
968
997
|
const isDragging = activeHandleId === resizeHandleId;
|
|
969
|
-
const [isFocused, setIsFocused] = (0, $
|
|
970
|
-
const [resizeHandler, setResizeHandler] = (0, $
|
|
971
|
-
const stopDraggingAndBlur = (0, $
|
|
998
|
+
const [isFocused, setIsFocused] = (0, $6e687094f9ca8395$export$60241385465d0a34)(false);
|
|
999
|
+
const [resizeHandler, setResizeHandler] = (0, $6e687094f9ca8395$export$60241385465d0a34)(null);
|
|
1000
|
+
const stopDraggingAndBlur = (0, $6e687094f9ca8395$export$35808ee640e87ca7)(()=>{
|
|
972
1001
|
// Clicking on the drag handle shouldn't leave it focused;
|
|
973
1002
|
// That would cause the PanelGroup to think it was still active.
|
|
974
1003
|
const div = divElementRef.current;
|
|
@@ -979,7 +1008,7 @@ function $3a26a712c9163348$export$8829ecf6b6b15484({ children: children = null ,
|
|
|
979
1008
|
}, [
|
|
980
1009
|
stopDragging
|
|
981
1010
|
]);
|
|
982
|
-
(0, $
|
|
1011
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
983
1012
|
if (disabled) setResizeHandler(null);
|
|
984
1013
|
else {
|
|
985
1014
|
const resizeHandler = registerResizeHandle(resizeHandleId);
|
|
@@ -990,7 +1019,7 @@ function $3a26a712c9163348$export$8829ecf6b6b15484({ children: children = null ,
|
|
|
990
1019
|
resizeHandleId,
|
|
991
1020
|
registerResizeHandle
|
|
992
1021
|
]);
|
|
993
|
-
(0, $
|
|
1022
|
+
(0, $6e687094f9ca8395$export$6d9c69b0de29b591)(()=>{
|
|
994
1023
|
if (disabled || resizeHandler == null || !isDragging) return;
|
|
995
1024
|
const onMove = (event)=>{
|
|
996
1025
|
resizeHandler(event);
|
|
@@ -1031,7 +1060,7 @@ function $3a26a712c9163348$export$8829ecf6b6b15484({ children: children = null ,
|
|
|
1031
1060
|
touchAction: "none",
|
|
1032
1061
|
userSelect: "none"
|
|
1033
1062
|
};
|
|
1034
|
-
return (0, $
|
|
1063
|
+
return (0, $6e687094f9ca8395$export$c8a8987d4410bf2d)(Type, {
|
|
1035
1064
|
children: children,
|
|
1036
1065
|
className: classNameFromProps,
|
|
1037
1066
|
"data-resize-handle-active": isDragging ? "pointer" : isFocused ? "keyboard" : undefined,
|