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/ImageGif.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./index-DLqogznp.cjs"),N=require("./throttle-DXN-aiH5.cjs"),l=require("react/jsx-runtime"),u=require("react"),G=require("./index-B0fWAhpK.cjs"),L=require("./isNumber-C2saEiG2.cjs"),W=require("./toggle-BWfca8kh.cjs");require("./index-DM3mpxB-.cjs");const k=require("./useButtonProps-DJ51kDtM.cjs"),P=require("./popover-C64cn4Pd.cjs"),D=require("./input-CadAYBdT.cjs"),S={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function B(e){var z,C;const[t,r]=u.useState({width:G.IMAGE_MAX_SIZE,height:G.IMAGE_MAX_SIZE}),[c,i]=u.useState({width:0,height:0}),[n]=u.useState([S.TOP_LEFT,S.TOP_RIGHT,S.BOTTOM_LEFT,S.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,b]=u.useState({x:0,y:0,w:0,h:0,dir:""}),{align:x}=(z=e==null?void 0:e.node)==null?void 0:z.attrs,m=u.useMemo(()=>{var v;const{src:o,alt:f,width:w,height:M}=(v=e==null?void 0:e.node)==null?void 0:v.attrs,A=L.isNumber(w)?`${w}px`:w,d=L.isNumber(M)?`${M}px`:M;return{src:o||void 0,alt:f||void 0,style:{width:A||void 0,height:d||void 0}}},[(C=e==null?void 0:e.node)==null?void 0:C.attrs]),T=u.useMemo(()=>{const{style:{width:o}}=m;return{width:o==="100%"?o:void 0}},[m]);function g(o){i({width:o.target.width,height:o.target.height})}function _(){const{editor:o,getPos:f}=e;o.commands.setNodeSelection(f())}const y=u.useCallback(N.throttle(()=>{const{editor:o}=e,{width:f}=getComputedStyle(o.view.dom);r(w=>({...w,width:Number.parseInt(f,10)}))},G.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function p(o,f){o.preventDefault(),o.stopPropagation();const w=c.width,M=c.height,A=w/M;let d=Number(e.node.attrs.width),v=Number(e.node.attrs.height);const I=t.width;d&&!v?(d=d>I?I:d,v=Math.round(d/A)):v&&!d?(d=Math.round(v*A),d=d>I?I:d):!d&&!v?(d=w>I?I:w,v=Math.round(d/A)):d=d>I?I:d,a(!0),b({x:o.clientX,y:o.clientY,w:d,h:v,dir:f})}const j=u.useCallback(N.throttle(o=>{if(o.preventDefault(),o.stopPropagation(),!s)return;const{x:f,w,dir:M}=h,A=(o.clientX-f)*(/l/.test(M)?-1:1),d=L.clamp(w+A,G.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},G.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),E=u.useCallback(o=>{o.preventDefault(),o.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),_())},[s,_]),q=u.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",E,!0)},[j,E]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",E,!0)},[j,E]);u.useEffect(()=>(s?q():O(),()=>{O()}),[s,q,O]);const R=u.useMemo(()=>new ResizeObserver(()=>y()),[y]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx($.NodeViewWrapper,{className:"image-view",style:{...T,width:"100%",textAlign:x},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:T,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:_,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:n==null?void 0:n.map(o=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${o}`,onMouseDown:f=>p(f,o)},`image-dir-${o}`))})]})})}async function F(e){var c;const r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(c=r==null?void 0:r.data)==null?void 0:c.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function V(e,t){var i;const c=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=c==null?void 0:c.data)==null?void 0:i.map(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function X(e){var n,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(n=r==null?void 0:r.results)==null?void 0:n[0]}&limit=15`)).json();return(s=i==null?void 0:i.results)==null?void 0:s.map(a=>{var h,b,x,m,T,g,_,y;return{id:a==null?void 0:a.id,src:(b=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:b.url,width:(T=(m=(x=a==null?void 0:a.media_formats)==null?void 0:x.gif)==null?void 0:m.dims)==null?void 0:T[0],height:(y=(_=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:_.dims)==null?void 0:y[1]}})}async function Y(e,t){var i;const c=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=c==null?void 0:c.results)==null?void 0:i.map(n=>{var s,a,h,b,x,m,T,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(x=(b=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:x[0],height:(g=(T=(m=n==null?void 0:n.media_formats)==null?void 0:m.gif)==null?void 0:T.dims)==null?void 0:g[1]}})}function Z(e,t){return{searchTrending:async()=>t?e==="giphy"?F(t):e==="tenor"?X(t):[]:[],searchWord:async i=>t?e==="giphy"?V(i,t):e==="tenor"?Y(i,t):[]:[]}}function U({selectImage:e,apiKey:t,provider:r,children:c}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=k.useToggleActive(),b=u.useRef(null),{searchTrending:x,searchWord:m}=Z(r,t);u.useEffect(()=>{(async()=>{const g=await x();a(g)})()},[]);const T=u.useCallback(N.debounce(async g=>{if(!g.target.value){const y=await x();a(y);return}const _=await m(g.target.value);a(_)},350),[]);return l.jsxs(P.Popover,{modal:!0,onOpenChange:n,open:i,children:[l.jsx(P.PopoverTrigger,{asChild:!0,disabled:h,children:c}),l.jsx(P.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(D.Input,{onChange:T,placeholder:"Search GIF",ref:b,type:"text"})}),l.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:l.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:s!=null&&s.length?s==null?void 0:s.map(g=>l.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",src:g.src,onClick:()=>{e(g.src),n(!1)}},g.id)):l.jsx("p",{children:"No GIFs found"})})})]}):l.jsx("div",{children:l.jsx("p",{children:"Missing Giphy API Key"})})})]})}function J(){const e=k.useButtonProps(H.name),{action:t,icon:r,tooltip:c,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=k.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(U,{apiKey:i,provider:n,selectImage:a,children:l.jsx(W.ActionButton,{disabled:s,icon:r,tooltip:c})})}const H=N.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:c})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:c("editor.imageGif.tooltip"),apiKey:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return $.ReactNodeViewRenderer(B)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",$.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=H;exports.RichTextImageGif=J;
|
package/lib/ImageGif.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { m as
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { I as ie } from "./input-wJ9PDEzZ.js";
|
|
1
|
+
import { s as B, m as q, R as V } from "./index-nFjllrEl.js";
|
|
2
|
+
import { a as H, d as X, c as Y } from "./throttle-CGM5M2yG.js";
|
|
3
|
+
import { jsx as u, jsxs as P, Fragment as Z } from "react/jsx-runtime";
|
|
4
|
+
import { useState as G, useMemo as L, useCallback as M, useEffect as z, useRef as U } from "react";
|
|
5
|
+
import { I as C, j, k as J } from "./index-CEbbM7Gx.js";
|
|
6
|
+
import { i as W, c as Q } from "./isNumber-CTm1pIvN.js";
|
|
7
|
+
import { A as K } from "./toggle-Crvm3Tcn.js";
|
|
8
|
+
import "./index-ClAEwR0V.js";
|
|
9
|
+
import { u as ee, a as D } from "./useButtonProps--5ytUuGi.js";
|
|
10
|
+
import { P as te, a as re, b as ne } from "./popover-ydZ2mHXy.js";
|
|
11
|
+
import { I as ie } from "./input-U-XBy56K.js";
|
|
13
12
|
const O = {
|
|
14
13
|
TOP_LEFT: "tl",
|
|
15
14
|
TOP_RIGHT: "tr",
|
|
@@ -17,88 +16,88 @@ const O = {
|
|
|
17
16
|
BOTTOM_RIGHT: "br"
|
|
18
17
|
};
|
|
19
18
|
function ae(e) {
|
|
20
|
-
var $,
|
|
21
|
-
const [t, n] =
|
|
19
|
+
var $, k;
|
|
20
|
+
const [t, n] = G({
|
|
22
21
|
width: C,
|
|
23
22
|
height: C
|
|
24
|
-
}), [c, i] =
|
|
23
|
+
}), [c, i] = G({
|
|
25
24
|
width: 0,
|
|
26
25
|
height: 0
|
|
27
|
-
}), [r] =
|
|
26
|
+
}), [r] = G([
|
|
28
27
|
O.TOP_LEFT,
|
|
29
28
|
O.TOP_RIGHT,
|
|
30
29
|
O.BOTTOM_LEFT,
|
|
31
30
|
O.BOTTOM_RIGHT
|
|
32
|
-
]), [a, s] =
|
|
31
|
+
]), [a, s] = G(!1), [l, v] = G({
|
|
33
32
|
x: 0,
|
|
34
33
|
y: 0,
|
|
35
34
|
w: 0,
|
|
36
35
|
h: 0,
|
|
37
36
|
dir: ""
|
|
38
|
-
}), { align: b } = ($ = e == null ? void 0 : e.node) == null ? void 0 : $.attrs,
|
|
39
|
-
var
|
|
40
|
-
const { src: o, alt:
|
|
37
|
+
}), { align: b } = ($ = e == null ? void 0 : e.node) == null ? void 0 : $.attrs, g = L(() => {
|
|
38
|
+
var w;
|
|
39
|
+
const { src: o, alt: m, width: f, height: x } = (w = e == null ? void 0 : e.node) == null ? void 0 : w.attrs, A = W(f) ? `${f}px` : f, d = W(x) ? `${x}px` : x;
|
|
41
40
|
return {
|
|
42
41
|
src: o || void 0,
|
|
43
|
-
alt:
|
|
42
|
+
alt: m || void 0,
|
|
44
43
|
style: {
|
|
45
|
-
width:
|
|
44
|
+
width: A || void 0,
|
|
46
45
|
height: d || void 0
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
|
-
}, [(
|
|
48
|
+
}, [(k = e == null ? void 0 : e.node) == null ? void 0 : k.attrs]), _ = L(() => {
|
|
50
49
|
const {
|
|
51
50
|
style: { width: o }
|
|
52
|
-
} =
|
|
51
|
+
} = g;
|
|
53
52
|
return { width: o === "100%" ? o : void 0 };
|
|
54
|
-
}, [
|
|
55
|
-
function
|
|
53
|
+
}, [g]);
|
|
54
|
+
function h(o) {
|
|
56
55
|
i({
|
|
57
56
|
width: o.target.width,
|
|
58
57
|
height: o.target.height
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
60
|
function y() {
|
|
62
|
-
const { editor: o, getPos:
|
|
63
|
-
o.commands.setNodeSelection(
|
|
61
|
+
const { editor: o, getPos: m } = e;
|
|
62
|
+
o.commands.setNodeSelection(m());
|
|
64
63
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const { editor: o } = e, { width:
|
|
68
|
-
n((
|
|
69
|
-
...
|
|
70
|
-
width: Number.parseInt(
|
|
64
|
+
const T = M(
|
|
65
|
+
H(() => {
|
|
66
|
+
const { editor: o } = e, { width: m } = getComputedStyle(o.view.dom);
|
|
67
|
+
n((f) => ({
|
|
68
|
+
...f,
|
|
69
|
+
width: Number.parseInt(m, 10)
|
|
71
70
|
}));
|
|
72
|
-
},
|
|
71
|
+
}, j),
|
|
73
72
|
[e == null ? void 0 : e.editor]
|
|
74
73
|
);
|
|
75
|
-
function
|
|
74
|
+
function F(o, m) {
|
|
76
75
|
o.preventDefault(), o.stopPropagation();
|
|
77
|
-
const
|
|
78
|
-
let d = Number(e.node.attrs.width),
|
|
76
|
+
const f = c.width, x = c.height, A = f / x;
|
|
77
|
+
let d = Number(e.node.attrs.width), w = Number(e.node.attrs.height);
|
|
79
78
|
const I = t.width;
|
|
80
|
-
d && !
|
|
79
|
+
d && !w ? (d = d > I ? I : d, w = Math.round(d / A)) : w && !d ? (d = Math.round(w * A), d = d > I ? I : d) : !d && !w ? (d = f > I ? I : f, w = Math.round(d / A)) : d = d > I ? I : d, s(!0), v({
|
|
81
80
|
x: o.clientX,
|
|
82
81
|
y: o.clientY,
|
|
83
82
|
w: d,
|
|
84
|
-
h:
|
|
85
|
-
dir:
|
|
83
|
+
h: w,
|
|
84
|
+
dir: m
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
|
-
const N =
|
|
89
|
-
|
|
87
|
+
const N = M(
|
|
88
|
+
H((o) => {
|
|
90
89
|
if (o.preventDefault(), o.stopPropagation(), !a)
|
|
91
90
|
return;
|
|
92
|
-
const { x:
|
|
91
|
+
const { x: m, w: f, dir: x } = l, A = (o.clientX - m) * (/l/.test(x) ? -1 : 1), d = Q(f + A, J, t.width);
|
|
93
92
|
e.updateAttributes({
|
|
94
93
|
width: d,
|
|
95
94
|
height: null
|
|
96
95
|
});
|
|
97
|
-
},
|
|
96
|
+
}, j),
|
|
98
97
|
[a, l, t, e.updateAttributes]
|
|
99
|
-
), E =
|
|
98
|
+
), E = M(
|
|
100
99
|
(o) => {
|
|
101
|
-
o.preventDefault(), o.stopPropagation(), a && (
|
|
100
|
+
o.preventDefault(), o.stopPropagation(), a && (v({
|
|
102
101
|
x: 0,
|
|
103
102
|
y: 0,
|
|
104
103
|
w: 0,
|
|
@@ -107,47 +106,47 @@ function ae(e) {
|
|
|
107
106
|
}), s(!1), y());
|
|
108
107
|
},
|
|
109
108
|
[a, y]
|
|
110
|
-
), R =
|
|
109
|
+
), R = M(() => {
|
|
111
110
|
document == null || document.addEventListener("mousemove", N, !0), document == null || document.addEventListener("mouseup", E, !0);
|
|
112
|
-
}, [N, E]),
|
|
111
|
+
}, [N, E]), S = M(() => {
|
|
113
112
|
document == null || document.removeEventListener("mousemove", N, !0), document == null || document.removeEventListener("mouseup", E, !0);
|
|
114
113
|
}, [N, E]);
|
|
115
|
-
z(() => (a ? R() :
|
|
116
|
-
|
|
117
|
-
}), [a, R,
|
|
118
|
-
const
|
|
119
|
-
return z(() => (
|
|
120
|
-
|
|
121
|
-
}), [e.editor.view.dom,
|
|
122
|
-
|
|
114
|
+
z(() => (a ? R() : S(), () => {
|
|
115
|
+
S();
|
|
116
|
+
}), [a, R, S]);
|
|
117
|
+
const p = L(() => new ResizeObserver(() => T()), [T]);
|
|
118
|
+
return z(() => (p.observe(e.editor.view.dom), () => {
|
|
119
|
+
p.disconnect();
|
|
120
|
+
}), [e.editor.view.dom, p]), /* @__PURE__ */ u(
|
|
121
|
+
B,
|
|
123
122
|
{
|
|
124
123
|
className: "image-view",
|
|
125
|
-
style: { ...
|
|
124
|
+
style: { ..._, width: "100%", textAlign: b },
|
|
126
125
|
children: /* @__PURE__ */ P(
|
|
127
126
|
"div",
|
|
128
127
|
{
|
|
129
128
|
"data-drag-handle": !0,
|
|
130
129
|
draggable: "true",
|
|
131
|
-
style:
|
|
130
|
+
style: _,
|
|
132
131
|
className: `image-view__body ${e != null && e.selected ? "image-view__body--focused" : ""} ${a ? "image-view__body--resizing" : ""}`,
|
|
133
132
|
children: [
|
|
134
133
|
/* @__PURE__ */ u(
|
|
135
134
|
"img",
|
|
136
135
|
{
|
|
137
|
-
alt:
|
|
136
|
+
alt: g.alt,
|
|
138
137
|
className: "image-view__body__image block",
|
|
139
138
|
height: "auto",
|
|
140
139
|
onClick: y,
|
|
141
|
-
onLoad:
|
|
142
|
-
src:
|
|
143
|
-
style:
|
|
140
|
+
onLoad: h,
|
|
141
|
+
src: g.src,
|
|
142
|
+
style: g.style
|
|
144
143
|
}
|
|
145
144
|
),
|
|
146
145
|
(e == null ? void 0 : e.editor.view.editable) && ((e == null ? void 0 : e.selected) || a) && /* @__PURE__ */ u("div", { className: "image-resizer", children: r == null ? void 0 : r.map((o) => /* @__PURE__ */ u(
|
|
147
146
|
"span",
|
|
148
147
|
{
|
|
149
148
|
className: `image-resizer__handler image-resizer__handler--${o}`,
|
|
150
|
-
onMouseDown: (
|
|
149
|
+
onMouseDown: (m) => F(m, o)
|
|
151
150
|
},
|
|
152
151
|
`image-dir-${o}`
|
|
153
152
|
)) })
|
|
@@ -187,12 +186,12 @@ async function ce(e) {
|
|
|
187
186
|
var r, a;
|
|
188
187
|
const t = await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`), n = await (t == null ? void 0 : t.json()), i = await (await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(r = n == null ? void 0 : n.results) == null ? void 0 : r[0]}&limit=15`)).json();
|
|
189
188
|
return (a = i == null ? void 0 : i.results) == null ? void 0 : a.map((s) => {
|
|
190
|
-
var l,
|
|
189
|
+
var l, v, b, g, _, h, y, T;
|
|
191
190
|
return {
|
|
192
191
|
id: s == null ? void 0 : s.id,
|
|
193
|
-
src: (
|
|
194
|
-
width: (
|
|
195
|
-
height: (
|
|
192
|
+
src: (v = (l = s == null ? void 0 : s.media_formats) == null ? void 0 : l.gif) == null ? void 0 : v.url,
|
|
193
|
+
width: (_ = (g = (b = s == null ? void 0 : s.media_formats) == null ? void 0 : b.gif) == null ? void 0 : g.dims) == null ? void 0 : _[0],
|
|
194
|
+
height: (T = (y = (h = s == null ? void 0 : s.media_formats) == null ? void 0 : h.gif) == null ? void 0 : y.dims) == null ? void 0 : T[1]
|
|
196
195
|
};
|
|
197
196
|
});
|
|
198
197
|
}
|
|
@@ -200,12 +199,12 @@ async function de(e, t) {
|
|
|
200
199
|
var i;
|
|
201
200
|
const c = await (await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();
|
|
202
201
|
return (i = c == null ? void 0 : c.results) == null ? void 0 : i.map((r) => {
|
|
203
|
-
var a, s, l,
|
|
202
|
+
var a, s, l, v, b, g, _, h;
|
|
204
203
|
return {
|
|
205
204
|
id: r == null ? void 0 : r.id,
|
|
206
205
|
src: (s = (a = r == null ? void 0 : r.media_formats) == null ? void 0 : a.gif) == null ? void 0 : s.url,
|
|
207
|
-
width: (b = (
|
|
208
|
-
height: (
|
|
206
|
+
width: (b = (v = (l = r == null ? void 0 : r.media_formats) == null ? void 0 : l.gif) == null ? void 0 : v.dims) == null ? void 0 : b[0],
|
|
207
|
+
height: (h = (_ = (g = r == null ? void 0 : r.media_formats) == null ? void 0 : g.gif) == null ? void 0 : _.dims) == null ? void 0 : h[1]
|
|
209
208
|
};
|
|
210
209
|
});
|
|
211
210
|
}
|
|
@@ -216,22 +215,22 @@ function le(e, t) {
|
|
|
216
215
|
};
|
|
217
216
|
}
|
|
218
217
|
function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
|
|
219
|
-
const [i, r] =
|
|
218
|
+
const [i, r] = G(!1), [a, s] = G([]), { editorDisabled: l } = D(), v = U(null), { searchTrending: b, searchWord: g } = le(n, t);
|
|
220
219
|
z(() => {
|
|
221
220
|
(async () => {
|
|
222
|
-
const h = await
|
|
221
|
+
const h = await b();
|
|
223
222
|
s(h);
|
|
224
223
|
})();
|
|
225
224
|
}, []);
|
|
226
|
-
const
|
|
227
|
-
|
|
225
|
+
const _ = M(
|
|
226
|
+
X(async (h) => {
|
|
228
227
|
if (!h.target.value) {
|
|
229
|
-
const
|
|
230
|
-
s(
|
|
228
|
+
const T = await b();
|
|
229
|
+
s(T);
|
|
231
230
|
return;
|
|
232
231
|
}
|
|
233
|
-
const
|
|
234
|
-
s(
|
|
232
|
+
const y = await g(h.target.value);
|
|
233
|
+
s(y);
|
|
235
234
|
}, 350),
|
|
236
235
|
// Adjust the debounce delay as needed
|
|
237
236
|
[]
|
|
@@ -243,7 +242,14 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
|
|
|
243
242
|
onOpenChange: r,
|
|
244
243
|
open: i,
|
|
245
244
|
children: [
|
|
246
|
-
/* @__PURE__ */ u(
|
|
245
|
+
/* @__PURE__ */ u(
|
|
246
|
+
re,
|
|
247
|
+
{
|
|
248
|
+
asChild: !0,
|
|
249
|
+
disabled: l,
|
|
250
|
+
children: c
|
|
251
|
+
}
|
|
252
|
+
),
|
|
247
253
|
/* @__PURE__ */ u(
|
|
248
254
|
ne,
|
|
249
255
|
{
|
|
@@ -251,13 +257,13 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
|
|
|
251
257
|
className: "richtext-size-full richtext-p-2",
|
|
252
258
|
hideWhenDetached: !0,
|
|
253
259
|
side: "bottom",
|
|
254
|
-
children: t ? /* @__PURE__ */ P(
|
|
260
|
+
children: t ? /* @__PURE__ */ P(Z, { children: [
|
|
255
261
|
/* @__PURE__ */ u("div", { className: "richtext-mb-[10px] richtext-w-full", children: /* @__PURE__ */ u(
|
|
256
262
|
ie,
|
|
257
263
|
{
|
|
258
|
-
onChange:
|
|
264
|
+
onChange: _,
|
|
259
265
|
placeholder: "Search GIF",
|
|
260
|
-
ref:
|
|
266
|
+
ref: v,
|
|
261
267
|
type: "text"
|
|
262
268
|
}
|
|
263
269
|
) }),
|
|
@@ -280,14 +286,14 @@ function he({ selectImage: e, apiKey: t, provider: n, children: c }) {
|
|
|
280
286
|
}
|
|
281
287
|
);
|
|
282
288
|
}
|
|
283
|
-
function
|
|
284
|
-
const e =
|
|
289
|
+
function Ae() {
|
|
290
|
+
const e = ee(ue.name), {
|
|
285
291
|
action: t,
|
|
286
292
|
icon: n,
|
|
287
293
|
tooltip: c,
|
|
288
294
|
apiKey: i,
|
|
289
295
|
provider: r
|
|
290
|
-
} = (e == null ? void 0 : e.componentProps) ?? {}, { editorDisabled: a } =
|
|
296
|
+
} = (e == null ? void 0 : e.componentProps) ?? {}, { editorDisabled: a } = D();
|
|
291
297
|
return /* @__PURE__ */ u(
|
|
292
298
|
he,
|
|
293
299
|
{
|
|
@@ -297,8 +303,9 @@ function Ge() {
|
|
|
297
303
|
a || t && t(l);
|
|
298
304
|
},
|
|
299
305
|
children: /* @__PURE__ */ u(
|
|
300
|
-
|
|
306
|
+
K,
|
|
301
307
|
{
|
|
308
|
+
disabled: a,
|
|
302
309
|
icon: n,
|
|
303
310
|
tooltip: c
|
|
304
311
|
}
|
|
@@ -306,7 +313,7 @@ function Ge() {
|
|
|
306
313
|
}
|
|
307
314
|
);
|
|
308
315
|
}
|
|
309
|
-
const ue = /* @__PURE__ */
|
|
316
|
+
const ue = /* @__PURE__ */ Y.extend({
|
|
310
317
|
name: "imageGif",
|
|
311
318
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
312
319
|
//@ts-expect-error
|
|
@@ -366,7 +373,7 @@ const ue = /* @__PURE__ */ q.extend({
|
|
|
366
373
|
};
|
|
367
374
|
},
|
|
368
375
|
addNodeView() {
|
|
369
|
-
return
|
|
376
|
+
return V(ae);
|
|
370
377
|
},
|
|
371
378
|
addCommands() {
|
|
372
379
|
var e;
|
|
@@ -391,7 +398,7 @@ const ue = /* @__PURE__ */ q.extend({
|
|
|
391
398
|
},
|
|
392
399
|
[
|
|
393
400
|
"img",
|
|
394
|
-
|
|
401
|
+
q(
|
|
395
402
|
// Always render the `height="auto"`
|
|
396
403
|
{
|
|
397
404
|
height: "auto"
|
|
@@ -422,5 +429,5 @@ const ue = /* @__PURE__ */ q.extend({
|
|
|
422
429
|
});
|
|
423
430
|
export {
|
|
424
431
|
ue as ImageGif,
|
|
425
|
-
|
|
432
|
+
Ae as RichTextImageGif
|
|
426
433
|
};
|