@univerjs/design 0.14.0 → 0.15.0
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.
- package/lib/cjs/index.js +6 -6
- package/lib/es/index.js +106 -96
- package/lib/index.js +106 -96
- package/lib/umd/index.js +6 -6
- package/package.json +8 -8
package/lib/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as p from "react";
|
|
2
|
-
import K, { useRef as ye, createElement as xt, forwardRef as Ue, useState as De, Children as wi, cloneElement as Ns, createContext as Rc, useMemo as lt, useContext as Jn, isValidElement as Ds, useCallback as dt, useEffect as
|
|
2
|
+
import K, { useRef as ye, createElement as xt, forwardRef as Ue, useState as De, Children as wi, cloneElement as Ns, createContext as Rc, useMemo as lt, useContext as Jn, isValidElement as Ds, useCallback as dt, useEffect as je, memo as Wi, useLayoutEffect as Bi, version as Fp, useImperativeHandle as Mc } from "react";
|
|
3
3
|
import { jsx as R, jsxs as me, Fragment as dr } from "react/jsx-runtime";
|
|
4
4
|
import * as Pc from "react-dom";
|
|
5
5
|
import rn, { createPortal as _o, unstable_batchedUpdates as Hp, flushSync as Ya } from "react-dom";
|
|
@@ -3075,7 +3075,7 @@ function Oo(...e) {
|
|
|
3075
3075
|
function gt(...e) {
|
|
3076
3076
|
return p.useCallback(Oo(...e), e);
|
|
3077
3077
|
}
|
|
3078
|
-
var jh = Symbol.for("react.lazy"), xi = p[" use ".trim().toString()];
|
|
3078
|
+
var jh = /* @__PURE__ */ Symbol.for("react.lazy"), xi = p[" use ".trim().toString()];
|
|
3079
3079
|
function Vh(e) {
|
|
3080
3080
|
return typeof e == "object" && e !== null && "then" in e;
|
|
3081
3081
|
}
|
|
@@ -3109,7 +3109,7 @@ function Uh(e) {
|
|
|
3109
3109
|
});
|
|
3110
3110
|
return t.displayName = `${e}.SlotClone`, t;
|
|
3111
3111
|
}
|
|
3112
|
-
var Gh = Symbol("radix.slottable");
|
|
3112
|
+
var Gh = /* @__PURE__ */ Symbol("radix.slottable");
|
|
3113
3113
|
function Kh(e) {
|
|
3114
3114
|
return p.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Gh;
|
|
3115
3115
|
}
|
|
@@ -4017,7 +4017,7 @@ function vm(e) {
|
|
|
4017
4017
|
});
|
|
4018
4018
|
return t.displayName = `${e}.SlotClone`, t;
|
|
4019
4019
|
}
|
|
4020
|
-
var pm = Symbol("radix.slottable");
|
|
4020
|
+
var pm = /* @__PURE__ */ Symbol("radix.slottable");
|
|
4021
4021
|
function hm(e) {
|
|
4022
4022
|
return p.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === pm;
|
|
4023
4023
|
}
|
|
@@ -4058,7 +4058,7 @@ var ym = [
|
|
|
4058
4058
|
], at = ym.reduce((e, t) => {
|
|
4059
4059
|
const n = /* @__PURE__ */ Lr(`Primitive.${t}`), r = p.forwardRef((o, i) => {
|
|
4060
4060
|
const { asChild: a, ...s } = o, l = a ? n : t;
|
|
4061
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ R(l, { ...s, ref: i });
|
|
4061
|
+
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ R(l, { ...s, ref: i });
|
|
4062
4062
|
});
|
|
4063
4063
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
4064
4064
|
}, {});
|
|
@@ -5075,7 +5075,7 @@ var Ng = p.forwardRef(
|
|
|
5075
5075
|
var l, c;
|
|
5076
5076
|
(l = e.onInteractOutside) == null || l.call(e, i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
5077
5077
|
const a = i.target;
|
|
5078
|
-
(
|
|
5078
|
+
(c = n.triggerRef.current) != null && c.contains(a) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
|
|
5079
5079
|
}
|
|
5080
5080
|
}
|
|
5081
5081
|
);
|
|
@@ -5291,7 +5291,7 @@ function zg(e = {}) {
|
|
|
5291
5291
|
y: Math.max(0, (v - 0) / 2)
|
|
5292
5292
|
};
|
|
5293
5293
|
}, []), { defaultPosition: n = t(), enabled: r = !1 } = e, [o, i] = De(n), [a, s] = De(!1), l = ye(null), c = ye({ x: 0, y: 0 }), f = ye({ x: 0, y: 0 }), u = ye(!1);
|
|
5294
|
-
|
|
5294
|
+
je(() => {
|
|
5295
5295
|
if (!l.current || u.current || e.defaultPosition) return;
|
|
5296
5296
|
const { width: d, height: v } = l.current.getBoundingClientRect(), { innerWidth: m, innerHeight: b } = window, C = Math.max(0, (m - d) / 2), x = Math.max(0, (b - v) / 2);
|
|
5297
5297
|
i({ x: C, y: x }), c.current = { x: C, y: x }, u.current = !0;
|
|
@@ -5311,7 +5311,7 @@ function zg(e = {}) {
|
|
|
5311
5311
|
}, [a, y]), w = dt(() => {
|
|
5312
5312
|
s(!1), document.body.style.userSelect = "";
|
|
5313
5313
|
}, []);
|
|
5314
|
-
return
|
|
5314
|
+
return je(() => {
|
|
5315
5315
|
if (r)
|
|
5316
5316
|
return document.addEventListener("mousemove", g), document.addEventListener("mouseup", w), () => {
|
|
5317
5317
|
document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", w);
|
|
@@ -5457,7 +5457,7 @@ const Si = (e, t, n) => {
|
|
|
5457
5457
|
};
|
|
5458
5458
|
function Fg({ hsv: e, onChange: t }) {
|
|
5459
5459
|
const [n, r] = De(""), o = lt(() => Ei(e[0], e[1], e[2]), [e]);
|
|
5460
|
-
|
|
5460
|
+
je(() => {
|
|
5461
5461
|
r(o.replace(/^#/, ""));
|
|
5462
5462
|
}, [o]);
|
|
5463
5463
|
const i = (l) => /^[0-9A-Fa-f]{6}$/.test(l), a = (l) => {
|
|
@@ -5492,7 +5492,7 @@ function Fg({ hsv: e, onChange: t }) {
|
|
|
5492
5492
|
}
|
|
5493
5493
|
function Hg({ hsv: e, onChange: t }) {
|
|
5494
5494
|
const [n, r] = De({ r: 0, g: 0, b: 0 });
|
|
5495
|
-
|
|
5495
|
+
je(() => {
|
|
5496
5496
|
const [a, s, l] = Si(e[0], e[1], e[2]);
|
|
5497
5497
|
r({
|
|
5498
5498
|
r: Math.round(a),
|
|
@@ -5607,7 +5607,7 @@ function jg({ hsv: e, onChange: t }) {
|
|
|
5607
5607
|
}
|
|
5608
5608
|
function Vg({ hsv: e, onChange: t, onChanged: n }) {
|
|
5609
5609
|
const r = ye(null), o = ye(null), [i, a] = De(!1);
|
|
5610
|
-
|
|
5610
|
+
je(() => {
|
|
5611
5611
|
const u = r.current;
|
|
5612
5612
|
if (!u) return;
|
|
5613
5613
|
const y = u.getContext("2d");
|
|
@@ -5629,7 +5629,7 @@ function Vg({ hsv: e, onChange: t, onChanged: n }) {
|
|
|
5629
5629
|
function c() {
|
|
5630
5630
|
n == null || n(e[0], e[1], e[2]);
|
|
5631
5631
|
}
|
|
5632
|
-
|
|
5632
|
+
je(() => {
|
|
5633
5633
|
var u;
|
|
5634
5634
|
return (u = o.current) == null || u.addEventListener("mouseup", c), window.addEventListener("pointerup", l), window.addEventListener("mouseup", l), () => {
|
|
5635
5635
|
var y;
|
|
@@ -5644,7 +5644,7 @@ function Vg({ hsv: e, onChange: t, onChanged: n }) {
|
|
|
5644
5644
|
transition: i ? "none" : "transform 0.1s ease-out"
|
|
5645
5645
|
};
|
|
5646
5646
|
};
|
|
5647
|
-
return
|
|
5647
|
+
return je(() => {
|
|
5648
5648
|
const u = () => {
|
|
5649
5649
|
a(!1);
|
|
5650
5650
|
};
|
|
@@ -5694,7 +5694,7 @@ function qg({ hsv: e, onChange: t, onChanged: n }) {
|
|
|
5694
5694
|
}, [r, l]), f = dt(() => {
|
|
5695
5695
|
o(!1), n == null || n(e[0], e[1], e[2]);
|
|
5696
5696
|
}, [e, n]);
|
|
5697
|
-
return
|
|
5697
|
+
return je(() => (r && (window.addEventListener("pointermove", c), window.addEventListener("pointerup", f), window.addEventListener("mouseup", f)), () => {
|
|
5698
5698
|
window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", f), window.removeEventListener("mouseup", f);
|
|
5699
5699
|
}), [r, c, f]), /* @__PURE__ */ R(
|
|
5700
5700
|
"div",
|
|
@@ -5743,7 +5743,7 @@ const Ug = Wi(Vg), Gg = Wi(qg), Kg = Wi(Wg), Yg = Wi(jg);
|
|
|
5743
5743
|
function bE({ format: e = "hex", value: t = "#000000", onChange: n }) {
|
|
5744
5744
|
if (!Is) return null;
|
|
5745
5745
|
const { locale: r } = Jn(Tn), [o, i] = De([0, 100, 100]), [a, s] = De(!1), l = dt((y, h, g) => Si(y, h, g), []);
|
|
5746
|
-
|
|
5746
|
+
je(() => {
|
|
5747
5747
|
try {
|
|
5748
5748
|
if (e === "hex") {
|
|
5749
5749
|
const [y, h, g] = t ? Ws(t) : o;
|
|
@@ -7548,7 +7548,7 @@ var wy = /* @__PURE__ */ Lr("PopoverContent.RemoveScroll"), xy = p.forwardRef(
|
|
|
7548
7548
|
var l, c;
|
|
7549
7549
|
(l = e.onInteractOutside) == null || l.call(e, i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
7550
7550
|
const a = i.target;
|
|
7551
|
-
(
|
|
7551
|
+
(c = n.triggerRef.current) != null && c.contains(a) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
|
|
7552
7552
|
}
|
|
7553
7553
|
}
|
|
7554
7554
|
);
|
|
@@ -8116,7 +8116,7 @@ function Gr() {
|
|
|
8116
8116
|
const be = O.x, we = O.y;
|
|
8117
8117
|
typeof F == "number" && (O.x = F), typeof G == "number" && (O.y = G), O.moved = !0;
|
|
8118
8118
|
let pe = U(D, oe);
|
|
8119
|
-
(oe === "vertical" && typeof G == "number" ? we >= G : oe === "horizontal" && typeof F == "number"
|
|
8119
|
+
(oe === "vertical" && typeof G == "number" ? we >= G : oe === "horizontal" && typeof F == "number" && be >= F) && (pe = pe.reverse());
|
|
8120
8120
|
const He = m(pe, O), Te = He.length > 0;
|
|
8121
8121
|
if (Te && ne)
|
|
8122
8122
|
return o(D);
|
|
@@ -11853,8 +11853,8 @@ var Il;
|
|
|
11853
11853
|
function Rb() {
|
|
11854
11854
|
if (Il) return Be;
|
|
11855
11855
|
Il = 1;
|
|
11856
|
-
var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), s = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g;
|
|
11857
|
-
g = Symbol.for("react.module.reference");
|
|
11856
|
+
var e = /* @__PURE__ */ Symbol.for("react.element"), t = /* @__PURE__ */ Symbol.for("react.portal"), n = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), o = /* @__PURE__ */ Symbol.for("react.profiler"), i = /* @__PURE__ */ Symbol.for("react.provider"), a = /* @__PURE__ */ Symbol.for("react.context"), s = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), c = /* @__PURE__ */ Symbol.for("react.suspense"), f = /* @__PURE__ */ Symbol.for("react.suspense_list"), u = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), h = /* @__PURE__ */ Symbol.for("react.offscreen"), g;
|
|
11857
|
+
g = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
11858
11858
|
function w(d) {
|
|
11859
11859
|
if (typeof d == "object" && d !== null) {
|
|
11860
11860
|
var v = d.$$typeof;
|
|
@@ -11926,7 +11926,7 @@ function Af(e, t, n) {
|
|
|
11926
11926
|
var r = p.useRef({});
|
|
11927
11927
|
return (!("value" in r.current) || n(r.current.condition, t)) && (r.current.value = e(), r.current.condition = t), r.current.value;
|
|
11928
11928
|
}
|
|
11929
|
-
var Pb = Symbol.for("react.element"), Nb = Symbol.for("react.transitional.element"), Db = Symbol.for("react.fragment");
|
|
11929
|
+
var Pb = /* @__PURE__ */ Symbol.for("react.element"), Nb = /* @__PURE__ */ Symbol.for("react.transitional.element"), Db = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
11930
11930
|
function Lf(e) {
|
|
11931
11931
|
return (
|
|
11932
11932
|
// Base object type
|
|
@@ -12597,7 +12597,7 @@ const h1 = (function(e) {
|
|
|
12597
12597
|
};
|
|
12598
12598
|
}, []), [r, n];
|
|
12599
12599
|
});
|
|
12600
|
-
var Jf = kn() ? Bi :
|
|
12600
|
+
var Jf = kn() ? Bi : je, ev = function(t) {
|
|
12601
12601
|
return +setTimeout(t, 16);
|
|
12602
12602
|
}, tv = function(t) {
|
|
12603
12603
|
return clearTimeout(t);
|
|
@@ -12738,18 +12738,18 @@ function x1(e, t, n, r) {
|
|
|
12738
12738
|
var te = D(pe);
|
|
12739
12739
|
pe && (e || te[nn]) ? (N(pe), Q()) : N(Kn), ee.current = t;
|
|
12740
12740
|
}
|
|
12741
|
-
}, [t]),
|
|
12741
|
+
}, [t]), je(function() {
|
|
12742
12742
|
// Cancel appear
|
|
12743
12743
|
(W === ai && !s || // Cancel enter
|
|
12744
12744
|
W === si && !i || // Cancel leave
|
|
12745
12745
|
W === ui && !c) && N(Kn);
|
|
12746
|
-
}, [s, i, c]),
|
|
12746
|
+
}, [s, i, c]), je(function() {
|
|
12747
12747
|
return function() {
|
|
12748
12748
|
Y.current = !1, clearTimeout(U.current);
|
|
12749
12749
|
};
|
|
12750
12750
|
}, []);
|
|
12751
12751
|
var ne = p.useRef(!1);
|
|
12752
|
-
|
|
12752
|
+
je(function() {
|
|
12753
12753
|
k && (ne.current = !0), k !== void 0 && W === Kn && ((ne.current || k) && (M == null || M(k)), ne.current = !0);
|
|
12754
12754
|
}, [k, W]);
|
|
12755
12755
|
var be = z;
|
|
@@ -13240,9 +13240,9 @@ function $1(e, t, n, r, o, i, a) {
|
|
|
13240
13240
|
var Ge = Mo(Math.round(F / parseFloat(P) * 1e3) / 1e3), ze = Mo(Math.round(O / parseFloat(k) * 1e3) / 1e3);
|
|
13241
13241
|
if (Ge === 0 || ze === 0 || Eo(n) && !iv(n))
|
|
13242
13242
|
return;
|
|
13243
|
-
var Ie = A.offset, Xe = A.targetOffset, Je = oc(V, Ie),
|
|
13243
|
+
var Ie = A.offset, Xe = A.targetOffset, Je = oc(V, Ie), Ve = ae(Je, 2), Ze = Ve[0], Ae = Ve[1], Fe = oc(B, Xe), Ke = ae(Fe, 2), vt = Ke[0], st = Ke[1];
|
|
13244
13244
|
B.x -= vt, B.y -= st;
|
|
13245
|
-
var pt = A.points || [], zt = ae(pt, 2), St = zt[0], Tt = zt[1], ot = ic(Tt), ce = ic(St), _e = Rr(B, ot), Re = Rr(V, ce), de = re({}, A), fe = _e.x - Re.x + Ze, ue = _e.y - Re.y + Ae, Pe = Gt(fe, ue), nt = Gt(fe, ue, te), et = Rr(B, ["t", "l"]),
|
|
13245
|
+
var pt = A.points || [], zt = ae(pt, 2), St = zt[0], Tt = zt[1], ot = ic(Tt), ce = ic(St), _e = Rr(B, ot), Re = Rr(V, ce), de = re({}, A), fe = _e.x - Re.x + Ze, ue = _e.y - Re.y + Ae, Pe = Gt(fe, ue), nt = Gt(fe, ue, te), et = Rr(B, ["t", "l"]), qe = Rr(V, ["t", "l"]), Xt = Rr(B, ["b", "r"]), yt = Rr(V, ["b", "r"]), It = A.overflow || {}, Zt = It.adjustX, An = It.adjustY, Ft = It.shiftX, Et = It.shiftY, Qt = function(Hn) {
|
|
13246
13246
|
return typeof Hn == "boolean" ? Hn : Hn >= 0;
|
|
13247
13247
|
}, Ht, Jt, At, cn;
|
|
13248
13248
|
Uo();
|
|
@@ -13257,7 +13257,7 @@ function $1(e, t, n, r, o, i, a) {
|
|
|
13257
13257
|
}
|
|
13258
13258
|
if (Pt && ce[0] === "b" && (Ht < Te.top || h.current.tb)) {
|
|
13259
13259
|
var Oe = ue;
|
|
13260
|
-
Sn ? Oe += O - G : Oe = Xt.y -
|
|
13260
|
+
Sn ? Oe += O - G : Oe = Xt.y - qe.y - Ae;
|
|
13261
13261
|
var Ye = Gt(fe, Oe), qt = Gt(fe, Oe, te);
|
|
13262
13262
|
// Of course use larger one
|
|
13263
13263
|
Ye > Pe || Ye === Pe && (!we || // Choose recommend one
|
|
@@ -13274,7 +13274,7 @@ function $1(e, t, n, r, o, i, a) {
|
|
|
13274
13274
|
}
|
|
13275
13275
|
if (Lt && ce[1] === "r" && (At < Te.left || h.current.lr)) {
|
|
13276
13276
|
var tn = fe;
|
|
13277
|
-
dn ? tn += F - Q : tn = Xt.x -
|
|
13277
|
+
dn ? tn += F - Q : tn = Xt.x - qe.x - Ze;
|
|
13278
13278
|
var yr = Gt(tn, ue), br = Gt(tn, ue, te);
|
|
13279
13279
|
// Of course use larger one
|
|
13280
13280
|
yr > Pe || yr === Pe && (!we || // Choose recommend one
|
|
@@ -13380,10 +13380,10 @@ function W1() {
|
|
|
13380
13380
|
};
|
|
13381
13381
|
}, [we]), te = s1(), He = p.useState(null), Te = ae(He, 2), Ee = Te[0], Ge = Te[1], ze = p.useRef(null), Ie = Ot(function(he) {
|
|
13382
13382
|
ze.current = he, Eo(he) && Ee !== he && Ge(he), we == null || we.registerSubPopup(te, he);
|
|
13383
|
-
}), Xe = p.useState(null), Je = ae(Xe, 2),
|
|
13384
|
-
Eo(he) &&
|
|
13383
|
+
}), Xe = p.useState(null), Je = ae(Xe, 2), Ve = Je[0], Ze = Je[1], Ae = p.useRef(null), Fe = Ot(function(he) {
|
|
13384
|
+
Eo(he) && Ve !== he && (Ze(he), Ae.current = he);
|
|
13385
13385
|
}), Ke = p.Children.only(a), vt = (Ke == null ? void 0 : Ke.props) || {}, st = {}, pt = Ot(function(he) {
|
|
13386
|
-
var Se, rt, bt =
|
|
13386
|
+
var Se, rt, bt = Ve;
|
|
13387
13387
|
return (bt == null ? void 0 : bt.contains(he)) || ((Se = cs(bt)) === null || Se === void 0 ? void 0 : Se.host) === he || he === bt || (Ee == null ? void 0 : Ee.contains(he)) || ((rt = cs(Ee)) === null || rt === void 0 ? void 0 : rt.host) === he || he === Ee || Object.values(be.current).some(function(ut) {
|
|
13388
13388
|
return (ut == null ? void 0 : ut.contains(he)) || he === ut;
|
|
13389
13389
|
});
|
|
@@ -13402,7 +13402,7 @@ function W1() {
|
|
|
13402
13402
|
de(he), ((Se = ue.current[ue.current.length - 1]) !== null && Se !== void 0 ? Se : Re) !== he && (ue.current.push(he), h == null || h(he));
|
|
13403
13403
|
}), nt = p.useRef(), et = function() {
|
|
13404
13404
|
clearTimeout(nt.current);
|
|
13405
|
-
},
|
|
13405
|
+
}, qe = function(Se) {
|
|
13406
13406
|
var rt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
13407
13407
|
et(), rt === 0 ? Pe(Se) : nt.current = setTimeout(function() {
|
|
13408
13408
|
Pe(Se);
|
|
@@ -13417,12 +13417,12 @@ function W1() {
|
|
|
13417
13417
|
}, [Re]);
|
|
13418
13418
|
var An = p.useState(null), Ft = ae(An, 2), Et = Ft[0], Qt = Ft[1], Ht = p.useState(null), Jt = ae(Ht, 2), At = Jt[0], cn = Jt[1], Pt = function(Se) {
|
|
13419
13419
|
cn([Se.clientX, Se.clientY]);
|
|
13420
|
-
}, Sn = $1(Re, Ee, Y && At !== null ? At :
|
|
13420
|
+
}, Sn = $1(Re, Ee, Y && At !== null ? At : Ve, I, N, L, V), le = ae(Sn, 11), ve = le[0], Me = le[1], Oe = le[2], Ye = le[3], qt = le[4], Lt = le[5], dn = le[6], en = le[7], fn = le[8], _t = le[9], tn = le[10], yr = I1(ee, l, c, f), br = ae(yr, 2), Wt = br[0], Bt = br[1], Ln = Wt.has("click"), $n = Bt.has("click") || Bt.has("contextMenu"), Ut = Ot(function() {
|
|
13421
13421
|
It || tn();
|
|
13422
13422
|
}), Xr = function() {
|
|
13423
|
-
fe.current && Y && $n &&
|
|
13423
|
+
fe.current && Y && $n && qe(!1);
|
|
13424
13424
|
};
|
|
13425
|
-
z1(Re,
|
|
13425
|
+
z1(Re, Ve, Ee, Ut, Xr), ht(function() {
|
|
13426
13426
|
Ut();
|
|
13427
13427
|
}, [At, I]), ht(function() {
|
|
13428
13428
|
Re && !(N != null && N[I]) && Ut();
|
|
@@ -13439,8 +13439,8 @@ function W1() {
|
|
|
13439
13439
|
};
|
|
13440
13440
|
});
|
|
13441
13441
|
var Le = p.useState(0), We = ae(Le, 2), Rt = We[0], Mt = We[1], zn = p.useState(0), Fn = ae(zn, 2), Zr = Fn[0], wr = Fn[1], or = function() {
|
|
13442
|
-
if (z &&
|
|
13443
|
-
var Se =
|
|
13442
|
+
if (z && Ve) {
|
|
13443
|
+
var Se = Ve.getBoundingClientRect();
|
|
13444
13444
|
Mt(Se.width), wr(Se.height);
|
|
13445
13445
|
}
|
|
13446
13446
|
}, En = function() {
|
|
@@ -13460,7 +13460,7 @@ function W1() {
|
|
|
13460
13460
|
function vn(he, Se, rt, bt) {
|
|
13461
13461
|
st[he] = function(ut) {
|
|
13462
13462
|
var Ko;
|
|
13463
|
-
bt == null || bt(ut),
|
|
13463
|
+
bt == null || bt(ut), qe(Se, rt);
|
|
13464
13464
|
for (var xa = arguments.length, Mu = new Array(xa > 1 ? xa - 1 : 0), Yo = 1; Yo < xa; Yo++)
|
|
13465
13465
|
Mu[Yo - 1] = arguments[Yo];
|
|
13466
13466
|
(Ko = vt[he]) === null || Ko === void 0 || Ko.call.apply(Ko, [vt, ut].concat(Mu));
|
|
@@ -13468,26 +13468,26 @@ function W1() {
|
|
|
13468
13468
|
}
|
|
13469
13469
|
(Ln || $n) && (st.onClick = function(he) {
|
|
13470
13470
|
var Se;
|
|
13471
|
-
fe.current && $n ?
|
|
13471
|
+
fe.current && $n ? qe(!1) : !fe.current && Ln && (Pt(he), qe(!0));
|
|
13472
13472
|
for (var rt = arguments.length, bt = new Array(rt > 1 ? rt - 1 : 0), ut = 1; ut < rt; ut++)
|
|
13473
13473
|
bt[ut - 1] = arguments[ut];
|
|
13474
13474
|
(Se = vt.onClick) === null || Se === void 0 || Se.call.apply(Se, [vt, he].concat(bt));
|
|
13475
13475
|
});
|
|
13476
|
-
var ga = F1(Re, $n,
|
|
13476
|
+
var ga = F1(Re, $n, Ve, Ee, C, S, pt, qe), Gt = Wt.has("hover"), Uo = Bt.has("hover"), xr, Hn;
|
|
13477
13477
|
Gt && (vn("onMouseEnter", !0, w, function(he) {
|
|
13478
13478
|
Pt(he);
|
|
13479
13479
|
}), vn("onPointerEnter", !0, w, function(he) {
|
|
13480
13480
|
Pt(he);
|
|
13481
13481
|
}), xr = function(Se) {
|
|
13482
|
-
(Re || It) && Ee !== null && Ee !== void 0 && Ee.contains(Se.target) &&
|
|
13482
|
+
(Re || It) && Ee !== null && Ee !== void 0 && Ee.contains(Se.target) && qe(!0, w);
|
|
13483
13483
|
}, Y && (st.onMouseMove = function(he) {
|
|
13484
13484
|
var Se;
|
|
13485
13485
|
(Se = vt.onMouseMove) === null || Se === void 0 || Se.call(vt, he);
|
|
13486
13486
|
})), Uo && (vn("onMouseLeave", !1, v), vn("onPointerLeave", !1, v), Hn = function() {
|
|
13487
|
-
|
|
13487
|
+
qe(!1, v);
|
|
13488
13488
|
}), Wt.has("focus") && vn("onFocus", !0, m), Bt.has("focus") && vn("onBlur", !1, b), Wt.has("contextMenu") && (st.onContextMenu = function(he) {
|
|
13489
13489
|
var Se;
|
|
13490
|
-
fe.current && Bt.has("contextMenu") ?
|
|
13490
|
+
fe.current && Bt.has("contextMenu") ? qe(!1) : (Pt(he), qe(!0)), he.preventDefault();
|
|
13491
13491
|
for (var rt = arguments.length, bt = new Array(rt > 1 ? rt - 1 : 0), ut = 1; ut < rt; ut++)
|
|
13492
13492
|
bt[ut - 1] = arguments[ut];
|
|
13493
13493
|
(Se = vt.onContextMenu) === null || Se === void 0 || Se.call.apply(Se, [vt, he].concat(bt));
|
|
@@ -13519,7 +13519,7 @@ function W1() {
|
|
|
13519
13519
|
popup: k,
|
|
13520
13520
|
className: it(T, Qe),
|
|
13521
13521
|
style: H,
|
|
13522
|
-
target:
|
|
13522
|
+
target: Ve,
|
|
13523
13523
|
onMouseEnter: xr,
|
|
13524
13524
|
onMouseLeave: Hn,
|
|
13525
13525
|
onPointerEnter: xr,
|
|
@@ -13787,7 +13787,9 @@ function sv(e) {
|
|
|
13787
13787
|
const f = e + "CollectionItemSlot", u = "data-radix-collection-item", y = /* @__PURE__ */ Lr(f), h = K.forwardRef(
|
|
13788
13788
|
(w, d) => {
|
|
13789
13789
|
const { scope: v, children: m, ...b } = w, C = K.useRef(null), x = gt(d, C), S = i(f, v);
|
|
13790
|
-
return K.useEffect(() => (S.itemMap.set(C, { ref: C, ...b }), () =>
|
|
13790
|
+
return K.useEffect(() => (S.itemMap.set(C, { ref: C, ...b }), () => {
|
|
13791
|
+
S.itemMap.delete(C);
|
|
13792
|
+
})), /* @__PURE__ */ R(y, { [u]: "", ref: x, children: m });
|
|
13791
13793
|
}
|
|
13792
13794
|
);
|
|
13793
13795
|
h.displayName = f;
|
|
@@ -15213,15 +15215,15 @@ const qa = `
|
|
|
15213
15215
|
`;
|
|
15214
15216
|
function OE(e) {
|
|
15215
15217
|
const { className: t, images: n, open: r, onOpenChange: o } = e, [i, a] = De(!1), [s, l] = De(0), [c, f] = De(1), u = ye(null), y = lt(() => n[s], [s, n]);
|
|
15216
|
-
if (
|
|
15218
|
+
if (je(() => {
|
|
15217
15219
|
r && u.current && u.current.focus();
|
|
15218
|
-
}, [r]),
|
|
15220
|
+
}, [r]), je(() => {
|
|
15219
15221
|
if (!r) return;
|
|
15220
15222
|
const g = (w) => {
|
|
15221
15223
|
w.key === "Escape" && (o == null || o(!1));
|
|
15222
15224
|
};
|
|
15223
15225
|
return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
|
|
15224
|
-
}, [r, o]),
|
|
15226
|
+
}, [r, o]), je(() => {
|
|
15225
15227
|
if (r)
|
|
15226
15228
|
a(!0);
|
|
15227
15229
|
else {
|
|
@@ -15230,6 +15232,16 @@ function OE(e) {
|
|
|
15230
15232
|
}, 150);
|
|
15231
15233
|
return () => clearTimeout(g);
|
|
15232
15234
|
}
|
|
15235
|
+
}, [r]), je(() => {
|
|
15236
|
+
if (!r) return;
|
|
15237
|
+
const g = (w) => {
|
|
15238
|
+
w.preventDefault();
|
|
15239
|
+
const d = -w.deltaY * 1e-3;
|
|
15240
|
+
f((v) => Math.min(Math.max(0.5, v + d), 2));
|
|
15241
|
+
};
|
|
15242
|
+
return window.addEventListener("wheel", g, { passive: !1 }), () => {
|
|
15243
|
+
window.removeEventListener("wheel", g);
|
|
15244
|
+
};
|
|
15233
15245
|
}, [r]), !r && !i) return null;
|
|
15234
15246
|
function h(g) {
|
|
15235
15247
|
if (g === "reset") {
|
|
@@ -15589,12 +15601,12 @@ const Jx = Ts(
|
|
|
15589
15601
|
}, C = (_) => {
|
|
15590
15602
|
u == null || u(_.target.value);
|
|
15591
15603
|
}, x = lt(() => s && i && !l || g, [s, l, g, i]), [S, E] = De(0), M = ye(null);
|
|
15592
|
-
return
|
|
15604
|
+
return je(() => {
|
|
15593
15605
|
let _ = null;
|
|
15594
15606
|
return g && M.current && (_ = new MutationObserver(() => {
|
|
15595
15607
|
M.current && E(M.current.offsetWidth + 8);
|
|
15596
15608
|
}), _.observe(M.current, { childList: !0, subtree: !0 }), E(M.current.offsetWidth + 8)), () => _ == null ? void 0 : _.disconnect();
|
|
15597
|
-
}, [M.current]),
|
|
15609
|
+
}, [M.current]), je(() => {
|
|
15598
15610
|
s && !(g && M.current) && E(26);
|
|
15599
15611
|
}, []), /* @__PURE__ */ me(
|
|
15600
15612
|
"div",
|
|
@@ -15686,11 +15698,11 @@ const Jx = Ts(
|
|
|
15686
15698
|
), E = ye(x), [M, _] = De(I(x)), P = ye(null), k = ye(null), T = ye(null), H = (W) => {
|
|
15687
15699
|
C && (typeof C == "function" ? C(W) : C.current = W), P.current = W;
|
|
15688
15700
|
};
|
|
15689
|
-
|
|
15701
|
+
je(() => {
|
|
15690
15702
|
e !== void 0 && e !== x && (S(e), E.current = e, _(I(e)));
|
|
15691
|
-
}, [e]),
|
|
15703
|
+
}, [e]), je(() => {
|
|
15692
15704
|
x !== null && (E.current = x);
|
|
15693
|
-
}, [x]),
|
|
15705
|
+
}, [x]), je(() => () => {
|
|
15694
15706
|
k.current && clearTimeout(k.current), T.current && clearInterval(T.current);
|
|
15695
15707
|
}, []);
|
|
15696
15708
|
function I(W) {
|
|
@@ -15936,7 +15948,7 @@ function dC(e, t) {
|
|
|
15936
15948
|
}, [i, Ie, Ee, ee]), Je = dt(function(de, fe) {
|
|
15937
15949
|
var ue;
|
|
15938
15950
|
return typeof l == "function" ? l(de) : (ue = l && (de == null ? void 0 : de[l])) !== null && ue !== void 0 ? ue : fe;
|
|
15939
|
-
}, [l]),
|
|
15951
|
+
}, [l]), Ve = dt(a || function(de) {
|
|
15940
15952
|
return de;
|
|
15941
15953
|
}, [a]);
|
|
15942
15954
|
function Ze(de, fe, ue) {
|
|
@@ -16015,7 +16027,7 @@ function dC(e, t) {
|
|
|
16015
16027
|
order: fe,
|
|
16016
16028
|
key: ue,
|
|
16017
16029
|
item: de,
|
|
16018
|
-
renderItem:
|
|
16030
|
+
renderItem: Ve,
|
|
16019
16031
|
itemKey: ue,
|
|
16020
16032
|
registerSize: Fe,
|
|
16021
16033
|
display: fe <= ee
|
|
@@ -16696,9 +16708,9 @@ var FC = ["style", "className", "title", "eventKey", "warnKey", "disabled", "int
|
|
|
16696
16708
|
"aria-disabled": Z,
|
|
16697
16709
|
onClick: Te,
|
|
16698
16710
|
onFocus: ze
|
|
16699
|
-
}, Q), o, Xe),
|
|
16700
|
-
if (M !== "inline" && U.length > 1 ?
|
|
16701
|
-
var Ze =
|
|
16711
|
+
}, Q), o, Xe), Ve = p.useRef(M);
|
|
16712
|
+
if (M !== "inline" && U.length > 1 ? Ve.current = "vertical" : Ve.current = M, !k) {
|
|
16713
|
+
var Ze = Ve.current;
|
|
16702
16714
|
Je = /* @__PURE__ */ p.createElement($C, {
|
|
16703
16715
|
mode: Ze,
|
|
16704
16716
|
prefixCls: V,
|
|
@@ -16836,12 +16848,12 @@ var qC = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items
|
|
|
16836
16848
|
r.openAnimation, r.openTransitionName;
|
|
16837
16849
|
var oe = r._internalRenderMenuItem, ee = r._internalRenderSubMenuItem, ne = r._internalComponents, be = ft(r, qC), we = p.useMemo(function() {
|
|
16838
16850
|
return [vc(y, u, ur, ne, i), vc(y, u, ur, {}, i)];
|
|
16839
|
-
}, [y, u, ne]), pe = ae(we, 2), te = pe[0], He = pe[1], Te = p.useState(!1), Ee = ae(Te, 2), Ge = Ee[0], ze = Ee[1], Ie = p.useRef(), Xe = EC(g), Je = h === "rtl",
|
|
16851
|
+
}, [y, u, ne]), pe = ae(we, 2), te = pe[0], He = pe[1], Te = p.useState(!1), Ee = ae(Te, 2), Ge = Ee[0], ze = Ee[1], Ie = p.useRef(), Xe = EC(g), Je = h === "rtl", Ve = gi(_, {
|
|
16840
16852
|
value: P,
|
|
16841
16853
|
postState: function(Le) {
|
|
16842
16854
|
return Le || ur;
|
|
16843
16855
|
}
|
|
16844
|
-
}), Ze = ae(
|
|
16856
|
+
}), Ze = ae(Ve, 2), Ae = Ze[0], Fe = Ze[1], Ke = function(Le) {
|
|
16845
16857
|
var We = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
16846
16858
|
function Rt() {
|
|
16847
16859
|
Fe(Le), Q == null || Q(Le);
|
|
@@ -16849,7 +16861,7 @@ var qC = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items
|
|
|
16849
16861
|
We ? Ya(Rt) : Rt();
|
|
16850
16862
|
}, vt = p.useState(Ae), st = ae(vt, 2), pt = st[0], zt = st[1], St = p.useRef(!1), Tt = p.useMemo(function() {
|
|
16851
16863
|
return (d === "inline" || d === "vertical") && v ? ["vertical", v] : [d, !1];
|
|
16852
|
-
}, [d, v]), ot = ae(Tt, 2), ce = ot[0], _e = ot[1], Re = ce === "inline", de = p.useState(ce), fe = ae(de, 2), ue = fe[0], Pe = fe[1], nt = p.useState(_e), et = ae(nt, 2),
|
|
16864
|
+
}, [d, v]), ot = ae(Tt, 2), ce = ot[0], _e = ot[1], Re = ce === "inline", de = p.useState(ce), fe = ae(de, 2), ue = fe[0], Pe = fe[1], nt = p.useState(_e), et = ae(nt, 2), qe = et[0], Xt = et[1];
|
|
16853
16865
|
p.useEffect(function() {
|
|
16854
16866
|
Pe(ce), Xt(_e), St.current && (Re ? Fe(pt) : Ke(ur));
|
|
16855
16867
|
}, [ce, _e]);
|
|
@@ -16959,7 +16971,7 @@ var qC = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items
|
|
|
16959
16971
|
prefixCls: "".concat(i, "-overflow"),
|
|
16960
16972
|
component: "ul",
|
|
16961
16973
|
itemComponent: ha,
|
|
16962
|
-
className: it(i, "".concat(i, "-root"), "".concat(i, "-").concat(ue), l, xe(xe({}, "".concat(i, "-inline-collapsed"),
|
|
16974
|
+
className: it(i, "".concat(i, "-root"), "".concat(i, "-").concat(ue), l, xe(xe({}, "".concat(i, "-inline-collapsed"), qe), "".concat(i, "-rtl"), Je), a),
|
|
16963
16975
|
dir: h,
|
|
16964
16976
|
style: s,
|
|
16965
16977
|
role: "menu",
|
|
@@ -17072,7 +17084,7 @@ function Np(e) {
|
|
|
17072
17084
|
W = Math.min(Math.max(0, V.t), A - $.height), Y = Math.min(Math.max(0, V.l), L - $.width);
|
|
17073
17085
|
}
|
|
17074
17086
|
b(B), v({ top: Math.round(W + window.scrollY), left: Math.round(Y + window.scrollX) });
|
|
17075
|
-
}, [y, i]),
|
|
17087
|
+
}, [y, i]), je(() => {
|
|
17076
17088
|
if (!y) return;
|
|
17077
17089
|
const T = () => {
|
|
17078
17090
|
if (!h.current || !g.current) return;
|
|
@@ -17238,7 +17250,7 @@ const ZC = /* @__PURE__ */ (() => {
|
|
|
17238
17250
|
}), o((a) => ({
|
|
17239
17251
|
messages: a.messages.filter((s) => s.id !== i)
|
|
17240
17252
|
}));
|
|
17241
|
-
},
|
|
17253
|
+
}, je(() => {
|
|
17242
17254
|
const i = [];
|
|
17243
17255
|
return e = (a) => {
|
|
17244
17256
|
const s = String(XC++);
|
|
@@ -17527,7 +17539,7 @@ Ru.defaultProps = {
|
|
|
17527
17539
|
Ru.propTypes = {};
|
|
17528
17540
|
function jE(e) {
|
|
17529
17541
|
const { children: t, visible: n = !1, offset: r = [0, 0] } = e, o = ye(null), [i, a] = De(r), { mountContainer: s } = Jn(Tn);
|
|
17530
|
-
|
|
17542
|
+
je(() => {
|
|
17531
17543
|
if (!n) {
|
|
17532
17544
|
a([-9999, -9999]);
|
|
17533
17545
|
return;
|
|
@@ -17660,7 +17672,7 @@ function UE({
|
|
|
17660
17672
|
const [i, a] = De(
|
|
17661
17673
|
t !== void 0 ? t : n || e[0].value
|
|
17662
17674
|
), [s, l] = De({}), c = ye(/* @__PURE__ */ new Map()), f = ye(null);
|
|
17663
|
-
|
|
17675
|
+
je(() => {
|
|
17664
17676
|
t !== void 0 && t !== i && a(t);
|
|
17665
17677
|
}, [t]);
|
|
17666
17678
|
const u = (h, g) => {
|
|
@@ -17682,7 +17694,7 @@ function UE({
|
|
|
17682
17694
|
});
|
|
17683
17695
|
}
|
|
17684
17696
|
};
|
|
17685
|
-
|
|
17697
|
+
je(() => {
|
|
17686
17698
|
u(i);
|
|
17687
17699
|
}, [i]);
|
|
17688
17700
|
const y = (h) => {
|
|
@@ -17948,7 +17960,7 @@ var nS = [
|
|
|
17948
17960
|
], rS = nS.reduce((e, t) => {
|
|
17949
17961
|
const n = /* @__PURE__ */ Xc(`Primitive.${t}`), r = p.forwardRef((o, i) => {
|
|
17950
17962
|
const { asChild: a, ...s } = o, l = a ? n : t;
|
|
17951
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ R(l, { ...s, ref: i });
|
|
17963
|
+
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ R(l, { ...s, ref: i });
|
|
17952
17964
|
});
|
|
17953
17965
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
17954
17966
|
}, {}), oS = "Separator", mc = "horizontal", iS = ["horizontal", "vertical"], Tp = p.forwardRef((e, t) => {
|
|
@@ -17998,7 +18010,7 @@ const ZE = (e) => {
|
|
|
17998
18010
|
const { defaultChecked: t = !1, onChange: n } = e, [r, o] = De(t), i = () => {
|
|
17999
18011
|
o(!r), n == null || n(!r);
|
|
18000
18012
|
};
|
|
18001
|
-
return
|
|
18013
|
+
return je(() => {
|
|
18002
18014
|
o(t);
|
|
18003
18015
|
}, [t]), /* @__PURE__ */ R("div", { className: "univer-h-4", children: /* @__PURE__ */ me("label", { className: "univer-relative univer-inline-block univer-h-4 univer-w-7", children: [
|
|
18004
18016
|
/* @__PURE__ */ R(
|
|
@@ -18370,7 +18382,7 @@ const kS = (e) => {
|
|
|
18370
18382
|
]), ze = K.useMemo(() => u.duration || T || gc, [
|
|
18371
18383
|
u.duration,
|
|
18372
18384
|
T
|
|
18373
|
-
]), Ie = K.useRef(0), Xe = K.useRef(0), Je = K.useRef(0),
|
|
18385
|
+
]), Ie = K.useRef(0), Xe = K.useRef(0), Je = K.useRef(0), Ve = K.useRef(null), [Ze, Ae] = H.split("-"), Fe = K.useMemo(() => d.reduce((ce, _e, Re) => Re >= Ee ? ce : ce + _e.height, 0), [
|
|
18374
18386
|
d,
|
|
18375
18387
|
Ee
|
|
18376
18388
|
]), Ke = gS(), vt = u.invert || f, st = pe === "loading";
|
|
@@ -18444,11 +18456,9 @@ const kS = (e) => {
|
|
|
18444
18456
|
oe.current = oe.current - de;
|
|
18445
18457
|
}
|
|
18446
18458
|
Je.current = (/* @__PURE__ */ new Date()).getTime();
|
|
18447
|
-
})() : (() => {
|
|
18448
|
-
|
|
18449
|
-
|
|
18450
|
-
}, oe.current));
|
|
18451
|
-
})(), () => clearTimeout(ce);
|
|
18459
|
+
})() : oe.current !== 1 / 0 && (Ie.current = (/* @__PURE__ */ new Date()).getTime(), ce = setTimeout(() => {
|
|
18460
|
+
u.onAutoClose == null || u.onAutoClose.call(u, u), pt();
|
|
18461
|
+
}, oe.current)), () => clearTimeout(ce);
|
|
18452
18462
|
}, [
|
|
18453
18463
|
b,
|
|
18454
18464
|
h,
|
|
@@ -18512,10 +18522,10 @@ const kS = (e) => {
|
|
|
18512
18522
|
...u.style
|
|
18513
18523
|
},
|
|
18514
18524
|
onDragEnd: () => {
|
|
18515
|
-
j(!1), B(null),
|
|
18525
|
+
j(!1), B(null), Ve.current = null;
|
|
18516
18526
|
},
|
|
18517
18527
|
onPointerDown: (ce) => {
|
|
18518
|
-
ce.button !== 2 && (st || !te || (ee.current = /* @__PURE__ */ new Date(), G(Xe.current), ce.target.setPointerCapture(ce.pointerId), ce.target.tagName !== "BUTTON" && (j(!0),
|
|
18528
|
+
ce.button !== 2 && (st || !te || (ee.current = /* @__PURE__ */ new Date(), G(Xe.current), ce.target.setPointerCapture(ce.pointerId), ce.target.tagName !== "BUTTON" && (j(!0), Ve.current = {
|
|
18519
18529
|
x: ce.clientX,
|
|
18520
18530
|
y: ce.clientY
|
|
18521
18531
|
})));
|
|
@@ -18523,25 +18533,25 @@ const kS = (e) => {
|
|
|
18523
18533
|
onPointerUp: () => {
|
|
18524
18534
|
var ce, _e, Re;
|
|
18525
18535
|
if (q || !te) return;
|
|
18526
|
-
|
|
18536
|
+
Ve.current = null;
|
|
18527
18537
|
const de = Number(((ce = ne.current) == null ? void 0 : ce.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), fe = Number(((_e = ne.current) == null ? void 0 : _e.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), ue = (/* @__PURE__ */ new Date()).getTime() - ((Re = ee.current) == null ? void 0 : Re.getTime()), Pe = z === "x" ? de : fe, nt = Math.abs(Pe) / ue;
|
|
18528
18538
|
if (Math.abs(Pe) >= DS || nt > 0.11) {
|
|
18529
18539
|
G(Xe.current), u.onDismiss == null || u.onDismiss.call(u, u), Y(z === "x" ? de > 0 ? "right" : "left" : fe > 0 ? "down" : "up"), pt(), J(!0);
|
|
18530
18540
|
return;
|
|
18531
18541
|
} else {
|
|
18532
|
-
var et,
|
|
18533
|
-
(et = ne.current) == null || et.style.setProperty("--swipe-amount-x", "0px"), (
|
|
18542
|
+
var et, qe;
|
|
18543
|
+
(et = ne.current) == null || et.style.setProperty("--swipe-amount-x", "0px"), (qe = ne.current) == null || qe.style.setProperty("--swipe-amount-y", "0px");
|
|
18534
18544
|
}
|
|
18535
18545
|
O(!1), j(!1), B(null);
|
|
18536
18546
|
},
|
|
18537
18547
|
onPointerMove: (ce) => {
|
|
18538
18548
|
var _e, Re, de;
|
|
18539
|
-
if (!
|
|
18540
|
-
const ue = ce.clientY -
|
|
18549
|
+
if (!Ve.current || !te || ((_e = window.getSelection()) == null ? void 0 : _e.toString().length) > 0) return;
|
|
18550
|
+
const ue = ce.clientY - Ve.current.y, Pe = ce.clientX - Ve.current.x;
|
|
18541
18551
|
var nt;
|
|
18542
18552
|
const et = (nt = e.swipeDirections) != null ? nt : OS(H);
|
|
18543
18553
|
!z && (Math.abs(Pe) > 1 || Math.abs(ue) > 1) && B(Math.abs(Pe) > Math.abs(ue) ? "x" : "y");
|
|
18544
|
-
let
|
|
18554
|
+
let qe = {
|
|
18545
18555
|
x: 0,
|
|
18546
18556
|
y: 0
|
|
18547
18557
|
};
|
|
@@ -18549,19 +18559,19 @@ const kS = (e) => {
|
|
|
18549
18559
|
if (z === "y") {
|
|
18550
18560
|
if (et.includes("top") || et.includes("bottom"))
|
|
18551
18561
|
if (et.includes("top") && ue < 0 || et.includes("bottom") && ue > 0)
|
|
18552
|
-
|
|
18562
|
+
qe.y = ue;
|
|
18553
18563
|
else {
|
|
18554
18564
|
const yt = ue * Xt(ue);
|
|
18555
|
-
|
|
18565
|
+
qe.y = Math.abs(yt) < Math.abs(ue) ? yt : ue;
|
|
18556
18566
|
}
|
|
18557
18567
|
} else if (z === "x" && (et.includes("left") || et.includes("right")))
|
|
18558
18568
|
if (et.includes("left") && Pe < 0 || et.includes("right") && Pe > 0)
|
|
18559
|
-
|
|
18569
|
+
qe.x = Pe;
|
|
18560
18570
|
else {
|
|
18561
18571
|
const yt = Pe * Xt(Pe);
|
|
18562
|
-
|
|
18572
|
+
qe.x = Math.abs(yt) < Math.abs(Pe) ? yt : Pe;
|
|
18563
18573
|
}
|
|
18564
|
-
(Math.abs(
|
|
18574
|
+
(Math.abs(qe.x) > 0 || Math.abs(qe.y) > 0) && O(!0), (Re = ne.current) == null || Re.style.setProperty("--swipe-amount-x", `${qe.x}px`), (de = ne.current) == null || de.style.setProperty("--swipe-amount-y", `${qe.y}px`);
|
|
18565
18575
|
}
|
|
18566
18576
|
}, Ge && !u.jsx && pe !== "loading" ? /* @__PURE__ */ K.createElement("button", {
|
|
18567
18577
|
"aria-label": A,
|
|
@@ -19055,7 +19065,7 @@ function BS(e, t, n) {
|
|
|
19055
19065
|
var w = e(h);
|
|
19056
19066
|
s.current.get(w), g ? (s.current.set(w, g), u()) : s.current.delete(w);
|
|
19057
19067
|
}
|
|
19058
|
-
return
|
|
19068
|
+
return je(function() {
|
|
19059
19069
|
return f;
|
|
19060
19070
|
}, []), [y, u, l.current, i];
|
|
19061
19071
|
}
|
|
@@ -19371,7 +19381,7 @@ function ZS(e, t) {
|
|
|
19371
19381
|
end: Ye,
|
|
19372
19382
|
offset: Oe
|
|
19373
19383
|
};
|
|
19374
|
-
}, [B, A, q, U, L, i]), Ie = ze.scrollHeight, Xe = ze.start, Je = ze.end,
|
|
19384
|
+
}, [B, A, q, U, L, i]), Ie = ze.scrollHeight, Xe = ze.start, Je = ze.end, Ve = ze.offset;
|
|
19375
19385
|
te.current.start = Xe, te.current.end = Je, p.useLayoutEffect(function() {
|
|
19376
19386
|
var le = N.getRecord();
|
|
19377
19387
|
if (le.size === 1) {
|
|
@@ -19417,7 +19427,7 @@ function ZS(e, t) {
|
|
|
19417
19427
|
(nt.current.x !== ve.x || nt.current.y !== ve.y) && (b(ve), nt.current = ve);
|
|
19418
19428
|
}
|
|
19419
19429
|
});
|
|
19420
|
-
function
|
|
19430
|
+
function qe(le, ve) {
|
|
19421
19431
|
var Me = le;
|
|
19422
19432
|
ve ? (Ya(function() {
|
|
19423
19433
|
G(Me);
|
|
@@ -19504,7 +19514,7 @@ function ZS(e, t) {
|
|
|
19504
19514
|
end: Je,
|
|
19505
19515
|
virtual: B,
|
|
19506
19516
|
offsetX: F,
|
|
19507
|
-
offsetY:
|
|
19517
|
+
offsetY: Ve,
|
|
19508
19518
|
rtl: W,
|
|
19509
19519
|
getSize: Jt
|
|
19510
19520
|
}), cn = LS(U, Xe, Je, w, F, I, u, we), Pt = null;
|
|
@@ -19528,7 +19538,7 @@ function ZS(e, t) {
|
|
|
19528
19538
|
prefixCls: r,
|
|
19529
19539
|
height: Ie,
|
|
19530
19540
|
offsetX: F,
|
|
19531
|
-
offsetY:
|
|
19541
|
+
offsetY: Ve,
|
|
19532
19542
|
scrollWidth: w,
|
|
19533
19543
|
onInnerResize: $,
|
|
19534
19544
|
ref: Z,
|
|
@@ -19541,7 +19551,7 @@ function ZS(e, t) {
|
|
|
19541
19551
|
scrollOffset: q,
|
|
19542
19552
|
scrollRange: Ie,
|
|
19543
19553
|
rtl: W,
|
|
19544
|
-
onScroll:
|
|
19554
|
+
onScroll: qe,
|
|
19545
19555
|
onStartMove: ne,
|
|
19546
19556
|
onStopMove: be,
|
|
19547
19557
|
spinSize: St,
|
|
@@ -19555,7 +19565,7 @@ function ZS(e, t) {
|
|
|
19555
19565
|
scrollOffset: F,
|
|
19556
19566
|
scrollRange: w,
|
|
19557
19567
|
rtl: W,
|
|
19558
|
-
onScroll:
|
|
19568
|
+
onScroll: qe,
|
|
19559
19569
|
onStartMove: ne,
|
|
19560
19570
|
onStopMove: be,
|
|
19561
19571
|
spinSize: zt,
|
|
@@ -19662,7 +19672,7 @@ function rR(e) {
|
|
|
19662
19672
|
w.findNodePathFromTreeWithCache(x).forEach((E) => C.add(E));
|
|
19663
19673
|
}), C;
|
|
19664
19674
|
}, [a, w]);
|
|
19665
|
-
|
|
19675
|
+
je(() => {
|
|
19666
19676
|
function C(x) {
|
|
19667
19677
|
var S;
|
|
19668
19678
|
g.add(x.key), (S = x.children) == null || S.forEach(C);
|