react-resizable-panels 4.14.6 → 4.14.7
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.
|
@@ -293,12 +293,12 @@ function On({
|
|
|
293
293
|
const $ = M ? O(M) : void 0, C = k ? O(k) : void 0, I = $?.end ?? C.start, E = C?.start ?? $.end, q = Math.max(
|
|
294
294
|
$?.crossStart ?? -1 / 0,
|
|
295
295
|
C?.crossStart ?? -1 / 0
|
|
296
|
-
),
|
|
296
|
+
), K = Math.min(
|
|
297
297
|
$?.crossEnd ?? 1 / 0,
|
|
298
298
|
C?.crossEnd ?? 1 / 0
|
|
299
299
|
);
|
|
300
300
|
P = {
|
|
301
|
-
crossEnd: Math.max(q,
|
|
301
|
+
crossEnd: Math.max(q, K),
|
|
302
302
|
crossStart: q,
|
|
303
303
|
end: Math.max(I, E),
|
|
304
304
|
start: Math.min(I, E)
|
|
@@ -764,7 +764,7 @@ function Le({
|
|
|
764
764
|
}
|
|
765
765
|
return o;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function Z(e) {
|
|
768
768
|
return parseFloat(e.toFixed(3));
|
|
769
769
|
}
|
|
770
770
|
function ft(e) {
|
|
@@ -787,7 +787,7 @@ function ft(e) {
|
|
|
787
787
|
itemElement: r,
|
|
788
788
|
styleProp: i.collapsedSize
|
|
789
789
|
});
|
|
790
|
-
a =
|
|
790
|
+
a = Z(d / n * 100);
|
|
791
791
|
}
|
|
792
792
|
let c;
|
|
793
793
|
if (i.collapsedThreshold !== void 0) {
|
|
@@ -796,7 +796,7 @@ function ft(e) {
|
|
|
796
796
|
itemElement: r,
|
|
797
797
|
styleProp: i.collapsedThreshold
|
|
798
798
|
});
|
|
799
|
-
c =
|
|
799
|
+
c = Z(d / n * 100);
|
|
800
800
|
}
|
|
801
801
|
let s;
|
|
802
802
|
if (i.defaultSize !== void 0) {
|
|
@@ -805,7 +805,7 @@ function ft(e) {
|
|
|
805
805
|
itemElement: r,
|
|
806
806
|
styleProp: i.defaultSize
|
|
807
807
|
});
|
|
808
|
-
s =
|
|
808
|
+
s = Z(d / n * 100);
|
|
809
809
|
}
|
|
810
810
|
let u = 0;
|
|
811
811
|
if (i.minSize !== void 0) {
|
|
@@ -814,7 +814,7 @@ function ft(e) {
|
|
|
814
814
|
itemElement: r,
|
|
815
815
|
styleProp: i.minSize
|
|
816
816
|
});
|
|
817
|
-
u =
|
|
817
|
+
u = Z(d / n * 100);
|
|
818
818
|
}
|
|
819
819
|
let l = 100;
|
|
820
820
|
if (i.maxSize !== void 0) {
|
|
@@ -823,7 +823,7 @@ function ft(e) {
|
|
|
823
823
|
itemElement: r,
|
|
824
824
|
styleProp: i.maxSize
|
|
825
825
|
});
|
|
826
|
-
l =
|
|
826
|
+
l = Z(d / n * 100);
|
|
827
827
|
}
|
|
828
828
|
return {
|
|
829
829
|
groupResizeBehavior: i.groupResizeBehavior,
|
|
@@ -911,7 +911,7 @@ function Zn(e, t) {
|
|
|
911
911
|
return !0;
|
|
912
912
|
}
|
|
913
913
|
function W(e, t, n = 0) {
|
|
914
|
-
return Math.abs(
|
|
914
|
+
return Math.abs(Z(e) - Z(t)) <= n;
|
|
915
915
|
}
|
|
916
916
|
function ue(e, t) {
|
|
917
917
|
return W(e, t) ? 0 : e > t ? 1 : -1;
|
|
@@ -938,7 +938,7 @@ function Ee({
|
|
|
938
938
|
ue(o, r) <= 0 || p < 0 || i !== void 0 && d && p === 0 ? o = r : o = u;
|
|
939
939
|
} else
|
|
940
940
|
o = u;
|
|
941
|
-
return o = Math.min(s, o), o =
|
|
941
|
+
return o = Math.min(s, o), o = Z(o), o;
|
|
942
942
|
}
|
|
943
943
|
function qe({
|
|
944
944
|
delta: e,
|
|
@@ -1482,7 +1482,7 @@ function zt({
|
|
|
1482
1482
|
const g = u.slice(0, p).reduce((S, z) => S + l[z.id], 0);
|
|
1483
1483
|
return {
|
|
1484
1484
|
...l,
|
|
1485
|
-
[t]:
|
|
1485
|
+
[t]: Z(100 - g)
|
|
1486
1486
|
};
|
|
1487
1487
|
}
|
|
1488
1488
|
return qe({
|
|
@@ -1551,7 +1551,7 @@ function zt({
|
|
|
1551
1551
|
axisSize: d,
|
|
1552
1552
|
itemElement: l,
|
|
1553
1553
|
styleProp: s
|
|
1554
|
-
}), p =
|
|
1554
|
+
}), p = Z(h / d * 100);
|
|
1555
1555
|
c(p);
|
|
1556
1556
|
}
|
|
1557
1557
|
};
|
|
@@ -1949,13 +1949,13 @@ function fo(e) {
|
|
|
1949
1949
|
for (const i of e)
|
|
1950
1950
|
if (i.defaultSize !== void 0) {
|
|
1951
1951
|
t++;
|
|
1952
|
-
const a =
|
|
1952
|
+
const a = Z(i.defaultSize);
|
|
1953
1953
|
n += a, o[i.itemId] = a;
|
|
1954
1954
|
} else
|
|
1955
1955
|
o[i.itemId] = void 0;
|
|
1956
1956
|
const r = e.length - t;
|
|
1957
1957
|
if (r !== 0) {
|
|
1958
|
-
const i =
|
|
1958
|
+
const i = Z((100 - n) / r);
|
|
1959
1959
|
for (const a of e)
|
|
1960
1960
|
a.defaultSize === void 0 && (o[a.itemId] = i);
|
|
1961
1961
|
}
|
|
@@ -2001,7 +2001,7 @@ function po(e, t, n) {
|
|
|
2001
2001
|
if (!r || !r.onResize)
|
|
2002
2002
|
return;
|
|
2003
2003
|
const i = Pe({ axis: e }), a = e.orientation === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, c = r.mutableValues.prevSize, s = {
|
|
2004
|
-
asPercentage:
|
|
2004
|
+
asPercentage: Z(a / i * 100),
|
|
2005
2005
|
inPixels: a
|
|
2006
2006
|
};
|
|
2007
2007
|
r.mutableValues.prevSize = s, r.onResize(s, r.id, c);
|
|
@@ -2032,7 +2032,7 @@ function go({
|
|
|
2032
2032
|
switch (d.constraintProps.groupResizeBehavior) {
|
|
2033
2033
|
case "preserve-pixel-size": {
|
|
2034
2034
|
a = !0;
|
|
2035
|
-
const p = h / 100 * n, m =
|
|
2035
|
+
const p = h / 100 * n, m = Z(
|
|
2036
2036
|
p / t * 100
|
|
2037
2037
|
);
|
|
2038
2038
|
c.set(d.id, m), r += m;
|
|
@@ -2053,12 +2053,12 @@ function go({
|
|
|
2053
2053
|
}), i > 0)
|
|
2054
2054
|
for (const d of s) {
|
|
2055
2055
|
const h = o[d] ?? 0;
|
|
2056
|
-
l[d] =
|
|
2056
|
+
l[d] = Z(
|
|
2057
2057
|
h / i * u
|
|
2058
2058
|
);
|
|
2059
2059
|
}
|
|
2060
2060
|
else {
|
|
2061
|
-
const d =
|
|
2061
|
+
const d = Z(u / s.length);
|
|
2062
2062
|
for (const h of s)
|
|
2063
2063
|
l[h] = d;
|
|
2064
2064
|
}
|
|
@@ -2328,22 +2328,22 @@ function zn({
|
|
|
2328
2328
|
}
|
|
2329
2329
|
};
|
|
2330
2330
|
M.current = E;
|
|
2331
|
-
const q = p(E),
|
|
2332
|
-
(
|
|
2331
|
+
const q = p(E), K = gt(
|
|
2332
|
+
(J) => {
|
|
2333
2333
|
A(
|
|
2334
|
-
|
|
2334
|
+
J.next.state !== "inactive" && J.next.hitRegions.some(
|
|
2335
2335
|
(ae) => ae.separator === E || (d?.(ae) ?? !1)
|
|
2336
|
-
) ?
|
|
2336
|
+
) ? J.next.state : "inactive"
|
|
2337
2337
|
);
|
|
2338
2338
|
}
|
|
2339
2339
|
), X = Be(
|
|
2340
2340
|
t,
|
|
2341
|
-
(
|
|
2342
|
-
const { derivedItemConstraints: ae, layout: we, separatorToItems: ke } =
|
|
2341
|
+
(J) => {
|
|
2342
|
+
const { derivedItemConstraints: ae, layout: we, separatorToItems: ke } = J.next, ze = ke.get(E);
|
|
2343
2343
|
if (ze) {
|
|
2344
2344
|
const L = ze[0], T = ae.findIndex(
|
|
2345
2345
|
(G) => G.itemId === L.id
|
|
2346
|
-
), { layoutStrategy: F } =
|
|
2346
|
+
), { layoutStrategy: F } = J.axis;
|
|
2347
2347
|
R({
|
|
2348
2348
|
...yo({
|
|
2349
2349
|
layout: we,
|
|
@@ -2362,7 +2362,7 @@ function zn({
|
|
|
2362
2362
|
}
|
|
2363
2363
|
);
|
|
2364
2364
|
return () => {
|
|
2365
|
-
M.current = null,
|
|
2365
|
+
M.current = null, K(), X(), q();
|
|
2366
2366
|
};
|
|
2367
2367
|
}
|
|
2368
2368
|
}, [t, l, d, p, z]), ne(() => {
|
|
@@ -2593,7 +2593,7 @@ function So({
|
|
|
2593
2593
|
G.id === L && (G.disabled = T, G.disableDoubleClick = F);
|
|
2594
2594
|
},
|
|
2595
2595
|
[]
|
|
2596
|
-
), q = M.current.separators,
|
|
2596
|
+
), q = M.current.separators, K = Me(
|
|
2597
2597
|
() => ({
|
|
2598
2598
|
getDisableCursor: $,
|
|
2599
2599
|
getResizeAxisId: y,
|
|
@@ -2855,7 +2855,7 @@ function So({
|
|
|
2855
2855
|
}), L())
|
|
2856
2856
|
};
|
|
2857
2857
|
}, [g, y, f, S]);
|
|
2858
|
-
const
|
|
2858
|
+
const J = () => Ce.map((L) => {
|
|
2859
2859
|
const T = ce(y(L)), F = z(L);
|
|
2860
2860
|
return (T && !T.defaultLayoutDeferred ? F.map((_) => `minmax(0, ${T.layout[_.id] ?? 1}fr)`) : vo(
|
|
2861
2861
|
F,
|
|
@@ -2871,10 +2871,10 @@ function So({
|
|
|
2871
2871
|
[y]
|
|
2872
2872
|
), we = tt(
|
|
2873
2873
|
ae,
|
|
2874
|
-
|
|
2875
|
-
|
|
2874
|
+
J,
|
|
2875
|
+
J
|
|
2876
2876
|
), [ke, ze] = we.split("|");
|
|
2877
|
-
return /* @__PURE__ */ Y(sn.Provider, { value:
|
|
2877
|
+
return /* @__PURE__ */ Y(sn.Provider, { value: K, children: /* @__PURE__ */ Y(
|
|
2878
2878
|
"div",
|
|
2879
2879
|
{
|
|
2880
2880
|
...m,
|
|
@@ -3316,13 +3316,15 @@ function Mo({
|
|
|
3316
3316
|
};
|
|
3317
3317
|
},
|
|
3318
3318
|
updatePanelProps: (I, { disabled: E }) => {
|
|
3319
|
-
const
|
|
3319
|
+
const K = v.current.panels.find(
|
|
3320
3320
|
(ae) => ae.id === I
|
|
3321
3321
|
);
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3322
|
+
if (!K || K.constraintProps.disabled === E)
|
|
3323
|
+
return;
|
|
3324
|
+
K.constraintProps.disabled = E;
|
|
3325
|
+
const X = Re(S), J = ce(S);
|
|
3326
|
+
X && J && me(X, {
|
|
3327
|
+
...J,
|
|
3326
3328
|
derivedItemConstraints: ft(X)
|
|
3327
3329
|
});
|
|
3328
3330
|
},
|
|
@@ -3331,7 +3333,7 @@ function Mo({
|
|
|
3331
3333
|
disableDoubleClick: q
|
|
3332
3334
|
}) => {
|
|
3333
3335
|
const X = v.current.separators.find(
|
|
3334
|
-
(
|
|
3336
|
+
(J) => J.id === I
|
|
3335
3337
|
);
|
|
3336
3338
|
X && (X.disabled = E, X.disableDoubleClick = q);
|
|
3337
3339
|
}
|
|
@@ -3361,7 +3363,7 @@ function Mo({
|
|
|
3361
3363
|
T !== void 0 && (q[L.id] = T);
|
|
3362
3364
|
}
|
|
3363
3365
|
}
|
|
3364
|
-
const
|
|
3366
|
+
const K = {
|
|
3365
3367
|
disabled: !!r,
|
|
3366
3368
|
element: I,
|
|
3367
3369
|
id: S,
|
|
@@ -3379,14 +3381,14 @@ function Mo({
|
|
|
3379
3381
|
},
|
|
3380
3382
|
separators: E.separators
|
|
3381
3383
|
};
|
|
3382
|
-
C.current =
|
|
3383
|
-
const X = bn(
|
|
3384
|
-
defaultLayoutDeferred:
|
|
3384
|
+
C.current = K;
|
|
3385
|
+
const X = bn(K), {
|
|
3386
|
+
defaultLayoutDeferred: J,
|
|
3385
3387
|
derivedItemConstraints: ae,
|
|
3386
3388
|
layout: we,
|
|
3387
3389
|
requestedLayout: ke
|
|
3388
|
-
} = ce(
|
|
3389
|
-
if (!
|
|
3390
|
+
} = ce(K.id, !0);
|
|
3391
|
+
if (!J && ae.length > 0)
|
|
3390
3392
|
try {
|
|
3391
3393
|
try {
|
|
3392
3394
|
y(we);
|
|
@@ -3407,12 +3409,12 @@ function Mo({
|
|
|
3407
3409
|
return;
|
|
3408
3410
|
xn({
|
|
3409
3411
|
derivedItemConstraints: F,
|
|
3410
|
-
axis:
|
|
3412
|
+
axis: K,
|
|
3411
3413
|
layout: G,
|
|
3412
3414
|
prevLayout: L.prev?.layout,
|
|
3413
3415
|
requestedLayout: _
|
|
3414
3416
|
});
|
|
3415
|
-
const V = ie(), j = V.state !== "active" || !V.hitRegions.some((te) => te.axis ===
|
|
3417
|
+
const V = ie(), j = V.state !== "active" || !V.hitRegions.some((te) => te.axis === K);
|
|
3416
3418
|
try {
|
|
3417
3419
|
y(G);
|
|
3418
3420
|
} finally {
|