react-resizable-panels 4.5.5 → 4.5.6
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 J } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Q, useCallback as Y, useId as nt, useLayoutEffect as Te, useEffect as Oe, useRef as k, createContext as ot, useImperativeHandle as Ae, useMemo as _e, useSyncExternalStore as it, useContext as rt } from "react";
|
|
4
|
+
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function B({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
@@ -53,7 +53,7 @@ function lt({
|
|
|
53
53
|
const { x: s, y: a } = Fe(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 ut() {
|
|
@@ -68,17 +68,17 @@ function $e(e) {
|
|
|
68
68
|
for (const c of r)
|
|
69
69
|
if (c.hasAttribute("data-panel")) {
|
|
70
70
|
const h = o.find(
|
|
71
|
-
(
|
|
71
|
+
(y) => y.element === c
|
|
72
72
|
);
|
|
73
73
|
if (h) {
|
|
74
74
|
if (a) {
|
|
75
|
-
const
|
|
75
|
+
const y = a.element.getBoundingClientRect(), m = c.getBoundingClientRect();
|
|
76
76
|
let f;
|
|
77
77
|
if (s) {
|
|
78
|
-
const d = n === "horizontal" ? new DOMRect(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
const d = n === "horizontal" ? new DOMRect(y.right, y.top, 0, y.height) : new DOMRect(
|
|
79
|
+
y.left,
|
|
80
|
+
y.bottom,
|
|
81
|
+
y.width,
|
|
82
82
|
0
|
|
83
83
|
), p = n === "horizontal" ? new DOMRect(m.left, m.top, 0, m.height) : new DOMRect(m.left, m.top, m.width, 0);
|
|
84
84
|
switch (u.length) {
|
|
@@ -92,12 +92,12 @@ function $e(e) {
|
|
|
92
92
|
case 1: {
|
|
93
93
|
const g = u[0], v = lt({
|
|
94
94
|
orientation: n,
|
|
95
|
-
rects: [
|
|
95
|
+
rects: [y, m],
|
|
96
96
|
targetRect: g.element.getBoundingClientRect()
|
|
97
97
|
});
|
|
98
98
|
f = [
|
|
99
99
|
g,
|
|
100
|
-
v ===
|
|
100
|
+
v === y ? p : d
|
|
101
101
|
];
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
@@ -109,15 +109,15 @@ function $e(e) {
|
|
|
109
109
|
} else
|
|
110
110
|
u.length ? f = u : f = [
|
|
111
111
|
n === "horizontal" ? new DOMRect(
|
|
112
|
-
|
|
112
|
+
y.right,
|
|
113
113
|
m.top,
|
|
114
|
-
m.left -
|
|
114
|
+
m.left - y.right,
|
|
115
115
|
m.height
|
|
116
116
|
) : new DOMRect(
|
|
117
117
|
m.left,
|
|
118
|
-
|
|
118
|
+
y.bottom,
|
|
119
119
|
m.width,
|
|
120
|
-
m.top -
|
|
120
|
+
m.top - y.bottom
|
|
121
121
|
)
|
|
122
122
|
];
|
|
123
123
|
for (const d of f) {
|
|
@@ -143,7 +143,7 @@ function $e(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
146
|
+
groupSize: B({ group: e }),
|
|
147
147
|
panels: [a, h],
|
|
148
148
|
separator: "width" in d ? void 0 : d,
|
|
149
149
|
rect: p
|
|
@@ -154,7 +154,7 @@ function $e(e) {
|
|
|
154
154
|
}
|
|
155
155
|
} else if (c.hasAttribute("data-separator")) {
|
|
156
156
|
const h = i.find(
|
|
157
|
-
(
|
|
157
|
+
(y) => y.element === c
|
|
158
158
|
);
|
|
159
159
|
h ? u.push(h) : (a = void 0, u = []);
|
|
160
160
|
} else
|
|
@@ -220,11 +220,11 @@ function re({
|
|
|
220
220
|
}
|
|
221
221
|
return o;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function D(e) {
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
226
|
function ve(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
227
|
+
const { panels: t } = e, n = B({ group: e });
|
|
228
228
|
return n === 0 ? t.map((o) => ({
|
|
229
229
|
collapsedSize: 0,
|
|
230
230
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -241,7 +241,7 @@ function ve(e) {
|
|
|
241
241
|
panelElement: i,
|
|
242
242
|
styleProp: r.collapsedSize
|
|
243
243
|
});
|
|
244
|
-
l =
|
|
244
|
+
l = D(c / n * 100);
|
|
245
245
|
}
|
|
246
246
|
let s;
|
|
247
247
|
if (r.defaultSize !== void 0) {
|
|
@@ -250,7 +250,7 @@ function ve(e) {
|
|
|
250
250
|
panelElement: i,
|
|
251
251
|
styleProp: r.defaultSize
|
|
252
252
|
});
|
|
253
|
-
s =
|
|
253
|
+
s = D(c / n * 100);
|
|
254
254
|
}
|
|
255
255
|
let a = 0;
|
|
256
256
|
if (r.minSize !== void 0) {
|
|
@@ -259,7 +259,7 @@ function ve(e) {
|
|
|
259
259
|
panelElement: i,
|
|
260
260
|
styleProp: r.minSize
|
|
261
261
|
});
|
|
262
|
-
a =
|
|
262
|
+
a = D(c / n * 100);
|
|
263
263
|
}
|
|
264
264
|
let u = 100;
|
|
265
265
|
if (r.maxSize !== void 0) {
|
|
@@ -268,7 +268,7 @@ function ve(e) {
|
|
|
268
268
|
panelElement: i,
|
|
269
269
|
styleProp: r.maxSize
|
|
270
270
|
});
|
|
271
|
-
u =
|
|
271
|
+
u = D(c / n * 100);
|
|
272
272
|
}
|
|
273
273
|
return {
|
|
274
274
|
collapsedSize: l,
|
|
@@ -320,7 +320,7 @@ class mt {
|
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
function R(e, t, n = 0) {
|
|
323
|
-
return Math.abs(
|
|
323
|
+
return Math.abs(D(e) - D(t)) <= n;
|
|
324
324
|
}
|
|
325
325
|
let I = {
|
|
326
326
|
cursorFlags: 0,
|
|
@@ -329,7 +329,7 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
332
|
+
const N = new mt();
|
|
333
333
|
function G() {
|
|
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 && N.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && N.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
|
+
}), N.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
362
|
function gt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
@@ -394,7 +394,7 @@ function St(e, t) {
|
|
|
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
|
);
|
|
@@ -429,7 +429,7 @@ function xe(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"), zt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
@@ -492,10 +492,10 @@ function Lt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function ee(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function W({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -505,13 +505,13 @@ function B({
|
|
|
505
505
|
maxSize: i = 100,
|
|
506
506
|
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (ee(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
510
|
const l = (n + r) / 2;
|
|
511
|
-
|
|
511
|
+
ee(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
513
|
t = r;
|
|
514
|
-
return t = Math.min(i, t), t =
|
|
514
|
+
return t = Math.min(i, t), t = D(t), t;
|
|
515
515
|
}
|
|
516
516
|
function te({
|
|
517
517
|
delta: e,
|
|
@@ -524,13 +524,13 @@ function te({
|
|
|
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
|
);
|
|
@@ -541,18 +541,18 @@ function te({
|
|
|
541
541
|
} = d;
|
|
542
542
|
if (g) {
|
|
543
543
|
const x = l[f];
|
|
544
|
-
if (
|
|
544
|
+
if (z(
|
|
545
545
|
x != null,
|
|
546
546
|
`Previous layout not found for panel index ${f}`
|
|
547
547
|
), R(x, p)) {
|
|
548
|
-
const
|
|
549
|
-
|
|
548
|
+
const S = v - x;
|
|
549
|
+
ee(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
|
);
|
|
@@ -563,51 +563,32 @@ function te({
|
|
|
563
563
|
} = d;
|
|
564
564
|
if (g) {
|
|
565
565
|
const x = l[f];
|
|
566
|
-
if (
|
|
566
|
+
if (z(
|
|
567
567
|
x != null,
|
|
568
568
|
`Previous layout not found for panel index ${f}`
|
|
569
569
|
), R(x, v)) {
|
|
570
|
-
const
|
|
571
|
-
|
|
570
|
+
const S = x - p;
|
|
571
|
+
ee(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
|
-
b(
|
|
580
|
-
d,
|
|
581
|
-
`Panel constraints not found for index ${f}`
|
|
582
|
-
);
|
|
583
|
-
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
|
-
if (p) {
|
|
585
|
-
const x = f === c;
|
|
586
|
-
if (e > 0) {
|
|
587
|
-
const y = v - g, z = y / 2;
|
|
588
|
-
D(e, v) < 0 && (e = D(e, z) <= 0 ? 0 : y);
|
|
589
|
-
} else {
|
|
590
|
-
const y = v - g, z = 100 - y / 2;
|
|
591
|
-
x ? D(Math.abs(e), v) < 0 && (e = D(100 + e, z) > 0 ? 0 : -y) : D(100 + e, v) < 0 && (e = D(100 + e, z) > 0 ? 0 : -y);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
break;
|
|
595
|
-
}
|
|
596
577
|
}
|
|
597
578
|
{
|
|
598
579
|
const f = e < 0 ? 1 : -1;
|
|
599
580
|
let d = e < 0 ? c : u, p = 0;
|
|
600
581
|
for (; ; ) {
|
|
601
582
|
const v = l[d];
|
|
602
|
-
|
|
583
|
+
z(
|
|
603
584
|
v != null,
|
|
604
585
|
`Previous layout not found for panel index ${d}`
|
|
605
586
|
);
|
|
606
|
-
const
|
|
587
|
+
const S = W({
|
|
607
588
|
panelConstraints: n[d],
|
|
608
589
|
size: 100
|
|
609
590
|
}) - v;
|
|
610
|
-
if (p +=
|
|
591
|
+
if (p += S, d += f, d < 0 || d >= n.length)
|
|
611
592
|
break;
|
|
612
593
|
}
|
|
613
594
|
const g = Math.min(Math.abs(e), Math.abs(p));
|
|
@@ -617,11 +598,11 @@ function te({
|
|
|
617
598
|
let d = e < 0 ? u : c;
|
|
618
599
|
for (; d >= 0 && d < n.length; ) {
|
|
619
600
|
const p = Math.abs(e) - Math.abs(h), g = l[d];
|
|
620
|
-
|
|
601
|
+
z(
|
|
621
602
|
g != null,
|
|
622
603
|
`Previous layout not found for panel index ${d}`
|
|
623
604
|
);
|
|
624
|
-
const v = g - p, x =
|
|
605
|
+
const v = g - p, x = W({
|
|
625
606
|
panelConstraints: n[d],
|
|
626
607
|
size: v
|
|
627
608
|
});
|
|
@@ -636,50 +617,50 @@ function te({
|
|
|
636
617
|
return i;
|
|
637
618
|
{
|
|
638
619
|
const f = e < 0 ? c : u, d = l[f];
|
|
639
|
-
|
|
620
|
+
z(
|
|
640
621
|
d != null,
|
|
641
622
|
`Previous layout not found for panel index ${f}`
|
|
642
623
|
);
|
|
643
|
-
const p = d + h, g =
|
|
624
|
+
const p = d + h, g = W({
|
|
644
625
|
panelConstraints: n[f],
|
|
645
626
|
size: p
|
|
646
627
|
});
|
|
647
628
|
if (a[f] = g, !R(g, p)) {
|
|
648
|
-
let v = p - g,
|
|
649
|
-
for (;
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
`Previous layout not found for panel index ${
|
|
629
|
+
let v = p - g, S = e < 0 ? c : u;
|
|
630
|
+
for (; S >= 0 && S < n.length; ) {
|
|
631
|
+
const w = a[S];
|
|
632
|
+
z(
|
|
633
|
+
w != null,
|
|
634
|
+
`Previous layout not found for panel index ${S}`
|
|
654
635
|
);
|
|
655
|
-
const C =
|
|
656
|
-
panelConstraints: n[
|
|
636
|
+
const C = w + v, P = W({
|
|
637
|
+
panelConstraints: n[S],
|
|
657
638
|
size: C
|
|
658
639
|
});
|
|
659
|
-
if (R(
|
|
640
|
+
if (R(w, P) || (v -= P - w, a[S] = P), R(v, 0))
|
|
660
641
|
break;
|
|
661
|
-
e > 0 ?
|
|
642
|
+
e > 0 ? S-- : S++;
|
|
662
643
|
}
|
|
663
644
|
}
|
|
664
645
|
}
|
|
665
|
-
const
|
|
646
|
+
const y = Object.values(a).reduce(
|
|
666
647
|
(f, d) => d + f,
|
|
667
648
|
0
|
|
668
649
|
);
|
|
669
|
-
if (!R(
|
|
650
|
+
if (!R(y, 100, 0.1))
|
|
670
651
|
return i;
|
|
671
652
|
const m = Object.keys(i);
|
|
672
653
|
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
673
654
|
}
|
|
674
|
-
function
|
|
655
|
+
function F(e, t) {
|
|
675
656
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
676
657
|
return !1;
|
|
677
658
|
for (const n in e)
|
|
678
|
-
if (t[n] === void 0 ||
|
|
659
|
+
if (t[n] === void 0 || ee(e[n], t[n]) !== 0)
|
|
679
660
|
return !1;
|
|
680
661
|
return !0;
|
|
681
662
|
}
|
|
682
|
-
function
|
|
663
|
+
function $({
|
|
683
664
|
layout: e,
|
|
684
665
|
panelConstraints: t
|
|
685
666
|
}) {
|
|
@@ -694,15 +675,15 @@ function H({
|
|
|
694
675
|
if (!R(i, 100) && o.length > 0)
|
|
695
676
|
for (let s = 0; s < t.length; s++) {
|
|
696
677
|
const a = o[s];
|
|
697
|
-
|
|
678
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
698
679
|
const u = 100 / i * a;
|
|
699
680
|
o[s] = u;
|
|
700
681
|
}
|
|
701
682
|
let r = 0;
|
|
702
683
|
for (let s = 0; s < t.length; s++) {
|
|
703
684
|
const a = o[s];
|
|
704
|
-
|
|
705
|
-
const u =
|
|
685
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
686
|
+
const u = W({
|
|
706
687
|
panelConstraints: t[s],
|
|
707
688
|
size: a
|
|
708
689
|
});
|
|
@@ -711,8 +692,8 @@ function H({
|
|
|
711
692
|
if (!R(r, 0))
|
|
712
693
|
for (let s = 0; s < t.length; s++) {
|
|
713
694
|
const a = o[s];
|
|
714
|
-
|
|
715
|
-
const u = a + r, c =
|
|
695
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
696
|
+
const u = a + r, c = W({
|
|
716
697
|
panelConstraints: t[s],
|
|
717
698
|
size: u
|
|
718
699
|
});
|
|
@@ -734,7 +715,7 @@ function je({
|
|
|
734
715
|
defaultLayoutDeferred: u,
|
|
735
716
|
derivedPanelConstraints: c,
|
|
736
717
|
layout: h,
|
|
737
|
-
separatorToPanels:
|
|
718
|
+
separatorToPanels: y
|
|
738
719
|
}
|
|
739
720
|
] of s)
|
|
740
721
|
if (a.id === e)
|
|
@@ -743,7 +724,7 @@ function je({
|
|
|
743
724
|
derivedPanelConstraints: c,
|
|
744
725
|
group: a,
|
|
745
726
|
layout: h,
|
|
746
|
-
separatorToPanels:
|
|
727
|
+
separatorToPanels: y
|
|
747
728
|
};
|
|
748
729
|
throw Error(`Group ${e} not found`);
|
|
749
730
|
}, o = () => {
|
|
@@ -771,20 +752,20 @@ function je({
|
|
|
771
752
|
defaultLayoutDeferred: u,
|
|
772
753
|
derivedPanelConstraints: c,
|
|
773
754
|
group: h,
|
|
774
|
-
layout:
|
|
755
|
+
layout: y,
|
|
775
756
|
separatorToPanels: m
|
|
776
757
|
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p = te({
|
|
777
758
|
delta: d ? a - s : s - a,
|
|
778
|
-
initialLayout:
|
|
759
|
+
initialLayout: y,
|
|
779
760
|
panelConstraints: c,
|
|
780
761
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
781
|
-
prevLayout:
|
|
762
|
+
prevLayout: y,
|
|
782
763
|
trigger: "imperative-api"
|
|
783
|
-
}), g =
|
|
764
|
+
}), g = $({
|
|
784
765
|
layout: p,
|
|
785
766
|
panelConstraints: c
|
|
786
767
|
});
|
|
787
|
-
|
|
768
|
+
F(y, g) || M((v) => ({
|
|
788
769
|
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
789
770
|
defaultLayoutDeferred: u,
|
|
790
771
|
derivedPanelConstraints: c,
|
|
@@ -801,8 +782,8 @@ function je({
|
|
|
801
782
|
expand: () => {
|
|
802
783
|
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), h = r();
|
|
803
784
|
if (s && h === a) {
|
|
804
|
-
let
|
|
805
|
-
|
|
785
|
+
let y = c.expandToSize ?? u;
|
|
786
|
+
y === 0 && (y = 1), l(y);
|
|
806
787
|
}
|
|
807
788
|
},
|
|
808
789
|
getSize: () => {
|
|
@@ -821,8 +802,8 @@ function je({
|
|
|
821
802
|
let u;
|
|
822
803
|
switch (typeof s) {
|
|
823
804
|
case "number": {
|
|
824
|
-
const { group: c } = n(), h =
|
|
825
|
-
u =
|
|
805
|
+
const { group: c } = n(), h = B({ group: c });
|
|
806
|
+
u = D(s / h * 100);
|
|
826
807
|
break;
|
|
827
808
|
}
|
|
828
809
|
case "string": {
|
|
@@ -885,11 +866,11 @@ function Ve({
|
|
|
885
866
|
group: r,
|
|
886
867
|
layout: l,
|
|
887
868
|
separatorToPanels: s
|
|
888
|
-
} = t(), a =
|
|
869
|
+
} = t(), a = $({
|
|
889
870
|
layout: n,
|
|
890
871
|
panelConstraints: i
|
|
891
872
|
});
|
|
892
|
-
return o ? l : (
|
|
873
|
+
return o ? l : (F(l, a) || M((u) => ({
|
|
893
874
|
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
894
875
|
defaultLayoutDeferred: o,
|
|
895
876
|
derivedPanelConstraints: i,
|
|
@@ -902,15 +883,15 @@ function Ve({
|
|
|
902
883
|
}
|
|
903
884
|
function Ue(e) {
|
|
904
885
|
const { mountedGroups: t } = G(), n = t.get(e);
|
|
905
|
-
return
|
|
886
|
+
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
906
887
|
}
|
|
907
|
-
function
|
|
888
|
+
function _(e, t) {
|
|
908
889
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
909
890
|
(h) => h.element === e
|
|
910
891
|
);
|
|
911
|
-
|
|
892
|
+
z(i, "Matching separator not found");
|
|
912
893
|
const r = o.separatorToPanels.get(i);
|
|
913
|
-
|
|
894
|
+
z(r, "Matching panels not found");
|
|
914
895
|
const l = r.map((h) => n.panels.indexOf(h)), a = Ve({ groupId: n.id }).getLayout(), u = te({
|
|
915
896
|
delta: t,
|
|
916
897
|
initialLayout: a,
|
|
@@ -918,11 +899,11 @@ function N(e, t) {
|
|
|
918
899
|
pivotIndices: l,
|
|
919
900
|
prevLayout: a,
|
|
920
901
|
trigger: "keyboard"
|
|
921
|
-
}), c =
|
|
902
|
+
}), c = $({
|
|
922
903
|
layout: u,
|
|
923
904
|
panelConstraints: o.derivedPanelConstraints
|
|
924
905
|
});
|
|
925
|
-
|
|
906
|
+
F(a, c) || M((h) => ({
|
|
926
907
|
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
927
908
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
928
909
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -938,23 +919,23 @@ function Le(e) {
|
|
|
938
919
|
if (!n.disabled)
|
|
939
920
|
switch (e.key) {
|
|
940
921
|
case "ArrowDown": {
|
|
941
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
922
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, 5);
|
|
942
923
|
break;
|
|
943
924
|
}
|
|
944
925
|
case "ArrowLeft": {
|
|
945
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
926
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
|
|
946
927
|
break;
|
|
947
928
|
}
|
|
948
929
|
case "ArrowRight": {
|
|
949
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
930
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
|
|
950
931
|
break;
|
|
951
932
|
}
|
|
952
933
|
case "ArrowUp": {
|
|
953
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
934
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, -5);
|
|
954
935
|
break;
|
|
955
936
|
}
|
|
956
937
|
case "End": {
|
|
957
|
-
e.preventDefault(),
|
|
938
|
+
e.preventDefault(), _(t, 100);
|
|
958
939
|
break;
|
|
959
940
|
}
|
|
960
941
|
case "Enter": {
|
|
@@ -962,15 +943,15 @@ function Le(e) {
|
|
|
962
943
|
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
963
944
|
(h) => h.element === t
|
|
964
945
|
);
|
|
965
|
-
|
|
946
|
+
z(s, "Matching separator not found");
|
|
966
947
|
const a = l.get(s);
|
|
967
|
-
|
|
948
|
+
z(a, "Matching panels not found");
|
|
968
949
|
const u = a[0], c = i.find(
|
|
969
950
|
(h) => h.panelId === u.id
|
|
970
951
|
);
|
|
971
|
-
if (
|
|
972
|
-
const h = r[u.id],
|
|
973
|
-
|
|
952
|
+
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
953
|
+
const h = r[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
954
|
+
_(t, y - h);
|
|
974
955
|
}
|
|
975
956
|
break;
|
|
976
957
|
}
|
|
@@ -981,13 +962,13 @@ function Le(e) {
|
|
|
981
962
|
), r = Array.from(i).findIndex(
|
|
982
963
|
(a) => a === e.currentTarget
|
|
983
964
|
);
|
|
984
|
-
|
|
965
|
+
z(r !== null, "Index not found");
|
|
985
966
|
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
986
967
|
i[l].focus();
|
|
987
968
|
break;
|
|
988
969
|
}
|
|
989
970
|
case "Home": {
|
|
990
|
-
e.preventDefault(),
|
|
971
|
+
e.preventDefault(), _(t, -100);
|
|
991
972
|
break;
|
|
992
973
|
}
|
|
993
974
|
}
|
|
@@ -1103,25 +1084,25 @@ function qe({
|
|
|
1103
1084
|
let s = 0;
|
|
1104
1085
|
const a = new Map(i);
|
|
1105
1086
|
n.forEach((c) => {
|
|
1106
|
-
const { group: h, groupSize:
|
|
1087
|
+
const { group: h, groupSize: y } = c, { disableCursor: m, orientation: f, panels: d } = h;
|
|
1107
1088
|
let p = 0;
|
|
1108
|
-
r ? f === "horizontal" ? p = (t.clientX - r.x) /
|
|
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;
|
|
1109
1090
|
const g = o.get(h), {
|
|
1110
1091
|
defaultLayoutDeferred: v,
|
|
1111
1092
|
derivedPanelConstraints: x,
|
|
1112
|
-
layout:
|
|
1113
|
-
separatorToPanels:
|
|
1093
|
+
layout: S,
|
|
1094
|
+
separatorToPanels: w
|
|
1114
1095
|
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1115
|
-
if (x && g &&
|
|
1096
|
+
if (x && g && S && w) {
|
|
1116
1097
|
const C = te({
|
|
1117
1098
|
delta: p,
|
|
1118
1099
|
initialLayout: g,
|
|
1119
1100
|
panelConstraints: x,
|
|
1120
1101
|
pivotIndices: c.panels.map((P) => d.indexOf(P)),
|
|
1121
|
-
prevLayout:
|
|
1102
|
+
prevLayout: S,
|
|
1122
1103
|
trigger: "mouse-or-touch"
|
|
1123
1104
|
});
|
|
1124
|
-
if (
|
|
1105
|
+
if (F(C, S)) {
|
|
1125
1106
|
if (p !== 0 && !m)
|
|
1126
1107
|
switch (f) {
|
|
1127
1108
|
case "horizontal": {
|
|
@@ -1138,9 +1119,9 @@ function qe({
|
|
|
1138
1119
|
defaultLayoutDeferred: v,
|
|
1139
1120
|
derivedPanelConstraints: x,
|
|
1140
1121
|
layout: C,
|
|
1141
|
-
separatorToPanels:
|
|
1122
|
+
separatorToPanels: w
|
|
1142
1123
|
});
|
|
1143
|
-
const P = c.group.panels.map(({ id:
|
|
1124
|
+
const P = c.group.panels.map(({ id: T }) => T).join(",");
|
|
1144
1125
|
c.group.inMemoryLayouts[P] = C;
|
|
1145
1126
|
}
|
|
1146
1127
|
}
|
|
@@ -1236,13 +1217,13 @@ function De(e) {
|
|
|
1236
1217
|
for (const r of e)
|
|
1237
1218
|
if (r.defaultSize !== void 0) {
|
|
1238
1219
|
t++;
|
|
1239
|
-
const l =
|
|
1220
|
+
const l = D(r.defaultSize);
|
|
1240
1221
|
n += l, o[r.panelId] = l;
|
|
1241
1222
|
} else
|
|
1242
1223
|
o[r.panelId] = void 0;
|
|
1243
1224
|
const i = e.length - t;
|
|
1244
1225
|
if (i !== 0) {
|
|
1245
|
-
const r =
|
|
1226
|
+
const r = D((100 - n) / i);
|
|
1246
1227
|
for (const l of e)
|
|
1247
1228
|
l.defaultSize === void 0 && (o[l.panelId] = r);
|
|
1248
1229
|
}
|
|
@@ -1254,8 +1235,8 @@ function Rt(e, t, n) {
|
|
|
1254
1235
|
const i = e.panels.find((u) => u.element === t);
|
|
1255
1236
|
if (!i || !i.onResize)
|
|
1256
1237
|
return;
|
|
1257
|
-
const r =
|
|
1258
|
-
asPercentage:
|
|
1238
|
+
const r = B({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1239
|
+
asPercentage: D(l / r * 100),
|
|
1259
1240
|
inPixels: l
|
|
1260
1241
|
};
|
|
1261
1242
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
@@ -1277,10 +1258,10 @@ function Et(e, t) {
|
|
|
1277
1258
|
return !1;
|
|
1278
1259
|
return !0;
|
|
1279
1260
|
}
|
|
1280
|
-
const
|
|
1261
|
+
const U = /* @__PURE__ */ new Map();
|
|
1281
1262
|
function kt(e) {
|
|
1282
1263
|
let t = !0;
|
|
1283
|
-
|
|
1264
|
+
z(
|
|
1284
1265
|
e.element.ownerDocument.defaultView,
|
|
1285
1266
|
"Cannot register an unmounted Group"
|
|
1286
1267
|
);
|
|
@@ -1289,24 +1270,24 @@ function kt(e) {
|
|
|
1289
1270
|
const { borderBoxSize: p, target: g } = d;
|
|
1290
1271
|
if (g === e.element) {
|
|
1291
1272
|
if (t) {
|
|
1292
|
-
if (
|
|
1273
|
+
if (B({ group: e }) === 0)
|
|
1293
1274
|
return;
|
|
1294
1275
|
M((x) => {
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
const
|
|
1276
|
+
const S = x.mountedGroups.get(e);
|
|
1277
|
+
if (S) {
|
|
1278
|
+
const w = ve(e), C = S.defaultLayoutDeferred ? De(w) : S.layout, P = $({
|
|
1298
1279
|
layout: C,
|
|
1299
|
-
panelConstraints:
|
|
1280
|
+
panelConstraints: w
|
|
1300
1281
|
});
|
|
1301
|
-
return !
|
|
1302
|
-
|
|
1303
|
-
|
|
1282
|
+
return !S.defaultLayoutDeferred && F(C, P) && Mt(
|
|
1283
|
+
S.derivedPanelConstraints,
|
|
1284
|
+
w
|
|
1304
1285
|
) ? x : {
|
|
1305
1286
|
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1306
1287
|
defaultLayoutDeferred: !1,
|
|
1307
|
-
derivedPanelConstraints:
|
|
1288
|
+
derivedPanelConstraints: w,
|
|
1308
1289
|
layout: P,
|
|
1309
|
-
separatorToPanels:
|
|
1290
|
+
separatorToPanels: S.separatorToPanels
|
|
1310
1291
|
})
|
|
1311
1292
|
};
|
|
1312
1293
|
}
|
|
@@ -1318,24 +1299,24 @@ function kt(e) {
|
|
|
1318
1299
|
}
|
|
1319
1300
|
});
|
|
1320
1301
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
1321
|
-
|
|
1302
|
+
z(
|
|
1322
1303
|
!o.has(f.id),
|
|
1323
1304
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1324
1305
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1325
1306
|
});
|
|
1326
|
-
const l =
|
|
1307
|
+
const l = B({ group: e }), s = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1327
1308
|
let u = e.defaultLayout;
|
|
1328
1309
|
u && (Et(e.panels, u) || (u = void 0));
|
|
1329
|
-
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h =
|
|
1310
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = $({
|
|
1330
1311
|
layout: c,
|
|
1331
1312
|
panelConstraints: s
|
|
1332
|
-
}),
|
|
1313
|
+
}), y = $e(e), m = e.element.ownerDocument;
|
|
1333
1314
|
return M((f) => {
|
|
1334
1315
|
const d = /* @__PURE__ */ new Map();
|
|
1335
|
-
return
|
|
1316
|
+
return U.set(
|
|
1336
1317
|
m,
|
|
1337
|
-
(
|
|
1338
|
-
),
|
|
1318
|
+
(U.get(m) ?? 0) + 1
|
|
1319
|
+
), y.forEach((p) => {
|
|
1339
1320
|
p.separator && d.set(p.separator, p.panels);
|
|
1340
1321
|
}), {
|
|
1341
1322
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
@@ -1346,20 +1327,20 @@ function kt(e) {
|
|
|
1346
1327
|
})
|
|
1347
1328
|
};
|
|
1348
1329
|
}), e.separators.forEach((f) => {
|
|
1349
|
-
|
|
1330
|
+
z(
|
|
1350
1331
|
!i.has(f.id),
|
|
1351
1332
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1352
1333
|
), i.add(f.id), f.element.addEventListener("keydown", Le);
|
|
1353
|
-
}),
|
|
1354
|
-
t = !1,
|
|
1334
|
+
}), U.get(m) === 1 && (m.addEventListener("dblclick", we, !0), m.addEventListener("pointerdown", Ce, !0), m.addEventListener("pointerleave", ke), m.addEventListener("pointermove", Ge), m.addEventListener("pointerup", Ie, !0)), function() {
|
|
1335
|
+
t = !1, U.set(
|
|
1355
1336
|
m,
|
|
1356
|
-
Math.max(0, (
|
|
1337
|
+
Math.max(0, (U.get(m) ?? 0) - 1)
|
|
1357
1338
|
), M((d) => {
|
|
1358
1339
|
const p = new Map(d.mountedGroups);
|
|
1359
1340
|
return p.delete(e), { mountedGroups: p };
|
|
1360
1341
|
}), e.separators.forEach((d) => {
|
|
1361
1342
|
d.element.removeEventListener("keydown", Le);
|
|
1362
|
-
}),
|
|
1343
|
+
}), U.get(m) || (m.removeEventListener(
|
|
1363
1344
|
"dblclick",
|
|
1364
1345
|
we,
|
|
1365
1346
|
!0
|
|
@@ -1371,25 +1352,25 @@ function kt(e) {
|
|
|
1371
1352
|
};
|
|
1372
1353
|
}
|
|
1373
1354
|
function Ye() {
|
|
1374
|
-
const [e, t] =
|
|
1355
|
+
const [e, t] = Q({}), n = Y(() => t({}), []);
|
|
1375
1356
|
return [e, n];
|
|
1376
1357
|
}
|
|
1377
1358
|
function me(e) {
|
|
1378
1359
|
const t = nt();
|
|
1379
1360
|
return `${e ?? t}`;
|
|
1380
1361
|
}
|
|
1381
|
-
const
|
|
1382
|
-
function
|
|
1362
|
+
const H = typeof window < "u" ? Te : Oe;
|
|
1363
|
+
function Z(e) {
|
|
1383
1364
|
const t = k(e);
|
|
1384
|
-
return
|
|
1365
|
+
return H(() => {
|
|
1385
1366
|
t.current = e;
|
|
1386
|
-
}, [e]),
|
|
1367
|
+
}, [e]), Y(
|
|
1387
1368
|
(...n) => t.current?.(...n),
|
|
1388
1369
|
[t]
|
|
1389
1370
|
);
|
|
1390
1371
|
}
|
|
1391
1372
|
function ge(...e) {
|
|
1392
|
-
return
|
|
1373
|
+
return Z((t) => {
|
|
1393
1374
|
e.forEach((n) => {
|
|
1394
1375
|
if (n)
|
|
1395
1376
|
switch (typeof n) {
|
|
@@ -1407,7 +1388,7 @@ function ge(...e) {
|
|
|
1407
1388
|
}
|
|
1408
1389
|
function Gt(e) {
|
|
1409
1390
|
const t = k({ ...e });
|
|
1410
|
-
return
|
|
1391
|
+
return H(() => {
|
|
1411
1392
|
for (const n in e)
|
|
1412
1393
|
t.current[n] = e[n];
|
|
1413
1394
|
}, [e]), t.current;
|
|
@@ -1418,7 +1399,7 @@ function It(e, t) {
|
|
|
1418
1399
|
getLayout: () => ({}),
|
|
1419
1400
|
setLayout: Ct
|
|
1420
1401
|
});
|
|
1421
|
-
Ae(t, () => n.current, []),
|
|
1402
|
+
Ae(t, () => n.current, []), H(() => {
|
|
1422
1403
|
Object.assign(
|
|
1423
1404
|
n.current,
|
|
1424
1405
|
Ve({ groupId: e })
|
|
@@ -1441,17 +1422,17 @@ function Dt({
|
|
|
1441
1422
|
coarse: 20,
|
|
1442
1423
|
fine: 10
|
|
1443
1424
|
},
|
|
1444
|
-
style:
|
|
1425
|
+
style: y,
|
|
1445
1426
|
...m
|
|
1446
1427
|
}) {
|
|
1447
1428
|
const f = k({
|
|
1448
1429
|
onLayoutChange: {},
|
|
1449
1430
|
onLayoutChanged: {}
|
|
1450
|
-
}), d =
|
|
1451
|
-
|
|
1452
|
-
}), p =
|
|
1453
|
-
|
|
1454
|
-
}), g = me(s), v = k(null), [x,
|
|
1431
|
+
}), d = Z((b) => {
|
|
1432
|
+
F(f.current.onLayoutChange, b) || (f.current.onLayoutChange = b, a?.(b));
|
|
1433
|
+
}), p = Z((b) => {
|
|
1434
|
+
F(f.current.onLayoutChanged, b) || (f.current.onLayoutChanged = b, u?.(b));
|
|
1435
|
+
}), g = me(s), v = k(null), [x, S] = Ye(), w = k({
|
|
1455
1436
|
lastExpandedPanelSizes: {},
|
|
1456
1437
|
layouts: {},
|
|
1457
1438
|
panels: [],
|
|
@@ -1459,25 +1440,25 @@ function Dt({
|
|
|
1459
1440
|
separators: []
|
|
1460
1441
|
}), C = ge(v, r);
|
|
1461
1442
|
It(g, l);
|
|
1462
|
-
const P =
|
|
1463
|
-
(
|
|
1443
|
+
const P = Z(
|
|
1444
|
+
(b, L) => {
|
|
1464
1445
|
const { interactionState: E, mountedGroups: ne } = G();
|
|
1465
1446
|
for (const oe of ne.keys())
|
|
1466
|
-
if (oe.id ===
|
|
1467
|
-
const
|
|
1468
|
-
if (
|
|
1469
|
-
let
|
|
1447
|
+
if (oe.id === b) {
|
|
1448
|
+
const K = ne.get(oe);
|
|
1449
|
+
if (K) {
|
|
1450
|
+
let X = !1;
|
|
1470
1451
|
switch (E.state) {
|
|
1471
1452
|
case "active": {
|
|
1472
|
-
|
|
1453
|
+
X = E.hitRegions.some(
|
|
1473
1454
|
(le) => le.group === oe
|
|
1474
1455
|
);
|
|
1475
1456
|
break;
|
|
1476
1457
|
}
|
|
1477
1458
|
}
|
|
1478
1459
|
return {
|
|
1479
|
-
flexGrow:
|
|
1480
|
-
pointerEvents:
|
|
1460
|
+
flexGrow: K.layout[L] ?? 1,
|
|
1461
|
+
pointerEvents: X ? "none" : void 0
|
|
1481
1462
|
};
|
|
1482
1463
|
}
|
|
1483
1464
|
}
|
|
@@ -1485,80 +1466,80 @@ function Dt({
|
|
|
1485
1466
|
flexGrow: n?.[L] ?? 1
|
|
1486
1467
|
};
|
|
1487
1468
|
}
|
|
1488
|
-
),
|
|
1469
|
+
), T = _e(
|
|
1489
1470
|
() => ({
|
|
1490
1471
|
getPanelStyles: P,
|
|
1491
1472
|
id: g,
|
|
1492
1473
|
orientation: c,
|
|
1493
|
-
registerPanel: (
|
|
1494
|
-
const L =
|
|
1474
|
+
registerPanel: (b) => {
|
|
1475
|
+
const L = w.current;
|
|
1495
1476
|
return L.panels = de(c, [
|
|
1496
1477
|
...L.panels,
|
|
1497
|
-
|
|
1498
|
-
]),
|
|
1478
|
+
b
|
|
1479
|
+
]), S(), () => {
|
|
1499
1480
|
L.panels = L.panels.filter(
|
|
1500
|
-
(E) => E !==
|
|
1501
|
-
),
|
|
1481
|
+
(E) => E !== b
|
|
1482
|
+
), S();
|
|
1502
1483
|
};
|
|
1503
1484
|
},
|
|
1504
|
-
registerSeparator: (
|
|
1505
|
-
const L =
|
|
1485
|
+
registerSeparator: (b) => {
|
|
1486
|
+
const L = w.current;
|
|
1506
1487
|
return L.separators = de(c, [
|
|
1507
1488
|
...L.separators,
|
|
1508
|
-
|
|
1509
|
-
]),
|
|
1489
|
+
b
|
|
1490
|
+
]), S(), () => {
|
|
1510
1491
|
L.separators = L.separators.filter(
|
|
1511
|
-
(E) => E !==
|
|
1512
|
-
),
|
|
1492
|
+
(E) => E !== b
|
|
1493
|
+
), S();
|
|
1513
1494
|
};
|
|
1514
1495
|
}
|
|
1515
1496
|
}),
|
|
1516
|
-
[P, g,
|
|
1517
|
-
),
|
|
1497
|
+
[P, g, S, c]
|
|
1498
|
+
), j = Gt({
|
|
1518
1499
|
defaultLayout: n,
|
|
1519
1500
|
disableCursor: o
|
|
1520
|
-
}),
|
|
1521
|
-
return
|
|
1522
|
-
const
|
|
1523
|
-
if (
|
|
1501
|
+
}), O = k(null);
|
|
1502
|
+
return H(() => {
|
|
1503
|
+
const b = v.current;
|
|
1504
|
+
if (b === null)
|
|
1524
1505
|
return;
|
|
1525
|
-
const L =
|
|
1526
|
-
defaultLayout:
|
|
1527
|
-
disableCursor: !!
|
|
1506
|
+
const L = w.current, E = {
|
|
1507
|
+
defaultLayout: j.defaultLayout,
|
|
1508
|
+
disableCursor: !!j.disableCursor,
|
|
1528
1509
|
disabled: !!i,
|
|
1529
|
-
element:
|
|
1510
|
+
element: b,
|
|
1530
1511
|
id: g,
|
|
1531
|
-
inMemoryLastExpandedPanelSizes:
|
|
1532
|
-
inMemoryLayouts:
|
|
1512
|
+
inMemoryLastExpandedPanelSizes: w.current.lastExpandedPanelSizes,
|
|
1513
|
+
inMemoryLayouts: w.current.layouts,
|
|
1533
1514
|
orientation: c,
|
|
1534
1515
|
panels: L.panels,
|
|
1535
1516
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1536
1517
|
separators: L.separators
|
|
1537
1518
|
};
|
|
1538
|
-
|
|
1539
|
-
const ne = kt(E),
|
|
1540
|
-
if (
|
|
1541
|
-
const { defaultLayoutDeferred:
|
|
1542
|
-
!
|
|
1519
|
+
O.current = E;
|
|
1520
|
+
const ne = kt(E), K = G().mountedGroups.get(E);
|
|
1521
|
+
if (K) {
|
|
1522
|
+
const { defaultLayoutDeferred: q, derivedPanelConstraints: A, layout: V } = K;
|
|
1523
|
+
!q && A.length > 0 && (d(V), p(V), L.panels.forEach((ue) => {
|
|
1543
1524
|
ue.scheduleUpdate();
|
|
1544
1525
|
}));
|
|
1545
1526
|
}
|
|
1546
|
-
let
|
|
1547
|
-
const le =
|
|
1527
|
+
let X = !1;
|
|
1528
|
+
const le = N.addListener(
|
|
1548
1529
|
"interactionStateChange",
|
|
1549
|
-
(
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1552
|
-
|
|
1530
|
+
(q) => {
|
|
1531
|
+
const A = q.state === "active";
|
|
1532
|
+
X !== A && (X = A, L.panels.forEach((V) => {
|
|
1533
|
+
V.scheduleUpdate();
|
|
1553
1534
|
}));
|
|
1554
1535
|
}
|
|
1555
|
-
), Je =
|
|
1536
|
+
), Je = N.addListener(
|
|
1556
1537
|
"mountedGroupsChange",
|
|
1557
|
-
(
|
|
1558
|
-
const
|
|
1559
|
-
if (
|
|
1560
|
-
const { defaultLayoutDeferred:
|
|
1561
|
-
if (
|
|
1538
|
+
(q) => {
|
|
1539
|
+
const A = q.get(E);
|
|
1540
|
+
if (A) {
|
|
1541
|
+
const { defaultLayoutDeferred: V, derivedPanelConstraints: ue, layout: Se } = A;
|
|
1542
|
+
if (V || ue.length === 0)
|
|
1562
1543
|
return;
|
|
1563
1544
|
const { interactionState: Qe } = G(), et = Qe.state !== "active";
|
|
1564
1545
|
d(Se), et && p(Se), L.panels.forEach((tt) => {
|
|
@@ -1568,7 +1549,7 @@ function Dt({
|
|
|
1568
1549
|
}
|
|
1569
1550
|
);
|
|
1570
1551
|
return () => {
|
|
1571
|
-
|
|
1552
|
+
O.current = null, ne(), le(), Je();
|
|
1572
1553
|
};
|
|
1573
1554
|
}, [
|
|
1574
1555
|
i,
|
|
@@ -1577,11 +1558,11 @@ function Dt({
|
|
|
1577
1558
|
d,
|
|
1578
1559
|
c,
|
|
1579
1560
|
x,
|
|
1580
|
-
|
|
1561
|
+
j
|
|
1581
1562
|
]), Oe(() => {
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
}), /* @__PURE__ */
|
|
1563
|
+
const b = O.current;
|
|
1564
|
+
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1565
|
+
}), /* @__PURE__ */ J(Ze.Provider, { value: T, children: /* @__PURE__ */ J(
|
|
1585
1566
|
"div",
|
|
1586
1567
|
{
|
|
1587
1568
|
...m,
|
|
@@ -1594,7 +1575,7 @@ function Dt({
|
|
|
1594
1575
|
height: "100%",
|
|
1595
1576
|
width: "100%",
|
|
1596
1577
|
overflow: "hidden",
|
|
1597
|
-
...
|
|
1578
|
+
...y,
|
|
1598
1579
|
display: "flex",
|
|
1599
1580
|
flexDirection: c === "horizontal" ? "row" : "column",
|
|
1600
1581
|
flexWrap: "nowrap"
|
|
@@ -1620,14 +1601,14 @@ function jt({
|
|
|
1620
1601
|
), a = _e(
|
|
1621
1602
|
() => s ? JSON.parse(s) : void 0,
|
|
1622
1603
|
[s]
|
|
1623
|
-
), u = k(null), c =
|
|
1604
|
+
), u = k(null), c = Y(() => {
|
|
1624
1605
|
const m = u.current;
|
|
1625
1606
|
m && (u.current = null, clearTimeout(m));
|
|
1626
1607
|
}, []);
|
|
1627
1608
|
Te(() => () => {
|
|
1628
1609
|
c();
|
|
1629
1610
|
}, [c]);
|
|
1630
|
-
const h =
|
|
1611
|
+
const h = Y(
|
|
1631
1612
|
(m) => {
|
|
1632
1613
|
c();
|
|
1633
1614
|
let f;
|
|
@@ -1639,7 +1620,7 @@ function jt({
|
|
|
1639
1620
|
}
|
|
1640
1621
|
},
|
|
1641
1622
|
[c, i, r, n]
|
|
1642
|
-
),
|
|
1623
|
+
), y = Y(
|
|
1643
1624
|
(m) => {
|
|
1644
1625
|
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1645
1626
|
h(m);
|
|
@@ -1657,7 +1638,7 @@ function jt({
|
|
|
1657
1638
|
*
|
|
1658
1639
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1659
1640
|
*/
|
|
1660
|
-
onLayoutChange:
|
|
1641
|
+
onLayoutChange: y,
|
|
1661
1642
|
/**
|
|
1662
1643
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1663
1644
|
*/
|
|
@@ -1669,14 +1650,14 @@ function Tt() {
|
|
|
1669
1650
|
};
|
|
1670
1651
|
}
|
|
1671
1652
|
function Vt() {
|
|
1672
|
-
return
|
|
1653
|
+
return Q(null);
|
|
1673
1654
|
}
|
|
1674
1655
|
function Ut() {
|
|
1675
1656
|
return k(null);
|
|
1676
1657
|
}
|
|
1677
1658
|
function ye() {
|
|
1678
1659
|
const e = rt(Ze);
|
|
1679
|
-
return
|
|
1660
|
+
return z(
|
|
1680
1661
|
e,
|
|
1681
1662
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1682
1663
|
), e;
|
|
@@ -1692,7 +1673,7 @@ function Ot(e, t) {
|
|
|
1692
1673
|
isCollapsed: () => !1,
|
|
1693
1674
|
resize: ce
|
|
1694
1675
|
});
|
|
1695
|
-
Ae(t, () => o.current, []),
|
|
1676
|
+
Ae(t, () => o.current, []), H(() => {
|
|
1696
1677
|
Object.assign(
|
|
1697
1678
|
o.current,
|
|
1698
1679
|
je({ groupId: n, panelId: e })
|
|
@@ -1712,25 +1693,25 @@ function At({
|
|
|
1712
1693
|
onResize: u,
|
|
1713
1694
|
panelRef: c,
|
|
1714
1695
|
style: h,
|
|
1715
|
-
...
|
|
1696
|
+
...y
|
|
1716
1697
|
}) {
|
|
1717
|
-
const m = !!l, f = me(l), d = k(null), p = ge(d, r), [, g] = Ye(), { getPanelStyles: v, id: x, registerPanel:
|
|
1718
|
-
(
|
|
1719
|
-
u?.(
|
|
1698
|
+
const m = !!l, f = me(l), d = k(null), p = ge(d, r), [, g] = Ye(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C = Z(
|
|
1699
|
+
(T, j, O) => {
|
|
1700
|
+
u?.(T, l, O);
|
|
1720
1701
|
}
|
|
1721
1702
|
);
|
|
1722
|
-
|
|
1723
|
-
const
|
|
1724
|
-
if (
|
|
1725
|
-
return
|
|
1726
|
-
element:
|
|
1703
|
+
H(() => {
|
|
1704
|
+
const T = d.current;
|
|
1705
|
+
if (T !== null)
|
|
1706
|
+
return S({
|
|
1707
|
+
element: T,
|
|
1727
1708
|
id: f,
|
|
1728
1709
|
idIsStable: m,
|
|
1729
1710
|
mutableValues: {
|
|
1730
1711
|
expandToSize: void 0,
|
|
1731
1712
|
prevSize: void 0
|
|
1732
1713
|
},
|
|
1733
|
-
onResize:
|
|
1714
|
+
onResize: w ? C : void 0,
|
|
1734
1715
|
panelConstraints: {
|
|
1735
1716
|
collapsedSize: n,
|
|
1736
1717
|
collapsible: o,
|
|
@@ -1745,19 +1726,19 @@ function At({
|
|
|
1745
1726
|
o,
|
|
1746
1727
|
i,
|
|
1747
1728
|
g,
|
|
1748
|
-
|
|
1729
|
+
w,
|
|
1749
1730
|
f,
|
|
1750
1731
|
m,
|
|
1751
1732
|
s,
|
|
1752
1733
|
a,
|
|
1753
1734
|
C,
|
|
1754
|
-
|
|
1735
|
+
S
|
|
1755
1736
|
]), Ot(f, c);
|
|
1756
1737
|
const P = v(x, f);
|
|
1757
|
-
return /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ J(
|
|
1758
1739
|
"div",
|
|
1759
1740
|
{
|
|
1760
|
-
...
|
|
1741
|
+
...y,
|
|
1761
1742
|
"data-panel": !0,
|
|
1762
1743
|
"data-testid": f,
|
|
1763
1744
|
id: f,
|
|
@@ -1771,7 +1752,7 @@ function At({
|
|
|
1771
1752
|
overflow: "hidden",
|
|
1772
1753
|
...P
|
|
1773
1754
|
},
|
|
1774
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ J(
|
|
1775
1756
|
"div",
|
|
1776
1757
|
{
|
|
1777
1758
|
className: t,
|
|
@@ -1801,7 +1782,7 @@ const _t = {
|
|
|
1801
1782
|
margin: 0
|
|
1802
1783
|
};
|
|
1803
1784
|
function Wt() {
|
|
1804
|
-
return
|
|
1785
|
+
return Q(null);
|
|
1805
1786
|
}
|
|
1806
1787
|
function Bt() {
|
|
1807
1788
|
return k(null);
|
|
@@ -1818,7 +1799,7 @@ function Nt({
|
|
|
1818
1799
|
);
|
|
1819
1800
|
if (s) {
|
|
1820
1801
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1821
|
-
r =
|
|
1802
|
+
r = $({
|
|
1822
1803
|
layout: te({
|
|
1823
1804
|
delta: u - l,
|
|
1824
1805
|
initialLayout: e,
|
|
@@ -1827,7 +1808,7 @@ function Nt({
|
|
|
1827
1808
|
prevLayout: e
|
|
1828
1809
|
}),
|
|
1829
1810
|
panelConstraints: t
|
|
1830
|
-
})[n], i =
|
|
1811
|
+
})[n], i = $({
|
|
1831
1812
|
layout: te({
|
|
1832
1813
|
delta: a - l,
|
|
1833
1814
|
initialLayout: e,
|
|
@@ -1853,18 +1834,18 @@ function Ft({
|
|
|
1853
1834
|
style: i,
|
|
1854
1835
|
...r
|
|
1855
1836
|
}) {
|
|
1856
|
-
const l = me(o), [s, a] =
|
|
1837
|
+
const l = me(o), [s, a] = Q({}), [u, c] = Q("inactive"), h = k(null), y = ge(h, n), {
|
|
1857
1838
|
id: m,
|
|
1858
1839
|
orientation: f,
|
|
1859
1840
|
registerSeparator: d
|
|
1860
1841
|
} = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1861
|
-
return
|
|
1842
|
+
return H(() => {
|
|
1862
1843
|
const g = h.current;
|
|
1863
1844
|
if (g !== null) {
|
|
1864
1845
|
const v = {
|
|
1865
1846
|
element: g,
|
|
1866
1847
|
id: l
|
|
1867
|
-
}, x = d(v),
|
|
1848
|
+
}, x = d(v), S = N.addListener(
|
|
1868
1849
|
"interactionStateChange",
|
|
1869
1850
|
(C) => {
|
|
1870
1851
|
c(
|
|
@@ -1873,18 +1854,18 @@ function Ft({
|
|
|
1873
1854
|
) ? C.state : "inactive"
|
|
1874
1855
|
);
|
|
1875
1856
|
}
|
|
1876
|
-
),
|
|
1857
|
+
), w = N.addListener(
|
|
1877
1858
|
"mountedGroupsChange",
|
|
1878
1859
|
(C) => {
|
|
1879
1860
|
C.forEach(
|
|
1880
|
-
({ derivedPanelConstraints: P, layout:
|
|
1881
|
-
if (
|
|
1882
|
-
const
|
|
1883
|
-
if (
|
|
1884
|
-
const L =
|
|
1861
|
+
({ derivedPanelConstraints: P, layout: T, separatorToPanels: j }, O) => {
|
|
1862
|
+
if (O.id === m) {
|
|
1863
|
+
const b = j.get(v);
|
|
1864
|
+
if (b) {
|
|
1865
|
+
const L = b[0], E = O.panels.indexOf(L);
|
|
1885
1866
|
a(
|
|
1886
1867
|
Nt({
|
|
1887
|
-
layout:
|
|
1868
|
+
layout: T,
|
|
1888
1869
|
panelConstraints: P,
|
|
1889
1870
|
panelId: L.id,
|
|
1890
1871
|
panelIndex: E
|
|
@@ -1897,10 +1878,10 @@ function Ft({
|
|
|
1897
1878
|
}
|
|
1898
1879
|
);
|
|
1899
1880
|
return () => {
|
|
1900
|
-
|
|
1881
|
+
S(), w(), x();
|
|
1901
1882
|
};
|
|
1902
1883
|
}
|
|
1903
|
-
}, [m, l, d]), /* @__PURE__ */
|
|
1884
|
+
}, [m, l, d]), /* @__PURE__ */ J(
|
|
1904
1885
|
"div",
|
|
1905
1886
|
{
|
|
1906
1887
|
...r,
|
|
@@ -1914,7 +1895,7 @@ function Ft({
|
|
|
1914
1895
|
"data-separator": u,
|
|
1915
1896
|
"data-testid": l,
|
|
1916
1897
|
id: l,
|
|
1917
|
-
ref:
|
|
1898
|
+
ref: y,
|
|
1918
1899
|
role: "separator",
|
|
1919
1900
|
style: {
|
|
1920
1901
|
flexBasis: "auto",
|