react-resizable-panels 4.5.4 → 4.5.6
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,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
2
|
+
import { jsx as J } from "react/jsx-runtime";
|
|
3
|
+
import { useState as Q, useCallback as Y, useId as nt, useLayoutEffect as Te, useEffect as Oe, useRef as k, createContext as ot, useImperativeHandle as Ae, useMemo as _e, useSyncExternalStore as it, useContext as rt } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function B({
|
|
9
9
|
group: e
|
|
10
10
|
}) {
|
|
11
11
|
const { orientation: t, panels: n } = e;
|
|
@@ -143,7 +143,7 @@ function $e(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
146
|
+
groupSize: B({ group: e }),
|
|
147
147
|
panels: [a, h],
|
|
148
148
|
separator: "width" in d ? void 0 : d,
|
|
149
149
|
rect: p
|
|
@@ -224,7 +224,7 @@ function D(e) {
|
|
|
224
224
|
return parseFloat(e.toFixed(3));
|
|
225
225
|
}
|
|
226
226
|
function ve(e) {
|
|
227
|
-
const { panels: t } = e, n =
|
|
227
|
+
const { panels: t } = e, n = B({ group: e });
|
|
228
228
|
return n === 0 ? t.map((o) => ({
|
|
229
229
|
collapsedSize: 0,
|
|
230
230
|
collapsible: o.panelConstraints.collapsible === !0,
|
|
@@ -329,7 +329,7 @@ let I = {
|
|
|
329
329
|
},
|
|
330
330
|
mountedGroups: /* @__PURE__ */ new Map()
|
|
331
331
|
};
|
|
332
|
-
const
|
|
332
|
+
const N = new mt();
|
|
333
333
|
function G() {
|
|
334
334
|
return I;
|
|
335
335
|
}
|
|
@@ -341,7 +341,7 @@ function M(e) {
|
|
|
341
341
|
return I = {
|
|
342
342
|
...I,
|
|
343
343
|
...t
|
|
344
|
-
}, t.cursorFlags !== void 0 &&
|
|
344
|
+
}, t.cursorFlags !== void 0 && N.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && N.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, i) => {
|
|
345
345
|
o.derivedPanelConstraints.forEach((r) => {
|
|
346
346
|
if (r.collapsible) {
|
|
347
347
|
const { layout: l } = n.mountedGroups.get(i) ?? {};
|
|
@@ -357,7 +357,7 @@ function M(e) {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
-
}),
|
|
360
|
+
}), N.emit("mountedGroupsChange", I.mountedGroups)), I;
|
|
361
361
|
}
|
|
362
362
|
function gt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
@@ -492,10 +492,10 @@ function Lt(e, t) {
|
|
|
492
492
|
return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function ee(e, t) {
|
|
496
496
|
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function W({
|
|
499
499
|
panelConstraints: e,
|
|
500
500
|
size: t
|
|
501
501
|
}) {
|
|
@@ -505,10 +505,10 @@ function B({
|
|
|
505
505
|
maxSize: i = 100,
|
|
506
506
|
minSize: r = 0
|
|
507
507
|
} = e;
|
|
508
|
-
if (
|
|
508
|
+
if (ee(t, r) < 0)
|
|
509
509
|
if (o) {
|
|
510
510
|
const l = (n + r) / 2;
|
|
511
|
-
|
|
511
|
+
ee(t, l) < 0 ? t = n : t = r;
|
|
512
512
|
} else
|
|
513
513
|
t = r;
|
|
514
514
|
return t = Math.min(i, t), t = D(t), t;
|
|
@@ -546,7 +546,7 @@ function te({
|
|
|
546
546
|
`Previous layout not found for panel index ${f}`
|
|
547
547
|
), R(x, p)) {
|
|
548
548
|
const S = v - x;
|
|
549
|
-
|
|
549
|
+
ee(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
@@ -568,29 +568,12 @@ function te({
|
|
|
568
568
|
`Previous layout not found for panel index ${f}`
|
|
569
569
|
), R(x, v)) {
|
|
570
570
|
const S = x - p;
|
|
571
|
-
|
|
571
|
+
ee(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
-
default: {
|
|
578
|
-
const f = e < 0 ? c : u, d = n[f];
|
|
579
|
-
z(
|
|
580
|
-
d,
|
|
581
|
-
`Panel constraints not found for index ${f}`
|
|
582
|
-
);
|
|
583
|
-
const { collapsible: p, collapsedSize: g, minSize: v } = d;
|
|
584
|
-
if (p)
|
|
585
|
-
if (e > 0) {
|
|
586
|
-
const x = v - g, S = x / 2;
|
|
587
|
-
O(e, v) < 0 && (e = O(e, S) <= 0 ? 0 : x);
|
|
588
|
-
} else {
|
|
589
|
-
const x = v - g, S = 100 - x / 2;
|
|
590
|
-
O(100 + e, v) > 0 && (e = O(100 + e, S) > 0 ? 0 : -x);
|
|
591
|
-
}
|
|
592
|
-
break;
|
|
593
|
-
}
|
|
594
577
|
}
|
|
595
578
|
{
|
|
596
579
|
const f = e < 0 ? 1 : -1;
|
|
@@ -601,7 +584,7 @@ function te({
|
|
|
601
584
|
v != null,
|
|
602
585
|
`Previous layout not found for panel index ${d}`
|
|
603
586
|
);
|
|
604
|
-
const S =
|
|
587
|
+
const S = W({
|
|
605
588
|
panelConstraints: n[d],
|
|
606
589
|
size: 100
|
|
607
590
|
}) - v;
|
|
@@ -619,7 +602,7 @@ function te({
|
|
|
619
602
|
g != null,
|
|
620
603
|
`Previous layout not found for panel index ${d}`
|
|
621
604
|
);
|
|
622
|
-
const v = g - p, x =
|
|
605
|
+
const v = g - p, x = W({
|
|
623
606
|
panelConstraints: n[d],
|
|
624
607
|
size: v
|
|
625
608
|
});
|
|
@@ -638,7 +621,7 @@ function te({
|
|
|
638
621
|
d != null,
|
|
639
622
|
`Previous layout not found for panel index ${f}`
|
|
640
623
|
);
|
|
641
|
-
const p = d + h, g =
|
|
624
|
+
const p = d + h, g = W({
|
|
642
625
|
panelConstraints: n[f],
|
|
643
626
|
size: p
|
|
644
627
|
});
|
|
@@ -650,7 +633,7 @@ function te({
|
|
|
650
633
|
w != null,
|
|
651
634
|
`Previous layout not found for panel index ${S}`
|
|
652
635
|
);
|
|
653
|
-
const C = w + v, P =
|
|
636
|
+
const C = w + v, P = W({
|
|
654
637
|
panelConstraints: n[S],
|
|
655
638
|
size: C
|
|
656
639
|
});
|
|
@@ -669,15 +652,15 @@ function te({
|
|
|
669
652
|
const m = Object.keys(i);
|
|
670
653
|
return a.reduce((f, d, p) => (f[m[p]] = d, f), {});
|
|
671
654
|
}
|
|
672
|
-
function
|
|
655
|
+
function F(e, t) {
|
|
673
656
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
674
657
|
return !1;
|
|
675
658
|
for (const n in e)
|
|
676
|
-
if (t[n] === void 0 ||
|
|
659
|
+
if (t[n] === void 0 || ee(e[n], t[n]) !== 0)
|
|
677
660
|
return !1;
|
|
678
661
|
return !0;
|
|
679
662
|
}
|
|
680
|
-
function
|
|
663
|
+
function $({
|
|
681
664
|
layout: e,
|
|
682
665
|
panelConstraints: t
|
|
683
666
|
}) {
|
|
@@ -700,7 +683,7 @@ function H({
|
|
|
700
683
|
for (let s = 0; s < t.length; s++) {
|
|
701
684
|
const a = o[s];
|
|
702
685
|
z(a != null, `No layout data found for index ${s}`);
|
|
703
|
-
const u =
|
|
686
|
+
const u = W({
|
|
704
687
|
panelConstraints: t[s],
|
|
705
688
|
size: a
|
|
706
689
|
});
|
|
@@ -710,7 +693,7 @@ function H({
|
|
|
710
693
|
for (let s = 0; s < t.length; s++) {
|
|
711
694
|
const a = o[s];
|
|
712
695
|
z(a != null, `No layout data found for index ${s}`);
|
|
713
|
-
const u = a + r, c =
|
|
696
|
+
const u = a + r, c = W({
|
|
714
697
|
panelConstraints: t[s],
|
|
715
698
|
size: u
|
|
716
699
|
});
|
|
@@ -778,11 +761,11 @@ function je({
|
|
|
778
761
|
pivotIndices: d ? [f - 1, f] : [f, f + 1],
|
|
779
762
|
prevLayout: y,
|
|
780
763
|
trigger: "imperative-api"
|
|
781
|
-
}), g =
|
|
764
|
+
}), g = $({
|
|
782
765
|
layout: p,
|
|
783
766
|
panelConstraints: c
|
|
784
767
|
});
|
|
785
|
-
|
|
768
|
+
F(y, g) || M((v) => ({
|
|
786
769
|
mountedGroups: new Map(v.mountedGroups).set(h, {
|
|
787
770
|
defaultLayoutDeferred: u,
|
|
788
771
|
derivedPanelConstraints: c,
|
|
@@ -819,7 +802,7 @@ function je({
|
|
|
819
802
|
let u;
|
|
820
803
|
switch (typeof s) {
|
|
821
804
|
case "number": {
|
|
822
|
-
const { group: c } = n(), h =
|
|
805
|
+
const { group: c } = n(), h = B({ group: c });
|
|
823
806
|
u = D(s / h * 100);
|
|
824
807
|
break;
|
|
825
808
|
}
|
|
@@ -883,11 +866,11 @@ function Ve({
|
|
|
883
866
|
group: r,
|
|
884
867
|
layout: l,
|
|
885
868
|
separatorToPanels: s
|
|
886
|
-
} = t(), a =
|
|
869
|
+
} = t(), a = $({
|
|
887
870
|
layout: n,
|
|
888
871
|
panelConstraints: i
|
|
889
872
|
});
|
|
890
|
-
return o ? l : (
|
|
873
|
+
return o ? l : (F(l, a) || M((u) => ({
|
|
891
874
|
mountedGroups: new Map(u.mountedGroups).set(r, {
|
|
892
875
|
defaultLayoutDeferred: o,
|
|
893
876
|
derivedPanelConstraints: i,
|
|
@@ -902,7 +885,7 @@ function Ue(e) {
|
|
|
902
885
|
const { mountedGroups: t } = G(), n = t.get(e);
|
|
903
886
|
return z(n, `Mounted Group ${e.id} not found`), n;
|
|
904
887
|
}
|
|
905
|
-
function
|
|
888
|
+
function _(e, t) {
|
|
906
889
|
const n = ae(e), o = Ue(n), i = n.separators.find(
|
|
907
890
|
(h) => h.element === e
|
|
908
891
|
);
|
|
@@ -916,11 +899,11 @@ function N(e, t) {
|
|
|
916
899
|
pivotIndices: l,
|
|
917
900
|
prevLayout: a,
|
|
918
901
|
trigger: "keyboard"
|
|
919
|
-
}), c =
|
|
902
|
+
}), c = $({
|
|
920
903
|
layout: u,
|
|
921
904
|
panelConstraints: o.derivedPanelConstraints
|
|
922
905
|
});
|
|
923
|
-
|
|
906
|
+
F(a, c) || M((h) => ({
|
|
924
907
|
mountedGroups: new Map(h.mountedGroups).set(n, {
|
|
925
908
|
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
926
909
|
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
@@ -936,23 +919,23 @@ function Le(e) {
|
|
|
936
919
|
if (!n.disabled)
|
|
937
920
|
switch (e.key) {
|
|
938
921
|
case "ArrowDown": {
|
|
939
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
922
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, 5);
|
|
940
923
|
break;
|
|
941
924
|
}
|
|
942
925
|
case "ArrowLeft": {
|
|
943
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
926
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
|
|
944
927
|
break;
|
|
945
928
|
}
|
|
946
929
|
case "ArrowRight": {
|
|
947
|
-
e.preventDefault(), n.orientation === "horizontal" &&
|
|
930
|
+
e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
|
|
948
931
|
break;
|
|
949
932
|
}
|
|
950
933
|
case "ArrowUp": {
|
|
951
|
-
e.preventDefault(), n.orientation === "vertical" &&
|
|
934
|
+
e.preventDefault(), n.orientation === "vertical" && _(t, -5);
|
|
952
935
|
break;
|
|
953
936
|
}
|
|
954
937
|
case "End": {
|
|
955
|
-
e.preventDefault(),
|
|
938
|
+
e.preventDefault(), _(t, 100);
|
|
956
939
|
break;
|
|
957
940
|
}
|
|
958
941
|
case "Enter": {
|
|
@@ -968,7 +951,7 @@ function Le(e) {
|
|
|
968
951
|
);
|
|
969
952
|
if (z(c, "Panel metadata not found"), c.collapsible) {
|
|
970
953
|
const h = r[u.id], y = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
971
|
-
|
|
954
|
+
_(t, y - h);
|
|
972
955
|
}
|
|
973
956
|
break;
|
|
974
957
|
}
|
|
@@ -985,7 +968,7 @@ function Le(e) {
|
|
|
985
968
|
break;
|
|
986
969
|
}
|
|
987
970
|
case "Home": {
|
|
988
|
-
e.preventDefault(),
|
|
971
|
+
e.preventDefault(), _(t, -100);
|
|
989
972
|
break;
|
|
990
973
|
}
|
|
991
974
|
}
|
|
@@ -1119,7 +1102,7 @@ function qe({
|
|
|
1119
1102
|
prevLayout: S,
|
|
1120
1103
|
trigger: "mouse-or-touch"
|
|
1121
1104
|
});
|
|
1122
|
-
if (
|
|
1105
|
+
if (F(C, S)) {
|
|
1123
1106
|
if (p !== 0 && !m)
|
|
1124
1107
|
switch (f) {
|
|
1125
1108
|
case "horizontal": {
|
|
@@ -1252,7 +1235,7 @@ function Rt(e, t, n) {
|
|
|
1252
1235
|
const i = e.panels.find((u) => u.element === t);
|
|
1253
1236
|
if (!i || !i.onResize)
|
|
1254
1237
|
return;
|
|
1255
|
-
const r =
|
|
1238
|
+
const r = B({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1256
1239
|
asPercentage: D(l / r * 100),
|
|
1257
1240
|
inPixels: l
|
|
1258
1241
|
};
|
|
@@ -1275,7 +1258,7 @@ function Et(e, t) {
|
|
|
1275
1258
|
return !1;
|
|
1276
1259
|
return !0;
|
|
1277
1260
|
}
|
|
1278
|
-
const
|
|
1261
|
+
const U = /* @__PURE__ */ new Map();
|
|
1279
1262
|
function kt(e) {
|
|
1280
1263
|
let t = !0;
|
|
1281
1264
|
z(
|
|
@@ -1287,16 +1270,16 @@ function kt(e) {
|
|
|
1287
1270
|
const { borderBoxSize: p, target: g } = d;
|
|
1288
1271
|
if (g === e.element) {
|
|
1289
1272
|
if (t) {
|
|
1290
|
-
if (
|
|
1273
|
+
if (B({ group: e }) === 0)
|
|
1291
1274
|
return;
|
|
1292
1275
|
M((x) => {
|
|
1293
1276
|
const S = x.mountedGroups.get(e);
|
|
1294
1277
|
if (S) {
|
|
1295
|
-
const w = ve(e), C = S.defaultLayoutDeferred ? De(w) : S.layout, P =
|
|
1278
|
+
const w = ve(e), C = S.defaultLayoutDeferred ? De(w) : S.layout, P = $({
|
|
1296
1279
|
layout: C,
|
|
1297
1280
|
panelConstraints: w
|
|
1298
1281
|
});
|
|
1299
|
-
return !S.defaultLayoutDeferred &&
|
|
1282
|
+
return !S.defaultLayoutDeferred && F(C, P) && Mt(
|
|
1300
1283
|
S.derivedPanelConstraints,
|
|
1301
1284
|
w
|
|
1302
1285
|
) ? x : {
|
|
@@ -1321,18 +1304,18 @@ function kt(e) {
|
|
|
1321
1304
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1322
1305
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1323
1306
|
});
|
|
1324
|
-
const l =
|
|
1307
|
+
const l = B({ group: e }), s = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1325
1308
|
let u = e.defaultLayout;
|
|
1326
1309
|
u && (Et(e.panels, u) || (u = void 0));
|
|
1327
|
-
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h =
|
|
1310
|
+
const c = e.inMemoryLayouts[a] ?? u ?? De(s), h = $({
|
|
1328
1311
|
layout: c,
|
|
1329
1312
|
panelConstraints: s
|
|
1330
1313
|
}), y = $e(e), m = e.element.ownerDocument;
|
|
1331
1314
|
return M((f) => {
|
|
1332
1315
|
const d = /* @__PURE__ */ new Map();
|
|
1333
|
-
return
|
|
1316
|
+
return U.set(
|
|
1334
1317
|
m,
|
|
1335
|
-
(
|
|
1318
|
+
(U.get(m) ?? 0) + 1
|
|
1336
1319
|
), y.forEach((p) => {
|
|
1337
1320
|
p.separator && d.set(p.separator, p.panels);
|
|
1338
1321
|
}), {
|
|
@@ -1348,16 +1331,16 @@ function kt(e) {
|
|
|
1348
1331
|
!i.has(f.id),
|
|
1349
1332
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1350
1333
|
), i.add(f.id), f.element.addEventListener("keydown", Le);
|
|
1351
|
-
}),
|
|
1352
|
-
t = !1,
|
|
1334
|
+
}), U.get(m) === 1 && (m.addEventListener("dblclick", we, !0), m.addEventListener("pointerdown", Ce, !0), m.addEventListener("pointerleave", ke), m.addEventListener("pointermove", Ge), m.addEventListener("pointerup", Ie, !0)), function() {
|
|
1335
|
+
t = !1, U.set(
|
|
1353
1336
|
m,
|
|
1354
|
-
Math.max(0, (
|
|
1337
|
+
Math.max(0, (U.get(m) ?? 0) - 1)
|
|
1355
1338
|
), M((d) => {
|
|
1356
1339
|
const p = new Map(d.mountedGroups);
|
|
1357
1340
|
return p.delete(e), { mountedGroups: p };
|
|
1358
1341
|
}), e.separators.forEach((d) => {
|
|
1359
1342
|
d.element.removeEventListener("keydown", Le);
|
|
1360
|
-
}),
|
|
1343
|
+
}), U.get(m) || (m.removeEventListener(
|
|
1361
1344
|
"dblclick",
|
|
1362
1345
|
we,
|
|
1363
1346
|
!0
|
|
@@ -1369,25 +1352,25 @@ function kt(e) {
|
|
|
1369
1352
|
};
|
|
1370
1353
|
}
|
|
1371
1354
|
function Ye() {
|
|
1372
|
-
const [e, t] =
|
|
1355
|
+
const [e, t] = Q({}), n = Y(() => t({}), []);
|
|
1373
1356
|
return [e, n];
|
|
1374
1357
|
}
|
|
1375
1358
|
function me(e) {
|
|
1376
1359
|
const t = nt();
|
|
1377
1360
|
return `${e ?? t}`;
|
|
1378
1361
|
}
|
|
1379
|
-
const
|
|
1380
|
-
function
|
|
1362
|
+
const H = typeof window < "u" ? Te : Oe;
|
|
1363
|
+
function Z(e) {
|
|
1381
1364
|
const t = k(e);
|
|
1382
|
-
return
|
|
1365
|
+
return H(() => {
|
|
1383
1366
|
t.current = e;
|
|
1384
|
-
}, [e]),
|
|
1367
|
+
}, [e]), Y(
|
|
1385
1368
|
(...n) => t.current?.(...n),
|
|
1386
1369
|
[t]
|
|
1387
1370
|
);
|
|
1388
1371
|
}
|
|
1389
1372
|
function ge(...e) {
|
|
1390
|
-
return
|
|
1373
|
+
return Z((t) => {
|
|
1391
1374
|
e.forEach((n) => {
|
|
1392
1375
|
if (n)
|
|
1393
1376
|
switch (typeof n) {
|
|
@@ -1405,7 +1388,7 @@ function ge(...e) {
|
|
|
1405
1388
|
}
|
|
1406
1389
|
function Gt(e) {
|
|
1407
1390
|
const t = k({ ...e });
|
|
1408
|
-
return
|
|
1391
|
+
return H(() => {
|
|
1409
1392
|
for (const n in e)
|
|
1410
1393
|
t.current[n] = e[n];
|
|
1411
1394
|
}, [e]), t.current;
|
|
@@ -1416,7 +1399,7 @@ function It(e, t) {
|
|
|
1416
1399
|
getLayout: () => ({}),
|
|
1417
1400
|
setLayout: Ct
|
|
1418
1401
|
});
|
|
1419
|
-
Ae(t, () => n.current, []),
|
|
1402
|
+
Ae(t, () => n.current, []), H(() => {
|
|
1420
1403
|
Object.assign(
|
|
1421
1404
|
n.current,
|
|
1422
1405
|
Ve({ groupId: e })
|
|
@@ -1445,10 +1428,10 @@ function Dt({
|
|
|
1445
1428
|
const f = k({
|
|
1446
1429
|
onLayoutChange: {},
|
|
1447
1430
|
onLayoutChanged: {}
|
|
1448
|
-
}), d =
|
|
1449
|
-
|
|
1450
|
-
}), p =
|
|
1451
|
-
|
|
1431
|
+
}), d = Z((b) => {
|
|
1432
|
+
F(f.current.onLayoutChange, b) || (f.current.onLayoutChange = b, a?.(b));
|
|
1433
|
+
}), p = Z((b) => {
|
|
1434
|
+
F(f.current.onLayoutChanged, b) || (f.current.onLayoutChanged = b, u?.(b));
|
|
1452
1435
|
}), g = me(s), v = k(null), [x, S] = Ye(), w = k({
|
|
1453
1436
|
lastExpandedPanelSizes: {},
|
|
1454
1437
|
layouts: {},
|
|
@@ -1457,25 +1440,25 @@ function Dt({
|
|
|
1457
1440
|
separators: []
|
|
1458
1441
|
}), C = ge(v, r);
|
|
1459
1442
|
It(g, l);
|
|
1460
|
-
const P =
|
|
1443
|
+
const P = Z(
|
|
1461
1444
|
(b, L) => {
|
|
1462
1445
|
const { interactionState: E, mountedGroups: ne } = G();
|
|
1463
1446
|
for (const oe of ne.keys())
|
|
1464
1447
|
if (oe.id === b) {
|
|
1465
|
-
const
|
|
1466
|
-
if (
|
|
1467
|
-
let
|
|
1448
|
+
const K = ne.get(oe);
|
|
1449
|
+
if (K) {
|
|
1450
|
+
let X = !1;
|
|
1468
1451
|
switch (E.state) {
|
|
1469
1452
|
case "active": {
|
|
1470
|
-
|
|
1453
|
+
X = E.hitRegions.some(
|
|
1471
1454
|
(le) => le.group === oe
|
|
1472
1455
|
);
|
|
1473
1456
|
break;
|
|
1474
1457
|
}
|
|
1475
1458
|
}
|
|
1476
1459
|
return {
|
|
1477
|
-
flexGrow:
|
|
1478
|
-
pointerEvents:
|
|
1460
|
+
flexGrow: K.layout[L] ?? 1,
|
|
1461
|
+
pointerEvents: X ? "none" : void 0
|
|
1479
1462
|
};
|
|
1480
1463
|
}
|
|
1481
1464
|
}
|
|
@@ -1512,17 +1495,17 @@ function Dt({
|
|
|
1512
1495
|
}
|
|
1513
1496
|
}),
|
|
1514
1497
|
[P, g, S, c]
|
|
1515
|
-
),
|
|
1498
|
+
), j = Gt({
|
|
1516
1499
|
defaultLayout: n,
|
|
1517
1500
|
disableCursor: o
|
|
1518
|
-
}),
|
|
1519
|
-
return
|
|
1501
|
+
}), O = k(null);
|
|
1502
|
+
return H(() => {
|
|
1520
1503
|
const b = v.current;
|
|
1521
1504
|
if (b === null)
|
|
1522
1505
|
return;
|
|
1523
1506
|
const L = w.current, E = {
|
|
1524
|
-
defaultLayout:
|
|
1525
|
-
disableCursor: !!
|
|
1507
|
+
defaultLayout: j.defaultLayout,
|
|
1508
|
+
disableCursor: !!j.disableCursor,
|
|
1526
1509
|
disabled: !!i,
|
|
1527
1510
|
element: b,
|
|
1528
1511
|
id: g,
|
|
@@ -1533,30 +1516,30 @@ function Dt({
|
|
|
1533
1516
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1534
1517
|
separators: L.separators
|
|
1535
1518
|
};
|
|
1536
|
-
|
|
1537
|
-
const ne = kt(E),
|
|
1538
|
-
if (
|
|
1539
|
-
const { defaultLayoutDeferred:
|
|
1540
|
-
!
|
|
1519
|
+
O.current = E;
|
|
1520
|
+
const ne = kt(E), K = G().mountedGroups.get(E);
|
|
1521
|
+
if (K) {
|
|
1522
|
+
const { defaultLayoutDeferred: q, derivedPanelConstraints: A, layout: V } = K;
|
|
1523
|
+
!q && A.length > 0 && (d(V), p(V), L.panels.forEach((ue) => {
|
|
1541
1524
|
ue.scheduleUpdate();
|
|
1542
1525
|
}));
|
|
1543
1526
|
}
|
|
1544
|
-
let
|
|
1545
|
-
const le =
|
|
1527
|
+
let X = !1;
|
|
1528
|
+
const le = N.addListener(
|
|
1546
1529
|
"interactionStateChange",
|
|
1547
|
-
(
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1550
|
-
|
|
1530
|
+
(q) => {
|
|
1531
|
+
const A = q.state === "active";
|
|
1532
|
+
X !== A && (X = A, L.panels.forEach((V) => {
|
|
1533
|
+
V.scheduleUpdate();
|
|
1551
1534
|
}));
|
|
1552
1535
|
}
|
|
1553
|
-
), Je =
|
|
1536
|
+
), Je = N.addListener(
|
|
1554
1537
|
"mountedGroupsChange",
|
|
1555
|
-
(
|
|
1556
|
-
const
|
|
1557
|
-
if (
|
|
1558
|
-
const { defaultLayoutDeferred:
|
|
1559
|
-
if (
|
|
1538
|
+
(q) => {
|
|
1539
|
+
const A = q.get(E);
|
|
1540
|
+
if (A) {
|
|
1541
|
+
const { defaultLayoutDeferred: V, derivedPanelConstraints: ue, layout: Se } = A;
|
|
1542
|
+
if (V || ue.length === 0)
|
|
1560
1543
|
return;
|
|
1561
1544
|
const { interactionState: Qe } = G(), et = Qe.state !== "active";
|
|
1562
1545
|
d(Se), et && p(Se), L.panels.forEach((tt) => {
|
|
@@ -1566,7 +1549,7 @@ function Dt({
|
|
|
1566
1549
|
}
|
|
1567
1550
|
);
|
|
1568
1551
|
return () => {
|
|
1569
|
-
|
|
1552
|
+
O.current = null, ne(), le(), Je();
|
|
1570
1553
|
};
|
|
1571
1554
|
}, [
|
|
1572
1555
|
i,
|
|
@@ -1575,15 +1558,14 @@ function Dt({
|
|
|
1575
1558
|
d,
|
|
1576
1559
|
c,
|
|
1577
1560
|
x,
|
|
1578
|
-
|
|
1561
|
+
j
|
|
1579
1562
|
]), Oe(() => {
|
|
1580
|
-
const b =
|
|
1563
|
+
const b = O.current;
|
|
1581
1564
|
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1582
|
-
}), /* @__PURE__ */
|
|
1565
|
+
}), /* @__PURE__ */ J(Ze.Provider, { value: T, children: /* @__PURE__ */ J(
|
|
1583
1566
|
"div",
|
|
1584
1567
|
{
|
|
1585
1568
|
...m,
|
|
1586
|
-
"aria-orientation": c,
|
|
1587
1569
|
className: t,
|
|
1588
1570
|
"data-group": !0,
|
|
1589
1571
|
"data-testid": g,
|
|
@@ -1619,14 +1601,14 @@ function jt({
|
|
|
1619
1601
|
), a = _e(
|
|
1620
1602
|
() => s ? JSON.parse(s) : void 0,
|
|
1621
1603
|
[s]
|
|
1622
|
-
), u = k(null), c =
|
|
1604
|
+
), u = k(null), c = Y(() => {
|
|
1623
1605
|
const m = u.current;
|
|
1624
1606
|
m && (u.current = null, clearTimeout(m));
|
|
1625
1607
|
}, []);
|
|
1626
1608
|
Te(() => () => {
|
|
1627
1609
|
c();
|
|
1628
1610
|
}, [c]);
|
|
1629
|
-
const h =
|
|
1611
|
+
const h = Y(
|
|
1630
1612
|
(m) => {
|
|
1631
1613
|
c();
|
|
1632
1614
|
let f;
|
|
@@ -1638,7 +1620,7 @@ function jt({
|
|
|
1638
1620
|
}
|
|
1639
1621
|
},
|
|
1640
1622
|
[c, i, r, n]
|
|
1641
|
-
), y =
|
|
1623
|
+
), y = Y(
|
|
1642
1624
|
(m) => {
|
|
1643
1625
|
c(), e === 0 ? h(m) : u.current = setTimeout(() => {
|
|
1644
1626
|
h(m);
|
|
@@ -1668,7 +1650,7 @@ function Tt() {
|
|
|
1668
1650
|
};
|
|
1669
1651
|
}
|
|
1670
1652
|
function Vt() {
|
|
1671
|
-
return
|
|
1653
|
+
return Q(null);
|
|
1672
1654
|
}
|
|
1673
1655
|
function Ut() {
|
|
1674
1656
|
return k(null);
|
|
@@ -1691,7 +1673,7 @@ function Ot(e, t) {
|
|
|
1691
1673
|
isCollapsed: () => !1,
|
|
1692
1674
|
resize: ce
|
|
1693
1675
|
});
|
|
1694
|
-
Ae(t, () => o.current, []),
|
|
1676
|
+
Ae(t, () => o.current, []), H(() => {
|
|
1695
1677
|
Object.assign(
|
|
1696
1678
|
o.current,
|
|
1697
1679
|
je({ groupId: n, panelId: e })
|
|
@@ -1713,12 +1695,12 @@ function At({
|
|
|
1713
1695
|
style: h,
|
|
1714
1696
|
...y
|
|
1715
1697
|
}) {
|
|
1716
|
-
const m = !!l, f = me(l), d = k(null), p = ge(d, r), [, g] = Ye(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C =
|
|
1717
|
-
(T,
|
|
1718
|
-
u?.(T, l,
|
|
1698
|
+
const m = !!l, f = me(l), d = k(null), p = ge(d, r), [, g] = Ye(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C = Z(
|
|
1699
|
+
(T, j, O) => {
|
|
1700
|
+
u?.(T, l, O);
|
|
1719
1701
|
}
|
|
1720
1702
|
);
|
|
1721
|
-
|
|
1703
|
+
H(() => {
|
|
1722
1704
|
const T = d.current;
|
|
1723
1705
|
if (T !== null)
|
|
1724
1706
|
return S({
|
|
@@ -1753,7 +1735,7 @@ function At({
|
|
|
1753
1735
|
S
|
|
1754
1736
|
]), Ot(f, c);
|
|
1755
1737
|
const P = v(x, f);
|
|
1756
|
-
return /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ J(
|
|
1757
1739
|
"div",
|
|
1758
1740
|
{
|
|
1759
1741
|
...y,
|
|
@@ -1770,7 +1752,7 @@ function At({
|
|
|
1770
1752
|
overflow: "hidden",
|
|
1771
1753
|
...P
|
|
1772
1754
|
},
|
|
1773
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ J(
|
|
1774
1756
|
"div",
|
|
1775
1757
|
{
|
|
1776
1758
|
className: t,
|
|
@@ -1800,7 +1782,7 @@ const _t = {
|
|
|
1800
1782
|
margin: 0
|
|
1801
1783
|
};
|
|
1802
1784
|
function Wt() {
|
|
1803
|
-
return
|
|
1785
|
+
return Q(null);
|
|
1804
1786
|
}
|
|
1805
1787
|
function Bt() {
|
|
1806
1788
|
return k(null);
|
|
@@ -1817,7 +1799,7 @@ function Nt({
|
|
|
1817
1799
|
);
|
|
1818
1800
|
if (s) {
|
|
1819
1801
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1820
|
-
r =
|
|
1802
|
+
r = $({
|
|
1821
1803
|
layout: te({
|
|
1822
1804
|
delta: u - l,
|
|
1823
1805
|
initialLayout: e,
|
|
@@ -1826,7 +1808,7 @@ function Nt({
|
|
|
1826
1808
|
prevLayout: e
|
|
1827
1809
|
}),
|
|
1828
1810
|
panelConstraints: t
|
|
1829
|
-
})[n], i =
|
|
1811
|
+
})[n], i = $({
|
|
1830
1812
|
layout: te({
|
|
1831
1813
|
delta: a - l,
|
|
1832
1814
|
initialLayout: e,
|
|
@@ -1852,18 +1834,18 @@ function Ft({
|
|
|
1852
1834
|
style: i,
|
|
1853
1835
|
...r
|
|
1854
1836
|
}) {
|
|
1855
|
-
const l = me(o), [s, a] =
|
|
1837
|
+
const l = me(o), [s, a] = Q({}), [u, c] = Q("inactive"), h = k(null), y = ge(h, n), {
|
|
1856
1838
|
id: m,
|
|
1857
1839
|
orientation: f,
|
|
1858
1840
|
registerSeparator: d
|
|
1859
1841
|
} = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1860
|
-
return
|
|
1842
|
+
return H(() => {
|
|
1861
1843
|
const g = h.current;
|
|
1862
1844
|
if (g !== null) {
|
|
1863
1845
|
const v = {
|
|
1864
1846
|
element: g,
|
|
1865
1847
|
id: l
|
|
1866
|
-
}, x = d(v), S =
|
|
1848
|
+
}, x = d(v), S = N.addListener(
|
|
1867
1849
|
"interactionStateChange",
|
|
1868
1850
|
(C) => {
|
|
1869
1851
|
c(
|
|
@@ -1872,15 +1854,15 @@ function Ft({
|
|
|
1872
1854
|
) ? C.state : "inactive"
|
|
1873
1855
|
);
|
|
1874
1856
|
}
|
|
1875
|
-
), w =
|
|
1857
|
+
), w = N.addListener(
|
|
1876
1858
|
"mountedGroupsChange",
|
|
1877
1859
|
(C) => {
|
|
1878
1860
|
C.forEach(
|
|
1879
|
-
({ derivedPanelConstraints: P, layout: T, separatorToPanels:
|
|
1880
|
-
if (
|
|
1881
|
-
const b =
|
|
1861
|
+
({ derivedPanelConstraints: P, layout: T, separatorToPanels: j }, O) => {
|
|
1862
|
+
if (O.id === m) {
|
|
1863
|
+
const b = j.get(v);
|
|
1882
1864
|
if (b) {
|
|
1883
|
-
const L = b[0], E =
|
|
1865
|
+
const L = b[0], E = O.panels.indexOf(L);
|
|
1884
1866
|
a(
|
|
1885
1867
|
Nt({
|
|
1886
1868
|
layout: T,
|
|
@@ -1899,7 +1881,7 @@ function Ft({
|
|
|
1899
1881
|
S(), w(), x();
|
|
1900
1882
|
};
|
|
1901
1883
|
}
|
|
1902
|
-
}, [m, l, d]), /* @__PURE__ */
|
|
1884
|
+
}, [m, l, d]), /* @__PURE__ */ J(
|
|
1903
1885
|
"div",
|
|
1904
1886
|
{
|
|
1905
1887
|
...r,
|