react-resizable-panels 4.5.8-alpha.0 → 4.5.9-alpha.0
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,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as q } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Y, useCallback as K, useId as tt, useLayoutEffect as Oe, useEffect as Te, useRef as k, createContext as nt, useImperativeHandle as Ne, useMemo as Ae, useSyncExternalStore as _e, useContext as ot } from "react";
|
|
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;
|
|
@@ -53,7 +53,7 @@ function st({
|
|
|
53
53
|
const { x: s, y: a } = $e(o, l), u = e === "horizontal" ? s : a;
|
|
54
54
|
u < r && (r = u, i = l);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
59
|
function at() {
|
|
@@ -143,7 +143,7 @@ function He(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
146
|
+
groupSize: W({ group: e }),
|
|
147
147
|
panels: [a, h],
|
|
148
148
|
separator: "width" in d ? void 0 : d,
|
|
149
149
|
rect: p
|
|
@@ -224,7 +224,7 @@ function D(e) {
|
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
226
|
function Se(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
227
|
+
const { panels: t } = e, n = W({ group: e });
|
|
228
228
|
return n === 0 ? t.map((o) => ({
|
|
229
229
|
collapsedSize: 0,
|
|
230
230
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -329,7 +329,7 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
332
|
+
const O = new pt();
|
|
333
333
|
function E() {
|
|
334
334
|
return I;
|
|
335
335
|
}
|
|
@@ -341,7 +341,7 @@ function M(e) {
|
|
|
341
341
|
return I = {
|
|
342
342
|
...I,
|
|
343
343
|
...t
|
|
344
|
-
}, t.cursorFlags !== void 0 &&
|
|
344
|
+
}, t.cursorFlags !== void 0 && O.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && O.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
|
|
345
345
|
o.derivedPanelConstraints.forEach((r) => {
|
|
346
346
|
if (r.collapsible) {
|
|
347
347
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
@@ -357,7 +357,7 @@ function M(e) {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
}),
|
|
360
|
+
}), O.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
362
|
function mt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
@@ -388,19 +388,19 @@ function ht(e) {
|
|
|
388
388
|
function gt(e, t) {
|
|
389
389
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
390
390
|
const n = {
|
|
391
|
-
a:
|
|
392
|
-
b:
|
|
391
|
+
a: ze(e),
|
|
392
|
+
b: ze(t)
|
|
393
393
|
};
|
|
394
394
|
let o;
|
|
395
395
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
396
396
|
o = n.a.pop(), n.b.pop();
|
|
397
|
-
|
|
397
|
+
z(
|
|
398
398
|
o,
|
|
399
399
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
400
400
|
);
|
|
401
401
|
const i = {
|
|
402
|
-
a:
|
|
403
|
-
b:
|
|
402
|
+
a: xe(ve(n.a)),
|
|
403
|
+
b: xe(ve(n.b))
|
|
404
404
|
};
|
|
405
405
|
if (i.a === i.b) {
|
|
406
406
|
const r = o.childNodes, l = {
|
|
@@ -429,14 +429,14 @@ function ve(e) {
|
|
|
429
429
|
let t = e.length;
|
|
430
430
|
for (; t--; ) {
|
|
431
431
|
const n = e[t];
|
|
432
|
-
if (
|
|
432
|
+
if (z(n, "Missing node"), vt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function xe(e) {
|
|
437
437
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function ze(e) {
|
|
440
440
|
const t = [];
|
|
441
441
|
for (; e; )
|
|
442
442
|
t.push(e), e = je(e);
|
|
@@ -446,10 +446,10 @@ function je(e) {
|
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
447
|
return ht(t) ? t.host : t;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function xt(e, t) {
|
|
450
450
|
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function zt({
|
|
453
453
|
groupElement: e,
|
|
454
454
|
hitRegion: t,
|
|
455
455
|
pointerEventTarget: n
|
|
@@ -461,7 +461,7 @@ function xt({
|
|
|
461
461
|
for (; o; ) {
|
|
462
462
|
if (o.contains(e))
|
|
463
463
|
return !0;
|
|
464
|
-
if (
|
|
464
|
+
if (xt(o.getBoundingClientRect(), t))
|
|
465
465
|
return !1;
|
|
466
466
|
o = o.parentElement;
|
|
467
467
|
}
|
|
@@ -477,7 +477,7 @@ function de(e, t) {
|
|
|
477
477
|
x: e.clientX,
|
|
478
478
|
y: e.clientY
|
|
479
479
|
});
|
|
480
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 &&
|
|
480
|
+
l && l.distance.x <= 0 && l.distance.y <= 0 && zt({
|
|
481
481
|
groupElement: i.element,
|
|
482
482
|
hitRegion: l.hitRegion.rect,
|
|
483
483
|
pointerEventTarget: e.target
|
|
@@ -492,10 +492,10 @@ function bt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function J(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function V({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -505,10 +505,10 @@ function W({
|
|
|
505
505
|
maxSize: i = 100,
|
|
506
506
|
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (J(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
510
|
const l = (n + r) / 2;
|
|
511
|
-
|
|
511
|
+
J(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
513
|
t = r;
|
|
514
514
|
return t = Math.min(i, t), t = D(t), t;
|
|
@@ -524,13 +524,13 @@ function Z({
|
|
|
524
524
|
if (R(e, 0))
|
|
525
525
|
return t;
|
|
526
526
|
const l = Object.values(t), s = Object.values(i), a = [...l], [u, c] = o;
|
|
527
|
-
|
|
527
|
+
z(u != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
|
|
528
528
|
let h = 0;
|
|
529
529
|
switch (r) {
|
|
530
530
|
case "keyboard": {
|
|
531
531
|
{
|
|
532
532
|
const f = e < 0 ? c : u, d = n[f];
|
|
533
|
-
|
|
533
|
+
z(
|
|
534
534
|
d,
|
|
535
535
|
`Panel constraints not found for index ${f}`
|
|
536
536
|
);
|
|
@@ -540,19 +540,19 @@ function Z({
|
|
|
540
540
|
minSize: v = 0
|
|
541
541
|
} = d;
|
|
542
542
|
if (g) {
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
|
|
543
|
+
const x = l[f];
|
|
544
|
+
if (z(
|
|
545
|
+
x != null,
|
|
546
546
|
`Previous layout not found for panel index ${f}`
|
|
547
|
-
), R(
|
|
548
|
-
const S = v -
|
|
549
|
-
|
|
547
|
+
), R(x, p)) {
|
|
548
|
+
const S = v - x;
|
|
549
|
+
J(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
{
|
|
554
554
|
const f = e < 0 ? u : c, d = n[f];
|
|
555
|
-
|
|
555
|
+
z(
|
|
556
556
|
d,
|
|
557
557
|
`No panel constraints found for index ${f}`
|
|
558
558
|
);
|
|
@@ -562,46 +562,29 @@ function Z({
|
|
|
562
562
|
minSize: v = 0
|
|
563
563
|
} = d;
|
|
564
564
|
if (g) {
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
567
|
-
|
|
565
|
+
const x = l[f];
|
|
566
|
+
if (z(
|
|
567
|
+
x != null,
|
|
568
568
|
`Previous layout not found for panel index ${f}`
|
|
569
|
-
), R(
|
|
570
|
-
const S =
|
|
571
|
-
|
|
569
|
+
), R(x, v)) {
|
|
570
|
+
const S = x - p;
|
|
571
|
+
J(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
-
default: {
|
|
578
|
-
const f = e < 0 ? c : u, d = n[f];
|
|
579
|
-
x(
|
|
580
|
-
d,
|
|
581
|
-
`Panel constraints not found for index ${f}`
|
|
582
|
-
);
|
|
583
|
-
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
|
-
if (p)
|
|
585
|
-
if (e > 0) {
|
|
586
|
-
const z = v - g, S = z / 2;
|
|
587
|
-
O(e, z) < 0 && (e = O(e, S) <= 0 ? 0 : z);
|
|
588
|
-
} else {
|
|
589
|
-
const z = v - g, S = 100 - z / 2;
|
|
590
|
-
O(Math.abs(e), z) < 0 && (e = O(100 + e, S) > 0 ? 0 : -z);
|
|
591
|
-
}
|
|
592
|
-
break;
|
|
593
|
-
}
|
|
594
577
|
}
|
|
595
578
|
{
|
|
596
579
|
const f = e < 0 ? 1 : -1;
|
|
597
580
|
let d = e < 0 ? c : u, p = 0;
|
|
598
581
|
for (; ; ) {
|
|
599
582
|
const v = l[d];
|
|
600
|
-
|
|
583
|
+
z(
|
|
601
584
|
v != null,
|
|
602
585
|
`Previous layout not found for panel index ${d}`
|
|
603
586
|
);
|
|
604
|
-
const S =
|
|
587
|
+
const S = V({
|
|
605
588
|
panelConstraints: n[d],
|
|
606
589
|
size: 100
|
|
607
590
|
}) - v;
|
|
@@ -615,15 +598,15 @@ function Z({
|
|
|
615
598
|
let d = e < 0 ? u : c;
|
|
616
599
|
for (; d >= 0 && d < n.length; ) {
|
|
617
600
|
const p = Math.abs(e) - Math.abs(h), g = l[d];
|
|
618
|
-
|
|
601
|
+
z(
|
|
619
602
|
g != null,
|
|
620
603
|
`Previous layout not found for panel index ${d}`
|
|
621
604
|
);
|
|
622
|
-
const v = g - p,
|
|
605
|
+
const v = g - p, x = V({
|
|
623
606
|
panelConstraints: n[d],
|
|
624
607
|
size: v
|
|
625
608
|
});
|
|
626
|
-
if (!R(g,
|
|
609
|
+
if (!R(g, x) && (h += g - x, a[d] = x, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
627
610
|
numeric: !0
|
|
628
611
|
}) >= 0))
|
|
629
612
|
break;
|
|
@@ -634,11 +617,11 @@ function Z({
|
|
|
634
617
|
return i;
|
|
635
618
|
{
|
|
636
619
|
const f = e < 0 ? c : u, d = l[f];
|
|
637
|
-
|
|
620
|
+
z(
|
|
638
621
|
d != null,
|
|
639
622
|
`Previous layout not found for panel index ${f}`
|
|
640
623
|
);
|
|
641
|
-
const p = d + h, g =
|
|
624
|
+
const p = d + h, g = V({
|
|
642
625
|
panelConstraints: n[f],
|
|
643
626
|
size: p
|
|
644
627
|
});
|
|
@@ -646,11 +629,11 @@ function Z({
|
|
|
646
629
|
let v = p - g, S = e < 0 ? c : u;
|
|
647
630
|
for (; S >= 0 && S < n.length; ) {
|
|
648
631
|
const L = a[S];
|
|
649
|
-
|
|
632
|
+
z(
|
|
650
633
|
L != null,
|
|
651
634
|
`Previous layout not found for panel index ${S}`
|
|
652
635
|
);
|
|
653
|
-
const P = L + v, b =
|
|
636
|
+
const P = L + v, b = V({
|
|
654
637
|
panelConstraints: n[S],
|
|
655
638
|
size: P
|
|
656
639
|
});
|
|
@@ -673,11 +656,11 @@ function A(e, t) {
|
|
|
673
656
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
674
657
|
return !1;
|
|
675
658
|
for (const n in e)
|
|
676
|
-
if (t[n] === void 0 ||
|
|
659
|
+
if (t[n] === void 0 || J(e[n], t[n]) !== 0)
|
|
677
660
|
return !1;
|
|
678
661
|
return !0;
|
|
679
662
|
}
|
|
680
|
-
function
|
|
663
|
+
function _({
|
|
681
664
|
layout: e,
|
|
682
665
|
panelConstraints: t
|
|
683
666
|
}) {
|
|
@@ -692,15 +675,15 @@ function F({
|
|
|
692
675
|
if (!R(i, 100) && o.length > 0)
|
|
693
676
|
for (let s = 0; s < t.length; s++) {
|
|
694
677
|
const a = o[s];
|
|
695
|
-
|
|
678
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
696
679
|
const u = 100 / i * a;
|
|
697
680
|
o[s] = u;
|
|
698
681
|
}
|
|
699
682
|
let r = 0;
|
|
700
683
|
for (let s = 0; s < t.length; s++) {
|
|
701
684
|
const a = o[s];
|
|
702
|
-
|
|
703
|
-
const u =
|
|
685
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
686
|
+
const u = V({
|
|
704
687
|
panelConstraints: t[s],
|
|
705
688
|
size: a
|
|
706
689
|
});
|
|
@@ -709,8 +692,8 @@ function F({
|
|
|
709
692
|
if (!R(r, 0))
|
|
710
693
|
for (let s = 0; s < t.length; s++) {
|
|
711
694
|
const a = o[s];
|
|
712
|
-
|
|
713
|
-
const u = a + r, c =
|
|
695
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
696
|
+
const u = a + r, c = V({
|
|
714
697
|
panelConstraints: t[s],
|
|
715
698
|
size: u
|
|
716
699
|
});
|
|
@@ -778,7 +761,7 @@ function Ve({
|
|
|
778
761
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
779
762
|
prevLayout: y,
|
|
780
763
|
trigger: "imperative-api"
|
|
781
|
-
}), g =
|
|
764
|
+
}), g = _({
|
|
782
765
|
layout: p,
|
|
783
766
|
panelConstraints: c
|
|
784
767
|
});
|
|
@@ -819,7 +802,7 @@ function Ve({
|
|
|
819
802
|
let u;
|
|
820
803
|
switch (typeof s) {
|
|
821
804
|
case "number": {
|
|
822
|
-
const { group: c } = n(), h =
|
|
805
|
+
const { group: c } = n(), h = W({ group: c });
|
|
823
806
|
u = D(s / h * 100);
|
|
824
807
|
break;
|
|
825
808
|
}
|
|
@@ -883,7 +866,7 @@ function We({
|
|
|
883
866
|
group: r,
|
|
884
867
|
layout: l,
|
|
885
868
|
separatorToPanels: s
|
|
886
|
-
} = t(), a =
|
|
869
|
+
} = t(), a = _({
|
|
887
870
|
layout: n,
|
|
888
871
|
panelConstraints: i
|
|
889
872
|
});
|
|
@@ -900,15 +883,15 @@ function We({
|
|
|
900
883
|
}
|
|
901
884
|
function Ue(e) {
|
|
902
885
|
const { mountedGroups: t } = E(), n = t.get(e);
|
|
903
|
-
return
|
|
886
|
+
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
904
887
|
}
|
|
905
|
-
function
|
|
888
|
+
function N(e, t) {
|
|
906
889
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
907
890
|
(h) => h.element === e
|
|
908
891
|
);
|
|
909
|
-
|
|
892
|
+
z(i, "Matching separator not found");
|
|
910
893
|
const r = o.separatorToPanels.get(i);
|
|
911
|
-
|
|
894
|
+
z(r, "Matching panels not found");
|
|
912
895
|
const l = r.map((h) => n.panels.indexOf(h)), a = We({ groupId: n.id }).getLayout(), u = Z({
|
|
913
896
|
delta: t,
|
|
914
897
|
initialLayout: a,
|
|
@@ -916,7 +899,7 @@ function _(e, t) {
|
|
|
916
899
|
pivotIndices: l,
|
|
917
900
|
prevLayout: a,
|
|
918
901
|
trigger: "keyboard"
|
|
919
|
-
}), c =
|
|
902
|
+
}), c = _({
|
|
920
903
|
layout: u,
|
|
921
904
|
panelConstraints: o.derivedPanelConstraints
|
|
922
905
|
});
|
|
@@ -936,23 +919,23 @@ function we(e) {
|
|
|
936
919
|
if (!n.disabled)
|
|
937
920
|
switch (e.key) {
|
|
938
921
|
case "ArrowDown": {
|
|
939
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
922
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, 5);
|
|
940
923
|
break;
|
|
941
924
|
}
|
|
942
925
|
case "ArrowLeft": {
|
|
943
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
926
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, -5);
|
|
944
927
|
break;
|
|
945
928
|
}
|
|
946
929
|
case "ArrowRight": {
|
|
947
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
930
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, 5);
|
|
948
931
|
break;
|
|
949
932
|
}
|
|
950
933
|
case "ArrowUp": {
|
|
951
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
934
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, -5);
|
|
952
935
|
break;
|
|
953
936
|
}
|
|
954
937
|
case "End": {
|
|
955
|
-
e.preventDefault(),
|
|
938
|
+
e.preventDefault(), N(t, 100);
|
|
956
939
|
break;
|
|
957
940
|
}
|
|
958
941
|
case "Enter": {
|
|
@@ -960,15 +943,15 @@ function we(e) {
|
|
|
960
943
|
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
961
944
|
(h) => h.element === t
|
|
962
945
|
);
|
|
963
|
-
|
|
946
|
+
z(s, "Matching separator not found");
|
|
964
947
|
const a = l.get(s);
|
|
965
|
-
|
|
948
|
+
z(a, "Matching panels not found");
|
|
966
949
|
const u = a[0], c = i.find(
|
|
967
950
|
(h) => h.panelId === u.id
|
|
968
951
|
);
|
|
969
|
-
if (
|
|
952
|
+
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
970
953
|
const h = r[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
971
|
-
|
|
954
|
+
N(t, y - h);
|
|
972
955
|
}
|
|
973
956
|
break;
|
|
974
957
|
}
|
|
@@ -979,13 +962,13 @@ function we(e) {
|
|
|
979
962
|
), r = Array.from(i).findIndex(
|
|
980
963
|
(a) => a === e.currentTarget
|
|
981
964
|
);
|
|
982
|
-
|
|
965
|
+
z(r !== null, "Index not found");
|
|
983
966
|
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
984
967
|
i[l].focus();
|
|
985
968
|
break;
|
|
986
969
|
}
|
|
987
970
|
case "Home": {
|
|
988
|
-
e.preventDefault(),
|
|
971
|
+
e.preventDefault(), N(t, -100);
|
|
989
972
|
break;
|
|
990
973
|
}
|
|
991
974
|
}
|
|
@@ -1106,15 +1089,15 @@ function Ye({
|
|
|
1106
1089
|
r ? f === "horizontal" ? p = (t.clientX - r.x) / y * 100 : p = (t.clientY - r.y) / y * 100 : f === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
1107
1090
|
const g = o.get(h), {
|
|
1108
1091
|
defaultLayoutDeferred: v,
|
|
1109
|
-
derivedPanelConstraints:
|
|
1092
|
+
derivedPanelConstraints: x,
|
|
1110
1093
|
layout: S,
|
|
1111
1094
|
separatorToPanels: L
|
|
1112
1095
|
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1113
|
-
if (
|
|
1096
|
+
if (x && g && S && L) {
|
|
1114
1097
|
const P = Z({
|
|
1115
1098
|
delta: p,
|
|
1116
1099
|
initialLayout: g,
|
|
1117
|
-
panelConstraints:
|
|
1100
|
+
panelConstraints: x,
|
|
1118
1101
|
pivotIndices: c.panels.map((b) => d.indexOf(b)),
|
|
1119
1102
|
prevLayout: S,
|
|
1120
1103
|
trigger: "mouse-or-touch"
|
|
@@ -1134,11 +1117,11 @@ function Ye({
|
|
|
1134
1117
|
} else {
|
|
1135
1118
|
a.set(c.group, {
|
|
1136
1119
|
defaultLayoutDeferred: v,
|
|
1137
|
-
derivedPanelConstraints:
|
|
1120
|
+
derivedPanelConstraints: x,
|
|
1138
1121
|
layout: P,
|
|
1139
1122
|
separatorToPanels: L
|
|
1140
1123
|
});
|
|
1141
|
-
const b = c.group.panels.map(({ id:
|
|
1124
|
+
const b = c.group.panels.map(({ id: $ }) => $).join(",");
|
|
1142
1125
|
c.group.inMemoryLayouts[b] = P;
|
|
1143
1126
|
}
|
|
1144
1127
|
}
|
|
@@ -1163,7 +1146,7 @@ function Ee(e) {
|
|
|
1163
1146
|
});
|
|
1164
1147
|
}
|
|
1165
1148
|
}
|
|
1166
|
-
function
|
|
1149
|
+
function Ge(e) {
|
|
1167
1150
|
if (e.defaultPrevented)
|
|
1168
1151
|
return;
|
|
1169
1152
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
@@ -1210,7 +1193,7 @@ function ke(e) {
|
|
|
1210
1193
|
}
|
|
1211
1194
|
}
|
|
1212
1195
|
}
|
|
1213
|
-
function
|
|
1196
|
+
function ke(e) {
|
|
1214
1197
|
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1215
1198
|
const { interactionState: t } = E();
|
|
1216
1199
|
switch (t.state) {
|
|
@@ -1265,7 +1248,7 @@ function Ct(e, t, n) {
|
|
|
1265
1248
|
const i = e.panels.find((u) => u.element === t);
|
|
1266
1249
|
if (!i || !i.onResize)
|
|
1267
1250
|
return;
|
|
1268
|
-
const r =
|
|
1251
|
+
const r = W({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1269
1252
|
asPercentage: D(l / r * 100),
|
|
1270
1253
|
inPixels: l
|
|
1271
1254
|
};
|
|
@@ -1288,10 +1271,10 @@ function Rt(e, t) {
|
|
|
1288
1271
|
return !1;
|
|
1289
1272
|
return !0;
|
|
1290
1273
|
}
|
|
1291
|
-
const
|
|
1274
|
+
const j = /* @__PURE__ */ new Map();
|
|
1292
1275
|
function Mt(e) {
|
|
1293
1276
|
let t = !0;
|
|
1294
|
-
|
|
1277
|
+
z(
|
|
1295
1278
|
e.element.ownerDocument.defaultView,
|
|
1296
1279
|
"Cannot register an unmounted Group"
|
|
1297
1280
|
);
|
|
@@ -1300,20 +1283,20 @@ function Mt(e) {
|
|
|
1300
1283
|
const { borderBoxSize: p, target: g } = d;
|
|
1301
1284
|
if (g === e.element) {
|
|
1302
1285
|
if (t) {
|
|
1303
|
-
if (
|
|
1286
|
+
if (W({ group: e }) === 0)
|
|
1304
1287
|
return;
|
|
1305
|
-
M((
|
|
1306
|
-
const S =
|
|
1288
|
+
M((x) => {
|
|
1289
|
+
const S = x.mountedGroups.get(e);
|
|
1307
1290
|
if (S) {
|
|
1308
|
-
const L = Se(e), P = S.defaultLayoutDeferred ? De(L) : S.layout, b =
|
|
1291
|
+
const L = Se(e), P = S.defaultLayoutDeferred ? De(L) : S.layout, b = _({
|
|
1309
1292
|
layout: P,
|
|
1310
1293
|
panelConstraints: L
|
|
1311
1294
|
});
|
|
1312
1295
|
return !S.defaultLayoutDeferred && A(P, b) && Pt(
|
|
1313
1296
|
S.derivedPanelConstraints,
|
|
1314
1297
|
L
|
|
1315
|
-
) ?
|
|
1316
|
-
mountedGroups: new Map(
|
|
1298
|
+
) ? x : {
|
|
1299
|
+
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1317
1300
|
defaultLayoutDeferred: !1,
|
|
1318
1301
|
derivedPanelConstraints: L,
|
|
1319
1302
|
layout: b,
|
|
@@ -1321,7 +1304,7 @@ function Mt(e) {
|
|
|
1321
1304
|
})
|
|
1322
1305
|
};
|
|
1323
1306
|
}
|
|
1324
|
-
return
|
|
1307
|
+
return x;
|
|
1325
1308
|
});
|
|
1326
1309
|
}
|
|
1327
1310
|
} else
|
|
@@ -1329,23 +1312,23 @@ function Mt(e) {
|
|
|
1329
1312
|
}
|
|
1330
1313
|
});
|
|
1331
1314
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
1332
|
-
|
|
1315
|
+
z(
|
|
1333
1316
|
!o.has(f.id),
|
|
1334
1317
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1335
1318
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1336
1319
|
});
|
|
1337
|
-
const l =
|
|
1320
|
+
const l = W({ group: e }), s = Se(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1338
1321
|
let u = e.defaultLayout;
|
|
1339
1322
|
u && (Rt(e.panels, u) || (u = void 0));
|
|
1340
|
-
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h =
|
|
1323
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = _({
|
|
1341
1324
|
layout: c,
|
|
1342
1325
|
panelConstraints: s
|
|
1343
1326
|
}), y = He(e), m = e.element.ownerDocument;
|
|
1344
1327
|
return M((f) => {
|
|
1345
1328
|
const d = /* @__PURE__ */ new Map();
|
|
1346
|
-
return
|
|
1329
|
+
return j.set(
|
|
1347
1330
|
m,
|
|
1348
|
-
(
|
|
1331
|
+
(j.get(m) ?? 0) + 1
|
|
1349
1332
|
), y.forEach((p) => {
|
|
1350
1333
|
p.separator && d.set(p.separator, p.panels);
|
|
1351
1334
|
}), {
|
|
@@ -1357,20 +1340,20 @@ function Mt(e) {
|
|
|
1357
1340
|
})
|
|
1358
1341
|
};
|
|
1359
1342
|
}), e.separators.forEach((f) => {
|
|
1360
|
-
|
|
1343
|
+
z(
|
|
1361
1344
|
!i.has(f.id),
|
|
1362
1345
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1363
1346
|
), i.add(f.id), f.element.addEventListener("keydown", we);
|
|
1364
|
-
}),
|
|
1365
|
-
t = !1,
|
|
1347
|
+
}), j.get(m) === 1 && (m.addEventListener("dblclick", be, !0), m.addEventListener("pointerdown", Le, !0), m.addEventListener("pointerleave", Ee), m.addEventListener("pointermove", Ge), m.addEventListener("pointerout", ke), m.addEventListener("pointerup", Ie, !0)), function() {
|
|
1348
|
+
t = !1, j.set(
|
|
1366
1349
|
m,
|
|
1367
|
-
Math.max(0, (
|
|
1350
|
+
Math.max(0, (j.get(m) ?? 0) - 1)
|
|
1368
1351
|
), M((d) => {
|
|
1369
1352
|
const p = new Map(d.mountedGroups);
|
|
1370
1353
|
return p.delete(e), { mountedGroups: p };
|
|
1371
1354
|
}), e.separators.forEach((d) => {
|
|
1372
1355
|
d.element.removeEventListener("keydown", we);
|
|
1373
|
-
}),
|
|
1356
|
+
}), j.get(m) || (m.removeEventListener(
|
|
1374
1357
|
"dblclick",
|
|
1375
1358
|
be,
|
|
1376
1359
|
!0
|
|
@@ -1378,29 +1361,29 @@ function Mt(e) {
|
|
|
1378
1361
|
"pointerdown",
|
|
1379
1362
|
Le,
|
|
1380
1363
|
!0
|
|
1381
|
-
), m.removeEventListener("pointerleave", Ee), m.removeEventListener("pointermove",
|
|
1364
|
+
), m.removeEventListener("pointerleave", Ee), m.removeEventListener("pointermove", Ge), m.removeEventListener("pointerout", ke), m.removeEventListener("pointerup", Ie, !0)), r.disconnect();
|
|
1382
1365
|
};
|
|
1383
1366
|
}
|
|
1384
1367
|
function Et() {
|
|
1385
|
-
const [e, t] =
|
|
1368
|
+
const [e, t] = Y({}), n = K(() => t({}), []);
|
|
1386
1369
|
return [e, n];
|
|
1387
1370
|
}
|
|
1388
1371
|
function me(e) {
|
|
1389
1372
|
const t = tt();
|
|
1390
1373
|
return `${e ?? t}`;
|
|
1391
1374
|
}
|
|
1392
|
-
const
|
|
1393
|
-
function
|
|
1394
|
-
const t =
|
|
1395
|
-
return
|
|
1375
|
+
const F = typeof window < "u" ? Oe : Te;
|
|
1376
|
+
function X(e) {
|
|
1377
|
+
const t = k(e);
|
|
1378
|
+
return F(() => {
|
|
1396
1379
|
t.current = e;
|
|
1397
|
-
}, [e]),
|
|
1380
|
+
}, [e]), K(
|
|
1398
1381
|
(...n) => t.current?.(...n),
|
|
1399
1382
|
[t]
|
|
1400
1383
|
);
|
|
1401
1384
|
}
|
|
1402
1385
|
function he(...e) {
|
|
1403
|
-
return
|
|
1386
|
+
return X((t) => {
|
|
1404
1387
|
e.forEach((n) => {
|
|
1405
1388
|
if (n)
|
|
1406
1389
|
switch (typeof n) {
|
|
@@ -1416,20 +1399,20 @@ function he(...e) {
|
|
|
1416
1399
|
});
|
|
1417
1400
|
});
|
|
1418
1401
|
}
|
|
1419
|
-
function
|
|
1420
|
-
const t =
|
|
1421
|
-
return
|
|
1402
|
+
function Gt(e) {
|
|
1403
|
+
const t = k({ ...e });
|
|
1404
|
+
return F(() => {
|
|
1422
1405
|
for (const n in e)
|
|
1423
1406
|
t.current[n] = e[n];
|
|
1424
1407
|
}, [e]), t.current;
|
|
1425
1408
|
}
|
|
1426
1409
|
const Je = nt(null);
|
|
1427
|
-
function
|
|
1428
|
-
const n =
|
|
1410
|
+
function kt(e, t) {
|
|
1411
|
+
const n = k({
|
|
1429
1412
|
getLayout: () => ({}),
|
|
1430
1413
|
setLayout: wt
|
|
1431
1414
|
});
|
|
1432
|
-
Ne(t, () => n.current, []),
|
|
1415
|
+
Ne(t, () => n.current, []), F(() => {
|
|
1433
1416
|
Object.assign(
|
|
1434
1417
|
n.current,
|
|
1435
1418
|
We({ groupId: e })
|
|
@@ -1455,39 +1438,39 @@ function It({
|
|
|
1455
1438
|
style: y,
|
|
1456
1439
|
...m
|
|
1457
1440
|
}) {
|
|
1458
|
-
const f =
|
|
1441
|
+
const f = k({
|
|
1459
1442
|
onLayoutChange: {},
|
|
1460
1443
|
onLayoutChanged: {}
|
|
1461
|
-
}), d =
|
|
1444
|
+
}), d = X((w) => {
|
|
1462
1445
|
A(f.current.onLayoutChange, w) || (f.current.onLayoutChange = w, a?.(w));
|
|
1463
|
-
}), p =
|
|
1446
|
+
}), p = X((w) => {
|
|
1464
1447
|
A(f.current.onLayoutChanged, w) || (f.current.onLayoutChanged = w, u?.(w));
|
|
1465
|
-
}), g = me(s), v =
|
|
1448
|
+
}), g = me(s), v = k(null), [x, S] = Et(), L = k({
|
|
1466
1449
|
lastExpandedPanelSizes: {},
|
|
1467
1450
|
layouts: {},
|
|
1468
1451
|
panels: [],
|
|
1469
1452
|
resizeTargetMinimumSize: h,
|
|
1470
1453
|
separators: []
|
|
1471
1454
|
}), P = he(v, r);
|
|
1472
|
-
|
|
1473
|
-
const b =
|
|
1455
|
+
kt(g, l);
|
|
1456
|
+
const b = X(
|
|
1474
1457
|
(w, C) => {
|
|
1475
|
-
const { interactionState:
|
|
1458
|
+
const { interactionState: G, mountedGroups: Q } = E();
|
|
1476
1459
|
for (const ee of Q.keys())
|
|
1477
1460
|
if (ee.id === w) {
|
|
1478
|
-
const
|
|
1479
|
-
if (
|
|
1461
|
+
const U = Q.get(ee);
|
|
1462
|
+
if (U) {
|
|
1480
1463
|
let te = !1;
|
|
1481
|
-
switch (
|
|
1464
|
+
switch (G.state) {
|
|
1482
1465
|
case "active": {
|
|
1483
|
-
te =
|
|
1466
|
+
te = G.hitRegions.some(
|
|
1484
1467
|
(le) => le.group === ee
|
|
1485
1468
|
);
|
|
1486
1469
|
break;
|
|
1487
1470
|
}
|
|
1488
1471
|
}
|
|
1489
1472
|
return {
|
|
1490
|
-
flexGrow:
|
|
1473
|
+
flexGrow: U.layout[C] ?? 1,
|
|
1491
1474
|
pointerEvents: te ? "none" : void 0
|
|
1492
1475
|
};
|
|
1493
1476
|
}
|
|
@@ -1496,7 +1479,7 @@ function It({
|
|
|
1496
1479
|
flexGrow: n?.[C] ?? 1
|
|
1497
1480
|
};
|
|
1498
1481
|
}
|
|
1499
|
-
),
|
|
1482
|
+
), $ = Ae(
|
|
1500
1483
|
() => ({
|
|
1501
1484
|
getPanelStyles: b,
|
|
1502
1485
|
id: g,
|
|
@@ -1508,7 +1491,7 @@ function It({
|
|
|
1508
1491
|
w
|
|
1509
1492
|
]), S(), () => {
|
|
1510
1493
|
C.panels = C.panels.filter(
|
|
1511
|
-
(
|
|
1494
|
+
(G) => G !== w
|
|
1512
1495
|
), S();
|
|
1513
1496
|
};
|
|
1514
1497
|
},
|
|
@@ -1519,23 +1502,23 @@ function It({
|
|
|
1519
1502
|
w
|
|
1520
1503
|
]), S(), () => {
|
|
1521
1504
|
C.separators = C.separators.filter(
|
|
1522
|
-
(
|
|
1505
|
+
(G) => G !== w
|
|
1523
1506
|
), S();
|
|
1524
1507
|
};
|
|
1525
1508
|
}
|
|
1526
1509
|
}),
|
|
1527
1510
|
[b, g, S, c]
|
|
1528
|
-
),
|
|
1511
|
+
), T = Gt({
|
|
1529
1512
|
defaultLayout: n,
|
|
1530
1513
|
disableCursor: o
|
|
1531
|
-
}),
|
|
1532
|
-
return
|
|
1514
|
+
}), H = k(null);
|
|
1515
|
+
return F(() => {
|
|
1533
1516
|
const w = v.current;
|
|
1534
1517
|
if (w === null)
|
|
1535
1518
|
return;
|
|
1536
|
-
const C = L.current,
|
|
1537
|
-
defaultLayout:
|
|
1538
|
-
disableCursor: !!
|
|
1519
|
+
const C = L.current, G = {
|
|
1520
|
+
defaultLayout: T.defaultLayout,
|
|
1521
|
+
disableCursor: !!T.disableCursor,
|
|
1539
1522
|
disabled: !!i,
|
|
1540
1523
|
element: w,
|
|
1541
1524
|
id: g,
|
|
@@ -1546,21 +1529,21 @@ function It({
|
|
|
1546
1529
|
resizeTargetMinimumSize: C.resizeTargetMinimumSize,
|
|
1547
1530
|
separators: C.separators
|
|
1548
1531
|
};
|
|
1549
|
-
|
|
1550
|
-
const Q = Mt(
|
|
1551
|
-
if (
|
|
1552
|
-
const { defaultLayoutDeferred:
|
|
1553
|
-
!
|
|
1532
|
+
H.current = G;
|
|
1533
|
+
const Q = Mt(G), U = E().mountedGroups.get(G);
|
|
1534
|
+
if (U) {
|
|
1535
|
+
const { defaultLayoutDeferred: B, derivedPanelConstraints: ne, layout: oe } = U;
|
|
1536
|
+
!B && ne.length > 0 && (d(oe), p(oe));
|
|
1554
1537
|
}
|
|
1555
|
-
const te =
|
|
1538
|
+
const te = O.addListener(
|
|
1556
1539
|
"interactionStateChange",
|
|
1557
|
-
(
|
|
1558
|
-
|
|
1540
|
+
(B) => {
|
|
1541
|
+
B.state;
|
|
1559
1542
|
}
|
|
1560
|
-
), le =
|
|
1543
|
+
), le = O.addListener(
|
|
1561
1544
|
"mountedGroupsChange",
|
|
1562
|
-
(
|
|
1563
|
-
const ne =
|
|
1545
|
+
(B) => {
|
|
1546
|
+
const ne = B.get(G);
|
|
1564
1547
|
if (ne) {
|
|
1565
1548
|
const { defaultLayoutDeferred: oe, derivedPanelConstraints: Ze, layout: ye } = ne;
|
|
1566
1549
|
if (oe || Ze.length === 0)
|
|
@@ -1571,7 +1554,7 @@ function It({
|
|
|
1571
1554
|
}
|
|
1572
1555
|
);
|
|
1573
1556
|
return () => {
|
|
1574
|
-
|
|
1557
|
+
H.current = null, Q(), te(), le();
|
|
1575
1558
|
};
|
|
1576
1559
|
}, [
|
|
1577
1560
|
i,
|
|
@@ -1579,12 +1562,12 @@ function It({
|
|
|
1579
1562
|
p,
|
|
1580
1563
|
d,
|
|
1581
1564
|
c,
|
|
1582
|
-
|
|
1583
|
-
|
|
1565
|
+
x,
|
|
1566
|
+
T
|
|
1584
1567
|
]), Te(() => {
|
|
1585
|
-
const w =
|
|
1568
|
+
const w = H.current;
|
|
1586
1569
|
w && (w.defaultLayout = n, w.disableCursor = !!o);
|
|
1587
|
-
}), /* @__PURE__ */
|
|
1570
|
+
}), /* @__PURE__ */ q(Je.Provider, { value: $, children: /* @__PURE__ */ q(
|
|
1588
1571
|
"div",
|
|
1589
1572
|
{
|
|
1590
1573
|
...m,
|
|
@@ -1616,21 +1599,21 @@ function Ht({
|
|
|
1616
1599
|
storage: n = localStorage,
|
|
1617
1600
|
...o
|
|
1618
1601
|
}) {
|
|
1619
|
-
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = ce(r, t ?? []), s =
|
|
1602
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = ce(r, t ?? []), s = _e(
|
|
1620
1603
|
Dt,
|
|
1621
1604
|
() => n.getItem(l),
|
|
1622
1605
|
() => n.getItem(l)
|
|
1623
|
-
), a =
|
|
1606
|
+
), a = Ae(
|
|
1624
1607
|
() => s ? JSON.parse(s) : void 0,
|
|
1625
1608
|
[s]
|
|
1626
|
-
), u =
|
|
1609
|
+
), u = k(null), c = K(() => {
|
|
1627
1610
|
const m = u.current;
|
|
1628
1611
|
m && (u.current = null, clearTimeout(m));
|
|
1629
1612
|
}, []);
|
|
1630
1613
|
Oe(() => () => {
|
|
1631
1614
|
c();
|
|
1632
1615
|
}, [c]);
|
|
1633
|
-
const h =
|
|
1616
|
+
const h = K(
|
|
1634
1617
|
(m) => {
|
|
1635
1618
|
c();
|
|
1636
1619
|
let f;
|
|
@@ -1642,7 +1625,7 @@ function Ht({
|
|
|
1642
1625
|
}
|
|
1643
1626
|
},
|
|
1644
1627
|
[c, i, r, n]
|
|
1645
|
-
), y =
|
|
1628
|
+
), y = K(
|
|
1646
1629
|
(m) => {
|
|
1647
1630
|
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1648
1631
|
h(m);
|
|
@@ -1672,20 +1655,20 @@ function Dt() {
|
|
|
1672
1655
|
};
|
|
1673
1656
|
}
|
|
1674
1657
|
function jt() {
|
|
1675
|
-
return
|
|
1658
|
+
return Y(null);
|
|
1676
1659
|
}
|
|
1677
1660
|
function Vt() {
|
|
1678
|
-
return
|
|
1661
|
+
return k(null);
|
|
1679
1662
|
}
|
|
1680
1663
|
function ge() {
|
|
1681
1664
|
const e = ot(Je);
|
|
1682
|
-
return
|
|
1665
|
+
return z(
|
|
1683
1666
|
e,
|
|
1684
1667
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1685
1668
|
), e;
|
|
1686
1669
|
}
|
|
1687
1670
|
function Ot(e, t) {
|
|
1688
|
-
const { id: n } = ge(), o =
|
|
1671
|
+
const { id: n } = ge(), o = k({
|
|
1689
1672
|
collapse: ue,
|
|
1690
1673
|
expand: ue,
|
|
1691
1674
|
getSize: () => ({
|
|
@@ -1695,7 +1678,7 @@ function Ot(e, t) {
|
|
|
1695
1678
|
isCollapsed: () => !1,
|
|
1696
1679
|
resize: ue
|
|
1697
1680
|
});
|
|
1698
|
-
Ne(t, () => o.current, []),
|
|
1681
|
+
Ne(t, () => o.current, []), F(() => {
|
|
1699
1682
|
Object.assign(
|
|
1700
1683
|
o.current,
|
|
1701
1684
|
Ve({ groupId: n, panelId: e })
|
|
@@ -1717,15 +1700,15 @@ function Tt({
|
|
|
1717
1700
|
style: h,
|
|
1718
1701
|
...y
|
|
1719
1702
|
}) {
|
|
1720
|
-
const m = !!l, f = me(l), d =
|
|
1721
|
-
(b,
|
|
1722
|
-
u?.(b, l,
|
|
1703
|
+
const m = !!l, f = me(l), d = k(null), p = he(d, r), { getPanelStyles: g, id: v, registerPanel: x } = ge(), S = u !== null, L = X(
|
|
1704
|
+
(b, $, T) => {
|
|
1705
|
+
u?.(b, l, T);
|
|
1723
1706
|
}
|
|
1724
1707
|
);
|
|
1725
|
-
|
|
1708
|
+
F(() => {
|
|
1726
1709
|
const b = d.current;
|
|
1727
1710
|
if (b !== null)
|
|
1728
|
-
return
|
|
1711
|
+
return x({
|
|
1729
1712
|
element: b,
|
|
1730
1713
|
id: f,
|
|
1731
1714
|
idIsStable: m,
|
|
@@ -1752,18 +1735,18 @@ function Tt({
|
|
|
1752
1735
|
s,
|
|
1753
1736
|
a,
|
|
1754
1737
|
L,
|
|
1755
|
-
|
|
1738
|
+
x
|
|
1756
1739
|
]), Ot(f, c);
|
|
1757
|
-
const P =
|
|
1758
|
-
(b) => (
|
|
1759
|
-
|
|
1740
|
+
const P = _e(
|
|
1741
|
+
(b) => (O.addListener("mountedGroupsChange", b), () => {
|
|
1742
|
+
O.removeListener("mountedGroupsChange", b);
|
|
1760
1743
|
}),
|
|
1761
1744
|
// useSyncExternalStore does not support a custom equality check
|
|
1762
1745
|
// stringify avoids re-rendering when the style value hasn't changed
|
|
1763
1746
|
() => JSON.stringify(g(v, f)),
|
|
1764
1747
|
() => JSON.stringify(g(v, f))
|
|
1765
1748
|
);
|
|
1766
|
-
return /* @__PURE__ */
|
|
1749
|
+
return /* @__PURE__ */ q(
|
|
1767
1750
|
"div",
|
|
1768
1751
|
{
|
|
1769
1752
|
...y,
|
|
@@ -1780,7 +1763,7 @@ function Tt({
|
|
|
1780
1763
|
overflow: "hidden",
|
|
1781
1764
|
...JSON.parse(P)
|
|
1782
1765
|
},
|
|
1783
|
-
children: /* @__PURE__ */
|
|
1766
|
+
children: /* @__PURE__ */ q(
|
|
1784
1767
|
"div",
|
|
1785
1768
|
{
|
|
1786
1769
|
className: t,
|
|
@@ -1810,12 +1793,12 @@ const Nt = {
|
|
|
1810
1793
|
margin: 0
|
|
1811
1794
|
};
|
|
1812
1795
|
function Wt() {
|
|
1813
|
-
return
|
|
1796
|
+
return Y(null);
|
|
1814
1797
|
}
|
|
1815
1798
|
function Ut() {
|
|
1816
|
-
return
|
|
1799
|
+
return k(null);
|
|
1817
1800
|
}
|
|
1818
|
-
function
|
|
1801
|
+
function At({
|
|
1819
1802
|
layout: e,
|
|
1820
1803
|
panelConstraints: t,
|
|
1821
1804
|
panelId: n,
|
|
@@ -1827,7 +1810,7 @@ function _t({
|
|
|
1827
1810
|
);
|
|
1828
1811
|
if (s) {
|
|
1829
1812
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1830
|
-
r =
|
|
1813
|
+
r = _({
|
|
1831
1814
|
layout: Z({
|
|
1832
1815
|
delta: u - l,
|
|
1833
1816
|
initialLayout: e,
|
|
@@ -1836,7 +1819,7 @@ function _t({
|
|
|
1836
1819
|
prevLayout: e
|
|
1837
1820
|
}),
|
|
1838
1821
|
panelConstraints: t
|
|
1839
|
-
})[n], i =
|
|
1822
|
+
})[n], i = _({
|
|
1840
1823
|
layout: Z({
|
|
1841
1824
|
delta: a - l,
|
|
1842
1825
|
initialLayout: e,
|
|
@@ -1854,7 +1837,7 @@ function _t({
|
|
|
1854
1837
|
valueNow: l
|
|
1855
1838
|
};
|
|
1856
1839
|
}
|
|
1857
|
-
function
|
|
1840
|
+
function _t({
|
|
1858
1841
|
children: e,
|
|
1859
1842
|
className: t,
|
|
1860
1843
|
elementRef: n,
|
|
@@ -1862,18 +1845,18 @@ function At({
|
|
|
1862
1845
|
style: i,
|
|
1863
1846
|
...r
|
|
1864
1847
|
}) {
|
|
1865
|
-
const l = me(o), [s, a] =
|
|
1848
|
+
const l = me(o), [s, a] = Y({}), [u, c] = Y("inactive"), h = k(null), y = he(h, n), {
|
|
1866
1849
|
id: m,
|
|
1867
1850
|
orientation: f,
|
|
1868
1851
|
registerSeparator: d
|
|
1869
1852
|
} = ge(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1870
|
-
return
|
|
1853
|
+
return F(() => {
|
|
1871
1854
|
const g = h.current;
|
|
1872
1855
|
if (g !== null) {
|
|
1873
1856
|
const v = {
|
|
1874
1857
|
element: g,
|
|
1875
1858
|
id: l
|
|
1876
|
-
},
|
|
1859
|
+
}, x = d(v), S = O.addListener(
|
|
1877
1860
|
"interactionStateChange",
|
|
1878
1861
|
(P) => {
|
|
1879
1862
|
c(
|
|
@@ -1882,21 +1865,21 @@ function At({
|
|
|
1882
1865
|
) ? P.state : "inactive"
|
|
1883
1866
|
);
|
|
1884
1867
|
}
|
|
1885
|
-
), L =
|
|
1868
|
+
), L = O.addListener(
|
|
1886
1869
|
"mountedGroupsChange",
|
|
1887
1870
|
(P) => {
|
|
1888
1871
|
P.forEach(
|
|
1889
|
-
({ derivedPanelConstraints: b, layout:
|
|
1890
|
-
if (
|
|
1891
|
-
const w =
|
|
1872
|
+
({ derivedPanelConstraints: b, layout: $, separatorToPanels: T }, H) => {
|
|
1873
|
+
if (H.id === m) {
|
|
1874
|
+
const w = T.get(v);
|
|
1892
1875
|
if (w) {
|
|
1893
|
-
const C = w[0],
|
|
1876
|
+
const C = w[0], G = H.panels.indexOf(C);
|
|
1894
1877
|
a(
|
|
1895
|
-
|
|
1896
|
-
layout:
|
|
1878
|
+
At({
|
|
1879
|
+
layout: $,
|
|
1897
1880
|
panelConstraints: b,
|
|
1898
1881
|
panelId: C.id,
|
|
1899
|
-
panelIndex:
|
|
1882
|
+
panelIndex: G
|
|
1900
1883
|
})
|
|
1901
1884
|
);
|
|
1902
1885
|
}
|
|
@@ -1906,10 +1889,10 @@ function At({
|
|
|
1906
1889
|
}
|
|
1907
1890
|
);
|
|
1908
1891
|
return () => {
|
|
1909
|
-
S(), L(),
|
|
1892
|
+
S(), L(), x();
|
|
1910
1893
|
};
|
|
1911
1894
|
}
|
|
1912
|
-
}, [m, l, d]), /* @__PURE__ */
|
|
1895
|
+
}, [m, l, d]), /* @__PURE__ */ q(
|
|
1913
1896
|
"div",
|
|
1914
1897
|
{
|
|
1915
1898
|
...r,
|
|
@@ -1935,11 +1918,11 @@ function At({
|
|
|
1935
1918
|
}
|
|
1936
1919
|
);
|
|
1937
1920
|
}
|
|
1938
|
-
|
|
1921
|
+
_t.displayName = "Separator";
|
|
1939
1922
|
export {
|
|
1940
1923
|
It as Group,
|
|
1941
1924
|
Tt as Panel,
|
|
1942
|
-
|
|
1925
|
+
_t as Separator,
|
|
1943
1926
|
at as isCoarsePointer,
|
|
1944
1927
|
Ht as useDefaultLayout,
|
|
1945
1928
|
jt as useGroupCallbackRef,
|