reactjs-tiptap-editor 0.3.25 → 0.3.27
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-Bh2ft7th.js → ActionMenuButton-D3nLtawn.js} +1 -1
- package/lib/{ActionMenuButton-B3XOtCey.cjs → ActionMenuButton-fkh63F_R.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +26 -17
- package/lib/Attachment.d.ts +26 -17
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +26 -17
- package/lib/Blockquote.d.ts +26 -17
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +26 -17
- package/lib/Bold.d.ts +26 -17
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +26 -17
- package/lib/BulletList.d.ts +26 -17
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +26 -17
- package/lib/Clear.d.ts +26 -17
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +26 -17
- package/lib/Code.d.ts +26 -17
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +26 -17
- package/lib/CodeBlock.d.ts +26 -17
- package/lib/CodeBlock.js +1 -1
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +26 -17
- package/lib/CodeView.d.ts +26 -17
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +26 -17
- package/lib/Color.d.ts +26 -17
- package/lib/Color.js +1 -1
- package/lib/Document.d.cts +26 -17
- package/lib/Document.d.ts +26 -17
- package/lib/{Drawer-Orz21MYs.js → Drawer-BBVUujX4.js} +1 -1
- package/lib/{Drawer-CUntRzbs.cjs → Drawer-DetzmUvQ.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +26 -17
- package/lib/Drawer.d.ts +26 -17
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +26 -17
- package/lib/Emoji.d.ts +26 -17
- package/lib/Emoji.js +1 -1
- package/lib/{Excalidraw-Cj-sXq5F.js → Excalidraw-BVdio4hk.js} +1 -1
- package/lib/{Excalidraw-Bu8XuykT.cjs → Excalidraw-DVnwdz-w.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +26 -17
- package/lib/Excalidraw.d.ts +26 -17
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +4 -4
- package/lib/ExportPdf.d.cts +27 -17
- package/lib/ExportPdf.d.ts +27 -17
- package/lib/ExportPdf.js +34 -27
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +26 -17
- package/lib/ExportWord.d.ts +26 -17
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +26 -17
- package/lib/FontFamily.d.ts +26 -17
- package/lib/FontFamily.js +2 -2
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +26 -17
- package/lib/FontSize.d.ts +26 -17
- package/lib/FontSize.js +2 -2
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +26 -17
- package/lib/FormatPainter.d.ts +26 -17
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +26 -17
- package/lib/Heading.d.ts +26 -17
- package/lib/Heading.js +2 -2
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +26 -17
- package/lib/Highlight.d.ts +26 -17
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +26 -17
- package/lib/History.d.ts +26 -17
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +26 -17
- package/lib/HorizontalRule.d.ts +26 -17
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +26 -17
- package/lib/Iframe.d.ts +26 -17
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +26 -17
- package/lib/Image.d.ts +26 -17
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +26 -17
- package/lib/ImageGif.d.ts +26 -17
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.d.cts +26 -17
- package/lib/ImportWord.d.ts +26 -17
- package/lib/ImportWord.js +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +26 -17
- package/lib/Indent.d.ts +26 -17
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +26 -17
- package/lib/Italic.d.ts +26 -17
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +26 -17
- package/lib/Katex.d.ts +26 -17
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +26 -17
- package/lib/LineHeight.d.ts +26 -17
- package/lib/LineHeight.js +1 -1
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +26 -17
- package/lib/Link.d.ts +26 -17
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +26 -17
- package/lib/ListItem.d.ts +26 -17
- package/lib/Mention.d.cts +26 -17
- package/lib/Mention.d.ts +26 -17
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +26 -17
- package/lib/Mermaid.d.ts +26 -17
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +26 -17
- package/lib/MoreMark.d.ts +26 -17
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +26 -17
- package/lib/MultiColumn.d.ts +26 -17
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +26 -17
- package/lib/OrderedList.d.ts +26 -17
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-CfAFp9V2.js → RichTextEditor-BJWhWz4z.js} +1460 -1446
- package/lib/{RichTextEditor-B5WYnm7K.cjs → RichTextEditor-DoMu_nCj.cjs} +7 -7
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +26 -17
- package/lib/SearchAndReplace.d.ts +26 -17
- package/lib/SearchAndReplace.js +1 -1
- package/lib/Selection.d.cts +26 -17
- package/lib/Selection.d.ts +26 -17
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +26 -17
- package/lib/SlashCommand.d.ts +26 -17
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +26 -17
- package/lib/Strike.d.ts +26 -17
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +26 -17
- package/lib/SubAndSuperScript.d.ts +26 -17
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +26 -17
- package/lib/Table.d.ts +26 -17
- package/lib/Table.js +1 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +26 -17
- package/lib/TableOfContent.d.ts +26 -17
- package/lib/TableOfContent.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +26 -17
- package/lib/TaskList.d.ts +26 -17
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +26 -17
- package/lib/TextAlign.d.ts +26 -17
- package/lib/TextAlign.js +1 -1
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +26 -17
- package/lib/TextBubble.d.ts +26 -17
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +26 -17
- package/lib/TextDirection.d.ts +26 -17
- package/lib/TextDirection.js +1 -1
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +26 -17
- package/lib/TextUnderline.d.ts +26 -17
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +26 -17
- package/lib/TrailingNode.d.ts +26 -17
- package/lib/{Twitter-BFwUowi8.cjs → Twitter--OkCPska.cjs} +1 -1
- package/lib/{Twitter-9AKqIK4p.js → Twitter-CXwmqolk.js} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +26 -17
- package/lib/Twitter.d.ts +26 -17
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +26 -17
- package/lib/Video.d.ts +26 -17
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +26 -17
- package/lib/bubble-extra.d.ts +26 -17
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +26 -17
- package/lib/index.d.ts +26 -17
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +26 -17
- package/lib/locale-bundle.d.ts +26 -17
- package/lib/{textarea-bND4WL8o.cjs → textarea-DkVc2MIQ.cjs} +1 -1
- package/lib/{textarea-CWt0EMiJ.js → textarea-HW9QlrCS.js} +1 -1
- package/package.json +1 -1
package/lib/Excalidraw.d.cts
CHANGED
|
@@ -43,6 +43,16 @@ declare module '@tiptap/core' {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
declare module '@tiptap/core' {
|
|
47
|
+
interface Commands<ReturnType> {
|
|
48
|
+
drawer: {
|
|
49
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
50
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
46
56
|
declare module '@tiptap/core' {
|
|
47
57
|
interface Commands<ReturnType> {
|
|
48
58
|
emoji: {
|
|
@@ -57,9 +67,8 @@ declare module '@tiptap/core' {
|
|
|
57
67
|
|
|
58
68
|
declare module '@tiptap/core' {
|
|
59
69
|
interface Commands<ReturnType> {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
70
|
+
excalidraw: {
|
|
71
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
63
72
|
};
|
|
64
73
|
}
|
|
65
74
|
}
|
|
@@ -67,8 +76,8 @@ declare module '@tiptap/core' {
|
|
|
67
76
|
|
|
68
77
|
declare module '@tiptap/core' {
|
|
69
78
|
interface Commands<ReturnType> {
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
exportPdf: {
|
|
80
|
+
exportToPdf: () => ReturnType;
|
|
72
81
|
};
|
|
73
82
|
}
|
|
74
83
|
}
|
|
@@ -127,19 +136,19 @@ declare module '@tiptap/core' {
|
|
|
127
136
|
|
|
128
137
|
declare module '@tiptap/core' {
|
|
129
138
|
interface Commands<ReturnType> {
|
|
130
|
-
|
|
139
|
+
imageUpload: {
|
|
131
140
|
/**
|
|
132
|
-
* Add an image
|
|
141
|
+
* Add an image
|
|
133
142
|
*/
|
|
134
|
-
|
|
143
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
135
144
|
/**
|
|
136
|
-
* Update an image
|
|
145
|
+
* Update an image
|
|
137
146
|
*/
|
|
138
|
-
|
|
147
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
139
148
|
/**
|
|
140
149
|
* Set image alignment
|
|
141
150
|
*/
|
|
142
|
-
|
|
151
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
143
152
|
};
|
|
144
153
|
}
|
|
145
154
|
}
|
|
@@ -147,19 +156,19 @@ declare module '@tiptap/core' {
|
|
|
147
156
|
|
|
148
157
|
declare module '@tiptap/core' {
|
|
149
158
|
interface Commands<ReturnType> {
|
|
150
|
-
|
|
159
|
+
imageGifUpload: {
|
|
151
160
|
/**
|
|
152
|
-
* Add an image
|
|
161
|
+
* Add an image gif
|
|
153
162
|
*/
|
|
154
|
-
|
|
163
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
155
164
|
/**
|
|
156
|
-
* Update an image
|
|
165
|
+
* Update an image gif
|
|
157
166
|
*/
|
|
158
|
-
|
|
167
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
159
168
|
/**
|
|
160
169
|
* Set image alignment
|
|
161
170
|
*/
|
|
162
|
-
|
|
171
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
163
172
|
};
|
|
164
173
|
}
|
|
165
174
|
}
|
package/lib/Excalidraw.d.ts
CHANGED
|
@@ -43,6 +43,16 @@ declare module '@tiptap/core' {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
declare module '@tiptap/core' {
|
|
47
|
+
interface Commands<ReturnType> {
|
|
48
|
+
drawer: {
|
|
49
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
50
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
46
56
|
declare module '@tiptap/core' {
|
|
47
57
|
interface Commands<ReturnType> {
|
|
48
58
|
emoji: {
|
|
@@ -57,9 +67,8 @@ declare module '@tiptap/core' {
|
|
|
57
67
|
|
|
58
68
|
declare module '@tiptap/core' {
|
|
59
69
|
interface Commands<ReturnType> {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
70
|
+
excalidraw: {
|
|
71
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
63
72
|
};
|
|
64
73
|
}
|
|
65
74
|
}
|
|
@@ -67,8 +76,8 @@ declare module '@tiptap/core' {
|
|
|
67
76
|
|
|
68
77
|
declare module '@tiptap/core' {
|
|
69
78
|
interface Commands<ReturnType> {
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
exportPdf: {
|
|
80
|
+
exportToPdf: () => ReturnType;
|
|
72
81
|
};
|
|
73
82
|
}
|
|
74
83
|
}
|
|
@@ -127,19 +136,19 @@ declare module '@tiptap/core' {
|
|
|
127
136
|
|
|
128
137
|
declare module '@tiptap/core' {
|
|
129
138
|
interface Commands<ReturnType> {
|
|
130
|
-
|
|
139
|
+
imageUpload: {
|
|
131
140
|
/**
|
|
132
|
-
* Add an image
|
|
141
|
+
* Add an image
|
|
133
142
|
*/
|
|
134
|
-
|
|
143
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
135
144
|
/**
|
|
136
|
-
* Update an image
|
|
145
|
+
* Update an image
|
|
137
146
|
*/
|
|
138
|
-
|
|
147
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
139
148
|
/**
|
|
140
149
|
* Set image alignment
|
|
141
150
|
*/
|
|
142
|
-
|
|
151
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
143
152
|
};
|
|
144
153
|
}
|
|
145
154
|
}
|
|
@@ -147,19 +156,19 @@ declare module '@tiptap/core' {
|
|
|
147
156
|
|
|
148
157
|
declare module '@tiptap/core' {
|
|
149
158
|
interface Commands<ReturnType> {
|
|
150
|
-
|
|
159
|
+
imageGifUpload: {
|
|
151
160
|
/**
|
|
152
|
-
* Add an image
|
|
161
|
+
* Add an image gif
|
|
153
162
|
*/
|
|
154
|
-
|
|
163
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
155
164
|
/**
|
|
156
|
-
* Update an image
|
|
165
|
+
* Update an image gif
|
|
157
166
|
*/
|
|
158
|
-
|
|
167
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
159
168
|
/**
|
|
160
169
|
* Set image alignment
|
|
161
170
|
*/
|
|
162
|
-
|
|
171
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
163
172
|
};
|
|
164
173
|
}
|
|
165
174
|
}
|
package/lib/Excalidraw.js
CHANGED
package/lib/ExportPdf.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-ByRfqzMr.cjs"),b=require("./RichTextEditor-DoMu_nCj.cjs");function y(e,o){var i;const t=document.createElement("iframe");t.setAttribute("style","position: absolute; width: 0; height: 0; top: 0; left: 0;"),document.body.appendChild(t);const n=t.contentDocument||((i=t.contentWindow)==null?void 0:i.document);if(!n)return;const{paperSize:a,title:c="Echo Editor",margins:{top:l,right:p,bottom:m,left:h}}=o,u=`
|
|
2
2
|
<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
|
-
<title
|
|
5
|
+
<title>${c}</title>
|
|
6
6
|
<meta charset="UTF-8">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
8
|
<style>
|
|
9
9
|
@media print {
|
|
10
10
|
@page {
|
|
11
11
|
size: ${a};
|
|
12
|
-
margin: ${
|
|
12
|
+
margin: ${l} ${p} ${m} ${h}; /* top, right, bottom, left */
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
body {
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
</div>
|
|
37
37
|
</body>
|
|
38
38
|
</html>
|
|
39
|
-
`;n.open(),n.write(
|
|
39
|
+
`;n.open(),n.write(u),n.close(),t.addEventListener("load",()=>{setTimeout(()=>{var r,d;try{(r=t.contentWindow)==null||r.focus(),(d=t.contentWindow)==null||d.print()}catch(f){console.error("Print failed",f)}setTimeout(()=>{document.body.removeChild(t)},100)},50)})}function s(e,o){const t=e.getHTML();return t?(y(t,o),!0):!1}const E=g.Extension.create({name:"exportPdf",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),paperSize:"Letter",title:"Echo Editor",margins:{top:"0.4in",right:"0.4in",bottom:"0.4in",left:"0.4in"},button:({editor:o,extension:t,t:n})=>({component:b.ActionButton,componentProps:{action:()=>{s(o,t.options)},icon:"ExportPdf",tooltip:n("editor.exportPdf.tooltip"),isActive:()=>!1,disabled:!1}})}},addCommands(){return{exportToPdf:()=>({editor:e})=>s(e,this.options)}}});exports.ExportPdf=E;
|
package/lib/ExportPdf.d.cts
CHANGED
|
@@ -58,6 +58,7 @@ export declare const ExportPdf: Extension<ExportPdfOptions, any>;
|
|
|
58
58
|
|
|
59
59
|
export declare interface ExportPdfOptions extends GeneralOptions<ExportPdfOptions> {
|
|
60
60
|
paperSize: PaperSize;
|
|
61
|
+
title?: string;
|
|
61
62
|
margins: {
|
|
62
63
|
top?: PageMargin;
|
|
63
64
|
right?: PageMargin;
|
|
@@ -117,6 +118,16 @@ declare module '@tiptap/core' {
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
|
|
121
|
+
declare module '@tiptap/core' {
|
|
122
|
+
interface Commands<ReturnType> {
|
|
123
|
+
drawer: {
|
|
124
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
125
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
120
131
|
declare module '@tiptap/core' {
|
|
121
132
|
interface Commands<ReturnType> {
|
|
122
133
|
emoji: {
|
|
@@ -131,9 +142,8 @@ declare module '@tiptap/core' {
|
|
|
131
142
|
|
|
132
143
|
declare module '@tiptap/core' {
|
|
133
144
|
interface Commands<ReturnType> {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
145
|
+
excalidraw: {
|
|
146
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
137
147
|
};
|
|
138
148
|
}
|
|
139
149
|
}
|
|
@@ -141,8 +151,8 @@ declare module '@tiptap/core' {
|
|
|
141
151
|
|
|
142
152
|
declare module '@tiptap/core' {
|
|
143
153
|
interface Commands<ReturnType> {
|
|
144
|
-
|
|
145
|
-
|
|
154
|
+
exportPdf: {
|
|
155
|
+
exportToPdf: () => ReturnType;
|
|
146
156
|
};
|
|
147
157
|
}
|
|
148
158
|
}
|
|
@@ -201,19 +211,19 @@ declare module '@tiptap/core' {
|
|
|
201
211
|
|
|
202
212
|
declare module '@tiptap/core' {
|
|
203
213
|
interface Commands<ReturnType> {
|
|
204
|
-
|
|
214
|
+
imageUpload: {
|
|
205
215
|
/**
|
|
206
|
-
* Add an image
|
|
216
|
+
* Add an image
|
|
207
217
|
*/
|
|
208
|
-
|
|
218
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
209
219
|
/**
|
|
210
|
-
* Update an image
|
|
220
|
+
* Update an image
|
|
211
221
|
*/
|
|
212
|
-
|
|
222
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
213
223
|
/**
|
|
214
224
|
* Set image alignment
|
|
215
225
|
*/
|
|
216
|
-
|
|
226
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
217
227
|
};
|
|
218
228
|
}
|
|
219
229
|
}
|
|
@@ -221,19 +231,19 @@ declare module '@tiptap/core' {
|
|
|
221
231
|
|
|
222
232
|
declare module '@tiptap/core' {
|
|
223
233
|
interface Commands<ReturnType> {
|
|
224
|
-
|
|
234
|
+
imageGifUpload: {
|
|
225
235
|
/**
|
|
226
|
-
* Add an image
|
|
236
|
+
* Add an image gif
|
|
227
237
|
*/
|
|
228
|
-
|
|
238
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
229
239
|
/**
|
|
230
|
-
* Update an image
|
|
240
|
+
* Update an image gif
|
|
231
241
|
*/
|
|
232
|
-
|
|
242
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
233
243
|
/**
|
|
234
244
|
* Set image alignment
|
|
235
245
|
*/
|
|
236
|
-
|
|
246
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
237
247
|
};
|
|
238
248
|
}
|
|
239
249
|
}
|
package/lib/ExportPdf.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export declare const ExportPdf: Extension<ExportPdfOptions, any>;
|
|
|
58
58
|
|
|
59
59
|
export declare interface ExportPdfOptions extends GeneralOptions<ExportPdfOptions> {
|
|
60
60
|
paperSize: PaperSize;
|
|
61
|
+
title?: string;
|
|
61
62
|
margins: {
|
|
62
63
|
top?: PageMargin;
|
|
63
64
|
right?: PageMargin;
|
|
@@ -117,6 +118,16 @@ declare module '@tiptap/core' {
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
|
|
121
|
+
declare module '@tiptap/core' {
|
|
122
|
+
interface Commands<ReturnType> {
|
|
123
|
+
drawer: {
|
|
124
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
125
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
120
131
|
declare module '@tiptap/core' {
|
|
121
132
|
interface Commands<ReturnType> {
|
|
122
133
|
emoji: {
|
|
@@ -131,9 +142,8 @@ declare module '@tiptap/core' {
|
|
|
131
142
|
|
|
132
143
|
declare module '@tiptap/core' {
|
|
133
144
|
interface Commands<ReturnType> {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
145
|
+
excalidraw: {
|
|
146
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
137
147
|
};
|
|
138
148
|
}
|
|
139
149
|
}
|
|
@@ -141,8 +151,8 @@ declare module '@tiptap/core' {
|
|
|
141
151
|
|
|
142
152
|
declare module '@tiptap/core' {
|
|
143
153
|
interface Commands<ReturnType> {
|
|
144
|
-
|
|
145
|
-
|
|
154
|
+
exportPdf: {
|
|
155
|
+
exportToPdf: () => ReturnType;
|
|
146
156
|
};
|
|
147
157
|
}
|
|
148
158
|
}
|
|
@@ -201,19 +211,19 @@ declare module '@tiptap/core' {
|
|
|
201
211
|
|
|
202
212
|
declare module '@tiptap/core' {
|
|
203
213
|
interface Commands<ReturnType> {
|
|
204
|
-
|
|
214
|
+
imageUpload: {
|
|
205
215
|
/**
|
|
206
|
-
* Add an image
|
|
216
|
+
* Add an image
|
|
207
217
|
*/
|
|
208
|
-
|
|
218
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
209
219
|
/**
|
|
210
|
-
* Update an image
|
|
220
|
+
* Update an image
|
|
211
221
|
*/
|
|
212
|
-
|
|
222
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
213
223
|
/**
|
|
214
224
|
* Set image alignment
|
|
215
225
|
*/
|
|
216
|
-
|
|
226
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
217
227
|
};
|
|
218
228
|
}
|
|
219
229
|
}
|
|
@@ -221,19 +231,19 @@ declare module '@tiptap/core' {
|
|
|
221
231
|
|
|
222
232
|
declare module '@tiptap/core' {
|
|
223
233
|
interface Commands<ReturnType> {
|
|
224
|
-
|
|
234
|
+
imageGifUpload: {
|
|
225
235
|
/**
|
|
226
|
-
* Add an image
|
|
236
|
+
* Add an image gif
|
|
227
237
|
*/
|
|
228
|
-
|
|
238
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
229
239
|
/**
|
|
230
|
-
* Update an image
|
|
240
|
+
* Update an image gif
|
|
231
241
|
*/
|
|
232
|
-
|
|
242
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
233
243
|
/**
|
|
234
244
|
* Set image alignment
|
|
235
245
|
*/
|
|
236
|
-
|
|
246
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
237
247
|
};
|
|
238
248
|
}
|
|
239
249
|
}
|
package/lib/ExportPdf.js
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import { A as
|
|
3
|
-
function
|
|
1
|
+
import { E as g } from "./index-DI9T3iLd.js";
|
|
2
|
+
import { A as b } from "./RichTextEditor-BJWhWz4z.js";
|
|
3
|
+
function y(e, n) {
|
|
4
4
|
var i;
|
|
5
5
|
const t = document.createElement("iframe");
|
|
6
6
|
t.setAttribute(
|
|
7
7
|
"style",
|
|
8
8
|
"position: absolute; width: 0; height: 0; top: 0; left: 0;"
|
|
9
9
|
), document.body.appendChild(t);
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
10
|
+
const o = t.contentDocument || ((i = t.contentWindow) == null ? void 0 : i.document);
|
|
11
|
+
if (!o) return;
|
|
12
12
|
const {
|
|
13
|
-
paperSize:
|
|
13
|
+
paperSize: s,
|
|
14
|
+
title: c = "Echo Editor",
|
|
14
15
|
margins: {
|
|
15
|
-
top:
|
|
16
|
-
right:
|
|
17
|
-
bottom:
|
|
18
|
-
left:
|
|
16
|
+
top: p,
|
|
17
|
+
right: l,
|
|
18
|
+
bottom: m,
|
|
19
|
+
left: h
|
|
19
20
|
}
|
|
20
|
-
} =
|
|
21
|
+
} = n, f = `
|
|
21
22
|
<!DOCTYPE html>
|
|
22
23
|
<html lang="en">
|
|
23
24
|
<head>
|
|
24
|
-
<title
|
|
25
|
+
<title>${c}</title>
|
|
25
26
|
<meta charset="UTF-8">
|
|
26
27
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
27
28
|
<style>
|
|
28
29
|
@media print {
|
|
29
30
|
@page {
|
|
30
|
-
size: ${
|
|
31
|
-
margin: ${
|
|
31
|
+
size: ${s};
|
|
32
|
+
margin: ${p} ${l} ${m} ${h}; /* top, right, bottom, left */
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
body {
|
|
@@ -56,13 +57,13 @@ function g(e, o) {
|
|
|
56
57
|
</body>
|
|
57
58
|
</html>
|
|
58
59
|
`;
|
|
59
|
-
|
|
60
|
+
o.open(), o.write(f), o.close(), t.addEventListener("load", () => {
|
|
60
61
|
setTimeout(() => {
|
|
61
|
-
var r,
|
|
62
|
+
var r, d;
|
|
62
63
|
try {
|
|
63
|
-
(r = t.contentWindow) == null || r.focus(), (
|
|
64
|
-
} catch (
|
|
65
|
-
console.error("Print failed",
|
|
64
|
+
(r = t.contentWindow) == null || r.focus(), (d = t.contentWindow) == null || d.print();
|
|
65
|
+
} catch (u) {
|
|
66
|
+
console.error("Print failed", u);
|
|
66
67
|
}
|
|
67
68
|
setTimeout(() => {
|
|
68
69
|
document.body.removeChild(t);
|
|
@@ -70,38 +71,44 @@ function g(e, o) {
|
|
|
70
71
|
}, 50);
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function a(e, n) {
|
|
74
75
|
const t = e.getHTML();
|
|
75
|
-
return t ? (
|
|
76
|
+
return t ? (y(t, n), !0) : !1;
|
|
76
77
|
}
|
|
77
|
-
const
|
|
78
|
+
const x = /* @__PURE__ */ g.create({
|
|
78
79
|
name: "exportPdf",
|
|
79
80
|
addOptions() {
|
|
80
81
|
var e;
|
|
81
82
|
return {
|
|
82
83
|
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
83
84
|
paperSize: "Letter",
|
|
85
|
+
title: "Echo Editor",
|
|
84
86
|
margins: {
|
|
85
87
|
top: "0.4in",
|
|
86
88
|
right: "0.4in",
|
|
87
89
|
bottom: "0.4in",
|
|
88
90
|
left: "0.4in"
|
|
89
91
|
},
|
|
90
|
-
button: ({ editor:
|
|
91
|
-
component:
|
|
92
|
+
button: ({ editor: n, extension: t, t: o }) => ({
|
|
93
|
+
component: b,
|
|
92
94
|
componentProps: {
|
|
93
95
|
action: () => {
|
|
94
|
-
|
|
96
|
+
a(n, t.options);
|
|
95
97
|
},
|
|
96
98
|
icon: "ExportPdf",
|
|
97
|
-
tooltip:
|
|
99
|
+
tooltip: o("editor.exportPdf.tooltip"),
|
|
98
100
|
isActive: () => !1,
|
|
99
101
|
disabled: !1
|
|
100
102
|
}
|
|
101
103
|
})
|
|
102
104
|
};
|
|
105
|
+
},
|
|
106
|
+
addCommands() {
|
|
107
|
+
return {
|
|
108
|
+
exportToPdf: () => ({ editor: e }) => a(e, this.options)
|
|
109
|
+
};
|
|
103
110
|
}
|
|
104
111
|
});
|
|
105
112
|
export {
|
|
106
|
-
|
|
113
|
+
x as ExportPdf
|
|
107
114
|
};
|
package/lib/ExportWord.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-ByRfqzMr.cjs"),s=require("docx"),t=require("prosemirror-docx"),i=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-ByRfqzMr.cjs"),s=require("docx"),t=require("prosemirror-docx"),i=require("./RichTextEditor-DoMu_nCj.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;
|
package/lib/ExportWord.d.cts
CHANGED
|
@@ -106,6 +106,16 @@ declare module '@tiptap/core' {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
|
|
109
|
+
declare module '@tiptap/core' {
|
|
110
|
+
interface Commands<ReturnType> {
|
|
111
|
+
drawer: {
|
|
112
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
113
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
109
119
|
declare module '@tiptap/core' {
|
|
110
120
|
interface Commands<ReturnType> {
|
|
111
121
|
emoji: {
|
|
@@ -120,9 +130,8 @@ declare module '@tiptap/core' {
|
|
|
120
130
|
|
|
121
131
|
declare module '@tiptap/core' {
|
|
122
132
|
interface Commands<ReturnType> {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
133
|
+
excalidraw: {
|
|
134
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
126
135
|
};
|
|
127
136
|
}
|
|
128
137
|
}
|
|
@@ -130,8 +139,8 @@ declare module '@tiptap/core' {
|
|
|
130
139
|
|
|
131
140
|
declare module '@tiptap/core' {
|
|
132
141
|
interface Commands<ReturnType> {
|
|
133
|
-
|
|
134
|
-
|
|
142
|
+
exportPdf: {
|
|
143
|
+
exportToPdf: () => ReturnType;
|
|
135
144
|
};
|
|
136
145
|
}
|
|
137
146
|
}
|
|
@@ -190,19 +199,19 @@ declare module '@tiptap/core' {
|
|
|
190
199
|
|
|
191
200
|
declare module '@tiptap/core' {
|
|
192
201
|
interface Commands<ReturnType> {
|
|
193
|
-
|
|
202
|
+
imageUpload: {
|
|
194
203
|
/**
|
|
195
|
-
* Add an image
|
|
204
|
+
* Add an image
|
|
196
205
|
*/
|
|
197
|
-
|
|
206
|
+
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
198
207
|
/**
|
|
199
|
-
* Update an image
|
|
208
|
+
* Update an image
|
|
200
209
|
*/
|
|
201
|
-
|
|
210
|
+
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
202
211
|
/**
|
|
203
212
|
* Set image alignment
|
|
204
213
|
*/
|
|
205
|
-
|
|
214
|
+
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
206
215
|
};
|
|
207
216
|
}
|
|
208
217
|
}
|
|
@@ -210,19 +219,19 @@ declare module '@tiptap/core' {
|
|
|
210
219
|
|
|
211
220
|
declare module '@tiptap/core' {
|
|
212
221
|
interface Commands<ReturnType> {
|
|
213
|
-
|
|
222
|
+
imageGifUpload: {
|
|
214
223
|
/**
|
|
215
|
-
* Add an image
|
|
224
|
+
* Add an image gif
|
|
216
225
|
*/
|
|
217
|
-
|
|
226
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
218
227
|
/**
|
|
219
|
-
* Update an image
|
|
228
|
+
* Update an image gif
|
|
220
229
|
*/
|
|
221
|
-
|
|
230
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
222
231
|
/**
|
|
223
232
|
* Set image alignment
|
|
224
233
|
*/
|
|
225
|
-
|
|
234
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
226
235
|
};
|
|
227
236
|
}
|
|
228
237
|
}
|