react-resizable-panels 4.0.12 → 4.0.13
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.
|
@@ -323,21 +323,28 @@ export declare type SeparatorProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
323
323
|
|
|
324
324
|
export declare type SizeUnit = "px" | "%" | "em" | "rem" | "vh" | "vw";
|
|
325
325
|
|
|
326
|
-
export declare function useDefaultLayout({ debounceSaveMs,
|
|
326
|
+
export declare function useDefaultLayout({ debounceSaveMs, storage, ...rest }: {
|
|
327
327
|
/**
|
|
328
328
|
* Debounce save operation by the specified number of milliseconds; defaults to 100ms
|
|
329
329
|
*/
|
|
330
330
|
debounceSaveMs?: number;
|
|
331
|
+
/**
|
|
332
|
+
* Storage implementation; supports localStorage, sessionStorage, and custom implementations
|
|
333
|
+
* Refer to documentation site for example integrations.
|
|
334
|
+
*/
|
|
335
|
+
storage: LayoutStorage;
|
|
336
|
+
} & ({
|
|
331
337
|
/**
|
|
332
338
|
* Group id; must be unique in order for layouts to be saved separately.
|
|
339
|
+
* @deprecated Use the {@link id} param instead
|
|
333
340
|
*/
|
|
334
341
|
groupId: string;
|
|
342
|
+
} | {
|
|
335
343
|
/**
|
|
336
|
-
*
|
|
337
|
-
* Refer to documentation site for example integrations.
|
|
344
|
+
* Unique layout identifier.
|
|
338
345
|
*/
|
|
339
|
-
|
|
340
|
-
}): {
|
|
346
|
+
id: string;
|
|
347
|
+
})): {
|
|
341
348
|
defaultLayout: Layout | undefined;
|
|
342
349
|
onLayoutChange: (layout: Layout) => void | undefined;
|
|
343
350
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as K } from "react/jsx-runtime";
|
|
3
|
-
import { useId as Ve, useLayoutEffect as Ke, useEffect as Re, useRef as O, useCallback as Xe, createContext as Ye, useImperativeHandle as Ee, useState as
|
|
3
|
+
import { useId as Ve, useLayoutEffect as Ke, useEffect as Re, useRef as O, useCallback as Xe, createContext as Ye, useImperativeHandle as Ee, useState as I, useMemo as se, useSyncExternalStore as qe, useContext as Ze } from "react";
|
|
4
4
|
function z(e, t = "Assertion error") {
|
|
5
5
|
if (!e)
|
|
6
6
|
throw Error(t);
|
|
@@ -52,7 +52,7 @@ function et({
|
|
|
52
52
|
}
|
|
53
53
|
return z(r, "No rect found"), r;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Ie(e) {
|
|
56
56
|
const { element: t, orientation: n, panels: o, separators: r } = e, a = ae(
|
|
57
57
|
n,
|
|
58
58
|
Array.from(t.children).filter((c) => c instanceof HTMLElement).map((c) => ({ element: c }))
|
|
@@ -73,12 +73,12 @@ function ke(e) {
|
|
|
73
73
|
m.bottom,
|
|
74
74
|
m.width,
|
|
75
75
|
0
|
|
76
|
-
),
|
|
76
|
+
), g = n === "horizontal" ? new DOMRect(p.left, p.top, 0, p.height) : new DOMRect(p.left, p.top, p.width, 0);
|
|
77
77
|
switch (u.length) {
|
|
78
78
|
case 0: {
|
|
79
79
|
f = [
|
|
80
80
|
d,
|
|
81
|
-
|
|
81
|
+
g
|
|
82
82
|
];
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
@@ -90,7 +90,7 @@ function ke(e) {
|
|
|
90
90
|
});
|
|
91
91
|
f = [
|
|
92
92
|
v,
|
|
93
|
-
S === m ?
|
|
93
|
+
S === m ? g : d
|
|
94
94
|
];
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
@@ -192,10 +192,10 @@ function te({
|
|
|
192
192
|
}
|
|
193
193
|
return o;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function k(e) {
|
|
196
196
|
return parseFloat(e.toFixed(3));
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function ge(e) {
|
|
199
199
|
const { panels: t } = e, n = B({ group: e });
|
|
200
200
|
return n === 0 ? t.map((o) => ({
|
|
201
201
|
collapsedSize: 0,
|
|
@@ -213,7 +213,7 @@ function ye(e) {
|
|
|
213
213
|
panelElement: r,
|
|
214
214
|
styleProp: a.collapsedSize
|
|
215
215
|
});
|
|
216
|
-
l =
|
|
216
|
+
l = k(c / n * 100);
|
|
217
217
|
}
|
|
218
218
|
let i;
|
|
219
219
|
if (a.defaultSize) {
|
|
@@ -222,7 +222,7 @@ function ye(e) {
|
|
|
222
222
|
panelElement: r,
|
|
223
223
|
styleProp: a.defaultSize
|
|
224
224
|
});
|
|
225
|
-
i =
|
|
225
|
+
i = k(c / n * 100);
|
|
226
226
|
}
|
|
227
227
|
let s = 0;
|
|
228
228
|
if (a.minSize) {
|
|
@@ -231,7 +231,7 @@ function ye(e) {
|
|
|
231
231
|
panelElement: r,
|
|
232
232
|
styleProp: a.minSize
|
|
233
233
|
});
|
|
234
|
-
s =
|
|
234
|
+
s = k(c / n * 100);
|
|
235
235
|
}
|
|
236
236
|
let u = 100;
|
|
237
237
|
if (a.maxSize) {
|
|
@@ -240,7 +240,7 @@ function ye(e) {
|
|
|
240
240
|
panelElement: r,
|
|
241
241
|
styleProp: a.maxSize
|
|
242
242
|
});
|
|
243
|
-
u =
|
|
243
|
+
u = k(c / n * 100);
|
|
244
244
|
}
|
|
245
245
|
return {
|
|
246
246
|
collapsedSize: l,
|
|
@@ -292,7 +292,7 @@ class st {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
function P(e, t, n = 0) {
|
|
295
|
-
return Math.abs(
|
|
295
|
+
return Math.abs(k(e) - k(t)) <= n;
|
|
296
296
|
}
|
|
297
297
|
let R = {
|
|
298
298
|
cursorFlags: 0,
|
|
@@ -332,7 +332,7 @@ function E(e) {
|
|
|
332
332
|
}), _.emit("mountedGroupsChange", R.mountedGroups)), R;
|
|
333
333
|
}
|
|
334
334
|
const at = (e) => e, ie = () => {
|
|
335
|
-
},
|
|
335
|
+
}, ke = 1, Ge = 2, De = 4, Oe = 8, ye = {
|
|
336
336
|
coarse: 10,
|
|
337
337
|
precise: 5
|
|
338
338
|
};
|
|
@@ -363,7 +363,7 @@ function lt({
|
|
|
363
363
|
return null;
|
|
364
364
|
switch (n) {
|
|
365
365
|
case "active": {
|
|
366
|
-
const a = (e &
|
|
366
|
+
const a = (e & ke) !== 0, l = (e & Ge) !== 0, i = (e & De) !== 0, s = (e & Oe) !== 0;
|
|
367
367
|
if (e) {
|
|
368
368
|
if (a)
|
|
369
369
|
return i ? "se-resize" : s ? "ne-resize" : "e-resize";
|
|
@@ -429,7 +429,7 @@ function W({
|
|
|
429
429
|
X(t, l) < 0 ? t = n : t = a;
|
|
430
430
|
} else
|
|
431
431
|
t = a;
|
|
432
|
-
return t = Math.min(r, t), t =
|
|
432
|
+
return t = Math.min(r, t), t = k(t), t;
|
|
433
433
|
}
|
|
434
434
|
function Y({
|
|
435
435
|
delta: e,
|
|
@@ -452,7 +452,7 @@ function Y({
|
|
|
452
452
|
`Panel constraints not found for index ${f}`
|
|
453
453
|
);
|
|
454
454
|
const {
|
|
455
|
-
collapsedSize:
|
|
455
|
+
collapsedSize: g = 0,
|
|
456
456
|
collapsible: v,
|
|
457
457
|
minSize: S = 0
|
|
458
458
|
} = d;
|
|
@@ -461,9 +461,9 @@ function Y({
|
|
|
461
461
|
if (z(
|
|
462
462
|
x != null,
|
|
463
463
|
`Previous layout not found for panel index ${f}`
|
|
464
|
-
), P(x,
|
|
465
|
-
const
|
|
466
|
-
X(
|
|
464
|
+
), P(x, g)) {
|
|
465
|
+
const y = S - x;
|
|
466
|
+
X(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
}
|
|
@@ -474,7 +474,7 @@ function Y({
|
|
|
474
474
|
`No panel constraints found for index ${f}`
|
|
475
475
|
);
|
|
476
476
|
const {
|
|
477
|
-
collapsedSize:
|
|
477
|
+
collapsedSize: g = 0,
|
|
478
478
|
collapsible: v,
|
|
479
479
|
minSize: S = 0
|
|
480
480
|
} = d;
|
|
@@ -484,40 +484,40 @@ function Y({
|
|
|
484
484
|
x != null,
|
|
485
485
|
`Previous layout not found for panel index ${f}`
|
|
486
486
|
), P(x, S)) {
|
|
487
|
-
const
|
|
488
|
-
X(
|
|
487
|
+
const y = x - g;
|
|
488
|
+
X(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
{
|
|
494
494
|
const f = e < 0 ? 1 : -1;
|
|
495
|
-
let d = e < 0 ? c : u,
|
|
495
|
+
let d = e < 0 ? c : u, g = 0;
|
|
496
496
|
for (; ; ) {
|
|
497
497
|
const S = l[d];
|
|
498
498
|
z(
|
|
499
499
|
S != null,
|
|
500
500
|
`Previous layout not found for panel index ${d}`
|
|
501
501
|
);
|
|
502
|
-
const
|
|
502
|
+
const y = W({
|
|
503
503
|
panelConstraints: n[d],
|
|
504
504
|
size: 100
|
|
505
505
|
}) - S;
|
|
506
|
-
if (
|
|
506
|
+
if (g += y, d += f, d < 0 || d >= n.length)
|
|
507
507
|
break;
|
|
508
508
|
}
|
|
509
|
-
const v = Math.min(Math.abs(e), Math.abs(
|
|
509
|
+
const v = Math.min(Math.abs(e), Math.abs(g));
|
|
510
510
|
e = e < 0 ? 0 - v : v;
|
|
511
511
|
}
|
|
512
512
|
{
|
|
513
513
|
let d = e < 0 ? u : c;
|
|
514
514
|
for (; d >= 0 && d < n.length; ) {
|
|
515
|
-
const
|
|
515
|
+
const g = Math.abs(e) - Math.abs(h), v = l[d];
|
|
516
516
|
z(
|
|
517
517
|
v != null,
|
|
518
518
|
`Previous layout not found for panel index ${d}`
|
|
519
519
|
);
|
|
520
|
-
const S = v -
|
|
520
|
+
const S = v - g, x = W({
|
|
521
521
|
panelConstraints: n[d],
|
|
522
522
|
size: S
|
|
523
523
|
});
|
|
@@ -536,25 +536,25 @@ function Y({
|
|
|
536
536
|
d != null,
|
|
537
537
|
`Previous layout not found for panel index ${f}`
|
|
538
538
|
);
|
|
539
|
-
const
|
|
539
|
+
const g = d + h, v = W({
|
|
540
540
|
panelConstraints: n[f],
|
|
541
|
-
size:
|
|
541
|
+
size: g
|
|
542
542
|
});
|
|
543
|
-
if (s[f] = v, !P(v,
|
|
544
|
-
let S =
|
|
545
|
-
for (;
|
|
546
|
-
const b = s[
|
|
543
|
+
if (s[f] = v, !P(v, g)) {
|
|
544
|
+
let S = g - v, y = e < 0 ? c : u;
|
|
545
|
+
for (; y >= 0 && y < n.length; ) {
|
|
546
|
+
const b = s[y];
|
|
547
547
|
z(
|
|
548
548
|
b != null,
|
|
549
|
-
`Previous layout not found for panel index ${
|
|
549
|
+
`Previous layout not found for panel index ${y}`
|
|
550
550
|
);
|
|
551
551
|
const L = b + S, C = W({
|
|
552
|
-
panelConstraints: n[
|
|
552
|
+
panelConstraints: n[y],
|
|
553
553
|
size: L
|
|
554
554
|
});
|
|
555
|
-
if (P(b, C) || (S -= C - b, s[
|
|
555
|
+
if (P(b, C) || (S -= C - b, s[y] = C), P(S, 0))
|
|
556
556
|
break;
|
|
557
|
-
e > 0 ?
|
|
557
|
+
e > 0 ? y-- : y++;
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}
|
|
@@ -565,7 +565,7 @@ function Y({
|
|
|
565
565
|
if (!P(m, 100, 0.1))
|
|
566
566
|
return r;
|
|
567
567
|
const p = Object.keys(r);
|
|
568
|
-
return s.reduce((f, d,
|
|
568
|
+
return s.reduce((f, d, g) => (f[p[g]] = d, f), {});
|
|
569
569
|
}
|
|
570
570
|
function U(e, t) {
|
|
571
571
|
if (Object.keys(e).length !== Object.keys(t).length)
|
|
@@ -590,16 +590,16 @@ function Te({
|
|
|
590
590
|
r ? h === "horizontal" ? p = (e.clientX - r.x) / u * 100 : p = (e.clientY - r.y) / u * 100 : h === "horizontal" ? p = e.clientX < 0 ? -100 : 100 : p = e.clientY < 0 ? -100 : 100;
|
|
591
591
|
const f = n.get(s), {
|
|
592
592
|
defaultLayoutDeferred: d,
|
|
593
|
-
derivedPanelConstraints:
|
|
593
|
+
derivedPanelConstraints: g,
|
|
594
594
|
layout: v,
|
|
595
595
|
separatorToPanels: S
|
|
596
596
|
} = o.get(s) ?? { defaultLayoutDeferred: !1 };
|
|
597
|
-
if (
|
|
597
|
+
if (g && f && v && S) {
|
|
598
598
|
const x = Y({
|
|
599
599
|
delta: p,
|
|
600
600
|
initialLayout: f,
|
|
601
|
-
panelConstraints:
|
|
602
|
-
pivotIndices: i.panels.map((
|
|
601
|
+
panelConstraints: g,
|
|
602
|
+
pivotIndices: i.panels.map((y) => m.indexOf(y)),
|
|
603
603
|
prevLayout: v,
|
|
604
604
|
trigger: "mouse-or-touch"
|
|
605
605
|
});
|
|
@@ -607,7 +607,7 @@ function Te({
|
|
|
607
607
|
if (p !== 0 && !c)
|
|
608
608
|
switch (h) {
|
|
609
609
|
case "horizontal": {
|
|
610
|
-
a |= p < 0 ?
|
|
610
|
+
a |= p < 0 ? ke : Ge;
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
613
613
|
case "vertical": {
|
|
@@ -618,12 +618,12 @@ function Te({
|
|
|
618
618
|
} else {
|
|
619
619
|
l.set(i.group, {
|
|
620
620
|
defaultLayoutDeferred: d,
|
|
621
|
-
derivedPanelConstraints:
|
|
621
|
+
derivedPanelConstraints: g,
|
|
622
622
|
layout: x,
|
|
623
623
|
separatorToPanels: S
|
|
624
624
|
});
|
|
625
|
-
const
|
|
626
|
-
i.group.inMemoryLayouts[
|
|
625
|
+
const y = i.group.panels.map(({ id: b }) => b).join(",");
|
|
626
|
+
i.group.inMemoryLayouts[y] = x;
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
}), E({
|
|
@@ -920,10 +920,10 @@ function Ne(e) {
|
|
|
920
920
|
const { parentNode: t } = e;
|
|
921
921
|
return t && t instanceof ShadowRoot ? t.host : t;
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function gt(e, t) {
|
|
924
924
|
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function yt({
|
|
927
927
|
groupElement: e,
|
|
928
928
|
hitRegion: t,
|
|
929
929
|
pointerEventTarget: n
|
|
@@ -935,7 +935,7 @@ function gt({
|
|
|
935
935
|
for (; o; ) {
|
|
936
936
|
if (o.contains(e))
|
|
937
937
|
return !0;
|
|
938
|
-
if (
|
|
938
|
+
if (gt(o.getBoundingClientRect(), t))
|
|
939
939
|
return !1;
|
|
940
940
|
o = o.parentElement;
|
|
941
941
|
}
|
|
@@ -947,11 +947,11 @@ function $e(e, t) {
|
|
|
947
947
|
return t.forEach((o, r) => {
|
|
948
948
|
if (r.disabled)
|
|
949
949
|
return;
|
|
950
|
-
const a = ft() ?
|
|
950
|
+
const a = ft() ? ye.coarse : ye.precise, l = Ie(r), i = ct(r.orientation, l, {
|
|
951
951
|
x: e.clientX,
|
|
952
952
|
y: e.clientY
|
|
953
953
|
});
|
|
954
|
-
i && i.distance.x <= a && i.distance.y <= a &&
|
|
954
|
+
i && i.distance.x <= a && i.distance.y <= a && yt({
|
|
955
955
|
groupElement: r.element,
|
|
956
956
|
hitRegion: i.hitRegion.rect,
|
|
957
957
|
pointerEventTarget: e.target
|
|
@@ -1042,13 +1042,13 @@ function Ce(e) {
|
|
|
1042
1042
|
for (const a of e)
|
|
1043
1043
|
if (a.defaultSize !== void 0) {
|
|
1044
1044
|
t++;
|
|
1045
|
-
const l =
|
|
1045
|
+
const l = k(a.defaultSize);
|
|
1046
1046
|
n += l, o[a.panelId] = l;
|
|
1047
1047
|
} else
|
|
1048
1048
|
o[a.panelId] = void 0;
|
|
1049
1049
|
const r = e.length - t;
|
|
1050
1050
|
if (r !== 0) {
|
|
1051
|
-
const a =
|
|
1051
|
+
const a = k((100 - n) / r);
|
|
1052
1052
|
for (const l of e)
|
|
1053
1053
|
l.defaultSize === void 0 && (o[l.panelId] = a);
|
|
1054
1054
|
}
|
|
@@ -1064,7 +1064,7 @@ function vt(e, t, n) {
|
|
|
1064
1064
|
const a = B({ group: e });
|
|
1065
1065
|
r.onResize(
|
|
1066
1066
|
{
|
|
1067
|
-
asPercentage:
|
|
1067
|
+
asPercentage: k(
|
|
1068
1068
|
o.inlineSize / a * 100
|
|
1069
1069
|
),
|
|
1070
1070
|
inPixels: o.inlineSize
|
|
@@ -1084,25 +1084,25 @@ function xt(e) {
|
|
|
1084
1084
|
let t = !0;
|
|
1085
1085
|
const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((p) => {
|
|
1086
1086
|
for (const f of p) {
|
|
1087
|
-
const { borderBoxSize: d, target:
|
|
1088
|
-
if (
|
|
1087
|
+
const { borderBoxSize: d, target: g } = f;
|
|
1088
|
+
if (g === e.element) {
|
|
1089
1089
|
if (t) {
|
|
1090
1090
|
if (B({ group: e }) === 0)
|
|
1091
1091
|
return;
|
|
1092
1092
|
E((S) => {
|
|
1093
1093
|
const x = S.mountedGroups.get(e);
|
|
1094
1094
|
if (x) {
|
|
1095
|
-
const
|
|
1095
|
+
const y = ge(e), b = x.defaultLayoutDeferred ? Ce(y) : x.layout, L = A({
|
|
1096
1096
|
layout: b,
|
|
1097
|
-
panelConstraints:
|
|
1097
|
+
panelConstraints: y
|
|
1098
1098
|
});
|
|
1099
1099
|
return !x.defaultLayoutDeferred && U(b, L) && St(
|
|
1100
1100
|
x.derivedPanelConstraints,
|
|
1101
|
-
|
|
1101
|
+
y
|
|
1102
1102
|
) ? S : {
|
|
1103
1103
|
mountedGroups: new Map(S.mountedGroups).set(e, {
|
|
1104
1104
|
defaultLayoutDeferred: !1,
|
|
1105
|
-
derivedPanelConstraints:
|
|
1105
|
+
derivedPanelConstraints: y,
|
|
1106
1106
|
layout: L,
|
|
1107
1107
|
separatorToPanels: x.separatorToPanels
|
|
1108
1108
|
})
|
|
@@ -1112,7 +1112,7 @@ function xt(e) {
|
|
|
1112
1112
|
});
|
|
1113
1113
|
}
|
|
1114
1114
|
} else
|
|
1115
|
-
vt(e,
|
|
1115
|
+
vt(e, g, d);
|
|
1116
1116
|
}
|
|
1117
1117
|
});
|
|
1118
1118
|
r.observe(e.element), e.panels.forEach((p) => {
|
|
@@ -1121,13 +1121,13 @@ function xt(e) {
|
|
|
1121
1121
|
`Panel ids must be unique; id "${p.id}" was used more than once`
|
|
1122
1122
|
), n.add(p.id), p.onResize && r.observe(p.element);
|
|
1123
1123
|
});
|
|
1124
|
-
const a = B({ group: e }), l =
|
|
1124
|
+
const a = B({ group: e }), l = ge(e), i = e.panels.map(({ id: p }) => p).join(",");
|
|
1125
1125
|
let s = e.defaultLayout;
|
|
1126
1126
|
s && e.panels.length !== Object.keys(s).length && (s = void 0);
|
|
1127
1127
|
const u = e.inMemoryLayouts[i] ?? s ?? Ce(l), c = A({
|
|
1128
1128
|
layout: u,
|
|
1129
1129
|
panelConstraints: l
|
|
1130
|
-
}), h =
|
|
1130
|
+
}), h = Ie(e), m = E((p) => {
|
|
1131
1131
|
const f = /* @__PURE__ */ new Map();
|
|
1132
1132
|
return h.forEach((d) => {
|
|
1133
1133
|
d.separator && f.set(d.separator, d.panels);
|
|
@@ -1148,8 +1148,8 @@ function xt(e) {
|
|
|
1148
1148
|
}), m.mountedGroups.size === 1 && (window.addEventListener("pointerdown", be), window.addEventListener("pointermove", Le), window.addEventListener("pointerup", Pe)), function() {
|
|
1149
1149
|
t = !1;
|
|
1150
1150
|
const f = E((d) => {
|
|
1151
|
-
const
|
|
1152
|
-
return
|
|
1151
|
+
const g = new Map(d.mountedGroups);
|
|
1152
|
+
return g.delete(e), { mountedGroups: g };
|
|
1153
1153
|
});
|
|
1154
1154
|
e.element.removeEventListener("pointerleave", ve), e.separators.forEach((d) => {
|
|
1155
1155
|
d.element.removeEventListener("keydown", Se);
|
|
@@ -1225,7 +1225,7 @@ function Gt({
|
|
|
1225
1225
|
}) {
|
|
1226
1226
|
const m = O({}), p = ce((w) => {
|
|
1227
1227
|
U(m.current, w) || (m.current = w, s?.(w));
|
|
1228
|
-
}), f = ue(i), [d,
|
|
1228
|
+
}), f = ue(i), [d, g] = I(!1), [v, S] = I(null), [x, y] = I(n ?? {}), [b, L] = I([]), [C, q] = I([]), Z = O({
|
|
1229
1229
|
lastExpandedPanelSizes: {},
|
|
1230
1230
|
layouts: {}
|
|
1231
1231
|
}), J = fe(S, a);
|
|
@@ -1269,14 +1269,14 @@ function Gt({
|
|
|
1269
1269
|
const M = xt(w), he = D().mountedGroups.get(w);
|
|
1270
1270
|
if (he) {
|
|
1271
1271
|
const { defaultLayoutDeferred: H, derivedPanelConstraints: j, layout: ee } = he;
|
|
1272
|
-
!H && j.length > 0 && (
|
|
1272
|
+
!H && j.length > 0 && (y(ee), p?.(ee));
|
|
1273
1273
|
}
|
|
1274
1274
|
const We = _.addListener(
|
|
1275
1275
|
"interactionStateChange",
|
|
1276
1276
|
(H) => {
|
|
1277
1277
|
switch (H.state) {
|
|
1278
1278
|
case "active": {
|
|
1279
|
-
|
|
1279
|
+
g(
|
|
1280
1280
|
H.hitRegions.some(
|
|
1281
1281
|
(j) => j.group === w
|
|
1282
1282
|
)
|
|
@@ -1284,7 +1284,7 @@ function Gt({
|
|
|
1284
1284
|
break;
|
|
1285
1285
|
}
|
|
1286
1286
|
default: {
|
|
1287
|
-
|
|
1287
|
+
g(!1);
|
|
1288
1288
|
break;
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
@@ -1297,7 +1297,7 @@ function Gt({
|
|
|
1297
1297
|
const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ue, layout: me } = j;
|
|
1298
1298
|
if (ee || Ue.length === 0)
|
|
1299
1299
|
return;
|
|
1300
|
-
|
|
1300
|
+
y(me), p?.(me);
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
1303
|
);
|
|
@@ -1358,29 +1358,29 @@ function Lt(e) {
|
|
|
1358
1358
|
}
|
|
1359
1359
|
function Dt({
|
|
1360
1360
|
debounceSaveMs: e = 100,
|
|
1361
|
-
|
|
1362
|
-
|
|
1361
|
+
storage: t,
|
|
1362
|
+
...n
|
|
1363
1363
|
}) {
|
|
1364
|
-
const o = Lt(
|
|
1364
|
+
const o = "id" in n ? n.id : n.groupId, r = Lt(o), a = qe(
|
|
1365
1365
|
Pt,
|
|
1366
|
-
() =>
|
|
1367
|
-
() =>
|
|
1368
|
-
),
|
|
1369
|
-
() =>
|
|
1370
|
-
[
|
|
1371
|
-
),
|
|
1372
|
-
const
|
|
1366
|
+
() => t.getItem(r),
|
|
1367
|
+
() => t.getItem(r)
|
|
1368
|
+
), l = se(
|
|
1369
|
+
() => a ? JSON.parse(a) : void 0,
|
|
1370
|
+
[a]
|
|
1371
|
+
), i = se(() => {
|
|
1372
|
+
const s = (u) => {
|
|
1373
1373
|
try {
|
|
1374
|
-
|
|
1375
|
-
} catch (
|
|
1376
|
-
console.error(
|
|
1374
|
+
t.setItem(r, JSON.stringify(u));
|
|
1375
|
+
} catch (c) {
|
|
1376
|
+
console.error(c);
|
|
1377
1377
|
}
|
|
1378
1378
|
};
|
|
1379
|
-
return e > 0 ? bt(
|
|
1380
|
-
}, [e,
|
|
1379
|
+
return e > 0 ? bt(s, e) : s;
|
|
1380
|
+
}, [e, t, r]);
|
|
1381
1381
|
return {
|
|
1382
|
-
defaultLayout:
|
|
1383
|
-
onLayoutChange:
|
|
1382
|
+
defaultLayout: l,
|
|
1383
|
+
onLayoutChange: i
|
|
1384
1384
|
};
|
|
1385
1385
|
}
|
|
1386
1386
|
function Pt() {
|
|
@@ -1388,7 +1388,7 @@ function Pt() {
|
|
|
1388
1388
|
};
|
|
1389
1389
|
}
|
|
1390
1390
|
function Ot() {
|
|
1391
|
-
return
|
|
1391
|
+
return I(null);
|
|
1392
1392
|
}
|
|
1393
1393
|
function Tt() {
|
|
1394
1394
|
return O(null);
|
|
@@ -1451,7 +1451,7 @@ function Ct({
|
|
|
1451
1451
|
group: h,
|
|
1452
1452
|
layout: m,
|
|
1453
1453
|
separatorToPanels: p
|
|
1454
|
-
} = n(), f = h.panels.findIndex((S) => S.id === t), d = f === h.panels.length - 1,
|
|
1454
|
+
} = n(), f = h.panels.findIndex((S) => S.id === t), d = f === h.panels.length - 1, g = Y({
|
|
1455
1455
|
delta: d ? s - i : i - s,
|
|
1456
1456
|
initialLayout: m,
|
|
1457
1457
|
panelConstraints: c,
|
|
@@ -1459,7 +1459,7 @@ function Ct({
|
|
|
1459
1459
|
prevLayout: m,
|
|
1460
1460
|
trigger: "imperative-api"
|
|
1461
1461
|
}), v = A({
|
|
1462
|
-
layout:
|
|
1462
|
+
layout: g,
|
|
1463
1463
|
panelConstraints: c
|
|
1464
1464
|
});
|
|
1465
1465
|
U(m, v) || E((S) => ({
|
|
@@ -1497,7 +1497,7 @@ function Ct({
|
|
|
1497
1497
|
switch (typeof i) {
|
|
1498
1498
|
case "number": {
|
|
1499
1499
|
const { group: c } = n(), h = B({ group: c });
|
|
1500
|
-
u =
|
|
1500
|
+
u = k(i / h * 100);
|
|
1501
1501
|
break;
|
|
1502
1502
|
}
|
|
1503
1503
|
case "string": {
|
|
@@ -1543,7 +1543,7 @@ function _t({
|
|
|
1543
1543
|
style: h,
|
|
1544
1544
|
...m
|
|
1545
1545
|
}) {
|
|
1546
|
-
const p = !!l, f = ue(l), [d,
|
|
1546
|
+
const p = !!l, f = ue(l), [d, g] = I(null), v = fe(g, a), { id: S, registerPanel: x } = de(), y = u !== null, b = ce((C) => {
|
|
1547
1547
|
u?.(C, l);
|
|
1548
1548
|
});
|
|
1549
1549
|
N(() => {
|
|
@@ -1552,7 +1552,7 @@ function _t({
|
|
|
1552
1552
|
element: d,
|
|
1553
1553
|
id: f,
|
|
1554
1554
|
idIsStable: p,
|
|
1555
|
-
onResize:
|
|
1555
|
+
onResize: y ? b : void 0,
|
|
1556
1556
|
panelConstraints: {
|
|
1557
1557
|
collapsedSize: n,
|
|
1558
1558
|
collapsible: o,
|
|
@@ -1566,7 +1566,7 @@ function _t({
|
|
|
1566
1566
|
o,
|
|
1567
1567
|
r,
|
|
1568
1568
|
d,
|
|
1569
|
-
|
|
1569
|
+
y,
|
|
1570
1570
|
f,
|
|
1571
1571
|
p,
|
|
1572
1572
|
i,
|
|
@@ -1626,7 +1626,7 @@ const Et = {
|
|
|
1626
1626
|
margin: "unset"
|
|
1627
1627
|
};
|
|
1628
1628
|
function At() {
|
|
1629
|
-
return
|
|
1629
|
+
return I(null);
|
|
1630
1630
|
}
|
|
1631
1631
|
function Nt() {
|
|
1632
1632
|
return O(null);
|
|
@@ -1680,17 +1680,17 @@ function $t({
|
|
|
1680
1680
|
style: r,
|
|
1681
1681
|
...a
|
|
1682
1682
|
}) {
|
|
1683
|
-
const l = ue(o), [i, s] =
|
|
1683
|
+
const l = ue(o), [i, s] = I({}), [u, c] = I("inactive"), [h, m] = I(null), p = fe(m, n), {
|
|
1684
1684
|
id: f,
|
|
1685
1685
|
orientation: d,
|
|
1686
|
-
registerSeparator:
|
|
1686
|
+
registerSeparator: g
|
|
1687
1687
|
} = de(), v = d === "horizontal" ? "vertical" : "horizontal";
|
|
1688
1688
|
return N(() => {
|
|
1689
1689
|
if (h !== null) {
|
|
1690
1690
|
const S = {
|
|
1691
1691
|
element: h,
|
|
1692
1692
|
id: l
|
|
1693
|
-
}, x =
|
|
1693
|
+
}, x = g(S), y = _.addListener(
|
|
1694
1694
|
"interactionStateChange",
|
|
1695
1695
|
(L) => {
|
|
1696
1696
|
c(
|
|
@@ -1723,10 +1723,10 @@ function $t({
|
|
|
1723
1723
|
}
|
|
1724
1724
|
);
|
|
1725
1725
|
return () => {
|
|
1726
|
-
|
|
1726
|
+
y(), b(), x();
|
|
1727
1727
|
};
|
|
1728
1728
|
}
|
|
1729
|
-
}, [h, f, l,
|
|
1729
|
+
}, [h, f, l, g]), /* @__PURE__ */ K(
|
|
1730
1730
|
"div",
|
|
1731
1731
|
{
|
|
1732
1732
|
...a,
|