react-resizable-panels 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as q } from "react/jsx-runtime";
|
|
3
|
-
import { useState as Y, useCallback as K, useId as
|
|
4
|
-
function
|
|
3
|
+
import { useState as Y, useCallback as K, useId as et, useLayoutEffect as De, useEffect as Oe, useRef as k, createContext as tt, useImperativeHandle as Te, useMemo as _e, useSyncExternalStore as nt, useContext as ot } from "react";
|
|
4
|
+
function w(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
@@ -11,23 +11,23 @@ function U({
|
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
12
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function fe(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? it : rt
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function it(e, t) {
|
|
20
20
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
21
21
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function rt(e, t) {
|
|
24
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
25
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Ae(e) {
|
|
28
28
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Ne(e, t) {
|
|
31
31
|
return {
|
|
32
32
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
33
33
|
Math.abs(e.x - t.left),
|
|
@@ -39,7 +39,7 @@ function _e(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function st({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -50,19 +50,19 @@ function it({
|
|
|
50
50
|
};
|
|
51
51
|
let i, s = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x: r, y: a } =
|
|
53
|
+
const { x: r, y: a } = Ne(o, l), u = e === "horizontal" ? r : a;
|
|
54
54
|
u < s && (s = u, i = l);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return w(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let oe;
|
|
59
|
-
function
|
|
59
|
+
function at() {
|
|
60
60
|
return oe === void 0 && (typeof matchMedia == "function" ? oe = !!matchMedia("(pointer:coarse)").matches : oe = !1), oe;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s =
|
|
62
|
+
function Fe(e) {
|
|
63
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, s = fe(
|
|
64
64
|
n,
|
|
65
|
-
Array.from(t.children).filter(
|
|
65
|
+
Array.from(t.children).filter(Ae).map((c) => ({ element: c }))
|
|
66
66
|
).map(({ element: c }) => c), l = [];
|
|
67
67
|
let r = !1, a, u = [];
|
|
68
68
|
for (const c of s)
|
|
@@ -90,7 +90,7 @@ function Ne(e) {
|
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case 1: {
|
|
93
|
-
const y = u[0], v =
|
|
93
|
+
const y = u[0], v = st({
|
|
94
94
|
orientation: n,
|
|
95
95
|
rects: [g, h],
|
|
96
96
|
targetRect: y.element.getBoundingClientRect()
|
|
@@ -122,7 +122,7 @@ function Ne(e) {
|
|
|
122
122
|
];
|
|
123
123
|
for (const p of f) {
|
|
124
124
|
let d = "width" in p ? p : p.element.getBoundingClientRect();
|
|
125
|
-
const y =
|
|
125
|
+
const y = at() ? 37 : 27;
|
|
126
126
|
if (d.width < y) {
|
|
127
127
|
const v = y - d.width;
|
|
128
128
|
d = new DOMRect(
|
|
@@ -161,21 +161,21 @@ function Ne(e) {
|
|
|
161
161
|
r = !0;
|
|
162
162
|
return l;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function lt(e, t) {
|
|
165
165
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
166
166
|
return t * o;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function ut(e, t) {
|
|
169
169
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
170
170
|
return t * o;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function ct(e) {
|
|
173
173
|
return e / 100 * window.innerHeight;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ft(e) {
|
|
176
176
|
return e / 100 * window.innerWidth;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function dt(e) {
|
|
179
179
|
switch (typeof e) {
|
|
180
180
|
case "number":
|
|
181
181
|
return [e, "px"];
|
|
@@ -191,7 +191,7 @@ function ie({
|
|
|
191
191
|
styleProp: n
|
|
192
192
|
}) {
|
|
193
193
|
let o;
|
|
194
|
-
const [i, s] =
|
|
194
|
+
const [i, s] = dt(n);
|
|
195
195
|
switch (s) {
|
|
196
196
|
case "%": {
|
|
197
197
|
o = i / 100 * e;
|
|
@@ -202,19 +202,19 @@ function ie({
|
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "rem": {
|
|
205
|
-
o =
|
|
205
|
+
o = ut(t, i);
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
case "em": {
|
|
209
|
-
o =
|
|
209
|
+
o = lt(t, i);
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
212
|
case "vh": {
|
|
213
|
-
o =
|
|
213
|
+
o = ct(i);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
case "vw": {
|
|
217
|
-
o =
|
|
217
|
+
o = ft(i);
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -223,7 +223,7 @@ function ie({
|
|
|
223
223
|
function O(e) {
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Se(e) {
|
|
227
227
|
const { panels: t } = e, n = U({ group: e });
|
|
228
228
|
return n === 0 ? t.map((o) => ({
|
|
229
229
|
collapsedSize: 0,
|
|
@@ -280,7 +280,7 @@ function ye(e) {
|
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
class
|
|
283
|
+
class pt {
|
|
284
284
|
#e = {};
|
|
285
285
|
addListener(t, n) {
|
|
286
286
|
const o = this.#e[t];
|
|
@@ -329,7 +329,7 @@ let D = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const _ = new
|
|
332
|
+
const _ = new pt();
|
|
333
333
|
function G() {
|
|
334
334
|
return D;
|
|
335
335
|
}
|
|
@@ -359,13 +359,13 @@ function E(e) {
|
|
|
359
359
|
});
|
|
360
360
|
}), _.emit("mountedGroupsChange", D.mountedGroups)), D;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function ht(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
364
364
|
x: 1 / 0,
|
|
365
365
|
y: 1 / 0
|
|
366
366
|
};
|
|
367
367
|
for (const s of t) {
|
|
368
|
-
const l =
|
|
368
|
+
const l = Ne(n, s.rect);
|
|
369
369
|
switch (e) {
|
|
370
370
|
case "horizontal": {
|
|
371
371
|
l.x <= i.x && (o = s, i = l);
|
|
@@ -382,25 +382,25 @@ function dt(e, t, n) {
|
|
|
382
382
|
hitRegion: o
|
|
383
383
|
} : void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function mt(e) {
|
|
386
386
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
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
|
e = n.a.pop(), t = n.b.pop(), o = e;
|
|
397
|
-
|
|
397
|
+
w(
|
|
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: ve(
|
|
403
|
-
b: ve(
|
|
402
|
+
a: xe(ve(n.a)),
|
|
403
|
+
b: xe(ve(n.b))
|
|
404
404
|
};
|
|
405
405
|
if (i.a === i.b) {
|
|
406
406
|
const s = o.childNodes, l = {
|
|
@@ -416,75 +416,75 @@ function ht(e, t) {
|
|
|
416
416
|
}
|
|
417
417
|
return Math.sign(i.a - i.b);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
421
|
-
const t = getComputedStyle(
|
|
419
|
+
const yt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
420
|
+
function St(e) {
|
|
421
|
+
const t = getComputedStyle($e(e) ?? e).display;
|
|
422
422
|
return t === "flex" || t === "inline-flex";
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function vt(e) {
|
|
425
425
|
const t = getComputedStyle(e);
|
|
426
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
426
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || St(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" || yt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function ve(e) {
|
|
429
429
|
let t = e.length;
|
|
430
430
|
for (; t--; ) {
|
|
431
431
|
const n = e[t];
|
|
432
|
-
if (
|
|
432
|
+
if (w(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
|
-
t.push(e), e =
|
|
442
|
+
t.push(e), e = $e(e);
|
|
443
443
|
return t;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function $e(e) {
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
|
-
return
|
|
447
|
+
return mt(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
|
|
456
456
|
}) {
|
|
457
|
-
if (!
|
|
457
|
+
if (!Ae(n) || n.contains(e) || e.contains(n))
|
|
458
458
|
return !0;
|
|
459
|
-
if (
|
|
459
|
+
if (gt(n, e) > 0) {
|
|
460
460
|
let o = n;
|
|
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
|
}
|
|
468
468
|
}
|
|
469
469
|
return !0;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function de(e, t) {
|
|
472
472
|
const n = [];
|
|
473
473
|
return t.forEach((o, i) => {
|
|
474
474
|
if (i.disabled)
|
|
475
475
|
return;
|
|
476
|
-
const s =
|
|
476
|
+
const s = Fe(i), l = ht(i.orientation, s, {
|
|
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
|
|
484
484
|
}) && n.push(l.hitRegion);
|
|
485
485
|
}), n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function wt(e, t) {
|
|
488
488
|
if (e.length !== t.length)
|
|
489
489
|
return !1;
|
|
490
490
|
for (let n = 0; n < e.length; n++)
|
|
@@ -524,12 +524,12 @@ function J({
|
|
|
524
524
|
if (R(e, 0))
|
|
525
525
|
return t;
|
|
526
526
|
const l = Object.values(t), r = Object.values(i), a = [...l], [u, c] = o;
|
|
527
|
-
|
|
527
|
+
w(u != null, "Invalid first pivot index"), w(c != null, "Invalid second pivot index");
|
|
528
528
|
let m = 0;
|
|
529
529
|
if (s === "keyboard") {
|
|
530
530
|
{
|
|
531
531
|
const f = e < 0 ? c : u, p = n[f];
|
|
532
|
-
|
|
532
|
+
w(
|
|
533
533
|
p,
|
|
534
534
|
`Panel constraints not found for index ${f}`
|
|
535
535
|
);
|
|
@@ -540,7 +540,7 @@ function J({
|
|
|
540
540
|
} = p;
|
|
541
541
|
if (y) {
|
|
542
542
|
const x = l[f];
|
|
543
|
-
if (
|
|
543
|
+
if (w(
|
|
544
544
|
x != null,
|
|
545
545
|
`Previous layout not found for panel index ${f}`
|
|
546
546
|
), R(x, d)) {
|
|
@@ -551,7 +551,7 @@ function J({
|
|
|
551
551
|
}
|
|
552
552
|
{
|
|
553
553
|
const f = e < 0 ? u : c, p = n[f];
|
|
554
|
-
|
|
554
|
+
w(
|
|
555
555
|
p,
|
|
556
556
|
`No panel constraints found for index ${f}`
|
|
557
557
|
);
|
|
@@ -562,7 +562,7 @@ function J({
|
|
|
562
562
|
} = p;
|
|
563
563
|
if (y) {
|
|
564
564
|
const x = l[f];
|
|
565
|
-
if (
|
|
565
|
+
if (w(
|
|
566
566
|
x != null,
|
|
567
567
|
`Previous layout not found for panel index ${f}`
|
|
568
568
|
), R(x, v)) {
|
|
@@ -577,7 +577,7 @@ function J({
|
|
|
577
577
|
let p = e < 0 ? c : u, d = 0;
|
|
578
578
|
for (; ; ) {
|
|
579
579
|
const v = l[p];
|
|
580
|
-
|
|
580
|
+
w(
|
|
581
581
|
v != null,
|
|
582
582
|
`Previous layout not found for panel index ${p}`
|
|
583
583
|
);
|
|
@@ -595,7 +595,7 @@ function J({
|
|
|
595
595
|
let p = e < 0 ? u : c;
|
|
596
596
|
for (; p >= 0 && p < n.length; ) {
|
|
597
597
|
const d = Math.abs(e) - Math.abs(m), y = l[p];
|
|
598
|
-
|
|
598
|
+
w(
|
|
599
599
|
y != null,
|
|
600
600
|
`Previous layout not found for panel index ${p}`
|
|
601
601
|
);
|
|
@@ -610,11 +610,11 @@ function J({
|
|
|
610
610
|
e < 0 ? p-- : p++;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
if (
|
|
613
|
+
if (wt(r, a))
|
|
614
614
|
return i;
|
|
615
615
|
{
|
|
616
616
|
const f = e < 0 ? c : u, p = l[f];
|
|
617
|
-
|
|
617
|
+
w(
|
|
618
618
|
p != null,
|
|
619
619
|
`Previous layout not found for panel index ${f}`
|
|
620
620
|
);
|
|
@@ -626,7 +626,7 @@ function J({
|
|
|
626
626
|
let v = d - y, S = e < 0 ? c : u;
|
|
627
627
|
for (; S >= 0 && S < n.length; ) {
|
|
628
628
|
const C = a[S];
|
|
629
|
-
|
|
629
|
+
w(
|
|
630
630
|
C != null,
|
|
631
631
|
`Previous layout not found for panel index ${S}`
|
|
632
632
|
);
|
|
@@ -649,7 +649,7 @@ function J({
|
|
|
649
649
|
const h = Object.keys(i);
|
|
650
650
|
return a.reduce((f, p, d) => (f[h[d]] = p, f), {});
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function A(e, t) {
|
|
653
653
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
654
654
|
return !1;
|
|
655
655
|
for (const n in e)
|
|
@@ -657,7 +657,7 @@ function N(e, t) {
|
|
|
657
657
|
return !1;
|
|
658
658
|
return !0;
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function N({
|
|
661
661
|
layout: e,
|
|
662
662
|
panelConstraints: t
|
|
663
663
|
}) {
|
|
@@ -672,14 +672,14 @@ function A({
|
|
|
672
672
|
if (!R(i, 100) && o.length > 0)
|
|
673
673
|
for (let r = 0; r < t.length; r++) {
|
|
674
674
|
const a = o[r];
|
|
675
|
-
|
|
675
|
+
w(a != null, `No layout data found for index ${r}`);
|
|
676
676
|
const u = 100 / i * a;
|
|
677
677
|
o[r] = u;
|
|
678
678
|
}
|
|
679
679
|
let s = 0;
|
|
680
680
|
for (let r = 0; r < t.length; r++) {
|
|
681
681
|
const a = o[r];
|
|
682
|
-
|
|
682
|
+
w(a != null, `No layout data found for index ${r}`);
|
|
683
683
|
const u = V({
|
|
684
684
|
panelConstraints: t[r],
|
|
685
685
|
size: a
|
|
@@ -689,7 +689,7 @@ function A({
|
|
|
689
689
|
if (!R(s, 0))
|
|
690
690
|
for (let r = 0; r < t.length; r++) {
|
|
691
691
|
const a = o[r];
|
|
692
|
-
|
|
692
|
+
w(a != null, `No layout data found for index ${r}`);
|
|
693
693
|
const u = a + s, c = V({
|
|
694
694
|
panelConstraints: t[r],
|
|
695
695
|
size: u
|
|
@@ -700,7 +700,7 @@ function A({
|
|
|
700
700
|
const l = Object.keys(e);
|
|
701
701
|
return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function He({
|
|
704
704
|
groupId: e,
|
|
705
705
|
panelId: t
|
|
706
706
|
}) {
|
|
@@ -758,11 +758,11 @@ function Fe({
|
|
|
758
758
|
pivotIndices: p ? [f - 1, f] : [f, f + 1],
|
|
759
759
|
prevLayout: g,
|
|
760
760
|
trigger: "imperative-api"
|
|
761
|
-
}), y =
|
|
761
|
+
}), y = N({
|
|
762
762
|
layout: d,
|
|
763
763
|
panelConstraints: c
|
|
764
764
|
});
|
|
765
|
-
|
|
765
|
+
A(g, y) || E((v) => ({
|
|
766
766
|
mountedGroups: new Map(v.mountedGroups).set(m, {
|
|
767
767
|
defaultLayoutDeferred: u,
|
|
768
768
|
derivedPanelConstraints: c,
|
|
@@ -813,10 +813,10 @@ function Fe({
|
|
|
813
813
|
}
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function we(e) {
|
|
817
817
|
if (e.defaultPrevented)
|
|
818
818
|
return;
|
|
819
|
-
const { mountedGroups: t } = G(), n =
|
|
819
|
+
const { mountedGroups: t } = G(), n = de(e, t), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
820
820
|
n.forEach((s) => {
|
|
821
821
|
if (o.add(s.group), s.panels.forEach((l) => {
|
|
822
822
|
i.add(l);
|
|
@@ -825,7 +825,7 @@ function ze(e) {
|
|
|
825
825
|
(r) => r.panelConstraints.defaultSize !== void 0
|
|
826
826
|
);
|
|
827
827
|
if (l) {
|
|
828
|
-
const r = l.panelConstraints.defaultSize, a =
|
|
828
|
+
const r = l.panelConstraints.defaultSize, a = He({
|
|
829
829
|
groupId: s.group.id,
|
|
830
830
|
panelId: l.id
|
|
831
831
|
});
|
|
@@ -834,7 +834,7 @@ function ze(e) {
|
|
|
834
834
|
}
|
|
835
835
|
});
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function se(e) {
|
|
838
838
|
const { mountedGroups: t } = G();
|
|
839
839
|
for (const [n] of t)
|
|
840
840
|
if (n.separators.some(
|
|
@@ -843,7 +843,7 @@ function re(e) {
|
|
|
843
843
|
return n;
|
|
844
844
|
throw Error("Could not find parent Group for separator element");
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function je({
|
|
847
847
|
groupId: e
|
|
848
848
|
}) {
|
|
849
849
|
const t = () => {
|
|
@@ -865,11 +865,11 @@ function $e({
|
|
|
865
865
|
group: s,
|
|
866
866
|
layout: l,
|
|
867
867
|
separatorToPanels: r
|
|
868
|
-
} = t(), a =
|
|
868
|
+
} = t(), a = N({
|
|
869
869
|
layout: n,
|
|
870
870
|
panelConstraints: i
|
|
871
871
|
});
|
|
872
|
-
return o ? l : (
|
|
872
|
+
return o ? l : (A(l, a) || E((u) => ({
|
|
873
873
|
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
874
874
|
defaultLayoutDeferred: o,
|
|
875
875
|
derivedPanelConstraints: i,
|
|
@@ -880,29 +880,29 @@ function $e({
|
|
|
880
880
|
}
|
|
881
881
|
};
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function Ve(e) {
|
|
884
884
|
const { mountedGroups: t } = G(), n = t.get(e);
|
|
885
|
-
return
|
|
885
|
+
return w(n, `Mounted Group ${e.id} not found`), n;
|
|
886
886
|
}
|
|
887
887
|
function T(e, t) {
|
|
888
|
-
const n =
|
|
888
|
+
const n = se(e), o = Ve(n), i = n.separators.find(
|
|
889
889
|
(m) => m.element === e
|
|
890
890
|
);
|
|
891
|
-
|
|
891
|
+
w(i, "Matching separator not found");
|
|
892
892
|
const s = o.separatorToPanels.get(i);
|
|
893
|
-
|
|
894
|
-
const l = s.map((m) => n.panels.indexOf(m)), a =
|
|
893
|
+
w(s, "Matching panels not found");
|
|
894
|
+
const l = s.map((m) => n.panels.indexOf(m)), a = je({ groupId: n.id }).getLayout(), u = J({
|
|
895
895
|
delta: t,
|
|
896
896
|
initialLayout: a,
|
|
897
897
|
panelConstraints: o.derivedPanelConstraints,
|
|
898
898
|
pivotIndices: l,
|
|
899
899
|
prevLayout: a,
|
|
900
900
|
trigger: "keyboard"
|
|
901
|
-
}), c =
|
|
901
|
+
}), c = N({
|
|
902
902
|
layout: u,
|
|
903
903
|
panelConstraints: o.derivedPanelConstraints
|
|
904
904
|
});
|
|
905
|
-
|
|
905
|
+
A(a, c) || E((m) => ({
|
|
906
906
|
mountedGroups: new Map(m.mountedGroups).set(n, {
|
|
907
907
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
908
908
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -914,7 +914,7 @@ function T(e, t) {
|
|
|
914
914
|
function be(e) {
|
|
915
915
|
if (e.defaultPrevented)
|
|
916
916
|
return;
|
|
917
|
-
const t = e.currentTarget, n =
|
|
917
|
+
const t = e.currentTarget, n = se(t);
|
|
918
918
|
if (!n.disabled)
|
|
919
919
|
switch (e.key) {
|
|
920
920
|
case "ArrowDown": {
|
|
@@ -939,16 +939,16 @@ function be(e) {
|
|
|
939
939
|
}
|
|
940
940
|
case "Enter": {
|
|
941
941
|
e.preventDefault();
|
|
942
|
-
const o =
|
|
942
|
+
const o = se(t), { derivedPanelConstraints: i, layout: s, separatorToPanels: l } = Ve(o), r = o.separators.find(
|
|
943
943
|
(m) => m.element === t
|
|
944
944
|
);
|
|
945
|
-
|
|
945
|
+
w(r, "Matching separator not found");
|
|
946
946
|
const a = l.get(r);
|
|
947
|
-
|
|
947
|
+
w(a, "Matching panels not found");
|
|
948
948
|
const u = a[0], c = i.find(
|
|
949
949
|
(m) => m.panelId === u.id
|
|
950
950
|
);
|
|
951
|
-
if (
|
|
951
|
+
if (w(c, "Panel metadata not found"), c.collapsible) {
|
|
952
952
|
const m = s[u.id], g = c.collapsedSize === m ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
953
953
|
T(t, g - m);
|
|
954
954
|
}
|
|
@@ -956,12 +956,12 @@ function be(e) {
|
|
|
956
956
|
}
|
|
957
957
|
case "F6": {
|
|
958
958
|
e.preventDefault();
|
|
959
|
-
const i =
|
|
959
|
+
const i = se(t).separators.map(
|
|
960
960
|
(a) => a.element
|
|
961
961
|
), s = Array.from(i).findIndex(
|
|
962
962
|
(a) => a === e.currentTarget
|
|
963
963
|
);
|
|
964
|
-
|
|
964
|
+
w(s !== null, "Index not found");
|
|
965
965
|
const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
|
|
966
966
|
i[l].focus();
|
|
967
967
|
break;
|
|
@@ -972,12 +972,12 @@ function be(e) {
|
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function Le(e) {
|
|
976
976
|
if (e.defaultPrevented)
|
|
977
977
|
return;
|
|
978
978
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
979
979
|
return;
|
|
980
|
-
const { mountedGroups: t } = G(), n =
|
|
980
|
+
const { mountedGroups: t } = G(), n = de(e, t), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
981
981
|
let r = !1;
|
|
982
982
|
n.forEach((a) => {
|
|
983
983
|
o.add(a.group), a.panels.forEach((c) => {
|
|
@@ -994,9 +994,13 @@ function we(e) {
|
|
|
994
994
|
}
|
|
995
995
|
}), n.length && e.preventDefault();
|
|
996
996
|
}
|
|
997
|
-
const
|
|
998
|
-
},
|
|
999
|
-
|
|
997
|
+
const bt = (e) => e, ue = () => {
|
|
998
|
+
}, Ue = 1, We = 2, Be = 4, Ke = 8, Ce = 3, Pe = 12;
|
|
999
|
+
let re;
|
|
1000
|
+
function Re() {
|
|
1001
|
+
return re === void 0 && (re = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (re = !0)), re;
|
|
1002
|
+
}
|
|
1003
|
+
function Lt({
|
|
1000
1004
|
cursorFlags: e,
|
|
1001
1005
|
groups: t,
|
|
1002
1006
|
state: n
|
|
@@ -1023,8 +1027,8 @@ function bt({
|
|
|
1023
1027
|
return null;
|
|
1024
1028
|
switch (n) {
|
|
1025
1029
|
case "active": {
|
|
1026
|
-
|
|
1027
|
-
|
|
1030
|
+
if (e && Re()) {
|
|
1031
|
+
const s = (e & Ue) !== 0, l = (e & We) !== 0, r = (e & Be) !== 0, a = (e & Ke) !== 0;
|
|
1028
1032
|
if (s)
|
|
1029
1033
|
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1030
1034
|
if (l)
|
|
@@ -1037,23 +1041,23 @@ function bt({
|
|
|
1037
1041
|
break;
|
|
1038
1042
|
}
|
|
1039
1043
|
}
|
|
1040
|
-
return o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
1044
|
+
return Re() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1041
1045
|
}
|
|
1042
|
-
const
|
|
1043
|
-
function
|
|
1046
|
+
const Me = /* @__PURE__ */ new WeakMap();
|
|
1047
|
+
function pe(e) {
|
|
1044
1048
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1045
1049
|
return;
|
|
1046
|
-
let { prevStyle: t, styleSheet: n } =
|
|
1050
|
+
let { prevStyle: t, styleSheet: n } = Me.get(e) ?? {};
|
|
1047
1051
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1048
1052
|
const { cursorFlags: o, interactionState: i } = G();
|
|
1049
1053
|
switch (i.state) {
|
|
1050
1054
|
case "active":
|
|
1051
1055
|
case "hover": {
|
|
1052
|
-
const s =
|
|
1056
|
+
const s = Lt({
|
|
1053
1057
|
cursorFlags: o,
|
|
1054
1058
|
groups: i.hitRegions.map((r) => r.group),
|
|
1055
1059
|
state: i.state
|
|
1056
|
-
}), l =
|
|
1060
|
+
}), l = `*, *:hover {cursor: ${s} !important; ${i.state === "active" ? "touch-action: none;" : ""} }`;
|
|
1057
1061
|
if (t === l)
|
|
1058
1062
|
return;
|
|
1059
1063
|
t = l, s ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
@@ -1064,12 +1068,12 @@ function de(e) {
|
|
|
1064
1068
|
break;
|
|
1065
1069
|
}
|
|
1066
1070
|
}
|
|
1067
|
-
|
|
1071
|
+
Me.set(e, {
|
|
1068
1072
|
prevStyle: t,
|
|
1069
1073
|
styleSheet: n
|
|
1070
1074
|
});
|
|
1071
1075
|
}
|
|
1072
|
-
function
|
|
1076
|
+
function Xe({
|
|
1073
1077
|
document: e,
|
|
1074
1078
|
event: t,
|
|
1075
1079
|
hitRegions: n,
|
|
@@ -1099,15 +1103,15 @@ function Be({
|
|
|
1099
1103
|
prevLayout: S,
|
|
1100
1104
|
trigger: "mouse-or-touch"
|
|
1101
1105
|
});
|
|
1102
|
-
if (
|
|
1106
|
+
if (A(L, S)) {
|
|
1103
1107
|
if (d !== 0 && !h)
|
|
1104
1108
|
switch (f) {
|
|
1105
1109
|
case "horizontal": {
|
|
1106
|
-
r |= d < 0 ?
|
|
1110
|
+
r |= d < 0 ? Ue : We;
|
|
1107
1111
|
break;
|
|
1108
1112
|
}
|
|
1109
1113
|
case "vertical": {
|
|
1110
|
-
r |= d < 0 ?
|
|
1114
|
+
r |= d < 0 ? Be : Ke;
|
|
1111
1115
|
break;
|
|
1112
1116
|
}
|
|
1113
1117
|
}
|
|
@@ -1124,16 +1128,16 @@ function Be({
|
|
|
1124
1128
|
}
|
|
1125
1129
|
});
|
|
1126
1130
|
let u = 0;
|
|
1127
|
-
t.movementX === 0 ? u |= l &
|
|
1131
|
+
t.movementX === 0 ? u |= l & Ce : u |= r & Ce, t.movementY === 0 ? u |= l & Pe : u |= r & Pe, E({
|
|
1128
1132
|
cursorFlags: u,
|
|
1129
1133
|
mountedGroups: a
|
|
1130
|
-
}),
|
|
1134
|
+
}), pe(e);
|
|
1131
1135
|
}
|
|
1132
|
-
function
|
|
1136
|
+
function Ee(e) {
|
|
1133
1137
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
1134
1138
|
switch (n.state) {
|
|
1135
1139
|
case "active":
|
|
1136
|
-
|
|
1140
|
+
Xe({
|
|
1137
1141
|
document: e.currentTarget,
|
|
1138
1142
|
event: e,
|
|
1139
1143
|
hitRegions: n.hitRegions,
|
|
@@ -1143,7 +1147,7 @@ function Re(e) {
|
|
|
1143
1147
|
});
|
|
1144
1148
|
}
|
|
1145
1149
|
}
|
|
1146
|
-
function
|
|
1150
|
+
function ke(e) {
|
|
1147
1151
|
if (e.defaultPrevented)
|
|
1148
1152
|
return;
|
|
1149
1153
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
|
|
@@ -1163,7 +1167,7 @@ function Me(e) {
|
|
|
1163
1167
|
}));
|
|
1164
1168
|
return;
|
|
1165
1169
|
}
|
|
1166
|
-
|
|
1170
|
+
Xe({
|
|
1167
1171
|
document: e.currentTarget,
|
|
1168
1172
|
event: e,
|
|
1169
1173
|
hitRegions: n.hitRegions,
|
|
@@ -1175,7 +1179,7 @@ function Me(e) {
|
|
|
1175
1179
|
break;
|
|
1176
1180
|
}
|
|
1177
1181
|
default: {
|
|
1178
|
-
const i =
|
|
1182
|
+
const i = de(e, o);
|
|
1179
1183
|
i.length === 0 ? n.state !== "inactive" && E({
|
|
1180
1184
|
interactionState: {
|
|
1181
1185
|
state: "inactive"
|
|
@@ -1185,12 +1189,12 @@ function Me(e) {
|
|
|
1185
1189
|
hitRegions: i,
|
|
1186
1190
|
state: "hover"
|
|
1187
1191
|
}
|
|
1188
|
-
}),
|
|
1192
|
+
}), pe(e.currentTarget);
|
|
1189
1193
|
break;
|
|
1190
1194
|
}
|
|
1191
1195
|
}
|
|
1192
1196
|
}
|
|
1193
|
-
function
|
|
1197
|
+
function Ge(e) {
|
|
1194
1198
|
if (e.defaultPrevented)
|
|
1195
1199
|
return;
|
|
1196
1200
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
@@ -1203,12 +1207,12 @@ function Ee(e) {
|
|
|
1203
1207
|
interactionState: {
|
|
1204
1208
|
state: "inactive"
|
|
1205
1209
|
}
|
|
1206
|
-
}), t.hitRegions.length > 0 && (
|
|
1210
|
+
}), t.hitRegions.length > 0 && (pe(e.currentTarget), E((n) => ({
|
|
1207
1211
|
mountedGroups: new Map(n.mountedGroups)
|
|
1208
1212
|
})), e.preventDefault());
|
|
1209
1213
|
}
|
|
1210
1214
|
}
|
|
1211
|
-
function
|
|
1215
|
+
function Ie(e) {
|
|
1212
1216
|
let t = 0, n = 0;
|
|
1213
1217
|
const o = {};
|
|
1214
1218
|
for (const s of e)
|
|
@@ -1226,7 +1230,7 @@ function ke(e) {
|
|
|
1226
1230
|
}
|
|
1227
1231
|
return o;
|
|
1228
1232
|
}
|
|
1229
|
-
function
|
|
1233
|
+
function Ct(e, t, n) {
|
|
1230
1234
|
if (!n[0])
|
|
1231
1235
|
return;
|
|
1232
1236
|
const i = e.panels.find((u) => u.element === t);
|
|
@@ -1238,7 +1242,7 @@ function wt(e, t, n) {
|
|
|
1238
1242
|
};
|
|
1239
1243
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
1240
1244
|
}
|
|
1241
|
-
function
|
|
1245
|
+
function Pt(e, t) {
|
|
1242
1246
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1243
1247
|
return !1;
|
|
1244
1248
|
for (const o in e)
|
|
@@ -1246,7 +1250,7 @@ function Lt(e, t) {
|
|
|
1246
1250
|
return !1;
|
|
1247
1251
|
return !0;
|
|
1248
1252
|
}
|
|
1249
|
-
function
|
|
1253
|
+
function Rt(e, t) {
|
|
1250
1254
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1251
1255
|
if (n.length !== o.length)
|
|
1252
1256
|
return !1;
|
|
@@ -1256,9 +1260,9 @@ function Ct(e, t) {
|
|
|
1256
1260
|
return !0;
|
|
1257
1261
|
}
|
|
1258
1262
|
const j = /* @__PURE__ */ new Map();
|
|
1259
|
-
function
|
|
1263
|
+
function Mt(e) {
|
|
1260
1264
|
let t = !0;
|
|
1261
|
-
|
|
1265
|
+
w(
|
|
1262
1266
|
e.element.ownerDocument.defaultView,
|
|
1263
1267
|
"Cannot register an unmounted Group"
|
|
1264
1268
|
);
|
|
@@ -1272,11 +1276,11 @@ function Pt(e) {
|
|
|
1272
1276
|
E((x) => {
|
|
1273
1277
|
const S = x.mountedGroups.get(e);
|
|
1274
1278
|
if (S) {
|
|
1275
|
-
const C =
|
|
1279
|
+
const C = Se(e), L = S.defaultLayoutDeferred ? Ie(C) : S.layout, P = N({
|
|
1276
1280
|
layout: L,
|
|
1277
1281
|
panelConstraints: C
|
|
1278
1282
|
});
|
|
1279
|
-
return !S.defaultLayoutDeferred &&
|
|
1283
|
+
return !S.defaultLayoutDeferred && A(L, P) && Pt(
|
|
1280
1284
|
S.derivedPanelConstraints,
|
|
1281
1285
|
C
|
|
1282
1286
|
) ? x : {
|
|
@@ -1292,22 +1296,22 @@ function Pt(e) {
|
|
|
1292
1296
|
});
|
|
1293
1297
|
}
|
|
1294
1298
|
} else
|
|
1295
|
-
|
|
1299
|
+
Ct(e, y, d);
|
|
1296
1300
|
}
|
|
1297
1301
|
});
|
|
1298
1302
|
s.observe(e.element), e.panels.forEach((f) => {
|
|
1299
|
-
|
|
1303
|
+
w(
|
|
1300
1304
|
!o.has(f.id),
|
|
1301
1305
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1302
1306
|
), o.add(f.id), f.onResize && s.observe(f.element);
|
|
1303
1307
|
});
|
|
1304
|
-
const l = U({ group: e }), r =
|
|
1308
|
+
const l = U({ group: e }), r = Se(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1305
1309
|
let u = e.defaultLayout;
|
|
1306
|
-
u && (
|
|
1307
|
-
const c = e.inMemoryLayouts[a] ?? u ??
|
|
1310
|
+
u && (Rt(e.panels, u) || (u = void 0));
|
|
1311
|
+
const c = e.inMemoryLayouts[a] ?? u ?? Ie(r), m = N({
|
|
1308
1312
|
layout: c,
|
|
1309
1313
|
panelConstraints: r
|
|
1310
|
-
}), g =
|
|
1314
|
+
}), g = Fe(e), h = e.element.ownerDocument;
|
|
1311
1315
|
return E((f) => {
|
|
1312
1316
|
const p = /* @__PURE__ */ new Map();
|
|
1313
1317
|
return j.set(
|
|
@@ -1324,11 +1328,11 @@ function Pt(e) {
|
|
|
1324
1328
|
})
|
|
1325
1329
|
};
|
|
1326
1330
|
}), e.separators.forEach((f) => {
|
|
1327
|
-
|
|
1331
|
+
w(
|
|
1328
1332
|
!i.has(f.id),
|
|
1329
1333
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1330
1334
|
), i.add(f.id), f.element.addEventListener("keydown", be);
|
|
1331
|
-
}), j.get(h) === 1 && (h.addEventListener("dblclick",
|
|
1335
|
+
}), j.get(h) === 1 && (h.addEventListener("dblclick", we, !0), h.addEventListener("pointerdown", Le, !0), h.addEventListener("pointerleave", Ee), h.addEventListener("pointermove", ke), h.addEventListener("pointerup", Ge, !0)), function() {
|
|
1332
1336
|
t = !1, j.set(
|
|
1333
1337
|
h,
|
|
1334
1338
|
Math.max(0, (j.get(h) ?? 0) - 1)
|
|
@@ -1339,24 +1343,24 @@ function Pt(e) {
|
|
|
1339
1343
|
p.element.removeEventListener("keydown", be);
|
|
1340
1344
|
}), j.get(h) || (h.removeEventListener(
|
|
1341
1345
|
"dblclick",
|
|
1342
|
-
|
|
1346
|
+
we,
|
|
1343
1347
|
!0
|
|
1344
1348
|
), h.removeEventListener(
|
|
1345
1349
|
"pointerdown",
|
|
1346
|
-
|
|
1350
|
+
Le,
|
|
1347
1351
|
!0
|
|
1348
|
-
), h.removeEventListener("pointerleave",
|
|
1352
|
+
), h.removeEventListener("pointerleave", Ee), h.removeEventListener("pointermove", ke), h.removeEventListener("pointerup", Ge, !0)), s.disconnect();
|
|
1349
1353
|
};
|
|
1350
1354
|
}
|
|
1351
|
-
function
|
|
1355
|
+
function qe() {
|
|
1352
1356
|
const [e, t] = Y({}), n = K(() => t({}), []);
|
|
1353
1357
|
return [e, n];
|
|
1354
1358
|
}
|
|
1355
|
-
function
|
|
1356
|
-
const t =
|
|
1359
|
+
function he(e) {
|
|
1360
|
+
const t = et();
|
|
1357
1361
|
return `${e ?? t}`;
|
|
1358
1362
|
}
|
|
1359
|
-
const F = typeof window < "u" ?
|
|
1363
|
+
const F = typeof window < "u" ? De : Oe;
|
|
1360
1364
|
function X(e) {
|
|
1361
1365
|
const t = k(e);
|
|
1362
1366
|
return F(() => {
|
|
@@ -1366,7 +1370,7 @@ function X(e) {
|
|
|
1366
1370
|
[t]
|
|
1367
1371
|
);
|
|
1368
1372
|
}
|
|
1369
|
-
function
|
|
1373
|
+
function me(...e) {
|
|
1370
1374
|
return X((t) => {
|
|
1371
1375
|
e.forEach((n) => {
|
|
1372
1376
|
if (n)
|
|
@@ -1383,27 +1387,27 @@ function he(...e) {
|
|
|
1383
1387
|
});
|
|
1384
1388
|
});
|
|
1385
1389
|
}
|
|
1386
|
-
function
|
|
1390
|
+
function Et(e) {
|
|
1387
1391
|
const t = k({ ...e });
|
|
1388
1392
|
return F(() => {
|
|
1389
1393
|
for (const n in e)
|
|
1390
1394
|
t.current[n] = e[n];
|
|
1391
1395
|
}, [e]), t.current;
|
|
1392
1396
|
}
|
|
1393
|
-
const
|
|
1394
|
-
function
|
|
1397
|
+
const Ye = tt(null);
|
|
1398
|
+
function kt(e, t) {
|
|
1395
1399
|
const n = k({
|
|
1396
1400
|
getLayout: () => ({}),
|
|
1397
|
-
setLayout:
|
|
1401
|
+
setLayout: bt
|
|
1398
1402
|
});
|
|
1399
|
-
|
|
1403
|
+
Te(t, () => n.current, []), F(() => {
|
|
1400
1404
|
Object.assign(
|
|
1401
1405
|
n.current,
|
|
1402
|
-
|
|
1406
|
+
je({ groupId: e })
|
|
1403
1407
|
);
|
|
1404
1408
|
});
|
|
1405
1409
|
}
|
|
1406
|
-
function
|
|
1410
|
+
function Gt({
|
|
1407
1411
|
children: e,
|
|
1408
1412
|
className: t,
|
|
1409
1413
|
defaultLayout: n,
|
|
@@ -1422,18 +1426,18 @@ function Et({
|
|
|
1422
1426
|
onLayoutChange: {},
|
|
1423
1427
|
onLayoutChanged: {}
|
|
1424
1428
|
}), f = X((z) => {
|
|
1425
|
-
|
|
1429
|
+
A(h.current.onLayoutChange, z) || (h.current.onLayoutChange = z, a?.(z));
|
|
1426
1430
|
}), p = X((z) => {
|
|
1427
|
-
|
|
1428
|
-
}), d =
|
|
1431
|
+
A(h.current.onLayoutChanged, z) || (h.current.onLayoutChanged = z, u?.(z));
|
|
1432
|
+
}), d = he(r), y = k(null), [v, x] = qe(), S = k({
|
|
1429
1433
|
lastExpandedPanelSizes: {},
|
|
1430
1434
|
layouts: {},
|
|
1431
1435
|
panels: [],
|
|
1432
1436
|
separators: []
|
|
1433
|
-
}), C =
|
|
1434
|
-
|
|
1437
|
+
}), C = me(y, s);
|
|
1438
|
+
kt(d, l);
|
|
1435
1439
|
const L = X(
|
|
1436
|
-
(z,
|
|
1440
|
+
(z, b) => {
|
|
1437
1441
|
const { interactionState: M, mountedGroups: H } = G();
|
|
1438
1442
|
for (const Q of H.keys())
|
|
1439
1443
|
if (Q.id === z) {
|
|
@@ -1443,51 +1447,51 @@ function Et({
|
|
|
1443
1447
|
switch (M.state) {
|
|
1444
1448
|
case "active": {
|
|
1445
1449
|
ee = M.hitRegions.some(
|
|
1446
|
-
(
|
|
1450
|
+
(ae) => ae.group === Q
|
|
1447
1451
|
);
|
|
1448
1452
|
break;
|
|
1449
1453
|
}
|
|
1450
1454
|
}
|
|
1451
1455
|
return {
|
|
1452
|
-
flexGrow: W.layout[
|
|
1456
|
+
flexGrow: W.layout[b] ?? 1,
|
|
1453
1457
|
pointerEvents: ee ? "none" : void 0
|
|
1454
1458
|
};
|
|
1455
1459
|
}
|
|
1456
1460
|
}
|
|
1457
1461
|
return {
|
|
1458
|
-
flexGrow: n?.[
|
|
1462
|
+
flexGrow: n?.[b] ?? 1
|
|
1459
1463
|
};
|
|
1460
1464
|
}
|
|
1461
|
-
), P =
|
|
1465
|
+
), P = _e(
|
|
1462
1466
|
() => ({
|
|
1463
1467
|
getPanelStyles: L,
|
|
1464
1468
|
id: d,
|
|
1465
1469
|
orientation: c,
|
|
1466
1470
|
registerPanel: (z) => {
|
|
1467
|
-
const
|
|
1468
|
-
return
|
|
1469
|
-
...
|
|
1471
|
+
const b = S.current;
|
|
1472
|
+
return b.panels = fe(c, [
|
|
1473
|
+
...b.panels,
|
|
1470
1474
|
z
|
|
1471
1475
|
]), x(), () => {
|
|
1472
|
-
|
|
1476
|
+
b.panels = b.panels.filter(
|
|
1473
1477
|
(M) => M !== z
|
|
1474
1478
|
), x();
|
|
1475
1479
|
};
|
|
1476
1480
|
},
|
|
1477
1481
|
registerSeparator: (z) => {
|
|
1478
|
-
const
|
|
1479
|
-
return
|
|
1480
|
-
...
|
|
1482
|
+
const b = S.current;
|
|
1483
|
+
return b.separators = fe(c, [
|
|
1484
|
+
...b.separators,
|
|
1481
1485
|
z
|
|
1482
1486
|
]), x(), () => {
|
|
1483
|
-
|
|
1487
|
+
b.separators = b.separators.filter(
|
|
1484
1488
|
(M) => M !== z
|
|
1485
1489
|
), x();
|
|
1486
1490
|
};
|
|
1487
1491
|
}
|
|
1488
1492
|
}),
|
|
1489
1493
|
[L, d, x, c]
|
|
1490
|
-
), I =
|
|
1494
|
+
), I = Et({
|
|
1491
1495
|
defaultLayout: n,
|
|
1492
1496
|
disableCursor: o
|
|
1493
1497
|
}), $ = k(null);
|
|
@@ -1495,7 +1499,7 @@ function Et({
|
|
|
1495
1499
|
const z = y.current;
|
|
1496
1500
|
if (z === null)
|
|
1497
1501
|
return;
|
|
1498
|
-
const
|
|
1502
|
+
const b = S.current, M = {
|
|
1499
1503
|
defaultLayout: I.defaultLayout,
|
|
1500
1504
|
disableCursor: !!I.disableCursor,
|
|
1501
1505
|
disabled: !!i,
|
|
@@ -1504,41 +1508,41 @@ function Et({
|
|
|
1504
1508
|
inMemoryLastExpandedPanelSizes: S.current.lastExpandedPanelSizes,
|
|
1505
1509
|
inMemoryLayouts: S.current.layouts,
|
|
1506
1510
|
orientation: c,
|
|
1507
|
-
panels:
|
|
1508
|
-
separators:
|
|
1511
|
+
panels: b.panels,
|
|
1512
|
+
separators: b.separators
|
|
1509
1513
|
};
|
|
1510
1514
|
$.current = M;
|
|
1511
|
-
const H =
|
|
1515
|
+
const H = Mt(M), W = G().mountedGroups.get(M);
|
|
1512
1516
|
if (W) {
|
|
1513
1517
|
const { defaultLayoutDeferred: B, derivedPanelConstraints: te, layout: ne } = W;
|
|
1514
|
-
!B && te.length > 0 && (f(ne), p(ne),
|
|
1515
|
-
|
|
1518
|
+
!B && te.length > 0 && (f(ne), p(ne), b.panels.forEach((le) => {
|
|
1519
|
+
le.scheduleUpdate();
|
|
1516
1520
|
}));
|
|
1517
1521
|
}
|
|
1518
1522
|
const ee = _.addListener(
|
|
1519
1523
|
"interactionStateChange",
|
|
1520
1524
|
() => {
|
|
1521
|
-
|
|
1525
|
+
b.panels.forEach((B) => {
|
|
1522
1526
|
B.scheduleUpdate();
|
|
1523
1527
|
});
|
|
1524
1528
|
}
|
|
1525
|
-
),
|
|
1529
|
+
), ae = _.addListener(
|
|
1526
1530
|
"mountedGroupsChange",
|
|
1527
1531
|
(B) => {
|
|
1528
1532
|
const te = B.get(M);
|
|
1529
1533
|
if (te) {
|
|
1530
|
-
const { defaultLayoutDeferred: ne, derivedPanelConstraints:
|
|
1531
|
-
if (ne ||
|
|
1534
|
+
const { defaultLayoutDeferred: ne, derivedPanelConstraints: le, layout: ye } = te;
|
|
1535
|
+
if (ne || le.length === 0)
|
|
1532
1536
|
return;
|
|
1533
|
-
const { interactionState:
|
|
1534
|
-
f(
|
|
1535
|
-
|
|
1537
|
+
const { interactionState: Ze } = G(), Je = Ze.state !== "active";
|
|
1538
|
+
f(ye), Je && p(ye), b.panels.forEach((Qe) => {
|
|
1539
|
+
Qe.scheduleUpdate();
|
|
1536
1540
|
});
|
|
1537
1541
|
}
|
|
1538
1542
|
}
|
|
1539
1543
|
);
|
|
1540
1544
|
return () => {
|
|
1541
|
-
$.current = null, H(), ee(),
|
|
1545
|
+
$.current = null, H(), ee(), ae();
|
|
1542
1546
|
};
|
|
1543
1547
|
}, [
|
|
1544
1548
|
i,
|
|
@@ -1548,10 +1552,10 @@ function Et({
|
|
|
1548
1552
|
c,
|
|
1549
1553
|
v,
|
|
1550
1554
|
I
|
|
1551
|
-
]),
|
|
1555
|
+
]), Oe(() => {
|
|
1552
1556
|
const z = $.current;
|
|
1553
1557
|
z && (z.defaultLayout = n, z.disableCursor = !!o);
|
|
1554
|
-
}), /* @__PURE__ */ q(
|
|
1558
|
+
}), /* @__PURE__ */ q(Ye.Provider, { value: P, children: /* @__PURE__ */ q(
|
|
1555
1559
|
"div",
|
|
1556
1560
|
{
|
|
1557
1561
|
...g,
|
|
@@ -1574,35 +1578,35 @@ function Et({
|
|
|
1574
1578
|
}
|
|
1575
1579
|
) });
|
|
1576
1580
|
}
|
|
1577
|
-
|
|
1578
|
-
function
|
|
1581
|
+
Gt.displayName = "Group";
|
|
1582
|
+
function ce(e, t) {
|
|
1579
1583
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1580
1584
|
}
|
|
1581
|
-
function
|
|
1585
|
+
function $t({
|
|
1582
1586
|
debounceSaveMs: e = 100,
|
|
1583
1587
|
panelIds: t,
|
|
1584
1588
|
storage: n = localStorage,
|
|
1585
1589
|
...o
|
|
1586
1590
|
}) {
|
|
1587
|
-
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l =
|
|
1588
|
-
|
|
1591
|
+
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = ce(s, t ?? []), r = nt(
|
|
1592
|
+
It,
|
|
1589
1593
|
() => n.getItem(l),
|
|
1590
1594
|
() => n.getItem(l)
|
|
1591
|
-
), a =
|
|
1595
|
+
), a = _e(
|
|
1592
1596
|
() => r ? JSON.parse(r) : void 0,
|
|
1593
1597
|
[r]
|
|
1594
1598
|
), u = k(null), c = K(() => {
|
|
1595
1599
|
const h = u.current;
|
|
1596
1600
|
h && (u.current = null, clearTimeout(h));
|
|
1597
1601
|
}, []);
|
|
1598
|
-
|
|
1602
|
+
De(() => () => {
|
|
1599
1603
|
c();
|
|
1600
1604
|
}, [c]);
|
|
1601
1605
|
const m = K(
|
|
1602
1606
|
(h) => {
|
|
1603
1607
|
c();
|
|
1604
1608
|
let f;
|
|
1605
|
-
i ? f =
|
|
1609
|
+
i ? f = ce(s, Object.keys(h)) : f = ce(s, []);
|
|
1606
1610
|
try {
|
|
1607
1611
|
n.setItem(f, JSON.stringify(h));
|
|
1608
1612
|
} catch (p) {
|
|
@@ -1635,42 +1639,42 @@ function At({
|
|
|
1635
1639
|
onLayoutChanged: m
|
|
1636
1640
|
};
|
|
1637
1641
|
}
|
|
1638
|
-
function
|
|
1642
|
+
function It() {
|
|
1639
1643
|
return function() {
|
|
1640
1644
|
};
|
|
1641
1645
|
}
|
|
1642
|
-
function
|
|
1646
|
+
function Ht() {
|
|
1643
1647
|
return Y(null);
|
|
1644
1648
|
}
|
|
1645
|
-
function
|
|
1649
|
+
function jt() {
|
|
1646
1650
|
return k(null);
|
|
1647
1651
|
}
|
|
1648
|
-
function
|
|
1649
|
-
const e =
|
|
1650
|
-
return
|
|
1652
|
+
function ge() {
|
|
1653
|
+
const e = ot(Ye);
|
|
1654
|
+
return w(
|
|
1651
1655
|
e,
|
|
1652
1656
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1653
1657
|
), e;
|
|
1654
1658
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const { id: n } =
|
|
1657
|
-
collapse:
|
|
1658
|
-
expand:
|
|
1659
|
+
function Dt(e, t) {
|
|
1660
|
+
const { id: n } = ge(), o = k({
|
|
1661
|
+
collapse: ue,
|
|
1662
|
+
expand: ue,
|
|
1659
1663
|
getSize: () => ({
|
|
1660
1664
|
asPercentage: 0,
|
|
1661
1665
|
inPixels: 0
|
|
1662
1666
|
}),
|
|
1663
1667
|
isCollapsed: () => !1,
|
|
1664
|
-
resize:
|
|
1668
|
+
resize: ue
|
|
1665
1669
|
});
|
|
1666
|
-
|
|
1670
|
+
Te(t, () => o.current, []), F(() => {
|
|
1667
1671
|
Object.assign(
|
|
1668
1672
|
o.current,
|
|
1669
|
-
|
|
1673
|
+
He({ groupId: n, panelId: e })
|
|
1670
1674
|
);
|
|
1671
1675
|
});
|
|
1672
1676
|
}
|
|
1673
|
-
function
|
|
1677
|
+
function Ot({
|
|
1674
1678
|
children: e,
|
|
1675
1679
|
className: t,
|
|
1676
1680
|
collapsedSize: n = "0%",
|
|
@@ -1685,7 +1689,7 @@ function It({
|
|
|
1685
1689
|
style: m,
|
|
1686
1690
|
...g
|
|
1687
1691
|
}) {
|
|
1688
|
-
const h = !!l, f =
|
|
1692
|
+
const h = !!l, f = he(l), p = k(null), d = me(p, s), [, y] = qe(), { getPanelStyles: v, id: x, registerPanel: S } = ge(), C = u !== null, L = X(
|
|
1689
1693
|
(I, $, z) => {
|
|
1690
1694
|
u?.(I, l, z);
|
|
1691
1695
|
}
|
|
@@ -1723,7 +1727,7 @@ function It({
|
|
|
1723
1727
|
a,
|
|
1724
1728
|
L,
|
|
1725
1729
|
S
|
|
1726
|
-
]),
|
|
1730
|
+
]), Dt(f, c);
|
|
1727
1731
|
const P = v(x, f);
|
|
1728
1732
|
return /* @__PURE__ */ q(
|
|
1729
1733
|
"div",
|
|
@@ -1734,7 +1738,7 @@ function It({
|
|
|
1734
1738
|
id: f,
|
|
1735
1739
|
ref: d,
|
|
1736
1740
|
style: {
|
|
1737
|
-
...
|
|
1741
|
+
...Tt,
|
|
1738
1742
|
display: "flex",
|
|
1739
1743
|
flexBasis: 0,
|
|
1740
1744
|
flexShrink: 1,
|
|
@@ -1756,8 +1760,8 @@ function It({
|
|
|
1756
1760
|
}
|
|
1757
1761
|
);
|
|
1758
1762
|
}
|
|
1759
|
-
|
|
1760
|
-
const
|
|
1763
|
+
Ot.displayName = "Panel";
|
|
1764
|
+
const Tt = {
|
|
1761
1765
|
minHeight: 0,
|
|
1762
1766
|
maxHeight: "100%",
|
|
1763
1767
|
height: "auto",
|
|
@@ -1769,13 +1773,13 @@ const Dt = {
|
|
|
1769
1773
|
padding: 0,
|
|
1770
1774
|
margin: 0
|
|
1771
1775
|
};
|
|
1772
|
-
function
|
|
1776
|
+
function Vt() {
|
|
1773
1777
|
return Y(null);
|
|
1774
1778
|
}
|
|
1775
|
-
function
|
|
1779
|
+
function Ut() {
|
|
1776
1780
|
return k(null);
|
|
1777
1781
|
}
|
|
1778
|
-
function
|
|
1782
|
+
function _t({
|
|
1779
1783
|
layout: e,
|
|
1780
1784
|
panelConstraints: t,
|
|
1781
1785
|
panelId: n,
|
|
@@ -1787,7 +1791,7 @@ function Ot({
|
|
|
1787
1791
|
);
|
|
1788
1792
|
if (r) {
|
|
1789
1793
|
const a = r.maxSize, u = s = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
|
|
1790
|
-
s =
|
|
1794
|
+
s = N({
|
|
1791
1795
|
layout: J({
|
|
1792
1796
|
delta: u - l,
|
|
1793
1797
|
initialLayout: e,
|
|
@@ -1797,7 +1801,7 @@ function Ot({
|
|
|
1797
1801
|
trigger: "keyboard"
|
|
1798
1802
|
}),
|
|
1799
1803
|
panelConstraints: t
|
|
1800
|
-
})[n], i =
|
|
1804
|
+
})[n], i = N({
|
|
1801
1805
|
layout: J({
|
|
1802
1806
|
delta: a - l,
|
|
1803
1807
|
initialLayout: e,
|
|
@@ -1816,7 +1820,7 @@ function Ot({
|
|
|
1816
1820
|
valueNow: l
|
|
1817
1821
|
};
|
|
1818
1822
|
}
|
|
1819
|
-
function
|
|
1823
|
+
function At({
|
|
1820
1824
|
children: e,
|
|
1821
1825
|
className: t,
|
|
1822
1826
|
elementRef: n,
|
|
@@ -1824,11 +1828,11 @@ function Tt({
|
|
|
1824
1828
|
style: i,
|
|
1825
1829
|
...s
|
|
1826
1830
|
}) {
|
|
1827
|
-
const l =
|
|
1831
|
+
const l = he(o), [r, a] = Y({}), [u, c] = Y("inactive"), m = k(null), g = me(m, n), {
|
|
1828
1832
|
id: h,
|
|
1829
1833
|
orientation: f,
|
|
1830
1834
|
registerSeparator: p
|
|
1831
|
-
} =
|
|
1835
|
+
} = ge(), d = f === "horizontal" ? "vertical" : "horizontal";
|
|
1832
1836
|
return F(() => {
|
|
1833
1837
|
const y = m.current;
|
|
1834
1838
|
if (y !== null) {
|
|
@@ -1850,11 +1854,11 @@ function Tt({
|
|
|
1850
1854
|
L.forEach(
|
|
1851
1855
|
({ derivedPanelConstraints: P, layout: I, separatorToPanels: $ }, z) => {
|
|
1852
1856
|
if (z.id === h) {
|
|
1853
|
-
const
|
|
1854
|
-
if (
|
|
1855
|
-
const M =
|
|
1857
|
+
const b = $.get(v);
|
|
1858
|
+
if (b) {
|
|
1859
|
+
const M = b[0], H = z.panels.indexOf(M);
|
|
1856
1860
|
a(
|
|
1857
|
-
|
|
1861
|
+
_t({
|
|
1858
1862
|
layout: I,
|
|
1859
1863
|
panelConstraints: P,
|
|
1860
1864
|
panelId: M.id,
|
|
@@ -1897,16 +1901,16 @@ function Tt({
|
|
|
1897
1901
|
}
|
|
1898
1902
|
);
|
|
1899
1903
|
}
|
|
1900
|
-
|
|
1904
|
+
At.displayName = "Separator";
|
|
1901
1905
|
export {
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1906
|
+
Gt as Group,
|
|
1907
|
+
Ot as Panel,
|
|
1908
|
+
At as Separator,
|
|
1909
|
+
at as isCoarsePointer,
|
|
1910
|
+
$t as useDefaultLayout,
|
|
1911
|
+
Ht as useGroupCallbackRef,
|
|
1912
|
+
jt as useGroupRef,
|
|
1913
|
+
Vt as usePanelCallbackRef,
|
|
1914
|
+
Ut as usePanelRef
|
|
1911
1915
|
};
|
|
1912
1916
|
//# sourceMappingURL=react-resizable-panels.js.map
|