react-resizable-panels 4.3.0 → 4.3.1
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.
|
@@ -5,7 +5,7 @@ function z(e, t = "Assertion error") {
|
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function W({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
@@ -48,27 +48,27 @@ function et({
|
|
|
48
48
|
x: n.x + n.width / 2,
|
|
49
49
|
y: n.y + n.height / 2
|
|
50
50
|
};
|
|
51
|
-
let i,
|
|
51
|
+
let i, a = Number.MAX_VALUE;
|
|
52
52
|
for (const l of t) {
|
|
53
|
-
const { x: r, y:
|
|
54
|
-
u <
|
|
53
|
+
const { x: r, y: s } = Ee(o, l), u = e === "horizontal" ? r : s;
|
|
54
|
+
u < a && (a = u, i = l);
|
|
55
55
|
}
|
|
56
56
|
return z(i, "No rect found"), i;
|
|
57
57
|
}
|
|
58
58
|
function Ie(e) {
|
|
59
|
-
const { element: t, orientation: n, panels: o, separators: i } = e,
|
|
59
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, a = ie(
|
|
60
60
|
n,
|
|
61
61
|
Array.from(t.children).filter(Me).map((f) => ({ element: f }))
|
|
62
62
|
).map(({ element: f }) => f), l = [];
|
|
63
|
-
let r = !1,
|
|
64
|
-
for (const f of
|
|
63
|
+
let r = !1, s, u = [];
|
|
64
|
+
for (const f of a)
|
|
65
65
|
if (f.hasAttribute("data-panel")) {
|
|
66
66
|
const p = o.find(
|
|
67
67
|
(m) => m.element === f
|
|
68
68
|
);
|
|
69
69
|
if (p) {
|
|
70
|
-
if (
|
|
71
|
-
const m =
|
|
70
|
+
if (s) {
|
|
71
|
+
const m = s.element.getBoundingClientRect(), h = f.getBoundingClientRect();
|
|
72
72
|
let c;
|
|
73
73
|
if (r) {
|
|
74
74
|
const d = n === "horizontal" ? new DOMRect(m.right, m.top, 0, m.height) : new DOMRect(
|
|
@@ -119,19 +119,19 @@ function Ie(e) {
|
|
|
119
119
|
for (const d of c)
|
|
120
120
|
l.push({
|
|
121
121
|
group: e,
|
|
122
|
-
groupSize:
|
|
123
|
-
panels: [
|
|
122
|
+
groupSize: W({ group: e }),
|
|
123
|
+
panels: [s, p],
|
|
124
124
|
separator: "width" in d ? void 0 : d,
|
|
125
125
|
rect: "width" in d ? d : d.element.getBoundingClientRect()
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
r = !1,
|
|
128
|
+
r = !1, s = p, u = [];
|
|
129
129
|
}
|
|
130
130
|
} else if (f.hasAttribute("data-separator")) {
|
|
131
131
|
const p = i.find(
|
|
132
132
|
(m) => m.element === f
|
|
133
133
|
);
|
|
134
|
-
p ? u.push(p) : (
|
|
134
|
+
p ? u.push(p) : (s = void 0, u = []);
|
|
135
135
|
} else
|
|
136
136
|
r = !0;
|
|
137
137
|
return l;
|
|
@@ -166,8 +166,8 @@ function Q({
|
|
|
166
166
|
styleProp: n
|
|
167
167
|
}) {
|
|
168
168
|
let o;
|
|
169
|
-
const [i,
|
|
170
|
-
switch (
|
|
169
|
+
const [i, a] = it(n);
|
|
170
|
+
switch (a) {
|
|
171
171
|
case "%": {
|
|
172
172
|
o = i / 100 * e;
|
|
173
173
|
break;
|
|
@@ -199,7 +199,7 @@ function G(e) {
|
|
|
199
199
|
return parseFloat(e.toFixed(3));
|
|
200
200
|
}
|
|
201
201
|
function pe(e) {
|
|
202
|
-
const { panels: t } = e, n =
|
|
202
|
+
const { panels: t } = e, n = W({ group: e });
|
|
203
203
|
return n === 0 ? t.map((o) => ({
|
|
204
204
|
collapsedSize: 0,
|
|
205
205
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -208,48 +208,48 @@ function pe(e) {
|
|
|
208
208
|
maxSize: 100,
|
|
209
209
|
panelId: o.id
|
|
210
210
|
})) : t.map((o) => {
|
|
211
|
-
const { element: i, panelConstraints:
|
|
211
|
+
const { element: i, panelConstraints: a } = o;
|
|
212
212
|
let l = 0;
|
|
213
|
-
if (
|
|
213
|
+
if (a.collapsedSize) {
|
|
214
214
|
const f = Q({
|
|
215
215
|
groupSize: n,
|
|
216
216
|
panelElement: i,
|
|
217
|
-
styleProp:
|
|
217
|
+
styleProp: a.collapsedSize
|
|
218
218
|
});
|
|
219
219
|
l = G(f / n * 100);
|
|
220
220
|
}
|
|
221
221
|
let r;
|
|
222
|
-
if (
|
|
222
|
+
if (a.defaultSize) {
|
|
223
223
|
const f = Q({
|
|
224
224
|
groupSize: n,
|
|
225
225
|
panelElement: i,
|
|
226
|
-
styleProp:
|
|
226
|
+
styleProp: a.defaultSize
|
|
227
227
|
});
|
|
228
228
|
r = G(f / n * 100);
|
|
229
229
|
}
|
|
230
|
-
let
|
|
231
|
-
if (
|
|
230
|
+
let s = 0;
|
|
231
|
+
if (a.minSize) {
|
|
232
232
|
const f = Q({
|
|
233
233
|
groupSize: n,
|
|
234
234
|
panelElement: i,
|
|
235
|
-
styleProp:
|
|
235
|
+
styleProp: a.minSize
|
|
236
236
|
});
|
|
237
|
-
|
|
237
|
+
s = G(f / n * 100);
|
|
238
238
|
}
|
|
239
239
|
let u = 100;
|
|
240
|
-
if (
|
|
240
|
+
if (a.maxSize) {
|
|
241
241
|
const f = Q({
|
|
242
242
|
groupSize: n,
|
|
243
243
|
panelElement: i,
|
|
244
|
-
styleProp:
|
|
244
|
+
styleProp: a.maxSize
|
|
245
245
|
});
|
|
246
246
|
u = G(f / n * 100);
|
|
247
247
|
}
|
|
248
248
|
return {
|
|
249
249
|
collapsedSize: l,
|
|
250
|
-
collapsible:
|
|
250
|
+
collapsible: a.collapsible === !0,
|
|
251
251
|
defaultSize: r,
|
|
252
|
-
minSize:
|
|
252
|
+
minSize: s,
|
|
253
253
|
maxSize: u,
|
|
254
254
|
panelId: o.id
|
|
255
255
|
};
|
|
@@ -269,18 +269,18 @@ class st {
|
|
|
269
269
|
if (o.length === 1)
|
|
270
270
|
o[0].call(null, n);
|
|
271
271
|
else {
|
|
272
|
-
let i = !1,
|
|
272
|
+
let i = !1, a = null;
|
|
273
273
|
const l = Array.from(o);
|
|
274
274
|
for (let r = 0; r < l.length; r++) {
|
|
275
|
-
const
|
|
275
|
+
const s = l[r];
|
|
276
276
|
try {
|
|
277
|
-
|
|
277
|
+
s.call(null, n);
|
|
278
278
|
} catch (u) {
|
|
279
|
-
|
|
279
|
+
a === null && (i = !0, a = u);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
if (i)
|
|
283
|
-
throw
|
|
283
|
+
throw a;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
removeAllListeners() {
|
|
@@ -304,7 +304,7 @@ let M = {
|
|
|
304
304
|
},
|
|
305
305
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
306
306
|
};
|
|
307
|
-
const
|
|
307
|
+
const T = new st();
|
|
308
308
|
function D() {
|
|
309
309
|
return M;
|
|
310
310
|
}
|
|
@@ -316,23 +316,23 @@ function I(e) {
|
|
|
316
316
|
return M = {
|
|
317
317
|
...M,
|
|
318
318
|
...t
|
|
319
|
-
}, t.cursorFlags !== void 0 &&
|
|
320
|
-
o.derivedPanelConstraints.forEach((
|
|
321
|
-
if (
|
|
319
|
+
}, t.cursorFlags !== void 0 && T.emit("cursorFlagsChange", M.cursorFlags), t.interactionState !== void 0 && T.emit("interactionStateChange", M.interactionState), t.mountedGroups !== void 0 && (M.mountedGroups.forEach((o, i) => {
|
|
320
|
+
o.derivedPanelConstraints.forEach((a) => {
|
|
321
|
+
if (a.collapsible) {
|
|
322
322
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
323
323
|
if (l) {
|
|
324
324
|
const r = R(
|
|
325
|
-
|
|
326
|
-
o.layout[
|
|
327
|
-
),
|
|
328
|
-
|
|
329
|
-
l[
|
|
325
|
+
a.collapsedSize,
|
|
326
|
+
o.layout[a.panelId]
|
|
327
|
+
), s = R(
|
|
328
|
+
a.collapsedSize,
|
|
329
|
+
l[a.panelId]
|
|
330
330
|
);
|
|
331
|
-
r && !
|
|
331
|
+
r && !s && (i.inMemoryLastExpandedPanelSizes[a.panelId] = l[a.panelId]);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
-
}),
|
|
335
|
+
}), T.emit("mountedGroupsChange", M.mountedGroups)), M;
|
|
336
336
|
}
|
|
337
337
|
function at(e, t) {
|
|
338
338
|
if (e.length !== t.length)
|
|
@@ -353,14 +353,14 @@ function H({
|
|
|
353
353
|
collapsedSize: n = 0,
|
|
354
354
|
collapsible: o,
|
|
355
355
|
maxSize: i = 100,
|
|
356
|
-
minSize:
|
|
356
|
+
minSize: a = 0
|
|
357
357
|
} = e;
|
|
358
|
-
if (Y(t,
|
|
358
|
+
if (Y(t, a) < 0)
|
|
359
359
|
if (o) {
|
|
360
|
-
const l = (n +
|
|
361
|
-
Y(t, l) < 0 ? t = n : t =
|
|
360
|
+
const l = (n + a) / 2;
|
|
361
|
+
Y(t, l) < 0 ? t = n : t = a;
|
|
362
362
|
} else
|
|
363
|
-
t =
|
|
363
|
+
t = a;
|
|
364
364
|
return t = Math.min(i, t), t = G(t), t;
|
|
365
365
|
}
|
|
366
366
|
function Z({
|
|
@@ -369,14 +369,14 @@ function Z({
|
|
|
369
369
|
panelConstraints: n,
|
|
370
370
|
pivotIndices: o,
|
|
371
371
|
prevLayout: i,
|
|
372
|
-
trigger:
|
|
372
|
+
trigger: a
|
|
373
373
|
}) {
|
|
374
374
|
if (R(e, 0))
|
|
375
375
|
return t;
|
|
376
|
-
const l = Object.values(t), r = Object.values(i),
|
|
376
|
+
const l = Object.values(t), r = Object.values(i), s = [...l], [u, f] = o;
|
|
377
377
|
z(u != null, "Invalid first pivot index"), z(f != null, "Invalid second pivot index");
|
|
378
378
|
let p = 0;
|
|
379
|
-
if (
|
|
379
|
+
if (a === "keyboard") {
|
|
380
380
|
{
|
|
381
381
|
const c = e < 0 ? f : u, d = n[c];
|
|
382
382
|
z(
|
|
@@ -453,14 +453,14 @@ function Z({
|
|
|
453
453
|
panelConstraints: n[d],
|
|
454
454
|
size: v
|
|
455
455
|
});
|
|
456
|
-
if (!R(g, x) && (p += g - x,
|
|
456
|
+
if (!R(g, x) && (p += g - x, s[d] = x, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
457
457
|
numeric: !0
|
|
458
458
|
}) >= 0))
|
|
459
459
|
break;
|
|
460
460
|
e < 0 ? d-- : d++;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
if (at(r,
|
|
463
|
+
if (at(r, s))
|
|
464
464
|
return i;
|
|
465
465
|
{
|
|
466
466
|
const c = e < 0 ? f : u, d = l[c];
|
|
@@ -472,10 +472,10 @@ function Z({
|
|
|
472
472
|
panelConstraints: n[c],
|
|
473
473
|
size: y
|
|
474
474
|
});
|
|
475
|
-
if (
|
|
475
|
+
if (s[c] = g, !R(g, y)) {
|
|
476
476
|
let v = y - g, S = e < 0 ? f : u;
|
|
477
477
|
for (; S >= 0 && S < n.length; ) {
|
|
478
|
-
const b =
|
|
478
|
+
const b = s[S];
|
|
479
479
|
z(
|
|
480
480
|
b != null,
|
|
481
481
|
`Previous layout not found for panel index ${S}`
|
|
@@ -484,20 +484,20 @@ function Z({
|
|
|
484
484
|
panelConstraints: n[S],
|
|
485
485
|
size: w
|
|
486
486
|
});
|
|
487
|
-
if (R(b, C) || (v -= C - b,
|
|
487
|
+
if (R(b, C) || (v -= C - b, s[S] = C), R(v, 0))
|
|
488
488
|
break;
|
|
489
489
|
e > 0 ? S-- : S++;
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
const m = Object.values(
|
|
493
|
+
const m = Object.values(s).reduce(
|
|
494
494
|
(c, d) => d + c,
|
|
495
495
|
0
|
|
496
496
|
);
|
|
497
497
|
if (!R(m, 100, 0.1))
|
|
498
498
|
return i;
|
|
499
499
|
const h = Object.keys(i);
|
|
500
|
-
return
|
|
500
|
+
return s.reduce((c, d, y) => (c[h[y]] = d, c), {});
|
|
501
501
|
}
|
|
502
502
|
function te(e) {
|
|
503
503
|
const { mountedGroups: t } = D();
|
|
@@ -508,7 +508,7 @@ function te(e) {
|
|
|
508
508
|
return n;
|
|
509
509
|
throw Error("Could not find parent Group for separator element");
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function B(e, t) {
|
|
512
512
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
513
513
|
return !1;
|
|
514
514
|
for (const n in e)
|
|
@@ -521,7 +521,7 @@ function _({
|
|
|
521
521
|
panelConstraints: t
|
|
522
522
|
}) {
|
|
523
523
|
const o = [...Object.values(e)], i = o.reduce(
|
|
524
|
-
(r,
|
|
524
|
+
(r, s) => r + s,
|
|
525
525
|
0
|
|
526
526
|
);
|
|
527
527
|
if (o.length !== t.length)
|
|
@@ -530,34 +530,34 @@ function _({
|
|
|
530
530
|
);
|
|
531
531
|
if (!R(i, 100) && o.length > 0)
|
|
532
532
|
for (let r = 0; r < t.length; r++) {
|
|
533
|
-
const
|
|
534
|
-
z(
|
|
535
|
-
const u = 100 / i *
|
|
533
|
+
const s = o[r];
|
|
534
|
+
z(s != null, `No layout data found for index ${r}`);
|
|
535
|
+
const u = 100 / i * s;
|
|
536
536
|
o[r] = u;
|
|
537
537
|
}
|
|
538
|
-
let
|
|
538
|
+
let a = 0;
|
|
539
539
|
for (let r = 0; r < t.length; r++) {
|
|
540
|
-
const
|
|
541
|
-
z(
|
|
540
|
+
const s = o[r];
|
|
541
|
+
z(s != null, `No layout data found for index ${r}`);
|
|
542
542
|
const u = H({
|
|
543
543
|
panelConstraints: t[r],
|
|
544
|
-
size:
|
|
544
|
+
size: s
|
|
545
545
|
});
|
|
546
|
-
|
|
546
|
+
s != u && (a += s - u, o[r] = u);
|
|
547
547
|
}
|
|
548
|
-
if (!R(
|
|
548
|
+
if (!R(a, 0))
|
|
549
549
|
for (let r = 0; r < t.length; r++) {
|
|
550
|
-
const
|
|
551
|
-
z(
|
|
552
|
-
const u =
|
|
550
|
+
const s = o[r];
|
|
551
|
+
z(s != null, `No layout data found for index ${r}`);
|
|
552
|
+
const u = s + a, f = H({
|
|
553
553
|
panelConstraints: t[r],
|
|
554
554
|
size: u
|
|
555
555
|
});
|
|
556
|
-
if (
|
|
556
|
+
if (s !== f && (a -= f - s, o[r] = f, R(a, 0)))
|
|
557
557
|
break;
|
|
558
558
|
}
|
|
559
559
|
const l = Object.keys(e);
|
|
560
|
-
return o.reduce((r,
|
|
560
|
+
return o.reduce((r, s, u) => (r[l[u]] = s, r), {});
|
|
561
561
|
}
|
|
562
562
|
function ke({
|
|
563
563
|
groupId: e
|
|
@@ -578,21 +578,21 @@ function ke({
|
|
|
578
578
|
const {
|
|
579
579
|
defaultLayoutDeferred: o,
|
|
580
580
|
derivedPanelConstraints: i,
|
|
581
|
-
group:
|
|
581
|
+
group: a,
|
|
582
582
|
layout: l,
|
|
583
583
|
separatorToPanels: r
|
|
584
|
-
} = t(),
|
|
584
|
+
} = t(), s = _({
|
|
585
585
|
layout: n,
|
|
586
586
|
panelConstraints: i
|
|
587
587
|
});
|
|
588
|
-
return o ? l : (
|
|
589
|
-
mountedGroups: new Map(u.mountedGroups).set(
|
|
588
|
+
return o ? l : (B(l, s) || I((u) => ({
|
|
589
|
+
mountedGroups: new Map(u.mountedGroups).set(a, {
|
|
590
590
|
defaultLayoutDeferred: o,
|
|
591
591
|
derivedPanelConstraints: i,
|
|
592
|
-
layout:
|
|
592
|
+
layout: s,
|
|
593
593
|
separatorToPanels: r
|
|
594
594
|
})
|
|
595
|
-
})),
|
|
595
|
+
})), s);
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
598
|
}
|
|
@@ -600,25 +600,25 @@ function Ge(e) {
|
|
|
600
600
|
const { mountedGroups: t } = D(), n = t.get(e);
|
|
601
601
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function O(e, t) {
|
|
604
604
|
const n = te(e), o = Ge(n), i = n.separators.find(
|
|
605
605
|
(p) => p.element === e
|
|
606
606
|
);
|
|
607
607
|
z(i, "Matching separator not found");
|
|
608
|
-
const
|
|
609
|
-
z(
|
|
610
|
-
const l =
|
|
608
|
+
const a = o.separatorToPanels.get(i);
|
|
609
|
+
z(a, "Matching panels not found");
|
|
610
|
+
const l = a.map((p) => n.panels.indexOf(p)), s = ke({ groupId: n.id }).getLayout(), u = Z({
|
|
611
611
|
delta: t,
|
|
612
|
-
initialLayout:
|
|
612
|
+
initialLayout: s,
|
|
613
613
|
panelConstraints: o.derivedPanelConstraints,
|
|
614
614
|
pivotIndices: l,
|
|
615
|
-
prevLayout:
|
|
615
|
+
prevLayout: s,
|
|
616
616
|
trigger: "keyboard"
|
|
617
617
|
}), f = _({
|
|
618
618
|
layout: u,
|
|
619
619
|
panelConstraints: o.derivedPanelConstraints
|
|
620
620
|
});
|
|
621
|
-
|
|
621
|
+
B(s, f) || I((p) => ({
|
|
622
622
|
mountedGroups: new Map(p.mountedGroups).set(n, {
|
|
623
623
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
624
624
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -634,62 +634,62 @@ function me(e) {
|
|
|
634
634
|
if (!n.disabled)
|
|
635
635
|
switch (e.key) {
|
|
636
636
|
case "ArrowDown": {
|
|
637
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
637
|
+
e.preventDefault(), n.orientation === "vertical" && O(t, 5);
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
640
|
case "ArrowLeft": {
|
|
641
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
641
|
+
e.preventDefault(), n.orientation === "horizontal" && O(t, -5);
|
|
642
642
|
break;
|
|
643
643
|
}
|
|
644
644
|
case "ArrowRight": {
|
|
645
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
645
|
+
e.preventDefault(), n.orientation === "horizontal" && O(t, 5);
|
|
646
646
|
break;
|
|
647
647
|
}
|
|
648
648
|
case "ArrowUp": {
|
|
649
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
649
|
+
e.preventDefault(), n.orientation === "vertical" && O(t, -5);
|
|
650
650
|
break;
|
|
651
651
|
}
|
|
652
652
|
case "End": {
|
|
653
|
-
e.preventDefault(),
|
|
653
|
+
e.preventDefault(), O(t, 100);
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
656
|
case "Enter": {
|
|
657
657
|
e.preventDefault();
|
|
658
|
-
const o = te(t), { derivedPanelConstraints: i, layout:
|
|
658
|
+
const o = te(t), { derivedPanelConstraints: i, layout: a, separatorToPanels: l } = Ge(o), r = o.separators.find(
|
|
659
659
|
(p) => p.element === t
|
|
660
660
|
);
|
|
661
661
|
z(r, "Matching separator not found");
|
|
662
|
-
const
|
|
663
|
-
z(
|
|
664
|
-
const u =
|
|
662
|
+
const s = l.get(r);
|
|
663
|
+
z(s, "Matching panels not found");
|
|
664
|
+
const u = s[0], f = i.find(
|
|
665
665
|
(p) => p.panelId === u.id
|
|
666
666
|
);
|
|
667
667
|
if (z(f, "Panel metadata not found"), f.collapsible) {
|
|
668
|
-
const p =
|
|
669
|
-
|
|
668
|
+
const p = a[u.id], m = f.collapsedSize === p ? o.inMemoryLastExpandedPanelSizes[u.id] ?? f.minSize : f.collapsedSize;
|
|
669
|
+
O(t, m - p);
|
|
670
670
|
}
|
|
671
671
|
break;
|
|
672
672
|
}
|
|
673
673
|
case "F6": {
|
|
674
674
|
e.preventDefault();
|
|
675
675
|
const i = te(t).separators.map(
|
|
676
|
-
(
|
|
677
|
-
),
|
|
678
|
-
(
|
|
676
|
+
(s) => s.element
|
|
677
|
+
), a = Array.from(i).findIndex(
|
|
678
|
+
(s) => s === e.currentTarget
|
|
679
679
|
);
|
|
680
|
-
z(
|
|
681
|
-
const l = e.shiftKey ?
|
|
680
|
+
z(a !== null, "Index not found");
|
|
681
|
+
const l = e.shiftKey ? a > 0 ? a - 1 : i.length - 1 : a + 1 < i.length ? a + 1 : 0;
|
|
682
682
|
i[l].focus();
|
|
683
683
|
break;
|
|
684
684
|
}
|
|
685
685
|
case "Home": {
|
|
686
|
-
e.preventDefault(),
|
|
686
|
+
e.preventDefault(), O(t, -100);
|
|
687
687
|
break;
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
const lt = (e) => e, ne = () => {
|
|
692
|
-
}, De = 1,
|
|
692
|
+
}, De = 1, Oe = 2, Te = 4, Ne = 8, he = {
|
|
693
693
|
coarse: 10,
|
|
694
694
|
precise: 5
|
|
695
695
|
};
|
|
@@ -698,15 +698,15 @@ function ut(e, t, n) {
|
|
|
698
698
|
x: 1 / 0,
|
|
699
699
|
y: 1 / 0
|
|
700
700
|
};
|
|
701
|
-
for (const
|
|
702
|
-
const l = Ee(n,
|
|
701
|
+
for (const a of t) {
|
|
702
|
+
const l = Ee(n, a.rect);
|
|
703
703
|
switch (e) {
|
|
704
704
|
case "horizontal": {
|
|
705
|
-
l.x <= i.x && (o =
|
|
705
|
+
l.x <= i.x && (o = a, i = l);
|
|
706
706
|
break;
|
|
707
707
|
}
|
|
708
708
|
case "vertical": {
|
|
709
|
-
l.y <= i.y && (o =
|
|
709
|
+
l.y <= i.y && (o = a, i = l);
|
|
710
710
|
break;
|
|
711
711
|
}
|
|
712
712
|
}
|
|
@@ -741,15 +741,15 @@ function dt(e, t) {
|
|
|
741
741
|
b: ge(ye(n.b))
|
|
742
742
|
};
|
|
743
743
|
if (i.a === i.b) {
|
|
744
|
-
const
|
|
744
|
+
const a = o.childNodes, l = {
|
|
745
745
|
a: n.a.at(-1),
|
|
746
746
|
b: n.b.at(-1)
|
|
747
747
|
};
|
|
748
|
-
let r =
|
|
748
|
+
let r = a.length;
|
|
749
749
|
for (; r--; ) {
|
|
750
|
-
const
|
|
751
|
-
if (
|
|
752
|
-
if (
|
|
750
|
+
const s = a[r];
|
|
751
|
+
if (s === l.a) return 1;
|
|
752
|
+
if (s === l.b) return -1;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
return Math.sign(i.a - i.b);
|
|
@@ -811,11 +811,11 @@ function Ae(e, t) {
|
|
|
811
811
|
return t.forEach((o, i) => {
|
|
812
812
|
if (i.disabled)
|
|
813
813
|
return;
|
|
814
|
-
const
|
|
814
|
+
const a = ct() ? he.coarse : he.precise, l = Ie(i), r = ut(i.orientation, l, {
|
|
815
815
|
x: e.clientX,
|
|
816
816
|
y: e.clientY
|
|
817
817
|
});
|
|
818
|
-
r && r.distance.x <=
|
|
818
|
+
r && r.distance.x <= a && r.distance.y <= a && gt({
|
|
819
819
|
groupElement: i.element,
|
|
820
820
|
hitRegion: r.hitRegion.rect,
|
|
821
821
|
pointerEventTarget: e.target
|
|
@@ -827,14 +827,14 @@ function ve(e) {
|
|
|
827
827
|
return;
|
|
828
828
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
829
829
|
return;
|
|
830
|
-
const { mountedGroups: t } = D(), n = Ae(e, t), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
830
|
+
const { mountedGroups: t } = D(), n = Ae(e, t), o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
|
|
831
831
|
let r = !1;
|
|
832
|
-
n.forEach((
|
|
833
|
-
o.add(
|
|
832
|
+
n.forEach((s) => {
|
|
833
|
+
o.add(s.group), s.panels.forEach((f) => {
|
|
834
834
|
i.add(f);
|
|
835
|
-
}),
|
|
836
|
-
const u = t.get(
|
|
837
|
-
u && l.set(
|
|
835
|
+
}), s.separator && (a.add(s.separator), r || (r = !0, s.separator.element.focus()));
|
|
836
|
+
const u = t.get(s.group);
|
|
837
|
+
u && l.set(s.group, u.layout);
|
|
838
838
|
}), I({
|
|
839
839
|
interactionState: {
|
|
840
840
|
hitRegions: n,
|
|
@@ -853,9 +853,9 @@ function St({
|
|
|
853
853
|
switch (n) {
|
|
854
854
|
case "active":
|
|
855
855
|
case "hover":
|
|
856
|
-
t.forEach((
|
|
857
|
-
if (!
|
|
858
|
-
switch (
|
|
856
|
+
t.forEach((a) => {
|
|
857
|
+
if (!a.disableCursor)
|
|
858
|
+
switch (a.orientation) {
|
|
859
859
|
case "horizontal": {
|
|
860
860
|
o++;
|
|
861
861
|
break;
|
|
@@ -871,15 +871,15 @@ function St({
|
|
|
871
871
|
return null;
|
|
872
872
|
switch (n) {
|
|
873
873
|
case "active": {
|
|
874
|
-
const
|
|
874
|
+
const a = (e & De) !== 0, l = (e & Oe) !== 0, r = (e & Te) !== 0, s = (e & Ne) !== 0;
|
|
875
875
|
if (e) {
|
|
876
|
-
if (
|
|
877
|
-
return r ? "se-resize" :
|
|
876
|
+
if (a)
|
|
877
|
+
return r ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
878
878
|
if (l)
|
|
879
|
-
return r ? "sw-resize" :
|
|
879
|
+
return r ? "sw-resize" : s ? "nw-resize" : "w-resize";
|
|
880
880
|
if (r)
|
|
881
881
|
return "s-resize";
|
|
882
|
-
if (
|
|
882
|
+
if (s)
|
|
883
883
|
return "n-resize";
|
|
884
884
|
}
|
|
885
885
|
break;
|
|
@@ -897,14 +897,14 @@ function se(e) {
|
|
|
897
897
|
switch (i.state) {
|
|
898
898
|
case "active":
|
|
899
899
|
case "hover": {
|
|
900
|
-
const
|
|
900
|
+
const a = St({
|
|
901
901
|
cursorFlags: o,
|
|
902
902
|
groups: i.hitRegions.map((r) => r.group),
|
|
903
903
|
state: i.state
|
|
904
|
-
}), l = `*{cursor: ${
|
|
904
|
+
}), l = `*{cursor: ${a} !important; ${i.state === "active" ? "touch-action: none;" : ""} }`;
|
|
905
905
|
if (t === l)
|
|
906
906
|
return;
|
|
907
|
-
t = l,
|
|
907
|
+
t = l, a ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
908
908
|
break;
|
|
909
909
|
}
|
|
910
910
|
case "inactive": {
|
|
@@ -923,14 +923,14 @@ function $e({
|
|
|
923
923
|
hitRegions: n,
|
|
924
924
|
initialLayoutMap: o,
|
|
925
925
|
mountedGroups: i,
|
|
926
|
-
pointerDownAtPoint:
|
|
926
|
+
pointerDownAtPoint: a
|
|
927
927
|
}) {
|
|
928
928
|
let l = 0;
|
|
929
929
|
const r = new Map(i);
|
|
930
|
-
n.forEach((
|
|
931
|
-
const { group: u, groupSize: f } =
|
|
930
|
+
n.forEach((s) => {
|
|
931
|
+
const { group: u, groupSize: f } = s, { disableCursor: p, orientation: m, panels: h } = u;
|
|
932
932
|
let c = 0;
|
|
933
|
-
|
|
933
|
+
a ? m === "horizontal" ? c = (t.clientX - a.x) / f * 100 : c = (t.clientY - a.y) / f * 100 : m === "horizontal" ? c = t.clientX < 0 ? -100 : 100 : c = t.clientY < 0 ? -100 : 100;
|
|
934
934
|
const d = o.get(u), {
|
|
935
935
|
defaultLayoutDeferred: y,
|
|
936
936
|
derivedPanelConstraints: g,
|
|
@@ -942,31 +942,31 @@ function $e({
|
|
|
942
942
|
delta: c,
|
|
943
943
|
initialLayout: d,
|
|
944
944
|
panelConstraints: g,
|
|
945
|
-
pivotIndices:
|
|
945
|
+
pivotIndices: s.panels.map((b) => h.indexOf(b)),
|
|
946
946
|
prevLayout: v,
|
|
947
947
|
trigger: "mouse-or-touch"
|
|
948
948
|
});
|
|
949
|
-
if (
|
|
949
|
+
if (B(S, v)) {
|
|
950
950
|
if (c !== 0 && !p)
|
|
951
951
|
switch (m) {
|
|
952
952
|
case "horizontal": {
|
|
953
|
-
l |= c < 0 ? De :
|
|
953
|
+
l |= c < 0 ? De : Oe;
|
|
954
954
|
break;
|
|
955
955
|
}
|
|
956
956
|
case "vertical": {
|
|
957
|
-
l |= c < 0 ?
|
|
957
|
+
l |= c < 0 ? Te : Ne;
|
|
958
958
|
break;
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
} else {
|
|
962
|
-
r.set(
|
|
962
|
+
r.set(s.group, {
|
|
963
963
|
defaultLayoutDeferred: y,
|
|
964
964
|
derivedPanelConstraints: g,
|
|
965
965
|
layout: S,
|
|
966
966
|
separatorToPanels: x
|
|
967
967
|
});
|
|
968
|
-
const b =
|
|
969
|
-
|
|
968
|
+
const b = s.group.panels.map(({ id: w }) => w).join(",");
|
|
969
|
+
s.group.inMemoryLayouts[b] = S;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
}), I({
|
|
@@ -1051,35 +1051,32 @@ function we(e) {
|
|
|
1051
1051
|
function Le(e) {
|
|
1052
1052
|
let t = 0, n = 0;
|
|
1053
1053
|
const o = {};
|
|
1054
|
-
for (const
|
|
1055
|
-
if (
|
|
1054
|
+
for (const a of e)
|
|
1055
|
+
if (a.defaultSize !== void 0) {
|
|
1056
1056
|
t++;
|
|
1057
|
-
const l = G(
|
|
1058
|
-
n += l, o[
|
|
1057
|
+
const l = G(a.defaultSize);
|
|
1058
|
+
n += l, o[a.panelId] = l;
|
|
1059
1059
|
} else
|
|
1060
|
-
o[
|
|
1060
|
+
o[a.panelId] = void 0;
|
|
1061
1061
|
const i = e.length - t;
|
|
1062
1062
|
if (i !== 0) {
|
|
1063
|
-
const
|
|
1063
|
+
const a = G((100 - n) / i);
|
|
1064
1064
|
for (const l of e)
|
|
1065
|
-
l.defaultSize === void 0 && (o[l.panelId] =
|
|
1065
|
+
l.defaultSize === void 0 && (o[l.panelId] = a);
|
|
1066
1066
|
}
|
|
1067
1067
|
return o;
|
|
1068
1068
|
}
|
|
1069
1069
|
function vt(e, t, n) {
|
|
1070
|
-
|
|
1071
|
-
if (!o)
|
|
1070
|
+
if (!n[0])
|
|
1072
1071
|
return;
|
|
1073
|
-
const i = e.panels.find((
|
|
1072
|
+
const i = e.panels.find((u) => u.element === t);
|
|
1074
1073
|
if (!i || !i.onResize)
|
|
1075
1074
|
return;
|
|
1076
|
-
const
|
|
1077
|
-
asPercentage: G(
|
|
1078
|
-
|
|
1079
|
-
),
|
|
1080
|
-
inPixels: o.inlineSize
|
|
1075
|
+
const a = W({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, s = {
|
|
1076
|
+
asPercentage: G(l / a * 100),
|
|
1077
|
+
inPixels: l
|
|
1081
1078
|
};
|
|
1082
|
-
i.mutableValues.prevSize =
|
|
1079
|
+
i.mutableValues.prevSize = s, i.onResize(s, i.id, r);
|
|
1083
1080
|
}
|
|
1084
1081
|
function xt(e, t) {
|
|
1085
1082
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -1105,12 +1102,12 @@ function bt(e) {
|
|
|
1105
1102
|
e.element.ownerDocument.defaultView,
|
|
1106
1103
|
"Cannot register an unmounted Group"
|
|
1107
1104
|
);
|
|
1108
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
1105
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = new n((c) => {
|
|
1109
1106
|
for (const d of c) {
|
|
1110
1107
|
const { borderBoxSize: y, target: g } = d;
|
|
1111
1108
|
if (g === e.element) {
|
|
1112
1109
|
if (t) {
|
|
1113
|
-
if (
|
|
1110
|
+
if (W({ group: e }) === 0)
|
|
1114
1111
|
return;
|
|
1115
1112
|
I((x) => {
|
|
1116
1113
|
const S = x.mountedGroups.get(e);
|
|
@@ -1119,7 +1116,7 @@ function bt(e) {
|
|
|
1119
1116
|
layout: w,
|
|
1120
1117
|
panelConstraints: b
|
|
1121
1118
|
});
|
|
1122
|
-
return !S.defaultLayoutDeferred &&
|
|
1119
|
+
return !S.defaultLayoutDeferred && B(w, C) && xt(
|
|
1123
1120
|
S.derivedPanelConstraints,
|
|
1124
1121
|
b
|
|
1125
1122
|
) ? x : {
|
|
@@ -1138,16 +1135,16 @@ function bt(e) {
|
|
|
1138
1135
|
vt(e, g, y);
|
|
1139
1136
|
}
|
|
1140
1137
|
});
|
|
1141
|
-
|
|
1138
|
+
a.observe(e.element), e.panels.forEach((c) => {
|
|
1142
1139
|
z(
|
|
1143
1140
|
!o.has(c.id),
|
|
1144
1141
|
`Panel ids must be unique; id "${c.id}" was used more than once`
|
|
1145
|
-
), o.add(c.id), c.onResize &&
|
|
1142
|
+
), o.add(c.id), c.onResize && a.observe(c.element);
|
|
1146
1143
|
});
|
|
1147
|
-
const l =
|
|
1144
|
+
const l = W({ group: e }), r = pe(e), s = e.panels.map(({ id: c }) => c).join(",");
|
|
1148
1145
|
let u = e.defaultLayout;
|
|
1149
1146
|
u && (zt(e.panels, u) || (u = void 0));
|
|
1150
|
-
const f = e.inMemoryLayouts[
|
|
1147
|
+
const f = e.inMemoryLayouts[s] ?? u ?? Le(r), p = _({
|
|
1151
1148
|
layout: f,
|
|
1152
1149
|
panelConstraints: r
|
|
1153
1150
|
}), m = Ie(e), h = e.element.ownerDocument;
|
|
@@ -1171,7 +1168,7 @@ function bt(e) {
|
|
|
1171
1168
|
!i.has(c.id),
|
|
1172
1169
|
`Separator ids must be unique; id "${c.id}" was used more than once`
|
|
1173
1170
|
), i.add(c.id), c.element.addEventListener("keydown", me);
|
|
1174
|
-
}), j.get(h) === 1 && (h.addEventListener("pointerdown", ve), h.addEventListener("pointerleave", ze), h.addEventListener("pointermove", be), h.addEventListener("pointerup", we)), function() {
|
|
1171
|
+
}), j.get(h) === 1 && (h.addEventListener("pointerdown", ve, !0), h.addEventListener("pointerleave", ze), h.addEventListener("pointermove", be), h.addEventListener("pointerup", we, !0)), function() {
|
|
1175
1172
|
t = !1, j.set(
|
|
1176
1173
|
h,
|
|
1177
1174
|
Math.max(0, (j.get(h) ?? 0) - 1)
|
|
@@ -1180,7 +1177,11 @@ function bt(e) {
|
|
|
1180
1177
|
return y.delete(e), { mountedGroups: y };
|
|
1181
1178
|
}), e.separators.forEach((d) => {
|
|
1182
1179
|
d.element.removeEventListener("keydown", me);
|
|
1183
|
-
}), j.get(h) || (h.removeEventListener(
|
|
1180
|
+
}), j.get(h) || (h.removeEventListener(
|
|
1181
|
+
"pointerdown",
|
|
1182
|
+
ve,
|
|
1183
|
+
!0
|
|
1184
|
+
), h.removeEventListener("pointerleave", ze), h.removeEventListener("pointermove", be), h.removeEventListener("pointerup", we, !0)), a.disconnect();
|
|
1184
1185
|
};
|
|
1185
1186
|
}
|
|
1186
1187
|
function wt() {
|
|
@@ -1249,22 +1250,22 @@ function Rt({
|
|
|
1249
1250
|
defaultLayout: n,
|
|
1250
1251
|
disableCursor: o,
|
|
1251
1252
|
disabled: i,
|
|
1252
|
-
elementRef:
|
|
1253
|
+
elementRef: a,
|
|
1253
1254
|
groupRef: l,
|
|
1254
1255
|
id: r,
|
|
1255
|
-
onLayoutChange:
|
|
1256
|
+
onLayoutChange: s,
|
|
1256
1257
|
orientation: u = "horizontal",
|
|
1257
1258
|
style: f,
|
|
1258
1259
|
...p
|
|
1259
1260
|
}) {
|
|
1260
1261
|
const m = E({}), h = le((L) => {
|
|
1261
|
-
|
|
1262
|
+
B(m.current, L) || (m.current = L, s?.(L));
|
|
1262
1263
|
}), c = ae(r), d = E(null), [y, g] = N(!1), [v, x] = N(n ?? {}), [S, b] = wt(), w = E({
|
|
1263
1264
|
lastExpandedPanelSizes: {},
|
|
1264
1265
|
layouts: {},
|
|
1265
1266
|
panels: [],
|
|
1266
1267
|
separators: []
|
|
1267
|
-
}), C = ue(d,
|
|
1268
|
+
}), C = ue(d, a);
|
|
1268
1269
|
Pt(c, l);
|
|
1269
1270
|
const U = re(
|
|
1270
1271
|
() => ({
|
|
@@ -1320,7 +1321,7 @@ function Rt({
|
|
|
1320
1321
|
const { defaultLayoutDeferred: F, derivedPanelConstraints: V, layout: J } = fe;
|
|
1321
1322
|
!F && V.length > 0 && (x(J), h?.(J));
|
|
1322
1323
|
}
|
|
1323
|
-
const
|
|
1324
|
+
const We = T.addListener(
|
|
1324
1325
|
"interactionStateChange",
|
|
1325
1326
|
(F) => {
|
|
1326
1327
|
switch (F.state) {
|
|
@@ -1338,7 +1339,7 @@ function Rt({
|
|
|
1338
1339
|
}
|
|
1339
1340
|
}
|
|
1340
1341
|
}
|
|
1341
|
-
),
|
|
1342
|
+
), Be = T.addListener(
|
|
1342
1343
|
"mountedGroupsChange",
|
|
1343
1344
|
(F) => {
|
|
1344
1345
|
const V = F.get(k);
|
|
@@ -1351,7 +1352,7 @@ function Rt({
|
|
|
1351
1352
|
}
|
|
1352
1353
|
);
|
|
1353
1354
|
return () => {
|
|
1354
|
-
$.current = null, He(),
|
|
1355
|
+
$.current = null, He(), We(), Be();
|
|
1355
1356
|
};
|
|
1356
1357
|
}, [
|
|
1357
1358
|
i,
|
|
@@ -1413,17 +1414,17 @@ function At({
|
|
|
1413
1414
|
storage: n = localStorage,
|
|
1414
1415
|
...o
|
|
1415
1416
|
}) {
|
|
1416
|
-
const i = t !== void 0,
|
|
1417
|
+
const i = t !== void 0, a = "id" in o ? o.id : o.groupId, l = oe(a, t ?? []), r = Ye(
|
|
1417
1418
|
Mt,
|
|
1418
1419
|
() => n.getItem(l),
|
|
1419
1420
|
() => n.getItem(l)
|
|
1420
|
-
),
|
|
1421
|
+
), s = re(
|
|
1421
1422
|
() => r ? JSON.parse(r) : void 0,
|
|
1422
1423
|
[r]
|
|
1423
1424
|
), u = re(() => {
|
|
1424
1425
|
const f = (p) => {
|
|
1425
1426
|
let m;
|
|
1426
|
-
i ? m = oe(
|
|
1427
|
+
i ? m = oe(a, Object.keys(p)) : m = oe(a, []);
|
|
1427
1428
|
try {
|
|
1428
1429
|
n.setItem(m, JSON.stringify(p));
|
|
1429
1430
|
} catch (h) {
|
|
@@ -1431,9 +1432,9 @@ function At({
|
|
|
1431
1432
|
}
|
|
1432
1433
|
};
|
|
1433
1434
|
return e > 0 ? Ct(f, e) : f;
|
|
1434
|
-
}, [e, i,
|
|
1435
|
+
}, [e, i, a, n]);
|
|
1435
1436
|
return {
|
|
1436
|
-
defaultLayout:
|
|
1437
|
+
defaultLayout: s,
|
|
1437
1438
|
onLayoutChange: u
|
|
1438
1439
|
};
|
|
1439
1440
|
}
|
|
@@ -1461,7 +1462,7 @@ function Et({
|
|
|
1461
1462
|
const n = () => {
|
|
1462
1463
|
const { mountedGroups: r } = D();
|
|
1463
1464
|
for (const [
|
|
1464
|
-
|
|
1465
|
+
s,
|
|
1465
1466
|
{
|
|
1466
1467
|
defaultLayoutDeferred: u,
|
|
1467
1468
|
derivedPanelConstraints: f,
|
|
@@ -1469,35 +1470,35 @@ function Et({
|
|
|
1469
1470
|
separatorToPanels: m
|
|
1470
1471
|
}
|
|
1471
1472
|
] of r)
|
|
1472
|
-
if (
|
|
1473
|
+
if (s.id === e)
|
|
1473
1474
|
return {
|
|
1474
1475
|
defaultLayoutDeferred: u,
|
|
1475
1476
|
derivedPanelConstraints: f,
|
|
1476
|
-
group:
|
|
1477
|
+
group: s,
|
|
1477
1478
|
layout: p,
|
|
1478
1479
|
separatorToPanels: m
|
|
1479
1480
|
};
|
|
1480
1481
|
throw Error(`Group ${e} not found`);
|
|
1481
1482
|
}, o = () => {
|
|
1482
1483
|
const r = n().derivedPanelConstraints.find(
|
|
1483
|
-
(
|
|
1484
|
+
(s) => s.panelId === t
|
|
1484
1485
|
);
|
|
1485
1486
|
if (r !== void 0)
|
|
1486
1487
|
return r;
|
|
1487
1488
|
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
1488
1489
|
}, i = () => {
|
|
1489
|
-
const r = n().group.panels.find((
|
|
1490
|
+
const r = n().group.panels.find((s) => s.id === t);
|
|
1490
1491
|
if (r !== void 0)
|
|
1491
1492
|
return r;
|
|
1492
1493
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1493
|
-
},
|
|
1494
|
+
}, a = () => {
|
|
1494
1495
|
const r = n().layout[t];
|
|
1495
1496
|
if (r !== void 0)
|
|
1496
1497
|
return r;
|
|
1497
1498
|
throw Error(`Layout not found for Panel ${t}`);
|
|
1498
1499
|
}, l = (r) => {
|
|
1499
|
-
const
|
|
1500
|
-
if (r ===
|
|
1500
|
+
const s = a();
|
|
1501
|
+
if (r === s)
|
|
1501
1502
|
return;
|
|
1502
1503
|
const {
|
|
1503
1504
|
defaultLayoutDeferred: u,
|
|
@@ -1506,7 +1507,7 @@ function Et({
|
|
|
1506
1507
|
layout: m,
|
|
1507
1508
|
separatorToPanels: h
|
|
1508
1509
|
} = n(), c = p.panels.findIndex((v) => v.id === t), d = c === p.panels.length - 1, y = Z({
|
|
1509
|
-
delta: d ?
|
|
1510
|
+
delta: d ? s - r : r - s,
|
|
1510
1511
|
initialLayout: m,
|
|
1511
1512
|
panelConstraints: f,
|
|
1512
1513
|
pivotIndices: d ? [c - 1, c] : [c, c + 1],
|
|
@@ -1516,7 +1517,7 @@ function Et({
|
|
|
1516
1517
|
layout: y,
|
|
1517
1518
|
panelConstraints: f
|
|
1518
1519
|
});
|
|
1519
|
-
|
|
1520
|
+
B(m, g) || I((v) => ({
|
|
1520
1521
|
mountedGroups: new Map(v.mountedGroups).set(p, {
|
|
1521
1522
|
defaultLayoutDeferred: u,
|
|
1522
1523
|
derivedPanelConstraints: f,
|
|
@@ -1527,33 +1528,33 @@ function Et({
|
|
|
1527
1528
|
};
|
|
1528
1529
|
return {
|
|
1529
1530
|
collapse: () => {
|
|
1530
|
-
const { collapsible: r, collapsedSize:
|
|
1531
|
-
r && f !==
|
|
1531
|
+
const { collapsible: r, collapsedSize: s } = o(), { mutableValues: u } = i(), f = a();
|
|
1532
|
+
r && f !== s && (u.expandToSize = f, l(s));
|
|
1532
1533
|
},
|
|
1533
1534
|
expand: () => {
|
|
1534
|
-
const { collapsible: r, collapsedSize:
|
|
1535
|
-
if (r && p ===
|
|
1535
|
+
const { collapsible: r, collapsedSize: s, minSize: u } = o(), { mutableValues: f } = i(), p = a();
|
|
1536
|
+
if (r && p === s) {
|
|
1536
1537
|
let m = f.expandToSize ?? u;
|
|
1537
1538
|
m === 0 && (m = 1), l(m);
|
|
1538
1539
|
}
|
|
1539
1540
|
},
|
|
1540
1541
|
getSize: () => {
|
|
1541
|
-
const { group: r } = n(),
|
|
1542
|
+
const { group: r } = n(), s = a(), { element: u } = i(), f = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
1542
1543
|
return {
|
|
1543
|
-
asPercentage:
|
|
1544
|
+
asPercentage: s,
|
|
1544
1545
|
inPixels: f
|
|
1545
1546
|
};
|
|
1546
1547
|
},
|
|
1547
1548
|
isCollapsed: () => {
|
|
1548
|
-
const { collapsible: r, collapsedSize:
|
|
1549
|
-
return r && R(
|
|
1549
|
+
const { collapsible: r, collapsedSize: s } = o(), u = a();
|
|
1550
|
+
return r && R(s, u);
|
|
1550
1551
|
},
|
|
1551
1552
|
resize: (r) => {
|
|
1552
|
-
if (
|
|
1553
|
+
if (a() !== r) {
|
|
1553
1554
|
let u;
|
|
1554
1555
|
switch (typeof r) {
|
|
1555
1556
|
case "number": {
|
|
1556
|
-
const { group: f } = n(), p =
|
|
1557
|
+
const { group: f } = n(), p = W({ group: f });
|
|
1557
1558
|
u = G(r / p * 100);
|
|
1558
1559
|
break;
|
|
1559
1560
|
}
|
|
@@ -1591,16 +1592,16 @@ function kt({
|
|
|
1591
1592
|
collapsedSize: n = "0%",
|
|
1592
1593
|
collapsible: o = !1,
|
|
1593
1594
|
defaultSize: i,
|
|
1594
|
-
elementRef:
|
|
1595
|
+
elementRef: a,
|
|
1595
1596
|
id: l,
|
|
1596
1597
|
maxSize: r = "100%",
|
|
1597
|
-
minSize:
|
|
1598
|
+
minSize: s = "0%",
|
|
1598
1599
|
onResize: u,
|
|
1599
1600
|
panelRef: f,
|
|
1600
1601
|
style: p,
|
|
1601
1602
|
...m
|
|
1602
1603
|
}) {
|
|
1603
|
-
const h = !!l, c = ae(l), d = E(null), y = ue(d,
|
|
1604
|
+
const h = !!l, c = ae(l), d = E(null), y = ue(d, a), { id: g, registerPanel: v } = ce(), x = u !== null, S = le(
|
|
1604
1605
|
(w, C, U) => {
|
|
1605
1606
|
u?.(w, l, U);
|
|
1606
1607
|
}
|
|
@@ -1622,7 +1623,7 @@ function kt({
|
|
|
1622
1623
|
collapsible: o,
|
|
1623
1624
|
defaultSize: i,
|
|
1624
1625
|
maxSize: r,
|
|
1625
|
-
minSize:
|
|
1626
|
+
minSize: s
|
|
1626
1627
|
}
|
|
1627
1628
|
});
|
|
1628
1629
|
}, [
|
|
@@ -1633,7 +1634,7 @@ function kt({
|
|
|
1633
1634
|
c,
|
|
1634
1635
|
h,
|
|
1635
1636
|
r,
|
|
1636
|
-
|
|
1637
|
+
s,
|
|
1637
1638
|
S,
|
|
1638
1639
|
v
|
|
1639
1640
|
]), It(c, f);
|
|
@@ -1674,20 +1675,16 @@ function kt({
|
|
|
1674
1675
|
}
|
|
1675
1676
|
kt.displayName = "Panel";
|
|
1676
1677
|
const Gt = {
|
|
1677
|
-
minHeight:
|
|
1678
|
-
maxHeight: "
|
|
1679
|
-
height: "
|
|
1680
|
-
minWidth:
|
|
1681
|
-
maxWidth: "
|
|
1682
|
-
width: "
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
border: "unset",
|
|
1688
|
-
borderWidth: "unset",
|
|
1689
|
-
padding: "unset",
|
|
1690
|
-
margin: "unset"
|
|
1678
|
+
minHeight: 0,
|
|
1679
|
+
maxHeight: "100%",
|
|
1680
|
+
height: "auto",
|
|
1681
|
+
minWidth: 0,
|
|
1682
|
+
maxWidth: "100%",
|
|
1683
|
+
width: "auto",
|
|
1684
|
+
border: "none",
|
|
1685
|
+
borderWidth: 0,
|
|
1686
|
+
padding: 0,
|
|
1687
|
+
margin: 0
|
|
1691
1688
|
};
|
|
1692
1689
|
function Vt() {
|
|
1693
1690
|
return N(null);
|
|
@@ -1701,13 +1698,13 @@ function Dt({
|
|
|
1701
1698
|
panelId: n,
|
|
1702
1699
|
panelIndex: o
|
|
1703
1700
|
}) {
|
|
1704
|
-
let i,
|
|
1701
|
+
let i, a;
|
|
1705
1702
|
const l = e[n], r = t.find(
|
|
1706
|
-
(
|
|
1703
|
+
(s) => s.panelId === n
|
|
1707
1704
|
);
|
|
1708
1705
|
if (r) {
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1706
|
+
const s = r.maxSize, u = a = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
|
|
1707
|
+
a = _({
|
|
1711
1708
|
layout: Z({
|
|
1712
1709
|
delta: u - l,
|
|
1713
1710
|
initialLayout: e,
|
|
@@ -1719,7 +1716,7 @@ function Dt({
|
|
|
1719
1716
|
panelConstraints: t
|
|
1720
1717
|
})[n], i = _({
|
|
1721
1718
|
layout: Z({
|
|
1722
|
-
delta:
|
|
1719
|
+
delta: s - l,
|
|
1723
1720
|
initialLayout: e,
|
|
1724
1721
|
panelConstraints: t,
|
|
1725
1722
|
pivotIndices: f,
|
|
@@ -1732,19 +1729,19 @@ function Dt({
|
|
|
1732
1729
|
return {
|
|
1733
1730
|
valueControls: n,
|
|
1734
1731
|
valueMax: i,
|
|
1735
|
-
valueMin:
|
|
1732
|
+
valueMin: a,
|
|
1736
1733
|
valueNow: l
|
|
1737
1734
|
};
|
|
1738
1735
|
}
|
|
1739
|
-
function
|
|
1736
|
+
function Ot({
|
|
1740
1737
|
children: e,
|
|
1741
1738
|
className: t,
|
|
1742
1739
|
elementRef: n,
|
|
1743
1740
|
id: o,
|
|
1744
1741
|
style: i,
|
|
1745
|
-
...
|
|
1742
|
+
...a
|
|
1746
1743
|
}) {
|
|
1747
|
-
const l = ae(o), [r,
|
|
1744
|
+
const l = ae(o), [r, s] = N({}), [u, f] = N("inactive"), p = E(null), m = ue(p, n), {
|
|
1748
1745
|
id: h,
|
|
1749
1746
|
orientation: c,
|
|
1750
1747
|
registerSeparator: d
|
|
@@ -1755,7 +1752,7 @@ function Tt({
|
|
|
1755
1752
|
const v = {
|
|
1756
1753
|
element: g,
|
|
1757
1754
|
id: l
|
|
1758
|
-
}, x = d(v), S =
|
|
1755
|
+
}, x = d(v), S = T.addListener(
|
|
1759
1756
|
"interactionStateChange",
|
|
1760
1757
|
(w) => {
|
|
1761
1758
|
f(
|
|
@@ -1764,7 +1761,7 @@ function Tt({
|
|
|
1764
1761
|
) ? w.state : "inactive"
|
|
1765
1762
|
);
|
|
1766
1763
|
}
|
|
1767
|
-
), b =
|
|
1764
|
+
), b = T.addListener(
|
|
1768
1765
|
"mountedGroupsChange",
|
|
1769
1766
|
(w) => {
|
|
1770
1767
|
w.forEach(
|
|
@@ -1773,7 +1770,7 @@ function Tt({
|
|
|
1773
1770
|
const X = K.get(v);
|
|
1774
1771
|
if (X) {
|
|
1775
1772
|
const L = X[0], P = $.panels.indexOf(L);
|
|
1776
|
-
|
|
1773
|
+
s(
|
|
1777
1774
|
Dt({
|
|
1778
1775
|
layout: U,
|
|
1779
1776
|
panelConstraints: C,
|
|
@@ -1794,7 +1791,7 @@ function Tt({
|
|
|
1794
1791
|
}, [h, l, d]), /* @__PURE__ */ q(
|
|
1795
1792
|
"div",
|
|
1796
1793
|
{
|
|
1797
|
-
...
|
|
1794
|
+
...a,
|
|
1798
1795
|
"aria-controls": r.valueControls,
|
|
1799
1796
|
"aria-orientation": y,
|
|
1800
1797
|
"aria-valuemax": r.valueMax,
|
|
@@ -1817,11 +1814,11 @@ function Tt({
|
|
|
1817
1814
|
}
|
|
1818
1815
|
);
|
|
1819
1816
|
}
|
|
1820
|
-
|
|
1817
|
+
Ot.displayName = "Separator";
|
|
1821
1818
|
export {
|
|
1822
1819
|
Rt as Group,
|
|
1823
1820
|
kt as Panel,
|
|
1824
|
-
|
|
1821
|
+
Ot as Separator,
|
|
1825
1822
|
At as useDefaultLayout,
|
|
1826
1823
|
$t as useGroupCallbackRef,
|
|
1827
1824
|
Ft as useGroupRef,
|