zs_library 0.4.13 → 0.4.14

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