reactjs-tiptap-editor 0.3.31 → 0.4.1
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-BCgqJsST.cjs → ActionMenuButton-CYdM1xx5.cjs} +1 -1
- package/lib/{ActionMenuButton-D97K0UWT.js → ActionMenuButton-DKRF6oa0.js} +1 -1
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +25 -29
- package/lib/Attachment.d.ts +25 -29
- 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 +25 -29
- package/lib/Blockquote.d.ts +25 -29
- package/lib/Blockquote.js +33 -17
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +25 -29
- package/lib/Bold.d.ts +25 -29
- package/lib/Bold.js +23 -16
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +26 -30
- package/lib/BulletList.d.ts +26 -30
- package/lib/BulletList.js +11 -57
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +25 -29
- package/lib/Clear.d.ts +25 -29
- package/lib/Clear.js +4 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +25 -29
- package/lib/Code.d.ts +25 -29
- package/lib/Code.js +29 -25
- package/lib/CodeBlock.cjs +2 -2
- package/lib/CodeBlock.d.cts +25 -29
- package/lib/CodeBlock.d.ts +25 -29
- package/lib/CodeBlock.js +3 -3
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +25 -29
- package/lib/CodeView.d.ts +25 -29
- package/lib/CodeView.js +3 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +26 -30
- package/lib/Color.d.ts +26 -30
- package/lib/Color.js +42 -74
- package/lib/Document.cjs +1 -1
- package/lib/Document.d.cts +25 -29
- package/lib/Document.d.ts +25 -29
- package/lib/Document.js +4 -8
- package/lib/{Drawer-BHkje8ys.js → Drawer-CaAfmqNo.js} +37 -35
- package/lib/{Drawer-5Q_-WRhc.cjs → Drawer-CdvCMSzN.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +25 -29
- package/lib/Drawer.d.ts +25 -29
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +28 -30
- package/lib/Emoji.d.ts +28 -30
- package/lib/Emoji.js +19795 -184
- package/lib/{Excalidraw-GUVW-IqC.cjs → Excalidraw-BbMQhNvs.cjs} +1 -1
- package/lib/{Excalidraw-CG498239.js → Excalidraw-CVWz2Vyn.js} +20 -20
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +25 -29
- package/lib/Excalidraw.d.ts +25 -29
- package/lib/Excalidraw.js +3 -3
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +25 -29
- package/lib/ExportPdf.d.ts +25 -29
- package/lib/ExportPdf.js +4 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +25 -29
- package/lib/ExportWord.d.ts +25 -29
- package/lib/ExportWord.js +22 -51
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +26 -30
- package/lib/FontFamily.d.ts +26 -30
- package/lib/FontFamily.js +44 -73
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +25 -29
- package/lib/FontSize.d.ts +25 -29
- package/lib/FontSize.js +7 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +25 -29
- package/lib/FormatPainter.d.ts +25 -29
- package/lib/FormatPainter.js +4 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +25 -29
- package/lib/Heading.d.ts +25 -29
- package/lib/Heading.js +71 -60
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +25 -29
- package/lib/Highlight.d.ts +25 -29
- package/lib/Highlight.js +5 -4
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +27 -31
- package/lib/History.d.ts +27 -31
- package/lib/History.js +39 -403
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +25 -29
- package/lib/HorizontalRule.d.ts +25 -29
- package/lib/HorizontalRule.js +16 -65
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +25 -29
- package/lib/Iframe.d.ts +25 -29
- package/lib/Iframe.js +4 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +25 -29
- package/lib/Image.d.ts +25 -29
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +25 -29
- package/lib/ImageGif.d.ts +25 -29
- package/lib/ImageGif.js +5 -5
- package/lib/ImportWord.cjs +72 -72
- package/lib/ImportWord.d.cts +25 -29
- package/lib/ImportWord.d.ts +25 -29
- package/lib/ImportWord.js +5652 -5615
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +25 -29
- package/lib/Indent.d.ts +25 -29
- package/lib/Indent.js +4 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +25 -29
- package/lib/Italic.d.ts +25 -29
- package/lib/Italic.js +20 -14
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +25 -29
- package/lib/Katex.d.ts +25 -29
- package/lib/Katex.js +12 -12
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +25 -29
- package/lib/LineHeight.d.ts +25 -29
- package/lib/LineHeight.js +5 -3
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +25 -29
- package/lib/Link.d.ts +25 -29
- package/lib/Link.js +4 -4
- package/lib/ListItem.cjs +1 -1
- package/lib/ListItem.d.cts +30 -30
- package/lib/ListItem.d.ts +30 -30
- package/lib/ListItem.js +4 -30
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +25 -29
- package/lib/Mention.d.ts +25 -29
- package/lib/Mention.js +161 -132
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +25 -29
- package/lib/Mermaid.d.ts +25 -29
- package/lib/Mermaid.js +50 -48
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +25 -29
- package/lib/MoreMark.d.ts +25 -29
- package/lib/MoreMark.js +5 -3
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +25 -29
- package/lib/MultiColumn.d.ts +25 -29
- package/lib/MultiColumn.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +26 -30
- package/lib/OrderedList.d.ts +26 -30
- 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 +38 -112
- package/lib/SearchAndReplace.d.ts +38 -112
- package/lib/SearchAndReplace.js +204 -192
- package/lib/Selection.cjs +1 -1
- package/lib/Selection.d.cts +25 -29
- package/lib/Selection.d.ts +25 -29
- package/lib/Selection.js +1 -1
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +25 -29
- package/lib/SlashCommand.d.ts +25 -29
- package/lib/SlashCommand.js +178 -223
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +25 -29
- package/lib/Strike.d.ts +25 -29
- package/lib/Strike.js +20 -14
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +25 -29
- package/lib/SubAndSuperScript.d.ts +25 -29
- package/lib/SubAndSuperScript.js +5 -3
- package/lib/Table.cjs +8 -10
- package/lib/Table.d.cts +28 -32
- package/lib/Table.d.ts +28 -32
- package/lib/Table.js +382 -2022
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +25 -29
- package/lib/TableOfContent.d.ts +25 -29
- package/lib/TableOfContent.js +5 -5
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +27 -31
- package/lib/TaskList.d.ts +27 -31
- package/lib/TaskList.js +12 -154
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +25 -29
- package/lib/TextAlign.d.ts +25 -29
- package/lib/TextAlign.js +11 -9
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +25 -29
- package/lib/TextBubble.d.ts +25 -29
- package/lib/TextBubble.js +5 -3
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +25 -29
- package/lib/TextDirection.d.ts +25 -29
- package/lib/TextDirection.js +2 -3
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +25 -29
- package/lib/TextUnderline.d.ts +25 -29
- package/lib/TextUnderline.js +40 -12
- package/lib/TrailingNode.cjs +1 -1
- package/lib/TrailingNode.d.cts +25 -29
- package/lib/TrailingNode.d.ts +25 -29
- 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 +25 -29
- package/lib/Twitter.d.ts +25 -29
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +25 -29
- package/lib/Video.d.ts +25 -29
- package/lib/Video.js +3 -3
- package/lib/bubble-extra.cjs +2 -2
- package/lib/bubble-extra.d.cts +25 -29
- package/lib/bubble-extra.d.ts +25 -29
- 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 +26 -229
- package/lib/index.d.ts +26 -229
- 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 +25 -29
- package/lib/locale-bundle.d.ts +25 -29
- package/lib/locale-bundle.js +1 -1
- package/lib/style.css +1 -1
- package/lib/{textarea-DdH64g04.cjs → textarea-DFo_aXnj.cjs} +1 -1
- package/lib/{textarea-CktfkXNe.js → textarea-aPtytkDx.js} +1 -1
- package/package.json +76 -70
- package/lib/RichTextEditor-DWlLqTl9.cjs +0 -140
- package/lib/RichTextEditor-KP2Rgcqe.js +0 -12751
- package/lib/Twitter-99ivY5qv.js +0 -1744
- package/lib/Twitter-BvfvUtNT.cjs +0 -17
- 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/FontFamily.js
CHANGED
|
@@ -1,130 +1,101 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
addOptions() {
|
|
11
|
-
return {
|
|
12
|
-
types: ["textStyle"]
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
addGlobalAttributes() {
|
|
16
|
-
return [
|
|
17
|
-
{
|
|
18
|
-
types: this.options.types,
|
|
19
|
-
attributes: {
|
|
20
|
-
fontFamily: {
|
|
21
|
-
default: null,
|
|
22
|
-
parseHTML: (t) => t.style.fontFamily,
|
|
23
|
-
renderHTML: (t) => t.fontFamily ? {
|
|
24
|
-
style: `font-family: ${t.fontFamily}`
|
|
25
|
-
} : {}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
];
|
|
30
|
-
},
|
|
31
|
-
addCommands() {
|
|
32
|
-
return {
|
|
33
|
-
setFontFamily: (t) => ({ chain: i }) => i().setMark("textStyle", { fontFamily: t }).run(),
|
|
34
|
-
unsetFontFamily: () => ({ chain: t }) => t().setMark("textStyle", { fontFamily: null }).removeEmptyTextStyle().run()
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
function T(t) {
|
|
39
|
-
var m, u, s;
|
|
40
|
-
const { t: i, lang: f } = y(), n = h(() => {
|
|
1
|
+
import { F } from "./index-ByurDDMv.js";
|
|
2
|
+
import { u as r, D as h } from "./index-LmrOdnen.js";
|
|
3
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo as y, Fragment as b } from "react";
|
|
5
|
+
import { A as M } from "./ActionMenuButton-DKRF6oa0.js";
|
|
6
|
+
import { D as x, h as A, j as D, k as g, l as w, m as L } from "./RichTextEditor-DGcKEUGr.js";
|
|
7
|
+
function k(t) {
|
|
8
|
+
var m, s, d;
|
|
9
|
+
const { t: e, lang: f } = r(), n = y(() => {
|
|
41
10
|
var o;
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
...
|
|
11
|
+
const i = (o = t == null ? void 0 : t.items) == null ? void 0 : o.find((l) => l.isActive());
|
|
12
|
+
return i && !i.default ? {
|
|
13
|
+
...i
|
|
45
14
|
} : {
|
|
46
15
|
title: t.tooltip,
|
|
47
|
-
font:
|
|
16
|
+
font: e("editor.fontFamily.default.tooltip"),
|
|
48
17
|
isActive: () => !1,
|
|
49
18
|
disabled: !1,
|
|
50
19
|
action: () => t.editor.chain().focus().unsetFontFamily().run()
|
|
51
20
|
};
|
|
52
|
-
}, [
|
|
53
|
-
return /* @__PURE__ */
|
|
21
|
+
}, [e, f, t]);
|
|
22
|
+
return /* @__PURE__ */ c(x, { children: [
|
|
54
23
|
/* @__PURE__ */ a(
|
|
55
24
|
A,
|
|
56
25
|
{
|
|
57
26
|
asChild: !0,
|
|
58
27
|
disabled: t == null ? void 0 : t.disabled,
|
|
59
28
|
children: /* @__PURE__ */ a(
|
|
60
|
-
|
|
29
|
+
M,
|
|
61
30
|
{
|
|
62
31
|
disabled: t == null ? void 0 : t.disabled,
|
|
63
32
|
icon: "MenuDown",
|
|
64
|
-
title: ((m = n == null ? void 0 : n.font) == null ? void 0 : m.length) > 7 ? `${(
|
|
33
|
+
title: ((m = n == null ? void 0 : n.font) == null ? void 0 : m.length) > 7 ? `${(s = n == null ? void 0 : n.font) == null ? void 0 : s.slice(0, 6)}...` : n == null ? void 0 : n.font,
|
|
65
34
|
tooltip: t == null ? void 0 : t.tooltip,
|
|
66
35
|
tooltipOptions: t == null ? void 0 : t.tooltipOptions
|
|
67
36
|
}
|
|
68
37
|
)
|
|
69
38
|
}
|
|
70
39
|
),
|
|
71
|
-
/* @__PURE__ */ a(
|
|
72
|
-
const o =
|
|
73
|
-
return /* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ a(D, { className: "richtext-w-full", children: (d = t == null ? void 0 : t.items) == null ? void 0 : d.map((i, u) => {
|
|
41
|
+
const o = i.font === e("editor.fontFamily.default.tooltip") ? {} : { fontFamily: i.font };
|
|
42
|
+
return /* @__PURE__ */ c(b, { children: [
|
|
74
43
|
/* @__PURE__ */ a(
|
|
75
44
|
g,
|
|
76
45
|
{
|
|
77
|
-
checked: (n == null ? void 0 : n.font) ===
|
|
78
|
-
onClick:
|
|
46
|
+
checked: (n == null ? void 0 : n.font) === i.font,
|
|
47
|
+
onClick: i.action,
|
|
79
48
|
children: /* @__PURE__ */ a(
|
|
80
49
|
"div",
|
|
81
50
|
{
|
|
82
51
|
className: "richtext-ml-1 richtext-h-full",
|
|
83
52
|
style: o,
|
|
84
|
-
children:
|
|
53
|
+
children: i.font
|
|
85
54
|
}
|
|
86
55
|
)
|
|
87
56
|
}
|
|
88
57
|
),
|
|
89
|
-
|
|
90
|
-
] }, `font-family-${
|
|
58
|
+
i.font === e("editor.fontFamily.default.tooltip") && /* @__PURE__ */ a(w, {})
|
|
59
|
+
] }, `font-family-${u}`);
|
|
91
60
|
}) })
|
|
92
61
|
] });
|
|
93
62
|
}
|
|
94
|
-
const
|
|
63
|
+
const v = /* @__PURE__ */ F.extend({
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
65
|
+
//@ts-expect-error
|
|
95
66
|
addOptions() {
|
|
96
67
|
var t;
|
|
97
68
|
return {
|
|
98
69
|
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
99
|
-
fontFamilyList:
|
|
100
|
-
button({ editor:
|
|
70
|
+
fontFamilyList: h,
|
|
71
|
+
button({ editor: e, extension: f, t: n }) {
|
|
101
72
|
var o;
|
|
102
|
-
const { extensions: m = [] } =
|
|
73
|
+
const { extensions: m = [] } = e.extensionManager ?? [], s = L(((o = f == null ? void 0 : f.options) == null ? void 0 : o.fontFamilyList) || []), d = m.find(
|
|
103
74
|
(l) => l.name === "base-kit"
|
|
104
|
-
),
|
|
75
|
+
), i = s.map((l) => ({
|
|
105
76
|
action: () => {
|
|
106
|
-
|
|
77
|
+
e.chain().focus().setFontFamily(l.value).run();
|
|
107
78
|
},
|
|
108
|
-
isActive: () =>
|
|
109
|
-
disabled: !
|
|
79
|
+
isActive: () => e.isActive("textStyle", { fontFamily: l.value }) || !1,
|
|
80
|
+
disabled: !e.can().setFontFamily(l.value),
|
|
110
81
|
title: l.name,
|
|
111
82
|
font: l.value
|
|
112
83
|
}));
|
|
113
|
-
|
|
114
|
-
action: () =>
|
|
84
|
+
d && d.options.textStyle !== !1 && i.unshift({
|
|
85
|
+
action: () => e.chain().focus().unsetFontFamily().run(),
|
|
115
86
|
isActive: () => !1,
|
|
116
87
|
disabled: !1,
|
|
117
88
|
font: n("editor.fontFamily.default.tooltip"),
|
|
118
89
|
title: n("editor.fontFamily.tooltip")
|
|
119
90
|
});
|
|
120
|
-
const
|
|
91
|
+
const u = i.filter((l) => l.disabled).length === i.length;
|
|
121
92
|
return {
|
|
122
|
-
component:
|
|
93
|
+
component: k,
|
|
123
94
|
componentProps: {
|
|
124
95
|
tooltip: n("editor.fontFamily.tooltip"),
|
|
125
|
-
disabled:
|
|
126
|
-
items:
|
|
127
|
-
editor:
|
|
96
|
+
disabled: u,
|
|
97
|
+
items: i,
|
|
98
|
+
editor: e
|
|
128
99
|
}
|
|
129
100
|
};
|
|
130
101
|
}
|
|
@@ -132,6 +103,6 @@ const j = /* @__PURE__ */ w.extend({
|
|
|
132
103
|
}
|
|
133
104
|
});
|
|
134
105
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
106
|
+
h as DEFAULT_FONT_FAMILY_LIST,
|
|
107
|
+
v as FontFamily
|
|
137
108
|
};
|
package/lib/FontSize.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index-DF2Lp4HZ.cjs"),r=require("./index-6D1J-A-o.cjs"),a=require("./RichTextEditor-CxvwGvQG.cjs"),u=require("react/jsx-runtime"),m=require("react"),z=require("./ActionMenuButton-CYdM1xx5.cjs");function x(t){var s;const{t:e}=r.useLocale(),l=m.useMemo(()=>{const i=(t.items||[]).find(c=>c.isActive());return i||{title:e("editor.fontSize.default.tooltip"),isActive:()=>!1}},[t]);return u.jsxs(a.DropdownMenu,{children:[u.jsx(a.DropdownMenuTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:u.jsx(z.ActionMenuButton,{disabled:t==null?void 0:t.disabled,icon:"MenuDown",title:l==null?void 0:l.title,tooltip:`${t==null?void 0:t.tooltip}`,tooltipOptions:t==null?void 0:t.tooltipOptions})}),u.jsx(a.DropdownMenuContent,{className:"richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto",children:(s=t==null?void 0:t.items)==null?void 0:s.map((i,o)=>u.jsx(a.DropdownMenuCheckboxItem,{checked:l.title===i.title,onClick:i.action,children:u.jsx("div",{className:"richtext-ml-1 richtext-h-full",children:i.title})},`font-size-${o}`))})]})}const v=f.Extension.create({name:"fontSize",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontSizes:[...r.DEFAULT_FONT_SIZE_LIST],button({editor:e,extension:l,t:s}){var d;const i=a.ensureNameValueOptions(((d=l.options)==null?void 0:d.fontSizes)||r.DEFAULT_FONT_SIZE_VALUE),o=a.ensureNameValueOptions([r.DEFAULT_FONT_SIZE_VALUE])[0],c=i.map(n=>({title:n.value===o.value?s("editor.fontSize.default.tooltip"):String(n.name),isActive:()=>{const{fontSize:S}=e.getAttributes("textStyle");return n.value===o.value&&S===void 0?!0:e.isActive({fontSize:String(n.value)})||!1},action:()=>{if(n.value===o.value){e.commands.unsetFontSize();return}e.commands.setFontSize(String(n.value))},disabled:!e.can().setFontSize(String(n.value)),divider:n.value===o.value||!1,default:n.value===o.value||!1}));return{component:x,componentProps:{editor:e,tooltip:s("editor.fontSize.tooltip"),disabled:!1,items:c,maxHeight:280}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize.replaceAll(/["']+/g,""),renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});exports.DEFAULT_FONT_SIZE_LIST=r.DEFAULT_FONT_SIZE_LIST;exports.FontSize=v;
|
package/lib/FontSize.d.cts
CHANGED
|
@@ -136,18 +136,6 @@ declare module '@tiptap/core' {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
declare module '@tiptap/core' {
|
|
140
|
-
interface Commands<ReturnType> {
|
|
141
|
-
emoji: {
|
|
142
|
-
setEmoji: (emoji: {
|
|
143
|
-
name: string;
|
|
144
|
-
emoji: string;
|
|
145
|
-
}) => ReturnType;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
139
|
declare module '@tiptap/core' {
|
|
152
140
|
interface Commands<ReturnType> {
|
|
153
141
|
excalidraw: {
|
|
@@ -239,19 +227,15 @@ declare module '@tiptap/core' {
|
|
|
239
227
|
|
|
240
228
|
declare module '@tiptap/core' {
|
|
241
229
|
interface Commands<ReturnType> {
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Add an image gif
|
|
245
|
-
*/
|
|
246
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
230
|
+
indent: {
|
|
247
231
|
/**
|
|
248
|
-
*
|
|
232
|
+
* Set the indent attribute
|
|
249
233
|
*/
|
|
250
|
-
|
|
234
|
+
indent: () => ReturnType;
|
|
251
235
|
/**
|
|
252
|
-
* Set
|
|
236
|
+
* Set the outdent attribute
|
|
253
237
|
*/
|
|
254
|
-
|
|
238
|
+
outdent: () => ReturnType;
|
|
255
239
|
};
|
|
256
240
|
}
|
|
257
241
|
}
|
|
@@ -259,15 +243,19 @@ declare module '@tiptap/core' {
|
|
|
259
243
|
|
|
260
244
|
declare module '@tiptap/core' {
|
|
261
245
|
interface Commands<ReturnType> {
|
|
262
|
-
|
|
246
|
+
imageGifUpload: {
|
|
263
247
|
/**
|
|
264
|
-
*
|
|
248
|
+
* Add an image gif
|
|
265
249
|
*/
|
|
266
|
-
|
|
250
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
267
251
|
/**
|
|
268
|
-
*
|
|
252
|
+
* Update an image gif
|
|
269
253
|
*/
|
|
270
|
-
|
|
254
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
255
|
+
/**
|
|
256
|
+
* Set image alignment
|
|
257
|
+
*/
|
|
258
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
271
259
|
};
|
|
272
260
|
}
|
|
273
261
|
}
|
|
@@ -321,16 +309,24 @@ declare module '@tiptap/core' {
|
|
|
321
309
|
search: {
|
|
322
310
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
323
311
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
312
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
313
|
+
resetIndex: () => ReturnType;
|
|
314
|
+
nextSearchResult: () => ReturnType;
|
|
315
|
+
previousSearchResult: () => ReturnType;
|
|
324
316
|
replace: () => ReturnType;
|
|
325
317
|
replaceAll: () => ReturnType;
|
|
326
|
-
goToPrevSearchResult: () => void;
|
|
327
|
-
goToNextSearchResult: () => void;
|
|
328
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
329
318
|
};
|
|
330
319
|
}
|
|
331
320
|
}
|
|
332
321
|
|
|
333
322
|
|
|
323
|
+
declare module '@tiptap/core' {
|
|
324
|
+
interface Storage {
|
|
325
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
|
|
334
330
|
declare module '@tiptap/core' {
|
|
335
331
|
interface Commands<ReturnType> {
|
|
336
332
|
tableOfContents: {
|
package/lib/FontSize.d.ts
CHANGED
|
@@ -136,18 +136,6 @@ declare module '@tiptap/core' {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
declare module '@tiptap/core' {
|
|
140
|
-
interface Commands<ReturnType> {
|
|
141
|
-
emoji: {
|
|
142
|
-
setEmoji: (emoji: {
|
|
143
|
-
name: string;
|
|
144
|
-
emoji: string;
|
|
145
|
-
}) => ReturnType;
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
139
|
declare module '@tiptap/core' {
|
|
152
140
|
interface Commands<ReturnType> {
|
|
153
141
|
excalidraw: {
|
|
@@ -239,19 +227,15 @@ declare module '@tiptap/core' {
|
|
|
239
227
|
|
|
240
228
|
declare module '@tiptap/core' {
|
|
241
229
|
interface Commands<ReturnType> {
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Add an image gif
|
|
245
|
-
*/
|
|
246
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
230
|
+
indent: {
|
|
247
231
|
/**
|
|
248
|
-
*
|
|
232
|
+
* Set the indent attribute
|
|
249
233
|
*/
|
|
250
|
-
|
|
234
|
+
indent: () => ReturnType;
|
|
251
235
|
/**
|
|
252
|
-
* Set
|
|
236
|
+
* Set the outdent attribute
|
|
253
237
|
*/
|
|
254
|
-
|
|
238
|
+
outdent: () => ReturnType;
|
|
255
239
|
};
|
|
256
240
|
}
|
|
257
241
|
}
|
|
@@ -259,15 +243,19 @@ declare module '@tiptap/core' {
|
|
|
259
243
|
|
|
260
244
|
declare module '@tiptap/core' {
|
|
261
245
|
interface Commands<ReturnType> {
|
|
262
|
-
|
|
246
|
+
imageGifUpload: {
|
|
263
247
|
/**
|
|
264
|
-
*
|
|
248
|
+
* Add an image gif
|
|
265
249
|
*/
|
|
266
|
-
|
|
250
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
267
251
|
/**
|
|
268
|
-
*
|
|
252
|
+
* Update an image gif
|
|
269
253
|
*/
|
|
270
|
-
|
|
254
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
255
|
+
/**
|
|
256
|
+
* Set image alignment
|
|
257
|
+
*/
|
|
258
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
271
259
|
};
|
|
272
260
|
}
|
|
273
261
|
}
|
|
@@ -321,16 +309,24 @@ declare module '@tiptap/core' {
|
|
|
321
309
|
search: {
|
|
322
310
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
323
311
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
312
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
313
|
+
resetIndex: () => ReturnType;
|
|
314
|
+
nextSearchResult: () => ReturnType;
|
|
315
|
+
previousSearchResult: () => ReturnType;
|
|
324
316
|
replace: () => ReturnType;
|
|
325
317
|
replaceAll: () => ReturnType;
|
|
326
|
-
goToPrevSearchResult: () => void;
|
|
327
|
-
goToNextSearchResult: () => void;
|
|
328
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
329
318
|
};
|
|
330
319
|
}
|
|
331
320
|
}
|
|
332
321
|
|
|
333
322
|
|
|
323
|
+
declare module '@tiptap/core' {
|
|
324
|
+
interface Storage {
|
|
325
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
|
|
334
330
|
declare module '@tiptap/core' {
|
|
335
331
|
interface Commands<ReturnType> {
|
|
336
332
|
tableOfContents: {
|
package/lib/FontSize.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as m } from "./index-
|
|
2
|
-
import { u as S,
|
|
3
|
-
import { D as v,
|
|
1
|
+
import { E as m } from "./index-kbO3iWqL.js";
|
|
2
|
+
import { u as S, g as z, h as c } from "./index-LmrOdnen.js";
|
|
3
|
+
import { D as v, h, j as x, k as F, m as f } from "./RichTextEditor-DGcKEUGr.js";
|
|
4
4
|
import { jsxs as y, jsx as u } from "react/jsx-runtime";
|
|
5
5
|
import { useMemo as A } from "react";
|
|
6
|
-
import { A as M } from "./ActionMenuButton-
|
|
6
|
+
import { A as M } from "./ActionMenuButton-DKRF6oa0.js";
|
|
7
7
|
function b(t) {
|
|
8
8
|
var a;
|
|
9
9
|
const { t: e } = S(), l = A(() => {
|
|
@@ -44,6 +44,8 @@ function b(t) {
|
|
|
44
44
|
}
|
|
45
45
|
const C = /* @__PURE__ */ m.create({
|
|
46
46
|
name: "fontSize",
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
|
+
//@ts-expect-error
|
|
47
49
|
addOptions() {
|
|
48
50
|
var t;
|
|
49
51
|
return {
|
|
@@ -52,7 +54,7 @@ const C = /* @__PURE__ */ m.create({
|
|
|
52
54
|
fontSizes: [...z],
|
|
53
55
|
button({ editor: e, extension: l, t: a }) {
|
|
54
56
|
var r;
|
|
55
|
-
const i =
|
|
57
|
+
const i = f(((r = l.options) == null ? void 0 : r.fontSizes) || c), o = f([c])[0], s = i.map((n) => ({
|
|
56
58
|
title: n.value === o.value ? a("editor.fontSize.default.tooltip") : String(n.name),
|
|
57
59
|
isActive: () => {
|
|
58
60
|
const { fontSize: d } = e.getAttributes("textStyle");
|
package/lib/FormatPainter.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-DF2Lp4HZ.cjs"),c=require("./RichTextEditor-CxvwGvQG.cjs"),m=i.Extension.create({name:"painter",addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),button:({editor:t,t:e})=>({component:c.ActionButton,componentProps:{action:()=>{t.commands.setPainter(t==null?void 0:t.state.selection.$head.marks())},icon:"PaintRoller",tooltip:e("editor.format")}})}},addCommands(){return{setPainter:n=>({view:{dispatch:t,state:{tr:e},dom:s}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return s.style.cursor=a,t(e.setMeta("painterAction",{type:"start",marks:n})),!0}}},addProseMirrorPlugins(){return[new i.Plugin({key:new i.PluginKey("format-painter"),state:{init:()=>[],apply:(n,t)=>{const e=n.getMeta("painterAction");return e&&e.type==="start"?t=e.marks:e&&e.type==="end"&&(t=[]),t}},props:{handleDOMEvents:{mousedown(n){const t=this.getState(n.state);if(!t||t.length===0)return n.dom.style.cursor="",!1;const e=()=>{document.removeEventListener("mouseup",e);let{dispatch:s,state:{tr:r,selection:o},dom:a}=n;a.style.cursor="",r=r.removeMark(o.from,o.to);for(const u of t)u.type.name!=="link"&&(r=r.addMark(o.from,o.to,u));s(r.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",e),!0}}}})]}});exports.FormatPainter=m;
|
package/lib/FormatPainter.d.cts
CHANGED
|
@@ -130,18 +130,6 @@ declare module '@tiptap/core' {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
declare module '@tiptap/core' {
|
|
134
|
-
interface Commands<ReturnType> {
|
|
135
|
-
emoji: {
|
|
136
|
-
setEmoji: (emoji: {
|
|
137
|
-
name: string;
|
|
138
|
-
emoji: string;
|
|
139
|
-
}) => ReturnType;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
133
|
declare module '@tiptap/core' {
|
|
146
134
|
interface Commands<ReturnType> {
|
|
147
135
|
excalidraw: {
|
|
@@ -233,19 +221,15 @@ declare module '@tiptap/core' {
|
|
|
233
221
|
|
|
234
222
|
declare module '@tiptap/core' {
|
|
235
223
|
interface Commands<ReturnType> {
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Add an image gif
|
|
239
|
-
*/
|
|
240
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
224
|
+
indent: {
|
|
241
225
|
/**
|
|
242
|
-
*
|
|
226
|
+
* Set the indent attribute
|
|
243
227
|
*/
|
|
244
|
-
|
|
228
|
+
indent: () => ReturnType;
|
|
245
229
|
/**
|
|
246
|
-
* Set
|
|
230
|
+
* Set the outdent attribute
|
|
247
231
|
*/
|
|
248
|
-
|
|
232
|
+
outdent: () => ReturnType;
|
|
249
233
|
};
|
|
250
234
|
}
|
|
251
235
|
}
|
|
@@ -253,15 +237,19 @@ declare module '@tiptap/core' {
|
|
|
253
237
|
|
|
254
238
|
declare module '@tiptap/core' {
|
|
255
239
|
interface Commands<ReturnType> {
|
|
256
|
-
|
|
240
|
+
imageGifUpload: {
|
|
257
241
|
/**
|
|
258
|
-
*
|
|
242
|
+
* Add an image gif
|
|
259
243
|
*/
|
|
260
|
-
|
|
244
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
261
245
|
/**
|
|
262
|
-
*
|
|
246
|
+
* Update an image gif
|
|
263
247
|
*/
|
|
264
|
-
|
|
248
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
249
|
+
/**
|
|
250
|
+
* Set image alignment
|
|
251
|
+
*/
|
|
252
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
265
253
|
};
|
|
266
254
|
}
|
|
267
255
|
}
|
|
@@ -315,16 +303,24 @@ declare module '@tiptap/core' {
|
|
|
315
303
|
search: {
|
|
316
304
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
317
305
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
306
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
307
|
+
resetIndex: () => ReturnType;
|
|
308
|
+
nextSearchResult: () => ReturnType;
|
|
309
|
+
previousSearchResult: () => ReturnType;
|
|
318
310
|
replace: () => ReturnType;
|
|
319
311
|
replaceAll: () => ReturnType;
|
|
320
|
-
goToPrevSearchResult: () => void;
|
|
321
|
-
goToNextSearchResult: () => void;
|
|
322
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
323
312
|
};
|
|
324
313
|
}
|
|
325
314
|
}
|
|
326
315
|
|
|
327
316
|
|
|
317
|
+
declare module '@tiptap/core' {
|
|
318
|
+
interface Storage {
|
|
319
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
|
|
328
324
|
declare module '@tiptap/core' {
|
|
329
325
|
interface Commands<ReturnType> {
|
|
330
326
|
tableOfContents: {
|
package/lib/FormatPainter.d.ts
CHANGED
|
@@ -130,18 +130,6 @@ declare module '@tiptap/core' {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
|
|
133
|
-
declare module '@tiptap/core' {
|
|
134
|
-
interface Commands<ReturnType> {
|
|
135
|
-
emoji: {
|
|
136
|
-
setEmoji: (emoji: {
|
|
137
|
-
name: string;
|
|
138
|
-
emoji: string;
|
|
139
|
-
}) => ReturnType;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
133
|
declare module '@tiptap/core' {
|
|
146
134
|
interface Commands<ReturnType> {
|
|
147
135
|
excalidraw: {
|
|
@@ -233,19 +221,15 @@ declare module '@tiptap/core' {
|
|
|
233
221
|
|
|
234
222
|
declare module '@tiptap/core' {
|
|
235
223
|
interface Commands<ReturnType> {
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Add an image gif
|
|
239
|
-
*/
|
|
240
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
224
|
+
indent: {
|
|
241
225
|
/**
|
|
242
|
-
*
|
|
226
|
+
* Set the indent attribute
|
|
243
227
|
*/
|
|
244
|
-
|
|
228
|
+
indent: () => ReturnType;
|
|
245
229
|
/**
|
|
246
|
-
* Set
|
|
230
|
+
* Set the outdent attribute
|
|
247
231
|
*/
|
|
248
|
-
|
|
232
|
+
outdent: () => ReturnType;
|
|
249
233
|
};
|
|
250
234
|
}
|
|
251
235
|
}
|
|
@@ -253,15 +237,19 @@ declare module '@tiptap/core' {
|
|
|
253
237
|
|
|
254
238
|
declare module '@tiptap/core' {
|
|
255
239
|
interface Commands<ReturnType> {
|
|
256
|
-
|
|
240
|
+
imageGifUpload: {
|
|
257
241
|
/**
|
|
258
|
-
*
|
|
242
|
+
* Add an image gif
|
|
259
243
|
*/
|
|
260
|
-
|
|
244
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
261
245
|
/**
|
|
262
|
-
*
|
|
246
|
+
* Update an image gif
|
|
263
247
|
*/
|
|
264
|
-
|
|
248
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
249
|
+
/**
|
|
250
|
+
* Set image alignment
|
|
251
|
+
*/
|
|
252
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
265
253
|
};
|
|
266
254
|
}
|
|
267
255
|
}
|
|
@@ -315,16 +303,24 @@ declare module '@tiptap/core' {
|
|
|
315
303
|
search: {
|
|
316
304
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
317
305
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
306
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
307
|
+
resetIndex: () => ReturnType;
|
|
308
|
+
nextSearchResult: () => ReturnType;
|
|
309
|
+
previousSearchResult: () => ReturnType;
|
|
318
310
|
replace: () => ReturnType;
|
|
319
311
|
replaceAll: () => ReturnType;
|
|
320
|
-
goToPrevSearchResult: () => void;
|
|
321
|
-
goToNextSearchResult: () => void;
|
|
322
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
323
312
|
};
|
|
324
313
|
}
|
|
325
314
|
}
|
|
326
315
|
|
|
327
316
|
|
|
317
|
+
declare module '@tiptap/core' {
|
|
318
|
+
interface Storage {
|
|
319
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
|
|
328
324
|
declare module '@tiptap/core' {
|
|
329
325
|
interface Commands<ReturnType> {
|
|
330
326
|
tableOfContents: {
|
package/lib/FormatPainter.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { E as m, P as u, a as c } from "./index-
|
|
2
|
-
import { A as p } from "./RichTextEditor-
|
|
1
|
+
import { E as m, P as u, a as c } from "./index-kbO3iWqL.js";
|
|
2
|
+
import { A as p } from "./RichTextEditor-DGcKEUGr.js";
|
|
3
3
|
const v = /* @__PURE__ */ m.create({
|
|
4
4
|
name: "painter",
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
+
//@ts-expect-error
|
|
5
7
|
addOptions() {
|
|
6
8
|
var n;
|
|
7
9
|
return {
|
package/lib/Heading.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-DF2Lp4HZ.cjs"),l=require("react/jsx-runtime"),f=require("react"),b=require("./ActionMenuButton-CYdM1xx5.cjs"),o=require("./RichTextEditor-CxvwGvQG.cjs");var x=u.Node3.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,u.mergeAttributes(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var s;const n=(s=e.attrs)!=null&&s.level?parseInt(e.attrs.level,10):1,d="#".repeat(n);return e.content?`${d} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>u.textblockTypeInputRule({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});function M(e){var s;const t=f.useMemo(()=>{var a;const n=(a=e==null?void 0:e.items)==null?void 0:a.find(r=>r.isActive());return n&&!n.default?{...n}:{title:e.tooltip,level:0,isActive:()=>!1}},[e]);return l.jsxs(o.DropdownMenu,{children:[l.jsx(o.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:l.jsx(b.ActionMenuButton,{disabled:e==null?void 0:e.disabled,icon:"MenuDown",title:t==null?void 0:t.title,tooltip:e==null?void 0:e.tooltip,tooltipOptions:e==null?void 0:e.tooltipOptions})}),l.jsx(o.DropdownMenuContent,{className:"richtext-w-full",children:(s=e==null?void 0:e.items)==null?void 0:s.map((n,d)=>{var a,r;return l.jsxs(f.Fragment,{children:[l.jsxs(o.DropdownMenuCheckboxItem,{checked:(t==null?void 0:t.title)===n.title,onClick:n.action,children:[l.jsx("div",{className:`heading- richtext-ml-1 richtext-h-full${n.level}`,children:n.title}),!!((a=n==null?void 0:n.shortcutKeys)!=null&&a.length)&&l.jsx(o.DropdownMenuShortcut,{className:"richtext-pl-4",children:(r=n==null?void 0:n.shortcutKeys)==null?void 0:r.map(c=>o.getShortcutKey(c)).join(" ")})]}),n.level===0&&l.jsx(o.DropdownMenuSeparator,{})]},`heading-k-${d}`)})})]})}const A=x.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),levels:[1,2,3,4,5,6],button({editor:t,extension:s,t:n}){var h,g;const{extensions:d=[]}=t.extensionManager??[],a=((h=s.options)==null?void 0:h.levels)||[],r=d.find(i=>i.name==="base-kit"),c=a.map(i=>{var v;return{action:()=>t.commands.toggleHeading({level:i}),isActive:()=>t.isActive("heading",{level:i})||!1,disabled:!t.can().toggleHeading({level:i}),title:n(`editor.heading.h${i}.tooltip`),level:i,shortcutKeys:((v=s.options.shortcutKeys)==null?void 0:v[i])??["alt","mod",`${i}`]}});r&&r.options.paragraph!==!1&&c.unshift({action:()=>t.commands.setParagraph(),isActive:()=>t.isActive("paragraph")||!1,disabled:!t.can().setParagraph(),level:0,title:n("editor.paragraph.tooltip"),shortcutKeys:((g=s.options.shortcutKeys)==null?void 0:g[0])??["alt","mod","0"]});const m=c.filter(i=>i.disabled).length===c.length;return{component:M,componentProps:{tooltip:n("editor.heading.tooltip"),disabled:m,items:c,editor:t}}}}}});exports.Heading=A;
|