react-resizable-panels 4.5.9-alpha.0 → 4.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as Y } from "react/jsx-runtime";
|
|
3
|
+
import { useState as J, useCallback as X, useId as tt, useLayoutEffect as Oe, useEffect as Te, useRef as G, createContext as nt, useImperativeHandle as Ne, useMemo as _e, useSyncExternalStore as Ae, useContext as ot } from "react";
|
|
4
|
+
function x(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function U({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
@@ -50,10 +50,10 @@ function st({
|
|
|
50
50
|
};
|
|
51
51
|
let i, r = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x: s, y: a } = $e(o, l),
|
|
54
|
-
|
|
53
|
+
const { x: s, y: a } = $e(o, l), c = e === "horizontal" ? s : a;
|
|
54
|
+
c < r && (r = c, i = l);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return x(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
59
|
function at() {
|
|
@@ -62,26 +62,26 @@ function at() {
|
|
|
62
62
|
function He(e) {
|
|
63
63
|
const { element: t, orientation: n, panels: o, separators: i } = e, r = fe(
|
|
64
64
|
n,
|
|
65
|
-
Array.from(t.children).filter(Fe).map((
|
|
66
|
-
).map(({ element:
|
|
67
|
-
let s = !1, a,
|
|
68
|
-
for (const
|
|
69
|
-
if (
|
|
65
|
+
Array.from(t.children).filter(Fe).map((u) => ({ element: u }))
|
|
66
|
+
).map(({ element: u }) => u), l = [];
|
|
67
|
+
let s = !1, a, c = [];
|
|
68
|
+
for (const u of r)
|
|
69
|
+
if (u.hasAttribute("data-panel")) {
|
|
70
70
|
const h = o.find(
|
|
71
|
-
(
|
|
71
|
+
(S) => S.element === u
|
|
72
72
|
);
|
|
73
73
|
if (h) {
|
|
74
74
|
if (a) {
|
|
75
|
-
const
|
|
75
|
+
const S = a.element.getBoundingClientRect(), m = u.getBoundingClientRect();
|
|
76
76
|
let f;
|
|
77
77
|
if (s) {
|
|
78
|
-
const d = n === "horizontal" ? new DOMRect(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
const d = n === "horizontal" ? new DOMRect(S.right, S.top, 0, S.height) : new DOMRect(
|
|
79
|
+
S.left,
|
|
80
|
+
S.bottom,
|
|
81
|
+
S.width,
|
|
82
82
|
0
|
|
83
83
|
), p = n === "horizontal" ? new DOMRect(m.left, m.top, 0, m.height) : new DOMRect(m.left, m.top, m.width, 0);
|
|
84
|
-
switch (
|
|
84
|
+
switch (c.length) {
|
|
85
85
|
case 0: {
|
|
86
86
|
f = [
|
|
87
87
|
d,
|
|
@@ -90,34 +90,34 @@ function He(e) {
|
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case 1: {
|
|
93
|
-
const g =
|
|
93
|
+
const g = c[0], v = st({
|
|
94
94
|
orientation: n,
|
|
95
|
-
rects: [
|
|
95
|
+
rects: [S, m],
|
|
96
96
|
targetRect: g.element.getBoundingClientRect()
|
|
97
97
|
});
|
|
98
98
|
f = [
|
|
99
99
|
g,
|
|
100
|
-
v ===
|
|
100
|
+
v === S ? p : d
|
|
101
101
|
];
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
default: {
|
|
105
|
-
f =
|
|
105
|
+
f = c;
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
} else
|
|
110
|
-
|
|
110
|
+
c.length ? f = c : f = [
|
|
111
111
|
n === "horizontal" ? new DOMRect(
|
|
112
|
-
|
|
112
|
+
S.right,
|
|
113
113
|
m.top,
|
|
114
|
-
m.left -
|
|
114
|
+
m.left - S.right,
|
|
115
115
|
m.height
|
|
116
116
|
) : new DOMRect(
|
|
117
117
|
m.left,
|
|
118
|
-
|
|
118
|
+
S.bottom,
|
|
119
119
|
m.width,
|
|
120
|
-
m.top -
|
|
120
|
+
m.top - S.bottom
|
|
121
121
|
)
|
|
122
122
|
];
|
|
123
123
|
for (const d of f) {
|
|
@@ -143,20 +143,20 @@ function He(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
146
|
+
groupSize: U({ group: e }),
|
|
147
147
|
panels: [a, h],
|
|
148
148
|
separator: "width" in d ? void 0 : d,
|
|
149
149
|
rect: p
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
s = !1, a = h,
|
|
153
|
+
s = !1, a = h, c = [];
|
|
154
154
|
}
|
|
155
|
-
} else if (
|
|
155
|
+
} else if (u.hasAttribute("data-separator")) {
|
|
156
156
|
const h = i.find(
|
|
157
|
-
(
|
|
157
|
+
(S) => S.element === u
|
|
158
158
|
);
|
|
159
|
-
h ?
|
|
159
|
+
h ? c.push(h) : (a = void 0, c = []);
|
|
160
160
|
} else
|
|
161
161
|
s = !0;
|
|
162
162
|
return l;
|
|
@@ -224,7 +224,7 @@ function D(e) {
|
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
226
|
function Se(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
227
|
+
const { panels: t } = e, n = U({ group: e });
|
|
228
228
|
return n === 0 ? t.map((o) => ({
|
|
229
229
|
collapsedSize: 0,
|
|
230
230
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -236,46 +236,46 @@ function Se(e) {
|
|
|
236
236
|
const { element: i, panelConstraints: r } = o;
|
|
237
237
|
let l = 0;
|
|
238
238
|
if (r.collapsedSize !== void 0) {
|
|
239
|
-
const
|
|
239
|
+
const u = re({
|
|
240
240
|
groupSize: n,
|
|
241
241
|
panelElement: i,
|
|
242
242
|
styleProp: r.collapsedSize
|
|
243
243
|
});
|
|
244
|
-
l = D(
|
|
244
|
+
l = D(u / n * 100);
|
|
245
245
|
}
|
|
246
246
|
let s;
|
|
247
247
|
if (r.defaultSize !== void 0) {
|
|
248
|
-
const
|
|
248
|
+
const u = re({
|
|
249
249
|
groupSize: n,
|
|
250
250
|
panelElement: i,
|
|
251
251
|
styleProp: r.defaultSize
|
|
252
252
|
});
|
|
253
|
-
s = D(
|
|
253
|
+
s = D(u / n * 100);
|
|
254
254
|
}
|
|
255
255
|
let a = 0;
|
|
256
256
|
if (r.minSize !== void 0) {
|
|
257
|
-
const
|
|
257
|
+
const u = re({
|
|
258
258
|
groupSize: n,
|
|
259
259
|
panelElement: i,
|
|
260
260
|
styleProp: r.minSize
|
|
261
261
|
});
|
|
262
|
-
a = D(
|
|
262
|
+
a = D(u / n * 100);
|
|
263
263
|
}
|
|
264
|
-
let
|
|
264
|
+
let c = 100;
|
|
265
265
|
if (r.maxSize !== void 0) {
|
|
266
|
-
const
|
|
266
|
+
const u = re({
|
|
267
267
|
groupSize: n,
|
|
268
268
|
panelElement: i,
|
|
269
269
|
styleProp: r.maxSize
|
|
270
270
|
});
|
|
271
|
-
|
|
271
|
+
c = D(u / n * 100);
|
|
272
272
|
}
|
|
273
273
|
return {
|
|
274
274
|
collapsedSize: l,
|
|
275
275
|
collapsible: r.collapsible === !0,
|
|
276
276
|
defaultSize: s,
|
|
277
277
|
minSize: a,
|
|
278
|
-
maxSize:
|
|
278
|
+
maxSize: c,
|
|
279
279
|
panelId: o.id
|
|
280
280
|
};
|
|
281
281
|
});
|
|
@@ -300,8 +300,8 @@ class pt {
|
|
|
300
300
|
const a = l[s];
|
|
301
301
|
try {
|
|
302
302
|
a.call(null, n);
|
|
303
|
-
} catch (
|
|
304
|
-
r === null && (i = !0, r =
|
|
303
|
+
} catch (c) {
|
|
304
|
+
r === null && (i = !0, r = c);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
if (i)
|
|
@@ -329,7 +329,7 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
332
|
+
const T = new pt();
|
|
333
333
|
function E() {
|
|
334
334
|
return I;
|
|
335
335
|
}
|
|
@@ -341,7 +341,7 @@ function M(e) {
|
|
|
341
341
|
return I = {
|
|
342
342
|
...I,
|
|
343
343
|
...t
|
|
344
|
-
}, t.cursorFlags !== void 0 &&
|
|
344
|
+
}, t.cursorFlags !== void 0 && T.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && T.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
|
|
345
345
|
o.derivedPanelConstraints.forEach((r) => {
|
|
346
346
|
if (r.collapsible) {
|
|
347
347
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
@@ -357,7 +357,7 @@ function M(e) {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
}),
|
|
360
|
+
}), T.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
362
|
function mt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
@@ -388,19 +388,19 @@ function ht(e) {
|
|
|
388
388
|
function gt(e, t) {
|
|
389
389
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
390
390
|
const n = {
|
|
391
|
-
a:
|
|
392
|
-
b:
|
|
391
|
+
a: xe(e),
|
|
392
|
+
b: xe(t)
|
|
393
393
|
};
|
|
394
394
|
let o;
|
|
395
395
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
396
396
|
o = n.a.pop(), n.b.pop();
|
|
397
|
-
|
|
397
|
+
x(
|
|
398
398
|
o,
|
|
399
399
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
400
400
|
);
|
|
401
401
|
const i = {
|
|
402
|
-
a:
|
|
403
|
-
b:
|
|
402
|
+
a: ze(ve(n.a)),
|
|
403
|
+
b: ze(ve(n.b))
|
|
404
404
|
};
|
|
405
405
|
if (i.a === i.b) {
|
|
406
406
|
const r = o.childNodes, l = {
|
|
@@ -429,14 +429,14 @@ function ve(e) {
|
|
|
429
429
|
let t = e.length;
|
|
430
430
|
for (; t--; ) {
|
|
431
431
|
const n = e[t];
|
|
432
|
-
if (
|
|
432
|
+
if (x(n, "Missing node"), vt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function ze(e) {
|
|
437
437
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function xe(e) {
|
|
440
440
|
const t = [];
|
|
441
441
|
for (; e; )
|
|
442
442
|
t.push(e), e = je(e);
|
|
@@ -446,10 +446,10 @@ function je(e) {
|
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
447
|
return ht(t) ? t.host : t;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function zt(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 xt({
|
|
453
453
|
groupElement: e,
|
|
454
454
|
hitRegion: t,
|
|
455
455
|
pointerEventTarget: n
|
|
@@ -461,7 +461,7 @@ function zt({
|
|
|
461
461
|
for (; o; ) {
|
|
462
462
|
if (o.contains(e))
|
|
463
463
|
return !0;
|
|
464
|
-
if (
|
|
464
|
+
if (zt(o.getBoundingClientRect(), t))
|
|
465
465
|
return !1;
|
|
466
466
|
o = o.parentElement;
|
|
467
467
|
}
|
|
@@ -477,7 +477,7 @@ function de(e, t) {
|
|
|
477
477
|
x: e.clientX,
|
|
478
478
|
y: e.clientY
|
|
479
479
|
});
|
|
480
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 &&
|
|
480
|
+
l && l.distance.x <= 0 && l.distance.y <= 0 && xt({
|
|
481
481
|
groupElement: i.element,
|
|
482
482
|
hitRegion: l.hitRegion.rect,
|
|
483
483
|
pointerEventTarget: e.target
|
|
@@ -492,10 +492,10 @@ function bt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function O(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function W({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -505,10 +505,10 @@ function V({
|
|
|
505
505
|
maxSize: i = 100,
|
|
506
506
|
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (O(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
510
|
const l = (n + r) / 2;
|
|
511
|
-
|
|
511
|
+
O(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
513
|
t = r;
|
|
514
514
|
return t = Math.min(i, t), t = D(t), t;
|
|
@@ -523,14 +523,14 @@ function Z({
|
|
|
523
523
|
}) {
|
|
524
524
|
if (R(e, 0))
|
|
525
525
|
return t;
|
|
526
|
-
const l = Object.values(t), s = Object.values(i), a = [...l], [
|
|
527
|
-
|
|
526
|
+
const l = Object.values(t), s = Object.values(i), a = [...l], [c, u] = o;
|
|
527
|
+
x(c != null, "Invalid first pivot index"), x(u != null, "Invalid second pivot index");
|
|
528
528
|
let h = 0;
|
|
529
529
|
switch (r) {
|
|
530
530
|
case "keyboard": {
|
|
531
531
|
{
|
|
532
|
-
const f = e < 0 ?
|
|
533
|
-
|
|
532
|
+
const f = e < 0 ? u : c, d = n[f];
|
|
533
|
+
x(
|
|
534
534
|
d,
|
|
535
535
|
`Panel constraints not found for index ${f}`
|
|
536
536
|
);
|
|
@@ -540,19 +540,19 @@ function Z({
|
|
|
540
540
|
minSize: v = 0
|
|
541
541
|
} = d;
|
|
542
542
|
if (g) {
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
|
|
543
|
+
const z = l[f];
|
|
544
|
+
if (x(
|
|
545
|
+
z != null,
|
|
546
546
|
`Previous layout not found for panel index ${f}`
|
|
547
|
-
), R(
|
|
548
|
-
const
|
|
549
|
-
|
|
547
|
+
), R(z, p)) {
|
|
548
|
+
const y = v - z;
|
|
549
|
+
O(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
{
|
|
554
|
-
const f = e < 0 ?
|
|
555
|
-
|
|
554
|
+
const f = e < 0 ? c : u, d = n[f];
|
|
555
|
+
x(
|
|
556
556
|
d,
|
|
557
557
|
`No panel constraints found for index ${f}`
|
|
558
558
|
);
|
|
@@ -562,51 +562,68 @@ function Z({
|
|
|
562
562
|
minSize: v = 0
|
|
563
563
|
} = d;
|
|
564
564
|
if (g) {
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
567
|
-
|
|
565
|
+
const z = l[f];
|
|
566
|
+
if (x(
|
|
567
|
+
z != null,
|
|
568
568
|
`Previous layout not found for panel index ${f}`
|
|
569
|
-
), R(
|
|
570
|
-
const
|
|
571
|
-
|
|
569
|
+
), R(z, v)) {
|
|
570
|
+
const y = z - p;
|
|
571
|
+
O(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
+
default: {
|
|
578
|
+
const f = e < 0 ? u : c, d = n[f];
|
|
579
|
+
x(
|
|
580
|
+
d,
|
|
581
|
+
`Panel constraints not found for index ${f}`
|
|
582
|
+
);
|
|
583
|
+
const p = l[f], { collapsible: g, collapsedSize: v, minSize: z } = d;
|
|
584
|
+
if (g && O(p, z) < 0)
|
|
585
|
+
if (e > 0) {
|
|
586
|
+
const y = z - v, b = y / 2, C = p + e;
|
|
587
|
+
O(C, z) < 0 && (e = O(e, b) <= 0 ? 0 : y);
|
|
588
|
+
} else {
|
|
589
|
+
const y = z - v, b = 100 - y / 2, C = p - e;
|
|
590
|
+
O(C, z) < 0 && (e = O(100 + e, b) > 0 ? 0 : -y);
|
|
591
|
+
}
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
577
594
|
}
|
|
578
595
|
{
|
|
579
596
|
const f = e < 0 ? 1 : -1;
|
|
580
|
-
let d = e < 0 ?
|
|
597
|
+
let d = e < 0 ? u : c, p = 0;
|
|
581
598
|
for (; ; ) {
|
|
582
599
|
const v = l[d];
|
|
583
|
-
|
|
600
|
+
x(
|
|
584
601
|
v != null,
|
|
585
602
|
`Previous layout not found for panel index ${d}`
|
|
586
603
|
);
|
|
587
|
-
const
|
|
604
|
+
const y = W({
|
|
588
605
|
panelConstraints: n[d],
|
|
589
606
|
size: 100
|
|
590
607
|
}) - v;
|
|
591
|
-
if (p +=
|
|
608
|
+
if (p += y, d += f, d < 0 || d >= n.length)
|
|
592
609
|
break;
|
|
593
610
|
}
|
|
594
611
|
const g = Math.min(Math.abs(e), Math.abs(p));
|
|
595
612
|
e = e < 0 ? 0 - g : g;
|
|
596
613
|
}
|
|
597
614
|
{
|
|
598
|
-
let d = e < 0 ?
|
|
615
|
+
let d = e < 0 ? c : u;
|
|
599
616
|
for (; d >= 0 && d < n.length; ) {
|
|
600
617
|
const p = Math.abs(e) - Math.abs(h), g = l[d];
|
|
601
|
-
|
|
618
|
+
x(
|
|
602
619
|
g != null,
|
|
603
620
|
`Previous layout not found for panel index ${d}`
|
|
604
621
|
);
|
|
605
|
-
const v = g - p,
|
|
622
|
+
const v = g - p, z = W({
|
|
606
623
|
panelConstraints: n[d],
|
|
607
624
|
size: v
|
|
608
625
|
});
|
|
609
|
-
if (!R(g,
|
|
626
|
+
if (!R(g, z) && (h += g - z, a[d] = z, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
610
627
|
numeric: !0
|
|
611
628
|
}) >= 0))
|
|
612
629
|
break;
|
|
@@ -616,38 +633,38 @@ function Z({
|
|
|
616
633
|
if (bt(s, a))
|
|
617
634
|
return i;
|
|
618
635
|
{
|
|
619
|
-
const f = e < 0 ?
|
|
620
|
-
|
|
636
|
+
const f = e < 0 ? u : c, d = l[f];
|
|
637
|
+
x(
|
|
621
638
|
d != null,
|
|
622
639
|
`Previous layout not found for panel index ${f}`
|
|
623
640
|
);
|
|
624
|
-
const p = d + h, g =
|
|
641
|
+
const p = d + h, g = W({
|
|
625
642
|
panelConstraints: n[f],
|
|
626
643
|
size: p
|
|
627
644
|
});
|
|
628
645
|
if (a[f] = g, !R(g, p)) {
|
|
629
|
-
let v = p - g,
|
|
630
|
-
for (;
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
`Previous layout not found for panel index ${
|
|
646
|
+
let v = p - g, y = e < 0 ? u : c;
|
|
647
|
+
for (; y >= 0 && y < n.length; ) {
|
|
648
|
+
const b = a[y];
|
|
649
|
+
x(
|
|
650
|
+
b != null,
|
|
651
|
+
`Previous layout not found for panel index ${y}`
|
|
635
652
|
);
|
|
636
|
-
const
|
|
637
|
-
panelConstraints: n[
|
|
638
|
-
size:
|
|
653
|
+
const C = b + v, w = W({
|
|
654
|
+
panelConstraints: n[y],
|
|
655
|
+
size: C
|
|
639
656
|
});
|
|
640
|
-
if (R(
|
|
657
|
+
if (R(b, w) || (v -= w - b, a[y] = w), R(v, 0))
|
|
641
658
|
break;
|
|
642
|
-
e > 0 ?
|
|
659
|
+
e > 0 ? y-- : y++;
|
|
643
660
|
}
|
|
644
661
|
}
|
|
645
662
|
}
|
|
646
|
-
const
|
|
663
|
+
const S = Object.values(a).reduce(
|
|
647
664
|
(f, d) => d + f,
|
|
648
665
|
0
|
|
649
666
|
);
|
|
650
|
-
if (!R(
|
|
667
|
+
if (!R(S, 100, 0.1))
|
|
651
668
|
return i;
|
|
652
669
|
const m = Object.keys(i);
|
|
653
670
|
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
@@ -656,11 +673,11 @@ function A(e, t) {
|
|
|
656
673
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
657
674
|
return !1;
|
|
658
675
|
for (const n in e)
|
|
659
|
-
if (t[n] === void 0 ||
|
|
676
|
+
if (t[n] === void 0 || O(e[n], t[n]) !== 0)
|
|
660
677
|
return !1;
|
|
661
678
|
return !0;
|
|
662
679
|
}
|
|
663
|
-
function
|
|
680
|
+
function F({
|
|
664
681
|
layout: e,
|
|
665
682
|
panelConstraints: t
|
|
666
683
|
}) {
|
|
@@ -675,33 +692,33 @@ function _({
|
|
|
675
692
|
if (!R(i, 100) && o.length > 0)
|
|
676
693
|
for (let s = 0; s < t.length; s++) {
|
|
677
694
|
const a = o[s];
|
|
678
|
-
|
|
679
|
-
const
|
|
680
|
-
o[s] =
|
|
695
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
696
|
+
const c = 100 / i * a;
|
|
697
|
+
o[s] = c;
|
|
681
698
|
}
|
|
682
699
|
let r = 0;
|
|
683
700
|
for (let s = 0; s < t.length; s++) {
|
|
684
701
|
const a = o[s];
|
|
685
|
-
|
|
686
|
-
const
|
|
702
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
703
|
+
const c = W({
|
|
687
704
|
panelConstraints: t[s],
|
|
688
705
|
size: a
|
|
689
706
|
});
|
|
690
|
-
a !=
|
|
707
|
+
a != c && (r += a - c, o[s] = c);
|
|
691
708
|
}
|
|
692
709
|
if (!R(r, 0))
|
|
693
710
|
for (let s = 0; s < t.length; s++) {
|
|
694
711
|
const a = o[s];
|
|
695
|
-
|
|
696
|
-
const
|
|
712
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
713
|
+
const c = a + r, u = W({
|
|
697
714
|
panelConstraints: t[s],
|
|
698
|
-
size:
|
|
715
|
+
size: c
|
|
699
716
|
});
|
|
700
|
-
if (a !==
|
|
717
|
+
if (a !== u && (r -= u - a, o[s] = u, R(r, 0)))
|
|
701
718
|
break;
|
|
702
719
|
}
|
|
703
720
|
const l = Object.keys(e);
|
|
704
|
-
return o.reduce((s, a,
|
|
721
|
+
return o.reduce((s, a, c) => (s[l[c]] = a, s), {});
|
|
705
722
|
}
|
|
706
723
|
function Ve({
|
|
707
724
|
groupId: e,
|
|
@@ -712,19 +729,19 @@ function Ve({
|
|
|
712
729
|
for (const [
|
|
713
730
|
a,
|
|
714
731
|
{
|
|
715
|
-
defaultLayoutDeferred:
|
|
716
|
-
derivedPanelConstraints:
|
|
732
|
+
defaultLayoutDeferred: c,
|
|
733
|
+
derivedPanelConstraints: u,
|
|
717
734
|
layout: h,
|
|
718
|
-
separatorToPanels:
|
|
735
|
+
separatorToPanels: S
|
|
719
736
|
}
|
|
720
737
|
] of s)
|
|
721
738
|
if (a.id === e)
|
|
722
739
|
return {
|
|
723
|
-
defaultLayoutDeferred:
|
|
724
|
-
derivedPanelConstraints:
|
|
740
|
+
defaultLayoutDeferred: c,
|
|
741
|
+
derivedPanelConstraints: u,
|
|
725
742
|
group: a,
|
|
726
743
|
layout: h,
|
|
727
|
-
separatorToPanels:
|
|
744
|
+
separatorToPanels: S
|
|
728
745
|
};
|
|
729
746
|
throw Error(`Group ${e} not found`);
|
|
730
747
|
}, o = () => {
|
|
@@ -749,26 +766,26 @@ function Ve({
|
|
|
749
766
|
if (s === a)
|
|
750
767
|
return;
|
|
751
768
|
const {
|
|
752
|
-
defaultLayoutDeferred:
|
|
753
|
-
derivedPanelConstraints:
|
|
769
|
+
defaultLayoutDeferred: c,
|
|
770
|
+
derivedPanelConstraints: u,
|
|
754
771
|
group: h,
|
|
755
|
-
layout:
|
|
772
|
+
layout: S,
|
|
756
773
|
separatorToPanels: m
|
|
757
774
|
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p = Z({
|
|
758
775
|
delta: d ? a - s : s - a,
|
|
759
|
-
initialLayout:
|
|
760
|
-
panelConstraints:
|
|
776
|
+
initialLayout: S,
|
|
777
|
+
panelConstraints: u,
|
|
761
778
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
762
|
-
prevLayout:
|
|
779
|
+
prevLayout: S,
|
|
763
780
|
trigger: "imperative-api"
|
|
764
|
-
}), g =
|
|
781
|
+
}), g = F({
|
|
765
782
|
layout: p,
|
|
766
|
-
panelConstraints:
|
|
783
|
+
panelConstraints: u
|
|
767
784
|
});
|
|
768
|
-
A(
|
|
785
|
+
A(S, g) || M((v) => ({
|
|
769
786
|
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
770
|
-
defaultLayoutDeferred:
|
|
771
|
-
derivedPanelConstraints:
|
|
787
|
+
defaultLayoutDeferred: c,
|
|
788
|
+
derivedPanelConstraints: u,
|
|
772
789
|
layout: g,
|
|
773
790
|
separatorToPanels: m
|
|
774
791
|
})
|
|
@@ -776,42 +793,42 @@ function Ve({
|
|
|
776
793
|
};
|
|
777
794
|
return {
|
|
778
795
|
collapse: () => {
|
|
779
|
-
const { collapsible: s, collapsedSize: a } = o(), { mutableValues:
|
|
780
|
-
s &&
|
|
796
|
+
const { collapsible: s, collapsedSize: a } = o(), { mutableValues: c } = i(), u = r();
|
|
797
|
+
s && u !== a && (c.expandToSize = u, l(a));
|
|
781
798
|
},
|
|
782
799
|
expand: () => {
|
|
783
|
-
const { collapsible: s, collapsedSize: a, minSize:
|
|
800
|
+
const { collapsible: s, collapsedSize: a, minSize: c } = o(), { mutableValues: u } = i(), h = r();
|
|
784
801
|
if (s && h === a) {
|
|
785
|
-
let
|
|
786
|
-
|
|
802
|
+
let S = u.expandToSize ?? c;
|
|
803
|
+
S === 0 && (S = 1), l(S);
|
|
787
804
|
}
|
|
788
805
|
},
|
|
789
806
|
getSize: () => {
|
|
790
|
-
const { group: s } = n(), a = r(), { element:
|
|
807
|
+
const { group: s } = n(), a = r(), { element: c } = i(), u = s.orientation === "horizontal" ? c.offsetWidth : c.offsetHeight;
|
|
791
808
|
return {
|
|
792
809
|
asPercentage: a,
|
|
793
|
-
inPixels:
|
|
810
|
+
inPixels: u
|
|
794
811
|
};
|
|
795
812
|
},
|
|
796
813
|
isCollapsed: () => {
|
|
797
|
-
const { collapsible: s, collapsedSize: a } = o(),
|
|
798
|
-
return s && R(a,
|
|
814
|
+
const { collapsible: s, collapsedSize: a } = o(), c = r();
|
|
815
|
+
return s && R(a, c);
|
|
799
816
|
},
|
|
800
817
|
resize: (s) => {
|
|
801
818
|
if (r() !== s) {
|
|
802
|
-
let
|
|
819
|
+
let c;
|
|
803
820
|
switch (typeof s) {
|
|
804
821
|
case "number": {
|
|
805
|
-
const { group:
|
|
806
|
-
|
|
822
|
+
const { group: u } = n(), h = U({ group: u });
|
|
823
|
+
c = D(s / h * 100);
|
|
807
824
|
break;
|
|
808
825
|
}
|
|
809
826
|
case "string": {
|
|
810
|
-
|
|
827
|
+
c = parseFloat(s);
|
|
811
828
|
break;
|
|
812
829
|
}
|
|
813
830
|
}
|
|
814
|
-
l(
|
|
831
|
+
l(c);
|
|
815
832
|
}
|
|
816
833
|
}
|
|
817
834
|
};
|
|
@@ -866,48 +883,55 @@ function We({
|
|
|
866
883
|
group: r,
|
|
867
884
|
layout: l,
|
|
868
885
|
separatorToPanels: s
|
|
869
|
-
} = t(), a =
|
|
886
|
+
} = t(), a = F({
|
|
870
887
|
layout: n,
|
|
871
888
|
panelConstraints: i
|
|
872
889
|
});
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
890
|
+
if (o)
|
|
891
|
+
return l;
|
|
892
|
+
if (!A(l, a)) {
|
|
893
|
+
M((u) => ({
|
|
894
|
+
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
895
|
+
defaultLayoutDeferred: o,
|
|
896
|
+
derivedPanelConstraints: i,
|
|
897
|
+
layout: a,
|
|
898
|
+
separatorToPanels: s
|
|
899
|
+
})
|
|
900
|
+
}));
|
|
901
|
+
const c = r.panels.map(({ id: u }) => u).join(",");
|
|
902
|
+
r.inMemoryLayouts[c] = a;
|
|
903
|
+
}
|
|
904
|
+
return a;
|
|
881
905
|
}
|
|
882
906
|
};
|
|
883
907
|
}
|
|
884
908
|
function Ue(e) {
|
|
885
909
|
const { mountedGroups: t } = E(), n = t.get(e);
|
|
886
|
-
return
|
|
910
|
+
return x(n, `Mounted Group ${e.id} not found`), n;
|
|
887
911
|
}
|
|
888
|
-
function
|
|
912
|
+
function _(e, t) {
|
|
889
913
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
890
914
|
(h) => h.element === e
|
|
891
915
|
);
|
|
892
|
-
|
|
916
|
+
x(i, "Matching separator not found");
|
|
893
917
|
const r = o.separatorToPanels.get(i);
|
|
894
|
-
|
|
895
|
-
const l = r.map((h) => n.panels.indexOf(h)), a = We({ groupId: n.id }).getLayout(),
|
|
918
|
+
x(r, "Matching panels not found");
|
|
919
|
+
const l = r.map((h) => n.panels.indexOf(h)), a = We({ groupId: n.id }).getLayout(), c = Z({
|
|
896
920
|
delta: t,
|
|
897
921
|
initialLayout: a,
|
|
898
922
|
panelConstraints: o.derivedPanelConstraints,
|
|
899
923
|
pivotIndices: l,
|
|
900
924
|
prevLayout: a,
|
|
901
925
|
trigger: "keyboard"
|
|
902
|
-
}),
|
|
903
|
-
layout:
|
|
926
|
+
}), u = F({
|
|
927
|
+
layout: c,
|
|
904
928
|
panelConstraints: o.derivedPanelConstraints
|
|
905
929
|
});
|
|
906
|
-
A(a,
|
|
930
|
+
A(a, u) || M((h) => ({
|
|
907
931
|
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
908
932
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
909
933
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
910
|
-
layout:
|
|
934
|
+
layout: u,
|
|
911
935
|
separatorToPanels: o.separatorToPanels
|
|
912
936
|
})
|
|
913
937
|
}));
|
|
@@ -919,23 +943,23 @@ function we(e) {
|
|
|
919
943
|
if (!n.disabled)
|
|
920
944
|
switch (e.key) {
|
|
921
945
|
case "ArrowDown": {
|
|
922
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
946
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, 5);
|
|
923
947
|
break;
|
|
924
948
|
}
|
|
925
949
|
case "ArrowLeft": {
|
|
926
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
950
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
|
|
927
951
|
break;
|
|
928
952
|
}
|
|
929
953
|
case "ArrowRight": {
|
|
930
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
954
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
|
|
931
955
|
break;
|
|
932
956
|
}
|
|
933
957
|
case "ArrowUp": {
|
|
934
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
958
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, -5);
|
|
935
959
|
break;
|
|
936
960
|
}
|
|
937
961
|
case "End": {
|
|
938
|
-
e.preventDefault(),
|
|
962
|
+
e.preventDefault(), _(t, 100);
|
|
939
963
|
break;
|
|
940
964
|
}
|
|
941
965
|
case "Enter": {
|
|
@@ -943,15 +967,15 @@ function we(e) {
|
|
|
943
967
|
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
944
968
|
(h) => h.element === t
|
|
945
969
|
);
|
|
946
|
-
|
|
970
|
+
x(s, "Matching separator not found");
|
|
947
971
|
const a = l.get(s);
|
|
948
|
-
|
|
949
|
-
const
|
|
950
|
-
(h) => h.panelId ===
|
|
972
|
+
x(a, "Matching panels not found");
|
|
973
|
+
const c = a[0], u = i.find(
|
|
974
|
+
(h) => h.panelId === c.id
|
|
951
975
|
);
|
|
952
|
-
if (
|
|
953
|
-
const h = r[
|
|
954
|
-
|
|
976
|
+
if (x(u, "Panel metadata not found"), u.collapsible) {
|
|
977
|
+
const h = r[c.id], S = u.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[c.id] ?? u.minSize : u.collapsedSize;
|
|
978
|
+
_(t, S - h);
|
|
955
979
|
}
|
|
956
980
|
break;
|
|
957
981
|
}
|
|
@@ -962,13 +986,13 @@ function we(e) {
|
|
|
962
986
|
), r = Array.from(i).findIndex(
|
|
963
987
|
(a) => a === e.currentTarget
|
|
964
988
|
);
|
|
965
|
-
|
|
989
|
+
x(r !== null, "Index not found");
|
|
966
990
|
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
967
991
|
i[l].focus();
|
|
968
992
|
break;
|
|
969
993
|
}
|
|
970
994
|
case "Home": {
|
|
971
|
-
e.preventDefault(),
|
|
995
|
+
e.preventDefault(), _(t, -100);
|
|
972
996
|
break;
|
|
973
997
|
}
|
|
974
998
|
}
|
|
@@ -1083,26 +1107,26 @@ function Ye({
|
|
|
1083
1107
|
}) {
|
|
1084
1108
|
let s = 0;
|
|
1085
1109
|
const a = new Map(i);
|
|
1086
|
-
n.forEach((
|
|
1087
|
-
const { group: h, groupSize:
|
|
1110
|
+
n.forEach((u) => {
|
|
1111
|
+
const { group: h, groupSize: S } = u, { disableCursor: m, orientation: f, panels: d } = h;
|
|
1088
1112
|
let p = 0;
|
|
1089
|
-
r ? f === "horizontal" ? p = (t.clientX - r.x) /
|
|
1113
|
+
r ? f === "horizontal" ? p = (t.clientX - r.x) / S * 100 : p = (t.clientY - r.y) / S * 100 : f === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
1090
1114
|
const g = o.get(h), {
|
|
1091
1115
|
defaultLayoutDeferred: v,
|
|
1092
|
-
derivedPanelConstraints:
|
|
1093
|
-
layout:
|
|
1094
|
-
separatorToPanels:
|
|
1116
|
+
derivedPanelConstraints: z,
|
|
1117
|
+
layout: y,
|
|
1118
|
+
separatorToPanels: b
|
|
1095
1119
|
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1096
|
-
if (
|
|
1097
|
-
const
|
|
1120
|
+
if (z && g && y && b) {
|
|
1121
|
+
const C = Z({
|
|
1098
1122
|
delta: p,
|
|
1099
1123
|
initialLayout: g,
|
|
1100
|
-
panelConstraints:
|
|
1101
|
-
pivotIndices:
|
|
1102
|
-
prevLayout:
|
|
1124
|
+
panelConstraints: z,
|
|
1125
|
+
pivotIndices: u.panels.map((w) => d.indexOf(w)),
|
|
1126
|
+
prevLayout: y,
|
|
1103
1127
|
trigger: "mouse-or-touch"
|
|
1104
1128
|
});
|
|
1105
|
-
if (A(
|
|
1129
|
+
if (A(C, y)) {
|
|
1106
1130
|
if (p !== 0 && !m)
|
|
1107
1131
|
switch (f) {
|
|
1108
1132
|
case "horizontal": {
|
|
@@ -1115,20 +1139,20 @@ function Ye({
|
|
|
1115
1139
|
}
|
|
1116
1140
|
}
|
|
1117
1141
|
} else {
|
|
1118
|
-
a.set(
|
|
1142
|
+
a.set(u.group, {
|
|
1119
1143
|
defaultLayoutDeferred: v,
|
|
1120
|
-
derivedPanelConstraints:
|
|
1121
|
-
layout:
|
|
1122
|
-
separatorToPanels:
|
|
1144
|
+
derivedPanelConstraints: z,
|
|
1145
|
+
layout: C,
|
|
1146
|
+
separatorToPanels: b
|
|
1123
1147
|
});
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1148
|
+
const w = u.group.panels.map(({ id: H }) => H).join(",");
|
|
1149
|
+
u.group.inMemoryLayouts[w] = C;
|
|
1126
1150
|
}
|
|
1127
1151
|
}
|
|
1128
1152
|
});
|
|
1129
|
-
let
|
|
1130
|
-
t.movementX === 0 ?
|
|
1131
|
-
cursorFlags:
|
|
1153
|
+
let c = 0;
|
|
1154
|
+
t.movementX === 0 ? c |= l & Ce : c |= s & Ce, t.movementY === 0 ? c |= l & Pe : c |= s & Pe, M({
|
|
1155
|
+
cursorFlags: c,
|
|
1132
1156
|
mountedGroups: a
|
|
1133
1157
|
}), pe(e);
|
|
1134
1158
|
}
|
|
@@ -1146,7 +1170,7 @@ function Ee(e) {
|
|
|
1146
1170
|
});
|
|
1147
1171
|
}
|
|
1148
1172
|
}
|
|
1149
|
-
function
|
|
1173
|
+
function ke(e) {
|
|
1150
1174
|
if (e.defaultPrevented)
|
|
1151
1175
|
return;
|
|
1152
1176
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
@@ -1193,7 +1217,7 @@ function Ge(e) {
|
|
|
1193
1217
|
}
|
|
1194
1218
|
}
|
|
1195
1219
|
}
|
|
1196
|
-
function
|
|
1220
|
+
function Ge(e) {
|
|
1197
1221
|
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1198
1222
|
const { interactionState: t } = E();
|
|
1199
1223
|
switch (t.state) {
|
|
@@ -1245,10 +1269,10 @@ function De(e) {
|
|
|
1245
1269
|
function Ct(e, t, n) {
|
|
1246
1270
|
if (!n[0])
|
|
1247
1271
|
return;
|
|
1248
|
-
const i = e.panels.find((
|
|
1272
|
+
const i = e.panels.find((c) => c.element === t);
|
|
1249
1273
|
if (!i || !i.onResize)
|
|
1250
1274
|
return;
|
|
1251
|
-
const r =
|
|
1275
|
+
const r = U({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1252
1276
|
asPercentage: D(l / r * 100),
|
|
1253
1277
|
inPixels: l
|
|
1254
1278
|
};
|
|
@@ -1271,10 +1295,10 @@ function Rt(e, t) {
|
|
|
1271
1295
|
return !1;
|
|
1272
1296
|
return !0;
|
|
1273
1297
|
}
|
|
1274
|
-
const
|
|
1298
|
+
const V = /* @__PURE__ */ new Map();
|
|
1275
1299
|
function Mt(e) {
|
|
1276
1300
|
let t = !0;
|
|
1277
|
-
|
|
1301
|
+
x(
|
|
1278
1302
|
e.element.ownerDocument.defaultView,
|
|
1279
1303
|
"Cannot register an unmounted Group"
|
|
1280
1304
|
);
|
|
@@ -1283,28 +1307,28 @@ function Mt(e) {
|
|
|
1283
1307
|
const { borderBoxSize: p, target: g } = d;
|
|
1284
1308
|
if (g === e.element) {
|
|
1285
1309
|
if (t) {
|
|
1286
|
-
if (
|
|
1310
|
+
if (U({ group: e }) === 0)
|
|
1287
1311
|
return;
|
|
1288
|
-
M((
|
|
1289
|
-
const
|
|
1290
|
-
if (
|
|
1291
|
-
const
|
|
1292
|
-
layout:
|
|
1293
|
-
panelConstraints:
|
|
1312
|
+
M((z) => {
|
|
1313
|
+
const y = z.mountedGroups.get(e);
|
|
1314
|
+
if (y) {
|
|
1315
|
+
const b = Se(e), C = y.defaultLayoutDeferred ? De(b) : y.layout, w = F({
|
|
1316
|
+
layout: C,
|
|
1317
|
+
panelConstraints: b
|
|
1294
1318
|
});
|
|
1295
|
-
return !
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
) ?
|
|
1299
|
-
mountedGroups: new Map(
|
|
1319
|
+
return !y.defaultLayoutDeferred && A(C, w) && Pt(
|
|
1320
|
+
y.derivedPanelConstraints,
|
|
1321
|
+
b
|
|
1322
|
+
) ? z : {
|
|
1323
|
+
mountedGroups: new Map(z.mountedGroups).set(e, {
|
|
1300
1324
|
defaultLayoutDeferred: !1,
|
|
1301
|
-
derivedPanelConstraints:
|
|
1302
|
-
layout:
|
|
1303
|
-
separatorToPanels:
|
|
1325
|
+
derivedPanelConstraints: b,
|
|
1326
|
+
layout: w,
|
|
1327
|
+
separatorToPanels: y.separatorToPanels
|
|
1304
1328
|
})
|
|
1305
1329
|
};
|
|
1306
1330
|
}
|
|
1307
|
-
return
|
|
1331
|
+
return z;
|
|
1308
1332
|
});
|
|
1309
1333
|
}
|
|
1310
1334
|
} else
|
|
@@ -1312,24 +1336,24 @@ function Mt(e) {
|
|
|
1312
1336
|
}
|
|
1313
1337
|
});
|
|
1314
1338
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
1315
|
-
|
|
1339
|
+
x(
|
|
1316
1340
|
!o.has(f.id),
|
|
1317
1341
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1318
1342
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1319
1343
|
});
|
|
1320
|
-
const l =
|
|
1321
|
-
let
|
|
1322
|
-
|
|
1323
|
-
const
|
|
1324
|
-
layout:
|
|
1344
|
+
const l = U({ group: e }), s = Se(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1345
|
+
let c = e.defaultLayout;
|
|
1346
|
+
c && (Rt(e.panels, c) || (c = void 0));
|
|
1347
|
+
const u = e.inMemoryLayouts[a] ?? c ?? De(s), h = F({
|
|
1348
|
+
layout: u,
|
|
1325
1349
|
panelConstraints: s
|
|
1326
|
-
}),
|
|
1350
|
+
}), S = He(e), m = e.element.ownerDocument;
|
|
1327
1351
|
return M((f) => {
|
|
1328
1352
|
const d = /* @__PURE__ */ new Map();
|
|
1329
|
-
return
|
|
1353
|
+
return V.set(
|
|
1330
1354
|
m,
|
|
1331
|
-
(
|
|
1332
|
-
),
|
|
1355
|
+
(V.get(m) ?? 0) + 1
|
|
1356
|
+
), S.forEach((p) => {
|
|
1333
1357
|
p.separator && d.set(p.separator, p.panels);
|
|
1334
1358
|
}), {
|
|
1335
1359
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
@@ -1340,20 +1364,20 @@ function Mt(e) {
|
|
|
1340
1364
|
})
|
|
1341
1365
|
};
|
|
1342
1366
|
}), e.separators.forEach((f) => {
|
|
1343
|
-
|
|
1367
|
+
x(
|
|
1344
1368
|
!i.has(f.id),
|
|
1345
1369
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1346
1370
|
), i.add(f.id), f.element.addEventListener("keydown", we);
|
|
1347
|
-
}),
|
|
1348
|
-
t = !1,
|
|
1371
|
+
}), V.get(m) === 1 && (m.addEventListener("dblclick", be, !0), m.addEventListener("pointerdown", Le, !0), m.addEventListener("pointerleave", Ee), m.addEventListener("pointermove", ke), m.addEventListener("pointerout", Ge), m.addEventListener("pointerup", Ie, !0)), function() {
|
|
1372
|
+
t = !1, V.set(
|
|
1349
1373
|
m,
|
|
1350
|
-
Math.max(0, (
|
|
1374
|
+
Math.max(0, (V.get(m) ?? 0) - 1)
|
|
1351
1375
|
), M((d) => {
|
|
1352
1376
|
const p = new Map(d.mountedGroups);
|
|
1353
1377
|
return p.delete(e), { mountedGroups: p };
|
|
1354
1378
|
}), e.separators.forEach((d) => {
|
|
1355
1379
|
d.element.removeEventListener("keydown", we);
|
|
1356
|
-
}),
|
|
1380
|
+
}), V.get(m) || (m.removeEventListener(
|
|
1357
1381
|
"dblclick",
|
|
1358
1382
|
be,
|
|
1359
1383
|
!0
|
|
@@ -1361,29 +1385,29 @@ function Mt(e) {
|
|
|
1361
1385
|
"pointerdown",
|
|
1362
1386
|
Le,
|
|
1363
1387
|
!0
|
|
1364
|
-
), m.removeEventListener("pointerleave", Ee), m.removeEventListener("pointermove",
|
|
1388
|
+
), m.removeEventListener("pointerleave", Ee), m.removeEventListener("pointermove", ke), m.removeEventListener("pointerout", Ge), m.removeEventListener("pointerup", Ie, !0)), r.disconnect();
|
|
1365
1389
|
};
|
|
1366
1390
|
}
|
|
1367
1391
|
function Et() {
|
|
1368
|
-
const [e, t] =
|
|
1392
|
+
const [e, t] = J({}), n = X(() => t({}), []);
|
|
1369
1393
|
return [e, n];
|
|
1370
1394
|
}
|
|
1371
1395
|
function me(e) {
|
|
1372
1396
|
const t = tt();
|
|
1373
1397
|
return `${e ?? t}`;
|
|
1374
1398
|
}
|
|
1375
|
-
const
|
|
1376
|
-
function
|
|
1377
|
-
const t =
|
|
1378
|
-
return
|
|
1399
|
+
const $ = typeof window < "u" ? Oe : Te;
|
|
1400
|
+
function q(e) {
|
|
1401
|
+
const t = G(e);
|
|
1402
|
+
return $(() => {
|
|
1379
1403
|
t.current = e;
|
|
1380
|
-
}, [e]),
|
|
1404
|
+
}, [e]), X(
|
|
1381
1405
|
(...n) => t.current?.(...n),
|
|
1382
1406
|
[t]
|
|
1383
1407
|
);
|
|
1384
1408
|
}
|
|
1385
1409
|
function he(...e) {
|
|
1386
|
-
return
|
|
1410
|
+
return q((t) => {
|
|
1387
1411
|
e.forEach((n) => {
|
|
1388
1412
|
if (n)
|
|
1389
1413
|
switch (typeof n) {
|
|
@@ -1399,20 +1423,20 @@ function he(...e) {
|
|
|
1399
1423
|
});
|
|
1400
1424
|
});
|
|
1401
1425
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const t =
|
|
1404
|
-
return
|
|
1426
|
+
function kt(e) {
|
|
1427
|
+
const t = G({ ...e });
|
|
1428
|
+
return $(() => {
|
|
1405
1429
|
for (const n in e)
|
|
1406
1430
|
t.current[n] = e[n];
|
|
1407
1431
|
}, [e]), t.current;
|
|
1408
1432
|
}
|
|
1409
1433
|
const Je = nt(null);
|
|
1410
|
-
function
|
|
1411
|
-
const n =
|
|
1434
|
+
function Gt(e, t) {
|
|
1435
|
+
const n = G({
|
|
1412
1436
|
getLayout: () => ({}),
|
|
1413
1437
|
setLayout: wt
|
|
1414
1438
|
});
|
|
1415
|
-
Ne(t, () => n.current, []),
|
|
1439
|
+
Ne(t, () => n.current, []), $(() => {
|
|
1416
1440
|
Object.assign(
|
|
1417
1441
|
n.current,
|
|
1418
1442
|
We({ groupId: e })
|
|
@@ -1429,121 +1453,121 @@ function It({
|
|
|
1429
1453
|
groupRef: l,
|
|
1430
1454
|
id: s,
|
|
1431
1455
|
onLayoutChange: a,
|
|
1432
|
-
onLayoutChanged:
|
|
1433
|
-
orientation:
|
|
1456
|
+
onLayoutChanged: c,
|
|
1457
|
+
orientation: u = "horizontal",
|
|
1434
1458
|
resizeTargetMinimumSize: h = {
|
|
1435
1459
|
coarse: 20,
|
|
1436
1460
|
fine: 10
|
|
1437
1461
|
},
|
|
1438
|
-
style:
|
|
1462
|
+
style: S,
|
|
1439
1463
|
...m
|
|
1440
1464
|
}) {
|
|
1441
|
-
const f =
|
|
1465
|
+
const f = G({
|
|
1442
1466
|
onLayoutChange: {},
|
|
1443
1467
|
onLayoutChanged: {}
|
|
1444
|
-
}), d =
|
|
1445
|
-
A(f.current.onLayoutChange,
|
|
1446
|
-
}), p =
|
|
1447
|
-
A(f.current.onLayoutChanged,
|
|
1448
|
-
}), g = me(s), v =
|
|
1468
|
+
}), d = q((L) => {
|
|
1469
|
+
A(f.current.onLayoutChange, L) || (f.current.onLayoutChange = L, a?.(L));
|
|
1470
|
+
}), p = q((L) => {
|
|
1471
|
+
A(f.current.onLayoutChanged, L) || (f.current.onLayoutChanged = L, c?.(L));
|
|
1472
|
+
}), g = me(s), v = G(null), [z, y] = Et(), b = G({
|
|
1449
1473
|
lastExpandedPanelSizes: {},
|
|
1450
1474
|
layouts: {},
|
|
1451
1475
|
panels: [],
|
|
1452
1476
|
resizeTargetMinimumSize: h,
|
|
1453
1477
|
separators: []
|
|
1454
|
-
}),
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
(
|
|
1458
|
-
const { interactionState:
|
|
1478
|
+
}), C = he(v, r);
|
|
1479
|
+
Gt(g, l);
|
|
1480
|
+
const w = q(
|
|
1481
|
+
(L, P) => {
|
|
1482
|
+
const { interactionState: k, mountedGroups: Q } = E();
|
|
1459
1483
|
for (const ee of Q.keys())
|
|
1460
|
-
if (ee.id ===
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1484
|
+
if (ee.id === L) {
|
|
1485
|
+
const B = Q.get(ee);
|
|
1486
|
+
if (B) {
|
|
1463
1487
|
let te = !1;
|
|
1464
|
-
switch (
|
|
1488
|
+
switch (k.state) {
|
|
1465
1489
|
case "active": {
|
|
1466
|
-
te =
|
|
1490
|
+
te = k.hitRegions.some(
|
|
1467
1491
|
(le) => le.group === ee
|
|
1468
1492
|
);
|
|
1469
1493
|
break;
|
|
1470
1494
|
}
|
|
1471
1495
|
}
|
|
1472
1496
|
return {
|
|
1473
|
-
flexGrow:
|
|
1497
|
+
flexGrow: B.layout[P] ?? 1,
|
|
1474
1498
|
pointerEvents: te ? "none" : void 0
|
|
1475
1499
|
};
|
|
1476
1500
|
}
|
|
1477
1501
|
}
|
|
1478
1502
|
return {
|
|
1479
|
-
flexGrow: n?.[
|
|
1503
|
+
flexGrow: n?.[P] ?? 1
|
|
1480
1504
|
};
|
|
1481
1505
|
}
|
|
1482
|
-
),
|
|
1506
|
+
), H = _e(
|
|
1483
1507
|
() => ({
|
|
1484
|
-
getPanelStyles:
|
|
1508
|
+
getPanelStyles: w,
|
|
1485
1509
|
id: g,
|
|
1486
|
-
orientation:
|
|
1487
|
-
registerPanel: (
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1490
|
-
...
|
|
1491
|
-
|
|
1492
|
-
]),
|
|
1493
|
-
|
|
1494
|
-
(
|
|
1495
|
-
),
|
|
1510
|
+
orientation: u,
|
|
1511
|
+
registerPanel: (L) => {
|
|
1512
|
+
const P = b.current;
|
|
1513
|
+
return P.panels = fe(u, [
|
|
1514
|
+
...P.panels,
|
|
1515
|
+
L
|
|
1516
|
+
]), y(), () => {
|
|
1517
|
+
P.panels = P.panels.filter(
|
|
1518
|
+
(k) => k !== L
|
|
1519
|
+
), y();
|
|
1496
1520
|
};
|
|
1497
1521
|
},
|
|
1498
|
-
registerSeparator: (
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1501
|
-
...
|
|
1502
|
-
|
|
1503
|
-
]),
|
|
1504
|
-
|
|
1505
|
-
(
|
|
1506
|
-
),
|
|
1522
|
+
registerSeparator: (L) => {
|
|
1523
|
+
const P = b.current;
|
|
1524
|
+
return P.separators = fe(u, [
|
|
1525
|
+
...P.separators,
|
|
1526
|
+
L
|
|
1527
|
+
]), y(), () => {
|
|
1528
|
+
P.separators = P.separators.filter(
|
|
1529
|
+
(k) => k !== L
|
|
1530
|
+
), y();
|
|
1507
1531
|
};
|
|
1508
1532
|
}
|
|
1509
1533
|
}),
|
|
1510
|
-
[
|
|
1511
|
-
),
|
|
1534
|
+
[w, g, y, u]
|
|
1535
|
+
), N = kt({
|
|
1512
1536
|
defaultLayout: n,
|
|
1513
1537
|
disableCursor: o
|
|
1514
|
-
}),
|
|
1515
|
-
return
|
|
1516
|
-
const
|
|
1517
|
-
if (
|
|
1538
|
+
}), j = G(null);
|
|
1539
|
+
return $(() => {
|
|
1540
|
+
const L = v.current;
|
|
1541
|
+
if (L === null)
|
|
1518
1542
|
return;
|
|
1519
|
-
const
|
|
1520
|
-
defaultLayout:
|
|
1521
|
-
disableCursor: !!
|
|
1543
|
+
const P = b.current, k = {
|
|
1544
|
+
defaultLayout: N.defaultLayout,
|
|
1545
|
+
disableCursor: !!N.disableCursor,
|
|
1522
1546
|
disabled: !!i,
|
|
1523
|
-
element:
|
|
1547
|
+
element: L,
|
|
1524
1548
|
id: g,
|
|
1525
|
-
inMemoryLastExpandedPanelSizes:
|
|
1526
|
-
inMemoryLayouts:
|
|
1527
|
-
orientation:
|
|
1528
|
-
panels:
|
|
1529
|
-
resizeTargetMinimumSize:
|
|
1530
|
-
separators:
|
|
1549
|
+
inMemoryLastExpandedPanelSizes: b.current.lastExpandedPanelSizes,
|
|
1550
|
+
inMemoryLayouts: b.current.layouts,
|
|
1551
|
+
orientation: u,
|
|
1552
|
+
panels: P.panels,
|
|
1553
|
+
resizeTargetMinimumSize: P.resizeTargetMinimumSize,
|
|
1554
|
+
separators: P.separators
|
|
1531
1555
|
};
|
|
1532
|
-
|
|
1533
|
-
const Q = Mt(
|
|
1534
|
-
if (
|
|
1535
|
-
const { defaultLayoutDeferred:
|
|
1536
|
-
!
|
|
1556
|
+
j.current = k;
|
|
1557
|
+
const Q = Mt(k), B = E().mountedGroups.get(k);
|
|
1558
|
+
if (B) {
|
|
1559
|
+
const { defaultLayoutDeferred: K, derivedPanelConstraints: ne, layout: oe } = B;
|
|
1560
|
+
!K && ne.length > 0 && (d(oe), p(oe));
|
|
1537
1561
|
}
|
|
1538
|
-
const te =
|
|
1562
|
+
const te = T.addListener(
|
|
1539
1563
|
"interactionStateChange",
|
|
1540
|
-
(
|
|
1541
|
-
|
|
1564
|
+
(K) => {
|
|
1565
|
+
K.state;
|
|
1542
1566
|
}
|
|
1543
|
-
), le =
|
|
1567
|
+
), le = T.addListener(
|
|
1544
1568
|
"mountedGroupsChange",
|
|
1545
|
-
(
|
|
1546
|
-
const ne =
|
|
1569
|
+
(K) => {
|
|
1570
|
+
const ne = K.get(k);
|
|
1547
1571
|
if (ne) {
|
|
1548
1572
|
const { defaultLayoutDeferred: oe, derivedPanelConstraints: Ze, layout: ye } = ne;
|
|
1549
1573
|
if (oe || Ze.length === 0)
|
|
@@ -1554,20 +1578,20 @@ function It({
|
|
|
1554
1578
|
}
|
|
1555
1579
|
);
|
|
1556
1580
|
return () => {
|
|
1557
|
-
|
|
1581
|
+
j.current = null, Q(), te(), le();
|
|
1558
1582
|
};
|
|
1559
1583
|
}, [
|
|
1560
1584
|
i,
|
|
1561
1585
|
g,
|
|
1562
1586
|
p,
|
|
1563
1587
|
d,
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1588
|
+
u,
|
|
1589
|
+
z,
|
|
1590
|
+
N
|
|
1567
1591
|
]), Te(() => {
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
}), /* @__PURE__ */
|
|
1592
|
+
const L = j.current;
|
|
1593
|
+
L && (L.defaultLayout = n, L.disableCursor = !!o);
|
|
1594
|
+
}), /* @__PURE__ */ Y(Je.Provider, { value: H, children: /* @__PURE__ */ Y(
|
|
1571
1595
|
"div",
|
|
1572
1596
|
{
|
|
1573
1597
|
...m,
|
|
@@ -1575,14 +1599,14 @@ function It({
|
|
|
1575
1599
|
"data-group": !0,
|
|
1576
1600
|
"data-testid": g,
|
|
1577
1601
|
id: g,
|
|
1578
|
-
ref:
|
|
1602
|
+
ref: C,
|
|
1579
1603
|
style: {
|
|
1580
1604
|
height: "100%",
|
|
1581
1605
|
width: "100%",
|
|
1582
1606
|
overflow: "hidden",
|
|
1583
|
-
...
|
|
1607
|
+
...S,
|
|
1584
1608
|
display: "flex",
|
|
1585
|
-
flexDirection:
|
|
1609
|
+
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1586
1610
|
flexWrap: "nowrap"
|
|
1587
1611
|
},
|
|
1588
1612
|
children: e
|
|
@@ -1599,23 +1623,23 @@ function Ht({
|
|
|
1599
1623
|
storage: n = localStorage,
|
|
1600
1624
|
...o
|
|
1601
1625
|
}) {
|
|
1602
|
-
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = ce(r, t ?? []), s =
|
|
1626
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = ce(r, t ?? []), s = Ae(
|
|
1603
1627
|
Dt,
|
|
1604
1628
|
() => n.getItem(l),
|
|
1605
1629
|
() => n.getItem(l)
|
|
1606
|
-
), a =
|
|
1630
|
+
), a = _e(
|
|
1607
1631
|
() => s ? JSON.parse(s) : void 0,
|
|
1608
1632
|
[s]
|
|
1609
|
-
),
|
|
1610
|
-
const m =
|
|
1611
|
-
m && (
|
|
1633
|
+
), c = G(null), u = X(() => {
|
|
1634
|
+
const m = c.current;
|
|
1635
|
+
m && (c.current = null, clearTimeout(m));
|
|
1612
1636
|
}, []);
|
|
1613
1637
|
Oe(() => () => {
|
|
1614
|
-
|
|
1615
|
-
}, [
|
|
1616
|
-
const h =
|
|
1638
|
+
u();
|
|
1639
|
+
}, [u]);
|
|
1640
|
+
const h = X(
|
|
1617
1641
|
(m) => {
|
|
1618
|
-
|
|
1642
|
+
u();
|
|
1619
1643
|
let f;
|
|
1620
1644
|
i ? f = ce(r, Object.keys(m)) : f = ce(r, []);
|
|
1621
1645
|
try {
|
|
@@ -1624,14 +1648,14 @@ function Ht({
|
|
|
1624
1648
|
console.error(d);
|
|
1625
1649
|
}
|
|
1626
1650
|
},
|
|
1627
|
-
[
|
|
1628
|
-
),
|
|
1651
|
+
[u, i, r, n]
|
|
1652
|
+
), S = X(
|
|
1629
1653
|
(m) => {
|
|
1630
|
-
|
|
1654
|
+
u(), e === 0 ? h(m) : c.current = setTimeout(() => {
|
|
1631
1655
|
h(m);
|
|
1632
1656
|
}, e);
|
|
1633
1657
|
},
|
|
1634
|
-
[
|
|
1658
|
+
[u, e, h]
|
|
1635
1659
|
);
|
|
1636
1660
|
return {
|
|
1637
1661
|
/**
|
|
@@ -1643,7 +1667,7 @@ function Ht({
|
|
|
1643
1667
|
*
|
|
1644
1668
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1645
1669
|
*/
|
|
1646
|
-
onLayoutChange:
|
|
1670
|
+
onLayoutChange: S,
|
|
1647
1671
|
/**
|
|
1648
1672
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1649
1673
|
*/
|
|
@@ -1655,20 +1679,20 @@ function Dt() {
|
|
|
1655
1679
|
};
|
|
1656
1680
|
}
|
|
1657
1681
|
function jt() {
|
|
1658
|
-
return
|
|
1682
|
+
return J(null);
|
|
1659
1683
|
}
|
|
1660
1684
|
function Vt() {
|
|
1661
|
-
return
|
|
1685
|
+
return G(null);
|
|
1662
1686
|
}
|
|
1663
1687
|
function ge() {
|
|
1664
1688
|
const e = ot(Je);
|
|
1665
|
-
return
|
|
1689
|
+
return x(
|
|
1666
1690
|
e,
|
|
1667
1691
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1668
1692
|
), e;
|
|
1669
1693
|
}
|
|
1670
1694
|
function Ot(e, t) {
|
|
1671
|
-
const { id: n } = ge(), o =
|
|
1695
|
+
const { id: n } = ge(), o = G({
|
|
1672
1696
|
collapse: ue,
|
|
1673
1697
|
expand: ue,
|
|
1674
1698
|
getSize: () => ({
|
|
@@ -1678,7 +1702,7 @@ function Ot(e, t) {
|
|
|
1678
1702
|
isCollapsed: () => !1,
|
|
1679
1703
|
resize: ue
|
|
1680
1704
|
});
|
|
1681
|
-
Ne(t, () => o.current, []),
|
|
1705
|
+
Ne(t, () => o.current, []), $(() => {
|
|
1682
1706
|
Object.assign(
|
|
1683
1707
|
o.current,
|
|
1684
1708
|
Ve({ groupId: n, panelId: e })
|
|
@@ -1695,28 +1719,28 @@ function Tt({
|
|
|
1695
1719
|
id: l,
|
|
1696
1720
|
maxSize: s = "100%",
|
|
1697
1721
|
minSize: a = "0%",
|
|
1698
|
-
onResize:
|
|
1699
|
-
panelRef:
|
|
1722
|
+
onResize: c,
|
|
1723
|
+
panelRef: u,
|
|
1700
1724
|
style: h,
|
|
1701
|
-
...
|
|
1725
|
+
...S
|
|
1702
1726
|
}) {
|
|
1703
|
-
const m = !!l, f = me(l), d =
|
|
1704
|
-
(
|
|
1705
|
-
|
|
1727
|
+
const m = !!l, f = me(l), d = G(null), p = he(d, r), { getPanelStyles: g, id: v, registerPanel: z } = ge(), y = c !== null, b = q(
|
|
1728
|
+
(w, H, N) => {
|
|
1729
|
+
c?.(w, l, N);
|
|
1706
1730
|
}
|
|
1707
1731
|
);
|
|
1708
|
-
|
|
1709
|
-
const
|
|
1710
|
-
if (
|
|
1711
|
-
return
|
|
1712
|
-
element:
|
|
1732
|
+
$(() => {
|
|
1733
|
+
const w = d.current;
|
|
1734
|
+
if (w !== null)
|
|
1735
|
+
return z({
|
|
1736
|
+
element: w,
|
|
1713
1737
|
id: f,
|
|
1714
1738
|
idIsStable: m,
|
|
1715
1739
|
mutableValues: {
|
|
1716
1740
|
expandToSize: void 0,
|
|
1717
1741
|
prevSize: void 0
|
|
1718
1742
|
},
|
|
1719
|
-
onResize:
|
|
1743
|
+
onResize: y ? b : void 0,
|
|
1720
1744
|
panelConstraints: {
|
|
1721
1745
|
collapsedSize: n,
|
|
1722
1746
|
collapsible: o,
|
|
@@ -1729,27 +1753,27 @@ function Tt({
|
|
|
1729
1753
|
n,
|
|
1730
1754
|
o,
|
|
1731
1755
|
i,
|
|
1732
|
-
|
|
1756
|
+
y,
|
|
1733
1757
|
f,
|
|
1734
1758
|
m,
|
|
1735
1759
|
s,
|
|
1736
1760
|
a,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
]), Ot(f,
|
|
1740
|
-
const
|
|
1741
|
-
(
|
|
1742
|
-
|
|
1761
|
+
b,
|
|
1762
|
+
z
|
|
1763
|
+
]), Ot(f, u);
|
|
1764
|
+
const C = Ae(
|
|
1765
|
+
(w) => (T.addListener("mountedGroupsChange", w), () => {
|
|
1766
|
+
T.removeListener("mountedGroupsChange", w);
|
|
1743
1767
|
}),
|
|
1744
1768
|
// useSyncExternalStore does not support a custom equality check
|
|
1745
1769
|
// stringify avoids re-rendering when the style value hasn't changed
|
|
1746
1770
|
() => JSON.stringify(g(v, f)),
|
|
1747
1771
|
() => JSON.stringify(g(v, f))
|
|
1748
1772
|
);
|
|
1749
|
-
return /* @__PURE__ */
|
|
1773
|
+
return /* @__PURE__ */ Y(
|
|
1750
1774
|
"div",
|
|
1751
1775
|
{
|
|
1752
|
-
...
|
|
1776
|
+
...S,
|
|
1753
1777
|
"data-panel": !0,
|
|
1754
1778
|
"data-testid": f,
|
|
1755
1779
|
id: f,
|
|
@@ -1761,9 +1785,9 @@ function Tt({
|
|
|
1761
1785
|
flexShrink: 1,
|
|
1762
1786
|
// Prevent Panel content from interfering with panel size
|
|
1763
1787
|
overflow: "hidden",
|
|
1764
|
-
...JSON.parse(
|
|
1788
|
+
...JSON.parse(C)
|
|
1765
1789
|
},
|
|
1766
|
-
children: /* @__PURE__ */
|
|
1790
|
+
children: /* @__PURE__ */ Y(
|
|
1767
1791
|
"div",
|
|
1768
1792
|
{
|
|
1769
1793
|
className: t,
|
|
@@ -1793,12 +1817,12 @@ const Nt = {
|
|
|
1793
1817
|
margin: 0
|
|
1794
1818
|
};
|
|
1795
1819
|
function Wt() {
|
|
1796
|
-
return
|
|
1820
|
+
return J(null);
|
|
1797
1821
|
}
|
|
1798
1822
|
function Ut() {
|
|
1799
|
-
return
|
|
1823
|
+
return G(null);
|
|
1800
1824
|
}
|
|
1801
|
-
function
|
|
1825
|
+
function _t({
|
|
1802
1826
|
layout: e,
|
|
1803
1827
|
panelConstraints: t,
|
|
1804
1828
|
panelId: n,
|
|
@@ -1809,22 +1833,22 @@ function At({
|
|
|
1809
1833
|
(a) => a.panelId === n
|
|
1810
1834
|
);
|
|
1811
1835
|
if (s) {
|
|
1812
|
-
const a = s.maxSize,
|
|
1813
|
-
r =
|
|
1836
|
+
const a = s.maxSize, c = s.collapsible ? s.collapsedSize : s.minSize, u = [o, o + 1];
|
|
1837
|
+
r = F({
|
|
1814
1838
|
layout: Z({
|
|
1815
|
-
delta:
|
|
1839
|
+
delta: c - l,
|
|
1816
1840
|
initialLayout: e,
|
|
1817
1841
|
panelConstraints: t,
|
|
1818
|
-
pivotIndices:
|
|
1842
|
+
pivotIndices: u,
|
|
1819
1843
|
prevLayout: e
|
|
1820
1844
|
}),
|
|
1821
1845
|
panelConstraints: t
|
|
1822
|
-
})[n], i =
|
|
1846
|
+
})[n], i = F({
|
|
1823
1847
|
layout: Z({
|
|
1824
1848
|
delta: a - l,
|
|
1825
1849
|
initialLayout: e,
|
|
1826
1850
|
panelConstraints: t,
|
|
1827
|
-
pivotIndices:
|
|
1851
|
+
pivotIndices: u,
|
|
1828
1852
|
prevLayout: e
|
|
1829
1853
|
}),
|
|
1830
1854
|
panelConstraints: t
|
|
@@ -1837,7 +1861,7 @@ function At({
|
|
|
1837
1861
|
valueNow: l
|
|
1838
1862
|
};
|
|
1839
1863
|
}
|
|
1840
|
-
function
|
|
1864
|
+
function At({
|
|
1841
1865
|
children: e,
|
|
1842
1866
|
className: t,
|
|
1843
1867
|
elementRef: n,
|
|
@@ -1845,41 +1869,41 @@ function _t({
|
|
|
1845
1869
|
style: i,
|
|
1846
1870
|
...r
|
|
1847
1871
|
}) {
|
|
1848
|
-
const l = me(o), [s, a] =
|
|
1872
|
+
const l = me(o), [s, a] = J({}), [c, u] = J("inactive"), h = G(null), S = he(h, n), {
|
|
1849
1873
|
id: m,
|
|
1850
1874
|
orientation: f,
|
|
1851
1875
|
registerSeparator: d
|
|
1852
1876
|
} = ge(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1853
|
-
return
|
|
1877
|
+
return $(() => {
|
|
1854
1878
|
const g = h.current;
|
|
1855
1879
|
if (g !== null) {
|
|
1856
1880
|
const v = {
|
|
1857
1881
|
element: g,
|
|
1858
1882
|
id: l
|
|
1859
|
-
},
|
|
1883
|
+
}, z = d(v), y = T.addListener(
|
|
1860
1884
|
"interactionStateChange",
|
|
1861
|
-
(
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
(
|
|
1865
|
-
) ?
|
|
1885
|
+
(C) => {
|
|
1886
|
+
u(
|
|
1887
|
+
C.state !== "inactive" && C.hitRegions.some(
|
|
1888
|
+
(w) => w.separator === v
|
|
1889
|
+
) ? C.state : "inactive"
|
|
1866
1890
|
);
|
|
1867
1891
|
}
|
|
1868
|
-
),
|
|
1892
|
+
), b = T.addListener(
|
|
1869
1893
|
"mountedGroupsChange",
|
|
1870
|
-
(
|
|
1871
|
-
|
|
1872
|
-
({ derivedPanelConstraints:
|
|
1873
|
-
if (
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1876
|
-
const
|
|
1894
|
+
(C) => {
|
|
1895
|
+
C.forEach(
|
|
1896
|
+
({ derivedPanelConstraints: w, layout: H, separatorToPanels: N }, j) => {
|
|
1897
|
+
if (j.id === m) {
|
|
1898
|
+
const L = N.get(v);
|
|
1899
|
+
if (L) {
|
|
1900
|
+
const P = L[0], k = j.panels.indexOf(P);
|
|
1877
1901
|
a(
|
|
1878
|
-
|
|
1879
|
-
layout:
|
|
1880
|
-
panelConstraints:
|
|
1881
|
-
panelId:
|
|
1882
|
-
panelIndex:
|
|
1902
|
+
_t({
|
|
1903
|
+
layout: H,
|
|
1904
|
+
panelConstraints: w,
|
|
1905
|
+
panelId: P.id,
|
|
1906
|
+
panelIndex: k
|
|
1883
1907
|
})
|
|
1884
1908
|
);
|
|
1885
1909
|
}
|
|
@@ -1889,10 +1913,10 @@ function _t({
|
|
|
1889
1913
|
}
|
|
1890
1914
|
);
|
|
1891
1915
|
return () => {
|
|
1892
|
-
|
|
1916
|
+
y(), b(), z();
|
|
1893
1917
|
};
|
|
1894
1918
|
}
|
|
1895
|
-
}, [m, l, d]), /* @__PURE__ */
|
|
1919
|
+
}, [m, l, d]), /* @__PURE__ */ Y(
|
|
1896
1920
|
"div",
|
|
1897
1921
|
{
|
|
1898
1922
|
...r,
|
|
@@ -1903,10 +1927,10 @@ function _t({
|
|
|
1903
1927
|
"aria-valuenow": s.valueNow,
|
|
1904
1928
|
children: e,
|
|
1905
1929
|
className: t,
|
|
1906
|
-
"data-separator":
|
|
1930
|
+
"data-separator": c,
|
|
1907
1931
|
"data-testid": l,
|
|
1908
1932
|
id: l,
|
|
1909
|
-
ref:
|
|
1933
|
+
ref: S,
|
|
1910
1934
|
role: "separator",
|
|
1911
1935
|
style: {
|
|
1912
1936
|
flexBasis: "auto",
|
|
@@ -1918,11 +1942,11 @@ function _t({
|
|
|
1918
1942
|
}
|
|
1919
1943
|
);
|
|
1920
1944
|
}
|
|
1921
|
-
|
|
1945
|
+
At.displayName = "Separator";
|
|
1922
1946
|
export {
|
|
1923
1947
|
It as Group,
|
|
1924
1948
|
Tt as Panel,
|
|
1925
|
-
|
|
1949
|
+
At as Separator,
|
|
1926
1950
|
at as isCoarsePointer,
|
|
1927
1951
|
Ht as useDefaultLayout,
|
|
1928
1952
|
jt as useGroupCallbackRef,
|