react-resizable-panels 4.6.1 → 4.6.3
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,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as te } from "react/jsx-runtime";
|
|
3
|
+
import { useState as ne, useCallback as Q, useId as ot, useLayoutEffect as Ne, useEffect as ue, useRef as T, createContext as it, useImperativeHandle as Ae, useMemo as _e, useSyncExternalStore as Fe, useContext as rt } from "react";
|
|
4
|
+
function st(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function at(e, t) {
|
|
9
9
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
10
10
|
return t * o;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function lt(e) {
|
|
13
13
|
return e / 100 * window.innerHeight;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ut(e) {
|
|
16
16
|
return e / 100 * window.innerWidth;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function ct(e) {
|
|
19
19
|
switch (typeof e) {
|
|
20
20
|
case "number":
|
|
21
21
|
return [e, "px"];
|
|
@@ -31,7 +31,7 @@ function re({
|
|
|
31
31
|
styleProp: n
|
|
32
32
|
}) {
|
|
33
33
|
let o;
|
|
34
|
-
const [i, s] =
|
|
34
|
+
const [i, s] = ct(n);
|
|
35
35
|
switch (s) {
|
|
36
36
|
case "%": {
|
|
37
37
|
o = i / 100 * e;
|
|
@@ -42,35 +42,35 @@ function re({
|
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
case "rem": {
|
|
45
|
-
o =
|
|
45
|
+
o = at(t, i);
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
case "em": {
|
|
49
|
-
o =
|
|
49
|
+
o = st(t, i);
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
case "vh": {
|
|
53
|
-
o =
|
|
53
|
+
o = lt(i);
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
case "vw": {
|
|
57
|
-
o =
|
|
57
|
+
o = ut(i);
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
return o;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function F(e) {
|
|
64
64
|
return parseFloat(e.toFixed(3));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Y({
|
|
67
67
|
group: e
|
|
68
68
|
}) {
|
|
69
69
|
const { orientation: t, panels: n } = e;
|
|
70
70
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
71
71
|
}
|
|
72
72
|
function de(e) {
|
|
73
|
-
const { panels: t } = e, n =
|
|
73
|
+
const { panels: t } = e, n = Y({ group: e });
|
|
74
74
|
return n === 0 ? t.map((o) => ({
|
|
75
75
|
collapsedSize: 0,
|
|
76
76
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -88,7 +88,7 @@ function de(e) {
|
|
|
88
88
|
panelElement: i,
|
|
89
89
|
styleProp: s.collapsedSize
|
|
90
90
|
});
|
|
91
|
-
l =
|
|
91
|
+
l = F(c / n * 100);
|
|
92
92
|
}
|
|
93
93
|
let r;
|
|
94
94
|
if (s.defaultSize !== void 0) {
|
|
@@ -97,7 +97,7 @@ function de(e) {
|
|
|
97
97
|
panelElement: i,
|
|
98
98
|
styleProp: s.defaultSize
|
|
99
99
|
});
|
|
100
|
-
r =
|
|
100
|
+
r = F(c / n * 100);
|
|
101
101
|
}
|
|
102
102
|
let a = 0;
|
|
103
103
|
if (s.minSize !== void 0) {
|
|
@@ -106,7 +106,7 @@ function de(e) {
|
|
|
106
106
|
panelElement: i,
|
|
107
107
|
styleProp: s.minSize
|
|
108
108
|
});
|
|
109
|
-
a =
|
|
109
|
+
a = F(c / n * 100);
|
|
110
110
|
}
|
|
111
111
|
let u = 100;
|
|
112
112
|
if (s.maxSize !== void 0) {
|
|
@@ -115,7 +115,7 @@ function de(e) {
|
|
|
115
115
|
panelElement: i,
|
|
116
116
|
styleProp: s.maxSize
|
|
117
117
|
});
|
|
118
|
-
u =
|
|
118
|
+
u = F(c / n * 100);
|
|
119
119
|
}
|
|
120
120
|
return {
|
|
121
121
|
collapsedSize: l,
|
|
@@ -134,14 +134,14 @@ function L(e, t = "Assertion error") {
|
|
|
134
134
|
}
|
|
135
135
|
function pe(e, t) {
|
|
136
136
|
return Array.from(t).sort(
|
|
137
|
-
e === "horizontal" ?
|
|
137
|
+
e === "horizontal" ? ft : dt
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function ft(e, t) {
|
|
141
141
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
142
142
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function dt(e, t) {
|
|
145
145
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
146
146
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
147
147
|
}
|
|
@@ -160,7 +160,7 @@ function He(e, t) {
|
|
|
160
160
|
)
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function pt({
|
|
164
164
|
orientation: e,
|
|
165
165
|
rects: t,
|
|
166
166
|
targetRect: n
|
|
@@ -177,7 +177,7 @@ function dt({
|
|
|
177
177
|
return L(i, "No rect found"), i;
|
|
178
178
|
}
|
|
179
179
|
let se;
|
|
180
|
-
function
|
|
180
|
+
function mt() {
|
|
181
181
|
return se === void 0 && (typeof matchMedia == "function" ? se = !!matchMedia("(pointer:coarse)").matches : se = !1), se;
|
|
182
182
|
}
|
|
183
183
|
function Ve(e) {
|
|
@@ -224,14 +224,14 @@ function Ve(e) {
|
|
|
224
224
|
break;
|
|
225
225
|
}
|
|
226
226
|
case 1: {
|
|
227
|
-
const w = S[0],
|
|
227
|
+
const w = S[0], C = pt({
|
|
228
228
|
orientation: n,
|
|
229
229
|
rects: [m, v],
|
|
230
230
|
targetRect: w.element.getBoundingClientRect()
|
|
231
231
|
});
|
|
232
232
|
x = [
|
|
233
233
|
w,
|
|
234
|
-
|
|
234
|
+
C === m ? p : y
|
|
235
235
|
];
|
|
236
236
|
break;
|
|
237
237
|
}
|
|
@@ -256,7 +256,7 @@ function Ve(e) {
|
|
|
256
256
|
];
|
|
257
257
|
for (const y of x) {
|
|
258
258
|
let p = "width" in y ? y : y.element.getBoundingClientRect();
|
|
259
|
-
const w =
|
|
259
|
+
const w = mt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
260
260
|
if (p.width < w) {
|
|
261
261
|
const R = w - p.width;
|
|
262
262
|
p = new DOMRect(
|
|
@@ -275,10 +275,10 @@ function Ve(e) {
|
|
|
275
275
|
p.height + R
|
|
276
276
|
);
|
|
277
277
|
}
|
|
278
|
-
const
|
|
279
|
-
!r && !
|
|
278
|
+
const C = h <= u || h > c;
|
|
279
|
+
!r && !C && l.push({
|
|
280
280
|
group: e,
|
|
281
|
-
groupSize:
|
|
281
|
+
groupSize: Y({ group: e }),
|
|
282
282
|
panels: [z, f],
|
|
283
283
|
separator: "width" in y ? void 0 : y,
|
|
284
284
|
rect: p
|
|
@@ -298,7 +298,7 @@ function Ve(e) {
|
|
|
298
298
|
}
|
|
299
299
|
return l;
|
|
300
300
|
}
|
|
301
|
-
class
|
|
301
|
+
class ht {
|
|
302
302
|
#e = {};
|
|
303
303
|
addListener(t, n) {
|
|
304
304
|
const o = this.#e[t];
|
|
@@ -338,7 +338,7 @@ class mt {
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
function E(e, t, n = 0) {
|
|
341
|
-
return Math.abs(
|
|
341
|
+
return Math.abs(F(e) - F(t)) <= n;
|
|
342
342
|
}
|
|
343
343
|
let A = {
|
|
344
344
|
cursorFlags: 0,
|
|
@@ -347,7 +347,7 @@ let A = {
|
|
|
347
347
|
},
|
|
348
348
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
349
349
|
};
|
|
350
|
-
const H = new
|
|
350
|
+
const H = new ht();
|
|
351
351
|
function k() {
|
|
352
352
|
return A;
|
|
353
353
|
}
|
|
@@ -377,7 +377,7 @@ function G(e) {
|
|
|
377
377
|
});
|
|
378
378
|
}), H.emit("mountedGroupsChange", A.mountedGroups)), A;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function gt(e, t, n) {
|
|
381
381
|
let o, i = {
|
|
382
382
|
x: 1 / 0,
|
|
383
383
|
y: 1 / 0
|
|
@@ -400,10 +400,10 @@ function ht(e, t, n) {
|
|
|
400
400
|
hitRegion: o
|
|
401
401
|
} : void 0;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function yt(e) {
|
|
404
404
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function St(e, t) {
|
|
407
407
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
408
408
|
const n = {
|
|
409
409
|
a: we(e),
|
|
@@ -434,20 +434,20 @@ function yt(e, t) {
|
|
|
434
434
|
}
|
|
435
435
|
return Math.sign(i.a - i.b);
|
|
436
436
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
437
|
+
const vt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
438
|
+
function xt(e) {
|
|
439
439
|
const t = getComputedStyle(je(e) ?? e).display;
|
|
440
440
|
return t === "flex" || t === "inline-flex";
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function zt(e) {
|
|
443
443
|
const t = getComputedStyle(e);
|
|
444
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
444
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || xt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || vt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
445
445
|
}
|
|
446
446
|
function ze(e) {
|
|
447
447
|
let t = e.length;
|
|
448
448
|
for (; t--; ) {
|
|
449
449
|
const n = e[t];
|
|
450
|
-
if (L(n, "Missing node"),
|
|
450
|
+
if (L(n, "Missing node"), zt(n)) return n;
|
|
451
451
|
}
|
|
452
452
|
return null;
|
|
453
453
|
}
|
|
@@ -462,24 +462,24 @@ function we(e) {
|
|
|
462
462
|
}
|
|
463
463
|
function je(e) {
|
|
464
464
|
const { parentNode: t } = e;
|
|
465
|
-
return
|
|
465
|
+
return yt(t) ? t.host : t;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function bt(e, t) {
|
|
468
468
|
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;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function wt({
|
|
471
471
|
groupElement: e,
|
|
472
472
|
hitRegion: t,
|
|
473
473
|
pointerEventTarget: n
|
|
474
474
|
}) {
|
|
475
475
|
if (!$e(n) || n.contains(e) || e.contains(n))
|
|
476
476
|
return !0;
|
|
477
|
-
if (
|
|
477
|
+
if (St(n, e) > 0) {
|
|
478
478
|
let o = n;
|
|
479
479
|
for (; o; ) {
|
|
480
480
|
if (o.contains(e))
|
|
481
481
|
return !0;
|
|
482
|
-
if (
|
|
482
|
+
if (bt(o.getBoundingClientRect(), t))
|
|
483
483
|
return !1;
|
|
484
484
|
o = o.parentElement;
|
|
485
485
|
}
|
|
@@ -491,18 +491,18 @@ function me(e, t) {
|
|
|
491
491
|
return t.forEach((o, i) => {
|
|
492
492
|
if (i.disabled)
|
|
493
493
|
return;
|
|
494
|
-
const s = Ve(i), l =
|
|
494
|
+
const s = Ve(i), l = gt(i.orientation, s, {
|
|
495
495
|
x: e.clientX,
|
|
496
496
|
y: e.clientY
|
|
497
497
|
});
|
|
498
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 &&
|
|
498
|
+
l && l.distance.x <= 0 && l.distance.y <= 0 && wt({
|
|
499
499
|
groupElement: i.element,
|
|
500
500
|
hitRegion: l.hitRegion.rect,
|
|
501
501
|
pointerEventTarget: e.target
|
|
502
502
|
}) && n.push(l.hitRegion);
|
|
503
503
|
}), n;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function Lt(e, t) {
|
|
506
506
|
if (e.length !== t.length)
|
|
507
507
|
return !1;
|
|
508
508
|
for (let n = 0; n < e.length; n++)
|
|
@@ -513,7 +513,7 @@ function wt(e, t) {
|
|
|
513
513
|
function $(e, t) {
|
|
514
514
|
return E(e, t) ? 0 : e > t ? 1 : -1;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function q({
|
|
517
517
|
overrideDisabledPanels: e,
|
|
518
518
|
panelConstraints: t,
|
|
519
519
|
prevSize: n,
|
|
@@ -534,9 +534,9 @@ function K({
|
|
|
534
534
|
$(o, u) < 0 ? o = i : o = a;
|
|
535
535
|
} else
|
|
536
536
|
o = a;
|
|
537
|
-
return o = Math.min(r, o), o =
|
|
537
|
+
return o = Math.min(r, o), o = F(o), o;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function oe({
|
|
540
540
|
delta: e,
|
|
541
541
|
initialLayout: t,
|
|
542
542
|
panelConstraints: n,
|
|
@@ -606,11 +606,11 @@ function ne({
|
|
|
606
606
|
const m = r[d], { collapsible: v, collapsedSize: x, minSize: y } = f;
|
|
607
607
|
if (v && $(m, y) < 0)
|
|
608
608
|
if (e > 0) {
|
|
609
|
-
const p = y - x, w = p / 2,
|
|
610
|
-
$(
|
|
609
|
+
const p = y - x, w = p / 2, C = m + e;
|
|
610
|
+
$(C, y) < 0 && (e = $(e, w) <= 0 ? 0 : p);
|
|
611
611
|
} else {
|
|
612
|
-
const p = y - x, w = 100 - p / 2,
|
|
613
|
-
$(
|
|
612
|
+
const p = y - x, w = 100 - p / 2, C = m - e;
|
|
613
|
+
$(C, y) < 0 && (e = $(100 + e, w) > 0 ? 0 : -p);
|
|
614
614
|
}
|
|
615
615
|
break;
|
|
616
616
|
}
|
|
@@ -624,7 +624,7 @@ function ne({
|
|
|
624
624
|
x != null,
|
|
625
625
|
`Previous layout not found for panel index ${f}`
|
|
626
626
|
);
|
|
627
|
-
const p =
|
|
627
|
+
const p = q({
|
|
628
628
|
overrideDisabledPanels: l,
|
|
629
629
|
panelConstraints: n[f],
|
|
630
630
|
prevSize: x,
|
|
@@ -644,7 +644,7 @@ function ne({
|
|
|
644
644
|
v != null,
|
|
645
645
|
`Previous layout not found for panel index ${f}`
|
|
646
646
|
);
|
|
647
|
-
const x = v - m, y =
|
|
647
|
+
const x = v - m, y = q({
|
|
648
648
|
overrideDisabledPanels: l,
|
|
649
649
|
panelConstraints: n[f],
|
|
650
650
|
prevSize: v,
|
|
@@ -657,7 +657,7 @@ function ne({
|
|
|
657
657
|
e < 0 ? f-- : f++;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
if (
|
|
660
|
+
if (Lt(a, u))
|
|
661
661
|
return i;
|
|
662
662
|
{
|
|
663
663
|
const d = e < 0 ? g : c, f = r[d];
|
|
@@ -665,7 +665,7 @@ function ne({
|
|
|
665
665
|
f != null,
|
|
666
666
|
`Previous layout not found for panel index ${d}`
|
|
667
667
|
);
|
|
668
|
-
const m = f + z, v =
|
|
668
|
+
const m = f + z, v = q({
|
|
669
669
|
overrideDisabledPanels: l,
|
|
670
670
|
panelConstraints: n[d],
|
|
671
671
|
prevSize: f,
|
|
@@ -679,11 +679,11 @@ function ne({
|
|
|
679
679
|
w != null,
|
|
680
680
|
`Previous layout not found for panel index ${p}`
|
|
681
681
|
);
|
|
682
|
-
const
|
|
682
|
+
const C = w + x, R = q({
|
|
683
683
|
overrideDisabledPanels: l,
|
|
684
684
|
panelConstraints: n[p],
|
|
685
685
|
prevSize: w,
|
|
686
|
-
size:
|
|
686
|
+
size: C
|
|
687
687
|
});
|
|
688
688
|
if (E(w, R) || (x -= R - w, u[p] = R), E(x, 0))
|
|
689
689
|
break;
|
|
@@ -700,7 +700,7 @@ function ne({
|
|
|
700
700
|
const h = Object.keys(i);
|
|
701
701
|
return u.reduce((d, f, m) => (d[h[m]] = f, d), {});
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function U(e, t) {
|
|
704
704
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
705
705
|
return !1;
|
|
706
706
|
for (const n in e)
|
|
@@ -708,7 +708,7 @@ function j(e, t) {
|
|
|
708
708
|
return !1;
|
|
709
709
|
return !0;
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function B({
|
|
712
712
|
layout: e,
|
|
713
713
|
panelConstraints: t
|
|
714
714
|
}) {
|
|
@@ -733,7 +733,7 @@ function W({
|
|
|
733
733
|
L(a != null, `No layout data found for index ${r}`);
|
|
734
734
|
const u = o[r];
|
|
735
735
|
L(u != null, `No layout data found for index ${r}`);
|
|
736
|
-
const c =
|
|
736
|
+
const c = q({
|
|
737
737
|
overrideDisabledPanels: !0,
|
|
738
738
|
panelConstraints: t[r],
|
|
739
739
|
prevSize: a,
|
|
@@ -745,7 +745,7 @@ function W({
|
|
|
745
745
|
for (let r = 0; r < t.length; r++) {
|
|
746
746
|
const a = o[r];
|
|
747
747
|
L(a != null, `No layout data found for index ${r}`);
|
|
748
|
-
const u = a + s, c =
|
|
748
|
+
const u = a + s, c = q({
|
|
749
749
|
overrideDisabledPanels: !0,
|
|
750
750
|
panelConstraints: t[r],
|
|
751
751
|
prevSize: a,
|
|
@@ -808,18 +808,18 @@ function We({
|
|
|
808
808
|
group: g,
|
|
809
809
|
layout: z,
|
|
810
810
|
separatorToPanels: S
|
|
811
|
-
} = n(), h = g.panels.findIndex((v) => v.id === t), d = h === g.panels.length - 1, f =
|
|
811
|
+
} = n(), h = g.panels.findIndex((v) => v.id === t), d = h === g.panels.length - 1, f = oe({
|
|
812
812
|
delta: d ? a - r : r - a,
|
|
813
813
|
initialLayout: z,
|
|
814
814
|
panelConstraints: c,
|
|
815
815
|
pivotIndices: d ? [h - 1, h] : [h, h + 1],
|
|
816
816
|
prevLayout: z,
|
|
817
817
|
trigger: "imperative-api"
|
|
818
|
-
}), m =
|
|
818
|
+
}), m = B({
|
|
819
819
|
layout: f,
|
|
820
820
|
panelConstraints: c
|
|
821
821
|
});
|
|
822
|
-
|
|
822
|
+
U(z, m) || G((v) => ({
|
|
823
823
|
mountedGroups: new Map(v.mountedGroups).set(g, {
|
|
824
824
|
defaultLayoutDeferred: u,
|
|
825
825
|
derivedPanelConstraints: c,
|
|
@@ -856,8 +856,8 @@ function We({
|
|
|
856
856
|
let u;
|
|
857
857
|
switch (typeof r) {
|
|
858
858
|
case "number": {
|
|
859
|
-
const { group: c } = n(), g =
|
|
860
|
-
u =
|
|
859
|
+
const { group: c } = n(), g = Y({ group: c });
|
|
860
|
+
u = F(r / g * 100);
|
|
861
861
|
break;
|
|
862
862
|
}
|
|
863
863
|
case "string": {
|
|
@@ -920,13 +920,13 @@ function Ue({
|
|
|
920
920
|
group: s,
|
|
921
921
|
layout: l,
|
|
922
922
|
separatorToPanels: r
|
|
923
|
-
} = t(), a =
|
|
923
|
+
} = t(), a = B({
|
|
924
924
|
layout: n,
|
|
925
925
|
panelConstraints: i
|
|
926
926
|
});
|
|
927
927
|
if (o)
|
|
928
928
|
return l;
|
|
929
|
-
if (!
|
|
929
|
+
if (!U(l, a)) {
|
|
930
930
|
G((c) => ({
|
|
931
931
|
mountedGroups: new Map(c.mountedGroups).set(s, {
|
|
932
932
|
defaultLayoutDeferred: o,
|
|
@@ -946,25 +946,25 @@ function Be(e) {
|
|
|
946
946
|
const { mountedGroups: t } = k(), n = t.get(e);
|
|
947
947
|
return L(n, `Mounted Group ${e.id} not found`), n;
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function W(e, t) {
|
|
950
950
|
const n = le(e), o = Be(n), i = n.separators.find(
|
|
951
951
|
(g) => g.element === e
|
|
952
952
|
);
|
|
953
953
|
L(i, "Matching separator not found");
|
|
954
954
|
const s = o.separatorToPanels.get(i);
|
|
955
955
|
L(s, "Matching panels not found");
|
|
956
|
-
const l = s.map((g) => n.panels.indexOf(g)), a = Ue({ groupId: n.id }).getLayout(), u =
|
|
956
|
+
const l = s.map((g) => n.panels.indexOf(g)), a = Ue({ groupId: n.id }).getLayout(), u = oe({
|
|
957
957
|
delta: t,
|
|
958
958
|
initialLayout: a,
|
|
959
959
|
panelConstraints: o.derivedPanelConstraints,
|
|
960
960
|
pivotIndices: l,
|
|
961
961
|
prevLayout: a,
|
|
962
962
|
trigger: "keyboard"
|
|
963
|
-
}), c =
|
|
963
|
+
}), c = B({
|
|
964
964
|
layout: u,
|
|
965
965
|
panelConstraints: o.derivedPanelConstraints
|
|
966
966
|
});
|
|
967
|
-
|
|
967
|
+
U(a, c) || G((g) => ({
|
|
968
968
|
mountedGroups: new Map(g.mountedGroups).set(n, {
|
|
969
969
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
970
970
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -980,23 +980,23 @@ function Pe(e) {
|
|
|
980
980
|
if (!n.disabled)
|
|
981
981
|
switch (e.key) {
|
|
982
982
|
case "ArrowDown": {
|
|
983
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
983
|
+
e.preventDefault(), n.orientation === "vertical" && W(t, 5);
|
|
984
984
|
break;
|
|
985
985
|
}
|
|
986
986
|
case "ArrowLeft": {
|
|
987
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
987
|
+
e.preventDefault(), n.orientation === "horizontal" && W(t, -5);
|
|
988
988
|
break;
|
|
989
989
|
}
|
|
990
990
|
case "ArrowRight": {
|
|
991
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
991
|
+
e.preventDefault(), n.orientation === "horizontal" && W(t, 5);
|
|
992
992
|
break;
|
|
993
993
|
}
|
|
994
994
|
case "ArrowUp": {
|
|
995
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
995
|
+
e.preventDefault(), n.orientation === "vertical" && W(t, -5);
|
|
996
996
|
break;
|
|
997
997
|
}
|
|
998
998
|
case "End": {
|
|
999
|
-
e.preventDefault(),
|
|
999
|
+
e.preventDefault(), W(t, 100);
|
|
1000
1000
|
break;
|
|
1001
1001
|
}
|
|
1002
1002
|
case "Enter": {
|
|
@@ -1012,7 +1012,7 @@ function Pe(e) {
|
|
|
1012
1012
|
);
|
|
1013
1013
|
if (L(c, "Panel metadata not found"), c.collapsible) {
|
|
1014
1014
|
const g = s[u.id], z = c.collapsedSize === g ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
1015
|
-
|
|
1015
|
+
W(t, z - g);
|
|
1016
1016
|
}
|
|
1017
1017
|
break;
|
|
1018
1018
|
}
|
|
@@ -1029,7 +1029,7 @@ function Pe(e) {
|
|
|
1029
1029
|
break;
|
|
1030
1030
|
}
|
|
1031
1031
|
case "Home": {
|
|
1032
|
-
e.preventDefault(),
|
|
1032
|
+
e.preventDefault(), W(t, -100);
|
|
1033
1033
|
break;
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
@@ -1054,13 +1054,13 @@ function Ce(e) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
}), n.length && e.preventDefault();
|
|
1056
1056
|
}
|
|
1057
|
-
const
|
|
1057
|
+
const Pt = (e) => e, ce = () => {
|
|
1058
1058
|
}, Ke = 1, Xe = 2, qe = 4, Ye = 8, Re = 3, Me = 12;
|
|
1059
1059
|
let ae;
|
|
1060
1060
|
function Ee() {
|
|
1061
1061
|
return ae === void 0 && (ae = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ae = !0)), ae;
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function Ct({
|
|
1064
1064
|
cursorFlags: e,
|
|
1065
1065
|
groups: t,
|
|
1066
1066
|
state: n
|
|
@@ -1113,7 +1113,7 @@ function he(e) {
|
|
|
1113
1113
|
switch (i.state) {
|
|
1114
1114
|
case "active":
|
|
1115
1115
|
case "hover": {
|
|
1116
|
-
const s =
|
|
1116
|
+
const s = Ct({
|
|
1117
1117
|
cursorFlags: o,
|
|
1118
1118
|
groups: i.hitRegions.map((r) => r.group),
|
|
1119
1119
|
state: i.state
|
|
@@ -1155,15 +1155,15 @@ function Je({
|
|
|
1155
1155
|
separatorToPanels: p
|
|
1156
1156
|
} = i.get(g) ?? { defaultLayoutDeferred: !1 };
|
|
1157
1157
|
if (x && m && y && p) {
|
|
1158
|
-
const w =
|
|
1158
|
+
const w = oe({
|
|
1159
1159
|
delta: f,
|
|
1160
1160
|
initialLayout: m,
|
|
1161
1161
|
panelConstraints: x,
|
|
1162
|
-
pivotIndices: c.panels.map((
|
|
1162
|
+
pivotIndices: c.panels.map((C) => d.indexOf(C)),
|
|
1163
1163
|
prevLayout: y,
|
|
1164
1164
|
trigger: "mouse-or-touch"
|
|
1165
1165
|
});
|
|
1166
|
-
if (
|
|
1166
|
+
if (U(w, y)) {
|
|
1167
1167
|
if (f !== 0 && !S)
|
|
1168
1168
|
switch (h) {
|
|
1169
1169
|
case "horizontal": {
|
|
@@ -1182,8 +1182,8 @@ function Je({
|
|
|
1182
1182
|
layout: w,
|
|
1183
1183
|
separatorToPanels: p
|
|
1184
1184
|
});
|
|
1185
|
-
const
|
|
1186
|
-
c.group.inMemoryLayouts[
|
|
1185
|
+
const C = c.group.panels.map(({ id: R }) => R).join(",");
|
|
1186
|
+
c.group.inMemoryLayouts[C] = w;
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
1189
|
});
|
|
@@ -1291,31 +1291,31 @@ function Te(e) {
|
|
|
1291
1291
|
for (const s of e)
|
|
1292
1292
|
if (s.defaultSize !== void 0) {
|
|
1293
1293
|
t++;
|
|
1294
|
-
const l =
|
|
1294
|
+
const l = F(s.defaultSize);
|
|
1295
1295
|
n += l, o[s.panelId] = l;
|
|
1296
1296
|
} else
|
|
1297
1297
|
o[s.panelId] = void 0;
|
|
1298
1298
|
const i = e.length - t;
|
|
1299
1299
|
if (i !== 0) {
|
|
1300
|
-
const s =
|
|
1300
|
+
const s = F((100 - n) / i);
|
|
1301
1301
|
for (const l of e)
|
|
1302
1302
|
l.defaultSize === void 0 && (o[l.panelId] = s);
|
|
1303
1303
|
}
|
|
1304
1304
|
return o;
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function Rt(e, t, n) {
|
|
1307
1307
|
if (!n[0])
|
|
1308
1308
|
return;
|
|
1309
1309
|
const i = e.panels.find((u) => u.element === t);
|
|
1310
1310
|
if (!i || !i.onResize)
|
|
1311
1311
|
return;
|
|
1312
|
-
const s =
|
|
1313
|
-
asPercentage:
|
|
1312
|
+
const s = Y({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
|
|
1313
|
+
asPercentage: F(l / s * 100),
|
|
1314
1314
|
inPixels: l
|
|
1315
1315
|
};
|
|
1316
1316
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
1317
1317
|
}
|
|
1318
|
-
function
|
|
1318
|
+
function Mt(e, t) {
|
|
1319
1319
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1320
1320
|
return !1;
|
|
1321
1321
|
for (const o in e)
|
|
@@ -1323,7 +1323,7 @@ function Rt(e, t) {
|
|
|
1323
1323
|
return !1;
|
|
1324
1324
|
return !0;
|
|
1325
1325
|
}
|
|
1326
|
-
function
|
|
1326
|
+
function Et(e, t) {
|
|
1327
1327
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1328
1328
|
if (n.length !== o.length)
|
|
1329
1329
|
return !1;
|
|
@@ -1332,8 +1332,8 @@ function Mt(e, t) {
|
|
|
1332
1332
|
return !1;
|
|
1333
1333
|
return !0;
|
|
1334
1334
|
}
|
|
1335
|
-
const
|
|
1336
|
-
function
|
|
1335
|
+
const X = /* @__PURE__ */ new Map();
|
|
1336
|
+
function kt(e) {
|
|
1337
1337
|
let t = !0;
|
|
1338
1338
|
L(
|
|
1339
1339
|
e.element.ownerDocument.defaultView,
|
|
@@ -1344,23 +1344,23 @@ function Et(e) {
|
|
|
1344
1344
|
const { borderBoxSize: f, target: m } = d;
|
|
1345
1345
|
if (m === e.element) {
|
|
1346
1346
|
if (t) {
|
|
1347
|
-
if (
|
|
1347
|
+
if (Y({ group: e }) === 0)
|
|
1348
1348
|
return;
|
|
1349
1349
|
G((x) => {
|
|
1350
1350
|
const y = x.mountedGroups.get(e);
|
|
1351
1351
|
if (y) {
|
|
1352
|
-
const p = de(e), w = y.defaultLayoutDeferred ? Te(p) : y.layout,
|
|
1352
|
+
const p = de(e), w = y.defaultLayoutDeferred ? Te(p) : y.layout, C = B({
|
|
1353
1353
|
layout: w,
|
|
1354
1354
|
panelConstraints: p
|
|
1355
1355
|
});
|
|
1356
|
-
return !y.defaultLayoutDeferred &&
|
|
1356
|
+
return !y.defaultLayoutDeferred && U(w, C) && Mt(
|
|
1357
1357
|
y.derivedPanelConstraints,
|
|
1358
1358
|
p
|
|
1359
1359
|
) ? x : {
|
|
1360
1360
|
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1361
1361
|
defaultLayoutDeferred: !1,
|
|
1362
1362
|
derivedPanelConstraints: p,
|
|
1363
|
-
layout:
|
|
1363
|
+
layout: C,
|
|
1364
1364
|
separatorToPanels: y.separatorToPanels
|
|
1365
1365
|
})
|
|
1366
1366
|
};
|
|
@@ -1369,7 +1369,7 @@ function Et(e) {
|
|
|
1369
1369
|
});
|
|
1370
1370
|
}
|
|
1371
1371
|
} else
|
|
1372
|
-
|
|
1372
|
+
Rt(e, m, f);
|
|
1373
1373
|
}
|
|
1374
1374
|
});
|
|
1375
1375
|
s.observe(e.element), e.panels.forEach((h) => {
|
|
@@ -1378,18 +1378,18 @@ function Et(e) {
|
|
|
1378
1378
|
`Panel ids must be unique; id "${h.id}" was used more than once`
|
|
1379
1379
|
), o.add(h.id), h.onResize && s.observe(h.element);
|
|
1380
1380
|
});
|
|
1381
|
-
const l =
|
|
1381
|
+
const l = Y({ group: e }), r = de(e), a = e.panels.map(({ id: h }) => h).join(",");
|
|
1382
1382
|
let u = e.defaultLayout;
|
|
1383
|
-
u && (
|
|
1384
|
-
const c = e.inMemoryLayouts[a] ?? u ?? Te(r), g =
|
|
1383
|
+
u && (Et(e.panels, u) || (u = void 0));
|
|
1384
|
+
const c = e.inMemoryLayouts[a] ?? u ?? Te(r), g = B({
|
|
1385
1385
|
layout: c,
|
|
1386
1386
|
panelConstraints: r
|
|
1387
1387
|
}), z = Ve(e), S = e.element.ownerDocument;
|
|
1388
1388
|
return G((h) => {
|
|
1389
1389
|
const d = /* @__PURE__ */ new Map();
|
|
1390
|
-
return
|
|
1390
|
+
return X.set(
|
|
1391
1391
|
S,
|
|
1392
|
-
(
|
|
1392
|
+
(X.get(S) ?? 0) + 1
|
|
1393
1393
|
), z.forEach((f) => {
|
|
1394
1394
|
f.separator && d.set(f.separator, f.panels);
|
|
1395
1395
|
}), {
|
|
@@ -1405,16 +1405,16 @@ function Et(e) {
|
|
|
1405
1405
|
!i.has(h.id),
|
|
1406
1406
|
`Separator ids must be unique; id "${h.id}" was used more than once`
|
|
1407
1407
|
), i.add(h.id), h.element.addEventListener("keydown", Pe);
|
|
1408
|
-
}),
|
|
1409
|
-
t = !1,
|
|
1408
|
+
}), X.get(S) === 1 && (S.addEventListener("dblclick", Le, !0), S.addEventListener("pointerdown", Ce, !0), S.addEventListener("pointerleave", Ge), S.addEventListener("pointermove", Ie), S.addEventListener("pointerout", De), S.addEventListener("pointerup", Oe, !0)), function() {
|
|
1409
|
+
t = !1, X.set(
|
|
1410
1410
|
S,
|
|
1411
|
-
Math.max(0, (
|
|
1411
|
+
Math.max(0, (X.get(S) ?? 0) - 1)
|
|
1412
1412
|
), G((d) => {
|
|
1413
1413
|
const f = new Map(d.mountedGroups);
|
|
1414
1414
|
return f.delete(e), { mountedGroups: f };
|
|
1415
1415
|
}), e.separators.forEach((d) => {
|
|
1416
1416
|
d.element.removeEventListener("keydown", Pe);
|
|
1417
|
-
}),
|
|
1417
|
+
}), X.get(S) || (S.removeEventListener(
|
|
1418
1418
|
"dblclick",
|
|
1419
1419
|
Le,
|
|
1420
1420
|
!0
|
|
@@ -1425,26 +1425,26 @@ function Et(e) {
|
|
|
1425
1425
|
), S.removeEventListener("pointerleave", Ge), S.removeEventListener("pointermove", Ie), S.removeEventListener("pointerout", De), S.removeEventListener("pointerup", Oe, !0)), s.disconnect();
|
|
1426
1426
|
};
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1429
|
-
const [e, t] =
|
|
1428
|
+
function Gt() {
|
|
1429
|
+
const [e, t] = ne({}), n = Q(() => t({}), []);
|
|
1430
1430
|
return [e, n];
|
|
1431
1431
|
}
|
|
1432
1432
|
function ge(e) {
|
|
1433
|
-
const t =
|
|
1433
|
+
const t = ot();
|
|
1434
1434
|
return `${e ?? t}`;
|
|
1435
1435
|
}
|
|
1436
|
-
const
|
|
1437
|
-
function
|
|
1438
|
-
const t =
|
|
1439
|
-
return
|
|
1436
|
+
const K = typeof window < "u" ? Ne : ue;
|
|
1437
|
+
function ee(e) {
|
|
1438
|
+
const t = T(e);
|
|
1439
|
+
return K(() => {
|
|
1440
1440
|
t.current = e;
|
|
1441
|
-
}, [e]),
|
|
1441
|
+
}, [e]), Q(
|
|
1442
1442
|
(...n) => t.current?.(...n),
|
|
1443
1443
|
[t]
|
|
1444
1444
|
);
|
|
1445
1445
|
}
|
|
1446
1446
|
function ye(...e) {
|
|
1447
|
-
return
|
|
1447
|
+
return ee((t) => {
|
|
1448
1448
|
e.forEach((n) => {
|
|
1449
1449
|
if (n)
|
|
1450
1450
|
switch (typeof n) {
|
|
@@ -1461,26 +1461,26 @@ function ye(...e) {
|
|
|
1461
1461
|
});
|
|
1462
1462
|
}
|
|
1463
1463
|
function Se(e) {
|
|
1464
|
-
const t =
|
|
1465
|
-
return
|
|
1464
|
+
const t = T({ ...e });
|
|
1465
|
+
return K(() => {
|
|
1466
1466
|
for (const n in e)
|
|
1467
1467
|
t.current[n] = e[n];
|
|
1468
1468
|
}, [e]), t.current;
|
|
1469
1469
|
}
|
|
1470
|
-
const Ze =
|
|
1471
|
-
function
|
|
1472
|
-
const n =
|
|
1470
|
+
const Ze = it(null);
|
|
1471
|
+
function It(e, t) {
|
|
1472
|
+
const n = T({
|
|
1473
1473
|
getLayout: () => ({}),
|
|
1474
|
-
setLayout:
|
|
1474
|
+
setLayout: Pt
|
|
1475
1475
|
});
|
|
1476
|
-
Ae(t, () => n.current, []),
|
|
1476
|
+
Ae(t, () => n.current, []), K(() => {
|
|
1477
1477
|
Object.assign(
|
|
1478
1478
|
n.current,
|
|
1479
1479
|
Ue({ groupId: e })
|
|
1480
1480
|
);
|
|
1481
1481
|
});
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1483
|
+
function Dt({
|
|
1484
1484
|
children: e,
|
|
1485
1485
|
className: t,
|
|
1486
1486
|
defaultLayout: n,
|
|
@@ -1499,107 +1499,116 @@ function It({
|
|
|
1499
1499
|
style: z,
|
|
1500
1500
|
...S
|
|
1501
1501
|
}) {
|
|
1502
|
-
const h =
|
|
1502
|
+
const h = T({
|
|
1503
1503
|
onLayoutChange: {},
|
|
1504
1504
|
onLayoutChanged: {}
|
|
1505
|
-
}), d =
|
|
1506
|
-
|
|
1507
|
-
}), f =
|
|
1508
|
-
|
|
1509
|
-
}), m = ge(r), v =
|
|
1505
|
+
}), d = ee((b) => {
|
|
1506
|
+
U(h.current.onLayoutChange, b) || (h.current.onLayoutChange = b, a?.(b));
|
|
1507
|
+
}), f = ee((b) => {
|
|
1508
|
+
U(h.current.onLayoutChanged, b) || (h.current.onLayoutChanged = b, u?.(b));
|
|
1509
|
+
}), m = ge(r), v = T(null), [x, y] = Gt(), p = T({
|
|
1510
1510
|
lastExpandedPanelSizes: {},
|
|
1511
1511
|
layouts: {},
|
|
1512
1512
|
panels: [],
|
|
1513
1513
|
resizeTargetMinimumSize: g,
|
|
1514
1514
|
separators: []
|
|
1515
1515
|
}), w = ye(v, s);
|
|
1516
|
-
|
|
1517
|
-
const
|
|
1518
|
-
(b,
|
|
1519
|
-
const { interactionState:
|
|
1520
|
-
for (const
|
|
1521
|
-
if (
|
|
1522
|
-
const
|
|
1523
|
-
if (
|
|
1524
|
-
let
|
|
1525
|
-
switch (
|
|
1516
|
+
It(m, l);
|
|
1517
|
+
const C = ee(
|
|
1518
|
+
(b, P) => {
|
|
1519
|
+
const { interactionState: I, mountedGroups: M } = k();
|
|
1520
|
+
for (const O of M.keys())
|
|
1521
|
+
if (O.id === b) {
|
|
1522
|
+
const N = M.get(O);
|
|
1523
|
+
if (N) {
|
|
1524
|
+
let _ = !1;
|
|
1525
|
+
switch (I.state) {
|
|
1526
1526
|
case "active": {
|
|
1527
|
-
|
|
1528
|
-
(
|
|
1527
|
+
_ = I.hitRegions.some(
|
|
1528
|
+
(Z) => Z.group === O
|
|
1529
1529
|
);
|
|
1530
1530
|
break;
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
1533
|
return {
|
|
1534
|
-
flexGrow:
|
|
1535
|
-
pointerEvents:
|
|
1534
|
+
flexGrow: N.layout[P] ?? 1,
|
|
1535
|
+
pointerEvents: _ ? "none" : void 0
|
|
1536
1536
|
};
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
1539
1539
|
return {
|
|
1540
|
-
flexGrow: n?.[
|
|
1540
|
+
flexGrow: n?.[P] ?? 1
|
|
1541
1541
|
};
|
|
1542
1542
|
}
|
|
1543
1543
|
), R = Se({
|
|
1544
1544
|
defaultLayout: n,
|
|
1545
1545
|
disableCursor: o
|
|
1546
|
-
}),
|
|
1546
|
+
}), J = _e(
|
|
1547
1547
|
() => ({
|
|
1548
1548
|
get disableCursor() {
|
|
1549
1549
|
return !!R.disableCursor;
|
|
1550
1550
|
},
|
|
1551
|
-
getPanelStyles:
|
|
1551
|
+
getPanelStyles: C,
|
|
1552
1552
|
id: m,
|
|
1553
1553
|
orientation: c,
|
|
1554
1554
|
registerPanel: (b) => {
|
|
1555
|
-
const
|
|
1556
|
-
return
|
|
1557
|
-
...
|
|
1555
|
+
const P = p.current;
|
|
1556
|
+
return P.panels = pe(c, [
|
|
1557
|
+
...P.panels,
|
|
1558
1558
|
b
|
|
1559
1559
|
]), y(), () => {
|
|
1560
|
-
|
|
1561
|
-
(
|
|
1560
|
+
P.panels = P.panels.filter(
|
|
1561
|
+
(I) => I !== b
|
|
1562
1562
|
), y();
|
|
1563
1563
|
};
|
|
1564
1564
|
},
|
|
1565
1565
|
registerSeparator: (b) => {
|
|
1566
|
-
const
|
|
1567
|
-
return
|
|
1568
|
-
...
|
|
1566
|
+
const P = p.current;
|
|
1567
|
+
return P.separators = pe(c, [
|
|
1568
|
+
...P.separators,
|
|
1569
1569
|
b
|
|
1570
1570
|
]), y(), () => {
|
|
1571
|
-
|
|
1572
|
-
(
|
|
1571
|
+
P.separators = P.separators.filter(
|
|
1572
|
+
(I) => I !== b
|
|
1573
1573
|
), y();
|
|
1574
1574
|
};
|
|
1575
1575
|
},
|
|
1576
|
-
togglePanelDisabled: (b,
|
|
1577
|
-
const
|
|
1578
|
-
(
|
|
1576
|
+
togglePanelDisabled: (b, P) => {
|
|
1577
|
+
const M = p.current.panels.find(
|
|
1578
|
+
(N) => N.id === b
|
|
1579
1579
|
);
|
|
1580
|
-
|
|
1581
|
-
const { mountedGroups:
|
|
1582
|
-
for (const
|
|
1583
|
-
if (
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1580
|
+
M && (M.panelConstraints.disabled = P);
|
|
1581
|
+
const { mountedGroups: O } = k();
|
|
1582
|
+
for (const N of O.keys())
|
|
1583
|
+
if (N.id === m) {
|
|
1584
|
+
const _ = O.get(N);
|
|
1585
|
+
_ && (_.derivedPanelConstraints = de(N));
|
|
1586
1586
|
}
|
|
1587
1587
|
},
|
|
1588
|
-
toggleSeparatorDisabled: (b,
|
|
1589
|
-
const
|
|
1590
|
-
(
|
|
1588
|
+
toggleSeparatorDisabled: (b, P) => {
|
|
1589
|
+
const M = p.current.separators.find(
|
|
1590
|
+
(O) => O.id === b
|
|
1591
1591
|
);
|
|
1592
|
-
|
|
1592
|
+
M && (M.disabled = P);
|
|
1593
1593
|
}
|
|
1594
1594
|
}),
|
|
1595
|
-
[
|
|
1596
|
-
), D =
|
|
1597
|
-
return
|
|
1595
|
+
[C, m, y, c, R]
|
|
1596
|
+
), D = T(null);
|
|
1597
|
+
return K(() => {
|
|
1598
1598
|
const b = v.current;
|
|
1599
1599
|
if (b === null)
|
|
1600
1600
|
return;
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1601
|
+
const P = p.current;
|
|
1602
|
+
let I;
|
|
1603
|
+
if (R.defaultLayout !== void 0 && Object.keys(R.defaultLayout).length === P.panels.length) {
|
|
1604
|
+
I = {};
|
|
1605
|
+
for (const V of P.panels) {
|
|
1606
|
+
const j = R.defaultLayout[V.id];
|
|
1607
|
+
j !== void 0 && (I[V.id] = j);
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
const M = {
|
|
1611
|
+
defaultLayout: I,
|
|
1603
1612
|
disableCursor: !!R.disableCursor,
|
|
1604
1613
|
disabled: !!i,
|
|
1605
1614
|
element: b,
|
|
@@ -1607,36 +1616,36 @@ function It({
|
|
|
1607
1616
|
inMemoryLastExpandedPanelSizes: p.current.lastExpandedPanelSizes,
|
|
1608
1617
|
inMemoryLayouts: p.current.layouts,
|
|
1609
1618
|
orientation: c,
|
|
1610
|
-
panels:
|
|
1611
|
-
resizeTargetMinimumSize:
|
|
1612
|
-
separators:
|
|
1619
|
+
panels: P.panels,
|
|
1620
|
+
resizeTargetMinimumSize: P.resizeTargetMinimumSize,
|
|
1621
|
+
separators: P.separators
|
|
1613
1622
|
};
|
|
1614
1623
|
D.current = M;
|
|
1615
|
-
const
|
|
1616
|
-
if (
|
|
1617
|
-
const { defaultLayoutDeferred:
|
|
1618
|
-
!
|
|
1624
|
+
const O = kt(M), _ = k().mountedGroups.get(M);
|
|
1625
|
+
if (_) {
|
|
1626
|
+
const { defaultLayoutDeferred: V, derivedPanelConstraints: j, layout: ie } = _;
|
|
1627
|
+
!V && j.length > 0 && (d(ie), f(ie));
|
|
1619
1628
|
}
|
|
1620
|
-
const
|
|
1629
|
+
const Z = H.addListener(
|
|
1621
1630
|
"interactionStateChange",
|
|
1622
|
-
(
|
|
1623
|
-
|
|
1631
|
+
(V) => {
|
|
1632
|
+
V.state;
|
|
1624
1633
|
}
|
|
1625
|
-
),
|
|
1634
|
+
), Qe = H.addListener(
|
|
1626
1635
|
"mountedGroupsChange",
|
|
1627
|
-
(
|
|
1628
|
-
const
|
|
1629
|
-
if (
|
|
1630
|
-
const { defaultLayoutDeferred: ie, derivedPanelConstraints:
|
|
1631
|
-
if (ie ||
|
|
1636
|
+
(V) => {
|
|
1637
|
+
const j = V.get(M);
|
|
1638
|
+
if (j) {
|
|
1639
|
+
const { defaultLayoutDeferred: ie, derivedPanelConstraints: et, layout: xe } = j;
|
|
1640
|
+
if (ie || et.length === 0)
|
|
1632
1641
|
return;
|
|
1633
|
-
const { interactionState:
|
|
1634
|
-
d(xe),
|
|
1642
|
+
const { interactionState: tt } = k(), nt = tt.state !== "active";
|
|
1643
|
+
d(xe), nt && f(xe);
|
|
1635
1644
|
}
|
|
1636
1645
|
}
|
|
1637
1646
|
);
|
|
1638
1647
|
return () => {
|
|
1639
|
-
D.current = null,
|
|
1648
|
+
D.current = null, O(), Z(), Qe();
|
|
1640
1649
|
};
|
|
1641
1650
|
}, [
|
|
1642
1651
|
i,
|
|
@@ -1649,7 +1658,7 @@ function It({
|
|
|
1649
1658
|
]), ue(() => {
|
|
1650
1659
|
const b = D.current;
|
|
1651
1660
|
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1652
|
-
}), /* @__PURE__ */
|
|
1661
|
+
}), /* @__PURE__ */ te(Ze.Provider, { value: J, children: /* @__PURE__ */ te(
|
|
1653
1662
|
"div",
|
|
1654
1663
|
{
|
|
1655
1664
|
...S,
|
|
@@ -1671,31 +1680,31 @@ function It({
|
|
|
1671
1680
|
}
|
|
1672
1681
|
) });
|
|
1673
1682
|
}
|
|
1674
|
-
|
|
1683
|
+
Dt.displayName = "Group";
|
|
1675
1684
|
function fe(e, t) {
|
|
1676
1685
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1677
1686
|
}
|
|
1678
|
-
function
|
|
1687
|
+
function Vt({
|
|
1679
1688
|
debounceSaveMs: e = 100,
|
|
1680
1689
|
panelIds: t,
|
|
1681
1690
|
storage: n = localStorage,
|
|
1682
1691
|
...o
|
|
1683
1692
|
}) {
|
|
1684
1693
|
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = fe(s, t ?? []), r = Fe(
|
|
1685
|
-
|
|
1694
|
+
Ot,
|
|
1686
1695
|
() => n.getItem(l),
|
|
1687
1696
|
() => n.getItem(l)
|
|
1688
1697
|
), a = _e(
|
|
1689
1698
|
() => r ? JSON.parse(r) : void 0,
|
|
1690
1699
|
[r]
|
|
1691
|
-
), u =
|
|
1700
|
+
), u = T(null), c = Q(() => {
|
|
1692
1701
|
const S = u.current;
|
|
1693
1702
|
S && (u.current = null, clearTimeout(S));
|
|
1694
1703
|
}, []);
|
|
1695
1704
|
Ne(() => () => {
|
|
1696
1705
|
c();
|
|
1697
1706
|
}, [c]);
|
|
1698
|
-
const g =
|
|
1707
|
+
const g = Q(
|
|
1699
1708
|
(S) => {
|
|
1700
1709
|
c();
|
|
1701
1710
|
let h;
|
|
@@ -1707,7 +1716,7 @@ function Ht({
|
|
|
1707
1716
|
}
|
|
1708
1717
|
},
|
|
1709
1718
|
[c, i, s, n]
|
|
1710
|
-
), z =
|
|
1719
|
+
), z = Q(
|
|
1711
1720
|
(S) => {
|
|
1712
1721
|
c(), e === 0 ? g(S) : u.current = setTimeout(() => {
|
|
1713
1722
|
g(S);
|
|
@@ -1732,25 +1741,25 @@ function Ht({
|
|
|
1732
1741
|
onLayoutChanged: g
|
|
1733
1742
|
};
|
|
1734
1743
|
}
|
|
1735
|
-
function
|
|
1744
|
+
function Ot() {
|
|
1736
1745
|
return function() {
|
|
1737
1746
|
};
|
|
1738
1747
|
}
|
|
1739
|
-
function Vt() {
|
|
1740
|
-
return te(null);
|
|
1741
|
-
}
|
|
1742
1748
|
function jt() {
|
|
1743
|
-
return
|
|
1749
|
+
return ne(null);
|
|
1750
|
+
}
|
|
1751
|
+
function Wt() {
|
|
1752
|
+
return T(null);
|
|
1744
1753
|
}
|
|
1745
1754
|
function ve() {
|
|
1746
|
-
const e =
|
|
1755
|
+
const e = rt(Ze);
|
|
1747
1756
|
return L(
|
|
1748
1757
|
e,
|
|
1749
1758
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1750
1759
|
), e;
|
|
1751
1760
|
}
|
|
1752
|
-
function
|
|
1753
|
-
const { id: n } = ve(), o =
|
|
1761
|
+
function Tt(e, t) {
|
|
1762
|
+
const { id: n } = ve(), o = T({
|
|
1754
1763
|
collapse: ce,
|
|
1755
1764
|
expand: ce,
|
|
1756
1765
|
getSize: () => ({
|
|
@@ -1760,14 +1769,14 @@ function Ot(e, t) {
|
|
|
1760
1769
|
isCollapsed: () => !1,
|
|
1761
1770
|
resize: ce
|
|
1762
1771
|
});
|
|
1763
|
-
Ae(t, () => o.current, []),
|
|
1772
|
+
Ae(t, () => o.current, []), K(() => {
|
|
1764
1773
|
Object.assign(
|
|
1765
1774
|
o.current,
|
|
1766
1775
|
We({ groupId: n, panelId: e })
|
|
1767
1776
|
);
|
|
1768
1777
|
});
|
|
1769
1778
|
}
|
|
1770
|
-
function
|
|
1779
|
+
function Nt({
|
|
1771
1780
|
children: e,
|
|
1772
1781
|
className: t,
|
|
1773
1782
|
collapsedSize: n = "0%",
|
|
@@ -1785,17 +1794,17 @@ function Tt({
|
|
|
1785
1794
|
}) {
|
|
1786
1795
|
const h = !!r, d = ge(r), f = Se({
|
|
1787
1796
|
disabled: s
|
|
1788
|
-
}), m =
|
|
1797
|
+
}), m = T(null), v = ye(m, l), {
|
|
1789
1798
|
getPanelStyles: x,
|
|
1790
1799
|
id: y,
|
|
1791
1800
|
registerPanel: p,
|
|
1792
1801
|
togglePanelDisabled: w
|
|
1793
|
-
} = ve(),
|
|
1794
|
-
(D, b,
|
|
1795
|
-
c?.(D, r,
|
|
1802
|
+
} = ve(), C = c !== null, R = ee(
|
|
1803
|
+
(D, b, P) => {
|
|
1804
|
+
c?.(D, r, P);
|
|
1796
1805
|
}
|
|
1797
1806
|
);
|
|
1798
|
-
|
|
1807
|
+
K(() => {
|
|
1799
1808
|
const D = m.current;
|
|
1800
1809
|
if (D !== null) {
|
|
1801
1810
|
const b = {
|
|
@@ -1806,7 +1815,7 @@ function Tt({
|
|
|
1806
1815
|
expandToSize: void 0,
|
|
1807
1816
|
prevSize: void 0
|
|
1808
1817
|
},
|
|
1809
|
-
onResize:
|
|
1818
|
+
onResize: C ? R : void 0,
|
|
1810
1819
|
panelConstraints: {
|
|
1811
1820
|
collapsedSize: n,
|
|
1812
1821
|
collapsible: o,
|
|
@@ -1822,7 +1831,7 @@ function Tt({
|
|
|
1822
1831
|
n,
|
|
1823
1832
|
o,
|
|
1824
1833
|
i,
|
|
1825
|
-
|
|
1834
|
+
C,
|
|
1826
1835
|
d,
|
|
1827
1836
|
h,
|
|
1828
1837
|
a,
|
|
@@ -1832,8 +1841,8 @@ function Tt({
|
|
|
1832
1841
|
f
|
|
1833
1842
|
]), ue(() => {
|
|
1834
1843
|
w(d, !!s);
|
|
1835
|
-
}, [s, d, w]),
|
|
1836
|
-
const
|
|
1844
|
+
}, [s, d, w]), Tt(d, g);
|
|
1845
|
+
const J = Fe(
|
|
1837
1846
|
(D) => (H.addListener("mountedGroupsChange", D), () => {
|
|
1838
1847
|
H.removeListener("mountedGroupsChange", D);
|
|
1839
1848
|
}),
|
|
@@ -1842,7 +1851,7 @@ function Tt({
|
|
|
1842
1851
|
() => JSON.stringify(x(y, d)),
|
|
1843
1852
|
() => JSON.stringify(x(y, d))
|
|
1844
1853
|
);
|
|
1845
|
-
return /* @__PURE__ */
|
|
1854
|
+
return /* @__PURE__ */ te(
|
|
1846
1855
|
"div",
|
|
1847
1856
|
{
|
|
1848
1857
|
...S,
|
|
@@ -1852,15 +1861,15 @@ function Tt({
|
|
|
1852
1861
|
id: d,
|
|
1853
1862
|
ref: v,
|
|
1854
1863
|
style: {
|
|
1855
|
-
...
|
|
1864
|
+
...At,
|
|
1856
1865
|
display: "flex",
|
|
1857
1866
|
flexBasis: 0,
|
|
1858
1867
|
flexShrink: 1,
|
|
1859
1868
|
// Prevent Panel content from interfering with panel size
|
|
1860
1869
|
overflow: "hidden",
|
|
1861
|
-
...JSON.parse(
|
|
1870
|
+
...JSON.parse(J)
|
|
1862
1871
|
},
|
|
1863
|
-
children: /* @__PURE__ */
|
|
1872
|
+
children: /* @__PURE__ */ te(
|
|
1864
1873
|
"div",
|
|
1865
1874
|
{
|
|
1866
1875
|
className: t,
|
|
@@ -1876,8 +1885,8 @@ function Tt({
|
|
|
1876
1885
|
}
|
|
1877
1886
|
);
|
|
1878
1887
|
}
|
|
1879
|
-
|
|
1880
|
-
const
|
|
1888
|
+
Nt.displayName = "Panel";
|
|
1889
|
+
const At = {
|
|
1881
1890
|
minHeight: 0,
|
|
1882
1891
|
maxHeight: "100%",
|
|
1883
1892
|
height: "auto",
|
|
@@ -1889,13 +1898,13 @@ const Nt = {
|
|
|
1889
1898
|
padding: 0,
|
|
1890
1899
|
margin: 0
|
|
1891
1900
|
};
|
|
1892
|
-
function Wt() {
|
|
1893
|
-
return te(null);
|
|
1894
|
-
}
|
|
1895
1901
|
function Ut() {
|
|
1896
|
-
return
|
|
1902
|
+
return ne(null);
|
|
1897
1903
|
}
|
|
1898
|
-
function
|
|
1904
|
+
function Bt() {
|
|
1905
|
+
return T(null);
|
|
1906
|
+
}
|
|
1907
|
+
function _t({
|
|
1899
1908
|
layout: e,
|
|
1900
1909
|
panelConstraints: t,
|
|
1901
1910
|
panelId: n,
|
|
@@ -1907,8 +1916,8 @@ function At({
|
|
|
1907
1916
|
);
|
|
1908
1917
|
if (r) {
|
|
1909
1918
|
const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
|
|
1910
|
-
s =
|
|
1911
|
-
layout:
|
|
1919
|
+
s = B({
|
|
1920
|
+
layout: oe({
|
|
1912
1921
|
delta: u - l,
|
|
1913
1922
|
initialLayout: e,
|
|
1914
1923
|
panelConstraints: t,
|
|
@@ -1916,8 +1925,8 @@ function At({
|
|
|
1916
1925
|
prevLayout: e
|
|
1917
1926
|
}),
|
|
1918
1927
|
panelConstraints: t
|
|
1919
|
-
})[n], i =
|
|
1920
|
-
layout:
|
|
1928
|
+
})[n], i = B({
|
|
1929
|
+
layout: oe({
|
|
1921
1930
|
delta: a - l,
|
|
1922
1931
|
initialLayout: e,
|
|
1923
1932
|
panelConstraints: t,
|
|
@@ -1934,7 +1943,7 @@ function At({
|
|
|
1934
1943
|
valueNow: l
|
|
1935
1944
|
};
|
|
1936
1945
|
}
|
|
1937
|
-
function
|
|
1946
|
+
function Ft({
|
|
1938
1947
|
children: e,
|
|
1939
1948
|
className: t,
|
|
1940
1949
|
disabled: n,
|
|
@@ -1945,26 +1954,26 @@ function _t({
|
|
|
1945
1954
|
}) {
|
|
1946
1955
|
const r = ge(i), a = Se({
|
|
1947
1956
|
disabled: n
|
|
1948
|
-
}), [u, c] =
|
|
1957
|
+
}), [u, c] = ne({}), [g, z] = ne("inactive"), S = T(null), h = ye(S, o), {
|
|
1949
1958
|
disableCursor: d,
|
|
1950
1959
|
id: f,
|
|
1951
1960
|
orientation: m,
|
|
1952
1961
|
registerSeparator: v,
|
|
1953
1962
|
toggleSeparatorDisabled: x
|
|
1954
1963
|
} = ve(), y = m === "horizontal" ? "vertical" : "horizontal";
|
|
1955
|
-
|
|
1964
|
+
K(() => {
|
|
1956
1965
|
const w = S.current;
|
|
1957
1966
|
if (w !== null) {
|
|
1958
|
-
const
|
|
1967
|
+
const C = {
|
|
1959
1968
|
disabled: a.disabled,
|
|
1960
1969
|
element: w,
|
|
1961
1970
|
id: r
|
|
1962
|
-
}, R = v(
|
|
1971
|
+
}, R = v(C), J = H.addListener(
|
|
1963
1972
|
"interactionStateChange",
|
|
1964
1973
|
(b) => {
|
|
1965
1974
|
z(
|
|
1966
1975
|
b.state !== "inactive" && b.hitRegions.some(
|
|
1967
|
-
(
|
|
1976
|
+
(P) => P.separator === C
|
|
1968
1977
|
) ? b.state : "inactive"
|
|
1969
1978
|
);
|
|
1970
1979
|
}
|
|
@@ -1972,17 +1981,17 @@ function _t({
|
|
|
1972
1981
|
"mountedGroupsChange",
|
|
1973
1982
|
(b) => {
|
|
1974
1983
|
b.forEach(
|
|
1975
|
-
({ derivedPanelConstraints:
|
|
1976
|
-
if (
|
|
1977
|
-
const
|
|
1978
|
-
if (
|
|
1979
|
-
const
|
|
1984
|
+
({ derivedPanelConstraints: P, layout: I, separatorToPanels: M }, O) => {
|
|
1985
|
+
if (O.id === f) {
|
|
1986
|
+
const N = M.get(C);
|
|
1987
|
+
if (N) {
|
|
1988
|
+
const _ = N[0], Z = O.panels.indexOf(_);
|
|
1980
1989
|
c(
|
|
1981
|
-
|
|
1982
|
-
layout:
|
|
1983
|
-
panelConstraints:
|
|
1984
|
-
panelId:
|
|
1985
|
-
panelIndex:
|
|
1990
|
+
_t({
|
|
1991
|
+
layout: I,
|
|
1992
|
+
panelConstraints: P,
|
|
1993
|
+
panelId: _.id,
|
|
1994
|
+
panelIndex: Z
|
|
1986
1995
|
})
|
|
1987
1996
|
);
|
|
1988
1997
|
}
|
|
@@ -1992,14 +2001,14 @@ function _t({
|
|
|
1992
2001
|
}
|
|
1993
2002
|
);
|
|
1994
2003
|
return () => {
|
|
1995
|
-
|
|
2004
|
+
J(), D(), R();
|
|
1996
2005
|
};
|
|
1997
2006
|
}
|
|
1998
2007
|
}, [f, r, v, a]), ue(() => {
|
|
1999
2008
|
x(r, !!n);
|
|
2000
2009
|
}, [n, r, x]);
|
|
2001
2010
|
let p;
|
|
2002
|
-
return n && !d && (p = "not-allowed"), /* @__PURE__ */
|
|
2011
|
+
return n && !d && (p = "not-allowed"), /* @__PURE__ */ te(
|
|
2003
2012
|
"div",
|
|
2004
2013
|
{
|
|
2005
2014
|
...l,
|
|
@@ -2027,16 +2036,16 @@ function _t({
|
|
|
2027
2036
|
}
|
|
2028
2037
|
);
|
|
2029
2038
|
}
|
|
2030
|
-
|
|
2039
|
+
Ft.displayName = "Separator";
|
|
2031
2040
|
export {
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
+
Dt as Group,
|
|
2042
|
+
Nt as Panel,
|
|
2043
|
+
Ft as Separator,
|
|
2044
|
+
mt as isCoarsePointer,
|
|
2045
|
+
Vt as useDefaultLayout,
|
|
2046
|
+
jt as useGroupCallbackRef,
|
|
2047
|
+
Wt as useGroupRef,
|
|
2048
|
+
Ut as usePanelCallbackRef,
|
|
2049
|
+
Bt as usePanelRef
|
|
2041
2050
|
};
|
|
2042
2051
|
//# sourceMappingURL=react-resizable-panels.js.map
|