@remarkablejames/editor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/lib/ActionMenuButton-B0EHT9CC.js +35 -0
- package/lib/ActionMenuButton-J1el_e6Z.cjs +1 -0
- package/lib/Attachment.cjs +19 -0
- package/lib/Attachment.js +273 -0
- package/lib/Blockquote.cjs +5 -0
- package/lib/Blockquote.js +107 -0
- package/lib/Bold.cjs +1 -0
- package/lib/Bold.js +123 -0
- package/lib/BulletList.cjs +1 -0
- package/lib/BulletList.js +53 -0
- package/lib/Callout.cjs +1 -0
- package/lib/Callout.js +225 -0
- package/lib/Clear.cjs +1 -0
- package/lib/Clear.js +49 -0
- package/lib/Code.cjs +1 -0
- package/lib/Code.js +100 -0
- package/lib/CodeBlock.cjs +44 -0
- package/lib/CodeBlock.js +4065 -0
- package/lib/CodeView.cjs +1 -0
- package/lib/CodeView.js +81 -0
- package/lib/Color.cjs +1 -0
- package/lib/Color.js +134 -0
- package/lib/Column.cjs +1 -0
- package/lib/Column.js +230 -0
- package/lib/Drawer-BCWVN-4l.js +1125 -0
- package/lib/Drawer-BTouEroZ.cjs +2 -0
- package/lib/Drawer.cjs +1 -0
- package/lib/Drawer.js +7 -0
- package/lib/Emoji.cjs +1 -0
- package/lib/Emoji.js +19888 -0
- package/lib/Excalidraw.cjs +1 -0
- package/lib/Excalidraw.js +276 -0
- package/lib/ExportPdf.cjs +39 -0
- package/lib/ExportPdf.js +142 -0
- package/lib/ExportWord.cjs +1 -0
- package/lib/ExportWord.js +107 -0
- package/lib/FontFamily.cjs +1 -0
- package/lib/FontFamily.js +84 -0
- package/lib/FontSize.cjs +1 -0
- package/lib/FontSize.js +106 -0
- package/lib/Heading.cjs +1 -0
- package/lib/Heading.js +167 -0
- package/lib/Highlight.cjs +1 -0
- package/lib/Highlight.js +203 -0
- package/lib/History.cjs +1 -0
- package/lib/History.js +990 -0
- package/lib/HorizontalRule.cjs +1 -0
- package/lib/HorizontalRule.js +118 -0
- package/lib/Iframe-BdgiWGml.js +416 -0
- package/lib/Iframe-BfBLILDA.cjs +1 -0
- package/lib/Iframe.cjs +1 -0
- package/lib/Iframe.js +7 -0
- package/lib/Image.cjs +1 -0
- package/lib/Image.js +6 -0
- package/lib/ImageGif.cjs +1 -0
- package/lib/ImageGif.js +400 -0
- package/lib/ImportWord.cjs +1 -0
- package/lib/ImportWord.js +145 -0
- package/lib/Indent-BpMcZKok.js +148 -0
- package/lib/Indent-Dvqz_WEn.cjs +1 -0
- package/lib/Indent.cjs +1 -0
- package/lib/Indent.js +6 -0
- package/lib/Italic.cjs +1 -0
- package/lib/Italic.js +123 -0
- package/lib/Katex-B8_uprkO.js +2753 -0
- package/lib/Katex-BQyeCeQ0.cjs +4 -0
- package/lib/Katex.cjs +1 -0
- package/lib/Katex.js +6 -0
- package/lib/LineHeight.cjs +1 -0
- package/lib/LineHeight.js +89 -0
- package/lib/Link.cjs +1 -0
- package/lib/Link.js +6 -0
- package/lib/LinkEditBlock-BX0fXXpF.js +1185 -0
- package/lib/LinkEditBlock-CIshn_8F.cjs +5 -0
- package/lib/Mention.cjs +1 -0
- package/lib/Mention.js +265 -0
- package/lib/Mermaid-0GiGVxn0.cjs +2 -0
- package/lib/Mermaid-D8bbIgAl.js +381 -0
- package/lib/Mermaid.cjs +1 -0
- package/lib/Mermaid.js +7 -0
- package/lib/MoreMark.cjs +1 -0
- package/lib/MoreMark.js +157 -0
- package/lib/OrderedList.cjs +1 -0
- package/lib/OrderedList.js +52 -0
- package/lib/SearchAndReplace.cjs +1 -0
- package/lib/SearchAndReplace.js +305 -0
- package/lib/SlashCommand.cjs +1 -0
- package/lib/SlashCommand.js +90 -0
- package/lib/SlashCommandNodeView-BcmtKbEE.js +249 -0
- package/lib/SlashCommandNodeView-rDJ7OjRd.cjs +1 -0
- package/lib/Strike.cjs +1 -0
- package/lib/Strike.js +112 -0
- package/lib/Table-BEhNBeuA.cjs +5 -0
- package/lib/Table-DbxuP5xh.js +1939 -0
- package/lib/Table.cjs +1 -0
- package/lib/Table.js +5 -0
- package/lib/TaskList.cjs +1 -0
- package/lib/TaskList.js +63 -0
- package/lib/TextAlign.cjs +1 -0
- package/lib/TextAlign.js +165 -0
- package/lib/TextDirection.cjs +1 -0
- package/lib/TextDirection.js +110 -0
- package/lib/TextUnderline.cjs +1 -0
- package/lib/TextUnderline.js +115 -0
- package/lib/Twitter-9I6BLNmg.js +1666 -0
- package/lib/Twitter-BuEBgpi9.cjs +1 -0
- package/lib/Twitter.cjs +1 -0
- package/lib/Twitter.js +6 -0
- package/lib/Video.cjs +1 -0
- package/lib/Video.js +7 -0
- package/lib/bubble.cjs +3 -0
- package/lib/bubble.d.ts +1 -0
- package/lib/bubble.js +9533 -0
- package/lib/clsx-CDyrfCnw.js +7391 -0
- package/lib/clsx-CXbNJWDD.cjs +54 -0
- package/lib/components/ActionButton.d.ts +23 -0
- package/lib/components/ActionMenuButton.d.ts +28 -0
- package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -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 +13 -0
- package/lib/components/ColorPicker.d.ts +11 -0
- package/lib/components/ReactBus.d.ts +11 -0
- package/lib/components/RichTextProvider.d.ts +8 -0
- package/lib/components/SizeSetter/SizeSetter.d.ts +13 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -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 +15 -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/delete-node-CosiBes5.cjs +1 -0
- package/lib/delete-node-eQHsyyhR.js +24 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/dropdown-menu-Bs69ZBbO.js +143 -0
- package/lib/dropdown-menu-DjWlG2-J.cjs +1 -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/Callout/Callout.d.ts +18 -0
- package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
- package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
- package/lib/extensions/Callout/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 +5 -0
- package/lib/extensions/Emoji/components/EmojiList/EmojiNodeView.d.ts +11 -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 +64 -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/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 +9 -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 +3 -0
- package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +16 -0
- package/lib/extensions/Mention/index.d.ts +1 -0
- package/lib/extensions/Mermaid/Mermaid.d.ts +27 -0
- package/lib/extensions/Mermaid/components/EditMermaidBlock.d.ts +9 -0
- package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +9 -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 +20 -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/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-4Q5IhypJ.js +1349 -0
- package/lib/index-BCzvbrf5.cjs +12 -0
- package/lib/index-BG0kQamI.js +285 -0
- package/lib/index-C-tDsIKJ.js +1631 -0
- package/lib/index-C1WCZhyA.js +237 -0
- package/lib/index-CjhjjJsN.cjs +1 -0
- package/lib/index-Cs6cp0Y6.cjs +1 -0
- package/lib/index-CsSfYR30.js +1351 -0
- package/lib/index-D9oM__YW.cjs +1 -0
- package/lib/index-DjDf4BK8.js +707 -0
- package/lib/index-NsYff_Ni.cjs +1 -0
- package/lib/index-bVGIXhRg.cjs +1 -0
- package/lib/index-lj3VWExo.js +4883 -0
- package/lib/index-neeeY2o7.cjs +4 -0
- package/lib/index.cjs +115 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +338 -0
- package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
- package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
- package/lib/lib/utils.d.ts +2 -0
- package/lib/locale-bundle.cjs +1 -0
- package/lib/locale-bundle.d.ts +1 -0
- package/lib/locale-bundle.js +11 -0
- package/lib/locales/en.d.ts +196 -0
- package/lib/locales/fi.d.ts +196 -0
- package/lib/locales/hu.d.ts +196 -0
- package/lib/locales/index.d.ts +1198 -0
- package/lib/locales/pt-br.d.ts +196 -0
- package/lib/locales/vi.d.ts +196 -0
- package/lib/locales/zh-cn.d.ts +196 -0
- package/lib/plugins/image-upload.d.ts +13 -0
- package/lib/popover-CPr9bHYn.js +24 -0
- package/lib/popover-D-hUKDYu.cjs +1 -0
- package/lib/renderNodeView-BJSrgyGj.js +28 -0
- package/lib/renderNodeView-DfLmGrgA.cjs +1 -0
- package/lib/select-C2KF4RNg.cjs +1 -0
- package/lib/select-CuE_HaQJ.js +120 -0
- package/lib/separator-CHzYNMVt.js +293 -0
- package/lib/separator-_gvUNba_.cjs +1 -0
- package/lib/store/EditorEditableReactive.d.ts +1 -0
- package/lib/store/ThemeColorReactive.d.ts +1 -0
- package/lib/store/commandList.d.ts +2 -0
- package/lib/store/editor.d.ts +21 -0
- package/lib/store/store.d.ts +3 -0
- package/lib/style.css +1 -0
- package/lib/textarea-DZj6EY-N.cjs +1 -0
- package/lib/textarea-gEoNp9CA.js +20 -0
- package/lib/theme/theme.d.ts +369 -0
- package/lib/theme.cjs +1 -0
- package/lib/theme.js +395 -0
- package/lib/types.d.ts +230 -0
- package/lib/updatePosition-Cjuj2E26.cjs +1 -0
- package/lib/updatePosition-e90ZrFWW.js +16 -0
- package/lib/utils/base64.d.ts +2 -0
- package/lib/utils/checkIsVideoUrl.d.ts +1 -0
- package/lib/utils/color.d.ts +7 -0
- package/lib/utils/columns.d.ts +14 -0
- package/lib/utils/customEvents/events.constant.d.ts +6 -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 +24 -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/renderNodeView.d.ts +6 -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 +845 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./clsx-CXbNJWDD.cjs"),l=require("@tiptap/pm/state"),p=require("./index-D9oM__YW.cjs"),m=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=i.Node3.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",i.mergeAttributes(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,n)=>n.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:n})=>{if(!i.canInsertNode(n,n.schema.nodes[this.name]))return!1;const{selection:r}=n,{$to:s}=r,c=t();return i.isNodeSelection(r)?c.insertContentAt(s.pos,{type:this.name}):c.insertContent({type:this.name}),c.command(({state:a,tr:e,dispatch:h})=>{if(h){const{$to:o}=e.selection,u=o.end();if(o.nodeAfter)o.nodeAfter.isTextblock?e.setSelection(l.TextSelection.create(e.doc,o.pos+1)):o.nodeAfter.isBlock?e.setSelection(l.NodeSelection.create(e.doc,o.pos)):e.setSelection(l.TextSelection.create(e.doc,o.pos));else{const d=a.schema.nodes[this.options.nextNodeType]||o.parent.type.contentMatch.defaultType,T=d==null?void 0:d.create();T&&(e.insert(u,T),e.setSelection(l.TextSelection.create(e.doc,u+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[i.nodeInputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});function A(){const t=p.useButtonProps(f.name),{icon:n=void 0,tooltip:r=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:e=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:h,disabled:o,update:u}=p.useToggleActive(e),d=()=>{o||a&&(a(),u())};return t?m.jsx(p.ActionButton,{action:d,dataState:h,disabled:o,icon:n,shortcutKeys:s,tooltip:r,tooltipOptions:c}):m.jsx(m.Fragment,{})}const f=y.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:n,t:r,extension:s})=>({component:p.ActionButton,componentProps:{action:()=>n.commands.setHorizontalRule(),disabled:!n.can().setHorizontalRule(),icon:"Minus",shortcutKeys:s.options.shortcutKeys??["mod","alt","S"],tooltip:r("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}},renderHTML(){return["div",i.mergeAttributes(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]}});exports.HorizontalRule=f;exports.RichTextHorizontalRule=A;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { N as T, n as A, o as y, q as H, m as h } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { TextSelection as u, NodeSelection as R } from "@tiptap/pm/state";
|
|
3
|
+
import { u as M, d as v, A as f } from "./index-lj3VWExo.js";
|
|
4
|
+
import { jsx as m, Fragment as z } from "react/jsx-runtime";
|
|
5
|
+
import "react";
|
|
6
|
+
import "./theme.js";
|
|
7
|
+
var S = T.create({
|
|
8
|
+
name: "horizontalRule",
|
|
9
|
+
addOptions() {
|
|
10
|
+
return {
|
|
11
|
+
HTMLAttributes: {},
|
|
12
|
+
nextNodeType: "paragraph"
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
group: "block",
|
|
16
|
+
parseHTML() {
|
|
17
|
+
return [{ tag: "hr" }];
|
|
18
|
+
},
|
|
19
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
20
|
+
return ["hr", h(this.options.HTMLAttributes, t)];
|
|
21
|
+
},
|
|
22
|
+
markdownTokenName: "hr",
|
|
23
|
+
parseMarkdown: (t, n) => n.createNode("horizontalRule"),
|
|
24
|
+
renderMarkdown: () => "---",
|
|
25
|
+
addCommands() {
|
|
26
|
+
return {
|
|
27
|
+
setHorizontalRule: () => ({ chain: t, state: n }) => {
|
|
28
|
+
if (!y(n, n.schema.nodes[this.name]))
|
|
29
|
+
return !1;
|
|
30
|
+
const { selection: r } = n, { $to: s } = r, i = t();
|
|
31
|
+
return H(r) ? i.insertContentAt(s.pos, {
|
|
32
|
+
type: this.name
|
|
33
|
+
}) : i.insertContent({ type: this.name }), i.command(({ state: a, tr: e, dispatch: l }) => {
|
|
34
|
+
if (l) {
|
|
35
|
+
const { $to: o } = e.selection, c = o.end();
|
|
36
|
+
if (o.nodeAfter)
|
|
37
|
+
o.nodeAfter.isTextblock ? e.setSelection(u.create(e.doc, o.pos + 1)) : o.nodeAfter.isBlock ? e.setSelection(R.create(e.doc, o.pos)) : e.setSelection(u.create(e.doc, o.pos));
|
|
38
|
+
else {
|
|
39
|
+
const d = a.schema.nodes[this.options.nextNodeType] || o.parent.type.contentMatch.defaultType, p = d == null ? void 0 : d.create();
|
|
40
|
+
p && (e.insert(c, p), e.setSelection(u.create(e.doc, c + 1)));
|
|
41
|
+
}
|
|
42
|
+
e.scrollIntoView();
|
|
43
|
+
}
|
|
44
|
+
return !0;
|
|
45
|
+
}).run();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
addInputRules() {
|
|
50
|
+
return [
|
|
51
|
+
A({
|
|
52
|
+
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
53
|
+
type: this.type
|
|
54
|
+
})
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function w() {
|
|
59
|
+
const t = M(b.name), {
|
|
60
|
+
icon: n = void 0,
|
|
61
|
+
tooltip: r = void 0,
|
|
62
|
+
shortcutKeys: s = void 0,
|
|
63
|
+
tooltipOptions: i = {},
|
|
64
|
+
action: a = void 0,
|
|
65
|
+
isActive: e = void 0
|
|
66
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: l, disabled: o, update: c } = v(e), d = () => {
|
|
67
|
+
o || a && (a(), c());
|
|
68
|
+
};
|
|
69
|
+
return t ? /* @__PURE__ */ m(
|
|
70
|
+
f,
|
|
71
|
+
{
|
|
72
|
+
action: d,
|
|
73
|
+
dataState: l,
|
|
74
|
+
disabled: o,
|
|
75
|
+
icon: n,
|
|
76
|
+
shortcutKeys: s,
|
|
77
|
+
tooltip: r,
|
|
78
|
+
tooltipOptions: i
|
|
79
|
+
}
|
|
80
|
+
) : /* @__PURE__ */ m(z, {});
|
|
81
|
+
}
|
|
82
|
+
const b = /* @__PURE__ */ S.extend({
|
|
83
|
+
//@ts-expect-error
|
|
84
|
+
addOptions() {
|
|
85
|
+
var t;
|
|
86
|
+
return {
|
|
87
|
+
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
88
|
+
button: ({ editor: n, t: r, extension: s }) => ({
|
|
89
|
+
component: f,
|
|
90
|
+
componentProps: {
|
|
91
|
+
action: () => n.commands.setHorizontalRule(),
|
|
92
|
+
disabled: !n.can().setHorizontalRule(),
|
|
93
|
+
icon: "Minus",
|
|
94
|
+
shortcutKeys: s.options.shortcutKeys ?? ["mod", "alt", "S"],
|
|
95
|
+
tooltip: r("editor.horizontalrule.tooltip")
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
addKeyboardShortcuts() {
|
|
101
|
+
return {
|
|
102
|
+
"Mod-Alt-s": () => this.editor.commands.setHorizontalRule()
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
renderHTML() {
|
|
106
|
+
return [
|
|
107
|
+
"div",
|
|
108
|
+
h(this.options.HTMLAttributes, {
|
|
109
|
+
"data-type": this.name
|
|
110
|
+
}),
|
|
111
|
+
["hr"]
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
export {
|
|
116
|
+
b as HorizontalRule,
|
|
117
|
+
w as RichTextHorizontalRule
|
|
118
|
+
};
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { h as v, j as x, N as k, k as y, n as S, m as I } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { jsxs as f, jsx as d, Fragment as P } from "react/jsx-runtime";
|
|
3
|
+
import { Resizable as M } from "re-resizable";
|
|
4
|
+
import { useState as R, useCallback as N } from "react";
|
|
5
|
+
import { g as l } from "./dom-dataset-CIEeltF6.js";
|
|
6
|
+
import { J as j, j as U, B as q, u as A, d as L, A as D } from "./index-lj3VWExo.js";
|
|
7
|
+
import "./theme.js";
|
|
8
|
+
const m = {
|
|
9
|
+
youtube: {
|
|
10
|
+
example: "https://www.youtube.com/watch?v=I4sMhHbHYXM",
|
|
11
|
+
src: "https://www.youtube.com/embed/I4sMhHbHYXM",
|
|
12
|
+
srcPrefix: "https://www.youtube.com/embed",
|
|
13
|
+
linkRule: [
|
|
14
|
+
/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
youku: {
|
|
18
|
+
example: "https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",
|
|
19
|
+
src: "https://player.youku.com/embed/XNDM0NDM4MTcy",
|
|
20
|
+
srcPrefix: "https://player.youku.com/embed",
|
|
21
|
+
linkRule: [String.raw`v.youku.com\/v_show\/id_\w+\=*`],
|
|
22
|
+
idRule: String.raw`id_\w+\=*`
|
|
23
|
+
},
|
|
24
|
+
bilibili: {
|
|
25
|
+
example: "https://www.bilibili.com/video/BV1EJ411u7DN",
|
|
26
|
+
src: "https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",
|
|
27
|
+
srcPrefix: "https://player.bilibili.com/player.html?bvid",
|
|
28
|
+
linkRule: [String.raw`www.bilibili.com\/video\/\w+`]
|
|
29
|
+
},
|
|
30
|
+
qqvideo: {
|
|
31
|
+
example: "https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",
|
|
32
|
+
src: "https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",
|
|
33
|
+
srcPrefix: "https://v.qq.com/txp/iframe/player.html?vid",
|
|
34
|
+
linkRule: [String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]
|
|
35
|
+
},
|
|
36
|
+
amap: {
|
|
37
|
+
example: "https://ditu.amap.com/",
|
|
38
|
+
src: "https://www.amap.com/place/B000A45467",
|
|
39
|
+
srcPrefix: "",
|
|
40
|
+
linkRule: [String.raw`\.amap\.com`]
|
|
41
|
+
},
|
|
42
|
+
baidu_map: {
|
|
43
|
+
example: "https://j.map.baidu.com/15/fo",
|
|
44
|
+
src: "https://j.map.baidu.com/15/fo",
|
|
45
|
+
srcPrefix: "",
|
|
46
|
+
linkRule: [String.raw`map\.baidu\.com`]
|
|
47
|
+
},
|
|
48
|
+
modao: {
|
|
49
|
+
example: "https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",
|
|
50
|
+
src: "https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",
|
|
51
|
+
srcPrefix: "",
|
|
52
|
+
linkRule: [String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],
|
|
53
|
+
tips: "Modao > More > Share > Embed > COPY"
|
|
54
|
+
},
|
|
55
|
+
lanhu: {
|
|
56
|
+
example: "https://lanhuapp.com/link/#/invite?sid=evP7L",
|
|
57
|
+
src: "https://lanhuapp.com/url/evP7L",
|
|
58
|
+
srcPrefix: "",
|
|
59
|
+
linkRule: [String.raw`https:\/\/lanhuapp.com\/url\/\w+`],
|
|
60
|
+
tips: "Lanhu > Project > Share > Copy Link"
|
|
61
|
+
},
|
|
62
|
+
figma: {
|
|
63
|
+
example: "https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",
|
|
64
|
+
src: "https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",
|
|
65
|
+
srcPrefix: "https://www.figma.com/embed?embed_host=share&url",
|
|
66
|
+
linkRule: [String.raw`https:\/\/www.figma.com\/file\/\w+`]
|
|
67
|
+
},
|
|
68
|
+
canva: {
|
|
69
|
+
example: "https://www.canva.cn/design/DAD61-t29UI/view",
|
|
70
|
+
src: "https://www.canva.cn/design/DAD61-t29UI/view",
|
|
71
|
+
srcPrefix: "",
|
|
72
|
+
linkRule: [String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]
|
|
73
|
+
},
|
|
74
|
+
processon: {
|
|
75
|
+
example: "https://www.processon.com/embed/5ea99d8607912948b0e6fe78",
|
|
76
|
+
src: "https://www.processon.com/embed/5ea99d8607912948b0e6fe78",
|
|
77
|
+
srcPrefix: "",
|
|
78
|
+
linkRule: [String.raw`https:\/\/www.processon.com\/embed\/\w+`]
|
|
79
|
+
},
|
|
80
|
+
codepen: {
|
|
81
|
+
example: "https://codepen.io/mekery/embed/YzyrKOJ",
|
|
82
|
+
src: "https://codepen.io/mekery/embed/YzyrKOJ",
|
|
83
|
+
srcPrefix: "",
|
|
84
|
+
linkRule: [String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]
|
|
85
|
+
},
|
|
86
|
+
jinshuju: {
|
|
87
|
+
example: "https://jinshuju.net/f/q9YvVf",
|
|
88
|
+
src: "https://jinshuju.net/f/q9YvVf",
|
|
89
|
+
srcPrefix: "",
|
|
90
|
+
linkRule: [String.raw`https:\/\/jinshuju.net\/f\/\w+`]
|
|
91
|
+
},
|
|
92
|
+
iframe: {
|
|
93
|
+
example: "https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",
|
|
94
|
+
src: "https://player.youku.com/embed/XNDM0NDM4MTcy",
|
|
95
|
+
srcPrefix: "",
|
|
96
|
+
linkRule: [".+"]
|
|
97
|
+
},
|
|
98
|
+
googlemaps: {
|
|
99
|
+
example: "https://goo.gl/maps/8Ys8b4K1ZJY2",
|
|
100
|
+
src: "https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",
|
|
101
|
+
srcPrefix: "",
|
|
102
|
+
linkRule: [String.raw`https:\/\/goo.gl\/maps\/\w+`]
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
function _(e) {
|
|
106
|
+
const t = m.youtube, i = e.matchedUrl;
|
|
107
|
+
e.validLink = !0;
|
|
108
|
+
const r = i.split("="), n = r.length;
|
|
109
|
+
if (n > 0) {
|
|
110
|
+
const c = r[n - 1];
|
|
111
|
+
e.src = `${t.srcPrefix}/${c}`, e.validId = !0;
|
|
112
|
+
}
|
|
113
|
+
return e;
|
|
114
|
+
}
|
|
115
|
+
function $(e) {
|
|
116
|
+
const t = m.youku, i = e.matchedUrl, r = t.idRule, n = new RegExp(r), c = i.match(n);
|
|
117
|
+
if (c && c.length > 0) {
|
|
118
|
+
const o = c[0].slice(3);
|
|
119
|
+
e.validId = !0, e.src = `${t.srcPrefix}/${o}`;
|
|
120
|
+
} else
|
|
121
|
+
e.validId = !1;
|
|
122
|
+
return e;
|
|
123
|
+
}
|
|
124
|
+
function T(e) {
|
|
125
|
+
const t = m.bilibili, r = e.matchedUrl.split("/"), n = r.length;
|
|
126
|
+
if (n > 0) {
|
|
127
|
+
const c = r[n - 1];
|
|
128
|
+
e.src = `${t.srcPrefix}=${c}`, e.validId = !0;
|
|
129
|
+
}
|
|
130
|
+
return e;
|
|
131
|
+
}
|
|
132
|
+
function Y(e) {
|
|
133
|
+
const t = m.qqvideo, r = e.matchedUrl.split("/"), n = r.length;
|
|
134
|
+
if (n > 0) {
|
|
135
|
+
const c = r[n - 1];
|
|
136
|
+
e.src = `${t.srcPrefix}=${c}`, e.validId = !0;
|
|
137
|
+
}
|
|
138
|
+
return e;
|
|
139
|
+
}
|
|
140
|
+
function z(e, t) {
|
|
141
|
+
return t.src = e, t.validId = !0, t;
|
|
142
|
+
}
|
|
143
|
+
function C(e, t) {
|
|
144
|
+
return t.src = e, t.validId = !0, t;
|
|
145
|
+
}
|
|
146
|
+
function E(e, t) {
|
|
147
|
+
return t.src = e, t.validId = !0, t.originalLink = e, t;
|
|
148
|
+
}
|
|
149
|
+
function H(e) {
|
|
150
|
+
return e.src = e.matchedUrl, e.validId = !0, e.originalLink = e.src, e;
|
|
151
|
+
}
|
|
152
|
+
function B(e) {
|
|
153
|
+
return e.src = e.matchedUrl, e.validId = !0, e.originalLink = e.src, e;
|
|
154
|
+
}
|
|
155
|
+
function V(e) {
|
|
156
|
+
const t = m.figma;
|
|
157
|
+
return e.src = `${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`, e.validId = !0, e.originalLink = e.matchedUrl, e;
|
|
158
|
+
}
|
|
159
|
+
function J(e, t) {
|
|
160
|
+
return t.src = `${t.matchedUrl}?embed`, t.validId = !0, t.originalLink = e, t;
|
|
161
|
+
}
|
|
162
|
+
function K(e, t) {
|
|
163
|
+
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = e, t;
|
|
164
|
+
}
|
|
165
|
+
function O(e) {
|
|
166
|
+
return e.src = `${e.matchedUrl}`, e.validId = !0, e.originalLink = e.src, e;
|
|
167
|
+
}
|
|
168
|
+
function X(e, t) {
|
|
169
|
+
return t.src = `${t.matchedUrl}?background=white&banner=show&embedded=true`, t.validId = !0, t.originalLink = e, t;
|
|
170
|
+
}
|
|
171
|
+
function W(e, t) {
|
|
172
|
+
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = e, t;
|
|
173
|
+
}
|
|
174
|
+
function F(e, t, i) {
|
|
175
|
+
if (e === "googlemaps")
|
|
176
|
+
return i.validLink = !0, i.matchedUrl = t, i;
|
|
177
|
+
const n = m[e].linkRule;
|
|
178
|
+
for (const c of n) {
|
|
179
|
+
const o = new RegExp(c), a = t.match(o);
|
|
180
|
+
if (a && a.length > 0)
|
|
181
|
+
return i.validLink = !0, i.matchedUrl = e === "youtube" ? a[1] : a[0], i;
|
|
182
|
+
}
|
|
183
|
+
return i;
|
|
184
|
+
}
|
|
185
|
+
function G(e) {
|
|
186
|
+
var i, r;
|
|
187
|
+
let t = "iframe";
|
|
188
|
+
return ((i = e.includes) != null && i.call(e, "youtube") || (r = e.includes) != null && r.call(e, "youtu.be")) && (t = "youtube"), e.includes("youku") && (t = "youku"), e.includes("bilibili") && (t = "bilibili"), e.includes("qq") && (t = "qqvideo"), e.includes("amap") && (t = "amap"), e.includes("map.baidu") && (t = "baidu_map"), (e.includes("google.com/maps") || e.includes("maps.app.goo.gl")) && (t = "googlemaps"), e.includes("modao") && (t = "modao"), e.includes("lanhuapp") && (t = "lanhu"), e.includes("figma") && (t = "figma"), e.includes("canva") && (t = "canva"), e.includes("processon") && (t = "processon"), e.includes("codepen") && (t = "codepen"), e.includes("jinshuju") && (t = "jinshuju"), e.includes("iframe") && (t = "iframe"), t;
|
|
189
|
+
}
|
|
190
|
+
function Z(e) {
|
|
191
|
+
let t = {
|
|
192
|
+
validLink: !1,
|
|
193
|
+
validId: !1,
|
|
194
|
+
matchedUrl: "",
|
|
195
|
+
originalLink: e,
|
|
196
|
+
src: ""
|
|
197
|
+
};
|
|
198
|
+
const i = G(e);
|
|
199
|
+
if (t = F(i, e, t), !t.validLink)
|
|
200
|
+
return t;
|
|
201
|
+
switch (i) {
|
|
202
|
+
case "youtube":
|
|
203
|
+
return _(t);
|
|
204
|
+
case "youku":
|
|
205
|
+
return $(t);
|
|
206
|
+
case "bilibili":
|
|
207
|
+
return T(t);
|
|
208
|
+
case "qqvideo":
|
|
209
|
+
return Y(t);
|
|
210
|
+
case "amap":
|
|
211
|
+
return z(e, t);
|
|
212
|
+
case "baidu_map":
|
|
213
|
+
return C(e, t);
|
|
214
|
+
case "googlemaps":
|
|
215
|
+
return E(e, t);
|
|
216
|
+
case "modao":
|
|
217
|
+
return H(t);
|
|
218
|
+
case "lanhu":
|
|
219
|
+
return B(t);
|
|
220
|
+
case "figma":
|
|
221
|
+
return V(t);
|
|
222
|
+
case "canva":
|
|
223
|
+
return J(e, t);
|
|
224
|
+
case "processon":
|
|
225
|
+
return K(e, t);
|
|
226
|
+
case "codepen":
|
|
227
|
+
return O(t);
|
|
228
|
+
case "jinshuju":
|
|
229
|
+
return X(e, t);
|
|
230
|
+
case "iframe":
|
|
231
|
+
return W(e, t);
|
|
232
|
+
default:
|
|
233
|
+
return e;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const Q = "_wrap_5y04w_1", ee = "_innerWrap_5y04w_15", w = {
|
|
237
|
+
wrap: Q,
|
|
238
|
+
innerWrap: ee
|
|
239
|
+
};
|
|
240
|
+
function te({ editor: e, node: t, updateAttributes: i }) {
|
|
241
|
+
const r = j(), { src: n, width: c, height: o } = t.attrs, [a, p] = R("");
|
|
242
|
+
function u() {
|
|
243
|
+
if (!a)
|
|
244
|
+
return;
|
|
245
|
+
const s = Z(a);
|
|
246
|
+
e.chain().updateAttributes(b.name, {
|
|
247
|
+
src: (s == null ? void 0 : s.src) || a
|
|
248
|
+
}).setNodeSelection(e.state.selection.from).focus().run();
|
|
249
|
+
}
|
|
250
|
+
const g = N(
|
|
251
|
+
(s) => {
|
|
252
|
+
i({ width: s.width, height: s.height });
|
|
253
|
+
},
|
|
254
|
+
[i]
|
|
255
|
+
);
|
|
256
|
+
return /* @__PURE__ */ f(v, { children: [
|
|
257
|
+
!n && /* @__PURE__ */ f("div", { className: "richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-border richtext-p-[10px]", children: [
|
|
258
|
+
/* @__PURE__ */ d(
|
|
259
|
+
U,
|
|
260
|
+
{
|
|
261
|
+
autoFocus: !0,
|
|
262
|
+
className: "richtext-flex-1",
|
|
263
|
+
onInput: (s) => p(s.target.value),
|
|
264
|
+
placeholder: "Enter link",
|
|
265
|
+
type: "url",
|
|
266
|
+
value: a
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ d(q, { className: "richtext-w-[60px]", onClick: u, children: "OK" })
|
|
270
|
+
] }),
|
|
271
|
+
n && /* @__PURE__ */ d(
|
|
272
|
+
M,
|
|
273
|
+
{
|
|
274
|
+
size: {
|
|
275
|
+
width: Number.parseInt(c),
|
|
276
|
+
height: Number.parseInt(o)
|
|
277
|
+
},
|
|
278
|
+
onResizeStop: (s, ie, re, h) => {
|
|
279
|
+
g({
|
|
280
|
+
width: Number.parseInt(c) + h.width,
|
|
281
|
+
height: Number.parseInt(o) + h.height
|
|
282
|
+
});
|
|
283
|
+
},
|
|
284
|
+
children: /* @__PURE__ */ d("div", { className: x(w.wrap, "render-wrapper"), children: /* @__PURE__ */ d(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
className: w.innerWrap,
|
|
288
|
+
style: { pointerEvents: r ? "none" : "auto" },
|
|
289
|
+
children: /* @__PURE__ */ d("iframe", { className: "richtext-my-[12px]", src: n })
|
|
290
|
+
}
|
|
291
|
+
) })
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
] });
|
|
295
|
+
}
|
|
296
|
+
function pe() {
|
|
297
|
+
const e = A(b.name), {
|
|
298
|
+
icon: t = void 0,
|
|
299
|
+
tooltip: i = void 0,
|
|
300
|
+
shortcutKeys: r = void 0,
|
|
301
|
+
tooltipOptions: n = {},
|
|
302
|
+
action: c = void 0,
|
|
303
|
+
isActive: o = void 0
|
|
304
|
+
} = (e == null ? void 0 : e.componentProps) ?? {}, { editorDisabled: a, update: p } = L(o), u = () => {
|
|
305
|
+
a || c && (c(), p());
|
|
306
|
+
};
|
|
307
|
+
return e ? /* @__PURE__ */ d(
|
|
308
|
+
D,
|
|
309
|
+
{
|
|
310
|
+
action: u,
|
|
311
|
+
disabled: a,
|
|
312
|
+
icon: t,
|
|
313
|
+
shortcutKeys: r,
|
|
314
|
+
tooltip: i,
|
|
315
|
+
tooltipOptions: n
|
|
316
|
+
}
|
|
317
|
+
) : /* @__PURE__ */ d(P, {});
|
|
318
|
+
}
|
|
319
|
+
const b = /* @__PURE__ */ k.create({
|
|
320
|
+
name: "iframe",
|
|
321
|
+
content: "",
|
|
322
|
+
marks: "",
|
|
323
|
+
group: "block",
|
|
324
|
+
selectable: !0,
|
|
325
|
+
atom: !0,
|
|
326
|
+
draggable: !0,
|
|
327
|
+
addOptions() {
|
|
328
|
+
var e;
|
|
329
|
+
return {
|
|
330
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
331
|
+
HTMLAttributes: {
|
|
332
|
+
class: "iframe"
|
|
333
|
+
},
|
|
334
|
+
button: ({
|
|
335
|
+
editor: t,
|
|
336
|
+
extension: i,
|
|
337
|
+
t: r
|
|
338
|
+
}) => ({
|
|
339
|
+
componentProps: {
|
|
340
|
+
action: (n) => t.commands.setIframe(n),
|
|
341
|
+
upload: i.options.upload,
|
|
342
|
+
// isActive: () => editor.can().setIframe({}),
|
|
343
|
+
icon: "Iframe",
|
|
344
|
+
tooltip: r("editor.iframe.tooltip")
|
|
345
|
+
}
|
|
346
|
+
})
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
addAttributes() {
|
|
350
|
+
return {
|
|
351
|
+
width: {
|
|
352
|
+
default: 600,
|
|
353
|
+
parseHTML: l("width")
|
|
354
|
+
},
|
|
355
|
+
height: {
|
|
356
|
+
default: 300,
|
|
357
|
+
parseHTML: l("height")
|
|
358
|
+
},
|
|
359
|
+
src: {
|
|
360
|
+
default: null,
|
|
361
|
+
parseHTML: l("src")
|
|
362
|
+
},
|
|
363
|
+
defaultShowPicker: {
|
|
364
|
+
default: !1
|
|
365
|
+
},
|
|
366
|
+
frameborder: {
|
|
367
|
+
default: 0
|
|
368
|
+
},
|
|
369
|
+
allowfullscreen: {
|
|
370
|
+
default: this.options.allowFullscreen,
|
|
371
|
+
parseHTML: () => this.options.allowFullscreen
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
},
|
|
375
|
+
parseHTML() {
|
|
376
|
+
return [
|
|
377
|
+
{
|
|
378
|
+
tag: "iframe"
|
|
379
|
+
}
|
|
380
|
+
];
|
|
381
|
+
},
|
|
382
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
383
|
+
return ["iframe", I(this.options.HTMLAttributes, e)];
|
|
384
|
+
},
|
|
385
|
+
addCommands() {
|
|
386
|
+
return {
|
|
387
|
+
setIframe: (e) => ({ tr: t, commands: i, chain: r }) => {
|
|
388
|
+
var c, o, a;
|
|
389
|
+
if (((a = (o = (c = t.selection) == null ? void 0 : c.node) == null ? void 0 : o.type) == null ? void 0 : a.name) == this.name)
|
|
390
|
+
return i.updateAttributes(this.name, e);
|
|
391
|
+
const n = e || { url: "" };
|
|
392
|
+
return r().insertContent({
|
|
393
|
+
type: this.name,
|
|
394
|
+
attrs: n
|
|
395
|
+
}).run();
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
},
|
|
399
|
+
addInputRules() {
|
|
400
|
+
return [
|
|
401
|
+
S({
|
|
402
|
+
find: /^\$iframe\$$/,
|
|
403
|
+
type: this.type,
|
|
404
|
+
getAttributes: () => ({ width: "100%" })
|
|
405
|
+
})
|
|
406
|
+
];
|
|
407
|
+
},
|
|
408
|
+
addNodeView() {
|
|
409
|
+
return y(te);
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
export {
|
|
413
|
+
b as I,
|
|
414
|
+
pe as R,
|
|
415
|
+
Z as g
|
|
416
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),y=require("re-resizable"),g=require("react"),f=require("./dom-dataset-BqoJhJXt.cjs"),m=require("./index-D9oM__YW.cjs");require("./theme.cjs");const p={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function S(e){const t=p.youtube,i=e.matchedUrl;e.validLink=!0;const r=i.split("="),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}/${c}`,e.validId=!0}return e}function I(e){const t=p.youku,i=e.matchedUrl,r=t.idRule,n=new RegExp(r),c=i.match(n);if(c&&c.length>0){const o=c[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${o}`}else e.validId=!1;return e}function R(e){const t=p.bilibili,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function P(e){const t=p.qqvideo,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function j(e,t){return t.src=e,t.validId=!0,t}function M(e,t){return t.src=e,t.validId=!0,t}function N(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function q(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function U(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function A(e){const t=p.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function D(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function L(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function _(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function $(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function T(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function z(e,t,i){if(e==="googlemaps")return i.validLink=!0,i.matchedUrl=t,i;const n=p[e].linkRule;for(const c of n){const o=new RegExp(c),a=t.match(o);if(a&&a.length>0)return i.validLink=!0,i.matchedUrl=e==="youtube"?a[1]:a[0],i}return i}function Y(e){var i,r;let t="iframe";return((i=e.includes)!=null&&i.call(e,"youtube")||(r=e.includes)!=null&&r.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function x(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const i=Y(e);if(t=z(i,e,t),!t.validLink)return t;switch(i){case"youtube":return S(t);case"youku":return I(t);case"bilibili":return R(t);case"qqvideo":return P(t);case"amap":return j(e,t);case"baidu_map":return M(e,t);case"googlemaps":return N(e,t);case"modao":return q(t);case"lanhu":return U(t);case"figma":return A(t);case"canva":return D(e,t);case"processon":return L(e,t);case"codepen":return _(t);case"jinshuju":return $(e,t);case"iframe":return T(e,t);default:return e}}const C="_wrap_5y04w_1",E="_innerWrap_5y04w_15",v={wrap:C,innerWrap:E};function H({editor:e,node:t,updateAttributes:i}){const r=m.useEditableEditor(),{src:n,width:c,height:o}=t.attrs,[a,l]=g.useState("");function h(){if(!a)return;const d=x(a);e.chain().updateAttributes(w.name,{src:(d==null?void 0:d.src)||a}).setNodeSelection(e.state.selection.from).focus().run()}const k=g.useCallback(d=>{i({width:d.width,height:d.height})},[i]);return s.jsxs(u.NodeViewWrapper,{children:[!n&&s.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-border richtext-p-[10px]",children:[s.jsx(m.Input,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>l(d.target.value),placeholder:"Enter link",type:"url",value:a}),s.jsx(m.Button,{className:"richtext-w-[60px]",onClick:h,children:"OK"})]}),n&&s.jsx(y.Resizable,{size:{width:Number.parseInt(c),height:Number.parseInt(o)},onResizeStop:(d,V,K,b)=>{k({width:Number.parseInt(c)+b.width,height:Number.parseInt(o)+b.height})},children:s.jsx("div",{className:u.clsx(v.wrap,"render-wrapper"),children:s.jsx("div",{className:v.innerWrap,style:{pointerEvents:r?"none":"auto"},children:s.jsx("iframe",{className:"richtext-my-[12px]",src:n})})})})]})}function B(){const e=m.useButtonProps(w.name),{icon:t=void 0,tooltip:i=void 0,shortcutKeys:r=void 0,tooltipOptions:n={},action:c=void 0,isActive:o=void 0}=(e==null?void 0:e.componentProps)??{},{editorDisabled:a,update:l}=m.useToggleActive(o),h=()=>{a||c&&(c(),l())};return e?s.jsx(m.ActionButton,{action:h,disabled:a,icon:t,shortcutKeys:r,tooltip:i,tooltipOptions:n}):s.jsx(s.Fragment,{})}const w=u.Node3.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:i,t:r})=>({componentProps:{action:n=>t.commands.setIframe(n),upload:i.options.upload,icon:"Iframe",tooltip:r("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:f.getDatasetAttribute("width")},height:{default:300,parseHTML:f.getDatasetAttribute("height")},src:{default:null,parseHTML:f.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",u.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:i,chain:r})=>{var c,o,a;if(((a=(o=(c=t.selection)==null?void 0:c.node)==null?void 0:o.type)==null?void 0:a.name)==this.name)return i.updateAttributes(this.name,e);const n=e||{url:""};return r().insertContent({type:this.name,attrs:n}).run()}}},addInputRules(){return[u.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return u.ReactNodeViewRenderer(H)}});exports.Iframe=w;exports.RichTextIframe=B;exports.getServiceSrc=x;
|
package/lib/Iframe.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./Iframe-BfBLILDA.cjs");require("./dom-dataset-BqoJhJXt.cjs");exports.Iframe=e.Iframe;exports.RichTextIframe=e.RichTextIframe;
|
package/lib/Iframe.js
ADDED
package/lib/Image.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./index-D9oM__YW.cjs");exports.Image=e.Image;exports.RichTextImage=e.RichTextImage;
|
package/lib/Image.js
ADDED
package/lib/ImageGif.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./clsx-CXbNJWDD.cjs"),f=require("./index-D9oM__YW.cjs"),l=require("react/jsx-runtime"),u=require("react"),j=require("./index-bVGIXhRg.cjs");require("./theme.cjs");const L=require("./popover-D-hUKDYu.cjs"),N={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function q(e){var k,z;const[t,r]=u.useState({width:j.IMAGE_MAX_SIZE,height:j.IMAGE_MAX_SIZE}),[o,i]=u.useState({width:0,height:0}),[n]=u.useState([N.TOP_LEFT,N.TOP_RIGHT,N.BOTTOM_LEFT,N.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,x]=u.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=(k=e==null?void 0:e.node)==null?void 0:k.attrs,m=u.useMemo(()=>{var b;const{src:c,alt:w,width:v,height:A}=(b=e==null?void 0:e.node)==null?void 0:b.attrs,G=f.isNumber(v)?`${v}px`:v,d=f.isNumber(A)?`${A}px`:A;return{src:c||void 0,alt:w||void 0,style:{width:G||void 0,height:d||void 0}}},[(z=e==null?void 0:e.node)==null?void 0:z.attrs]),_=u.useMemo(()=>{const{style:{width:c}}=m;return{width:c==="100%"?c:void 0}},[m]);function g(c){i({width:c.target.width,height:c.target.height})}function I(){const{editor:c,getPos:w}=e;c.commands.setNodeSelection(w())}const M=u.useCallback(f.throttle(()=>{const{editor:c}=e,{width:w}=getComputedStyle(c.view.dom);r(v=>({...v,width:Number.parseInt(w,10)}))},j.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function H(c,w){c.preventDefault(),c.stopPropagation();const v=o.width,A=o.height,G=v/A;let d=Number(e.node.attrs.width),b=Number(e.node.attrs.height);const y=t.width;d&&!b?(d=d>y?y:d,b=Math.round(d/G)):b&&!d?(d=Math.round(b*G),d=d>y?y:d):!d&&!b?(d=v>y?y:v,b=Math.round(d/G)):d=d>y?y:d,a(!0),x({x:c.clientX,y:c.clientY,w:d,h:b,dir:w})}const E=u.useCallback(f.throttle(c=>{if(c.preventDefault(),c.stopPropagation(),!s)return;const{x:w,w:v,dir:A}=h,G=(c.clientX-w)*(/l/.test(A)?-1:1),d=f.clamp$1(v+G,j.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},j.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),S=u.useCallback(c=>{c.preventDefault(),c.stopPropagation(),s&&(x({x:0,y:0,w:0,h:0,dir:""}),a(!1),I())},[s,I]),$=u.useCallback(()=>{document==null||document.addEventListener("mousemove",E,!0),document==null||document.addEventListener("mouseup",S,!0)},[E,S]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",E,!0),document==null||document.removeEventListener("mouseup",S,!0)},[E,S]);u.useEffect(()=>(s?$():O(),()=>{O()}),[s,$,O]);const R=u.useMemo(()=>new ResizeObserver(()=>M()),[M]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx(P.NodeViewWrapper,{className:"image-view",style:{..._,width:"100%",textAlign:T},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:_,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:I,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:n==null?void 0:n.map(c=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${c}`,onMouseDown:w=>H(w,c)},`image-dir-${c}`))})]})})}async function W(e){var o;const r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(o=r==null?void 0:r.data)==null?void 0:o.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function p(e,t){var i;const o=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=o==null?void 0:o.data)==null?void 0:i.map(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function D(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,x,T,m,_,g,I,M;return{id:a==null?void 0:a.id,src:(x=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:x.url,width:(_=(m=(T=a==null?void 0:a.media_formats)==null?void 0:T.gif)==null?void 0:m.dims)==null?void 0:_[0],height:(M=(I=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:I.dims)==null?void 0:M[1]}})}async function F(e,t){var i;const o=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=o==null?void 0:o.results)==null?void 0:i.map(n=>{var s,a,h,x,T,m,_,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(T=(x=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:x.dims)==null?void 0:T[0],height:(g=(_=(m=n==null?void 0:n.media_formats)==null?void 0:m.gif)==null?void 0:_.dims)==null?void 0:g[1]}})}function B(e,t){return{searchTrending:async()=>t?e==="giphy"?W(t):e==="tenor"?D(t):[]:[],searchWord:async i=>t?e==="giphy"?p(i,t):e==="tenor"?F(i,t):[]:[]}}function V({selectImage:e,apiKey:t,provider:r,children:o}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=f.useToggleActive(),x=u.useRef(null),{searchTrending:T,searchWord:m}=B(r,t);u.useEffect(()=>{(async()=>{const g=await T();a(g)})()},[]);const _=u.useCallback(f.debounce(async g=>{if(!g.target.value){const M=await T();a(M);return}const I=await m(g.target.value);a(I)},350),[]);return l.jsxs(L.Popover,{modal:!0,onOpenChange:n,open:i,children:[l.jsx(L.PopoverTrigger,{asChild:!0,disabled:h,children:o}),l.jsx(L.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(f.Input,{onChange:_,placeholder:"Search GIF",ref:x,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 X(){const e=f.useButtonProps(C.name),{action:t,icon:r,tooltip:o,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=f.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(V,{apiKey:i,provider:n,selectImage:a,children:l.jsx(f.ActionButton,{disabled:s,icon:r,tooltip:o})})}const C=f.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:o})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:o("editor.imageGif.tooltip"),apiKey:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return P.ReactNodeViewRenderer(q)},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",P.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=C;exports.RichTextImageGif=X;
|