reactjs-tiptap-editor 0.3.30 → 0.4.0
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/README.md +8 -2
- package/lib/{ActionMenuButton-wiDnIxE2.cjs → ActionMenuButton-CYdM1xx5.cjs} +1 -1
- package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-DKRF6oa0.js} +5 -5
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +47 -51
- package/lib/Attachment.d.ts +47 -51
- package/lib/Attachment.js +7 -6
- package/lib/BaseKit.cjs +3 -0
- package/lib/BaseKit.d.cts +481 -0
- package/lib/BaseKit.d.ts +481 -0
- package/lib/BaseKit.js +132 -0
- package/lib/Blockquote.cjs +5 -1
- package/lib/Blockquote.d.cts +47 -51
- package/lib/Blockquote.d.ts +47 -51
- package/lib/Blockquote.js +33 -17
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +47 -51
- package/lib/Bold.d.ts +47 -51
- package/lib/Bold.js +23 -16
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +48 -52
- package/lib/BulletList.d.ts +48 -52
- package/lib/BulletList.js +11 -57
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +47 -51
- package/lib/Clear.d.ts +47 -51
- package/lib/Clear.js +4 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +47 -51
- package/lib/Code.d.ts +47 -51
- package/lib/Code.js +29 -25
- package/lib/CodeBlock.cjs +2 -2
- package/lib/CodeBlock.d.cts +47 -51
- package/lib/CodeBlock.d.ts +47 -51
- package/lib/CodeBlock.js +5 -4
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +47 -51
- package/lib/CodeView.d.ts +47 -51
- package/lib/CodeView.js +3 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +48 -52
- package/lib/Color.d.ts +48 -52
- package/lib/Color.js +42 -74
- package/lib/Document.cjs +1 -1
- package/lib/Document.d.cts +47 -51
- package/lib/Document.d.ts +47 -51
- package/lib/Document.js +4 -8
- package/lib/{Drawer-BKTU9CpU.js → Drawer-CaAfmqNo.js} +268 -265
- package/lib/Drawer-CdvCMSzN.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +47 -51
- package/lib/Drawer.d.ts +47 -51
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +50 -52
- package/lib/Emoji.d.ts +50 -52
- package/lib/Emoji.js +19790 -178
- package/lib/Excalidraw-BbMQhNvs.cjs +1 -0
- package/lib/Excalidraw-CVWz2Vyn.js +290 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +47 -51
- package/lib/Excalidraw.d.ts +47 -51
- package/lib/Excalidraw.js +3 -3
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +47 -51
- package/lib/ExportPdf.d.ts +47 -51
- package/lib/ExportPdf.js +4 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +47 -51
- package/lib/ExportWord.d.ts +47 -51
- package/lib/ExportWord.js +22 -51
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +48 -52
- package/lib/FontFamily.d.ts +48 -52
- package/lib/FontFamily.js +46 -74
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +47 -51
- package/lib/FontSize.d.ts +47 -51
- package/lib/FontSize.js +11 -8
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +47 -51
- package/lib/FormatPainter.d.ts +47 -51
- package/lib/FormatPainter.js +4 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +47 -51
- package/lib/Heading.d.ts +47 -51
- package/lib/Heading.js +77 -65
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +47 -51
- package/lib/Highlight.d.ts +47 -51
- package/lib/Highlight.js +5 -4
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +49 -53
- package/lib/History.d.ts +49 -53
- package/lib/History.js +39 -403
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +47 -51
- package/lib/HorizontalRule.d.ts +47 -51
- package/lib/HorizontalRule.js +16 -65
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +47 -51
- package/lib/Iframe.d.ts +47 -51
- package/lib/Iframe.js +4 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +47 -51
- package/lib/Image.d.ts +47 -51
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +47 -51
- package/lib/ImageGif.d.ts +47 -51
- package/lib/ImageGif.js +5 -5
- package/lib/ImportWord.cjs +72 -72
- package/lib/ImportWord.d.cts +47 -51
- package/lib/ImportWord.d.ts +47 -51
- package/lib/ImportWord.js +5654 -5616
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +47 -51
- package/lib/Indent.d.ts +47 -51
- package/lib/Indent.js +4 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +47 -51
- package/lib/Italic.d.ts +47 -51
- package/lib/Italic.js +20 -14
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +47 -51
- package/lib/Katex.d.ts +47 -51
- package/lib/Katex.js +49 -48
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +47 -51
- package/lib/LineHeight.d.ts +47 -51
- package/lib/LineHeight.js +21 -18
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +47 -51
- package/lib/Link.d.ts +47 -51
- package/lib/Link.js +4 -4
- package/lib/ListItem.cjs +1 -1
- package/lib/ListItem.d.cts +52 -52
- package/lib/ListItem.d.ts +52 -52
- package/lib/ListItem.js +4 -30
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +47 -51
- package/lib/Mention.d.ts +47 -51
- package/lib/Mention.js +161 -132
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +47 -51
- package/lib/Mermaid.d.ts +47 -51
- package/lib/Mermaid.js +150 -147
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +47 -51
- package/lib/MoreMark.d.ts +47 -51
- package/lib/MoreMark.js +5 -3
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +47 -51
- package/lib/MultiColumn.d.ts +47 -51
- package/lib/MultiColumn.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +48 -52
- package/lib/OrderedList.d.ts +48 -52
- package/lib/OrderedList.js +11 -75
- package/lib/RichTextEditor-CxvwGvQG.cjs +142 -0
- package/lib/RichTextEditor-DGcKEUGr.js +22166 -0
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +60 -134
- package/lib/SearchAndReplace.d.ts +60 -134
- package/lib/SearchAndReplace.js +207 -194
- package/lib/Selection.cjs +1 -1
- package/lib/Selection.d.cts +47 -51
- package/lib/Selection.d.ts +47 -51
- package/lib/Selection.js +1 -1
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +47 -51
- package/lib/SlashCommand.d.ts +47 -51
- package/lib/SlashCommand.js +177 -222
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +47 -51
- package/lib/Strike.d.ts +47 -51
- package/lib/Strike.js +20 -14
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +47 -51
- package/lib/SubAndSuperScript.d.ts +47 -51
- package/lib/SubAndSuperScript.js +5 -3
- package/lib/Table.cjs +8 -10
- package/lib/Table.d.cts +50 -54
- package/lib/Table.d.ts +50 -54
- package/lib/Table.js +382 -2021
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +47 -51
- package/lib/TableOfContent.d.ts +47 -51
- package/lib/TableOfContent.js +53 -52
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +49 -53
- package/lib/TaskList.d.ts +49 -53
- package/lib/TaskList.js +12 -154
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +47 -51
- package/lib/TextAlign.d.ts +47 -51
- package/lib/TextAlign.js +11 -8
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +47 -51
- package/lib/TextBubble.d.ts +47 -51
- package/lib/TextBubble.js +5 -3
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +47 -51
- package/lib/TextDirection.d.ts +47 -51
- package/lib/TextDirection.js +15 -15
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +47 -51
- package/lib/TextUnderline.d.ts +47 -51
- package/lib/TextUnderline.js +40 -12
- package/lib/TrailingNode.cjs +1 -1
- package/lib/TrailingNode.d.cts +47 -51
- package/lib/TrailingNode.d.ts +47 -51
- package/lib/TrailingNode.js +1 -1
- package/lib/Twitter-BFULyqdR.js +1628 -0
- package/lib/Twitter-Cutpkh3h.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +47 -51
- package/lib/Twitter.d.ts +47 -51
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +47 -51
- package/lib/Video.d.ts +47 -51
- package/lib/Video.js +3 -3
- package/lib/bubble-extra.cjs +2 -2
- package/lib/bubble-extra.d.cts +47 -51
- package/lib/bubble-extra.d.ts +47 -51
- package/lib/bubble-extra.js +200 -192
- package/lib/dom-dataset-_6-diIRQ.cjs +33 -0
- package/lib/dom-dataset-lYeH6gfI.js +2361 -0
- package/lib/index-5iBZLua9.cjs +12 -0
- package/lib/index-6D1J-A-o.cjs +1 -0
- package/lib/index-B96Cclrj.cjs +3 -0
- package/lib/index-BBz7Nmv9.js +55 -0
- package/lib/index-BeCTd5v2.cjs +1 -0
- package/lib/index-ByurDDMv.js +237 -0
- package/lib/index-CUogRI7j.cjs +1 -0
- package/lib/index-Ch6dBBad.js +709 -0
- package/lib/index-DF2Lp4HZ.cjs +100 -0
- package/lib/{index-LUL9mqY4.js → index-D_L6n8O8.js} +4 -4
- package/lib/index-Dbvi-Bvh.cjs +1 -0
- package/lib/index-DpCrt7xs.cjs +1 -0
- package/lib/index-DsAX1Vq8.cjs +1 -0
- package/lib/index-Dy4DlW9o.js +12 -0
- package/lib/index-J3jHHZ4d.js +200 -0
- package/lib/{index-CsK90iVd.js → index-LmrOdnen.js} +302 -389
- package/lib/index-VvXaaKe3.js +898 -0
- package/lib/index-kbO3iWqL.js +13432 -0
- package/lib/index.cjs +1 -2
- package/lib/index.d.cts +49 -251
- package/lib/index.d.ts +49 -251
- package/lib/index.js +2 -588
- package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
- package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +47 -51
- package/lib/locale-bundle.d.ts +47 -51
- package/lib/locale-bundle.js +1 -1
- package/lib/style.css +1 -1
- package/lib/{textarea-D5WVZMgt.cjs → textarea-DFo_aXnj.cjs} +1 -1
- package/lib/{textarea-BglwYF6b.js → textarea-aPtytkDx.js} +1 -1
- package/package.json +76 -70
- package/lib/Drawer-CmoEF-Zg.cjs +0 -1
- package/lib/Excalidraw-CM74U5tG.js +0 -289
- package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
- package/lib/RichTextEditor-BQN2eLD_.js +0 -12775
- package/lib/RichTextEditor-C8Sm1E6J.cjs +0 -140
- package/lib/Twitter-CL2pu4QM.cjs +0 -17
- package/lib/Twitter-Dg6WWauX.js +0 -1743
- package/lib/dom-dataset-Byuf1YmW.cjs +0 -33
- package/lib/dom-dataset-Di3tIRrR.js +0 -1031
- package/lib/index-BI-IcZcN.cjs +0 -1
- package/lib/index-ByRfqzMr.cjs +0 -89
- package/lib/index-C1fzuXpN.js +0 -46
- package/lib/index-CbQQFj2T.js +0 -133
- package/lib/index-DI9T3iLd.js +0 -12354
- package/lib/index-D_A0TBRA.cjs +0 -1
- package/lib/index-DclQSrIx.cjs +0 -1
- package/lib/index-Z4b9rzn-.cjs +0 -1
package/lib/bubble-extra.js
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as y, useRef as
|
|
3
|
-
import { B as
|
|
4
|
-
import { w as Z, x as J, A as S, y as Q, z as X, F as Y, B as H, G as ee, O as D, a1 as ce, a2 as te, a3 as R, a4 as se, a5 as le } from "./RichTextEditor-BQN2eLD_.js";
|
|
1
|
+
import { jsxs as p, jsx as t, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useRef as O, useCallback as w, useEffect as k, useMemo as D, Fragment as G } from "react";
|
|
3
|
+
import { t as Z, u as J, A as S, v as Q, w as X, x as Y, B as R, y as ee, K as W, aj as ae, ak as P, al as te, am as U, an as se, ao as le } from "./RichTextEditor-DGcKEUGr.js";
|
|
5
4
|
import { Mermaid as j } from "./Mermaid.js";
|
|
6
5
|
import { s as re, i as ne } from "./shortId-WJVkrvml.js";
|
|
7
|
-
import { T as ie } from "./textarea-
|
|
8
|
-
import { u as
|
|
9
|
-
import { E as
|
|
10
|
-
import { T as K, F as he } from "./Twitter-
|
|
6
|
+
import { T as ie } from "./textarea-aPtytkDx.js";
|
|
7
|
+
import { u as z } from "./index-LmrOdnen.js";
|
|
8
|
+
import { E as N, t as de } from "./Excalidraw-CVWz2Vyn.js";
|
|
9
|
+
import { T as K, F as he } from "./Twitter-BFULyqdR.js";
|
|
11
10
|
import ue from "katex";
|
|
12
11
|
import { HelpCircle as me, Pencil as xe, Trash2 as fe } from "lucide-react";
|
|
13
|
-
import { Katex as
|
|
14
|
-
import { C as
|
|
15
|
-
import { Editor as
|
|
12
|
+
import { Katex as A } from "./Katex.js";
|
|
13
|
+
import { C as ge, D as _ } from "./Drawer-CaAfmqNo.js";
|
|
14
|
+
import { Editor as be, makeDropdownToolbar as pe } from "easydrawer";
|
|
16
15
|
const q = `graph TB
|
|
17
|
-
a-->b`, we = ({ editor: e, attrs:
|
|
18
|
-
const { alt:
|
|
19
|
-
(
|
|
20
|
-
|
|
16
|
+
a-->b`, we = ({ editor: e, attrs: a, extension: o }) => {
|
|
17
|
+
const { alt: s, align: n } = a, [r, i] = y(decodeURIComponent(s ?? q)), [l, h] = y(""), [m, x] = y(!1), g = O(null), [f, M] = y(null), T = o == null ? void 0 : o.options.upload, L = w(
|
|
18
|
+
(b) => {
|
|
19
|
+
b && import("mermaid").then((B) => {
|
|
21
20
|
M(B.default);
|
|
22
21
|
});
|
|
23
22
|
},
|
|
24
23
|
[]
|
|
25
|
-
),
|
|
24
|
+
), I = async (b) => {
|
|
26
25
|
try {
|
|
27
|
-
const { svg: B } = await f.render("mermaid-svg",
|
|
26
|
+
const { svg: B } = await f.render("mermaid-svg", b);
|
|
28
27
|
h(B);
|
|
29
28
|
} catch {
|
|
30
29
|
h("");
|
|
@@ -36,13 +35,13 @@ a-->b`, we = ({ editor: e, attrs: s, extension: o }) => {
|
|
|
36
35
|
// fontFamily:'',
|
|
37
36
|
fontSize: 12,
|
|
38
37
|
theme: "base"
|
|
39
|
-
}),
|
|
38
|
+
}), I(r);
|
|
40
39
|
};
|
|
41
|
-
return
|
|
40
|
+
return k(() => {
|
|
42
41
|
f && m && $();
|
|
43
|
-
}, [f, m]),
|
|
44
|
-
f && m &&
|
|
45
|
-
}, [f, r]), /* @__PURE__ */
|
|
42
|
+
}, [f, m]), k(() => {
|
|
43
|
+
f && m && I(r);
|
|
44
|
+
}, [f, r]), /* @__PURE__ */ p(
|
|
46
45
|
Z,
|
|
47
46
|
{
|
|
48
47
|
onOpenChange: x,
|
|
@@ -56,21 +55,21 @@ a-->b`, we = ({ editor: e, attrs: s, extension: o }) => {
|
|
|
56
55
|
tooltip: "Edit Mermaid"
|
|
57
56
|
}
|
|
58
57
|
) }),
|
|
59
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ p(Q, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
60
59
|
/* @__PURE__ */ t(X, { children: "Edit Mermaid" }),
|
|
61
60
|
/* @__PURE__ */ t(
|
|
62
61
|
"div",
|
|
63
62
|
{
|
|
64
|
-
ref:
|
|
63
|
+
ref: L,
|
|
65
64
|
style: { height: "100%", border: "1px solid hsl(var(--border))" },
|
|
66
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ p("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
|
|
67
66
|
/* @__PURE__ */ t(
|
|
68
67
|
ie,
|
|
69
68
|
{
|
|
70
69
|
autoFocus: !0,
|
|
71
70
|
className: "richtext-flex-1",
|
|
72
71
|
defaultValue: q,
|
|
73
|
-
onChange: (
|
|
72
|
+
onChange: (b) => i(b.target.value),
|
|
74
73
|
placeholder: "Text",
|
|
75
74
|
required: !0,
|
|
76
75
|
rows: 10,
|
|
@@ -85,7 +84,7 @@ a-->b`, we = ({ editor: e, attrs: s, extension: o }) => {
|
|
|
85
84
|
{
|
|
86
85
|
className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",
|
|
87
86
|
dangerouslySetInnerHTML: { __html: l },
|
|
88
|
-
ref:
|
|
87
|
+
ref: g,
|
|
89
88
|
style: { height: "100%", border: "1px solid hsl(var(--border))", minHeight: 500, background: "#fff" }
|
|
90
89
|
}
|
|
91
90
|
)
|
|
@@ -93,16 +92,16 @@ a-->b`, we = ({ editor: e, attrs: s, extension: o }) => {
|
|
|
93
92
|
}
|
|
94
93
|
),
|
|
95
94
|
/* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(
|
|
96
|
-
|
|
95
|
+
R,
|
|
97
96
|
{
|
|
98
97
|
onClick: async () => {
|
|
99
98
|
if (r !== "") {
|
|
100
99
|
if (r) {
|
|
101
|
-
const
|
|
102
|
-
let c = ne(
|
|
103
|
-
if (
|
|
100
|
+
const b = g.current.querySelector("svg"), { width: B, height: V } = b.getBoundingClientRect(), u = `mermaid-${re()}.svg`;
|
|
101
|
+
let c = ne(b.outerHTML);
|
|
102
|
+
if (T) {
|
|
104
103
|
const d = ee(c, u);
|
|
105
|
-
c = await
|
|
104
|
+
c = await T(d);
|
|
106
105
|
}
|
|
107
106
|
e == null || e.chain().focus().setMermaid(
|
|
108
107
|
{
|
|
@@ -127,70 +126,63 @@ a-->b`, we = ({ editor: e, attrs: s, extension: o }) => {
|
|
|
127
126
|
}
|
|
128
127
|
);
|
|
129
128
|
};
|
|
130
|
-
function oe(e,
|
|
131
|
-
const [o,
|
|
132
|
-
return
|
|
129
|
+
function oe(e, a) {
|
|
130
|
+
const [o, s] = y(void 0);
|
|
131
|
+
return k(() => {
|
|
133
132
|
const n = () => {
|
|
134
|
-
const r = e.extensionManager.extensions.find((i) => i.name ===
|
|
135
|
-
r &&
|
|
133
|
+
const r = e.extensionManager.extensions.find((i) => i.name === a);
|
|
134
|
+
r && s(r);
|
|
136
135
|
};
|
|
137
136
|
return e.on("selectionUpdate", n), e.on("transaction", n), () => {
|
|
138
137
|
e.off("selectionUpdate", n), e.off("transaction", n);
|
|
139
138
|
};
|
|
140
|
-
}, [e,
|
|
139
|
+
}, [e, a]), o;
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
maxWidth: "auto",
|
|
144
|
-
zIndex: 20,
|
|
145
|
-
appendTo: "parent",
|
|
146
|
-
moveTransition: "transform 0.1s ease-out"
|
|
147
|
-
};
|
|
148
|
-
function ye({ item: e, disabled: s, editor: o }) {
|
|
141
|
+
function ve({ item: e, disabled: a, editor: o }) {
|
|
149
142
|
var n;
|
|
150
|
-
const
|
|
151
|
-
return
|
|
143
|
+
const s = e.component;
|
|
144
|
+
return s ? /* @__PURE__ */ t(G, { children: e.type === "divider" ? /* @__PURE__ */ t(
|
|
152
145
|
te,
|
|
153
146
|
{
|
|
154
147
|
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
|
|
155
148
|
orientation: "vertical"
|
|
156
149
|
}
|
|
157
150
|
) : /* @__PURE__ */ t(
|
|
158
|
-
|
|
151
|
+
s,
|
|
159
152
|
{
|
|
160
153
|
...e.componentProps,
|
|
161
|
-
disabled:
|
|
154
|
+
disabled: a || ((n = e == null ? void 0 : e.componentProps) == null ? void 0 : n.disabled),
|
|
162
155
|
editor: o
|
|
163
156
|
}
|
|
164
157
|
) }) : /* @__PURE__ */ t(v, {});
|
|
165
158
|
}
|
|
166
|
-
function
|
|
159
|
+
function ye(e) {
|
|
167
160
|
return e.type.name === "mermaid";
|
|
168
161
|
}
|
|
169
|
-
function
|
|
170
|
-
const { lang:
|
|
162
|
+
function Re(e) {
|
|
163
|
+
const { lang: a } = z(), o = W(e.editor, j.name), s = oe(e.editor, j.name), n = ({ editor: i }) => {
|
|
171
164
|
const { selection: l } = i.view.state, { $from: h, to: m } = l;
|
|
172
165
|
let x = !1;
|
|
173
|
-
return i.view.state.doc.nodesBetween(h.pos, m, (
|
|
174
|
-
if (
|
|
166
|
+
return i.view.state.doc.nodesBetween(h.pos, m, (g) => {
|
|
167
|
+
if (ye(g))
|
|
175
168
|
return x = !0, !1;
|
|
176
169
|
}), x;
|
|
177
|
-
}, r =
|
|
170
|
+
}, r = D(() => e.disabled ? [] : ae(e.editor), [e.disabled, e.editor, a]);
|
|
178
171
|
return /* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(
|
|
179
|
-
|
|
172
|
+
P,
|
|
180
173
|
{
|
|
181
174
|
editor: e == null ? void 0 : e.editor,
|
|
182
175
|
shouldShow: n,
|
|
183
|
-
tippyOptions: ve,
|
|
184
176
|
children: r != null && r.length ? /* @__PURE__ */ t("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ t("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: r == null ? void 0 : r.map((i, l) => i.type === "edit" && (o != null && o.src) ? /* @__PURE__ */ t(
|
|
185
177
|
we,
|
|
186
178
|
{
|
|
187
179
|
attrs: o,
|
|
188
180
|
editor: e.editor,
|
|
189
|
-
extension:
|
|
181
|
+
extension: s
|
|
190
182
|
},
|
|
191
183
|
`bubbleMenu-mermaid-${l}`
|
|
192
184
|
) : /* @__PURE__ */ t(
|
|
193
|
-
|
|
185
|
+
ve,
|
|
194
186
|
{
|
|
195
187
|
disabled: e.disabled,
|
|
196
188
|
editor: e.editor,
|
|
@@ -202,105 +194,123 @@ function Ve(e) {
|
|
|
202
194
|
) });
|
|
203
195
|
}
|
|
204
196
|
const C = /* @__PURE__ */ new Map();
|
|
205
|
-
function
|
|
206
|
-
const
|
|
207
|
-
C.has("width") || C.set("width",
|
|
208
|
-
const o = { attributes: !0, childList: !0, subtree: !0 },
|
|
209
|
-
C.set("width",
|
|
210
|
-
}, n = new MutationObserver(
|
|
211
|
-
return n.observe(
|
|
197
|
+
function Se(e) {
|
|
198
|
+
const a = e.options.element;
|
|
199
|
+
C.has("width") || C.set("width", a.clientWidth), C.has("width") && C.get("width") <= 0 && C.set("width", a.clientWidth);
|
|
200
|
+
const o = { attributes: !0, childList: !0, subtree: !0 }, s = function() {
|
|
201
|
+
C.set("width", a.clientWidth);
|
|
202
|
+
}, n = new MutationObserver(s);
|
|
203
|
+
return n.observe(a, o), e.on("destroy", () => {
|
|
212
204
|
n.disconnect();
|
|
213
205
|
}), { width: C.get("width") };
|
|
214
206
|
}
|
|
215
|
-
function
|
|
216
|
-
const { t:
|
|
207
|
+
function Ue({ editor: e }) {
|
|
208
|
+
const { t: a } = z(), { width: o } = Se(e), s = W(e, N.name, {
|
|
217
209
|
defaultShowPicker: !1,
|
|
218
210
|
createUser: "",
|
|
219
211
|
width: 0,
|
|
220
212
|
height: 0
|
|
221
|
-
}), { defaultShowPicker: n, createUser: r, width: i, height: l } =
|
|
213
|
+
}), { defaultShowPicker: n, createUser: r, width: i, height: l } = s, h = w(
|
|
222
214
|
(f) => {
|
|
223
|
-
e.chain().updateAttributes(
|
|
215
|
+
e.chain().updateAttributes(N.name, f).setNodeSelection(e.state.selection.from).focus().run();
|
|
224
216
|
},
|
|
225
217
|
[e]
|
|
226
218
|
), m = w(() => {
|
|
227
|
-
de({ ...
|
|
228
|
-
}, [e,
|
|
229
|
-
return
|
|
230
|
-
n && (m(), e.chain().updateAttributes(
|
|
219
|
+
de({ ...s, editor: e });
|
|
220
|
+
}, [e, s]), x = w(() => e.isActive(N.name), [e]), g = w(() => U(N.name, e), [e]);
|
|
221
|
+
return k(() => {
|
|
222
|
+
n && (m(), e.chain().updateAttributes(N.name, { defaultShowPicker: !1 }).focus().run());
|
|
231
223
|
}, [r, n, e, m]), /* @__PURE__ */ t(
|
|
232
|
-
|
|
224
|
+
P,
|
|
233
225
|
{
|
|
234
226
|
className: "bubble-menu",
|
|
235
227
|
editor: e,
|
|
236
228
|
pluginKey: "excalidraw-bubble-menu",
|
|
237
229
|
shouldShow: x,
|
|
238
|
-
|
|
239
|
-
popperOptions: {
|
|
240
|
-
|
|
241
|
-
},
|
|
230
|
+
options: {
|
|
231
|
+
// popperOptions: {
|
|
232
|
+
// modifiers: [{ name: 'flip', enabled: false }],
|
|
233
|
+
// },
|
|
234
|
+
// offset: [-2, 16],
|
|
242
235
|
placement: "bottom-start",
|
|
243
|
-
offset:
|
|
244
|
-
|
|
236
|
+
offset: {
|
|
237
|
+
alignmentAxis: 6,
|
|
238
|
+
crossAxis: 6
|
|
239
|
+
}
|
|
240
|
+
// zIndex: 9999,
|
|
245
241
|
// onHidden: () => {
|
|
246
242
|
// toggleVisible(false)
|
|
247
243
|
// },
|
|
248
244
|
},
|
|
249
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ p("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: [
|
|
250
246
|
/* @__PURE__ */ t(
|
|
251
247
|
S,
|
|
252
248
|
{
|
|
253
|
-
icon: "Pencil",
|
|
254
249
|
action: m,
|
|
255
|
-
|
|
250
|
+
icon: "Pencil",
|
|
251
|
+
tooltip: a("editor.edit")
|
|
256
252
|
}
|
|
257
253
|
),
|
|
258
|
-
/* @__PURE__ */ t(
|
|
259
|
-
|
|
254
|
+
/* @__PURE__ */ t(
|
|
255
|
+
se,
|
|
260
256
|
{
|
|
261
|
-
|
|
262
|
-
|
|
257
|
+
height: l,
|
|
258
|
+
maxWidth: o,
|
|
259
|
+
onOk: h,
|
|
260
|
+
width: i,
|
|
261
|
+
children: /* @__PURE__ */ t(
|
|
262
|
+
S,
|
|
263
|
+
{
|
|
264
|
+
icon: "Settings",
|
|
265
|
+
tooltip: a("editor.settings")
|
|
266
|
+
}
|
|
267
|
+
)
|
|
263
268
|
}
|
|
264
|
-
)
|
|
269
|
+
),
|
|
265
270
|
/* @__PURE__ */ t(
|
|
266
271
|
S,
|
|
267
272
|
{
|
|
273
|
+
action: g,
|
|
268
274
|
icon: "Trash2",
|
|
269
|
-
|
|
270
|
-
tooltip: s("editor.delete")
|
|
275
|
+
tooltip: a("editor.delete")
|
|
271
276
|
}
|
|
272
277
|
)
|
|
273
278
|
] })
|
|
274
279
|
}
|
|
275
280
|
);
|
|
276
281
|
}
|
|
277
|
-
function
|
|
278
|
-
const [o,
|
|
279
|
-
e.commands.updateTweet({ src: h }),
|
|
280
|
-
}, l = w(() =>
|
|
282
|
+
function He({ editor: e, disabled: a }) {
|
|
283
|
+
const [o, s] = y(!1), { t: n } = z(), r = w(({ editor: h }) => h.isActive(K.name), []), i = (h) => {
|
|
284
|
+
e.commands.updateTweet({ src: h }), s(!1);
|
|
285
|
+
}, l = w(() => U(K.name, e), [e]);
|
|
281
286
|
return /* @__PURE__ */ t(v, { children: /* @__PURE__ */ t(
|
|
282
|
-
|
|
287
|
+
P,
|
|
283
288
|
{
|
|
284
289
|
editor: e,
|
|
285
290
|
shouldShow: r,
|
|
286
|
-
|
|
287
|
-
popperOptions: {
|
|
288
|
-
|
|
289
|
-
},
|
|
291
|
+
options: {
|
|
292
|
+
// popperOptions: {
|
|
293
|
+
// modifiers: [{ name: 'flip', enabled: false }],
|
|
294
|
+
// },
|
|
295
|
+
// placement: 'bottom-start',
|
|
296
|
+
// offset: [-2, 16],
|
|
297
|
+
// zIndex: 9999,
|
|
298
|
+
// onHidden: () => {
|
|
299
|
+
// setShowEdit(false);
|
|
300
|
+
// },
|
|
290
301
|
placement: "bottom-start",
|
|
291
|
-
offset:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
a(!1);
|
|
302
|
+
offset: {
|
|
303
|
+
alignmentAxis: 6,
|
|
304
|
+
crossAxis: 6
|
|
295
305
|
}
|
|
296
306
|
},
|
|
297
|
-
children:
|
|
307
|
+
children: a ? /* @__PURE__ */ t(v, {}) : /* @__PURE__ */ t(v, { children: o ? /* @__PURE__ */ t(
|
|
298
308
|
he,
|
|
299
309
|
{
|
|
300
310
|
editor: e,
|
|
301
311
|
onSetLink: i
|
|
302
312
|
}
|
|
303
|
-
) : /* @__PURE__ */ t("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */
|
|
313
|
+
) : /* @__PURE__ */ t("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: /* @__PURE__ */ p("div", { className: "richtext-flex richtext-flex-nowrap", children: [
|
|
304
314
|
/* @__PURE__ */ t(
|
|
305
315
|
S,
|
|
306
316
|
{
|
|
@@ -308,7 +318,7 @@ function Ke({ editor: e, disabled: s }) {
|
|
|
308
318
|
tooltip: n("editor.link.edit.tooltip"),
|
|
309
319
|
tooltipOptions: { sideOffset: 15 },
|
|
310
320
|
action: () => {
|
|
311
|
-
|
|
321
|
+
s(!0);
|
|
312
322
|
}
|
|
313
323
|
}
|
|
314
324
|
),
|
|
@@ -325,25 +335,25 @@ function Ke({ editor: e, disabled: s }) {
|
|
|
325
335
|
}
|
|
326
336
|
) });
|
|
327
337
|
}
|
|
328
|
-
function
|
|
329
|
-
const o =
|
|
338
|
+
function Ve({ editor: e, ...a }) {
|
|
339
|
+
const o = W(e, A.name, {
|
|
330
340
|
text: "",
|
|
331
341
|
defaultShowPicker: !1
|
|
332
|
-
}), { text:
|
|
342
|
+
}), { text: s, defaultShowPicker: n } = o, [r, i] = y(""), [l, h] = y(!1), m = w(() => e.isActive(A.name), [e]), x = w(() => U(A.name, e), [e]), g = w(() => {
|
|
333
343
|
e.chain().focus().setKatex({ text: r }).run(), h(!1);
|
|
334
344
|
}, [e, r]);
|
|
335
|
-
|
|
336
|
-
n && (h(!0), e.chain().updateAttributes(
|
|
337
|
-
}, [e, n, h]),
|
|
338
|
-
l && i(
|
|
345
|
+
k(() => {
|
|
346
|
+
n && (h(!0), e.chain().updateAttributes(A.name, { defaultShowPicker: !1 }).focus().run());
|
|
347
|
+
}, [e, n, h]), k(() => {
|
|
348
|
+
l && i(s || "");
|
|
339
349
|
}, [l]);
|
|
340
|
-
const f =
|
|
350
|
+
const f = D(() => {
|
|
341
351
|
try {
|
|
342
352
|
return ue.renderToString(`${r}`);
|
|
343
353
|
} catch {
|
|
344
354
|
return r;
|
|
345
355
|
}
|
|
346
|
-
}, [r]), M =
|
|
356
|
+
}, [r]), M = D(
|
|
347
357
|
() => `${r}`.trim() ? /* @__PURE__ */ t(
|
|
348
358
|
"span",
|
|
349
359
|
{
|
|
@@ -354,29 +364,34 @@ function _e({ editor: e, ...s }) {
|
|
|
354
364
|
[r, f]
|
|
355
365
|
);
|
|
356
366
|
return /* @__PURE__ */ t(
|
|
357
|
-
|
|
367
|
+
P,
|
|
358
368
|
{
|
|
359
369
|
editor: e,
|
|
360
370
|
pluginKey: "Katex-bubble-menu",
|
|
361
371
|
shouldShow: m,
|
|
362
|
-
|
|
363
|
-
popperOptions: {
|
|
364
|
-
|
|
365
|
-
},
|
|
372
|
+
options: {
|
|
373
|
+
// popperOptions: {
|
|
374
|
+
// modifiers: [{ name: 'flip', enabled: false }],
|
|
375
|
+
// },
|
|
376
|
+
// placement: 'bottom-start',
|
|
377
|
+
// offset: [-2, 16],
|
|
378
|
+
// zIndex: 9999,
|
|
379
|
+
// onHidden: () => {
|
|
380
|
+
// toggleVisible(false);
|
|
381
|
+
// },
|
|
366
382
|
placement: "bottom-start",
|
|
367
|
-
offset:
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
h(!1);
|
|
383
|
+
offset: {
|
|
384
|
+
alignmentAxis: 6,
|
|
385
|
+
crossAxis: 6
|
|
371
386
|
}
|
|
372
387
|
},
|
|
373
|
-
children:
|
|
388
|
+
children: a != null && a.disabled ? /* @__PURE__ */ t(v, {}) : /* @__PURE__ */ t("div", { className: "richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black", children: l ? /* @__PURE__ */ p(v, { children: [
|
|
374
389
|
/* @__PURE__ */ t(
|
|
375
390
|
ie,
|
|
376
391
|
{
|
|
377
392
|
autoFocus: !0,
|
|
378
|
-
defaultValue:
|
|
379
|
-
onChange: (
|
|
393
|
+
defaultValue: s,
|
|
394
|
+
onChange: (T) => i(T.target.value),
|
|
380
395
|
placeholder: "Formula text",
|
|
381
396
|
rows: 3,
|
|
382
397
|
style: { marginBottom: 8 },
|
|
@@ -384,12 +399,12 @@ function _e({ editor: e, ...s }) {
|
|
|
384
399
|
}
|
|
385
400
|
),
|
|
386
401
|
M && /* @__PURE__ */ t("div", { className: "richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]", children: M }),
|
|
387
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ p("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
|
|
388
403
|
/* @__PURE__ */ t(
|
|
389
|
-
|
|
404
|
+
R,
|
|
390
405
|
{
|
|
391
406
|
className: "richtext-flex-1",
|
|
392
|
-
onClick:
|
|
407
|
+
onClick: g,
|
|
393
408
|
children: "Submit"
|
|
394
409
|
}
|
|
395
410
|
),
|
|
@@ -403,7 +418,7 @@ function _e({ editor: e, ...s }) {
|
|
|
403
418
|
}
|
|
404
419
|
)
|
|
405
420
|
] })
|
|
406
|
-
] }) : /* @__PURE__ */
|
|
421
|
+
] }) : /* @__PURE__ */ p("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]", children: [
|
|
407
422
|
/* @__PURE__ */ t(
|
|
408
423
|
S,
|
|
409
424
|
{
|
|
@@ -424,29 +439,29 @@ function _e({ editor: e, ...s }) {
|
|
|
424
439
|
}
|
|
425
440
|
);
|
|
426
441
|
}
|
|
427
|
-
let
|
|
428
|
-
function
|
|
429
|
-
const [
|
|
442
|
+
let E = !1;
|
|
443
|
+
function Ce({ editor: e, attrs: a, extension: o }) {
|
|
444
|
+
const [s, n] = y(!1), r = O(null), i = O(null), { alt: l, align: h } = a, m = o == null ? void 0 : o.options.upload, x = () => {
|
|
430
445
|
(async () => {
|
|
431
446
|
const c = document.querySelector("#easydrawer");
|
|
432
|
-
c && (r.current = new
|
|
447
|
+
c && (r.current = new be(c, {
|
|
433
448
|
wheelEventsEnabled: !1,
|
|
434
449
|
disableZoom: !0
|
|
435
|
-
}), i.current =
|
|
450
|
+
}), i.current = pe(r.current), i.current.addDefaultToolWidgets(), r.current.loadFromSVG(decodeURIComponent(l)));
|
|
436
451
|
})();
|
|
437
452
|
};
|
|
438
|
-
|
|
439
|
-
|
|
453
|
+
k(() => {
|
|
454
|
+
s && setTimeout(() => {
|
|
440
455
|
x();
|
|
441
456
|
}, 200);
|
|
442
|
-
}, [
|
|
443
|
-
const
|
|
457
|
+
}, [s]);
|
|
458
|
+
const g = async () => {
|
|
444
459
|
if (r.current) {
|
|
445
460
|
const u = r.current.toSVG(), c = u.outerHTML, d = `drawer-${re()}.svg`;
|
|
446
461
|
let F = ne(u.outerHTML);
|
|
447
462
|
if (m) {
|
|
448
|
-
const
|
|
449
|
-
F = await m(
|
|
463
|
+
const ce = ee(F, d);
|
|
464
|
+
F = await m(ce);
|
|
450
465
|
}
|
|
451
466
|
e == null || e.chain().focus().setDrawer(
|
|
452
467
|
{
|
|
@@ -466,35 +481,35 @@ function Te({ editor: e, attrs: s, extension: o }) {
|
|
|
466
481
|
}, M = (u) => {
|
|
467
482
|
const c = r.current.toolController.getPrimaryTools()[2], d = i.current.getWidgetById("pen-1");
|
|
468
483
|
c && d && (c.setThickness(u), d.serializeState());
|
|
469
|
-
},
|
|
484
|
+
}, T = (u) => {
|
|
470
485
|
const c = r.current.toolController.getPrimaryTools()[3], d = i.current.getWidgetById("pen-2");
|
|
471
486
|
c && d && (c.setColor(u), d.serializeState());
|
|
472
|
-
},
|
|
487
|
+
}, L = (u) => {
|
|
473
488
|
const c = i.current.getWidgetById("shape");
|
|
474
489
|
c && c.setShapeType(u);
|
|
475
|
-
},
|
|
490
|
+
}, I = (u) => {
|
|
476
491
|
const c = r.current.toolController.getPrimaryTools()[5], d = i.current.getWidgetById("shape");
|
|
477
492
|
c && d && (c.setColor(u), d.serializeState());
|
|
478
493
|
}, $ = (u) => {
|
|
479
494
|
const c = r.current.toolController.getPrimaryTools()[5], d = i.current.getWidgetById("shape");
|
|
480
495
|
c && d && (c.setThickness(u), d.serializeState());
|
|
481
|
-
},
|
|
496
|
+
}, H = (u) => {
|
|
482
497
|
const c = r.current.toolController.getPrimaryTools()[5], d = i.current.getWidgetById("shape");
|
|
483
498
|
c && d && (c.setBorderColor(u), d.serializeState());
|
|
484
|
-
},
|
|
485
|
-
if (
|
|
499
|
+
}, b = () => {
|
|
500
|
+
if (E) {
|
|
486
501
|
for (; r.current.history.redoStackSize > 0; )
|
|
487
502
|
r.current.history.redo();
|
|
488
|
-
|
|
503
|
+
E = !1;
|
|
489
504
|
return;
|
|
490
505
|
}
|
|
491
506
|
r.current.history.undo();
|
|
492
507
|
};
|
|
493
|
-
return /* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ p(
|
|
494
509
|
Z,
|
|
495
510
|
{
|
|
496
511
|
onOpenChange: n,
|
|
497
|
-
open:
|
|
512
|
+
open: s,
|
|
498
513
|
children: [
|
|
499
514
|
/* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ t(
|
|
500
515
|
S,
|
|
@@ -504,9 +519,9 @@ function Te({ editor: e, attrs: s, extension: o }) {
|
|
|
504
519
|
tooltip: "Edit Drawer"
|
|
505
520
|
}
|
|
506
521
|
) }),
|
|
507
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ p(Q, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
508
523
|
/* @__PURE__ */ t(X, { children: "Edit Drawer" }),
|
|
509
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ p("div", { style: { height: "100%", borderWidth: 1, background: "white", position: "relative" }, children: [
|
|
510
525
|
/* @__PURE__ */ t(
|
|
511
526
|
"div",
|
|
512
527
|
{
|
|
@@ -515,34 +530,34 @@ function Te({ editor: e, attrs: s, extension: o }) {
|
|
|
515
530
|
}
|
|
516
531
|
),
|
|
517
532
|
/* @__PURE__ */ t(
|
|
518
|
-
|
|
533
|
+
ge,
|
|
519
534
|
{
|
|
520
|
-
changeBorderColorShape:
|
|
521
|
-
changeColorShape:
|
|
522
|
-
changeShape:
|
|
535
|
+
changeBorderColorShape: H,
|
|
536
|
+
changeColorShape: I,
|
|
537
|
+
changeShape: L,
|
|
523
538
|
onClear: () => {
|
|
524
|
-
if (!
|
|
539
|
+
if (!E) {
|
|
525
540
|
for (; r.current.history.undoStackSize > 0; )
|
|
526
|
-
|
|
527
|
-
|
|
541
|
+
b();
|
|
542
|
+
E = !0;
|
|
528
543
|
}
|
|
529
544
|
},
|
|
530
545
|
onRedo: () => {
|
|
531
|
-
|
|
546
|
+
E || r.current.history.redo();
|
|
532
547
|
},
|
|
533
548
|
onThicknessChange: $,
|
|
534
|
-
onUndo:
|
|
549
|
+
onUndo: b,
|
|
535
550
|
refEditor: r,
|
|
536
|
-
setColorHighlight:
|
|
551
|
+
setColorHighlight: T,
|
|
537
552
|
setColorPen: f,
|
|
538
553
|
setThicknessPen: M
|
|
539
554
|
}
|
|
540
555
|
)
|
|
541
556
|
] }),
|
|
542
557
|
/* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(
|
|
543
|
-
|
|
558
|
+
R,
|
|
544
559
|
{
|
|
545
|
-
onClick:
|
|
560
|
+
onClick: g,
|
|
546
561
|
type: "button",
|
|
547
562
|
children: "Save changes"
|
|
548
563
|
}
|
|
@@ -552,54 +567,47 @@ function Te({ editor: e, attrs: s, extension: o }) {
|
|
|
552
567
|
}
|
|
553
568
|
);
|
|
554
569
|
}
|
|
555
|
-
|
|
556
|
-
maxWidth: "auto",
|
|
557
|
-
zIndex: 20,
|
|
558
|
-
appendTo: "parent",
|
|
559
|
-
moveTransition: "transform 0.1s ease-out"
|
|
560
|
-
};
|
|
561
|
-
function ke({ item: e, disabled: s, editor: o }) {
|
|
570
|
+
function ke({ item: e, disabled: a, editor: o }) {
|
|
562
571
|
var n;
|
|
563
|
-
const
|
|
564
|
-
return
|
|
572
|
+
const s = e.component;
|
|
573
|
+
return s ? /* @__PURE__ */ t(G, { children: e.type === "divider" ? /* @__PURE__ */ t(
|
|
565
574
|
te,
|
|
566
575
|
{
|
|
567
576
|
className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
|
|
568
577
|
orientation: "vertical"
|
|
569
578
|
}
|
|
570
579
|
) : /* @__PURE__ */ t(
|
|
571
|
-
|
|
580
|
+
s,
|
|
572
581
|
{
|
|
573
582
|
...e.componentProps,
|
|
574
|
-
disabled:
|
|
583
|
+
disabled: a || ((n = e == null ? void 0 : e.componentProps) == null ? void 0 : n.disabled),
|
|
575
584
|
editor: o
|
|
576
585
|
}
|
|
577
586
|
) }) : /* @__PURE__ */ t(v, {});
|
|
578
587
|
}
|
|
579
|
-
function
|
|
588
|
+
function Me(e) {
|
|
580
589
|
return e.type.name === "drawer";
|
|
581
590
|
}
|
|
582
|
-
function
|
|
583
|
-
const { lang:
|
|
591
|
+
function je(e) {
|
|
592
|
+
const { lang: a } = z(), o = W(e.editor, _.name), s = oe(e.editor, _.name), n = ({ editor: i }) => {
|
|
584
593
|
const { selection: l } = i.view.state, { $from: h, to: m } = l;
|
|
585
594
|
let x = !1;
|
|
586
|
-
return i.view.state.doc.nodesBetween(h.pos, m, (
|
|
587
|
-
if (
|
|
595
|
+
return i.view.state.doc.nodesBetween(h.pos, m, (g) => {
|
|
596
|
+
if (Me(g))
|
|
588
597
|
return x = !0, !1;
|
|
589
598
|
}), x;
|
|
590
|
-
}, r =
|
|
599
|
+
}, r = D(() => e.disabled ? [] : le(e.editor), [e.disabled, e.editor, a]);
|
|
591
600
|
return /* @__PURE__ */ t(
|
|
592
|
-
|
|
601
|
+
P,
|
|
593
602
|
{
|
|
594
603
|
editor: e == null ? void 0 : e.editor,
|
|
595
604
|
shouldShow: n,
|
|
596
|
-
tippyOptions: Me,
|
|
597
605
|
children: r != null && r.length ? /* @__PURE__ */ t("div", { className: "richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800", children: /* @__PURE__ */ t("div", { className: "richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap", children: r == null ? void 0 : r.map((i, l) => i.type === "edit" && (o != null && o.src) ? /* @__PURE__ */ t(
|
|
598
|
-
|
|
606
|
+
Ce,
|
|
599
607
|
{
|
|
600
608
|
attrs: o,
|
|
601
609
|
editor: e.editor,
|
|
602
|
-
extension:
|
|
610
|
+
extension: s
|
|
603
611
|
},
|
|
604
612
|
`bubbleMenu-drawer-${l}`
|
|
605
613
|
) : /* @__PURE__ */ t(
|
|
@@ -615,9 +623,9 @@ function qe(e) {
|
|
|
615
623
|
);
|
|
616
624
|
}
|
|
617
625
|
export {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
626
|
+
je as BubbleMenuDrawer,
|
|
627
|
+
Ue as BubbleMenuExcalidraw,
|
|
628
|
+
Ve as BubbleMenuKatex,
|
|
629
|
+
Re as BubbleMenuMermaid,
|
|
630
|
+
He as BubbleMenuTwitter
|
|
623
631
|
};
|