zs_library 0.6.11 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { initReactI18next as Ko } from "react-i18next";
|
|
|
7
7
|
import { jsx as s, jsxs as T, Fragment as Ce } from "react/jsx-runtime";
|
|
8
8
|
import * as ae from "react";
|
|
9
9
|
import { createContext as zt, useMemo as te, useContext as Te, useState as R, useRef as oe, useCallback as le, useEffect as X, forwardRef as Ve, useImperativeHandle as et, memo as De, Fragment as Jo, useLayoutEffect as Qo, cloneElement as en } from "react";
|
|
10
|
-
import { css as D, cx as
|
|
10
|
+
import { css as D, cx as L } from "@emotion/css";
|
|
11
11
|
import tn from "react-slick";
|
|
12
12
|
import { ReactSortable as mt } from "react-sortablejs";
|
|
13
13
|
import { useLocalStorageState as on, useDebounceEffect as nn, useRequest as rn } from "ahooks";
|
|
@@ -448,18 +448,18 @@ const fo = zt({
|
|
|
448
448
|
onChange: r,
|
|
449
449
|
storageKey: n = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
450
450
|
enableCaching: a = !0
|
|
451
|
-
} = t, [i, l] = R(), [m, p] = R(), [
|
|
451
|
+
} = t, [i, l] = R(), [m, p] = R(), [c, u] = R(null), f = oe(c), [d, S] = R(null), [v, z] = R([]), [y, N] = R(null), [g, b] = R(null), [x, k] = R(!1), [A, I] = R(null), [P, B] = R(null), [J, j] = R(null), [F, E] = R(0), [G, se] = R(!1), [Z, Y] = on(n, {
|
|
452
452
|
defaultValue: [],
|
|
453
453
|
listenStorageChange: !0
|
|
454
454
|
}), re = () => {
|
|
455
|
-
|
|
455
|
+
S(null), clearTimeout(i), l(void 0), f.current = null;
|
|
456
456
|
}, de = (O, q) => {
|
|
457
457
|
let U = O.target;
|
|
458
458
|
for (; U && !U.getAttribute("data-id"); )
|
|
459
459
|
U = U.parentElement;
|
|
460
460
|
U || (U = O.target);
|
|
461
461
|
const _ = U.getBoundingClientRect();
|
|
462
|
-
|
|
462
|
+
S({
|
|
463
463
|
rect: _,
|
|
464
464
|
pageX: O.pageX,
|
|
465
465
|
pageY: O.pageY,
|
|
@@ -492,10 +492,10 @@ const fo = zt({
|
|
|
492
492
|
if (U.length > 0)
|
|
493
493
|
z((_) => {
|
|
494
494
|
const ee = [..._], K = (h) => {
|
|
495
|
-
var
|
|
495
|
+
var M, H;
|
|
496
496
|
const C = U.shift(), w = h.find(($) => $.id === C), W = h.findIndex(($) => $.id === C);
|
|
497
497
|
if (U.length && w) {
|
|
498
|
-
if (((
|
|
498
|
+
if (((M = w.children) == null ? void 0 : M.filter(($) => !O.some((ge) => ge.id === $.id)).length) === 1 && O.length === 1) {
|
|
499
499
|
const $ = { ...O[0] };
|
|
500
500
|
return h.splice(W, 1, $), r == null || r(h), h;
|
|
501
501
|
}
|
|
@@ -559,7 +559,7 @@ const fo = zt({
|
|
|
559
559
|
if (_.length === 0)
|
|
560
560
|
return;
|
|
561
561
|
const ee = (K, h) => {
|
|
562
|
-
const C = h.shift(), w = K.find((
|
|
562
|
+
const C = h.shift(), w = K.find((M) => M.id === C), W = K.findIndex((M) => M.id === C);
|
|
563
563
|
return w && (h.length ? w.children = ee(w.children || [], h) : w.children = [
|
|
564
564
|
...w.children ?? [],
|
|
565
565
|
{
|
|
@@ -592,8 +592,8 @@ const fo = zt({
|
|
|
592
592
|
X(() => {
|
|
593
593
|
(o == null ? void 0 : o.length) > 0 && v.length === 0 && ie(o);
|
|
594
594
|
}, [o]), X(() => {
|
|
595
|
-
f.current =
|
|
596
|
-
}, [
|
|
595
|
+
f.current = c, c !== null && re();
|
|
596
|
+
}, [c]), X(() => {
|
|
597
597
|
a && Z != null && Z.length && !G && (ie(Z), se(!0));
|
|
598
598
|
}, [Z, G, a, ie]), nn(
|
|
599
599
|
() => {
|
|
@@ -613,14 +613,14 @@ const fo = zt({
|
|
|
613
613
|
value: {
|
|
614
614
|
list: v,
|
|
615
615
|
setList: ie,
|
|
616
|
-
contextMenu:
|
|
617
|
-
setContextMenu:
|
|
618
|
-
listStatus:
|
|
616
|
+
contextMenu: d,
|
|
617
|
+
setContextMenu: S,
|
|
618
|
+
listStatus: c,
|
|
619
619
|
setListStatus: u,
|
|
620
620
|
contextMenuFuns: fe,
|
|
621
621
|
hideContextMenu: re,
|
|
622
622
|
showInfoItemData: y,
|
|
623
|
-
setShowInfoItemData:
|
|
623
|
+
setShowInfoItemData: N,
|
|
624
624
|
openGroupItemData: g,
|
|
625
625
|
setOpenGroupItemData: b,
|
|
626
626
|
longPressTriggered: x,
|
|
@@ -632,7 +632,7 @@ const fo = zt({
|
|
|
632
632
|
updateRootItem: xe,
|
|
633
633
|
removeRootItem: me,
|
|
634
634
|
moveItemId: A,
|
|
635
|
-
setMoveItemId:
|
|
635
|
+
setMoveItemId: I,
|
|
636
636
|
moveTargetId: P,
|
|
637
637
|
setMoveTargetId: B,
|
|
638
638
|
dragItem: J,
|
|
@@ -656,23 +656,23 @@ const fo = zt({
|
|
|
656
656
|
containerRef: l,
|
|
657
657
|
onCreateNewPage: m
|
|
658
658
|
}, p) => {
|
|
659
|
-
const
|
|
660
|
-
|
|
659
|
+
const c = oe(null), [u, f] = R(null), d = oe(0), S = oe(!1), v = le(() => {
|
|
660
|
+
c.current && (clearTimeout(c.current), c.current = null), S.current = !1;
|
|
661
661
|
}, []), z = le(
|
|
662
662
|
(x) => {
|
|
663
663
|
if (!n) return;
|
|
664
664
|
const k = e >= o - 1, A = typeof r == "number" && o >= r;
|
|
665
665
|
if (x === "right" && k && A)
|
|
666
666
|
return;
|
|
667
|
-
const
|
|
668
|
-
|
|
667
|
+
const I = Date.now();
|
|
668
|
+
S.current || I - d.current < a + 200 || u !== x && (f(x), v(), c.current = setTimeout(() => {
|
|
669
669
|
const P = t.current;
|
|
670
670
|
if (!P) {
|
|
671
671
|
f(null);
|
|
672
672
|
return;
|
|
673
673
|
}
|
|
674
|
-
|
|
675
|
-
|
|
674
|
+
S.current = !0, d.current = Date.now(), x === "left" && e > 0 ? P.slickGoTo(e - 1) : x === "right" && (e < o - 1 ? P.slickGoTo(e + 1) : A || m == null || m()), f(null), setTimeout(() => {
|
|
675
|
+
S.current = !1;
|
|
676
676
|
}, 300);
|
|
677
677
|
}, a));
|
|
678
678
|
},
|
|
@@ -689,14 +689,14 @@ const fo = zt({
|
|
|
689
689
|
]
|
|
690
690
|
), y = le(() => {
|
|
691
691
|
f(null), v();
|
|
692
|
-
}, [v]),
|
|
692
|
+
}, [v]), N = le(
|
|
693
693
|
(x) => {
|
|
694
694
|
if (!n || !l.current)
|
|
695
695
|
return;
|
|
696
|
-
const k = l.current.getBoundingClientRect(), A = x.clientX - k.left,
|
|
696
|
+
const k = l.current.getBoundingClientRect(), A = x.clientX - k.left, I = k.width - i;
|
|
697
697
|
if (A < i && e > 0)
|
|
698
698
|
z("left");
|
|
699
|
-
else if (A >
|
|
699
|
+
else if (A > I) {
|
|
700
700
|
const P = e >= o - 1, B = typeof r == "number" && o >= r;
|
|
701
701
|
if (P && B)
|
|
702
702
|
return;
|
|
@@ -719,13 +719,13 @@ const fo = zt({
|
|
|
719
719
|
et(
|
|
720
720
|
p,
|
|
721
721
|
() => ({
|
|
722
|
-
handleDragMove:
|
|
722
|
+
handleDragMove: N
|
|
723
723
|
}),
|
|
724
|
-
[
|
|
724
|
+
[N]
|
|
725
725
|
), X(() => () => {
|
|
726
726
|
v();
|
|
727
727
|
}, [v]), X(() => {
|
|
728
|
-
n || (v(), f(null),
|
|
728
|
+
n || (v(), f(null), S.current = !1, d.current = 0);
|
|
729
729
|
}, [n, v]);
|
|
730
730
|
const g = D`
|
|
731
731
|
position: absolute;
|
|
@@ -794,7 +794,7 @@ const fo = zt({
|
|
|
794
794
|
e > 0 && /* @__PURE__ */ s(
|
|
795
795
|
"div",
|
|
796
796
|
{
|
|
797
|
-
className:
|
|
797
|
+
className: L(g, "left", u === "left" && "active"),
|
|
798
798
|
onMouseEnter: () => {
|
|
799
799
|
n && z("left");
|
|
800
800
|
},
|
|
@@ -806,7 +806,7 @@ const fo = zt({
|
|
|
806
806
|
/* @__PURE__ */ s(
|
|
807
807
|
"div",
|
|
808
808
|
{
|
|
809
|
-
className:
|
|
809
|
+
className: L(g, "right", u === "right" && "active"),
|
|
810
810
|
onMouseEnter: () => {
|
|
811
811
|
const x = e >= o - 1, k = typeof r == "number" && o >= r;
|
|
812
812
|
n && !(x && k) && z("right");
|
|
@@ -854,7 +854,6 @@ const js = D`
|
|
|
854
854
|
|
|
855
855
|
/* 拖拽活动状态 */
|
|
856
856
|
.sortable-drag {
|
|
857
|
-
background: rgba(255, 255, 255, 0.05);
|
|
858
857
|
backdrop-filter: blur(8px);
|
|
859
858
|
-webkit-backdrop-filter: blur(8px);
|
|
860
859
|
}
|
|
@@ -1023,11 +1022,11 @@ const Ys = De(({ src: t }) => {
|
|
|
1023
1022
|
const { data: e, noLetters: o = !1, name: r, defaultName: n, className: a } = t, { moveItemId: i } = Ae(), { theme: l } = pe(), m = {
|
|
1024
1023
|
visible: { opacity: 1, scale: 1 },
|
|
1025
1024
|
hidden: { opacity: 0, scale: 0.95 }
|
|
1026
|
-
}, p = te(() => i === e.id.toString(), [e.id, i]),
|
|
1025
|
+
}, p = te(() => i === e.id.toString(), [e.id, i]), c = r || ((u = e.data) == null ? void 0 : u.name) || n || "";
|
|
1027
1026
|
return /* @__PURE__ */ s(
|
|
1028
1027
|
V.p,
|
|
1029
1028
|
{
|
|
1030
|
-
className:
|
|
1029
|
+
className: L(
|
|
1031
1030
|
"zs-whitespace-nowrap zs-text-ellipsis zs-overflow-hidden zs-text-center zs-mt-1 zs-mb-0 zs-absolute zs-left-0 zs-right-0 zs-text-sm",
|
|
1032
1031
|
D`
|
|
1033
1032
|
color: ${(f = l.token.items) == null ? void 0 : f.textColor};
|
|
@@ -1039,46 +1038,46 @@ const Ys = De(({ src: t }) => {
|
|
|
1039
1038
|
),
|
|
1040
1039
|
variants: m,
|
|
1041
1040
|
animate: p ? "hidden" : "visible",
|
|
1042
|
-
children:
|
|
1041
|
+
children: c
|
|
1043
1042
|
}
|
|
1044
1043
|
);
|
|
1045
1044
|
}, Vs = (t) => {
|
|
1046
|
-
var
|
|
1047
|
-
const { data: e, noLetters: o = !1, icon: r,
|
|
1045
|
+
var z, y, N;
|
|
1046
|
+
const { data: e, noLetters: o = !1, icon: r, iconColor: n, from: a, iconSize: i = 64, contextMenuProps: l } = t, { contextMenuFuns: m } = Ae(), { itemIconBuilder: p, theme: c, contextMenu: u } = pe(), f = l != !1 ? l || u : l, { data: d = {} } = e, { name: S, iconColor: v } = d;
|
|
1048
1047
|
return /* @__PURE__ */ T(Ce, { children: [
|
|
1049
1048
|
/* @__PURE__ */ s(
|
|
1050
1049
|
V.div,
|
|
1051
1050
|
{
|
|
1052
|
-
className:
|
|
1051
|
+
className: L(
|
|
1053
1052
|
"zs-cursor-pointer zs-relative zs-overflow-hidden",
|
|
1054
1053
|
D`
|
|
1055
|
-
background-color: ${(
|
|
1054
|
+
background-color: ${n ?? v ?? ((z = c.token.items) == null ? void 0 : z.iconBackgroundColor)};
|
|
1056
1055
|
border-radius: 0.75rem;
|
|
1057
|
-
box-shadow: 0 0 0.5rem ${(
|
|
1058
|
-
width: ${
|
|
1059
|
-
height: ${
|
|
1056
|
+
box-shadow: 0 0 0.5rem ${(y = c.token.items) == null ? void 0 : y.iconShadowColor};
|
|
1057
|
+
width: ${i}px;
|
|
1058
|
+
height: ${i}px;
|
|
1060
1059
|
`
|
|
1061
1060
|
),
|
|
1062
1061
|
whileTap: { scale: 0.9 },
|
|
1063
1062
|
children: /* @__PURE__ */ s(
|
|
1064
1063
|
"div",
|
|
1065
1064
|
{
|
|
1066
|
-
className:
|
|
1065
|
+
className: L(
|
|
1067
1066
|
"zs-absolute zs-left-0 zs-top-0 zs-w-full zs-h-full",
|
|
1068
1067
|
D`
|
|
1069
|
-
color: ${(
|
|
1068
|
+
color: ${(N = c.token.items) == null ? void 0 : N.textColor};
|
|
1070
1069
|
`
|
|
1071
1070
|
),
|
|
1072
|
-
...
|
|
1073
|
-
{ ...e, ...
|
|
1074
|
-
|
|
1071
|
+
...m(
|
|
1072
|
+
{ ...e, ...a === "dock" ? { config: { allowResize: !1 } } : {} },
|
|
1073
|
+
f !== !1
|
|
1075
1074
|
),
|
|
1076
|
-
children: qe(e, r,
|
|
1075
|
+
children: qe(e, r, p)
|
|
1077
1076
|
}
|
|
1078
1077
|
)
|
|
1079
1078
|
}
|
|
1080
1079
|
),
|
|
1081
|
-
/* @__PURE__ */ s(Co, { data: e, noLetters: o, name:
|
|
1080
|
+
/* @__PURE__ */ s(Co, { data: e, noLetters: o, name: S })
|
|
1082
1081
|
] });
|
|
1083
1082
|
}, Pe = (t) => {
|
|
1084
1083
|
const { data: e, className: o, itemIndex: r, onClick: n, disabledDrag: a = !1, children: i, parentIds: l, childrenLength: m } = t;
|
|
@@ -1090,7 +1089,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1090
1089
|
"data-parent-ids": l == null ? void 0 : l.join(","),
|
|
1091
1090
|
"data-children-length": m,
|
|
1092
1091
|
onClick: () => n == null ? void 0 : n(e),
|
|
1093
|
-
className:
|
|
1092
|
+
className: L(a && "drag-disabled", "zs-relative", o),
|
|
1094
1093
|
initial: { opacity: 0 },
|
|
1095
1094
|
animate: { opacity: 1 },
|
|
1096
1095
|
exit: { opacity: 0 },
|
|
@@ -1101,13 +1100,13 @@ const Ys = De(({ src: t }) => {
|
|
|
1101
1100
|
var j, F, E, G, se;
|
|
1102
1101
|
const { data: e, className: o, parentIds: r, itemIndex: n, onClick: a, noLetters: i = !1, disabledDrag: l = !1, icon: m } = t, {
|
|
1103
1102
|
contextMenuFuns: p,
|
|
1104
|
-
setList:
|
|
1103
|
+
setList: c,
|
|
1105
1104
|
setOpenGroupItemData: u,
|
|
1106
1105
|
longPressTriggered: f,
|
|
1107
|
-
moveTargetId:
|
|
1108
|
-
setMoveTargetId:
|
|
1106
|
+
moveTargetId: d,
|
|
1107
|
+
setMoveTargetId: S,
|
|
1109
1108
|
listStatus: v
|
|
1110
|
-
} = Ae(), { itemIconBuilder: z, theme: y, contextMenu:
|
|
1109
|
+
} = Ae(), { itemIconBuilder: z, theme: y, contextMenu: N, typeConfigMap: g } = pe(), { children: b } = e, { row: x, col: k } = ko(e.type, (j = e.config) == null ? void 0 : j.sizeId, g), A = ((b == null ? void 0 : b.length) ?? 0) === 0, I = A ? [e] : [...b ?? []].slice(0, 9), P = te(() => d === e.id, [e.id, d]), B = D`
|
|
1111
1110
|
overflow: hidden;
|
|
1112
1111
|
cursor: pointer;
|
|
1113
1112
|
background-color: ${(F = y.token.items) == null ? void 0 : F.iconBackgroundColor};
|
|
@@ -1118,7 +1117,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1118
1117
|
return /* @__PURE__ */ s(
|
|
1119
1118
|
V.div,
|
|
1120
1119
|
{
|
|
1121
|
-
className:
|
|
1120
|
+
className: L(
|
|
1122
1121
|
"sortable-group-item zs-cursor-pointer zs-w-full zs-h-full zs-absolute zs-left-0 zs-top-0 zs-bottom-0 zs-right-0 zs-overflow-hidden",
|
|
1123
1122
|
D`
|
|
1124
1123
|
background-color: ${(Z = y.token.items) == null ? void 0 : Z.iconBackgroundColor};
|
|
@@ -1135,17 +1134,17 @@ const Ys = De(({ src: t }) => {
|
|
|
1135
1134
|
return /* @__PURE__ */ s(
|
|
1136
1135
|
V.div,
|
|
1137
1136
|
{
|
|
1138
|
-
className:
|
|
1137
|
+
className: L(
|
|
1139
1138
|
"zs-grid zs-w-full zs-h-full zs-grid-cols-3 zs-grid-rows-3 zs-place-items-center",
|
|
1140
1139
|
D`
|
|
1141
1140
|
padding: ${k === 1 ? "0.125rem" : "0.25rem"};
|
|
1142
1141
|
gap: ${k === 1 ? "0.125rem" : "0.5rem"};
|
|
1143
1142
|
`
|
|
1144
1143
|
),
|
|
1145
|
-
children:
|
|
1144
|
+
children: I == null ? void 0 : I.slice(0, 9).map((Y) => /* @__PURE__ */ s(
|
|
1146
1145
|
V.div,
|
|
1147
1146
|
{
|
|
1148
|
-
className:
|
|
1147
|
+
className: L(
|
|
1149
1148
|
B,
|
|
1150
1149
|
"zs-w-full zs-h-full",
|
|
1151
1150
|
D`
|
|
@@ -1162,10 +1161,10 @@ const Ys = De(({ src: t }) => {
|
|
|
1162
1161
|
}
|
|
1163
1162
|
);
|
|
1164
1163
|
if (x === 1 && k === 2)
|
|
1165
|
-
return /* @__PURE__ */ s(V.div, { className: "zs-grid zs-grid-cols-10 zs-grid-rows-4 zs-gap-x-2 zs-gap-y-1 zs-place-items-center zs-w-36 h-[52px]", children:
|
|
1164
|
+
return /* @__PURE__ */ s(V.div, { className: "zs-grid zs-grid-cols-10 zs-grid-rows-4 zs-gap-x-2 zs-gap-y-1 zs-place-items-center zs-w-36 h-[52px]", children: I == null ? void 0 : I.slice(0, 4).map((Y, re) => /* @__PURE__ */ s(
|
|
1166
1165
|
V.div,
|
|
1167
1166
|
{
|
|
1168
|
-
className:
|
|
1167
|
+
className: L(
|
|
1169
1168
|
B,
|
|
1170
1169
|
re < 2 ? D`
|
|
1171
1170
|
width: 52px;
|
|
@@ -1189,10 +1188,10 @@ const Ys = De(({ src: t }) => {
|
|
|
1189
1188
|
Y.id
|
|
1190
1189
|
)) });
|
|
1191
1190
|
if (x === 2 && k === 1)
|
|
1192
|
-
return /* @__PURE__ */ s(V.div, { className: "zs-grid zs-grid-cols-4 zs-grid-rows-10 zs-gap-x-1 zs-gap-y-2 w-[52px] zs-h-36 zs-place-items-center", children:
|
|
1191
|
+
return /* @__PURE__ */ s(V.div, { className: "zs-grid zs-grid-cols-4 zs-grid-rows-10 zs-gap-x-1 zs-gap-y-2 w-[52px] zs-h-36 zs-place-items-center", children: I == null ? void 0 : I.slice(0, 4).map((Y, re) => /* @__PURE__ */ s(
|
|
1193
1192
|
V.div,
|
|
1194
1193
|
{
|
|
1195
|
-
className:
|
|
1194
|
+
className: L(
|
|
1196
1195
|
B,
|
|
1197
1196
|
re < 2 ? D`
|
|
1198
1197
|
width: 52px;
|
|
@@ -1223,13 +1222,13 @@ const Ys = De(({ src: t }) => {
|
|
|
1223
1222
|
itemIndex: n,
|
|
1224
1223
|
parentIds: r,
|
|
1225
1224
|
childrenLength: b == null ? void 0 : b.length,
|
|
1226
|
-
className:
|
|
1225
|
+
className: L(o),
|
|
1227
1226
|
children: [
|
|
1228
1227
|
/* @__PURE__ */ s(
|
|
1229
1228
|
V.div,
|
|
1230
1229
|
{
|
|
1231
1230
|
whileTap: { scale: 0.9 },
|
|
1232
|
-
className:
|
|
1231
|
+
className: L(
|
|
1233
1232
|
P ? "!scale-110" : "",
|
|
1234
1233
|
"zs-cursor-pointer zs-relative my-0",
|
|
1235
1234
|
D`
|
|
@@ -1246,11 +1245,11 @@ const Ys = De(({ src: t }) => {
|
|
|
1246
1245
|
onClick: (Z) => {
|
|
1247
1246
|
!A && !f && (e.parentIds = r, e.pageX = Z.pageX, e.pageY = Z.pageY, u(e));
|
|
1248
1247
|
},
|
|
1249
|
-
...p(e,
|
|
1248
|
+
...p(e, N !== !1),
|
|
1250
1249
|
children: /* @__PURE__ */ T(
|
|
1251
1250
|
V.div,
|
|
1252
1251
|
{
|
|
1253
|
-
className:
|
|
1252
|
+
className: L(
|
|
1254
1253
|
"zs-relative zs-w-full zs-h-full flex zs-items-center zs-justify-center",
|
|
1255
1254
|
D`
|
|
1256
1255
|
padding: 0.375rem;
|
|
@@ -1261,7 +1260,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1261
1260
|
/* @__PURE__ */ s(
|
|
1262
1261
|
mt,
|
|
1263
1262
|
{
|
|
1264
|
-
className:
|
|
1263
|
+
className: L(
|
|
1265
1264
|
"sortable-group-item",
|
|
1266
1265
|
"zs-absolute zs-cursor-pointer",
|
|
1267
1266
|
D`
|
|
@@ -1279,12 +1278,12 @@ const Ys = De(({ src: t }) => {
|
|
|
1279
1278
|
animation: 150,
|
|
1280
1279
|
fallbackOnBody: !0,
|
|
1281
1280
|
list: b ?? [],
|
|
1282
|
-
setList: (Z) => !l &&
|
|
1281
|
+
setList: (Z) => !l && c(Z, r),
|
|
1283
1282
|
filter: () => !0,
|
|
1284
1283
|
disabled: l,
|
|
1285
1284
|
"data-id": e.id,
|
|
1286
1285
|
onChange: () => {
|
|
1287
|
-
l ||
|
|
1286
|
+
l || S(e.id);
|
|
1288
1287
|
}
|
|
1289
1288
|
}
|
|
1290
1289
|
)
|
|
@@ -1298,7 +1297,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1298
1297
|
}
|
|
1299
1298
|
);
|
|
1300
1299
|
}, wo = Ws, Xs = ({ value: t, onChange: e, onBlur: o, placeholder: r = "标题" }) => {
|
|
1301
|
-
var p,
|
|
1300
|
+
var p, c, u, f, d, S, v, z, y, N, g, b, x, k, A, I, P, B, J, j, F;
|
|
1302
1301
|
const [n, a] = R(t), { theme: i } = pe(), l = (E) => {
|
|
1303
1302
|
const G = E.target.value;
|
|
1304
1303
|
a(G), e(G);
|
|
@@ -1308,22 +1307,22 @@ const Ys = De(({ src: t }) => {
|
|
|
1308
1307
|
return /* @__PURE__ */ s(
|
|
1309
1308
|
"input",
|
|
1310
1309
|
{
|
|
1311
|
-
className:
|
|
1310
|
+
className: L(
|
|
1312
1311
|
"zs-bg-transparent zs-text-center zs-text-xl zs-w-full zs-rounded-lg py-2 px-4",
|
|
1313
1312
|
D`
|
|
1314
1313
|
border-style: none;
|
|
1315
|
-
color: ${(u = (
|
|
1314
|
+
color: ${(u = (c = (p = i.token.items) == null ? void 0 : p.groupModal) == null ? void 0 : c.title) == null ? void 0 : u.textColor};
|
|
1316
1315
|
font-weight: 600;
|
|
1317
1316
|
letter-spacing: -0.5px;
|
|
1318
1317
|
transition: all 0.2s ease-out;
|
|
1319
|
-
background: ${(
|
|
1318
|
+
background: ${(S = (d = (f = i.token.items) == null ? void 0 : f.groupModal) == null ? void 0 : d.title) == null ? void 0 : S.backgroundColor};
|
|
1320
1319
|
|
|
1321
1320
|
&:focus {
|
|
1322
1321
|
outline: none;
|
|
1323
1322
|
background: ${(y = (z = (v = i.token.items) == null ? void 0 : v.groupModal) == null ? void 0 : z.title) == null ? void 0 : y.focusBackgroundColor};
|
|
1324
1323
|
backdrop-filter: blur(8px);
|
|
1325
1324
|
-webkit-backdrop-filter: blur(8px);
|
|
1326
|
-
box-shadow: 0 0 0 2px ${(b = (g = (
|
|
1325
|
+
box-shadow: 0 0 0 2px ${(b = (g = (N = i.token.items) == null ? void 0 : N.groupModal) == null ? void 0 : g.title) == null ? void 0 : b.shadowColor};
|
|
1327
1326
|
transform: scale(1.02);
|
|
1328
1327
|
}
|
|
1329
1328
|
|
|
@@ -1332,7 +1331,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1332
1331
|
}
|
|
1333
1332
|
|
|
1334
1333
|
&::placeholder {
|
|
1335
|
-
color: ${(B = (P = (
|
|
1334
|
+
color: ${(B = (P = (I = i.token.items) == null ? void 0 : I.groupModal) == null ? void 0 : P.title) == null ? void 0 : B.placeholderColor};
|
|
1336
1335
|
}
|
|
1337
1336
|
|
|
1338
1337
|
&::selection {
|
|
@@ -1347,7 +1346,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1347
1346
|
}
|
|
1348
1347
|
);
|
|
1349
1348
|
}, gt = (t) => {
|
|
1350
|
-
var g, b, x, k, A,
|
|
1349
|
+
var g, b, x, k, A, I, P, B, J, j, F, E, G, se, Z, Y, re, de, fe, ie, ce, Q;
|
|
1351
1350
|
const {
|
|
1352
1351
|
visible: e,
|
|
1353
1352
|
onClose: o,
|
|
@@ -1358,15 +1357,15 @@ const Ys = De(({ src: t }) => {
|
|
|
1358
1357
|
destroyOnClose: l = !0,
|
|
1359
1358
|
closable: m = !1,
|
|
1360
1359
|
footer: p = null,
|
|
1361
|
-
className:
|
|
1360
|
+
className: c,
|
|
1362
1361
|
contentClassName: u
|
|
1363
|
-
} = t, { theme: f } = pe(),
|
|
1362
|
+
} = t, { theme: f } = pe(), d = f.token.modal, [S, v] = R(!1), [z, y] = R(!1);
|
|
1364
1363
|
return X(() => {
|
|
1365
1364
|
v(!!e);
|
|
1366
1365
|
}, [e]), /* @__PURE__ */ s(ze, { children: e && /* @__PURE__ */ s(
|
|
1367
1366
|
sn,
|
|
1368
1367
|
{
|
|
1369
|
-
visible:
|
|
1368
|
+
visible: S,
|
|
1370
1369
|
onClose: () => {
|
|
1371
1370
|
y(!0), v(!1), setTimeout(() => {
|
|
1372
1371
|
y(!1), o();
|
|
@@ -1378,13 +1377,13 @@ const Ys = De(({ src: t }) => {
|
|
|
1378
1377
|
title: r,
|
|
1379
1378
|
footer: p,
|
|
1380
1379
|
closable: m,
|
|
1381
|
-
className:
|
|
1380
|
+
className: L(
|
|
1382
1381
|
"base-modal",
|
|
1383
1382
|
{ "modal-closing": z },
|
|
1384
1383
|
D`
|
|
1385
1384
|
.rc-dialog-mask {
|
|
1386
|
-
background: ${(g =
|
|
1387
|
-
backdrop-filter: ${(b =
|
|
1385
|
+
background: ${(g = d == null ? void 0 : d.mask) == null ? void 0 : g.backgroundColor};
|
|
1386
|
+
backdrop-filter: ${(b = d == null ? void 0 : d.mask) == null ? void 0 : b.backdropFilter};
|
|
1388
1387
|
animation: maskFadeIn 0.2s ease-out;
|
|
1389
1388
|
}
|
|
1390
1389
|
|
|
@@ -1395,7 +1394,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1395
1394
|
}
|
|
1396
1395
|
to {
|
|
1397
1396
|
opacity: 1;
|
|
1398
|
-
backdrop-filter: ${(x =
|
|
1397
|
+
backdrop-filter: ${(x = d == null ? void 0 : d.mask) == null ? void 0 : x.backdropFilter};
|
|
1399
1398
|
}
|
|
1400
1399
|
}
|
|
1401
1400
|
|
|
@@ -1407,13 +1406,13 @@ const Ys = De(({ src: t }) => {
|
|
|
1407
1406
|
}
|
|
1408
1407
|
|
|
1409
1408
|
.rc-dialog-content {
|
|
1410
|
-
background: ${(k =
|
|
1411
|
-
backdrop-filter: ${(A =
|
|
1412
|
-
box-shadow: 0 20px 40px ${(
|
|
1413
|
-
0 0 0 0.75px ${(P =
|
|
1414
|
-
border: 0.75px solid ${(B =
|
|
1409
|
+
background: ${(k = d == null ? void 0 : d.content) == null ? void 0 : k.backgroundColor};
|
|
1410
|
+
backdrop-filter: ${(A = d == null ? void 0 : d.content) == null ? void 0 : A.backdropFilter};
|
|
1411
|
+
box-shadow: 0 20px 40px ${(I = d == null ? void 0 : d.content) == null ? void 0 : I.boxShadowColor},
|
|
1412
|
+
0 0 0 0.75px ${(P = d == null ? void 0 : d.content) == null ? void 0 : P.boxShadowBorderColor};
|
|
1413
|
+
border: 0.75px solid ${(B = d == null ? void 0 : d.content) == null ? void 0 : B.borderColor};
|
|
1415
1414
|
padding: 0;
|
|
1416
|
-
border-radius: ${(J =
|
|
1415
|
+
border-radius: ${(J = d == null ? void 0 : d.content) == null ? void 0 : J.borderRadius};
|
|
1417
1416
|
overflow: hidden;
|
|
1418
1417
|
animation: modalSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
|
|
1419
1418
|
position: relative;
|
|
@@ -1444,7 +1443,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1444
1443
|
@keyframes maskFadeOut {
|
|
1445
1444
|
from {
|
|
1446
1445
|
opacity: 1;
|
|
1447
|
-
backdrop-filter: ${(j =
|
|
1446
|
+
backdrop-filter: ${(j = d == null ? void 0 : d.mask) == null ? void 0 : j.backdropFilter};
|
|
1448
1447
|
}
|
|
1449
1448
|
to {
|
|
1450
1449
|
opacity: 0;
|
|
@@ -1472,7 +1471,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1472
1471
|
position: relative;
|
|
1473
1472
|
|
|
1474
1473
|
.ant-modal-name {
|
|
1475
|
-
color: ${(F =
|
|
1474
|
+
color: ${(F = d == null ? void 0 : d.header) == null ? void 0 : F.textColor};
|
|
1476
1475
|
}
|
|
1477
1476
|
}
|
|
1478
1477
|
|
|
@@ -1493,53 +1492,53 @@ const Ys = De(({ src: t }) => {
|
|
|
1493
1492
|
}
|
|
1494
1493
|
|
|
1495
1494
|
&::-webkit-scrollbar-track {
|
|
1496
|
-
background: ${(E =
|
|
1495
|
+
background: ${(E = d == null ? void 0 : d.scrollbar) == null ? void 0 : E.trackColor};
|
|
1497
1496
|
}
|
|
1498
1497
|
|
|
1499
1498
|
&::-webkit-scrollbar-thumb {
|
|
1500
|
-
background: ${(G =
|
|
1501
|
-
border-radius: ${(se =
|
|
1499
|
+
background: ${(G = d == null ? void 0 : d.scrollbar) == null ? void 0 : G.thumbColor};
|
|
1500
|
+
border-radius: ${(se = d == null ? void 0 : d.scrollbar) == null ? void 0 : se.borderRadius};
|
|
1502
1501
|
transition: background-color 0.2s ease;
|
|
1503
1502
|
}
|
|
1504
1503
|
|
|
1505
1504
|
&::-webkit-scrollbar-thumb:hover {
|
|
1506
|
-
background: ${(Z =
|
|
1505
|
+
background: ${(Z = d == null ? void 0 : d.scrollbar) == null ? void 0 : Z.thumbHoverColor};
|
|
1507
1506
|
}
|
|
1508
1507
|
|
|
1509
1508
|
/* Firefox 滚动条样式 */
|
|
1510
1509
|
scrollbar-width: thin;
|
|
1511
|
-
scrollbar-color: ${(Y =
|
|
1510
|
+
scrollbar-color: ${(Y = d == null ? void 0 : d.scrollbar) == null ? void 0 : Y.thumbColor} ${(re = d == null ? void 0 : d.scrollbar) == null ? void 0 : re.trackColor};
|
|
1512
1511
|
}
|
|
1513
1512
|
`,
|
|
1514
|
-
|
|
1513
|
+
c
|
|
1515
1514
|
),
|
|
1516
1515
|
width: a,
|
|
1517
1516
|
destroyOnClose: l,
|
|
1518
1517
|
children: /* @__PURE__ */ s(
|
|
1519
1518
|
"div",
|
|
1520
1519
|
{
|
|
1521
|
-
className:
|
|
1520
|
+
className: L(
|
|
1522
1521
|
"zs-overflow-y-auto zs-relative",
|
|
1523
1522
|
D`
|
|
1524
1523
|
max-height: 60vh;
|
|
1525
1524
|
|
|
1526
1525
|
/* iOS 风格的滚动条 */
|
|
1527
1526
|
&::-webkit-scrollbar {
|
|
1528
|
-
width: ${(de =
|
|
1527
|
+
width: ${(de = d == null ? void 0 : d.scrollbar) == null ? void 0 : de.width};
|
|
1529
1528
|
}
|
|
1530
1529
|
|
|
1531
1530
|
&::-webkit-scrollbar-track {
|
|
1532
|
-
background: ${(fe =
|
|
1531
|
+
background: ${(fe = d == null ? void 0 : d.scrollbar) == null ? void 0 : fe.trackColor};
|
|
1533
1532
|
}
|
|
1534
1533
|
|
|
1535
1534
|
&::-webkit-scrollbar-thumb {
|
|
1536
|
-
background: ${(ie =
|
|
1537
|
-
border-radius: ${(ce =
|
|
1535
|
+
background: ${(ie = d == null ? void 0 : d.scrollbar) == null ? void 0 : ie.thumbColor};
|
|
1536
|
+
border-radius: ${(ce = d == null ? void 0 : d.scrollbar) == null ? void 0 : ce.borderRadius};
|
|
1538
1537
|
transition: background 0.2s ease;
|
|
1539
1538
|
}
|
|
1540
1539
|
|
|
1541
1540
|
&::-webkit-scrollbar-thumb:hover {
|
|
1542
|
-
background: ${(Q =
|
|
1541
|
+
background: ${(Q = d == null ? void 0 : d.scrollbar) == null ? void 0 : Q.thumbHoverColor};
|
|
1543
1542
|
}
|
|
1544
1543
|
`,
|
|
1545
1544
|
u
|
|
@@ -1550,41 +1549,41 @@ const Ys = De(({ src: t }) => {
|
|
|
1550
1549
|
}
|
|
1551
1550
|
) });
|
|
1552
1551
|
}, qs = (t) => {
|
|
1553
|
-
const { data: e, onClose: o, onItemClick: r } = t, { list: n, setList: a, setListStatus: i, setMoveItemId: l, setMoveTargetId: m, updateItem: p } = Ae(), [
|
|
1552
|
+
const { data: e, onClose: o, onItemClick: r } = t, { list: n, setList: a, setListStatus: i, setMoveItemId: l, setMoveTargetId: m, updateItem: p } = Ae(), [c, u] = R("文件夹"), f = oe(null), d = oe(null), [S, v] = R(), [z, y] = R(), N = [...(e == null ? void 0 : e.children) ?? []];
|
|
1554
1553
|
X(() => {
|
|
1555
|
-
var
|
|
1556
|
-
e && u((
|
|
1554
|
+
var I;
|
|
1555
|
+
e && u((I = e.data) == null ? void 0 : I.name);
|
|
1557
1556
|
}, [e]);
|
|
1558
|
-
const g = (
|
|
1559
|
-
u(
|
|
1557
|
+
const g = (I) => {
|
|
1558
|
+
u(I);
|
|
1560
1559
|
}, b = () => {
|
|
1561
1560
|
e && p(e.id, {
|
|
1562
1561
|
...e.data,
|
|
1563
|
-
name:
|
|
1562
|
+
name: c
|
|
1564
1563
|
});
|
|
1565
|
-
}, x = (
|
|
1566
|
-
const P =
|
|
1567
|
-
P && (
|
|
1564
|
+
}, x = (I) => {
|
|
1565
|
+
const P = I.relatedTarget;
|
|
1566
|
+
P && (I.currentTarget.contains(P) || setTimeout(() => {
|
|
1568
1567
|
o();
|
|
1569
1568
|
}, 500));
|
|
1570
|
-
}, k = le((
|
|
1571
|
-
const { width: P, marginLeft: B } = Se.computeRowWidth(
|
|
1569
|
+
}, k = le((I) => {
|
|
1570
|
+
const { width: P, marginLeft: B } = Se.computeRowWidth(I, 112);
|
|
1572
1571
|
v(P), y(B);
|
|
1573
1572
|
}, []), A = le(
|
|
1574
|
-
(
|
|
1575
|
-
if (
|
|
1573
|
+
(I) => {
|
|
1574
|
+
if (d.current && (d.current.disconnect(), d.current = null), f.current = I, !!I)
|
|
1576
1575
|
if (window.requestAnimationFrame(() => {
|
|
1577
|
-
k(
|
|
1576
|
+
k(I);
|
|
1578
1577
|
}), "ResizeObserver" in window) {
|
|
1579
1578
|
const P = new ResizeObserver(() => {
|
|
1580
|
-
k(
|
|
1579
|
+
k(I);
|
|
1581
1580
|
});
|
|
1582
|
-
P.observe(
|
|
1581
|
+
P.observe(I), d.current = P;
|
|
1583
1582
|
} else {
|
|
1584
1583
|
const P = () => {
|
|
1585
|
-
k(
|
|
1584
|
+
k(I);
|
|
1586
1585
|
};
|
|
1587
|
-
globalThis.addEventListener("resize", P),
|
|
1586
|
+
globalThis.addEventListener("resize", P), d.current = {
|
|
1588
1587
|
disconnect: () => globalThis.removeEventListener("resize", P)
|
|
1589
1588
|
};
|
|
1590
1589
|
}
|
|
@@ -1603,7 +1602,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1603
1602
|
`,
|
|
1604
1603
|
visible: !!e,
|
|
1605
1604
|
onClose: o,
|
|
1606
|
-
title: /* @__PURE__ */ s(Xs, { value:
|
|
1605
|
+
title: /* @__PURE__ */ s(Xs, { value: c, onChange: g, onBlur: b, placeholder: "文件夹" }),
|
|
1607
1606
|
mousePosition: e != null && e.pageX && (e != null && e.pageY) ? {
|
|
1608
1607
|
x: e == null ? void 0 : e.pageX,
|
|
1609
1608
|
y: e == null ? void 0 : e.pageY
|
|
@@ -1611,25 +1610,25 @@ const Ys = De(({ src: t }) => {
|
|
|
1611
1610
|
children: /* @__PURE__ */ s("div", { ref: A, className: "zs-min-h-96 zs-px-4", onDragLeave: x, children: /* @__PURE__ */ s(
|
|
1612
1611
|
mt,
|
|
1613
1612
|
{
|
|
1614
|
-
className:
|
|
1615
|
-
style: { width:
|
|
1613
|
+
className: L("zs-grid zs-place-items-center zs-grid-flow-row-dense zs-mx-auto", js),
|
|
1614
|
+
style: { width: S, marginLeft: z },
|
|
1616
1615
|
...Gs,
|
|
1617
1616
|
list: (e == null ? void 0 : e.children) ?? [],
|
|
1618
|
-
setList: (
|
|
1617
|
+
setList: (I) => {
|
|
1619
1618
|
var J, j;
|
|
1620
|
-
const P =
|
|
1621
|
-
P.length === (B == null ? void 0 : B.length) && P.every((F, E) => F === B[E]) || P.length < ((B == null ? void 0 : B.length) ?? 0) || a(
|
|
1619
|
+
const P = I.map((F) => F.id), B = (j = (J = n.find((F) => F.id === (e == null ? void 0 : e.id))) == null ? void 0 : J.children) == null ? void 0 : j.map((F) => F.id);
|
|
1620
|
+
P.length === (B == null ? void 0 : B.length) && P.every((F, E) => F === B[E]) || P.length < ((B == null ? void 0 : B.length) ?? 0) || a(I, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
|
|
1622
1621
|
},
|
|
1623
1622
|
onMove: () => (m(null), i("onMove"), !0),
|
|
1624
|
-
onStart: (
|
|
1625
|
-
const P =
|
|
1623
|
+
onStart: (I) => {
|
|
1624
|
+
const P = I.item.dataset;
|
|
1626
1625
|
P != null && P.id && l(P.id), i("onMove");
|
|
1627
1626
|
},
|
|
1628
1627
|
onEnd: () => {
|
|
1629
1628
|
l(null), m(null), i(null);
|
|
1630
1629
|
},
|
|
1631
1630
|
ghostClass: wo,
|
|
1632
|
-
children: /* @__PURE__ */ s(ze, { mode: "popLayout", children:
|
|
1631
|
+
children: /* @__PURE__ */ s(ze, { mode: "popLayout", children: N.map((I, P) => /* @__PURE__ */ s("div", { className: "zs-w-28 zs-h-28 zs-flex zs-items-center zs-justify-center", children: /* @__PURE__ */ s(Pe, { data: I, itemIndex: P, onClick: r }, I.id) }, I.id)) })
|
|
1633
1632
|
}
|
|
1634
1633
|
) })
|
|
1635
1634
|
}
|
|
@@ -1650,7 +1649,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1650
1649
|
children: e && /* @__PURE__ */ s(
|
|
1651
1650
|
"div",
|
|
1652
1651
|
{
|
|
1653
|
-
className:
|
|
1652
|
+
className: L(
|
|
1654
1653
|
"zs-p-2 zs-rounded-md",
|
|
1655
1654
|
D`
|
|
1656
1655
|
background-color: ${(a = r.token.items) == null ? void 0 : a.infoModalBackgroundColor};
|
|
@@ -1664,7 +1663,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1664
1663
|
}, Ks = ({ dots: t, className: e }) => /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
1665
1664
|
"ul",
|
|
1666
1665
|
{
|
|
1667
|
-
className:
|
|
1666
|
+
className: L(
|
|
1668
1667
|
"slick-dots-default",
|
|
1669
1668
|
"!zs-flex zs-justify-center zs-items-center zs-gap-3",
|
|
1670
1669
|
D`
|
|
@@ -1712,7 +1711,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1712
1711
|
"button",
|
|
1713
1712
|
{
|
|
1714
1713
|
type: "button",
|
|
1715
|
-
className:
|
|
1714
|
+
className: L(
|
|
1716
1715
|
"zs-w-2 zs-h-2 zs-rounded-full zs-border-none zs-cursor-pointer",
|
|
1717
1716
|
D`
|
|
1718
1717
|
background-color: ${n ? "rgba(0, 0, 0, 1)" : "rgba(0, 0, 0, 0.3)"};
|
|
@@ -1723,16 +1722,16 @@ const Ys = De(({ src: t }) => {
|
|
|
1723
1722
|
}
|
|
1724
1723
|
);
|
|
1725
1724
|
}, ea = ({ onClick: t, className: e }) => {
|
|
1726
|
-
var
|
|
1727
|
-
const [o, r] = R(!1), { theme: n } = pe(), a = (v = (
|
|
1725
|
+
var d, S, v;
|
|
1726
|
+
const [o, r] = R(!1), { theme: n } = pe(), a = (v = (S = (d = n == null ? void 0 : n.token) == null ? void 0 : d.dock) == null ? void 0 : S.launchpad) == null ? void 0 : v.icon, i = a.textColor, l = a.backgroundColor, m = a.borderColor, p = a.shadowColor, c = a.hoverGlowColor, u = (z, y) => {
|
|
1728
1727
|
if (z.startsWith("#")) {
|
|
1729
|
-
const g = z.slice(1), b = parseInt(g.slice(0, 2), 16), x = parseInt(g.slice(2, 4), 16), k = parseInt(g.slice(4, 6), 16), A = y * 15,
|
|
1730
|
-
return `rgb(${
|
|
1728
|
+
const g = z.slice(1), b = parseInt(g.slice(0, 2), 16), x = parseInt(g.slice(2, 4), 16), k = parseInt(g.slice(4, 6), 16), A = y * 15, I = Math.max(0, b - A), P = Math.max(0, x - A), B = Math.max(0, k - A);
|
|
1729
|
+
return `rgb(${I}, ${P}, ${B})`;
|
|
1731
1730
|
}
|
|
1732
|
-
const
|
|
1733
|
-
if (
|
|
1734
|
-
const g = parseInt(
|
|
1735
|
-
return `rgba(${
|
|
1731
|
+
const N = z.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
|
|
1732
|
+
if (N) {
|
|
1733
|
+
const g = parseInt(N[1]), b = parseInt(N[2]), x = parseInt(N[3]), k = N[4] || "1", A = y * 15, I = Math.max(0, g - A), P = Math.max(0, b - A), B = Math.max(0, x - A);
|
|
1734
|
+
return `rgba(${I}, ${P}, ${B}, ${k})`;
|
|
1736
1735
|
}
|
|
1737
1736
|
return z;
|
|
1738
1737
|
}, f = [
|
|
@@ -1753,7 +1752,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1753
1752
|
return /* @__PURE__ */ T(
|
|
1754
1753
|
V.div,
|
|
1755
1754
|
{
|
|
1756
|
-
className:
|
|
1755
|
+
className: L("zs-cursor-pointer zs-relative", e),
|
|
1757
1756
|
style: {
|
|
1758
1757
|
overflow: "visible",
|
|
1759
1758
|
padding: "0 8px 0 0"
|
|
@@ -1778,16 +1777,16 @@ const Ys = De(({ src: t }) => {
|
|
|
1778
1777
|
overflow: "visible"
|
|
1779
1778
|
},
|
|
1780
1779
|
children: f.map((z, y) => {
|
|
1781
|
-
const
|
|
1780
|
+
const N = y * 4, g = 0, b = o ? N + y * 2 : N, x = g, k = 0, A = 1 - y * 0.05, I = f.length - y, P = (B) => B === 0 ? l : u(l, B);
|
|
1782
1781
|
return /* @__PURE__ */ s(
|
|
1783
1782
|
V.div,
|
|
1784
1783
|
{
|
|
1785
|
-
className:
|
|
1784
|
+
className: L(
|
|
1786
1785
|
"zs-absolute zs-w-full zs-h-full zs-rounded-xl zs-flex zs-items-center zs-justify-center zs-shadow-lg",
|
|
1787
1786
|
D`
|
|
1788
1787
|
background: ${P(y)};
|
|
1789
1788
|
color: ${i};
|
|
1790
|
-
z-index: ${
|
|
1789
|
+
z-index: ${I};
|
|
1791
1790
|
box-shadow: 0 ${1 + y * 0.5}px ${4 + y * 1}px
|
|
1792
1791
|
${p.replace(/[\d.]+\)$/, `${0.1 + y * 0.02})`)};
|
|
1793
1792
|
border: 0.5px solid ${m};
|
|
@@ -1818,10 +1817,10 @@ const Ys = De(({ src: t }) => {
|
|
|
1818
1817
|
/* @__PURE__ */ s(
|
|
1819
1818
|
V.div,
|
|
1820
1819
|
{
|
|
1821
|
-
className:
|
|
1820
|
+
className: L(
|
|
1822
1821
|
"zs-absolute zs-inset-0 zs-rounded-xl zs-pointer-events-none",
|
|
1823
1822
|
D`
|
|
1824
|
-
background: radial-gradient(circle, ${
|
|
1823
|
+
background: radial-gradient(circle, ${c} 0%, transparent 70%);
|
|
1825
1824
|
opacity: 0;
|
|
1826
1825
|
`
|
|
1827
1826
|
),
|
|
@@ -1832,7 +1831,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1832
1831
|
]
|
|
1833
1832
|
}
|
|
1834
1833
|
);
|
|
1835
|
-
}, No = ({ onClick: t, className: e }) => /* @__PURE__ */ s(ea, { onClick: t, className:
|
|
1834
|
+
}, No = ({ onClick: t, className: e }) => /* @__PURE__ */ s(ea, { onClick: t, className: L("zs-flex-shrink-0", e) }), Io = ({
|
|
1836
1835
|
items: t = [],
|
|
1837
1836
|
fixedItems: e = [],
|
|
1838
1837
|
position: o = "bottom",
|
|
@@ -1843,10 +1842,10 @@ const Ys = De(({ src: t }) => {
|
|
|
1843
1842
|
onLaunchpadClick: l,
|
|
1844
1843
|
onDrop: m,
|
|
1845
1844
|
onDockItemsChange: p,
|
|
1846
|
-
itemSize:
|
|
1845
|
+
itemSize: c = 56
|
|
1847
1846
|
}) => {
|
|
1848
|
-
var
|
|
1849
|
-
const { setListStatus: u } = Ae(), { theme: f } = pe(),
|
|
1847
|
+
var N;
|
|
1848
|
+
const { setListStatus: u } = Ae(), { theme: f } = pe(), d = f.token.dock, S = f.token.base, v = (g, b) => n ? n(g, b) : /* @__PURE__ */ s(Pe, { data: g, itemIndex: b, noLetters: !0, from: "dock", iconSize: c }, g.id), z = (g, b) => a ? a(g, b) : /* @__PURE__ */ s(
|
|
1850
1849
|
Pe,
|
|
1851
1850
|
{
|
|
1852
1851
|
data: g,
|
|
@@ -1854,7 +1853,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1854
1853
|
noLetters: !0,
|
|
1855
1854
|
from: "dock",
|
|
1856
1855
|
disabledDrag: !0,
|
|
1857
|
-
iconSize:
|
|
1856
|
+
iconSize: c
|
|
1858
1857
|
},
|
|
1859
1858
|
g.id
|
|
1860
1859
|
);
|
|
@@ -1863,11 +1862,11 @@ const Ys = De(({ src: t }) => {
|
|
|
1863
1862
|
const y = /* @__PURE__ */ s(
|
|
1864
1863
|
"div",
|
|
1865
1864
|
{
|
|
1866
|
-
className:
|
|
1865
|
+
className: L(
|
|
1867
1866
|
"zs-flex zs-transition-colors",
|
|
1868
1867
|
o === "top" || o === "bottom" ? "zs-w-[1px] zs-h-8 zs-mx-1" : "zs-w-8 zs-h-[1px] zs-my-1",
|
|
1869
1868
|
D`
|
|
1870
|
-
background-color: ${((
|
|
1869
|
+
background-color: ${((N = d == null ? void 0 : d.divider) == null ? void 0 : N.color) || "rgba(255, 255, 255, 0.3)"};
|
|
1871
1870
|
`
|
|
1872
1871
|
)
|
|
1873
1872
|
}
|
|
@@ -1875,15 +1874,15 @@ const Ys = De(({ src: t }) => {
|
|
|
1875
1874
|
return /* @__PURE__ */ T(
|
|
1876
1875
|
"div",
|
|
1877
1876
|
{
|
|
1878
|
-
className:
|
|
1877
|
+
className: L(
|
|
1879
1878
|
"zs-flex zs-justify-between zs-items-center zs-rounded-2xl zs-py-3 zs-px-4 zs-backdrop-blur-xl zs-gap-1 zs-border zs-transition-colors zs-max-w-full",
|
|
1880
1879
|
o === "top" || o === "bottom" ? "zs-flex-row" : "zs-flex-col",
|
|
1881
1880
|
o === "top" && "zs-mb-4",
|
|
1882
1881
|
o === "bottom" && "zs-mt-4",
|
|
1883
1882
|
D`
|
|
1884
|
-
background-color: ${(
|
|
1885
|
-
border-color: ${(
|
|
1886
|
-
box-shadow: 0 8px 32px ${(
|
|
1883
|
+
background-color: ${(d == null ? void 0 : d.backgroundColor) || "rgba(255, 255, 255, 0.8)"};
|
|
1884
|
+
border-color: ${(d == null ? void 0 : d.borderColor) || "rgba(255, 255, 255, 0.2)"};
|
|
1885
|
+
box-shadow: 0 8px 32px ${(d == null ? void 0 : d.boxShadowColor) || "rgba(0, 0, 0, 0.1)"};
|
|
1887
1886
|
`,
|
|
1888
1887
|
r
|
|
1889
1888
|
),
|
|
@@ -1895,7 +1894,7 @@ const Ys = De(({ src: t }) => {
|
|
|
1895
1894
|
e.length > 0 && /* @__PURE__ */ s(
|
|
1896
1895
|
"div",
|
|
1897
1896
|
{
|
|
1898
|
-
className:
|
|
1897
|
+
className: L(
|
|
1899
1898
|
"zs-flex zs-gap-3",
|
|
1900
1899
|
D`
|
|
1901
1900
|
${o === "top" || o === "bottom" ? "flex-direction: row;" : "flex-direction: column;"}
|
|
@@ -1913,10 +1912,10 @@ const Ys = De(({ src: t }) => {
|
|
|
1913
1912
|
p && p(g);
|
|
1914
1913
|
},
|
|
1915
1914
|
...bo,
|
|
1916
|
-
className:
|
|
1915
|
+
className: L(
|
|
1917
1916
|
"desktop-dock-sortable zs-flex zs-gap-3 flex-1 zs-relative",
|
|
1918
1917
|
D`
|
|
1919
|
-
min-height: ${
|
|
1918
|
+
min-height: ${c}px;
|
|
1920
1919
|
${o === "top" || o === "bottom" ? "flex-direction: row; overflow-x: auto; overflow-y: hidden;" : "flex-direction: column; overflow-y: auto; overflow-x: hidden;"}
|
|
1921
1920
|
|
|
1922
1921
|
/* 隐藏滚动条但保持滚动功能 */
|
|
@@ -1933,12 +1932,12 @@ const Ys = De(({ src: t }) => {
|
|
|
1933
1932
|
}
|
|
1934
1933
|
|
|
1935
1934
|
.sortable-ghost {
|
|
1936
|
-
width: ${
|
|
1937
|
-
height: ${
|
|
1935
|
+
width: ${c}px;
|
|
1936
|
+
height: ${c}px;
|
|
1938
1937
|
div,
|
|
1939
1938
|
img {
|
|
1940
|
-
width: ${
|
|
1941
|
-
height: ${
|
|
1939
|
+
width: ${c}px;
|
|
1940
|
+
height: ${c}px;
|
|
1942
1941
|
}
|
|
1943
1942
|
}
|
|
1944
1943
|
`,
|
|
@@ -1951,14 +1950,14 @@ const Ys = De(({ src: t }) => {
|
|
|
1951
1950
|
children: t.length > 0 ? t.map((g, b) => v(g, b)) : /* @__PURE__ */ s(
|
|
1952
1951
|
V.div,
|
|
1953
1952
|
{
|
|
1954
|
-
className:
|
|
1953
|
+
className: L(
|
|
1955
1954
|
"drag-disabled dock-items-empty zs-flex zs-items-center zs-justify-center zs-gap-2 zs-rounded-xl zs-border-2 zs-border-dashed zs-absolute zs-top-0 zs-left-0",
|
|
1956
1955
|
D`
|
|
1957
|
-
min-height: ${
|
|
1958
|
-
${o === "top" || o === "bottom" ? "width: 100%; padding: 8px 12px;" : `height: 100%; min-width: ${
|
|
1959
|
-
color: ${(
|
|
1960
|
-
border-color: ${(
|
|
1961
|
-
background-color: ${(
|
|
1956
|
+
min-height: ${c}px;
|
|
1957
|
+
${o === "top" || o === "bottom" ? "width: 100%; padding: 8px 12px;" : `height: 100%; min-width: ${c}px; padding: 12px 8px;`};
|
|
1958
|
+
color: ${(S == null ? void 0 : S.textColor) || "rgba(0, 0, 0, 0.6)"};
|
|
1959
|
+
border-color: ${(d == null ? void 0 : d.borderColor) || "rgba(0, 0, 0, 0.2)"};
|
|
1960
|
+
background-color: ${(d == null ? void 0 : d.backgroundColor) || "rgba(255, 255, 255, 0.25)"};
|
|
1962
1961
|
opacity: 0.5 !important;
|
|
1963
1962
|
`
|
|
1964
1963
|
),
|
|
@@ -1975,8 +1974,8 @@ const Ys = De(({ src: t }) => {
|
|
|
1975
1974
|
}, bt = D`
|
|
1976
1975
|
transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
1977
1976
|
`, ta = ({ value: t, onChange: e, placeholder: o = "搜索应用", className: r = "" }) => {
|
|
1978
|
-
var
|
|
1979
|
-
const { theme: n } = pe(), a = oe(null), i = oe(null), l = oe(null), [m, p] = R(!1),
|
|
1977
|
+
var d, S, v, z, y, N, g, b, x, k, A, I, P, B, J, j, F, E, G, se, Z, Y, re, de, fe, ie, ce, Q, ue, Ie, ne, xe, me, ve, we, O, q, U, _, ee, K, h, C;
|
|
1978
|
+
const { theme: n } = pe(), a = oe(null), i = oe(null), l = oe(null), [m, p] = R(!1), c = () => {
|
|
1980
1979
|
p(!0), i.current && (i.current.style.transform = "translateY(-50%) translateX(-0.5rem)"), l.current && (l.current.style.transform = "translateY(-50%) translateX(0.5rem)");
|
|
1981
1980
|
}, u = () => {
|
|
1982
1981
|
p(!1), i.current && (i.current.style.transform = "translateY(-50%) translateX(0)"), l.current && (l.current.style.transform = "translateY(-50%) translateX(0)");
|
|
@@ -1989,10 +1988,10 @@ const Ys = De(({ src: t }) => {
|
|
|
1989
1988
|
"div",
|
|
1990
1989
|
{
|
|
1991
1990
|
ref: i,
|
|
1992
|
-
className:
|
|
1991
|
+
className: L(
|
|
1993
1992
|
"zs-absolute zs-left-4 zs-top-1/2 zs-transform zs--translate-y-1/2 zs-pointer-events-none zs-transition-all zs-duration-300",
|
|
1994
1993
|
D`
|
|
1995
|
-
color: ${m ? (z = (v = (
|
|
1994
|
+
color: ${m ? (z = (v = (S = (d = n.token.dock) == null ? void 0 : d.launchpad) == null ? void 0 : S.modal) == null ? void 0 : v.searchBox) == null ? void 0 : z.iconFocusColor : (b = (g = (N = (y = n.token.dock) == null ? void 0 : y.launchpad) == null ? void 0 : N.modal) == null ? void 0 : g.searchBox) == null ? void 0 : b.iconColor};
|
|
1996
1995
|
`,
|
|
1997
1996
|
bt
|
|
1998
1997
|
),
|
|
@@ -2003,10 +2002,10 @@ const Ys = De(({ src: t }) => {
|
|
|
2003
2002
|
"input",
|
|
2004
2003
|
{
|
|
2005
2004
|
ref: a,
|
|
2006
|
-
className:
|
|
2005
|
+
className: L(
|
|
2007
2006
|
"zs-w-full zs-h-11 zs-pl-12 zs-pr-12 zs-border-none zs-rounded-[22px] zs-text-base zs-outline-none zs-transition-all zs-duration-300 placeholder:zs-font-normal focus:zs-scale-[1.02]",
|
|
2008
2007
|
D`
|
|
2009
|
-
background-color: ${(
|
|
2008
|
+
background-color: ${(I = (A = (k = (x = n.token.dock) == null ? void 0 : x.launchpad) == null ? void 0 : k.modal) == null ? void 0 : A.searchBox) == null ? void 0 : I.backgroundColor};
|
|
2010
2009
|
color: ${(j = (J = (B = (P = n.token.dock) == null ? void 0 : P.launchpad) == null ? void 0 : B.modal) == null ? void 0 : J.searchBox) == null ? void 0 : j.textColor};
|
|
2011
2010
|
&::placeholder {
|
|
2012
2011
|
color: ${(se = (G = (E = (F = n.token.dock) == null ? void 0 : F.launchpad) == null ? void 0 : E.modal) == null ? void 0 : G.searchBox) == null ? void 0 : se.placeholderColor};
|
|
@@ -2022,7 +2021,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2022
2021
|
placeholder: o,
|
|
2023
2022
|
value: t,
|
|
2024
2023
|
onChange: (w) => e(w.target.value),
|
|
2025
|
-
onFocus:
|
|
2024
|
+
onFocus: c,
|
|
2026
2025
|
onBlur: u
|
|
2027
2026
|
}
|
|
2028
2027
|
),
|
|
@@ -2030,7 +2029,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2030
2029
|
"button",
|
|
2031
2030
|
{
|
|
2032
2031
|
ref: l,
|
|
2033
|
-
className:
|
|
2032
|
+
className: L(
|
|
2034
2033
|
"zs-absolute zs-right-3 zs-top-1/2 zs-transform zs--translate-y-1/2 zs-w-5 zs-h-5 zs-rounded-full zs-border-none zs-text-xs zs-cursor-pointer zs-flex zs-items-center zs-justify-center zs-transition-all zs-duration-300 hover:zs-scale-110 active:zs-scale-95",
|
|
2035
2034
|
D`
|
|
2036
2035
|
background-color: ${(me = (xe = (ne = (Ie = (ue = n.token.dock) == null ? void 0 : ue.launchpad) == null ? void 0 : Ie.modal) == null ? void 0 : ne.searchBox) == null ? void 0 : xe.clearButton) == null ? void 0 : me.backgroundColor};
|
|
@@ -2051,32 +2050,32 @@ const Ys = De(({ src: t }) => {
|
|
|
2051
2050
|
const { list: r } = Ae(), [n, a] = R(""), { allApps: i, groupedData: l, groups: m, groupCounts: p } = te(() => {
|
|
2052
2051
|
if (!r || r.length === 0)
|
|
2053
2052
|
return { allApps: [], groupedData: [], groups: [], groupCounts: [] };
|
|
2054
|
-
const u = (g) => g.flatMap((b) => b.type === "app" ? [{ ...b }] : b.type === "group" && b.children ? u(b.children) : []), f = r.flatMap((g) => g.children ? u(g.children) : []),
|
|
2053
|
+
const u = (g) => g.flatMap((b) => b.type === "app" ? [{ ...b }] : b.type === "group" && b.children ? u(b.children) : []), f = r.flatMap((g) => g.children ? u(g.children) : []), S = (n.trim() ? f.filter((g) => {
|
|
2055
2054
|
var x;
|
|
2056
2055
|
return (((x = g.data) == null ? void 0 : x.name) || g.id || "").toString().toLowerCase().includes(n.toLowerCase());
|
|
2057
2056
|
}) : f).sort((g, b) => {
|
|
2058
|
-
var A,
|
|
2059
|
-
const x = (((A = g.data) == null ? void 0 : A.name) || g.id || "").toString(), k = (((
|
|
2057
|
+
var A, I;
|
|
2058
|
+
const x = (((A = g.data) == null ? void 0 : A.name) || g.id || "").toString(), k = (((I = b.data) == null ? void 0 : I.name) || b.id || "").toString();
|
|
2060
2059
|
return x.localeCompare(k);
|
|
2061
2060
|
}), v = /* @__PURE__ */ new Map();
|
|
2062
|
-
|
|
2061
|
+
S.forEach((g) => {
|
|
2063
2062
|
var A;
|
|
2064
2063
|
const x = (((A = g.data) == null ? void 0 : A.name) || g.id || "").toString().charAt(0).toUpperCase(), k = /[A-Z]/.test(x) ? x : "#";
|
|
2065
2064
|
v.has(k) || v.set(k, []), v.get(k).push(g);
|
|
2066
2065
|
});
|
|
2067
|
-
const z = Array.from(v.keys()).sort((g, b) => g === "#" ? 1 : b === "#" ? -1 : g.localeCompare(b)), y = [],
|
|
2066
|
+
const z = Array.from(v.keys()).sort((g, b) => g === "#" ? 1 : b === "#" ? -1 : g.localeCompare(b)), y = [], N = [];
|
|
2068
2067
|
return z.forEach((g) => {
|
|
2069
2068
|
const b = v.get(g) || [];
|
|
2070
|
-
y.push(...b),
|
|
2069
|
+
y.push(...b), N.push(b.length);
|
|
2071
2070
|
}), {
|
|
2072
|
-
allApps:
|
|
2071
|
+
allApps: S,
|
|
2073
2072
|
groupedData: y,
|
|
2074
2073
|
groups: z,
|
|
2075
|
-
groupCounts:
|
|
2074
|
+
groupCounts: N
|
|
2076
2075
|
};
|
|
2077
|
-
}, [r, n]),
|
|
2078
|
-
const f = m[u],
|
|
2079
|
-
|
|
2076
|
+
}, [r, n]), c = (u) => {
|
|
2077
|
+
const f = m[u], d = document.getElementById(`group-${f}`);
|
|
2078
|
+
d && d.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
2080
2079
|
};
|
|
2081
2080
|
return /* @__PURE__ */ T(
|
|
2082
2081
|
gt,
|
|
@@ -2086,11 +2085,11 @@ const Ys = De(({ src: t }) => {
|
|
|
2086
2085
|
title: /* @__PURE__ */ s("div", { className: "zs-py-4", children: /* @__PURE__ */ s(ta, { value: n, onChange: a, placeholder: "搜索应用" }) }),
|
|
2087
2086
|
width: 900,
|
|
2088
2087
|
children: [
|
|
2089
|
-
/* @__PURE__ */ s("div", { className:
|
|
2088
|
+
/* @__PURE__ */ s("div", { className: L("zs-relative zs-overflow-hidden zs-min-h-[60vh] zs-max-h-[600px]"), children: i.length === 0 ? /* @__PURE__ */ T("div", { className: "zs-flex-1 zs-flex zs-items-center zs-justify-center zs-flex-col zs-text-[#8e8e93] zs-text-xl zs-font-medium zs-text-center", children: [
|
|
2090
2089
|
/* @__PURE__ */ s("div", { className: "zs-text-6xl zs-mb-4 zs-opacity-60", children: n.trim() ? "🔍" : "📱" }),
|
|
2091
2090
|
/* @__PURE__ */ s("div", { className: "zs-mb-2", children: n.trim() ? "未找到相关应用" : "暂无应用" }),
|
|
2092
2091
|
/* @__PURE__ */ s("div", { className: "zs-text-base zs-text-[#c7c7cc] zs-font-normal", children: n.trim() ? "尝试使用其他关键词搜索" : "请添加应用到启动台" })
|
|
2093
|
-
] }) : /* @__PURE__ */ s(Ce, { children: /* @__PURE__ */ s("div", { className:
|
|
2092
|
+
] }) : /* @__PURE__ */ s(Ce, { children: /* @__PURE__ */ s("div", { className: L("zs-overflow-y-auto zs-h-full zs-ml-14 zs-p-1"), children: /* @__PURE__ */ s("div", { className: "zs-flex zs-gap-8 zs-flex-wrap", children: /* @__PURE__ */ s(ze, { mode: "popLayout", children: n.trim() ? (
|
|
2094
2093
|
// 搜索模式:简单网格布局
|
|
2095
2094
|
i.map((u, f) => /* @__PURE__ */ s("div", { className: "zs-mb-6", children: /* @__PURE__ */ s(
|
|
2096
2095
|
Pe,
|
|
@@ -2105,11 +2104,11 @@ const Ys = De(({ src: t }) => {
|
|
|
2105
2104
|
) : (
|
|
2106
2105
|
// 正常模式:字母分组布局groups
|
|
2107
2106
|
m.map((u, f) => {
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2110
|
-
|
|
2107
|
+
const d = p.slice(0, f).reduce((v, z) => v + z, 0), S = l.slice(
|
|
2108
|
+
d,
|
|
2109
|
+
d + p[f]
|
|
2111
2110
|
);
|
|
2112
|
-
return /* @__PURE__ */ s(Ce, { children:
|
|
2111
|
+
return /* @__PURE__ */ s(Ce, { children: S.map((v, z) => /* @__PURE__ */ s(
|
|
2113
2112
|
"div",
|
|
2114
2113
|
{
|
|
2115
2114
|
id: z === 0 ? `group-${u}` : void 0,
|
|
@@ -2118,7 +2117,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2118
2117
|
Pe,
|
|
2119
2118
|
{
|
|
2120
2119
|
data: v,
|
|
2121
|
-
itemIndex:
|
|
2120
|
+
itemIndex: d + z,
|
|
2122
2121
|
parentIds: [],
|
|
2123
2122
|
onClick: o,
|
|
2124
2123
|
disabledDrag: !0
|
|
@@ -2155,7 +2154,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2155
2154
|
},
|
|
2156
2155
|
whileTap: { scale: 0.95 },
|
|
2157
2156
|
className: "zs-text-sm zs-p-2 zs-cursor-pointer zs-rounded-xl zs-w-8 zs-h-8 zs-flex zs-items-center zs-justify-center zs-bg-transparent zs-border-none zs-font-semibold zs-my-1 zs-text-[#666] zs-leading-none",
|
|
2158
|
-
onClick: () =>
|
|
2157
|
+
onClick: () => c(f),
|
|
2159
2158
|
title: `跳转到 ${u}`,
|
|
2160
2159
|
children: u
|
|
2161
2160
|
},
|
|
@@ -2191,12 +2190,12 @@ const Ys = De(({ src: t }) => {
|
|
|
2191
2190
|
position: "bottom",
|
|
2192
2191
|
showLaunchpad: !0
|
|
2193
2192
|
}
|
|
2194
|
-
} = t, p = oe(null),
|
|
2193
|
+
} = t, p = oe(null), c = oe(null), u = oe(null), [f, d] = R(0), [S, v] = R(!1), [z, y] = R(!1), [N, g] = R(!0), {
|
|
2195
2194
|
list: b,
|
|
2196
2195
|
setList: x,
|
|
2197
2196
|
setListStatus: k,
|
|
2198
2197
|
showInfoItemData: A,
|
|
2199
|
-
setShowInfoItemData:
|
|
2198
|
+
setShowInfoItemData: I,
|
|
2200
2199
|
openGroupItemData: P,
|
|
2201
2200
|
setOpenGroupItemData: B,
|
|
2202
2201
|
setMoveItemId: J,
|
|
@@ -2347,11 +2346,11 @@ const Ys = De(({ src: t }) => {
|
|
|
2347
2346
|
}
|
|
2348
2347
|
if (h && C && h !== C && (w && (w.disconnect(), U.current = null), W && (globalThis.removeEventListener("resize", W), _.current = null), q.current = null), h)
|
|
2349
2348
|
if (q.current = h, requestAnimationFrame(() => ee(h)), "ResizeObserver" in globalThis) {
|
|
2350
|
-
const
|
|
2351
|
-
U.current =
|
|
2349
|
+
const M = new ResizeObserver(() => ee(h));
|
|
2350
|
+
U.current = M, M.observe(h);
|
|
2352
2351
|
} else {
|
|
2353
|
-
const
|
|
2354
|
-
_.current =
|
|
2352
|
+
const M = () => ee(h);
|
|
2353
|
+
_.current = M, globalThis.addEventListener("resize", M);
|
|
2355
2354
|
}
|
|
2356
2355
|
},
|
|
2357
2356
|
[ee]
|
|
@@ -2360,8 +2359,8 @@ const Ys = De(({ src: t }) => {
|
|
|
2360
2359
|
/* @__PURE__ */ T(
|
|
2361
2360
|
"div",
|
|
2362
2361
|
{
|
|
2363
|
-
ref:
|
|
2364
|
-
className:
|
|
2362
|
+
ref: c,
|
|
2363
|
+
className: L("zs-relative zs-w-full zs-h-full", xe),
|
|
2365
2364
|
onDragOver: (h) => {
|
|
2366
2365
|
h.preventDefault(), u.current && u.current.handleDragMove(h);
|
|
2367
2366
|
},
|
|
@@ -2405,12 +2404,12 @@ const Ys = De(({ src: t }) => {
|
|
|
2405
2404
|
po,
|
|
2406
2405
|
{
|
|
2407
2406
|
ref: u,
|
|
2408
|
-
isDragging:
|
|
2407
|
+
isDragging: S,
|
|
2409
2408
|
activeSlide: f,
|
|
2410
2409
|
totalSlides: Q.length,
|
|
2411
2410
|
maxSlides: a,
|
|
2412
2411
|
sliderRef: n ?? p,
|
|
2413
|
-
containerRef:
|
|
2412
|
+
containerRef: c,
|
|
2414
2413
|
onCreateNewPage: ue
|
|
2415
2414
|
}
|
|
2416
2415
|
),
|
|
@@ -2424,8 +2423,8 @@ const Ys = De(({ src: t }) => {
|
|
|
2424
2423
|
infinite: !1,
|
|
2425
2424
|
dots: !0,
|
|
2426
2425
|
lazyLoad: "anticipated",
|
|
2427
|
-
touchMove:
|
|
2428
|
-
className:
|
|
2426
|
+
touchMove: N,
|
|
2427
|
+
className: L(
|
|
2429
2428
|
ne,
|
|
2430
2429
|
D`
|
|
2431
2430
|
height: 100%;
|
|
@@ -2466,7 +2465,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2466
2465
|
pagingDotsBuilder: de,
|
|
2467
2466
|
slickDots: h,
|
|
2468
2467
|
disabled: e === !1,
|
|
2469
|
-
className:
|
|
2468
|
+
className: L(
|
|
2470
2469
|
"slick-dots-default",
|
|
2471
2470
|
D`
|
|
2472
2471
|
.slick-dots-default {
|
|
@@ -2477,7 +2476,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2477
2476
|
}
|
|
2478
2477
|
),
|
|
2479
2478
|
beforeChange: (h, C) => {
|
|
2480
|
-
|
|
2479
|
+
d(C), Y(C);
|
|
2481
2480
|
},
|
|
2482
2481
|
...r,
|
|
2483
2482
|
children: Q.map((h) => /* @__PURE__ */ s(
|
|
@@ -2489,8 +2488,8 @@ const Ys = De(({ src: t }) => {
|
|
|
2489
2488
|
if (Se.quickJSONCheck(w))
|
|
2490
2489
|
try {
|
|
2491
2490
|
F(JSON.parse(w), [h.id]);
|
|
2492
|
-
} catch (
|
|
2493
|
-
console.log("drag error",
|
|
2491
|
+
} catch (M) {
|
|
2492
|
+
console.log("drag error", M);
|
|
2494
2493
|
}
|
|
2495
2494
|
},
|
|
2496
2495
|
onDragOver: (C) => {
|
|
@@ -2499,7 +2498,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2499
2498
|
children: /* @__PURE__ */ T(
|
|
2500
2499
|
mt,
|
|
2501
2500
|
{
|
|
2502
|
-
className:
|
|
2501
|
+
className: L("zs-grid zs-h-full", Us),
|
|
2503
2502
|
style: { width: me, marginLeft: we, transform: "translate(28px, 28px)" },
|
|
2504
2503
|
...bo,
|
|
2505
2504
|
list: h.children ?? [],
|
|
@@ -2507,14 +2506,14 @@ const Ys = De(({ src: t }) => {
|
|
|
2507
2506
|
onMove: (C) => {
|
|
2508
2507
|
var $;
|
|
2509
2508
|
k("onMove");
|
|
2510
|
-
const { dragged: w, related: W } = C,
|
|
2511
|
-
return j(null), !((Object.keys(H).length === 0 || H.parentIds) && Number(
|
|
2509
|
+
const { dragged: w, related: W } = C, M = w.dataset, H = W.dataset;
|
|
2510
|
+
return j(null), !((Object.keys(H).length === 0 || H.parentIds) && Number(M.childrenLength) > 0 && W.classList.contains("sortable-group-item") || (W.classList.contains("desktop-dock-sortable") || ($ = W.parentElement) != null && $.classList.contains("desktop-dock-sortable")) && Number(M.childrenLength) > 0);
|
|
2512
2511
|
},
|
|
2513
2512
|
onStart: (C) => {
|
|
2514
|
-
var
|
|
2513
|
+
var M;
|
|
2515
2514
|
const w = C.item.dataset;
|
|
2516
2515
|
w != null && w.id && J(w.id), k("onMove"), v(!0);
|
|
2517
|
-
const W = (
|
|
2516
|
+
const W = (M = h.children) == null ? void 0 : M.find((H) => H.id === w.id);
|
|
2518
2517
|
W && G(W);
|
|
2519
2518
|
},
|
|
2520
2519
|
onEnd: () => {
|
|
@@ -2529,20 +2528,23 @@ const Ys = De(({ src: t }) => {
|
|
|
2529
2528
|
let W;
|
|
2530
2529
|
if (fe)
|
|
2531
2530
|
return fe(C);
|
|
2532
|
-
const { row:
|
|
2531
|
+
const { row: M, col: H } = ko(C.type, ($ = C.config) == null ? void 0 : $.sizeId, ie);
|
|
2533
2532
|
switch (C.type) {
|
|
2534
2533
|
case "group":
|
|
2535
2534
|
case "app":
|
|
2536
2535
|
W = /* @__PURE__ */ s(
|
|
2537
|
-
|
|
2536
|
+
V.div,
|
|
2538
2537
|
{
|
|
2539
|
-
className:
|
|
2538
|
+
className: L(
|
|
2540
2539
|
"zs-flex zs-justify-start zs-items-start",
|
|
2541
2540
|
D`
|
|
2542
|
-
grid-row: span ${
|
|
2541
|
+
grid-row: span ${M};
|
|
2543
2542
|
grid-column: span ${H};
|
|
2544
2543
|
`
|
|
2545
2544
|
),
|
|
2545
|
+
"data-id": C.id,
|
|
2546
|
+
layout: S ? !1 : "position",
|
|
2547
|
+
transition: S ? { duration: 0 } : { type: "spring", stiffness: 380, damping: 38 },
|
|
2546
2548
|
onMouseEnter: () => g(!1),
|
|
2547
2549
|
onMouseLeave: () => g(!0),
|
|
2548
2550
|
children: /* @__PURE__ */ s(
|
|
@@ -2560,15 +2562,18 @@ const Ys = De(({ src: t }) => {
|
|
|
2560
2562
|
break;
|
|
2561
2563
|
default:
|
|
2562
2564
|
W = /* @__PURE__ */ s(
|
|
2563
|
-
|
|
2565
|
+
V.div,
|
|
2564
2566
|
{
|
|
2565
|
-
className:
|
|
2567
|
+
className: L(
|
|
2566
2568
|
"zs-flex zs-justify-center zs-items-center",
|
|
2567
2569
|
D`
|
|
2568
|
-
grid-row: span ${
|
|
2570
|
+
grid-row: span ${M};
|
|
2569
2571
|
grid-column: span ${H};
|
|
2570
2572
|
`
|
|
2571
2573
|
),
|
|
2574
|
+
"data-id": C.id,
|
|
2575
|
+
layout: S ? !1 : "position",
|
|
2576
|
+
transition: S ? { duration: 0 } : { type: "spring", stiffness: 380, damping: 38 },
|
|
2572
2577
|
onMouseEnter: () => g(!1),
|
|
2573
2578
|
onMouseLeave: () => g(!0),
|
|
2574
2579
|
children: /* @__PURE__ */ s(Pe, { data: C, itemIndex: w, onClick: i })
|
|
@@ -2597,7 +2602,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2597
2602
|
{
|
|
2598
2603
|
data: A,
|
|
2599
2604
|
onClose: () => {
|
|
2600
|
-
|
|
2605
|
+
I(null);
|
|
2601
2606
|
}
|
|
2602
2607
|
}
|
|
2603
2608
|
),
|
|
@@ -2619,7 +2624,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2619
2624
|
return /* @__PURE__ */ s(
|
|
2620
2625
|
V.div,
|
|
2621
2626
|
{
|
|
2622
|
-
className:
|
|
2627
|
+
className: L(
|
|
2623
2628
|
"zs-rounded-2xl py-2 zs-w-max zs-z-50",
|
|
2624
2629
|
D`
|
|
2625
2630
|
background-color: ${(a = n.token.contextMenu) == null ? void 0 : a.backgroundColor};
|
|
@@ -2640,8 +2645,8 @@ const Ys = De(({ src: t }) => {
|
|
|
2640
2645
|
damping: 30,
|
|
2641
2646
|
duration: 0.15
|
|
2642
2647
|
},
|
|
2643
|
-
onMouseDown: (
|
|
2644
|
-
|
|
2648
|
+
onMouseDown: (c) => {
|
|
2649
|
+
c.stopPropagation(), c.preventDefault();
|
|
2645
2650
|
},
|
|
2646
2651
|
...r,
|
|
2647
2652
|
children: o
|
|
@@ -2653,11 +2658,11 @@ const Ys = De(({ src: t }) => {
|
|
|
2653
2658
|
}
|
|
2654
2659
|
}), st = ({ icon: t, text: e, color: o, textColor: r, onClick: n, index: a, children: i, ...l }) => {
|
|
2655
2660
|
var v, z, y;
|
|
2656
|
-
const { hoveredIndex: m, setHoveredIndex: p } = Te(St), { theme:
|
|
2661
|
+
const { hoveredIndex: m, setHoveredIndex: p } = Te(St), { theme: c } = pe(), u = m === a, f = r || ((v = c.token.contextMenu) == null ? void 0 : v.textColor) || "#1d1d1f", d = o || ((z = c.token.contextMenu) == null ? void 0 : z.textColor) || "black";
|
|
2657
2662
|
return /* @__PURE__ */ T(
|
|
2658
2663
|
V.div,
|
|
2659
2664
|
{
|
|
2660
|
-
className:
|
|
2665
|
+
className: L(
|
|
2661
2666
|
"zs-py-0 zs-px-5 zs-flex zs-items-center zs-gap-4 zs-cursor-pointer zs-relative zs-h-10 zs-outline-none",
|
|
2662
2667
|
D`
|
|
2663
2668
|
z-index: 1;
|
|
@@ -2672,11 +2677,11 @@ const Ys = De(({ src: t }) => {
|
|
|
2672
2677
|
V.div,
|
|
2673
2678
|
{
|
|
2674
2679
|
layoutId: "menuHover",
|
|
2675
|
-
className:
|
|
2680
|
+
className: L(
|
|
2676
2681
|
"zs-absolute zs-top-0.5 zs-left-2 zs-right-2 zs-bottom-0.5 zs-bg-black zs-bg-opacity-5 zs-rounded-lg",
|
|
2677
2682
|
D`
|
|
2678
2683
|
z-index: -1;
|
|
2679
|
-
background-color: ${((y =
|
|
2684
|
+
background-color: ${((y = c.token.contextMenu) == null ? void 0 : y.activeColor) || "rgba(0, 0, 0, 0.05)"};
|
|
2680
2685
|
`
|
|
2681
2686
|
),
|
|
2682
2687
|
initial: { opacity: 0 },
|
|
@@ -2692,7 +2697,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2692
2697
|
/* @__PURE__ */ s(
|
|
2693
2698
|
V.div,
|
|
2694
2699
|
{
|
|
2695
|
-
className:
|
|
2700
|
+
className: L(
|
|
2696
2701
|
"zs-flex-1 zs-text-sm",
|
|
2697
2702
|
D`
|
|
2698
2703
|
font-weight: 400;
|
|
@@ -2707,10 +2712,10 @@ const Ys = De(({ src: t }) => {
|
|
|
2707
2712
|
t && /* @__PURE__ */ s(
|
|
2708
2713
|
V.div,
|
|
2709
2714
|
{
|
|
2710
|
-
className:
|
|
2715
|
+
className: L(
|
|
2711
2716
|
"zs-flex zs-items-center zs-justify-center zs-shrink-0",
|
|
2712
2717
|
D`
|
|
2713
|
-
color: ${
|
|
2718
|
+
color: ${d};
|
|
2714
2719
|
width: 18px;
|
|
2715
2720
|
height: 18px;
|
|
2716
2721
|
`
|
|
@@ -2723,11 +2728,11 @@ const Ys = De(({ src: t }) => {
|
|
|
2723
2728
|
}
|
|
2724
2729
|
);
|
|
2725
2730
|
}, na = ({ text: t, icon: e, index: o, children: r, color: n, textColor: a, ...i }) => {
|
|
2726
|
-
var A,
|
|
2727
|
-
const [l, m] = R(!1), [p,
|
|
2728
|
-
if (f.current && clearTimeout(f.current),
|
|
2731
|
+
var A, I, P;
|
|
2732
|
+
const [l, m] = R(!1), [p, c] = R({ x: 0, y: 0 }), u = oe(null), f = oe(null), { hoveredIndex: d, setHoveredIndex: S } = Te(St), { theme: v } = pe(), z = d === o, y = a || ((A = v.token.contextMenu) == null ? void 0 : A.textColor) || "#1d1d1f", N = n || ((I = v.token.contextMenu) == null ? void 0 : I.textColor) || "black", g = () => {
|
|
2733
|
+
if (f.current && clearTimeout(f.current), S(o), m(!0), u.current) {
|
|
2729
2734
|
const B = u.current.getBoundingClientRect();
|
|
2730
|
-
|
|
2735
|
+
c({
|
|
2731
2736
|
x: B.width - 4,
|
|
2732
2737
|
y: 0
|
|
2733
2738
|
});
|
|
@@ -2747,7 +2752,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2747
2752
|
V.div,
|
|
2748
2753
|
{
|
|
2749
2754
|
ref: u,
|
|
2750
|
-
className:
|
|
2755
|
+
className: L(
|
|
2751
2756
|
"zs-py-0 zs-px-5 zs-flex zs-items-center zs-gap-4 zs-cursor-pointer zs-relative zs-h-10 zs-outline-none",
|
|
2752
2757
|
D`
|
|
2753
2758
|
z-index: 1;
|
|
@@ -2761,7 +2766,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2761
2766
|
V.div,
|
|
2762
2767
|
{
|
|
2763
2768
|
layoutId: "menuHover",
|
|
2764
|
-
className:
|
|
2769
|
+
className: L(
|
|
2765
2770
|
"zs-absolute zs-top-0.5 zs-left-2 zs-right-2 zs-bottom-0.5 zs-rounded-lg",
|
|
2766
2771
|
D`
|
|
2767
2772
|
z-index: -1;
|
|
@@ -2781,7 +2786,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2781
2786
|
/* @__PURE__ */ s(
|
|
2782
2787
|
V.div,
|
|
2783
2788
|
{
|
|
2784
|
-
className:
|
|
2789
|
+
className: L(
|
|
2785
2790
|
"zs-flex-1 zs-text-sm",
|
|
2786
2791
|
D`
|
|
2787
2792
|
font-weight: 400;
|
|
@@ -2796,10 +2801,10 @@ const Ys = De(({ src: t }) => {
|
|
|
2796
2801
|
/* @__PURE__ */ s(
|
|
2797
2802
|
V.div,
|
|
2798
2803
|
{
|
|
2799
|
-
className:
|
|
2804
|
+
className: L(
|
|
2800
2805
|
"zs-flex zs-items-center zs-justify-center zs-shrink-0",
|
|
2801
2806
|
D`
|
|
2802
|
-
color: ${
|
|
2807
|
+
color: ${N};
|
|
2803
2808
|
width: 18px;
|
|
2804
2809
|
height: 18px;
|
|
2805
2810
|
`
|
|
@@ -2810,7 +2815,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2810
2815
|
/* @__PURE__ */ s(ze, { children: l && /* @__PURE__ */ s(
|
|
2811
2816
|
Lo,
|
|
2812
2817
|
{
|
|
2813
|
-
className:
|
|
2818
|
+
className: L(
|
|
2814
2819
|
"zs-absolute zs-overflow-hidden zs-z-50",
|
|
2815
2820
|
D`
|
|
2816
2821
|
left: ${p.x}px;
|
|
@@ -2833,12 +2838,12 @@ const Ys = De(({ src: t }) => {
|
|
|
2833
2838
|
}, ra = ({ sizes: t, currentSize: e, onSizeChange: o }) => {
|
|
2834
2839
|
const [r, n] = R(null), { theme: a } = pe();
|
|
2835
2840
|
return /* @__PURE__ */ s(Ce, { children: t.map((i) => {
|
|
2836
|
-
var p,
|
|
2841
|
+
var p, c, u;
|
|
2837
2842
|
const l = r === i, m = e === i;
|
|
2838
2843
|
return /* @__PURE__ */ T(
|
|
2839
2844
|
V.div,
|
|
2840
2845
|
{
|
|
2841
|
-
className:
|
|
2846
|
+
className: L(
|
|
2842
2847
|
"zs-h-10 zs-py-0 zs-px-5 zs-flex zs-items-center zs-gap-4 zs-cursor-pointer zs-relative zs-outline-none",
|
|
2843
2848
|
D`
|
|
2844
2849
|
z-index: 1;
|
|
@@ -2852,7 +2857,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2852
2857
|
/* @__PURE__ */ s(ze, { children: (l || m) && /* @__PURE__ */ s(
|
|
2853
2858
|
V.div,
|
|
2854
2859
|
{
|
|
2855
|
-
className:
|
|
2860
|
+
className: L(
|
|
2856
2861
|
"zs-absolute zs-top-0.5 zs-left-2 zs-right-2 zs-bottom-0.5 zs-rounded-lg",
|
|
2857
2862
|
D`
|
|
2858
2863
|
z-index: -1;
|
|
@@ -2872,12 +2877,12 @@ const Ys = De(({ src: t }) => {
|
|
|
2872
2877
|
/* @__PURE__ */ s(
|
|
2873
2878
|
V.div,
|
|
2874
2879
|
{
|
|
2875
|
-
className:
|
|
2880
|
+
className: L(
|
|
2876
2881
|
"zs-flex-1 zs-text-sm",
|
|
2877
2882
|
D`
|
|
2878
2883
|
font-weight: 400;
|
|
2879
2884
|
line-height: 18px;
|
|
2880
|
-
color: ${((
|
|
2885
|
+
color: ${((c = a.token.contextMenu) == null ? void 0 : c.textColor) || "#1d1d1f"};
|
|
2881
2886
|
letter-spacing: -0.28px;
|
|
2882
2887
|
`
|
|
2883
2888
|
),
|
|
@@ -2887,7 +2892,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2887
2892
|
m && /* @__PURE__ */ s(
|
|
2888
2893
|
V.div,
|
|
2889
2894
|
{
|
|
2890
|
-
className:
|
|
2895
|
+
className: L(
|
|
2891
2896
|
"zs-flex zs-items-center zs-justify-center zs-shrink-0",
|
|
2892
2897
|
D`
|
|
2893
2898
|
color: ${((u = a.token.contextMenu) == null ? void 0 : u.textColor) || "#1d1d1f"};
|
|
@@ -2915,21 +2920,21 @@ const Ys = De(({ src: t }) => {
|
|
|
2915
2920
|
onInfoClick: l,
|
|
2916
2921
|
onShareClick: m,
|
|
2917
2922
|
onRemoveClick: p
|
|
2918
|
-
} = t, { contextMenu:
|
|
2923
|
+
} = t, { contextMenu: c, setContextMenu: u, hideContextMenu: f, setShowInfoItemData: d, removeItem: S, updateItemConfig: v } = Ae(), { typeConfigMap: z, dataTypeMenuConfigMap: y, theme: N } = pe(), [g, b] = R(null), { data: x } = c ?? {}, { config: k = {} } = x ?? {}, A = () => {
|
|
2919
2924
|
var F;
|
|
2920
|
-
return ct(((F =
|
|
2921
|
-
},
|
|
2925
|
+
return ct(((F = c == null ? void 0 : c.data) == null ? void 0 : F.type) || "app", z).sizeConfigs.map((E) => E.name);
|
|
2926
|
+
}, I = () => {
|
|
2922
2927
|
var F;
|
|
2923
|
-
const j = (F =
|
|
2928
|
+
const j = (F = c == null ? void 0 : c.data) == null ? void 0 : F.dataType;
|
|
2924
2929
|
return !j || !y ? [] : y[j] || [];
|
|
2925
2930
|
}, P = {
|
|
2926
2931
|
setContextMenu: u,
|
|
2927
2932
|
hideContextMenu: f,
|
|
2928
|
-
setShowInfoItemData:
|
|
2929
|
-
removeItem:
|
|
2933
|
+
setShowInfoItemData: d,
|
|
2934
|
+
removeItem: S,
|
|
2930
2935
|
updateItemConfig: v
|
|
2931
2936
|
};
|
|
2932
|
-
return /* @__PURE__ */ s(ze, { children:
|
|
2937
|
+
return /* @__PURE__ */ s(ze, { children: c && i && /* @__PURE__ */ s(St.Provider, { value: { hoveredIndex: g, setHoveredIndex: b }, children: /* @__PURE__ */ T(
|
|
2933
2938
|
Lo,
|
|
2934
2939
|
{
|
|
2935
2940
|
style: {
|
|
@@ -2941,15 +2946,15 @@ const Ys = De(({ src: t }) => {
|
|
|
2941
2946
|
{
|
|
2942
2947
|
text: "移除",
|
|
2943
2948
|
icon: /* @__PURE__ */ s(un, {}),
|
|
2944
|
-
color: ((B =
|
|
2945
|
-
textColor: ((J =
|
|
2949
|
+
color: ((B = N.token.contextMenu) == null ? void 0 : B.dangerColor) || "#ff3b30",
|
|
2950
|
+
textColor: ((J = N.token.contextMenu) == null ? void 0 : J.dangerColor) || "#ff3b30",
|
|
2946
2951
|
index: 0,
|
|
2947
2952
|
onClick: () => {
|
|
2948
2953
|
if (p) {
|
|
2949
|
-
p(
|
|
2954
|
+
p(c.data, S);
|
|
2950
2955
|
return;
|
|
2951
2956
|
}
|
|
2952
|
-
u(null),
|
|
2957
|
+
u(null), S(c.data.id);
|
|
2953
2958
|
}
|
|
2954
2959
|
}
|
|
2955
2960
|
),
|
|
@@ -2961,7 +2966,7 @@ const Ys = De(({ src: t }) => {
|
|
|
2961
2966
|
index: 1,
|
|
2962
2967
|
onClick: () => {
|
|
2963
2968
|
if (m) {
|
|
2964
|
-
m(
|
|
2969
|
+
m(c.data);
|
|
2965
2970
|
return;
|
|
2966
2971
|
}
|
|
2967
2972
|
}
|
|
@@ -2975,20 +2980,20 @@ const Ys = De(({ src: t }) => {
|
|
|
2975
2980
|
index: 2,
|
|
2976
2981
|
onClick: () => {
|
|
2977
2982
|
if (l) {
|
|
2978
|
-
l(
|
|
2983
|
+
l(c.data);
|
|
2979
2984
|
return;
|
|
2980
2985
|
}
|
|
2981
|
-
|
|
2982
|
-
...
|
|
2983
|
-
pageX:
|
|
2984
|
-
pageY:
|
|
2986
|
+
d({
|
|
2987
|
+
...c.data,
|
|
2988
|
+
pageX: c.pageX,
|
|
2989
|
+
pageY: c.pageY
|
|
2985
2990
|
}), f();
|
|
2986
2991
|
}
|
|
2987
2992
|
}
|
|
2988
2993
|
),
|
|
2989
2994
|
n && k.allowResize !== !1 && (() => {
|
|
2990
2995
|
var G, se;
|
|
2991
|
-
const j = ct(((G =
|
|
2996
|
+
const j = ct(((G = c == null ? void 0 : c.data) == null ? void 0 : G.type) || "app", z), F = vo(
|
|
2992
2997
|
(se = x == null ? void 0 : x.config) == null ? void 0 : se.sizeId,
|
|
2993
2998
|
j.sizeConfigs,
|
|
2994
2999
|
j.defaultSizeId
|
|
@@ -3001,14 +3006,14 @@ const Ys = De(({ src: t }) => {
|
|
|
3001
3006
|
currentSize: F.name,
|
|
3002
3007
|
onSizeChange: (Z) => {
|
|
3003
3008
|
const Y = j.sizeConfigs.find((re) => re.name === Z);
|
|
3004
|
-
Y && v(
|
|
3009
|
+
Y && v(c.data.id, {
|
|
3005
3010
|
sizeId: Y.id || Z
|
|
3006
3011
|
});
|
|
3007
3012
|
}
|
|
3008
3013
|
}
|
|
3009
3014
|
) });
|
|
3010
3015
|
})(),
|
|
3011
|
-
|
|
3016
|
+
I().map((j, F) => {
|
|
3012
3017
|
let E = 0;
|
|
3013
3018
|
return o && E++, r && E++, e && E++, n && k.allowResize !== !1 && E++, E += F, /* @__PURE__ */ s(
|
|
3014
3019
|
st,
|
|
@@ -3019,7 +3024,7 @@ const Ys = De(({ src: t }) => {
|
|
|
3019
3024
|
textColor: j.textColor,
|
|
3020
3025
|
index: E,
|
|
3021
3026
|
onClick: () => {
|
|
3022
|
-
j.onClick && j.onClick(
|
|
3027
|
+
j.onClick && j.onClick(c.data, P);
|
|
3023
3028
|
}
|
|
3024
3029
|
},
|
|
3025
3030
|
`custom-${F}`
|
|
@@ -3043,7 +3048,7 @@ const Ys = De(({ src: t }) => {
|
|
|
3043
3048
|
const { contextMenu: e, setContextMenu: o } = Ae(), [r, n] = R(!1), [a, i] = R(!1), [l, m] = R({
|
|
3044
3049
|
left: 0,
|
|
3045
3050
|
top: 0
|
|
3046
|
-
}), [p,
|
|
3051
|
+
}), [p, c] = R("center"), u = le(
|
|
3047
3052
|
(y) => ({
|
|
3048
3053
|
left: y.left,
|
|
3049
3054
|
right: y.right,
|
|
@@ -3053,18 +3058,18 @@ const Ys = De(({ src: t }) => {
|
|
|
3053
3058
|
height: y.height
|
|
3054
3059
|
}),
|
|
3055
3060
|
[]
|
|
3056
|
-
), f = le((y,
|
|
3061
|
+
), f = le((y, N, g, b) => {
|
|
3057
3062
|
const x = aa(), k = Re.GAP;
|
|
3058
3063
|
return {
|
|
3059
3064
|
left: Math.max(x.left + k, Math.min(y, x.right - g - k)),
|
|
3060
|
-
top: Math.max(x.top + k, Math.min(
|
|
3065
|
+
top: Math.max(x.top + k, Math.min(N, x.bottom - b - k))
|
|
3061
3066
|
};
|
|
3062
|
-
}, []),
|
|
3063
|
-
(y,
|
|
3067
|
+
}, []), d = le(
|
|
3068
|
+
(y, N, g) => {
|
|
3064
3069
|
const b = Re.GAP;
|
|
3065
3070
|
let x = y.right + b, k = y.top;
|
|
3066
|
-
if (x +
|
|
3067
|
-
if (x = y.left -
|
|
3071
|
+
if (x + N > window.innerWidth) {
|
|
3072
|
+
if (x = y.left - N - b, x < 0) {
|
|
3068
3073
|
x = y.left, k = y.bottom + b;
|
|
3069
3074
|
const A = window.innerHeight + window.scrollY;
|
|
3070
3075
|
k + g > A && (k = y.top - g - b);
|
|
@@ -3073,14 +3078,14 @@ const Ys = De(({ src: t }) => {
|
|
|
3073
3078
|
const A = window.innerHeight + window.scrollY;
|
|
3074
3079
|
if (k + g > A) {
|
|
3075
3080
|
k = y.bottom - g;
|
|
3076
|
-
const
|
|
3077
|
-
k <
|
|
3081
|
+
const I = window.scrollY;
|
|
3082
|
+
k < I + b && (k = I + b);
|
|
3078
3083
|
}
|
|
3079
3084
|
}
|
|
3080
|
-
return f(x, k,
|
|
3085
|
+
return f(x, k, N, g);
|
|
3081
3086
|
},
|
|
3082
3087
|
[f]
|
|
3083
|
-
),
|
|
3088
|
+
), S = e ? {
|
|
3084
3089
|
getBoundingClientRect() {
|
|
3085
3090
|
return {
|
|
3086
3091
|
width: 0,
|
|
@@ -3108,21 +3113,21 @@ const Ys = De(({ src: t }) => {
|
|
|
3108
3113
|
],
|
|
3109
3114
|
whileElementsMounted: Dn,
|
|
3110
3115
|
elements: {
|
|
3111
|
-
reference:
|
|
3116
|
+
reference: S
|
|
3112
3117
|
}
|
|
3113
|
-
}), z = (y,
|
|
3114
|
-
const b = y < g.left, x = y > g.right, k =
|
|
3118
|
+
}), z = (y, N, g) => {
|
|
3119
|
+
const b = y < g.left, x = y > g.right, k = N < g.top, A = N > g.bottom;
|
|
3115
3120
|
return x ? k ? "bottom left" : A ? "top left" : "center left" : b ? k ? "bottom right" : A ? "top right" : "center right" : A ? "top center" : k ? "bottom center" : "center";
|
|
3116
3121
|
};
|
|
3117
3122
|
return X(() => {
|
|
3118
3123
|
if (e) {
|
|
3119
3124
|
i(!0), n(!0);
|
|
3120
|
-
const { rect: y } = e,
|
|
3121
|
-
|
|
3125
|
+
const { rect: y } = e, N = u(y), { left: g, top: b } = d(
|
|
3126
|
+
N,
|
|
3122
3127
|
Re.ESTIMATED_MENU_WIDTH,
|
|
3123
3128
|
Re.ESTIMATED_MENU_HEIGHT
|
|
3124
|
-
), x = z(g, b,
|
|
3125
|
-
|
|
3129
|
+
), x = z(g, b, N);
|
|
3130
|
+
c(x), m({ left: g, top: b });
|
|
3126
3131
|
} else {
|
|
3127
3132
|
n(!1);
|
|
3128
3133
|
const y = setTimeout(() => {
|
|
@@ -3130,23 +3135,23 @@ const Ys = De(({ src: t }) => {
|
|
|
3130
3135
|
}, Re.ANIMATION_DELAY);
|
|
3131
3136
|
return () => clearTimeout(y);
|
|
3132
3137
|
}
|
|
3133
|
-
}, [e, u,
|
|
3138
|
+
}, [e, u, d]), X(() => {
|
|
3134
3139
|
r && v.floating.current && e && a && requestAnimationFrame(() => {
|
|
3135
|
-
const { rect: y } = e,
|
|
3136
|
-
|
|
3140
|
+
const { rect: y } = e, N = u(y), g = v.floating.current, b = (g == null ? void 0 : g.offsetWidth) || Re.ESTIMATED_MENU_WIDTH, x = (g == null ? void 0 : g.offsetHeight) || Re.ESTIMATED_MENU_HEIGHT, { left: k, top: A } = d(N, b, x), I = z(k, A, N);
|
|
3141
|
+
c(I), m({ left: k, top: A });
|
|
3137
3142
|
});
|
|
3138
|
-
}, [r, e, v, a, u,
|
|
3143
|
+
}, [r, e, v, a, u, d]), X(() => {
|
|
3139
3144
|
if (!r) return;
|
|
3140
3145
|
const y = (b) => {
|
|
3141
3146
|
const x = b.target, k = v.floating.current;
|
|
3142
3147
|
k && !k.contains(x) && o(null);
|
|
3143
|
-
},
|
|
3148
|
+
}, N = (b) => {
|
|
3144
3149
|
b.key === "Escape" && o(null);
|
|
3145
3150
|
}, g = setTimeout(() => {
|
|
3146
|
-
document.addEventListener("mousedown", y), document.addEventListener("keydown",
|
|
3151
|
+
document.addEventListener("mousedown", y), document.addEventListener("keydown", N);
|
|
3147
3152
|
}, Re.EVENT_LISTENER_DELAY);
|
|
3148
3153
|
return () => {
|
|
3149
|
-
clearTimeout(g), document.removeEventListener("mousedown", y), document.removeEventListener("keydown",
|
|
3154
|
+
clearTimeout(g), document.removeEventListener("mousedown", y), document.removeEventListener("keydown", N);
|
|
3150
3155
|
};
|
|
3151
3156
|
}, [r, o, v.floating]), a ? /* @__PURE__ */ s(Pn, { children: /* @__PURE__ */ s(
|
|
3152
3157
|
"div",
|
|
@@ -3176,11 +3181,11 @@ const Ys = De(({ src: t }) => {
|
|
|
3176
3181
|
noLetters: l,
|
|
3177
3182
|
typeConfigMap: m,
|
|
3178
3183
|
contextMenu: p,
|
|
3179
|
-
contextMenuBuilder:
|
|
3184
|
+
contextMenuBuilder: c,
|
|
3180
3185
|
itemBuilder: u,
|
|
3181
3186
|
itemIconBuilder: f,
|
|
3182
|
-
pagingDotBuilder:
|
|
3183
|
-
pagingDotsBuilder:
|
|
3187
|
+
pagingDotBuilder: d,
|
|
3188
|
+
pagingDotsBuilder: S,
|
|
3184
3189
|
...v
|
|
3185
3190
|
} = t, z = {
|
|
3186
3191
|
list: o,
|
|
@@ -3193,11 +3198,11 @@ const Ys = De(({ src: t }) => {
|
|
|
3193
3198
|
typeConfigMap: m,
|
|
3194
3199
|
dataTypeMenuConfigMap: t.dataTypeMenuConfigMap,
|
|
3195
3200
|
contextMenu: p,
|
|
3196
|
-
pagingDotsBuilder:
|
|
3197
|
-
pagingDotBuilder:
|
|
3201
|
+
pagingDotsBuilder: S,
|
|
3202
|
+
pagingDotBuilder: d,
|
|
3198
3203
|
itemBuilder: u,
|
|
3199
3204
|
itemIconBuilder: f,
|
|
3200
|
-
contextMenuBuilder:
|
|
3205
|
+
contextMenuBuilder: c
|
|
3201
3206
|
};
|
|
3202
3207
|
return /* @__PURE__ */ s(go, { ...z, children: /* @__PURE__ */ T(mo, { ...y, children: [
|
|
3203
3208
|
/* @__PURE__ */ s(() => {
|
|
@@ -3456,7 +3461,7 @@ const Ys = De(({ src: t }) => {
|
|
|
3456
3461
|
margin-bottom: 0;
|
|
3457
3462
|
}
|
|
3458
3463
|
}
|
|
3459
|
-
`, To =
|
|
3464
|
+
`, To = L(
|
|
3460
3465
|
"markdown-body",
|
|
3461
3466
|
D`
|
|
3462
3467
|
p {
|
|
@@ -3603,13 +3608,13 @@ const Ys = De(({ src: t }) => {
|
|
|
3603
3608
|
...l
|
|
3604
3609
|
} = t, m = oe(null), {
|
|
3605
3610
|
image: p,
|
|
3606
|
-
diffSource:
|
|
3611
|
+
diffSource: c = {
|
|
3607
3612
|
viewMode: "rich-text"
|
|
3608
3613
|
},
|
|
3609
3614
|
headings: u,
|
|
3610
3615
|
link: f,
|
|
3611
|
-
codeBlock:
|
|
3612
|
-
codeMirror:
|
|
3616
|
+
codeBlock: d,
|
|
3617
|
+
codeMirror: S = {
|
|
3613
3618
|
codeBlockLanguages: {
|
|
3614
3619
|
js: "JavaScript",
|
|
3615
3620
|
css: "CSS",
|
|
@@ -3623,13 +3628,13 @@ const Ys = De(({ src: t }) => {
|
|
|
3623
3628
|
}
|
|
3624
3629
|
} = n ?? {}, [z, y] = R("");
|
|
3625
3630
|
return X(() => {
|
|
3626
|
-
var
|
|
3627
|
-
e !== void 0 && m.current && ((
|
|
3631
|
+
var N;
|
|
3632
|
+
e !== void 0 && m.current && ((N = m.current) == null || N.setMarkdown(e), y(e));
|
|
3628
3633
|
}, [e, m]), /* @__PURE__ */ s(
|
|
3629
3634
|
$n,
|
|
3630
3635
|
{
|
|
3631
3636
|
ref: m,
|
|
3632
|
-
className:
|
|
3637
|
+
className: L(
|
|
3633
3638
|
ma,
|
|
3634
3639
|
kt(i) ? ua : "",
|
|
3635
3640
|
kt(i) ? Ao : Do,
|
|
@@ -3637,8 +3642,8 @@ const Ys = De(({ src: t }) => {
|
|
|
3637
3642
|
),
|
|
3638
3643
|
contentEditableClassName: To,
|
|
3639
3644
|
markdown: z,
|
|
3640
|
-
onChange: (
|
|
3641
|
-
!e && !o && y(
|
|
3645
|
+
onChange: (N) => {
|
|
3646
|
+
!e && !o && y(N), o && o(N);
|
|
3642
3647
|
},
|
|
3643
3648
|
translation: r ?? da,
|
|
3644
3649
|
plugins: [
|
|
@@ -3664,7 +3669,7 @@ const Ys = De(({ src: t }) => {
|
|
|
3664
3669
|
/* @__PURE__ */ s(dr, {})
|
|
3665
3670
|
] })
|
|
3666
3671
|
}),
|
|
3667
|
-
On(
|
|
3672
|
+
On(c),
|
|
3668
3673
|
Fn(),
|
|
3669
3674
|
Hn(),
|
|
3670
3675
|
jn(u),
|
|
@@ -3674,8 +3679,8 @@ const Ys = De(({ src: t }) => {
|
|
|
3674
3679
|
Yn(),
|
|
3675
3680
|
Vn(),
|
|
3676
3681
|
Xn(),
|
|
3677
|
-
qn(
|
|
3678
|
-
Zn(
|
|
3682
|
+
qn(d),
|
|
3683
|
+
Zn(S),
|
|
3679
3684
|
Kn(),
|
|
3680
3685
|
Jn(v)
|
|
3681
3686
|
],
|
|
@@ -3691,22 +3696,22 @@ const Ys = De(({ src: t }) => {
|
|
|
3691
3696
|
children: /* @__PURE__ */ s(
|
|
3692
3697
|
so,
|
|
3693
3698
|
{
|
|
3694
|
-
className:
|
|
3699
|
+
className: L(To, o),
|
|
3695
3700
|
remarkPlugins: [ur, mr],
|
|
3696
3701
|
rehypePlugins: [fr],
|
|
3697
3702
|
components: {
|
|
3698
3703
|
code(a) {
|
|
3699
|
-
const { children: i, className: l, node: m, ref: p, ...
|
|
3704
|
+
const { children: i, className: l, node: m, ref: p, ...c } = a, u = /language-(\w+)/.exec(l || "");
|
|
3700
3705
|
return u ? /* @__PURE__ */ s(
|
|
3701
3706
|
gr,
|
|
3702
3707
|
{
|
|
3703
|
-
...
|
|
3708
|
+
...c,
|
|
3704
3709
|
PreTag: "div",
|
|
3705
3710
|
children: String(i).replace(/\n$/, ""),
|
|
3706
3711
|
language: u[1],
|
|
3707
3712
|
style: pr
|
|
3708
3713
|
}
|
|
3709
|
-
) : /* @__PURE__ */ s("code", { ...
|
|
3714
|
+
) : /* @__PURE__ */ s("code", { ...c, className: l, children: i });
|
|
3710
3715
|
},
|
|
3711
3716
|
img(a) {
|
|
3712
3717
|
const { preview: i, ...l } = n ?? {};
|
|
@@ -3759,16 +3764,16 @@ const Mt = (t) => {
|
|
|
3759
3764
|
componentClassName: l = "zs-rounded-full zs-bg-gray-200 dark:zs-bg-neutral-800",
|
|
3760
3765
|
titleClassName: m = "zs-rounded-md zs-bg-gray-100 zs-border dark:zs-bg-neutral-800 dark:zs-border-neutral-900 dark:zs-text-white zs-border-gray-200 zs-text-neutral-700",
|
|
3761
3766
|
childrenClassName: p,
|
|
3762
|
-
...
|
|
3767
|
+
...c
|
|
3763
3768
|
} = t, u = oe(null), f = He(e, (P) => {
|
|
3764
3769
|
var J;
|
|
3765
3770
|
const B = ((J = u.current) == null ? void 0 : J.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
3766
3771
|
return P - B.x - B.width / 2;
|
|
3767
|
-
}),
|
|
3772
|
+
}), d = He(f, [-150, 0, 150], [40, 80, 40]), S = He(f, [-150, 0, 150], [40, 80, 40]), v = He(f, [-150, 0, 150], [20, 40, 20]), z = He(f, [-150, 0, 150], [20, 40, 20]), y = nt(d, {
|
|
3768
3773
|
mass: 0.1,
|
|
3769
3774
|
stiffness: 150,
|
|
3770
3775
|
damping: 12
|
|
3771
|
-
}),
|
|
3776
|
+
}), N = nt(S, {
|
|
3772
3777
|
mass: 0.1,
|
|
3773
3778
|
stiffness: 150,
|
|
3774
3779
|
damping: 12
|
|
@@ -3780,15 +3785,15 @@ const Mt = (t) => {
|
|
|
3780
3785
|
mass: 0.1,
|
|
3781
3786
|
stiffness: 150,
|
|
3782
3787
|
damping: 12
|
|
3783
|
-
}), x = He(g, (P) => `${P}px`), [k, A] = R(!1),
|
|
3788
|
+
}), x = He(g, (P) => `${P}px`), [k, A] = R(!1), I = /* @__PURE__ */ T(
|
|
3784
3789
|
i,
|
|
3785
3790
|
{
|
|
3786
3791
|
ref: u,
|
|
3787
|
-
style: { width: y, height:
|
|
3792
|
+
style: { width: y, height: N },
|
|
3788
3793
|
onMouseEnter: () => A(!0),
|
|
3789
3794
|
onMouseLeave: () => A(!1),
|
|
3790
3795
|
className: Ze("zs-aspect-square zs-flex zs-items-center zs-justify-center zs-relative", l),
|
|
3791
|
-
...
|
|
3796
|
+
...c,
|
|
3792
3797
|
children: [
|
|
3793
3798
|
o && /* @__PURE__ */ s(ze, { children: k && /* @__PURE__ */ s(
|
|
3794
3799
|
V.div,
|
|
@@ -3818,7 +3823,7 @@ const Mt = (t) => {
|
|
|
3818
3823
|
]
|
|
3819
3824
|
}
|
|
3820
3825
|
);
|
|
3821
|
-
return n ? /* @__PURE__ */ s("a", { href: n, children:
|
|
3826
|
+
return n ? /* @__PURE__ */ s("a", { href: n, children: I }) : I;
|
|
3822
3827
|
}, Lt = (t) => {
|
|
3823
3828
|
const {
|
|
3824
3829
|
items: e = [],
|
|
@@ -3880,7 +3885,7 @@ const Mt = (t) => {
|
|
|
3880
3885
|
layoutId: "nav",
|
|
3881
3886
|
className: "zs-absolute zs-bottom-full zs-mb-2 zs-inset-x-0 zs-flex zs-flex-col zs-gap-2",
|
|
3882
3887
|
children: i || e.map(
|
|
3883
|
-
(
|
|
3888
|
+
(c, u) => a ? /* @__PURE__ */ s(dt, { ...c, index: u, totalItems: e.length, children: a(c, u, e) }, c.title) : /* @__PURE__ */ s(dt, { ...c, index: u, totalItems: e.length }, c.title)
|
|
3884
3889
|
)
|
|
3885
3890
|
}
|
|
3886
3891
|
) }),
|
|
@@ -4003,45 +4008,45 @@ function at(t, e) {
|
|
|
4003
4008
|
}
|
|
4004
4009
|
function xa(t) {
|
|
4005
4010
|
let e = "", o = !1;
|
|
4006
|
-
function r(
|
|
4007
|
-
if (u.focus(), !
|
|
4011
|
+
function r(c, u) {
|
|
4012
|
+
if (u.focus(), !c.dataTransfer) return;
|
|
4008
4013
|
const f = At(
|
|
4009
4014
|
{
|
|
4010
|
-
x:
|
|
4011
|
-
y:
|
|
4015
|
+
x: c.clientX + 50 + t.dragHandleWidth,
|
|
4016
|
+
y: c.clientY
|
|
4012
4017
|
},
|
|
4013
4018
|
t
|
|
4014
4019
|
);
|
|
4015
4020
|
if (!(f instanceof Element)) return;
|
|
4016
|
-
let
|
|
4017
|
-
if (
|
|
4018
|
-
|
|
4019
|
-
const { from:
|
|
4020
|
-
let
|
|
4021
|
+
let d = Et(f, u, t);
|
|
4022
|
+
if (d == null || d < 0) return;
|
|
4023
|
+
d = at(d, u);
|
|
4024
|
+
const { from: S, to: v } = u.state.selection, z = S - v, y = at(S, u);
|
|
4025
|
+
let N = !1;
|
|
4021
4026
|
const g = u.state.doc.resolve(y);
|
|
4022
|
-
if (g.node().type.name === "doc")
|
|
4027
|
+
if (g.node().type.name === "doc") N = !0;
|
|
4023
4028
|
else {
|
|
4024
|
-
const
|
|
4029
|
+
const I = ke.create(
|
|
4025
4030
|
u.state.doc,
|
|
4026
4031
|
g.before()
|
|
4027
4032
|
);
|
|
4028
|
-
|
|
4033
|
+
N = !(d + 1 >= I.$from.pos && d <= I.$to.pos);
|
|
4029
4034
|
}
|
|
4030
4035
|
let b = u.state.selection;
|
|
4031
|
-
if (!
|
|
4032
|
-
const
|
|
4036
|
+
if (!N && z !== 0 && !(u.state.selection instanceof ke)) {
|
|
4037
|
+
const I = ke.create(u.state.doc, v - 1);
|
|
4033
4038
|
b = ls.create(
|
|
4034
4039
|
u.state.doc,
|
|
4035
|
-
|
|
4036
|
-
|
|
4040
|
+
d,
|
|
4041
|
+
I.$to.pos
|
|
4037
4042
|
);
|
|
4038
|
-
} else if (b = ke.create(u.state.doc,
|
|
4039
|
-
const
|
|
4040
|
-
b = ke.create(u.state.doc,
|
|
4043
|
+
} else if (b = ke.create(u.state.doc, d), b.node.type.isInline || b.node.type.name === "tableRow") {
|
|
4044
|
+
const I = u.state.doc.resolve(b.from);
|
|
4045
|
+
b = ke.create(u.state.doc, I.before());
|
|
4041
4046
|
}
|
|
4042
4047
|
u.dispatch(u.state.tr.setSelection(b)), u.state.selection instanceof ke && u.state.selection.node.type.name === "listItem" && (e = f.parentElement.tagName);
|
|
4043
4048
|
const x = u.state.selection.content(), { dom: k, text: A } = ba(u, x);
|
|
4044
|
-
|
|
4049
|
+
c.dataTransfer.clearData(), c.dataTransfer.setData("text/html", k.innerHTML), c.dataTransfer.setData("text/plain", A), c.dataTransfer.effectAllowed = "copyMove", c.dataTransfer.setDragImage(f, 0, 0), u.dragging = { slice: x, move: c.ctrlKey };
|
|
4045
4050
|
}
|
|
4046
4051
|
let n = null;
|
|
4047
4052
|
function a() {
|
|
@@ -4050,63 +4055,63 @@ function xa(t) {
|
|
|
4050
4055
|
function i() {
|
|
4051
4056
|
n && n.classList.remove("hide");
|
|
4052
4057
|
}
|
|
4053
|
-
function l(
|
|
4054
|
-
const f = at(u,
|
|
4055
|
-
|
|
4058
|
+
function l(c, u) {
|
|
4059
|
+
const f = at(u, c), d = ke.create(c.state.doc, f);
|
|
4060
|
+
c.dispatch(c.state.tr.setSelection(d)), c.focus(), o = !0;
|
|
4056
4061
|
}
|
|
4057
|
-
function m(
|
|
4058
|
-
if (o =
|
|
4062
|
+
function m(c) {
|
|
4063
|
+
if (o = c.state.selection instanceof ke, o && (n != null && n.dataset.nodePos)) {
|
|
4059
4064
|
const f = parseInt(n.dataset.nodePos, 10);
|
|
4060
4065
|
try {
|
|
4061
|
-
const
|
|
4062
|
-
|
|
4066
|
+
const d = c.state.doc.resolve(f);
|
|
4067
|
+
d && d.parent && d.parent.type.name !== "doc" || (o = !1, a());
|
|
4063
4068
|
} catch {
|
|
4064
4069
|
o = !1, a();
|
|
4065
4070
|
}
|
|
4066
4071
|
}
|
|
4067
4072
|
o && n && !n.classList.contains("hide") ? i() : o || a();
|
|
4068
4073
|
}
|
|
4069
|
-
function p(
|
|
4070
|
-
if (!(
|
|
4071
|
-
const u =
|
|
4074
|
+
function p(c) {
|
|
4075
|
+
if (!(c.target instanceof Element)) return;
|
|
4076
|
+
const u = c.relatedTarget;
|
|
4072
4077
|
if (!u) {
|
|
4073
4078
|
o || a();
|
|
4074
4079
|
return;
|
|
4075
4080
|
}
|
|
4076
|
-
const f = u.closest(".drag-handle") || u.classList.contains("drag-handle"),
|
|
4077
|
-
!f && !
|
|
4081
|
+
const f = u.closest(".drag-handle") || u.classList.contains("drag-handle"), d = u.closest(".tiptap") || u.classList.contains("tiptap");
|
|
4082
|
+
!f && !d && !o && a();
|
|
4078
4083
|
}
|
|
4079
4084
|
return new as({
|
|
4080
4085
|
key: new is(t.pluginKey),
|
|
4081
|
-
view: (
|
|
4082
|
-
var v, z, y,
|
|
4086
|
+
view: (c) => {
|
|
4087
|
+
var v, z, y, N;
|
|
4083
4088
|
const u = t.dragHandleSelector ? document.querySelector(t.dragHandleSelector) : null;
|
|
4084
4089
|
n = u ?? document.createElement("div"), n.draggable = !0, n.dataset.dragHandle = "", n.classList.add("drag-handle");
|
|
4085
4090
|
function f(g) {
|
|
4086
|
-
r(g,
|
|
4091
|
+
r(g, c);
|
|
4087
4092
|
}
|
|
4088
4093
|
n.addEventListener("dragstart", f);
|
|
4089
|
-
function
|
|
4094
|
+
function d(g) {
|
|
4090
4095
|
u || (g.preventDefault(), g.stopPropagation());
|
|
4091
4096
|
const b = n == null ? void 0 : n.dataset.nodePos;
|
|
4092
|
-
b && l(
|
|
4097
|
+
b && l(c, parseInt(b, 10));
|
|
4093
4098
|
}
|
|
4094
|
-
n.addEventListener("click",
|
|
4095
|
-
function
|
|
4099
|
+
n.addEventListener("click", d);
|
|
4100
|
+
function S(g) {
|
|
4096
4101
|
a();
|
|
4097
4102
|
const b = window.scrollY;
|
|
4098
4103
|
g.clientY < t.scrollTreshold ? window.scrollTo({ top: b - 30, behavior: "smooth" }) : window.innerHeight - g.clientY < t.scrollTreshold && window.scrollTo({ top: b + 30, behavior: "smooth" });
|
|
4099
4104
|
}
|
|
4100
|
-
return n.addEventListener("drag",
|
|
4105
|
+
return n.addEventListener("drag", S), a(), u || (z = (v = c == null ? void 0 : c.dom) == null ? void 0 : v.parentElement) == null || z.appendChild(n), (N = (y = c == null ? void 0 : c.dom) == null ? void 0 : y.parentElement) == null || N.addEventListener(
|
|
4101
4106
|
"mouseout",
|
|
4102
4107
|
p
|
|
4103
4108
|
), {
|
|
4104
4109
|
destroy: () => {
|
|
4105
4110
|
var g, b, x;
|
|
4106
|
-
u || (g = n == null ? void 0 : n.remove) == null || g.call(n), n == null || n.removeEventListener("drag",
|
|
4111
|
+
u || (g = n == null ? void 0 : n.remove) == null || g.call(n), n == null || n.removeEventListener("drag", S), n == null || n.removeEventListener(
|
|
4107
4112
|
"dragstart",
|
|
4108
4113
|
f
|
|
4109
|
-
), n == null || n.removeEventListener("click",
|
|
4114
|
+
), n == null || n.removeEventListener("click", d), n = null, (x = (b = c == null ? void 0 : c.dom) == null ? void 0 : b.parentElement) == null || x.removeEventListener(
|
|
4110
4115
|
"mouseout",
|
|
4111
4116
|
p
|
|
4112
4117
|
);
|
|
@@ -4115,8 +4120,8 @@ function xa(t) {
|
|
|
4115
4120
|
},
|
|
4116
4121
|
props: {
|
|
4117
4122
|
handleDOMEvents: {
|
|
4118
|
-
mousemove: (
|
|
4119
|
-
if (!
|
|
4123
|
+
mousemove: (c, u) => {
|
|
4124
|
+
if (!c.editable)
|
|
4120
4125
|
return;
|
|
4121
4126
|
const f = At(
|
|
4122
4127
|
{
|
|
@@ -4124,17 +4129,17 @@ function xa(t) {
|
|
|
4124
4129
|
y: u.clientY
|
|
4125
4130
|
},
|
|
4126
4131
|
t
|
|
4127
|
-
),
|
|
4128
|
-
if (!(f instanceof Element) || f.matches(
|
|
4132
|
+
), d = f == null ? void 0 : f.closest(".not-draggable"), S = t.excludedTags.concat(["ol", "ul"]).join(", ");
|
|
4133
|
+
if (!(f instanceof Element) || f.matches(S) || d) {
|
|
4129
4134
|
o || a();
|
|
4130
4135
|
return;
|
|
4131
4136
|
}
|
|
4132
|
-
const v = Et(f,
|
|
4137
|
+
const v = Et(f, c, t);
|
|
4133
4138
|
v != null && v >= 0 && (n.dataset.nodePos = String(
|
|
4134
|
-
at(v,
|
|
4139
|
+
at(v, c)
|
|
4135
4140
|
));
|
|
4136
|
-
const z = window.getComputedStyle(f), y = parseInt(z.lineHeight, 10),
|
|
4137
|
-
b.top += (
|
|
4141
|
+
const z = window.getComputedStyle(f), y = parseInt(z.lineHeight, 10), N = isNaN(y) ? parseInt(z.fontSize) * 1.2 : y, g = parseInt(z.paddingTop, 10), b = ya(f);
|
|
4142
|
+
b.top += (N - 24) / 2, b.top += g, f.matches("ul:not([data-type=taskList]) li, ol li") && (b.left -= t.dragHandleWidth - 28), b.width = t.dragHandleWidth, n && (n.style.position = "absolute", n.style.left = `${b.left - b.width}px`, n.style.top = `${b.top}px`, i());
|
|
4138
4143
|
},
|
|
4139
4144
|
keydown: () => {
|
|
4140
4145
|
o || a();
|
|
@@ -4143,33 +4148,33 @@ function xa(t) {
|
|
|
4143
4148
|
o || a();
|
|
4144
4149
|
},
|
|
4145
4150
|
// 在选择状态变化时更新拖拽按钮的状态
|
|
4146
|
-
selectionChange: (
|
|
4147
|
-
m(
|
|
4151
|
+
selectionChange: (c) => {
|
|
4152
|
+
m(c);
|
|
4148
4153
|
},
|
|
4149
4154
|
// dragging class is used for CSS
|
|
4150
|
-
dragstart: (
|
|
4151
|
-
|
|
4155
|
+
dragstart: (c) => {
|
|
4156
|
+
c.dom.classList.add("dragging");
|
|
4152
4157
|
},
|
|
4153
|
-
drop: (
|
|
4158
|
+
drop: (c, u) => {
|
|
4154
4159
|
var z;
|
|
4155
|
-
|
|
4160
|
+
c.dom.classList.remove("dragging"), a();
|
|
4156
4161
|
let f = null;
|
|
4157
|
-
const
|
|
4162
|
+
const d = c.posAtCoords({
|
|
4158
4163
|
left: u.clientX,
|
|
4159
4164
|
top: u.clientY
|
|
4160
4165
|
});
|
|
4161
|
-
if (!
|
|
4162
|
-
const v =
|
|
4163
|
-
if (
|
|
4164
|
-
const y = (z =
|
|
4166
|
+
if (!d || (c.state.selection instanceof ke && (f = c.state.selection.node), !f)) return;
|
|
4167
|
+
const v = c.state.doc.resolve(d.pos).parent.type.name === "listItem";
|
|
4168
|
+
if (c.state.selection instanceof ke && c.state.selection.node.type.name === "listItem" && !v && e == "OL") {
|
|
4169
|
+
const y = (z = c.state.schema.nodes.orderedList) == null ? void 0 : z.createAndFill(
|
|
4165
4170
|
null,
|
|
4166
4171
|
f
|
|
4167
|
-
),
|
|
4168
|
-
|
|
4172
|
+
), N = new cs(ds.from(y), 0, 0);
|
|
4173
|
+
c.dragging = { slice: N, move: u.ctrlKey };
|
|
4169
4174
|
}
|
|
4170
4175
|
},
|
|
4171
|
-
dragend: (
|
|
4172
|
-
|
|
4176
|
+
dragend: (c) => {
|
|
4177
|
+
c.dom.classList.remove("dragging");
|
|
4173
4178
|
}
|
|
4174
4179
|
}
|
|
4175
4180
|
},
|
|
@@ -4178,11 +4183,11 @@ function xa(t) {
|
|
|
4178
4183
|
init() {
|
|
4179
4184
|
return {};
|
|
4180
4185
|
},
|
|
4181
|
-
apply(
|
|
4182
|
-
if (
|
|
4183
|
-
const
|
|
4186
|
+
apply(c, u, f, d) {
|
|
4187
|
+
if (c.docChanged && n && n.dataset.nodePos) {
|
|
4188
|
+
const S = parseInt(n.dataset.nodePos, 10);
|
|
4184
4189
|
try {
|
|
4185
|
-
const v =
|
|
4190
|
+
const v = d.doc.resolve(S);
|
|
4186
4191
|
(!v || v.parent.type.name === "doc") && (o = !1, a());
|
|
4187
4192
|
} catch {
|
|
4188
4193
|
o = !1, a();
|
|
@@ -4342,7 +4347,7 @@ const va = ss.create({
|
|
|
4342
4347
|
ref: n,
|
|
4343
4348
|
align: e,
|
|
4344
4349
|
sideOffset: o,
|
|
4345
|
-
className:
|
|
4350
|
+
className: L(
|
|
4346
4351
|
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
4347
4352
|
t
|
|
4348
4353
|
),
|
|
@@ -4378,7 +4383,7 @@ const Ba = os(
|
|
|
4378
4383
|
({ className: t, variant: e, size: o, asChild: r = !1, ...n }, a) => /* @__PURE__ */ s(
|
|
4379
4384
|
r ? fs : "button",
|
|
4380
4385
|
{
|
|
4381
|
-
className:
|
|
4386
|
+
className: L(Ba({ variant: e, size: o, className: t })),
|
|
4382
4387
|
ref: a,
|
|
4383
4388
|
...n
|
|
4384
4389
|
}
|
|
@@ -4615,7 +4620,7 @@ const Fa = ({ open: t, onOpenChange: e }) => {
|
|
|
4615
4620
|
/* @__PURE__ */ s(
|
|
4616
4621
|
"p",
|
|
4617
4622
|
{
|
|
4618
|
-
className:
|
|
4623
|
+
className: L(
|
|
4619
4624
|
"underline decoration-stone-400 underline-offset-4",
|
|
4620
4625
|
{
|
|
4621
4626
|
"text-blue-500": r.isActive("link")
|
|
@@ -4685,7 +4690,7 @@ const Fa = ({ open: t, onOpenChange: e }) => {
|
|
|
4685
4690
|
children: /* @__PURE__ */ s(
|
|
4686
4691
|
ps,
|
|
4687
4692
|
{
|
|
4688
|
-
className:
|
|
4693
|
+
className: L("size-4", { "text-blue-500": t.isActive("math") }),
|
|
4689
4694
|
strokeWidth: 2.3
|
|
4690
4695
|
}
|
|
4691
4696
|
)
|
|
@@ -4805,7 +4810,7 @@ const Fa = ({ open: t, onOpenChange: e }) => {
|
|
|
4805
4810
|
ref: n,
|
|
4806
4811
|
decorative: o,
|
|
4807
4812
|
orientation: e,
|
|
4808
|
-
className:
|
|
4813
|
+
className: L(
|
|
4809
4814
|
"shrink-0 bg-border",
|
|
4810
4815
|
e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
|
|
4811
4816
|
t
|
|
@@ -4823,7 +4828,7 @@ const Ua = () => /* @__PURE__ */ T("div", { className: "flex items-center justif
|
|
|
4823
4828
|
$e.Root,
|
|
4824
4829
|
{
|
|
4825
4830
|
ref: r,
|
|
4826
|
-
className:
|
|
4831
|
+
className: L("relative overflow-hidden", t),
|
|
4827
4832
|
...o,
|
|
4828
4833
|
children: [
|
|
4829
4834
|
/* @__PURE__ */ s($e.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
|
|
@@ -4838,7 +4843,7 @@ const _o = ae.forwardRef(({ className: t, orientation: e = "vertical", ...o }, r
|
|
|
4838
4843
|
{
|
|
4839
4844
|
ref: r,
|
|
4840
4845
|
orientation: e,
|
|
4841
|
-
className:
|
|
4846
|
+
className: L(
|
|
4842
4847
|
"flex touch-none select-none transition-colors",
|
|
4843
4848
|
e === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
4844
4849
|
e === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -4853,7 +4858,7 @@ const Wa = Le.Portal, Oo = ae.forwardRef(({ className: t, ...e }, o) => /* @__PU
|
|
|
4853
4858
|
Le.Overlay,
|
|
4854
4859
|
{
|
|
4855
4860
|
ref: o,
|
|
4856
|
-
className:
|
|
4861
|
+
className: L(
|
|
4857
4862
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
4858
4863
|
t
|
|
4859
4864
|
),
|
|
@@ -4867,7 +4872,7 @@ const Ga = ae.forwardRef(({ className: t, children: e, ...o }, r) => /* @__PURE_
|
|
|
4867
4872
|
Le.Content,
|
|
4868
4873
|
{
|
|
4869
4874
|
ref: r,
|
|
4870
|
-
className:
|
|
4875
|
+
className: L(
|
|
4871
4876
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
4872
4877
|
t
|
|
4873
4878
|
),
|
|
@@ -4887,7 +4892,7 @@ const Ya = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
|
4887
4892
|
Le.Title,
|
|
4888
4893
|
{
|
|
4889
4894
|
ref: o,
|
|
4890
|
-
className:
|
|
4895
|
+
className: L(
|
|
4891
4896
|
"text-lg font-semibold leading-none tracking-tight",
|
|
4892
4897
|
t
|
|
4893
4898
|
),
|
|
@@ -4899,7 +4904,7 @@ const Va = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
|
4899
4904
|
Le.Description,
|
|
4900
4905
|
{
|
|
4901
4906
|
ref: o,
|
|
4902
|
-
className:
|
|
4907
|
+
className: L("text-sm text-muted-foreground", t),
|
|
4903
4908
|
...e
|
|
4904
4909
|
}
|
|
4905
4910
|
));
|
|
@@ -4908,7 +4913,7 @@ const Fo = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
|
4908
4913
|
ye,
|
|
4909
4914
|
{
|
|
4910
4915
|
ref: o,
|
|
4911
|
-
className:
|
|
4916
|
+
className: L(
|
|
4912
4917
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
4913
4918
|
t
|
|
4914
4919
|
),
|
|
@@ -4922,7 +4927,7 @@ const Ho = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ T("div",
|
|
|
4922
4927
|
ye.Input,
|
|
4923
4928
|
{
|
|
4924
4929
|
ref: o,
|
|
4925
|
-
className:
|
|
4930
|
+
className: L(
|
|
4926
4931
|
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
4927
4932
|
t
|
|
4928
4933
|
),
|
|
@@ -4935,7 +4940,7 @@ const Xa = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
|
4935
4940
|
ye.List,
|
|
4936
4941
|
{
|
|
4937
4942
|
ref: o,
|
|
4938
|
-
className:
|
|
4943
|
+
className: L("max-h-[300px] overflow-y-auto overflow-x-hidden", t),
|
|
4939
4944
|
...e
|
|
4940
4945
|
}
|
|
4941
4946
|
));
|
|
@@ -4953,7 +4958,7 @@ const Qe = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
|
4953
4958
|
ye.Group,
|
|
4954
4959
|
{
|
|
4955
4960
|
ref: o,
|
|
4956
|
-
className:
|
|
4961
|
+
className: L(
|
|
4957
4962
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
4958
4963
|
t
|
|
4959
4964
|
),
|
|
@@ -4965,7 +4970,7 @@ const Dt = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
|
4965
4970
|
ye.Separator,
|
|
4966
4971
|
{
|
|
4967
4972
|
ref: o,
|
|
4968
|
-
className:
|
|
4973
|
+
className: L("-mx-1 h-px bg-border", t),
|
|
4969
4974
|
...e
|
|
4970
4975
|
}
|
|
4971
4976
|
));
|
|
@@ -4974,7 +4979,7 @@ const We = ae.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ s(
|
|
|
4974
4979
|
ye.Item,
|
|
4975
4980
|
{
|
|
4976
4981
|
ref: o,
|
|
4977
|
-
className:
|
|
4982
|
+
className: L(
|
|
4978
4983
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
|
|
4979
4984
|
t
|
|
4980
4985
|
),
|
|
@@ -5146,10 +5151,10 @@ function Qa({ onOpenChange: t, options: e }) {
|
|
|
5146
5151
|
return i(a, {
|
|
5147
5152
|
body: { option: "zap", command: r }
|
|
5148
5153
|
}).then(() => n(""));
|
|
5149
|
-
const p = o.state.selection.content(),
|
|
5154
|
+
const p = o.state.selection.content(), c = o.storage.markdown.serializer.serialize(
|
|
5150
5155
|
p.content
|
|
5151
5156
|
);
|
|
5152
|
-
i(
|
|
5157
|
+
i(c, {
|
|
5153
5158
|
body: { option: "zap", command: r }
|
|
5154
5159
|
}).then(() => n(""));
|
|
5155
5160
|
},
|
|
@@ -5168,7 +5173,7 @@ function Qa({ onOpenChange: t, options: e }) {
|
|
|
5168
5173
|
) : /* @__PURE__ */ s(
|
|
5169
5174
|
Ja,
|
|
5170
5175
|
{
|
|
5171
|
-
onSelect: (p,
|
|
5176
|
+
onSelect: (p, c) => i(p, { body: { option: c } })
|
|
5172
5177
|
}
|
|
5173
5178
|
)
|
|
5174
5179
|
] })
|
|
@@ -5305,7 +5310,7 @@ const ei = ({
|
|
|
5305
5310
|
children: /* @__PURE__ */ s(
|
|
5306
5311
|
o.icon,
|
|
5307
5312
|
{
|
|
5308
|
-
className:
|
|
5313
|
+
className: L("h-4 w-4", {
|
|
5309
5314
|
"text-blue-500": o.isActive(t)
|
|
5310
5315
|
})
|
|
5311
5316
|
}
|
|
@@ -5443,7 +5448,7 @@ const ei = ({
|
|
|
5443
5448
|
rt.Item,
|
|
5444
5449
|
{
|
|
5445
5450
|
onClick: i.onClick,
|
|
5446
|
-
className:
|
|
5451
|
+
className: L(
|
|
5447
5452
|
"gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
5448
5453
|
i.className
|
|
5449
5454
|
),
|
|
@@ -5461,7 +5466,7 @@ const ei = ({
|
|
|
5461
5466
|
rt.SubMenu,
|
|
5462
5467
|
{
|
|
5463
5468
|
expandIcon: /* @__PURE__ */ s(Vt, { size: 16 }),
|
|
5464
|
-
popupClassName:
|
|
5469
|
+
popupClassName: L(
|
|
5465
5470
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
|
|
5466
5471
|
D`
|
|
5467
5472
|
.rc-menu {
|
|
@@ -5471,7 +5476,7 @@ const ei = ({
|
|
|
5471
5476
|
`
|
|
5472
5477
|
),
|
|
5473
5478
|
popupOffset: [4, 0],
|
|
5474
|
-
className:
|
|
5479
|
+
className: L(
|
|
5475
5480
|
"gap-2 !p-0 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
5476
5481
|
D`
|
|
5477
5482
|
.rc-menu-submenu-title {
|
|
@@ -5505,7 +5510,7 @@ const ei = ({
|
|
|
5505
5510
|
overlay: /* @__PURE__ */ s(
|
|
5506
5511
|
rt,
|
|
5507
5512
|
{
|
|
5508
|
-
className:
|
|
5513
|
+
className: L(
|
|
5509
5514
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
|
|
5510
5515
|
D`
|
|
5511
5516
|
.rc-menu-submenu-active {
|
|
@@ -5583,7 +5588,7 @@ const ai = ({ children: t, ...e }) => {
|
|
|
5583
5588
|
return /* @__PURE__ */ T(
|
|
5584
5589
|
"div",
|
|
5585
5590
|
{
|
|
5586
|
-
className:
|
|
5591
|
+
className: L(
|
|
5587
5592
|
"custom-drag-handle",
|
|
5588
5593
|
D`
|
|
5589
5594
|
width: auto;
|
|
@@ -5638,11 +5643,11 @@ const ai = ({ children: t, ...e }) => {
|
|
|
5638
5643
|
showWordCount: l = !0,
|
|
5639
5644
|
uploadImageProps: m,
|
|
5640
5645
|
editorRef: p,
|
|
5641
|
-
enableAI:
|
|
5646
|
+
enableAI: c = !1,
|
|
5642
5647
|
aiOptions: u
|
|
5643
|
-
} = t, [f,
|
|
5648
|
+
} = t, [f, d] = R(
|
|
5644
5649
|
o
|
|
5645
|
-
), [
|
|
5650
|
+
), [S, v] = R("Saved"), [z, y] = R(), [N, g] = R(!1), [b, x] = R(!1), [k, A] = R(!1), [I, P] = R(!1), B = (E) => {
|
|
5646
5651
|
const G = new DOMParser().parseFromString(E, "text/html");
|
|
5647
5652
|
return G.querySelectorAll("pre code").forEach((se) => {
|
|
5648
5653
|
As.highlightElement(se);
|
|
@@ -5725,7 +5730,7 @@ const ai = ({ children: t, ...e }) => {
|
|
|
5725
5730
|
if (X(() => {
|
|
5726
5731
|
if (!a) return;
|
|
5727
5732
|
const E = window.localStorage.getItem(n);
|
|
5728
|
-
|
|
5733
|
+
d(E ? JSON.parse(E) : si);
|
|
5729
5734
|
}, [n, a]), !f) return null;
|
|
5730
5735
|
const F = [
|
|
5731
5736
|
...Po,
|
|
@@ -5733,9 +5738,9 @@ const ai = ({ children: t, ...e }) => {
|
|
|
5733
5738
|
uploadFn: j
|
|
5734
5739
|
})
|
|
5735
5740
|
];
|
|
5736
|
-
return /* @__PURE__ */ T("div", { className:
|
|
5741
|
+
return /* @__PURE__ */ T("div", { className: L("relative w-full max-w-screen-lg", e), children: [
|
|
5737
5742
|
(a && i || l) && /* @__PURE__ */ T("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
|
|
5738
|
-
a && i && /* @__PURE__ */ s("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children:
|
|
5743
|
+
a && i && /* @__PURE__ */ s("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children: S }),
|
|
5739
5744
|
l && /* @__PURE__ */ T(
|
|
5740
5745
|
"div",
|
|
5741
5746
|
{
|
|
@@ -5795,13 +5800,13 @@ const ai = ({ children: t, ...e }) => {
|
|
|
5795
5800
|
/* @__PURE__ */ T(
|
|
5796
5801
|
ei,
|
|
5797
5802
|
{
|
|
5798
|
-
open:
|
|
5803
|
+
open: I,
|
|
5799
5804
|
onOpenChange: P,
|
|
5800
|
-
enableAI:
|
|
5805
|
+
enableAI: c,
|
|
5801
5806
|
aiOptions: u,
|
|
5802
5807
|
children: [
|
|
5803
|
-
|
|
5804
|
-
/* @__PURE__ */ s(ja, { open:
|
|
5808
|
+
c && /* @__PURE__ */ s(Ue, { orientation: "vertical" }),
|
|
5809
|
+
/* @__PURE__ */ s(ja, { open: N, onOpenChange: g }),
|
|
5805
5810
|
/* @__PURE__ */ s(Ue, { orientation: "vertical" }),
|
|
5806
5811
|
/* @__PURE__ */ s(Fa, { open: k, onOpenChange: A }),
|
|
5807
5812
|
/* @__PURE__ */ s(Ue, { orientation: "vertical" }),
|
|
@@ -6198,26 +6203,26 @@ function vi(t, e) {
|
|
|
6198
6203
|
const o = Te(di), [r, n] = R(null), a = oe(), { current: i } = oe({ mapLib: null, map: null });
|
|
6199
6204
|
X(() => {
|
|
6200
6205
|
const p = t.mapLib;
|
|
6201
|
-
let
|
|
6206
|
+
let c = !0, u;
|
|
6202
6207
|
return Promise.resolve(p || import("maplibre-gl")).then((f) => {
|
|
6203
|
-
if (!
|
|
6208
|
+
if (!c)
|
|
6204
6209
|
return;
|
|
6205
6210
|
if (!f)
|
|
6206
6211
|
throw new Error("Invalid mapLib");
|
|
6207
|
-
const
|
|
6208
|
-
if (!
|
|
6212
|
+
const d = "Map" in f ? f : f.default;
|
|
6213
|
+
if (!d.Map)
|
|
6209
6214
|
throw new Error("Invalid mapLib");
|
|
6210
|
-
xi(
|
|
6215
|
+
xi(d, t), t.reuseMaps && (u = Ye.reuse(t, a.current)), u || (u = new Ye(d.Map, t, a.current)), i.map = hi(u), i.mapLib = d, n(u), o == null || o.onMapMount(i.map, t.id);
|
|
6211
6216
|
}).catch((f) => {
|
|
6212
|
-
const { onError:
|
|
6213
|
-
|
|
6217
|
+
const { onError: d } = t;
|
|
6218
|
+
d ? d({
|
|
6214
6219
|
type: "error",
|
|
6215
6220
|
target: null,
|
|
6216
6221
|
originalEvent: null,
|
|
6217
6222
|
error: f
|
|
6218
6223
|
}) : console.error(f);
|
|
6219
6224
|
}), () => {
|
|
6220
|
-
|
|
6225
|
+
c = !1, u && (o == null || o.onMapUnmount(t.id), t.reuseMaps ? u.recycle() : u.destroy());
|
|
6221
6226
|
};
|
|
6222
6227
|
}, []), yi(() => {
|
|
6223
6228
|
r && r.setProps(t);
|
|
@@ -6265,10 +6270,10 @@ const yt = De(Ve((t, e) => {
|
|
|
6265
6270
|
ae.Children.forEach(t.children, (b) => {
|
|
6266
6271
|
b && (y = !0);
|
|
6267
6272
|
});
|
|
6268
|
-
const
|
|
6273
|
+
const N = {
|
|
6269
6274
|
...t,
|
|
6270
6275
|
element: y ? document.createElement("div") : void 0
|
|
6271
|
-
}, g = new r.Marker(
|
|
6276
|
+
}, g = new r.Marker(N);
|
|
6272
6277
|
return g.setLngLat([t.longitude, t.latitude]), g.getElement().addEventListener("click", (b) => {
|
|
6273
6278
|
var x, k;
|
|
6274
6279
|
(k = (x = n.current.props).onClick) == null || k.call(x, {
|
|
@@ -6293,12 +6298,12 @@ const yt = De(Ve((t, e) => {
|
|
|
6293
6298
|
X(() => (a.addTo(o.getMap()), () => {
|
|
6294
6299
|
a.remove();
|
|
6295
6300
|
}), []);
|
|
6296
|
-
const { longitude: i, latitude: l, offset: m, style: p, draggable:
|
|
6301
|
+
const { longitude: i, latitude: l, offset: m, style: p, draggable: c = !1, popup: u = null, rotation: f = 0, rotationAlignment: d = "auto", pitchAlignment: S = "auto" } = t;
|
|
6297
6302
|
X(() => {
|
|
6298
6303
|
Ee(a.getElement(), p);
|
|
6299
6304
|
}, [p]), et(e, () => a, []);
|
|
6300
6305
|
const v = n.current.props;
|
|
6301
|
-
(a.getLngLat().lng !== i || a.getLngLat().lat !== l) && a.setLngLat([i, l]), m && !ui(a.getOffset(), m) && a.setOffset(m), a.isDraggable() !==
|
|
6306
|
+
(a.getLngLat().lng !== i || a.getLngLat().lat !== l) && a.setLngLat([i, l]), m && !ui(a.getOffset(), m) && a.setOffset(m), a.isDraggable() !== c && a.setDraggable(c), a.getRotation() !== f && a.setRotation(f), a.getRotationAlignment() !== d && a.setRotationAlignment(d), a.getPitchAlignment() !== S && a.setPitchAlignment(S), a.getPopup() !== u && a.setPopup(u);
|
|
6302
6307
|
const z = Go(v.className, t.className);
|
|
6303
6308
|
if (z)
|
|
6304
6309
|
for (const y of z)
|
|
@@ -6309,14 +6314,14 @@ De(Ve((t, e) => {
|
|
|
6309
6314
|
const { map: o, mapLib: r } = Te(Xe), n = te(() => document.createElement("div"), []), a = oe({ props: t }), i = te(() => {
|
|
6310
6315
|
const l = { ...t }, m = new r.Popup(l);
|
|
6311
6316
|
return m.setLngLat([t.longitude, t.latitude]), m.once("open", (p) => {
|
|
6312
|
-
var
|
|
6313
|
-
(u = (
|
|
6317
|
+
var c, u;
|
|
6318
|
+
(u = (c = a.current.props).onOpen) == null || u.call(c, p);
|
|
6314
6319
|
}), m;
|
|
6315
6320
|
}, []);
|
|
6316
6321
|
if (X(() => {
|
|
6317
6322
|
const l = (m) => {
|
|
6318
|
-
var p,
|
|
6319
|
-
(
|
|
6323
|
+
var p, c;
|
|
6324
|
+
(c = (p = a.current.props).onClose) == null || c.call(p, m);
|
|
6320
6325
|
};
|
|
6321
6326
|
return i.on("close", l), i.setDOMContent(n).addTo(o.getMap()), () => {
|
|
6322
6327
|
i.off("close", l), i.isOpen() && i.remove();
|
|
@@ -6494,17 +6499,17 @@ function Ei(t, e, o, r) {
|
|
|
6494
6499
|
return;
|
|
6495
6500
|
const { layout: n = {}, paint: a = {}, filter: i, minzoom: l, maxzoom: m, beforeId: p } = o;
|
|
6496
6501
|
if (p !== r.beforeId && t.moveLayer(e, p), n !== r.layout) {
|
|
6497
|
-
const
|
|
6502
|
+
const c = r.layout || {};
|
|
6498
6503
|
for (const u in n)
|
|
6499
|
-
be(n[u],
|
|
6500
|
-
for (const u in
|
|
6504
|
+
be(n[u], c[u]) || t.setLayoutProperty(e, u, n[u]);
|
|
6505
|
+
for (const u in c)
|
|
6501
6506
|
n.hasOwnProperty(u) || t.setLayoutProperty(e, u, void 0);
|
|
6502
6507
|
}
|
|
6503
6508
|
if (a !== r.paint) {
|
|
6504
|
-
const
|
|
6509
|
+
const c = r.paint || {};
|
|
6505
6510
|
for (const u in a)
|
|
6506
|
-
be(a[u],
|
|
6507
|
-
for (const u in
|
|
6511
|
+
be(a[u], c[u]) || t.setPaintProperty(e, u, a[u]);
|
|
6512
|
+
for (const u in c)
|
|
6508
6513
|
a.hasOwnProperty(u) || t.setPaintProperty(e, u, void 0);
|
|
6509
6514
|
}
|
|
6510
6515
|
be(i, r.filter) || t.setFilter(e, i), (l !== r.minzoom || m !== r.maxzoom) && t.setLayerZoomRange(e, l, m);
|
|
@@ -6586,40 +6591,40 @@ const Bi = (t) => {
|
|
|
6586
6591
|
height: p
|
|
6587
6592
|
}), m > 50 && p > 30)
|
|
6588
6593
|
return console.log("视图范围很大,返回所有省份"), [...o];
|
|
6589
|
-
const
|
|
6594
|
+
const c = [], u = new Map(
|
|
6590
6595
|
o.map((f) => [f.code, f])
|
|
6591
6596
|
);
|
|
6592
6597
|
if (e.features.forEach((f) => {
|
|
6593
6598
|
if (!f.properties || !f.properties.adcode) return;
|
|
6594
|
-
const { adcode:
|
|
6595
|
-
if (!
|
|
6599
|
+
const { adcode: d } = f.properties, S = u.get(d);
|
|
6600
|
+
if (!S) return;
|
|
6596
6601
|
let v = Bi(f);
|
|
6597
|
-
if (!v &&
|
|
6598
|
-
const { longitude: x, latitude: k } =
|
|
6602
|
+
if (!v && S) {
|
|
6603
|
+
const { longitude: x, latitude: k } = S;
|
|
6599
6604
|
v = [x - 2, k - 2, x + 2, k + 2];
|
|
6600
6605
|
}
|
|
6601
6606
|
if (!v) return;
|
|
6602
|
-
const [z, y,
|
|
6603
|
-
!(
|
|
6607
|
+
const [z, y, N, g] = v;
|
|
6608
|
+
!(N < n || // 省份完全在视图左侧
|
|
6604
6609
|
z > a || // 省份完全在视图右侧
|
|
6605
6610
|
g < i || // 省份完全在视图下方
|
|
6606
|
-
y > l) &&
|
|
6607
|
-
}),
|
|
6608
|
-
if (
|
|
6609
|
-
const { longitude:
|
|
6610
|
-
|
|
6611
|
-
}),
|
|
6611
|
+
y > l) && c.push(S);
|
|
6612
|
+
}), c.length < 3 && (console.log("找到的相交区域太少,尝试其他检查方法..."), o.forEach((f) => {
|
|
6613
|
+
if (c.some((z) => z.code === f.code)) return;
|
|
6614
|
+
const { longitude: S, latitude: v } = f;
|
|
6615
|
+
S >= n && S <= a && v >= i && v <= l && c.push(f);
|
|
6616
|
+
}), c.length < 3 && (m > 10 || p > 10))) {
|
|
6612
6617
|
console.log("扩大检查范围...");
|
|
6613
|
-
const f = n - 2,
|
|
6618
|
+
const f = n - 2, d = a + 2, S = i - 2, v = l + 2;
|
|
6614
6619
|
o.forEach((z) => {
|
|
6615
|
-
if (
|
|
6620
|
+
if (c.some(
|
|
6616
6621
|
(b) => b.code === z.code
|
|
6617
6622
|
)) return;
|
|
6618
|
-
const { longitude:
|
|
6619
|
-
|
|
6623
|
+
const { longitude: N, latitude: g } = z;
|
|
6624
|
+
N >= f && N <= d && g >= S && g <= v && c.push(z);
|
|
6620
6625
|
});
|
|
6621
6626
|
}
|
|
6622
|
-
return console.log(`找到 ${
|
|
6627
|
+
return console.log(`找到 ${c.length} 个区域与视图相交`), c;
|
|
6623
6628
|
}, Wt = "100000", _i = {
|
|
6624
6629
|
6: 0,
|
|
6625
6630
|
// 国家级别 (6位ID长度)
|
|
@@ -6646,12 +6651,12 @@ const Bi = (t) => {
|
|
|
6646
6651
|
onVisibleAreasChanged: l,
|
|
6647
6652
|
cityMinZoom: m = 5,
|
|
6648
6653
|
districtMinZoom: p = 7,
|
|
6649
|
-
fetchGeoData:
|
|
6654
|
+
fetchGeoData: c,
|
|
6650
6655
|
children: u
|
|
6651
6656
|
}) => {
|
|
6652
|
-
const f = oe(null), [
|
|
6653
|
-
() =>
|
|
6654
|
-
[
|
|
6657
|
+
const f = oe(null), [d, S] = R(Wt), [v, z] = R(null), [y, N] = R(t), [g, b] = R([]), x = oe({}), [k, A] = R({}), [I, P] = R({}), [B, J] = R(!1), [j, F] = R([]), [E, G] = R({}), [se, Z] = R({}), [Y, re] = R(!1), [de, fe] = R([]), ie = te(
|
|
6658
|
+
() => c || Oi,
|
|
6659
|
+
[c]
|
|
6655
6660
|
), { run: ce } = rn(
|
|
6656
6661
|
(h) => ie(h),
|
|
6657
6662
|
{
|
|
@@ -6668,24 +6673,24 @@ const Bi = (t) => {
|
|
|
6668
6673
|
), Q = le((h) => {
|
|
6669
6674
|
const C = [];
|
|
6670
6675
|
let w = 0, W = 0;
|
|
6671
|
-
return h.features.forEach((
|
|
6676
|
+
return h.features.forEach((M) => {
|
|
6672
6677
|
var H;
|
|
6673
|
-
if (
|
|
6678
|
+
if (M.properties)
|
|
6674
6679
|
try {
|
|
6675
|
-
let $ =
|
|
6676
|
-
!$ &&
|
|
6677
|
-
name:
|
|
6680
|
+
let $ = M.properties.centroid || null;
|
|
6681
|
+
!$ && M.properties.center && ($ = M.properties.center), $ && M.properties.adcode && M.properties.name ? (C.push({
|
|
6682
|
+
name: M.properties.name,
|
|
6678
6683
|
longitude: $[0],
|
|
6679
6684
|
latitude: $[1],
|
|
6680
|
-
code:
|
|
6685
|
+
code: M.properties.adcode
|
|
6681
6686
|
}), w++) : (W++, console.warn(
|
|
6682
|
-
`Missing centroid/center data for ${
|
|
6683
|
-
|
|
6687
|
+
`Missing centroid/center data for ${M.properties.name || "unknown area"}:`,
|
|
6688
|
+
M.properties.adcode || "unknown code"
|
|
6684
6689
|
));
|
|
6685
6690
|
} catch ($) {
|
|
6686
6691
|
W++, console.error(
|
|
6687
6692
|
"Error processing centroid data for feature:",
|
|
6688
|
-
((H =
|
|
6693
|
+
((H = M.properties) == null ? void 0 : H.name) || "unknown",
|
|
6689
6694
|
$
|
|
6690
6695
|
);
|
|
6691
6696
|
}
|
|
@@ -6697,36 +6702,36 @@ const Bi = (t) => {
|
|
|
6697
6702
|
if (h.length === 0)
|
|
6698
6703
|
return;
|
|
6699
6704
|
const C = Array.from(
|
|
6700
|
-
new Set(h.map((
|
|
6701
|
-
).map((
|
|
6702
|
-
J((
|
|
6705
|
+
new Set(h.map((M) => M.code))
|
|
6706
|
+
).map((M) => ({ name: h.find(($) => $.code === M).name, code: M }));
|
|
6707
|
+
J((M) => M || !0);
|
|
6703
6708
|
const w = C.filter(
|
|
6704
|
-
(
|
|
6709
|
+
(M) => !j.includes(M.code) && !k[M.code]
|
|
6705
6710
|
);
|
|
6706
6711
|
if (w.length === 0)
|
|
6707
6712
|
return;
|
|
6708
|
-
console.debug(`开始加载${w.length}个省的市级数据`), F((
|
|
6713
|
+
console.debug(`开始加载${w.length}个省的市级数据`), F((M) => {
|
|
6709
6714
|
const H = w.map(($) => $.code);
|
|
6710
|
-
return [.../* @__PURE__ */ new Set([...
|
|
6715
|
+
return [.../* @__PURE__ */ new Set([...M, ...H])];
|
|
6711
6716
|
});
|
|
6712
6717
|
const W = w.map(
|
|
6713
|
-
(
|
|
6718
|
+
(M) => ie(M.code).then((H) => {
|
|
6714
6719
|
A((ge) => ({
|
|
6715
6720
|
...ge,
|
|
6716
|
-
[
|
|
6721
|
+
[M.code]: H
|
|
6717
6722
|
}));
|
|
6718
6723
|
const $ = Q(H);
|
|
6719
6724
|
return P((ge) => ({
|
|
6720
6725
|
...ge,
|
|
6721
|
-
[
|
|
6722
|
-
})), { code:
|
|
6726
|
+
[M.code]: $
|
|
6727
|
+
})), { code: M.code, data: H };
|
|
6723
6728
|
}).catch((H) => (console.error(
|
|
6724
|
-
`Failed to load cities data for province ${
|
|
6729
|
+
`Failed to load cities data for province ${M.name}:`,
|
|
6725
6730
|
H
|
|
6726
6731
|
), null))
|
|
6727
6732
|
);
|
|
6728
|
-
Promise.all(W).then((
|
|
6729
|
-
const H =
|
|
6733
|
+
Promise.all(W).then((M) => {
|
|
6734
|
+
const H = M.filter(Boolean).map(($) => ($ == null ? void 0 : $.code) || "");
|
|
6730
6735
|
F(
|
|
6731
6736
|
($) => $.filter((ge) => !H.includes(ge))
|
|
6732
6737
|
);
|
|
@@ -6742,44 +6747,44 @@ const Bi = (t) => {
|
|
|
6742
6747
|
(h) => {
|
|
6743
6748
|
if (h.length === 0)
|
|
6744
6749
|
return;
|
|
6745
|
-
const C = Array.from(new Set(h.map((
|
|
6746
|
-
(
|
|
6750
|
+
const C = Array.from(new Set(h.map((M) => M.code))).map(
|
|
6751
|
+
(M) => ({ name: h.find(($) => $.code === M).name, code: M })
|
|
6747
6752
|
);
|
|
6748
|
-
re((
|
|
6753
|
+
re((M) => M || !0);
|
|
6749
6754
|
const w = C.filter(
|
|
6750
|
-
(
|
|
6755
|
+
(M) => !de.includes(M.code) && !E[M.code]
|
|
6751
6756
|
);
|
|
6752
6757
|
if (w.length === 0)
|
|
6753
6758
|
return;
|
|
6754
|
-
console.debug(`开始加载${w.length}个城市的区级数据`), fe((
|
|
6759
|
+
console.debug(`开始加载${w.length}个城市的区级数据`), fe((M) => {
|
|
6755
6760
|
const H = w.map(($) => $.code);
|
|
6756
|
-
return [.../* @__PURE__ */ new Set([...
|
|
6761
|
+
return [.../* @__PURE__ */ new Set([...M, ...H])];
|
|
6757
6762
|
});
|
|
6758
6763
|
const W = w.map(
|
|
6759
|
-
(
|
|
6764
|
+
(M) => ie(M.code).then((H) => {
|
|
6760
6765
|
G((ge) => ({
|
|
6761
6766
|
...ge,
|
|
6762
|
-
[
|
|
6767
|
+
[M.code]: H
|
|
6763
6768
|
}));
|
|
6764
6769
|
const $ = Q(H);
|
|
6765
6770
|
return Z((ge) => ({
|
|
6766
6771
|
...ge,
|
|
6767
|
-
[
|
|
6768
|
-
})), { code:
|
|
6772
|
+
[M.code]: $
|
|
6773
|
+
})), { code: M.code, data: H };
|
|
6769
6774
|
}).catch((H) => (console.error(
|
|
6770
|
-
`Failed to load districts data for city ${
|
|
6775
|
+
`Failed to load districts data for city ${M.name}:`,
|
|
6771
6776
|
H
|
|
6772
6777
|
), null))
|
|
6773
6778
|
);
|
|
6774
|
-
Promise.all(W).then((
|
|
6775
|
-
const H =
|
|
6779
|
+
Promise.all(W).then((M) => {
|
|
6780
|
+
const H = M.filter(Boolean).map(($) => ($ == null ? void 0 : $.code) || "");
|
|
6776
6781
|
fe(
|
|
6777
6782
|
($) => $.filter((ge) => !H.includes(ge))
|
|
6778
6783
|
);
|
|
6779
6784
|
});
|
|
6780
6785
|
},
|
|
6781
6786
|
[de, E, Q, ie]
|
|
6782
|
-
), ne = te(() => B ? Object.values(
|
|
6787
|
+
), ne = te(() => B ? Object.values(I).flat() : [], [I, B]), xe = te(() => Y ? Object.values(se).flat() : [], [se, Y]), me = le(() => {
|
|
6783
6788
|
if (!f.current || !v)
|
|
6784
6789
|
return;
|
|
6785
6790
|
const h = f.current.getBounds(), C = {
|
|
@@ -6801,10 +6806,10 @@ const Bi = (t) => {
|
|
|
6801
6806
|
zoom: y
|
|
6802
6807
|
}, console.debug("计算结果:", w.length, "个区域在视图内"), l && l(w), y > p) {
|
|
6803
6808
|
J(!0), re(!0), ue(w);
|
|
6804
|
-
const W = Object.values(
|
|
6805
|
-
(
|
|
6809
|
+
const W = Object.values(I).flat().filter(
|
|
6810
|
+
(M) => {
|
|
6806
6811
|
var H;
|
|
6807
|
-
return (H = f.current) == null ? void 0 : H.getBounds().contains([
|
|
6812
|
+
return (H = f.current) == null ? void 0 : H.getBounds().contains([M.longitude, M.latitude]);
|
|
6808
6813
|
}
|
|
6809
6814
|
);
|
|
6810
6815
|
W.length > 0 && (console.debug(`加载${W.length}个城市的区级数据`), Ie(W));
|
|
@@ -6817,13 +6822,13 @@ const Bi = (t) => {
|
|
|
6817
6822
|
y,
|
|
6818
6823
|
ue,
|
|
6819
6824
|
Ie,
|
|
6820
|
-
|
|
6825
|
+
I,
|
|
6821
6826
|
m,
|
|
6822
6827
|
p
|
|
6823
6828
|
]);
|
|
6824
6829
|
X(() => {
|
|
6825
|
-
ce(
|
|
6826
|
-
}, [
|
|
6830
|
+
ce(d);
|
|
6831
|
+
}, [d, ce]), X(() => {
|
|
6827
6832
|
if (f.current && g.length > 0) {
|
|
6828
6833
|
const h = requestAnimationFrame(() => {
|
|
6829
6834
|
me();
|
|
@@ -6840,23 +6845,23 @@ const Bi = (t) => {
|
|
|
6840
6845
|
(h) => {
|
|
6841
6846
|
const C = h.viewState.zoom, w = x.current.zoom || y, W = Math.abs(C - w) >= 5e-3;
|
|
6842
6847
|
if (f.current) {
|
|
6843
|
-
const
|
|
6844
|
-
north:
|
|
6845
|
-
south:
|
|
6846
|
-
east:
|
|
6847
|
-
west:
|
|
6848
|
+
const M = f.current.getBounds(), H = {
|
|
6849
|
+
north: M.getNorth(),
|
|
6850
|
+
south: M.getSouth(),
|
|
6851
|
+
east: M.getEast(),
|
|
6852
|
+
west: M.getWest()
|
|
6848
6853
|
}, $ = !x.current.bounds || Math.abs(x.current.bounds.north - H.north) >= 1e-3 || Math.abs(x.current.bounds.south - H.south) >= 1e-3 || Math.abs(x.current.bounds.east - H.east) >= 1e-3 || Math.abs(x.current.bounds.west - H.west) >= 1e-3;
|
|
6849
6854
|
if (W) {
|
|
6850
|
-
|
|
6855
|
+
N(C), x.current.zoom = C;
|
|
6851
6856
|
let ge = 6;
|
|
6852
6857
|
for (const [Yo, Vo] of Object.entries(n))
|
|
6853
6858
|
C >= Vo && (ge = parseInt(Yo, 10));
|
|
6854
|
-
|
|
6859
|
+
d.length !== ge && S(Wt);
|
|
6855
6860
|
}
|
|
6856
6861
|
($ || W) && me();
|
|
6857
6862
|
}
|
|
6858
6863
|
},
|
|
6859
|
-
[
|
|
6864
|
+
[d, n, y, me]
|
|
6860
6865
|
), we = le(() => {
|
|
6861
6866
|
g.length > 0 && f.current && me();
|
|
6862
6867
|
}, [g, me]), O = te(
|