react-resizable-panels 4.5.8 → 4.5.9-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
|
|
2
|
+
import { jsx as q } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Y, useCallback as K, useId as tt, useLayoutEffect as Oe, useEffect as Te, useRef as k, createContext as nt, useImperativeHandle as Ne, useMemo as Ae, useSyncExternalStore as _e, useContext as ot } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function W({
|
|
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
|
|
@@ -56,23 +56,23 @@ function ut({
|
|
|
56
56
|
return z(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: W({ 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 = W({ 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 O = 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 && O.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && O.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
|
+
}), O.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,14 +382,14 @@ 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: ze(e),
|
|
392
|
+
b: ze(t)
|
|
393
393
|
};
|
|
394
394
|
let o;
|
|
395
395
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
@@ -399,8 +399,8 @@ function vt(e, t) {
|
|
|
399
399
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
400
400
|
);
|
|
401
401
|
const i = {
|
|
402
|
-
a:
|
|
403
|
-
b:
|
|
402
|
+
a: xe(ve(n.a)),
|
|
403
|
+
b: xe(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 (z(n, "Missing node"),
|
|
432
|
+
if (z(n, "Missing node"), vt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function xe(e) {
|
|
437
437
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function ze(e) {
|
|
440
440
|
const t = [];
|
|
441
441
|
for (; e; )
|
|
442
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 xt(e, t) {
|
|
450
450
|
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function zt({
|
|
453
453
|
groupElement: e,
|
|
454
454
|
hitRegion: t,
|
|
455
455
|
pointerEventTarget: n
|
|
456
456
|
}) {
|
|
457
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 (xt(o.getBoundingClientRect(), t))
|
|
465
465
|
return !1;
|
|
466
466
|
o = o.parentElement;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
return !0;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function de(e, t) {
|
|
472
472
|
const n = [];
|
|
473
473
|
return t.forEach((o, i) => {
|
|
474
474
|
if (i.disabled)
|
|
475
475
|
return;
|
|
476
|
-
const 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 && zt({
|
|
481
481
|
groupElement: i.element,
|
|
482
482
|
hitRegion: l.hitRegion.rect,
|
|
483
483
|
pointerEventTarget: e.target
|
|
484
484
|
}) && n.push(l.hitRegion);
|
|
485
485
|
}), n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function bt(e, t) {
|
|
488
488
|
if (e.length !== t.length)
|
|
489
489
|
return !1;
|
|
490
490
|
for (let n = 0; n < e.length; n++)
|
|
@@ -492,10 +492,10 @@ function Ct(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function J(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function V({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -505,15 +505,15 @@ function W({
|
|
|
505
505
|
maxSize: i = 100,
|
|
506
506
|
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (J(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
510
|
const l = (n + r) / 2;
|
|
511
|
-
|
|
511
|
+
J(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
513
|
t = r;
|
|
514
514
|
return t = Math.min(i, t), t = D(t), t;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function Z({
|
|
517
517
|
delta: e,
|
|
518
518
|
initialLayout: t,
|
|
519
519
|
panelConstraints: n,
|
|
@@ -525,7 +525,7 @@ function te({
|
|
|
525
525
|
return t;
|
|
526
526
|
const l = Object.values(t), s = Object.values(i), a = [...l], [u, c] = o;
|
|
527
527
|
z(u != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
|
|
528
|
-
let
|
|
528
|
+
let h = 0;
|
|
529
529
|
switch (r) {
|
|
530
530
|
case "keyboard": {
|
|
531
531
|
{
|
|
@@ -546,7 +546,7 @@ function te({
|
|
|
546
546
|
`Previous layout not found for panel index ${f}`
|
|
547
547
|
), R(x, p)) {
|
|
548
548
|
const S = v - x;
|
|
549
|
-
|
|
549
|
+
J(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
@@ -568,7 +568,7 @@ function te({
|
|
|
568
568
|
`Previous layout not found for panel index ${f}`
|
|
569
569
|
), R(x, v)) {
|
|
570
570
|
const S = x - p;
|
|
571
|
-
|
|
571
|
+
J(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
}
|
|
@@ -584,7 +584,7 @@ function te({
|
|
|
584
584
|
v != null,
|
|
585
585
|
`Previous layout not found for panel index ${d}`
|
|
586
586
|
);
|
|
587
|
-
const S =
|
|
587
|
+
const S = V({
|
|
588
588
|
panelConstraints: n[d],
|
|
589
589
|
size: 100
|
|
590
590
|
}) - v;
|
|
@@ -597,23 +597,23 @@ function te({
|
|
|
597
597
|
{
|
|
598
598
|
let d = e < 0 ? u : c;
|
|
599
599
|
for (; d >= 0 && d < n.length; ) {
|
|
600
|
-
const p = Math.abs(e) - Math.abs(
|
|
600
|
+
const p = Math.abs(e) - Math.abs(h), g = l[d];
|
|
601
601
|
z(
|
|
602
602
|
g != null,
|
|
603
603
|
`Previous layout not found for panel index ${d}`
|
|
604
604
|
);
|
|
605
|
-
const v = g - p, x =
|
|
605
|
+
const v = g - p, x = V({
|
|
606
606
|
panelConstraints: n[d],
|
|
607
607
|
size: v
|
|
608
608
|
});
|
|
609
|
-
if (!R(g, x) && (
|
|
609
|
+
if (!R(g, x) && (h += g - x, a[d] = x, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
610
610
|
numeric: !0
|
|
611
611
|
}) >= 0))
|
|
612
612
|
break;
|
|
613
613
|
e < 0 ? d-- : d++;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
if (
|
|
616
|
+
if (bt(s, a))
|
|
617
617
|
return i;
|
|
618
618
|
{
|
|
619
619
|
const f = e < 0 ? c : u, d = l[f];
|
|
@@ -621,23 +621,23 @@ function te({
|
|
|
621
621
|
d != null,
|
|
622
622
|
`Previous layout not found for panel index ${f}`
|
|
623
623
|
);
|
|
624
|
-
const p = d +
|
|
624
|
+
const p = d + h, g = V({
|
|
625
625
|
panelConstraints: n[f],
|
|
626
626
|
size: p
|
|
627
627
|
});
|
|
628
628
|
if (a[f] = g, !R(g, p)) {
|
|
629
629
|
let v = p - g, S = e < 0 ? c : u;
|
|
630
630
|
for (; S >= 0 && S < n.length; ) {
|
|
631
|
-
const
|
|
631
|
+
const L = a[S];
|
|
632
632
|
z(
|
|
633
|
-
|
|
633
|
+
L != null,
|
|
634
634
|
`Previous layout not found for panel index ${S}`
|
|
635
635
|
);
|
|
636
|
-
const
|
|
636
|
+
const P = L + v, b = V({
|
|
637
637
|
panelConstraints: n[S],
|
|
638
|
-
size:
|
|
638
|
+
size: P
|
|
639
639
|
});
|
|
640
|
-
if (R(
|
|
640
|
+
if (R(L, b) || (v -= b - L, a[S] = b), R(v, 0))
|
|
641
641
|
break;
|
|
642
642
|
e > 0 ? S-- : S++;
|
|
643
643
|
}
|
|
@@ -649,18 +649,18 @@ function te({
|
|
|
649
649
|
);
|
|
650
650
|
if (!R(y, 100, 0.1))
|
|
651
651
|
return i;
|
|
652
|
-
const
|
|
653
|
-
return a.reduce((f, d, p) => (f[
|
|
652
|
+
const m = Object.keys(i);
|
|
653
|
+
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function A(e, t) {
|
|
656
656
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
657
657
|
return !1;
|
|
658
658
|
for (const n in e)
|
|
659
|
-
if (t[n] === void 0 ||
|
|
659
|
+
if (t[n] === void 0 || J(e[n], t[n]) !== 0)
|
|
660
660
|
return !1;
|
|
661
661
|
return !0;
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function _({
|
|
664
664
|
layout: e,
|
|
665
665
|
panelConstraints: t
|
|
666
666
|
}) {
|
|
@@ -683,7 +683,7 @@ function $({
|
|
|
683
683
|
for (let s = 0; s < t.length; s++) {
|
|
684
684
|
const a = o[s];
|
|
685
685
|
z(a != null, `No layout data found for index ${s}`);
|
|
686
|
-
const u =
|
|
686
|
+
const u = V({
|
|
687
687
|
panelConstraints: t[s],
|
|
688
688
|
size: a
|
|
689
689
|
});
|
|
@@ -693,7 +693,7 @@ function $({
|
|
|
693
693
|
for (let s = 0; s < t.length; s++) {
|
|
694
694
|
const a = o[s];
|
|
695
695
|
z(a != null, `No layout data found for index ${s}`);
|
|
696
|
-
const u = a + r, c =
|
|
696
|
+
const u = a + r, c = V({
|
|
697
697
|
panelConstraints: t[s],
|
|
698
698
|
size: u
|
|
699
699
|
});
|
|
@@ -714,7 +714,7 @@ function Ve({
|
|
|
714
714
|
{
|
|
715
715
|
defaultLayoutDeferred: u,
|
|
716
716
|
derivedPanelConstraints: c,
|
|
717
|
-
layout:
|
|
717
|
+
layout: h,
|
|
718
718
|
separatorToPanels: y
|
|
719
719
|
}
|
|
720
720
|
] of s)
|
|
@@ -723,7 +723,7 @@ function Ve({
|
|
|
723
723
|
defaultLayoutDeferred: u,
|
|
724
724
|
derivedPanelConstraints: c,
|
|
725
725
|
group: a,
|
|
726
|
-
layout:
|
|
726
|
+
layout: h,
|
|
727
727
|
separatorToPanels: y
|
|
728
728
|
};
|
|
729
729
|
throw Error(`Group ${e} not found`);
|
|
@@ -751,26 +751,26 @@ function Ve({
|
|
|
751
751
|
const {
|
|
752
752
|
defaultLayoutDeferred: u,
|
|
753
753
|
derivedPanelConstraints: c,
|
|
754
|
-
group:
|
|
754
|
+
group: h,
|
|
755
755
|
layout: y,
|
|
756
|
-
separatorToPanels:
|
|
757
|
-
} = n(), f =
|
|
756
|
+
separatorToPanels: m
|
|
757
|
+
} = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, p = Z({
|
|
758
758
|
delta: d ? a - s : s - a,
|
|
759
759
|
initialLayout: y,
|
|
760
760
|
panelConstraints: c,
|
|
761
761
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
762
762
|
prevLayout: y,
|
|
763
763
|
trigger: "imperative-api"
|
|
764
|
-
}), g =
|
|
764
|
+
}), g = _({
|
|
765
765
|
layout: p,
|
|
766
766
|
panelConstraints: c
|
|
767
767
|
});
|
|
768
|
-
|
|
769
|
-
mountedGroups: new Map(v.mountedGroups).set(
|
|
768
|
+
A(y, g) || M((v) => ({
|
|
769
|
+
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
770
770
|
defaultLayoutDeferred: u,
|
|
771
771
|
derivedPanelConstraints: c,
|
|
772
772
|
layout: g,
|
|
773
|
-
separatorToPanels:
|
|
773
|
+
separatorToPanels: m
|
|
774
774
|
})
|
|
775
775
|
}));
|
|
776
776
|
};
|
|
@@ -780,8 +780,8 @@ function Ve({
|
|
|
780
780
|
s && c !== a && (u.expandToSize = c, l(a));
|
|
781
781
|
},
|
|
782
782
|
expand: () => {
|
|
783
|
-
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(),
|
|
784
|
-
if (s &&
|
|
783
|
+
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), h = r();
|
|
784
|
+
if (s && h === a) {
|
|
785
785
|
let y = c.expandToSize ?? u;
|
|
786
786
|
y === 0 && (y = 1), l(y);
|
|
787
787
|
}
|
|
@@ -802,8 +802,8 @@ function Ve({
|
|
|
802
802
|
let u;
|
|
803
803
|
switch (typeof s) {
|
|
804
804
|
case "number": {
|
|
805
|
-
const { group: c } = n(),
|
|
806
|
-
u = D(s /
|
|
805
|
+
const { group: c } = n(), h = W({ group: c });
|
|
806
|
+
u = D(s / h * 100);
|
|
807
807
|
break;
|
|
808
808
|
}
|
|
809
809
|
case "string": {
|
|
@@ -816,11 +816,11 @@ function Ve({
|
|
|
816
816
|
}
|
|
817
817
|
};
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function be(e) {
|
|
820
820
|
if (e.defaultPrevented)
|
|
821
821
|
return;
|
|
822
822
|
const { mountedGroups: t } = E();
|
|
823
|
-
|
|
823
|
+
de(e, t).forEach((o) => {
|
|
824
824
|
if (o.separator) {
|
|
825
825
|
const i = o.panels.find(
|
|
826
826
|
(r) => r.panelConstraints.defaultSize !== void 0
|
|
@@ -844,7 +844,7 @@ function ae(e) {
|
|
|
844
844
|
return n;
|
|
845
845
|
throw Error("Could not find parent Group for separator element");
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function We({
|
|
848
848
|
groupId: e
|
|
849
849
|
}) {
|
|
850
850
|
const t = () => {
|
|
@@ -866,11 +866,11 @@ function Ue({
|
|
|
866
866
|
group: r,
|
|
867
867
|
layout: l,
|
|
868
868
|
separatorToPanels: s
|
|
869
|
-
} = t(), a =
|
|
869
|
+
} = t(), a = _({
|
|
870
870
|
layout: n,
|
|
871
871
|
panelConstraints: i
|
|
872
872
|
});
|
|
873
|
-
return o ? l : (
|
|
873
|
+
return o ? l : (A(l, a) || M((u) => ({
|
|
874
874
|
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
875
875
|
defaultLayoutDeferred: o,
|
|
876
876
|
derivedPanelConstraints: i,
|
|
@@ -881,30 +881,30 @@ function Ue({
|
|
|
881
881
|
}
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function Ue(e) {
|
|
885
885
|
const { mountedGroups: t } = E(), n = t.get(e);
|
|
886
886
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
const n = ae(e), o =
|
|
890
|
-
(
|
|
888
|
+
function N(e, t) {
|
|
889
|
+
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
890
|
+
(h) => h.element === e
|
|
891
891
|
);
|
|
892
892
|
z(i, "Matching separator not found");
|
|
893
893
|
const r = o.separatorToPanels.get(i);
|
|
894
894
|
z(r, "Matching panels not found");
|
|
895
|
-
const l = r.map((
|
|
895
|
+
const l = r.map((h) => n.panels.indexOf(h)), a = We({ groupId: n.id }).getLayout(), u = Z({
|
|
896
896
|
delta: t,
|
|
897
897
|
initialLayout: a,
|
|
898
898
|
panelConstraints: o.derivedPanelConstraints,
|
|
899
899
|
pivotIndices: l,
|
|
900
900
|
prevLayout: a,
|
|
901
901
|
trigger: "keyboard"
|
|
902
|
-
}), c =
|
|
902
|
+
}), c = _({
|
|
903
903
|
layout: u,
|
|
904
904
|
panelConstraints: o.derivedPanelConstraints
|
|
905
905
|
});
|
|
906
|
-
|
|
907
|
-
mountedGroups: new Map(
|
|
906
|
+
A(a, c) || M((h) => ({
|
|
907
|
+
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
908
908
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
909
909
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
910
910
|
layout: c,
|
|
@@ -912,46 +912,46 @@ function _(e, t) {
|
|
|
912
912
|
})
|
|
913
913
|
}));
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function we(e) {
|
|
916
916
|
if (e.defaultPrevented)
|
|
917
917
|
return;
|
|
918
918
|
const t = e.currentTarget, n = ae(t);
|
|
919
919
|
if (!n.disabled)
|
|
920
920
|
switch (e.key) {
|
|
921
921
|
case "ArrowDown": {
|
|
922
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
922
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, 5);
|
|
923
923
|
break;
|
|
924
924
|
}
|
|
925
925
|
case "ArrowLeft": {
|
|
926
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
926
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, -5);
|
|
927
927
|
break;
|
|
928
928
|
}
|
|
929
929
|
case "ArrowRight": {
|
|
930
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
930
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, 5);
|
|
931
931
|
break;
|
|
932
932
|
}
|
|
933
933
|
case "ArrowUp": {
|
|
934
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
934
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, -5);
|
|
935
935
|
break;
|
|
936
936
|
}
|
|
937
937
|
case "End": {
|
|
938
|
-
e.preventDefault(),
|
|
938
|
+
e.preventDefault(), N(t, 100);
|
|
939
939
|
break;
|
|
940
940
|
}
|
|
941
941
|
case "Enter": {
|
|
942
942
|
e.preventDefault();
|
|
943
|
-
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } =
|
|
944
|
-
(
|
|
943
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = Ue(o), s = o.separators.find(
|
|
944
|
+
(h) => h.element === t
|
|
945
945
|
);
|
|
946
946
|
z(s, "Matching separator not found");
|
|
947
947
|
const a = l.get(s);
|
|
948
948
|
z(a, "Matching panels not found");
|
|
949
949
|
const u = a[0], c = i.find(
|
|
950
|
-
(
|
|
950
|
+
(h) => h.panelId === u.id
|
|
951
951
|
);
|
|
952
952
|
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
953
|
-
const
|
|
954
|
-
|
|
953
|
+
const h = r[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
954
|
+
N(t, y - h);
|
|
955
955
|
}
|
|
956
956
|
break;
|
|
957
957
|
}
|
|
@@ -968,17 +968,17 @@ function Le(e) {
|
|
|
968
968
|
break;
|
|
969
969
|
}
|
|
970
970
|
case "Home": {
|
|
971
|
-
e.preventDefault(),
|
|
971
|
+
e.preventDefault(), N(t, -100);
|
|
972
972
|
break;
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function Le(e) {
|
|
977
977
|
if (e.defaultPrevented)
|
|
978
978
|
return;
|
|
979
979
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
980
980
|
return;
|
|
981
|
-
const { mountedGroups: t } = E(), n =
|
|
981
|
+
const { mountedGroups: t } = E(), n = de(e, t), o = /* @__PURE__ */ new Map();
|
|
982
982
|
let i = !1;
|
|
983
983
|
n.forEach((r) => {
|
|
984
984
|
r.separator && (i || (i = !0, r.separator.element.focus()));
|
|
@@ -993,13 +993,13 @@ function Ce(e) {
|
|
|
993
993
|
}
|
|
994
994
|
}), n.length && e.preventDefault();
|
|
995
995
|
}
|
|
996
|
-
const
|
|
997
|
-
}, Be = 1, Ke = 2, Xe = 4, qe = 8,
|
|
996
|
+
const wt = (e) => e, ue = () => {
|
|
997
|
+
}, Be = 1, Ke = 2, Xe = 4, qe = 8, Ce = 3, Pe = 12;
|
|
998
998
|
let se;
|
|
999
|
-
function
|
|
999
|
+
function Re() {
|
|
1000
1000
|
return se === void 0 && (se = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (se = !0)), se;
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function Lt({
|
|
1003
1003
|
cursorFlags: e,
|
|
1004
1004
|
groups: t,
|
|
1005
1005
|
state: n
|
|
@@ -1026,7 +1026,7 @@ function Rt({
|
|
|
1026
1026
|
return null;
|
|
1027
1027
|
switch (n) {
|
|
1028
1028
|
case "active": {
|
|
1029
|
-
if (e &&
|
|
1029
|
+
if (e && Re()) {
|
|
1030
1030
|
const r = (e & Be) !== 0, l = (e & Ke) !== 0, s = (e & Xe) !== 0, a = (e & qe) !== 0;
|
|
1031
1031
|
if (r)
|
|
1032
1032
|
return s ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
@@ -1040,19 +1040,19 @@ function Rt({
|
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
|
-
return
|
|
1043
|
+
return Re() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1044
1044
|
}
|
|
1045
|
-
const
|
|
1046
|
-
function
|
|
1045
|
+
const Me = /* @__PURE__ */ new WeakMap();
|
|
1046
|
+
function pe(e) {
|
|
1047
1047
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1048
1048
|
return;
|
|
1049
|
-
let { prevStyle: t, styleSheet: n } =
|
|
1049
|
+
let { prevStyle: t, styleSheet: n } = Me.get(e) ?? {};
|
|
1050
1050
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1051
1051
|
const { cursorFlags: o, interactionState: i } = E();
|
|
1052
1052
|
switch (i.state) {
|
|
1053
1053
|
case "active":
|
|
1054
1054
|
case "hover": {
|
|
1055
|
-
const r =
|
|
1055
|
+
const r = Lt({
|
|
1056
1056
|
cursorFlags: o,
|
|
1057
1057
|
groups: i.hitRegions.map((s) => s.group),
|
|
1058
1058
|
state: i.state
|
|
@@ -1067,7 +1067,7 @@ function he(e) {
|
|
|
1067
1067
|
break;
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
|
|
1070
|
+
Me.set(e, {
|
|
1071
1071
|
prevStyle: t,
|
|
1072
1072
|
styleSheet: n
|
|
1073
1073
|
});
|
|
@@ -1084,26 +1084,26 @@ function Ye({
|
|
|
1084
1084
|
let s = 0;
|
|
1085
1085
|
const a = new Map(i);
|
|
1086
1086
|
n.forEach((c) => {
|
|
1087
|
-
const { group:
|
|
1087
|
+
const { group: h, groupSize: y } = c, { disableCursor: m, orientation: f, panels: d } = h;
|
|
1088
1088
|
let p = 0;
|
|
1089
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;
|
|
1090
|
-
const g = o.get(
|
|
1090
|
+
const g = o.get(h), {
|
|
1091
1091
|
defaultLayoutDeferred: v,
|
|
1092
1092
|
derivedPanelConstraints: x,
|
|
1093
1093
|
layout: S,
|
|
1094
|
-
separatorToPanels:
|
|
1095
|
-
} = i.get(
|
|
1096
|
-
if (x && g && S &&
|
|
1097
|
-
const
|
|
1094
|
+
separatorToPanels: L
|
|
1095
|
+
} = i.get(h) ?? { defaultLayoutDeferred: !1 };
|
|
1096
|
+
if (x && g && S && L) {
|
|
1097
|
+
const P = Z({
|
|
1098
1098
|
delta: p,
|
|
1099
1099
|
initialLayout: g,
|
|
1100
1100
|
panelConstraints: x,
|
|
1101
|
-
pivotIndices: c.panels.map((
|
|
1101
|
+
pivotIndices: c.panels.map((b) => d.indexOf(b)),
|
|
1102
1102
|
prevLayout: S,
|
|
1103
1103
|
trigger: "mouse-or-touch"
|
|
1104
1104
|
});
|
|
1105
|
-
if (
|
|
1106
|
-
if (p !== 0 && !
|
|
1105
|
+
if (A(P, S)) {
|
|
1106
|
+
if (p !== 0 && !m)
|
|
1107
1107
|
switch (f) {
|
|
1108
1108
|
case "horizontal": {
|
|
1109
1109
|
s |= p < 0 ? Be : Ke;
|
|
@@ -1118,21 +1118,21 @@ function Ye({
|
|
|
1118
1118
|
a.set(c.group, {
|
|
1119
1119
|
defaultLayoutDeferred: v,
|
|
1120
1120
|
derivedPanelConstraints: x,
|
|
1121
|
-
layout:
|
|
1122
|
-
separatorToPanels:
|
|
1121
|
+
layout: P,
|
|
1122
|
+
separatorToPanels: L
|
|
1123
1123
|
});
|
|
1124
|
-
const
|
|
1125
|
-
c.group.inMemoryLayouts[
|
|
1124
|
+
const b = c.group.panels.map(({ id: $ }) => $).join(",");
|
|
1125
|
+
c.group.inMemoryLayouts[b] = P;
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
});
|
|
1129
1129
|
let u = 0;
|
|
1130
|
-
t.movementX === 0 ? u |= l &
|
|
1130
|
+
t.movementX === 0 ? u |= l & Ce : u |= s & Ce, t.movementY === 0 ? u |= l & Pe : u |= s & Pe, M({
|
|
1131
1131
|
cursorFlags: u,
|
|
1132
1132
|
mountedGroups: a
|
|
1133
|
-
}),
|
|
1133
|
+
}), pe(e);
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function Ee(e) {
|
|
1136
1136
|
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
1137
1137
|
switch (n.state) {
|
|
1138
1138
|
case "active":
|
|
@@ -1178,7 +1178,7 @@ function Ge(e) {
|
|
|
1178
1178
|
break;
|
|
1179
1179
|
}
|
|
1180
1180
|
default: {
|
|
1181
|
-
const i =
|
|
1181
|
+
const i = de(e, o);
|
|
1182
1182
|
i.length === 0 ? n.state !== "inactive" && M({
|
|
1183
1183
|
interactionState: {
|
|
1184
1184
|
state: "inactive"
|
|
@@ -1188,12 +1188,12 @@ function Ge(e) {
|
|
|
1188
1188
|
hitRegions: i,
|
|
1189
1189
|
state: "hover"
|
|
1190
1190
|
}
|
|
1191
|
-
}),
|
|
1191
|
+
}), pe(e.currentTarget);
|
|
1192
1192
|
break;
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function ke(e) {
|
|
1197
1197
|
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1198
1198
|
const { interactionState: t } = E();
|
|
1199
1199
|
switch (t.state) {
|
|
@@ -1206,7 +1206,7 @@ function Ie(e) {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
|
-
function
|
|
1209
|
+
function Ie(e) {
|
|
1210
1210
|
if (e.defaultPrevented)
|
|
1211
1211
|
return;
|
|
1212
1212
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
@@ -1219,12 +1219,12 @@ function De(e) {
|
|
|
1219
1219
|
interactionState: {
|
|
1220
1220
|
state: "inactive"
|
|
1221
1221
|
}
|
|
1222
|
-
}), t.hitRegions.length > 0 && (
|
|
1222
|
+
}), t.hitRegions.length > 0 && (pe(e.currentTarget), M((n) => ({
|
|
1223
1223
|
mountedGroups: new Map(n.mountedGroups)
|
|
1224
1224
|
})), e.preventDefault());
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function De(e) {
|
|
1228
1228
|
let t = 0, n = 0;
|
|
1229
1229
|
const o = {};
|
|
1230
1230
|
for (const r of e)
|
|
@@ -1242,19 +1242,19 @@ function Te(e) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
return o;
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function Ct(e, t, n) {
|
|
1246
1246
|
if (!n[0])
|
|
1247
1247
|
return;
|
|
1248
1248
|
const i = e.panels.find((u) => u.element === t);
|
|
1249
1249
|
if (!i || !i.onResize)
|
|
1250
1250
|
return;
|
|
1251
|
-
const r =
|
|
1251
|
+
const r = W({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1252
1252
|
asPercentage: D(l / r * 100),
|
|
1253
1253
|
inPixels: l
|
|
1254
1254
|
};
|
|
1255
1255
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function Pt(e, t) {
|
|
1258
1258
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1259
1259
|
return !1;
|
|
1260
1260
|
for (const o in e)
|
|
@@ -1262,7 +1262,7 @@ function Et(e, t) {
|
|
|
1262
1262
|
return !1;
|
|
1263
1263
|
return !0;
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function Rt(e, t) {
|
|
1266
1266
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1267
1267
|
if (n.length !== o.length)
|
|
1268
1268
|
return !1;
|
|
@@ -1271,8 +1271,8 @@ function kt(e, t) {
|
|
|
1271
1271
|
return !1;
|
|
1272
1272
|
return !0;
|
|
1273
1273
|
}
|
|
1274
|
-
const
|
|
1275
|
-
function
|
|
1274
|
+
const j = /* @__PURE__ */ new Map();
|
|
1275
|
+
function Mt(e) {
|
|
1276
1276
|
let t = !0;
|
|
1277
1277
|
z(
|
|
1278
1278
|
e.element.ownerDocument.defaultView,
|
|
@@ -1283,23 +1283,23 @@ function Gt(e) {
|
|
|
1283
1283
|
const { borderBoxSize: p, target: g } = d;
|
|
1284
1284
|
if (g === e.element) {
|
|
1285
1285
|
if (t) {
|
|
1286
|
-
if (
|
|
1286
|
+
if (W({ group: e }) === 0)
|
|
1287
1287
|
return;
|
|
1288
1288
|
M((x) => {
|
|
1289
1289
|
const S = x.mountedGroups.get(e);
|
|
1290
1290
|
if (S) {
|
|
1291
|
-
const
|
|
1292
|
-
layout:
|
|
1293
|
-
panelConstraints:
|
|
1291
|
+
const L = Se(e), P = S.defaultLayoutDeferred ? De(L) : S.layout, b = _({
|
|
1292
|
+
layout: P,
|
|
1293
|
+
panelConstraints: L
|
|
1294
1294
|
});
|
|
1295
|
-
return !S.defaultLayoutDeferred &&
|
|
1295
|
+
return !S.defaultLayoutDeferred && A(P, b) && Pt(
|
|
1296
1296
|
S.derivedPanelConstraints,
|
|
1297
|
-
|
|
1297
|
+
L
|
|
1298
1298
|
) ? x : {
|
|
1299
1299
|
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1300
1300
|
defaultLayoutDeferred: !1,
|
|
1301
|
-
derivedPanelConstraints:
|
|
1302
|
-
layout:
|
|
1301
|
+
derivedPanelConstraints: L,
|
|
1302
|
+
layout: b,
|
|
1303
1303
|
separatorToPanels: S.separatorToPanels
|
|
1304
1304
|
})
|
|
1305
1305
|
};
|
|
@@ -1308,7 +1308,7 @@ function Gt(e) {
|
|
|
1308
1308
|
});
|
|
1309
1309
|
}
|
|
1310
1310
|
} else
|
|
1311
|
-
|
|
1311
|
+
Ct(e, g, p);
|
|
1312
1312
|
}
|
|
1313
1313
|
});
|
|
1314
1314
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
@@ -1317,25 +1317,25 @@ function Gt(e) {
|
|
|
1317
1317
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1318
1318
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1319
1319
|
});
|
|
1320
|
-
const l =
|
|
1320
|
+
const l = W({ group: e }), s = Se(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1321
1321
|
let u = e.defaultLayout;
|
|
1322
|
-
u && (
|
|
1323
|
-
const c = e.inMemoryLayouts[a] ?? u ??
|
|
1322
|
+
u && (Rt(e.panels, u) || (u = void 0));
|
|
1323
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = _({
|
|
1324
1324
|
layout: c,
|
|
1325
1325
|
panelConstraints: s
|
|
1326
|
-
}), y = He(e),
|
|
1326
|
+
}), y = He(e), m = e.element.ownerDocument;
|
|
1327
1327
|
return M((f) => {
|
|
1328
1328
|
const d = /* @__PURE__ */ new Map();
|
|
1329
|
-
return
|
|
1330
|
-
|
|
1331
|
-
(
|
|
1329
|
+
return j.set(
|
|
1330
|
+
m,
|
|
1331
|
+
(j.get(m) ?? 0) + 1
|
|
1332
1332
|
), y.forEach((p) => {
|
|
1333
1333
|
p.separator && d.set(p.separator, p.panels);
|
|
1334
1334
|
}), {
|
|
1335
1335
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1336
1336
|
defaultLayoutDeferred: l === 0,
|
|
1337
1337
|
derivedPanelConstraints: s,
|
|
1338
|
-
layout:
|
|
1338
|
+
layout: h,
|
|
1339
1339
|
separatorToPanels: d
|
|
1340
1340
|
})
|
|
1341
1341
|
};
|
|
@@ -1343,47 +1343,47 @@ function Gt(e) {
|
|
|
1343
1343
|
z(
|
|
1344
1344
|
!i.has(f.id),
|
|
1345
1345
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1346
|
-
), i.add(f.id), f.element.addEventListener("keydown",
|
|
1347
|
-
}),
|
|
1348
|
-
t = !1,
|
|
1349
|
-
|
|
1350
|
-
Math.max(0, (
|
|
1346
|
+
), i.add(f.id), f.element.addEventListener("keydown", we);
|
|
1347
|
+
}), j.get(m) === 1 && (m.addEventListener("dblclick", be, !0), m.addEventListener("pointerdown", Le, !0), m.addEventListener("pointerleave", Ee), m.addEventListener("pointermove", Ge), m.addEventListener("pointerout", ke), m.addEventListener("pointerup", Ie, !0)), function() {
|
|
1348
|
+
t = !1, j.set(
|
|
1349
|
+
m,
|
|
1350
|
+
Math.max(0, (j.get(m) ?? 0) - 1)
|
|
1351
1351
|
), M((d) => {
|
|
1352
1352
|
const p = new Map(d.mountedGroups);
|
|
1353
1353
|
return p.delete(e), { mountedGroups: p };
|
|
1354
1354
|
}), e.separators.forEach((d) => {
|
|
1355
|
-
d.element.removeEventListener("keydown",
|
|
1356
|
-
}),
|
|
1355
|
+
d.element.removeEventListener("keydown", we);
|
|
1356
|
+
}), j.get(m) || (m.removeEventListener(
|
|
1357
1357
|
"dblclick",
|
|
1358
|
-
|
|
1358
|
+
be,
|
|
1359
1359
|
!0
|
|
1360
|
-
),
|
|
1360
|
+
), m.removeEventListener(
|
|
1361
1361
|
"pointerdown",
|
|
1362
|
-
|
|
1362
|
+
Le,
|
|
1363
1363
|
!0
|
|
1364
|
-
),
|
|
1364
|
+
), m.removeEventListener("pointerleave", Ee), m.removeEventListener("pointermove", Ge), m.removeEventListener("pointerout", ke), m.removeEventListener("pointerup", Ie, !0)), r.disconnect();
|
|
1365
1365
|
};
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1368
|
-
const [e, t] =
|
|
1367
|
+
function Et() {
|
|
1368
|
+
const [e, t] = Y({}), n = K(() => t({}), []);
|
|
1369
1369
|
return [e, n];
|
|
1370
1370
|
}
|
|
1371
1371
|
function me(e) {
|
|
1372
|
-
const t =
|
|
1372
|
+
const t = tt();
|
|
1373
1373
|
return `${e ?? t}`;
|
|
1374
1374
|
}
|
|
1375
|
-
const
|
|
1376
|
-
function
|
|
1377
|
-
const t =
|
|
1378
|
-
return
|
|
1375
|
+
const F = typeof window < "u" ? Oe : Te;
|
|
1376
|
+
function X(e) {
|
|
1377
|
+
const t = k(e);
|
|
1378
|
+
return F(() => {
|
|
1379
1379
|
t.current = e;
|
|
1380
|
-
}, [e]),
|
|
1380
|
+
}, [e]), K(
|
|
1381
1381
|
(...n) => t.current?.(...n),
|
|
1382
1382
|
[t]
|
|
1383
1383
|
);
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1386
|
-
return
|
|
1385
|
+
function he(...e) {
|
|
1386
|
+
return X((t) => {
|
|
1387
1387
|
e.forEach((n) => {
|
|
1388
1388
|
if (n)
|
|
1389
1389
|
switch (typeof n) {
|
|
@@ -1399,27 +1399,27 @@ function ge(...e) {
|
|
|
1399
1399
|
});
|
|
1400
1400
|
});
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const t =
|
|
1404
|
-
return
|
|
1402
|
+
function Gt(e) {
|
|
1403
|
+
const t = k({ ...e });
|
|
1404
|
+
return F(() => {
|
|
1405
1405
|
for (const n in e)
|
|
1406
1406
|
t.current[n] = e[n];
|
|
1407
1407
|
}, [e]), t.current;
|
|
1408
1408
|
}
|
|
1409
|
-
const Je =
|
|
1410
|
-
function
|
|
1411
|
-
const n =
|
|
1409
|
+
const Je = nt(null);
|
|
1410
|
+
function kt(e, t) {
|
|
1411
|
+
const n = k({
|
|
1412
1412
|
getLayout: () => ({}),
|
|
1413
|
-
setLayout:
|
|
1413
|
+
setLayout: wt
|
|
1414
1414
|
});
|
|
1415
|
-
|
|
1415
|
+
Ne(t, () => n.current, []), F(() => {
|
|
1416
1416
|
Object.assign(
|
|
1417
1417
|
n.current,
|
|
1418
|
-
|
|
1418
|
+
We({ groupId: e })
|
|
1419
1419
|
);
|
|
1420
1420
|
});
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1422
|
+
function It({
|
|
1423
1423
|
children: e,
|
|
1424
1424
|
className: t,
|
|
1425
1425
|
defaultLayout: n,
|
|
@@ -1431,138 +1431,130 @@ function Tt({
|
|
|
1431
1431
|
onLayoutChange: a,
|
|
1432
1432
|
onLayoutChanged: u,
|
|
1433
1433
|
orientation: c = "horizontal",
|
|
1434
|
-
resizeTargetMinimumSize:
|
|
1434
|
+
resizeTargetMinimumSize: h = {
|
|
1435
1435
|
coarse: 20,
|
|
1436
1436
|
fine: 10
|
|
1437
1437
|
},
|
|
1438
1438
|
style: y,
|
|
1439
|
-
...
|
|
1439
|
+
...m
|
|
1440
1440
|
}) {
|
|
1441
|
-
const f =
|
|
1441
|
+
const f = k({
|
|
1442
1442
|
onLayoutChange: {},
|
|
1443
1443
|
onLayoutChanged: {}
|
|
1444
|
-
}), d =
|
|
1445
|
-
|
|
1446
|
-
}), p =
|
|
1447
|
-
|
|
1448
|
-
}), g = me(s), v =
|
|
1444
|
+
}), d = X((w) => {
|
|
1445
|
+
A(f.current.onLayoutChange, w) || (f.current.onLayoutChange = w, a?.(w));
|
|
1446
|
+
}), p = X((w) => {
|
|
1447
|
+
A(f.current.onLayoutChanged, w) || (f.current.onLayoutChanged = w, u?.(w));
|
|
1448
|
+
}), g = me(s), v = k(null), [x, S] = Et(), L = k({
|
|
1449
1449
|
lastExpandedPanelSizes: {},
|
|
1450
1450
|
layouts: {},
|
|
1451
1451
|
panels: [],
|
|
1452
|
-
resizeTargetMinimumSize:
|
|
1452
|
+
resizeTargetMinimumSize: h,
|
|
1453
1453
|
separators: []
|
|
1454
|
-
}),
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
(
|
|
1458
|
-
const { interactionState:
|
|
1459
|
-
for (const
|
|
1460
|
-
if (
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1463
|
-
let
|
|
1464
|
-
switch (
|
|
1454
|
+
}), P = he(v, r);
|
|
1455
|
+
kt(g, l);
|
|
1456
|
+
const b = X(
|
|
1457
|
+
(w, C) => {
|
|
1458
|
+
const { interactionState: G, mountedGroups: Q } = E();
|
|
1459
|
+
for (const ee of Q.keys())
|
|
1460
|
+
if (ee.id === w) {
|
|
1461
|
+
const U = Q.get(ee);
|
|
1462
|
+
if (U) {
|
|
1463
|
+
let te = !1;
|
|
1464
|
+
switch (G.state) {
|
|
1465
1465
|
case "active": {
|
|
1466
|
-
|
|
1467
|
-
(le) => le.group ===
|
|
1466
|
+
te = G.hitRegions.some(
|
|
1467
|
+
(le) => le.group === ee
|
|
1468
1468
|
);
|
|
1469
1469
|
break;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
1472
|
return {
|
|
1473
|
-
flexGrow:
|
|
1474
|
-
pointerEvents:
|
|
1473
|
+
flexGrow: U.layout[C] ?? 1,
|
|
1474
|
+
pointerEvents: te ? "none" : void 0
|
|
1475
1475
|
};
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
1478
|
return {
|
|
1479
|
-
flexGrow: n?.[
|
|
1479
|
+
flexGrow: n?.[C] ?? 1
|
|
1480
1480
|
};
|
|
1481
1481
|
}
|
|
1482
|
-
),
|
|
1482
|
+
), $ = Ae(
|
|
1483
1483
|
() => ({
|
|
1484
|
-
getPanelStyles:
|
|
1484
|
+
getPanelStyles: b,
|
|
1485
1485
|
id: g,
|
|
1486
1486
|
orientation: c,
|
|
1487
|
-
registerPanel: (
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1490
|
-
...
|
|
1491
|
-
|
|
1487
|
+
registerPanel: (w) => {
|
|
1488
|
+
const C = L.current;
|
|
1489
|
+
return C.panels = fe(c, [
|
|
1490
|
+
...C.panels,
|
|
1491
|
+
w
|
|
1492
1492
|
]), S(), () => {
|
|
1493
|
-
|
|
1494
|
-
(
|
|
1493
|
+
C.panels = C.panels.filter(
|
|
1494
|
+
(G) => G !== w
|
|
1495
1495
|
), S();
|
|
1496
1496
|
};
|
|
1497
1497
|
},
|
|
1498
|
-
registerSeparator: (
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1501
|
-
...
|
|
1502
|
-
|
|
1498
|
+
registerSeparator: (w) => {
|
|
1499
|
+
const C = L.current;
|
|
1500
|
+
return C.separators = fe(c, [
|
|
1501
|
+
...C.separators,
|
|
1502
|
+
w
|
|
1503
1503
|
]), S(), () => {
|
|
1504
|
-
|
|
1505
|
-
(
|
|
1504
|
+
C.separators = C.separators.filter(
|
|
1505
|
+
(G) => G !== w
|
|
1506
1506
|
), S();
|
|
1507
1507
|
};
|
|
1508
1508
|
}
|
|
1509
1509
|
}),
|
|
1510
|
-
[
|
|
1511
|
-
),
|
|
1510
|
+
[b, g, S, c]
|
|
1511
|
+
), T = Gt({
|
|
1512
1512
|
defaultLayout: n,
|
|
1513
1513
|
disableCursor: o
|
|
1514
|
-
}),
|
|
1515
|
-
return
|
|
1516
|
-
const
|
|
1517
|
-
if (
|
|
1514
|
+
}), H = k(null);
|
|
1515
|
+
return F(() => {
|
|
1516
|
+
const w = v.current;
|
|
1517
|
+
if (w === null)
|
|
1518
1518
|
return;
|
|
1519
|
-
const
|
|
1520
|
-
defaultLayout:
|
|
1521
|
-
disableCursor: !!
|
|
1519
|
+
const C = L.current, G = {
|
|
1520
|
+
defaultLayout: T.defaultLayout,
|
|
1521
|
+
disableCursor: !!T.disableCursor,
|
|
1522
1522
|
disabled: !!i,
|
|
1523
|
-
element:
|
|
1523
|
+
element: w,
|
|
1524
1524
|
id: g,
|
|
1525
|
-
inMemoryLastExpandedPanelSizes:
|
|
1526
|
-
inMemoryLayouts:
|
|
1525
|
+
inMemoryLastExpandedPanelSizes: L.current.lastExpandedPanelSizes,
|
|
1526
|
+
inMemoryLayouts: L.current.layouts,
|
|
1527
1527
|
orientation: c,
|
|
1528
|
-
panels:
|
|
1529
|
-
resizeTargetMinimumSize:
|
|
1530
|
-
separators:
|
|
1528
|
+
panels: C.panels,
|
|
1529
|
+
resizeTargetMinimumSize: C.resizeTargetMinimumSize,
|
|
1530
|
+
separators: C.separators
|
|
1531
1531
|
};
|
|
1532
|
-
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1535
|
-
const { defaultLayoutDeferred:
|
|
1536
|
-
!
|
|
1537
|
-
ue.scheduleUpdate();
|
|
1538
|
-
}));
|
|
1532
|
+
H.current = G;
|
|
1533
|
+
const Q = Mt(G), U = E().mountedGroups.get(G);
|
|
1534
|
+
if (U) {
|
|
1535
|
+
const { defaultLayoutDeferred: B, derivedPanelConstraints: ne, layout: oe } = U;
|
|
1536
|
+
!B && ne.length > 0 && (d(oe), p(oe));
|
|
1539
1537
|
}
|
|
1540
|
-
|
|
1541
|
-
const le = N.addListener(
|
|
1538
|
+
const te = O.addListener(
|
|
1542
1539
|
"interactionStateChange",
|
|
1543
|
-
(
|
|
1544
|
-
|
|
1545
|
-
X !== A && (X = A, L.panels.forEach((V) => {
|
|
1546
|
-
V.scheduleUpdate();
|
|
1547
|
-
}));
|
|
1540
|
+
(B) => {
|
|
1541
|
+
B.state;
|
|
1548
1542
|
}
|
|
1549
|
-
),
|
|
1543
|
+
), le = O.addListener(
|
|
1550
1544
|
"mountedGroupsChange",
|
|
1551
|
-
(
|
|
1552
|
-
const
|
|
1553
|
-
if (
|
|
1554
|
-
const { defaultLayoutDeferred:
|
|
1555
|
-
if (
|
|
1545
|
+
(B) => {
|
|
1546
|
+
const ne = B.get(G);
|
|
1547
|
+
if (ne) {
|
|
1548
|
+
const { defaultLayoutDeferred: oe, derivedPanelConstraints: Ze, layout: ye } = ne;
|
|
1549
|
+
if (oe || Ze.length === 0)
|
|
1556
1550
|
return;
|
|
1557
|
-
const { interactionState:
|
|
1558
|
-
d(
|
|
1559
|
-
nt.scheduleUpdate();
|
|
1560
|
-
});
|
|
1551
|
+
const { interactionState: Qe } = E(), et = Qe.state !== "active";
|
|
1552
|
+
d(ye), et && p(ye);
|
|
1561
1553
|
}
|
|
1562
1554
|
}
|
|
1563
1555
|
);
|
|
1564
1556
|
return () => {
|
|
1565
|
-
|
|
1557
|
+
H.current = null, Q(), te(), le();
|
|
1566
1558
|
};
|
|
1567
1559
|
}, [
|
|
1568
1560
|
i,
|
|
@@ -1571,19 +1563,19 @@ function Tt({
|
|
|
1571
1563
|
d,
|
|
1572
1564
|
c,
|
|
1573
1565
|
x,
|
|
1574
|
-
|
|
1575
|
-
]),
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1578
|
-
}), /* @__PURE__ */
|
|
1566
|
+
T
|
|
1567
|
+
]), Te(() => {
|
|
1568
|
+
const w = H.current;
|
|
1569
|
+
w && (w.defaultLayout = n, w.disableCursor = !!o);
|
|
1570
|
+
}), /* @__PURE__ */ q(Je.Provider, { value: $, children: /* @__PURE__ */ q(
|
|
1579
1571
|
"div",
|
|
1580
1572
|
{
|
|
1581
|
-
...
|
|
1573
|
+
...m,
|
|
1582
1574
|
className: t,
|
|
1583
1575
|
"data-group": !0,
|
|
1584
1576
|
"data-testid": g,
|
|
1585
1577
|
id: g,
|
|
1586
|
-
ref:
|
|
1578
|
+
ref: P,
|
|
1587
1579
|
style: {
|
|
1588
1580
|
height: "100%",
|
|
1589
1581
|
width: "100%",
|
|
@@ -1597,49 +1589,49 @@ function Tt({
|
|
|
1597
1589
|
}
|
|
1598
1590
|
) });
|
|
1599
1591
|
}
|
|
1600
|
-
|
|
1601
|
-
function
|
|
1592
|
+
It.displayName = "Group";
|
|
1593
|
+
function ce(e, t) {
|
|
1602
1594
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1603
1595
|
}
|
|
1604
|
-
function
|
|
1596
|
+
function Ht({
|
|
1605
1597
|
debounceSaveMs: e = 100,
|
|
1606
1598
|
panelIds: t,
|
|
1607
1599
|
storage: n = localStorage,
|
|
1608
1600
|
...o
|
|
1609
1601
|
}) {
|
|
1610
|
-
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l =
|
|
1611
|
-
|
|
1602
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = ce(r, t ?? []), s = _e(
|
|
1603
|
+
Dt,
|
|
1612
1604
|
() => n.getItem(l),
|
|
1613
1605
|
() => n.getItem(l)
|
|
1614
|
-
), a =
|
|
1606
|
+
), a = Ae(
|
|
1615
1607
|
() => s ? JSON.parse(s) : void 0,
|
|
1616
1608
|
[s]
|
|
1617
|
-
), u =
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1609
|
+
), u = k(null), c = K(() => {
|
|
1610
|
+
const m = u.current;
|
|
1611
|
+
m && (u.current = null, clearTimeout(m));
|
|
1620
1612
|
}, []);
|
|
1621
1613
|
Oe(() => () => {
|
|
1622
1614
|
c();
|
|
1623
1615
|
}, [c]);
|
|
1624
|
-
const
|
|
1625
|
-
(
|
|
1616
|
+
const h = K(
|
|
1617
|
+
(m) => {
|
|
1626
1618
|
c();
|
|
1627
1619
|
let f;
|
|
1628
|
-
i ? f =
|
|
1620
|
+
i ? f = ce(r, Object.keys(m)) : f = ce(r, []);
|
|
1629
1621
|
try {
|
|
1630
|
-
n.setItem(f, JSON.stringify(
|
|
1622
|
+
n.setItem(f, JSON.stringify(m));
|
|
1631
1623
|
} catch (d) {
|
|
1632
1624
|
console.error(d);
|
|
1633
1625
|
}
|
|
1634
1626
|
},
|
|
1635
1627
|
[c, i, r, n]
|
|
1636
|
-
), y =
|
|
1637
|
-
(
|
|
1638
|
-
c(), e === 0 ? m
|
|
1639
|
-
m
|
|
1628
|
+
), y = K(
|
|
1629
|
+
(m) => {
|
|
1630
|
+
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1631
|
+
h(m);
|
|
1640
1632
|
}, e);
|
|
1641
1633
|
},
|
|
1642
|
-
[c, e,
|
|
1634
|
+
[c, e, h]
|
|
1643
1635
|
);
|
|
1644
1636
|
return {
|
|
1645
1637
|
/**
|
|
@@ -1655,45 +1647,45 @@ function Vt({
|
|
|
1655
1647
|
/**
|
|
1656
1648
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1657
1649
|
*/
|
|
1658
|
-
onLayoutChanged:
|
|
1650
|
+
onLayoutChanged: h
|
|
1659
1651
|
};
|
|
1660
1652
|
}
|
|
1661
|
-
function
|
|
1653
|
+
function Dt() {
|
|
1662
1654
|
return function() {
|
|
1663
1655
|
};
|
|
1664
1656
|
}
|
|
1665
|
-
function
|
|
1666
|
-
return
|
|
1657
|
+
function jt() {
|
|
1658
|
+
return Y(null);
|
|
1667
1659
|
}
|
|
1668
|
-
function
|
|
1669
|
-
return
|
|
1660
|
+
function Vt() {
|
|
1661
|
+
return k(null);
|
|
1670
1662
|
}
|
|
1671
|
-
function
|
|
1672
|
-
const e =
|
|
1663
|
+
function ge() {
|
|
1664
|
+
const e = ot(Je);
|
|
1673
1665
|
return z(
|
|
1674
1666
|
e,
|
|
1675
1667
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1676
1668
|
), e;
|
|
1677
1669
|
}
|
|
1678
|
-
function
|
|
1679
|
-
const { id: n } =
|
|
1680
|
-
collapse:
|
|
1681
|
-
expand:
|
|
1670
|
+
function Ot(e, t) {
|
|
1671
|
+
const { id: n } = ge(), o = k({
|
|
1672
|
+
collapse: ue,
|
|
1673
|
+
expand: ue,
|
|
1682
1674
|
getSize: () => ({
|
|
1683
1675
|
asPercentage: 0,
|
|
1684
1676
|
inPixels: 0
|
|
1685
1677
|
}),
|
|
1686
1678
|
isCollapsed: () => !1,
|
|
1687
|
-
resize:
|
|
1679
|
+
resize: ue
|
|
1688
1680
|
});
|
|
1689
|
-
|
|
1681
|
+
Ne(t, () => o.current, []), F(() => {
|
|
1690
1682
|
Object.assign(
|
|
1691
1683
|
o.current,
|
|
1692
1684
|
Ve({ groupId: n, panelId: e })
|
|
1693
1685
|
);
|
|
1694
1686
|
});
|
|
1695
1687
|
}
|
|
1696
|
-
function
|
|
1688
|
+
function Tt({
|
|
1697
1689
|
children: e,
|
|
1698
1690
|
className: t,
|
|
1699
1691
|
collapsedSize: n = "0%",
|
|
@@ -1705,50 +1697,56 @@ function _t({
|
|
|
1705
1697
|
minSize: a = "0%",
|
|
1706
1698
|
onResize: u,
|
|
1707
1699
|
panelRef: c,
|
|
1708
|
-
style:
|
|
1700
|
+
style: h,
|
|
1709
1701
|
...y
|
|
1710
1702
|
}) {
|
|
1711
|
-
const
|
|
1712
|
-
(
|
|
1713
|
-
u?.(
|
|
1703
|
+
const m = !!l, f = me(l), d = k(null), p = he(d, r), { getPanelStyles: g, id: v, registerPanel: x } = ge(), S = u !== null, L = X(
|
|
1704
|
+
(b, $, T) => {
|
|
1705
|
+
u?.(b, l, T);
|
|
1714
1706
|
}
|
|
1715
1707
|
);
|
|
1716
|
-
|
|
1717
|
-
const
|
|
1718
|
-
if (
|
|
1719
|
-
return
|
|
1720
|
-
element:
|
|
1708
|
+
F(() => {
|
|
1709
|
+
const b = d.current;
|
|
1710
|
+
if (b !== null)
|
|
1711
|
+
return x({
|
|
1712
|
+
element: b,
|
|
1721
1713
|
id: f,
|
|
1722
|
-
idIsStable:
|
|
1714
|
+
idIsStable: m,
|
|
1723
1715
|
mutableValues: {
|
|
1724
1716
|
expandToSize: void 0,
|
|
1725
1717
|
prevSize: void 0
|
|
1726
1718
|
},
|
|
1727
|
-
onResize:
|
|
1719
|
+
onResize: S ? L : void 0,
|
|
1728
1720
|
panelConstraints: {
|
|
1729
1721
|
collapsedSize: n,
|
|
1730
1722
|
collapsible: o,
|
|
1731
1723
|
defaultSize: i,
|
|
1732
1724
|
maxSize: s,
|
|
1733
1725
|
minSize: a
|
|
1734
|
-
}
|
|
1735
|
-
scheduleUpdate: g
|
|
1726
|
+
}
|
|
1736
1727
|
});
|
|
1737
1728
|
}, [
|
|
1738
1729
|
n,
|
|
1739
1730
|
o,
|
|
1740
1731
|
i,
|
|
1741
|
-
|
|
1742
|
-
w,
|
|
1732
|
+
S,
|
|
1743
1733
|
f,
|
|
1744
|
-
|
|
1734
|
+
m,
|
|
1745
1735
|
s,
|
|
1746
1736
|
a,
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
]),
|
|
1750
|
-
const P =
|
|
1751
|
-
|
|
1737
|
+
L,
|
|
1738
|
+
x
|
|
1739
|
+
]), Ot(f, c);
|
|
1740
|
+
const P = _e(
|
|
1741
|
+
(b) => (O.addListener("mountedGroupsChange", b), () => {
|
|
1742
|
+
O.removeListener("mountedGroupsChange", b);
|
|
1743
|
+
}),
|
|
1744
|
+
// useSyncExternalStore does not support a custom equality check
|
|
1745
|
+
// stringify avoids re-rendering when the style value hasn't changed
|
|
1746
|
+
() => JSON.stringify(g(v, f)),
|
|
1747
|
+
() => JSON.stringify(g(v, f))
|
|
1748
|
+
);
|
|
1749
|
+
return /* @__PURE__ */ q(
|
|
1752
1750
|
"div",
|
|
1753
1751
|
{
|
|
1754
1752
|
...y,
|
|
@@ -1763,9 +1761,9 @@ function _t({
|
|
|
1763
1761
|
flexShrink: 1,
|
|
1764
1762
|
// Prevent Panel content from interfering with panel size
|
|
1765
1763
|
overflow: "hidden",
|
|
1766
|
-
...P
|
|
1764
|
+
...JSON.parse(P)
|
|
1767
1765
|
},
|
|
1768
|
-
children: /* @__PURE__ */
|
|
1766
|
+
children: /* @__PURE__ */ q(
|
|
1769
1767
|
"div",
|
|
1770
1768
|
{
|
|
1771
1769
|
className: t,
|
|
@@ -1773,7 +1771,7 @@ function _t({
|
|
|
1773
1771
|
maxHeight: "100%",
|
|
1774
1772
|
maxWidth: "100%",
|
|
1775
1773
|
flexGrow: 1,
|
|
1776
|
-
...
|
|
1774
|
+
...h
|
|
1777
1775
|
},
|
|
1778
1776
|
children: e
|
|
1779
1777
|
}
|
|
@@ -1781,7 +1779,7 @@ function _t({
|
|
|
1781
1779
|
}
|
|
1782
1780
|
);
|
|
1783
1781
|
}
|
|
1784
|
-
|
|
1782
|
+
Tt.displayName = "Panel";
|
|
1785
1783
|
const Nt = {
|
|
1786
1784
|
minHeight: 0,
|
|
1787
1785
|
maxHeight: "100%",
|
|
@@ -1794,13 +1792,13 @@ const Nt = {
|
|
|
1794
1792
|
padding: 0,
|
|
1795
1793
|
margin: 0
|
|
1796
1794
|
};
|
|
1797
|
-
function
|
|
1798
|
-
return
|
|
1795
|
+
function Wt() {
|
|
1796
|
+
return Y(null);
|
|
1799
1797
|
}
|
|
1800
|
-
function
|
|
1801
|
-
return
|
|
1798
|
+
function Ut() {
|
|
1799
|
+
return k(null);
|
|
1802
1800
|
}
|
|
1803
|
-
function
|
|
1801
|
+
function At({
|
|
1804
1802
|
layout: e,
|
|
1805
1803
|
panelConstraints: t,
|
|
1806
1804
|
panelId: n,
|
|
@@ -1812,8 +1810,8 @@ function Ft({
|
|
|
1812
1810
|
);
|
|
1813
1811
|
if (s) {
|
|
1814
1812
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1815
|
-
r =
|
|
1816
|
-
layout:
|
|
1813
|
+
r = _({
|
|
1814
|
+
layout: Z({
|
|
1817
1815
|
delta: u - l,
|
|
1818
1816
|
initialLayout: e,
|
|
1819
1817
|
panelConstraints: t,
|
|
@@ -1821,8 +1819,8 @@ function Ft({
|
|
|
1821
1819
|
prevLayout: e
|
|
1822
1820
|
}),
|
|
1823
1821
|
panelConstraints: t
|
|
1824
|
-
})[n], i =
|
|
1825
|
-
layout:
|
|
1822
|
+
})[n], i = _({
|
|
1823
|
+
layout: Z({
|
|
1826
1824
|
delta: a - l,
|
|
1827
1825
|
initialLayout: e,
|
|
1828
1826
|
panelConstraints: t,
|
|
@@ -1839,7 +1837,7 @@ function Ft({
|
|
|
1839
1837
|
valueNow: l
|
|
1840
1838
|
};
|
|
1841
1839
|
}
|
|
1842
|
-
function
|
|
1840
|
+
function _t({
|
|
1843
1841
|
children: e,
|
|
1844
1842
|
className: t,
|
|
1845
1843
|
elementRef: n,
|
|
@@ -1847,41 +1845,41 @@ function $t({
|
|
|
1847
1845
|
style: i,
|
|
1848
1846
|
...r
|
|
1849
1847
|
}) {
|
|
1850
|
-
const l = me(o), [s, a] =
|
|
1851
|
-
id:
|
|
1848
|
+
const l = me(o), [s, a] = Y({}), [u, c] = Y("inactive"), h = k(null), y = he(h, n), {
|
|
1849
|
+
id: m,
|
|
1852
1850
|
orientation: f,
|
|
1853
1851
|
registerSeparator: d
|
|
1854
|
-
} =
|
|
1855
|
-
return
|
|
1856
|
-
const g =
|
|
1852
|
+
} = ge(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1853
|
+
return F(() => {
|
|
1854
|
+
const g = h.current;
|
|
1857
1855
|
if (g !== null) {
|
|
1858
1856
|
const v = {
|
|
1859
1857
|
element: g,
|
|
1860
1858
|
id: l
|
|
1861
|
-
}, x = d(v), S =
|
|
1859
|
+
}, x = d(v), S = O.addListener(
|
|
1862
1860
|
"interactionStateChange",
|
|
1863
|
-
(
|
|
1861
|
+
(P) => {
|
|
1864
1862
|
c(
|
|
1865
|
-
|
|
1866
|
-
(
|
|
1867
|
-
) ?
|
|
1863
|
+
P.state !== "inactive" && P.hitRegions.some(
|
|
1864
|
+
(b) => b.separator === v
|
|
1865
|
+
) ? P.state : "inactive"
|
|
1868
1866
|
);
|
|
1869
1867
|
}
|
|
1870
|
-
),
|
|
1868
|
+
), L = O.addListener(
|
|
1871
1869
|
"mountedGroupsChange",
|
|
1872
|
-
(
|
|
1873
|
-
|
|
1874
|
-
({ derivedPanelConstraints:
|
|
1875
|
-
if (
|
|
1876
|
-
const
|
|
1877
|
-
if (
|
|
1878
|
-
const
|
|
1870
|
+
(P) => {
|
|
1871
|
+
P.forEach(
|
|
1872
|
+
({ derivedPanelConstraints: b, layout: $, separatorToPanels: T }, H) => {
|
|
1873
|
+
if (H.id === m) {
|
|
1874
|
+
const w = T.get(v);
|
|
1875
|
+
if (w) {
|
|
1876
|
+
const C = w[0], G = H.panels.indexOf(C);
|
|
1879
1877
|
a(
|
|
1880
|
-
|
|
1881
|
-
layout:
|
|
1882
|
-
panelConstraints:
|
|
1883
|
-
panelId:
|
|
1884
|
-
panelIndex:
|
|
1878
|
+
At({
|
|
1879
|
+
layout: $,
|
|
1880
|
+
panelConstraints: b,
|
|
1881
|
+
panelId: C.id,
|
|
1882
|
+
panelIndex: G
|
|
1885
1883
|
})
|
|
1886
1884
|
);
|
|
1887
1885
|
}
|
|
@@ -1891,10 +1889,10 @@ function $t({
|
|
|
1891
1889
|
}
|
|
1892
1890
|
);
|
|
1893
1891
|
return () => {
|
|
1894
|
-
S(),
|
|
1892
|
+
S(), L(), x();
|
|
1895
1893
|
};
|
|
1896
1894
|
}
|
|
1897
|
-
}, [
|
|
1895
|
+
}, [m, l, d]), /* @__PURE__ */ q(
|
|
1898
1896
|
"div",
|
|
1899
1897
|
{
|
|
1900
1898
|
...r,
|
|
@@ -1920,16 +1918,16 @@ function $t({
|
|
|
1920
1918
|
}
|
|
1921
1919
|
);
|
|
1922
1920
|
}
|
|
1923
|
-
|
|
1921
|
+
_t.displayName = "Separator";
|
|
1924
1922
|
export {
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1923
|
+
It as Group,
|
|
1924
|
+
Tt as Panel,
|
|
1925
|
+
_t as Separator,
|
|
1926
|
+
at as isCoarsePointer,
|
|
1927
|
+
Ht as useDefaultLayout,
|
|
1928
|
+
jt as useGroupCallbackRef,
|
|
1929
|
+
Vt as useGroupRef,
|
|
1930
|
+
Wt as usePanelCallbackRef,
|
|
1931
|
+
Ut as usePanelRef
|
|
1934
1932
|
};
|
|
1935
1933
|
//# sourceMappingURL=react-resizable-panels.js.map
|