reactjs-tiptap-editor 0.2.29 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ActionMenuButton-Bycn676n.js +33 -0
- package/lib/ActionMenuButton-CpFNwSUZ.cjs +1 -0
- package/lib/Attachment.cjs +19 -0
- package/lib/Attachment.d.cts +344 -0
- package/lib/Attachment.d.ts +344 -0
- package/lib/Attachment.js +259 -0
- package/lib/Blockquote.cjs +1 -0
- package/lib/Blockquote.d.cts +343 -0
- package/lib/Blockquote.d.ts +343 -0
- package/lib/Blockquote.js +65 -0
- package/lib/Bold.cjs +1 -0
- package/lib/Bold.d.cts +343 -0
- package/lib/Bold.d.ts +343 -0
- package/lib/Bold.js +90 -0
- package/lib/BulletList.cjs +1 -0
- package/lib/BulletList.d.cts +343 -0
- package/lib/BulletList.d.ts +343 -0
- package/lib/BulletList.js +72 -0
- package/lib/Clear.cjs +1 -0
- package/lib/Clear.d.cts +342 -0
- package/lib/Clear.d.ts +342 -0
- package/lib/Clear.js +23 -0
- package/lib/Code.cjs +1 -0
- package/lib/Code.d.cts +343 -0
- package/lib/Code.d.ts +343 -0
- package/lib/Code.js +70 -0
- package/lib/CodeBlock.cjs +39 -0
- package/lib/CodeBlock.d.cts +352 -0
- package/lib/CodeBlock.d.ts +352 -0
- package/lib/CodeBlock.js +3639 -0
- package/lib/Color.cjs +1 -0
- package/lib/Color.d.cts +350 -0
- package/lib/Color.d.ts +350 -0
- package/lib/Color.js +141 -0
- package/lib/Document.cjs +1 -0
- package/lib/Document.d.cts +272 -0
- package/lib/Document.d.ts +272 -0
- package/lib/Document.js +13 -0
- package/lib/Drawer-BZadE1gM.js +1367 -0
- package/lib/Drawer-rwnFvgZR.cjs +1 -0
- package/lib/Drawer.cjs +1 -0
- package/lib/Drawer.d.cts +344 -0
- package/lib/Drawer.d.ts +344 -0
- package/lib/Drawer.js +7 -0
- package/lib/Emoji.cjs +1 -0
- package/lib/Emoji.d.cts +277 -0
- package/lib/Emoji.d.ts +277 -0
- package/lib/Emoji.js +2168 -0
- package/lib/Excalidraw-B2414Smc.js +651 -0
- package/lib/Excalidraw-D21vMFe0.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -0
- package/lib/Excalidraw.d.cts +278 -0
- package/lib/Excalidraw.d.ts +278 -0
- package/lib/Excalidraw.js +6 -0
- package/lib/ExportPdf.cjs +15 -0
- package/lib/ExportPdf.d.cts +270 -0
- package/lib/ExportPdf.d.ts +270 -0
- package/lib/ExportPdf.js +67 -0
- package/lib/ExportWord.cjs +1 -0
- package/lib/ExportWord.d.cts +341 -0
- package/lib/ExportWord.d.ts +341 -0
- package/lib/ExportWord.js +72 -0
- package/lib/FontFamily.cjs +1 -0
- package/lib/FontFamily.d.cts +354 -0
- package/lib/FontFamily.d.ts +354 -0
- package/lib/FontFamily.js +136 -0
- package/lib/FontSize.cjs +1 -0
- package/lib/FontSize.d.cts +359 -0
- package/lib/FontSize.d.ts +359 -0
- package/lib/FontSize.js +110 -0
- package/lib/FormatPainter.cjs +1 -0
- package/lib/FormatPainter.d.cts +353 -0
- package/lib/FormatPainter.d.ts +353 -0
- package/lib/FormatPainter.js +74 -0
- package/lib/Heading.cjs +1 -0
- package/lib/Heading.d.cts +343 -0
- package/lib/Heading.d.ts +343 -0
- package/lib/Heading.js +147 -0
- package/lib/Highlight.cjs +1 -0
- package/lib/Highlight.d.cts +344 -0
- package/lib/Highlight.d.ts +344 -0
- package/lib/Highlight.js +85 -0
- package/lib/History.cjs +1 -0
- package/lib/History.d.cts +343 -0
- package/lib/History.d.ts +343 -0
- package/lib/History.js +431 -0
- package/lib/HorizontalRule.cjs +1 -0
- package/lib/HorizontalRule.d.cts +343 -0
- package/lib/HorizontalRule.d.ts +343 -0
- package/lib/HorizontalRule.js +87 -0
- package/lib/Iframe.cjs +1 -0
- package/lib/Iframe.d.cts +277 -0
- package/lib/Iframe.d.ts +277 -0
- package/lib/Iframe.js +6 -0
- package/lib/Image.cjs +1 -0
- package/lib/Image.d.cts +370 -0
- package/lib/Image.d.ts +370 -0
- package/lib/Image.js +7 -0
- package/lib/ImageGif.cjs +1 -0
- package/lib/ImageGif.d.cts +292 -0
- package/lib/ImageGif.d.ts +292 -0
- package/lib/ImageGif.js +7 -0
- package/lib/ImportWord.cjs +231 -0
- package/lib/ImportWord.d.cts +353 -0
- package/lib/ImportWord.d.ts +353 -0
- package/lib/ImportWord.js +16620 -0
- package/lib/Indent.cjs +1 -0
- package/lib/Indent.d.cts +344 -0
- package/lib/Indent.d.ts +344 -0
- package/lib/Indent.js +78 -0
- package/lib/Italic.cjs +1 -0
- package/lib/Italic.d.cts +343 -0
- package/lib/Italic.d.ts +343 -0
- package/lib/Italic.js +91 -0
- package/lib/Katex.cjs +1 -0
- package/lib/Katex.d.cts +279 -0
- package/lib/Katex.d.ts +279 -0
- package/lib/Katex.js +197 -0
- package/lib/LineHeight.cjs +1 -0
- package/lib/LineHeight.d.cts +347 -0
- package/lib/LineHeight.d.ts +347 -0
- package/lib/LineHeight.js +137 -0
- package/lib/Link.cjs +5 -0
- package/lib/Link.d.cts +343 -0
- package/lib/Link.d.ts +343 -0
- package/lib/Link.js +1048 -0
- package/lib/ListItem.cjs +1 -0
- package/lib/ListItem.d.cts +269 -0
- package/lib/ListItem.d.ts +269 -0
- package/lib/ListItem.js +33 -0
- package/lib/Mention.cjs +1 -0
- package/lib/Mention.d.cts +272 -0
- package/lib/Mention.d.ts +272 -0
- package/lib/Mention.js +233 -0
- package/lib/Mermaid.cjs +2 -0
- package/lib/Mermaid.d.cts +344 -0
- package/lib/Mermaid.d.ts +344 -0
- package/lib/Mermaid.js +390 -0
- package/lib/MoreMark.cjs +1 -0
- package/lib/MoreMark.d.cts +355 -0
- package/lib/MoreMark.d.ts +355 -0
- package/lib/MoreMark.js +95 -0
- package/lib/MultiColumn.cjs +1 -0
- package/lib/MultiColumn.d.cts +277 -0
- package/lib/MultiColumn.d.ts +277 -0
- package/lib/MultiColumn.js +8 -0
- package/lib/OrderedList.cjs +1 -0
- package/lib/OrderedList.d.cts +343 -0
- package/lib/OrderedList.d.ts +343 -0
- package/lib/OrderedList.js +90 -0
- package/lib/RichTextEditor-Cy9XKEI5.js +11178 -0
- package/lib/RichTextEditor-DkpDEr5U.cjs +137 -0
- package/lib/SearchAndReplace.cjs +1 -0
- package/lib/SearchAndReplace.d.cts +358 -0
- package/lib/SearchAndReplace.d.ts +358 -0
- package/lib/SearchAndReplace.js +339 -0
- package/lib/Selection.cjs +1 -0
- package/lib/Selection.d.cts +272 -0
- package/lib/Selection.d.ts +272 -0
- package/lib/Selection.js +25 -0
- package/lib/SlashCommand.cjs +1 -0
- package/lib/SlashCommand.d.cts +299 -0
- package/lib/SlashCommand.d.ts +299 -0
- package/lib/SlashCommand.js +369 -0
- package/lib/Strike.cjs +1 -0
- package/lib/Strike.d.cts +343 -0
- package/lib/Strike.d.ts +343 -0
- package/lib/Strike.js +80 -0
- package/lib/SubAndSuperScript.cjs +1 -0
- package/lib/SubAndSuperScript.d.cts +358 -0
- package/lib/SubAndSuperScript.d.ts +358 -0
- package/lib/SubAndSuperScript.js +41 -0
- package/lib/Table.cjs +1 -0
- package/lib/Table.d.cts +366 -0
- package/lib/Table.d.ts +366 -0
- package/lib/Table.js +2165 -0
- package/lib/TableOfContent.cjs +1 -0
- package/lib/TableOfContent.d.cts +274 -0
- package/lib/TableOfContent.d.ts +274 -0
- package/lib/TableOfContent.js +184 -0
- package/lib/TaskList.cjs +1 -0
- package/lib/TaskList.d.cts +349 -0
- package/lib/TaskList.d.ts +349 -0
- package/lib/TaskList.js +175 -0
- package/lib/TextAlign.cjs +1 -0
- package/lib/TextAlign.d.cts +353 -0
- package/lib/TextAlign.d.ts +353 -0
- package/lib/TextAlign.js +165 -0
- package/lib/TextBubble.cjs +1 -0
- package/lib/TextBubble.d.cts +343 -0
- package/lib/TextBubble.d.ts +343 -0
- package/lib/TextBubble.js +131 -0
- package/lib/TextDirection.cjs +1 -0
- package/lib/TextDirection.d.cts +270 -0
- package/lib/TextDirection.d.ts +270 -0
- package/lib/TextDirection.js +142 -0
- package/lib/TextUnderline.cjs +1 -0
- package/lib/TextUnderline.d.cts +343 -0
- package/lib/TextUnderline.d.ts +343 -0
- package/lib/TextUnderline.js +61 -0
- package/lib/TrailingNode.cjs +1 -0
- package/lib/TrailingNode.d.cts +280 -0
- package/lib/TrailingNode.d.ts +280 -0
- package/lib/TrailingNode.js +41 -0
- package/lib/Twitter-B_tSItrW.js +1743 -0
- package/lib/Twitter-CfDC4bFV.cjs +17 -0
- package/lib/Twitter.cjs +1 -0
- package/lib/Twitter.d.cts +295 -0
- package/lib/Twitter.d.ts +295 -0
- package/lib/Twitter.js +6 -0
- package/lib/Video.cjs +1 -0
- package/lib/Video.d.cts +371 -0
- package/lib/Video.d.ts +371 -0
- package/lib/Video.js +6 -0
- package/lib/bubble-extra.cjs +2 -0
- package/lib/bubble-extra.d.cts +294 -0
- package/lib/bubble-extra.d.ts +294 -0
- package/lib/bubble-extra.js +623 -0
- package/lib/dom-dataset-CAXnsjYE.cjs +33 -0
- package/lib/dom-dataset-CJ7GyQ2E.js +999 -0
- package/lib/index-COecBbaE.cjs +89 -0
- package/lib/index-ClFtfQ0J.cjs +1 -0
- package/lib/index-CvYIX2-x.js +129 -0
- package/lib/index-CySbCeQd.cjs +1 -0
- package/lib/{index-CO-iymkb.js → index-D9llIWB5.js} +442 -101
- package/lib/index-DXBa3JBo.js +46 -0
- package/lib/index-DjP7Onch.cjs +1 -0
- package/lib/index-Drmyqk9P.js +12322 -0
- package/lib/index-DuhDIOel.js +76 -0
- package/lib/index-LbrE7K9i.cjs +1 -0
- package/lib/index.cjs +2 -1
- package/lib/index.d.cts +290 -108
- package/lib/index.d.ts +290 -108
- package/lib/index.js +587 -13
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +108 -108
- package/lib/locale-bundle.d.ts +108 -108
- package/lib/locale-bundle.js +1 -1
- package/lib/shortId-Bfj8TyNr.cjs +2 -0
- package/lib/shortId-WJVkrvml.js +30 -0
- package/lib/style.css +1 -1
- package/lib/textarea-B45fP3gP.cjs +1 -0
- package/lib/textarea-DXTdXr2y.js +20 -0
- package/package.json +678 -15
- package/lib/RichTextEditor-Ce2IeNE6.js +0 -8265
- package/lib/RichTextEditor-hDDApaDD.cjs +0 -136
- package/lib/extension-bundle.cjs +0 -33
- package/lib/extension-bundle.d.cts +0 -951
- package/lib/extension-bundle.d.ts +0 -951
- package/lib/extension-bundle.js +0 -5982
- package/lib/index-CJ6Hb9MN.cjs +0 -1
- package/lib/tiptap-DOP8lVCQ.js +0 -5950
- package/lib/tiptap-Dq62HiQ9.cjs +0 -113
- package/lib/vendor-BbgkyoD-.js +0 -40297
- package/lib/vendor-DdwtMmSr.cjs +0 -302
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
export declare const ExportPdf: Extension<any, any>;
|
|
4
|
+
|
|
5
|
+
export { }
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
declare module '@tiptap/core' {
|
|
9
|
+
interface Commands<ReturnType> {
|
|
10
|
+
attachment: {
|
|
11
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
declare module '@tiptap/core' {
|
|
18
|
+
interface Commands<ReturnType> {
|
|
19
|
+
setCodeBlock: {
|
|
20
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
declare module '@tiptap/core' {
|
|
27
|
+
interface Commands<ReturnType> {
|
|
28
|
+
excalidraw: {
|
|
29
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
declare module '@tiptap/core' {
|
|
36
|
+
interface Commands<ReturnType> {
|
|
37
|
+
emoji: {
|
|
38
|
+
setEmoji: (emoji: {
|
|
39
|
+
name: string;
|
|
40
|
+
emoji: string;
|
|
41
|
+
}) => ReturnType;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
declare module '@tiptap/core' {
|
|
48
|
+
interface Commands<ReturnType> {
|
|
49
|
+
drawer: {
|
|
50
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
51
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
declare module '@tiptap/core' {
|
|
58
|
+
interface Commands<ReturnType> {
|
|
59
|
+
exportWord: {
|
|
60
|
+
exportToWord: () => ReturnType;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
declare module '@tiptap/core' {
|
|
67
|
+
interface Commands<ReturnType> {
|
|
68
|
+
fontSize: {
|
|
69
|
+
/**
|
|
70
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
71
|
+
* CSS font-size
|
|
72
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
73
|
+
*/
|
|
74
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
75
|
+
/**
|
|
76
|
+
* Unset the font size
|
|
77
|
+
*/
|
|
78
|
+
unsetFontSize: () => ReturnType;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
declare module '@tiptap/core' {
|
|
85
|
+
interface Commands<ReturnType> {
|
|
86
|
+
painter: {
|
|
87
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
declare module '@tiptap/core' {
|
|
94
|
+
interface Commands<ReturnType> {
|
|
95
|
+
iframe: {
|
|
96
|
+
/**
|
|
97
|
+
* Add an iframe
|
|
98
|
+
*/
|
|
99
|
+
setIframe: (options: {
|
|
100
|
+
src: string;
|
|
101
|
+
service: string;
|
|
102
|
+
}) => ReturnType;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
declare module '@tiptap/core' {
|
|
109
|
+
interface Commands<ReturnType> {
|
|
110
|
+
imageUpload: {
|
|
111
|
+
/**
|
|
112
|
+
* Add an image
|
|
113
|
+
*/
|
|
114
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
115
|
+
/**
|
|
116
|
+
* Update an image
|
|
117
|
+
*/
|
|
118
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
119
|
+
/**
|
|
120
|
+
* Set image alignment
|
|
121
|
+
*/
|
|
122
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
declare module '@tiptap/core' {
|
|
129
|
+
interface Commands<ReturnType> {
|
|
130
|
+
imageGifUpload: {
|
|
131
|
+
/**
|
|
132
|
+
* Add an image gif
|
|
133
|
+
*/
|
|
134
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
135
|
+
/**
|
|
136
|
+
* Update an image gif
|
|
137
|
+
*/
|
|
138
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
139
|
+
/**
|
|
140
|
+
* Set image alignment
|
|
141
|
+
*/
|
|
142
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
declare module '@tiptap/core' {
|
|
149
|
+
interface Commands<ReturnType> {
|
|
150
|
+
indent: {
|
|
151
|
+
/**
|
|
152
|
+
* Set the indent attribute
|
|
153
|
+
*/
|
|
154
|
+
indent: () => ReturnType;
|
|
155
|
+
/**
|
|
156
|
+
* Set the outdent attribute
|
|
157
|
+
*/
|
|
158
|
+
outdent: () => ReturnType;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
declare module '@tiptap/core' {
|
|
165
|
+
interface Commands<ReturnType> {
|
|
166
|
+
katex: {
|
|
167
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
declare module '@tiptap/core' {
|
|
174
|
+
interface Commands<ReturnType> {
|
|
175
|
+
lineHeight: {
|
|
176
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
177
|
+
unsetLineHeight: () => ReturnType;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
declare module '@tiptap/core' {
|
|
184
|
+
interface Commands<ReturnType> {
|
|
185
|
+
mermaid: {
|
|
186
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
187
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
columns: {
|
|
196
|
+
insertColumns: (attrs?: {
|
|
197
|
+
cols: number;
|
|
198
|
+
}) => ReturnType;
|
|
199
|
+
addColBefore: () => ReturnType;
|
|
200
|
+
addColAfter: () => ReturnType;
|
|
201
|
+
deleteCol: () => ReturnType;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
declare module '@tiptap/core' {
|
|
208
|
+
interface Commands<ReturnType> {
|
|
209
|
+
search: {
|
|
210
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
211
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
212
|
+
replace: () => ReturnType;
|
|
213
|
+
replaceAll: () => ReturnType;
|
|
214
|
+
goToPrevSearchResult: () => void;
|
|
215
|
+
goToNextSearchResult: () => void;
|
|
216
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
declare module '@tiptap/core' {
|
|
223
|
+
interface Commands<ReturnType> {
|
|
224
|
+
tableOfContents: {
|
|
225
|
+
setTableOfContents: () => ReturnType;
|
|
226
|
+
removeTableOfContents: () => ReturnType;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
declare module '@tiptap/core' {
|
|
233
|
+
interface Commands<ReturnType> {
|
|
234
|
+
twitter: {
|
|
235
|
+
/**
|
|
236
|
+
* Insert a tweet
|
|
237
|
+
* @param options The tweet attributes
|
|
238
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
239
|
+
*/
|
|
240
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
241
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
declare module '@tiptap/core' {
|
|
248
|
+
interface Commands<ReturnType> {
|
|
249
|
+
video: {
|
|
250
|
+
/**
|
|
251
|
+
* Add an video
|
|
252
|
+
*/
|
|
253
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
254
|
+
/**
|
|
255
|
+
* Update an video
|
|
256
|
+
*/
|
|
257
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
declare module '@tiptap/core' {
|
|
264
|
+
interface Commands<ReturnType> {
|
|
265
|
+
tableCellBackground: {
|
|
266
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
267
|
+
unsetTableCellBackground: () => ReturnType;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
export declare const ExportPdf: Extension<any, any>;
|
|
4
|
+
|
|
5
|
+
export { }
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
declare module '@tiptap/core' {
|
|
9
|
+
interface Commands<ReturnType> {
|
|
10
|
+
attachment: {
|
|
11
|
+
setAttachment: (attrs?: unknown) => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
declare module '@tiptap/core' {
|
|
18
|
+
interface Commands<ReturnType> {
|
|
19
|
+
setCodeBlock: {
|
|
20
|
+
setCodeBlock: (options?: any) => ReturnType;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
declare module '@tiptap/core' {
|
|
27
|
+
interface Commands<ReturnType> {
|
|
28
|
+
excalidraw: {
|
|
29
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
declare module '@tiptap/core' {
|
|
36
|
+
interface Commands<ReturnType> {
|
|
37
|
+
emoji: {
|
|
38
|
+
setEmoji: (emoji: {
|
|
39
|
+
name: string;
|
|
40
|
+
emoji: string;
|
|
41
|
+
}) => ReturnType;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
declare module '@tiptap/core' {
|
|
48
|
+
interface Commands<ReturnType> {
|
|
49
|
+
drawer: {
|
|
50
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
51
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
declare module '@tiptap/core' {
|
|
58
|
+
interface Commands<ReturnType> {
|
|
59
|
+
exportWord: {
|
|
60
|
+
exportToWord: () => ReturnType;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
declare module '@tiptap/core' {
|
|
67
|
+
interface Commands<ReturnType> {
|
|
68
|
+
fontSize: {
|
|
69
|
+
/**
|
|
70
|
+
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
71
|
+
* CSS font-size
|
|
72
|
+
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
73
|
+
*/
|
|
74
|
+
setFontSize: (fontSize: string) => ReturnType;
|
|
75
|
+
/**
|
|
76
|
+
* Unset the font size
|
|
77
|
+
*/
|
|
78
|
+
unsetFontSize: () => ReturnType;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
declare module '@tiptap/core' {
|
|
85
|
+
interface Commands<ReturnType> {
|
|
86
|
+
painter: {
|
|
87
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
declare module '@tiptap/core' {
|
|
94
|
+
interface Commands<ReturnType> {
|
|
95
|
+
iframe: {
|
|
96
|
+
/**
|
|
97
|
+
* Add an iframe
|
|
98
|
+
*/
|
|
99
|
+
setIframe: (options: {
|
|
100
|
+
src: string;
|
|
101
|
+
service: string;
|
|
102
|
+
}) => ReturnType;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
declare module '@tiptap/core' {
|
|
109
|
+
interface Commands<ReturnType> {
|
|
110
|
+
imageUpload: {
|
|
111
|
+
/**
|
|
112
|
+
* Add an image
|
|
113
|
+
*/
|
|
114
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
115
|
+
/**
|
|
116
|
+
* Update an image
|
|
117
|
+
*/
|
|
118
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
119
|
+
/**
|
|
120
|
+
* Set image alignment
|
|
121
|
+
*/
|
|
122
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
declare module '@tiptap/core' {
|
|
129
|
+
interface Commands<ReturnType> {
|
|
130
|
+
imageGifUpload: {
|
|
131
|
+
/**
|
|
132
|
+
* Add an image gif
|
|
133
|
+
*/
|
|
134
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
135
|
+
/**
|
|
136
|
+
* Update an image gif
|
|
137
|
+
*/
|
|
138
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
139
|
+
/**
|
|
140
|
+
* Set image alignment
|
|
141
|
+
*/
|
|
142
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
declare module '@tiptap/core' {
|
|
149
|
+
interface Commands<ReturnType> {
|
|
150
|
+
indent: {
|
|
151
|
+
/**
|
|
152
|
+
* Set the indent attribute
|
|
153
|
+
*/
|
|
154
|
+
indent: () => ReturnType;
|
|
155
|
+
/**
|
|
156
|
+
* Set the outdent attribute
|
|
157
|
+
*/
|
|
158
|
+
outdent: () => ReturnType;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
declare module '@tiptap/core' {
|
|
165
|
+
interface Commands<ReturnType> {
|
|
166
|
+
katex: {
|
|
167
|
+
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
declare module '@tiptap/core' {
|
|
174
|
+
interface Commands<ReturnType> {
|
|
175
|
+
lineHeight: {
|
|
176
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
177
|
+
unsetLineHeight: () => ReturnType;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
declare module '@tiptap/core' {
|
|
184
|
+
interface Commands<ReturnType> {
|
|
185
|
+
mermaid: {
|
|
186
|
+
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
187
|
+
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
declare module '@tiptap/core' {
|
|
194
|
+
interface Commands<ReturnType> {
|
|
195
|
+
columns: {
|
|
196
|
+
insertColumns: (attrs?: {
|
|
197
|
+
cols: number;
|
|
198
|
+
}) => ReturnType;
|
|
199
|
+
addColBefore: () => ReturnType;
|
|
200
|
+
addColAfter: () => ReturnType;
|
|
201
|
+
deleteCol: () => ReturnType;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
declare module '@tiptap/core' {
|
|
208
|
+
interface Commands<ReturnType> {
|
|
209
|
+
search: {
|
|
210
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
211
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
212
|
+
replace: () => ReturnType;
|
|
213
|
+
replaceAll: () => ReturnType;
|
|
214
|
+
goToPrevSearchResult: () => void;
|
|
215
|
+
goToNextSearchResult: () => void;
|
|
216
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
declare module '@tiptap/core' {
|
|
223
|
+
interface Commands<ReturnType> {
|
|
224
|
+
tableOfContents: {
|
|
225
|
+
setTableOfContents: () => ReturnType;
|
|
226
|
+
removeTableOfContents: () => ReturnType;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
declare module '@tiptap/core' {
|
|
233
|
+
interface Commands<ReturnType> {
|
|
234
|
+
twitter: {
|
|
235
|
+
/**
|
|
236
|
+
* Insert a tweet
|
|
237
|
+
* @param options The tweet attributes
|
|
238
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
239
|
+
*/
|
|
240
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
241
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
declare module '@tiptap/core' {
|
|
248
|
+
interface Commands<ReturnType> {
|
|
249
|
+
video: {
|
|
250
|
+
/**
|
|
251
|
+
* Add an video
|
|
252
|
+
*/
|
|
253
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
254
|
+
/**
|
|
255
|
+
* Update an video
|
|
256
|
+
*/
|
|
257
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
declare module '@tiptap/core' {
|
|
264
|
+
interface Commands<ReturnType> {
|
|
265
|
+
tableCellBackground: {
|
|
266
|
+
setTableCellBackground: (color: string) => ReturnType;
|
|
267
|
+
unsetTableCellBackground: () => ReturnType;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
package/lib/ExportPdf.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { E as c } from "./index-Drmyqk9P.js";
|
|
2
|
+
import { A as d } from "./RichTextEditor-Cy9XKEI5.js";
|
|
3
|
+
function s(n) {
|
|
4
|
+
const t = document.createElement("iframe");
|
|
5
|
+
t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
|
|
6
|
+
<!DOCTYPE html>
|
|
7
|
+
<html lang="en">
|
|
8
|
+
<head>
|
|
9
|
+
<title>Echo Editor</title>
|
|
10
|
+
<meta charset="UTF-8">
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
12
|
+
</head>
|
|
13
|
+
<body class="is-print">
|
|
14
|
+
<div class="tiptap ProseMirror" translate="no" aria-expanded="false">
|
|
15
|
+
${n}
|
|
16
|
+
</div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
19
|
+
`;
|
|
20
|
+
const e = t.contentWindow, o = t.contentDocument || t.contentWindow && t.contentWindow.document, i = document.createElement("link");
|
|
21
|
+
i.rel = "stylesheet", i.href = "https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css", o.head.appendChild(i), o && (o.open(), o.write(n), o.close()), e && t.addEventListener("load", function() {
|
|
22
|
+
try {
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
e.focus();
|
|
25
|
+
try {
|
|
26
|
+
e.document.execCommand("print", !1) || e.print();
|
|
27
|
+
} catch {
|
|
28
|
+
e.print();
|
|
29
|
+
}
|
|
30
|
+
e.close();
|
|
31
|
+
}, 10);
|
|
32
|
+
} catch (r) {
|
|
33
|
+
console.error(r);
|
|
34
|
+
}
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
document.body.removeChild(t);
|
|
37
|
+
}, 100);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function a(n) {
|
|
41
|
+
const t = n.getHTML();
|
|
42
|
+
return t ? (s(t), !0) : !1;
|
|
43
|
+
}
|
|
44
|
+
const m = /* @__PURE__ */ c.create({
|
|
45
|
+
name: "exportPdf",
|
|
46
|
+
addOptions() {
|
|
47
|
+
var n;
|
|
48
|
+
return {
|
|
49
|
+
...(n = this.parent) == null ? void 0 : n.call(this),
|
|
50
|
+
button: ({ editor: t, t: e }) => ({
|
|
51
|
+
component: d,
|
|
52
|
+
componentProps: {
|
|
53
|
+
action: () => {
|
|
54
|
+
a(t);
|
|
55
|
+
},
|
|
56
|
+
icon: "ExportPdf",
|
|
57
|
+
tooltip: e("editor.exportPdf.tooltip"),
|
|
58
|
+
isActive: () => !1,
|
|
59
|
+
disabled: !1
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
m as ExportPdf
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-COecBbaE.cjs"),s=require("docx"),t=require("prosemirror-docx"),i=require("./RichTextEditor-DkpDEr5U.cjs"),l=typeof window<"u";function c(o,e){if(l){const n=window.URL.createObjectURL(o),r=document.createElement("a");return r.href=n,r.download=e,r.click(),window.URL.revokeObjectURL(n),Promise.resolve()}return console.error("Download is not supported in Node.js"),Promise.resolve()}const u={...t.defaultNodes,hardBreak:t.defaultNodes.hard_break,codeBlock:t.defaultNodes.code_block,orderedList:t.defaultNodes.ordered_list,listItem:t.defaultNodes.list_item,bulletList:t.defaultNodes.bullet_list,horizontalRule:t.defaultNodes.horizontal_rule,image(o,e){o.renderInline(e),o.closeBlock(e)},table(o,e){o.table(e,{tableOptions:{width:{size:100,type:s.WidthType.PERCENTAGE}}})}},p=new t.DocxSerializer(u,t.defaultMarks),f=a.Extension.create({name:"exportWord",addOptions(){var o;return{...(o=this.parent)==null?void 0:o.call(this),button:({editor:e,t:n})=>({component:i.ActionButton,componentProps:{icon:"ExportWord",action:()=>{e==null||e.commands.exportToWord()},tooltip:n("editor.exportWord.tooltip"),isActive:()=>!1,disabled:!1}})}},addCommands(){return{exportToWord:()=>async({editor:o})=>{const e={getImageBuffer:async r=>{const d=await(await fetch(r)).arrayBuffer();return new Uint8Array(d)}},n=p.serialize(o.state.doc,e);return s.Packer.toBlob(n).then(r=>c(new Blob([r]),"export-document.docx")),!0}}}});exports.ExportWord=f;
|