reactjs-tiptap-editor 0.2.29 → 0.3.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 (255) hide show
  1. package/lib/ActionMenuButton-BllDdN2-.js +33 -0
  2. package/lib/ActionMenuButton-tLPdHfCT.cjs +1 -0
  3. package/lib/Attachment.cjs +19 -0
  4. package/lib/Attachment.d.cts +344 -0
  5. package/lib/Attachment.d.ts +344 -0
  6. package/lib/Attachment.js +259 -0
  7. package/lib/Blockquote.cjs +1 -0
  8. package/lib/Blockquote.d.cts +343 -0
  9. package/lib/Blockquote.d.ts +343 -0
  10. package/lib/Blockquote.js +65 -0
  11. package/lib/Bold.cjs +1 -0
  12. package/lib/Bold.d.cts +343 -0
  13. package/lib/Bold.d.ts +343 -0
  14. package/lib/Bold.js +90 -0
  15. package/lib/BulletList.cjs +1 -0
  16. package/lib/BulletList.d.cts +343 -0
  17. package/lib/BulletList.d.ts +343 -0
  18. package/lib/BulletList.js +72 -0
  19. package/lib/Clear.cjs +1 -0
  20. package/lib/Clear.d.cts +342 -0
  21. package/lib/Clear.d.ts +342 -0
  22. package/lib/Clear.js +23 -0
  23. package/lib/Code.cjs +1 -0
  24. package/lib/Code.d.cts +343 -0
  25. package/lib/Code.d.ts +343 -0
  26. package/lib/Code.js +70 -0
  27. package/lib/CodeBlock.cjs +44 -0
  28. package/lib/CodeBlock.d.cts +352 -0
  29. package/lib/CodeBlock.d.ts +352 -0
  30. package/lib/CodeBlock.js +4189 -0
  31. package/lib/Color.cjs +1 -0
  32. package/lib/Color.d.cts +350 -0
  33. package/lib/Color.d.ts +350 -0
  34. package/lib/Color.js +141 -0
  35. package/lib/Document.cjs +1 -0
  36. package/lib/Document.d.cts +272 -0
  37. package/lib/Document.d.ts +272 -0
  38. package/lib/Document.js +13 -0
  39. package/lib/Drawer-BBmEHEAp.cjs +1 -0
  40. package/lib/Drawer-hyBIiEP6.js +1367 -0
  41. package/lib/Drawer.cjs +1 -0
  42. package/lib/Drawer.d.cts +344 -0
  43. package/lib/Drawer.d.ts +344 -0
  44. package/lib/Drawer.js +7 -0
  45. package/lib/Emoji.cjs +1 -0
  46. package/lib/Emoji.d.cts +277 -0
  47. package/lib/Emoji.d.ts +277 -0
  48. package/lib/Emoji.js +2168 -0
  49. package/lib/Excalidraw-BQ2PeAoa.js +651 -0
  50. package/lib/Excalidraw-Cd01zFJl.cjs +1 -0
  51. package/lib/Excalidraw.cjs +1 -0
  52. package/lib/Excalidraw.d.cts +278 -0
  53. package/lib/Excalidraw.d.ts +278 -0
  54. package/lib/Excalidraw.js +6 -0
  55. package/lib/ExportPdf.cjs +15 -0
  56. package/lib/ExportPdf.d.cts +270 -0
  57. package/lib/ExportPdf.d.ts +270 -0
  58. package/lib/ExportPdf.js +67 -0
  59. package/lib/ExportWord.cjs +1 -0
  60. package/lib/ExportWord.d.cts +341 -0
  61. package/lib/ExportWord.d.ts +341 -0
  62. package/lib/ExportWord.js +72 -0
  63. package/lib/FontFamily.cjs +1 -0
  64. package/lib/FontFamily.d.cts +354 -0
  65. package/lib/FontFamily.d.ts +354 -0
  66. package/lib/FontFamily.js +136 -0
  67. package/lib/FontSize.cjs +1 -0
  68. package/lib/FontSize.d.cts +359 -0
  69. package/lib/FontSize.d.ts +359 -0
  70. package/lib/FontSize.js +110 -0
  71. package/lib/FormatPainter.cjs +1 -0
  72. package/lib/FormatPainter.d.cts +353 -0
  73. package/lib/FormatPainter.d.ts +353 -0
  74. package/lib/FormatPainter.js +74 -0
  75. package/lib/Heading.cjs +1 -0
  76. package/lib/Heading.d.cts +343 -0
  77. package/lib/Heading.d.ts +343 -0
  78. package/lib/Heading.js +147 -0
  79. package/lib/Highlight.cjs +1 -0
  80. package/lib/Highlight.d.cts +344 -0
  81. package/lib/Highlight.d.ts +344 -0
  82. package/lib/Highlight.js +85 -0
  83. package/lib/History.cjs +1 -0
  84. package/lib/History.d.cts +343 -0
  85. package/lib/History.d.ts +343 -0
  86. package/lib/History.js +431 -0
  87. package/lib/HorizontalRule.cjs +1 -0
  88. package/lib/HorizontalRule.d.cts +343 -0
  89. package/lib/HorizontalRule.d.ts +343 -0
  90. package/lib/HorizontalRule.js +87 -0
  91. package/lib/Iframe.cjs +1 -0
  92. package/lib/Iframe.d.cts +277 -0
  93. package/lib/Iframe.d.ts +277 -0
  94. package/lib/Iframe.js +6 -0
  95. package/lib/Image.cjs +1 -0
  96. package/lib/Image.d.cts +370 -0
  97. package/lib/Image.d.ts +370 -0
  98. package/lib/Image.js +7 -0
  99. package/lib/ImageGif.cjs +1 -0
  100. package/lib/ImageGif.d.cts +292 -0
  101. package/lib/ImageGif.d.ts +292 -0
  102. package/lib/ImageGif.js +7 -0
  103. package/lib/ImportWord.cjs +231 -0
  104. package/lib/ImportWord.d.cts +353 -0
  105. package/lib/ImportWord.d.ts +353 -0
  106. package/lib/ImportWord.js +16620 -0
  107. package/lib/Indent.cjs +1 -0
  108. package/lib/Indent.d.cts +344 -0
  109. package/lib/Indent.d.ts +344 -0
  110. package/lib/Indent.js +78 -0
  111. package/lib/Italic.cjs +1 -0
  112. package/lib/Italic.d.cts +343 -0
  113. package/lib/Italic.d.ts +343 -0
  114. package/lib/Italic.js +91 -0
  115. package/lib/Katex.cjs +1 -0
  116. package/lib/Katex.d.cts +279 -0
  117. package/lib/Katex.d.ts +279 -0
  118. package/lib/Katex.js +197 -0
  119. package/lib/LineHeight.cjs +1 -0
  120. package/lib/LineHeight.d.cts +347 -0
  121. package/lib/LineHeight.d.ts +347 -0
  122. package/lib/LineHeight.js +137 -0
  123. package/lib/Link.cjs +5 -0
  124. package/lib/Link.d.cts +343 -0
  125. package/lib/Link.d.ts +343 -0
  126. package/lib/Link.js +1048 -0
  127. package/lib/ListItem.cjs +1 -0
  128. package/lib/ListItem.d.cts +269 -0
  129. package/lib/ListItem.d.ts +269 -0
  130. package/lib/ListItem.js +33 -0
  131. package/lib/Mention.cjs +1 -0
  132. package/lib/Mention.d.cts +272 -0
  133. package/lib/Mention.d.ts +272 -0
  134. package/lib/Mention.js +233 -0
  135. package/lib/Mermaid.cjs +2 -0
  136. package/lib/Mermaid.d.cts +344 -0
  137. package/lib/Mermaid.d.ts +344 -0
  138. package/lib/Mermaid.js +390 -0
  139. package/lib/MoreMark.cjs +1 -0
  140. package/lib/MoreMark.d.cts +355 -0
  141. package/lib/MoreMark.d.ts +355 -0
  142. package/lib/MoreMark.js +95 -0
  143. package/lib/MultiColumn.cjs +1 -0
  144. package/lib/MultiColumn.d.cts +277 -0
  145. package/lib/MultiColumn.d.ts +277 -0
  146. package/lib/MultiColumn.js +8 -0
  147. package/lib/OrderedList.cjs +1 -0
  148. package/lib/OrderedList.d.cts +343 -0
  149. package/lib/OrderedList.d.ts +343 -0
  150. package/lib/OrderedList.js +90 -0
  151. package/lib/RichTextEditor-CM-Xq9RS.cjs +137 -0
  152. package/lib/RichTextEditor-DvrUVNK2.js +11417 -0
  153. package/lib/SearchAndReplace.cjs +1 -0
  154. package/lib/SearchAndReplace.d.cts +358 -0
  155. package/lib/SearchAndReplace.d.ts +358 -0
  156. package/lib/SearchAndReplace.js +339 -0
  157. package/lib/Selection.cjs +1 -0
  158. package/lib/Selection.d.cts +272 -0
  159. package/lib/Selection.d.ts +272 -0
  160. package/lib/Selection.js +25 -0
  161. package/lib/SlashCommand.cjs +1 -0
  162. package/lib/SlashCommand.d.cts +299 -0
  163. package/lib/SlashCommand.d.ts +299 -0
  164. package/lib/SlashCommand.js +369 -0
  165. package/lib/Strike.cjs +1 -0
  166. package/lib/Strike.d.cts +343 -0
  167. package/lib/Strike.d.ts +343 -0
  168. package/lib/Strike.js +80 -0
  169. package/lib/SubAndSuperScript.cjs +1 -0
  170. package/lib/SubAndSuperScript.d.cts +358 -0
  171. package/lib/SubAndSuperScript.d.ts +358 -0
  172. package/lib/SubAndSuperScript.js +41 -0
  173. package/lib/Table.cjs +1 -0
  174. package/lib/Table.d.cts +366 -0
  175. package/lib/Table.d.ts +366 -0
  176. package/lib/Table.js +2165 -0
  177. package/lib/TableOfContent.cjs +1 -0
  178. package/lib/TableOfContent.d.cts +274 -0
  179. package/lib/TableOfContent.d.ts +274 -0
  180. package/lib/TableOfContent.js +184 -0
  181. package/lib/TaskList.cjs +1 -0
  182. package/lib/TaskList.d.cts +349 -0
  183. package/lib/TaskList.d.ts +349 -0
  184. package/lib/TaskList.js +175 -0
  185. package/lib/TextAlign.cjs +1 -0
  186. package/lib/TextAlign.d.cts +353 -0
  187. package/lib/TextAlign.d.ts +353 -0
  188. package/lib/TextAlign.js +165 -0
  189. package/lib/TextBubble.cjs +1 -0
  190. package/lib/TextBubble.d.cts +343 -0
  191. package/lib/TextBubble.d.ts +343 -0
  192. package/lib/TextBubble.js +131 -0
  193. package/lib/TextDirection.cjs +1 -0
  194. package/lib/TextDirection.d.cts +270 -0
  195. package/lib/TextDirection.d.ts +270 -0
  196. package/lib/TextDirection.js +142 -0
  197. package/lib/TextUnderline.cjs +1 -0
  198. package/lib/TextUnderline.d.cts +343 -0
  199. package/lib/TextUnderline.d.ts +343 -0
  200. package/lib/TextUnderline.js +61 -0
  201. package/lib/TrailingNode.cjs +1 -0
  202. package/lib/TrailingNode.d.cts +280 -0
  203. package/lib/TrailingNode.d.ts +280 -0
  204. package/lib/TrailingNode.js +41 -0
  205. package/lib/Twitter-BuMkJKBq.cjs +17 -0
  206. package/lib/Twitter-BvdxYuDK.js +1743 -0
  207. package/lib/Twitter.cjs +1 -0
  208. package/lib/Twitter.d.cts +295 -0
  209. package/lib/Twitter.d.ts +295 -0
  210. package/lib/Twitter.js +6 -0
  211. package/lib/Video.cjs +1 -0
  212. package/lib/Video.d.cts +371 -0
  213. package/lib/Video.d.ts +371 -0
  214. package/lib/Video.js +6 -0
  215. package/lib/bubble-extra.cjs +2 -0
  216. package/lib/bubble-extra.d.cts +294 -0
  217. package/lib/bubble-extra.d.ts +294 -0
  218. package/lib/bubble-extra.js +623 -0
  219. package/lib/dom-dataset-CAXnsjYE.cjs +33 -0
  220. package/lib/dom-dataset-CJ7GyQ2E.js +999 -0
  221. package/lib/index-COecBbaE.cjs +89 -0
  222. package/lib/index-ClFtfQ0J.cjs +1 -0
  223. package/lib/index-CvYIX2-x.js +129 -0
  224. package/lib/index-CySbCeQd.cjs +1 -0
  225. package/lib/{index-CO-iymkb.js → index-D9llIWB5.js} +442 -101
  226. package/lib/index-DXBa3JBo.js +46 -0
  227. package/lib/index-DjP7Onch.cjs +1 -0
  228. package/lib/index-Drmyqk9P.js +12322 -0
  229. package/lib/index-DuhDIOel.js +76 -0
  230. package/lib/index-LbrE7K9i.cjs +1 -0
  231. package/lib/index.cjs +2 -1
  232. package/lib/index.d.cts +290 -108
  233. package/lib/index.d.ts +290 -108
  234. package/lib/index.js +587 -13
  235. package/lib/locale-bundle.cjs +1 -1
  236. package/lib/locale-bundle.d.cts +108 -108
  237. package/lib/locale-bundle.d.ts +108 -108
  238. package/lib/locale-bundle.js +1 -1
  239. package/lib/shortId-Bfj8TyNr.cjs +2 -0
  240. package/lib/shortId-WJVkrvml.js +30 -0
  241. package/lib/style.css +1 -1
  242. package/lib/textarea-B172kMgC.js +20 -0
  243. package/lib/textarea-CapyElEP.cjs +1 -0
  244. package/package.json +678 -15
  245. package/lib/RichTextEditor-Ce2IeNE6.js +0 -8265
  246. package/lib/RichTextEditor-hDDApaDD.cjs +0 -136
  247. package/lib/extension-bundle.cjs +0 -33
  248. package/lib/extension-bundle.d.cts +0 -951
  249. package/lib/extension-bundle.d.ts +0 -951
  250. package/lib/extension-bundle.js +0 -5982
  251. package/lib/index-CJ6Hb9MN.cjs +0 -1
  252. package/lib/tiptap-DOP8lVCQ.js +0 -5950
  253. package/lib/tiptap-Dq62HiQ9.cjs +0 -113
  254. package/lib/vendor-BbgkyoD-.js +0 -40297
  255. package/lib/vendor-DdwtMmSr.cjs +0 -302
@@ -0,0 +1,72 @@
1
+ import { E as a } from "./index-Drmyqk9P.js";
2
+ import { Packer as i, WidthType as c } from "docx";
3
+ import { defaultNodes as t, DocxSerializer as d, defaultMarks as l } from "prosemirror-docx";
4
+ import { A as p } from "./RichTextEditor-DvrUVNK2.js";
5
+ const m = typeof window < "u";
6
+ function u(e, o) {
7
+ if (m) {
8
+ const n = window.URL.createObjectURL(e), r = document.createElement("a");
9
+ return r.href = n, r.download = o, r.click(), window.URL.revokeObjectURL(n), Promise.resolve();
10
+ }
11
+ return console.error("Download is not supported in Node.js"), Promise.resolve();
12
+ }
13
+ const f = {
14
+ ...t,
15
+ hardBreak: t.hard_break,
16
+ codeBlock: t.code_block,
17
+ orderedList: t.ordered_list,
18
+ listItem: t.list_item,
19
+ bulletList: t.bullet_list,
20
+ horizontalRule: t.horizontal_rule,
21
+ // Requirement Buffer on browser
22
+ image(e, o) {
23
+ e.renderInline(o), e.closeBlock(o);
24
+ },
25
+ table(e, o) {
26
+ e.table(o, {
27
+ tableOptions: {
28
+ width: {
29
+ size: 100,
30
+ type: c.PERCENTAGE
31
+ }
32
+ }
33
+ });
34
+ }
35
+ }, w = /* @__PURE__ */ new d(f, l), y = /* @__PURE__ */ a.create({
36
+ name: "exportWord",
37
+ addOptions() {
38
+ var e;
39
+ return {
40
+ ...(e = this.parent) == null ? void 0 : e.call(this),
41
+ button: ({ editor: o, t: n }) => ({
42
+ component: p,
43
+ componentProps: {
44
+ icon: "ExportWord",
45
+ action: () => {
46
+ o == null || o.commands.exportToWord();
47
+ },
48
+ tooltip: n("editor.exportWord.tooltip"),
49
+ isActive: () => !1,
50
+ disabled: !1
51
+ }
52
+ })
53
+ };
54
+ },
55
+ // @ts-expect-error
56
+ addCommands() {
57
+ return {
58
+ exportToWord: () => async ({ editor: e }) => {
59
+ const o = {
60
+ getImageBuffer: async (r) => {
61
+ const s = await (await fetch(r)).arrayBuffer();
62
+ return new Uint8Array(s);
63
+ }
64
+ }, n = w.serialize(e.state.doc, o);
65
+ return i.toBlob(n).then((r) => u(new Blob([r]), "export-document.docx")), !0;
66
+ }
67
+ };
68
+ }
69
+ });
70
+ export {
71
+ y as ExportWord
72
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DjP7Onch.cjs");const y=require("./index-COecBbaE.cjs"),m=require("./index-LbrE7K9i.cjs"),o=require("react/jsx-runtime"),F=require("react"),h=require("./ActionMenuButton-tLPdHfCT.cjs"),s=require("./RichTextEditor-CM-Xq9RS.cjs"),x=y.Extension.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:i})=>i().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}});function M(t){var r,f,d;const{t:i,lang:u}=m.useLocale(),e=F.useMemo(()=>{var a;const n=(a=t==null?void 0:t.items)==null?void 0:a.find(l=>l.isActive());return n&&!n.default?{...n}:{title:t.tooltip,font:i("editor.fontFamily.default.tooltip"),isActive:()=>!1,disabled:!1,action:()=>t.editor.chain().focus().unsetFontFamily().run()}},[i,u,t]);return o.jsxs(s.DropdownMenu,{children:[o.jsx(s.DropdownMenuTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:o.jsx(h.ActionMenuButton,{disabled:t==null?void 0:t.disabled,icon:"MenuDown",title:((r=e==null?void 0:e.font)==null?void 0:r.length)>7?`${(f=e==null?void 0:e.font)==null?void 0:f.slice(0,6)}...`:e==null?void 0:e.font,tooltip:t==null?void 0:t.tooltip})}),o.jsx(s.DropdownMenuContent,{className:"richtext-w-full",children:(d=t==null?void 0:t.items)==null?void 0:d.map((n,c)=>{const a=n.font===i("editor.fontFamily.default.tooltip")?{}:{fontFamily:n.font};return o.jsxs(F.Fragment,{children:[o.jsx(s.DropdownMenuCheckboxItem,{checked:(e==null?void 0:e.font)===n.font,onClick:n.action,children:o.jsx("div",{className:"richtext-ml-1 richtext-h-full",style:a,children:n.font})}),n.font===i("editor.fontFamily.default.tooltip")&&o.jsx(s.DropdownMenuSeparator,{})]},`font-family-${c}`)})})]})}const b=x.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),fontFamilyList:m.DEFAULT_FONT_FAMILY_LIST,button({editor:i,extension:u,t:e}){var a;const{extensions:r=[]}=i.extensionManager??[],f=s.ensureNameValueOptions(((a=u==null?void 0:u.options)==null?void 0:a.fontFamilyList)||[]),d=r.find(l=>l.name==="base-kit"),n=f.map(l=>({action:()=>{i.chain().focus().setFontFamily(l.value).run()},isActive:()=>i.isActive("textStyle",{fontFamily:l.value})||!1,disabled:!i.can().setFontFamily(l.value),title:l.name,font:l.value}));d&&d.options.textStyle!==!1&&n.unshift({action:()=>i.chain().focus().unsetFontFamily().run(),isActive:()=>!1,disabled:!1,font:e("editor.fontFamily.default.tooltip"),title:e("editor.fontFamily.tooltip")});const c=n.filter(l=>l.disabled).length===n.length;return{component:M,componentProps:{tooltip:e("editor.fontFamily.tooltip"),disabled:c,items:n,editor:i}}}}}});exports.DEFAULT_FONT_FAMILY_LIST=m.DEFAULT_FONT_FAMILY_LIST;exports.FontFamily=b;
@@ -0,0 +1,354 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { Extension } from '@tiptap/core';
3
+ import { FontFamilyOptions as FontFamilyOptions_2 } from '@tiptap/extension-font-family';
4
+
5
+ /**
6
+ * Represents the ButtonView function.
7
+ */
8
+ declare type ButtonView<T = any> = (options: ButtonViewParams<T>) => ButtonViewReturn | ButtonViewReturn[];
9
+
10
+ /**
11
+ * Represents the parameters for the ButtonView function.
12
+ */
13
+ declare interface ButtonViewParams<T = any> {
14
+ /** Editor object */
15
+ editor: Editor;
16
+ /** Extension object */
17
+ extension: Extension<T>;
18
+ /** Translation function */
19
+ t: (path: string) => string;
20
+ }
21
+
22
+ /**
23
+ * Represents the return value for the ButtonView component.
24
+ */
25
+ declare interface ButtonViewReturn {
26
+ /** Component */
27
+ component: unknown;
28
+ /** Component props */
29
+ componentProps: ButtonViewReturnComponentProps;
30
+ /** Component slots */
31
+ componentSlots?: ButtonViewReturnComponentSlots;
32
+ }
33
+
34
+ /**
35
+ * Represents the props for the ButtonView component.
36
+ */
37
+ declare interface ButtonViewReturnComponentProps {
38
+ /** Method triggered when action is performed */
39
+ action?: (value?: any) => void;
40
+ /** Whether it is in the active state */
41
+ isActive?: () => boolean;
42
+ /** Button icon */
43
+ icon?: any;
44
+ /** Text displayed on hover */
45
+ tooltip?: string;
46
+ [x: string]: any;
47
+ }
48
+
49
+ /**
50
+ * Represents the slots for the ButtonView component.
51
+ */
52
+ declare interface ButtonViewReturnComponentSlots {
53
+ /** Dialog slot */
54
+ dialog: () => any;
55
+ [x: string]: () => any;
56
+ }
57
+
58
+ /** Default font family list */
59
+ export declare const DEFAULT_FONT_FAMILY_LIST: string[];
60
+
61
+ export declare const FontFamily: Extension<FontFamilyOptions, any>;
62
+
63
+ export declare interface FontFamilyOptions extends FontFamilyOptions_2, GeneralOptions<FontFamilyOptions> {
64
+ /**
65
+ * Font family list.
66
+ */
67
+ fontFamilyList: (string | NameValueOption)[];
68
+ }
69
+
70
+ /**
71
+ * Represents the general options for Tiptap extensions.
72
+ */
73
+ declare interface GeneralOptions<T> {
74
+ /** Enabled divider */
75
+ divider: boolean;
76
+ /** Enabled spacer */
77
+ spacer: boolean;
78
+ /** Button view function */
79
+ button: ButtonView<T>;
80
+ /** Show on Toolbar */
81
+ toolbar?: boolean;
82
+ }
83
+
84
+ declare interface NameValueOption<T = string> {
85
+ name: string;
86
+ value: T;
87
+ }
88
+
89
+ export { }
90
+
91
+
92
+ declare module '@tiptap/core' {
93
+ interface Commands<ReturnType> {
94
+ attachment: {
95
+ setAttachment: (attrs?: unknown) => ReturnType;
96
+ };
97
+ }
98
+ }
99
+
100
+
101
+ declare module '@tiptap/core' {
102
+ interface Commands<ReturnType> {
103
+ setCodeBlock: {
104
+ setCodeBlock: (options?: any) => ReturnType;
105
+ };
106
+ }
107
+ }
108
+
109
+
110
+ declare module '@tiptap/core' {
111
+ interface Commands<ReturnType> {
112
+ drawer: {
113
+ setDrawer: (options: any, replace?: any) => ReturnType;
114
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
115
+ };
116
+ }
117
+ }
118
+
119
+
120
+ declare module '@tiptap/core' {
121
+ interface Commands<ReturnType> {
122
+ emoji: {
123
+ setEmoji: (emoji: {
124
+ name: string;
125
+ emoji: string;
126
+ }) => ReturnType;
127
+ };
128
+ }
129
+ }
130
+
131
+
132
+ declare module '@tiptap/core' {
133
+ interface Commands<ReturnType> {
134
+ excalidraw: {
135
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
136
+ };
137
+ }
138
+ }
139
+
140
+
141
+ declare module '@tiptap/core' {
142
+ interface Commands<ReturnType> {
143
+ exportWord: {
144
+ exportToWord: () => ReturnType;
145
+ };
146
+ }
147
+ }
148
+
149
+
150
+ declare module '@tiptap/core' {
151
+ interface Commands<ReturnType> {
152
+ fontSize: {
153
+ /**
154
+ * Set the text font size. ex: "12px", "2em", or "small". Must be a valid
155
+ * CSS font-size
156
+ * (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
157
+ */
158
+ setFontSize: (fontSize: string) => ReturnType;
159
+ /**
160
+ * Unset the font size
161
+ */
162
+ unsetFontSize: () => ReturnType;
163
+ };
164
+ }
165
+ }
166
+
167
+
168
+ declare module '@tiptap/core' {
169
+ interface Commands<ReturnType> {
170
+ painter: {
171
+ setPainter: (marks: Mark[]) => ReturnType;
172
+ };
173
+ }
174
+ }
175
+
176
+
177
+ declare module '@tiptap/core' {
178
+ interface Commands<ReturnType> {
179
+ iframe: {
180
+ /**
181
+ * Add an iframe
182
+ */
183
+ setIframe: (options: {
184
+ src: string;
185
+ service: string;
186
+ }) => ReturnType;
187
+ };
188
+ }
189
+ }
190
+
191
+
192
+ declare module '@tiptap/core' {
193
+ interface Commands<ReturnType> {
194
+ imageUpload: {
195
+ /**
196
+ * Add an image
197
+ */
198
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
199
+ /**
200
+ * Update an image
201
+ */
202
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
203
+ /**
204
+ * Set image alignment
205
+ */
206
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
207
+ };
208
+ }
209
+ }
210
+
211
+
212
+ declare module '@tiptap/core' {
213
+ interface Commands<ReturnType> {
214
+ imageGifUpload: {
215
+ /**
216
+ * Add an image gif
217
+ */
218
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
219
+ /**
220
+ * Update an image gif
221
+ */
222
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
223
+ /**
224
+ * Set image alignment
225
+ */
226
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
227
+ };
228
+ }
229
+ }
230
+
231
+
232
+ declare module '@tiptap/core' {
233
+ interface Commands<ReturnType> {
234
+ indent: {
235
+ /**
236
+ * Set the indent attribute
237
+ */
238
+ indent: () => ReturnType;
239
+ /**
240
+ * Set the outdent attribute
241
+ */
242
+ outdent: () => ReturnType;
243
+ };
244
+ }
245
+ }
246
+
247
+
248
+ declare module '@tiptap/core' {
249
+ interface Commands<ReturnType> {
250
+ katex: {
251
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
252
+ };
253
+ }
254
+ }
255
+
256
+
257
+ declare module '@tiptap/core' {
258
+ interface Commands<ReturnType> {
259
+ lineHeight: {
260
+ setLineHeight: (lineHeight: string) => ReturnType;
261
+ unsetLineHeight: () => ReturnType;
262
+ };
263
+ }
264
+ }
265
+
266
+
267
+ declare module '@tiptap/core' {
268
+ interface Commands<ReturnType> {
269
+ mermaid: {
270
+ setMermaid: (options: any, replace?: any) => ReturnType;
271
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
272
+ };
273
+ }
274
+ }
275
+
276
+
277
+ declare module '@tiptap/core' {
278
+ interface Commands<ReturnType> {
279
+ columns: {
280
+ insertColumns: (attrs?: {
281
+ cols: number;
282
+ }) => ReturnType;
283
+ addColBefore: () => ReturnType;
284
+ addColAfter: () => ReturnType;
285
+ deleteCol: () => ReturnType;
286
+ };
287
+ }
288
+ }
289
+
290
+
291
+ declare module '@tiptap/core' {
292
+ interface Commands<ReturnType> {
293
+ search: {
294
+ setSearchTerm: (searchTerm: string) => ReturnType;
295
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
296
+ replace: () => ReturnType;
297
+ replaceAll: () => ReturnType;
298
+ goToPrevSearchResult: () => void;
299
+ goToNextSearchResult: () => void;
300
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
301
+ };
302
+ }
303
+ }
304
+
305
+
306
+ declare module '@tiptap/core' {
307
+ interface Commands<ReturnType> {
308
+ tableOfContents: {
309
+ setTableOfContents: () => ReturnType;
310
+ removeTableOfContents: () => ReturnType;
311
+ };
312
+ }
313
+ }
314
+
315
+
316
+ declare module '@tiptap/core' {
317
+ interface Commands<ReturnType> {
318
+ twitter: {
319
+ /**
320
+ * Insert a tweet
321
+ * @param options The tweet attributes
322
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
323
+ */
324
+ setTweet: (options: SetTweetOptions) => ReturnType;
325
+ updateTweet: (options: SetTweetOptions) => ReturnType;
326
+ };
327
+ }
328
+ }
329
+
330
+
331
+ declare module '@tiptap/core' {
332
+ interface Commands<ReturnType> {
333
+ video: {
334
+ /**
335
+ * Add an video
336
+ */
337
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
338
+ /**
339
+ * Update an video
340
+ */
341
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
342
+ };
343
+ }
344
+ }
345
+
346
+
347
+ declare module '@tiptap/core' {
348
+ interface Commands<ReturnType> {
349
+ tableCellBackground: {
350
+ setTableCellBackground: (color: string) => ReturnType;
351
+ unsetTableCellBackground: () => ReturnType;
352
+ };
353
+ }
354
+ }