reactjs-tiptap-editor 0.3.19 → 0.3.21

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 (244) hide show
  1. package/lib/{ActionMenuButton-BPq-R8E7.cjs → ActionMenuButton-BTFBZyG2.cjs} +1 -1
  2. package/lib/{ActionMenuButton-DCACoSG3.js → ActionMenuButton-DXwnYZhJ.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +28 -28
  5. package/lib/Attachment.d.ts +28 -28
  6. package/lib/Attachment.js +3 -3
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +28 -28
  9. package/lib/Blockquote.d.ts +28 -28
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +28 -28
  13. package/lib/Bold.d.ts +28 -28
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +28 -28
  17. package/lib/BulletList.d.ts +28 -28
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +28 -28
  21. package/lib/Clear.d.ts +28 -28
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +28 -28
  25. package/lib/Code.d.ts +28 -28
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +28 -28
  29. package/lib/CodeBlock.d.ts +28 -28
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +28 -28
  33. package/lib/CodeView.d.ts +28 -28
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +28 -28
  37. package/lib/Color.d.ts +28 -28
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.cjs +1 -1
  40. package/lib/Document.d.cts +28 -28
  41. package/lib/Document.d.ts +28 -28
  42. package/lib/Document.js +1 -1
  43. package/lib/{Drawer-Dwx9V0Xb.cjs → Drawer-BrHHs2E9.cjs} +1 -1
  44. package/lib/{Drawer-Qh1zEBl3.js → Drawer-CVuwyG50.js} +3 -3
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +28 -28
  47. package/lib/Drawer.d.ts +28 -28
  48. package/lib/Drawer.js +4 -4
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +28 -28
  51. package/lib/Emoji.d.ts +28 -28
  52. package/lib/Emoji.js +4 -4
  53. package/lib/{Excalidraw-BP_-zWZH.cjs → Excalidraw-Be_GDV4Q.cjs} +1 -1
  54. package/lib/{Excalidraw-DD3P3ClH.js → Excalidraw-frMX4K62.js} +3 -3
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +28 -28
  57. package/lib/Excalidraw.d.ts +28 -28
  58. package/lib/Excalidraw.js +3 -3
  59. package/lib/ExportPdf.cjs +1 -1
  60. package/lib/ExportPdf.d.cts +28 -28
  61. package/lib/ExportPdf.d.ts +28 -28
  62. package/lib/ExportPdf.js +2 -2
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +28 -28
  65. package/lib/ExportWord.d.ts +28 -28
  66. package/lib/ExportWord.js +2 -2
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +28 -28
  69. package/lib/FontFamily.d.ts +28 -28
  70. package/lib/FontFamily.js +4 -4
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +28 -28
  73. package/lib/FontSize.d.ts +28 -28
  74. package/lib/FontSize.js +3 -3
  75. package/lib/FormatPainter.cjs +1 -1
  76. package/lib/FormatPainter.d.cts +28 -28
  77. package/lib/FormatPainter.d.ts +28 -28
  78. package/lib/FormatPainter.js +2 -2
  79. package/lib/Heading.cjs +1 -1
  80. package/lib/Heading.d.cts +28 -28
  81. package/lib/Heading.d.ts +28 -28
  82. package/lib/Heading.js +3 -3
  83. package/lib/Highlight.cjs +1 -1
  84. package/lib/Highlight.d.cts +28 -28
  85. package/lib/Highlight.d.ts +28 -28
  86. package/lib/Highlight.js +2 -2
  87. package/lib/History.cjs +1 -1
  88. package/lib/History.d.cts +28 -28
  89. package/lib/History.d.ts +28 -28
  90. package/lib/History.js +2 -2
  91. package/lib/HorizontalRule.cjs +1 -1
  92. package/lib/HorizontalRule.d.cts +28 -28
  93. package/lib/HorizontalRule.d.ts +28 -28
  94. package/lib/HorizontalRule.js +2 -2
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +28 -28
  97. package/lib/Iframe.d.ts +28 -28
  98. package/lib/Iframe.js +3 -3
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +28 -28
  101. package/lib/Image.d.ts +28 -28
  102. package/lib/Image.js +3 -3
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +28 -28
  105. package/lib/ImageGif.d.ts +28 -28
  106. package/lib/ImageGif.js +3 -3
  107. package/lib/ImportWord.cjs +74 -74
  108. package/lib/ImportWord.d.cts +28 -28
  109. package/lib/ImportWord.d.ts +28 -28
  110. package/lib/ImportWord.js +5015 -4998
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +28 -28
  113. package/lib/Indent.d.ts +28 -28
  114. package/lib/Indent.js +2 -2
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +28 -28
  117. package/lib/Italic.d.ts +28 -28
  118. package/lib/Italic.js +2 -2
  119. package/lib/Katex.cjs +1 -1
  120. package/lib/Katex.d.cts +28 -28
  121. package/lib/Katex.d.ts +28 -28
  122. package/lib/Katex.js +4 -4
  123. package/lib/LineHeight.cjs +1 -1
  124. package/lib/LineHeight.d.cts +28 -28
  125. package/lib/LineHeight.d.ts +28 -28
  126. package/lib/LineHeight.js +2 -2
  127. package/lib/Link.cjs +1 -1
  128. package/lib/Link.d.cts +28 -28
  129. package/lib/Link.d.ts +28 -28
  130. package/lib/Link.js +2 -2
  131. package/lib/ListItem.cjs +1 -1
  132. package/lib/ListItem.d.cts +28 -28
  133. package/lib/ListItem.d.ts +28 -28
  134. package/lib/ListItem.js +1 -1
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +28 -28
  137. package/lib/Mention.d.ts +28 -28
  138. package/lib/Mention.js +123 -91
  139. package/lib/Mermaid.cjs +1 -1
  140. package/lib/Mermaid.d.cts +28 -28
  141. package/lib/Mermaid.d.ts +28 -28
  142. package/lib/Mermaid.js +4 -4
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +28 -28
  145. package/lib/MoreMark.d.ts +28 -28
  146. package/lib/MoreMark.js +3 -3
  147. package/lib/MultiColumn.cjs +1 -1
  148. package/lib/MultiColumn.d.cts +28 -28
  149. package/lib/MultiColumn.d.ts +28 -28
  150. package/lib/MultiColumn.js +2 -2
  151. package/lib/OrderedList.cjs +1 -1
  152. package/lib/OrderedList.d.cts +28 -28
  153. package/lib/OrderedList.d.ts +28 -28
  154. package/lib/OrderedList.js +2 -2
  155. package/lib/RichTextEditor-CAxwVWUE.cjs +137 -0
  156. package/lib/{RichTextEditor-DIvPROxl.js → RichTextEditor-DjTnd5Uu.js} +1607 -1603
  157. package/lib/SearchAndReplace.cjs +1 -1
  158. package/lib/SearchAndReplace.d.cts +28 -28
  159. package/lib/SearchAndReplace.d.ts +28 -28
  160. package/lib/SearchAndReplace.js +2 -2
  161. package/lib/Selection.cjs +1 -1
  162. package/lib/Selection.d.cts +28 -28
  163. package/lib/Selection.d.ts +28 -28
  164. package/lib/Selection.js +1 -1
  165. package/lib/SlashCommand.cjs +1 -1
  166. package/lib/SlashCommand.d.cts +28 -28
  167. package/lib/SlashCommand.d.ts +28 -28
  168. package/lib/SlashCommand.js +4 -4
  169. package/lib/Strike.cjs +1 -1
  170. package/lib/Strike.d.cts +28 -28
  171. package/lib/Strike.d.ts +28 -28
  172. package/lib/Strike.js +2 -2
  173. package/lib/SubAndSuperScript.cjs +1 -1
  174. package/lib/SubAndSuperScript.d.cts +28 -28
  175. package/lib/SubAndSuperScript.d.ts +28 -28
  176. package/lib/SubAndSuperScript.js +3 -3
  177. package/lib/Table.cjs +1 -1
  178. package/lib/Table.d.cts +28 -28
  179. package/lib/Table.d.ts +28 -28
  180. package/lib/Table.js +2 -2
  181. package/lib/TableOfContent.cjs +1 -1
  182. package/lib/TableOfContent.d.cts +28 -28
  183. package/lib/TableOfContent.d.ts +28 -28
  184. package/lib/TableOfContent.js +3 -3
  185. package/lib/TaskList.cjs +1 -1
  186. package/lib/TaskList.d.cts +28 -28
  187. package/lib/TaskList.d.ts +28 -28
  188. package/lib/TaskList.js +37 -33
  189. package/lib/TextAlign.cjs +1 -1
  190. package/lib/TextAlign.d.cts +28 -28
  191. package/lib/TextAlign.d.ts +28 -28
  192. package/lib/TextAlign.js +2 -2
  193. package/lib/TextBubble.cjs +1 -1
  194. package/lib/TextBubble.d.cts +28 -28
  195. package/lib/TextBubble.d.ts +28 -28
  196. package/lib/TextBubble.js +2 -2
  197. package/lib/TextDirection.cjs +1 -1
  198. package/lib/TextDirection.d.cts +28 -28
  199. package/lib/TextDirection.d.ts +28 -28
  200. package/lib/TextDirection.js +2 -2
  201. package/lib/TextUnderline.cjs +1 -1
  202. package/lib/TextUnderline.d.cts +28 -28
  203. package/lib/TextUnderline.d.ts +28 -28
  204. package/lib/TextUnderline.js +2 -2
  205. package/lib/TrailingNode.cjs +1 -1
  206. package/lib/TrailingNode.d.cts +28 -28
  207. package/lib/TrailingNode.d.ts +28 -28
  208. package/lib/TrailingNode.js +1 -1
  209. package/lib/{Twitter-Bl5HyIX0.cjs → Twitter-V0OzBT_E.cjs} +1 -1
  210. package/lib/{Twitter-raSi7ATg.js → Twitter-dRxbZOad.js} +3 -3
  211. package/lib/Twitter.cjs +1 -1
  212. package/lib/Twitter.d.cts +28 -28
  213. package/lib/Twitter.d.ts +28 -28
  214. package/lib/Twitter.js +3 -3
  215. package/lib/Video.cjs +1 -1
  216. package/lib/Video.d.cts +28 -28
  217. package/lib/Video.d.ts +28 -28
  218. package/lib/Video.js +2 -2
  219. package/lib/bubble-extra.cjs +2 -2
  220. package/lib/bubble-extra.d.cts +28 -28
  221. package/lib/bubble-extra.d.ts +28 -28
  222. package/lib/bubble-extra.js +25 -25
  223. package/lib/{dom-dataset-Cuy-pIfj.cjs → dom-dataset-Byuf1YmW.cjs} +5 -5
  224. package/lib/{dom-dataset-CHDbKz5J.js → dom-dataset-Di3tIRrR.js} +94 -83
  225. package/lib/index-BI-IcZcN.cjs +1 -0
  226. package/lib/{index-CSvnpArE.cjs → index-ByRfqzMr.cjs} +2 -2
  227. package/lib/{index-DIPntess.js → index-C1fzuXpN.js} +1 -1
  228. package/lib/index-CbQQFj2T.js +133 -0
  229. package/lib/{index-BWx1Mchx.js → index-DI9T3iLd.js} +243 -243
  230. package/lib/{index-CrxasX7b.cjs → index-DclQSrIx.cjs} +1 -1
  231. package/lib/{index-DEFQHExY.js → index-LUL9mqY4.js} +1 -1
  232. package/lib/{index-h9_SDuwc.cjs → index-Z4b9rzn-.cjs} +1 -1
  233. package/lib/index.cjs +1 -1
  234. package/lib/index.d.cts +28 -28
  235. package/lib/index.d.ts +28 -28
  236. package/lib/index.js +5 -5
  237. package/lib/locale-bundle.d.cts +28 -28
  238. package/lib/locale-bundle.d.ts +28 -28
  239. package/lib/{textarea-DnBlTntN.js → textarea-6c8drwXJ.js} +1 -1
  240. package/lib/{textarea-DgXP0XRK.cjs → textarea-BsJTSgT-.cjs} +1 -1
  241. package/package.json +67 -67
  242. package/lib/RichTextEditor-DszaQdvS.cjs +0 -141
  243. package/lib/index-Cyh1yoFk.cjs +0 -1
  244. package/lib/index-oQutU45z.js +0 -129
package/lib/Mention.d.cts CHANGED
@@ -39,9 +39,11 @@ declare module '@tiptap/core' {
39
39
 
40
40
  declare module '@tiptap/core' {
41
41
  interface Commands<ReturnType> {
42
- drawer: {
43
- setDrawer: (options: any, replace?: any) => ReturnType;
44
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
42
+ emoji: {
43
+ setEmoji: (emoji: {
44
+ name: string;
45
+ emoji: string;
46
+ }) => ReturnType;
45
47
  };
46
48
  }
47
49
  }
@@ -49,11 +51,9 @@ declare module '@tiptap/core' {
49
51
 
50
52
  declare module '@tiptap/core' {
51
53
  interface Commands<ReturnType> {
52
- emoji: {
53
- setEmoji: (emoji: {
54
- name: string;
55
- emoji: string;
56
- }) => ReturnType;
54
+ drawer: {
55
+ setDrawer: (options: any, replace?: any) => ReturnType;
56
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
57
57
  };
58
58
  }
59
59
  }
@@ -104,21 +104,6 @@ declare module '@tiptap/core' {
104
104
  }
105
105
 
106
106
 
107
- declare module '@tiptap/core' {
108
- interface Commands<ReturnType> {
109
- iframe: {
110
- /**
111
- * Add an iframe
112
- */
113
- setIframe: (options: {
114
- src: string;
115
- service: string;
116
- }) => ReturnType;
117
- };
118
- }
119
- }
120
-
121
-
122
107
  declare module '@tiptap/core' {
123
108
  interface Commands<ReturnType> {
124
109
  imageUpload: {
@@ -139,6 +124,21 @@ declare module '@tiptap/core' {
139
124
  }
140
125
 
141
126
 
127
+ declare module '@tiptap/core' {
128
+ interface Commands<ReturnType> {
129
+ iframe: {
130
+ /**
131
+ * Add an iframe
132
+ */
133
+ setIframe: (options: {
134
+ src: string;
135
+ service: string;
136
+ }) => ReturnType;
137
+ };
138
+ }
139
+ }
140
+
141
+
142
142
  declare module '@tiptap/core' {
143
143
  interface Commands<ReturnType> {
144
144
  imageGifUpload: {
@@ -177,8 +177,9 @@ declare module '@tiptap/core' {
177
177
 
178
178
  declare module '@tiptap/core' {
179
179
  interface Commands<ReturnType> {
180
- katex: {
181
- setKatex: (arg?: IKatexAttrs) => ReturnType;
180
+ lineHeight: {
181
+ setLineHeight: (lineHeight: string) => ReturnType;
182
+ unsetLineHeight: () => ReturnType;
182
183
  };
183
184
  }
184
185
  }
@@ -186,9 +187,8 @@ declare module '@tiptap/core' {
186
187
 
187
188
  declare module '@tiptap/core' {
188
189
  interface Commands<ReturnType> {
189
- lineHeight: {
190
- setLineHeight: (lineHeight: string) => ReturnType;
191
- unsetLineHeight: () => ReturnType;
190
+ katex: {
191
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
192
192
  };
193
193
  }
194
194
  }
package/lib/Mention.d.ts CHANGED
@@ -39,9 +39,11 @@ declare module '@tiptap/core' {
39
39
 
40
40
  declare module '@tiptap/core' {
41
41
  interface Commands<ReturnType> {
42
- drawer: {
43
- setDrawer: (options: any, replace?: any) => ReturnType;
44
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
42
+ emoji: {
43
+ setEmoji: (emoji: {
44
+ name: string;
45
+ emoji: string;
46
+ }) => ReturnType;
45
47
  };
46
48
  }
47
49
  }
@@ -49,11 +51,9 @@ declare module '@tiptap/core' {
49
51
 
50
52
  declare module '@tiptap/core' {
51
53
  interface Commands<ReturnType> {
52
- emoji: {
53
- setEmoji: (emoji: {
54
- name: string;
55
- emoji: string;
56
- }) => ReturnType;
54
+ drawer: {
55
+ setDrawer: (options: any, replace?: any) => ReturnType;
56
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
57
57
  };
58
58
  }
59
59
  }
@@ -104,21 +104,6 @@ declare module '@tiptap/core' {
104
104
  }
105
105
 
106
106
 
107
- declare module '@tiptap/core' {
108
- interface Commands<ReturnType> {
109
- iframe: {
110
- /**
111
- * Add an iframe
112
- */
113
- setIframe: (options: {
114
- src: string;
115
- service: string;
116
- }) => ReturnType;
117
- };
118
- }
119
- }
120
-
121
-
122
107
  declare module '@tiptap/core' {
123
108
  interface Commands<ReturnType> {
124
109
  imageUpload: {
@@ -139,6 +124,21 @@ declare module '@tiptap/core' {
139
124
  }
140
125
 
141
126
 
127
+ declare module '@tiptap/core' {
128
+ interface Commands<ReturnType> {
129
+ iframe: {
130
+ /**
131
+ * Add an iframe
132
+ */
133
+ setIframe: (options: {
134
+ src: string;
135
+ service: string;
136
+ }) => ReturnType;
137
+ };
138
+ }
139
+ }
140
+
141
+
142
142
  declare module '@tiptap/core' {
143
143
  interface Commands<ReturnType> {
144
144
  imageGifUpload: {
@@ -177,8 +177,9 @@ declare module '@tiptap/core' {
177
177
 
178
178
  declare module '@tiptap/core' {
179
179
  interface Commands<ReturnType> {
180
- katex: {
181
- setKatex: (arg?: IKatexAttrs) => ReturnType;
180
+ lineHeight: {
181
+ setLineHeight: (lineHeight: string) => ReturnType;
182
+ unsetLineHeight: () => ReturnType;
182
183
  };
183
184
  }
184
185
  }
@@ -186,9 +187,8 @@ declare module '@tiptap/core' {
186
187
 
187
188
  declare module '@tiptap/core' {
188
189
  interface Commands<ReturnType> {
189
- lineHeight: {
190
- setLineHeight: (lineHeight: string) => ReturnType;
191
- unsetLineHeight: () => ReturnType;
190
+ katex: {
191
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
192
192
  };
193
193
  }
194
194
  }
package/lib/Mention.js CHANGED
@@ -1,51 +1,71 @@
1
- import { a as b, N as y, m as c } from "./index-BWx1Mchx.js";
2
- import { S as T } from "./index-oQutU45z.js";
3
- import { c as p, g as h, a as L } from "./dom-dataset-CHDbKz5J.js";
4
- import M from "tippy.js";
5
- import { jsx as u } from "react/jsx-runtime";
6
- import { forwardRef as w, useRef as v, useState as H, useEffect as f, useImperativeHandle as U } from "react";
7
- import A from "scroll-into-view-if-needed";
8
- const _ = new b("mention"), x = y.create({
1
+ import { N as v, q as L, m as c, a as M } from "./index-DI9T3iLd.js";
2
+ import { S as w } from "./index-CbQQFj2T.js";
3
+ import { c as h, g as f, a as H } from "./dom-dataset-Di3tIRrR.js";
4
+ import S from "tippy.js";
5
+ import { jsx as m } from "react/jsx-runtime";
6
+ import { forwardRef as A, useRef as U, useState as _, useEffect as b, useImperativeHandle as x } from "react";
7
+ import C from "scroll-into-view-if-needed";
8
+ function N({ editor: e, overrideSuggestionOptions: n, extensionName: t, char: r = "@" }) {
9
+ const i = new M();
10
+ return {
11
+ editor: e,
12
+ char: r,
13
+ pluginKey: i,
14
+ command: ({ editor: o, range: l, props: u }) => {
15
+ var a, s, d;
16
+ const p = o.view.state.selection.$to.nodeAfter;
17
+ ((a = p == null ? void 0 : p.text) === null || a === void 0 ? void 0 : a.startsWith(" ")) && (l.to += 1), o.chain().focus().insertContentAt(l, [
18
+ {
19
+ type: t,
20
+ attrs: { ...u, mentionSuggestionChar: r }
21
+ },
22
+ {
23
+ type: "text",
24
+ text: " "
25
+ }
26
+ ]).run(), (d = (s = o.view.dom.ownerDocument.defaultView) === null || s === void 0 ? void 0 : s.getSelection()) === null || d === void 0 || d.collapseToEnd();
27
+ },
28
+ allow: ({ state: o, range: l }) => {
29
+ const u = o.doc.resolve(l.from), a = o.schema.nodes[t];
30
+ return !!u.parent.type.contentMatch.matchType(a);
31
+ },
32
+ ...n
33
+ };
34
+ }
35
+ function T(e) {
36
+ return (e.options.suggestions.length ? e.options.suggestions : [e.options.suggestion]).map((n) => N({
37
+ // @ts-ignore `editor` can be `undefined` when converting the document to HTML with the HTML utility
38
+ editor: e.editor,
39
+ overrideSuggestionOptions: n,
40
+ extensionName: e.name,
41
+ char: n.char
42
+ }));
43
+ }
44
+ function y(e, n) {
45
+ const t = T(e), r = t.find((i) => i.char === n);
46
+ return r || (t.length ? t[0] : null);
47
+ }
48
+ const R = v.create({
9
49
  name: "mention",
10
50
  priority: 101,
11
51
  addOptions() {
12
52
  return {
13
53
  HTMLAttributes: {},
14
- renderText({ options: e, node: n }) {
15
- var t;
16
- return `${e.suggestion.char}${(t = n.attrs.label) !== null && t !== void 0 ? t : n.attrs.id}`;
54
+ renderText({ node: e, suggestion: n }) {
55
+ var t, r;
56
+ return `${(t = n == null ? void 0 : n.char) !== null && t !== void 0 ? t : "@"}${(r = e.attrs.label) !== null && r !== void 0 ? r : e.attrs.id}`;
17
57
  },
18
58
  deleteTriggerWithBackspace: !1,
19
- renderHTML({ options: e, node: n }) {
20
- var t;
59
+ renderHTML({ options: e, node: n, suggestion: t }) {
60
+ var r, i;
21
61
  return [
22
62
  "span",
23
63
  c(this.HTMLAttributes, e.HTMLAttributes),
24
- `${e.suggestion.char}${(t = n.attrs.label) !== null && t !== void 0 ? t : n.attrs.id}`
64
+ `${(r = t == null ? void 0 : t.char) !== null && r !== void 0 ? r : "@"}${(i = n.attrs.label) !== null && i !== void 0 ? i : n.attrs.id}`
25
65
  ];
26
66
  },
27
- suggestion: {
28
- char: "@",
29
- pluginKey: _,
30
- command: ({ editor: e, range: n, props: t }) => {
31
- var r, s, o;
32
- const a = e.view.state.selection.$to.nodeAfter;
33
- ((r = a == null ? void 0 : a.text) === null || r === void 0 ? void 0 : r.startsWith(" ")) && (n.to += 1), e.chain().focus().insertContentAt(n, [
34
- {
35
- type: this.name,
36
- attrs: t
37
- },
38
- {
39
- type: "text",
40
- text: " "
41
- }
42
- ]).run(), (o = (s = e.view.dom.ownerDocument.defaultView) === null || s === void 0 ? void 0 : s.getSelection()) === null || o === void 0 || o.collapseToEnd();
43
- },
44
- allow: ({ state: e, range: n }) => {
45
- const t = e.doc.resolve(n.from), r = e.schema.nodes[this.name];
46
- return !!t.parent.type.contentMatch.matchType(r);
47
- }
48
- }
67
+ suggestions: [],
68
+ suggestion: {}
49
69
  };
50
70
  },
51
71
  group: "inline",
@@ -67,6 +87,14 @@ const _ = new b("mention"), x = y.create({
67
87
  renderHTML: (e) => e.label ? {
68
88
  "data-label": e.label
69
89
  } : {}
90
+ },
91
+ // When there are multiple types of mentions, this attribute helps distinguish them
92
+ mentionSuggestionChar: {
93
+ default: "@",
94
+ parseHTML: (e) => e.getAttribute("data-mention-suggestion-char"),
95
+ renderHTML: (e) => ({
96
+ "data-mention-suggestion-char": e.mentionSuggestionChar
97
+ })
70
98
  }
71
99
  };
72
100
  },
@@ -78,88 +106,92 @@ const _ = new b("mention"), x = y.create({
78
106
  ];
79
107
  },
80
108
  renderHTML({ node: e, HTMLAttributes: n }) {
109
+ const t = y(this, e.attrs.mentionSuggestionChar);
81
110
  if (this.options.renderLabel !== void 0)
82
111
  return console.warn("renderLabel is deprecated use renderText and renderHTML instead"), [
83
112
  "span",
84
113
  c({ "data-type": this.name }, this.options.HTMLAttributes, n),
85
114
  this.options.renderLabel({
86
115
  options: this.options,
87
- node: e
116
+ node: e,
117
+ suggestion: t
88
118
  })
89
119
  ];
90
- const t = { ...this.options };
91
- t.HTMLAttributes = c({ "data-type": this.name }, this.options.HTMLAttributes, n);
92
- const r = this.options.renderHTML({
93
- options: t,
94
- node: e
120
+ const r = { ...this.options };
121
+ r.HTMLAttributes = c({ "data-type": this.name }, this.options.HTMLAttributes, n);
122
+ const i = this.options.renderHTML({
123
+ options: r,
124
+ node: e,
125
+ suggestion: t
95
126
  });
96
- return typeof r == "string" ? [
127
+ return typeof i == "string" ? [
97
128
  "span",
98
129
  c({ "data-type": this.name }, this.options.HTMLAttributes, n),
99
- r
100
- ] : r;
130
+ i
131
+ ] : i;
101
132
  },
102
133
  renderText({ node: e }) {
103
- return this.options.renderLabel !== void 0 ? (console.warn("renderLabel is deprecated use renderText and renderHTML instead"), this.options.renderLabel({
134
+ const n = {
104
135
  options: this.options,
105
- node: e
106
- })) : this.options.renderText({
107
- options: this.options,
108
- node: e
109
- });
136
+ node: e,
137
+ suggestion: y(this, e.attrs.mentionSuggestionChar)
138
+ };
139
+ return this.options.renderLabel !== void 0 ? (console.warn("renderLabel is deprecated use renderText and renderHTML instead"), this.options.renderLabel(n)) : this.options.renderText(n);
110
140
  },
111
141
  addKeyboardShortcuts() {
112
142
  return {
113
143
  Backspace: () => this.editor.commands.command(({ tr: e, state: n }) => {
114
144
  let t = !1;
115
- const { selection: r } = n, { empty: s, anchor: o } = r;
116
- return s ? (n.doc.nodesBetween(o - 1, o, (a, l) => {
145
+ const { selection: r } = n, { empty: i, anchor: o } = r;
146
+ if (!i)
147
+ return !1;
148
+ n.doc.nodesBetween(o - 1, o, (a, s) => {
149
+ if (a.type.name === this.name)
150
+ return t = !0, e.insertText(this.options.deleteTriggerWithBackspace ? "" : this.options.suggestion.char || "", s, s + a.nodeSize), !1;
151
+ });
152
+ let l = new L(), u = 0;
153
+ return n.doc.nodesBetween(o - 1, o, (a, s) => {
117
154
  if (a.type.name === this.name)
118
- return t = !0, e.insertText(this.options.deleteTriggerWithBackspace ? "" : this.options.suggestion.char || "", l, l + a.nodeSize), !1;
119
- }), t) : !1;
155
+ return t = !0, l = a, u = s, !1;
156
+ }), t && e.insertText(this.options.deleteTriggerWithBackspace ? "" : l.attrs.mentionSuggestionChar, u, u + l.nodeSize), t;
120
157
  })
121
158
  };
122
159
  },
123
160
  addProseMirrorPlugins() {
124
- return [
125
- T({
126
- editor: this.editor,
127
- ...this.options.suggestion
128
- })
129
- ];
161
+ return T(this).map(w);
130
162
  }
131
- }), S = "_listUsers_en3pm_1", R = "_itemUser_en3pm_10", N = "_selectedUser_en3pm_31", m = {
132
- listUsers: S,
133
- itemUser: R,
134
- selectedUser: N
135
- }, $ = w((e, n) => {
136
- const t = v(null), [r, s] = H(0), o = (i) => {
137
- const d = e.items[i];
163
+ }), $ = "_listUsers_en3pm_1", k = "_itemUser_en3pm_10", D = "_selectedUser_en3pm_31", g = {
164
+ listUsers: $,
165
+ itemUser: k,
166
+ selectedUser: D
167
+ }, E = A((e, n) => {
168
+ const t = U(null), [r, i] = _(0), o = (s) => {
169
+ const d = e.items[s];
138
170
  d && e.command({ id: d, label: d });
139
- }, a = () => {
140
- s((r + e.items.length - 1) % e.items.length);
141
171
  }, l = () => {
142
- s((r + 1) % e.items.length);
143
- }, g = () => {
172
+ i((r + e.items.length - 1) % e.items.length);
173
+ }, u = () => {
174
+ i((r + 1) % e.items.length);
175
+ }, a = () => {
144
176
  o(r);
145
177
  };
146
- return f(() => s(0), [e.items]), f(() => {
178
+ return b(() => i(0), [e.items]), b(() => {
147
179
  if (Number.isNaN(r + 1))
148
180
  return;
149
- const i = t.current.querySelector(`span:nth-of-type(${r + 1})`);
150
- i && A(i, { behavior: "smooth", scrollMode: "if-needed" });
151
- }, [r]), U(n, () => ({
152
- onKeyDown: ({ event: i }) => i.key === "ArrowUp" ? (a(), !0) : i.key === "ArrowDown" ? (l(), !0) : i.key === "Enter" ? (g(), !0) : !1
153
- })), /* @__PURE__ */ u("div", { className: p("listUsers", m.listUsers), children: /* @__PURE__ */ u("div", { ref: t, children: e.items.length > 0 ? e.items.map((i, d) => /* @__PURE__ */ u(
181
+ const s = t.current.querySelector(`span:nth-of-type(${r + 1})`);
182
+ s && C(s, { behavior: "smooth", scrollMode: "if-needed" });
183
+ }, [r]), x(n, () => ({
184
+ onKeyDown: ({ event: s }) => s.key === "ArrowUp" ? (l(), !0) : s.key === "ArrowDown" ? (u(), !0) : s.key === "Enter" ? (a(), !0) : !1
185
+ })), /* @__PURE__ */ m("div", { className: h("listUsers", g.listUsers), children: /* @__PURE__ */ m("div", { ref: t, children: e.items.length > 0 ? e.items.map((s, d) => /* @__PURE__ */ m(
154
186
  "span",
155
187
  {
156
- className: p("itemUser", m.itemUser, d === r ? m.selectedUser : ""),
188
+ className: h("itemUser", g.itemUser, d === r ? g.selectedUser : ""),
157
189
  onClick: () => o(d),
158
- children: i
190
+ children: s
159
191
  },
160
192
  d
161
- )) : /* @__PURE__ */ u("div", { className: p("itemUserEmpty", m.itemUser), children: "Empty" }) }) });
162
- }), k = [
193
+ )) : /* @__PURE__ */ m("div", { className: h("itemUserEmpty", g.itemUser), children: "Empty" }) }) });
194
+ }), B = [
163
195
  {
164
196
  id: "1",
165
197
  name: "John Doe"
@@ -176,16 +208,16 @@ const _ = new b("mention"), x = y.create({
176
208
  id: "4",
177
209
  name: "Bob"
178
210
  }
179
- ], C = {
180
- items: async ({ query: e }) => k.map((t) => t.name).filter((t) => t.toLowerCase().startsWith(e.toLowerCase())),
211
+ ], K = {
212
+ items: async ({ query: e }) => B.map((t) => t.name).filter((t) => t.toLowerCase().startsWith(e.toLowerCase())),
181
213
  render: () => {
182
214
  let e, n;
183
215
  return {
184
216
  onStart: (t) => {
185
- e = new L($, {
217
+ e = new H(E, {
186
218
  props: t,
187
219
  editor: t.editor
188
- }), n = M("body", {
220
+ }), n = S("body", {
189
221
  getReferenceClientRect: t.clientRect,
190
222
  appendTo: () => document.body,
191
223
  content: e.element,
@@ -209,16 +241,16 @@ const _ = new b("mention"), x = y.create({
209
241
  }
210
242
  };
211
243
  }
212
- }, W = /* @__PURE__ */ x.extend({
244
+ }, j = /* @__PURE__ */ R.extend({
213
245
  addAttributes() {
214
246
  return {
215
247
  id: {
216
248
  default: "",
217
- parseHTML: h("id")
249
+ parseHTML: f("id")
218
250
  },
219
251
  label: {
220
252
  default: "",
221
- parseHTML: h("label")
253
+ parseHTML: f("label")
222
254
  }
223
255
  };
224
256
  }
@@ -226,8 +258,8 @@ const _ = new b("mention"), x = y.create({
226
258
  HTMLAttributes: {
227
259
  class: "mention"
228
260
  },
229
- suggestion: C
261
+ suggestion: K
230
262
  });
231
263
  export {
232
- W as Mention
264
+ j as Mention
233
265
  };
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-CSvnpArE.cjs"),u=require("./RichTextEditor-DszaQdvS.cjs"),F=require("./dom-dataset-Cuy-pIfj.cjs"),o=require("react/jsx-runtime"),s=require("react"),P=require("./shortId-Bfj8TyNr.cjs"),Q=require("./textarea-DgXP0XRK.cjs"),S=require("./index-C19MB4Al.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-CAxwVWUE.cjs"),F=require("./dom-dataset-Byuf1YmW.cjs"),o=require("react/jsx-runtime"),s=require("react"),P=require("./shortId-Bfj8TyNr.cjs"),Q=require("./textarea-BsJTSgT-.cjs"),S=require("./index-C19MB4Al.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;
package/lib/Mermaid.d.cts CHANGED
@@ -111,9 +111,11 @@ declare module '@tiptap/core' {
111
111
 
112
112
  declare module '@tiptap/core' {
113
113
  interface Commands<ReturnType> {
114
- drawer: {
115
- setDrawer: (options: any, replace?: any) => ReturnType;
116
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
114
+ emoji: {
115
+ setEmoji: (emoji: {
116
+ name: string;
117
+ emoji: string;
118
+ }) => ReturnType;
117
119
  };
118
120
  }
119
121
  }
@@ -121,11 +123,9 @@ declare module '@tiptap/core' {
121
123
 
122
124
  declare module '@tiptap/core' {
123
125
  interface Commands<ReturnType> {
124
- emoji: {
125
- setEmoji: (emoji: {
126
- name: string;
127
- emoji: string;
128
- }) => ReturnType;
126
+ drawer: {
127
+ setDrawer: (options: any, replace?: any) => ReturnType;
128
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
129
129
  };
130
130
  }
131
131
  }
@@ -176,21 +176,6 @@ declare module '@tiptap/core' {
176
176
  }
177
177
 
178
178
 
179
- declare module '@tiptap/core' {
180
- interface Commands<ReturnType> {
181
- iframe: {
182
- /**
183
- * Add an iframe
184
- */
185
- setIframe: (options: {
186
- src: string;
187
- service: string;
188
- }) => ReturnType;
189
- };
190
- }
191
- }
192
-
193
-
194
179
  declare module '@tiptap/core' {
195
180
  interface Commands<ReturnType> {
196
181
  imageUpload: {
@@ -211,6 +196,21 @@ declare module '@tiptap/core' {
211
196
  }
212
197
 
213
198
 
199
+ declare module '@tiptap/core' {
200
+ interface Commands<ReturnType> {
201
+ iframe: {
202
+ /**
203
+ * Add an iframe
204
+ */
205
+ setIframe: (options: {
206
+ src: string;
207
+ service: string;
208
+ }) => ReturnType;
209
+ };
210
+ }
211
+ }
212
+
213
+
214
214
  declare module '@tiptap/core' {
215
215
  interface Commands<ReturnType> {
216
216
  imageGifUpload: {
@@ -249,8 +249,9 @@ declare module '@tiptap/core' {
249
249
 
250
250
  declare module '@tiptap/core' {
251
251
  interface Commands<ReturnType> {
252
- katex: {
253
- setKatex: (arg?: IKatexAttrs) => ReturnType;
252
+ lineHeight: {
253
+ setLineHeight: (lineHeight: string) => ReturnType;
254
+ unsetLineHeight: () => ReturnType;
254
255
  };
255
256
  }
256
257
  }
@@ -258,9 +259,8 @@ declare module '@tiptap/core' {
258
259
 
259
260
  declare module '@tiptap/core' {
260
261
  interface Commands<ReturnType> {
261
- lineHeight: {
262
- setLineHeight: (lineHeight: string) => ReturnType;
263
- unsetLineHeight: () => ReturnType;
262
+ katex: {
263
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
264
264
  };
265
265
  }
266
266
  }