react-resizable-panels 0.0.43 → 0.0.44
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/CHANGELOG.md +3 -0
- package/dist/react-resizable-panels.d.ts.map +1 -1
- package/dist/react-resizable-panels.js +66 -65
- package/dist/react-resizable-panels.js.map +1 -1
- package/dist/react-resizable-panels.module.js +66 -65
- package/dist/react-resizable-panels.module.js.map +1 -1
- package/package.json +1 -1
- package/src/Panel.ts +41 -30
- package/src/PanelGroup.ts +14 -11
- package/src/hooks/useWindowSplitterBehavior.ts +7 -7
- package/src/types.ts +14 -10
- package/src/utils/coordinates.ts +5 -5
- package/src/utils/group.ts +20 -18
- package/src/utils/serialization.ts +1 -1
|
@@ -12,7 +12,6 @@ const { createElement: $ef07efbe5fa7d87e$export$c8a8987d4410bf2d , createContext
|
|
|
12
12
|
const $ef07efbe5fa7d87e$export$f680877a34711e37 = $jhddX$react["useId".toString()];
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
const $3f95d3e171760903$var$canUseEffectHooks = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
17
16
|
const $3f95d3e171760903$var$useIsomorphicLayoutEffect = $3f95d3e171760903$var$canUseEffectHooks ? (0, $ef07efbe5fa7d87e$export$e5c5a5f917a5871c) : ()=>{};
|
|
18
17
|
var $3f95d3e171760903$export$2e2bcd8739ae039 = $3f95d3e171760903$var$useIsomorphicLayoutEffect;
|
|
@@ -30,6 +29,7 @@ function $e504a2438473eda9$export$2e2bcd8739ae039(idFromParams = null) {
|
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
|
|
32
|
+
|
|
33
33
|
const $af466b485b9d515d$export$7d8c6d083caec74a = (0, $ef07efbe5fa7d87e$export$fd42f52fd3ae1109)(null);
|
|
34
34
|
// Workaround for Parcel scope hoisting (which renames objects/functions).
|
|
35
35
|
// Casting to :any is required to avoid corrupting the generated TypeScript types.
|
|
@@ -61,37 +61,38 @@ function $c33df6d7c39fd3ee$var$PanelWithForwardedRef({ children: children = null
|
|
|
61
61
|
defaultSize = minSize;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
const style = getPanelStyle(panelId);
|
|
65
|
+
const committedValuesRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
66
|
+
size: $c33df6d7c39fd3ee$var$parseSizeFromStyle(style)
|
|
67
|
+
});
|
|
68
|
+
const panelDataRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
69
|
+
callbacksRef: callbacksRef,
|
|
70
|
+
collapsible: collapsible,
|
|
71
|
+
defaultSize: defaultSize,
|
|
72
|
+
id: panelId,
|
|
73
|
+
maxSize: maxSize,
|
|
74
|
+
minSize: minSize,
|
|
75
|
+
order: order
|
|
76
|
+
});
|
|
64
77
|
(0, $3f95d3e171760903$export$2e2bcd8739ae039)(()=>{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
committedValuesRef.current.size = $c33df6d7c39fd3ee$var$parseSizeFromStyle(style);
|
|
79
|
+
panelDataRef.current.callbacksRef = callbacksRef;
|
|
80
|
+
panelDataRef.current.collapsible = collapsible;
|
|
81
|
+
panelDataRef.current.defaultSize = defaultSize;
|
|
82
|
+
panelDataRef.current.id = panelId;
|
|
83
|
+
panelDataRef.current.maxSize = maxSize;
|
|
84
|
+
panelDataRef.current.minSize = minSize;
|
|
85
|
+
panelDataRef.current.order = order;
|
|
86
|
+
});
|
|
87
|
+
(0, $3f95d3e171760903$export$2e2bcd8739ae039)(()=>{
|
|
88
|
+
registerPanel(panelId, panelDataRef);
|
|
75
89
|
return ()=>{
|
|
76
90
|
unregisterPanel(panelId);
|
|
77
91
|
};
|
|
78
92
|
}, [
|
|
79
|
-
collapsible,
|
|
80
|
-
defaultSize,
|
|
81
|
-
panelId,
|
|
82
|
-
maxSize,
|
|
83
|
-
minSize,
|
|
84
|
-
order,
|
|
85
93
|
registerPanel,
|
|
86
94
|
unregisterPanel
|
|
87
95
|
]);
|
|
88
|
-
const style = getPanelStyle(panelId);
|
|
89
|
-
const committedValuesRef = (0, $ef07efbe5fa7d87e$export$b8f5890fc79d6aca)({
|
|
90
|
-
size: $c33df6d7c39fd3ee$var$parseSizeFromStyle(style)
|
|
91
|
-
});
|
|
92
|
-
(0, $3f95d3e171760903$export$2e2bcd8739ae039)(()=>{
|
|
93
|
-
committedValuesRef.current.size = $c33df6d7c39fd3ee$var$parseSizeFromStyle(style);
|
|
94
|
-
});
|
|
95
96
|
(0, $ef07efbe5fa7d87e$export$d5a552a76deda3c2)(forwardedRef, ()=>({
|
|
96
97
|
collapse: ()=>collapsePanel(panelId),
|
|
97
98
|
expand: ()=>expandPanel(panelId),
|
|
@@ -166,7 +167,7 @@ function $d6f7e4c3aa9e02d7$export$f50bae335f53943c(event, panels, idBefore, idAf
|
|
|
166
167
|
// Max-bounds check the panel being expanded first.
|
|
167
168
|
{
|
|
168
169
|
const pivotId = delta < 0 ? idAfter : idBefore;
|
|
169
|
-
const index = panelsArray.findIndex((panel)=>panel.id === pivotId);
|
|
170
|
+
const index = panelsArray.findIndex((panel)=>panel.current.id === pivotId);
|
|
170
171
|
const panel = panelsArray[index];
|
|
171
172
|
const baseSize = baseSizes[index];
|
|
172
173
|
const nextSize = $d6f7e4c3aa9e02d7$var$safeResizePanel(panel, Math.abs(delta), baseSize, event);
|
|
@@ -178,14 +179,14 @@ function $d6f7e4c3aa9e02d7$export$f50bae335f53943c(event, panels, idBefore, idAf
|
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
let pivotId = delta < 0 ? idBefore : idAfter;
|
|
181
|
-
let index = panelsArray.findIndex((panel)=>panel.id === pivotId);
|
|
182
|
+
let index = panelsArray.findIndex((panel)=>panel.current.id === pivotId);
|
|
182
183
|
while(true){
|
|
183
184
|
const panel = panelsArray[index];
|
|
184
185
|
const baseSize = baseSizes[index];
|
|
185
186
|
const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
|
|
186
187
|
const nextSize = $d6f7e4c3aa9e02d7$var$safeResizePanel(panel, 0 - deltaRemaining, baseSize, event);
|
|
187
188
|
if (baseSize !== nextSize) {
|
|
188
|
-
if (nextSize === 0 && baseSize > 0) panelSizeBeforeCollapse.set(panel.id, baseSize);
|
|
189
|
+
if (nextSize === 0 && baseSize > 0) panelSizeBeforeCollapse.set(panel.current.id, baseSize);
|
|
189
190
|
deltaApplied += baseSize - nextSize;
|
|
190
191
|
nextSizes[index] = nextSize;
|
|
191
192
|
if (deltaApplied.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879)).localeCompare(Math.abs(delta).toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879)), undefined, {
|
|
@@ -203,7 +204,7 @@ function $d6f7e4c3aa9e02d7$export$f50bae335f53943c(event, panels, idBefore, idAf
|
|
|
203
204
|
if (deltaApplied === 0) return baseSizes;
|
|
204
205
|
// Adjust the pivot panel before, but only by the amount that surrounding panels were able to shrink/contract.
|
|
205
206
|
pivotId = delta < 0 ? idAfter : idBefore;
|
|
206
|
-
index = panelsArray.findIndex((panel)=>panel.id === pivotId);
|
|
207
|
+
index = panelsArray.findIndex((panel)=>panel.current.id === pivotId);
|
|
207
208
|
nextSizes[index] = baseSizes[index] + deltaApplied;
|
|
208
209
|
return nextSizes;
|
|
209
210
|
}
|
|
@@ -211,7 +212,7 @@ function $d6f7e4c3aa9e02d7$export$b8e48269e4faa934(panelsArray, prevSizes, nextS
|
|
|
211
212
|
nextSizes.forEach((nextSize, index)=>{
|
|
212
213
|
const prevSize = prevSizes[index];
|
|
213
214
|
if (prevSize !== nextSize) {
|
|
214
|
-
const { callbacksRef: callbacksRef , collapsible: collapsible } = panelsArray[index];
|
|
215
|
+
const { callbacksRef: callbacksRef , collapsible: collapsible } = panelsArray[index].current;
|
|
215
216
|
const { onCollapse: onCollapse , onResize: onResize } = callbacksRef.current;
|
|
216
217
|
if (onResize) onResize(nextSize);
|
|
217
218
|
if (collapsible && onCollapse) {
|
|
@@ -228,14 +229,14 @@ function $d6f7e4c3aa9e02d7$export$5a5b0c1d38c23c3b(id, panelsArray) {
|
|
|
228
229
|
null,
|
|
229
230
|
null
|
|
230
231
|
];
|
|
231
|
-
const index = panelsArray.findIndex((panel)=>panel.id === id);
|
|
232
|
+
const index = panelsArray.findIndex((panel)=>panel.current.id === id);
|
|
232
233
|
if (index < 0) return [
|
|
233
234
|
null,
|
|
234
235
|
null
|
|
235
236
|
];
|
|
236
237
|
const isLastPanel = index === panelsArray.length - 1;
|
|
237
|
-
const idBefore = isLastPanel ? panelsArray[index - 1].id : id;
|
|
238
|
-
const idAfter = isLastPanel ? id : panelsArray[index + 1].id;
|
|
238
|
+
const idBefore = isLastPanel ? panelsArray[index - 1].current.id : id;
|
|
239
|
+
const idAfter = isLastPanel ? id : panelsArray[index + 1].current.id;
|
|
239
240
|
return [
|
|
240
241
|
idBefore,
|
|
241
242
|
idAfter
|
|
@@ -244,7 +245,7 @@ function $d6f7e4c3aa9e02d7$export$5a5b0c1d38c23c3b(id, panelsArray) {
|
|
|
244
245
|
function $d6f7e4c3aa9e02d7$export$6f43503e166de6fb(panels, id, sizes) {
|
|
245
246
|
if (panels.size === 1) return "100";
|
|
246
247
|
const panelsArray = $d6f7e4c3aa9e02d7$export$a861c0ad45885494(panels);
|
|
247
|
-
const index = panelsArray.findIndex((panel)=>panel.id === id);
|
|
248
|
+
const index = panelsArray.findIndex((panel)=>panel.current.id === id);
|
|
248
249
|
const size = sizes[index];
|
|
249
250
|
if (size == null) return "0";
|
|
250
251
|
return size.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879));
|
|
@@ -276,14 +277,14 @@ function $d6f7e4c3aa9e02d7$export$ae14931f0a0256a3(groupId) {
|
|
|
276
277
|
return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${groupId}"]`));
|
|
277
278
|
}
|
|
278
279
|
function $d6f7e4c3aa9e02d7$export$68d3a33c21dfbe27(groupId, handleId, panelsArray) {
|
|
279
|
-
var _panelsArray_index, _panelsArray_;
|
|
280
|
+
var _panelsArray_index, _panelsArray_index_current, _panelsArray_, _panelsArray__current;
|
|
280
281
|
const handle = $d6f7e4c3aa9e02d7$export$2e27d3a347680388(handleId);
|
|
281
282
|
const handles = $d6f7e4c3aa9e02d7$export$ae14931f0a0256a3(groupId);
|
|
282
283
|
const index = handle ? handles.indexOf(handle) : -1;
|
|
283
|
-
var
|
|
284
|
-
const idBefore = (
|
|
285
|
-
var
|
|
286
|
-
const idAfter = (
|
|
284
|
+
var _panelsArray_index_current_id;
|
|
285
|
+
const idBefore = (_panelsArray_index_current_id = (_panelsArray_index = panelsArray[index]) === null || _panelsArray_index === void 0 ? void 0 : (_panelsArray_index_current = _panelsArray_index.current) === null || _panelsArray_index_current === void 0 ? void 0 : _panelsArray_index_current.id) !== null && _panelsArray_index_current_id !== void 0 ? _panelsArray_index_current_id : null;
|
|
286
|
+
var _panelsArray__current_id;
|
|
287
|
+
const idAfter = (_panelsArray__current_id = (_panelsArray_ = panelsArray[index + 1]) === null || _panelsArray_ === void 0 ? void 0 : (_panelsArray__current = _panelsArray_.current) === null || _panelsArray__current === void 0 ? void 0 : _panelsArray__current.id) !== null && _panelsArray__current_id !== void 0 ? _panelsArray__current_id : null;
|
|
287
288
|
return [
|
|
288
289
|
idBefore,
|
|
289
290
|
idAfter
|
|
@@ -291,8 +292,8 @@ function $d6f7e4c3aa9e02d7$export$68d3a33c21dfbe27(groupId, handleId, panelsArra
|
|
|
291
292
|
}
|
|
292
293
|
function $d6f7e4c3aa9e02d7$export$a861c0ad45885494(panels) {
|
|
293
294
|
return Array.from(panels.values()).sort((panelA, panelB)=>{
|
|
294
|
-
const orderA = panelA.order;
|
|
295
|
-
const orderB = panelB.order;
|
|
295
|
+
const orderA = panelA.current.order;
|
|
296
|
+
const orderB = panelB.current.order;
|
|
296
297
|
if (orderA == null && orderB == null) return 0;
|
|
297
298
|
else if (orderA == null) return -1;
|
|
298
299
|
else if (orderB == null) return 1;
|
|
@@ -301,7 +302,7 @@ function $d6f7e4c3aa9e02d7$export$a861c0ad45885494(panels) {
|
|
|
301
302
|
}
|
|
302
303
|
function $d6f7e4c3aa9e02d7$var$safeResizePanel(panel, delta, prevSize, event) {
|
|
303
304
|
const nextSizeUnsafe = prevSize + delta;
|
|
304
|
-
if (panel.collapsible) {
|
|
305
|
+
if (panel.current.collapsible) {
|
|
305
306
|
if (prevSize > 0) {
|
|
306
307
|
if (nextSizeUnsafe <= 0) return 0;
|
|
307
308
|
} else {
|
|
@@ -311,11 +312,11 @@ function $d6f7e4c3aa9e02d7$var$safeResizePanel(panel, delta, prevSize, event) {
|
|
|
311
312
|
// Keyboard events should expand a collapsed panel to the min size,
|
|
312
313
|
// but mouse events should wait until the panel has reached its min size
|
|
313
314
|
// to avoid a visual flickering when dragging between collapsed and min size.
|
|
314
|
-
if (nextSizeUnsafe < panel.minSize) return 0;
|
|
315
|
+
if (nextSizeUnsafe < panel.current.minSize) return 0;
|
|
315
316
|
}
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
|
-
const nextSize = Math.min(panel.maxSize, Math.max(panel.minSize, nextSizeUnsafe));
|
|
319
|
+
const nextSize = Math.min(panel.current.maxSize, Math.max(panel.current.minSize, nextSizeUnsafe));
|
|
319
320
|
return nextSize;
|
|
320
321
|
}
|
|
321
322
|
|
|
@@ -345,12 +346,12 @@ function $4a90471e7083b52f$export$d9fcbe062527d159({ committedValuesRef: committ
|
|
|
345
346
|
let totalMaxSize = 0;
|
|
346
347
|
// A panel's effective min/max sizes also need to account for other panel's sizes.
|
|
347
348
|
panelsArray.forEach((panelData)=>{
|
|
348
|
-
if (panelData.id === idBefore) {
|
|
349
|
-
maxSize = panelData.maxSize;
|
|
350
|
-
minSize = panelData.minSize;
|
|
349
|
+
if (panelData.current.id === idBefore) {
|
|
350
|
+
maxSize = panelData.current.maxSize;
|
|
351
|
+
minSize = panelData.current.minSize;
|
|
351
352
|
} else {
|
|
352
|
-
totalMinSize += panelData.minSize;
|
|
353
|
-
totalMaxSize += panelData.maxSize;
|
|
353
|
+
totalMinSize += panelData.current.minSize;
|
|
354
|
+
totalMaxSize += panelData.current.maxSize;
|
|
354
355
|
}
|
|
355
356
|
});
|
|
356
357
|
const ariaValueMax = Math.min(maxSize, 100 - totalMinSize);
|
|
@@ -365,13 +366,13 @@ function $4a90471e7083b52f$export$d9fcbe062527d159({ committedValuesRef: committ
|
|
|
365
366
|
case "Enter":
|
|
366
367
|
{
|
|
367
368
|
event.preventDefault();
|
|
368
|
-
const index = panelsArray.findIndex((panel)=>panel.id === idBefore);
|
|
369
|
+
const index = panelsArray.findIndex((panel)=>panel.current.id === idBefore);
|
|
369
370
|
if (index >= 0) {
|
|
370
371
|
const panelData = panelsArray[index];
|
|
371
372
|
const size = sizes[index];
|
|
372
373
|
if (size != null) {
|
|
373
374
|
let delta = 0;
|
|
374
|
-
if (size.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879)) <= panelData.minSize.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879))) delta = direction === "horizontal" ? width : height;
|
|
375
|
+
if (size.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879)) <= panelData.current.minSize.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879))) delta = direction === "horizontal" ? width : height;
|
|
375
376
|
else delta = -(direction === "horizontal" ? width : height);
|
|
376
377
|
const nextSizes = (0, $d6f7e4c3aa9e02d7$export$f50bae335f53943c)(event, panels, idBefore, idAfter, delta, sizes, panelSizeBeforeCollapse.current, null);
|
|
377
378
|
if (sizes !== nextSizes) setSizes(nextSizes);
|
|
@@ -511,11 +512,11 @@ function $8f51c2d77bf1da88$export$354b17c0684607ed(event, groupId, handleId, pan
|
|
|
511
512
|
// If expanding from collapsed, they should snap back to their minSize.
|
|
512
513
|
const [idBefore, idAfter] = (0, $d6f7e4c3aa9e02d7$export$68d3a33c21dfbe27)(groupId, handleId, panelsArray);
|
|
513
514
|
const targetPanelId = movement < 0 ? idBefore : idAfter;
|
|
514
|
-
const targetPanelIndex = panelsArray.findIndex((panel)=>panel.id === targetPanelId);
|
|
515
|
+
const targetPanelIndex = panelsArray.findIndex((panel)=>panel.current.id === targetPanelId);
|
|
515
516
|
const targetPanel = panelsArray[targetPanelIndex];
|
|
516
|
-
if (targetPanel.collapsible) {
|
|
517
|
+
if (targetPanel.current.collapsible) {
|
|
517
518
|
const baseSize = baseSizes[targetPanelIndex];
|
|
518
|
-
if (baseSize === 0 || baseSize.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879)) === targetPanel.minSize.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879))) movement = movement < 0 ? -targetPanel.minSize * groupSizeInPixels : targetPanel.minSize * groupSizeInPixels;
|
|
519
|
+
if (baseSize === 0 || baseSize.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879)) === targetPanel.current.minSize.toPrecision((0, $a8e83be196252871$export$d6d3992f3becc879))) movement = movement < 0 ? -targetPanel.current.minSize * groupSizeInPixels : targetPanel.current.minSize * groupSizeInPixels;
|
|
519
520
|
}
|
|
520
521
|
return movement;
|
|
521
522
|
} else return $8f51c2d77bf1da88$export$ec391ce65b083ed4(event, handleId, direction, dragOffset, dragHandleRect);
|
|
@@ -587,7 +588,7 @@ function $f7d932e9304c1581$export$2e2bcd8739ae039(callback, durationMs = 10) {
|
|
|
587
588
|
// Pre-sorting by minSize allows remembering layouts even if panels are re-ordered/dragged.
|
|
588
589
|
function $6889c3a3ed41cfd1$var$getSerializationKey(panels) {
|
|
589
590
|
return panels.map((panel)=>{
|
|
590
|
-
const { minSize: minSize , order: order } = panel;
|
|
591
|
+
const { minSize: minSize , order: order } = panel.current;
|
|
591
592
|
return order ? `${order}:${minSize}` : `${minSize}`;
|
|
592
593
|
}).sort((a, b)=>a.localeCompare(b)).join(",");
|
|
593
594
|
}
|
|
@@ -730,15 +731,15 @@ function $3daa5d4c086ea816$var$PanelGroupWithForwardedRef({ autoSaveId: autoSave
|
|
|
730
731
|
// 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.
|
|
731
732
|
// For now, these logic edge cases are left to the user to handle via props.
|
|
732
733
|
panelsArray.forEach((panel)=>{
|
|
733
|
-
totalMinSize += panel.minSize;
|
|
734
|
-
if (panel.defaultSize === null) panelsWithNullDefaultSize++;
|
|
735
|
-
else totalDefaultSize += panel.defaultSize;
|
|
734
|
+
totalMinSize += panel.current.minSize;
|
|
735
|
+
if (panel.current.defaultSize === null) panelsWithNullDefaultSize++;
|
|
736
|
+
else totalDefaultSize += panel.current.defaultSize;
|
|
736
737
|
});
|
|
737
738
|
if (totalDefaultSize > 100) throw new Error(`The sum of the defaultSize of all panels in a group cannot exceed 100.`);
|
|
738
739
|
else if (totalMinSize > 100) throw new Error(`The sum of the minSize of all panels in a group cannot exceed 100.`);
|
|
739
740
|
setSizes(panelsArray.map((panel)=>{
|
|
740
|
-
if (panel.defaultSize === null) return (100 - totalDefaultSize) / panelsWithNullDefaultSize;
|
|
741
|
-
return panel.defaultSize;
|
|
741
|
+
if (panel.current.defaultSize === null) return (100 - totalDefaultSize) / panelsWithNullDefaultSize;
|
|
742
|
+
return panel.current.defaultSize;
|
|
742
743
|
}));
|
|
743
744
|
}
|
|
744
745
|
}, [
|
|
@@ -789,11 +790,11 @@ function $3daa5d4c086ea816$var$PanelGroupWithForwardedRef({ autoSaveId: autoSave
|
|
|
789
790
|
disablePointerEventsDuringResize,
|
|
790
791
|
sizes
|
|
791
792
|
]);
|
|
792
|
-
const registerPanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id,
|
|
793
|
+
const registerPanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id, panelRef)=>{
|
|
793
794
|
setPanels((prevPanels)=>{
|
|
794
795
|
if (prevPanels.has(id)) return prevPanels;
|
|
795
796
|
const nextPanels = new Map(prevPanels);
|
|
796
|
-
nextPanels.set(id,
|
|
797
|
+
nextPanels.set(id, panelRef);
|
|
797
798
|
return nextPanels;
|
|
798
799
|
});
|
|
799
800
|
}, []);
|
|
@@ -851,7 +852,7 @@ function $3daa5d4c086ea816$var$PanelGroupWithForwardedRef({ autoSaveId: autoSave
|
|
|
851
852
|
const collapsePanel = (0, $ef07efbe5fa7d87e$export$35808ee640e87ca7)((id)=>{
|
|
852
853
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
853
854
|
const panel = panels.get(id);
|
|
854
|
-
if (panel == null || !panel.collapsible) return;
|
|
855
|
+
if (panel == null || !panel.current.collapsible) return;
|
|
855
856
|
const panelsArray = (0, $d6f7e4c3aa9e02d7$export$a861c0ad45885494)(panels);
|
|
856
857
|
const index = panelsArray.indexOf(panel);
|
|
857
858
|
if (index < 0) return;
|
|
@@ -874,7 +875,7 @@ function $3daa5d4c086ea816$var$PanelGroupWithForwardedRef({ autoSaveId: autoSave
|
|
|
874
875
|
const { panels: panels , sizes: prevSizes } = committedValuesRef.current;
|
|
875
876
|
const panel = panels.get(id);
|
|
876
877
|
if (panel == null) return;
|
|
877
|
-
const sizeBeforeCollapse = panelSizeBeforeCollapse.current.get(id) || panel.minSize;
|
|
878
|
+
const sizeBeforeCollapse = panelSizeBeforeCollapse.current.get(id) || panel.current.minSize;
|
|
878
879
|
if (!sizeBeforeCollapse) return;
|
|
879
880
|
const panelsArray = (0, $d6f7e4c3aa9e02d7$export$a861c0ad45885494)(panels);
|
|
880
881
|
const index = panelsArray.indexOf(panel);
|
|
@@ -902,8 +903,8 @@ function $3daa5d4c086ea816$var$PanelGroupWithForwardedRef({ autoSaveId: autoSave
|
|
|
902
903
|
if (index < 0) return;
|
|
903
904
|
const currentSize = prevSizes[index];
|
|
904
905
|
if (currentSize === nextSize) return;
|
|
905
|
-
if (panel.collapsible && nextSize === 0) ;
|
|
906
|
-
else nextSize = Math.min(panel.maxSize, Math.max(panel.minSize, nextSize));
|
|
906
|
+
if (panel.current.collapsible && nextSize === 0) ;
|
|
907
|
+
else nextSize = Math.min(panel.current.maxSize, Math.max(panel.current.minSize, nextSize));
|
|
907
908
|
const [idBefore, idAfter] = (0, $d6f7e4c3aa9e02d7$export$5a5b0c1d38c23c3b)(id, panelsArray);
|
|
908
909
|
if (idBefore == null || idAfter == null) return;
|
|
909
910
|
const isLastPanel = index === panelsArray.length - 1;
|