reactjs-tiptap-editor 0.3.31 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/README.md +8 -2
  2. package/lib/{ActionMenuButton-BCgqJsST.cjs → ActionMenuButton-CYdM1xx5.cjs} +1 -1
  3. package/lib/{ActionMenuButton-D97K0UWT.js → ActionMenuButton-DKRF6oa0.js} +1 -1
  4. package/lib/Attachment.cjs +2 -2
  5. package/lib/Attachment.d.cts +25 -29
  6. package/lib/Attachment.d.ts +25 -29
  7. package/lib/Attachment.js +7 -6
  8. package/lib/BaseKit.cjs +3 -0
  9. package/lib/BaseKit.d.cts +481 -0
  10. package/lib/BaseKit.d.ts +481 -0
  11. package/lib/BaseKit.js +132 -0
  12. package/lib/Blockquote.cjs +5 -1
  13. package/lib/Blockquote.d.cts +25 -29
  14. package/lib/Blockquote.d.ts +25 -29
  15. package/lib/Blockquote.js +33 -17
  16. package/lib/Bold.cjs +1 -1
  17. package/lib/Bold.d.cts +25 -29
  18. package/lib/Bold.d.ts +25 -29
  19. package/lib/Bold.js +23 -16
  20. package/lib/BulletList.cjs +1 -1
  21. package/lib/BulletList.d.cts +26 -30
  22. package/lib/BulletList.d.ts +26 -30
  23. package/lib/BulletList.js +11 -57
  24. package/lib/Clear.cjs +1 -1
  25. package/lib/Clear.d.cts +25 -29
  26. package/lib/Clear.d.ts +25 -29
  27. package/lib/Clear.js +4 -2
  28. package/lib/Code.cjs +1 -1
  29. package/lib/Code.d.cts +25 -29
  30. package/lib/Code.d.ts +25 -29
  31. package/lib/Code.js +29 -25
  32. package/lib/CodeBlock.cjs +2 -2
  33. package/lib/CodeBlock.d.cts +25 -29
  34. package/lib/CodeBlock.d.ts +25 -29
  35. package/lib/CodeBlock.js +3 -3
  36. package/lib/CodeView.cjs +1 -1
  37. package/lib/CodeView.d.cts +25 -29
  38. package/lib/CodeView.d.ts +25 -29
  39. package/lib/CodeView.js +3 -2
  40. package/lib/Color.cjs +1 -1
  41. package/lib/Color.d.cts +26 -30
  42. package/lib/Color.d.ts +26 -30
  43. package/lib/Color.js +42 -74
  44. package/lib/Document.cjs +1 -1
  45. package/lib/Document.d.cts +25 -29
  46. package/lib/Document.d.ts +25 -29
  47. package/lib/Document.js +4 -8
  48. package/lib/{Drawer-BHkje8ys.js → Drawer-CaAfmqNo.js} +37 -35
  49. package/lib/{Drawer-5Q_-WRhc.cjs → Drawer-CdvCMSzN.cjs} +1 -1
  50. package/lib/Drawer.cjs +1 -1
  51. package/lib/Drawer.d.cts +25 -29
  52. package/lib/Drawer.d.ts +25 -29
  53. package/lib/Drawer.js +4 -4
  54. package/lib/Emoji.cjs +1 -1
  55. package/lib/Emoji.d.cts +28 -30
  56. package/lib/Emoji.d.ts +28 -30
  57. package/lib/Emoji.js +19795 -184
  58. package/lib/{Excalidraw-GUVW-IqC.cjs → Excalidraw-BbMQhNvs.cjs} +1 -1
  59. package/lib/{Excalidraw-CG498239.js → Excalidraw-CVWz2Vyn.js} +20 -20
  60. package/lib/Excalidraw.cjs +1 -1
  61. package/lib/Excalidraw.d.cts +25 -29
  62. package/lib/Excalidraw.d.ts +25 -29
  63. package/lib/Excalidraw.js +3 -3
  64. package/lib/ExportPdf.cjs +1 -1
  65. package/lib/ExportPdf.d.cts +25 -29
  66. package/lib/ExportPdf.d.ts +25 -29
  67. package/lib/ExportPdf.js +4 -2
  68. package/lib/ExportWord.cjs +1 -1
  69. package/lib/ExportWord.d.cts +25 -29
  70. package/lib/ExportWord.d.ts +25 -29
  71. package/lib/ExportWord.js +22 -51
  72. package/lib/FontFamily.cjs +1 -1
  73. package/lib/FontFamily.d.cts +26 -30
  74. package/lib/FontFamily.d.ts +26 -30
  75. package/lib/FontFamily.js +44 -73
  76. package/lib/FontSize.cjs +1 -1
  77. package/lib/FontSize.d.cts +25 -29
  78. package/lib/FontSize.d.ts +25 -29
  79. package/lib/FontSize.js +7 -5
  80. package/lib/FormatPainter.cjs +1 -1
  81. package/lib/FormatPainter.d.cts +25 -29
  82. package/lib/FormatPainter.d.ts +25 -29
  83. package/lib/FormatPainter.js +4 -2
  84. package/lib/Heading.cjs +1 -1
  85. package/lib/Heading.d.cts +25 -29
  86. package/lib/Heading.d.ts +25 -29
  87. package/lib/Heading.js +71 -60
  88. package/lib/Highlight.cjs +1 -1
  89. package/lib/Highlight.d.cts +25 -29
  90. package/lib/Highlight.d.ts +25 -29
  91. package/lib/Highlight.js +5 -4
  92. package/lib/History.cjs +1 -1
  93. package/lib/History.d.cts +27 -31
  94. package/lib/History.d.ts +27 -31
  95. package/lib/History.js +39 -403
  96. package/lib/HorizontalRule.cjs +1 -1
  97. package/lib/HorizontalRule.d.cts +25 -29
  98. package/lib/HorizontalRule.d.ts +25 -29
  99. package/lib/HorizontalRule.js +16 -65
  100. package/lib/Iframe.cjs +1 -1
  101. package/lib/Iframe.d.cts +25 -29
  102. package/lib/Iframe.d.ts +25 -29
  103. package/lib/Iframe.js +4 -4
  104. package/lib/Image.cjs +1 -1
  105. package/lib/Image.d.cts +25 -29
  106. package/lib/Image.d.ts +25 -29
  107. package/lib/Image.js +3 -3
  108. package/lib/ImageGif.cjs +1 -1
  109. package/lib/ImageGif.d.cts +25 -29
  110. package/lib/ImageGif.d.ts +25 -29
  111. package/lib/ImageGif.js +5 -5
  112. package/lib/ImportWord.cjs +72 -72
  113. package/lib/ImportWord.d.cts +25 -29
  114. package/lib/ImportWord.d.ts +25 -29
  115. package/lib/ImportWord.js +5652 -5615
  116. package/lib/Indent.cjs +1 -1
  117. package/lib/Indent.d.cts +25 -29
  118. package/lib/Indent.d.ts +25 -29
  119. package/lib/Indent.js +4 -2
  120. package/lib/Italic.cjs +1 -1
  121. package/lib/Italic.d.cts +25 -29
  122. package/lib/Italic.d.ts +25 -29
  123. package/lib/Italic.js +20 -14
  124. package/lib/Katex.cjs +1 -1
  125. package/lib/Katex.d.cts +25 -29
  126. package/lib/Katex.d.ts +25 -29
  127. package/lib/Katex.js +12 -12
  128. package/lib/LineHeight.cjs +1 -1
  129. package/lib/LineHeight.d.cts +25 -29
  130. package/lib/LineHeight.d.ts +25 -29
  131. package/lib/LineHeight.js +5 -3
  132. package/lib/Link.cjs +1 -1
  133. package/lib/Link.d.cts +25 -29
  134. package/lib/Link.d.ts +25 -29
  135. package/lib/Link.js +4 -4
  136. package/lib/ListItem.cjs +1 -1
  137. package/lib/ListItem.d.cts +30 -30
  138. package/lib/ListItem.d.ts +30 -30
  139. package/lib/ListItem.js +4 -30
  140. package/lib/Mention.cjs +1 -1
  141. package/lib/Mention.d.cts +25 -29
  142. package/lib/Mention.d.ts +25 -29
  143. package/lib/Mention.js +161 -132
  144. package/lib/Mermaid.cjs +2 -2
  145. package/lib/Mermaid.d.cts +25 -29
  146. package/lib/Mermaid.d.ts +25 -29
  147. package/lib/Mermaid.js +50 -48
  148. package/lib/MoreMark.cjs +1 -1
  149. package/lib/MoreMark.d.cts +25 -29
  150. package/lib/MoreMark.d.ts +25 -29
  151. package/lib/MoreMark.js +5 -3
  152. package/lib/MultiColumn.cjs +1 -1
  153. package/lib/MultiColumn.d.cts +25 -29
  154. package/lib/MultiColumn.d.ts +25 -29
  155. package/lib/MultiColumn.js +2 -2
  156. package/lib/OrderedList.cjs +1 -1
  157. package/lib/OrderedList.d.cts +26 -30
  158. package/lib/OrderedList.d.ts +26 -30
  159. package/lib/OrderedList.js +11 -75
  160. package/lib/RichTextEditor-CxvwGvQG.cjs +142 -0
  161. package/lib/RichTextEditor-DGcKEUGr.js +22166 -0
  162. package/lib/SearchAndReplace.cjs +1 -1
  163. package/lib/SearchAndReplace.d.cts +38 -112
  164. package/lib/SearchAndReplace.d.ts +38 -112
  165. package/lib/SearchAndReplace.js +204 -192
  166. package/lib/Selection.cjs +1 -1
  167. package/lib/Selection.d.cts +25 -29
  168. package/lib/Selection.d.ts +25 -29
  169. package/lib/Selection.js +1 -1
  170. package/lib/SlashCommand.cjs +1 -1
  171. package/lib/SlashCommand.d.cts +25 -29
  172. package/lib/SlashCommand.d.ts +25 -29
  173. package/lib/SlashCommand.js +178 -223
  174. package/lib/Strike.cjs +1 -1
  175. package/lib/Strike.d.cts +25 -29
  176. package/lib/Strike.d.ts +25 -29
  177. package/lib/Strike.js +20 -14
  178. package/lib/SubAndSuperScript.cjs +1 -1
  179. package/lib/SubAndSuperScript.d.cts +25 -29
  180. package/lib/SubAndSuperScript.d.ts +25 -29
  181. package/lib/SubAndSuperScript.js +5 -3
  182. package/lib/Table.cjs +8 -10
  183. package/lib/Table.d.cts +28 -32
  184. package/lib/Table.d.ts +28 -32
  185. package/lib/Table.js +382 -2022
  186. package/lib/TableOfContent.cjs +1 -1
  187. package/lib/TableOfContent.d.cts +25 -29
  188. package/lib/TableOfContent.d.ts +25 -29
  189. package/lib/TableOfContent.js +5 -5
  190. package/lib/TaskList.cjs +1 -1
  191. package/lib/TaskList.d.cts +27 -31
  192. package/lib/TaskList.d.ts +27 -31
  193. package/lib/TaskList.js +12 -154
  194. package/lib/TextAlign.cjs +1 -1
  195. package/lib/TextAlign.d.cts +25 -29
  196. package/lib/TextAlign.d.ts +25 -29
  197. package/lib/TextAlign.js +11 -9
  198. package/lib/TextBubble.cjs +1 -1
  199. package/lib/TextBubble.d.cts +25 -29
  200. package/lib/TextBubble.d.ts +25 -29
  201. package/lib/TextBubble.js +5 -3
  202. package/lib/TextDirection.cjs +1 -1
  203. package/lib/TextDirection.d.cts +25 -29
  204. package/lib/TextDirection.d.ts +25 -29
  205. package/lib/TextDirection.js +2 -3
  206. package/lib/TextUnderline.cjs +1 -1
  207. package/lib/TextUnderline.d.cts +25 -29
  208. package/lib/TextUnderline.d.ts +25 -29
  209. package/lib/TextUnderline.js +40 -12
  210. package/lib/TrailingNode.cjs +1 -1
  211. package/lib/TrailingNode.d.cts +25 -29
  212. package/lib/TrailingNode.d.ts +25 -29
  213. package/lib/TrailingNode.js +1 -1
  214. package/lib/Twitter-BFULyqdR.js +1628 -0
  215. package/lib/Twitter-Cutpkh3h.cjs +1 -0
  216. package/lib/Twitter.cjs +1 -1
  217. package/lib/Twitter.d.cts +25 -29
  218. package/lib/Twitter.d.ts +25 -29
  219. package/lib/Twitter.js +3 -3
  220. package/lib/Video.cjs +1 -1
  221. package/lib/Video.d.cts +25 -29
  222. package/lib/Video.d.ts +25 -29
  223. package/lib/Video.js +3 -3
  224. package/lib/bubble-extra.cjs +2 -2
  225. package/lib/bubble-extra.d.cts +25 -29
  226. package/lib/bubble-extra.d.ts +25 -29
  227. package/lib/bubble-extra.js +200 -192
  228. package/lib/dom-dataset-_6-diIRQ.cjs +33 -0
  229. package/lib/dom-dataset-lYeH6gfI.js +2361 -0
  230. package/lib/index-5iBZLua9.cjs +12 -0
  231. package/lib/index-6D1J-A-o.cjs +1 -0
  232. package/lib/index-B96Cclrj.cjs +3 -0
  233. package/lib/index-BBz7Nmv9.js +55 -0
  234. package/lib/index-BeCTd5v2.cjs +1 -0
  235. package/lib/index-ByurDDMv.js +237 -0
  236. package/lib/index-CUogRI7j.cjs +1 -0
  237. package/lib/index-Ch6dBBad.js +709 -0
  238. package/lib/index-DF2Lp4HZ.cjs +100 -0
  239. package/lib/{index-LUL9mqY4.js → index-D_L6n8O8.js} +4 -4
  240. package/lib/index-Dbvi-Bvh.cjs +1 -0
  241. package/lib/index-DpCrt7xs.cjs +1 -0
  242. package/lib/index-DsAX1Vq8.cjs +1 -0
  243. package/lib/index-Dy4DlW9o.js +12 -0
  244. package/lib/index-J3jHHZ4d.js +200 -0
  245. package/lib/{index-CsK90iVd.js → index-LmrOdnen.js} +302 -389
  246. package/lib/index-VvXaaKe3.js +898 -0
  247. package/lib/index-kbO3iWqL.js +13432 -0
  248. package/lib/index.cjs +1 -2
  249. package/lib/index.d.cts +26 -229
  250. package/lib/index.d.ts +26 -229
  251. package/lib/index.js +2 -588
  252. package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
  253. package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
  254. package/lib/locale-bundle.cjs +1 -1
  255. package/lib/locale-bundle.d.cts +25 -29
  256. package/lib/locale-bundle.d.ts +25 -29
  257. package/lib/locale-bundle.js +1 -1
  258. package/lib/style.css +1 -1
  259. package/lib/{textarea-DdH64g04.cjs → textarea-DFo_aXnj.cjs} +1 -1
  260. package/lib/{textarea-CktfkXNe.js → textarea-aPtytkDx.js} +1 -1
  261. package/package.json +76 -70
  262. package/lib/RichTextEditor-DWlLqTl9.cjs +0 -140
  263. package/lib/RichTextEditor-KP2Rgcqe.js +0 -12751
  264. package/lib/Twitter-99ivY5qv.js +0 -1744
  265. package/lib/Twitter-BvfvUtNT.cjs +0 -17
  266. package/lib/dom-dataset-Byuf1YmW.cjs +0 -33
  267. package/lib/dom-dataset-Di3tIRrR.js +0 -1031
  268. package/lib/index-BI-IcZcN.cjs +0 -1
  269. package/lib/index-ByRfqzMr.cjs +0 -89
  270. package/lib/index-C1fzuXpN.js +0 -46
  271. package/lib/index-CbQQFj2T.js +0 -133
  272. package/lib/index-DI9T3iLd.js +0 -12354
  273. package/lib/index-D_A0TBRA.cjs +0 -1
  274. package/lib/index-DclQSrIx.cjs +0 -1
  275. package/lib/index-Z4b9rzn-.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-ByRfqzMr.cjs"),P=require("scroll-into-view-if-needed"),a=require("react/jsx-runtime"),f=require("react"),c=require("./RichTextEditor-DWlLqTl9.cjs"),A=require("./index-D_A0TBRA.cjs");function w({editor:e,...t}){const{t:s}=A.useLocale(),[i,n]=f.useState(-1),[r,l]=f.useState([]),[o,x]=f.useState(""),[u,h]=f.useState(""),[m,C]=f.useState(!1),[T,I]=f.useState(!1);return f.useEffect(()=>{m||(x(""),h(""),n(-1),l([]),e.commands.setSearchTerm(""),e.commands.setReplaceTerm(""))},[e,m]),f.useEffect(()=>{m&&e&&e.commands&&e.commands.setSearchTerm&&e.commands.setSearchTerm(o)},[m,o,e]),f.useEffect(()=>{m&&e&&e.commands&&e.commands.setReplaceTerm&&e.commands.setReplaceTerm(u)},[m,u,e]),f.useEffect(()=>{if(!e)return;const d=e.extensionManager.extensions.find(R=>R.name===j.name);if(!d)return;const p=()=>{if(!m)return;const R=d?d.storage.currentIndex:-1,v=d?d.storage.results:[];n(E=>E!==R?R:E),l(E=>c.deepEqual(E,v)?E:v)};return c.listenEvent(c.EVENTS.SEARCH_REPLCE,p),()=>{d&&c.listenEvent(c.EVENTS.SEARCH_REPLCE,p)}},[m,e]),a.jsxs(c.Popover,{onOpenChange:C,open:m,children:[a.jsx(c.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:a.jsx(c.ActionButton,{disabled:t==null?void 0:t.disabled,isActive:t==null?void 0:t.isActive,tooltip:t==null?void 0:t.tooltip,tooltipOptions:t==null?void 0:t.tooltipOptions,children:a.jsx(c.IconComponent,{name:t==null?void 0:t.icon})})}),a.jsxs(c.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[a.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[a.jsx(c.Label,{children:s("editor.search.dialog.text")}),a.jsx("span",{className:"richtext-font-semibold",children:r.length>0?`${i+1}/${r.length}`:"0/0"})]}),a.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[a.jsx(c.Input,{autoFocus:!0,className:"richtext-w-full",onChange:d=>x(d.target.value),placeholder:"Text",required:!0,type:"text",value:o}),a.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToPrevSearchResult,children:a.jsx(c.IconComponent,{name:"ChevronUp"})}),a.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToNextSearchResult,children:a.jsx(c.IconComponent,{name:"ChevronDown"})})]}),a.jsx(c.Label,{className:"richtext-mb-[6px]",children:s("editor.replace.dialog.text")}),a.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:a.jsx(c.Input,{className:"richtext-w-80",onChange:d=>h(d.target.value),placeholder:"Text",required:!0,type:"text",value:u})})}),a.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2",children:[a.jsx(c.Switch,{checked:T,onCheckedChange:d=>{I(d),e.commands.setCaseSensitive(d)}}),a.jsx(c.Label,{children:s("editor.replace.caseSensitive")})]}),a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[a.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.replace,children:s("editor.replace.dialog.text")}),a.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.replaceAll,children:s("editor.replaceAll.dialog.text")})]})]})]})}const S=(e,t)=>t(e.tr);function V(e,t,s){return RegExp(t?e.replace(/[$()*+./?[\\\]^{|}-]/g,String.raw`\$&`):e,s?"gu":"gui")}function L(e,t,s){const i=[];let n=[];const r=[];let l=0;if(!t)return{decorationsToReturn:[],results:[]};e==null||e.descendants((o,x)=>{o.isText?n[l]?n[l]={text:n[l].text+o.text,pos:n[l].pos}:n[l]={text:`${o.text}`,pos:x}:l+=1}),n=n.filter(Boolean);for(const{text:o,pos:x}of n){const u=[...o.matchAll(t)];for(const h of u){if(h[0]==="")break;h.index!==void 0&&r.push({from:x+h.index,to:x+h.index+h[0].length})}}for(const o of r)i.push(g.Decoration.inline(o.from,o.to,{class:s}));return{decorationsToReturn:i,results:r}}function b(e,t,{state:s,dispatch:i}){if(!t[0])return;const{from:r,to:l}=t[0];i&&i(s.tr.insertText(e,r,l))}function y(e,t,s,i){const n=t+1;if(!i[n])return null;const{from:r,to:l}=i[t],o=l-r-e.length+s,{from:x,to:u}=i[n];return i[n]={to:u-o,from:x-o},[o,i]}function D(e,t,{tr:s,dispatch:i}){let n=0,r=t.slice();if(r.length===0)return!1;for(let l=0;l<r.length;l+=1){const{from:o,to:x}=r[l];s.insertText(e,o,x);const u=y(e,l,n,r);u&&(n=u[0],r=u[1])}return i(s),!0}function N({view:e,tr:t,searchResults:s,searchResultCurrentClass:i,gotoIndex:n}){const r=s[n];if(r){const l=t.setMeta("directDecoration",{fromPos:r.from,toPos:r.to,attrs:{class:i}});return e==null||e.dispatch(l),setTimeout(()=>{const o=window.document.querySelector(`.${i}`);o&&P(o,{behavior:"smooth",scrollMode:"if-needed"})},0),!0}return!1}const j=g.Extension.create({name:"search",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),searchTerm:"",replaceTerm:"",results:[],currentIndex:0,searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!1,onChange:()=>{},button:({editor:t,t:s})=>({component:w,componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:s("editor.searchAndReplace.tooltip"),isActive:()=>!1,disabled:!1,editor:t}})}},addStorage(){return{results:[],currentIndex:-1}},addCommands(){return{setSearchTerm:e=>({state:t,dispatch:s})=>(this.options.searchTerm=e,this.storage.results=[],this.storage.currentIndex=0,c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(t,s),!1),setReplaceTerm:e=>({state:t,dispatch:s})=>(this.options.replaceTerm=e,S(t,s),!1),setCaseSensitive:e=>({state:t,dispatch:s})=>(this.options.caseSensitive=e,S(t,s),!1),replace:()=>({state:e,dispatch:t})=>{const{replaceTerm:s}=this.options,{currentIndex:i,results:n}=this.storage,r=n[i];return r?(b(s,[r],{state:e,dispatch:t}),this.storage.results.splice(i,1)):(b(s,n,{state:e,dispatch:t}),this.storage.results.shift()),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(e,t),!1},replaceAll:()=>({state:e,tr:t,dispatch:s})=>{const{replaceTerm:i}=this.options,{results:n}=this.storage;return D(i,n,{tr:t,dispatch:s}),this.storage.currentIndex=-1,this.storage.results=[],c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(e,s),!1},goToPrevSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:s}=this.options,{currentIndex:i,results:n}=this.storage,r=(i+n.length-1)%n.length;return this.storage.currentIndex=r,c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),N({view:e,tr:t,searchResults:n,searchResultCurrentClass:s,gotoIndex:r})},goToNextSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:s}=this.options,{currentIndex:i,results:n}=this.storage,r=(i+1)%n.length;return this.storage.currentIndex=r,this.options.onChange&&this.options.onChange(),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),N({view:e,tr:t,searchResults:n,searchResultCurrentClass:s,gotoIndex:r})}}},addProseMirrorPlugins(){const e=this;return[new g.Plugin({key:new g.PluginKey("search"),state:{init(){return g.DecorationSet.empty},apply(t){const{doc:s,docChanged:i}=t,{searchTerm:n,searchResultClass:r,searchResultCurrentClass:l,disableRegex:o,caseSensitive:x}=e.options;if(i||n){const{decorationsToReturn:u,results:h}=L(s,V(n,o,x),r);if(e.storage.results=h,e.storage.currentIndex>h.length-1&&(e.storage.currentIndex=0),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),t.getMeta("directDecoration")){const{fromPos:m,toPos:C,attrs:T}=t.getMeta("directDecoration");u.push(g.Decoration.inline(m,C,T))}else h.length>0&&(u[0]=g.Decoration.inline(h[0].from,h[0].to,{class:l}));return g.DecorationSet.create(s,u)}return g.DecorationSet.empty}},props:{decorations(t){return this.getState(t)}}})]}});exports.SearchAndReplace=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-DF2Lp4HZ.cjs"),r=require("react/jsx-runtime"),f=require("react"),u=require("./RichTextEditor-CxvwGvQG.cjs"),L=require("./index-6D1J-A-o.cjs");function B({editor:e,...t}){const{t:s}=L.useLocale(),[n,i]=f.useState(!1),[a,c]=f.useState(""),[o,h]=f.useState(""),[l,g]=f.useState(!1),[d,m]=f.useState(""),R=()=>{var x,I,T,C;m(`${((I=(x=e==null?void 0:e.storage)==null?void 0:x.searchAndReplace)==null?void 0:I.resultIndex)+1}/${(C=(T=e==null?void 0:e.storage)==null?void 0:T.searchAndReplace)==null?void 0:C.results.length}`)};f.useEffect(()=>{e&&R()},[e]);const A=(x=!1)=>{e&&(x&&e.commands.resetIndex(),e.commands.setSearchTerm(a),e.commands.setReplaceTerm(o),e.commands.setCaseSensitive(l),R())},v=()=>{if(!e)return;const{results:x,resultIndex:I}=e.storage.searchAndReplace,T=x[I];if(!T)return;e.commands.setTextSelection(T);const{node:C}=e.view.domAtPos(e.state.selection.anchor);C instanceof HTMLElement&&C.scrollIntoView({behavior:"smooth",block:"center"}),R()};f.useEffect(()=>{a.trim()||j(),a.trim()&&A(!0)},[a]),f.useEffect(()=>{o.trim()&&A()},[o]),f.useEffect(()=>{A(!0)},[l]);const b=()=>{e==null||e.commands.replace(),v()},y=()=>{e==null||e.commands.nextSearchResult(),v()},P=()=>{e==null||e.commands.previousSearchResult(),v()},j=()=>{c(""),h(""),e.commands.resetIndex(),R()},k=()=>{e==null||e.commands.replaceAll(),m("0/0")};return r.jsxs(u.Popover,{onOpenChange:i,open:n,children:[r.jsx(u.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:r.jsx(u.ActionButton,{disabled:t==null?void 0:t.disabled,isActive:t==null?void 0:t.isActive,tooltip:t==null?void 0:t.tooltip,tooltipOptions:t==null?void 0:t.tooltipOptions,children:r.jsx(u.IconComponent,{name:t==null?void 0:t.icon})})}),r.jsxs(u.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[r.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[r.jsx(u.Label,{children:s("editor.search.dialog.text")}),r.jsx("span",{className:"richtext-font-semibold",children:d})]}),r.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[r.jsx(u.Input,{autoFocus:!0,className:"richtext-w-full",onChange:x=>c(x.target.value),placeholder:"Text",required:!0,type:"text",value:a}),r.jsx(u.Button,{className:"richtext-flex-1",onClick:P,children:r.jsx(u.IconComponent,{name:"ChevronUp"})}),r.jsx(u.Button,{className:"richtext-flex-1",onClick:y,children:r.jsx(u.IconComponent,{name:"ChevronDown"})}),r.jsx(u.Button,{className:"richtext-flex-1",onClick:j,children:"Clear"})]}),r.jsx(u.Label,{className:"richtext-mb-[6px]",children:s("editor.replace.dialog.text")}),r.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:r.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:r.jsx(u.Input,{className:"richtext-w-80",onChange:x=>h(x.target.value),placeholder:"Text",required:!0,type:"text",value:o})})}),r.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2",children:[r.jsx(u.Switch,{checked:l,onCheckedChange:x=>{g(x),e.commands.setCaseSensitive(x)}}),r.jsx(u.Label,{children:s("editor.replace.caseSensitive")})]}),r.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[r.jsx(u.Button,{className:"richtext-flex-1",onClick:b,children:s("editor.replace.dialog.text")}),r.jsx(u.Button,{className:"richtext-flex-1",onClick:k,children:s("editor.replaceAll.dialog.text")})]})]})]})}const S=(e,t)=>t(e.tr);function $(e,t,s){return RegExp(t?e.replace(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`):e,s?"gu":"gui")}function q(e,t,s,n){const i=[],a=[];let c=[],o=0;if(!t)return{decorationsToReturn:p.DecorationSet.empty,results:[]};e==null||e.descendants((h,l)=>{h.isText?c[o]?c[o]={text:c[o].text+h.text,pos:c[o].pos}:c[o]={text:`${h.text}`,pos:l}:o+=1}),c=c.filter(Boolean);for(const h of c){const{text:l,pos:g}=h,d=Array.from(l.matchAll(t)).filter(([m])=>m.trim());for(const m of d){if(m[0]==="")break;m.index!==void 0&&a.push({from:g+m.index,to:g+m.index+m[0].length})}}for(const[h,l]of a.entries()){const g=h===n?`${s} ${s}-current`:s,d=p.Decoration.inline(l.from,l.to,{class:g});i.push(d)}return{decorationsToReturn:p.DecorationSet.create(e,i),results:a}}function N(e,t,{state:s,dispatch:n}){if(!t[0])return;const{from:a,to:c}=t[0];n&&n(s.tr.insertText(e,a,c))}function D(e,t,s,n){const i=t+1;if(!n[i])return null;const{from:a,to:c}=n[t],o=c-a-e.length+s,{from:h,to:l}=n[i];return n[i]={to:l-o,from:h-o},[o,n]}function E(e,t,{tr:s,dispatch:n}){let i=0,a=t.slice();if(a.length!==0){for(let c=0;c<a.length;c+=1){const{from:o,to:h}=a[c];s.insertText(e,o,h);const l=D(e,c,i,a);l&&(i=l[0],a=l[1])}n(s)}}const w=new p.PluginKey("searchAndReplacePlugin"),O=p.Extension.create({name:"searchAndReplace",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),searchTerm:"",replaceTerm:"",results:[],searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!0,onChange:()=>{},button:({editor:t,t:s})=>({component:B,componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:s("editor.searchAndReplace.tooltip"),isActive:()=>!1,disabled:!1,editor:t}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:e=>({editor:t,state:s,dispatch:n})=>(t.storage.searchAndReplace.searchTerm=e,S(s,n),!1),setReplaceTerm:e=>({editor:t,state:s,dispatch:n})=>(t.storage.searchAndReplace.replaceTerm=e,S(s,n),!1),setCaseSensitive:e=>({editor:t,state:s,dispatch:n})=>(t.storage.searchAndReplace.caseSensitive=e,S(s,n),!1),resetIndex:()=>({editor:e,state:t,dispatch:s})=>(e.storage.searchAndReplace.resultIndex=0,S(t,s),!1),nextSearchResult:()=>({editor:e})=>{const{results:t,resultIndex:s}=e.storage.searchAndReplace,n=s+1;return t[n]?e.storage.searchAndReplace.resultIndex=n:e.storage.searchAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:e})=>{const{results:t,resultIndex:s}=e.storage.searchAndReplace,n=s-1;return t[n]?e.storage.searchAndReplace.resultIndex=n:e.storage.searchAndReplace.resultIndex=t.length-1,!1},replace:()=>({editor:e,state:t,dispatch:s})=>{const{replaceTerm:n,results:i,resultIndex:a}=e.storage.searchAndReplace,c=i[a];return c?(N(n,[c],{state:t,dispatch:s}),e.storage.searchAndReplace.results.splice(a,1)):(N(n,i,{state:t,dispatch:s}),e.storage.searchAndReplace.results.shift()),S(t,s),!1},replaceAll:()=>({editor:e,tr:t,state:s,dispatch:n})=>{const{replaceTerm:i,results:a}=e.storage.searchAndReplace;return E(i,a,{tr:t,dispatch:n}),e.storage.searchAndReplace.resultIndex=0,e.storage.searchAndReplace.results=[],S(s,n),!1}}},addProseMirrorPlugins(){const e=this.editor,{searchResultClass:t,disableRegex:s}=this.options,n=c=>e.storage.searchAndReplace.lastSearchTerm=c,i=c=>e.storage.searchAndReplace.lastCaseSensitive=c,a=c=>e.storage.searchAndReplace.lastResultIndex=c;return[new p.Plugin({key:w,state:{init:()=>p.DecorationSet.empty,apply({doc:c,docChanged:o},h){const{searchTerm:l,lastSearchTerm:g,caseSensitive:d,lastCaseSensitive:m,resultIndex:R,lastResultIndex:A}=e.storage.searchAndReplace;if(!o&&g===l&&m===d&&A===R)return h;if(n(l),i(d),a(R),!l)return e.storage.searchAndReplace.results=[],p.DecorationSet.empty;const{decorationsToReturn:v,results:b}=q(c,$(l,s,d),t,R);return e.storage.searchAndReplace.results=b,v}},props:{decorations(c){return this.getState(c)}}})]}});exports.SearchAndReplace=O;exports.searchAndReplacePluginKey=w;
@@ -1,95 +1,25 @@
1
- import { Editor } from '@tiptap/react';
2
1
  import { Extension } from '@tiptap/core';
2
+ import { PluginKey } from '@tiptap/pm/state';
3
+ import { Range as Range_2 } from '@tiptap/core';
3
4
 
4
- /**
5
- * Represents the ButtonView function.
6
- */
7
- declare type ButtonView<T = any> = (options: ButtonViewParams<T>) => ButtonViewReturn | ButtonViewReturn[];
5
+ export declare const SearchAndReplace: Extension<SearchAndReplaceOptions, SearchAndReplaceStorage>;
8
6
 
9
- /**
10
- * Represents the parameters for the ButtonView function.
11
- */
12
- declare interface ButtonViewParams<T = any> {
13
- /** Editor object */
14
- editor: Editor;
15
- /** Extension object */
16
- extension: Extension<T>;
17
- /** Translation function */
18
- t: (path: string) => string;
19
- }
20
-
21
- /**
22
- * Represents the return value for the ButtonView component.
23
- */
24
- declare interface ButtonViewReturn {
25
- /** Component */
26
- component: unknown;
27
- /** Component props */
28
- componentProps: ButtonViewReturnComponentProps;
29
- /** Component slots */
30
- componentSlots?: ButtonViewReturnComponentSlots;
31
- }
32
-
33
- /**
34
- * Represents the props for the ButtonView component.
35
- */
36
- declare interface ButtonViewReturnComponentProps {
37
- /** Method triggered when action is performed */
38
- action?: (value?: any) => void;
39
- /** Whether it is in the active state */
40
- isActive?: () => boolean;
41
- /** Button icon */
42
- icon?: any;
43
- /** Text displayed on hover */
44
- tooltip?: string;
45
- [x: string]: any;
46
- }
47
-
48
- /**
49
- * Represents the slots for the ButtonView component.
50
- */
51
- declare interface ButtonViewReturnComponentSlots {
52
- /** Dialog slot */
53
- dialog: () => any;
54
- [x: string]: () => any;
55
- }
56
-
57
- /**
58
- * Represents the general options for Tiptap extensions.
59
- */
60
- declare interface GeneralOptions<T> {
61
- /** Enabled divider */
62
- divider: boolean;
63
- /** Enabled spacer */
64
- spacer: boolean;
65
- /** Button view function */
66
- button: ButtonView<T>;
67
- /** Show on Toolbar */
68
- toolbar?: boolean;
69
- /** Shortcut keys override */
70
- shortcutKeys?: string[] | string[][];
71
- }
72
-
73
- declare interface Result {
74
- from: number;
75
- to: number;
7
+ export declare interface SearchAndReplaceOptions {
8
+ searchResultClass: string;
9
+ disableRegex: boolean;
76
10
  }
77
11
 
78
- export declare const SearchAndReplace: Extension<SearchOptions, SearchStorage>;
12
+ export declare const searchAndReplacePluginKey: PluginKey<any>;
79
13
 
80
- declare interface SearchOptions extends GeneralOptions<SearchOptions> {
14
+ export declare interface SearchAndReplaceStorage {
81
15
  searchTerm: string;
82
16
  replaceTerm: string;
83
- searchResultClass: string;
84
- searchResultCurrentClass: string;
17
+ results: Range_2[];
18
+ lastSearchTerm: string;
85
19
  caseSensitive: boolean;
86
- disableRegex: boolean;
87
- onChange?: () => void;
88
- }
89
-
90
- declare interface SearchStorage {
91
- results: Result[];
92
- currentIndex: number;
20
+ lastCaseSensitive: boolean;
21
+ resultIndex: number;
22
+ lastResultIndex: number;
93
23
  }
94
24
 
95
25
  export { }
@@ -135,18 +65,6 @@ declare module '@tiptap/core' {
135
65
  }
136
66
 
137
67
 
138
- declare module '@tiptap/core' {
139
- interface Commands<ReturnType> {
140
- emoji: {
141
- setEmoji: (emoji: {
142
- name: string;
143
- emoji: string;
144
- }) => ReturnType;
145
- };
146
- }
147
- }
148
-
149
-
150
68
  declare module '@tiptap/core' {
151
69
  interface Commands<ReturnType> {
152
70
  excalidraw: {
@@ -238,19 +156,15 @@ declare module '@tiptap/core' {
238
156
 
239
157
  declare module '@tiptap/core' {
240
158
  interface Commands<ReturnType> {
241
- imageGifUpload: {
242
- /**
243
- * Add an image gif
244
- */
245
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
159
+ indent: {
246
160
  /**
247
- * Update an image gif
161
+ * Set the indent attribute
248
162
  */
249
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
163
+ indent: () => ReturnType;
250
164
  /**
251
- * Set image alignment
165
+ * Set the outdent attribute
252
166
  */
253
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
167
+ outdent: () => ReturnType;
254
168
  };
255
169
  }
256
170
  }
@@ -258,15 +172,19 @@ declare module '@tiptap/core' {
258
172
 
259
173
  declare module '@tiptap/core' {
260
174
  interface Commands<ReturnType> {
261
- indent: {
175
+ imageGifUpload: {
262
176
  /**
263
- * Set the indent attribute
177
+ * Add an image gif
264
178
  */
265
- indent: () => ReturnType;
179
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
266
180
  /**
267
- * Set the outdent attribute
181
+ * Update an image gif
268
182
  */
269
- outdent: () => ReturnType;
183
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
184
+ /**
185
+ * Set image alignment
186
+ */
187
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
270
188
  };
271
189
  }
272
190
  }
@@ -320,16 +238,24 @@ declare module '@tiptap/core' {
320
238
  search: {
321
239
  setSearchTerm: (searchTerm: string) => ReturnType;
322
240
  setReplaceTerm: (replaceTerm: string) => ReturnType;
241
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
242
+ resetIndex: () => ReturnType;
243
+ nextSearchResult: () => ReturnType;
244
+ previousSearchResult: () => ReturnType;
323
245
  replace: () => ReturnType;
324
246
  replaceAll: () => ReturnType;
325
- goToPrevSearchResult: () => void;
326
- goToNextSearchResult: () => void;
327
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
328
247
  };
329
248
  }
330
249
  }
331
250
 
332
251
 
252
+ declare module '@tiptap/core' {
253
+ interface Storage {
254
+ searchAndReplace: SearchAndReplaceStorage;
255
+ }
256
+ }
257
+
258
+
333
259
  declare module '@tiptap/core' {
334
260
  interface Commands<ReturnType> {
335
261
  tableOfContents: {
@@ -1,95 +1,25 @@
1
- import { Editor } from '@tiptap/react';
2
1
  import { Extension } from '@tiptap/core';
2
+ import { PluginKey } from '@tiptap/pm/state';
3
+ import { Range as Range_2 } from '@tiptap/core';
3
4
 
4
- /**
5
- * Represents the ButtonView function.
6
- */
7
- declare type ButtonView<T = any> = (options: ButtonViewParams<T>) => ButtonViewReturn | ButtonViewReturn[];
5
+ export declare const SearchAndReplace: Extension<SearchAndReplaceOptions, SearchAndReplaceStorage>;
8
6
 
9
- /**
10
- * Represents the parameters for the ButtonView function.
11
- */
12
- declare interface ButtonViewParams<T = any> {
13
- /** Editor object */
14
- editor: Editor;
15
- /** Extension object */
16
- extension: Extension<T>;
17
- /** Translation function */
18
- t: (path: string) => string;
19
- }
20
-
21
- /**
22
- * Represents the return value for the ButtonView component.
23
- */
24
- declare interface ButtonViewReturn {
25
- /** Component */
26
- component: unknown;
27
- /** Component props */
28
- componentProps: ButtonViewReturnComponentProps;
29
- /** Component slots */
30
- componentSlots?: ButtonViewReturnComponentSlots;
31
- }
32
-
33
- /**
34
- * Represents the props for the ButtonView component.
35
- */
36
- declare interface ButtonViewReturnComponentProps {
37
- /** Method triggered when action is performed */
38
- action?: (value?: any) => void;
39
- /** Whether it is in the active state */
40
- isActive?: () => boolean;
41
- /** Button icon */
42
- icon?: any;
43
- /** Text displayed on hover */
44
- tooltip?: string;
45
- [x: string]: any;
46
- }
47
-
48
- /**
49
- * Represents the slots for the ButtonView component.
50
- */
51
- declare interface ButtonViewReturnComponentSlots {
52
- /** Dialog slot */
53
- dialog: () => any;
54
- [x: string]: () => any;
55
- }
56
-
57
- /**
58
- * Represents the general options for Tiptap extensions.
59
- */
60
- declare interface GeneralOptions<T> {
61
- /** Enabled divider */
62
- divider: boolean;
63
- /** Enabled spacer */
64
- spacer: boolean;
65
- /** Button view function */
66
- button: ButtonView<T>;
67
- /** Show on Toolbar */
68
- toolbar?: boolean;
69
- /** Shortcut keys override */
70
- shortcutKeys?: string[] | string[][];
71
- }
72
-
73
- declare interface Result {
74
- from: number;
75
- to: number;
7
+ export declare interface SearchAndReplaceOptions {
8
+ searchResultClass: string;
9
+ disableRegex: boolean;
76
10
  }
77
11
 
78
- export declare const SearchAndReplace: Extension<SearchOptions, SearchStorage>;
12
+ export declare const searchAndReplacePluginKey: PluginKey<any>;
79
13
 
80
- declare interface SearchOptions extends GeneralOptions<SearchOptions> {
14
+ export declare interface SearchAndReplaceStorage {
81
15
  searchTerm: string;
82
16
  replaceTerm: string;
83
- searchResultClass: string;
84
- searchResultCurrentClass: string;
17
+ results: Range_2[];
18
+ lastSearchTerm: string;
85
19
  caseSensitive: boolean;
86
- disableRegex: boolean;
87
- onChange?: () => void;
88
- }
89
-
90
- declare interface SearchStorage {
91
- results: Result[];
92
- currentIndex: number;
20
+ lastCaseSensitive: boolean;
21
+ resultIndex: number;
22
+ lastResultIndex: number;
93
23
  }
94
24
 
95
25
  export { }
@@ -135,18 +65,6 @@ declare module '@tiptap/core' {
135
65
  }
136
66
 
137
67
 
138
- declare module '@tiptap/core' {
139
- interface Commands<ReturnType> {
140
- emoji: {
141
- setEmoji: (emoji: {
142
- name: string;
143
- emoji: string;
144
- }) => ReturnType;
145
- };
146
- }
147
- }
148
-
149
-
150
68
  declare module '@tiptap/core' {
151
69
  interface Commands<ReturnType> {
152
70
  excalidraw: {
@@ -238,19 +156,15 @@ declare module '@tiptap/core' {
238
156
 
239
157
  declare module '@tiptap/core' {
240
158
  interface Commands<ReturnType> {
241
- imageGifUpload: {
242
- /**
243
- * Add an image gif
244
- */
245
- setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
159
+ indent: {
246
160
  /**
247
- * Update an image gif
161
+ * Set the indent attribute
248
162
  */
249
- updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
163
+ indent: () => ReturnType;
250
164
  /**
251
- * Set image alignment
165
+ * Set the outdent attribute
252
166
  */
253
- setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
167
+ outdent: () => ReturnType;
254
168
  };
255
169
  }
256
170
  }
@@ -258,15 +172,19 @@ declare module '@tiptap/core' {
258
172
 
259
173
  declare module '@tiptap/core' {
260
174
  interface Commands<ReturnType> {
261
- indent: {
175
+ imageGifUpload: {
262
176
  /**
263
- * Set the indent attribute
177
+ * Add an image gif
264
178
  */
265
- indent: () => ReturnType;
179
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
266
180
  /**
267
- * Set the outdent attribute
181
+ * Update an image gif
268
182
  */
269
- outdent: () => ReturnType;
183
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
184
+ /**
185
+ * Set image alignment
186
+ */
187
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
270
188
  };
271
189
  }
272
190
  }
@@ -320,16 +238,24 @@ declare module '@tiptap/core' {
320
238
  search: {
321
239
  setSearchTerm: (searchTerm: string) => ReturnType;
322
240
  setReplaceTerm: (replaceTerm: string) => ReturnType;
241
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
242
+ resetIndex: () => ReturnType;
243
+ nextSearchResult: () => ReturnType;
244
+ previousSearchResult: () => ReturnType;
323
245
  replace: () => ReturnType;
324
246
  replaceAll: () => ReturnType;
325
- goToPrevSearchResult: () => void;
326
- goToNextSearchResult: () => void;
327
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
328
247
  };
329
248
  }
330
249
  }
331
250
 
332
251
 
252
+ declare module '@tiptap/core' {
253
+ interface Storage {
254
+ searchAndReplace: SearchAndReplaceStorage;
255
+ }
256
+ }
257
+
258
+
333
259
  declare module '@tiptap/core' {
334
260
  interface Commands<ReturnType> {
335
261
  tableOfContents: {