react-resizable-panels 4.5.8-alpha.0 → 4.5.8
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 J } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Q, useCallback as Y, useId as ot, useLayoutEffect as Oe, useEffect as Ae, useRef as G, createContext as it, useImperativeHandle as _e, useMemo as Ne, useSyncExternalStore as rt, useContext as st } from "react";
|
|
4
|
+
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function B({
|
|
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 de(e, t) {
|
|
15
15
|
return Array.from(t).sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? at : lt
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function at(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 lt(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 ut({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -53,26 +53,26 @@ function st({
|
|
|
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 z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
|
-
function
|
|
59
|
+
function ct() {
|
|
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 = de(
|
|
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 m = o.find(
|
|
71
71
|
(y) => y.element === c
|
|
72
72
|
);
|
|
73
|
-
if (
|
|
73
|
+
if (m) {
|
|
74
74
|
if (a) {
|
|
75
|
-
const y = a.element.getBoundingClientRect(),
|
|
75
|
+
const y = a.element.getBoundingClientRect(), h = 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(h.left, h.top, 0, h.height) : new DOMRect(h.left, h.top, h.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 = ut({
|
|
94
94
|
orientation: n,
|
|
95
|
-
rects: [y,
|
|
95
|
+
rects: [y, h],
|
|
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
|
+
h.top,
|
|
114
|
+
h.left - y.right,
|
|
115
|
+
h.height
|
|
116
116
|
) : new DOMRect(
|
|
117
|
-
|
|
117
|
+
h.left,
|
|
118
118
|
y.bottom,
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
h.width,
|
|
120
|
+
h.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 = ct() ? 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: B({ group: e }),
|
|
147
|
+
panels: [a, m],
|
|
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 = m, u = [];
|
|
154
154
|
}
|
|
155
155
|
} else if (c.hasAttribute("data-separator")) {
|
|
156
|
-
const
|
|
156
|
+
const m = i.find(
|
|
157
157
|
(y) => y.element === c
|
|
158
158
|
);
|
|
159
|
-
|
|
159
|
+
m ? u.push(m) : (a = void 0, u = []);
|
|
160
160
|
} else
|
|
161
161
|
s = !0;
|
|
162
162
|
return l;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function ft(e, t) {
|
|
165
165
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
166
166
|
return t * o;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function dt(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 pt(e) {
|
|
173
173
|
return e / 100 * window.innerHeight;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ht(e) {
|
|
176
176
|
return e / 100 * window.innerWidth;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function mt(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] = mt(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 = dt(t, i);
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
case "em": {
|
|
209
|
-
o =
|
|
209
|
+
o = ft(t, i);
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
212
|
case "vh": {
|
|
213
|
-
o =
|
|
213
|
+
o = pt(i);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
case "vw": {
|
|
217
|
-
o =
|
|
217
|
+
o = ht(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 ve(e) {
|
|
227
|
+
const { panels: t } = e, n = B({ 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 Se(e) {
|
|
|
280
280
|
};
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
class
|
|
283
|
+
class gt {
|
|
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 N = new gt();
|
|
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 && N.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && N.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
|
+
}), N.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function yt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
364
364
|
x: 1 / 0,
|
|
365
365
|
y: 1 / 0
|
|
@@ -382,25 +382,25 @@ function mt(e, t, n) {
|
|
|
382
382
|
hitRegion: o
|
|
383
383
|
} : void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function St(e) {
|
|
386
386
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function vt(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: be(e),
|
|
392
|
+
b: be(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
|
+
z(
|
|
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(xe(n.a)),
|
|
403
|
+
b: ze(xe(n.b))
|
|
404
404
|
};
|
|
405
405
|
if (i.a === i.b) {
|
|
406
406
|
const r = o.childNodes, l = {
|
|
@@ -416,27 +416,27 @@ function gt(e, t) {
|
|
|
416
416
|
}
|
|
417
417
|
return Math.sign(i.a - i.b);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
419
|
+
const xt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
420
|
+
function zt(e) {
|
|
421
421
|
const t = getComputedStyle(je(e) ?? e).display;
|
|
422
422
|
return t === "flex" || t === "inline-flex";
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function bt(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" || zt(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" || xt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function xe(e) {
|
|
429
429
|
let t = e.length;
|
|
430
430
|
for (; t--; ) {
|
|
431
431
|
const n = e[t];
|
|
432
|
-
if (
|
|
432
|
+
if (z(n, "Missing node"), bt(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 be(e) {
|
|
440
440
|
const t = [];
|
|
441
441
|
for (; e; )
|
|
442
442
|
t.push(e), e = je(e);
|
|
@@ -444,47 +444,47 @@ function xe(e) {
|
|
|
444
444
|
}
|
|
445
445
|
function je(e) {
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
|
-
return
|
|
447
|
+
return St(t) ? t.host : t;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function wt(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 Lt({
|
|
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 (vt(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 (wt(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 pe(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 = yt(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 && Lt({
|
|
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 Ct(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 bt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function ee(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 (ee(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
510
|
const l = (n + r) / 2;
|
|
511
|
-
|
|
511
|
+
ee(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 te({
|
|
517
517
|
delta: e,
|
|
518
518
|
initialLayout: t,
|
|
519
519
|
panelConstraints: n,
|
|
@@ -524,13 +524,13 @@ function Z({
|
|
|
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
|
+
z(u != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
|
|
528
|
+
let m = 0;
|
|
529
529
|
switch (r) {
|
|
530
530
|
case "keyboard": {
|
|
531
531
|
{
|
|
532
532
|
const f = e < 0 ? c : u, d = n[f];
|
|
533
|
-
|
|
533
|
+
z(
|
|
534
534
|
d,
|
|
535
535
|
`Panel constraints not found for index ${f}`
|
|
536
536
|
);
|
|
@@ -540,19 +540,19 @@ function Z({
|
|
|
540
540
|
minSize: v = 0
|
|
541
541
|
} = d;
|
|
542
542
|
if (g) {
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
|
|
543
|
+
const x = l[f];
|
|
544
|
+
if (z(
|
|
545
|
+
x != null,
|
|
546
546
|
`Previous layout not found for panel index ${f}`
|
|
547
|
-
), R(
|
|
548
|
-
const S = v -
|
|
549
|
-
|
|
547
|
+
), R(x, p)) {
|
|
548
|
+
const S = v - x;
|
|
549
|
+
ee(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
|
+
z(
|
|
556
556
|
d,
|
|
557
557
|
`No panel constraints found for index ${f}`
|
|
558
558
|
);
|
|
@@ -562,42 +562,25 @@ function Z({
|
|
|
562
562
|
minSize: v = 0
|
|
563
563
|
} = d;
|
|
564
564
|
if (g) {
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
567
|
-
|
|
565
|
+
const x = l[f];
|
|
566
|
+
if (z(
|
|
567
|
+
x != null,
|
|
568
568
|
`Previous layout not found for panel index ${f}`
|
|
569
|
-
), R(
|
|
570
|
-
const S =
|
|
571
|
-
|
|
569
|
+
), R(x, v)) {
|
|
570
|
+
const S = x - p;
|
|
571
|
+
ee(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
|
-
}
|
|
594
577
|
}
|
|
595
578
|
{
|
|
596
579
|
const f = e < 0 ? 1 : -1;
|
|
597
580
|
let d = e < 0 ? c : u, p = 0;
|
|
598
581
|
for (; ; ) {
|
|
599
582
|
const v = l[d];
|
|
600
|
-
|
|
583
|
+
z(
|
|
601
584
|
v != null,
|
|
602
585
|
`Previous layout not found for panel index ${d}`
|
|
603
586
|
);
|
|
@@ -614,47 +597,47 @@ function Z({
|
|
|
614
597
|
{
|
|
615
598
|
let d = e < 0 ? u : c;
|
|
616
599
|
for (; d >= 0 && d < n.length; ) {
|
|
617
|
-
const p = Math.abs(e) - Math.abs(
|
|
618
|
-
|
|
600
|
+
const p = Math.abs(e) - Math.abs(m), g = l[d];
|
|
601
|
+
z(
|
|
619
602
|
g != null,
|
|
620
603
|
`Previous layout not found for panel index ${d}`
|
|
621
604
|
);
|
|
622
|
-
const v = g - p,
|
|
605
|
+
const v = g - p, x = W({
|
|
623
606
|
panelConstraints: n[d],
|
|
624
607
|
size: v
|
|
625
608
|
});
|
|
626
|
-
if (!R(g,
|
|
609
|
+
if (!R(g, x) && (m += g - x, a[d] = x, m.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
627
610
|
numeric: !0
|
|
628
611
|
}) >= 0))
|
|
629
612
|
break;
|
|
630
613
|
e < 0 ? d-- : d++;
|
|
631
614
|
}
|
|
632
615
|
}
|
|
633
|
-
if (
|
|
616
|
+
if (Ct(s, a))
|
|
634
617
|
return i;
|
|
635
618
|
{
|
|
636
619
|
const f = e < 0 ? c : u, d = l[f];
|
|
637
|
-
|
|
620
|
+
z(
|
|
638
621
|
d != null,
|
|
639
622
|
`Previous layout not found for panel index ${f}`
|
|
640
623
|
);
|
|
641
|
-
const p = d +
|
|
624
|
+
const p = d + m, g = W({
|
|
642
625
|
panelConstraints: n[f],
|
|
643
626
|
size: p
|
|
644
627
|
});
|
|
645
628
|
if (a[f] = g, !R(g, p)) {
|
|
646
629
|
let v = p - g, S = e < 0 ? c : u;
|
|
647
630
|
for (; S >= 0 && S < n.length; ) {
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
631
|
+
const w = a[S];
|
|
632
|
+
z(
|
|
633
|
+
w != null,
|
|
651
634
|
`Previous layout not found for panel index ${S}`
|
|
652
635
|
);
|
|
653
|
-
const
|
|
636
|
+
const C = w + v, P = W({
|
|
654
637
|
panelConstraints: n[S],
|
|
655
|
-
size:
|
|
638
|
+
size: C
|
|
656
639
|
});
|
|
657
|
-
if (R(
|
|
640
|
+
if (R(w, P) || (v -= P - w, a[S] = P), R(v, 0))
|
|
658
641
|
break;
|
|
659
642
|
e > 0 ? S-- : S++;
|
|
660
643
|
}
|
|
@@ -666,18 +649,18 @@ function Z({
|
|
|
666
649
|
);
|
|
667
650
|
if (!R(y, 100, 0.1))
|
|
668
651
|
return i;
|
|
669
|
-
const
|
|
670
|
-
return a.reduce((f, d, p) => (f[
|
|
652
|
+
const h = Object.keys(i);
|
|
653
|
+
return a.reduce((f, d, p) => (f[h[p]] = d, f), {});
|
|
671
654
|
}
|
|
672
|
-
function
|
|
655
|
+
function F(e, t) {
|
|
673
656
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
674
657
|
return !1;
|
|
675
658
|
for (const n in e)
|
|
676
|
-
if (t[n] === void 0 ||
|
|
659
|
+
if (t[n] === void 0 || ee(e[n], t[n]) !== 0)
|
|
677
660
|
return !1;
|
|
678
661
|
return !0;
|
|
679
662
|
}
|
|
680
|
-
function
|
|
663
|
+
function $({
|
|
681
664
|
layout: e,
|
|
682
665
|
panelConstraints: t
|
|
683
666
|
}) {
|
|
@@ -692,14 +675,14 @@ function F({
|
|
|
692
675
|
if (!R(i, 100) && o.length > 0)
|
|
693
676
|
for (let s = 0; s < t.length; s++) {
|
|
694
677
|
const a = o[s];
|
|
695
|
-
|
|
678
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
696
679
|
const u = 100 / i * a;
|
|
697
680
|
o[s] = u;
|
|
698
681
|
}
|
|
699
682
|
let r = 0;
|
|
700
683
|
for (let s = 0; s < t.length; s++) {
|
|
701
684
|
const a = o[s];
|
|
702
|
-
|
|
685
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
703
686
|
const u = W({
|
|
704
687
|
panelConstraints: t[s],
|
|
705
688
|
size: a
|
|
@@ -709,7 +692,7 @@ function F({
|
|
|
709
692
|
if (!R(r, 0))
|
|
710
693
|
for (let s = 0; s < t.length; s++) {
|
|
711
694
|
const a = o[s];
|
|
712
|
-
|
|
695
|
+
z(a != null, `No layout data found for index ${s}`);
|
|
713
696
|
const u = a + r, c = W({
|
|
714
697
|
panelConstraints: t[s],
|
|
715
698
|
size: u
|
|
@@ -731,7 +714,7 @@ function Ve({
|
|
|
731
714
|
{
|
|
732
715
|
defaultLayoutDeferred: u,
|
|
733
716
|
derivedPanelConstraints: c,
|
|
734
|
-
layout:
|
|
717
|
+
layout: m,
|
|
735
718
|
separatorToPanels: y
|
|
736
719
|
}
|
|
737
720
|
] of s)
|
|
@@ -740,7 +723,7 @@ function Ve({
|
|
|
740
723
|
defaultLayoutDeferred: u,
|
|
741
724
|
derivedPanelConstraints: c,
|
|
742
725
|
group: a,
|
|
743
|
-
layout:
|
|
726
|
+
layout: m,
|
|
744
727
|
separatorToPanels: y
|
|
745
728
|
};
|
|
746
729
|
throw Error(`Group ${e} not found`);
|
|
@@ -768,26 +751,26 @@ function Ve({
|
|
|
768
751
|
const {
|
|
769
752
|
defaultLayoutDeferred: u,
|
|
770
753
|
derivedPanelConstraints: c,
|
|
771
|
-
group:
|
|
754
|
+
group: m,
|
|
772
755
|
layout: y,
|
|
773
|
-
separatorToPanels:
|
|
774
|
-
} = n(), f =
|
|
756
|
+
separatorToPanels: h
|
|
757
|
+
} = n(), f = m.panels.findIndex((v) => v.id === t), d = f === m.panels.length - 1, p = te({
|
|
775
758
|
delta: d ? a - s : s - a,
|
|
776
759
|
initialLayout: y,
|
|
777
760
|
panelConstraints: c,
|
|
778
761
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
779
762
|
prevLayout: y,
|
|
780
763
|
trigger: "imperative-api"
|
|
781
|
-
}), g =
|
|
764
|
+
}), g = $({
|
|
782
765
|
layout: p,
|
|
783
766
|
panelConstraints: c
|
|
784
767
|
});
|
|
785
|
-
|
|
786
|
-
mountedGroups: new Map(v.mountedGroups).set(
|
|
768
|
+
F(y, g) || M((v) => ({
|
|
769
|
+
mountedGroups: new Map(v.mountedGroups).set(m, {
|
|
787
770
|
defaultLayoutDeferred: u,
|
|
788
771
|
derivedPanelConstraints: c,
|
|
789
772
|
layout: g,
|
|
790
|
-
separatorToPanels:
|
|
773
|
+
separatorToPanels: h
|
|
791
774
|
})
|
|
792
775
|
}));
|
|
793
776
|
};
|
|
@@ -797,8 +780,8 @@ function Ve({
|
|
|
797
780
|
s && c !== a && (u.expandToSize = c, l(a));
|
|
798
781
|
},
|
|
799
782
|
expand: () => {
|
|
800
|
-
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(),
|
|
801
|
-
if (s &&
|
|
783
|
+
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), m = r();
|
|
784
|
+
if (s && m === a) {
|
|
802
785
|
let y = c.expandToSize ?? u;
|
|
803
786
|
y === 0 && (y = 1), l(y);
|
|
804
787
|
}
|
|
@@ -819,8 +802,8 @@ function Ve({
|
|
|
819
802
|
let u;
|
|
820
803
|
switch (typeof s) {
|
|
821
804
|
case "number": {
|
|
822
|
-
const { group: c } = n(),
|
|
823
|
-
u = D(s /
|
|
805
|
+
const { group: c } = n(), m = B({ group: c });
|
|
806
|
+
u = D(s / m * 100);
|
|
824
807
|
break;
|
|
825
808
|
}
|
|
826
809
|
case "string": {
|
|
@@ -833,11 +816,11 @@ function Ve({
|
|
|
833
816
|
}
|
|
834
817
|
};
|
|
835
818
|
}
|
|
836
|
-
function
|
|
819
|
+
function we(e) {
|
|
837
820
|
if (e.defaultPrevented)
|
|
838
821
|
return;
|
|
839
822
|
const { mountedGroups: t } = E();
|
|
840
|
-
|
|
823
|
+
pe(e, t).forEach((o) => {
|
|
841
824
|
if (o.separator) {
|
|
842
825
|
const i = o.panels.find(
|
|
843
826
|
(r) => r.panelConstraints.defaultSize !== void 0
|
|
@@ -861,7 +844,7 @@ function ae(e) {
|
|
|
861
844
|
return n;
|
|
862
845
|
throw Error("Could not find parent Group for separator element");
|
|
863
846
|
}
|
|
864
|
-
function
|
|
847
|
+
function Ue({
|
|
865
848
|
groupId: e
|
|
866
849
|
}) {
|
|
867
850
|
const t = () => {
|
|
@@ -883,11 +866,11 @@ function We({
|
|
|
883
866
|
group: r,
|
|
884
867
|
layout: l,
|
|
885
868
|
separatorToPanels: s
|
|
886
|
-
} = t(), a =
|
|
869
|
+
} = t(), a = $({
|
|
887
870
|
layout: n,
|
|
888
871
|
panelConstraints: i
|
|
889
872
|
});
|
|
890
|
-
return o ? l : (
|
|
873
|
+
return o ? l : (F(l, a) || M((u) => ({
|
|
891
874
|
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
892
875
|
defaultLayoutDeferred: o,
|
|
893
876
|
derivedPanelConstraints: i,
|
|
@@ -898,30 +881,30 @@ function We({
|
|
|
898
881
|
}
|
|
899
882
|
};
|
|
900
883
|
}
|
|
901
|
-
function
|
|
884
|
+
function We(e) {
|
|
902
885
|
const { mountedGroups: t } = E(), n = t.get(e);
|
|
903
|
-
return
|
|
886
|
+
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
904
887
|
}
|
|
905
888
|
function _(e, t) {
|
|
906
|
-
const n = ae(e), o =
|
|
907
|
-
(
|
|
889
|
+
const n = ae(e), o = We(n), i = n.separators.find(
|
|
890
|
+
(m) => m.element === e
|
|
908
891
|
);
|
|
909
|
-
|
|
892
|
+
z(i, "Matching separator not found");
|
|
910
893
|
const r = o.separatorToPanels.get(i);
|
|
911
|
-
|
|
912
|
-
const l = r.map((
|
|
894
|
+
z(r, "Matching panels not found");
|
|
895
|
+
const l = r.map((m) => n.panels.indexOf(m)), a = Ue({ groupId: n.id }).getLayout(), u = te({
|
|
913
896
|
delta: t,
|
|
914
897
|
initialLayout: a,
|
|
915
898
|
panelConstraints: o.derivedPanelConstraints,
|
|
916
899
|
pivotIndices: l,
|
|
917
900
|
prevLayout: a,
|
|
918
901
|
trigger: "keyboard"
|
|
919
|
-
}), c =
|
|
902
|
+
}), c = $({
|
|
920
903
|
layout: u,
|
|
921
904
|
panelConstraints: o.derivedPanelConstraints
|
|
922
905
|
});
|
|
923
|
-
|
|
924
|
-
mountedGroups: new Map(
|
|
906
|
+
F(a, c) || M((m) => ({
|
|
907
|
+
mountedGroups: new Map(m.mountedGroups).set(n, {
|
|
925
908
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
926
909
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
927
910
|
layout: c,
|
|
@@ -929,7 +912,7 @@ function _(e, t) {
|
|
|
929
912
|
})
|
|
930
913
|
}));
|
|
931
914
|
}
|
|
932
|
-
function
|
|
915
|
+
function Le(e) {
|
|
933
916
|
if (e.defaultPrevented)
|
|
934
917
|
return;
|
|
935
918
|
const t = e.currentTarget, n = ae(t);
|
|
@@ -957,18 +940,18 @@ function we(e) {
|
|
|
957
940
|
}
|
|
958
941
|
case "Enter": {
|
|
959
942
|
e.preventDefault();
|
|
960
|
-
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } =
|
|
961
|
-
(
|
|
943
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = We(o), s = o.separators.find(
|
|
944
|
+
(m) => m.element === t
|
|
962
945
|
);
|
|
963
|
-
|
|
946
|
+
z(s, "Matching separator not found");
|
|
964
947
|
const a = l.get(s);
|
|
965
|
-
|
|
948
|
+
z(a, "Matching panels not found");
|
|
966
949
|
const u = a[0], c = i.find(
|
|
967
|
-
(
|
|
950
|
+
(m) => m.panelId === u.id
|
|
968
951
|
);
|
|
969
|
-
if (
|
|
970
|
-
const
|
|
971
|
-
_(t, y -
|
|
952
|
+
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
953
|
+
const m = r[u.id], y = c.collapsedSize === m ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
954
|
+
_(t, y - m);
|
|
972
955
|
}
|
|
973
956
|
break;
|
|
974
957
|
}
|
|
@@ -979,7 +962,7 @@ function we(e) {
|
|
|
979
962
|
), r = Array.from(i).findIndex(
|
|
980
963
|
(a) => a === e.currentTarget
|
|
981
964
|
);
|
|
982
|
-
|
|
965
|
+
z(r !== null, "Index not found");
|
|
983
966
|
const l = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
|
|
984
967
|
i[l].focus();
|
|
985
968
|
break;
|
|
@@ -990,12 +973,12 @@ function we(e) {
|
|
|
990
973
|
}
|
|
991
974
|
}
|
|
992
975
|
}
|
|
993
|
-
function
|
|
976
|
+
function Ce(e) {
|
|
994
977
|
if (e.defaultPrevented)
|
|
995
978
|
return;
|
|
996
979
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
997
980
|
return;
|
|
998
|
-
const { mountedGroups: t } = E(), n =
|
|
981
|
+
const { mountedGroups: t } = E(), n = pe(e, t), o = /* @__PURE__ */ new Map();
|
|
999
982
|
let i = !1;
|
|
1000
983
|
n.forEach((r) => {
|
|
1001
984
|
r.separator && (i || (i = !0, r.separator.element.focus()));
|
|
@@ -1010,13 +993,13 @@ function Le(e) {
|
|
|
1010
993
|
}
|
|
1011
994
|
}), n.length && e.preventDefault();
|
|
1012
995
|
}
|
|
1013
|
-
const
|
|
1014
|
-
}, Be = 1, Ke = 2, Xe = 4, qe = 8,
|
|
996
|
+
const Pt = (e) => e, ce = () => {
|
|
997
|
+
}, Be = 1, Ke = 2, Xe = 4, qe = 8, Pe = 3, Re = 12;
|
|
1015
998
|
let se;
|
|
1016
|
-
function
|
|
999
|
+
function Me() {
|
|
1017
1000
|
return se === void 0 && (se = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (se = !0)), se;
|
|
1018
1001
|
}
|
|
1019
|
-
function
|
|
1002
|
+
function Rt({
|
|
1020
1003
|
cursorFlags: e,
|
|
1021
1004
|
groups: t,
|
|
1022
1005
|
state: n
|
|
@@ -1043,7 +1026,7 @@ function Lt({
|
|
|
1043
1026
|
return null;
|
|
1044
1027
|
switch (n) {
|
|
1045
1028
|
case "active": {
|
|
1046
|
-
if (e &&
|
|
1029
|
+
if (e && Me()) {
|
|
1047
1030
|
const r = (e & Be) !== 0, l = (e & Ke) !== 0, s = (e & Xe) !== 0, a = (e & qe) !== 0;
|
|
1048
1031
|
if (r)
|
|
1049
1032
|
return s ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
@@ -1057,19 +1040,19 @@ function Lt({
|
|
|
1057
1040
|
break;
|
|
1058
1041
|
}
|
|
1059
1042
|
}
|
|
1060
|
-
return
|
|
1043
|
+
return Me() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1061
1044
|
}
|
|
1062
|
-
const
|
|
1063
|
-
function
|
|
1045
|
+
const Ee = /* @__PURE__ */ new WeakMap();
|
|
1046
|
+
function he(e) {
|
|
1064
1047
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1065
1048
|
return;
|
|
1066
|
-
let { prevStyle: t, styleSheet: n } =
|
|
1049
|
+
let { prevStyle: t, styleSheet: n } = Ee.get(e) ?? {};
|
|
1067
1050
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1068
1051
|
const { cursorFlags: o, interactionState: i } = E();
|
|
1069
1052
|
switch (i.state) {
|
|
1070
1053
|
case "active":
|
|
1071
1054
|
case "hover": {
|
|
1072
|
-
const r =
|
|
1055
|
+
const r = Rt({
|
|
1073
1056
|
cursorFlags: o,
|
|
1074
1057
|
groups: i.hitRegions.map((s) => s.group),
|
|
1075
1058
|
state: i.state
|
|
@@ -1084,7 +1067,7 @@ function pe(e) {
|
|
|
1084
1067
|
break;
|
|
1085
1068
|
}
|
|
1086
1069
|
}
|
|
1087
|
-
|
|
1070
|
+
Ee.set(e, {
|
|
1088
1071
|
prevStyle: t,
|
|
1089
1072
|
styleSheet: n
|
|
1090
1073
|
});
|
|
@@ -1101,26 +1084,26 @@ function Ye({
|
|
|
1101
1084
|
let s = 0;
|
|
1102
1085
|
const a = new Map(i);
|
|
1103
1086
|
n.forEach((c) => {
|
|
1104
|
-
const { group:
|
|
1087
|
+
const { group: m, groupSize: y } = c, { disableCursor: h, orientation: f, panels: d } = m;
|
|
1105
1088
|
let p = 0;
|
|
1106
1089
|
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(
|
|
1090
|
+
const g = o.get(m), {
|
|
1108
1091
|
defaultLayoutDeferred: v,
|
|
1109
|
-
derivedPanelConstraints:
|
|
1092
|
+
derivedPanelConstraints: x,
|
|
1110
1093
|
layout: S,
|
|
1111
|
-
separatorToPanels:
|
|
1112
|
-
} = i.get(
|
|
1113
|
-
if (
|
|
1114
|
-
const
|
|
1094
|
+
separatorToPanels: w
|
|
1095
|
+
} = i.get(m) ?? { defaultLayoutDeferred: !1 };
|
|
1096
|
+
if (x && g && S && w) {
|
|
1097
|
+
const C = te({
|
|
1115
1098
|
delta: p,
|
|
1116
1099
|
initialLayout: g,
|
|
1117
|
-
panelConstraints:
|
|
1118
|
-
pivotIndices: c.panels.map((
|
|
1100
|
+
panelConstraints: x,
|
|
1101
|
+
pivotIndices: c.panels.map((P) => d.indexOf(P)),
|
|
1119
1102
|
prevLayout: S,
|
|
1120
1103
|
trigger: "mouse-or-touch"
|
|
1121
1104
|
});
|
|
1122
|
-
if (
|
|
1123
|
-
if (p !== 0 && !
|
|
1105
|
+
if (F(C, S)) {
|
|
1106
|
+
if (p !== 0 && !h)
|
|
1124
1107
|
switch (f) {
|
|
1125
1108
|
case "horizontal": {
|
|
1126
1109
|
s |= p < 0 ? Be : Ke;
|
|
@@ -1134,22 +1117,22 @@ function Ye({
|
|
|
1134
1117
|
} else {
|
|
1135
1118
|
a.set(c.group, {
|
|
1136
1119
|
defaultLayoutDeferred: v,
|
|
1137
|
-
derivedPanelConstraints:
|
|
1138
|
-
layout:
|
|
1139
|
-
separatorToPanels:
|
|
1120
|
+
derivedPanelConstraints: x,
|
|
1121
|
+
layout: C,
|
|
1122
|
+
separatorToPanels: w
|
|
1140
1123
|
});
|
|
1141
|
-
const
|
|
1142
|
-
c.group.inMemoryLayouts[
|
|
1124
|
+
const P = c.group.panels.map(({ id: T }) => T).join(",");
|
|
1125
|
+
c.group.inMemoryLayouts[P] = C;
|
|
1143
1126
|
}
|
|
1144
1127
|
}
|
|
1145
1128
|
});
|
|
1146
1129
|
let u = 0;
|
|
1147
|
-
t.movementX === 0 ? u |= l &
|
|
1130
|
+
t.movementX === 0 ? u |= l & Pe : u |= s & Pe, t.movementY === 0 ? u |= l & Re : u |= s & Re, M({
|
|
1148
1131
|
cursorFlags: u,
|
|
1149
1132
|
mountedGroups: a
|
|
1150
|
-
}),
|
|
1133
|
+
}), he(e);
|
|
1151
1134
|
}
|
|
1152
|
-
function
|
|
1135
|
+
function ke(e) {
|
|
1153
1136
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
1154
1137
|
switch (n.state) {
|
|
1155
1138
|
case "active":
|
|
@@ -1163,7 +1146,7 @@ function Ee(e) {
|
|
|
1163
1146
|
});
|
|
1164
1147
|
}
|
|
1165
1148
|
}
|
|
1166
|
-
function
|
|
1149
|
+
function Ge(e) {
|
|
1167
1150
|
if (e.defaultPrevented)
|
|
1168
1151
|
return;
|
|
1169
1152
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
@@ -1195,7 +1178,7 @@ function ke(e) {
|
|
|
1195
1178
|
break;
|
|
1196
1179
|
}
|
|
1197
1180
|
default: {
|
|
1198
|
-
const i =
|
|
1181
|
+
const i = pe(e, o);
|
|
1199
1182
|
i.length === 0 ? n.state !== "inactive" && M({
|
|
1200
1183
|
interactionState: {
|
|
1201
1184
|
state: "inactive"
|
|
@@ -1205,12 +1188,12 @@ function ke(e) {
|
|
|
1205
1188
|
hitRegions: i,
|
|
1206
1189
|
state: "hover"
|
|
1207
1190
|
}
|
|
1208
|
-
}),
|
|
1191
|
+
}), he(e.currentTarget);
|
|
1209
1192
|
break;
|
|
1210
1193
|
}
|
|
1211
1194
|
}
|
|
1212
1195
|
}
|
|
1213
|
-
function
|
|
1196
|
+
function Ie(e) {
|
|
1214
1197
|
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1215
1198
|
const { interactionState: t } = E();
|
|
1216
1199
|
switch (t.state) {
|
|
@@ -1223,7 +1206,7 @@ function Ge(e) {
|
|
|
1223
1206
|
}
|
|
1224
1207
|
}
|
|
1225
1208
|
}
|
|
1226
|
-
function
|
|
1209
|
+
function De(e) {
|
|
1227
1210
|
if (e.defaultPrevented)
|
|
1228
1211
|
return;
|
|
1229
1212
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
@@ -1236,12 +1219,12 @@ function Ie(e) {
|
|
|
1236
1219
|
interactionState: {
|
|
1237
1220
|
state: "inactive"
|
|
1238
1221
|
}
|
|
1239
|
-
}), t.hitRegions.length > 0 && (
|
|
1222
|
+
}), t.hitRegions.length > 0 && (he(e.currentTarget), M((n) => ({
|
|
1240
1223
|
mountedGroups: new Map(n.mountedGroups)
|
|
1241
1224
|
})), e.preventDefault());
|
|
1242
1225
|
}
|
|
1243
1226
|
}
|
|
1244
|
-
function
|
|
1227
|
+
function Te(e) {
|
|
1245
1228
|
let t = 0, n = 0;
|
|
1246
1229
|
const o = {};
|
|
1247
1230
|
for (const r of e)
|
|
@@ -1259,19 +1242,19 @@ function De(e) {
|
|
|
1259
1242
|
}
|
|
1260
1243
|
return o;
|
|
1261
1244
|
}
|
|
1262
|
-
function
|
|
1245
|
+
function Mt(e, t, n) {
|
|
1263
1246
|
if (!n[0])
|
|
1264
1247
|
return;
|
|
1265
1248
|
const i = e.panels.find((u) => u.element === t);
|
|
1266
1249
|
if (!i || !i.onResize)
|
|
1267
1250
|
return;
|
|
1268
|
-
const r =
|
|
1251
|
+
const r = B({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1269
1252
|
asPercentage: D(l / r * 100),
|
|
1270
1253
|
inPixels: l
|
|
1271
1254
|
};
|
|
1272
1255
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
1273
1256
|
}
|
|
1274
|
-
function
|
|
1257
|
+
function Et(e, t) {
|
|
1275
1258
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1276
1259
|
return !1;
|
|
1277
1260
|
for (const o in e)
|
|
@@ -1279,7 +1262,7 @@ function Pt(e, t) {
|
|
|
1279
1262
|
return !1;
|
|
1280
1263
|
return !0;
|
|
1281
1264
|
}
|
|
1282
|
-
function
|
|
1265
|
+
function kt(e, t) {
|
|
1283
1266
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1284
1267
|
if (n.length !== o.length)
|
|
1285
1268
|
return !1;
|
|
@@ -1288,10 +1271,10 @@ function Rt(e, t) {
|
|
|
1288
1271
|
return !1;
|
|
1289
1272
|
return !0;
|
|
1290
1273
|
}
|
|
1291
|
-
const
|
|
1292
|
-
function
|
|
1274
|
+
const U = /* @__PURE__ */ new Map();
|
|
1275
|
+
function Gt(e) {
|
|
1293
1276
|
let t = !0;
|
|
1294
|
-
|
|
1277
|
+
z(
|
|
1295
1278
|
e.element.ownerDocument.defaultView,
|
|
1296
1279
|
"Cannot register an unmounted Group"
|
|
1297
1280
|
);
|
|
@@ -1300,107 +1283,107 @@ function Mt(e) {
|
|
|
1300
1283
|
const { borderBoxSize: p, target: g } = d;
|
|
1301
1284
|
if (g === e.element) {
|
|
1302
1285
|
if (t) {
|
|
1303
|
-
if (
|
|
1286
|
+
if (B({ group: e }) === 0)
|
|
1304
1287
|
return;
|
|
1305
|
-
M((
|
|
1306
|
-
const S =
|
|
1288
|
+
M((x) => {
|
|
1289
|
+
const S = x.mountedGroups.get(e);
|
|
1307
1290
|
if (S) {
|
|
1308
|
-
const
|
|
1309
|
-
layout:
|
|
1310
|
-
panelConstraints:
|
|
1291
|
+
const w = ve(e), C = S.defaultLayoutDeferred ? Te(w) : S.layout, P = $({
|
|
1292
|
+
layout: C,
|
|
1293
|
+
panelConstraints: w
|
|
1311
1294
|
});
|
|
1312
|
-
return !S.defaultLayoutDeferred &&
|
|
1295
|
+
return !S.defaultLayoutDeferred && F(C, P) && Et(
|
|
1313
1296
|
S.derivedPanelConstraints,
|
|
1314
|
-
|
|
1315
|
-
) ?
|
|
1316
|
-
mountedGroups: new Map(
|
|
1297
|
+
w
|
|
1298
|
+
) ? x : {
|
|
1299
|
+
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1317
1300
|
defaultLayoutDeferred: !1,
|
|
1318
|
-
derivedPanelConstraints:
|
|
1319
|
-
layout:
|
|
1301
|
+
derivedPanelConstraints: w,
|
|
1302
|
+
layout: P,
|
|
1320
1303
|
separatorToPanels: S.separatorToPanels
|
|
1321
1304
|
})
|
|
1322
1305
|
};
|
|
1323
1306
|
}
|
|
1324
|
-
return
|
|
1307
|
+
return x;
|
|
1325
1308
|
});
|
|
1326
1309
|
}
|
|
1327
1310
|
} else
|
|
1328
|
-
|
|
1311
|
+
Mt(e, g, p);
|
|
1329
1312
|
}
|
|
1330
1313
|
});
|
|
1331
1314
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
1332
|
-
|
|
1315
|
+
z(
|
|
1333
1316
|
!o.has(f.id),
|
|
1334
1317
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1335
1318
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1336
1319
|
});
|
|
1337
|
-
const l =
|
|
1320
|
+
const l = B({ group: e }), s = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1338
1321
|
let u = e.defaultLayout;
|
|
1339
|
-
u && (
|
|
1340
|
-
const c = e.inMemoryLayouts[a] ?? u ??
|
|
1322
|
+
u && (kt(e.panels, u) || (u = void 0));
|
|
1323
|
+
const c = e.inMemoryLayouts[a] ?? u ?? Te(s), m = $({
|
|
1341
1324
|
layout: c,
|
|
1342
1325
|
panelConstraints: s
|
|
1343
|
-
}), y = He(e),
|
|
1326
|
+
}), y = He(e), h = e.element.ownerDocument;
|
|
1344
1327
|
return M((f) => {
|
|
1345
1328
|
const d = /* @__PURE__ */ new Map();
|
|
1346
|
-
return
|
|
1347
|
-
|
|
1348
|
-
(
|
|
1329
|
+
return U.set(
|
|
1330
|
+
h,
|
|
1331
|
+
(U.get(h) ?? 0) + 1
|
|
1349
1332
|
), y.forEach((p) => {
|
|
1350
1333
|
p.separator && d.set(p.separator, p.panels);
|
|
1351
1334
|
}), {
|
|
1352
1335
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1353
1336
|
defaultLayoutDeferred: l === 0,
|
|
1354
1337
|
derivedPanelConstraints: s,
|
|
1355
|
-
layout:
|
|
1338
|
+
layout: m,
|
|
1356
1339
|
separatorToPanels: d
|
|
1357
1340
|
})
|
|
1358
1341
|
};
|
|
1359
1342
|
}), e.separators.forEach((f) => {
|
|
1360
|
-
|
|
1343
|
+
z(
|
|
1361
1344
|
!i.has(f.id),
|
|
1362
1345
|
`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, (
|
|
1346
|
+
), i.add(f.id), f.element.addEventListener("keydown", Le);
|
|
1347
|
+
}), U.get(h) === 1 && (h.addEventListener("dblclick", we, !0), h.addEventListener("pointerdown", Ce, !0), h.addEventListener("pointerleave", ke), h.addEventListener("pointermove", Ge), h.addEventListener("pointerout", Ie), h.addEventListener("pointerup", De, !0)), function() {
|
|
1348
|
+
t = !1, U.set(
|
|
1349
|
+
h,
|
|
1350
|
+
Math.max(0, (U.get(h) ?? 0) - 1)
|
|
1368
1351
|
), M((d) => {
|
|
1369
1352
|
const p = new Map(d.mountedGroups);
|
|
1370
1353
|
return p.delete(e), { mountedGroups: p };
|
|
1371
1354
|
}), e.separators.forEach((d) => {
|
|
1372
|
-
d.element.removeEventListener("keydown",
|
|
1373
|
-
}),
|
|
1355
|
+
d.element.removeEventListener("keydown", Le);
|
|
1356
|
+
}), U.get(h) || (h.removeEventListener(
|
|
1374
1357
|
"dblclick",
|
|
1375
|
-
|
|
1358
|
+
we,
|
|
1376
1359
|
!0
|
|
1377
|
-
),
|
|
1360
|
+
), h.removeEventListener(
|
|
1378
1361
|
"pointerdown",
|
|
1379
|
-
|
|
1362
|
+
Ce,
|
|
1380
1363
|
!0
|
|
1381
|
-
),
|
|
1364
|
+
), h.removeEventListener("pointerleave", ke), h.removeEventListener("pointermove", Ge), h.removeEventListener("pointerout", Ie), h.removeEventListener("pointerup", De, !0)), r.disconnect();
|
|
1382
1365
|
};
|
|
1383
1366
|
}
|
|
1384
|
-
function
|
|
1385
|
-
const [e, t] =
|
|
1367
|
+
function Ze() {
|
|
1368
|
+
const [e, t] = Q({}), n = Y(() => t({}), []);
|
|
1386
1369
|
return [e, n];
|
|
1387
1370
|
}
|
|
1388
1371
|
function me(e) {
|
|
1389
|
-
const t =
|
|
1372
|
+
const t = ot();
|
|
1390
1373
|
return `${e ?? t}`;
|
|
1391
1374
|
}
|
|
1392
|
-
const
|
|
1393
|
-
function
|
|
1375
|
+
const H = typeof window < "u" ? Oe : Ae;
|
|
1376
|
+
function Z(e) {
|
|
1394
1377
|
const t = G(e);
|
|
1395
|
-
return
|
|
1378
|
+
return H(() => {
|
|
1396
1379
|
t.current = e;
|
|
1397
|
-
}, [e]),
|
|
1380
|
+
}, [e]), Y(
|
|
1398
1381
|
(...n) => t.current?.(...n),
|
|
1399
1382
|
[t]
|
|
1400
1383
|
);
|
|
1401
1384
|
}
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1385
|
+
function ge(...e) {
|
|
1386
|
+
return Z((t) => {
|
|
1404
1387
|
e.forEach((n) => {
|
|
1405
1388
|
if (n)
|
|
1406
1389
|
switch (typeof n) {
|
|
@@ -1416,27 +1399,27 @@ function he(...e) {
|
|
|
1416
1399
|
});
|
|
1417
1400
|
});
|
|
1418
1401
|
}
|
|
1419
|
-
function
|
|
1402
|
+
function It(e) {
|
|
1420
1403
|
const t = G({ ...e });
|
|
1421
|
-
return
|
|
1404
|
+
return H(() => {
|
|
1422
1405
|
for (const n in e)
|
|
1423
1406
|
t.current[n] = e[n];
|
|
1424
1407
|
}, [e]), t.current;
|
|
1425
1408
|
}
|
|
1426
|
-
const Je =
|
|
1427
|
-
function
|
|
1409
|
+
const Je = it(null);
|
|
1410
|
+
function Dt(e, t) {
|
|
1428
1411
|
const n = G({
|
|
1429
1412
|
getLayout: () => ({}),
|
|
1430
|
-
setLayout:
|
|
1413
|
+
setLayout: Pt
|
|
1431
1414
|
});
|
|
1432
|
-
|
|
1415
|
+
_e(t, () => n.current, []), H(() => {
|
|
1433
1416
|
Object.assign(
|
|
1434
1417
|
n.current,
|
|
1435
|
-
|
|
1418
|
+
Ue({ groupId: e })
|
|
1436
1419
|
);
|
|
1437
1420
|
});
|
|
1438
1421
|
}
|
|
1439
|
-
function
|
|
1422
|
+
function Tt({
|
|
1440
1423
|
children: e,
|
|
1441
1424
|
className: t,
|
|
1442
1425
|
defaultLayout: n,
|
|
@@ -1448,130 +1431,138 @@ function It({
|
|
|
1448
1431
|
onLayoutChange: a,
|
|
1449
1432
|
onLayoutChanged: u,
|
|
1450
1433
|
orientation: c = "horizontal",
|
|
1451
|
-
resizeTargetMinimumSize:
|
|
1434
|
+
resizeTargetMinimumSize: m = {
|
|
1452
1435
|
coarse: 20,
|
|
1453
1436
|
fine: 10
|
|
1454
1437
|
},
|
|
1455
1438
|
style: y,
|
|
1456
|
-
...
|
|
1439
|
+
...h
|
|
1457
1440
|
}) {
|
|
1458
1441
|
const f = G({
|
|
1459
1442
|
onLayoutChange: {},
|
|
1460
1443
|
onLayoutChanged: {}
|
|
1461
|
-
}), d =
|
|
1462
|
-
|
|
1463
|
-
}), p =
|
|
1464
|
-
|
|
1465
|
-
}), g = me(s), v = G(null), [
|
|
1444
|
+
}), d = Z((b) => {
|
|
1445
|
+
F(f.current.onLayoutChange, b) || (f.current.onLayoutChange = b, a?.(b));
|
|
1446
|
+
}), p = Z((b) => {
|
|
1447
|
+
F(f.current.onLayoutChanged, b) || (f.current.onLayoutChanged = b, u?.(b));
|
|
1448
|
+
}), g = me(s), v = G(null), [x, S] = Ze(), w = G({
|
|
1466
1449
|
lastExpandedPanelSizes: {},
|
|
1467
1450
|
layouts: {},
|
|
1468
1451
|
panels: [],
|
|
1469
|
-
resizeTargetMinimumSize:
|
|
1452
|
+
resizeTargetMinimumSize: m,
|
|
1470
1453
|
separators: []
|
|
1471
|
-
}),
|
|
1472
|
-
|
|
1473
|
-
const
|
|
1474
|
-
(
|
|
1475
|
-
const { interactionState: k, mountedGroups:
|
|
1476
|
-
for (const
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
if (
|
|
1480
|
-
let
|
|
1454
|
+
}), C = ge(v, r);
|
|
1455
|
+
Dt(g, l);
|
|
1456
|
+
const P = Z(
|
|
1457
|
+
(b, L) => {
|
|
1458
|
+
const { interactionState: k, mountedGroups: ne } = E();
|
|
1459
|
+
for (const oe of ne.keys())
|
|
1460
|
+
if (oe.id === b) {
|
|
1461
|
+
const K = ne.get(oe);
|
|
1462
|
+
if (K) {
|
|
1463
|
+
let X = !1;
|
|
1481
1464
|
switch (k.state) {
|
|
1482
1465
|
case "active": {
|
|
1483
|
-
|
|
1484
|
-
(le) => le.group ===
|
|
1466
|
+
X = k.hitRegions.some(
|
|
1467
|
+
(le) => le.group === oe
|
|
1485
1468
|
);
|
|
1486
1469
|
break;
|
|
1487
1470
|
}
|
|
1488
1471
|
}
|
|
1489
1472
|
return {
|
|
1490
|
-
flexGrow:
|
|
1491
|
-
pointerEvents:
|
|
1473
|
+
flexGrow: K.layout[L] ?? 1,
|
|
1474
|
+
pointerEvents: X ? "none" : void 0
|
|
1492
1475
|
};
|
|
1493
1476
|
}
|
|
1494
1477
|
}
|
|
1495
1478
|
return {
|
|
1496
|
-
flexGrow: n?.[
|
|
1479
|
+
flexGrow: n?.[L] ?? 1
|
|
1497
1480
|
};
|
|
1498
1481
|
}
|
|
1499
|
-
),
|
|
1482
|
+
), T = Ne(
|
|
1500
1483
|
() => ({
|
|
1501
|
-
getPanelStyles:
|
|
1484
|
+
getPanelStyles: P,
|
|
1502
1485
|
id: g,
|
|
1503
1486
|
orientation: c,
|
|
1504
|
-
registerPanel: (
|
|
1505
|
-
const
|
|
1506
|
-
return
|
|
1507
|
-
...
|
|
1508
|
-
|
|
1487
|
+
registerPanel: (b) => {
|
|
1488
|
+
const L = w.current;
|
|
1489
|
+
return L.panels = de(c, [
|
|
1490
|
+
...L.panels,
|
|
1491
|
+
b
|
|
1509
1492
|
]), S(), () => {
|
|
1510
|
-
|
|
1511
|
-
(k) => k !==
|
|
1493
|
+
L.panels = L.panels.filter(
|
|
1494
|
+
(k) => k !== b
|
|
1512
1495
|
), S();
|
|
1513
1496
|
};
|
|
1514
1497
|
},
|
|
1515
|
-
registerSeparator: (
|
|
1516
|
-
const
|
|
1517
|
-
return
|
|
1518
|
-
...
|
|
1519
|
-
|
|
1498
|
+
registerSeparator: (b) => {
|
|
1499
|
+
const L = w.current;
|
|
1500
|
+
return L.separators = de(c, [
|
|
1501
|
+
...L.separators,
|
|
1502
|
+
b
|
|
1520
1503
|
]), S(), () => {
|
|
1521
|
-
|
|
1522
|
-
(k) => k !==
|
|
1504
|
+
L.separators = L.separators.filter(
|
|
1505
|
+
(k) => k !== b
|
|
1523
1506
|
), S();
|
|
1524
1507
|
};
|
|
1525
1508
|
}
|
|
1526
1509
|
}),
|
|
1527
|
-
[
|
|
1528
|
-
),
|
|
1510
|
+
[P, g, S, c]
|
|
1511
|
+
), j = It({
|
|
1529
1512
|
defaultLayout: n,
|
|
1530
1513
|
disableCursor: o
|
|
1531
|
-
}),
|
|
1532
|
-
return
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1514
|
+
}), O = G(null);
|
|
1515
|
+
return H(() => {
|
|
1516
|
+
const b = v.current;
|
|
1517
|
+
if (b === null)
|
|
1535
1518
|
return;
|
|
1536
|
-
const
|
|
1537
|
-
defaultLayout:
|
|
1538
|
-
disableCursor: !!
|
|
1519
|
+
const L = w.current, k = {
|
|
1520
|
+
defaultLayout: j.defaultLayout,
|
|
1521
|
+
disableCursor: !!j.disableCursor,
|
|
1539
1522
|
disabled: !!i,
|
|
1540
|
-
element:
|
|
1523
|
+
element: b,
|
|
1541
1524
|
id: g,
|
|
1542
|
-
inMemoryLastExpandedPanelSizes:
|
|
1543
|
-
inMemoryLayouts:
|
|
1525
|
+
inMemoryLastExpandedPanelSizes: w.current.lastExpandedPanelSizes,
|
|
1526
|
+
inMemoryLayouts: w.current.layouts,
|
|
1544
1527
|
orientation: c,
|
|
1545
|
-
panels:
|
|
1546
|
-
resizeTargetMinimumSize:
|
|
1547
|
-
separators:
|
|
1528
|
+
panels: L.panels,
|
|
1529
|
+
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1530
|
+
separators: L.separators
|
|
1548
1531
|
};
|
|
1549
|
-
|
|
1550
|
-
const
|
|
1551
|
-
if (
|
|
1552
|
-
const { defaultLayoutDeferred:
|
|
1553
|
-
!
|
|
1532
|
+
O.current = k;
|
|
1533
|
+
const ne = Gt(k), K = E().mountedGroups.get(k);
|
|
1534
|
+
if (K) {
|
|
1535
|
+
const { defaultLayoutDeferred: q, derivedPanelConstraints: A, layout: V } = K;
|
|
1536
|
+
!q && A.length > 0 && (d(V), p(V), L.panels.forEach((ue) => {
|
|
1537
|
+
ue.scheduleUpdate();
|
|
1538
|
+
}));
|
|
1554
1539
|
}
|
|
1555
|
-
|
|
1540
|
+
let X = !1;
|
|
1541
|
+
const le = N.addListener(
|
|
1556
1542
|
"interactionStateChange",
|
|
1557
|
-
(
|
|
1558
|
-
|
|
1543
|
+
(q) => {
|
|
1544
|
+
const A = q.state === "active";
|
|
1545
|
+
X !== A && (X = A, L.panels.forEach((V) => {
|
|
1546
|
+
V.scheduleUpdate();
|
|
1547
|
+
}));
|
|
1559
1548
|
}
|
|
1560
|
-
),
|
|
1549
|
+
), Qe = N.addListener(
|
|
1561
1550
|
"mountedGroupsChange",
|
|
1562
|
-
(
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1565
|
-
const { defaultLayoutDeferred:
|
|
1566
|
-
if (
|
|
1551
|
+
(q) => {
|
|
1552
|
+
const A = q.get(k);
|
|
1553
|
+
if (A) {
|
|
1554
|
+
const { defaultLayoutDeferred: V, derivedPanelConstraints: ue, layout: Se } = A;
|
|
1555
|
+
if (V || ue.length === 0)
|
|
1567
1556
|
return;
|
|
1568
|
-
const { interactionState:
|
|
1569
|
-
d(
|
|
1557
|
+
const { interactionState: et } = E(), tt = et.state !== "active";
|
|
1558
|
+
d(Se), tt && p(Se), L.panels.forEach((nt) => {
|
|
1559
|
+
nt.scheduleUpdate();
|
|
1560
|
+
});
|
|
1570
1561
|
}
|
|
1571
1562
|
}
|
|
1572
1563
|
);
|
|
1573
1564
|
return () => {
|
|
1574
|
-
|
|
1565
|
+
O.current = null, ne(), le(), Qe();
|
|
1575
1566
|
};
|
|
1576
1567
|
}, [
|
|
1577
1568
|
i,
|
|
@@ -1579,20 +1570,20 @@ function It({
|
|
|
1579
1570
|
p,
|
|
1580
1571
|
d,
|
|
1581
1572
|
c,
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
]),
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1587
|
-
}), /* @__PURE__ */
|
|
1573
|
+
x,
|
|
1574
|
+
j
|
|
1575
|
+
]), Ae(() => {
|
|
1576
|
+
const b = O.current;
|
|
1577
|
+
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1578
|
+
}), /* @__PURE__ */ J(Je.Provider, { value: T, children: /* @__PURE__ */ J(
|
|
1588
1579
|
"div",
|
|
1589
1580
|
{
|
|
1590
|
-
...
|
|
1581
|
+
...h,
|
|
1591
1582
|
className: t,
|
|
1592
1583
|
"data-group": !0,
|
|
1593
1584
|
"data-testid": g,
|
|
1594
1585
|
id: g,
|
|
1595
|
-
ref:
|
|
1586
|
+
ref: C,
|
|
1596
1587
|
style: {
|
|
1597
1588
|
height: "100%",
|
|
1598
1589
|
width: "100%",
|
|
@@ -1606,49 +1597,49 @@ function It({
|
|
|
1606
1597
|
}
|
|
1607
1598
|
) });
|
|
1608
1599
|
}
|
|
1609
|
-
|
|
1610
|
-
function
|
|
1600
|
+
Tt.displayName = "Group";
|
|
1601
|
+
function fe(e, t) {
|
|
1611
1602
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1612
1603
|
}
|
|
1613
|
-
function
|
|
1604
|
+
function Vt({
|
|
1614
1605
|
debounceSaveMs: e = 100,
|
|
1615
1606
|
panelIds: t,
|
|
1616
1607
|
storage: n = localStorage,
|
|
1617
1608
|
...o
|
|
1618
1609
|
}) {
|
|
1619
|
-
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l =
|
|
1620
|
-
|
|
1610
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = fe(r, t ?? []), s = rt(
|
|
1611
|
+
Ot,
|
|
1621
1612
|
() => n.getItem(l),
|
|
1622
1613
|
() => n.getItem(l)
|
|
1623
|
-
), a =
|
|
1614
|
+
), a = Ne(
|
|
1624
1615
|
() => s ? JSON.parse(s) : void 0,
|
|
1625
1616
|
[s]
|
|
1626
|
-
), u = G(null), c =
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1617
|
+
), u = G(null), c = Y(() => {
|
|
1618
|
+
const h = u.current;
|
|
1619
|
+
h && (u.current = null, clearTimeout(h));
|
|
1629
1620
|
}, []);
|
|
1630
1621
|
Oe(() => () => {
|
|
1631
1622
|
c();
|
|
1632
1623
|
}, [c]);
|
|
1633
|
-
const
|
|
1634
|
-
(
|
|
1624
|
+
const m = Y(
|
|
1625
|
+
(h) => {
|
|
1635
1626
|
c();
|
|
1636
1627
|
let f;
|
|
1637
|
-
i ? f =
|
|
1628
|
+
i ? f = fe(r, Object.keys(h)) : f = fe(r, []);
|
|
1638
1629
|
try {
|
|
1639
|
-
n.setItem(f, JSON.stringify(
|
|
1630
|
+
n.setItem(f, JSON.stringify(h));
|
|
1640
1631
|
} catch (d) {
|
|
1641
1632
|
console.error(d);
|
|
1642
1633
|
}
|
|
1643
1634
|
},
|
|
1644
1635
|
[c, i, r, n]
|
|
1645
|
-
), y =
|
|
1646
|
-
(
|
|
1647
|
-
c(), e === 0 ? h
|
|
1648
|
-
h
|
|
1636
|
+
), y = Y(
|
|
1637
|
+
(h) => {
|
|
1638
|
+
c(), e === 0 ? m(h) : u.current = setTimeout(() => {
|
|
1639
|
+
m(h);
|
|
1649
1640
|
}, e);
|
|
1650
1641
|
},
|
|
1651
|
-
[c, e,
|
|
1642
|
+
[c, e, m]
|
|
1652
1643
|
);
|
|
1653
1644
|
return {
|
|
1654
1645
|
/**
|
|
@@ -1664,45 +1655,45 @@ function Ht({
|
|
|
1664
1655
|
/**
|
|
1665
1656
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1666
1657
|
*/
|
|
1667
|
-
onLayoutChanged:
|
|
1658
|
+
onLayoutChanged: m
|
|
1668
1659
|
};
|
|
1669
1660
|
}
|
|
1670
|
-
function
|
|
1661
|
+
function Ot() {
|
|
1671
1662
|
return function() {
|
|
1672
1663
|
};
|
|
1673
1664
|
}
|
|
1674
|
-
function
|
|
1675
|
-
return
|
|
1665
|
+
function Ut() {
|
|
1666
|
+
return Q(null);
|
|
1676
1667
|
}
|
|
1677
|
-
function
|
|
1668
|
+
function Wt() {
|
|
1678
1669
|
return G(null);
|
|
1679
1670
|
}
|
|
1680
|
-
function
|
|
1681
|
-
const e =
|
|
1682
|
-
return
|
|
1671
|
+
function ye() {
|
|
1672
|
+
const e = st(Je);
|
|
1673
|
+
return z(
|
|
1683
1674
|
e,
|
|
1684
1675
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1685
1676
|
), e;
|
|
1686
1677
|
}
|
|
1687
|
-
function
|
|
1688
|
-
const { id: n } =
|
|
1689
|
-
collapse:
|
|
1690
|
-
expand:
|
|
1678
|
+
function At(e, t) {
|
|
1679
|
+
const { id: n } = ye(), o = G({
|
|
1680
|
+
collapse: ce,
|
|
1681
|
+
expand: ce,
|
|
1691
1682
|
getSize: () => ({
|
|
1692
1683
|
asPercentage: 0,
|
|
1693
1684
|
inPixels: 0
|
|
1694
1685
|
}),
|
|
1695
1686
|
isCollapsed: () => !1,
|
|
1696
|
-
resize:
|
|
1687
|
+
resize: ce
|
|
1697
1688
|
});
|
|
1698
|
-
|
|
1689
|
+
_e(t, () => o.current, []), H(() => {
|
|
1699
1690
|
Object.assign(
|
|
1700
1691
|
o.current,
|
|
1701
1692
|
Ve({ groupId: n, panelId: e })
|
|
1702
1693
|
);
|
|
1703
1694
|
});
|
|
1704
1695
|
}
|
|
1705
|
-
function
|
|
1696
|
+
function _t({
|
|
1706
1697
|
children: e,
|
|
1707
1698
|
className: t,
|
|
1708
1699
|
collapsedSize: n = "0%",
|
|
@@ -1714,56 +1705,50 @@ function Tt({
|
|
|
1714
1705
|
minSize: a = "0%",
|
|
1715
1706
|
onResize: u,
|
|
1716
1707
|
panelRef: c,
|
|
1717
|
-
style:
|
|
1708
|
+
style: m,
|
|
1718
1709
|
...y
|
|
1719
1710
|
}) {
|
|
1720
|
-
const
|
|
1721
|
-
(
|
|
1722
|
-
u?.(
|
|
1711
|
+
const h = !!l, f = me(l), d = G(null), p = ge(d, r), [, g] = Ze(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C = Z(
|
|
1712
|
+
(T, j, O) => {
|
|
1713
|
+
u?.(T, l, O);
|
|
1723
1714
|
}
|
|
1724
1715
|
);
|
|
1725
|
-
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
1728
|
-
return
|
|
1729
|
-
element:
|
|
1716
|
+
H(() => {
|
|
1717
|
+
const T = d.current;
|
|
1718
|
+
if (T !== null)
|
|
1719
|
+
return S({
|
|
1720
|
+
element: T,
|
|
1730
1721
|
id: f,
|
|
1731
|
-
idIsStable:
|
|
1722
|
+
idIsStable: h,
|
|
1732
1723
|
mutableValues: {
|
|
1733
1724
|
expandToSize: void 0,
|
|
1734
1725
|
prevSize: void 0
|
|
1735
1726
|
},
|
|
1736
|
-
onResize:
|
|
1727
|
+
onResize: w ? C : void 0,
|
|
1737
1728
|
panelConstraints: {
|
|
1738
1729
|
collapsedSize: n,
|
|
1739
1730
|
collapsible: o,
|
|
1740
1731
|
defaultSize: i,
|
|
1741
1732
|
maxSize: s,
|
|
1742
1733
|
minSize: a
|
|
1743
|
-
}
|
|
1734
|
+
},
|
|
1735
|
+
scheduleUpdate: g
|
|
1744
1736
|
});
|
|
1745
1737
|
}, [
|
|
1746
1738
|
n,
|
|
1747
1739
|
o,
|
|
1748
1740
|
i,
|
|
1749
|
-
|
|
1741
|
+
g,
|
|
1742
|
+
w,
|
|
1750
1743
|
f,
|
|
1751
|
-
|
|
1744
|
+
h,
|
|
1752
1745
|
s,
|
|
1753
1746
|
a,
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
]),
|
|
1757
|
-
const P =
|
|
1758
|
-
|
|
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(
|
|
1747
|
+
C,
|
|
1748
|
+
S
|
|
1749
|
+
]), At(f, c);
|
|
1750
|
+
const P = v(x, f);
|
|
1751
|
+
return /* @__PURE__ */ J(
|
|
1767
1752
|
"div",
|
|
1768
1753
|
{
|
|
1769
1754
|
...y,
|
|
@@ -1778,9 +1763,9 @@ function Tt({
|
|
|
1778
1763
|
flexShrink: 1,
|
|
1779
1764
|
// Prevent Panel content from interfering with panel size
|
|
1780
1765
|
overflow: "hidden",
|
|
1781
|
-
...
|
|
1766
|
+
...P
|
|
1782
1767
|
},
|
|
1783
|
-
children: /* @__PURE__ */
|
|
1768
|
+
children: /* @__PURE__ */ J(
|
|
1784
1769
|
"div",
|
|
1785
1770
|
{
|
|
1786
1771
|
className: t,
|
|
@@ -1788,7 +1773,7 @@ function Tt({
|
|
|
1788
1773
|
maxHeight: "100%",
|
|
1789
1774
|
maxWidth: "100%",
|
|
1790
1775
|
flexGrow: 1,
|
|
1791
|
-
...
|
|
1776
|
+
...m
|
|
1792
1777
|
},
|
|
1793
1778
|
children: e
|
|
1794
1779
|
}
|
|
@@ -1796,7 +1781,7 @@ function Tt({
|
|
|
1796
1781
|
}
|
|
1797
1782
|
);
|
|
1798
1783
|
}
|
|
1799
|
-
|
|
1784
|
+
_t.displayName = "Panel";
|
|
1800
1785
|
const Nt = {
|
|
1801
1786
|
minHeight: 0,
|
|
1802
1787
|
maxHeight: "100%",
|
|
@@ -1809,13 +1794,13 @@ const Nt = {
|
|
|
1809
1794
|
padding: 0,
|
|
1810
1795
|
margin: 0
|
|
1811
1796
|
};
|
|
1812
|
-
function
|
|
1813
|
-
return
|
|
1797
|
+
function Bt() {
|
|
1798
|
+
return Q(null);
|
|
1814
1799
|
}
|
|
1815
|
-
function
|
|
1800
|
+
function Kt() {
|
|
1816
1801
|
return G(null);
|
|
1817
1802
|
}
|
|
1818
|
-
function
|
|
1803
|
+
function Ft({
|
|
1819
1804
|
layout: e,
|
|
1820
1805
|
panelConstraints: t,
|
|
1821
1806
|
panelId: n,
|
|
@@ -1827,8 +1812,8 @@ function _t({
|
|
|
1827
1812
|
);
|
|
1828
1813
|
if (s) {
|
|
1829
1814
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1830
|
-
r =
|
|
1831
|
-
layout:
|
|
1815
|
+
r = $({
|
|
1816
|
+
layout: te({
|
|
1832
1817
|
delta: u - l,
|
|
1833
1818
|
initialLayout: e,
|
|
1834
1819
|
panelConstraints: t,
|
|
@@ -1836,8 +1821,8 @@ function _t({
|
|
|
1836
1821
|
prevLayout: e
|
|
1837
1822
|
}),
|
|
1838
1823
|
panelConstraints: t
|
|
1839
|
-
})[n], i =
|
|
1840
|
-
layout:
|
|
1824
|
+
})[n], i = $({
|
|
1825
|
+
layout: te({
|
|
1841
1826
|
delta: a - l,
|
|
1842
1827
|
initialLayout: e,
|
|
1843
1828
|
panelConstraints: t,
|
|
@@ -1854,7 +1839,7 @@ function _t({
|
|
|
1854
1839
|
valueNow: l
|
|
1855
1840
|
};
|
|
1856
1841
|
}
|
|
1857
|
-
function
|
|
1842
|
+
function $t({
|
|
1858
1843
|
children: e,
|
|
1859
1844
|
className: t,
|
|
1860
1845
|
elementRef: n,
|
|
@@ -1862,40 +1847,40 @@ function At({
|
|
|
1862
1847
|
style: i,
|
|
1863
1848
|
...r
|
|
1864
1849
|
}) {
|
|
1865
|
-
const l = me(o), [s, a] =
|
|
1866
|
-
id:
|
|
1850
|
+
const l = me(o), [s, a] = Q({}), [u, c] = Q("inactive"), m = G(null), y = ge(m, n), {
|
|
1851
|
+
id: h,
|
|
1867
1852
|
orientation: f,
|
|
1868
1853
|
registerSeparator: d
|
|
1869
|
-
} =
|
|
1870
|
-
return
|
|
1871
|
-
const g =
|
|
1854
|
+
} = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1855
|
+
return H(() => {
|
|
1856
|
+
const g = m.current;
|
|
1872
1857
|
if (g !== null) {
|
|
1873
1858
|
const v = {
|
|
1874
1859
|
element: g,
|
|
1875
1860
|
id: l
|
|
1876
|
-
},
|
|
1861
|
+
}, x = d(v), S = N.addListener(
|
|
1877
1862
|
"interactionStateChange",
|
|
1878
|
-
(
|
|
1863
|
+
(C) => {
|
|
1879
1864
|
c(
|
|
1880
|
-
|
|
1881
|
-
(
|
|
1882
|
-
) ?
|
|
1865
|
+
C.state !== "inactive" && C.hitRegions.some(
|
|
1866
|
+
(P) => P.separator === v
|
|
1867
|
+
) ? C.state : "inactive"
|
|
1883
1868
|
);
|
|
1884
1869
|
}
|
|
1885
|
-
),
|
|
1870
|
+
), w = N.addListener(
|
|
1886
1871
|
"mountedGroupsChange",
|
|
1887
|
-
(
|
|
1888
|
-
|
|
1889
|
-
({ derivedPanelConstraints:
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1893
|
-
const
|
|
1872
|
+
(C) => {
|
|
1873
|
+
C.forEach(
|
|
1874
|
+
({ derivedPanelConstraints: P, layout: T, separatorToPanels: j }, O) => {
|
|
1875
|
+
if (O.id === h) {
|
|
1876
|
+
const b = j.get(v);
|
|
1877
|
+
if (b) {
|
|
1878
|
+
const L = b[0], k = O.panels.indexOf(L);
|
|
1894
1879
|
a(
|
|
1895
|
-
|
|
1896
|
-
layout:
|
|
1897
|
-
panelConstraints:
|
|
1898
|
-
panelId:
|
|
1880
|
+
Ft({
|
|
1881
|
+
layout: T,
|
|
1882
|
+
panelConstraints: P,
|
|
1883
|
+
panelId: L.id,
|
|
1899
1884
|
panelIndex: k
|
|
1900
1885
|
})
|
|
1901
1886
|
);
|
|
@@ -1906,10 +1891,10 @@ function At({
|
|
|
1906
1891
|
}
|
|
1907
1892
|
);
|
|
1908
1893
|
return () => {
|
|
1909
|
-
S(),
|
|
1894
|
+
S(), w(), x();
|
|
1910
1895
|
};
|
|
1911
1896
|
}
|
|
1912
|
-
}, [
|
|
1897
|
+
}, [h, l, d]), /* @__PURE__ */ J(
|
|
1913
1898
|
"div",
|
|
1914
1899
|
{
|
|
1915
1900
|
...r,
|
|
@@ -1935,16 +1920,16 @@ function At({
|
|
|
1935
1920
|
}
|
|
1936
1921
|
);
|
|
1937
1922
|
}
|
|
1938
|
-
|
|
1923
|
+
$t.displayName = "Separator";
|
|
1939
1924
|
export {
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1925
|
+
Tt as Group,
|
|
1926
|
+
_t as Panel,
|
|
1927
|
+
$t as Separator,
|
|
1928
|
+
ct as isCoarsePointer,
|
|
1929
|
+
Vt as useDefaultLayout,
|
|
1930
|
+
Ut as useGroupCallbackRef,
|
|
1931
|
+
Wt as useGroupRef,
|
|
1932
|
+
Bt as usePanelCallbackRef,
|
|
1933
|
+
Kt as usePanelRef
|
|
1949
1934
|
};
|
|
1950
1935
|
//# sourceMappingURL=react-resizable-panels.js.map
|