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
package/lib/Twitter-BvfvUtNT.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";const je=require("./index-ByRfqzMr.cjs"),M=require("./dom-dataset-Byuf1YmW.cjs"),n=require("react/jsx-runtime"),x=require("react"),H=require("./RichTextEditor-DWlLqTl9.cjs"),qt=require("./index-D_A0TBRA.cjs"),Dt="_verified_lvyh0_1",We={verified:Dt},$t=()=>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"})})}),At=()=>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"})]})]})}),Vt=()=>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"})})}),Mt="_root_98iqw_1",Bt="_article_98iqw_21",et={root:Mt,article:Bt},Fe=({className:e,children:t})=>n.jsx("div",{className:M.clsx("react-tweet-theme",et.root,e),children:n.jsx("article",{className:et.article,children:t})}),mt=e=>n.jsx("img",{...e}),Wt="_header_nqq4j_1",Ft="_avatar_nqq4j_11",Pt="_avatarOverflow_nqq4j_16",Ut="_avatarSquare_nqq4j_23",Ht="_avatarShadow_nqq4j_26",zt="_author_nqq4j_37",Gt="_authorLink_nqq4j_44",Kt="_authorVerified_nqq4j_53",Xt="_authorLinkText_nqq4j_56",Qt="_authorMeta_nqq4j_63",Jt="_authorFollow_nqq4j_66",Yt="_username_nqq4j_69",Zt="_follow_nqq4j_74",en="_separator_nqq4j_82",tn="_brand_nqq4j_86",nn="_twitterIcon_nqq4j_90",b={header:Wt,avatar:Ft,avatarOverflow:Pt,avatarSquare:Ut,avatarShadow:Ht,author:zt,authorLink:Gt,authorVerified:Kt,authorLinkText:Xt,authorMeta:Qt,authorFollow:Jt,username:Yt,follow:Zt,separator:en,brand:tn,twitterIcon:nn},rn="_verifiedOld_lcna5_1",sn="_verifiedBlue_lcna5_4",on="_verifiedGovernment_lcna5_7",we={verifiedOld:rn,verifiedBlue:sn,verifiedGovernment:on},pt=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx($t,{}),o=we.verifiedBlue;if(r)switch(e.is_blue_verified||(o=we.verifiedOld),e.verified_type){case"Government":s=n.jsx(Vt,{}),o=we.verifiedGovernment;break;case"Business":s=n.jsx(At,{}),o=null;break}return r?n.jsx("div",{className:M.clsx(t,o),children:s}):null},an=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:mt,{user:o}=e;return n.jsxs("div",{className:b.header,children:[n.jsxs("a",{href:e.url,className:b.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:M.clsx(b.avatarOverflow,o.profile_image_shape==="Square"&&b.avatarSquare),children:n.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),n.jsx("div",{className:b.avatarOverflow,children:n.jsx("div",{className:b.avatarShadow})})]}),n.jsxs("div",{className:b.author,children:[n.jsxs("a",{href:e.url,className:b.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:b.authorLinkText,children:n.jsx("span",{title:o.name,children:o.name})}),n.jsx(pt,{user:o,className:b.authorVerified})]}),n.jsxs("div",{className:b.authorMeta,children:[n.jsx("a",{href:e.url,className:b.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),n.jsxs("div",{className:b.authorFollow,children:[n.jsx("span",{className:b.separator,children:"·"}),n.jsx("a",{href:o.follow_url,className:b.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:b.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:b.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"})})})})]})},cn="_root_1ec15_1",ln={root:cn},un=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:ln.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),dn="_root_eihfa_1",fn={root:dn},_n=({href:e,children:t})=>n.jsx("a",{href:e,className:fn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),hn="_root_1xq52_1",mn={root:hn},pn=({tweet:e})=>n.jsx("p",{className:mn.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(_n,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),tt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,xn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,vn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,gn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,jn=e=>`https://x.com/hashtag/${e.text}`,wn=e=>`https://x.com/search?q=%24${e.text}`,yn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(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},Sn=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var i,a;return((i=o.bitrate)!=null?i:0)-((a=s.bitrate)!=null?a:0)})},Tn=e=>{const t=Sn(e);return t.length>1?t[1]:t[0]},Ie=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function nt(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ae(r,"hashtag",e.entities.hashtags),ae(r,"mention",e.entities.user_mentions),ae(r,"url",e.entities.urls),ae(r,"symbol",e.entities.symbols),e.entities.media&&ae(r,"media",e.entities.media),bn(e,r),r.map(s=>{const o=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:jn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:wn(s),text:o});default:return Object.assign(s,{text:o})}})}function ae(e,t,r){for(const s of r)for(const[o,i]of e.entries()){if(i.indices[0]>s.indices[0]||i.indices[1]<s.indices[1])continue;const a=[{...s,type:t}];i.indices[0]<s.indices[0]&&a.unshift({indices:[i.indices[0],s.indices[0]],type:"text"}),i.indices[1]>s.indices[1]&&a.push({indices:[s.indices[1],i.indices[1]],type:"text"}),e.splice(o,1,...a);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 En=e=>({...e,url:tt(e),user:{...e.user,url:xt(e),follow_url:gn(e)},like_url:xn(e),reply_url:vn(e),in_reply_to_url:e.in_reply_to_screen_name?yn(e):void 0,entities:nt(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:tt(e.quoted_tweet),entities:nt(e.quoted_tweet)}:void 0}),Rn="_root_g9tkv_1",On="_rounded_g9tkv_6",Nn="_mediaWrapper_g9tkv_10",Ln="_grid2Columns_g9tkv_17",kn="_grid3_g9tkv_20",In="_grid2x2_g9tkv_23",Cn="_mediaContainer_g9tkv_26",qn="_mediaLink_g9tkv_34",Dn="_skeleton_g9tkv_38",$n="_image_g9tkv_43",C={root:Rn,rounded:On,mediaWrapper:Nn,grid2Columns:Ln,grid3:kn,grid2x2:In,mediaContainer:Cn,mediaLink:qn,skeleton:Dn,image:$n},An="_anchor_fp31d_1",Vn="_videoButton_fp31d_17",Mn="_videoButtonIcon_fp31d_35",Bn="_watchOnTwitter_fp31d_44",Wn="_viewReplies_fp31d_60",se={anchor:An,videoButton:Vn,videoButtonIcon:Mn,watchOnTwitter:Bn,viewReplies:Wn},Fn=({tweet:e,media:t})=>{const[r,s]=x.useState(!0),[o,i]=x.useState(!1),[a,d]=x.useState(!1),p=Tn(t);let _=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:C.image,poster:vt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{_&&window.clearTimeout(_),o||i(!0),a&&d(!1)},onPause:()=>{_&&window.clearTimeout(_),_=window.setTimeout(()=>{o&&i(!1),_=0},100)},onEnded:()=>{d(!0)},children:n.jsx("source",{src:p.url,type:p.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:w=>{const u=w.currentTarget.previousSibling;w.preventDefault(),s(!1),u.load(),u.play().then(()=>{i(!0),u.focus()}).catch(h=>{console.error("Error playing video:",h),s(!0),i(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!a&&n.jsx("div",{className:se.watchOnTwitter,children:n.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),a&&n.jsx("a",{href:e.url,className:M.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Pn=e=>n.jsx("img",{...e}),rt=(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}%`}},gt=({tweet:e,components:t,quoted:r})=>{var s,o,i;const a=(i=(s=e.mediaDetails)==null?void 0:s.length)!=null?i:0;var d;const p=(d=t==null?void 0:t.MediaImg)!=null?d:Pn;return n.jsx("div",{className:M.clsx(C.root,!r&&C.rounded),children:n.jsx("div",{className:M.clsx(C.mediaWrapper,a>1&&C.grid2Columns,a===3&&C.grid3,a>4&&C.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(_=>n.jsx(x.Fragment,{children:_.type==="photo"?n.jsxs("a",{href:e.url,className:M.clsx(C.mediaContainer,C.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(p,{src:vt(_,"small"),alt:_.ext_alt_text||"Image",className:C.image,draggable:!0})]},_.media_url_https):n.jsxs("div",{className:C.mediaContainer,children:[n.jsx("div",{className:C.skeleton,style:rt(_,a)}),n.jsx(Fn,{tweet:e,media:_})]},_.media_url_https)},_.media_url_https))})})},Un={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Hn=new Intl.DateTimeFormat("en-US",Un),zn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Gn=e=>{const t=zn(Hn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},Kn="_root_i24yn_1",Xn={root:Kn},Qn=({tweet:e})=>{const t=new Date(e.created_at),r=Gn(t);return n.jsx("a",{className:Xn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},Jn="_info_19qcj_1",Yn="_infoLink_19qcj_10",Zn="_infoIcon_19qcj_30",ye={info:Jn,infoLink:Yn,infoIcon:Zn},er=({tweet:e})=>n.jsxs("div",{className:ye.info,children:[n.jsx(Qn,{tweet:e}),n.jsx("a",{className:ye.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:ye.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"})})})})]}),tr="_actions_n2anf_1",nr="_like_n2anf_13",rr="_reply_n2anf_14",sr="_copy_n2anf_15",or="_likeIconWrapper_n2anf_27",ir="_likeCount_n2anf_30",ar="_replyIconWrapper_n2anf_35",cr="_copyIconWrapper_n2anf_36",lr="_likeIcon_n2anf_27",ur="_replyIcon_n2anf_35",dr="_copyIcon_n2anf_36",fr="_replyText_n2anf_56",_r="_copyText_n2anf_57",L={actions:tr,like:nr,reply:rr,copy:sr,likeIconWrapper:or,likeCount:ir,replyIconWrapper:ar,copyIconWrapper:cr,likeIcon:lr,replyIcon:ur,copyIcon:dr,replyText:fr,copyText:_r},hr=({tweet:e})=>{const[t,r]=x.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return x.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[t]),n.jsxs("button",{type:"button",className:L.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:L.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:L.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:L.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:L.copyText,children:t?"Copied!":"Copy link"})]})},mr=({tweet:e})=>{const t=Ie(e.favorite_count);return n.jsxs("div",{className:L.actions,children:[n.jsxs("a",{className:L.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:L.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.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:L.likeCount,children:t})]}),n.jsxs("a",{className:L.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:L.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:L.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:L.replyText,children:"Reply"})]}),n.jsx(hr,{tweet:e})]})},pr="_replies_1cutb_1",xr="_link_1cutb_4",vr="_text_1cutb_23",Se={replies:pr,link:xr,text:vr},gr=({tweet:e})=>n.jsx("div",{className:Se.replies,children:n.jsx("a",{className:Se.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Se.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${Ie(e.conversation_count)} reply`:`Read ${Ie(e.conversation_count)} replies`})})}),jr="_root_q5799_1",wr="_article_q5799_16",st={root:jr,article:wr},yr=({tweet:e,children:t})=>n.jsx("div",{className:st.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:st.article,children:t})}),Sr="_header_r31i5_1",Tr="_avatar_r31i5_11",br="_avatarSquare_r31i5_17",Er="_author_r31i5_21",Rr="_authorText_r31i5_26",Or="_username_r31i5_33",Q={header:Sr,avatar:Tr,avatarSquare:br,author:Er,authorText:Rr,username:Or},Nr=({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:M.clsx(Q.avatarOverflow,t.profile_image_shape==="Square"&&Q.avatarSquare),children:n.jsx(mt,{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(pt,{user:t}),n.jsx("div",{className:Q.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Lr="_root_175ot_1",kr={root:Lr},Ir=({tweet:e})=>n.jsx("p",{className:kr.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(yr,{tweet:e,children:[n.jsx(Nr,{tweet:e}),n.jsx(Ir,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(gt,{quoted:!0,tweet:e}):null]})},qr=({tweet:e,components:t})=>{var r;const s=x.useMemo(()=>En(e),[e]);return n.jsxs(Fe,{children:[n.jsx(an,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(un,{tweet:s}),n.jsx(pn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(gt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Cr,{tweet:s.quoted_tweet}),n.jsx(er,{tweet:s}),n.jsx(mr,{tweet:s}),n.jsx(gr,{tweet:s})]})},Dr="_root_16yxa_1",$r={root:Dr},Ar=e=>n.jsx(Fe,{children:n.jsxs("div",{className:$r.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Vr="_skeleton_oi7hr_1",Mr={skeleton:Vr},_e=({style:e})=>n.jsx("span",{className:Mr.skeleton,style:e}),Br="_root_17qqv_1",Wr={root:Br},Fr=()=>n.jsxs(Fe,{className:Wr.root,children:[n.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(_e,{style:{height:"2rem"}}),n.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var he={exports:{}},Te={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* use-sync-external-store-shim.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ot;function Pr(){if(ot)return Te;ot=1;var e=x;function t(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function d(u,h){var l=h(),v=s({inst:{value:l,getSnapshot:h}}),f=v[0].inst,k=v[1];return i(function(){f.value=l,f.getSnapshot=h,p(f)&&k({inst:f})},[u,l,h]),o(function(){return p(f)&&k({inst:f}),u(function(){p(f)&&k({inst:f})})},[u]),a(l),l}function p(u){var h=u.getSnapshot;u=u.value;try{var l=h();return!r(u,l)}catch{return!0}}function _(u,h){return h()}var w=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_:d;return Te.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w,Te}var be={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* use-sync-external-store-shim.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var it;function Ur(){return it||(it=1,process.env.NODE_ENV!=="production"&&function(){function e(l,v){return l===v&&(l!==0||1/l===1/v)||l!==l&&v!==v}function t(l,v){w||o.startTransition===void 0||(w=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var f=v();if(!u){var k=v();i(f,k)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}k=a({inst:{value:f,getSnapshot:v}});var c=k[0].inst,P=k[1];return p(function(){c.value=f,c.getSnapshot=v,r(c)&&P({inst:c})},[l,f,v]),d(function(){return r(c)&&P({inst:c}),l(function(){r(c)&&P({inst:c})})},[l]),_(f),f}function r(l){var v=l.getSnapshot;l=l.value;try{var f=v();return!i(l,f)}catch{return!0}}function s(l,v){return v()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=x,i=typeof Object.is=="function"?Object.is:e,a=o.useState,d=o.useEffect,p=o.useLayoutEffect,_=o.useDebugValue,w=!1,u=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;be.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),be}var at;function Hr(){return at||(at=1,process.env.NODE_ENV==="production"?he.exports=Pr():he.exports=Ur()),he.exports}var zr=Hr();const jt=0,wt=1,yt=2,ct=3;var lt=Object.prototype.hasOwnProperty;function Ce(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--&&Ce(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(lt.call(e,r)&&++s&&!lt.call(t,r)||!(r in t)||!Ce(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const F=new WeakMap,z=()=>{},N=z(),qe=Object,m=e=>e===N,V=e=>typeof e=="function",G=(e,t)=>({...e,...t}),St=e=>V(e.then),Ee={},me={},Pe="undefined",le=typeof window!=Pe,De=typeof document!=Pe,Gr=le&&"Deno"in window,Kr=()=>le&&typeof window.requestAnimationFrame!=Pe,Tt=(e,t)=>{const r=F.get(e);return[()=>!m(t)&&e.get(t)||Ee,s=>{if(!m(t)){const o=e.get(t);t in me||(me[t]=o),r[5](t,G(o,s),o||Ee)}},r[6],()=>!m(t)&&t in me?me[t]:!m(t)&&e.get(t)||Ee]};let $e=!0;const Xr=()=>$e,[Ae,Ve]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[z,z],Qr=()=>{const e=De&&document.visibilityState;return m(e)||e!=="hidden"},Jr=e=>(De&&document.addEventListener("visibilitychange",e),Ae("focus",e),()=>{De&&document.removeEventListener("visibilitychange",e),Ve("focus",e)}),Yr=e=>{const t=()=>{$e=!0,e()},r=()=>{$e=!1};return Ae("online",t),Ae("offline",r),()=>{Ve("online",t),Ve("offline",r)}},Zr={isOnline:Xr,isVisible:Qr},es={initFocus:Jr,initReconnect:Yr},ut=!x.useId,ce=!le||Gr,ts=e=>Kr()?window.requestAnimationFrame(e):setTimeout(e,1),Re=ce?x.useEffect:x.useLayoutEffect,Oe=typeof navigator<"u"&&navigator.connection,dt=!ce&&Oe&&(["slow-2g","2g"].includes(Oe.effectiveType)||Oe.saveData),pe=new WeakMap,Ne=(e,t)=>qe.prototype.toString.call(e)===`[object ${t}]`;let ns=0;const Me=e=>{const t=typeof e,r=Ne(e,"Date"),s=Ne(e,"RegExp"),o=Ne(e,"Object");let i,a;if(qe(e)===e&&!r&&!s){if(i=pe.get(e),i)return i;if(i=++ns+"~",pe.set(e,i),Array.isArray(e)){for(i="@",a=0;a<e.length;a++)i+=Me(e[a])+",";pe.set(e,i)}if(o){i="#";const d=qe.keys(e).sort();for(;!m(a=d.pop());)m(e[a])||(i+=a+":"+Me(e[a])+",");pe.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Ue=e=>{if(V(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,t]};let rs=0;const Be=()=>++rs;async function bt(...e){const[t,r,s,o]=e,i=G({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let a=i.populateCache;const d=i.rollbackOnError;let p=i.optimisticData;const _=h=>typeof d=="function"?d(h):d!==!1,w=i.throwOnError;if(V(r)){const h=r,l=[],v=t.keys();for(const f of v)!/^\$(inf|sub)\$/.test(f)&&h(t.get(f)._k)&&l.push(f);return Promise.all(l.map(u))}return u(r);async function u(h){const[l]=Ue(h);if(!l)return;const[v,f]=Tt(t,l),[k,c,P,oe]=F.get(t),U=()=>{const D=k[l];return(V(i.revalidate)?i.revalidate(v().data,h):i.revalidate!==!1)&&(delete P[l],delete oe[l],D&&D[0])?D[0](yt).then(()=>v().data):v().data};if(e.length<3)return U();let E=s,I;const J=Be();c[l]=[J,0];const S=!m(p),Y=v(),$=Y.data,Z=Y._c,K=m(Z)?$:Z;if(S&&(p=V(p)?p(K,$):p,f({data:p,_c:K})),V(E))try{E=E(K)}catch(D){I=D}if(E&&St(E))if(E=await E.catch(D=>{I=D}),J!==c[l][0]){if(I)throw I;return E}else I&&S&&_(I)&&(a=!0,f({data:K,_c:N}));if(a&&!I)if(V(a)){const D=a(E,K);f({data:D,error:N,_c:N})}else f({data:E,error:N,_c:N});if(c[l][1]=Be(),Promise.resolve(U()).then(()=>{f({_c:N})}),I){if(w)throw I;return}return E}}const ft=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},ss=(e,t)=>{if(!F.has(e)){const r=G(es,t),s={},o=bt.bind(N,e);let i=z;const a={},d=(w,u)=>{const h=a[w]||[];return a[w]=h,h.push(u),()=>h.splice(h.indexOf(u),1)},p=(w,u,h)=>{e.set(w,u);const l=a[w];if(l)for(const v of l)v(u,h)},_=()=>{if(!F.has(e)&&(F.set(e,[s,{},{},{},o,p,d]),!ce)){const w=r.initFocus(setTimeout.bind(N,ft.bind(N,s,jt))),u=r.initReconnect(setTimeout.bind(N,ft.bind(N,s,wt)));i=()=>{w&&w(),u&&u(),F.delete(e)}}};return _(),[e,o,_,i]}return[e,F.get(e)[4]]},os=(e,t,r,s,o)=>{const i=r.errorRetryCount,a=o.retryCount,d=~~((Math.random()+.5)*(1<<(a<8?a:8)))*r.errorRetryInterval;!m(i)&&a>i||setTimeout(s,d,o)},is=Ce,[Et,as]=ss(new Map),cs=G({onLoadingSlow:z,onSuccess:z,onError:z,onErrorRetry:os,onDiscarded:z,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:is,isPaused:()=>!1,cache:Et,mutate:as,fallback:{}},Zr),ls=(e,t)=>{const r=G(e,t);if(t){const{use:s,fallback:o}=e,{use:i,fallback:a}=t;s&&i&&(r.use=s.concat(i)),o&&a&&(r.fallback=G(o,a))}return r},us=x.createContext({}),ds="$inf$",Rt=le&&window.__SWR_DEVTOOLS_USE__,fs=Rt?window.__SWR_DEVTOOLS_USE__:[],_s=()=>{Rt&&(window.__SWR_DEVTOOLS_REACT__=x)},hs=e=>V(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],ms=()=>G(cs,x.useContext(us)),ps=e=>(t,r,s)=>e(t,r&&((...i)=>{const[a]=Ue(t),[,,,d]=F.get(Et);if(a.startsWith(ds))return r(...i);const p=d[a];return m(p)?r(...i):(delete d[a],p)}),s),xs=fs.concat(ps),vs=e=>function(...r){const s=ms(),[o,i,a]=hs(r),d=ls(s,a);let p=e;const{use:_}=d,w=(_||[]).concat(xs);for(let u=w.length;u--;)p=w[u](p);return p(o,i||d.fetcher||null,d)},gs=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};_s();const Le=x.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}}),ke={dedupe:!0},js=(e,t,r)=>{const{cache:s,compare:o,suspense:i,fallbackData:a,revalidateOnMount:d,revalidateIfStale:p,refreshInterval:_,refreshWhenHidden:w,refreshWhenOffline:u,keepPreviousData:h}=r,[l,v,f,k]=F.get(s),[c,P]=Ue(e),oe=x.useRef(!1),U=x.useRef(!1),E=x.useRef(c),I=x.useRef(t),J=x.useRef(r),S=()=>J.current,Y=()=>S().isVisible()&&S().isOnline(),[$,Z,K,D]=Tt(s,c),ee=x.useRef({}).current,ue=m(a)?m(r.fallback)?N:r.fallback[c]:a,He=(g,j)=>{for(const R in ee){const y=R;if(y==="data"){if(!o(g[y],j[y])&&(!m(g[y])||!o(fe,j[y])))return!1}else if(j[y]!==g[y])return!1}return!0},ze=x.useMemo(()=>{const g=!c||!t?!1:m(d)?S().isPaused()||i?!1:p!==!1:d,j=O=>{const B=G(O);return delete B._k,g?{isValidating:!0,isLoading:!0,...B}:B},R=$(),y=D(),A=j(R),re=R===y?A:j(y);let T=A;return[()=>{const O=j($());return He(O,T)?(T.data=O.data,T.isLoading=O.isLoading,T.isValidating=O.isValidating,T.error=O.error,T):(T=O,O)},()=>re]},[s,c]),te=zr.useSyncExternalStore(x.useCallback(g=>K(c,(j,R)=>{He(R,j)||g()}),[s,c]),ze[0],ze[1]),Ge=!oe.current,Lt=l[c]&&l[c].length>0,ne=te.data,X=m(ne)?ue&&St(ue)?Le(ue):ue:ne,de=te.error,xe=x.useRef(X),fe=h?m(ne)?m(xe.current)?X:xe.current:ne:X,Ke=Lt&&!m(de)?!1:Ge&&!m(d)?d:S().isPaused()?!1:i?m(X)?!1:p:m(X)||p,Xe=!!(c&&t&&Ge&&Ke),kt=m(te.isValidating)?Xe:te.isValidating,It=m(te.isLoading)?Xe:te.isLoading,ie=x.useCallback(async g=>{const j=I.current;if(!c||!j||U.current||S().isPaused())return!1;let R,y,A=!0;const re=g||{},T=!f[c]||!re.dedupe,O=()=>ut?!U.current&&c===E.current&&oe.current:c===E.current,B={isValidating:!1,isLoading:!1},Je=()=>{Z(B)},Ye=()=>{const q=f[c];q&&q[1]===y&&delete f[c]},Ze={isValidating:!0};m($().data)&&(Ze.isLoading=!0);try{if(T&&(Z(Ze),r.loadingTimeout&&m($().data)&&setTimeout(()=>{A&&O()&&S().onLoadingSlow(c,r)},r.loadingTimeout),f[c]=[j(P),Be()]),[R,y]=f[c],R=await R,T&&setTimeout(Ye,r.dedupingInterval),!f[c]||f[c][1]!==y)return T&&O()&&S().onDiscarded(c),!1;B.error=N;const q=v[c];if(!m(q)&&(y<=q[0]||y<=q[1]||q[1]===0))return Je(),T&&O()&&S().onDiscarded(c),!1;const W=$().data;B.data=o(W,R)?W:R,T&&O()&&S().onSuccess(R,c,r)}catch(q){Ye();const W=S(),{shouldRetryOnError:ve}=W;W.isPaused()||(B.error=q,T&&O()&&(W.onError(q,c,W),(ve===!0||V(ve)&&ve(q))&&(!S().revalidateOnFocus||!S().revalidateOnReconnect||Y())&&W.onErrorRetry(q,c,W,Ct=>{const ge=l[c];ge&&ge[0]&&ge[0](ct,Ct)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return A=!1,Je(),!0},[c,s]),Qe=x.useCallback((...g)=>bt(s,E.current,...g),[]);if(Re(()=>{I.current=t,J.current=r,m(ne)||(xe.current=ne)}),Re(()=>{if(!c)return;const g=ie.bind(N,ke);let j=0;const y=gs(c,l,(A,re={})=>{if(A==jt){const T=Date.now();S().revalidateOnFocus&&T>j&&Y()&&(j=T+S().focusThrottleInterval,g())}else if(A==wt)S().revalidateOnReconnect&&Y()&&g();else{if(A==yt)return ie();if(A==ct)return ie(re)}});return U.current=!1,E.current=c,oe.current=!0,Z({_k:P}),Ke&&(m(X)||ce?g():ts(g)),()=>{U.current=!0,y()}},[c]),Re(()=>{let g;function j(){const y=V(_)?_($().data):_;y&&g!==-1&&(g=setTimeout(R,y))}function R(){!$().error&&(w||S().isVisible())&&(u||S().isOnline())?ie(ke).then(j):j()}return j(),()=>{g&&(clearTimeout(g),g=-1)}},[_,w,u,c]),x.useDebugValue(fe),i&&m(X)&&c){if(!ut&&ce)throw new Error("Fallback data is required when using Suspense in SSR.");I.current=t,J.current=r,U.current=!1;const g=k[c];if(!m(g)){const j=Qe(g);Le(j)}if(m(de)){const j=ie(ke);m(fe)||(j.status="fulfilled",j.value=!0),Le(j)}else throw de}return{mutate:Qe,get data(){return ee.data=!0,fe},get error(){return ee.error=!0,de},get isValidating(){return ee.isValidating=!0,kt},get isLoading(){return ee.isLoading=!0,It}}},_t=vs(js);class ws extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const ys=_t.default||_t,Ss="https://react-tweet.vercel.app";async function Ts([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new ws({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const bs=(e,t,r)=>{const{isLoading:s,data:o,error:i}=ys(()=>t||e?[t||e&&`${Ss}/api/tweet/${e}`,r]:null,Ts,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!i),data:o,error:i}},Es=({id:e,apiUrl:t,fallback:r=n.jsx(Fr,{}),components:s,fetchOptions:o,onError:i})=>{const{data:a,error:d,isLoading:p}=bs(e,t,o);if(p)return r;if(d||!a){const _=(s==null?void 0:s.TweetNotFound)||Ar;return n.jsx(_,{error:i?i(d):d})}return n.jsx(qr,{tweet:a,components:s})};function Rs({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(M.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Es,{id:r})})}):null}function Ot(e){const{t}=qt.useLocale(),[r,s]=x.useState("");x.useEffect(()=>{var i;if(e!=null&&e.editor){const{src:a}=(i=e.editor)==null?void 0:i.getAttributes(Nt.name);a&&s(a)}},[e==null?void 0:e.editor]);function o(i){i.preventDefault(),i.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:o,children:[n.jsx(H.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(H.Input,{className:"richtext-w-80",onChange:i=>s(i.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(H.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Os(e){function t(r){e.action&&e.action(r)}return n.jsxs(H.Popover,{modal:!0,children:[n.jsx(H.PopoverTrigger,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(H.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(H.IconComponent,{name:e==null?void 0:e.icon})})}),n.jsx(H.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Ot,{editor:e.editor,onSetLink:t})})]})}const Ns=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ls=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function ht(e){return e.match(Ls)}const Nt=je.Node.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({component:Os,componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return M.ReactNodeViewRenderer(Rs,{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})=>ht(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>ht(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[je.nodePasteRule({find:Ns,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",je.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Ot;exports.Twitter=Nt;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";const C=require("./index-ByRfqzMr.cjs"),ie=require("tippy.js"),d=require("react"),X=require("react-dom");class oe{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:f}){this.preventHide=!1,this.shouldShow=({view:s,state:p,from:c,to:l})=>{const{doc:u,selection:m}=p,{empty:v}=m,E=!u.textBetween(c,l).length&&C.isTextSelection(p.selection),y=this.element.contains(document.activeElement);return!(!(s.hasFocus()||y)||v||E||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var p;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((p=this.element.parentNode)===null||p===void 0)&&p.contains(s.relatedTarget))||(s==null?void 0:s.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,p)=>{const c=!(p!=null&&p.selection.eq(s.state.selection)),l=!(p!=null&&p.doc.eq(s.state.doc));!c&&!l||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,c,l,p)},this.updateDelay))},this.updateHandler=(s,p,c,l)=>{var u,m,v;const{state:E,composing:y}=s,{selection:_}=E;if(y||!p&&!c)return;this.createTooltip();const{ranges:D}=_,S=Math.min(...D.map(a=>a.$from.pos)),h=Math.max(...D.map(a=>a.$to.pos));if(!((u=this.shouldShow)===null||u===void 0?void 0:u.call(this,{editor:this.editor,element:this.element,view:s,state:E,oldState:l,from:S,to:h}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((v=this.tippyOptions)===null||v===void 0?void 0:v.getReferenceClientRect)||(()=>{if(C.isNodeSelection(E.selection)){let a=s.nodeDOM(S);if(a){const g=a.dataset.nodeViewWrapper?a:a.querySelector("[data-node-view-wrapper]");if(g&&(a=g.firstChild),a)return a.getBoundingClientRect()}}return C.posToDOMRect(s,S,h)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,f&&(this.shouldShow=f),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.element.tabIndex=0,!(this.tippy||!t)&&(this.tippy=ie(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),f=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,f,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Z=n=>new C.Plugin({key:typeof n.pluginKey=="string"?new C.PluginKey(n.pluginKey):n.pluginKey,view:e=>new oe({view:e,...n})});C.Extension.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Z({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function se(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var U={exports:{}},H={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* use-sync-external-store-shim.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var F;function ue(){if(F)return H;F=1;var n=d;function e(u,m){return u===m&&(u!==0||1/u===1/m)||u!==u&&m!==m}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,i=n.useEffect,o=n.useLayoutEffect,f=n.useDebugValue;function s(u,m){var v=m(),E=r({inst:{value:v,getSnapshot:m}}),y=E[0].inst,_=E[1];return o(function(){y.value=v,y.getSnapshot=m,p(y)&&_({inst:y})},[u,v,m]),i(function(){return p(y)&&_({inst:y}),u(function(){p(y)&&_({inst:y})})},[u]),f(v),v}function p(u){var m=u.getSnapshot;u=u.value;try{var v=m();return!t(u,v)}catch{return!0}}function c(u,m){return m()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return H.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:l,H}var B={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* use-sync-external-store-shim.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var K;function ae(){return K||(K=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=d,e=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(S){{for(var h=arguments.length,b=new Array(h>1?h-1:0),a=1;a<h;a++)b[a-1]=arguments[a];r("error",S,b)}}function r(S,h,b){{var a=e.ReactDebugCurrentFrame,g=a.getStackAddendum();g!==""&&(h+="%s",b=b.concat([g]));var w=b.map(function(O){return String(O)});w.unshift("Warning: "+h),Function.prototype.apply.call(console[S],console,w)}}function i(S,h){return S===h&&(S!==0||1/S===1/h)||S!==S&&h!==h}var o=typeof Object.is=="function"?Object.is:i,f=n.useState,s=n.useEffect,p=n.useLayoutEffect,c=n.useDebugValue,l=!1,u=!1;function m(S,h,b){l||n.startTransition!==void 0&&(l=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var a=h();if(!u){var g=h();o(a,g)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}var w=f({inst:{value:a,getSnapshot:h}}),O=w[0].inst,T=w[1];return p(function(){O.value=a,O.getSnapshot=h,v(O)&&T({inst:O})},[S,a,h]),s(function(){v(O)&&T({inst:O});var L=function(){v(O)&&T({inst:O})};return S(L)},[S]),c(a),a}function v(S){var h=S.getSnapshot,b=S.value;try{var a=h();return!o(b,a)}catch{return!0}}function E(S,h,b){return h()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!y,R=_?E:m,D=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:R;B.useSyncExternalStore=D,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),B}process.env.NODE_ENV==="production"?U.exports=ue():U.exports=ae();var A=U.exports;const de=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},ce=({contentComponent:n})=>{const e=A.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return d.createElement(d.Fragment,null,Object.values(e))};function le(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:X.createPortal(r.reactElement,r.element,t)},n.forEach(i=>i())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(i=>i())}}}class he extends d.Component{constructor(e){var t;super(e),this.editorContentRef=d.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((t=e.editor)===null||t===void 0)&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=le(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,innerRef:t,...r}=this.props;return d.createElement(d.Fragment,null,d.createElement("div",{ref:de(t,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&d.createElement(ce,{contentComponent:e.contentComponent}))}}const fe=d.forwardRef((n,e)=>{const t=d.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return d.createElement(he,{key:t,innerRef:e,...n})}),pe=d.memo(fe);var me=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(i=r;i--!==0;)if(!n(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!n(i[1],t.get(i[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(i=r;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){var f=o[i];if(!(f==="_owner"&&e.$$typeof)&&!n(e[f],t[f]))return!1}return!0}return e!==e&&t!==t},ve=se(me),q={exports:{}},j={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var z;function Se(){if(z)return j;z=1;var n=d,e=A;function t(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,o=n.useRef,f=n.useEffect,s=n.useMemo,p=n.useDebugValue;return j.useSyncExternalStoreWithSelector=function(c,l,u,m,v){var E=o(null);if(E.current===null){var y={hasValue:!1,value:null};E.current=y}else y=E.current;E=s(function(){function R(a){if(!D){if(D=!0,S=a,a=m(a),v!==void 0&&y.hasValue){var g=y.value;if(v(g,a))return h=g}return h=a}if(g=h,r(S,a))return g;var w=m(a);return v!==void 0&&v(g,w)?g:(S=a,h=w)}var D=!1,S,h,b=u===void 0?null:u;return[function(){return R(l())},b===null?void 0:function(){return R(b())}]},[l,u,m,v]);var _=i(c,E[0],E[1]);return f(function(){y.hasValue=!0,y.value=_},[_]),p(_),_},j}var P={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var G;function ye(){return G||(G=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=d,e=A;function t(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,o=n.useRef,f=n.useEffect,s=n.useMemo,p=n.useDebugValue;function c(l,u,m,v,E){var y=o(null),_;y.current===null?(_={hasValue:!1,value:null},y.current=_):_=y.current;var R=s(function(){var b=!1,a,g,w=function(M){if(!b){b=!0,a=M;var x=v(M);if(E!==void 0&&_.hasValue){var N=_.value;if(E(N,x))return g=N,N}return g=x,x}var re=a,V=g;if(r(re,M))return V;var I=v(M);return E!==void 0&&E(V,I)?V:(a=M,g=I,I)},O=m===void 0?null:m,T=function(){return w(u())},L=O===null?void 0:function(){return w(O())};return[T,L]},[u,m,v,E]),D=R[0],S=R[1],h=i(l,D,S);return f(function(){_.hasValue=!0,_.value=h},[h]),p(h),h}P.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),P}process.env.NODE_ENV==="production"?q.exports=Se():q.exports=ye();var Ee=q.exports;const _e=typeof window<"u"?d.useLayoutEffect:d.useEffect;class ge{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",t),()=>{r.off("transaction",t)}}}}function be(n){var e;const[t]=d.useState(()=>new ge(n.editor)),r=Ee.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!==null&&e!==void 0?e:ve);return _e(()=>t.watch(n.editor),[n.editor,t]),d.useDebugValue(r),r}const J=process.env.NODE_ENV!=="production",W=typeof window>"u",Oe=W||!!(typeof window<"u"&&window.next);class ${constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return W||Oe?(J&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&W&&J)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...r)}};return new C.Editor(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((i,o)=>{var f;return i===((f=t.extensions)===null||f===void 0?void 0:f[o])}):e[r]===t[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?$.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function we(n={},e=[]){const t=d.useRef(n);t.current=n;const[r]=d.useState(()=>new $(t)),i=A.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return d.useDebugValue(i),d.useEffect(r.onRender(e)),be({editor:i,selector:({transactionNumber:o})=>n.shouldRerenderOnTransaction===!1?null:n.immediatelyRender&&o===0?0:o+1}),i}const k=d.createContext({editor:null});k.Consumer;const De=()=>d.useContext(k),Ce=n=>{const[e,t]=d.useState(null),{editor:r}=De();return d.useEffect(()=>{var i;if(!e||!((i=n.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:f,tippyOptions:s={},updateDelay:p,shouldShow:c=null}=n,l=f||r;if(!l){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const u=Z({updateDelay:p,editor:l,element:e,pluginKey:o,shouldShow:c,tippyOptions:s});return l.registerPlugin(u),()=>{l.unregisterPlugin(o)}},[n.editor,r,e]),d.createElement("div",{ref:t,className:n.className,style:{visibility:"hidden"}},n.children)},ee=d.createContext({onDragStart:void 0}),Re=()=>d.useContext(ee),Te=d.forwardRef((n,e)=>{const{onDragStart:t}=Re(),r=n.as||"div";return d.createElement(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function Y(n){return!!(typeof n=="function"&&n.prototype&&n.prototype.isReactComponent)}function Q(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.forward_ref)"||n.$$typeof.description==="react.forward_ref"))}function Me(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.memo)"||n.$$typeof.description==="react.memo"))}function Ae(n){if(Y(n)||Q(n))return!0;if(Me(n)){const e=n.type;if(e)return Y(e)||Q(e)}return!1}function Le(){try{if(d.version)return parseInt(d.version.split(".")[0],10)>=19}catch{}return!1}class te{constructor(e,{editor:t,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?X.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var e;const t=this.component,r=this.props,i=this.editor,o=Le(),f=Ae(t),s={...r};s.ref&&!(o||f)&&delete s.ref,!s.ref&&(o||f)&&(s.ref=p=>{this.ref=p}),this.reactElement=d.createElement(t,{...s}),(e=i==null?void 0:i.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const t=this.editor;(e=t==null?void 0:t.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}}class xe extends C.NodeView{constructor(e,t,r){if(super(e,t,r),!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const i=this.dom.querySelector("[data-node-view-content]");if(!i)return;i.appendChild(this.contentDOMElement)}}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode(),ref:d.createRef()};if(!this.component.displayName){const c=l=>l.charAt(0).toUpperCase()+l.substring(1);this.component.displayName=c(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&(c.hasAttribute("data-node-view-wrapper")&&c.removeAttribute("data-node-view-wrapper"),c.appendChild(this.contentDOMElement))}},o=this.component,f=d.memo(c=>d.createElement(ee.Provider,{value:i},d.createElement(o,c)));f.displayName="ReactNodeView";let s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);const{className:p=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new te(f,{editor:this.editor,props:e,as:s,className:`node-${this.node.type.name} ${p}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:t}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&t>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,r){const i=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,f=this.decorations,s=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:f,newNode:e,newDecorations:t,oldInnerDecorations:s,innerDecorations:r,updateProps:()=>i({node:e,decorations:t,innerDecorations:r})})}return e===this.node&&this.decorations===t&&this.innerDecorations===r||(this.node=e,this.decorations=t,this.innerDecorations=r,i({node:e,decorations:t,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const t=this.editor.extensionManager.attributes,r=C.getRenderedAttributes(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function Ne(n,e){return t=>t.editor.contentComponent?new xe(n,t,e):{}}function ne(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=ne(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Ve(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=ne(n))&&(r&&(r+=" "),r+=e);return r}function Ie(n){try{return JSON.stringify(n)}catch{return JSON.stringify({})}}function He(n,e=!1){return t=>{const r=n.startsWith("data-")?n:`data-${n}`;let i=decodeURIComponent(t.getAttribute(r));if(i==null||typeof i=="string"&&i==="null")try{const s=t.outerHTML.match(/([\S\s])+?="([\S\s])+?"/g);s&&s.length>0&&(i=(s.map(c=>c.trim()).reduce((c,l)=>{const u=l.indexOf("="),m=[l.slice(0,u),l.slice(u+1).slice(1,-1)];return c[m[0]]=m[1],c},{})[n.toLowerCase()]||"").replaceAll(""",'"'))}catch(f){console.error("Error getDatasetAttribute ",f.message,t)}if(e)try{return JSON.parse(i)}catch{return{}}if(i.includes("%")||i.includes("auto"))return i;const o=Number.parseInt(i);return o!==o?i:o}}function Be(n){const{attrs:e}=n;return Object.keys(e).reduce((t,r)=>{const i=e[r];if(i==null)return t;let o="";return typeof i=="object"?o=Ie(i):o=i,t[r]=o,t},Object.create(null))}exports.BubbleMenu=Ce;exports.EditorContent=pe;exports.NodeViewWrapper=Te;exports.ReactNodeViewRenderer=Ne;exports.ReactRenderer=te;exports.clsx=Ve;exports.getDatasetAttribute=He;exports.nodeAttrsToDataset=Be;exports.useEditor=we;
|