react-resizable-panels 4.5.7 → 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,26 +1,26 @@
|
|
|
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
|
}
|
|
@@ -39,7 +39,7 @@ function $e(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function st({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -53,26 +53,26 @@ function ut({
|
|
|
53
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
62
|
function He(e) {
|
|
63
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, r =
|
|
63
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, r = fe(
|
|
64
64
|
n,
|
|
65
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)
|
|
69
69
|
if (c.hasAttribute("data-panel")) {
|
|
70
|
-
const
|
|
70
|
+
const h = o.find(
|
|
71
71
|
(y) => y.element === c
|
|
72
72
|
);
|
|
73
|
-
if (
|
|
73
|
+
if (h) {
|
|
74
74
|
if (a) {
|
|
75
|
-
const y = a.element.getBoundingClientRect(),
|
|
75
|
+
const y = a.element.getBoundingClientRect(), m = c.getBoundingClientRect();
|
|
76
76
|
let f;
|
|
77
77
|
if (s) {
|
|
78
78
|
const d = n === "horizontal" ? new DOMRect(y.right, y.top, 0, y.height) : new DOMRect(
|
|
@@ -80,7 +80,7 @@ function He(e) {
|
|
|
80
80
|
y.bottom,
|
|
81
81
|
y.width,
|
|
82
82
|
0
|
|
83
|
-
), p = n === "horizontal" ? new DOMRect(
|
|
83
|
+
), p = n === "horizontal" ? new DOMRect(m.left, m.top, 0, m.height) : new DOMRect(m.left, m.top, m.width, 0);
|
|
84
84
|
switch (u.length) {
|
|
85
85
|
case 0: {
|
|
86
86
|
f = [
|
|
@@ -90,9 +90,9 @@ function He(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
|
-
rects: [y,
|
|
95
|
+
rects: [y, m],
|
|
96
96
|
targetRect: g.element.getBoundingClientRect()
|
|
97
97
|
});
|
|
98
98
|
f = [
|
|
@@ -110,19 +110,19 @@ function He(e) {
|
|
|
110
110
|
u.length ? f = u : f = [
|
|
111
111
|
n === "horizontal" ? new DOMRect(
|
|
112
112
|
y.right,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
m.top,
|
|
114
|
+
m.left - y.right,
|
|
115
|
+
m.height
|
|
116
116
|
) : new DOMRect(
|
|
117
|
-
|
|
117
|
+
m.left,
|
|
118
118
|
y.bottom,
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
m.width,
|
|
120
|
+
m.top - y.bottom
|
|
121
121
|
)
|
|
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,39 +143,39 @@ function He(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
147
|
-
panels: [a,
|
|
146
|
+
groupSize: U({ group: e }),
|
|
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 =
|
|
153
|
+
s = !1, a = h, u = [];
|
|
154
154
|
}
|
|
155
155
|
} else if (c.hasAttribute("data-separator")) {
|
|
156
|
-
const
|
|
156
|
+
const h = i.find(
|
|
157
157
|
(y) => y.element === c
|
|
158
158
|
);
|
|
159
|
-
|
|
159
|
+
h ? u.push(h) : (a = void 0, u = []);
|
|
160
160
|
} else
|
|
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,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,9 +357,9 @@ 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
|
|
@@ -382,25 +382,25 @@ function yt(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,27 +416,27 @@ function vt(e, t) {
|
|
|
416
416
|
}
|
|
417
417
|
return Math.sign(i.a - i.b);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
419
|
+
const yt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
420
|
+
function St(e) {
|
|
421
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
442
|
t.push(e), e = je(e);
|
|
@@ -444,47 +444,47 @@ function be(e) {
|
|
|
444
444
|
}
|
|
445
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
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 = He(i), l =
|
|
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++)
|
|
@@ -495,7 +495,7 @@ function Ct(e, t) {
|
|
|
495
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
|
}) {
|
|
@@ -513,7 +513,7 @@ function B({
|
|
|
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
|
-
|
|
528
|
-
let
|
|
527
|
+
x(u != null, "Invalid first pivot index"), x(c != null, "Invalid second pivot index");
|
|
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 -
|
|
547
|
+
), R(z, p)) {
|
|
548
|
+
const S = v - z;
|
|
549
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,12 +562,12 @@ 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 =
|
|
569
|
+
), R(z, v)) {
|
|
570
|
+
const S = z - p;
|
|
571
571
|
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
@@ -576,18 +576,18 @@ function te({
|
|
|
576
576
|
}
|
|
577
577
|
default: {
|
|
578
578
|
const f = e < 0 ? c : u, d = n[f];
|
|
579
|
-
|
|
579
|
+
x(
|
|
580
580
|
d,
|
|
581
581
|
`Panel constraints not found for index ${f}`
|
|
582
582
|
);
|
|
583
583
|
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
584
|
if (p)
|
|
585
585
|
if (e > 0) {
|
|
586
|
-
const
|
|
587
|
-
O(e,
|
|
586
|
+
const z = v - g, S = z / 2;
|
|
587
|
+
O(e, z) < 0 && (e = O(e, S) <= 0 ? 0 : z);
|
|
588
588
|
} else {
|
|
589
|
-
const
|
|
590
|
-
O(Math.abs(e),
|
|
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
591
|
}
|
|
592
592
|
break;
|
|
593
593
|
}
|
|
@@ -597,11 +597,11 @@ function te({
|
|
|
597
597
|
let d = e < 0 ? c : u, p = 0;
|
|
598
598
|
for (; ; ) {
|
|
599
599
|
const v = l[d];
|
|
600
|
-
|
|
600
|
+
x(
|
|
601
601
|
v != null,
|
|
602
602
|
`Previous layout not found for panel index ${d}`
|
|
603
603
|
);
|
|
604
|
-
const S =
|
|
604
|
+
const S = W({
|
|
605
605
|
panelConstraints: n[d],
|
|
606
606
|
size: 100
|
|
607
607
|
}) - v;
|
|
@@ -614,47 +614,47 @@ function te({
|
|
|
614
614
|
{
|
|
615
615
|
let d = e < 0 ? u : c;
|
|
616
616
|
for (; d >= 0 && d < n.length; ) {
|
|
617
|
-
const p = Math.abs(e) - Math.abs(
|
|
618
|
-
|
|
617
|
+
const p = Math.abs(e) - Math.abs(h), g = l[d];
|
|
618
|
+
x(
|
|
619
619
|
g != null,
|
|
620
620
|
`Previous layout not found for panel index ${d}`
|
|
621
621
|
);
|
|
622
|
-
const v = g - p,
|
|
622
|
+
const v = g - p, z = W({
|
|
623
623
|
panelConstraints: n[d],
|
|
624
624
|
size: v
|
|
625
625
|
});
|
|
626
|
-
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, {
|
|
627
627
|
numeric: !0
|
|
628
628
|
}) >= 0))
|
|
629
629
|
break;
|
|
630
630
|
e < 0 ? d-- : d++;
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
if (
|
|
633
|
+
if (bt(s, a))
|
|
634
634
|
return i;
|
|
635
635
|
{
|
|
636
636
|
const f = e < 0 ? c : u, d = l[f];
|
|
637
|
-
|
|
637
|
+
x(
|
|
638
638
|
d != null,
|
|
639
639
|
`Previous layout not found for panel index ${f}`
|
|
640
640
|
);
|
|
641
|
-
const p = d +
|
|
641
|
+
const p = d + h, g = W({
|
|
642
642
|
panelConstraints: n[f],
|
|
643
643
|
size: p
|
|
644
644
|
});
|
|
645
645
|
if (a[f] = g, !R(g, p)) {
|
|
646
646
|
let v = p - g, S = e < 0 ? c : u;
|
|
647
647
|
for (; S >= 0 && S < n.length; ) {
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
648
|
+
const L = a[S];
|
|
649
|
+
x(
|
|
650
|
+
L != null,
|
|
651
651
|
`Previous layout not found for panel index ${S}`
|
|
652
652
|
);
|
|
653
|
-
const
|
|
653
|
+
const P = L + v, b = W({
|
|
654
654
|
panelConstraints: n[S],
|
|
655
|
-
size:
|
|
655
|
+
size: P
|
|
656
656
|
});
|
|
657
|
-
if (R(
|
|
657
|
+
if (R(L, b) || (v -= b - L, a[S] = b), R(v, 0))
|
|
658
658
|
break;
|
|
659
659
|
e > 0 ? S-- : S++;
|
|
660
660
|
}
|
|
@@ -666,10 +666,10 @@ function te({
|
|
|
666
666
|
);
|
|
667
667
|
if (!R(y, 100, 0.1))
|
|
668
668
|
return i;
|
|
669
|
-
const
|
|
670
|
-
return a.reduce((f, d, p) => (f[
|
|
669
|
+
const m = Object.keys(i);
|
|
670
|
+
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function A(e, t) {
|
|
673
673
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
674
674
|
return !1;
|
|
675
675
|
for (const n in e)
|
|
@@ -677,7 +677,7 @@ function $(e, t) {
|
|
|
677
677
|
return !1;
|
|
678
678
|
return !0;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function F({
|
|
681
681
|
layout: e,
|
|
682
682
|
panelConstraints: t
|
|
683
683
|
}) {
|
|
@@ -692,15 +692,15 @@ function H({
|
|
|
692
692
|
if (!R(i, 100) && o.length > 0)
|
|
693
693
|
for (let s = 0; s < t.length; s++) {
|
|
694
694
|
const a = o[s];
|
|
695
|
-
|
|
695
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
696
696
|
const u = 100 / i * a;
|
|
697
697
|
o[s] = u;
|
|
698
698
|
}
|
|
699
699
|
let r = 0;
|
|
700
700
|
for (let s = 0; s < t.length; s++) {
|
|
701
701
|
const a = o[s];
|
|
702
|
-
|
|
703
|
-
const u =
|
|
702
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
703
|
+
const u = W({
|
|
704
704
|
panelConstraints: t[s],
|
|
705
705
|
size: a
|
|
706
706
|
});
|
|
@@ -709,8 +709,8 @@ function H({
|
|
|
709
709
|
if (!R(r, 0))
|
|
710
710
|
for (let s = 0; s < t.length; s++) {
|
|
711
711
|
const a = o[s];
|
|
712
|
-
|
|
713
|
-
const u = a + r, c =
|
|
712
|
+
x(a != null, `No layout data found for index ${s}`);
|
|
713
|
+
const u = a + r, c = W({
|
|
714
714
|
panelConstraints: t[s],
|
|
715
715
|
size: u
|
|
716
716
|
});
|
|
@@ -731,7 +731,7 @@ function Ve({
|
|
|
731
731
|
{
|
|
732
732
|
defaultLayoutDeferred: u,
|
|
733
733
|
derivedPanelConstraints: c,
|
|
734
|
-
layout:
|
|
734
|
+
layout: h,
|
|
735
735
|
separatorToPanels: y
|
|
736
736
|
}
|
|
737
737
|
] of s)
|
|
@@ -740,7 +740,7 @@ function Ve({
|
|
|
740
740
|
defaultLayoutDeferred: u,
|
|
741
741
|
derivedPanelConstraints: c,
|
|
742
742
|
group: a,
|
|
743
|
-
layout:
|
|
743
|
+
layout: h,
|
|
744
744
|
separatorToPanels: y
|
|
745
745
|
};
|
|
746
746
|
throw Error(`Group ${e} not found`);
|
|
@@ -768,26 +768,26 @@ function Ve({
|
|
|
768
768
|
const {
|
|
769
769
|
defaultLayoutDeferred: u,
|
|
770
770
|
derivedPanelConstraints: c,
|
|
771
|
-
group:
|
|
771
|
+
group: h,
|
|
772
772
|
layout: y,
|
|
773
|
-
separatorToPanels:
|
|
774
|
-
} = n(), f =
|
|
773
|
+
separatorToPanels: m
|
|
774
|
+
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p = Z({
|
|
775
775
|
delta: d ? a - s : s - a,
|
|
776
776
|
initialLayout: y,
|
|
777
777
|
panelConstraints: c,
|
|
778
778
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
779
779
|
prevLayout: y,
|
|
780
780
|
trigger: "imperative-api"
|
|
781
|
-
}), g =
|
|
781
|
+
}), g = F({
|
|
782
782
|
layout: p,
|
|
783
783
|
panelConstraints: c
|
|
784
784
|
});
|
|
785
|
-
|
|
786
|
-
mountedGroups: new Map(v.mountedGroups).set(
|
|
785
|
+
A(y, g) || M((v) => ({
|
|
786
|
+
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
787
787
|
defaultLayoutDeferred: u,
|
|
788
788
|
derivedPanelConstraints: c,
|
|
789
789
|
layout: g,
|
|
790
|
-
separatorToPanels:
|
|
790
|
+
separatorToPanels: m
|
|
791
791
|
})
|
|
792
792
|
}));
|
|
793
793
|
};
|
|
@@ -797,8 +797,8 @@ function Ve({
|
|
|
797
797
|
s && c !== a && (u.expandToSize = c, l(a));
|
|
798
798
|
},
|
|
799
799
|
expand: () => {
|
|
800
|
-
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(),
|
|
801
|
-
if (s &&
|
|
800
|
+
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), h = r();
|
|
801
|
+
if (s && h === a) {
|
|
802
802
|
let y = c.expandToSize ?? u;
|
|
803
803
|
y === 0 && (y = 1), l(y);
|
|
804
804
|
}
|
|
@@ -819,8 +819,8 @@ function Ve({
|
|
|
819
819
|
let u;
|
|
820
820
|
switch (typeof s) {
|
|
821
821
|
case "number": {
|
|
822
|
-
const { group: c } = n(),
|
|
823
|
-
u = D(s /
|
|
822
|
+
const { group: c } = n(), h = U({ group: c });
|
|
823
|
+
u = D(s / h * 100);
|
|
824
824
|
break;
|
|
825
825
|
}
|
|
826
826
|
case "string": {
|
|
@@ -833,11 +833,11 @@ function Ve({
|
|
|
833
833
|
}
|
|
834
834
|
};
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function be(e) {
|
|
837
837
|
if (e.defaultPrevented)
|
|
838
838
|
return;
|
|
839
839
|
const { mountedGroups: t } = E();
|
|
840
|
-
|
|
840
|
+
de(e, t).forEach((o) => {
|
|
841
841
|
if (o.separator) {
|
|
842
842
|
const i = o.panels.find(
|
|
843
843
|
(r) => r.panelConstraints.defaultSize !== void 0
|
|
@@ -861,7 +861,7 @@ function ae(e) {
|
|
|
861
861
|
return n;
|
|
862
862
|
throw Error("Could not find parent Group for separator element");
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function We({
|
|
865
865
|
groupId: e
|
|
866
866
|
}) {
|
|
867
867
|
const t = () => {
|
|
@@ -883,11 +883,11 @@ function Ue({
|
|
|
883
883
|
group: r,
|
|
884
884
|
layout: l,
|
|
885
885
|
separatorToPanels: s
|
|
886
|
-
} = t(), a =
|
|
886
|
+
} = t(), a = F({
|
|
887
887
|
layout: n,
|
|
888
888
|
panelConstraints: i
|
|
889
889
|
});
|
|
890
|
-
return o ? l : (
|
|
890
|
+
return o ? l : (A(l, a) || M((u) => ({
|
|
891
891
|
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
892
892
|
defaultLayoutDeferred: o,
|
|
893
893
|
derivedPanelConstraints: i,
|
|
@@ -898,30 +898,30 @@ function Ue({
|
|
|
898
898
|
}
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function Ue(e) {
|
|
902
902
|
const { mountedGroups: t } = E(), n = t.get(e);
|
|
903
|
-
return
|
|
903
|
+
return x(n, `Mounted Group ${e.id} not found`), n;
|
|
904
904
|
}
|
|
905
|
-
function
|
|
906
|
-
const n = ae(e), o =
|
|
907
|
-
(
|
|
905
|
+
function _(e, t) {
|
|
906
|
+
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
907
|
+
(h) => h.element === e
|
|
908
908
|
);
|
|
909
|
-
|
|
909
|
+
x(i, "Matching separator not found");
|
|
910
910
|
const r = o.separatorToPanels.get(i);
|
|
911
|
-
|
|
912
|
-
const l = r.map((
|
|
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({
|
|
913
913
|
delta: t,
|
|
914
914
|
initialLayout: a,
|
|
915
915
|
panelConstraints: o.derivedPanelConstraints,
|
|
916
916
|
pivotIndices: l,
|
|
917
917
|
prevLayout: a,
|
|
918
918
|
trigger: "keyboard"
|
|
919
|
-
}), c =
|
|
919
|
+
}), c = F({
|
|
920
920
|
layout: u,
|
|
921
921
|
panelConstraints: o.derivedPanelConstraints
|
|
922
922
|
});
|
|
923
|
-
|
|
924
|
-
mountedGroups: new Map(
|
|
923
|
+
A(a, c) || M((h) => ({
|
|
924
|
+
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
925
925
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
926
926
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
927
927
|
layout: c,
|
|
@@ -929,46 +929,46 @@ function N(e, t) {
|
|
|
929
929
|
})
|
|
930
930
|
}));
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function we(e) {
|
|
933
933
|
if (e.defaultPrevented)
|
|
934
934
|
return;
|
|
935
935
|
const t = e.currentTarget, n = ae(t);
|
|
936
936
|
if (!n.disabled)
|
|
937
937
|
switch (e.key) {
|
|
938
938
|
case "ArrowDown": {
|
|
939
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
939
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, 5);
|
|
940
940
|
break;
|
|
941
941
|
}
|
|
942
942
|
case "ArrowLeft": {
|
|
943
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
943
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
|
|
944
944
|
break;
|
|
945
945
|
}
|
|
946
946
|
case "ArrowRight": {
|
|
947
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
947
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
|
|
948
948
|
break;
|
|
949
949
|
}
|
|
950
950
|
case "ArrowUp": {
|
|
951
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
951
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, -5);
|
|
952
952
|
break;
|
|
953
953
|
}
|
|
954
954
|
case "End": {
|
|
955
|
-
e.preventDefault(),
|
|
955
|
+
e.preventDefault(), _(t, 100);
|
|
956
956
|
break;
|
|
957
957
|
}
|
|
958
958
|
case "Enter": {
|
|
959
959
|
e.preventDefault();
|
|
960
|
-
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } =
|
|
961
|
-
(
|
|
960
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
961
|
+
(h) => h.element === t
|
|
962
962
|
);
|
|
963
|
-
|
|
963
|
+
x(s, "Matching separator not found");
|
|
964
964
|
const a = l.get(s);
|
|
965
|
-
|
|
965
|
+
x(a, "Matching panels not found");
|
|
966
966
|
const u = a[0], c = i.find(
|
|
967
|
-
(
|
|
967
|
+
(h) => h.panelId === u.id
|
|
968
968
|
);
|
|
969
|
-
if (
|
|
970
|
-
const
|
|
971
|
-
|
|
969
|
+
if (x(c, "Panel metadata not found"), c.collapsible) {
|
|
970
|
+
const h = r[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
971
|
+
_(t, y - h);
|
|
972
972
|
}
|
|
973
973
|
break;
|
|
974
974
|
}
|
|
@@ -979,23 +979,23 @@ function Le(e) {
|
|
|
979
979
|
), r = Array.from(i).findIndex(
|
|
980
980
|
(a) => a === e.currentTarget
|
|
981
981
|
);
|
|
982
|
-
|
|
982
|
+
x(r !== null, "Index not found");
|
|
983
983
|
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
984
984
|
i[l].focus();
|
|
985
985
|
break;
|
|
986
986
|
}
|
|
987
987
|
case "Home": {
|
|
988
|
-
e.preventDefault(),
|
|
988
|
+
e.preventDefault(), _(t, -100);
|
|
989
989
|
break;
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function Le(e) {
|
|
994
994
|
if (e.defaultPrevented)
|
|
995
995
|
return;
|
|
996
996
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
997
997
|
return;
|
|
998
|
-
const { mountedGroups: t } = E(), n =
|
|
998
|
+
const { mountedGroups: t } = E(), n = de(e, t), o = /* @__PURE__ */ new Map();
|
|
999
999
|
let i = !1;
|
|
1000
1000
|
n.forEach((r) => {
|
|
1001
1001
|
r.separator && (i || (i = !0, r.separator.element.focus()));
|
|
@@ -1010,13 +1010,13 @@ function Ce(e) {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
}), n.length && e.preventDefault();
|
|
1012
1012
|
}
|
|
1013
|
-
const
|
|
1014
|
-
}, Be = 1, Ke = 2, Xe = 4, qe = 8,
|
|
1013
|
+
const wt = (e) => e, ue = () => {
|
|
1014
|
+
}, Be = 1, Ke = 2, Xe = 4, qe = 8, Ce = 3, Pe = 12;
|
|
1015
1015
|
let se;
|
|
1016
|
-
function
|
|
1016
|
+
function Re() {
|
|
1017
1017
|
return se === void 0 && (se = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (se = !0)), se;
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function Lt({
|
|
1020
1020
|
cursorFlags: e,
|
|
1021
1021
|
groups: t,
|
|
1022
1022
|
state: n
|
|
@@ -1043,7 +1043,7 @@ function Rt({
|
|
|
1043
1043
|
return null;
|
|
1044
1044
|
switch (n) {
|
|
1045
1045
|
case "active": {
|
|
1046
|
-
if (e &&
|
|
1046
|
+
if (e && Re()) {
|
|
1047
1047
|
const r = (e & Be) !== 0, l = (e & Ke) !== 0, s = (e & Xe) !== 0, a = (e & qe) !== 0;
|
|
1048
1048
|
if (r)
|
|
1049
1049
|
return s ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
@@ -1057,19 +1057,19 @@ function Rt({
|
|
|
1057
1057
|
break;
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
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";
|
|
1061
1061
|
}
|
|
1062
|
-
const
|
|
1063
|
-
function
|
|
1062
|
+
const Me = /* @__PURE__ */ new WeakMap();
|
|
1063
|
+
function pe(e) {
|
|
1064
1064
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1065
1065
|
return;
|
|
1066
|
-
let { prevStyle: t, styleSheet: n } =
|
|
1066
|
+
let { prevStyle: t, styleSheet: n } = Me.get(e) ?? {};
|
|
1067
1067
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1068
1068
|
const { cursorFlags: o, interactionState: i } = E();
|
|
1069
1069
|
switch (i.state) {
|
|
1070
1070
|
case "active":
|
|
1071
1071
|
case "hover": {
|
|
1072
|
-
const r =
|
|
1072
|
+
const r = Lt({
|
|
1073
1073
|
cursorFlags: o,
|
|
1074
1074
|
groups: i.hitRegions.map((s) => s.group),
|
|
1075
1075
|
state: i.state
|
|
@@ -1084,7 +1084,7 @@ function he(e) {
|
|
|
1084
1084
|
break;
|
|
1085
1085
|
}
|
|
1086
1086
|
}
|
|
1087
|
-
|
|
1087
|
+
Me.set(e, {
|
|
1088
1088
|
prevStyle: t,
|
|
1089
1089
|
styleSheet: n
|
|
1090
1090
|
});
|
|
@@ -1101,26 +1101,26 @@ function Ye({
|
|
|
1101
1101
|
let s = 0;
|
|
1102
1102
|
const a = new Map(i);
|
|
1103
1103
|
n.forEach((c) => {
|
|
1104
|
-
const { group:
|
|
1104
|
+
const { group: h, groupSize: y } = c, { disableCursor: m, orientation: f, panels: d } = h;
|
|
1105
1105
|
let p = 0;
|
|
1106
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;
|
|
1107
|
-
const g = o.get(
|
|
1107
|
+
const g = o.get(h), {
|
|
1108
1108
|
defaultLayoutDeferred: v,
|
|
1109
|
-
derivedPanelConstraints:
|
|
1109
|
+
derivedPanelConstraints: z,
|
|
1110
1110
|
layout: S,
|
|
1111
|
-
separatorToPanels:
|
|
1112
|
-
} = i.get(
|
|
1113
|
-
if (
|
|
1114
|
-
const
|
|
1111
|
+
separatorToPanels: L
|
|
1112
|
+
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1113
|
+
if (z && g && S && L) {
|
|
1114
|
+
const P = Z({
|
|
1115
1115
|
delta: p,
|
|
1116
1116
|
initialLayout: g,
|
|
1117
|
-
panelConstraints:
|
|
1118
|
-
pivotIndices: c.panels.map((
|
|
1117
|
+
panelConstraints: z,
|
|
1118
|
+
pivotIndices: c.panels.map((b) => d.indexOf(b)),
|
|
1119
1119
|
prevLayout: S,
|
|
1120
1120
|
trigger: "mouse-or-touch"
|
|
1121
1121
|
});
|
|
1122
|
-
if (
|
|
1123
|
-
if (p !== 0 && !
|
|
1122
|
+
if (A(P, S)) {
|
|
1123
|
+
if (p !== 0 && !m)
|
|
1124
1124
|
switch (f) {
|
|
1125
1125
|
case "horizontal": {
|
|
1126
1126
|
s |= p < 0 ? Be : Ke;
|
|
@@ -1134,22 +1134,22 @@ function Ye({
|
|
|
1134
1134
|
} else {
|
|
1135
1135
|
a.set(c.group, {
|
|
1136
1136
|
defaultLayoutDeferred: v,
|
|
1137
|
-
derivedPanelConstraints:
|
|
1138
|
-
layout:
|
|
1139
|
-
separatorToPanels:
|
|
1137
|
+
derivedPanelConstraints: z,
|
|
1138
|
+
layout: P,
|
|
1139
|
+
separatorToPanels: L
|
|
1140
1140
|
});
|
|
1141
|
-
const
|
|
1142
|
-
c.group.inMemoryLayouts[
|
|
1141
|
+
const b = c.group.panels.map(({ id: H }) => H).join(",");
|
|
1142
|
+
c.group.inMemoryLayouts[b] = P;
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
1145
1145
|
});
|
|
1146
1146
|
let u = 0;
|
|
1147
|
-
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({
|
|
1148
1148
|
cursorFlags: u,
|
|
1149
1149
|
mountedGroups: a
|
|
1150
|
-
}),
|
|
1150
|
+
}), pe(e);
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function Ee(e) {
|
|
1153
1153
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
1154
1154
|
switch (n.state) {
|
|
1155
1155
|
case "active":
|
|
@@ -1163,7 +1163,7 @@ function ke(e) {
|
|
|
1163
1163
|
});
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1166
|
+
function ke(e) {
|
|
1167
1167
|
if (e.defaultPrevented)
|
|
1168
1168
|
return;
|
|
1169
1169
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
@@ -1195,7 +1195,7 @@ function Ge(e) {
|
|
|
1195
1195
|
break;
|
|
1196
1196
|
}
|
|
1197
1197
|
default: {
|
|
1198
|
-
const i =
|
|
1198
|
+
const i = de(e, o);
|
|
1199
1199
|
i.length === 0 ? n.state !== "inactive" && M({
|
|
1200
1200
|
interactionState: {
|
|
1201
1201
|
state: "inactive"
|
|
@@ -1205,12 +1205,12 @@ function Ge(e) {
|
|
|
1205
1205
|
hitRegions: i,
|
|
1206
1206
|
state: "hover"
|
|
1207
1207
|
}
|
|
1208
|
-
}),
|
|
1208
|
+
}), pe(e.currentTarget);
|
|
1209
1209
|
break;
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function Ge(e) {
|
|
1214
1214
|
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1215
1215
|
const { interactionState: t } = E();
|
|
1216
1216
|
switch (t.state) {
|
|
@@ -1223,7 +1223,7 @@ function Ie(e) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1226
|
+
function Ie(e) {
|
|
1227
1227
|
if (e.defaultPrevented)
|
|
1228
1228
|
return;
|
|
1229
1229
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
@@ -1236,12 +1236,12 @@ function De(e) {
|
|
|
1236
1236
|
interactionState: {
|
|
1237
1237
|
state: "inactive"
|
|
1238
1238
|
}
|
|
1239
|
-
}), t.hitRegions.length > 0 && (
|
|
1239
|
+
}), t.hitRegions.length > 0 && (pe(e.currentTarget), M((n) => ({
|
|
1240
1240
|
mountedGroups: new Map(n.mountedGroups)
|
|
1241
1241
|
})), e.preventDefault());
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function De(e) {
|
|
1245
1245
|
let t = 0, n = 0;
|
|
1246
1246
|
const o = {};
|
|
1247
1247
|
for (const r of e)
|
|
@@ -1259,19 +1259,19 @@ function Te(e) {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
return o;
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function Ct(e, t, n) {
|
|
1263
1263
|
if (!n[0])
|
|
1264
1264
|
return;
|
|
1265
1265
|
const i = e.panels.find((u) => u.element === t);
|
|
1266
1266
|
if (!i || !i.onResize)
|
|
1267
1267
|
return;
|
|
1268
|
-
const r =
|
|
1268
|
+
const r = U({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1269
1269
|
asPercentage: D(l / r * 100),
|
|
1270
1270
|
inPixels: l
|
|
1271
1271
|
};
|
|
1272
1272
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function Pt(e, t) {
|
|
1275
1275
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1276
1276
|
return !1;
|
|
1277
1277
|
for (const o in e)
|
|
@@ -1279,7 +1279,7 @@ function Et(e, t) {
|
|
|
1279
1279
|
return !1;
|
|
1280
1280
|
return !0;
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function Rt(e, t) {
|
|
1283
1283
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1284
1284
|
if (n.length !== o.length)
|
|
1285
1285
|
return !1;
|
|
@@ -1288,10 +1288,10 @@ function kt(e, t) {
|
|
|
1288
1288
|
return !1;
|
|
1289
1289
|
return !0;
|
|
1290
1290
|
}
|
|
1291
|
-
const
|
|
1292
|
-
function
|
|
1291
|
+
const V = /* @__PURE__ */ new Map();
|
|
1292
|
+
function Mt(e) {
|
|
1293
1293
|
let t = !0;
|
|
1294
|
-
|
|
1294
|
+
x(
|
|
1295
1295
|
e.element.ownerDocument.defaultView,
|
|
1296
1296
|
"Cannot register an unmounted Group"
|
|
1297
1297
|
);
|
|
@@ -1300,107 +1300,107 @@ function Gt(e) {
|
|
|
1300
1300
|
const { borderBoxSize: p, target: g } = d;
|
|
1301
1301
|
if (g === e.element) {
|
|
1302
1302
|
if (t) {
|
|
1303
|
-
if (
|
|
1303
|
+
if (U({ group: e }) === 0)
|
|
1304
1304
|
return;
|
|
1305
|
-
M((
|
|
1306
|
-
const S =
|
|
1305
|
+
M((z) => {
|
|
1306
|
+
const S = z.mountedGroups.get(e);
|
|
1307
1307
|
if (S) {
|
|
1308
|
-
const
|
|
1309
|
-
layout:
|
|
1310
|
-
panelConstraints:
|
|
1308
|
+
const L = Se(e), P = S.defaultLayoutDeferred ? De(L) : S.layout, b = F({
|
|
1309
|
+
layout: P,
|
|
1310
|
+
panelConstraints: L
|
|
1311
1311
|
});
|
|
1312
|
-
return !S.defaultLayoutDeferred &&
|
|
1312
|
+
return !S.defaultLayoutDeferred && A(P, b) && Pt(
|
|
1313
1313
|
S.derivedPanelConstraints,
|
|
1314
|
-
|
|
1315
|
-
) ?
|
|
1316
|
-
mountedGroups: new Map(
|
|
1314
|
+
L
|
|
1315
|
+
) ? z : {
|
|
1316
|
+
mountedGroups: new Map(z.mountedGroups).set(e, {
|
|
1317
1317
|
defaultLayoutDeferred: !1,
|
|
1318
|
-
derivedPanelConstraints:
|
|
1319
|
-
layout:
|
|
1318
|
+
derivedPanelConstraints: L,
|
|
1319
|
+
layout: b,
|
|
1320
1320
|
separatorToPanels: S.separatorToPanels
|
|
1321
1321
|
})
|
|
1322
1322
|
};
|
|
1323
1323
|
}
|
|
1324
|
-
return
|
|
1324
|
+
return z;
|
|
1325
1325
|
});
|
|
1326
1326
|
}
|
|
1327
1327
|
} else
|
|
1328
|
-
|
|
1328
|
+
Ct(e, g, p);
|
|
1329
1329
|
}
|
|
1330
1330
|
});
|
|
1331
1331
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
1332
|
-
|
|
1332
|
+
x(
|
|
1333
1333
|
!o.has(f.id),
|
|
1334
1334
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1335
1335
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1336
1336
|
});
|
|
1337
|
-
const l =
|
|
1337
|
+
const l = U({ group: e }), s = Se(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1338
1338
|
let u = e.defaultLayout;
|
|
1339
|
-
u && (
|
|
1340
|
-
const c = e.inMemoryLayouts[a] ?? u ??
|
|
1339
|
+
u && (Rt(e.panels, u) || (u = void 0));
|
|
1340
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = F({
|
|
1341
1341
|
layout: c,
|
|
1342
1342
|
panelConstraints: s
|
|
1343
|
-
}), y = He(e),
|
|
1343
|
+
}), y = He(e), m = e.element.ownerDocument;
|
|
1344
1344
|
return M((f) => {
|
|
1345
1345
|
const d = /* @__PURE__ */ new Map();
|
|
1346
|
-
return
|
|
1347
|
-
|
|
1348
|
-
(
|
|
1346
|
+
return V.set(
|
|
1347
|
+
m,
|
|
1348
|
+
(V.get(m) ?? 0) + 1
|
|
1349
1349
|
), y.forEach((p) => {
|
|
1350
1350
|
p.separator && d.set(p.separator, p.panels);
|
|
1351
1351
|
}), {
|
|
1352
1352
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1353
1353
|
defaultLayoutDeferred: l === 0,
|
|
1354
1354
|
derivedPanelConstraints: s,
|
|
1355
|
-
layout:
|
|
1355
|
+
layout: h,
|
|
1356
1356
|
separatorToPanels: d
|
|
1357
1357
|
})
|
|
1358
1358
|
};
|
|
1359
1359
|
}), e.separators.forEach((f) => {
|
|
1360
|
-
|
|
1360
|
+
x(
|
|
1361
1361
|
!i.has(f.id),
|
|
1362
1362
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1363
|
-
), i.add(f.id), f.element.addEventListener("keydown",
|
|
1364
|
-
}),
|
|
1365
|
-
t = !1,
|
|
1366
|
-
|
|
1367
|
-
Math.max(0, (
|
|
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(
|
|
1366
|
+
m,
|
|
1367
|
+
Math.max(0, (V.get(m) ?? 0) - 1)
|
|
1368
1368
|
), M((d) => {
|
|
1369
1369
|
const p = new Map(d.mountedGroups);
|
|
1370
1370
|
return p.delete(e), { mountedGroups: p };
|
|
1371
1371
|
}), e.separators.forEach((d) => {
|
|
1372
|
-
d.element.removeEventListener("keydown",
|
|
1373
|
-
}),
|
|
1372
|
+
d.element.removeEventListener("keydown", we);
|
|
1373
|
+
}), V.get(m) || (m.removeEventListener(
|
|
1374
1374
|
"dblclick",
|
|
1375
|
-
|
|
1375
|
+
be,
|
|
1376
1376
|
!0
|
|
1377
|
-
),
|
|
1377
|
+
), m.removeEventListener(
|
|
1378
1378
|
"pointerdown",
|
|
1379
|
-
|
|
1379
|
+
Le,
|
|
1380
1380
|
!0
|
|
1381
|
-
),
|
|
1381
|
+
), m.removeEventListener("pointerleave", Ee), m.removeEventListener("pointermove", ke), m.removeEventListener("pointerout", Ge), m.removeEventListener("pointerup", Ie, !0)), r.disconnect();
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1385
|
-
const [e, t] =
|
|
1384
|
+
function Et() {
|
|
1385
|
+
const [e, t] = J({}), n = X(() => t({}), []);
|
|
1386
1386
|
return [e, n];
|
|
1387
1387
|
}
|
|
1388
1388
|
function me(e) {
|
|
1389
|
-
const t =
|
|
1389
|
+
const t = tt();
|
|
1390
1390
|
return `${e ?? t}`;
|
|
1391
1391
|
}
|
|
1392
|
-
const
|
|
1393
|
-
function
|
|
1392
|
+
const $ = typeof window < "u" ? Oe : Te;
|
|
1393
|
+
function q(e) {
|
|
1394
1394
|
const t = G(e);
|
|
1395
|
-
return
|
|
1395
|
+
return $(() => {
|
|
1396
1396
|
t.current = e;
|
|
1397
|
-
}, [e]),
|
|
1397
|
+
}, [e]), X(
|
|
1398
1398
|
(...n) => t.current?.(...n),
|
|
1399
1399
|
[t]
|
|
1400
1400
|
);
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1402
|
+
function he(...e) {
|
|
1403
|
+
return q((t) => {
|
|
1404
1404
|
e.forEach((n) => {
|
|
1405
1405
|
if (n)
|
|
1406
1406
|
switch (typeof n) {
|
|
@@ -1416,27 +1416,27 @@ function ge(...e) {
|
|
|
1416
1416
|
});
|
|
1417
1417
|
});
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function kt(e) {
|
|
1420
1420
|
const t = G({ ...e });
|
|
1421
|
-
return
|
|
1421
|
+
return $(() => {
|
|
1422
1422
|
for (const n in e)
|
|
1423
1423
|
t.current[n] = e[n];
|
|
1424
1424
|
}, [e]), t.current;
|
|
1425
1425
|
}
|
|
1426
|
-
const Je =
|
|
1427
|
-
function
|
|
1426
|
+
const Je = nt(null);
|
|
1427
|
+
function Gt(e, t) {
|
|
1428
1428
|
const n = G({
|
|
1429
1429
|
getLayout: () => ({}),
|
|
1430
|
-
setLayout:
|
|
1430
|
+
setLayout: wt
|
|
1431
1431
|
});
|
|
1432
|
-
|
|
1432
|
+
Ne(t, () => n.current, []), $(() => {
|
|
1433
1433
|
Object.assign(
|
|
1434
1434
|
n.current,
|
|
1435
|
-
|
|
1435
|
+
We({ groupId: e })
|
|
1436
1436
|
);
|
|
1437
1437
|
});
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function It({
|
|
1440
1440
|
children: e,
|
|
1441
1441
|
className: t,
|
|
1442
1442
|
defaultLayout: n,
|
|
@@ -1448,138 +1448,130 @@ function Tt({
|
|
|
1448
1448
|
onLayoutChange: a,
|
|
1449
1449
|
onLayoutChanged: u,
|
|
1450
1450
|
orientation: c = "horizontal",
|
|
1451
|
-
resizeTargetMinimumSize:
|
|
1451
|
+
resizeTargetMinimumSize: h = {
|
|
1452
1452
|
coarse: 20,
|
|
1453
1453
|
fine: 10
|
|
1454
1454
|
},
|
|
1455
1455
|
style: y,
|
|
1456
|
-
...
|
|
1456
|
+
...m
|
|
1457
1457
|
}) {
|
|
1458
1458
|
const f = G({
|
|
1459
1459
|
onLayoutChange: {},
|
|
1460
1460
|
onLayoutChanged: {}
|
|
1461
|
-
}), d =
|
|
1462
|
-
|
|
1463
|
-
}), p =
|
|
1464
|
-
|
|
1465
|
-
}), g = me(s), v = G(null), [
|
|
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({
|
|
1466
1466
|
lastExpandedPanelSizes: {},
|
|
1467
1467
|
layouts: {},
|
|
1468
1468
|
panels: [],
|
|
1469
|
-
resizeTargetMinimumSize:
|
|
1469
|
+
resizeTargetMinimumSize: h,
|
|
1470
1470
|
separators: []
|
|
1471
|
-
}),
|
|
1472
|
-
|
|
1473
|
-
const
|
|
1474
|
-
(
|
|
1475
|
-
const { interactionState: k, mountedGroups:
|
|
1476
|
-
for (const
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
if (
|
|
1480
|
-
let
|
|
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
1481
|
switch (k.state) {
|
|
1482
1482
|
case "active": {
|
|
1483
|
-
|
|
1484
|
-
(le) => le.group ===
|
|
1483
|
+
te = k.hitRegions.some(
|
|
1484
|
+
(le) => le.group === ee
|
|
1485
1485
|
);
|
|
1486
1486
|
break;
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
1489
|
return {
|
|
1490
|
-
flexGrow:
|
|
1491
|
-
pointerEvents:
|
|
1490
|
+
flexGrow: B.layout[C] ?? 1,
|
|
1491
|
+
pointerEvents: te ? "none" : void 0
|
|
1492
1492
|
};
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
return {
|
|
1496
|
-
flexGrow: n?.[
|
|
1496
|
+
flexGrow: n?.[C] ?? 1
|
|
1497
1497
|
};
|
|
1498
1498
|
}
|
|
1499
|
-
),
|
|
1499
|
+
), H = _e(
|
|
1500
1500
|
() => ({
|
|
1501
|
-
getPanelStyles:
|
|
1501
|
+
getPanelStyles: b,
|
|
1502
1502
|
id: g,
|
|
1503
1503
|
orientation: c,
|
|
1504
|
-
registerPanel: (
|
|
1505
|
-
const
|
|
1506
|
-
return
|
|
1507
|
-
...
|
|
1508
|
-
|
|
1504
|
+
registerPanel: (w) => {
|
|
1505
|
+
const C = L.current;
|
|
1506
|
+
return C.panels = fe(c, [
|
|
1507
|
+
...C.panels,
|
|
1508
|
+
w
|
|
1509
1509
|
]), S(), () => {
|
|
1510
|
-
|
|
1511
|
-
(k) => k !==
|
|
1510
|
+
C.panels = C.panels.filter(
|
|
1511
|
+
(k) => k !== w
|
|
1512
1512
|
), S();
|
|
1513
1513
|
};
|
|
1514
1514
|
},
|
|
1515
|
-
registerSeparator: (
|
|
1516
|
-
const
|
|
1517
|
-
return
|
|
1518
|
-
...
|
|
1519
|
-
|
|
1515
|
+
registerSeparator: (w) => {
|
|
1516
|
+
const C = L.current;
|
|
1517
|
+
return C.separators = fe(c, [
|
|
1518
|
+
...C.separators,
|
|
1519
|
+
w
|
|
1520
1520
|
]), S(), () => {
|
|
1521
|
-
|
|
1522
|
-
(k) => k !==
|
|
1521
|
+
C.separators = C.separators.filter(
|
|
1522
|
+
(k) => k !== w
|
|
1523
1523
|
), S();
|
|
1524
1524
|
};
|
|
1525
1525
|
}
|
|
1526
1526
|
}),
|
|
1527
|
-
[
|
|
1528
|
-
),
|
|
1527
|
+
[b, g, S, c]
|
|
1528
|
+
), N = kt({
|
|
1529
1529
|
defaultLayout: n,
|
|
1530
1530
|
disableCursor: o
|
|
1531
|
-
}),
|
|
1532
|
-
return
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1531
|
+
}), j = G(null);
|
|
1532
|
+
return $(() => {
|
|
1533
|
+
const w = v.current;
|
|
1534
|
+
if (w === null)
|
|
1535
1535
|
return;
|
|
1536
|
-
const
|
|
1537
|
-
defaultLayout:
|
|
1538
|
-
disableCursor: !!
|
|
1536
|
+
const C = L.current, k = {
|
|
1537
|
+
defaultLayout: N.defaultLayout,
|
|
1538
|
+
disableCursor: !!N.disableCursor,
|
|
1539
1539
|
disabled: !!i,
|
|
1540
|
-
element:
|
|
1540
|
+
element: w,
|
|
1541
1541
|
id: g,
|
|
1542
|
-
inMemoryLastExpandedPanelSizes:
|
|
1543
|
-
inMemoryLayouts:
|
|
1542
|
+
inMemoryLastExpandedPanelSizes: L.current.lastExpandedPanelSizes,
|
|
1543
|
+
inMemoryLayouts: L.current.layouts,
|
|
1544
1544
|
orientation: c,
|
|
1545
|
-
panels:
|
|
1546
|
-
resizeTargetMinimumSize:
|
|
1547
|
-
separators:
|
|
1545
|
+
panels: C.panels,
|
|
1546
|
+
resizeTargetMinimumSize: C.resizeTargetMinimumSize,
|
|
1547
|
+
separators: C.separators
|
|
1548
1548
|
};
|
|
1549
|
-
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
const { defaultLayoutDeferred:
|
|
1553
|
-
!
|
|
1554
|
-
ue.scheduleUpdate();
|
|
1555
|
-
}));
|
|
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));
|
|
1556
1554
|
}
|
|
1557
|
-
|
|
1558
|
-
const le = F.addListener(
|
|
1555
|
+
const te = T.addListener(
|
|
1559
1556
|
"interactionStateChange",
|
|
1560
|
-
(
|
|
1561
|
-
|
|
1562
|
-
q !== _ && (q = _, L.panels.forEach((U) => {
|
|
1563
|
-
U.scheduleUpdate();
|
|
1564
|
-
}));
|
|
1557
|
+
(K) => {
|
|
1558
|
+
K.state;
|
|
1565
1559
|
}
|
|
1566
|
-
),
|
|
1560
|
+
), le = T.addListener(
|
|
1567
1561
|
"mountedGroupsChange",
|
|
1568
|
-
(
|
|
1569
|
-
const
|
|
1570
|
-
if (
|
|
1571
|
-
const { defaultLayoutDeferred:
|
|
1572
|
-
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)
|
|
1573
1567
|
return;
|
|
1574
|
-
const { interactionState:
|
|
1575
|
-
d(
|
|
1576
|
-
nt.scheduleUpdate();
|
|
1577
|
-
});
|
|
1568
|
+
const { interactionState: Qe } = E(), et = Qe.state !== "active";
|
|
1569
|
+
d(ye), et && p(ye);
|
|
1578
1570
|
}
|
|
1579
1571
|
}
|
|
1580
1572
|
);
|
|
1581
1573
|
return () => {
|
|
1582
|
-
|
|
1574
|
+
j.current = null, Q(), te(), le();
|
|
1583
1575
|
};
|
|
1584
1576
|
}, [
|
|
1585
1577
|
i,
|
|
@@ -1587,20 +1579,20 @@ function Tt({
|
|
|
1587
1579
|
p,
|
|
1588
1580
|
d,
|
|
1589
1581
|
c,
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
]),
|
|
1593
|
-
const
|
|
1594
|
-
|
|
1595
|
-
}), /* @__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(
|
|
1596
1588
|
"div",
|
|
1597
1589
|
{
|
|
1598
|
-
...
|
|
1590
|
+
...m,
|
|
1599
1591
|
className: t,
|
|
1600
1592
|
"data-group": !0,
|
|
1601
1593
|
"data-testid": g,
|
|
1602
1594
|
id: g,
|
|
1603
|
-
ref:
|
|
1595
|
+
ref: P,
|
|
1604
1596
|
style: {
|
|
1605
1597
|
height: "100%",
|
|
1606
1598
|
width: "100%",
|
|
@@ -1614,49 +1606,49 @@ function Tt({
|
|
|
1614
1606
|
}
|
|
1615
1607
|
) });
|
|
1616
1608
|
}
|
|
1617
|
-
|
|
1618
|
-
function
|
|
1609
|
+
It.displayName = "Group";
|
|
1610
|
+
function ce(e, t) {
|
|
1619
1611
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1620
1612
|
}
|
|
1621
|
-
function
|
|
1613
|
+
function Ht({
|
|
1622
1614
|
debounceSaveMs: e = 100,
|
|
1623
1615
|
panelIds: t,
|
|
1624
1616
|
storage: n = localStorage,
|
|
1625
1617
|
...o
|
|
1626
1618
|
}) {
|
|
1627
|
-
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l =
|
|
1628
|
-
|
|
1619
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = ce(r, t ?? []), s = Ae(
|
|
1620
|
+
Dt,
|
|
1629
1621
|
() => n.getItem(l),
|
|
1630
1622
|
() => n.getItem(l)
|
|
1631
|
-
), a =
|
|
1623
|
+
), a = _e(
|
|
1632
1624
|
() => s ? JSON.parse(s) : void 0,
|
|
1633
1625
|
[s]
|
|
1634
|
-
), u = G(null), c =
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1626
|
+
), u = G(null), c = X(() => {
|
|
1627
|
+
const m = u.current;
|
|
1628
|
+
m && (u.current = null, clearTimeout(m));
|
|
1637
1629
|
}, []);
|
|
1638
1630
|
Oe(() => () => {
|
|
1639
1631
|
c();
|
|
1640
1632
|
}, [c]);
|
|
1641
|
-
const
|
|
1642
|
-
(
|
|
1633
|
+
const h = X(
|
|
1634
|
+
(m) => {
|
|
1643
1635
|
c();
|
|
1644
1636
|
let f;
|
|
1645
|
-
i ? f =
|
|
1637
|
+
i ? f = ce(r, Object.keys(m)) : f = ce(r, []);
|
|
1646
1638
|
try {
|
|
1647
|
-
n.setItem(f, JSON.stringify(
|
|
1639
|
+
n.setItem(f, JSON.stringify(m));
|
|
1648
1640
|
} catch (d) {
|
|
1649
1641
|
console.error(d);
|
|
1650
1642
|
}
|
|
1651
1643
|
},
|
|
1652
1644
|
[c, i, r, n]
|
|
1653
|
-
), y =
|
|
1654
|
-
(
|
|
1655
|
-
c(), e === 0 ? m
|
|
1656
|
-
m
|
|
1645
|
+
), y = X(
|
|
1646
|
+
(m) => {
|
|
1647
|
+
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1648
|
+
h(m);
|
|
1657
1649
|
}, e);
|
|
1658
1650
|
},
|
|
1659
|
-
[c, e,
|
|
1651
|
+
[c, e, h]
|
|
1660
1652
|
);
|
|
1661
1653
|
return {
|
|
1662
1654
|
/**
|
|
@@ -1672,45 +1664,45 @@ function Vt({
|
|
|
1672
1664
|
/**
|
|
1673
1665
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1674
1666
|
*/
|
|
1675
|
-
onLayoutChanged:
|
|
1667
|
+
onLayoutChanged: h
|
|
1676
1668
|
};
|
|
1677
1669
|
}
|
|
1678
|
-
function
|
|
1670
|
+
function Dt() {
|
|
1679
1671
|
return function() {
|
|
1680
1672
|
};
|
|
1681
1673
|
}
|
|
1682
|
-
function
|
|
1683
|
-
return
|
|
1674
|
+
function jt() {
|
|
1675
|
+
return J(null);
|
|
1684
1676
|
}
|
|
1685
|
-
function
|
|
1677
|
+
function Vt() {
|
|
1686
1678
|
return G(null);
|
|
1687
1679
|
}
|
|
1688
|
-
function
|
|
1689
|
-
const e =
|
|
1690
|
-
return
|
|
1680
|
+
function ge() {
|
|
1681
|
+
const e = ot(Je);
|
|
1682
|
+
return x(
|
|
1691
1683
|
e,
|
|
1692
1684
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1693
1685
|
), e;
|
|
1694
1686
|
}
|
|
1695
|
-
function
|
|
1696
|
-
const { id: n } =
|
|
1697
|
-
collapse:
|
|
1698
|
-
expand:
|
|
1687
|
+
function Ot(e, t) {
|
|
1688
|
+
const { id: n } = ge(), o = G({
|
|
1689
|
+
collapse: ue,
|
|
1690
|
+
expand: ue,
|
|
1699
1691
|
getSize: () => ({
|
|
1700
1692
|
asPercentage: 0,
|
|
1701
1693
|
inPixels: 0
|
|
1702
1694
|
}),
|
|
1703
1695
|
isCollapsed: () => !1,
|
|
1704
|
-
resize:
|
|
1696
|
+
resize: ue
|
|
1705
1697
|
});
|
|
1706
|
-
|
|
1698
|
+
Ne(t, () => o.current, []), $(() => {
|
|
1707
1699
|
Object.assign(
|
|
1708
1700
|
o.current,
|
|
1709
1701
|
Ve({ groupId: n, panelId: e })
|
|
1710
1702
|
);
|
|
1711
1703
|
});
|
|
1712
1704
|
}
|
|
1713
|
-
function
|
|
1705
|
+
function Tt({
|
|
1714
1706
|
children: e,
|
|
1715
1707
|
className: t,
|
|
1716
1708
|
collapsedSize: n = "0%",
|
|
@@ -1722,50 +1714,56 @@ function _t({
|
|
|
1722
1714
|
minSize: a = "0%",
|
|
1723
1715
|
onResize: u,
|
|
1724
1716
|
panelRef: c,
|
|
1725
|
-
style:
|
|
1717
|
+
style: h,
|
|
1726
1718
|
...y
|
|
1727
1719
|
}) {
|
|
1728
|
-
const
|
|
1729
|
-
(
|
|
1730
|
-
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);
|
|
1731
1723
|
}
|
|
1732
1724
|
);
|
|
1733
|
-
|
|
1734
|
-
const
|
|
1735
|
-
if (
|
|
1736
|
-
return
|
|
1737
|
-
element:
|
|
1725
|
+
$(() => {
|
|
1726
|
+
const b = d.current;
|
|
1727
|
+
if (b !== null)
|
|
1728
|
+
return z({
|
|
1729
|
+
element: b,
|
|
1738
1730
|
id: f,
|
|
1739
|
-
idIsStable:
|
|
1731
|
+
idIsStable: m,
|
|
1740
1732
|
mutableValues: {
|
|
1741
1733
|
expandToSize: void 0,
|
|
1742
1734
|
prevSize: void 0
|
|
1743
1735
|
},
|
|
1744
|
-
onResize:
|
|
1736
|
+
onResize: S ? L : void 0,
|
|
1745
1737
|
panelConstraints: {
|
|
1746
1738
|
collapsedSize: n,
|
|
1747
1739
|
collapsible: o,
|
|
1748
1740
|
defaultSize: i,
|
|
1749
1741
|
maxSize: s,
|
|
1750
1742
|
minSize: a
|
|
1751
|
-
}
|
|
1752
|
-
scheduleUpdate: g
|
|
1743
|
+
}
|
|
1753
1744
|
});
|
|
1754
1745
|
}, [
|
|
1755
1746
|
n,
|
|
1756
1747
|
o,
|
|
1757
1748
|
i,
|
|
1758
|
-
|
|
1759
|
-
w,
|
|
1749
|
+
S,
|
|
1760
1750
|
f,
|
|
1761
|
-
|
|
1751
|
+
m,
|
|
1762
1752
|
s,
|
|
1763
1753
|
a,
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
]),
|
|
1767
|
-
const P =
|
|
1768
|
-
|
|
1754
|
+
L,
|
|
1755
|
+
z
|
|
1756
|
+
]), Ot(f, c);
|
|
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(
|
|
1769
1767
|
"div",
|
|
1770
1768
|
{
|
|
1771
1769
|
...y,
|
|
@@ -1780,9 +1778,9 @@ function _t({
|
|
|
1780
1778
|
flexShrink: 1,
|
|
1781
1779
|
// Prevent Panel content from interfering with panel size
|
|
1782
1780
|
overflow: "hidden",
|
|
1783
|
-
...P
|
|
1781
|
+
...JSON.parse(P)
|
|
1784
1782
|
},
|
|
1785
|
-
children: /* @__PURE__ */
|
|
1783
|
+
children: /* @__PURE__ */ Y(
|
|
1786
1784
|
"div",
|
|
1787
1785
|
{
|
|
1788
1786
|
className: t,
|
|
@@ -1790,7 +1788,7 @@ function _t({
|
|
|
1790
1788
|
maxHeight: "100%",
|
|
1791
1789
|
maxWidth: "100%",
|
|
1792
1790
|
flexGrow: 1,
|
|
1793
|
-
...
|
|
1791
|
+
...h
|
|
1794
1792
|
},
|
|
1795
1793
|
children: e
|
|
1796
1794
|
}
|
|
@@ -1798,7 +1796,7 @@ function _t({
|
|
|
1798
1796
|
}
|
|
1799
1797
|
);
|
|
1800
1798
|
}
|
|
1801
|
-
|
|
1799
|
+
Tt.displayName = "Panel";
|
|
1802
1800
|
const Nt = {
|
|
1803
1801
|
minHeight: 0,
|
|
1804
1802
|
maxHeight: "100%",
|
|
@@ -1811,13 +1809,13 @@ const Nt = {
|
|
|
1811
1809
|
padding: 0,
|
|
1812
1810
|
margin: 0
|
|
1813
1811
|
};
|
|
1814
|
-
function
|
|
1815
|
-
return
|
|
1812
|
+
function Wt() {
|
|
1813
|
+
return J(null);
|
|
1816
1814
|
}
|
|
1817
|
-
function
|
|
1815
|
+
function Ut() {
|
|
1818
1816
|
return G(null);
|
|
1819
1817
|
}
|
|
1820
|
-
function
|
|
1818
|
+
function _t({
|
|
1821
1819
|
layout: e,
|
|
1822
1820
|
panelConstraints: t,
|
|
1823
1821
|
panelId: n,
|
|
@@ -1829,8 +1827,8 @@ function Ft({
|
|
|
1829
1827
|
);
|
|
1830
1828
|
if (s) {
|
|
1831
1829
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1832
|
-
r =
|
|
1833
|
-
layout:
|
|
1830
|
+
r = F({
|
|
1831
|
+
layout: Z({
|
|
1834
1832
|
delta: u - l,
|
|
1835
1833
|
initialLayout: e,
|
|
1836
1834
|
panelConstraints: t,
|
|
@@ -1838,8 +1836,8 @@ function Ft({
|
|
|
1838
1836
|
prevLayout: e
|
|
1839
1837
|
}),
|
|
1840
1838
|
panelConstraints: t
|
|
1841
|
-
})[n], i =
|
|
1842
|
-
layout:
|
|
1839
|
+
})[n], i = F({
|
|
1840
|
+
layout: Z({
|
|
1843
1841
|
delta: a - l,
|
|
1844
1842
|
initialLayout: e,
|
|
1845
1843
|
panelConstraints: t,
|
|
@@ -1856,7 +1854,7 @@ function Ft({
|
|
|
1856
1854
|
valueNow: l
|
|
1857
1855
|
};
|
|
1858
1856
|
}
|
|
1859
|
-
function
|
|
1857
|
+
function At({
|
|
1860
1858
|
children: e,
|
|
1861
1859
|
className: t,
|
|
1862
1860
|
elementRef: n,
|
|
@@ -1864,40 +1862,40 @@ function $t({
|
|
|
1864
1862
|
style: i,
|
|
1865
1863
|
...r
|
|
1866
1864
|
}) {
|
|
1867
|
-
const l = me(o), [s, a] =
|
|
1868
|
-
id:
|
|
1865
|
+
const l = me(o), [s, a] = J({}), [u, c] = J("inactive"), h = G(null), y = he(h, n), {
|
|
1866
|
+
id: m,
|
|
1869
1867
|
orientation: f,
|
|
1870
1868
|
registerSeparator: d
|
|
1871
|
-
} =
|
|
1872
|
-
return
|
|
1873
|
-
const g =
|
|
1869
|
+
} = ge(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1870
|
+
return $(() => {
|
|
1871
|
+
const g = h.current;
|
|
1874
1872
|
if (g !== null) {
|
|
1875
1873
|
const v = {
|
|
1876
1874
|
element: g,
|
|
1877
1875
|
id: l
|
|
1878
|
-
},
|
|
1876
|
+
}, z = d(v), S = T.addListener(
|
|
1879
1877
|
"interactionStateChange",
|
|
1880
|
-
(
|
|
1878
|
+
(P) => {
|
|
1881
1879
|
c(
|
|
1882
|
-
|
|
1883
|
-
(
|
|
1884
|
-
) ?
|
|
1880
|
+
P.state !== "inactive" && P.hitRegions.some(
|
|
1881
|
+
(b) => b.separator === v
|
|
1882
|
+
) ? P.state : "inactive"
|
|
1885
1883
|
);
|
|
1886
1884
|
}
|
|
1887
|
-
),
|
|
1885
|
+
), L = T.addListener(
|
|
1888
1886
|
"mountedGroupsChange",
|
|
1889
|
-
(
|
|
1890
|
-
|
|
1891
|
-
({ derivedPanelConstraints:
|
|
1892
|
-
if (
|
|
1893
|
-
const
|
|
1894
|
-
if (
|
|
1895
|
-
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);
|
|
1896
1894
|
a(
|
|
1897
|
-
|
|
1898
|
-
layout:
|
|
1899
|
-
panelConstraints:
|
|
1900
|
-
panelId:
|
|
1895
|
+
_t({
|
|
1896
|
+
layout: H,
|
|
1897
|
+
panelConstraints: b,
|
|
1898
|
+
panelId: C.id,
|
|
1901
1899
|
panelIndex: k
|
|
1902
1900
|
})
|
|
1903
1901
|
);
|
|
@@ -1908,10 +1906,10 @@ function $t({
|
|
|
1908
1906
|
}
|
|
1909
1907
|
);
|
|
1910
1908
|
return () => {
|
|
1911
|
-
S(),
|
|
1909
|
+
S(), L(), z();
|
|
1912
1910
|
};
|
|
1913
1911
|
}
|
|
1914
|
-
}, [
|
|
1912
|
+
}, [m, l, d]), /* @__PURE__ */ Y(
|
|
1915
1913
|
"div",
|
|
1916
1914
|
{
|
|
1917
1915
|
...r,
|
|
@@ -1937,16 +1935,16 @@ function $t({
|
|
|
1937
1935
|
}
|
|
1938
1936
|
);
|
|
1939
1937
|
}
|
|
1940
|
-
|
|
1938
|
+
At.displayName = "Separator";
|
|
1941
1939
|
export {
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
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,
|
|
1947
|
+
Wt as usePanelCallbackRef,
|
|
1948
|
+
Ut as usePanelRef
|
|
1951
1949
|
};
|
|
1952
1950
|
//# sourceMappingURL=react-resizable-panels.js.map
|