reactjs-tiptap-editor 0.3.31 → 0.4.1

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 (275) hide show
  1. package/README.md +8 -2
  2. package/lib/{ActionMenuButton-BCgqJsST.cjs → ActionMenuButton-CYdM1xx5.cjs} +1 -1
  3. package/lib/{ActionMenuButton-D97K0UWT.js → ActionMenuButton-DKRF6oa0.js} +1 -1
  4. package/lib/Attachment.cjs +2 -2
  5. package/lib/Attachment.d.cts +25 -29
  6. package/lib/Attachment.d.ts +25 -29
  7. package/lib/Attachment.js +7 -6
  8. package/lib/BaseKit.cjs +3 -0
  9. package/lib/BaseKit.d.cts +481 -0
  10. package/lib/BaseKit.d.ts +481 -0
  11. package/lib/BaseKit.js +132 -0
  12. package/lib/Blockquote.cjs +5 -1
  13. package/lib/Blockquote.d.cts +25 -29
  14. package/lib/Blockquote.d.ts +25 -29
  15. package/lib/Blockquote.js +33 -17
  16. package/lib/Bold.cjs +1 -1
  17. package/lib/Bold.d.cts +25 -29
  18. package/lib/Bold.d.ts +25 -29
  19. package/lib/Bold.js +23 -16
  20. package/lib/BulletList.cjs +1 -1
  21. package/lib/BulletList.d.cts +26 -30
  22. package/lib/BulletList.d.ts +26 -30
  23. package/lib/BulletList.js +11 -57
  24. package/lib/Clear.cjs +1 -1
  25. package/lib/Clear.d.cts +25 -29
  26. package/lib/Clear.d.ts +25 -29
  27. package/lib/Clear.js +4 -2
  28. package/lib/Code.cjs +1 -1
  29. package/lib/Code.d.cts +25 -29
  30. package/lib/Code.d.ts +25 -29
  31. package/lib/Code.js +29 -25
  32. package/lib/CodeBlock.cjs +2 -2
  33. package/lib/CodeBlock.d.cts +25 -29
  34. package/lib/CodeBlock.d.ts +25 -29
  35. package/lib/CodeBlock.js +3 -3
  36. package/lib/CodeView.cjs +1 -1
  37. package/lib/CodeView.d.cts +25 -29
  38. package/lib/CodeView.d.ts +25 -29
  39. package/lib/CodeView.js +3 -2
  40. package/lib/Color.cjs +1 -1
  41. package/lib/Color.d.cts +26 -30
  42. package/lib/Color.d.ts +26 -30
  43. package/lib/Color.js +42 -74
  44. package/lib/Document.cjs +1 -1
  45. package/lib/Document.d.cts +25 -29
  46. package/lib/Document.d.ts +25 -29
  47. package/lib/Document.js +4 -8
  48. package/lib/{Drawer-BHkje8ys.js → Drawer-CaAfmqNo.js} +37 -35
  49. package/lib/{Drawer-5Q_-WRhc.cjs → Drawer-CdvCMSzN.cjs} +1 -1
  50. package/lib/Drawer.cjs +1 -1
  51. package/lib/Drawer.d.cts +25 -29
  52. package/lib/Drawer.d.ts +25 -29
  53. package/lib/Drawer.js +4 -4
  54. package/lib/Emoji.cjs +1 -1
  55. package/lib/Emoji.d.cts +28 -30
  56. package/lib/Emoji.d.ts +28 -30
  57. package/lib/Emoji.js +19795 -184
  58. package/lib/{Excalidraw-GUVW-IqC.cjs → Excalidraw-BbMQhNvs.cjs} +1 -1
  59. package/lib/{Excalidraw-CG498239.js → Excalidraw-CVWz2Vyn.js} +20 -20
  60. package/lib/Excalidraw.cjs +1 -1
  61. package/lib/Excalidraw.d.cts +25 -29
  62. package/lib/Excalidraw.d.ts +25 -29
  63. package/lib/Excalidraw.js +3 -3
  64. package/lib/ExportPdf.cjs +1 -1
  65. package/lib/ExportPdf.d.cts +25 -29
  66. package/lib/ExportPdf.d.ts +25 -29
  67. package/lib/ExportPdf.js +4 -2
  68. package/lib/ExportWord.cjs +1 -1
  69. package/lib/ExportWord.d.cts +25 -29
  70. package/lib/ExportWord.d.ts +25 -29
  71. package/lib/ExportWord.js +22 -51
  72. package/lib/FontFamily.cjs +1 -1
  73. package/lib/FontFamily.d.cts +26 -30
  74. package/lib/FontFamily.d.ts +26 -30
  75. package/lib/FontFamily.js +44 -73
  76. package/lib/FontSize.cjs +1 -1
  77. package/lib/FontSize.d.cts +25 -29
  78. package/lib/FontSize.d.ts +25 -29
  79. package/lib/FontSize.js +7 -5
  80. package/lib/FormatPainter.cjs +1 -1
  81. package/lib/FormatPainter.d.cts +25 -29
  82. package/lib/FormatPainter.d.ts +25 -29
  83. package/lib/FormatPainter.js +4 -2
  84. package/lib/Heading.cjs +1 -1
  85. package/lib/Heading.d.cts +25 -29
  86. package/lib/Heading.d.ts +25 -29
  87. package/lib/Heading.js +71 -60
  88. package/lib/Highlight.cjs +1 -1
  89. package/lib/Highlight.d.cts +25 -29
  90. package/lib/Highlight.d.ts +25 -29
  91. package/lib/Highlight.js +5 -4
  92. package/lib/History.cjs +1 -1
  93. package/lib/History.d.cts +27 -31
  94. package/lib/History.d.ts +27 -31
  95. package/lib/History.js +39 -403
  96. package/lib/HorizontalRule.cjs +1 -1
  97. package/lib/HorizontalRule.d.cts +25 -29
  98. package/lib/HorizontalRule.d.ts +25 -29
  99. package/lib/HorizontalRule.js +16 -65
  100. package/lib/Iframe.cjs +1 -1
  101. package/lib/Iframe.d.cts +25 -29
  102. package/lib/Iframe.d.ts +25 -29
  103. package/lib/Iframe.js +4 -4
  104. package/lib/Image.cjs +1 -1
  105. package/lib/Image.d.cts +25 -29
  106. package/lib/Image.d.ts +25 -29
  107. package/lib/Image.js +3 -3
  108. package/lib/ImageGif.cjs +1 -1
  109. package/lib/ImageGif.d.cts +25 -29
  110. package/lib/ImageGif.d.ts +25 -29
  111. package/lib/ImageGif.js +5 -5
  112. package/lib/ImportWord.cjs +72 -72
  113. package/lib/ImportWord.d.cts +25 -29
  114. package/lib/ImportWord.d.ts +25 -29
  115. package/lib/ImportWord.js +5652 -5615
  116. package/lib/Indent.cjs +1 -1
  117. package/lib/Indent.d.cts +25 -29
  118. package/lib/Indent.d.ts +25 -29
  119. package/lib/Indent.js +4 -2
  120. package/lib/Italic.cjs +1 -1
  121. package/lib/Italic.d.cts +25 -29
  122. package/lib/Italic.d.ts +25 -29
  123. package/lib/Italic.js +20 -14
  124. package/lib/Katex.cjs +1 -1
  125. package/lib/Katex.d.cts +25 -29
  126. package/lib/Katex.d.ts +25 -29
  127. package/lib/Katex.js +12 -12
  128. package/lib/LineHeight.cjs +1 -1
  129. package/lib/LineHeight.d.cts +25 -29
  130. package/lib/LineHeight.d.ts +25 -29
  131. package/lib/LineHeight.js +5 -3
  132. package/lib/Link.cjs +1 -1
  133. package/lib/Link.d.cts +25 -29
  134. package/lib/Link.d.ts +25 -29
  135. package/lib/Link.js +4 -4
  136. package/lib/ListItem.cjs +1 -1
  137. package/lib/ListItem.d.cts +30 -30
  138. package/lib/ListItem.d.ts +30 -30
  139. package/lib/ListItem.js +4 -30
  140. package/lib/Mention.cjs +1 -1
  141. package/lib/Mention.d.cts +25 -29
  142. package/lib/Mention.d.ts +25 -29
  143. package/lib/Mention.js +161 -132
  144. package/lib/Mermaid.cjs +2 -2
  145. package/lib/Mermaid.d.cts +25 -29
  146. package/lib/Mermaid.d.ts +25 -29
  147. package/lib/Mermaid.js +50 -48
  148. package/lib/MoreMark.cjs +1 -1
  149. package/lib/MoreMark.d.cts +25 -29
  150. package/lib/MoreMark.d.ts +25 -29
  151. package/lib/MoreMark.js +5 -3
  152. package/lib/MultiColumn.cjs +1 -1
  153. package/lib/MultiColumn.d.cts +25 -29
  154. package/lib/MultiColumn.d.ts +25 -29
  155. package/lib/MultiColumn.js +2 -2
  156. package/lib/OrderedList.cjs +1 -1
  157. package/lib/OrderedList.d.cts +26 -30
  158. package/lib/OrderedList.d.ts +26 -30
  159. package/lib/OrderedList.js +11 -75
  160. package/lib/RichTextEditor-CxvwGvQG.cjs +142 -0
  161. package/lib/RichTextEditor-DGcKEUGr.js +22166 -0
  162. package/lib/SearchAndReplace.cjs +1 -1
  163. package/lib/SearchAndReplace.d.cts +38 -112
  164. package/lib/SearchAndReplace.d.ts +38 -112
  165. package/lib/SearchAndReplace.js +204 -192
  166. package/lib/Selection.cjs +1 -1
  167. package/lib/Selection.d.cts +25 -29
  168. package/lib/Selection.d.ts +25 -29
  169. package/lib/Selection.js +1 -1
  170. package/lib/SlashCommand.cjs +1 -1
  171. package/lib/SlashCommand.d.cts +25 -29
  172. package/lib/SlashCommand.d.ts +25 -29
  173. package/lib/SlashCommand.js +178 -223
  174. package/lib/Strike.cjs +1 -1
  175. package/lib/Strike.d.cts +25 -29
  176. package/lib/Strike.d.ts +25 -29
  177. package/lib/Strike.js +20 -14
  178. package/lib/SubAndSuperScript.cjs +1 -1
  179. package/lib/SubAndSuperScript.d.cts +25 -29
  180. package/lib/SubAndSuperScript.d.ts +25 -29
  181. package/lib/SubAndSuperScript.js +5 -3
  182. package/lib/Table.cjs +8 -10
  183. package/lib/Table.d.cts +28 -32
  184. package/lib/Table.d.ts +28 -32
  185. package/lib/Table.js +382 -2022
  186. package/lib/TableOfContent.cjs +1 -1
  187. package/lib/TableOfContent.d.cts +25 -29
  188. package/lib/TableOfContent.d.ts +25 -29
  189. package/lib/TableOfContent.js +5 -5
  190. package/lib/TaskList.cjs +1 -1
  191. package/lib/TaskList.d.cts +27 -31
  192. package/lib/TaskList.d.ts +27 -31
  193. package/lib/TaskList.js +12 -154
  194. package/lib/TextAlign.cjs +1 -1
  195. package/lib/TextAlign.d.cts +25 -29
  196. package/lib/TextAlign.d.ts +25 -29
  197. package/lib/TextAlign.js +11 -9
  198. package/lib/TextBubble.cjs +1 -1
  199. package/lib/TextBubble.d.cts +25 -29
  200. package/lib/TextBubble.d.ts +25 -29
  201. package/lib/TextBubble.js +5 -3
  202. package/lib/TextDirection.cjs +1 -1
  203. package/lib/TextDirection.d.cts +25 -29
  204. package/lib/TextDirection.d.ts +25 -29
  205. package/lib/TextDirection.js +2 -3
  206. package/lib/TextUnderline.cjs +1 -1
  207. package/lib/TextUnderline.d.cts +25 -29
  208. package/lib/TextUnderline.d.ts +25 -29
  209. package/lib/TextUnderline.js +40 -12
  210. package/lib/TrailingNode.cjs +1 -1
  211. package/lib/TrailingNode.d.cts +25 -29
  212. package/lib/TrailingNode.d.ts +25 -29
  213. package/lib/TrailingNode.js +1 -1
  214. package/lib/Twitter-BFULyqdR.js +1628 -0
  215. package/lib/Twitter-Cutpkh3h.cjs +1 -0
  216. package/lib/Twitter.cjs +1 -1
  217. package/lib/Twitter.d.cts +25 -29
  218. package/lib/Twitter.d.ts +25 -29
  219. package/lib/Twitter.js +3 -3
  220. package/lib/Video.cjs +1 -1
  221. package/lib/Video.d.cts +25 -29
  222. package/lib/Video.d.ts +25 -29
  223. package/lib/Video.js +3 -3
  224. package/lib/bubble-extra.cjs +2 -2
  225. package/lib/bubble-extra.d.cts +25 -29
  226. package/lib/bubble-extra.d.ts +25 -29
  227. package/lib/bubble-extra.js +200 -192
  228. package/lib/dom-dataset-_6-diIRQ.cjs +33 -0
  229. package/lib/dom-dataset-lYeH6gfI.js +2361 -0
  230. package/lib/index-5iBZLua9.cjs +12 -0
  231. package/lib/index-6D1J-A-o.cjs +1 -0
  232. package/lib/index-B96Cclrj.cjs +3 -0
  233. package/lib/index-BBz7Nmv9.js +55 -0
  234. package/lib/index-BeCTd5v2.cjs +1 -0
  235. package/lib/index-ByurDDMv.js +237 -0
  236. package/lib/index-CUogRI7j.cjs +1 -0
  237. package/lib/index-Ch6dBBad.js +709 -0
  238. package/lib/index-DF2Lp4HZ.cjs +100 -0
  239. package/lib/{index-LUL9mqY4.js → index-D_L6n8O8.js} +4 -4
  240. package/lib/index-Dbvi-Bvh.cjs +1 -0
  241. package/lib/index-DpCrt7xs.cjs +1 -0
  242. package/lib/index-DsAX1Vq8.cjs +1 -0
  243. package/lib/index-Dy4DlW9o.js +12 -0
  244. package/lib/index-J3jHHZ4d.js +200 -0
  245. package/lib/{index-CsK90iVd.js → index-LmrOdnen.js} +302 -389
  246. package/lib/index-VvXaaKe3.js +898 -0
  247. package/lib/index-kbO3iWqL.js +13432 -0
  248. package/lib/index.cjs +1 -2
  249. package/lib/index.d.cts +26 -229
  250. package/lib/index.d.ts +26 -229
  251. package/lib/index.js +2 -588
  252. package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
  253. package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
  254. package/lib/locale-bundle.cjs +1 -1
  255. package/lib/locale-bundle.d.cts +25 -29
  256. package/lib/locale-bundle.d.ts +25 -29
  257. package/lib/locale-bundle.js +1 -1
  258. package/lib/style.css +1 -1
  259. package/lib/{textarea-DdH64g04.cjs → textarea-DFo_aXnj.cjs} +1 -1
  260. package/lib/{textarea-CktfkXNe.js → textarea-aPtytkDx.js} +1 -1
  261. package/package.json +76 -70
  262. package/lib/RichTextEditor-DWlLqTl9.cjs +0 -140
  263. package/lib/RichTextEditor-KP2Rgcqe.js +0 -12751
  264. package/lib/Twitter-99ivY5qv.js +0 -1744
  265. package/lib/Twitter-BvfvUtNT.cjs +0 -17
  266. package/lib/dom-dataset-Byuf1YmW.cjs +0 -33
  267. package/lib/dom-dataset-Di3tIRrR.js +0 -1031
  268. package/lib/index-BI-IcZcN.cjs +0 -1
  269. package/lib/index-ByRfqzMr.cjs +0 -89
  270. package/lib/index-C1fzuXpN.js +0 -46
  271. package/lib/index-CbQQFj2T.js +0 -133
  272. package/lib/index-DI9T3iLd.js +0 -12354
  273. package/lib/index-D_A0TBRA.cjs +0 -1
  274. package/lib/index-DclQSrIx.cjs +0 -1
  275. package/lib/index-Z4b9rzn-.cjs +0 -1
@@ -0,0 +1,481 @@
1
+ import { CharacterCountOptions } from '@tiptap/extensions';
2
+ import { DropcursorOptions } from '@tiptap/extensions';
3
+ import { Editor } from '@tiptap/react';
4
+ import { Extension } from '@tiptap/core';
5
+ import { FocusOptions as FocusOptions_2 } from '@tiptap/extensions';
6
+ import { HardBreakOptions } from '@tiptap/extension-hard-break';
7
+ import { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule';
8
+ import { ListItemOptions } from '@tiptap/extension-list';
9
+ import { ListKeymapOptions } from '@tiptap/extension-list';
10
+ import { OrderedListOptions } from '@tiptap/extension-list';
11
+ import { ParagraphOptions } from '@tiptap/extension-paragraph';
12
+ import { PlaceholderOptions } from '@tiptap/extensions';
13
+ import { StrikeOptions } from '@tiptap/extension-strike';
14
+ import { TextStyleOptions } from '@tiptap/extension-text-style';
15
+ import { TrailingNodeOptions } from '@tiptap/extensions';
16
+
17
+ export declare const BaseKit: Extension<BaseKitOptions, any>;
18
+
19
+ /**
20
+ * Represents the interface for options in the base toolkit.
21
+ */
22
+ export declare interface BaseKitOptions {
23
+ /**
24
+ * Whether to enable the document option
25
+ *
26
+ * @default false
27
+ */
28
+ multiColumn?: boolean;
29
+ /**
30
+ * character count options or false, indicating whether to enable character count
31
+ *
32
+ * @default true
33
+ */
34
+ characterCount: Partial<CharacterCountOptions> | false;
35
+ /**
36
+ * selection options or false, indicating whether to enable the selection
37
+ *
38
+ * @default true
39
+ */
40
+ selection: any | false;
41
+ /**
42
+ * Focus options or false, indicating whether to enable focus functionality
43
+ *
44
+ * @default true
45
+ */
46
+ focus: Partial<FocusOptions_2> | false;
47
+ /**
48
+ * Placeholder options or false, indicating whether to enable placeholders
49
+ *
50
+ * @default true
51
+ */
52
+ placeholder: Partial<PlaceholderOptions> | false;
53
+ /**
54
+ * textBubble options or false, indicating whether to enable the textBubble
55
+ *
56
+ * @default true
57
+ */
58
+ textBubble: Partial<TextBubbleOptions> | false;
59
+ /**
60
+ * Text Style options or false, indicating whether to enable text style functionality
61
+ *
62
+ * @default true
63
+ */
64
+ textStyle: Partial<TextStyleOptions> | false;
65
+ /**
66
+ * If set to false, the document extension will not be registered
67
+ * @example document: false
68
+ */
69
+ document: false;
70
+ /**
71
+ * If set to false, the dropcursor extension will not be registered
72
+ * @example dropcursor: false
73
+ */
74
+ dropcursor: Partial<DropcursorOptions> | false;
75
+ /**
76
+ * If set to false, the gapcursor extension will not be registered
77
+ * @example gapcursor: false
78
+ */
79
+ gapcursor: false;
80
+ /**
81
+ * If set to false, the hardBreak extension will not be registered
82
+ * @example hardBreak: false
83
+ */
84
+ hardBreak: Partial<HardBreakOptions> | false;
85
+ /**
86
+ * If set to false, the horizontalRule extension will not be registered
87
+ * @example horizontalRule: false
88
+ */
89
+ horizontalRule: Partial<HorizontalRuleOptions> | false;
90
+ /**
91
+ * If set to false, the listItem extension will not be registered
92
+ * @example listItem: false
93
+ */
94
+ listItem: Partial<ListItemOptions> | false;
95
+ /**
96
+ * If set to false, the listItemKeymap extension will not be registered
97
+ * @example listKeymap: false
98
+ */
99
+ listKeymap: Partial<ListKeymapOptions> | false;
100
+ /**
101
+ * If set to false, the orderedList extension will not be registered
102
+ * @example orderedList: false
103
+ */
104
+ orderedList: Partial<OrderedListOptions> | false;
105
+ /**
106
+ * If set to false, the paragraph extension will not be registered
107
+ * @example paragraph: false
108
+ */
109
+ paragraph: Partial<ParagraphOptions> | false;
110
+ /**
111
+ * If set to false, the strike extension will not be registered
112
+ * @example strike: false
113
+ */
114
+ strike: Partial<StrikeOptions> | false;
115
+ /**
116
+ * If set to false, the text extension will not be registered
117
+ * @example text: false
118
+ */
119
+ text: false;
120
+ /**
121
+ * If set to false, the trailingNode extension will not be registered
122
+ * @example trailingNode: false
123
+ */
124
+ trailingNode: Partial<TrailingNodeOptions> | false;
125
+ }
126
+
127
+ /**
128
+ * Represents the ButtonView function.
129
+ */
130
+ declare type ButtonView<T = any> = (options: ButtonViewParams<T>) => ButtonViewReturn | ButtonViewReturn[];
131
+
132
+ /**
133
+ * Represents the parameters for the ButtonView function.
134
+ */
135
+ declare interface ButtonViewParams<T = any> {
136
+ /** Editor object */
137
+ editor: Editor;
138
+ /** Extension object */
139
+ extension: Extension<T>;
140
+ /** Translation function */
141
+ t: (path: string) => string;
142
+ }
143
+
144
+ /**
145
+ * Represents the return value for the ButtonView component.
146
+ */
147
+ declare interface ButtonViewReturn {
148
+ /** Component */
149
+ component: unknown;
150
+ /** Component props */
151
+ componentProps: ButtonViewReturnComponentProps;
152
+ /** Component slots */
153
+ componentSlots?: ButtonViewReturnComponentSlots;
154
+ }
155
+
156
+ /**
157
+ * Represents the props for the ButtonView component.
158
+ */
159
+ declare interface ButtonViewReturnComponentProps {
160
+ /** Method triggered when action is performed */
161
+ action?: (value?: any) => void;
162
+ /** Whether it is in the active state */
163
+ isActive?: () => boolean;
164
+ /** Button icon */
165
+ icon?: any;
166
+ /** Text displayed on hover */
167
+ tooltip?: string;
168
+ [x: string]: any;
169
+ }
170
+
171
+ /**
172
+ * Represents the slots for the ButtonView component.
173
+ */
174
+ declare interface ButtonViewReturnComponentSlots {
175
+ /** Dialog slot */
176
+ dialog: () => any;
177
+ [x: string]: () => any;
178
+ }
179
+
180
+ /**
181
+ * Represents the general options for Tiptap extensions.
182
+ */
183
+ declare interface GeneralOptions<T> {
184
+ /** Enabled divider */
185
+ divider: boolean;
186
+ /** Enabled spacer */
187
+ spacer: boolean;
188
+ /** Button view function */
189
+ button: ButtonView<T>;
190
+ /** Show on Toolbar */
191
+ toolbar?: boolean;
192
+ /** Shortcut keys override */
193
+ shortcutKeys?: string[] | string[][];
194
+ }
195
+
196
+ declare interface TextBubbleOptions extends GeneralOptions<TextBubbleOptions> {
197
+ }
198
+
199
+ export { }
200
+
201
+
202
+ declare module '@tiptap/core' {
203
+ interface Commands<ReturnType> {
204
+ attachment: {
205
+ setAttachment: (attrs?: unknown) => ReturnType;
206
+ };
207
+ }
208
+ }
209
+
210
+
211
+ declare module '@tiptap/core' {
212
+ interface Commands<ReturnType> {
213
+ setCodeBlock: {
214
+ setCodeBlock: (options?: any) => ReturnType;
215
+ };
216
+ }
217
+ }
218
+
219
+
220
+ declare module '@tiptap/core' {
221
+ interface Commands<ReturnType> {
222
+ codeView: {
223
+ /**
224
+ * Toggle code view mode
225
+ */
226
+ toggleCodeView: () => ReturnType;
227
+ };
228
+ }
229
+ }
230
+
231
+
232
+ declare module '@tiptap/core' {
233
+ interface Commands<ReturnType> {
234
+ drawer: {
235
+ setDrawer: (options: any, replace?: any) => ReturnType;
236
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
237
+ };
238
+ }
239
+ }
240
+
241
+
242
+ declare module '@tiptap/core' {
243
+ interface Commands<ReturnType> {
244
+ excalidraw: {
245
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
246
+ };
247
+ }
248
+ }
249
+
250
+
251
+ declare module '@tiptap/core' {
252
+ interface Commands<ReturnType> {
253
+ exportPdf: {
254
+ exportToPdf: () => ReturnType;
255
+ };
256
+ }
257
+ }
258
+
259
+
260
+ declare module '@tiptap/core' {
261
+ interface Commands<ReturnType> {
262
+ exportWord: {
263
+ exportToWord: () => ReturnType;
264
+ };
265
+ }
266
+ }
267
+
268
+
269
+ declare module '@tiptap/core' {
270
+ interface Commands<ReturnType> {
271
+ fontSize: {
272
+ /**
273
+ * Set the text font size. ex: "12px", "2em", or "small". Must be a valid
274
+ * CSS font-size
275
+ * (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
276
+ */
277
+ setFontSize: (fontSize: string) => ReturnType;
278
+ /**
279
+ * Unset the font size
280
+ */
281
+ unsetFontSize: () => ReturnType;
282
+ };
283
+ }
284
+ }
285
+
286
+
287
+ declare module '@tiptap/core' {
288
+ interface Commands<ReturnType> {
289
+ painter: {
290
+ setPainter: (marks: Mark[]) => ReturnType;
291
+ };
292
+ }
293
+ }
294
+
295
+
296
+ declare module '@tiptap/core' {
297
+ interface Commands<ReturnType> {
298
+ iframe: {
299
+ /**
300
+ * Add an iframe
301
+ */
302
+ setIframe: (options: {
303
+ src: string;
304
+ service: string;
305
+ }) => ReturnType;
306
+ };
307
+ }
308
+ }
309
+
310
+
311
+ declare module '@tiptap/core' {
312
+ interface Commands<ReturnType> {
313
+ imageUpload: {
314
+ /**
315
+ * Add an image
316
+ */
317
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
318
+ /**
319
+ * Update an image
320
+ */
321
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
322
+ /**
323
+ * Set image alignment
324
+ */
325
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
326
+ };
327
+ }
328
+ }
329
+
330
+
331
+ declare module '@tiptap/core' {
332
+ interface Commands<ReturnType> {
333
+ indent: {
334
+ /**
335
+ * Set the indent attribute
336
+ */
337
+ indent: () => ReturnType;
338
+ /**
339
+ * Set the outdent attribute
340
+ */
341
+ outdent: () => ReturnType;
342
+ };
343
+ }
344
+ }
345
+
346
+
347
+ declare module '@tiptap/core' {
348
+ interface Commands<ReturnType> {
349
+ imageGifUpload: {
350
+ /**
351
+ * Add an image gif
352
+ */
353
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
354
+ /**
355
+ * Update an image gif
356
+ */
357
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
358
+ /**
359
+ * Set image alignment
360
+ */
361
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
362
+ };
363
+ }
364
+ }
365
+
366
+
367
+ declare module '@tiptap/core' {
368
+ interface Commands<ReturnType> {
369
+ katex: {
370
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
371
+ };
372
+ }
373
+ }
374
+
375
+
376
+ declare module '@tiptap/core' {
377
+ interface Commands<ReturnType> {
378
+ lineHeight: {
379
+ setLineHeight: (lineHeight: string) => ReturnType;
380
+ unsetLineHeight: () => ReturnType;
381
+ };
382
+ }
383
+ }
384
+
385
+
386
+ declare module '@tiptap/core' {
387
+ interface Commands<ReturnType> {
388
+ mermaid: {
389
+ setMermaid: (options: any, replace?: any) => ReturnType;
390
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
391
+ };
392
+ }
393
+ }
394
+
395
+
396
+ declare module '@tiptap/core' {
397
+ interface Commands<ReturnType> {
398
+ columns: {
399
+ insertColumns: (attrs?: {
400
+ cols: number;
401
+ }) => ReturnType;
402
+ addColBefore: () => ReturnType;
403
+ addColAfter: () => ReturnType;
404
+ deleteCol: () => ReturnType;
405
+ };
406
+ }
407
+ }
408
+
409
+
410
+ declare module '@tiptap/core' {
411
+ interface Commands<ReturnType> {
412
+ search: {
413
+ setSearchTerm: (searchTerm: string) => ReturnType;
414
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
415
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
416
+ resetIndex: () => ReturnType;
417
+ nextSearchResult: () => ReturnType;
418
+ previousSearchResult: () => ReturnType;
419
+ replace: () => ReturnType;
420
+ replaceAll: () => ReturnType;
421
+ };
422
+ }
423
+ }
424
+
425
+
426
+ declare module '@tiptap/core' {
427
+ interface Storage {
428
+ searchAndReplace: SearchAndReplaceStorage;
429
+ }
430
+ }
431
+
432
+
433
+ declare module '@tiptap/core' {
434
+ interface Commands<ReturnType> {
435
+ tableOfContents: {
436
+ setTableOfContents: () => ReturnType;
437
+ removeTableOfContents: () => ReturnType;
438
+ };
439
+ }
440
+ }
441
+
442
+
443
+ declare module '@tiptap/core' {
444
+ interface Commands<ReturnType> {
445
+ twitter: {
446
+ /**
447
+ * Insert a tweet
448
+ * @param options The tweet attributes
449
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
450
+ */
451
+ setTweet: (options: SetTweetOptions) => ReturnType;
452
+ updateTweet: (options: SetTweetOptions) => ReturnType;
453
+ };
454
+ }
455
+ }
456
+
457
+
458
+ declare module '@tiptap/core' {
459
+ interface Commands<ReturnType> {
460
+ video: {
461
+ /**
462
+ * Add an video
463
+ */
464
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
465
+ /**
466
+ * Update an video
467
+ */
468
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
469
+ };
470
+ }
471
+ }
472
+
473
+
474
+ declare module '@tiptap/core' {
475
+ interface Commands<ReturnType> {
476
+ tableCellBackground: {
477
+ setTableCellBackground: (color: string) => ReturnType;
478
+ unsetTableCellBackground: () => ReturnType;
479
+ };
480
+ }
481
+ }
package/lib/BaseKit.js ADDED
@@ -0,0 +1,132 @@
1
+ import { N as c, m, E as g } from "./index-kbO3iWqL.js";
2
+ import { D as k } from "./index-Dy4DlW9o.js";
3
+ import { H as M } from "./index-BBz7Nmv9.js";
4
+ import { L as x, b } from "./index-Ch6dBBad.js";
5
+ import { T as y } from "./index-ByurDDMv.js";
6
+ import { P as T, F as C, C as H, S as B, D as L, G as A, T as N } from "./index-VvXaaKe3.js";
7
+ import { G as S, J as w } from "./RichTextEditor-DGcKEUGr.js";
8
+ import { TextBubble as K } from "./TextBubble.js";
9
+ import { n as h } from "./index-LmrOdnen.js";
10
+ var v = c.create({
11
+ name: "hardBreak",
12
+ markdownTokenName: "br",
13
+ addOptions() {
14
+ return {
15
+ keepMarks: !0,
16
+ HTMLAttributes: {}
17
+ };
18
+ },
19
+ inline: !0,
20
+ group: "inline",
21
+ selectable: !1,
22
+ linebreakReplacement: !0,
23
+ parseHTML() {
24
+ return [{ tag: "br" }];
25
+ },
26
+ renderHTML({ HTMLAttributes: t }) {
27
+ return ["br", m(this.options.HTMLAttributes, t)];
28
+ },
29
+ renderText() {
30
+ return `
31
+ `;
32
+ },
33
+ renderMarkdown: () => `
34
+ `,
35
+ parseMarkdown: () => ({
36
+ type: "hardBreak"
37
+ }),
38
+ addCommands() {
39
+ return {
40
+ setHardBreak: () => ({ commands: t, chain: r, state: s, editor: e }) => t.first([
41
+ () => t.exitCode(),
42
+ () => t.command(() => {
43
+ const { selection: i, storedMarks: l } = s;
44
+ if (i.$from.parent.type.spec.isolating)
45
+ return !1;
46
+ const { keepMarks: a } = this.options, { splittableMarks: n } = e.extensionManager, o = l || i.$to.parentOffset && i.$from.marks();
47
+ return r().insertContent({ type: this.name }).command(({ tr: p, dispatch: u }) => {
48
+ if (u && o && a) {
49
+ const f = o.filter((d) => n.includes(d.type.name));
50
+ p.ensureMarks(f);
51
+ }
52
+ return !0;
53
+ }).run();
54
+ })
55
+ ])
56
+ };
57
+ },
58
+ addKeyboardShortcuts() {
59
+ return {
60
+ "Mod-Enter": () => this.editor.commands.setHardBreak(),
61
+ "Shift-Enter": () => this.editor.commands.setHardBreak()
62
+ };
63
+ }
64
+ }), E = c.create({
65
+ name: "paragraph",
66
+ priority: 1e3,
67
+ addOptions() {
68
+ return {
69
+ HTMLAttributes: {}
70
+ };
71
+ },
72
+ group: "block",
73
+ content: "inline*",
74
+ parseHTML() {
75
+ return [{ tag: "p" }];
76
+ },
77
+ renderHTML({ HTMLAttributes: t }) {
78
+ return ["p", m(this.options.HTMLAttributes, t), 0];
79
+ },
80
+ parseMarkdown: (t, r) => {
81
+ const s = t.tokens || [];
82
+ return s.length === 1 && s[0].type === "image" ? r.parseChildren([s[0]]) : r.createNode(
83
+ "paragraph",
84
+ void 0,
85
+ // no attributes for paragraph
86
+ r.parseInline(s)
87
+ );
88
+ },
89
+ renderMarkdown: (t, r) => !t || !Array.isArray(t.content) ? "" : r.renderChildren(t.content),
90
+ addCommands() {
91
+ return {
92
+ setParagraph: () => ({ commands: t }) => t.setNode(this.name)
93
+ };
94
+ },
95
+ addKeyboardShortcuts() {
96
+ return {
97
+ "Mod-Alt-0": () => this.editor.commands.setParagraph()
98
+ };
99
+ }
100
+ }), P = c.create({
101
+ name: "text",
102
+ group: "inline",
103
+ parseMarkdown: (t) => ({
104
+ type: "text",
105
+ text: t.text || ""
106
+ }),
107
+ renderMarkdown: (t) => t.text || ""
108
+ });
109
+ const j = /* @__PURE__ */ g.create({
110
+ name: "base-kit",
111
+ addExtensions() {
112
+ var r, s;
113
+ const t = [];
114
+ return this.options.placeholder !== !1 && t.push(
115
+ T.configure({
116
+ placeholder: ({ node: e, pos: i, editor: l }) => {
117
+ var a, n, o, p, u;
118
+ return ((a = e == null ? void 0 : e.type) == null ? void 0 : a.name) === "columns" || ((n = e == null ? void 0 : e.content) == null ? void 0 : n.size) !== 0 ? "" : ((o = e == null ? void 0 : e.type) == null ? void 0 : o.name) === "heading" ? `${h.t(`editor.heading.h${e.attrs.level}.tooltip`)}` : ((p = e == null ? void 0 : e.type) == null ? void 0 : p.name) === "codeBlock" || ((u = e == null ? void 0 : e.type) == null ? void 0 : u.name) === "table" ? "" : l.extensionManager.extensions.some((f) => f.name === "slashCommand") ? h.t("editor.slash") : i === 0 ? h.t("editor.content") : h.t("editor.content");
119
+ },
120
+ ...this.options.placeholder
121
+ })
122
+ ), this.options.focus !== !1 && t.push(
123
+ C.configure({
124
+ className: "focus",
125
+ ...this.options.focus
126
+ })
127
+ ), this.options.textBubble !== !1 && t.push(K.configure()), this.options.characterCount !== !1 && t.push(H.configure(this.options.characterCount)), this.options.textStyle !== !1 && t.push(y.configure(this.options.textStyle)), this.options.selection !== !1 && t.push(B), this.options.multiColumn !== !1 && t.push(S, w), this.options.document !== !1 && t.push(k.configure(this.options.document)), this.options.dropcursor !== !1 && t.push(L.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && t.push(A.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && t.push(v.configure(this.options.hardBreak)), this.options.horizontalRule !== !1 && t.push(M.configure(this.options.horizontalRule)), this.options.listItem !== !1 && t.push(x.configure(this.options.listItem)), this.options.listKeymap !== !1 && t.push(b.configure((r = this.options) == null ? void 0 : r.listKeymap)), this.options.paragraph !== !1 && t.push(E.configure(this.options.paragraph)), this.options.text !== !1 && t.push(P.configure(this.options.text)), this.options.trailingNode !== !1 && t.push(N.configure((s = this.options) == null ? void 0 : s.trailingNode)), t;
128
+ }
129
+ });
130
+ export {
131
+ j as BaseKit
132
+ };
@@ -1 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-ByRfqzMr.cjs"),u=require("./RichTextEditor-DWlLqTl9.cjs"),s=/^\s*>\s$/,c=o.Node.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",o.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[o.wrappingInputRule({find:s,type:this.type})]}}),i=c.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:n,extension:r})=>({component:u.ActionButton,componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote")||!1,disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:r.options.shortcutKeys??["shift","mod","B"],tooltip:n("editor.blockquote.tooltip")}})}}});exports.Blockquote=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-DF2Lp4HZ.cjs"),s=require("./jsx-runtime-C_NLcKys.cjs"),l=require("./RichTextEditor-CxvwGvQG.cjs");var a=/^\s*>\s$/,d=r.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return s.h("blockquote",{...r.mergeAttributes(this.options.HTMLAttributes,t),children:s.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(u=>{const c=e.renderChildren([u]).split(`
2
+ `).map(i=>i.trim()===""?o:`${o} ${i}`);n.push(c.join(`
3
+ `))}),n.join(`
4
+ ${o}
5
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[r.wrappingInputRule({find:a,type:this.type})]}});const p=d.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:o,extension:n})=>({component:l.ActionButton,componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote")||!1,disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:n.options.shortcutKeys??["shift","mod","B"],tooltip:o("editor.blockquote.tooltip")}})}}});exports.Blockquote=p;