reactjs-tiptap-editor 0.3.29 → 0.3.31
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/lib/{ActionMenuButton-5Y8QcYxD.cjs → ActionMenuButton-BCgqJsST.cjs} +1 -1
- package/lib/{ActionMenuButton-Cs9DM_16.js → ActionMenuButton-D97K0UWT.js} +5 -5
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +4 -4
- package/lib/Attachment.d.ts +4 -4
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +4 -4
- package/lib/Blockquote.d.ts +4 -4
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +4 -4
- package/lib/Bold.d.ts +4 -4
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +4 -4
- package/lib/BulletList.d.ts +4 -4
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +4 -4
- package/lib/Clear.d.ts +4 -4
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +4 -4
- package/lib/Code.d.ts +4 -4
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +4 -4
- package/lib/CodeBlock.d.ts +4 -4
- package/lib/CodeBlock.js +3 -2
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +4 -4
- package/lib/CodeView.d.ts +4 -4
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +4 -4
- package/lib/Color.d.ts +4 -4
- package/lib/Color.js +2 -2
- package/lib/Document.d.cts +4 -4
- package/lib/Document.d.ts +4 -4
- package/lib/Drawer-5Q_-WRhc.cjs +1 -0
- package/lib/{Drawer-BCmNLh31.js → Drawer-BHkje8ys.js} +250 -249
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +4 -4
- package/lib/Drawer.d.ts +4 -4
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +4 -4
- package/lib/Emoji.d.ts +4 -4
- package/lib/Emoji.js +22 -21
- package/lib/Excalidraw-CG498239.js +290 -0
- package/lib/Excalidraw-GUVW-IqC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +4 -4
- package/lib/Excalidraw.d.ts +4 -4
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +4 -4
- package/lib/ExportPdf.d.ts +4 -4
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +4 -4
- package/lib/ExportWord.d.ts +4 -4
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +4 -4
- package/lib/FontFamily.d.ts +4 -4
- package/lib/FontFamily.js +11 -10
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +4 -4
- package/lib/FontSize.d.ts +4 -4
- package/lib/FontSize.js +6 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +4 -4
- package/lib/FormatPainter.d.ts +4 -4
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +4 -4
- package/lib/Heading.d.ts +4 -4
- package/lib/Heading.js +32 -31
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +4 -4
- package/lib/Highlight.d.ts +4 -4
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +4 -4
- package/lib/History.d.ts +4 -4
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +4 -4
- package/lib/HorizontalRule.d.ts +4 -4
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +4 -4
- package/lib/Iframe.d.ts +4 -4
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +4 -4
- package/lib/Image.d.ts +4 -4
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +4 -4
- package/lib/ImageGif.d.ts +4 -4
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.d.cts +4 -4
- package/lib/ImportWord.d.ts +4 -4
- package/lib/ImportWord.js +3 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +4 -4
- package/lib/Indent.d.ts +4 -4
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +4 -4
- package/lib/Italic.d.ts +4 -4
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +4 -4
- package/lib/Katex.d.ts +4 -4
- package/lib/Katex.js +41 -40
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +4 -4
- package/lib/LineHeight.d.ts +4 -4
- package/lib/LineHeight.js +17 -16
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +4 -4
- package/lib/Link.d.ts +4 -4
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +4 -4
- package/lib/ListItem.d.ts +4 -4
- package/lib/Mention.d.cts +4 -4
- package/lib/Mention.d.ts +4 -4
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +4 -4
- package/lib/Mermaid.d.ts +4 -4
- package/lib/Mermaid.js +138 -137
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +4 -4
- package/lib/MoreMark.d.ts +4 -4
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +4 -4
- package/lib/MultiColumn.d.ts +4 -4
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +4 -4
- package/lib/OrderedList.d.ts +4 -4
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-DsUcQSbm.cjs → RichTextEditor-DWlLqTl9.cjs} +4 -4
- package/lib/{RichTextEditor-e6q30rbV.js → RichTextEditor-KP2Rgcqe.js} +18 -44
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +4 -4
- package/lib/SearchAndReplace.d.ts +4 -4
- package/lib/SearchAndReplace.js +68 -67
- package/lib/Selection.d.cts +4 -4
- package/lib/Selection.d.ts +4 -4
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +4 -4
- package/lib/SlashCommand.d.ts +4 -4
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +4 -4
- package/lib/Strike.d.ts +4 -4
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +4 -4
- package/lib/SubAndSuperScript.d.ts +4 -4
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +4 -4
- package/lib/Table.d.ts +4 -4
- package/lib/Table.js +2 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +4 -4
- package/lib/TableOfContent.d.ts +4 -4
- package/lib/TableOfContent.js +50 -49
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +4 -4
- package/lib/TaskList.d.ts +4 -4
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +4 -4
- package/lib/TextAlign.d.ts +4 -4
- package/lib/TextAlign.js +8 -7
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +4 -4
- package/lib/TextBubble.d.ts +4 -4
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +4 -4
- package/lib/TextDirection.d.ts +4 -4
- package/lib/TextDirection.js +14 -13
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +4 -4
- package/lib/TextUnderline.d.ts +4 -4
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +4 -4
- package/lib/TrailingNode.d.ts +4 -4
- package/lib/{Twitter-Wb7cD3M-.js → Twitter-99ivY5qv.js} +62 -61
- package/lib/{Twitter-D2Osj8qP.cjs → Twitter-BvfvUtNT.cjs} +2 -2
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +4 -4
- package/lib/Twitter.d.ts +4 -4
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +4 -4
- package/lib/Video.d.ts +4 -4
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +4 -4
- package/lib/bubble-extra.d.ts +4 -4
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +5 -4
- package/lib/index.d.ts +5 -4
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +4 -4
- package/lib/locale-bundle.d.ts +4 -4
- package/lib/style.css +1 -1
- package/lib/{textarea-Csmx5x-_.js → textarea-CktfkXNe.js} +1 -1
- package/lib/{textarea-BVbzd9-k.cjs → textarea-DdH64g04.cjs} +1 -1
- package/package.json +1 -1
- package/lib/Drawer-DCAp7eZF.cjs +0 -1
- package/lib/Excalidraw-BI50RQL-.cjs +0 -1
- package/lib/Excalidraw-CYPcjYZB.js +0 -289
package/lib/Katex.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { N as b, n as g, m as w } from "./index-DI9T3iLd.js";
|
|
2
2
|
import { N as k, R as N } from "./dom-dataset-Di3tIRrR.js";
|
|
3
|
-
import { jsx as n, jsxs as
|
|
4
|
-
import { useState as T, useCallback as $, useEffect as v, useMemo as
|
|
3
|
+
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
4
|
+
import { useState as T, useCallback as $, useEffect as v, useMemo as l } from "react";
|
|
5
5
|
import x from "katex";
|
|
6
6
|
import { HelpCircle as A } from "lucide-react";
|
|
7
|
-
import { O as S, P as L, m as P, A as C, n as H, L as I, B as M, Q as y } from "./RichTextEditor-
|
|
8
|
-
import { T as K } from "./textarea-
|
|
7
|
+
import { O as S, P as L, m as P, A as C, n as H, L as I, B as M, Q as y } from "./RichTextEditor-KP2Rgcqe.js";
|
|
8
|
+
import { T as K } from "./textarea-CktfkXNe.js";
|
|
9
9
|
import { u as R } from "./index-CsK90iVd.js";
|
|
10
|
-
function V({ editor:
|
|
11
|
-
const { t: a } = R(), o = S(
|
|
10
|
+
function V({ editor: e, ...t }) {
|
|
11
|
+
const { t: a } = R(), o = S(e, h.name, {
|
|
12
12
|
text: "",
|
|
13
13
|
defaultShowPicker: !1
|
|
14
|
-
}), { text: s, defaultShowPicker: r } = o, [i,
|
|
15
|
-
|
|
16
|
-
}, [
|
|
14
|
+
}), { text: s, defaultShowPicker: r } = o, [i, u] = T(""), f = $(() => {
|
|
15
|
+
e.chain().focus().setKatex({ text: i }).run(), u("");
|
|
16
|
+
}, [e, i]);
|
|
17
17
|
v(() => {
|
|
18
|
-
r &&
|
|
19
|
-
}, [
|
|
20
|
-
const m =
|
|
18
|
+
r && e.chain().updateAttributes(h.name, { defaultShowPicker: !1 }).focus().run();
|
|
19
|
+
}, [e, r]);
|
|
20
|
+
const m = l(() => {
|
|
21
21
|
try {
|
|
22
22
|
return x.renderToString(`${i}`);
|
|
23
23
|
} catch {
|
|
24
24
|
return i;
|
|
25
25
|
}
|
|
26
|
-
}, [i]), d =
|
|
26
|
+
}, [i]), d = l(
|
|
27
27
|
() => `${i}`.trim() ? /* @__PURE__ */ n(
|
|
28
28
|
"span",
|
|
29
29
|
{
|
|
@@ -33,15 +33,16 @@ function V({ editor: t, ...e }) {
|
|
|
33
33
|
) : null,
|
|
34
34
|
[i, m]
|
|
35
35
|
);
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ c(L, { modal: !0, children: [
|
|
37
37
|
/* @__PURE__ */ n(P, { asChild: !0, children: /* @__PURE__ */ n(
|
|
38
38
|
C,
|
|
39
39
|
{
|
|
40
|
-
icon:
|
|
41
|
-
tooltip:
|
|
40
|
+
icon: t == null ? void 0 : t.icon,
|
|
41
|
+
tooltip: t == null ? void 0 : t.tooltip,
|
|
42
|
+
tooltipOptions: t == null ? void 0 : t.tooltipOptions
|
|
42
43
|
}
|
|
43
44
|
) }),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ c(
|
|
45
46
|
H,
|
|
46
47
|
{
|
|
47
48
|
align: "start",
|
|
@@ -56,7 +57,7 @@ function V({ editor: t, ...e }) {
|
|
|
56
57
|
autoFocus: !0,
|
|
57
58
|
className: "richtext-w-full",
|
|
58
59
|
defaultValue: s,
|
|
59
|
-
onChange: (p) =>
|
|
60
|
+
onChange: (p) => u(p.target.value),
|
|
60
61
|
placeholder: "Text",
|
|
61
62
|
required: !0,
|
|
62
63
|
rows: 3,
|
|
@@ -64,7 +65,7 @@ function V({ editor: t, ...e }) {
|
|
|
64
65
|
}
|
|
65
66
|
) }) }),
|
|
66
67
|
d && /* @__PURE__ */ n("div", { className: "richtext-my-[10px] richtext-max-w-[286px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]", children: d }),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ c("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
|
|
68
69
|
/* @__PURE__ */ n(
|
|
69
70
|
M,
|
|
70
71
|
{
|
|
@@ -88,29 +89,29 @@ function V({ editor: t, ...e }) {
|
|
|
88
89
|
)
|
|
89
90
|
] });
|
|
90
91
|
}
|
|
91
|
-
function B(
|
|
92
|
+
function B(e, t = 1) {
|
|
92
93
|
let a = 0, o = 0, s = 0;
|
|
93
|
-
if (
|
|
94
|
-
const r =
|
|
94
|
+
if (e.startsWith("rgb")) {
|
|
95
|
+
const r = e.replace(/\s/g, "").match(/rgb\((.*)\)$/)[1].split(",");
|
|
95
96
|
a = +r[0], o = +r[1], s = +r[2];
|
|
96
|
-
} else if (
|
|
97
|
-
let r =
|
|
97
|
+
} else if (e.startsWith("#")) {
|
|
98
|
+
let r = e.replace("#", "");
|
|
98
99
|
r.length === 3 && (r = `${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`), a = Number.parseInt(r.substring(0, 2), 16), o = Number.parseInt(r.substring(2, 4), 16), s = Number.parseInt(r.substring(4, 6), 16);
|
|
99
100
|
} else
|
|
100
|
-
return
|
|
101
|
-
return
|
|
101
|
+
return e;
|
|
102
|
+
return t > 1 && t <= 100 && (t = t / 100), `rgba(${a},${o},${s},${t})`;
|
|
102
103
|
}
|
|
103
|
-
function W({ node:
|
|
104
|
-
const
|
|
104
|
+
function W({ node: e }) {
|
|
105
|
+
const t = y(), { text: a } = e.attrs, o = l(() => {
|
|
105
106
|
const i = "rgb(254, 242, 237)";
|
|
106
|
-
return
|
|
107
|
-
}, [
|
|
107
|
+
return t === "dark" ? B(i, 0.75) : i;
|
|
108
|
+
}, [t]), s = l(() => {
|
|
108
109
|
try {
|
|
109
110
|
return x.renderToString(`${a}`);
|
|
110
111
|
} catch {
|
|
111
112
|
return a;
|
|
112
113
|
}
|
|
113
|
-
}, [a]), r =
|
|
114
|
+
}, [a]), r = l(
|
|
114
115
|
() => a.trim() ? /* @__PURE__ */ n("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ n("span", { contentEditable: !1, children: "Not enter a formula" }),
|
|
115
116
|
[a, s]
|
|
116
117
|
);
|
|
@@ -126,8 +127,8 @@ function W({ node: t }) {
|
|
|
126
127
|
}
|
|
127
128
|
);
|
|
128
129
|
}
|
|
129
|
-
function _(
|
|
130
|
-
return (
|
|
130
|
+
function _(e) {
|
|
131
|
+
return (t) => t.getAttribute(e);
|
|
131
132
|
}
|
|
132
133
|
const h = /* @__PURE__ */ b.create({
|
|
133
134
|
name: "katex",
|
|
@@ -141,15 +142,15 @@ const h = /* @__PURE__ */ b.create({
|
|
|
141
142
|
HTMLAttributes: {
|
|
142
143
|
class: "katex"
|
|
143
144
|
},
|
|
144
|
-
button: ({ editor:
|
|
145
|
+
button: ({ editor: e, t }) => ({
|
|
145
146
|
component: V,
|
|
146
147
|
componentProps: {
|
|
147
|
-
editor:
|
|
148
|
+
editor: e,
|
|
148
149
|
action: () => !0,
|
|
149
150
|
isActive: () => !1,
|
|
150
151
|
disabled: !1,
|
|
151
152
|
icon: "KatexIcon",
|
|
152
|
-
tooltip:
|
|
153
|
+
tooltip: t("editor.katex.tooltip")
|
|
153
154
|
}
|
|
154
155
|
})
|
|
155
156
|
};
|
|
@@ -168,14 +169,14 @@ const h = /* @__PURE__ */ b.create({
|
|
|
168
169
|
parseHTML() {
|
|
169
170
|
return [{ tag: "span.katex" }];
|
|
170
171
|
},
|
|
171
|
-
renderHTML({ HTMLAttributes:
|
|
172
|
-
return ["span", w(this.options && this.options.HTMLAttributes || {},
|
|
172
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
173
|
+
return ["span", w(this.options && this.options.HTMLAttributes || {}, e)];
|
|
173
174
|
},
|
|
174
175
|
addCommands() {
|
|
175
176
|
return {
|
|
176
|
-
setKatex: (
|
|
177
|
+
setKatex: (e) => ({ commands: t }) => t.insertContent({
|
|
177
178
|
type: this.name,
|
|
178
|
-
attrs:
|
|
179
|
+
attrs: e
|
|
179
180
|
})
|
|
180
181
|
};
|
|
181
182
|
},
|
package/lib/LineHeight.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-ByRfqzMr.cjs"),g=require("./index-D_A0TBRA.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-ByRfqzMr.cjs"),g=require("./index-D_A0TBRA.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-DWlLqTl9.cjs");function T(e){return Number.parseFloat(e.replace("%",""))/100}function x(e){const{t}=g.useLocale(),[n,a]=L.useState("default");function o(i){i==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(i),a(i)}const d=L.useMemo(()=>{const s=e.editor.extensionManager.extensions.find(l=>l.name==="lineHeight").options.lineHeights.map(l=>({label:T(l),value:l}));return s.unshift({label:t("editor.default"),value:"default"}),s},[e]);return c.jsxs(u.DropdownMenu,{children:[c.jsx(u.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(u.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:e==null?void 0:e.disabled,icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,tooltipOptions:e==null?void 0:e.tooltipOptions,children:c.jsx(u.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),c.jsx(u.DropdownMenuContent,{className:"richtext-min-w-24",children:d==null?void 0:d.map((i,h)=>c.jsx(u.DropdownMenuCheckboxItem,{checked:i.value===n,onClick:()=>o(i.value),children:i.label},`lineHeight-${h}`))})]})}const _=["paragraph","heading","list_item","todo_item"];function E(e,t){const{selection:n,doc:a}=e;if(!n||!a||!(n instanceof m.TextSelection||n instanceof m.AllSelection))return e;const{from:o,to:d}=n,i=[],h=t&&t!==g.DEFAULT_LINE_HEIGHT?t:null;if(a.nodesBetween(o,d,(s,l)=>{const r=s.type;return _.includes(r.name)?((s.attrs.lineHeight||null)!==h&&i.push({node:s,pos:l,nodeType:r}),r.name!=="list_item"&&r.name!=="todo_item"):!0}),i.length===0)return e;for(const s of i){const{node:l,pos:r,nodeType:f}=s;let{attrs:H}=l;H={...H,lineHeight:h},e=e.setNodeMarkup(r,f,H,l.marks)}return e}function b(e){return({state:t,dispatch:n})=>{const{selection:a}=t;let{tr:o}=t;return o=o.setSelection(a),o=E(o,e),o.docChanged?(n&&n(o),!0):!1}}const I=m.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:g.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:g.DEFAULT_LINE_HEIGHT,button({editor:t,t:n}){return{component:x,componentProps:{editor:t,tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>b(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}});exports.DEFAULT_LINE_HEIGHT_LIST=g.DEFAULT_LINE_HEIGHT_LIST;exports.LineHeight=I;
|
package/lib/LineHeight.d.cts
CHANGED
|
@@ -138,8 +138,8 @@ declare module '@tiptap/core' {
|
|
|
138
138
|
|
|
139
139
|
declare module '@tiptap/core' {
|
|
140
140
|
interface Commands<ReturnType> {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
excalidraw: {
|
|
142
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -147,8 +147,8 @@ declare module '@tiptap/core' {
|
|
|
147
147
|
|
|
148
148
|
declare module '@tiptap/core' {
|
|
149
149
|
interface Commands<ReturnType> {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
exportPdf: {
|
|
151
|
+
exportToPdf: () => ReturnType;
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
}
|
package/lib/LineHeight.d.ts
CHANGED
|
@@ -138,8 +138,8 @@ declare module '@tiptap/core' {
|
|
|
138
138
|
|
|
139
139
|
declare module '@tiptap/core' {
|
|
140
140
|
interface Commands<ReturnType> {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
excalidraw: {
|
|
142
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -147,8 +147,8 @@ declare module '@tiptap/core' {
|
|
|
147
147
|
|
|
148
148
|
declare module '@tiptap/core' {
|
|
149
149
|
interface Commands<ReturnType> {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
exportPdf: {
|
|
151
|
+
exportToPdf: () => ReturnType;
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
}
|
package/lib/LineHeight.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { T as f, A as H, E as L } from "./index-DI9T3iLd.js";
|
|
2
2
|
import { u as x, k as g, m as T } from "./index-CsK90iVd.js";
|
|
3
3
|
import { jsxs as b, jsx as h } from "react/jsx-runtime";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { D, e as
|
|
6
|
-
function
|
|
4
|
+
import { useState as _, useMemo as D } from "react";
|
|
5
|
+
import { D as E, e as M, A as w, k as A, f as C, h as y } from "./RichTextEditor-KP2Rgcqe.js";
|
|
6
|
+
function k(e) {
|
|
7
7
|
return Number.parseFloat(e.replace("%", "")) / 100;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const { t } = x(), [n, s] =
|
|
9
|
+
function p(e) {
|
|
10
|
+
const { t } = x(), [n, s] = _("default");
|
|
11
11
|
function o(i) {
|
|
12
12
|
i === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(i), s(i);
|
|
13
13
|
}
|
|
14
|
-
const c =
|
|
14
|
+
const c = D(() => {
|
|
15
15
|
const a = e.editor.extensionManager.extensions.find(
|
|
16
16
|
(l) => l.name === "lineHeight"
|
|
17
17
|
).options.lineHeights.map((l) => ({
|
|
18
|
-
label:
|
|
18
|
+
label: k(l),
|
|
19
19
|
value: l
|
|
20
20
|
}));
|
|
21
21
|
return a.unshift({
|
|
@@ -23,21 +23,22 @@ function k(e) {
|
|
|
23
23
|
value: "default"
|
|
24
24
|
}), a;
|
|
25
25
|
}, [e]);
|
|
26
|
-
return /* @__PURE__ */ b(
|
|
26
|
+
return /* @__PURE__ */ b(E, { children: [
|
|
27
27
|
/* @__PURE__ */ h(
|
|
28
|
-
|
|
28
|
+
M,
|
|
29
29
|
{
|
|
30
30
|
asChild: !0,
|
|
31
31
|
disabled: e == null ? void 0 : e.disabled,
|
|
32
32
|
children: /* @__PURE__ */ h(
|
|
33
|
-
|
|
33
|
+
w,
|
|
34
34
|
{
|
|
35
35
|
customClass: "!richtext-w-12 richtext-h-12",
|
|
36
36
|
disabled: e == null ? void 0 : e.disabled,
|
|
37
37
|
icon: "LineHeight",
|
|
38
38
|
tooltip: e == null ? void 0 : e.tooltip,
|
|
39
|
+
tooltipOptions: e == null ? void 0 : e.tooltipOptions,
|
|
39
40
|
children: /* @__PURE__ */ h(
|
|
40
|
-
|
|
41
|
+
A,
|
|
41
42
|
{
|
|
42
43
|
className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
|
|
43
44
|
name: "MenuDown"
|
|
@@ -47,8 +48,8 @@ function k(e) {
|
|
|
47
48
|
)
|
|
48
49
|
}
|
|
49
50
|
),
|
|
50
|
-
/* @__PURE__ */ h(
|
|
51
|
-
|
|
51
|
+
/* @__PURE__ */ h(C, { className: "richtext-min-w-24", children: c == null ? void 0 : c.map((i, u) => /* @__PURE__ */ h(
|
|
52
|
+
y,
|
|
52
53
|
{
|
|
53
54
|
checked: i.value === n,
|
|
54
55
|
onClick: () => o(i.value),
|
|
@@ -83,7 +84,7 @@ function N(e, t) {
|
|
|
83
84
|
}
|
|
84
85
|
return e;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function O(e) {
|
|
87
88
|
return ({ state: t, dispatch: n }) => {
|
|
88
89
|
const { selection: s } = t;
|
|
89
90
|
let { tr: o } = t;
|
|
@@ -101,7 +102,7 @@ const z = /* @__PURE__ */ L.create({
|
|
|
101
102
|
defaultHeight: g,
|
|
102
103
|
button({ editor: t, t: n }) {
|
|
103
104
|
return {
|
|
104
|
-
component:
|
|
105
|
+
component: p,
|
|
105
106
|
componentProps: {
|
|
106
107
|
editor: t,
|
|
107
108
|
tooltip: n("editor.lineheight.tooltip")
|
|
@@ -126,7 +127,7 @@ const z = /* @__PURE__ */ L.create({
|
|
|
126
127
|
},
|
|
127
128
|
addCommands() {
|
|
128
129
|
return {
|
|
129
|
-
setLineHeight: (e) =>
|
|
130
|
+
setLineHeight: (e) => O(e),
|
|
130
131
|
unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
|
|
131
132
|
};
|
|
132
133
|
}
|
package/lib/Link.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-DWlLqTl9.cjs");exports.Link=e.Link;exports.default=e.Link;
|
package/lib/Link.d.cts
CHANGED
|
@@ -136,8 +136,8 @@ declare module '@tiptap/core' {
|
|
|
136
136
|
|
|
137
137
|
declare module '@tiptap/core' {
|
|
138
138
|
interface Commands<ReturnType> {
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
excalidraw: {
|
|
140
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -145,8 +145,8 @@ declare module '@tiptap/core' {
|
|
|
145
145
|
|
|
146
146
|
declare module '@tiptap/core' {
|
|
147
147
|
interface Commands<ReturnType> {
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
exportPdf: {
|
|
149
|
+
exportToPdf: () => ReturnType;
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
}
|
package/lib/Link.d.ts
CHANGED
|
@@ -136,8 +136,8 @@ declare module '@tiptap/core' {
|
|
|
136
136
|
|
|
137
137
|
declare module '@tiptap/core' {
|
|
138
138
|
interface Commands<ReturnType> {
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
excalidraw: {
|
|
140
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -145,8 +145,8 @@ declare module '@tiptap/core' {
|
|
|
145
145
|
|
|
146
146
|
declare module '@tiptap/core' {
|
|
147
147
|
interface Commands<ReturnType> {
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
exportPdf: {
|
|
149
|
+
exportToPdf: () => ReturnType;
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
}
|
package/lib/Link.js
CHANGED
package/lib/ListItem.d.cts
CHANGED
|
@@ -58,8 +58,8 @@ declare module '@tiptap/core' {
|
|
|
58
58
|
|
|
59
59
|
declare module '@tiptap/core' {
|
|
60
60
|
interface Commands<ReturnType> {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
excalidraw: {
|
|
62
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -67,8 +67,8 @@ declare module '@tiptap/core' {
|
|
|
67
67
|
|
|
68
68
|
declare module '@tiptap/core' {
|
|
69
69
|
interface Commands<ReturnType> {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
exportPdf: {
|
|
71
|
+
exportToPdf: () => ReturnType;
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
}
|
package/lib/ListItem.d.ts
CHANGED
|
@@ -58,8 +58,8 @@ declare module '@tiptap/core' {
|
|
|
58
58
|
|
|
59
59
|
declare module '@tiptap/core' {
|
|
60
60
|
interface Commands<ReturnType> {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
excalidraw: {
|
|
62
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -67,8 +67,8 @@ declare module '@tiptap/core' {
|
|
|
67
67
|
|
|
68
68
|
declare module '@tiptap/core' {
|
|
69
69
|
interface Commands<ReturnType> {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
exportPdf: {
|
|
71
|
+
exportToPdf: () => ReturnType;
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
}
|
package/lib/Mention.d.cts
CHANGED
|
@@ -61,8 +61,8 @@ declare module '@tiptap/core' {
|
|
|
61
61
|
|
|
62
62
|
declare module '@tiptap/core' {
|
|
63
63
|
interface Commands<ReturnType> {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
excalidraw: {
|
|
65
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -70,8 +70,8 @@ declare module '@tiptap/core' {
|
|
|
70
70
|
|
|
71
71
|
declare module '@tiptap/core' {
|
|
72
72
|
interface Commands<ReturnType> {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
exportPdf: {
|
|
74
|
+
exportToPdf: () => ReturnType;
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
}
|
package/lib/Mention.d.ts
CHANGED
|
@@ -61,8 +61,8 @@ declare module '@tiptap/core' {
|
|
|
61
61
|
|
|
62
62
|
declare module '@tiptap/core' {
|
|
63
63
|
interface Commands<ReturnType> {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
excalidraw: {
|
|
65
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -70,8 +70,8 @@ declare module '@tiptap/core' {
|
|
|
70
70
|
|
|
71
71
|
declare module '@tiptap/core' {
|
|
72
72
|
interface Commands<ReturnType> {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
exportPdf: {
|
|
74
|
+
exportToPdf: () => ReturnType;
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
}
|
package/lib/Mermaid.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var W=Object.create;var G=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var J=(t,e,r
|
|
2
|
-
a-->b`,ee=({editor:t,upload:e})=>{const[r,
|
|
1
|
+
"use strict";var W=Object.create;var G=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var J=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of U(e))!Y.call(t,l)&&l!==i&&G(t,l,{get:()=>e[l],enumerable:!(r=X(e,l))||r.enumerable});return t};var K=(t,e,i)=>(i=t!=null?W(Z(t)):{},J(e||!t||!t.__esModule?G(i,"default",{value:t,enumerable:!0}):i,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index-ByRfqzMr.cjs"),u=require("./RichTextEditor-DWlLqTl9.cjs"),F=require("./dom-dataset-Byuf1YmW.cjs"),o=require("react/jsx-runtime"),a=require("react"),P=require("./shortId-Bfj8TyNr.cjs"),Q=require("./textarea-DdH64g04.cjs"),E=require("./index-D_A0TBRA.cjs"),$=`graph TB
|
|
2
|
+
a-->b`,ee=({editor:t,upload:e,tooltipOptions:i})=>{const[r,l]=a.useState($),[_,L]=a.useState(""),[p,I]=a.useState(!1),v=a.useRef(null),[c,N]=a.useState(null),C=a.useCallback(d=>{d&&import("mermaid").then(M=>{N(M.default)})},[]),S=async d=>{try{const{svg:M}=await c.render("mermaid-svg",d);L(M)}catch{L("")}},H=()=>{c.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),S(r)};a.useEffect(()=>{c&&p&&H()},[c,p]),a.useEffect(()=>{c&&p&&S(r)},[c&&r]);const x=async()=>{if(r!==""){if(r){const d=v.current.querySelector("svg"),{width:M,height:A}=d.getBoundingClientRect(),O=`mermaid-${P.shortId()}.svg`;let T=P.i(d.outerHTML);if(e){console.log({src:T});const y=u.dataURLtoFile(T,O);T=await e(y)}t==null||t.chain().focus().setMermaid({type:"mermaid",src:T,alt:encodeURIComponent(r),width:M,height:A},!!r).run()}I(!1)}};return o.jsxs(u.Dialog,{onOpenChange:I,open:p,children:[o.jsx(u.DialogTrigger,{asChild:!0,children:o.jsx(u.ActionButton,{action:()=>I(!0),icon:"Mermaid",tooltip:"Mermaid",tooltipOptions:i})}),o.jsxs(u.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[o.jsx(u.DialogTitle,{children:"Mermaid"}),o.jsx("div",{ref:C,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:o.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[o.jsx(Q.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:d=>l(d.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),o.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:_},ref:v,style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),o.jsx(u.DialogFooter,{children:o.jsx(u.Button,{onClick:x,type:"button",children:"Save changes"})})]})]})},j={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function te({editor:t,node:e,updateAttributes:i,getPos:r,selected:l}){const[_,L]=a.useState({width:E.IMAGE_MAX_SIZE,height:E.IMAGE_MAX_SIZE}),[p,I]=a.useState({width:0,height:0}),[v]=a.useState([j.TOP_LEFT,j.TOP_RIGHT,j.BOTTOM_LEFT,j.BOTTOM_RIGHT]),[c,N]=a.useState(!1),[C,S]=a.useState({x:0,y:0,w:0,h:0,dir:""}),{align:H}=e==null?void 0:e.attrs,x=a.useMemo(()=>{const{src:s,alt:g,width:m,height:b}=e==null?void 0:e.attrs,w=q.isNumber(m)?`${m}px`:m,n=q.isNumber(b)?`${b}px`:b;return{src:s||void 0,alt:g||void 0,style:{width:w||void 0,height:n||void 0}}},[e==null?void 0:e.attrs]),d=a.useMemo(()=>{const{style:{width:s}}=x;return{width:s==="100%"?s:void 0}},[x]);function M(s){I({width:s.target.width,height:s.target.height})}function A(){t.commands.setNodeSelection(r())}const O=a.useCallback(u.throttle(()=>{const{width:s}=getComputedStyle(t.view.dom);L(g=>({...g,width:Number.parseInt(s,10)}))},E.IMAGE_THROTTLE_WAIT_TIME),[t]);function T(s,g){s.preventDefault(),s.stopPropagation();const m=p.width,b=p.height,w=m/b;let n=Number(e.attrs.width),f=Number(e.attrs.height);const h=_.width;n&&!f?(n=n>h?h:n,f=Math.round(n/w)):f&&!n?(n=Math.round(f*w),n=n>h?h:n):!n&&!f?(n=m>h?h:m,f=Math.round(n/w)):n=n>h?h:n,N(!0),S({x:s.clientX,y:s.clientY,w:n,h:f,dir:g})}const y=a.useCallback(u.throttle(s=>{if(s.preventDefault(),s.stopPropagation(),!c)return;const{x:g,w:m,dir:b}=C,w=(s.clientX-g)*(/l/.test(b)?-1:1),{width:n,height:f}=e==null?void 0:e.attrs,h=n/f,B=u.clamp(m+w,E.IMAGE_MIN_SIZE,_.width),V=Math.round(B/h);i({width:B,height:V})},E.IMAGE_THROTTLE_WAIT_TIME),[c,C,_,i,e==null?void 0:e.attrs]),R=a.useCallback(s=>{s.preventDefault(),s.stopPropagation(),c&&(S({x:0,y:0,w:0,h:0,dir:""}),N(!1),A())},[c,A]),D=a.useCallback(()=>{document==null||document.addEventListener("mousemove",y,!0),document==null||document.addEventListener("mouseup",R,!0)},[y,R]),z=a.useCallback(()=>{document==null||document.removeEventListener("mousemove",y,!0),document==null||document.removeEventListener("mouseup",R,!0)},[y,R]);a.useEffect(()=>(c?D():z(),()=>{z()}),[c,D,z]);const k=a.useMemo(()=>new ResizeObserver(()=>O()),[O]);return a.useEffect(()=>(k.observe(t.view.dom),()=>{k.disconnect()}),[t.view.dom,k]),o.jsx(F.NodeViewWrapper,{className:"image-view",style:{...d,width:"100%",textAlign:H},children:o.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:{...d,background:"#fff"},className:`image-view__body ${l?"image-view__body--focused":""} ${c?"image-view__body--resizing":""}`,children:[o.jsx("img",{alt:x.alt,className:"image-view__body__image block",height:"auto",onClick:A,onLoad:M,src:x.src,style:x.style}),t.view.editable&&(l||c)&&o.jsx("div",{className:"image-resizer",children:v==null?void 0:v.map(s=>o.jsx("span",{className:`image-resizer__handler image-resizer__handler--${s}`,onMouseDown:g=>T(g,s)},`image-dir-${s}`))})]})})}const re=u.Image.extend({name:"mermaid",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"mermaid"},button:({editor:e,t:i,extension:r})=>{var l;return{component:ee,componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,editor:e,icon:"Mermaid",tooltip:i("editor.mermaid.tooltip"),upload:(l=r==null?void 0:r.options)==null?void 0:l.upload}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>{const i=e.querySelector("img"),r=i==null?void 0:i.getAttribute("width");return r?Number.parseInt(r,10):320},renderHTML:e=>({width:e.width})},height:{default:null,parseHTML:e=>{const i=e.querySelector("img"),r=i==null?void 0:i.getAttribute("height");return r?Number.parseInt(r,10):212},renderHTML:e=>({height:e.height})},align:{default:"center",parseHTML:e=>e.getAttribute("align"),renderHTML:e=>({align:e.align})}}},addNodeView(){return F.ReactNodeViewRenderer(te)},addCommands(){return{setMermaid:(t,e)=>({commands:i,editor:r})=>e?i.insertContent({type:this.name,attrs:t}):i.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:t}),setAlignImageMermaid:t=>({commands:e})=>e.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:t}){const{align:e}=t;return["div",{style:e?`text-align: ${e};`:"",class:"imageMermaid"},["img",q.mergeAttributes(this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageMermaid]",getAttrs:t=>{const e=t.querySelector("img"),i=e==null?void 0:e.getAttribute("width"),r=e==null?void 0:e.getAttribute("height");return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),width:i?Number.parseInt(i,10):null,height:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||t.style.textAlign||null}}}]}});exports.Mermaid=re;
|
package/lib/Mermaid.d.cts
CHANGED
|
@@ -135,8 +135,8 @@ declare module '@tiptap/core' {
|
|
|
135
135
|
|
|
136
136
|
declare module '@tiptap/core' {
|
|
137
137
|
interface Commands<ReturnType> {
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
excalidraw: {
|
|
139
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -144,8 +144,8 @@ declare module '@tiptap/core' {
|
|
|
144
144
|
|
|
145
145
|
declare module '@tiptap/core' {
|
|
146
146
|
interface Commands<ReturnType> {
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
exportPdf: {
|
|
148
|
+
exportToPdf: () => ReturnType;
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
}
|
package/lib/Mermaid.d.ts
CHANGED
|
@@ -135,8 +135,8 @@ declare module '@tiptap/core' {
|
|
|
135
135
|
|
|
136
136
|
declare module '@tiptap/core' {
|
|
137
137
|
interface Commands<ReturnType> {
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
excalidraw: {
|
|
139
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
}
|
|
@@ -144,8 +144,8 @@ declare module '@tiptap/core' {
|
|
|
144
144
|
|
|
145
145
|
declare module '@tiptap/core' {
|
|
146
146
|
interface Commands<ReturnType> {
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
exportPdf: {
|
|
148
|
+
exportToPdf: () => ReturnType;
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
}
|