reactjs-tiptap-editor 0.4.1 → 1.0.0

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 (338) hide show
  1. package/lib/ActionMenuButton-BKOg7hkq.js +38 -0
  2. package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.d.cts +43 -55
  5. package/lib/Attachment.d.ts +43 -55
  6. package/lib/Attachment.js +129 -99
  7. package/lib/Blockquote.cjs +3 -3
  8. package/lib/Blockquote.d.cts +43 -55
  9. package/lib/Blockquote.d.ts +43 -55
  10. package/lib/Blockquote.js +50 -22
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +43 -55
  13. package/lib/Bold.d.ts +43 -55
  14. package/lib/Bold.js +48 -20
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +43 -55
  17. package/lib/BulletList.d.ts +43 -55
  18. package/lib/BulletList.js +38 -9
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +43 -55
  21. package/lib/Clear.d.ts +43 -55
  22. package/lib/Clear.js +32 -6
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +43 -55
  25. package/lib/Code.d.ts +43 -55
  26. package/lib/Code.js +53 -25
  27. package/lib/CodeBlock.cjs +35 -35
  28. package/lib/CodeBlock.d.cts +43 -55
  29. package/lib/CodeBlock.d.ts +43 -55
  30. package/lib/CodeBlock.js +605 -590
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +44 -56
  33. package/lib/CodeView.d.ts +44 -56
  34. package/lib/CodeView.js +49 -21
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +47 -55
  37. package/lib/Color.d.ts +47 -55
  38. package/lib/Color.js +123 -79
  39. package/lib/Column.cjs +1 -0
  40. package/lib/{Document.d.cts → Column.d.cts} +49 -58
  41. package/lib/{Document.d.ts → Column.d.ts} +49 -58
  42. package/lib/Column.js +217 -0
  43. package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
  44. package/lib/Drawer-SRhwOc6T.cjs +1 -0
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +43 -55
  47. package/lib/Drawer.d.ts +43 -55
  48. package/lib/Drawer.js +6 -5
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +43 -60
  51. package/lib/Emoji.d.ts +43 -60
  52. package/lib/Emoji.js +377 -392
  53. package/lib/Excalidraw-DwBRXEtC.js +345 -0
  54. package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +43 -55
  57. package/lib/Excalidraw.d.ts +43 -55
  58. package/lib/Excalidraw.js +6 -4
  59. package/lib/ExportPdf.cjs +5 -5
  60. package/lib/ExportPdf.d.cts +43 -55
  61. package/lib/ExportPdf.d.ts +43 -55
  62. package/lib/ExportPdf.js +60 -32
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +44 -56
  65. package/lib/ExportWord.d.ts +44 -56
  66. package/lib/ExportWord.js +84 -21
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +57 -58
  69. package/lib/FontFamily.d.ts +57 -58
  70. package/lib/FontFamily.js +72 -74
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +54 -58
  73. package/lib/FontSize.d.ts +54 -58
  74. package/lib/FontSize.js +72 -64
  75. package/lib/Heading.cjs +1 -1
  76. package/lib/Heading.d.cts +57 -55
  77. package/lib/Heading.d.ts +57 -55
  78. package/lib/Heading.js +91 -73
  79. package/lib/Highlight.cjs +1 -1
  80. package/lib/Highlight.d.cts +47 -55
  81. package/lib/Highlight.d.ts +47 -55
  82. package/lib/Highlight.js +152 -21
  83. package/lib/History.cjs +1 -1
  84. package/lib/History.d.cts +45 -55
  85. package/lib/History.d.ts +45 -55
  86. package/lib/History.js +976 -53
  87. package/lib/HorizontalRule.cjs +1 -1
  88. package/lib/HorizontalRule.d.cts +43 -55
  89. package/lib/HorizontalRule.d.ts +43 -55
  90. package/lib/HorizontalRule.js +97 -17
  91. package/lib/Icon-DUpv2cI6.cjs +1 -0
  92. package/lib/Icon-jKs8Hr6p.js +11 -0
  93. package/lib/Iframe-CmXkEqOd.js +431 -0
  94. package/lib/Iframe-Cvca2G7X.cjs +1 -0
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +42 -61
  97. package/lib/Iframe.d.ts +42 -61
  98. package/lib/Iframe.js +6 -4
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +43 -56
  101. package/lib/Image.d.ts +43 -56
  102. package/lib/Image.js +848 -5
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +44 -58
  105. package/lib/ImageGif.d.ts +44 -58
  106. package/lib/ImageGif.js +424 -5
  107. package/lib/ImportWord.cjs +48 -48
  108. package/lib/ImportWord.d.cts +44 -56
  109. package/lib/ImportWord.d.ts +44 -56
  110. package/lib/ImportWord.js +2596 -2588
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +43 -55
  113. package/lib/Indent.d.ts +43 -55
  114. package/lib/Indent.js +97 -27
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +43 -55
  117. package/lib/Italic.d.ts +43 -55
  118. package/lib/Italic.js +47 -19
  119. package/lib/Katex-DsYXsjSS.js +2740 -0
  120. package/lib/Katex-XfrNne6U.cjs +4 -0
  121. package/lib/Katex.cjs +1 -1
  122. package/lib/Katex.d.cts +43 -55
  123. package/lib/Katex.d.ts +43 -55
  124. package/lib/Katex.js +5 -196
  125. package/lib/LineHeight.cjs +1 -1
  126. package/lib/LineHeight.d.cts +45 -61
  127. package/lib/LineHeight.d.ts +45 -61
  128. package/lib/LineHeight.js +71 -112
  129. package/lib/Link.cjs +1 -1
  130. package/lib/Link.d.cts +44 -58
  131. package/lib/Link.d.ts +44 -58
  132. package/lib/Link.js +3 -3
  133. package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
  134. package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +40 -55
  137. package/lib/Mention.d.ts +40 -55
  138. package/lib/Mention.js +114 -130
  139. package/lib/Mermaid.cjs +2 -2
  140. package/lib/Mermaid.d.cts +43 -55
  141. package/lib/Mermaid.d.ts +43 -55
  142. package/lib/Mermaid.js +177 -165
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +58 -57
  145. package/lib/MoreMark.d.ts +58 -57
  146. package/lib/MoreMark.js +125 -55
  147. package/lib/OrderedList.cjs +1 -1
  148. package/lib/OrderedList.d.cts +43 -55
  149. package/lib/OrderedList.d.ts +43 -55
  150. package/lib/OrderedList.js +37 -9
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +43 -58
  153. package/lib/SearchAndReplace.d.ts +43 -58
  154. package/lib/SearchAndReplace.js +221 -197
  155. package/lib/SlashCommand.cjs +1 -1
  156. package/lib/SlashCommand.d.cts +55 -62
  157. package/lib/SlashCommand.d.ts +55 -62
  158. package/lib/SlashCommand.js +235 -249
  159. package/lib/Strike.cjs +1 -1
  160. package/lib/Strike.d.cts +43 -55
  161. package/lib/Strike.d.ts +43 -55
  162. package/lib/Strike.js +39 -11
  163. package/lib/Table-B1j1Ebmh.cjs +9 -0
  164. package/lib/Table-Db8TcQX8.js +1984 -0
  165. package/lib/Table.cjs +1 -9
  166. package/lib/Table.d.cts +44 -58
  167. package/lib/Table.d.ts +44 -58
  168. package/lib/Table.js +3 -558
  169. package/lib/TaskList.cjs +1 -1
  170. package/lib/TaskList.d.cts +43 -55
  171. package/lib/TaskList.d.ts +43 -55
  172. package/lib/TaskList.js +38 -10
  173. package/lib/TextAlign.cjs +1 -1
  174. package/lib/TextAlign.d.cts +56 -55
  175. package/lib/TextAlign.d.ts +56 -55
  176. package/lib/TextAlign.js +108 -101
  177. package/lib/TextDirection.cjs +1 -1
  178. package/lib/TextDirection.d.cts +72 -55
  179. package/lib/TextDirection.d.ts +72 -55
  180. package/lib/TextDirection.js +105 -112
  181. package/lib/TextUnderline.cjs +1 -1
  182. package/lib/TextUnderline.d.cts +43 -55
  183. package/lib/TextUnderline.d.ts +43 -55
  184. package/lib/TextUnderline.js +46 -18
  185. package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
  186. package/lib/Twitter-CtVTIWJW.cjs +1 -0
  187. package/lib/Twitter.cjs +1 -1
  188. package/lib/Twitter.d.cts +43 -55
  189. package/lib/Twitter.d.ts +43 -55
  190. package/lib/Twitter.js +5 -4
  191. package/lib/Video.cjs +1 -1
  192. package/lib/Video.d.cts +43 -55
  193. package/lib/Video.d.ts +43 -55
  194. package/lib/Video.js +261 -4
  195. package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
  196. package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
  197. package/lib/bubble.cjs +2 -0
  198. package/lib/{bubble-extra.d.cts → bubble.d.cts} +69 -70
  199. package/lib/{bubble-extra.d.ts → bubble.d.ts} +69 -70
  200. package/lib/bubble.js +1925 -0
  201. package/lib/button-B12K7BJ4.cjs +1 -0
  202. package/lib/button-DXMsXUEn.js +43 -0
  203. package/lib/clsx-C11secjj.cjs +1 -0
  204. package/lib/clsx-OuTLNxxd.js +16 -0
  205. package/lib/delete-node-CosiBes5.cjs +1 -0
  206. package/lib/delete-node-IyVmiRbI.js +22 -0
  207. package/lib/dialog-CaCS-W5S.cjs +1 -0
  208. package/lib/dialog-PtQivpHS.js +100 -0
  209. package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
  210. package/lib/dom-dataset-CIEeltF6.js +47 -0
  211. package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
  212. package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
  213. package/lib/file-BLas99n7.js +43 -0
  214. package/lib/file-i7e4nQY2.cjs +1 -0
  215. package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
  216. package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
  217. package/lib/icons-Cllpys39.js +362 -0
  218. package/lib/icons-CqHjeW5T.cjs +1 -0
  219. package/lib/index-BH4bc3jN.cjs +33 -0
  220. package/lib/index-BPfVXs5_.js +2380 -0
  221. package/lib/index-Bnmd0WvY.js +1631 -0
  222. package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
  223. package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
  224. package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
  225. package/lib/index-DV5kbgRU.cjs +1 -0
  226. package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
  227. package/lib/index-Dfmm6FTT.cjs +1 -0
  228. package/lib/index-DnWWK9F_.js +6374 -0
  229. package/lib/index-DzcKxutn.js +632 -0
  230. package/lib/index-DzvuNTxo.cjs +4 -0
  231. package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
  232. package/lib/index-RfTlOzIr.cjs +22 -0
  233. package/lib/index.cjs +132 -1
  234. package/lib/index.d.cts +45 -296
  235. package/lib/index.d.ts +45 -296
  236. package/lib/index.js +243 -2
  237. package/lib/input-_ECRfn3Y.cjs +1 -0
  238. package/lib/input-wJ9PDEzZ.js +21 -0
  239. package/lib/isNumber-ClPupm7P.cjs +1 -0
  240. package/lib/isNumber-fpLGS0AZ.js +15 -0
  241. package/lib/label-BkgAe7IY.cjs +1 -0
  242. package/lib/label-CGdLYWv7.js +19 -0
  243. package/lib/locale-bundle.cjs +1 -1
  244. package/lib/locale-bundle.d.cts +5421 -73
  245. package/lib/locale-bundle.d.ts +5421 -73
  246. package/lib/locale-bundle.js +9 -7
  247. package/lib/popover-BgmUNMHj.cjs +1 -0
  248. package/lib/popover-CAuEW0Mr.js +23 -0
  249. package/lib/separator-CuBW_w98.js +328 -0
  250. package/lib/separator-DRIrVZ2N.cjs +1 -0
  251. package/lib/store-DX599H5W.js +10 -0
  252. package/lib/store-WStcMOiW.cjs +1 -0
  253. package/lib/style.css +1 -1
  254. package/lib/switch-CnLJ7Y-b.cjs +1 -0
  255. package/lib/switch-Coix_FA1.js +27 -0
  256. package/lib/tabs-B5mVSN1I.js +46 -0
  257. package/lib/tabs-BoLCMcCI.cjs +1 -0
  258. package/lib/textarea-B-6zTKQz.cjs +1 -0
  259. package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
  260. package/lib/theme-B7aAsK_T.js +15 -0
  261. package/lib/theme-D8_cxGqB.cjs +1 -0
  262. package/lib/throttle-CdwDrFpn.js +249 -0
  263. package/lib/throttle-qX7Yjtsg.cjs +1 -0
  264. package/lib/toggle-Cdp4IT2U.js +85 -0
  265. package/lib/toggle-D41PzQLJ.cjs +1 -0
  266. package/lib/tooltip-BuEiE96N.cjs +1 -0
  267. package/lib/tooltip-CopwsU8q.js +23 -0
  268. package/lib/updatePosition-8Sdem5jb.cjs +1 -0
  269. package/lib/updatePosition-BPmcE0YD.js +215 -0
  270. package/lib/use-toast-Bz3QCOtE.cjs +1 -0
  271. package/lib/use-toast-Crf7-q5H.js +98 -0
  272. package/lib/useButtonProps-BsEd4zYM.js +141 -0
  273. package/lib/useButtonProps-C6Vpn190.cjs +1 -0
  274. package/package.json +22 -105
  275. package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
  276. package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
  277. package/lib/BaseKit.cjs +0 -3
  278. package/lib/BaseKit.d.cts +0 -481
  279. package/lib/BaseKit.d.ts +0 -481
  280. package/lib/BaseKit.js +0 -132
  281. package/lib/Document.cjs +0 -1
  282. package/lib/Document.js +0 -9
  283. package/lib/Drawer-CdvCMSzN.cjs +0 -1
  284. package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
  285. package/lib/Excalidraw-CVWz2Vyn.js +0 -290
  286. package/lib/FormatPainter.cjs +0 -1
  287. package/lib/FormatPainter.d.cts +0 -372
  288. package/lib/FormatPainter.d.ts +0 -372
  289. package/lib/FormatPainter.js +0 -76
  290. package/lib/ListItem.cjs +0 -1
  291. package/lib/ListItem.d.cts +0 -290
  292. package/lib/ListItem.d.ts +0 -290
  293. package/lib/ListItem.js +0 -7
  294. package/lib/MultiColumn.cjs +0 -1
  295. package/lib/MultiColumn.d.cts +0 -294
  296. package/lib/MultiColumn.d.ts +0 -294
  297. package/lib/MultiColumn.js +0 -8
  298. package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
  299. package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
  300. package/lib/Selection.cjs +0 -1
  301. package/lib/Selection.d.cts +0 -289
  302. package/lib/Selection.d.ts +0 -289
  303. package/lib/Selection.js +0 -25
  304. package/lib/SubAndSuperScript.cjs +0 -1
  305. package/lib/SubAndSuperScript.d.cts +0 -377
  306. package/lib/SubAndSuperScript.d.ts +0 -377
  307. package/lib/SubAndSuperScript.js +0 -43
  308. package/lib/TableOfContent.cjs +0 -1
  309. package/lib/TableOfContent.d.cts +0 -291
  310. package/lib/TableOfContent.d.ts +0 -291
  311. package/lib/TableOfContent.js +0 -185
  312. package/lib/TextBubble.cjs +0 -1
  313. package/lib/TextBubble.d.cts +0 -362
  314. package/lib/TextBubble.d.ts +0 -362
  315. package/lib/TextBubble.js +0 -133
  316. package/lib/TrailingNode.cjs +0 -1
  317. package/lib/TrailingNode.d.cts +0 -297
  318. package/lib/TrailingNode.d.ts +0 -297
  319. package/lib/TrailingNode.js +0 -41
  320. package/lib/Twitter-Cutpkh3h.cjs +0 -1
  321. package/lib/bubble-extra.cjs +0 -2
  322. package/lib/bubble-extra.js +0 -631
  323. package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
  324. package/lib/dom-dataset-lYeH6gfI.js +0 -2361
  325. package/lib/index-6D1J-A-o.cjs +0 -1
  326. package/lib/index-B96Cclrj.cjs +0 -3
  327. package/lib/index-BBz7Nmv9.js +0 -55
  328. package/lib/index-CUogRI7j.cjs +0 -1
  329. package/lib/index-DF2Lp4HZ.cjs +0 -100
  330. package/lib/index-D_L6n8O8.js +0 -76
  331. package/lib/index-Dbvi-Bvh.cjs +0 -1
  332. package/lib/index-DpCrt7xs.cjs +0 -1
  333. package/lib/index-DsAX1Vq8.cjs +0 -1
  334. package/lib/index-Dy4DlW9o.js +0 -12
  335. package/lib/index-J3jHHZ4d.js +0 -200
  336. package/lib/index-VvXaaKe3.js +0 -898
  337. package/lib/index-kbO3iWqL.js +0 -13432
  338. package/lib/textarea-DFo_aXnj.cjs +0 -1
@@ -1,5 +1,7 @@
1
+ import { default as default_2 } from 'react';
1
2
  import { Editor } from '@tiptap/react';
2
3
  import { Extension } from '@tiptap/core';
4
+ import { JSX } from 'react/jsx-runtime';
3
5
  import { SubscriptExtensionOptions } from '@tiptap/extension-subscript';
4
6
  import { SuperscriptExtensionOptions } from '@tiptap/extension-superscript';
5
7
 
@@ -72,23 +74,37 @@ declare interface GeneralOptions<T> {
72
74
  shortcutKeys?: string[] | string[][];
73
75
  }
74
76
 
77
+ export declare interface Item {
78
+ title: string;
79
+ icon?: any;
80
+ isActive: NonNullable<ButtonViewReturnComponentProps['isActive']>;
81
+ action?: ButtonViewReturnComponentProps['action'];
82
+ style?: default_2.CSSProperties;
83
+ shortcutKeys?: string[];
84
+ disabled?: boolean;
85
+ divider?: boolean;
86
+ default?: boolean;
87
+ }
88
+
75
89
  export declare const MoreMark: Extension<MoreMarkOptions, any>;
76
90
 
77
91
  export declare interface MoreMarkOptions extends GeneralOptions<MoreMarkOptions> {
78
92
  /**
79
- * // 下标
93
+ * // options for Subscript Extension
80
94
  *
81
95
  * @default true
82
96
  */
83
97
  subscript: Partial<SubscriptExtensionOptions> | false;
84
98
  /**
85
- * // 上标
99
+ * // options for Superscript Extension
86
100
  *
87
101
  * @default true
88
102
  */
89
103
  superscript: Partial<SuperscriptExtensionOptions> | false;
90
104
  }
91
105
 
106
+ export declare function RichTextMoreMark(): JSX.Element;
107
+
92
108
  export { }
93
109
 
94
110
 
@@ -122,11 +138,22 @@ declare module '@tiptap/core' {
122
138
  }
123
139
 
124
140
 
141
+ declare module '@tiptap/core' {
142
+ interface Storage {
143
+ color: ColorStorage;
144
+ }
145
+ }
146
+
147
+
125
148
  declare module '@tiptap/core' {
126
149
  interface Commands<ReturnType> {
127
- drawer: {
128
- setDrawer: (options: any, replace?: any) => ReturnType;
129
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
150
+ columns: {
151
+ insertColumns: (attrs?: {
152
+ cols: number;
153
+ }) => ReturnType;
154
+ addColBefore: () => ReturnType;
155
+ addColAfter: () => ReturnType;
156
+ deleteCol: () => ReturnType;
130
157
  };
131
158
  }
132
159
  }
@@ -134,8 +161,9 @@ declare module '@tiptap/core' {
134
161
 
135
162
  declare module '@tiptap/core' {
136
163
  interface Commands<ReturnType> {
137
- excalidraw: {
138
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
164
+ drawer: {
165
+ setDrawer: (options: any, replace?: any) => ReturnType;
166
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
139
167
  };
140
168
  }
141
169
  }
@@ -153,7 +181,16 @@ declare module '@tiptap/core' {
153
181
  declare module '@tiptap/core' {
154
182
  interface Commands<ReturnType> {
155
183
  exportWord: {
156
- exportToWord: () => ReturnType;
184
+ exportToWord: (docState: any) => ReturnType;
185
+ };
186
+ }
187
+ }
188
+
189
+
190
+ declare module '@tiptap/core' {
191
+ interface Commands<ReturnType> {
192
+ excalidraw: {
193
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
157
194
  };
158
195
  }
159
196
  }
@@ -178,10 +215,8 @@ declare module '@tiptap/core' {
178
215
 
179
216
 
180
217
  declare module '@tiptap/core' {
181
- interface Commands<ReturnType> {
182
- painter: {
183
- setPainter: (marks: Mark[]) => ReturnType;
184
- };
218
+ interface Storage {
219
+ highlight: HighlightStorage;
185
220
  }
186
221
  }
187
222
 
@@ -221,22 +256,6 @@ declare module '@tiptap/core' {
221
256
  }
222
257
 
223
258
 
224
- declare module '@tiptap/core' {
225
- interface Commands<ReturnType> {
226
- indent: {
227
- /**
228
- * Set the indent attribute
229
- */
230
- indent: () => ReturnType;
231
- /**
232
- * Set the outdent attribute
233
- */
234
- outdent: () => ReturnType;
235
- };
236
- }
237
- }
238
-
239
-
240
259
  declare module '@tiptap/core' {
241
260
  interface Commands<ReturnType> {
242
261
  imageGifUpload: {
@@ -259,8 +278,15 @@ declare module '@tiptap/core' {
259
278
 
260
279
  declare module '@tiptap/core' {
261
280
  interface Commands<ReturnType> {
262
- katex: {
263
- setKatex: (arg?: IKatexAttrs) => ReturnType;
281
+ indent: {
282
+ /**
283
+ * Set the indent attribute
284
+ */
285
+ indent: () => ReturnType;
286
+ /**
287
+ * Set the outdent attribute
288
+ */
289
+ outdent: () => ReturnType;
264
290
  };
265
291
  }
266
292
  }
@@ -268,9 +294,8 @@ declare module '@tiptap/core' {
268
294
 
269
295
  declare module '@tiptap/core' {
270
296
  interface Commands<ReturnType> {
271
- lineHeight: {
272
- setLineHeight: (lineHeight: string) => ReturnType;
273
- unsetLineHeight: () => ReturnType;
297
+ katex: {
298
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
274
299
  };
275
300
  }
276
301
  }
@@ -286,20 +311,6 @@ declare module '@tiptap/core' {
286
311
  }
287
312
 
288
313
 
289
- declare module '@tiptap/core' {
290
- interface Commands<ReturnType> {
291
- columns: {
292
- insertColumns: (attrs?: {
293
- cols: number;
294
- }) => ReturnType;
295
- addColBefore: () => ReturnType;
296
- addColAfter: () => ReturnType;
297
- deleteCol: () => ReturnType;
298
- };
299
- }
300
- }
301
-
302
-
303
314
  declare module '@tiptap/core' {
304
315
  interface Commands<ReturnType> {
305
316
  search: {
@@ -323,16 +334,6 @@ declare module '@tiptap/core' {
323
334
  }
324
335
 
325
336
 
326
- declare module '@tiptap/core' {
327
- interface Commands<ReturnType> {
328
- tableOfContents: {
329
- setTableOfContents: () => ReturnType;
330
- removeTableOfContents: () => ReturnType;
331
- };
332
- }
333
- }
334
-
335
-
336
337
  declare module '@tiptap/core' {
337
338
  interface Commands<ReturnType> {
338
339
  twitter: {
package/lib/MoreMark.d.ts CHANGED
@@ -1,5 +1,7 @@
1
+ import { default as default_2 } from 'react';
1
2
  import { Editor } from '@tiptap/react';
2
3
  import { Extension } from '@tiptap/core';
4
+ import { JSX } from 'react/jsx-runtime';
3
5
  import { SubscriptExtensionOptions } from '@tiptap/extension-subscript';
4
6
  import { SuperscriptExtensionOptions } from '@tiptap/extension-superscript';
5
7
 
@@ -72,23 +74,37 @@ declare interface GeneralOptions<T> {
72
74
  shortcutKeys?: string[] | string[][];
73
75
  }
74
76
 
77
+ export declare interface Item {
78
+ title: string;
79
+ icon?: any;
80
+ isActive: NonNullable<ButtonViewReturnComponentProps['isActive']>;
81
+ action?: ButtonViewReturnComponentProps['action'];
82
+ style?: default_2.CSSProperties;
83
+ shortcutKeys?: string[];
84
+ disabled?: boolean;
85
+ divider?: boolean;
86
+ default?: boolean;
87
+ }
88
+
75
89
  export declare const MoreMark: Extension<MoreMarkOptions, any>;
76
90
 
77
91
  export declare interface MoreMarkOptions extends GeneralOptions<MoreMarkOptions> {
78
92
  /**
79
- * // 下标
93
+ * // options for Subscript Extension
80
94
  *
81
95
  * @default true
82
96
  */
83
97
  subscript: Partial<SubscriptExtensionOptions> | false;
84
98
  /**
85
- * // 上标
99
+ * // options for Superscript Extension
86
100
  *
87
101
  * @default true
88
102
  */
89
103
  superscript: Partial<SuperscriptExtensionOptions> | false;
90
104
  }
91
105
 
106
+ export declare function RichTextMoreMark(): JSX.Element;
107
+
92
108
  export { }
93
109
 
94
110
 
@@ -122,11 +138,22 @@ declare module '@tiptap/core' {
122
138
  }
123
139
 
124
140
 
141
+ declare module '@tiptap/core' {
142
+ interface Storage {
143
+ color: ColorStorage;
144
+ }
145
+ }
146
+
147
+
125
148
  declare module '@tiptap/core' {
126
149
  interface Commands<ReturnType> {
127
- drawer: {
128
- setDrawer: (options: any, replace?: any) => ReturnType;
129
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
150
+ columns: {
151
+ insertColumns: (attrs?: {
152
+ cols: number;
153
+ }) => ReturnType;
154
+ addColBefore: () => ReturnType;
155
+ addColAfter: () => ReturnType;
156
+ deleteCol: () => ReturnType;
130
157
  };
131
158
  }
132
159
  }
@@ -134,8 +161,9 @@ declare module '@tiptap/core' {
134
161
 
135
162
  declare module '@tiptap/core' {
136
163
  interface Commands<ReturnType> {
137
- excalidraw: {
138
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
164
+ drawer: {
165
+ setDrawer: (options: any, replace?: any) => ReturnType;
166
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
139
167
  };
140
168
  }
141
169
  }
@@ -153,7 +181,16 @@ declare module '@tiptap/core' {
153
181
  declare module '@tiptap/core' {
154
182
  interface Commands<ReturnType> {
155
183
  exportWord: {
156
- exportToWord: () => ReturnType;
184
+ exportToWord: (docState: any) => ReturnType;
185
+ };
186
+ }
187
+ }
188
+
189
+
190
+ declare module '@tiptap/core' {
191
+ interface Commands<ReturnType> {
192
+ excalidraw: {
193
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
157
194
  };
158
195
  }
159
196
  }
@@ -178,10 +215,8 @@ declare module '@tiptap/core' {
178
215
 
179
216
 
180
217
  declare module '@tiptap/core' {
181
- interface Commands<ReturnType> {
182
- painter: {
183
- setPainter: (marks: Mark[]) => ReturnType;
184
- };
218
+ interface Storage {
219
+ highlight: HighlightStorage;
185
220
  }
186
221
  }
187
222
 
@@ -221,22 +256,6 @@ declare module '@tiptap/core' {
221
256
  }
222
257
 
223
258
 
224
- declare module '@tiptap/core' {
225
- interface Commands<ReturnType> {
226
- indent: {
227
- /**
228
- * Set the indent attribute
229
- */
230
- indent: () => ReturnType;
231
- /**
232
- * Set the outdent attribute
233
- */
234
- outdent: () => ReturnType;
235
- };
236
- }
237
- }
238
-
239
-
240
259
  declare module '@tiptap/core' {
241
260
  interface Commands<ReturnType> {
242
261
  imageGifUpload: {
@@ -259,8 +278,15 @@ declare module '@tiptap/core' {
259
278
 
260
279
  declare module '@tiptap/core' {
261
280
  interface Commands<ReturnType> {
262
- katex: {
263
- setKatex: (arg?: IKatexAttrs) => ReturnType;
281
+ indent: {
282
+ /**
283
+ * Set the indent attribute
284
+ */
285
+ indent: () => ReturnType;
286
+ /**
287
+ * Set the outdent attribute
288
+ */
289
+ outdent: () => ReturnType;
264
290
  };
265
291
  }
266
292
  }
@@ -268,9 +294,8 @@ declare module '@tiptap/core' {
268
294
 
269
295
  declare module '@tiptap/core' {
270
296
  interface Commands<ReturnType> {
271
- lineHeight: {
272
- setLineHeight: (lineHeight: string) => ReturnType;
273
- unsetLineHeight: () => ReturnType;
297
+ katex: {
298
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
274
299
  };
275
300
  }
276
301
  }
@@ -286,20 +311,6 @@ declare module '@tiptap/core' {
286
311
  }
287
312
 
288
313
 
289
- declare module '@tiptap/core' {
290
- interface Commands<ReturnType> {
291
- columns: {
292
- insertColumns: (attrs?: {
293
- cols: number;
294
- }) => ReturnType;
295
- addColBefore: () => ReturnType;
296
- addColAfter: () => ReturnType;
297
- deleteCol: () => ReturnType;
298
- };
299
- }
300
- }
301
-
302
-
303
314
  declare module '@tiptap/core' {
304
315
  interface Commands<ReturnType> {
305
316
  search: {
@@ -323,16 +334,6 @@ declare module '@tiptap/core' {
323
334
  }
324
335
 
325
336
 
326
- declare module '@tiptap/core' {
327
- interface Commands<ReturnType> {
328
- tableOfContents: {
329
- setTableOfContents: () => ReturnType;
330
- removeTableOfContents: () => ReturnType;
331
- };
332
- }
333
- }
334
-
335
-
336
337
  declare module '@tiptap/core' {
337
338
  interface Commands<ReturnType> {
338
339
  twitter: {
package/lib/MoreMark.js CHANGED
@@ -1,57 +1,125 @@
1
- import { E as m } from "./index-kbO3iWqL.js";
2
- import { S as f, a as b } from "./index-D_L6n8O8.js";
3
- import { jsxs as h, jsx as s } from "react/jsx-runtime";
4
- import { useMemo as x } from "react";
5
- import { D as g, h as M, A as y, M as S, j as k, k as A, f as w, g as v } from "./RichTextEditor-DGcKEUGr.js";
6
- function K(t) {
7
- var c;
8
- const e = x(() => {
9
- var o;
10
- const i = (o = t == null ? void 0 : t.items) == null ? void 0 : o.find((a) => a.isActive());
11
- return i && !i.default ? {
12
- ...i,
13
- icon: i != null && i.icon ? i == null ? void 0 : i.icon : t == null ? void 0 : t.icon
14
- } : {
15
- title: t.tooltip,
16
- icon: t.icon,
17
- isActive: () => !1
1
+ import { M as h, m, E as b } from "./index-DnWWK9F_.js";
2
+ import { jsx as e, Fragment as f, jsxs as d } from "react/jsx-runtime";
3
+ import { useMemo as M } from "react";
4
+ import { A as x } from "./toggle-Cdp4IT2U.js";
5
+ import "./index-BPfVXs5_.js";
6
+ import { I as A } from "./Icon-jKs8Hr6p.js";
7
+ import { M as S } from "./icons-Cllpys39.js";
8
+ import { u as k, b as v, g as y } from "./useButtonProps-BsEd4zYM.js";
9
+ import { D as T, a as K, b as w, c as C } from "./dropdown-menu-BPp2Z_U-.js";
10
+ var H = h.create({
11
+ name: "subscript",
12
+ addOptions() {
13
+ return {
14
+ HTMLAttributes: {}
15
+ };
16
+ },
17
+ parseHTML() {
18
+ return [
19
+ {
20
+ tag: "sub"
21
+ },
22
+ {
23
+ style: "vertical-align",
24
+ getAttrs(t) {
25
+ return t !== "sub" ? !1 : null;
26
+ }
27
+ }
28
+ ];
29
+ },
30
+ renderHTML({ HTMLAttributes: t }) {
31
+ return ["sub", m(this.options.HTMLAttributes, t), 0];
32
+ },
33
+ addCommands() {
34
+ return {
35
+ setSubscript: () => ({ commands: t }) => t.setMark(this.name),
36
+ toggleSubscript: () => ({ commands: t }) => t.toggleMark(this.name),
37
+ unsetSubscript: () => ({ commands: t }) => t.unsetMark(this.name)
38
+ };
39
+ },
40
+ addKeyboardShortcuts() {
41
+ return {
42
+ "Mod-,": () => this.editor.commands.toggleSubscript()
43
+ };
44
+ }
45
+ }), L = h.create({
46
+ name: "superscript",
47
+ addOptions() {
48
+ return {
49
+ HTMLAttributes: {}
50
+ };
51
+ },
52
+ parseHTML() {
53
+ return [
54
+ {
55
+ tag: "sup"
56
+ },
57
+ {
58
+ style: "vertical-align",
59
+ getAttrs(t) {
60
+ return t !== "super" ? !1 : null;
61
+ }
62
+ }
63
+ ];
64
+ },
65
+ renderHTML({ HTMLAttributes: t }) {
66
+ return ["sup", m(this.options.HTMLAttributes, t), 0];
67
+ },
68
+ addCommands() {
69
+ return {
70
+ setSuperscript: () => ({ commands: t }) => t.setMark(this.name),
71
+ toggleSuperscript: () => ({ commands: t }) => t.toggleMark(this.name),
72
+ unsetSuperscript: () => ({ commands: t }) => t.unsetMark(this.name)
73
+ };
74
+ },
75
+ addKeyboardShortcuts() {
76
+ return {
77
+ "Mod-.": () => this.editor.commands.toggleSuperscript()
18
78
  };
19
- }, [t]);
20
- return /* @__PURE__ */ h(g, { children: [
21
- /* @__PURE__ */ s(
22
- M,
79
+ }
80
+ });
81
+ function $() {
82
+ const t = k(D.name), {
83
+ icon: s = void 0,
84
+ tooltip: o = void 0,
85
+ items: i = [],
86
+ isActive: a = void 0
87
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { disabled: c, dataState: n } = v(a), p = M(() => (n == null ? void 0 : n.title) || "", [n]);
88
+ return t ? /* @__PURE__ */ d(T, { children: [
89
+ /* @__PURE__ */ e(
90
+ K,
23
91
  {
24
92
  asChild: !0,
25
- disabled: t == null ? void 0 : t.disabled,
26
- children: /* @__PURE__ */ s(
27
- y,
93
+ disabled: c,
94
+ children: /* @__PURE__ */ e(
95
+ x,
28
96
  {
29
97
  customClass: "!richtext-w-12 richtext-h-12",
30
- disabled: t == null ? void 0 : t.disabled,
31
- icon: t == null ? void 0 : t.icon,
32
- tooltip: t == null ? void 0 : t.tooltip,
33
- children: /* @__PURE__ */ s(S, { className: "richtext-size-3 richtext-text-gray-500" })
98
+ disabled: c,
99
+ icon: s,
100
+ tooltip: o,
101
+ children: /* @__PURE__ */ e(S, { className: "richtext-size-3 richtext-text-gray-500" })
34
102
  }
35
103
  )
36
104
  }
37
105
  ),
38
- /* @__PURE__ */ s(k, { className: "w-full", children: (c = t == null ? void 0 : t.items) == null ? void 0 : c.map((i, n) => /* @__PURE__ */ h(
39
- A,
106
+ /* @__PURE__ */ e(w, { className: "w-full", children: i == null ? void 0 : i.map((r, u) => /* @__PURE__ */ d(
107
+ C,
40
108
  {
41
- checked: e.title === i.title,
109
+ checked: p === r.title,
42
110
  className: "richtext-flex richtext-items-center richtext-gap-3",
43
- onClick: i.action,
111
+ onClick: r.action,
44
112
  children: [
45
- /* @__PURE__ */ s(w, { name: i == null ? void 0 : i.icon }),
46
- /* @__PURE__ */ s("span", { className: "richtext-ml-1", children: i.title }),
47
- !!(i != null && i.shortcutKeys) && /* @__PURE__ */ s("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: v(i.shortcutKeys) })
113
+ /* @__PURE__ */ e(A, { name: r == null ? void 0 : r.icon }),
114
+ /* @__PURE__ */ e("span", { className: "richtext-ml-1", children: r.title }),
115
+ !!(r != null && r.shortcutKeys) && /* @__PURE__ */ e("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: y(r.shortcutKeys) })
48
116
  ]
49
117
  },
50
- `more-mark-${n}`
118
+ `more-mark-${u}`
51
119
  )) })
52
- ] });
120
+ ] }) : /* @__PURE__ */ e(f, {});
53
121
  }
54
- const j = /* @__PURE__ */ m.create({
122
+ const D = /* @__PURE__ */ b.create({
55
123
  name: "moreMark",
56
124
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
57
125
  //@ts-expect-error
@@ -59,30 +127,31 @@ const j = /* @__PURE__ */ m.create({
59
127
  var t;
60
128
  return {
61
129
  ...(t = this.parent) == null ? void 0 : t.call(this),
62
- button({ editor: e, extension: c, t: i }) {
130
+ button({ editor: s, extension: o, t: i }) {
63
131
  var u, l;
64
- const n = c.options.subscript, o = c.options.superscript, a = {
65
- action: () => e.commands.toggleSubscript(),
66
- isActive: () => e.isActive("subscript") || !1,
67
- disabled: !e.can().toggleSubscript(),
132
+ const a = o.options.subscript, c = o.options.superscript, n = {
133
+ action: () => s.commands.toggleSubscript(),
134
+ isActive: () => s.isActive("subscript") || !1,
135
+ disabled: !s.can().toggleSubscript(),
68
136
  icon: "Subscript",
69
137
  title: i("editor.subscript.tooltip"),
70
- shortcutKeys: ((u = c.options.shortcutKeys) == null ? void 0 : u[0]) ?? ["mod", "."]
71
- }, d = {
72
- action: () => e.commands.toggleSuperscript(),
73
- isActive: () => e.isActive("superscript") || !1,
74
- disabled: !e.can().toggleSuperscript(),
138
+ shortcutKeys: ((u = o.options.shortcutKeys) == null ? void 0 : u[0]) ?? ["mod", "."]
139
+ }, p = {
140
+ action: () => s.commands.toggleSuperscript(),
141
+ isActive: () => s.isActive("superscript") || !1,
142
+ disabled: !s.can().toggleSuperscript(),
75
143
  icon: "Superscript",
76
144
  title: i("editor.superscript.tooltip"),
77
- shortcutKeys: ((l = c.options.shortcutKeys) == null ? void 0 : l[1]) ?? ["mod", ","]
145
+ shortcutKeys: ((l = o.options.shortcutKeys) == null ? void 0 : l[1]) ?? ["mod", ","]
78
146
  }, r = [];
79
- return n !== !1 && r.push(a), o !== !1 && r.push(d), {
80
- component: K,
147
+ return a !== !1 && r.push(n), c !== !1 && r.push(p), {
148
+ // component: ActionMoreButton,
81
149
  componentProps: {
82
150
  icon: "Type",
83
151
  tooltip: i("editor.moremark"),
84
- disabled: !e.isEditable,
85
- items: r
152
+ disabled: !s.isEditable,
153
+ items: r,
154
+ isActive: () => r == null ? void 0 : r.find((g) => g.isActive())
86
155
  }
87
156
  };
88
157
  }
@@ -90,9 +159,10 @@ const j = /* @__PURE__ */ m.create({
90
159
  },
91
160
  addExtensions() {
92
161
  const t = [];
93
- return this.options.subscript !== !1 && t.push(f.configure(this.options.subscript)), this.options.superscript !== !1 && t.push(b.configure(this.options.superscript)), t;
162
+ return this.options.subscript !== !1 && t.push(H.configure(this.options.subscript)), this.options.superscript !== !1 && t.push(L.configure(this.options.superscript)), t;
94
163
  }
95
164
  });
96
165
  export {
97
- j as MoreMark
166
+ D as MoreMark,
167
+ $ as RichTextMoreMark
98
168
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-5iBZLua9.cjs"),s=require("./RichTextEditor-CxvwGvQG.cjs"),d=r.OrderedList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o,extension:i})=>({component:s.ActionButton,componentProps:{action:()=>e.commands.toggleOrderedList(),isActive:()=>e.isActive("orderedList")||!1,disabled:!1,icon:"ListOrdered",shortcutKeys:i.options.shortcutKeys??["mod","shift","7"],tooltip:o("editor.orderedlist.tooltip")}})}}});exports.OrderedList=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index-D-5U8dY8.cjs"),r=require("react/jsx-runtime"),g=require("./toggle-D41PzQLJ.cjs");require("react");require("./index-DV5kbgRU.cjs");const d=require("./useButtonProps-C6Vpn190.cjs");function m(){const t=d.useButtonProps(c.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:i=void 0,tooltipOptions:u={},action:s=void 0,isActive:a=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:n,update:l}=d.useToggleActive(a),v=()=>{n||s&&(s(),l())};return t?r.jsx(g.ActionButton,{action:v,dataState:p,disabled:n,icon:e,shortcutKeys:i,tooltip:o,tooltipOptions:u}):r.jsx(r.Fragment,{})}const c=O.OrderedList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o,extension:i})=>({componentProps:{action:()=>e.commands.toggleOrderedList(),isActive:()=>e.isActive("orderedList"),disabled:!1,icon:"ListOrdered",shortcutKeys:i.options.shortcutKeys??["mod","shift","7"],tooltip:o("editor.orderedlist.tooltip")}})}}});exports.OrderedList=c;exports.RichTextOrderedList=m;