reactjs-tiptap-editor 0.3.5 → 0.3.7

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 (243) hide show
  1. package/lib/{ActionMenuButton-DocMG_Xt.cjs → ActionMenuButton-CqlhqVIW.cjs} +1 -1
  2. package/lib/{ActionMenuButton-D9WfF2ep.js → ActionMenuButton-DXwpQHj4.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +13 -13
  5. package/lib/Attachment.d.ts +13 -13
  6. package/lib/Attachment.js +3 -3
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +13 -13
  9. package/lib/Blockquote.d.ts +13 -13
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +13 -13
  13. package/lib/Bold.d.ts +13 -13
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +13 -13
  17. package/lib/BulletList.d.ts +13 -13
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +13 -13
  21. package/lib/Clear.d.ts +13 -13
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +13 -13
  25. package/lib/Code.d.ts +13 -13
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +13 -13
  29. package/lib/CodeBlock.d.ts +13 -13
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +13 -13
  33. package/lib/CodeView.d.ts +13 -13
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +13 -13
  37. package/lib/Color.d.ts +13 -13
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.cjs +1 -1
  40. package/lib/Document.d.cts +13 -13
  41. package/lib/Document.d.ts +13 -13
  42. package/lib/Document.js +1 -1
  43. package/lib/{Drawer-DdyndCxA.js → Drawer-B6uGc4Ab.js} +3 -3
  44. package/lib/{Drawer-C6yrcHc7.cjs → Drawer-DBt_aN5x.cjs} +1 -1
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +13 -13
  47. package/lib/Drawer.d.ts +13 -13
  48. package/lib/Drawer.js +4 -4
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +13 -13
  51. package/lib/Emoji.d.ts +13 -13
  52. package/lib/Emoji.js +4 -4
  53. package/lib/{Excalidraw-D5qXWfKq.js → Excalidraw-Bp252YTN.js} +3 -3
  54. package/lib/{Excalidraw-BS6_3xHm.cjs → Excalidraw-CYLyPnI4.cjs} +1 -1
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +13 -13
  57. package/lib/Excalidraw.d.ts +13 -13
  58. package/lib/Excalidraw.js +3 -3
  59. package/lib/ExportPdf.cjs +1 -1
  60. package/lib/ExportPdf.d.cts +13 -13
  61. package/lib/ExportPdf.d.ts +13 -13
  62. package/lib/ExportPdf.js +2 -2
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +13 -13
  65. package/lib/ExportWord.d.ts +13 -13
  66. package/lib/ExportWord.js +2 -2
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +13 -13
  69. package/lib/FontFamily.d.ts +13 -13
  70. package/lib/FontFamily.js +4 -4
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +13 -13
  73. package/lib/FontSize.d.ts +13 -13
  74. package/lib/FontSize.js +3 -3
  75. package/lib/FormatPainter.cjs +1 -1
  76. package/lib/FormatPainter.d.cts +13 -13
  77. package/lib/FormatPainter.d.ts +13 -13
  78. package/lib/FormatPainter.js +2 -2
  79. package/lib/Heading.cjs +1 -1
  80. package/lib/Heading.d.cts +13 -13
  81. package/lib/Heading.d.ts +13 -13
  82. package/lib/Heading.js +3 -3
  83. package/lib/Highlight.cjs +1 -1
  84. package/lib/Highlight.d.cts +13 -13
  85. package/lib/Highlight.d.ts +13 -13
  86. package/lib/Highlight.js +2 -2
  87. package/lib/History.cjs +1 -1
  88. package/lib/History.d.cts +13 -13
  89. package/lib/History.d.ts +13 -13
  90. package/lib/History.js +2 -2
  91. package/lib/HorizontalRule.cjs +1 -1
  92. package/lib/HorizontalRule.d.cts +13 -13
  93. package/lib/HorizontalRule.d.ts +13 -13
  94. package/lib/HorizontalRule.js +10 -8
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +13 -13
  97. package/lib/Iframe.d.ts +13 -13
  98. package/lib/Iframe.js +3 -3
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +13 -13
  101. package/lib/Image.d.ts +13 -13
  102. package/lib/Image.js +3 -3
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +13 -13
  105. package/lib/ImageGif.d.ts +13 -13
  106. package/lib/ImageGif.js +3 -3
  107. package/lib/ImportWord.cjs +2 -2
  108. package/lib/ImportWord.d.cts +13 -13
  109. package/lib/ImportWord.d.ts +13 -13
  110. package/lib/ImportWord.js +4 -4
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +13 -13
  113. package/lib/Indent.d.ts +13 -13
  114. package/lib/Indent.js +2 -2
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +13 -13
  117. package/lib/Italic.d.ts +13 -13
  118. package/lib/Italic.js +2 -2
  119. package/lib/Katex.cjs +1 -1
  120. package/lib/Katex.d.cts +13 -13
  121. package/lib/Katex.d.ts +13 -13
  122. package/lib/Katex.js +4 -4
  123. package/lib/LineHeight.cjs +1 -1
  124. package/lib/LineHeight.d.cts +13 -13
  125. package/lib/LineHeight.d.ts +13 -13
  126. package/lib/LineHeight.js +2 -2
  127. package/lib/Link.cjs +1 -1
  128. package/lib/Link.d.cts +13 -13
  129. package/lib/Link.d.ts +13 -13
  130. package/lib/Link.js +2 -2
  131. package/lib/ListItem.cjs +1 -1
  132. package/lib/ListItem.d.cts +13 -13
  133. package/lib/ListItem.d.ts +13 -13
  134. package/lib/ListItem.js +1 -1
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +13 -13
  137. package/lib/Mention.d.ts +13 -13
  138. package/lib/Mention.js +3 -3
  139. package/lib/Mermaid.cjs +1 -1
  140. package/lib/Mermaid.d.cts +13 -13
  141. package/lib/Mermaid.d.ts +13 -13
  142. package/lib/Mermaid.js +16 -16
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +13 -13
  145. package/lib/MoreMark.d.ts +13 -13
  146. package/lib/MoreMark.js +3 -3
  147. package/lib/MultiColumn.cjs +1 -1
  148. package/lib/MultiColumn.d.cts +13 -13
  149. package/lib/MultiColumn.d.ts +13 -13
  150. package/lib/MultiColumn.js +2 -2
  151. package/lib/OrderedList.cjs +1 -1
  152. package/lib/OrderedList.d.cts +13 -13
  153. package/lib/OrderedList.d.ts +13 -13
  154. package/lib/OrderedList.js +2 -2
  155. package/lib/{RichTextEditor-DS30aD8t.js → RichTextEditor-BfYZYQb9.js} +899 -905
  156. package/lib/RichTextEditor-Db6oQoYY.cjs +137 -0
  157. package/lib/SearchAndReplace.cjs +1 -1
  158. package/lib/SearchAndReplace.d.cts +13 -13
  159. package/lib/SearchAndReplace.d.ts +13 -13
  160. package/lib/SearchAndReplace.js +2 -2
  161. package/lib/Selection.cjs +1 -1
  162. package/lib/Selection.d.cts +13 -13
  163. package/lib/Selection.d.ts +13 -13
  164. package/lib/Selection.js +1 -1
  165. package/lib/SlashCommand.cjs +1 -1
  166. package/lib/SlashCommand.d.cts +13 -13
  167. package/lib/SlashCommand.d.ts +13 -13
  168. package/lib/SlashCommand.js +4 -4
  169. package/lib/Strike.cjs +1 -1
  170. package/lib/Strike.d.cts +13 -13
  171. package/lib/Strike.d.ts +13 -13
  172. package/lib/Strike.js +2 -2
  173. package/lib/SubAndSuperScript.cjs +1 -1
  174. package/lib/SubAndSuperScript.d.cts +13 -13
  175. package/lib/SubAndSuperScript.d.ts +13 -13
  176. package/lib/SubAndSuperScript.js +3 -3
  177. package/lib/Table.cjs +1 -1
  178. package/lib/Table.d.cts +13 -13
  179. package/lib/Table.d.ts +13 -13
  180. package/lib/Table.js +15 -15
  181. package/lib/TableOfContent.cjs +1 -1
  182. package/lib/TableOfContent.d.cts +13 -13
  183. package/lib/TableOfContent.d.ts +13 -13
  184. package/lib/TableOfContent.js +3 -3
  185. package/lib/TaskList.cjs +1 -1
  186. package/lib/TaskList.d.cts +13 -13
  187. package/lib/TaskList.d.ts +13 -13
  188. package/lib/TaskList.js +2 -2
  189. package/lib/TextAlign.cjs +1 -1
  190. package/lib/TextAlign.d.cts +13 -13
  191. package/lib/TextAlign.d.ts +13 -13
  192. package/lib/TextAlign.js +47 -46
  193. package/lib/TextBubble.cjs +1 -1
  194. package/lib/TextBubble.d.cts +13 -13
  195. package/lib/TextBubble.d.ts +13 -13
  196. package/lib/TextBubble.js +2 -2
  197. package/lib/TextDirection.cjs +1 -1
  198. package/lib/TextDirection.d.cts +13 -13
  199. package/lib/TextDirection.d.ts +13 -13
  200. package/lib/TextDirection.js +2 -2
  201. package/lib/TextUnderline.cjs +1 -1
  202. package/lib/TextUnderline.d.cts +13 -13
  203. package/lib/TextUnderline.d.ts +13 -13
  204. package/lib/TextUnderline.js +2 -2
  205. package/lib/TrailingNode.cjs +1 -1
  206. package/lib/TrailingNode.d.cts +13 -13
  207. package/lib/TrailingNode.d.ts +13 -13
  208. package/lib/TrailingNode.js +1 -1
  209. package/lib/{Twitter-VKMhfUTN.js → Twitter-CZA9dXpC.js} +44 -44
  210. package/lib/{Twitter-Dwmo5UJ-.cjs → Twitter-DLO12QnF.cjs} +1 -1
  211. package/lib/Twitter.cjs +1 -1
  212. package/lib/Twitter.d.cts +13 -13
  213. package/lib/Twitter.d.ts +13 -13
  214. package/lib/Twitter.js +3 -3
  215. package/lib/Video.cjs +1 -1
  216. package/lib/Video.d.cts +13 -13
  217. package/lib/Video.d.ts +13 -13
  218. package/lib/Video.js +2 -2
  219. package/lib/bubble-extra.cjs +1 -1
  220. package/lib/bubble-extra.d.cts +13 -13
  221. package/lib/bubble-extra.d.ts +13 -13
  222. package/lib/bubble-extra.js +6 -6
  223. package/lib/{dom-dataset-pKb7TLlt.js → dom-dataset-2RXYq9wp.js} +397 -376
  224. package/lib/dom-dataset-DmsCLv1q.cjs +33 -0
  225. package/lib/{index-BaTWsqZj.js → index-BGwJ0NfQ.js} +1 -1
  226. package/lib/{index-Dk3tSDmG.js → index-BkoojfPK.js} +1 -1
  227. package/lib/{index-COecBbaE.cjs → index-CSvnpArE.cjs} +11 -11
  228. package/lib/{index-DEe_Svay.js → index-CXIIg9Sq.js} +676 -644
  229. package/lib/{index-DjP7Onch.cjs → index-CrxasX7b.cjs} +1 -1
  230. package/lib/{index-CySbCeQd.cjs → index-Cyh1yoFk.cjs} +1 -1
  231. package/lib/{index-DCFzuS5p.js → index-fKx6CYUM.js} +1 -1
  232. package/lib/{index-ClFtfQ0J.cjs → index-h9_SDuwc.cjs} +1 -1
  233. package/lib/index.cjs +1 -1
  234. package/lib/index.d.cts +13 -13
  235. package/lib/index.d.ts +13 -13
  236. package/lib/index.js +27 -27
  237. package/lib/locale-bundle.d.cts +13 -13
  238. package/lib/locale-bundle.d.ts +13 -13
  239. package/lib/{textarea-DITg4shx.js → textarea-BUlQB7hI.js} +1 -1
  240. package/lib/{textarea-I3qcfzYg.cjs → textarea-ILk3QoYy.cjs} +1 -1
  241. package/package.json +71 -71
  242. package/lib/RichTextEditor-CFS3E6GK.cjs +0 -137
  243. package/lib/dom-dataset-CAXnsjYE.cjs +0 -33
@@ -1 +1 @@
1
- "use strict";const l=require("./index-COecBbaE.cjs"),a=t=>{if(!t.children.length)return;const r=t.querySelectorAll("span");r&&r.forEach(e=>{var n,s;const i=e.getAttribute("style"),o=(s=(n=e.parentElement)===null||n===void 0?void 0:n.closest("span"))===null||s===void 0?void 0:s.getAttribute("style");e.setAttribute("style",`${o};${i}`)})},u=l.Mark.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&a(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",l.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:r}=t;return t.doc.nodesBetween(r.from,r.to,(e,n)=>{if(e.isTextblock)return!0;e.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(i=>!!i))||t.removeMark(n,n+e.nodeSize,this.type)}),!0}}}});exports.TextStyle=u;
1
+ "use strict";const l=require("./index-CSvnpArE.cjs"),a=t=>{if(!t.children.length)return;const r=t.querySelectorAll("span");r&&r.forEach(e=>{var n,s;const i=e.getAttribute("style"),o=(s=(n=e.parentElement)===null||n===void 0?void 0:n.closest("span"))===null||s===void 0?void 0:s.getAttribute("style");e.setAttribute("style",`${o};${i}`)})},u=l.Mark.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&a(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",l.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:r}=t;return t.doc.nodesBetween(r.from,r.to,(e,n)=>{if(e.isTextblock)return!0;e.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(i=>!!i))||t.removeMark(n,n+e.nodeSize,this.type)}),!0}}}});exports.TextStyle=u;
@@ -1 +1 @@
1
- "use strict";const q=require("./index-COecBbaE.cjs");function U(B){var c;const{char:_,allowSpaces:C,allowToIncludeChar:E,allowedPrefixes:f,startOfLine:D,$position:d}=B,I=C&&!E,g=q.escapeForRegEx(_),M=new RegExp(`\\s${g}$`),v=D?"^":"",R=E?"":g,k=I?new RegExp(`${v}${g}.*?(?=\\s${R}|$)`,"gm"):new RegExp(`${v}(?:^)?${g}[^\\s${R}]*`,"gm"),r=((c=d.nodeBefore)===null||c===void 0?void 0:c.isText)&&d.nodeBefore.text;if(!r)return null;const e=d.pos-r.length,o=Array.from(r.matchAll(k)).pop();if(!o||o.input===void 0||o.index===void 0)return null;const n=o.input.slice(Math.max(0,o.index-1),o.index),i=new RegExp(`^[${f==null?void 0:f.join("")}\0]?$`).test(n);if(f!==null&&!i)return null;const a=e+o.index;let l=a+o[0].length;return I&&M.test(r.slice(l-1,l+1))&&(o[0]+=" ",l+=1),a<d.pos&&l>=d.pos?{range:{from:a,to:l},query:o[0].slice(_.length),text:o[0]}:null}const j=new q.PluginKey("suggestion");function L({pluginKey:B=j,editor:c,char:_="@",allowSpaces:C=!1,allowToIncludeChar:E=!1,allowedPrefixes:f=[" "],startOfLine:D=!1,decorationTag:d="span",decorationClass:I="suggestion",command:g=()=>null,items:M=()=>[],render:v=()=>({}),allow:R=()=>!0,findSuggestionMatch:k=U}){let r;const e=v==null?void 0:v(),o=new q.Plugin({key:B,view(){return{update:async(n,i)=>{var a,l,u,p,m,y,x;const t=(a=this.key)===null||a===void 0?void 0:a.getState(i),s=(l=this.key)===null||l===void 0?void 0:l.getState(n.state),S=t.active&&s.active&&t.range.from!==s.range.from,b=!t.active&&s.active,F=t.active&&!s.active,A=!b&&!F&&t.query!==s.query,$=b||S&&A,P=A||S,K=F||S&&A;if(!$&&!P&&!K)return;const h=K&&!$?t:s,O=n.dom.querySelector(`[data-decoration-id="${h.decorationId}"]`);r={editor:c,range:h.range,query:h.query,text:h.text,items:[],command:w=>g({editor:c,range:h.range,props:w}),decorationNode:O,clientRect:O?()=>{var w;const{decorationId:T}=(w=this.key)===null||w===void 0?void 0:w.getState(c.state),N=n.dom.querySelector(`[data-decoration-id="${T}"]`);return(N==null?void 0:N.getBoundingClientRect())||null}:null},$&&((u=e==null?void 0:e.onBeforeStart)===null||u===void 0||u.call(e,r)),P&&((p=e==null?void 0:e.onBeforeUpdate)===null||p===void 0||p.call(e,r)),(P||$)&&(r.items=await M({editor:c,query:h.query})),K&&((m=e==null?void 0:e.onExit)===null||m===void 0||m.call(e,r)),P&&((y=e==null?void 0:e.onUpdate)===null||y===void 0||y.call(e,r)),$&&((x=e==null?void 0:e.onStart)===null||x===void 0||x.call(e,r))},destroy:()=>{var n;r&&((n=e==null?void 0:e.onExit)===null||n===void 0||n.call(e,r))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,i,a,l){const{isEditable:u}=c,{composing:p}=c.view,{selection:m}=n,{empty:y,from:x}=m,t={...i};if(t.composing=p,u&&(y||c.view.composing)){(x<i.range.from||x>i.range.to)&&!p&&!i.composing&&(t.active=!1);const s=k({char:_,allowSpaces:C,allowToIncludeChar:E,allowedPrefixes:f,startOfLine:D,$position:m.$from}),S=`id_${Math.floor(Math.random()*4294967295)}`;s&&R({editor:c,state:l,range:s.range,isActive:i.active})?(t.active=!0,t.decorationId=i.decorationId?i.decorationId:S,t.range=s.range,t.query=s.query,t.text=s.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,i){var a;const{active:l,range:u}=o.getState(n.state);return l&&((a=e==null?void 0:e.onKeyDown)===null||a===void 0?void 0:a.call(e,{view:n,event:i,range:u}))||!1},decorations(n){const{active:i,range:a,decorationId:l}=o.getState(n);return i?q.DecorationSet.create(n.doc,[q.Decoration.inline(a.from,a.to,{nodeName:d,class:I,"data-decoration-id":l})]):null}}});return o}exports.Suggestion=L;
1
+ "use strict";const q=require("./index-CSvnpArE.cjs");function U(B){var c;const{char:_,allowSpaces:C,allowToIncludeChar:E,allowedPrefixes:f,startOfLine:D,$position:d}=B,I=C&&!E,g=q.escapeForRegEx(_),M=new RegExp(`\\s${g}$`),v=D?"^":"",R=E?"":g,k=I?new RegExp(`${v}${g}.*?(?=\\s${R}|$)`,"gm"):new RegExp(`${v}(?:^)?${g}[^\\s${R}]*`,"gm"),r=((c=d.nodeBefore)===null||c===void 0?void 0:c.isText)&&d.nodeBefore.text;if(!r)return null;const e=d.pos-r.length,o=Array.from(r.matchAll(k)).pop();if(!o||o.input===void 0||o.index===void 0)return null;const n=o.input.slice(Math.max(0,o.index-1),o.index),i=new RegExp(`^[${f==null?void 0:f.join("")}\0]?$`).test(n);if(f!==null&&!i)return null;const a=e+o.index;let l=a+o[0].length;return I&&M.test(r.slice(l-1,l+1))&&(o[0]+=" ",l+=1),a<d.pos&&l>=d.pos?{range:{from:a,to:l},query:o[0].slice(_.length),text:o[0]}:null}const j=new q.PluginKey("suggestion");function L({pluginKey:B=j,editor:c,char:_="@",allowSpaces:C=!1,allowToIncludeChar:E=!1,allowedPrefixes:f=[" "],startOfLine:D=!1,decorationTag:d="span",decorationClass:I="suggestion",command:g=()=>null,items:M=()=>[],render:v=()=>({}),allow:R=()=>!0,findSuggestionMatch:k=U}){let r;const e=v==null?void 0:v(),o=new q.Plugin({key:B,view(){return{update:async(n,i)=>{var a,l,u,p,m,y,x;const t=(a=this.key)===null||a===void 0?void 0:a.getState(i),s=(l=this.key)===null||l===void 0?void 0:l.getState(n.state),S=t.active&&s.active&&t.range.from!==s.range.from,b=!t.active&&s.active,F=t.active&&!s.active,A=!b&&!F&&t.query!==s.query,$=b||S&&A,P=A||S,K=F||S&&A;if(!$&&!P&&!K)return;const h=K&&!$?t:s,O=n.dom.querySelector(`[data-decoration-id="${h.decorationId}"]`);r={editor:c,range:h.range,query:h.query,text:h.text,items:[],command:w=>g({editor:c,range:h.range,props:w}),decorationNode:O,clientRect:O?()=>{var w;const{decorationId:T}=(w=this.key)===null||w===void 0?void 0:w.getState(c.state),N=n.dom.querySelector(`[data-decoration-id="${T}"]`);return(N==null?void 0:N.getBoundingClientRect())||null}:null},$&&((u=e==null?void 0:e.onBeforeStart)===null||u===void 0||u.call(e,r)),P&&((p=e==null?void 0:e.onBeforeUpdate)===null||p===void 0||p.call(e,r)),(P||$)&&(r.items=await M({editor:c,query:h.query})),K&&((m=e==null?void 0:e.onExit)===null||m===void 0||m.call(e,r)),P&&((y=e==null?void 0:e.onUpdate)===null||y===void 0||y.call(e,r)),$&&((x=e==null?void 0:e.onStart)===null||x===void 0||x.call(e,r))},destroy:()=>{var n;r&&((n=e==null?void 0:e.onExit)===null||n===void 0||n.call(e,r))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,i,a,l){const{isEditable:u}=c,{composing:p}=c.view,{selection:m}=n,{empty:y,from:x}=m,t={...i};if(t.composing=p,u&&(y||c.view.composing)){(x<i.range.from||x>i.range.to)&&!p&&!i.composing&&(t.active=!1);const s=k({char:_,allowSpaces:C,allowToIncludeChar:E,allowedPrefixes:f,startOfLine:D,$position:m.$from}),S=`id_${Math.floor(Math.random()*4294967295)}`;s&&R({editor:c,state:l,range:s.range,isActive:i.active})?(t.active=!0,t.decorationId=i.decorationId?i.decorationId:S,t.range=s.range,t.query=s.query,t.text=s.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,i){var a;const{active:l,range:u}=o.getState(n.state);return l&&((a=e==null?void 0:e.onKeyDown)===null||a===void 0?void 0:a.call(e,{view:n,event:i,range:u}))||!1},decorations(n){const{active:i,range:a,decorationId:l}=o.getState(n);return i?q.DecorationSet.create(n.doc,[q.Decoration.inline(a.from,a.to,{nodeName:d,class:I,"data-decoration-id":l})]):null}}});return o}exports.Suggestion=L;
@@ -1,4 +1,4 @@
1
- import { a as T, P as U, D as j, b as L, e as z } from "./index-DEe_Svay.js";
1
+ import { a as T, P as U, D as j, b as L, e as z } from "./index-CXIIg9Sq.js";
2
2
  function G(R) {
3
3
  var s;
4
4
  const { char: q, allowSpaces: D, allowToIncludeChar: _, allowedPrefixes: f, startOfLine: B, $position: d } = R, E = D && !_, g = z(q), C = new RegExp(`\\s${g}$`), v = B ? "^" : "", I = _ ? "" : g, M = E ? new RegExp(`${v}${g}.*?(?=\\s${I}|$)`, "gm") : new RegExp(`${v}(?:^)?${g}[^\\s${I}]*`, "gm"), r = ((s = d.nodeBefore) === null || s === void 0 ? void 0 : s.isText) && d.nodeBefore.text;
@@ -1 +1 @@
1
- "use strict";const r=require("./index-COecBbaE.cjs"),e=r.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),s=r.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});exports.Subscript=e;exports.Superscript=s;
1
+ "use strict";const r=require("./index-CSvnpArE.cjs"),e=r.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),s=r.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});exports.Subscript=e;exports.Superscript=s;
package/lib/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react"),C=require("./RichTextEditor-CFS3E6GK.cjs"),x=require("./dom-dataset-CAXnsjYE.cjs"),a=require("./index-COecBbaE.cjs"),b=require("./ListItem.cjs"),S=require("./index-DjP7Onch.cjs"),v=require("./Document.cjs"),k=require("./Selection.cjs"),P=require("./TextBubble.cjs"),M=require("./TrailingNode.cjs"),m=require("./index-Dz3YxLE7.cjs");function T(){var l;const t=p.useRef({editor:null}),[e,i]=p.useState(!1),[o,r]=p.useState(null);return p.useEffect(()=>{var s;(s=t.current)!=null&&s.editor&&(i(!0),r(t.current.editor))},[t,(l=t.current)==null?void 0:l.editor]),{isReady:e,editor:o,editorRef:t}}const E=a.Extension.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const o=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(o)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,i=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(i)}},addProseMirrorPlugins(){let t=!1;return[new a.Plugin({key:new a.PluginKey("characterCount"),appendTransaction:(e,i,o)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const l=this.storage.characters({node:o.doc});if(l>r){const s=l-r,n=0,c=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=o.tr.deleteRange(n,c);return t=!0,u}t=!0},filterTransaction:(e,i)=>{const o=this.options.limit;if(!e.docChanged||o===0||o===null||o===void 0)return!0;const r=this.storage.characters({node:i.doc}),l=this.storage.characters({node:e.doc});if(l<=o||r>o&&l>o&&l<=r)return!0;if(r>o&&l>o&&l>r||!e.getMeta("paste"))return!1;const n=e.selection.$head.pos,c=l-o,u=n-c,h=n;return e.deleteRange(u,h),!(this.storage.characters({node:e.doc})>o)}})]}});function A(t={}){return new a.Plugin({view(e){return new O(e,t)}})}class O{constructor(e,i){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=i.width)!==null&&o!==void 0?o:1,this.color=i.color===!1?void 0:i.color||"black",this.class=i.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let l=s=>{this[r](s)};return e.dom.addEventListener(r,l),{name:r,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:i})=>this.editorView.dom.removeEventListener(e,i))}update(e,i){this.cursorPos!=null&&i.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),i=!e.parent.inlineContent,o;if(i){let n=e.nodeBefore,c=e.nodeAfter;if(n||c){let u=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(u){let h=u.getBoundingClientRect(),f=n?h.bottom:h.top;n&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),o={left:h.left,right:h.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!o){let n=this.editorView.coordsAtPos(this.cursorPos);o={left:n.left-this.width/2,right:n.left+this.width/2,top:n.top,bottom:n.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",i),this.element.classList.toggle("prosemirror-dropcursor-inline",!i);let l,s;if(!r||r==document.body&&getComputedStyle(r).position=="static")l=-pageXOffset,s=-pageYOffset;else{let n=r.getBoundingClientRect();l=n.left-r.scrollLeft,s=n.top-r.scrollTop}this.element.style.left=o.left-l+"px",this.element.style.top=o.top-s+"px",this.element.style.width=o.right-o.left+"px",this.element.style.height=o.bottom-o.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let i=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=i&&i.inside>=0&&this.editorView.state.doc.nodeAt(i.inside),r=o&&o.type.spec.disableDropCursor,l=typeof r=="function"?r(this.editorView,i,e):r;if(i&&!l){let s=i.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let n=a.dropPoint(this.editorView.state.doc,s,this.editorView.dragging.slice);n!=null&&(s=n)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const B=a.Extension.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[A(this.options)]}}),N=a.Extension.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new a.Plugin({key:new a.PluginKey("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:i,isFocused:o}=this.editor,{anchor:r}=e,l=[];if(!i||!o)return a.DecorationSet.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((c,u)=>{if(c.isText)return;if(!(r>=u&&r<=u+c.nodeSize-1))return!1;s+=1});let n=0;return t.descendants((c,u)=>{if(c.isText||!(r>=u&&r<=u+c.nodeSize-1))return!1;if(n+=1,this.options.mode==="deepest"&&s-n>0||this.options.mode==="shallowest"&&n>1)return this.options.mode==="deepest";l.push(a.Decoration.node(u,u+c.nodeSize,{class:this.options.className}))}),a.DecorationSet.create(t,l)}}})]}});class d extends a.Selection{constructor(e){super(e,e)}map(e,i){let o=e.resolve(i.map(this.head));return d.valid(o)?new d(o):a.Selection.near(o)}content(){return a.Slice.empty}eq(e){return e instanceof d&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,i){if(typeof i.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new d(e.resolve(i.pos))}getBookmark(){return new y(this.anchor)}static valid(e){let i=e.parent;if(i.isTextblock||!z(e)||!D(e))return!1;let o=i.type.spec.allowGapCursor;if(o!=null)return o;let r=i.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,i,o=!1){e:for(;;){if(!o&&d.valid(e))return e;let r=e.pos,l=null;for(let s=e.depth;;s--){let n=e.node(s);if(i>0?e.indexAfter(s)<n.childCount:e.index(s)>0){l=n.child(i>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;r+=i;let c=e.doc.resolve(r);if(d.valid(c))return c}for(;;){let s=i>0?l.firstChild:l.lastChild;if(!s){if(l.isAtom&&!l.isText&&!a.NodeSelection.isSelectable(l)){e=e.doc.resolve(r+l.nodeSize*i),o=!1;continue e}break}l=s,r+=i;let n=e.doc.resolve(r);if(d.valid(n))return n}return null}}}d.prototype.visible=!1;d.findFrom=d.findGapCursorFrom;a.Selection.jsonID("gapcursor",d);class y{constructor(e){this.pos=e}map(e){return new y(e.map(this.pos))}resolve(e){let i=e.resolve(this.pos);return d.valid(i)?new d(i):a.Selection.near(i)}}function z(t){for(let e=t.depth;e>=0;e--){let i=t.index(e),o=t.node(e);if(i==0){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function D(t){for(let e=t.depth;e>=0;e--){let i=t.indexAfter(e),o=t.node(e);if(i==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function L(){return new a.Plugin({props:{decorations:q,createSelectionBetween(t,e,i){return e.pos==i.pos&&d.valid(i)?new d(i):null},handleClick:V,handleKeyDown:R,handleDOMEvents:{beforeinput:H}}})}const R=a.keydownHandler({ArrowLeft:g("horiz",-1),ArrowRight:g("horiz",1),ArrowUp:g("vert",-1),ArrowDown:g("vert",1)});function g(t,e){const i=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,r,l){let s=o.selection,n=e>0?s.$to:s.$from,c=s.empty;if(s instanceof a.TextSelection){if(!l.endOfTextblock(i)||n.depth==0)return!1;c=!1,n=o.doc.resolve(e>0?n.after():n.before())}let u=d.findGapCursorFrom(n,e,c);return u?(r&&r(o.tr.setSelection(new d(u))),!0):!1}}function V(t,e,i){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!d.valid(o))return!1;let r=t.posAtCoords({left:i.clientX,top:i.clientY});return r&&r.inside>-1&&a.NodeSelection.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new d(o))),!0)}function H(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof d))return!1;let{$from:i}=t.state.selection,o=i.parent.contentMatchAt(i.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let r=a.Fragment.empty;for(let s=o.length-1;s>=0;s--)r=a.Fragment.from(o[s].createAndFill(null,r));let l=t.state.tr.replace(i.pos,i.pos,new a.Slice(r,0,0));return l.setSelection(a.TextSelection.near(l.doc.resolve(i.pos+1))),t.dispatch(l),!1}function q(t){if(!(t.selection instanceof d))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",a.DecorationSet.create(t.doc,[a.Decoration.widget(t.selection.head,e,{key:"gapcursor"})])}const F=a.Extension.create({name:"gapCursor",addProseMirrorPlugins(){return[L()]},extendNodeSchema(t){var e;const i={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=a.callOrReturn(a.getExtensionField(t,"allowGapCursor",i)))!==null&&e!==void 0?e:null}}}),I=a.Node.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",a.mergeAttributes(this.options.HTMLAttributes,t)]},renderText(){return`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react"),C=require("./RichTextEditor-Db6oQoYY.cjs"),x=require("./dom-dataset-DmsCLv1q.cjs"),a=require("./index-CSvnpArE.cjs"),b=require("./ListItem.cjs"),S=require("./index-CrxasX7b.cjs"),v=require("./Document.cjs"),k=require("./Selection.cjs"),P=require("./TextBubble.cjs"),M=require("./TrailingNode.cjs"),m=require("./index-Dz3YxLE7.cjs");function T(){var l;const t=p.useRef({editor:null}),[e,i]=p.useState(!1),[o,r]=p.useState(null);return p.useEffect(()=>{var s;(s=t.current)!=null&&s.editor&&(i(!0),r(t.current.editor))},[t,(l=t.current)==null?void 0:l.editor]),{isReady:e,editor:o,editorRef:t}}const E=a.Extension.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const o=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(o)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,i=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(i)}},addProseMirrorPlugins(){let t=!1;return[new a.Plugin({key:new a.PluginKey("characterCount"),appendTransaction:(e,i,o)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const l=this.storage.characters({node:o.doc});if(l>r){const s=l-r,n=0,c=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=o.tr.deleteRange(n,c);return t=!0,u}t=!0},filterTransaction:(e,i)=>{const o=this.options.limit;if(!e.docChanged||o===0||o===null||o===void 0)return!0;const r=this.storage.characters({node:i.doc}),l=this.storage.characters({node:e.doc});if(l<=o||r>o&&l>o&&l<=r)return!0;if(r>o&&l>o&&l>r||!e.getMeta("paste"))return!1;const n=e.selection.$head.pos,c=l-o,u=n-c,h=n;return e.deleteRange(u,h),!(this.storage.characters({node:e.doc})>o)}})]}});function A(t={}){return new a.Plugin({view(e){return new O(e,t)}})}class O{constructor(e,i){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=i.width)!==null&&o!==void 0?o:1,this.color=i.color===!1?void 0:i.color||"black",this.class=i.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let l=s=>{this[r](s)};return e.dom.addEventListener(r,l),{name:r,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:i})=>this.editorView.dom.removeEventListener(e,i))}update(e,i){this.cursorPos!=null&&i.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),i=!e.parent.inlineContent,o;if(i){let n=e.nodeBefore,c=e.nodeAfter;if(n||c){let u=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(u){let h=u.getBoundingClientRect(),f=n?h.bottom:h.top;n&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),o={left:h.left,right:h.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!o){let n=this.editorView.coordsAtPos(this.cursorPos);o={left:n.left-this.width/2,right:n.left+this.width/2,top:n.top,bottom:n.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",i),this.element.classList.toggle("prosemirror-dropcursor-inline",!i);let l,s;if(!r||r==document.body&&getComputedStyle(r).position=="static")l=-pageXOffset,s=-pageYOffset;else{let n=r.getBoundingClientRect();l=n.left-r.scrollLeft,s=n.top-r.scrollTop}this.element.style.left=o.left-l+"px",this.element.style.top=o.top-s+"px",this.element.style.width=o.right-o.left+"px",this.element.style.height=o.bottom-o.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let i=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=i&&i.inside>=0&&this.editorView.state.doc.nodeAt(i.inside),r=o&&o.type.spec.disableDropCursor,l=typeof r=="function"?r(this.editorView,i,e):r;if(i&&!l){let s=i.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let n=a.dropPoint(this.editorView.state.doc,s,this.editorView.dragging.slice);n!=null&&(s=n)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const B=a.Extension.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[A(this.options)]}}),N=a.Extension.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new a.Plugin({key:new a.PluginKey("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:i,isFocused:o}=this.editor,{anchor:r}=e,l=[];if(!i||!o)return a.DecorationSet.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((c,u)=>{if(c.isText)return;if(!(r>=u&&r<=u+c.nodeSize-1))return!1;s+=1});let n=0;return t.descendants((c,u)=>{if(c.isText||!(r>=u&&r<=u+c.nodeSize-1))return!1;if(n+=1,this.options.mode==="deepest"&&s-n>0||this.options.mode==="shallowest"&&n>1)return this.options.mode==="deepest";l.push(a.Decoration.node(u,u+c.nodeSize,{class:this.options.className}))}),a.DecorationSet.create(t,l)}}})]}});class d extends a.Selection{constructor(e){super(e,e)}map(e,i){let o=e.resolve(i.map(this.head));return d.valid(o)?new d(o):a.Selection.near(o)}content(){return a.Slice.empty}eq(e){return e instanceof d&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,i){if(typeof i.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new d(e.resolve(i.pos))}getBookmark(){return new y(this.anchor)}static valid(e){let i=e.parent;if(i.isTextblock||!z(e)||!D(e))return!1;let o=i.type.spec.allowGapCursor;if(o!=null)return o;let r=i.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,i,o=!1){e:for(;;){if(!o&&d.valid(e))return e;let r=e.pos,l=null;for(let s=e.depth;;s--){let n=e.node(s);if(i>0?e.indexAfter(s)<n.childCount:e.index(s)>0){l=n.child(i>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;r+=i;let c=e.doc.resolve(r);if(d.valid(c))return c}for(;;){let s=i>0?l.firstChild:l.lastChild;if(!s){if(l.isAtom&&!l.isText&&!a.NodeSelection.isSelectable(l)){e=e.doc.resolve(r+l.nodeSize*i),o=!1;continue e}break}l=s,r+=i;let n=e.doc.resolve(r);if(d.valid(n))return n}return null}}}d.prototype.visible=!1;d.findFrom=d.findGapCursorFrom;a.Selection.jsonID("gapcursor",d);class y{constructor(e){this.pos=e}map(e){return new y(e.map(this.pos))}resolve(e){let i=e.resolve(this.pos);return d.valid(i)?new d(i):a.Selection.near(i)}}function z(t){for(let e=t.depth;e>=0;e--){let i=t.index(e),o=t.node(e);if(i==0){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function D(t){for(let e=t.depth;e>=0;e--){let i=t.indexAfter(e),o=t.node(e);if(i==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function L(){return new a.Plugin({props:{decorations:q,createSelectionBetween(t,e,i){return e.pos==i.pos&&d.valid(i)?new d(i):null},handleClick:V,handleKeyDown:R,handleDOMEvents:{beforeinput:H}}})}const R=a.keydownHandler({ArrowLeft:g("horiz",-1),ArrowRight:g("horiz",1),ArrowUp:g("vert",-1),ArrowDown:g("vert",1)});function g(t,e){const i=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,r,l){let s=o.selection,n=e>0?s.$to:s.$from,c=s.empty;if(s instanceof a.TextSelection){if(!l.endOfTextblock(i)||n.depth==0)return!1;c=!1,n=o.doc.resolve(e>0?n.after():n.before())}let u=d.findGapCursorFrom(n,e,c);return u?(r&&r(o.tr.setSelection(new d(u))),!0):!1}}function V(t,e,i){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!d.valid(o))return!1;let r=t.posAtCoords({left:i.clientX,top:i.clientY});return r&&r.inside>-1&&a.NodeSelection.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new d(o))),!0)}function H(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof d))return!1;let{$from:i}=t.state.selection,o=i.parent.contentMatchAt(i.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let r=a.Fragment.empty;for(let s=o.length-1;s>=0;s--)r=a.Fragment.from(o[s].createAndFill(null,r));let l=t.state.tr.replace(i.pos,i.pos,new a.Slice(r,0,0));return l.setSelection(a.TextSelection.near(l.doc.resolve(i.pos+1))),t.dispatch(l),!1}function q(t){if(!(t.selection instanceof d))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",a.DecorationSet.create(t.doc,[a.Decoration.widget(t.selection.head,e,{key:"gapcursor"})])}const F=a.Extension.create({name:"gapCursor",addProseMirrorPlugins(){return[L()]},extendNodeSchema(t){var e;const i={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=a.callOrReturn(a.getExtensionField(t,"allowGapCursor",i)))!==null&&e!==void 0?e:null}}}),I=a.Node.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",a.mergeAttributes(this.options.HTMLAttributes,t)]},renderText(){return`
2
2
  `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:i,editor:o})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:l}=i;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:n}=o.extensionManager,c=l||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&c&&s){const f=c.filter(w=>n.includes(w.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),K=a.Node.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",a.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),W=a.Extension.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new a.Plugin({key:new a.PluginKey("placeholder"),props:{decorations:({doc:t,selection:e})=>{const i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=e,r=[];if(!i)return null;const l=this.editor.isEmpty;return t.descendants((s,n)=>{const c=o>=n&&o<=n+s.nodeSize,u=!s.isLeaf&&a.isNodeEmpty(s);if((c||!this.options.showOnlyCurrent)&&u){const h=[this.options.emptyNodeClass];l&&h.push(this.options.emptyEditorClass);const f=a.Decoration.node(n,n+s.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:n,hasAnchor:c}):this.options.placeholder});r.push(f)}return this.options.includeChildren}),a.DecorationSet.create(t,r)}}})]}}),G=a.Node.create({name:"text",group:"inline"}),J=a.Extension.create({name:"base-kit",addExtensions(){const t=[];return this.options.document!==!1&&t.push(v.Document.configure()),this.options.placeholder!==!1&&t.push(W.configure({placeholder:({node:e,pos:i,editor:o})=>{var r,l,s,n,c;return((r=e==null?void 0:e.type)==null?void 0:r.name)==="columns"||((l=e==null?void 0:e.content)==null?void 0:l.size)!==0?"":((s=e==null?void 0:e.type)==null?void 0:s.name)==="heading"?`${m.localeActions.t(`editor.heading.h${e.attrs.level}.tooltip`)}`:((n=e==null?void 0:e.type)==null?void 0:n.name)==="codeBlock"||((c=e==null?void 0:e.type)==null?void 0:c.name)==="table"?"":o.extensionManager.extensions.some(u=>u.name==="slashCommand")?m.localeActions.t("editor.slash"):m.localeActions.t("editor.content")},...this.options.placeholder})),this.options.focus!==!1&&t.push(N.configure({className:"focus",...this.options.focus})),this.options.text!==!1&&t.push(G.configure()),this.options.textBubble!==!1&&t.push(P.TextBubble.configure()),this.options.gapcursor!==!1&&t.push(F.configure()),this.options.dropcursor!==!1&&t.push(B.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&t.push(E.configure(this.options.characterCount)),this.options.paragraph!==!1&&t.push(K.configure(this.options.paragraph)),this.options.hardBreak!==!1&&t.push(I.configure(this.options.hardBreak)),this.options.listItem!==!1&&t.push(b.ListItem.configure(this.options.listItem)),this.options.textStyle!==!1&&t.push(S.TextStyle.configure(this.options.textStyle)),this.options.trailingNode!==!1&&t.push(M.TrailingNode.configure(this.options.trailingNode)),this.options.selection!==!1&&t.push(k.Selection),this.options.multiColumn!==!1&&t.push(C.Column,C.MultiColumn),t}});exports.default=C.RichTextEditor;exports.BubbleMenu=x.BubbleMenu;exports.BaseKit=J;exports.useEditorState=T;
package/lib/index.d.cts CHANGED
@@ -676,14 +676,15 @@ declare module '@tiptap/core' {
676
676
 
677
677
  declare module '@tiptap/core' {
678
678
  interface Commands<ReturnType> {
679
- twitter: {
679
+ video: {
680
680
  /**
681
- * Insert a tweet
682
- * @param options The tweet attributes
683
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
681
+ * Add an video
684
682
  */
685
- setTweet: (options: SetTweetOptions) => ReturnType;
686
- updateTweet: (options: SetTweetOptions) => ReturnType;
683
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
684
+ /**
685
+ * Update an video
686
+ */
687
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
687
688
  };
688
689
  }
689
690
  }
@@ -691,15 +692,14 @@ declare module '@tiptap/core' {
691
692
 
692
693
  declare module '@tiptap/core' {
693
694
  interface Commands<ReturnType> {
694
- video: {
695
- /**
696
- * Add an video
697
- */
698
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
695
+ twitter: {
699
696
  /**
700
- * Update an video
697
+ * Insert a tweet
698
+ * @param options The tweet attributes
699
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
701
700
  */
702
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
701
+ setTweet: (options: SetTweetOptions) => ReturnType;
702
+ updateTweet: (options: SetTweetOptions) => ReturnType;
703
703
  };
704
704
  }
705
705
  }
package/lib/index.d.ts CHANGED
@@ -676,14 +676,15 @@ declare module '@tiptap/core' {
676
676
 
677
677
  declare module '@tiptap/core' {
678
678
  interface Commands<ReturnType> {
679
- twitter: {
679
+ video: {
680
680
  /**
681
- * Insert a tweet
682
- * @param options The tweet attributes
683
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
681
+ * Add an video
684
682
  */
685
- setTweet: (options: SetTweetOptions) => ReturnType;
686
- updateTweet: (options: SetTweetOptions) => ReturnType;
683
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
684
+ /**
685
+ * Update an video
686
+ */
687
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
687
688
  };
688
689
  }
689
690
  }
@@ -691,15 +692,14 @@ declare module '@tiptap/core' {
691
692
 
692
693
  declare module '@tiptap/core' {
693
694
  interface Commands<ReturnType> {
694
- video: {
695
- /**
696
- * Add an video
697
- */
698
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
695
+ twitter: {
699
696
  /**
700
- * Update an video
697
+ * Insert a tweet
698
+ * @param options The tweet attributes
699
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
701
700
  */
702
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
701
+ setTweet: (options: SetTweetOptions) => ReturnType;
702
+ updateTweet: (options: SetTweetOptions) => ReturnType;
703
703
  };
704
704
  }
705
705
  }
package/lib/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { useRef as O, useState as S, useEffect as B } from "react";
2
- import { a8 as z, a9 as N } from "./RichTextEditor-DS30aD8t.js";
3
- import { aa as ve } from "./RichTextEditor-DS30aD8t.js";
4
- import { B as ke } from "./dom-dataset-pKb7TLlt.js";
5
- import { E as h, P as p, a as w, y as L, D as C, b, z as R, F as k, S as P, T as M, f as T, B as y, C as D, G as V, N as x, m as A, H } from "./index-DEe_Svay.js";
2
+ import { a8 as z, a9 as N } from "./RichTextEditor-BfYZYQb9.js";
3
+ import { aa as ve } from "./RichTextEditor-BfYZYQb9.js";
4
+ import { B as ke } from "./dom-dataset-2RXYq9wp.js";
5
+ import { E as f, P as p, a as y, z as L, D as C, b, B as R, F as k, S as P, T as M, g as T, C as w, G as D, H as V, N as x, m as A, I as H } from "./index-CXIIg9Sq.js";
6
6
  import { ListItem as F } from "./ListItem.js";
7
- import { T as I } from "./index-Dk3tSDmG.js";
7
+ import { T as I } from "./index-BkoojfPK.js";
8
8
  import { Document as K } from "./Document.js";
9
9
  import { Selection as G } from "./Selection.js";
10
10
  import { TextBubble as W } from "./TextBubble.js";
11
11
  import { TrailingNode as J } from "./TrailingNode.js";
12
12
  import { m } from "./index-D-DR0FPY.js";
13
- function ye() {
13
+ function we() {
14
14
  var l;
15
15
  const t = O({ editor: null }), [e, o] = S(!1), [s, r] = S(null);
16
16
  return B(() => {
@@ -18,7 +18,7 @@ function ye() {
18
18
  (i = t.current) != null && i.editor && (o(!0), r(t.current.editor));
19
19
  }, [t, (l = t.current) == null ? void 0 : l.editor]), { isReady: e, editor: s, editorRef: t };
20
20
  }
21
- const X = h.create({
21
+ const X = f.create({
22
22
  name: "characterCount",
23
23
  addOptions() {
24
24
  return {
@@ -51,7 +51,7 @@ const X = h.create({
51
51
  let t = !1;
52
52
  return [
53
53
  new p({
54
- key: new w("characterCount"),
54
+ key: new y("characterCount"),
55
55
  appendTransaction: (e, o, s) => {
56
56
  if (t)
57
57
  return;
@@ -118,8 +118,8 @@ class j {
118
118
  if (n || a) {
119
119
  let c = this.editorView.nodeDOM(this.cursorPos - (n ? n.nodeSize : 0));
120
120
  if (c) {
121
- let u = c.getBoundingClientRect(), f = n ? u.bottom : u.top;
122
- n && a && (f = (f + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2), s = { left: u.left, right: u.right, top: f - this.width / 2, bottom: f + this.width / 2 };
121
+ let u = c.getBoundingClientRect(), h = n ? u.bottom : u.top;
122
+ n && a && (h = (h + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2), s = { left: u.left, right: u.right, top: h - this.width / 2, bottom: h + this.width / 2 };
123
123
  }
124
124
  }
125
125
  }
@@ -164,7 +164,7 @@ class j {
164
164
  (e.target == this.editorView.dom || !this.editorView.dom.contains(e.relatedTarget)) && this.setCursor(null);
165
165
  }
166
166
  }
167
- const q = h.create({
167
+ const q = f.create({
168
168
  name: "dropCursor",
169
169
  addOptions() {
170
170
  return {
@@ -178,7 +178,7 @@ const q = h.create({
178
178
  Y(this.options)
179
179
  ];
180
180
  }
181
- }), U = h.create({
181
+ }), U = f.create({
182
182
  name: "focus",
183
183
  addOptions() {
184
184
  return {
@@ -189,7 +189,7 @@ const q = h.create({
189
189
  addProseMirrorPlugins() {
190
190
  return [
191
191
  new p({
192
- key: new w("focus"),
192
+ key: new y("focus"),
193
193
  props: {
194
194
  decorations: ({ doc: t, selection: e }) => {
195
195
  const { isEditable: o, isFocused: s } = this.editor, { anchor: r } = e, l = [];
@@ -219,7 +219,7 @@ const q = h.create({
219
219
  ];
220
220
  }
221
221
  });
222
- class d extends y {
222
+ class d extends w {
223
223
  /**
224
224
  Create a gap cursor.
225
225
  */
@@ -228,7 +228,7 @@ class d extends y {
228
228
  }
229
229
  map(e, o) {
230
230
  let s = e.resolve(o.map(this.head));
231
- return d.valid(s) ? new d(s) : y.near(s);
231
+ return d.valid(s) ? new d(s) : w.near(s);
232
232
  }
233
233
  content() {
234
234
  return P.empty;
@@ -306,7 +306,7 @@ class d extends y {
306
306
  }
307
307
  d.prototype.visible = !1;
308
308
  d.findFrom = d.findGapCursorFrom;
309
- y.jsonID("gapcursor", d);
309
+ w.jsonID("gapcursor", d);
310
310
  class v {
311
311
  constructor(e) {
312
312
  this.pos = e;
@@ -316,7 +316,7 @@ class v {
316
316
  }
317
317
  resolve(e) {
318
318
  let o = e.resolve(this.pos);
319
- return d.valid(o) ? new d(o) : y.near(o);
319
+ return d.valid(o) ? new d(o) : w.near(o);
320
320
  }
321
321
  }
322
322
  function Q(t) {
@@ -412,7 +412,7 @@ function re(t) {
412
412
  let e = document.createElement("div");
413
413
  return e.className = "ProseMirror-gapcursor", C.create(t.doc, [b.widget(t.selection.head, e, { key: "gapcursor" })]);
414
414
  }
415
- const oe = h.create({
415
+ const oe = f.create({
416
416
  name: "gapCursor",
417
417
  addProseMirrorPlugins() {
418
418
  return [
@@ -465,8 +465,8 @@ const oe = h.create({
465
465
  const { keepMarks: i } = this.options, { splittableMarks: n } = s.extensionManager, a = l || r.$to.parentOffset && r.$from.marks();
466
466
  return e().insertContent({ type: this.name }).command(({ tr: c, dispatch: u }) => {
467
467
  if (u && a && i) {
468
- const f = a.filter((E) => n.includes(E.type.name));
469
- c.ensureMarks(f);
468
+ const h = a.filter((E) => n.includes(E.type.name));
469
+ c.ensureMarks(h);
470
470
  }
471
471
  return !0;
472
472
  }).run();
@@ -508,7 +508,7 @@ const oe = h.create({
508
508
  "Mod-Alt-0": () => this.editor.commands.setParagraph()
509
509
  };
510
510
  }
511
- }), ne = h.create({
511
+ }), ne = f.create({
512
512
  name: "placeholder",
513
513
  addOptions() {
514
514
  return {
@@ -523,7 +523,7 @@ const oe = h.create({
523
523
  addProseMirrorPlugins() {
524
524
  return [
525
525
  new p({
526
- key: new w("placeholder"),
526
+ key: new y("placeholder"),
527
527
  props: {
528
528
  decorations: ({ doc: t, selection: e }) => {
529
529
  const o = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: s } = e, r = [];
@@ -535,7 +535,7 @@ const oe = h.create({
535
535
  if ((a || !this.options.showOnlyCurrent) && c) {
536
536
  const u = [this.options.emptyNodeClass];
537
537
  l && u.push(this.options.emptyEditorClass);
538
- const f = b.node(n, n + i.nodeSize, {
538
+ const h = b.node(n, n + i.nodeSize, {
539
539
  class: u.join(" "),
540
540
  "data-placeholder": typeof this.options.placeholder == "function" ? this.options.placeholder({
541
541
  editor: this.editor,
@@ -544,7 +544,7 @@ const oe = h.create({
544
544
  hasAnchor: a
545
545
  }) : this.options.placeholder
546
546
  });
547
- r.push(f);
547
+ r.push(h);
548
548
  }
549
549
  return this.options.includeChildren;
550
550
  }), C.create(t, r);
@@ -556,7 +556,7 @@ const oe = h.create({
556
556
  }), le = x.create({
557
557
  name: "text",
558
558
  group: "inline"
559
- }), we = /* @__PURE__ */ h.create({
559
+ }), ye = /* @__PURE__ */ f.create({
560
560
  name: "base-kit",
561
561
  addExtensions() {
562
562
  const t = [];
@@ -583,8 +583,8 @@ const oe = h.create({
583
583
  }
584
584
  });
585
585
  export {
586
- we as BaseKit,
586
+ ye as BaseKit,
587
587
  ke as BubbleMenu,
588
588
  ve as default,
589
- ye as useEditorState
589
+ we as useEditorState
590
590
  };
@@ -1127,14 +1127,15 @@ declare module '@tiptap/core' {
1127
1127
 
1128
1128
  declare module '@tiptap/core' {
1129
1129
  interface Commands<ReturnType> {
1130
- twitter: {
1130
+ video: {
1131
1131
  /**
1132
- * Insert a tweet
1133
- * @param options The tweet attributes
1134
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1132
+ * Add an video
1135
1133
  */
1136
- setTweet: (options: SetTweetOptions) => ReturnType;
1137
- updateTweet: (options: SetTweetOptions) => ReturnType;
1134
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1135
+ /**
1136
+ * Update an video
1137
+ */
1138
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1138
1139
  };
1139
1140
  }
1140
1141
  }
@@ -1142,15 +1143,14 @@ declare module '@tiptap/core' {
1142
1143
 
1143
1144
  declare module '@tiptap/core' {
1144
1145
  interface Commands<ReturnType> {
1145
- video: {
1146
- /**
1147
- * Add an video
1148
- */
1149
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1146
+ twitter: {
1150
1147
  /**
1151
- * Update an video
1148
+ * Insert a tweet
1149
+ * @param options The tweet attributes
1150
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1152
1151
  */
1153
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1152
+ setTweet: (options: SetTweetOptions) => ReturnType;
1153
+ updateTweet: (options: SetTweetOptions) => ReturnType;
1154
1154
  };
1155
1155
  }
1156
1156
  }
@@ -1127,14 +1127,15 @@ declare module '@tiptap/core' {
1127
1127
 
1128
1128
  declare module '@tiptap/core' {
1129
1129
  interface Commands<ReturnType> {
1130
- twitter: {
1130
+ video: {
1131
1131
  /**
1132
- * Insert a tweet
1133
- * @param options The tweet attributes
1134
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1132
+ * Add an video
1135
1133
  */
1136
- setTweet: (options: SetTweetOptions) => ReturnType;
1137
- updateTweet: (options: SetTweetOptions) => ReturnType;
1134
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1135
+ /**
1136
+ * Update an video
1137
+ */
1138
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1138
1139
  };
1139
1140
  }
1140
1141
  }
@@ -1142,15 +1143,14 @@ declare module '@tiptap/core' {
1142
1143
 
1143
1144
  declare module '@tiptap/core' {
1144
1145
  interface Commands<ReturnType> {
1145
- video: {
1146
- /**
1147
- * Add an video
1148
- */
1149
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1146
+ twitter: {
1150
1147
  /**
1151
- * Update an video
1148
+ * Insert a tweet
1149
+ * @param options The tweet attributes
1150
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1152
1151
  */
1153
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1152
+ setTweet: (options: SetTweetOptions) => ReturnType;
1153
+ updateTweet: (options: SetTweetOptions) => ReturnType;
1154
1154
  };
1155
1155
  }
1156
1156
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
- import { d as o } from "./RichTextEditor-DS30aD8t.js";
3
+ import { d as o } from "./RichTextEditor-BfYZYQb9.js";
4
4
  const x = c.forwardRef(
5
5
  ({ className: t, ...e }, r) => /* @__PURE__ */ i(
6
6
  "textarea",
@@ -1 +1 @@
1
- "use strict";const n=require("react/jsx-runtime"),o=require("react"),a=require("./RichTextEditor-CFS3E6GK.cjs");function s(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const u=s(o),c=u.forwardRef(({className:e,...r},t)=>n.jsx("textarea",{className:a.cn("richtext-flex richtext-min-h-[80px] richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:t,...r}));c.displayName="Textarea";exports.Textarea=c;
1
+ "use strict";const n=require("react/jsx-runtime"),o=require("react"),a=require("./RichTextEditor-Db6oQoYY.cjs");function s(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const u=s(o),c=u.forwardRef(({className:e,...r},t)=>n.jsx("textarea",{className:a.cn("richtext-flex richtext-min-h-[80px] richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:t,...r}));c.displayName="Textarea";exports.Textarea=c;