reactjs-tiptap-editor 0.3.24 → 0.3.26

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-BqO6QTnX.cjs → ActionMenuButton-C9tPWcDX.cjs} +1 -1
  2. package/lib/{ActionMenuButton-BW1lNB_I.js → ActionMenuButton-DpFt8DwI.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +39 -30
  5. package/lib/Attachment.d.ts +39 -30
  6. package/lib/Attachment.js +1 -1
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +39 -30
  9. package/lib/Blockquote.d.ts +39 -30
  10. package/lib/Blockquote.js +1 -1
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +39 -30
  13. package/lib/Bold.d.ts +39 -30
  14. package/lib/Bold.js +1 -1
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +39 -30
  17. package/lib/BulletList.d.ts +39 -30
  18. package/lib/BulletList.js +1 -1
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +39 -30
  21. package/lib/Clear.d.ts +39 -30
  22. package/lib/Clear.js +1 -1
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +39 -30
  25. package/lib/Code.d.ts +39 -30
  26. package/lib/Code.js +1 -1
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +39 -30
  29. package/lib/CodeBlock.d.ts +39 -30
  30. package/lib/CodeBlock.js +1 -1
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +39 -30
  33. package/lib/CodeView.d.ts +39 -30
  34. package/lib/CodeView.js +1 -1
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +39 -30
  37. package/lib/Color.d.ts +39 -30
  38. package/lib/Color.js +1 -1
  39. package/lib/Document.d.cts +39 -30
  40. package/lib/Document.d.ts +39 -30
  41. package/lib/{Drawer-B1rmIQfS.cjs → Drawer-BQLKKEOB.cjs} +1 -1
  42. package/lib/{Drawer-DEqRsjHw.js → Drawer-BouNhUKq.js} +1 -1
  43. package/lib/Drawer.cjs +1 -1
  44. package/lib/Drawer.d.cts +39 -30
  45. package/lib/Drawer.d.ts +39 -30
  46. package/lib/Drawer.js +2 -2
  47. package/lib/Emoji.cjs +1 -1
  48. package/lib/Emoji.d.cts +39 -30
  49. package/lib/Emoji.d.ts +39 -30
  50. package/lib/Emoji.js +1 -1
  51. package/lib/{Excalidraw-Qr5vHe9J.cjs → Excalidraw-DYbRbH0x.cjs} +1 -1
  52. package/lib/{Excalidraw-D2y-x-OZ.js → Excalidraw-u2P8Olgi.js} +1 -1
  53. package/lib/Excalidraw.cjs +1 -1
  54. package/lib/Excalidraw.d.cts +39 -30
  55. package/lib/Excalidraw.d.ts +39 -30
  56. package/lib/Excalidraw.js +1 -1
  57. package/lib/ExportPdf.cjs +4 -4
  58. package/lib/ExportPdf.d.cts +40 -30
  59. package/lib/ExportPdf.d.ts +40 -30
  60. package/lib/ExportPdf.js +34 -27
  61. package/lib/ExportWord.cjs +1 -1
  62. package/lib/ExportWord.d.cts +39 -30
  63. package/lib/ExportWord.d.ts +39 -30
  64. package/lib/ExportWord.js +1 -1
  65. package/lib/FontFamily.cjs +1 -1
  66. package/lib/FontFamily.d.cts +39 -30
  67. package/lib/FontFamily.d.ts +39 -30
  68. package/lib/FontFamily.js +2 -2
  69. package/lib/FontSize.cjs +1 -1
  70. package/lib/FontSize.d.cts +39 -30
  71. package/lib/FontSize.d.ts +39 -30
  72. package/lib/FontSize.js +2 -2
  73. package/lib/FormatPainter.cjs +1 -1
  74. package/lib/FormatPainter.d.cts +39 -30
  75. package/lib/FormatPainter.d.ts +39 -30
  76. package/lib/FormatPainter.js +1 -1
  77. package/lib/Heading.cjs +1 -1
  78. package/lib/Heading.d.cts +39 -30
  79. package/lib/Heading.d.ts +39 -30
  80. package/lib/Heading.js +2 -2
  81. package/lib/Highlight.cjs +1 -1
  82. package/lib/Highlight.d.cts +39 -30
  83. package/lib/Highlight.d.ts +39 -30
  84. package/lib/Highlight.js +1 -1
  85. package/lib/History.cjs +1 -1
  86. package/lib/History.d.cts +39 -30
  87. package/lib/History.d.ts +39 -30
  88. package/lib/History.js +1 -1
  89. package/lib/HorizontalRule.cjs +1 -1
  90. package/lib/HorizontalRule.d.cts +39 -30
  91. package/lib/HorizontalRule.d.ts +39 -30
  92. package/lib/HorizontalRule.js +1 -1
  93. package/lib/Iframe.cjs +1 -1
  94. package/lib/Iframe.d.cts +39 -30
  95. package/lib/Iframe.d.ts +39 -30
  96. package/lib/Iframe.js +1 -1
  97. package/lib/Image.cjs +1 -1
  98. package/lib/Image.d.cts +39 -30
  99. package/lib/Image.d.ts +39 -30
  100. package/lib/Image.js +1 -1
  101. package/lib/ImageGif.cjs +1 -1
  102. package/lib/ImageGif.d.cts +39 -30
  103. package/lib/ImageGif.d.ts +39 -30
  104. package/lib/ImageGif.js +1 -1
  105. package/lib/ImportWord.cjs +1 -1
  106. package/lib/ImportWord.d.cts +39 -30
  107. package/lib/ImportWord.d.ts +39 -30
  108. package/lib/ImportWord.js +1 -1
  109. package/lib/Indent.cjs +1 -1
  110. package/lib/Indent.d.cts +39 -30
  111. package/lib/Indent.d.ts +39 -30
  112. package/lib/Indent.js +1 -1
  113. package/lib/Italic.cjs +1 -1
  114. package/lib/Italic.d.cts +39 -30
  115. package/lib/Italic.d.ts +39 -30
  116. package/lib/Italic.js +1 -1
  117. package/lib/Katex.cjs +1 -1
  118. package/lib/Katex.d.cts +39 -30
  119. package/lib/Katex.d.ts +39 -30
  120. package/lib/Katex.js +2 -2
  121. package/lib/LineHeight.cjs +1 -1
  122. package/lib/LineHeight.d.cts +39 -30
  123. package/lib/LineHeight.d.ts +39 -30
  124. package/lib/LineHeight.js +1 -1
  125. package/lib/Link.cjs +1 -1
  126. package/lib/Link.d.cts +39 -30
  127. package/lib/Link.d.ts +39 -30
  128. package/lib/Link.js +1 -1
  129. package/lib/ListItem.d.cts +39 -30
  130. package/lib/ListItem.d.ts +39 -30
  131. package/lib/Mention.d.cts +39 -30
  132. package/lib/Mention.d.ts +39 -30
  133. package/lib/Mermaid.cjs +1 -1
  134. package/lib/Mermaid.d.cts +39 -30
  135. package/lib/Mermaid.d.ts +39 -30
  136. package/lib/Mermaid.js +2 -2
  137. package/lib/MoreMark.cjs +1 -1
  138. package/lib/MoreMark.d.cts +39 -30
  139. package/lib/MoreMark.d.ts +39 -30
  140. package/lib/MoreMark.js +1 -1
  141. package/lib/MultiColumn.cjs +1 -1
  142. package/lib/MultiColumn.d.cts +39 -30
  143. package/lib/MultiColumn.d.ts +39 -30
  144. package/lib/MultiColumn.js +1 -1
  145. package/lib/OrderedList.cjs +1 -1
  146. package/lib/OrderedList.d.cts +39 -30
  147. package/lib/OrderedList.d.ts +39 -30
  148. package/lib/OrderedList.js +1 -1
  149. package/lib/{RichTextEditor-CSA367l8.cjs → RichTextEditor-8GrfwaB4.cjs} +1 -1
  150. package/lib/{RichTextEditor-CrDGx-K7.js → RichTextEditor-VkzSL04E.js} +148 -109
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +39 -30
  153. package/lib/SearchAndReplace.d.ts +39 -30
  154. package/lib/SearchAndReplace.js +1 -1
  155. package/lib/Selection.d.cts +39 -30
  156. package/lib/Selection.d.ts +39 -30
  157. package/lib/SlashCommand.cjs +1 -1
  158. package/lib/SlashCommand.d.cts +39 -30
  159. package/lib/SlashCommand.d.ts +39 -30
  160. package/lib/SlashCommand.js +1 -1
  161. package/lib/Strike.cjs +1 -1
  162. package/lib/Strike.d.cts +39 -30
  163. package/lib/Strike.d.ts +39 -30
  164. package/lib/Strike.js +1 -1
  165. package/lib/SubAndSuperScript.cjs +1 -1
  166. package/lib/SubAndSuperScript.d.cts +39 -30
  167. package/lib/SubAndSuperScript.d.ts +39 -30
  168. package/lib/SubAndSuperScript.js +1 -1
  169. package/lib/Table.cjs +1 -1
  170. package/lib/Table.d.cts +39 -30
  171. package/lib/Table.d.ts +39 -30
  172. package/lib/Table.js +1 -1
  173. package/lib/TableOfContent.cjs +1 -1
  174. package/lib/TableOfContent.d.cts +39 -30
  175. package/lib/TableOfContent.d.ts +39 -30
  176. package/lib/TableOfContent.js +1 -1
  177. package/lib/TaskList.cjs +1 -1
  178. package/lib/TaskList.d.cts +39 -30
  179. package/lib/TaskList.d.ts +39 -30
  180. package/lib/TaskList.js +1 -1
  181. package/lib/TextAlign.cjs +1 -1
  182. package/lib/TextAlign.d.cts +39 -30
  183. package/lib/TextAlign.d.ts +39 -30
  184. package/lib/TextAlign.js +1 -1
  185. package/lib/TextBubble.cjs +1 -1
  186. package/lib/TextBubble.d.cts +39 -30
  187. package/lib/TextBubble.d.ts +39 -30
  188. package/lib/TextBubble.js +1 -1
  189. package/lib/TextDirection.cjs +1 -1
  190. package/lib/TextDirection.d.cts +39 -30
  191. package/lib/TextDirection.d.ts +39 -30
  192. package/lib/TextDirection.js +1 -1
  193. package/lib/TextUnderline.cjs +1 -1
  194. package/lib/TextUnderline.d.cts +39 -30
  195. package/lib/TextUnderline.d.ts +39 -30
  196. package/lib/TextUnderline.js +1 -1
  197. package/lib/TrailingNode.d.cts +39 -30
  198. package/lib/TrailingNode.d.ts +39 -30
  199. package/lib/{Twitter-D-kqw1ZB.js → Twitter-DlKz1fXJ.js} +1 -1
  200. package/lib/{Twitter-BRF2Ehp3.cjs → Twitter-u_6ZejIn.cjs} +1 -1
  201. package/lib/Twitter.cjs +1 -1
  202. package/lib/Twitter.d.cts +39 -30
  203. package/lib/Twitter.d.ts +39 -30
  204. package/lib/Twitter.js +1 -1
  205. package/lib/Video.cjs +1 -1
  206. package/lib/Video.d.cts +39 -30
  207. package/lib/Video.d.ts +39 -30
  208. package/lib/Video.js +1 -1
  209. package/lib/bubble-extra.cjs +1 -1
  210. package/lib/bubble-extra.d.cts +39 -30
  211. package/lib/bubble-extra.d.ts +39 -30
  212. package/lib/bubble-extra.js +5 -5
  213. package/lib/index.cjs +1 -1
  214. package/lib/index.d.cts +39 -30
  215. package/lib/index.d.ts +39 -30
  216. package/lib/index.js +2 -2
  217. package/lib/locale-bundle.d.cts +39 -30
  218. package/lib/locale-bundle.d.ts +39 -30
  219. package/lib/{textarea-06Uv95yx.js → textarea-BA9ETXT8.js} +1 -1
  220. package/lib/{textarea-QE8jlGEs.cjs → textarea-ESw2TM_u.cjs} +1 -1
  221. package/package.json +1 -1
package/lib/Twitter.d.cts CHANGED
@@ -62,9 +62,11 @@ declare module '@tiptap/core' {
62
62
 
63
63
  declare module '@tiptap/core' {
64
64
  interface Commands<ReturnType> {
65
- drawer: {
66
- setDrawer: (options: any, replace?: any) => ReturnType;
67
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
65
+ emoji: {
66
+ setEmoji: (emoji: {
67
+ name: string;
68
+ emoji: string;
69
+ }) => ReturnType;
68
70
  };
69
71
  }
70
72
  }
@@ -81,11 +83,18 @@ declare module '@tiptap/core' {
81
83
 
82
84
  declare module '@tiptap/core' {
83
85
  interface Commands<ReturnType> {
84
- emoji: {
85
- setEmoji: (emoji: {
86
- name: string;
87
- emoji: string;
88
- }) => ReturnType;
86
+ drawer: {
87
+ setDrawer: (options: any, replace?: any) => ReturnType;
88
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
89
+ };
90
+ }
91
+ }
92
+
93
+
94
+ declare module '@tiptap/core' {
95
+ interface Commands<ReturnType> {
96
+ exportPdf: {
97
+ exportToPdf: () => ReturnType;
89
98
  };
90
99
  }
91
100
  }
@@ -182,15 +191,6 @@ declare module '@tiptap/core' {
182
191
  }
183
192
 
184
193
 
185
- declare module '@tiptap/core' {
186
- interface Commands<ReturnType> {
187
- katex: {
188
- setKatex: (arg?: IKatexAttrs) => ReturnType;
189
- };
190
- }
191
- }
192
-
193
-
194
194
  declare module '@tiptap/core' {
195
195
  interface Commands<ReturnType> {
196
196
  indent: {
@@ -207,6 +207,15 @@ declare module '@tiptap/core' {
207
207
  }
208
208
 
209
209
 
210
+ declare module '@tiptap/core' {
211
+ interface Commands<ReturnType> {
212
+ katex: {
213
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
214
+ };
215
+ }
216
+ }
217
+
218
+
210
219
  declare module '@tiptap/core' {
211
220
  interface Commands<ReturnType> {
212
221
  lineHeight: {
@@ -268,14 +277,15 @@ declare module '@tiptap/core' {
268
277
 
269
278
  declare module '@tiptap/core' {
270
279
  interface Commands<ReturnType> {
271
- twitter: {
280
+ video: {
272
281
  /**
273
- * Insert a tweet
274
- * @param options The tweet attributes
275
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
282
+ * Add an video
276
283
  */
277
- setTweet: (options: SetTweetOptions) => ReturnType;
278
- updateTweet: (options: SetTweetOptions) => ReturnType;
284
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
285
+ /**
286
+ * Update an video
287
+ */
288
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
279
289
  };
280
290
  }
281
291
  }
@@ -283,15 +293,14 @@ declare module '@tiptap/core' {
283
293
 
284
294
  declare module '@tiptap/core' {
285
295
  interface Commands<ReturnType> {
286
- video: {
287
- /**
288
- * Add an video
289
- */
290
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
296
+ twitter: {
291
297
  /**
292
- * Update an video
298
+ * Insert a tweet
299
+ * @param options The tweet attributes
300
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
293
301
  */
294
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
302
+ setTweet: (options: SetTweetOptions) => ReturnType;
303
+ updateTweet: (options: SetTweetOptions) => ReturnType;
295
304
  };
296
305
  }
297
306
  }
package/lib/Twitter.d.ts CHANGED
@@ -62,9 +62,11 @@ declare module '@tiptap/core' {
62
62
 
63
63
  declare module '@tiptap/core' {
64
64
  interface Commands<ReturnType> {
65
- drawer: {
66
- setDrawer: (options: any, replace?: any) => ReturnType;
67
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
65
+ emoji: {
66
+ setEmoji: (emoji: {
67
+ name: string;
68
+ emoji: string;
69
+ }) => ReturnType;
68
70
  };
69
71
  }
70
72
  }
@@ -81,11 +83,18 @@ declare module '@tiptap/core' {
81
83
 
82
84
  declare module '@tiptap/core' {
83
85
  interface Commands<ReturnType> {
84
- emoji: {
85
- setEmoji: (emoji: {
86
- name: string;
87
- emoji: string;
88
- }) => ReturnType;
86
+ drawer: {
87
+ setDrawer: (options: any, replace?: any) => ReturnType;
88
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
89
+ };
90
+ }
91
+ }
92
+
93
+
94
+ declare module '@tiptap/core' {
95
+ interface Commands<ReturnType> {
96
+ exportPdf: {
97
+ exportToPdf: () => ReturnType;
89
98
  };
90
99
  }
91
100
  }
@@ -182,15 +191,6 @@ declare module '@tiptap/core' {
182
191
  }
183
192
 
184
193
 
185
- declare module '@tiptap/core' {
186
- interface Commands<ReturnType> {
187
- katex: {
188
- setKatex: (arg?: IKatexAttrs) => ReturnType;
189
- };
190
- }
191
- }
192
-
193
-
194
194
  declare module '@tiptap/core' {
195
195
  interface Commands<ReturnType> {
196
196
  indent: {
@@ -207,6 +207,15 @@ declare module '@tiptap/core' {
207
207
  }
208
208
 
209
209
 
210
+ declare module '@tiptap/core' {
211
+ interface Commands<ReturnType> {
212
+ katex: {
213
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
214
+ };
215
+ }
216
+ }
217
+
218
+
210
219
  declare module '@tiptap/core' {
211
220
  interface Commands<ReturnType> {
212
221
  lineHeight: {
@@ -268,14 +277,15 @@ declare module '@tiptap/core' {
268
277
 
269
278
  declare module '@tiptap/core' {
270
279
  interface Commands<ReturnType> {
271
- twitter: {
280
+ video: {
272
281
  /**
273
- * Insert a tweet
274
- * @param options The tweet attributes
275
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
282
+ * Add an video
276
283
  */
277
- setTweet: (options: SetTweetOptions) => ReturnType;
278
- updateTweet: (options: SetTweetOptions) => ReturnType;
284
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
285
+ /**
286
+ * Update an video
287
+ */
288
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
279
289
  };
280
290
  }
281
291
  }
@@ -283,15 +293,14 @@ declare module '@tiptap/core' {
283
293
 
284
294
  declare module '@tiptap/core' {
285
295
  interface Commands<ReturnType> {
286
- video: {
287
- /**
288
- * Add an video
289
- */
290
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
296
+ twitter: {
291
297
  /**
292
- * Update an video
298
+ * Insert a tweet
299
+ * @param options The tweet attributes
300
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
293
301
  */
294
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
302
+ setTweet: (options: SetTweetOptions) => ReturnType;
303
+ updateTweet: (options: SetTweetOptions) => ReturnType;
295
304
  };
296
305
  }
297
306
  }
package/lib/Twitter.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./index-DI9T3iLd.js";
2
2
  import "./dom-dataset-Di3tIRrR.js";
3
- import { T as m } from "./Twitter-D-kqw1ZB.js";
3
+ import { T as m } from "./Twitter-DlKz1fXJ.js";
4
4
  export {
5
5
  m as Twitter
6
6
  };
package/lib/Video.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-ByRfqzMr.cjs");require("./index-D_A0TBRA.cjs");const e=require("./RichTextEditor-CSA367l8.cjs");exports.Video=e.Video;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-ByRfqzMr.cjs");require("./index-D_A0TBRA.cjs");const e=require("./RichTextEditor-8GrfwaB4.cjs");exports.Video=e.Video;
package/lib/Video.d.cts CHANGED
@@ -145,9 +145,11 @@ declare module '@tiptap/core' {
145
145
 
146
146
  declare module '@tiptap/core' {
147
147
  interface Commands<ReturnType> {
148
- drawer: {
149
- setDrawer: (options: any, replace?: any) => ReturnType;
150
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
148
+ emoji: {
149
+ setEmoji: (emoji: {
150
+ name: string;
151
+ emoji: string;
152
+ }) => ReturnType;
151
153
  };
152
154
  }
153
155
  }
@@ -164,11 +166,18 @@ declare module '@tiptap/core' {
164
166
 
165
167
  declare module '@tiptap/core' {
166
168
  interface Commands<ReturnType> {
167
- emoji: {
168
- setEmoji: (emoji: {
169
- name: string;
170
- emoji: string;
171
- }) => ReturnType;
169
+ drawer: {
170
+ setDrawer: (options: any, replace?: any) => ReturnType;
171
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
172
+ };
173
+ }
174
+ }
175
+
176
+
177
+ declare module '@tiptap/core' {
178
+ interface Commands<ReturnType> {
179
+ exportPdf: {
180
+ exportToPdf: () => ReturnType;
172
181
  };
173
182
  }
174
183
  }
@@ -265,15 +274,6 @@ declare module '@tiptap/core' {
265
274
  }
266
275
 
267
276
 
268
- declare module '@tiptap/core' {
269
- interface Commands<ReturnType> {
270
- katex: {
271
- setKatex: (arg?: IKatexAttrs) => ReturnType;
272
- };
273
- }
274
- }
275
-
276
-
277
277
  declare module '@tiptap/core' {
278
278
  interface Commands<ReturnType> {
279
279
  indent: {
@@ -290,6 +290,15 @@ declare module '@tiptap/core' {
290
290
  }
291
291
 
292
292
 
293
+ declare module '@tiptap/core' {
294
+ interface Commands<ReturnType> {
295
+ katex: {
296
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
297
+ };
298
+ }
299
+ }
300
+
301
+
293
302
  declare module '@tiptap/core' {
294
303
  interface Commands<ReturnType> {
295
304
  lineHeight: {
@@ -351,14 +360,15 @@ declare module '@tiptap/core' {
351
360
 
352
361
  declare module '@tiptap/core' {
353
362
  interface Commands<ReturnType> {
354
- twitter: {
363
+ video: {
355
364
  /**
356
- * Insert a tweet
357
- * @param options The tweet attributes
358
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
365
+ * Add an video
359
366
  */
360
- setTweet: (options: SetTweetOptions) => ReturnType;
361
- updateTweet: (options: SetTweetOptions) => ReturnType;
367
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
368
+ /**
369
+ * Update an video
370
+ */
371
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
362
372
  };
363
373
  }
364
374
  }
@@ -366,15 +376,14 @@ declare module '@tiptap/core' {
366
376
 
367
377
  declare module '@tiptap/core' {
368
378
  interface Commands<ReturnType> {
369
- video: {
370
- /**
371
- * Add an video
372
- */
373
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
379
+ twitter: {
374
380
  /**
375
- * Update an video
381
+ * Insert a tweet
382
+ * @param options The tweet attributes
383
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
376
384
  */
377
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
385
+ setTweet: (options: SetTweetOptions) => ReturnType;
386
+ updateTweet: (options: SetTweetOptions) => ReturnType;
378
387
  };
379
388
  }
380
389
  }
package/lib/Video.d.ts CHANGED
@@ -145,9 +145,11 @@ declare module '@tiptap/core' {
145
145
 
146
146
  declare module '@tiptap/core' {
147
147
  interface Commands<ReturnType> {
148
- drawer: {
149
- setDrawer: (options: any, replace?: any) => ReturnType;
150
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
148
+ emoji: {
149
+ setEmoji: (emoji: {
150
+ name: string;
151
+ emoji: string;
152
+ }) => ReturnType;
151
153
  };
152
154
  }
153
155
  }
@@ -164,11 +166,18 @@ declare module '@tiptap/core' {
164
166
 
165
167
  declare module '@tiptap/core' {
166
168
  interface Commands<ReturnType> {
167
- emoji: {
168
- setEmoji: (emoji: {
169
- name: string;
170
- emoji: string;
171
- }) => ReturnType;
169
+ drawer: {
170
+ setDrawer: (options: any, replace?: any) => ReturnType;
171
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
172
+ };
173
+ }
174
+ }
175
+
176
+
177
+ declare module '@tiptap/core' {
178
+ interface Commands<ReturnType> {
179
+ exportPdf: {
180
+ exportToPdf: () => ReturnType;
172
181
  };
173
182
  }
174
183
  }
@@ -265,15 +274,6 @@ declare module '@tiptap/core' {
265
274
  }
266
275
 
267
276
 
268
- declare module '@tiptap/core' {
269
- interface Commands<ReturnType> {
270
- katex: {
271
- setKatex: (arg?: IKatexAttrs) => ReturnType;
272
- };
273
- }
274
- }
275
-
276
-
277
277
  declare module '@tiptap/core' {
278
278
  interface Commands<ReturnType> {
279
279
  indent: {
@@ -290,6 +290,15 @@ declare module '@tiptap/core' {
290
290
  }
291
291
 
292
292
 
293
+ declare module '@tiptap/core' {
294
+ interface Commands<ReturnType> {
295
+ katex: {
296
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
297
+ };
298
+ }
299
+ }
300
+
301
+
293
302
  declare module '@tiptap/core' {
294
303
  interface Commands<ReturnType> {
295
304
  lineHeight: {
@@ -351,14 +360,15 @@ declare module '@tiptap/core' {
351
360
 
352
361
  declare module '@tiptap/core' {
353
362
  interface Commands<ReturnType> {
354
- twitter: {
363
+ video: {
355
364
  /**
356
- * Insert a tweet
357
- * @param options The tweet attributes
358
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
365
+ * Add an video
359
366
  */
360
- setTweet: (options: SetTweetOptions) => ReturnType;
361
- updateTweet: (options: SetTweetOptions) => ReturnType;
367
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
368
+ /**
369
+ * Update an video
370
+ */
371
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
362
372
  };
363
373
  }
364
374
  }
@@ -366,15 +376,14 @@ declare module '@tiptap/core' {
366
376
 
367
377
  declare module '@tiptap/core' {
368
378
  interface Commands<ReturnType> {
369
- video: {
370
- /**
371
- * Add an video
372
- */
373
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
379
+ twitter: {
374
380
  /**
375
- * Update an video
381
+ * Insert a tweet
382
+ * @param options The tweet attributes
383
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
376
384
  */
377
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
385
+ setTweet: (options: SetTweetOptions) => ReturnType;
386
+ updateTweet: (options: SetTweetOptions) => ReturnType;
378
387
  };
379
388
  }
380
389
  }
package/lib/Video.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./index-DI9T3iLd.js";
2
2
  import "./index-CsK90iVd.js";
3
- import { V as p } from "./RichTextEditor-CrDGx-K7.js";
3
+ import { V as p } from "./RichTextEditor-VkzSL04E.js";
4
4
  export {
5
5
  p as Video
6
6
  };
@@ -1,2 +1,2 @@
1
- "use strict";var V=Object.create;var q=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of G(n))!J.call(e,i)&&i!==s&&q(e,i,{get:()=>n[i],enumerable:!(c=_(n,i))||c.enumerable});return e};var X=(e,n,s)=>(s=e!=null?V(Z(e)):{},Q(n||!e||!e.__esModule?q(s,"default",{value:e,enumerable:!0}):s,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),k=require("./dom-dataset-Byuf1YmW.cjs"),o=require("./RichTextEditor-CSA367l8.cjs"),L=require("./Mermaid.cjs"),E=require("./shortId-Bfj8TyNr.cjs"),H=require("./textarea-QE8jlGEs.cjs"),D=require("./index-D_A0TBRA.cjs"),M=require("./Excalidraw-Qr5vHe9J.cjs"),W=require("./Twitter-BRF2Ehp3.cjs"),Y=require("katex"),F=require("lucide-react"),B=require("./Katex.cjs"),O=require("./Drawer-B1rmIQfS.cjs"),R=require("easydrawer"),$=`graph TB
1
+ "use strict";var V=Object.create;var q=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of G(n))!J.call(e,i)&&i!==s&&q(e,i,{get:()=>n[i],enumerable:!(c=_(n,i))||c.enumerable});return e};var X=(e,n,s)=>(s=e!=null?V(Z(e)):{},Q(n||!e||!e.__esModule?q(s,"default",{value:e,enumerable:!0}):s,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),k=require("./dom-dataset-Byuf1YmW.cjs"),o=require("./RichTextEditor-8GrfwaB4.cjs"),L=require("./Mermaid.cjs"),E=require("./shortId-Bfj8TyNr.cjs"),H=require("./textarea-ESw2TM_u.cjs"),D=require("./index-D_A0TBRA.cjs"),M=require("./Excalidraw-DYbRbH0x.cjs"),W=require("./Twitter-u_6ZejIn.cjs"),Y=require("katex"),F=require("lucide-react"),B=require("./Katex.cjs"),O=require("./Drawer-BQLKKEOB.cjs"),R=require("easydrawer"),$=`graph TB
2
2
  a-->b`,ee=({editor:e,attrs:n,extension:s})=>{const{alt:c,align:i}=n,[r,l]=a.useState(decodeURIComponent(c??$)),[u,x]=a.useState(""),[f,b]=a.useState(!1),p=a.useRef(null),[g,y]=a.useState(null),S=s==null?void 0:s.options.upload,I=a.useCallback(w=>{w&&import("mermaid").then(j=>{y(j.default)})},[]),T=async w=>{try{const{svg:j}=await g.render("mermaid-svg",w);x(j)}catch{x("")}},N=()=>{g.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),T(r)};a.useEffect(()=>{g&&f&&N()},[g,f]),a.useEffect(()=>{g&&f&&T(r)},[g,r]);const A=async()=>{if(r!==""){if(r){const w=p.current.querySelector("svg"),{width:j,height:z}=w.getBoundingClientRect(),m=`mermaid-${E.shortId()}.svg`;let d=E.i(w.outerHTML);if(S){const h=o.dataURLtoFile(d,m);d=await S(h)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:d,alt:encodeURIComponent(r),width:j,height:z},!!r).run(),e==null||e.commands.setAlignImageMermaid(i)}b(!1)}};return t.jsxs(o.Dialog,{onOpenChange:b,open:f,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>b(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Mermaid"}),t.jsx("div",{ref:I,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(H.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:w=>l(w.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:u},ref:p,style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"}})]})}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:A,type:"button",children:"Save changes"})})]})]})};function K(e,n){const[s,c]=a.useState(void 0);return a.useEffect(()=>{const i=()=>{const r=e.extensionManager.extensions.find(l=>l.name===n);r&&c(r)};return e.on("selectionUpdate",i),e.on("transaction",i),()=>{e.off("selectionUpdate",i),e.off("transaction",i)}},[e,n]),s}const te={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function re({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function ne(e){return e.type.name==="mermaid"}function ie(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,L.Mermaid.name),c=K(e.editor,L.Mermaid.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(ne(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleMermaid(e.editor),[e.disabled,e.editor,n]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:te,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(ee,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-mermaid-${u}`):t.jsx(re,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-mermaid-${u}`))})}):t.jsx(t.Fragment,{})})})}const v=new Map;function se(e){const n=e.options.element;v.has("width")||v.set("width",n.clientWidth),v.has("width")&&v.get("width")<=0&&v.set("width",n.clientWidth);const s={attributes:!0,childList:!0,subtree:!0},c=function(){v.set("width",n.clientWidth)},i=new MutationObserver(c);return i.observe(n,s),e.on("destroy",()=>{i.disconnect()}),{width:v.get("width")}}function oe({editor:e}){const{t:n}=D.useLocale(),{width:s}=se(e),c=o.useAttributes(e,M.Excalidraw.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:i,createUser:r,width:l,height:u}=c,x=a.useCallback(g=>{e.chain().updateAttributes(M.Excalidraw.name,g).setNodeSelection(e.state.selection.from).focus().run()},[e]),f=a.useCallback(()=>{M.triggerOpenExcalidrawSettingModal({...c,editor:e})},[e,c]),b=a.useCallback(()=>e.isActive(M.Excalidraw.name),[e]),p=a.useCallback(()=>o.deleteNode(M.Excalidraw.name,e),[e]);return a.useEffect(()=>{i&&(f(),e.chain().updateAttributes(M.Excalidraw.name,{defaultShowPicker:!1}).focus().run())},[r,i,e,f]),t.jsx(k.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:b,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:t.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[t.jsx(o.ActionButton,{icon:"Pencil",action:f,tooltip:n("editor.edit")}),t.jsx(o.SizeSetter,{width:l,maxWidth:s,height:u,onOk:x,children:t.jsx(o.ActionButton,{icon:"Settings",tooltip:n("editor.settings")})}),t.jsx(o.ActionButton,{icon:"Trash2",action:p,tooltip:n("editor.delete")})]})})}function ae({editor:e,disabled:n}){const[s,c]=a.useState(!1),{t:i}=D.useLocale(),r=a.useCallback(({editor:x})=>x.isActive(W.Twitter.name),[]),l=x=>{e.commands.updateTweet({src:x}),c(!1)},u=a.useCallback(()=>o.deleteNode(W.Twitter.name,e),[e]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e,shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{c(!1)}},children:n?t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{children:s?t.jsx(W.FormEditLinkTwitter,{editor:e,onSetLink:l}):t.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:t.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[t.jsx(o.ActionButton,{icon:"Pencil",tooltip:i("editor.link.edit.tooltip"),tooltipOptions:{sideOffset:15},action:()=>{c(!0)}}),t.jsx(o.ActionButton,{action:u,icon:"Trash",tooltip:i("editor.delete"),tooltipOptions:{sideOffset:15}})]})})})})})}function ce({editor:e,...n}){const s=o.useAttributes(e,B.Katex.name,{text:"",defaultShowPicker:!1}),{text:c,defaultShowPicker:i}=s,[r,l]=a.useState(""),[u,x]=a.useState(!1),f=a.useCallback(()=>e.isActive(B.Katex.name),[e]),b=a.useCallback(()=>o.deleteNode(B.Katex.name,e),[e]),p=a.useCallback(()=>{e.chain().focus().setKatex({text:r}).run(),x(!1)},[e,r]);a.useEffect(()=>{i&&(x(!0),e.chain().updateAttributes(B.Katex.name,{defaultShowPicker:!1}).focus().run())},[e,i,x]),a.useEffect(()=>{u&&l(c||"")},[u]);const g=a.useMemo(()=>{try{return Y.renderToString(`${r}`)}catch{return r}},[r]),y=a.useMemo(()=>`${r}`.trim()?t.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:g||""}}):null,[r,g]);return t.jsx(k.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:f,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{x(!1)}},children:n!=null&&n.disabled?t.jsx(t.Fragment,{}):t.jsx("div",{className:"richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:u?t.jsxs(t.Fragment,{children:[t.jsx(H.Textarea,{autoFocus:!0,defaultValue:c,onChange:S=>l(S.target.value),placeholder:"Formula text",rows:3,style:{marginBottom:8},value:r}),y&&t.jsx("div",{className:"richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:y}),t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[t.jsx(o.Button,{className:"richtext-flex-1",onClick:p,children:"Submit"}),t.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:t.jsx(F.HelpCircle,{size:16})})]})]}):t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[t.jsx(o.ActionButton,{action:()=>x(!u),tooltip:"Edit",children:t.jsx(F.Pencil,{size:16})}),t.jsx(o.ActionButton,{action:b,tooltip:"Delete",children:t.jsx(F.Trash2,{size:16})})]})})})}let C=!1;function le({editor:e,attrs:n,extension:s}){const[c,i]=a.useState(!1),r=a.useRef(null),l=a.useRef(null),{alt:u,align:x}=n,f=s==null?void 0:s.options.upload,b=()=>{(async()=>{const d=document.querySelector("#easydrawer");d&&(r.current=new R.Editor(d,{wheelEventsEnabled:!1,disableZoom:!0}),l.current=R.makeDropdownToolbar(r.current),l.current.addDefaultToolWidgets(),r.current.loadFromSVG(decodeURIComponent(u)))})()};a.useEffect(()=>{c&&setTimeout(()=>{b()},200)},[c]);const p=async()=>{if(r.current){const m=r.current.toSVG(),d=m.outerHTML,h=`drawer-${E.shortId()}.svg`;let P=E.i(m.outerHTML);if(f){const U=o.dataURLtoFile(P,h);P=await f(U)}e==null||e.chain().focus().setDrawer({type:"drawer",src:P,alt:encodeURIComponent(d),width:426,height:212},!!d).run(),e==null||e.commands.setAlignImageDrawer(x)}i(!1)},g=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setColor(m),h.serializeState())},y=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setThickness(m),h.serializeState())},S=m=>{const d=r.current.toolController.getPrimaryTools()[3],h=l.current.getWidgetById("pen-2");d&&h&&(d.setColor(m),h.serializeState())},I=m=>{const d=l.current.getWidgetById("shape");d&&d.setShapeType(m)},T=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setColor(m),h.serializeState())},N=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setThickness(m),h.serializeState())},A=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setBorderColor(m),h.serializeState())},w=()=>{if(C){for(;r.current.history.redoStackSize>0;)r.current.history.redo();C=!1;return}r.current.history.undo()},j=()=>{C||r.current.history.redo()},z=()=>{if(!C){for(;r.current.history.undoStackSize>0;)w();C=!0}};return t.jsxs(o.Dialog,{onOpenChange:i,open:c,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>i(!0),icon:"Pencil",tooltip:"Edit Drawer"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Drawer"}),t.jsxs("div",{style:{height:"100%",borderWidth:1,background:"white",position:"relative"},children:[t.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),t.jsx(O.ControlDrawer,{changeBorderColorShape:A,changeColorShape:T,changeShape:I,onClear:z,onRedo:j,onThicknessChange:N,onUndo:w,refEditor:r,setColorHighlight:S,setColorPen:g,setThicknessPen:y})]}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:p,type:"button",children:"Save changes"})})]})]})}const de={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function ue({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function he(e){return e.type.name==="drawer"}function xe(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,O.Drawer.name),c=K(e.editor,O.Drawer.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(he(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleDrawer(e.editor),[e.disabled,e.editor,n]);return t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:de,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(le,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-drawer-${u}`):t.jsx(ue,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-drawer-${u}`))})}):t.jsx(t.Fragment,{})})}exports.BubbleMenuDrawer=xe;exports.BubbleMenuExcalidraw=oe;exports.BubbleMenuKatex=ce;exports.BubbleMenuMermaid=ie;exports.BubbleMenuTwitter=ae;
@@ -61,9 +61,11 @@ declare module '@tiptap/core' {
61
61
 
62
62
  declare module '@tiptap/core' {
63
63
  interface Commands<ReturnType> {
64
- drawer: {
65
- setDrawer: (options: any, replace?: any) => ReturnType;
66
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
64
+ emoji: {
65
+ setEmoji: (emoji: {
66
+ name: string;
67
+ emoji: string;
68
+ }) => ReturnType;
67
69
  };
68
70
  }
69
71
  }
@@ -80,11 +82,18 @@ declare module '@tiptap/core' {
80
82
 
81
83
  declare module '@tiptap/core' {
82
84
  interface Commands<ReturnType> {
83
- emoji: {
84
- setEmoji: (emoji: {
85
- name: string;
86
- emoji: string;
87
- }) => ReturnType;
85
+ drawer: {
86
+ setDrawer: (options: any, replace?: any) => ReturnType;
87
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
88
+ };
89
+ }
90
+ }
91
+
92
+
93
+ declare module '@tiptap/core' {
94
+ interface Commands<ReturnType> {
95
+ exportPdf: {
96
+ exportToPdf: () => ReturnType;
88
97
  };
89
98
  }
90
99
  }
@@ -181,15 +190,6 @@ declare module '@tiptap/core' {
181
190
  }
182
191
 
183
192
 
184
- declare module '@tiptap/core' {
185
- interface Commands<ReturnType> {
186
- katex: {
187
- setKatex: (arg?: IKatexAttrs) => ReturnType;
188
- };
189
- }
190
- }
191
-
192
-
193
193
  declare module '@tiptap/core' {
194
194
  interface Commands<ReturnType> {
195
195
  indent: {
@@ -206,6 +206,15 @@ declare module '@tiptap/core' {
206
206
  }
207
207
 
208
208
 
209
+ declare module '@tiptap/core' {
210
+ interface Commands<ReturnType> {
211
+ katex: {
212
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
213
+ };
214
+ }
215
+ }
216
+
217
+
209
218
  declare module '@tiptap/core' {
210
219
  interface Commands<ReturnType> {
211
220
  lineHeight: {
@@ -267,14 +276,15 @@ declare module '@tiptap/core' {
267
276
 
268
277
  declare module '@tiptap/core' {
269
278
  interface Commands<ReturnType> {
270
- twitter: {
279
+ video: {
271
280
  /**
272
- * Insert a tweet
273
- * @param options The tweet attributes
274
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
281
+ * Add an video
275
282
  */
276
- setTweet: (options: SetTweetOptions) => ReturnType;
277
- updateTweet: (options: SetTweetOptions) => ReturnType;
283
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
284
+ /**
285
+ * Update an video
286
+ */
287
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
278
288
  };
279
289
  }
280
290
  }
@@ -282,15 +292,14 @@ declare module '@tiptap/core' {
282
292
 
283
293
  declare module '@tiptap/core' {
284
294
  interface Commands<ReturnType> {
285
- video: {
286
- /**
287
- * Add an video
288
- */
289
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
295
+ twitter: {
290
296
  /**
291
- * Update an video
297
+ * Insert a tweet
298
+ * @param options The tweet attributes
299
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
292
300
  */
293
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
301
+ setTweet: (options: SetTweetOptions) => ReturnType;
302
+ updateTweet: (options: SetTweetOptions) => ReturnType;
294
303
  };
295
304
  }
296
305
  }