react-resizable-panels 4.7.5 → 4.8.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,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as ie } from "react/jsx-runtime";
|
|
3
|
-
import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as
|
|
3
|
+
import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as We, useEffect as pe, useRef as T, createContext as ht, useImperativeHandle as Ue, useMemo as ge, useSyncExternalStore as Ke, useContext as mt } from "react";
|
|
4
4
|
function gt(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function yt(e, t) {
|
|
9
9
|
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
10
10
|
return t * o;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function St(e) {
|
|
13
13
|
return e / 100 * window.innerHeight;
|
|
14
14
|
}
|
|
15
15
|
function vt(e) {
|
|
@@ -42,7 +42,7 @@ function te({
|
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
case "rem": {
|
|
45
|
-
o =
|
|
45
|
+
o = yt(t, i);
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
case "em": {
|
|
@@ -50,7 +50,7 @@ function te({
|
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
case "vh": {
|
|
53
|
-
o =
|
|
53
|
+
o = St(i);
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
case "vw": {
|
|
@@ -69,7 +69,7 @@ function Q({
|
|
|
69
69
|
const { orientation: t, panels: n } = e;
|
|
70
70
|
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function ye(e) {
|
|
73
73
|
const { panels: t } = e, n = Q({ group: e });
|
|
74
74
|
return n === 0 ? t.map((o) => ({
|
|
75
75
|
groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
|
|
@@ -84,39 +84,39 @@ function ge(e) {
|
|
|
84
84
|
const { element: i, panelConstraints: s } = o;
|
|
85
85
|
let l = 0;
|
|
86
86
|
if (s.collapsedSize !== void 0) {
|
|
87
|
-
const
|
|
87
|
+
const f = te({
|
|
88
88
|
groupSize: n,
|
|
89
89
|
panelElement: i,
|
|
90
90
|
styleProp: s.collapsedSize
|
|
91
91
|
});
|
|
92
|
-
l = D(
|
|
92
|
+
l = D(f / n * 100);
|
|
93
93
|
}
|
|
94
94
|
let r;
|
|
95
95
|
if (s.defaultSize !== void 0) {
|
|
96
|
-
const
|
|
96
|
+
const f = te({
|
|
97
97
|
groupSize: n,
|
|
98
98
|
panelElement: i,
|
|
99
99
|
styleProp: s.defaultSize
|
|
100
100
|
});
|
|
101
|
-
r = D(
|
|
101
|
+
r = D(f / n * 100);
|
|
102
102
|
}
|
|
103
103
|
let a = 0;
|
|
104
104
|
if (s.minSize !== void 0) {
|
|
105
|
-
const
|
|
105
|
+
const f = te({
|
|
106
106
|
groupSize: n,
|
|
107
107
|
panelElement: i,
|
|
108
108
|
styleProp: s.minSize
|
|
109
109
|
});
|
|
110
|
-
a = D(
|
|
110
|
+
a = D(f / n * 100);
|
|
111
111
|
}
|
|
112
112
|
let u = 100;
|
|
113
113
|
if (s.maxSize !== void 0) {
|
|
114
|
-
const
|
|
114
|
+
const f = te({
|
|
115
115
|
groupSize: n,
|
|
116
116
|
panelElement: i,
|
|
117
117
|
styleProp: s.maxSize
|
|
118
118
|
});
|
|
119
|
-
u = D(
|
|
119
|
+
u = D(f / n * 100);
|
|
120
120
|
}
|
|
121
121
|
return {
|
|
122
122
|
groupResizeBehavior: s.groupResizeBehavior,
|
|
@@ -136,14 +136,14 @@ function L(e, t = "Assertion error") {
|
|
|
136
136
|
}
|
|
137
137
|
function Se(e, t) {
|
|
138
138
|
return Array.from(t).sort(
|
|
139
|
-
e === "horizontal" ?
|
|
139
|
+
e === "horizontal" ? bt : xt
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function bt(e, t) {
|
|
143
143
|
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
144
144
|
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function xt(e, t) {
|
|
147
147
|
const n = e.element.offsetTop - t.element.offsetTop;
|
|
148
148
|
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
149
149
|
}
|
|
@@ -185,116 +185,116 @@ function Pt() {
|
|
|
185
185
|
function Ye(e) {
|
|
186
186
|
const { element: t, orientation: n, panels: o, separators: i } = e, s = Se(
|
|
187
187
|
n,
|
|
188
|
-
Array.from(t.children).filter(Xe).map((
|
|
189
|
-
).map(({ element:
|
|
190
|
-
let r = !1, a = !1, u = -1,
|
|
188
|
+
Array.from(t.children).filter(Xe).map((x) => ({ element: x }))
|
|
189
|
+
).map(({ element: x }) => x), l = [];
|
|
190
|
+
let r = !1, a = !1, u = -1, f = -1, g = 0, d, z = [];
|
|
191
191
|
{
|
|
192
|
-
let
|
|
193
|
-
for (const
|
|
194
|
-
|
|
192
|
+
let x = -1;
|
|
193
|
+
for (const c of s)
|
|
194
|
+
c.hasAttribute("data-panel") && (x++, c.hasAttribute("data-disabled") || (g++, u === -1 && (u = x), f = x));
|
|
195
195
|
}
|
|
196
|
-
if (
|
|
197
|
-
let
|
|
198
|
-
for (const
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
(
|
|
196
|
+
if (g > 1) {
|
|
197
|
+
let x = -1;
|
|
198
|
+
for (const c of s)
|
|
199
|
+
if (c.hasAttribute("data-panel")) {
|
|
200
|
+
x++;
|
|
201
|
+
const p = o.find(
|
|
202
|
+
(m) => m.element === c
|
|
203
203
|
);
|
|
204
|
-
if (
|
|
204
|
+
if (p) {
|
|
205
205
|
if (d) {
|
|
206
|
-
const
|
|
207
|
-
let
|
|
206
|
+
const m = d.element.getBoundingClientRect(), S = c.getBoundingClientRect();
|
|
207
|
+
let v;
|
|
208
208
|
if (a) {
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
const y = n === "horizontal" ? new DOMRect(
|
|
210
|
+
m.right,
|
|
211
|
+
m.top,
|
|
212
212
|
0,
|
|
213
|
-
|
|
213
|
+
m.height
|
|
214
214
|
) : new DOMRect(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
m.left,
|
|
216
|
+
m.bottom,
|
|
217
|
+
m.width,
|
|
218
218
|
0
|
|
219
|
-
),
|
|
220
|
-
switch (
|
|
219
|
+
), h = n === "horizontal" ? new DOMRect(S.left, S.top, 0, S.height) : new DOMRect(S.left, S.top, S.width, 0);
|
|
220
|
+
switch (z.length) {
|
|
221
221
|
case 0: {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
v = [
|
|
223
|
+
y,
|
|
224
|
+
h
|
|
225
225
|
];
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
case 1: {
|
|
229
|
-
const P =
|
|
229
|
+
const P = z[0], M = wt({
|
|
230
230
|
orientation: n,
|
|
231
|
-
rects: [
|
|
231
|
+
rects: [m, S],
|
|
232
232
|
targetRect: P.element.getBoundingClientRect()
|
|
233
233
|
});
|
|
234
|
-
|
|
234
|
+
v = [
|
|
235
235
|
P,
|
|
236
|
-
M ===
|
|
236
|
+
M === m ? h : y
|
|
237
237
|
];
|
|
238
238
|
break;
|
|
239
239
|
}
|
|
240
240
|
default: {
|
|
241
|
-
|
|
241
|
+
v = z;
|
|
242
242
|
break;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
} else
|
|
246
|
-
|
|
246
|
+
z.length ? v = z : v = [
|
|
247
247
|
n === "horizontal" ? new DOMRect(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
m.right,
|
|
249
|
+
S.top,
|
|
250
|
+
S.left - m.right,
|
|
251
|
+
S.height
|
|
252
252
|
) : new DOMRect(
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
S.left,
|
|
254
|
+
m.bottom,
|
|
255
|
+
S.width,
|
|
256
|
+
S.top - m.bottom
|
|
257
257
|
)
|
|
258
258
|
];
|
|
259
|
-
for (const
|
|
260
|
-
let
|
|
259
|
+
for (const y of v) {
|
|
260
|
+
let h = "width" in y ? y : y.element.getBoundingClientRect();
|
|
261
261
|
const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
262
|
-
if (
|
|
263
|
-
const C = P -
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
262
|
+
if (h.width < P) {
|
|
263
|
+
const C = P - h.width;
|
|
264
|
+
h = new DOMRect(
|
|
265
|
+
h.x - C / 2,
|
|
266
|
+
h.y,
|
|
267
|
+
h.width + C,
|
|
268
|
+
h.height
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
|
-
if (
|
|
272
|
-
const C = P -
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
if (h.height < P) {
|
|
272
|
+
const C = P - h.height;
|
|
273
|
+
h = new DOMRect(
|
|
274
|
+
h.x,
|
|
275
|
+
h.y - C / 2,
|
|
276
|
+
h.width,
|
|
277
|
+
h.height + C
|
|
278
278
|
);
|
|
279
279
|
}
|
|
280
|
-
const M =
|
|
280
|
+
const M = x <= u || x > f;
|
|
281
281
|
!r && !M && l.push({
|
|
282
282
|
group: e,
|
|
283
283
|
groupSize: Q({ group: e }),
|
|
284
|
-
panels: [d,
|
|
285
|
-
separator: "width" in
|
|
286
|
-
rect:
|
|
284
|
+
panels: [d, p],
|
|
285
|
+
separator: "width" in y ? void 0 : y,
|
|
286
|
+
rect: h
|
|
287
287
|
}), r = !1;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
a = !1, d =
|
|
290
|
+
a = !1, d = p, z = [];
|
|
291
291
|
}
|
|
292
|
-
} else if (
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
(
|
|
292
|
+
} else if (c.hasAttribute("data-separator")) {
|
|
293
|
+
c.ariaDisabled !== null && (r = !0);
|
|
294
|
+
const p = i.find(
|
|
295
|
+
(m) => m.element === c
|
|
296
296
|
);
|
|
297
|
-
|
|
297
|
+
p ? z.push(p) : (d = void 0, z = []);
|
|
298
298
|
} else
|
|
299
299
|
a = !0;
|
|
300
300
|
}
|
|
@@ -344,7 +344,7 @@ const Ze = new Je();
|
|
|
344
344
|
function Lt(e) {
|
|
345
345
|
A = new Map(A), A.delete(e);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ee(e, t) {
|
|
348
348
|
for (const [n] of A)
|
|
349
349
|
if (n.id === e)
|
|
350
350
|
return n;
|
|
@@ -359,7 +359,7 @@ function $(e, t) {
|
|
|
359
359
|
function U() {
|
|
360
360
|
return A;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function ve(e, t) {
|
|
363
363
|
return Ze.addListener("groupChange", (n) => {
|
|
364
364
|
n.group.id === e && t(n);
|
|
365
365
|
});
|
|
@@ -401,8 +401,8 @@ function Rt(e) {
|
|
|
401
401
|
function Mt(e, t) {
|
|
402
402
|
if (e === t) throw new Error("Cannot compare node with itself");
|
|
403
403
|
const n = {
|
|
404
|
-
a:
|
|
405
|
-
b:
|
|
404
|
+
a: De(e),
|
|
405
|
+
b: De(t)
|
|
406
406
|
};
|
|
407
407
|
let o;
|
|
408
408
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
@@ -412,8 +412,8 @@ function Mt(e, t) {
|
|
|
412
412
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
413
413
|
);
|
|
414
414
|
const i = {
|
|
415
|
-
a: Ie(
|
|
416
|
-
b: Ie(
|
|
415
|
+
a: Ie(ke(n.a)),
|
|
416
|
+
b: Ie(ke(n.b))
|
|
417
417
|
};
|
|
418
418
|
if (i.a === i.b) {
|
|
419
419
|
const s = o.childNodes, l = {
|
|
@@ -430,26 +430,26 @@ function Mt(e, t) {
|
|
|
430
430
|
return Math.sign(i.a - i.b);
|
|
431
431
|
}
|
|
432
432
|
const Et = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
433
|
-
function
|
|
433
|
+
function kt(e) {
|
|
434
434
|
const t = getComputedStyle(Qe(e) ?? e).display;
|
|
435
435
|
return t === "flex" || t === "inline-flex";
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function It(e) {
|
|
438
438
|
const t = getComputedStyle(e);
|
|
439
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" ||
|
|
439
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || kt(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" || Et.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function ke(e) {
|
|
442
442
|
let t = e.length;
|
|
443
443
|
for (; t--; ) {
|
|
444
444
|
const n = e[t];
|
|
445
|
-
if (L(n, "Missing node"),
|
|
445
|
+
if (L(n, "Missing node"), It(n)) return n;
|
|
446
446
|
}
|
|
447
447
|
return null;
|
|
448
448
|
}
|
|
449
449
|
function Ie(e) {
|
|
450
450
|
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function De(e) {
|
|
453
453
|
const t = [];
|
|
454
454
|
for (; e; )
|
|
455
455
|
t.push(e), e = Qe(e);
|
|
@@ -481,7 +481,7 @@ function Tt({
|
|
|
481
481
|
}
|
|
482
482
|
return !0;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function ze(e, t) {
|
|
485
485
|
const n = [];
|
|
486
486
|
return t.forEach((o, i) => {
|
|
487
487
|
if (i.disabled)
|
|
@@ -505,11 +505,11 @@ function Ot(e, t) {
|
|
|
505
505
|
return !1;
|
|
506
506
|
return !0;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function I(e, t, n = 0) {
|
|
509
509
|
return Math.abs(D(e) - D(t)) <= n;
|
|
510
510
|
}
|
|
511
511
|
function G(e, t) {
|
|
512
|
-
return
|
|
512
|
+
return I(e, t) ? 0 : e > t ? 1 : -1;
|
|
513
513
|
}
|
|
514
514
|
function Y({
|
|
515
515
|
overrideDisabledPanels: e,
|
|
@@ -542,163 +542,163 @@ function se({
|
|
|
542
542
|
prevLayout: i,
|
|
543
543
|
trigger: s
|
|
544
544
|
}) {
|
|
545
|
-
if (
|
|
545
|
+
if (I(e, 0))
|
|
546
546
|
return t;
|
|
547
|
-
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [
|
|
548
|
-
L(
|
|
547
|
+
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [f, g] = o;
|
|
548
|
+
L(f != null, "Invalid first pivot index"), L(g != null, "Invalid second pivot index");
|
|
549
549
|
let d = 0;
|
|
550
550
|
switch (s) {
|
|
551
551
|
case "keyboard": {
|
|
552
552
|
{
|
|
553
|
-
const
|
|
553
|
+
const c = e < 0 ? g : f, p = n[c];
|
|
554
554
|
L(
|
|
555
|
-
|
|
556
|
-
`Panel constraints not found for index ${
|
|
555
|
+
p,
|
|
556
|
+
`Panel constraints not found for index ${c}`
|
|
557
557
|
);
|
|
558
558
|
const {
|
|
559
|
-
collapsedSize:
|
|
560
|
-
collapsible:
|
|
561
|
-
minSize:
|
|
562
|
-
} =
|
|
563
|
-
if (
|
|
564
|
-
const
|
|
559
|
+
collapsedSize: m = 0,
|
|
560
|
+
collapsible: S,
|
|
561
|
+
minSize: v = 0
|
|
562
|
+
} = p;
|
|
563
|
+
if (S) {
|
|
564
|
+
const y = r[c];
|
|
565
565
|
if (L(
|
|
566
|
-
|
|
567
|
-
`Previous layout not found for panel index ${
|
|
568
|
-
),
|
|
569
|
-
const
|
|
570
|
-
G(
|
|
566
|
+
y != null,
|
|
567
|
+
`Previous layout not found for panel index ${c}`
|
|
568
|
+
), I(y, m)) {
|
|
569
|
+
const h = v - y;
|
|
570
|
+
G(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
{
|
|
575
|
-
const
|
|
575
|
+
const c = e < 0 ? f : g, p = n[c];
|
|
576
576
|
L(
|
|
577
|
-
|
|
578
|
-
`No panel constraints found for index ${
|
|
577
|
+
p,
|
|
578
|
+
`No panel constraints found for index ${c}`
|
|
579
579
|
);
|
|
580
580
|
const {
|
|
581
|
-
collapsedSize:
|
|
582
|
-
collapsible:
|
|
583
|
-
minSize:
|
|
584
|
-
} =
|
|
585
|
-
if (
|
|
586
|
-
const
|
|
581
|
+
collapsedSize: m = 0,
|
|
582
|
+
collapsible: S,
|
|
583
|
+
minSize: v = 0
|
|
584
|
+
} = p;
|
|
585
|
+
if (S) {
|
|
586
|
+
const y = r[c];
|
|
587
587
|
if (L(
|
|
588
|
-
|
|
589
|
-
`Previous layout not found for panel index ${
|
|
590
|
-
),
|
|
591
|
-
const
|
|
592
|
-
G(
|
|
588
|
+
y != null,
|
|
589
|
+
`Previous layout not found for panel index ${c}`
|
|
590
|
+
), I(y, v)) {
|
|
591
|
+
const h = y - m;
|
|
592
|
+
G(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
596
|
break;
|
|
597
597
|
}
|
|
598
598
|
default: {
|
|
599
|
-
const
|
|
599
|
+
const c = e < 0 ? g : f, p = n[c];
|
|
600
600
|
L(
|
|
601
|
-
|
|
602
|
-
`Panel constraints not found for index ${
|
|
601
|
+
p,
|
|
602
|
+
`Panel constraints not found for index ${c}`
|
|
603
603
|
);
|
|
604
|
-
const
|
|
605
|
-
if (
|
|
604
|
+
const m = r[c], { collapsible: S, collapsedSize: v, minSize: y } = p;
|
|
605
|
+
if (S && G(m, y) < 0)
|
|
606
606
|
if (e > 0) {
|
|
607
|
-
const
|
|
608
|
-
G(M,
|
|
607
|
+
const h = y - v, P = h / 2, M = m + e;
|
|
608
|
+
G(M, y) < 0 && (e = G(e, P) <= 0 ? 0 : h);
|
|
609
609
|
} else {
|
|
610
|
-
const
|
|
611
|
-
G(M,
|
|
610
|
+
const h = y - v, P = 100 - h / 2, M = m - e;
|
|
611
|
+
G(M, y) < 0 && (e = G(100 + e, P) > 0 ? 0 : -h);
|
|
612
612
|
}
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
{
|
|
617
|
-
const
|
|
618
|
-
let
|
|
617
|
+
const c = e < 0 ? 1 : -1;
|
|
618
|
+
let p = e < 0 ? g : f, m = 0;
|
|
619
619
|
for (; ; ) {
|
|
620
|
-
const
|
|
620
|
+
const v = r[p];
|
|
621
621
|
L(
|
|
622
|
-
|
|
623
|
-
`Previous layout not found for panel index ${
|
|
622
|
+
v != null,
|
|
623
|
+
`Previous layout not found for panel index ${p}`
|
|
624
624
|
);
|
|
625
|
-
const
|
|
625
|
+
const h = Y({
|
|
626
626
|
overrideDisabledPanels: l,
|
|
627
|
-
panelConstraints: n[
|
|
628
|
-
prevSize:
|
|
627
|
+
panelConstraints: n[p],
|
|
628
|
+
prevSize: v,
|
|
629
629
|
size: 100
|
|
630
|
-
}) -
|
|
631
|
-
if (
|
|
630
|
+
}) - v;
|
|
631
|
+
if (m += h, p += c, p < 0 || p >= n.length)
|
|
632
632
|
break;
|
|
633
633
|
}
|
|
634
|
-
const
|
|
635
|
-
e = e < 0 ? 0 -
|
|
634
|
+
const S = Math.min(Math.abs(e), Math.abs(m));
|
|
635
|
+
e = e < 0 ? 0 - S : S;
|
|
636
636
|
}
|
|
637
637
|
{
|
|
638
|
-
let
|
|
639
|
-
for (;
|
|
640
|
-
const
|
|
638
|
+
let p = e < 0 ? f : g;
|
|
639
|
+
for (; p >= 0 && p < n.length; ) {
|
|
640
|
+
const m = Math.abs(e) - Math.abs(d), S = r[p];
|
|
641
641
|
L(
|
|
642
|
-
|
|
643
|
-
`Previous layout not found for panel index ${
|
|
642
|
+
S != null,
|
|
643
|
+
`Previous layout not found for panel index ${p}`
|
|
644
644
|
);
|
|
645
|
-
const
|
|
645
|
+
const v = S - m, y = Y({
|
|
646
646
|
overrideDisabledPanels: l,
|
|
647
|
-
panelConstraints: n[
|
|
648
|
-
prevSize:
|
|
649
|
-
size:
|
|
647
|
+
panelConstraints: n[p],
|
|
648
|
+
prevSize: S,
|
|
649
|
+
size: v
|
|
650
650
|
});
|
|
651
|
-
if (!
|
|
651
|
+
if (!I(S, y) && (d += S - y, u[p] = y, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
652
652
|
numeric: !0
|
|
653
653
|
}) >= 0))
|
|
654
654
|
break;
|
|
655
|
-
e < 0 ?
|
|
655
|
+
e < 0 ? p-- : p++;
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
if (Ot(a, u))
|
|
659
659
|
return i;
|
|
660
660
|
{
|
|
661
|
-
const
|
|
661
|
+
const c = e < 0 ? g : f, p = r[c];
|
|
662
662
|
L(
|
|
663
|
-
|
|
664
|
-
`Previous layout not found for panel index ${
|
|
663
|
+
p != null,
|
|
664
|
+
`Previous layout not found for panel index ${c}`
|
|
665
665
|
);
|
|
666
|
-
const
|
|
666
|
+
const m = p + d, S = Y({
|
|
667
667
|
overrideDisabledPanels: l,
|
|
668
|
-
panelConstraints: n[
|
|
669
|
-
prevSize:
|
|
670
|
-
size:
|
|
668
|
+
panelConstraints: n[c],
|
|
669
|
+
prevSize: p,
|
|
670
|
+
size: m
|
|
671
671
|
});
|
|
672
|
-
if (u[
|
|
673
|
-
let
|
|
674
|
-
for (;
|
|
675
|
-
const P = u[
|
|
672
|
+
if (u[c] = S, !I(S, m)) {
|
|
673
|
+
let v = m - S, h = e < 0 ? g : f;
|
|
674
|
+
for (; h >= 0 && h < n.length; ) {
|
|
675
|
+
const P = u[h];
|
|
676
676
|
L(
|
|
677
677
|
P != null,
|
|
678
|
-
`Previous layout not found for panel index ${
|
|
678
|
+
`Previous layout not found for panel index ${h}`
|
|
679
679
|
);
|
|
680
|
-
const M = P +
|
|
680
|
+
const M = P + v, C = Y({
|
|
681
681
|
overrideDisabledPanels: l,
|
|
682
|
-
panelConstraints: n[
|
|
682
|
+
panelConstraints: n[h],
|
|
683
683
|
prevSize: P,
|
|
684
684
|
size: M
|
|
685
685
|
});
|
|
686
|
-
if (
|
|
686
|
+
if (I(P, C) || (v -= C - P, u[h] = C), I(v, 0))
|
|
687
687
|
break;
|
|
688
|
-
e > 0 ?
|
|
688
|
+
e > 0 ? h-- : h++;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
|
-
const
|
|
693
|
-
(
|
|
692
|
+
const z = Object.values(u).reduce(
|
|
693
|
+
(c, p) => p + c,
|
|
694
694
|
0
|
|
695
695
|
);
|
|
696
|
-
if (!
|
|
696
|
+
if (!I(z, 100, 0.1))
|
|
697
697
|
return i;
|
|
698
|
-
const
|
|
699
|
-
return u.reduce((
|
|
698
|
+
const x = Object.keys(i);
|
|
699
|
+
return u.reduce((c, p, m) => (c[x[m]] = p, c), {});
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function V(e, t) {
|
|
702
702
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
703
703
|
return !1;
|
|
704
704
|
for (const n in e)
|
|
@@ -718,7 +718,7 @@ function B({
|
|
|
718
718
|
throw Error(
|
|
719
719
|
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
720
720
|
);
|
|
721
|
-
if (!
|
|
721
|
+
if (!I(i, 100) && o.length > 0)
|
|
722
722
|
for (let r = 0; r < t.length; r++) {
|
|
723
723
|
const a = o[r];
|
|
724
724
|
L(a != null, `No layout data found for index ${r}`);
|
|
@@ -731,25 +731,25 @@ function B({
|
|
|
731
731
|
L(a != null, `No layout data found for index ${r}`);
|
|
732
732
|
const u = o[r];
|
|
733
733
|
L(u != null, `No layout data found for index ${r}`);
|
|
734
|
-
const
|
|
734
|
+
const f = Y({
|
|
735
735
|
overrideDisabledPanels: !0,
|
|
736
736
|
panelConstraints: t[r],
|
|
737
737
|
prevSize: a,
|
|
738
738
|
size: u
|
|
739
739
|
});
|
|
740
|
-
u !=
|
|
740
|
+
u != f && (s += u - f, o[r] = f);
|
|
741
741
|
}
|
|
742
|
-
if (!
|
|
742
|
+
if (!I(s, 0))
|
|
743
743
|
for (let r = 0; r < t.length; r++) {
|
|
744
744
|
const a = o[r];
|
|
745
745
|
L(a != null, `No layout data found for index ${r}`);
|
|
746
|
-
const u = a + s,
|
|
746
|
+
const u = a + s, f = Y({
|
|
747
747
|
overrideDisabledPanels: !0,
|
|
748
748
|
panelConstraints: t[r],
|
|
749
749
|
prevSize: a,
|
|
750
750
|
size: u
|
|
751
751
|
});
|
|
752
|
-
if (a !==
|
|
752
|
+
if (a !== f && (s -= f - a, o[r] = f, I(s, 0)))
|
|
753
753
|
break;
|
|
754
754
|
}
|
|
755
755
|
const l = Object.keys(e);
|
|
@@ -765,20 +765,20 @@ function et({
|
|
|
765
765
|
a,
|
|
766
766
|
{
|
|
767
767
|
defaultLayoutDeferred: u,
|
|
768
|
-
derivedPanelConstraints:
|
|
769
|
-
layout:
|
|
768
|
+
derivedPanelConstraints: f,
|
|
769
|
+
layout: g,
|
|
770
770
|
groupSize: d,
|
|
771
|
-
separatorToPanels:
|
|
771
|
+
separatorToPanels: z
|
|
772
772
|
}
|
|
773
773
|
] of r)
|
|
774
774
|
if (a.id === e)
|
|
775
775
|
return {
|
|
776
776
|
defaultLayoutDeferred: u,
|
|
777
|
-
derivedPanelConstraints:
|
|
777
|
+
derivedPanelConstraints: f,
|
|
778
778
|
group: a,
|
|
779
779
|
groupSize: d,
|
|
780
|
-
layout:
|
|
781
|
-
separatorToPanels:
|
|
780
|
+
layout: g,
|
|
781
|
+
separatorToPanels: z
|
|
782
782
|
};
|
|
783
783
|
throw Error(`Group ${e} not found`);
|
|
784
784
|
}, o = () => {
|
|
@@ -804,68 +804,68 @@ function et({
|
|
|
804
804
|
return;
|
|
805
805
|
const {
|
|
806
806
|
defaultLayoutDeferred: u,
|
|
807
|
-
derivedPanelConstraints:
|
|
808
|
-
group:
|
|
807
|
+
derivedPanelConstraints: f,
|
|
808
|
+
group: g,
|
|
809
809
|
groupSize: d,
|
|
810
|
-
layout:
|
|
811
|
-
separatorToPanels:
|
|
812
|
-
} = n(),
|
|
813
|
-
delta:
|
|
814
|
-
initialLayout:
|
|
815
|
-
panelConstraints:
|
|
816
|
-
pivotIndices:
|
|
817
|
-
prevLayout:
|
|
810
|
+
layout: z,
|
|
811
|
+
separatorToPanels: x
|
|
812
|
+
} = n(), c = g.panels.findIndex((v) => v.id === t), p = c === g.panels.length - 1, m = se({
|
|
813
|
+
delta: p ? a - r : r - a,
|
|
814
|
+
initialLayout: z,
|
|
815
|
+
panelConstraints: f,
|
|
816
|
+
pivotIndices: p ? [c - 1, c] : [c, c + 1],
|
|
817
|
+
prevLayout: z,
|
|
818
818
|
trigger: "imperative-api"
|
|
819
|
-
}),
|
|
820
|
-
layout:
|
|
821
|
-
panelConstraints:
|
|
819
|
+
}), S = B({
|
|
820
|
+
layout: m,
|
|
821
|
+
panelConstraints: f
|
|
822
822
|
});
|
|
823
|
-
|
|
823
|
+
V(z, S) || _(g, {
|
|
824
824
|
defaultLayoutDeferred: u,
|
|
825
|
-
derivedPanelConstraints:
|
|
825
|
+
derivedPanelConstraints: f,
|
|
826
826
|
groupSize: d,
|
|
827
|
-
layout:
|
|
828
|
-
separatorToPanels:
|
|
827
|
+
layout: S,
|
|
828
|
+
separatorToPanels: x
|
|
829
829
|
});
|
|
830
830
|
};
|
|
831
831
|
return {
|
|
832
832
|
collapse: () => {
|
|
833
|
-
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(),
|
|
834
|
-
r &&
|
|
833
|
+
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), f = s();
|
|
834
|
+
r && f !== a && (u.expandToSize = f, l(a));
|
|
835
835
|
},
|
|
836
836
|
expand: () => {
|
|
837
|
-
const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues:
|
|
838
|
-
if (r &&
|
|
839
|
-
let d =
|
|
837
|
+
const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: f } = i(), g = s();
|
|
838
|
+
if (r && g === a) {
|
|
839
|
+
let d = f.expandToSize ?? u;
|
|
840
840
|
d === 0 && (d = 1), l(d);
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
getSize: () => {
|
|
844
|
-
const { group: r } = n(), a = s(), { element: u } = i(),
|
|
844
|
+
const { group: r } = n(), a = s(), { element: u } = i(), f = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
845
845
|
return {
|
|
846
846
|
asPercentage: a,
|
|
847
|
-
inPixels:
|
|
847
|
+
inPixels: f
|
|
848
848
|
};
|
|
849
849
|
},
|
|
850
850
|
isCollapsed: () => {
|
|
851
851
|
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
852
|
-
return r &&
|
|
852
|
+
return r && I(a, u);
|
|
853
853
|
},
|
|
854
854
|
resize: (r) => {
|
|
855
|
-
const { group: a } = n(), { element: u } = i(),
|
|
856
|
-
groupSize:
|
|
855
|
+
const { group: a } = n(), { element: u } = i(), f = Q({ group: a }), g = te({
|
|
856
|
+
groupSize: f,
|
|
857
857
|
panelElement: u,
|
|
858
858
|
styleProp: r
|
|
859
|
-
}), d = D(
|
|
859
|
+
}), d = D(g / f * 100);
|
|
860
860
|
l(d);
|
|
861
861
|
}
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function Te(e) {
|
|
865
865
|
if (e.defaultPrevented)
|
|
866
866
|
return;
|
|
867
867
|
const t = U();
|
|
868
|
-
|
|
868
|
+
ze(e, t).forEach((o) => {
|
|
869
869
|
if (o.separator) {
|
|
870
870
|
const i = o.panels.find(
|
|
871
871
|
(s) => s.panelConstraints.defaultSize !== void 0
|
|
@@ -916,7 +916,7 @@ function tt({
|
|
|
916
916
|
layout: n,
|
|
917
917
|
panelConstraints: i
|
|
918
918
|
});
|
|
919
|
-
return o ? r : (
|
|
919
|
+
return o ? r : (V(r, u) || _(s, {
|
|
920
920
|
defaultLayoutDeferred: o,
|
|
921
921
|
derivedPanelConstraints: i,
|
|
922
922
|
groupSize: l,
|
|
@@ -926,56 +926,56 @@ function tt({
|
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function H(e, t) {
|
|
930
930
|
const n = fe(e), o = $(n.id, !0), i = n.separators.find(
|
|
931
|
-
(
|
|
931
|
+
(g) => g.element === e
|
|
932
932
|
);
|
|
933
933
|
L(i, "Matching separator not found");
|
|
934
934
|
const s = o.separatorToPanels.get(i);
|
|
935
935
|
L(s, "Matching panels not found");
|
|
936
|
-
const l = s.map((
|
|
936
|
+
const l = s.map((g) => n.panels.indexOf(g)), a = tt({ groupId: n.id }).getLayout(), u = se({
|
|
937
937
|
delta: t,
|
|
938
938
|
initialLayout: a,
|
|
939
939
|
panelConstraints: o.derivedPanelConstraints,
|
|
940
940
|
pivotIndices: l,
|
|
941
941
|
prevLayout: a,
|
|
942
942
|
trigger: "keyboard"
|
|
943
|
-
}),
|
|
943
|
+
}), f = B({
|
|
944
944
|
layout: u,
|
|
945
945
|
panelConstraints: o.derivedPanelConstraints
|
|
946
946
|
});
|
|
947
|
-
|
|
947
|
+
V(a, f) || _(n, {
|
|
948
948
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
949
949
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
950
950
|
groupSize: o.groupSize,
|
|
951
|
-
layout:
|
|
951
|
+
layout: f,
|
|
952
952
|
separatorToPanels: o.separatorToPanels
|
|
953
953
|
});
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function Oe(e) {
|
|
956
956
|
if (e.defaultPrevented)
|
|
957
957
|
return;
|
|
958
958
|
const t = e.currentTarget, n = fe(t);
|
|
959
959
|
if (!n.disabled)
|
|
960
960
|
switch (e.key) {
|
|
961
961
|
case "ArrowDown": {
|
|
962
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
962
|
+
e.preventDefault(), n.orientation === "vertical" && H(t, 5);
|
|
963
963
|
break;
|
|
964
964
|
}
|
|
965
965
|
case "ArrowLeft": {
|
|
966
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
966
|
+
e.preventDefault(), n.orientation === "horizontal" && H(t, -5);
|
|
967
967
|
break;
|
|
968
968
|
}
|
|
969
969
|
case "ArrowRight": {
|
|
970
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
970
|
+
e.preventDefault(), n.orientation === "horizontal" && H(t, 5);
|
|
971
971
|
break;
|
|
972
972
|
}
|
|
973
973
|
case "ArrowUp": {
|
|
974
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
974
|
+
e.preventDefault(), n.orientation === "vertical" && H(t, -5);
|
|
975
975
|
break;
|
|
976
976
|
}
|
|
977
977
|
case "End": {
|
|
978
|
-
e.preventDefault(),
|
|
978
|
+
e.preventDefault(), H(t, 100);
|
|
979
979
|
break;
|
|
980
980
|
}
|
|
981
981
|
case "Enter": {
|
|
@@ -986,12 +986,12 @@ function Te(e) {
|
|
|
986
986
|
L(a, "Matching separator not found");
|
|
987
987
|
const u = r.get(a);
|
|
988
988
|
L(u, "Matching panels not found");
|
|
989
|
-
const
|
|
990
|
-
(d) => d.panelId ===
|
|
989
|
+
const f = u[0], g = s.find(
|
|
990
|
+
(d) => d.panelId === f.id
|
|
991
991
|
);
|
|
992
|
-
if (L(
|
|
993
|
-
const d = l[
|
|
994
|
-
|
|
992
|
+
if (L(g, "Panel metadata not found"), g.collapsible) {
|
|
993
|
+
const d = l[f.id], z = g.collapsedSize === d ? o.mutableState.expandedPanelSizes[f.id] ?? g.minSize : g.collapsedSize;
|
|
994
|
+
H(t, z - d);
|
|
995
995
|
}
|
|
996
996
|
break;
|
|
997
997
|
}
|
|
@@ -1010,7 +1010,7 @@ function Te(e) {
|
|
|
1010
1010
|
break;
|
|
1011
1011
|
}
|
|
1012
1012
|
case "Home": {
|
|
1013
|
-
e.preventDefault(),
|
|
1013
|
+
e.preventDefault(), H(t, -100);
|
|
1014
1014
|
break;
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
@@ -1019,33 +1019,33 @@ let J = {
|
|
|
1019
1019
|
cursorFlags: 0,
|
|
1020
1020
|
state: "inactive"
|
|
1021
1021
|
};
|
|
1022
|
-
const
|
|
1022
|
+
const be = new Je();
|
|
1023
1023
|
function W() {
|
|
1024
1024
|
return J;
|
|
1025
1025
|
}
|
|
1026
1026
|
function Gt(e) {
|
|
1027
|
-
return
|
|
1027
|
+
return be.addListener("change", e);
|
|
1028
1028
|
}
|
|
1029
1029
|
function At(e) {
|
|
1030
1030
|
const t = J, n = { ...J };
|
|
1031
|
-
n.cursorFlags = e, J = n,
|
|
1031
|
+
n.cursorFlags = e, J = n, be.emit("change", {
|
|
1032
1032
|
prev: t,
|
|
1033
1033
|
next: n
|
|
1034
1034
|
});
|
|
1035
1035
|
}
|
|
1036
1036
|
function Z(e) {
|
|
1037
1037
|
const t = J;
|
|
1038
|
-
J = e,
|
|
1038
|
+
J = e, be.emit("change", {
|
|
1039
1039
|
prev: t,
|
|
1040
1040
|
next: e
|
|
1041
1041
|
});
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function Ge(e) {
|
|
1044
1044
|
if (e.defaultPrevented)
|
|
1045
1045
|
return;
|
|
1046
1046
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1047
1047
|
return;
|
|
1048
|
-
const t = U(), n =
|
|
1048
|
+
const t = U(), n = ze(e, t), o = /* @__PURE__ */ new Map();
|
|
1049
1049
|
let i = !1;
|
|
1050
1050
|
n.forEach((s) => {
|
|
1051
1051
|
s.separator && (i || (i = !0, s.separator.element.focus({
|
|
@@ -1061,10 +1061,10 @@ function Oe(e) {
|
|
|
1061
1061
|
state: "active"
|
|
1062
1062
|
}), n.length && e.preventDefault();
|
|
1063
1063
|
}
|
|
1064
|
-
const Nt = (e) => e,
|
|
1065
|
-
}, nt = 1, ot = 2, it = 4, rt = 8,
|
|
1064
|
+
const Nt = (e) => e, me = () => {
|
|
1065
|
+
}, nt = 1, ot = 2, it = 4, rt = 8, Ae = 3, Ne = 12;
|
|
1066
1066
|
let ce;
|
|
1067
|
-
function
|
|
1067
|
+
function _e() {
|
|
1068
1068
|
return ce === void 0 && (ce = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ce = !0)), ce;
|
|
1069
1069
|
}
|
|
1070
1070
|
function _t({
|
|
@@ -1093,7 +1093,7 @@ function _t({
|
|
|
1093
1093
|
if (!(o === 0 && i === 0)) {
|
|
1094
1094
|
switch (n) {
|
|
1095
1095
|
case "active": {
|
|
1096
|
-
if (e &&
|
|
1096
|
+
if (e && _e()) {
|
|
1097
1097
|
const s = (e & nt) !== 0, l = (e & ot) !== 0, r = (e & it) !== 0, a = (e & rt) !== 0;
|
|
1098
1098
|
if (s)
|
|
1099
1099
|
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
@@ -1107,14 +1107,14 @@ function _t({
|
|
|
1107
1107
|
break;
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
|
-
return
|
|
1110
|
+
return _e() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
|
-
const
|
|
1113
|
+
const Fe = /* @__PURE__ */ new WeakMap();
|
|
1114
1114
|
function xe(e) {
|
|
1115
1115
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1116
1116
|
return;
|
|
1117
|
-
let { prevStyle: t, styleSheet: n } =
|
|
1117
|
+
let { prevStyle: t, styleSheet: n } = Fe.get(e) ?? {};
|
|
1118
1118
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
|
|
1119
1119
|
const o = W();
|
|
1120
1120
|
switch (o.state) {
|
|
@@ -1135,7 +1135,7 @@ function xe(e) {
|
|
|
1135
1135
|
break;
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
|
-
|
|
1138
|
+
Fe.set(e, {
|
|
1139
1139
|
prevStyle: t,
|
|
1140
1140
|
styleSheet: n
|
|
1141
1141
|
});
|
|
@@ -1151,54 +1151,54 @@ function st({
|
|
|
1151
1151
|
}) {
|
|
1152
1152
|
let r = 0;
|
|
1153
1153
|
n.forEach((u) => {
|
|
1154
|
-
const { group:
|
|
1155
|
-
let
|
|
1156
|
-
s ? d === "horizontal" ?
|
|
1157
|
-
const
|
|
1158
|
-
if (!
|
|
1154
|
+
const { group: f, groupSize: g } = u, { orientation: d, panels: z } = f, { disableCursor: x } = f.mutableState;
|
|
1155
|
+
let c = 0;
|
|
1156
|
+
s ? d === "horizontal" ? c = (t.clientX - s.x) / g * 100 : c = (t.clientY - s.y) / g * 100 : d === "horizontal" ? c = t.clientX < 0 ? -100 : 100 : c = t.clientY < 0 ? -100 : 100;
|
|
1157
|
+
const p = o.get(f), m = i.get(f);
|
|
1158
|
+
if (!p || !m)
|
|
1159
1159
|
return;
|
|
1160
1160
|
const {
|
|
1161
|
-
defaultLayoutDeferred:
|
|
1162
|
-
derivedPanelConstraints:
|
|
1163
|
-
groupSize:
|
|
1164
|
-
layout:
|
|
1161
|
+
defaultLayoutDeferred: S,
|
|
1162
|
+
derivedPanelConstraints: v,
|
|
1163
|
+
groupSize: y,
|
|
1164
|
+
layout: h,
|
|
1165
1165
|
separatorToPanels: P
|
|
1166
|
-
} =
|
|
1167
|
-
if (
|
|
1166
|
+
} = m;
|
|
1167
|
+
if (v && h && P) {
|
|
1168
1168
|
const M = se({
|
|
1169
|
-
delta:
|
|
1170
|
-
initialLayout:
|
|
1171
|
-
panelConstraints:
|
|
1172
|
-
pivotIndices: u.panels.map((C) =>
|
|
1173
|
-
prevLayout:
|
|
1169
|
+
delta: c,
|
|
1170
|
+
initialLayout: p,
|
|
1171
|
+
panelConstraints: v,
|
|
1172
|
+
pivotIndices: u.panels.map((C) => z.indexOf(C)),
|
|
1173
|
+
prevLayout: h,
|
|
1174
1174
|
trigger: "mouse-or-touch"
|
|
1175
1175
|
});
|
|
1176
|
-
if (
|
|
1177
|
-
if (
|
|
1176
|
+
if (V(M, h)) {
|
|
1177
|
+
if (c !== 0 && !x)
|
|
1178
1178
|
switch (d) {
|
|
1179
1179
|
case "horizontal": {
|
|
1180
|
-
r |=
|
|
1180
|
+
r |= c < 0 ? nt : ot;
|
|
1181
1181
|
break;
|
|
1182
1182
|
}
|
|
1183
1183
|
case "vertical": {
|
|
1184
|
-
r |=
|
|
1184
|
+
r |= c < 0 ? it : rt;
|
|
1185
1185
|
break;
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
1188
|
} else
|
|
1189
1189
|
_(u.group, {
|
|
1190
|
-
defaultLayoutDeferred:
|
|
1191
|
-
derivedPanelConstraints:
|
|
1192
|
-
groupSize:
|
|
1190
|
+
defaultLayoutDeferred: S,
|
|
1191
|
+
derivedPanelConstraints: v,
|
|
1192
|
+
groupSize: y,
|
|
1193
1193
|
layout: M,
|
|
1194
1194
|
separatorToPanels: P
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
1197
|
});
|
|
1198
1198
|
let a = 0;
|
|
1199
|
-
t.movementX === 0 ? a |= l &
|
|
1199
|
+
t.movementX === 0 ? a |= l & Ae : a |= r & Ae, t.movementY === 0 ? a |= l & Ne : a |= r & Ne, At(a), xe(e);
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function $e(e) {
|
|
1202
1202
|
const t = U(), n = W();
|
|
1203
1203
|
switch (n.state) {
|
|
1204
1204
|
case "active":
|
|
@@ -1212,7 +1212,7 @@ function Fe(e) {
|
|
|
1212
1212
|
});
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1215
|
+
function je(e) {
|
|
1216
1216
|
if (e.defaultPrevented)
|
|
1217
1217
|
return;
|
|
1218
1218
|
const t = W(), n = U();
|
|
@@ -1248,7 +1248,7 @@ function $e(e) {
|
|
|
1248
1248
|
break;
|
|
1249
1249
|
}
|
|
1250
1250
|
default: {
|
|
1251
|
-
const o =
|
|
1251
|
+
const o = ze(e, n);
|
|
1252
1252
|
o.length === 0 ? t.state !== "inactive" && Z({
|
|
1253
1253
|
cursorFlags: 0,
|
|
1254
1254
|
state: "inactive"
|
|
@@ -1288,7 +1288,7 @@ function Ve(e) {
|
|
|
1288
1288
|
}), e.preventDefault());
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function Be(e) {
|
|
1292
1292
|
let t = 0, n = 0;
|
|
1293
1293
|
const o = {};
|
|
1294
1294
|
for (const s of e)
|
|
@@ -1326,7 +1326,7 @@ function $t(e, t) {
|
|
|
1326
1326
|
return !1;
|
|
1327
1327
|
return !0;
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1329
|
+
function jt({
|
|
1330
1330
|
group: e,
|
|
1331
1331
|
nextGroupSize: t,
|
|
1332
1332
|
prevGroupSize: n,
|
|
@@ -1336,46 +1336,46 @@ function Ht({
|
|
|
1336
1336
|
return o;
|
|
1337
1337
|
let i = 0, s = 0, l = !1;
|
|
1338
1338
|
const r = /* @__PURE__ */ new Map(), a = [];
|
|
1339
|
-
for (const
|
|
1340
|
-
const d = o[
|
|
1341
|
-
switch (
|
|
1339
|
+
for (const g of e.panels) {
|
|
1340
|
+
const d = o[g.id] ?? 0;
|
|
1341
|
+
switch (g.panelConstraints.groupResizeBehavior) {
|
|
1342
1342
|
case "preserve-pixel-size": {
|
|
1343
1343
|
l = !0;
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1344
|
+
const z = d / 100 * n, x = D(
|
|
1345
|
+
z / t * 100
|
|
1346
1346
|
);
|
|
1347
|
-
r.set(
|
|
1347
|
+
r.set(g.id, x), i += x;
|
|
1348
1348
|
break;
|
|
1349
1349
|
}
|
|
1350
1350
|
case "preserve-relative-size":
|
|
1351
1351
|
default: {
|
|
1352
|
-
a.push(
|
|
1352
|
+
a.push(g.id), s += d;
|
|
1353
1353
|
break;
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
1357
|
if (!l || a.length === 0)
|
|
1358
1358
|
return o;
|
|
1359
|
-
const u = 100 - i,
|
|
1360
|
-
if (r.forEach((
|
|
1361
|
-
|
|
1359
|
+
const u = 100 - i, f = { ...o };
|
|
1360
|
+
if (r.forEach((g, d) => {
|
|
1361
|
+
f[d] = g;
|
|
1362
1362
|
}), s > 0)
|
|
1363
|
-
for (const
|
|
1364
|
-
const d = o[
|
|
1365
|
-
|
|
1363
|
+
for (const g of a) {
|
|
1364
|
+
const d = o[g] ?? 0;
|
|
1365
|
+
f[g] = D(
|
|
1366
1366
|
d / s * u
|
|
1367
1367
|
);
|
|
1368
1368
|
}
|
|
1369
1369
|
else {
|
|
1370
|
-
const
|
|
1370
|
+
const g = D(
|
|
1371
1371
|
u / a.length
|
|
1372
1372
|
);
|
|
1373
1373
|
for (const d of a)
|
|
1374
|
-
|
|
1374
|
+
f[d] = g;
|
|
1375
1375
|
}
|
|
1376
|
-
return
|
|
1376
|
+
return f;
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function Ht(e, t) {
|
|
1379
1379
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1380
1380
|
if (n.length !== o.length)
|
|
1381
1381
|
return !1;
|
|
@@ -1385,106 +1385,106 @@ function Vt(e, t) {
|
|
|
1385
1385
|
return !0;
|
|
1386
1386
|
}
|
|
1387
1387
|
const q = /* @__PURE__ */ new Map();
|
|
1388
|
-
function
|
|
1388
|
+
function Vt(e) {
|
|
1389
1389
|
let t = !0;
|
|
1390
1390
|
L(
|
|
1391
1391
|
e.element.ownerDocument.defaultView,
|
|
1392
1392
|
"Cannot register an unmounted Group"
|
|
1393
1393
|
);
|
|
1394
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((
|
|
1395
|
-
for (const
|
|
1396
|
-
const { borderBoxSize:
|
|
1397
|
-
if (
|
|
1394
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((c) => {
|
|
1395
|
+
for (const p of c) {
|
|
1396
|
+
const { borderBoxSize: m, target: S } = p;
|
|
1397
|
+
if (S === e.element) {
|
|
1398
1398
|
if (t) {
|
|
1399
|
-
const
|
|
1400
|
-
if (
|
|
1399
|
+
const v = Q({ group: e });
|
|
1400
|
+
if (v === 0)
|
|
1401
1401
|
return;
|
|
1402
|
-
const
|
|
1403
|
-
if (!
|
|
1402
|
+
const y = $(e.id);
|
|
1403
|
+
if (!y)
|
|
1404
1404
|
return;
|
|
1405
|
-
const
|
|
1405
|
+
const h = ye(e), P = y.defaultLayoutDeferred ? Be(h) : y.layout, M = jt({
|
|
1406
1406
|
group: e,
|
|
1407
|
-
nextGroupSize:
|
|
1408
|
-
prevGroupSize:
|
|
1407
|
+
nextGroupSize: v,
|
|
1408
|
+
prevGroupSize: y.groupSize,
|
|
1409
1409
|
prevLayout: P
|
|
1410
1410
|
}), C = B({
|
|
1411
1411
|
layout: M,
|
|
1412
|
-
panelConstraints:
|
|
1412
|
+
panelConstraints: h
|
|
1413
1413
|
});
|
|
1414
|
-
if (!
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
) &&
|
|
1414
|
+
if (!y.defaultLayoutDeferred && V(y.layout, C) && $t(
|
|
1415
|
+
y.derivedPanelConstraints,
|
|
1416
|
+
h
|
|
1417
|
+
) && y.groupSize === v)
|
|
1418
1418
|
return;
|
|
1419
1419
|
_(e, {
|
|
1420
1420
|
defaultLayoutDeferred: !1,
|
|
1421
|
-
derivedPanelConstraints:
|
|
1422
|
-
groupSize:
|
|
1421
|
+
derivedPanelConstraints: h,
|
|
1422
|
+
groupSize: v,
|
|
1423
1423
|
layout: C,
|
|
1424
|
-
separatorToPanels:
|
|
1424
|
+
separatorToPanels: y.separatorToPanels
|
|
1425
1425
|
});
|
|
1426
1426
|
}
|
|
1427
1427
|
} else
|
|
1428
|
-
Ft(e,
|
|
1428
|
+
Ft(e, S, m);
|
|
1429
1429
|
}
|
|
1430
1430
|
});
|
|
1431
|
-
s.observe(e.element), e.panels.forEach((
|
|
1431
|
+
s.observe(e.element), e.panels.forEach((c) => {
|
|
1432
1432
|
L(
|
|
1433
|
-
!o.has(
|
|
1434
|
-
`Panel ids must be unique; id "${
|
|
1435
|
-
), o.add(
|
|
1433
|
+
!o.has(c.id),
|
|
1434
|
+
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1435
|
+
), o.add(c.id), c.onResize && s.observe(c.element);
|
|
1436
1436
|
});
|
|
1437
|
-
const l = Q({ group: e }), r =
|
|
1437
|
+
const l = Q({ group: e }), r = ye(e), a = e.panels.map(({ id: c }) => c).join(",");
|
|
1438
1438
|
let u = e.mutableState.defaultLayout;
|
|
1439
|
-
u && (
|
|
1440
|
-
const
|
|
1441
|
-
layout:
|
|
1439
|
+
u && (Ht(e.panels, u) || (u = void 0));
|
|
1440
|
+
const f = e.mutableState.layouts[a] ?? u ?? Be(r), g = B({
|
|
1441
|
+
layout: f,
|
|
1442
1442
|
panelConstraints: r
|
|
1443
1443
|
}), d = e.element.ownerDocument;
|
|
1444
1444
|
q.set(
|
|
1445
1445
|
d,
|
|
1446
1446
|
(q.get(d) ?? 0) + 1
|
|
1447
1447
|
);
|
|
1448
|
-
const
|
|
1449
|
-
return Ye(e).forEach((
|
|
1450
|
-
|
|
1448
|
+
const z = /* @__PURE__ */ new Map();
|
|
1449
|
+
return Ye(e).forEach((c) => {
|
|
1450
|
+
c.separator && z.set(c.separator, c.panels);
|
|
1451
1451
|
}), _(e, {
|
|
1452
1452
|
defaultLayoutDeferred: l === 0,
|
|
1453
1453
|
derivedPanelConstraints: r,
|
|
1454
1454
|
groupSize: l,
|
|
1455
|
-
layout:
|
|
1456
|
-
separatorToPanels:
|
|
1457
|
-
}), e.separators.forEach((
|
|
1455
|
+
layout: g,
|
|
1456
|
+
separatorToPanels: z
|
|
1457
|
+
}), e.separators.forEach((c) => {
|
|
1458
1458
|
L(
|
|
1459
|
-
!i.has(
|
|
1460
|
-
`Separator ids must be unique; id "${
|
|
1461
|
-
), i.add(
|
|
1462
|
-
}), q.get(d) === 1 && (d.addEventListener("dblclick",
|
|
1459
|
+
!i.has(c.id),
|
|
1460
|
+
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1461
|
+
), i.add(c.id), c.element.addEventListener("keydown", Oe);
|
|
1462
|
+
}), q.get(d) === 1 && (d.addEventListener("dblclick", Te, !0), d.addEventListener("pointerdown", Ge, !0), d.addEventListener("pointerleave", $e), d.addEventListener("pointermove", je), d.addEventListener("pointerout", He), d.addEventListener("pointerup", Ve, !0)), function() {
|
|
1463
1463
|
t = !1, q.set(
|
|
1464
1464
|
d,
|
|
1465
1465
|
Math.max(0, (q.get(d) ?? 0) - 1)
|
|
1466
|
-
), Lt(e), e.separators.forEach((
|
|
1467
|
-
|
|
1466
|
+
), Lt(e), e.separators.forEach((p) => {
|
|
1467
|
+
p.element.removeEventListener("keydown", Oe);
|
|
1468
1468
|
}), q.get(d) || (d.removeEventListener(
|
|
1469
1469
|
"dblclick",
|
|
1470
|
-
|
|
1470
|
+
Te,
|
|
1471
1471
|
!0
|
|
1472
1472
|
), d.removeEventListener(
|
|
1473
1473
|
"pointerdown",
|
|
1474
|
-
|
|
1474
|
+
Ge,
|
|
1475
1475
|
!0
|
|
1476
|
-
), d.removeEventListener("pointerleave",
|
|
1476
|
+
), d.removeEventListener("pointerleave", $e), d.removeEventListener("pointermove", je), d.removeEventListener("pointerout", He), d.removeEventListener("pointerup", Ve, !0)), s.disconnect();
|
|
1477
1477
|
};
|
|
1478
1478
|
}
|
|
1479
1479
|
function Bt() {
|
|
1480
1480
|
const [e, t] = re({}), n = ne(() => t({}), []);
|
|
1481
1481
|
return [e, n];
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1483
|
+
function we(e) {
|
|
1484
1484
|
const t = pt();
|
|
1485
1485
|
return `${e ?? t}`;
|
|
1486
1486
|
}
|
|
1487
|
-
const K = typeof window < "u" ?
|
|
1487
|
+
const K = typeof window < "u" ? We : pe;
|
|
1488
1488
|
function oe(e) {
|
|
1489
1489
|
const t = T(e);
|
|
1490
1490
|
return K(() => {
|
|
@@ -1494,7 +1494,7 @@ function oe(e) {
|
|
|
1494
1494
|
[t]
|
|
1495
1495
|
);
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function Pe(...e) {
|
|
1498
1498
|
return oe((t) => {
|
|
1499
1499
|
e.forEach((n) => {
|
|
1500
1500
|
if (n)
|
|
@@ -1511,7 +1511,7 @@ function we(...e) {
|
|
|
1511
1511
|
});
|
|
1512
1512
|
});
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1514
|
+
function Le(e) {
|
|
1515
1515
|
const t = T({ ...e });
|
|
1516
1516
|
return K(() => {
|
|
1517
1517
|
for (const n in e)
|
|
@@ -1524,7 +1524,7 @@ function Wt(e, t) {
|
|
|
1524
1524
|
getLayout: () => ({}),
|
|
1525
1525
|
setLayout: Nt
|
|
1526
1526
|
});
|
|
1527
|
-
|
|
1527
|
+
Ue(t, () => n.current, []), K(() => {
|
|
1528
1528
|
Object.assign(
|
|
1529
1529
|
n.current,
|
|
1530
1530
|
tt({ groupId: e })
|
|
@@ -1542,44 +1542,44 @@ function Ut({
|
|
|
1542
1542
|
id: r,
|
|
1543
1543
|
onLayoutChange: a,
|
|
1544
1544
|
onLayoutChanged: u,
|
|
1545
|
-
orientation:
|
|
1546
|
-
resizeTargetMinimumSize:
|
|
1545
|
+
orientation: f = "horizontal",
|
|
1546
|
+
resizeTargetMinimumSize: g = {
|
|
1547
1547
|
coarse: 20,
|
|
1548
1548
|
fine: 10
|
|
1549
1549
|
},
|
|
1550
1550
|
style: d,
|
|
1551
|
-
...
|
|
1551
|
+
...z
|
|
1552
1552
|
}) {
|
|
1553
|
-
const
|
|
1553
|
+
const x = T({
|
|
1554
1554
|
onLayoutChange: {},
|
|
1555
1555
|
onLayoutChanged: {}
|
|
1556
|
-
}),
|
|
1557
|
-
|
|
1558
|
-
}),
|
|
1559
|
-
|
|
1560
|
-
}),
|
|
1556
|
+
}), c = oe((b) => {
|
|
1557
|
+
V(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, a?.(b));
|
|
1558
|
+
}), p = oe((b) => {
|
|
1559
|
+
V(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, u?.(b));
|
|
1560
|
+
}), m = we(r), S = T(null), [v, y] = Bt(), h = T({
|
|
1561
1561
|
lastExpandedPanelSizes: {},
|
|
1562
1562
|
layouts: {},
|
|
1563
1563
|
panels: [],
|
|
1564
|
-
resizeTargetMinimumSize:
|
|
1564
|
+
resizeTargetMinimumSize: g,
|
|
1565
1565
|
separators: []
|
|
1566
|
-
}), P =
|
|
1567
|
-
Wt(
|
|
1566
|
+
}), P = Pe(S, s);
|
|
1567
|
+
Wt(m, l);
|
|
1568
1568
|
const M = oe(
|
|
1569
|
-
(
|
|
1570
|
-
const E = W(), R =
|
|
1571
|
-
if (
|
|
1569
|
+
(b, w) => {
|
|
1570
|
+
const E = W(), R = Ee(b), k = $(b);
|
|
1571
|
+
if (k) {
|
|
1572
1572
|
let O = !1;
|
|
1573
1573
|
switch (E.state) {
|
|
1574
1574
|
case "active": {
|
|
1575
1575
|
O = E.hitRegions.some(
|
|
1576
|
-
(
|
|
1576
|
+
(j) => j.group === R
|
|
1577
1577
|
);
|
|
1578
1578
|
break;
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
1581
|
return {
|
|
1582
|
-
flexGrow:
|
|
1582
|
+
flexGrow: k.layout[w] ?? 1,
|
|
1583
1583
|
pointerEvents: O ? "none" : void 0
|
|
1584
1584
|
};
|
|
1585
1585
|
}
|
|
@@ -1588,64 +1588,64 @@ function Ut({
|
|
|
1588
1588
|
flexGrow: n?.[w]
|
|
1589
1589
|
};
|
|
1590
1590
|
}
|
|
1591
|
-
), C =
|
|
1591
|
+
), C = Le({
|
|
1592
1592
|
defaultLayout: n,
|
|
1593
1593
|
disableCursor: o
|
|
1594
|
-
}), X =
|
|
1594
|
+
}), X = ge(
|
|
1595
1595
|
() => ({
|
|
1596
1596
|
get disableCursor() {
|
|
1597
1597
|
return !!C.disableCursor;
|
|
1598
1598
|
},
|
|
1599
1599
|
getPanelStyles: M,
|
|
1600
|
-
id:
|
|
1601
|
-
orientation:
|
|
1602
|
-
registerPanel: (
|
|
1603
|
-
const w =
|
|
1604
|
-
return w.panels = Se(
|
|
1600
|
+
id: m,
|
|
1601
|
+
orientation: f,
|
|
1602
|
+
registerPanel: (b) => {
|
|
1603
|
+
const w = h.current;
|
|
1604
|
+
return w.panels = Se(f, [
|
|
1605
1605
|
...w.panels,
|
|
1606
|
-
|
|
1607
|
-
]),
|
|
1606
|
+
b
|
|
1607
|
+
]), y(), () => {
|
|
1608
1608
|
w.panels = w.panels.filter(
|
|
1609
|
-
(E) => E !==
|
|
1610
|
-
),
|
|
1609
|
+
(E) => E !== b
|
|
1610
|
+
), y();
|
|
1611
1611
|
};
|
|
1612
1612
|
},
|
|
1613
|
-
registerSeparator: (
|
|
1614
|
-
const w =
|
|
1615
|
-
return w.separators = Se(
|
|
1613
|
+
registerSeparator: (b) => {
|
|
1614
|
+
const w = h.current;
|
|
1615
|
+
return w.separators = Se(f, [
|
|
1616
1616
|
...w.separators,
|
|
1617
|
-
|
|
1618
|
-
]),
|
|
1617
|
+
b
|
|
1618
|
+
]), y(), () => {
|
|
1619
1619
|
w.separators = w.separators.filter(
|
|
1620
|
-
(E) => E !==
|
|
1621
|
-
),
|
|
1620
|
+
(E) => E !== b
|
|
1621
|
+
), y();
|
|
1622
1622
|
};
|
|
1623
1623
|
},
|
|
1624
|
-
togglePanelDisabled: (
|
|
1625
|
-
const R =
|
|
1626
|
-
(
|
|
1624
|
+
togglePanelDisabled: (b, w) => {
|
|
1625
|
+
const R = h.current.panels.find(
|
|
1626
|
+
(j) => j.id === b
|
|
1627
1627
|
);
|
|
1628
1628
|
R && (R.panelConstraints.disabled = w);
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1629
|
+
const k = Ee(m), O = $(m);
|
|
1630
|
+
k && O && _(k, {
|
|
1631
1631
|
...O,
|
|
1632
|
-
derivedPanelConstraints:
|
|
1632
|
+
derivedPanelConstraints: ye(k)
|
|
1633
1633
|
});
|
|
1634
1634
|
},
|
|
1635
|
-
toggleSeparatorDisabled: (
|
|
1636
|
-
const R =
|
|
1637
|
-
(
|
|
1635
|
+
toggleSeparatorDisabled: (b, w) => {
|
|
1636
|
+
const R = h.current.separators.find(
|
|
1637
|
+
(k) => k.id === b
|
|
1638
1638
|
);
|
|
1639
1639
|
R && (R.disabled = w);
|
|
1640
1640
|
}
|
|
1641
1641
|
}),
|
|
1642
|
-
[M,
|
|
1642
|
+
[M, m, y, f, C]
|
|
1643
1643
|
), F = T(null);
|
|
1644
1644
|
return K(() => {
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1645
|
+
const b = S.current;
|
|
1646
|
+
if (b === null)
|
|
1647
1647
|
return;
|
|
1648
|
-
const w =
|
|
1648
|
+
const w = h.current;
|
|
1649
1649
|
let E;
|
|
1650
1650
|
if (C.defaultLayout !== void 0 && Object.keys(C.defaultLayout).length === w.panels.length) {
|
|
1651
1651
|
E = {};
|
|
@@ -1656,67 +1656,67 @@ function Ut({
|
|
|
1656
1656
|
}
|
|
1657
1657
|
const R = {
|
|
1658
1658
|
disabled: !!i,
|
|
1659
|
-
element:
|
|
1660
|
-
id:
|
|
1659
|
+
element: b,
|
|
1660
|
+
id: m,
|
|
1661
1661
|
mutableState: {
|
|
1662
1662
|
defaultLayout: E,
|
|
1663
1663
|
disableCursor: !!C.disableCursor,
|
|
1664
|
-
expandedPanelSizes:
|
|
1665
|
-
layouts:
|
|
1664
|
+
expandedPanelSizes: h.current.lastExpandedPanelSizes,
|
|
1665
|
+
layouts: h.current.layouts
|
|
1666
1666
|
},
|
|
1667
|
-
orientation:
|
|
1667
|
+
orientation: f,
|
|
1668
1668
|
panels: w.panels,
|
|
1669
1669
|
resizeTargetMinimumSize: w.resizeTargetMinimumSize,
|
|
1670
1670
|
separators: w.separators
|
|
1671
1671
|
};
|
|
1672
1672
|
F.current = R;
|
|
1673
|
-
const
|
|
1674
|
-
!O &&
|
|
1675
|
-
const lt =
|
|
1676
|
-
const { defaultLayoutDeferred: ae, derivedPanelConstraints:
|
|
1677
|
-
if (ae ||
|
|
1673
|
+
const k = Vt(R), { defaultLayoutDeferred: O, derivedPanelConstraints: j, layout: Re } = $(R.id, !0);
|
|
1674
|
+
!O && j.length > 0 && (c(Re), p(Re));
|
|
1675
|
+
const lt = ve(m, (ee) => {
|
|
1676
|
+
const { defaultLayoutDeferred: ae, derivedPanelConstraints: Me, layout: le } = ee.next;
|
|
1677
|
+
if (ae || Me.length === 0)
|
|
1678
1678
|
return;
|
|
1679
1679
|
const ut = R.panels.map(({ id: N }) => N).join(",");
|
|
1680
|
-
R.mutableState.layouts[ut] = le,
|
|
1680
|
+
R.mutableState.layouts[ut] = le, Me.forEach((N) => {
|
|
1681
1681
|
if (N.collapsible) {
|
|
1682
|
-
const { layout:
|
|
1683
|
-
if (
|
|
1684
|
-
const ft =
|
|
1682
|
+
const { layout: he } = ee.prev ?? {};
|
|
1683
|
+
if (he) {
|
|
1684
|
+
const ft = I(
|
|
1685
1685
|
N.collapsedSize,
|
|
1686
1686
|
le[N.panelId]
|
|
1687
|
-
), dt =
|
|
1687
|
+
), dt = I(
|
|
1688
1688
|
N.collapsedSize,
|
|
1689
|
-
|
|
1689
|
+
he[N.panelId]
|
|
1690
1690
|
);
|
|
1691
|
-
ft && !dt && (R.mutableState.expandedPanelSizes[N.panelId] =
|
|
1691
|
+
ft && !dt && (R.mutableState.expandedPanelSizes[N.panelId] = he[N.panelId]);
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
1694
|
});
|
|
1695
1695
|
const ct = W().state !== "active";
|
|
1696
|
-
|
|
1696
|
+
c(le), ct && p(le);
|
|
1697
1697
|
});
|
|
1698
1698
|
return () => {
|
|
1699
|
-
F.current = null,
|
|
1699
|
+
F.current = null, k(), lt();
|
|
1700
1700
|
};
|
|
1701
1701
|
}, [
|
|
1702
1702
|
i,
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
f,
|
|
1703
|
+
m,
|
|
1704
|
+
p,
|
|
1706
1705
|
c,
|
|
1707
|
-
|
|
1706
|
+
f,
|
|
1707
|
+
v,
|
|
1708
1708
|
C
|
|
1709
|
-
]),
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1709
|
+
]), pe(() => {
|
|
1710
|
+
const b = F.current;
|
|
1711
|
+
b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
|
|
1712
1712
|
}), /* @__PURE__ */ ie(at.Provider, { value: X, children: /* @__PURE__ */ ie(
|
|
1713
1713
|
"div",
|
|
1714
1714
|
{
|
|
1715
|
-
...
|
|
1715
|
+
...z,
|
|
1716
1716
|
className: t,
|
|
1717
1717
|
"data-group": !0,
|
|
1718
|
-
"data-testid":
|
|
1719
|
-
id:
|
|
1718
|
+
"data-testid": m,
|
|
1719
|
+
id: m,
|
|
1720
1720
|
ref: P,
|
|
1721
1721
|
style: {
|
|
1722
1722
|
height: "100%",
|
|
@@ -1724,115 +1724,160 @@ function Ut({
|
|
|
1724
1724
|
overflow: "hidden",
|
|
1725
1725
|
...d,
|
|
1726
1726
|
display: "flex",
|
|
1727
|
-
flexDirection:
|
|
1727
|
+
flexDirection: f === "horizontal" ? "row" : "column",
|
|
1728
1728
|
flexWrap: "nowrap",
|
|
1729
1729
|
// Inform the browser that the library is handling touch events for this element
|
|
1730
1730
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1731
1731
|
// NOTE This is not an inherited style
|
|
1732
1732
|
// See github.com/bvaughn/react-resizable-panels/issues/662
|
|
1733
|
-
touchAction:
|
|
1733
|
+
touchAction: f === "horizontal" ? "pan-y" : "pan-x"
|
|
1734
1734
|
},
|
|
1735
1735
|
children: e
|
|
1736
1736
|
}
|
|
1737
1737
|
) });
|
|
1738
1738
|
}
|
|
1739
1739
|
Ut.displayName = "Group";
|
|
1740
|
-
function
|
|
1740
|
+
function de(e, t) {
|
|
1741
1741
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function Kt({
|
|
1744
|
+
id: e,
|
|
1745
|
+
panelIds: t,
|
|
1746
|
+
storage: n
|
|
1747
|
+
}) {
|
|
1748
|
+
const o = de(e, []), i = n.getItem(o);
|
|
1749
|
+
if (i)
|
|
1750
|
+
try {
|
|
1751
|
+
const s = JSON.parse(i);
|
|
1752
|
+
if (t) {
|
|
1753
|
+
const l = t.join(","), r = s[l];
|
|
1754
|
+
if (r && Array.isArray(r.layout) && t.length === r.layout.length) {
|
|
1755
|
+
const a = {};
|
|
1756
|
+
for (let u = 0; u < t.length; u++)
|
|
1757
|
+
a[t[u]] = r.layout[u];
|
|
1758
|
+
return a;
|
|
1759
|
+
}
|
|
1760
|
+
} else {
|
|
1761
|
+
const l = Object.keys(s);
|
|
1762
|
+
if (l.length === 1) {
|
|
1763
|
+
const r = s[l[0]];
|
|
1764
|
+
if (r && Array.isArray(r.layout)) {
|
|
1765
|
+
const a = l[0].split(",");
|
|
1766
|
+
if (a.length === r.layout.length) {
|
|
1767
|
+
const u = {};
|
|
1768
|
+
for (let f = 0; f < a.length; f++)
|
|
1769
|
+
u[a[f]] = r.layout[f];
|
|
1770
|
+
return u;
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
} catch {
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
function on({
|
|
1744
1779
|
debounceSaveMs: e = 100,
|
|
1745
1780
|
panelIds: t,
|
|
1746
1781
|
storage: n = localStorage,
|
|
1747
1782
|
...o
|
|
1748
1783
|
}) {
|
|
1749
|
-
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l =
|
|
1750
|
-
|
|
1784
|
+
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = de(s, t ?? []), r = Ke(
|
|
1785
|
+
Xt,
|
|
1751
1786
|
() => n.getItem(l),
|
|
1752
1787
|
() => n.getItem(l)
|
|
1753
|
-
), a =
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1788
|
+
), a = ge(() => {
|
|
1789
|
+
if (r) {
|
|
1790
|
+
const c = JSON.parse(r), p = Object.values(c);
|
|
1791
|
+
if (Array.from(p).every((m) => typeof m == "number"))
|
|
1792
|
+
return c;
|
|
1793
|
+
}
|
|
1794
|
+
}, [r]), u = ge(() => {
|
|
1795
|
+
if (!a)
|
|
1796
|
+
return Kt({
|
|
1797
|
+
id: s,
|
|
1798
|
+
panelIds: t,
|
|
1799
|
+
storage: n
|
|
1800
|
+
});
|
|
1801
|
+
}, [a, s, t, n]), f = a ?? u, g = T(null), d = ne(() => {
|
|
1802
|
+
const c = g.current;
|
|
1803
|
+
c && (g.current = null, clearTimeout(c));
|
|
1759
1804
|
}, []);
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
}, [
|
|
1763
|
-
const
|
|
1764
|
-
(
|
|
1765
|
-
|
|
1766
|
-
let
|
|
1767
|
-
i ?
|
|
1805
|
+
We(() => () => {
|
|
1806
|
+
d();
|
|
1807
|
+
}, [d]);
|
|
1808
|
+
const z = ne(
|
|
1809
|
+
(c) => {
|
|
1810
|
+
d();
|
|
1811
|
+
let p;
|
|
1812
|
+
i ? p = de(s, Object.keys(c)) : p = de(s, []);
|
|
1768
1813
|
try {
|
|
1769
|
-
n.setItem(
|
|
1770
|
-
} catch (
|
|
1771
|
-
console.error(
|
|
1814
|
+
n.setItem(p, JSON.stringify(c));
|
|
1815
|
+
} catch (m) {
|
|
1816
|
+
console.error(m);
|
|
1772
1817
|
}
|
|
1773
1818
|
},
|
|
1774
|
-
[
|
|
1775
|
-
),
|
|
1776
|
-
(
|
|
1777
|
-
|
|
1778
|
-
|
|
1819
|
+
[d, i, s, n]
|
|
1820
|
+
), x = ne(
|
|
1821
|
+
(c) => {
|
|
1822
|
+
d(), e === 0 ? z(c) : g.current = setTimeout(() => {
|
|
1823
|
+
z(c);
|
|
1779
1824
|
}, e);
|
|
1780
1825
|
},
|
|
1781
|
-
[
|
|
1826
|
+
[d, e, z]
|
|
1782
1827
|
);
|
|
1783
1828
|
return {
|
|
1784
1829
|
/**
|
|
1785
1830
|
* Pass this value to `Group` as the `defaultLayout` prop.
|
|
1786
1831
|
*/
|
|
1787
|
-
defaultLayout:
|
|
1832
|
+
defaultLayout: f,
|
|
1788
1833
|
/**
|
|
1789
1834
|
* Attach this callback on the `Group` as the `onLayoutChange` prop.
|
|
1790
1835
|
*
|
|
1791
1836
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1792
1837
|
*/
|
|
1793
|
-
onLayoutChange:
|
|
1838
|
+
onLayoutChange: x,
|
|
1794
1839
|
/**
|
|
1795
1840
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1796
1841
|
*/
|
|
1797
|
-
onLayoutChanged:
|
|
1842
|
+
onLayoutChanged: z
|
|
1798
1843
|
};
|
|
1799
1844
|
}
|
|
1800
|
-
function
|
|
1845
|
+
function Xt() {
|
|
1801
1846
|
return function() {
|
|
1802
1847
|
};
|
|
1803
1848
|
}
|
|
1804
|
-
function
|
|
1849
|
+
function rn() {
|
|
1805
1850
|
return re(null);
|
|
1806
1851
|
}
|
|
1807
|
-
function
|
|
1852
|
+
function sn() {
|
|
1808
1853
|
return T(null);
|
|
1809
1854
|
}
|
|
1810
|
-
function
|
|
1855
|
+
function Ce() {
|
|
1811
1856
|
const e = mt(at);
|
|
1812
1857
|
return L(
|
|
1813
1858
|
e,
|
|
1814
1859
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1815
1860
|
), e;
|
|
1816
1861
|
}
|
|
1817
|
-
function
|
|
1818
|
-
const { id: n } =
|
|
1819
|
-
collapse:
|
|
1820
|
-
expand:
|
|
1862
|
+
function qt(e, t) {
|
|
1863
|
+
const { id: n } = Ce(), o = T({
|
|
1864
|
+
collapse: me,
|
|
1865
|
+
expand: me,
|
|
1821
1866
|
getSize: () => ({
|
|
1822
1867
|
asPercentage: 0,
|
|
1823
1868
|
inPixels: 0
|
|
1824
1869
|
}),
|
|
1825
1870
|
isCollapsed: () => !1,
|
|
1826
|
-
resize:
|
|
1871
|
+
resize: me
|
|
1827
1872
|
});
|
|
1828
|
-
|
|
1873
|
+
Ue(t, () => o.current, []), K(() => {
|
|
1829
1874
|
Object.assign(
|
|
1830
1875
|
o.current,
|
|
1831
1876
|
et({ groupId: n, panelId: e })
|
|
1832
1877
|
);
|
|
1833
1878
|
});
|
|
1834
1879
|
}
|
|
1835
|
-
function
|
|
1880
|
+
function Yt({
|
|
1836
1881
|
children: e,
|
|
1837
1882
|
className: t,
|
|
1838
1883
|
collapsedSize: n = "0%",
|
|
@@ -1843,32 +1888,32 @@ function qt({
|
|
|
1843
1888
|
groupResizeBehavior: r = "preserve-relative-size",
|
|
1844
1889
|
id: a,
|
|
1845
1890
|
maxSize: u = "100%",
|
|
1846
|
-
minSize:
|
|
1847
|
-
onResize:
|
|
1891
|
+
minSize: f = "0%",
|
|
1892
|
+
onResize: g,
|
|
1848
1893
|
panelRef: d,
|
|
1849
|
-
style:
|
|
1850
|
-
...
|
|
1894
|
+
style: z,
|
|
1895
|
+
...x
|
|
1851
1896
|
}) {
|
|
1852
|
-
const
|
|
1897
|
+
const c = !!a, p = we(a), m = Le({
|
|
1853
1898
|
disabled: s
|
|
1854
|
-
}),
|
|
1855
|
-
getPanelStyles:
|
|
1856
|
-
id:
|
|
1899
|
+
}), S = T(null), v = Pe(S, l), {
|
|
1900
|
+
getPanelStyles: y,
|
|
1901
|
+
id: h,
|
|
1857
1902
|
orientation: P,
|
|
1858
1903
|
registerPanel: M,
|
|
1859
1904
|
togglePanelDisabled: C
|
|
1860
|
-
} =
|
|
1861
|
-
(R,
|
|
1862
|
-
|
|
1905
|
+
} = Ce(), X = g !== null, F = oe(
|
|
1906
|
+
(R, k, O) => {
|
|
1907
|
+
g?.(R, a, O);
|
|
1863
1908
|
}
|
|
1864
1909
|
);
|
|
1865
1910
|
K(() => {
|
|
1866
|
-
const R =
|
|
1911
|
+
const R = S.current;
|
|
1867
1912
|
if (R !== null) {
|
|
1868
|
-
const
|
|
1913
|
+
const k = {
|
|
1869
1914
|
element: R,
|
|
1870
|
-
id:
|
|
1871
|
-
idIsStable:
|
|
1915
|
+
id: p,
|
|
1916
|
+
idIsStable: c,
|
|
1872
1917
|
mutableValues: {
|
|
1873
1918
|
expandToSize: void 0,
|
|
1874
1919
|
prevSize: void 0
|
|
@@ -1879,12 +1924,12 @@ function qt({
|
|
|
1879
1924
|
collapsedSize: n,
|
|
1880
1925
|
collapsible: o,
|
|
1881
1926
|
defaultSize: i,
|
|
1882
|
-
disabled:
|
|
1927
|
+
disabled: m.disabled,
|
|
1883
1928
|
maxSize: u,
|
|
1884
|
-
minSize:
|
|
1929
|
+
minSize: f
|
|
1885
1930
|
}
|
|
1886
1931
|
};
|
|
1887
|
-
return M(
|
|
1932
|
+
return M(k);
|
|
1888
1933
|
}
|
|
1889
1934
|
}, [
|
|
1890
1935
|
r,
|
|
@@ -1892,24 +1937,24 @@ function qt({
|
|
|
1892
1937
|
o,
|
|
1893
1938
|
i,
|
|
1894
1939
|
X,
|
|
1895
|
-
|
|
1896
|
-
f,
|
|
1897
|
-
u,
|
|
1940
|
+
p,
|
|
1898
1941
|
c,
|
|
1942
|
+
u,
|
|
1943
|
+
f,
|
|
1899
1944
|
F,
|
|
1900
1945
|
M,
|
|
1901
|
-
|
|
1902
|
-
]),
|
|
1903
|
-
C(
|
|
1904
|
-
}, [s,
|
|
1905
|
-
const
|
|
1906
|
-
const R =
|
|
1946
|
+
m
|
|
1947
|
+
]), pe(() => {
|
|
1948
|
+
C(p, !!s);
|
|
1949
|
+
}, [s, p, C]), qt(p, d);
|
|
1950
|
+
const b = () => {
|
|
1951
|
+
const R = y(h, p);
|
|
1907
1952
|
if (R)
|
|
1908
1953
|
return JSON.stringify(R);
|
|
1909
1954
|
}, w = Ke(
|
|
1910
|
-
(R) =>
|
|
1911
|
-
|
|
1912
|
-
|
|
1955
|
+
(R) => ve(h, R),
|
|
1956
|
+
b,
|
|
1957
|
+
b
|
|
1913
1958
|
);
|
|
1914
1959
|
let E;
|
|
1915
1960
|
return w ? E = JSON.parse(w) : i ? E = {
|
|
@@ -1919,14 +1964,14 @@ function qt({
|
|
|
1919
1964
|
} : E = { flexGrow: 1 }, /* @__PURE__ */ ie(
|
|
1920
1965
|
"div",
|
|
1921
1966
|
{
|
|
1922
|
-
...
|
|
1923
|
-
"
|
|
1967
|
+
...x,
|
|
1968
|
+
"data-disabled": s || void 0,
|
|
1924
1969
|
"data-panel": !0,
|
|
1925
|
-
"data-testid":
|
|
1926
|
-
id:
|
|
1927
|
-
ref:
|
|
1970
|
+
"data-testid": p,
|
|
1971
|
+
id: p,
|
|
1972
|
+
ref: v,
|
|
1928
1973
|
style: {
|
|
1929
|
-
...
|
|
1974
|
+
...Jt,
|
|
1930
1975
|
display: "flex",
|
|
1931
1976
|
flexBasis: 0,
|
|
1932
1977
|
flexShrink: 1,
|
|
@@ -1942,7 +1987,7 @@ function qt({
|
|
|
1942
1987
|
maxWidth: "100%",
|
|
1943
1988
|
flexGrow: 1,
|
|
1944
1989
|
overflow: "auto",
|
|
1945
|
-
...
|
|
1990
|
+
...z,
|
|
1946
1991
|
// Inform the browser that the library is handling touch events for this element
|
|
1947
1992
|
// but still allow users to scroll content within panels in the non-resizing direction
|
|
1948
1993
|
// NOTE This is not an inherited style
|
|
@@ -1955,8 +2000,8 @@ function qt({
|
|
|
1955
2000
|
}
|
|
1956
2001
|
);
|
|
1957
2002
|
}
|
|
1958
|
-
|
|
1959
|
-
const
|
|
2003
|
+
Yt.displayName = "Panel";
|
|
2004
|
+
const Jt = {
|
|
1960
2005
|
minHeight: 0,
|
|
1961
2006
|
maxHeight: "100%",
|
|
1962
2007
|
height: "auto",
|
|
@@ -1968,13 +2013,13 @@ const Yt = {
|
|
|
1968
2013
|
padding: 0,
|
|
1969
2014
|
margin: 0
|
|
1970
2015
|
};
|
|
1971
|
-
function
|
|
2016
|
+
function an() {
|
|
1972
2017
|
return re(null);
|
|
1973
2018
|
}
|
|
1974
|
-
function
|
|
2019
|
+
function ln() {
|
|
1975
2020
|
return T(null);
|
|
1976
2021
|
}
|
|
1977
|
-
function
|
|
2022
|
+
function Zt({
|
|
1978
2023
|
layout: e,
|
|
1979
2024
|
panelConstraints: t,
|
|
1980
2025
|
panelId: n,
|
|
@@ -1985,13 +2030,13 @@ function Jt({
|
|
|
1985
2030
|
(a) => a.panelId === n
|
|
1986
2031
|
);
|
|
1987
2032
|
if (r) {
|
|
1988
|
-
const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize,
|
|
2033
|
+
const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
|
|
1989
2034
|
s = B({
|
|
1990
2035
|
layout: se({
|
|
1991
2036
|
delta: u - l,
|
|
1992
2037
|
initialLayout: e,
|
|
1993
2038
|
panelConstraints: t,
|
|
1994
|
-
pivotIndices:
|
|
2039
|
+
pivotIndices: f,
|
|
1995
2040
|
prevLayout: e
|
|
1996
2041
|
}),
|
|
1997
2042
|
panelConstraints: t
|
|
@@ -2000,7 +2045,7 @@ function Jt({
|
|
|
2000
2045
|
delta: a - l,
|
|
2001
2046
|
initialLayout: e,
|
|
2002
2047
|
panelConstraints: t,
|
|
2003
|
-
pivotIndices:
|
|
2048
|
+
pivotIndices: f,
|
|
2004
2049
|
prevLayout: e
|
|
2005
2050
|
}),
|
|
2006
2051
|
panelConstraints: t
|
|
@@ -2013,7 +2058,7 @@ function Jt({
|
|
|
2013
2058
|
valueNow: l
|
|
2014
2059
|
};
|
|
2015
2060
|
}
|
|
2016
|
-
function
|
|
2061
|
+
function Qt({
|
|
2017
2062
|
children: e,
|
|
2018
2063
|
className: t,
|
|
2019
2064
|
disabled: n,
|
|
@@ -2022,42 +2067,42 @@ function Zt({
|
|
|
2022
2067
|
style: s,
|
|
2023
2068
|
...l
|
|
2024
2069
|
}) {
|
|
2025
|
-
const r =
|
|
2070
|
+
const r = we(i), a = Le({
|
|
2026
2071
|
disabled: n
|
|
2027
|
-
}), [u,
|
|
2028
|
-
disableCursor:
|
|
2029
|
-
id:
|
|
2030
|
-
orientation:
|
|
2031
|
-
registerSeparator:
|
|
2032
|
-
toggleSeparatorDisabled:
|
|
2033
|
-
} =
|
|
2072
|
+
}), [u, f] = re({}), [g, d] = re("inactive"), z = T(null), x = Pe(z, o), {
|
|
2073
|
+
disableCursor: c,
|
|
2074
|
+
id: p,
|
|
2075
|
+
orientation: m,
|
|
2076
|
+
registerSeparator: S,
|
|
2077
|
+
toggleSeparatorDisabled: v
|
|
2078
|
+
} = Ce(), y = m === "horizontal" ? "vertical" : "horizontal";
|
|
2034
2079
|
K(() => {
|
|
2035
|
-
const P =
|
|
2080
|
+
const P = z.current;
|
|
2036
2081
|
if (P !== null) {
|
|
2037
2082
|
const M = {
|
|
2038
2083
|
disabled: a.disabled,
|
|
2039
2084
|
element: P,
|
|
2040
2085
|
id: r
|
|
2041
|
-
}, C =
|
|
2042
|
-
(
|
|
2086
|
+
}, C = S(M), X = Gt(
|
|
2087
|
+
(b) => {
|
|
2043
2088
|
d(
|
|
2044
|
-
|
|
2089
|
+
b.next.state !== "inactive" && b.next.hitRegions.some(
|
|
2045
2090
|
(w) => w.separator === M
|
|
2046
|
-
) ?
|
|
2091
|
+
) ? b.next.state : "inactive"
|
|
2047
2092
|
);
|
|
2048
2093
|
}
|
|
2049
|
-
), F =
|
|
2050
|
-
|
|
2051
|
-
(
|
|
2052
|
-
const { derivedPanelConstraints: w, layout: E, separatorToPanels: R } =
|
|
2053
|
-
if (
|
|
2054
|
-
const O =
|
|
2055
|
-
|
|
2056
|
-
|
|
2094
|
+
), F = ve(
|
|
2095
|
+
p,
|
|
2096
|
+
(b) => {
|
|
2097
|
+
const { derivedPanelConstraints: w, layout: E, separatorToPanels: R } = b.next, k = R.get(M);
|
|
2098
|
+
if (k) {
|
|
2099
|
+
const O = k[0], j = k.indexOf(O);
|
|
2100
|
+
f(
|
|
2101
|
+
Zt({
|
|
2057
2102
|
layout: E,
|
|
2058
2103
|
panelConstraints: w,
|
|
2059
2104
|
panelId: O.id,
|
|
2060
|
-
panelIndex:
|
|
2105
|
+
panelIndex: j
|
|
2061
2106
|
})
|
|
2062
2107
|
);
|
|
2063
2108
|
}
|
|
@@ -2067,30 +2112,30 @@ function Zt({
|
|
|
2067
2112
|
X(), F(), C();
|
|
2068
2113
|
};
|
|
2069
2114
|
}
|
|
2070
|
-
}, [
|
|
2071
|
-
|
|
2072
|
-
}, [n, r,
|
|
2073
|
-
let
|
|
2074
|
-
return n && !
|
|
2115
|
+
}, [p, r, S, a]), pe(() => {
|
|
2116
|
+
v(r, !!n);
|
|
2117
|
+
}, [n, r, v]);
|
|
2118
|
+
let h;
|
|
2119
|
+
return n && !c && (h = "not-allowed"), /* @__PURE__ */ ie(
|
|
2075
2120
|
"div",
|
|
2076
2121
|
{
|
|
2077
2122
|
...l,
|
|
2078
2123
|
"aria-controls": u.valueControls,
|
|
2079
2124
|
"aria-disabled": n || void 0,
|
|
2080
|
-
"aria-orientation":
|
|
2125
|
+
"aria-orientation": y,
|
|
2081
2126
|
"aria-valuemax": u.valueMax,
|
|
2082
2127
|
"aria-valuemin": u.valueMin,
|
|
2083
2128
|
"aria-valuenow": u.valueNow,
|
|
2084
2129
|
children: e,
|
|
2085
2130
|
className: t,
|
|
2086
|
-
"data-separator": n ? "disabled" :
|
|
2131
|
+
"data-separator": n ? "disabled" : g,
|
|
2087
2132
|
"data-testid": r,
|
|
2088
2133
|
id: r,
|
|
2089
|
-
ref:
|
|
2134
|
+
ref: x,
|
|
2090
2135
|
role: "separator",
|
|
2091
2136
|
style: {
|
|
2092
2137
|
flexBasis: "auto",
|
|
2093
|
-
cursor:
|
|
2138
|
+
cursor: h,
|
|
2094
2139
|
...s,
|
|
2095
2140
|
flexGrow: 0,
|
|
2096
2141
|
flexShrink: 0,
|
|
@@ -2102,16 +2147,16 @@ function Zt({
|
|
|
2102
2147
|
}
|
|
2103
2148
|
);
|
|
2104
2149
|
}
|
|
2105
|
-
|
|
2150
|
+
Qt.displayName = "Separator";
|
|
2106
2151
|
export {
|
|
2107
2152
|
Ut as Group,
|
|
2108
|
-
|
|
2109
|
-
|
|
2153
|
+
Yt as Panel,
|
|
2154
|
+
Qt as Separator,
|
|
2110
2155
|
Pt as isCoarsePointer,
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2156
|
+
on as useDefaultLayout,
|
|
2157
|
+
rn as useGroupCallbackRef,
|
|
2158
|
+
sn as useGroupRef,
|
|
2159
|
+
an as usePanelCallbackRef,
|
|
2160
|
+
ln as usePanelRef
|
|
2116
2161
|
};
|
|
2117
2162
|
//# sourceMappingURL=react-resizable-panels.js.map
|