reactjs-tiptap-editor 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/lib/{ActionMenuButton-BPgqKDXT.cjs → ActionMenuButton-BVaZBdL3.cjs} +1 -1
  2. package/lib/{ActionMenuButton-CMXWxvWu.js → ActionMenuButton-Cpla3oSm.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +23 -23
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +1 -1
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +1 -1
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +1 -1
  11. package/lib/Callout-JL3mm4GU.cjs +1 -0
  12. package/lib/Callout-mb31jDcR.js +340 -0
  13. package/lib/Callout.cjs +1 -1
  14. package/lib/Callout.js +8 -222
  15. package/lib/Clear.cjs +1 -1
  16. package/lib/Clear.js +1 -1
  17. package/lib/Code.cjs +1 -1
  18. package/lib/Code.js +1 -1
  19. package/lib/CodeBlock.cjs +1 -1
  20. package/lib/CodeBlock.js +1 -1
  21. package/lib/CodeView.cjs +1 -1
  22. package/lib/CodeView.js +1 -1
  23. package/lib/Color.cjs +1 -1
  24. package/lib/Color.js +2 -2
  25. package/lib/Column.cjs +1 -1
  26. package/lib/Column.js +1 -1
  27. package/lib/{Drawer-BivLAzMN.cjs → Drawer-94nAoli4.cjs} +1 -1
  28. package/lib/{Drawer-BmVmgJsc.js → Drawer-d9e69c7G.js} +18 -18
  29. package/lib/Drawer.cjs +1 -1
  30. package/lib/Drawer.js +2 -2
  31. package/lib/Emoji.cjs +1 -1
  32. package/lib/Emoji.js +8 -8
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +5 -5
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +1 -1
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +1 -1
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +3 -3
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +3 -3
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +8 -8
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +2 -2
  47. package/lib/History.cjs +1 -1
  48. package/lib/History.js +1 -1
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +1 -1
  51. package/lib/{Iframe-CAUrccA0.js → Iframe-CkUClxtI.js} +5 -5
  52. package/lib/{Iframe-hwg9FxhU.cjs → Iframe-qCivhCR5.cjs} +1 -1
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +1 -1
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +4 -4
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +35 -35
  59. package/lib/ImportWord.cjs +1 -1
  60. package/lib/ImportWord.js +12 -12
  61. package/lib/{Indent-3MoIatX1.js → Indent-BTzj50Sf.js} +1 -1
  62. package/lib/{Indent-MuSU0kXz.cjs → Indent-DtgugDpq.cjs} +1 -1
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +1 -1
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +1 -1
  67. package/lib/{Katex-xS-XZKQc.js → Katex-BuFwL_MA.js} +4 -3
  68. package/lib/Katex-RcbH2O5p.cjs +4 -0
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +1 -1
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +2 -2
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +1 -1
  75. package/lib/{LinkEditBlock-DLDY-8Ax.cjs → LinkEditBlock-CSKh_5n7.cjs} +1 -1
  76. package/lib/{LinkEditBlock-Dhvz7DCA.js → LinkEditBlock-DYOmu7jQ.js} +25 -25
  77. package/lib/Mermaid.cjs +2 -2
  78. package/lib/Mermaid.js +44 -43
  79. package/lib/MoreMark.cjs +1 -1
  80. package/lib/MoreMark.js +4 -4
  81. package/lib/OrderedList.cjs +1 -1
  82. package/lib/OrderedList.js +1 -1
  83. package/lib/SearchAndReplace.cjs +1 -1
  84. package/lib/SearchAndReplace.js +7 -7
  85. package/lib/SlashCommand.cjs +1 -1
  86. package/lib/SlashCommand.js +2 -2
  87. package/lib/{SlashCommandNodeView-RnDRm4Z1.js → SlashCommandNodeView-CT_-28t6.js} +6 -6
  88. package/lib/{SlashCommandNodeView-CavaOSwo.cjs → SlashCommandNodeView-CYdYVjeb.cjs} +1 -1
  89. package/lib/Strike.cjs +1 -1
  90. package/lib/Strike.js +1 -1
  91. package/lib/{Table-DN4TuDz1.js → Table-CEHV8gmO.js} +2 -2
  92. package/lib/{Table-m32ZhtxF.cjs → Table-DOl6C6To.cjs} +1 -1
  93. package/lib/Table.cjs +1 -1
  94. package/lib/Table.js +1 -1
  95. package/lib/TaskList.cjs +1 -1
  96. package/lib/TaskList.js +1 -1
  97. package/lib/TextAlign.cjs +1 -1
  98. package/lib/TextAlign.js +2 -2
  99. package/lib/TextDirection.cjs +1 -1
  100. package/lib/TextDirection.js +2 -2
  101. package/lib/TextUnderline.cjs +1 -1
  102. package/lib/TextUnderline.js +1 -1
  103. package/lib/{Twitter-CJhQLKYS.cjs → Twitter-DDuJwWdF.cjs} +1 -1
  104. package/lib/{Twitter-B2FDarxE.js → Twitter-DxqKzo3U.js} +7 -7
  105. package/lib/Twitter.cjs +1 -1
  106. package/lib/Twitter.js +1 -1
  107. package/lib/Video.cjs +1 -1
  108. package/lib/Video.js +3 -3
  109. package/lib/bubble.cjs +6 -6
  110. package/lib/bubble.js +667 -640
  111. package/lib/{dropdown-menu-CWd8VVRO.js → dropdown-menu-BYbds8yQ.js} +1 -1
  112. package/lib/{dropdown-menu-C0VlKIZC.cjs → dropdown-menu-CoZZaqv5.cjs} +1 -1
  113. package/lib/{index-B2a7NqnN.js → index-B1SzsIsE.js} +1020 -1149
  114. package/lib/index-DirFiHQ6.cjs +1 -0
  115. package/lib/index.cjs +1 -1
  116. package/lib/index.js +12 -12
  117. package/lib/{popover-UUKfPWue.cjs → popover-BaAurWOZ.cjs} +1 -1
  118. package/lib/{popover-BrSDMb_n.js → popover-CK54Ip2N.js} +1 -1
  119. package/lib/{separator-LH5EzF0T.cjs → separator-ByK1SKWn.cjs} +1 -1
  120. package/lib/{separator-fpWkZkoh.js → separator-XZA3-egy.js} +14 -14
  121. package/lib/style.css +1 -1
  122. package/lib/textarea--IMIy9VF.js +20 -0
  123. package/lib/textarea-mwHtiXJV.cjs +1 -0
  124. package/package.json +1 -1
  125. package/lib/Katex-BPQ7_A3w.cjs +0 -4
  126. package/lib/index-czmcFIW7.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";const h=require("./index-C4WLt4NA.cjs"),w=require("./clsx-DSAWW32g.cjs"),s=require("react/jsx-runtime"),S=require("re-resizable"),v=require("react"),u=require("./index-czmcFIW7.cjs"),f=require("./dom-dataset-BqoJhJXt.cjs");require("./theme.cjs");const m={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function I(e){const t=m.youtube,i=e.matchedUrl;e.validLink=!0;const r=i.split("="),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}/${c}`,e.validId=!0}return e}function R(e){const t=m.youku,i=e.matchedUrl,r=t.idRule,n=new RegExp(r),c=i.match(n);if(c&&c.length>0){const o=c[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${o}`}else e.validId=!1;return e}function P(e){const t=m.bilibili,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function j(e){const t=m.qqvideo,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function M(e,t){return t.src=e,t.validId=!0,t}function N(e,t){return t.src=e,t.validId=!0,t}function q(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function U(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function A(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function D(e){const t=m.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function L(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function _(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function $(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function T(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function z(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Y(e,t,i){if(e==="googlemaps")return i.validLink=!0,i.matchedUrl=t,i;const n=m[e].linkRule;for(const c of n){const o=new RegExp(c),a=t.match(o);if(a&&a.length>0)return i.validLink=!0,i.matchedUrl=e==="youtube"?a[1]:a[0],i}return i}function C(e){var i,r;let t="iframe";return((i=e.includes)!=null&&i.call(e,"youtube")||(r=e.includes)!=null&&r.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function k(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const i=C(e);if(t=Y(i,e,t),!t.validLink)return t;switch(i){case"youtube":return I(t);case"youku":return R(t);case"bilibili":return P(t);case"qqvideo":return j(t);case"amap":return M(e,t);case"baidu_map":return N(e,t);case"googlemaps":return q(e,t);case"modao":return U(t);case"lanhu":return A(t);case"figma":return D(t);case"canva":return L(e,t);case"processon":return _(e,t);case"codepen":return $(t);case"jinshuju":return T(e,t);case"iframe":return z(e,t);default:return e}}const E="_wrap_5y04w_1",H="_innerWrap_5y04w_15",x={wrap:E,innerWrap:H};function B({editor:e,node:t,updateAttributes:i}){const r=u.useEditableEditor(),{src:n,width:c,height:o}=t.attrs,[a,p]=v.useState("");function l(){if(!a)return;const d=k(a);e.chain().updateAttributes(b.name,{src:(d==null?void 0:d.src)||a}).setNodeSelection(e.state.selection.from).focus().run()}const y=v.useCallback(d=>{i({width:d.width,height:d.height})},[i]);return s.jsxs(w.NodeViewWrapper,{children:[!n&&s.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-border richtext-p-[10px]",children:[s.jsx(u.Input,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>p(d.target.value),placeholder:"Enter link",type:"url",value:a}),s.jsx(u.Button,{className:"richtext-w-[60px]",onClick:l,children:"OK"})]}),n&&s.jsx(S.Resizable,{size:{width:Number.parseInt(c),height:Number.parseInt(o)},onResizeStop:(d,K,O,g)=>{y({width:Number.parseInt(c)+g.width,height:Number.parseInt(o)+g.height})},children:s.jsx("div",{className:w.clsx(x.wrap,"render-wrapper"),children:s.jsx("div",{className:x.innerWrap,style:{pointerEvents:r?"none":"auto"},children:s.jsx("iframe",{className:"richtext-my-[12px]",src:n})})})})]})}function V(){const e=u.useButtonProps(b.name),{icon:t=void 0,tooltip:i=void 0,shortcutKeys:r=void 0,tooltipOptions:n={},action:c=void 0,isActive:o=void 0}=(e==null?void 0:e.componentProps)??{},{editorDisabled:a,update:p}=u.useToggleActive(o),l=()=>{a||c&&(c(),p())};return e?s.jsx(u.ActionButton,{action:l,disabled:a,icon:t,shortcutKeys:r,tooltip:i,tooltipOptions:n}):s.jsx(s.Fragment,{})}const b=h.Node3.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:i,t:r})=>({componentProps:{action:n=>t.commands.setIframe(n),upload:i.options.upload,icon:"Iframe",tooltip:r("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:f.getDatasetAttribute("width")},height:{default:300,parseHTML:f.getDatasetAttribute("height")},src:{default:null,parseHTML:f.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",h.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:i,chain:r})=>{var c,o,a;if(((a=(o=(c=t.selection)==null?void 0:c.node)==null?void 0:o.type)==null?void 0:a.name)==this.name)return i.updateAttributes(this.name,e);const n=e||{url:""};return r().insertContent({type:this.name,attrs:n}).run()}}},addInputRules(){return[h.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return w.ReactNodeViewRenderer(B)}});exports.Iframe=b;exports.RichTextIframe=V;exports.getServiceSrc=k;
1
+ "use strict";const h=require("./index-C4WLt4NA.cjs"),w=require("./clsx-DSAWW32g.cjs"),s=require("react/jsx-runtime"),S=require("re-resizable"),v=require("react"),f=require("./dom-dataset-BqoJhJXt.cjs"),u=require("./index-DirFiHQ6.cjs");require("./theme.cjs");const m={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function I(e){const t=m.youtube,i=e.matchedUrl;e.validLink=!0;const r=i.split("="),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}/${c}`,e.validId=!0}return e}function R(e){const t=m.youku,i=e.matchedUrl,r=t.idRule,n=new RegExp(r),c=i.match(n);if(c&&c.length>0){const o=c[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${o}`}else e.validId=!1;return e}function P(e){const t=m.bilibili,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function j(e){const t=m.qqvideo,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function M(e,t){return t.src=e,t.validId=!0,t}function N(e,t){return t.src=e,t.validId=!0,t}function q(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function U(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function A(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function D(e){const t=m.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function L(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function _(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function $(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function T(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function z(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Y(e,t,i){if(e==="googlemaps")return i.validLink=!0,i.matchedUrl=t,i;const n=m[e].linkRule;for(const c of n){const o=new RegExp(c),a=t.match(o);if(a&&a.length>0)return i.validLink=!0,i.matchedUrl=e==="youtube"?a[1]:a[0],i}return i}function C(e){var i,r;let t="iframe";return((i=e.includes)!=null&&i.call(e,"youtube")||(r=e.includes)!=null&&r.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function k(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const i=C(e);if(t=Y(i,e,t),!t.validLink)return t;switch(i){case"youtube":return I(t);case"youku":return R(t);case"bilibili":return P(t);case"qqvideo":return j(t);case"amap":return M(e,t);case"baidu_map":return N(e,t);case"googlemaps":return q(e,t);case"modao":return U(t);case"lanhu":return A(t);case"figma":return D(t);case"canva":return L(e,t);case"processon":return _(e,t);case"codepen":return $(t);case"jinshuju":return T(e,t);case"iframe":return z(e,t);default:return e}}const E="_wrap_5y04w_1",H="_innerWrap_5y04w_15",x={wrap:E,innerWrap:H};function B({editor:e,node:t,updateAttributes:i}){const r=u.useEditableEditor(),{src:n,width:c,height:o}=t.attrs,[a,p]=v.useState("");function l(){if(!a)return;const d=k(a);e.chain().updateAttributes(b.name,{src:(d==null?void 0:d.src)||a}).setNodeSelection(e.state.selection.from).focus().run()}const y=v.useCallback(d=>{i({width:d.width,height:d.height})},[i]);return s.jsxs(w.NodeViewWrapper,{children:[!n&&s.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-border richtext-p-[10px]",children:[s.jsx(u.Input,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>p(d.target.value),placeholder:"Enter link",type:"url",value:a}),s.jsx(u.Button,{className:"richtext-w-[60px]",onClick:l,children:"OK"})]}),n&&s.jsx(S.Resizable,{size:{width:Number.parseInt(c),height:Number.parseInt(o)},onResizeStop:(d,K,O,g)=>{y({width:Number.parseInt(c)+g.width,height:Number.parseInt(o)+g.height})},children:s.jsx("div",{className:w.clsx(x.wrap,"render-wrapper"),children:s.jsx("div",{className:x.innerWrap,style:{pointerEvents:r?"none":"auto"},children:s.jsx("iframe",{className:"richtext-my-[12px]",src:n})})})})]})}function V(){const e=u.useButtonProps(b.name),{icon:t=void 0,tooltip:i=void 0,shortcutKeys:r=void 0,tooltipOptions:n={},action:c=void 0,isActive:o=void 0}=(e==null?void 0:e.componentProps)??{},{editorDisabled:a,update:p}=u.useToggleActive(o),l=()=>{a||c&&(c(),p())};return e?s.jsx(u.ActionButton,{action:l,disabled:a,icon:t,shortcutKeys:r,tooltip:i,tooltipOptions:n}):s.jsx(s.Fragment,{})}const b=h.Node3.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:i,t:r})=>({componentProps:{action:n=>t.commands.setIframe(n),upload:i.options.upload,icon:"Iframe",tooltip:r("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:f.getDatasetAttribute("width")},height:{default:300,parseHTML:f.getDatasetAttribute("height")},src:{default:null,parseHTML:f.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",h.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:i,chain:r})=>{var c,o,a;if(((a=(o=(c=t.selection)==null?void 0:c.node)==null?void 0:o.type)==null?void 0:a.name)==this.name)return i.updateAttributes(this.name,e);const n=e||{url:""};return r().insertContent({type:this.name,attrs:n}).run()}}},addInputRules(){return[h.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return w.ReactNodeViewRenderer(B)}});exports.Iframe=b;exports.RichTextIframe=V;exports.getServiceSrc=k;
package/lib/Iframe.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");require("./clsx-DSAWW32g.cjs");const e=require("./Iframe-hwg9FxhU.cjs");require("./dom-dataset-BqoJhJXt.cjs");exports.Iframe=e.Iframe;exports.RichTextIframe=e.RichTextIframe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");require("./clsx-DSAWW32g.cjs");const e=require("./Iframe-qCivhCR5.cjs");require("./dom-dataset-BqoJhJXt.cjs");exports.Iframe=e.Iframe;exports.RichTextIframe=e.RichTextIframe;
package/lib/Iframe.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./index-D0EmqTpe.js";
2
2
  import "./clsx-Bg-2aTKh.js";
3
- import { I as e, R as i } from "./Iframe-CAUrccA0.js";
3
+ import { I as e, R as i } from "./Iframe-CkUClxtI.js";
4
4
  import "./dom-dataset-CIEeltF6.js";
5
5
  export {
6
6
  e as Iframe,
package/lib/Image.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");const e=require("./index-czmcFIW7.cjs");require("./clsx-DSAWW32g.cjs");exports.DEFAULT_OPTIONS=e.DEFAULT_OPTIONS;exports.Image=e.Image;exports.RichTextImage=e.RichTextImage;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");const e=require("./index-DirFiHQ6.cjs");require("./clsx-DSAWW32g.cjs");exports.DEFAULT_OPTIONS=e.DEFAULT_OPTIONS;exports.Image=e.Image;exports.RichTextImage=e.RichTextImage;
package/lib/Image.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "./index-D0EmqTpe.js";
2
- import { a4 as r, y as t, a5 as i } from "./index-B2a7NqnN.js";
2
+ import { _ as p, p as r, $ as t } from "./index-B1SzsIsE.js";
3
3
  import "./clsx-Bg-2aTKh.js";
4
4
  export {
5
- r as DEFAULT_OPTIONS,
6
- t as Image,
7
- i as RichTextImage
5
+ p as DEFAULT_OPTIONS,
6
+ r as Image,
7
+ t as RichTextImage
8
8
  };
package/lib/ImageGif.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-C4WLt4NA.cjs"),f=require("./index-czmcFIW7.cjs"),z=require("./clsx-DSAWW32g.cjs"),l=require("react/jsx-runtime"),u=require("react"),j=require("./index-BqL4vAWE.cjs");require("./theme.cjs");const L=require("./popover-UUKfPWue.cjs"),N={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function W(e){var P,k;const[t,r]=u.useState({width:j.IMAGE_MAX_SIZE,height:j.IMAGE_MAX_SIZE}),[o,i]=u.useState({width:0,height:0}),[n]=u.useState([N.TOP_LEFT,N.TOP_RIGHT,N.BOTTOM_LEFT,N.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,b]=u.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=(P=e==null?void 0:e.node)==null?void 0:P.attrs,m=u.useMemo(()=>{var x;const{src:c,alt:w,width:v,height:A}=(x=e==null?void 0:e.node)==null?void 0:x.attrs,G=f.isNumber(v)?`${v}px`:v,d=f.isNumber(A)?`${A}px`:A;return{src:c||void 0,alt:w||void 0,style:{width:G||void 0,height:d||void 0}}},[(k=e==null?void 0:e.node)==null?void 0:k.attrs]),_=u.useMemo(()=>{const{style:{width:c}}=m;return{width:c==="100%"?c:void 0}},[m]);function g(c){i({width:c.target.width,height:c.target.height})}function I(){const{editor:c,getPos:w}=e;c.commands.setNodeSelection(w())}const M=u.useCallback(f.throttle(()=>{const{editor:c}=e,{width:w}=getComputedStyle(c.view.dom);r(v=>({...v,width:Number.parseInt(w,10)}))},j.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function q(c,w){c.preventDefault(),c.stopPropagation();const v=o.width,A=o.height,G=v/A;let d=Number(e.node.attrs.width),x=Number(e.node.attrs.height);const y=t.width;d&&!x?(d=d>y?y:d,x=Math.round(d/G)):x&&!d?(d=Math.round(x*G),d=d>y?y:d):!d&&!x?(d=v>y?y:v,x=Math.round(d/G)):d=d>y?y:d,a(!0),b({x:c.clientX,y:c.clientY,w:d,h:x,dir:w})}const E=u.useCallback(f.throttle(c=>{if(c.preventDefault(),c.stopPropagation(),!s)return;const{x:w,w:v,dir:A}=h,G=(c.clientX-w)*(/l/.test(A)?-1:1),d=f.clamp$1(v+G,j.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},j.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),S=u.useCallback(c=>{c.preventDefault(),c.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),I())},[s,I]),$=u.useCallback(()=>{document==null||document.addEventListener("mousemove",E,!0),document==null||document.addEventListener("mouseup",S,!0)},[E,S]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",E,!0),document==null||document.removeEventListener("mouseup",S,!0)},[E,S]);u.useEffect(()=>(s?$():O(),()=>{O()}),[s,$,O]);const R=u.useMemo(()=>new ResizeObserver(()=>M()),[M]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx(z.NodeViewWrapper,{className:"image-view",style:{..._,width:"100%",textAlign:T},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:_,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:I,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:n==null?void 0:n.map(c=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${c}`,onMouseDown:w=>q(w,c)},`image-dir-${c}`))})]})})}async function p(e){var o;const r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(o=r==null?void 0:r.data)==null?void 0:o.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function D(e,t){var i;const o=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=o==null?void 0:o.data)==null?void 0:i.map(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function F(e){var n,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(n=r==null?void 0:r.results)==null?void 0:n[0]}&limit=15`)).json();return(s=i==null?void 0:i.results)==null?void 0:s.map(a=>{var h,b,T,m,_,g,I,M;return{id:a==null?void 0:a.id,src:(b=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:b.url,width:(_=(m=(T=a==null?void 0:a.media_formats)==null?void 0:T.gif)==null?void 0:m.dims)==null?void 0:_[0],height:(M=(I=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:I.dims)==null?void 0:M[1]}})}async function B(e,t){var i;const o=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=o==null?void 0:o.results)==null?void 0:i.map(n=>{var s,a,h,b,T,m,_,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(T=(b=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:T[0],height:(g=(_=(m=n==null?void 0:n.media_formats)==null?void 0:m.gif)==null?void 0:_.dims)==null?void 0:g[1]}})}function V(e,t){return{searchTrending:async()=>t?e==="giphy"?p(t):e==="tenor"?F(t):[]:[],searchWord:async i=>t?e==="giphy"?D(i,t):e==="tenor"?B(i,t):[]:[]}}function X({selectImage:e,apiKey:t,provider:r,children:o}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=f.useToggleActive(),b=u.useRef(null),{searchTrending:T,searchWord:m}=V(r,t);u.useEffect(()=>{(async()=>{const g=await T();a(g)})()},[]);const _=u.useCallback(f.debounce(async g=>{if(!g.target.value){const M=await T();a(M);return}const I=await m(g.target.value);a(I)},350),[]);return l.jsxs(L.Popover,{modal:!0,onOpenChange:n,open:i,children:[l.jsx(L.PopoverTrigger,{asChild:!0,disabled:h,children:o}),l.jsx(L.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(f.Input,{onChange:_,placeholder:"Search GIF",ref:b,type:"text"})}),l.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:l.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1",children:s!=null&&s.length?s==null?void 0:s.map(g=>l.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",src:g.src,onClick:()=>{e(g.src),n(!1)}},g.id)):l.jsx("p",{children:"No GIFs found"})})})]}):l.jsx("div",{children:l.jsx("p",{children:"Missing Giphy API Key"})})})]})}function Y(){const e=f.useButtonProps(C.name),{action:t,icon:r,tooltip:o,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=f.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(X,{apiKey:i,provider:n,selectImage:a,children:l.jsx(f.ActionButton,{disabled:s,icon:r,tooltip:o})})}const C=f.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:o})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:o("editor.imageGif.tooltip"),apiKey:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return z.ReactNodeViewRenderer(W)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",H.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=C;exports.RichTextImageGif=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-C4WLt4NA.cjs"),f=require("./index-DirFiHQ6.cjs"),z=require("./clsx-DSAWW32g.cjs"),l=require("react/jsx-runtime"),u=require("react"),j=require("./index-BqL4vAWE.cjs");require("./theme.cjs");const L=require("./popover-BaAurWOZ.cjs"),N={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function W(e){var P,k;const[t,r]=u.useState({width:j.IMAGE_MAX_SIZE,height:j.IMAGE_MAX_SIZE}),[o,i]=u.useState({width:0,height:0}),[n]=u.useState([N.TOP_LEFT,N.TOP_RIGHT,N.BOTTOM_LEFT,N.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,b]=u.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=(P=e==null?void 0:e.node)==null?void 0:P.attrs,m=u.useMemo(()=>{var x;const{src:c,alt:w,width:v,height:A}=(x=e==null?void 0:e.node)==null?void 0:x.attrs,G=f.isNumber(v)?`${v}px`:v,d=f.isNumber(A)?`${A}px`:A;return{src:c||void 0,alt:w||void 0,style:{width:G||void 0,height:d||void 0}}},[(k=e==null?void 0:e.node)==null?void 0:k.attrs]),_=u.useMemo(()=>{const{style:{width:c}}=m;return{width:c==="100%"?c:void 0}},[m]);function g(c){i({width:c.target.width,height:c.target.height})}function I(){const{editor:c,getPos:w}=e;c.commands.setNodeSelection(w())}const M=u.useCallback(f.throttle(()=>{const{editor:c}=e,{width:w}=getComputedStyle(c.view.dom);r(v=>({...v,width:Number.parseInt(w,10)}))},j.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function q(c,w){c.preventDefault(),c.stopPropagation();const v=o.width,A=o.height,G=v/A;let d=Number(e.node.attrs.width),x=Number(e.node.attrs.height);const y=t.width;d&&!x?(d=d>y?y:d,x=Math.round(d/G)):x&&!d?(d=Math.round(x*G),d=d>y?y:d):!d&&!x?(d=v>y?y:v,x=Math.round(d/G)):d=d>y?y:d,a(!0),b({x:c.clientX,y:c.clientY,w:d,h:x,dir:w})}const E=u.useCallback(f.throttle(c=>{if(c.preventDefault(),c.stopPropagation(),!s)return;const{x:w,w:v,dir:A}=h,G=(c.clientX-w)*(/l/.test(A)?-1:1),d=f.clamp$1(v+G,j.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},j.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),S=u.useCallback(c=>{c.preventDefault(),c.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),I())},[s,I]),$=u.useCallback(()=>{document==null||document.addEventListener("mousemove",E,!0),document==null||document.addEventListener("mouseup",S,!0)},[E,S]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",E,!0),document==null||document.removeEventListener("mouseup",S,!0)},[E,S]);u.useEffect(()=>(s?$():O(),()=>{O()}),[s,$,O]);const R=u.useMemo(()=>new ResizeObserver(()=>M()),[M]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx(z.NodeViewWrapper,{className:"image-view",style:{..._,width:"100%",textAlign:T},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:_,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:I,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:n==null?void 0:n.map(c=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${c}`,onMouseDown:w=>q(w,c)},`image-dir-${c}`))})]})})}async function p(e){var o;const r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(o=r==null?void 0:r.data)==null?void 0:o.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function D(e,t){var i;const o=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=o==null?void 0:o.data)==null?void 0:i.map(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function F(e){var n,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(n=r==null?void 0:r.results)==null?void 0:n[0]}&limit=15`)).json();return(s=i==null?void 0:i.results)==null?void 0:s.map(a=>{var h,b,T,m,_,g,I,M;return{id:a==null?void 0:a.id,src:(b=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:b.url,width:(_=(m=(T=a==null?void 0:a.media_formats)==null?void 0:T.gif)==null?void 0:m.dims)==null?void 0:_[0],height:(M=(I=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:I.dims)==null?void 0:M[1]}})}async function B(e,t){var i;const o=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=o==null?void 0:o.results)==null?void 0:i.map(n=>{var s,a,h,b,T,m,_,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(T=(b=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:T[0],height:(g=(_=(m=n==null?void 0:n.media_formats)==null?void 0:m.gif)==null?void 0:_.dims)==null?void 0:g[1]}})}function V(e,t){return{searchTrending:async()=>t?e==="giphy"?p(t):e==="tenor"?F(t):[]:[],searchWord:async i=>t?e==="giphy"?D(i,t):e==="tenor"?B(i,t):[]:[]}}function X({selectImage:e,apiKey:t,provider:r,children:o}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=f.useToggleActive(),b=u.useRef(null),{searchTrending:T,searchWord:m}=V(r,t);u.useEffect(()=>{(async()=>{const g=await T();a(g)})()},[]);const _=u.useCallback(f.debounce(async g=>{if(!g.target.value){const M=await T();a(M);return}const I=await m(g.target.value);a(I)},350),[]);return l.jsxs(L.Popover,{modal:!0,onOpenChange:n,open:i,children:[l.jsx(L.PopoverTrigger,{asChild:!0,disabled:h,children:o}),l.jsx(L.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(f.Input,{onChange:_,placeholder:"Search GIF",ref:b,type:"text"})}),l.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:l.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1",children:s!=null&&s.length?s==null?void 0:s.map(g=>l.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",src:g.src,onClick:()=>{e(g.src),n(!1)}},g.id)):l.jsx("p",{children:"No GIFs found"})})})]}):l.jsx("div",{children:l.jsx("p",{children:"Missing Giphy API Key"})})})]})}function Y(){const e=f.useButtonProps(C.name),{action:t,icon:r,tooltip:o,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=f.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(X,{apiKey:i,provider:n,selectImage:a,children:l.jsx(f.ActionButton,{disabled:s,icon:r,tooltip:o})})}const C=f.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:o})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:o("editor.imageGif.tooltip"),apiKey:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return z.ReactNodeViewRenderer(W)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",H.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=C;exports.RichTextImageGif=Y;
package/lib/ImageGif.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { m as B } from "./index-D0EmqTpe.js";
2
- import { O as k, z as C, P as q, u as V, d as D, A as X, Q as Y, j as Z, H as Q } from "./index-B2a7NqnN.js";
3
- import { N as U, a as J } from "./clsx-Bg-2aTKh.js";
4
- import { jsx as u, jsxs as L, Fragment as K } from "react/jsx-runtime";
5
- import { useState as G, useMemo as z, useCallback as M, useEffect as $, useRef as ee } from "react";
2
+ import { H as k, t as C, J as q, u as V, d as D, A as X, K as Y, j as Z, y as J } from "./index-B1SzsIsE.js";
3
+ import { N as U, a as Q } from "./clsx-Bg-2aTKh.js";
4
+ import { jsx as u, jsxs as z, Fragment as K } from "react/jsx-runtime";
5
+ import { useState as G, useMemo as P, useCallback as M, useEffect as $, useRef as ee } from "react";
6
6
  import { I as j, i as W, j as te } from "./index-BlXGgvT-.js";
7
7
  import "./theme.js";
8
- import { P as ne, a as re, b as ie } from "./popover-BrSDMb_n.js";
8
+ import { P as ne, a as re, b as ie } from "./popover-CK54Ip2N.js";
9
9
  const O = {
10
10
  TOP_LEFT: "tl",
11
11
  TOP_RIGHT: "tr",
@@ -31,7 +31,7 @@ function ae(e) {
31
31
  w: 0,
32
32
  h: 0,
33
33
  dir: ""
34
- }), { align: b } = (p = e == null ? void 0 : e.node) == null ? void 0 : p.attrs, g = z(() => {
34
+ }), { align: b } = (p = e == null ? void 0 : e.node) == null ? void 0 : p.attrs, g = P(() => {
35
35
  var w;
36
36
  const { src: o, alt: m, width: f, height: x } = (w = e == null ? void 0 : e.node) == null ? void 0 : w.attrs, A = k(f) ? `${f}px` : f, d = k(x) ? `${x}px` : x;
37
37
  return {
@@ -42,7 +42,7 @@ function ae(e) {
42
42
  height: d || void 0
43
43
  }
44
44
  };
45
- }, [(H = e == null ? void 0 : e.node) == null ? void 0 : H.attrs]), _ = z(() => {
45
+ }, [(H = e == null ? void 0 : e.node) == null ? void 0 : H.attrs]), y = P(() => {
46
46
  const {
47
47
  style: { width: o }
48
48
  } = g;
@@ -54,7 +54,7 @@ function ae(e) {
54
54
  height: o.target.height
55
55
  });
56
56
  }
57
- function y() {
57
+ function _() {
58
58
  const { editor: o, getPos: m } = e;
59
59
  o.commands.setNodeSelection(m());
60
60
  }
@@ -100,31 +100,31 @@ function ae(e) {
100
100
  w: 0,
101
101
  h: 0,
102
102
  dir: ""
103
- }), s(!1), y());
103
+ }), s(!1), _());
104
104
  },
105
- [a, y]
105
+ [a, _]
106
106
  ), R = M(() => {
107
107
  document == null || document.addEventListener("mousemove", N, !0), document == null || document.addEventListener("mouseup", E, !0);
108
- }, [N, E]), P = M(() => {
108
+ }, [N, E]), S = M(() => {
109
109
  document == null || document.removeEventListener("mousemove", N, !0), document == null || document.removeEventListener("mouseup", E, !0);
110
110
  }, [N, E]);
111
- $(() => (a ? R() : P(), () => {
112
- P();
113
- }), [a, R, P]);
114
- const S = z(() => new ResizeObserver(() => I()), [I]);
115
- return $(() => (S.observe(e.editor.view.dom), () => {
116
- S.disconnect();
117
- }), [e.editor.view.dom, S]), /* @__PURE__ */ u(
111
+ $(() => (a ? R() : S(), () => {
112
+ S();
113
+ }), [a, R, S]);
114
+ const L = P(() => new ResizeObserver(() => I()), [I]);
115
+ return $(() => (L.observe(e.editor.view.dom), () => {
116
+ L.disconnect();
117
+ }), [e.editor.view.dom, L]), /* @__PURE__ */ u(
118
118
  U,
119
119
  {
120
120
  className: "image-view",
121
- style: { ..._, width: "100%", textAlign: b },
122
- children: /* @__PURE__ */ L(
121
+ style: { ...y, width: "100%", textAlign: b },
122
+ children: /* @__PURE__ */ z(
123
123
  "div",
124
124
  {
125
125
  "data-drag-handle": !0,
126
126
  draggable: "true",
127
- style: _,
127
+ style: y,
128
128
  className: `image-view__body ${e != null && e.selected ? "image-view__body--focused" : ""} ${a ? "image-view__body--resizing" : ""}`,
129
129
  children: [
130
130
  /* @__PURE__ */ u(
@@ -133,7 +133,7 @@ function ae(e) {
133
133
  alt: g.alt,
134
134
  className: "image-view__body__image block",
135
135
  height: "auto",
136
- onClick: y,
136
+ onClick: _,
137
137
  onLoad: h,
138
138
  src: g.src,
139
139
  style: g.style
@@ -189,12 +189,12 @@ async function ce(e) {
189
189
  `https://tenor.googleapis.com/v2/search?key=${e}&q=${(n = r == null ? void 0 : r.results) == null ? void 0 : n[0]}&limit=15`
190
190
  )).json();
191
191
  return (a = i == null ? void 0 : i.results) == null ? void 0 : a.map((s) => {
192
- var l, v, b, g, _, h, y, I;
192
+ var l, v, b, g, y, h, _, I;
193
193
  return {
194
194
  id: s == null ? void 0 : s.id,
195
195
  src: (v = (l = s == null ? void 0 : s.media_formats) == null ? void 0 : l.gif) == null ? void 0 : v.url,
196
- width: (_ = (g = (b = s == null ? void 0 : s.media_formats) == null ? void 0 : b.gif) == null ? void 0 : g.dims) == null ? void 0 : _[0],
197
- height: (I = (y = (h = s == null ? void 0 : s.media_formats) == null ? void 0 : h.gif) == null ? void 0 : y.dims) == null ? void 0 : I[1]
196
+ width: (y = (g = (b = s == null ? void 0 : s.media_formats) == null ? void 0 : b.gif) == null ? void 0 : g.dims) == null ? void 0 : y[0],
197
+ height: (I = (_ = (h = s == null ? void 0 : s.media_formats) == null ? void 0 : h.gif) == null ? void 0 : _.dims) == null ? void 0 : I[1]
198
198
  };
199
199
  });
200
200
  }
@@ -204,12 +204,12 @@ async function de(e, t) {
204
204
  `https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`
205
205
  )).json();
206
206
  return (i = c == null ? void 0 : c.results) == null ? void 0 : i.map((n) => {
207
- var a, s, l, v, b, g, _, h;
207
+ var a, s, l, v, b, g, y, h;
208
208
  return {
209
209
  id: n == null ? void 0 : n.id,
210
210
  src: (s = (a = n == null ? void 0 : n.media_formats) == null ? void 0 : a.gif) == null ? void 0 : s.url,
211
211
  width: (b = (v = (l = n == null ? void 0 : n.media_formats) == null ? void 0 : l.gif) == null ? void 0 : v.dims) == null ? void 0 : b[0],
212
- height: (h = (_ = (g = n == null ? void 0 : n.media_formats) == null ? void 0 : g.gif) == null ? void 0 : _.dims) == null ? void 0 : h[1]
212
+ height: (h = (y = (g = n == null ? void 0 : n.media_formats) == null ? void 0 : g.gif) == null ? void 0 : y.dims) == null ? void 0 : h[1]
213
213
  };
214
214
  });
215
215
  }
@@ -227,20 +227,20 @@ function he({ selectImage: e, apiKey: t, provider: r, children: c }) {
227
227
  s(h);
228
228
  })();
229
229
  }, []);
230
- const _ = M(
230
+ const y = M(
231
231
  Y(async (h) => {
232
232
  if (!h.target.value) {
233
233
  const I = await b();
234
234
  s(I);
235
235
  return;
236
236
  }
237
- const y = await g(h.target.value);
238
- s(y);
237
+ const _ = await g(h.target.value);
238
+ s(_);
239
239
  }, 350),
240
240
  // Adjust the debounce delay as needed
241
241
  []
242
242
  );
243
- return /* @__PURE__ */ L(ne, { modal: !0, onOpenChange: n, open: i, children: [
243
+ return /* @__PURE__ */ z(ne, { modal: !0, onOpenChange: n, open: i, children: [
244
244
  /* @__PURE__ */ u(re, { asChild: !0, disabled: l, children: c }),
245
245
  /* @__PURE__ */ u(
246
246
  ie,
@@ -249,11 +249,11 @@ function he({ selectImage: e, apiKey: t, provider: r, children: c }) {
249
249
  className: "richtext-size-full richtext-p-2",
250
250
  hideWhenDetached: !0,
251
251
  side: "bottom",
252
- children: t ? /* @__PURE__ */ L(K, { children: [
252
+ children: t ? /* @__PURE__ */ z(K, { children: [
253
253
  /* @__PURE__ */ u("div", { className: "richtext-mb-[10px] richtext-w-full", children: /* @__PURE__ */ u(
254
254
  Z,
255
255
  {
256
- onChange: _,
256
+ onChange: y,
257
257
  placeholder: "Search GIF",
258
258
  ref: v,
259
259
  type: "text"
@@ -282,7 +282,7 @@ function Te() {
282
282
  a || t && t(l);
283
283
  }, children: /* @__PURE__ */ u(X, { disabled: a, icon: r, tooltip: c }) });
284
284
  }
285
- const ue = /* @__PURE__ */ Q.extend({
285
+ const ue = /* @__PURE__ */ J.extend({
286
286
  name: "imageGif",
287
287
  //@ts-expect-error
288
288
  addOptions() {
@@ -341,7 +341,7 @@ const ue = /* @__PURE__ */ Q.extend({
341
341
  };
342
342
  },
343
343
  addNodeView() {
344
- return J(ae);
344
+ return Q(ae);
345
345
  },
346
346
  addCommands() {
347
347
  var e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-C4WLt4NA.cjs"),u=require("react/jsx-runtime"),H=require("mammoth"),A=require("react"),s=require("./index-czmcFIW7.cjs");require("./theme.cjs");const P=require("./index-BqL4vAWE.cjs");function N(o,t){const a=atob(o.split(",")[1]),l=Array.from({length:a.length});for(let i=0;i<a.length;i++)l[i]=a.charCodeAt(i);const m=new Uint8Array(l);return new Blob([m],{type:t})}function k(o,t){return new File([o],t,{type:o.type})}function z(){const o=s.useEditorInstance(),t=s.useButtonProps(y.name),{icon:a=void 0,tooltip:l=void 0,tooltipOptions:m={},isActive:i=void 0,mammothOptions:w,limit:j,convert:b}=(t==null?void 0:t.componentProps)??{},{editorDisabled:W}=s.useToggleActive(i),p=s.useExtension(y.name),{toast:q}=s.useToast(),{t:S}=P.useLocale(),[C,v]=A.useState(!1),x=A.useRef(null);function O(){var e;(e=x.current)==null||e.click()}function R(e){const n=e.target.files[0];if(n){if(n.size>j){q({variant:"destructive",title:S("editor.importWord.limitSize")});return}E(n)}}async function B(e){const c=new DOMParser().parseFromString(e,"text/html"),f=c.querySelectorAll("img");if(f.length===0)return c.body.innerHTML;if(s.hasExtension(o,s.Image.name)){const g=p==null?void 0:p.options;if(g&&typeof g.upload=="function"){const T=[];for(const h of f){const d=h.getAttribute("src"),r=N(d,"image/jpeg"),L=k(r,"image.jpeg");T.push(L)}const F=await g.upload(T);for(const[h,d]of f.entries()){d.setAttribute("src",F[h].src);const r=d.parentElement;(r==null?void 0:r.tagName)==="P"&&(r.insertAdjacentElement("beforebegin",d),!r.hasChildNodes()&&r.textContent===""&&r.remove())}return c.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),c.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),c.body.innerHTML}async function E(e){v(!0);try{if(b){const n=await b(e);I(n)}else{const n=await e.arrayBuffer(),{value:c}=await H.convertToHtml({arrayBuffer:n},w);I(c)}}finally{v(!1)}}async function I(e){const n=await B(e);o.chain().setContent(n,!0).run()}return t?u.jsxs(u.Fragment,{children:[u.jsx(s.ActionButton,{action:O,disabled:W,icon:a,loading:C,tooltip:l,tooltipOptions:m}),u.jsx("input",{accept:".docx",onChange:R,ref:x,type:"file",style:{display:"none"}})]}):u.jsx(u.Fragment,{})}const y=M.Extension.create({name:"importWord",addOptions(){var o;return{...(o=this.parent)==null?void 0:o.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({extension:t,t:a})=>{const{convert:l,limit:m,mammothOptions:i}=t.options;return{componentProps:{convert:l,limit:m,mammothOptions:i,icon:"Word",shortcutKeys:t.options.shortcutKeys??["alt","mod","S"],tooltip:a("editor.importWord.tooltip")}}}}}});exports.ImportWord=y;exports.RichTextImportWord=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-C4WLt4NA.cjs"),u=require("react/jsx-runtime"),H=require("mammoth"),A=require("react"),s=require("./index-DirFiHQ6.cjs");require("./theme.cjs");const P=require("./index-BqL4vAWE.cjs");function N(o,t){const a=atob(o.split(",")[1]),l=Array.from({length:a.length});for(let i=0;i<a.length;i++)l[i]=a.charCodeAt(i);const m=new Uint8Array(l);return new Blob([m],{type:t})}function k(o,t){return new File([o],t,{type:o.type})}function z(){const o=s.useEditorInstance(),t=s.useButtonProps(y.name),{icon:a=void 0,tooltip:l=void 0,tooltipOptions:m={},isActive:i=void 0,mammothOptions:w,limit:j,convert:b}=(t==null?void 0:t.componentProps)??{},{editorDisabled:W}=s.useToggleActive(i),p=s.useExtension(y.name),{toast:q}=s.useToast(),{t:S}=P.useLocale(),[C,v]=A.useState(!1),x=A.useRef(null);function O(){var e;(e=x.current)==null||e.click()}function R(e){const n=e.target.files[0];if(n){if(n.size>j){q({variant:"destructive",title:S("editor.importWord.limitSize")});return}E(n)}}async function B(e){const c=new DOMParser().parseFromString(e,"text/html"),f=c.querySelectorAll("img");if(f.length===0)return c.body.innerHTML;if(s.hasExtension(o,s.Image.name)){const g=p==null?void 0:p.options;if(g&&typeof g.upload=="function"){const T=[];for(const h of f){const d=h.getAttribute("src"),r=N(d,"image/jpeg"),L=k(r,"image.jpeg");T.push(L)}const F=await g.upload(T);for(const[h,d]of f.entries()){d.setAttribute("src",F[h].src);const r=d.parentElement;(r==null?void 0:r.tagName)==="P"&&(r.insertAdjacentElement("beforebegin",d),!r.hasChildNodes()&&r.textContent===""&&r.remove())}return c.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),c.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),c.body.innerHTML}async function E(e){v(!0);try{if(b){const n=await b(e);I(n)}else{const n=await e.arrayBuffer(),{value:c}=await H.convertToHtml({arrayBuffer:n},w);I(c)}}finally{v(!1)}}async function I(e){const n=await B(e);o.chain().setContent(n,!0).run()}return t?u.jsxs(u.Fragment,{children:[u.jsx(s.ActionButton,{action:O,disabled:W,icon:a,loading:C,tooltip:l,tooltipOptions:m}),u.jsx("input",{accept:".docx",onChange:R,ref:x,type:"file",style:{display:"none"}})]}):u.jsx(u.Fragment,{})}const y=M.Extension.create({name:"importWord",addOptions(){var o;return{...(o=this.parent)==null?void 0:o.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({extension:t,t:a})=>{const{convert:l,limit:m,mammothOptions:i}=t.options;return{componentProps:{convert:l,limit:m,mammothOptions:i,icon:"Word",shortcutKeys:t.options.shortcutKeys??["alt","mod","S"],tooltip:a("editor.importWord.tooltip")}}}}}});exports.ImportWord=y;exports.RichTextImportWord=z;
package/lib/ImportWord.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { E as M } from "./index-D0EmqTpe.js";
2
- import { jsx as g, Fragment as w, jsxs as P } from "react/jsx-runtime";
2
+ import { jsx as g, Fragment as I, jsxs as P } from "react/jsx-runtime";
3
3
  import R from "mammoth";
4
4
  import { useState as N, useRef as k } from "react";
5
- import { h as z, u as D, d as K, v as U, w as q, A as G, x as J, y as Q } from "./index-B2a7NqnN.js";
5
+ import { h as z, u as D, d as K, m as U, n as q, A as G, o as J, p as Q } from "./index-B1SzsIsE.js";
6
6
  import "./theme.js";
7
7
  import { u as V } from "./index-BlXGgvT-.js";
8
8
  function X(e, t) {
@@ -16,15 +16,15 @@ function Y(e, t) {
16
16
  return new File([e], t, { type: e.type });
17
17
  }
18
18
  function it() {
19
- const e = z(), t = D(I.name), {
19
+ const e = z(), t = D(w.name), {
20
20
  icon: s = void 0,
21
21
  tooltip: c = void 0,
22
22
  tooltipOptions: l = {},
23
23
  isActive: i = void 0,
24
- mammothOptions: x,
25
- limit: T,
24
+ mammothOptions: T,
25
+ limit: x,
26
26
  convert: h
27
- } = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: C } = K(i), u = U(I.name), { toast: E } = q(), { t: W } = V(), [B, y] = N(!1), b = k(null);
27
+ } = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: C } = K(i), u = U(w.name), { toast: E } = q(), { t: W } = V(), [B, y] = N(!1), b = k(null);
28
28
  function L() {
29
29
  var o;
30
30
  (o = b.current) == null || o.click();
@@ -32,7 +32,7 @@ function it() {
32
32
  function O(o) {
33
33
  const n = o.target.files[0];
34
34
  if (n) {
35
- if (n.size > T) {
35
+ if (n.size > x) {
36
36
  E({
37
37
  variant: "destructive",
38
38
  title: W("editor.importWord.limitSize")
@@ -73,7 +73,7 @@ function it() {
73
73
  const n = await h(o);
74
74
  v(n);
75
75
  } else {
76
- const n = await o.arrayBuffer(), { value: a } = await R.convertToHtml({ arrayBuffer: n }, x);
76
+ const n = await o.arrayBuffer(), { value: a } = await R.convertToHtml({ arrayBuffer: n }, T);
77
77
  v(a);
78
78
  }
79
79
  } finally {
@@ -84,7 +84,7 @@ function it() {
84
84
  const n = await S(o);
85
85
  e.chain().setContent(n, !0).run();
86
86
  }
87
- return t ? /* @__PURE__ */ P(w, { children: [
87
+ return t ? /* @__PURE__ */ P(I, { children: [
88
88
  /* @__PURE__ */ g(
89
89
  G,
90
90
  {
@@ -108,9 +108,9 @@ function it() {
108
108
  }
109
109
  }
110
110
  )
111
- ] }) : /* @__PURE__ */ g(w, {});
111
+ ] }) : /* @__PURE__ */ g(I, {});
112
112
  }
113
- const I = /* @__PURE__ */ M.create({
113
+ const w = /* @__PURE__ */ M.create({
114
114
  name: "importWord",
115
115
  //@ts-expect-error
116
116
  addOptions() {
@@ -140,6 +140,6 @@ const I = /* @__PURE__ */ M.create({
140
140
  }
141
141
  });
142
142
  export {
143
- I as ImportWord,
143
+ w as ImportWord,
144
144
  it as RichTextImportWord
145
145
  };
@@ -1,7 +1,7 @@
1
1
  import { o as y, E as x } from "./index-D0EmqTpe.js";
2
2
  import { TextSelection as b, AllSelection as I } from "@tiptap/pm/state";
3
3
  import { jsx as d, Fragment as m, jsxs as A } from "react/jsx-runtime";
4
- import { u as T, d as K, A as p } from "./index-B2a7NqnN.js";
4
+ import { u as T, d as K, A as p } from "./index-B1SzsIsE.js";
5
5
  import "react";
6
6
  import "./theme.js";
7
7
  var a = /* @__PURE__ */ ((t) => (t[t.max = 7] = "max", t[t.min = 0] = "min", t[t.more = 1] = "more", t[t.less = -1] = "less", t))(a || {});
@@ -1 +1 @@
1
- "use strict";const p=require("./index-C4WLt4NA.cjs"),l=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),u=require("./index-czmcFIW7.cjs");require("react");require("./theme.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function b(t,e,n){return t<e?e:t>n?n:t}function T(t,e,n,o){const{doc:s,selection:i}=t;if(!s||!i||!(i instanceof l.TextSelection||i instanceof l.AllSelection))return t;const{from:r,to:d}=i;return s.nodesBetween(r,d,(m,x)=>{const I=m.type;return n.includes(I.name)?(t=h(t,x,e),!1):!p.isList(m.type.name,o.extensionManager.extensions)}),t}function h(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const r=b((o.attrs.indent||0)+n,0,7);if(r===o.attrs.indent)return t;const d={...o.attrs,indent:r};return t.setNodeMarkup(e,o.type,d,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:s})=>{const{selection:i}=n;let{tr:r}=n;return r=r.setSelection(i),r=T(r,t,e,s),r.docChanged?(o&&o(r),!0):!1}}function A(){const t=u.useButtonProps(y.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=u.useToggleActive(),s=()=>{o||e!=null&&e.action&&(e==null||e.action())},i=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(u.ActionButton,{action:s,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(u.ActionButton,{action:i,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const y=p.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var s,i;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((s=o.options.shortcutKeys)==null?void 0:s[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=y;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=h;
1
+ "use strict";const p=require("./index-C4WLt4NA.cjs"),l=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),u=require("./index-DirFiHQ6.cjs");require("react");require("./theme.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function b(t,e,n){return t<e?e:t>n?n:t}function T(t,e,n,o){const{doc:s,selection:i}=t;if(!s||!i||!(i instanceof l.TextSelection||i instanceof l.AllSelection))return t;const{from:r,to:d}=i;return s.nodesBetween(r,d,(m,x)=>{const I=m.type;return n.includes(I.name)?(t=h(t,x,e),!1):!p.isList(m.type.name,o.extensionManager.extensions)}),t}function h(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const r=b((o.attrs.indent||0)+n,0,7);if(r===o.attrs.indent)return t;const d={...o.attrs,indent:r};return t.setNodeMarkup(e,o.type,d,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:s})=>{const{selection:i}=n;let{tr:r}=n;return r=r.setSelection(i),r=T(r,t,e,s),r.docChanged?(o&&o(r),!0):!1}}function A(){const t=u.useButtonProps(y.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=u.useToggleActive(),s=()=>{o||e!=null&&e.action&&(e==null||e.action())},i=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(u.ActionButton,{action:s,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(u.ActionButton,{action:i,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const y=p.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var s,i;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((s=o.options.shortcutKeys)==null?void 0:s[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=y;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=h;
package/lib/Indent.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");const e=require("./Indent-MuSU0kXz.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");const e=require("./Indent-DtgugDpq.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
package/lib/Indent.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./index-D0EmqTpe.js";
2
- import { I as o, R as r } from "./Indent-3MoIatX1.js";
2
+ import { I as o, R as r } from "./Indent-BTzj50Sf.js";
3
3
  export {
4
4
  o as Indent,
5
5
  r as RichTextIndent
package/lib/Italic.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-C4WLt4NA.cjs"),s=require("react/jsx-runtime"),a=require("./index-czmcFIW7.cjs");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,h=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,k=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,v=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:y,type:this.type}),r.markInputRule({find:h,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:I,type:this.type}),r.markPasteRule({find:k,type:this.type})]}}),f=v;function M(){const t=a.useButtonProps(u.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:c={},action:o=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:m,disabled:l,update:p}=a.useToggleActive(d),g=()=>{l||o&&(o(),p())};return t?s.jsx(a.ActionButton,{action:g,dataState:m,disabled:l,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:c}):s.jsx(s.Fragment,{})}const u=f.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=u;exports.RichTextItalic=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-C4WLt4NA.cjs"),s=require("react/jsx-runtime"),a=require("./index-DirFiHQ6.cjs");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,h=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,k=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,v=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:y,type:this.type}),r.markInputRule({find:h,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:I,type:this.type}),r.markPasteRule({find:k,type:this.type})]}}),f=v;function M(){const t=a.useButtonProps(u.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:c={},action:o=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:m,disabled:l,update:p}=a.useToggleActive(d),g=()=>{l||o&&(o(),p())};return t?s.jsx(a.ActionButton,{action:g,dataState:m,disabled:l,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:c}):s.jsx(s.Fragment,{})}const u=f.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=u;exports.RichTextItalic=M;
package/lib/Italic.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { M as g, f as o, h as i, m as y } from "./index-D0EmqTpe.js";
2
2
  import { jsx as d, Fragment as h } from "react/jsx-runtime";
3
- import { u as f, d as I, A as v } from "./index-B2a7NqnN.js";
3
+ import { u as f, d as I, A as v } from "./index-B1SzsIsE.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  var M = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, k = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, A = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, _ = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, R = g.create({
@@ -3,8 +3,9 @@ import { N as $o, a as Eo } from "./clsx-Bg-2aTKh.js";
3
3
  import { jsx as er, jsxs as _r } from "react/jsx-runtime";
4
4
  import Xa from "katex";
5
5
  import { useState as Ur, useRef as xo, useEffect as Bo, useMemo as Hr, useCallback as To } from "react";
6
- import { u as Mo, d as jo, h as Co, D as Do, m as Fo, A as No, n as _o, o as Wo, L as un, F as fn, t as ko, B as Lo } from "./index-B2a7NqnN.js";
6
+ import { u as Mo, d as jo, h as Co, D as Do, r as Fo, A as No, s as _o, v as Wo, L as un, w as ko, B as Lo } from "./index-B1SzsIsE.js";
7
7
  import "./theme.js";
8
+ import { T as fn } from "./textarea--IMIy9VF.js";
8
9
  import { a as Uo, c as Gr, g as Ho } from "./_commonjsHelpers-B4e78b8K.js";
9
10
  import { u as Go } from "./index-BlXGgvT-.js";
10
11
  var ae, sn;
@@ -2576,7 +2577,7 @@ function Yi({ node: r }) {
2576
2577
  }
2577
2578
  );
2578
2579
  }
2579
- function iu() {
2580
+ function uu() {
2580
2581
  const { t: r } = Go(), [e, n] = Ur(!1), o = Mo(Ya.name), {
2581
2582
  icon: t = void 0,
2582
2583
  tooltip: f = void 0,
@@ -2736,7 +2737,7 @@ const Ya = /* @__PURE__ */ Io.create({
2736
2737
  });
2737
2738
  export {
2738
2739
  Ya as K,
2739
- iu as R,
2740
+ uu as R,
2740
2741
  bo as s,
2741
2742
  Ji as u
2742
2743
  };