@univerjs/ui 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +13 -13
- package/lib/es/index.js +202 -201
- package/lib/types/services/dom/canvas-dom-layer.service.d.ts +1 -0
- package/lib/umd/index.js +13 -13
- package/package.json +5 -5
package/lib/es/index.js
CHANGED
|
@@ -1463,9 +1463,9 @@ function j8(e) {
|
|
|
1463
1463
|
if (o) return;
|
|
1464
1464
|
H.preventDefault();
|
|
1465
1465
|
const E = v.current;
|
|
1466
|
-
let
|
|
1466
|
+
let T = !0;
|
|
1467
1467
|
function w(k) {
|
|
1468
|
-
if (
|
|
1468
|
+
if (T) {
|
|
1469
1469
|
let z = k.clientX - E.getBoundingClientRect().x;
|
|
1470
1470
|
z <= 0 ? z = 0 : z >= 116 && (z = 116);
|
|
1471
1471
|
const F = z / 116;
|
|
@@ -1473,13 +1473,13 @@ function j8(e) {
|
|
|
1473
1473
|
F <= 0.5 ? G = r + F * (a - r) * 2 : G = a + (F - 0.5) * (i - a) * 2, d && d(Math.ceil(G));
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1476
|
+
function N() {
|
|
1477
|
+
T = !1, document.removeEventListener("pointermove", w), window.removeEventListener("pointerup", N);
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1480
|
-
k.relatedTarget === null &&
|
|
1479
|
+
function I(k) {
|
|
1480
|
+
k.relatedTarget === null && N();
|
|
1481
1481
|
}
|
|
1482
|
-
window.addEventListener("pointermove", w), window.addEventListener("pointerup",
|
|
1482
|
+
window.addEventListener("pointermove", w), window.addEventListener("pointerup", N), window.addEventListener("pointerout", I);
|
|
1483
1483
|
}
|
|
1484
1484
|
function f(H) {
|
|
1485
1485
|
o || (u(!1), d && d(H));
|
|
@@ -1580,35 +1580,35 @@ function R5(e) {
|
|
|
1580
1580
|
return t.current = e, t;
|
|
1581
1581
|
}
|
|
1582
1582
|
const X8 = (e, t) => {
|
|
1583
|
-
const { containerTarget: n, itemHeight: r, overscan: i = 5 } = t, o = R5(r), [a, l] = K(null), d = e1(!1), [v, g] = K([]), [u, m] = K({ height: void 0, marginTop: void 0 }), C = (E,
|
|
1583
|
+
const { containerTarget: n, itemHeight: r, overscan: i = 5 } = t, o = R5(r), [a, l] = K(null), d = e1(!1), [v, g] = K([]), [u, m] = K({ height: void 0, marginTop: void 0 }), C = (E, T) => {
|
|
1584
1584
|
if (typeof o.current == "number")
|
|
1585
1585
|
return Math.ceil(E / o.current);
|
|
1586
|
-
let w = 0,
|
|
1587
|
-
for (let
|
|
1588
|
-
const k = o.current(
|
|
1589
|
-
if (w += k,
|
|
1586
|
+
let w = 0, N = 0;
|
|
1587
|
+
for (let I = T; I < e.length; I++) {
|
|
1588
|
+
const k = o.current(I, e[I]);
|
|
1589
|
+
if (w += k, N = I, w >= E)
|
|
1590
1590
|
break;
|
|
1591
1591
|
}
|
|
1592
|
-
return
|
|
1592
|
+
return N - T;
|
|
1593
1593
|
}, S = (E) => {
|
|
1594
1594
|
if (Ln(o.current))
|
|
1595
1595
|
return Math.floor(E / o.current);
|
|
1596
|
-
let
|
|
1597
|
-
for (let
|
|
1598
|
-
const
|
|
1599
|
-
if (
|
|
1600
|
-
w =
|
|
1596
|
+
let T = 0, w = 0;
|
|
1597
|
+
for (let N = 0; N < e.length; N++) {
|
|
1598
|
+
const I = o.current(N, e[N]);
|
|
1599
|
+
if (T += I, T >= E) {
|
|
1600
|
+
w = N;
|
|
1601
1601
|
break;
|
|
1602
1602
|
}
|
|
1603
1603
|
}
|
|
1604
1604
|
return w + 1;
|
|
1605
|
-
}, L = (E) => typeof o.current == "number" ? E * o.current : e.slice(0, E).reduce((w,
|
|
1606
|
-
(E,
|
|
1605
|
+
}, L = (E) => typeof o.current == "number" ? E * o.current : e.slice(0, E).reduce((w, N, I) => w + o.current(I, e[I]), 0), f = r1(() => Ln(o.current) ? e.length * o.current : e.reduce(
|
|
1606
|
+
(E, T, w) => E + o.current(w, e[w]),
|
|
1607
1607
|
0
|
|
1608
1608
|
), [e]), M = () => {
|
|
1609
1609
|
const E = n.current;
|
|
1610
1610
|
if (E) {
|
|
1611
|
-
const { scrollTop:
|
|
1611
|
+
const { scrollTop: T, clientHeight: w } = E, N = S(T), I = C(w, N), k = Math.max(0, N - i), P = Math.min(e.length, N + I + i), z = L(k);
|
|
1612
1612
|
m({
|
|
1613
1613
|
height: `${f - z}px`,
|
|
1614
1614
|
marginTop: `${z}px`
|
|
@@ -1623,13 +1623,13 @@ const X8 = (e, t) => {
|
|
|
1623
1623
|
return Y(() => {
|
|
1624
1624
|
if (n.current) {
|
|
1625
1625
|
const E = () => {
|
|
1626
|
-
const w = n.current.clientWidth,
|
|
1627
|
-
(w !== (a == null ? void 0 : a.width) ||
|
|
1626
|
+
const w = n.current.clientWidth, N = n.current.clientHeight;
|
|
1627
|
+
(w !== (a == null ? void 0 : a.width) || N !== (a == null ? void 0 : a.height)) && l({ width: w, height: N });
|
|
1628
1628
|
};
|
|
1629
1629
|
E();
|
|
1630
|
-
const
|
|
1631
|
-
return
|
|
1632
|
-
|
|
1630
|
+
const T = new ResizeObserver(E);
|
|
1631
|
+
return T.observe(n.current), () => {
|
|
1632
|
+
T.disconnect();
|
|
1633
1633
|
};
|
|
1634
1634
|
}
|
|
1635
1635
|
}, []), Y(() => {
|
|
@@ -1639,8 +1639,8 @@ const X8 = (e, t) => {
|
|
|
1639
1639
|
{
|
|
1640
1640
|
wrapperStyle: u,
|
|
1641
1641
|
scrollTo: qe((E) => {
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1642
|
+
const T = n.current;
|
|
1643
|
+
T && (d.current = !0, T.scrollTop = L(E), M());
|
|
1644
1644
|
}),
|
|
1645
1645
|
containerProps: {
|
|
1646
1646
|
onScroll: (E) => {
|
|
@@ -1662,9 +1662,9 @@ function N6(e) {
|
|
|
1662
1662
|
const { left: C, top: S, right: L, bottom: f } = t, M = a === "vertical" && f > i - r - de || a.indexOf("top") > -1 ? { top: Math.max(S - r, de) } : { top: Math.min(f, i - r - de) };
|
|
1663
1663
|
let H;
|
|
1664
1664
|
if (a.includes("center")) {
|
|
1665
|
-
const
|
|
1665
|
+
const T = (L - C - n) / 2;
|
|
1666
1666
|
H = {
|
|
1667
|
-
left: C +
|
|
1667
|
+
left: C + T
|
|
1668
1668
|
};
|
|
1669
1669
|
} else
|
|
1670
1670
|
H = C + n > o ? { left: Math.max(L - n, de) } : { left: Math.min(C, o - n - de) };
|
|
@@ -1681,15 +1681,15 @@ function $3(e) {
|
|
|
1681
1681
|
left: -9999
|
|
1682
1682
|
}), M = l, H = e1(void 0);
|
|
1683
1683
|
Y(() => {
|
|
1684
|
-
const
|
|
1684
|
+
const T = r.subscribe((w) => {
|
|
1685
1685
|
H.current = w, requestAnimationFrame(() => {
|
|
1686
1686
|
if (!C.current) return;
|
|
1687
|
-
const { clientWidth:
|
|
1687
|
+
const { clientWidth: N, clientHeight: I } = C.current, k = window.innerWidth, P = window.innerHeight;
|
|
1688
1688
|
f.current = N6(
|
|
1689
1689
|
{
|
|
1690
1690
|
position: w,
|
|
1691
|
-
width:
|
|
1692
|
-
height:
|
|
1691
|
+
width: N,
|
|
1692
|
+
height: I,
|
|
1693
1693
|
containerWidth: k,
|
|
1694
1694
|
containerHeight: P,
|
|
1695
1695
|
direction: i
|
|
@@ -1697,30 +1697,30 @@ function $3(e) {
|
|
|
1697
1697
|
), C.current.style.top = `${f.current.top}px`, C.current.style.left = `${f.current.left}px`;
|
|
1698
1698
|
});
|
|
1699
1699
|
});
|
|
1700
|
-
return () =>
|
|
1700
|
+
return () => T.unsubscribe();
|
|
1701
1701
|
}, [r, i]), Y(() => {
|
|
1702
|
-
const
|
|
1702
|
+
const T = (w) => {
|
|
1703
1703
|
var P;
|
|
1704
1704
|
if (a && (a.indexOf(w.target) > -1 || a.some(
|
|
1705
1705
|
(z) => z.contains(w.target)
|
|
1706
1706
|
)))
|
|
1707
1707
|
return;
|
|
1708
|
-
const
|
|
1708
|
+
const N = w.clientX, I = w.clientY, k = [...(P = M == null ? void 0 : M.current) != null ? P : []];
|
|
1709
1709
|
H.current && k.push(H.current);
|
|
1710
1710
|
for (const z of k)
|
|
1711
|
-
if (
|
|
1711
|
+
if (N <= z.right && N >= z.left && I <= z.bottom && I >= z.top)
|
|
1712
1712
|
return;
|
|
1713
1713
|
S(w);
|
|
1714
1714
|
};
|
|
1715
|
-
return window.addEventListener("pointerdown",
|
|
1716
|
-
window.removeEventListener("pointerdown",
|
|
1715
|
+
return window.addEventListener("pointerdown", T), () => {
|
|
1716
|
+
window.removeEventListener("pointerdown", T);
|
|
1717
1717
|
};
|
|
1718
1718
|
}, [S, a, M]), Y(() => {
|
|
1719
|
-
const
|
|
1719
|
+
const T = (w) => {
|
|
1720
1720
|
w.ctrlKey && w.button === 0 || L();
|
|
1721
1721
|
};
|
|
1722
|
-
return window.addEventListener("contextmenu",
|
|
1723
|
-
window.removeEventListener("contextmenu",
|
|
1722
|
+
return window.addEventListener("contextmenu", T), () => {
|
|
1723
|
+
window.removeEventListener("contextmenu", T);
|
|
1724
1724
|
};
|
|
1725
1725
|
}, [L]);
|
|
1726
1726
|
const E = /* @__PURE__ */ b(
|
|
@@ -1731,7 +1731,7 @@ function $3(e) {
|
|
|
1731
1731
|
ref: C,
|
|
1732
1732
|
style: { ...f.current, ...u ? { display: "none" } : null },
|
|
1733
1733
|
className: V5.popupFixed,
|
|
1734
|
-
onPointerDown: (
|
|
1734
|
+
onPointerDown: (T) => T.stopPropagation(),
|
|
1735
1735
|
onClick: g,
|
|
1736
1736
|
children: /* @__PURE__ */ b(T6.Provider, { value: H, children: n })
|
|
1737
1737
|
}
|
|
@@ -2822,10 +2822,11 @@ const bo = V2((e) => {
|
|
|
2822
2822
|
}), [t.data, t.props]);
|
|
2823
2823
|
Y(() => {
|
|
2824
2824
|
const M = t.position$.subscribe((E) => {
|
|
2825
|
-
|
|
2825
|
+
var T;
|
|
2826
|
+
d.current = `rotate(${E.rotate}deg)`, v.current = E.startY, g.current = E.startX, a.current && (a.current.style.transform = d.current, a.current.style.top = `${v.current}px`, a.current.style.left = `${g.current}px`, a.current.style.opacity = `${(T = E.opacity) != null ? T : 1}`);
|
|
2826
2827
|
}), H = i.subscribe((E) => {
|
|
2827
2828
|
if (a.current && (a.current.style.width = `${Math.max(E.endX - E.startX - 2, 0)}px`, a.current.style.height = `${Math.max(E.endY - E.startY - 2, 0)}px`), l.current) {
|
|
2828
|
-
const
|
|
2829
|
+
const T = {
|
|
2829
2830
|
width: `${E.width - 4}px`,
|
|
2830
2831
|
height: `${E.height - 4}px`,
|
|
2831
2832
|
left: `${E.absolute.left ? 0 : "auto"}`,
|
|
@@ -2833,7 +2834,7 @@ const bo = V2((e) => {
|
|
|
2833
2834
|
right: `${E.absolute.left ? "auto" : 0}`,
|
|
2834
2835
|
bottom: `${E.absolute.top ? "auto" : 0}`
|
|
2835
2836
|
};
|
|
2836
|
-
l.current.style.width =
|
|
2837
|
+
l.current.style.width = T.width, l.current.style.height = T.height, l.current.style.left = T.left, l.current.style.top = T.top, l.current.style.right = T.right, l.current.style.bottom = T.bottom, u.current = T;
|
|
2837
2838
|
}
|
|
2838
2839
|
});
|
|
2839
2840
|
return () => {
|
|
@@ -2955,7 +2956,7 @@ const yo = ({ popup: e, children: t }) => {
|
|
|
2955
2956
|
if (!v)
|
|
2956
2957
|
return;
|
|
2957
2958
|
const u = $t([i, o]).subscribe(([m, C]) => {
|
|
2958
|
-
const S = d.getBoundingClientRect(), { top: L, left: f, bottom: M, right: H } = S, E = m.bottom - m.top,
|
|
2959
|
+
const S = d.getBoundingClientRect(), { top: L, left: f, bottom: M, right: H } = S, E = m.bottom - m.top, T = m.right - m.left, w = C.some((N) => m.top >= N.top - 0.5 * E && m.bottom <= N.bottom + 0.5 * E && m.left >= N.left - 0.5 * T && m.right <= N.right + 0.5 * T);
|
|
2959
2960
|
m.bottom < L || m.top > M || m.right < f || m.left > H || w ? r(!0) : r(!1);
|
|
2960
2961
|
});
|
|
2961
2962
|
return () => u.unsubscribe();
|
|
@@ -3168,13 +3169,13 @@ function Tn({
|
|
|
3168
3169
|
const L = u.map((f) => {
|
|
3169
3170
|
if (!f.children) return null;
|
|
3170
3171
|
const M = f.children.map((H) => {
|
|
3171
|
-
var E,
|
|
3172
|
-
return (
|
|
3172
|
+
var E, T;
|
|
3173
|
+
return (T = (E = H.item) == null ? void 0 : E.hidden$) != null ? T : At(!1);
|
|
3173
3174
|
});
|
|
3174
3175
|
return $t(M).subscribe((H) => {
|
|
3175
|
-
const E = H.every((
|
|
3176
|
-
g((
|
|
3177
|
-
...
|
|
3176
|
+
const E = H.every((T) => T === !0);
|
|
3177
|
+
g((T) => ({
|
|
3178
|
+
...T,
|
|
3178
3179
|
[f.key]: E
|
|
3179
3180
|
}));
|
|
3180
3181
|
});
|
|
@@ -3226,7 +3227,7 @@ function Tn({
|
|
|
3226
3227
|
});
|
|
3227
3228
|
for (const f of m) {
|
|
3228
3229
|
if (!f.item) continue;
|
|
3229
|
-
const { title: M, id: H, commandId: E, icon:
|
|
3230
|
+
const { title: M, id: H, commandId: E, icon: T } = f.item;
|
|
3230
3231
|
if (!M)
|
|
3231
3232
|
throw new Error("Menu item title is required");
|
|
3232
3233
|
L.push({
|
|
@@ -3234,7 +3235,7 @@ function Tn({
|
|
|
3234
3235
|
children: /* @__PURE__ */ b(
|
|
3235
3236
|
rt,
|
|
3236
3237
|
{
|
|
3237
|
-
icon:
|
|
3238
|
+
icon: T,
|
|
3238
3239
|
value: n,
|
|
3239
3240
|
option: {
|
|
3240
3241
|
label: {
|
|
@@ -3266,7 +3267,7 @@ function Tn({
|
|
|
3266
3267
|
const L = [];
|
|
3267
3268
|
for (const f of m)
|
|
3268
3269
|
if (f.item) {
|
|
3269
|
-
const { title: M, id: H, commandId: E, icon:
|
|
3270
|
+
const { title: M, id: H, commandId: E, icon: T } = f.item;
|
|
3270
3271
|
if (!M)
|
|
3271
3272
|
throw new Error("Menu item title is required");
|
|
3272
3273
|
L.push({
|
|
@@ -3274,7 +3275,7 @@ function Tn({
|
|
|
3274
3275
|
children: /* @__PURE__ */ b(
|
|
3275
3276
|
rt,
|
|
3276
3277
|
{
|
|
3277
|
-
icon:
|
|
3278
|
+
icon: T,
|
|
3278
3279
|
value: n,
|
|
3279
3280
|
option: {
|
|
3280
3281
|
label: {
|
|
@@ -3307,13 +3308,13 @@ function Tn({
|
|
|
3307
3308
|
const je = R((e, t) => {
|
|
3308
3309
|
const n = X(ce), r = X($e), i = X(ye), o = X(K1), { value: a, hidden: l, disabled: d, activated: v } = Lo(e), g = (W, q) => {
|
|
3309
3310
|
i.focus(), r.executeCommand(W, q);
|
|
3310
|
-
}, { tooltip: u, shortcut: m, icon: C, title: S, label: L, id: f, commandId: M, type: H, slot: E } = e,
|
|
3311
|
+
}, { tooltip: u, shortcut: m, icon: C, title: S, label: L, id: f, commandId: M, type: H, slot: E } = e, T = n.t(u != null ? u : "") + (m ? ` (${m})` : ""), { selections: w } = e, N = r1(() => vt(w) ? w : new Xe((W) => {
|
|
3311
3312
|
W.next(w);
|
|
3312
|
-
}), [w]),
|
|
3313
|
+
}), [w]), I = m1(N), k = r1(() => vt(C) ? C : new Xe((W) => {
|
|
3313
3314
|
var c1, J;
|
|
3314
|
-
const q = (J = (c1 =
|
|
3315
|
+
const q = (J = (c1 = I == null ? void 0 : I.find((u1) => u1.value === a)) == null ? void 0 : c1.icon) != null ? J : C;
|
|
3315
3316
|
W.next(q);
|
|
3316
|
-
}), [C,
|
|
3317
|
+
}), [C, I, a]), P = m1(k, void 0, !0);
|
|
3317
3318
|
function z(W) {
|
|
3318
3319
|
var P1;
|
|
3319
3320
|
const q = e.selectionsCommandId, c1 = M != null ? M : f, J = (P1 = q != null ? q : M) != null ? P1 : f;
|
|
@@ -3372,7 +3373,7 @@ const je = R((e, t) => {
|
|
|
3372
3373
|
menuId: f,
|
|
3373
3374
|
slot: E,
|
|
3374
3375
|
value: a,
|
|
3375
|
-
options:
|
|
3376
|
+
options: I,
|
|
3376
3377
|
disabled: d,
|
|
3377
3378
|
onOptionSelect: u1,
|
|
3378
3379
|
children: /* @__PURE__ */ b(
|
|
@@ -3402,7 +3403,7 @@ const je = R((e, t) => {
|
|
|
3402
3403
|
menuId: f,
|
|
3403
3404
|
slot: E,
|
|
3404
3405
|
value: a,
|
|
3405
|
-
options:
|
|
3406
|
+
options: I,
|
|
3406
3407
|
disabled: d,
|
|
3407
3408
|
onOptionSelect: u1,
|
|
3408
3409
|
children: /* @__PURE__ */ t1(
|
|
@@ -3477,7 +3478,7 @@ const je = R((e, t) => {
|
|
|
3477
3478
|
ei,
|
|
3478
3479
|
{
|
|
3479
3480
|
ref: t,
|
|
3480
|
-
title:
|
|
3481
|
+
title: T,
|
|
3481
3482
|
placement: "bottom",
|
|
3482
3483
|
children: G()
|
|
3483
3484
|
}
|
|
@@ -3503,13 +3504,13 @@ function _o(e) {
|
|
|
3503
3504
|
}, [n]), Y(() => {
|
|
3504
3505
|
const L = new ResizeObserver((f) => {
|
|
3505
3506
|
requestAnimationFrame(() => {
|
|
3506
|
-
var
|
|
3507
|
-
const H = f[0].target.clientWidth, E = Object.values(o.current),
|
|
3507
|
+
var I, k;
|
|
3508
|
+
const H = f[0].target.clientWidth, E = Object.values(o.current), T = [];
|
|
3508
3509
|
let w = 0;
|
|
3509
|
-
const
|
|
3510
|
+
const N = (k = (I = a.find((P) => P.key === d)) == null ? void 0 : I.children) != null ? k : [];
|
|
3510
3511
|
for (const { el: P, key: z } of E)
|
|
3511
|
-
P && (w += (P == null ? void 0 : P.getBoundingClientRect().width) + 8, w > H - 32 - 8 * (
|
|
3512
|
-
u(
|
|
3512
|
+
P && (w += (P == null ? void 0 : P.getBoundingClientRect().width) + 8, w > H - 32 - 8 * (N.length - 1) && T.push(z));
|
|
3513
|
+
u(T);
|
|
3513
3514
|
});
|
|
3514
3515
|
});
|
|
3515
3516
|
return i.current && L.observe(i.current), () => {
|
|
@@ -3518,11 +3519,11 @@ function _o(e) {
|
|
|
3518
3519
|
}, [a, d]);
|
|
3519
3520
|
const C = r1(() => {
|
|
3520
3521
|
var H, E;
|
|
3521
|
-
const L = (E = (H = a.find((
|
|
3522
|
-
for (const
|
|
3523
|
-
if (
|
|
3524
|
-
const w =
|
|
3525
|
-
w.length > 0 && f.push({ ...
|
|
3522
|
+
const L = (E = (H = a.find((T) => T.key === d)) == null ? void 0 : H.children) != null ? E : [], f = [], M = [];
|
|
3523
|
+
for (const T of L)
|
|
3524
|
+
if (T.children) {
|
|
3525
|
+
const w = T.children.filter((N) => !g.includes(N.key));
|
|
3526
|
+
w.length > 0 && f.push({ ...T, children: w }), w.length < T.children.length && M.push({ ...T, children: T.children.filter((N) => g.includes(N.key)) });
|
|
3526
3527
|
}
|
|
3527
3528
|
return {
|
|
3528
3529
|
allGroups: L,
|
|
@@ -3613,8 +3614,8 @@ function _o(e) {
|
|
|
3613
3614
|
return (((M = L.children) == null ? void 0 : M.length) || L.item) && /* @__PURE__ */ t1(vn, { children: [
|
|
3614
3615
|
/* @__PURE__ */ b("div", { className: "univer-flex univer-flex-nowrap univer-gap-2 univer-px-2", children: L.children ? (H = L.children) == null ? void 0 : H.map((E) => E.item && /* @__PURE__ */ b(je, { ...E.item }, E.key)) : L.item && /* @__PURE__ */ b(je, { ...L.item }, L.key) }),
|
|
3615
3616
|
f < C.visibleGroups.length - 1 && C.visibleGroups.some((E) => {
|
|
3616
|
-
var
|
|
3617
|
-
return ((
|
|
3617
|
+
var T;
|
|
3618
|
+
return ((T = E.children) == null ? void 0 : T.length) || !!E.item;
|
|
3618
3619
|
}) && /* @__PURE__ */ b(e3, {})
|
|
3619
3620
|
] }, L.key);
|
|
3620
3621
|
}),
|
|
@@ -3898,13 +3899,13 @@ function Io(e) {
|
|
|
3898
3899
|
contextMenu: i = !0,
|
|
3899
3900
|
mountContainer: o,
|
|
3900
3901
|
onRendered: a
|
|
3901
|
-
} = e, l = X(ce), d = X(V3), v = X(xe), g = e1(null), u = I1(f1.CUSTOM_HEADER), m = I1(f1.FOOTER), C = I1(f1.HEADER), S = I1(f1.HEADER_MENU), L = I1(f1.CONTENT), f = I1(f1.LEFT_SIDEBAR), M = I1(f1.GLOBAL), H = I1(f1.TOOLBAR), [E,
|
|
3902
|
+
} = e, l = X(ce), d = X(V3), v = X(xe), g = e1(null), u = I1(f1.CUSTOM_HEADER), m = I1(f1.FOOTER), C = I1(f1.HEADER), S = I1(f1.HEADER_MENU), L = I1(f1.CONTENT), f = I1(f1.LEFT_SIDEBAR), M = I1(f1.GLOBAL), H = I1(f1.TOOLBAR), [E, T] = K(null);
|
|
3902
3903
|
Y(() => {
|
|
3903
3904
|
const k = v.focused$.subscribe((P) => {
|
|
3904
3905
|
if (P == null)
|
|
3905
3906
|
return;
|
|
3906
3907
|
const z = v.getUnitType(P), F = v.getUnit(P);
|
|
3907
|
-
z === We.UNIVER_DOC && F &&
|
|
3908
|
+
z === We.UNIVER_DOC && F && T(F.getSnapshot());
|
|
3908
3909
|
});
|
|
3909
3910
|
return () => {
|
|
3910
3911
|
k.unsubscribe();
|
|
@@ -3914,21 +3915,21 @@ function Io(e) {
|
|
|
3914
3915
|
}, []), Y(() => {
|
|
3915
3916
|
g.current && (a == null || a(g.current));
|
|
3916
3917
|
}, [a]);
|
|
3917
|
-
const [w,
|
|
3918
|
+
const [w, N] = K(l.getLocales()), I = r1(() => document.createElement("div"), []);
|
|
3918
3919
|
return Y(() => {
|
|
3919
|
-
document.body.appendChild(
|
|
3920
|
+
document.body.appendChild(I);
|
|
3920
3921
|
const k = [
|
|
3921
3922
|
l.localeChanged$.subscribe(() => {
|
|
3922
|
-
|
|
3923
|
+
N(l.getLocales());
|
|
3923
3924
|
}),
|
|
3924
3925
|
d.currentTheme$.subscribe((P) => {
|
|
3925
|
-
mt.setTheme(o, P),
|
|
3926
|
+
mt.setTheme(o, P), I && mt.setTheme(I, P);
|
|
3926
3927
|
})
|
|
3927
3928
|
];
|
|
3928
3929
|
return () => {
|
|
3929
|
-
k.forEach((P) => P.unsubscribe()), document.body.removeChild(
|
|
3930
|
+
k.forEach((P) => P.unsubscribe()), document.body.removeChild(I);
|
|
3930
3931
|
};
|
|
3931
|
-
}, [l, o,
|
|
3932
|
+
}, [l, o, I, d.currentTheme$]), /* @__PURE__ */ t1(Hr, { locale: w == null ? void 0 : w.design, mountContainer: I, children: [
|
|
3932
3933
|
/* @__PURE__ */ t1("div", { className: Y1.workbenchLayout, tabIndex: -1, onBlur: (k) => k.stopPropagation(), children: [
|
|
3933
3934
|
/* @__PURE__ */ b("div", { className: Y1.workbenchCustomHeader, children: /* @__PURE__ */ b(D1, { components: u }, "custom-header") }),
|
|
3934
3935
|
t && n && /* @__PURE__ */ b("header", { className: Y1.workbenchContainerHeader, children: /* @__PURE__ */ b(
|
|
@@ -4714,19 +4715,19 @@ function wa() {
|
|
|
4714
4715
|
}
|
|
4715
4716
|
u.prototype.catch = function(w) {
|
|
4716
4717
|
return this.then(null, w);
|
|
4717
|
-
}, u.prototype.then = function(w,
|
|
4718
|
-
if (typeof w != "function" && this.state === v || typeof
|
|
4718
|
+
}, u.prototype.then = function(w, N) {
|
|
4719
|
+
if (typeof w != "function" && this.state === v || typeof N != "function" && this.state === d)
|
|
4719
4720
|
return this;
|
|
4720
|
-
var
|
|
4721
|
+
var I = new this.constructor(a);
|
|
4721
4722
|
if (this.state !== g) {
|
|
4722
|
-
var k = this.state === v ? w :
|
|
4723
|
-
C(
|
|
4723
|
+
var k = this.state === v ? w : N;
|
|
4724
|
+
C(I, k, this.outcome);
|
|
4724
4725
|
} else
|
|
4725
|
-
this.queue.push(new m(
|
|
4726
|
-
return
|
|
4726
|
+
this.queue.push(new m(I, w, N));
|
|
4727
|
+
return I;
|
|
4727
4728
|
};
|
|
4728
|
-
function m(w,
|
|
4729
|
-
this.promise = w, typeof
|
|
4729
|
+
function m(w, N, I) {
|
|
4730
|
+
this.promise = w, typeof N == "function" && (this.onFulfilled = N, this.callFulfilled = this.otherCallFulfilled), typeof I == "function" && (this.onRejected = I, this.callRejected = this.otherCallRejected);
|
|
4730
4731
|
}
|
|
4731
4732
|
m.prototype.callFulfilled = function(w) {
|
|
4732
4733
|
l.resolve(this.promise, w);
|
|
@@ -4737,65 +4738,65 @@ function wa() {
|
|
|
4737
4738
|
}, m.prototype.otherCallRejected = function(w) {
|
|
4738
4739
|
C(this.promise, this.onRejected, w);
|
|
4739
4740
|
};
|
|
4740
|
-
function C(w,
|
|
4741
|
+
function C(w, N, I) {
|
|
4741
4742
|
o(function() {
|
|
4742
4743
|
var k;
|
|
4743
4744
|
try {
|
|
4744
|
-
k =
|
|
4745
|
+
k = N(I);
|
|
4745
4746
|
} catch (P) {
|
|
4746
4747
|
return l.reject(w, P);
|
|
4747
4748
|
}
|
|
4748
4749
|
k === w ? l.reject(w, new TypeError("Cannot resolve promise with itself")) : l.resolve(w, k);
|
|
4749
4750
|
});
|
|
4750
4751
|
}
|
|
4751
|
-
l.resolve = function(w,
|
|
4752
|
-
var
|
|
4753
|
-
if (
|
|
4754
|
-
return l.reject(w,
|
|
4755
|
-
var k =
|
|
4752
|
+
l.resolve = function(w, N) {
|
|
4753
|
+
var I = f(S, N);
|
|
4754
|
+
if (I.status === "error")
|
|
4755
|
+
return l.reject(w, I.value);
|
|
4756
|
+
var k = I.value;
|
|
4756
4757
|
if (k)
|
|
4757
4758
|
L(w, k);
|
|
4758
4759
|
else {
|
|
4759
|
-
w.state = v, w.outcome =
|
|
4760
|
+
w.state = v, w.outcome = N;
|
|
4760
4761
|
for (var P = -1, z = w.queue.length; ++P < z; )
|
|
4761
|
-
w.queue[P].callFulfilled(
|
|
4762
|
+
w.queue[P].callFulfilled(N);
|
|
4762
4763
|
}
|
|
4763
4764
|
return w;
|
|
4764
|
-
}, l.reject = function(w,
|
|
4765
|
-
w.state = d, w.outcome =
|
|
4766
|
-
for (var
|
|
4767
|
-
w.queue[
|
|
4765
|
+
}, l.reject = function(w, N) {
|
|
4766
|
+
w.state = d, w.outcome = N;
|
|
4767
|
+
for (var I = -1, k = w.queue.length; ++I < k; )
|
|
4768
|
+
w.queue[I].callRejected(N);
|
|
4768
4769
|
return w;
|
|
4769
4770
|
};
|
|
4770
4771
|
function S(w) {
|
|
4771
|
-
var
|
|
4772
|
-
if (w && (typeof w == "object" || typeof w == "function") && typeof
|
|
4772
|
+
var N = w && w.then;
|
|
4773
|
+
if (w && (typeof w == "object" || typeof w == "function") && typeof N == "function")
|
|
4773
4774
|
return function() {
|
|
4774
|
-
|
|
4775
|
+
N.apply(w, arguments);
|
|
4775
4776
|
};
|
|
4776
4777
|
}
|
|
4777
|
-
function L(w,
|
|
4778
|
-
var
|
|
4778
|
+
function L(w, N) {
|
|
4779
|
+
var I = !1;
|
|
4779
4780
|
function k(G) {
|
|
4780
|
-
|
|
4781
|
+
I || (I = !0, l.reject(w, G));
|
|
4781
4782
|
}
|
|
4782
4783
|
function P(G) {
|
|
4783
|
-
|
|
4784
|
+
I || (I = !0, l.resolve(w, G));
|
|
4784
4785
|
}
|
|
4785
4786
|
function z() {
|
|
4786
|
-
|
|
4787
|
+
N(P, k);
|
|
4787
4788
|
}
|
|
4788
4789
|
var F = f(z);
|
|
4789
4790
|
F.status === "error" && k(F.value);
|
|
4790
4791
|
}
|
|
4791
|
-
function f(w,
|
|
4792
|
-
var
|
|
4792
|
+
function f(w, N) {
|
|
4793
|
+
var I = {};
|
|
4793
4794
|
try {
|
|
4794
|
-
|
|
4795
|
+
I.value = w(N), I.status = "success";
|
|
4795
4796
|
} catch (k) {
|
|
4796
|
-
|
|
4797
|
+
I.status = "error", I.value = k;
|
|
4797
4798
|
}
|
|
4798
|
-
return
|
|
4799
|
+
return I;
|
|
4799
4800
|
}
|
|
4800
4801
|
u.resolve = M;
|
|
4801
4802
|
function M(w) {
|
|
@@ -4803,42 +4804,42 @@ function wa() {
|
|
|
4803
4804
|
}
|
|
4804
4805
|
u.reject = H;
|
|
4805
4806
|
function H(w) {
|
|
4806
|
-
var
|
|
4807
|
-
return l.reject(
|
|
4807
|
+
var N = new this(a);
|
|
4808
|
+
return l.reject(N, w);
|
|
4808
4809
|
}
|
|
4809
4810
|
u.all = E;
|
|
4810
4811
|
function E(w) {
|
|
4811
|
-
var
|
|
4812
|
+
var N = this;
|
|
4812
4813
|
if (Object.prototype.toString.call(w) !== "[object Array]")
|
|
4813
4814
|
return this.reject(new TypeError("must be an array"));
|
|
4814
|
-
var
|
|
4815
|
-
if (!
|
|
4815
|
+
var I = w.length, k = !1;
|
|
4816
|
+
if (!I)
|
|
4816
4817
|
return this.resolve([]);
|
|
4817
|
-
for (var P = new Array(
|
|
4818
|
+
for (var P = new Array(I), z = 0, F = -1, G = new this(a); ++F < I; )
|
|
4818
4819
|
W(w[F], F);
|
|
4819
4820
|
return G;
|
|
4820
4821
|
function W(q, c1) {
|
|
4821
|
-
|
|
4822
|
+
N.resolve(q).then(J, function(u1) {
|
|
4822
4823
|
k || (k = !0, l.reject(G, u1));
|
|
4823
4824
|
});
|
|
4824
4825
|
function J(u1) {
|
|
4825
|
-
P[c1] = u1, ++z ===
|
|
4826
|
+
P[c1] = u1, ++z === I && !k && (k = !0, l.resolve(G, P));
|
|
4826
4827
|
}
|
|
4827
4828
|
}
|
|
4828
4829
|
}
|
|
4829
|
-
u.race =
|
|
4830
|
-
function
|
|
4831
|
-
var
|
|
4830
|
+
u.race = T;
|
|
4831
|
+
function T(w) {
|
|
4832
|
+
var N = this;
|
|
4832
4833
|
if (Object.prototype.toString.call(w) !== "[object Array]")
|
|
4833
4834
|
return this.reject(new TypeError("must be an array"));
|
|
4834
|
-
var
|
|
4835
|
-
if (!
|
|
4835
|
+
var I = w.length, k = !1;
|
|
4836
|
+
if (!I)
|
|
4836
4837
|
return this.resolve([]);
|
|
4837
|
-
for (var P = -1, z = new this(a); ++P <
|
|
4838
|
+
for (var P = -1, z = new this(a); ++P < I; )
|
|
4838
4839
|
F(w[P]);
|
|
4839
4840
|
return z;
|
|
4840
4841
|
function F(G) {
|
|
4841
|
-
|
|
4842
|
+
N.resolve(G).then(function(W) {
|
|
4842
4843
|
k || (k = !0, l.resolve(z, W));
|
|
4843
4844
|
}, function(W) {
|
|
4844
4845
|
k || (k = !0, l.reject(z, W));
|
|
@@ -4921,13 +4922,13 @@ function wa() {
|
|
|
4921
4922
|
if (arguments.length && typeof arguments[arguments.length - 1] == "function")
|
|
4922
4923
|
return arguments[arguments.length - 1];
|
|
4923
4924
|
}
|
|
4924
|
-
var f = "local-forage-detect-blob-support", M = void 0, H = {}, E = Object.prototype.toString,
|
|
4925
|
-
function
|
|
4925
|
+
var f = "local-forage-detect-blob-support", M = void 0, H = {}, E = Object.prototype.toString, T = "readonly", w = "readwrite";
|
|
4926
|
+
function N(s) {
|
|
4926
4927
|
for (var h = s.length, c = new ArrayBuffer(h), y = new Uint8Array(c), _ = 0; _ < h; _++)
|
|
4927
4928
|
y[_] = s.charCodeAt(_);
|
|
4928
4929
|
return c;
|
|
4929
4930
|
}
|
|
4930
|
-
function
|
|
4931
|
+
function I(s) {
|
|
4931
4932
|
return new u(function(h) {
|
|
4932
4933
|
var c = s.transaction(f, w), y = g([""]);
|
|
4933
4934
|
c.objectStore(f).put(y, "key"), c.onabort = function(_) {
|
|
@@ -4941,7 +4942,7 @@ function wa() {
|
|
|
4941
4942
|
});
|
|
4942
4943
|
}
|
|
4943
4944
|
function k(s) {
|
|
4944
|
-
return typeof M == "boolean" ? u.resolve(M) :
|
|
4945
|
+
return typeof M == "boolean" ? u.resolve(M) : I(s).then(function(h) {
|
|
4945
4946
|
return M = h, M;
|
|
4946
4947
|
});
|
|
4947
4948
|
}
|
|
@@ -5026,7 +5027,7 @@ function wa() {
|
|
|
5026
5027
|
});
|
|
5027
5028
|
}
|
|
5028
5029
|
function u1(s) {
|
|
5029
|
-
var h =
|
|
5030
|
+
var h = N(atob(s.data));
|
|
5030
5031
|
return g([h], { type: s.type });
|
|
5031
5032
|
}
|
|
5032
5033
|
function y1(s) {
|
|
@@ -5121,7 +5122,7 @@ function wa() {
|
|
|
5121
5122
|
s = S(s);
|
|
5122
5123
|
var y = new u(function(_, p) {
|
|
5123
5124
|
c.ready().then(function() {
|
|
5124
|
-
i1(c._dbInfo,
|
|
5125
|
+
i1(c._dbInfo, T, function(x, D) {
|
|
5125
5126
|
if (x)
|
|
5126
5127
|
return p(x);
|
|
5127
5128
|
try {
|
|
@@ -5143,7 +5144,7 @@ function wa() {
|
|
|
5143
5144
|
function n1(s, h) {
|
|
5144
5145
|
var c = this, y = new u(function(_, p) {
|
|
5145
5146
|
c.ready().then(function() {
|
|
5146
|
-
i1(c._dbInfo,
|
|
5147
|
+
i1(c._dbInfo, T, function(x, D) {
|
|
5147
5148
|
if (x)
|
|
5148
5149
|
return p(x);
|
|
5149
5150
|
try {
|
|
@@ -5250,7 +5251,7 @@ function wa() {
|
|
|
5250
5251
|
function ee(s) {
|
|
5251
5252
|
var h = this, c = new u(function(y, _) {
|
|
5252
5253
|
h.ready().then(function() {
|
|
5253
|
-
i1(h._dbInfo,
|
|
5254
|
+
i1(h._dbInfo, T, function(p, x) {
|
|
5254
5255
|
if (p)
|
|
5255
5256
|
return _(p);
|
|
5256
5257
|
try {
|
|
@@ -5275,7 +5276,7 @@ function wa() {
|
|
|
5275
5276
|
return;
|
|
5276
5277
|
}
|
|
5277
5278
|
c.ready().then(function() {
|
|
5278
|
-
i1(c._dbInfo,
|
|
5279
|
+
i1(c._dbInfo, T, function(x, D) {
|
|
5279
5280
|
if (x)
|
|
5280
5281
|
return p(x);
|
|
5281
5282
|
try {
|
|
@@ -5301,7 +5302,7 @@ function wa() {
|
|
|
5301
5302
|
function Oe(s) {
|
|
5302
5303
|
var h = this, c = new u(function(y, _) {
|
|
5303
5304
|
h.ready().then(function() {
|
|
5304
|
-
i1(h._dbInfo,
|
|
5305
|
+
i1(h._dbInfo, T, function(p, x) {
|
|
5305
5306
|
if (p)
|
|
5306
5307
|
return _(p);
|
|
5307
5308
|
try {
|
|
@@ -6753,7 +6754,7 @@ const d7 = function(e, t, n) {
|
|
|
6753
6754
|
}, []), [u, o];
|
|
6754
6755
|
};
|
|
6755
6756
|
function f7(e, t, n, r) {
|
|
6756
|
-
var i = r.motionEnter, o = i === void 0 ? !0 : i, a = r.motionAppear, l = a === void 0 ? !0 : a, d = r.motionLeave, v = d === void 0 ? !0 : d, g = r.motionDeadline, u = r.motionLeaveImmediately, m = r.onAppearPrepare, C = r.onEnterPrepare, S = r.onLeavePrepare, L = r.onAppearStart, f = r.onEnterStart, M = r.onLeaveStart, H = r.onAppearActive, E = r.onEnterActive,
|
|
6757
|
+
var i = r.motionEnter, o = i === void 0 ? !0 : i, a = r.motionAppear, l = a === void 0 ? !0 : a, d = r.motionLeave, v = d === void 0 ? !0 : d, g = r.motionDeadline, u = r.motionLeaveImmediately, m = r.onAppearPrepare, C = r.onEnterPrepare, S = r.onLeavePrepare, L = r.onAppearStart, f = r.onEnterStart, M = r.onLeaveStart, H = r.onAppearActive, E = r.onEnterActive, T = r.onLeaveActive, w = r.onAppearEnd, N = r.onEnterEnd, I = r.onLeaveEnd, k = r.onVisibleChanged, P = L3(), z = M1(P, 2), F = z[0], G = z[1], W = n7(Ce), q = M1(W, 2), c1 = q[0], J = q[1], u1 = L3(null), y1 = M1(u1, 2), x1 = y1[0], P1 = y1[1], i1 = c1(), R1 = e1(!1), O1 = e1(null);
|
|
6757
6758
|
function w1() {
|
|
6758
6759
|
return n();
|
|
6759
6760
|
}
|
|
@@ -6767,7 +6768,7 @@ function f7(e, t, n, r) {
|
|
|
6767
6768
|
var V1 = w1();
|
|
6768
6769
|
if (!(h1 && !h1.deadline && h1.target !== V1)) {
|
|
6769
6770
|
var ue = n1.current, z1;
|
|
6770
|
-
d1 === at && ue ? z1 = w == null ? void 0 : w(V1, h1) : d1 === st && ue ? z1 =
|
|
6771
|
+
d1 === at && ue ? z1 = w == null ? void 0 : w(V1, h1) : d1 === st && ue ? z1 = N == null ? void 0 : N(V1, h1) : d1 === lt && ue && (z1 = I == null ? void 0 : I(V1, h1)), ue && z1 !== !1 && g1();
|
|
6771
6772
|
}
|
|
6772
6773
|
}
|
|
6773
6774
|
}), Le = a7(he), ee = M1(Le, 1), j1 = ee[0], Oe = function(d1) {
|
|
@@ -6777,7 +6778,7 @@ function f7(e, t, n, r) {
|
|
|
6777
6778
|
case st:
|
|
6778
6779
|
return S1(S1(S1({}, X1, C), Ie, f), De, E);
|
|
6779
6780
|
case lt:
|
|
6780
|
-
return S1(S1(S1({}, X1, S), Ie, M), De,
|
|
6781
|
+
return S1(S1(S1({}, X1, S), Ie, M), De, T);
|
|
6781
6782
|
default:
|
|
6782
6783
|
return {};
|
|
6783
6784
|
}
|
|
@@ -6833,14 +6834,14 @@ function h7(e) {
|
|
|
6833
6834
|
}
|
|
6834
6835
|
var r = /* @__PURE__ */ j.forwardRef(function(i, o) {
|
|
6835
6836
|
var a = i.visible, l = a === void 0 ? !0 : a, d = i.removeOnLeave, v = d === void 0 ? !0 : d, g = i.forceRender, u = i.children, m = i.motionName, C = i.leavedClassName, S = i.eventProps, L = j.useContext(ja), f = L.motion, M = n(i, f), H = e1(), E = e1();
|
|
6836
|
-
function
|
|
6837
|
+
function T() {
|
|
6837
6838
|
try {
|
|
6838
6839
|
return H.current instanceof HTMLElement ? H.current : Ba(E.current);
|
|
6839
6840
|
} catch {
|
|
6840
6841
|
return null;
|
|
6841
6842
|
}
|
|
6842
6843
|
}
|
|
6843
|
-
var w = f7(M, l,
|
|
6844
|
+
var w = f7(M, l, T, i), N = M1(w, 4), I = N[0], k = N[1], P = N[2], z = N[3], F = j.useRef(z);
|
|
6844
6845
|
z && (F.current = !0);
|
|
6845
6846
|
var G = j.useCallback(function(x1) {
|
|
6846
6847
|
H.current = x1, Ua(o, x1);
|
|
@@ -6849,7 +6850,7 @@ function h7(e) {
|
|
|
6849
6850
|
});
|
|
6850
6851
|
if (!u)
|
|
6851
6852
|
W = null;
|
|
6852
|
-
else if (
|
|
6853
|
+
else if (I === Ce)
|
|
6853
6854
|
z ? W = u(l1({}, q), G) : !v && F.current && C ? W = u(l1(l1({}, q), {}, {
|
|
6854
6855
|
className: C
|
|
6855
6856
|
}), G) : g || !v && !C ? W = u(l1(l1({}, q), {}, {
|
|
@@ -6860,9 +6861,9 @@ function h7(e) {
|
|
|
6860
6861
|
else {
|
|
6861
6862
|
var c1;
|
|
6862
6863
|
k === X1 ? c1 = "prepare" : Oi(k) ? c1 = "active" : k === Ie && (c1 = "start");
|
|
6863
|
-
var J = tr(m, "".concat(
|
|
6864
|
+
var J = tr(m, "".concat(I, "-").concat(c1));
|
|
6864
6865
|
W = u(l1(l1({}, q), {}, {
|
|
6865
|
-
className: Ge(tr(m,
|
|
6866
|
+
className: Ge(tr(m, I), S1(S1({}, J, J && c1), m, typeof m == "string")),
|
|
6866
6867
|
style: P
|
|
6867
6868
|
}), G);
|
|
6868
6869
|
}
|
|
@@ -6966,23 +6967,23 @@ function y7(e) {
|
|
|
6966
6967
|
return b7.forEach(function(M) {
|
|
6967
6968
|
f[M] = S[M], delete S[M];
|
|
6968
6969
|
}), delete S.keys, /* @__PURE__ */ j.createElement(L, S, d.map(function(M, H) {
|
|
6969
|
-
var E = M.status,
|
|
6970
|
+
var E = M.status, T = Ot(M, p7), w = E === S3 || E === M3;
|
|
6970
6971
|
return /* @__PURE__ */ j.createElement(t, He({}, f, {
|
|
6971
|
-
key:
|
|
6972
|
+
key: T.key,
|
|
6972
6973
|
visible: w,
|
|
6973
|
-
eventProps:
|
|
6974
|
-
onVisibleChanged: function(
|
|
6975
|
-
if (m == null || m(
|
|
6976
|
-
key:
|
|
6977
|
-
}), !
|
|
6978
|
-
var k = l.removeKey(
|
|
6974
|
+
eventProps: T,
|
|
6975
|
+
onVisibleChanged: function(I) {
|
|
6976
|
+
if (m == null || m(I, {
|
|
6977
|
+
key: T.key
|
|
6978
|
+
}), !I) {
|
|
6979
|
+
var k = l.removeKey(T.key);
|
|
6979
6980
|
k === 0 && C && C();
|
|
6980
6981
|
}
|
|
6981
6982
|
}
|
|
6982
|
-
}), function(
|
|
6983
|
-
return u(l1(l1({},
|
|
6983
|
+
}), function(N, I) {
|
|
6984
|
+
return u(l1(l1({}, N), {}, {
|
|
6984
6985
|
index: H
|
|
6985
|
-
}),
|
|
6986
|
+
}), I);
|
|
6986
6987
|
});
|
|
6987
6988
|
}));
|
|
6988
6989
|
}
|
|
@@ -7052,7 +7053,7 @@ function x7(e) {
|
|
|
7052
7053
|
}), r;
|
|
7053
7054
|
}
|
|
7054
7055
|
var R7 = /* @__PURE__ */ j.forwardRef(function(e, t) {
|
|
7055
|
-
var n = e.prefixCls, r = e.style, i = e.className, o = e.duration, a = o === void 0 ? 4.5 : o, l = e.showProgress, d = e.pauseOnHover, v = d === void 0 ? !0 : d, g = e.eventKey, u = e.content, m = e.closable, C = e.closeIcon, S = C === void 0 ? "x" : C, L = e.props, f = e.onClick, M = e.onNoticeClose, H = e.times, E = e.hovering,
|
|
7056
|
+
var n = e.prefixCls, r = e.style, i = e.className, o = e.duration, a = o === void 0 ? 4.5 : o, l = e.showProgress, d = e.pauseOnHover, v = d === void 0 ? !0 : d, g = e.eventKey, u = e.content, m = e.closable, C = e.closeIcon, S = C === void 0 ? "x" : C, L = e.props, f = e.onClick, M = e.onNoticeClose, H = e.times, E = e.hovering, T = j.useState(!1), w = M1(T, 2), N = w[0], I = w[1], k = j.useState(0), P = M1(k, 2), z = P[0], F = P[1], G = j.useState(0), W = M1(G, 2), q = W[0], c1 = W[1], J = E || N, u1 = a > 0 && l, y1 = function() {
|
|
7056
7057
|
M(g);
|
|
7057
7058
|
}, x1 = function(n1) {
|
|
7058
7059
|
(n1.key === "Enter" || n1.code === "Enter" || n1.keyCode === _7.ENTER) && y1();
|
|
@@ -7090,11 +7091,11 @@ var R7 = /* @__PURE__ */ j.forwardRef(function(e, t) {
|
|
|
7090
7091
|
style: r,
|
|
7091
7092
|
onMouseEnter: function(n1) {
|
|
7092
7093
|
var g1;
|
|
7093
|
-
|
|
7094
|
+
I(!0), L == null || (g1 = L.onMouseEnter) === null || g1 === void 0 || g1.call(L, n1);
|
|
7094
7095
|
},
|
|
7095
7096
|
onMouseLeave: function(n1) {
|
|
7096
7097
|
var g1;
|
|
7097
|
-
|
|
7098
|
+
I(!1), L == null || (g1 = L.onMouseLeave) === null || g1 === void 0 || g1.call(L, n1);
|
|
7098
7099
|
},
|
|
7099
7100
|
onClick: f
|
|
7100
7101
|
}), /* @__PURE__ */ j.createElement("div", {
|
|
@@ -7125,49 +7126,49 @@ var R7 = /* @__PURE__ */ j.forwardRef(function(e, t) {
|
|
|
7125
7126
|
}
|
|
7126
7127
|
return [!!t, n];
|
|
7127
7128
|
}, T7 = ["className", "style", "classNames", "styles"], N7 = function(t) {
|
|
7128
|
-
var n = t.configList, r = t.placement, i = t.prefixCls, o = t.className, a = t.style, l = t.motion, d = t.onAllNoticeRemoved, v = t.onNoticeClose, g = t.stack, u = Pe(O7), m = u.classNames, C = e1({}), S = K(null), L = M1(S, 2), f = L[0], M = L[1], H = K([]), E = M1(H, 2),
|
|
7129
|
+
var n = t.configList, r = t.placement, i = t.prefixCls, o = t.className, a = t.style, l = t.motion, d = t.onAllNoticeRemoved, v = t.onNoticeClose, g = t.stack, u = Pe(O7), m = u.classNames, C = e1({}), S = K(null), L = M1(S, 2), f = L[0], M = L[1], H = K([]), E = M1(H, 2), T = E[0], w = E[1], N = n.map(function(J) {
|
|
7129
7130
|
return {
|
|
7130
7131
|
config: J,
|
|
7131
7132
|
key: String(J.key)
|
|
7132
7133
|
};
|
|
7133
|
-
}),
|
|
7134
|
+
}), I = V7(g), k = M1(I, 2), P = k[0], z = k[1], F = z.offset, G = z.threshold, W = z.gap, q = P && (T.length > 0 || N.length <= G), c1 = typeof l == "function" ? l(r) : l;
|
|
7134
7135
|
return Y(function() {
|
|
7135
|
-
P &&
|
|
7136
|
+
P && T.length > 1 && w(function(J) {
|
|
7136
7137
|
return J.filter(function(u1) {
|
|
7137
|
-
return
|
|
7138
|
+
return N.some(function(y1) {
|
|
7138
7139
|
var x1 = y1.key;
|
|
7139
7140
|
return u1 === x1;
|
|
7140
7141
|
});
|
|
7141
7142
|
});
|
|
7142
7143
|
});
|
|
7143
|
-
}, [
|
|
7144
|
+
}, [T, N, P]), Y(function() {
|
|
7144
7145
|
var J;
|
|
7145
|
-
if (P && C.current[(J =
|
|
7146
|
+
if (P && C.current[(J = N[N.length - 1]) === null || J === void 0 ? void 0 : J.key]) {
|
|
7146
7147
|
var u1;
|
|
7147
|
-
M(C.current[(u1 =
|
|
7148
|
+
M(C.current[(u1 = N[N.length - 1]) === null || u1 === void 0 ? void 0 : u1.key]);
|
|
7148
7149
|
}
|
|
7149
|
-
}, [
|
|
7150
|
+
}, [N, P]), /* @__PURE__ */ be.createElement(L7, He({
|
|
7150
7151
|
key: r,
|
|
7151
7152
|
className: Ge(i, "".concat(i, "-").concat(r), m == null ? void 0 : m.list, o, S1(S1({}, "".concat(i, "-stack"), !!P), "".concat(i, "-stack-expanded"), q)),
|
|
7152
7153
|
style: a,
|
|
7153
|
-
keys:
|
|
7154
|
+
keys: N,
|
|
7154
7155
|
motionAppear: !0
|
|
7155
7156
|
}, c1, {
|
|
7156
7157
|
onAllRemoved: function() {
|
|
7157
7158
|
d(r);
|
|
7158
7159
|
}
|
|
7159
7160
|
}), function(J, u1) {
|
|
7160
|
-
var y1 = J.config, x1 = J.className, P1 = J.style, i1 = J.index, R1 = y1, O1 = R1.key, w1 = R1.times, n1 = String(O1), g1 = y1, he = g1.className, Le = g1.style, ee = g1.classNames, j1 = g1.styles, Oe = Ot(g1, T7), W1 =
|
|
7161
|
+
var y1 = J.config, x1 = J.className, P1 = J.style, i1 = J.index, R1 = y1, O1 = R1.key, w1 = R1.times, n1 = String(O1), g1 = y1, he = g1.className, Le = g1.style, ee = g1.classNames, j1 = g1.styles, Oe = Ot(g1, T7), W1 = N.findIndex(function(z1) {
|
|
7161
7162
|
return z1.key === n1;
|
|
7162
7163
|
}), ve = {};
|
|
7163
7164
|
if (P) {
|
|
7164
|
-
var te =
|
|
7165
|
+
var te = N.length - 1 - (W1 > -1 ? W1 : i1 - 1), A1 = r === "top" || r === "bottom" ? "-50%" : "0";
|
|
7165
7166
|
if (te > 0) {
|
|
7166
7167
|
var $1, me, B1;
|
|
7167
7168
|
ve.height = q ? ($1 = C.current[n1]) === null || $1 === void 0 ? void 0 : $1.offsetHeight : f == null ? void 0 : f.offsetHeight;
|
|
7168
7169
|
for (var ne = 0, h1 = 0; h1 < te; h1++) {
|
|
7169
7170
|
var d1;
|
|
7170
|
-
ne += ((d1 = C.current[
|
|
7171
|
+
ne += ((d1 = C.current[N[N.length - 1 - h1].key]) === null || d1 === void 0 ? void 0 : d1.offsetHeight) + W;
|
|
7171
7172
|
}
|
|
7172
7173
|
var V1 = (q ? ne : te * F) * (r.startsWith("top") ? 1 : -1), ue = !q && f !== null && f !== void 0 && f.offsetWidth && (me = C.current[n1]) !== null && me !== void 0 && me.offsetWidth ? ((f == null ? void 0 : f.offsetWidth) - F * 2 * (te < 3 ? te : 3)) / ((B1 = C.current[n1]) === null || B1 === void 0 ? void 0 : B1.offsetWidth) : 1;
|
|
7173
7174
|
ve.transform = "translate3d(".concat(A1, ", ").concat(V1, "px, 0) scaleX(").concat(ue, ")");
|
|
@@ -7203,7 +7204,7 @@ var R7 = /* @__PURE__ */ j.forwardRef(function(e, t) {
|
|
|
7203
7204
|
key: O1,
|
|
7204
7205
|
eventKey: O1,
|
|
7205
7206
|
onNoticeClose: v,
|
|
7206
|
-
hovering: P &&
|
|
7207
|
+
hovering: P && T.length > 0
|
|
7207
7208
|
})));
|
|
7208
7209
|
});
|
|
7209
7210
|
}, I7 = /* @__PURE__ */ j.forwardRef(function(e, t) {
|
|
@@ -7240,7 +7241,7 @@ var R7 = /* @__PURE__ */ j.forwardRef(function(e, t) {
|
|
|
7240
7241
|
}
|
|
7241
7242
|
};
|
|
7242
7243
|
});
|
|
7243
|
-
var M = j.useState({}), H = M1(M, 2), E = H[0],
|
|
7244
|
+
var M = j.useState({}), H = M1(M, 2), E = H[0], T = H[1];
|
|
7244
7245
|
j.useEffect(function() {
|
|
7245
7246
|
var k = {};
|
|
7246
7247
|
S.forEach(function(P) {
|
|
@@ -7248,20 +7249,20 @@ var R7 = /* @__PURE__ */ j.forwardRef(function(e, t) {
|
|
|
7248
7249
|
F && (k[F] = k[F] || [], k[F].push(P));
|
|
7249
7250
|
}), Object.keys(E).forEach(function(P) {
|
|
7250
7251
|
k[P] = k[P] || [];
|
|
7251
|
-
}),
|
|
7252
|
+
}), T(k);
|
|
7252
7253
|
}, [S]);
|
|
7253
7254
|
var w = function(P) {
|
|
7254
|
-
|
|
7255
|
+
T(function(z) {
|
|
7255
7256
|
var F = l1({}, z), G = F[P] || [];
|
|
7256
7257
|
return G.length || delete F[P], F;
|
|
7257
7258
|
});
|
|
7258
|
-
},
|
|
7259
|
+
}, N = j.useRef(!1);
|
|
7259
7260
|
if (j.useEffect(function() {
|
|
7260
|
-
Object.keys(E).length > 0 ?
|
|
7261
|
+
Object.keys(E).length > 0 ? N.current = !0 : N.current && (v == null || v(), N.current = !1);
|
|
7261
7262
|
}, [E]), !i)
|
|
7262
7263
|
return null;
|
|
7263
|
-
var
|
|
7264
|
-
return /* @__PURE__ */ k3(/* @__PURE__ */ j.createElement(j.Fragment, null,
|
|
7264
|
+
var I = Object.keys(E);
|
|
7265
|
+
return /* @__PURE__ */ k3(/* @__PURE__ */ j.createElement(j.Fragment, null, I.map(function(k) {
|
|
7265
7266
|
var P = E[k], z = /* @__PURE__ */ j.createElement(N7, {
|
|
7266
7267
|
key: k,
|
|
7267
7268
|
configList: P,
|
|
@@ -7304,7 +7305,7 @@ function $7() {
|
|
|
7304
7305
|
onAllRemoved: d,
|
|
7305
7306
|
stack: v,
|
|
7306
7307
|
renderNotifications: g
|
|
7307
|
-
}), H = j.useState([]), E = M1(H, 2),
|
|
7308
|
+
}), H = j.useState([]), E = M1(H, 2), T = E[0], w = E[1], N = j.useMemo(function() {
|
|
7308
7309
|
return {
|
|
7309
7310
|
open: function(k) {
|
|
7310
7311
|
var P = A7(u, k);
|
|
@@ -7335,24 +7336,24 @@ function $7() {
|
|
|
7335
7336
|
return j.useEffect(function() {
|
|
7336
7337
|
L(n());
|
|
7337
7338
|
}), j.useEffect(function() {
|
|
7338
|
-
f.current &&
|
|
7339
|
-
switch (
|
|
7339
|
+
f.current && T.length && (T.forEach(function(I) {
|
|
7340
|
+
switch (I.type) {
|
|
7340
7341
|
case "open":
|
|
7341
|
-
f.current.open(
|
|
7342
|
+
f.current.open(I.config);
|
|
7342
7343
|
break;
|
|
7343
7344
|
case "close":
|
|
7344
|
-
f.current.close(
|
|
7345
|
+
f.current.close(I.key);
|
|
7345
7346
|
break;
|
|
7346
7347
|
case "destroy":
|
|
7347
7348
|
f.current.destroy();
|
|
7348
7349
|
break;
|
|
7349
7350
|
}
|
|
7350
|
-
}), w(function(
|
|
7351
|
-
return
|
|
7352
|
-
return !
|
|
7351
|
+
}), w(function(I) {
|
|
7352
|
+
return I.filter(function(k) {
|
|
7353
|
+
return !T.includes(k);
|
|
7353
7354
|
});
|
|
7354
7355
|
}));
|
|
7355
|
-
}, [
|
|
7356
|
+
}, [T]), [N, M];
|
|
7356
7357
|
}
|
|
7357
7358
|
const P7 = "univer-notification", B7 = "univer-notification-icon", z7 = "univer-notification-icon-success", F7 = "univer-notification-icon-info", U7 = "univer-notification-icon-warning", Z7 = "univer-notification-icon-error", j7 = "univer-notification-content-container", W7 = "univer-notification-title", Y7 = "univer-notification-content", G7 = "univer-notification-content-ellipsis", X7 = "univer-notification-fade", q1 = {
|
|
7358
7359
|
notification: P7,
|
|
@@ -8059,13 +8060,13 @@ function ls(e) {
|
|
|
8059
8060
|
if (u !== o) {
|
|
8060
8061
|
if (t[d][u] == null) {
|
|
8061
8062
|
t[d][u] = C;
|
|
8062
|
-
const E = (M = Number(m.getAttribute("rowSpan"))) != null ? M : 1,
|
|
8063
|
-
if (E > 1 ||
|
|
8064
|
-
const w = { rs: +E - 1, cs: +
|
|
8063
|
+
const E = (M = Number(m.getAttribute("rowSpan"))) != null ? M : 1, T = (H = Number(m.getAttribute("colSpan"))) != null ? H : 1;
|
|
8064
|
+
if (E > 1 || T > 1) {
|
|
8065
|
+
const w = { rs: +E - 1, cs: +T - 1, r: d, c: u };
|
|
8065
8066
|
t[d][u].mc = w;
|
|
8066
|
-
for (let
|
|
8067
|
-
for (let
|
|
8068
|
-
|
|
8067
|
+
for (let N = 0; N < E; N++)
|
|
8068
|
+
for (let I = 0; I < T; I++)
|
|
8069
|
+
N === 0 && I === 0 || (t[d + N][u + I] = { mc: null });
|
|
8069
8070
|
}
|
|
8070
8071
|
}
|
|
8071
8072
|
u++;
|