react-resizable-panels 2.0.11 → 2.0.13
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/.parcel-cache/0e613961dce44a82 +0 -0
- package/.parcel-cache/13776de4870b0ae4.txt +2 -0
- package/.parcel-cache/35c20fb91e350b46 +0 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/dist/react-resizable-panels.browser.cjs.js +84 -47
- package/dist/react-resizable-panels.browser.development.cjs.js +84 -47
- package/dist/react-resizable-panels.browser.development.esm.js +84 -47
- package/dist/react-resizable-panels.browser.esm.js +84 -47
- package/dist/react-resizable-panels.cjs.js +84 -47
- package/dist/react-resizable-panels.development.cjs.js +84 -47
- package/dist/react-resizable-panels.development.esm.js +84 -47
- package/dist/react-resizable-panels.development.node.cjs.js +84 -47
- package/dist/react-resizable-panels.development.node.esm.js +84 -47
- package/dist/react-resizable-panels.esm.js +84 -47
- package/dist/react-resizable-panels.node.cjs.js +84 -47
- package/dist/react-resizable-panels.node.esm.js +84 -47
- package/package.json +9 -9
- package/src/PanelGroup.ts +8 -4
- package/src/hooks/useWindowSplitterPanelGroupBehavior.ts +2 -1
- package/src/utils/adjustLayoutByDelta.test.ts +268 -115
- package/src/utils/adjustLayoutByDelta.ts +51 -39
- package/src/utils/numbers/fuzzyLayoutsEqual.ts +22 -0
- package/src/vendor/stacking-order.ts +10 -4
package/src/PanelGroup.ts
CHANGED
|
@@ -355,9 +355,10 @@ function PanelGroupWithForwardedRef({
|
|
|
355
355
|
|
|
356
356
|
const nextLayout = adjustLayoutByDelta({
|
|
357
357
|
delta,
|
|
358
|
-
|
|
358
|
+
initialLayout: prevLayout,
|
|
359
359
|
panelConstraints: panelConstraintsArray,
|
|
360
360
|
pivotIndices,
|
|
361
|
+
prevLayout,
|
|
361
362
|
trigger: "imperative-api",
|
|
362
363
|
});
|
|
363
364
|
|
|
@@ -415,9 +416,10 @@ function PanelGroupWithForwardedRef({
|
|
|
415
416
|
|
|
416
417
|
const nextLayout = adjustLayoutByDelta({
|
|
417
418
|
delta,
|
|
418
|
-
|
|
419
|
+
initialLayout: prevLayout,
|
|
419
420
|
panelConstraints: panelConstraintsArray,
|
|
420
421
|
pivotIndices,
|
|
422
|
+
prevLayout,
|
|
421
423
|
trigger: "imperative-api",
|
|
422
424
|
});
|
|
423
425
|
|
|
@@ -636,9 +638,10 @@ function PanelGroupWithForwardedRef({
|
|
|
636
638
|
|
|
637
639
|
const nextLayout = adjustLayoutByDelta({
|
|
638
640
|
delta,
|
|
639
|
-
|
|
641
|
+
initialLayout: initialLayout ?? prevLayout,
|
|
640
642
|
panelConstraints,
|
|
641
643
|
pivotIndices,
|
|
644
|
+
prevLayout,
|
|
642
645
|
trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch",
|
|
643
646
|
});
|
|
644
647
|
|
|
@@ -722,9 +725,10 @@ function PanelGroupWithForwardedRef({
|
|
|
722
725
|
|
|
723
726
|
const nextLayout = adjustLayoutByDelta({
|
|
724
727
|
delta,
|
|
725
|
-
|
|
728
|
+
initialLayout: prevLayout,
|
|
726
729
|
panelConstraints: panelConstraintsArray,
|
|
727
730
|
pivotIndices,
|
|
731
|
+
prevLayout,
|
|
728
732
|
trigger: "imperative-api",
|
|
729
733
|
});
|
|
730
734
|
|
|
@@ -157,7 +157,7 @@ export function useWindowSplitterPanelGroupBehavior({
|
|
|
157
157
|
delta: fuzzyNumbersEqual(size, collapsedSize)
|
|
158
158
|
? minSize - collapsedSize
|
|
159
159
|
: collapsedSize - size,
|
|
160
|
-
layout,
|
|
160
|
+
initialLayout: layout,
|
|
161
161
|
panelConstraints: panelDataArray.map(
|
|
162
162
|
(panelData) => panelData.constraints
|
|
163
163
|
),
|
|
@@ -166,6 +166,7 @@ export function useWindowSplitterPanelGroupBehavior({
|
|
|
166
166
|
handleId,
|
|
167
167
|
panelGroupElement
|
|
168
168
|
),
|
|
169
|
+
prevLayout: layout,
|
|
169
170
|
trigger: "keyboard",
|
|
170
171
|
});
|
|
171
172
|
if (layout !== nextLayout) {
|