react-resizable-panels 4.5.7 → 4.5.8
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 ot, useLayoutEffect as Oe, useEffect as Ae, useRef as G, createContext as it, useImperativeHandle as _e, useMemo as Ne, useSyncExternalStore as rt, useContext as st } 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 He(e) {
|
|
|
143
143
|
}
|
|
144
144
|
l.push({
|
|
145
145
|
group: e,
|
|
146
|
-
groupSize:
|
|
146
|
+
groupSize: B({ group: e }),
|
|
147
147
|
panels: [a, m],
|
|
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 gt();
|
|
333
333
|
function E() {
|
|
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 yt(e, t, n) {
|
|
363
363
|
let o, i = {
|
|
@@ -492,10 +492,10 @@ function Ct(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, x) < 0 && (e = O(e, S) <= 0 ? 0 : x);
|
|
588
|
-
} else {
|
|
589
|
-
const x = v - g, S = 100 - x / 2;
|
|
590
|
-
O(Math.abs(e), x) < 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 + m, g =
|
|
624
|
+
const p = d + m, 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 h = Object.keys(i);
|
|
670
653
|
return a.reduce((f, d, p) => (f[h[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 Ve({
|
|
|
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(m, {
|
|
787
770
|
defaultLayoutDeferred: u,
|
|
788
771
|
derivedPanelConstraints: c,
|
|
@@ -819,7 +802,7 @@ function Ve({
|
|
|
819
802
|
let u;
|
|
820
803
|
switch (typeof s) {
|
|
821
804
|
case "number": {
|
|
822
|
-
const { group: c } = n(), m =
|
|
805
|
+
const { group: c } = n(), m = B({ group: c });
|
|
823
806
|
u = D(s / m * 100);
|
|
824
807
|
break;
|
|
825
808
|
}
|
|
@@ -883,11 +866,11 @@ function Ue({
|
|
|
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 We(e) {
|
|
|
902
885
|
const { mountedGroups: t } = E(), 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 = We(n), i = n.separators.find(
|
|
907
890
|
(m) => m.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((m) => ({
|
|
924
907
|
mountedGroups: new Map(m.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 m = r[u.id], y = c.collapsedSize === m ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
|
|
971
|
-
|
|
954
|
+
_(t, y - m);
|
|
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 Ye({
|
|
|
1119
1102
|
prevLayout: S,
|
|
1120
1103
|
trigger: "mouse-or-touch"
|
|
1121
1104
|
});
|
|
1122
|
-
if (
|
|
1105
|
+
if (F(C, S)) {
|
|
1123
1106
|
if (p !== 0 && !h)
|
|
1124
1107
|
switch (f) {
|
|
1125
1108
|
case "horizontal": {
|
|
@@ -1265,7 +1248,7 @@ function Mt(e, t, n) {
|
|
|
1265
1248
|
const i = e.panels.find((u) => u.element === t);
|
|
1266
1249
|
if (!i || !i.onResize)
|
|
1267
1250
|
return;
|
|
1268
|
-
const r =
|
|
1251
|
+
const r = B({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, s = i.mutableValues.prevSize, a = {
|
|
1269
1252
|
asPercentage: D(l / r * 100),
|
|
1270
1253
|
inPixels: l
|
|
1271
1254
|
};
|
|
@@ -1288,7 +1271,7 @@ function kt(e, t) {
|
|
|
1288
1271
|
return !1;
|
|
1289
1272
|
return !0;
|
|
1290
1273
|
}
|
|
1291
|
-
const
|
|
1274
|
+
const U = /* @__PURE__ */ new Map();
|
|
1292
1275
|
function Gt(e) {
|
|
1293
1276
|
let t = !0;
|
|
1294
1277
|
z(
|
|
@@ -1300,16 +1283,16 @@ function Gt(e) {
|
|
|
1300
1283
|
const { borderBoxSize: p, target: g } = d;
|
|
1301
1284
|
if (g === e.element) {
|
|
1302
1285
|
if (t) {
|
|
1303
|
-
if (
|
|
1286
|
+
if (B({ group: e }) === 0)
|
|
1304
1287
|
return;
|
|
1305
1288
|
M((x) => {
|
|
1306
1289
|
const S = x.mountedGroups.get(e);
|
|
1307
1290
|
if (S) {
|
|
1308
|
-
const w = ve(e), C = S.defaultLayoutDeferred ? Te(w) : S.layout, P =
|
|
1291
|
+
const w = ve(e), C = S.defaultLayoutDeferred ? Te(w) : S.layout, P = $({
|
|
1309
1292
|
layout: C,
|
|
1310
1293
|
panelConstraints: w
|
|
1311
1294
|
});
|
|
1312
|
-
return !S.defaultLayoutDeferred &&
|
|
1295
|
+
return !S.defaultLayoutDeferred && F(C, P) && Et(
|
|
1313
1296
|
S.derivedPanelConstraints,
|
|
1314
1297
|
w
|
|
1315
1298
|
) ? x : {
|
|
@@ -1334,18 +1317,18 @@ function Gt(e) {
|
|
|
1334
1317
|
`Panel ids must be unique; id "${f.id}" was used more than once`
|
|
1335
1318
|
), o.add(f.id), f.onResize && r.observe(f.element);
|
|
1336
1319
|
});
|
|
1337
|
-
const l =
|
|
1320
|
+
const l = B({ group: e }), s = ve(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
1338
1321
|
let u = e.defaultLayout;
|
|
1339
1322
|
u && (kt(e.panels, u) || (u = void 0));
|
|
1340
|
-
const c = e.inMemoryLayouts[a] ?? u ?? Te(s), m =
|
|
1323
|
+
const c = e.inMemoryLayouts[a] ?? u ?? Te(s), m = $({
|
|
1341
1324
|
layout: c,
|
|
1342
1325
|
panelConstraints: s
|
|
1343
1326
|
}), y = He(e), h = e.element.ownerDocument;
|
|
1344
1327
|
return M((f) => {
|
|
1345
1328
|
const d = /* @__PURE__ */ new Map();
|
|
1346
|
-
return
|
|
1329
|
+
return U.set(
|
|
1347
1330
|
h,
|
|
1348
|
-
(
|
|
1331
|
+
(U.get(h) ?? 0) + 1
|
|
1349
1332
|
), y.forEach((p) => {
|
|
1350
1333
|
p.separator && d.set(p.separator, p.panels);
|
|
1351
1334
|
}), {
|
|
@@ -1361,16 +1344,16 @@ function Gt(e) {
|
|
|
1361
1344
|
!i.has(f.id),
|
|
1362
1345
|
`Separator ids must be unique; id "${f.id}" was used more than once`
|
|
1363
1346
|
), i.add(f.id), f.element.addEventListener("keydown", Le);
|
|
1364
|
-
}),
|
|
1365
|
-
t = !1,
|
|
1347
|
+
}), U.get(h) === 1 && (h.addEventListener("dblclick", we, !0), h.addEventListener("pointerdown", Ce, !0), h.addEventListener("pointerleave", ke), h.addEventListener("pointermove", Ge), h.addEventListener("pointerout", Ie), h.addEventListener("pointerup", De, !0)), function() {
|
|
1348
|
+
t = !1, U.set(
|
|
1366
1349
|
h,
|
|
1367
|
-
Math.max(0, (
|
|
1350
|
+
Math.max(0, (U.get(h) ?? 0) - 1)
|
|
1368
1351
|
), M((d) => {
|
|
1369
1352
|
const p = new Map(d.mountedGroups);
|
|
1370
1353
|
return p.delete(e), { mountedGroups: p };
|
|
1371
1354
|
}), e.separators.forEach((d) => {
|
|
1372
1355
|
d.element.removeEventListener("keydown", Le);
|
|
1373
|
-
}),
|
|
1356
|
+
}), U.get(h) || (h.removeEventListener(
|
|
1374
1357
|
"dblclick",
|
|
1375
1358
|
we,
|
|
1376
1359
|
!0
|
|
@@ -1382,25 +1365,25 @@ function Gt(e) {
|
|
|
1382
1365
|
};
|
|
1383
1366
|
}
|
|
1384
1367
|
function Ze() {
|
|
1385
|
-
const [e, t] =
|
|
1368
|
+
const [e, t] = Q({}), n = Y(() => t({}), []);
|
|
1386
1369
|
return [e, n];
|
|
1387
1370
|
}
|
|
1388
1371
|
function me(e) {
|
|
1389
1372
|
const t = ot();
|
|
1390
1373
|
return `${e ?? t}`;
|
|
1391
1374
|
}
|
|
1392
|
-
const
|
|
1393
|
-
function
|
|
1375
|
+
const H = typeof window < "u" ? Oe : Ae;
|
|
1376
|
+
function Z(e) {
|
|
1394
1377
|
const t = G(e);
|
|
1395
|
-
return
|
|
1378
|
+
return H(() => {
|
|
1396
1379
|
t.current = e;
|
|
1397
|
-
}, [e]),
|
|
1380
|
+
}, [e]), Y(
|
|
1398
1381
|
(...n) => t.current?.(...n),
|
|
1399
1382
|
[t]
|
|
1400
1383
|
);
|
|
1401
1384
|
}
|
|
1402
1385
|
function ge(...e) {
|
|
1403
|
-
return
|
|
1386
|
+
return Z((t) => {
|
|
1404
1387
|
e.forEach((n) => {
|
|
1405
1388
|
if (n)
|
|
1406
1389
|
switch (typeof n) {
|
|
@@ -1418,7 +1401,7 @@ function ge(...e) {
|
|
|
1418
1401
|
}
|
|
1419
1402
|
function It(e) {
|
|
1420
1403
|
const t = G({ ...e });
|
|
1421
|
-
return
|
|
1404
|
+
return H(() => {
|
|
1422
1405
|
for (const n in e)
|
|
1423
1406
|
t.current[n] = e[n];
|
|
1424
1407
|
}, [e]), t.current;
|
|
@@ -1429,7 +1412,7 @@ function Dt(e, t) {
|
|
|
1429
1412
|
getLayout: () => ({}),
|
|
1430
1413
|
setLayout: Pt
|
|
1431
1414
|
});
|
|
1432
|
-
_e(t, () => n.current, []),
|
|
1415
|
+
_e(t, () => n.current, []), H(() => {
|
|
1433
1416
|
Object.assign(
|
|
1434
1417
|
n.current,
|
|
1435
1418
|
Ue({ groupId: e })
|
|
@@ -1458,10 +1441,10 @@ function Tt({
|
|
|
1458
1441
|
const f = G({
|
|
1459
1442
|
onLayoutChange: {},
|
|
1460
1443
|
onLayoutChanged: {}
|
|
1461
|
-
}), d =
|
|
1462
|
-
|
|
1463
|
-
}), p =
|
|
1464
|
-
|
|
1444
|
+
}), d = Z((b) => {
|
|
1445
|
+
F(f.current.onLayoutChange, b) || (f.current.onLayoutChange = b, a?.(b));
|
|
1446
|
+
}), p = Z((b) => {
|
|
1447
|
+
F(f.current.onLayoutChanged, b) || (f.current.onLayoutChanged = b, u?.(b));
|
|
1465
1448
|
}), g = me(s), v = G(null), [x, S] = Ze(), w = G({
|
|
1466
1449
|
lastExpandedPanelSizes: {},
|
|
1467
1450
|
layouts: {},
|
|
@@ -1470,25 +1453,25 @@ function Tt({
|
|
|
1470
1453
|
separators: []
|
|
1471
1454
|
}), C = ge(v, r);
|
|
1472
1455
|
Dt(g, l);
|
|
1473
|
-
const P =
|
|
1456
|
+
const P = Z(
|
|
1474
1457
|
(b, L) => {
|
|
1475
1458
|
const { interactionState: k, mountedGroups: ne } = E();
|
|
1476
1459
|
for (const oe of ne.keys())
|
|
1477
1460
|
if (oe.id === b) {
|
|
1478
|
-
const
|
|
1479
|
-
if (
|
|
1480
|
-
let
|
|
1461
|
+
const K = ne.get(oe);
|
|
1462
|
+
if (K) {
|
|
1463
|
+
let X = !1;
|
|
1481
1464
|
switch (k.state) {
|
|
1482
1465
|
case "active": {
|
|
1483
|
-
|
|
1466
|
+
X = k.hitRegions.some(
|
|
1484
1467
|
(le) => le.group === oe
|
|
1485
1468
|
);
|
|
1486
1469
|
break;
|
|
1487
1470
|
}
|
|
1488
1471
|
}
|
|
1489
1472
|
return {
|
|
1490
|
-
flexGrow:
|
|
1491
|
-
pointerEvents:
|
|
1473
|
+
flexGrow: K.layout[L] ?? 1,
|
|
1474
|
+
pointerEvents: X ? "none" : void 0
|
|
1492
1475
|
};
|
|
1493
1476
|
}
|
|
1494
1477
|
}
|
|
@@ -1525,17 +1508,17 @@ function Tt({
|
|
|
1525
1508
|
}
|
|
1526
1509
|
}),
|
|
1527
1510
|
[P, g, S, c]
|
|
1528
|
-
),
|
|
1511
|
+
), j = It({
|
|
1529
1512
|
defaultLayout: n,
|
|
1530
1513
|
disableCursor: o
|
|
1531
|
-
}),
|
|
1532
|
-
return
|
|
1514
|
+
}), O = G(null);
|
|
1515
|
+
return H(() => {
|
|
1533
1516
|
const b = v.current;
|
|
1534
1517
|
if (b === null)
|
|
1535
1518
|
return;
|
|
1536
1519
|
const L = w.current, k = {
|
|
1537
|
-
defaultLayout:
|
|
1538
|
-
disableCursor: !!
|
|
1520
|
+
defaultLayout: j.defaultLayout,
|
|
1521
|
+
disableCursor: !!j.disableCursor,
|
|
1539
1522
|
disabled: !!i,
|
|
1540
1523
|
element: b,
|
|
1541
1524
|
id: g,
|
|
@@ -1546,30 +1529,30 @@ function Tt({
|
|
|
1546
1529
|
resizeTargetMinimumSize: L.resizeTargetMinimumSize,
|
|
1547
1530
|
separators: L.separators
|
|
1548
1531
|
};
|
|
1549
|
-
|
|
1550
|
-
const ne = Gt(k),
|
|
1551
|
-
if (
|
|
1552
|
-
const { defaultLayoutDeferred:
|
|
1553
|
-
!
|
|
1532
|
+
O.current = k;
|
|
1533
|
+
const ne = Gt(k), K = E().mountedGroups.get(k);
|
|
1534
|
+
if (K) {
|
|
1535
|
+
const { defaultLayoutDeferred: q, derivedPanelConstraints: A, layout: V } = K;
|
|
1536
|
+
!q && A.length > 0 && (d(V), p(V), L.panels.forEach((ue) => {
|
|
1554
1537
|
ue.scheduleUpdate();
|
|
1555
1538
|
}));
|
|
1556
1539
|
}
|
|
1557
|
-
let
|
|
1558
|
-
const le =
|
|
1540
|
+
let X = !1;
|
|
1541
|
+
const le = N.addListener(
|
|
1559
1542
|
"interactionStateChange",
|
|
1560
|
-
(
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1563
|
-
|
|
1543
|
+
(q) => {
|
|
1544
|
+
const A = q.state === "active";
|
|
1545
|
+
X !== A && (X = A, L.panels.forEach((V) => {
|
|
1546
|
+
V.scheduleUpdate();
|
|
1564
1547
|
}));
|
|
1565
1548
|
}
|
|
1566
|
-
), Qe =
|
|
1549
|
+
), Qe = N.addListener(
|
|
1567
1550
|
"mountedGroupsChange",
|
|
1568
|
-
(
|
|
1569
|
-
const
|
|
1570
|
-
if (
|
|
1571
|
-
const { defaultLayoutDeferred:
|
|
1572
|
-
if (
|
|
1551
|
+
(q) => {
|
|
1552
|
+
const A = q.get(k);
|
|
1553
|
+
if (A) {
|
|
1554
|
+
const { defaultLayoutDeferred: V, derivedPanelConstraints: ue, layout: Se } = A;
|
|
1555
|
+
if (V || ue.length === 0)
|
|
1573
1556
|
return;
|
|
1574
1557
|
const { interactionState: et } = E(), tt = et.state !== "active";
|
|
1575
1558
|
d(Se), tt && p(Se), L.panels.forEach((nt) => {
|
|
@@ -1579,7 +1562,7 @@ function Tt({
|
|
|
1579
1562
|
}
|
|
1580
1563
|
);
|
|
1581
1564
|
return () => {
|
|
1582
|
-
|
|
1565
|
+
O.current = null, ne(), le(), Qe();
|
|
1583
1566
|
};
|
|
1584
1567
|
}, [
|
|
1585
1568
|
i,
|
|
@@ -1588,11 +1571,11 @@ function Tt({
|
|
|
1588
1571
|
d,
|
|
1589
1572
|
c,
|
|
1590
1573
|
x,
|
|
1591
|
-
|
|
1574
|
+
j
|
|
1592
1575
|
]), Ae(() => {
|
|
1593
|
-
const b =
|
|
1576
|
+
const b = O.current;
|
|
1594
1577
|
b && (b.defaultLayout = n, b.disableCursor = !!o);
|
|
1595
|
-
}), /* @__PURE__ */
|
|
1578
|
+
}), /* @__PURE__ */ J(Je.Provider, { value: T, children: /* @__PURE__ */ J(
|
|
1596
1579
|
"div",
|
|
1597
1580
|
{
|
|
1598
1581
|
...h,
|
|
@@ -1631,14 +1614,14 @@ function Vt({
|
|
|
1631
1614
|
), a = Ne(
|
|
1632
1615
|
() => s ? JSON.parse(s) : void 0,
|
|
1633
1616
|
[s]
|
|
1634
|
-
), u = G(null), c =
|
|
1617
|
+
), u = G(null), c = Y(() => {
|
|
1635
1618
|
const h = u.current;
|
|
1636
1619
|
h && (u.current = null, clearTimeout(h));
|
|
1637
1620
|
}, []);
|
|
1638
1621
|
Oe(() => () => {
|
|
1639
1622
|
c();
|
|
1640
1623
|
}, [c]);
|
|
1641
|
-
const m =
|
|
1624
|
+
const m = Y(
|
|
1642
1625
|
(h) => {
|
|
1643
1626
|
c();
|
|
1644
1627
|
let f;
|
|
@@ -1650,7 +1633,7 @@ function Vt({
|
|
|
1650
1633
|
}
|
|
1651
1634
|
},
|
|
1652
1635
|
[c, i, r, n]
|
|
1653
|
-
), y =
|
|
1636
|
+
), y = Y(
|
|
1654
1637
|
(h) => {
|
|
1655
1638
|
c(), e === 0 ? m(h) : u.current = setTimeout(() => {
|
|
1656
1639
|
m(h);
|
|
@@ -1680,7 +1663,7 @@ function Ot() {
|
|
|
1680
1663
|
};
|
|
1681
1664
|
}
|
|
1682
1665
|
function Ut() {
|
|
1683
|
-
return
|
|
1666
|
+
return Q(null);
|
|
1684
1667
|
}
|
|
1685
1668
|
function Wt() {
|
|
1686
1669
|
return G(null);
|
|
@@ -1703,7 +1686,7 @@ function At(e, t) {
|
|
|
1703
1686
|
isCollapsed: () => !1,
|
|
1704
1687
|
resize: ce
|
|
1705
1688
|
});
|
|
1706
|
-
_e(t, () => o.current, []),
|
|
1689
|
+
_e(t, () => o.current, []), H(() => {
|
|
1707
1690
|
Object.assign(
|
|
1708
1691
|
o.current,
|
|
1709
1692
|
Ve({ groupId: n, panelId: e })
|
|
@@ -1725,12 +1708,12 @@ function _t({
|
|
|
1725
1708
|
style: m,
|
|
1726
1709
|
...y
|
|
1727
1710
|
}) {
|
|
1728
|
-
const h = !!l, f = me(l), d = G(null), p = ge(d, r), [, g] = Ze(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C =
|
|
1729
|
-
(T,
|
|
1730
|
-
u?.(T, l,
|
|
1711
|
+
const h = !!l, f = me(l), d = G(null), p = ge(d, r), [, g] = Ze(), { getPanelStyles: v, id: x, registerPanel: S } = ye(), w = u !== null, C = Z(
|
|
1712
|
+
(T, j, O) => {
|
|
1713
|
+
u?.(T, l, O);
|
|
1731
1714
|
}
|
|
1732
1715
|
);
|
|
1733
|
-
|
|
1716
|
+
H(() => {
|
|
1734
1717
|
const T = d.current;
|
|
1735
1718
|
if (T !== null)
|
|
1736
1719
|
return S({
|
|
@@ -1765,7 +1748,7 @@ function _t({
|
|
|
1765
1748
|
S
|
|
1766
1749
|
]), At(f, c);
|
|
1767
1750
|
const P = v(x, f);
|
|
1768
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ J(
|
|
1769
1752
|
"div",
|
|
1770
1753
|
{
|
|
1771
1754
|
...y,
|
|
@@ -1782,7 +1765,7 @@ function _t({
|
|
|
1782
1765
|
overflow: "hidden",
|
|
1783
1766
|
...P
|
|
1784
1767
|
},
|
|
1785
|
-
children: /* @__PURE__ */
|
|
1768
|
+
children: /* @__PURE__ */ J(
|
|
1786
1769
|
"div",
|
|
1787
1770
|
{
|
|
1788
1771
|
className: t,
|
|
@@ -1812,7 +1795,7 @@ const Nt = {
|
|
|
1812
1795
|
margin: 0
|
|
1813
1796
|
};
|
|
1814
1797
|
function Bt() {
|
|
1815
|
-
return
|
|
1798
|
+
return Q(null);
|
|
1816
1799
|
}
|
|
1817
1800
|
function Kt() {
|
|
1818
1801
|
return G(null);
|
|
@@ -1829,7 +1812,7 @@ function Ft({
|
|
|
1829
1812
|
);
|
|
1830
1813
|
if (s) {
|
|
1831
1814
|
const a = s.maxSize, u = s.collapsible ? s.collapsedSize : s.minSize, c = [o, o + 1];
|
|
1832
|
-
r =
|
|
1815
|
+
r = $({
|
|
1833
1816
|
layout: te({
|
|
1834
1817
|
delta: u - l,
|
|
1835
1818
|
initialLayout: e,
|
|
@@ -1838,7 +1821,7 @@ function Ft({
|
|
|
1838
1821
|
prevLayout: e
|
|
1839
1822
|
}),
|
|
1840
1823
|
panelConstraints: t
|
|
1841
|
-
})[n], i =
|
|
1824
|
+
})[n], i = $({
|
|
1842
1825
|
layout: te({
|
|
1843
1826
|
delta: a - l,
|
|
1844
1827
|
initialLayout: e,
|
|
@@ -1864,18 +1847,18 @@ function $t({
|
|
|
1864
1847
|
style: i,
|
|
1865
1848
|
...r
|
|
1866
1849
|
}) {
|
|
1867
|
-
const l = me(o), [s, a] =
|
|
1850
|
+
const l = me(o), [s, a] = Q({}), [u, c] = Q("inactive"), m = G(null), y = ge(m, n), {
|
|
1868
1851
|
id: h,
|
|
1869
1852
|
orientation: f,
|
|
1870
1853
|
registerSeparator: d
|
|
1871
1854
|
} = ye(), p = f === "horizontal" ? "vertical" : "horizontal";
|
|
1872
|
-
return
|
|
1855
|
+
return H(() => {
|
|
1873
1856
|
const g = m.current;
|
|
1874
1857
|
if (g !== null) {
|
|
1875
1858
|
const v = {
|
|
1876
1859
|
element: g,
|
|
1877
1860
|
id: l
|
|
1878
|
-
}, x = d(v), S =
|
|
1861
|
+
}, x = d(v), S = N.addListener(
|
|
1879
1862
|
"interactionStateChange",
|
|
1880
1863
|
(C) => {
|
|
1881
1864
|
c(
|
|
@@ -1884,15 +1867,15 @@ function $t({
|
|
|
1884
1867
|
) ? C.state : "inactive"
|
|
1885
1868
|
);
|
|
1886
1869
|
}
|
|
1887
|
-
), w =
|
|
1870
|
+
), w = N.addListener(
|
|
1888
1871
|
"mountedGroupsChange",
|
|
1889
1872
|
(C) => {
|
|
1890
1873
|
C.forEach(
|
|
1891
|
-
({ derivedPanelConstraints: P, layout: T, separatorToPanels:
|
|
1892
|
-
if (
|
|
1893
|
-
const b =
|
|
1874
|
+
({ derivedPanelConstraints: P, layout: T, separatorToPanels: j }, O) => {
|
|
1875
|
+
if (O.id === h) {
|
|
1876
|
+
const b = j.get(v);
|
|
1894
1877
|
if (b) {
|
|
1895
|
-
const L = b[0], k =
|
|
1878
|
+
const L = b[0], k = O.panels.indexOf(L);
|
|
1896
1879
|
a(
|
|
1897
1880
|
Ft({
|
|
1898
1881
|
layout: T,
|
|
@@ -1911,7 +1894,7 @@ function $t({
|
|
|
1911
1894
|
S(), w(), x();
|
|
1912
1895
|
};
|
|
1913
1896
|
}
|
|
1914
|
-
}, [h, l, d]), /* @__PURE__ */
|
|
1897
|
+
}, [h, l, d]), /* @__PURE__ */ J(
|
|
1915
1898
|
"div",
|
|
1916
1899
|
{
|
|
1917
1900
|
...r,
|