reactjs-tiptap-editor 0.3.30 → 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-wiDnIxE2.cjs → ActionMenuButton-BCgqJsST.cjs} +1 -1
- package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-D97K0UWT.js} +5 -5
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +15 -15
- package/lib/Attachment.d.ts +15 -15
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +15 -15
- package/lib/Blockquote.d.ts +15 -15
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +15 -15
- package/lib/Bold.d.ts +15 -15
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +15 -15
- package/lib/BulletList.d.ts +15 -15
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +15 -15
- package/lib/Clear.d.ts +15 -15
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +15 -15
- package/lib/Code.d.ts +15 -15
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +15 -15
- package/lib/CodeBlock.d.ts +15 -15
- package/lib/CodeBlock.js +3 -2
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +15 -15
- package/lib/CodeView.d.ts +15 -15
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +15 -15
- package/lib/Color.d.ts +15 -15
- package/lib/Color.js +2 -2
- package/lib/Document.d.cts +15 -15
- package/lib/Document.d.ts +15 -15
- package/lib/Drawer-5Q_-WRhc.cjs +1 -0
- package/lib/{Drawer-BKTU9CpU.js → Drawer-BHkje8ys.js} +250 -249
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +15 -15
- package/lib/Drawer.d.ts +15 -15
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +15 -15
- package/lib/Emoji.d.ts +15 -15
- 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 +15 -15
- package/lib/Excalidraw.d.ts +15 -15
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +15 -15
- package/lib/ExportPdf.d.ts +15 -15
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +15 -15
- package/lib/ExportWord.d.ts +15 -15
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +15 -15
- package/lib/FontFamily.d.ts +15 -15
- package/lib/FontFamily.js +11 -10
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +15 -15
- package/lib/FontSize.d.ts +15 -15
- package/lib/FontSize.js +6 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +15 -15
- package/lib/FormatPainter.d.ts +15 -15
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +15 -15
- package/lib/Heading.d.ts +15 -15
- package/lib/Heading.js +32 -31
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +15 -15
- package/lib/Highlight.d.ts +15 -15
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +15 -15
- package/lib/History.d.ts +15 -15
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +15 -15
- package/lib/HorizontalRule.d.ts +15 -15
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +15 -15
- package/lib/Iframe.d.ts +15 -15
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +15 -15
- package/lib/Image.d.ts +15 -15
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +15 -15
- package/lib/ImageGif.d.ts +15 -15
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.d.cts +15 -15
- package/lib/ImportWord.d.ts +15 -15
- package/lib/ImportWord.js +3 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +15 -15
- package/lib/Indent.d.ts +15 -15
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +15 -15
- package/lib/Italic.d.ts +15 -15
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +15 -15
- package/lib/Katex.d.ts +15 -15
- package/lib/Katex.js +41 -40
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +15 -15
- package/lib/LineHeight.d.ts +15 -15
- package/lib/LineHeight.js +17 -16
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +15 -15
- package/lib/Link.d.ts +15 -15
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +15 -15
- package/lib/ListItem.d.ts +15 -15
- package/lib/Mention.d.cts +15 -15
- package/lib/Mention.d.ts +15 -15
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +15 -15
- package/lib/Mermaid.d.ts +15 -15
- package/lib/Mermaid.js +138 -137
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +15 -15
- package/lib/MoreMark.d.ts +15 -15
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +15 -15
- package/lib/MultiColumn.d.ts +15 -15
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +15 -15
- package/lib/OrderedList.d.ts +15 -15
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-C8Sm1E6J.cjs → RichTextEditor-DWlLqTl9.cjs} +4 -4
- package/lib/{RichTextEditor-BQN2eLD_.js → RichTextEditor-KP2Rgcqe.js} +15 -39
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +15 -15
- package/lib/SearchAndReplace.d.ts +15 -15
- package/lib/SearchAndReplace.js +68 -67
- package/lib/Selection.d.cts +15 -15
- package/lib/Selection.d.ts +15 -15
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +15 -15
- package/lib/SlashCommand.d.ts +15 -15
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +15 -15
- package/lib/Strike.d.ts +15 -15
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +15 -15
- package/lib/SubAndSuperScript.d.ts +15 -15
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +15 -15
- package/lib/Table.d.ts +15 -15
- package/lib/Table.js +2 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +15 -15
- package/lib/TableOfContent.d.ts +15 -15
- package/lib/TableOfContent.js +50 -49
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +15 -15
- package/lib/TaskList.d.ts +15 -15
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +15 -15
- package/lib/TextAlign.d.ts +15 -15
- package/lib/TextAlign.js +8 -7
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +15 -15
- package/lib/TextBubble.d.ts +15 -15
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +15 -15
- package/lib/TextDirection.d.ts +15 -15
- package/lib/TextDirection.js +14 -13
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +15 -15
- package/lib/TextUnderline.d.ts +15 -15
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +15 -15
- package/lib/TrailingNode.d.ts +15 -15
- package/lib/{Twitter-Dg6WWauX.js → Twitter-99ivY5qv.js} +62 -61
- package/lib/{Twitter-CL2pu4QM.cjs → Twitter-BvfvUtNT.cjs} +2 -2
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +15 -15
- package/lib/Twitter.d.ts +15 -15
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +15 -15
- package/lib/Video.d.ts +15 -15
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +15 -15
- package/lib/bubble-extra.d.ts +15 -15
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +16 -15
- package/lib/index.d.ts +16 -15
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +15 -15
- package/lib/locale-bundle.d.ts +15 -15
- package/lib/{textarea-BglwYF6b.js → textarea-CktfkXNe.js} +1 -1
- package/lib/{textarea-D5WVZMgt.cjs → textarea-DdH64g04.cjs} +1 -1
- package/package.json +1 -1
- package/lib/Drawer-CmoEF-Zg.cjs +0 -1
- package/lib/Excalidraw-CM74U5tG.js +0 -289
- package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
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
|
@@ -190,6 +190,21 @@ declare module '@tiptap/core' {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
iframe: {
|
|
196
|
+
/**
|
|
197
|
+
* Add an iframe
|
|
198
|
+
*/
|
|
199
|
+
setIframe: (options: {
|
|
200
|
+
src: string;
|
|
201
|
+
service: string;
|
|
202
|
+
}) => ReturnType;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
193
208
|
declare module '@tiptap/core' {
|
|
194
209
|
interface Commands<ReturnType> {
|
|
195
210
|
imageUpload: {
|
|
@@ -210,21 +225,6 @@ declare module '@tiptap/core' {
|
|
|
210
225
|
}
|
|
211
226
|
|
|
212
227
|
|
|
213
|
-
declare module '@tiptap/core' {
|
|
214
|
-
interface Commands<ReturnType> {
|
|
215
|
-
iframe: {
|
|
216
|
-
/**
|
|
217
|
-
* Add an iframe
|
|
218
|
-
*/
|
|
219
|
-
setIframe: (options: {
|
|
220
|
-
src: string;
|
|
221
|
-
service: string;
|
|
222
|
-
}) => ReturnType;
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
228
|
declare module '@tiptap/core' {
|
|
229
229
|
interface Commands<ReturnType> {
|
|
230
230
|
imageGifUpload: {
|
package/lib/LineHeight.d.ts
CHANGED
|
@@ -190,6 +190,21 @@ declare module '@tiptap/core' {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
iframe: {
|
|
196
|
+
/**
|
|
197
|
+
* Add an iframe
|
|
198
|
+
*/
|
|
199
|
+
setIframe: (options: {
|
|
200
|
+
src: string;
|
|
201
|
+
service: string;
|
|
202
|
+
}) => ReturnType;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
193
208
|
declare module '@tiptap/core' {
|
|
194
209
|
interface Commands<ReturnType> {
|
|
195
210
|
imageUpload: {
|
|
@@ -210,21 +225,6 @@ declare module '@tiptap/core' {
|
|
|
210
225
|
}
|
|
211
226
|
|
|
212
227
|
|
|
213
|
-
declare module '@tiptap/core' {
|
|
214
|
-
interface Commands<ReturnType> {
|
|
215
|
-
iframe: {
|
|
216
|
-
/**
|
|
217
|
-
* Add an iframe
|
|
218
|
-
*/
|
|
219
|
-
setIframe: (options: {
|
|
220
|
-
src: string;
|
|
221
|
-
service: string;
|
|
222
|
-
}) => ReturnType;
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
228
|
declare module '@tiptap/core' {
|
|
229
229
|
interface Commands<ReturnType> {
|
|
230
230
|
imageGifUpload: {
|
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
|
@@ -188,6 +188,21 @@ declare module '@tiptap/core' {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
|
|
191
|
+
declare module '@tiptap/core' {
|
|
192
|
+
interface Commands<ReturnType> {
|
|
193
|
+
iframe: {
|
|
194
|
+
/**
|
|
195
|
+
* Add an iframe
|
|
196
|
+
*/
|
|
197
|
+
setIframe: (options: {
|
|
198
|
+
src: string;
|
|
199
|
+
service: string;
|
|
200
|
+
}) => ReturnType;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
191
206
|
declare module '@tiptap/core' {
|
|
192
207
|
interface Commands<ReturnType> {
|
|
193
208
|
imageUpload: {
|
|
@@ -208,21 +223,6 @@ declare module '@tiptap/core' {
|
|
|
208
223
|
}
|
|
209
224
|
|
|
210
225
|
|
|
211
|
-
declare module '@tiptap/core' {
|
|
212
|
-
interface Commands<ReturnType> {
|
|
213
|
-
iframe: {
|
|
214
|
-
/**
|
|
215
|
-
* Add an iframe
|
|
216
|
-
*/
|
|
217
|
-
setIframe: (options: {
|
|
218
|
-
src: string;
|
|
219
|
-
service: string;
|
|
220
|
-
}) => ReturnType;
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
226
|
declare module '@tiptap/core' {
|
|
227
227
|
interface Commands<ReturnType> {
|
|
228
228
|
imageGifUpload: {
|
package/lib/Link.d.ts
CHANGED
|
@@ -188,6 +188,21 @@ declare module '@tiptap/core' {
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
|
|
191
|
+
declare module '@tiptap/core' {
|
|
192
|
+
interface Commands<ReturnType> {
|
|
193
|
+
iframe: {
|
|
194
|
+
/**
|
|
195
|
+
* Add an iframe
|
|
196
|
+
*/
|
|
197
|
+
setIframe: (options: {
|
|
198
|
+
src: string;
|
|
199
|
+
service: string;
|
|
200
|
+
}) => ReturnType;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
191
206
|
declare module '@tiptap/core' {
|
|
192
207
|
interface Commands<ReturnType> {
|
|
193
208
|
imageUpload: {
|
|
@@ -208,21 +223,6 @@ declare module '@tiptap/core' {
|
|
|
208
223
|
}
|
|
209
224
|
|
|
210
225
|
|
|
211
|
-
declare module '@tiptap/core' {
|
|
212
|
-
interface Commands<ReturnType> {
|
|
213
|
-
iframe: {
|
|
214
|
-
/**
|
|
215
|
-
* Add an iframe
|
|
216
|
-
*/
|
|
217
|
-
setIframe: (options: {
|
|
218
|
-
src: string;
|
|
219
|
-
service: string;
|
|
220
|
-
}) => ReturnType;
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
226
|
declare module '@tiptap/core' {
|
|
227
227
|
interface Commands<ReturnType> {
|
|
228
228
|
imageGifUpload: {
|
package/lib/Link.js
CHANGED
package/lib/ListItem.d.cts
CHANGED
|
@@ -110,6 +110,21 @@ declare module '@tiptap/core' {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
|
|
113
|
+
declare module '@tiptap/core' {
|
|
114
|
+
interface Commands<ReturnType> {
|
|
115
|
+
iframe: {
|
|
116
|
+
/**
|
|
117
|
+
* Add an iframe
|
|
118
|
+
*/
|
|
119
|
+
setIframe: (options: {
|
|
120
|
+
src: string;
|
|
121
|
+
service: string;
|
|
122
|
+
}) => ReturnType;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
113
128
|
declare module '@tiptap/core' {
|
|
114
129
|
interface Commands<ReturnType> {
|
|
115
130
|
imageUpload: {
|
|
@@ -130,21 +145,6 @@ declare module '@tiptap/core' {
|
|
|
130
145
|
}
|
|
131
146
|
|
|
132
147
|
|
|
133
|
-
declare module '@tiptap/core' {
|
|
134
|
-
interface Commands<ReturnType> {
|
|
135
|
-
iframe: {
|
|
136
|
-
/**
|
|
137
|
-
* Add an iframe
|
|
138
|
-
*/
|
|
139
|
-
setIframe: (options: {
|
|
140
|
-
src: string;
|
|
141
|
-
service: string;
|
|
142
|
-
}) => ReturnType;
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
148
|
declare module '@tiptap/core' {
|
|
149
149
|
interface Commands<ReturnType> {
|
|
150
150
|
imageGifUpload: {
|
package/lib/ListItem.d.ts
CHANGED
|
@@ -110,6 +110,21 @@ declare module '@tiptap/core' {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
|
|
113
|
+
declare module '@tiptap/core' {
|
|
114
|
+
interface Commands<ReturnType> {
|
|
115
|
+
iframe: {
|
|
116
|
+
/**
|
|
117
|
+
* Add an iframe
|
|
118
|
+
*/
|
|
119
|
+
setIframe: (options: {
|
|
120
|
+
src: string;
|
|
121
|
+
service: string;
|
|
122
|
+
}) => ReturnType;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
113
128
|
declare module '@tiptap/core' {
|
|
114
129
|
interface Commands<ReturnType> {
|
|
115
130
|
imageUpload: {
|
|
@@ -130,21 +145,6 @@ declare module '@tiptap/core' {
|
|
|
130
145
|
}
|
|
131
146
|
|
|
132
147
|
|
|
133
|
-
declare module '@tiptap/core' {
|
|
134
|
-
interface Commands<ReturnType> {
|
|
135
|
-
iframe: {
|
|
136
|
-
/**
|
|
137
|
-
* Add an iframe
|
|
138
|
-
*/
|
|
139
|
-
setIframe: (options: {
|
|
140
|
-
src: string;
|
|
141
|
-
service: string;
|
|
142
|
-
}) => ReturnType;
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
148
|
declare module '@tiptap/core' {
|
|
149
149
|
interface Commands<ReturnType> {
|
|
150
150
|
imageGifUpload: {
|
package/lib/Mention.d.cts
CHANGED
|
@@ -113,6 +113,21 @@ declare module '@tiptap/core' {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
declare module '@tiptap/core' {
|
|
117
|
+
interface Commands<ReturnType> {
|
|
118
|
+
iframe: {
|
|
119
|
+
/**
|
|
120
|
+
* Add an iframe
|
|
121
|
+
*/
|
|
122
|
+
setIframe: (options: {
|
|
123
|
+
src: string;
|
|
124
|
+
service: string;
|
|
125
|
+
}) => ReturnType;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
116
131
|
declare module '@tiptap/core' {
|
|
117
132
|
interface Commands<ReturnType> {
|
|
118
133
|
imageUpload: {
|
|
@@ -133,21 +148,6 @@ declare module '@tiptap/core' {
|
|
|
133
148
|
}
|
|
134
149
|
|
|
135
150
|
|
|
136
|
-
declare module '@tiptap/core' {
|
|
137
|
-
interface Commands<ReturnType> {
|
|
138
|
-
iframe: {
|
|
139
|
-
/**
|
|
140
|
-
* Add an iframe
|
|
141
|
-
*/
|
|
142
|
-
setIframe: (options: {
|
|
143
|
-
src: string;
|
|
144
|
-
service: string;
|
|
145
|
-
}) => ReturnType;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
151
|
declare module '@tiptap/core' {
|
|
152
152
|
interface Commands<ReturnType> {
|
|
153
153
|
imageGifUpload: {
|
package/lib/Mention.d.ts
CHANGED
|
@@ -113,6 +113,21 @@ declare module '@tiptap/core' {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
declare module '@tiptap/core' {
|
|
117
|
+
interface Commands<ReturnType> {
|
|
118
|
+
iframe: {
|
|
119
|
+
/**
|
|
120
|
+
* Add an iframe
|
|
121
|
+
*/
|
|
122
|
+
setIframe: (options: {
|
|
123
|
+
src: string;
|
|
124
|
+
service: string;
|
|
125
|
+
}) => ReturnType;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
116
131
|
declare module '@tiptap/core' {
|
|
117
132
|
interface Commands<ReturnType> {
|
|
118
133
|
imageUpload: {
|
|
@@ -133,21 +148,6 @@ declare module '@tiptap/core' {
|
|
|
133
148
|
}
|
|
134
149
|
|
|
135
150
|
|
|
136
|
-
declare module '@tiptap/core' {
|
|
137
|
-
interface Commands<ReturnType> {
|
|
138
|
-
iframe: {
|
|
139
|
-
/**
|
|
140
|
-
* Add an iframe
|
|
141
|
-
*/
|
|
142
|
-
setIframe: (options: {
|
|
143
|
-
src: string;
|
|
144
|
-
service: string;
|
|
145
|
-
}) => ReturnType;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
151
|
declare module '@tiptap/core' {
|
|
152
152
|
interface Commands<ReturnType> {
|
|
153
153
|
imageGifUpload: {
|