reactjs-tiptap-editor 0.3.19 → 0.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/lib/{ActionMenuButton-BPq-R8E7.cjs → ActionMenuButton-BTFBZyG2.cjs} +1 -1
  2. package/lib/{ActionMenuButton-DCACoSG3.js → ActionMenuButton-DXwnYZhJ.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +28 -28
  5. package/lib/Attachment.d.ts +28 -28
  6. package/lib/Attachment.js +3 -3
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +28 -28
  9. package/lib/Blockquote.d.ts +28 -28
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +28 -28
  13. package/lib/Bold.d.ts +28 -28
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +28 -28
  17. package/lib/BulletList.d.ts +28 -28
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +28 -28
  21. package/lib/Clear.d.ts +28 -28
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +28 -28
  25. package/lib/Code.d.ts +28 -28
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +28 -28
  29. package/lib/CodeBlock.d.ts +28 -28
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +28 -28
  33. package/lib/CodeView.d.ts +28 -28
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +28 -28
  37. package/lib/Color.d.ts +28 -28
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.cjs +1 -1
  40. package/lib/Document.d.cts +28 -28
  41. package/lib/Document.d.ts +28 -28
  42. package/lib/Document.js +1 -1
  43. package/lib/{Drawer-Dwx9V0Xb.cjs → Drawer-BrHHs2E9.cjs} +1 -1
  44. package/lib/{Drawer-Qh1zEBl3.js → Drawer-CVuwyG50.js} +3 -3
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +28 -28
  47. package/lib/Drawer.d.ts +28 -28
  48. package/lib/Drawer.js +4 -4
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +28 -28
  51. package/lib/Emoji.d.ts +28 -28
  52. package/lib/Emoji.js +4 -4
  53. package/lib/{Excalidraw-BP_-zWZH.cjs → Excalidraw-Be_GDV4Q.cjs} +1 -1
  54. package/lib/{Excalidraw-DD3P3ClH.js → Excalidraw-frMX4K62.js} +3 -3
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +28 -28
  57. package/lib/Excalidraw.d.ts +28 -28
  58. package/lib/Excalidraw.js +3 -3
  59. package/lib/ExportPdf.cjs +1 -1
  60. package/lib/ExportPdf.d.cts +28 -28
  61. package/lib/ExportPdf.d.ts +28 -28
  62. package/lib/ExportPdf.js +2 -2
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +28 -28
  65. package/lib/ExportWord.d.ts +28 -28
  66. package/lib/ExportWord.js +2 -2
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +28 -28
  69. package/lib/FontFamily.d.ts +28 -28
  70. package/lib/FontFamily.js +4 -4
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +28 -28
  73. package/lib/FontSize.d.ts +28 -28
  74. package/lib/FontSize.js +3 -3
  75. package/lib/FormatPainter.cjs +1 -1
  76. package/lib/FormatPainter.d.cts +28 -28
  77. package/lib/FormatPainter.d.ts +28 -28
  78. package/lib/FormatPainter.js +2 -2
  79. package/lib/Heading.cjs +1 -1
  80. package/lib/Heading.d.cts +28 -28
  81. package/lib/Heading.d.ts +28 -28
  82. package/lib/Heading.js +3 -3
  83. package/lib/Highlight.cjs +1 -1
  84. package/lib/Highlight.d.cts +28 -28
  85. package/lib/Highlight.d.ts +28 -28
  86. package/lib/Highlight.js +2 -2
  87. package/lib/History.cjs +1 -1
  88. package/lib/History.d.cts +28 -28
  89. package/lib/History.d.ts +28 -28
  90. package/lib/History.js +2 -2
  91. package/lib/HorizontalRule.cjs +1 -1
  92. package/lib/HorizontalRule.d.cts +28 -28
  93. package/lib/HorizontalRule.d.ts +28 -28
  94. package/lib/HorizontalRule.js +2 -2
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +28 -28
  97. package/lib/Iframe.d.ts +28 -28
  98. package/lib/Iframe.js +3 -3
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +28 -28
  101. package/lib/Image.d.ts +28 -28
  102. package/lib/Image.js +3 -3
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +28 -28
  105. package/lib/ImageGif.d.ts +28 -28
  106. package/lib/ImageGif.js +3 -3
  107. package/lib/ImportWord.cjs +74 -74
  108. package/lib/ImportWord.d.cts +28 -28
  109. package/lib/ImportWord.d.ts +28 -28
  110. package/lib/ImportWord.js +5015 -4998
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +28 -28
  113. package/lib/Indent.d.ts +28 -28
  114. package/lib/Indent.js +2 -2
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +28 -28
  117. package/lib/Italic.d.ts +28 -28
  118. package/lib/Italic.js +2 -2
  119. package/lib/Katex.cjs +1 -1
  120. package/lib/Katex.d.cts +28 -28
  121. package/lib/Katex.d.ts +28 -28
  122. package/lib/Katex.js +4 -4
  123. package/lib/LineHeight.cjs +1 -1
  124. package/lib/LineHeight.d.cts +28 -28
  125. package/lib/LineHeight.d.ts +28 -28
  126. package/lib/LineHeight.js +2 -2
  127. package/lib/Link.cjs +1 -1
  128. package/lib/Link.d.cts +28 -28
  129. package/lib/Link.d.ts +28 -28
  130. package/lib/Link.js +2 -2
  131. package/lib/ListItem.cjs +1 -1
  132. package/lib/ListItem.d.cts +28 -28
  133. package/lib/ListItem.d.ts +28 -28
  134. package/lib/ListItem.js +1 -1
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +28 -28
  137. package/lib/Mention.d.ts +28 -28
  138. package/lib/Mention.js +123 -91
  139. package/lib/Mermaid.cjs +1 -1
  140. package/lib/Mermaid.d.cts +28 -28
  141. package/lib/Mermaid.d.ts +28 -28
  142. package/lib/Mermaid.js +4 -4
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +28 -28
  145. package/lib/MoreMark.d.ts +28 -28
  146. package/lib/MoreMark.js +3 -3
  147. package/lib/MultiColumn.cjs +1 -1
  148. package/lib/MultiColumn.d.cts +28 -28
  149. package/lib/MultiColumn.d.ts +28 -28
  150. package/lib/MultiColumn.js +2 -2
  151. package/lib/OrderedList.cjs +1 -1
  152. package/lib/OrderedList.d.cts +28 -28
  153. package/lib/OrderedList.d.ts +28 -28
  154. package/lib/OrderedList.js +2 -2
  155. package/lib/RichTextEditor-CAxwVWUE.cjs +137 -0
  156. package/lib/{RichTextEditor-DIvPROxl.js → RichTextEditor-DjTnd5Uu.js} +1607 -1603
  157. package/lib/SearchAndReplace.cjs +1 -1
  158. package/lib/SearchAndReplace.d.cts +28 -28
  159. package/lib/SearchAndReplace.d.ts +28 -28
  160. package/lib/SearchAndReplace.js +2 -2
  161. package/lib/Selection.cjs +1 -1
  162. package/lib/Selection.d.cts +28 -28
  163. package/lib/Selection.d.ts +28 -28
  164. package/lib/Selection.js +1 -1
  165. package/lib/SlashCommand.cjs +1 -1
  166. package/lib/SlashCommand.d.cts +28 -28
  167. package/lib/SlashCommand.d.ts +28 -28
  168. package/lib/SlashCommand.js +4 -4
  169. package/lib/Strike.cjs +1 -1
  170. package/lib/Strike.d.cts +28 -28
  171. package/lib/Strike.d.ts +28 -28
  172. package/lib/Strike.js +2 -2
  173. package/lib/SubAndSuperScript.cjs +1 -1
  174. package/lib/SubAndSuperScript.d.cts +28 -28
  175. package/lib/SubAndSuperScript.d.ts +28 -28
  176. package/lib/SubAndSuperScript.js +3 -3
  177. package/lib/Table.cjs +1 -1
  178. package/lib/Table.d.cts +28 -28
  179. package/lib/Table.d.ts +28 -28
  180. package/lib/Table.js +2 -2
  181. package/lib/TableOfContent.cjs +1 -1
  182. package/lib/TableOfContent.d.cts +28 -28
  183. package/lib/TableOfContent.d.ts +28 -28
  184. package/lib/TableOfContent.js +3 -3
  185. package/lib/TaskList.cjs +1 -1
  186. package/lib/TaskList.d.cts +28 -28
  187. package/lib/TaskList.d.ts +28 -28
  188. package/lib/TaskList.js +37 -33
  189. package/lib/TextAlign.cjs +1 -1
  190. package/lib/TextAlign.d.cts +28 -28
  191. package/lib/TextAlign.d.ts +28 -28
  192. package/lib/TextAlign.js +2 -2
  193. package/lib/TextBubble.cjs +1 -1
  194. package/lib/TextBubble.d.cts +28 -28
  195. package/lib/TextBubble.d.ts +28 -28
  196. package/lib/TextBubble.js +2 -2
  197. package/lib/TextDirection.cjs +1 -1
  198. package/lib/TextDirection.d.cts +28 -28
  199. package/lib/TextDirection.d.ts +28 -28
  200. package/lib/TextDirection.js +2 -2
  201. package/lib/TextUnderline.cjs +1 -1
  202. package/lib/TextUnderline.d.cts +28 -28
  203. package/lib/TextUnderline.d.ts +28 -28
  204. package/lib/TextUnderline.js +2 -2
  205. package/lib/TrailingNode.cjs +1 -1
  206. package/lib/TrailingNode.d.cts +28 -28
  207. package/lib/TrailingNode.d.ts +28 -28
  208. package/lib/TrailingNode.js +1 -1
  209. package/lib/{Twitter-Bl5HyIX0.cjs → Twitter-V0OzBT_E.cjs} +1 -1
  210. package/lib/{Twitter-raSi7ATg.js → Twitter-dRxbZOad.js} +3 -3
  211. package/lib/Twitter.cjs +1 -1
  212. package/lib/Twitter.d.cts +28 -28
  213. package/lib/Twitter.d.ts +28 -28
  214. package/lib/Twitter.js +3 -3
  215. package/lib/Video.cjs +1 -1
  216. package/lib/Video.d.cts +28 -28
  217. package/lib/Video.d.ts +28 -28
  218. package/lib/Video.js +2 -2
  219. package/lib/bubble-extra.cjs +2 -2
  220. package/lib/bubble-extra.d.cts +28 -28
  221. package/lib/bubble-extra.d.ts +28 -28
  222. package/lib/bubble-extra.js +25 -25
  223. package/lib/{dom-dataset-Cuy-pIfj.cjs → dom-dataset-Byuf1YmW.cjs} +5 -5
  224. package/lib/{dom-dataset-CHDbKz5J.js → dom-dataset-Di3tIRrR.js} +94 -83
  225. package/lib/index-BI-IcZcN.cjs +1 -0
  226. package/lib/{index-CSvnpArE.cjs → index-ByRfqzMr.cjs} +2 -2
  227. package/lib/{index-DIPntess.js → index-C1fzuXpN.js} +1 -1
  228. package/lib/index-CbQQFj2T.js +133 -0
  229. package/lib/{index-BWx1Mchx.js → index-DI9T3iLd.js} +243 -243
  230. package/lib/{index-CrxasX7b.cjs → index-DclQSrIx.cjs} +1 -1
  231. package/lib/{index-DEFQHExY.js → index-LUL9mqY4.js} +1 -1
  232. package/lib/{index-h9_SDuwc.cjs → index-Z4b9rzn-.cjs} +1 -1
  233. package/lib/index.cjs +1 -1
  234. package/lib/index.d.cts +28 -28
  235. package/lib/index.d.ts +28 -28
  236. package/lib/index.js +5 -5
  237. package/lib/locale-bundle.d.cts +28 -28
  238. package/lib/locale-bundle.d.ts +28 -28
  239. package/lib/{textarea-DnBlTntN.js → textarea-6c8drwXJ.js} +1 -1
  240. package/lib/{textarea-DgXP0XRK.cjs → textarea-BsJTSgT-.cjs} +1 -1
  241. package/package.json +67 -67
  242. package/lib/RichTextEditor-DszaQdvS.cjs +0 -141
  243. package/lib/index-Cyh1yoFk.cjs +0 -1
  244. package/lib/index-oQutU45z.js +0 -129
@@ -41,9 +41,11 @@ declare module '@tiptap/core' {
41
41
 
42
42
  declare module '@tiptap/core' {
43
43
  interface Commands<ReturnType> {
44
- drawer: {
45
- setDrawer: (options: any, replace?: any) => ReturnType;
46
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
44
+ emoji: {
45
+ setEmoji: (emoji: {
46
+ name: string;
47
+ emoji: string;
48
+ }) => ReturnType;
47
49
  };
48
50
  }
49
51
  }
@@ -51,11 +53,9 @@ declare module '@tiptap/core' {
51
53
 
52
54
  declare module '@tiptap/core' {
53
55
  interface Commands<ReturnType> {
54
- emoji: {
55
- setEmoji: (emoji: {
56
- name: string;
57
- emoji: string;
58
- }) => ReturnType;
56
+ drawer: {
57
+ setDrawer: (options: any, replace?: any) => ReturnType;
58
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
59
59
  };
60
60
  }
61
61
  }
@@ -106,21 +106,6 @@ declare module '@tiptap/core' {
106
106
  }
107
107
 
108
108
 
109
- declare module '@tiptap/core' {
110
- interface Commands<ReturnType> {
111
- iframe: {
112
- /**
113
- * Add an iframe
114
- */
115
- setIframe: (options: {
116
- src: string;
117
- service: string;
118
- }) => ReturnType;
119
- };
120
- }
121
- }
122
-
123
-
124
109
  declare module '@tiptap/core' {
125
110
  interface Commands<ReturnType> {
126
111
  imageUpload: {
@@ -141,6 +126,21 @@ declare module '@tiptap/core' {
141
126
  }
142
127
 
143
128
 
129
+ declare module '@tiptap/core' {
130
+ interface Commands<ReturnType> {
131
+ iframe: {
132
+ /**
133
+ * Add an iframe
134
+ */
135
+ setIframe: (options: {
136
+ src: string;
137
+ service: string;
138
+ }) => ReturnType;
139
+ };
140
+ }
141
+ }
142
+
143
+
144
144
  declare module '@tiptap/core' {
145
145
  interface Commands<ReturnType> {
146
146
  imageGifUpload: {
@@ -179,8 +179,9 @@ declare module '@tiptap/core' {
179
179
 
180
180
  declare module '@tiptap/core' {
181
181
  interface Commands<ReturnType> {
182
- katex: {
183
- setKatex: (arg?: IKatexAttrs) => ReturnType;
182
+ lineHeight: {
183
+ setLineHeight: (lineHeight: string) => ReturnType;
184
+ unsetLineHeight: () => ReturnType;
184
185
  };
185
186
  }
186
187
  }
@@ -188,9 +189,8 @@ declare module '@tiptap/core' {
188
189
 
189
190
  declare module '@tiptap/core' {
190
191
  interface Commands<ReturnType> {
191
- lineHeight: {
192
- setLineHeight: (lineHeight: string) => ReturnType;
193
- unsetLineHeight: () => ReturnType;
192
+ katex: {
193
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
194
194
  };
195
195
  }
196
196
  }
@@ -1,9 +1,9 @@
1
- import { N as b, m as v } from "./index-BWx1Mchx.js";
2
- import { N as C, c as g, R as N } from "./dom-dataset-CHDbKz5J.js";
1
+ import { N as b, m as v } from "./index-DI9T3iLd.js";
2
+ import { N as C, c as g, R as N } from "./dom-dataset-Di3tIRrR.js";
3
3
  import { jsx as l, jsxs as T } from "react/jsx-runtime";
4
4
  import { useState as p, useCallback as m, useEffect as d } from "react";
5
5
  import { u as O } from "./index-Tj3Ci7xM.js";
6
- import { Z as _, A as y } from "./RichTextEditor-DIvPROxl.js";
6
+ import { Z as _, A as y } from "./RichTextEditor-DjTnd5Uu.js";
7
7
  const x = "_toc_aag8a_1", A = "_visible_aag8a_7", w = "_list_aag8a_11", E = "_item_aag8a_16", f = {
8
8
  toc: x,
9
9
  visible: A,
package/lib/TaskList.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CSvnpArE.cjs"),k=require("./RichTextEditor-DszaQdvS.cjs"),b=/^\s*(\[([( |x])?\])\s$/,f=a.Node.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const n=t.getAttribute("data-checked");return n===""||n==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:n}){return["li",a.mergeAttributes(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:n,getPos:c,editor:o})=>{const i=document.createElement("li"),d=document.createElement("label"),m=document.createElement("span"),s=document.createElement("input"),p=document.createElement("div");return d.contentEditable="false",s.type="checkbox",s.addEventListener("mousedown",e=>e.preventDefault()),s.addEventListener("change",e=>{if(!o.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}const{checked:r}=e.target;o.isEditable&&typeof c=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:l})=>{const u=c();if(typeof u!="number")return!1;const h=l.doc.nodeAt(u);return l.setNodeMarkup(u,void 0,{...h==null?void 0:h.attrs,checked:r}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,r)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,r])=>{i.setAttribute(e,r)}),i.dataset.checked=t.attrs.checked,s.checked=t.attrs.checked,d.append(s,m),i.append(d,p),Object.entries(n).forEach(([e,r])=>{i.setAttribute(e,r)}),{dom:i,contentDOM:p,update:e=>e.type!==this.type?!1:(i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,!0)}}},addInputRules(){return[a.wrappingInputRule({find:b,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),L=a.Node.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",a.mergeAttributes(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),T=L.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:n,t:c})=>({component:k.ActionButton,componentProps:{action:()=>n.commands.toggleTaskList(),isActive:()=>n.isActive("taskList")||!1,disabled:!1,icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:c("editor.tasklist.tooltip")}})}},addExtensions(){return[f.configure(this.options.taskItem)]}});exports.TaskList=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-ByRfqzMr.cjs"),b=require("./RichTextEditor-CAxwVWUE.cjs"),f=/^\s*(\[([( |x])?\])\s$/,L=r.Node.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const i=t.getAttribute("data-checked");return i===""||i==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:i}){return["li",r.mergeAttributes(this.options.HTMLAttributes,i,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:i,getPos:o,editor:c})=>{const a=document.createElement("li"),d=document.createElement("label"),k=document.createElement("span"),s=document.createElement("input"),l=document.createElement("div"),p=()=>{var e,n;s.ariaLabel=((n=(e=this.options.a11y)===null||e===void 0?void 0:e.checkboxLabel)===null||n===void 0?void 0:n.call(e,t,s.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`};return p(),d.contentEditable="false",s.type="checkbox",s.addEventListener("mousedown",e=>e.preventDefault()),s.addEventListener("change",e=>{if(!c.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}const{checked:n}=e.target;c.isEditable&&typeof o=="function"&&c.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:m})=>{const u=o();if(typeof u!="number")return!1;const h=m.doc.nodeAt(u);return m.setNodeMarkup(u,void 0,{...h==null?void 0:h.attrs,checked:n}),!0}).run(),!c.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,n)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,n])=>{a.setAttribute(e,n)}),a.dataset.checked=t.attrs.checked,s.checked=t.attrs.checked,d.append(s,k),a.append(d,l),Object.entries(i).forEach(([e,n])=>{a.setAttribute(e,n)}),{dom:a,contentDOM:l,update:e=>e.type!==this.type?!1:(a.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,p(),!0)}}},addInputRules(){return[r.wrappingInputRule({find:f,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),y=r.Node.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",r.mergeAttributes(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),T=y.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:i,t:o})=>({component:b.ActionButton,componentProps:{action:()=>i.commands.toggleTaskList(),isActive:()=>i.isActive("taskList")||!1,disabled:!1,icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:o("editor.tasklist.tooltip")}})}},addExtensions(){return[L.configure(this.options.taskItem)]}});exports.TaskList=T;
@@ -116,9 +116,11 @@ declare module '@tiptap/core' {
116
116
 
117
117
  declare module '@tiptap/core' {
118
118
  interface Commands<ReturnType> {
119
- drawer: {
120
- setDrawer: (options: any, replace?: any) => ReturnType;
121
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
119
+ emoji: {
120
+ setEmoji: (emoji: {
121
+ name: string;
122
+ emoji: string;
123
+ }) => ReturnType;
122
124
  };
123
125
  }
124
126
  }
@@ -126,11 +128,9 @@ declare module '@tiptap/core' {
126
128
 
127
129
  declare module '@tiptap/core' {
128
130
  interface Commands<ReturnType> {
129
- emoji: {
130
- setEmoji: (emoji: {
131
- name: string;
132
- emoji: string;
133
- }) => ReturnType;
131
+ drawer: {
132
+ setDrawer: (options: any, replace?: any) => ReturnType;
133
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
134
134
  };
135
135
  }
136
136
  }
@@ -181,21 +181,6 @@ declare module '@tiptap/core' {
181
181
  }
182
182
 
183
183
 
184
- declare module '@tiptap/core' {
185
- interface Commands<ReturnType> {
186
- iframe: {
187
- /**
188
- * Add an iframe
189
- */
190
- setIframe: (options: {
191
- src: string;
192
- service: string;
193
- }) => ReturnType;
194
- };
195
- }
196
- }
197
-
198
-
199
184
  declare module '@tiptap/core' {
200
185
  interface Commands<ReturnType> {
201
186
  imageUpload: {
@@ -216,6 +201,21 @@ declare module '@tiptap/core' {
216
201
  }
217
202
 
218
203
 
204
+ declare module '@tiptap/core' {
205
+ interface Commands<ReturnType> {
206
+ iframe: {
207
+ /**
208
+ * Add an iframe
209
+ */
210
+ setIframe: (options: {
211
+ src: string;
212
+ service: string;
213
+ }) => ReturnType;
214
+ };
215
+ }
216
+ }
217
+
218
+
219
219
  declare module '@tiptap/core' {
220
220
  interface Commands<ReturnType> {
221
221
  imageGifUpload: {
@@ -254,8 +254,9 @@ declare module '@tiptap/core' {
254
254
 
255
255
  declare module '@tiptap/core' {
256
256
  interface Commands<ReturnType> {
257
- katex: {
258
- setKatex: (arg?: IKatexAttrs) => ReturnType;
257
+ lineHeight: {
258
+ setLineHeight: (lineHeight: string) => ReturnType;
259
+ unsetLineHeight: () => ReturnType;
259
260
  };
260
261
  }
261
262
  }
@@ -263,9 +264,8 @@ declare module '@tiptap/core' {
263
264
 
264
265
  declare module '@tiptap/core' {
265
266
  interface Commands<ReturnType> {
266
- lineHeight: {
267
- setLineHeight: (lineHeight: string) => ReturnType;
268
- unsetLineHeight: () => ReturnType;
267
+ katex: {
268
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
269
269
  };
270
270
  }
271
271
  }
package/lib/TaskList.d.ts CHANGED
@@ -116,9 +116,11 @@ declare module '@tiptap/core' {
116
116
 
117
117
  declare module '@tiptap/core' {
118
118
  interface Commands<ReturnType> {
119
- drawer: {
120
- setDrawer: (options: any, replace?: any) => ReturnType;
121
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
119
+ emoji: {
120
+ setEmoji: (emoji: {
121
+ name: string;
122
+ emoji: string;
123
+ }) => ReturnType;
122
124
  };
123
125
  }
124
126
  }
@@ -126,11 +128,9 @@ declare module '@tiptap/core' {
126
128
 
127
129
  declare module '@tiptap/core' {
128
130
  interface Commands<ReturnType> {
129
- emoji: {
130
- setEmoji: (emoji: {
131
- name: string;
132
- emoji: string;
133
- }) => ReturnType;
131
+ drawer: {
132
+ setDrawer: (options: any, replace?: any) => ReturnType;
133
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
134
134
  };
135
135
  }
136
136
  }
@@ -181,21 +181,6 @@ declare module '@tiptap/core' {
181
181
  }
182
182
 
183
183
 
184
- declare module '@tiptap/core' {
185
- interface Commands<ReturnType> {
186
- iframe: {
187
- /**
188
- * Add an iframe
189
- */
190
- setIframe: (options: {
191
- src: string;
192
- service: string;
193
- }) => ReturnType;
194
- };
195
- }
196
- }
197
-
198
-
199
184
  declare module '@tiptap/core' {
200
185
  interface Commands<ReturnType> {
201
186
  imageUpload: {
@@ -216,6 +201,21 @@ declare module '@tiptap/core' {
216
201
  }
217
202
 
218
203
 
204
+ declare module '@tiptap/core' {
205
+ interface Commands<ReturnType> {
206
+ iframe: {
207
+ /**
208
+ * Add an iframe
209
+ */
210
+ setIframe: (options: {
211
+ src: string;
212
+ service: string;
213
+ }) => ReturnType;
214
+ };
215
+ }
216
+ }
217
+
218
+
219
219
  declare module '@tiptap/core' {
220
220
  interface Commands<ReturnType> {
221
221
  imageGifUpload: {
@@ -254,8 +254,9 @@ declare module '@tiptap/core' {
254
254
 
255
255
  declare module '@tiptap/core' {
256
256
  interface Commands<ReturnType> {
257
- katex: {
258
- setKatex: (arg?: IKatexAttrs) => ReturnType;
257
+ lineHeight: {
258
+ setLineHeight: (lineHeight: string) => ReturnType;
259
+ unsetLineHeight: () => ReturnType;
259
260
  };
260
261
  }
261
262
  }
@@ -263,9 +264,8 @@ declare module '@tiptap/core' {
263
264
 
264
265
  declare module '@tiptap/core' {
265
266
  interface Commands<ReturnType> {
266
- lineHeight: {
267
- setLineHeight: (lineHeight: string) => ReturnType;
268
- unsetLineHeight: () => ReturnType;
267
+ katex: {
268
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
269
269
  };
270
270
  }
271
271
  }
package/lib/TaskList.js CHANGED
@@ -1,12 +1,13 @@
1
- import { N as m, w as b, m as l } from "./index-BWx1Mchx.js";
2
- import { A as f } from "./RichTextEditor-DIvPROxl.js";
3
- const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
1
+ import { N as m, w as f, m as k } from "./index-DI9T3iLd.js";
2
+ import { A as L } from "./RichTextEditor-DjTnd5Uu.js";
3
+ const y = /^\s*(\[([( |x])?\])\s$/, T = m.create({
4
4
  name: "taskItem",
5
5
  addOptions() {
6
6
  return {
7
7
  nested: !1,
8
8
  HTMLAttributes: {},
9
- taskListTypeName: "taskList"
9
+ taskListTypeName: "taskList",
10
+ a11y: void 0
10
11
  };
11
12
  },
12
13
  content() {
@@ -19,8 +20,8 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
19
20
  default: !1,
20
21
  keepOnSplit: !1,
21
22
  parseHTML: (t) => {
22
- const n = t.getAttribute("data-checked");
23
- return n === "" || n === "true";
23
+ const i = t.getAttribute("data-checked");
24
+ return i === "" || i === "true";
24
25
  },
25
26
  renderHTML: (t) => ({
26
27
  "data-checked": t.checked
@@ -36,10 +37,10 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
36
37
  }
37
38
  ];
38
39
  },
39
- renderHTML({ node: t, HTMLAttributes: n }) {
40
+ renderHTML({ node: t, HTMLAttributes: i }) {
40
41
  return [
41
42
  "li",
42
- l(this.options.HTMLAttributes, n, {
43
+ k(this.options.HTMLAttributes, i, {
43
44
  "data-type": this.name
44
45
  }),
45
46
  [
@@ -67,39 +68,42 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
67
68
  } : t;
68
69
  },
69
70
  addNodeView() {
70
- return ({ node: t, HTMLAttributes: n, getPos: r, editor: o }) => {
71
- const i = document.createElement("li"), c = document.createElement("label"), k = document.createElement("span"), s = document.createElement("input"), h = document.createElement("div");
72
- return c.contentEditable = "false", s.type = "checkbox", s.addEventListener("mousedown", (e) => e.preventDefault()), s.addEventListener("change", (e) => {
71
+ return ({ node: t, HTMLAttributes: i, getPos: r, editor: o }) => {
72
+ const a = document.createElement("li"), c = document.createElement("label"), b = document.createElement("span"), s = document.createElement("input"), h = document.createElement("div"), p = () => {
73
+ var e, n;
74
+ s.ariaLabel = ((n = (e = this.options.a11y) === null || e === void 0 ? void 0 : e.checkboxLabel) === null || n === void 0 ? void 0 : n.call(e, t, s.checked)) || `Task item checkbox for ${t.textContent || "empty task item"}`;
75
+ };
76
+ return p(), c.contentEditable = "false", s.type = "checkbox", s.addEventListener("mousedown", (e) => e.preventDefault()), s.addEventListener("change", (e) => {
73
77
  if (!o.isEditable && !this.options.onReadOnlyChecked) {
74
78
  s.checked = !s.checked;
75
79
  return;
76
80
  }
77
- const { checked: a } = e.target;
78
- o.isEditable && typeof r == "function" && o.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: p }) => {
81
+ const { checked: n } = e.target;
82
+ o.isEditable && typeof r == "function" && o.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: l }) => {
79
83
  const d = r();
80
84
  if (typeof d != "number")
81
85
  return !1;
82
- const u = p.doc.nodeAt(d);
83
- return p.setNodeMarkup(d, void 0, {
86
+ const u = l.doc.nodeAt(d);
87
+ return l.setNodeMarkup(d, void 0, {
84
88
  ...u == null ? void 0 : u.attrs,
85
- checked: a
89
+ checked: n
86
90
  }), !0;
87
- }).run(), !o.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, a) || (s.checked = !s.checked));
88
- }), Object.entries(this.options.HTMLAttributes).forEach(([e, a]) => {
89
- i.setAttribute(e, a);
90
- }), i.dataset.checked = t.attrs.checked, s.checked = t.attrs.checked, c.append(s, k), i.append(c, h), Object.entries(n).forEach(([e, a]) => {
91
- i.setAttribute(e, a);
91
+ }).run(), !o.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, n) || (s.checked = !s.checked));
92
+ }), Object.entries(this.options.HTMLAttributes).forEach(([e, n]) => {
93
+ a.setAttribute(e, n);
94
+ }), a.dataset.checked = t.attrs.checked, s.checked = t.attrs.checked, c.append(s, b), a.append(c, h), Object.entries(i).forEach(([e, n]) => {
95
+ a.setAttribute(e, n);
92
96
  }), {
93
- dom: i,
97
+ dom: a,
94
98
  contentDOM: h,
95
- update: (e) => e.type !== this.type ? !1 : (i.dataset.checked = e.attrs.checked, s.checked = e.attrs.checked, !0)
99
+ update: (e) => e.type !== this.type ? !1 : (a.dataset.checked = e.attrs.checked, s.checked = e.attrs.checked, p(), !0)
96
100
  };
97
101
  };
98
102
  },
99
103
  addInputRules() {
100
104
  return [
101
- b({
102
- find: L,
105
+ f({
106
+ find: y,
103
107
  type: this.type,
104
108
  getAttributes: (t) => ({
105
109
  checked: t[t.length - 1] === "x"
@@ -107,7 +111,7 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
107
111
  })
108
112
  ];
109
113
  }
110
- }), y = m.create({
114
+ }), g = m.create({
111
115
  name: "taskList",
112
116
  addOptions() {
113
117
  return {
@@ -128,7 +132,7 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
128
132
  ];
129
133
  },
130
134
  renderHTML({ HTMLAttributes: t }) {
131
- return ["ul", l(this.options.HTMLAttributes, t, { "data-type": this.name }), 0];
135
+ return ["ul", k(this.options.HTMLAttributes, t, { "data-type": this.name }), 0];
132
136
  },
133
137
  addCommands() {
134
138
  return {
@@ -140,7 +144,7 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
140
144
  "Mod-Shift-9": () => this.editor.commands.toggleTaskList()
141
145
  };
142
146
  }
143
- }), M = /* @__PURE__ */ y.extend({
147
+ }), E = /* @__PURE__ */ g.extend({
144
148
  addOptions() {
145
149
  var t;
146
150
  return {
@@ -153,11 +157,11 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
153
157
  class: "task-list-item"
154
158
  }
155
159
  },
156
- button: ({ editor: n, t: r }) => ({
157
- component: f,
160
+ button: ({ editor: i, t: r }) => ({
161
+ component: L,
158
162
  componentProps: {
159
- action: () => n.commands.toggleTaskList(),
160
- isActive: () => n.isActive("taskList") || !1,
163
+ action: () => i.commands.toggleTaskList(),
164
+ isActive: () => i.isActive("taskList") || !1,
161
165
  disabled: !1,
162
166
  icon: "ListTodo",
163
167
  shortcutKeys: ["shift", "mod", "9"],
@@ -171,5 +175,5 @@ const L = /^\s*(\[([( |x])?\])\s$/, T = m.create({
171
175
  }
172
176
  });
173
177
  export {
174
- M as TaskList
178
+ E as TaskList
175
179
  };
package/lib/TextAlign.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index-CSvnpArE.cjs"),n=require("react/jsx-runtime"),T=require("react"),s=require("./RichTextEditor-DszaQdvS.cjs"),j=y.Extension.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(l=>e.updateAttributes(l,{textAlign:t})).every(l=>l):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:l})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?l.unsetTextAlign():l.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function b(t){var l;const e=T.useMemo(()=>{var o;const i=(o=t==null?void 0:t.items)==null?void 0:o.find(a=>a.isActive());return i&&!i.default?{...i,icon:i.icon?i.icon:t.icon}:{title:t==null?void 0:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return n.jsxs(s.Popover,{modal:!0,children:[n.jsx(s.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:n.jsx(s.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:t==null?void 0:t.disabled,icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,children:n.jsx(s.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),n.jsx(s.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",children:(l=t==null?void 0:t.items)==null?void 0:l.map((i,d)=>{var o,a;return n.jsxs(s.Tooltip,{children:[n.jsx(s.TooltipTrigger,{asChild:!0,children:n.jsx(s.Toggle,{className:"richtext-size-7 richtext-p-1","data-state":e.title===i.title?"on":"off",onClick:i==null?void 0:i.action,pressed:e.title===i.title,size:"sm",children:(i==null?void 0:i.icon)&&n.jsx(s.IconComponent,{name:i.icon})})}),n.jsxs(s.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[n.jsx("span",{children:i.title}),!!((o=i.shortcutKeys)!=null&&o.length)&&n.jsx("span",{children:(a=i.shortcutKeys)==null?void 0:a.map(r=>s.getShortcutKey(r)).join(" ")})]})]},`text-align-${d}`)})})]})}const v=j.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["heading","paragraph","list_item","title"],button({editor:e,extension:l,t:i}){var x;const d=((x=l.options)==null?void 0:x.alignments)||[],o={left:["mod","Shift","L"],center:["mod","Shift","E"],right:["mod","Shift","R"],justify:["mod","Shift","J"]},a={left:"AlignLeft",center:"AlignCenter",right:"AlignRight",justify:"AlignJustify"},r=d.map(c=>{var g,h,f;return{title:i(`editor.textalign.${c}.tooltip`),icon:a[c],shortcutKeys:o[c],isActive:()=>e.isActive({textAlign:c})||!1,action:()=>{var u,A;return(A=(u=e.commands)==null?void 0:u.setTextAlign)==null?void 0:A.call(u,c)},disabled:!((f=(h=(g=e==null?void 0:e.can)==null?void 0:g.call(e))==null?void 0:h.setTextAlign)!=null&&f.call(h,c))}}),m=r.filter(c=>c.disabled).length===r.length;return{component:b,componentProps:{icon:"AlignJustify",tooltip:i("editor.textalign.tooltip"),disabled:m,items:r}}}}}});exports.TextAlign=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index-ByRfqzMr.cjs"),n=require("react/jsx-runtime"),T=require("react"),s=require("./RichTextEditor-CAxwVWUE.cjs"),j=y.Extension.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(l=>e.updateAttributes(l,{textAlign:t})).every(l=>l):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:l})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?l.unsetTextAlign():l.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function b(t){var l;const e=T.useMemo(()=>{var o;const i=(o=t==null?void 0:t.items)==null?void 0:o.find(a=>a.isActive());return i&&!i.default?{...i,icon:i.icon?i.icon:t.icon}:{title:t==null?void 0:t.tooltip,icon:t.icon,isActive:()=>!1}},[t]);return n.jsxs(s.Popover,{modal:!0,children:[n.jsx(s.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:n.jsx(s.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:t==null?void 0:t.disabled,icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip,children:n.jsx(s.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),n.jsx(s.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",children:(l=t==null?void 0:t.items)==null?void 0:l.map((i,d)=>{var o,a;return n.jsxs(s.Tooltip,{children:[n.jsx(s.TooltipTrigger,{asChild:!0,children:n.jsx(s.Toggle,{className:"richtext-size-7 richtext-p-1","data-state":e.title===i.title?"on":"off",onClick:i==null?void 0:i.action,pressed:e.title===i.title,size:"sm",children:(i==null?void 0:i.icon)&&n.jsx(s.IconComponent,{name:i.icon})})}),n.jsxs(s.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[n.jsx("span",{children:i.title}),!!((o=i.shortcutKeys)!=null&&o.length)&&n.jsx("span",{children:(a=i.shortcutKeys)==null?void 0:a.map(r=>s.getShortcutKey(r)).join(" ")})]})]},`text-align-${d}`)})})]})}const v=j.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["heading","paragraph","list_item","title"],button({editor:e,extension:l,t:i}){var x;const d=((x=l.options)==null?void 0:x.alignments)||[],o={left:["mod","Shift","L"],center:["mod","Shift","E"],right:["mod","Shift","R"],justify:["mod","Shift","J"]},a={left:"AlignLeft",center:"AlignCenter",right:"AlignRight",justify:"AlignJustify"},r=d.map(c=>{var g,h,f;return{title:i(`editor.textalign.${c}.tooltip`),icon:a[c],shortcutKeys:o[c],isActive:()=>e.isActive({textAlign:c})||!1,action:()=>{var u,A;return(A=(u=e.commands)==null?void 0:u.setTextAlign)==null?void 0:A.call(u,c)},disabled:!((f=(h=(g=e==null?void 0:e.can)==null?void 0:g.call(e))==null?void 0:h.setTextAlign)!=null&&f.call(h,c))}}),m=r.filter(c=>c.disabled).length===r.length;return{component:b,componentProps:{icon:"AlignJustify",tooltip:i("editor.textalign.tooltip"),disabled:m,items:r}}}}}});exports.TextAlign=v;
@@ -120,9 +120,11 @@ declare module '@tiptap/core' {
120
120
 
121
121
  declare module '@tiptap/core' {
122
122
  interface Commands<ReturnType> {
123
- drawer: {
124
- setDrawer: (options: any, replace?: any) => ReturnType;
125
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
123
+ emoji: {
124
+ setEmoji: (emoji: {
125
+ name: string;
126
+ emoji: string;
127
+ }) => ReturnType;
126
128
  };
127
129
  }
128
130
  }
@@ -130,11 +132,9 @@ declare module '@tiptap/core' {
130
132
 
131
133
  declare module '@tiptap/core' {
132
134
  interface Commands<ReturnType> {
133
- emoji: {
134
- setEmoji: (emoji: {
135
- name: string;
136
- emoji: string;
137
- }) => ReturnType;
135
+ drawer: {
136
+ setDrawer: (options: any, replace?: any) => ReturnType;
137
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
138
138
  };
139
139
  }
140
140
  }
@@ -185,21 +185,6 @@ declare module '@tiptap/core' {
185
185
  }
186
186
 
187
187
 
188
- declare module '@tiptap/core' {
189
- interface Commands<ReturnType> {
190
- iframe: {
191
- /**
192
- * Add an iframe
193
- */
194
- setIframe: (options: {
195
- src: string;
196
- service: string;
197
- }) => ReturnType;
198
- };
199
- }
200
- }
201
-
202
-
203
188
  declare module '@tiptap/core' {
204
189
  interface Commands<ReturnType> {
205
190
  imageUpload: {
@@ -220,6 +205,21 @@ declare module '@tiptap/core' {
220
205
  }
221
206
 
222
207
 
208
+ declare module '@tiptap/core' {
209
+ interface Commands<ReturnType> {
210
+ iframe: {
211
+ /**
212
+ * Add an iframe
213
+ */
214
+ setIframe: (options: {
215
+ src: string;
216
+ service: string;
217
+ }) => ReturnType;
218
+ };
219
+ }
220
+ }
221
+
222
+
223
223
  declare module '@tiptap/core' {
224
224
  interface Commands<ReturnType> {
225
225
  imageGifUpload: {
@@ -258,8 +258,9 @@ declare module '@tiptap/core' {
258
258
 
259
259
  declare module '@tiptap/core' {
260
260
  interface Commands<ReturnType> {
261
- katex: {
262
- setKatex: (arg?: IKatexAttrs) => ReturnType;
261
+ lineHeight: {
262
+ setLineHeight: (lineHeight: string) => ReturnType;
263
+ unsetLineHeight: () => ReturnType;
263
264
  };
264
265
  }
265
266
  }
@@ -267,9 +268,8 @@ declare module '@tiptap/core' {
267
268
 
268
269
  declare module '@tiptap/core' {
269
270
  interface Commands<ReturnType> {
270
- lineHeight: {
271
- setLineHeight: (lineHeight: string) => ReturnType;
272
- unsetLineHeight: () => ReturnType;
271
+ katex: {
272
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
273
273
  };
274
274
  }
275
275
  }