reactjs-tiptap-editor 0.3.26 → 0.3.28

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 (222) hide show
  1. package/lib/{ActionMenuButton-C9tPWcDX.cjs → ActionMenuButton-C20molC9.cjs} +1 -1
  2. package/lib/{ActionMenuButton-DpFt8DwI.js → ActionMenuButton-D0hFczCn.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +41 -39
  5. package/lib/Attachment.d.ts +41 -39
  6. package/lib/Attachment.js +1 -1
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +41 -39
  9. package/lib/Blockquote.d.ts +41 -39
  10. package/lib/Blockquote.js +10 -10
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +41 -39
  13. package/lib/Bold.d.ts +41 -39
  14. package/lib/Bold.js +10 -10
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +41 -39
  17. package/lib/BulletList.d.ts +41 -39
  18. package/lib/BulletList.js +10 -10
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +41 -39
  21. package/lib/Clear.d.ts +41 -39
  22. package/lib/Clear.js +1 -1
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +41 -39
  25. package/lib/Code.d.ts +41 -39
  26. package/lib/Code.js +21 -21
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +41 -39
  29. package/lib/CodeBlock.d.ts +41 -39
  30. package/lib/CodeBlock.js +1 -1
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +41 -39
  33. package/lib/CodeView.d.ts +41 -39
  34. package/lib/CodeView.js +1 -1
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +41 -39
  37. package/lib/Color.d.ts +41 -39
  38. package/lib/Color.js +1 -1
  39. package/lib/Document.d.cts +39 -39
  40. package/lib/Document.d.ts +39 -39
  41. package/lib/{Drawer-BQLKKEOB.cjs → Drawer-0kBt3GVL.cjs} +1 -1
  42. package/lib/{Drawer-BouNhUKq.js → Drawer-B96jQIQU.js} +1 -1
  43. package/lib/Drawer.cjs +1 -1
  44. package/lib/Drawer.d.cts +41 -39
  45. package/lib/Drawer.d.ts +41 -39
  46. package/lib/Drawer.js +2 -2
  47. package/lib/Emoji.cjs +1 -1
  48. package/lib/Emoji.d.cts +39 -39
  49. package/lib/Emoji.d.ts +39 -39
  50. package/lib/Emoji.js +1 -1
  51. package/lib/{Excalidraw-DYbRbH0x.cjs → Excalidraw-HK9kjpX5.cjs} +1 -1
  52. package/lib/{Excalidraw-u2P8Olgi.js → Excalidraw-z3VZyGJ4.js} +1 -1
  53. package/lib/Excalidraw.cjs +1 -1
  54. package/lib/Excalidraw.d.cts +39 -39
  55. package/lib/Excalidraw.d.ts +39 -39
  56. package/lib/Excalidraw.js +1 -1
  57. package/lib/ExportPdf.cjs +1 -1
  58. package/lib/ExportPdf.d.cts +41 -39
  59. package/lib/ExportPdf.d.ts +41 -39
  60. package/lib/ExportPdf.js +1 -1
  61. package/lib/ExportWord.cjs +1 -1
  62. package/lib/ExportWord.d.cts +41 -39
  63. package/lib/ExportWord.d.ts +41 -39
  64. package/lib/ExportWord.js +1 -1
  65. package/lib/FontFamily.cjs +1 -1
  66. package/lib/FontFamily.d.cts +41 -39
  67. package/lib/FontFamily.d.ts +41 -39
  68. package/lib/FontFamily.js +2 -2
  69. package/lib/FontSize.cjs +1 -1
  70. package/lib/FontSize.d.cts +41 -39
  71. package/lib/FontSize.d.ts +41 -39
  72. package/lib/FontSize.js +2 -2
  73. package/lib/FormatPainter.cjs +1 -1
  74. package/lib/FormatPainter.d.cts +41 -39
  75. package/lib/FormatPainter.d.ts +41 -39
  76. package/lib/FormatPainter.js +1 -1
  77. package/lib/Heading.cjs +1 -1
  78. package/lib/Heading.d.cts +41 -39
  79. package/lib/Heading.d.ts +41 -39
  80. package/lib/Heading.js +71 -68
  81. package/lib/Highlight.cjs +1 -1
  82. package/lib/Highlight.d.cts +45 -39
  83. package/lib/Highlight.d.ts +45 -39
  84. package/lib/Highlight.js +14 -13
  85. package/lib/History.cjs +1 -1
  86. package/lib/History.d.cts +41 -39
  87. package/lib/History.d.ts +41 -39
  88. package/lib/History.js +163 -160
  89. package/lib/HorizontalRule.cjs +1 -1
  90. package/lib/HorizontalRule.d.cts +41 -39
  91. package/lib/HorizontalRule.d.ts +41 -39
  92. package/lib/HorizontalRule.js +14 -14
  93. package/lib/Iframe.cjs +1 -1
  94. package/lib/Iframe.d.cts +39 -39
  95. package/lib/Iframe.d.ts +39 -39
  96. package/lib/Iframe.js +1 -1
  97. package/lib/Image.cjs +1 -1
  98. package/lib/Image.d.cts +41 -39
  99. package/lib/Image.d.ts +41 -39
  100. package/lib/Image.js +1 -1
  101. package/lib/ImageGif.cjs +1 -1
  102. package/lib/ImageGif.d.cts +39 -39
  103. package/lib/ImageGif.d.ts +39 -39
  104. package/lib/ImageGif.js +1 -1
  105. package/lib/ImportWord.cjs +2 -2
  106. package/lib/ImportWord.d.cts +41 -39
  107. package/lib/ImportWord.d.ts +41 -39
  108. package/lib/ImportWord.js +2 -2
  109. package/lib/Indent.cjs +1 -1
  110. package/lib/Indent.d.cts +41 -39
  111. package/lib/Indent.d.ts +41 -39
  112. package/lib/Indent.js +12 -11
  113. package/lib/Italic.cjs +1 -1
  114. package/lib/Italic.d.cts +41 -39
  115. package/lib/Italic.d.ts +41 -39
  116. package/lib/Italic.js +13 -13
  117. package/lib/Katex.cjs +1 -1
  118. package/lib/Katex.d.cts +39 -39
  119. package/lib/Katex.d.ts +39 -39
  120. package/lib/Katex.js +2 -2
  121. package/lib/LineHeight.cjs +1 -1
  122. package/lib/LineHeight.d.cts +41 -39
  123. package/lib/LineHeight.d.ts +41 -39
  124. package/lib/LineHeight.js +1 -1
  125. package/lib/Link.cjs +1 -1
  126. package/lib/Link.d.cts +41 -39
  127. package/lib/Link.d.ts +41 -39
  128. package/lib/Link.js +1 -1
  129. package/lib/ListItem.d.cts +39 -39
  130. package/lib/ListItem.d.ts +39 -39
  131. package/lib/Mention.d.cts +39 -39
  132. package/lib/Mention.d.ts +39 -39
  133. package/lib/Mermaid.cjs +1 -1
  134. package/lib/Mermaid.d.cts +41 -39
  135. package/lib/Mermaid.d.ts +41 -39
  136. package/lib/Mermaid.js +2 -2
  137. package/lib/MoreMark.cjs +1 -1
  138. package/lib/MoreMark.d.cts +41 -39
  139. package/lib/MoreMark.d.ts +41 -39
  140. package/lib/MoreMark.js +46 -45
  141. package/lib/MultiColumn.cjs +1 -1
  142. package/lib/MultiColumn.d.cts +39 -39
  143. package/lib/MultiColumn.d.ts +39 -39
  144. package/lib/MultiColumn.js +1 -1
  145. package/lib/OrderedList.cjs +1 -1
  146. package/lib/OrderedList.d.cts +41 -39
  147. package/lib/OrderedList.d.ts +41 -39
  148. package/lib/OrderedList.js +9 -9
  149. package/lib/RichTextEditor-BKywwUM4.cjs +140 -0
  150. package/lib/{RichTextEditor-VkzSL04E.js → RichTextEditor-CnWZ69eX.js} +1685 -1708
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +41 -39
  153. package/lib/SearchAndReplace.d.ts +41 -39
  154. package/lib/SearchAndReplace.js +1 -1
  155. package/lib/Selection.d.cts +39 -39
  156. package/lib/Selection.d.ts +39 -39
  157. package/lib/SlashCommand.cjs +1 -1
  158. package/lib/SlashCommand.d.cts +39 -39
  159. package/lib/SlashCommand.d.ts +39 -39
  160. package/lib/SlashCommand.js +1 -1
  161. package/lib/Strike.cjs +1 -1
  162. package/lib/Strike.d.cts +41 -39
  163. package/lib/Strike.d.ts +41 -39
  164. package/lib/Strike.js +13 -13
  165. package/lib/SubAndSuperScript.cjs +1 -1
  166. package/lib/SubAndSuperScript.d.cts +41 -39
  167. package/lib/SubAndSuperScript.d.ts +41 -39
  168. package/lib/SubAndSuperScript.js +1 -1
  169. package/lib/Table.cjs +1 -1
  170. package/lib/Table.d.cts +41 -39
  171. package/lib/Table.d.ts +41 -39
  172. package/lib/Table.js +1 -1
  173. package/lib/TableOfContent.cjs +1 -1
  174. package/lib/TableOfContent.d.cts +39 -39
  175. package/lib/TableOfContent.d.ts +39 -39
  176. package/lib/TableOfContent.js +1 -1
  177. package/lib/TaskList.cjs +1 -1
  178. package/lib/TaskList.d.cts +41 -39
  179. package/lib/TaskList.d.ts +41 -39
  180. package/lib/TaskList.js +15 -15
  181. package/lib/TextAlign.cjs +1 -1
  182. package/lib/TextAlign.d.cts +41 -39
  183. package/lib/TextAlign.d.ts +41 -39
  184. package/lib/TextAlign.js +41 -41
  185. package/lib/TextBubble.cjs +1 -1
  186. package/lib/TextBubble.d.cts +41 -39
  187. package/lib/TextBubble.d.ts +41 -39
  188. package/lib/TextBubble.js +1 -1
  189. package/lib/TextDirection.cjs +1 -1
  190. package/lib/TextDirection.d.cts +39 -39
  191. package/lib/TextDirection.d.ts +39 -39
  192. package/lib/TextDirection.js +1 -1
  193. package/lib/TextUnderline.cjs +1 -1
  194. package/lib/TextUnderline.d.cts +41 -39
  195. package/lib/TextUnderline.d.ts +41 -39
  196. package/lib/TextUnderline.js +8 -8
  197. package/lib/TrailingNode.d.cts +39 -39
  198. package/lib/TrailingNode.d.ts +39 -39
  199. package/lib/{Twitter-DlKz1fXJ.js → Twitter-CCf1aM0f.js} +1 -1
  200. package/lib/{Twitter-u_6ZejIn.cjs → Twitter-Dj49i3B9.cjs} +1 -1
  201. package/lib/Twitter.cjs +1 -1
  202. package/lib/Twitter.d.cts +39 -39
  203. package/lib/Twitter.d.ts +39 -39
  204. package/lib/Twitter.js +1 -1
  205. package/lib/Video.cjs +1 -1
  206. package/lib/Video.d.cts +41 -39
  207. package/lib/Video.d.ts +41 -39
  208. package/lib/Video.js +1 -1
  209. package/lib/bubble-extra.cjs +1 -1
  210. package/lib/bubble-extra.d.cts +39 -39
  211. package/lib/bubble-extra.d.ts +39 -39
  212. package/lib/bubble-extra.js +5 -5
  213. package/lib/index.cjs +1 -1
  214. package/lib/index.d.cts +58 -52
  215. package/lib/index.d.ts +58 -52
  216. package/lib/index.js +2 -2
  217. package/lib/locale-bundle.d.cts +39 -39
  218. package/lib/locale-bundle.d.ts +39 -39
  219. package/lib/{textarea-ESw2TM_u.cjs → textarea-DhlS0JCr.cjs} +1 -1
  220. package/lib/{textarea-BA9ETXT8.js → textarea-nr3UZ7Wg.js} +1 -1
  221. package/package.json +1 -1
  222. package/lib/RichTextEditor-8GrfwaB4.cjs +0 -140
@@ -36,11 +36,9 @@ declare module '@tiptap/core' {
36
36
 
37
37
  declare module '@tiptap/core' {
38
38
  interface Commands<ReturnType> {
39
- emoji: {
40
- setEmoji: (emoji: {
41
- name: string;
42
- emoji: string;
43
- }) => ReturnType;
39
+ drawer: {
40
+ setDrawer: (options: any, replace?: any) => ReturnType;
41
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
44
42
  };
45
43
  }
46
44
  }
@@ -57,9 +55,11 @@ declare module '@tiptap/core' {
57
55
 
58
56
  declare module '@tiptap/core' {
59
57
  interface Commands<ReturnType> {
60
- drawer: {
61
- setDrawer: (options: any, replace?: any) => ReturnType;
62
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
58
+ emoji: {
59
+ setEmoji: (emoji: {
60
+ name: string;
61
+ emoji: string;
62
+ }) => ReturnType;
63
63
  };
64
64
  }
65
65
  }
@@ -181,15 +181,6 @@ declare module '@tiptap/core' {
181
181
  }
182
182
 
183
183
 
184
- declare module '@tiptap/core' {
185
- interface Commands<ReturnType> {
186
- katex: {
187
- setKatex: (arg?: IKatexAttrs) => ReturnType;
188
- };
189
- }
190
- }
191
-
192
-
193
184
  declare module '@tiptap/core' {
194
185
  interface Commands<ReturnType> {
195
186
  lineHeight: {
@@ -202,9 +193,8 @@ declare module '@tiptap/core' {
202
193
 
203
194
  declare module '@tiptap/core' {
204
195
  interface Commands<ReturnType> {
205
- mermaid: {
206
- setMermaid: (options: any, replace?: any) => ReturnType;
207
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
196
+ katex: {
197
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
208
198
  };
209
199
  }
210
200
  }
@@ -212,13 +202,9 @@ declare module '@tiptap/core' {
212
202
 
213
203
  declare module '@tiptap/core' {
214
204
  interface Commands<ReturnType> {
215
- columns: {
216
- insertColumns: (attrs?: {
217
- cols: number;
218
- }) => ReturnType;
219
- addColBefore: () => ReturnType;
220
- addColAfter: () => ReturnType;
221
- deleteCol: () => ReturnType;
205
+ mermaid: {
206
+ setMermaid: (options: any, replace?: any) => ReturnType;
207
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
222
208
  };
223
209
  }
224
210
  }
@@ -241,9 +227,13 @@ declare module '@tiptap/core' {
241
227
 
242
228
  declare module '@tiptap/core' {
243
229
  interface Commands<ReturnType> {
244
- tableOfContents: {
245
- setTableOfContents: () => ReturnType;
246
- removeTableOfContents: () => ReturnType;
230
+ columns: {
231
+ insertColumns: (attrs?: {
232
+ cols: number;
233
+ }) => ReturnType;
234
+ addColBefore: () => ReturnType;
235
+ addColAfter: () => ReturnType;
236
+ deleteCol: () => ReturnType;
247
237
  };
248
238
  }
249
239
  }
@@ -251,15 +241,9 @@ declare module '@tiptap/core' {
251
241
 
252
242
  declare module '@tiptap/core' {
253
243
  interface Commands<ReturnType> {
254
- video: {
255
- /**
256
- * Add an video
257
- */
258
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
259
- /**
260
- * Update an video
261
- */
262
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
244
+ tableOfContents: {
245
+ setTableOfContents: () => ReturnType;
246
+ removeTableOfContents: () => ReturnType;
263
247
  };
264
248
  }
265
249
  }
@@ -280,6 +264,22 @@ declare module '@tiptap/core' {
280
264
  }
281
265
 
282
266
 
267
+ declare module '@tiptap/core' {
268
+ interface Commands<ReturnType> {
269
+ video: {
270
+ /**
271
+ * Add an video
272
+ */
273
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
274
+ /**
275
+ * Update an video
276
+ */
277
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
278
+ };
279
+ }
280
+ }
281
+
282
+
283
283
  declare module '@tiptap/core' {
284
284
  interface Commands<ReturnType> {
285
285
  tableCellBackground: {
package/lib/ListItem.d.ts CHANGED
@@ -36,11 +36,9 @@ declare module '@tiptap/core' {
36
36
 
37
37
  declare module '@tiptap/core' {
38
38
  interface Commands<ReturnType> {
39
- emoji: {
40
- setEmoji: (emoji: {
41
- name: string;
42
- emoji: string;
43
- }) => ReturnType;
39
+ drawer: {
40
+ setDrawer: (options: any, replace?: any) => ReturnType;
41
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
44
42
  };
45
43
  }
46
44
  }
@@ -57,9 +55,11 @@ declare module '@tiptap/core' {
57
55
 
58
56
  declare module '@tiptap/core' {
59
57
  interface Commands<ReturnType> {
60
- drawer: {
61
- setDrawer: (options: any, replace?: any) => ReturnType;
62
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
58
+ emoji: {
59
+ setEmoji: (emoji: {
60
+ name: string;
61
+ emoji: string;
62
+ }) => ReturnType;
63
63
  };
64
64
  }
65
65
  }
@@ -181,15 +181,6 @@ declare module '@tiptap/core' {
181
181
  }
182
182
 
183
183
 
184
- declare module '@tiptap/core' {
185
- interface Commands<ReturnType> {
186
- katex: {
187
- setKatex: (arg?: IKatexAttrs) => ReturnType;
188
- };
189
- }
190
- }
191
-
192
-
193
184
  declare module '@tiptap/core' {
194
185
  interface Commands<ReturnType> {
195
186
  lineHeight: {
@@ -202,9 +193,8 @@ declare module '@tiptap/core' {
202
193
 
203
194
  declare module '@tiptap/core' {
204
195
  interface Commands<ReturnType> {
205
- mermaid: {
206
- setMermaid: (options: any, replace?: any) => ReturnType;
207
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
196
+ katex: {
197
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
208
198
  };
209
199
  }
210
200
  }
@@ -212,13 +202,9 @@ declare module '@tiptap/core' {
212
202
 
213
203
  declare module '@tiptap/core' {
214
204
  interface Commands<ReturnType> {
215
- columns: {
216
- insertColumns: (attrs?: {
217
- cols: number;
218
- }) => ReturnType;
219
- addColBefore: () => ReturnType;
220
- addColAfter: () => ReturnType;
221
- deleteCol: () => ReturnType;
205
+ mermaid: {
206
+ setMermaid: (options: any, replace?: any) => ReturnType;
207
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
222
208
  };
223
209
  }
224
210
  }
@@ -241,9 +227,13 @@ declare module '@tiptap/core' {
241
227
 
242
228
  declare module '@tiptap/core' {
243
229
  interface Commands<ReturnType> {
244
- tableOfContents: {
245
- setTableOfContents: () => ReturnType;
246
- removeTableOfContents: () => ReturnType;
230
+ columns: {
231
+ insertColumns: (attrs?: {
232
+ cols: number;
233
+ }) => ReturnType;
234
+ addColBefore: () => ReturnType;
235
+ addColAfter: () => ReturnType;
236
+ deleteCol: () => ReturnType;
247
237
  };
248
238
  }
249
239
  }
@@ -251,15 +241,9 @@ declare module '@tiptap/core' {
251
241
 
252
242
  declare module '@tiptap/core' {
253
243
  interface Commands<ReturnType> {
254
- video: {
255
- /**
256
- * Add an video
257
- */
258
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
259
- /**
260
- * Update an video
261
- */
262
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
244
+ tableOfContents: {
245
+ setTableOfContents: () => ReturnType;
246
+ removeTableOfContents: () => ReturnType;
263
247
  };
264
248
  }
265
249
  }
@@ -280,6 +264,22 @@ declare module '@tiptap/core' {
280
264
  }
281
265
 
282
266
 
267
+ declare module '@tiptap/core' {
268
+ interface Commands<ReturnType> {
269
+ video: {
270
+ /**
271
+ * Add an video
272
+ */
273
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
274
+ /**
275
+ * Update an video
276
+ */
277
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
278
+ };
279
+ }
280
+ }
281
+
282
+
283
283
  declare module '@tiptap/core' {
284
284
  interface Commands<ReturnType> {
285
285
  tableCellBackground: {
package/lib/Mention.d.cts CHANGED
@@ -39,11 +39,9 @@ declare module '@tiptap/core' {
39
39
 
40
40
  declare module '@tiptap/core' {
41
41
  interface Commands<ReturnType> {
42
- emoji: {
43
- setEmoji: (emoji: {
44
- name: string;
45
- emoji: string;
46
- }) => ReturnType;
42
+ drawer: {
43
+ setDrawer: (options: any, replace?: any) => ReturnType;
44
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
47
45
  };
48
46
  }
49
47
  }
@@ -60,9 +58,11 @@ declare module '@tiptap/core' {
60
58
 
61
59
  declare module '@tiptap/core' {
62
60
  interface Commands<ReturnType> {
63
- drawer: {
64
- setDrawer: (options: any, replace?: any) => ReturnType;
65
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
61
+ emoji: {
62
+ setEmoji: (emoji: {
63
+ name: string;
64
+ emoji: string;
65
+ }) => ReturnType;
66
66
  };
67
67
  }
68
68
  }
@@ -184,15 +184,6 @@ declare module '@tiptap/core' {
184
184
  }
185
185
 
186
186
 
187
- declare module '@tiptap/core' {
188
- interface Commands<ReturnType> {
189
- katex: {
190
- setKatex: (arg?: IKatexAttrs) => ReturnType;
191
- };
192
- }
193
- }
194
-
195
-
196
187
  declare module '@tiptap/core' {
197
188
  interface Commands<ReturnType> {
198
189
  lineHeight: {
@@ -205,9 +196,8 @@ declare module '@tiptap/core' {
205
196
 
206
197
  declare module '@tiptap/core' {
207
198
  interface Commands<ReturnType> {
208
- mermaid: {
209
- setMermaid: (options: any, replace?: any) => ReturnType;
210
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
199
+ katex: {
200
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
211
201
  };
212
202
  }
213
203
  }
@@ -215,13 +205,9 @@ declare module '@tiptap/core' {
215
205
 
216
206
  declare module '@tiptap/core' {
217
207
  interface Commands<ReturnType> {
218
- columns: {
219
- insertColumns: (attrs?: {
220
- cols: number;
221
- }) => ReturnType;
222
- addColBefore: () => ReturnType;
223
- addColAfter: () => ReturnType;
224
- deleteCol: () => ReturnType;
208
+ mermaid: {
209
+ setMermaid: (options: any, replace?: any) => ReturnType;
210
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
225
211
  };
226
212
  }
227
213
  }
@@ -244,9 +230,13 @@ declare module '@tiptap/core' {
244
230
 
245
231
  declare module '@tiptap/core' {
246
232
  interface Commands<ReturnType> {
247
- tableOfContents: {
248
- setTableOfContents: () => ReturnType;
249
- removeTableOfContents: () => ReturnType;
233
+ columns: {
234
+ insertColumns: (attrs?: {
235
+ cols: number;
236
+ }) => ReturnType;
237
+ addColBefore: () => ReturnType;
238
+ addColAfter: () => ReturnType;
239
+ deleteCol: () => ReturnType;
250
240
  };
251
241
  }
252
242
  }
@@ -254,15 +244,9 @@ declare module '@tiptap/core' {
254
244
 
255
245
  declare module '@tiptap/core' {
256
246
  interface Commands<ReturnType> {
257
- video: {
258
- /**
259
- * Add an video
260
- */
261
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
262
- /**
263
- * Update an video
264
- */
265
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
247
+ tableOfContents: {
248
+ setTableOfContents: () => ReturnType;
249
+ removeTableOfContents: () => ReturnType;
266
250
  };
267
251
  }
268
252
  }
@@ -283,6 +267,22 @@ declare module '@tiptap/core' {
283
267
  }
284
268
 
285
269
 
270
+ declare module '@tiptap/core' {
271
+ interface Commands<ReturnType> {
272
+ video: {
273
+ /**
274
+ * Add an video
275
+ */
276
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
277
+ /**
278
+ * Update an video
279
+ */
280
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
281
+ };
282
+ }
283
+ }
284
+
285
+
286
286
  declare module '@tiptap/core' {
287
287
  interface Commands<ReturnType> {
288
288
  tableCellBackground: {
package/lib/Mention.d.ts CHANGED
@@ -39,11 +39,9 @@ declare module '@tiptap/core' {
39
39
 
40
40
  declare module '@tiptap/core' {
41
41
  interface Commands<ReturnType> {
42
- emoji: {
43
- setEmoji: (emoji: {
44
- name: string;
45
- emoji: string;
46
- }) => ReturnType;
42
+ drawer: {
43
+ setDrawer: (options: any, replace?: any) => ReturnType;
44
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
47
45
  };
48
46
  }
49
47
  }
@@ -60,9 +58,11 @@ declare module '@tiptap/core' {
60
58
 
61
59
  declare module '@tiptap/core' {
62
60
  interface Commands<ReturnType> {
63
- drawer: {
64
- setDrawer: (options: any, replace?: any) => ReturnType;
65
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
61
+ emoji: {
62
+ setEmoji: (emoji: {
63
+ name: string;
64
+ emoji: string;
65
+ }) => ReturnType;
66
66
  };
67
67
  }
68
68
  }
@@ -184,15 +184,6 @@ declare module '@tiptap/core' {
184
184
  }
185
185
 
186
186
 
187
- declare module '@tiptap/core' {
188
- interface Commands<ReturnType> {
189
- katex: {
190
- setKatex: (arg?: IKatexAttrs) => ReturnType;
191
- };
192
- }
193
- }
194
-
195
-
196
187
  declare module '@tiptap/core' {
197
188
  interface Commands<ReturnType> {
198
189
  lineHeight: {
@@ -205,9 +196,8 @@ declare module '@tiptap/core' {
205
196
 
206
197
  declare module '@tiptap/core' {
207
198
  interface Commands<ReturnType> {
208
- mermaid: {
209
- setMermaid: (options: any, replace?: any) => ReturnType;
210
- setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
199
+ katex: {
200
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
211
201
  };
212
202
  }
213
203
  }
@@ -215,13 +205,9 @@ declare module '@tiptap/core' {
215
205
 
216
206
  declare module '@tiptap/core' {
217
207
  interface Commands<ReturnType> {
218
- columns: {
219
- insertColumns: (attrs?: {
220
- cols: number;
221
- }) => ReturnType;
222
- addColBefore: () => ReturnType;
223
- addColAfter: () => ReturnType;
224
- deleteCol: () => ReturnType;
208
+ mermaid: {
209
+ setMermaid: (options: any, replace?: any) => ReturnType;
210
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
225
211
  };
226
212
  }
227
213
  }
@@ -244,9 +230,13 @@ declare module '@tiptap/core' {
244
230
 
245
231
  declare module '@tiptap/core' {
246
232
  interface Commands<ReturnType> {
247
- tableOfContents: {
248
- setTableOfContents: () => ReturnType;
249
- removeTableOfContents: () => ReturnType;
233
+ columns: {
234
+ insertColumns: (attrs?: {
235
+ cols: number;
236
+ }) => ReturnType;
237
+ addColBefore: () => ReturnType;
238
+ addColAfter: () => ReturnType;
239
+ deleteCol: () => ReturnType;
250
240
  };
251
241
  }
252
242
  }
@@ -254,15 +244,9 @@ declare module '@tiptap/core' {
254
244
 
255
245
  declare module '@tiptap/core' {
256
246
  interface Commands<ReturnType> {
257
- video: {
258
- /**
259
- * Add an video
260
- */
261
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
262
- /**
263
- * Update an video
264
- */
265
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
247
+ tableOfContents: {
248
+ setTableOfContents: () => ReturnType;
249
+ removeTableOfContents: () => ReturnType;
266
250
  };
267
251
  }
268
252
  }
@@ -283,6 +267,22 @@ declare module '@tiptap/core' {
283
267
  }
284
268
 
285
269
 
270
+ declare module '@tiptap/core' {
271
+ interface Commands<ReturnType> {
272
+ video: {
273
+ /**
274
+ * Add an video
275
+ */
276
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
277
+ /**
278
+ * Update an video
279
+ */
280
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
281
+ };
282
+ }
283
+ }
284
+
285
+
286
286
  declare module '@tiptap/core' {
287
287
  interface Commands<ReturnType> {
288
288
  tableCellBackground: {
package/lib/Mermaid.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var W=Object.create;var G=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var J=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of U(e))!Y.call(t,l)&&l!==r&&G(t,l,{get:()=>e[l],enumerable:!(a=X(e,l))||a.enumerable});return t};var K=(t,e,r)=>(r=t!=null?W(Z(t)):{},J(e||!t||!t.__esModule?G(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index-ByRfqzMr.cjs"),u=require("./RichTextEditor-8GrfwaB4.cjs"),F=require("./dom-dataset-Byuf1YmW.cjs"),o=require("react/jsx-runtime"),s=require("react"),P=require("./shortId-Bfj8TyNr.cjs"),Q=require("./textarea-ESw2TM_u.cjs"),S=require("./index-D_A0TBRA.cjs"),$=`graph TB
1
+ "use strict";var W=Object.create;var G=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var J=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of U(e))!Y.call(t,l)&&l!==r&&G(t,l,{get:()=>e[l],enumerable:!(a=X(e,l))||a.enumerable});return t};var K=(t,e,r)=>(r=t!=null?W(Z(t)):{},J(e||!t||!t.__esModule?G(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index-ByRfqzMr.cjs"),u=require("./RichTextEditor-BKywwUM4.cjs"),F=require("./dom-dataset-Byuf1YmW.cjs"),o=require("react/jsx-runtime"),s=require("react"),P=require("./shortId-Bfj8TyNr.cjs"),Q=require("./textarea-DhlS0JCr.cjs"),S=require("./index-D_A0TBRA.cjs"),$=`graph TB
2
2
  a-->b`,ee=({editor:t,upload:e})=>{const[r,a]=s.useState($),[l,v]=s.useState(""),[T,y]=s.useState(!1),A=s.useRef(null),[d,h]=s.useState(null),E=s.useCallback(c=>{c&&import("mermaid").then(x=>{h(x.default)})},[]),_=async c=>{try{const{svg:x}=await d.render("mermaid-svg",c);v(x)}catch{v("")}},L=()=>{d.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),_(r)};s.useEffect(()=>{d&&T&&L()},[d,T]),s.useEffect(()=>{d&&T&&_(r)},[d&&r]);const R=async()=>{if(r!==""){if(r){const c=A.current.querySelector("svg"),{width:x,height:j}=c.getBoundingClientRect(),I=`mermaid-${P.shortId()}.svg`;let M=P.i(c.outerHTML);if(e){console.log({src:M});const H=u.dataURLtoFile(M,I);M=await e(H)}t==null||t.chain().focus().setMermaid({type:"mermaid",src:M,alt:encodeURIComponent(r),width:x,height:j},!!r).run()}y(!1)}};return o.jsxs(u.Dialog,{onOpenChange:y,open:T,children:[o.jsx(u.DialogTrigger,{asChild:!0,children:o.jsx(u.ActionButton,{action:()=>y(!0),icon:"Mermaid",tooltip:"Mermaid"})}),o.jsxs(u.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[o.jsx(u.DialogTitle,{children:"Mermaid"}),o.jsx("div",{ref:E,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:o.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[o.jsx(Q.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:c=>a(c.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),o.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:l},ref:A,style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),o.jsx(u.DialogFooter,{children:o.jsx(u.Button,{onClick:R,type:"button",children:"Save changes"})})]})]})},O={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function te({editor:t,node:e,updateAttributes:r,getPos:a,selected:l}){const[v,T]=s.useState({width:S.IMAGE_MAX_SIZE,height:S.IMAGE_MAX_SIZE}),[y,A]=s.useState({width:0,height:0}),[d]=s.useState([O.TOP_LEFT,O.TOP_RIGHT,O.BOTTOM_LEFT,O.BOTTOM_RIGHT]),[h,E]=s.useState(!1),[_,L]=s.useState({x:0,y:0,w:0,h:0,dir:""}),{align:R}=e==null?void 0:e.attrs,c=s.useMemo(()=>{const{src:i,alt:m,width:f,height:b}=e==null?void 0:e.attrs,w=q.isNumber(f)?`${f}px`:f,n=q.isNumber(b)?`${b}px`:b;return{src:i||void 0,alt:m||void 0,style:{width:w||void 0,height:n||void 0}}},[e==null?void 0:e.attrs]),x=s.useMemo(()=>{const{style:{width:i}}=c;return{width:i==="100%"?i:void 0}},[c]);function j(i){A({width:i.target.width,height:i.target.height})}function I(){t.commands.setNodeSelection(a())}const M=s.useCallback(u.throttle(()=>{const{width:i}=getComputedStyle(t.view.dom);T(m=>({...m,width:Number.parseInt(i,10)}))},S.IMAGE_THROTTLE_WAIT_TIME),[t]);function H(i,m){i.preventDefault(),i.stopPropagation();const f=y.width,b=y.height,w=f/b;let n=Number(e.attrs.width),p=Number(e.attrs.height);const g=v.width;n&&!p?(n=n>g?g:n,p=Math.round(n/w)):p&&!n?(n=Math.round(p*w),n=n>g?g:n):!n&&!p?(n=f>g?g:f,p=Math.round(n/w)):n=n>g?g:n,E(!0),L({x:i.clientX,y:i.clientY,w:n,h:p,dir:m})}const N=s.useCallback(u.throttle(i=>{if(i.preventDefault(),i.stopPropagation(),!h)return;const{x:m,w:f,dir:b}=_,w=(i.clientX-m)*(/l/.test(b)?-1:1),{width:n,height:p}=e==null?void 0:e.attrs,g=n/p,B=u.clamp(f+w,S.IMAGE_MIN_SIZE,v.width),V=Math.round(B/g);r({width:B,height:V})},S.IMAGE_THROTTLE_WAIT_TIME),[h,_,v,r,e==null?void 0:e.attrs]),C=s.useCallback(i=>{i.preventDefault(),i.stopPropagation(),h&&(L({x:0,y:0,w:0,h:0,dir:""}),E(!1),I())},[h,I]),D=s.useCallback(()=>{document==null||document.addEventListener("mousemove",N,!0),document==null||document.addEventListener("mouseup",C,!0)},[N,C]),z=s.useCallback(()=>{document==null||document.removeEventListener("mousemove",N,!0),document==null||document.removeEventListener("mouseup",C,!0)},[N,C]);s.useEffect(()=>(h?D():z(),()=>{z()}),[h,D,z]);const k=s.useMemo(()=>new ResizeObserver(()=>M()),[M]);return s.useEffect(()=>(k.observe(t.view.dom),()=>{k.disconnect()}),[t.view.dom,k]),o.jsx(F.NodeViewWrapper,{className:"image-view",style:{...x,width:"100%",textAlign:R},children:o.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:{...x,background:"#fff"},className:`image-view__body ${l?"image-view__body--focused":""} ${h?"image-view__body--resizing":""}`,children:[o.jsx("img",{alt:c.alt,className:"image-view__body__image block",height:"auto",onClick:I,onLoad:j,src:c.src,style:c.style}),t.view.editable&&(l||h)&&o.jsx("div",{className:"image-resizer",children:d==null?void 0:d.map(i=>o.jsx("span",{className:`image-resizer__handler image-resizer__handler--${i}`,onMouseDown:m=>H(m,i)},`image-dir-${i}`))})]})})}const re=u.Image.extend({name:"mermaid",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"mermaid"},button:({editor:e,t:r,extension:a})=>{var l;return{component:ee,componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,editor:e,icon:"Mermaid",tooltip:r("editor.mermaid.tooltip"),upload:(l=a==null?void 0:a.options)==null?void 0:l.upload}}}}},addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),width:{default:null,parseHTML:e=>{const r=e.querySelector("img"),a=r==null?void 0:r.getAttribute("width");return a?Number.parseInt(a,10):320},renderHTML:e=>({width:e.width})},height:{default:null,parseHTML:e=>{const r=e.querySelector("img"),a=r==null?void 0:r.getAttribute("height");return a?Number.parseInt(a,10):212},renderHTML:e=>({height:e.height})},align:{default:"center",parseHTML:e=>e.getAttribute("align"),renderHTML:e=>({align:e.align})}}},addNodeView(){return F.ReactNodeViewRenderer(te)},addCommands(){return{setMermaid:(t,e)=>({commands:r,editor:a})=>e?r.insertContent({type:this.name,attrs:t}):r.insertContentAt(a.state.selection.anchor,{type:this.name,attrs:t}),setAlignImageMermaid:t=>({commands:e})=>e.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:t}){const{align:e}=t;return["div",{style:e?`text-align: ${e};`:"",class:"imageMermaid"},["img",q.mergeAttributes(this.options.HTMLAttributes,t)]]},parseHTML(){return[{tag:"div[class=imageMermaid]",getAttrs:t=>{const e=t.querySelector("img"),r=e==null?void 0:e.getAttribute("width"),a=e==null?void 0:e.getAttribute("height");return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),width:r?Number.parseInt(r,10):null,height:a?Number.parseInt(a,10):null,align:(e==null?void 0:e.getAttribute("align"))||t.style.textAlign||null}}}]}});exports.Mermaid=re;