reactjs-tiptap-editor 0.3.18 → 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 (251) hide show
  1. package/lib/{ActionMenuButton-Bp3NtBKu.cjs → ActionMenuButton-BTFBZyG2.cjs} +1 -1
  2. package/lib/{ActionMenuButton-CK00Dg3S.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 +4 -4
  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-D7O4q7Un.cjs → Drawer-BrHHs2E9.cjs} +1 -1
  44. package/lib/{Drawer-B5bTsUf8.js → Drawer-CVuwyG50.js} +4 -4
  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 +5 -5
  53. package/lib/Excalidraw-Be_GDV4Q.cjs +1 -0
  54. package/lib/Excalidraw-frMX4K62.js +289 -0
  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 +5 -5
  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 +4 -4
  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 +29 -28
  101. package/lib/Image.d.ts +29 -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 +5 -5
  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 +3 -3
  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 +5 -5
  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-DWN9FEob.js → RichTextEditor-DjTnd5Uu.js} +2336 -2328
  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 +3 -3
  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 +5 -5
  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 +3 -3
  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 +4 -4
  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 +3 -3
  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-COZu8DI2.cjs → Twitter-V0OzBT_E.cjs} +1 -1
  210. package/lib/{Twitter-J0XtGXRC.js → Twitter-dRxbZOad.js} +4 -4
  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 +3 -3
  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 +26 -26
  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-C19MB4Al.cjs +1 -0
  228. package/lib/{index-DIPntess.js → index-C1fzuXpN.js} +1 -1
  229. package/lib/index-CbQQFj2T.js +133 -0
  230. package/lib/{index-BWx1Mchx.js → index-DI9T3iLd.js} +243 -243
  231. package/lib/{index-CrxasX7b.cjs → index-DclQSrIx.cjs} +1 -1
  232. package/lib/{index-DEFQHExY.js → index-LUL9mqY4.js} +1 -1
  233. package/lib/{index-zcKfSGd5.js → index-Tj3Ci7xM.js} +13 -8
  234. package/lib/{index-h9_SDuwc.cjs → index-Z4b9rzn-.cjs} +1 -1
  235. package/lib/index.cjs +1 -1
  236. package/lib/index.d.cts +28 -28
  237. package/lib/index.d.ts +28 -28
  238. package/lib/index.js +6 -6
  239. package/lib/locale-bundle.cjs +1 -1
  240. package/lib/locale-bundle.d.cts +33 -28
  241. package/lib/locale-bundle.d.ts +33 -28
  242. package/lib/locale-bundle.js +1 -1
  243. package/lib/{textarea-Bm0GTcEU.js → textarea-6c8drwXJ.js} +1 -1
  244. package/lib/{textarea-C_xhu0vT.cjs → textarea-BsJTSgT-.cjs} +1 -1
  245. package/package.json +67 -67
  246. package/lib/Excalidraw-CzAhPJ3k.cjs +0 -1
  247. package/lib/Excalidraw-D1EJKRER.js +0 -282
  248. package/lib/RichTextEditor-jtVXJcE2.cjs +0 -141
  249. package/lib/index-Cyh1yoFk.cjs +0 -1
  250. package/lib/index-jEB3jXoa.cjs +0 -1
  251. package/lib/index-oQutU45z.js +0 -129
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-CSvnpArE.cjs"),g=require("./index-jEB3jXoa.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-jtVXJcE2.cjs");function T(e){return Number.parseFloat(e.replace("%",""))/100}function x(e){const{t}=g.useLocale(),[n,r]=L.useState("default");function o(i){i==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(i),r(i)}const d=L.useMemo(()=>{const s=e.editor.extensionManager.extensions.find(l=>l.name==="lineHeight").options.lineHeights.map(l=>({label:T(l),value:l}));return s.unshift({label:t("editor.default"),value:"default"}),s},[e]);return c.jsxs(u.DropdownMenu,{children:[c.jsx(u.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(u.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:e==null?void 0:e.disabled,icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,children:c.jsx(u.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),c.jsx(u.DropdownMenuContent,{className:"richtext-min-w-24",children:d==null?void 0:d.map((i,h)=>c.jsx(u.DropdownMenuCheckboxItem,{checked:i.value===n,onClick:()=>o(i.value),children:i.label},`lineHeight-${h}`))})]})}const _=["paragraph","heading","list_item","todo_item"];function E(e,t){const{selection:n,doc:r}=e;if(!n||!r||!(n instanceof m.TextSelection||n instanceof m.AllSelection))return e;const{from:o,to:d}=n,i=[],h=t&&t!==g.DEFAULT_LINE_HEIGHT?t:null;if(r.nodesBetween(o,d,(s,l)=>{const a=s.type;return _.includes(a.name)?((s.attrs.lineHeight||null)!==h&&i.push({node:s,pos:l,nodeType:a}),a.name!=="list_item"&&a.name!=="todo_item"):!0}),i.length===0)return e;for(const s of i){const{node:l,pos:a,nodeType:f}=s;let{attrs:H}=l;H={...H,lineHeight:h},e=e.setNodeMarkup(a,f,H,l.marks)}return e}function b(e){return({state:t,dispatch:n})=>{const{selection:r}=t;let{tr:o}=t;return o=o.setSelection(r),o=E(o,e),o.docChanged?(n&&n(o),!0):!1}}const I=m.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:g.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:g.DEFAULT_LINE_HEIGHT,button({editor:t,t:n}){return{component:x,componentProps:{editor:t,tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>b(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}});exports.DEFAULT_LINE_HEIGHT_LIST=g.DEFAULT_LINE_HEIGHT_LIST;exports.LineHeight=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-ByRfqzMr.cjs"),g=require("./index-C19MB4Al.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-CAxwVWUE.cjs");function T(e){return Number.parseFloat(e.replace("%",""))/100}function x(e){const{t}=g.useLocale(),[n,r]=L.useState("default");function o(i){i==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(i),r(i)}const d=L.useMemo(()=>{const s=e.editor.extensionManager.extensions.find(l=>l.name==="lineHeight").options.lineHeights.map(l=>({label:T(l),value:l}));return s.unshift({label:t("editor.default"),value:"default"}),s},[e]);return c.jsxs(u.DropdownMenu,{children:[c.jsx(u.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(u.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:e==null?void 0:e.disabled,icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,children:c.jsx(u.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),c.jsx(u.DropdownMenuContent,{className:"richtext-min-w-24",children:d==null?void 0:d.map((i,h)=>c.jsx(u.DropdownMenuCheckboxItem,{checked:i.value===n,onClick:()=>o(i.value),children:i.label},`lineHeight-${h}`))})]})}const _=["paragraph","heading","list_item","todo_item"];function E(e,t){const{selection:n,doc:r}=e;if(!n||!r||!(n instanceof m.TextSelection||n instanceof m.AllSelection))return e;const{from:o,to:d}=n,i=[],h=t&&t!==g.DEFAULT_LINE_HEIGHT?t:null;if(r.nodesBetween(o,d,(s,l)=>{const a=s.type;return _.includes(a.name)?((s.attrs.lineHeight||null)!==h&&i.push({node:s,pos:l,nodeType:a}),a.name!=="list_item"&&a.name!=="todo_item"):!0}),i.length===0)return e;for(const s of i){const{node:l,pos:a,nodeType:f}=s;let{attrs:H}=l;H={...H,lineHeight:h},e=e.setNodeMarkup(a,f,H,l.marks)}return e}function b(e){return({state:t,dispatch:n})=>{const{selection:r}=t;let{tr:o}=t;return o=o.setSelection(r),o=E(o,e),o.docChanged?(n&&n(o),!0):!1}}const I=m.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:g.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:g.DEFAULT_LINE_HEIGHT,button({editor:t,t:n}){return{component:x,componentProps:{editor:t,tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>b(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}});exports.DEFAULT_LINE_HEIGHT_LIST=g.DEFAULT_LINE_HEIGHT_LIST;exports.LineHeight=I;
@@ -114,9 +114,11 @@ declare module '@tiptap/core' {
114
114
 
115
115
  declare module '@tiptap/core' {
116
116
  interface Commands<ReturnType> {
117
- drawer: {
118
- setDrawer: (options: any, replace?: any) => ReturnType;
119
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
117
+ emoji: {
118
+ setEmoji: (emoji: {
119
+ name: string;
120
+ emoji: string;
121
+ }) => ReturnType;
120
122
  };
121
123
  }
122
124
  }
@@ -124,11 +126,9 @@ declare module '@tiptap/core' {
124
126
 
125
127
  declare module '@tiptap/core' {
126
128
  interface Commands<ReturnType> {
127
- emoji: {
128
- setEmoji: (emoji: {
129
- name: string;
130
- emoji: string;
131
- }) => ReturnType;
129
+ drawer: {
130
+ setDrawer: (options: any, replace?: any) => ReturnType;
131
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
132
132
  };
133
133
  }
134
134
  }
@@ -179,21 +179,6 @@ declare module '@tiptap/core' {
179
179
  }
180
180
 
181
181
 
182
- declare module '@tiptap/core' {
183
- interface Commands<ReturnType> {
184
- iframe: {
185
- /**
186
- * Add an iframe
187
- */
188
- setIframe: (options: {
189
- src: string;
190
- service: string;
191
- }) => ReturnType;
192
- };
193
- }
194
- }
195
-
196
-
197
182
  declare module '@tiptap/core' {
198
183
  interface Commands<ReturnType> {
199
184
  imageUpload: {
@@ -214,6 +199,21 @@ declare module '@tiptap/core' {
214
199
  }
215
200
 
216
201
 
202
+ declare module '@tiptap/core' {
203
+ interface Commands<ReturnType> {
204
+ iframe: {
205
+ /**
206
+ * Add an iframe
207
+ */
208
+ setIframe: (options: {
209
+ src: string;
210
+ service: string;
211
+ }) => ReturnType;
212
+ };
213
+ }
214
+ }
215
+
216
+
217
217
  declare module '@tiptap/core' {
218
218
  interface Commands<ReturnType> {
219
219
  imageGifUpload: {
@@ -252,8 +252,9 @@ declare module '@tiptap/core' {
252
252
 
253
253
  declare module '@tiptap/core' {
254
254
  interface Commands<ReturnType> {
255
- katex: {
256
- setKatex: (arg?: IKatexAttrs) => ReturnType;
255
+ lineHeight: {
256
+ setLineHeight: (lineHeight: string) => ReturnType;
257
+ unsetLineHeight: () => ReturnType;
257
258
  };
258
259
  }
259
260
  }
@@ -261,9 +262,8 @@ declare module '@tiptap/core' {
261
262
 
262
263
  declare module '@tiptap/core' {
263
264
  interface Commands<ReturnType> {
264
- lineHeight: {
265
- setLineHeight: (lineHeight: string) => ReturnType;
266
- unsetLineHeight: () => ReturnType;
265
+ katex: {
266
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
267
267
  };
268
268
  }
269
269
  }
@@ -114,9 +114,11 @@ declare module '@tiptap/core' {
114
114
 
115
115
  declare module '@tiptap/core' {
116
116
  interface Commands<ReturnType> {
117
- drawer: {
118
- setDrawer: (options: any, replace?: any) => ReturnType;
119
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
117
+ emoji: {
118
+ setEmoji: (emoji: {
119
+ name: string;
120
+ emoji: string;
121
+ }) => ReturnType;
120
122
  };
121
123
  }
122
124
  }
@@ -124,11 +126,9 @@ declare module '@tiptap/core' {
124
126
 
125
127
  declare module '@tiptap/core' {
126
128
  interface Commands<ReturnType> {
127
- emoji: {
128
- setEmoji: (emoji: {
129
- name: string;
130
- emoji: string;
131
- }) => ReturnType;
129
+ drawer: {
130
+ setDrawer: (options: any, replace?: any) => ReturnType;
131
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
132
132
  };
133
133
  }
134
134
  }
@@ -179,21 +179,6 @@ declare module '@tiptap/core' {
179
179
  }
180
180
 
181
181
 
182
- declare module '@tiptap/core' {
183
- interface Commands<ReturnType> {
184
- iframe: {
185
- /**
186
- * Add an iframe
187
- */
188
- setIframe: (options: {
189
- src: string;
190
- service: string;
191
- }) => ReturnType;
192
- };
193
- }
194
- }
195
-
196
-
197
182
  declare module '@tiptap/core' {
198
183
  interface Commands<ReturnType> {
199
184
  imageUpload: {
@@ -214,6 +199,21 @@ declare module '@tiptap/core' {
214
199
  }
215
200
 
216
201
 
202
+ declare module '@tiptap/core' {
203
+ interface Commands<ReturnType> {
204
+ iframe: {
205
+ /**
206
+ * Add an iframe
207
+ */
208
+ setIframe: (options: {
209
+ src: string;
210
+ service: string;
211
+ }) => ReturnType;
212
+ };
213
+ }
214
+ }
215
+
216
+
217
217
  declare module '@tiptap/core' {
218
218
  interface Commands<ReturnType> {
219
219
  imageGifUpload: {
@@ -252,8 +252,9 @@ declare module '@tiptap/core' {
252
252
 
253
253
  declare module '@tiptap/core' {
254
254
  interface Commands<ReturnType> {
255
- katex: {
256
- setKatex: (arg?: IKatexAttrs) => ReturnType;
255
+ lineHeight: {
256
+ setLineHeight: (lineHeight: string) => ReturnType;
257
+ unsetLineHeight: () => ReturnType;
257
258
  };
258
259
  }
259
260
  }
@@ -261,9 +262,8 @@ declare module '@tiptap/core' {
261
262
 
262
263
  declare module '@tiptap/core' {
263
264
  interface Commands<ReturnType> {
264
- lineHeight: {
265
- setLineHeight: (lineHeight: string) => ReturnType;
266
- unsetLineHeight: () => ReturnType;
265
+ katex: {
266
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
267
267
  };
268
268
  }
269
269
  }
package/lib/LineHeight.js CHANGED
@@ -1,8 +1,8 @@
1
- import { T as f, A as H, E as L } from "./index-BWx1Mchx.js";
2
- import { u as x, j as m, k as T } from "./index-zcKfSGd5.js";
1
+ import { T as f, A as H, E as L } from "./index-DI9T3iLd.js";
2
+ import { u as x, j as m, k as T } from "./index-Tj3Ci7xM.js";
3
3
  import { jsxs as b, jsx as h } from "react/jsx-runtime";
4
4
  import { useState as p, useMemo as _ } from "react";
5
- import { D, e as E, A as M, k as w, f as A, h as C } from "./RichTextEditor-DWN9FEob.js";
5
+ import { D, e as E, A as M, k as w, f as A, h as C } from "./RichTextEditor-DjTnd5Uu.js";
6
6
  function y(e) {
7
7
  return Number.parseFloat(e.replace("%", "")) / 100;
8
8
  }
package/lib/Link.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-CSvnpArE.cjs");const e=require("./RichTextEditor-jtVXJcE2.cjs");exports.Link=e.Link;exports.default=e.Link;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-CAxwVWUE.cjs");exports.Link=e.Link;exports.default=e.Link;
package/lib/Link.d.cts CHANGED
@@ -112,9 +112,11 @@ declare module '@tiptap/core' {
112
112
 
113
113
  declare module '@tiptap/core' {
114
114
  interface Commands<ReturnType> {
115
- drawer: {
116
- setDrawer: (options: any, replace?: any) => ReturnType;
117
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
115
+ emoji: {
116
+ setEmoji: (emoji: {
117
+ name: string;
118
+ emoji: string;
119
+ }) => ReturnType;
118
120
  };
119
121
  }
120
122
  }
@@ -122,11 +124,9 @@ declare module '@tiptap/core' {
122
124
 
123
125
  declare module '@tiptap/core' {
124
126
  interface Commands<ReturnType> {
125
- emoji: {
126
- setEmoji: (emoji: {
127
- name: string;
128
- emoji: string;
129
- }) => ReturnType;
127
+ drawer: {
128
+ setDrawer: (options: any, replace?: any) => ReturnType;
129
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
130
130
  };
131
131
  }
132
132
  }
@@ -177,21 +177,6 @@ declare module '@tiptap/core' {
177
177
  }
178
178
 
179
179
 
180
- declare module '@tiptap/core' {
181
- interface Commands<ReturnType> {
182
- iframe: {
183
- /**
184
- * Add an iframe
185
- */
186
- setIframe: (options: {
187
- src: string;
188
- service: string;
189
- }) => ReturnType;
190
- };
191
- }
192
- }
193
-
194
-
195
180
  declare module '@tiptap/core' {
196
181
  interface Commands<ReturnType> {
197
182
  imageUpload: {
@@ -212,6 +197,21 @@ declare module '@tiptap/core' {
212
197
  }
213
198
 
214
199
 
200
+ declare module '@tiptap/core' {
201
+ interface Commands<ReturnType> {
202
+ iframe: {
203
+ /**
204
+ * Add an iframe
205
+ */
206
+ setIframe: (options: {
207
+ src: string;
208
+ service: string;
209
+ }) => ReturnType;
210
+ };
211
+ }
212
+ }
213
+
214
+
215
215
  declare module '@tiptap/core' {
216
216
  interface Commands<ReturnType> {
217
217
  imageGifUpload: {
@@ -250,8 +250,9 @@ declare module '@tiptap/core' {
250
250
 
251
251
  declare module '@tiptap/core' {
252
252
  interface Commands<ReturnType> {
253
- katex: {
254
- setKatex: (arg?: IKatexAttrs) => ReturnType;
253
+ lineHeight: {
254
+ setLineHeight: (lineHeight: string) => ReturnType;
255
+ unsetLineHeight: () => ReturnType;
255
256
  };
256
257
  }
257
258
  }
@@ -259,9 +260,8 @@ declare module '@tiptap/core' {
259
260
 
260
261
  declare module '@tiptap/core' {
261
262
  interface Commands<ReturnType> {
262
- lineHeight: {
263
- setLineHeight: (lineHeight: string) => ReturnType;
264
- unsetLineHeight: () => ReturnType;
263
+ katex: {
264
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
265
265
  };
266
266
  }
267
267
  }
package/lib/Link.d.ts CHANGED
@@ -112,9 +112,11 @@ declare module '@tiptap/core' {
112
112
 
113
113
  declare module '@tiptap/core' {
114
114
  interface Commands<ReturnType> {
115
- drawer: {
116
- setDrawer: (options: any, replace?: any) => ReturnType;
117
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
115
+ emoji: {
116
+ setEmoji: (emoji: {
117
+ name: string;
118
+ emoji: string;
119
+ }) => ReturnType;
118
120
  };
119
121
  }
120
122
  }
@@ -122,11 +124,9 @@ declare module '@tiptap/core' {
122
124
 
123
125
  declare module '@tiptap/core' {
124
126
  interface Commands<ReturnType> {
125
- emoji: {
126
- setEmoji: (emoji: {
127
- name: string;
128
- emoji: string;
129
- }) => ReturnType;
127
+ drawer: {
128
+ setDrawer: (options: any, replace?: any) => ReturnType;
129
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
130
130
  };
131
131
  }
132
132
  }
@@ -177,21 +177,6 @@ declare module '@tiptap/core' {
177
177
  }
178
178
 
179
179
 
180
- declare module '@tiptap/core' {
181
- interface Commands<ReturnType> {
182
- iframe: {
183
- /**
184
- * Add an iframe
185
- */
186
- setIframe: (options: {
187
- src: string;
188
- service: string;
189
- }) => ReturnType;
190
- };
191
- }
192
- }
193
-
194
-
195
180
  declare module '@tiptap/core' {
196
181
  interface Commands<ReturnType> {
197
182
  imageUpload: {
@@ -212,6 +197,21 @@ declare module '@tiptap/core' {
212
197
  }
213
198
 
214
199
 
200
+ declare module '@tiptap/core' {
201
+ interface Commands<ReturnType> {
202
+ iframe: {
203
+ /**
204
+ * Add an iframe
205
+ */
206
+ setIframe: (options: {
207
+ src: string;
208
+ service: string;
209
+ }) => ReturnType;
210
+ };
211
+ }
212
+ }
213
+
214
+
215
215
  declare module '@tiptap/core' {
216
216
  interface Commands<ReturnType> {
217
217
  imageGifUpload: {
@@ -250,8 +250,9 @@ declare module '@tiptap/core' {
250
250
 
251
251
  declare module '@tiptap/core' {
252
252
  interface Commands<ReturnType> {
253
- katex: {
254
- setKatex: (arg?: IKatexAttrs) => ReturnType;
253
+ lineHeight: {
254
+ setLineHeight: (lineHeight: string) => ReturnType;
255
+ unsetLineHeight: () => ReturnType;
255
256
  };
256
257
  }
257
258
  }
@@ -259,9 +260,8 @@ declare module '@tiptap/core' {
259
260
 
260
261
  declare module '@tiptap/core' {
261
262
  interface Commands<ReturnType> {
262
- lineHeight: {
263
- setLineHeight: (lineHeight: string) => ReturnType;
264
- unsetLineHeight: () => ReturnType;
263
+ katex: {
264
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
265
265
  };
266
266
  }
267
267
  }
package/lib/Link.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./index-BWx1Mchx.js";
2
- import { ae as r, ae as t } from "./RichTextEditor-DWN9FEob.js";
1
+ import "./index-DI9T3iLd.js";
2
+ import { ae as r, ae as t } from "./RichTextEditor-DjTnd5Uu.js";
3
3
  export {
4
4
  r as Link,
5
5
  t as default
package/lib/ListItem.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CSvnpArE.cjs"),i=t.Node.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",t.mergeAttributes(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});exports.ListItem=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-ByRfqzMr.cjs"),i=t.Node.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",t.mergeAttributes(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});exports.ListItem=i;
@@ -36,9 +36,11 @@ declare module '@tiptap/core' {
36
36
 
37
37
  declare module '@tiptap/core' {
38
38
  interface Commands<ReturnType> {
39
- drawer: {
40
- setDrawer: (options: any, replace?: any) => ReturnType;
41
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
39
+ emoji: {
40
+ setEmoji: (emoji: {
41
+ name: string;
42
+ emoji: string;
43
+ }) => ReturnType;
42
44
  };
43
45
  }
44
46
  }
@@ -46,11 +48,9 @@ declare module '@tiptap/core' {
46
48
 
47
49
  declare module '@tiptap/core' {
48
50
  interface Commands<ReturnType> {
49
- emoji: {
50
- setEmoji: (emoji: {
51
- name: string;
52
- emoji: string;
53
- }) => ReturnType;
51
+ drawer: {
52
+ setDrawer: (options: any, replace?: any) => ReturnType;
53
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
54
54
  };
55
55
  }
56
56
  }
@@ -101,21 +101,6 @@ declare module '@tiptap/core' {
101
101
  }
102
102
 
103
103
 
104
- declare module '@tiptap/core' {
105
- interface Commands<ReturnType> {
106
- iframe: {
107
- /**
108
- * Add an iframe
109
- */
110
- setIframe: (options: {
111
- src: string;
112
- service: string;
113
- }) => ReturnType;
114
- };
115
- }
116
- }
117
-
118
-
119
104
  declare module '@tiptap/core' {
120
105
  interface Commands<ReturnType> {
121
106
  imageUpload: {
@@ -136,6 +121,21 @@ declare module '@tiptap/core' {
136
121
  }
137
122
 
138
123
 
124
+ declare module '@tiptap/core' {
125
+ interface Commands<ReturnType> {
126
+ iframe: {
127
+ /**
128
+ * Add an iframe
129
+ */
130
+ setIframe: (options: {
131
+ src: string;
132
+ service: string;
133
+ }) => ReturnType;
134
+ };
135
+ }
136
+ }
137
+
138
+
139
139
  declare module '@tiptap/core' {
140
140
  interface Commands<ReturnType> {
141
141
  imageGifUpload: {
@@ -174,8 +174,9 @@ declare module '@tiptap/core' {
174
174
 
175
175
  declare module '@tiptap/core' {
176
176
  interface Commands<ReturnType> {
177
- katex: {
178
- setKatex: (arg?: IKatexAttrs) => ReturnType;
177
+ lineHeight: {
178
+ setLineHeight: (lineHeight: string) => ReturnType;
179
+ unsetLineHeight: () => ReturnType;
179
180
  };
180
181
  }
181
182
  }
@@ -183,9 +184,8 @@ declare module '@tiptap/core' {
183
184
 
184
185
  declare module '@tiptap/core' {
185
186
  interface Commands<ReturnType> {
186
- lineHeight: {
187
- setLineHeight: (lineHeight: string) => ReturnType;
188
- unsetLineHeight: () => ReturnType;
187
+ katex: {
188
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
189
189
  };
190
190
  }
191
191
  }
package/lib/ListItem.d.ts CHANGED
@@ -36,9 +36,11 @@ declare module '@tiptap/core' {
36
36
 
37
37
  declare module '@tiptap/core' {
38
38
  interface Commands<ReturnType> {
39
- drawer: {
40
- setDrawer: (options: any, replace?: any) => ReturnType;
41
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
39
+ emoji: {
40
+ setEmoji: (emoji: {
41
+ name: string;
42
+ emoji: string;
43
+ }) => ReturnType;
42
44
  };
43
45
  }
44
46
  }
@@ -46,11 +48,9 @@ declare module '@tiptap/core' {
46
48
 
47
49
  declare module '@tiptap/core' {
48
50
  interface Commands<ReturnType> {
49
- emoji: {
50
- setEmoji: (emoji: {
51
- name: string;
52
- emoji: string;
53
- }) => ReturnType;
51
+ drawer: {
52
+ setDrawer: (options: any, replace?: any) => ReturnType;
53
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
54
54
  };
55
55
  }
56
56
  }
@@ -101,21 +101,6 @@ declare module '@tiptap/core' {
101
101
  }
102
102
 
103
103
 
104
- declare module '@tiptap/core' {
105
- interface Commands<ReturnType> {
106
- iframe: {
107
- /**
108
- * Add an iframe
109
- */
110
- setIframe: (options: {
111
- src: string;
112
- service: string;
113
- }) => ReturnType;
114
- };
115
- }
116
- }
117
-
118
-
119
104
  declare module '@tiptap/core' {
120
105
  interface Commands<ReturnType> {
121
106
  imageUpload: {
@@ -136,6 +121,21 @@ declare module '@tiptap/core' {
136
121
  }
137
122
 
138
123
 
124
+ declare module '@tiptap/core' {
125
+ interface Commands<ReturnType> {
126
+ iframe: {
127
+ /**
128
+ * Add an iframe
129
+ */
130
+ setIframe: (options: {
131
+ src: string;
132
+ service: string;
133
+ }) => ReturnType;
134
+ };
135
+ }
136
+ }
137
+
138
+
139
139
  declare module '@tiptap/core' {
140
140
  interface Commands<ReturnType> {
141
141
  imageGifUpload: {
@@ -174,8 +174,9 @@ declare module '@tiptap/core' {
174
174
 
175
175
  declare module '@tiptap/core' {
176
176
  interface Commands<ReturnType> {
177
- katex: {
178
- setKatex: (arg?: IKatexAttrs) => ReturnType;
177
+ lineHeight: {
178
+ setLineHeight: (lineHeight: string) => ReturnType;
179
+ unsetLineHeight: () => ReturnType;
179
180
  };
180
181
  }
181
182
  }
@@ -183,9 +184,8 @@ declare module '@tiptap/core' {
183
184
 
184
185
  declare module '@tiptap/core' {
185
186
  interface Commands<ReturnType> {
186
- lineHeight: {
187
- setLineHeight: (lineHeight: string) => ReturnType;
188
- unsetLineHeight: () => ReturnType;
187
+ katex: {
188
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
189
189
  };
190
190
  }
191
191
  }
package/lib/ListItem.js CHANGED
@@ -1,4 +1,4 @@
1
- import { N as e, m as i } from "./index-BWx1Mchx.js";
1
+ import { N as e, m as i } from "./index-DI9T3iLd.js";
2
2
  const s = e.create({
3
3
  name: "listItem",
4
4
  addOptions() {
package/lib/Mention.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CSvnpArE.cjs"),g=require("./index-Cyh1yoFk.cjs"),u=require("./dom-dataset-Cuy-pIfj.cjs"),b=require("tippy.js"),p=require("react/jsx-runtime"),l=require("react"),y=require("scroll-into-view-if-needed"),T=new c.PluginKey("mention"),M=c.Node.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:e,node:n}){var t;return`${e.suggestion.char}${(t=n.attrs.label)!==null&&t!==void 0?t:n.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:n}){var t;return["span",c.mergeAttributes(this.HTMLAttributes,e.HTMLAttributes),`${e.suggestion.char}${(t=n.attrs.label)!==null&&t!==void 0?t:n.attrs.id}`]},suggestion:{char:"@",pluginKey:T,command:({editor:e,range:n,props:t})=>{var r,s,o;const a=e.view.state.selection.$to.nodeAfter;((r=a==null?void 0:a.text)===null||r===void 0?void 0:r.startsWith(" "))&&(n.to+=1),e.chain().focus().insertContentAt(n,[{type:this.name,attrs:t},{type:"text",text:" "}]).run(),(o=(s=e.view.dom.ownerDocument.defaultView)===null||s===void 0?void 0:s.getSelection())===null||o===void 0||o.collapseToEnd()},allow:({state:e,range:n})=>{const t=e.doc.resolve(n.from),r=e.schema.nodes[this.name];return!!t.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:n}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",c.mergeAttributes({"data-type":this.name},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:e})];const t={...this.options};t.HTMLAttributes=c.mergeAttributes({"data-type":this.name},this.options.HTMLAttributes,n);const r=this.options.renderHTML({options:t,node:e});return typeof r=="string"?["span",c.mergeAttributes({"data-type":this.name},this.options.HTMLAttributes,n),r]:r},renderText({node:e}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:e})):this.options.renderText({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:n})=>{let t=!1;const{selection:r}=n,{empty:s,anchor:o}=r;return s?(n.doc.nodesBetween(o-1,o,(a,m)=>{if(a.type.name===this.name)return t=!0,e.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",m,m+a.nodeSize),!1}),t):!1})}},addProseMirrorPlugins(){return[g.Suggestion({editor:this.editor,...this.options.suggestion})]}}),L="_listUsers_en3pm_1",w="_itemUser_en3pm_10",v="_selectedUser_en3pm_31",h={listUsers:L,itemUser:w,selectedUser:v},A=l.forwardRef((e,n)=>{const t=l.useRef(null),[r,s]=l.useState(0),o=i=>{const d=e.items[i];d&&e.command({id:d,label:d})},a=()=>{s((r+e.items.length-1)%e.items.length)},m=()=>{s((r+1)%e.items.length)},f=()=>{o(r)};return l.useEffect(()=>s(0),[e.items]),l.useEffect(()=>{if(Number.isNaN(r+1))return;const i=t.current.querySelector(`span:nth-of-type(${r+1})`);i&&y(i,{behavior:"smooth",scrollMode:"if-needed"})},[r]),l.useImperativeHandle(n,()=>({onKeyDown:({event:i})=>i.key==="ArrowUp"?(a(),!0):i.key==="ArrowDown"?(m(),!0):i.key==="Enter"?(f(),!0):!1})),p.jsx("div",{className:u.clsx("listUsers",h.listUsers),children:p.jsx("div",{ref:t,children:e.items.length>0?e.items.map((i,d)=>p.jsx("span",{className:u.clsx("itemUser",h.itemUser,d===r?h.selectedUser:""),onClick:()=>o(d),children:i},d)):p.jsx("div",{className:u.clsx("itemUserEmpty",h.itemUser),children:"Empty"})})})}),H=[{id:"1",name:"John Doe"},{id:"2",name:"Jane Doe"},{id:"3",name:"Alice"},{id:"4",name:"Bob"}],x={items:async({query:e})=>H.map(t=>t.name).filter(t=>t.toLowerCase().startsWith(e.toLowerCase())),render:()=>{let e,n;return{onStart:t=>{e=new u.ReactRenderer(A,{props:t,editor:t.editor}),n=b("body",{getReferenceClientRect:t.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(t){e.updateProps(t),n[0].setProps({getReferenceClientRect:t.clientRect})},onKeyDown(t){var r;return t.event.key==="Escape"?(n[0].hide(),!0):(r=e.ref)==null?void 0:r.onKeyDown(t)},onExit(){n[0].destroy(),e.destroy()}}}},U=M.extend({addAttributes(){return{id:{default:"",parseHTML:u.getDatasetAttribute("id")},label:{default:"",parseHTML:u.getDatasetAttribute("label")}}}}).configure({HTMLAttributes:{class:"mention"},suggestion:x});exports.Mention=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-ByRfqzMr.cjs"),T=require("./index-BI-IcZcN.cjs"),g=require("./dom-dataset-Byuf1YmW.cjs"),v=require("tippy.js"),h=require("react/jsx-runtime"),m=require("react"),M=require("scroll-into-view-if-needed");function L({editor:e,overrideSuggestionOptions:n,extensionName:t,char:r="@"}){const i=new c.PluginKey;return{editor:e,char:r,pluginKey:i,command:({editor:o,range:l,props:u})=>{var a,s,d;const f=o.view.state.selection.$to.nodeAfter;((a=f==null?void 0:f.text)===null||a===void 0?void 0:a.startsWith(" "))&&(l.to+=1),o.chain().focus().insertContentAt(l,[{type:t,attrs:{...u,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(d=(s=o.view.dom.ownerDocument.defaultView)===null||s===void 0?void 0:s.getSelection())===null||d===void 0||d.collapseToEnd()},allow:({state:o,range:l})=>{const u=o.doc.resolve(l.from),a=o.schema.nodes[t];return!!u.parent.type.contentMatch.matchType(a)},...n}}function y(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(n=>L({editor:e.editor,overrideSuggestionOptions:n,extensionName:e.name,char:n.char}))}function b(e,n){const t=y(e),r=t.find(i=>i.char===n);return r||(t.length?t[0]:null)}const w=c.Node.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:n}){var t,r;return`${(t=n==null?void 0:n.char)!==null&&t!==void 0?t:"@"}${(r=e.attrs.label)!==null&&r!==void 0?r:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:n,suggestion:t}){var r,i;return["span",c.mergeAttributes(this.HTMLAttributes,e.HTMLAttributes),`${(r=t==null?void 0:t.char)!==null&&r!==void 0?r:"@"}${(i=n.attrs.label)!==null&&i!==void 0?i:n.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:e=>e.getAttribute("data-mention-suggestion-char"),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:n}){const t=b(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",c.mergeAttributes({"data-type":this.name},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:e,suggestion:t})];const r={...this.options};r.HTMLAttributes=c.mergeAttributes({"data-type":this.name},this.options.HTMLAttributes,n);const i=this.options.renderHTML({options:r,node:e,suggestion:t});return typeof i=="string"?["span",c.mergeAttributes({"data-type":this.name},this.options.HTMLAttributes,n),i]:i},renderText({node:e}){const n={options:this.options,node:e,suggestion:b(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(n)):this.options.renderText(n)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:n})=>{let t=!1;const{selection:r}=n,{empty:i,anchor:o}=r;if(!i)return!1;n.doc.nodesBetween(o-1,o,(a,s)=>{if(a.type.name===this.name)return t=!0,e.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",s,s+a.nodeSize),!1});let l=new c.Node$1,u=0;return n.doc.nodesBetween(o-1,o,(a,s)=>{if(a.type.name===this.name)return t=!0,l=a,u=s,!1}),t&&e.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,u,u+l.nodeSize),t})}},addProseMirrorPlugins(){return y(this).map(T.Suggestion)}}),S="_listUsers_en3pm_1",H="_itemUser_en3pm_10",A="_selectedUser_en3pm_31",p={listUsers:S,itemUser:H,selectedUser:A},x=m.forwardRef((e,n)=>{const t=m.useRef(null),[r,i]=m.useState(0),o=s=>{const d=e.items[s];d&&e.command({id:d,label:d})},l=()=>{i((r+e.items.length-1)%e.items.length)},u=()=>{i((r+1)%e.items.length)},a=()=>{o(r)};return m.useEffect(()=>i(0),[e.items]),m.useEffect(()=>{if(Number.isNaN(r+1))return;const s=t.current.querySelector(`span:nth-of-type(${r+1})`);s&&M(s,{behavior:"smooth",scrollMode:"if-needed"})},[r]),m.useImperativeHandle(n,()=>({onKeyDown:({event:s})=>s.key==="ArrowUp"?(l(),!0):s.key==="ArrowDown"?(u(),!0):s.key==="Enter"?(a(),!0):!1})),h.jsx("div",{className:g.clsx("listUsers",p.listUsers),children:h.jsx("div",{ref:t,children:e.items.length>0?e.items.map((s,d)=>h.jsx("span",{className:g.clsx("itemUser",p.itemUser,d===r?p.selectedUser:""),onClick:()=>o(d),children:s},d)):h.jsx("div",{className:g.clsx("itemUserEmpty",p.itemUser),children:"Empty"})})})}),U=[{id:"1",name:"John Doe"},{id:"2",name:"Jane Doe"},{id:"3",name:"Alice"},{id:"4",name:"Bob"}],_={items:async({query:e})=>U.map(t=>t.name).filter(t=>t.toLowerCase().startsWith(e.toLowerCase())),render:()=>{let e,n;return{onStart:t=>{e=new g.ReactRenderer(x,{props:t,editor:t.editor}),n=v("body",{getReferenceClientRect:t.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(t){e.updateProps(t),n[0].setProps({getReferenceClientRect:t.clientRect})},onKeyDown(t){var r;return t.event.key==="Escape"?(n[0].hide(),!0):(r=e.ref)==null?void 0:r.onKeyDown(t)},onExit(){n[0].destroy(),e.destroy()}}}},C=w.extend({addAttributes(){return{id:{default:"",parseHTML:g.getDatasetAttribute("id")},label:{default:"",parseHTML:g.getDatasetAttribute("label")}}}}).configure({HTMLAttributes:{class:"mention"},suggestion:_});exports.Mention=C;