react-resizable-panels 4.5.6 → 4.5.7
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,11 +1,11 @@
|
|
|
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 ee, useCallback as Z, useId as ot, useLayoutEffect as Oe, useEffect as Ae, useRef as G, createContext as it, useImperativeHandle as _e, useMemo as Ne, useSyncExternalStore as rt, useContext as st } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function K({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
@@ -13,21 +13,21 @@ function B({
|
|
|
13
13
|
}
|
|
14
14
|
function de(e, t) {
|
|
15
15
|
return Array.from(t).sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? at : lt
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function at(e, t) {
|
|
20
20
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
21
21
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function lt(e, t) {
|
|
24
24
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
25
25
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Fe(e) {
|
|
28
28
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function $e(e, t) {
|
|
31
31
|
return {
|
|
32
32
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
33
33
|
Math.abs(e.x - t.left),
|
|
@@ -39,7 +39,7 @@ function Fe(e, t) {
|
|
|
39
39
|
)
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function ut({
|
|
43
43
|
orientation: e,
|
|
44
44
|
rects: t,
|
|
45
45
|
targetRect: n
|
|
@@ -50,29 +50,29 @@ function lt({
|
|
|
50
50
|
};
|
|
51
51
|
let i, r = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x: s, y: a } =
|
|
53
|
+
const { x: s, y: a } = $e(o, l), u = e === "horizontal" ? s : a;
|
|
54
54
|
u < r && (r = u, i = l);
|
|
55
55
|
}
|
|
56
56
|
return z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
let ie;
|
|
59
|
-
function
|
|
59
|
+
function ct() {
|
|
60
60
|
return ie === void 0 && (typeof matchMedia == "function" ? ie = !!matchMedia("(pointer:coarse)").matches : ie = !1), ie;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function He(e) {
|
|
63
63
|
const { element: t, orientation: n, panels: o, separators: i } = e, r = de(
|
|
64
64
|
n,
|
|
65
|
-
Array.from(t.children).filter(
|
|
65
|
+
Array.from(t.children).filter(Fe).map((c) => ({ element: c }))
|
|
66
66
|
).map(({ element: c }) => c), l = [];
|
|
67
67
|
let s = !1, a, u = [];
|
|
68
68
|
for (const c of r)
|
|
69
69
|
if (c.hasAttribute("data-panel")) {
|
|
70
|
-
const
|
|
70
|
+
const m = o.find(
|
|
71
71
|
(y) => y.element === c
|
|
72
72
|
);
|
|
73
|
-
if (
|
|
73
|
+
if (m) {
|
|
74
74
|
if (a) {
|
|
75
|
-
const y = a.element.getBoundingClientRect(),
|
|
75
|
+
const y = a.element.getBoundingClientRect(), h = c.getBoundingClientRect();
|
|
76
76
|
let f;
|
|
77
77
|
if (s) {
|
|
78
78
|
const d = n === "horizontal" ? new DOMRect(y.right, y.top, 0, y.height) : new DOMRect(
|
|
@@ -80,7 +80,7 @@ function $e(e) {
|
|
|
80
80
|
y.bottom,
|
|
81
81
|
y.width,
|
|
82
82
|
0
|
|
83
|
-
), p = n === "horizontal" ? new DOMRect(
|
|
83
|
+
), p = n === "horizontal" ? new DOMRect(h.left, h.top, 0, h.height) : new DOMRect(h.left, h.top, h.width, 0);
|
|
84
84
|
switch (u.length) {
|
|
85
85
|
case 0: {
|
|
86
86
|
f = [
|
|
@@ -90,9 +90,9 @@ function $e(e) {
|
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case 1: {
|
|
93
|
-
const g = u[0], v =
|
|
93
|
+
const g = u[0], v = ut({
|
|
94
94
|
orientation: n,
|
|
95
|
-
rects: [y,
|
|
95
|
+
rects: [y, h],
|
|
96
96
|
targetRect: g.element.getBoundingClientRect()
|
|
97
97
|
});
|
|
98
98
|
f = [
|
|
@@ -110,19 +110,19 @@ function $e(e) {
|
|
|
110
110
|
u.length ? f = u : f = [
|
|
111
111
|
n === "horizontal" ? new DOMRect(
|
|
112
112
|
y.right,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
h.top,
|
|
114
|
+
h.left - y.right,
|
|
115
|
+
h.height
|
|
116
116
|
) : new DOMRect(
|
|
117
|
-
|
|
117
|
+
h.left,
|
|
118
118
|
y.bottom,
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
h.width,
|
|
120
|
+
h.top - y.bottom
|
|
121
121
|
)
|
|
122
122
|
];
|
|
123
123
|
for (const d of f) {
|
|
124
124
|
let p = "width" in d ? d : d.element.getBoundingClientRect();
|
|
125
|
-
const g =
|
|
125
|
+
const g = ct() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
126
126
|
if (p.width < g) {
|
|
127
127
|
const v = g - p.width;
|
|
128
128
|
p = new DOMRect(
|
|
@@ -143,39 +143,39 @@ function $e(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
147
|
-
panels: [a,
|
|
146
|
+
groupSize: K({ group: e }),
|
|
147
|
+
panels: [a, m],
|
|
148
148
|
separator: "width" in d ? void 0 : d,
|
|
149
149
|
rect: p
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
s = !1, a =
|
|
153
|
+
s = !1, a = m, u = [];
|
|
154
154
|
}
|
|
155
155
|
} else if (c.hasAttribute("data-separator")) {
|
|
156
|
-
const
|
|
156
|
+
const m = i.find(
|
|
157
157
|
(y) => y.element === c
|
|
158
158
|
);
|
|
159
|
-
|
|
159
|
+
m ? u.push(m) : (a = void 0, u = []);
|
|
160
160
|
} else
|
|
161
161
|
s = !0;
|
|
162
162
|
return l;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function ft(e, t) {
|
|
165
165
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
166
166
|
return t * o;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function dt(e, t) {
|
|
169
169
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
170
170
|
return t * o;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function pt(e) {
|
|
173
173
|
return e / 100 * window.innerHeight;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ht(e) {
|
|
176
176
|
return e / 100 * window.innerWidth;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function mt(e) {
|
|
179
179
|
switch (typeof e) {
|
|
180
180
|
case "number":
|
|
181
181
|
return [e, "px"];
|
|
@@ -191,7 +191,7 @@ function re({
|
|
|
191
191
|
styleProp: n
|
|
192
192
|
}) {
|
|
193
193
|
let o;
|
|
194
|
-
const [i, r] =
|
|
194
|
+
const [i, r] = mt(n);
|
|
195
195
|
switch (r) {
|
|
196
196
|
case "%": {
|
|
197
197
|
o = i / 100 * e;
|
|
@@ -202,19 +202,19 @@ function re({
|
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "rem": {
|
|
205
|
-
o =
|
|
205
|
+
o = dt(t, i);
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
case "em": {
|
|
209
|
-
o =
|
|
209
|
+
o = ft(t, i);
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
212
|
case "vh": {
|
|
213
|
-
o =
|
|
213
|
+
o = pt(i);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
case "vw": {
|
|
217
|
-
o =
|
|
217
|
+
o = ht(i);
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -224,7 +224,7 @@ function D(e) {
|
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
226
|
function ve(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
227
|
+
const { panels: t } = e, n = K({ 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 gt {
|
|
284
284
|
#e = {};
|
|
285
285
|
addListener(t, n) {
|
|
286
286
|
const o = this.#e[t];
|
|
@@ -329,8 +329,8 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
333
|
-
function
|
|
332
|
+
const F = new gt();
|
|
333
|
+
function E() {
|
|
334
334
|
return I;
|
|
335
335
|
}
|
|
336
336
|
function M(e) {
|
|
@@ -341,7 +341,7 @@ function M(e) {
|
|
|
341
341
|
return I = {
|
|
342
342
|
...I,
|
|
343
343
|
...t
|
|
344
|
-
}, t.cursorFlags !== void 0 &&
|
|
344
|
+
}, t.cursorFlags !== void 0 && F.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && F.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
|
|
345
345
|
o.derivedPanelConstraints.forEach((r) => {
|
|
346
346
|
if (r.collapsible) {
|
|
347
347
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
@@ -357,15 +357,15 @@ function M(e) {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
}),
|
|
360
|
+
}), F.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function yt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
364
364
|
x: 1 / 0,
|
|
365
365
|
y: 1 / 0
|
|
366
366
|
};
|
|
367
367
|
for (const r of t) {
|
|
368
|
-
const l =
|
|
368
|
+
const l = $e(n, r.rect);
|
|
369
369
|
switch (e) {
|
|
370
370
|
case "horizontal": {
|
|
371
371
|
l.x <= i.x && (o = r, i = l);
|
|
@@ -382,10 +382,10 @@ function gt(e, t, n) {
|
|
|
382
382
|
hitRegion: o
|
|
383
383
|
} : void 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function St(e) {
|
|
386
386
|
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function vt(e, t) {
|
|
389
389
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
390
390
|
const n = {
|
|
391
391
|
a: be(e),
|
|
@@ -416,20 +416,20 @@ function St(e, t) {
|
|
|
416
416
|
}
|
|
417
417
|
return Math.sign(i.a - i.b);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
421
|
-
const t = getComputedStyle(
|
|
419
|
+
const xt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
420
|
+
function zt(e) {
|
|
421
|
+
const t = getComputedStyle(je(e) ?? e).display;
|
|
422
422
|
return t === "flex" || t === "inline-flex";
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function bt(e) {
|
|
425
425
|
const t = getComputedStyle(e);
|
|
426
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
426
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || zt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || xt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
427
427
|
}
|
|
428
428
|
function xe(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"), bt(n)) return n;
|
|
433
433
|
}
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
@@ -439,29 +439,29 @@ function ze(e) {
|
|
|
439
439
|
function be(e) {
|
|
440
440
|
const t = [];
|
|
441
441
|
for (; e; )
|
|
442
|
-
t.push(e), e =
|
|
442
|
+
t.push(e), e = je(e);
|
|
443
443
|
return t;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function je(e) {
|
|
446
446
|
const { parentNode: t } = e;
|
|
447
|
-
return
|
|
447
|
+
return St(t) ? t.host : t;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function wt(e, t) {
|
|
450
450
|
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function Lt({
|
|
453
453
|
groupElement: e,
|
|
454
454
|
hitRegion: t,
|
|
455
455
|
pointerEventTarget: n
|
|
456
456
|
}) {
|
|
457
|
-
if (!
|
|
457
|
+
if (!Fe(n) || n.contains(e) || e.contains(n))
|
|
458
458
|
return !0;
|
|
459
|
-
if (
|
|
459
|
+
if (vt(n, e) > 0) {
|
|
460
460
|
let o = n;
|
|
461
461
|
for (; o; ) {
|
|
462
462
|
if (o.contains(e))
|
|
463
463
|
return !0;
|
|
464
|
-
if (
|
|
464
|
+
if (wt(o.getBoundingClientRect(), t))
|
|
465
465
|
return !1;
|
|
466
466
|
o = o.parentElement;
|
|
467
467
|
}
|
|
@@ -473,18 +473,18 @@ function pe(e, t) {
|
|
|
473
473
|
return t.forEach((o, i) => {
|
|
474
474
|
if (i.disabled)
|
|
475
475
|
return;
|
|
476
|
-
const r =
|
|
476
|
+
const r = He(i), l = yt(i.orientation, r, {
|
|
477
477
|
x: e.clientX,
|
|
478
478
|
y: e.clientY
|
|
479
479
|
});
|
|
480
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 &&
|
|
480
|
+
l && l.distance.x <= 0 && l.distance.y <= 0 && Lt({
|
|
481
481
|
groupElement: i.element,
|
|
482
482
|
hitRegion: l.hitRegion.rect,
|
|
483
483
|
pointerEventTarget: e.target
|
|
484
484
|
}) && n.push(l.hitRegion);
|
|
485
485
|
}), n;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Ct(e, t) {
|
|
488
488
|
if (e.length !== t.length)
|
|
489
489
|
return !1;
|
|
490
490
|
for (let n = 0; n < e.length; n++)
|
|
@@ -492,10 +492,10 @@ function Lt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function O(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function B({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -505,10 +505,10 @@ function W({
|
|
|
505
505
|
maxSize: i = 100,
|
|
506
506
|
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (O(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
510
|
const l = (n + r) / 2;
|
|
511
|
-
|
|
511
|
+
O(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
513
|
t = r;
|
|
514
514
|
return t = Math.min(i, t), t = D(t), t;
|
|
@@ -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 m = 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
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
@@ -568,12 +568,29 @@ 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
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
+
default: {
|
|
578
|
+
const f = e < 0 ? c : u, d = n[f];
|
|
579
|
+
z(
|
|
580
|
+
d,
|
|
581
|
+
`Panel constraints not found for index ${f}`
|
|
582
|
+
);
|
|
583
|
+
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
|
+
if (p)
|
|
585
|
+
if (e > 0) {
|
|
586
|
+
const x = v - g, S = x / 2;
|
|
587
|
+
O(e, x) < 0 && (e = O(e, S) <= 0 ? 0 : x);
|
|
588
|
+
} else {
|
|
589
|
+
const x = v - g, S = 100 - x / 2;
|
|
590
|
+
O(Math.abs(e), x) < 0 && (e = O(100 + e, S) > 0 ? 0 : -x);
|
|
591
|
+
}
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
577
594
|
}
|
|
578
595
|
{
|
|
579
596
|
const f = e < 0 ? 1 : -1;
|
|
@@ -584,7 +601,7 @@ function te({
|
|
|
584
601
|
v != null,
|
|
585
602
|
`Previous layout not found for panel index ${d}`
|
|
586
603
|
);
|
|
587
|
-
const S =
|
|
604
|
+
const S = B({
|
|
588
605
|
panelConstraints: n[d],
|
|
589
606
|
size: 100
|
|
590
607
|
}) - v;
|
|
@@ -597,23 +614,23 @@ function te({
|
|
|
597
614
|
{
|
|
598
615
|
let d = e < 0 ? u : c;
|
|
599
616
|
for (; d >= 0 && d < n.length; ) {
|
|
600
|
-
const p = Math.abs(e) - Math.abs(
|
|
617
|
+
const p = Math.abs(e) - Math.abs(m), g = l[d];
|
|
601
618
|
z(
|
|
602
619
|
g != null,
|
|
603
620
|
`Previous layout not found for panel index ${d}`
|
|
604
621
|
);
|
|
605
|
-
const v = g - p, x =
|
|
622
|
+
const v = g - p, x = B({
|
|
606
623
|
panelConstraints: n[d],
|
|
607
624
|
size: v
|
|
608
625
|
});
|
|
609
|
-
if (!R(g, x) && (
|
|
626
|
+
if (!R(g, x) && (m += g - x, a[d] = x, m.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
610
627
|
numeric: !0
|
|
611
628
|
}) >= 0))
|
|
612
629
|
break;
|
|
613
630
|
e < 0 ? d-- : d++;
|
|
614
631
|
}
|
|
615
632
|
}
|
|
616
|
-
if (
|
|
633
|
+
if (Ct(s, a))
|
|
617
634
|
return i;
|
|
618
635
|
{
|
|
619
636
|
const f = e < 0 ? c : u, d = l[f];
|
|
@@ -621,7 +638,7 @@ function te({
|
|
|
621
638
|
d != null,
|
|
622
639
|
`Previous layout not found for panel index ${f}`
|
|
623
640
|
);
|
|
624
|
-
const p = d +
|
|
641
|
+
const p = d + m, g = B({
|
|
625
642
|
panelConstraints: n[f],
|
|
626
643
|
size: p
|
|
627
644
|
});
|
|
@@ -633,7 +650,7 @@ function te({
|
|
|
633
650
|
w != null,
|
|
634
651
|
`Previous layout not found for panel index ${S}`
|
|
635
652
|
);
|
|
636
|
-
const C = w + v, P =
|
|
653
|
+
const C = w + v, P = B({
|
|
637
654
|
panelConstraints: n[S],
|
|
638
655
|
size: C
|
|
639
656
|
});
|
|
@@ -649,18 +666,18 @@ function te({
|
|
|
649
666
|
);
|
|
650
667
|
if (!R(y, 100, 0.1))
|
|
651
668
|
return i;
|
|
652
|
-
const
|
|
653
|
-
return a.reduce((f, d, p) => (f[
|
|
669
|
+
const h = Object.keys(i);
|
|
670
|
+
return a.reduce((f, d, p) => (f[h[p]] = d, f), {});
|
|
654
671
|
}
|
|
655
|
-
function
|
|
672
|
+
function $(e, t) {
|
|
656
673
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
657
674
|
return !1;
|
|
658
675
|
for (const n in e)
|
|
659
|
-
if (t[n] === void 0 ||
|
|
676
|
+
if (t[n] === void 0 || O(e[n], t[n]) !== 0)
|
|
660
677
|
return !1;
|
|
661
678
|
return !0;
|
|
662
679
|
}
|
|
663
|
-
function
|
|
680
|
+
function H({
|
|
664
681
|
layout: e,
|
|
665
682
|
panelConstraints: t
|
|
666
683
|
}) {
|
|
@@ -683,7 +700,7 @@ function $({
|
|
|
683
700
|
for (let s = 0; s < t.length; s++) {
|
|
684
701
|
const a = o[s];
|
|
685
702
|
z(a != null, `No layout data found for index ${s}`);
|
|
686
|
-
const u =
|
|
703
|
+
const u = B({
|
|
687
704
|
panelConstraints: t[s],
|
|
688
705
|
size: a
|
|
689
706
|
});
|
|
@@ -693,7 +710,7 @@ function $({
|
|
|
693
710
|
for (let s = 0; s < t.length; s++) {
|
|
694
711
|
const a = o[s];
|
|
695
712
|
z(a != null, `No layout data found for index ${s}`);
|
|
696
|
-
const u = a + r, c =
|
|
713
|
+
const u = a + r, c = B({
|
|
697
714
|
panelConstraints: t[s],
|
|
698
715
|
size: u
|
|
699
716
|
});
|
|
@@ -703,18 +720,18 @@ function $({
|
|
|
703
720
|
const l = Object.keys(e);
|
|
704
721
|
return o.reduce((s, a, u) => (s[l[u]] = a, s), {});
|
|
705
722
|
}
|
|
706
|
-
function
|
|
723
|
+
function Ve({
|
|
707
724
|
groupId: e,
|
|
708
725
|
panelId: t
|
|
709
726
|
}) {
|
|
710
727
|
const n = () => {
|
|
711
|
-
const { mountedGroups: s } =
|
|
728
|
+
const { mountedGroups: s } = E();
|
|
712
729
|
for (const [
|
|
713
730
|
a,
|
|
714
731
|
{
|
|
715
732
|
defaultLayoutDeferred: u,
|
|
716
733
|
derivedPanelConstraints: c,
|
|
717
|
-
layout:
|
|
734
|
+
layout: m,
|
|
718
735
|
separatorToPanels: y
|
|
719
736
|
}
|
|
720
737
|
] of s)
|
|
@@ -723,7 +740,7 @@ function je({
|
|
|
723
740
|
defaultLayoutDeferred: u,
|
|
724
741
|
derivedPanelConstraints: c,
|
|
725
742
|
group: a,
|
|
726
|
-
layout:
|
|
743
|
+
layout: m,
|
|
727
744
|
separatorToPanels: y
|
|
728
745
|
};
|
|
729
746
|
throw Error(`Group ${e} not found`);
|
|
@@ -751,26 +768,26 @@ function je({
|
|
|
751
768
|
const {
|
|
752
769
|
defaultLayoutDeferred: u,
|
|
753
770
|
derivedPanelConstraints: c,
|
|
754
|
-
group:
|
|
771
|
+
group: m,
|
|
755
772
|
layout: y,
|
|
756
|
-
separatorToPanels:
|
|
757
|
-
} = n(), f =
|
|
773
|
+
separatorToPanels: h
|
|
774
|
+
} = n(), f = m.panels.findIndex((v) => v.id === t), d = f === m.panels.length - 1, p = te({
|
|
758
775
|
delta: d ? a - s : s - a,
|
|
759
776
|
initialLayout: y,
|
|
760
777
|
panelConstraints: c,
|
|
761
778
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
762
779
|
prevLayout: y,
|
|
763
780
|
trigger: "imperative-api"
|
|
764
|
-
}), g =
|
|
781
|
+
}), g = H({
|
|
765
782
|
layout: p,
|
|
766
783
|
panelConstraints: c
|
|
767
784
|
});
|
|
768
|
-
|
|
769
|
-
mountedGroups: new Map(v.mountedGroups).set(
|
|
785
|
+
$(y, g) || M((v) => ({
|
|
786
|
+
mountedGroups: new Map(v.mountedGroups).set(m, {
|
|
770
787
|
defaultLayoutDeferred: u,
|
|
771
788
|
derivedPanelConstraints: c,
|
|
772
789
|
layout: g,
|
|
773
|
-
separatorToPanels:
|
|
790
|
+
separatorToPanels: h
|
|
774
791
|
})
|
|
775
792
|
}));
|
|
776
793
|
};
|
|
@@ -780,8 +797,8 @@ function je({
|
|
|
780
797
|
s && c !== a && (u.expandToSize = c, l(a));
|
|
781
798
|
},
|
|
782
799
|
expand: () => {
|
|
783
|
-
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(),
|
|
784
|
-
if (s &&
|
|
800
|
+
const { collapsible: s, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), m = r();
|
|
801
|
+
if (s && m === a) {
|
|
785
802
|
let y = c.expandToSize ?? u;
|
|
786
803
|
y === 0 && (y = 1), l(y);
|
|
787
804
|
}
|
|
@@ -802,8 +819,8 @@ function je({
|
|
|
802
819
|
let u;
|
|
803
820
|
switch (typeof s) {
|
|
804
821
|
case "number": {
|
|
805
|
-
const { group: c } = n(),
|
|
806
|
-
u = D(s /
|
|
822
|
+
const { group: c } = n(), m = K({ group: c });
|
|
823
|
+
u = D(s / m * 100);
|
|
807
824
|
break;
|
|
808
825
|
}
|
|
809
826
|
case "string": {
|
|
@@ -819,14 +836,14 @@ function je({
|
|
|
819
836
|
function we(e) {
|
|
820
837
|
if (e.defaultPrevented)
|
|
821
838
|
return;
|
|
822
|
-
const { mountedGroups: t } =
|
|
839
|
+
const { mountedGroups: t } = E();
|
|
823
840
|
pe(e, t).forEach((o) => {
|
|
824
841
|
if (o.separator) {
|
|
825
842
|
const i = o.panels.find(
|
|
826
843
|
(r) => r.panelConstraints.defaultSize !== void 0
|
|
827
844
|
);
|
|
828
845
|
if (i) {
|
|
829
|
-
const r = i.panelConstraints.defaultSize, l =
|
|
846
|
+
const r = i.panelConstraints.defaultSize, l = Ve({
|
|
830
847
|
groupId: o.group.id,
|
|
831
848
|
panelId: i.id
|
|
832
849
|
});
|
|
@@ -836,7 +853,7 @@ function we(e) {
|
|
|
836
853
|
});
|
|
837
854
|
}
|
|
838
855
|
function ae(e) {
|
|
839
|
-
const { mountedGroups: t } =
|
|
856
|
+
const { mountedGroups: t } = E();
|
|
840
857
|
for (const [n] of t)
|
|
841
858
|
if (n.separators.some(
|
|
842
859
|
(o) => o.element === e
|
|
@@ -844,11 +861,11 @@ function ae(e) {
|
|
|
844
861
|
return n;
|
|
845
862
|
throw Error("Could not find parent Group for separator element");
|
|
846
863
|
}
|
|
847
|
-
function
|
|
864
|
+
function Ue({
|
|
848
865
|
groupId: e
|
|
849
866
|
}) {
|
|
850
867
|
const t = () => {
|
|
851
|
-
const { mountedGroups: n } =
|
|
868
|
+
const { mountedGroups: n } = E();
|
|
852
869
|
for (const [o, i] of n)
|
|
853
870
|
if (o.id === e)
|
|
854
871
|
return { group: o, ...i };
|
|
@@ -866,11 +883,11 @@ function Ve({
|
|
|
866
883
|
group: r,
|
|
867
884
|
layout: l,
|
|
868
885
|
separatorToPanels: s
|
|
869
|
-
} = t(), a =
|
|
886
|
+
} = t(), a = H({
|
|
870
887
|
layout: n,
|
|
871
888
|
panelConstraints: i
|
|
872
889
|
});
|
|
873
|
-
return o ? l : (
|
|
890
|
+
return o ? l : ($(l, a) || M((u) => ({
|
|
874
891
|
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
875
892
|
defaultLayoutDeferred: o,
|
|
876
893
|
derivedPanelConstraints: i,
|
|
@@ -881,30 +898,30 @@ function Ve({
|
|
|
881
898
|
}
|
|
882
899
|
};
|
|
883
900
|
}
|
|
884
|
-
function
|
|
885
|
-
const { mountedGroups: t } =
|
|
901
|
+
function We(e) {
|
|
902
|
+
const { mountedGroups: t } = E(), n = t.get(e);
|
|
886
903
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
887
904
|
}
|
|
888
|
-
function
|
|
889
|
-
const n = ae(e), o =
|
|
890
|
-
(
|
|
905
|
+
function N(e, t) {
|
|
906
|
+
const n = ae(e), o = We(n), i = n.separators.find(
|
|
907
|
+
(m) => m.element === e
|
|
891
908
|
);
|
|
892
909
|
z(i, "Matching separator not found");
|
|
893
910
|
const r = o.separatorToPanels.get(i);
|
|
894
911
|
z(r, "Matching panels not found");
|
|
895
|
-
const l = r.map((
|
|
912
|
+
const l = r.map((m) => n.panels.indexOf(m)), a = Ue({ groupId: n.id }).getLayout(), u = te({
|
|
896
913
|
delta: t,
|
|
897
914
|
initialLayout: a,
|
|
898
915
|
panelConstraints: o.derivedPanelConstraints,
|
|
899
916
|
pivotIndices: l,
|
|
900
917
|
prevLayout: a,
|
|
901
918
|
trigger: "keyboard"
|
|
902
|
-
}), c =
|
|
919
|
+
}), c = H({
|
|
903
920
|
layout: u,
|
|
904
921
|
panelConstraints: o.derivedPanelConstraints
|
|
905
922
|
});
|
|
906
|
-
|
|
907
|
-
mountedGroups: new Map(
|
|
923
|
+
$(a, c) || M((m) => ({
|
|
924
|
+
mountedGroups: new Map(m.mountedGroups).set(n, {
|
|
908
925
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
909
926
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
910
927
|
layout: c,
|
|
@@ -919,39 +936,39 @@ function Le(e) {
|
|
|
919
936
|
if (!n.disabled)
|
|
920
937
|
switch (e.key) {
|
|
921
938
|
case "ArrowDown": {
|
|
922
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
939
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, 5);
|
|
923
940
|
break;
|
|
924
941
|
}
|
|
925
942
|
case "ArrowLeft": {
|
|
926
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
943
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, -5);
|
|
927
944
|
break;
|
|
928
945
|
}
|
|
929
946
|
case "ArrowRight": {
|
|
930
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
947
|
+
e.preventDefault(), n.orientation === "horizontal" && N(t, 5);
|
|
931
948
|
break;
|
|
932
949
|
}
|
|
933
950
|
case "ArrowUp": {
|
|
934
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
951
|
+
e.preventDefault(), n.orientation === "vertical" && N(t, -5);
|
|
935
952
|
break;
|
|
936
953
|
}
|
|
937
954
|
case "End": {
|
|
938
|
-
e.preventDefault(),
|
|
955
|
+
e.preventDefault(), N(t, 100);
|
|
939
956
|
break;
|
|
940
957
|
}
|
|
941
958
|
case "Enter": {
|
|
942
959
|
e.preventDefault();
|
|
943
|
-
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } =
|
|
944
|
-
(
|
|
960
|
+
const o = ae(t), { derivedPanelConstraints: i, layout: r, separatorToPanels: l } = We(o), s = o.separators.find(
|
|
961
|
+
(m) => m.element === t
|
|
945
962
|
);
|
|
946
963
|
z(s, "Matching separator not found");
|
|
947
964
|
const a = l.get(s);
|
|
948
965
|
z(a, "Matching panels not found");
|
|
949
966
|
const u = a[0], c = i.find(
|
|
950
|
-
(
|
|
967
|
+
(m) => m.panelId === u.id
|
|
951
968
|
);
|
|
952
969
|
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
953
|
-
const
|
|
954
|
-
|
|
970
|
+
const m = r[u.id], y = c.collapsedSize === m ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
971
|
+
N(t, y - m);
|
|
955
972
|
}
|
|
956
973
|
break;
|
|
957
974
|
}
|
|
@@ -968,7 +985,7 @@ function Le(e) {
|
|
|
968
985
|
break;
|
|
969
986
|
}
|
|
970
987
|
case "Home": {
|
|
971
|
-
e.preventDefault(),
|
|
988
|
+
e.preventDefault(), N(t, -100);
|
|
972
989
|
break;
|
|
973
990
|
}
|
|
974
991
|
}
|
|
@@ -978,7 +995,7 @@ function Ce(e) {
|
|
|
978
995
|
return;
|
|
979
996
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
980
997
|
return;
|
|
981
|
-
const { mountedGroups: t } =
|
|
998
|
+
const { mountedGroups: t } = E(), n = pe(e, t), o = /* @__PURE__ */ new Map();
|
|
982
999
|
let i = !1;
|
|
983
1000
|
n.forEach((r) => {
|
|
984
1001
|
r.separator && (i || (i = !0, r.separator.element.focus()));
|
|
@@ -993,13 +1010,13 @@ function Ce(e) {
|
|
|
993
1010
|
}
|
|
994
1011
|
}), n.length && e.preventDefault();
|
|
995
1012
|
}
|
|
996
|
-
const
|
|
997
|
-
},
|
|
1013
|
+
const Pt = (e) => e, ce = () => {
|
|
1014
|
+
}, Be = 1, Ke = 2, Xe = 4, qe = 8, Pe = 3, Re = 12;
|
|
998
1015
|
let se;
|
|
999
1016
|
function Me() {
|
|
1000
1017
|
return se === void 0 && (se = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (se = !0)), se;
|
|
1001
1018
|
}
|
|
1002
|
-
function
|
|
1019
|
+
function Rt({
|
|
1003
1020
|
cursorFlags: e,
|
|
1004
1021
|
groups: t,
|
|
1005
1022
|
state: n
|
|
@@ -1027,7 +1044,7 @@ function Pt({
|
|
|
1027
1044
|
switch (n) {
|
|
1028
1045
|
case "active": {
|
|
1029
1046
|
if (e && Me()) {
|
|
1030
|
-
const r = (e &
|
|
1047
|
+
const r = (e & Be) !== 0, l = (e & Ke) !== 0, s = (e & Xe) !== 0, a = (e & qe) !== 0;
|
|
1031
1048
|
if (r)
|
|
1032
1049
|
return s ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
1033
1050
|
if (l)
|
|
@@ -1048,11 +1065,11 @@ function he(e) {
|
|
|
1048
1065
|
return;
|
|
1049
1066
|
let { prevStyle: t, styleSheet: n } = Ee.get(e) ?? {};
|
|
1050
1067
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
|
|
1051
|
-
const { cursorFlags: o, interactionState: i } =
|
|
1068
|
+
const { cursorFlags: o, interactionState: i } = E();
|
|
1052
1069
|
switch (i.state) {
|
|
1053
1070
|
case "active":
|
|
1054
1071
|
case "hover": {
|
|
1055
|
-
const r =
|
|
1072
|
+
const r = Rt({
|
|
1056
1073
|
cursorFlags: o,
|
|
1057
1074
|
groups: i.hitRegions.map((s) => s.group),
|
|
1058
1075
|
state: i.state
|
|
@@ -1072,7 +1089,7 @@ function he(e) {
|
|
|
1072
1089
|
styleSheet: n
|
|
1073
1090
|
});
|
|
1074
1091
|
}
|
|
1075
|
-
function
|
|
1092
|
+
function Ye({
|
|
1076
1093
|
document: e,
|
|
1077
1094
|
event: t,
|
|
1078
1095
|
hitRegions: n,
|
|
@@ -1084,15 +1101,15 @@ function qe({
|
|
|
1084
1101
|
let s = 0;
|
|
1085
1102
|
const a = new Map(i);
|
|
1086
1103
|
n.forEach((c) => {
|
|
1087
|
-
const { group:
|
|
1104
|
+
const { group: m, groupSize: y } = c, { disableCursor: h, orientation: f, panels: d } = m;
|
|
1088
1105
|
let p = 0;
|
|
1089
1106
|
r ? f === "horizontal" ? p = (t.clientX - r.x) / y * 100 : p = (t.clientY - r.y) / y * 100 : f === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
1090
|
-
const g = o.get(
|
|
1107
|
+
const g = o.get(m), {
|
|
1091
1108
|
defaultLayoutDeferred: v,
|
|
1092
1109
|
derivedPanelConstraints: x,
|
|
1093
1110
|
layout: S,
|
|
1094
1111
|
separatorToPanels: w
|
|
1095
|
-
} = i.get(
|
|
1112
|
+
} = i.get(m) ?? { defaultLayoutDeferred: !1 };
|
|
1096
1113
|
if (x && g && S && w) {
|
|
1097
1114
|
const C = te({
|
|
1098
1115
|
delta: p,
|
|
@@ -1102,15 +1119,15 @@ function qe({
|
|
|
1102
1119
|
prevLayout: S,
|
|
1103
1120
|
trigger: "mouse-or-touch"
|
|
1104
1121
|
});
|
|
1105
|
-
if (
|
|
1106
|
-
if (p !== 0 && !
|
|
1122
|
+
if ($(C, S)) {
|
|
1123
|
+
if (p !== 0 && !h)
|
|
1107
1124
|
switch (f) {
|
|
1108
1125
|
case "horizontal": {
|
|
1109
|
-
s |= p < 0 ?
|
|
1126
|
+
s |= p < 0 ? Be : Ke;
|
|
1110
1127
|
break;
|
|
1111
1128
|
}
|
|
1112
1129
|
case "vertical": {
|
|
1113
|
-
s |= p < 0 ?
|
|
1130
|
+
s |= p < 0 ? Xe : qe;
|
|
1114
1131
|
break;
|
|
1115
1132
|
}
|
|
1116
1133
|
}
|
|
@@ -1133,10 +1150,10 @@ function qe({
|
|
|
1133
1150
|
}), he(e);
|
|
1134
1151
|
}
|
|
1135
1152
|
function ke(e) {
|
|
1136
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1153
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
1137
1154
|
switch (n.state) {
|
|
1138
1155
|
case "active":
|
|
1139
|
-
|
|
1156
|
+
Ye({
|
|
1140
1157
|
document: e.currentTarget,
|
|
1141
1158
|
event: e,
|
|
1142
1159
|
hitRegions: n.hitRegions,
|
|
@@ -1149,7 +1166,7 @@ function ke(e) {
|
|
|
1149
1166
|
function Ge(e) {
|
|
1150
1167
|
if (e.defaultPrevented)
|
|
1151
1168
|
return;
|
|
1152
|
-
const { cursorFlags: t, interactionState: n, mountedGroups: o } =
|
|
1169
|
+
const { cursorFlags: t, interactionState: n, mountedGroups: o } = E();
|
|
1153
1170
|
switch (n.state) {
|
|
1154
1171
|
case "active": {
|
|
1155
1172
|
if (
|
|
@@ -1166,7 +1183,7 @@ function Ge(e) {
|
|
|
1166
1183
|
}));
|
|
1167
1184
|
return;
|
|
1168
1185
|
}
|
|
1169
|
-
|
|
1186
|
+
Ye({
|
|
1170
1187
|
document: e.currentTarget,
|
|
1171
1188
|
event: e,
|
|
1172
1189
|
hitRegions: n.hitRegions,
|
|
@@ -1194,11 +1211,24 @@ function Ge(e) {
|
|
|
1194
1211
|
}
|
|
1195
1212
|
}
|
|
1196
1213
|
function Ie(e) {
|
|
1214
|
+
if (e.relatedTarget instanceof HTMLIFrameElement) {
|
|
1215
|
+
const { interactionState: t } = E();
|
|
1216
|
+
switch (t.state) {
|
|
1217
|
+
case "hover":
|
|
1218
|
+
M({
|
|
1219
|
+
interactionState: {
|
|
1220
|
+
state: "inactive"
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
function De(e) {
|
|
1197
1227
|
if (e.defaultPrevented)
|
|
1198
1228
|
return;
|
|
1199
1229
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1200
1230
|
return;
|
|
1201
|
-
const { interactionState: t } =
|
|
1231
|
+
const { interactionState: t } = E();
|
|
1202
1232
|
switch (t.state) {
|
|
1203
1233
|
case "active":
|
|
1204
1234
|
M({
|
|
@@ -1211,7 +1241,7 @@ function Ie(e) {
|
|
|
1211
1241
|
})), e.preventDefault());
|
|
1212
1242
|
}
|
|
1213
1243
|
}
|
|
1214
|
-
function
|
|
1244
|
+
function Te(e) {
|
|
1215
1245
|
let t = 0, n = 0;
|
|
1216
1246
|
const o = {};
|
|
1217
1247
|
for (const r of e)
|
|
@@ -1229,19 +1259,19 @@ function De(e) {
|
|
|
1229
1259
|
}
|
|
1230
1260
|
return o;
|
|
1231
1261
|
}
|
|
1232
|
-
function
|
|
1262
|
+
function Mt(e, t, n) {
|
|
1233
1263
|
if (!n[0])
|
|
1234
1264
|
return;
|
|
1235
1265
|
const i = e.panels.find((u) => u.element === t);
|
|
1236
1266
|
if (!i || !i.onResize)
|
|
1237
1267
|
return;
|
|
1238
|
-
const r =
|
|
1268
|
+
const r = K({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1239
1269
|
asPercentage: D(l / r * 100),
|
|
1240
1270
|
inPixels: l
|
|
1241
1271
|
};
|
|
1242
1272
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, s);
|
|
1243
1273
|
}
|
|
1244
|
-
function
|
|
1274
|
+
function Et(e, t) {
|
|
1245
1275
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
1246
1276
|
return !1;
|
|
1247
1277
|
for (const o in e)
|
|
@@ -1249,7 +1279,7 @@ function Mt(e, t) {
|
|
|
1249
1279
|
return !1;
|
|
1250
1280
|
return !0;
|
|
1251
1281
|
}
|
|
1252
|
-
function
|
|
1282
|
+
function kt(e, t) {
|
|
1253
1283
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1254
1284
|
if (n.length !== o.length)
|
|
1255
1285
|
return !1;
|
|
@@ -1258,8 +1288,8 @@ function Et(e, t) {
|
|
|
1258
1288
|
return !1;
|
|
1259
1289
|
return !0;
|
|
1260
1290
|
}
|
|
1261
|
-
const
|
|
1262
|
-
function
|
|
1291
|
+
const W = /* @__PURE__ */ new Map();
|
|
1292
|
+
function Gt(e) {
|
|
1263
1293
|
let t = !0;
|
|
1264
1294
|
z(
|
|
1265
1295
|
e.element.ownerDocument.defaultView,
|
|
@@ -1270,16 +1300,16 @@ function kt(e) {
|
|
|
1270
1300
|
const { borderBoxSize: p, target: g } = d;
|
|
1271
1301
|
if (g === e.element) {
|
|
1272
1302
|
if (t) {
|
|
1273
|
-
if (
|
|
1303
|
+
if (K({ group: e }) === 0)
|
|
1274
1304
|
return;
|
|
1275
1305
|
M((x) => {
|
|
1276
1306
|
const S = x.mountedGroups.get(e);
|
|
1277
1307
|
if (S) {
|
|
1278
|
-
const w = ve(e), C = S.defaultLayoutDeferred ?
|
|
1308
|
+
const w = ve(e), C = S.defaultLayoutDeferred ? Te(w) : S.layout, P = H({
|
|
1279
1309
|
layout: C,
|
|
1280
1310
|
panelConstraints: w
|
|
1281
1311
|
});
|
|
1282
|
-
return !S.defaultLayoutDeferred &&
|
|
1312
|
+
return !S.defaultLayoutDeferred && $(C, P) && Et(
|
|
1283
1313
|
S.derivedPanelConstraints,
|
|
1284
1314
|
w
|
|
1285
1315
|
) ? x : {
|
|
@@ -1295,7 +1325,7 @@ function kt(e) {
|
|
|
1295
1325
|
});
|
|
1296
1326
|
}
|
|
1297
1327
|
} else
|
|
1298
|
-
|
|
1328
|
+
Mt(e, g, p);
|
|
1299
1329
|
}
|
|
1300
1330
|
});
|
|
1301
1331
|
r.observe(e.element), e.panels.forEach((f) => {
|
|
@@ -1304,25 +1334,25 @@ function kt(e) {
|
|
|
1304
1334
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1305
1335
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1306
1336
|
});
|
|
1307
|
-
const l =
|
|
1337
|
+
const l = K({ group: e }), s = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1308
1338
|
let u = e.defaultLayout;
|
|
1309
|
-
u && (
|
|
1310
|
-
const c = e.inMemoryLayouts[a] ?? u ??
|
|
1339
|
+
u && (kt(e.panels, u) || (u = void 0));
|
|
1340
|
+
const c = e.inMemoryLayouts[a] ?? u ?? Te(s), m = H({
|
|
1311
1341
|
layout: c,
|
|
1312
1342
|
panelConstraints: s
|
|
1313
|
-
}), y =
|
|
1343
|
+
}), y = He(e), h = e.element.ownerDocument;
|
|
1314
1344
|
return M((f) => {
|
|
1315
1345
|
const d = /* @__PURE__ */ new Map();
|
|
1316
|
-
return
|
|
1317
|
-
|
|
1318
|
-
(
|
|
1346
|
+
return W.set(
|
|
1347
|
+
h,
|
|
1348
|
+
(W.get(h) ?? 0) + 1
|
|
1319
1349
|
), y.forEach((p) => {
|
|
1320
1350
|
p.separator && d.set(p.separator, p.panels);
|
|
1321
1351
|
}), {
|
|
1322
1352
|
mountedGroups: new Map(f.mountedGroups).set(e, {
|
|
1323
1353
|
defaultLayoutDeferred: l === 0,
|
|
1324
1354
|
derivedPanelConstraints: s,
|
|
1325
|
-
layout:
|
|
1355
|
+
layout: m,
|
|
1326
1356
|
separatorToPanels: d
|
|
1327
1357
|
})
|
|
1328
1358
|
};
|
|
@@ -1331,46 +1361,46 @@ function kt(e) {
|
|
|
1331
1361
|
!i.has(f.id),
|
|
1332
1362
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1333
1363
|
), i.add(f.id), f.element.addEventListener("keydown", Le);
|
|
1334
|
-
}),
|
|
1335
|
-
t = !1,
|
|
1336
|
-
|
|
1337
|
-
Math.max(0, (
|
|
1364
|
+
}), W.get(h) === 1 && (h.addEventListener("dblclick", we, !0), h.addEventListener("pointerdown", Ce, !0), h.addEventListener("pointerleave", ke), h.addEventListener("pointermove", Ge), h.addEventListener("pointerout", Ie), h.addEventListener("pointerup", De, !0)), function() {
|
|
1365
|
+
t = !1, W.set(
|
|
1366
|
+
h,
|
|
1367
|
+
Math.max(0, (W.get(h) ?? 0) - 1)
|
|
1338
1368
|
), M((d) => {
|
|
1339
1369
|
const p = new Map(d.mountedGroups);
|
|
1340
1370
|
return p.delete(e), { mountedGroups: p };
|
|
1341
1371
|
}), e.separators.forEach((d) => {
|
|
1342
1372
|
d.element.removeEventListener("keydown", Le);
|
|
1343
|
-
}),
|
|
1373
|
+
}), W.get(h) || (h.removeEventListener(
|
|
1344
1374
|
"dblclick",
|
|
1345
1375
|
we,
|
|
1346
1376
|
!0
|
|
1347
|
-
),
|
|
1377
|
+
), h.removeEventListener(
|
|
1348
1378
|
"pointerdown",
|
|
1349
1379
|
Ce,
|
|
1350
1380
|
!0
|
|
1351
|
-
),
|
|
1381
|
+
), h.removeEventListener("pointerleave", ke), h.removeEventListener("pointermove", Ge), h.removeEventListener("pointerout", Ie), h.removeEventListener("pointerup", De, !0)), r.disconnect();
|
|
1352
1382
|
};
|
|
1353
1383
|
}
|
|
1354
|
-
function
|
|
1355
|
-
const [e, t] =
|
|
1384
|
+
function Ze() {
|
|
1385
|
+
const [e, t] = ee({}), n = Z(() => t({}), []);
|
|
1356
1386
|
return [e, n];
|
|
1357
1387
|
}
|
|
1358
1388
|
function me(e) {
|
|
1359
|
-
const t =
|
|
1389
|
+
const t = ot();
|
|
1360
1390
|
return `${e ?? t}`;
|
|
1361
1391
|
}
|
|
1362
|
-
const
|
|
1363
|
-
function
|
|
1364
|
-
const t =
|
|
1365
|
-
return
|
|
1392
|
+
const j = typeof window < "u" ? Oe : Ae;
|
|
1393
|
+
function J(e) {
|
|
1394
|
+
const t = G(e);
|
|
1395
|
+
return j(() => {
|
|
1366
1396
|
t.current = e;
|
|
1367
|
-
}, [e]),
|
|
1397
|
+
}, [e]), Z(
|
|
1368
1398
|
(...n) => t.current?.(...n),
|
|
1369
1399
|
[t]
|
|
1370
1400
|
);
|
|
1371
1401
|
}
|
|
1372
1402
|
function ge(...e) {
|
|
1373
|
-
return
|
|
1403
|
+
return J((t) => {
|
|
1374
1404
|
e.forEach((n) => {
|
|
1375
1405
|
if (n)
|
|
1376
1406
|
switch (typeof n) {
|
|
@@ -1386,27 +1416,27 @@ function ge(...e) {
|
|
|
1386
1416
|
});
|
|
1387
1417
|
});
|
|
1388
1418
|
}
|
|
1389
|
-
function
|
|
1390
|
-
const t =
|
|
1391
|
-
return
|
|
1419
|
+
function It(e) {
|
|
1420
|
+
const t = G({ ...e });
|
|
1421
|
+
return j(() => {
|
|
1392
1422
|
for (const n in e)
|
|
1393
1423
|
t.current[n] = e[n];
|
|
1394
1424
|
}, [e]), t.current;
|
|
1395
1425
|
}
|
|
1396
|
-
const
|
|
1397
|
-
function
|
|
1398
|
-
const n =
|
|
1426
|
+
const Je = it(null);
|
|
1427
|
+
function Dt(e, t) {
|
|
1428
|
+
const n = G({
|
|
1399
1429
|
getLayout: () => ({}),
|
|
1400
|
-
setLayout:
|
|
1430
|
+
setLayout: Pt
|
|
1401
1431
|
});
|
|
1402
|
-
|
|
1432
|
+
_e(t, () => n.current, []), j(() => {
|
|
1403
1433
|
Object.assign(
|
|
1404
1434
|
n.current,
|
|
1405
|
-
|
|
1435
|
+
Ue({ groupId: e })
|
|
1406
1436
|
);
|
|
1407
1437
|
});
|
|
1408
1438
|
}
|
|
1409
|
-
function
|
|
1439
|
+
function Tt({
|
|
1410
1440
|
children: e,
|
|
1411
1441
|
className: t,
|
|
1412
1442
|
defaultLayout: n,
|
|
@@ -1418,47 +1448,47 @@ function Dt({
|
|
|
1418
1448
|
onLayoutChange: a,
|
|
1419
1449
|
onLayoutChanged: u,
|
|
1420
1450
|
orientation: c = "horizontal",
|
|
1421
|
-
resizeTargetMinimumSize:
|
|
1451
|
+
resizeTargetMinimumSize: m = {
|
|
1422
1452
|
coarse: 20,
|
|
1423
1453
|
fine: 10
|
|
1424
1454
|
},
|
|
1425
1455
|
style: y,
|
|
1426
|
-
...
|
|
1456
|
+
...h
|
|
1427
1457
|
}) {
|
|
1428
|
-
const f =
|
|
1458
|
+
const f = G({
|
|
1429
1459
|
onLayoutChange: {},
|
|
1430
1460
|
onLayoutChanged: {}
|
|
1431
|
-
}), d =
|
|
1432
|
-
|
|
1433
|
-
}), p =
|
|
1434
|
-
|
|
1435
|
-
}), g = me(s), v =
|
|
1461
|
+
}), d = J((b) => {
|
|
1462
|
+
$(f.current.onLayoutChange, b) || (f.current.onLayoutChange = b, a?.(b));
|
|
1463
|
+
}), p = J((b) => {
|
|
1464
|
+
$(f.current.onLayoutChanged, b) || (f.current.onLayoutChanged = b, u?.(b));
|
|
1465
|
+
}), g = me(s), v = G(null), [x, S] = Ze(), w = G({
|
|
1436
1466
|
lastExpandedPanelSizes: {},
|
|
1437
1467
|
layouts: {},
|
|
1438
1468
|
panels: [],
|
|
1439
|
-
resizeTargetMinimumSize:
|
|
1469
|
+
resizeTargetMinimumSize: m,
|
|
1440
1470
|
separators: []
|
|
1441
1471
|
}), C = ge(v, r);
|
|
1442
|
-
|
|
1443
|
-
const P =
|
|
1472
|
+
Dt(g, l);
|
|
1473
|
+
const P = J(
|
|
1444
1474
|
(b, L) => {
|
|
1445
|
-
const { interactionState:
|
|
1475
|
+
const { interactionState: k, mountedGroups: ne } = E();
|
|
1446
1476
|
for (const oe of ne.keys())
|
|
1447
1477
|
if (oe.id === b) {
|
|
1448
|
-
const
|
|
1449
|
-
if (
|
|
1450
|
-
let
|
|
1451
|
-
switch (
|
|
1478
|
+
const X = ne.get(oe);
|
|
1479
|
+
if (X) {
|
|
1480
|
+
let q = !1;
|
|
1481
|
+
switch (k.state) {
|
|
1452
1482
|
case "active": {
|
|
1453
|
-
|
|
1483
|
+
q = k.hitRegions.some(
|
|
1454
1484
|
(le) => le.group === oe
|
|
1455
1485
|
);
|
|
1456
1486
|
break;
|
|
1457
1487
|
}
|
|
1458
1488
|
}
|
|
1459
1489
|
return {
|
|
1460
|
-
flexGrow:
|
|
1461
|
-
pointerEvents:
|
|
1490
|
+
flexGrow: X.layout[L] ?? 1,
|
|
1491
|
+
pointerEvents: q ? "none" : void 0
|
|
1462
1492
|
};
|
|
1463
1493
|
}
|
|
1464
1494
|
}
|
|
@@ -1466,7 +1496,7 @@ function Dt({
|
|
|
1466
1496
|
flexGrow: n?.[L] ?? 1
|
|
1467
1497
|
};
|
|
1468
1498
|
}
|
|
1469
|
-
), T =
|
|
1499
|
+
), T = Ne(
|
|
1470
1500
|
() => ({
|
|
1471
1501
|
getPanelStyles: P,
|
|
1472
1502
|
id: g,
|
|
@@ -1478,7 +1508,7 @@ function Dt({
|
|
|
1478
1508
|
b
|
|
1479
1509
|
]), S(), () => {
|
|
1480
1510
|
L.panels = L.panels.filter(
|
|
1481
|
-
(
|
|
1511
|
+
(k) => k !== b
|
|
1482
1512
|
), S();
|
|
1483
1513
|
};
|
|
1484
1514
|
},
|
|
@@ -1489,23 +1519,23 @@ function Dt({
|
|
|
1489
1519
|
b
|
|
1490
1520
|
]), S(), () => {
|
|
1491
1521
|
L.separators = L.separators.filter(
|
|
1492
|
-
(
|
|
1522
|
+
(k) => k !== b
|
|
1493
1523
|
), S();
|
|
1494
1524
|
};
|
|
1495
1525
|
}
|
|
1496
1526
|
}),
|
|
1497
1527
|
[P, g, S, c]
|
|
1498
|
-
),
|
|
1528
|
+
), V = It({
|
|
1499
1529
|
defaultLayout: n,
|
|
1500
1530
|
disableCursor: o
|
|
1501
|
-
}),
|
|
1502
|
-
return
|
|
1531
|
+
}), A = G(null);
|
|
1532
|
+
return j(() => {
|
|
1503
1533
|
const b = v.current;
|
|
1504
1534
|
if (b === null)
|
|
1505
1535
|
return;
|
|
1506
|
-
const L = w.current,
|
|
1507
|
-
defaultLayout:
|
|
1508
|
-
disableCursor: !!
|
|
1536
|
+
const L = w.current, k = {
|
|
1537
|
+
defaultLayout: V.defaultLayout,
|
|
1538
|
+
disableCursor: !!V.disableCursor,
|
|
1509
1539
|
disabled: !!i,
|
|
1510
1540
|
element: b,
|
|
1511
1541
|
id: g,
|
|
@@ -1516,40 +1546,40 @@ function Dt({
|
|
|
1516
1546
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1517
1547
|
separators: L.separators
|
|
1518
1548
|
};
|
|
1519
|
-
|
|
1520
|
-
const ne =
|
|
1521
|
-
if (
|
|
1522
|
-
const { defaultLayoutDeferred:
|
|
1523
|
-
!
|
|
1549
|
+
A.current = k;
|
|
1550
|
+
const ne = Gt(k), X = E().mountedGroups.get(k);
|
|
1551
|
+
if (X) {
|
|
1552
|
+
const { defaultLayoutDeferred: Y, derivedPanelConstraints: _, layout: U } = X;
|
|
1553
|
+
!Y && _.length > 0 && (d(U), p(U), L.panels.forEach((ue) => {
|
|
1524
1554
|
ue.scheduleUpdate();
|
|
1525
1555
|
}));
|
|
1526
1556
|
}
|
|
1527
|
-
let
|
|
1528
|
-
const le =
|
|
1557
|
+
let q = !1;
|
|
1558
|
+
const le = F.addListener(
|
|
1529
1559
|
"interactionStateChange",
|
|
1530
|
-
(
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
|
|
1560
|
+
(Y) => {
|
|
1561
|
+
const _ = Y.state === "active";
|
|
1562
|
+
q !== _ && (q = _, L.panels.forEach((U) => {
|
|
1563
|
+
U.scheduleUpdate();
|
|
1534
1564
|
}));
|
|
1535
1565
|
}
|
|
1536
|
-
),
|
|
1566
|
+
), Qe = F.addListener(
|
|
1537
1567
|
"mountedGroupsChange",
|
|
1538
|
-
(
|
|
1539
|
-
const
|
|
1540
|
-
if (
|
|
1541
|
-
const { defaultLayoutDeferred:
|
|
1542
|
-
if (
|
|
1568
|
+
(Y) => {
|
|
1569
|
+
const _ = Y.get(k);
|
|
1570
|
+
if (_) {
|
|
1571
|
+
const { defaultLayoutDeferred: U, derivedPanelConstraints: ue, layout: Se } = _;
|
|
1572
|
+
if (U || ue.length === 0)
|
|
1543
1573
|
return;
|
|
1544
|
-
const { interactionState:
|
|
1545
|
-
d(Se),
|
|
1546
|
-
|
|
1574
|
+
const { interactionState: et } = E(), tt = et.state !== "active";
|
|
1575
|
+
d(Se), tt && p(Se), L.panels.forEach((nt) => {
|
|
1576
|
+
nt.scheduleUpdate();
|
|
1547
1577
|
});
|
|
1548
1578
|
}
|
|
1549
1579
|
}
|
|
1550
1580
|
);
|
|
1551
1581
|
return () => {
|
|
1552
|
-
|
|
1582
|
+
A.current = null, ne(), le(), Qe();
|
|
1553
1583
|
};
|
|
1554
1584
|
}, [
|
|
1555
1585
|
i,
|
|
@@ -1558,14 +1588,14 @@ function Dt({
|
|
|
1558
1588
|
d,
|
|
1559
1589
|
c,
|
|
1560
1590
|
x,
|
|
1561
|
-
|
|
1562
|
-
]),
|
|
1563
|
-
const b =
|
|
1591
|
+
V
|
|
1592
|
+
]), Ae(() => {
|
|
1593
|
+
const b = A.current;
|
|
1564
1594
|
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1565
|
-
}), /* @__PURE__ */
|
|
1595
|
+
}), /* @__PURE__ */ Q(Je.Provider, { value: T, children: /* @__PURE__ */ Q(
|
|
1566
1596
|
"div",
|
|
1567
1597
|
{
|
|
1568
|
-
...
|
|
1598
|
+
...h,
|
|
1569
1599
|
className: t,
|
|
1570
1600
|
"data-group": !0,
|
|
1571
1601
|
"data-testid": g,
|
|
@@ -1584,49 +1614,49 @@ function Dt({
|
|
|
1584
1614
|
}
|
|
1585
1615
|
) });
|
|
1586
1616
|
}
|
|
1587
|
-
|
|
1617
|
+
Tt.displayName = "Group";
|
|
1588
1618
|
function fe(e, t) {
|
|
1589
1619
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1590
1620
|
}
|
|
1591
|
-
function
|
|
1621
|
+
function Vt({
|
|
1592
1622
|
debounceSaveMs: e = 100,
|
|
1593
1623
|
panelIds: t,
|
|
1594
1624
|
storage: n = localStorage,
|
|
1595
1625
|
...o
|
|
1596
1626
|
}) {
|
|
1597
|
-
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = fe(r, t ?? []), s =
|
|
1598
|
-
|
|
1627
|
+
const i = t !== void 0, r = "id" in o ? o.id : o.groupId, l = fe(r, t ?? []), s = rt(
|
|
1628
|
+
Ot,
|
|
1599
1629
|
() => n.getItem(l),
|
|
1600
1630
|
() => n.getItem(l)
|
|
1601
|
-
), a =
|
|
1631
|
+
), a = Ne(
|
|
1602
1632
|
() => s ? JSON.parse(s) : void 0,
|
|
1603
1633
|
[s]
|
|
1604
|
-
), u =
|
|
1605
|
-
const
|
|
1606
|
-
|
|
1634
|
+
), u = G(null), c = Z(() => {
|
|
1635
|
+
const h = u.current;
|
|
1636
|
+
h && (u.current = null, clearTimeout(h));
|
|
1607
1637
|
}, []);
|
|
1608
|
-
|
|
1638
|
+
Oe(() => () => {
|
|
1609
1639
|
c();
|
|
1610
1640
|
}, [c]);
|
|
1611
|
-
const
|
|
1612
|
-
(
|
|
1641
|
+
const m = Z(
|
|
1642
|
+
(h) => {
|
|
1613
1643
|
c();
|
|
1614
1644
|
let f;
|
|
1615
|
-
i ? f = fe(r, Object.keys(
|
|
1645
|
+
i ? f = fe(r, Object.keys(h)) : f = fe(r, []);
|
|
1616
1646
|
try {
|
|
1617
|
-
n.setItem(f, JSON.stringify(
|
|
1647
|
+
n.setItem(f, JSON.stringify(h));
|
|
1618
1648
|
} catch (d) {
|
|
1619
1649
|
console.error(d);
|
|
1620
1650
|
}
|
|
1621
1651
|
},
|
|
1622
1652
|
[c, i, r, n]
|
|
1623
|
-
), y =
|
|
1624
|
-
(
|
|
1625
|
-
c(), e === 0 ? h
|
|
1626
|
-
h
|
|
1653
|
+
), y = Z(
|
|
1654
|
+
(h) => {
|
|
1655
|
+
c(), e === 0 ? m(h) : u.current = setTimeout(() => {
|
|
1656
|
+
m(h);
|
|
1627
1657
|
}, e);
|
|
1628
1658
|
},
|
|
1629
|
-
[c, e,
|
|
1659
|
+
[c, e, m]
|
|
1630
1660
|
);
|
|
1631
1661
|
return {
|
|
1632
1662
|
/**
|
|
@@ -1642,28 +1672,28 @@ function jt({
|
|
|
1642
1672
|
/**
|
|
1643
1673
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1644
1674
|
*/
|
|
1645
|
-
onLayoutChanged:
|
|
1675
|
+
onLayoutChanged: m
|
|
1646
1676
|
};
|
|
1647
1677
|
}
|
|
1648
|
-
function
|
|
1678
|
+
function Ot() {
|
|
1649
1679
|
return function() {
|
|
1650
1680
|
};
|
|
1651
1681
|
}
|
|
1652
|
-
function Vt() {
|
|
1653
|
-
return Q(null);
|
|
1654
|
-
}
|
|
1655
1682
|
function Ut() {
|
|
1656
|
-
return
|
|
1683
|
+
return ee(null);
|
|
1684
|
+
}
|
|
1685
|
+
function Wt() {
|
|
1686
|
+
return G(null);
|
|
1657
1687
|
}
|
|
1658
1688
|
function ye() {
|
|
1659
|
-
const e =
|
|
1689
|
+
const e = st(Je);
|
|
1660
1690
|
return z(
|
|
1661
1691
|
e,
|
|
1662
1692
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1663
1693
|
), e;
|
|
1664
1694
|
}
|
|
1665
|
-
function
|
|
1666
|
-
const { id: n } = ye(), o =
|
|
1695
|
+
function At(e, t) {
|
|
1696
|
+
const { id: n } = ye(), o = G({
|
|
1667
1697
|
collapse: ce,
|
|
1668
1698
|
expand: ce,
|
|
1669
1699
|
getSize: () => ({
|
|
@@ -1673,14 +1703,14 @@ function Ot(e, t) {
|
|
|
1673
1703
|
isCollapsed: () => !1,
|
|
1674
1704
|
resize: ce
|
|
1675
1705
|
});
|
|
1676
|
-
|
|
1706
|
+
_e(t, () => o.current, []), j(() => {
|
|
1677
1707
|
Object.assign(
|
|
1678
1708
|
o.current,
|
|
1679
|
-
|
|
1709
|
+
Ve({ groupId: n, panelId: e })
|
|
1680
1710
|
);
|
|
1681
1711
|
});
|
|
1682
1712
|
}
|
|
1683
|
-
function
|
|
1713
|
+
function _t({
|
|
1684
1714
|
children: e,
|
|
1685
1715
|
className: t,
|
|
1686
1716
|
collapsedSize: n = "0%",
|
|
@@ -1692,21 +1722,21 @@ function At({
|
|
|
1692
1722
|
minSize: a = "0%",
|
|
1693
1723
|
onResize: u,
|
|
1694
1724
|
panelRef: c,
|
|
1695
|
-
style:
|
|
1725
|
+
style: m,
|
|
1696
1726
|
...y
|
|
1697
1727
|
}) {
|
|
1698
|
-
const
|
|
1699
|
-
(T,
|
|
1700
|
-
u?.(T, l,
|
|
1728
|
+
const h = !!l, f = me(l), d = G(null), p = ge(d, r), [, g] = Ze(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C = J(
|
|
1729
|
+
(T, V, A) => {
|
|
1730
|
+
u?.(T, l, A);
|
|
1701
1731
|
}
|
|
1702
1732
|
);
|
|
1703
|
-
|
|
1733
|
+
j(() => {
|
|
1704
1734
|
const T = d.current;
|
|
1705
1735
|
if (T !== null)
|
|
1706
1736
|
return S({
|
|
1707
1737
|
element: T,
|
|
1708
1738
|
id: f,
|
|
1709
|
-
idIsStable:
|
|
1739
|
+
idIsStable: h,
|
|
1710
1740
|
mutableValues: {
|
|
1711
1741
|
expandToSize: void 0,
|
|
1712
1742
|
prevSize: void 0
|
|
@@ -1728,14 +1758,14 @@ function At({
|
|
|
1728
1758
|
g,
|
|
1729
1759
|
w,
|
|
1730
1760
|
f,
|
|
1731
|
-
|
|
1761
|
+
h,
|
|
1732
1762
|
s,
|
|
1733
1763
|
a,
|
|
1734
1764
|
C,
|
|
1735
1765
|
S
|
|
1736
|
-
]),
|
|
1766
|
+
]), At(f, c);
|
|
1737
1767
|
const P = v(x, f);
|
|
1738
|
-
return /* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ Q(
|
|
1739
1769
|
"div",
|
|
1740
1770
|
{
|
|
1741
1771
|
...y,
|
|
@@ -1744,7 +1774,7 @@ function At({
|
|
|
1744
1774
|
id: f,
|
|
1745
1775
|
ref: p,
|
|
1746
1776
|
style: {
|
|
1747
|
-
...
|
|
1777
|
+
...Nt,
|
|
1748
1778
|
display: "flex",
|
|
1749
1779
|
flexBasis: 0,
|
|
1750
1780
|
flexShrink: 1,
|
|
@@ -1752,7 +1782,7 @@ function At({
|
|
|
1752
1782
|
overflow: "hidden",
|
|
1753
1783
|
...P
|
|
1754
1784
|
},
|
|
1755
|
-
children: /* @__PURE__ */
|
|
1785
|
+
children: /* @__PURE__ */ Q(
|
|
1756
1786
|
"div",
|
|
1757
1787
|
{
|
|
1758
1788
|
className: t,
|
|
@@ -1760,7 +1790,7 @@ function At({
|
|
|
1760
1790
|
maxHeight: "100%",
|
|
1761
1791
|
maxWidth: "100%",
|
|
1762
1792
|
flexGrow: 1,
|
|
1763
|
-
...
|
|
1793
|
+
...m
|
|
1764
1794
|
},
|
|
1765
1795
|
children: e
|
|
1766
1796
|
}
|
|
@@ -1768,8 +1798,8 @@ function At({
|
|
|
1768
1798
|
}
|
|
1769
1799
|
);
|
|
1770
1800
|
}
|
|
1771
|
-
|
|
1772
|
-
const
|
|
1801
|
+
_t.displayName = "Panel";
|
|
1802
|
+
const Nt = {
|
|
1773
1803
|
minHeight: 0,
|
|
1774
1804
|
maxHeight: "100%",
|
|
1775
1805
|
height: "auto",
|
|
@@ -1781,13 +1811,13 @@ const _t = {
|
|
|
1781
1811
|
padding: 0,
|
|
1782
1812
|
margin: 0
|
|
1783
1813
|
};
|
|
1784
|
-
function Wt() {
|
|
1785
|
-
return Q(null);
|
|
1786
|
-
}
|
|
1787
1814
|
function Bt() {
|
|
1788
|
-
return
|
|
1815
|
+
return ee(null);
|
|
1816
|
+
}
|
|
1817
|
+
function Kt() {
|
|
1818
|
+
return G(null);
|
|
1789
1819
|
}
|
|
1790
|
-
function
|
|
1820
|
+
function Ft({
|
|
1791
1821
|
layout: e,
|
|
1792
1822
|
panelConstraints: t,
|
|
1793
1823
|
panelId: n,
|
|
@@ -1799,7 +1829,7 @@ function Nt({
|
|
|
1799
1829
|
);
|
|
1800
1830
|
if (s) {
|
|
1801
1831
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1802
|
-
r =
|
|
1832
|
+
r = H({
|
|
1803
1833
|
layout: te({
|
|
1804
1834
|
delta: u - l,
|
|
1805
1835
|
initialLayout: e,
|
|
@@ -1808,7 +1838,7 @@ function Nt({
|
|
|
1808
1838
|
prevLayout: e
|
|
1809
1839
|
}),
|
|
1810
1840
|
panelConstraints: t
|
|
1811
|
-
})[n], i =
|
|
1841
|
+
})[n], i = H({
|
|
1812
1842
|
layout: te({
|
|
1813
1843
|
delta: a - l,
|
|
1814
1844
|
initialLayout: e,
|
|
@@ -1826,7 +1856,7 @@ function Nt({
|
|
|
1826
1856
|
valueNow: l
|
|
1827
1857
|
};
|
|
1828
1858
|
}
|
|
1829
|
-
function
|
|
1859
|
+
function $t({
|
|
1830
1860
|
children: e,
|
|
1831
1861
|
className: t,
|
|
1832
1862
|
elementRef: n,
|
|
@@ -1834,18 +1864,18 @@ function Ft({
|
|
|
1834
1864
|
style: i,
|
|
1835
1865
|
...r
|
|
1836
1866
|
}) {
|
|
1837
|
-
const l = me(o), [s, a] =
|
|
1838
|
-
id:
|
|
1867
|
+
const l = me(o), [s, a] = ee({}), [u, c] = ee("inactive"), m = G(null), y = ge(m, n), {
|
|
1868
|
+
id: h,
|
|
1839
1869
|
orientation: f,
|
|
1840
1870
|
registerSeparator: d
|
|
1841
1871
|
} = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1842
|
-
return
|
|
1843
|
-
const g =
|
|
1872
|
+
return j(() => {
|
|
1873
|
+
const g = m.current;
|
|
1844
1874
|
if (g !== null) {
|
|
1845
1875
|
const v = {
|
|
1846
1876
|
element: g,
|
|
1847
1877
|
id: l
|
|
1848
|
-
}, x = d(v), S =
|
|
1878
|
+
}, x = d(v), S = F.addListener(
|
|
1849
1879
|
"interactionStateChange",
|
|
1850
1880
|
(C) => {
|
|
1851
1881
|
c(
|
|
@@ -1854,21 +1884,21 @@ function Ft({
|
|
|
1854
1884
|
) ? C.state : "inactive"
|
|
1855
1885
|
);
|
|
1856
1886
|
}
|
|
1857
|
-
), w =
|
|
1887
|
+
), w = F.addListener(
|
|
1858
1888
|
"mountedGroupsChange",
|
|
1859
1889
|
(C) => {
|
|
1860
1890
|
C.forEach(
|
|
1861
|
-
({ derivedPanelConstraints: P, layout: T, separatorToPanels:
|
|
1862
|
-
if (
|
|
1863
|
-
const b =
|
|
1891
|
+
({ derivedPanelConstraints: P, layout: T, separatorToPanels: V }, A) => {
|
|
1892
|
+
if (A.id === h) {
|
|
1893
|
+
const b = V.get(v);
|
|
1864
1894
|
if (b) {
|
|
1865
|
-
const L = b[0],
|
|
1895
|
+
const L = b[0], k = A.panels.indexOf(L);
|
|
1866
1896
|
a(
|
|
1867
|
-
|
|
1897
|
+
Ft({
|
|
1868
1898
|
layout: T,
|
|
1869
1899
|
panelConstraints: P,
|
|
1870
1900
|
panelId: L.id,
|
|
1871
|
-
panelIndex:
|
|
1901
|
+
panelIndex: k
|
|
1872
1902
|
})
|
|
1873
1903
|
);
|
|
1874
1904
|
}
|
|
@@ -1881,7 +1911,7 @@ function Ft({
|
|
|
1881
1911
|
S(), w(), x();
|
|
1882
1912
|
};
|
|
1883
1913
|
}
|
|
1884
|
-
}, [
|
|
1914
|
+
}, [h, l, d]), /* @__PURE__ */ Q(
|
|
1885
1915
|
"div",
|
|
1886
1916
|
{
|
|
1887
1917
|
...r,
|
|
@@ -1907,16 +1937,16 @@ function Ft({
|
|
|
1907
1937
|
}
|
|
1908
1938
|
);
|
|
1909
1939
|
}
|
|
1910
|
-
|
|
1940
|
+
$t.displayName = "Separator";
|
|
1911
1941
|
export {
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1942
|
+
Tt as Group,
|
|
1943
|
+
_t as Panel,
|
|
1944
|
+
$t as Separator,
|
|
1945
|
+
ct as isCoarsePointer,
|
|
1946
|
+
Vt as useDefaultLayout,
|
|
1947
|
+
Ut as useGroupCallbackRef,
|
|
1948
|
+
Wt as useGroupRef,
|
|
1949
|
+
Bt as usePanelCallbackRef,
|
|
1950
|
+
Kt as usePanelRef
|
|
1921
1951
|
};
|
|
1922
1952
|
//# sourceMappingURL=react-resizable-panels.js.map
|