react-resizable-panels 4.8.0 → 4.9.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,6 +1,6 @@
|
|
|
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 We, useEffect as
|
|
3
|
+
import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as We, useEffect as he, useRef as O, createContext as ht, useImperativeHandle as Ue, useMemo as ye, 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;
|
|
@@ -60,7 +60,7 @@ function te({
|
|
|
60
60
|
}
|
|
61
61
|
return o;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function T(e) {
|
|
64
64
|
return parseFloat(e.toFixed(3));
|
|
65
65
|
}
|
|
66
66
|
function Q({
|
|
@@ -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 Se(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,
|
|
@@ -89,7 +89,7 @@ function ye(e) {
|
|
|
89
89
|
panelElement: i,
|
|
90
90
|
styleProp: s.collapsedSize
|
|
91
91
|
});
|
|
92
|
-
l =
|
|
92
|
+
l = T(f / n * 100);
|
|
93
93
|
}
|
|
94
94
|
let r;
|
|
95
95
|
if (s.defaultSize !== void 0) {
|
|
@@ -98,7 +98,7 @@ function ye(e) {
|
|
|
98
98
|
panelElement: i,
|
|
99
99
|
styleProp: s.defaultSize
|
|
100
100
|
});
|
|
101
|
-
r =
|
|
101
|
+
r = T(f / n * 100);
|
|
102
102
|
}
|
|
103
103
|
let a = 0;
|
|
104
104
|
if (s.minSize !== void 0) {
|
|
@@ -107,16 +107,16 @@ function ye(e) {
|
|
|
107
107
|
panelElement: i,
|
|
108
108
|
styleProp: s.minSize
|
|
109
109
|
});
|
|
110
|
-
a =
|
|
110
|
+
a = T(f / n * 100);
|
|
111
111
|
}
|
|
112
|
-
let
|
|
112
|
+
let c = 100;
|
|
113
113
|
if (s.maxSize !== void 0) {
|
|
114
114
|
const f = te({
|
|
115
115
|
groupSize: n,
|
|
116
116
|
panelElement: i,
|
|
117
117
|
styleProp: s.maxSize
|
|
118
118
|
});
|
|
119
|
-
|
|
119
|
+
c = T(f / n * 100);
|
|
120
120
|
}
|
|
121
121
|
return {
|
|
122
122
|
groupResizeBehavior: s.groupResizeBehavior,
|
|
@@ -125,16 +125,16 @@ function ye(e) {
|
|
|
125
125
|
defaultSize: r,
|
|
126
126
|
disabled: s.disabled,
|
|
127
127
|
minSize: a,
|
|
128
|
-
maxSize:
|
|
128
|
+
maxSize: c,
|
|
129
129
|
panelId: o.id
|
|
130
130
|
};
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function C(e, t = "Assertion error") {
|
|
134
134
|
if (!e)
|
|
135
135
|
throw Error(t);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function ve(e, t) {
|
|
138
138
|
return Array.from(t).sort(
|
|
139
139
|
e === "horizontal" ? bt : xt
|
|
140
140
|
);
|
|
@@ -173,37 +173,37 @@ function wt({
|
|
|
173
173
|
};
|
|
174
174
|
let i, s = Number.MAX_VALUE;
|
|
175
175
|
for (const l of t) {
|
|
176
|
-
const { x: r, y: a } = qe(o, l),
|
|
177
|
-
|
|
176
|
+
const { x: r, y: a } = qe(o, l), c = e === "horizontal" ? r : a;
|
|
177
|
+
c < s && (s = c, i = l);
|
|
178
178
|
}
|
|
179
|
-
return
|
|
179
|
+
return C(i, "No rect found"), i;
|
|
180
180
|
}
|
|
181
|
-
let
|
|
181
|
+
let ce;
|
|
182
182
|
function Pt() {
|
|
183
|
-
return
|
|
183
|
+
return ce === void 0 && (typeof matchMedia == "function" ? ce = !!matchMedia("(pointer:coarse)").matches : ce = !1), ce;
|
|
184
184
|
}
|
|
185
185
|
function Ye(e) {
|
|
186
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s =
|
|
186
|
+
const { element: t, orientation: n, panels: o, separators: i } = e, s = ve(
|
|
187
187
|
n,
|
|
188
|
-
Array.from(t.children).filter(Xe).map((
|
|
189
|
-
).map(({ element:
|
|
190
|
-
let r = !1, a = !1,
|
|
188
|
+
Array.from(t.children).filter(Xe).map((b) => ({ element: b }))
|
|
189
|
+
).map(({ element: b }) => b), l = [];
|
|
190
|
+
let r = !1, a = !1, c = -1, f = -1, g = 0, d, z = [];
|
|
191
191
|
{
|
|
192
|
-
let
|
|
193
|
-
for (const
|
|
194
|
-
|
|
192
|
+
let b = -1;
|
|
193
|
+
for (const u of s)
|
|
194
|
+
u.hasAttribute("data-panel") && (b++, u.hasAttribute("data-disabled") || (g++, c === -1 && (c = b), f = b));
|
|
195
195
|
}
|
|
196
196
|
if (g > 1) {
|
|
197
|
-
let
|
|
198
|
-
for (const
|
|
199
|
-
if (
|
|
200
|
-
|
|
197
|
+
let b = -1;
|
|
198
|
+
for (const u of s)
|
|
199
|
+
if (u.hasAttribute("data-panel")) {
|
|
200
|
+
b++;
|
|
201
201
|
const p = o.find(
|
|
202
|
-
(m) => m.element ===
|
|
202
|
+
(m) => m.element === u
|
|
203
203
|
);
|
|
204
204
|
if (p) {
|
|
205
205
|
if (d) {
|
|
206
|
-
const m = d.element.getBoundingClientRect(), S =
|
|
206
|
+
const m = d.element.getBoundingClientRect(), S = u.getBoundingClientRect();
|
|
207
207
|
let v;
|
|
208
208
|
if (a) {
|
|
209
209
|
const y = n === "horizontal" ? new DOMRect(
|
|
@@ -260,24 +260,24 @@ function Ye(e) {
|
|
|
260
260
|
let h = "width" in y ? y : y.element.getBoundingClientRect();
|
|
261
261
|
const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
262
262
|
if (h.width < P) {
|
|
263
|
-
const
|
|
263
|
+
const L = P - h.width;
|
|
264
264
|
h = new DOMRect(
|
|
265
|
-
h.x -
|
|
265
|
+
h.x - L / 2,
|
|
266
266
|
h.y,
|
|
267
|
-
h.width +
|
|
267
|
+
h.width + L,
|
|
268
268
|
h.height
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
271
|
if (h.height < P) {
|
|
272
|
-
const
|
|
272
|
+
const L = P - h.height;
|
|
273
273
|
h = new DOMRect(
|
|
274
274
|
h.x,
|
|
275
|
-
h.y -
|
|
275
|
+
h.y - L / 2,
|
|
276
276
|
h.width,
|
|
277
|
-
h.height +
|
|
277
|
+
h.height + L
|
|
278
278
|
);
|
|
279
279
|
}
|
|
280
|
-
const M =
|
|
280
|
+
const M = b <= c || b > f;
|
|
281
281
|
!r && !M && l.push({
|
|
282
282
|
group: e,
|
|
283
283
|
groupSize: Q({ group: e }),
|
|
@@ -289,10 +289,10 @@ function Ye(e) {
|
|
|
289
289
|
}
|
|
290
290
|
a = !1, d = p, z = [];
|
|
291
291
|
}
|
|
292
|
-
} else if (
|
|
293
|
-
|
|
292
|
+
} else if (u.hasAttribute("data-separator")) {
|
|
293
|
+
u.ariaDisabled !== null && (r = !0);
|
|
294
294
|
const p = i.find(
|
|
295
|
-
(m) => m.element ===
|
|
295
|
+
(m) => m.element === u
|
|
296
296
|
);
|
|
297
297
|
p ? z.push(p) : (d = void 0, z = []);
|
|
298
298
|
} else
|
|
@@ -320,8 +320,8 @@ class Je {
|
|
|
320
320
|
const a = l[r];
|
|
321
321
|
try {
|
|
322
322
|
a.call(null, n);
|
|
323
|
-
} catch (
|
|
324
|
-
s === null && (i = !0, s =
|
|
323
|
+
} catch (c) {
|
|
324
|
+
s === null && (i = !0, s = c);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
if (i)
|
|
@@ -349,7 +349,7 @@ function Ee(e, t) {
|
|
|
349
349
|
if (n.id === e)
|
|
350
350
|
return n;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function j(e, t) {
|
|
353
353
|
for (const [n, o] of A)
|
|
354
354
|
if (n.id === e)
|
|
355
355
|
return o;
|
|
@@ -359,7 +359,7 @@ function $(e, t) {
|
|
|
359
359
|
function U() {
|
|
360
360
|
return A;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function ze(e, t) {
|
|
363
363
|
return Ze.addListener("groupChange", (n) => {
|
|
364
364
|
n.group.id === e && t(n);
|
|
365
365
|
});
|
|
@@ -407,7 +407,7 @@ function Mt(e, t) {
|
|
|
407
407
|
let o;
|
|
408
408
|
for (; n.a.at(-1) === n.b.at(-1); )
|
|
409
409
|
o = n.a.pop(), n.b.pop();
|
|
410
|
-
|
|
410
|
+
C(
|
|
411
411
|
o,
|
|
412
412
|
"Stacking order can only be calculated for elements with a common ancestor"
|
|
413
413
|
);
|
|
@@ -442,7 +442,7 @@ function ke(e) {
|
|
|
442
442
|
let t = e.length;
|
|
443
443
|
for (; t--; ) {
|
|
444
444
|
const n = e[t];
|
|
445
|
-
if (
|
|
445
|
+
if (C(n, "Missing node"), It(n)) return n;
|
|
446
446
|
}
|
|
447
447
|
return null;
|
|
448
448
|
}
|
|
@@ -481,7 +481,7 @@ function Tt({
|
|
|
481
481
|
}
|
|
482
482
|
return !0;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function be(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
|
|
509
|
-
return Math.abs(
|
|
508
|
+
function D(e, t, n = 0) {
|
|
509
|
+
return Math.abs(T(e) - T(t)) <= n;
|
|
510
510
|
}
|
|
511
511
|
function G(e, t) {
|
|
512
|
-
return
|
|
512
|
+
return D(e, t) ? 0 : e > t ? 1 : -1;
|
|
513
513
|
}
|
|
514
514
|
function Y({
|
|
515
515
|
overrideDisabledPanels: e,
|
|
@@ -528,11 +528,11 @@ function Y({
|
|
|
528
528
|
return n;
|
|
529
529
|
if (G(o, a) < 0)
|
|
530
530
|
if (s) {
|
|
531
|
-
const
|
|
532
|
-
G(o,
|
|
531
|
+
const c = (i + a) / 2;
|
|
532
|
+
G(o, c) < 0 ? o = i : o = a;
|
|
533
533
|
} else
|
|
534
534
|
o = a;
|
|
535
|
-
return o = Math.min(r, o), o =
|
|
535
|
+
return o = Math.min(r, o), o = T(o), o;
|
|
536
536
|
}
|
|
537
537
|
function se({
|
|
538
538
|
delta: e,
|
|
@@ -542,18 +542,18 @@ function se({
|
|
|
542
542
|
prevLayout: i,
|
|
543
543
|
trigger: s
|
|
544
544
|
}) {
|
|
545
|
-
if (
|
|
545
|
+
if (D(e, 0))
|
|
546
546
|
return t;
|
|
547
|
-
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i),
|
|
548
|
-
|
|
547
|
+
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), c = [...r], [f, g] = o;
|
|
548
|
+
C(f != null, "Invalid first pivot index"), C(g != null, "Invalid second pivot index");
|
|
549
549
|
let d = 0;
|
|
550
550
|
switch (s) {
|
|
551
551
|
case "keyboard": {
|
|
552
552
|
{
|
|
553
|
-
const
|
|
554
|
-
|
|
553
|
+
const u = e < 0 ? g : f, p = n[u];
|
|
554
|
+
C(
|
|
555
555
|
p,
|
|
556
|
-
`Panel constraints not found for index ${
|
|
556
|
+
`Panel constraints not found for index ${u}`
|
|
557
557
|
);
|
|
558
558
|
const {
|
|
559
559
|
collapsedSize: m = 0,
|
|
@@ -561,21 +561,21 @@ function se({
|
|
|
561
561
|
minSize: v = 0
|
|
562
562
|
} = p;
|
|
563
563
|
if (S) {
|
|
564
|
-
const y = r[
|
|
565
|
-
if (
|
|
564
|
+
const y = r[u];
|
|
565
|
+
if (C(
|
|
566
566
|
y != null,
|
|
567
|
-
`Previous layout not found for panel index ${
|
|
568
|
-
),
|
|
567
|
+
`Previous layout not found for panel index ${u}`
|
|
568
|
+
), D(y, m)) {
|
|
569
569
|
const h = v - y;
|
|
570
570
|
G(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
{
|
|
575
|
-
const
|
|
576
|
-
|
|
575
|
+
const u = e < 0 ? f : g, p = n[u];
|
|
576
|
+
C(
|
|
577
577
|
p,
|
|
578
|
-
`No panel constraints found for index ${
|
|
578
|
+
`No panel constraints found for index ${u}`
|
|
579
579
|
);
|
|
580
580
|
const {
|
|
581
581
|
collapsedSize: m = 0,
|
|
@@ -583,11 +583,11 @@ function se({
|
|
|
583
583
|
minSize: v = 0
|
|
584
584
|
} = p;
|
|
585
585
|
if (S) {
|
|
586
|
-
const y = r[
|
|
587
|
-
if (
|
|
586
|
+
const y = r[u];
|
|
587
|
+
if (C(
|
|
588
588
|
y != null,
|
|
589
|
-
`Previous layout not found for panel index ${
|
|
590
|
-
),
|
|
589
|
+
`Previous layout not found for panel index ${u}`
|
|
590
|
+
), D(y, v)) {
|
|
591
591
|
const h = y - m;
|
|
592
592
|
G(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
|
|
593
593
|
}
|
|
@@ -596,12 +596,12 @@ function se({
|
|
|
596
596
|
break;
|
|
597
597
|
}
|
|
598
598
|
default: {
|
|
599
|
-
const
|
|
600
|
-
|
|
599
|
+
const u = e < 0 ? g : f, p = n[u];
|
|
600
|
+
C(
|
|
601
601
|
p,
|
|
602
|
-
`Panel constraints not found for index ${
|
|
602
|
+
`Panel constraints not found for index ${u}`
|
|
603
603
|
);
|
|
604
|
-
const m = r[
|
|
604
|
+
const m = r[u], { collapsible: S, collapsedSize: v, minSize: y } = p;
|
|
605
605
|
if (S && G(m, y) < 0)
|
|
606
606
|
if (e > 0) {
|
|
607
607
|
const h = y - v, P = h / 2, M = m + e;
|
|
@@ -614,11 +614,11 @@ function se({
|
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
{
|
|
617
|
-
const
|
|
617
|
+
const u = e < 0 ? 1 : -1;
|
|
618
618
|
let p = e < 0 ? g : f, m = 0;
|
|
619
619
|
for (; ; ) {
|
|
620
620
|
const v = r[p];
|
|
621
|
-
|
|
621
|
+
C(
|
|
622
622
|
v != null,
|
|
623
623
|
`Previous layout not found for panel index ${p}`
|
|
624
624
|
);
|
|
@@ -628,7 +628,7 @@ function se({
|
|
|
628
628
|
prevSize: v,
|
|
629
629
|
size: 100
|
|
630
630
|
}) - v;
|
|
631
|
-
if (m += h, p +=
|
|
631
|
+
if (m += h, p += u, p < 0 || p >= n.length)
|
|
632
632
|
break;
|
|
633
633
|
}
|
|
634
634
|
const S = Math.min(Math.abs(e), Math.abs(m));
|
|
@@ -638,7 +638,7 @@ function se({
|
|
|
638
638
|
let p = e < 0 ? f : g;
|
|
639
639
|
for (; p >= 0 && p < n.length; ) {
|
|
640
640
|
const m = Math.abs(e) - Math.abs(d), S = r[p];
|
|
641
|
-
|
|
641
|
+
C(
|
|
642
642
|
S != null,
|
|
643
643
|
`Previous layout not found for panel index ${p}`
|
|
644
644
|
);
|
|
@@ -648,55 +648,55 @@ function se({
|
|
|
648
648
|
prevSize: S,
|
|
649
649
|
size: v
|
|
650
650
|
});
|
|
651
|
-
if (!
|
|
651
|
+
if (!D(S, y) && (d += S - y, c[p] = y, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
652
652
|
numeric: !0
|
|
653
653
|
}) >= 0))
|
|
654
654
|
break;
|
|
655
655
|
e < 0 ? p-- : p++;
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
if (Ot(a,
|
|
658
|
+
if (Ot(a, c))
|
|
659
659
|
return i;
|
|
660
660
|
{
|
|
661
|
-
const
|
|
662
|
-
|
|
661
|
+
const u = e < 0 ? g : f, p = r[u];
|
|
662
|
+
C(
|
|
663
663
|
p != null,
|
|
664
|
-
`Previous layout not found for panel index ${
|
|
664
|
+
`Previous layout not found for panel index ${u}`
|
|
665
665
|
);
|
|
666
666
|
const m = p + d, S = Y({
|
|
667
667
|
overrideDisabledPanels: l,
|
|
668
|
-
panelConstraints: n[
|
|
668
|
+
panelConstraints: n[u],
|
|
669
669
|
prevSize: p,
|
|
670
670
|
size: m
|
|
671
671
|
});
|
|
672
|
-
if (u
|
|
672
|
+
if (c[u] = S, !D(S, m)) {
|
|
673
673
|
let v = m - S, h = e < 0 ? g : f;
|
|
674
674
|
for (; h >= 0 && h < n.length; ) {
|
|
675
|
-
const P =
|
|
676
|
-
|
|
675
|
+
const P = c[h];
|
|
676
|
+
C(
|
|
677
677
|
P != null,
|
|
678
678
|
`Previous layout not found for panel index ${h}`
|
|
679
679
|
);
|
|
680
|
-
const M = P + v,
|
|
680
|
+
const M = P + v, L = Y({
|
|
681
681
|
overrideDisabledPanels: l,
|
|
682
682
|
panelConstraints: n[h],
|
|
683
683
|
prevSize: P,
|
|
684
684
|
size: M
|
|
685
685
|
});
|
|
686
|
-
if (
|
|
686
|
+
if (D(P, L) || (v -= L - P, c[h] = L), D(v, 0))
|
|
687
687
|
break;
|
|
688
688
|
e > 0 ? h-- : h++;
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
|
-
const z = Object.values(
|
|
693
|
-
(
|
|
692
|
+
const z = Object.values(c).reduce(
|
|
693
|
+
(u, p) => p + u,
|
|
694
694
|
0
|
|
695
695
|
);
|
|
696
|
-
if (!
|
|
696
|
+
if (!D(z, 100, 0.1))
|
|
697
697
|
return i;
|
|
698
|
-
const
|
|
699
|
-
return
|
|
698
|
+
const b = Object.keys(i);
|
|
699
|
+
return c.reduce((u, p, m) => (u[b[m]] = p, u), {});
|
|
700
700
|
}
|
|
701
701
|
function V(e, t) {
|
|
702
702
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -718,42 +718,42 @@ function B({
|
|
|
718
718
|
throw Error(
|
|
719
719
|
`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
|
|
720
720
|
);
|
|
721
|
-
if (!
|
|
721
|
+
if (!D(i, 100) && o.length > 0)
|
|
722
722
|
for (let r = 0; r < t.length; r++) {
|
|
723
723
|
const a = o[r];
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
o[r] =
|
|
724
|
+
C(a != null, `No layout data found for index ${r}`);
|
|
725
|
+
const c = 100 / i * a;
|
|
726
|
+
o[r] = c;
|
|
727
727
|
}
|
|
728
728
|
let s = 0;
|
|
729
729
|
for (let r = 0; r < t.length; r++) {
|
|
730
730
|
const a = n[r];
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
|
|
731
|
+
C(a != null, `No layout data found for index ${r}`);
|
|
732
|
+
const c = o[r];
|
|
733
|
+
C(c != null, `No layout data found for index ${r}`);
|
|
734
734
|
const f = Y({
|
|
735
735
|
overrideDisabledPanels: !0,
|
|
736
736
|
panelConstraints: t[r],
|
|
737
737
|
prevSize: a,
|
|
738
|
-
size:
|
|
738
|
+
size: c
|
|
739
739
|
});
|
|
740
|
-
|
|
740
|
+
c != f && (s += c - f, o[r] = f);
|
|
741
741
|
}
|
|
742
|
-
if (!
|
|
742
|
+
if (!D(s, 0))
|
|
743
743
|
for (let r = 0; r < t.length; r++) {
|
|
744
744
|
const a = o[r];
|
|
745
|
-
|
|
746
|
-
const
|
|
745
|
+
C(a != null, `No layout data found for index ${r}`);
|
|
746
|
+
const c = a + s, f = Y({
|
|
747
747
|
overrideDisabledPanels: !0,
|
|
748
748
|
panelConstraints: t[r],
|
|
749
749
|
prevSize: a,
|
|
750
|
-
size:
|
|
750
|
+
size: c
|
|
751
751
|
});
|
|
752
|
-
if (a !== f && (s -= f - a, o[r] = f,
|
|
752
|
+
if (a !== f && (s -= f - a, o[r] = f, D(s, 0)))
|
|
753
753
|
break;
|
|
754
754
|
}
|
|
755
755
|
const l = Object.keys(e);
|
|
756
|
-
return o.reduce((r, a,
|
|
756
|
+
return o.reduce((r, a, c) => (r[l[c]] = a, r), {});
|
|
757
757
|
}
|
|
758
758
|
function et({
|
|
759
759
|
groupId: e,
|
|
@@ -764,7 +764,7 @@ function et({
|
|
|
764
764
|
for (const [
|
|
765
765
|
a,
|
|
766
766
|
{
|
|
767
|
-
defaultLayoutDeferred:
|
|
767
|
+
defaultLayoutDeferred: c,
|
|
768
768
|
derivedPanelConstraints: f,
|
|
769
769
|
layout: g,
|
|
770
770
|
groupSize: d,
|
|
@@ -773,7 +773,7 @@ function et({
|
|
|
773
773
|
] of r)
|
|
774
774
|
if (a.id === e)
|
|
775
775
|
return {
|
|
776
|
-
defaultLayoutDeferred:
|
|
776
|
+
defaultLayoutDeferred: c,
|
|
777
777
|
derivedPanelConstraints: f,
|
|
778
778
|
group: a,
|
|
779
779
|
groupSize: d,
|
|
@@ -803,17 +803,17 @@ function et({
|
|
|
803
803
|
if (r === a)
|
|
804
804
|
return;
|
|
805
805
|
const {
|
|
806
|
-
defaultLayoutDeferred:
|
|
806
|
+
defaultLayoutDeferred: c,
|
|
807
807
|
derivedPanelConstraints: f,
|
|
808
808
|
group: g,
|
|
809
809
|
groupSize: d,
|
|
810
810
|
layout: z,
|
|
811
|
-
separatorToPanels:
|
|
812
|
-
} = n(),
|
|
811
|
+
separatorToPanels: b
|
|
812
|
+
} = n(), u = g.panels.findIndex((v) => v.id === t), p = u === g.panels.length - 1, m = se({
|
|
813
813
|
delta: p ? a - r : r - a,
|
|
814
814
|
initialLayout: z,
|
|
815
815
|
panelConstraints: f,
|
|
816
|
-
pivotIndices: p ? [
|
|
816
|
+
pivotIndices: p ? [u - 1, u] : [u, u + 1],
|
|
817
817
|
prevLayout: z,
|
|
818
818
|
trigger: "imperative-api"
|
|
819
819
|
}), S = B({
|
|
@@ -821,42 +821,42 @@ function et({
|
|
|
821
821
|
panelConstraints: f
|
|
822
822
|
});
|
|
823
823
|
V(z, S) || _(g, {
|
|
824
|
-
defaultLayoutDeferred:
|
|
824
|
+
defaultLayoutDeferred: c,
|
|
825
825
|
derivedPanelConstraints: f,
|
|
826
826
|
groupSize: d,
|
|
827
827
|
layout: S,
|
|
828
|
-
separatorToPanels:
|
|
828
|
+
separatorToPanels: b
|
|
829
829
|
});
|
|
830
830
|
};
|
|
831
831
|
return {
|
|
832
832
|
collapse: () => {
|
|
833
|
-
const { collapsible: r, collapsedSize: a } = o(), { mutableValues:
|
|
834
|
-
r && f !== a && (
|
|
833
|
+
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: c } = i(), f = s();
|
|
834
|
+
r && f !== a && (c.expandToSize = f, l(a));
|
|
835
835
|
},
|
|
836
836
|
expand: () => {
|
|
837
|
-
const { collapsible: r, collapsedSize: a, minSize:
|
|
837
|
+
const { collapsible: r, collapsedSize: a, minSize: c } = o(), { mutableValues: f } = i(), g = s();
|
|
838
838
|
if (r && g === a) {
|
|
839
|
-
let d = f.expandToSize ??
|
|
839
|
+
let d = f.expandToSize ?? c;
|
|
840
840
|
d === 0 && (d = 1), l(d);
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
getSize: () => {
|
|
844
|
-
const { group: r } = n(), a = s(), { element:
|
|
844
|
+
const { group: r } = n(), a = s(), { element: c } = i(), f = r.orientation === "horizontal" ? c.offsetWidth : c.offsetHeight;
|
|
845
845
|
return {
|
|
846
846
|
asPercentage: a,
|
|
847
847
|
inPixels: f
|
|
848
848
|
};
|
|
849
849
|
},
|
|
850
850
|
isCollapsed: () => {
|
|
851
|
-
const { collapsible: r, collapsedSize: a } = o(),
|
|
852
|
-
return r &&
|
|
851
|
+
const { collapsible: r, collapsedSize: a } = o(), c = s();
|
|
852
|
+
return r && D(a, c);
|
|
853
853
|
},
|
|
854
854
|
resize: (r) => {
|
|
855
|
-
const { group: a } = n(), { element:
|
|
855
|
+
const { group: a } = n(), { element: c } = i(), f = Q({ group: a }), g = te({
|
|
856
856
|
groupSize: f,
|
|
857
|
-
panelElement:
|
|
857
|
+
panelElement: c,
|
|
858
858
|
styleProp: r
|
|
859
|
-
}), d =
|
|
859
|
+
}), d = T(g / f * 100);
|
|
860
860
|
l(d);
|
|
861
861
|
}
|
|
862
862
|
};
|
|
@@ -865,8 +865,8 @@ function Te(e) {
|
|
|
865
865
|
if (e.defaultPrevented)
|
|
866
866
|
return;
|
|
867
867
|
const t = U();
|
|
868
|
-
|
|
869
|
-
if (o.separator) {
|
|
868
|
+
be(e, t).forEach((o) => {
|
|
869
|
+
if (o.separator && !o.separator.disableDoubleClick) {
|
|
870
870
|
const i = o.panels.find(
|
|
871
871
|
(s) => s.panelConstraints.defaultSize !== void 0
|
|
872
872
|
);
|
|
@@ -880,7 +880,7 @@ function Te(e) {
|
|
|
880
880
|
}
|
|
881
881
|
});
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function de(e) {
|
|
884
884
|
const t = U();
|
|
885
885
|
for (const [n] of t)
|
|
886
886
|
if (n.separators.some(
|
|
@@ -912,28 +912,28 @@ function tt({
|
|
|
912
912
|
groupSize: l,
|
|
913
913
|
layout: r,
|
|
914
914
|
separatorToPanels: a
|
|
915
|
-
} = t(),
|
|
915
|
+
} = t(), c = B({
|
|
916
916
|
layout: n,
|
|
917
917
|
panelConstraints: i
|
|
918
918
|
});
|
|
919
|
-
return o ? r : (V(r,
|
|
919
|
+
return o ? r : (V(r, c) || _(s, {
|
|
920
920
|
defaultLayoutDeferred: o,
|
|
921
921
|
derivedPanelConstraints: i,
|
|
922
922
|
groupSize: l,
|
|
923
|
-
layout:
|
|
923
|
+
layout: c,
|
|
924
924
|
separatorToPanels: a
|
|
925
|
-
}),
|
|
925
|
+
}), c);
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
928
|
}
|
|
929
929
|
function H(e, t) {
|
|
930
|
-
const n =
|
|
930
|
+
const n = de(e), o = j(n.id, !0), i = n.separators.find(
|
|
931
931
|
(g) => g.element === e
|
|
932
932
|
);
|
|
933
|
-
|
|
933
|
+
C(i, "Matching separator not found");
|
|
934
934
|
const s = o.separatorToPanels.get(i);
|
|
935
|
-
|
|
936
|
-
const l = s.map((g) => n.panels.indexOf(g)), a = tt({ groupId: n.id }).getLayout(),
|
|
935
|
+
C(s, "Matching panels not found");
|
|
936
|
+
const l = s.map((g) => n.panels.indexOf(g)), a = tt({ groupId: n.id }).getLayout(), c = se({
|
|
937
937
|
delta: t,
|
|
938
938
|
initialLayout: a,
|
|
939
939
|
panelConstraints: o.derivedPanelConstraints,
|
|
@@ -941,7 +941,7 @@ function H(e, t) {
|
|
|
941
941
|
prevLayout: a,
|
|
942
942
|
trigger: "keyboard"
|
|
943
943
|
}), f = B({
|
|
944
|
-
layout:
|
|
944
|
+
layout: c,
|
|
945
945
|
panelConstraints: o.derivedPanelConstraints
|
|
946
946
|
});
|
|
947
947
|
V(a, f) || _(n, {
|
|
@@ -955,7 +955,7 @@ function H(e, t) {
|
|
|
955
955
|
function Oe(e) {
|
|
956
956
|
if (e.defaultPrevented)
|
|
957
957
|
return;
|
|
958
|
-
const t = e.currentTarget, n =
|
|
958
|
+
const t = e.currentTarget, n = de(t);
|
|
959
959
|
if (!n.disabled)
|
|
960
960
|
switch (e.key) {
|
|
961
961
|
case "ArrowDown": {
|
|
@@ -980,16 +980,16 @@ function Oe(e) {
|
|
|
980
980
|
}
|
|
981
981
|
case "Enter": {
|
|
982
982
|
e.preventDefault();
|
|
983
|
-
const o =
|
|
983
|
+
const o = de(t), i = j(o.id, !0), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find(
|
|
984
984
|
(d) => d.element === t
|
|
985
985
|
);
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
|
|
989
|
-
const f =
|
|
986
|
+
C(a, "Matching separator not found");
|
|
987
|
+
const c = r.get(a);
|
|
988
|
+
C(c, "Matching panels not found");
|
|
989
|
+
const f = c[0], g = s.find(
|
|
990
990
|
(d) => d.panelId === f.id
|
|
991
991
|
);
|
|
992
|
-
if (
|
|
992
|
+
if (C(g, "Panel metadata not found"), g.collapsible) {
|
|
993
993
|
const d = l[f.id], z = g.collapsedSize === d ? o.mutableState.expandedPanelSizes[f.id] ?? g.minSize : g.collapsedSize;
|
|
994
994
|
H(t, z - d);
|
|
995
995
|
}
|
|
@@ -997,12 +997,12 @@ function Oe(e) {
|
|
|
997
997
|
}
|
|
998
998
|
case "F6": {
|
|
999
999
|
e.preventDefault();
|
|
1000
|
-
const i =
|
|
1000
|
+
const i = de(t).separators.map(
|
|
1001
1001
|
(a) => a.element
|
|
1002
1002
|
), s = Array.from(i).findIndex(
|
|
1003
1003
|
(a) => a === e.currentTarget
|
|
1004
1004
|
);
|
|
1005
|
-
|
|
1005
|
+
C(s !== null, "Index not found");
|
|
1006
1006
|
const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
|
|
1007
1007
|
i[l].focus({
|
|
1008
1008
|
preventScroll: !0
|
|
@@ -1019,23 +1019,23 @@ let J = {
|
|
|
1019
1019
|
cursorFlags: 0,
|
|
1020
1020
|
state: "inactive"
|
|
1021
1021
|
};
|
|
1022
|
-
const
|
|
1022
|
+
const xe = new Je();
|
|
1023
1023
|
function W() {
|
|
1024
1024
|
return J;
|
|
1025
1025
|
}
|
|
1026
1026
|
function Gt(e) {
|
|
1027
|
-
return
|
|
1027
|
+
return xe.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, xe.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, xe.emit("change", {
|
|
1039
1039
|
prev: t,
|
|
1040
1040
|
next: e
|
|
1041
1041
|
});
|
|
@@ -1045,7 +1045,7 @@ function Ge(e) {
|
|
|
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 = be(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,11 +1061,11 @@ function Ge(e) {
|
|
|
1061
1061
|
state: "active"
|
|
1062
1062
|
}), n.length && e.preventDefault();
|
|
1063
1063
|
}
|
|
1064
|
-
const Nt = (e) => e,
|
|
1064
|
+
const Nt = (e) => e, ge = () => {
|
|
1065
1065
|
}, nt = 1, ot = 2, it = 4, rt = 8, Ae = 3, Ne = 12;
|
|
1066
|
-
let
|
|
1066
|
+
let fe;
|
|
1067
1067
|
function _e() {
|
|
1068
|
-
return
|
|
1068
|
+
return fe === void 0 && (fe = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (fe = !0)), fe;
|
|
1069
1069
|
}
|
|
1070
1070
|
function _t({
|
|
1071
1071
|
cursorFlags: e,
|
|
@@ -1111,7 +1111,7 @@ function _t({
|
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
const Fe = /* @__PURE__ */ new WeakMap();
|
|
1114
|
-
function
|
|
1114
|
+
function we(e) {
|
|
1115
1115
|
if (e.defaultView === null || e.defaultView === void 0)
|
|
1116
1116
|
return;
|
|
1117
1117
|
let { prevStyle: t, styleSheet: n } = Fe.get(e) ?? {};
|
|
@@ -1150,10 +1150,10 @@ function st({
|
|
|
1150
1150
|
prevCursorFlags: l
|
|
1151
1151
|
}) {
|
|
1152
1152
|
let r = 0;
|
|
1153
|
-
n.forEach((
|
|
1154
|
-
const { group: f, groupSize: g } =
|
|
1155
|
-
let
|
|
1156
|
-
s ? d === "horizontal" ?
|
|
1153
|
+
n.forEach((c) => {
|
|
1154
|
+
const { group: f, groupSize: g } = c, { orientation: d, panels: z } = f, { disableCursor: b } = f.mutableState;
|
|
1155
|
+
let u = 0;
|
|
1156
|
+
s ? d === "horizontal" ? u = (t.clientX - s.x) / g * 100 : u = (t.clientY - s.y) / g * 100 : d === "horizontal" ? u = t.clientX < 0 ? -100 : 100 : u = t.clientY < 0 ? -100 : 100;
|
|
1157
1157
|
const p = o.get(f), m = i.get(f);
|
|
1158
1158
|
if (!p || !m)
|
|
1159
1159
|
return;
|
|
@@ -1166,27 +1166,27 @@ function st({
|
|
|
1166
1166
|
} = m;
|
|
1167
1167
|
if (v && h && P) {
|
|
1168
1168
|
const M = se({
|
|
1169
|
-
delta:
|
|
1169
|
+
delta: u,
|
|
1170
1170
|
initialLayout: p,
|
|
1171
1171
|
panelConstraints: v,
|
|
1172
|
-
pivotIndices:
|
|
1172
|
+
pivotIndices: c.panels.map((L) => z.indexOf(L)),
|
|
1173
1173
|
prevLayout: h,
|
|
1174
1174
|
trigger: "mouse-or-touch"
|
|
1175
1175
|
});
|
|
1176
1176
|
if (V(M, h)) {
|
|
1177
|
-
if (
|
|
1177
|
+
if (u !== 0 && !b)
|
|
1178
1178
|
switch (d) {
|
|
1179
1179
|
case "horizontal": {
|
|
1180
|
-
r |=
|
|
1180
|
+
r |= u < 0 ? nt : ot;
|
|
1181
1181
|
break;
|
|
1182
1182
|
}
|
|
1183
1183
|
case "vertical": {
|
|
1184
|
-
r |=
|
|
1184
|
+
r |= u < 0 ? it : rt;
|
|
1185
1185
|
break;
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
1188
|
} else
|
|
1189
|
-
_(
|
|
1189
|
+
_(c.group, {
|
|
1190
1190
|
defaultLayoutDeferred: S,
|
|
1191
1191
|
derivedPanelConstraints: v,
|
|
1192
1192
|
groupSize: y,
|
|
@@ -1196,7 +1196,7 @@ function st({
|
|
|
1196
1196
|
}
|
|
1197
1197
|
});
|
|
1198
1198
|
let a = 0;
|
|
1199
|
-
t.movementX === 0 ? a |= l & Ae : a |= r & Ae, t.movementY === 0 ? a |= l & Ne : a |= r & Ne, At(a),
|
|
1199
|
+
t.movementX === 0 ? a |= l & Ae : a |= r & Ae, t.movementY === 0 ? a |= l & Ne : a |= r & Ne, At(a), we(e);
|
|
1200
1200
|
}
|
|
1201
1201
|
function $e(e) {
|
|
1202
1202
|
const t = U(), n = W();
|
|
@@ -1226,7 +1226,7 @@ function je(e) {
|
|
|
1226
1226
|
cursorFlags: 0,
|
|
1227
1227
|
state: "inactive"
|
|
1228
1228
|
}), t.hitRegions.forEach((o) => {
|
|
1229
|
-
const i =
|
|
1229
|
+
const i = j(o.group.id, !0);
|
|
1230
1230
|
_(o.group, i);
|
|
1231
1231
|
});
|
|
1232
1232
|
return;
|
|
@@ -1248,7 +1248,7 @@ function je(e) {
|
|
|
1248
1248
|
break;
|
|
1249
1249
|
}
|
|
1250
1250
|
default: {
|
|
1251
|
-
const o =
|
|
1251
|
+
const o = be(e, n);
|
|
1252
1252
|
o.length === 0 ? t.state !== "inactive" && Z({
|
|
1253
1253
|
cursorFlags: 0,
|
|
1254
1254
|
state: "inactive"
|
|
@@ -1256,7 +1256,7 @@ function je(e) {
|
|
|
1256
1256
|
cursorFlags: 0,
|
|
1257
1257
|
hitRegions: o,
|
|
1258
1258
|
state: "hover"
|
|
1259
|
-
}),
|
|
1259
|
+
}), we(e.currentTarget);
|
|
1260
1260
|
break;
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
@@ -1282,8 +1282,8 @@ function Ve(e) {
|
|
|
1282
1282
|
Z({
|
|
1283
1283
|
cursorFlags: 0,
|
|
1284
1284
|
state: "inactive"
|
|
1285
|
-
}), t.hitRegions.length > 0 && (
|
|
1286
|
-
const o =
|
|
1285
|
+
}), t.hitRegions.length > 0 && (we(e.currentTarget), t.hitRegions.forEach((n) => {
|
|
1286
|
+
const o = j(n.group.id, !0);
|
|
1287
1287
|
_(n.group, o);
|
|
1288
1288
|
}), e.preventDefault());
|
|
1289
1289
|
}
|
|
@@ -1294,13 +1294,13 @@ function Be(e) {
|
|
|
1294
1294
|
for (const s of e)
|
|
1295
1295
|
if (s.defaultSize !== void 0) {
|
|
1296
1296
|
t++;
|
|
1297
|
-
const l =
|
|
1297
|
+
const l = T(s.defaultSize);
|
|
1298
1298
|
n += l, o[s.panelId] = l;
|
|
1299
1299
|
} else
|
|
1300
1300
|
o[s.panelId] = void 0;
|
|
1301
1301
|
const i = e.length - t;
|
|
1302
1302
|
if (i !== 0) {
|
|
1303
|
-
const s =
|
|
1303
|
+
const s = T((100 - n) / i);
|
|
1304
1304
|
for (const l of e)
|
|
1305
1305
|
l.defaultSize === void 0 && (o[l.panelId] = s);
|
|
1306
1306
|
}
|
|
@@ -1309,11 +1309,11 @@ function Be(e) {
|
|
|
1309
1309
|
function Ft(e, t, n) {
|
|
1310
1310
|
if (!n[0])
|
|
1311
1311
|
return;
|
|
1312
|
-
const i = e.panels.find((
|
|
1312
|
+
const i = e.panels.find((c) => c.element === t);
|
|
1313
1313
|
if (!i || !i.onResize)
|
|
1314
1314
|
return;
|
|
1315
1315
|
const s = Q({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
|
|
1316
|
-
asPercentage:
|
|
1316
|
+
asPercentage: T(l / s * 100),
|
|
1317
1317
|
inPixels: l
|
|
1318
1318
|
};
|
|
1319
1319
|
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
@@ -1341,10 +1341,10 @@ function jt({
|
|
|
1341
1341
|
switch (g.panelConstraints.groupResizeBehavior) {
|
|
1342
1342
|
case "preserve-pixel-size": {
|
|
1343
1343
|
l = !0;
|
|
1344
|
-
const z = d / 100 * n,
|
|
1344
|
+
const z = d / 100 * n, b = T(
|
|
1345
1345
|
z / t * 100
|
|
1346
1346
|
);
|
|
1347
|
-
r.set(g.id,
|
|
1347
|
+
r.set(g.id, b), i += b;
|
|
1348
1348
|
break;
|
|
1349
1349
|
}
|
|
1350
1350
|
case "preserve-relative-size":
|
|
@@ -1356,19 +1356,19 @@ function jt({
|
|
|
1356
1356
|
}
|
|
1357
1357
|
if (!l || a.length === 0)
|
|
1358
1358
|
return o;
|
|
1359
|
-
const
|
|
1359
|
+
const c = 100 - i, f = { ...o };
|
|
1360
1360
|
if (r.forEach((g, d) => {
|
|
1361
1361
|
f[d] = g;
|
|
1362
1362
|
}), s > 0)
|
|
1363
1363
|
for (const g of a) {
|
|
1364
1364
|
const d = o[g] ?? 0;
|
|
1365
|
-
f[g] =
|
|
1366
|
-
d / s *
|
|
1365
|
+
f[g] = T(
|
|
1366
|
+
d / s * c
|
|
1367
1367
|
);
|
|
1368
1368
|
}
|
|
1369
1369
|
else {
|
|
1370
|
-
const g =
|
|
1371
|
-
|
|
1370
|
+
const g = T(
|
|
1371
|
+
c / a.length
|
|
1372
1372
|
);
|
|
1373
1373
|
for (const d of a)
|
|
1374
1374
|
f[d] = g;
|
|
@@ -1387,31 +1387,31 @@ function Ht(e, t) {
|
|
|
1387
1387
|
const q = /* @__PURE__ */ new Map();
|
|
1388
1388
|
function Vt(e) {
|
|
1389
1389
|
let t = !0;
|
|
1390
|
-
|
|
1390
|
+
C(
|
|
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 p of
|
|
1394
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((u) => {
|
|
1395
|
+
for (const p of u) {
|
|
1396
1396
|
const { borderBoxSize: m, target: S } = p;
|
|
1397
1397
|
if (S === e.element) {
|
|
1398
1398
|
if (t) {
|
|
1399
1399
|
const v = Q({ group: e });
|
|
1400
1400
|
if (v === 0)
|
|
1401
1401
|
return;
|
|
1402
|
-
const y =
|
|
1402
|
+
const y = j(e.id);
|
|
1403
1403
|
if (!y)
|
|
1404
1404
|
return;
|
|
1405
|
-
const h =
|
|
1405
|
+
const h = Se(e), P = y.defaultLayoutDeferred ? Be(h) : y.layout, M = jt({
|
|
1406
1406
|
group: e,
|
|
1407
1407
|
nextGroupSize: v,
|
|
1408
1408
|
prevGroupSize: y.groupSize,
|
|
1409
1409
|
prevLayout: P
|
|
1410
|
-
}),
|
|
1410
|
+
}), L = B({
|
|
1411
1411
|
layout: M,
|
|
1412
1412
|
panelConstraints: h
|
|
1413
1413
|
});
|
|
1414
|
-
if (!y.defaultLayoutDeferred && V(y.layout,
|
|
1414
|
+
if (!y.defaultLayoutDeferred && V(y.layout, L) && $t(
|
|
1415
1415
|
y.derivedPanelConstraints,
|
|
1416
1416
|
h
|
|
1417
1417
|
) && y.groupSize === v)
|
|
@@ -1420,7 +1420,7 @@ function Vt(e) {
|
|
|
1420
1420
|
defaultLayoutDeferred: !1,
|
|
1421
1421
|
derivedPanelConstraints: h,
|
|
1422
1422
|
groupSize: v,
|
|
1423
|
-
layout:
|
|
1423
|
+
layout: L,
|
|
1424
1424
|
separatorToPanels: y.separatorToPanels
|
|
1425
1425
|
});
|
|
1426
1426
|
}
|
|
@@ -1428,16 +1428,16 @@ function Vt(e) {
|
|
|
1428
1428
|
Ft(e, S, m);
|
|
1429
1429
|
}
|
|
1430
1430
|
});
|
|
1431
|
-
s.observe(e.element), e.panels.forEach((
|
|
1432
|
-
|
|
1433
|
-
!o.has(
|
|
1434
|
-
`Panel ids must be unique; id "${
|
|
1435
|
-
), o.add(
|
|
1431
|
+
s.observe(e.element), e.panels.forEach((u) => {
|
|
1432
|
+
C(
|
|
1433
|
+
!o.has(u.id),
|
|
1434
|
+
`Panel ids must be unique; id "${u.id}" was used more than once`
|
|
1435
|
+
), o.add(u.id), u.onResize && s.observe(u.element);
|
|
1436
1436
|
});
|
|
1437
|
-
const l = Q({ group: e }), r =
|
|
1438
|
-
let
|
|
1439
|
-
|
|
1440
|
-
const f = e.mutableState.layouts[a] ??
|
|
1437
|
+
const l = Q({ group: e }), r = Se(e), a = e.panels.map(({ id: u }) => u).join(",");
|
|
1438
|
+
let c = e.mutableState.defaultLayout;
|
|
1439
|
+
c && (Ht(e.panels, c) || (c = void 0));
|
|
1440
|
+
const f = e.mutableState.layouts[a] ?? c ?? Be(r), g = B({
|
|
1441
1441
|
layout: f,
|
|
1442
1442
|
panelConstraints: r
|
|
1443
1443
|
}), d = e.element.ownerDocument;
|
|
@@ -1446,19 +1446,19 @@ function Vt(e) {
|
|
|
1446
1446
|
(q.get(d) ?? 0) + 1
|
|
1447
1447
|
);
|
|
1448
1448
|
const z = /* @__PURE__ */ new Map();
|
|
1449
|
-
return Ye(e).forEach((
|
|
1450
|
-
|
|
1449
|
+
return Ye(e).forEach((u) => {
|
|
1450
|
+
u.separator && z.set(u.separator, u.panels);
|
|
1451
1451
|
}), _(e, {
|
|
1452
1452
|
defaultLayoutDeferred: l === 0,
|
|
1453
1453
|
derivedPanelConstraints: r,
|
|
1454
1454
|
groupSize: l,
|
|
1455
1455
|
layout: g,
|
|
1456
1456
|
separatorToPanels: z
|
|
1457
|
-
}), e.separators.forEach((
|
|
1458
|
-
|
|
1459
|
-
!i.has(
|
|
1460
|
-
`Separator ids must be unique; id "${
|
|
1461
|
-
), i.add(
|
|
1457
|
+
}), e.separators.forEach((u) => {
|
|
1458
|
+
C(
|
|
1459
|
+
!i.has(u.id),
|
|
1460
|
+
`Separator ids must be unique; id "${u.id}" was used more than once`
|
|
1461
|
+
), i.add(u.id), u.element.addEventListener("keydown", Oe);
|
|
1462
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,
|
|
@@ -1480,13 +1480,13 @@ function Bt() {
|
|
|
1480
1480
|
const [e, t] = re({}), n = ne(() => t({}), []);
|
|
1481
1481
|
return [e, n];
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1483
|
+
function Pe(e) {
|
|
1484
1484
|
const t = pt();
|
|
1485
1485
|
return `${e ?? t}`;
|
|
1486
1486
|
}
|
|
1487
|
-
const K = typeof window < "u" ? We :
|
|
1487
|
+
const K = typeof window < "u" ? We : he;
|
|
1488
1488
|
function oe(e) {
|
|
1489
|
-
const t =
|
|
1489
|
+
const t = O(e);
|
|
1490
1490
|
return K(() => {
|
|
1491
1491
|
t.current = e;
|
|
1492
1492
|
}, [e]), ne(
|
|
@@ -1494,7 +1494,7 @@ function oe(e) {
|
|
|
1494
1494
|
[t]
|
|
1495
1495
|
);
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function Le(...e) {
|
|
1498
1498
|
return oe((t) => {
|
|
1499
1499
|
e.forEach((n) => {
|
|
1500
1500
|
if (n)
|
|
@@ -1511,8 +1511,8 @@ function Pe(...e) {
|
|
|
1511
1511
|
});
|
|
1512
1512
|
});
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1515
|
-
const t =
|
|
1514
|
+
function Ce(e) {
|
|
1515
|
+
const t = O({ ...e });
|
|
1516
1516
|
return K(() => {
|
|
1517
1517
|
for (const n in e)
|
|
1518
1518
|
t.current[n] = e[n];
|
|
@@ -1520,7 +1520,7 @@ function Le(e) {
|
|
|
1520
1520
|
}
|
|
1521
1521
|
const at = ht(null);
|
|
1522
1522
|
function Wt(e, t) {
|
|
1523
|
-
const n =
|
|
1523
|
+
const n = O({
|
|
1524
1524
|
getLayout: () => ({}),
|
|
1525
1525
|
setLayout: Nt
|
|
1526
1526
|
});
|
|
@@ -1541,7 +1541,7 @@ function Ut({
|
|
|
1541
1541
|
groupRef: l,
|
|
1542
1542
|
id: r,
|
|
1543
1543
|
onLayoutChange: a,
|
|
1544
|
-
onLayoutChanged:
|
|
1544
|
+
onLayoutChanged: c,
|
|
1545
1545
|
orientation: f = "horizontal",
|
|
1546
1546
|
resizeTargetMinimumSize: g = {
|
|
1547
1547
|
coarse: 20,
|
|
@@ -1550,37 +1550,37 @@ function Ut({
|
|
|
1550
1550
|
style: d,
|
|
1551
1551
|
...z
|
|
1552
1552
|
}) {
|
|
1553
|
-
const
|
|
1553
|
+
const b = O({
|
|
1554
1554
|
onLayoutChange: {},
|
|
1555
1555
|
onLayoutChanged: {}
|
|
1556
|
-
}),
|
|
1557
|
-
V(
|
|
1558
|
-
}), p = oe((
|
|
1559
|
-
V(
|
|
1560
|
-
}), m =
|
|
1556
|
+
}), u = oe((x) => {
|
|
1557
|
+
V(b.current.onLayoutChange, x) || (b.current.onLayoutChange = x, a?.(x));
|
|
1558
|
+
}), p = oe((x) => {
|
|
1559
|
+
V(b.current.onLayoutChanged, x) || (b.current.onLayoutChanged = x, c?.(x));
|
|
1560
|
+
}), m = Pe(r), S = O(null), [v, y] = Bt(), h = O({
|
|
1561
1561
|
lastExpandedPanelSizes: {},
|
|
1562
1562
|
layouts: {},
|
|
1563
1563
|
panels: [],
|
|
1564
1564
|
resizeTargetMinimumSize: g,
|
|
1565
1565
|
separators: []
|
|
1566
|
-
}), P =
|
|
1566
|
+
}), P = Le(S, s);
|
|
1567
1567
|
Wt(m, l);
|
|
1568
1568
|
const M = oe(
|
|
1569
|
-
(
|
|
1570
|
-
const E = W(), R = Ee(
|
|
1569
|
+
(x, w) => {
|
|
1570
|
+
const E = W(), R = Ee(x), k = j(x);
|
|
1571
1571
|
if (k) {
|
|
1572
|
-
let
|
|
1572
|
+
let I = !1;
|
|
1573
1573
|
switch (E.state) {
|
|
1574
1574
|
case "active": {
|
|
1575
|
-
|
|
1576
|
-
(
|
|
1575
|
+
I = E.hitRegions.some(
|
|
1576
|
+
($) => $.group === R
|
|
1577
1577
|
);
|
|
1578
1578
|
break;
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
1581
|
return {
|
|
1582
1582
|
flexGrow: k.layout[w] ?? 1,
|
|
1583
|
-
pointerEvents:
|
|
1583
|
+
pointerEvents: I ? "none" : void 0
|
|
1584
1584
|
};
|
|
1585
1585
|
}
|
|
1586
1586
|
if (n?.[w])
|
|
@@ -1588,79 +1588,82 @@ function Ut({
|
|
|
1588
1588
|
flexGrow: n?.[w]
|
|
1589
1589
|
};
|
|
1590
1590
|
}
|
|
1591
|
-
),
|
|
1591
|
+
), L = Ce({
|
|
1592
1592
|
defaultLayout: n,
|
|
1593
1593
|
disableCursor: o
|
|
1594
|
-
}), X =
|
|
1594
|
+
}), X = ye(
|
|
1595
1595
|
() => ({
|
|
1596
1596
|
get disableCursor() {
|
|
1597
|
-
return !!
|
|
1597
|
+
return !!L.disableCursor;
|
|
1598
1598
|
},
|
|
1599
1599
|
getPanelStyles: M,
|
|
1600
1600
|
id: m,
|
|
1601
1601
|
orientation: f,
|
|
1602
|
-
registerPanel: (
|
|
1602
|
+
registerPanel: (x) => {
|
|
1603
1603
|
const w = h.current;
|
|
1604
|
-
return w.panels =
|
|
1604
|
+
return w.panels = ve(f, [
|
|
1605
1605
|
...w.panels,
|
|
1606
|
-
|
|
1606
|
+
x
|
|
1607
1607
|
]), y(), () => {
|
|
1608
1608
|
w.panels = w.panels.filter(
|
|
1609
|
-
(E) => E !==
|
|
1609
|
+
(E) => E !== x
|
|
1610
1610
|
), y();
|
|
1611
1611
|
};
|
|
1612
1612
|
},
|
|
1613
|
-
registerSeparator: (
|
|
1613
|
+
registerSeparator: (x) => {
|
|
1614
1614
|
const w = h.current;
|
|
1615
|
-
return w.separators =
|
|
1615
|
+
return w.separators = ve(f, [
|
|
1616
1616
|
...w.separators,
|
|
1617
|
-
|
|
1617
|
+
x
|
|
1618
1618
|
]), y(), () => {
|
|
1619
1619
|
w.separators = w.separators.filter(
|
|
1620
|
-
(E) => E !==
|
|
1620
|
+
(E) => E !== x
|
|
1621
1621
|
), y();
|
|
1622
1622
|
};
|
|
1623
1623
|
},
|
|
1624
|
-
|
|
1624
|
+
updatePanelProps: (x, { disabled: w }) => {
|
|
1625
1625
|
const R = h.current.panels.find(
|
|
1626
|
-
(
|
|
1626
|
+
($) => $.id === x
|
|
1627
1627
|
);
|
|
1628
1628
|
R && (R.panelConstraints.disabled = w);
|
|
1629
|
-
const k = Ee(m),
|
|
1630
|
-
k &&
|
|
1631
|
-
...
|
|
1632
|
-
derivedPanelConstraints:
|
|
1629
|
+
const k = Ee(m), I = j(m);
|
|
1630
|
+
k && I && _(k, {
|
|
1631
|
+
...I,
|
|
1632
|
+
derivedPanelConstraints: Se(k)
|
|
1633
1633
|
});
|
|
1634
1634
|
},
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1635
|
+
updateSeparatorProps: (x, {
|
|
1636
|
+
disabled: w,
|
|
1637
|
+
disableDoubleClick: E
|
|
1638
|
+
}) => {
|
|
1639
|
+
const k = h.current.separators.find(
|
|
1640
|
+
(I) => I.id === x
|
|
1638
1641
|
);
|
|
1639
|
-
|
|
1642
|
+
k && (k.disabled = w, k.disableDoubleClick = E);
|
|
1640
1643
|
}
|
|
1641
1644
|
}),
|
|
1642
|
-
[M, m, y, f,
|
|
1643
|
-
), F =
|
|
1645
|
+
[M, m, y, f, L]
|
|
1646
|
+
), F = O(null);
|
|
1644
1647
|
return K(() => {
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1648
|
+
const x = S.current;
|
|
1649
|
+
if (x === null)
|
|
1647
1650
|
return;
|
|
1648
1651
|
const w = h.current;
|
|
1649
1652
|
let E;
|
|
1650
|
-
if (
|
|
1653
|
+
if (L.defaultLayout !== void 0 && Object.keys(L.defaultLayout).length === w.panels.length) {
|
|
1651
1654
|
E = {};
|
|
1652
1655
|
for (const ee of w.panels) {
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1656
|
+
const le = L.defaultLayout[ee.id];
|
|
1657
|
+
le !== void 0 && (E[ee.id] = le);
|
|
1655
1658
|
}
|
|
1656
1659
|
}
|
|
1657
1660
|
const R = {
|
|
1658
1661
|
disabled: !!i,
|
|
1659
|
-
element:
|
|
1662
|
+
element: x,
|
|
1660
1663
|
id: m,
|
|
1661
1664
|
mutableState: {
|
|
1662
1665
|
defaultLayout: E,
|
|
1663
|
-
disableCursor: !!
|
|
1666
|
+
disableCursor: !!L.disableCursor,
|
|
1664
1667
|
expandedPanelSizes: h.current.lastExpandedPanelSizes,
|
|
1665
1668
|
layouts: h.current.layouts
|
|
1666
1669
|
},
|
|
@@ -1670,30 +1673,30 @@ function Ut({
|
|
|
1670
1673
|
separators: w.separators
|
|
1671
1674
|
};
|
|
1672
1675
|
F.current = R;
|
|
1673
|
-
const k = Vt(R), { defaultLayoutDeferred:
|
|
1674
|
-
!
|
|
1675
|
-
const lt =
|
|
1676
|
-
const { defaultLayoutDeferred:
|
|
1677
|
-
if (
|
|
1676
|
+
const k = Vt(R), { defaultLayoutDeferred: I, derivedPanelConstraints: $, layout: ae } = j(R.id, !0);
|
|
1677
|
+
!I && $.length > 0 && (u(ae), p(ae));
|
|
1678
|
+
const lt = ze(m, (ee) => {
|
|
1679
|
+
const { defaultLayoutDeferred: le, derivedPanelConstraints: Me, layout: ue } = ee.next;
|
|
1680
|
+
if (le || Me.length === 0)
|
|
1678
1681
|
return;
|
|
1679
1682
|
const ut = R.panels.map(({ id: N }) => N).join(",");
|
|
1680
|
-
R.mutableState.layouts[ut] =
|
|
1683
|
+
R.mutableState.layouts[ut] = ue, Me.forEach((N) => {
|
|
1681
1684
|
if (N.collapsible) {
|
|
1682
|
-
const { layout:
|
|
1683
|
-
if (
|
|
1684
|
-
const ft =
|
|
1685
|
+
const { layout: me } = ee.prev ?? {};
|
|
1686
|
+
if (me) {
|
|
1687
|
+
const ft = D(
|
|
1685
1688
|
N.collapsedSize,
|
|
1686
|
-
|
|
1687
|
-
), dt =
|
|
1689
|
+
ue[N.panelId]
|
|
1690
|
+
), dt = D(
|
|
1688
1691
|
N.collapsedSize,
|
|
1689
|
-
|
|
1692
|
+
me[N.panelId]
|
|
1690
1693
|
);
|
|
1691
|
-
ft && !dt && (R.mutableState.expandedPanelSizes[N.panelId] =
|
|
1694
|
+
ft && !dt && (R.mutableState.expandedPanelSizes[N.panelId] = me[N.panelId]);
|
|
1692
1695
|
}
|
|
1693
1696
|
}
|
|
1694
1697
|
});
|
|
1695
1698
|
const ct = W().state !== "active";
|
|
1696
|
-
|
|
1699
|
+
u(ue), ct && p(ue);
|
|
1697
1700
|
});
|
|
1698
1701
|
return () => {
|
|
1699
1702
|
F.current = null, k(), lt();
|
|
@@ -1702,13 +1705,13 @@ function Ut({
|
|
|
1702
1705
|
i,
|
|
1703
1706
|
m,
|
|
1704
1707
|
p,
|
|
1705
|
-
|
|
1708
|
+
u,
|
|
1706
1709
|
f,
|
|
1707
1710
|
v,
|
|
1708
|
-
|
|
1709
|
-
]),
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1711
|
+
L
|
|
1712
|
+
]), he(() => {
|
|
1713
|
+
const x = F.current;
|
|
1714
|
+
x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
|
|
1712
1715
|
}), /* @__PURE__ */ ie(at.Provider, { value: X, children: /* @__PURE__ */ ie(
|
|
1713
1716
|
"div",
|
|
1714
1717
|
{
|
|
@@ -1737,7 +1740,7 @@ function Ut({
|
|
|
1737
1740
|
) });
|
|
1738
1741
|
}
|
|
1739
1742
|
Ut.displayName = "Group";
|
|
1740
|
-
function
|
|
1743
|
+
function pe(e, t) {
|
|
1741
1744
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1742
1745
|
}
|
|
1743
1746
|
function Kt({
|
|
@@ -1745,7 +1748,7 @@ function Kt({
|
|
|
1745
1748
|
panelIds: t,
|
|
1746
1749
|
storage: n
|
|
1747
1750
|
}) {
|
|
1748
|
-
const o =
|
|
1751
|
+
const o = pe(e, []), i = n.getItem(o);
|
|
1749
1752
|
if (i)
|
|
1750
1753
|
try {
|
|
1751
1754
|
const s = JSON.parse(i);
|
|
@@ -1753,8 +1756,8 @@ function Kt({
|
|
|
1753
1756
|
const l = t.join(","), r = s[l];
|
|
1754
1757
|
if (r && Array.isArray(r.layout) && t.length === r.layout.length) {
|
|
1755
1758
|
const a = {};
|
|
1756
|
-
for (let
|
|
1757
|
-
a[t[
|
|
1759
|
+
for (let c = 0; c < t.length; c++)
|
|
1760
|
+
a[t[c]] = r.layout[c];
|
|
1758
1761
|
return a;
|
|
1759
1762
|
}
|
|
1760
1763
|
} else {
|
|
@@ -1764,10 +1767,10 @@ function Kt({
|
|
|
1764
1767
|
if (r && Array.isArray(r.layout)) {
|
|
1765
1768
|
const a = l[0].split(",");
|
|
1766
1769
|
if (a.length === r.layout.length) {
|
|
1767
|
-
const
|
|
1770
|
+
const c = {};
|
|
1768
1771
|
for (let f = 0; f < a.length; f++)
|
|
1769
|
-
|
|
1770
|
-
return
|
|
1772
|
+
c[a[f]] = r.layout[f];
|
|
1773
|
+
return c;
|
|
1771
1774
|
}
|
|
1772
1775
|
}
|
|
1773
1776
|
}
|
|
@@ -1781,46 +1784,46 @@ function on({
|
|
|
1781
1784
|
storage: n = localStorage,
|
|
1782
1785
|
...o
|
|
1783
1786
|
}) {
|
|
1784
|
-
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l =
|
|
1787
|
+
const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = pe(s, t ?? []), r = Ke(
|
|
1785
1788
|
Xt,
|
|
1786
1789
|
() => n.getItem(l),
|
|
1787
1790
|
() => n.getItem(l)
|
|
1788
|
-
), a =
|
|
1791
|
+
), a = ye(() => {
|
|
1789
1792
|
if (r) {
|
|
1790
|
-
const
|
|
1793
|
+
const u = JSON.parse(r), p = Object.values(u);
|
|
1791
1794
|
if (Array.from(p).every((m) => typeof m == "number"))
|
|
1792
|
-
return
|
|
1795
|
+
return u;
|
|
1793
1796
|
}
|
|
1794
|
-
}, [r]),
|
|
1797
|
+
}, [r]), c = ye(() => {
|
|
1795
1798
|
if (!a)
|
|
1796
1799
|
return Kt({
|
|
1797
1800
|
id: s,
|
|
1798
1801
|
panelIds: t,
|
|
1799
1802
|
storage: n
|
|
1800
1803
|
});
|
|
1801
|
-
}, [a, s, t, n]), f = a ??
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1804
|
+
}, [a, s, t, n]), f = a ?? c, g = O(null), d = ne(() => {
|
|
1805
|
+
const u = g.current;
|
|
1806
|
+
u && (g.current = null, clearTimeout(u));
|
|
1804
1807
|
}, []);
|
|
1805
1808
|
We(() => () => {
|
|
1806
1809
|
d();
|
|
1807
1810
|
}, [d]);
|
|
1808
1811
|
const z = ne(
|
|
1809
|
-
(
|
|
1812
|
+
(u) => {
|
|
1810
1813
|
d();
|
|
1811
1814
|
let p;
|
|
1812
|
-
i ? p =
|
|
1815
|
+
i ? p = pe(s, Object.keys(u)) : p = pe(s, []);
|
|
1813
1816
|
try {
|
|
1814
|
-
n.setItem(p, JSON.stringify(
|
|
1817
|
+
n.setItem(p, JSON.stringify(u));
|
|
1815
1818
|
} catch (m) {
|
|
1816
1819
|
console.error(m);
|
|
1817
1820
|
}
|
|
1818
1821
|
},
|
|
1819
1822
|
[d, i, s, n]
|
|
1820
|
-
),
|
|
1821
|
-
(
|
|
1822
|
-
d(), e === 0 ? z(
|
|
1823
|
-
z(
|
|
1823
|
+
), b = ne(
|
|
1824
|
+
(u) => {
|
|
1825
|
+
d(), e === 0 ? z(u) : g.current = setTimeout(() => {
|
|
1826
|
+
z(u);
|
|
1824
1827
|
}, e);
|
|
1825
1828
|
},
|
|
1826
1829
|
[d, e, z]
|
|
@@ -1835,7 +1838,7 @@ function on({
|
|
|
1835
1838
|
*
|
|
1836
1839
|
* @deprecated Use the {@link onLayoutChanged} prop instead.
|
|
1837
1840
|
*/
|
|
1838
|
-
onLayoutChange:
|
|
1841
|
+
onLayoutChange: b,
|
|
1839
1842
|
/**
|
|
1840
1843
|
* Attach this callback on the `Group` as the `onLayoutChanged` prop.
|
|
1841
1844
|
*/
|
|
@@ -1850,25 +1853,25 @@ function rn() {
|
|
|
1850
1853
|
return re(null);
|
|
1851
1854
|
}
|
|
1852
1855
|
function sn() {
|
|
1853
|
-
return
|
|
1856
|
+
return O(null);
|
|
1854
1857
|
}
|
|
1855
|
-
function
|
|
1858
|
+
function Re() {
|
|
1856
1859
|
const e = mt(at);
|
|
1857
|
-
return
|
|
1860
|
+
return C(
|
|
1858
1861
|
e,
|
|
1859
1862
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1860
1863
|
), e;
|
|
1861
1864
|
}
|
|
1862
1865
|
function qt(e, t) {
|
|
1863
|
-
const { id: n } =
|
|
1864
|
-
collapse:
|
|
1865
|
-
expand:
|
|
1866
|
+
const { id: n } = Re(), o = O({
|
|
1867
|
+
collapse: ge,
|
|
1868
|
+
expand: ge,
|
|
1866
1869
|
getSize: () => ({
|
|
1867
1870
|
asPercentage: 0,
|
|
1868
1871
|
inPixels: 0
|
|
1869
1872
|
}),
|
|
1870
1873
|
isCollapsed: () => !1,
|
|
1871
|
-
resize:
|
|
1874
|
+
resize: ge
|
|
1872
1875
|
});
|
|
1873
1876
|
Ue(t, () => o.current, []), K(() => {
|
|
1874
1877
|
Object.assign(
|
|
@@ -1887,24 +1890,24 @@ function Yt({
|
|
|
1887
1890
|
elementRef: l,
|
|
1888
1891
|
groupResizeBehavior: r = "preserve-relative-size",
|
|
1889
1892
|
id: a,
|
|
1890
|
-
maxSize:
|
|
1893
|
+
maxSize: c = "100%",
|
|
1891
1894
|
minSize: f = "0%",
|
|
1892
1895
|
onResize: g,
|
|
1893
1896
|
panelRef: d,
|
|
1894
1897
|
style: z,
|
|
1895
|
-
...
|
|
1898
|
+
...b
|
|
1896
1899
|
}) {
|
|
1897
|
-
const
|
|
1900
|
+
const u = !!a, p = Pe(a), m = Ce({
|
|
1898
1901
|
disabled: s
|
|
1899
|
-
}), S =
|
|
1902
|
+
}), S = O(null), v = Le(S, l), {
|
|
1900
1903
|
getPanelStyles: y,
|
|
1901
1904
|
id: h,
|
|
1902
1905
|
orientation: P,
|
|
1903
1906
|
registerPanel: M,
|
|
1904
|
-
|
|
1905
|
-
} =
|
|
1906
|
-
(R, k,
|
|
1907
|
-
g?.(R, a,
|
|
1907
|
+
updatePanelProps: L
|
|
1908
|
+
} = Re(), X = g !== null, F = oe(
|
|
1909
|
+
(R, k, I) => {
|
|
1910
|
+
g?.(R, a, I);
|
|
1908
1911
|
}
|
|
1909
1912
|
);
|
|
1910
1913
|
K(() => {
|
|
@@ -1913,7 +1916,7 @@ function Yt({
|
|
|
1913
1916
|
const k = {
|
|
1914
1917
|
element: R,
|
|
1915
1918
|
id: p,
|
|
1916
|
-
idIsStable:
|
|
1919
|
+
idIsStable: u,
|
|
1917
1920
|
mutableValues: {
|
|
1918
1921
|
expandToSize: void 0,
|
|
1919
1922
|
prevSize: void 0
|
|
@@ -1925,7 +1928,7 @@ function Yt({
|
|
|
1925
1928
|
collapsible: o,
|
|
1926
1929
|
defaultSize: i,
|
|
1927
1930
|
disabled: m.disabled,
|
|
1928
|
-
maxSize:
|
|
1931
|
+
maxSize: c,
|
|
1929
1932
|
minSize: f
|
|
1930
1933
|
}
|
|
1931
1934
|
};
|
|
@@ -1938,23 +1941,23 @@ function Yt({
|
|
|
1938
1941
|
i,
|
|
1939
1942
|
X,
|
|
1940
1943
|
p,
|
|
1941
|
-
c,
|
|
1942
1944
|
u,
|
|
1945
|
+
c,
|
|
1943
1946
|
f,
|
|
1944
1947
|
F,
|
|
1945
1948
|
M,
|
|
1946
1949
|
m
|
|
1947
|
-
]),
|
|
1948
|
-
|
|
1949
|
-
}, [s, p,
|
|
1950
|
-
const
|
|
1950
|
+
]), he(() => {
|
|
1951
|
+
L(p, { disabled: s });
|
|
1952
|
+
}, [s, p, L]), qt(p, d);
|
|
1953
|
+
const x = () => {
|
|
1951
1954
|
const R = y(h, p);
|
|
1952
1955
|
if (R)
|
|
1953
1956
|
return JSON.stringify(R);
|
|
1954
1957
|
}, w = Ke(
|
|
1955
|
-
(R) =>
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
+
(R) => ze(h, R),
|
|
1959
|
+
x,
|
|
1960
|
+
x
|
|
1958
1961
|
);
|
|
1959
1962
|
let E;
|
|
1960
1963
|
return w ? E = JSON.parse(w) : i ? E = {
|
|
@@ -1964,7 +1967,7 @@ function Yt({
|
|
|
1964
1967
|
} : E = { flexGrow: 1 }, /* @__PURE__ */ ie(
|
|
1965
1968
|
"div",
|
|
1966
1969
|
{
|
|
1967
|
-
...
|
|
1970
|
+
...b,
|
|
1968
1971
|
"data-disabled": s || void 0,
|
|
1969
1972
|
"data-panel": !0,
|
|
1970
1973
|
"data-testid": p,
|
|
@@ -2017,7 +2020,7 @@ function an() {
|
|
|
2017
2020
|
return re(null);
|
|
2018
2021
|
}
|
|
2019
2022
|
function ln() {
|
|
2020
|
-
return
|
|
2023
|
+
return O(null);
|
|
2021
2024
|
}
|
|
2022
2025
|
function Zt({
|
|
2023
2026
|
layout: e,
|
|
@@ -2030,10 +2033,10 @@ function Zt({
|
|
|
2030
2033
|
(a) => a.panelId === n
|
|
2031
2034
|
);
|
|
2032
2035
|
if (r) {
|
|
2033
|
-
const a = r.maxSize,
|
|
2036
|
+
const a = r.maxSize, c = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
|
|
2034
2037
|
s = B({
|
|
2035
2038
|
layout: se({
|
|
2036
|
-
delta:
|
|
2039
|
+
delta: c - l,
|
|
2037
2040
|
initialLayout: e,
|
|
2038
2041
|
panelConstraints: t,
|
|
2039
2042
|
pivotIndices: f,
|
|
@@ -2062,81 +2065,84 @@ function Qt({
|
|
|
2062
2065
|
children: e,
|
|
2063
2066
|
className: t,
|
|
2064
2067
|
disabled: n,
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2068
|
+
disableDoubleClick: o,
|
|
2069
|
+
elementRef: i,
|
|
2070
|
+
id: s,
|
|
2071
|
+
style: l,
|
|
2072
|
+
...r
|
|
2069
2073
|
}) {
|
|
2070
|
-
const
|
|
2071
|
-
disabled: n
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2074
|
+
const a = Pe(s), c = Ce({
|
|
2075
|
+
disabled: n,
|
|
2076
|
+
disableDoubleClick: o
|
|
2077
|
+
}), [f, g] = re({}), [d, z] = re("inactive"), b = O(null), u = Le(b, i), {
|
|
2078
|
+
disableCursor: p,
|
|
2079
|
+
id: m,
|
|
2080
|
+
orientation: S,
|
|
2081
|
+
registerSeparator: v,
|
|
2082
|
+
updateSeparatorProps: y
|
|
2083
|
+
} = Re(), h = S === "horizontal" ? "vertical" : "horizontal";
|
|
2079
2084
|
K(() => {
|
|
2080
|
-
const
|
|
2081
|
-
if (
|
|
2082
|
-
const
|
|
2083
|
-
disabled:
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2085
|
+
const M = b.current;
|
|
2086
|
+
if (M !== null) {
|
|
2087
|
+
const L = {
|
|
2088
|
+
disabled: c.disabled,
|
|
2089
|
+
disableDoubleClick: c.disableDoubleClick,
|
|
2090
|
+
element: M,
|
|
2091
|
+
id: a
|
|
2092
|
+
}, X = v(L), F = Gt(
|
|
2093
|
+
(w) => {
|
|
2094
|
+
z(
|
|
2095
|
+
w.next.state !== "inactive" && w.next.hitRegions.some(
|
|
2096
|
+
(E) => E.separator === L
|
|
2097
|
+
) ? w.next.state : "inactive"
|
|
2092
2098
|
);
|
|
2093
2099
|
}
|
|
2094
|
-
),
|
|
2095
|
-
|
|
2096
|
-
(
|
|
2097
|
-
const { derivedPanelConstraints:
|
|
2098
|
-
if (
|
|
2099
|
-
const
|
|
2100
|
-
|
|
2100
|
+
), x = ze(
|
|
2101
|
+
m,
|
|
2102
|
+
(w) => {
|
|
2103
|
+
const { derivedPanelConstraints: E, layout: R, separatorToPanels: k } = w.next, I = k.get(L);
|
|
2104
|
+
if (I) {
|
|
2105
|
+
const $ = I[0], ae = I.indexOf($);
|
|
2106
|
+
g(
|
|
2101
2107
|
Zt({
|
|
2102
|
-
layout:
|
|
2103
|
-
panelConstraints:
|
|
2104
|
-
panelId:
|
|
2105
|
-
panelIndex:
|
|
2108
|
+
layout: R,
|
|
2109
|
+
panelConstraints: E,
|
|
2110
|
+
panelId: $.id,
|
|
2111
|
+
panelIndex: ae
|
|
2106
2112
|
})
|
|
2107
2113
|
);
|
|
2108
2114
|
}
|
|
2109
2115
|
}
|
|
2110
2116
|
);
|
|
2111
2117
|
return () => {
|
|
2112
|
-
|
|
2118
|
+
F(), x(), X();
|
|
2113
2119
|
};
|
|
2114
2120
|
}
|
|
2115
|
-
}, [
|
|
2116
|
-
|
|
2117
|
-
}, [n,
|
|
2118
|
-
let
|
|
2119
|
-
return n && !
|
|
2121
|
+
}, [m, a, v, c]), he(() => {
|
|
2122
|
+
y(a, { disabled: n, disableDoubleClick: o });
|
|
2123
|
+
}, [n, o, a, y]);
|
|
2124
|
+
let P;
|
|
2125
|
+
return n && !p && (P = "not-allowed"), /* @__PURE__ */ ie(
|
|
2120
2126
|
"div",
|
|
2121
2127
|
{
|
|
2122
|
-
...
|
|
2123
|
-
"aria-controls":
|
|
2128
|
+
...r,
|
|
2129
|
+
"aria-controls": f.valueControls,
|
|
2124
2130
|
"aria-disabled": n || void 0,
|
|
2125
|
-
"aria-orientation":
|
|
2126
|
-
"aria-valuemax":
|
|
2127
|
-
"aria-valuemin":
|
|
2128
|
-
"aria-valuenow":
|
|
2131
|
+
"aria-orientation": h,
|
|
2132
|
+
"aria-valuemax": f.valueMax,
|
|
2133
|
+
"aria-valuemin": f.valueMin,
|
|
2134
|
+
"aria-valuenow": f.valueNow,
|
|
2129
2135
|
children: e,
|
|
2130
2136
|
className: t,
|
|
2131
|
-
"data-separator": n ? "disabled" :
|
|
2132
|
-
"data-testid":
|
|
2133
|
-
id:
|
|
2134
|
-
ref:
|
|
2137
|
+
"data-separator": n ? "disabled" : d,
|
|
2138
|
+
"data-testid": a,
|
|
2139
|
+
id: a,
|
|
2140
|
+
ref: u,
|
|
2135
2141
|
role: "separator",
|
|
2136
2142
|
style: {
|
|
2137
2143
|
flexBasis: "auto",
|
|
2138
|
-
cursor:
|
|
2139
|
-
...
|
|
2144
|
+
cursor: P,
|
|
2145
|
+
...l,
|
|
2140
2146
|
flexGrow: 0,
|
|
2141
2147
|
flexShrink: 0,
|
|
2142
2148
|
// Inform the browser that the library is handling touch events for this element
|