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.
- package/README.md +8 -2
- package/lib/{ActionMenuButton-BCgqJsST.cjs → ActionMenuButton-CYdM1xx5.cjs} +1 -1
- package/lib/{ActionMenuButton-D97K0UWT.js → ActionMenuButton-DKRF6oa0.js} +1 -1
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +25 -29
- package/lib/Attachment.d.ts +25 -29
- package/lib/Attachment.js +7 -6
- package/lib/BaseKit.cjs +3 -0
- package/lib/BaseKit.d.cts +481 -0
- package/lib/BaseKit.d.ts +481 -0
- package/lib/BaseKit.js +132 -0
- package/lib/Blockquote.cjs +5 -1
- package/lib/Blockquote.d.cts +25 -29
- package/lib/Blockquote.d.ts +25 -29
- package/lib/Blockquote.js +33 -17
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +25 -29
- package/lib/Bold.d.ts +25 -29
- package/lib/Bold.js +23 -16
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +26 -30
- package/lib/BulletList.d.ts +26 -30
- package/lib/BulletList.js +11 -57
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +25 -29
- package/lib/Clear.d.ts +25 -29
- package/lib/Clear.js +4 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +25 -29
- package/lib/Code.d.ts +25 -29
- package/lib/Code.js +29 -25
- package/lib/CodeBlock.cjs +2 -2
- package/lib/CodeBlock.d.cts +25 -29
- package/lib/CodeBlock.d.ts +25 -29
- package/lib/CodeBlock.js +3 -3
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +25 -29
- package/lib/CodeView.d.ts +25 -29
- package/lib/CodeView.js +3 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +26 -30
- package/lib/Color.d.ts +26 -30
- package/lib/Color.js +42 -74
- package/lib/Document.cjs +1 -1
- package/lib/Document.d.cts +25 -29
- package/lib/Document.d.ts +25 -29
- package/lib/Document.js +4 -8
- package/lib/{Drawer-BHkje8ys.js → Drawer-CaAfmqNo.js} +37 -35
- package/lib/{Drawer-5Q_-WRhc.cjs → Drawer-CdvCMSzN.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +25 -29
- package/lib/Drawer.d.ts +25 -29
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +28 -30
- package/lib/Emoji.d.ts +28 -30
- package/lib/Emoji.js +19795 -184
- package/lib/{Excalidraw-GUVW-IqC.cjs → Excalidraw-BbMQhNvs.cjs} +1 -1
- package/lib/{Excalidraw-CG498239.js → Excalidraw-CVWz2Vyn.js} +20 -20
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +25 -29
- package/lib/Excalidraw.d.ts +25 -29
- package/lib/Excalidraw.js +3 -3
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +25 -29
- package/lib/ExportPdf.d.ts +25 -29
- package/lib/ExportPdf.js +4 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +25 -29
- package/lib/ExportWord.d.ts +25 -29
- package/lib/ExportWord.js +22 -51
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +26 -30
- package/lib/FontFamily.d.ts +26 -30
- package/lib/FontFamily.js +44 -73
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +25 -29
- package/lib/FontSize.d.ts +25 -29
- package/lib/FontSize.js +7 -5
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +25 -29
- package/lib/FormatPainter.d.ts +25 -29
- package/lib/FormatPainter.js +4 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +25 -29
- package/lib/Heading.d.ts +25 -29
- package/lib/Heading.js +71 -60
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +25 -29
- package/lib/Highlight.d.ts +25 -29
- package/lib/Highlight.js +5 -4
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +27 -31
- package/lib/History.d.ts +27 -31
- package/lib/History.js +39 -403
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +25 -29
- package/lib/HorizontalRule.d.ts +25 -29
- package/lib/HorizontalRule.js +16 -65
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +25 -29
- package/lib/Iframe.d.ts +25 -29
- package/lib/Iframe.js +4 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +25 -29
- package/lib/Image.d.ts +25 -29
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +25 -29
- package/lib/ImageGif.d.ts +25 -29
- package/lib/ImageGif.js +5 -5
- package/lib/ImportWord.cjs +72 -72
- package/lib/ImportWord.d.cts +25 -29
- package/lib/ImportWord.d.ts +25 -29
- package/lib/ImportWord.js +5652 -5615
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +25 -29
- package/lib/Indent.d.ts +25 -29
- package/lib/Indent.js +4 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +25 -29
- package/lib/Italic.d.ts +25 -29
- package/lib/Italic.js +20 -14
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +25 -29
- package/lib/Katex.d.ts +25 -29
- package/lib/Katex.js +12 -12
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +25 -29
- package/lib/LineHeight.d.ts +25 -29
- package/lib/LineHeight.js +5 -3
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +25 -29
- package/lib/Link.d.ts +25 -29
- package/lib/Link.js +4 -4
- package/lib/ListItem.cjs +1 -1
- package/lib/ListItem.d.cts +30 -30
- package/lib/ListItem.d.ts +30 -30
- package/lib/ListItem.js +4 -30
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +25 -29
- package/lib/Mention.d.ts +25 -29
- package/lib/Mention.js +161 -132
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +25 -29
- package/lib/Mermaid.d.ts +25 -29
- package/lib/Mermaid.js +50 -48
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +25 -29
- package/lib/MoreMark.d.ts +25 -29
- package/lib/MoreMark.js +5 -3
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +25 -29
- package/lib/MultiColumn.d.ts +25 -29
- package/lib/MultiColumn.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +26 -30
- package/lib/OrderedList.d.ts +26 -30
- package/lib/OrderedList.js +11 -75
- package/lib/RichTextEditor-CxvwGvQG.cjs +142 -0
- package/lib/RichTextEditor-DGcKEUGr.js +22166 -0
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +38 -112
- package/lib/SearchAndReplace.d.ts +38 -112
- package/lib/SearchAndReplace.js +204 -192
- package/lib/Selection.cjs +1 -1
- package/lib/Selection.d.cts +25 -29
- package/lib/Selection.d.ts +25 -29
- package/lib/Selection.js +1 -1
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +25 -29
- package/lib/SlashCommand.d.ts +25 -29
- package/lib/SlashCommand.js +178 -223
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +25 -29
- package/lib/Strike.d.ts +25 -29
- package/lib/Strike.js +20 -14
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +25 -29
- package/lib/SubAndSuperScript.d.ts +25 -29
- package/lib/SubAndSuperScript.js +5 -3
- package/lib/Table.cjs +8 -10
- package/lib/Table.d.cts +28 -32
- package/lib/Table.d.ts +28 -32
- package/lib/Table.js +382 -2022
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +25 -29
- package/lib/TableOfContent.d.ts +25 -29
- package/lib/TableOfContent.js +5 -5
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +27 -31
- package/lib/TaskList.d.ts +27 -31
- package/lib/TaskList.js +12 -154
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +25 -29
- package/lib/TextAlign.d.ts +25 -29
- package/lib/TextAlign.js +11 -9
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +25 -29
- package/lib/TextBubble.d.ts +25 -29
- package/lib/TextBubble.js +5 -3
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +25 -29
- package/lib/TextDirection.d.ts +25 -29
- package/lib/TextDirection.js +2 -3
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +25 -29
- package/lib/TextUnderline.d.ts +25 -29
- package/lib/TextUnderline.js +40 -12
- package/lib/TrailingNode.cjs +1 -1
- package/lib/TrailingNode.d.cts +25 -29
- package/lib/TrailingNode.d.ts +25 -29
- package/lib/TrailingNode.js +1 -1
- package/lib/Twitter-BFULyqdR.js +1628 -0
- package/lib/Twitter-Cutpkh3h.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +25 -29
- package/lib/Twitter.d.ts +25 -29
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +25 -29
- package/lib/Video.d.ts +25 -29
- package/lib/Video.js +3 -3
- package/lib/bubble-extra.cjs +2 -2
- package/lib/bubble-extra.d.cts +25 -29
- package/lib/bubble-extra.d.ts +25 -29
- package/lib/bubble-extra.js +200 -192
- package/lib/dom-dataset-_6-diIRQ.cjs +33 -0
- package/lib/dom-dataset-lYeH6gfI.js +2361 -0
- package/lib/index-5iBZLua9.cjs +12 -0
- package/lib/index-6D1J-A-o.cjs +1 -0
- package/lib/index-B96Cclrj.cjs +3 -0
- package/lib/index-BBz7Nmv9.js +55 -0
- package/lib/index-BeCTd5v2.cjs +1 -0
- package/lib/index-ByurDDMv.js +237 -0
- package/lib/index-CUogRI7j.cjs +1 -0
- package/lib/index-Ch6dBBad.js +709 -0
- package/lib/index-DF2Lp4HZ.cjs +100 -0
- package/lib/{index-LUL9mqY4.js → index-D_L6n8O8.js} +4 -4
- package/lib/index-Dbvi-Bvh.cjs +1 -0
- package/lib/index-DpCrt7xs.cjs +1 -0
- package/lib/index-DsAX1Vq8.cjs +1 -0
- package/lib/index-Dy4DlW9o.js +12 -0
- package/lib/index-J3jHHZ4d.js +200 -0
- package/lib/{index-CsK90iVd.js → index-LmrOdnen.js} +302 -389
- package/lib/index-VvXaaKe3.js +898 -0
- package/lib/index-kbO3iWqL.js +13432 -0
- package/lib/index.cjs +1 -2
- package/lib/index.d.cts +26 -229
- package/lib/index.d.ts +26 -229
- package/lib/index.js +2 -588
- package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
- package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +25 -29
- package/lib/locale-bundle.d.ts +25 -29
- package/lib/locale-bundle.js +1 -1
- package/lib/style.css +1 -1
- package/lib/{textarea-DdH64g04.cjs → textarea-DFo_aXnj.cjs} +1 -1
- package/lib/{textarea-CktfkXNe.js → textarea-aPtytkDx.js} +1 -1
- package/package.json +76 -70
- package/lib/RichTextEditor-DWlLqTl9.cjs +0 -140
- package/lib/RichTextEditor-KP2Rgcqe.js +0 -12751
- package/lib/Twitter-99ivY5qv.js +0 -1744
- package/lib/Twitter-BvfvUtNT.cjs +0 -17
- package/lib/dom-dataset-Byuf1YmW.cjs +0 -33
- package/lib/dom-dataset-Di3tIRrR.js +0 -1031
- package/lib/index-BI-IcZcN.cjs +0 -1
- package/lib/index-ByRfqzMr.cjs +0 -89
- package/lib/index-C1fzuXpN.js +0 -46
- package/lib/index-CbQQFj2T.js +0 -133
- package/lib/index-DI9T3iLd.js +0 -12354
- package/lib/index-D_A0TBRA.cjs +0 -1
- package/lib/index-DclQSrIx.cjs +0 -1
- package/lib/index-Z4b9rzn-.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const we=require("./index-DF2Lp4HZ.cjs"),L=require("./dom-dataset-_6-diIRQ.cjs"),n=require("react/jsx-runtime"),f=require("react"),z=require("./RichTextEditor-CxvwGvQG.cjs"),Lt=require("./index-6D1J-A-o.cjs"),Ot="_verified_lvyh0_1",We={verified:Ot},qt=()=>n.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Dt=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsxs("g",{children:[n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[n.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),n.jsx("stop",{offset:".539",stopColor:"#cd8105"}),n.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),n.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),n.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[n.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),n.jsx("stop",{offset:".406",stopColor:"#e2b719"}),n.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),n.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[n.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),n.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),n.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),$t=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:We.verified,children:n.jsx("g",{children:n.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),At="_root_98iqw_1",Vt="_article_98iqw_21",Ze={root:At,article:Vt},Be=({className:e,children:t})=>n.jsx("div",{className:L.clsx("react-tweet-theme",Ze.root,e),children:n.jsx("article",{className:Ze.article,children:t})}),ft=e=>n.jsx("img",{...e}),Mt="_header_nqq4j_1",Wt="_avatar_nqq4j_11",Bt="_avatarOverflow_nqq4j_16",Ft="_avatarSquare_nqq4j_23",Pt="_avatarShadow_nqq4j_26",Ut="_author_nqq4j_37",zt="_authorLink_nqq4j_44",Ht="_authorVerified_nqq4j_53",Gt="_authorLinkText_nqq4j_56",Xt="_authorMeta_nqq4j_63",Kt="_authorFollow_nqq4j_66",Qt="_username_nqq4j_69",Jt="_follow_nqq4j_74",Yt="_separator_nqq4j_82",Zt="_brand_nqq4j_86",en="_twitterIcon_nqq4j_90",T={header:Mt,avatar:Wt,avatarOverflow:Bt,avatarSquare:Ft,avatarShadow:Pt,author:Ut,authorLink:zt,authorVerified:Ht,authorLinkText:Gt,authorMeta:Xt,authorFollow:Kt,username:Qt,follow:Jt,separator:Yt,brand:Zt,twitterIcon:en},tn="_verifiedOld_lcna5_1",nn="_verifiedBlue_lcna5_4",rn="_verifiedGovernment_lcna5_7",ye={verifiedOld:tn,verifiedBlue:nn,verifiedGovernment:rn},ht=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx(qt,{}),i=ye.verifiedBlue;if(r)switch(e.is_blue_verified||(i=ye.verifiedOld),e.verified_type){case"Government":s=n.jsx($t,{}),i=ye.verifiedGovernment;break;case"Business":s=n.jsx(Dt,{}),i=null;break}return r?n.jsx("div",{className:L.clsx(t,i),children:s}):null},sn=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:ft,{user:i}=e;return n.jsxs("div",{className:T.header,children:[n.jsxs("a",{href:e.url,className:T.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:L.clsx(T.avatarOverflow,i.profile_image_shape==="Square"&&T.avatarSquare),children:n.jsx(s,{src:i.profile_image_url_https,alt:i.name,width:48,height:48})}),n.jsx("div",{className:T.avatarOverflow,children:n.jsx("div",{className:T.avatarShadow})})]}),n.jsxs("div",{className:T.author,children:[n.jsxs("a",{href:e.url,className:T.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:T.authorLinkText,children:n.jsx("span",{title:i.name,children:i.name})}),n.jsx(ht,{user:i,className:T.authorVerified})]}),n.jsxs("div",{className:T.authorMeta,children:[n.jsx("a",{href:e.url,className:T.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${i.screen_name}`,children:["@",i.screen_name]})}),n.jsxs("div",{className:T.authorFollow,children:[n.jsx("span",{className:T.separator,children:"·"}),n.jsx("a",{href:i.follow_url,className:T.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:T.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:T.twitterIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},on="_root_1ec15_1",an={root:on},cn=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:an.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),ln="_root_eihfa_1",dn={root:ln},un=({href:e,children:t})=>n.jsx("a",{href:e,className:dn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),fn="_root_1xq52_1",hn={root:fn},_n=({tweet:e})=>n.jsx("p",{className:hn.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>{switch(t.type){case"hashtag":case"mention":case"url":case"symbol":return n.jsx(un,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),et=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,_t=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,mn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,xn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,pn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,vn=e=>`https://x.com/hashtag/${e.text}`,gn=e=>`https://x.com/search?q=%24${e.text}`,jn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,mt=(e,t)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",t),r.toString()):e.media_url_https},wn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,i)=>{var a,o;return((a=i.bitrate)!=null?a:0)-((o=s.bitrate)!=null?o:0)})},yn=e=>{const t=wn(e);return t.length>1?t[1]:t[0]},Ce=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function tt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return le(r,"hashtag",e.entities.hashtags),le(r,"mention",e.entities.user_mentions),le(r,"url",e.entities.urls),le(r,"symbol",e.entities.symbols),e.entities.media&&le(r,"media",e.entities.media),bn(e,r),r.map(s=>{const i=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:vn(s),text:i});case"mention":return Object.assign(s,{href:_t(s.screen_name),text:i});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:gn(s),text:i});default:return Object.assign(s,{text:i})}})}function le(e,t,r){for(const s of r)for(const[i,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const o=[{...s,type:t}];a.indices[0]<s.indices[0]&&o.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&o.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(i,1,...o);break}}function bn(e,t){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=t.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const Tn=e=>({...e,url:et(e),user:{...e.user,url:_t(e),follow_url:pn(e)},like_url:mn(e),reply_url:xn(e),in_reply_to_url:e.in_reply_to_screen_name?jn(e):void 0,entities:tt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:et(e.quoted_tweet),entities:tt(e.quoted_tweet)}:void 0}),Nn="_root_g9tkv_1",Rn="_rounded_g9tkv_6",kn="_mediaWrapper_g9tkv_10",Sn="_grid2Columns_g9tkv_17",En="_grid3_g9tkv_20",In="_grid2x2_g9tkv_23",Cn="_mediaContainer_g9tkv_26",Ln="_mediaLink_g9tkv_34",On="_skeleton_g9tkv_38",qn="_image_g9tkv_43",I={root:Nn,rounded:Rn,mediaWrapper:kn,grid2Columns:Sn,grid3:En,grid2x2:In,mediaContainer:Cn,mediaLink:Ln,skeleton:On,image:qn},Dn="_anchor_fp31d_1",$n="_videoButton_fp31d_17",An="_videoButtonIcon_fp31d_35",Vn="_watchOnTwitter_fp31d_44",Mn="_viewReplies_fp31d_60",ie={anchor:Dn,videoButton:$n,videoButtonIcon:An,watchOnTwitter:Vn,viewReplies:Mn},Wn=({tweet:e,media:t})=>{const[r,s]=f.useState(!0),[i,a]=f.useState(!1),[o,l]=f.useState(!1),h=yn(t);let u=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:I.image,poster:mt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{u&&window.clearTimeout(u),i||a(!0),o&&l(!1)},onPause:()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{i&&a(!1),u=0},100)},onEnded:()=>{l(!0)},children:n.jsx("source",{src:h.url,type:h.content_type})}),r&&n.jsx("button",{type:"button",className:ie.videoButton,"aria-label":"View video on X",onClick:j=>{const p=j.currentTarget.previousSibling;j.preventDefault(),s(!1),p.load(),p.play().then(()=>{a(!0),p.focus()}).catch(w=>{console.error("Error playing video:",w),s(!0),a(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:ie.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!i&&!o&&n.jsx("div",{className:ie.watchOnTwitter,children:n.jsx("a",{href:e.url,className:ie.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),o&&n.jsx("a",{href:e.url,className:L.clsx(ie.anchor,ie.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Bn=e=>n.jsx("img",{...e}),nt=(e,t)=>{let r=56.25;return t===1&&(r=100/e.original_info.width*e.original_info.height),t===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},xt=({tweet:e,components:t,quoted:r})=>{var s,i,a;const o=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var l;const h=(l=t==null?void 0:t.MediaImg)!=null?l:Bn;return n.jsx("div",{className:L.clsx(I.root,!r&&I.rounded),children:n.jsx("div",{className:L.clsx(I.mediaWrapper,o>1&&I.grid2Columns,o===3&&I.grid3,o>4&&I.grid2x2),children:(i=e.mediaDetails)==null?void 0:i.map(u=>n.jsx(f.Fragment,{children:u.type==="photo"?n.jsxs("a",{href:e.url,className:L.clsx(I.mediaContainer,I.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:I.skeleton,style:nt(u,o)}),n.jsx(h,{src:mt(u,"small"),alt:u.ext_alt_text||"Image",className:I.image,draggable:!0})]},u.media_url_https):n.jsxs("div",{className:I.mediaContainer,children:[n.jsx("div",{className:I.skeleton,style:nt(u,o)}),n.jsx(Wn,{tweet:e,media:u})]},u.media_url_https)},u.media_url_https))})})},Fn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Pn=new Intl.DateTimeFormat("en-US",Fn),Un=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},zn=e=>{const t=Un(Pn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Hn="_root_i24yn_1",Gn={root:Hn},Xn=({tweet:e})=>{const t=new Date(e.created_at),r=zn(t);return n.jsx("a",{className:Gn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},Kn="_info_19qcj_1",Qn="_infoLink_19qcj_10",Jn="_infoIcon_19qcj_30",be={info:Kn,infoLink:Qn,infoIcon:Jn},Yn=({tweet:e})=>n.jsxs("div",{className:be.info,children:[n.jsx(Xn,{tweet:e}),n.jsx("a",{className:be.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:be.infoIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),Zn="_actions_n2anf_1",er="_like_n2anf_13",tr="_reply_n2anf_14",nr="_copy_n2anf_15",rr="_likeIconWrapper_n2anf_27",sr="_likeCount_n2anf_30",ir="_replyIconWrapper_n2anf_35",or="_copyIconWrapper_n2anf_36",ar="_likeIcon_n2anf_27",cr="_replyIcon_n2anf_35",lr="_copyIcon_n2anf_36",dr="_replyText_n2anf_56",ur="_copyText_n2anf_57",S={actions:Zn,like:er,reply:tr,copy:nr,likeIconWrapper:rr,likeCount:sr,replyIconWrapper:ir,copyIconWrapper:or,likeIcon:ar,replyIcon:cr,copyIcon:lr,replyText:dr,copyText:ur},fr=({tweet:e})=>{const[t,r]=f.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return f.useEffect(()=>{if(t){const i=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(i)}},[t]),n.jsxs("button",{type:"button",className:S.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:S.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):n.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),n.jsx("span",{className:S.copyText,children:t?"Copied!":"Copy link"})]})},hr=({tweet:e})=>{const t=Ce(e.favorite_count);return n.jsxs("div",{className:S.actions,children:[n.jsxs("a",{className:S.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:S.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:S.likeIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),n.jsx("span",{className:S.likeCount,children:t})]}),n.jsxs("a",{className:S.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:S.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:S.replyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),n.jsx("span",{className:S.replyText,children:"Reply"})]}),n.jsx(fr,{tweet:e})]})},_r="_replies_1cutb_1",mr="_link_1cutb_4",xr="_text_1cutb_23",Te={replies:_r,link:mr,text:xr},pr=({tweet:e})=>n.jsx("div",{className:Te.replies,children:n.jsx("a",{className:Te.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Te.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ce(e.conversation_count)} reply`:`Read ${Ce(e.conversation_count)} replies`})})}),vr="_root_q5799_1",gr="_article_q5799_16",rt={root:vr,article:gr},jr=({tweet:e,children:t})=>n.jsx("div",{className:rt.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:rt.article,children:t})}),wr="_header_r31i5_1",yr="_avatar_r31i5_11",br="_avatarSquare_r31i5_17",Tr="_author_r31i5_21",Nr="_authorText_r31i5_26",Rr="_username_r31i5_33",Q={header:wr,avatar:yr,avatarSquare:br,author:Tr,authorText:Nr,username:Rr},kr=({tweet:e})=>{const{user:t}=e;return n.jsxs("div",{className:Q.header,children:[n.jsx("a",{href:e.url,className:Q.avatar,target:"_blank",rel:"noopener noreferrer",children:n.jsx("div",{className:L.clsx(Q.avatarOverflow,t.profile_image_shape==="Square"&&Q.avatarSquare),children:n.jsx(ft,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),n.jsxs("div",{className:Q.author,children:[n.jsx("div",{className:Q.authorText,children:n.jsx("span",{title:t.name,children:t.name})}),n.jsx(ht,{user:t}),n.jsx("div",{className:Q.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Sr="_root_175ot_1",Er={root:Sr},Ir=({tweet:e})=>n.jsx("p",{className:Er.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r))}),Cr=({tweet:e})=>{var t;return n.jsxs(jr,{tweet:e,children:[n.jsx(kr,{tweet:e}),n.jsx(Ir,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(xt,{quoted:!0,tweet:e}):null]})},Lr=({tweet:e,components:t})=>{var r;const s=f.useMemo(()=>Tn(e),[e]);return n.jsxs(Be,{children:[n.jsx(sn,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(cn,{tweet:s}),n.jsx(_n,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(xt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Cr,{tweet:s.quoted_tweet}),n.jsx(Yn,{tweet:s}),n.jsx(hr,{tweet:s}),n.jsx(pr,{tweet:s})]})},Or="_root_16yxa_1",qr={root:Or},Dr=e=>n.jsx(Be,{children:n.jsxs("div",{className:qr.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),$r="_skeleton_oi7hr_1",Ar={skeleton:$r},me=({style:e})=>n.jsx("span",{className:Ar.skeleton,style:e}),Vr="_root_17qqv_1",Mr={root:Vr},Wr=()=>n.jsxs(Be,{className:Mr.root,children:[n.jsx(me,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(me,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(me,{style:{height:"2rem"}}),n.jsx(me,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]}),pt=0,vt=1,gt=2,st=3;var it=Object.prototype.hasOwnProperty;function Le(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&Le(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(it.call(e,r)&&++s&&!it.call(t,r)||!(r in t)||!Le(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const P=new WeakMap,U=()=>{},R=U(),Oe=Object,d=e=>e===R,W=e=>typeof e=="function",H=(e,t)=>({...e,...t}),jt=e=>W(e.then),Ne={},xe={},Fe="undefined",de=typeof window!=Fe,qe=typeof document!=Fe,Br=de&&"Deno"in window,Fr=()=>de&&typeof window.requestAnimationFrame!=Fe,wt=(e,t)=>{const r=P.get(e);return[()=>!d(t)&&e.get(t)||Ne,s=>{if(!d(t)){const i=e.get(t);t in xe||(xe[t]=i),r[5](t,H(i,s),i||Ne)}},r[6],()=>!d(t)&&t in xe?xe[t]:!d(t)&&e.get(t)||Ne]};let De=!0;const Pr=()=>De,[$e,Ae]=de&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[U,U],Ur=()=>{const e=qe&&document.visibilityState;return d(e)||e!=="hidden"},zr=e=>(qe&&document.addEventListener("visibilitychange",e),$e("focus",e),()=>{qe&&document.removeEventListener("visibilitychange",e),Ae("focus",e)}),Hr=e=>{const t=()=>{De=!0,e()},r=()=>{De=!1};return $e("online",t),$e("offline",r),()=>{Ae("online",t),Ae("offline",r)}},Gr={isOnline:Pr,isVisible:Ur},Xr={initFocus:zr,initReconnect:Hr},ot=!f.useId,oe=!de||Br,Kr=e=>Fr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=oe?f.useEffect:f.useLayoutEffect,ke=typeof navigator<"u"&&navigator.connection,at=!oe&&ke&&(["slow-2g","2g"].includes(ke.effectiveType)||ke.saveData),pe=new WeakMap,Qr=e=>Oe.prototype.toString.call(e),Se=(e,t)=>e===`[object ${t}]`;let Jr=0;const Ve=e=>{const t=typeof e,r=Qr(e),s=Se(r,"Date"),i=Se(r,"RegExp"),a=Se(r,"Object");let o,l;if(Oe(e)===e&&!s&&!i){if(o=pe.get(e),o)return o;if(o=++Jr+"~",pe.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=Ve(e[l])+",";pe.set(e,o)}if(a){o="#";const h=Oe.keys(e).sort();for(;!d(l=h.pop());)d(e[l])||(o+=l+":"+Ve(e[l])+",");pe.set(e,o)}}else o=s?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Pe=e=>{if(W(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Ve(e):"",[e,t]};let Yr=0;const Me=()=>++Yr;async function yt(...e){const[t,r,s,i]=e,a=H({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=a.populateCache;const l=a.rollbackOnError;let h=a.optimisticData;const u=w=>typeof l=="function"?l(w):l!==!1,j=a.throwOnError;if(W(r)){const w=r,N=[],E=t.keys();for(const O of E)!/^\$(inf|sub)\$/.test(O)&&w(t.get(O)._k)&&N.push(O);return Promise.all(N.map(p))}return p(r);async function p(w){const[N]=Pe(w);if(!N)return;const[E,O]=wt(t,N),[$,ae,c,ue]=P.get(t),J=()=>{const q=$[N];return(W(a.revalidate)?a.revalidate(E().data,w):a.revalidate!==!1)&&(delete c[N],delete ue[N],q&&q[0])?q[0](gt).then(()=>E().data):E().data};if(e.length<3)return J();let y=s,A,V=!1;const Y=Me();ae[N]=[Y,0];const m=!d(h),Z=E(),M=Z.data,ee=Z._c,G=d(ee)?M:ee;if(m&&(h=W(h)?h(G,M):h,O({data:h,_c:G})),W(y))try{y=y(G)}catch(q){A=q,V=!0}if(y&&jt(y))if(y=await y.catch(q=>{A=q,V=!0}),Y!==ae[N][0]){if(V)throw A;return y}else V&&m&&u(A)&&(o=!0,O({data:G,_c:R}));if(o&&!V)if(W(o)){const q=o(y,G);O({data:q,error:R,_c:R})}else O({data:y,error:R,_c:R});if(ae[N][1]=Me(),Promise.resolve(J()).then(()=>{O({_c:R})}),V){if(j)throw A;return}return y}}const ct=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},Zr=(e,t)=>{if(!P.has(e)){const r=H(Xr,t),s=Object.create(null),i=yt.bind(R,e);let a=U;const o=Object.create(null),l=(j,p)=>{const w=o[j]||[];return o[j]=w,w.push(p),()=>w.splice(w.indexOf(p),1)},h=(j,p,w)=>{e.set(j,p);const N=o[j];if(N)for(const E of N)E(p,w)},u=()=>{if(!P.has(e)&&(P.set(e,[s,Object.create(null),Object.create(null),Object.create(null),i,h,l]),!oe)){const j=r.initFocus(setTimeout.bind(R,ct.bind(R,s,pt))),p=r.initReconnect(setTimeout.bind(R,ct.bind(R,s,vt)));a=()=>{j&&j(),p&&p(),P.delete(e)}}};return u(),[e,i,u,a]}return[e,P.get(e)[4]]},es=(e,t,r,s,i)=>{const a=r.errorRetryCount,o=i.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*r.errorRetryInterval;!d(a)&&o>a||setTimeout(s,l,i)},ts=Le,[bt,ns]=Zr(new Map),rs=H({onLoadingSlow:U,onSuccess:U,onError:U,onErrorRetry:es,onDiscarded:U,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:at?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:at?5e3:3e3,compare:ts,isPaused:()=>!1,cache:bt,mutate:ns,fallback:{}},Gr),ss=(e,t)=>{const r=H(e,t);if(t){const{use:s,fallback:i}=e,{use:a,fallback:o}=t;s&&a&&(r.use=s.concat(a)),i&&o&&(r.fallback=H(i,o))}return r},is=f.createContext({}),os="$inf$",Tt=de&&window.__SWR_DEVTOOLS_USE__,as=Tt?window.__SWR_DEVTOOLS_USE__:[],cs=()=>{Tt&&(window.__SWR_DEVTOOLS_REACT__=f)},ls=e=>W(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ds=()=>{const e=f.useContext(is);return f.useMemo(()=>H(rs,e),[e])},us=e=>(t,r,s)=>e(t,r&&((...a)=>{const[o]=Pe(t),[,,,l]=P.get(bt);if(o.startsWith(os))return r(...a);const h=l[o];return d(h)?r(...a):(delete l[o],h)}),s),fs=as.concat(us),hs=e=>function(...r){const s=ds(),[i,a,o]=ls(r),l=ss(s,o);let h=e;const{use:u}=l,j=(u||[]).concat(fs);for(let p=j.length;p--;)h=j[p](h);return h(i,a||l.fetcher||null,l)},_s=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const i=s.indexOf(r);i>=0&&(s[i]=s[s.length-1],s.pop())}};cs();const Ee=f.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ie={dedupe:!0},lt=Promise.resolve(R),ms=(e,t,r)=>{const{cache:s,compare:i,suspense:a,fallbackData:o,revalidateOnMount:l,revalidateIfStale:h,refreshInterval:u,refreshWhenHidden:j,refreshWhenOffline:p,keepPreviousData:w,strictServerPrefetchWarning:N}=r,[E,O,$,ae]=P.get(s),[c,ue]=Pe(e),J=f.useRef(!1),y=f.useRef(!1),A=f.useRef(c),V=f.useRef(t),Y=f.useRef(r),m=()=>Y.current,Z=()=>m().isVisible()&&m().isOnline(),[M,ee,G,q]=wt(s,c),te=f.useRef({}).current,fe=d(o)?d(r.fallback)?R:r.fallback[c]:o,Ue=(_,x)=>{for(const g in te){const v=g;if(v==="data"){if(!i(_[v],x[v])&&(!d(_[v])||!i(_e,x[v])))return!1}else if(x[v]!==_[v])return!1}return!0},ze=f.useMemo(()=>{const _=!c||!t?!1:d(l)?m().isPaused()||a?!1:h!==!1:l,x=k=>{const B=H(k);return delete B._k,_?{isValidating:!0,isLoading:!0,...B}:B},g=M(),v=q(),D=x(g),se=g===v?D:x(v);let b=D;return[()=>{const k=x(M());return Ue(k,b)?(b.data=k.data,b.isLoading=k.isLoading,b.isValidating=k.isValidating,b.error=k.error,b):(b=k,k)},()=>se]},[s,c]),ne=L.shimExports.useSyncExternalStore(f.useCallback(_=>G(c,(x,g)=>{Ue(g,x)||_()}),[s,c]),ze[0],ze[1]),He=!J.current,kt=E[c]&&E[c].length>0,re=ne.data,X=d(re)?fe&&jt(fe)?Ee(fe):fe:re,he=ne.error,ve=f.useRef(X),_e=w?d(re)?d(ve.current)?X:ve.current:re:X,K=c&&d(X),St=!oe&&L.shimExports.useSyncExternalStore(()=>U,()=>!1,()=>!0);N&&St&&!a&&K&&console.warn(`Missing pre-initiated data for serialized key "${c}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ge=kt&&!d(he)?!1:He&&!d(l)?l:m().isPaused()?!1:a?d(X)?!1:h:d(X)||h,Xe=!!(c&&t&&He&&Ge),Et=d(ne.isValidating)?Xe:ne.isValidating,It=d(ne.isLoading)?Xe:ne.isLoading,ce=f.useCallback(async _=>{const x=V.current;if(!c||!x||y.current||m().isPaused())return!1;let g,v,D=!0;const se=_||{},b=!$[c]||!se.dedupe,k=()=>ot?!y.current&&c===A.current&&J.current:c===A.current,B={isValidating:!1,isLoading:!1},Qe=()=>{ee(B)},Je=()=>{const C=$[c];C&&C[1]===v&&delete $[c]},Ye={isValidating:!0};d(M().data)&&(Ye.isLoading=!0);try{if(b&&(ee(Ye),r.loadingTimeout&&d(M().data)&&setTimeout(()=>{D&&k()&&m().onLoadingSlow(c,r)},r.loadingTimeout),$[c]=[x(ue),Me()]),[g,v]=$[c],g=await g,b&&setTimeout(Je,r.dedupingInterval),!$[c]||$[c][1]!==v)return b&&k()&&m().onDiscarded(c),!1;B.error=R;const C=O[c];if(!d(C)&&(v<=C[0]||v<=C[1]||C[1]===0))return Qe(),b&&k()&&m().onDiscarded(c),!1;const F=M().data;B.data=i(F,g)?F:g,b&&k()&&m().onSuccess(g,c,r)}catch(C){Je();const F=m(),{shouldRetryOnError:ge}=F;F.isPaused()||(B.error=C,b&&k()&&(F.onError(C,c,F),(ge===!0||W(ge)&&ge(C))&&(!m().revalidateOnFocus||!m().revalidateOnReconnect||Z())&&F.onErrorRetry(C,c,F,Ct=>{const je=E[c];je&&je[0]&&je[0](st,Ct)},{retryCount:(se.retryCount||0)+1,dedupe:!0})))}return D=!1,Qe(),!0},[c,s]),Ke=f.useCallback((..._)=>yt(s,A.current,..._),[]);if(Re(()=>{V.current=t,Y.current=r,d(re)||(ve.current=re)}),Re(()=>{if(!c)return;const _=ce.bind(R,Ie);let x=0;m().revalidateOnFocus&&(x=Date.now()+m().focusThrottleInterval);const v=_s(c,E,(D,se={})=>{if(D==pt){const b=Date.now();m().revalidateOnFocus&&b>x&&Z()&&(x=b+m().focusThrottleInterval,_())}else if(D==vt)m().revalidateOnReconnect&&Z()&&_();else{if(D==gt)return ce();if(D==st)return ce(se)}});return y.current=!1,A.current=c,J.current=!0,ee({_k:ue}),Ge&&($[c]||(d(X)||oe?_():Kr(_))),()=>{y.current=!0,v()}},[c]),Re(()=>{let _;function x(){const v=W(u)?u(M().data):u;v&&_!==-1&&(_=setTimeout(g,v))}function g(){!M().error&&(j||m().isVisible())&&(p||m().isOnline())?ce(Ie).then(x):x()}return x(),()=>{_&&(clearTimeout(_),_=-1)}},[u,j,p,c]),f.useDebugValue(_e),a){if(!ot&&oe&&K)throw new Error("Fallback data is required when using Suspense in SSR.");K&&(V.current=t,Y.current=r,y.current=!1);const _=ae[c],x=!d(_)&&K?Ke(_):lt;if(Ee(x),!d(he)&&K)throw he;const g=K?ce(Ie):lt;!d(_e)&&K&&(g.status="fulfilled",g.value=!0),Ee(g)}return{mutate:Ke,get data(){return te.data=!0,_e},get error(){return te.error=!0,he},get isValidating(){return te.isValidating=!0,Et},get isLoading(){return te.isLoading=!0,It}}},dt=hs(ms);class xs extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ps=dt.default||dt,vs="https://react-tweet.vercel.app";async function gs([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new xs({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const js=(e,t,r)=>{const{isLoading:s,data:i,error:a}=ps(()=>t||e?[t||e&&`${vs}/api/tweet/${e}`,r]:null,gs,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||i===void 0&&!a),data:i,error:a}},ws=({id:e,apiUrl:t,fallback:r=n.jsx(Wr,{}),components:s,fetchOptions:i,onError:a})=>{const{data:o,error:l,isLoading:h}=js(e,t,i);if(h)return r;if(l||!o){const u=(s==null?void 0:s.TweetNotFound)||Dr;return n.jsx(u,{error:a?a(l):l})}return n.jsx(Lr,{tweet:o,components:s})};function ys({node:e}){var s;const t=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=t==null?void 0:t.split("/").pop();return r?n.jsx(L.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(ws,{id:r})})}):null}function Nt(e){const{t}=Lt.useLocale(),[r,s]=f.useState("");f.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:o}=(a=e.editor)==null?void 0:a.getAttributes(Rt.name);o&&s(o)}},[e==null?void 0:e.editor]);function i(a){a.preventDefault(),a.stopPropagation(),e==null||e.onSetLink(r)}return n.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:i,children:[n.jsx(z.Label,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),n.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:n.jsx(z.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(z.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function bs(e){function t(r){e.action&&e.action(r)}return n.jsxs(z.Popover,{modal:!0,children:[n.jsx(z.PopoverTrigger,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(z.ActionButton,{tooltip:e==null?void 0:e.tooltip,tooltipOptions:e==null?void 0:e.tooltipOptions,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:n.jsx(z.IconComponent,{name:e==null?void 0:e.icon})})}),n.jsx(z.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Nt,{editor:e.editor,onSetLink:t})})]})}const Ts=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ns=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ut(e){return e.match(Ns)}const Rt=we.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({component:bs,componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return L.ReactNodeViewRenderer(ys,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:t})=>ut(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ut(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[we.nodePasteRule({find:Ts,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",we.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Nt;exports.Twitter=Rt;
|
package/lib/Twitter.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DF2Lp4HZ.cjs");require("./dom-dataset-_6-diIRQ.cjs");const e=require("./Twitter-Cutpkh3h.cjs");exports.Twitter=e.Twitter;
|
package/lib/Twitter.d.cts
CHANGED
|
@@ -70,18 +70,6 @@ declare module '@tiptap/core' {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
declare module '@tiptap/core' {
|
|
74
|
-
interface Commands<ReturnType> {
|
|
75
|
-
emoji: {
|
|
76
|
-
setEmoji: (emoji: {
|
|
77
|
-
name: string;
|
|
78
|
-
emoji: string;
|
|
79
|
-
}) => ReturnType;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
73
|
declare module '@tiptap/core' {
|
|
86
74
|
interface Commands<ReturnType> {
|
|
87
75
|
excalidraw: {
|
|
@@ -173,19 +161,15 @@ declare module '@tiptap/core' {
|
|
|
173
161
|
|
|
174
162
|
declare module '@tiptap/core' {
|
|
175
163
|
interface Commands<ReturnType> {
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Add an image gif
|
|
179
|
-
*/
|
|
180
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
164
|
+
indent: {
|
|
181
165
|
/**
|
|
182
|
-
*
|
|
166
|
+
* Set the indent attribute
|
|
183
167
|
*/
|
|
184
|
-
|
|
168
|
+
indent: () => ReturnType;
|
|
185
169
|
/**
|
|
186
|
-
* Set
|
|
170
|
+
* Set the outdent attribute
|
|
187
171
|
*/
|
|
188
|
-
|
|
172
|
+
outdent: () => ReturnType;
|
|
189
173
|
};
|
|
190
174
|
}
|
|
191
175
|
}
|
|
@@ -193,15 +177,19 @@ declare module '@tiptap/core' {
|
|
|
193
177
|
|
|
194
178
|
declare module '@tiptap/core' {
|
|
195
179
|
interface Commands<ReturnType> {
|
|
196
|
-
|
|
180
|
+
imageGifUpload: {
|
|
197
181
|
/**
|
|
198
|
-
*
|
|
182
|
+
* Add an image gif
|
|
199
183
|
*/
|
|
200
|
-
|
|
184
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
201
185
|
/**
|
|
202
|
-
*
|
|
186
|
+
* Update an image gif
|
|
203
187
|
*/
|
|
204
|
-
|
|
188
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
189
|
+
/**
|
|
190
|
+
* Set image alignment
|
|
191
|
+
*/
|
|
192
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
205
193
|
};
|
|
206
194
|
}
|
|
207
195
|
}
|
|
@@ -255,16 +243,24 @@ declare module '@tiptap/core' {
|
|
|
255
243
|
search: {
|
|
256
244
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
257
245
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
246
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
247
|
+
resetIndex: () => ReturnType;
|
|
248
|
+
nextSearchResult: () => ReturnType;
|
|
249
|
+
previousSearchResult: () => ReturnType;
|
|
258
250
|
replace: () => ReturnType;
|
|
259
251
|
replaceAll: () => ReturnType;
|
|
260
|
-
goToPrevSearchResult: () => void;
|
|
261
|
-
goToNextSearchResult: () => void;
|
|
262
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
263
252
|
};
|
|
264
253
|
}
|
|
265
254
|
}
|
|
266
255
|
|
|
267
256
|
|
|
257
|
+
declare module '@tiptap/core' {
|
|
258
|
+
interface Storage {
|
|
259
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
|
|
268
264
|
declare module '@tiptap/core' {
|
|
269
265
|
interface Commands<ReturnType> {
|
|
270
266
|
tableOfContents: {
|
package/lib/Twitter.d.ts
CHANGED
|
@@ -70,18 +70,6 @@ declare module '@tiptap/core' {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
declare module '@tiptap/core' {
|
|
74
|
-
interface Commands<ReturnType> {
|
|
75
|
-
emoji: {
|
|
76
|
-
setEmoji: (emoji: {
|
|
77
|
-
name: string;
|
|
78
|
-
emoji: string;
|
|
79
|
-
}) => ReturnType;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
73
|
declare module '@tiptap/core' {
|
|
86
74
|
interface Commands<ReturnType> {
|
|
87
75
|
excalidraw: {
|
|
@@ -173,19 +161,15 @@ declare module '@tiptap/core' {
|
|
|
173
161
|
|
|
174
162
|
declare module '@tiptap/core' {
|
|
175
163
|
interface Commands<ReturnType> {
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Add an image gif
|
|
179
|
-
*/
|
|
180
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
164
|
+
indent: {
|
|
181
165
|
/**
|
|
182
|
-
*
|
|
166
|
+
* Set the indent attribute
|
|
183
167
|
*/
|
|
184
|
-
|
|
168
|
+
indent: () => ReturnType;
|
|
185
169
|
/**
|
|
186
|
-
* Set
|
|
170
|
+
* Set the outdent attribute
|
|
187
171
|
*/
|
|
188
|
-
|
|
172
|
+
outdent: () => ReturnType;
|
|
189
173
|
};
|
|
190
174
|
}
|
|
191
175
|
}
|
|
@@ -193,15 +177,19 @@ declare module '@tiptap/core' {
|
|
|
193
177
|
|
|
194
178
|
declare module '@tiptap/core' {
|
|
195
179
|
interface Commands<ReturnType> {
|
|
196
|
-
|
|
180
|
+
imageGifUpload: {
|
|
197
181
|
/**
|
|
198
|
-
*
|
|
182
|
+
* Add an image gif
|
|
199
183
|
*/
|
|
200
|
-
|
|
184
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
201
185
|
/**
|
|
202
|
-
*
|
|
186
|
+
* Update an image gif
|
|
203
187
|
*/
|
|
204
|
-
|
|
188
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
189
|
+
/**
|
|
190
|
+
* Set image alignment
|
|
191
|
+
*/
|
|
192
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
205
193
|
};
|
|
206
194
|
}
|
|
207
195
|
}
|
|
@@ -255,16 +243,24 @@ declare module '@tiptap/core' {
|
|
|
255
243
|
search: {
|
|
256
244
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
257
245
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
246
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
247
|
+
resetIndex: () => ReturnType;
|
|
248
|
+
nextSearchResult: () => ReturnType;
|
|
249
|
+
previousSearchResult: () => ReturnType;
|
|
258
250
|
replace: () => ReturnType;
|
|
259
251
|
replaceAll: () => ReturnType;
|
|
260
|
-
goToPrevSearchResult: () => void;
|
|
261
|
-
goToNextSearchResult: () => void;
|
|
262
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
263
252
|
};
|
|
264
253
|
}
|
|
265
254
|
}
|
|
266
255
|
|
|
267
256
|
|
|
257
|
+
declare module '@tiptap/core' {
|
|
258
|
+
interface Storage {
|
|
259
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
|
|
268
264
|
declare module '@tiptap/core' {
|
|
269
265
|
interface Commands<ReturnType> {
|
|
270
266
|
tableOfContents: {
|
package/lib/Twitter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import "./dom-dataset-
|
|
3
|
-
import { T as m } from "./Twitter-
|
|
1
|
+
import "./index-kbO3iWqL.js";
|
|
2
|
+
import "./dom-dataset-lYeH6gfI.js";
|
|
3
|
+
import { T as m } from "./Twitter-BFULyqdR.js";
|
|
4
4
|
export {
|
|
5
5
|
m as Twitter
|
|
6
6
|
};
|
package/lib/Video.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DF2Lp4HZ.cjs");require("./index-6D1J-A-o.cjs");const e=require("./RichTextEditor-CxvwGvQG.cjs");exports.Video=e.Video;
|
package/lib/Video.d.cts
CHANGED
|
@@ -155,18 +155,6 @@ declare module '@tiptap/core' {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
declare module '@tiptap/core' {
|
|
159
|
-
interface Commands<ReturnType> {
|
|
160
|
-
emoji: {
|
|
161
|
-
setEmoji: (emoji: {
|
|
162
|
-
name: string;
|
|
163
|
-
emoji: string;
|
|
164
|
-
}) => ReturnType;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
158
|
declare module '@tiptap/core' {
|
|
171
159
|
interface Commands<ReturnType> {
|
|
172
160
|
excalidraw: {
|
|
@@ -258,19 +246,15 @@ declare module '@tiptap/core' {
|
|
|
258
246
|
|
|
259
247
|
declare module '@tiptap/core' {
|
|
260
248
|
interface Commands<ReturnType> {
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Add an image gif
|
|
264
|
-
*/
|
|
265
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
249
|
+
indent: {
|
|
266
250
|
/**
|
|
267
|
-
*
|
|
251
|
+
* Set the indent attribute
|
|
268
252
|
*/
|
|
269
|
-
|
|
253
|
+
indent: () => ReturnType;
|
|
270
254
|
/**
|
|
271
|
-
* Set
|
|
255
|
+
* Set the outdent attribute
|
|
272
256
|
*/
|
|
273
|
-
|
|
257
|
+
outdent: () => ReturnType;
|
|
274
258
|
};
|
|
275
259
|
}
|
|
276
260
|
}
|
|
@@ -278,15 +262,19 @@ declare module '@tiptap/core' {
|
|
|
278
262
|
|
|
279
263
|
declare module '@tiptap/core' {
|
|
280
264
|
interface Commands<ReturnType> {
|
|
281
|
-
|
|
265
|
+
imageGifUpload: {
|
|
282
266
|
/**
|
|
283
|
-
*
|
|
267
|
+
* Add an image gif
|
|
284
268
|
*/
|
|
285
|
-
|
|
269
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
286
270
|
/**
|
|
287
|
-
*
|
|
271
|
+
* Update an image gif
|
|
288
272
|
*/
|
|
289
|
-
|
|
273
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
274
|
+
/**
|
|
275
|
+
* Set image alignment
|
|
276
|
+
*/
|
|
277
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
290
278
|
};
|
|
291
279
|
}
|
|
292
280
|
}
|
|
@@ -340,16 +328,24 @@ declare module '@tiptap/core' {
|
|
|
340
328
|
search: {
|
|
341
329
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
342
330
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
331
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
332
|
+
resetIndex: () => ReturnType;
|
|
333
|
+
nextSearchResult: () => ReturnType;
|
|
334
|
+
previousSearchResult: () => ReturnType;
|
|
343
335
|
replace: () => ReturnType;
|
|
344
336
|
replaceAll: () => ReturnType;
|
|
345
|
-
goToPrevSearchResult: () => void;
|
|
346
|
-
goToNextSearchResult: () => void;
|
|
347
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
348
337
|
};
|
|
349
338
|
}
|
|
350
339
|
}
|
|
351
340
|
|
|
352
341
|
|
|
342
|
+
declare module '@tiptap/core' {
|
|
343
|
+
interface Storage {
|
|
344
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
|
|
353
349
|
declare module '@tiptap/core' {
|
|
354
350
|
interface Commands<ReturnType> {
|
|
355
351
|
tableOfContents: {
|
package/lib/Video.d.ts
CHANGED
|
@@ -155,18 +155,6 @@ declare module '@tiptap/core' {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
declare module '@tiptap/core' {
|
|
159
|
-
interface Commands<ReturnType> {
|
|
160
|
-
emoji: {
|
|
161
|
-
setEmoji: (emoji: {
|
|
162
|
-
name: string;
|
|
163
|
-
emoji: string;
|
|
164
|
-
}) => ReturnType;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
158
|
declare module '@tiptap/core' {
|
|
171
159
|
interface Commands<ReturnType> {
|
|
172
160
|
excalidraw: {
|
|
@@ -258,19 +246,15 @@ declare module '@tiptap/core' {
|
|
|
258
246
|
|
|
259
247
|
declare module '@tiptap/core' {
|
|
260
248
|
interface Commands<ReturnType> {
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Add an image gif
|
|
264
|
-
*/
|
|
265
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
249
|
+
indent: {
|
|
266
250
|
/**
|
|
267
|
-
*
|
|
251
|
+
* Set the indent attribute
|
|
268
252
|
*/
|
|
269
|
-
|
|
253
|
+
indent: () => ReturnType;
|
|
270
254
|
/**
|
|
271
|
-
* Set
|
|
255
|
+
* Set the outdent attribute
|
|
272
256
|
*/
|
|
273
|
-
|
|
257
|
+
outdent: () => ReturnType;
|
|
274
258
|
};
|
|
275
259
|
}
|
|
276
260
|
}
|
|
@@ -278,15 +262,19 @@ declare module '@tiptap/core' {
|
|
|
278
262
|
|
|
279
263
|
declare module '@tiptap/core' {
|
|
280
264
|
interface Commands<ReturnType> {
|
|
281
|
-
|
|
265
|
+
imageGifUpload: {
|
|
282
266
|
/**
|
|
283
|
-
*
|
|
267
|
+
* Add an image gif
|
|
284
268
|
*/
|
|
285
|
-
|
|
269
|
+
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
286
270
|
/**
|
|
287
|
-
*
|
|
271
|
+
* Update an image gif
|
|
288
272
|
*/
|
|
289
|
-
|
|
273
|
+
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
274
|
+
/**
|
|
275
|
+
* Set image alignment
|
|
276
|
+
*/
|
|
277
|
+
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
290
278
|
};
|
|
291
279
|
}
|
|
292
280
|
}
|
|
@@ -340,16 +328,24 @@ declare module '@tiptap/core' {
|
|
|
340
328
|
search: {
|
|
341
329
|
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
342
330
|
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
331
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
332
|
+
resetIndex: () => ReturnType;
|
|
333
|
+
nextSearchResult: () => ReturnType;
|
|
334
|
+
previousSearchResult: () => ReturnType;
|
|
343
335
|
replace: () => ReturnType;
|
|
344
336
|
replaceAll: () => ReturnType;
|
|
345
|
-
goToPrevSearchResult: () => void;
|
|
346
|
-
goToNextSearchResult: () => void;
|
|
347
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
348
337
|
};
|
|
349
338
|
}
|
|
350
339
|
}
|
|
351
340
|
|
|
352
341
|
|
|
342
|
+
declare module '@tiptap/core' {
|
|
343
|
+
interface Storage {
|
|
344
|
+
searchAndReplace: SearchAndReplaceStorage;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
|
|
353
349
|
declare module '@tiptap/core' {
|
|
354
350
|
interface Commands<ReturnType> {
|
|
355
351
|
tableOfContents: {
|
package/lib/Video.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import "./index-
|
|
3
|
-
import {
|
|
1
|
+
import "./index-kbO3iWqL.js";
|
|
2
|
+
import "./index-LmrOdnen.js";
|
|
3
|
+
import { W as p } from "./RichTextEditor-DGcKEUGr.js";
|
|
4
4
|
export {
|
|
5
5
|
p as Video
|
|
6
6
|
};
|
package/lib/bubble-extra.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
a-->b`,ee=({editor:e,attrs:n,extension:s})=>{const{alt:c,align:i}=n,[r,l]=a.useState(decodeURIComponent(c??$)),[u,x]=a.useState(""),[f,b]=a.useState(!1),p=a.useRef(null),[g,y]=a.useState(null),S=s==null?void 0:s.options.upload,I=a.useCallback(w=>{w&&import("mermaid").then(j=>{y(j.default)})},[]),T=async w=>{try{const{svg:j}=await g.render("mermaid-svg",w);x(j)}catch{x("")}},N=()=>{g.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),T(r)};a.useEffect(()=>{g&&f&&N()},[g,f]),a.useEffect(()=>{g&&f&&T(r)},[g,r]);const A=async()=>{if(r!==""){if(r){const w=p.current.querySelector("svg"),{width:j,height:z}=w.getBoundingClientRect(),m=`mermaid-${E.shortId()}.svg`;let d=E.i(w.outerHTML);if(S){const h=o.dataURLtoFile(d,m);d=await S(h)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:d,alt:encodeURIComponent(r),width:j,height:z},!!r).run(),e==null||e.commands.setAlignImageMermaid(i)}b(!1)}};return t.jsxs(o.Dialog,{onOpenChange:b,open:f,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>b(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Mermaid"}),t.jsx("div",{ref:I,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(H.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:$,onChange:w=>l(w.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:u},ref:p,style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"}})]})}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:A,type:"button",children:"Save changes"})})]})]})};function K(e,n){const[s,c]=a.useState(void 0);return a.useEffect(()=>{const i=()=>{const r=e.extensionManager.extensions.find(l=>l.name===n);r&&c(r)};return e.on("selectionUpdate",i),e.on("transaction",i),()=>{e.off("selectionUpdate",i),e.off("transaction",i)}},[e,n]),s}const te={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function re({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function ne(e){return e.type.name==="mermaid"}function ie(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,L.Mermaid.name),c=K(e.editor,L.Mermaid.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(ne(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleMermaid(e.editor),[e.disabled,e.editor,n]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:te,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(ee,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-mermaid-${u}`):t.jsx(re,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-mermaid-${u}`))})}):t.jsx(t.Fragment,{})})})}const v=new Map;function se(e){const n=e.options.element;v.has("width")||v.set("width",n.clientWidth),v.has("width")&&v.get("width")<=0&&v.set("width",n.clientWidth);const s={attributes:!0,childList:!0,subtree:!0},c=function(){v.set("width",n.clientWidth)},i=new MutationObserver(c);return i.observe(n,s),e.on("destroy",()=>{i.disconnect()}),{width:v.get("width")}}function oe({editor:e}){const{t:n}=D.useLocale(),{width:s}=se(e),c=o.useAttributes(e,M.Excalidraw.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:i,createUser:r,width:l,height:u}=c,x=a.useCallback(g=>{e.chain().updateAttributes(M.Excalidraw.name,g).setNodeSelection(e.state.selection.from).focus().run()},[e]),f=a.useCallback(()=>{M.triggerOpenExcalidrawSettingModal({...c,editor:e})},[e,c]),b=a.useCallback(()=>e.isActive(M.Excalidraw.name),[e]),p=a.useCallback(()=>o.deleteNode(M.Excalidraw.name,e),[e]);return a.useEffect(()=>{i&&(f(),e.chain().updateAttributes(M.Excalidraw.name,{defaultShowPicker:!1}).focus().run())},[r,i,e,f]),t.jsx(k.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:b,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:t.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[t.jsx(o.ActionButton,{icon:"Pencil",action:f,tooltip:n("editor.edit")}),t.jsx(o.SizeSetter,{width:l,maxWidth:s,height:u,onOk:x,children:t.jsx(o.ActionButton,{icon:"Settings",tooltip:n("editor.settings")})}),t.jsx(o.ActionButton,{icon:"Trash2",action:p,tooltip:n("editor.delete")})]})})}function ae({editor:e,disabled:n}){const[s,c]=a.useState(!1),{t:i}=D.useLocale(),r=a.useCallback(({editor:x})=>x.isActive(W.Twitter.name),[]),l=x=>{e.commands.updateTweet({src:x}),c(!1)},u=a.useCallback(()=>o.deleteNode(W.Twitter.name,e),[e]);return t.jsx(t.Fragment,{children:t.jsx(k.BubbleMenu,{editor:e,shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{c(!1)}},children:n?t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{children:s?t.jsx(W.FormEditLinkTwitter,{editor:e,onSetLink:l}):t.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:t.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[t.jsx(o.ActionButton,{icon:"Pencil",tooltip:i("editor.link.edit.tooltip"),tooltipOptions:{sideOffset:15},action:()=>{c(!0)}}),t.jsx(o.ActionButton,{action:u,icon:"Trash",tooltip:i("editor.delete"),tooltipOptions:{sideOffset:15}})]})})})})})}function ce({editor:e,...n}){const s=o.useAttributes(e,B.Katex.name,{text:"",defaultShowPicker:!1}),{text:c,defaultShowPicker:i}=s,[r,l]=a.useState(""),[u,x]=a.useState(!1),f=a.useCallback(()=>e.isActive(B.Katex.name),[e]),b=a.useCallback(()=>o.deleteNode(B.Katex.name,e),[e]),p=a.useCallback(()=>{e.chain().focus().setKatex({text:r}).run(),x(!1)},[e,r]);a.useEffect(()=>{i&&(x(!0),e.chain().updateAttributes(B.Katex.name,{defaultShowPicker:!1}).focus().run())},[e,i,x]),a.useEffect(()=>{u&&l(c||"")},[u]);const g=a.useMemo(()=>{try{return Y.renderToString(`${r}`)}catch{return r}},[r]),y=a.useMemo(()=>`${r}`.trim()?t.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:g||""}}):null,[r,g]);return t.jsx(k.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:f,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{x(!1)}},children:n!=null&&n.disabled?t.jsx(t.Fragment,{}):t.jsx("div",{className:"richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:u?t.jsxs(t.Fragment,{children:[t.jsx(H.Textarea,{autoFocus:!0,defaultValue:c,onChange:S=>l(S.target.value),placeholder:"Formula text",rows:3,style:{marginBottom:8},value:r}),y&&t.jsx("div",{className:"richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:y}),t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[t.jsx(o.Button,{className:"richtext-flex-1",onClick:p,children:"Submit"}),t.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:t.jsx(F.HelpCircle,{size:16})})]})]}):t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[t.jsx(o.ActionButton,{action:()=>x(!u),tooltip:"Edit",children:t.jsx(F.Pencil,{size:16})}),t.jsx(o.ActionButton,{action:b,tooltip:"Delete",children:t.jsx(F.Trash2,{size:16})})]})})})}let C=!1;function le({editor:e,attrs:n,extension:s}){const[c,i]=a.useState(!1),r=a.useRef(null),l=a.useRef(null),{alt:u,align:x}=n,f=s==null?void 0:s.options.upload,b=()=>{(async()=>{const d=document.querySelector("#easydrawer");d&&(r.current=new R.Editor(d,{wheelEventsEnabled:!1,disableZoom:!0}),l.current=R.makeDropdownToolbar(r.current),l.current.addDefaultToolWidgets(),r.current.loadFromSVG(decodeURIComponent(u)))})()};a.useEffect(()=>{c&&setTimeout(()=>{b()},200)},[c]);const p=async()=>{if(r.current){const m=r.current.toSVG(),d=m.outerHTML,h=`drawer-${E.shortId()}.svg`;let P=E.i(m.outerHTML);if(f){const U=o.dataURLtoFile(P,h);P=await f(U)}e==null||e.chain().focus().setDrawer({type:"drawer",src:P,alt:encodeURIComponent(d),width:426,height:212},!!d).run(),e==null||e.commands.setAlignImageDrawer(x)}i(!1)},g=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setColor(m),h.serializeState())},y=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setThickness(m),h.serializeState())},S=m=>{const d=r.current.toolController.getPrimaryTools()[3],h=l.current.getWidgetById("pen-2");d&&h&&(d.setColor(m),h.serializeState())},I=m=>{const d=l.current.getWidgetById("shape");d&&d.setShapeType(m)},T=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setColor(m),h.serializeState())},N=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setThickness(m),h.serializeState())},A=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setBorderColor(m),h.serializeState())},w=()=>{if(C){for(;r.current.history.redoStackSize>0;)r.current.history.redo();C=!1;return}r.current.history.undo()},j=()=>{C||r.current.history.redo()},z=()=>{if(!C){for(;r.current.history.undoStackSize>0;)w();C=!0}};return t.jsxs(o.Dialog,{onOpenChange:i,open:c,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:()=>i(!0),icon:"Pencil",tooltip:"Edit Drawer"})}),t.jsxs(o.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(o.DialogTitle,{children:"Edit Drawer"}),t.jsxs("div",{style:{height:"100%",borderWidth:1,background:"white",position:"relative"},children:[t.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),t.jsx(O.ControlDrawer,{changeBorderColorShape:A,changeColorShape:T,changeShape:I,onClear:z,onRedo:j,onThicknessChange:N,onUndo:w,refEditor:r,setColorHighlight:S,setColorPen:g,setThicknessPen:y})]}),t.jsx(o.DialogFooter,{children:t.jsx(o.Button,{onClick:p,type:"button",children:"Save changes"})})]})]})}const de={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function ue({item:e,disabled:n,editor:s}){var i;const c=e.component;return c?t.jsx(a.Fragment,{children:e.type==="divider"?t.jsx(o.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(c,{...e.componentProps,disabled:n||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:s})}):t.jsx(t.Fragment,{})}function he(e){return e.type.name==="drawer"}function xe(e){const{lang:n}=D.useLocale(),s=o.useAttributes(e.editor,O.Drawer.name),c=K(e.editor,O.Drawer.name),i=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let b=!1;return l.view.state.doc.nodesBetween(x.pos,f,p=>{if(he(p))return b=!0,!1}),b},r=a.useMemo(()=>e.disabled?[]:o.getBubbleDrawer(e.editor),[e.disabled,e.editor,n]);return t.jsx(k.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:i,tippyOptions:de,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(s!=null&&s.src)?t.jsx(le,{attrs:s,editor:e.editor,extension:c},`bubbleMenu-drawer-${u}`):t.jsx(ue,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-drawer-${u}`))})}):t.jsx(t.Fragment,{})})}exports.BubbleMenuDrawer=xe;exports.BubbleMenuExcalidraw=oe;exports.BubbleMenuKatex=ce;exports.BubbleMenuMermaid=ie;exports.BubbleMenuTwitter=ae;
|
|
1
|
+
"use strict";var H=Object.create;var q=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var J=(e,i,o,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of _(i))!Z.call(e,s)&&s!==o&&q(e,s,{get:()=>i[s],enumerable:!(a=V(i,s))||a.enumerable});return e};var Q=(e,i,o)=>(o=e!=null?H(G(e)):{},J(i||!e||!e.__esModule?q(o,"default",{value:e,enumerable:!0}):o,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),n=require("./RichTextEditor-CxvwGvQG.cjs"),L=require("./Mermaid.cjs"),B=require("./shortId-Bfj8TyNr.cjs"),K=require("./textarea-DFo_aXnj.cjs"),E=require("./index-6D1J-A-o.cjs"),M=require("./Excalidraw-BbMQhNvs.cjs"),F=require("./Twitter-Cutpkh3h.cjs"),X=require("katex"),W=require("lucide-react"),T=require("./Katex.cjs"),z=require("./Drawer-CdvCMSzN.cjs"),R=require("easydrawer"),O=`graph TB
|
|
2
|
+
a-->b`,Y=({editor:e,attrs:i,extension:o})=>{const{alt:a,align:s}=i,[r,l]=c.useState(decodeURIComponent(a??O)),[u,x]=c.useState(""),[f,g]=c.useState(!1),w=c.useRef(null),[b,y]=c.useState(null),S=o==null?void 0:o.options.upload,A=c.useCallback(p=>{p&&import("mermaid").then(j=>{y(j.default)})},[]),k=async p=>{try{const{svg:j}=await b.render("mermaid-svg",p);x(j)}catch{x("")}},D=()=>{b.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),k(r)};c.useEffect(()=>{b&&f&&D()},[b,f]),c.useEffect(()=>{b&&f&&k(r)},[b,r]);const N=async()=>{if(r!==""){if(r){const p=w.current.querySelector("svg"),{width:j,height:I}=p.getBoundingClientRect(),m=`mermaid-${B.shortId()}.svg`;let d=B.i(p.outerHTML);if(S){const h=n.dataURLtoFile(d,m);d=await S(h)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:d,alt:encodeURIComponent(r),width:j,height:I},!!r).run(),e==null||e.commands.setAlignImageMermaid(s)}g(!1)}};return t.jsxs(n.Dialog,{onOpenChange:g,open:f,children:[t.jsx(n.DialogTrigger,{asChild:!0,children:t.jsx(n.ActionButton,{action:()=>g(!0),icon:"Pencil",tooltip:"Edit Mermaid"})}),t.jsxs(n.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(n.DialogTitle,{children:"Edit Mermaid"}),t.jsx("div",{ref:A,style:{height:"100%",border:"1px solid hsl(var(--border))"},children:t.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[t.jsx(K.Textarea,{autoFocus:!0,className:"richtext-flex-1",defaultValue:O,onChange:p=>l(p.target.value),placeholder:"Text",required:!0,rows:10,value:r,style:{color:"hsl(var(--richtext-foreground))"}}),t.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:u},ref:w,style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"}})]})}),t.jsx(n.DialogFooter,{children:t.jsx(n.Button,{onClick:N,type:"button",children:"Save changes"})})]})]})};function U(e,i){const[o,a]=c.useState(void 0);return c.useEffect(()=>{const s=()=>{const r=e.extensionManager.extensions.find(l=>l.name===i);r&&a(r)};return e.on("selectionUpdate",s),e.on("transaction",s),()=>{e.off("selectionUpdate",s),e.off("transaction",s)}},[e,i]),o}function ee({item:e,disabled:i,editor:o}){var s;const a=e.component;return a?t.jsx(c.Fragment,{children:e.type==="divider"?t.jsx(n.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(a,{...e.componentProps,disabled:i||((s=e==null?void 0:e.componentProps)==null?void 0:s.disabled),editor:o})}):t.jsx(t.Fragment,{})}function te(e){return e.type.name==="mermaid"}function re(e){const{lang:i}=E.useLocale(),o=n.useAttributes(e.editor,L.Mermaid.name),a=U(e.editor,L.Mermaid.name),s=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let g=!1;return l.view.state.doc.nodesBetween(x.pos,f,w=>{if(te(w))return g=!0,!1}),g},r=c.useMemo(()=>e.disabled?[]:n.getBubbleMermaid(e.editor),[e.disabled,e.editor,i]);return t.jsx(t.Fragment,{children:t.jsx(n.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:s,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(o!=null&&o.src)?t.jsx(Y,{attrs:o,editor:e.editor,extension:a},`bubbleMenu-mermaid-${u}`):t.jsx(ee,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-mermaid-${u}`))})}):t.jsx(t.Fragment,{})})})}const v=new Map;function ne(e){const i=e.options.element;v.has("width")||v.set("width",i.clientWidth),v.has("width")&&v.get("width")<=0&&v.set("width",i.clientWidth);const o={attributes:!0,childList:!0,subtree:!0},a=function(){v.set("width",i.clientWidth)},s=new MutationObserver(a);return s.observe(i,o),e.on("destroy",()=>{s.disconnect()}),{width:v.get("width")}}function ie({editor:e}){const{t:i}=E.useLocale(),{width:o}=ne(e),a=n.useAttributes(e,M.Excalidraw.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:s,createUser:r,width:l,height:u}=a,x=c.useCallback(b=>{e.chain().updateAttributes(M.Excalidraw.name,b).setNodeSelection(e.state.selection.from).focus().run()},[e]),f=c.useCallback(()=>{M.triggerOpenExcalidrawSettingModal({...a,editor:e})},[e,a]),g=c.useCallback(()=>e.isActive(M.Excalidraw.name),[e]),w=c.useCallback(()=>n.deleteNode(M.Excalidraw.name,e),[e]);return c.useEffect(()=>{s&&(f(),e.chain().updateAttributes(M.Excalidraw.name,{defaultShowPicker:!1}).focus().run())},[r,s,e,f]),t.jsx(n.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:g,options:{placement:"bottom-start",offset:{alignmentAxis:6,crossAxis:6}},children:t.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[t.jsx(n.ActionButton,{action:f,icon:"Pencil",tooltip:i("editor.edit")}),t.jsx(n.SizeSetter,{height:u,maxWidth:o,onOk:x,width:l,children:t.jsx(n.ActionButton,{icon:"Settings",tooltip:i("editor.settings")})}),t.jsx(n.ActionButton,{action:w,icon:"Trash2",tooltip:i("editor.delete")})]})})}function se({editor:e,disabled:i}){const[o,a]=c.useState(!1),{t:s}=E.useLocale(),r=c.useCallback(({editor:x})=>x.isActive(F.Twitter.name),[]),l=x=>{e.commands.updateTweet({src:x}),a(!1)},u=c.useCallback(()=>n.deleteNode(F.Twitter.name,e),[e]);return t.jsx(t.Fragment,{children:t.jsx(n.BubbleMenu,{editor:e,shouldShow:r,options:{placement:"bottom-start",offset:{alignmentAxis:6,crossAxis:6}},children:i?t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{children:o?t.jsx(F.FormEditLinkTwitter,{editor:e,onSetLink:l}):t.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:t.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[t.jsx(n.ActionButton,{icon:"Pencil",tooltip:s("editor.link.edit.tooltip"),tooltipOptions:{sideOffset:15},action:()=>{a(!0)}}),t.jsx(n.ActionButton,{action:u,icon:"Trash",tooltip:s("editor.delete"),tooltipOptions:{sideOffset:15}})]})})})})})}function oe({editor:e,...i}){const o=n.useAttributes(e,T.Katex.name,{text:"",defaultShowPicker:!1}),{text:a,defaultShowPicker:s}=o,[r,l]=c.useState(""),[u,x]=c.useState(!1),f=c.useCallback(()=>e.isActive(T.Katex.name),[e]),g=c.useCallback(()=>n.deleteNode(T.Katex.name,e),[e]),w=c.useCallback(()=>{e.chain().focus().setKatex({text:r}).run(),x(!1)},[e,r]);c.useEffect(()=>{s&&(x(!0),e.chain().updateAttributes(T.Katex.name,{defaultShowPicker:!1}).focus().run())},[e,s,x]),c.useEffect(()=>{u&&l(a||"")},[u]);const b=c.useMemo(()=>{try{return X.renderToString(`${r}`)}catch{return r}},[r]),y=c.useMemo(()=>`${r}`.trim()?t.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:b||""}}):null,[r,b]);return t.jsx(n.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:f,options:{placement:"bottom-start",offset:{alignmentAxis:6,crossAxis:6}},children:i!=null&&i.disabled?t.jsx(t.Fragment,{}):t.jsx("div",{className:"richtext-rounded-lg !richtext-border richtext-border-neutral-200 richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:u?t.jsxs(t.Fragment,{children:[t.jsx(K.Textarea,{autoFocus:!0,defaultValue:a,onChange:S=>l(S.target.value),placeholder:"Formula text",rows:3,style:{marginBottom:8},value:r}),y&&t.jsx("div",{className:"richtext-my-[10px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:y}),t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[t.jsx(n.Button,{className:"richtext-flex-1",onClick:w,children:"Submit"}),t.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:t.jsx(W.HelpCircle,{size:16})})]})]}):t.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[t.jsx(n.ActionButton,{action:()=>x(!u),tooltip:"Edit",children:t.jsx(W.Pencil,{size:16})}),t.jsx(n.ActionButton,{action:g,tooltip:"Delete",children:t.jsx(W.Trash2,{size:16})})]})})})}let C=!1;function ce({editor:e,attrs:i,extension:o}){const[a,s]=c.useState(!1),r=c.useRef(null),l=c.useRef(null),{alt:u,align:x}=i,f=o==null?void 0:o.options.upload,g=()=>{(async()=>{const d=document.querySelector("#easydrawer");d&&(r.current=new R.Editor(d,{wheelEventsEnabled:!1,disableZoom:!0}),l.current=R.makeDropdownToolbar(r.current),l.current.addDefaultToolWidgets(),r.current.loadFromSVG(decodeURIComponent(u)))})()};c.useEffect(()=>{a&&setTimeout(()=>{g()},200)},[a]);const w=async()=>{if(r.current){const m=r.current.toSVG(),d=m.outerHTML,h=`drawer-${B.shortId()}.svg`;let P=B.i(m.outerHTML);if(f){const $=n.dataURLtoFile(P,h);P=await f($)}e==null||e.chain().focus().setDrawer({type:"drawer",src:P,alt:encodeURIComponent(d),width:426,height:212},!!d).run(),e==null||e.commands.setAlignImageDrawer(x)}s(!1)},b=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setColor(m),h.serializeState())},y=m=>{const d=r.current.toolController.getPrimaryTools()[2],h=l.current.getWidgetById("pen-1");d&&h&&(d.setThickness(m),h.serializeState())},S=m=>{const d=r.current.toolController.getPrimaryTools()[3],h=l.current.getWidgetById("pen-2");d&&h&&(d.setColor(m),h.serializeState())},A=m=>{const d=l.current.getWidgetById("shape");d&&d.setShapeType(m)},k=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setColor(m),h.serializeState())},D=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setThickness(m),h.serializeState())},N=m=>{const d=r.current.toolController.getPrimaryTools()[5],h=l.current.getWidgetById("shape");d&&h&&(d.setBorderColor(m),h.serializeState())},p=()=>{if(C){for(;r.current.history.redoStackSize>0;)r.current.history.redo();C=!1;return}r.current.history.undo()},j=()=>{C||r.current.history.redo()},I=()=>{if(!C){for(;r.current.history.undoStackSize>0;)p();C=!0}};return t.jsxs(n.Dialog,{onOpenChange:s,open:a,children:[t.jsx(n.DialogTrigger,{asChild:!0,children:t.jsx(n.ActionButton,{action:()=>s(!0),icon:"Pencil",tooltip:"Edit Drawer"})}),t.jsxs(n.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[t.jsx(n.DialogTitle,{children:"Edit Drawer"}),t.jsxs("div",{style:{height:"100%",borderWidth:1,background:"white",position:"relative"},children:[t.jsx("div",{className:"richtext-size-full",id:"easydrawer"}),t.jsx(z.ControlDrawer,{changeBorderColorShape:N,changeColorShape:k,changeShape:A,onClear:I,onRedo:j,onThicknessChange:D,onUndo:p,refEditor:r,setColorHighlight:S,setColorPen:b,setThicknessPen:y})]}),t.jsx(n.DialogFooter,{children:t.jsx(n.Button,{onClick:w,type:"button",children:"Save changes"})})]})]})}function ae({item:e,disabled:i,editor:o}){var s;const a=e.component;return a?t.jsx(c.Fragment,{children:e.type==="divider"?t.jsx(n.Separator,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):t.jsx(a,{...e.componentProps,disabled:i||((s=e==null?void 0:e.componentProps)==null?void 0:s.disabled),editor:o})}):t.jsx(t.Fragment,{})}function le(e){return e.type.name==="drawer"}function de(e){const{lang:i}=E.useLocale(),o=n.useAttributes(e.editor,z.Drawer.name),a=U(e.editor,z.Drawer.name),s=({editor:l})=>{const{selection:u}=l.view.state,{$from:x,to:f}=u;let g=!1;return l.view.state.doc.nodesBetween(x.pos,f,w=>{if(le(w))return g=!0,!1}),g},r=c.useMemo(()=>e.disabled?[]:n.getBubbleDrawer(e.editor),[e.disabled,e.editor,i]);return t.jsx(n.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:s,children:r!=null&&r.length?t.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:t.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:r==null?void 0:r.map((l,u)=>l.type==="edit"&&(o!=null&&o.src)?t.jsx(ce,{attrs:o,editor:e.editor,extension:a},`bubbleMenu-drawer-${u}`):t.jsx(ae,{disabled:e.disabled,editor:e.editor,item:l},`bubbleMenu-drawer-${u}`))})}):t.jsx(t.Fragment,{})})}exports.BubbleMenuDrawer=de;exports.BubbleMenuExcalidraw=ie;exports.BubbleMenuKatex=oe;exports.BubbleMenuMermaid=re;exports.BubbleMenuTwitter=se;
|