zs_library 0.4.21 → 0.4.22
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/components/desktop/context/state/context.d.ts +3 -0
- package/dist/index.js +1068 -1037
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Kt = Object.defineProperty;
|
|
2
|
+
var Jt = (r, e, o) => e in r ? Kt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
|
|
3
|
+
var Le = (r, e, o) => Jt(r, typeof e != "symbol" ? e + "" : e, o);
|
|
4
4
|
import "./index.css";
|
|
5
|
-
import
|
|
6
|
-
import { initReactI18next as
|
|
5
|
+
import Zt from "i18next";
|
|
6
|
+
import { initReactI18next as Qt } from "react-i18next";
|
|
7
7
|
import { jsx as t, jsxs as m, Fragment as ue } from "react/jsx-runtime";
|
|
8
8
|
import * as q from "react";
|
|
9
|
-
import
|
|
9
|
+
import eo, { createContext as st, useMemo as he, useContext as it, useState as _, useRef as be, useCallback as to, useEffect as ae, forwardRef as lt, Fragment as oo } from "react";
|
|
10
10
|
import { cx as k, css as b } from "@emotion/css";
|
|
11
|
-
import
|
|
12
|
-
import { ReactSortable as
|
|
13
|
-
import { AnimatePresence as
|
|
14
|
-
import { useMotionValue as
|
|
15
|
-
import { useLocalStorageState as
|
|
16
|
-
import { v4 as
|
|
17
|
-
import
|
|
18
|
-
import { RiPencilRuler2Line as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { AdmonitionDirectiveDescriptor as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { Prism as
|
|
27
|
-
import { oneLight as
|
|
28
|
-
import
|
|
29
|
-
import { clsx as
|
|
30
|
-
import { twMerge as
|
|
31
|
-
import { Placeholder as
|
|
32
|
-
import { useDebouncedCallback as
|
|
33
|
-
import { Markdown as
|
|
34
|
-
import { cx as Y, cva as
|
|
35
|
-
import { createLowlight as
|
|
36
|
-
import { Extension as
|
|
37
|
-
import { Plugin as
|
|
38
|
-
import { Slice as
|
|
39
|
-
import * as
|
|
40
|
-
import * as
|
|
41
|
-
import { Popover as
|
|
42
|
-
import { Slot as
|
|
43
|
-
import { SigmaIcon as
|
|
44
|
-
import * as
|
|
45
|
-
import { useCompletion as
|
|
46
|
-
import { toast as
|
|
11
|
+
import ro from "react-slick";
|
|
12
|
+
import { ReactSortable as Xe } from "react-sortablejs";
|
|
13
|
+
import { AnimatePresence as Ue, motion as R, useMotionValue as ct, useTransform as ye, useSpring as Ae } from "framer-motion";
|
|
14
|
+
import { useMotionValue as Ps } from "framer-motion";
|
|
15
|
+
import { useLocalStorageState as no, useDebounceEffect as ao } from "ahooks";
|
|
16
|
+
import { v4 as Oe } from "uuid";
|
|
17
|
+
import dt from "rc-tooltip";
|
|
18
|
+
import { RiPencilRuler2Line as so, RiShareLine as io, RiInformationLine as lo, RiCloseCircleLine as co, RiArrowUpDownLine as mo, RiArrowLeftRightLine as uo, RiArrowRightLine as po, RiArrowLeftLine as go, RiCloseLine as fo, RiZoomOutLine as ho, RiZoomInLine as bo, RiClockwise2Line as xo, RiAnticlockwise2Line as yo, RiMoreLine as vo, RiArrowDropDownLine as mt, RiCheckLine as ke, RiLink as ko, RiDeleteBinLine as ut, RiText as pt, RiH1 as gt, RiH2 as ft, RiH3 as ht, RiListCheck as bt, RiListUnordered as xt, RiListOrdered as yt, RiQuoteText as vt, RiCodeLine as kt, RiSparklingFill as Ge, RiImageLine as Co, RiArrowRightSLine as wo, RiRepeatLine as No, RiFileCopyLine as Io, RiAddLine as So, RiDraggable as To } from "@remixicon/react";
|
|
19
|
+
import Ct from "rc-dialog";
|
|
20
|
+
import Mo from "react-json-view";
|
|
21
|
+
import { AdmonitionDirectiveDescriptor as Lo, MDXEditor as Ao, toolbarPlugin as Do, diffSourcePlugin as Ro, listsPlugin as Po, quotePlugin as Bo, headingsPlugin as zo, linkPlugin as Eo, linkDialogPlugin as $o, imagePlugin as Ho, tablePlugin as Oo, thematicBreakPlugin as Fo, frontmatterPlugin as _o, codeBlockPlugin as jo, codeMirrorPlugin as Xo, markdownShortcutPlugin as Uo, directivesPlugin as Go, DiffSourceToggleWrapper as qo, UndoRedo as Yo, Separator as ce, BoldItalicUnderlineToggles as Vo, CodeToggle as Wo, StrikeThroughSupSubToggles as Ko, ListsToggle as Jo, CreateLink as Zo, InsertImage as Qo, InsertTable as er, InsertThematicBreak as tr, InsertCodeBlock as or, InsertFrontmatter as rr } from "@mdxeditor/editor";
|
|
22
|
+
import wt from "react-markdown";
|
|
23
|
+
import nr from "remark-gfm";
|
|
24
|
+
import ar from "remark-emoji";
|
|
25
|
+
import sr from "rehype-raw";
|
|
26
|
+
import { Prism as ir } from "react-syntax-highlighter";
|
|
27
|
+
import { oneLight as lr } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
28
|
+
import cr from "rc-image";
|
|
29
|
+
import { clsx as dr } from "clsx";
|
|
30
|
+
import { twMerge as mr } from "tailwind-merge";
|
|
31
|
+
import { Placeholder as ur, TiptapLink as pr, TiptapImage as gr, UploadImagesPlugin as fr, UpdatedImage as hr, TaskList as br, TaskItem as xr, HorizontalRule as yr, StarterKit as vr, CodeBlockLowlight as kr, Mathematics as Cr, CharacterCount as wr, AIHighlight as Nr, TiptapUnderline as Ir, HighlightExtension as Sr, TextStyle as Tr, Color as Mr, CustomKeymap as Lr, useEditor as Q, EditorBubbleItem as Pe, getPrevText as Ar, addAIHighlight as Dr, removeAIHighlight as Rr, EditorBubble as Pr, createImageUpload as Nt, Command as Br, createSuggestionItems as zr, renderItems as Er, EditorRoot as $r, EditorContent as Hr, handleImageDrop as Or, handleImagePaste as Fr, handleCommandNavigation as _r, EditorCommand as jr, EditorCommandEmpty as Xr, EditorCommandList as Ur, EditorCommandItem as Gr, ImageResizer as qr } from "novel";
|
|
32
|
+
import { useDebouncedCallback as Yr } from "use-debounce";
|
|
33
|
+
import { Markdown as Vr } from "tiptap-markdown";
|
|
34
|
+
import { cx as Y, cva as Wr } from "class-variance-authority";
|
|
35
|
+
import { createLowlight as Kr, common as Jr } from "lowlight";
|
|
36
|
+
import { Extension as Zr } from "@tiptap/core";
|
|
37
|
+
import { Plugin as Qr, PluginKey as en, NodeSelection as J, TextSelection as tn } from "prosemirror-state";
|
|
38
|
+
import { Slice as on, Fragment as rn } from "prosemirror-model";
|
|
39
|
+
import * as nn from "prosemirror-view";
|
|
40
|
+
import * as Ce from "@radix-ui/react-popover";
|
|
41
|
+
import { Popover as It, PopoverTrigger as an } from "@radix-ui/react-popover";
|
|
42
|
+
import { Slot as sn } from "@radix-ui/react-slot";
|
|
43
|
+
import { SigmaIcon as ln, X as cn, Check as dn, TextQuote as mn, TrashIcon as un, RefreshCcwDot as pn, CheckCheck as gn, ArrowDownWideNarrow as fn, WrapText as hn, StepForward as bn, ArrowUp as xn, BoldIcon as yn, ItalicIcon as vn, UnderlineIcon as kn, StrikethroughIcon as Cn, CodeIcon as wn } from "lucide-react";
|
|
44
|
+
import * as St from "@radix-ui/react-separator";
|
|
45
|
+
import { useCompletion as Nn } from "@ai-sdk/react";
|
|
46
|
+
import { toast as we } from "sonner";
|
|
47
47
|
import * as de from "@radix-ui/react-scroll-area";
|
|
48
48
|
import { Command as W } from "cmdk";
|
|
49
|
-
import * as
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import { generateHTML as
|
|
54
|
-
function
|
|
49
|
+
import * as oe from "@radix-ui/react-dialog";
|
|
50
|
+
import In from "highlight.js";
|
|
51
|
+
import Sn from "rc-dropdown";
|
|
52
|
+
import De from "rc-menu";
|
|
53
|
+
import { generateHTML as Tn } from "@tiptap/html";
|
|
54
|
+
function Mn(r, e) {
|
|
55
55
|
for (var o = 0; o < e.length; o++) {
|
|
56
|
-
const
|
|
57
|
-
if (typeof
|
|
58
|
-
for (const
|
|
59
|
-
if (
|
|
60
|
-
const s = Object.getOwnPropertyDescriptor(
|
|
61
|
-
s && Object.defineProperty(r,
|
|
56
|
+
const n = e[o];
|
|
57
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
58
|
+
for (const a in n)
|
|
59
|
+
if (a !== "default" && !(a in r)) {
|
|
60
|
+
const s = Object.getOwnPropertyDescriptor(n, a);
|
|
61
|
+
s && Object.defineProperty(r, a, s.get ? s : {
|
|
62
62
|
enumerable: !0,
|
|
63
|
-
get: () => a
|
|
63
|
+
get: () => n[a]
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const Ln = {
|
|
71
71
|
common: {
|
|
72
72
|
ok: "确定",
|
|
73
73
|
cancel: "取消",
|
|
@@ -92,7 +92,7 @@ const In = {
|
|
|
92
92
|
link: "链接",
|
|
93
93
|
image: "图片"
|
|
94
94
|
}
|
|
95
|
-
},
|
|
95
|
+
}, An = {
|
|
96
96
|
common: {
|
|
97
97
|
ok: "OK",
|
|
98
98
|
cancel: "Cancel",
|
|
@@ -117,20 +117,20 @@ const In = {
|
|
|
117
117
|
link: "Link",
|
|
118
118
|
image: "Image"
|
|
119
119
|
}
|
|
120
|
-
},
|
|
121
|
-
|
|
120
|
+
}, Dn = "common";
|
|
121
|
+
Zt.use(Qt).init({
|
|
122
122
|
resources: {
|
|
123
|
-
"zh-CN":
|
|
124
|
-
"en-US":
|
|
123
|
+
"zh-CN": Ln,
|
|
124
|
+
"en-US": An
|
|
125
125
|
},
|
|
126
126
|
lng: "zh-CN",
|
|
127
127
|
fallbackLng: "zh-CN",
|
|
128
|
-
defaultNS:
|
|
128
|
+
defaultNS: Dn,
|
|
129
129
|
interpolation: {
|
|
130
130
|
escapeValue: !1
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
const
|
|
133
|
+
const qe = {
|
|
134
134
|
token: {
|
|
135
135
|
itemNameColor: "#1a1a1a",
|
|
136
136
|
itemIconBackgroundColor: "white",
|
|
@@ -143,7 +143,7 @@ const _e = {
|
|
|
143
143
|
contextMenuBackgroundColor: "white",
|
|
144
144
|
contextMenuShadowColor: "rgba(0, 0, 0, 0.1)"
|
|
145
145
|
}
|
|
146
|
-
},
|
|
146
|
+
}, Ye = {
|
|
147
147
|
token: {
|
|
148
148
|
itemNameColor: "white",
|
|
149
149
|
itemIconBackgroundColor: "#1f2937",
|
|
@@ -156,27 +156,27 @@ const _e = {
|
|
|
156
156
|
contextMenuBackgroundColor: "#1a1a1a",
|
|
157
157
|
contextMenuShadowColor: "rgba(255, 255, 255, 0.1)"
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, Tt = st(
|
|
160
160
|
{}
|
|
161
|
-
),
|
|
162
|
-
const { children: e, theme: o, ...
|
|
163
|
-
return /* @__PURE__ */ t(
|
|
164
|
-
}, le = () =>
|
|
161
|
+
), Mt = (r) => {
|
|
162
|
+
const { children: e, theme: o, ...n } = r, a = he(() => o === "light" ? qe : o === "dark" ? Ye : o, [o]);
|
|
163
|
+
return /* @__PURE__ */ t(Tt.Provider, { value: { theme: a, ...n }, children: e });
|
|
164
|
+
}, le = () => it(Tt), Ve = {
|
|
165
165
|
maxRow: 2,
|
|
166
166
|
maxCol: 2
|
|
167
|
-
},
|
|
168
|
-
...
|
|
169
|
-
},
|
|
170
|
-
app:
|
|
171
|
-
group:
|
|
167
|
+
}, Lt = {
|
|
168
|
+
...Ve
|
|
169
|
+
}, Be = {
|
|
170
|
+
app: Ve,
|
|
171
|
+
group: Lt
|
|
172
172
|
};
|
|
173
173
|
class V {
|
|
174
174
|
}
|
|
175
175
|
/** 清理重复id */
|
|
176
|
-
|
|
177
|
-
const o =
|
|
178
|
-
return { light:
|
|
179
|
-
}),
|
|
176
|
+
Le(V, "uniqueArray", (e) => e.reduce((o, n) => o.find((s) => s.id === n.id) ? o : o.concat([n]), [])), Le(V, "getTheme", (e) => {
|
|
177
|
+
const o = qe.token, n = Ye.token, a = { ...o, ...e == null ? void 0 : e.token }, s = { ...n, ...e == null ? void 0 : e.token };
|
|
178
|
+
return { light: a, dark: s };
|
|
179
|
+
}), Le(V, "quickJSONCheck", (e) => {
|
|
180
180
|
if (typeof e != "string" || e.trim() === "") return !1;
|
|
181
181
|
if (!/^\s*(\{.*\}|\[.*\])\s*$/.test(e))
|
|
182
182
|
return /^\s*(".*?"|[\d.]+|true|false|null)\s*$/.test(e);
|
|
@@ -186,7 +186,7 @@ Te(V, "uniqueArray", (e) => e.reduce((o, a) => o.find((s) => s.id === a.id) ? o
|
|
|
186
186
|
return !1;
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
|
-
const
|
|
189
|
+
const At = st({
|
|
190
190
|
list: [],
|
|
191
191
|
setList: () => {
|
|
192
192
|
},
|
|
@@ -215,195 +215,226 @@ const Tt = rt({
|
|
|
215
215
|
},
|
|
216
216
|
addItem: () => {
|
|
217
217
|
},
|
|
218
|
+
addRootItem: () => {
|
|
219
|
+
},
|
|
220
|
+
updateRootItem: () => {
|
|
221
|
+
},
|
|
222
|
+
removeRootItem: () => {
|
|
223
|
+
},
|
|
218
224
|
moveItemId: null,
|
|
219
225
|
setMoveItemId: () => {
|
|
220
226
|
},
|
|
221
227
|
moveTargetId: null,
|
|
222
228
|
setMoveTargetId: () => {
|
|
223
229
|
}
|
|
224
|
-
}),
|
|
230
|
+
}), Dt = (r) => {
|
|
225
231
|
const {
|
|
226
232
|
children: e,
|
|
227
233
|
list: o = [],
|
|
228
|
-
onChange:
|
|
229
|
-
storageKey:
|
|
234
|
+
onChange: n,
|
|
235
|
+
storageKey: a = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
230
236
|
enableCaching: s = !0
|
|
231
|
-
} = r, [i, d] =
|
|
237
|
+
} = r, [i, d] = _(), [p, x] = _(), [l, c] = _(null), f = be(l), [v, D] = _(null), [h, g] = _([]), [S, y] = _(
|
|
232
238
|
null
|
|
233
|
-
), [
|
|
239
|
+
), [I, u] = _(
|
|
234
240
|
null
|
|
235
|
-
), [
|
|
241
|
+
), [M, L] = _(!1), [N, w] = _(null), [H, G] = _(
|
|
236
242
|
null
|
|
237
|
-
), [
|
|
243
|
+
), [X, se] = _(!1), [re, A] = no(a, {
|
|
238
244
|
defaultValue: [],
|
|
239
245
|
listenStorageChange: !0
|
|
240
|
-
}),
|
|
241
|
-
D(null), clearTimeout(i), d(void 0),
|
|
242
|
-
},
|
|
243
|
-
D({ ...
|
|
244
|
-
}, K = (
|
|
245
|
-
const { config:
|
|
246
|
-
return
|
|
247
|
-
onMouseDown: (
|
|
246
|
+
}), j = () => {
|
|
247
|
+
D(null), clearTimeout(i), d(void 0), f.current = null;
|
|
248
|
+
}, E = (C, B) => {
|
|
249
|
+
D({ ...C, pageX: C.pageX, pageY: C.pageY, data: B }), clearTimeout(i);
|
|
250
|
+
}, K = (C, B = !0) => {
|
|
251
|
+
const { config: z = {} } = C;
|
|
252
|
+
return z.allowContextMenu === !1 ? {} : {
|
|
253
|
+
onMouseDown: (T) => {
|
|
248
254
|
d(
|
|
249
255
|
setTimeout(() => {
|
|
250
|
-
|
|
256
|
+
B && f.current === null && E(T, C);
|
|
251
257
|
}, 800)
|
|
252
|
-
),
|
|
258
|
+
), L(!1), x(
|
|
253
259
|
setTimeout(() => {
|
|
254
|
-
|
|
260
|
+
L(!0);
|
|
255
261
|
}, 800)
|
|
256
262
|
);
|
|
257
263
|
},
|
|
258
264
|
onMouseUp: () => {
|
|
259
265
|
clearTimeout(p), x(void 0), clearTimeout(i), d(void 0);
|
|
260
266
|
},
|
|
261
|
-
onContextMenu: (
|
|
262
|
-
|
|
267
|
+
onContextMenu: (T) => {
|
|
268
|
+
B && (T.preventDefault(), E(T, C));
|
|
263
269
|
}
|
|
264
270
|
};
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (
|
|
274
|
-
(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
}, ee = to(
|
|
272
|
+
(C, B) => {
|
|
273
|
+
const z = [...B || []];
|
|
274
|
+
if (z.length > 0)
|
|
275
|
+
g((T) => {
|
|
276
|
+
const $ = [...T], O = (P) => {
|
|
277
|
+
var et, tt;
|
|
278
|
+
const F = z.shift(), U = P.find((ne) => ne.id === F), te = P.findIndex((ne) => ne.id === F);
|
|
279
|
+
if (z.length && U) {
|
|
280
|
+
if (((et = U.children) == null ? void 0 : et.filter(
|
|
281
|
+
(ne) => !C.some((Wt) => Wt.id === ne.id)
|
|
282
|
+
).length) === 1 && C.length === 1) {
|
|
283
|
+
const ne = { ...C[0] };
|
|
284
|
+
return P.splice(te, 1, ne), n == null || n(P), P;
|
|
285
|
+
}
|
|
286
|
+
return U.children = O(U.children || []), P.splice(te, 1, U), n == null || n(P), P;
|
|
278
287
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return
|
|
288
|
+
if (U) {
|
|
289
|
+
if (!((tt = U.children) != null && tt.length) && C.length) {
|
|
290
|
+
const ne = { ...U };
|
|
291
|
+
return U.data = { name: "文件夹" }, U.type = "group", U.children = [ne, ...C], U.id = Oe(), P.splice(te, 1, U), n == null || n(P), P;
|
|
292
|
+
}
|
|
293
|
+
return U.children = V.uniqueArray(C), P.splice(te, 1, U), n == null || n(P), P;
|
|
285
294
|
}
|
|
286
|
-
return
|
|
287
|
-
}
|
|
288
|
-
return V.uniqueArray(
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
var
|
|
300
|
-
for (let
|
|
301
|
-
if (
|
|
302
|
-
|
|
295
|
+
return V.uniqueArray(C);
|
|
296
|
+
};
|
|
297
|
+
return V.uniqueArray(O($));
|
|
298
|
+
});
|
|
299
|
+
else {
|
|
300
|
+
const T = V.uniqueArray(C);
|
|
301
|
+
n == null || n(T), g(T);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
[n]
|
|
305
|
+
), $e = (C, B) => {
|
|
306
|
+
g((z) => {
|
|
307
|
+
const T = [...z], $ = (O) => {
|
|
308
|
+
var P;
|
|
309
|
+
for (let F = 0; F < O.length; F++)
|
|
310
|
+
if (O[F].id === C) {
|
|
311
|
+
O[F].config = B;
|
|
303
312
|
break;
|
|
304
|
-
} else ((
|
|
313
|
+
} else ((P = O[F].children) == null ? void 0 : P.length) !== void 0 && $(O[F].children);
|
|
305
314
|
};
|
|
306
|
-
return
|
|
315
|
+
return $(T), n == null || n(T), T;
|
|
307
316
|
});
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
var
|
|
312
|
-
for (let
|
|
313
|
-
if (
|
|
314
|
-
|
|
317
|
+
}, Se = (C, B) => {
|
|
318
|
+
g((z) => {
|
|
319
|
+
const T = [...z], $ = (O) => {
|
|
320
|
+
var P;
|
|
321
|
+
for (let F = 0; F < O.length; F++)
|
|
322
|
+
if (O[F].id === C) {
|
|
323
|
+
O[F].data = B;
|
|
315
324
|
break;
|
|
316
|
-
} else ((
|
|
325
|
+
} else ((P = O[F].children) == null ? void 0 : P.length) !== void 0 && $(O[F].children);
|
|
317
326
|
};
|
|
318
|
-
return
|
|
327
|
+
return $(T), n == null || n(T), T;
|
|
319
328
|
});
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
const
|
|
323
|
-
var
|
|
324
|
-
for (let
|
|
325
|
-
if (P
|
|
326
|
-
|
|
329
|
+
}, Te = (C) => {
|
|
330
|
+
g((B) => {
|
|
331
|
+
const z = [...B], T = ($) => {
|
|
332
|
+
var O;
|
|
333
|
+
for (let P = 0; P < $.length; P++)
|
|
334
|
+
if ($[P].id === C) {
|
|
335
|
+
$.splice(P, 1);
|
|
327
336
|
break;
|
|
328
|
-
} else ((
|
|
337
|
+
} else ((O = $[P].children) == null ? void 0 : O.length) !== void 0 && T($[P].children);
|
|
329
338
|
};
|
|
330
|
-
return
|
|
339
|
+
return T(z), n == null || n(z), z;
|
|
331
340
|
});
|
|
332
|
-
}, ie = (
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
|
|
341
|
+
}, ie = (C, B) => {
|
|
342
|
+
const z = [...h], T = ($, O) => {
|
|
343
|
+
const P = O.shift(), F = $.find((te) => te.id === P), U = $.findIndex((te) => te.id === P);
|
|
344
|
+
if (F) {
|
|
345
|
+
if (O.length)
|
|
346
|
+
F.children = T(F.children || [], O);
|
|
338
347
|
else {
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
...
|
|
348
|
+
const te = (C == null ? void 0 : C.type) ?? "app";
|
|
349
|
+
F.children = [
|
|
350
|
+
...F.children ?? [],
|
|
342
351
|
{
|
|
343
|
-
...
|
|
344
|
-
id:
|
|
345
|
-
config: (
|
|
352
|
+
...C,
|
|
353
|
+
id: Oe(),
|
|
354
|
+
config: (C == null ? void 0 : C.config) ?? Be[te]
|
|
346
355
|
}
|
|
347
356
|
];
|
|
348
357
|
}
|
|
349
|
-
return
|
|
358
|
+
return $.splice(U, 1, F), $;
|
|
350
359
|
} else
|
|
351
|
-
return
|
|
360
|
+
return $;
|
|
352
361
|
};
|
|
353
|
-
|
|
362
|
+
g(T(z, B));
|
|
363
|
+
}, Me = (C) => {
|
|
364
|
+
g((B) => {
|
|
365
|
+
const z = (C == null ? void 0 : C.type) ?? "app", T = {
|
|
366
|
+
...C,
|
|
367
|
+
id: Oe(),
|
|
368
|
+
config: (C == null ? void 0 : C.config) ?? Be[z]
|
|
369
|
+
}, $ = [...B, T];
|
|
370
|
+
return n == null || n($), $;
|
|
371
|
+
});
|
|
372
|
+
}, He = (C, B) => {
|
|
373
|
+
g((z) => {
|
|
374
|
+
const T = [...z], $ = T.findIndex((O) => O.id === C);
|
|
375
|
+
return $ !== -1 && (T[$] = { ...T[$], ...B }, n == null || n(T)), T;
|
|
376
|
+
});
|
|
377
|
+
}, xe = (C) => {
|
|
378
|
+
g((B) => {
|
|
379
|
+
const z = B.filter((T) => T.id !== C);
|
|
380
|
+
return n == null || n(z), z;
|
|
381
|
+
});
|
|
354
382
|
};
|
|
355
383
|
return ae(() => {
|
|
356
|
-
(o == null ? void 0 : o.length) > 0 && h.length === 0 &&
|
|
384
|
+
(o == null ? void 0 : o.length) > 0 && h.length === 0 && ee(o);
|
|
357
385
|
}, [o]), ae(() => {
|
|
358
|
-
|
|
386
|
+
f.current = l, l !== null && j();
|
|
359
387
|
}, [l]), ae(() => {
|
|
360
|
-
s &&
|
|
361
|
-
}, [
|
|
388
|
+
s && re != null && re.length && !X && (ee(re), se(!0));
|
|
389
|
+
}, [re, X, s, ee]), ao(
|
|
362
390
|
() => {
|
|
363
|
-
s &&
|
|
391
|
+
s && A(h);
|
|
364
392
|
},
|
|
365
393
|
[h, s],
|
|
366
394
|
{
|
|
367
395
|
wait: 1e3
|
|
368
396
|
}
|
|
369
397
|
), /* @__PURE__ */ t(
|
|
370
|
-
|
|
398
|
+
At.Provider,
|
|
371
399
|
{
|
|
372
400
|
value: {
|
|
373
401
|
list: h,
|
|
374
|
-
setList:
|
|
402
|
+
setList: ee,
|
|
375
403
|
contextMenu: v,
|
|
376
404
|
setContextMenu: D,
|
|
377
405
|
listStatus: l,
|
|
378
406
|
setListStatus: c,
|
|
379
407
|
contextMenuFuns: K,
|
|
380
|
-
hideContextMenu:
|
|
381
|
-
showInfoItemData:
|
|
408
|
+
hideContextMenu: j,
|
|
409
|
+
showInfoItemData: S,
|
|
382
410
|
setShowInfoItemData: y,
|
|
383
|
-
openGroupItemData:
|
|
411
|
+
openGroupItemData: I,
|
|
384
412
|
setOpenGroupItemData: u,
|
|
385
|
-
longPressTriggered:
|
|
386
|
-
updateItemConfig:
|
|
387
|
-
updateItem:
|
|
388
|
-
removeItem:
|
|
413
|
+
longPressTriggered: M,
|
|
414
|
+
updateItemConfig: $e,
|
|
415
|
+
updateItem: Se,
|
|
416
|
+
removeItem: Te,
|
|
389
417
|
addItem: ie,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
418
|
+
addRootItem: Me,
|
|
419
|
+
updateRootItem: He,
|
|
420
|
+
removeRootItem: xe,
|
|
421
|
+
moveItemId: N,
|
|
422
|
+
setMoveItemId: w,
|
|
423
|
+
moveTargetId: H,
|
|
424
|
+
setMoveTargetId: G
|
|
394
425
|
},
|
|
395
426
|
children: e
|
|
396
427
|
}
|
|
397
428
|
);
|
|
398
|
-
}, pe = () =>
|
|
429
|
+
}, pe = () => it(At), Rn = {
|
|
399
430
|
menuShow: {
|
|
400
431
|
opacity: 1,
|
|
401
432
|
y: 0,
|
|
402
433
|
transition: { type: "spring", stiffness: 300, damping: 24 }
|
|
403
434
|
},
|
|
404
435
|
menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
|
|
405
|
-
},
|
|
406
|
-
const { icon: e, title: o, onClick:
|
|
436
|
+
}, Fe = (r) => {
|
|
437
|
+
const { icon: e, title: o, onClick: n } = r, { theme: a } = le(), { light: s, dark: i } = V.getTheme(a);
|
|
407
438
|
return /* @__PURE__ */ t(
|
|
408
439
|
R.div,
|
|
409
440
|
{
|
|
@@ -425,9 +456,9 @@ const Tt = rt({
|
|
|
425
456
|
border-radius: 0.5rem;
|
|
426
457
|
`,
|
|
427
458
|
onClick: (d) => {
|
|
428
|
-
d.stopPropagation(),
|
|
459
|
+
d.stopPropagation(), n == null || n();
|
|
429
460
|
},
|
|
430
|
-
variants:
|
|
461
|
+
variants: Rn,
|
|
431
462
|
children: /* @__PURE__ */ m(
|
|
432
463
|
R.div,
|
|
433
464
|
{
|
|
@@ -462,12 +493,12 @@ const Tt = rt({
|
|
|
462
493
|
)
|
|
463
494
|
}
|
|
464
495
|
);
|
|
465
|
-
},
|
|
496
|
+
}, Pn = (r) => {
|
|
466
497
|
const {
|
|
467
498
|
showInfoButton: e = !0,
|
|
468
499
|
showRemoveButton: o = !0,
|
|
469
|
-
showShareButton:
|
|
470
|
-
showSizeButton:
|
|
500
|
+
showShareButton: n = !0,
|
|
501
|
+
showSizeButton: a = !0,
|
|
471
502
|
onInfoClick: s,
|
|
472
503
|
onShareClick: i,
|
|
473
504
|
onRemoveClick: d
|
|
@@ -476,17 +507,17 @@ const Tt = rt({
|
|
|
476
507
|
setContextMenu: x,
|
|
477
508
|
hideContextMenu: l,
|
|
478
509
|
setShowInfoItemData: c,
|
|
479
|
-
removeItem:
|
|
510
|
+
removeItem: f,
|
|
480
511
|
updateItemConfig: v
|
|
481
|
-
} = pe(), { theme: D } = le(), { light: h, dark:
|
|
482
|
-
var
|
|
483
|
-
const u =
|
|
484
|
-
for (let
|
|
485
|
-
for (let
|
|
486
|
-
|
|
487
|
-
return
|
|
512
|
+
} = pe(), { theme: D } = le(), { light: h, dark: g } = V.getTheme(D), { data: S } = p ?? {}, { config: y = {} } = S ?? {}, I = () => {
|
|
513
|
+
var L;
|
|
514
|
+
const u = Be[(L = p == null ? void 0 : p.data) == null ? void 0 : L.type], M = [];
|
|
515
|
+
for (let N = 1; N <= ((u == null ? void 0 : u.maxRow) ?? 2); N++)
|
|
516
|
+
for (let w = 1; w <= ((u == null ? void 0 : u.maxCol) ?? 2); w++)
|
|
517
|
+
M.push(`${N}x${w}`);
|
|
518
|
+
return M;
|
|
488
519
|
};
|
|
489
|
-
return /* @__PURE__ */ t(
|
|
520
|
+
return /* @__PURE__ */ t(Ue, { children: p && /* @__PURE__ */ m(
|
|
490
521
|
R.div,
|
|
491
522
|
{
|
|
492
523
|
initial: { opacity: 0 },
|
|
@@ -506,12 +537,12 @@ const Tt = rt({
|
|
|
506
537
|
background-color: ${h.contextMenuBackgroundColor};
|
|
507
538
|
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
508
539
|
@media (prefers-color-scheme: dark) {
|
|
509
|
-
background-color: ${
|
|
510
|
-
box-shadow: 0 0 0.5rem ${
|
|
540
|
+
background-color: ${g.contextMenuBackgroundColor};
|
|
541
|
+
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
511
542
|
}
|
|
512
543
|
`
|
|
513
544
|
),
|
|
514
|
-
children:
|
|
545
|
+
children: a && y.allowResize !== !1 && /* @__PURE__ */ t(
|
|
515
546
|
R.ul,
|
|
516
547
|
{
|
|
517
548
|
className: b`
|
|
@@ -523,15 +554,15 @@ const Tt = rt({
|
|
|
523
554
|
{
|
|
524
555
|
label: "修改大小",
|
|
525
556
|
key: "size",
|
|
526
|
-
icon: /* @__PURE__ */ t(
|
|
527
|
-
items:
|
|
557
|
+
icon: /* @__PURE__ */ t(so, { size: 14 }),
|
|
558
|
+
items: I().map((u) => ({
|
|
528
559
|
label: u,
|
|
529
560
|
key: u,
|
|
530
561
|
onClick: () => {
|
|
531
|
-
const [
|
|
562
|
+
const [M, L] = u.split("x").map(Number);
|
|
532
563
|
v(p.data.id, {
|
|
533
|
-
row:
|
|
534
|
-
col:
|
|
564
|
+
row: M,
|
|
565
|
+
col: L
|
|
535
566
|
});
|
|
536
567
|
}
|
|
537
568
|
}))
|
|
@@ -559,7 +590,7 @@ const Tt = rt({
|
|
|
559
590
|
margin: 0;
|
|
560
591
|
color: ${h.contextMenuTextColor};
|
|
561
592
|
@media (prefers-color-scheme: dark) {
|
|
562
|
-
color: ${
|
|
593
|
+
color: ${g.contextMenuTextColor};
|
|
563
594
|
}
|
|
564
595
|
`,
|
|
565
596
|
children: [
|
|
@@ -577,7 +608,7 @@ const Tt = rt({
|
|
|
577
608
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
578
609
|
gap: 0.25rem;
|
|
579
610
|
`,
|
|
580
|
-
children: u.items.map((
|
|
611
|
+
children: u.items.map((M) => /* @__PURE__ */ t(
|
|
581
612
|
R.div,
|
|
582
613
|
{
|
|
583
614
|
className: k(
|
|
@@ -595,26 +626,26 @@ const Tt = rt({
|
|
|
595
626
|
text-align: center;
|
|
596
627
|
color: ${h.contextMenuTextColor};
|
|
597
628
|
@media (prefers-color-scheme: dark) {
|
|
598
|
-
color: ${
|
|
629
|
+
color: ${g.contextMenuTextColor};
|
|
599
630
|
}
|
|
600
631
|
&:hover {
|
|
601
632
|
background-color: ${h.contextMenuActiveColor};
|
|
602
633
|
@media (prefers-color-scheme: dark) {
|
|
603
|
-
background-color: ${
|
|
634
|
+
background-color: ${g.contextMenuActiveColor};
|
|
604
635
|
}
|
|
605
636
|
}
|
|
606
637
|
`,
|
|
607
|
-
`${y.row}x${y.col}` ===
|
|
638
|
+
`${y.row}x${y.col}` === M.key && b`
|
|
608
639
|
background-color: ${h.contextMenuActiveColor};
|
|
609
640
|
@media (prefers-color-scheme: dark) {
|
|
610
|
-
background-color: ${
|
|
641
|
+
background-color: ${g.contextMenuActiveColor};
|
|
611
642
|
}
|
|
612
643
|
`
|
|
613
644
|
),
|
|
614
|
-
onClick:
|
|
615
|
-
children:
|
|
645
|
+
onClick: M.onClick,
|
|
646
|
+
children: M.label
|
|
616
647
|
},
|
|
617
|
-
|
|
648
|
+
M.key
|
|
618
649
|
))
|
|
619
650
|
}
|
|
620
651
|
)
|
|
@@ -634,8 +665,8 @@ const Tt = rt({
|
|
|
634
665
|
background-color: ${h.contextMenuBackgroundColor};
|
|
635
666
|
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
636
667
|
@media (prefers-color-scheme: dark) {
|
|
637
|
-
background-color: ${
|
|
638
|
-
box-shadow: 0 0 0.5rem ${
|
|
668
|
+
background-color: ${g.contextMenuBackgroundColor};
|
|
669
|
+
box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
|
|
639
670
|
}
|
|
640
671
|
display: flex;
|
|
641
672
|
justify-content: space-around;
|
|
@@ -647,10 +678,10 @@ const Tt = rt({
|
|
|
647
678
|
`
|
|
648
679
|
),
|
|
649
680
|
children: [
|
|
650
|
-
|
|
651
|
-
|
|
681
|
+
n && /* @__PURE__ */ t(
|
|
682
|
+
Fe,
|
|
652
683
|
{
|
|
653
|
-
icon: /* @__PURE__ */ t(
|
|
684
|
+
icon: /* @__PURE__ */ t(io, { size: 20 }),
|
|
654
685
|
title: "分享",
|
|
655
686
|
onClick: () => {
|
|
656
687
|
if (i) {
|
|
@@ -661,9 +692,9 @@ const Tt = rt({
|
|
|
661
692
|
}
|
|
662
693
|
),
|
|
663
694
|
e && /* @__PURE__ */ t(
|
|
664
|
-
|
|
695
|
+
Fe,
|
|
665
696
|
{
|
|
666
|
-
icon: /* @__PURE__ */ t(
|
|
697
|
+
icon: /* @__PURE__ */ t(lo, { size: 20 }),
|
|
667
698
|
title: "信息",
|
|
668
699
|
onClick: () => {
|
|
669
700
|
if (s) {
|
|
@@ -679,16 +710,16 @@ const Tt = rt({
|
|
|
679
710
|
}
|
|
680
711
|
),
|
|
681
712
|
o && /* @__PURE__ */ t(
|
|
682
|
-
|
|
713
|
+
Fe,
|
|
683
714
|
{
|
|
684
|
-
icon: /* @__PURE__ */ t(
|
|
715
|
+
icon: /* @__PURE__ */ t(co, { size: 20 }),
|
|
685
716
|
title: "移除",
|
|
686
717
|
onClick: () => {
|
|
687
718
|
if (d) {
|
|
688
|
-
d(p.data,
|
|
719
|
+
d(p.data, f);
|
|
689
720
|
return;
|
|
690
721
|
}
|
|
691
|
-
x(null),
|
|
722
|
+
x(null), f(p.data.id);
|
|
692
723
|
}
|
|
693
724
|
}
|
|
694
725
|
)
|
|
@@ -698,8 +729,8 @@ const Tt = rt({
|
|
|
698
729
|
]
|
|
699
730
|
}
|
|
700
731
|
) });
|
|
701
|
-
},
|
|
702
|
-
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns:
|
|
732
|
+
}, Bn = (r) => {
|
|
733
|
+
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: n } = pe(), { itemIconBuilder: a, theme: s, contextMenu: i } = le(), { light: d, dark: p } = V.getTheme(s), { data: x = {} } = e, { name: l } = x;
|
|
703
734
|
return /* @__PURE__ */ m(ue, { children: [
|
|
704
735
|
/* @__PURE__ */ t(
|
|
705
736
|
R.div,
|
|
@@ -733,8 +764,8 @@ const Tt = rt({
|
|
|
733
764
|
color: ${p.itemNameColor};
|
|
734
765
|
}
|
|
735
766
|
`,
|
|
736
|
-
...
|
|
737
|
-
children:
|
|
767
|
+
...n(e, i !== !1),
|
|
768
|
+
children: a == null ? void 0 : a(e)
|
|
738
769
|
}
|
|
739
770
|
)
|
|
740
771
|
}
|
|
@@ -758,19 +789,19 @@ const Tt = rt({
|
|
|
758
789
|
}
|
|
759
790
|
)
|
|
760
791
|
] });
|
|
761
|
-
},
|
|
792
|
+
}, We = (r) => {
|
|
762
793
|
const {
|
|
763
794
|
data: e,
|
|
764
795
|
className: o,
|
|
765
|
-
itemIndex:
|
|
766
|
-
onClick:
|
|
796
|
+
itemIndex: n,
|
|
797
|
+
onClick: a,
|
|
767
798
|
disabledDrag: s = !1,
|
|
768
799
|
children: i,
|
|
769
800
|
parentIds: d,
|
|
770
801
|
childrenLength: p
|
|
771
802
|
} = r, { contextMenu: x, setContextMenu: l } = pe(), { contextMenu: c } = le();
|
|
772
803
|
return /* @__PURE__ */ t(
|
|
773
|
-
|
|
804
|
+
dt,
|
|
774
805
|
{
|
|
775
806
|
placement: "bottom",
|
|
776
807
|
overlayClassName: b`
|
|
@@ -781,32 +812,32 @@ const Tt = rt({
|
|
|
781
812
|
border: none;
|
|
782
813
|
}
|
|
783
814
|
`,
|
|
784
|
-
overlay: /* @__PURE__ */ t(
|
|
815
|
+
overlay: /* @__PURE__ */ t(Pn, { ...c }),
|
|
785
816
|
visible: (x == null ? void 0 : x.data.id) === e.id,
|
|
786
|
-
onVisibleChange: (
|
|
787
|
-
|
|
817
|
+
onVisibleChange: (f) => {
|
|
818
|
+
f || l(null);
|
|
788
819
|
},
|
|
789
820
|
destroyTooltipOnHide: !0,
|
|
790
821
|
children: /* @__PURE__ */ t(
|
|
791
822
|
R.div,
|
|
792
823
|
{
|
|
793
824
|
"data-id": e.id,
|
|
794
|
-
"data-index":
|
|
825
|
+
"data-index": n,
|
|
795
826
|
"data-parent-ids": d == null ? void 0 : d.join(","),
|
|
796
827
|
"data-children-length": p,
|
|
797
|
-
onClick: () =>
|
|
828
|
+
onClick: () => a == null ? void 0 : a(e),
|
|
798
829
|
className: k(s && "drag-disabled", o),
|
|
799
|
-
children: i ?? /* @__PURE__ */ t(
|
|
830
|
+
children: i ?? /* @__PURE__ */ t(Bn, { ...r })
|
|
800
831
|
}
|
|
801
832
|
)
|
|
802
833
|
}
|
|
803
834
|
);
|
|
804
|
-
},
|
|
835
|
+
}, zn = (r) => {
|
|
805
836
|
const {
|
|
806
837
|
data: e,
|
|
807
838
|
className: o,
|
|
808
|
-
parentIds:
|
|
809
|
-
itemIndex:
|
|
839
|
+
parentIds: n,
|
|
840
|
+
itemIndex: a,
|
|
810
841
|
onClick: s,
|
|
811
842
|
noLetters: i = !1
|
|
812
843
|
} = r, {
|
|
@@ -815,23 +846,23 @@ const Tt = rt({
|
|
|
815
846
|
setOpenGroupItemData: x,
|
|
816
847
|
longPressTriggered: l,
|
|
817
848
|
moveItemId: c,
|
|
818
|
-
moveTargetId:
|
|
849
|
+
moveTargetId: f,
|
|
819
850
|
setMoveTargetId: v,
|
|
820
851
|
listStatus: D
|
|
821
|
-
} = pe(), { itemIconBuilder: h, theme:
|
|
852
|
+
} = pe(), { itemIconBuilder: h, theme: g, contextMenu: S } = le(), { light: y, dark: I } = V.getTheme(g), { children: u, data: M, config: L } = e, { row: N = 1, col: w = 1 } = L ?? {}, H = {
|
|
822
853
|
visible: { opacity: 1, scale: 1 },
|
|
823
854
|
hidden: { opacity: 0, scale: 0.95 }
|
|
824
|
-
},
|
|
855
|
+
}, G = ((u == null ? void 0 : u.length) ?? 0) === 0, X = G ? [e] : [...u ?? []].slice(0, 9), se = he(() => c === e.id.toString(), [e.id, c]), re = he(() => f === e.id, [e.id, f]), A = b`
|
|
825
856
|
overflow: hidden;
|
|
826
857
|
cursor: pointer;
|
|
827
858
|
background-color: ${y.itemIconBackgroundColor};
|
|
828
859
|
box-shadow: 0 0 0.5rem ${y.itemIconShadowColor};
|
|
829
860
|
@media (prefers-color-scheme: dark) {
|
|
830
|
-
background-color: ${
|
|
831
|
-
box-shadow: 0 0 0.5rem ${
|
|
861
|
+
background-color: ${I.itemIconBackgroundColor};
|
|
862
|
+
box-shadow: 0 0 0.5rem ${I.itemIconShadowColor};
|
|
832
863
|
}
|
|
833
|
-
`,
|
|
834
|
-
if (
|
|
864
|
+
`, j = () => {
|
|
865
|
+
if (G)
|
|
835
866
|
return /* @__PURE__ */ t(
|
|
836
867
|
R.div,
|
|
837
868
|
{
|
|
@@ -848,17 +879,17 @@ const Tt = rt({
|
|
|
848
879
|
top: 0;
|
|
849
880
|
border-radius: 0.75rem;
|
|
850
881
|
@media (prefers-color-scheme: dark) {
|
|
851
|
-
background-color: ${
|
|
882
|
+
background-color: ${I.itemIconBackgroundColor};
|
|
852
883
|
}
|
|
853
884
|
`
|
|
854
885
|
),
|
|
855
|
-
onClick: (
|
|
856
|
-
|
|
886
|
+
onClick: (E) => {
|
|
887
|
+
E.stopPropagation(), s == null || s(e);
|
|
857
888
|
},
|
|
858
889
|
children: h == null ? void 0 : h(e)
|
|
859
890
|
}
|
|
860
891
|
);
|
|
861
|
-
if (
|
|
892
|
+
if (N === 1 && w === 1 || N === 2 && w === 2)
|
|
862
893
|
return /* @__PURE__ */ t(
|
|
863
894
|
R.div,
|
|
864
895
|
{
|
|
@@ -868,31 +899,31 @@ const Tt = rt({
|
|
|
868
899
|
height: 100%;
|
|
869
900
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
870
901
|
grid-template-rows: repeat(3, minmax(0, 1fr));
|
|
871
|
-
padding: ${
|
|
872
|
-
gap: ${
|
|
902
|
+
padding: ${w === 1 ? "0.125rem" : "0.25rem"};
|
|
903
|
+
gap: ${w === 1 ? "0.125rem" : "0.5rem"};
|
|
873
904
|
place-items: center;
|
|
874
905
|
`,
|
|
875
|
-
children:
|
|
906
|
+
children: X == null ? void 0 : X.slice(0, 9).map((E) => /* @__PURE__ */ t(
|
|
876
907
|
R.div,
|
|
877
908
|
{
|
|
878
909
|
className: k(
|
|
879
|
-
|
|
910
|
+
A,
|
|
880
911
|
b`
|
|
881
|
-
border-radius: ${
|
|
912
|
+
border-radius: ${w === 1 ? "0.25rem" : "0.5rem"};
|
|
882
913
|
width: 100%;
|
|
883
914
|
height: 100%;
|
|
884
915
|
`
|
|
885
916
|
),
|
|
886
917
|
onClick: (K) => {
|
|
887
|
-
K.stopPropagation(), s == null || s(
|
|
918
|
+
K.stopPropagation(), s == null || s(E);
|
|
888
919
|
},
|
|
889
|
-
children: h == null ? void 0 : h(
|
|
920
|
+
children: h == null ? void 0 : h(E)
|
|
890
921
|
},
|
|
891
|
-
|
|
922
|
+
E.id
|
|
892
923
|
))
|
|
893
924
|
}
|
|
894
925
|
);
|
|
895
|
-
if (
|
|
926
|
+
if (N === 1 && w === 2)
|
|
896
927
|
return /* @__PURE__ */ t(
|
|
897
928
|
R.div,
|
|
898
929
|
{
|
|
@@ -906,11 +937,11 @@ const Tt = rt({
|
|
|
906
937
|
height: 52px;
|
|
907
938
|
place-items: center;
|
|
908
939
|
`,
|
|
909
|
-
children:
|
|
940
|
+
children: X == null ? void 0 : X.slice(0, 4).map((E, K) => /* @__PURE__ */ t(
|
|
910
941
|
R.div,
|
|
911
942
|
{
|
|
912
943
|
className: k(
|
|
913
|
-
|
|
944
|
+
A,
|
|
914
945
|
K < 2 ? b`
|
|
915
946
|
width: 52px;
|
|
916
947
|
height: 52px;
|
|
@@ -925,16 +956,16 @@ const Tt = rt({
|
|
|
925
956
|
grid-row: span 2 / span 2;
|
|
926
957
|
`
|
|
927
958
|
),
|
|
928
|
-
onClick: (
|
|
929
|
-
K > 2 || (
|
|
959
|
+
onClick: (ee) => {
|
|
960
|
+
K > 2 || (ee.stopPropagation(), s == null || s(E));
|
|
930
961
|
},
|
|
931
|
-
children: h == null ? void 0 : h(
|
|
962
|
+
children: h == null ? void 0 : h(E)
|
|
932
963
|
},
|
|
933
|
-
|
|
964
|
+
E.id
|
|
934
965
|
))
|
|
935
966
|
}
|
|
936
967
|
);
|
|
937
|
-
if (
|
|
968
|
+
if (N === 2 && w === 1)
|
|
938
969
|
return /* @__PURE__ */ t(
|
|
939
970
|
R.div,
|
|
940
971
|
{
|
|
@@ -948,11 +979,11 @@ const Tt = rt({
|
|
|
948
979
|
height: 144px;
|
|
949
980
|
place-items: center;
|
|
950
981
|
`,
|
|
951
|
-
children:
|
|
982
|
+
children: X == null ? void 0 : X.slice(0, 4).map((E, K) => /* @__PURE__ */ t(
|
|
952
983
|
R.div,
|
|
953
984
|
{
|
|
954
985
|
className: k(
|
|
955
|
-
|
|
986
|
+
A,
|
|
956
987
|
K < 2 ? b`
|
|
957
988
|
width: 52px;
|
|
958
989
|
height: 52px;
|
|
@@ -966,27 +997,27 @@ const Tt = rt({
|
|
|
966
997
|
grid-row: span 2 / span 2;
|
|
967
998
|
`
|
|
968
999
|
),
|
|
969
|
-
onClick: (
|
|
970
|
-
K > 2 || (
|
|
1000
|
+
onClick: (ee) => {
|
|
1001
|
+
K > 2 || (ee.stopPropagation(), s == null || s(E));
|
|
971
1002
|
},
|
|
972
|
-
children: h == null ? void 0 : h(
|
|
1003
|
+
children: h == null ? void 0 : h(E)
|
|
973
1004
|
},
|
|
974
|
-
|
|
1005
|
+
E.id
|
|
975
1006
|
))
|
|
976
1007
|
}
|
|
977
1008
|
);
|
|
978
1009
|
};
|
|
979
1010
|
return /* @__PURE__ */ m(
|
|
980
|
-
|
|
1011
|
+
We,
|
|
981
1012
|
{
|
|
982
1013
|
data: e,
|
|
983
|
-
itemIndex:
|
|
984
|
-
parentIds:
|
|
1014
|
+
itemIndex: a,
|
|
1015
|
+
parentIds: n,
|
|
985
1016
|
childrenLength: u == null ? void 0 : u.length,
|
|
986
1017
|
className: k(
|
|
987
1018
|
b`
|
|
988
|
-
grid-row: span ${
|
|
989
|
-
grid-column: span ${
|
|
1019
|
+
grid-row: span ${N};
|
|
1020
|
+
grid-column: span ${w};
|
|
990
1021
|
`,
|
|
991
1022
|
o
|
|
992
1023
|
),
|
|
@@ -996,7 +1027,7 @@ const Tt = rt({
|
|
|
996
1027
|
{
|
|
997
1028
|
whileTap: { scale: 0.9 },
|
|
998
1029
|
className: k(
|
|
999
|
-
|
|
1030
|
+
re ? "!scale-110" : "",
|
|
1000
1031
|
b`
|
|
1001
1032
|
cursor: pointer;
|
|
1002
1033
|
position: relative;
|
|
@@ -1004,20 +1035,20 @@ const Tt = rt({
|
|
|
1004
1035
|
background-color: ${y.groupItemIconBackgroundColor};
|
|
1005
1036
|
box-shadow: 0 0 0.5rem ${y.groupItemIconShadowColor};
|
|
1006
1037
|
@media (prefers-color-scheme: dark) {
|
|
1007
|
-
background-color: ${
|
|
1008
|
-
box-shadow: 0 0 0.5rem ${
|
|
1038
|
+
background-color: ${I.groupItemIconBackgroundColor};
|
|
1039
|
+
box-shadow: 0 0 0.5rem ${I.groupItemIconShadowColor};
|
|
1009
1040
|
}
|
|
1010
1041
|
/* overflow: hidden; */
|
|
1011
1042
|
transition: all 0.3s;
|
|
1012
1043
|
margin: 0 auto;
|
|
1013
|
-
width: ${
|
|
1014
|
-
height: ${
|
|
1044
|
+
width: ${w * 64 + 32 * (w - 1)}px;
|
|
1045
|
+
height: ${N * 64 + 32 * (N - 1)}px;
|
|
1015
1046
|
`
|
|
1016
1047
|
),
|
|
1017
|
-
onClick: (
|
|
1018
|
-
!
|
|
1048
|
+
onClick: (E) => {
|
|
1049
|
+
!G && !l && (e.parentIds = n, e.pageX = E.pageX, e.pageY = E.pageY, x(e));
|
|
1019
1050
|
},
|
|
1020
|
-
...d(e,
|
|
1051
|
+
...d(e, S !== !1),
|
|
1021
1052
|
children: /* @__PURE__ */ m(
|
|
1022
1053
|
R.div,
|
|
1023
1054
|
{
|
|
@@ -1031,9 +1062,9 @@ const Tt = rt({
|
|
|
1031
1062
|
padding: 0.375rem;
|
|
1032
1063
|
`,
|
|
1033
1064
|
children: [
|
|
1034
|
-
|
|
1065
|
+
j(),
|
|
1035
1066
|
/* @__PURE__ */ t(
|
|
1036
|
-
|
|
1067
|
+
Xe,
|
|
1037
1068
|
{
|
|
1038
1069
|
className: k(
|
|
1039
1070
|
"sortable-group-item",
|
|
@@ -1054,7 +1085,7 @@ const Tt = rt({
|
|
|
1054
1085
|
animation: 150,
|
|
1055
1086
|
fallbackOnBody: !0,
|
|
1056
1087
|
list: u ?? [],
|
|
1057
|
-
setList: (
|
|
1088
|
+
setList: (E) => p(E, n),
|
|
1058
1089
|
filter: () => !0,
|
|
1059
1090
|
"data-id": e.id,
|
|
1060
1091
|
onChange: () => {
|
|
@@ -1075,22 +1106,22 @@ const Tt = rt({
|
|
|
1075
1106
|
b`
|
|
1076
1107
|
color: ${y.itemNameColor};
|
|
1077
1108
|
@media (prefers-color-scheme: dark) {
|
|
1078
|
-
color: ${
|
|
1109
|
+
color: ${I.itemNameColor};
|
|
1079
1110
|
}
|
|
1080
1111
|
`,
|
|
1081
1112
|
i && b`
|
|
1082
1113
|
color: transparent;
|
|
1083
1114
|
`
|
|
1084
1115
|
),
|
|
1085
|
-
variants:
|
|
1116
|
+
variants: H,
|
|
1086
1117
|
animate: se ? "hidden" : "visible",
|
|
1087
|
-
children: (
|
|
1118
|
+
children: (M == null ? void 0 : M.name) ?? "文件夹"
|
|
1088
1119
|
}
|
|
1089
1120
|
)
|
|
1090
1121
|
]
|
|
1091
1122
|
}
|
|
1092
1123
|
);
|
|
1093
|
-
},
|
|
1124
|
+
}, Rt = b`
|
|
1094
1125
|
padding: 8px;
|
|
1095
1126
|
transition: all 0.2s;
|
|
1096
1127
|
> div {
|
|
@@ -1102,20 +1133,20 @@ const Tt = rt({
|
|
|
1102
1133
|
transition: all 0.2s;
|
|
1103
1134
|
}
|
|
1104
1135
|
}
|
|
1105
|
-
`,
|
|
1106
|
-
const { data: e, onClose: o, onItemClick:
|
|
1107
|
-
list:
|
|
1136
|
+
`, En = (r) => {
|
|
1137
|
+
const { data: e, onClose: o, onItemClick: n } = r, {
|
|
1138
|
+
list: a,
|
|
1108
1139
|
setList: s,
|
|
1109
1140
|
setListStatus: i,
|
|
1110
1141
|
setMoveItemId: d,
|
|
1111
1142
|
setMoveTargetId: p,
|
|
1112
1143
|
updateItem: x
|
|
1113
|
-
} = pe(), { theme: l } = le(), { light: c, dark:
|
|
1144
|
+
} = pe(), { theme: l } = le(), { light: c, dark: f } = V.getTheme(l), [v, D] = _("文件夹"), h = [...(e == null ? void 0 : e.children) ?? []];
|
|
1114
1145
|
return ae(() => {
|
|
1115
|
-
var
|
|
1116
|
-
e && D((
|
|
1146
|
+
var g;
|
|
1147
|
+
e && D((g = e.data) == null ? void 0 : g.name);
|
|
1117
1148
|
}, [e]), /* @__PURE__ */ t(
|
|
1118
|
-
|
|
1149
|
+
Ct,
|
|
1119
1150
|
{
|
|
1120
1151
|
visible: !!e,
|
|
1121
1152
|
onClose: () => {
|
|
@@ -1145,8 +1176,8 @@ const Tt = rt({
|
|
|
1145
1176
|
}
|
|
1146
1177
|
`,
|
|
1147
1178
|
value: v,
|
|
1148
|
-
onChange: (
|
|
1149
|
-
D(
|
|
1179
|
+
onChange: (g) => {
|
|
1180
|
+
D(g.target.value);
|
|
1150
1181
|
},
|
|
1151
1182
|
onBlur: () => {
|
|
1152
1183
|
e && x(e.id, {
|
|
@@ -1177,7 +1208,7 @@ const Tt = rt({
|
|
|
1177
1208
|
.rc-dialog-body {
|
|
1178
1209
|
background-color: ${c.groupItemModalBackgroundColor};
|
|
1179
1210
|
@media (prefers-color-scheme: dark) {
|
|
1180
|
-
background-color: ${
|
|
1211
|
+
background-color: ${f.groupItemModalBackgroundColor};
|
|
1181
1212
|
}
|
|
1182
1213
|
border-radius: 0.5rem;
|
|
1183
1214
|
overflow: hidden;
|
|
@@ -1195,14 +1226,14 @@ const Tt = rt({
|
|
|
1195
1226
|
max-height: 60vh;
|
|
1196
1227
|
padding: 1.25rem 0;
|
|
1197
1228
|
`,
|
|
1198
|
-
onDragLeave: (
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1229
|
+
onDragLeave: (g) => {
|
|
1230
|
+
const S = g.relatedTarget;
|
|
1231
|
+
S && (g.currentTarget.contains(S) || setTimeout(() => {
|
|
1201
1232
|
o();
|
|
1202
1233
|
}, 500));
|
|
1203
1234
|
},
|
|
1204
1235
|
children: /* @__PURE__ */ t(
|
|
1205
|
-
|
|
1236
|
+
Xe,
|
|
1206
1237
|
{
|
|
1207
1238
|
className: b`
|
|
1208
1239
|
display: grid;
|
|
@@ -1216,28 +1247,28 @@ const Tt = rt({
|
|
|
1216
1247
|
animation: 150,
|
|
1217
1248
|
fallbackOnBody: !0,
|
|
1218
1249
|
list: (e == null ? void 0 : e.children) ?? [],
|
|
1219
|
-
setList: (
|
|
1220
|
-
var
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1250
|
+
setList: (g) => {
|
|
1251
|
+
var I, u;
|
|
1252
|
+
const S = g.map((M) => M.id), y = (u = (I = a.find((M) => M.id === (e == null ? void 0 : e.id))) == null ? void 0 : I.children) == null ? void 0 : u.map((M) => M.id);
|
|
1253
|
+
S.length === (y == null ? void 0 : y.length) && S.every((M, L) => M === y[L]) || S.length < ((y == null ? void 0 : y.length) ?? 0) || s(g, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
|
|
1223
1254
|
},
|
|
1224
1255
|
onMove: () => (p(null), i("onMove"), !0),
|
|
1225
|
-
onStart: (
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1256
|
+
onStart: (g) => {
|
|
1257
|
+
const S = g.item.dataset;
|
|
1258
|
+
S != null && S.id && d(S.id), i("onMove");
|
|
1228
1259
|
},
|
|
1229
1260
|
onEnd: () => {
|
|
1230
1261
|
d(null), p(null), i(null);
|
|
1231
1262
|
},
|
|
1232
|
-
ghostClass:
|
|
1233
|
-
children: h.map((
|
|
1234
|
-
|
|
1263
|
+
ghostClass: Rt,
|
|
1264
|
+
children: h.map((g, S) => /* @__PURE__ */ t(
|
|
1265
|
+
We,
|
|
1235
1266
|
{
|
|
1236
|
-
data:
|
|
1237
|
-
itemIndex:
|
|
1238
|
-
onClick:
|
|
1267
|
+
data: g,
|
|
1268
|
+
itemIndex: S,
|
|
1269
|
+
onClick: n
|
|
1239
1270
|
},
|
|
1240
|
-
|
|
1271
|
+
g.id
|
|
1241
1272
|
))
|
|
1242
1273
|
}
|
|
1243
1274
|
)
|
|
@@ -1245,11 +1276,11 @@ const Tt = rt({
|
|
|
1245
1276
|
)
|
|
1246
1277
|
}
|
|
1247
1278
|
);
|
|
1248
|
-
},
|
|
1249
|
-
var
|
|
1279
|
+
}, $n = (r) => {
|
|
1280
|
+
var n;
|
|
1250
1281
|
const { data: e, onClose: o } = r;
|
|
1251
1282
|
return /* @__PURE__ */ t(
|
|
1252
|
-
|
|
1283
|
+
Ct,
|
|
1253
1284
|
{
|
|
1254
1285
|
visible: !!e,
|
|
1255
1286
|
onClose: () => {
|
|
@@ -1262,32 +1293,32 @@ const Tt = rt({
|
|
|
1262
1293
|
y: e == null ? void 0 : e.pageY
|
|
1263
1294
|
} : null,
|
|
1264
1295
|
footer: null,
|
|
1265
|
-
title: ((
|
|
1296
|
+
title: ((n = e == null ? void 0 : e.data) == null ? void 0 : n.name) ?? "信息",
|
|
1266
1297
|
children: e && /* @__PURE__ */ m("div", { children: [
|
|
1267
1298
|
/* @__PURE__ */ t("div", { className: "mb-2", children: "开发者信息" }),
|
|
1268
|
-
/* @__PURE__ */ t("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ t(
|
|
1299
|
+
/* @__PURE__ */ t("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ t(Mo, { src: e, theme: "monokai" }) })
|
|
1269
1300
|
] })
|
|
1270
1301
|
}
|
|
1271
1302
|
);
|
|
1272
|
-
},
|
|
1303
|
+
}, Pt = (r) => {
|
|
1273
1304
|
const {
|
|
1274
1305
|
pagination: e = { position: "bottom" },
|
|
1275
1306
|
className: o,
|
|
1276
|
-
sliderProps:
|
|
1277
|
-
sliderRef:
|
|
1307
|
+
sliderProps: n,
|
|
1308
|
+
sliderRef: a,
|
|
1278
1309
|
onItemClick: s
|
|
1279
1310
|
} = r, i = be(null), d = be(null), {
|
|
1280
1311
|
list: p,
|
|
1281
1312
|
setList: x,
|
|
1282
1313
|
setListStatus: l,
|
|
1283
1314
|
showInfoItemData: c,
|
|
1284
|
-
setShowInfoItemData:
|
|
1315
|
+
setShowInfoItemData: f,
|
|
1285
1316
|
openGroupItemData: v,
|
|
1286
1317
|
setOpenGroupItemData: D,
|
|
1287
1318
|
setMoveItemId: h,
|
|
1288
|
-
setMoveTargetId:
|
|
1289
|
-
addItem:
|
|
1290
|
-
} = pe(), { pagingDotBuilder: y, pagingDotsBuilder:
|
|
1319
|
+
setMoveTargetId: g,
|
|
1320
|
+
addItem: S
|
|
1321
|
+
} = pe(), { pagingDotBuilder: y, pagingDotsBuilder: I, itemBuilder: u } = le(), M = he(() => e === !1 ? {} : {
|
|
1291
1322
|
top: b`
|
|
1292
1323
|
display: flex;
|
|
1293
1324
|
flex-direction: column;
|
|
@@ -1338,18 +1369,18 @@ const Tt = rt({
|
|
|
1338
1369
|
}[e.position ?? "bottom"], [e]);
|
|
1339
1370
|
return /* @__PURE__ */ m(ue, { children: [
|
|
1340
1371
|
/* @__PURE__ */ t(
|
|
1341
|
-
|
|
1372
|
+
ro,
|
|
1342
1373
|
{
|
|
1343
1374
|
useCSS: !0,
|
|
1344
1375
|
useTransform: !0,
|
|
1345
1376
|
arrows: !1,
|
|
1346
|
-
ref:
|
|
1377
|
+
ref: a ?? i,
|
|
1347
1378
|
infinite: !1,
|
|
1348
1379
|
dots: !0,
|
|
1349
1380
|
touchMove: !1,
|
|
1350
1381
|
lazyLoad: "anticipated",
|
|
1351
1382
|
className: k(
|
|
1352
|
-
|
|
1383
|
+
M,
|
|
1353
1384
|
b`
|
|
1354
1385
|
.slick-track {
|
|
1355
1386
|
display: flex;
|
|
@@ -1368,14 +1399,14 @@ const Tt = rt({
|
|
|
1368
1399
|
`,
|
|
1369
1400
|
o
|
|
1370
1401
|
),
|
|
1371
|
-
customPaging: (
|
|
1372
|
-
var
|
|
1402
|
+
customPaging: (L) => {
|
|
1403
|
+
var N, w;
|
|
1373
1404
|
if (y) {
|
|
1374
|
-
const
|
|
1375
|
-
return
|
|
1376
|
-
onDragEnter: (
|
|
1377
|
-
var
|
|
1378
|
-
(
|
|
1405
|
+
const H = y(p[L], L);
|
|
1406
|
+
return eo.cloneElement(H, {
|
|
1407
|
+
onDragEnter: (G) => {
|
|
1408
|
+
var X;
|
|
1409
|
+
(X = (a ?? i).current) == null || X.slickGoTo(L), H.props && H.props.onDragEnter && H.props.onDragEnter(G);
|
|
1379
1410
|
}
|
|
1380
1411
|
});
|
|
1381
1412
|
}
|
|
@@ -1383,14 +1414,14 @@ const Tt = rt({
|
|
|
1383
1414
|
"div",
|
|
1384
1415
|
{
|
|
1385
1416
|
onDragEnter: () => {
|
|
1386
|
-
var
|
|
1387
|
-
(
|
|
1417
|
+
var H;
|
|
1418
|
+
(H = (a ?? i).current) == null || H.slickGoTo(L);
|
|
1388
1419
|
},
|
|
1389
|
-
children: (
|
|
1420
|
+
children: (w = (N = p[L]) == null ? void 0 : N.data) == null ? void 0 : w.name
|
|
1390
1421
|
}
|
|
1391
1422
|
);
|
|
1392
1423
|
},
|
|
1393
|
-
appendDots: (
|
|
1424
|
+
appendDots: (L) => I ? I(L) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
1394
1425
|
"ul",
|
|
1395
1426
|
{
|
|
1396
1427
|
ref: d,
|
|
@@ -1417,28 +1448,28 @@ const Tt = rt({
|
|
|
1417
1448
|
}
|
|
1418
1449
|
`
|
|
1419
1450
|
),
|
|
1420
|
-
children:
|
|
1451
|
+
children: L
|
|
1421
1452
|
}
|
|
1422
1453
|
) }),
|
|
1423
|
-
...
|
|
1424
|
-
children: p.map((
|
|
1454
|
+
...n,
|
|
1455
|
+
children: p.map((L) => /* @__PURE__ */ t(
|
|
1425
1456
|
"div",
|
|
1426
1457
|
{
|
|
1427
|
-
onDrop: (
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1430
|
-
if (V.quickJSONCheck(
|
|
1458
|
+
onDrop: (N) => {
|
|
1459
|
+
N.preventDefault();
|
|
1460
|
+
const w = N.dataTransfer.getData("text/plain");
|
|
1461
|
+
if (V.quickJSONCheck(w))
|
|
1431
1462
|
try {
|
|
1432
|
-
|
|
1433
|
-
} catch (
|
|
1434
|
-
console.log("drag error",
|
|
1463
|
+
S(JSON.parse(w), [L.id]);
|
|
1464
|
+
} catch (G) {
|
|
1465
|
+
console.log("drag error", G);
|
|
1435
1466
|
}
|
|
1436
1467
|
},
|
|
1437
|
-
onDragOver: (
|
|
1438
|
-
|
|
1468
|
+
onDragOver: (N) => {
|
|
1469
|
+
N.preventDefault();
|
|
1439
1470
|
},
|
|
1440
1471
|
children: /* @__PURE__ */ t(
|
|
1441
|
-
|
|
1472
|
+
Xe,
|
|
1442
1473
|
{
|
|
1443
1474
|
className: k(
|
|
1444
1475
|
b`
|
|
@@ -1456,72 +1487,72 @@ const Tt = rt({
|
|
|
1456
1487
|
fallbackOnBody: !0,
|
|
1457
1488
|
swapThreshold: 0.65,
|
|
1458
1489
|
group: "nested",
|
|
1459
|
-
list:
|
|
1460
|
-
setList: (
|
|
1490
|
+
list: L.children ?? [],
|
|
1491
|
+
setList: (N) => x(N, [L.id]),
|
|
1461
1492
|
filter: ".drag-disabled",
|
|
1462
|
-
onMove: (
|
|
1493
|
+
onMove: (N) => {
|
|
1463
1494
|
l("onMove");
|
|
1464
|
-
const { dragged:
|
|
1465
|
-
return
|
|
1495
|
+
const { dragged: w, related: H } = N, G = w.dataset, X = H.dataset;
|
|
1496
|
+
return g(null), !((Object.keys(X).length === 0 || X.parentIds) && Number(G.childrenLength) > 0 && H.classList.contains("sortable-group-item"));
|
|
1466
1497
|
},
|
|
1467
|
-
onStart: (
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1498
|
+
onStart: (N) => {
|
|
1499
|
+
const w = N.item.dataset;
|
|
1500
|
+
w != null && w.id && h(w.id), l("onMove");
|
|
1470
1501
|
},
|
|
1471
1502
|
onEnd: () => {
|
|
1472
|
-
h(null),
|
|
1503
|
+
h(null), g(null), l(null);
|
|
1473
1504
|
},
|
|
1474
|
-
ghostClass:
|
|
1475
|
-
children: (
|
|
1476
|
-
let
|
|
1505
|
+
ghostClass: Rt,
|
|
1506
|
+
children: (L.children ?? []).map((N, w) => {
|
|
1507
|
+
let H;
|
|
1477
1508
|
if (u)
|
|
1478
|
-
return u(
|
|
1479
|
-
switch (
|
|
1509
|
+
return u(N);
|
|
1510
|
+
switch (N.type) {
|
|
1480
1511
|
case "group":
|
|
1481
1512
|
case "app":
|
|
1482
|
-
|
|
1483
|
-
|
|
1513
|
+
H = /* @__PURE__ */ t(
|
|
1514
|
+
zn,
|
|
1484
1515
|
{
|
|
1485
|
-
data:
|
|
1486
|
-
itemIndex:
|
|
1487
|
-
parentIds: [
|
|
1516
|
+
data: N,
|
|
1517
|
+
itemIndex: w,
|
|
1518
|
+
parentIds: [L.id, N.id],
|
|
1488
1519
|
onClick: s
|
|
1489
1520
|
},
|
|
1490
|
-
|
|
1521
|
+
N.id
|
|
1491
1522
|
);
|
|
1492
1523
|
break;
|
|
1493
1524
|
default:
|
|
1494
|
-
|
|
1495
|
-
|
|
1525
|
+
H = /* @__PURE__ */ t(
|
|
1526
|
+
We,
|
|
1496
1527
|
{
|
|
1497
|
-
data:
|
|
1498
|
-
itemIndex:
|
|
1528
|
+
data: N,
|
|
1529
|
+
itemIndex: w,
|
|
1499
1530
|
onClick: s
|
|
1500
1531
|
},
|
|
1501
|
-
|
|
1532
|
+
N.id
|
|
1502
1533
|
);
|
|
1503
1534
|
break;
|
|
1504
1535
|
}
|
|
1505
|
-
return
|
|
1536
|
+
return H;
|
|
1506
1537
|
})
|
|
1507
1538
|
}
|
|
1508
1539
|
)
|
|
1509
1540
|
},
|
|
1510
|
-
|
|
1541
|
+
L.id
|
|
1511
1542
|
))
|
|
1512
1543
|
}
|
|
1513
1544
|
),
|
|
1514
1545
|
/* @__PURE__ */ t(
|
|
1515
|
-
|
|
1546
|
+
$n,
|
|
1516
1547
|
{
|
|
1517
1548
|
data: c,
|
|
1518
1549
|
onClose: () => {
|
|
1519
|
-
|
|
1550
|
+
f(null);
|
|
1520
1551
|
}
|
|
1521
1552
|
}
|
|
1522
1553
|
),
|
|
1523
1554
|
/* @__PURE__ */ t(
|
|
1524
|
-
|
|
1555
|
+
En,
|
|
1525
1556
|
{
|
|
1526
1557
|
data: v,
|
|
1527
1558
|
onClose: () => {
|
|
@@ -1531,12 +1562,12 @@ const Tt = rt({
|
|
|
1531
1562
|
}
|
|
1532
1563
|
)
|
|
1533
1564
|
] });
|
|
1534
|
-
},
|
|
1565
|
+
}, Hn = lt(
|
|
1535
1566
|
(r, e) => {
|
|
1536
1567
|
const {
|
|
1537
1568
|
list: o,
|
|
1538
|
-
onChange:
|
|
1539
|
-
storageKey:
|
|
1569
|
+
onChange: n,
|
|
1570
|
+
storageKey: a,
|
|
1540
1571
|
enableCaching: s,
|
|
1541
1572
|
theme: i,
|
|
1542
1573
|
noLetters: d,
|
|
@@ -1544,35 +1575,35 @@ const Tt = rt({
|
|
|
1544
1575
|
contextMenuBuilder: x,
|
|
1545
1576
|
itemBuilder: l,
|
|
1546
1577
|
itemIconBuilder: c,
|
|
1547
|
-
pagingDotBuilder:
|
|
1578
|
+
pagingDotBuilder: f,
|
|
1548
1579
|
pagingDotsBuilder: v,
|
|
1549
1580
|
...D
|
|
1550
1581
|
} = r;
|
|
1551
|
-
return /* @__PURE__ */ t(
|
|
1582
|
+
return /* @__PURE__ */ t(Dt, { ...{
|
|
1552
1583
|
list: o,
|
|
1553
|
-
onChange:
|
|
1554
|
-
storageKey:
|
|
1584
|
+
onChange: n,
|
|
1585
|
+
storageKey: a,
|
|
1555
1586
|
enableCaching: s
|
|
1556
|
-
}, children: /* @__PURE__ */ m(
|
|
1587
|
+
}, children: /* @__PURE__ */ m(Mt, { ...{
|
|
1557
1588
|
theme: i,
|
|
1558
1589
|
noLetters: d,
|
|
1559
1590
|
contextMenu: p,
|
|
1560
1591
|
pagingDotsBuilder: v,
|
|
1561
|
-
pagingDotBuilder:
|
|
1592
|
+
pagingDotBuilder: f,
|
|
1562
1593
|
itemBuilder: l,
|
|
1563
1594
|
itemIconBuilder: c,
|
|
1564
1595
|
contextMenuBuilder: x
|
|
1565
1596
|
}, children: [
|
|
1566
1597
|
/* @__PURE__ */ t(() => {
|
|
1567
|
-
const y = pe(),
|
|
1598
|
+
const y = pe(), I = le();
|
|
1568
1599
|
return ae(() => {
|
|
1569
|
-
e && (typeof e == "function" ? e({ state: y, config:
|
|
1570
|
-
}, [y,
|
|
1600
|
+
e && (typeof e == "function" ? e({ state: y, config: I }) : e.current = { state: y, config: I });
|
|
1601
|
+
}, [y, I]), null;
|
|
1571
1602
|
}, {}),
|
|
1572
|
-
/* @__PURE__ */ t(
|
|
1603
|
+
/* @__PURE__ */ t(Pt, { ...D })
|
|
1573
1604
|
] }) });
|
|
1574
1605
|
}
|
|
1575
|
-
),
|
|
1606
|
+
), On = {
|
|
1576
1607
|
frontmatterEditor: {
|
|
1577
1608
|
title: "编辑前置元数据",
|
|
1578
1609
|
key: "键",
|
|
@@ -1689,13 +1720,13 @@ const Tt = rt({
|
|
|
1689
1720
|
image: {
|
|
1690
1721
|
delete: "删除图片"
|
|
1691
1722
|
}
|
|
1692
|
-
},
|
|
1693
|
-
const
|
|
1723
|
+
}, Fn = (r, e, o) => {
|
|
1724
|
+
const a = r.split(".").reduce(
|
|
1694
1725
|
(s, i) => typeof s == "string" ? s : s[i],
|
|
1695
|
-
|
|
1726
|
+
On
|
|
1696
1727
|
);
|
|
1697
|
-
return typeof
|
|
1698
|
-
},
|
|
1728
|
+
return typeof a != "string" ? e : o ? a.replace(/{{(.*?)}}/g, (s, i) => o[i]) : a;
|
|
1729
|
+
}, _n = b`
|
|
1699
1730
|
--accentBase: var(--tomato-1);
|
|
1700
1731
|
--accentBgSubtle: var(--tomato-2);
|
|
1701
1732
|
--accentBg: var(--tomato-3);
|
|
@@ -1749,7 +1780,7 @@ const Tt = rt({
|
|
|
1749
1780
|
rgba(255, 255, 255, 0.05),
|
|
1750
1781
|
rgba(255, 255, 255, 0.05)
|
|
1751
1782
|
);
|
|
1752
|
-
`,
|
|
1783
|
+
`, jn = b`
|
|
1753
1784
|
[class*="_toolbarRoot"] {
|
|
1754
1785
|
flex-wrap: wrap;
|
|
1755
1786
|
transition: all 0.3s;
|
|
@@ -1819,7 +1850,7 @@ const Tt = rt({
|
|
|
1819
1850
|
margin-bottom: 0;
|
|
1820
1851
|
}
|
|
1821
1852
|
}
|
|
1822
|
-
`,
|
|
1853
|
+
`, Bt = k(
|
|
1823
1854
|
"markdown-body",
|
|
1824
1855
|
b`
|
|
1825
1856
|
p {
|
|
@@ -1842,7 +1873,7 @@ const Tt = rt({
|
|
|
1842
1873
|
}
|
|
1843
1874
|
}
|
|
1844
1875
|
`
|
|
1845
|
-
),
|
|
1876
|
+
), zt = b`
|
|
1846
1877
|
.markdown-body {
|
|
1847
1878
|
/* light */
|
|
1848
1879
|
color-scheme: light;
|
|
@@ -1897,7 +1928,7 @@ const Tt = rt({
|
|
|
1897
1928
|
--color-prettylights-syntax-meta-diff-range: #8250df;
|
|
1898
1929
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
|
|
1899
1930
|
}
|
|
1900
|
-
`,
|
|
1931
|
+
`, Et = b`
|
|
1901
1932
|
.markdown-body {
|
|
1902
1933
|
/* dark */
|
|
1903
1934
|
color-scheme: dark;
|
|
@@ -1952,15 +1983,15 @@ const Tt = rt({
|
|
|
1952
1983
|
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
|
|
1953
1984
|
--color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
|
|
1954
1985
|
}
|
|
1955
|
-
`,
|
|
1986
|
+
`, _e = (r) => {
|
|
1956
1987
|
var e, o;
|
|
1957
1988
|
return r === "dark" ? !0 : r === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (o = document.documentElement.getAttribute("style")) != null && o.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1958
|
-
},
|
|
1989
|
+
}, Xn = (r) => {
|
|
1959
1990
|
const {
|
|
1960
1991
|
value: e,
|
|
1961
1992
|
onChange: o,
|
|
1962
|
-
translation:
|
|
1963
|
-
pluginConfig:
|
|
1993
|
+
translation: n,
|
|
1994
|
+
pluginConfig: a,
|
|
1964
1995
|
className: s,
|
|
1965
1996
|
theme: i = "auto",
|
|
1966
1997
|
...d
|
|
@@ -1970,7 +2001,7 @@ const Tt = rt({
|
|
|
1970
2001
|
viewMode: "rich-text"
|
|
1971
2002
|
},
|
|
1972
2003
|
headings: c,
|
|
1973
|
-
link:
|
|
2004
|
+
link: f,
|
|
1974
2005
|
codeBlock: v,
|
|
1975
2006
|
codeMirror: D = {
|
|
1976
2007
|
codeBlockLanguages: {
|
|
@@ -1982,112 +2013,112 @@ const Tt = rt({
|
|
|
1982
2013
|
}
|
|
1983
2014
|
},
|
|
1984
2015
|
directives: h = {
|
|
1985
|
-
directiveDescriptors: [
|
|
2016
|
+
directiveDescriptors: [Lo]
|
|
1986
2017
|
}
|
|
1987
|
-
} =
|
|
2018
|
+
} = a ?? {}, [g, S] = _("");
|
|
1988
2019
|
return ae(() => {
|
|
1989
2020
|
var y;
|
|
1990
|
-
e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e),
|
|
2021
|
+
e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e), S(e));
|
|
1991
2022
|
}, [e, p]), /* @__PURE__ */ t(
|
|
1992
|
-
|
|
2023
|
+
Ao,
|
|
1993
2024
|
{
|
|
1994
2025
|
ref: p,
|
|
1995
2026
|
className: k(
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2027
|
+
jn,
|
|
2028
|
+
_e(i) ? _n : "",
|
|
2029
|
+
_e(i) ? Et : zt,
|
|
1999
2030
|
s
|
|
2000
2031
|
),
|
|
2001
|
-
contentEditableClassName:
|
|
2002
|
-
markdown:
|
|
2032
|
+
contentEditableClassName: Bt,
|
|
2033
|
+
markdown: g,
|
|
2003
2034
|
onChange: (y) => {
|
|
2004
|
-
!e && !o &&
|
|
2035
|
+
!e && !o && S(y), o && o(y);
|
|
2005
2036
|
},
|
|
2006
|
-
translation:
|
|
2037
|
+
translation: n ?? Fn,
|
|
2007
2038
|
plugins: [
|
|
2008
|
-
|
|
2009
|
-
toolbarContents: () => /* @__PURE__ */ m(
|
|
2010
|
-
/* @__PURE__ */ t(Xo, {}),
|
|
2011
|
-
/* @__PURE__ */ t(ce, {}),
|
|
2012
|
-
/* @__PURE__ */ t(Uo, {}),
|
|
2013
|
-
/* @__PURE__ */ t(Go, {}),
|
|
2014
|
-
/* @__PURE__ */ t(ce, {}),
|
|
2015
|
-
/* @__PURE__ */ t(qo, {}),
|
|
2016
|
-
/* @__PURE__ */ t(ce, {}),
|
|
2039
|
+
Do({
|
|
2040
|
+
toolbarContents: () => /* @__PURE__ */ m(qo, { options: ["rich-text", "source"], children: [
|
|
2017
2041
|
/* @__PURE__ */ t(Yo, {}),
|
|
2018
2042
|
/* @__PURE__ */ t(ce, {}),
|
|
2019
2043
|
/* @__PURE__ */ t(Vo, {}),
|
|
2020
2044
|
/* @__PURE__ */ t(Wo, {}),
|
|
2021
2045
|
/* @__PURE__ */ t(ce, {}),
|
|
2022
2046
|
/* @__PURE__ */ t(Ko, {}),
|
|
2047
|
+
/* @__PURE__ */ t(ce, {}),
|
|
2023
2048
|
/* @__PURE__ */ t(Jo, {}),
|
|
2024
2049
|
/* @__PURE__ */ t(ce, {}),
|
|
2025
2050
|
/* @__PURE__ */ t(Zo, {}),
|
|
2051
|
+
/* @__PURE__ */ t(Qo, {}),
|
|
2052
|
+
/* @__PURE__ */ t(ce, {}),
|
|
2053
|
+
/* @__PURE__ */ t(er, {}),
|
|
2054
|
+
/* @__PURE__ */ t(tr, {}),
|
|
2026
2055
|
/* @__PURE__ */ t(ce, {}),
|
|
2027
|
-
/* @__PURE__ */ t(
|
|
2056
|
+
/* @__PURE__ */ t(or, {}),
|
|
2057
|
+
/* @__PURE__ */ t(ce, {}),
|
|
2058
|
+
/* @__PURE__ */ t(rr, {})
|
|
2028
2059
|
] })
|
|
2029
2060
|
}),
|
|
2030
|
-
|
|
2031
|
-
Lo(),
|
|
2032
|
-
Ao(),
|
|
2033
|
-
Do(c),
|
|
2034
|
-
Ro(g),
|
|
2061
|
+
Ro(l),
|
|
2035
2062
|
Po(),
|
|
2036
|
-
Bo(
|
|
2037
|
-
zo(),
|
|
2038
|
-
Eo(),
|
|
2063
|
+
Bo(),
|
|
2064
|
+
zo(c),
|
|
2065
|
+
Eo(f),
|
|
2039
2066
|
$o(),
|
|
2040
|
-
Ho(
|
|
2041
|
-
Oo(
|
|
2067
|
+
Ho(x),
|
|
2068
|
+
Oo(),
|
|
2042
2069
|
Fo(),
|
|
2043
|
-
_o(
|
|
2070
|
+
_o(),
|
|
2071
|
+
jo(v),
|
|
2072
|
+
Xo(D),
|
|
2073
|
+
Uo(),
|
|
2074
|
+
Go(h)
|
|
2044
2075
|
],
|
|
2045
2076
|
...d
|
|
2046
2077
|
}
|
|
2047
2078
|
);
|
|
2048
|
-
},
|
|
2049
|
-
const { children: e = "", className: o, theme:
|
|
2079
|
+
}, $t = (r) => {
|
|
2080
|
+
const { children: e = "", className: o, theme: n = "auto", imageProps: a } = r;
|
|
2050
2081
|
return /* @__PURE__ */ t(
|
|
2051
2082
|
"div",
|
|
2052
2083
|
{
|
|
2053
|
-
className:
|
|
2084
|
+
className: _e(n) ? Et : zt,
|
|
2054
2085
|
children: /* @__PURE__ */ t(
|
|
2055
|
-
|
|
2086
|
+
wt,
|
|
2056
2087
|
{
|
|
2057
|
-
className: k(
|
|
2058
|
-
remarkPlugins: [
|
|
2059
|
-
rehypePlugins: [
|
|
2088
|
+
className: k(Bt, o),
|
|
2089
|
+
remarkPlugins: [nr, ar],
|
|
2090
|
+
rehypePlugins: [sr],
|
|
2060
2091
|
components: {
|
|
2061
2092
|
code(s) {
|
|
2062
2093
|
const { children: i, className: d, node: p, ref: x, ...l } = s, c = /language-(\w+)/.exec(d || "");
|
|
2063
2094
|
return c ? /* @__PURE__ */ t(
|
|
2064
|
-
|
|
2095
|
+
ir,
|
|
2065
2096
|
{
|
|
2066
2097
|
...l,
|
|
2067
2098
|
PreTag: "div",
|
|
2068
2099
|
children: String(i).replace(/\n$/, ""),
|
|
2069
2100
|
language: c[1],
|
|
2070
|
-
style:
|
|
2101
|
+
style: lr
|
|
2071
2102
|
}
|
|
2072
2103
|
) : /* @__PURE__ */ t("code", { ...l, className: d, children: i });
|
|
2073
2104
|
},
|
|
2074
2105
|
img(s) {
|
|
2075
|
-
const { preview: i, ...d } =
|
|
2106
|
+
const { preview: i, ...d } = a ?? {};
|
|
2076
2107
|
return /* @__PURE__ */ t(
|
|
2077
|
-
|
|
2108
|
+
cr,
|
|
2078
2109
|
{
|
|
2079
2110
|
...s,
|
|
2080
2111
|
preview: i instanceof Boolean ? i : {
|
|
2081
2112
|
icons: {
|
|
2082
|
-
rotateLeft: /* @__PURE__ */ t(
|
|
2083
|
-
rotateRight: /* @__PURE__ */ t(
|
|
2084
|
-
zoomIn: /* @__PURE__ */ t(
|
|
2085
|
-
zoomOut: /* @__PURE__ */ t(
|
|
2086
|
-
close: /* @__PURE__ */ t(
|
|
2087
|
-
left: /* @__PURE__ */ t(
|
|
2088
|
-
right: /* @__PURE__ */ t(
|
|
2089
|
-
flipX: /* @__PURE__ */ t(
|
|
2090
|
-
flipY: /* @__PURE__ */ t(
|
|
2113
|
+
rotateLeft: /* @__PURE__ */ t(yo, {}),
|
|
2114
|
+
rotateRight: /* @__PURE__ */ t(xo, {}),
|
|
2115
|
+
zoomIn: /* @__PURE__ */ t(bo, {}),
|
|
2116
|
+
zoomOut: /* @__PURE__ */ t(ho, {}),
|
|
2117
|
+
close: /* @__PURE__ */ t(fo, {}),
|
|
2118
|
+
left: /* @__PURE__ */ t(go, {}),
|
|
2119
|
+
right: /* @__PURE__ */ t(po, {}),
|
|
2120
|
+
flipX: /* @__PURE__ */ t(uo, {}),
|
|
2121
|
+
flipY: /* @__PURE__ */ t(mo, {})
|
|
2091
2122
|
},
|
|
2092
2123
|
zIndex: 9999,
|
|
2093
2124
|
mask: " ",
|
|
@@ -2106,71 +2137,71 @@ const Tt = rt({
|
|
|
2106
2137
|
)
|
|
2107
2138
|
}
|
|
2108
2139
|
);
|
|
2109
|
-
},
|
|
2110
|
-
|
|
2111
|
-
function
|
|
2112
|
-
return
|
|
2140
|
+
}, Ht = Xn;
|
|
2141
|
+
Ht.Preview = $t;
|
|
2142
|
+
function ve(...r) {
|
|
2143
|
+
return mr(dr(r));
|
|
2113
2144
|
}
|
|
2114
|
-
const
|
|
2145
|
+
const Ke = (r) => {
|
|
2115
2146
|
const {
|
|
2116
2147
|
mouseX: e,
|
|
2117
2148
|
title: o,
|
|
2118
|
-
icon:
|
|
2119
|
-
href:
|
|
2149
|
+
icon: n,
|
|
2150
|
+
href: a,
|
|
2120
2151
|
children: s,
|
|
2121
2152
|
as: i = R.div,
|
|
2122
2153
|
componentClassName: d = "rounded-full bg-gray-200 dark:bg-neutral-800",
|
|
2123
2154
|
titleClassName: p = "rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700",
|
|
2124
2155
|
childrenClassName: x,
|
|
2125
2156
|
...l
|
|
2126
|
-
} = r, c = be(null),
|
|
2127
|
-
var
|
|
2128
|
-
const
|
|
2129
|
-
return
|
|
2130
|
-
}), v =
|
|
2131
|
-
|
|
2157
|
+
} = r, c = be(null), f = ye(e, (w) => {
|
|
2158
|
+
var G;
|
|
2159
|
+
const H = ((G = c.current) == null ? void 0 : G.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
2160
|
+
return w - H.x - H.width / 2;
|
|
2161
|
+
}), v = ye(f, [-150, 0, 150], [40, 80, 40]), D = ye(f, [-150, 0, 150], [40, 80, 40]), h = ye(
|
|
2162
|
+
f,
|
|
2132
2163
|
[-150, 0, 150],
|
|
2133
2164
|
[20, 40, 20]
|
|
2134
|
-
),
|
|
2135
|
-
|
|
2165
|
+
), g = ye(
|
|
2166
|
+
f,
|
|
2136
2167
|
[-150, 0, 150],
|
|
2137
2168
|
[20, 40, 20]
|
|
2138
|
-
),
|
|
2169
|
+
), S = Ae(v, {
|
|
2139
2170
|
mass: 0.1,
|
|
2140
2171
|
stiffness: 150,
|
|
2141
2172
|
damping: 12
|
|
2142
|
-
}), y =
|
|
2173
|
+
}), y = Ae(D, {
|
|
2143
2174
|
mass: 0.1,
|
|
2144
2175
|
stiffness: 150,
|
|
2145
2176
|
damping: 12
|
|
2146
|
-
}),
|
|
2177
|
+
}), I = Ae(h, {
|
|
2147
2178
|
mass: 0.1,
|
|
2148
2179
|
stiffness: 150,
|
|
2149
2180
|
damping: 12
|
|
2150
|
-
}), u =
|
|
2181
|
+
}), u = Ae(g, {
|
|
2151
2182
|
mass: 0.1,
|
|
2152
2183
|
stiffness: 150,
|
|
2153
2184
|
damping: 12
|
|
2154
|
-
}), [
|
|
2185
|
+
}), [M, L] = _(!1), N = /* @__PURE__ */ m(
|
|
2155
2186
|
i,
|
|
2156
2187
|
{
|
|
2157
2188
|
ref: c,
|
|
2158
|
-
style: { width:
|
|
2159
|
-
onMouseEnter: () =>
|
|
2160
|
-
onMouseLeave: () =>
|
|
2161
|
-
className:
|
|
2189
|
+
style: { width: S, height: y },
|
|
2190
|
+
onMouseEnter: () => L(!0),
|
|
2191
|
+
onMouseLeave: () => L(!1),
|
|
2192
|
+
className: ve(
|
|
2162
2193
|
"aspect-square flex items-center justify-center relative",
|
|
2163
2194
|
d
|
|
2164
2195
|
),
|
|
2165
2196
|
...l,
|
|
2166
2197
|
children: [
|
|
2167
|
-
o && /* @__PURE__ */ t(
|
|
2198
|
+
o && /* @__PURE__ */ t(Ue, { children: M && /* @__PURE__ */ t(
|
|
2168
2199
|
R.div,
|
|
2169
2200
|
{
|
|
2170
2201
|
initial: { opacity: 0, y: 10, x: "-50%" },
|
|
2171
2202
|
animate: { opacity: 1, y: 0, x: "-50%" },
|
|
2172
2203
|
exit: { opacity: 0, y: 2, x: "-50%" },
|
|
2173
|
-
className:
|
|
2204
|
+
className: ve(
|
|
2174
2205
|
"px-2 py-0.5 whitespace-pre absolute left-1/2 -translate-x-1/2 -top-8 w-fit text-xs",
|
|
2175
2206
|
p
|
|
2176
2207
|
),
|
|
@@ -2180,40 +2211,40 @@ const qe = (r) => {
|
|
|
2180
2211
|
/* @__PURE__ */ t(
|
|
2181
2212
|
R.div,
|
|
2182
2213
|
{
|
|
2183
|
-
style: { width:
|
|
2184
|
-
className:
|
|
2185
|
-
children: s ||
|
|
2214
|
+
style: { width: I, height: u },
|
|
2215
|
+
className: ve("flex items-center justify-center", x),
|
|
2216
|
+
children: s || n
|
|
2186
2217
|
}
|
|
2187
2218
|
)
|
|
2188
2219
|
]
|
|
2189
2220
|
}
|
|
2190
2221
|
);
|
|
2191
|
-
return
|
|
2192
|
-
},
|
|
2222
|
+
return a ? /* @__PURE__ */ t("a", { href: a, children: N }) : N;
|
|
2223
|
+
}, Je = (r) => {
|
|
2193
2224
|
const {
|
|
2194
2225
|
items: e = [],
|
|
2195
2226
|
className: o = "rounded-2xl bg-gray-50 dark:bg-neutral-900",
|
|
2196
|
-
itemBuilder:
|
|
2197
|
-
children:
|
|
2227
|
+
itemBuilder: n,
|
|
2228
|
+
children: a,
|
|
2198
2229
|
mouseX: s,
|
|
2199
2230
|
as: i = R.div
|
|
2200
|
-
} = r, d =
|
|
2231
|
+
} = r, d = ct(1 / 0), p = s ?? d;
|
|
2201
2232
|
return /* @__PURE__ */ t(
|
|
2202
2233
|
i,
|
|
2203
2234
|
{
|
|
2204
2235
|
onMouseMove: (x) => p.set(x.pageX),
|
|
2205
2236
|
onMouseLeave: () => p.set(1 / 0),
|
|
2206
|
-
className:
|
|
2237
|
+
className: ve(
|
|
2207
2238
|
"mx-auto hidden md:flex h-16 gap-4 items-end px-4 pb-3",
|
|
2208
2239
|
o
|
|
2209
2240
|
),
|
|
2210
|
-
children:
|
|
2211
|
-
(x) =>
|
|
2241
|
+
children: a || e.map(
|
|
2242
|
+
(x) => n ? n(x, p) : /* @__PURE__ */ t(Ke, { mouseX: p, ...x }, x.title)
|
|
2212
2243
|
)
|
|
2213
2244
|
}
|
|
2214
2245
|
);
|
|
2215
|
-
},
|
|
2216
|
-
const { title: e, icon: o, href:
|
|
2246
|
+
}, ze = (r) => {
|
|
2247
|
+
const { title: e, icon: o, href: n, index: a, totalItems: s, children: i, ...d } = r;
|
|
2217
2248
|
return /* @__PURE__ */ t(
|
|
2218
2249
|
R.div,
|
|
2219
2250
|
{
|
|
@@ -2226,15 +2257,15 @@ const qe = (r) => {
|
|
|
2226
2257
|
opacity: 0,
|
|
2227
2258
|
y: 10,
|
|
2228
2259
|
transition: {
|
|
2229
|
-
delay:
|
|
2260
|
+
delay: a * 0.05
|
|
2230
2261
|
}
|
|
2231
2262
|
},
|
|
2232
|
-
transition: { delay: (s - 1 -
|
|
2263
|
+
transition: { delay: (s - 1 - a) * 0.05 },
|
|
2233
2264
|
...d,
|
|
2234
2265
|
children: i || /* @__PURE__ */ t(
|
|
2235
2266
|
"a",
|
|
2236
2267
|
{
|
|
2237
|
-
href:
|
|
2268
|
+
href: n,
|
|
2238
2269
|
className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",
|
|
2239
2270
|
children: /* @__PURE__ */ t("div", { className: "h-4 w-4", children: o })
|
|
2240
2271
|
}
|
|
@@ -2242,30 +2273,30 @@ const qe = (r) => {
|
|
|
2242
2273
|
},
|
|
2243
2274
|
e
|
|
2244
2275
|
);
|
|
2245
|
-
},
|
|
2276
|
+
}, Ze = (r) => {
|
|
2246
2277
|
const {
|
|
2247
2278
|
items: e = [],
|
|
2248
2279
|
className: o,
|
|
2249
|
-
collapseIcon:
|
|
2250
|
-
autoHidden:
|
|
2280
|
+
collapseIcon: n,
|
|
2281
|
+
autoHidden: a = !1,
|
|
2251
2282
|
itemBuilder: s,
|
|
2252
2283
|
children: i
|
|
2253
|
-
} = r, [d, p] =
|
|
2284
|
+
} = r, [d, p] = _(!1), x = () => {
|
|
2254
2285
|
p(!d);
|
|
2255
2286
|
};
|
|
2256
2287
|
return /* @__PURE__ */ m(
|
|
2257
2288
|
"div",
|
|
2258
2289
|
{
|
|
2259
|
-
className:
|
|
2290
|
+
className: ve("relative block", a ? "md:hidden" : "", o),
|
|
2260
2291
|
children: [
|
|
2261
|
-
/* @__PURE__ */ t(
|
|
2292
|
+
/* @__PURE__ */ t(Ue, { children: d && /* @__PURE__ */ t(
|
|
2262
2293
|
R.div,
|
|
2263
2294
|
{
|
|
2264
2295
|
layoutId: "nav",
|
|
2265
2296
|
className: "absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",
|
|
2266
2297
|
children: i || e.map(
|
|
2267
2298
|
(l, c) => s ? /* @__PURE__ */ t(
|
|
2268
|
-
|
|
2299
|
+
ze,
|
|
2269
2300
|
{
|
|
2270
2301
|
...l,
|
|
2271
2302
|
index: c,
|
|
@@ -2274,7 +2305,7 @@ const qe = (r) => {
|
|
|
2274
2305
|
},
|
|
2275
2306
|
l.title
|
|
2276
2307
|
) : /* @__PURE__ */ t(
|
|
2277
|
-
|
|
2308
|
+
ze,
|
|
2278
2309
|
{
|
|
2279
2310
|
...l,
|
|
2280
2311
|
index: c,
|
|
@@ -2290,18 +2321,18 @@ const qe = (r) => {
|
|
|
2290
2321
|
{
|
|
2291
2322
|
onClick: x,
|
|
2292
2323
|
className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
|
|
2293
|
-
children:
|
|
2324
|
+
children: n || /* @__PURE__ */ t(vo, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
|
|
2294
2325
|
}
|
|
2295
2326
|
)
|
|
2296
2327
|
]
|
|
2297
2328
|
}
|
|
2298
2329
|
);
|
|
2299
|
-
},
|
|
2330
|
+
}, Un = (r) => {
|
|
2300
2331
|
const {
|
|
2301
2332
|
items: e,
|
|
2302
2333
|
desktopClassName: o,
|
|
2303
|
-
mobileClassName:
|
|
2304
|
-
desktopItemBuilder:
|
|
2334
|
+
mobileClassName: n,
|
|
2335
|
+
desktopItemBuilder: a,
|
|
2305
2336
|
mobileItemBuilder: s,
|
|
2306
2337
|
desktopChildren: i,
|
|
2307
2338
|
mobileChildren: d,
|
|
@@ -2310,21 +2341,21 @@ const qe = (r) => {
|
|
|
2310
2341
|
} = r;
|
|
2311
2342
|
return /* @__PURE__ */ m(ue, { children: [
|
|
2312
2343
|
/* @__PURE__ */ t(
|
|
2313
|
-
|
|
2344
|
+
Je,
|
|
2314
2345
|
{
|
|
2315
2346
|
items: e,
|
|
2316
2347
|
className: o,
|
|
2317
|
-
itemBuilder:
|
|
2348
|
+
itemBuilder: a,
|
|
2318
2349
|
children: i,
|
|
2319
2350
|
mouseX: p,
|
|
2320
2351
|
...x
|
|
2321
2352
|
}
|
|
2322
2353
|
),
|
|
2323
2354
|
/* @__PURE__ */ t(
|
|
2324
|
-
|
|
2355
|
+
Ze,
|
|
2325
2356
|
{
|
|
2326
2357
|
items: e,
|
|
2327
|
-
className:
|
|
2358
|
+
className: n,
|
|
2328
2359
|
itemBuilder: s,
|
|
2329
2360
|
children: d,
|
|
2330
2361
|
autoHidden: !0,
|
|
@@ -2332,31 +2363,31 @@ const qe = (r) => {
|
|
|
2332
2363
|
}
|
|
2333
2364
|
)
|
|
2334
2365
|
] });
|
|
2335
|
-
},
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
const
|
|
2366
|
+
}, Ie = Un;
|
|
2367
|
+
Ie.Desktop = Je;
|
|
2368
|
+
Ie.DesktopItem = Ke;
|
|
2369
|
+
Ie.Mobile = Ze;
|
|
2370
|
+
Ie.MobileItem = ze;
|
|
2371
|
+
const Gn = /* @__PURE__ */ Mn({
|
|
2341
2372
|
__proto__: null
|
|
2342
|
-
}, [
|
|
2343
|
-
function
|
|
2373
|
+
}, [nn]);
|
|
2374
|
+
function qn() {
|
|
2344
2375
|
try {
|
|
2345
|
-
return
|
|
2376
|
+
return Gn;
|
|
2346
2377
|
} catch {
|
|
2347
2378
|
return null;
|
|
2348
2379
|
}
|
|
2349
2380
|
}
|
|
2350
|
-
function
|
|
2381
|
+
function Yn(r, e) {
|
|
2351
2382
|
if (r && typeof r.serializeForClipboard == "function")
|
|
2352
2383
|
return r.serializeForClipboard(e);
|
|
2353
|
-
const o =
|
|
2384
|
+
const o = qn();
|
|
2354
2385
|
if (o && typeof (o == null ? void 0 : o.__serializeForClipboard) == "function")
|
|
2355
2386
|
return o.__serializeForClipboard(r, e);
|
|
2356
2387
|
throw new Error("No supported clipboard serialization method found.");
|
|
2357
2388
|
}
|
|
2358
|
-
function
|
|
2359
|
-
const e = r.getBoundingClientRect(), o = r.closest('[role="dialog"]'),
|
|
2389
|
+
function Vn(r) {
|
|
2390
|
+
const e = r.getBoundingClientRect(), o = r.closest('[role="dialog"]'), n = r.closest(".ProseMirror"), a = n == null ? void 0 : n.getBoundingClientRect(), s = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop;
|
|
2360
2391
|
if (o && window.getComputedStyle(o).transform !== "none") {
|
|
2361
2392
|
const d = o.getBoundingClientRect();
|
|
2362
2393
|
return {
|
|
@@ -2366,12 +2397,12 @@ function Un(r) {
|
|
|
2366
2397
|
};
|
|
2367
2398
|
}
|
|
2368
2399
|
return {
|
|
2369
|
-
top:
|
|
2370
|
-
left:
|
|
2400
|
+
top: a ? e.top - a.top : e.top + i,
|
|
2401
|
+
left: a ? e.left - a.left : e.left + s,
|
|
2371
2402
|
width: e.width
|
|
2372
2403
|
};
|
|
2373
2404
|
}
|
|
2374
|
-
function
|
|
2405
|
+
function ot(r, e) {
|
|
2375
2406
|
const o = [
|
|
2376
2407
|
"li",
|
|
2377
2408
|
"p:not(:first-child)",
|
|
@@ -2383,91 +2414,91 @@ function Qe(r, e) {
|
|
|
2383
2414
|
"h4",
|
|
2384
2415
|
"h5",
|
|
2385
2416
|
"h6",
|
|
2386
|
-
...e.customNodes.map((
|
|
2417
|
+
...e.customNodes.map((n) => `[data-type=${n}]`)
|
|
2387
2418
|
].join(", ");
|
|
2388
2419
|
return document.elementsFromPoint(r.x, r.y).find(
|
|
2389
|
-
(
|
|
2390
|
-
var
|
|
2391
|
-
return ((s = (
|
|
2420
|
+
(n) => {
|
|
2421
|
+
var a, s;
|
|
2422
|
+
return ((s = (a = n.parentElement) == null ? void 0 : a.matches) == null ? void 0 : s.call(a, ".ProseMirror")) || n.matches(o);
|
|
2392
2423
|
}
|
|
2393
2424
|
);
|
|
2394
2425
|
}
|
|
2395
|
-
function
|
|
2396
|
-
var
|
|
2397
|
-
const
|
|
2398
|
-
return (
|
|
2399
|
-
left:
|
|
2400
|
-
top:
|
|
2401
|
-
})) == null ? void 0 :
|
|
2426
|
+
function rt(r, e, o) {
|
|
2427
|
+
var a;
|
|
2428
|
+
const n = r.getBoundingClientRect();
|
|
2429
|
+
return (a = e.posAtCoords({
|
|
2430
|
+
left: n.left + 50 + o.dragHandleWidth,
|
|
2431
|
+
top: n.top + 1
|
|
2432
|
+
})) == null ? void 0 : a.inside;
|
|
2402
2433
|
}
|
|
2403
|
-
function
|
|
2434
|
+
function Re(r, e) {
|
|
2404
2435
|
const o = e.state.doc.resolve(r);
|
|
2405
2436
|
return o.depth > 1 ? o.before(o.depth) : r;
|
|
2406
2437
|
}
|
|
2407
|
-
function
|
|
2438
|
+
function Wn(r) {
|
|
2408
2439
|
let e = "", o = !1;
|
|
2409
|
-
function
|
|
2440
|
+
function n(l, c) {
|
|
2410
2441
|
if (c.focus(), !l.dataTransfer) return;
|
|
2411
|
-
const
|
|
2442
|
+
const f = ot(
|
|
2412
2443
|
{
|
|
2413
2444
|
x: l.clientX + 50 + r.dragHandleWidth,
|
|
2414
2445
|
y: l.clientY
|
|
2415
2446
|
},
|
|
2416
2447
|
r
|
|
2417
2448
|
);
|
|
2418
|
-
if (!(
|
|
2419
|
-
let v =
|
|
2449
|
+
if (!(f instanceof Element)) return;
|
|
2450
|
+
let v = rt(f, c, r);
|
|
2420
2451
|
if (v == null || v < 0) return;
|
|
2421
|
-
v =
|
|
2422
|
-
const { from: D, to: h } = c.state.selection,
|
|
2452
|
+
v = Re(v, c);
|
|
2453
|
+
const { from: D, to: h } = c.state.selection, g = D - h, S = Re(D, c);
|
|
2423
2454
|
let y = !1;
|
|
2424
|
-
const
|
|
2425
|
-
if (
|
|
2455
|
+
const I = c.state.doc.resolve(S);
|
|
2456
|
+
if (I.node().type.name === "doc") y = !0;
|
|
2426
2457
|
else {
|
|
2427
|
-
const
|
|
2458
|
+
const w = J.create(
|
|
2428
2459
|
c.state.doc,
|
|
2429
|
-
|
|
2460
|
+
I.before()
|
|
2430
2461
|
);
|
|
2431
|
-
y = !(v + 1 >=
|
|
2462
|
+
y = !(v + 1 >= w.$from.pos && v <= w.$to.pos);
|
|
2432
2463
|
}
|
|
2433
2464
|
let u = c.state.selection;
|
|
2434
|
-
if (!y &&
|
|
2435
|
-
const
|
|
2436
|
-
u =
|
|
2465
|
+
if (!y && g !== 0 && !(c.state.selection instanceof J)) {
|
|
2466
|
+
const w = J.create(c.state.doc, h - 1);
|
|
2467
|
+
u = tn.create(
|
|
2437
2468
|
c.state.doc,
|
|
2438
2469
|
v,
|
|
2439
|
-
|
|
2470
|
+
w.$to.pos
|
|
2440
2471
|
);
|
|
2441
2472
|
} else if (u = J.create(c.state.doc, v), u.node.type.isInline || u.node.type.name === "tableRow") {
|
|
2442
|
-
const
|
|
2443
|
-
u = J.create(c.state.doc,
|
|
2473
|
+
const w = c.state.doc.resolve(u.from);
|
|
2474
|
+
u = J.create(c.state.doc, w.before());
|
|
2444
2475
|
}
|
|
2445
|
-
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof J && c.state.selection.node.type.name === "listItem" && (e =
|
|
2446
|
-
const
|
|
2447
|
-
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html",
|
|
2476
|
+
c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof J && c.state.selection.node.type.name === "listItem" && (e = f.parentElement.tagName);
|
|
2477
|
+
const M = c.state.selection.content(), { dom: L, text: N } = Yn(c, M);
|
|
2478
|
+
l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", L.innerHTML), l.dataTransfer.setData("text/plain", N), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(f, 0, 0), c.dragging = { slice: M, move: l.ctrlKey };
|
|
2448
2479
|
}
|
|
2449
|
-
let
|
|
2480
|
+
let a = null;
|
|
2450
2481
|
function s() {
|
|
2451
|
-
|
|
2482
|
+
a && a.classList.add("hide");
|
|
2452
2483
|
}
|
|
2453
2484
|
function i() {
|
|
2454
|
-
|
|
2485
|
+
a && a.classList.remove("hide");
|
|
2455
2486
|
}
|
|
2456
2487
|
function d(l, c) {
|
|
2457
|
-
const
|
|
2488
|
+
const f = Re(c, l), v = J.create(l.state.doc, f);
|
|
2458
2489
|
l.dispatch(l.state.tr.setSelection(v)), l.focus(), o = !0;
|
|
2459
2490
|
}
|
|
2460
2491
|
function p(l) {
|
|
2461
|
-
if (o = l.state.selection instanceof J, o && (
|
|
2462
|
-
const
|
|
2492
|
+
if (o = l.state.selection instanceof J, o && (a != null && a.dataset.nodePos)) {
|
|
2493
|
+
const f = parseInt(a.dataset.nodePos, 10);
|
|
2463
2494
|
try {
|
|
2464
|
-
const v = l.state.doc.resolve(
|
|
2495
|
+
const v = l.state.doc.resolve(f);
|
|
2465
2496
|
v && v.parent && v.parent.type.name !== "doc" || (o = !1, s());
|
|
2466
2497
|
} catch {
|
|
2467
2498
|
o = !1, s();
|
|
2468
2499
|
}
|
|
2469
2500
|
}
|
|
2470
|
-
o &&
|
|
2501
|
+
o && a && !a.classList.contains("hide") ? i() : o || s();
|
|
2471
2502
|
}
|
|
2472
2503
|
function x(l) {
|
|
2473
2504
|
if (!(l.target instanceof Element)) return;
|
|
@@ -2476,40 +2507,40 @@ function Gn(r) {
|
|
|
2476
2507
|
o || s();
|
|
2477
2508
|
return;
|
|
2478
2509
|
}
|
|
2479
|
-
const
|
|
2480
|
-
!
|
|
2510
|
+
const f = c.closest(".drag-handle") || c.classList.contains("drag-handle"), v = c.closest(".tiptap") || c.classList.contains("tiptap");
|
|
2511
|
+
!f && !v && !o && s();
|
|
2481
2512
|
}
|
|
2482
|
-
return new
|
|
2483
|
-
key: new
|
|
2513
|
+
return new Qr({
|
|
2514
|
+
key: new en(r.pluginKey),
|
|
2484
2515
|
view: (l) => {
|
|
2485
|
-
var h,
|
|
2516
|
+
var h, g, S, y;
|
|
2486
2517
|
const c = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
|
|
2487
|
-
|
|
2488
|
-
function
|
|
2489
|
-
|
|
2518
|
+
a = c ?? document.createElement("div"), a.draggable = !0, a.dataset.dragHandle = "", a.classList.add("drag-handle");
|
|
2519
|
+
function f(I) {
|
|
2520
|
+
n(I, l);
|
|
2490
2521
|
}
|
|
2491
|
-
|
|
2492
|
-
function v(
|
|
2493
|
-
c || (
|
|
2494
|
-
const u =
|
|
2522
|
+
a.addEventListener("dragstart", f);
|
|
2523
|
+
function v(I) {
|
|
2524
|
+
c || (I.preventDefault(), I.stopPropagation());
|
|
2525
|
+
const u = a == null ? void 0 : a.dataset.nodePos;
|
|
2495
2526
|
u && d(l, parseInt(u, 10));
|
|
2496
2527
|
}
|
|
2497
|
-
|
|
2498
|
-
function D(
|
|
2528
|
+
a.addEventListener("click", v);
|
|
2529
|
+
function D(I) {
|
|
2499
2530
|
s();
|
|
2500
2531
|
const u = window.scrollY;
|
|
2501
|
-
|
|
2532
|
+
I.clientY < r.scrollTreshold ? window.scrollTo({ top: u - 30, behavior: "smooth" }) : window.innerHeight - I.clientY < r.scrollTreshold && window.scrollTo({ top: u + 30, behavior: "smooth" });
|
|
2502
2533
|
}
|
|
2503
|
-
return
|
|
2534
|
+
return a.addEventListener("drag", D), s(), c || (g = (h = l == null ? void 0 : l.dom) == null ? void 0 : h.parentElement) == null || g.appendChild(a), (y = (S = l == null ? void 0 : l.dom) == null ? void 0 : S.parentElement) == null || y.addEventListener(
|
|
2504
2535
|
"mouseout",
|
|
2505
2536
|
x
|
|
2506
2537
|
), {
|
|
2507
2538
|
destroy: () => {
|
|
2508
|
-
var
|
|
2509
|
-
c || (
|
|
2539
|
+
var I, u, M;
|
|
2540
|
+
c || (I = a == null ? void 0 : a.remove) == null || I.call(a), a == null || a.removeEventListener("drag", D), a == null || a.removeEventListener(
|
|
2510
2541
|
"dragstart",
|
|
2511
|
-
|
|
2512
|
-
),
|
|
2542
|
+
f
|
|
2543
|
+
), a == null || a.removeEventListener("click", v), a = null, (M = (u = l == null ? void 0 : l.dom) == null ? void 0 : u.parentElement) == null || M.removeEventListener(
|
|
2513
2544
|
"mouseout",
|
|
2514
2545
|
x
|
|
2515
2546
|
);
|
|
@@ -2521,23 +2552,23 @@ function Gn(r) {
|
|
|
2521
2552
|
mousemove: (l, c) => {
|
|
2522
2553
|
if (!l.editable)
|
|
2523
2554
|
return;
|
|
2524
|
-
const
|
|
2555
|
+
const f = ot(
|
|
2525
2556
|
{
|
|
2526
2557
|
x: c.clientX + 50 + r.dragHandleWidth,
|
|
2527
2558
|
y: c.clientY
|
|
2528
2559
|
},
|
|
2529
2560
|
r
|
|
2530
|
-
), v =
|
|
2531
|
-
if (!(
|
|
2561
|
+
), v = f == null ? void 0 : f.closest(".not-draggable"), D = r.excludedTags.concat(["ol", "ul"]).join(", ");
|
|
2562
|
+
if (!(f instanceof Element) || f.matches(D) || v) {
|
|
2532
2563
|
o || s();
|
|
2533
2564
|
return;
|
|
2534
2565
|
}
|
|
2535
|
-
const h =
|
|
2536
|
-
h != null && h >= 0 && (
|
|
2537
|
-
|
|
2566
|
+
const h = rt(f, l, r);
|
|
2567
|
+
h != null && h >= 0 && (a.dataset.nodePos = String(
|
|
2568
|
+
Re(h, l)
|
|
2538
2569
|
));
|
|
2539
|
-
const
|
|
2540
|
-
u.top += (y - 24) / 2, u.top +=
|
|
2570
|
+
const g = window.getComputedStyle(f), S = parseInt(g.lineHeight, 10), y = isNaN(S) ? parseInt(g.fontSize) * 1.2 : S, I = parseInt(g.paddingTop, 10), u = Vn(f);
|
|
2571
|
+
u.top += (y - 24) / 2, u.top += I, f.matches("ul:not([data-type=taskList]) li, ol li") && (u.left -= r.dragHandleWidth - 28), u.width = r.dragHandleWidth, a && (a.style.position = "absolute", a.style.left = `${u.left - u.width}px`, a.style.top = `${u.top}px`, i());
|
|
2541
2572
|
},
|
|
2542
2573
|
keydown: () => {
|
|
2543
2574
|
o || s();
|
|
@@ -2554,20 +2585,20 @@ function Gn(r) {
|
|
|
2554
2585
|
l.dom.classList.add("dragging");
|
|
2555
2586
|
},
|
|
2556
2587
|
drop: (l, c) => {
|
|
2557
|
-
var
|
|
2588
|
+
var g;
|
|
2558
2589
|
l.dom.classList.remove("dragging"), s();
|
|
2559
|
-
let
|
|
2590
|
+
let f = null;
|
|
2560
2591
|
const v = l.posAtCoords({
|
|
2561
2592
|
left: c.clientX,
|
|
2562
2593
|
top: c.clientY
|
|
2563
2594
|
});
|
|
2564
|
-
if (!v || (l.state.selection instanceof J && (
|
|
2595
|
+
if (!v || (l.state.selection instanceof J && (f = l.state.selection.node), !f)) return;
|
|
2565
2596
|
const h = l.state.doc.resolve(v.pos).parent.type.name === "listItem";
|
|
2566
2597
|
if (l.state.selection instanceof J && l.state.selection.node.type.name === "listItem" && !h && e == "OL") {
|
|
2567
|
-
const
|
|
2598
|
+
const S = (g = l.state.schema.nodes.orderedList) == null ? void 0 : g.createAndFill(
|
|
2568
2599
|
null,
|
|
2569
|
-
|
|
2570
|
-
), y = new
|
|
2600
|
+
f
|
|
2601
|
+
), y = new on(rn.from(S), 0, 0);
|
|
2571
2602
|
l.dragging = { slice: y, move: c.ctrlKey };
|
|
2572
2603
|
}
|
|
2573
2604
|
},
|
|
@@ -2581,9 +2612,9 @@ function Gn(r) {
|
|
|
2581
2612
|
init() {
|
|
2582
2613
|
return {};
|
|
2583
2614
|
},
|
|
2584
|
-
apply(l, c,
|
|
2585
|
-
if (l.docChanged &&
|
|
2586
|
-
const D = parseInt(
|
|
2615
|
+
apply(l, c, f, v) {
|
|
2616
|
+
if (l.docChanged && a && a.dataset.nodePos) {
|
|
2617
|
+
const D = parseInt(a.dataset.nodePos, 10);
|
|
2587
2618
|
try {
|
|
2588
2619
|
const h = v.doc.resolve(D);
|
|
2589
2620
|
(!h || h.parent.type.name === "doc") && (o = !1, s());
|
|
@@ -2596,7 +2627,7 @@ function Gn(r) {
|
|
|
2596
2627
|
}
|
|
2597
2628
|
});
|
|
2598
2629
|
}
|
|
2599
|
-
const
|
|
2630
|
+
const Kn = Zr.create({
|
|
2600
2631
|
name: "globalDragHandle",
|
|
2601
2632
|
addOptions() {
|
|
2602
2633
|
return {
|
|
@@ -2608,7 +2639,7 @@ const qn = Vr.create({
|
|
|
2608
2639
|
},
|
|
2609
2640
|
addProseMirrorPlugins() {
|
|
2610
2641
|
return [
|
|
2611
|
-
|
|
2642
|
+
Wn({
|
|
2612
2643
|
pluginKey: "globalDragHandle",
|
|
2613
2644
|
dragHandleWidth: this.options.dragHandleWidth,
|
|
2614
2645
|
scrollTreshold: this.options.scrollTreshold,
|
|
@@ -2618,18 +2649,18 @@ const qn = Vr.create({
|
|
|
2618
2649
|
})
|
|
2619
2650
|
];
|
|
2620
2651
|
}
|
|
2621
|
-
}),
|
|
2652
|
+
}), Jn = Nr, Zn = ur.configure({
|
|
2622
2653
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
2623
|
-
}),
|
|
2654
|
+
}), Qn = pr.configure({
|
|
2624
2655
|
HTMLAttributes: {
|
|
2625
2656
|
class: Y(
|
|
2626
2657
|
"text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
|
|
2627
2658
|
)
|
|
2628
2659
|
}
|
|
2629
|
-
}),
|
|
2660
|
+
}), ea = gr.extend({
|
|
2630
2661
|
addProseMirrorPlugins() {
|
|
2631
2662
|
return [
|
|
2632
|
-
|
|
2663
|
+
fr({
|
|
2633
2664
|
imageClass: Y("opacity-40 rounded-lg border border-stone-200")
|
|
2634
2665
|
})
|
|
2635
2666
|
];
|
|
@@ -2639,24 +2670,24 @@ const qn = Vr.create({
|
|
|
2639
2670
|
HTMLAttributes: {
|
|
2640
2671
|
class: Y("rounded-lg border border-muted")
|
|
2641
2672
|
}
|
|
2642
|
-
}),
|
|
2673
|
+
}), ta = hr.configure({
|
|
2643
2674
|
HTMLAttributes: {
|
|
2644
2675
|
class: Y("rounded-lg border border-muted")
|
|
2645
2676
|
}
|
|
2646
|
-
}),
|
|
2677
|
+
}), oa = br.configure({
|
|
2647
2678
|
HTMLAttributes: {
|
|
2648
2679
|
class: Y("not-prose pl-2 ")
|
|
2649
2680
|
}
|
|
2650
|
-
}),
|
|
2681
|
+
}), ra = xr.configure({
|
|
2651
2682
|
HTMLAttributes: {
|
|
2652
2683
|
class: Y("flex gap-2 items-start my-4")
|
|
2653
2684
|
},
|
|
2654
2685
|
nested: !0
|
|
2655
|
-
}),
|
|
2686
|
+
}), na = yr.configure({
|
|
2656
2687
|
HTMLAttributes: {
|
|
2657
2688
|
class: Y("mt-4 mb-6 border-t border-muted-foreground")
|
|
2658
2689
|
}
|
|
2659
|
-
}),
|
|
2690
|
+
}), aa = vr.configure({
|
|
2660
2691
|
bulletList: {
|
|
2661
2692
|
HTMLAttributes: {
|
|
2662
2693
|
class: Y("list-disc list-outside leading-3 -mt-2")
|
|
@@ -2696,18 +2727,18 @@ const qn = Vr.create({
|
|
|
2696
2727
|
width: 4
|
|
2697
2728
|
},
|
|
2698
2729
|
gapcursor: !1
|
|
2699
|
-
}),
|
|
2730
|
+
}), sa = kr.configure({
|
|
2700
2731
|
// configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
|
|
2701
2732
|
// common: covers 37 language grammars which should be good enough in most cases
|
|
2702
|
-
lowlight:
|
|
2703
|
-
}),
|
|
2733
|
+
lowlight: Kr(Jr)
|
|
2734
|
+
}), ia = Cr.configure({
|
|
2704
2735
|
HTMLAttributes: {
|
|
2705
2736
|
class: Y("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
|
|
2706
2737
|
},
|
|
2707
2738
|
katexOptions: {
|
|
2708
2739
|
throwOnError: !1
|
|
2709
2740
|
}
|
|
2710
|
-
}),
|
|
2741
|
+
}), la = wr.configure(), ca = Vr.configure({
|
|
2711
2742
|
html: !0,
|
|
2712
2743
|
tightLists: !0,
|
|
2713
2744
|
tightListClass: "tight",
|
|
@@ -2716,44 +2747,44 @@ const qn = Vr.create({
|
|
|
2716
2747
|
breaks: !1,
|
|
2717
2748
|
transformPastedText: !1,
|
|
2718
2749
|
transformCopiedText: !1
|
|
2719
|
-
}),
|
|
2750
|
+
}), da = Kn.configure({
|
|
2720
2751
|
dragHandleWidth: 56,
|
|
2721
2752
|
dragHandleSelector: ".custom-drag-handle"
|
|
2722
|
-
}),
|
|
2723
|
-
|
|
2724
|
-
Vn,
|
|
2725
|
-
Wn,
|
|
2726
|
-
Kn,
|
|
2727
|
-
Jn,
|
|
2753
|
+
}), Ot = [
|
|
2754
|
+
aa,
|
|
2728
2755
|
Zn,
|
|
2729
2756
|
Qn,
|
|
2730
2757
|
ea,
|
|
2731
|
-
|
|
2758
|
+
ta,
|
|
2732
2759
|
oa,
|
|
2733
2760
|
ra,
|
|
2734
2761
|
na,
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
Nr,
|
|
2762
|
+
Jn,
|
|
2763
|
+
sa,
|
|
2764
|
+
ia,
|
|
2765
|
+
la,
|
|
2740
2766
|
Ir,
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2767
|
+
ca,
|
|
2768
|
+
Sr,
|
|
2769
|
+
Tr,
|
|
2770
|
+
Mr,
|
|
2771
|
+
Lr,
|
|
2772
|
+
da
|
|
2773
|
+
], ma = Ce.Root, Ft = Ce.Trigger, Ee = q.forwardRef(({ className: r, align: e = "center", sideOffset: o = 4, ...n }, a) => /* @__PURE__ */ t(Ce.Portal, { children: /* @__PURE__ */ t(
|
|
2774
|
+
Ce.Content,
|
|
2744
2775
|
{
|
|
2745
|
-
ref:
|
|
2776
|
+
ref: a,
|
|
2746
2777
|
align: e,
|
|
2747
2778
|
sideOffset: o,
|
|
2748
2779
|
className: k(
|
|
2749
2780
|
"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",
|
|
2750
2781
|
r
|
|
2751
2782
|
),
|
|
2752
|
-
...
|
|
2783
|
+
...n
|
|
2753
2784
|
}
|
|
2754
2785
|
) }));
|
|
2755
|
-
|
|
2756
|
-
const
|
|
2786
|
+
Ee.displayName = Ce.Content.displayName;
|
|
2787
|
+
const ua = Wr(
|
|
2757
2788
|
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
2758
2789
|
{
|
|
2759
2790
|
variants: {
|
|
@@ -2778,17 +2809,17 @@ const la = Gr(
|
|
|
2778
2809
|
}
|
|
2779
2810
|
}
|
|
2780
2811
|
), Z = q.forwardRef(
|
|
2781
|
-
({ className: r, variant: e, size: o, asChild:
|
|
2782
|
-
|
|
2812
|
+
({ className: r, variant: e, size: o, asChild: n = !1, ...a }, s) => /* @__PURE__ */ t(
|
|
2813
|
+
n ? sn : "button",
|
|
2783
2814
|
{
|
|
2784
|
-
className: k(
|
|
2815
|
+
className: k(ua({ variant: e, size: o, className: r })),
|
|
2785
2816
|
ref: s,
|
|
2786
|
-
...
|
|
2817
|
+
...a
|
|
2787
2818
|
}
|
|
2788
2819
|
)
|
|
2789
2820
|
);
|
|
2790
2821
|
Z.displayName = "Button";
|
|
2791
|
-
const
|
|
2822
|
+
const nt = [
|
|
2792
2823
|
{
|
|
2793
2824
|
name: "默认",
|
|
2794
2825
|
// Default
|
|
@@ -2834,7 +2865,7 @@ const tt = [
|
|
|
2834
2865
|
// Gray
|
|
2835
2866
|
color: "#A8A29E"
|
|
2836
2867
|
}
|
|
2837
|
-
],
|
|
2868
|
+
], at = [
|
|
2838
2869
|
{
|
|
2839
2870
|
name: "默认背景",
|
|
2840
2871
|
// Default
|
|
@@ -2881,7 +2912,7 @@ const tt = [
|
|
|
2881
2912
|
color: "var(--novel-highlight-gray)"
|
|
2882
2913
|
}
|
|
2883
2914
|
], me = (r) => /* @__PURE__ */ t(
|
|
2884
|
-
|
|
2915
|
+
dt,
|
|
2885
2916
|
{
|
|
2886
2917
|
classNames: {
|
|
2887
2918
|
root: b`
|
|
@@ -2896,31 +2927,31 @@ const tt = [
|
|
|
2896
2927
|
showArrow: !1,
|
|
2897
2928
|
...r
|
|
2898
2929
|
}
|
|
2899
|
-
),
|
|
2930
|
+
), pa = ({ open: r, onOpenChange: e }) => {
|
|
2900
2931
|
const { editor: o } = Q();
|
|
2901
2932
|
if (!o) return null;
|
|
2902
|
-
const
|
|
2933
|
+
const n = nt.find(
|
|
2903
2934
|
({ color: s }) => o.isActive("textStyle", { color: s })
|
|
2904
|
-
),
|
|
2935
|
+
), a = at.find(
|
|
2905
2936
|
({ color: s }) => o.isActive("highlight", { color: s })
|
|
2906
2937
|
);
|
|
2907
|
-
return /* @__PURE__ */ m(
|
|
2908
|
-
/* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(
|
|
2938
|
+
return /* @__PURE__ */ m(ma, { modal: !0, open: r, onOpenChange: e, children: [
|
|
2939
|
+
/* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Ft, { asChild: !0, children: /* @__PURE__ */ m(Z, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
|
|
2909
2940
|
/* @__PURE__ */ t(
|
|
2910
2941
|
"span",
|
|
2911
2942
|
{
|
|
2912
2943
|
className: "rounded-sm px-1",
|
|
2913
2944
|
style: {
|
|
2914
|
-
color:
|
|
2915
|
-
backgroundColor:
|
|
2945
|
+
color: n == null ? void 0 : n.color,
|
|
2946
|
+
backgroundColor: a == null ? void 0 : a.color
|
|
2916
2947
|
},
|
|
2917
2948
|
children: "A"
|
|
2918
2949
|
}
|
|
2919
2950
|
),
|
|
2920
|
-
/* @__PURE__ */ t(
|
|
2951
|
+
/* @__PURE__ */ t(mt, {})
|
|
2921
2952
|
] }) }) }),
|
|
2922
2953
|
/* @__PURE__ */ m(
|
|
2923
|
-
|
|
2954
|
+
Ee,
|
|
2924
2955
|
{
|
|
2925
2956
|
sideOffset: 5,
|
|
2926
2957
|
className: "my-1 flex max-h-80 w-48 flex-col overflow-hidden overflow-y-auto rounded border p-1 shadow-xl ",
|
|
@@ -2928,8 +2959,8 @@ const tt = [
|
|
|
2928
2959
|
children: [
|
|
2929
2960
|
/* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
2930
2961
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "颜色" }),
|
|
2931
|
-
|
|
2932
|
-
|
|
2962
|
+
nt.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2963
|
+
Pe,
|
|
2933
2964
|
{
|
|
2934
2965
|
onSelect: () => {
|
|
2935
2966
|
o.commands.unsetColor(), s !== "Default" && o.chain().focus().setColor(i || "").run(), e(!1);
|
|
@@ -2947,7 +2978,7 @@ const tt = [
|
|
|
2947
2978
|
),
|
|
2948
2979
|
/* @__PURE__ */ t("span", { children: s })
|
|
2949
2980
|
] }),
|
|
2950
|
-
o.isActive("textStyle", { color: i }) && /* @__PURE__ */ t(
|
|
2981
|
+
o.isActive("textStyle", { color: i }) && /* @__PURE__ */ t(ke, { size: 14 })
|
|
2951
2982
|
]
|
|
2952
2983
|
},
|
|
2953
2984
|
s
|
|
@@ -2955,8 +2986,8 @@ const tt = [
|
|
|
2955
2986
|
] }),
|
|
2956
2987
|
/* @__PURE__ */ m("div", { children: [
|
|
2957
2988
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "背景 " }),
|
|
2958
|
-
|
|
2959
|
-
|
|
2989
|
+
at.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2990
|
+
Pe,
|
|
2960
2991
|
{
|
|
2961
2992
|
onSelect: () => {
|
|
2962
2993
|
o.commands.unsetHighlight(), s !== "Default" && o.chain().focus().setHighlight({ color: i }).run(), e(!1);
|
|
@@ -2974,7 +3005,7 @@ const tt = [
|
|
|
2974
3005
|
),
|
|
2975
3006
|
/* @__PURE__ */ t("span", { children: s })
|
|
2976
3007
|
] }),
|
|
2977
|
-
o.isActive("highlight", { color: i }) && /* @__PURE__ */ t(
|
|
3008
|
+
o.isActive("highlight", { color: i }) && /* @__PURE__ */ t(ke, { size: 14 })
|
|
2978
3009
|
]
|
|
2979
3010
|
},
|
|
2980
3011
|
s
|
|
@@ -2985,15 +3016,15 @@ const tt = [
|
|
|
2985
3016
|
)
|
|
2986
3017
|
] });
|
|
2987
3018
|
};
|
|
2988
|
-
function
|
|
3019
|
+
function ga(r) {
|
|
2989
3020
|
try {
|
|
2990
3021
|
return new URL(r), !0;
|
|
2991
3022
|
} catch {
|
|
2992
3023
|
return !1;
|
|
2993
3024
|
}
|
|
2994
3025
|
}
|
|
2995
|
-
function
|
|
2996
|
-
if (
|
|
3026
|
+
function fa(r) {
|
|
3027
|
+
if (ga(r)) return r;
|
|
2997
3028
|
try {
|
|
2998
3029
|
if (r.includes(".") && !r.includes(" "))
|
|
2999
3030
|
return new URL(`https://${r}`).toString();
|
|
@@ -3001,27 +3032,27 @@ function ma(r) {
|
|
|
3001
3032
|
return null;
|
|
3002
3033
|
}
|
|
3003
3034
|
}
|
|
3004
|
-
const
|
|
3005
|
-
const o = be(null), { editor:
|
|
3035
|
+
const ha = ({ open: r, onOpenChange: e }) => {
|
|
3036
|
+
const o = be(null), { editor: n } = Q();
|
|
3006
3037
|
return ae(() => {
|
|
3007
|
-
var
|
|
3008
|
-
(
|
|
3009
|
-
}),
|
|
3010
|
-
/* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(
|
|
3038
|
+
var a;
|
|
3039
|
+
(a = o.current) == null || a.focus();
|
|
3040
|
+
}), n ? /* @__PURE__ */ m(It, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3041
|
+
/* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(an, { asChild: !0, children: /* @__PURE__ */ m(
|
|
3011
3042
|
Z,
|
|
3012
3043
|
{
|
|
3013
3044
|
size: "sm",
|
|
3014
3045
|
variant: "ghost",
|
|
3015
3046
|
className: "gap-2 rounded-md border-none",
|
|
3016
3047
|
children: [
|
|
3017
|
-
/* @__PURE__ */ t("p", { className: "text-base", children: /* @__PURE__ */ t(
|
|
3048
|
+
/* @__PURE__ */ t("p", { className: "text-base", children: /* @__PURE__ */ t(ko, { size: 16 }) }),
|
|
3018
3049
|
/* @__PURE__ */ t(
|
|
3019
3050
|
"p",
|
|
3020
3051
|
{
|
|
3021
3052
|
className: k(
|
|
3022
3053
|
"underline decoration-stone-400 underline-offset-4",
|
|
3023
3054
|
{
|
|
3024
|
-
"text-blue-500":
|
|
3055
|
+
"text-blue-500": n.isActive("link")
|
|
3025
3056
|
}
|
|
3026
3057
|
),
|
|
3027
3058
|
children: "链接 "
|
|
@@ -3030,14 +3061,14 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3030
3061
|
]
|
|
3031
3062
|
}
|
|
3032
3063
|
) }) }),
|
|
3033
|
-
/* @__PURE__ */ t(
|
|
3064
|
+
/* @__PURE__ */ t(Ee, { align: "start", className: "w-60 p-0", sideOffset: 10, children: /* @__PURE__ */ m(
|
|
3034
3065
|
"form",
|
|
3035
3066
|
{
|
|
3036
|
-
onSubmit: (
|
|
3037
|
-
const s =
|
|
3038
|
-
|
|
3039
|
-
const i = s[0], d =
|
|
3040
|
-
d && (
|
|
3067
|
+
onSubmit: (a) => {
|
|
3068
|
+
const s = a.currentTarget;
|
|
3069
|
+
a.preventDefault();
|
|
3070
|
+
const i = s[0], d = fa(i.value);
|
|
3071
|
+
d && (n.chain().focus().setLink({ href: d }).run(), e(!1));
|
|
3041
3072
|
},
|
|
3042
3073
|
className: "flex p-1 ",
|
|
3043
3074
|
children: [
|
|
@@ -3048,10 +3079,10 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3048
3079
|
type: "text",
|
|
3049
3080
|
placeholder: "粘贴链接",
|
|
3050
3081
|
className: "flex-1 bg-background p-1 text-sm outline-none",
|
|
3051
|
-
defaultValue:
|
|
3082
|
+
defaultValue: n.getAttributes("link").href || ""
|
|
3052
3083
|
}
|
|
3053
3084
|
),
|
|
3054
|
-
|
|
3085
|
+
n.getAttributes("link").href ? /* @__PURE__ */ t(
|
|
3055
3086
|
Z,
|
|
3056
3087
|
{
|
|
3057
3088
|
size: "icon",
|
|
@@ -3059,16 +3090,16 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3059
3090
|
type: "button",
|
|
3060
3091
|
className: "flex h-8 items-center rounded-sm p-1 text-red-600 transition-all hover:bg-red-100 dark:hover:bg-red-800",
|
|
3061
3092
|
onClick: () => {
|
|
3062
|
-
|
|
3093
|
+
n.chain().focus().unsetLink().run(), o.current.value = "", e(!1);
|
|
3063
3094
|
},
|
|
3064
|
-
children: /* @__PURE__ */ t(
|
|
3095
|
+
children: /* @__PURE__ */ t(ut, { className: "h-4 w-4" })
|
|
3065
3096
|
}
|
|
3066
|
-
) : /* @__PURE__ */ t(Z, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(
|
|
3097
|
+
) : /* @__PURE__ */ t(Z, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ke, { className: "h-4 w-4" }) })
|
|
3067
3098
|
]
|
|
3068
3099
|
}
|
|
3069
3100
|
) })
|
|
3070
3101
|
] }) : null;
|
|
3071
|
-
},
|
|
3102
|
+
}, ba = () => {
|
|
3072
3103
|
const { editor: r } = Q();
|
|
3073
3104
|
return r ? /* @__PURE__ */ t(me, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ t(
|
|
3074
3105
|
Z,
|
|
@@ -3080,13 +3111,13 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3080
3111
|
if (r.isActive("math"))
|
|
3081
3112
|
r.chain().focus().unsetLatex().run();
|
|
3082
3113
|
else {
|
|
3083
|
-
const { from: e, to: o } = r.state.selection,
|
|
3084
|
-
if (!
|
|
3085
|
-
r.chain().focus().setLatex({ latex:
|
|
3114
|
+
const { from: e, to: o } = r.state.selection, n = r.state.doc.textBetween(e, o);
|
|
3115
|
+
if (!n) return;
|
|
3116
|
+
r.chain().focus().setLatex({ latex: n }).run();
|
|
3086
3117
|
}
|
|
3087
3118
|
},
|
|
3088
3119
|
children: /* @__PURE__ */ t(
|
|
3089
|
-
|
|
3120
|
+
ln,
|
|
3090
3121
|
{
|
|
3091
3122
|
className: k("size-4", { "text-blue-500": r.isActive("math") }),
|
|
3092
3123
|
strokeWidth: 2.3
|
|
@@ -3094,118 +3125,118 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3094
3125
|
)
|
|
3095
3126
|
}
|
|
3096
3127
|
) }) : null;
|
|
3097
|
-
},
|
|
3128
|
+
}, je = [
|
|
3098
3129
|
{
|
|
3099
3130
|
name: "正文",
|
|
3100
3131
|
// Text
|
|
3101
|
-
icon:
|
|
3132
|
+
icon: pt,
|
|
3102
3133
|
command: (r) => r.chain().focus().clearNodes().run(),
|
|
3103
3134
|
isActive: (r) => r.isActive("paragraph") && !r.isActive("bulletList") && !r.isActive("orderedList")
|
|
3104
3135
|
},
|
|
3105
3136
|
{
|
|
3106
3137
|
name: "标题 1",
|
|
3107
3138
|
// Heading 1
|
|
3108
|
-
icon:
|
|
3139
|
+
icon: gt,
|
|
3109
3140
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 1 }).run(),
|
|
3110
3141
|
isActive: (r) => r.isActive("heading", { level: 1 })
|
|
3111
3142
|
},
|
|
3112
3143
|
{
|
|
3113
3144
|
name: "标题 2",
|
|
3114
3145
|
// Heading 2
|
|
3115
|
-
icon:
|
|
3146
|
+
icon: ft,
|
|
3116
3147
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 2 }).run(),
|
|
3117
3148
|
isActive: (r) => r.isActive("heading", { level: 2 })
|
|
3118
3149
|
},
|
|
3119
3150
|
{
|
|
3120
3151
|
name: "标题 3",
|
|
3121
3152
|
// Heading 3
|
|
3122
|
-
icon:
|
|
3153
|
+
icon: ht,
|
|
3123
3154
|
command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 3 }).run(),
|
|
3124
3155
|
isActive: (r) => r.isActive("heading", { level: 3 })
|
|
3125
3156
|
},
|
|
3126
3157
|
{
|
|
3127
3158
|
name: "待办列表",
|
|
3128
3159
|
// To-do List
|
|
3129
|
-
icon:
|
|
3160
|
+
icon: bt,
|
|
3130
3161
|
command: (r) => r.chain().focus().clearNodes().toggleTaskList().run(),
|
|
3131
3162
|
isActive: (r) => r.isActive("taskItem")
|
|
3132
3163
|
},
|
|
3133
3164
|
{
|
|
3134
3165
|
name: "无序列表",
|
|
3135
3166
|
// Bullet List
|
|
3136
|
-
icon:
|
|
3167
|
+
icon: xt,
|
|
3137
3168
|
command: (r) => r.chain().focus().clearNodes().toggleBulletList().run(),
|
|
3138
3169
|
isActive: (r) => r.isActive("bulletList")
|
|
3139
3170
|
},
|
|
3140
3171
|
{
|
|
3141
3172
|
name: "有序列表",
|
|
3142
3173
|
// Numbered List
|
|
3143
|
-
icon:
|
|
3174
|
+
icon: yt,
|
|
3144
3175
|
command: (r) => r.chain().focus().clearNodes().toggleOrderedList().run(),
|
|
3145
3176
|
isActive: (r) => r.isActive("orderedList")
|
|
3146
3177
|
},
|
|
3147
3178
|
{
|
|
3148
3179
|
name: "引用",
|
|
3149
3180
|
// Quote
|
|
3150
|
-
icon:
|
|
3181
|
+
icon: vt,
|
|
3151
3182
|
command: (r) => r.chain().focus().clearNodes().toggleBlockquote().run(),
|
|
3152
3183
|
isActive: (r) => r.isActive("blockquote")
|
|
3153
3184
|
},
|
|
3154
3185
|
{
|
|
3155
3186
|
name: "代码块",
|
|
3156
3187
|
// Code
|
|
3157
|
-
icon:
|
|
3188
|
+
icon: kt,
|
|
3158
3189
|
command: (r) => r.chain().focus().clearNodes().toggleCodeBlock().run(),
|
|
3159
3190
|
isActive: (r) => r.isActive("codeBlock")
|
|
3160
3191
|
}
|
|
3161
|
-
],
|
|
3192
|
+
], xa = ({ open: r, onOpenChange: e }) => {
|
|
3162
3193
|
const { editor: o } = Q();
|
|
3163
3194
|
if (!o) return null;
|
|
3164
|
-
const
|
|
3165
|
-
(
|
|
3195
|
+
const n = je.filter(
|
|
3196
|
+
(a) => a.isActive(o)
|
|
3166
3197
|
).pop() ?? {
|
|
3167
3198
|
name: "多个选中"
|
|
3168
3199
|
// Multiple
|
|
3169
3200
|
};
|
|
3170
|
-
return /* @__PURE__ */ m(
|
|
3201
|
+
return /* @__PURE__ */ m(It, { modal: !0, open: r, onOpenChange: e, children: [
|
|
3171
3202
|
/* @__PURE__ */ t(me, { overlay: "转换成", placement: "top", children: /* @__PURE__ */ t(
|
|
3172
|
-
|
|
3203
|
+
Ft,
|
|
3173
3204
|
{
|
|
3174
3205
|
asChild: !0,
|
|
3175
3206
|
className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
|
|
3176
3207
|
children: /* @__PURE__ */ m(Z, { size: "sm", variant: "ghost", children: [
|
|
3177
|
-
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children:
|
|
3178
|
-
/* @__PURE__ */ t(
|
|
3208
|
+
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: n.name }),
|
|
3209
|
+
/* @__PURE__ */ t(mt, {})
|
|
3179
3210
|
] })
|
|
3180
3211
|
}
|
|
3181
3212
|
) }),
|
|
3182
|
-
/* @__PURE__ */ m(
|
|
3213
|
+
/* @__PURE__ */ m(Ee, { sideOffset: 5, align: "start", className: "w-48 p-1", children: [
|
|
3183
3214
|
/* @__PURE__ */ t("p", { className: "mb-2 text-sm text-secondary-foreground", children: "转换成" }),
|
|
3184
3215
|
" ",
|
|
3185
|
-
|
|
3186
|
-
|
|
3216
|
+
je.map((a) => /* @__PURE__ */ m(
|
|
3217
|
+
Pe,
|
|
3187
3218
|
{
|
|
3188
3219
|
onSelect: (s) => {
|
|
3189
|
-
|
|
3220
|
+
a.command(s), e(!1);
|
|
3190
3221
|
},
|
|
3191
3222
|
className: "flex cursor-pointer items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-accent",
|
|
3192
3223
|
children: [
|
|
3193
3224
|
/* @__PURE__ */ m("div", { className: "flex items-center space-x-2", children: [
|
|
3194
|
-
/* @__PURE__ */ t("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ t(
|
|
3195
|
-
/* @__PURE__ */ t("span", { children:
|
|
3225
|
+
/* @__PURE__ */ t("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ t(a.icon, { className: "h-3 w-3" }) }),
|
|
3226
|
+
/* @__PURE__ */ t("span", { children: a.name })
|
|
3196
3227
|
] }),
|
|
3197
|
-
|
|
3228
|
+
n.name === a.name && /* @__PURE__ */ t(ke, { size: 14 })
|
|
3198
3229
|
]
|
|
3199
3230
|
},
|
|
3200
|
-
|
|
3231
|
+
a.name
|
|
3201
3232
|
))
|
|
3202
3233
|
] })
|
|
3203
3234
|
] });
|
|
3204
3235
|
}, ge = q.forwardRef(
|
|
3205
|
-
({ className: r, orientation: e = "horizontal", decorative: o = !0, ...
|
|
3206
|
-
|
|
3236
|
+
({ className: r, orientation: e = "horizontal", decorative: o = !0, ...n }, a) => /* @__PURE__ */ t(
|
|
3237
|
+
St.Root,
|
|
3207
3238
|
{
|
|
3208
|
-
ref:
|
|
3239
|
+
ref: a,
|
|
3209
3240
|
decorative: o,
|
|
3210
3241
|
orientation: e,
|
|
3211
3242
|
className: k(
|
|
@@ -3213,33 +3244,33 @@ const ua = ({ open: r, onOpenChange: e }) => {
|
|
|
3213
3244
|
e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
|
|
3214
3245
|
r
|
|
3215
3246
|
),
|
|
3216
|
-
...
|
|
3247
|
+
...n
|
|
3217
3248
|
}
|
|
3218
3249
|
)
|
|
3219
3250
|
);
|
|
3220
|
-
ge.displayName =
|
|
3221
|
-
const
|
|
3251
|
+
ge.displayName = St.Root.displayName;
|
|
3252
|
+
const ya = () => /* @__PURE__ */ m("div", { className: "flex items-center justify-center gap-0.5", children: [
|
|
3222
3253
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
|
|
3223
3254
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
|
|
3224
3255
|
/* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
|
|
3225
|
-
] }),
|
|
3256
|
+
] }), _t = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__ */ m(
|
|
3226
3257
|
de.Root,
|
|
3227
3258
|
{
|
|
3228
|
-
ref:
|
|
3259
|
+
ref: n,
|
|
3229
3260
|
className: k("relative overflow-hidden", r),
|
|
3230
3261
|
...o,
|
|
3231
3262
|
children: [
|
|
3232
3263
|
/* @__PURE__ */ t(de.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
|
|
3233
|
-
/* @__PURE__ */ t(
|
|
3264
|
+
/* @__PURE__ */ t(jt, {}),
|
|
3234
3265
|
/* @__PURE__ */ t(de.Corner, {})
|
|
3235
3266
|
]
|
|
3236
3267
|
}
|
|
3237
3268
|
));
|
|
3238
|
-
|
|
3239
|
-
const
|
|
3269
|
+
_t.displayName = de.Root.displayName;
|
|
3270
|
+
const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n) => /* @__PURE__ */ t(
|
|
3240
3271
|
de.ScrollAreaScrollbar,
|
|
3241
3272
|
{
|
|
3242
|
-
ref:
|
|
3273
|
+
ref: n,
|
|
3243
3274
|
orientation: e,
|
|
3244
3275
|
className: k(
|
|
3245
3276
|
"flex touch-none select-none transition-colors",
|
|
@@ -3251,9 +3282,9 @@ const Ot = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, a)
|
|
|
3251
3282
|
children: /* @__PURE__ */ t(de.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
3252
3283
|
}
|
|
3253
3284
|
));
|
|
3254
|
-
|
|
3255
|
-
const
|
|
3256
|
-
|
|
3285
|
+
jt.displayName = de.ScrollAreaScrollbar.displayName;
|
|
3286
|
+
const va = oe.Portal, Xt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3287
|
+
oe.Overlay,
|
|
3257
3288
|
{
|
|
3258
3289
|
ref: o,
|
|
3259
3290
|
className: k(
|
|
@@ -3263,13 +3294,13 @@ const ha = te.Portal, Ft = q.forwardRef(({ className: r, ...e }, o) => /* @__PUR
|
|
|
3263
3294
|
...e
|
|
3264
3295
|
}
|
|
3265
3296
|
));
|
|
3266
|
-
|
|
3267
|
-
const
|
|
3268
|
-
/* @__PURE__ */ t(
|
|
3297
|
+
Xt.displayName = oe.Overlay.displayName;
|
|
3298
|
+
const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__ */ m(va, { children: [
|
|
3299
|
+
/* @__PURE__ */ t(Xt, {}),
|
|
3269
3300
|
/* @__PURE__ */ m(
|
|
3270
|
-
|
|
3301
|
+
oe.Content,
|
|
3271
3302
|
{
|
|
3272
|
-
ref:
|
|
3303
|
+
ref: n,
|
|
3273
3304
|
className: k(
|
|
3274
3305
|
"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",
|
|
3275
3306
|
r
|
|
@@ -3277,17 +3308,17 @@ const ba = q.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__
|
|
|
3277
3308
|
...o,
|
|
3278
3309
|
children: [
|
|
3279
3310
|
e,
|
|
3280
|
-
/* @__PURE__ */ m(
|
|
3281
|
-
/* @__PURE__ */ t(
|
|
3311
|
+
/* @__PURE__ */ m(oe.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
3312
|
+
/* @__PURE__ */ t(cn, { className: "h-4 w-4" }),
|
|
3282
3313
|
/* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
|
|
3283
3314
|
] })
|
|
3284
3315
|
]
|
|
3285
3316
|
}
|
|
3286
3317
|
)
|
|
3287
3318
|
] }));
|
|
3288
|
-
|
|
3289
|
-
const
|
|
3290
|
-
|
|
3319
|
+
ka.displayName = oe.Content.displayName;
|
|
3320
|
+
const Ca = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3321
|
+
oe.Title,
|
|
3291
3322
|
{
|
|
3292
3323
|
ref: o,
|
|
3293
3324
|
className: k(
|
|
@@ -3297,17 +3328,17 @@ const xa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3297
3328
|
...e
|
|
3298
3329
|
}
|
|
3299
3330
|
));
|
|
3300
|
-
|
|
3301
|
-
const
|
|
3302
|
-
|
|
3331
|
+
Ca.displayName = oe.Title.displayName;
|
|
3332
|
+
const wa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3333
|
+
oe.Description,
|
|
3303
3334
|
{
|
|
3304
3335
|
ref: o,
|
|
3305
3336
|
className: k("text-sm text-muted-foreground", r),
|
|
3306
3337
|
...e
|
|
3307
3338
|
}
|
|
3308
3339
|
));
|
|
3309
|
-
|
|
3310
|
-
const
|
|
3340
|
+
wa.displayName = oe.Description.displayName;
|
|
3341
|
+
const Ut = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3311
3342
|
W,
|
|
3312
3343
|
{
|
|
3313
3344
|
ref: o,
|
|
@@ -3318,9 +3349,9 @@ const _t = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3318
3349
|
...e
|
|
3319
3350
|
}
|
|
3320
3351
|
));
|
|
3321
|
-
|
|
3322
|
-
const
|
|
3323
|
-
/* @__PURE__ */ t(
|
|
3352
|
+
Ut.displayName = W.displayName;
|
|
3353
|
+
const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
|
|
3354
|
+
/* @__PURE__ */ t(Ge, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
|
|
3324
3355
|
/* @__PURE__ */ t(
|
|
3325
3356
|
W.Input,
|
|
3326
3357
|
{
|
|
@@ -3333,8 +3364,8 @@ const jt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div",
|
|
|
3333
3364
|
}
|
|
3334
3365
|
)
|
|
3335
3366
|
] }));
|
|
3336
|
-
|
|
3337
|
-
const
|
|
3367
|
+
Gt.displayName = W.Input.displayName;
|
|
3368
|
+
const Na = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3338
3369
|
W.List,
|
|
3339
3370
|
{
|
|
3340
3371
|
ref: o,
|
|
@@ -3342,8 +3373,8 @@ const va = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3342
3373
|
...e
|
|
3343
3374
|
}
|
|
3344
3375
|
));
|
|
3345
|
-
|
|
3346
|
-
const
|
|
3376
|
+
Na.displayName = W.List.displayName;
|
|
3377
|
+
const Ia = q.forwardRef((r, e) => /* @__PURE__ */ t(
|
|
3347
3378
|
W.Empty,
|
|
3348
3379
|
{
|
|
3349
3380
|
ref: e,
|
|
@@ -3351,8 +3382,8 @@ const ka = q.forwardRef((r, e) => /* @__PURE__ */ t(
|
|
|
3351
3382
|
...r
|
|
3352
3383
|
}
|
|
3353
3384
|
));
|
|
3354
|
-
|
|
3355
|
-
const
|
|
3385
|
+
Ia.displayName = W.Empty.displayName;
|
|
3386
|
+
const Ne = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3356
3387
|
W.Group,
|
|
3357
3388
|
{
|
|
3358
3389
|
ref: o,
|
|
@@ -3363,8 +3394,8 @@ const we = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3363
3394
|
...e
|
|
3364
3395
|
}
|
|
3365
3396
|
));
|
|
3366
|
-
|
|
3367
|
-
const
|
|
3397
|
+
Ne.displayName = W.Group.displayName;
|
|
3398
|
+
const Qe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3368
3399
|
W.Separator,
|
|
3369
3400
|
{
|
|
3370
3401
|
ref: o,
|
|
@@ -3372,7 +3403,7 @@ const We = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3372
3403
|
...e
|
|
3373
3404
|
}
|
|
3374
3405
|
));
|
|
3375
|
-
|
|
3406
|
+
Qe.displayName = W.Separator.displayName;
|
|
3376
3407
|
const fe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
3377
3408
|
W.Item,
|
|
3378
3409
|
{
|
|
@@ -3385,30 +3416,30 @@ const fe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
|
|
|
3385
3416
|
}
|
|
3386
3417
|
));
|
|
3387
3418
|
fe.displayName = W.Item.displayName;
|
|
3388
|
-
const
|
|
3419
|
+
const Sa = ({
|
|
3389
3420
|
completion: r,
|
|
3390
3421
|
onDiscard: e
|
|
3391
3422
|
}) => {
|
|
3392
3423
|
const { editor: o } = Q();
|
|
3393
3424
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3394
|
-
/* @__PURE__ */ m(
|
|
3425
|
+
/* @__PURE__ */ m(Ne, { children: [
|
|
3395
3426
|
/* @__PURE__ */ m(
|
|
3396
3427
|
fe,
|
|
3397
3428
|
{
|
|
3398
3429
|
className: "gap-2 px-4",
|
|
3399
3430
|
value: "replace",
|
|
3400
3431
|
onSelect: () => {
|
|
3401
|
-
const
|
|
3432
|
+
const n = o.view.state.selection;
|
|
3402
3433
|
o.chain().focus().insertContentAt(
|
|
3403
3434
|
{
|
|
3404
|
-
from:
|
|
3405
|
-
to:
|
|
3435
|
+
from: n.from,
|
|
3436
|
+
to: n.to
|
|
3406
3437
|
},
|
|
3407
3438
|
r
|
|
3408
3439
|
).run();
|
|
3409
3440
|
},
|
|
3410
3441
|
children: [
|
|
3411
|
-
/* @__PURE__ */ t(
|
|
3442
|
+
/* @__PURE__ */ t(dn, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3412
3443
|
"替换选择"
|
|
3413
3444
|
]
|
|
3414
3445
|
}
|
|
@@ -3419,60 +3450,60 @@ const Ca = ({
|
|
|
3419
3450
|
className: "gap-2 px-4",
|
|
3420
3451
|
value: "insert",
|
|
3421
3452
|
onSelect: () => {
|
|
3422
|
-
const
|
|
3423
|
-
o.chain().focus().insertContentAt(
|
|
3453
|
+
const n = o.view.state.selection;
|
|
3454
|
+
o.chain().focus().insertContentAt(n.to + 1, r).run();
|
|
3424
3455
|
},
|
|
3425
3456
|
children: [
|
|
3426
|
-
/* @__PURE__ */ t(
|
|
3457
|
+
/* @__PURE__ */ t(mn, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3427
3458
|
"在下面插入"
|
|
3428
3459
|
]
|
|
3429
3460
|
}
|
|
3430
3461
|
)
|
|
3431
3462
|
] }),
|
|
3432
|
-
/* @__PURE__ */ t(
|
|
3433
|
-
/* @__PURE__ */ t(
|
|
3434
|
-
/* @__PURE__ */ t(
|
|
3463
|
+
/* @__PURE__ */ t(Qe, {}),
|
|
3464
|
+
/* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ m(fe, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
|
|
3465
|
+
/* @__PURE__ */ t(un, { className: "h-4 w-4 text-muted-foreground" }),
|
|
3435
3466
|
"丢弃"
|
|
3436
3467
|
] }) })
|
|
3437
3468
|
] });
|
|
3438
|
-
},
|
|
3469
|
+
}, Ta = [
|
|
3439
3470
|
{
|
|
3440
3471
|
value: "improve",
|
|
3441
3472
|
label: "改进写作",
|
|
3442
3473
|
// Improve writing
|
|
3443
|
-
icon:
|
|
3474
|
+
icon: pn
|
|
3444
3475
|
},
|
|
3445
3476
|
{
|
|
3446
3477
|
value: "fix",
|
|
3447
3478
|
label: "修正语法",
|
|
3448
3479
|
// Fix grammar
|
|
3449
|
-
icon:
|
|
3480
|
+
icon: gn
|
|
3450
3481
|
},
|
|
3451
3482
|
{
|
|
3452
3483
|
value: "shorter",
|
|
3453
3484
|
label: "缩短文本",
|
|
3454
3485
|
// Make shorter
|
|
3455
|
-
icon:
|
|
3486
|
+
icon: fn
|
|
3456
3487
|
},
|
|
3457
3488
|
{
|
|
3458
3489
|
value: "longer",
|
|
3459
3490
|
label: "扩展文本",
|
|
3460
3491
|
// Make longer
|
|
3461
|
-
icon:
|
|
3492
|
+
icon: hn
|
|
3462
3493
|
}
|
|
3463
|
-
],
|
|
3494
|
+
], Ma = ({ onSelect: r }) => {
|
|
3464
3495
|
const { editor: e } = Q();
|
|
3465
3496
|
return /* @__PURE__ */ m(ue, { children: [
|
|
3466
|
-
/* @__PURE__ */ m(
|
|
3497
|
+
/* @__PURE__ */ m(Ne, { heading: "编辑或校对选中文本", children: [
|
|
3467
3498
|
" ",
|
|
3468
|
-
|
|
3499
|
+
Ta.map((o) => /* @__PURE__ */ m(
|
|
3469
3500
|
fe,
|
|
3470
3501
|
{
|
|
3471
|
-
onSelect: (
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3502
|
+
onSelect: (n) => {
|
|
3503
|
+
const a = e.state.selection.content(), s = e.storage.markdown.serializer.serialize(
|
|
3504
|
+
a.content
|
|
3474
3505
|
);
|
|
3475
|
-
r(s,
|
|
3506
|
+
r(s, n);
|
|
3476
3507
|
},
|
|
3477
3508
|
className: "flex gap-2 px-4",
|
|
3478
3509
|
value: o.value,
|
|
@@ -3484,20 +3515,20 @@ const Ca = ({
|
|
|
3484
3515
|
o.value
|
|
3485
3516
|
))
|
|
3486
3517
|
] }),
|
|
3487
|
-
/* @__PURE__ */ t(
|
|
3488
|
-
/* @__PURE__ */ m(
|
|
3518
|
+
/* @__PURE__ */ t(Qe, {}),
|
|
3519
|
+
/* @__PURE__ */ m(Ne, { heading: "使用 AI 完成更多", children: [
|
|
3489
3520
|
" ",
|
|
3490
3521
|
/* @__PURE__ */ m(
|
|
3491
3522
|
fe,
|
|
3492
3523
|
{
|
|
3493
3524
|
onSelect: () => {
|
|
3494
|
-
const o = e.state.selection.from,
|
|
3495
|
-
r(
|
|
3525
|
+
const o = e.state.selection.from, n = Ar(e, o);
|
|
3526
|
+
r(n, "continue");
|
|
3496
3527
|
},
|
|
3497
3528
|
value: "continue",
|
|
3498
3529
|
className: "gap-2 px-4",
|
|
3499
3530
|
children: [
|
|
3500
|
-
/* @__PURE__ */ t(
|
|
3531
|
+
/* @__PURE__ */ t(bn, { className: "h-4 w-4 text-purple-500" }),
|
|
3501
3532
|
"继续写作"
|
|
3502
3533
|
]
|
|
3503
3534
|
}
|
|
@@ -3505,38 +3536,38 @@ const Ca = ({
|
|
|
3505
3536
|
] })
|
|
3506
3537
|
] });
|
|
3507
3538
|
};
|
|
3508
|
-
function
|
|
3509
|
-
const { editor: o } = Q(), [
|
|
3539
|
+
function La({ onOpenChange: r, options: e }) {
|
|
3540
|
+
const { editor: o } = Q(), [n, a] = _(""), { completion: s, complete: i, isLoading: d } = Nn({
|
|
3510
3541
|
// id: "novel",
|
|
3511
3542
|
api: "/api/generate",
|
|
3512
3543
|
onResponse: (x) => {
|
|
3513
3544
|
if (x.status === 429) {
|
|
3514
|
-
|
|
3545
|
+
we.error("You have reached your request limit for the day.");
|
|
3515
3546
|
return;
|
|
3516
3547
|
}
|
|
3517
3548
|
},
|
|
3518
3549
|
onError: (x) => {
|
|
3519
|
-
|
|
3550
|
+
we.error(x.message);
|
|
3520
3551
|
},
|
|
3521
3552
|
...e
|
|
3522
3553
|
}), p = s.length > 0;
|
|
3523
|
-
return /* @__PURE__ */ m(
|
|
3524
|
-
p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t(
|
|
3554
|
+
return /* @__PURE__ */ m(Ut, { className: "w-[350px]", children: [
|
|
3555
|
+
p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t(_t, { children: /* @__PURE__ */ t("div", { className: "prose p-2 px-4 prose-sm", children: /* @__PURE__ */ t(wt, { children: s }) }) }) }),
|
|
3525
3556
|
d && /* @__PURE__ */ m("div", { className: "flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-purple-500", children: [
|
|
3526
|
-
/* @__PURE__ */ t(
|
|
3557
|
+
/* @__PURE__ */ t(Ge, { size: 14, className: "mr-2 shrink-0" }),
|
|
3527
3558
|
"AI正在思考",
|
|
3528
|
-
/* @__PURE__ */ t("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ t(
|
|
3559
|
+
/* @__PURE__ */ t("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ t(ya, {}) })
|
|
3529
3560
|
] }),
|
|
3530
3561
|
!d && /* @__PURE__ */ m(ue, { children: [
|
|
3531
3562
|
/* @__PURE__ */ m("div", { className: "relative", children: [
|
|
3532
3563
|
/* @__PURE__ */ t(
|
|
3533
|
-
|
|
3564
|
+
Gt,
|
|
3534
3565
|
{
|
|
3535
|
-
value:
|
|
3536
|
-
onValueChange:
|
|
3566
|
+
value: n,
|
|
3567
|
+
onValueChange: a,
|
|
3537
3568
|
autoFocus: !0,
|
|
3538
3569
|
placeholder: p ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
|
|
3539
|
-
onFocus: () =>
|
|
3570
|
+
onFocus: () => Dr(o)
|
|
3540
3571
|
}
|
|
3541
3572
|
),
|
|
3542
3573
|
/* @__PURE__ */ t(
|
|
@@ -3547,21 +3578,21 @@ function Ia({ onOpenChange: r, options: e }) {
|
|
|
3547
3578
|
onClick: () => {
|
|
3548
3579
|
if (s)
|
|
3549
3580
|
return i(s, {
|
|
3550
|
-
body: { option: "zap", command:
|
|
3551
|
-
}).then(() =>
|
|
3581
|
+
body: { option: "zap", command: n }
|
|
3582
|
+
}).then(() => a(""));
|
|
3552
3583
|
const x = o.state.selection.content(), l = o.storage.markdown.serializer.serialize(
|
|
3553
3584
|
x.content
|
|
3554
3585
|
);
|
|
3555
3586
|
i(l, {
|
|
3556
|
-
body: { option: "zap", command:
|
|
3557
|
-
}).then(() =>
|
|
3587
|
+
body: { option: "zap", command: n }
|
|
3588
|
+
}).then(() => a(""));
|
|
3558
3589
|
},
|
|
3559
|
-
children: /* @__PURE__ */ t(
|
|
3590
|
+
children: /* @__PURE__ */ t(xn, { className: "h-4 w-4" })
|
|
3560
3591
|
}
|
|
3561
3592
|
)
|
|
3562
3593
|
] }),
|
|
3563
3594
|
p ? /* @__PURE__ */ t(
|
|
3564
|
-
|
|
3595
|
+
Sa,
|
|
3565
3596
|
{
|
|
3566
3597
|
onDiscard: () => {
|
|
3567
3598
|
o.chain().unsetHighlight().focus().run(), r(!1);
|
|
@@ -3569,7 +3600,7 @@ function Ia({ onOpenChange: r, options: e }) {
|
|
|
3569
3600
|
completion: s
|
|
3570
3601
|
}
|
|
3571
3602
|
) : /* @__PURE__ */ t(
|
|
3572
|
-
|
|
3603
|
+
Ma,
|
|
3573
3604
|
{
|
|
3574
3605
|
onSelect: (x, l) => i(x, { body: { option: l } })
|
|
3575
3606
|
}
|
|
@@ -3577,18 +3608,18 @@ function Ia({ onOpenChange: r, options: e }) {
|
|
|
3577
3608
|
] })
|
|
3578
3609
|
] });
|
|
3579
3610
|
}
|
|
3580
|
-
const
|
|
3611
|
+
const Aa = ({
|
|
3581
3612
|
children: r,
|
|
3582
3613
|
open: e,
|
|
3583
3614
|
onOpenChange: o,
|
|
3584
|
-
enableAI:
|
|
3585
|
-
aiOptions:
|
|
3615
|
+
enableAI: n = !1,
|
|
3616
|
+
aiOptions: a
|
|
3586
3617
|
}) => {
|
|
3587
3618
|
const { editor: s } = Q();
|
|
3588
3619
|
return ae(() => {
|
|
3589
|
-
e ||
|
|
3620
|
+
e || Rr(s);
|
|
3590
3621
|
}, [e]), /* @__PURE__ */ m(
|
|
3591
|
-
|
|
3622
|
+
Pr,
|
|
3592
3623
|
{
|
|
3593
3624
|
tippyOptions: {
|
|
3594
3625
|
placement: e ? "bottom-start" : "top",
|
|
@@ -3598,16 +3629,16 @@ const Sa = ({
|
|
|
3598
3629
|
},
|
|
3599
3630
|
className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
|
|
3600
3631
|
children: [
|
|
3601
|
-
e &&
|
|
3602
|
-
|
|
3632
|
+
e && n && /* @__PURE__ */ t(
|
|
3633
|
+
La,
|
|
3603
3634
|
{
|
|
3604
3635
|
open: e,
|
|
3605
3636
|
onOpenChange: o,
|
|
3606
|
-
options:
|
|
3637
|
+
options: a
|
|
3607
3638
|
}
|
|
3608
3639
|
),
|
|
3609
|
-
!e && /* @__PURE__ */ m(
|
|
3610
|
-
|
|
3640
|
+
!e && /* @__PURE__ */ m(oo, { children: [
|
|
3641
|
+
n && /* @__PURE__ */ m(
|
|
3611
3642
|
Z,
|
|
3612
3643
|
{
|
|
3613
3644
|
className: "gap-1 text-purple-500",
|
|
@@ -3615,7 +3646,7 @@ const Sa = ({
|
|
|
3615
3646
|
onClick: () => o(!0),
|
|
3616
3647
|
size: "sm",
|
|
3617
3648
|
children: [
|
|
3618
|
-
/* @__PURE__ */ t(
|
|
3649
|
+
/* @__PURE__ */ t(Ge, { size: 14 }),
|
|
3619
3650
|
"询问AI"
|
|
3620
3651
|
]
|
|
3621
3652
|
}
|
|
@@ -3625,7 +3656,7 @@ const Sa = ({
|
|
|
3625
3656
|
]
|
|
3626
3657
|
}
|
|
3627
3658
|
);
|
|
3628
|
-
},
|
|
3659
|
+
}, Da = (r) => {
|
|
3629
3660
|
const e = fetch("/api/upload", {
|
|
3630
3661
|
method: "POST",
|
|
3631
3662
|
headers: {
|
|
@@ -3634,27 +3665,27 @@ const Sa = ({
|
|
|
3634
3665
|
},
|
|
3635
3666
|
body: r
|
|
3636
3667
|
});
|
|
3637
|
-
return new Promise((o,
|
|
3638
|
-
|
|
3639
|
-
e.then(async (
|
|
3640
|
-
if (
|
|
3641
|
-
const { url: s } = await
|
|
3668
|
+
return new Promise((o, n) => {
|
|
3669
|
+
we.promise(
|
|
3670
|
+
e.then(async (a) => {
|
|
3671
|
+
if (a.status === 200) {
|
|
3672
|
+
const { url: s } = await a.json(), i = new Image();
|
|
3642
3673
|
i.src = s, i.onload = () => {
|
|
3643
3674
|
o(s);
|
|
3644
3675
|
};
|
|
3645
|
-
} else throw
|
|
3676
|
+
} else throw a.status === 401 ? (o(r), new Error("`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead.")) : new Error("Error uploading image. Please try again.");
|
|
3646
3677
|
}),
|
|
3647
3678
|
{
|
|
3648
3679
|
loading: "Uploading image...",
|
|
3649
3680
|
success: "Image uploaded successfully.",
|
|
3650
|
-
error: (
|
|
3681
|
+
error: (a) => (n(a), a.message)
|
|
3651
3682
|
}
|
|
3652
3683
|
);
|
|
3653
3684
|
});
|
|
3654
|
-
},
|
|
3655
|
-
onUpload:
|
|
3656
|
-
validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (
|
|
3657
|
-
}),
|
|
3685
|
+
}, Ra = Nt({
|
|
3686
|
+
onUpload: Da,
|
|
3687
|
+
validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (we.error("File size too big (max 20MB)."), !1) : !0 : (we.error("File type not supported."), !1)
|
|
3688
|
+
}), Pa = () => {
|
|
3658
3689
|
const { editor: r } = Q();
|
|
3659
3690
|
return r ? /* @__PURE__ */ t("div", { className: "flex", children: [
|
|
3660
3691
|
{
|
|
@@ -3662,41 +3693,41 @@ const Sa = ({
|
|
|
3662
3693
|
// bold
|
|
3663
3694
|
isActive: (o) => o.isActive("bold"),
|
|
3664
3695
|
command: (o) => o.chain().focus().toggleBold().run(),
|
|
3665
|
-
icon:
|
|
3696
|
+
icon: yn
|
|
3666
3697
|
},
|
|
3667
3698
|
{
|
|
3668
3699
|
name: "斜体",
|
|
3669
3700
|
// italic
|
|
3670
3701
|
isActive: (o) => o.isActive("italic"),
|
|
3671
3702
|
command: (o) => o.chain().focus().toggleItalic().run(),
|
|
3672
|
-
icon:
|
|
3703
|
+
icon: vn
|
|
3673
3704
|
},
|
|
3674
3705
|
{
|
|
3675
3706
|
name: "下划线",
|
|
3676
3707
|
// underline
|
|
3677
3708
|
isActive: (o) => o.isActive("underline"),
|
|
3678
3709
|
command: (o) => o.chain().focus().toggleUnderline().run(),
|
|
3679
|
-
icon:
|
|
3710
|
+
icon: kn
|
|
3680
3711
|
},
|
|
3681
3712
|
{
|
|
3682
3713
|
name: "删除线",
|
|
3683
3714
|
// strike
|
|
3684
3715
|
isActive: (o) => o.isActive("strike"),
|
|
3685
3716
|
command: (o) => o.chain().focus().toggleStrike().run(),
|
|
3686
|
-
icon:
|
|
3717
|
+
icon: Cn
|
|
3687
3718
|
},
|
|
3688
3719
|
{
|
|
3689
3720
|
name: "代码",
|
|
3690
3721
|
// code
|
|
3691
3722
|
isActive: (o) => o.isActive("code"),
|
|
3692
3723
|
command: (o) => o.chain().focus().toggleCode().run(),
|
|
3693
|
-
icon:
|
|
3724
|
+
icon: wn
|
|
3694
3725
|
}
|
|
3695
3726
|
].map((o) => /* @__PURE__ */ t(
|
|
3696
|
-
|
|
3727
|
+
Pe,
|
|
3697
3728
|
{
|
|
3698
|
-
onSelect: (
|
|
3699
|
-
o.command(
|
|
3729
|
+
onSelect: (n) => {
|
|
3730
|
+
o.command(n);
|
|
3700
3731
|
},
|
|
3701
3732
|
children: /* @__PURE__ */ t(me, { overlay: o.name, placement: "top", children: /* @__PURE__ */ t(
|
|
3702
3733
|
Z,
|
|
@@ -3718,14 +3749,14 @@ const Sa = ({
|
|
|
3718
3749
|
},
|
|
3719
3750
|
o.name
|
|
3720
3751
|
)) }) : null;
|
|
3721
|
-
},
|
|
3752
|
+
}, qt = ({ uploadFn: r }) => zr([
|
|
3722
3753
|
{
|
|
3723
3754
|
title: "文本",
|
|
3724
3755
|
// "Text",
|
|
3725
3756
|
description: "从纯文本开始编写。",
|
|
3726
3757
|
// "Just start typing with plain text.",
|
|
3727
3758
|
searchTerms: ["p", "paragraph"],
|
|
3728
|
-
icon: /* @__PURE__ */ t(
|
|
3759
|
+
icon: /* @__PURE__ */ t(pt, { size: 18 }),
|
|
3729
3760
|
command: ({ editor: e, range: o }) => {
|
|
3730
3761
|
e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").run();
|
|
3731
3762
|
}
|
|
@@ -3736,7 +3767,7 @@ const Sa = ({
|
|
|
3736
3767
|
description: "大标题。",
|
|
3737
3768
|
// "Big section heading.",
|
|
3738
3769
|
searchTerms: ["title", "big", "large"],
|
|
3739
|
-
icon: /* @__PURE__ */ t(
|
|
3770
|
+
icon: /* @__PURE__ */ t(gt, { size: 18 }),
|
|
3740
3771
|
command: ({ editor: e, range: o }) => {
|
|
3741
3772
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 1 }).run();
|
|
3742
3773
|
}
|
|
@@ -3747,7 +3778,7 @@ const Sa = ({
|
|
|
3747
3778
|
description: "中标题。",
|
|
3748
3779
|
// "Medium section heading.",
|
|
3749
3780
|
searchTerms: ["subtitle", "medium"],
|
|
3750
|
-
icon: /* @__PURE__ */ t(
|
|
3781
|
+
icon: /* @__PURE__ */ t(ft, { size: 18 }),
|
|
3751
3782
|
command: ({ editor: e, range: o }) => {
|
|
3752
3783
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 2 }).run();
|
|
3753
3784
|
}
|
|
@@ -3758,7 +3789,7 @@ const Sa = ({
|
|
|
3758
3789
|
description: "小标题。",
|
|
3759
3790
|
// "Small section heading.",
|
|
3760
3791
|
searchTerms: ["subtitle", "small"],
|
|
3761
|
-
icon: /* @__PURE__ */ t(
|
|
3792
|
+
icon: /* @__PURE__ */ t(ht, { size: 18 }),
|
|
3762
3793
|
command: ({ editor: e, range: o }) => {
|
|
3763
3794
|
e.chain().focus().deleteRange(o).setNode("heading", { level: 3 }).run();
|
|
3764
3795
|
}
|
|
@@ -3769,7 +3800,7 @@ const Sa = ({
|
|
|
3769
3800
|
description: "使用待办清单追踪任务。",
|
|
3770
3801
|
// "Track tasks with a to-do list.",
|
|
3771
3802
|
searchTerms: ["todo", "task", "list", "check", "checkbox"],
|
|
3772
|
-
icon: /* @__PURE__ */ t(
|
|
3803
|
+
icon: /* @__PURE__ */ t(bt, { size: 18 }),
|
|
3773
3804
|
command: ({ editor: e, range: o }) => {
|
|
3774
3805
|
e.chain().focus().deleteRange(o).toggleTaskList().run();
|
|
3775
3806
|
}
|
|
@@ -3780,7 +3811,7 @@ const Sa = ({
|
|
|
3780
3811
|
description: "创建一个简单的项目符号列表。",
|
|
3781
3812
|
// "Create a simple bullet list.",
|
|
3782
3813
|
searchTerms: ["unordered", "point"],
|
|
3783
|
-
icon: /* @__PURE__ */ t(
|
|
3814
|
+
icon: /* @__PURE__ */ t(xt, { size: 18 }),
|
|
3784
3815
|
command: ({ editor: e, range: o }) => {
|
|
3785
3816
|
e.chain().focus().deleteRange(o).toggleBulletList().run();
|
|
3786
3817
|
}
|
|
@@ -3791,7 +3822,7 @@ const Sa = ({
|
|
|
3791
3822
|
description: "创建一个带有序号的列表。",
|
|
3792
3823
|
// "Create a list with numbering.",
|
|
3793
3824
|
searchTerms: ["ordered"],
|
|
3794
|
-
icon: /* @__PURE__ */ t(
|
|
3825
|
+
icon: /* @__PURE__ */ t(yt, { size: 18 }),
|
|
3795
3826
|
command: ({ editor: e, range: o }) => {
|
|
3796
3827
|
e.chain().focus().deleteRange(o).toggleOrderedList().run();
|
|
3797
3828
|
}
|
|
@@ -3802,7 +3833,7 @@ const Sa = ({
|
|
|
3802
3833
|
description: "摘取引用。",
|
|
3803
3834
|
// "Capture a quote.",
|
|
3804
3835
|
searchTerms: ["blockquote"],
|
|
3805
|
-
icon: /* @__PURE__ */ t(
|
|
3836
|
+
icon: /* @__PURE__ */ t(vt, { size: 18 }),
|
|
3806
3837
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").toggleBlockquote().run()
|
|
3807
3838
|
},
|
|
3808
3839
|
{
|
|
@@ -3811,7 +3842,7 @@ const Sa = ({
|
|
|
3811
3842
|
description: "捕获代码段。",
|
|
3812
3843
|
// "Capture a code snippet.",
|
|
3813
3844
|
searchTerms: ["codeblock"],
|
|
3814
|
-
icon: /* @__PURE__ */ t(
|
|
3845
|
+
icon: /* @__PURE__ */ t(kt, { size: 18 }),
|
|
3815
3846
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleCodeBlock().run()
|
|
3816
3847
|
},
|
|
3817
3848
|
{
|
|
@@ -3820,37 +3851,37 @@ const Sa = ({
|
|
|
3820
3851
|
description: "从您的计算机上传图像。",
|
|
3821
3852
|
// "Upload an image from your computer.",
|
|
3822
3853
|
searchTerms: ["photo", "picture", "media"],
|
|
3823
|
-
icon: /* @__PURE__ */ t(
|
|
3854
|
+
icon: /* @__PURE__ */ t(Co, { size: 18 }),
|
|
3824
3855
|
command: ({ editor: e, range: o }) => {
|
|
3825
3856
|
e.chain().focus().deleteRange(o).run();
|
|
3826
|
-
const
|
|
3827
|
-
|
|
3828
|
-
var
|
|
3829
|
-
if ((
|
|
3830
|
-
const s =
|
|
3857
|
+
const n = document.createElement("input");
|
|
3858
|
+
n.type = "file", n.accept = "image/*", n.onchange = async () => {
|
|
3859
|
+
var a;
|
|
3860
|
+
if ((a = n.files) != null && a.length) {
|
|
3861
|
+
const s = n.files[0], i = e.view.state.selection.from;
|
|
3831
3862
|
r(s, e.view, i);
|
|
3832
3863
|
}
|
|
3833
|
-
},
|
|
3864
|
+
}, n.click();
|
|
3834
3865
|
}
|
|
3835
3866
|
}
|
|
3836
|
-
]),
|
|
3867
|
+
]), Ba = (r) => Br.configure({
|
|
3837
3868
|
suggestion: {
|
|
3838
|
-
items: () =>
|
|
3839
|
-
render:
|
|
3869
|
+
items: () => qt(r),
|
|
3870
|
+
render: Er
|
|
3840
3871
|
}
|
|
3841
|
-
}),
|
|
3872
|
+
}), za = {
|
|
3842
3873
|
type: "doc",
|
|
3843
3874
|
content: []
|
|
3844
|
-
},
|
|
3845
|
-
const
|
|
3846
|
-
|
|
3875
|
+
}, Yt = lt(({ children: r, items: e, ...o }, n) => {
|
|
3876
|
+
const a = (i) => /* @__PURE__ */ m(
|
|
3877
|
+
De.Item,
|
|
3847
3878
|
{
|
|
3848
3879
|
onClick: i.onClick,
|
|
3849
3880
|
className: k(
|
|
3850
3881
|
"gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3851
3882
|
i.className
|
|
3852
3883
|
),
|
|
3853
|
-
itemIcon: i.isActive ? /* @__PURE__ */ t(
|
|
3884
|
+
itemIcon: i.isActive ? /* @__PURE__ */ t(ke, { size: 16 }) : void 0,
|
|
3854
3885
|
children: [
|
|
3855
3886
|
i.icon,
|
|
3856
3887
|
i.label,
|
|
@@ -3861,9 +3892,9 @@ const Sa = ({
|
|
|
3861
3892
|
), s = (i) => {
|
|
3862
3893
|
var d;
|
|
3863
3894
|
return /* @__PURE__ */ t(
|
|
3864
|
-
|
|
3895
|
+
De.SubMenu,
|
|
3865
3896
|
{
|
|
3866
|
-
expandIcon: /* @__PURE__ */ t(
|
|
3897
|
+
expandIcon: /* @__PURE__ */ t(wo, { size: 16 }),
|
|
3867
3898
|
popupClassName: k(
|
|
3868
3899
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
|
|
3869
3900
|
b`
|
|
@@ -3895,18 +3926,18 @@ const Sa = ({
|
|
|
3895
3926
|
i.label,
|
|
3896
3927
|
/* @__PURE__ */ t("div", { className: "flex-1" })
|
|
3897
3928
|
] }),
|
|
3898
|
-
children: (d = i.children) == null ? void 0 : d.map(
|
|
3929
|
+
children: (d = i.children) == null ? void 0 : d.map(a)
|
|
3899
3930
|
},
|
|
3900
3931
|
i.key
|
|
3901
3932
|
);
|
|
3902
3933
|
};
|
|
3903
3934
|
return /* @__PURE__ */ t(
|
|
3904
|
-
|
|
3935
|
+
Sn,
|
|
3905
3936
|
{
|
|
3906
|
-
ref:
|
|
3937
|
+
ref: n,
|
|
3907
3938
|
trigger: "click",
|
|
3908
3939
|
overlay: /* @__PURE__ */ t(
|
|
3909
|
-
|
|
3940
|
+
De,
|
|
3910
3941
|
{
|
|
3911
3942
|
className: k(
|
|
3912
3943
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
|
|
@@ -3919,7 +3950,7 @@ const Sa = ({
|
|
|
3919
3950
|
`
|
|
3920
3951
|
),
|
|
3921
3952
|
...o,
|
|
3922
|
-
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(
|
|
3953
|
+
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(De.Divider, { className: "!my-1" }, i.key) : i.type === "submenu" ? s(i) : a(i))
|
|
3923
3954
|
}
|
|
3924
3955
|
),
|
|
3925
3956
|
...o,
|
|
@@ -3927,11 +3958,11 @@ const Sa = ({
|
|
|
3927
3958
|
}
|
|
3928
3959
|
);
|
|
3929
3960
|
});
|
|
3930
|
-
|
|
3931
|
-
const
|
|
3932
|
-
const { editor: o } = Q(),
|
|
3961
|
+
Yt.displayName = "DropdownMenu";
|
|
3962
|
+
const Ea = ({ children: r, ...e }) => {
|
|
3963
|
+
const { editor: o } = Q(), n = () => {
|
|
3933
3964
|
o && o.state.selection instanceof J && (o.commands.deleteSelection(), o.commands.focus());
|
|
3934
|
-
},
|
|
3965
|
+
}, a = () => {
|
|
3935
3966
|
if (o && o.state.selection instanceof J) {
|
|
3936
3967
|
const d = o.state.selection.node, p = o.state.selection.to;
|
|
3937
3968
|
o.chain().insertContentAt(p, {
|
|
@@ -3940,7 +3971,7 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
3940
3971
|
content: d.content.toJSON()
|
|
3941
3972
|
}).focus().run();
|
|
3942
3973
|
}
|
|
3943
|
-
}, s =
|
|
3974
|
+
}, s = je.map((d) => ({
|
|
3944
3975
|
key: `transform-${d.name}`,
|
|
3945
3976
|
icon: /* @__PURE__ */ t(d.icon, { size: 16 }),
|
|
3946
3977
|
label: d.name,
|
|
@@ -3949,35 +3980,35 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
3949
3980
|
},
|
|
3950
3981
|
isActive: d.isActive(o)
|
|
3951
3982
|
}));
|
|
3952
|
-
return /* @__PURE__ */ t(
|
|
3983
|
+
return /* @__PURE__ */ t(Yt, { items: [
|
|
3953
3984
|
{
|
|
3954
3985
|
key: "transform",
|
|
3955
3986
|
type: "submenu",
|
|
3956
|
-
icon: /* @__PURE__ */ t(
|
|
3987
|
+
icon: /* @__PURE__ */ t(No, { size: 16 }),
|
|
3957
3988
|
label: "转换成",
|
|
3958
3989
|
children: s
|
|
3959
3990
|
},
|
|
3960
3991
|
{
|
|
3961
3992
|
key: "duplicate",
|
|
3962
|
-
icon: /* @__PURE__ */ t(
|
|
3993
|
+
icon: /* @__PURE__ */ t(Io, { size: 16 }),
|
|
3963
3994
|
label: "创建副本",
|
|
3964
|
-
onClick:
|
|
3995
|
+
onClick: a
|
|
3965
3996
|
},
|
|
3966
3997
|
{ key: "divider", type: "divider" },
|
|
3967
3998
|
{
|
|
3968
3999
|
key: "delete",
|
|
3969
|
-
icon: /* @__PURE__ */ t(
|
|
4000
|
+
icon: /* @__PURE__ */ t(ut, { size: 16 }),
|
|
3970
4001
|
label: "删除",
|
|
3971
4002
|
className: "text-red-500",
|
|
3972
|
-
onClick:
|
|
4003
|
+
onClick: n
|
|
3973
4004
|
}
|
|
3974
4005
|
], ...e, children: r });
|
|
3975
|
-
},
|
|
4006
|
+
}, $a = () => {
|
|
3976
4007
|
const { editor: r } = Q(), e = (o) => {
|
|
3977
4008
|
if (!r) return;
|
|
3978
|
-
const
|
|
3979
|
-
if (!
|
|
3980
|
-
const
|
|
4009
|
+
const n = o.target.closest(".custom-drag-handle");
|
|
4010
|
+
if (!n) return;
|
|
4011
|
+
const a = n.dataset.nodePos, s = a !== void 0 ? parseInt(n.dataset.nodePos || "0", 10) : a;
|
|
3981
4012
|
s !== void 0 && (r.commands.focus(), r.commands.setNodeSelection(s), r.commands.createParagraphNear() ? r.commands.insertContent("/") : r.chain().insertContentAt(s, {
|
|
3982
4013
|
type: "paragraph",
|
|
3983
4014
|
content: [{ type: "text", text: "/" }]
|
|
@@ -4011,12 +4042,12 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4011
4042
|
variant: "ghost",
|
|
4012
4043
|
className: "w-auto h-auto p-0.5",
|
|
4013
4044
|
onClick: e,
|
|
4014
|
-
children: /* @__PURE__ */ t(
|
|
4045
|
+
children: /* @__PURE__ */ t(So, { className: "cursor-pointer", size: 22 })
|
|
4015
4046
|
}
|
|
4016
4047
|
)
|
|
4017
4048
|
}
|
|
4018
4049
|
),
|
|
4019
|
-
/* @__PURE__ */ t(
|
|
4050
|
+
/* @__PURE__ */ t(Ea, { children: /* @__PURE__ */ t(
|
|
4020
4051
|
me,
|
|
4021
4052
|
{
|
|
4022
4053
|
placement: "bottom",
|
|
@@ -4024,18 +4055,18 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4024
4055
|
"拖动",
|
|
4025
4056
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以移动" })
|
|
4026
4057
|
] }) }),
|
|
4027
|
-
children: /* @__PURE__ */ t(Z, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(
|
|
4058
|
+
children: /* @__PURE__ */ t(Z, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(To, { size: 22 }) })
|
|
4028
4059
|
}
|
|
4029
4060
|
) })
|
|
4030
4061
|
]
|
|
4031
4062
|
}
|
|
4032
4063
|
);
|
|
4033
|
-
},
|
|
4064
|
+
}, Ha = (r) => {
|
|
4034
4065
|
const {
|
|
4035
4066
|
className: e,
|
|
4036
4067
|
initialContent: o = {},
|
|
4037
|
-
onChange:
|
|
4038
|
-
cacheKey:
|
|
4068
|
+
onChange: n,
|
|
4069
|
+
cacheKey: a = "novel-content",
|
|
4039
4070
|
enableCache: s = !1,
|
|
4040
4071
|
showSaveStatus: i = !0,
|
|
4041
4072
|
showWordCount: d = !0,
|
|
@@ -4043,79 +4074,79 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4043
4074
|
editorRef: x,
|
|
4044
4075
|
enableAI: l = !1,
|
|
4045
4076
|
aiOptions: c
|
|
4046
|
-
} = r, [
|
|
4077
|
+
} = r, [f, v] = _(
|
|
4047
4078
|
o
|
|
4048
|
-
), [D, h] =
|
|
4049
|
-
const
|
|
4050
|
-
return
|
|
4051
|
-
|
|
4052
|
-
}), new XMLSerializer().serializeToString(
|
|
4053
|
-
},
|
|
4054
|
-
async (
|
|
4055
|
-
const
|
|
4056
|
-
|
|
4079
|
+
), [D, h] = _("Saved"), [g, S] = _(), [y, I] = _(!1), [u, M] = _(!1), [L, N] = _(!1), [w, H] = _(!1), G = (A) => {
|
|
4080
|
+
const j = new DOMParser().parseFromString(A, "text/html");
|
|
4081
|
+
return j.querySelectorAll("pre code").forEach((E) => {
|
|
4082
|
+
In.highlightElement(E);
|
|
4083
|
+
}), new XMLSerializer().serializeToString(j);
|
|
4084
|
+
}, X = Yr(
|
|
4085
|
+
async (A) => {
|
|
4086
|
+
const j = A.getJSON();
|
|
4087
|
+
S(A.storage.characterCount.words()), n == null || n(j), s && (window.localStorage.setItem(
|
|
4057
4088
|
"html-content",
|
|
4058
|
-
|
|
4059
|
-
), window.localStorage.setItem(
|
|
4089
|
+
G(A.getHTML())
|
|
4090
|
+
), window.localStorage.setItem(a, JSON.stringify(j)), window.localStorage.setItem(
|
|
4060
4091
|
"markdown",
|
|
4061
|
-
|
|
4092
|
+
A.storage.markdown.getMarkdown()
|
|
4062
4093
|
), h("Saved"));
|
|
4063
4094
|
},
|
|
4064
4095
|
500
|
|
4065
4096
|
), se = he(() => {
|
|
4066
|
-
if (!p) return
|
|
4097
|
+
if (!p) return Ra;
|
|
4067
4098
|
const {
|
|
4068
|
-
beforeUpload:
|
|
4069
|
-
maxSize:
|
|
4070
|
-
action:
|
|
4099
|
+
beforeUpload: A,
|
|
4100
|
+
maxSize: j,
|
|
4101
|
+
action: E,
|
|
4071
4102
|
headers: K,
|
|
4072
|
-
method:
|
|
4073
|
-
name:
|
|
4074
|
-
onSuccess:
|
|
4075
|
-
onError:
|
|
4103
|
+
method: ee,
|
|
4104
|
+
name: $e,
|
|
4105
|
+
onSuccess: Se,
|
|
4106
|
+
onError: Te
|
|
4076
4107
|
} = p;
|
|
4077
|
-
return
|
|
4108
|
+
return Nt({
|
|
4078
4109
|
onUpload: (ie) => {
|
|
4079
|
-
const
|
|
4080
|
-
|
|
4081
|
-
const
|
|
4082
|
-
method:
|
|
4110
|
+
const Me = new FormData();
|
|
4111
|
+
Me.append($e || "file", ie);
|
|
4112
|
+
const He = fetch(E, {
|
|
4113
|
+
method: ee || "POST",
|
|
4083
4114
|
headers: {
|
|
4084
4115
|
...K
|
|
4085
4116
|
},
|
|
4086
|
-
body:
|
|
4117
|
+
body: Me
|
|
4087
4118
|
});
|
|
4088
|
-
return new Promise((
|
|
4089
|
-
|
|
4090
|
-
if (
|
|
4091
|
-
const z = await
|
|
4092
|
-
|
|
4119
|
+
return new Promise((xe, C) => {
|
|
4120
|
+
He.then(async (B) => {
|
|
4121
|
+
if (Se) {
|
|
4122
|
+
const z = await B.json();
|
|
4123
|
+
xe(Se(z));
|
|
4093
4124
|
return;
|
|
4094
4125
|
}
|
|
4095
|
-
if (
|
|
4096
|
-
const { url: z } = await
|
|
4097
|
-
|
|
4098
|
-
|
|
4126
|
+
if (B.status === 200) {
|
|
4127
|
+
const { url: z } = await B.json(), T = new Image();
|
|
4128
|
+
T.src = z, T.onload = () => {
|
|
4129
|
+
xe(z);
|
|
4099
4130
|
};
|
|
4100
|
-
} else throw
|
|
4131
|
+
} else throw B.status === 401 ? (xe(ie), new Error(
|
|
4101
4132
|
"`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead."
|
|
4102
4133
|
)) : new Error("Error uploading image. Please try again.");
|
|
4103
|
-
}).catch((
|
|
4104
|
-
|
|
4134
|
+
}).catch((B) => {
|
|
4135
|
+
Te && Te(B), C(B);
|
|
4105
4136
|
});
|
|
4106
4137
|
});
|
|
4107
4138
|
},
|
|
4108
|
-
validateFn: (ie) =>
|
|
4139
|
+
validateFn: (ie) => A ? A(ie) : ie.type.includes("image/") ? j && ie.size > j ? (console.error("File size too big (max 20MB)."), !1) : !0 : (console.error("File type not supported."), !1)
|
|
4109
4140
|
});
|
|
4110
4141
|
}, [p]);
|
|
4111
4142
|
if (ae(() => {
|
|
4112
4143
|
if (!s) return;
|
|
4113
|
-
const
|
|
4114
|
-
v(
|
|
4115
|
-
}, [
|
|
4116
|
-
const
|
|
4117
|
-
...
|
|
4118
|
-
|
|
4144
|
+
const A = window.localStorage.getItem(a);
|
|
4145
|
+
v(A ? JSON.parse(A) : za);
|
|
4146
|
+
}, [a, s]), !f) return null;
|
|
4147
|
+
const re = [
|
|
4148
|
+
...Ot,
|
|
4149
|
+
Ba({
|
|
4119
4150
|
uploadFn: se
|
|
4120
4151
|
})
|
|
4121
4152
|
];
|
|
@@ -4125,131 +4156,131 @@ const Ra = ({ children: r, ...e }) => {
|
|
|
4125
4156
|
d && /* @__PURE__ */ m(
|
|
4126
4157
|
"div",
|
|
4127
4158
|
{
|
|
4128
|
-
className:
|
|
4159
|
+
className: g ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
|
|
4129
4160
|
children: [
|
|
4130
|
-
|
|
4161
|
+
g,
|
|
4131
4162
|
" Words"
|
|
4132
4163
|
]
|
|
4133
4164
|
}
|
|
4134
4165
|
)
|
|
4135
4166
|
] }),
|
|
4136
|
-
/* @__PURE__ */ t(
|
|
4137
|
-
|
|
4167
|
+
/* @__PURE__ */ t($r, { children: /* @__PURE__ */ m(
|
|
4168
|
+
Hr,
|
|
4138
4169
|
{
|
|
4139
|
-
onCreate: ({ editor:
|
|
4140
|
-
x && (x.current =
|
|
4170
|
+
onCreate: ({ editor: A }) => {
|
|
4171
|
+
x && (x.current = A);
|
|
4141
4172
|
},
|
|
4142
|
-
initialContent:
|
|
4143
|
-
extensions:
|
|
4173
|
+
initialContent: f,
|
|
4174
|
+
extensions: re,
|
|
4144
4175
|
className: "relative min-h-[500px] w-full max-w-screen-lg border-muted bg-background sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:shadow-lg editor-content",
|
|
4145
4176
|
editorProps: {
|
|
4146
4177
|
handleDOMEvents: {
|
|
4147
|
-
keydown: (
|
|
4178
|
+
keydown: (A, j) => _r(j)
|
|
4148
4179
|
},
|
|
4149
|
-
handlePaste: (
|
|
4150
|
-
handleDrop: (
|
|
4180
|
+
handlePaste: (A, j) => Fr(A, j, se),
|
|
4181
|
+
handleDrop: (A, j, E, K) => Or(A, j, K, se),
|
|
4151
4182
|
attributes: {
|
|
4152
4183
|
class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
|
|
4153
4184
|
}
|
|
4154
4185
|
},
|
|
4155
|
-
onUpdate: ({ editor:
|
|
4156
|
-
|
|
4186
|
+
onUpdate: ({ editor: A }) => {
|
|
4187
|
+
X(A), h("Unsaved");
|
|
4157
4188
|
},
|
|
4158
|
-
slotAfter: /* @__PURE__ */ t(
|
|
4189
|
+
slotAfter: /* @__PURE__ */ t(qr, {}),
|
|
4159
4190
|
children: [
|
|
4160
|
-
/* @__PURE__ */ m(
|
|
4161
|
-
/* @__PURE__ */ t(
|
|
4162
|
-
/* @__PURE__ */ t(
|
|
4191
|
+
/* @__PURE__ */ m(jr, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
|
|
4192
|
+
/* @__PURE__ */ t(Xr, { className: "px-2 text-muted-foreground", children: "没有结果" }),
|
|
4193
|
+
/* @__PURE__ */ t(Ur, { children: qt({
|
|
4163
4194
|
uploadFn: se
|
|
4164
|
-
}).map((
|
|
4165
|
-
|
|
4195
|
+
}).map((A) => /* @__PURE__ */ m(
|
|
4196
|
+
Gr,
|
|
4166
4197
|
{
|
|
4167
|
-
value:
|
|
4168
|
-
onCommand: (
|
|
4198
|
+
value: A.title,
|
|
4199
|
+
onCommand: (j) => A.command(j),
|
|
4169
4200
|
className: "flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm hover:bg-accent aria-selected:bg-accent",
|
|
4170
4201
|
children: [
|
|
4171
|
-
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children:
|
|
4202
|
+
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: A.icon }),
|
|
4172
4203
|
/* @__PURE__ */ m("div", { children: [
|
|
4173
|
-
/* @__PURE__ */ t("p", { className: "font-medium", children:
|
|
4174
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children:
|
|
4204
|
+
/* @__PURE__ */ t("p", { className: "font-medium", children: A.title }),
|
|
4205
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: A.description })
|
|
4175
4206
|
] })
|
|
4176
4207
|
]
|
|
4177
4208
|
},
|
|
4178
|
-
|
|
4209
|
+
A.title
|
|
4179
4210
|
)) })
|
|
4180
4211
|
] }),
|
|
4181
4212
|
/* @__PURE__ */ m(
|
|
4182
|
-
|
|
4213
|
+
Aa,
|
|
4183
4214
|
{
|
|
4184
|
-
open:
|
|
4185
|
-
onOpenChange:
|
|
4215
|
+
open: w,
|
|
4216
|
+
onOpenChange: H,
|
|
4186
4217
|
enableAI: l,
|
|
4187
4218
|
aiOptions: c,
|
|
4188
4219
|
children: [
|
|
4189
4220
|
l && /* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4190
|
-
/* @__PURE__ */ t(
|
|
4221
|
+
/* @__PURE__ */ t(xa, { open: y, onOpenChange: I }),
|
|
4191
4222
|
/* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4192
|
-
/* @__PURE__ */ t(
|
|
4223
|
+
/* @__PURE__ */ t(ha, { open: L, onOpenChange: N }),
|
|
4193
4224
|
/* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4194
|
-
/* @__PURE__ */ t(
|
|
4225
|
+
/* @__PURE__ */ t(ba, {}),
|
|
4195
4226
|
/* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4196
|
-
/* @__PURE__ */ t(
|
|
4227
|
+
/* @__PURE__ */ t(Pa, {}),
|
|
4197
4228
|
/* @__PURE__ */ t(ge, { orientation: "vertical" }),
|
|
4198
|
-
/* @__PURE__ */ t(
|
|
4229
|
+
/* @__PURE__ */ t(pa, { open: u, onOpenChange: M })
|
|
4199
4230
|
]
|
|
4200
4231
|
}
|
|
4201
4232
|
),
|
|
4202
|
-
/* @__PURE__ */ t(
|
|
4233
|
+
/* @__PURE__ */ t($a, {})
|
|
4203
4234
|
]
|
|
4204
4235
|
}
|
|
4205
4236
|
) })
|
|
4206
4237
|
] });
|
|
4207
|
-
},
|
|
4208
|
-
const e = he(() =>
|
|
4238
|
+
}, Oa = ({ json: r }) => {
|
|
4239
|
+
const e = he(() => Tn(r ?? {}, Ot), [r]);
|
|
4209
4240
|
return /* @__PURE__ */ t("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e } }) });
|
|
4210
|
-
},
|
|
4211
|
-
|
|
4212
|
-
const
|
|
4241
|
+
}, Vt = Ha;
|
|
4242
|
+
Vt.Preview = Oa;
|
|
4243
|
+
const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4213
4244
|
__proto__: null,
|
|
4214
|
-
Desktop:
|
|
4215
|
-
DesktopSortable:
|
|
4216
|
-
DesktopSortableConfigProvider:
|
|
4217
|
-
DesktopSortableStateProvider:
|
|
4218
|
-
Dock:
|
|
4219
|
-
DockDesktop:
|
|
4220
|
-
DockDesktopItem:
|
|
4221
|
-
DockMobile:
|
|
4222
|
-
DockMobileItem:
|
|
4223
|
-
Editor:
|
|
4224
|
-
Markdown:
|
|
4225
|
-
MdEditor:
|
|
4245
|
+
Desktop: Hn,
|
|
4246
|
+
DesktopSortable: Pt,
|
|
4247
|
+
DesktopSortableConfigProvider: Mt,
|
|
4248
|
+
DesktopSortableStateProvider: Dt,
|
|
4249
|
+
Dock: Ie,
|
|
4250
|
+
DockDesktop: Je,
|
|
4251
|
+
DockDesktopItem: Ke,
|
|
4252
|
+
DockMobile: Ze,
|
|
4253
|
+
DockMobileItem: ze,
|
|
4254
|
+
Editor: Vt,
|
|
4255
|
+
Markdown: $t,
|
|
4256
|
+
MdEditor: Ht,
|
|
4226
4257
|
SortableUtils: V,
|
|
4227
|
-
desktopAppConfig:
|
|
4228
|
-
desktopConfigMap:
|
|
4229
|
-
desktopGroupConfig:
|
|
4230
|
-
desktopThemeDark:
|
|
4231
|
-
desktopThemeLight:
|
|
4232
|
-
useDockDesktopMouseX:
|
|
4258
|
+
desktopAppConfig: Ve,
|
|
4259
|
+
desktopConfigMap: Be,
|
|
4260
|
+
desktopGroupConfig: Lt,
|
|
4261
|
+
desktopThemeDark: Ye,
|
|
4262
|
+
desktopThemeLight: qe,
|
|
4263
|
+
useDockDesktopMouseX: ct
|
|
4233
4264
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4234
4265
|
export {
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4266
|
+
Hn as Desktop,
|
|
4267
|
+
Pt as DesktopSortable,
|
|
4268
|
+
Mt as DesktopSortableConfigProvider,
|
|
4269
|
+
Dt as DesktopSortableStateProvider,
|
|
4270
|
+
Ie as Dock,
|
|
4271
|
+
Je as DockDesktop,
|
|
4272
|
+
Ke as DockDesktopItem,
|
|
4273
|
+
Ze as DockMobile,
|
|
4274
|
+
ze as DockMobileItem,
|
|
4275
|
+
Vt as Editor,
|
|
4276
|
+
$t as Markdown,
|
|
4277
|
+
Ht as MdEditor,
|
|
4247
4278
|
V as SortableUtils,
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4279
|
+
As as default,
|
|
4280
|
+
Ve as desktopAppConfig,
|
|
4281
|
+
Be as desktopConfigMap,
|
|
4282
|
+
Lt as desktopGroupConfig,
|
|
4283
|
+
Ye as desktopThemeDark,
|
|
4284
|
+
qe as desktopThemeLight,
|
|
4285
|
+
Ps as useDockDesktopMouseX
|
|
4255
4286
|
};
|