react-resizable-panels 0.0.38 → 0.0.39
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 +3 -0
- package/dist/react-resizable-panels.d.ts +1 -1
- package/dist/react-resizable-panels.d.ts.map +1 -1
- package/dist/react-resizable-panels.js +65 -52
- package/dist/react-resizable-panels.js.map +1 -1
- package/dist/react-resizable-panels.module.js +65 -52
- package/dist/react-resizable-panels.module.js.map +1 -1
- package/package.json +5 -1
- package/src/Panel.ts +1 -1
- package/src/PanelContexts.ts +1 -1
- package/src/PanelGroup.ts +4 -4
- package/src/PanelResizeHandle.ts +1 -1
- package/src/hooks/useIsomorphicEffect.ts +1 -1
- package/src/hooks/useUniqueId.ts +4 -8
- package/src/hooks/useWindowSplitterBehavior.ts +9 -2
- package/src/types.ts +1 -1
- package/src/vendor/react.ts +61 -0
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
import * as $jhddX$react from "react";
|
|
2
2
|
|
|
3
|
+
// This module exists to work around Webpack issue https://github.com/webpack/webpack/issues/14814
|
|
4
|
+
// and limitations with ParcelJS parsing of the useId workaround (used below).
|
|
5
|
+
// For the time being, all react-resizable-panels must import "react" with the "* as React" syntax.
|
|
6
|
+
// To avoid mistakes, we use the ESLint "no-restricted-imports" to prevent "react" imports except in this file.
|
|
7
|
+
// See https://github.com/bvaughn/react-resizable-panels/issues/118
|
|
8
|
+
// eslint-disable-next-line no-restricted-imports
|
|
9
|
+
|
|
10
|
+
const { createElement: $ef07efbe5fa7d87e$export$c8a8987d4410bf2d , createContext: $ef07efbe5fa7d87e$export$fd42f52fd3ae1109 , forwardRef: $ef07efbe5fa7d87e$export$257a8862b851cb5b , useCallback: $ef07efbe5fa7d87e$export$35808ee640e87ca7 , useContext: $ef07efbe5fa7d87e$export$fae74005e78b1a27 , useEffect: $ef07efbe5fa7d87e$export$6d9c69b0de29b591 , useImperativeHandle: $ef07efbe5fa7d87e$export$d5a552a76deda3c2 , useLayoutEffect: $ef07efbe5fa7d87e$export$e5c5a5f917a5871c , useMemo: $ef07efbe5fa7d87e$export$1538c33de8887b59 , useRef: $ef07efbe5fa7d87e$export$b8f5890fc79d6aca , useState: $ef07efbe5fa7d87e$export$60241385465d0a34 } = $jhddX$react;
|
|
11
|
+
// `toString()` prevents bundlers from trying to `import { useId } from 'react'`
|
|
12
|
+
const $ef07efbe5fa7d87e$export$f680877a34711e37 = $jhddX$react["useId".toString()];
|
|
13
|
+
|
|
3
14
|
|
|
4
15
|
|
|
5
16
|
const $3f95d3e171760903$var$canUseEffectHooks = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
6
|
-
const $3f95d3e171760903$var$useIsomorphicLayoutEffect = $3f95d3e171760903$var$canUseEffectHooks ? (0, $
|
|
17
|
+
const $3f95d3e171760903$var$useIsomorphicLayoutEffect = $3f95d3e171760903$var$canUseEffectHooks ? (0, $ef07efbe5fa7d87e$export$e5c5a5f917a5871c) : ()=>{};
|
|
7
18
|
var $3f95d3e171760903$export$2e2bcd8739ae039 = $3f95d3e171760903$var$useIsomorphicLayoutEffect;
|
|
8
19
|
|
|
9
20
|
|
|
10
21
|
|
|
11
|
-
|
|
12
|
-
// Support React versions older than 18.0
|
|
13
|
-
// Workaround for https://github.com/webpack/webpack/issues/14814
|
|
14
|
-
const $e504a2438473eda9$var$useId = $jhddX$react["useId".toString()];
|
|
22
|
+
const $e504a2438473eda9$var$wrappedUseId = typeof (0, $ef07efbe5fa7d87e$export$f680877a34711e37) === "function" ? (0, $ef07efbe5fa7d87e$export$f680877a34711e37) : ()=>null;
|
|
15
23
|
let $e504a2438473eda9$var$counter = 0;
|
|
16
24
|
function $e504a2438473eda9$export$2e2bcd8739ae039(idFromParams = null) {
|
|
17
|
-
const idFromUseId =
|
|
18
|
-
const idRef = (0, $
|
|
25
|
+
const idFromUseId = $e504a2438473eda9$var$wrappedUseId();
|
|
26
|
+
const idRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)(idFromParams || idFromUseId || null);
|
|
19
27
|
if (idRef.current === null) idRef.current = "" + $e504a2438473eda9$var$counter++;
|
|
20
28
|
return idRef.current;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
|
|
24
32
|
|
|
25
|
-
const $af466b485b9d515d$export$7d8c6d083caec74a = (0, $
|
|
33
|
+
const $af466b485b9d515d$export$7d8c6d083caec74a = (0, $ef07efbe5fa7d87e$export$fd42f52fd3ae1109)(null);
|
|
26
34
|
// Workaround for Parcel scope hoisting (which renames objects/functions).
|
|
27
35
|
// Casting to :any is required to avoid corrupting the generated TypeScript types.
|
|
28
36
|
// See github.com/parcel-bundler/parcel/issues/8724
|
|
@@ -30,16 +38,16 @@ $af466b485b9d515d$export$7d8c6d083caec74a.displayName = "PanelGroupContext";
|
|
|
30
38
|
|
|
31
39
|
|
|
32
40
|
function $c33df6d7c39fd3ee$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" }) {
|
|
33
|
-
const context = (0, $
|
|
41
|
+
const context = (0, $ef07efbe5fa7d87e$export$fae74005e78b1a27)((0, $af466b485b9d515d$export$7d8c6d083caec74a));
|
|
34
42
|
if (context === null) throw Error(`Panel components must be rendered within a PanelGroup container`);
|
|
35
43
|
const panelId = (0, $e504a2438473eda9$export$2e2bcd8739ae039)(idFromProps);
|
|
36
44
|
const { collapsePanel: collapsePanel , expandPanel: expandPanel , getPanelStyle: getPanelStyle , registerPanel: registerPanel , resizePanel: resizePanel , unregisterPanel: unregisterPanel } = context;
|
|
37
45
|
// Use a ref to guard against users passing inline props
|
|
38
|
-
const callbacksRef = (0, $
|
|
46
|
+
const callbacksRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
39
47
|
onCollapse: onCollapse,
|
|
40
48
|
onResize: onResize
|
|
41
49
|
});
|
|
42
|
-
(0, $
|
|
50
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
43
51
|
callbacksRef.current.onCollapse = onCollapse;
|
|
44
52
|
callbacksRef.current.onResize = onResize;
|
|
45
53
|
});
|
|
@@ -78,13 +86,13 @@ function $c33df6d7c39fd3ee$var$PanelWithForwardedRef({ children: children = null
|
|
|
78
86
|
unregisterPanel
|
|
79
87
|
]);
|
|
80
88
|
const style = getPanelStyle(panelId);
|
|
81
|
-
const committedValuesRef = (0, $
|
|
89
|
+
const committedValuesRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
82
90
|
size: $c33df6d7c39fd3ee$var$parseSizeFromStyle(style)
|
|
83
91
|
});
|
|
84
92
|
(0, $3f95d3e171760903$export$2e2bcd8739ae039)(()=>{
|
|
85
93
|
committedValuesRef.current.size = $c33df6d7c39fd3ee$var$parseSizeFromStyle(style);
|
|
86
94
|
});
|
|
87
|
-
(0, $
|
|
95
|
+
(0, $ef07efbe5fa7d87e$export$d5a552a76deda3c2)(forwardedRef, ()=>({
|
|
88
96
|
collapse: ()=>collapsePanel(panelId),
|
|
89
97
|
expand: ()=>expandPanel(panelId),
|
|
90
98
|
getCollapsed () {
|
|
@@ -100,7 +108,7 @@ function $c33df6d7c39fd3ee$var$PanelWithForwardedRef({ children: children = null
|
|
|
100
108
|
panelId,
|
|
101
109
|
resizePanel
|
|
102
110
|
]);
|
|
103
|
-
return (0, $
|
|
111
|
+
return (0, $ef07efbe5fa7d87e$export$c8a8987d4410bf2d)(Type, {
|
|
104
112
|
children: children,
|
|
105
113
|
className: classNameFromProps,
|
|
106
114
|
"data-panel": "",
|
|
@@ -114,7 +122,7 @@ function $c33df6d7c39fd3ee$var$PanelWithForwardedRef({ children: children = null
|
|
|
114
122
|
}
|
|
115
123
|
});
|
|
116
124
|
}
|
|
117
|
-
const $c33df6d7c39fd3ee$export$2ddb90ad54e5f587 = (0, $
|
|
125
|
+
const $c33df6d7c39fd3ee$export$2ddb90ad54e5f587 = (0, $ef07efbe5fa7d87e$export$257a8862b851cb5b)((props, ref)=>(0, $ef07efbe5fa7d87e$export$c8a8987d4410bf2d)($c33df6d7c39fd3ee$var$PanelWithForwardedRef, {
|
|
118
126
|
...props,
|
|
119
127
|
forwardedRef: ref
|
|
120
128
|
}));
|
|
@@ -423,7 +431,7 @@ function $8f51c2d77bf1da88$export$c4dfce035d43d1e0(event) {
|
|
|
423
431
|
|
|
424
432
|
|
|
425
433
|
function $4a90471e7083b52f$export$d9fcbe062527d159({ committedValuesRef: committedValuesRef , groupId: groupId , panels: panels , setSizes: setSizes , sizes: sizes , panelSizeBeforeCollapse: panelSizeBeforeCollapse }) {
|
|
426
|
-
(0, $
|
|
434
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
427
435
|
const { direction: direction , panels: panels } = committedValuesRef.current;
|
|
428
436
|
const groupElement = (0, $d6f7e4c3aa9e02d7$export$5e67632cf3550a9c)(groupId);
|
|
429
437
|
const { height: height , width: width } = groupElement.getBoundingClientRect();
|
|
@@ -490,13 +498,16 @@ function $4a90471e7083b52f$export$d9fcbe062527d159({ committedValuesRef: committ
|
|
|
490
498
|
cleanupFunctions.forEach((cleanupFunction)=>cleanupFunction());
|
|
491
499
|
};
|
|
492
500
|
}, [
|
|
501
|
+
committedValuesRef,
|
|
493
502
|
groupId,
|
|
494
503
|
panels,
|
|
504
|
+
panelSizeBeforeCollapse,
|
|
505
|
+
setSizes,
|
|
495
506
|
sizes
|
|
496
507
|
]);
|
|
497
508
|
}
|
|
498
509
|
function $4a90471e7083b52f$export$33b0bea6ac3ffb03({ disabled: disabled , handleId: handleId , resizeHandler: resizeHandler }) {
|
|
499
|
-
(0, $
|
|
510
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
500
511
|
if (disabled || resizeHandler == null) return;
|
|
501
512
|
const handleElement = (0, $d6f7e4c3aa9e02d7$export$2e27d3a347680388)(handleId);
|
|
502
513
|
if (handleElement == null) return;
|
|
@@ -605,26 +616,26 @@ const $3daa5d4c086ea816$var$defaultStorage = {
|
|
|
605
616
|
};
|
|
606
617
|
function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , children: children = null , className: classNameFromProps = "" , direction: direction , disablePointerEventsDuringResize: disablePointerEventsDuringResize = false , id: idFromProps = null , onLayout: onLayout = null , storage: storage = $3daa5d4c086ea816$var$defaultStorage , style: styleFromProps = {} , tagName: Type = "div" }) {
|
|
607
618
|
const groupId = (0, $e504a2438473eda9$export$2e2bcd8739ae039)(idFromProps);
|
|
608
|
-
const [activeHandleId, setActiveHandleId] = (0, $
|
|
609
|
-
const [panels, setPanels] = (0, $
|
|
619
|
+
const [activeHandleId, setActiveHandleId] = (0, $ef07efbe5fa7d87e$export$60241385465d0a34)(null);
|
|
620
|
+
const [panels, setPanels] = (0, $ef07efbe5fa7d87e$export$60241385465d0a34)(new Map());
|
|
610
621
|
// When resizing is done via mouse/touch event–
|
|
611
622
|
// We store the initial Panel sizes in this ref, and apply move deltas to them instead of to the current sizes.
|
|
612
623
|
// This has the benefit of causing force-collapsed panels to spring back open if drag is reversed.
|
|
613
|
-
const initialDragStateRef = (0, $
|
|
624
|
+
const initialDragStateRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)(null);
|
|
614
625
|
// Use a ref to guard against users passing inline props
|
|
615
|
-
const callbacksRef = (0, $
|
|
626
|
+
const callbacksRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
616
627
|
onLayout: onLayout
|
|
617
628
|
});
|
|
618
|
-
(0, $
|
|
629
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
619
630
|
callbacksRef.current.onLayout = onLayout;
|
|
620
631
|
});
|
|
621
632
|
// 0-1 values representing the relative size of each panel.
|
|
622
|
-
const [sizes, setSizes] = (0, $
|
|
633
|
+
const [sizes, setSizes] = (0, $ef07efbe5fa7d87e$export$60241385465d0a34)([]);
|
|
623
634
|
// Used to support imperative collapse/expand API.
|
|
624
|
-
const panelSizeBeforeCollapse = (0, $
|
|
625
|
-
const prevDeltaRef = (0, $
|
|
635
|
+
const panelSizeBeforeCollapse = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)(new Map());
|
|
636
|
+
const prevDeltaRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)(0);
|
|
626
637
|
// Store committed values to avoid unnecessarily re-running memoization/effects functions.
|
|
627
|
-
const committedValuesRef = (0, $
|
|
638
|
+
const committedValuesRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
628
639
|
direction: direction,
|
|
629
640
|
panels: panels,
|
|
630
641
|
sizes: sizes
|
|
@@ -643,7 +654,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
643
654
|
panelSizeBeforeCollapse: panelSizeBeforeCollapse
|
|
644
655
|
});
|
|
645
656
|
// Notify external code when sizes have changed.
|
|
646
|
-
(0, $
|
|
657
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
647
658
|
const { onLayout: onLayout } = callbacksRef.current;
|
|
648
659
|
if (onLayout) {
|
|
649
660
|
const { sizes: sizes } = committedValuesRef.current;
|
|
@@ -655,7 +666,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
655
666
|
]);
|
|
656
667
|
// Notify Panel listeners about their initial sizes and collapsed state after mount.
|
|
657
668
|
// Subsequent changes will be called by the resizeHandler.
|
|
658
|
-
const didNotifyCallbacksAfterMountRef = (0, $
|
|
669
|
+
const didNotifyCallbacksAfterMountRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)(false);
|
|
659
670
|
(0, $3f95d3e171760903$export$2e2bcd8739ae039)(()=>{
|
|
660
671
|
if (didNotifyCallbacksAfterMountRef.current) return;
|
|
661
672
|
const { panels: panels , sizes: sizes } = committedValuesRef.current;
|
|
@@ -705,9 +716,10 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
705
716
|
}
|
|
706
717
|
}, [
|
|
707
718
|
autoSaveId,
|
|
708
|
-
panels
|
|
719
|
+
panels,
|
|
720
|
+
storage
|
|
709
721
|
]);
|
|
710
|
-
(0, $
|
|
722
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
711
723
|
// If this panel has been configured to persist sizing information, save sizes to local storage.
|
|
712
724
|
if (autoSaveId) {
|
|
713
725
|
if (sizes.length === 0 || sizes.length !== panels.size) return;
|
|
@@ -717,9 +729,10 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
717
729
|
}, [
|
|
718
730
|
autoSaveId,
|
|
719
731
|
panels,
|
|
720
|
-
sizes
|
|
732
|
+
sizes,
|
|
733
|
+
storage
|
|
721
734
|
]);
|
|
722
|
-
const getPanelStyle = (0, $
|
|
735
|
+
const getPanelStyle = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id)=>{
|
|
723
736
|
const { panels: panels } = committedValuesRef.current;
|
|
724
737
|
// Before mounting, Panels will not yet have registered themselves.
|
|
725
738
|
// This includes server rendering.
|
|
@@ -744,10 +757,10 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
744
757
|
};
|
|
745
758
|
}, [
|
|
746
759
|
activeHandleId,
|
|
747
|
-
|
|
760
|
+
disablePointerEventsDuringResize,
|
|
748
761
|
sizes
|
|
749
762
|
]);
|
|
750
|
-
const registerPanel = (0, $
|
|
763
|
+
const registerPanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id, panel)=>{
|
|
751
764
|
setPanels((prevPanels)=>{
|
|
752
765
|
if (prevPanels.has(id)) return prevPanels;
|
|
753
766
|
const nextPanels = new Map(prevPanels);
|
|
@@ -755,7 +768,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
755
768
|
return nextPanels;
|
|
756
769
|
});
|
|
757
770
|
}, []);
|
|
758
|
-
const registerResizeHandle = (0, $
|
|
771
|
+
const registerResizeHandle = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((handleId)=>{
|
|
759
772
|
const resizeHandler = (event)=>{
|
|
760
773
|
event.preventDefault();
|
|
761
774
|
const { direction: direction , panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
@@ -798,7 +811,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
798
811
|
}, [
|
|
799
812
|
groupId
|
|
800
813
|
]);
|
|
801
|
-
const unregisterPanel = (0, $
|
|
814
|
+
const unregisterPanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id)=>{
|
|
802
815
|
setPanels((prevPanels)=>{
|
|
803
816
|
if (!prevPanels.has(id)) return prevPanels;
|
|
804
817
|
const nextPanels = new Map(prevPanels);
|
|
@@ -806,7 +819,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
806
819
|
return nextPanels;
|
|
807
820
|
});
|
|
808
821
|
}, []);
|
|
809
|
-
const collapsePanel = (0, $
|
|
822
|
+
const collapsePanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id)=>{
|
|
810
823
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
811
824
|
const panel = panels.get(id);
|
|
812
825
|
if (panel == null || !panel.collapsible) return;
|
|
@@ -828,7 +841,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
828
841
|
setSizes(nextSizes);
|
|
829
842
|
}
|
|
830
843
|
}, []);
|
|
831
|
-
const expandPanel = (0, $
|
|
844
|
+
const expandPanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id)=>{
|
|
832
845
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
833
846
|
const panel = panels.get(id);
|
|
834
847
|
if (panel == null) return;
|
|
@@ -851,7 +864,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
851
864
|
setSizes(nextSizes);
|
|
852
865
|
}
|
|
853
866
|
}, []);
|
|
854
|
-
const resizePanel = (0, $
|
|
867
|
+
const resizePanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id, nextSize)=>{
|
|
855
868
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
856
869
|
const panel = panels.get(id);
|
|
857
870
|
if (panel == null) return;
|
|
@@ -873,7 +886,7 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
873
886
|
setSizes(nextSizes);
|
|
874
887
|
}
|
|
875
888
|
}, []);
|
|
876
|
-
const context = (0, $
|
|
889
|
+
const context = (0, $ef07efbe5fa7d87e$export$1538c33de8887b59)(()=>({
|
|
877
890
|
activeHandleId: activeHandleId,
|
|
878
891
|
collapsePanel: collapsePanel,
|
|
879
892
|
direction: direction,
|
|
@@ -919,8 +932,8 @@ function $3daa5d4c086ea816$export$1d05749f6f573bb({ autoSaveId: autoSaveId , chi
|
|
|
919
932
|
overflow: "hidden",
|
|
920
933
|
width: "100%"
|
|
921
934
|
};
|
|
922
|
-
return (0, $
|
|
923
|
-
children: (0, $
|
|
935
|
+
return (0, $ef07efbe5fa7d87e$export$c8a8987d4410bf2d)((0, $af466b485b9d515d$export$7d8c6d083caec74a).Provider, {
|
|
936
|
+
children: (0, $ef07efbe5fa7d87e$export$c8a8987d4410bf2d)(Type, {
|
|
924
937
|
children: children,
|
|
925
938
|
className: classNameFromProps,
|
|
926
939
|
"data-panel-group": "",
|
|
@@ -946,22 +959,22 @@ $3daa5d4c086ea816$export$1d05749f6f573bb.displayName = "PanelGroup";
|
|
|
946
959
|
|
|
947
960
|
|
|
948
961
|
function $971f2c37f9d2b98e$export$8829ecf6b6b15484({ children: children = null , className: classNameFromProps = "" , disabled: disabled = false , id: idFromProps = null , onDragging: onDragging = null , style: styleFromProps = {} , tagName: Type = "div" }) {
|
|
949
|
-
const divElementRef = (0, $
|
|
962
|
+
const divElementRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)(null);
|
|
950
963
|
// Use a ref to guard against users passing inline props
|
|
951
|
-
const callbacksRef = (0, $
|
|
964
|
+
const callbacksRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
952
965
|
onDragging: onDragging
|
|
953
966
|
});
|
|
954
|
-
(0, $
|
|
967
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
955
968
|
callbacksRef.current.onDragging = onDragging;
|
|
956
969
|
});
|
|
957
|
-
const panelGroupContext = (0, $
|
|
970
|
+
const panelGroupContext = (0, $ef07efbe5fa7d87e$export$fae74005e78b1a27)((0, $af466b485b9d515d$export$7d8c6d083caec74a));
|
|
958
971
|
if (panelGroupContext === null) throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);
|
|
959
972
|
const { activeHandleId: activeHandleId , direction: direction , groupId: groupId , registerResizeHandle: registerResizeHandle , startDragging: startDragging , stopDragging: stopDragging } = panelGroupContext;
|
|
960
973
|
const resizeHandleId = (0, $e504a2438473eda9$export$2e2bcd8739ae039)(idFromProps);
|
|
961
974
|
const isDragging = activeHandleId === resizeHandleId;
|
|
962
|
-
const [isFocused, setIsFocused] = (0, $
|
|
963
|
-
const [resizeHandler, setResizeHandler] = (0, $
|
|
964
|
-
const stopDraggingAndBlur = (0, $
|
|
975
|
+
const [isFocused, setIsFocused] = (0, $ef07efbe5fa7d87e$export$60241385465d0a34)(false);
|
|
976
|
+
const [resizeHandler, setResizeHandler] = (0, $ef07efbe5fa7d87e$export$60241385465d0a34)(null);
|
|
977
|
+
const stopDraggingAndBlur = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)(()=>{
|
|
965
978
|
// Clicking on the drag handle shouldn't leave it focused;
|
|
966
979
|
// That would cause the PanelGroup to think it was still active.
|
|
967
980
|
const div = divElementRef.current;
|
|
@@ -972,7 +985,7 @@ function $971f2c37f9d2b98e$export$8829ecf6b6b15484({ children: children = null ,
|
|
|
972
985
|
}, [
|
|
973
986
|
stopDragging
|
|
974
987
|
]);
|
|
975
|
-
(0, $
|
|
988
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
976
989
|
if (disabled) setResizeHandler(null);
|
|
977
990
|
else {
|
|
978
991
|
const resizeHandler = registerResizeHandle(resizeHandleId);
|
|
@@ -983,7 +996,7 @@ function $971f2c37f9d2b98e$export$8829ecf6b6b15484({ children: children = null ,
|
|
|
983
996
|
resizeHandleId,
|
|
984
997
|
registerResizeHandle
|
|
985
998
|
]);
|
|
986
|
-
(0, $
|
|
999
|
+
(0, $ef07efbe5fa7d87e$export$6d9c69b0de29b591)(()=>{
|
|
987
1000
|
if (disabled || resizeHandler == null || !isDragging) return;
|
|
988
1001
|
const onMove = (event)=>{
|
|
989
1002
|
resizeHandler(event);
|
|
@@ -1024,7 +1037,7 @@ function $971f2c37f9d2b98e$export$8829ecf6b6b15484({ children: children = null ,
|
|
|
1024
1037
|
touchAction: "none",
|
|
1025
1038
|
userSelect: "none"
|
|
1026
1039
|
};
|
|
1027
|
-
return (0, $
|
|
1040
|
+
return (0, $ef07efbe5fa7d87e$export$c8a8987d4410bf2d)(Type, {
|
|
1028
1041
|
children: children,
|
|
1029
1042
|
className: classNameFromProps,
|
|
1030
1043
|
"data-resize-handle-active": isDragging ? "pointer" : isFocused ? "keyboard" : undefined,
|