zs_library 0.4.14 → 0.4.15
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.d.ts +2 -2
- package/dist/index.js +211 -205
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Desktop, DesktopSortable, DesktopSortableConfigProvider, DesktopSortableStateProvider, desktopAppConfig, desktopGroupConfig, desktopConfigMap, desktopThemeLight, desktopThemeDark, SortableUtils, MdEditor, Markdown,
|
|
2
|
-
export type { DesktopSortableProps, DesktopSortableConfigProviderProps, DesktopSortableStateProviderProps, DesktopSortItemBaseConfig, DesktopSortItem, DesktopSortItemBaseData, DesktopTheme, } from './components';
|
|
1
|
+
export { Desktop, DesktopSortable, DesktopSortableConfigProvider, DesktopSortableStateProvider, desktopAppConfig, desktopGroupConfig, desktopConfigMap, desktopThemeLight, desktopThemeDark, SortableUtils, Dock, DockDesktop, DockDesktopItem, DockMobile, DockMobileItem, useDockDesktopMouseX, MdEditor, Markdown, Editor, } from './components';
|
|
2
|
+
export type { DesktopSortableProps, DesktopSortableConfigProviderProps, DesktopSortableStateProviderProps, DesktopSortItemBaseConfig, DesktopSortItem, DesktopSortItemBaseData, DesktopTheme, DockDesktopItemProps, DockMobileItemProps, } from './components';
|
|
3
3
|
import * as Components from "./components";
|
|
4
4
|
export default Components;
|
package/dist/index.js
CHANGED
|
@@ -7,14 +7,15 @@ import { initReactI18next as Wt } from "react-i18next";
|
|
|
7
7
|
import { jsx as t, jsxs as m, Fragment as me } from "react/jsx-runtime";
|
|
8
8
|
import { cx as y, css as g } from "@emotion/css";
|
|
9
9
|
import * as G from "react";
|
|
10
|
-
import { createContext as ot, useMemo as fe, useContext as rt, useState as H, useRef as he, useEffect as
|
|
10
|
+
import { createContext as ot, useMemo as fe, useContext as rt, useState as H, useRef as he, useEffect as ie, Fragment as Kt, forwardRef as Jt } from "react";
|
|
11
11
|
import Zt from "react-slick";
|
|
12
12
|
import { ReactSortable as $e } from "react-sortablejs";
|
|
13
13
|
import { AnimatePresence as He, motion as D, useMotionValue as nt, useTransform as xe, useSpring as Te } from "framer-motion";
|
|
14
|
+
import { useMotionValue as Ms } from "framer-motion";
|
|
14
15
|
import { useLocalStorageState as Qt, useDebounceEffect as eo } from "ahooks";
|
|
15
16
|
import { v4 as Je } from "uuid";
|
|
16
17
|
import at from "rc-tooltip";
|
|
17
|
-
import { RiPencilRuler2Line as to, RiShareLine as oo, RiInformationLine as ro, RiCloseCircleLine as no, RiArrowUpDownLine as ao, RiArrowLeftRightLine as
|
|
18
|
+
import { RiPencilRuler2Line as to, RiShareLine as oo, RiInformationLine as ro, RiCloseCircleLine as no, RiArrowUpDownLine as ao, RiArrowLeftRightLine as so, RiArrowRightLine as io, RiArrowLeftLine as lo, RiCloseLine as co, RiZoomOutLine as mo, RiZoomInLine as uo, RiClockwise2Line as po, RiAnticlockwise2Line as go, RiMoreLine as fo, RiArrowDropDownLine as st, RiCheckLine as ye, RiLink as ho, RiDeleteBinLine as it, 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
19
|
import bt from "rc-dialog";
|
|
19
20
|
import wo from "react-json-view";
|
|
20
21
|
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";
|
|
@@ -26,8 +27,8 @@ import { Prism as or } from "react-syntax-highlighter";
|
|
|
26
27
|
import { oneLight as rr } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
27
28
|
import nr from "rc-image";
|
|
28
29
|
import { clsx as ar } from "clsx";
|
|
29
|
-
import { twMerge as
|
|
30
|
-
import { Placeholder as
|
|
30
|
+
import { twMerge as sr } from "tailwind-merge";
|
|
31
|
+
import { Placeholder as ir, 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
32
|
import { useDebouncedCallback as jr } from "use-debounce";
|
|
32
33
|
import { Markdown as Xr } from "tiptap-markdown";
|
|
33
34
|
import { cx as q, cva as Ur } from "class-variance-authority";
|
|
@@ -56,8 +57,8 @@ function wn(r, e) {
|
|
|
56
57
|
if (typeof a != "string" && !Array.isArray(a)) {
|
|
57
58
|
for (const n in a)
|
|
58
59
|
if (n !== "default" && !(n in r)) {
|
|
59
|
-
const
|
|
60
|
-
|
|
60
|
+
const s = Object.getOwnPropertyDescriptor(a, n);
|
|
61
|
+
s && Object.defineProperty(r, n, s.get ? s : {
|
|
61
62
|
enumerable: !0,
|
|
62
63
|
get: () => a[n]
|
|
63
64
|
});
|
|
@@ -172,9 +173,9 @@ const Fe = {
|
|
|
172
173
|
class Y {
|
|
173
174
|
}
|
|
174
175
|
/** 清理重复id */
|
|
175
|
-
Se(Y, "uniqueArray", (e) => e.reduce((o, a) => o.find((
|
|
176
|
-
const o = Fe.token, a = _e.token, n = { ...o, ...e == null ? void 0 : e.token },
|
|
177
|
-
return { light: n, dark:
|
|
176
|
+
Se(Y, "uniqueArray", (e) => e.reduce((o, a) => o.find((s) => s.id === a.id) ? o : o.concat([a]), [])), Se(Y, "getTheme", (e) => {
|
|
177
|
+
const o = Fe.token, a = _e.token, n = { ...o, ...e == null ? void 0 : e.token }, s = { ...a, ...e == null ? void 0 : e.token };
|
|
178
|
+
return { light: n, dark: s };
|
|
178
179
|
}), Se(Y, "quickJSONCheck", (e) => {
|
|
179
180
|
if (typeof e != "string" || e.trim() === "") return !1;
|
|
180
181
|
if (!/^\s*(\{.*\}|\[.*\])\s*$/.test(e))
|
|
@@ -226,8 +227,8 @@ const It = ot({
|
|
|
226
227
|
list: o = [],
|
|
227
228
|
onChange: a,
|
|
228
229
|
storageKey: n = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
229
|
-
enableCaching:
|
|
230
|
-
} = r, [
|
|
230
|
+
enableCaching: s = !0
|
|
231
|
+
} = r, [i, c] = H(), [p, k] = H(), [l, d] = H(null), b = he(l), [x, A] = H(null), [f, h] = H([]), [w, v] = H(
|
|
231
232
|
null
|
|
232
233
|
), [I, u] = H(
|
|
233
234
|
null
|
|
@@ -237,9 +238,9 @@ const It = ot({
|
|
|
237
238
|
defaultValue: [],
|
|
238
239
|
listenStorageChange: !0
|
|
239
240
|
}), O = () => {
|
|
240
|
-
A(null), clearTimeout(
|
|
241
|
+
A(null), clearTimeout(i), c(void 0), b.current = null;
|
|
241
242
|
}, B = (M, U) => {
|
|
242
|
-
A({ ...M, pageX: M.pageX, pageY: M.pageY, data: U }), clearTimeout(
|
|
243
|
+
A({ ...M, pageX: M.pageX, pageY: M.pageY, data: U }), clearTimeout(i);
|
|
243
244
|
}, W = (M, U = !0) => {
|
|
244
245
|
const { config: F = {} } = M;
|
|
245
246
|
return F.allowContextMenu === !1 ? {} : {
|
|
@@ -255,7 +256,7 @@ const It = ot({
|
|
|
255
256
|
);
|
|
256
257
|
},
|
|
257
258
|
onMouseUp: () => {
|
|
258
|
-
clearTimeout(p), k(void 0), clearTimeout(
|
|
259
|
+
clearTimeout(p), k(void 0), clearTimeout(i), c(void 0);
|
|
259
260
|
},
|
|
260
261
|
onContextMenu: (E) => {
|
|
261
262
|
U && (E.preventDefault(), B(E, M));
|
|
@@ -328,7 +329,7 @@ const It = ot({
|
|
|
328
329
|
};
|
|
329
330
|
return E(F), a == null || a(F), F;
|
|
330
331
|
});
|
|
331
|
-
},
|
|
332
|
+
}, se = (M, U) => {
|
|
332
333
|
const F = [...f], E = (P, z) => {
|
|
333
334
|
const L = z.shift(), $ = P.find((ee) => ee.id === L), j = P.findIndex((ee) => ee.id === L);
|
|
334
335
|
if ($) {
|
|
@@ -351,17 +352,17 @@ const It = ot({
|
|
|
351
352
|
};
|
|
352
353
|
h(E(F, U));
|
|
353
354
|
};
|
|
354
|
-
return
|
|
355
|
+
return ie(() => {
|
|
355
356
|
(o == null ? void 0 : o.length) > 0 && f.length === 0 && re(o);
|
|
356
|
-
}, [o]),
|
|
357
|
+
}, [o]), ie(() => {
|
|
357
358
|
b.current = l, l !== null && O();
|
|
358
|
-
}, [l]),
|
|
359
|
-
|
|
360
|
-
}, [oe, _,
|
|
359
|
+
}, [l]), ie(() => {
|
|
360
|
+
s && oe != null && oe.length && !_ && (re(oe), ae(!0));
|
|
361
|
+
}, [oe, _, s]), eo(
|
|
361
362
|
() => {
|
|
362
|
-
|
|
363
|
+
s && S(f);
|
|
363
364
|
},
|
|
364
|
-
[f,
|
|
365
|
+
[f, s],
|
|
365
366
|
{
|
|
366
367
|
wait: 1e3
|
|
367
368
|
}
|
|
@@ -385,7 +386,7 @@ const It = ot({
|
|
|
385
386
|
updateItemConfig: Pe,
|
|
386
387
|
updateItem: Ne,
|
|
387
388
|
removeItem: Ie,
|
|
388
|
-
addItem:
|
|
389
|
+
addItem: se,
|
|
389
390
|
moveItemId: N,
|
|
390
391
|
setMoveItemId: C,
|
|
391
392
|
moveTargetId: X,
|
|
@@ -402,15 +403,15 @@ const It = ot({
|
|
|
402
403
|
},
|
|
403
404
|
menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
|
|
404
405
|
}, Be = (r) => {
|
|
405
|
-
const { icon: e, title: o, onClick: a } = r, { theme: n } = ue(), { light:
|
|
406
|
+
const { icon: e, title: o, onClick: a } = r, { theme: n } = ue(), { light: s, dark: i } = Y.getTheme(n);
|
|
406
407
|
return /* @__PURE__ */ t(
|
|
407
408
|
D.div,
|
|
408
409
|
{
|
|
409
410
|
className: g`
|
|
410
411
|
&:hover {
|
|
411
|
-
background-color: ${
|
|
412
|
+
background-color: ${s.contextMenuActiveColor};
|
|
412
413
|
@media (prefers-color-scheme: dark) {
|
|
413
|
-
background-color: ${
|
|
414
|
+
background-color: ${i.contextMenuActiveColor};
|
|
414
415
|
}
|
|
415
416
|
}
|
|
416
417
|
@media (prefers-color-scheme: dark) {
|
|
@@ -467,8 +468,8 @@ const It = ot({
|
|
|
467
468
|
showRemoveButton: o = !0,
|
|
468
469
|
showShareButton: a = !0,
|
|
469
470
|
showSizeButton: n = !0,
|
|
470
|
-
onInfoClick:
|
|
471
|
-
onShareClick:
|
|
471
|
+
onInfoClick: s,
|
|
472
|
+
onShareClick: i,
|
|
472
473
|
onRemoveClick: c
|
|
473
474
|
} = r, {
|
|
474
475
|
contextMenu: p,
|
|
@@ -648,8 +649,8 @@ const It = ot({
|
|
|
648
649
|
icon: /* @__PURE__ */ t(oo, { size: 20 }),
|
|
649
650
|
title: "分享",
|
|
650
651
|
onClick: () => {
|
|
651
|
-
if (
|
|
652
|
-
|
|
652
|
+
if (i) {
|
|
653
|
+
i(p.data);
|
|
653
654
|
return;
|
|
654
655
|
}
|
|
655
656
|
}
|
|
@@ -661,8 +662,8 @@ const It = ot({
|
|
|
661
662
|
icon: /* @__PURE__ */ t(ro, { size: 20 }),
|
|
662
663
|
title: "信息",
|
|
663
664
|
onClick: () => {
|
|
664
|
-
if (
|
|
665
|
-
|
|
665
|
+
if (s) {
|
|
666
|
+
s(p.data);
|
|
666
667
|
return;
|
|
667
668
|
}
|
|
668
669
|
d({
|
|
@@ -694,7 +695,7 @@ const It = ot({
|
|
|
694
695
|
}
|
|
695
696
|
) });
|
|
696
697
|
}, Ln = (r) => {
|
|
697
|
-
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: a } = be(), { itemIconBuilder: n, theme:
|
|
698
|
+
const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: a } = be(), { itemIconBuilder: n, theme: s, contextMenu: i } = ue(), { light: c, dark: p } = Y.getTheme(s), { data: k = {} } = e, { name: l } = k;
|
|
698
699
|
return /* @__PURE__ */ m(me, { children: [
|
|
699
700
|
/* @__PURE__ */ t(
|
|
700
701
|
D.div,
|
|
@@ -728,7 +729,7 @@ const It = ot({
|
|
|
728
729
|
color: ${p.itemNameColor};
|
|
729
730
|
}
|
|
730
731
|
`,
|
|
731
|
-
...a(e,
|
|
732
|
+
...a(e, i !== !1),
|
|
732
733
|
children: n == null ? void 0 : n(e)
|
|
733
734
|
}
|
|
734
735
|
)
|
|
@@ -761,8 +762,8 @@ const It = ot({
|
|
|
761
762
|
className: o,
|
|
762
763
|
itemIndex: a,
|
|
763
764
|
onClick: n,
|
|
764
|
-
disabledDrag:
|
|
765
|
-
children:
|
|
765
|
+
disabledDrag: s = !1,
|
|
766
|
+
children: i,
|
|
766
767
|
parentIds: c,
|
|
767
768
|
childrenLength: p
|
|
768
769
|
} = r, { contextMenu: k, setContextMenu: l } = be(), { contextMenu: d } = ue();
|
|
@@ -792,8 +793,8 @@ const It = ot({
|
|
|
792
793
|
"data-parent-ids": c == null ? void 0 : c.join(","),
|
|
793
794
|
"data-children-length": p,
|
|
794
795
|
onClick: () => n == null ? void 0 : n(e),
|
|
795
|
-
className: y(
|
|
796
|
-
children:
|
|
796
|
+
className: y(s && "drag-disabled", o),
|
|
797
|
+
children: i ?? /* @__PURE__ */ t(Ln, { ...r })
|
|
797
798
|
}
|
|
798
799
|
)
|
|
799
800
|
}
|
|
@@ -804,8 +805,8 @@ const It = ot({
|
|
|
804
805
|
className: o,
|
|
805
806
|
parentIds: a,
|
|
806
807
|
itemIndex: n,
|
|
807
|
-
onClick:
|
|
808
|
-
noLetters:
|
|
808
|
+
onClick: s,
|
|
809
|
+
noLetters: i = !1
|
|
809
810
|
} = r, {
|
|
810
811
|
contextMenuFuns: c,
|
|
811
812
|
setList: p,
|
|
@@ -850,7 +851,7 @@ const It = ot({
|
|
|
850
851
|
`
|
|
851
852
|
),
|
|
852
853
|
onClick: (B) => {
|
|
853
|
-
B.stopPropagation(),
|
|
854
|
+
B.stopPropagation(), s == null || s(e);
|
|
854
855
|
},
|
|
855
856
|
children: f == null ? void 0 : f(e)
|
|
856
857
|
}
|
|
@@ -881,7 +882,7 @@ const It = ot({
|
|
|
881
882
|
`
|
|
882
883
|
),
|
|
883
884
|
onClick: (W) => {
|
|
884
|
-
W.stopPropagation(),
|
|
885
|
+
W.stopPropagation(), s == null || s(B);
|
|
885
886
|
},
|
|
886
887
|
children: f == null ? void 0 : f(B)
|
|
887
888
|
},
|
|
@@ -923,7 +924,7 @@ const It = ot({
|
|
|
923
924
|
`
|
|
924
925
|
),
|
|
925
926
|
onClick: (re) => {
|
|
926
|
-
W > 2 || (re.stopPropagation(),
|
|
927
|
+
W > 2 || (re.stopPropagation(), s == null || s(B));
|
|
927
928
|
},
|
|
928
929
|
children: f == null ? void 0 : f(B)
|
|
929
930
|
},
|
|
@@ -964,7 +965,7 @@ const It = ot({
|
|
|
964
965
|
`
|
|
965
966
|
),
|
|
966
967
|
onClick: (re) => {
|
|
967
|
-
W > 2 || (re.stopPropagation(),
|
|
968
|
+
W > 2 || (re.stopPropagation(), s == null || s(B));
|
|
968
969
|
},
|
|
969
970
|
children: f == null ? void 0 : f(B)
|
|
970
971
|
},
|
|
@@ -1077,7 +1078,7 @@ const It = ot({
|
|
|
1077
1078
|
color: ${I.itemNameColor};
|
|
1078
1079
|
}
|
|
1079
1080
|
`,
|
|
1080
|
-
|
|
1081
|
+
i && g`
|
|
1081
1082
|
color: transparent;
|
|
1082
1083
|
`
|
|
1083
1084
|
),
|
|
@@ -1104,13 +1105,13 @@ const It = ot({
|
|
|
1104
1105
|
`, Dn = (r) => {
|
|
1105
1106
|
const { data: e, onClose: o, onItemClick: a } = r, {
|
|
1106
1107
|
list: n,
|
|
1107
|
-
setList:
|
|
1108
|
-
setListStatus:
|
|
1108
|
+
setList: s,
|
|
1109
|
+
setListStatus: i,
|
|
1109
1110
|
setMoveItemId: c,
|
|
1110
1111
|
setMoveTargetId: p,
|
|
1111
1112
|
updateItem: k
|
|
1112
1113
|
} = be(), { theme: l } = ue(), { light: d, dark: b } = Y.getTheme(l), [x, A] = H("文件夹"), f = [...(e == null ? void 0 : e.children) ?? []];
|
|
1113
|
-
return
|
|
1114
|
+
return ie(() => {
|
|
1114
1115
|
var h;
|
|
1115
1116
|
e && A((h = e.data) == null ? void 0 : h.name);
|
|
1116
1117
|
}, [e]), /* @__PURE__ */ t(
|
|
@@ -1218,15 +1219,15 @@ const It = ot({
|
|
|
1218
1219
|
setList: (h) => {
|
|
1219
1220
|
var I, u;
|
|
1220
1221
|
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) ||
|
|
1222
|
+
w.length === (v == null ? void 0 : v.length) && w.every((T, R) => T === v[R]) || w.length < ((v == null ? void 0 : v.length) ?? 0) || s(h, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
|
|
1222
1223
|
},
|
|
1223
|
-
onMove: () => (p(null),
|
|
1224
|
+
onMove: () => (p(null), i("onMove"), !0),
|
|
1224
1225
|
onStart: (h) => {
|
|
1225
1226
|
const w = h.item.dataset;
|
|
1226
|
-
w != null && w.id && c(w.id),
|
|
1227
|
+
w != null && w.id && c(w.id), i("onMove");
|
|
1227
1228
|
},
|
|
1228
1229
|
onEnd: () => {
|
|
1229
|
-
c(null), p(null),
|
|
1230
|
+
c(null), p(null), i(null);
|
|
1230
1231
|
},
|
|
1231
1232
|
ghostClass: Tt,
|
|
1232
1233
|
children: f.map((h, w) => /* @__PURE__ */ t(
|
|
@@ -1274,8 +1275,8 @@ const It = ot({
|
|
|
1274
1275
|
className: o,
|
|
1275
1276
|
sliderProps: a,
|
|
1276
1277
|
sliderRef: n,
|
|
1277
|
-
onItemClick:
|
|
1278
|
-
} = r,
|
|
1278
|
+
onItemClick: s
|
|
1279
|
+
} = r, i = he(null), c = he(null), {
|
|
1279
1280
|
list: p,
|
|
1280
1281
|
setList: k,
|
|
1281
1282
|
setListStatus: l,
|
|
@@ -1342,7 +1343,7 @@ const It = ot({
|
|
|
1342
1343
|
useCSS: !0,
|
|
1343
1344
|
useTransform: !0,
|
|
1344
1345
|
arrows: !1,
|
|
1345
|
-
ref: n ??
|
|
1346
|
+
ref: n ?? i,
|
|
1346
1347
|
infinite: !1,
|
|
1347
1348
|
dots: !0,
|
|
1348
1349
|
touchMove: !1,
|
|
@@ -1374,7 +1375,7 @@ const It = ot({
|
|
|
1374
1375
|
{
|
|
1375
1376
|
onDragEnter: () => {
|
|
1376
1377
|
var X;
|
|
1377
|
-
(X = (n ??
|
|
1378
|
+
(X = (n ?? i).current) == null || X.slickGoTo(R);
|
|
1378
1379
|
},
|
|
1379
1380
|
children: (C = (N = p[R]) == null ? void 0 : N.data) == null ? void 0 : C.name
|
|
1380
1381
|
}
|
|
@@ -1475,7 +1476,7 @@ const It = ot({
|
|
|
1475
1476
|
data: N,
|
|
1476
1477
|
itemIndex: C,
|
|
1477
1478
|
parentIds: [R.id, N.id],
|
|
1478
|
-
onClick:
|
|
1479
|
+
onClick: s
|
|
1479
1480
|
},
|
|
1480
1481
|
N.id
|
|
1481
1482
|
);
|
|
@@ -1486,7 +1487,7 @@ const It = ot({
|
|
|
1486
1487
|
{
|
|
1487
1488
|
data: N,
|
|
1488
1489
|
itemIndex: C,
|
|
1489
|
-
onClick:
|
|
1490
|
+
onClick: s
|
|
1490
1491
|
},
|
|
1491
1492
|
N.id
|
|
1492
1493
|
);
|
|
@@ -1517,7 +1518,7 @@ const It = ot({
|
|
|
1517
1518
|
onClose: () => {
|
|
1518
1519
|
A(null);
|
|
1519
1520
|
},
|
|
1520
|
-
onItemClick:
|
|
1521
|
+
onItemClick: s
|
|
1521
1522
|
}
|
|
1522
1523
|
)
|
|
1523
1524
|
] });
|
|
@@ -1527,8 +1528,8 @@ const It = ot({
|
|
|
1527
1528
|
onChange: o,
|
|
1528
1529
|
storageKey: a,
|
|
1529
1530
|
enableCaching: n,
|
|
1530
|
-
theme:
|
|
1531
|
-
noLetters:
|
|
1531
|
+
theme: s,
|
|
1532
|
+
noLetters: i,
|
|
1532
1533
|
contextMenu: c,
|
|
1533
1534
|
contextMenuBuilder: p,
|
|
1534
1535
|
itemBuilder: k,
|
|
@@ -1543,8 +1544,8 @@ const It = ot({
|
|
|
1543
1544
|
storageKey: a,
|
|
1544
1545
|
enableCaching: n
|
|
1545
1546
|
}, children: /* @__PURE__ */ t(wt, { ...{
|
|
1546
|
-
theme:
|
|
1547
|
-
noLetters:
|
|
1547
|
+
theme: s,
|
|
1548
|
+
noLetters: i,
|
|
1548
1549
|
contextMenu: c,
|
|
1549
1550
|
pagingDotsBuilder: b,
|
|
1550
1551
|
pagingDotBuilder: d,
|
|
@@ -1671,10 +1672,10 @@ const It = ot({
|
|
|
1671
1672
|
}
|
|
1672
1673
|
}, zn = (r, e, o) => {
|
|
1673
1674
|
const n = r.split(".").reduce(
|
|
1674
|
-
(
|
|
1675
|
+
(s, i) => typeof s == "string" ? s : s[i],
|
|
1675
1676
|
Bn
|
|
1676
1677
|
);
|
|
1677
|
-
return typeof n != "string" ? e : o ? n.replace(/{{(.*?)}}/g, (
|
|
1678
|
+
return typeof n != "string" ? e : o ? n.replace(/{{(.*?)}}/g, (s, i) => o[i]) : n;
|
|
1678
1679
|
}, En = g`
|
|
1679
1680
|
--accentBase: var(--tomato-1);
|
|
1680
1681
|
--accentBgSubtle: var(--tomato-2);
|
|
@@ -1941,8 +1942,8 @@ const It = ot({
|
|
|
1941
1942
|
onChange: o,
|
|
1942
1943
|
translation: a,
|
|
1943
1944
|
pluginConfig: n,
|
|
1944
|
-
className:
|
|
1945
|
-
theme:
|
|
1945
|
+
className: s,
|
|
1946
|
+
theme: i = "auto",
|
|
1946
1947
|
...c
|
|
1947
1948
|
} = r, p = he(null), {
|
|
1948
1949
|
image: k,
|
|
@@ -1965,7 +1966,7 @@ const It = ot({
|
|
|
1965
1966
|
directiveDescriptors: [No]
|
|
1966
1967
|
}
|
|
1967
1968
|
} = n ?? {}, [h, w] = H("");
|
|
1968
|
-
return
|
|
1969
|
+
return ie(() => {
|
|
1969
1970
|
var v;
|
|
1970
1971
|
e !== void 0 && p.current && ((v = p.current) == null || v.setMarkdown(e), w(e));
|
|
1971
1972
|
}, [e, p]), /* @__PURE__ */ t(
|
|
@@ -1974,9 +1975,9 @@ const It = ot({
|
|
|
1974
1975
|
ref: p,
|
|
1975
1976
|
className: y(
|
|
1976
1977
|
$n,
|
|
1977
|
-
ze(
|
|
1978
|
-
ze(
|
|
1979
|
-
|
|
1978
|
+
ze(i) ? En : "",
|
|
1979
|
+
ze(i) ? Dt : At,
|
|
1980
|
+
s
|
|
1980
1981
|
),
|
|
1981
1982
|
contentEditableClassName: Lt,
|
|
1982
1983
|
markdown: h,
|
|
@@ -2038,26 +2039,26 @@ const It = ot({
|
|
|
2038
2039
|
remarkPlugins: [Qo, er],
|
|
2039
2040
|
rehypePlugins: [tr],
|
|
2040
2041
|
components: {
|
|
2041
|
-
code(
|
|
2042
|
-
const { children:
|
|
2042
|
+
code(s) {
|
|
2043
|
+
const { children: i, className: c, node: p, ref: k, ...l } = s, d = /language-(\w+)/.exec(c || "");
|
|
2043
2044
|
return d ? /* @__PURE__ */ t(
|
|
2044
2045
|
or,
|
|
2045
2046
|
{
|
|
2046
2047
|
...l,
|
|
2047
2048
|
PreTag: "div",
|
|
2048
|
-
children: String(
|
|
2049
|
+
children: String(i).replace(/\n$/, ""),
|
|
2049
2050
|
language: d[1],
|
|
2050
2051
|
style: rr
|
|
2051
2052
|
}
|
|
2052
|
-
) : /* @__PURE__ */ t("code", { ...l, className: c, children:
|
|
2053
|
+
) : /* @__PURE__ */ t("code", { ...l, className: c, children: i });
|
|
2053
2054
|
},
|
|
2054
|
-
img(
|
|
2055
|
-
const { preview:
|
|
2055
|
+
img(s) {
|
|
2056
|
+
const { preview: i, ...c } = n ?? {};
|
|
2056
2057
|
return /* @__PURE__ */ t(
|
|
2057
2058
|
nr,
|
|
2058
2059
|
{
|
|
2059
|
-
...
|
|
2060
|
-
preview:
|
|
2060
|
+
...s,
|
|
2061
|
+
preview: i instanceof Boolean ? i : {
|
|
2061
2062
|
icons: {
|
|
2062
2063
|
rotateLeft: /* @__PURE__ */ t(go, {}),
|
|
2063
2064
|
rotateRight: /* @__PURE__ */ t(po, {}),
|
|
@@ -2065,13 +2066,13 @@ const It = ot({
|
|
|
2065
2066
|
zoomOut: /* @__PURE__ */ t(mo, {}),
|
|
2066
2067
|
close: /* @__PURE__ */ t(co, {}),
|
|
2067
2068
|
left: /* @__PURE__ */ t(lo, {}),
|
|
2068
|
-
right: /* @__PURE__ */ t(
|
|
2069
|
-
flipX: /* @__PURE__ */ t(
|
|
2069
|
+
right: /* @__PURE__ */ t(io, {}),
|
|
2070
|
+
flipX: /* @__PURE__ */ t(so, {}),
|
|
2070
2071
|
flipY: /* @__PURE__ */ t(ao, {})
|
|
2071
2072
|
},
|
|
2072
2073
|
zIndex: 9999,
|
|
2073
2074
|
mask: " ",
|
|
2074
|
-
...
|
|
2075
|
+
...i
|
|
2075
2076
|
},
|
|
2076
2077
|
className: g`
|
|
2077
2078
|
cursor: zoom-in;
|
|
@@ -2089,12 +2090,12 @@ const It = ot({
|
|
|
2089
2090
|
}, Pt = Hn;
|
|
2090
2091
|
Pt.Preview = Rt;
|
|
2091
2092
|
function Bt(...r) {
|
|
2092
|
-
return
|
|
2093
|
+
return sr(ar(r));
|
|
2093
2094
|
}
|
|
2094
2095
|
const Ge = (r) => {
|
|
2095
|
-
const { mouseX: e, title: o, icon: a, href: n, children:
|
|
2096
|
+
const { mouseX: e, title: o, icon: a, href: n, children: s } = r, i = he(null), c = xe(e, (v) => {
|
|
2096
2097
|
var u;
|
|
2097
|
-
const I = ((u =
|
|
2098
|
+
const I = ((u = i.current) == null ? void 0 : u.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
2098
2099
|
return v - I.x - I.width / 2;
|
|
2099
2100
|
}), p = xe(c, [-150, 0, 150], [40, 80, 40]), k = xe(c, [-150, 0, 150], [40, 80, 40]), l = xe(
|
|
2100
2101
|
c,
|
|
@@ -2124,7 +2125,7 @@ const Ge = (r) => {
|
|
|
2124
2125
|
return /* @__PURE__ */ t("a", { href: n, children: /* @__PURE__ */ m(
|
|
2125
2126
|
D.div,
|
|
2126
2127
|
{
|
|
2127
|
-
ref:
|
|
2128
|
+
ref: i,
|
|
2128
2129
|
style: { width: b, height: x },
|
|
2129
2130
|
onMouseEnter: () => w(!0),
|
|
2130
2131
|
onMouseLeave: () => w(!1),
|
|
@@ -2146,7 +2147,7 @@ const Ge = (r) => {
|
|
|
2146
2147
|
{
|
|
2147
2148
|
style: { width: A, height: f },
|
|
2148
2149
|
className: "flex items-center justify-center",
|
|
2149
|
-
children:
|
|
2150
|
+
children: s || a
|
|
2150
2151
|
}
|
|
2151
2152
|
)
|
|
2152
2153
|
]
|
|
@@ -2158,8 +2159,8 @@ const Ge = (r) => {
|
|
|
2158
2159
|
className: o,
|
|
2159
2160
|
itemBuilder: a,
|
|
2160
2161
|
children: n,
|
|
2161
|
-
mouseX:
|
|
2162
|
-
} = r,
|
|
2162
|
+
mouseX: s
|
|
2163
|
+
} = r, i = nt(1 / 0), c = s ?? i;
|
|
2163
2164
|
return /* @__PURE__ */ t(
|
|
2164
2165
|
D.div,
|
|
2165
2166
|
{
|
|
@@ -2175,7 +2176,7 @@ const Ge = (r) => {
|
|
|
2175
2176
|
}
|
|
2176
2177
|
);
|
|
2177
2178
|
}, De = (r) => {
|
|
2178
|
-
const { title: e, icon: o, href: a, index: n, totalItems:
|
|
2179
|
+
const { title: e, icon: o, href: a, index: n, totalItems: s, children: i } = r;
|
|
2179
2180
|
return /* @__PURE__ */ t(
|
|
2180
2181
|
D.div,
|
|
2181
2182
|
{
|
|
@@ -2191,8 +2192,8 @@ const Ge = (r) => {
|
|
|
2191
2192
|
delay: n * 0.05
|
|
2192
2193
|
}
|
|
2193
2194
|
},
|
|
2194
|
-
transition: { delay: (
|
|
2195
|
-
children:
|
|
2195
|
+
transition: { delay: (s - 1 - n) * 0.05 },
|
|
2196
|
+
children: i || /* @__PURE__ */ t(
|
|
2196
2197
|
"a",
|
|
2197
2198
|
{
|
|
2198
2199
|
href: a,
|
|
@@ -2209,8 +2210,8 @@ const Ge = (r) => {
|
|
|
2209
2210
|
className: o,
|
|
2210
2211
|
collapseIcon: a,
|
|
2211
2212
|
autoHidden: n = !1,
|
|
2212
|
-
itemBuilder:
|
|
2213
|
-
children:
|
|
2213
|
+
itemBuilder: s,
|
|
2214
|
+
children: i
|
|
2214
2215
|
} = r, [c, p] = H(!1), k = () => {
|
|
2215
2216
|
p(!c);
|
|
2216
2217
|
};
|
|
@@ -2224,14 +2225,14 @@ const Ge = (r) => {
|
|
|
2224
2225
|
{
|
|
2225
2226
|
layoutId: "nav",
|
|
2226
2227
|
className: "absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",
|
|
2227
|
-
children:
|
|
2228
|
-
(l, d) =>
|
|
2228
|
+
children: i || e.map(
|
|
2229
|
+
(l, d) => s ? /* @__PURE__ */ t(
|
|
2229
2230
|
De,
|
|
2230
2231
|
{
|
|
2231
2232
|
...l,
|
|
2232
2233
|
index: d,
|
|
2233
2234
|
totalItems: e.length,
|
|
2234
|
-
children:
|
|
2235
|
+
children: s(l, d, e)
|
|
2235
2236
|
},
|
|
2236
2237
|
l.title
|
|
2237
2238
|
) : /* @__PURE__ */ t(
|
|
@@ -2263,8 +2264,8 @@ const Ge = (r) => {
|
|
|
2263
2264
|
desktopClassName: o,
|
|
2264
2265
|
mobileClassName: a,
|
|
2265
2266
|
desktopItemBuilder: n,
|
|
2266
|
-
mobileItemBuilder:
|
|
2267
|
-
desktopChildren:
|
|
2267
|
+
mobileItemBuilder: s,
|
|
2268
|
+
desktopChildren: i,
|
|
2268
2269
|
mobileChildren: c,
|
|
2269
2270
|
desktopMouseX: p,
|
|
2270
2271
|
...k
|
|
@@ -2276,7 +2277,7 @@ const Ge = (r) => {
|
|
|
2276
2277
|
items: e,
|
|
2277
2278
|
className: o,
|
|
2278
2279
|
itemBuilder: n,
|
|
2279
|
-
children:
|
|
2280
|
+
children: i,
|
|
2280
2281
|
mouseX: p,
|
|
2281
2282
|
...k
|
|
2282
2283
|
}
|
|
@@ -2286,7 +2287,7 @@ const Ge = (r) => {
|
|
|
2286
2287
|
{
|
|
2287
2288
|
items: e,
|
|
2288
2289
|
className: a,
|
|
2289
|
-
itemBuilder:
|
|
2290
|
+
itemBuilder: s,
|
|
2290
2291
|
children: c,
|
|
2291
2292
|
autoHidden: !0,
|
|
2292
2293
|
...k
|
|
@@ -2317,18 +2318,18 @@ function jn(r, e) {
|
|
|
2317
2318
|
throw new Error("No supported clipboard serialization method found.");
|
|
2318
2319
|
}
|
|
2319
2320
|
function Xn(r) {
|
|
2320
|
-
const e = r.getBoundingClientRect(), o = r.closest('[role="dialog"]'), a = r.closest(".ProseMirror"), n = a == null ? void 0 : a.getBoundingClientRect(),
|
|
2321
|
+
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;
|
|
2321
2322
|
if (o && window.getComputedStyle(o).transform !== "none") {
|
|
2322
2323
|
const c = o.getBoundingClientRect();
|
|
2323
2324
|
return {
|
|
2324
|
-
top: e.top - c.top +
|
|
2325
|
-
left: e.left - c.left +
|
|
2325
|
+
top: e.top - c.top + i,
|
|
2326
|
+
left: e.left - c.left + s,
|
|
2326
2327
|
width: e.width
|
|
2327
2328
|
};
|
|
2328
2329
|
}
|
|
2329
2330
|
return {
|
|
2330
|
-
top: n ? e.top - n.top : e.top +
|
|
2331
|
-
left: n ? e.left - n.left : e.left +
|
|
2331
|
+
top: n ? e.top - n.top : e.top + i,
|
|
2332
|
+
left: n ? e.left - n.left : e.left + s,
|
|
2332
2333
|
width: e.width
|
|
2333
2334
|
};
|
|
2334
2335
|
}
|
|
@@ -2348,8 +2349,8 @@ function Ze(r, e) {
|
|
|
2348
2349
|
].join(", ");
|
|
2349
2350
|
return document.elementsFromPoint(r.x, r.y).find(
|
|
2350
2351
|
(a) => {
|
|
2351
|
-
var n,
|
|
2352
|
-
return ((
|
|
2352
|
+
var n, s;
|
|
2353
|
+
return ((s = (n = a.parentElement) == null ? void 0 : n.matches) == null ? void 0 : s.call(n, ".ProseMirror")) || a.matches(o);
|
|
2353
2354
|
}
|
|
2354
2355
|
);
|
|
2355
2356
|
}
|
|
@@ -2408,10 +2409,10 @@ function Un(r) {
|
|
|
2408
2409
|
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 };
|
|
2409
2410
|
}
|
|
2410
2411
|
let n = null;
|
|
2411
|
-
function
|
|
2412
|
+
function s() {
|
|
2412
2413
|
n && n.classList.add("hide");
|
|
2413
2414
|
}
|
|
2414
|
-
function
|
|
2415
|
+
function i() {
|
|
2415
2416
|
n && n.classList.remove("hide");
|
|
2416
2417
|
}
|
|
2417
2418
|
function c(l, d) {
|
|
@@ -2423,22 +2424,22 @@ function Un(r) {
|
|
|
2423
2424
|
const b = parseInt(n.dataset.nodePos, 10);
|
|
2424
2425
|
try {
|
|
2425
2426
|
const x = l.state.doc.resolve(b);
|
|
2426
|
-
x && x.parent && x.parent.type.name !== "doc" || (o = !1,
|
|
2427
|
+
x && x.parent && x.parent.type.name !== "doc" || (o = !1, s());
|
|
2427
2428
|
} catch {
|
|
2428
|
-
o = !1,
|
|
2429
|
+
o = !1, s();
|
|
2429
2430
|
}
|
|
2430
2431
|
}
|
|
2431
|
-
o && n && !n.classList.contains("hide") ?
|
|
2432
|
+
o && n && !n.classList.contains("hide") ? i() : o || s();
|
|
2432
2433
|
}
|
|
2433
2434
|
function k(l) {
|
|
2434
2435
|
if (!(l.target instanceof Element)) return;
|
|
2435
2436
|
const d = l.relatedTarget;
|
|
2436
2437
|
if (!d) {
|
|
2437
|
-
o ||
|
|
2438
|
+
o || s();
|
|
2438
2439
|
return;
|
|
2439
2440
|
}
|
|
2440
2441
|
const b = d.closest(".drag-handle") || d.classList.contains("drag-handle"), x = d.closest(".tiptap") || d.classList.contains("tiptap");
|
|
2441
|
-
!b && !x && !o &&
|
|
2442
|
+
!b && !x && !o && s();
|
|
2442
2443
|
}
|
|
2443
2444
|
return new Vr({
|
|
2444
2445
|
key: new Wr(r.pluginKey),
|
|
@@ -2457,11 +2458,11 @@ function Un(r) {
|
|
|
2457
2458
|
}
|
|
2458
2459
|
n.addEventListener("click", x);
|
|
2459
2460
|
function A(I) {
|
|
2460
|
-
|
|
2461
|
+
s();
|
|
2461
2462
|
const u = window.scrollY;
|
|
2462
2463
|
I.clientY < r.scrollTreshold ? window.scrollTo({ top: u - 30, behavior: "smooth" }) : window.innerHeight - I.clientY < r.scrollTreshold && window.scrollTo({ top: u + 30, behavior: "smooth" });
|
|
2463
2464
|
}
|
|
2464
|
-
return n.addEventListener("drag", A),
|
|
2465
|
+
return n.addEventListener("drag", A), s(), 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(
|
|
2465
2466
|
"mouseout",
|
|
2466
2467
|
k
|
|
2467
2468
|
), {
|
|
@@ -2490,7 +2491,7 @@ function Un(r) {
|
|
|
2490
2491
|
r
|
|
2491
2492
|
), x = b == null ? void 0 : b.closest(".not-draggable"), A = r.excludedTags.concat(["ol", "ul"]).join(", ");
|
|
2492
2493
|
if (!(b instanceof Element) || b.matches(A) || x) {
|
|
2493
|
-
o ||
|
|
2494
|
+
o || s();
|
|
2494
2495
|
return;
|
|
2495
2496
|
}
|
|
2496
2497
|
const f = Qe(b, l, r);
|
|
@@ -2498,13 +2499,13 @@ function Un(r) {
|
|
|
2498
2499
|
Le(f, l)
|
|
2499
2500
|
));
|
|
2500
2501
|
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`,
|
|
2502
|
+
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());
|
|
2502
2503
|
},
|
|
2503
2504
|
keydown: () => {
|
|
2504
|
-
o ||
|
|
2505
|
+
o || s();
|
|
2505
2506
|
},
|
|
2506
2507
|
mousewheel: () => {
|
|
2507
|
-
o ||
|
|
2508
|
+
o || s();
|
|
2508
2509
|
},
|
|
2509
2510
|
// 在选择状态变化时更新拖拽按钮的状态
|
|
2510
2511
|
selectionChange: (l) => {
|
|
@@ -2516,7 +2517,7 @@ function Un(r) {
|
|
|
2516
2517
|
},
|
|
2517
2518
|
drop: (l, d) => {
|
|
2518
2519
|
var h;
|
|
2519
|
-
l.dom.classList.remove("dragging"),
|
|
2520
|
+
l.dom.classList.remove("dragging"), s();
|
|
2520
2521
|
let b = null;
|
|
2521
2522
|
const x = l.posAtCoords({
|
|
2522
2523
|
left: d.clientX,
|
|
@@ -2547,9 +2548,9 @@ function Un(r) {
|
|
|
2547
2548
|
const A = parseInt(n.dataset.nodePos, 10);
|
|
2548
2549
|
try {
|
|
2549
2550
|
const f = x.doc.resolve(A);
|
|
2550
|
-
(!f || f.parent.type.name === "doc") && (o = !1,
|
|
2551
|
+
(!f || f.parent.type.name === "doc") && (o = !1, s());
|
|
2551
2552
|
} catch {
|
|
2552
|
-
o = !1,
|
|
2553
|
+
o = !1, s();
|
|
2553
2554
|
}
|
|
2554
2555
|
}
|
|
2555
2556
|
return d;
|
|
@@ -2579,7 +2580,7 @@ const Gn = Yr.create({
|
|
|
2579
2580
|
})
|
|
2580
2581
|
];
|
|
2581
2582
|
}
|
|
2582
|
-
}), qn = yr, Yn =
|
|
2583
|
+
}), qn = yr, Yn = ir.configure({
|
|
2583
2584
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
2584
2585
|
}), Vn = lr.configure({
|
|
2585
2586
|
HTMLAttributes: {
|
|
@@ -2700,7 +2701,7 @@ const Gn = Yr.create({
|
|
|
2700
2701
|
wr,
|
|
2701
2702
|
Nr,
|
|
2702
2703
|
aa
|
|
2703
|
-
],
|
|
2704
|
+
], sa = 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(
|
|
2704
2705
|
ve.Content,
|
|
2705
2706
|
{
|
|
2706
2707
|
ref: n,
|
|
@@ -2714,7 +2715,7 @@ const Gn = Yr.create({
|
|
|
2714
2715
|
}
|
|
2715
2716
|
) }));
|
|
2716
2717
|
Re.displayName = ve.Content.displayName;
|
|
2717
|
-
const
|
|
2718
|
+
const ia = Ur(
|
|
2718
2719
|
"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",
|
|
2719
2720
|
{
|
|
2720
2721
|
variants: {
|
|
@@ -2739,11 +2740,11 @@ const sa = Ur(
|
|
|
2739
2740
|
}
|
|
2740
2741
|
}
|
|
2741
2742
|
), J = G.forwardRef(
|
|
2742
|
-
({ className: r, variant: e, size: o, asChild: a = !1, ...n },
|
|
2743
|
+
({ className: r, variant: e, size: o, asChild: a = !1, ...n }, s) => /* @__PURE__ */ t(
|
|
2743
2744
|
a ? tn : "button",
|
|
2744
2745
|
{
|
|
2745
|
-
className: y(
|
|
2746
|
-
ref:
|
|
2746
|
+
className: y(ia({ variant: e, size: o, className: r })),
|
|
2747
|
+
ref: s,
|
|
2747
2748
|
...n
|
|
2748
2749
|
}
|
|
2749
2750
|
)
|
|
@@ -2861,11 +2862,11 @@ const et = [
|
|
|
2861
2862
|
const { editor: o } = Q();
|
|
2862
2863
|
if (!o) return null;
|
|
2863
2864
|
const a = et.find(
|
|
2864
|
-
({ color:
|
|
2865
|
+
({ color: s }) => o.isActive("textStyle", { color: s })
|
|
2865
2866
|
), n = tt.find(
|
|
2866
|
-
({ color:
|
|
2867
|
+
({ color: s }) => o.isActive("highlight", { color: s })
|
|
2867
2868
|
);
|
|
2868
|
-
return /* @__PURE__ */ m(
|
|
2869
|
+
return /* @__PURE__ */ m(sa, { modal: !0, open: r, onOpenChange: e, children: [
|
|
2869
2870
|
/* @__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: [
|
|
2870
2871
|
/* @__PURE__ */ t(
|
|
2871
2872
|
"span",
|
|
@@ -2878,7 +2879,7 @@ const et = [
|
|
|
2878
2879
|
children: "A"
|
|
2879
2880
|
}
|
|
2880
2881
|
),
|
|
2881
|
-
/* @__PURE__ */ t(
|
|
2882
|
+
/* @__PURE__ */ t(st, {})
|
|
2882
2883
|
] }) }) }),
|
|
2883
2884
|
/* @__PURE__ */ m(
|
|
2884
2885
|
Re,
|
|
@@ -2889,11 +2890,11 @@ const et = [
|
|
|
2889
2890
|
children: [
|
|
2890
2891
|
/* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
2891
2892
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "颜色" }),
|
|
2892
|
-
et.map(({ name:
|
|
2893
|
+
et.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2893
2894
|
Ae,
|
|
2894
2895
|
{
|
|
2895
2896
|
onSelect: () => {
|
|
2896
|
-
o.commands.unsetColor(),
|
|
2897
|
+
o.commands.unsetColor(), s !== "Default" && o.chain().focus().setColor(i || "").run(), e(!1);
|
|
2897
2898
|
},
|
|
2898
2899
|
className: "flex cursor-pointer items-center justify-between px-2 py-1 text-sm hover:bg-accent",
|
|
2899
2900
|
children: [
|
|
@@ -2902,25 +2903,25 @@ const et = [
|
|
|
2902
2903
|
"div",
|
|
2903
2904
|
{
|
|
2904
2905
|
className: "rounded-sm border px-2 py-px font-medium",
|
|
2905
|
-
style: { color:
|
|
2906
|
+
style: { color: i },
|
|
2906
2907
|
children: "A"
|
|
2907
2908
|
}
|
|
2908
2909
|
),
|
|
2909
|
-
/* @__PURE__ */ t("span", { children:
|
|
2910
|
+
/* @__PURE__ */ t("span", { children: s })
|
|
2910
2911
|
] }),
|
|
2911
|
-
o.isActive("textStyle", { color:
|
|
2912
|
+
o.isActive("textStyle", { color: i }) && /* @__PURE__ */ t(ye, { size: 14 })
|
|
2912
2913
|
]
|
|
2913
2914
|
},
|
|
2914
|
-
|
|
2915
|
+
s
|
|
2915
2916
|
))
|
|
2916
2917
|
] }),
|
|
2917
2918
|
/* @__PURE__ */ m("div", { children: [
|
|
2918
2919
|
/* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "背景 " }),
|
|
2919
|
-
tt.map(({ name:
|
|
2920
|
+
tt.map(({ name: s, color: i }) => /* @__PURE__ */ m(
|
|
2920
2921
|
Ae,
|
|
2921
2922
|
{
|
|
2922
2923
|
onSelect: () => {
|
|
2923
|
-
o.commands.unsetHighlight(),
|
|
2924
|
+
o.commands.unsetHighlight(), s !== "Default" && o.chain().focus().setHighlight({ color: i }).run(), e(!1);
|
|
2924
2925
|
},
|
|
2925
2926
|
className: "flex cursor-pointer items-center justify-between px-2 py-1 text-sm hover:bg-accent",
|
|
2926
2927
|
children: [
|
|
@@ -2929,16 +2930,16 @@ const et = [
|
|
|
2929
2930
|
"div",
|
|
2930
2931
|
{
|
|
2931
2932
|
className: "rounded-sm border px-2 py-px font-medium",
|
|
2932
|
-
style: { backgroundColor:
|
|
2933
|
+
style: { backgroundColor: i },
|
|
2933
2934
|
children: "A"
|
|
2934
2935
|
}
|
|
2935
2936
|
),
|
|
2936
|
-
/* @__PURE__ */ t("span", { children:
|
|
2937
|
+
/* @__PURE__ */ t("span", { children: s })
|
|
2937
2938
|
] }),
|
|
2938
|
-
o.isActive("highlight", { color:
|
|
2939
|
+
o.isActive("highlight", { color: i }) && /* @__PURE__ */ t(ye, { size: 14 })
|
|
2939
2940
|
]
|
|
2940
2941
|
},
|
|
2941
|
-
|
|
2942
|
+
s
|
|
2942
2943
|
))
|
|
2943
2944
|
] })
|
|
2944
2945
|
]
|
|
@@ -2964,7 +2965,7 @@ function da(r) {
|
|
|
2964
2965
|
}
|
|
2965
2966
|
const ma = ({ open: r, onOpenChange: e }) => {
|
|
2966
2967
|
const o = he(null), { editor: a } = Q();
|
|
2967
|
-
return
|
|
2968
|
+
return ie(() => {
|
|
2968
2969
|
var n;
|
|
2969
2970
|
(n = o.current) == null || n.focus();
|
|
2970
2971
|
}), a ? /* @__PURE__ */ m(vt, { modal: !0, open: r, onOpenChange: e, children: [
|
|
@@ -2995,9 +2996,9 @@ const ma = ({ open: r, onOpenChange: e }) => {
|
|
|
2995
2996
|
"form",
|
|
2996
2997
|
{
|
|
2997
2998
|
onSubmit: (n) => {
|
|
2998
|
-
const
|
|
2999
|
+
const s = n.currentTarget;
|
|
2999
3000
|
n.preventDefault();
|
|
3000
|
-
const
|
|
3001
|
+
const i = s[0], c = da(i.value);
|
|
3001
3002
|
c && (a.chain().focus().setLink({ href: c }).run(), e(!1));
|
|
3002
3003
|
},
|
|
3003
3004
|
className: "flex p-1 ",
|
|
@@ -3022,7 +3023,7 @@ const ma = ({ open: r, onOpenChange: e }) => {
|
|
|
3022
3023
|
onClick: () => {
|
|
3023
3024
|
a.chain().focus().unsetLink().run(), o.current.value = "", e(!1);
|
|
3024
3025
|
},
|
|
3025
|
-
children: /* @__PURE__ */ t(
|
|
3026
|
+
children: /* @__PURE__ */ t(it, { className: "h-4 w-4" })
|
|
3026
3027
|
}
|
|
3027
3028
|
) : /* @__PURE__ */ t(J, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ye, { className: "h-4 w-4" }) })
|
|
3028
3029
|
]
|
|
@@ -3136,7 +3137,7 @@ const ma = ({ open: r, onOpenChange: e }) => {
|
|
|
3136
3137
|
className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
|
|
3137
3138
|
children: /* @__PURE__ */ m(J, { size: "sm", variant: "ghost", children: [
|
|
3138
3139
|
/* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: a.name }),
|
|
3139
|
-
/* @__PURE__ */ t(
|
|
3140
|
+
/* @__PURE__ */ t(st, {})
|
|
3140
3141
|
] })
|
|
3141
3142
|
}
|
|
3142
3143
|
) }),
|
|
@@ -3146,8 +3147,8 @@ const ma = ({ open: r, onOpenChange: e }) => {
|
|
|
3146
3147
|
Ee.map((n) => /* @__PURE__ */ m(
|
|
3147
3148
|
Ae,
|
|
3148
3149
|
{
|
|
3149
|
-
onSelect: (
|
|
3150
|
-
n.command(
|
|
3150
|
+
onSelect: (s) => {
|
|
3151
|
+
n.command(s), e(!1);
|
|
3151
3152
|
},
|
|
3152
3153
|
className: "flex cursor-pointer items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-accent",
|
|
3153
3154
|
children: [
|
|
@@ -3430,10 +3431,10 @@ const ka = ({
|
|
|
3430
3431
|
ge,
|
|
3431
3432
|
{
|
|
3432
3433
|
onSelect: (a) => {
|
|
3433
|
-
const n = e.state.selection.content(),
|
|
3434
|
+
const n = e.state.selection.content(), s = e.storage.markdown.serializer.serialize(
|
|
3434
3435
|
n.content
|
|
3435
3436
|
);
|
|
3436
|
-
r(
|
|
3437
|
+
r(s, a);
|
|
3437
3438
|
},
|
|
3438
3439
|
className: "flex gap-2 px-4",
|
|
3439
3440
|
value: o.value,
|
|
@@ -3467,7 +3468,7 @@ const ka = ({
|
|
|
3467
3468
|
] });
|
|
3468
3469
|
};
|
|
3469
3470
|
function Na({ onOpenChange: r, options: e }) {
|
|
3470
|
-
const { editor: o } = Q(), [a, n] = H(""), { completion:
|
|
3471
|
+
const { editor: o } = Q(), [a, n] = H(""), { completion: s, complete: i, isLoading: c } = yn({
|
|
3471
3472
|
// id: "novel",
|
|
3472
3473
|
api: "/api/generate",
|
|
3473
3474
|
onResponse: (k) => {
|
|
@@ -3480,9 +3481,9 @@ function Na({ onOpenChange: r, options: e }) {
|
|
|
3480
3481
|
ke.error(k.message);
|
|
3481
3482
|
},
|
|
3482
3483
|
...e
|
|
3483
|
-
}), p =
|
|
3484
|
+
}), p = s.length > 0;
|
|
3484
3485
|
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:
|
|
3486
|
+
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: s }) }) }) }),
|
|
3486
3487
|
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
3488
|
/* @__PURE__ */ t(Oe, { size: 14, className: "mr-2 shrink-0" }),
|
|
3488
3489
|
"AI正在思考",
|
|
@@ -3506,14 +3507,14 @@ function Na({ onOpenChange: r, options: e }) {
|
|
|
3506
3507
|
size: "icon",
|
|
3507
3508
|
className: "absolute right-2 top-1/2 h-6 w-6 -translate-y-1/2 rounded-full bg-purple-500 hover:bg-purple-900",
|
|
3508
3509
|
onClick: () => {
|
|
3509
|
-
if (
|
|
3510
|
-
return s
|
|
3510
|
+
if (s)
|
|
3511
|
+
return i(s, {
|
|
3511
3512
|
body: { option: "zap", command: a }
|
|
3512
3513
|
}).then(() => n(""));
|
|
3513
3514
|
const k = o.state.selection.content(), l = o.storage.markdown.serializer.serialize(
|
|
3514
3515
|
k.content
|
|
3515
3516
|
);
|
|
3516
|
-
|
|
3517
|
+
i(l, {
|
|
3517
3518
|
body: { option: "zap", command: a }
|
|
3518
3519
|
}).then(() => n(""));
|
|
3519
3520
|
},
|
|
@@ -3527,12 +3528,12 @@ function Na({ onOpenChange: r, options: e }) {
|
|
|
3527
3528
|
onDiscard: () => {
|
|
3528
3529
|
o.chain().unsetHighlight().focus().run(), r(!1);
|
|
3529
3530
|
},
|
|
3530
|
-
completion:
|
|
3531
|
+
completion: s
|
|
3531
3532
|
}
|
|
3532
3533
|
) : /* @__PURE__ */ t(
|
|
3533
3534
|
wa,
|
|
3534
3535
|
{
|
|
3535
|
-
onSelect: (k, l) =>
|
|
3536
|
+
onSelect: (k, l) => i(k, { body: { option: l } })
|
|
3536
3537
|
}
|
|
3537
3538
|
)
|
|
3538
3539
|
] })
|
|
@@ -3545,16 +3546,16 @@ const Ia = ({
|
|
|
3545
3546
|
enableAI: a = !1,
|
|
3546
3547
|
aiOptions: n
|
|
3547
3548
|
}) => {
|
|
3548
|
-
const { editor:
|
|
3549
|
-
return
|
|
3550
|
-
e || Tr(
|
|
3549
|
+
const { editor: s } = Q();
|
|
3550
|
+
return ie(() => {
|
|
3551
|
+
e || Tr(s);
|
|
3551
3552
|
}, [e]), /* @__PURE__ */ m(
|
|
3552
3553
|
Mr,
|
|
3553
3554
|
{
|
|
3554
3555
|
tippyOptions: {
|
|
3555
3556
|
placement: e ? "bottom-start" : "top",
|
|
3556
3557
|
onHidden: () => {
|
|
3557
|
-
o(!1),
|
|
3558
|
+
o(!1), s.chain().unsetHighlight().run();
|
|
3558
3559
|
}
|
|
3559
3560
|
},
|
|
3560
3561
|
className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
|
|
@@ -3599,9 +3600,9 @@ const Ia = ({
|
|
|
3599
3600
|
ke.promise(
|
|
3600
3601
|
e.then(async (n) => {
|
|
3601
3602
|
if (n.status === 200) {
|
|
3602
|
-
const { url:
|
|
3603
|
-
|
|
3604
|
-
o(
|
|
3603
|
+
const { url: s } = await n.json(), i = new Image();
|
|
3604
|
+
i.src = s, i.onload = () => {
|
|
3605
|
+
o(s);
|
|
3605
3606
|
};
|
|
3606
3607
|
} 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.");
|
|
3607
3608
|
}),
|
|
@@ -3788,8 +3789,8 @@ const Ia = ({
|
|
|
3788
3789
|
a.type = "file", a.accept = "image/*", a.onchange = async () => {
|
|
3789
3790
|
var n;
|
|
3790
3791
|
if ((n = a.files) != null && n.length) {
|
|
3791
|
-
const
|
|
3792
|
-
r(
|
|
3792
|
+
const s = a.files[0], i = e.view.state.selection.from;
|
|
3793
|
+
r(s, e.view, i);
|
|
3793
3794
|
}
|
|
3794
3795
|
}, a.click();
|
|
3795
3796
|
}
|
|
@@ -3803,23 +3804,23 @@ const Ia = ({
|
|
|
3803
3804
|
type: "doc",
|
|
3804
3805
|
content: []
|
|
3805
3806
|
}, Xt = Jt(({ children: r, items: e, ...o }, a) => {
|
|
3806
|
-
const n = (
|
|
3807
|
+
const n = (i) => /* @__PURE__ */ m(
|
|
3807
3808
|
Me.Item,
|
|
3808
3809
|
{
|
|
3809
|
-
onClick:
|
|
3810
|
+
onClick: i.onClick,
|
|
3810
3811
|
className: y(
|
|
3811
3812
|
"gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
|
|
3812
|
-
|
|
3813
|
+
i.className
|
|
3813
3814
|
),
|
|
3814
|
-
itemIcon:
|
|
3815
|
+
itemIcon: i.isActive ? /* @__PURE__ */ t(ye, { size: 16 }) : void 0,
|
|
3815
3816
|
children: [
|
|
3816
|
-
|
|
3817
|
-
|
|
3817
|
+
i.icon,
|
|
3818
|
+
i.label,
|
|
3818
3819
|
/* @__PURE__ */ t("div", { className: "flex-1" })
|
|
3819
3820
|
]
|
|
3820
3821
|
},
|
|
3821
|
-
|
|
3822
|
-
),
|
|
3822
|
+
i.key
|
|
3823
|
+
), s = (i) => {
|
|
3823
3824
|
var c;
|
|
3824
3825
|
return /* @__PURE__ */ t(
|
|
3825
3826
|
Me.SubMenu,
|
|
@@ -3852,13 +3853,13 @@ const Ia = ({
|
|
|
3852
3853
|
`
|
|
3853
3854
|
),
|
|
3854
3855
|
title: /* @__PURE__ */ m(me, { children: [
|
|
3855
|
-
|
|
3856
|
-
|
|
3856
|
+
i.icon,
|
|
3857
|
+
i.label,
|
|
3857
3858
|
/* @__PURE__ */ t("div", { className: "flex-1" })
|
|
3858
3859
|
] }),
|
|
3859
|
-
children: (c =
|
|
3860
|
+
children: (c = i.children) == null ? void 0 : c.map(n)
|
|
3860
3861
|
},
|
|
3861
|
-
|
|
3862
|
+
i.key
|
|
3862
3863
|
);
|
|
3863
3864
|
};
|
|
3864
3865
|
return /* @__PURE__ */ t(
|
|
@@ -3880,7 +3881,7 @@ const Ia = ({
|
|
|
3880
3881
|
`
|
|
3881
3882
|
),
|
|
3882
3883
|
...o,
|
|
3883
|
-
children: e.map((
|
|
3884
|
+
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(Me.Divider, { className: "!my-1" }, i.key) : i.type === "submenu" ? s(i) : n(i))
|
|
3884
3885
|
}
|
|
3885
3886
|
),
|
|
3886
3887
|
...o,
|
|
@@ -3901,7 +3902,7 @@ const Da = ({ children: r, ...e }) => {
|
|
|
3901
3902
|
content: c.content.toJSON()
|
|
3902
3903
|
}).focus().run();
|
|
3903
3904
|
}
|
|
3904
|
-
},
|
|
3905
|
+
}, s = Ee.map((c) => ({
|
|
3905
3906
|
key: `transform-${c.name}`,
|
|
3906
3907
|
icon: /* @__PURE__ */ t(c.icon, { size: 16 }),
|
|
3907
3908
|
label: c.name,
|
|
@@ -3916,7 +3917,7 @@ const Da = ({ children: r, ...e }) => {
|
|
|
3916
3917
|
type: "submenu",
|
|
3917
3918
|
icon: /* @__PURE__ */ t(yo, { size: 16 }),
|
|
3918
3919
|
label: "转换成",
|
|
3919
|
-
children:
|
|
3920
|
+
children: s
|
|
3920
3921
|
},
|
|
3921
3922
|
{
|
|
3922
3923
|
key: "duplicate",
|
|
@@ -3927,7 +3928,7 @@ const Da = ({ children: r, ...e }) => {
|
|
|
3927
3928
|
{ key: "divider", type: "divider" },
|
|
3928
3929
|
{
|
|
3929
3930
|
key: "delete",
|
|
3930
|
-
icon: /* @__PURE__ */ t(
|
|
3931
|
+
icon: /* @__PURE__ */ t(it, { size: 16 }),
|
|
3931
3932
|
label: "删除",
|
|
3932
3933
|
className: "text-red-500",
|
|
3933
3934
|
onClick: a
|
|
@@ -3938,8 +3939,8 @@ const Da = ({ children: r, ...e }) => {
|
|
|
3938
3939
|
if (!r) return;
|
|
3939
3940
|
const a = o.target.closest(".custom-drag-handle");
|
|
3940
3941
|
if (!a) return;
|
|
3941
|
-
const n = a.dataset.nodePos,
|
|
3942
|
-
|
|
3942
|
+
const n = a.dataset.nodePos, s = n !== void 0 ? parseInt(a.dataset.nodePos || "0", 10) : n;
|
|
3943
|
+
s !== void 0 && (r.commands.focus(), r.commands.setNodeSelection(s), r.commands.createParagraphNear() ? r.commands.insertContent("/") : r.chain().insertContentAt(s, {
|
|
3943
3944
|
type: "paragraph",
|
|
3944
3945
|
content: [{ type: "text", text: "/" }]
|
|
3945
3946
|
}).run());
|
|
@@ -3997,8 +3998,8 @@ const Da = ({ children: r, ...e }) => {
|
|
|
3997
3998
|
initialContent: o = {},
|
|
3998
3999
|
onChange: a,
|
|
3999
4000
|
cacheKey: n = "novel-content",
|
|
4000
|
-
enableCache:
|
|
4001
|
-
showSaveStatus:
|
|
4001
|
+
enableCache: s = !1,
|
|
4002
|
+
showSaveStatus: i = !0,
|
|
4002
4003
|
showWordCount: c = !0,
|
|
4003
4004
|
uploadImageProps: p,
|
|
4004
4005
|
editorRef: k,
|
|
@@ -4014,7 +4015,7 @@ const Da = ({ children: r, ...e }) => {
|
|
|
4014
4015
|
}, _ = jr(
|
|
4015
4016
|
async (S) => {
|
|
4016
4017
|
const O = S.getJSON();
|
|
4017
|
-
w(S.storage.characterCount.words()), a == null || a(O),
|
|
4018
|
+
w(S.storage.characterCount.words()), a == null || a(O), s && (window.localStorage.setItem(
|
|
4018
4019
|
"html-content",
|
|
4019
4020
|
Z(S.getHTML())
|
|
4020
4021
|
), window.localStorage.setItem(n, JSON.stringify(O)), window.localStorage.setItem(
|
|
@@ -4036,9 +4037,9 @@ const Da = ({ children: r, ...e }) => {
|
|
|
4036
4037
|
onError: Ie
|
|
4037
4038
|
} = p;
|
|
4038
4039
|
return yt({
|
|
4039
|
-
onUpload: (
|
|
4040
|
+
onUpload: (se) => {
|
|
4040
4041
|
const M = new FormData();
|
|
4041
|
-
M.append(Pe || "file",
|
|
4042
|
+
M.append(Pe || "file", se);
|
|
4042
4043
|
const U = fetch(B, {
|
|
4043
4044
|
method: re || "POST",
|
|
4044
4045
|
headers: {
|
|
@@ -4058,7 +4059,7 @@ const Da = ({ children: r, ...e }) => {
|
|
|
4058
4059
|
L.src = z, L.onload = () => {
|
|
4059
4060
|
F(z);
|
|
4060
4061
|
};
|
|
4061
|
-
} else throw P.status === 401 ? (F(
|
|
4062
|
+
} else throw P.status === 401 ? (F(se), new Error(
|
|
4062
4063
|
"`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead."
|
|
4063
4064
|
)) : new Error("Error uploading image. Please try again.");
|
|
4064
4065
|
}).catch((P) => {
|
|
@@ -4066,14 +4067,14 @@ const Da = ({ children: r, ...e }) => {
|
|
|
4066
4067
|
});
|
|
4067
4068
|
});
|
|
4068
4069
|
},
|
|
4069
|
-
validateFn: (
|
|
4070
|
+
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)
|
|
4070
4071
|
});
|
|
4071
4072
|
}, [p]);
|
|
4072
|
-
if (
|
|
4073
|
-
if (!
|
|
4073
|
+
if (ie(() => {
|
|
4074
|
+
if (!s) return;
|
|
4074
4075
|
const S = window.localStorage.getItem(n);
|
|
4075
4076
|
x(S ? JSON.parse(S) : Aa);
|
|
4076
|
-
}, [n,
|
|
4077
|
+
}, [n, s]), !b) return null;
|
|
4077
4078
|
const oe = [
|
|
4078
4079
|
...zt,
|
|
4079
4080
|
La({
|
|
@@ -4081,8 +4082,8 @@ const Da = ({ children: r, ...e }) => {
|
|
|
4081
4082
|
})
|
|
4082
4083
|
];
|
|
4083
4084
|
return /* @__PURE__ */ m("div", { className: y("relative w-full max-w-screen-lg", e), children: [
|
|
4084
|
-
(
|
|
4085
|
-
|
|
4085
|
+
(s && i || c) && /* @__PURE__ */ m("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
|
|
4086
|
+
s && i && /* @__PURE__ */ t("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children: A }),
|
|
4086
4087
|
c && /* @__PURE__ */ m(
|
|
4087
4088
|
"div",
|
|
4088
4089
|
{
|
|
@@ -4170,7 +4171,7 @@ const Da = ({ children: r, ...e }) => {
|
|
|
4170
4171
|
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 } }) });
|
|
4171
4172
|
}, Ut = Pa;
|
|
4172
4173
|
Ut.Preview = Ba;
|
|
4173
|
-
const
|
|
4174
|
+
const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4174
4175
|
__proto__: null,
|
|
4175
4176
|
Desktop: Pn,
|
|
4176
4177
|
DesktopSortable: Mt,
|
|
@@ -4198,14 +4199,19 @@ export {
|
|
|
4198
4199
|
wt as DesktopSortableConfigProvider,
|
|
4199
4200
|
St as DesktopSortableStateProvider,
|
|
4200
4201
|
we as Dock,
|
|
4202
|
+
qe as DockDesktop,
|
|
4203
|
+
Ge as DockDesktopItem,
|
|
4204
|
+
Ye as DockMobile,
|
|
4205
|
+
De as DockMobileItem,
|
|
4201
4206
|
Ut as Editor,
|
|
4202
4207
|
Rt as Markdown,
|
|
4203
4208
|
Pt as MdEditor,
|
|
4204
4209
|
Y as SortableUtils,
|
|
4205
|
-
|
|
4210
|
+
Is as default,
|
|
4206
4211
|
je as desktopAppConfig,
|
|
4207
4212
|
Xe as desktopConfigMap,
|
|
4208
4213
|
Nt as desktopGroupConfig,
|
|
4209
4214
|
_e as desktopThemeDark,
|
|
4210
|
-
Fe as desktopThemeLight
|
|
4215
|
+
Fe as desktopThemeLight,
|
|
4216
|
+
Ms as useDockDesktopMouseX
|
|
4211
4217
|
};
|