react-resizable-panels 4.5.6 → 4.5.8-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,33 +1,33 @@
|
|
|
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;
|
|
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 Array.from(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 Fe(e) {
|
|
28
28
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function $e(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 Fe(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 lt({
|
|
|
50
50
|
};
|
|
51
51
|
let i, r = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x: s, y: a } =
|
|
53
|
+
const { x: s, y: a } = $e(o, l), u = e === "horizontal" ? s : a;
|
|
54
54
|
u < r && (r = u, i = l);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return x(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
|
-
function
|
|
59
|
+
function at() {
|
|
60
60
|
return ie === void 0 && (typeof matchMedia == "function" ? ie = !!matchMedia("(pointer:coarse)").matches : ie = !1), ie;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, r =
|
|
62
|
+
function He(e) {
|
|
63
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, r = fe(
|
|
64
64
|
n,
|
|
65
|
-
Array.from(t.children).filter(
|
|
65
|
+
Array.from(t.children).filter(Fe).map((c) => ({ element: c }))
|
|
66
66
|
).map(({ element: c }) => c), l = [];
|
|
67
67
|
let s = !1, a, u = [];
|
|
68
68
|
for (const c of r)
|
|
@@ -90,7 +90,7 @@ function $e(e) {
|
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case 1: {
|
|
93
|
-
const g = u[0], v =
|
|
93
|
+
const g = u[0], v = st({
|
|
94
94
|
orientation: n,
|
|
95
95
|
rects: [y, m],
|
|
96
96
|
targetRect: g.element.getBoundingClientRect()
|
|
@@ -122,7 +122,7 @@ function $e(e) {
|
|
|
122
122
|
];
|
|
123
123
|
for (const d of f) {
|
|
124
124
|
let p = "width" in d ? d : d.element.getBoundingClientRect();
|
|
125
|
-
const g =
|
|
125
|
+
const g = at() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
126
126
|
if (p.width < g) {
|
|
127
127
|
const v = g - p.width;
|
|
128
128
|
p = new DOMRect(
|
|
@@ -143,7 +143,7 @@ function $e(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
|
|
@@ -161,21 +161,21 @@ function $e(e) {
|
|
|
161
161
|
s = !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 re({
|
|
|
191
191
|
styleProp: n
|
|
192
192
|
}) {
|
|
193
193
|
let o;
|
|
194
|
-
const [i, r] =
|
|
194
|
+
const [i, r] = dt(n);
|
|
195
195
|
switch (r) {
|
|
196
196
|
case "%": {
|
|
197
197
|
o = i / 100 * e;
|
|
@@ -202,19 +202,19 @@ function re({
|
|
|
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,8 +223,8 @@ function re({
|
|
|
223
223
|
function D(e) {
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
const { panels: t } = e, n =
|
|
226
|
+
function Se(e) {
|
|
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,
|
|
@@ -280,7 +280,7 @@ function ve(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,8 +329,8 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
333
|
-
function
|
|
332
|
+
const T = new pt();
|
|
333
|
+
function E() {
|
|
334
334
|
return I;
|
|
335
335
|
}
|
|
336
336
|
function M(e) {
|
|
@@ -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,15 +357,15 @@ function M(e) {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
}),
|
|
360
|
+
}), T.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function mt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
364
364
|
x: 1 / 0,
|
|
365
365
|
y: 1 / 0
|
|
366
366
|
};
|
|
367
367
|
for (const r of t) {
|
|
368
|
-
const l =
|
|
368
|
+
const l = $e(n, r.rect);
|
|
369
369
|
switch (e) {
|
|
370
370
|
case "horizontal": {
|
|
371
371
|
l.x <= i.x && (o = r, i = l);
|
|
@@ -382,25 +382,25 @@ function gt(e, t, n) {
|
|
|
382
382
|
hitRegion: o
|
|
383
383
|
} : void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function ht(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: 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: ze(
|
|
403
|
-
b: ze(
|
|
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 = {
|
|
@@ -416,75 +416,75 @@ function St(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(je(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 (x(n, "Missing node"), vt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
436
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
|
-
t.push(e), e =
|
|
442
|
+
t.push(e), e = je(e);
|
|
443
443
|
return t;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function je(e) {
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
|
-
return
|
|
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
|
|
456
456
|
}) {
|
|
457
|
-
if (!
|
|
457
|
+
if (!Fe(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 (zt(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 r =
|
|
476
|
+
const r = He(i), l = mt(i.orientation, r, {
|
|
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
|
|
484
484
|
}) && n.push(l.hitRegion);
|
|
485
485
|
}), n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function bt(e, t) {
|
|
488
488
|
if (e.length !== t.length)
|
|
489
489
|
return !1;
|
|
490
490
|
for (let n = 0; n < e.length; n++)
|
|
@@ -492,7 +492,7 @@ function Lt(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
498
|
function W({
|
|
@@ -505,15 +505,15 @@ function W({
|
|
|
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;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Z({
|
|
517
517
|
delta: e,
|
|
518
518
|
initialLayout: t,
|
|
519
519
|
panelConstraints: n,
|
|
@@ -524,13 +524,13 @@ function te({
|
|
|
524
524
|
if (R(e, 0))
|
|
525
525
|
return t;
|
|
526
526
|
const l = Object.values(t), s = Object.values(i), a = [...l], [u, c] = o;
|
|
527
|
-
|
|
527
|
+
x(u != null, "Invalid first pivot index"), x(c != null, "Invalid second pivot index");
|
|
528
528
|
let h = 0;
|
|
529
529
|
switch (r) {
|
|
530
530
|
case "keyboard": {
|
|
531
531
|
{
|
|
532
532
|
const f = e < 0 ? c : u, d = n[f];
|
|
533
|
-
|
|
533
|
+
x(
|
|
534
534
|
d,
|
|
535
535
|
`Panel constraints not found for index ${f}`
|
|
536
536
|
);
|
|
@@ -540,19 +540,19 @@ function te({
|
|
|
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 S = v -
|
|
549
|
-
|
|
547
|
+
), R(z, p)) {
|
|
548
|
+
const S = v - z;
|
|
549
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
{
|
|
554
554
|
const f = e < 0 ? u : c, d = n[f];
|
|
555
|
-
|
|
555
|
+
x(
|
|
556
556
|
d,
|
|
557
557
|
`No panel constraints found for index ${f}`
|
|
558
558
|
);
|
|
@@ -562,25 +562,42 @@ function te({
|
|
|
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 S =
|
|
571
|
-
|
|
569
|
+
), R(z, v)) {
|
|
570
|
+
const S = z - p;
|
|
571
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
+
default: {
|
|
578
|
+
const f = e < 0 ? c : u, d = n[f];
|
|
579
|
+
x(
|
|
580
|
+
d,
|
|
581
|
+
`Panel constraints not found for index ${f}`
|
|
582
|
+
);
|
|
583
|
+
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
|
+
if (p)
|
|
585
|
+
if (e > 0) {
|
|
586
|
+
const z = v - g, S = z / 2;
|
|
587
|
+
O(e, z) < 0 && (e = O(e, S) <= 0 ? 0 : z);
|
|
588
|
+
} else {
|
|
589
|
+
const z = v - g, S = 100 - z / 2;
|
|
590
|
+
O(Math.abs(e), z) < 0 && (e = O(100 + e, S) > 0 ? 0 : -z);
|
|
591
|
+
}
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
577
594
|
}
|
|
578
595
|
{
|
|
579
596
|
const f = e < 0 ? 1 : -1;
|
|
580
597
|
let d = e < 0 ? c : u, 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
|
);
|
|
@@ -598,26 +615,26 @@ function te({
|
|
|
598
615
|
let d = e < 0 ? u : c;
|
|
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;
|
|
613
630
|
e < 0 ? d-- : d++;
|
|
614
631
|
}
|
|
615
632
|
}
|
|
616
|
-
if (
|
|
633
|
+
if (bt(s, a))
|
|
617
634
|
return i;
|
|
618
635
|
{
|
|
619
636
|
const f = e < 0 ? c : u, d = l[f];
|
|
620
|
-
|
|
637
|
+
x(
|
|
621
638
|
d != null,
|
|
622
639
|
`Previous layout not found for panel index ${f}`
|
|
623
640
|
);
|
|
@@ -628,16 +645,16 @@ function te({
|
|
|
628
645
|
if (a[f] = g, !R(g, p)) {
|
|
629
646
|
let v = p - g, S = e < 0 ? c : u;
|
|
630
647
|
for (; S >= 0 && S < n.length; ) {
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
648
|
+
const L = a[S];
|
|
649
|
+
x(
|
|
650
|
+
L != null,
|
|
634
651
|
`Previous layout not found for panel index ${S}`
|
|
635
652
|
);
|
|
636
|
-
const
|
|
653
|
+
const P = L + v, b = W({
|
|
637
654
|
panelConstraints: n[S],
|
|
638
|
-
size:
|
|
655
|
+
size: P
|
|
639
656
|
});
|
|
640
|
-
if (R(
|
|
657
|
+
if (R(L, b) || (v -= b - L, a[S] = b), R(v, 0))
|
|
641
658
|
break;
|
|
642
659
|
e > 0 ? S-- : S++;
|
|
643
660
|
}
|
|
@@ -652,15 +669,15 @@ function te({
|
|
|
652
669
|
const m = Object.keys(i);
|
|
653
670
|
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
654
671
|
}
|
|
655
|
-
function
|
|
672
|
+
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,14 +692,14 @@ 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
|
-
|
|
695
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
679
696
|
const u = 100 / i * a;
|
|
680
697
|
o[s] = u;
|
|
681
698
|
}
|
|
682
699
|
let r = 0;
|
|
683
700
|
for (let s = 0; s < t.length; s++) {
|
|
684
701
|
const a = o[s];
|
|
685
|
-
|
|
702
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
686
703
|
const u = W({
|
|
687
704
|
panelConstraints: t[s],
|
|
688
705
|
size: a
|
|
@@ -692,7 +709,7 @@ function $({
|
|
|
692
709
|
if (!R(r, 0))
|
|
693
710
|
for (let s = 0; s < t.length; s++) {
|
|
694
711
|
const a = o[s];
|
|
695
|
-
|
|
712
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
696
713
|
const u = a + r, c = W({
|
|
697
714
|
panelConstraints: t[s],
|
|
698
715
|
size: u
|
|
@@ -703,12 +720,12 @@ function $({
|
|
|
703
720
|
const l = Object.keys(e);
|
|
704
721
|
return o.reduce((s, a, u) => (s[l[u]] = a, s), {});
|
|
705
722
|
}
|
|
706
|
-
function
|
|
723
|
+
function Ve({
|
|
707
724
|
groupId: e,
|
|
708
725
|
panelId: t
|
|
709
726
|
}) {
|
|
710
727
|
const n = () => {
|
|
711
|
-
const { mountedGroups: s } =
|
|
728
|
+
const { mountedGroups: s } = E();
|
|
712
729
|
for (const [
|
|
713
730
|
a,
|
|
714
731
|
{
|
|
@@ -754,18 +771,18 @@ function je({
|
|
|
754
771
|
group: h,
|
|
755
772
|
layout: y,
|
|
756
773
|
separatorToPanels: m
|
|
757
|
-
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p =
|
|
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
776
|
initialLayout: y,
|
|
760
777
|
panelConstraints: c,
|
|
761
778
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
762
779
|
prevLayout: y,
|
|
763
780
|
trigger: "imperative-api"
|
|
764
|
-
}), g =
|
|
781
|
+
}), g = F({
|
|
765
782
|
layout: p,
|
|
766
783
|
panelConstraints: c
|
|
767
784
|
});
|
|
768
|
-
|
|
785
|
+
A(y, g) || M((v) => ({
|
|
769
786
|
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
770
787
|
defaultLayoutDeferred: u,
|
|
771
788
|
derivedPanelConstraints: c,
|
|
@@ -802,7 +819,7 @@ function je({
|
|
|
802
819
|
let u;
|
|
803
820
|
switch (typeof s) {
|
|
804
821
|
case "number": {
|
|
805
|
-
const { group: c } = n(), h =
|
|
822
|
+
const { group: c } = n(), h = U({ group: c });
|
|
806
823
|
u = D(s / h * 100);
|
|
807
824
|
break;
|
|
808
825
|
}
|
|
@@ -816,17 +833,17 @@ function je({
|
|
|
816
833
|
}
|
|
817
834
|
};
|
|
818
835
|
}
|
|
819
|
-
function
|
|
836
|
+
function be(e) {
|
|
820
837
|
if (e.defaultPrevented)
|
|
821
838
|
return;
|
|
822
|
-
const { mountedGroups: t } =
|
|
823
|
-
|
|
839
|
+
const { mountedGroups: t } = E();
|
|
840
|
+
de(e, t).forEach((o) => {
|
|
824
841
|
if (o.separator) {
|
|
825
842
|
const i = o.panels.find(
|
|
826
843
|
(r) => r.panelConstraints.defaultSize !== void 0
|
|
827
844
|
);
|
|
828
845
|
if (i) {
|
|
829
|
-
const r = i.panelConstraints.defaultSize, l =
|
|
846
|
+
const r = i.panelConstraints.defaultSize, l = Ve({
|
|
830
847
|
groupId: o.group.id,
|
|
831
848
|
panelId: i.id
|
|
832
849
|
});
|
|
@@ -836,7 +853,7 @@ function we(e) {
|
|
|
836
853
|
});
|
|
837
854
|
}
|
|
838
855
|
function ae(e) {
|
|
839
|
-
const { mountedGroups: t } =
|
|
856
|
+
const { mountedGroups: t } = E();
|
|
840
857
|
for (const [n] of t)
|
|
841
858
|
if (n.separators.some(
|
|
842
859
|
(o) => o.element === e
|
|
@@ -844,11 +861,11 @@ function ae(e) {
|
|
|
844
861
|
return n;
|
|
845
862
|
throw Error("Could not find parent Group for separator element");
|
|
846
863
|
}
|
|
847
|
-
function
|
|
864
|
+
function We({
|
|
848
865
|
groupId: e
|
|
849
866
|
}) {
|
|
850
867
|
const t = () => {
|
|
851
|
-
const { mountedGroups: n } =
|
|
868
|
+
const { mountedGroups: n } = E();
|
|
852
869
|
for (const [o, i] of n)
|
|
853
870
|
if (o.id === e)
|
|
854
871
|
return { group: o, ...i };
|
|
@@ -866,11 +883,11 @@ function Ve({
|
|
|
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
|
-
return o ? l : (
|
|
890
|
+
return o ? l : (A(l, a) || M((u) => ({
|
|
874
891
|
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
875
892
|
defaultLayoutDeferred: o,
|
|
876
893
|
derivedPanelConstraints: i,
|
|
@@ -882,28 +899,28 @@ function Ve({
|
|
|
882
899
|
};
|
|
883
900
|
}
|
|
884
901
|
function Ue(e) {
|
|
885
|
-
const { mountedGroups: t } =
|
|
886
|
-
return
|
|
902
|
+
const { mountedGroups: t } = E(), n = t.get(e);
|
|
903
|
+
return x(n, `Mounted Group ${e.id} not found`), n;
|
|
887
904
|
}
|
|
888
905
|
function _(e, t) {
|
|
889
906
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
890
907
|
(h) => h.element === e
|
|
891
908
|
);
|
|
892
|
-
|
|
909
|
+
x(i, "Matching separator not found");
|
|
893
910
|
const r = o.separatorToPanels.get(i);
|
|
894
|
-
|
|
895
|
-
const l = r.map((h) => n.panels.indexOf(h)), a =
|
|
911
|
+
x(r, "Matching panels not found");
|
|
912
|
+
const l = r.map((h) => n.panels.indexOf(h)), a = We({ groupId: n.id }).getLayout(), u = Z({
|
|
896
913
|
delta: t,
|
|
897
914
|
initialLayout: a,
|
|
898
915
|
panelConstraints: o.derivedPanelConstraints,
|
|
899
916
|
pivotIndices: l,
|
|
900
917
|
prevLayout: a,
|
|
901
918
|
trigger: "keyboard"
|
|
902
|
-
}), c =
|
|
919
|
+
}), c = F({
|
|
903
920
|
layout: u,
|
|
904
921
|
panelConstraints: o.derivedPanelConstraints
|
|
905
922
|
});
|
|
906
|
-
|
|
923
|
+
A(a, c) || M((h) => ({
|
|
907
924
|
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
908
925
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
909
926
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -912,7 +929,7 @@ function _(e, t) {
|
|
|
912
929
|
})
|
|
913
930
|
}));
|
|
914
931
|
}
|
|
915
|
-
function
|
|
932
|
+
function we(e) {
|
|
916
933
|
if (e.defaultPrevented)
|
|
917
934
|
return;
|
|
918
935
|
const t = e.currentTarget, n = ae(t);
|
|
@@ -943,13 +960,13 @@ function Le(e) {
|
|
|
943
960
|
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
944
961
|
(h) => h.element === t
|
|
945
962
|
);
|
|
946
|
-
|
|
963
|
+
x(s, "Matching separator not found");
|
|
947
964
|
const a = l.get(s);
|
|
948
|
-
|
|
965
|
+
x(a, "Matching panels not found");
|
|
949
966
|
const u = a[0], c = i.find(
|
|
950
967
|
(h) => h.panelId === u.id
|
|
951
968
|
);
|
|
952
|
-
if (
|
|
969
|
+
if (x(c, "Panel metadata not found"), c.collapsible) {
|
|
953
970
|
const h = r[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
954
971
|
_(t, y - h);
|
|
955
972
|
}
|
|
@@ -962,7 +979,7 @@ function Le(e) {
|
|
|
962
979
|
), r = Array.from(i).findIndex(
|
|
963
980
|
(a) => a === e.currentTarget
|
|
964
981
|
);
|
|
965
|
-
|
|
982
|
+
x(r !== null, "Index not found");
|
|
966
983
|
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
967
984
|
i[l].focus();
|
|
968
985
|
break;
|
|
@@ -973,12 +990,12 @@ function Le(e) {
|
|
|
973
990
|
}
|
|
974
991
|
}
|
|
975
992
|
}
|
|
976
|
-
function
|
|
993
|
+
function Le(e) {
|
|
977
994
|
if (e.defaultPrevented)
|
|
978
995
|
return;
|
|
979
996
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
980
997
|
return;
|
|
981
|
-
const { mountedGroups: t } =
|
|
998
|
+
const { mountedGroups: t } = E(), n = de(e, t), o = /* @__PURE__ */ new Map();
|
|
982
999
|
let i = !1;
|
|
983
1000
|
n.forEach((r) => {
|
|
984
1001
|
r.separator && (i || (i = !0, r.separator.element.focus()));
|
|
@@ -993,13 +1010,13 @@ function Ce(e) {
|
|
|
993
1010
|
}
|
|
994
1011
|
}), n.length && e.preventDefault();
|
|
995
1012
|
}
|
|
996
|
-
const
|
|
997
|
-
},
|
|
1013
|
+
const wt = (e) => e, ue = () => {
|
|
1014
|
+
}, Be = 1, Ke = 2, Xe = 4, qe = 8, Ce = 3, Pe = 12;
|
|
998
1015
|
let se;
|
|
999
|
-
function
|
|
1016
|
+
function Re() {
|
|
1000
1017
|
return se === void 0 && (se = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (se = !0)), se;
|
|
1001
1018
|
}
|
|
1002
|
-
function
|
|
1019
|
+
function Lt({
|
|
1003
1020
|
cursorFlags: e,
|
|
1004
1021
|
groups: t,
|
|
1005
1022
|
state: n
|
|
@@ -1026,8 +1043,8 @@ function Pt({
|
|
|
1026
1043
|
return null;
|
|
1027
1044
|
switch (n) {
|
|
1028
1045
|
case "active": {
|
|
1029
|
-
if (e &&
|
|
1030
|
-
const r = (e &
|
|
1046
|
+
if (e && Re()) {
|
|
1047
|
+
const r = (e & Be) !== 0, l = (e & Ke) !== 0, s = (e & Xe) !== 0, a = (e & qe) !== 0;
|
|
1031
1048
|
if (r)
|
|
1032
1049
|
return s ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1033
1050
|
if (l)
|
|
@@ -1040,19 +1057,19 @@ function Pt({
|
|
|
1040
1057
|
break;
|
|
1041
1058
|
}
|
|
1042
1059
|
}
|
|
1043
|
-
return
|
|
1060
|
+
return Re() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1044
1061
|
}
|
|
1045
|
-
const
|
|
1046
|
-
function
|
|
1062
|
+
const Me = /* @__PURE__ */ new WeakMap();
|
|
1063
|
+
function pe(e) {
|
|
1047
1064
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1048
1065
|
return;
|
|
1049
|
-
let { prevStyle: t, styleSheet: n } =
|
|
1066
|
+
let { prevStyle: t, styleSheet: n } = Me.get(e) ?? {};
|
|
1050
1067
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1051
|
-
const { cursorFlags: o, interactionState: i } =
|
|
1068
|
+
const { cursorFlags: o, interactionState: i } = E();
|
|
1052
1069
|
switch (i.state) {
|
|
1053
1070
|
case "active":
|
|
1054
1071
|
case "hover": {
|
|
1055
|
-
const r =
|
|
1072
|
+
const r = Lt({
|
|
1056
1073
|
cursorFlags: o,
|
|
1057
1074
|
groups: i.hitRegions.map((s) => s.group),
|
|
1058
1075
|
state: i.state
|
|
@@ -1067,12 +1084,12 @@ function he(e) {
|
|
|
1067
1084
|
break;
|
|
1068
1085
|
}
|
|
1069
1086
|
}
|
|
1070
|
-
|
|
1087
|
+
Me.set(e, {
|
|
1071
1088
|
prevStyle: t,
|
|
1072
1089
|
styleSheet: n
|
|
1073
1090
|
});
|
|
1074
1091
|
}
|
|
1075
|
-
function
|
|
1092
|
+
function Ye({
|
|
1076
1093
|
document: e,
|
|
1077
1094
|
event: t,
|
|
1078
1095
|
hitRegions: n,
|
|
@@ -1089,54 +1106,54 @@ function qe({
|
|
|
1089
1106
|
r ? f === "horizontal" ? p = (t.clientX - r.x) / y * 100 : p = (t.clientY - r.y) / y * 100 : f === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
1090
1107
|
const g = o.get(h), {
|
|
1091
1108
|
defaultLayoutDeferred: v,
|
|
1092
|
-
derivedPanelConstraints:
|
|
1109
|
+
derivedPanelConstraints: z,
|
|
1093
1110
|
layout: S,
|
|
1094
|
-
separatorToPanels:
|
|
1111
|
+
separatorToPanels: L
|
|
1095
1112
|
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1096
|
-
if (
|
|
1097
|
-
const
|
|
1113
|
+
if (z && g && S && L) {
|
|
1114
|
+
const P = Z({
|
|
1098
1115
|
delta: p,
|
|
1099
1116
|
initialLayout: g,
|
|
1100
|
-
panelConstraints:
|
|
1101
|
-
pivotIndices: c.panels.map((
|
|
1117
|
+
panelConstraints: z,
|
|
1118
|
+
pivotIndices: c.panels.map((b) => d.indexOf(b)),
|
|
1102
1119
|
prevLayout: S,
|
|
1103
1120
|
trigger: "mouse-or-touch"
|
|
1104
1121
|
});
|
|
1105
|
-
if (
|
|
1122
|
+
if (A(P, S)) {
|
|
1106
1123
|
if (p !== 0 && !m)
|
|
1107
1124
|
switch (f) {
|
|
1108
1125
|
case "horizontal": {
|
|
1109
|
-
s |= p < 0 ?
|
|
1126
|
+
s |= p < 0 ? Be : Ke;
|
|
1110
1127
|
break;
|
|
1111
1128
|
}
|
|
1112
1129
|
case "vertical": {
|
|
1113
|
-
s |= p < 0 ?
|
|
1130
|
+
s |= p < 0 ? Xe : qe;
|
|
1114
1131
|
break;
|
|
1115
1132
|
}
|
|
1116
1133
|
}
|
|
1117
1134
|
} else {
|
|
1118
1135
|
a.set(c.group, {
|
|
1119
1136
|
defaultLayoutDeferred: v,
|
|
1120
|
-
derivedPanelConstraints:
|
|
1121
|
-
layout:
|
|
1122
|
-
separatorToPanels:
|
|
1137
|
+
derivedPanelConstraints: z,
|
|
1138
|
+
layout: P,
|
|
1139
|
+
separatorToPanels: L
|
|
1123
1140
|
});
|
|
1124
|
-
const
|
|
1125
|
-
c.group.inMemoryLayouts[
|
|
1141
|
+
const b = c.group.panels.map(({ id: H }) => H).join(",");
|
|
1142
|
+
c.group.inMemoryLayouts[b] = P;
|
|
1126
1143
|
}
|
|
1127
1144
|
}
|
|
1128
1145
|
});
|
|
1129
1146
|
let u = 0;
|
|
1130
|
-
t.movementX === 0 ? u |= l &
|
|
1147
|
+
t.movementX === 0 ? u |= l & Ce : u |= s & Ce, t.movementY === 0 ? u |= l & Pe : u |= s & Pe, M({
|
|
1131
1148
|
cursorFlags: u,
|
|
1132
1149
|
mountedGroups: a
|
|
1133
|
-
}),
|
|
1150
|
+
}), pe(e);
|
|
1134
1151
|
}
|
|
1135
|
-
function
|
|
1136
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1152
|
+
function Ee(e) {
|
|
1153
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
1137
1154
|
switch (n.state) {
|
|
1138
1155
|
case "active":
|
|
1139
|
-
|
|
1156
|
+
Ye({
|
|
1140
1157
|
document: e.currentTarget,
|
|
1141
1158
|
event: e,
|
|
1142
1159
|
hitRegions: n.hitRegions,
|
|
@@ -1146,10 +1163,10 @@ function ke(e) {
|
|
|
1146
1163
|
});
|
|
1147
1164
|
}
|
|
1148
1165
|
}
|
|
1149
|
-
function
|
|
1166
|
+
function ke(e) {
|
|
1150
1167
|
if (e.defaultPrevented)
|
|
1151
1168
|
return;
|
|
1152
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1169
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
1153
1170
|
switch (n.state) {
|
|
1154
1171
|
case "active": {
|
|
1155
1172
|
if (
|
|
@@ -1166,7 +1183,7 @@ function Ge(e) {
|
|
|
1166
1183
|
}));
|
|
1167
1184
|
return;
|
|
1168
1185
|
}
|
|
1169
|
-
|
|
1186
|
+
Ye({
|
|
1170
1187
|
document: e.currentTarget,
|
|
1171
1188
|
event: e,
|
|
1172
1189
|
hitRegions: n.hitRegions,
|
|
@@ -1178,7 +1195,7 @@ function Ge(e) {
|
|
|
1178
1195
|
break;
|
|
1179
1196
|
}
|
|
1180
1197
|
default: {
|
|
1181
|
-
const i =
|
|
1198
|
+
const i = de(e, o);
|
|
1182
1199
|
i.length === 0 ? n.state !== "inactive" && M({
|
|
1183
1200
|
interactionState: {
|
|
1184
1201
|
state: "inactive"
|
|
@@ -1188,17 +1205,30 @@ function Ge(e) {
|
|
|
1188
1205
|
hitRegions: i,
|
|
1189
1206
|
state: "hover"
|
|
1190
1207
|
}
|
|
1191
|
-
}),
|
|
1208
|
+
}), pe(e.currentTarget);
|
|
1192
1209
|
break;
|
|
1193
1210
|
}
|
|
1194
1211
|
}
|
|
1195
1212
|
}
|
|
1213
|
+
function Ge(e) {
|
|
1214
|
+
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1215
|
+
const { interactionState: t } = E();
|
|
1216
|
+
switch (t.state) {
|
|
1217
|
+
case "hover":
|
|
1218
|
+
M({
|
|
1219
|
+
interactionState: {
|
|
1220
|
+
state: "inactive"
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1196
1226
|
function Ie(e) {
|
|
1197
1227
|
if (e.defaultPrevented)
|
|
1198
1228
|
return;
|
|
1199
1229
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1200
1230
|
return;
|
|
1201
|
-
const { interactionState: t } =
|
|
1231
|
+
const { interactionState: t } = E();
|
|
1202
1232
|
switch (t.state) {
|
|
1203
1233
|
case "active":
|
|
1204
1234
|
M({
|
|
@@ -1206,7 +1236,7 @@ function Ie(e) {
|
|
|
1206
1236
|
interactionState: {
|
|
1207
1237
|
state: "inactive"
|
|
1208
1238
|
}
|
|
1209
|
-
}), t.hitRegions.length > 0 && (
|
|
1239
|
+
}), t.hitRegions.length > 0 && (pe(e.currentTarget), M((n) => ({
|
|
1210
1240
|
mountedGroups: new Map(n.mountedGroups)
|
|
1211
1241
|
})), e.preventDefault());
|
|
1212
1242
|
}
|
|
@@ -1229,19 +1259,19 @@ function De(e) {
|
|
|
1229
1259
|
}
|
|
1230
1260
|
return o;
|
|
1231
1261
|
}
|
|
1232
|
-
function
|
|
1262
|
+
function Ct(e, t, n) {
|
|
1233
1263
|
if (!n[0])
|
|
1234
1264
|
return;
|
|
1235
1265
|
const i = e.panels.find((u) => u.element === t);
|
|
1236
1266
|
if (!i || !i.onResize)
|
|
1237
1267
|
return;
|
|
1238
|
-
const r =
|
|
1268
|
+
const r = U({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1239
1269
|
asPercentage: D(l / r * 100),
|
|
1240
1270
|
inPixels: l
|
|
1241
1271
|
};
|
|
1242
1272
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
1243
1273
|
}
|
|
1244
|
-
function
|
|
1274
|
+
function Pt(e, t) {
|
|
1245
1275
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1246
1276
|
return !1;
|
|
1247
1277
|
for (const o in e)
|
|
@@ -1249,7 +1279,7 @@ function Mt(e, t) {
|
|
|
1249
1279
|
return !1;
|
|
1250
1280
|
return !0;
|
|
1251
1281
|
}
|
|
1252
|
-
function
|
|
1282
|
+
function Rt(e, t) {
|
|
1253
1283
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1254
1284
|
if (n.length !== o.length)
|
|
1255
1285
|
return !1;
|
|
@@ -1258,10 +1288,10 @@ function Et(e, t) {
|
|
|
1258
1288
|
return !1;
|
|
1259
1289
|
return !0;
|
|
1260
1290
|
}
|
|
1261
|
-
const
|
|
1262
|
-
function
|
|
1291
|
+
const V = /* @__PURE__ */ new Map();
|
|
1292
|
+
function Mt(e) {
|
|
1263
1293
|
let t = !0;
|
|
1264
|
-
|
|
1294
|
+
x(
|
|
1265
1295
|
e.element.ownerDocument.defaultView,
|
|
1266
1296
|
"Cannot register an unmounted Group"
|
|
1267
1297
|
);
|
|
@@ -1270,52 +1300,52 @@ function kt(e) {
|
|
|
1270
1300
|
const { borderBoxSize: p, target: g } = d;
|
|
1271
1301
|
if (g === e.element) {
|
|
1272
1302
|
if (t) {
|
|
1273
|
-
if (
|
|
1303
|
+
if (U({ group: e }) === 0)
|
|
1274
1304
|
return;
|
|
1275
|
-
M((
|
|
1276
|
-
const S =
|
|
1305
|
+
M((z) => {
|
|
1306
|
+
const S = z.mountedGroups.get(e);
|
|
1277
1307
|
if (S) {
|
|
1278
|
-
const
|
|
1279
|
-
layout:
|
|
1280
|
-
panelConstraints:
|
|
1308
|
+
const L = Se(e), P = S.defaultLayoutDeferred ? De(L) : S.layout, b = F({
|
|
1309
|
+
layout: P,
|
|
1310
|
+
panelConstraints: L
|
|
1281
1311
|
});
|
|
1282
|
-
return !S.defaultLayoutDeferred &&
|
|
1312
|
+
return !S.defaultLayoutDeferred && A(P, b) && Pt(
|
|
1283
1313
|
S.derivedPanelConstraints,
|
|
1284
|
-
|
|
1285
|
-
) ?
|
|
1286
|
-
mountedGroups: new Map(
|
|
1314
|
+
L
|
|
1315
|
+
) ? z : {
|
|
1316
|
+
mountedGroups: new Map(z.mountedGroups).set(e, {
|
|
1287
1317
|
defaultLayoutDeferred: !1,
|
|
1288
|
-
derivedPanelConstraints:
|
|
1289
|
-
layout:
|
|
1318
|
+
derivedPanelConstraints: L,
|
|
1319
|
+
layout: b,
|
|
1290
1320
|
separatorToPanels: S.separatorToPanels
|
|
1291
1321
|
})
|
|
1292
1322
|
};
|
|
1293
1323
|
}
|
|
1294
|
-
return
|
|
1324
|
+
return z;
|
|
1295
1325
|
});
|
|
1296
1326
|
}
|
|
1297
1327
|
} else
|
|
1298
|
-
|
|
1328
|
+
Ct(e, g, p);
|
|
1299
1329
|
}
|
|
1300
1330
|
});
|
|
1301
1331
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
1302
|
-
|
|
1332
|
+
x(
|
|
1303
1333
|
!o.has(f.id),
|
|
1304
1334
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1305
1335
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1306
1336
|
});
|
|
1307
|
-
const l =
|
|
1337
|
+
const l = U({ group: e }), s = Se(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1308
1338
|
let u = e.defaultLayout;
|
|
1309
|
-
u && (
|
|
1310
|
-
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h =
|
|
1339
|
+
u && (Rt(e.panels, u) || (u = void 0));
|
|
1340
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = F({
|
|
1311
1341
|
layout: c,
|
|
1312
1342
|
panelConstraints: s
|
|
1313
|
-
}), y =
|
|
1343
|
+
}), y = He(e), m = e.element.ownerDocument;
|
|
1314
1344
|
return M((f) => {
|
|
1315
1345
|
const d = /* @__PURE__ */ new Map();
|
|
1316
|
-
return
|
|
1346
|
+
return V.set(
|
|
1317
1347
|
m,
|
|
1318
|
-
(
|
|
1348
|
+
(V.get(m) ?? 0) + 1
|
|
1319
1349
|
), y.forEach((p) => {
|
|
1320
1350
|
p.separator && d.set(p.separator, p.panels);
|
|
1321
1351
|
}), {
|
|
@@ -1327,50 +1357,50 @@ function kt(e) {
|
|
|
1327
1357
|
})
|
|
1328
1358
|
};
|
|
1329
1359
|
}), e.separators.forEach((f) => {
|
|
1330
|
-
|
|
1360
|
+
x(
|
|
1331
1361
|
!i.has(f.id),
|
|
1332
1362
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1333
|
-
), i.add(f.id), f.element.addEventListener("keydown",
|
|
1334
|
-
}),
|
|
1335
|
-
t = !1,
|
|
1363
|
+
), i.add(f.id), f.element.addEventListener("keydown", we);
|
|
1364
|
+
}), 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() {
|
|
1365
|
+
t = !1, V.set(
|
|
1336
1366
|
m,
|
|
1337
|
-
Math.max(0, (
|
|
1367
|
+
Math.max(0, (V.get(m) ?? 0) - 1)
|
|
1338
1368
|
), M((d) => {
|
|
1339
1369
|
const p = new Map(d.mountedGroups);
|
|
1340
1370
|
return p.delete(e), { mountedGroups: p };
|
|
1341
1371
|
}), e.separators.forEach((d) => {
|
|
1342
|
-
d.element.removeEventListener("keydown",
|
|
1343
|
-
}),
|
|
1372
|
+
d.element.removeEventListener("keydown", we);
|
|
1373
|
+
}), V.get(m) || (m.removeEventListener(
|
|
1344
1374
|
"dblclick",
|
|
1345
|
-
|
|
1375
|
+
be,
|
|
1346
1376
|
!0
|
|
1347
1377
|
), m.removeEventListener(
|
|
1348
1378
|
"pointerdown",
|
|
1349
|
-
|
|
1379
|
+
Le,
|
|
1350
1380
|
!0
|
|
1351
|
-
), m.removeEventListener("pointerleave",
|
|
1381
|
+
), m.removeEventListener("pointerleave", Ee), m.removeEventListener("pointermove", ke), m.removeEventListener("pointerout", Ge), m.removeEventListener("pointerup", Ie, !0)), r.disconnect();
|
|
1352
1382
|
};
|
|
1353
1383
|
}
|
|
1354
|
-
function
|
|
1355
|
-
const [e, t] =
|
|
1384
|
+
function Et() {
|
|
1385
|
+
const [e, t] = J({}), n = X(() => t({}), []);
|
|
1356
1386
|
return [e, n];
|
|
1357
1387
|
}
|
|
1358
1388
|
function me(e) {
|
|
1359
|
-
const t =
|
|
1389
|
+
const t = tt();
|
|
1360
1390
|
return `${e ?? t}`;
|
|
1361
1391
|
}
|
|
1362
|
-
const
|
|
1363
|
-
function
|
|
1364
|
-
const t =
|
|
1365
|
-
return
|
|
1392
|
+
const $ = typeof window < "u" ? Oe : Te;
|
|
1393
|
+
function q(e) {
|
|
1394
|
+
const t = G(e);
|
|
1395
|
+
return $(() => {
|
|
1366
1396
|
t.current = e;
|
|
1367
|
-
}, [e]),
|
|
1397
|
+
}, [e]), X(
|
|
1368
1398
|
(...n) => t.current?.(...n),
|
|
1369
1399
|
[t]
|
|
1370
1400
|
);
|
|
1371
1401
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1402
|
+
function he(...e) {
|
|
1403
|
+
return q((t) => {
|
|
1374
1404
|
e.forEach((n) => {
|
|
1375
1405
|
if (n)
|
|
1376
1406
|
switch (typeof n) {
|
|
@@ -1386,27 +1416,27 @@ function ge(...e) {
|
|
|
1386
1416
|
});
|
|
1387
1417
|
});
|
|
1388
1418
|
}
|
|
1389
|
-
function
|
|
1390
|
-
const t =
|
|
1391
|
-
return
|
|
1419
|
+
function kt(e) {
|
|
1420
|
+
const t = G({ ...e });
|
|
1421
|
+
return $(() => {
|
|
1392
1422
|
for (const n in e)
|
|
1393
1423
|
t.current[n] = e[n];
|
|
1394
1424
|
}, [e]), t.current;
|
|
1395
1425
|
}
|
|
1396
|
-
const
|
|
1397
|
-
function
|
|
1398
|
-
const n =
|
|
1426
|
+
const Je = nt(null);
|
|
1427
|
+
function Gt(e, t) {
|
|
1428
|
+
const n = G({
|
|
1399
1429
|
getLayout: () => ({}),
|
|
1400
|
-
setLayout:
|
|
1430
|
+
setLayout: wt
|
|
1401
1431
|
});
|
|
1402
|
-
|
|
1432
|
+
Ne(t, () => n.current, []), $(() => {
|
|
1403
1433
|
Object.assign(
|
|
1404
1434
|
n.current,
|
|
1405
|
-
|
|
1435
|
+
We({ groupId: e })
|
|
1406
1436
|
);
|
|
1407
1437
|
});
|
|
1408
1438
|
}
|
|
1409
|
-
function
|
|
1439
|
+
function It({
|
|
1410
1440
|
children: e,
|
|
1411
1441
|
className: t,
|
|
1412
1442
|
defaultLayout: n,
|
|
@@ -1425,131 +1455,123 @@ function Dt({
|
|
|
1425
1455
|
style: y,
|
|
1426
1456
|
...m
|
|
1427
1457
|
}) {
|
|
1428
|
-
const f =
|
|
1458
|
+
const f = G({
|
|
1429
1459
|
onLayoutChange: {},
|
|
1430
1460
|
onLayoutChanged: {}
|
|
1431
|
-
}), d =
|
|
1432
|
-
|
|
1433
|
-
}), p =
|
|
1434
|
-
|
|
1435
|
-
}), g = me(s), v =
|
|
1461
|
+
}), d = q((w) => {
|
|
1462
|
+
A(f.current.onLayoutChange, w) || (f.current.onLayoutChange = w, a?.(w));
|
|
1463
|
+
}), p = q((w) => {
|
|
1464
|
+
A(f.current.onLayoutChanged, w) || (f.current.onLayoutChanged = w, u?.(w));
|
|
1465
|
+
}), g = me(s), v = G(null), [z, S] = Et(), L = G({
|
|
1436
1466
|
lastExpandedPanelSizes: {},
|
|
1437
1467
|
layouts: {},
|
|
1438
1468
|
panels: [],
|
|
1439
1469
|
resizeTargetMinimumSize: h,
|
|
1440
1470
|
separators: []
|
|
1441
|
-
}),
|
|
1442
|
-
|
|
1443
|
-
const
|
|
1444
|
-
(
|
|
1445
|
-
const { interactionState:
|
|
1446
|
-
for (const
|
|
1447
|
-
if (
|
|
1448
|
-
const
|
|
1449
|
-
if (
|
|
1450
|
-
let
|
|
1451
|
-
switch (
|
|
1471
|
+
}), P = he(v, r);
|
|
1472
|
+
Gt(g, l);
|
|
1473
|
+
const b = q(
|
|
1474
|
+
(w, C) => {
|
|
1475
|
+
const { interactionState: k, mountedGroups: Q } = E();
|
|
1476
|
+
for (const ee of Q.keys())
|
|
1477
|
+
if (ee.id === w) {
|
|
1478
|
+
const B = Q.get(ee);
|
|
1479
|
+
if (B) {
|
|
1480
|
+
let te = !1;
|
|
1481
|
+
switch (k.state) {
|
|
1452
1482
|
case "active": {
|
|
1453
|
-
|
|
1454
|
-
(le) => le.group ===
|
|
1483
|
+
te = k.hitRegions.some(
|
|
1484
|
+
(le) => le.group === ee
|
|
1455
1485
|
);
|
|
1456
1486
|
break;
|
|
1457
1487
|
}
|
|
1458
1488
|
}
|
|
1459
1489
|
return {
|
|
1460
|
-
flexGrow:
|
|
1461
|
-
pointerEvents:
|
|
1490
|
+
flexGrow: B.layout[C] ?? 1,
|
|
1491
|
+
pointerEvents: te ? "none" : void 0
|
|
1462
1492
|
};
|
|
1463
1493
|
}
|
|
1464
1494
|
}
|
|
1465
1495
|
return {
|
|
1466
|
-
flexGrow: n?.[
|
|
1496
|
+
flexGrow: n?.[C] ?? 1
|
|
1467
1497
|
};
|
|
1468
1498
|
}
|
|
1469
|
-
),
|
|
1499
|
+
), H = _e(
|
|
1470
1500
|
() => ({
|
|
1471
|
-
getPanelStyles:
|
|
1501
|
+
getPanelStyles: b,
|
|
1472
1502
|
id: g,
|
|
1473
1503
|
orientation: c,
|
|
1474
|
-
registerPanel: (
|
|
1475
|
-
const
|
|
1476
|
-
return
|
|
1477
|
-
...
|
|
1478
|
-
|
|
1504
|
+
registerPanel: (w) => {
|
|
1505
|
+
const C = L.current;
|
|
1506
|
+
return C.panels = fe(c, [
|
|
1507
|
+
...C.panels,
|
|
1508
|
+
w
|
|
1479
1509
|
]), S(), () => {
|
|
1480
|
-
|
|
1481
|
-
(
|
|
1510
|
+
C.panels = C.panels.filter(
|
|
1511
|
+
(k) => k !== w
|
|
1482
1512
|
), S();
|
|
1483
1513
|
};
|
|
1484
1514
|
},
|
|
1485
|
-
registerSeparator: (
|
|
1486
|
-
const
|
|
1487
|
-
return
|
|
1488
|
-
...
|
|
1489
|
-
|
|
1515
|
+
registerSeparator: (w) => {
|
|
1516
|
+
const C = L.current;
|
|
1517
|
+
return C.separators = fe(c, [
|
|
1518
|
+
...C.separators,
|
|
1519
|
+
w
|
|
1490
1520
|
]), S(), () => {
|
|
1491
|
-
|
|
1492
|
-
(
|
|
1521
|
+
C.separators = C.separators.filter(
|
|
1522
|
+
(k) => k !== w
|
|
1493
1523
|
), S();
|
|
1494
1524
|
};
|
|
1495
1525
|
}
|
|
1496
1526
|
}),
|
|
1497
|
-
[
|
|
1498
|
-
),
|
|
1527
|
+
[b, g, S, c]
|
|
1528
|
+
), N = kt({
|
|
1499
1529
|
defaultLayout: n,
|
|
1500
1530
|
disableCursor: o
|
|
1501
|
-
}),
|
|
1502
|
-
return
|
|
1503
|
-
const
|
|
1504
|
-
if (
|
|
1531
|
+
}), j = G(null);
|
|
1532
|
+
return $(() => {
|
|
1533
|
+
const w = v.current;
|
|
1534
|
+
if (w === null)
|
|
1505
1535
|
return;
|
|
1506
|
-
const
|
|
1507
|
-
defaultLayout:
|
|
1508
|
-
disableCursor: !!
|
|
1536
|
+
const C = L.current, k = {
|
|
1537
|
+
defaultLayout: N.defaultLayout,
|
|
1538
|
+
disableCursor: !!N.disableCursor,
|
|
1509
1539
|
disabled: !!i,
|
|
1510
|
-
element:
|
|
1540
|
+
element: w,
|
|
1511
1541
|
id: g,
|
|
1512
|
-
inMemoryLastExpandedPanelSizes:
|
|
1513
|
-
inMemoryLayouts:
|
|
1542
|
+
inMemoryLastExpandedPanelSizes: L.current.lastExpandedPanelSizes,
|
|
1543
|
+
inMemoryLayouts: L.current.layouts,
|
|
1514
1544
|
orientation: c,
|
|
1515
|
-
panels:
|
|
1516
|
-
resizeTargetMinimumSize:
|
|
1517
|
-
separators:
|
|
1545
|
+
panels: C.panels,
|
|
1546
|
+
resizeTargetMinimumSize: C.resizeTargetMinimumSize,
|
|
1547
|
+
separators: C.separators
|
|
1518
1548
|
};
|
|
1519
|
-
|
|
1520
|
-
const
|
|
1521
|
-
if (
|
|
1522
|
-
const { defaultLayoutDeferred:
|
|
1523
|
-
!
|
|
1524
|
-
ue.scheduleUpdate();
|
|
1525
|
-
}));
|
|
1549
|
+
j.current = k;
|
|
1550
|
+
const Q = Mt(k), B = E().mountedGroups.get(k);
|
|
1551
|
+
if (B) {
|
|
1552
|
+
const { defaultLayoutDeferred: K, derivedPanelConstraints: ne, layout: oe } = B;
|
|
1553
|
+
!K && ne.length > 0 && (d(oe), p(oe));
|
|
1526
1554
|
}
|
|
1527
|
-
|
|
1528
|
-
const le = N.addListener(
|
|
1555
|
+
const te = T.addListener(
|
|
1529
1556
|
"interactionStateChange",
|
|
1530
|
-
(
|
|
1531
|
-
|
|
1532
|
-
X !== A && (X = A, L.panels.forEach((V) => {
|
|
1533
|
-
V.scheduleUpdate();
|
|
1534
|
-
}));
|
|
1557
|
+
(K) => {
|
|
1558
|
+
K.state;
|
|
1535
1559
|
}
|
|
1536
|
-
),
|
|
1560
|
+
), le = T.addListener(
|
|
1537
1561
|
"mountedGroupsChange",
|
|
1538
|
-
(
|
|
1539
|
-
const
|
|
1540
|
-
if (
|
|
1541
|
-
const { defaultLayoutDeferred:
|
|
1542
|
-
if (
|
|
1562
|
+
(K) => {
|
|
1563
|
+
const ne = K.get(k);
|
|
1564
|
+
if (ne) {
|
|
1565
|
+
const { defaultLayoutDeferred: oe, derivedPanelConstraints: Ze, layout: ye } = ne;
|
|
1566
|
+
if (oe || Ze.length === 0)
|
|
1543
1567
|
return;
|
|
1544
|
-
const { interactionState: Qe } =
|
|
1545
|
-
d(
|
|
1546
|
-
tt.scheduleUpdate();
|
|
1547
|
-
});
|
|
1568
|
+
const { interactionState: Qe } = E(), et = Qe.state !== "active";
|
|
1569
|
+
d(ye), et && p(ye);
|
|
1548
1570
|
}
|
|
1549
1571
|
}
|
|
1550
1572
|
);
|
|
1551
1573
|
return () => {
|
|
1552
|
-
|
|
1574
|
+
j.current = null, Q(), te(), le();
|
|
1553
1575
|
};
|
|
1554
1576
|
}, [
|
|
1555
1577
|
i,
|
|
@@ -1557,12 +1579,12 @@ function Dt({
|
|
|
1557
1579
|
p,
|
|
1558
1580
|
d,
|
|
1559
1581
|
c,
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
]),
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1565
|
-
}), /* @__PURE__ */
|
|
1582
|
+
z,
|
|
1583
|
+
N
|
|
1584
|
+
]), Te(() => {
|
|
1585
|
+
const w = j.current;
|
|
1586
|
+
w && (w.defaultLayout = n, w.disableCursor = !!o);
|
|
1587
|
+
}), /* @__PURE__ */ Y(Je.Provider, { value: H, children: /* @__PURE__ */ Y(
|
|
1566
1588
|
"div",
|
|
1567
1589
|
{
|
|
1568
1590
|
...m,
|
|
@@ -1570,7 +1592,7 @@ function Dt({
|
|
|
1570
1592
|
"data-group": !0,
|
|
1571
1593
|
"data-testid": g,
|
|
1572
1594
|
id: g,
|
|
1573
|
-
ref:
|
|
1595
|
+
ref: P,
|
|
1574
1596
|
style: {
|
|
1575
1597
|
height: "100%",
|
|
1576
1598
|
width: "100%",
|
|
@@ -1584,35 +1606,35 @@ function Dt({
|
|
|
1584
1606
|
}
|
|
1585
1607
|
) });
|
|
1586
1608
|
}
|
|
1587
|
-
|
|
1588
|
-
function
|
|
1609
|
+
It.displayName = "Group";
|
|
1610
|
+
function ce(e, t) {
|
|
1589
1611
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1590
1612
|
}
|
|
1591
|
-
function
|
|
1613
|
+
function Ht({
|
|
1592
1614
|
debounceSaveMs: e = 100,
|
|
1593
1615
|
panelIds: t,
|
|
1594
1616
|
storage: n = localStorage,
|
|
1595
1617
|
...o
|
|
1596
1618
|
}) {
|
|
1597
|
-
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l =
|
|
1598
|
-
|
|
1619
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = ce(r, t ?? []), s = Ae(
|
|
1620
|
+
Dt,
|
|
1599
1621
|
() => n.getItem(l),
|
|
1600
1622
|
() => n.getItem(l)
|
|
1601
1623
|
), a = _e(
|
|
1602
1624
|
() => s ? JSON.parse(s) : void 0,
|
|
1603
1625
|
[s]
|
|
1604
|
-
), u =
|
|
1626
|
+
), u = G(null), c = X(() => {
|
|
1605
1627
|
const m = u.current;
|
|
1606
1628
|
m && (u.current = null, clearTimeout(m));
|
|
1607
1629
|
}, []);
|
|
1608
|
-
|
|
1630
|
+
Oe(() => () => {
|
|
1609
1631
|
c();
|
|
1610
1632
|
}, [c]);
|
|
1611
|
-
const h =
|
|
1633
|
+
const h = X(
|
|
1612
1634
|
(m) => {
|
|
1613
1635
|
c();
|
|
1614
1636
|
let f;
|
|
1615
|
-
i ? f =
|
|
1637
|
+
i ? f = ce(r, Object.keys(m)) : f = ce(r, []);
|
|
1616
1638
|
try {
|
|
1617
1639
|
n.setItem(f, JSON.stringify(m));
|
|
1618
1640
|
} catch (d) {
|
|
@@ -1620,7 +1642,7 @@ function jt({
|
|
|
1620
1642
|
}
|
|
1621
1643
|
},
|
|
1622
1644
|
[c, i, r, n]
|
|
1623
|
-
), y =
|
|
1645
|
+
), y = X(
|
|
1624
1646
|
(m) => {
|
|
1625
1647
|
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1626
1648
|
h(m);
|
|
@@ -1645,42 +1667,42 @@ function jt({
|
|
|
1645
1667
|
onLayoutChanged: h
|
|
1646
1668
|
};
|
|
1647
1669
|
}
|
|
1648
|
-
function
|
|
1670
|
+
function Dt() {
|
|
1649
1671
|
return function() {
|
|
1650
1672
|
};
|
|
1651
1673
|
}
|
|
1652
|
-
function
|
|
1653
|
-
return
|
|
1674
|
+
function jt() {
|
|
1675
|
+
return J(null);
|
|
1654
1676
|
}
|
|
1655
|
-
function
|
|
1656
|
-
return
|
|
1677
|
+
function Vt() {
|
|
1678
|
+
return G(null);
|
|
1657
1679
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const e =
|
|
1660
|
-
return
|
|
1680
|
+
function ge() {
|
|
1681
|
+
const e = ot(Je);
|
|
1682
|
+
return x(
|
|
1661
1683
|
e,
|
|
1662
1684
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1663
1685
|
), e;
|
|
1664
1686
|
}
|
|
1665
1687
|
function Ot(e, t) {
|
|
1666
|
-
const { id: n } =
|
|
1667
|
-
collapse:
|
|
1668
|
-
expand:
|
|
1688
|
+
const { id: n } = ge(), o = G({
|
|
1689
|
+
collapse: ue,
|
|
1690
|
+
expand: ue,
|
|
1669
1691
|
getSize: () => ({
|
|
1670
1692
|
asPercentage: 0,
|
|
1671
1693
|
inPixels: 0
|
|
1672
1694
|
}),
|
|
1673
1695
|
isCollapsed: () => !1,
|
|
1674
|
-
resize:
|
|
1696
|
+
resize: ue
|
|
1675
1697
|
});
|
|
1676
|
-
|
|
1698
|
+
Ne(t, () => o.current, []), $(() => {
|
|
1677
1699
|
Object.assign(
|
|
1678
1700
|
o.current,
|
|
1679
|
-
|
|
1701
|
+
Ve({ groupId: n, panelId: e })
|
|
1680
1702
|
);
|
|
1681
1703
|
});
|
|
1682
1704
|
}
|
|
1683
|
-
function
|
|
1705
|
+
function Tt({
|
|
1684
1706
|
children: e,
|
|
1685
1707
|
className: t,
|
|
1686
1708
|
collapsedSize: n = "0%",
|
|
@@ -1695,47 +1717,53 @@ function At({
|
|
|
1695
1717
|
style: h,
|
|
1696
1718
|
...y
|
|
1697
1719
|
}) {
|
|
1698
|
-
const m = !!l, f = me(l), d =
|
|
1699
|
-
(
|
|
1700
|
-
u?.(
|
|
1720
|
+
const m = !!l, f = me(l), d = G(null), p = he(d, r), { getPanelStyles: g, id: v, registerPanel: z } = ge(), S = u !== null, L = q(
|
|
1721
|
+
(b, H, N) => {
|
|
1722
|
+
u?.(b, l, N);
|
|
1701
1723
|
}
|
|
1702
1724
|
);
|
|
1703
|
-
|
|
1704
|
-
const
|
|
1705
|
-
if (
|
|
1706
|
-
return
|
|
1707
|
-
element:
|
|
1725
|
+
$(() => {
|
|
1726
|
+
const b = d.current;
|
|
1727
|
+
if (b !== null)
|
|
1728
|
+
return z({
|
|
1729
|
+
element: b,
|
|
1708
1730
|
id: f,
|
|
1709
1731
|
idIsStable: m,
|
|
1710
1732
|
mutableValues: {
|
|
1711
1733
|
expandToSize: void 0,
|
|
1712
1734
|
prevSize: void 0
|
|
1713
1735
|
},
|
|
1714
|
-
onResize:
|
|
1736
|
+
onResize: S ? L : void 0,
|
|
1715
1737
|
panelConstraints: {
|
|
1716
1738
|
collapsedSize: n,
|
|
1717
1739
|
collapsible: o,
|
|
1718
1740
|
defaultSize: i,
|
|
1719
1741
|
maxSize: s,
|
|
1720
1742
|
minSize: a
|
|
1721
|
-
}
|
|
1722
|
-
scheduleUpdate: g
|
|
1743
|
+
}
|
|
1723
1744
|
});
|
|
1724
1745
|
}, [
|
|
1725
1746
|
n,
|
|
1726
1747
|
o,
|
|
1727
1748
|
i,
|
|
1728
|
-
|
|
1729
|
-
w,
|
|
1749
|
+
S,
|
|
1730
1750
|
f,
|
|
1731
1751
|
m,
|
|
1732
1752
|
s,
|
|
1733
1753
|
a,
|
|
1734
|
-
|
|
1735
|
-
|
|
1754
|
+
L,
|
|
1755
|
+
z
|
|
1736
1756
|
]), Ot(f, c);
|
|
1737
|
-
const P =
|
|
1738
|
-
|
|
1757
|
+
const P = Ae(
|
|
1758
|
+
(b) => (T.addListener("mountedGroupsChange", b), () => {
|
|
1759
|
+
T.removeListener("mountedGroupsChange", b);
|
|
1760
|
+
}),
|
|
1761
|
+
// useSyncExternalStore does not support a custom equality check
|
|
1762
|
+
// stringify avoids re-rendering when the style value hasn't changed
|
|
1763
|
+
() => JSON.stringify(g(v, f)),
|
|
1764
|
+
() => JSON.stringify(g(v, f))
|
|
1765
|
+
);
|
|
1766
|
+
return /* @__PURE__ */ Y(
|
|
1739
1767
|
"div",
|
|
1740
1768
|
{
|
|
1741
1769
|
...y,
|
|
@@ -1744,15 +1772,15 @@ function At({
|
|
|
1744
1772
|
id: f,
|
|
1745
1773
|
ref: p,
|
|
1746
1774
|
style: {
|
|
1747
|
-
...
|
|
1775
|
+
...Nt,
|
|
1748
1776
|
display: "flex",
|
|
1749
1777
|
flexBasis: 0,
|
|
1750
1778
|
flexShrink: 1,
|
|
1751
1779
|
// Prevent Panel content from interfering with panel size
|
|
1752
1780
|
overflow: "hidden",
|
|
1753
|
-
...P
|
|
1781
|
+
...JSON.parse(P)
|
|
1754
1782
|
},
|
|
1755
|
-
children: /* @__PURE__ */
|
|
1783
|
+
children: /* @__PURE__ */ Y(
|
|
1756
1784
|
"div",
|
|
1757
1785
|
{
|
|
1758
1786
|
className: t,
|
|
@@ -1768,8 +1796,8 @@ function At({
|
|
|
1768
1796
|
}
|
|
1769
1797
|
);
|
|
1770
1798
|
}
|
|
1771
|
-
|
|
1772
|
-
const
|
|
1799
|
+
Tt.displayName = "Panel";
|
|
1800
|
+
const Nt = {
|
|
1773
1801
|
minHeight: 0,
|
|
1774
1802
|
maxHeight: "100%",
|
|
1775
1803
|
height: "auto",
|
|
@@ -1782,12 +1810,12 @@ const _t = {
|
|
|
1782
1810
|
margin: 0
|
|
1783
1811
|
};
|
|
1784
1812
|
function Wt() {
|
|
1785
|
-
return
|
|
1813
|
+
return J(null);
|
|
1786
1814
|
}
|
|
1787
|
-
function
|
|
1788
|
-
return
|
|
1815
|
+
function Ut() {
|
|
1816
|
+
return G(null);
|
|
1789
1817
|
}
|
|
1790
|
-
function
|
|
1818
|
+
function _t({
|
|
1791
1819
|
layout: e,
|
|
1792
1820
|
panelConstraints: t,
|
|
1793
1821
|
panelId: n,
|
|
@@ -1799,8 +1827,8 @@ function Nt({
|
|
|
1799
1827
|
);
|
|
1800
1828
|
if (s) {
|
|
1801
1829
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1802
|
-
r =
|
|
1803
|
-
layout:
|
|
1830
|
+
r = F({
|
|
1831
|
+
layout: Z({
|
|
1804
1832
|
delta: u - l,
|
|
1805
1833
|
initialLayout: e,
|
|
1806
1834
|
panelConstraints: t,
|
|
@@ -1808,8 +1836,8 @@ function Nt({
|
|
|
1808
1836
|
prevLayout: e
|
|
1809
1837
|
}),
|
|
1810
1838
|
panelConstraints: t
|
|
1811
|
-
})[n], i =
|
|
1812
|
-
layout:
|
|
1839
|
+
})[n], i = F({
|
|
1840
|
+
layout: Z({
|
|
1813
1841
|
delta: a - l,
|
|
1814
1842
|
initialLayout: e,
|
|
1815
1843
|
panelConstraints: t,
|
|
@@ -1826,7 +1854,7 @@ function Nt({
|
|
|
1826
1854
|
valueNow: l
|
|
1827
1855
|
};
|
|
1828
1856
|
}
|
|
1829
|
-
function
|
|
1857
|
+
function At({
|
|
1830
1858
|
children: e,
|
|
1831
1859
|
className: t,
|
|
1832
1860
|
elementRef: n,
|
|
@@ -1834,41 +1862,41 @@ function Ft({
|
|
|
1834
1862
|
style: i,
|
|
1835
1863
|
...r
|
|
1836
1864
|
}) {
|
|
1837
|
-
const l = me(o), [s, a] =
|
|
1865
|
+
const l = me(o), [s, a] = J({}), [u, c] = J("inactive"), h = G(null), y = he(h, n), {
|
|
1838
1866
|
id: m,
|
|
1839
1867
|
orientation: f,
|
|
1840
1868
|
registerSeparator: d
|
|
1841
|
-
} =
|
|
1842
|
-
return
|
|
1869
|
+
} = ge(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1870
|
+
return $(() => {
|
|
1843
1871
|
const g = h.current;
|
|
1844
1872
|
if (g !== null) {
|
|
1845
1873
|
const v = {
|
|
1846
1874
|
element: g,
|
|
1847
1875
|
id: l
|
|
1848
|
-
},
|
|
1876
|
+
}, z = d(v), S = T.addListener(
|
|
1849
1877
|
"interactionStateChange",
|
|
1850
|
-
(
|
|
1878
|
+
(P) => {
|
|
1851
1879
|
c(
|
|
1852
|
-
|
|
1853
|
-
(
|
|
1854
|
-
) ?
|
|
1880
|
+
P.state !== "inactive" && P.hitRegions.some(
|
|
1881
|
+
(b) => b.separator === v
|
|
1882
|
+
) ? P.state : "inactive"
|
|
1855
1883
|
);
|
|
1856
1884
|
}
|
|
1857
|
-
),
|
|
1885
|
+
), L = T.addListener(
|
|
1858
1886
|
"mountedGroupsChange",
|
|
1859
|
-
(
|
|
1860
|
-
|
|
1861
|
-
({ derivedPanelConstraints:
|
|
1862
|
-
if (
|
|
1863
|
-
const
|
|
1864
|
-
if (
|
|
1865
|
-
const
|
|
1887
|
+
(P) => {
|
|
1888
|
+
P.forEach(
|
|
1889
|
+
({ derivedPanelConstraints: b, layout: H, separatorToPanels: N }, j) => {
|
|
1890
|
+
if (j.id === m) {
|
|
1891
|
+
const w = N.get(v);
|
|
1892
|
+
if (w) {
|
|
1893
|
+
const C = w[0], k = j.panels.indexOf(C);
|
|
1866
1894
|
a(
|
|
1867
|
-
|
|
1868
|
-
layout:
|
|
1869
|
-
panelConstraints:
|
|
1870
|
-
panelId:
|
|
1871
|
-
panelIndex:
|
|
1895
|
+
_t({
|
|
1896
|
+
layout: H,
|
|
1897
|
+
panelConstraints: b,
|
|
1898
|
+
panelId: C.id,
|
|
1899
|
+
panelIndex: k
|
|
1872
1900
|
})
|
|
1873
1901
|
);
|
|
1874
1902
|
}
|
|
@@ -1878,10 +1906,10 @@ function Ft({
|
|
|
1878
1906
|
}
|
|
1879
1907
|
);
|
|
1880
1908
|
return () => {
|
|
1881
|
-
S(),
|
|
1909
|
+
S(), L(), z();
|
|
1882
1910
|
};
|
|
1883
1911
|
}
|
|
1884
|
-
}, [m, l, d]), /* @__PURE__ */
|
|
1912
|
+
}, [m, l, d]), /* @__PURE__ */ Y(
|
|
1885
1913
|
"div",
|
|
1886
1914
|
{
|
|
1887
1915
|
...r,
|
|
@@ -1907,16 +1935,16 @@ function Ft({
|
|
|
1907
1935
|
}
|
|
1908
1936
|
);
|
|
1909
1937
|
}
|
|
1910
|
-
|
|
1938
|
+
At.displayName = "Separator";
|
|
1911
1939
|
export {
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1940
|
+
It as Group,
|
|
1941
|
+
Tt as Panel,
|
|
1942
|
+
At as Separator,
|
|
1943
|
+
at as isCoarsePointer,
|
|
1944
|
+
Ht as useDefaultLayout,
|
|
1945
|
+
jt as useGroupCallbackRef,
|
|
1946
|
+
Vt as useGroupRef,
|
|
1919
1947
|
Wt as usePanelCallbackRef,
|
|
1920
|
-
|
|
1948
|
+
Ut as usePanelRef
|
|
1921
1949
|
};
|
|
1922
1950
|
//# sourceMappingURL=react-resizable-panels.js.map
|