react-resizable-panels 4.2.1 → 4.2.2-issue-572
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as q } from "react/jsx-runtime";
|
|
3
|
-
import { useState as N, useCallback as
|
|
3
|
+
import { useState as N, useCallback as Ce, useId as Xe, useLayoutEffect as qe, useEffect as Ee, useRef as k, createContext as Ye, useImperativeHandle as Me, useMemo as ae, useSyncExternalStore as Ze, useContext as Je } 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 le(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? Qe : et
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Qe(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 et(e, t) {
|
|
24
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
25
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function ke(e) {
|
|
28
28
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Ie(e, t) {
|
|
31
31
|
return {
|
|
32
32
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
33
33
|
Math.abs(e.x - t.left),
|
|
@@ -39,7 +39,7 @@ function Ee(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function tt({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -50,15 +50,15 @@ function et({
|
|
|
50
50
|
};
|
|
51
51
|
let i, s = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x: r, y: a } =
|
|
53
|
+
const { x: r, y: a } = Ie(o, l), u = e === "horizontal" ? r : a;
|
|
54
54
|
u < s && (s = u, i = l);
|
|
55
55
|
}
|
|
56
56
|
return z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s =
|
|
58
|
+
function Ge(e) {
|
|
59
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, s = le(
|
|
60
60
|
n,
|
|
61
|
-
Array.from(t.children).filter(
|
|
61
|
+
Array.from(t.children).filter(ke).map((f) => ({ element: f }))
|
|
62
62
|
).map(({ element: f }) => f), l = [];
|
|
63
63
|
let r = !1, a, u = [];
|
|
64
64
|
for (const f of s)
|
|
@@ -86,7 +86,7 @@ function Ie(e) {
|
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
case 1: {
|
|
89
|
-
const g = u[0], v =
|
|
89
|
+
const g = u[0], v = tt({
|
|
90
90
|
orientation: n,
|
|
91
91
|
rects: [m, h],
|
|
92
92
|
targetRect: g.element.getBoundingClientRect()
|
|
@@ -119,7 +119,7 @@ function Ie(e) {
|
|
|
119
119
|
for (const d of c)
|
|
120
120
|
l.push({
|
|
121
121
|
group: e,
|
|
122
|
-
groupSize:
|
|
122
|
+
groupSize: W({ group: e }),
|
|
123
123
|
panels: [a, p],
|
|
124
124
|
separator: "width" in d ? void 0 : d,
|
|
125
125
|
rect: "width" in d ? d : d.element.getBoundingClientRect()
|
|
@@ -136,21 +136,21 @@ function Ie(e) {
|
|
|
136
136
|
r = !0;
|
|
137
137
|
return l;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function nt(e, t) {
|
|
140
140
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
141
141
|
return t * o;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function ot(e, t) {
|
|
144
144
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
145
145
|
return t * o;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function rt(e) {
|
|
148
148
|
return e / 100 * window.innerHeight;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function it(e) {
|
|
151
151
|
return e / 100 * window.innerWidth;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function st(e) {
|
|
154
154
|
switch (typeof e) {
|
|
155
155
|
case "number":
|
|
156
156
|
return [e, "px"];
|
|
@@ -166,7 +166,7 @@ function Q({
|
|
|
166
166
|
styleProp: n
|
|
167
167
|
}) {
|
|
168
168
|
let o;
|
|
169
|
-
const [i, s] =
|
|
169
|
+
const [i, s] = st(n);
|
|
170
170
|
switch (s) {
|
|
171
171
|
case "%": {
|
|
172
172
|
o = i / 100 * e;
|
|
@@ -177,19 +177,19 @@ function Q({
|
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
case "rem": {
|
|
180
|
-
o =
|
|
180
|
+
o = ot(t, i);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "em": {
|
|
184
|
-
o =
|
|
184
|
+
o = nt(t, i);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "vh": {
|
|
188
|
-
o =
|
|
188
|
+
o = rt(i);
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
case "vw": {
|
|
192
|
-
o =
|
|
192
|
+
o = it(i);
|
|
193
193
|
break;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -198,8 +198,8 @@ function Q({
|
|
|
198
198
|
function G(e) {
|
|
199
199
|
return parseFloat(e.toFixed(3));
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
const { panels: t } = e, n =
|
|
201
|
+
function he(e) {
|
|
202
|
+
const { panels: t } = e, n = W({ group: e });
|
|
203
203
|
return n === 0 ? t.map((o) => ({
|
|
204
204
|
collapsedSize: 0,
|
|
205
205
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -255,7 +255,7 @@ function pe(e) {
|
|
|
255
255
|
};
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class at {
|
|
259
259
|
#e = {};
|
|
260
260
|
addListener(t, n) {
|
|
261
261
|
const o = this.#e[t];
|
|
@@ -294,7 +294,7 @@ class st {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function P(e, t, n = 0) {
|
|
298
298
|
return Math.abs(G(e) - G(t)) <= n;
|
|
299
299
|
}
|
|
300
300
|
let M = {
|
|
@@ -304,7 +304,7 @@ let M = {
|
|
|
304
304
|
},
|
|
305
305
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
306
306
|
};
|
|
307
|
-
const
|
|
307
|
+
const O = new at();
|
|
308
308
|
function D() {
|
|
309
309
|
return M;
|
|
310
310
|
}
|
|
@@ -316,15 +316,15 @@ function I(e) {
|
|
|
316
316
|
return M = {
|
|
317
317
|
...M,
|
|
318
318
|
...t
|
|
319
|
-
}, t.cursorFlags !== void 0 &&
|
|
319
|
+
}, t.cursorFlags !== void 0 && O.emit("cursorFlagsChange", M.cursorFlags), t.interactionState !== void 0 && O.emit("interactionStateChange", M.interactionState), t.mountedGroups !== void 0 && (M.mountedGroups.forEach((o, i) => {
|
|
320
320
|
o.derivedPanelConstraints.forEach((s) => {
|
|
321
321
|
if (s.collapsible) {
|
|
322
322
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
323
323
|
if (l) {
|
|
324
|
-
const r =
|
|
324
|
+
const r = P(
|
|
325
325
|
s.collapsedSize,
|
|
326
326
|
o.layout[s.panelId]
|
|
327
|
-
), a =
|
|
327
|
+
), a = P(
|
|
328
328
|
s.collapsedSize,
|
|
329
329
|
l[s.panelId]
|
|
330
330
|
);
|
|
@@ -332,9 +332,9 @@ function I(e) {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
-
}),
|
|
335
|
+
}), O.emit("mountedGroupsChange", M.mountedGroups)), M;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function lt(e, t) {
|
|
338
338
|
if (e.length !== t.length)
|
|
339
339
|
return !1;
|
|
340
340
|
for (let n = 0; n < e.length; n++)
|
|
@@ -343,9 +343,9 @@ function at(e, t) {
|
|
|
343
343
|
return !0;
|
|
344
344
|
}
|
|
345
345
|
function Y(e, t) {
|
|
346
|
-
return
|
|
346
|
+
return P(e, t) ? 0 : e > t ? 1 : -1;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function B({
|
|
349
349
|
panelConstraints: e,
|
|
350
350
|
size: t
|
|
351
351
|
}) {
|
|
@@ -371,7 +371,7 @@ function Z({
|
|
|
371
371
|
prevLayout: i,
|
|
372
372
|
trigger: s
|
|
373
373
|
}) {
|
|
374
|
-
if (
|
|
374
|
+
if (P(e, 0))
|
|
375
375
|
return t;
|
|
376
376
|
const l = Object.values(t), r = Object.values(i), a = [...l], [u, f] = o;
|
|
377
377
|
z(u != null, "Invalid first pivot index"), z(f != null, "Invalid second pivot index");
|
|
@@ -393,7 +393,7 @@ function Z({
|
|
|
393
393
|
if (z(
|
|
394
394
|
x != null,
|
|
395
395
|
`Previous layout not found for panel index ${c}`
|
|
396
|
-
),
|
|
396
|
+
), P(x, y)) {
|
|
397
397
|
const S = v - x;
|
|
398
398
|
Y(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
399
399
|
}
|
|
@@ -415,7 +415,7 @@ function Z({
|
|
|
415
415
|
if (z(
|
|
416
416
|
x != null,
|
|
417
417
|
`Previous layout not found for panel index ${c}`
|
|
418
|
-
),
|
|
418
|
+
), P(x, v)) {
|
|
419
419
|
const S = x - y;
|
|
420
420
|
Y(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
421
421
|
}
|
|
@@ -431,7 +431,7 @@ function Z({
|
|
|
431
431
|
v != null,
|
|
432
432
|
`Previous layout not found for panel index ${d}`
|
|
433
433
|
);
|
|
434
|
-
const S =
|
|
434
|
+
const S = B({
|
|
435
435
|
panelConstraints: n[d],
|
|
436
436
|
size: 100
|
|
437
437
|
}) - v;
|
|
@@ -449,18 +449,18 @@ function Z({
|
|
|
449
449
|
g != null,
|
|
450
450
|
`Previous layout not found for panel index ${d}`
|
|
451
451
|
);
|
|
452
|
-
const v = g - y, x =
|
|
452
|
+
const v = g - y, x = B({
|
|
453
453
|
panelConstraints: n[d],
|
|
454
454
|
size: v
|
|
455
455
|
});
|
|
456
|
-
if (!
|
|
456
|
+
if (!P(g, x) && (p += g - x, a[d] = x, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
457
457
|
numeric: !0
|
|
458
458
|
}) >= 0))
|
|
459
459
|
break;
|
|
460
460
|
e < 0 ? d-- : d++;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
if (
|
|
463
|
+
if (lt(r, a))
|
|
464
464
|
return i;
|
|
465
465
|
{
|
|
466
466
|
const c = e < 0 ? f : u, d = l[c];
|
|
@@ -468,11 +468,11 @@ function Z({
|
|
|
468
468
|
d != null,
|
|
469
469
|
`Previous layout not found for panel index ${c}`
|
|
470
470
|
);
|
|
471
|
-
const y = d + p, g =
|
|
471
|
+
const y = d + p, g = B({
|
|
472
472
|
panelConstraints: n[c],
|
|
473
473
|
size: y
|
|
474
474
|
});
|
|
475
|
-
if (a[c] = g, !
|
|
475
|
+
if (a[c] = g, !P(g, y)) {
|
|
476
476
|
let v = y - g, S = e < 0 ? f : u;
|
|
477
477
|
for (; S >= 0 && S < n.length; ) {
|
|
478
478
|
const b = a[S];
|
|
@@ -480,11 +480,11 @@ function Z({
|
|
|
480
480
|
b != null,
|
|
481
481
|
`Previous layout not found for panel index ${S}`
|
|
482
482
|
);
|
|
483
|
-
const w = b + v,
|
|
483
|
+
const w = b + v, R = B({
|
|
484
484
|
panelConstraints: n[S],
|
|
485
485
|
size: w
|
|
486
486
|
});
|
|
487
|
-
if (
|
|
487
|
+
if (P(b, R) || (v -= R - b, a[S] = R), P(v, 0))
|
|
488
488
|
break;
|
|
489
489
|
e > 0 ? S-- : S++;
|
|
490
490
|
}
|
|
@@ -494,7 +494,7 @@ function Z({
|
|
|
494
494
|
(c, d) => d + c,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
|
-
if (!
|
|
497
|
+
if (!P(m, 100, 0.1))
|
|
498
498
|
return i;
|
|
499
499
|
const h = Object.keys(i);
|
|
500
500
|
return a.reduce((c, d, y) => (c[h[y]] = d, c), {});
|
|
@@ -508,7 +508,7 @@ function te(e) {
|
|
|
508
508
|
return o;
|
|
509
509
|
throw Error("Could not find parent Group for separator element");
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function U(e, t) {
|
|
512
512
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
513
513
|
return !1;
|
|
514
514
|
for (const n in e)
|
|
@@ -528,7 +528,7 @@ function _({
|
|
|
528
528
|
throw Error(
|
|
529
529
|
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
530
530
|
);
|
|
531
|
-
if (!
|
|
531
|
+
if (!P(i, 100) && o.length > 0)
|
|
532
532
|
for (let r = 0; r < t.length; r++) {
|
|
533
533
|
const a = o[r];
|
|
534
534
|
z(a != null, `No layout data found for index ${r}`);
|
|
@@ -539,27 +539,27 @@ function _({
|
|
|
539
539
|
for (let r = 0; r < t.length; r++) {
|
|
540
540
|
const a = o[r];
|
|
541
541
|
z(a != null, `No layout data found for index ${r}`);
|
|
542
|
-
const u =
|
|
542
|
+
const u = B({
|
|
543
543
|
panelConstraints: t[r],
|
|
544
544
|
size: a
|
|
545
545
|
});
|
|
546
546
|
a != u && (s += a - u, o[r] = u);
|
|
547
547
|
}
|
|
548
|
-
if (!
|
|
548
|
+
if (!P(s, 0))
|
|
549
549
|
for (let r = 0; r < t.length; r++) {
|
|
550
550
|
const a = o[r];
|
|
551
551
|
z(a != null, `No layout data found for index ${r}`);
|
|
552
|
-
const u = a + s, f =
|
|
552
|
+
const u = a + s, f = B({
|
|
553
553
|
panelConstraints: t[r],
|
|
554
554
|
size: u
|
|
555
555
|
});
|
|
556
|
-
if (a !== f && (s -= f - a, o[r] = f,
|
|
556
|
+
if (a !== f && (s -= f - a, o[r] = f, P(s, 0)))
|
|
557
557
|
break;
|
|
558
558
|
}
|
|
559
559
|
const l = Object.keys(e);
|
|
560
560
|
return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function De({
|
|
563
563
|
groupId: e
|
|
564
564
|
}) {
|
|
565
565
|
const t = () => {
|
|
@@ -585,7 +585,7 @@ function ke({
|
|
|
585
585
|
layout: n,
|
|
586
586
|
panelConstraints: i
|
|
587
587
|
});
|
|
588
|
-
return o ? l : (
|
|
588
|
+
return o ? l : (U(l, a) || I((u) => ({
|
|
589
589
|
mountedGroups: new Map(u.mountedGroups).set(s, {
|
|
590
590
|
defaultLayoutDeferred: o,
|
|
591
591
|
derivedPanelConstraints: i,
|
|
@@ -596,18 +596,18 @@ function ke({
|
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function Te(e) {
|
|
600
600
|
const { mountedGroups: t } = D(), n = t.get(e);
|
|
601
601
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
const n = te(e), o =
|
|
603
|
+
function T(e, t) {
|
|
604
|
+
const n = te(e), o = Te(n), i = n.separators.find(
|
|
605
605
|
(p) => p.element === e
|
|
606
606
|
);
|
|
607
607
|
z(i, "Matching separator not found");
|
|
608
608
|
const s = o.separatorToPanels.get(i);
|
|
609
609
|
z(s, "Matching panels not found");
|
|
610
|
-
const l = s.map((p) => n.panels.indexOf(p)), a =
|
|
610
|
+
const l = s.map((p) => n.panels.indexOf(p)), a = De({ groupId: n.id }).getLayout(), u = Z({
|
|
611
611
|
delta: t,
|
|
612
612
|
initialLayout: a,
|
|
613
613
|
panelConstraints: o.derivedPanelConstraints,
|
|
@@ -618,7 +618,7 @@ function O(e, t) {
|
|
|
618
618
|
layout: u,
|
|
619
619
|
panelConstraints: o.derivedPanelConstraints
|
|
620
620
|
});
|
|
621
|
-
|
|
621
|
+
U(a, f) || I((p) => ({
|
|
622
622
|
mountedGroups: new Map(p.mountedGroups).set(n, {
|
|
623
623
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
624
624
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -627,35 +627,35 @@ function O(e, t) {
|
|
|
627
627
|
})
|
|
628
628
|
}));
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function ye(e) {
|
|
631
631
|
if (e.defaultPrevented)
|
|
632
632
|
return;
|
|
633
633
|
const t = e.currentTarget, n = te(t);
|
|
634
634
|
if (!n.disabled)
|
|
635
635
|
switch (e.key) {
|
|
636
636
|
case "ArrowDown": {
|
|
637
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
637
|
+
e.preventDefault(), n.orientation === "vertical" && T(t, 5);
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
640
|
case "ArrowLeft": {
|
|
641
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
641
|
+
e.preventDefault(), n.orientation === "horizontal" && T(t, -5);
|
|
642
642
|
break;
|
|
643
643
|
}
|
|
644
644
|
case "ArrowRight": {
|
|
645
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
645
|
+
e.preventDefault(), n.orientation === "horizontal" && T(t, 5);
|
|
646
646
|
break;
|
|
647
647
|
}
|
|
648
648
|
case "ArrowUp": {
|
|
649
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
649
|
+
e.preventDefault(), n.orientation === "vertical" && T(t, -5);
|
|
650
650
|
break;
|
|
651
651
|
}
|
|
652
652
|
case "End": {
|
|
653
|
-
e.preventDefault(),
|
|
653
|
+
e.preventDefault(), T(t, 100);
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
656
|
case "Enter": {
|
|
657
657
|
e.preventDefault();
|
|
658
|
-
const o = te(t), { derivedPanelConstraints: i, layout: s, separatorToPanels: l } =
|
|
658
|
+
const o = te(t), { derivedPanelConstraints: i, layout: s, separatorToPanels: l } = Te(o), r = o.separators.find(
|
|
659
659
|
(p) => p.element === t
|
|
660
660
|
);
|
|
661
661
|
z(r, "Matching separator not found");
|
|
@@ -666,7 +666,7 @@ function me(e) {
|
|
|
666
666
|
);
|
|
667
667
|
if (z(f, "Panel metadata not found"), f.collapsible) {
|
|
668
668
|
const p = s[u.id], m = f.collapsedSize === p ? o.inMemoryLastExpandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
|
|
669
|
-
|
|
669
|
+
T(t, m - p);
|
|
670
670
|
}
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
@@ -683,23 +683,23 @@ function me(e) {
|
|
|
683
683
|
break;
|
|
684
684
|
}
|
|
685
685
|
case "Home": {
|
|
686
|
-
e.preventDefault(),
|
|
686
|
+
e.preventDefault(), T(t, -100);
|
|
687
687
|
break;
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
const
|
|
692
|
-
},
|
|
691
|
+
const ut = (e) => e, ie = () => {
|
|
692
|
+
}, Oe = 1, Ne = 2, _e = 4, Ae = 8, ge = {
|
|
693
693
|
coarse: 10,
|
|
694
694
|
precise: 5
|
|
695
695
|
};
|
|
696
|
-
function
|
|
696
|
+
function ct(e, t, n) {
|
|
697
697
|
let o, i = {
|
|
698
698
|
x: 1 / 0,
|
|
699
699
|
y: 1 / 0
|
|
700
700
|
};
|
|
701
701
|
for (const s of t) {
|
|
702
|
-
const l =
|
|
702
|
+
const l = Ie(n, s.rect);
|
|
703
703
|
switch (e) {
|
|
704
704
|
case "horizontal": {
|
|
705
705
|
l.x <= i.x && (o = s, i = l);
|
|
@@ -717,17 +717,17 @@ function ut(e, t, n) {
|
|
|
717
717
|
} : void 0;
|
|
718
718
|
}
|
|
719
719
|
let ee;
|
|
720
|
-
function
|
|
720
|
+
function ft() {
|
|
721
721
|
return ee === void 0 && (typeof matchMedia == "function" ? ee = !!matchMedia("(pointer:coarse)").matches : ee = !1), ee;
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function dt(e) {
|
|
724
724
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function pt(e, t) {
|
|
727
727
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
728
728
|
const n = {
|
|
729
|
-
a:
|
|
730
|
-
b:
|
|
729
|
+
a: xe(e),
|
|
730
|
+
b: xe(t)
|
|
731
731
|
};
|
|
732
732
|
let o;
|
|
733
733
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
@@ -737,8 +737,8 @@ function dt(e, t) {
|
|
|
737
737
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
738
738
|
);
|
|
739
739
|
const i = {
|
|
740
|
-
a:
|
|
741
|
-
b:
|
|
740
|
+
a: ve(Se(n.a)),
|
|
741
|
+
b: ve(Se(n.b))
|
|
742
742
|
};
|
|
743
743
|
if (i.a === i.b) {
|
|
744
744
|
const s = o.childNodes, l = {
|
|
@@ -754,78 +754,80 @@ function dt(e, t) {
|
|
|
754
754
|
}
|
|
755
755
|
return Math.sign(i.a - i.b);
|
|
756
756
|
}
|
|
757
|
-
const
|
|
758
|
-
function
|
|
759
|
-
const t = getComputedStyle(
|
|
757
|
+
const mt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
758
|
+
function ht(e) {
|
|
759
|
+
const t = getComputedStyle($e(e) ?? e).display;
|
|
760
760
|
return t === "flex" || t === "inline-flex";
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function yt(e) {
|
|
763
763
|
const t = getComputedStyle(e);
|
|
764
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
764
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ht(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" || mt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function Se(e) {
|
|
767
767
|
let t = e.length;
|
|
768
768
|
for (; t--; ) {
|
|
769
769
|
const n = e[t];
|
|
770
|
-
if (z(n, "Missing node"),
|
|
770
|
+
if (z(n, "Missing node"), yt(n)) return n;
|
|
771
771
|
}
|
|
772
772
|
return null;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function ve(e) {
|
|
775
775
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function xe(e) {
|
|
778
778
|
const t = [];
|
|
779
779
|
for (; e; )
|
|
780
|
-
t.push(e), e =
|
|
780
|
+
t.push(e), e = $e(e);
|
|
781
781
|
return t;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function $e(e) {
|
|
784
784
|
const { parentNode: t } = e;
|
|
785
|
-
return
|
|
785
|
+
return dt(t) ? t.host : t;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function gt(e, t) {
|
|
788
788
|
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;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function St({
|
|
791
791
|
groupElement: e,
|
|
792
792
|
hitRegion: t,
|
|
793
793
|
pointerEventTarget: n
|
|
794
794
|
}) {
|
|
795
|
-
if (!
|
|
795
|
+
if (!ke(n) || n.contains(e) || e.contains(n))
|
|
796
796
|
return !0;
|
|
797
|
-
if (
|
|
797
|
+
if (pt(n, e) > 0) {
|
|
798
798
|
let o = n;
|
|
799
799
|
for (; o; ) {
|
|
800
800
|
if (o.contains(e))
|
|
801
801
|
return !0;
|
|
802
|
-
if (
|
|
802
|
+
if (gt(o.getBoundingClientRect(), t))
|
|
803
803
|
return !1;
|
|
804
804
|
o = o.parentElement;
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
807
|
return !0;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function Fe(e, t) {
|
|
810
810
|
const n = [];
|
|
811
811
|
return t.forEach((o, i) => {
|
|
812
812
|
if (i.disabled)
|
|
813
813
|
return;
|
|
814
|
-
const s =
|
|
814
|
+
const s = ft() ? ge.coarse : ge.precise, l = Ge(i), r = ct(i.orientation, l, {
|
|
815
815
|
x: e.clientX,
|
|
816
816
|
y: e.clientY
|
|
817
817
|
});
|
|
818
|
-
r && r.distance.x <= s && r.distance.y <= s &&
|
|
818
|
+
r && r.distance.x <= s && r.distance.y <= s && St({
|
|
819
819
|
groupElement: i.element,
|
|
820
820
|
hitRegion: r.hitRegion.rect,
|
|
821
821
|
pointerEventTarget: e.target
|
|
822
822
|
}) && n.push(r.hitRegion);
|
|
823
823
|
}), n;
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function ze(e) {
|
|
826
826
|
if (e.defaultPrevented)
|
|
827
827
|
return;
|
|
828
|
-
|
|
828
|
+
if (e.pointerType === "mouse" && e.button > 0)
|
|
829
|
+
return;
|
|
830
|
+
const { mountedGroups: t } = D(), n = Fe(e, t), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
829
831
|
let r = !1;
|
|
830
832
|
n.forEach((a) => {
|
|
831
833
|
o.add(a.group), a.panels.forEach((f) => {
|
|
@@ -842,7 +844,7 @@ function ve(e) {
|
|
|
842
844
|
}
|
|
843
845
|
}), n.length && e.preventDefault();
|
|
844
846
|
}
|
|
845
|
-
function
|
|
847
|
+
function vt({
|
|
846
848
|
cursorFlags: e,
|
|
847
849
|
groups: t,
|
|
848
850
|
state: n
|
|
@@ -869,7 +871,7 @@ function St({
|
|
|
869
871
|
return null;
|
|
870
872
|
switch (n) {
|
|
871
873
|
case "active": {
|
|
872
|
-
const s = (e &
|
|
874
|
+
const s = (e & Oe) !== 0, l = (e & Ne) !== 0, r = (e & _e) !== 0, a = (e & Ae) !== 0;
|
|
873
875
|
if (e) {
|
|
874
876
|
if (s)
|
|
875
877
|
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
@@ -885,17 +887,17 @@ function St({
|
|
|
885
887
|
}
|
|
886
888
|
return o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
887
889
|
}
|
|
888
|
-
const
|
|
889
|
-
function
|
|
890
|
+
const be = /* @__PURE__ */ new WeakMap();
|
|
891
|
+
function ue(e) {
|
|
890
892
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
891
893
|
return;
|
|
892
|
-
let { prevStyle: t, styleSheet: n } =
|
|
894
|
+
let { prevStyle: t, styleSheet: n } = be.get(e) ?? {};
|
|
893
895
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets = [n]);
|
|
894
896
|
const { cursorFlags: o, interactionState: i } = D();
|
|
895
897
|
switch (i.state) {
|
|
896
898
|
case "active":
|
|
897
899
|
case "hover": {
|
|
898
|
-
const s =
|
|
900
|
+
const s = vt({
|
|
899
901
|
cursorFlags: o,
|
|
900
902
|
groups: i.hitRegions.map((r) => r.group),
|
|
901
903
|
state: i.state
|
|
@@ -910,12 +912,12 @@ function se(e) {
|
|
|
910
912
|
break;
|
|
911
913
|
}
|
|
912
914
|
}
|
|
913
|
-
|
|
915
|
+
be.set(e, {
|
|
914
916
|
prevStyle: t,
|
|
915
917
|
styleSheet: n
|
|
916
918
|
});
|
|
917
919
|
}
|
|
918
|
-
function
|
|
920
|
+
function je({
|
|
919
921
|
document: e,
|
|
920
922
|
event: t,
|
|
921
923
|
hitRegions: n,
|
|
@@ -944,15 +946,15 @@ function $e({
|
|
|
944
946
|
prevLayout: v,
|
|
945
947
|
trigger: "mouse-or-touch"
|
|
946
948
|
});
|
|
947
|
-
if (
|
|
949
|
+
if (U(S, v)) {
|
|
948
950
|
if (c !== 0 && !p)
|
|
949
951
|
switch (m) {
|
|
950
952
|
case "horizontal": {
|
|
951
|
-
l |= c < 0 ?
|
|
953
|
+
l |= c < 0 ? Oe : Ne;
|
|
952
954
|
break;
|
|
953
955
|
}
|
|
954
956
|
case "vertical": {
|
|
955
|
-
l |= c < 0 ?
|
|
957
|
+
l |= c < 0 ? _e : Ae;
|
|
956
958
|
break;
|
|
957
959
|
}
|
|
958
960
|
}
|
|
@@ -970,13 +972,13 @@ function $e({
|
|
|
970
972
|
}), I({
|
|
971
973
|
cursorFlags: l,
|
|
972
974
|
mountedGroups: r
|
|
973
|
-
}),
|
|
975
|
+
}), ue(e);
|
|
974
976
|
}
|
|
975
|
-
function
|
|
977
|
+
function we(e) {
|
|
976
978
|
const { interactionState: t, mountedGroups: n } = D();
|
|
977
979
|
switch (t.state) {
|
|
978
980
|
case "active":
|
|
979
|
-
|
|
981
|
+
je({
|
|
980
982
|
document: e.currentTarget,
|
|
981
983
|
event: e,
|
|
982
984
|
hitRegions: t.hitRegions,
|
|
@@ -985,7 +987,7 @@ function ze(e) {
|
|
|
985
987
|
});
|
|
986
988
|
}
|
|
987
989
|
}
|
|
988
|
-
function
|
|
990
|
+
function Le(e) {
|
|
989
991
|
if (e.defaultPrevented)
|
|
990
992
|
return;
|
|
991
993
|
const { interactionState: t, mountedGroups: n } = D();
|
|
@@ -1005,7 +1007,7 @@ function be(e) {
|
|
|
1005
1007
|
);
|
|
1006
1008
|
return;
|
|
1007
1009
|
}
|
|
1008
|
-
|
|
1010
|
+
je({
|
|
1009
1011
|
document: e.currentTarget,
|
|
1010
1012
|
event: e,
|
|
1011
1013
|
hitRegions: t.hitRegions,
|
|
@@ -1016,7 +1018,7 @@ function be(e) {
|
|
|
1016
1018
|
break;
|
|
1017
1019
|
}
|
|
1018
1020
|
default: {
|
|
1019
|
-
const o =
|
|
1021
|
+
const o = Fe(e, n);
|
|
1020
1022
|
o.length === 0 ? t.state !== "inactive" && I({
|
|
1021
1023
|
interactionState: { state: "inactive" }
|
|
1022
1024
|
}) : I({
|
|
@@ -1024,14 +1026,16 @@ function be(e) {
|
|
|
1024
1026
|
hitRegions: o,
|
|
1025
1027
|
state: "hover"
|
|
1026
1028
|
}
|
|
1027
|
-
}),
|
|
1029
|
+
}), ue(e.currentTarget);
|
|
1028
1030
|
break;
|
|
1029
1031
|
}
|
|
1030
1032
|
}
|
|
1031
1033
|
}
|
|
1032
|
-
function
|
|
1034
|
+
function Pe(e) {
|
|
1033
1035
|
if (e.defaultPrevented)
|
|
1034
1036
|
return;
|
|
1037
|
+
if (e.pointerType === "mouse" && e.button > 0)
|
|
1038
|
+
return;
|
|
1035
1039
|
e.preventDefault();
|
|
1036
1040
|
const { interactionState: t } = D();
|
|
1037
1041
|
switch (t.state) {
|
|
@@ -1041,10 +1045,10 @@ function we(e) {
|
|
|
1041
1045
|
interactionState: {
|
|
1042
1046
|
state: "inactive"
|
|
1043
1047
|
}
|
|
1044
|
-
}),
|
|
1048
|
+
}), ue(e.currentTarget);
|
|
1045
1049
|
}
|
|
1046
1050
|
}
|
|
1047
|
-
function
|
|
1051
|
+
function Re(e) {
|
|
1048
1052
|
let t = 0, n = 0;
|
|
1049
1053
|
const o = {};
|
|
1050
1054
|
for (const s of e)
|
|
@@ -1062,14 +1066,14 @@ function Le(e) {
|
|
|
1062
1066
|
}
|
|
1063
1067
|
return o;
|
|
1064
1068
|
}
|
|
1065
|
-
function
|
|
1069
|
+
function xt(e, t, n) {
|
|
1066
1070
|
const o = n[0];
|
|
1067
1071
|
if (!o)
|
|
1068
1072
|
return;
|
|
1069
1073
|
const i = e.panels.find((a) => a.element === t);
|
|
1070
1074
|
if (!i || !i.onResize)
|
|
1071
1075
|
return;
|
|
1072
|
-
const s =
|
|
1076
|
+
const s = W({ group: e }), l = i.mutableValues.prevSize, r = {
|
|
1073
1077
|
asPercentage: G(
|
|
1074
1078
|
o.inlineSize / s * 100
|
|
1075
1079
|
),
|
|
@@ -1077,7 +1081,7 @@ function vt(e, t, n) {
|
|
|
1077
1081
|
};
|
|
1078
1082
|
i.mutableValues.prevSize = r, i.onResize(r, i.id, l);
|
|
1079
1083
|
}
|
|
1080
|
-
function
|
|
1084
|
+
function zt(e, t) {
|
|
1081
1085
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1082
1086
|
return !1;
|
|
1083
1087
|
for (const o in e)
|
|
@@ -1085,7 +1089,7 @@ function xt(e, t) {
|
|
|
1085
1089
|
return !1;
|
|
1086
1090
|
return !0;
|
|
1087
1091
|
}
|
|
1088
|
-
function
|
|
1092
|
+
function bt(e, t) {
|
|
1089
1093
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1090
1094
|
if (n.length !== o.length)
|
|
1091
1095
|
return !1;
|
|
@@ -1094,8 +1098,8 @@ function zt(e, t) {
|
|
|
1094
1098
|
return !1;
|
|
1095
1099
|
return !0;
|
|
1096
1100
|
}
|
|
1097
|
-
const
|
|
1098
|
-
function
|
|
1101
|
+
const H = /* @__PURE__ */ new Map();
|
|
1102
|
+
function wt(e) {
|
|
1099
1103
|
let t = !0;
|
|
1100
1104
|
z(
|
|
1101
1105
|
e.element.ownerDocument.defaultView,
|
|
@@ -1106,23 +1110,23 @@ function bt(e) {
|
|
|
1106
1110
|
const { borderBoxSize: y, target: g } = d;
|
|
1107
1111
|
if (g === e.element) {
|
|
1108
1112
|
if (t) {
|
|
1109
|
-
if (
|
|
1113
|
+
if (W({ group: e }) === 0)
|
|
1110
1114
|
return;
|
|
1111
1115
|
I((x) => {
|
|
1112
1116
|
const S = x.mountedGroups.get(e);
|
|
1113
1117
|
if (S) {
|
|
1114
|
-
const b =
|
|
1118
|
+
const b = he(e), w = S.defaultLayoutDeferred ? Re(b) : S.layout, R = _({
|
|
1115
1119
|
layout: w,
|
|
1116
1120
|
panelConstraints: b
|
|
1117
1121
|
});
|
|
1118
|
-
return !S.defaultLayoutDeferred &&
|
|
1122
|
+
return !S.defaultLayoutDeferred && U(w, R) && zt(
|
|
1119
1123
|
S.derivedPanelConstraints,
|
|
1120
1124
|
b
|
|
1121
1125
|
) ? x : {
|
|
1122
1126
|
mountedGroups: new Map(x.mountedGroups).set(e, {
|
|
1123
1127
|
defaultLayoutDeferred: !1,
|
|
1124
1128
|
derivedPanelConstraints: b,
|
|
1125
|
-
layout:
|
|
1129
|
+
layout: R,
|
|
1126
1130
|
separatorToPanels: S.separatorToPanels
|
|
1127
1131
|
})
|
|
1128
1132
|
};
|
|
@@ -1131,7 +1135,7 @@ function bt(e) {
|
|
|
1131
1135
|
});
|
|
1132
1136
|
}
|
|
1133
1137
|
} else
|
|
1134
|
-
|
|
1138
|
+
xt(e, g, y);
|
|
1135
1139
|
}
|
|
1136
1140
|
});
|
|
1137
1141
|
s.observe(e.element), e.panels.forEach((c) => {
|
|
@@ -1140,18 +1144,18 @@ function bt(e) {
|
|
|
1140
1144
|
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1141
1145
|
), o.add(c.id), c.onResize && s.observe(c.element);
|
|
1142
1146
|
});
|
|
1143
|
-
const l =
|
|
1147
|
+
const l = W({ group: e }), r = he(e), a = e.panels.map(({ id: c }) => c).join(",");
|
|
1144
1148
|
let u = e.defaultLayout;
|
|
1145
|
-
u && (
|
|
1146
|
-
const f = e.inMemoryLayouts[a] ?? u ??
|
|
1149
|
+
u && (bt(e.panels, u) || (u = void 0));
|
|
1150
|
+
const f = e.inMemoryLayouts[a] ?? u ?? Re(r), p = _({
|
|
1147
1151
|
layout: f,
|
|
1148
1152
|
panelConstraints: r
|
|
1149
|
-
}), m =
|
|
1153
|
+
}), m = Ge(e), h = e.element.ownerDocument;
|
|
1150
1154
|
return I((c) => {
|
|
1151
1155
|
const d = /* @__PURE__ */ new Map();
|
|
1152
|
-
return
|
|
1156
|
+
return H.set(
|
|
1153
1157
|
h,
|
|
1154
|
-
(
|
|
1158
|
+
(H.get(h) ?? 0) + 1
|
|
1155
1159
|
), m.forEach((y) => {
|
|
1156
1160
|
y.separator && d.set(y.separator, y.panels);
|
|
1157
1161
|
}), {
|
|
@@ -1166,39 +1170,39 @@ function bt(e) {
|
|
|
1166
1170
|
z(
|
|
1167
1171
|
!i.has(c.id),
|
|
1168
1172
|
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1169
|
-
), i.add(c.id), c.element.addEventListener("keydown",
|
|
1170
|
-
}),
|
|
1171
|
-
t = !1,
|
|
1173
|
+
), i.add(c.id), c.element.addEventListener("keydown", ye);
|
|
1174
|
+
}), H.get(h) === 1 && (h.addEventListener("pointerdown", ze), h.addEventListener("pointerleave", we), h.addEventListener("pointermove", Le), h.addEventListener("pointerup", Pe)), function() {
|
|
1175
|
+
t = !1, H.set(
|
|
1172
1176
|
h,
|
|
1173
|
-
Math.max(0, (
|
|
1177
|
+
Math.max(0, (H.get(h) ?? 0) - 1)
|
|
1174
1178
|
), I((d) => {
|
|
1175
1179
|
const y = new Map(d.mountedGroups);
|
|
1176
1180
|
return y.delete(e), { mountedGroups: y };
|
|
1177
1181
|
}), e.separators.forEach((d) => {
|
|
1178
|
-
d.element.removeEventListener("keydown",
|
|
1179
|
-
}),
|
|
1182
|
+
d.element.removeEventListener("keydown", ye);
|
|
1183
|
+
}), H.get(h) || (h.removeEventListener("pointerdown", ze), h.removeEventListener("pointerleave", we), h.removeEventListener("pointermove", Le), h.removeEventListener("pointerup", Pe)), s.disconnect();
|
|
1180
1184
|
};
|
|
1181
1185
|
}
|
|
1182
|
-
function
|
|
1183
|
-
const [e, t] = N({}), n =
|
|
1186
|
+
function Lt() {
|
|
1187
|
+
const [e, t] = N({}), n = Ce(() => t({}), []);
|
|
1184
1188
|
return [e, n];
|
|
1185
1189
|
}
|
|
1186
|
-
function
|
|
1187
|
-
const t =
|
|
1190
|
+
function ce(e) {
|
|
1191
|
+
const t = Xe();
|
|
1188
1192
|
return `${e ?? t}`;
|
|
1189
1193
|
}
|
|
1190
|
-
const A = typeof window < "u" ?
|
|
1191
|
-
function
|
|
1192
|
-
const t =
|
|
1194
|
+
const A = typeof window < "u" ? qe : Ee;
|
|
1195
|
+
function ne(e) {
|
|
1196
|
+
const t = k(e);
|
|
1193
1197
|
return A(() => {
|
|
1194
1198
|
t.current = e;
|
|
1195
|
-
}, [e]),
|
|
1199
|
+
}, [e]), Ce(
|
|
1196
1200
|
(...n) => t.current?.(...n),
|
|
1197
1201
|
[t]
|
|
1198
1202
|
);
|
|
1199
1203
|
}
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1204
|
+
function fe(...e) {
|
|
1205
|
+
return ne((t) => {
|
|
1202
1206
|
e.forEach((n) => {
|
|
1203
1207
|
if (n)
|
|
1204
1208
|
switch (typeof n) {
|
|
@@ -1214,32 +1218,32 @@ function ue(...e) {
|
|
|
1214
1218
|
});
|
|
1215
1219
|
});
|
|
1216
1220
|
}
|
|
1217
|
-
function
|
|
1218
|
-
const t =
|
|
1221
|
+
function Pt(e) {
|
|
1222
|
+
const t = k({ ...e });
|
|
1219
1223
|
return A(() => {
|
|
1220
1224
|
for (const n in e)
|
|
1221
1225
|
t.current[n] = e[n];
|
|
1222
1226
|
}, [e]), t.current;
|
|
1223
1227
|
}
|
|
1224
|
-
const
|
|
1225
|
-
function
|
|
1228
|
+
const Ve = "--react-resizable-panels--panel--pointer-events";
|
|
1229
|
+
function Rt(e, t) {
|
|
1226
1230
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1227
1231
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1228
1232
|
}
|
|
1229
|
-
const
|
|
1230
|
-
function
|
|
1231
|
-
const n =
|
|
1233
|
+
const He = Ye(null);
|
|
1234
|
+
function Ct(e, t) {
|
|
1235
|
+
const n = k({
|
|
1232
1236
|
getLayout: () => ({}),
|
|
1233
|
-
setLayout:
|
|
1237
|
+
setLayout: ut
|
|
1234
1238
|
});
|
|
1235
|
-
|
|
1239
|
+
Me(t, () => n.current, []), A(() => {
|
|
1236
1240
|
Object.assign(
|
|
1237
1241
|
n.current,
|
|
1238
|
-
|
|
1242
|
+
De({ groupId: e })
|
|
1239
1243
|
);
|
|
1240
1244
|
});
|
|
1241
1245
|
}
|
|
1242
|
-
function
|
|
1246
|
+
function Et({
|
|
1243
1247
|
children: e,
|
|
1244
1248
|
className: t,
|
|
1245
1249
|
defaultLayout: n,
|
|
@@ -1253,77 +1257,78 @@ function Rt({
|
|
|
1253
1257
|
style: f,
|
|
1254
1258
|
...p
|
|
1255
1259
|
}) {
|
|
1256
|
-
const m =
|
|
1257
|
-
|
|
1258
|
-
}), c =
|
|
1260
|
+
const m = k({}), h = ne((L) => {
|
|
1261
|
+
U(m.current, L) || (m.current = L, a?.(L));
|
|
1262
|
+
}), c = ce(r), d = k(null), [y, g] = N(!1), [v, x] = N(n ?? {}), [S, b] = Lt(), w = k({
|
|
1259
1263
|
lastExpandedPanelSizes: {},
|
|
1260
1264
|
layouts: {},
|
|
1261
1265
|
panels: [],
|
|
1262
1266
|
separators: []
|
|
1263
|
-
}),
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1267
|
+
}), R = ne((L) => v[L] ?? 1), K = fe(d, s);
|
|
1268
|
+
Ct(c, l);
|
|
1269
|
+
const oe = ae(
|
|
1266
1270
|
() => ({
|
|
1271
|
+
getPanelSize: R,
|
|
1267
1272
|
id: c,
|
|
1268
1273
|
orientation: u,
|
|
1269
1274
|
registerPanel: (L) => {
|
|
1270
|
-
const
|
|
1271
|
-
return
|
|
1272
|
-
...
|
|
1275
|
+
const C = w.current;
|
|
1276
|
+
return C.panels = le(u, [
|
|
1277
|
+
...C.panels,
|
|
1273
1278
|
L
|
|
1274
1279
|
]), b(), () => {
|
|
1275
|
-
|
|
1276
|
-
(
|
|
1280
|
+
C.panels = C.panels.filter(
|
|
1281
|
+
(E) => E !== L
|
|
1277
1282
|
), b();
|
|
1278
1283
|
};
|
|
1279
1284
|
},
|
|
1280
1285
|
registerSeparator: (L) => {
|
|
1281
|
-
const
|
|
1282
|
-
return
|
|
1283
|
-
...
|
|
1286
|
+
const C = w.current;
|
|
1287
|
+
return C.separators = le(u, [
|
|
1288
|
+
...C.separators,
|
|
1284
1289
|
L
|
|
1285
1290
|
]), b(), () => {
|
|
1286
|
-
|
|
1287
|
-
(
|
|
1291
|
+
C.separators = C.separators.filter(
|
|
1292
|
+
(E) => E !== L
|
|
1288
1293
|
), b();
|
|
1289
1294
|
};
|
|
1290
1295
|
}
|
|
1291
1296
|
}),
|
|
1292
|
-
[c, b, u]
|
|
1293
|
-
),
|
|
1297
|
+
[R, c, b, u]
|
|
1298
|
+
), $ = Pt({
|
|
1294
1299
|
defaultLayout: n,
|
|
1295
1300
|
disableCursor: o
|
|
1296
|
-
}),
|
|
1301
|
+
}), F = k(null);
|
|
1297
1302
|
A(() => {
|
|
1298
1303
|
const L = d.current;
|
|
1299
1304
|
if (L === null)
|
|
1300
1305
|
return;
|
|
1301
|
-
const
|
|
1302
|
-
defaultLayout:
|
|
1303
|
-
disableCursor:
|
|
1306
|
+
const C = w.current, E = {
|
|
1307
|
+
defaultLayout: $.defaultLayout,
|
|
1308
|
+
disableCursor: !!$.disableCursor,
|
|
1304
1309
|
disabled: !!i,
|
|
1305
1310
|
element: L,
|
|
1306
1311
|
id: c,
|
|
1307
1312
|
inMemoryLastExpandedPanelSizes: w.current.lastExpandedPanelSizes,
|
|
1308
1313
|
inMemoryLayouts: w.current.layouts,
|
|
1309
1314
|
orientation: u,
|
|
1310
|
-
panels:
|
|
1311
|
-
separators:
|
|
1315
|
+
panels: C.panels,
|
|
1316
|
+
separators: C.separators
|
|
1312
1317
|
};
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
if (
|
|
1316
|
-
const { defaultLayoutDeferred:
|
|
1317
|
-
!
|
|
1318
|
+
F.current = E;
|
|
1319
|
+
const Be = wt(E), pe = D().mountedGroups.get(E);
|
|
1320
|
+
if (pe) {
|
|
1321
|
+
const { defaultLayoutDeferred: j, derivedPanelConstraints: V, layout: J } = pe;
|
|
1322
|
+
!j && V.length > 0 && (x(J), h?.(J));
|
|
1318
1323
|
}
|
|
1319
|
-
const
|
|
1324
|
+
const We = O.addListener(
|
|
1320
1325
|
"interactionStateChange",
|
|
1321
|
-
(
|
|
1322
|
-
switch (
|
|
1326
|
+
(j) => {
|
|
1327
|
+
switch (j.state) {
|
|
1323
1328
|
case "active": {
|
|
1324
1329
|
g(
|
|
1325
|
-
|
|
1326
|
-
(V) => V.group ===
|
|
1330
|
+
j.hitRegions.some(
|
|
1331
|
+
(V) => V.group === E
|
|
1327
1332
|
)
|
|
1328
1333
|
);
|
|
1329
1334
|
break;
|
|
@@ -1334,20 +1339,22 @@ function Rt({
|
|
|
1334
1339
|
}
|
|
1335
1340
|
}
|
|
1336
1341
|
}
|
|
1337
|
-
),
|
|
1342
|
+
), Ue = O.addListener(
|
|
1338
1343
|
"mountedGroupsChange",
|
|
1339
|
-
(
|
|
1340
|
-
const V =
|
|
1344
|
+
(j) => {
|
|
1345
|
+
const V = j.get(E);
|
|
1341
1346
|
if (V) {
|
|
1342
|
-
const { defaultLayoutDeferred: J, derivedPanelConstraints:
|
|
1343
|
-
if (J ||
|
|
1347
|
+
const { defaultLayoutDeferred: J, derivedPanelConstraints: Ke, layout: re } = V;
|
|
1348
|
+
if (J || Ke.length === 0)
|
|
1344
1349
|
return;
|
|
1345
|
-
|
|
1350
|
+
E.panels.forEach((me) => {
|
|
1351
|
+
me.element.style.flexGrow = "" + re[me.id];
|
|
1352
|
+
}), x(re), h?.(re);
|
|
1346
1353
|
}
|
|
1347
1354
|
}
|
|
1348
1355
|
);
|
|
1349
1356
|
return () => {
|
|
1350
|
-
|
|
1357
|
+
F.current = null, Be(), We(), Ue();
|
|
1351
1358
|
};
|
|
1352
1359
|
}, [
|
|
1353
1360
|
i,
|
|
@@ -1355,19 +1362,19 @@ function Rt({
|
|
|
1355
1362
|
h,
|
|
1356
1363
|
u,
|
|
1357
1364
|
S,
|
|
1358
|
-
|
|
1359
|
-
]),
|
|
1360
|
-
const L =
|
|
1365
|
+
$
|
|
1366
|
+
]), Ee(() => {
|
|
1367
|
+
const L = F.current;
|
|
1361
1368
|
L && (L.defaultLayout = n, L.disableCursor = !!o);
|
|
1362
1369
|
});
|
|
1363
1370
|
const X = {
|
|
1364
|
-
[
|
|
1371
|
+
[Ve]: y ? "none" : void 0
|
|
1365
1372
|
};
|
|
1366
1373
|
for (const L in v) {
|
|
1367
|
-
const
|
|
1368
|
-
X[
|
|
1374
|
+
const C = Rt(c, L), E = v[L];
|
|
1375
|
+
X[C] = E;
|
|
1369
1376
|
}
|
|
1370
|
-
return /* @__PURE__ */ q(
|
|
1377
|
+
return /* @__PURE__ */ q(He.Provider, { value: oe, children: /* @__PURE__ */ q(
|
|
1371
1378
|
"div",
|
|
1372
1379
|
{
|
|
1373
1380
|
...p,
|
|
@@ -1376,7 +1383,7 @@ function Rt({
|
|
|
1376
1383
|
"data-group": !0,
|
|
1377
1384
|
"data-testid": c,
|
|
1378
1385
|
id: c,
|
|
1379
|
-
ref:
|
|
1386
|
+
ref: K,
|
|
1380
1387
|
style: {
|
|
1381
1388
|
...f,
|
|
1382
1389
|
...X,
|
|
@@ -1388,8 +1395,8 @@ function Rt({
|
|
|
1388
1395
|
}
|
|
1389
1396
|
) });
|
|
1390
1397
|
}
|
|
1391
|
-
|
|
1392
|
-
function
|
|
1398
|
+
Et.displayName = "Group";
|
|
1399
|
+
function Mt(e, t = 10) {
|
|
1393
1400
|
let n = null;
|
|
1394
1401
|
return (o) => {
|
|
1395
1402
|
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -1397,57 +1404,57 @@ function Ct(e, t = 10) {
|
|
|
1397
1404
|
}, t);
|
|
1398
1405
|
};
|
|
1399
1406
|
}
|
|
1400
|
-
function
|
|
1407
|
+
function se(e, t) {
|
|
1401
1408
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1402
1409
|
}
|
|
1403
|
-
function
|
|
1410
|
+
function Ft({
|
|
1404
1411
|
debounceSaveMs: e = 100,
|
|
1405
1412
|
panelIds: t,
|
|
1406
|
-
storage: n,
|
|
1413
|
+
storage: n = localStorage,
|
|
1407
1414
|
...o
|
|
1408
1415
|
}) {
|
|
1409
|
-
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l =
|
|
1410
|
-
|
|
1416
|
+
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = se(s, t ?? []), r = Ze(
|
|
1417
|
+
kt,
|
|
1411
1418
|
() => n.getItem(l),
|
|
1412
1419
|
() => n.getItem(l)
|
|
1413
|
-
), a =
|
|
1420
|
+
), a = ae(
|
|
1414
1421
|
() => r ? JSON.parse(r) : void 0,
|
|
1415
1422
|
[r]
|
|
1416
|
-
), u =
|
|
1423
|
+
), u = ae(() => {
|
|
1417
1424
|
const f = (p) => {
|
|
1418
1425
|
let m;
|
|
1419
|
-
i ? m =
|
|
1426
|
+
i ? m = se(s, Object.keys(p)) : m = se(s, []);
|
|
1420
1427
|
try {
|
|
1421
1428
|
n.setItem(m, JSON.stringify(p));
|
|
1422
1429
|
} catch (h) {
|
|
1423
1430
|
console.error(h);
|
|
1424
1431
|
}
|
|
1425
1432
|
};
|
|
1426
|
-
return e > 0 ?
|
|
1433
|
+
return e > 0 ? Mt(f, e) : f;
|
|
1427
1434
|
}, [e, i, s, n]);
|
|
1428
1435
|
return {
|
|
1429
1436
|
defaultLayout: a,
|
|
1430
1437
|
onLayoutChange: u
|
|
1431
1438
|
};
|
|
1432
1439
|
}
|
|
1433
|
-
function
|
|
1440
|
+
function kt() {
|
|
1434
1441
|
return function() {
|
|
1435
1442
|
};
|
|
1436
1443
|
}
|
|
1437
|
-
function
|
|
1444
|
+
function jt() {
|
|
1438
1445
|
return N(null);
|
|
1439
1446
|
}
|
|
1440
|
-
function
|
|
1441
|
-
return
|
|
1447
|
+
function Vt() {
|
|
1448
|
+
return k(null);
|
|
1442
1449
|
}
|
|
1443
|
-
function
|
|
1444
|
-
const e =
|
|
1450
|
+
function de() {
|
|
1451
|
+
const e = Je(He);
|
|
1445
1452
|
return z(
|
|
1446
1453
|
e,
|
|
1447
1454
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1448
1455
|
), e;
|
|
1449
1456
|
}
|
|
1450
|
-
function
|
|
1457
|
+
function It({
|
|
1451
1458
|
groupId: e,
|
|
1452
1459
|
panelId: t
|
|
1453
1460
|
}) {
|
|
@@ -1509,7 +1516,7 @@ function Et({
|
|
|
1509
1516
|
layout: y,
|
|
1510
1517
|
panelConstraints: f
|
|
1511
1518
|
});
|
|
1512
|
-
|
|
1519
|
+
U(m, g) || I((v) => ({
|
|
1513
1520
|
mountedGroups: new Map(v.mountedGroups).set(p, {
|
|
1514
1521
|
defaultLayoutDeferred: u,
|
|
1515
1522
|
derivedPanelConstraints: f,
|
|
@@ -1539,14 +1546,14 @@ function Et({
|
|
|
1539
1546
|
},
|
|
1540
1547
|
isCollapsed: () => {
|
|
1541
1548
|
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
1542
|
-
return r &&
|
|
1549
|
+
return r && P(a, u);
|
|
1543
1550
|
},
|
|
1544
1551
|
resize: (r) => {
|
|
1545
1552
|
if (s() !== r) {
|
|
1546
1553
|
let u;
|
|
1547
1554
|
switch (typeof r) {
|
|
1548
1555
|
case "number": {
|
|
1549
|
-
const { group: f } = n(), p =
|
|
1556
|
+
const { group: f } = n(), p = W({ group: f });
|
|
1550
1557
|
u = G(r / p * 100);
|
|
1551
1558
|
break;
|
|
1552
1559
|
}
|
|
@@ -1560,25 +1567,25 @@ function Et({
|
|
|
1560
1567
|
}
|
|
1561
1568
|
};
|
|
1562
1569
|
}
|
|
1563
|
-
function
|
|
1564
|
-
const { id: n } =
|
|
1565
|
-
collapse:
|
|
1566
|
-
expand:
|
|
1570
|
+
function Gt(e, t) {
|
|
1571
|
+
const { id: n } = de(), o = k({
|
|
1572
|
+
collapse: ie,
|
|
1573
|
+
expand: ie,
|
|
1567
1574
|
getSize: () => ({
|
|
1568
1575
|
asPercentage: 0,
|
|
1569
1576
|
inPixels: 0
|
|
1570
1577
|
}),
|
|
1571
1578
|
isCollapsed: () => !1,
|
|
1572
|
-
resize:
|
|
1579
|
+
resize: ie
|
|
1573
1580
|
});
|
|
1574
|
-
|
|
1581
|
+
Me(t, () => o.current, []), A(() => {
|
|
1575
1582
|
Object.assign(
|
|
1576
1583
|
o.current,
|
|
1577
|
-
|
|
1584
|
+
It({ groupId: n, panelId: e })
|
|
1578
1585
|
);
|
|
1579
1586
|
});
|
|
1580
1587
|
}
|
|
1581
|
-
function
|
|
1588
|
+
function Dt({
|
|
1582
1589
|
children: e,
|
|
1583
1590
|
className: t,
|
|
1584
1591
|
collapsedSize: n = "0%",
|
|
@@ -1593,9 +1600,9 @@ function kt({
|
|
|
1593
1600
|
style: p,
|
|
1594
1601
|
...m
|
|
1595
1602
|
}) {
|
|
1596
|
-
const h = !!l, c =
|
|
1597
|
-
(w,
|
|
1598
|
-
u?.(w, l,
|
|
1603
|
+
const h = !!l, c = ce(l), d = k(null), y = fe(d, s), { getPanelSize: g, registerPanel: v } = de(), x = u !== null, S = ne(
|
|
1604
|
+
(w, R, K) => {
|
|
1605
|
+
u?.(w, l, K);
|
|
1599
1606
|
}
|
|
1600
1607
|
);
|
|
1601
1608
|
A(() => {
|
|
@@ -1629,8 +1636,8 @@ function kt({
|
|
|
1629
1636
|
a,
|
|
1630
1637
|
S,
|
|
1631
1638
|
v
|
|
1632
|
-
]),
|
|
1633
|
-
const b =
|
|
1639
|
+
]), Gt(c, f);
|
|
1640
|
+
const b = g(c);
|
|
1634
1641
|
return /* @__PURE__ */ q(
|
|
1635
1642
|
"div",
|
|
1636
1643
|
{
|
|
@@ -1640,15 +1647,15 @@ function kt({
|
|
|
1640
1647
|
id: c,
|
|
1641
1648
|
ref: y,
|
|
1642
1649
|
style: {
|
|
1643
|
-
...
|
|
1650
|
+
...Tt,
|
|
1644
1651
|
flexBasis: 0,
|
|
1645
|
-
flexGrow:
|
|
1652
|
+
flexGrow: b,
|
|
1646
1653
|
flexShrink: 1,
|
|
1647
1654
|
// Prevent Panel content from interfering with panel size
|
|
1648
1655
|
overflow: "hidden",
|
|
1649
1656
|
// Disable pointer events inside of a panel during resize
|
|
1650
1657
|
// This avoid edge cases like nested iframes
|
|
1651
|
-
pointerEvents: `var(${
|
|
1658
|
+
pointerEvents: `var(${Ve})`
|
|
1652
1659
|
},
|
|
1653
1660
|
children: /* @__PURE__ */ q(
|
|
1654
1661
|
"div",
|
|
@@ -1665,8 +1672,8 @@ function kt({
|
|
|
1665
1672
|
}
|
|
1666
1673
|
);
|
|
1667
1674
|
}
|
|
1668
|
-
|
|
1669
|
-
const
|
|
1675
|
+
Dt.displayName = "Panel";
|
|
1676
|
+
const Tt = {
|
|
1670
1677
|
minHeight: "unset",
|
|
1671
1678
|
maxHeight: "unset",
|
|
1672
1679
|
height: "unset",
|
|
@@ -1682,13 +1689,13 @@ const Gt = {
|
|
|
1682
1689
|
padding: "unset",
|
|
1683
1690
|
margin: "unset"
|
|
1684
1691
|
};
|
|
1685
|
-
function
|
|
1692
|
+
function Ht() {
|
|
1686
1693
|
return N(null);
|
|
1687
1694
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1695
|
+
function Bt() {
|
|
1696
|
+
return k(null);
|
|
1690
1697
|
}
|
|
1691
|
-
function
|
|
1698
|
+
function Ot({
|
|
1692
1699
|
layout: e,
|
|
1693
1700
|
panelConstraints: t,
|
|
1694
1701
|
panelId: n,
|
|
@@ -1729,7 +1736,7 @@ function Dt({
|
|
|
1729
1736
|
valueNow: l
|
|
1730
1737
|
};
|
|
1731
1738
|
}
|
|
1732
|
-
function
|
|
1739
|
+
function Nt({
|
|
1733
1740
|
children: e,
|
|
1734
1741
|
className: t,
|
|
1735
1742
|
elementRef: n,
|
|
@@ -1737,41 +1744,41 @@ function Ot({
|
|
|
1737
1744
|
style: i,
|
|
1738
1745
|
...s
|
|
1739
1746
|
}) {
|
|
1740
|
-
const l =
|
|
1747
|
+
const l = ce(o), [r, a] = N({}), [u, f] = N("inactive"), p = k(null), m = fe(p, n), {
|
|
1741
1748
|
id: h,
|
|
1742
1749
|
orientation: c,
|
|
1743
1750
|
registerSeparator: d
|
|
1744
|
-
} =
|
|
1751
|
+
} = de(), y = c === "horizontal" ? "vertical" : "horizontal";
|
|
1745
1752
|
return A(() => {
|
|
1746
1753
|
const g = p.current;
|
|
1747
1754
|
if (g !== null) {
|
|
1748
1755
|
const v = {
|
|
1749
1756
|
element: g,
|
|
1750
1757
|
id: l
|
|
1751
|
-
}, x = d(v), S =
|
|
1758
|
+
}, x = d(v), S = O.addListener(
|
|
1752
1759
|
"interactionStateChange",
|
|
1753
1760
|
(w) => {
|
|
1754
1761
|
f(
|
|
1755
1762
|
w.state !== "inactive" && w.hitRegions.some(
|
|
1756
|
-
(
|
|
1763
|
+
(R) => R.separator === v
|
|
1757
1764
|
) ? w.state : "inactive"
|
|
1758
1765
|
);
|
|
1759
1766
|
}
|
|
1760
|
-
), b =
|
|
1767
|
+
), b = O.addListener(
|
|
1761
1768
|
"mountedGroupsChange",
|
|
1762
1769
|
(w) => {
|
|
1763
1770
|
w.forEach(
|
|
1764
|
-
({ derivedPanelConstraints:
|
|
1771
|
+
({ derivedPanelConstraints: R, layout: K, separatorToPanels: oe }, $) => {
|
|
1765
1772
|
if ($.id === h) {
|
|
1766
|
-
const
|
|
1767
|
-
if (
|
|
1768
|
-
const
|
|
1773
|
+
const F = oe.get(v);
|
|
1774
|
+
if (F) {
|
|
1775
|
+
const X = F[0], L = $.panels.indexOf(X);
|
|
1769
1776
|
a(
|
|
1770
|
-
|
|
1771
|
-
layout:
|
|
1772
|
-
panelConstraints:
|
|
1773
|
-
panelId:
|
|
1774
|
-
panelIndex:
|
|
1777
|
+
Ot({
|
|
1778
|
+
layout: K,
|
|
1779
|
+
panelConstraints: R,
|
|
1780
|
+
panelId: X.id,
|
|
1781
|
+
panelIndex: L
|
|
1775
1782
|
})
|
|
1776
1783
|
);
|
|
1777
1784
|
}
|
|
@@ -1810,15 +1817,15 @@ function Ot({
|
|
|
1810
1817
|
}
|
|
1811
1818
|
);
|
|
1812
1819
|
}
|
|
1813
|
-
|
|
1820
|
+
Nt.displayName = "Separator";
|
|
1814
1821
|
export {
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1822
|
+
Et as Group,
|
|
1823
|
+
Dt as Panel,
|
|
1824
|
+
Nt as Separator,
|
|
1825
|
+
Ft as useDefaultLayout,
|
|
1826
|
+
jt as useGroupCallbackRef,
|
|
1827
|
+
Vt as useGroupRef,
|
|
1828
|
+
Ht as usePanelCallbackRef,
|
|
1829
|
+
Bt as usePanelRef
|
|
1823
1830
|
};
|
|
1824
1831
|
//# sourceMappingURL=react-resizable-panels.js.map
|