react-resizable-panels 4.0.16 → 4.1.1
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.
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as K } from "react/jsx-runtime";
|
|
3
|
-
import { useId as Ke, useLayoutEffect as Xe, useEffect as Ce, useRef as
|
|
3
|
+
import { useId as Ke, useLayoutEffect as Xe, useEffect as Ce, useRef as I, useCallback as qe, createContext as Ye, useImperativeHandle as Ee, useState as D, useMemo as se, useSyncExternalStore as Ze, useContext as Je } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function W({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
12
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ae(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
16
|
e === "horizontal" ? Qe : et
|
|
17
17
|
);
|
|
@@ -56,7 +56,7 @@ function tt({
|
|
|
56
56
|
return z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
function ke(e) {
|
|
59
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s =
|
|
59
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, s = ae(
|
|
60
60
|
n,
|
|
61
61
|
Array.from(t.children).filter(Me).map((f) => ({ element: f }))
|
|
62
62
|
).map(({ element: f }) => f), l = [];
|
|
@@ -119,7 +119,7 @@ function ke(e) {
|
|
|
119
119
|
for (const d of c)
|
|
120
120
|
l.push({
|
|
121
121
|
group: e,
|
|
122
|
-
groupSize:
|
|
122
|
+
groupSize: W({ group: e }),
|
|
123
123
|
panels: [a, p],
|
|
124
124
|
separator: "width" in d ? void 0 : d,
|
|
125
125
|
rect: "width" in d ? d : d.element.getBoundingClientRect()
|
|
@@ -160,7 +160,7 @@ function st(e) {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function ee({
|
|
164
164
|
groupSize: e,
|
|
165
165
|
panelElement: t,
|
|
166
166
|
styleProp: n
|
|
@@ -199,7 +199,7 @@ function k(e) {
|
|
|
199
199
|
return parseFloat(e.toFixed(3));
|
|
200
200
|
}
|
|
201
201
|
function me(e) {
|
|
202
|
-
const { panels: t } = e, n =
|
|
202
|
+
const { panels: t } = e, n = W({ group: e });
|
|
203
203
|
return n === 0 ? t.map((o) => ({
|
|
204
204
|
collapsedSize: 0,
|
|
205
205
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -211,7 +211,7 @@ function me(e) {
|
|
|
211
211
|
const { element: i, panelConstraints: s } = o;
|
|
212
212
|
let l = 0;
|
|
213
213
|
if (s.collapsedSize) {
|
|
214
|
-
const f =
|
|
214
|
+
const f = ee({
|
|
215
215
|
groupSize: n,
|
|
216
216
|
panelElement: i,
|
|
217
217
|
styleProp: s.collapsedSize
|
|
@@ -220,7 +220,7 @@ function me(e) {
|
|
|
220
220
|
}
|
|
221
221
|
let r;
|
|
222
222
|
if (s.defaultSize) {
|
|
223
|
-
const f =
|
|
223
|
+
const f = ee({
|
|
224
224
|
groupSize: n,
|
|
225
225
|
panelElement: i,
|
|
226
226
|
styleProp: s.defaultSize
|
|
@@ -229,7 +229,7 @@ function me(e) {
|
|
|
229
229
|
}
|
|
230
230
|
let a = 0;
|
|
231
231
|
if (s.minSize) {
|
|
232
|
-
const f =
|
|
232
|
+
const f = ee({
|
|
233
233
|
groupSize: n,
|
|
234
234
|
panelElement: i,
|
|
235
235
|
styleProp: s.minSize
|
|
@@ -238,7 +238,7 @@ function me(e) {
|
|
|
238
238
|
}
|
|
239
239
|
let u = 100;
|
|
240
240
|
if (s.maxSize) {
|
|
241
|
-
const f =
|
|
241
|
+
const f = ee({
|
|
242
242
|
groupSize: n,
|
|
243
243
|
panelElement: i,
|
|
244
244
|
styleProp: s.maxSize
|
|
@@ -297,26 +297,26 @@ class at {
|
|
|
297
297
|
function R(e, t, n = 0) {
|
|
298
298
|
return Math.abs(k(e) - k(t)) <= n;
|
|
299
299
|
}
|
|
300
|
-
let
|
|
300
|
+
let E = {
|
|
301
301
|
cursorFlags: 0,
|
|
302
302
|
interactionState: {
|
|
303
303
|
state: "inactive"
|
|
304
304
|
},
|
|
305
305
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
306
306
|
};
|
|
307
|
-
const
|
|
307
|
+
const _ = new at();
|
|
308
308
|
function G() {
|
|
309
|
-
return
|
|
310
|
-
}
|
|
311
|
-
function
|
|
312
|
-
const t = typeof e == "function" ? e(
|
|
313
|
-
if (
|
|
314
|
-
return
|
|
315
|
-
const n =
|
|
316
|
-
return
|
|
317
|
-
...
|
|
309
|
+
return E;
|
|
310
|
+
}
|
|
311
|
+
function M(e) {
|
|
312
|
+
const t = typeof e == "function" ? e(E) : e;
|
|
313
|
+
if (E === t)
|
|
314
|
+
return E;
|
|
315
|
+
const n = E;
|
|
316
|
+
return E = {
|
|
317
|
+
...E,
|
|
318
318
|
...t
|
|
319
|
-
}, t.cursorFlags !== void 0 &&
|
|
319
|
+
}, t.cursorFlags !== void 0 && _.emit("cursorFlagsChange", E.cursorFlags), t.interactionState !== void 0 && _.emit("interactionStateChange", E.interactionState), t.mountedGroups !== void 0 && (E.mountedGroups.forEach((o, i) => {
|
|
320
320
|
o.derivedPanelConstraints.forEach((s) => {
|
|
321
321
|
if (s.collapsible) {
|
|
322
322
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
@@ -332,7 +332,7 @@ function E(e) {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
-
}),
|
|
335
|
+
}), _.emit("mountedGroupsChange", E.mountedGroups)), E;
|
|
336
336
|
}
|
|
337
337
|
function lt(e, t) {
|
|
338
338
|
if (e.length !== t.length)
|
|
@@ -345,7 +345,7 @@ function lt(e, t) {
|
|
|
345
345
|
function X(e, t) {
|
|
346
346
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function V({
|
|
349
349
|
panelConstraints: e,
|
|
350
350
|
size: t
|
|
351
351
|
}) {
|
|
@@ -431,7 +431,7 @@ function q({
|
|
|
431
431
|
S != null,
|
|
432
432
|
`Previous layout not found for panel index ${d}`
|
|
433
433
|
);
|
|
434
|
-
const g =
|
|
434
|
+
const g = V({
|
|
435
435
|
panelConstraints: n[d],
|
|
436
436
|
size: 100
|
|
437
437
|
}) - S;
|
|
@@ -449,7 +449,7 @@ function q({
|
|
|
449
449
|
v != null,
|
|
450
450
|
`Previous layout not found for panel index ${d}`
|
|
451
451
|
);
|
|
452
|
-
const S = v - y, x =
|
|
452
|
+
const S = v - y, x = V({
|
|
453
453
|
panelConstraints: n[d],
|
|
454
454
|
size: S
|
|
455
455
|
});
|
|
@@ -468,23 +468,23 @@ function q({
|
|
|
468
468
|
d != null,
|
|
469
469
|
`Previous layout not found for panel index ${c}`
|
|
470
470
|
);
|
|
471
|
-
const y = d + p, v =
|
|
471
|
+
const y = d + p, v = V({
|
|
472
472
|
panelConstraints: n[c],
|
|
473
473
|
size: y
|
|
474
474
|
});
|
|
475
475
|
if (a[c] = v, !R(v, y)) {
|
|
476
476
|
let S = y - v, g = e < 0 ? f : u;
|
|
477
477
|
for (; g >= 0 && g < n.length; ) {
|
|
478
|
-
const
|
|
478
|
+
const b = a[g];
|
|
479
479
|
z(
|
|
480
|
-
|
|
480
|
+
b != null,
|
|
481
481
|
`Previous layout not found for panel index ${g}`
|
|
482
482
|
);
|
|
483
|
-
const
|
|
483
|
+
const w = b + S, C = V({
|
|
484
484
|
panelConstraints: n[g],
|
|
485
|
-
size:
|
|
485
|
+
size: w
|
|
486
486
|
});
|
|
487
|
-
if (R(
|
|
487
|
+
if (R(b, C) || (S -= C - b, a[g] = C), R(S, 0))
|
|
488
488
|
break;
|
|
489
489
|
e > 0 ? g-- : g++;
|
|
490
490
|
}
|
|
@@ -499,7 +499,7 @@ function q({
|
|
|
499
499
|
const m = Object.keys(i);
|
|
500
500
|
return a.reduce((c, d, y) => (c[m[y]] = d, c), {});
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function ne(e) {
|
|
503
503
|
const t = e.parentElement;
|
|
504
504
|
z(t, "Parent group element not found");
|
|
505
505
|
const { mountedGroups: n } = G();
|
|
@@ -508,7 +508,7 @@ function oe(e) {
|
|
|
508
508
|
return o;
|
|
509
509
|
throw Error("Could not find parent Group for separator element");
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function U(e, t) {
|
|
512
512
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
513
513
|
return !1;
|
|
514
514
|
for (const n in e)
|
|
@@ -516,7 +516,7 @@ function W(e, t) {
|
|
|
516
516
|
return !1;
|
|
517
517
|
return !0;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function N({
|
|
520
520
|
layout: e,
|
|
521
521
|
panelConstraints: t
|
|
522
522
|
}) {
|
|
@@ -539,7 +539,7 @@ function _({
|
|
|
539
539
|
for (let r = 0; r < t.length; r++) {
|
|
540
540
|
const a = o[r];
|
|
541
541
|
z(a != null, `No layout data found for index ${r}`);
|
|
542
|
-
const u =
|
|
542
|
+
const u = V({
|
|
543
543
|
panelConstraints: t[r],
|
|
544
544
|
size: a
|
|
545
545
|
});
|
|
@@ -549,7 +549,7 @@ function _({
|
|
|
549
549
|
for (let r = 0; r < t.length; r++) {
|
|
550
550
|
const a = o[r];
|
|
551
551
|
z(a != null, `No layout data found for index ${r}`);
|
|
552
|
-
const u = a + s, f =
|
|
552
|
+
const u = a + s, f = V({
|
|
553
553
|
panelConstraints: t[r],
|
|
554
554
|
size: u
|
|
555
555
|
});
|
|
@@ -581,11 +581,11 @@ function Ge({
|
|
|
581
581
|
group: s,
|
|
582
582
|
layout: l,
|
|
583
583
|
separatorToPanels: r
|
|
584
|
-
} = t(), a =
|
|
584
|
+
} = t(), a = N({
|
|
585
585
|
layout: n,
|
|
586
586
|
panelConstraints: i
|
|
587
587
|
});
|
|
588
|
-
return o ? l : (
|
|
588
|
+
return o ? l : (U(l, a) || M((u) => ({
|
|
589
589
|
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
590
590
|
defaultLayoutDeferred: o,
|
|
591
591
|
derivedPanelConstraints: i,
|
|
@@ -601,7 +601,7 @@ function De(e) {
|
|
|
601
601
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
602
602
|
}
|
|
603
603
|
function T(e, t) {
|
|
604
|
-
const n =
|
|
604
|
+
const n = ne(e), o = De(n), i = n.separators.find(
|
|
605
605
|
(p) => p.element === e
|
|
606
606
|
);
|
|
607
607
|
z(i, "Matching separator not found");
|
|
@@ -614,11 +614,11 @@ function T(e, t) {
|
|
|
614
614
|
pivotIndices: l,
|
|
615
615
|
prevLayout: a,
|
|
616
616
|
trigger: "keyboard"
|
|
617
|
-
}), f =
|
|
617
|
+
}), f = N({
|
|
618
618
|
layout: u,
|
|
619
619
|
panelConstraints: o.derivedPanelConstraints
|
|
620
620
|
});
|
|
621
|
-
|
|
621
|
+
U(a, f) || M((p) => ({
|
|
622
622
|
mountedGroups: new Map(p.mountedGroups).set(n, {
|
|
623
623
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
624
624
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -630,7 +630,7 @@ function T(e, t) {
|
|
|
630
630
|
function ye(e) {
|
|
631
631
|
if (e.defaultPrevented)
|
|
632
632
|
return;
|
|
633
|
-
const t = e.currentTarget, n =
|
|
633
|
+
const t = e.currentTarget, n = ne(t);
|
|
634
634
|
if (!n.disabled)
|
|
635
635
|
switch (e.key) {
|
|
636
636
|
case "ArrowDown": {
|
|
@@ -655,7 +655,7 @@ function ye(e) {
|
|
|
655
655
|
}
|
|
656
656
|
case "Enter": {
|
|
657
657
|
e.preventDefault();
|
|
658
|
-
const o =
|
|
658
|
+
const o = ne(t), { derivedPanelConstraints: i, layout: s, separatorToPanels: l } = De(o), r = o.separators.find(
|
|
659
659
|
(p) => p.element === t
|
|
660
660
|
);
|
|
661
661
|
z(r, "Matching separator not found");
|
|
@@ -672,7 +672,7 @@ function ye(e) {
|
|
|
672
672
|
}
|
|
673
673
|
case "F6": {
|
|
674
674
|
e.preventDefault();
|
|
675
|
-
const i =
|
|
675
|
+
const i = ne(t).separators.map(
|
|
676
676
|
(a) => a.element
|
|
677
677
|
), s = Array.from(i).findIndex(
|
|
678
678
|
(a) => a === e.currentTarget
|
|
@@ -689,7 +689,7 @@ function ye(e) {
|
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
const ut = (e) => e, re = () => {
|
|
692
|
-
},
|
|
692
|
+
}, Oe = 1, Te = 2, _e = 4, Ne = 8, ge = {
|
|
693
693
|
coarse: 10,
|
|
694
694
|
precise: 5
|
|
695
695
|
};
|
|
@@ -716,9 +716,9 @@ function ct(e, t, n) {
|
|
|
716
716
|
hitRegion: o
|
|
717
717
|
} : void 0;
|
|
718
718
|
}
|
|
719
|
-
let
|
|
719
|
+
let te;
|
|
720
720
|
function ft() {
|
|
721
|
-
return
|
|
721
|
+
return te === void 0 && (typeof matchMedia == "function" ? te = !!matchMedia("(pointer:coarse)").matches : te = !1), te;
|
|
722
722
|
}
|
|
723
723
|
function dt(e) {
|
|
724
724
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
@@ -833,7 +833,7 @@ function ze(e) {
|
|
|
833
833
|
}), a.separator && (s.add(a.separator), r || (r = !0, a.separator.element.focus()));
|
|
834
834
|
const u = t.get(a.group);
|
|
835
835
|
u && l.set(a.group, u.layout);
|
|
836
|
-
}),
|
|
836
|
+
}), M({
|
|
837
837
|
interactionState: {
|
|
838
838
|
hitRegions: n,
|
|
839
839
|
initialLayoutMap: l,
|
|
@@ -869,7 +869,7 @@ function St({
|
|
|
869
869
|
return null;
|
|
870
870
|
switch (n) {
|
|
871
871
|
case "active": {
|
|
872
|
-
const s = (e &
|
|
872
|
+
const s = (e & Oe) !== 0, l = (e & Te) !== 0, r = (e & _e) !== 0, a = (e & Ne) !== 0;
|
|
873
873
|
if (e) {
|
|
874
874
|
if (s)
|
|
875
875
|
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
@@ -886,7 +886,7 @@ function St({
|
|
|
886
886
|
return o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
887
887
|
}
|
|
888
888
|
const be = /* @__PURE__ */ new WeakMap();
|
|
889
|
-
function
|
|
889
|
+
function le(e) {
|
|
890
890
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
891
891
|
return;
|
|
892
892
|
let { prevStyle: t, styleSheet: n } = be.get(e) ?? {};
|
|
@@ -940,15 +940,15 @@ function Fe({
|
|
|
940
940
|
delta: c,
|
|
941
941
|
initialLayout: d,
|
|
942
942
|
panelConstraints: v,
|
|
943
|
-
pivotIndices: a.panels.map((
|
|
943
|
+
pivotIndices: a.panels.map((b) => m.indexOf(b)),
|
|
944
944
|
prevLayout: S,
|
|
945
945
|
trigger: "mouse-or-touch"
|
|
946
946
|
});
|
|
947
|
-
if (
|
|
947
|
+
if (U(g, S)) {
|
|
948
948
|
if (c !== 0 && !p)
|
|
949
949
|
switch (h) {
|
|
950
950
|
case "horizontal": {
|
|
951
|
-
l |= c < 0 ?
|
|
951
|
+
l |= c < 0 ? Oe : Te;
|
|
952
952
|
break;
|
|
953
953
|
}
|
|
954
954
|
case "vertical": {
|
|
@@ -963,14 +963,14 @@ function Fe({
|
|
|
963
963
|
layout: g,
|
|
964
964
|
separatorToPanels: x
|
|
965
965
|
});
|
|
966
|
-
const
|
|
967
|
-
a.group.inMemoryLayouts[
|
|
966
|
+
const b = a.group.panels.map(({ id: w }) => w).join(",");
|
|
967
|
+
a.group.inMemoryLayouts[b] = g;
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
|
-
}),
|
|
970
|
+
}), M({
|
|
971
971
|
cursorFlags: l,
|
|
972
972
|
mountedGroups: r
|
|
973
|
-
}),
|
|
973
|
+
}), le(e);
|
|
974
974
|
}
|
|
975
975
|
function we(e) {
|
|
976
976
|
const { interactionState: t, mountedGroups: n } = G();
|
|
@@ -995,7 +995,7 @@ function Le(e) {
|
|
|
995
995
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
996
996
|
e.buttons === 0
|
|
997
997
|
) {
|
|
998
|
-
|
|
998
|
+
M(
|
|
999
999
|
(o) => o.interactionState.state === "inactive" ? o : {
|
|
1000
1000
|
cursorFlags: 0,
|
|
1001
1001
|
interactionState: {
|
|
@@ -1017,14 +1017,14 @@ function Le(e) {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
default: {
|
|
1019
1019
|
const o = $e(e, n);
|
|
1020
|
-
o.length === 0 ? t.state !== "inactive" &&
|
|
1020
|
+
o.length === 0 ? t.state !== "inactive" && M({
|
|
1021
1021
|
interactionState: { state: "inactive" }
|
|
1022
|
-
}) :
|
|
1022
|
+
}) : M({
|
|
1023
1023
|
interactionState: {
|
|
1024
1024
|
hitRegions: o,
|
|
1025
1025
|
state: "hover"
|
|
1026
1026
|
}
|
|
1027
|
-
}),
|
|
1027
|
+
}), le(e.currentTarget);
|
|
1028
1028
|
break;
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
@@ -1036,12 +1036,12 @@ function Pe(e) {
|
|
|
1036
1036
|
const { interactionState: t } = G();
|
|
1037
1037
|
switch (t.state) {
|
|
1038
1038
|
case "active":
|
|
1039
|
-
|
|
1039
|
+
M({
|
|
1040
1040
|
cursorFlags: 0,
|
|
1041
1041
|
interactionState: {
|
|
1042
1042
|
state: "inactive"
|
|
1043
1043
|
}
|
|
1044
|
-
}),
|
|
1044
|
+
}), le(e.currentTarget);
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
function Re(e) {
|
|
@@ -1069,7 +1069,7 @@ function xt(e, t, n) {
|
|
|
1069
1069
|
const i = e.panels.find((l) => l.element === t);
|
|
1070
1070
|
if (!i || !i.onResize)
|
|
1071
1071
|
return;
|
|
1072
|
-
const s =
|
|
1072
|
+
const s = W({ group: e });
|
|
1073
1073
|
i.onResize(
|
|
1074
1074
|
{
|
|
1075
1075
|
asPercentage: k(
|
|
@@ -1097,7 +1097,7 @@ function bt(e, t) {
|
|
|
1097
1097
|
return !1;
|
|
1098
1098
|
return !0;
|
|
1099
1099
|
}
|
|
1100
|
-
const
|
|
1100
|
+
const B = /* @__PURE__ */ new Map();
|
|
1101
1101
|
function wt(e) {
|
|
1102
1102
|
let t = !0;
|
|
1103
1103
|
z(
|
|
@@ -1109,23 +1109,23 @@ function wt(e) {
|
|
|
1109
1109
|
const { borderBoxSize: y, target: v } = d;
|
|
1110
1110
|
if (v === e.element) {
|
|
1111
1111
|
if (t) {
|
|
1112
|
-
if (
|
|
1112
|
+
if (W({ group: e }) === 0)
|
|
1113
1113
|
return;
|
|
1114
|
-
|
|
1114
|
+
M((x) => {
|
|
1115
1115
|
const g = x.mountedGroups.get(e);
|
|
1116
1116
|
if (g) {
|
|
1117
|
-
const
|
|
1118
|
-
layout:
|
|
1119
|
-
panelConstraints:
|
|
1117
|
+
const b = me(e), w = g.defaultLayoutDeferred ? Re(b) : g.layout, C = N({
|
|
1118
|
+
layout: w,
|
|
1119
|
+
panelConstraints: b
|
|
1120
1120
|
});
|
|
1121
|
-
return !g.defaultLayoutDeferred &&
|
|
1121
|
+
return !g.defaultLayoutDeferred && U(w, C) && zt(
|
|
1122
1122
|
g.derivedPanelConstraints,
|
|
1123
|
-
|
|
1123
|
+
b
|
|
1124
1124
|
) ? x : {
|
|
1125
1125
|
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1126
1126
|
defaultLayoutDeferred: !1,
|
|
1127
|
-
derivedPanelConstraints:
|
|
1128
|
-
layout:
|
|
1127
|
+
derivedPanelConstraints: b,
|
|
1128
|
+
layout: C,
|
|
1129
1129
|
separatorToPanels: g.separatorToPanels
|
|
1130
1130
|
})
|
|
1131
1131
|
};
|
|
@@ -1143,18 +1143,18 @@ function wt(e) {
|
|
|
1143
1143
|
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1144
1144
|
), o.add(c.id), c.onResize && s.observe(c.element);
|
|
1145
1145
|
});
|
|
1146
|
-
const l =
|
|
1146
|
+
const l = W({ group: e }), r = me(e), a = e.panels.map(({ id: c }) => c).join(",");
|
|
1147
1147
|
let u = e.defaultLayout;
|
|
1148
1148
|
u && (bt(e.panels, u) || (u = void 0));
|
|
1149
|
-
const f = e.inMemoryLayouts[a] ?? u ?? Re(r), p =
|
|
1149
|
+
const f = e.inMemoryLayouts[a] ?? u ?? Re(r), p = N({
|
|
1150
1150
|
layout: f,
|
|
1151
1151
|
panelConstraints: r
|
|
1152
1152
|
}), h = ke(e), m = e.element.ownerDocument;
|
|
1153
|
-
return
|
|
1153
|
+
return M((c) => {
|
|
1154
1154
|
const d = /* @__PURE__ */ new Map();
|
|
1155
|
-
return
|
|
1155
|
+
return B.set(
|
|
1156
1156
|
m,
|
|
1157
|
-
(
|
|
1157
|
+
(B.get(m) ?? 0) + 1
|
|
1158
1158
|
), h.forEach((y) => {
|
|
1159
1159
|
y.separator && d.set(y.separator, y.panels);
|
|
1160
1160
|
}), {
|
|
@@ -1170,31 +1170,31 @@ function wt(e) {
|
|
|
1170
1170
|
!i.has(c.id),
|
|
1171
1171
|
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1172
1172
|
), i.add(c.id), c.element.addEventListener("keydown", ye);
|
|
1173
|
-
}),
|
|
1174
|
-
t = !1,
|
|
1173
|
+
}), B.get(m) === 1 && (m.addEventListener("pointerdown", ze), m.addEventListener("pointerleave", we), m.addEventListener("pointermove", Le), m.addEventListener("pointerup", Pe)), function() {
|
|
1174
|
+
t = !1, B.set(
|
|
1175
1175
|
m,
|
|
1176
|
-
Math.max(0, (
|
|
1177
|
-
),
|
|
1176
|
+
Math.max(0, (B.get(m) ?? 0) - 1)
|
|
1177
|
+
), M((d) => {
|
|
1178
1178
|
const y = new Map(d.mountedGroups);
|
|
1179
1179
|
return y.delete(e), { mountedGroups: y };
|
|
1180
1180
|
}), e.separators.forEach((d) => {
|
|
1181
1181
|
d.element.removeEventListener("keydown", ye);
|
|
1182
|
-
}),
|
|
1182
|
+
}), B.get(m) || (m.removeEventListener("pointerdown", ze), m.removeEventListener("pointerleave", we), m.removeEventListener("pointermove", Le), m.removeEventListener("pointerup", Pe)), s.disconnect();
|
|
1183
1183
|
};
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1185
|
+
function ue(e) {
|
|
1186
1186
|
const t = Ke();
|
|
1187
1187
|
return `${e ?? t}`;
|
|
1188
1188
|
}
|
|
1189
|
-
const
|
|
1190
|
-
function
|
|
1191
|
-
const t =
|
|
1192
|
-
return
|
|
1189
|
+
const A = typeof window < "u" ? Xe : Ce;
|
|
1190
|
+
function ce(e) {
|
|
1191
|
+
const t = I(e);
|
|
1192
|
+
return A(() => {
|
|
1193
1193
|
t.current = e;
|
|
1194
1194
|
}, [e]), qe((n) => t.current?.(n), [t]);
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1197
|
-
return
|
|
1196
|
+
function fe(...e) {
|
|
1197
|
+
return ce((t) => {
|
|
1198
1198
|
e.forEach((n) => {
|
|
1199
1199
|
if (n)
|
|
1200
1200
|
switch (typeof n) {
|
|
@@ -1211,31 +1211,31 @@ function ce(...e) {
|
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
1213
|
function Lt(e) {
|
|
1214
|
-
const t =
|
|
1215
|
-
return
|
|
1214
|
+
const t = I({ ...e });
|
|
1215
|
+
return A(() => {
|
|
1216
1216
|
for (const n in e)
|
|
1217
1217
|
t.current[n] = e[n];
|
|
1218
1218
|
}, [e]), t.current;
|
|
1219
1219
|
}
|
|
1220
|
-
const
|
|
1221
|
-
function
|
|
1220
|
+
const je = "--react-resizable-panels--panel--pointer-events";
|
|
1221
|
+
function He(e, t) {
|
|
1222
1222
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1223
1223
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1224
1224
|
}
|
|
1225
1225
|
const Be = Ye(null);
|
|
1226
1226
|
function Pt(e, t) {
|
|
1227
|
-
const n =
|
|
1227
|
+
const n = I({
|
|
1228
1228
|
getLayout: () => ({}),
|
|
1229
1229
|
setLayout: ut
|
|
1230
1230
|
});
|
|
1231
|
-
Ee(t, () => n.current, []),
|
|
1231
|
+
Ee(t, () => n.current, []), A(() => {
|
|
1232
1232
|
Object.assign(
|
|
1233
1233
|
n.current,
|
|
1234
1234
|
Ge({ groupId: e })
|
|
1235
1235
|
);
|
|
1236
1236
|
});
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1238
|
+
function Tt({
|
|
1239
1239
|
children: e,
|
|
1240
1240
|
className: t,
|
|
1241
1241
|
defaultLayout: n,
|
|
@@ -1249,62 +1249,63 @@ function Ot({
|
|
|
1249
1249
|
style: f,
|
|
1250
1250
|
...p
|
|
1251
1251
|
}) {
|
|
1252
|
-
const h =
|
|
1253
|
-
|
|
1254
|
-
}), c =
|
|
1252
|
+
const h = I({}), m = ce((L) => {
|
|
1253
|
+
U(h.current, L) || (h.current = L, a?.(L));
|
|
1254
|
+
}), c = ue(r), [d, y] = D(!1), v = I(null), [S, x] = D(n ?? {}), [g, b] = D([]), [w, C] = D([]), Y = I({
|
|
1255
1255
|
lastExpandedPanelSizes: {},
|
|
1256
1256
|
layouts: {}
|
|
1257
|
-
}),
|
|
1257
|
+
}), oe = fe(v, s);
|
|
1258
1258
|
Pt(c, l);
|
|
1259
|
-
const
|
|
1259
|
+
const Z = se(
|
|
1260
1260
|
() => ({
|
|
1261
1261
|
id: c,
|
|
1262
1262
|
orientation: u,
|
|
1263
|
-
registerPanel: (
|
|
1264
|
-
|
|
1263
|
+
registerPanel: (L) => (b((P) => ae(u, [...P, L])), () => {
|
|
1264
|
+
b((P) => P.filter((O) => O !== L));
|
|
1265
1265
|
}),
|
|
1266
|
-
registerSeparator: (
|
|
1267
|
-
(
|
|
1266
|
+
registerSeparator: (L) => (C(
|
|
1267
|
+
(P) => ae(u, [...P, L])
|
|
1268
1268
|
), () => {
|
|
1269
|
-
|
|
1270
|
-
(
|
|
1269
|
+
C(
|
|
1270
|
+
(P) => P.filter((O) => O !== L)
|
|
1271
1271
|
);
|
|
1272
1272
|
})
|
|
1273
1273
|
}),
|
|
1274
1274
|
[c, u]
|
|
1275
|
-
),
|
|
1275
|
+
), $ = Lt({
|
|
1276
1276
|
defaultLayout: n,
|
|
1277
1277
|
disableCursor: o
|
|
1278
|
-
}),
|
|
1279
|
-
|
|
1280
|
-
|
|
1278
|
+
}), F = I(null);
|
|
1279
|
+
A(() => {
|
|
1280
|
+
const L = v.current;
|
|
1281
|
+
if (L === null)
|
|
1281
1282
|
return;
|
|
1282
|
-
const
|
|
1283
|
-
defaultLayout:
|
|
1284
|
-
disableCursor:
|
|
1283
|
+
const P = {
|
|
1284
|
+
defaultLayout: $.defaultLayout,
|
|
1285
|
+
disableCursor: !!$.disableCursor,
|
|
1285
1286
|
disabled: !!i,
|
|
1286
|
-
element:
|
|
1287
|
+
element: L,
|
|
1287
1288
|
id: c,
|
|
1288
|
-
inMemoryLastExpandedPanelSizes:
|
|
1289
|
-
inMemoryLayouts:
|
|
1289
|
+
inMemoryLastExpandedPanelSizes: Y.current.lastExpandedPanelSizes,
|
|
1290
|
+
inMemoryLayouts: Y.current.layouts,
|
|
1290
1291
|
orientation: u,
|
|
1291
|
-
panels:
|
|
1292
|
-
separators:
|
|
1292
|
+
panels: g,
|
|
1293
|
+
separators: w
|
|
1293
1294
|
};
|
|
1294
|
-
|
|
1295
|
-
const
|
|
1295
|
+
F.current = P;
|
|
1296
|
+
const O = wt(P), pe = G().mountedGroups.get(P);
|
|
1296
1297
|
if (pe) {
|
|
1297
|
-
const { defaultLayoutDeferred:
|
|
1298
|
-
!
|
|
1298
|
+
const { defaultLayoutDeferred: j, derivedPanelConstraints: H, layout: Q } = pe;
|
|
1299
|
+
!j && H.length > 0 && (x(Q), m?.(Q));
|
|
1299
1300
|
}
|
|
1300
|
-
const Ve =
|
|
1301
|
+
const Ve = _.addListener(
|
|
1301
1302
|
"interactionStateChange",
|
|
1302
|
-
(
|
|
1303
|
-
switch (
|
|
1303
|
+
(j) => {
|
|
1304
|
+
switch (j.state) {
|
|
1304
1305
|
case "active": {
|
|
1305
1306
|
y(
|
|
1306
|
-
|
|
1307
|
-
(H) => H.group ===
|
|
1307
|
+
j.hitRegions.some(
|
|
1308
|
+
(H) => H.group === P
|
|
1308
1309
|
)
|
|
1309
1310
|
);
|
|
1310
1311
|
break;
|
|
@@ -1315,42 +1316,41 @@ function Ot({
|
|
|
1315
1316
|
}
|
|
1316
1317
|
}
|
|
1317
1318
|
}
|
|
1318
|
-
), We =
|
|
1319
|
+
), We = _.addListener(
|
|
1319
1320
|
"mountedGroupsChange",
|
|
1320
|
-
(
|
|
1321
|
-
const H =
|
|
1321
|
+
(j) => {
|
|
1322
|
+
const H = j.get(P);
|
|
1322
1323
|
if (H) {
|
|
1323
|
-
const { defaultLayoutDeferred:
|
|
1324
|
-
if (
|
|
1324
|
+
const { defaultLayoutDeferred: Q, derivedPanelConstraints: Ue, layout: he } = H;
|
|
1325
|
+
if (Q || Ue.length === 0)
|
|
1325
1326
|
return;
|
|
1326
|
-
|
|
1327
|
+
x(he), m?.(he);
|
|
1327
1328
|
}
|
|
1328
1329
|
}
|
|
1329
1330
|
);
|
|
1330
1331
|
return () => {
|
|
1331
|
-
|
|
1332
|
+
F.current = null, O(), Ve(), We();
|
|
1332
1333
|
};
|
|
1333
1334
|
}, [
|
|
1334
1335
|
i,
|
|
1335
|
-
v,
|
|
1336
1336
|
c,
|
|
1337
1337
|
m,
|
|
1338
1338
|
u,
|
|
1339
|
+
g,
|
|
1339
1340
|
w,
|
|
1340
|
-
|
|
1341
|
-
A
|
|
1341
|
+
$
|
|
1342
1342
|
]), Ce(() => {
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1343
|
+
const L = F.current;
|
|
1344
|
+
L && (L.defaultLayout = n, L.disableCursor = !!o);
|
|
1345
1345
|
});
|
|
1346
|
-
const
|
|
1347
|
-
[
|
|
1346
|
+
const J = {
|
|
1347
|
+
[je]: d ? "none" : void 0
|
|
1348
1348
|
};
|
|
1349
|
-
for (const
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1349
|
+
for (const L in S) {
|
|
1350
|
+
const P = He(c, L), O = S[L];
|
|
1351
|
+
J[P] = O;
|
|
1352
1352
|
}
|
|
1353
|
-
return /* @__PURE__ */ K(Be.Provider, { value:
|
|
1353
|
+
return /* @__PURE__ */ K(Be.Provider, { value: Z, children: /* @__PURE__ */ K(
|
|
1354
1354
|
"div",
|
|
1355
1355
|
{
|
|
1356
1356
|
...p,
|
|
@@ -1359,10 +1359,10 @@ function Ot({
|
|
|
1359
1359
|
"data-group": !0,
|
|
1360
1360
|
"data-testid": c,
|
|
1361
1361
|
id: c,
|
|
1362
|
-
ref:
|
|
1362
|
+
ref: oe,
|
|
1363
1363
|
style: {
|
|
1364
1364
|
...f,
|
|
1365
|
-
...
|
|
1365
|
+
...J,
|
|
1366
1366
|
display: "flex",
|
|
1367
1367
|
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1368
1368
|
flexWrap: "nowrap"
|
|
@@ -1379,54 +1379,57 @@ function Rt(e, t = 10) {
|
|
|
1379
1379
|
}, t);
|
|
1380
1380
|
};
|
|
1381
1381
|
}
|
|
1382
|
-
function
|
|
1383
|
-
return `react-resizable-panels:${e}`;
|
|
1382
|
+
function ie(e, t) {
|
|
1383
|
+
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1384
1384
|
}
|
|
1385
1385
|
function _t({
|
|
1386
1386
|
debounceSaveMs: e = 100,
|
|
1387
|
-
|
|
1388
|
-
|
|
1387
|
+
panelIds: t,
|
|
1388
|
+
storage: n,
|
|
1389
|
+
...o
|
|
1389
1390
|
}) {
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1392
|
-
() =>
|
|
1393
|
-
() =>
|
|
1394
|
-
),
|
|
1395
|
-
() =>
|
|
1396
|
-
[
|
|
1397
|
-
),
|
|
1398
|
-
const
|
|
1391
|
+
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = ie(s, t ?? []), r = Ze(
|
|
1392
|
+
Ct,
|
|
1393
|
+
() => n.getItem(l),
|
|
1394
|
+
() => n.getItem(l)
|
|
1395
|
+
), a = se(
|
|
1396
|
+
() => r ? JSON.parse(r) : void 0,
|
|
1397
|
+
[r]
|
|
1398
|
+
), u = se(() => {
|
|
1399
|
+
const f = (p) => {
|
|
1400
|
+
let h;
|
|
1401
|
+
i ? h = ie(s, Object.keys(p)) : h = ie(s, []);
|
|
1399
1402
|
try {
|
|
1400
|
-
|
|
1401
|
-
} catch (
|
|
1402
|
-
console.error(
|
|
1403
|
+
n.setItem(h, JSON.stringify(p));
|
|
1404
|
+
} catch (m) {
|
|
1405
|
+
console.error(m);
|
|
1403
1406
|
}
|
|
1404
1407
|
};
|
|
1405
|
-
return e > 0 ? Rt(
|
|
1406
|
-
}, [e,
|
|
1408
|
+
return e > 0 ? Rt(f, e) : f;
|
|
1409
|
+
}, [e, i, s, n]);
|
|
1407
1410
|
return {
|
|
1408
|
-
defaultLayout:
|
|
1409
|
-
onLayoutChange:
|
|
1411
|
+
defaultLayout: a,
|
|
1412
|
+
onLayoutChange: u
|
|
1410
1413
|
};
|
|
1411
1414
|
}
|
|
1412
|
-
function
|
|
1415
|
+
function Ct() {
|
|
1413
1416
|
return function() {
|
|
1414
1417
|
};
|
|
1415
1418
|
}
|
|
1416
1419
|
function Nt() {
|
|
1417
|
-
return
|
|
1420
|
+
return D(null);
|
|
1418
1421
|
}
|
|
1419
1422
|
function At() {
|
|
1420
|
-
return
|
|
1423
|
+
return I(null);
|
|
1421
1424
|
}
|
|
1422
|
-
function
|
|
1425
|
+
function de() {
|
|
1423
1426
|
const e = Je(Be);
|
|
1424
1427
|
return z(
|
|
1425
1428
|
e,
|
|
1426
1429
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1427
1430
|
), e;
|
|
1428
1431
|
}
|
|
1429
|
-
function
|
|
1432
|
+
function Et({
|
|
1430
1433
|
groupId: e,
|
|
1431
1434
|
panelId: t
|
|
1432
1435
|
}) {
|
|
@@ -1484,11 +1487,11 @@ function Mt({
|
|
|
1484
1487
|
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
1485
1488
|
prevLayout: h,
|
|
1486
1489
|
trigger: "imperative-api"
|
|
1487
|
-
}), v =
|
|
1490
|
+
}), v = N({
|
|
1488
1491
|
layout: y,
|
|
1489
1492
|
panelConstraints: f
|
|
1490
1493
|
});
|
|
1491
|
-
|
|
1494
|
+
U(h, v) || M((S) => ({
|
|
1492
1495
|
mountedGroups: new Map(S.mountedGroups).set(p, {
|
|
1493
1496
|
defaultLayoutDeferred: u,
|
|
1494
1497
|
derivedPanelConstraints: f,
|
|
@@ -1525,7 +1528,7 @@ function Mt({
|
|
|
1525
1528
|
let u;
|
|
1526
1529
|
switch (typeof r) {
|
|
1527
1530
|
case "number": {
|
|
1528
|
-
const { group: f } = n(), p =
|
|
1531
|
+
const { group: f } = n(), p = W({ group: f });
|
|
1529
1532
|
u = k(r / p * 100);
|
|
1530
1533
|
break;
|
|
1531
1534
|
}
|
|
@@ -1539,8 +1542,8 @@ function Mt({
|
|
|
1539
1542
|
}
|
|
1540
1543
|
};
|
|
1541
1544
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const { id: n } =
|
|
1545
|
+
function Mt(e, t) {
|
|
1546
|
+
const { id: n } = de(), o = I({
|
|
1544
1547
|
collapse: re,
|
|
1545
1548
|
expand: re,
|
|
1546
1549
|
getSize: () => ({
|
|
@@ -1550,10 +1553,10 @@ function It(e, t) {
|
|
|
1550
1553
|
isCollapsed: () => !1,
|
|
1551
1554
|
resize: re
|
|
1552
1555
|
});
|
|
1553
|
-
Ee(t, () => o.current, []),
|
|
1556
|
+
Ee(t, () => o.current, []), A(() => {
|
|
1554
1557
|
Object.assign(
|
|
1555
1558
|
o.current,
|
|
1556
|
-
|
|
1559
|
+
Et({ groupId: n, panelId: e })
|
|
1557
1560
|
);
|
|
1558
1561
|
});
|
|
1559
1562
|
}
|
|
@@ -1572,17 +1575,18 @@ function $t({
|
|
|
1572
1575
|
style: p,
|
|
1573
1576
|
...h
|
|
1574
1577
|
}) {
|
|
1575
|
-
const m = !!l, c =
|
|
1576
|
-
u?.(
|
|
1578
|
+
const m = !!l, c = ue(l), d = I(null), y = fe(d, s), { id: v, registerPanel: S } = de(), x = u !== null, g = ce((w) => {
|
|
1579
|
+
u?.(w, l);
|
|
1577
1580
|
});
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1581
|
+
A(() => {
|
|
1582
|
+
const w = d.current;
|
|
1583
|
+
if (w !== null)
|
|
1584
|
+
return S({
|
|
1585
|
+
element: w,
|
|
1582
1586
|
expandToSizeRef: { current: void 0 },
|
|
1583
1587
|
id: c,
|
|
1584
1588
|
idIsStable: m,
|
|
1585
|
-
onResize:
|
|
1589
|
+
onResize: x ? g : void 0,
|
|
1586
1590
|
panelConstraints: {
|
|
1587
1591
|
collapsedSize: n,
|
|
1588
1592
|
collapsible: o,
|
|
@@ -1595,16 +1599,15 @@ function $t({
|
|
|
1595
1599
|
n,
|
|
1596
1600
|
o,
|
|
1597
1601
|
i,
|
|
1598
|
-
|
|
1599
|
-
g,
|
|
1602
|
+
x,
|
|
1600
1603
|
c,
|
|
1601
1604
|
m,
|
|
1602
1605
|
r,
|
|
1603
1606
|
a,
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
]),
|
|
1607
|
-
const
|
|
1607
|
+
g,
|
|
1608
|
+
S
|
|
1609
|
+
]), Mt(c, f);
|
|
1610
|
+
const b = He(v, c);
|
|
1608
1611
|
return /* @__PURE__ */ K(
|
|
1609
1612
|
"div",
|
|
1610
1613
|
{
|
|
@@ -1612,17 +1615,17 @@ function $t({
|
|
|
1612
1615
|
"data-panel": !0,
|
|
1613
1616
|
"data-testid": c,
|
|
1614
1617
|
id: c,
|
|
1615
|
-
ref:
|
|
1618
|
+
ref: y,
|
|
1616
1619
|
style: {
|
|
1617
|
-
...
|
|
1620
|
+
...It,
|
|
1618
1621
|
flexBasis: 0,
|
|
1619
|
-
flexGrow: `var(${
|
|
1622
|
+
flexGrow: `var(${b}, 1)`,
|
|
1620
1623
|
flexShrink: 1,
|
|
1621
1624
|
// Prevent Panel content from interfering with panel size
|
|
1622
1625
|
overflow: "hidden",
|
|
1623
1626
|
// Disable pointer events inside of a panel during resize
|
|
1624
1627
|
// This avoid edge cases like nested iframes
|
|
1625
|
-
pointerEvents: `var(${
|
|
1628
|
+
pointerEvents: `var(${je})`
|
|
1626
1629
|
},
|
|
1627
1630
|
children: /* @__PURE__ */ K(
|
|
1628
1631
|
"div",
|
|
@@ -1639,7 +1642,7 @@ function $t({
|
|
|
1639
1642
|
}
|
|
1640
1643
|
);
|
|
1641
1644
|
}
|
|
1642
|
-
const
|
|
1645
|
+
const It = {
|
|
1643
1646
|
minHeight: "unset",
|
|
1644
1647
|
maxHeight: "unset",
|
|
1645
1648
|
height: "unset",
|
|
@@ -1656,12 +1659,12 @@ const kt = {
|
|
|
1656
1659
|
margin: "unset"
|
|
1657
1660
|
};
|
|
1658
1661
|
function Ft() {
|
|
1659
|
-
return I(null);
|
|
1660
|
-
}
|
|
1661
|
-
function Ht() {
|
|
1662
1662
|
return D(null);
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1664
|
+
function jt() {
|
|
1665
|
+
return I(null);
|
|
1666
|
+
}
|
|
1667
|
+
function kt({
|
|
1665
1668
|
layout: e,
|
|
1666
1669
|
panelConstraints: t,
|
|
1667
1670
|
panelId: n,
|
|
@@ -1673,7 +1676,7 @@ function Gt({
|
|
|
1673
1676
|
);
|
|
1674
1677
|
if (r) {
|
|
1675
1678
|
const a = r.maxSize, u = s = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
|
|
1676
|
-
s =
|
|
1679
|
+
s = N({
|
|
1677
1680
|
layout: q({
|
|
1678
1681
|
delta: u - l,
|
|
1679
1682
|
initialLayout: e,
|
|
@@ -1683,7 +1686,7 @@ function Gt({
|
|
|
1683
1686
|
trigger: "keyboard"
|
|
1684
1687
|
}),
|
|
1685
1688
|
panelConstraints: t
|
|
1686
|
-
})[n], i =
|
|
1689
|
+
})[n], i = N({
|
|
1687
1690
|
layout: q({
|
|
1688
1691
|
delta: a - l,
|
|
1689
1692
|
initialLayout: e,
|
|
@@ -1702,7 +1705,7 @@ function Gt({
|
|
|
1702
1705
|
valueNow: l
|
|
1703
1706
|
};
|
|
1704
1707
|
}
|
|
1705
|
-
function
|
|
1708
|
+
function Ht({
|
|
1706
1709
|
children: e,
|
|
1707
1710
|
className: t,
|
|
1708
1711
|
elementRef: n,
|
|
@@ -1710,40 +1713,40 @@ function jt({
|
|
|
1710
1713
|
style: i,
|
|
1711
1714
|
...s
|
|
1712
1715
|
}) {
|
|
1713
|
-
const l =
|
|
1716
|
+
const l = ue(o), [r, a] = D({}), [u, f] = D("inactive"), [p, h] = D(null), m = fe(h, n), {
|
|
1714
1717
|
id: c,
|
|
1715
1718
|
orientation: d,
|
|
1716
1719
|
registerSeparator: y
|
|
1717
|
-
} =
|
|
1718
|
-
return
|
|
1720
|
+
} = de(), v = d === "horizontal" ? "vertical" : "horizontal";
|
|
1721
|
+
return A(() => {
|
|
1719
1722
|
if (p !== null) {
|
|
1720
1723
|
const S = {
|
|
1721
1724
|
element: p,
|
|
1722
1725
|
id: l
|
|
1723
|
-
}, x = y(S), g =
|
|
1726
|
+
}, x = y(S), g = _.addListener(
|
|
1724
1727
|
"interactionStateChange",
|
|
1725
|
-
(
|
|
1728
|
+
(w) => {
|
|
1726
1729
|
f(
|
|
1727
|
-
|
|
1728
|
-
(
|
|
1729
|
-
) ?
|
|
1730
|
+
w.state !== "inactive" && w.hitRegions.some(
|
|
1731
|
+
(C) => C.separator === S
|
|
1732
|
+
) ? w.state : "inactive"
|
|
1730
1733
|
);
|
|
1731
1734
|
}
|
|
1732
|
-
),
|
|
1735
|
+
), b = _.addListener(
|
|
1733
1736
|
"mountedGroupsChange",
|
|
1734
|
-
(
|
|
1735
|
-
|
|
1736
|
-
({ derivedPanelConstraints:
|
|
1737
|
-
if (
|
|
1738
|
-
const
|
|
1739
|
-
if (
|
|
1740
|
-
const
|
|
1737
|
+
(w) => {
|
|
1738
|
+
w.forEach(
|
|
1739
|
+
({ derivedPanelConstraints: C, layout: Y, separatorToPanels: oe }, Z) => {
|
|
1740
|
+
if (Z.id === c) {
|
|
1741
|
+
const $ = oe.get(S);
|
|
1742
|
+
if ($) {
|
|
1743
|
+
const F = $[0], J = Z.panels.indexOf(F);
|
|
1741
1744
|
a(
|
|
1742
|
-
|
|
1745
|
+
kt({
|
|
1743
1746
|
layout: Y,
|
|
1744
|
-
panelConstraints:
|
|
1745
|
-
panelId:
|
|
1746
|
-
panelIndex:
|
|
1747
|
+
panelConstraints: C,
|
|
1748
|
+
panelId: F.id,
|
|
1749
|
+
panelIndex: J
|
|
1747
1750
|
})
|
|
1748
1751
|
);
|
|
1749
1752
|
}
|
|
@@ -1753,7 +1756,7 @@ function jt({
|
|
|
1753
1756
|
}
|
|
1754
1757
|
);
|
|
1755
1758
|
return () => {
|
|
1756
|
-
g(),
|
|
1759
|
+
g(), b(), x();
|
|
1757
1760
|
};
|
|
1758
1761
|
}
|
|
1759
1762
|
}, [p, c, l, y]), /* @__PURE__ */ K(
|
|
@@ -1783,13 +1786,13 @@ function jt({
|
|
|
1783
1786
|
);
|
|
1784
1787
|
}
|
|
1785
1788
|
export {
|
|
1786
|
-
|
|
1789
|
+
Tt as Group,
|
|
1787
1790
|
$t as Panel,
|
|
1788
|
-
|
|
1791
|
+
Ht as Separator,
|
|
1789
1792
|
_t as useDefaultLayout,
|
|
1790
1793
|
Nt as useGroupCallbackRef,
|
|
1791
1794
|
At as useGroupRef,
|
|
1792
1795
|
Ft as usePanelCallbackRef,
|
|
1793
|
-
|
|
1796
|
+
jt as usePanelRef
|
|
1794
1797
|
};
|
|
1795
1798
|
//# sourceMappingURL=react-resizable-panels.js.map
|