react-resizable-panels 4.12.2 → 4.12.4
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
|
-
import { jsx as
|
|
3
|
-
import { useState as Q, useCallback as
|
|
2
|
+
import { jsx as se } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Q, useCallback as ie, useId as mt, useLayoutEffect as Ke, useEffect as ge, useRef as O, createContext as gt, useImperativeHandle as Xe, useMemo as ve, useSyncExternalStore as qe, useContext as yt } from "react";
|
|
4
4
|
function St(e, t) {
|
|
5
5
|
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
6
6
|
return t * o;
|
|
@@ -25,7 +25,7 @@ function xt(e) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function oe({
|
|
29
29
|
groupSize: e,
|
|
30
30
|
panelElement: t,
|
|
31
31
|
styleProp: n
|
|
@@ -69,7 +69,7 @@ function ne({
|
|
|
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 be(e) {
|
|
73
73
|
const { panels: t } = e, n = ne({ group: e });
|
|
74
74
|
return n === 0 ? t.map((o) => ({
|
|
75
75
|
groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
|
|
@@ -84,7 +84,7 @@ function ve(e) {
|
|
|
84
84
|
const { element: i, panelConstraints: s } = o;
|
|
85
85
|
let u = 0;
|
|
86
86
|
if (s.collapsedSize !== void 0) {
|
|
87
|
-
const c =
|
|
87
|
+
const c = oe({
|
|
88
88
|
groupSize: n,
|
|
89
89
|
panelElement: i,
|
|
90
90
|
styleProp: s.collapsedSize
|
|
@@ -93,7 +93,7 @@ function ve(e) {
|
|
|
93
93
|
}
|
|
94
94
|
let a;
|
|
95
95
|
if (s.defaultSize !== void 0) {
|
|
96
|
-
const c =
|
|
96
|
+
const c = oe({
|
|
97
97
|
groupSize: n,
|
|
98
98
|
panelElement: i,
|
|
99
99
|
styleProp: s.defaultSize
|
|
@@ -102,7 +102,7 @@ function ve(e) {
|
|
|
102
102
|
}
|
|
103
103
|
let r = 0;
|
|
104
104
|
if (s.minSize !== void 0) {
|
|
105
|
-
const c =
|
|
105
|
+
const c = oe({
|
|
106
106
|
groupSize: n,
|
|
107
107
|
panelElement: i,
|
|
108
108
|
styleProp: s.minSize
|
|
@@ -111,7 +111,7 @@ function ve(e) {
|
|
|
111
111
|
}
|
|
112
112
|
let l = 100;
|
|
113
113
|
if (s.maxSize !== void 0) {
|
|
114
|
-
const c =
|
|
114
|
+
const c = oe({
|
|
115
115
|
groupSize: n,
|
|
116
116
|
panelElement: i,
|
|
117
117
|
styleProp: s.maxSize
|
|
@@ -134,7 +134,7 @@ function C(e, t = "Assertion error") {
|
|
|
134
134
|
if (!e)
|
|
135
135
|
throw Error(t);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function ze(e, t) {
|
|
138
138
|
return Array.from(t).sort(
|
|
139
139
|
e === "horizontal" ? Pt : wt
|
|
140
140
|
);
|
|
@@ -178,12 +178,12 @@ function Lt({
|
|
|
178
178
|
}
|
|
179
179
|
return C(i, "No rect found"), i;
|
|
180
180
|
}
|
|
181
|
-
let
|
|
181
|
+
let de;
|
|
182
182
|
function Ct() {
|
|
183
|
-
return
|
|
183
|
+
return de === void 0 && (typeof matchMedia == "function" ? de = !!matchMedia("(pointer:coarse)").matches : de = !1), de;
|
|
184
184
|
}
|
|
185
185
|
function Ze(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 = ze(
|
|
187
187
|
n,
|
|
188
188
|
Array.from(t.children).filter(Ye).map((z) => ({ element: z }))
|
|
189
189
|
).map(({ element: z }) => z), u = [];
|
|
@@ -226,14 +226,14 @@ function Ze(e) {
|
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
case 1: {
|
|
229
|
-
const w = S[0],
|
|
229
|
+
const w = S[0], E = Lt({
|
|
230
230
|
orientation: n,
|
|
231
231
|
rects: [h, y],
|
|
232
232
|
targetRect: w.element.getBoundingClientRect()
|
|
233
233
|
});
|
|
234
234
|
b = [
|
|
235
235
|
w,
|
|
236
|
-
|
|
236
|
+
E === h ? g : v
|
|
237
237
|
];
|
|
238
238
|
break;
|
|
239
239
|
}
|
|
@@ -277,8 +277,8 @@ function Ze(e) {
|
|
|
277
277
|
g.height + L
|
|
278
278
|
);
|
|
279
279
|
}
|
|
280
|
-
const
|
|
281
|
-
!a && !
|
|
280
|
+
const E = z <= l || z > c;
|
|
281
|
+
!a && !E && u.push({
|
|
282
282
|
group: e,
|
|
283
283
|
groupSize: ne({ group: e }),
|
|
284
284
|
panels: [p, d],
|
|
@@ -343,32 +343,32 @@ let ee = {
|
|
|
343
343
|
cursorFlags: 0,
|
|
344
344
|
state: "inactive"
|
|
345
345
|
};
|
|
346
|
-
const
|
|
347
|
-
function
|
|
346
|
+
const xe = new Qe();
|
|
347
|
+
function W() {
|
|
348
348
|
return ee;
|
|
349
349
|
}
|
|
350
350
|
function Rt(e) {
|
|
351
|
-
return
|
|
351
|
+
return xe.addListener("change", e);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Et(e) {
|
|
354
354
|
const t = ee, n = { ...ee };
|
|
355
|
-
n.cursorFlags = e, ee = n,
|
|
355
|
+
n.cursorFlags = e, ee = n, xe.emit("change", {
|
|
356
356
|
prev: t,
|
|
357
357
|
next: n
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
function te(e) {
|
|
361
361
|
const t = ee;
|
|
362
|
-
ee = e,
|
|
362
|
+
ee = e, xe.emit("change", {
|
|
363
363
|
prev: t,
|
|
364
364
|
next: e
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
|
-
const
|
|
367
|
+
const Mt = (e) => e, Se = () => {
|
|
368
368
|
}, et = 1, tt = 2, nt = 4, ot = 8, Ie = 3, ke = 12;
|
|
369
|
-
let
|
|
369
|
+
let pe;
|
|
370
370
|
function De() {
|
|
371
|
-
return
|
|
371
|
+
return pe === void 0 && (pe = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (pe = !0)), pe;
|
|
372
372
|
}
|
|
373
373
|
function It({
|
|
374
374
|
cursorFlags: e,
|
|
@@ -414,15 +414,15 @@ function It({
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
const Te = /* @__PURE__ */ new WeakMap();
|
|
417
|
-
function
|
|
418
|
-
if (e.defaultView
|
|
417
|
+
function Pe(e) {
|
|
418
|
+
if (!e.defaultView || !e.adoptedStyleSheets)
|
|
419
419
|
return;
|
|
420
420
|
let { prevStyle: t, styleSheet: n } = Te.get(e) ?? {};
|
|
421
421
|
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
|
|
422
422
|
...e.adoptedStyleSheets,
|
|
423
423
|
n
|
|
424
424
|
]));
|
|
425
|
-
const o =
|
|
425
|
+
const o = W();
|
|
426
426
|
switch (o.state) {
|
|
427
427
|
case "active":
|
|
428
428
|
case "hover": {
|
|
@@ -463,10 +463,10 @@ function H(e, t) {
|
|
|
463
463
|
if (t)
|
|
464
464
|
throw Error(`Could not find data for Group with id ${e}`);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function V() {
|
|
467
467
|
return F;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function we(e, t) {
|
|
470
470
|
return it.addListener("groupChange", (n) => {
|
|
471
471
|
n.group.id === e && t(n);
|
|
472
472
|
});
|
|
@@ -481,21 +481,23 @@ function j(e, t, n) {
|
|
|
481
481
|
});
|
|
482
482
|
}
|
|
483
483
|
function rt(e) {
|
|
484
|
-
const t =
|
|
485
|
-
let
|
|
484
|
+
const t = W(), n = V();
|
|
485
|
+
let o = !1;
|
|
486
486
|
switch (t.state) {
|
|
487
487
|
case "active":
|
|
488
488
|
te({
|
|
489
489
|
cursorFlags: 0,
|
|
490
490
|
state: "inactive"
|
|
491
|
-
}), t.hitRegions.length > 0 && (
|
|
492
|
-
|
|
493
|
-
|
|
491
|
+
}), t.hitRegions.length > 0 && (Pe(e), o = !0, t.hitRegions.forEach((i) => {
|
|
492
|
+
if (!n.has(i.group))
|
|
493
|
+
return;
|
|
494
|
+
const s = H(i.group.id, !0);
|
|
495
|
+
j(i.group, s, {
|
|
494
496
|
isUserInteraction: !0
|
|
495
497
|
});
|
|
496
498
|
}));
|
|
497
499
|
}
|
|
498
|
-
return
|
|
500
|
+
return o;
|
|
499
501
|
}
|
|
500
502
|
function Ge(e) {
|
|
501
503
|
e.defaultPrevented || rt(e.currentTarget);
|
|
@@ -609,7 +611,7 @@ function _t({
|
|
|
609
611
|
}
|
|
610
612
|
return !0;
|
|
611
613
|
}
|
|
612
|
-
function
|
|
614
|
+
function Le(e, t) {
|
|
613
615
|
const n = [];
|
|
614
616
|
return t.forEach((o, i) => {
|
|
615
617
|
if (i.disabled)
|
|
@@ -633,11 +635,11 @@ function $t(e, t) {
|
|
|
633
635
|
return !1;
|
|
634
636
|
return !0;
|
|
635
637
|
}
|
|
636
|
-
function
|
|
638
|
+
function D(e, t, n = 0) {
|
|
637
639
|
return Math.abs(T(e) - T(t)) <= n;
|
|
638
640
|
}
|
|
639
641
|
function A(e, t) {
|
|
640
|
-
return
|
|
642
|
+
return D(e, t) ? 0 : e > t ? 1 : -1;
|
|
641
643
|
}
|
|
642
644
|
function Z({
|
|
643
645
|
overrideDisabledPanels: e,
|
|
@@ -662,7 +664,7 @@ function Z({
|
|
|
662
664
|
o = r;
|
|
663
665
|
return o = Math.min(a, o), o = T(o), o;
|
|
664
666
|
}
|
|
665
|
-
function
|
|
667
|
+
function ae({
|
|
666
668
|
delta: e,
|
|
667
669
|
initialLayout: t,
|
|
668
670
|
panelConstraints: n,
|
|
@@ -670,7 +672,7 @@ function le({
|
|
|
670
672
|
prevLayout: i,
|
|
671
673
|
trigger: s
|
|
672
674
|
}) {
|
|
673
|
-
if (
|
|
675
|
+
if (D(e, 0))
|
|
674
676
|
return t;
|
|
675
677
|
const u = s === "imperative-api", a = Object.values(t), r = Object.values(i), l = [...a], [c, m] = o;
|
|
676
678
|
C(c != null, "Invalid first pivot index"), C(m != null, "Invalid second pivot index");
|
|
@@ -693,7 +695,7 @@ function le({
|
|
|
693
695
|
if (C(
|
|
694
696
|
v != null,
|
|
695
697
|
`Previous layout not found for panel index ${f}`
|
|
696
|
-
),
|
|
698
|
+
), D(v, h)) {
|
|
697
699
|
const g = b - v;
|
|
698
700
|
A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
699
701
|
}
|
|
@@ -715,7 +717,7 @@ function le({
|
|
|
715
717
|
if (C(
|
|
716
718
|
v != null,
|
|
717
719
|
`Previous layout not found for panel index ${f}`
|
|
718
|
-
),
|
|
720
|
+
), D(v, b)) {
|
|
719
721
|
const g = v - h;
|
|
720
722
|
A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
|
|
721
723
|
}
|
|
@@ -732,11 +734,11 @@ function le({
|
|
|
732
734
|
const h = a[f], { collapsible: y, collapsedSize: b, minSize: v } = d;
|
|
733
735
|
if (y && A(h, v) < 0)
|
|
734
736
|
if (e > 0) {
|
|
735
|
-
const g = v - b, w = g / 2,
|
|
736
|
-
A(
|
|
737
|
+
const g = v - b, w = g / 2, E = h + e;
|
|
738
|
+
A(E, v) < 0 && (e = A(e, w) <= 0 ? 0 : g);
|
|
737
739
|
} else {
|
|
738
|
-
const g = v - b, w = 100 - g / 2,
|
|
739
|
-
A(
|
|
740
|
+
const g = v - b, w = 100 - g / 2, E = h - e;
|
|
741
|
+
A(E, v) < 0 && (e = A(100 + e, w) > 0 ? 0 : -g);
|
|
740
742
|
}
|
|
741
743
|
break;
|
|
742
744
|
}
|
|
@@ -776,7 +778,7 @@ function le({
|
|
|
776
778
|
prevSize: y,
|
|
777
779
|
size: b
|
|
778
780
|
});
|
|
779
|
-
if (!
|
|
781
|
+
if (!D(y, v) && (p += y - v, l[d] = v, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
|
|
780
782
|
numeric: !0
|
|
781
783
|
}) >= 0))
|
|
782
784
|
break;
|
|
@@ -797,7 +799,7 @@ function le({
|
|
|
797
799
|
prevSize: d,
|
|
798
800
|
size: h
|
|
799
801
|
});
|
|
800
|
-
if (l[f] = y, !
|
|
802
|
+
if (l[f] = y, !D(y, h)) {
|
|
801
803
|
let b = h - y, g = e < 0 ? m : c;
|
|
802
804
|
for (; g >= 0 && g < n.length; ) {
|
|
803
805
|
const w = l[g];
|
|
@@ -805,13 +807,13 @@ function le({
|
|
|
805
807
|
w != null,
|
|
806
808
|
`Previous layout not found for panel index ${g}`
|
|
807
809
|
);
|
|
808
|
-
const
|
|
810
|
+
const E = w + b, L = Z({
|
|
809
811
|
overrideDisabledPanels: u,
|
|
810
812
|
panelConstraints: n[g],
|
|
811
813
|
prevSize: w,
|
|
812
|
-
size:
|
|
814
|
+
size: E
|
|
813
815
|
});
|
|
814
|
-
if (
|
|
816
|
+
if (D(w, L) || (b -= L - w, l[g] = L), D(b, 0))
|
|
815
817
|
break;
|
|
816
818
|
e > 0 ? g-- : g++;
|
|
817
819
|
}
|
|
@@ -821,12 +823,12 @@ function le({
|
|
|
821
823
|
(f, d) => d + f,
|
|
822
824
|
0
|
|
823
825
|
);
|
|
824
|
-
if (!
|
|
826
|
+
if (!D(S, 100, 0.1))
|
|
825
827
|
return i;
|
|
826
828
|
const z = Object.keys(i);
|
|
827
829
|
return l.reduce((f, d, h) => (f[z[h]] = d, f), {});
|
|
828
830
|
}
|
|
829
|
-
function
|
|
831
|
+
function K(e, t) {
|
|
830
832
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
831
833
|
return !1;
|
|
832
834
|
for (const n in e)
|
|
@@ -834,7 +836,7 @@ function W(e, t) {
|
|
|
834
836
|
return !1;
|
|
835
837
|
return !0;
|
|
836
838
|
}
|
|
837
|
-
function
|
|
839
|
+
function X({
|
|
838
840
|
layout: e,
|
|
839
841
|
panelConstraints: t
|
|
840
842
|
}) {
|
|
@@ -846,7 +848,7 @@ function K({
|
|
|
846
848
|
throw Error(
|
|
847
849
|
`Invalid ${t.length} panel layout: ${o.map((a) => `${a}%`).join(", ")}`
|
|
848
850
|
);
|
|
849
|
-
if (!
|
|
851
|
+
if (!D(i, 100) && o.length > 0)
|
|
850
852
|
for (let a = 0; a < t.length; a++) {
|
|
851
853
|
const r = o[a];
|
|
852
854
|
C(r != null, `No layout data found for index ${a}`);
|
|
@@ -867,7 +869,7 @@ function K({
|
|
|
867
869
|
});
|
|
868
870
|
l != c && (s += l - c, o[a] = c);
|
|
869
871
|
}
|
|
870
|
-
if (!
|
|
872
|
+
if (!D(s, 0))
|
|
871
873
|
for (let a = 0; a < t.length; a++) {
|
|
872
874
|
const r = o[a];
|
|
873
875
|
C(r != null, `No layout data found for index ${a}`);
|
|
@@ -877,7 +879,7 @@ function K({
|
|
|
877
879
|
prevSize: r,
|
|
878
880
|
size: l
|
|
879
881
|
});
|
|
880
|
-
if (r !== c && (s -= c - r, o[a] = c,
|
|
882
|
+
if (r !== c && (s -= c - r, o[a] = c, D(s, 0)))
|
|
881
883
|
break;
|
|
882
884
|
}
|
|
883
885
|
const u = Object.keys(e);
|
|
@@ -888,7 +890,7 @@ function at({
|
|
|
888
890
|
panelId: t
|
|
889
891
|
}) {
|
|
890
892
|
const n = () => {
|
|
891
|
-
const r =
|
|
893
|
+
const r = V();
|
|
892
894
|
for (const [
|
|
893
895
|
l,
|
|
894
896
|
{
|
|
@@ -935,7 +937,7 @@ function at({
|
|
|
935
937
|
const p = s(), S = l.findIndex((h) => h.id === t), z = S === 0, f = S === l.length - 1;
|
|
936
938
|
if (f && r < p && (z || l.slice(0, S).every((h, y) => {
|
|
937
939
|
const b = m[y];
|
|
938
|
-
return b?.collapsible &&
|
|
940
|
+
return b?.collapsible && D(b.collapsedSize, c[b.panelId]);
|
|
939
941
|
}))) {
|
|
940
942
|
const h = l.slice(0, S).reduce((y, b) => y + c[b.id], 0);
|
|
941
943
|
return {
|
|
@@ -943,7 +945,7 @@ function at({
|
|
|
943
945
|
[t]: T(100 - h)
|
|
944
946
|
};
|
|
945
947
|
}
|
|
946
|
-
return
|
|
948
|
+
return ae({
|
|
947
949
|
delta: f ? p - r : r - p,
|
|
948
950
|
initialLayout: c,
|
|
949
951
|
panelConstraints: m,
|
|
@@ -967,11 +969,11 @@ function at({
|
|
|
967
969
|
panels: p.panels,
|
|
968
970
|
prevLayout: z,
|
|
969
971
|
derivedPanelConstraints: m
|
|
970
|
-
}), h =
|
|
972
|
+
}), h = X({
|
|
971
973
|
layout: d,
|
|
972
974
|
panelConstraints: m
|
|
973
975
|
});
|
|
974
|
-
|
|
976
|
+
K(z, h) || j(p, {
|
|
975
977
|
defaultLayoutDeferred: c,
|
|
976
978
|
derivedPanelConstraints: m,
|
|
977
979
|
groupSize: S,
|
|
@@ -1000,10 +1002,10 @@ function at({
|
|
|
1000
1002
|
},
|
|
1001
1003
|
isCollapsed: () => {
|
|
1002
1004
|
const { collapsible: r, collapsedSize: l } = o(), c = s();
|
|
1003
|
-
return r &&
|
|
1005
|
+
return r && D(l, c);
|
|
1004
1006
|
},
|
|
1005
1007
|
resize: (r) => {
|
|
1006
|
-
const { group: l } = n(), { element: c } = i(), m = ne({ group: l }), p =
|
|
1008
|
+
const { group: l } = n(), { element: c } = i(), m = ne({ group: l }), p = oe({
|
|
1007
1009
|
groupSize: m,
|
|
1008
1010
|
panelElement: c,
|
|
1009
1011
|
styleProp: r
|
|
@@ -1015,8 +1017,8 @@ function at({
|
|
|
1015
1017
|
function _e(e) {
|
|
1016
1018
|
if (e.defaultPrevented)
|
|
1017
1019
|
return;
|
|
1018
|
-
const t =
|
|
1019
|
-
|
|
1020
|
+
const t = V();
|
|
1021
|
+
Le(e, t).forEach((o) => {
|
|
1020
1022
|
if (o.separator && !o.separator.disableDoubleClick) {
|
|
1021
1023
|
const i = o.panels.find(
|
|
1022
1024
|
(s) => s.panelConstraints.defaultSize !== void 0
|
|
@@ -1031,8 +1033,8 @@ function _e(e) {
|
|
|
1031
1033
|
}
|
|
1032
1034
|
});
|
|
1033
1035
|
}
|
|
1034
|
-
function
|
|
1035
|
-
const t =
|
|
1036
|
+
function he(e) {
|
|
1037
|
+
const t = V();
|
|
1036
1038
|
for (const [n] of t)
|
|
1037
1039
|
if (n.separators.some(
|
|
1038
1040
|
(o) => o.element === e
|
|
@@ -1044,7 +1046,7 @@ function lt({
|
|
|
1044
1046
|
groupId: e
|
|
1045
1047
|
}) {
|
|
1046
1048
|
const t = () => {
|
|
1047
|
-
const n =
|
|
1049
|
+
const n = V();
|
|
1048
1050
|
for (const [o, i] of n)
|
|
1049
1051
|
if (o.id === e)
|
|
1050
1052
|
return { group: o, ...i };
|
|
@@ -1063,11 +1065,11 @@ function lt({
|
|
|
1063
1065
|
groupSize: u,
|
|
1064
1066
|
layout: a,
|
|
1065
1067
|
separatorToPanels: r
|
|
1066
|
-
} = t(), l =
|
|
1068
|
+
} = t(), l = X({
|
|
1067
1069
|
layout: n,
|
|
1068
1070
|
panelConstraints: i
|
|
1069
1071
|
});
|
|
1070
|
-
return o ? a : (
|
|
1072
|
+
return o ? a : (K(a, l) || j(s, {
|
|
1071
1073
|
defaultLayoutDeferred: o,
|
|
1072
1074
|
derivedPanelConstraints: i,
|
|
1073
1075
|
groupSize: u,
|
|
@@ -1077,25 +1079,25 @@ function lt({
|
|
|
1077
1079
|
}
|
|
1078
1080
|
};
|
|
1079
1081
|
}
|
|
1080
|
-
function
|
|
1081
|
-
const n =
|
|
1082
|
+
function B(e, t) {
|
|
1083
|
+
const n = he(e), o = H(n.id, !0), i = n.separators.find(
|
|
1082
1084
|
(m) => m.element === e
|
|
1083
1085
|
);
|
|
1084
1086
|
C(i, "Matching separator not found");
|
|
1085
1087
|
const s = o.separatorToPanels.get(i);
|
|
1086
1088
|
C(s, "Matching panels not found");
|
|
1087
|
-
const u = s.map((m) => n.panels.indexOf(m)), r = lt({ groupId: n.id }).getLayout(), l =
|
|
1089
|
+
const u = s.map((m) => n.panels.indexOf(m)), r = lt({ groupId: n.id }).getLayout(), l = ae({
|
|
1088
1090
|
delta: t,
|
|
1089
1091
|
initialLayout: r,
|
|
1090
1092
|
panelConstraints: o.derivedPanelConstraints,
|
|
1091
1093
|
pivotIndices: u,
|
|
1092
1094
|
prevLayout: r,
|
|
1093
1095
|
trigger: "keyboard"
|
|
1094
|
-
}), c =
|
|
1096
|
+
}), c = X({
|
|
1095
1097
|
layout: l,
|
|
1096
1098
|
panelConstraints: o.derivedPanelConstraints
|
|
1097
1099
|
});
|
|
1098
|
-
|
|
1100
|
+
K(r, c) || j(
|
|
1099
1101
|
n,
|
|
1100
1102
|
{
|
|
1101
1103
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
@@ -1114,32 +1116,32 @@ function U(e, t) {
|
|
|
1114
1116
|
function $e(e) {
|
|
1115
1117
|
if (e.defaultPrevented)
|
|
1116
1118
|
return;
|
|
1117
|
-
const t = e.currentTarget, n =
|
|
1119
|
+
const t = e.currentTarget, n = he(t);
|
|
1118
1120
|
if (!n.disabled)
|
|
1119
1121
|
switch (e.key) {
|
|
1120
1122
|
case "ArrowDown": {
|
|
1121
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
1123
|
+
e.preventDefault(), n.orientation === "vertical" && B(t, 5);
|
|
1122
1124
|
break;
|
|
1123
1125
|
}
|
|
1124
1126
|
case "ArrowLeft": {
|
|
1125
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
1127
|
+
e.preventDefault(), n.orientation === "horizontal" && B(t, -5);
|
|
1126
1128
|
break;
|
|
1127
1129
|
}
|
|
1128
1130
|
case "ArrowRight": {
|
|
1129
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
1131
|
+
e.preventDefault(), n.orientation === "horizontal" && B(t, 5);
|
|
1130
1132
|
break;
|
|
1131
1133
|
}
|
|
1132
1134
|
case "ArrowUp": {
|
|
1133
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
1135
|
+
e.preventDefault(), n.orientation === "vertical" && B(t, -5);
|
|
1134
1136
|
break;
|
|
1135
1137
|
}
|
|
1136
1138
|
case "End": {
|
|
1137
|
-
e.preventDefault(),
|
|
1139
|
+
e.preventDefault(), B(t, 100);
|
|
1138
1140
|
break;
|
|
1139
1141
|
}
|
|
1140
1142
|
case "Enter": {
|
|
1141
1143
|
e.preventDefault();
|
|
1142
|
-
const o =
|
|
1144
|
+
const o = he(t), i = H(o.id, !0), { derivedPanelConstraints: s, layout: u, separatorToPanels: a } = i, r = o.separators.find(
|
|
1143
1145
|
(p) => p.element === t
|
|
1144
1146
|
);
|
|
1145
1147
|
C(r, "Matching separator not found");
|
|
@@ -1150,13 +1152,13 @@ function $e(e) {
|
|
|
1150
1152
|
);
|
|
1151
1153
|
if (C(m, "Panel metadata not found"), m.collapsible) {
|
|
1152
1154
|
const p = u[c.id], S = m.collapsedSize === p ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
|
|
1153
|
-
|
|
1155
|
+
B(t, S - p);
|
|
1154
1156
|
}
|
|
1155
1157
|
break;
|
|
1156
1158
|
}
|
|
1157
1159
|
case "F6": {
|
|
1158
1160
|
e.preventDefault();
|
|
1159
|
-
const i =
|
|
1161
|
+
const i = he(t).separators.map(
|
|
1160
1162
|
(r) => r.element
|
|
1161
1163
|
), s = Array.from(i).findIndex(
|
|
1162
1164
|
(r) => r === e.currentTarget
|
|
@@ -1169,7 +1171,7 @@ function $e(e) {
|
|
|
1169
1171
|
break;
|
|
1170
1172
|
}
|
|
1171
1173
|
case "Home": {
|
|
1172
|
-
e.preventDefault(),
|
|
1174
|
+
e.preventDefault(), B(t, -100);
|
|
1173
1175
|
break;
|
|
1174
1176
|
}
|
|
1175
1177
|
}
|
|
@@ -1179,7 +1181,7 @@ function je(e) {
|
|
|
1179
1181
|
return;
|
|
1180
1182
|
if (e.pointerType === "mouse" && e.button > 0)
|
|
1181
1183
|
return;
|
|
1182
|
-
const t =
|
|
1184
|
+
const t = V(), n = Le(e, t), o = /* @__PURE__ */ new Map();
|
|
1183
1185
|
let i = !1;
|
|
1184
1186
|
n.forEach((s) => {
|
|
1185
1187
|
s.separator && (i || (i = !0, s.separator.element.focus({
|
|
@@ -1222,7 +1224,7 @@ function ut({
|
|
|
1222
1224
|
separatorToPanels: w
|
|
1223
1225
|
} = h;
|
|
1224
1226
|
if (b && g && w) {
|
|
1225
|
-
const
|
|
1227
|
+
const E = ae({
|
|
1226
1228
|
delta: f,
|
|
1227
1229
|
initialLayout: d,
|
|
1228
1230
|
panelConstraints: b,
|
|
@@ -1230,7 +1232,7 @@ function ut({
|
|
|
1230
1232
|
prevLayout: g,
|
|
1231
1233
|
trigger: "mouse-or-touch"
|
|
1232
1234
|
});
|
|
1233
|
-
if (
|
|
1235
|
+
if (K(E, g)) {
|
|
1234
1236
|
if (f !== 0 && !z)
|
|
1235
1237
|
switch (p) {
|
|
1236
1238
|
case "horizontal": {
|
|
@@ -1247,16 +1249,16 @@ function ut({
|
|
|
1247
1249
|
defaultLayoutDeferred: y,
|
|
1248
1250
|
derivedPanelConstraints: b,
|
|
1249
1251
|
groupSize: v,
|
|
1250
|
-
layout:
|
|
1252
|
+
layout: E,
|
|
1251
1253
|
separatorToPanels: w
|
|
1252
1254
|
});
|
|
1253
1255
|
}
|
|
1254
1256
|
});
|
|
1255
1257
|
let r = 0;
|
|
1256
|
-
t.movementX === 0 ? r |= u & Ie : r |= a & Ie, t.movementY === 0 ? r |= u & ke : r |= a & ke,
|
|
1258
|
+
t.movementX === 0 ? r |= u & Ie : r |= a & Ie, t.movementY === 0 ? r |= u & ke : r |= a & ke, Et(r), Pe(e);
|
|
1257
1259
|
}
|
|
1258
1260
|
function He(e) {
|
|
1259
|
-
const t =
|
|
1261
|
+
const t = V(), n = W();
|
|
1260
1262
|
switch (n.state) {
|
|
1261
1263
|
case "active":
|
|
1262
1264
|
ut({
|
|
@@ -1272,7 +1274,7 @@ function He(e) {
|
|
|
1272
1274
|
function Ve(e) {
|
|
1273
1275
|
if (e.defaultPrevented)
|
|
1274
1276
|
return;
|
|
1275
|
-
const t =
|
|
1277
|
+
const t = W(), n = V();
|
|
1276
1278
|
switch (t.state) {
|
|
1277
1279
|
case "active": {
|
|
1278
1280
|
if (
|
|
@@ -1283,6 +1285,8 @@ function Ve(e) {
|
|
|
1283
1285
|
cursorFlags: 0,
|
|
1284
1286
|
state: "inactive"
|
|
1285
1287
|
}), t.hitRegions.forEach((o) => {
|
|
1288
|
+
if (!n.has(o.group))
|
|
1289
|
+
return;
|
|
1286
1290
|
const i = H(o.group.id, !0);
|
|
1287
1291
|
j(o.group, i, {
|
|
1288
1292
|
isUserInteraction: !0
|
|
@@ -1293,7 +1297,7 @@ function Ve(e) {
|
|
|
1293
1297
|
for (const o of t.hitRegions)
|
|
1294
1298
|
if (o.separator) {
|
|
1295
1299
|
const { element: i } = o.separator;
|
|
1296
|
-
i.hasPointerCapture?.(e.pointerId)
|
|
1300
|
+
i.isConnected && !i.hasPointerCapture?.(e.pointerId) && i.setPointerCapture?.(e.pointerId);
|
|
1297
1301
|
}
|
|
1298
1302
|
ut({
|
|
1299
1303
|
document: e.currentTarget,
|
|
@@ -1307,7 +1311,7 @@ function Ve(e) {
|
|
|
1307
1311
|
break;
|
|
1308
1312
|
}
|
|
1309
1313
|
default: {
|
|
1310
|
-
const o =
|
|
1314
|
+
const o = Le(e, n);
|
|
1311
1315
|
o.length === 0 ? t.state !== "inactive" && te({
|
|
1312
1316
|
cursorFlags: 0,
|
|
1313
1317
|
state: "inactive"
|
|
@@ -1315,14 +1319,14 @@ function Ve(e) {
|
|
|
1315
1319
|
cursorFlags: 0,
|
|
1316
1320
|
hitRegions: o,
|
|
1317
1321
|
state: "hover"
|
|
1318
|
-
}),
|
|
1322
|
+
}), Pe(e.currentTarget);
|
|
1319
1323
|
break;
|
|
1320
1324
|
}
|
|
1321
1325
|
}
|
|
1322
1326
|
}
|
|
1323
1327
|
function Ue(e) {
|
|
1324
1328
|
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
1325
|
-
switch (
|
|
1329
|
+
switch (W().state) {
|
|
1326
1330
|
case "hover":
|
|
1327
1331
|
te({
|
|
1328
1332
|
cursorFlags: 0,
|
|
@@ -1375,7 +1379,10 @@ function Ht(e, t) {
|
|
|
1375
1379
|
return !1;
|
|
1376
1380
|
return !0;
|
|
1377
1381
|
}
|
|
1378
|
-
function Vt({
|
|
1382
|
+
function Vt(e, t) {
|
|
1383
|
+
return e.length !== t.length ? !1 : e.every((n, o) => Ht(n, t[o]));
|
|
1384
|
+
}
|
|
1385
|
+
function Ut({
|
|
1379
1386
|
group: e,
|
|
1380
1387
|
nextGroupSize: t,
|
|
1381
1388
|
prevGroupSize: n,
|
|
@@ -1424,7 +1431,7 @@ function Vt({
|
|
|
1424
1431
|
}
|
|
1425
1432
|
return c;
|
|
1426
1433
|
}
|
|
1427
|
-
function
|
|
1434
|
+
function Bt(e, t) {
|
|
1428
1435
|
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
1429
1436
|
if (n.length !== o.length)
|
|
1430
1437
|
return !1;
|
|
@@ -1434,7 +1441,7 @@ function Ut(e, t) {
|
|
|
1434
1441
|
return !0;
|
|
1435
1442
|
}
|
|
1436
1443
|
const J = /* @__PURE__ */ new Map();
|
|
1437
|
-
function
|
|
1444
|
+
function Wt(e) {
|
|
1438
1445
|
let t = !0;
|
|
1439
1446
|
C(
|
|
1440
1447
|
e.element.ownerDocument.defaultView,
|
|
@@ -1451,20 +1458,20 @@ function Bt(e) {
|
|
|
1451
1458
|
const v = H(e.id);
|
|
1452
1459
|
if (!v)
|
|
1453
1460
|
return;
|
|
1454
|
-
const g =
|
|
1461
|
+
const g = be(e), w = v.defaultLayoutDeferred ? We(g) : v.layout, E = Ut({
|
|
1455
1462
|
group: e,
|
|
1456
1463
|
nextGroupSize: b,
|
|
1457
1464
|
prevGroupSize: v.groupSize,
|
|
1458
1465
|
prevLayout: w
|
|
1459
|
-
}), L =
|
|
1460
|
-
layout:
|
|
1466
|
+
}), L = X({
|
|
1467
|
+
layout: E,
|
|
1461
1468
|
panelConstraints: g
|
|
1462
1469
|
});
|
|
1463
|
-
if (!v.defaultLayoutDeferred &&
|
|
1470
|
+
if (!v.defaultLayoutDeferred && K(v.layout, L) && Vt(
|
|
1464
1471
|
v.derivedPanelConstraints,
|
|
1465
1472
|
g
|
|
1466
1473
|
) && v.groupSize === b)
|
|
1467
|
-
|
|
1474
|
+
continue;
|
|
1468
1475
|
j(e, {
|
|
1469
1476
|
defaultLayoutDeferred: !1,
|
|
1470
1477
|
derivedPanelConstraints: g,
|
|
@@ -1483,10 +1490,10 @@ function Bt(e) {
|
|
|
1483
1490
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1484
1491
|
), o.add(f.id), f.onResize && s.observe(f.element);
|
|
1485
1492
|
});
|
|
1486
|
-
const u = ne({ group: e }), a =
|
|
1493
|
+
const u = ne({ group: e }), a = be(e), r = e.panels.map(({ id: f }) => f).join(",");
|
|
1487
1494
|
let l = e.mutableState.defaultLayout;
|
|
1488
|
-
l && (
|
|
1489
|
-
const c = e.mutableState.layouts[r] ?? l ?? We(a), m =
|
|
1495
|
+
l && (Bt(e.panels, l) || (l = void 0));
|
|
1496
|
+
const c = e.mutableState.layouts[r] ?? l ?? We(a), m = X({
|
|
1490
1497
|
layout: c,
|
|
1491
1498
|
panelConstraints: a
|
|
1492
1499
|
}), p = e.element.ownerDocument;
|
|
@@ -1529,26 +1536,26 @@ function Bt(e) {
|
|
|
1529
1536
|
), p.removeEventListener("pointerleave", He), p.removeEventListener("pointermove", Ve), p.removeEventListener("pointerout", Ue), p.removeEventListener("pointerup", Be, !0)), s.disconnect();
|
|
1530
1537
|
};
|
|
1531
1538
|
}
|
|
1532
|
-
function
|
|
1533
|
-
const [e, t] = Q({}), n =
|
|
1539
|
+
function Kt() {
|
|
1540
|
+
const [e, t] = Q({}), n = ie(() => t({}), []);
|
|
1534
1541
|
return [e, n];
|
|
1535
1542
|
}
|
|
1536
|
-
function
|
|
1543
|
+
function Ce(e) {
|
|
1537
1544
|
const t = mt();
|
|
1538
1545
|
return `${e ?? t}`;
|
|
1539
1546
|
}
|
|
1540
|
-
const q = typeof window < "u" ? Ke :
|
|
1541
|
-
function
|
|
1547
|
+
const q = typeof window < "u" ? Ke : ge;
|
|
1548
|
+
function re(e) {
|
|
1542
1549
|
const t = O(e);
|
|
1543
1550
|
return q(() => {
|
|
1544
1551
|
t.current = e;
|
|
1545
|
-
}, [e]),
|
|
1552
|
+
}, [e]), ie(
|
|
1546
1553
|
(...n) => t.current?.(...n),
|
|
1547
1554
|
[t]
|
|
1548
1555
|
);
|
|
1549
1556
|
}
|
|
1550
|
-
function
|
|
1551
|
-
return
|
|
1557
|
+
function Re(...e) {
|
|
1558
|
+
return re((t) => {
|
|
1552
1559
|
e.forEach((n) => {
|
|
1553
1560
|
if (n)
|
|
1554
1561
|
switch (typeof n) {
|
|
@@ -1564,7 +1571,7 @@ function Ce(...e) {
|
|
|
1564
1571
|
});
|
|
1565
1572
|
});
|
|
1566
1573
|
}
|
|
1567
|
-
function
|
|
1574
|
+
function Ee(e) {
|
|
1568
1575
|
const t = O({ ...e });
|
|
1569
1576
|
return q(() => {
|
|
1570
1577
|
for (const n in e)
|
|
@@ -1572,10 +1579,10 @@ function Re(e) {
|
|
|
1572
1579
|
}, [e]), t.current;
|
|
1573
1580
|
}
|
|
1574
1581
|
const ct = gt(null);
|
|
1575
|
-
function
|
|
1582
|
+
function Xt(e, t) {
|
|
1576
1583
|
const n = O({
|
|
1577
1584
|
getLayout: () => ({}),
|
|
1578
|
-
setLayout:
|
|
1585
|
+
setLayout: Mt
|
|
1579
1586
|
});
|
|
1580
1587
|
Xe(t, () => n.current, []), q(() => {
|
|
1581
1588
|
Object.assign(
|
|
@@ -1584,7 +1591,7 @@ function Kt(e, t) {
|
|
|
1584
1591
|
);
|
|
1585
1592
|
});
|
|
1586
1593
|
}
|
|
1587
|
-
function
|
|
1594
|
+
function qt({
|
|
1588
1595
|
children: e,
|
|
1589
1596
|
className: t,
|
|
1590
1597
|
defaultLayout: n,
|
|
@@ -1606,36 +1613,36 @@ function Xt({
|
|
|
1606
1613
|
const z = O({
|
|
1607
1614
|
onLayoutChange: {},
|
|
1608
1615
|
onLayoutChanged: {}
|
|
1609
|
-
}), f =
|
|
1610
|
-
|
|
1611
|
-
}), d =
|
|
1616
|
+
}), f = re((x) => {
|
|
1617
|
+
K(z.current.onLayoutChange, x) || (z.current.onLayoutChange = x, r?.(x));
|
|
1618
|
+
}), d = re(
|
|
1612
1619
|
(x, P) => {
|
|
1613
|
-
|
|
1620
|
+
K(z.current.onLayoutChanged, x) || (z.current.onLayoutChanged = x, l?.(x, { isUserInteraction: P }));
|
|
1614
1621
|
}
|
|
1615
|
-
), h =
|
|
1622
|
+
), h = Ce(a), y = O(null), [b, v] = Kt(), g = O({
|
|
1616
1623
|
lastExpandedPanelSizes: {},
|
|
1617
1624
|
layouts: {},
|
|
1618
1625
|
panels: [],
|
|
1619
1626
|
resizeTargetMinimumSize: m,
|
|
1620
1627
|
separators: []
|
|
1621
|
-
}), w =
|
|
1622
|
-
|
|
1623
|
-
const
|
|
1628
|
+
}), w = Re(y, s);
|
|
1629
|
+
Xt(h, u);
|
|
1630
|
+
const E = re(
|
|
1624
1631
|
(x, P) => {
|
|
1625
|
-
const I =
|
|
1626
|
-
if (
|
|
1627
|
-
let
|
|
1632
|
+
const I = W(), R = Oe(x), M = H(x);
|
|
1633
|
+
if (M) {
|
|
1634
|
+
let k = !1;
|
|
1628
1635
|
switch (I.state) {
|
|
1629
1636
|
case "active": {
|
|
1630
|
-
|
|
1631
|
-
(
|
|
1637
|
+
k = I.hitRegions.some(
|
|
1638
|
+
(U) => U.group === R
|
|
1632
1639
|
);
|
|
1633
1640
|
break;
|
|
1634
1641
|
}
|
|
1635
1642
|
}
|
|
1636
1643
|
return {
|
|
1637
|
-
flexGrow:
|
|
1638
|
-
pointerEvents:
|
|
1644
|
+
flexGrow: M.layout[P] ?? 1,
|
|
1645
|
+
pointerEvents: k ? "none" : void 0
|
|
1639
1646
|
};
|
|
1640
1647
|
}
|
|
1641
1648
|
if (n?.[P])
|
|
@@ -1643,20 +1650,20 @@ function Xt({
|
|
|
1643
1650
|
flexGrow: n?.[P]
|
|
1644
1651
|
};
|
|
1645
1652
|
}
|
|
1646
|
-
), L =
|
|
1653
|
+
), L = Ee({
|
|
1647
1654
|
defaultLayout: n,
|
|
1648
1655
|
disableCursor: o
|
|
1649
|
-
}), G =
|
|
1656
|
+
}), G = ve(
|
|
1650
1657
|
() => ({
|
|
1651
1658
|
get disableCursor() {
|
|
1652
1659
|
return !!L.disableCursor;
|
|
1653
1660
|
},
|
|
1654
|
-
getPanelStyles:
|
|
1661
|
+
getPanelStyles: E,
|
|
1655
1662
|
id: h,
|
|
1656
1663
|
orientation: c,
|
|
1657
1664
|
registerPanel: (x) => {
|
|
1658
1665
|
const P = g.current;
|
|
1659
|
-
return P.panels =
|
|
1666
|
+
return P.panels = ze(c, [
|
|
1660
1667
|
...P.panels,
|
|
1661
1668
|
x
|
|
1662
1669
|
]), v(), () => {
|
|
@@ -1667,7 +1674,7 @@ function Xt({
|
|
|
1667
1674
|
},
|
|
1668
1675
|
registerSeparator: (x) => {
|
|
1669
1676
|
const P = g.current;
|
|
1670
|
-
return P.separators =
|
|
1677
|
+
return P.separators = ze(c, [
|
|
1671
1678
|
...P.separators,
|
|
1672
1679
|
x
|
|
1673
1680
|
]), v(), () => {
|
|
@@ -1678,26 +1685,26 @@ function Xt({
|
|
|
1678
1685
|
},
|
|
1679
1686
|
updatePanelProps: (x, { disabled: P }) => {
|
|
1680
1687
|
const R = g.current.panels.find(
|
|
1681
|
-
(
|
|
1688
|
+
(U) => U.id === x
|
|
1682
1689
|
);
|
|
1683
1690
|
R && (R.panelConstraints.disabled = P);
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
...
|
|
1687
|
-
derivedPanelConstraints:
|
|
1691
|
+
const M = Oe(h), k = H(h);
|
|
1692
|
+
M && k && j(M, {
|
|
1693
|
+
...k,
|
|
1694
|
+
derivedPanelConstraints: be(M)
|
|
1688
1695
|
});
|
|
1689
1696
|
},
|
|
1690
1697
|
updateSeparatorProps: (x, {
|
|
1691
1698
|
disabled: P,
|
|
1692
1699
|
disableDoubleClick: I
|
|
1693
1700
|
}) => {
|
|
1694
|
-
const
|
|
1695
|
-
(
|
|
1701
|
+
const M = g.current.separators.find(
|
|
1702
|
+
(k) => k.id === x
|
|
1696
1703
|
);
|
|
1697
|
-
|
|
1704
|
+
M && (M.disabled = P, M.disableDoubleClick = I);
|
|
1698
1705
|
}
|
|
1699
1706
|
}),
|
|
1700
|
-
[
|
|
1707
|
+
[E, h, v, c, L]
|
|
1701
1708
|
), N = O(null);
|
|
1702
1709
|
return q(() => {
|
|
1703
1710
|
const x = y.current;
|
|
@@ -1728,33 +1735,33 @@ function Xt({
|
|
|
1728
1735
|
separators: P.separators
|
|
1729
1736
|
};
|
|
1730
1737
|
N.current = R;
|
|
1731
|
-
const
|
|
1732
|
-
!
|
|
1733
|
-
const
|
|
1734
|
-
const { defaultLayoutDeferred: Y, derivedPanelConstraints:
|
|
1735
|
-
if (Y ||
|
|
1738
|
+
const M = Wt(R), { defaultLayoutDeferred: k, derivedPanelConstraints: U, layout: le } = H(R.id, !0);
|
|
1739
|
+
!k && U.length > 0 && (f(le), d(le, !1));
|
|
1740
|
+
const ue = we(h, (_) => {
|
|
1741
|
+
const { defaultLayoutDeferred: Y, derivedPanelConstraints: ce, layout: fe } = _.next;
|
|
1742
|
+
if (Y || ce.length === 0)
|
|
1736
1743
|
return;
|
|
1737
1744
|
const ft = R.panels.map(({ id: $ }) => $).join(",");
|
|
1738
|
-
R.mutableState.layouts[ft] =
|
|
1745
|
+
R.mutableState.layouts[ft] = fe, ce.forEach(($) => {
|
|
1739
1746
|
if ($.collapsible) {
|
|
1740
|
-
const { layout:
|
|
1741
|
-
if (
|
|
1742
|
-
const pt =
|
|
1747
|
+
const { layout: ye } = _.prev ?? {};
|
|
1748
|
+
if (ye) {
|
|
1749
|
+
const pt = D(
|
|
1743
1750
|
$.collapsedSize,
|
|
1744
|
-
|
|
1745
|
-
), ht =
|
|
1751
|
+
fe[$.panelId]
|
|
1752
|
+
), ht = D(
|
|
1746
1753
|
$.collapsedSize,
|
|
1747
|
-
|
|
1754
|
+
ye[$.panelId]
|
|
1748
1755
|
);
|
|
1749
|
-
pt && !ht && (R.mutableState.expandedPanelSizes[$.panelId] =
|
|
1756
|
+
pt && !ht && (R.mutableState.expandedPanelSizes[$.panelId] = ye[$.panelId]);
|
|
1750
1757
|
}
|
|
1751
1758
|
}
|
|
1752
1759
|
});
|
|
1753
|
-
const dt =
|
|
1754
|
-
f(
|
|
1760
|
+
const dt = W().state !== "active";
|
|
1761
|
+
f(fe), dt && d(fe, _.isUserInteraction);
|
|
1755
1762
|
});
|
|
1756
1763
|
return () => {
|
|
1757
|
-
N.current = null,
|
|
1764
|
+
N.current = null, M(), ue();
|
|
1758
1765
|
};
|
|
1759
1766
|
}, [
|
|
1760
1767
|
i,
|
|
@@ -1764,10 +1771,10 @@ function Xt({
|
|
|
1764
1771
|
c,
|
|
1765
1772
|
b,
|
|
1766
1773
|
L
|
|
1767
|
-
]),
|
|
1774
|
+
]), ge(() => {
|
|
1768
1775
|
const x = N.current;
|
|
1769
1776
|
x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
|
|
1770
|
-
}), /* @__PURE__ */
|
|
1777
|
+
}), /* @__PURE__ */ se(ct.Provider, { value: G, children: /* @__PURE__ */ se(
|
|
1771
1778
|
"div",
|
|
1772
1779
|
{
|
|
1773
1780
|
...S,
|
|
@@ -1794,16 +1801,16 @@ function Xt({
|
|
|
1794
1801
|
}
|
|
1795
1802
|
) });
|
|
1796
1803
|
}
|
|
1797
|
-
|
|
1798
|
-
function
|
|
1804
|
+
qt.displayName = "Group";
|
|
1805
|
+
function me(e, t) {
|
|
1799
1806
|
return `react-resizable-panels:${[e, ...t].join(":")}`;
|
|
1800
1807
|
}
|
|
1801
|
-
function
|
|
1808
|
+
function Yt({
|
|
1802
1809
|
id: e,
|
|
1803
1810
|
panelIds: t,
|
|
1804
1811
|
storage: n
|
|
1805
1812
|
}) {
|
|
1806
|
-
const o =
|
|
1813
|
+
const o = me(e, []), i = n.getItem(o);
|
|
1807
1814
|
if (i)
|
|
1808
1815
|
try {
|
|
1809
1816
|
const s = JSON.parse(i);
|
|
@@ -1833,38 +1840,38 @@ function qt({
|
|
|
1833
1840
|
} catch {
|
|
1834
1841
|
}
|
|
1835
1842
|
}
|
|
1836
|
-
function
|
|
1843
|
+
function an({
|
|
1837
1844
|
debounceSaveMs: e = 100,
|
|
1838
1845
|
onlySaveAfterUserInteractions: t,
|
|
1839
1846
|
panelIds: n,
|
|
1840
1847
|
storage: o = localStorage,
|
|
1841
1848
|
...i
|
|
1842
1849
|
}) {
|
|
1843
|
-
const s = n !== void 0, u = "id" in i ? i.id : i.groupId, a =
|
|
1844
|
-
|
|
1850
|
+
const s = n !== void 0, u = "id" in i ? i.id : i.groupId, a = me(u, n ?? []), r = qe(
|
|
1851
|
+
Jt,
|
|
1845
1852
|
() => o.getItem(a),
|
|
1846
1853
|
() => o.getItem(a)
|
|
1847
|
-
), l =
|
|
1854
|
+
), l = ve(() => {
|
|
1848
1855
|
if (r) {
|
|
1849
1856
|
const d = JSON.parse(r), h = Object.values(d);
|
|
1850
1857
|
if (Array.from(h).every((y) => typeof y == "number"))
|
|
1851
1858
|
return d;
|
|
1852
1859
|
}
|
|
1853
|
-
}, [r]), c =
|
|
1860
|
+
}, [r]), c = ve(() => {
|
|
1854
1861
|
if (!l)
|
|
1855
|
-
return
|
|
1862
|
+
return Yt({
|
|
1856
1863
|
id: u,
|
|
1857
1864
|
panelIds: n,
|
|
1858
1865
|
storage: o
|
|
1859
1866
|
});
|
|
1860
|
-
}, [l, u, n, o]), m = l ?? c, p = O(null), S =
|
|
1867
|
+
}, [l, u, n, o]), m = l ?? c, p = O(null), S = ie(() => {
|
|
1861
1868
|
const d = p.current;
|
|
1862
1869
|
d && (p.current = null, clearTimeout(d));
|
|
1863
1870
|
}, []);
|
|
1864
1871
|
Ke(() => () => {
|
|
1865
1872
|
S();
|
|
1866
1873
|
}, [S]);
|
|
1867
|
-
const z =
|
|
1874
|
+
const z = ie(
|
|
1868
1875
|
// The hook persists every layout commit -- including library-driven ones --
|
|
1869
1876
|
// because it owns its own storage and the goal is to remember whatever
|
|
1870
1877
|
// layout the user is currently looking at. Consumers that only want to
|
|
@@ -1875,7 +1882,7 @@ function sn({
|
|
|
1875
1882
|
return;
|
|
1876
1883
|
S();
|
|
1877
1884
|
let y;
|
|
1878
|
-
s ? y =
|
|
1885
|
+
s ? y = me(u, Object.keys(d)) : y = me(u, []);
|
|
1879
1886
|
try {
|
|
1880
1887
|
o.setItem(y, JSON.stringify(d));
|
|
1881
1888
|
} catch (b) {
|
|
@@ -1889,7 +1896,7 @@ function sn({
|
|
|
1889
1896
|
t,
|
|
1890
1897
|
o
|
|
1891
1898
|
]
|
|
1892
|
-
), f =
|
|
1899
|
+
), f = ie(
|
|
1893
1900
|
(d) => {
|
|
1894
1901
|
S(), e === 0 ? z(d, { isUserInteraction: !1 }) : p.current = setTimeout(() => {
|
|
1895
1902
|
z(d, { isUserInteraction: !1 });
|
|
@@ -1914,14 +1921,14 @@ function sn({
|
|
|
1914
1921
|
onLayoutChanged: z
|
|
1915
1922
|
};
|
|
1916
1923
|
}
|
|
1917
|
-
function
|
|
1924
|
+
function Jt() {
|
|
1918
1925
|
return function() {
|
|
1919
1926
|
};
|
|
1920
1927
|
}
|
|
1921
|
-
function
|
|
1928
|
+
function ln() {
|
|
1922
1929
|
return Q(null);
|
|
1923
1930
|
}
|
|
1924
|
-
function
|
|
1931
|
+
function un() {
|
|
1925
1932
|
return O(null);
|
|
1926
1933
|
}
|
|
1927
1934
|
function Me() {
|
|
@@ -1931,16 +1938,16 @@ function Me() {
|
|
|
1931
1938
|
"Group Context not found; did you render a Panel or Separator outside of a Group?"
|
|
1932
1939
|
), e;
|
|
1933
1940
|
}
|
|
1934
|
-
function
|
|
1941
|
+
function Zt(e, t) {
|
|
1935
1942
|
const { id: n } = Me(), o = O({
|
|
1936
|
-
collapse:
|
|
1937
|
-
expand:
|
|
1943
|
+
collapse: Se,
|
|
1944
|
+
expand: Se,
|
|
1938
1945
|
getSize: () => ({
|
|
1939
1946
|
asPercentage: 0,
|
|
1940
1947
|
inPixels: 0
|
|
1941
1948
|
}),
|
|
1942
1949
|
isCollapsed: () => !1,
|
|
1943
|
-
resize:
|
|
1950
|
+
resize: Se
|
|
1944
1951
|
});
|
|
1945
1952
|
Xe(t, () => o.current, []), q(() => {
|
|
1946
1953
|
Object.assign(
|
|
@@ -1949,7 +1956,7 @@ function Jt(e, t) {
|
|
|
1949
1956
|
);
|
|
1950
1957
|
});
|
|
1951
1958
|
}
|
|
1952
|
-
function
|
|
1959
|
+
function Qt({
|
|
1953
1960
|
children: e,
|
|
1954
1961
|
className: t,
|
|
1955
1962
|
collapsedSize: n = "0%",
|
|
@@ -1966,23 +1973,23 @@ function Zt({
|
|
|
1966
1973
|
style: S,
|
|
1967
1974
|
...z
|
|
1968
1975
|
}) {
|
|
1969
|
-
const f = !!r, d =
|
|
1976
|
+
const f = !!r, d = Ce(r), h = Ee({
|
|
1970
1977
|
disabled: s
|
|
1971
|
-
}), y = O(null), b =
|
|
1978
|
+
}), y = O(null), b = Re(y, u), {
|
|
1972
1979
|
getPanelStyles: v,
|
|
1973
1980
|
id: g,
|
|
1974
1981
|
orientation: w,
|
|
1975
|
-
registerPanel:
|
|
1982
|
+
registerPanel: E,
|
|
1976
1983
|
updatePanelProps: L
|
|
1977
|
-
} = Me(), G = m !== null, N =
|
|
1978
|
-
(R,
|
|
1979
|
-
m?.(R, r,
|
|
1984
|
+
} = Me(), G = m !== null, N = re(
|
|
1985
|
+
(R, M, k) => {
|
|
1986
|
+
m?.(R, r, k);
|
|
1980
1987
|
}
|
|
1981
1988
|
);
|
|
1982
1989
|
q(() => {
|
|
1983
1990
|
const R = y.current;
|
|
1984
1991
|
if (R !== null) {
|
|
1985
|
-
const
|
|
1992
|
+
const M = {
|
|
1986
1993
|
element: R,
|
|
1987
1994
|
id: d,
|
|
1988
1995
|
idIsStable: f,
|
|
@@ -2001,7 +2008,7 @@ function Zt({
|
|
|
2001
2008
|
minSize: c
|
|
2002
2009
|
}
|
|
2003
2010
|
};
|
|
2004
|
-
return M
|
|
2011
|
+
return E(M);
|
|
2005
2012
|
}
|
|
2006
2013
|
}, [
|
|
2007
2014
|
a,
|
|
@@ -2014,17 +2021,17 @@ function Zt({
|
|
|
2014
2021
|
l,
|
|
2015
2022
|
c,
|
|
2016
2023
|
N,
|
|
2017
|
-
|
|
2024
|
+
E,
|
|
2018
2025
|
h
|
|
2019
|
-
]),
|
|
2026
|
+
]), ge(() => {
|
|
2020
2027
|
L(d, { disabled: s });
|
|
2021
|
-
}, [s, d, L]),
|
|
2028
|
+
}, [s, d, L]), Zt(d, p);
|
|
2022
2029
|
const x = () => {
|
|
2023
2030
|
const R = v(g, d);
|
|
2024
2031
|
if (R)
|
|
2025
2032
|
return JSON.stringify(R);
|
|
2026
2033
|
}, P = qe(
|
|
2027
|
-
(R) =>
|
|
2034
|
+
(R) => we(g, R),
|
|
2028
2035
|
x,
|
|
2029
2036
|
x
|
|
2030
2037
|
);
|
|
@@ -2033,7 +2040,7 @@ function Zt({
|
|
|
2033
2040
|
flexGrow: void 0,
|
|
2034
2041
|
flexShrink: void 0,
|
|
2035
2042
|
flexBasis: i
|
|
2036
|
-
} : I = { flexGrow: 1 }, /* @__PURE__ */
|
|
2043
|
+
} : I = { flexGrow: 1 }, /* @__PURE__ */ se(
|
|
2037
2044
|
"div",
|
|
2038
2045
|
{
|
|
2039
2046
|
...z,
|
|
@@ -2043,14 +2050,14 @@ function Zt({
|
|
|
2043
2050
|
id: d,
|
|
2044
2051
|
ref: b,
|
|
2045
2052
|
style: {
|
|
2046
|
-
...
|
|
2053
|
+
...en,
|
|
2047
2054
|
display: "flex",
|
|
2048
2055
|
flexBasis: 0,
|
|
2049
2056
|
flexShrink: 1,
|
|
2050
2057
|
overflow: "visible",
|
|
2051
2058
|
...I
|
|
2052
2059
|
},
|
|
2053
|
-
children: /* @__PURE__ */
|
|
2060
|
+
children: /* @__PURE__ */ se(
|
|
2054
2061
|
"div",
|
|
2055
2062
|
{
|
|
2056
2063
|
className: t,
|
|
@@ -2072,8 +2079,8 @@ function Zt({
|
|
|
2072
2079
|
}
|
|
2073
2080
|
);
|
|
2074
2081
|
}
|
|
2075
|
-
|
|
2076
|
-
const
|
|
2082
|
+
Qt.displayName = "Panel";
|
|
2083
|
+
const en = {
|
|
2077
2084
|
minHeight: 0,
|
|
2078
2085
|
maxHeight: "100%",
|
|
2079
2086
|
height: "auto",
|
|
@@ -2085,13 +2092,13 @@ const Qt = {
|
|
|
2085
2092
|
padding: 0,
|
|
2086
2093
|
margin: 0
|
|
2087
2094
|
};
|
|
2088
|
-
function
|
|
2095
|
+
function cn() {
|
|
2089
2096
|
return Q(null);
|
|
2090
2097
|
}
|
|
2091
|
-
function
|
|
2098
|
+
function fn() {
|
|
2092
2099
|
return O(null);
|
|
2093
2100
|
}
|
|
2094
|
-
function
|
|
2101
|
+
function tn({
|
|
2095
2102
|
layout: e,
|
|
2096
2103
|
panelConstraints: t,
|
|
2097
2104
|
panelId: n,
|
|
@@ -2103,8 +2110,8 @@ function en({
|
|
|
2103
2110
|
);
|
|
2104
2111
|
if (a) {
|
|
2105
2112
|
const r = a.maxSize, l = a.collapsible ? a.collapsedSize : a.minSize, c = [o, o + 1];
|
|
2106
|
-
s =
|
|
2107
|
-
layout:
|
|
2113
|
+
s = X({
|
|
2114
|
+
layout: ae({
|
|
2108
2115
|
delta: l - u,
|
|
2109
2116
|
initialLayout: e,
|
|
2110
2117
|
panelConstraints: t,
|
|
@@ -2112,8 +2119,8 @@ function en({
|
|
|
2112
2119
|
prevLayout: e
|
|
2113
2120
|
}),
|
|
2114
2121
|
panelConstraints: t
|
|
2115
|
-
})[n], i =
|
|
2116
|
-
layout:
|
|
2122
|
+
})[n], i = X({
|
|
2123
|
+
layout: ae({
|
|
2117
2124
|
delta: r - u,
|
|
2118
2125
|
initialLayout: e,
|
|
2119
2126
|
panelConstraints: t,
|
|
@@ -2130,7 +2137,7 @@ function en({
|
|
|
2130
2137
|
valueNow: u
|
|
2131
2138
|
};
|
|
2132
2139
|
}
|
|
2133
|
-
function
|
|
2140
|
+
function nn({
|
|
2134
2141
|
children: e,
|
|
2135
2142
|
className: t,
|
|
2136
2143
|
disabled: n,
|
|
@@ -2140,16 +2147,16 @@ function tn({
|
|
|
2140
2147
|
style: u,
|
|
2141
2148
|
...a
|
|
2142
2149
|
}) {
|
|
2143
|
-
const r =
|
|
2150
|
+
const r = Ce(s), l = Ee({
|
|
2144
2151
|
disabled: n,
|
|
2145
2152
|
disableDoubleClick: o
|
|
2146
|
-
}), [c, m] = Q({}), [p, S] = Q("inactive"), [z, f] = Q(!1), d = O(null), h =
|
|
2153
|
+
}), [c, m] = Q({}), [p, S] = Q("inactive"), [z, f] = Q(!1), d = O(null), h = Re(d, i), {
|
|
2147
2154
|
disableCursor: y,
|
|
2148
2155
|
id: b,
|
|
2149
2156
|
orientation: v,
|
|
2150
2157
|
registerSeparator: g,
|
|
2151
2158
|
updateSeparatorProps: w
|
|
2152
|
-
} = Me(),
|
|
2159
|
+
} = Me(), E = v === "horizontal" ? "vertical" : "horizontal";
|
|
2153
2160
|
q(() => {
|
|
2154
2161
|
const N = d.current;
|
|
2155
2162
|
if (N !== null) {
|
|
@@ -2159,23 +2166,25 @@ function tn({
|
|
|
2159
2166
|
element: N,
|
|
2160
2167
|
id: r
|
|
2161
2168
|
}, P = g(x), I = Rt(
|
|
2162
|
-
(
|
|
2169
|
+
(M) => {
|
|
2163
2170
|
S(
|
|
2164
|
-
|
|
2165
|
-
(
|
|
2166
|
-
) ?
|
|
2171
|
+
M.next.state !== "inactive" && M.next.hitRegions.some(
|
|
2172
|
+
(k) => k.separator === x
|
|
2173
|
+
) ? M.next.state : "inactive"
|
|
2167
2174
|
);
|
|
2168
2175
|
}
|
|
2169
|
-
), R =
|
|
2176
|
+
), R = we(
|
|
2170
2177
|
b,
|
|
2171
|
-
(
|
|
2172
|
-
const { derivedPanelConstraints:
|
|
2173
|
-
if (
|
|
2174
|
-
const _ =
|
|
2178
|
+
(M) => {
|
|
2179
|
+
const { derivedPanelConstraints: k, layout: U, separatorToPanels: le } = M.next, ue = le.get(x);
|
|
2180
|
+
if (ue) {
|
|
2181
|
+
const _ = ue[0], Y = k.findIndex(
|
|
2182
|
+
(ce) => ce.panelId === _.id
|
|
2183
|
+
);
|
|
2175
2184
|
m(
|
|
2176
|
-
|
|
2177
|
-
layout:
|
|
2178
|
-
panelConstraints:
|
|
2185
|
+
tn({
|
|
2186
|
+
layout: U,
|
|
2187
|
+
panelConstraints: k,
|
|
2179
2188
|
panelId: _.id,
|
|
2180
2189
|
panelIndex: Y
|
|
2181
2190
|
})
|
|
@@ -2187,7 +2196,7 @@ function tn({
|
|
|
2187
2196
|
I(), R(), P();
|
|
2188
2197
|
};
|
|
2189
2198
|
}
|
|
2190
|
-
}, [b, r, g, l]),
|
|
2199
|
+
}, [b, r, g, l]), ge(() => {
|
|
2191
2200
|
w(r, { disabled: n, disableDoubleClick: o });
|
|
2192
2201
|
}, [n, o, r, w]);
|
|
2193
2202
|
let L;
|
|
@@ -2204,13 +2213,13 @@ function tn({
|
|
|
2204
2213
|
default:
|
|
2205
2214
|
z ? G = "focus" : G = p;
|
|
2206
2215
|
}
|
|
2207
|
-
return /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ se(
|
|
2208
2217
|
"div",
|
|
2209
2218
|
{
|
|
2210
2219
|
...a,
|
|
2211
2220
|
"aria-controls": c.valueControls,
|
|
2212
2221
|
"aria-disabled": n || void 0,
|
|
2213
|
-
"aria-orientation":
|
|
2222
|
+
"aria-orientation": E,
|
|
2214
2223
|
"aria-valuemax": c.valueMax,
|
|
2215
2224
|
"aria-valuemin": c.valueMin,
|
|
2216
2225
|
"aria-valuenow": c.valueNow,
|
|
@@ -2237,16 +2246,16 @@ function tn({
|
|
|
2237
2246
|
}
|
|
2238
2247
|
);
|
|
2239
2248
|
}
|
|
2240
|
-
|
|
2249
|
+
nn.displayName = "Separator";
|
|
2241
2250
|
export {
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2251
|
+
qt as Group,
|
|
2252
|
+
Qt as Panel,
|
|
2253
|
+
nn as Separator,
|
|
2245
2254
|
Ct as isCoarsePointer,
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2255
|
+
an as useDefaultLayout,
|
|
2256
|
+
ln as useGroupCallbackRef,
|
|
2257
|
+
un as useGroupRef,
|
|
2258
|
+
cn as usePanelCallbackRef,
|
|
2259
|
+
fn as usePanelRef
|
|
2251
2260
|
};
|
|
2252
2261
|
//# sourceMappingURL=react-resizable-panels.js.map
|