@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";var z=Object.create;var M=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var B=(e,n,l,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of V(n))!U.call(e,i)&&i!==l&&M(e,i,{get:()=>n[i],enumerable:!(d=P(n,i))||d.enumerable});return e};var R=(e,n,l)=>(l=e!=null?z(q(e)):{},B(n||!e||!e.__esModule?M(l,"default",{value:e,enumerable:!0}):l,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),$=require("re-resizable"),a=require("react"),r=require("./index-D9oM__YW.cjs"),I=require("./dom-dataset-BqoJhJXt.cjs"),F="_wrap_dra8y_1",X="_renderWrap_dra8y_7",Y="_handlerWrap_dra8y_30",G="_disabled_dra8y_40",A={wrap:F,renderWrap:X,handlerWrap:Y,disabled:G},J=10,K=200,O=15,W={width:"100%",height:"100%",maxWidth:"100%"};function Q({editor:e,node:n,updateAttributes:l}){const d=a.useRef(null),[i,p]=a.useState(()=>(e==null?void 0:e.isEditable)??!1);a.useEffect(()=>{const t=()=>p((e==null?void 0:e.isEditable)??!1);return t(),e==null||e.on("editableUpdate",t),e==null||e.on("update",t),()=>{e==null||e.off("editableUpdate",t),e==null||e.off("update",t)}},[e]);const x=e.isActive(D.name),{data:o,width:j,height:S}=n.attrs,[m,L]=a.useState(null),[w,T]=a.useState(!0),[c,b]=a.useState(null),[v,E]=a.useState(100),y=a.useCallback(t=>()=>{E(h=>r.clamp(t==="minus"?h-O:h+O,J,K))},[]);a.useEffect(()=>{let t=!1;return import("@excalidraw/excalidraw").then(h=>{t||(d.current=h.exportToSvg)}).catch(h=>!t&&b(h)).finally(()=>!t&&T(!1)),()=>{t=!0}},[o]),a.useEffect(()=>{let t=!1;return(async()=>{if(!d.current||t||w||c||!o)return;const g=await d.current(o);t||(g.setAttribute("width","100%"),g.setAttribute("height","100%"),g.setAttribute("display","block"),L(g))})(),()=>{t=!0}},[o,w,c]);const N=t=>{l({width:t.width,height:t.height})};return s.jsx(f.NodeViewWrapper,{className:f.clsx(A.wrap,{[A.active]:x,[A.disabled]:!i}),children:s.jsx($.Resizable,{size:{width:Number.parseInt(j),height:Number.parseInt(S)},onResizeStop:(t,h,g,_)=>{N({width:Number.parseInt(j)+_.width,height:Number.parseInt(S)+_.height})},children:s.jsxs("div",{className:f.clsx(A.renderWrap,"render-wrapper"),style:{...W,overflow:"hidden"},children:[c&&s.jsx("div",{style:W,children:s.jsx("p",{children:c.message||c})}),w&&s.jsx("p",{children:"Loading..."}),!w&&!c&&m&&s.jsx("div",{dangerouslySetInnerHTML:{__html:(m==null?void 0:m.outerHTML)??""},style:{height:"100%",maxHeight:"100%",padding:24,overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"center",transform:`scale(${v/100})`,transition:"all ease-in-out .3s"}}),i&&s.jsxs("div",{className:A.handlerWrap,children:[s.jsx(r.ActionButton,{action:y("minus"),disabled:!i,icon:"ZoomOut",tooltip:"Zoom Out"}),s.jsx(r.ActionButton,{action:y("plus"),disabled:!i,icon:"ZoomIn",tooltip:"Zoom In"})]})]})})})}function ee(){const e=r.useEditorInstance(),n=r.useButtonProps(D.name),l=r.useExtension(D.name),{tooltipOptions:d={},isActive:i=void 0}=(n==null?void 0:n.componentProps)??{},{editorDisabled:p}=r.useToggleActive(i),x=a.useMemo(()=>(l==null?void 0:l.options)||{},[l]),[o,j]=a.useState(null),[S,m]=a.useState({}),[L,w]=a.useState({elements:[],appState:{isLoading:!1},files:null}),[T,c]=a.useState(!1),[b,v]=a.useState(!0),[E,y]=a.useState(null),N=a.useCallback(u=>{u&&import("@excalidraw/excalidraw").then(C=>{j(C.Excalidraw)}).catch(y).finally(()=>v(!1))},[v]),t=a.useCallback(u=>{setTimeout(()=>{u.refresh()})},[]),h=a.useCallback((u,C,Z)=>{m({elements:u,appState:{isLoading:!1},files:Z})},[]),g=a.useCallback(()=>{if(!o){c(!1);return}e.chain().focus().setExcalidraw({data:S}).run(),c(!1)},[o,e,S,c]),_=u=>{c(!0),u!=null&&u.data&&w(u==null?void 0:u.data)},k=r.EVENTS.EXCALIDRAW(e.id);return r.useListener(_,[k]),a.useEffect(()=>{!b&&o&&T&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},400)},[b,o,T]),s.jsxs(r.Dialog,{onOpenChange:c,open:T,children:[s.jsx(r.DialogTrigger,{asChild:!0,children:s.jsx(r.ActionButton,{disabled:p,icon:"Excalidraw",tooltip:"Excalidraw",tooltipOptions:d,action:()=>{p||c(!0)}})}),s.jsxs(r.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[s.jsx(r.DialogTitle,{children:"Excalidraw"}),s.jsxs("div",{style:{height:"100%",borderWidth:1},children:[b&&s.jsx("p",{children:"Loading..."}),E&&s.jsx("p",{children:E&&E.message||"Error"}),s.jsx("div",{ref:N,style:{width:"100%",height:600},children:!b&&!E&&o?s.jsx(o,{initialData:L,langCode:"en",onChange:h,ref:t,...x.excalidrawProps}):null})]}),s.jsx(r.DialogFooter,{children:s.jsx(r.Button,{disabled:!o,onClick:g,type:"button",children:"Save changes"})})]})]})}const H={elements:[]},D=f.Node3.create({name:"excalidraw",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addAttributes(){return{defaultShowPicker:{default:!1},createUser:{default:null},width:{default:"100%",parseHTML:I.getDatasetAttribute("width")},height:{default:240,parseHTML:I.getDatasetAttribute("height")},data:{default:H,parseHTML:I.getDatasetAttribute("data",!0)}}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"excalidraw"},excalidrawProps:{},button:()=>({componentProps:{}})}},parseHTML(){return[{tag:"div[class=excalidraw]"}]},renderHTML({HTMLAttributes:e,node:n}){return["div",f.mergeAttributes(this.options.HTMLAttributes,e,I.nodeAttrsToDataset(n))]},addCommands(){return{setExcalidraw:e=>({tr:n,commands:l,chain:d})=>{var i,p,x;return e=e||{},e.data=e.data||H,((x=(p=(i=n.selection)==null?void 0:i.node)==null?void 0:p.type)==null?void 0:x.name)==this.name?l.updateAttributes(this.name,e):d().insertContent({type:this.name,attrs:e}).run()}}},addNodeView(){return f.ReactNodeViewRenderer(Q)},addInputRules(){return[f.nodeInputRule({find:/^\$excalidraw\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]}});exports.Excalidraw=D;exports.RichTextExcalidraw=ee;
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { h as P, j as W, N as U, n as $, k as j, m as B } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { jsx as a, jsxs as A } from "react/jsx-runtime";
|
|
3
|
+
import { Resizable as F } from "re-resizable";
|
|
4
|
+
import { useRef as X, useState as i, useEffect as N, useCallback as v, useMemo as q } from "react";
|
|
5
|
+
import { w as Y, A as C, h as G, u as J, q as K, d as Q, E as ee, x as te, D as ae, m as ne, n as se, o as re, p as ie, B as le } from "./index-lj3VWExo.js";
|
|
6
|
+
import { n as oe, g as S } from "./dom-dataset-CIEeltF6.js";
|
|
7
|
+
const ce = "_wrap_dra8y_1", de = "_renderWrap_dra8y_7", ue = "_handlerWrap_dra8y_30", he = "_disabled_dra8y_40", T = {
|
|
8
|
+
wrap: ce,
|
|
9
|
+
renderWrap: de,
|
|
10
|
+
handlerWrap: ue,
|
|
11
|
+
disabled: he
|
|
12
|
+
}, pe = 10, me = 200, H = 15, Z = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
13
|
+
function fe({ editor: e, node: o, updateAttributes: d }) {
|
|
14
|
+
const u = X(null), [c, h] = i(
|
|
15
|
+
() => (e == null ? void 0 : e.isEditable) ?? !1
|
|
16
|
+
);
|
|
17
|
+
N(() => {
|
|
18
|
+
const t = () => h((e == null ? void 0 : e.isEditable) ?? !1);
|
|
19
|
+
return t(), e == null || e.on("editableUpdate", t), e == null || e.on("update", t), () => {
|
|
20
|
+
e == null || e.off("editableUpdate", t), e == null || e.off("update", t);
|
|
21
|
+
};
|
|
22
|
+
}, [e]);
|
|
23
|
+
const m = e.isActive(O.name), { data: s, width: y, height: E } = o.attrs, [f, D] = i(null), [g, x] = i(!0), [n, w] = i(null), [_, b] = i(100), I = v((t) => () => {
|
|
24
|
+
b(
|
|
25
|
+
(l) => Y(
|
|
26
|
+
t === "minus" ? l - H : l + H,
|
|
27
|
+
pe,
|
|
28
|
+
me
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
}, []);
|
|
32
|
+
N(() => {
|
|
33
|
+
let t = !1;
|
|
34
|
+
return import("@excalidraw/excalidraw").then((l) => {
|
|
35
|
+
t || (u.current = l.exportToSvg);
|
|
36
|
+
}).catch((l) => !t && w(l)).finally(() => !t && x(!1)), () => {
|
|
37
|
+
t = !0;
|
|
38
|
+
};
|
|
39
|
+
}, [s]), N(() => {
|
|
40
|
+
let t = !1;
|
|
41
|
+
return (async () => {
|
|
42
|
+
if (!u.current || t || g || n || !s)
|
|
43
|
+
return;
|
|
44
|
+
const p = await u.current(s);
|
|
45
|
+
t || (p.setAttribute("width", "100%"), p.setAttribute("height", "100%"), p.setAttribute("display", "block"), D(p));
|
|
46
|
+
})(), () => {
|
|
47
|
+
t = !0;
|
|
48
|
+
};
|
|
49
|
+
}, [s, g, n]);
|
|
50
|
+
const M = (t) => {
|
|
51
|
+
d({ width: t.width, height: t.height });
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ a(
|
|
54
|
+
P,
|
|
55
|
+
{
|
|
56
|
+
className: W(T.wrap, {
|
|
57
|
+
[T.active]: m,
|
|
58
|
+
[T.disabled]: !c
|
|
59
|
+
}),
|
|
60
|
+
children: /* @__PURE__ */ a(
|
|
61
|
+
F,
|
|
62
|
+
{
|
|
63
|
+
size: {
|
|
64
|
+
width: Number.parseInt(y),
|
|
65
|
+
height: Number.parseInt(E)
|
|
66
|
+
},
|
|
67
|
+
onResizeStop: (t, l, p, L) => {
|
|
68
|
+
M({
|
|
69
|
+
width: Number.parseInt(y) + L.width,
|
|
70
|
+
height: Number.parseInt(E) + L.height
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ A(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: W(T.renderWrap, "render-wrapper"),
|
|
77
|
+
style: { ...Z, overflow: "hidden" },
|
|
78
|
+
children: [
|
|
79
|
+
n && /* @__PURE__ */ a("div", { style: Z, children: /* @__PURE__ */ a("p", { children: n.message || n }) }),
|
|
80
|
+
g && /* @__PURE__ */ a("p", { children: "Loading..." }),
|
|
81
|
+
!g && !n && f && /* @__PURE__ */ a(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
dangerouslySetInnerHTML: { __html: (f == null ? void 0 : f.outerHTML) ?? "" },
|
|
85
|
+
style: {
|
|
86
|
+
height: "100%",
|
|
87
|
+
maxHeight: "100%",
|
|
88
|
+
padding: 24,
|
|
89
|
+
overflow: "hidden",
|
|
90
|
+
display: "flex",
|
|
91
|
+
justifyContent: "center",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
transform: `scale(${_ / 100})`,
|
|
94
|
+
transition: "all ease-in-out .3s"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
c && /* @__PURE__ */ A("div", { className: T.handlerWrap, children: [
|
|
99
|
+
/* @__PURE__ */ a(
|
|
100
|
+
C,
|
|
101
|
+
{
|
|
102
|
+
action: I("minus"),
|
|
103
|
+
disabled: !c,
|
|
104
|
+
icon: "ZoomOut",
|
|
105
|
+
tooltip: "Zoom Out"
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ a(
|
|
109
|
+
C,
|
|
110
|
+
{
|
|
111
|
+
action: I("plus"),
|
|
112
|
+
disabled: !c,
|
|
113
|
+
icon: "ZoomIn",
|
|
114
|
+
tooltip: "Zoom In"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function ve() {
|
|
127
|
+
const e = G(), o = J(O.name), d = K(O.name), { tooltipOptions: u = {}, isActive: c = void 0 } = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: h } = Q(c), m = q(() => (d == null ? void 0 : d.options) || {}, [d]), [s, y] = i(null), [E, f] = i({}), [D, g] = i({
|
|
128
|
+
elements: [],
|
|
129
|
+
appState: { isLoading: !1 },
|
|
130
|
+
files: null
|
|
131
|
+
}), [x, n] = i(!1), [w, _] = i(!0), [b, I] = i(null), M = v(
|
|
132
|
+
(r) => {
|
|
133
|
+
r && import("@excalidraw/excalidraw").then((R) => {
|
|
134
|
+
y(R.Excalidraw);
|
|
135
|
+
}).catch(I).finally(() => _(!1));
|
|
136
|
+
},
|
|
137
|
+
[_]
|
|
138
|
+
), t = v((r) => {
|
|
139
|
+
setTimeout(() => {
|
|
140
|
+
r.refresh();
|
|
141
|
+
});
|
|
142
|
+
}, []), l = v((r, R, z) => {
|
|
143
|
+
f({
|
|
144
|
+
elements: r,
|
|
145
|
+
appState: { isLoading: !1 },
|
|
146
|
+
files: z
|
|
147
|
+
});
|
|
148
|
+
}, []), p = v(() => {
|
|
149
|
+
if (!s) {
|
|
150
|
+
n(!1);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
e.chain().focus().setExcalidraw({ data: E }).run(), n(!1);
|
|
154
|
+
}, [s, e, E, n]), L = (r) => {
|
|
155
|
+
n(!0), r != null && r.data && g(r == null ? void 0 : r.data);
|
|
156
|
+
}, k = ee.EXCALIDRAW(e.id);
|
|
157
|
+
return te(L, [k]), N(() => {
|
|
158
|
+
!w && s && x && setTimeout(() => {
|
|
159
|
+
window.dispatchEvent(new Event("resize"));
|
|
160
|
+
}, 400);
|
|
161
|
+
}, [w, s, x]), /* @__PURE__ */ A(ae, { onOpenChange: n, open: x, children: [
|
|
162
|
+
/* @__PURE__ */ a(ne, { asChild: !0, children: /* @__PURE__ */ a(
|
|
163
|
+
C,
|
|
164
|
+
{
|
|
165
|
+
disabled: h,
|
|
166
|
+
icon: "Excalidraw",
|
|
167
|
+
tooltip: "Excalidraw",
|
|
168
|
+
tooltipOptions: u,
|
|
169
|
+
action: () => {
|
|
170
|
+
h || n(!0);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
) }),
|
|
174
|
+
/* @__PURE__ */ A(se, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
175
|
+
/* @__PURE__ */ a(re, { children: "Excalidraw" }),
|
|
176
|
+
/* @__PURE__ */ A("div", { style: { height: "100%", borderWidth: 1 }, children: [
|
|
177
|
+
w && /* @__PURE__ */ a("p", { children: "Loading..." }),
|
|
178
|
+
b && /* @__PURE__ */ a("p", { children: b && b.message || "Error" }),
|
|
179
|
+
/* @__PURE__ */ a("div", { ref: M, style: { width: "100%", height: 600 }, children: !w && !b && s ? /* @__PURE__ */ a(
|
|
180
|
+
s,
|
|
181
|
+
{
|
|
182
|
+
initialData: D,
|
|
183
|
+
langCode: "en",
|
|
184
|
+
onChange: l,
|
|
185
|
+
ref: t,
|
|
186
|
+
...m.excalidrawProps
|
|
187
|
+
}
|
|
188
|
+
) : null })
|
|
189
|
+
] }),
|
|
190
|
+
/* @__PURE__ */ a(ie, { children: /* @__PURE__ */ a(le, { disabled: !s, onClick: p, type: "button", children: "Save changes" }) })
|
|
191
|
+
] })
|
|
192
|
+
] });
|
|
193
|
+
}
|
|
194
|
+
const V = { elements: [] }, O = /* @__PURE__ */ U.create({
|
|
195
|
+
name: "excalidraw",
|
|
196
|
+
group: "block",
|
|
197
|
+
selectable: !0,
|
|
198
|
+
atom: !0,
|
|
199
|
+
draggable: !0,
|
|
200
|
+
inline: !1,
|
|
201
|
+
addAttributes() {
|
|
202
|
+
return {
|
|
203
|
+
defaultShowPicker: {
|
|
204
|
+
default: !1
|
|
205
|
+
},
|
|
206
|
+
createUser: {
|
|
207
|
+
default: null
|
|
208
|
+
},
|
|
209
|
+
width: {
|
|
210
|
+
default: "100%",
|
|
211
|
+
parseHTML: S("width")
|
|
212
|
+
},
|
|
213
|
+
height: {
|
|
214
|
+
default: 240,
|
|
215
|
+
parseHTML: S("height")
|
|
216
|
+
},
|
|
217
|
+
data: {
|
|
218
|
+
default: V,
|
|
219
|
+
parseHTML: S("data", !0)
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
addOptions() {
|
|
224
|
+
var e;
|
|
225
|
+
return {
|
|
226
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
227
|
+
HTMLAttributes: {
|
|
228
|
+
class: "excalidraw"
|
|
229
|
+
},
|
|
230
|
+
excalidrawProps: {},
|
|
231
|
+
button: () => ({
|
|
232
|
+
componentProps: {}
|
|
233
|
+
})
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
parseHTML() {
|
|
237
|
+
return [
|
|
238
|
+
{
|
|
239
|
+
tag: "div[class=excalidraw]"
|
|
240
|
+
}
|
|
241
|
+
];
|
|
242
|
+
},
|
|
243
|
+
renderHTML({ HTMLAttributes: e, node: o }) {
|
|
244
|
+
return [
|
|
245
|
+
"div",
|
|
246
|
+
B(this.options.HTMLAttributes, e, oe(o))
|
|
247
|
+
];
|
|
248
|
+
},
|
|
249
|
+
addCommands() {
|
|
250
|
+
return {
|
|
251
|
+
setExcalidraw: (e) => ({ tr: o, commands: d, chain: u }) => {
|
|
252
|
+
var c, h, m;
|
|
253
|
+
return e = e || {}, e.data = e.data || V, ((m = (h = (c = o.selection) == null ? void 0 : c.node) == null ? void 0 : h.type) == null ? void 0 : m.name) == this.name ? d.updateAttributes(this.name, e) : u().insertContent({
|
|
254
|
+
type: this.name,
|
|
255
|
+
attrs: e
|
|
256
|
+
}).run();
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
},
|
|
260
|
+
addNodeView() {
|
|
261
|
+
return j(fe);
|
|
262
|
+
},
|
|
263
|
+
addInputRules() {
|
|
264
|
+
return [
|
|
265
|
+
$({
|
|
266
|
+
find: /^\$excalidraw\$$/,
|
|
267
|
+
type: this.type,
|
|
268
|
+
getAttributes: () => ({ width: "100%" })
|
|
269
|
+
})
|
|
270
|
+
];
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
export {
|
|
274
|
+
O as Excalidraw,
|
|
275
|
+
ve as RichTextExcalidraw
|
|
276
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./clsx-CXbNJWDD.cjs"),p=require("react/jsx-runtime"),m=require("./index-D9oM__YW.cjs");require("react");require("./theme.cjs");function y(e,n){var u;const t=document.createElement("iframe");t.setAttribute("style","position: absolute; width: 0; height: 0; top: 0; left: 0;"),document.body.appendChild(t);const o=t.contentDocument||((u=t.contentWindow)==null?void 0:u.document);if(!o)return;const{paperSize:s,title:i="React Tiptap Editor",margins:{top:d,right:a,bottom:r,left:c}}=n,l=`
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<title>${i}</title>
|
|
6
|
+
<meta charset="UTF-8">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
+
<style>
|
|
9
|
+
@media print {
|
|
10
|
+
@page {
|
|
11
|
+
size: ${s};
|
|
12
|
+
margin: ${d} ${a} ${r} ${c}; /* top, right, bottom, left */
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
background: none;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.print-container {
|
|
22
|
+
width: 100%;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.no-print {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
31
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@remarkablejames/editor@latest/lib/style.css">
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<div class="print-container">
|
|
35
|
+
${e}
|
|
36
|
+
</div>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
|
39
|
+
`;o.open(),o.write(l),o.close(),t.addEventListener("load",()=>{setTimeout(()=>{var f,h;try{(f=t.contentWindow)==null||f.focus(),(h=t.contentWindow)==null||h.print()}catch(x){console.error("Print failed",x)}setTimeout(()=>{document.body.removeChild(t)},100)},50)})}function g(e,n){const t=e.getHTML();return t?(y(t,n),!0):!1}function E(){const e=m.useButtonProps(b.name),{icon:n=void 0,tooltip:t=void 0,shortcutKeys:o=void 0,tooltipOptions:s={},action:i=void 0,isActive:d=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:a,disabled:r,update:c}=m.useToggleActive(d),l=()=>{r||i&&(i(),c())};return e?p.jsx(m.ActionButton,{action:l,dataState:a,disabled:r,icon:n,shortcutKeys:o,tooltip:t,tooltipOptions:s}):p.jsx(p.Fragment,{})}const b=v.Extension.create({name:"exportPdf",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),paperSize:"Letter",title:"Echo Editor",margins:{top:"0.4in",right:"0.4in",bottom:"0.4in",left:"0.4in"},button:({editor:n,extension:t,t:o})=>({componentProps:{action:()=>{g(n,t.options)},icon:"ExportPdf",tooltip:o("editor.exportPdf.tooltip"),isActive:()=>!1,disabled:!1}})}},addCommands(){return{exportToPdf:()=>({editor:e})=>g(e,this.options)}}});exports.ExportPdf=b;exports.RichTextExportPdf=E;
|
package/lib/ExportPdf.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { E as b } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { jsx as f, Fragment as v } from "react/jsx-runtime";
|
|
3
|
+
import { u as y, d as x, A as E } from "./index-lj3VWExo.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "./theme.js";
|
|
6
|
+
function P(o, n) {
|
|
7
|
+
var m;
|
|
8
|
+
const t = document.createElement("iframe");
|
|
9
|
+
t.setAttribute(
|
|
10
|
+
"style",
|
|
11
|
+
"position: absolute; width: 0; height: 0; top: 0; left: 0;"
|
|
12
|
+
), document.body.appendChild(t);
|
|
13
|
+
const e = t.contentDocument || ((m = t.contentWindow) == null ? void 0 : m.document);
|
|
14
|
+
if (!e) return;
|
|
15
|
+
const {
|
|
16
|
+
paperSize: a,
|
|
17
|
+
title: i = "React Tiptap Editor",
|
|
18
|
+
margins: {
|
|
19
|
+
top: s,
|
|
20
|
+
right: d,
|
|
21
|
+
bottom: r,
|
|
22
|
+
left: c
|
|
23
|
+
}
|
|
24
|
+
} = n, p = `
|
|
25
|
+
<!DOCTYPE html>
|
|
26
|
+
<html lang="en">
|
|
27
|
+
<head>
|
|
28
|
+
<title>${i}</title>
|
|
29
|
+
<meta charset="UTF-8">
|
|
30
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
31
|
+
<style>
|
|
32
|
+
@media print {
|
|
33
|
+
@page {
|
|
34
|
+
size: ${a};
|
|
35
|
+
margin: ${s} ${d} ${r} ${c}; /* top, right, bottom, left */
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
body {
|
|
39
|
+
background: none;
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.print-container {
|
|
45
|
+
width: 100%;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.no-print {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
54
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@remarkablejames/editor@latest/lib/style.css">
|
|
55
|
+
</head>
|
|
56
|
+
<body>
|
|
57
|
+
<div class="print-container">
|
|
58
|
+
${o}
|
|
59
|
+
</div>
|
|
60
|
+
</body>
|
|
61
|
+
</html>
|
|
62
|
+
`;
|
|
63
|
+
e.open(), e.write(p), e.close(), t.addEventListener("load", () => {
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
var l, u;
|
|
66
|
+
try {
|
|
67
|
+
(l = t.contentWindow) == null || l.focus(), (u = t.contentWindow) == null || u.print();
|
|
68
|
+
} catch (g) {
|
|
69
|
+
console.error("Print failed", g);
|
|
70
|
+
}
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
document.body.removeChild(t);
|
|
73
|
+
}, 100);
|
|
74
|
+
}, 50);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function h(o, n) {
|
|
78
|
+
const t = o.getHTML();
|
|
79
|
+
return t ? (P(t, n), !0) : !1;
|
|
80
|
+
}
|
|
81
|
+
function L() {
|
|
82
|
+
const o = y(T.name), {
|
|
83
|
+
icon: n = void 0,
|
|
84
|
+
tooltip: t = void 0,
|
|
85
|
+
shortcutKeys: e = void 0,
|
|
86
|
+
tooltipOptions: a = {},
|
|
87
|
+
action: i = void 0,
|
|
88
|
+
isActive: s = void 0
|
|
89
|
+
} = (o == null ? void 0 : o.componentProps) ?? {}, { dataState: d, disabled: r, update: c } = x(s), p = () => {
|
|
90
|
+
r || i && (i(), c());
|
|
91
|
+
};
|
|
92
|
+
return o ? /* @__PURE__ */ f(
|
|
93
|
+
E,
|
|
94
|
+
{
|
|
95
|
+
action: p,
|
|
96
|
+
dataState: d,
|
|
97
|
+
disabled: r,
|
|
98
|
+
icon: n,
|
|
99
|
+
shortcutKeys: e,
|
|
100
|
+
tooltip: t,
|
|
101
|
+
tooltipOptions: a
|
|
102
|
+
}
|
|
103
|
+
) : /* @__PURE__ */ f(v, {});
|
|
104
|
+
}
|
|
105
|
+
const T = /* @__PURE__ */ b.create({
|
|
106
|
+
name: "exportPdf",
|
|
107
|
+
//@ts-expect-error
|
|
108
|
+
addOptions() {
|
|
109
|
+
var o;
|
|
110
|
+
return {
|
|
111
|
+
...(o = this.parent) == null ? void 0 : o.call(this),
|
|
112
|
+
paperSize: "Letter",
|
|
113
|
+
title: "Echo Editor",
|
|
114
|
+
margins: {
|
|
115
|
+
top: "0.4in",
|
|
116
|
+
right: "0.4in",
|
|
117
|
+
bottom: "0.4in",
|
|
118
|
+
left: "0.4in"
|
|
119
|
+
},
|
|
120
|
+
button: ({ editor: n, extension: t, t: e }) => ({
|
|
121
|
+
componentProps: {
|
|
122
|
+
action: () => {
|
|
123
|
+
h(n, t.options);
|
|
124
|
+
},
|
|
125
|
+
icon: "ExportPdf",
|
|
126
|
+
tooltip: e("editor.exportPdf.tooltip"),
|
|
127
|
+
isActive: () => !1,
|
|
128
|
+
disabled: !1
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
addCommands() {
|
|
134
|
+
return {
|
|
135
|
+
exportToPdf: () => ({ editor: o }) => h(o, this.options)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
export {
|
|
140
|
+
T as ExportPdf,
|
|
141
|
+
L as RichTextExportPdf
|
|
142
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./clsx-CXbNJWDD.cjs"),u=require("docx"),n=require("prosemirror-docx"),i=require("react/jsx-runtime"),y=require("react"),a=require("./index-D9oM__YW.cjs");require("./theme.cjs");const g=typeof window<"u";function v(o,e){if(g){const r=window.URL.createObjectURL(o),t=document.createElement("a");return t.href=r,t.download=e,t.click(),window.URL.revokeObjectURL(r),Promise.resolve()}return console.error("Download is not supported in Node.js"),Promise.resolve()}function B(){const o=a.useButtonProps(p.name),[e,r]=y.useState(!1),{icon:t=void 0,tooltip:c=void 0,shortcutKeys:s=void 0,tooltipOptions:f={},action:d=void 0,isActive:m=void 0}=(o==null?void 0:o.componentProps)??{},{dataState:x,disabled:l,update:w}=a.useToggleActive(m),b=async()=>{l||e||d&&(r(!0),await d(),w(),r(!1))};return o?i.jsx(a.ActionButton,{action:b,dataState:x,disabled:l||e,icon:e?"Loader":t,shortcutKeys:s,tooltip:c,tooltipOptions:f}):i.jsx(i.Fragment,{})}const E={...n.defaultNodes,hardBreak:n.defaultNodes.hard_break,codeBlock:n.defaultNodes.code_block,orderedList:n.defaultNodes.ordered_list,listItem:n.defaultNodes.list_item,bulletList:n.defaultNodes.bullet_list,horizontalRule:n.defaultNodes.horizontal_rule,image(o,e){o.renderInline(e),o.closeBlock(e)},table(o,e){o.table(e,{tableOptions:{width:{size:100,type:u.WidthType.PERCENTAGE}}})}},W=new n.DocxSerializer(E,n.defaultMarks),p=h.Extension.create({name:"exportWord",addOptions(){var o;return{...(o=this.parent)==null?void 0:o.call(this),button:({editor:e,t:r})=>({componentProps:{icon:"ExportWord",action:()=>{var t;return e==null?void 0:e.commands.exportToWord((t=e==null?void 0:e.state)==null?void 0:t.doc)},tooltip:r("editor.exportWord.tooltip"),isActive:()=>!1,disabled:!1}})}},addCommands(){return{exportToWord:o=>async()=>{try{const e={getImageBuffer:async t=>{const s=await(await fetch(t)).arrayBuffer();return new Uint8Array(s)}},r=W.serialize(o,e);return u.Packer.toBlob(r).then(t=>v(new Blob([t]),"richtext-export-document.docx")),!0}catch(e){return console.error("Error exporting to Word:",e),!1}}}}});exports.ExportWord=p;exports.RichTextExportWord=B;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { E as w } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { Packer as x, WidthType as b } from "docx";
|
|
3
|
+
import { defaultNodes as n, DocxSerializer as h, defaultMarks as B } from "prosemirror-docx";
|
|
4
|
+
import { jsx as d, Fragment as v } from "react/jsx-runtime";
|
|
5
|
+
import { useState as y } from "react";
|
|
6
|
+
import { u as E, d as g, A as k } from "./index-lj3VWExo.js";
|
|
7
|
+
import "./theme.js";
|
|
8
|
+
const W = typeof window < "u";
|
|
9
|
+
function A(e, o) {
|
|
10
|
+
if (W) {
|
|
11
|
+
const r = window.URL.createObjectURL(e), t = document.createElement("a");
|
|
12
|
+
return t.href = r, t.download = o, t.click(), window.URL.revokeObjectURL(r), Promise.resolve();
|
|
13
|
+
}
|
|
14
|
+
return console.error("Download is not supported in Node.js"), Promise.resolve();
|
|
15
|
+
}
|
|
16
|
+
function D() {
|
|
17
|
+
const e = E(R.name), [o, r] = y(!1), {
|
|
18
|
+
icon: t = void 0,
|
|
19
|
+
tooltip: s = void 0,
|
|
20
|
+
shortcutKeys: i = void 0,
|
|
21
|
+
tooltipOptions: l = {},
|
|
22
|
+
action: a = void 0,
|
|
23
|
+
isActive: p = void 0
|
|
24
|
+
} = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: u, disabled: c, update: m } = g(p), f = async () => {
|
|
25
|
+
c || o || a && (r(!0), await a(), m(), r(!1));
|
|
26
|
+
};
|
|
27
|
+
return e ? /* @__PURE__ */ d(
|
|
28
|
+
k,
|
|
29
|
+
{
|
|
30
|
+
action: f,
|
|
31
|
+
dataState: u,
|
|
32
|
+
disabled: c || o,
|
|
33
|
+
icon: o ? "Loader" : t,
|
|
34
|
+
shortcutKeys: i,
|
|
35
|
+
tooltip: s,
|
|
36
|
+
tooltipOptions: l
|
|
37
|
+
}
|
|
38
|
+
) : /* @__PURE__ */ d(v, {});
|
|
39
|
+
}
|
|
40
|
+
const L = {
|
|
41
|
+
...n,
|
|
42
|
+
hardBreak: n.hard_break,
|
|
43
|
+
codeBlock: n.code_block,
|
|
44
|
+
orderedList: n.ordered_list,
|
|
45
|
+
listItem: n.list_item,
|
|
46
|
+
bulletList: n.bullet_list,
|
|
47
|
+
horizontalRule: n.horizontal_rule,
|
|
48
|
+
// Requirement Buffer on browser
|
|
49
|
+
image(e, o) {
|
|
50
|
+
e.renderInline(o), e.closeBlock(o);
|
|
51
|
+
},
|
|
52
|
+
table(e, o) {
|
|
53
|
+
e.table(o, {
|
|
54
|
+
tableOptions: {
|
|
55
|
+
width: {
|
|
56
|
+
size: 100,
|
|
57
|
+
type: b.PERCENTAGE
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}, z = /* @__PURE__ */ new h(L, B), R = /* @__PURE__ */ w.create({
|
|
63
|
+
name: "exportWord",
|
|
64
|
+
//@ts-expect-error
|
|
65
|
+
addOptions() {
|
|
66
|
+
var e;
|
|
67
|
+
return {
|
|
68
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
69
|
+
button: ({ editor: o, t: r }) => ({
|
|
70
|
+
componentProps: {
|
|
71
|
+
icon: "ExportWord",
|
|
72
|
+
action: () => {
|
|
73
|
+
var t;
|
|
74
|
+
return o == null ? void 0 : o.commands.exportToWord((t = o == null ? void 0 : o.state) == null ? void 0 : t.doc);
|
|
75
|
+
},
|
|
76
|
+
tooltip: r("editor.exportWord.tooltip"),
|
|
77
|
+
isActive: () => !1,
|
|
78
|
+
disabled: !1
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
// @ts-expect-error
|
|
84
|
+
addCommands() {
|
|
85
|
+
return {
|
|
86
|
+
exportToWord: (e) => async () => {
|
|
87
|
+
try {
|
|
88
|
+
const o = {
|
|
89
|
+
getImageBuffer: async (t) => {
|
|
90
|
+
const i = await (await fetch(t)).arrayBuffer();
|
|
91
|
+
return new Uint8Array(i);
|
|
92
|
+
}
|
|
93
|
+
}, r = z.serialize(e, o);
|
|
94
|
+
return x.toBlob(r).then(
|
|
95
|
+
(t) => A(new Blob([t]), "richtext-export-document.docx")
|
|
96
|
+
), !0;
|
|
97
|
+
} catch (o) {
|
|
98
|
+
return console.error("Error exporting to Word:", o), !1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
export {
|
|
105
|
+
R as ExportWord,
|
|
106
|
+
D as RichTextExportWord
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-CjhjjJsN.cjs"),F=require("./index-bVGIXhRg.cjs"),f=require("./index-D9oM__YW.cjs"),e=require("react/jsx-runtime"),m=require("react"),x=require("./ActionMenuButton-J1el_e6Z.cjs");require("./theme.cjs");const d=require("./dropdown-menu-DjWlG2-J.cjs");function M(){const{t:l}=F.useLocale(),o=f.useButtonProps(p.name),{icon:a=void 0,tooltip:u=void 0,items:r=[],isActive:s=void 0}=(o==null?void 0:o.componentProps)??{},{disabled:c,dataState:t}=f.useActive(s),n=m.useMemo(()=>(t==null?void 0:t.font)||l("editor.fontFamily.default.tooltip"),[t]);return o?e.jsxs(d.DropdownMenu,{children:[e.jsx(d.DropdownMenuTrigger,{asChild:!0,disabled:c,children:e.jsx(x.ActionMenuButton,{disabled:c,icon:a,title:(n==null?void 0:n.length)>12?`${n==null?void 0:n.slice(0,12)}...`:n,tooltip:u})}),e.jsx(d.DropdownMenuContent,{className:"richtext-w-full",children:r==null?void 0:r.map((i,y)=>{const h=i.font===l("editor.fontFamily.default.tooltip")?{}:{fontFamily:i.font};return e.jsxs(m.Fragment,{children:[e.jsx(d.DropdownMenuCheckboxItem,{checked:n===i.font,onClick:i.action,children:e.jsx("div",{className:"richtext-ml-1 richtext-h-full",style:h,children:i.font})}),i.font===l("editor.fontFamily.default.tooltip")&&e.jsx(d.DropdownMenuSeparator,{})]},`font-family-${y}`)})})]}):e.jsx(e.Fragment,{})}const p=v.FontFamily.extend({addOptions(){var l;return{...(l=this.parent)==null?void 0:l.call(this),fontFamilyList:F.DEFAULT_FONT_FAMILY_LIST,button({editor:o,extension:a,t:u}){var c;const r=f.ensureNameValueOptions(((c=a==null?void 0:a.options)==null?void 0:c.fontFamilyList)||[]),s=r.map(t=>({action:()=>{if(t.value==="Default"){o.chain().focus().unsetFontFamily().run();return}o.chain().focus().setFontFamily(t.value).run()},isActive:()=>o.isActive("textStyle",{fontFamily:t.value})||!1,title:t.name,font:t.value,default:t.value==="Default"}));return{componentProps:{tooltip:u("editor.fontFamily.tooltip"),disabled:!1,items:s,isActive:()=>{const t=s==null?void 0:s.find(i=>i.isActive());return t&&!t.default?t:{title:u("editor.fontFamily.default.tooltip"),font:u("editor.fontFamily.default.tooltip"),isActive:()=>!1,disabled:!1}},icon:"MenuDown",fontFamilyList:r}}}}}});exports.FontFamily=p;exports.RichTextFontFamily=M;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { F as p } from "./index-C1WCZhyA.js";
|
|
2
|
+
import { u as F, D as y } from "./index-4Q5IhypJ.js";
|
|
3
|
+
import { u as h, e as v, f as A } from "./index-lj3VWExo.js";
|
|
4
|
+
import { jsx as i, Fragment as D, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import { useMemo as M, Fragment as w } from "react";
|
|
6
|
+
import { A as L } from "./ActionMenuButton-B0EHT9CC.js";
|
|
7
|
+
import "./theme.js";
|
|
8
|
+
import { D as g, a as x, b, c as T, d as C } from "./dropdown-menu-Bs69ZBbO.js";
|
|
9
|
+
function S() {
|
|
10
|
+
const { t: a } = F(), n = h(N.name), {
|
|
11
|
+
icon: s = void 0,
|
|
12
|
+
tooltip: c = void 0,
|
|
13
|
+
items: l = [],
|
|
14
|
+
isActive: r = void 0
|
|
15
|
+
} = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: u, dataState: t } = v(r), o = M(() => (t == null ? void 0 : t.font) || a("editor.fontFamily.default.tooltip"), [t]);
|
|
16
|
+
return n ? /* @__PURE__ */ f(g, { children: [
|
|
17
|
+
/* @__PURE__ */ i(x, { asChild: !0, disabled: u, children: /* @__PURE__ */ i(
|
|
18
|
+
L,
|
|
19
|
+
{
|
|
20
|
+
disabled: u,
|
|
21
|
+
icon: s,
|
|
22
|
+
title: (o == null ? void 0 : o.length) > 12 ? `${o == null ? void 0 : o.slice(0, 12)}...` : o,
|
|
23
|
+
tooltip: c
|
|
24
|
+
}
|
|
25
|
+
) }),
|
|
26
|
+
/* @__PURE__ */ i(b, { className: "richtext-w-full", children: l == null ? void 0 : l.map((e, m) => {
|
|
27
|
+
const d = e.font === a("editor.fontFamily.default.tooltip") ? {} : { fontFamily: e.font };
|
|
28
|
+
return /* @__PURE__ */ f(w, { children: [
|
|
29
|
+
/* @__PURE__ */ i(T, { checked: o === e.font, onClick: e.action, children: /* @__PURE__ */ i("div", { className: "richtext-ml-1 richtext-h-full", style: d, children: e.font }) }),
|
|
30
|
+
e.font === a("editor.fontFamily.default.tooltip") && /* @__PURE__ */ i(C, {})
|
|
31
|
+
] }, `font-family-${m}`);
|
|
32
|
+
}) })
|
|
33
|
+
] }) : /* @__PURE__ */ i(D, {});
|
|
34
|
+
}
|
|
35
|
+
const N = /* @__PURE__ */ p.extend({
|
|
36
|
+
//@ts-expect-error
|
|
37
|
+
addOptions() {
|
|
38
|
+
var a;
|
|
39
|
+
return {
|
|
40
|
+
...(a = this.parent) == null ? void 0 : a.call(this),
|
|
41
|
+
fontFamilyList: y,
|
|
42
|
+
button({ editor: n, extension: s, t: c }) {
|
|
43
|
+
var u;
|
|
44
|
+
const l = A(((u = s == null ? void 0 : s.options) == null ? void 0 : u.fontFamilyList) || []), r = l.map((t) => ({
|
|
45
|
+
action: () => {
|
|
46
|
+
if (t.value === "Default") {
|
|
47
|
+
n.chain().focus().unsetFontFamily().run();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
n.chain().focus().setFontFamily(t.value).run();
|
|
51
|
+
},
|
|
52
|
+
isActive: () => n.isActive("textStyle", { fontFamily: t.value }) || !1,
|
|
53
|
+
// disabled: !editor.can().setFontFamily(font.value),
|
|
54
|
+
title: t.name,
|
|
55
|
+
font: t.value,
|
|
56
|
+
default: t.value === "Default"
|
|
57
|
+
}));
|
|
58
|
+
return {
|
|
59
|
+
// component: FontFamilyButton,
|
|
60
|
+
componentProps: {
|
|
61
|
+
tooltip: c("editor.fontFamily.tooltip"),
|
|
62
|
+
disabled: !1,
|
|
63
|
+
items: r,
|
|
64
|
+
isActive: () => {
|
|
65
|
+
const t = r == null ? void 0 : r.find((e) => e.isActive());
|
|
66
|
+
return t && !t.default ? t : {
|
|
67
|
+
title: c("editor.fontFamily.default.tooltip"),
|
|
68
|
+
font: c("editor.fontFamily.default.tooltip"),
|
|
69
|
+
isActive: () => !1,
|
|
70
|
+
disabled: !1
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
icon: "MenuDown",
|
|
74
|
+
fontFamilyList: l
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
N as FontFamily,
|
|
83
|
+
S as RichTextFontFamily
|
|
84
|
+
};
|