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