reactjs-tiptap-editor 1.0.1 → 1.0.2
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/lib/{ActionMenuButton-DLQyd_gx.cjs → ActionMenuButton-BRWFTb3V.cjs} +1 -1
- package/lib/{ActionMenuButton-BKOg7hkq.js → ActionMenuButton-DgjFjzC8.js} +8 -8
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +27 -29
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +4 -4
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +7 -7
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +4 -4
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +7 -7
- package/lib/CodeBlock.cjs +36 -36
- package/lib/CodeBlock.js +593 -596
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +4 -4
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +9 -9
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +9 -9
- package/lib/Drawer-1_PmP-H0.cjs +1 -0
- package/lib/{Drawer-DZ5jvmrX.js → Drawer-DNnkwfnI.js} +48 -49
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +5 -6
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +155 -150
- package/lib/Excalidraw-DreGyrmJ.cjs +1 -0
- package/lib/Excalidraw-StBAUhjt.js +355 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +4 -5
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +4 -4
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +4 -4
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +6 -6
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +6 -6
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +6 -6
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +9 -9
- package/lib/History.cjs +1 -1
- package/lib/History.js +36 -36
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +4 -4
- package/lib/{Icon-DUpv2cI6.cjs → Icon-B9hI3gal.cjs} +1 -1
- package/lib/{Icon-jKs8Hr6p.js → Icon-D3AdnMCj.js} +2 -2
- package/lib/Iframe-BDm-w-lg.cjs +1 -0
- package/lib/{Iframe-CmXkEqOd.js → Iframe-BIgQtyZo.js} +26 -28
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +4 -5
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +208 -229
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +98 -91
- package/lib/ImportWord.cjs +28 -28
- package/lib/ImportWord.js +5 -5
- package/lib/Indent-BzyTbroV.cjs +1 -0
- package/lib/Indent-CnPAv7eT.js +153 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +4 -149
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +4 -4
- package/lib/Katex-BE_GROI2.cjs +4 -0
- package/lib/{Katex-DsYXsjSS.js → Katex-D-SUWkkU.js} +771 -783
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +4 -5
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +17 -17
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-5NRB9DRC.cjs +5 -0
- package/lib/{LinkEditBlock-CB8yIffE.js → LinkEditBlock-DcxIMK_D.js} +221 -221
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +17 -19
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +24 -26
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +16 -16
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +4 -4
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +52 -52
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +125 -120
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +4 -4
- package/lib/Table-BYg26eMf.cjs +9 -0
- package/lib/{Table-Db8TcQX8.js → Table-DtC2-bqx.js} +30 -30
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +4 -4
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +14 -13
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +7 -7
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +4 -4
- package/lib/{Twitter-CXmmjz9R.js → Twitter-B3n8vc45.js} +73 -75
- package/lib/Twitter-DJ6JzZPJ.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -4
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +41 -33
- package/lib/bubble.cjs +4 -2
- package/lib/bubble.d.ts +1 -310
- package/lib/bubble.js +8782 -1104
- package/lib/button-BTnV4TZ7.cjs +1 -0
- package/lib/{button-DXMsXUEn.js → button-DHZeIKzF.js} +6 -6
- package/lib/checkbox-BoBTXwkF.cjs +1 -0
- package/lib/checkbox-Dm8Nfwg8.js +27 -0
- package/lib/components/ActionButton.d.ts +23 -0
- package/lib/components/ActionMenuButton.d.ts +28 -0
- package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleKatex.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleLink.d.ts +6 -0
- package/lib/components/Bubble/RichTextBubbleMedia.d.ts +4 -0
- package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleTable.d.ts +5 -0
- package/lib/components/Bubble/RichTextBubbleText.d.ts +5 -0
- package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -0
- package/lib/components/Bubble/formatBubble.d.ts +55 -0
- package/lib/components/Bubble/index.d.ts +12 -0
- package/lib/components/ColorPicker.d.ts +11 -0
- package/lib/components/RichTextProvider.d.ts +8 -0
- package/lib/components/SizeSetter/SizeSetter.d.ts +13 -0
- package/lib/components/icons/Activity.d.ts +2 -0
- package/lib/components/icons/Animas.d.ts +2 -0
- package/lib/components/icons/AspectRatio.d.ts +2 -0
- package/lib/components/icons/Blockquote.d.ts +2 -0
- package/lib/components/icons/CodeView.d.ts +1 -0
- package/lib/components/icons/ColumnAddLeft.d.ts +1 -0
- package/lib/components/icons/ColumnAddRight.d.ts +1 -0
- package/lib/components/icons/DeleteColumn.d.ts +2 -0
- package/lib/components/icons/DeleteRow.d.ts +2 -0
- package/lib/components/icons/Direction.d.ts +1 -0
- package/lib/components/icons/Excalidraw.d.ts +1 -0
- package/lib/components/icons/ExportPdf.d.ts +1 -0
- package/lib/components/icons/ExportWord.d.ts +2 -0
- package/lib/components/icons/FileWordOutline.d.ts +2 -0
- package/lib/components/icons/Flag.d.ts +2 -0
- package/lib/components/icons/Food.d.ts +2 -0
- package/lib/components/icons/GIfIcon.d.ts +1 -0
- package/lib/components/icons/Html.d.ts +1 -0
- package/lib/components/icons/Icon.d.ts +8 -0
- package/lib/components/icons/IconColorFill.d.ts +5 -0
- package/lib/components/icons/IconHighlightFill.d.ts +3 -0
- package/lib/components/icons/ImportWord.d.ts +2 -0
- package/lib/components/icons/LeftToRight.d.ts +1 -0
- package/lib/components/icons/LineHeight.d.ts +2 -0
- package/lib/components/icons/MenuDown.d.ts +2 -0
- package/lib/components/icons/Mermaid.d.ts +1 -0
- package/lib/components/icons/NoFill.d.ts +1 -0
- package/lib/components/icons/Object.d.ts +2 -0
- package/lib/components/icons/RightToLeft.d.ts +1 -0
- package/lib/components/icons/SizeL.d.ts +2 -0
- package/lib/components/icons/SizeM.d.ts +2 -0
- package/lib/components/icons/SizeS.d.ts +2 -0
- package/lib/components/icons/Symbol.d.ts +2 -0
- package/lib/components/icons/Travel.d.ts +2 -0
- package/lib/components/icons/Twitter.d.ts +1 -0
- package/lib/components/icons/icons.d.ts +1 -0
- package/lib/components/icons/index.d.ts +12 -0
- package/lib/components/index.d.ts +6 -0
- package/lib/components/ui/button.d.ts +11 -0
- package/lib/components/ui/checkbox.d.ts +4 -0
- package/lib/components/ui/dialog.d.ts +19 -0
- package/lib/components/ui/dropdown-menu.d.ts +27 -0
- package/lib/components/ui/emoji-picker.d.ts +7 -0
- package/lib/components/ui/index.d.ts +14 -0
- package/lib/components/ui/input.d.ts +5 -0
- package/lib/components/ui/label.d.ts +5 -0
- package/lib/components/ui/popover.d.ts +6 -0
- package/lib/components/ui/select.d.ts +13 -0
- package/lib/components/ui/separator.d.ts +4 -0
- package/lib/components/ui/switch.d.ts +4 -0
- package/lib/components/ui/tabs.d.ts +7 -0
- package/lib/components/ui/textarea.d.ts +5 -0
- package/lib/components/ui/toast.d.ts +15 -0
- package/lib/components/ui/toaster.d.ts +1 -0
- package/lib/components/ui/toggle.d.ts +12 -0
- package/lib/components/ui/tooltip.d.ts +7 -0
- package/lib/components/ui/use-toast.d.ts +44 -0
- package/lib/constants/index.d.ts +47 -0
- package/lib/constants/resetCSS.d.ts +1 -0
- package/lib/dialog-DXF2Q8LZ.cjs +1 -0
- package/lib/dialog-xrO7nV_z.js +101 -0
- package/lib/dropdown-menu-Bh-wEgI8.cjs +1 -0
- package/lib/{dropdown-menu-BPp2Z_U-.js → dropdown-menu-ByeBPPyv.js} +32 -26
- package/lib/events.constant-B-VGURJp.cjs +1 -0
- package/lib/events.constant-CBPIqO_g.js +25 -0
- package/lib/extensions/Attachment/Attachment.d.ts +15 -0
- package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -0
- package/lib/extensions/Attachment/components/NodeViewAttachment/FileIconString.d.ts +1 -0
- package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -0
- package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -0
- package/lib/extensions/Attachment/index.d.ts +1 -0
- package/lib/extensions/Blockquote/Blockquote.d.ts +6 -0
- package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -0
- package/lib/extensions/Blockquote/index.d.ts +1 -0
- package/lib/extensions/Bold/Bold.d.ts +6 -0
- package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -0
- package/lib/extensions/Bold/index.d.ts +1 -0
- package/lib/extensions/BulletList/BulletList.d.ts +6 -0
- package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -0
- package/lib/extensions/BulletList/index.d.ts +1 -0
- package/lib/extensions/Clear/Clear.d.ts +6 -0
- package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -0
- package/lib/extensions/Clear/index.d.ts +1 -0
- package/lib/extensions/Code/Code.d.ts +6 -0
- package/lib/extensions/Code/components/RichTextCode.d.ts +1 -0
- package/lib/extensions/Code/index.d.ts +1 -0
- package/lib/extensions/CodeBlock/CodeBlock.d.ts +21 -0
- package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +1 -0
- package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +1 -0
- package/lib/extensions/CodeBlock/index.d.ts +1 -0
- package/lib/extensions/CodeView/CodeView.d.ts +17 -0
- package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -0
- package/lib/extensions/CodeView/index.d.ts +1 -0
- package/lib/extensions/Color/Color.d.ts +22 -0
- package/lib/extensions/Color/components/RichTextColor.d.ts +1 -0
- package/lib/extensions/Color/index.d.ts +1 -0
- package/lib/extensions/Column/Column.d.ts +17 -0
- package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -0
- package/lib/extensions/Column/index.d.ts +1 -0
- package/lib/extensions/Drawer/Drawer.d.ts +15 -0
- package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -0
- package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +28 -0
- package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -0
- package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +1 -0
- package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -0
- package/lib/extensions/Drawer/index.d.ts +1 -0
- package/lib/extensions/Emoji/Emoji.d.ts +3 -0
- package/lib/extensions/Emoji/components/EmojiList/EmojiNodeView.d.ts +3 -0
- package/lib/extensions/Emoji/components/EmojiList/emojis.d.ts +4 -0
- package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +1 -0
- package/lib/extensions/Emoji/index.d.ts +1 -0
- package/lib/extensions/Excalidraw/Excalidraw.d.ts +17 -0
- package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -0
- package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -0
- package/lib/extensions/Excalidraw/index.d.ts +1 -0
- package/lib/extensions/ExportPdf/ExportPdf.d.ts +21 -0
- package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -0
- package/lib/extensions/ExportPdf/index.d.ts +1 -0
- package/lib/extensions/ExportWord/ExportWord.d.ts +13 -0
- package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -0
- package/lib/extensions/ExportWord/index.d.ts +1 -0
- package/lib/extensions/FontFamily/FontFamily.d.ts +10 -0
- package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +15 -0
- package/lib/extensions/FontFamily/index.d.ts +1 -0
- package/lib/extensions/FontSize/FontSize.d.ts +32 -0
- package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +12 -0
- package/lib/extensions/FontSize/index.d.ts +1 -0
- package/lib/extensions/Heading/Heading.d.ts +6 -0
- package/lib/extensions/Heading/components/RichTextHeading.d.ts +15 -0
- package/lib/extensions/Heading/index.d.ts +1 -0
- package/lib/extensions/Highlight/Highlight.d.ts +18 -0
- package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +1 -0
- package/lib/extensions/Highlight/index.d.ts +1 -0
- package/lib/extensions/History/History.d.ts +6 -0
- package/lib/extensions/History/components/RichTextHistory.d.ts +2 -0
- package/lib/extensions/History/index.d.ts +1 -0
- package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +6 -0
- package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -0
- package/lib/extensions/HorizontalRule/index.d.ts +1 -0
- package/lib/extensions/Iframe/Iframe.d.ts +16 -0
- package/lib/extensions/Iframe/components/IframeNodeView.d.ts +2 -0
- package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -0
- package/lib/extensions/Iframe/index.d.ts +1 -0
- package/lib/extensions/Iframe/utils.d.ts +9 -0
- package/lib/extensions/Image/Image.d.ts +56 -0
- package/lib/extensions/Image/components/ImageCropper.d.ts +1 -0
- package/lib/extensions/Image/components/ImageView.d.ts +2 -0
- package/lib/extensions/Image/components/RichTextImage.d.ts +1 -0
- package/lib/extensions/Image/index.d.ts +1 -0
- package/lib/extensions/Image/store.d.ts +4 -0
- package/lib/extensions/ImageGif/ImageGif.d.ts +39 -0
- package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -0
- package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +1 -0
- package/lib/extensions/ImageGif/components/services.d.ts +458 -0
- package/lib/extensions/ImageGif/index.d.ts +1 -0
- package/lib/extensions/ImportWord/ImportWord.d.ts +18 -0
- package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -0
- package/lib/extensions/ImportWord/index.d.ts +1 -0
- package/lib/extensions/Indent/Indent.d.ts +23 -0
- package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -0
- package/lib/extensions/Indent/index.d.ts +1 -0
- package/lib/extensions/Italic/Italic.d.ts +6 -0
- package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -0
- package/lib/extensions/Italic/index.d.ts +1 -0
- package/lib/extensions/Katex/Katex.d.ts +17 -0
- package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -0
- package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -0
- package/lib/extensions/Katex/index.d.ts +1 -0
- package/lib/extensions/LineHeight/LineHeight.d.ts +7 -0
- package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -0
- package/lib/extensions/LineHeight/index.d.ts +1 -0
- package/lib/extensions/Link/Link.d.ts +6 -0
- package/lib/extensions/Link/components/LinkEditBlock.d.ts +8 -0
- package/lib/extensions/Link/components/LinkViewBlock.d.ts +8 -0
- package/lib/extensions/Link/components/RichTextLink.d.ts +1 -0
- package/lib/extensions/Link/index.d.ts +1 -0
- package/lib/extensions/Mention/Mention.d.ts +1 -0
- package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +10 -0
- package/lib/extensions/Mention/index.d.ts +1 -0
- package/lib/extensions/Mermaid/Mermaid.d.ts +15 -0
- package/lib/extensions/Mermaid/components/EditMermaidBlock.d.ts +8 -0
- package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +1 -0
- package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -0
- package/lib/extensions/Mermaid/index.d.ts +1 -0
- package/lib/extensions/MoreMark/MoreMark.d.ts +20 -0
- package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +14 -0
- package/lib/extensions/MoreMark/index.d.ts +1 -0
- package/lib/extensions/OrderedList/OrderedList.d.ts +6 -0
- package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -0
- package/lib/extensions/OrderedList/index.d.ts +1 -0
- package/lib/extensions/SearchAndReplace/SearchAndReplace.d.ts +36 -0
- package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -0
- package/lib/extensions/SearchAndReplace/index.d.ts +1 -0
- package/lib/extensions/SlashCommand/SlashCommand.d.ts +4 -0
- package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +6 -0
- package/lib/extensions/SlashCommand/components/SlashCommandNodeView.d.ts +3 -0
- package/lib/extensions/SlashCommand/index.d.ts +1 -0
- package/lib/extensions/SlashCommand/renderCommandListDefault.d.ts +7 -0
- package/lib/extensions/SlashCommand/types.d.ts +19 -0
- package/lib/extensions/Strike/Strike.d.ts +6 -0
- package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -0
- package/lib/extensions/Strike/index.d.ts +1 -0
- package/lib/extensions/Table/Table.d.ts +21 -0
- package/lib/extensions/Table/TableCellBackground.d.ts +14 -0
- package/lib/extensions/Table/components/CreateTablePopover.d.ts +7 -0
- package/lib/extensions/Table/components/RichTextTable.d.ts +1 -0
- package/lib/extensions/Table/index.d.ts +1 -0
- package/lib/extensions/TaskList/TaskList.d.ts +11 -0
- package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -0
- package/lib/extensions/TaskList/index.d.ts +1 -0
- package/lib/extensions/TextAlign/TextAlign.d.ts +17 -0
- package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +14 -0
- package/lib/extensions/TextAlign/index.d.ts +1 -0
- package/lib/extensions/TextDirection/TextDirection.d.ts +5 -0
- package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +15 -0
- package/lib/extensions/TextDirection/index.d.ts +1 -0
- package/lib/extensions/TextUnderline/TextUnderline.d.ts +6 -0
- package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -0
- package/lib/extensions/TextUnderline/index.d.ts +1 -0
- package/lib/extensions/Twitter/Twitter.d.ts +46 -0
- package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +6 -0
- package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +8 -0
- package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -0
- package/lib/extensions/Twitter/index.d.ts +1 -0
- package/lib/extensions/Video/Video.d.ts +66 -0
- package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -0
- package/lib/extensions/Video/index.d.ts +1 -0
- package/lib/extensions/Video/store.d.ts +4 -0
- package/lib/hooks/useActive.d.ts +21 -0
- package/lib/hooks/useAttributes.d.ts +2 -0
- package/lib/hooks/useButtonProps.d.ts +1 -0
- package/lib/hooks/useCopy.d.ts +5 -0
- package/lib/hooks/useExtension.d.ts +1 -0
- package/lib/hooks/useLocalStorage.d.ts +13 -0
- package/lib/index-B0fWAhpK.cjs +1 -0
- package/lib/{icons-Cllpys39.js → index-BQ17A_37.js} +173 -142
- package/lib/{index-Bnmd0WvY.js → index-BeUrdBxf.js} +23 -23
- package/lib/{index-DYkucCoF.js → index-CEbbM7Gx.js} +57 -76
- package/lib/{index-BPfVXs5_.js → index-ClAEwR0V.js} +580 -403
- package/lib/{index-CBce_TWY.js → index-D-FhWysc.js} +1 -1
- package/lib/{index-DzvuNTxo.cjs → index-DCJheRBq.cjs} +1 -1
- package/lib/index-DLqogznp.cjs +54 -0
- package/lib/index-DM3mpxB-.cjs +7 -0
- package/lib/index-DmOTQudI.cjs +1 -0
- package/lib/{index-N--9MohJ.cjs → index-DylewabB.cjs} +1 -1
- package/lib/{index-D-5U8dY8.cjs → index-TMqmkmT6.cjs} +1 -1
- package/lib/index-nFjllrEl.js +7390 -0
- package/lib/{index-D2TUfKkC.js → index-prphFVsp.js} +1 -1
- package/lib/index.cjs +3 -27
- package/lib/index.d.ts +1 -279
- package/lib/index.js +22 -129
- package/lib/input-CadAYBdT.cjs +1 -0
- package/lib/input-U-XBy56K.js +21 -0
- package/lib/{isNumber-ClPupm7P.cjs → isNumber-C2saEiG2.cjs} +1 -1
- package/lib/{isNumber-fpLGS0AZ.js → isNumber-CTm1pIvN.js} +1 -1
- package/lib/label-23SJWQ49.js +19 -0
- package/lib/label-C09fAh5p.cjs +1 -0
- package/lib/lib/utils.d.ts +2 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.ts +1 -6722
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/en.d.ts +179 -0
- package/lib/locales/fi.d.ts +179 -0
- package/lib/locales/hu.d.ts +179 -0
- package/lib/{locale-bundle.d.cts → locales/index.d.ts} +5365 -6707
- package/lib/locales/pt-br.d.ts +179 -0
- package/lib/locales/vi.d.ts +179 -0
- package/lib/locales/zh-cn.d.ts +179 -0
- package/lib/plugins/image-upload.d.ts +13 -0
- package/lib/popover-C64cn4Pd.cjs +1 -0
- package/lib/{popover-CAuEW0Mr.js → popover-ydZ2mHXy.js} +7 -6
- package/lib/separator-BoKhvBG9.cjs +1 -0
- package/lib/separator-DqqiRHfY.js +241 -0
- package/lib/store/ProviderUniqueId.d.ts +6 -0
- package/lib/store/commandList.d.ts +2 -0
- package/lib/store/editor.d.ts +21 -0
- package/lib/store/fast-context.d.ts +7 -0
- package/lib/store/store.d.ts +23 -0
- package/lib/store-BPiGnThe.cjs +1 -0
- package/lib/store-Cu0gDf4G.js +10 -0
- package/lib/style.css +1 -1
- package/lib/{tabs-B5mVSN1I.js → tabs-BiYU230B.js} +3 -3
- package/lib/{tabs-BoLCMcCI.cjs → tabs-DebGjFBg.cjs} +1 -1
- package/lib/{textarea-DUUM1jZd.js → textarea--_-Ve3AB.js} +3 -3
- package/lib/textarea-BIkB9h_0.cjs +1 -0
- package/lib/theme/theme.d.ts +364 -0
- package/lib/theme.cjs +1 -0
- package/lib/theme.js +372 -0
- package/lib/{throttle-CdwDrFpn.js → throttle-CGM5M2yG.js} +10 -10
- package/lib/{throttle-qX7Yjtsg.cjs → throttle-DXN-aiH5.cjs} +1 -1
- package/lib/toggle-BWfca8kh.cjs +1 -0
- package/lib/{toggle-Cdp4IT2U.js → toggle-Crvm3Tcn.js} +20 -13
- package/lib/tooltip-9jtsGIcX.cjs +1 -0
- package/lib/tooltip-D_0vo9Xj.js +24 -0
- package/lib/types.d.ts +230 -0
- package/lib/{updatePosition-8Sdem5jb.cjs → updatePosition-C17CDdjq.cjs} +1 -1
- package/lib/{updatePosition-BPmcE0YD.js → updatePosition-DpMKxYdN.js} +1 -1
- package/lib/useButtonProps--5ytUuGi.js +136 -0
- package/lib/useButtonProps-DJ51kDtM.cjs +1 -0
- package/lib/utils/_event.d.ts +13 -0
- package/lib/utils/base64.d.ts +2 -0
- package/lib/utils/color.d.ts +7 -0
- package/lib/utils/columns.d.ts +14 -0
- package/lib/utils/customEvents/customEvents.d.ts +3 -0
- package/lib/utils/customEvents/events.constant.d.ts +9 -0
- package/lib/utils/delete-node.d.ts +2 -0
- package/lib/utils/dom-dataset.d.ts +28 -0
- package/lib/utils/download.d.ts +1 -0
- package/lib/utils/dynamicCSS.d.ts +25 -0
- package/lib/utils/editor-container-size.d.ts +4 -0
- package/lib/utils/file.d.ts +30 -0
- package/lib/utils/getRenderContainer.d.ts +3 -0
- package/lib/utils/indent.d.ts +14 -0
- package/lib/utils/is-mobile.d.ts +19 -0
- package/lib/utils/json.d.ts +2 -0
- package/lib/utils/lru-cache.d.ts +31 -0
- package/lib/utils/mitt.d.ts +21 -0
- package/lib/utils/node.d.ts +15 -0
- package/lib/utils/pdf.d.ts +3 -0
- package/lib/utils/plateform.d.ts +11 -0
- package/lib/utils/shortId.d.ts +1 -0
- package/lib/utils/storage.d.ts +2 -0
- package/lib/utils/updatePosition.d.ts +1 -0
- package/lib/utils/utils.d.ts +20 -0
- package/lib/utils/validateFile.d.ts +16 -0
- package/package.json +155 -169
- package/lib/Attachment.d.cts +0 -351
- package/lib/Attachment.d.ts +0 -351
- package/lib/Blockquote.d.cts +0 -350
- package/lib/Blockquote.d.ts +0 -350
- package/lib/Bold.d.cts +0 -350
- package/lib/Bold.d.ts +0 -350
- package/lib/BulletList.d.cts +0 -350
- package/lib/BulletList.d.ts +0 -350
- package/lib/Clear.d.cts +0 -349
- package/lib/Clear.d.ts +0 -349
- package/lib/Code.d.cts +0 -350
- package/lib/Code.d.ts +0 -350
- package/lib/CodeBlock.d.cts +0 -359
- package/lib/CodeBlock.d.ts +0 -359
- package/lib/CodeView.d.cts +0 -349
- package/lib/CodeView.d.ts +0 -349
- package/lib/Color.d.cts +0 -361
- package/lib/Color.d.ts +0 -361
- package/lib/Column.d.cts +0 -280
- package/lib/Column.d.ts +0 -280
- package/lib/Drawer-SRhwOc6T.cjs +0 -1
- package/lib/Drawer.d.cts +0 -351
- package/lib/Drawer.d.ts +0 -351
- package/lib/Emoji.d.cts +0 -279
- package/lib/Emoji.d.ts +0 -279
- package/lib/Excalidraw-DwBRXEtC.js +0 -345
- package/lib/Excalidraw-ZN3DQvDC.cjs +0 -1
- package/lib/Excalidraw.d.cts +0 -283
- package/lib/Excalidraw.d.ts +0 -283
- package/lib/ExportPdf.d.cts +0 -360
- package/lib/ExportPdf.d.ts +0 -360
- package/lib/ExportWord.d.cts +0 -348
- package/lib/ExportWord.d.ts +0 -348
- package/lib/FontFamily.d.cts +0 -372
- package/lib/FontFamily.d.ts +0 -372
- package/lib/FontSize.d.cts +0 -374
- package/lib/FontSize.d.ts +0 -374
- package/lib/Heading.d.cts +0 -364
- package/lib/Heading.d.ts +0 -364
- package/lib/Highlight.d.cts +0 -359
- package/lib/Highlight.d.ts +0 -359
- package/lib/History.d.cts +0 -352
- package/lib/History.d.ts +0 -352
- package/lib/HorizontalRule.d.cts +0 -350
- package/lib/HorizontalRule.d.ts +0 -350
- package/lib/Iframe-Cvca2G7X.cjs +0 -1
- package/lib/Iframe.d.cts +0 -275
- package/lib/Iframe.d.ts +0 -275
- package/lib/Image.d.cts +0 -384
- package/lib/Image.d.ts +0 -384
- package/lib/ImageGif.d.cts +0 -296
- package/lib/ImageGif.d.ts +0 -296
- package/lib/ImportWord.d.cts +0 -360
- package/lib/ImportWord.d.ts +0 -360
- package/lib/Indent.d.cts +0 -351
- package/lib/Indent.d.ts +0 -351
- package/lib/Italic.d.cts +0 -350
- package/lib/Italic.d.ts +0 -350
- package/lib/Katex-XfrNne6U.cjs +0 -4
- package/lib/Katex.d.cts +0 -284
- package/lib/Katex.d.ts +0 -284
- package/lib/LineHeight.d.cts +0 -350
- package/lib/LineHeight.d.ts +0 -350
- package/lib/Link.d.cts +0 -350
- package/lib/Link.d.ts +0 -350
- package/lib/LinkEditBlock-BZenZq-Z.cjs +0 -5
- package/lib/Mention.d.cts +0 -274
- package/lib/Mention.d.ts +0 -274
- package/lib/Mermaid.d.cts +0 -351
- package/lib/Mermaid.d.ts +0 -351
- package/lib/MoreMark.d.cts +0 -375
- package/lib/MoreMark.d.ts +0 -375
- package/lib/OrderedList.d.cts +0 -350
- package/lib/OrderedList.d.ts +0 -350
- package/lib/SearchAndReplace.d.cts +0 -292
- package/lib/SearchAndReplace.d.ts +0 -292
- package/lib/SlashCommand.d.cts +0 -309
- package/lib/SlashCommand.d.ts +0 -309
- package/lib/Strike.d.cts +0 -350
- package/lib/Strike.d.ts +0 -350
- package/lib/Table-B1j1Ebmh.cjs +0 -9
- package/lib/Table.d.cts +0 -371
- package/lib/Table.d.ts +0 -371
- package/lib/TaskList.d.cts +0 -356
- package/lib/TaskList.d.ts +0 -356
- package/lib/TextAlign.d.cts +0 -373
- package/lib/TextAlign.d.ts +0 -373
- package/lib/TextDirection.d.cts +0 -304
- package/lib/TextDirection.d.ts +0 -304
- package/lib/TextUnderline.d.cts +0 -350
- package/lib/TextUnderline.d.ts +0 -350
- package/lib/Twitter-CtVTIWJW.cjs +0 -1
- package/lib/Twitter.d.cts +0 -300
- package/lib/Twitter.d.ts +0 -300
- package/lib/Video.d.cts +0 -385
- package/lib/Video.d.ts +0 -385
- package/lib/bubble.d.cts +0 -310
- package/lib/button-B12K7BJ4.cjs +0 -1
- package/lib/clsx-C11secjj.cjs +0 -1
- package/lib/clsx-OuTLNxxd.js +0 -16
- package/lib/dialog-CaCS-W5S.cjs +0 -1
- package/lib/dialog-PtQivpHS.js +0 -100
- package/lib/dropdown-menu-CdSm4emp.cjs +0 -1
- package/lib/icons-CqHjeW5T.cjs +0 -1
- package/lib/index-BH4bc3jN.cjs +0 -33
- package/lib/index-DV5kbgRU.cjs +0 -1
- package/lib/index-Dfmm6FTT.cjs +0 -1
- package/lib/index-DnWWK9F_.js +0 -6374
- package/lib/index-DzcKxutn.js +0 -632
- package/lib/index-RfTlOzIr.cjs +0 -22
- package/lib/index.d.cts +0 -279
- package/lib/input-_ECRfn3Y.cjs +0 -1
- package/lib/input-wJ9PDEzZ.js +0 -21
- package/lib/label-BkgAe7IY.cjs +0 -1
- package/lib/label-CGdLYWv7.js +0 -19
- package/lib/popover-BgmUNMHj.cjs +0 -1
- package/lib/separator-CuBW_w98.js +0 -328
- package/lib/separator-DRIrVZ2N.cjs +0 -1
- package/lib/store-DX599H5W.js +0 -10
- package/lib/store-WStcMOiW.cjs +0 -1
- package/lib/switch-CnLJ7Y-b.cjs +0 -1
- package/lib/switch-Coix_FA1.js +0 -27
- package/lib/textarea-B-6zTKQz.cjs +0 -1
- package/lib/theme-B7aAsK_T.js +0 -15
- package/lib/theme-D8_cxGqB.cjs +0 -1
- package/lib/toggle-D41PzQLJ.cjs +0 -1
- package/lib/tooltip-BuEiE96N.cjs +0 -1
- package/lib/tooltip-CopwsU8q.js +0 -23
- package/lib/useButtonProps-BsEd4zYM.js +0 -141
- package/lib/useButtonProps-C6Vpn190.cjs +0 -1
package/lib/TextUnderline.d.ts
DELETED
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { Extension } from '@tiptap/core';
|
|
3
|
-
import { JSX } from 'react/jsx-runtime';
|
|
4
|
-
import { Mark } from '@tiptap/core';
|
|
5
|
-
import { UnderlineOptions as UnderlineOptions_2 } from '@tiptap/extension-underline';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Represents the ButtonView function.
|
|
9
|
-
*/
|
|
10
|
-
declare type ButtonView<T = any> = (options: ButtonViewParams<T>) => ButtonViewReturn | ButtonViewReturn[];
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Represents the parameters for the ButtonView function.
|
|
14
|
-
*/
|
|
15
|
-
declare interface ButtonViewParams<T = any> {
|
|
16
|
-
/** Editor object */
|
|
17
|
-
editor: Editor;
|
|
18
|
-
/** Extension object */
|
|
19
|
-
extension: Extension<T>;
|
|
20
|
-
/** Translation function */
|
|
21
|
-
t: (path: string) => string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Represents the return value for the ButtonView component.
|
|
26
|
-
*/
|
|
27
|
-
declare interface ButtonViewReturn {
|
|
28
|
-
/** Component */
|
|
29
|
-
component: unknown;
|
|
30
|
-
/** Component props */
|
|
31
|
-
componentProps: ButtonViewReturnComponentProps;
|
|
32
|
-
/** Component slots */
|
|
33
|
-
componentSlots?: ButtonViewReturnComponentSlots;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Represents the props for the ButtonView component.
|
|
38
|
-
*/
|
|
39
|
-
declare interface ButtonViewReturnComponentProps {
|
|
40
|
-
/** Method triggered when action is performed */
|
|
41
|
-
action?: (value?: any) => void;
|
|
42
|
-
/** Whether it is in the active state */
|
|
43
|
-
isActive?: () => boolean;
|
|
44
|
-
/** Button icon */
|
|
45
|
-
icon?: any;
|
|
46
|
-
/** Text displayed on hover */
|
|
47
|
-
tooltip?: string;
|
|
48
|
-
[x: string]: any;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Represents the slots for the ButtonView component.
|
|
53
|
-
*/
|
|
54
|
-
declare interface ButtonViewReturnComponentSlots {
|
|
55
|
-
/** Dialog slot */
|
|
56
|
-
dialog: () => any;
|
|
57
|
-
[x: string]: () => any;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Represents the general options for Tiptap extensions.
|
|
62
|
-
*/
|
|
63
|
-
declare interface GeneralOptions<T> {
|
|
64
|
-
/** Enabled divider */
|
|
65
|
-
divider: boolean;
|
|
66
|
-
/** Enabled spacer */
|
|
67
|
-
spacer: boolean;
|
|
68
|
-
/** Button view function */
|
|
69
|
-
button: ButtonView<T>;
|
|
70
|
-
/** Show on Toolbar */
|
|
71
|
-
toolbar?: boolean;
|
|
72
|
-
/** Shortcut keys override */
|
|
73
|
-
shortcutKeys?: string[] | string[][];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export declare function RichTextUnderline(): JSX.Element;
|
|
77
|
-
|
|
78
|
-
export declare const TextUnderline: Mark<UnderlineOptions, any>;
|
|
79
|
-
|
|
80
|
-
export declare interface UnderlineOptions extends UnderlineOptions_2, GeneralOptions<UnderlineOptions> {
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { }
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
declare module '@tiptap/core' {
|
|
87
|
-
interface Commands<ReturnType> {
|
|
88
|
-
attachment: {
|
|
89
|
-
setAttachment: (attrs?: unknown) => ReturnType;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
declare module '@tiptap/core' {
|
|
96
|
-
interface Commands<ReturnType> {
|
|
97
|
-
setCodeBlock: {
|
|
98
|
-
setCodeBlock: (options?: any) => ReturnType;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
declare module '@tiptap/core' {
|
|
105
|
-
interface Commands<ReturnType> {
|
|
106
|
-
codeView: {
|
|
107
|
-
/**
|
|
108
|
-
* Toggle code view mode
|
|
109
|
-
*/
|
|
110
|
-
toggleCodeView: () => ReturnType;
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
declare module '@tiptap/core' {
|
|
117
|
-
interface Storage {
|
|
118
|
-
color: ColorStorage;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
declare module '@tiptap/core' {
|
|
124
|
-
interface Commands<ReturnType> {
|
|
125
|
-
columns: {
|
|
126
|
-
insertColumns: (attrs?: {
|
|
127
|
-
cols: number;
|
|
128
|
-
}) => ReturnType;
|
|
129
|
-
addColBefore: () => ReturnType;
|
|
130
|
-
addColAfter: () => ReturnType;
|
|
131
|
-
deleteCol: () => ReturnType;
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
declare module '@tiptap/core' {
|
|
138
|
-
interface Commands<ReturnType> {
|
|
139
|
-
drawer: {
|
|
140
|
-
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
141
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
declare module '@tiptap/core' {
|
|
148
|
-
interface Commands<ReturnType> {
|
|
149
|
-
excalidraw: {
|
|
150
|
-
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
declare module '@tiptap/core' {
|
|
157
|
-
interface Commands<ReturnType> {
|
|
158
|
-
exportPdf: {
|
|
159
|
-
exportToPdf: () => ReturnType;
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
declare module '@tiptap/core' {
|
|
166
|
-
interface Commands<ReturnType> {
|
|
167
|
-
exportWord: {
|
|
168
|
-
exportToWord: (docState: any) => ReturnType;
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
declare module '@tiptap/core' {
|
|
175
|
-
interface Commands<ReturnType> {
|
|
176
|
-
fontSize: {
|
|
177
|
-
/**
|
|
178
|
-
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
179
|
-
* CSS font-size
|
|
180
|
-
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
181
|
-
*/
|
|
182
|
-
setFontSize: (fontSize: string) => ReturnType;
|
|
183
|
-
/**
|
|
184
|
-
* Unset the font size
|
|
185
|
-
*/
|
|
186
|
-
unsetFontSize: () => ReturnType;
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
declare module '@tiptap/core' {
|
|
193
|
-
interface Storage {
|
|
194
|
-
highlight: HighlightStorage;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
declare module '@tiptap/core' {
|
|
200
|
-
interface Commands<ReturnType> {
|
|
201
|
-
iframe: {
|
|
202
|
-
/**
|
|
203
|
-
* Add an iframe
|
|
204
|
-
*/
|
|
205
|
-
setIframe: (options: {
|
|
206
|
-
src: string;
|
|
207
|
-
service: string;
|
|
208
|
-
}) => ReturnType;
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
declare module '@tiptap/core' {
|
|
215
|
-
interface Commands<ReturnType> {
|
|
216
|
-
imageUpload: {
|
|
217
|
-
/**
|
|
218
|
-
* Add an image
|
|
219
|
-
*/
|
|
220
|
-
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
221
|
-
/**
|
|
222
|
-
* Update an image
|
|
223
|
-
*/
|
|
224
|
-
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
225
|
-
/**
|
|
226
|
-
* Set image alignment
|
|
227
|
-
*/
|
|
228
|
-
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
declare module '@tiptap/core' {
|
|
235
|
-
interface Commands<ReturnType> {
|
|
236
|
-
imageGifUpload: {
|
|
237
|
-
/**
|
|
238
|
-
* Add an image gif
|
|
239
|
-
*/
|
|
240
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
241
|
-
/**
|
|
242
|
-
* Update an image gif
|
|
243
|
-
*/
|
|
244
|
-
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
245
|
-
/**
|
|
246
|
-
* Set image alignment
|
|
247
|
-
*/
|
|
248
|
-
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
declare module '@tiptap/core' {
|
|
255
|
-
interface Commands<ReturnType> {
|
|
256
|
-
indent: {
|
|
257
|
-
/**
|
|
258
|
-
* Set the indent attribute
|
|
259
|
-
*/
|
|
260
|
-
indent: () => ReturnType;
|
|
261
|
-
/**
|
|
262
|
-
* Set the outdent attribute
|
|
263
|
-
*/
|
|
264
|
-
outdent: () => ReturnType;
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
declare module '@tiptap/core' {
|
|
271
|
-
interface Commands<ReturnType> {
|
|
272
|
-
katex: {
|
|
273
|
-
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
declare module '@tiptap/core' {
|
|
280
|
-
interface Commands<ReturnType> {
|
|
281
|
-
mermaid: {
|
|
282
|
-
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
283
|
-
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
declare module '@tiptap/core' {
|
|
290
|
-
interface Commands<ReturnType> {
|
|
291
|
-
search: {
|
|
292
|
-
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
293
|
-
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
294
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
295
|
-
resetIndex: () => ReturnType;
|
|
296
|
-
nextSearchResult: () => ReturnType;
|
|
297
|
-
previousSearchResult: () => ReturnType;
|
|
298
|
-
replace: () => ReturnType;
|
|
299
|
-
replaceAll: () => ReturnType;
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
declare module '@tiptap/core' {
|
|
306
|
-
interface Storage {
|
|
307
|
-
searchAndReplace: SearchAndReplaceStorage;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
declare module '@tiptap/core' {
|
|
313
|
-
interface Commands<ReturnType> {
|
|
314
|
-
twitter: {
|
|
315
|
-
/**
|
|
316
|
-
* Insert a tweet
|
|
317
|
-
* @param options The tweet attributes
|
|
318
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
319
|
-
*/
|
|
320
|
-
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
321
|
-
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
declare module '@tiptap/core' {
|
|
328
|
-
interface Commands<ReturnType> {
|
|
329
|
-
video: {
|
|
330
|
-
/**
|
|
331
|
-
* Add an video
|
|
332
|
-
*/
|
|
333
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
334
|
-
/**
|
|
335
|
-
* Update an video
|
|
336
|
-
*/
|
|
337
|
-
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
declare module '@tiptap/core' {
|
|
344
|
-
interface Commands<ReturnType> {
|
|
345
|
-
tableCellBackground: {
|
|
346
|
-
setTableCellBackground: (color: string) => ReturnType;
|
|
347
|
-
unsetTableCellBackground: () => ReturnType;
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
}
|
package/lib/Twitter-CtVTIWJW.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const we=require("./index-RfTlOzIr.cjs"),xe=require("./index-BH4bc3jN.cjs"),n=require("react/jsx-runtime"),h=require("react"),U=require("./clsx-C11secjj.cjs"),Ot=require("./toggle-D41PzQLJ.cjs"),$t=require("./index-DV5kbgRU.cjs"),Dt=require("./Icon-DUpv2cI6.cjs"),At=require("./index-Dfmm6FTT.cjs"),Vt=require("./label-BkgAe7IY.cjs"),Mt=require("./input-_ECRfn3Y.cjs"),Wt=require("./button-B12K7BJ4.cjs"),tt=require("./useButtonProps-C6Vpn190.cjs"),ye=require("./popover-BgmUNMHj.cjs"),Bt="_verified_lvyh0_1",Be={verified:Bt},Pt=()=>n.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:Be.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"})})}),Ft=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:Be.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"})]})]})}),Ut=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:Be.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"})})}),zt="_root_98iqw_1",Ht="_article_98iqw_21",nt={root:zt,article:Ht},Pe=({className:e,children:t})=>n.jsx("div",{className:U.clsx("react-tweet-theme",nt.root,e),children:n.jsx("article",{className:nt.article,children:t})}),pt=e=>n.jsx("img",{...e}),Gt="_header_nqq4j_1",Xt="_avatar_nqq4j_11",Kt="_avatarOverflow_nqq4j_16",Qt="_avatarSquare_nqq4j_23",Jt="_avatarShadow_nqq4j_26",Yt="_author_nqq4j_37",Zt="_authorLink_nqq4j_44",en="_authorVerified_nqq4j_53",tn="_authorLinkText_nqq4j_56",nn="_authorMeta_nqq4j_63",rn="_authorFollow_nqq4j_66",sn="_username_nqq4j_69",on="_follow_nqq4j_74",an="_separator_nqq4j_82",cn="_brand_nqq4j_86",ln="_twitterIcon_nqq4j_90",b={header:Gt,avatar:Xt,avatarOverflow:Kt,avatarSquare:Qt,avatarShadow:Jt,author:Yt,authorLink:Zt,authorVerified:en,authorLinkText:tn,authorMeta:nn,authorFollow:rn,username:sn,follow:on,separator:an,brand:cn,twitterIcon:ln},dn="_verifiedOld_lcna5_1",un="_verifiedBlue_lcna5_4",fn="_verifiedGovernment_lcna5_7",Te={verifiedOld:dn,verifiedBlue:un,verifiedGovernment:fn},mt=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx(Pt,{}),o=Te.verifiedBlue;if(r)switch(e.is_blue_verified||(o=Te.verifiedOld),e.verified_type){case"Government":s=n.jsx(Ut,{}),o=Te.verifiedGovernment;break;case"Business":s=n.jsx(Ft,{}),o=null;break}return r?n.jsx("div",{className:U.clsx(t,o),children:s}):null},hn=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:pt,{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:U.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(mt,{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"})})})})]})},_n="_root_1ec15_1",pn={root:_n},mn=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:pn.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),xn="_root_eihfa_1",vn={root:xn},gn=({href:e,children:t})=>n.jsx("a",{href:e,className:vn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),jn="_root_1xq52_1",wn={root:jn},yn=({tweet:e})=>n.jsx("p",{className:wn.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(gn,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),rt=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}`,Tn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,bn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,Nn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,Rn=e=>`https://x.com/hashtag/${e.text}`,kn=e=>`https://x.com/search?q=%24${e.text}`,Sn=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},En=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var a,i;return((a=o.bitrate)!=null?a:0)-((i=s.bitrate)!=null?i:0)})},In=e=>{const t=En(e);return t.length>1?t[1]:t[0]},qe=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function st(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ce(r,"hashtag",e.entities.hashtags),ce(r,"mention",e.entities.user_mentions),ce(r,"url",e.entities.urls),ce(r,"symbol",e.entities.symbols),e.entities.media&&ce(r,"media",e.entities.media),Cn(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:Rn(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:kn(s),text:o});default:return Object.assign(s,{text:o})}})}function ce(e,t,r){for(const s of r)for(const[o,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const i=[{...s,type:t}];a.indices[0]<s.indices[0]&&i.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&i.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(o,1,...i);break}}function Cn(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 qn=e=>({...e,url:rt(e),user:{...e.user,url:xt(e),follow_url:Nn(e)},like_url:Tn(e),reply_url:bn(e),in_reply_to_url:e.in_reply_to_screen_name?Sn(e):void 0,entities:st(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:rt(e.quoted_tweet),entities:st(e.quoted_tweet)}:void 0}),Ln="_root_g9tkv_1",On="_rounded_g9tkv_6",$n="_mediaWrapper_g9tkv_10",Dn="_grid2Columns_g9tkv_17",An="_grid3_g9tkv_20",Vn="_grid2x2_g9tkv_23",Mn="_mediaContainer_g9tkv_26",Wn="_mediaLink_g9tkv_34",Bn="_skeleton_g9tkv_38",Pn="_image_g9tkv_43",I={root:Ln,rounded:On,mediaWrapper:$n,grid2Columns:Dn,grid3:An,grid2x2:Vn,mediaContainer:Mn,mediaLink:Wn,skeleton:Bn,image:Pn},Fn="_anchor_fp31d_1",Un="_videoButton_fp31d_17",zn="_videoButtonIcon_fp31d_35",Hn="_watchOnTwitter_fp31d_44",Gn="_viewReplies_fp31d_60",se={anchor:Fn,videoButton:Un,videoButtonIcon:zn,watchOnTwitter:Hn,viewReplies:Gn},Xn=({tweet:e,media:t})=>{const[r,s]=h.useState(!0),[o,a]=h.useState(!1),[i,c]=h.useState(!1),f=In(t);let d=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:I.image,poster:vt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{d&&window.clearTimeout(d),o||a(!0),i&&c(!1)},onPause:()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{o&&a(!1),d=0},100)},onEnded:()=>{c(!0)},children:n.jsx("source",{src:f.url,type:f.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:v=>{const p=v.currentTarget.previousSibling;v.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:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!i&&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"})}),i&&n.jsx("a",{href:e.url,className:U.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Kn=e=>n.jsx("img",{...e}),ot=(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,a;const i=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var c;const f=(c=t==null?void 0:t.MediaImg)!=null?c:Kn;return n.jsx("div",{className:U.clsx(I.root,!r&&I.rounded),children:n.jsx("div",{className:U.clsx(I.mediaWrapper,i>1&&I.grid2Columns,i===3&&I.grid3,i>4&&I.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(d=>n.jsx(h.Fragment,{children:d.type==="photo"?n.jsxs("a",{href:e.url,className:U.clsx(I.mediaContainer,I.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:I.skeleton,style:ot(d,i)}),n.jsx(f,{src:vt(d,"small"),alt:d.ext_alt_text||"Image",className:I.image,draggable:!0})]},d.media_url_https):n.jsxs("div",{className:I.mediaContainer,children:[n.jsx("div",{className:I.skeleton,style:ot(d,i)}),n.jsx(Xn,{tweet:e,media:d})]},d.media_url_https)},d.media_url_https))})})},Qn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Jn=new Intl.DateTimeFormat("en-US",Qn),Yn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Zn=e=>{const t=Yn(Jn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},er="_root_i24yn_1",tr={root:er},nr=({tweet:e})=>{const t=new Date(e.created_at),r=Zn(t);return n.jsx("a",{className:tr.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},rr="_info_19qcj_1",sr="_infoLink_19qcj_10",or="_infoIcon_19qcj_30",be={info:rr,infoLink:sr,infoIcon:or},ir=({tweet:e})=>n.jsxs("div",{className:be.info,children:[n.jsx(nr,{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"})})})})]}),ar="_actions_n2anf_1",cr="_like_n2anf_13",lr="_reply_n2anf_14",dr="_copy_n2anf_15",ur="_likeIconWrapper_n2anf_27",fr="_likeCount_n2anf_30",hr="_replyIconWrapper_n2anf_35",_r="_copyIconWrapper_n2anf_36",pr="_likeIcon_n2anf_27",mr="_replyIcon_n2anf_35",xr="_copyIcon_n2anf_36",vr="_replyText_n2anf_56",gr="_copyText_n2anf_57",S={actions:ar,like:cr,reply:lr,copy:dr,likeIconWrapper:ur,likeCount:fr,replyIconWrapper:hr,copyIconWrapper:_r,likeIcon:pr,replyIcon:mr,copyIcon:xr,replyText:vr,copyText:gr},jr=({tweet:e})=>{const[t,r]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return h.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[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"})]})},wr=({tweet:e})=>{const t=qe(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(jr,{tweet:e})]})},yr="_replies_1cutb_1",Tr="_link_1cutb_4",br="_text_1cutb_23",Ne={replies:yr,link:Tr,text:br},Nr=({tweet:e})=>n.jsx("div",{className:Ne.replies,children:n.jsx("a",{className:Ne.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Ne.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${qe(e.conversation_count)} reply`:`Read ${qe(e.conversation_count)} replies`})})}),Rr="_root_q5799_1",kr="_article_q5799_16",it={root:Rr,article:kr},Sr=({tweet:e,children:t})=>n.jsx("div",{className:it.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:it.article,children:t})}),Er="_header_r31i5_1",Ir="_avatar_r31i5_11",Cr="_avatarSquare_r31i5_17",qr="_author_r31i5_21",Lr="_authorText_r31i5_26",Or="_username_r31i5_33",K={header:Er,avatar:Ir,avatarSquare:Cr,author:qr,authorText:Lr,username:Or},$r=({tweet:e})=>{const{user:t}=e;return n.jsxs("div",{className:K.header,children:[n.jsx("a",{href:e.url,className:K.avatar,target:"_blank",rel:"noopener noreferrer",children:n.jsx("div",{className:U.clsx(K.avatarOverflow,t.profile_image_shape==="Square"&&K.avatarSquare),children:n.jsx(pt,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),n.jsxs("div",{className:K.author,children:[n.jsx("div",{className:K.authorText,children:n.jsx("span",{title:t.name,children:t.name})}),n.jsx(mt,{user:t}),n.jsx("div",{className:K.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Dr="_root_175ot_1",Ar={root:Dr},Vr=({tweet:e})=>n.jsx("p",{className:Ar.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r))}),Mr=({tweet:e})=>{var t;return n.jsxs(Sr,{tweet:e,children:[n.jsx($r,{tweet:e}),n.jsx(Vr,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(gt,{quoted:!0,tweet:e}):null]})},Wr=({tweet:e,components:t})=>{var r;const s=h.useMemo(()=>qn(e),[e]);return n.jsxs(Pe,{children:[n.jsx(hn,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(mn,{tweet:s}),n.jsx(yn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(gt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Mr,{tweet:s.quoted_tweet}),n.jsx(ir,{tweet:s}),n.jsx(wr,{tweet:s}),n.jsx(Nr,{tweet:s})]})},Br="_root_16yxa_1",Pr={root:Br},Fr=e=>n.jsx(Pe,{children:n.jsxs("div",{className:Pr.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Ur="_skeleton_oi7hr_1",zr={skeleton:Ur},_e=({style:e})=>n.jsx("span",{className:zr.skeleton,style:e}),Hr="_root_17qqv_1",Gr={root:Hr},Xr=()=>n.jsxs(Pe,{className:Gr.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"}})]}),jt=0,wt=1,yt=2,at=3;var ct=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(ct.call(e,r)&&++s&&!ct.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,F=()=>{},R=F(),Oe=Object,u=e=>e===R,M=e=>typeof e=="function",z=(e,t)=>({...e,...t}),Tt=e=>M(e.then),Re={},pe={},Fe="undefined",le=typeof window!=Fe,$e=typeof document!=Fe,Kr=le&&"Deno"in window,Qr=()=>le&&typeof window.requestAnimationFrame!=Fe,bt=(e,t)=>{const r=P.get(e);return[()=>!u(t)&&e.get(t)||Re,s=>{if(!u(t)){const o=e.get(t);t in pe||(pe[t]=o),r[5](t,z(o,s),o||Re)}},r[6],()=>!u(t)&&t in pe?pe[t]:!u(t)&&e.get(t)||Re]};let De=!0;const Jr=()=>De,[Ae,Ve]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[F,F],Yr=()=>{const e=$e&&document.visibilityState;return u(e)||e!=="hidden"},Zr=e=>($e&&document.addEventListener("visibilitychange",e),Ae("focus",e),()=>{$e&&document.removeEventListener("visibilitychange",e),Ve("focus",e)}),es=e=>{const t=()=>{De=!0,e()},r=()=>{De=!1};return Ae("online",t),Ae("offline",r),()=>{Ve("online",t),Ve("offline",r)}},ts={isOnline:Jr,isVisible:Yr},ns={initFocus:Zr,initReconnect:es},lt=!h.useId,oe=!le||Kr,rs=e=>Qr()?window.requestAnimationFrame(e):setTimeout(e,1),ke=oe?h.useEffect:h.useLayoutEffect,Se=typeof navigator<"u"&&navigator.connection,dt=!oe&&Se&&(["slow-2g","2g"].includes(Se.effectiveType)||Se.saveData),me=new WeakMap,ss=e=>Oe.prototype.toString.call(e),Ee=(e,t)=>e===`[object ${t}]`;let os=0;const Me=e=>{const t=typeof e,r=ss(e),s=Ee(r,"Date"),o=Ee(r,"RegExp"),a=Ee(r,"Object");let i,c;if(Oe(e)===e&&!s&&!o){if(i=me.get(e),i)return i;if(i=++os+"~",me.set(e,i),Array.isArray(e)){for(i="@",c=0;c<e.length;c++)i+=Me(e[c])+",";me.set(e,i)}if(a){i="#";const f=Oe.keys(e).sort();for(;!u(c=f.pop());)u(e[c])||(i+=c+":"+Me(e[c])+",");me.set(e,i)}}else i=s?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Ue=e=>{if(M(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 is=0;const We=()=>++is;async function Nt(...e){const[t,r,s,o]=e,a=z({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=a.populateCache;const c=a.rollbackOnError;let f=a.optimisticData;const d=w=>typeof c=="function"?c(w):c!==!1,v=a.throwOnError;if(M(r)){const w=r,N=[],E=t.keys();for(const q of E)!/^\$(inf|sub)\$/.test(q)&&w(t.get(q)._k)&&N.push(q);return Promise.all(N.map(p))}return p(r);async function p(w){const[N]=Ue(w);if(!N)return;const[E,q]=bt(t,N),[$,ie,l,de]=P.get(t),Q=()=>{const L=$[N];return(M(a.revalidate)?a.revalidate(E().data,w):a.revalidate!==!1)&&(delete l[N],delete de[N],L&&L[0])?L[0](yt).then(()=>E().data):E().data};if(e.length<3)return Q();let y=s,D,A=!1;const J=We();ie[N]=[J,0];const m=!u(f),Y=E(),V=Y.data,Z=Y._c,H=u(Z)?V:Z;if(m&&(f=M(f)?f(H,V):f,q({data:f,_c:H})),M(y))try{y=y(H)}catch(L){D=L,A=!0}if(y&&Tt(y))if(y=await y.catch(L=>{D=L,A=!0}),J!==ie[N][0]){if(A)throw D;return y}else A&&m&&d(D)&&(i=!0,q({data:H,_c:R}));if(i&&!A)if(M(i)){const L=i(y,H);q({data:L,error:R,_c:R})}else q({data:y,error:R,_c:R});if(ie[N][1]=We(),Promise.resolve(Q()).then(()=>{q({_c:R})}),A){if(v)throw D;return}return y}}const ut=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},as=(e,t)=>{if(!P.has(e)){const r=z(ns,t),s=Object.create(null),o=Nt.bind(R,e);let a=F;const i=Object.create(null),c=(v,p)=>{const w=i[v]||[];return i[v]=w,w.push(p),()=>w.splice(w.indexOf(p),1)},f=(v,p,w)=>{e.set(v,p);const N=i[v];if(N)for(const E of N)E(p,w)},d=()=>{if(!P.has(e)&&(P.set(e,[s,Object.create(null),Object.create(null),Object.create(null),o,f,c]),!oe)){const v=r.initFocus(setTimeout.bind(R,ut.bind(R,s,jt))),p=r.initReconnect(setTimeout.bind(R,ut.bind(R,s,wt)));a=()=>{v&&v(),p&&p(),P.delete(e)}}};return d(),[e,o,d,a]}return[e,P.get(e)[4]]},cs=(e,t,r,s,o)=>{const a=r.errorRetryCount,i=o.retryCount,c=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;!u(a)&&i>a||setTimeout(s,c,o)},ls=Le,[Rt,ds]=as(new Map),us=z({onLoadingSlow:F,onSuccess:F,onError:F,onErrorRetry:cs,onDiscarded:F,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:ls,isPaused:()=>!1,cache:Rt,mutate:ds,fallback:{}},ts),fs=(e,t)=>{const r=z(e,t);if(t){const{use:s,fallback:o}=e,{use:a,fallback:i}=t;s&&a&&(r.use=s.concat(a)),o&&i&&(r.fallback=z(o,i))}return r},hs=h.createContext({}),_s="$inf$",kt=le&&window.__SWR_DEVTOOLS_USE__,ps=kt?window.__SWR_DEVTOOLS_USE__:[],ms=()=>{kt&&(window.__SWR_DEVTOOLS_REACT__=h)},xs=e=>M(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],vs=()=>{const e=h.useContext(hs);return h.useMemo(()=>z(us,e),[e])},gs=e=>(t,r,s)=>e(t,r&&((...a)=>{const[i]=Ue(t),[,,,c]=P.get(Rt);if(i.startsWith(_s))return r(...a);const f=c[i];return u(f)?r(...a):(delete c[i],f)}),s),js=ps.concat(gs),ws=e=>function(...r){const s=vs(),[o,a,i]=xs(r),c=fs(s,i);let f=e;const{use:d}=c,v=(d||[]).concat(js);for(let p=v.length;p--;)f=v[p](f);return f(o,a||c.fetcher||null,c)},ys=(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())}};ms();const Ie=h.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}}),Ce={dedupe:!0},ft=Promise.resolve(R),Ts=(e,t,r)=>{const{cache:s,compare:o,suspense:a,fallbackData:i,revalidateOnMount:c,revalidateIfStale:f,refreshInterval:d,refreshWhenHidden:v,refreshWhenOffline:p,keepPreviousData:w,strictServerPrefetchWarning:N}=r,[E,q,$,ie]=P.get(s),[l,de]=Ue(e),Q=h.useRef(!1),y=h.useRef(!1),D=h.useRef(l),A=h.useRef(t),J=h.useRef(r),m=()=>J.current,Y=()=>m().isVisible()&&m().isOnline(),[V,Z,H,L]=bt(s,l),ee=h.useRef({}).current,ue=u(i)?u(r.fallback)?R:r.fallback[l]:i,He=(_,x)=>{for(const j in ee){const g=j;if(g==="data"){if(!o(_[g],x[g])&&(!u(_[g])||!o(he,x[g])))return!1}else if(x[g]!==_[g])return!1}return!0},Ge=h.useMemo(()=>{const _=!l||!t?!1:u(c)?m().isPaused()||a?!1:f!==!1:c,x=k=>{const W=z(k);return delete W._k,_?{isValidating:!0,isLoading:!0,...W}:W},j=V(),g=L(),O=x(j),re=j===g?O:x(g);let T=O;return[()=>{const k=x(V());return He(k,T)?(T.data=k.data,T.isLoading=k.isLoading,T.isValidating=k.isValidating,T.error=k.error,T):(T=k,k)},()=>re]},[s,l]),te=xe.shimExports.useSyncExternalStore(h.useCallback(_=>H(l,(x,j)=>{He(j,x)||_()}),[s,l]),Ge[0],Ge[1]),Xe=!Q.current,Et=E[l]&&E[l].length>0,ne=te.data,G=u(ne)?ue&&Tt(ue)?Ie(ue):ue:ne,fe=te.error,ve=h.useRef(G),he=w?u(ne)?u(ve.current)?G:ve.current:ne:G,X=l&&u(G),It=!oe&&xe.shimExports.useSyncExternalStore(()=>F,()=>!1,()=>!0);N&&It&&!a&&X&&console.warn(`Missing pre-initiated data for serialized key "${l}" 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 Ke=Et&&!u(fe)?!1:Xe&&!u(c)?c:m().isPaused()?!1:a?u(G)?!1:f:u(G)||f,Qe=!!(l&&t&&Xe&&Ke),Ct=u(te.isValidating)?Qe:te.isValidating,qt=u(te.isLoading)?Qe:te.isLoading,ae=h.useCallback(async _=>{const x=A.current;if(!l||!x||y.current||m().isPaused())return!1;let j,g,O=!0;const re=_||{},T=!$[l]||!re.dedupe,k=()=>lt?!y.current&&l===D.current&&Q.current:l===D.current,W={isValidating:!1,isLoading:!1},Ye=()=>{Z(W)},Ze=()=>{const C=$[l];C&&C[1]===g&&delete $[l]},et={isValidating:!0};u(V().data)&&(et.isLoading=!0);try{if(T&&(Z(et),r.loadingTimeout&&u(V().data)&&setTimeout(()=>{O&&k()&&m().onLoadingSlow(l,r)},r.loadingTimeout),$[l]=[x(de),We()]),[j,g]=$[l],j=await j,T&&setTimeout(Ze,r.dedupingInterval),!$[l]||$[l][1]!==g)return T&&k()&&m().onDiscarded(l),!1;W.error=R;const C=q[l];if(!u(C)&&(g<=C[0]||g<=C[1]||C[1]===0))return Ye(),T&&k()&&m().onDiscarded(l),!1;const B=V().data;W.data=o(B,j)?B:j,T&&k()&&m().onSuccess(j,l,r)}catch(C){Ze();const B=m(),{shouldRetryOnError:ge}=B;B.isPaused()||(W.error=C,T&&k()&&(B.onError(C,l,B),(ge===!0||M(ge)&&ge(C))&&(!m().revalidateOnFocus||!m().revalidateOnReconnect||Y())&&B.onErrorRetry(C,l,B,Lt=>{const je=E[l];je&&je[0]&&je[0](at,Lt)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return O=!1,Ye(),!0},[l,s]),Je=h.useCallback((..._)=>Nt(s,D.current,..._),[]);if(ke(()=>{A.current=t,J.current=r,u(ne)||(ve.current=ne)}),ke(()=>{if(!l)return;const _=ae.bind(R,Ce);let x=0;m().revalidateOnFocus&&(x=Date.now()+m().focusThrottleInterval);const g=ys(l,E,(O,re={})=>{if(O==jt){const T=Date.now();m().revalidateOnFocus&&T>x&&Y()&&(x=T+m().focusThrottleInterval,_())}else if(O==wt)m().revalidateOnReconnect&&Y()&&_();else{if(O==yt)return ae();if(O==at)return ae(re)}});return y.current=!1,D.current=l,Q.current=!0,Z({_k:de}),Ke&&($[l]||(u(G)||oe?_():rs(_))),()=>{y.current=!0,g()}},[l]),ke(()=>{let _;function x(){const g=M(d)?d(V().data):d;g&&_!==-1&&(_=setTimeout(j,g))}function j(){!V().error&&(v||m().isVisible())&&(p||m().isOnline())?ae(Ce).then(x):x()}return x(),()=>{_&&(clearTimeout(_),_=-1)}},[d,v,p,l]),h.useDebugValue(he),a){if(!lt&&oe&&X)throw new Error("Fallback data is required when using Suspense in SSR.");X&&(A.current=t,J.current=r,y.current=!1);const _=ie[l],x=!u(_)&&X?Je(_):ft;if(Ie(x),!u(fe)&&X)throw fe;const j=X?ae(Ce):ft;!u(he)&&X&&(j.status="fulfilled",j.value=!0),Ie(j)}return{mutate:Je,get data(){return ee.data=!0,he},get error(){return ee.error=!0,fe},get isValidating(){return ee.isValidating=!0,Ct},get isLoading(){return ee.isLoading=!0,qt}}},ht=ws(Ts);class bs extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const Ns=ht.default||ht,Rs="https://react-tweet.vercel.app";async function ks([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new bs({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const Ss=(e,t,r)=>{const{isLoading:s,data:o,error:a}=Ns(()=>t||e?[t||e&&`${Rs}/api/tweet/${e}`,r]:null,ks,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!a),data:o,error:a}},Es=({id:e,apiUrl:t,fallback:r=n.jsx(Xr,{}),components:s,fetchOptions:o,onError:a})=>{const{data:i,error:c,isLoading:f}=Ss(e,t,o);if(f)return r;if(c||!i){const d=(s==null?void 0:s.TweetNotFound)||Fr;return n.jsx(d,{error:a?a(c):c})}return n.jsx(Wr,{tweet:i,components:s})};function Is({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(xe.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Es,{id:r})})}):null}function St(e){const{t}=At.useLocale(),[r,s]=h.useState("");h.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:i}=(a=e.editor)==null?void 0:a.getAttributes(ze.name);i&&s(i)}},[e==null?void 0:e.editor]);function o(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:o,children:[n.jsx(Vt.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(Mt.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(Wt.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Cs(){const[e,t]=h.useState(!1),r=$t.useEditorInstance(),s=tt.useButtonProps(ze.name),{icon:o=void 0,tooltip:a=void 0,tooltipOptions:i={},action:c=void 0,isActive:f=void 0}=(s==null?void 0:s.componentProps)??{},{editorDisabled:d}=tt.useToggleActive(f);function v(p){d||c&&(c(p),t(!1))}return n.jsxs(ye.Popover,{modal:!0,onOpenChange:t,open:e,children:[n.jsx(ye.PopoverTrigger,{asChild:!0,children:n.jsx(Ot.ActionButton,{disabled:d,isActive:f,tooltip:a,tooltipOptions:i,children:n.jsx(Dt.IconComponent,{name:o})})}),n.jsx(ye.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:n.jsx(St,{editor:r,onSetLink:v})})]})}const qs=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ls=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function _t(e){return e.match(Ls)}const ze=we.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return xe.ReactNodeViewRenderer(Is,{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})=>_t(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>_t(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[we.nodePasteRule({find:qs,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",we.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=St;exports.RichTextTwitter=Cs;exports.Twitter=ze;
|