react-resizable-panels 4.0.8 → 4.0.9-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as B } from "react/jsx-runtime";
|
|
3
|
-
import { useId as
|
|
4
|
-
function
|
|
3
|
+
import { useId as We, useLayoutEffect as je, useEffect as Be, useRef as T, useCallback as Le, createContext as Ue, useImperativeHandle as Pe, useState as I, useMemo as Ce, useSyncExternalStore as Ve, useContext as Ke } from "react";
|
|
4
|
+
function x(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
@@ -11,21 +11,21 @@ function H({
|
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
12
12
|
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function se(e, t) {
|
|
15
15
|
return t.sort(
|
|
16
|
-
e === "horizontal" ?
|
|
16
|
+
e === "horizontal" ? Xe : Ye
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Xe(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 Ye(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
|
|
28
|
-
const { element: t, orientation: n, panels: o, separators: r } = e, a =
|
|
27
|
+
function Re(e) {
|
|
28
|
+
const { element: t, orientation: n, panels: o, separators: r } = e, a = se(
|
|
29
29
|
n,
|
|
30
30
|
Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
|
|
31
31
|
).map(({ element: l }) => l), u = [];
|
|
@@ -36,7 +36,7 @@ function we(e) {
|
|
|
36
36
|
);
|
|
37
37
|
if (c) {
|
|
38
38
|
if (i) {
|
|
39
|
-
const d = i.element.getBoundingClientRect(),
|
|
39
|
+
const d = i.element.getBoundingClientRect(), z = l.getBoundingClientRect();
|
|
40
40
|
u.push({
|
|
41
41
|
group: e,
|
|
42
42
|
groupSize: H({ group: e }),
|
|
@@ -44,42 +44,42 @@ function we(e) {
|
|
|
44
44
|
separator: s,
|
|
45
45
|
rect: n === "horizontal" ? new DOMRect(
|
|
46
46
|
d.right,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
z.top,
|
|
48
|
+
z.left - d.right,
|
|
49
|
+
z.height
|
|
50
50
|
) : new DOMRect(
|
|
51
|
-
|
|
51
|
+
z.left,
|
|
52
52
|
d.bottom,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
z.width,
|
|
54
|
+
z.top - d.bottom
|
|
55
55
|
)
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
i = c, s = void 0;
|
|
59
59
|
} else {
|
|
60
60
|
const d = r.find(
|
|
61
|
-
(
|
|
61
|
+
(z) => z.element === l
|
|
62
62
|
);
|
|
63
63
|
d ? s = d : (i = void 0, s = void 0);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
return u;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function qe(e, t) {
|
|
69
69
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
70
70
|
return t * o;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Ze(e, t) {
|
|
73
73
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
74
74
|
return t * o;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Je(e) {
|
|
77
77
|
return e / 100 * window.innerHeight;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Qe(e) {
|
|
80
80
|
return e / 100 * window.innerWidth;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function et(e) {
|
|
83
83
|
switch (typeof e) {
|
|
84
84
|
case "number":
|
|
85
85
|
return [e, "px"];
|
|
@@ -95,7 +95,7 @@ function Q({
|
|
|
95
95
|
styleProp: n
|
|
96
96
|
}) {
|
|
97
97
|
let o;
|
|
98
|
-
const [r, a] =
|
|
98
|
+
const [r, a] = et(n);
|
|
99
99
|
switch (a) {
|
|
100
100
|
case "%": {
|
|
101
101
|
o = r / 100 * e;
|
|
@@ -106,25 +106,25 @@ function Q({
|
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
case "rem": {
|
|
109
|
-
o =
|
|
109
|
+
o = Ze(t, r);
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
case "em": {
|
|
113
|
-
o =
|
|
113
|
+
o = qe(t, r);
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
case "vh": {
|
|
117
|
-
o =
|
|
117
|
+
o = Je(r);
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
120
|
case "vw": {
|
|
121
|
-
o =
|
|
121
|
+
o = Qe(r);
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
return o;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function G(e) {
|
|
128
128
|
return parseFloat(e.toFixed(3));
|
|
129
129
|
}
|
|
130
130
|
function pe(e) {
|
|
@@ -145,7 +145,7 @@ function pe(e) {
|
|
|
145
145
|
panelElement: r,
|
|
146
146
|
styleProp: a.collapsedSize
|
|
147
147
|
});
|
|
148
|
-
u =
|
|
148
|
+
u = G(c / n * 100);
|
|
149
149
|
}
|
|
150
150
|
let i;
|
|
151
151
|
if (a.defaultSize) {
|
|
@@ -154,7 +154,7 @@ function pe(e) {
|
|
|
154
154
|
panelElement: r,
|
|
155
155
|
styleProp: a.defaultSize
|
|
156
156
|
});
|
|
157
|
-
i =
|
|
157
|
+
i = G(c / n * 100);
|
|
158
158
|
}
|
|
159
159
|
let s = 0;
|
|
160
160
|
if (a.minSize) {
|
|
@@ -163,7 +163,7 @@ function pe(e) {
|
|
|
163
163
|
panelElement: r,
|
|
164
164
|
styleProp: a.minSize
|
|
165
165
|
});
|
|
166
|
-
s =
|
|
166
|
+
s = G(c / n * 100);
|
|
167
167
|
}
|
|
168
168
|
let l = 100;
|
|
169
169
|
if (a.maxSize) {
|
|
@@ -172,7 +172,7 @@ function pe(e) {
|
|
|
172
172
|
panelElement: r,
|
|
173
173
|
styleProp: a.maxSize
|
|
174
174
|
});
|
|
175
|
-
l =
|
|
175
|
+
l = G(c / n * 100);
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
178
178
|
collapsedSize: u,
|
|
@@ -184,7 +184,7 @@ function pe(e) {
|
|
|
184
184
|
};
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
class
|
|
187
|
+
class tt {
|
|
188
188
|
#e = {};
|
|
189
189
|
addListener(t, n) {
|
|
190
190
|
const o = this.#e[t];
|
|
@@ -224,7 +224,7 @@ class Ze {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
function P(e, t, n = 0) {
|
|
227
|
-
return Math.abs(
|
|
227
|
+
return Math.abs(G(e) - G(t)) <= n;
|
|
228
228
|
}
|
|
229
229
|
let R = {
|
|
230
230
|
cursorFlags: 0,
|
|
@@ -233,11 +233,11 @@ let R = {
|
|
|
233
233
|
},
|
|
234
234
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
235
235
|
};
|
|
236
|
-
const
|
|
236
|
+
const D = new tt();
|
|
237
237
|
function O() {
|
|
238
238
|
return R;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function E(e) {
|
|
241
241
|
const t = typeof e == "function" ? e(R) : e;
|
|
242
242
|
if (R === t)
|
|
243
243
|
return R;
|
|
@@ -245,7 +245,7 @@ function C(e) {
|
|
|
245
245
|
return R = {
|
|
246
246
|
...R,
|
|
247
247
|
...t
|
|
248
|
-
}, t.cursorFlags !== void 0 &&
|
|
248
|
+
}, t.cursorFlags !== void 0 && D.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && D.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, r) => {
|
|
249
249
|
o.derivedPanelConstraints.forEach((a) => {
|
|
250
250
|
if (a.collapsible) {
|
|
251
251
|
const { layout: u } = n.mountedGroups.get(r) ?? {};
|
|
@@ -261,14 +261,14 @@ function C(e) {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
|
-
}),
|
|
264
|
+
}), D.emit("mountedGroupsChange", R.mountedGroups)), R;
|
|
265
265
|
}
|
|
266
|
-
const
|
|
267
|
-
},
|
|
266
|
+
const nt = (e) => e, ie = () => {
|
|
267
|
+
}, Ee = 1, Me = 2, Ie = 4, Ge = 8, me = {
|
|
268
268
|
coarse: 10,
|
|
269
269
|
precise: 5
|
|
270
270
|
};
|
|
271
|
-
function
|
|
271
|
+
function ot({
|
|
272
272
|
cursorFlags: e,
|
|
273
273
|
groups: t,
|
|
274
274
|
state: n
|
|
@@ -295,7 +295,7 @@ function Qe({
|
|
|
295
295
|
return null;
|
|
296
296
|
switch (n) {
|
|
297
297
|
case "active": {
|
|
298
|
-
const a = (e &
|
|
298
|
+
const a = (e & Ee) !== 0, u = (e & Me) !== 0, i = (e & Ie) !== 0, s = (e & Ge) !== 0;
|
|
299
299
|
if (e) {
|
|
300
300
|
if (a)
|
|
301
301
|
return i ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
@@ -311,30 +311,30 @@ function Qe({
|
|
|
311
311
|
}
|
|
312
312
|
return o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize";
|
|
313
313
|
}
|
|
314
|
-
let
|
|
314
|
+
let re, k;
|
|
315
315
|
function le() {
|
|
316
316
|
k === void 0 && (k = new CSSStyleSheet(), document.adoptedStyleSheets = [k]);
|
|
317
317
|
const { cursorFlags: e, interactionState: t } = O();
|
|
318
318
|
switch (t.state) {
|
|
319
319
|
case "active":
|
|
320
320
|
case "hover": {
|
|
321
|
-
const n =
|
|
321
|
+
const n = ot({
|
|
322
322
|
cursorFlags: e,
|
|
323
323
|
groups: t.hitRegions.map((r) => r.group),
|
|
324
324
|
state: t.state
|
|
325
325
|
}), o = `*{cursor: ${n} !important; ${t.state === "active" ? "touch-action: none;" : ""} }`;
|
|
326
|
-
if (
|
|
326
|
+
if (re === o)
|
|
327
327
|
return;
|
|
328
|
-
|
|
328
|
+
re = o, n ? k.cssRules.length === 0 ? k.insertRule(o) : k.replaceSync(o) : k.cssRules.length === 1 && k.deleteRule(0);
|
|
329
329
|
break;
|
|
330
330
|
}
|
|
331
331
|
case "inactive": {
|
|
332
|
-
|
|
332
|
+
re = void 0, k.cssRules.length === 1 && k.deleteRule(0);
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function it(e, t) {
|
|
338
338
|
if (e.length !== t.length)
|
|
339
339
|
return !1;
|
|
340
340
|
for (let n = 0; n < e.length; n++)
|
|
@@ -361,9 +361,9 @@ function F({
|
|
|
361
361
|
U(t, u) < 0 ? t = n : t = a;
|
|
362
362
|
} else
|
|
363
363
|
t = a;
|
|
364
|
-
return t = Math.min(r, t), t =
|
|
364
|
+
return t = Math.min(r, t), t = G(t), t;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function V({
|
|
367
367
|
delta: e,
|
|
368
368
|
initialLayout: t,
|
|
369
369
|
panelConstraints: n,
|
|
@@ -374,50 +374,50 @@ function K({
|
|
|
374
374
|
if (P(e, 0))
|
|
375
375
|
return t;
|
|
376
376
|
const u = Object.values(t), i = Object.values(r), s = [...u], [l, c] = o;
|
|
377
|
-
|
|
377
|
+
x(l != null, "Invalid first pivot index"), x(c != null, "Invalid second pivot index");
|
|
378
378
|
let d = 0;
|
|
379
379
|
if (a === "keyboard") {
|
|
380
380
|
{
|
|
381
381
|
const f = e < 0 ? c : l, p = n[f];
|
|
382
|
-
|
|
382
|
+
x(
|
|
383
383
|
p,
|
|
384
384
|
`Panel constraints not found for index ${f}`
|
|
385
385
|
);
|
|
386
386
|
const {
|
|
387
387
|
collapsedSize: h = 0,
|
|
388
|
-
collapsible:
|
|
388
|
+
collapsible: y,
|
|
389
389
|
minSize: S = 0
|
|
390
390
|
} = p;
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
|
|
391
|
+
if (y) {
|
|
392
|
+
const v = u[f];
|
|
393
|
+
if (x(
|
|
394
|
+
v != null,
|
|
395
395
|
`Previous layout not found for panel index ${f}`
|
|
396
|
-
), P(
|
|
397
|
-
const
|
|
398
|
-
U(
|
|
396
|
+
), P(v, h)) {
|
|
397
|
+
const g = S - v;
|
|
398
|
+
U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
{
|
|
403
403
|
const f = e < 0 ? l : c, p = n[f];
|
|
404
|
-
|
|
404
|
+
x(
|
|
405
405
|
p,
|
|
406
406
|
`No panel constraints found for index ${f}`
|
|
407
407
|
);
|
|
408
408
|
const {
|
|
409
409
|
collapsedSize: h = 0,
|
|
410
|
-
collapsible:
|
|
410
|
+
collapsible: y,
|
|
411
411
|
minSize: S = 0
|
|
412
412
|
} = p;
|
|
413
|
-
if (
|
|
414
|
-
const
|
|
415
|
-
if (
|
|
416
|
-
|
|
413
|
+
if (y) {
|
|
414
|
+
const v = u[f];
|
|
415
|
+
if (x(
|
|
416
|
+
v != null,
|
|
417
417
|
`Previous layout not found for panel index ${f}`
|
|
418
|
-
), P(
|
|
419
|
-
const
|
|
420
|
-
U(
|
|
418
|
+
), P(v, S)) {
|
|
419
|
+
const g = v - h;
|
|
420
|
+
U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}
|
|
@@ -427,74 +427,74 @@ function K({
|
|
|
427
427
|
let p = e < 0 ? c : l, h = 0;
|
|
428
428
|
for (; ; ) {
|
|
429
429
|
const S = u[p];
|
|
430
|
-
|
|
430
|
+
x(
|
|
431
431
|
S != null,
|
|
432
432
|
`Previous layout not found for panel index ${p}`
|
|
433
433
|
);
|
|
434
|
-
const
|
|
434
|
+
const g = F({
|
|
435
435
|
panelConstraints: n[p],
|
|
436
436
|
size: 100
|
|
437
437
|
}) - S;
|
|
438
|
-
if (h +=
|
|
438
|
+
if (h += g, p += f, p < 0 || p >= n.length)
|
|
439
439
|
break;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
e = e < 0 ? 0 -
|
|
441
|
+
const y = Math.min(Math.abs(e), Math.abs(h));
|
|
442
|
+
e = e < 0 ? 0 - y : y;
|
|
443
443
|
}
|
|
444
444
|
{
|
|
445
445
|
let p = e < 0 ? l : c;
|
|
446
446
|
for (; p >= 0 && p < n.length; ) {
|
|
447
|
-
const h = Math.abs(e) - Math.abs(d),
|
|
448
|
-
|
|
449
|
-
|
|
447
|
+
const h = Math.abs(e) - Math.abs(d), y = u[p];
|
|
448
|
+
x(
|
|
449
|
+
y != null,
|
|
450
450
|
`Previous layout not found for panel index ${p}`
|
|
451
451
|
);
|
|
452
|
-
const S =
|
|
452
|
+
const S = y - h, v = F({
|
|
453
453
|
panelConstraints: n[p],
|
|
454
454
|
size: S
|
|
455
455
|
});
|
|
456
|
-
if (!P(
|
|
456
|
+
if (!P(y, v) && (d += y - v, s[p] = v, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
457
457
|
numeric: !0
|
|
458
458
|
}) >= 0))
|
|
459
459
|
break;
|
|
460
460
|
e < 0 ? p-- : p++;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
if (
|
|
463
|
+
if (it(i, s))
|
|
464
464
|
return r;
|
|
465
465
|
{
|
|
466
466
|
const f = e < 0 ? c : l, p = u[f];
|
|
467
|
-
|
|
467
|
+
x(
|
|
468
468
|
p != null,
|
|
469
469
|
`Previous layout not found for panel index ${f}`
|
|
470
470
|
);
|
|
471
|
-
const h = p + d,
|
|
471
|
+
const h = p + d, y = F({
|
|
472
472
|
panelConstraints: n[f],
|
|
473
473
|
size: h
|
|
474
474
|
});
|
|
475
|
-
if (s[f] =
|
|
476
|
-
let S = h -
|
|
477
|
-
for (;
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
`Previous layout not found for panel index ${
|
|
475
|
+
if (s[f] = y, !P(y, h)) {
|
|
476
|
+
let S = h - y, g = e < 0 ? c : l;
|
|
477
|
+
for (; g >= 0 && g < n.length; ) {
|
|
478
|
+
const w = s[g];
|
|
479
|
+
x(
|
|
480
|
+
w != null,
|
|
481
|
+
`Previous layout not found for panel index ${g}`
|
|
482
482
|
);
|
|
483
|
-
const
|
|
484
|
-
panelConstraints: n[
|
|
485
|
-
size:
|
|
483
|
+
const L = w + S, C = F({
|
|
484
|
+
panelConstraints: n[g],
|
|
485
|
+
size: L
|
|
486
486
|
});
|
|
487
|
-
if (P(
|
|
487
|
+
if (P(w, C) || (S -= C - w, s[g] = C), P(S, 0))
|
|
488
488
|
break;
|
|
489
|
-
e > 0 ?
|
|
489
|
+
e > 0 ? g-- : g++;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
const
|
|
493
|
+
const z = Object.values(s).reduce(
|
|
494
494
|
(f, p) => p + f,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
|
-
if (!P(
|
|
497
|
+
if (!P(z, 100, 0.1))
|
|
498
498
|
return r;
|
|
499
499
|
const m = Object.keys(r);
|
|
500
500
|
return s.reduce((f, p, h) => (f[m[h]] = p, f), {});
|
|
@@ -507,7 +507,7 @@ function W(e, t) {
|
|
|
507
507
|
return !1;
|
|
508
508
|
return !0;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function ke({
|
|
511
511
|
event: e,
|
|
512
512
|
hitRegions: t,
|
|
513
513
|
initialLayoutMap: n,
|
|
@@ -517,20 +517,20 @@ function Me({
|
|
|
517
517
|
let a = 0;
|
|
518
518
|
const u = new Map(o);
|
|
519
519
|
t.forEach((i) => {
|
|
520
|
-
const { group: s, groupSize: l } = i, { disableCursor: c, orientation: d, panels:
|
|
520
|
+
const { group: s, groupSize: l } = i, { disableCursor: c, orientation: d, panels: z } = s;
|
|
521
521
|
let m = 0;
|
|
522
522
|
r ? d === "horizontal" ? m = (e.clientX - r.x) / l * 100 : m = (e.clientY - r.y) / l * 100 : d === "horizontal" ? m = e.clientX < 0 ? -100 : 100 : m = e.clientY < 0 ? -100 : 100;
|
|
523
523
|
const f = n.get(s), {
|
|
524
524
|
derivedPanelConstraints: p,
|
|
525
525
|
layout: h,
|
|
526
|
-
separatorToPanels:
|
|
526
|
+
separatorToPanels: y
|
|
527
527
|
} = o.get(s) ?? {};
|
|
528
|
-
if (p && f && h &&
|
|
529
|
-
const S =
|
|
528
|
+
if (p && f && h && y) {
|
|
529
|
+
const S = V({
|
|
530
530
|
delta: m,
|
|
531
531
|
initialLayout: f,
|
|
532
532
|
panelConstraints: p,
|
|
533
|
-
pivotIndices: i.panels.map((
|
|
533
|
+
pivotIndices: i.panels.map((v) => z.indexOf(v)),
|
|
534
534
|
prevLayout: h,
|
|
535
535
|
trigger: "mouse-or-touch"
|
|
536
536
|
});
|
|
@@ -538,11 +538,11 @@ function Me({
|
|
|
538
538
|
if (m !== 0 && !c)
|
|
539
539
|
switch (d) {
|
|
540
540
|
case "horizontal": {
|
|
541
|
-
a |= m < 0 ?
|
|
541
|
+
a |= m < 0 ? Ee : Me;
|
|
542
542
|
break;
|
|
543
543
|
}
|
|
544
544
|
case "vertical": {
|
|
545
|
-
a |= m < 0 ?
|
|
545
|
+
a |= m < 0 ? Ie : Ge;
|
|
546
546
|
break;
|
|
547
547
|
}
|
|
548
548
|
}
|
|
@@ -550,13 +550,13 @@ function Me({
|
|
|
550
550
|
u.set(i.group, {
|
|
551
551
|
derivedPanelConstraints: p,
|
|
552
552
|
layout: S,
|
|
553
|
-
separatorToPanels:
|
|
553
|
+
separatorToPanels: y
|
|
554
554
|
});
|
|
555
|
-
const
|
|
556
|
-
i.group.inMemoryLayouts[
|
|
555
|
+
const v = i.group.panels.map(({ id: g }) => g).join(",");
|
|
556
|
+
i.group.inMemoryLayouts[v] = S;
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
}),
|
|
559
|
+
}), E({
|
|
560
560
|
cursorFlags: a,
|
|
561
561
|
mountedGroups: u
|
|
562
562
|
}), le();
|
|
@@ -572,7 +572,7 @@ function he(e) {
|
|
|
572
572
|
switch (t.state) {
|
|
573
573
|
case "active":
|
|
574
574
|
t.hitRegions.forEach((o) => {
|
|
575
|
-
e.currentTarget === o.group.element &&
|
|
575
|
+
e.currentTarget === o.group.element && ke({
|
|
576
576
|
event: e,
|
|
577
577
|
hitRegions: t.hitRegions,
|
|
578
578
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -583,14 +583,14 @@ function he(e) {
|
|
|
583
583
|
}
|
|
584
584
|
function te(e) {
|
|
585
585
|
const t = e.parentElement;
|
|
586
|
-
|
|
586
|
+
x(t, "Parent group element not found");
|
|
587
587
|
const { mountedGroups: n } = O();
|
|
588
588
|
for (const [o] of n)
|
|
589
589
|
if (o.element === t)
|
|
590
590
|
return o;
|
|
591
591
|
throw Error("Could not find parent Group for separator element");
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function A({
|
|
594
594
|
layout: e,
|
|
595
595
|
panelConstraints: t
|
|
596
596
|
}) {
|
|
@@ -605,14 +605,14 @@ function $({
|
|
|
605
605
|
if (!P(r, 100) && o.length > 0)
|
|
606
606
|
for (let i = 0; i < t.length; i++) {
|
|
607
607
|
const s = o[i];
|
|
608
|
-
|
|
608
|
+
x(s != null, `No layout data found for index ${i}`);
|
|
609
609
|
const l = 100 / r * s;
|
|
610
610
|
o[i] = l;
|
|
611
611
|
}
|
|
612
612
|
let a = 0;
|
|
613
613
|
for (let i = 0; i < t.length; i++) {
|
|
614
614
|
const s = o[i];
|
|
615
|
-
|
|
615
|
+
x(s != null, `No layout data found for index ${i}`);
|
|
616
616
|
const l = F({
|
|
617
617
|
panelConstraints: t[i],
|
|
618
618
|
size: s
|
|
@@ -622,7 +622,7 @@ function $({
|
|
|
622
622
|
if (!P(a, 0))
|
|
623
623
|
for (let i = 0; i < t.length; i++) {
|
|
624
624
|
const s = o[i];
|
|
625
|
-
|
|
625
|
+
x(s != null, `No layout data found for index ${i}`);
|
|
626
626
|
const l = s + a, c = F({
|
|
627
627
|
panelConstraints: t[i],
|
|
628
628
|
size: l
|
|
@@ -633,7 +633,7 @@ function $({
|
|
|
633
633
|
const u = Object.keys(e);
|
|
634
634
|
return o.reduce((i, s, l) => (i[u[l]] = s, i), {});
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function Oe({
|
|
637
637
|
groupId: e
|
|
638
638
|
}) {
|
|
639
639
|
const t = () => {
|
|
@@ -654,11 +654,11 @@ function Ge({
|
|
|
654
654
|
group: r,
|
|
655
655
|
layout: a,
|
|
656
656
|
separatorToPanels: u
|
|
657
|
-
} = t(), i =
|
|
657
|
+
} = t(), i = A({
|
|
658
658
|
layout: n,
|
|
659
659
|
panelConstraints: o
|
|
660
660
|
});
|
|
661
|
-
return W(a, i) ||
|
|
661
|
+
return W(a, i) || E((s) => ({
|
|
662
662
|
mountedGroups: new Map(s.mountedGroups).set(r, {
|
|
663
663
|
derivedPanelConstraints: o,
|
|
664
664
|
layout: i,
|
|
@@ -668,29 +668,29 @@ function Ge({
|
|
|
668
668
|
}
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function Te(e) {
|
|
672
672
|
const { mountedGroups: t } = O(), n = t.get(e);
|
|
673
|
-
return
|
|
673
|
+
return x(n, `Mounted Group ${e.id} not found`), n;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
676
|
-
const n = te(e), o =
|
|
675
|
+
function _(e, t) {
|
|
676
|
+
const n = te(e), o = Te(n), r = n.separators.find(
|
|
677
677
|
(d) => d.element === e
|
|
678
678
|
);
|
|
679
|
-
|
|
679
|
+
x(r, "Matching separator not found");
|
|
680
680
|
const a = o.separatorToPanels.get(r);
|
|
681
|
-
|
|
682
|
-
const u = a.map((d) => n.panels.indexOf(d)), s =
|
|
681
|
+
x(a, "Matching panels not found");
|
|
682
|
+
const u = a.map((d) => n.panels.indexOf(d)), s = Oe({ groupId: n.id }).getLayout(), l = V({
|
|
683
683
|
delta: t,
|
|
684
684
|
initialLayout: s,
|
|
685
685
|
panelConstraints: o.derivedPanelConstraints,
|
|
686
686
|
pivotIndices: u,
|
|
687
687
|
prevLayout: s,
|
|
688
688
|
trigger: "keyboard"
|
|
689
|
-
}), c =
|
|
689
|
+
}), c = A({
|
|
690
690
|
layout: l,
|
|
691
691
|
panelConstraints: o.derivedPanelConstraints
|
|
692
692
|
});
|
|
693
|
-
W(s, c) ||
|
|
693
|
+
W(s, c) || E((d) => ({
|
|
694
694
|
mountedGroups: new Map(d.mountedGroups).set(n, {
|
|
695
695
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
696
696
|
layout: c,
|
|
@@ -698,46 +698,46 @@ function D(e, t) {
|
|
|
698
698
|
})
|
|
699
699
|
}));
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function ge(e) {
|
|
702
702
|
if (e.defaultPrevented)
|
|
703
703
|
return;
|
|
704
704
|
const t = e.currentTarget, n = te(t);
|
|
705
705
|
if (!n.disabled)
|
|
706
706
|
switch (e.key) {
|
|
707
707
|
case "ArrowDown": {
|
|
708
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
708
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, 5);
|
|
709
709
|
break;
|
|
710
710
|
}
|
|
711
711
|
case "ArrowLeft": {
|
|
712
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
712
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
|
|
713
713
|
break;
|
|
714
714
|
}
|
|
715
715
|
case "ArrowRight": {
|
|
716
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
716
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
|
|
717
717
|
break;
|
|
718
718
|
}
|
|
719
719
|
case "ArrowUp": {
|
|
720
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
720
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, -5);
|
|
721
721
|
break;
|
|
722
722
|
}
|
|
723
723
|
case "End": {
|
|
724
|
-
e.preventDefault(),
|
|
724
|
+
e.preventDefault(), _(t, 100);
|
|
725
725
|
break;
|
|
726
726
|
}
|
|
727
727
|
case "Enter": {
|
|
728
728
|
e.preventDefault();
|
|
729
|
-
const o = te(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: u } =
|
|
729
|
+
const o = te(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: u } = Te(o), i = o.separators.find(
|
|
730
730
|
(d) => d.element === t
|
|
731
731
|
);
|
|
732
|
-
|
|
732
|
+
x(i, "Matching separator not found");
|
|
733
733
|
const s = u.get(i);
|
|
734
|
-
|
|
734
|
+
x(s, "Matching panels not found");
|
|
735
735
|
const l = s[0], c = r.find(
|
|
736
736
|
(d) => d.panelId === l.id
|
|
737
737
|
);
|
|
738
|
-
if (
|
|
739
|
-
const d = a[l.id],
|
|
740
|
-
|
|
738
|
+
if (x(c, "Panel metadata not found"), c.collapsible) {
|
|
739
|
+
const d = a[l.id], z = c.collapsedSize === d ? o.inMemoryLastExpandedPanelSizes[l.id] ?? c.minSize : c.collapsedSize;
|
|
740
|
+
_(t, z - d);
|
|
741
741
|
}
|
|
742
742
|
break;
|
|
743
743
|
}
|
|
@@ -748,18 +748,18 @@ function ve(e) {
|
|
|
748
748
|
), a = Array.from(r).findIndex(
|
|
749
749
|
(s) => s === e.currentTarget
|
|
750
750
|
);
|
|
751
|
-
|
|
751
|
+
x(a !== null, "Index not found");
|
|
752
752
|
const u = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
|
|
753
753
|
r[u].focus();
|
|
754
754
|
break;
|
|
755
755
|
}
|
|
756
756
|
case "Home": {
|
|
757
|
-
e.preventDefault(),
|
|
757
|
+
e.preventDefault(), _(t, -100);
|
|
758
758
|
break;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function rt(e, t) {
|
|
763
763
|
return {
|
|
764
764
|
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
|
|
765
765
|
Math.abs(e.x - t.left),
|
|
@@ -771,13 +771,13 @@ function tt(e, t) {
|
|
|
771
771
|
)
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function st(e, t, n) {
|
|
775
775
|
let o, r = {
|
|
776
776
|
x: 1 / 0,
|
|
777
777
|
y: 1 / 0
|
|
778
778
|
};
|
|
779
779
|
for (const a of t) {
|
|
780
|
-
const u =
|
|
780
|
+
const u = rt(n, a.rect);
|
|
781
781
|
switch (e) {
|
|
782
782
|
case "horizontal": {
|
|
783
783
|
u.x <= r.x && (o = a, r = u);
|
|
@@ -795,25 +795,112 @@ function nt(e, t, n) {
|
|
|
795
795
|
} : void 0;
|
|
796
796
|
}
|
|
797
797
|
let ee;
|
|
798
|
-
function
|
|
798
|
+
function at() {
|
|
799
799
|
return ee === void 0 && (typeof matchMedia == "function" ? ee = !!matchMedia("(pointer:coarse)").matches : ee = !1), ee;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function lt(e, t) {
|
|
802
|
+
if (e === t) throw new Error("Cannot compare node with itself");
|
|
803
|
+
const n = {
|
|
804
|
+
a: Se(e),
|
|
805
|
+
b: Se(t)
|
|
806
|
+
};
|
|
807
|
+
let o;
|
|
808
|
+
for (; n.a.at(-1) === n.b.at(-1); )
|
|
809
|
+
e = n.a.pop(), t = n.b.pop(), o = e;
|
|
810
|
+
x(
|
|
811
|
+
o,
|
|
812
|
+
"Stacking order can only be calculated for elements with a common ancestor"
|
|
813
|
+
);
|
|
814
|
+
const r = {
|
|
815
|
+
a: ve(ye(n.a)),
|
|
816
|
+
b: ve(ye(n.b))
|
|
817
|
+
};
|
|
818
|
+
if (r.a === r.b) {
|
|
819
|
+
const a = o.childNodes, u = {
|
|
820
|
+
a: n.a.at(-1),
|
|
821
|
+
b: n.b.at(-1)
|
|
822
|
+
};
|
|
823
|
+
let i = a.length;
|
|
824
|
+
for (; i--; ) {
|
|
825
|
+
const s = a[i];
|
|
826
|
+
if (s === u.a) return 1;
|
|
827
|
+
if (s === u.b) return -1;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
return Math.sign(r.a - r.b);
|
|
831
|
+
}
|
|
832
|
+
const ut = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
833
|
+
function ct(e) {
|
|
834
|
+
const t = getComputedStyle(_e(e) ?? e).display;
|
|
835
|
+
return t === "flex" || t === "inline-flex";
|
|
836
|
+
}
|
|
837
|
+
function ft(e) {
|
|
838
|
+
const t = getComputedStyle(e);
|
|
839
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ct(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" || ut.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
840
|
+
}
|
|
841
|
+
function ye(e) {
|
|
842
|
+
let t = e.length;
|
|
843
|
+
for (; t--; ) {
|
|
844
|
+
const n = e[t];
|
|
845
|
+
if (x(n, "Missing node"), ft(n)) return n;
|
|
846
|
+
}
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
function ve(e) {
|
|
850
|
+
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
851
|
+
}
|
|
852
|
+
function Se(e) {
|
|
853
|
+
const t = [];
|
|
854
|
+
for (; e; )
|
|
855
|
+
t.push(e), e = _e(e);
|
|
856
|
+
return t;
|
|
857
|
+
}
|
|
858
|
+
function _e(e) {
|
|
859
|
+
const { parentNode: t } = e;
|
|
860
|
+
return t && t instanceof ShadowRoot ? t.host : t;
|
|
861
|
+
}
|
|
862
|
+
function dt(e, t) {
|
|
863
|
+
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;
|
|
864
|
+
}
|
|
865
|
+
function pt({
|
|
866
|
+
groupElement: e,
|
|
867
|
+
hitRegion: t,
|
|
868
|
+
pointerEventTarget: n
|
|
869
|
+
}) {
|
|
870
|
+
if (!(n instanceof HTMLElement) || n.contains(e) || e.contains(n))
|
|
871
|
+
return !0;
|
|
872
|
+
if (lt(n, e) > 0) {
|
|
873
|
+
let o = n;
|
|
874
|
+
for (; o; ) {
|
|
875
|
+
if (o.contains(e))
|
|
876
|
+
return !0;
|
|
877
|
+
if (dt(o.getBoundingClientRect(), t))
|
|
878
|
+
return !1;
|
|
879
|
+
o = o.parentElement;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return !0;
|
|
883
|
+
}
|
|
884
|
+
function De(e, t) {
|
|
802
885
|
const n = [];
|
|
803
886
|
return t.forEach((o, r) => {
|
|
804
887
|
if (r.disabled)
|
|
805
888
|
return;
|
|
806
|
-
const a =
|
|
889
|
+
const a = at() ? me.coarse : me.precise, u = Re(r), i = st(r.orientation, u, {
|
|
807
890
|
x: e.clientX,
|
|
808
891
|
y: e.clientY
|
|
809
892
|
});
|
|
810
|
-
i && i.distance.x <= a && i.distance.y <= a &&
|
|
893
|
+
i && i.distance.x <= a && i.distance.y <= a && pt({
|
|
894
|
+
groupElement: r.element,
|
|
895
|
+
hitRegion: i.hitRegion.rect,
|
|
896
|
+
pointerEventTarget: e.target
|
|
897
|
+
}) && n.push(i.hitRegion);
|
|
811
898
|
}), n;
|
|
812
899
|
}
|
|
813
|
-
function
|
|
900
|
+
function xe(e) {
|
|
814
901
|
if (e.defaultPrevented)
|
|
815
902
|
return;
|
|
816
|
-
const { mountedGroups: t } = O(), n =
|
|
903
|
+
const { mountedGroups: t } = O(), n = De(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
|
|
817
904
|
let i = !1;
|
|
818
905
|
n.forEach((s) => {
|
|
819
906
|
o.add(s.group), s.panels.forEach((c) => {
|
|
@@ -821,7 +908,7 @@ function ge(e) {
|
|
|
821
908
|
}), s.separator && (a.add(s.separator), i || (i = !0, s.separator.element.focus()));
|
|
822
909
|
const l = t.get(s.group);
|
|
823
910
|
l && u.set(s.group, l.layout);
|
|
824
|
-
}),
|
|
911
|
+
}), E({
|
|
825
912
|
interactionState: {
|
|
826
913
|
hitRegions: n,
|
|
827
914
|
initialLayoutMap: u,
|
|
@@ -830,7 +917,7 @@ function ge(e) {
|
|
|
830
917
|
}
|
|
831
918
|
}), n.length && e.preventDefault();
|
|
832
919
|
}
|
|
833
|
-
function
|
|
920
|
+
function ze(e) {
|
|
834
921
|
if (e.defaultPrevented)
|
|
835
922
|
return;
|
|
836
923
|
const { interactionState: t, mountedGroups: n } = O();
|
|
@@ -840,7 +927,7 @@ function ye(e) {
|
|
|
840
927
|
// Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
|
|
841
928
|
e.type !== "pointerleave" && e.buttons === 0
|
|
842
929
|
) {
|
|
843
|
-
|
|
930
|
+
E(
|
|
844
931
|
(o) => o.interactionState.state === "inactive" ? o : {
|
|
845
932
|
cursorFlags: 0,
|
|
846
933
|
interactionState: {
|
|
@@ -850,7 +937,7 @@ function ye(e) {
|
|
|
850
937
|
);
|
|
851
938
|
return;
|
|
852
939
|
}
|
|
853
|
-
|
|
940
|
+
ke({
|
|
854
941
|
event: e,
|
|
855
942
|
hitRegions: t.hitRegions,
|
|
856
943
|
initialLayoutMap: t.initialLayoutMap,
|
|
@@ -860,10 +947,10 @@ function ye(e) {
|
|
|
860
947
|
break;
|
|
861
948
|
}
|
|
862
949
|
default: {
|
|
863
|
-
const o =
|
|
864
|
-
o.length === 0 ? t.state !== "inactive" &&
|
|
950
|
+
const o = De(e, n);
|
|
951
|
+
o.length === 0 ? t.state !== "inactive" && E({
|
|
865
952
|
interactionState: { state: "inactive" }
|
|
866
|
-
}) :
|
|
953
|
+
}) : E({
|
|
867
954
|
interactionState: {
|
|
868
955
|
hitRegions: o,
|
|
869
956
|
state: "hover"
|
|
@@ -873,14 +960,14 @@ function ye(e) {
|
|
|
873
960
|
}
|
|
874
961
|
}
|
|
875
962
|
}
|
|
876
|
-
function
|
|
963
|
+
function be(e) {
|
|
877
964
|
if (e.defaultPrevented)
|
|
878
965
|
return;
|
|
879
966
|
e.preventDefault();
|
|
880
967
|
const { interactionState: t } = O();
|
|
881
968
|
switch (t.state) {
|
|
882
969
|
case "active":
|
|
883
|
-
|
|
970
|
+
E({
|
|
884
971
|
cursorFlags: 0,
|
|
885
972
|
interactionState: {
|
|
886
973
|
state: "inactive"
|
|
@@ -888,25 +975,25 @@ function Se(e) {
|
|
|
888
975
|
}), le();
|
|
889
976
|
}
|
|
890
977
|
}
|
|
891
|
-
function
|
|
978
|
+
function we(e) {
|
|
892
979
|
let t = 0, n = 0;
|
|
893
980
|
const o = {};
|
|
894
981
|
for (const a of e)
|
|
895
982
|
if (a.defaultSize !== void 0) {
|
|
896
983
|
t++;
|
|
897
|
-
const u =
|
|
984
|
+
const u = G(a.defaultSize);
|
|
898
985
|
n += u, o[a.panelId] = u;
|
|
899
986
|
} else
|
|
900
987
|
o[a.panelId] = void 0;
|
|
901
988
|
const r = e.length - t;
|
|
902
989
|
if (r !== 0) {
|
|
903
|
-
const a =
|
|
990
|
+
const a = G((100 - n) / r);
|
|
904
991
|
for (const u of e)
|
|
905
992
|
u.defaultSize === void 0 && (o[u.panelId] = a);
|
|
906
993
|
}
|
|
907
994
|
return o;
|
|
908
995
|
}
|
|
909
|
-
function
|
|
996
|
+
function mt(e, t, n) {
|
|
910
997
|
const o = n[0];
|
|
911
998
|
if (!o)
|
|
912
999
|
return;
|
|
@@ -916,7 +1003,7 @@ function it(e, t, n) {
|
|
|
916
1003
|
const a = H({ group: e });
|
|
917
1004
|
r.onResize(
|
|
918
1005
|
{
|
|
919
|
-
asPercentage:
|
|
1006
|
+
asPercentage: G(
|
|
920
1007
|
o.inlineSize / a * 100
|
|
921
1008
|
),
|
|
922
1009
|
inPixels: o.inlineSize
|
|
@@ -924,9 +1011,9 @@ function it(e, t, n) {
|
|
|
924
1011
|
r.id
|
|
925
1012
|
);
|
|
926
1013
|
}
|
|
927
|
-
function
|
|
1014
|
+
function ht(e) {
|
|
928
1015
|
let t = !0;
|
|
929
|
-
|
|
1016
|
+
x(
|
|
930
1017
|
e.separators.length === 0 || e.separators.length < e.panels.length,
|
|
931
1018
|
"Invalid Group configuration; too many Separator components"
|
|
932
1019
|
);
|
|
@@ -937,18 +1024,18 @@ function st(e) {
|
|
|
937
1024
|
if (t) {
|
|
938
1025
|
if (H({ group: e }) === 0)
|
|
939
1026
|
return;
|
|
940
|
-
|
|
941
|
-
const
|
|
942
|
-
if (
|
|
943
|
-
const
|
|
944
|
-
layout:
|
|
945
|
-
panelConstraints:
|
|
1027
|
+
E((S) => {
|
|
1028
|
+
const v = S.mountedGroups.get(e);
|
|
1029
|
+
if (v) {
|
|
1030
|
+
const g = pe(e), w = v.defaultLayoutDeferred ? we(g) : v.layout, L = A({
|
|
1031
|
+
layout: w,
|
|
1032
|
+
panelConstraints: g
|
|
946
1033
|
});
|
|
947
|
-
return !
|
|
1034
|
+
return !v.defaultLayoutDeferred && W(w, L) ? S : {
|
|
948
1035
|
mountedGroups: new Map(S.mountedGroups).set(e, {
|
|
949
|
-
derivedPanelConstraints:
|
|
950
|
-
layout:
|
|
951
|
-
separatorToPanels:
|
|
1036
|
+
derivedPanelConstraints: g,
|
|
1037
|
+
layout: L,
|
|
1038
|
+
separatorToPanels: v.separatorToPanels
|
|
952
1039
|
})
|
|
953
1040
|
};
|
|
954
1041
|
}
|
|
@@ -956,11 +1043,11 @@ function st(e) {
|
|
|
956
1043
|
});
|
|
957
1044
|
}
|
|
958
1045
|
} else
|
|
959
|
-
|
|
1046
|
+
mt(e, h, p);
|
|
960
1047
|
}
|
|
961
1048
|
});
|
|
962
1049
|
r.observe(e.element), e.panels.forEach((m) => {
|
|
963
|
-
|
|
1050
|
+
x(
|
|
964
1051
|
!n.has(m.id),
|
|
965
1052
|
`Panel ids must be unique; id "${m.id}" was used more than once`
|
|
966
1053
|
), n.add(m.id), m.onResize && r.observe(m.element);
|
|
@@ -968,10 +1055,10 @@ function st(e) {
|
|
|
968
1055
|
const a = H({ group: e }), u = pe(e), i = e.panels.map(({ id: m }) => m).join(",");
|
|
969
1056
|
let s = e.defaultLayout;
|
|
970
1057
|
s && e.panels.length !== Object.keys(s).length && (s = void 0);
|
|
971
|
-
const l = e.inMemoryLayouts[i] ?? s ??
|
|
1058
|
+
const l = e.inMemoryLayouts[i] ?? s ?? we(u), c = A({
|
|
972
1059
|
layout: l,
|
|
973
1060
|
panelConstraints: u
|
|
974
|
-
}), d =
|
|
1061
|
+
}), d = Re(e), z = E((m) => ({
|
|
975
1062
|
mountedGroups: new Map(m.mountedGroups).set(e, {
|
|
976
1063
|
defaultLayoutDeferred: a === 0,
|
|
977
1064
|
derivedPanelConstraints: u,
|
|
@@ -982,31 +1069,31 @@ function st(e) {
|
|
|
982
1069
|
})
|
|
983
1070
|
}));
|
|
984
1071
|
return e.element.addEventListener("pointerleave", he), e.separators.forEach((m) => {
|
|
985
|
-
|
|
1072
|
+
x(
|
|
986
1073
|
!o.has(m.id),
|
|
987
1074
|
`Separator ids must be unique; id "${m.id}" was used more than once`
|
|
988
|
-
), o.add(m.id), m.element.addEventListener("keydown",
|
|
989
|
-
}),
|
|
1075
|
+
), o.add(m.id), m.element.addEventListener("keydown", ge);
|
|
1076
|
+
}), z.mountedGroups.size === 1 && (window.addEventListener("pointerdown", xe), window.addEventListener("pointermove", ze), window.addEventListener("pointerup", be)), function() {
|
|
990
1077
|
t = !1;
|
|
991
|
-
const f =
|
|
1078
|
+
const f = E((p) => {
|
|
992
1079
|
const h = new Map(p.mountedGroups);
|
|
993
1080
|
return h.delete(e), { mountedGroups: h };
|
|
994
1081
|
});
|
|
995
1082
|
e.element.removeEventListener("pointerleave", he), e.separators.forEach((p) => {
|
|
996
|
-
p.element.removeEventListener("keydown",
|
|
997
|
-
}), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown",
|
|
1083
|
+
p.element.removeEventListener("keydown", ge);
|
|
1084
|
+
}), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", xe), window.removeEventListener("pointermove", ze), window.removeEventListener("pointerup", be)), r.disconnect();
|
|
998
1085
|
};
|
|
999
1086
|
}
|
|
1000
1087
|
function ue(e) {
|
|
1001
|
-
const t =
|
|
1088
|
+
const t = We();
|
|
1002
1089
|
return `${e ?? t}`;
|
|
1003
1090
|
}
|
|
1004
|
-
const j = typeof window < "u" ?
|
|
1091
|
+
const j = typeof window < "u" ? je : Be;
|
|
1005
1092
|
function ce(e) {
|
|
1006
1093
|
const t = T(e);
|
|
1007
1094
|
return j(() => {
|
|
1008
1095
|
t.current = e;
|
|
1009
|
-
}, [e]),
|
|
1096
|
+
}, [e]), Le((n) => t.current?.(n), [t]);
|
|
1010
1097
|
}
|
|
1011
1098
|
function fe(...e) {
|
|
1012
1099
|
return ce((t) => {
|
|
@@ -1025,25 +1112,25 @@ function fe(...e) {
|
|
|
1025
1112
|
});
|
|
1026
1113
|
});
|
|
1027
1114
|
}
|
|
1028
|
-
const
|
|
1029
|
-
function
|
|
1115
|
+
const Ae = "--react-resizable-panels--panel--pointer-events";
|
|
1116
|
+
function Ne(e, t) {
|
|
1030
1117
|
const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
|
|
1031
1118
|
return `--react-resizable-panels--${n}--${o}`;
|
|
1032
1119
|
}
|
|
1033
|
-
const
|
|
1034
|
-
function
|
|
1120
|
+
const $e = Ue(null);
|
|
1121
|
+
function gt(e, t) {
|
|
1035
1122
|
const n = T({
|
|
1036
1123
|
getLayout: () => ({}),
|
|
1037
|
-
setLayout:
|
|
1124
|
+
setLayout: nt
|
|
1038
1125
|
});
|
|
1039
|
-
|
|
1126
|
+
Pe(t, () => n.current, []), j(() => {
|
|
1040
1127
|
Object.assign(
|
|
1041
1128
|
n.current,
|
|
1042
|
-
|
|
1129
|
+
Oe({ groupId: e })
|
|
1043
1130
|
);
|
|
1044
1131
|
});
|
|
1045
1132
|
}
|
|
1046
|
-
function
|
|
1133
|
+
function Pt({
|
|
1047
1134
|
children: e,
|
|
1048
1135
|
className: t,
|
|
1049
1136
|
defaultLayout: n,
|
|
@@ -1057,21 +1144,21 @@ function ht({
|
|
|
1057
1144
|
style: c,
|
|
1058
1145
|
...d
|
|
1059
1146
|
}) {
|
|
1060
|
-
const
|
|
1061
|
-
W(
|
|
1062
|
-
}), f = ue(i), [p, h] =
|
|
1063
|
-
|
|
1064
|
-
const q =
|
|
1147
|
+
const z = T({}), m = ce((b) => {
|
|
1148
|
+
W(z.current, b) || (z.current = b, s?.(b));
|
|
1149
|
+
}), f = ue(i), [p, h] = I(!1), [y, S] = I(null), [v, g] = I(n ?? {}), [w, L] = I([]), [C, K] = I([]), ne = T({}), X = T({}), Y = fe(S, a);
|
|
1150
|
+
gt(f, u);
|
|
1151
|
+
const q = Ce(
|
|
1065
1152
|
() => ({
|
|
1066
1153
|
id: f,
|
|
1067
1154
|
orientation: l,
|
|
1068
|
-
registerPanel: (b) => (
|
|
1069
|
-
|
|
1155
|
+
registerPanel: (b) => (L((M) => se(l, [...M, b])), () => {
|
|
1156
|
+
L((M) => M.filter((N) => N !== b));
|
|
1070
1157
|
}),
|
|
1071
|
-
registerSeparator: (b) => (
|
|
1072
|
-
(M) =>
|
|
1158
|
+
registerSeparator: (b) => (K(
|
|
1159
|
+
(M) => se(l, [...M, b])
|
|
1073
1160
|
), () => {
|
|
1074
|
-
|
|
1161
|
+
K(
|
|
1075
1162
|
(M) => M.filter((N) => N !== b)
|
|
1076
1163
|
);
|
|
1077
1164
|
})
|
|
@@ -1079,29 +1166,29 @@ function ht({
|
|
|
1079
1166
|
[f, l]
|
|
1080
1167
|
);
|
|
1081
1168
|
j(() => {
|
|
1082
|
-
if (
|
|
1169
|
+
if (y === null || w.length === 0)
|
|
1083
1170
|
return;
|
|
1084
1171
|
const b = {
|
|
1085
1172
|
defaultLayout: n,
|
|
1086
1173
|
disableCursor: !!o,
|
|
1087
1174
|
disabled: !!r,
|
|
1088
|
-
element:
|
|
1175
|
+
element: y,
|
|
1089
1176
|
id: f,
|
|
1090
1177
|
inMemoryLastExpandedPanelSizes: ne.current,
|
|
1091
1178
|
inMemoryLayouts: X.current,
|
|
1092
1179
|
orientation: l,
|
|
1093
|
-
panels:
|
|
1094
|
-
separators:
|
|
1095
|
-
}, M =
|
|
1096
|
-
oe && (
|
|
1097
|
-
const
|
|
1180
|
+
panels: w,
|
|
1181
|
+
separators: C
|
|
1182
|
+
}, M = ht(b), oe = O().mountedGroups.get(b);
|
|
1183
|
+
oe && (g(oe.layout), m?.(oe.layout));
|
|
1184
|
+
const Fe = D.addListener(
|
|
1098
1185
|
"interactionStateChange",
|
|
1099
1186
|
(J) => {
|
|
1100
1187
|
switch (J.state) {
|
|
1101
1188
|
case "active": {
|
|
1102
1189
|
h(
|
|
1103
1190
|
J.hitRegions.some(
|
|
1104
|
-
(
|
|
1191
|
+
($) => $.group === b
|
|
1105
1192
|
)
|
|
1106
1193
|
);
|
|
1107
1194
|
break;
|
|
@@ -1112,35 +1199,35 @@ function ht({
|
|
|
1112
1199
|
}
|
|
1113
1200
|
}
|
|
1114
1201
|
}
|
|
1115
|
-
),
|
|
1202
|
+
), He = D.addListener(
|
|
1116
1203
|
"mountedGroupsChange",
|
|
1117
1204
|
(J) => {
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1205
|
+
const $ = J.get(b);
|
|
1206
|
+
$ && $.derivedPanelConstraints.length > 0 && (g($.layout), m?.($.layout));
|
|
1120
1207
|
}
|
|
1121
1208
|
);
|
|
1122
1209
|
return () => {
|
|
1123
|
-
M(),
|
|
1210
|
+
M(), Fe(), He();
|
|
1124
1211
|
};
|
|
1125
1212
|
}, [
|
|
1126
1213
|
n,
|
|
1127
1214
|
o,
|
|
1128
1215
|
r,
|
|
1129
|
-
|
|
1216
|
+
y,
|
|
1130
1217
|
f,
|
|
1131
1218
|
m,
|
|
1132
1219
|
l,
|
|
1133
|
-
|
|
1134
|
-
|
|
1220
|
+
w,
|
|
1221
|
+
C
|
|
1135
1222
|
]);
|
|
1136
1223
|
const Z = {
|
|
1137
|
-
[
|
|
1224
|
+
[Ae]: p ? "none" : void 0
|
|
1138
1225
|
};
|
|
1139
|
-
for (const b in
|
|
1140
|
-
const M =
|
|
1226
|
+
for (const b in v) {
|
|
1227
|
+
const M = Ne(f, b), N = v[b];
|
|
1141
1228
|
Z[M] = N;
|
|
1142
1229
|
}
|
|
1143
|
-
return /* @__PURE__ */ B(
|
|
1230
|
+
return /* @__PURE__ */ B($e.Provider, { value: q, children: /* @__PURE__ */ B(
|
|
1144
1231
|
"div",
|
|
1145
1232
|
{
|
|
1146
1233
|
...d,
|
|
@@ -1164,7 +1251,7 @@ function ht({
|
|
|
1164
1251
|
function ae(e) {
|
|
1165
1252
|
return `react-resizable-panels:${e}`;
|
|
1166
1253
|
}
|
|
1167
|
-
function
|
|
1254
|
+
function yt({
|
|
1168
1255
|
id: e,
|
|
1169
1256
|
layout: t,
|
|
1170
1257
|
storage: n
|
|
@@ -1176,19 +1263,19 @@ function at({
|
|
|
1176
1263
|
console.error(o);
|
|
1177
1264
|
}
|
|
1178
1265
|
}
|
|
1179
|
-
function
|
|
1266
|
+
function Ct({
|
|
1180
1267
|
groupId: e,
|
|
1181
1268
|
storage: t
|
|
1182
1269
|
}) {
|
|
1183
|
-
const n =
|
|
1184
|
-
|
|
1270
|
+
const n = Ve(
|
|
1271
|
+
vt,
|
|
1185
1272
|
() => t.getItem(ae(e)),
|
|
1186
1273
|
() => t.getItem(ae(e))
|
|
1187
|
-
), o =
|
|
1274
|
+
), o = Ce(
|
|
1188
1275
|
() => n ? JSON.parse(n) : void 0,
|
|
1189
1276
|
[n]
|
|
1190
|
-
), r =
|
|
1191
|
-
(a) =>
|
|
1277
|
+
), r = Le(
|
|
1278
|
+
(a) => yt({
|
|
1192
1279
|
id: e,
|
|
1193
1280
|
layout: a,
|
|
1194
1281
|
storage: t
|
|
@@ -1200,24 +1287,24 @@ function vt({
|
|
|
1200
1287
|
onLayoutChange: r
|
|
1201
1288
|
};
|
|
1202
1289
|
}
|
|
1203
|
-
function
|
|
1290
|
+
function vt() {
|
|
1204
1291
|
return function() {
|
|
1205
1292
|
};
|
|
1206
1293
|
}
|
|
1207
|
-
function
|
|
1208
|
-
return
|
|
1294
|
+
function Rt() {
|
|
1295
|
+
return I(null);
|
|
1209
1296
|
}
|
|
1210
|
-
function
|
|
1297
|
+
function Et() {
|
|
1211
1298
|
return T(null);
|
|
1212
1299
|
}
|
|
1213
1300
|
function de() {
|
|
1214
|
-
const e =
|
|
1215
|
-
return
|
|
1301
|
+
const e = Ke($e);
|
|
1302
|
+
return x(
|
|
1216
1303
|
e,
|
|
1217
1304
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1218
1305
|
), e;
|
|
1219
1306
|
}
|
|
1220
|
-
function
|
|
1307
|
+
function St({
|
|
1221
1308
|
groupId: e,
|
|
1222
1309
|
panelId: t
|
|
1223
1310
|
}) {
|
|
@@ -1255,23 +1342,23 @@ function ut({
|
|
|
1255
1342
|
derivedPanelConstraints: l,
|
|
1256
1343
|
group: c,
|
|
1257
1344
|
layout: d,
|
|
1258
|
-
separatorToPanels:
|
|
1259
|
-
} = n(), m = c.panels.findIndex((
|
|
1345
|
+
separatorToPanels: z
|
|
1346
|
+
} = n(), m = c.panels.findIndex((y) => y.id === t), f = m === c.panels.length - 1, p = V({
|
|
1260
1347
|
delta: f ? s - i : i - s,
|
|
1261
1348
|
initialLayout: d,
|
|
1262
1349
|
panelConstraints: l,
|
|
1263
1350
|
pivotIndices: f ? [m - 1, m] : [m, m + 1],
|
|
1264
1351
|
prevLayout: d,
|
|
1265
1352
|
trigger: "imperative-api"
|
|
1266
|
-
}), h =
|
|
1353
|
+
}), h = A({
|
|
1267
1354
|
layout: p,
|
|
1268
1355
|
panelConstraints: l
|
|
1269
1356
|
});
|
|
1270
|
-
W(d, h) ||
|
|
1271
|
-
mountedGroups: new Map(
|
|
1357
|
+
W(d, h) || E((y) => ({
|
|
1358
|
+
mountedGroups: new Map(y.mountedGroups).set(c, {
|
|
1272
1359
|
derivedPanelConstraints: l,
|
|
1273
1360
|
layout: h,
|
|
1274
|
-
separatorToPanels:
|
|
1361
|
+
separatorToPanels: z
|
|
1275
1362
|
})
|
|
1276
1363
|
}));
|
|
1277
1364
|
};
|
|
@@ -1301,7 +1388,7 @@ function ut({
|
|
|
1301
1388
|
switch (typeof i) {
|
|
1302
1389
|
case "number": {
|
|
1303
1390
|
const { group: c } = n(), d = H({ group: c });
|
|
1304
|
-
l =
|
|
1391
|
+
l = G(i / d * 100);
|
|
1305
1392
|
break;
|
|
1306
1393
|
}
|
|
1307
1394
|
case "string": {
|
|
@@ -1314,7 +1401,7 @@ function ut({
|
|
|
1314
1401
|
}
|
|
1315
1402
|
};
|
|
1316
1403
|
}
|
|
1317
|
-
function
|
|
1404
|
+
function xt(e, t) {
|
|
1318
1405
|
const { id: n } = de(), o = T({
|
|
1319
1406
|
collapse: ie,
|
|
1320
1407
|
expand: ie,
|
|
@@ -1325,14 +1412,14 @@ function ct(e, t) {
|
|
|
1325
1412
|
isCollapsed: () => !1,
|
|
1326
1413
|
resize: ie
|
|
1327
1414
|
});
|
|
1328
|
-
|
|
1415
|
+
Pe(t, () => o.current, []), j(() => {
|
|
1329
1416
|
Object.assign(
|
|
1330
1417
|
o.current,
|
|
1331
|
-
|
|
1418
|
+
St({ groupId: n, panelId: e })
|
|
1332
1419
|
);
|
|
1333
1420
|
});
|
|
1334
1421
|
}
|
|
1335
|
-
function
|
|
1422
|
+
function Mt({
|
|
1336
1423
|
children: e,
|
|
1337
1424
|
className: t,
|
|
1338
1425
|
collapsedSize: n = "0%",
|
|
@@ -1345,18 +1432,18 @@ function St({
|
|
|
1345
1432
|
onResize: l,
|
|
1346
1433
|
panelRef: c,
|
|
1347
1434
|
style: d,
|
|
1348
|
-
...
|
|
1435
|
+
...z
|
|
1349
1436
|
}) {
|
|
1350
|
-
const m = !!u, f = ue(u), [p, h] =
|
|
1351
|
-
l?.(
|
|
1437
|
+
const m = !!u, f = ue(u), [p, h] = I(null), y = fe(h, a), { id: S, registerPanel: v } = de(), g = l !== null, w = ce((C) => {
|
|
1438
|
+
l?.(C, u);
|
|
1352
1439
|
});
|
|
1353
1440
|
j(() => {
|
|
1354
1441
|
if (p !== null)
|
|
1355
|
-
return
|
|
1442
|
+
return v({
|
|
1356
1443
|
element: p,
|
|
1357
1444
|
id: f,
|
|
1358
1445
|
idIsStable: m,
|
|
1359
|
-
onResize:
|
|
1446
|
+
onResize: g ? w : void 0,
|
|
1360
1447
|
panelConstraints: {
|
|
1361
1448
|
collapsedSize: n,
|
|
1362
1449
|
collapsible: o,
|
|
@@ -1370,33 +1457,33 @@ function St({
|
|
|
1370
1457
|
o,
|
|
1371
1458
|
r,
|
|
1372
1459
|
p,
|
|
1373
|
-
|
|
1460
|
+
g,
|
|
1374
1461
|
f,
|
|
1375
1462
|
m,
|
|
1376
1463
|
i,
|
|
1377
1464
|
s,
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
]),
|
|
1381
|
-
const
|
|
1465
|
+
w,
|
|
1466
|
+
v
|
|
1467
|
+
]), xt(f, c);
|
|
1468
|
+
const L = Ne(S, f);
|
|
1382
1469
|
return /* @__PURE__ */ B(
|
|
1383
1470
|
"div",
|
|
1384
1471
|
{
|
|
1385
|
-
...
|
|
1472
|
+
...z,
|
|
1386
1473
|
"data-panel": !0,
|
|
1387
1474
|
"data-testid": f,
|
|
1388
1475
|
id: f,
|
|
1389
|
-
ref:
|
|
1476
|
+
ref: y,
|
|
1390
1477
|
style: {
|
|
1391
|
-
...
|
|
1478
|
+
...zt,
|
|
1392
1479
|
flexBasis: 0,
|
|
1393
|
-
flexGrow: `var(${
|
|
1480
|
+
flexGrow: `var(${L}, 1)`,
|
|
1394
1481
|
flexShrink: 1,
|
|
1395
1482
|
// Prevent Panel content from interfering with panel size
|
|
1396
1483
|
overflow: "hidden",
|
|
1397
1484
|
// Disable pointer events inside of a panel during resize
|
|
1398
1485
|
// This avoid edge cases like nested iframes
|
|
1399
|
-
pointerEvents: `var(${
|
|
1486
|
+
pointerEvents: `var(${Ae})`
|
|
1400
1487
|
},
|
|
1401
1488
|
children: /* @__PURE__ */ B(
|
|
1402
1489
|
"div",
|
|
@@ -1413,7 +1500,7 @@ function St({
|
|
|
1413
1500
|
}
|
|
1414
1501
|
);
|
|
1415
1502
|
}
|
|
1416
|
-
const
|
|
1503
|
+
const zt = {
|
|
1417
1504
|
minHeight: "unset",
|
|
1418
1505
|
maxHeight: "unset",
|
|
1419
1506
|
height: "unset",
|
|
@@ -1429,13 +1516,13 @@ const ft = {
|
|
|
1429
1516
|
padding: "unset",
|
|
1430
1517
|
margin: "unset"
|
|
1431
1518
|
};
|
|
1432
|
-
function
|
|
1433
|
-
return
|
|
1519
|
+
function It() {
|
|
1520
|
+
return I(null);
|
|
1434
1521
|
}
|
|
1435
|
-
function
|
|
1522
|
+
function Gt() {
|
|
1436
1523
|
return T(null);
|
|
1437
1524
|
}
|
|
1438
|
-
function
|
|
1525
|
+
function bt({
|
|
1439
1526
|
layout: e,
|
|
1440
1527
|
panelConstraints: t,
|
|
1441
1528
|
panelId: n,
|
|
@@ -1447,8 +1534,8 @@ function dt({
|
|
|
1447
1534
|
);
|
|
1448
1535
|
if (i) {
|
|
1449
1536
|
const s = i.maxSize, l = a = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
|
|
1450
|
-
a =
|
|
1451
|
-
layout:
|
|
1537
|
+
a = A({
|
|
1538
|
+
layout: V({
|
|
1452
1539
|
delta: l - u,
|
|
1453
1540
|
initialLayout: e,
|
|
1454
1541
|
panelConstraints: t,
|
|
@@ -1457,8 +1544,8 @@ function dt({
|
|
|
1457
1544
|
trigger: "keyboard"
|
|
1458
1545
|
}),
|
|
1459
1546
|
panelConstraints: t
|
|
1460
|
-
})[n], r =
|
|
1461
|
-
layout:
|
|
1547
|
+
})[n], r = A({
|
|
1548
|
+
layout: V({
|
|
1462
1549
|
delta: s - u,
|
|
1463
1550
|
initialLayout: e,
|
|
1464
1551
|
panelConstraints: t,
|
|
@@ -1476,7 +1563,7 @@ function dt({
|
|
|
1476
1563
|
valueNow: u
|
|
1477
1564
|
};
|
|
1478
1565
|
}
|
|
1479
|
-
function
|
|
1566
|
+
function kt({
|
|
1480
1567
|
children: e,
|
|
1481
1568
|
className: t,
|
|
1482
1569
|
elementRef: n,
|
|
@@ -1484,38 +1571,38 @@ function bt({
|
|
|
1484
1571
|
style: r,
|
|
1485
1572
|
...a
|
|
1486
1573
|
}) {
|
|
1487
|
-
const u = ue(o), [i, s] =
|
|
1574
|
+
const u = ue(o), [i, s] = I({}), [l, c] = I("inactive"), [d, z] = I(null), m = fe(z, n), {
|
|
1488
1575
|
id: f,
|
|
1489
1576
|
orientation: p,
|
|
1490
1577
|
registerSeparator: h
|
|
1491
|
-
} = de(),
|
|
1578
|
+
} = de(), y = p === "horizontal" ? "vertical" : "horizontal";
|
|
1492
1579
|
return j(() => {
|
|
1493
1580
|
if (d !== null) {
|
|
1494
1581
|
const S = {
|
|
1495
1582
|
element: d,
|
|
1496
1583
|
id: u
|
|
1497
|
-
},
|
|
1584
|
+
}, v = h(S), g = D.addListener(
|
|
1498
1585
|
"interactionStateChange",
|
|
1499
|
-
(
|
|
1586
|
+
(L) => {
|
|
1500
1587
|
c(
|
|
1501
|
-
|
|
1502
|
-
(
|
|
1503
|
-
) ?
|
|
1588
|
+
L.state !== "inactive" && L.hitRegions.some(
|
|
1589
|
+
(C) => C.separator === S
|
|
1590
|
+
) ? L.state : "inactive"
|
|
1504
1591
|
);
|
|
1505
1592
|
}
|
|
1506
|
-
),
|
|
1593
|
+
), w = D.addListener(
|
|
1507
1594
|
"mountedGroupsChange",
|
|
1508
|
-
(
|
|
1509
|
-
|
|
1510
|
-
({ derivedPanelConstraints:
|
|
1595
|
+
(L) => {
|
|
1596
|
+
L.forEach(
|
|
1597
|
+
({ derivedPanelConstraints: C, layout: K, separatorToPanels: ne }, X) => {
|
|
1511
1598
|
if (X.id === f) {
|
|
1512
1599
|
const Y = ne.get(S);
|
|
1513
1600
|
if (Y) {
|
|
1514
1601
|
const q = Y[0], Z = X.panels.indexOf(q);
|
|
1515
1602
|
s(
|
|
1516
|
-
|
|
1517
|
-
layout:
|
|
1518
|
-
panelConstraints:
|
|
1603
|
+
bt({
|
|
1604
|
+
layout: K,
|
|
1605
|
+
panelConstraints: C,
|
|
1519
1606
|
panelId: q.id,
|
|
1520
1607
|
panelIndex: Z
|
|
1521
1608
|
})
|
|
@@ -1527,7 +1614,7 @@ function bt({
|
|
|
1527
1614
|
}
|
|
1528
1615
|
);
|
|
1529
1616
|
return () => {
|
|
1530
|
-
|
|
1617
|
+
g(), w(), v();
|
|
1531
1618
|
};
|
|
1532
1619
|
}
|
|
1533
1620
|
}, [d, f, u, h]), /* @__PURE__ */ B(
|
|
@@ -1535,7 +1622,7 @@ function bt({
|
|
|
1535
1622
|
{
|
|
1536
1623
|
...a,
|
|
1537
1624
|
"aria-controls": i.valueControls,
|
|
1538
|
-
"aria-orientation":
|
|
1625
|
+
"aria-orientation": y,
|
|
1539
1626
|
"aria-valuemax": i.valueMax,
|
|
1540
1627
|
"aria-valuemin": i.valueMin,
|
|
1541
1628
|
"aria-valuenow": i.valueNow,
|
|
@@ -1557,13 +1644,13 @@ function bt({
|
|
|
1557
1644
|
);
|
|
1558
1645
|
}
|
|
1559
1646
|
export {
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1647
|
+
Pt as Group,
|
|
1648
|
+
Mt as Panel,
|
|
1649
|
+
kt as Separator,
|
|
1650
|
+
Ct as useDefaultLayout,
|
|
1651
|
+
Rt as useGroupCallbackRef,
|
|
1652
|
+
Et as useGroupRef,
|
|
1653
|
+
It as usePanelCallbackRef,
|
|
1654
|
+
Gt as usePanelRef
|
|
1568
1655
|
};
|
|
1569
1656
|
//# sourceMappingURL=react-resizable-panels.js.map
|