@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,381 @@
|
|
|
1
|
+
import { h as V, N as U, k as F, m as P } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useState as s, useRef as E, useCallback as A, useEffect as C } from "react";
|
|
4
|
+
import { D as k, m as H, A as R, n as O, o as $, p as j, B as _, h as q, u as W, d as G } from "./index-lj3VWExo.js";
|
|
5
|
+
import { T as z } from "./textarea-gEoNp9CA.js";
|
|
6
|
+
const J = ({
|
|
7
|
+
editor: e,
|
|
8
|
+
node: a,
|
|
9
|
+
updateAttributes: d
|
|
10
|
+
}) => {
|
|
11
|
+
var i, n;
|
|
12
|
+
const l = ((i = a == null ? void 0 : a.attrs) == null ? void 0 : i.code) ?? b, h = ((n = a == null ? void 0 : a.attrs) == null ? void 0 : n.align) ?? "center", [r, y] = s(l), [v, x] = s(""), [M, m] = s(""), [u, g] = s(!1), [o, I] = s(null), [p, D] = s(!0), L = E(
|
|
13
|
+
`mermaid-edit-${Math.random().toString(36).slice(2, 9)}`
|
|
14
|
+
), N = A(
|
|
15
|
+
(c) => {
|
|
16
|
+
g(c), c && y(l);
|
|
17
|
+
},
|
|
18
|
+
[l]
|
|
19
|
+
);
|
|
20
|
+
C(() => {
|
|
21
|
+
import("mermaid").then((c) => {
|
|
22
|
+
const w = c.default;
|
|
23
|
+
w.initialize({
|
|
24
|
+
startOnLoad: !1,
|
|
25
|
+
darkMode: !1,
|
|
26
|
+
fontSize: 12,
|
|
27
|
+
theme: "base"
|
|
28
|
+
}), I(w);
|
|
29
|
+
}).finally(() => D(!1));
|
|
30
|
+
}, []), C(() => {
|
|
31
|
+
if (!o || !u) return;
|
|
32
|
+
(async () => {
|
|
33
|
+
const w = r.trim();
|
|
34
|
+
if (!w) {
|
|
35
|
+
x(""), m("");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const T = `${L.current}-${Date.now()}`, { svg: B } = await o.render(T, w);
|
|
40
|
+
x(B), m("");
|
|
41
|
+
} catch (T) {
|
|
42
|
+
x(""), m((T == null ? void 0 : T.message) ?? "Invalid Mermaid syntax");
|
|
43
|
+
}
|
|
44
|
+
})();
|
|
45
|
+
}, [r, o, u]);
|
|
46
|
+
const S = A(() => {
|
|
47
|
+
r.trim() && (d ? d({ code: r }) : e == null || e.chain().focus().setMermaid({ code: r, align: h }).run(), g(!1));
|
|
48
|
+
}, [e, r, h, d]);
|
|
49
|
+
return /* @__PURE__ */ f(k, { onOpenChange: N, open: u, children: [
|
|
50
|
+
/* @__PURE__ */ t(H, { asChild: !0, children: /* @__PURE__ */ t(
|
|
51
|
+
R,
|
|
52
|
+
{
|
|
53
|
+
action: () => g(!0),
|
|
54
|
+
icon: "Pencil",
|
|
55
|
+
tooltip: "Edit Mermaid"
|
|
56
|
+
}
|
|
57
|
+
) }),
|
|
58
|
+
/* @__PURE__ */ f(O, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
59
|
+
/* @__PURE__ */ t($, { children: "Edit Mermaid Diagram" }),
|
|
60
|
+
/* @__PURE__ */ t("div", { style: { height: "100%", border: "1px solid hsl(var(--border))" }, children: p ? /* @__PURE__ */ t("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400", children: "Loading Mermaid…" }) : /* @__PURE__ */ f("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
z,
|
|
63
|
+
{
|
|
64
|
+
autoFocus: !0,
|
|
65
|
+
className: "richtext-flex-1 richtext-font-mono richtext-text-sm",
|
|
66
|
+
onChange: (c) => y(c.target.value),
|
|
67
|
+
placeholder: b,
|
|
68
|
+
required: !0,
|
|
69
|
+
rows: 18,
|
|
70
|
+
value: r,
|
|
71
|
+
style: { color: "hsl(var(--foreground))" }
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ t(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",
|
|
78
|
+
style: {
|
|
79
|
+
minHeight: 400,
|
|
80
|
+
border: "1px solid hsl(var(--border))",
|
|
81
|
+
background: "#fff"
|
|
82
|
+
},
|
|
83
|
+
children: M ? /* @__PURE__ */ f("p", { className: "richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500", children: [
|
|
84
|
+
"⚠ ",
|
|
85
|
+
M
|
|
86
|
+
] }) : v ? (
|
|
87
|
+
// oxlint-disable-next-line react/no-danger
|
|
88
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: v } })
|
|
89
|
+
) : /* @__PURE__ */ t("p", { className: "richtext-text-sm richtext-text-gray-400", children: "Start typing to preview…" })
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] }) }),
|
|
93
|
+
/* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
|
|
94
|
+
_,
|
|
95
|
+
{
|
|
96
|
+
disabled: p || !o || !r.trim(),
|
|
97
|
+
onClick: S,
|
|
98
|
+
type: "button",
|
|
99
|
+
children: "Save changes"
|
|
100
|
+
}
|
|
101
|
+
) })
|
|
102
|
+
] })
|
|
103
|
+
] });
|
|
104
|
+
};
|
|
105
|
+
function K({
|
|
106
|
+
editor: e,
|
|
107
|
+
node: a,
|
|
108
|
+
updateAttributes: d,
|
|
109
|
+
selected: l,
|
|
110
|
+
extension: h
|
|
111
|
+
}) {
|
|
112
|
+
const [r, y] = s(
|
|
113
|
+
() => (e == null ? void 0 : e.isEditable) ?? !1
|
|
114
|
+
);
|
|
115
|
+
C(() => {
|
|
116
|
+
const i = () => y((e == null ? void 0 : e.isEditable) ?? !1);
|
|
117
|
+
return i(), e == null || e.on("editableUpdate", i), e == null || e.on("update", i), () => {
|
|
118
|
+
e == null || e.off("editableUpdate", i), e == null || e.off("update", i);
|
|
119
|
+
};
|
|
120
|
+
}, [e]);
|
|
121
|
+
const { code: v, align: x, width: M } = a.attrs, m = E(null), [u, g] = s(""), [o, I] = s(""), [p, D] = s(null), L = E(
|
|
122
|
+
`mermaid-view-${Math.random().toString(36).slice(2, 9)}`
|
|
123
|
+
);
|
|
124
|
+
C(() => {
|
|
125
|
+
import("mermaid").then((i) => {
|
|
126
|
+
const n = i.default;
|
|
127
|
+
n.initialize({
|
|
128
|
+
startOnLoad: !1,
|
|
129
|
+
darkMode: !1,
|
|
130
|
+
fontSize: 12,
|
|
131
|
+
theme: "base"
|
|
132
|
+
}), D(n);
|
|
133
|
+
});
|
|
134
|
+
}, []);
|
|
135
|
+
const N = A(
|
|
136
|
+
async (i) => {
|
|
137
|
+
if (!(!p || !(i != null && i.trim())))
|
|
138
|
+
try {
|
|
139
|
+
const n = `${L.current}-${Date.now()}`, { svg: c } = await p.render(n, i);
|
|
140
|
+
g(c), I("");
|
|
141
|
+
} catch (n) {
|
|
142
|
+
g(""), I((n == null ? void 0 : n.message) ?? "Invalid Mermaid syntax");
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
[p]
|
|
146
|
+
);
|
|
147
|
+
return C(() => {
|
|
148
|
+
N(v);
|
|
149
|
+
}, [v, N]), /* @__PURE__ */ t(
|
|
150
|
+
V,
|
|
151
|
+
{
|
|
152
|
+
className: "mermaid-node-view richtext-relative richtext-my-4",
|
|
153
|
+
style: {
|
|
154
|
+
textAlign: x ?? "center",
|
|
155
|
+
width: M ?? "100%"
|
|
156
|
+
},
|
|
157
|
+
children: /* @__PURE__ */ f(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
"data-drag-handle": !0,
|
|
161
|
+
draggable: r ? "true" : "false",
|
|
162
|
+
ref: m,
|
|
163
|
+
className: [
|
|
164
|
+
"richtext-relative richtext-inline-block richtext-rounded-lg richtext-border richtext-bg-white richtext-p-4 richtext-transition-all",
|
|
165
|
+
r ? l ? "richtext-border-gray-300" : "richtext-border-transparent" : "richtext-pointer-events-none richtext-select-none richtext-border-transparent"
|
|
166
|
+
].join(" "),
|
|
167
|
+
style: { maxWidth: "100%" },
|
|
168
|
+
children: [
|
|
169
|
+
o ? /* @__PURE__ */ t("div", { className: "richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-red-50 richtext-p-4 richtext-text-sm richtext-text-red-500", children: /* @__PURE__ */ f("span", { children: [
|
|
170
|
+
"⚠ ",
|
|
171
|
+
o
|
|
172
|
+
] }) }) : u ? /* @__PURE__ */ t(
|
|
173
|
+
"div",
|
|
174
|
+
{
|
|
175
|
+
className: "mermaid-svg-container",
|
|
176
|
+
dangerouslySetInnerHTML: { __html: u }
|
|
177
|
+
}
|
|
178
|
+
) : /* @__PURE__ */ t("div", { className: "richtext-flex richtext-min-h-[120px] richtext-min-w-[200px] richtext-items-center richtext-justify-center richtext-rounded richtext-bg-gray-50 richtext-text-sm richtext-text-gray-400", children: "Rendering…" }),
|
|
179
|
+
r && /* @__PURE__ */ t("div", { className: "richtext-absolute richtext-right-2 richtext-top-2 richtext-opacity-0 richtext-transition-opacity [.mermaid-node-view:hover_&]:richtext-opacity-100", children: /* @__PURE__ */ t(
|
|
180
|
+
J,
|
|
181
|
+
{
|
|
182
|
+
editor: e,
|
|
183
|
+
node: a,
|
|
184
|
+
updateAttributes: d,
|
|
185
|
+
extension: h
|
|
186
|
+
}
|
|
187
|
+
) })
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
function re() {
|
|
195
|
+
const e = q(), a = W(Q.name), { tooltipOptions: d = {}, isActive: l = void 0 } = (a == null ? void 0 : a.componentProps) ?? {}, { editorDisabled: h } = G(l), [r, y] = s(b), [v, x] = s(""), [M, m] = s(""), [u, g] = s(!1), [o, I] = s(null), [p, D] = s(!0), L = E(
|
|
196
|
+
`mermaid-toolbar-${Math.random().toString(36).slice(2, 9)}`
|
|
197
|
+
);
|
|
198
|
+
C(() => {
|
|
199
|
+
import("mermaid").then((i) => {
|
|
200
|
+
const n = i.default;
|
|
201
|
+
n.initialize({
|
|
202
|
+
startOnLoad: !1,
|
|
203
|
+
darkMode: !1,
|
|
204
|
+
fontSize: 12,
|
|
205
|
+
theme: "base"
|
|
206
|
+
}), I(n);
|
|
207
|
+
}).finally(() => D(!1));
|
|
208
|
+
}, []), C(() => {
|
|
209
|
+
if (!o || !u) return;
|
|
210
|
+
(async () => {
|
|
211
|
+
const n = r.trim();
|
|
212
|
+
if (!n) {
|
|
213
|
+
x(""), m("");
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
const c = `${L.current}-${Date.now()}`, { svg: w } = await o.render(c, n);
|
|
218
|
+
x(w), m("");
|
|
219
|
+
} catch (c) {
|
|
220
|
+
x(""), m((c == null ? void 0 : c.message) ?? "Invalid Mermaid syntax");
|
|
221
|
+
}
|
|
222
|
+
})();
|
|
223
|
+
}, [r, o, u]);
|
|
224
|
+
const N = A((i) => {
|
|
225
|
+
g(i), i && (y(b), x(""), m(""));
|
|
226
|
+
}, []), S = A(() => {
|
|
227
|
+
r.trim() && (e == null || e.chain().focus().setMermaid({ code: r, align: "center", width: "100%" }).run(), g(!1));
|
|
228
|
+
}, [e, r]);
|
|
229
|
+
return /* @__PURE__ */ f(k, { onOpenChange: N, open: u, children: [
|
|
230
|
+
/* @__PURE__ */ t(H, { asChild: !0, children: /* @__PURE__ */ t(
|
|
231
|
+
R,
|
|
232
|
+
{
|
|
233
|
+
disabled: h,
|
|
234
|
+
icon: "Mermaid",
|
|
235
|
+
tooltip: "Mermaid",
|
|
236
|
+
tooltipOptions: d,
|
|
237
|
+
action: () => {
|
|
238
|
+
h || g(!0);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
) }),
|
|
242
|
+
/* @__PURE__ */ f(O, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
243
|
+
/* @__PURE__ */ t($, { children: "Insert Mermaid Diagram" }),
|
|
244
|
+
/* @__PURE__ */ t("div", { style: { height: "100%", border: "1px solid hsl(var(--border))" }, children: p ? /* @__PURE__ */ t("div", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-p-10 richtext-text-sm richtext-text-gray-400", children: "Loading Mermaid…" }) : /* @__PURE__ */ f("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
|
|
245
|
+
/* @__PURE__ */ t(
|
|
246
|
+
z,
|
|
247
|
+
{
|
|
248
|
+
autoFocus: !0,
|
|
249
|
+
className: "richtext-flex-1 richtext-font-mono richtext-text-sm",
|
|
250
|
+
onChange: (i) => y(i.target.value),
|
|
251
|
+
placeholder: b,
|
|
252
|
+
required: !0,
|
|
253
|
+
rows: 18,
|
|
254
|
+
value: r,
|
|
255
|
+
style: { color: "hsl(var(--foreground))" }
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ t(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
className: "richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-overflow-auto richtext-rounded-[10px] richtext-p-[10px]",
|
|
262
|
+
style: {
|
|
263
|
+
minHeight: 400,
|
|
264
|
+
border: "1px solid hsl(var(--border))",
|
|
265
|
+
background: "#fff"
|
|
266
|
+
},
|
|
267
|
+
children: M ? /* @__PURE__ */ f("p", { className: "richtext-max-w-xs richtext-break-words richtext-text-sm richtext-text-red-500", children: [
|
|
268
|
+
"⚠ ",
|
|
269
|
+
M
|
|
270
|
+
] }) : v ? (
|
|
271
|
+
// oxlint-disable-next-line react/no-danger
|
|
272
|
+
/* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: v } })
|
|
273
|
+
) : /* @__PURE__ */ t("p", { className: "richtext-text-sm richtext-text-gray-400", children: "Start typing to preview…" })
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
] }) }),
|
|
277
|
+
/* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
|
|
278
|
+
_,
|
|
279
|
+
{
|
|
280
|
+
disabled: p || !o || !r.trim(),
|
|
281
|
+
onClick: S,
|
|
282
|
+
type: "button",
|
|
283
|
+
children: "Insert diagram"
|
|
284
|
+
}
|
|
285
|
+
) })
|
|
286
|
+
] })
|
|
287
|
+
] });
|
|
288
|
+
}
|
|
289
|
+
const b = `graph TB
|
|
290
|
+
A --> B`, Q = /* @__PURE__ */ U.create({
|
|
291
|
+
name: "mermaid",
|
|
292
|
+
group: "block",
|
|
293
|
+
selectable: !0,
|
|
294
|
+
atom: !0,
|
|
295
|
+
draggable: !0,
|
|
296
|
+
inline: !1,
|
|
297
|
+
addOptions() {
|
|
298
|
+
return {
|
|
299
|
+
divider: !1,
|
|
300
|
+
spacer: !1,
|
|
301
|
+
HTMLAttributes: {
|
|
302
|
+
class: "mermaid-node"
|
|
303
|
+
},
|
|
304
|
+
button: ({ editor: e, t: a, extension: d }) => ({
|
|
305
|
+
componentProps: {
|
|
306
|
+
action: () => !0,
|
|
307
|
+
isActive: () => e.isActive("mermaid"),
|
|
308
|
+
disabled: !1,
|
|
309
|
+
editor: e,
|
|
310
|
+
icon: "Mermaid",
|
|
311
|
+
tooltip: a("editor.mermaid.tooltip")
|
|
312
|
+
}
|
|
313
|
+
})
|
|
314
|
+
};
|
|
315
|
+
},
|
|
316
|
+
addAttributes() {
|
|
317
|
+
return {
|
|
318
|
+
code: {
|
|
319
|
+
default: b,
|
|
320
|
+
parseHTML: (e) => e.getAttribute("data-code") ? decodeURIComponent(e.getAttribute("data-code")) : b,
|
|
321
|
+
renderHTML: (e) => ({
|
|
322
|
+
"data-code": encodeURIComponent(e.code ?? "")
|
|
323
|
+
})
|
|
324
|
+
},
|
|
325
|
+
align: {
|
|
326
|
+
default: "center",
|
|
327
|
+
parseHTML: (e) => e.getAttribute("data-align") ?? "center",
|
|
328
|
+
renderHTML: (e) => ({
|
|
329
|
+
"data-align": e.align
|
|
330
|
+
})
|
|
331
|
+
},
|
|
332
|
+
width: {
|
|
333
|
+
default: "100%",
|
|
334
|
+
parseHTML: (e) => e.getAttribute("data-width") ?? "100%",
|
|
335
|
+
renderHTML: (e) => ({
|
|
336
|
+
"data-width": e.width
|
|
337
|
+
})
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
},
|
|
341
|
+
parseHTML() {
|
|
342
|
+
return [
|
|
343
|
+
{
|
|
344
|
+
tag: "div[class=mermaid-node]"
|
|
345
|
+
}
|
|
346
|
+
];
|
|
347
|
+
},
|
|
348
|
+
renderHTML({ HTMLAttributes: e, node: a }) {
|
|
349
|
+
const { align: d } = a.attrs, l = d ? `text-align: ${d};` : "";
|
|
350
|
+
return [
|
|
351
|
+
"div",
|
|
352
|
+
P({ class: "mermaid-node" }, e, { style: l })
|
|
353
|
+
];
|
|
354
|
+
},
|
|
355
|
+
addCommands() {
|
|
356
|
+
return {
|
|
357
|
+
setMermaid: (e) => ({ tr: a, commands: d }) => {
|
|
358
|
+
var l, h, r;
|
|
359
|
+
return e = {
|
|
360
|
+
code: b,
|
|
361
|
+
align: "center",
|
|
362
|
+
width: "100%",
|
|
363
|
+
...e
|
|
364
|
+
}, ((r = (h = (l = a.selection) == null ? void 0 : l.node) == null ? void 0 : h.type) == null ? void 0 : r.name) === this.name ? d.updateAttributes(this.name, e) : d.insertContent({
|
|
365
|
+
type: this.name,
|
|
366
|
+
attrs: e
|
|
367
|
+
});
|
|
368
|
+
},
|
|
369
|
+
setMermaidAlign: (e) => ({ commands: a }) => a.updateAttributes(this.name, { align: e })
|
|
370
|
+
};
|
|
371
|
+
},
|
|
372
|
+
addNodeView() {
|
|
373
|
+
return F(K);
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
export {
|
|
377
|
+
b as D,
|
|
378
|
+
J as E,
|
|
379
|
+
Q as M,
|
|
380
|
+
re as R
|
|
381
|
+
};
|
package/lib/Mermaid.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./Mermaid-0GiGVxn0.cjs");exports.DEFAULT_MERMAID_CODE=e.DEFAULT_MERMAID_CODE;exports.Mermaid=e.Mermaid;exports.RichTextMermaid=e.RichTextMermaid;
|
package/lib/Mermaid.js
ADDED
package/lib/MoreMark.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),e=require("react/jsx-runtime"),M=require("react"),c=require("./index-D9oM__YW.cjs");require("./theme.cjs");const l=require("./dropdown-menu-DjWlG2-J.cjs");var x=u.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),f=u.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});function S(){const t=c.useButtonProps(m.name),{icon:s=void 0,tooltip:n=void 0,items:i=[],isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:a,dataState:o}=c.useActive(d),h=M.useMemo(()=>(o==null?void 0:o.title)||"",[o]);return t?e.jsxs(l.DropdownMenu,{children:[e.jsx(l.DropdownMenuTrigger,{asChild:!0,disabled:a,children:e.jsx(c.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:a,icon:s,tooltip:n,children:e.jsx(c.MenuDown,{className:"richtext-size-3 richtext-text-gray-500"})})}),e.jsx(l.DropdownMenuContent,{className:"w-full",children:i==null?void 0:i.map((r,p)=>e.jsxs(l.DropdownMenuCheckboxItem,{checked:h===r.title,className:"richtext-flex richtext-items-center richtext-gap-3",onClick:r.action,children:[e.jsx(c.IconComponent,{name:r==null?void 0:r.icon}),e.jsx("span",{className:"richtext-ml-1",children:r.title}),!!(r!=null&&r.shortcutKeys)&&e.jsx("span",{className:"richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",children:c.getShortcutKeys(r.shortcutKeys)})]},`more-mark-${p}`))})]}):e.jsx(e.Fragment,{})}const m=u.Extension.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:s,extension:n,t:i}){var p,g;const d=n.options.subscript,a=n.options.superscript,o={action:()=>s.commands.toggleSubscript(),isActive:()=>s.isActive("subscript")||!1,disabled:!s.can().toggleSubscript(),icon:"Subscript",title:i("editor.subscript.tooltip"),shortcutKeys:((p=n.options.shortcutKeys)==null?void 0:p[0])??["mod","."]},h={action:()=>s.commands.toggleSuperscript(),isActive:()=>s.isActive("superscript")||!1,disabled:!s.can().toggleSuperscript(),icon:"Superscript",title:i("editor.superscript.tooltip"),shortcutKeys:((g=n.options.shortcutKeys)==null?void 0:g[1])??["mod",","]},r=[];return d!==!1&&r.push(o),a!==!1&&r.push(h),{componentProps:{icon:"Type",tooltip:i("editor.moremark"),disabled:!s.isEditable,items:r,isActive:()=>r==null?void 0:r.find(b=>b.isActive())}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(x.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(f.configure(this.options.superscript)),t}});exports.MoreMark=m;exports.RichTextMoreMark=S;
|
package/lib/MoreMark.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { M as h, m, E as b } from "./clsx-CDyrfCnw.js";
|
|
2
|
+
import { jsx as e, Fragment as M, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as f } from "react";
|
|
4
|
+
import { u as x, e as A, A as S, M as k, I as v, g as y } from "./index-lj3VWExo.js";
|
|
5
|
+
import "./theme.js";
|
|
6
|
+
import { D as T, a as K, b as w, c as C } from "./dropdown-menu-Bs69ZBbO.js";
|
|
7
|
+
var H = h.create({
|
|
8
|
+
name: "subscript",
|
|
9
|
+
addOptions() {
|
|
10
|
+
return {
|
|
11
|
+
HTMLAttributes: {}
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
parseHTML() {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
tag: "sub"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
style: "vertical-align",
|
|
21
|
+
getAttrs(t) {
|
|
22
|
+
return t !== "sub" ? !1 : null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
},
|
|
27
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
28
|
+
return ["sub", m(this.options.HTMLAttributes, t), 0];
|
|
29
|
+
},
|
|
30
|
+
addCommands() {
|
|
31
|
+
return {
|
|
32
|
+
setSubscript: () => ({ commands: t }) => t.setMark(this.name),
|
|
33
|
+
toggleSubscript: () => ({ commands: t }) => t.toggleMark(this.name),
|
|
34
|
+
unsetSubscript: () => ({ commands: t }) => t.unsetMark(this.name)
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
addKeyboardShortcuts() {
|
|
38
|
+
return {
|
|
39
|
+
"Mod-,": () => this.editor.commands.toggleSubscript()
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}), L = h.create({
|
|
43
|
+
name: "superscript",
|
|
44
|
+
addOptions() {
|
|
45
|
+
return {
|
|
46
|
+
HTMLAttributes: {}
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
parseHTML() {
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
tag: "sup"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
style: "vertical-align",
|
|
56
|
+
getAttrs(t) {
|
|
57
|
+
return t !== "super" ? !1 : null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
},
|
|
62
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
63
|
+
return ["sup", m(this.options.HTMLAttributes, t), 0];
|
|
64
|
+
},
|
|
65
|
+
addCommands() {
|
|
66
|
+
return {
|
|
67
|
+
setSuperscript: () => ({ commands: t }) => t.setMark(this.name),
|
|
68
|
+
toggleSuperscript: () => ({ commands: t }) => t.toggleMark(this.name),
|
|
69
|
+
unsetSuperscript: () => ({ commands: t }) => t.unsetMark(this.name)
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
addKeyboardShortcuts() {
|
|
73
|
+
return {
|
|
74
|
+
"Mod-.": () => this.editor.commands.toggleSuperscript()
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
function z() {
|
|
79
|
+
const t = x(D.name), {
|
|
80
|
+
icon: s = void 0,
|
|
81
|
+
tooltip: n = void 0,
|
|
82
|
+
items: i = [],
|
|
83
|
+
isActive: a = void 0
|
|
84
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { disabled: c, dataState: o } = A(a), p = f(() => (o == null ? void 0 : o.title) || "", [o]);
|
|
85
|
+
return t ? /* @__PURE__ */ d(T, { children: [
|
|
86
|
+
/* @__PURE__ */ e(K, { asChild: !0, disabled: c, children: /* @__PURE__ */ e(
|
|
87
|
+
S,
|
|
88
|
+
{
|
|
89
|
+
customClass: "!richtext-w-12 richtext-h-12",
|
|
90
|
+
disabled: c,
|
|
91
|
+
icon: s,
|
|
92
|
+
tooltip: n,
|
|
93
|
+
children: /* @__PURE__ */ e(k, { className: "richtext-size-3 richtext-text-gray-500" })
|
|
94
|
+
}
|
|
95
|
+
) }),
|
|
96
|
+
/* @__PURE__ */ e(w, { className: "w-full", children: i == null ? void 0 : i.map((r, u) => /* @__PURE__ */ d(
|
|
97
|
+
C,
|
|
98
|
+
{
|
|
99
|
+
checked: p === r.title,
|
|
100
|
+
className: "richtext-flex richtext-items-center richtext-gap-3",
|
|
101
|
+
onClick: r.action,
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ e(v, { name: r == null ? void 0 : r.icon }),
|
|
104
|
+
/* @__PURE__ */ e("span", { className: "richtext-ml-1", children: r.title }),
|
|
105
|
+
!!(r != null && r.shortcutKeys) && /* @__PURE__ */ e("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: y(r.shortcutKeys) })
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
`more-mark-${u}`
|
|
109
|
+
)) })
|
|
110
|
+
] }) : /* @__PURE__ */ e(M, {});
|
|
111
|
+
}
|
|
112
|
+
const D = /* @__PURE__ */ b.create({
|
|
113
|
+
name: "moreMark",
|
|
114
|
+
//@ts-expect-error
|
|
115
|
+
addOptions() {
|
|
116
|
+
var t;
|
|
117
|
+
return {
|
|
118
|
+
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
119
|
+
button({ editor: s, extension: n, t: i }) {
|
|
120
|
+
var u, l;
|
|
121
|
+
const a = n.options.subscript, c = n.options.superscript, o = {
|
|
122
|
+
action: () => s.commands.toggleSubscript(),
|
|
123
|
+
isActive: () => s.isActive("subscript") || !1,
|
|
124
|
+
disabled: !s.can().toggleSubscript(),
|
|
125
|
+
icon: "Subscript",
|
|
126
|
+
title: i("editor.subscript.tooltip"),
|
|
127
|
+
shortcutKeys: ((u = n.options.shortcutKeys) == null ? void 0 : u[0]) ?? ["mod", "."]
|
|
128
|
+
}, p = {
|
|
129
|
+
action: () => s.commands.toggleSuperscript(),
|
|
130
|
+
isActive: () => s.isActive("superscript") || !1,
|
|
131
|
+
disabled: !s.can().toggleSuperscript(),
|
|
132
|
+
icon: "Superscript",
|
|
133
|
+
title: i("editor.superscript.tooltip"),
|
|
134
|
+
shortcutKeys: ((l = n.options.shortcutKeys) == null ? void 0 : l[1]) ?? ["mod", ","]
|
|
135
|
+
}, r = [];
|
|
136
|
+
return a !== !1 && r.push(o), c !== !1 && r.push(p), {
|
|
137
|
+
// component: ActionMoreButton,
|
|
138
|
+
componentProps: {
|
|
139
|
+
icon: "Type",
|
|
140
|
+
tooltip: i("editor.moremark"),
|
|
141
|
+
disabled: !s.isEditable,
|
|
142
|
+
items: r,
|
|
143
|
+
isActive: () => r == null ? void 0 : r.find((g) => g.isActive())
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
addExtensions() {
|
|
150
|
+
const t = [];
|
|
151
|
+
return this.options.subscript !== !1 && t.push(H.configure(this.options.subscript)), this.options.superscript !== !1 && t.push(L.configure(this.options.superscript)), t;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
export {
|
|
155
|
+
D as MoreMark,
|
|
156
|
+
z as RichTextMoreMark
|
|
157
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),r=require("react/jsx-runtime"),s=require("./index-D9oM__YW.cjs");require("react");require("./theme.cjs");function O(){const t=s.useButtonProps(c.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:u={},action:n=void 0,isActive:a=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:d,update:l}=s.useToggleActive(a),m=()=>{d||n&&(n(),l())};return t?r.jsx(s.ActionButton,{action:m,dataState:p,disabled:d,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:u}):r.jsx(r.Fragment,{})}const c=v.OrderedList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleOrderedList(),isActive:()=>e.isActive("orderedList"),disabled:!1,icon:"ListOrdered",shortcutKeys:o.options.shortcutKeys??["mod","shift","7"],tooltip:i("editor.orderedlist.tooltip")}})}}});exports.OrderedList=c;exports.RichTextOrderedList=O;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { O as u } from "./index-DjDf4BK8.js";
|
|
2
|
+
import { jsx as n, Fragment as l } from "react/jsx-runtime";
|
|
3
|
+
import { u as f, d as v, A as O } from "./index-lj3VWExo.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "./theme.js";
|
|
6
|
+
function K() {
|
|
7
|
+
const t = f(A.name), {
|
|
8
|
+
icon: o = void 0,
|
|
9
|
+
tooltip: i = void 0,
|
|
10
|
+
shortcutKeys: e = void 0,
|
|
11
|
+
tooltipOptions: d = {},
|
|
12
|
+
action: s = void 0,
|
|
13
|
+
isActive: c = void 0
|
|
14
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: a, disabled: r, update: p } = v(c), m = () => {
|
|
15
|
+
r || s && (s(), p());
|
|
16
|
+
};
|
|
17
|
+
return t ? /* @__PURE__ */ n(
|
|
18
|
+
O,
|
|
19
|
+
{
|
|
20
|
+
action: m,
|
|
21
|
+
dataState: a,
|
|
22
|
+
disabled: r,
|
|
23
|
+
icon: o,
|
|
24
|
+
shortcutKeys: e,
|
|
25
|
+
tooltip: i,
|
|
26
|
+
tooltipOptions: d
|
|
27
|
+
}
|
|
28
|
+
) : /* @__PURE__ */ n(l, {});
|
|
29
|
+
}
|
|
30
|
+
const A = /* @__PURE__ */ u.extend({
|
|
31
|
+
//@ts-expect-error
|
|
32
|
+
addOptions() {
|
|
33
|
+
var t;
|
|
34
|
+
return {
|
|
35
|
+
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
36
|
+
button: ({ editor: o, t: i, extension: e }) => ({
|
|
37
|
+
componentProps: {
|
|
38
|
+
action: () => o.commands.toggleOrderedList(),
|
|
39
|
+
isActive: () => o.isActive("orderedList"),
|
|
40
|
+
disabled: !1,
|
|
41
|
+
icon: "ListOrdered",
|
|
42
|
+
shortcutKeys: e.options.shortcutKeys ?? ["mod", "shift", "7"],
|
|
43
|
+
tooltip: i("editor.orderedlist.tooltip")
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
A as OrderedList,
|
|
51
|
+
K as RichTextOrderedList
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("./clsx-CXbNJWDD.cjs"),D=require("@tiptap/pm/state"),b=require("@tiptap/pm/view"),a=require("react/jsx-runtime"),g=require("react"),h=require("./index-D9oM__YW.cjs");require("./theme.cjs");const J=require("./index-bVGIXhRg.cjs"),q=require("./popover-D-hUKDYu.cjs");function Q(){const{t}=J.useLocale(),e=h.useEditorInstance(),s=h.useButtonProps(F.name),{icon:n=void 0,tooltip:u=void 0,shortcutKeys:o=void 0,tooltipOptions:c={},action:x=void 0,isActive:m=void 0}=(s==null?void 0:s.componentProps)??{},{disabled:i}=h.useActive(m),[R,f]=g.useState(!1),[p,T]=g.useState(""),[C,N]=g.useState(""),[j,M]=g.useState(!1),[V,B]=g.useState(""),w=()=>{var r,l,v,d;B(`${((l=(r=e==null?void 0:e.storage)==null?void 0:r.searchAndReplace)==null?void 0:l.resultIndex)+1}/${(d=(v=e==null?void 0:e.storage)==null?void 0:v.searchAndReplace)==null?void 0:d.results.length}`)};g.useEffect(()=>{e&&w()},[e]);const K=()=>{i||x&&x()},P=(r=!1)=>{var l,v,d,S,A,L,y,$;e&&(r&&((v=(l=e==null?void 0:e.commands)==null?void 0:l.resetIndex)==null||v.call(l)),(S=(d=e==null?void 0:e.commands)==null?void 0:d.setSearchTerm)==null||S.call(d,p),(L=(A=e==null?void 0:e.commands)==null?void 0:A.setReplaceTerm)==null||L.call(A,C),($=(y=e==null?void 0:e.commands)==null?void 0:y.setCaseSensitive)==null||$.call(y,j),w())},k=()=>{var S,A;if(!e)return;const{results:r,resultIndex:l}=e.storage.searchAndReplace,v=r[l];if(!v)return;(A=(S=e==null?void 0:e.commands)==null?void 0:S.setTextSelection)==null||A.call(S,v);const{node:d}=e.view.domAtPos(e.state.selection.anchor);d instanceof HTMLElement&&d.scrollIntoView({behavior:"smooth",block:"center"}),w()};g.useEffect(()=>{p.trim()||E(),p.trim()&&P(!0)},[p]),g.useEffect(()=>{C.trim()&&P()},[C]),g.useEffect(()=>{P(!0)},[j]);const W=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.replace)==null||l.call(r),k()},H=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.nextSearchResult)==null||l.call(r),k()},U=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.previousSearchResult)==null||l.call(r),k()},E=()=>{var r,l;T(""),N(""),(l=(r=e==null?void 0:e.commands)==null?void 0:r.resetIndex)==null||l.call(r),w()},z=()=>{var r,l;(l=(r=e==null?void 0:e.commands)==null?void 0:r.replaceAll)==null||l.call(r),B("0/0")};return s?a.jsxs(q.Popover,{onOpenChange:f,open:R,children:[a.jsx(q.PopoverTrigger,{asChild:!0,disabled:i,children:a.jsx(h.ActionButton,{action:K,disabled:i,icon:n,shortcutKeys:o,tooltip:u,tooltipOptions:c})}),a.jsxs(q.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[a.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[a.jsx(h.Label,{children:t("editor.search.dialog.text")}),a.jsx("span",{className:"richtext-font-semibold",children:V})]}),a.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[a.jsx(h.Input,{autoFocus:!0,className:"richtext-w-full",onChange:r=>T(r.target.value),placeholder:"Text",required:!0,type:"text",value:p}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:U,children:a.jsx(h.IconComponent,{name:"ChevronUp"})}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:H,children:a.jsx(h.IconComponent,{name:"ChevronDown"})}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:E,children:"Clear"})]}),a.jsx(h.Label,{className:"richtext-mb-[6px]",children:t("editor.replace.dialog.text")}),a.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:a.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:a.jsx(h.Input,{className:"richtext-w-80",onChange:r=>N(r.target.value),placeholder:"Text",required:!0,type:"text",value:C})})}),a.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-1",children:[a.jsx(h.Checkbox,{checked:j,onCheckedChange:r=>{M(r),e.commands.setCaseSensitive(r)}}),a.jsx(h.Label,{children:t("editor.replace.caseSensitive")})]}),a.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[a.jsx(h.Button,{className:"richtext-flex-1",onClick:W,children:t("editor.replace.dialog.text")}),a.jsx(h.Button,{className:"richtext-flex-1",onClick:z,children:t("editor.replaceAll.dialog.text")})]})]})]}):a.jsx(a.Fragment,{})}const I=(t,e)=>e(t.tr);function X(t,e,s){return RegExp(e?t.replace(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`):t,s?"gu":"gui")}function Y(t,e,s,n){const u=[],o=[];let c=[],x=0;if(!e)return{decorationsToReturn:b.DecorationSet.empty,results:[]};t==null||t.descendants((m,i)=>{m.isText?c[x]?c[x]={text:c[x].text+m.text,pos:c[x].pos}:c[x]={text:`${m.text}`,pos:i}:x+=1}),c=c.filter(Boolean);for(const m of c){const{text:i,pos:R}=m,f=Array.from(i.matchAll(e)).filter(([p])=>p.trim());for(const p of f){if(p[0]==="")break;p.index!==void 0&&o.push({from:R+p.index,to:R+p.index+p[0].length})}}for(const[m,i]of o.entries()){const R=m===n?`${s} ${s}-current`:s,f=b.Decoration.inline(i.from,i.to,{class:R});u.push(f)}return{decorationsToReturn:b.DecorationSet.create(t,u),results:o}}function O(t,e,{state:s,dispatch:n}){if(!e[0])return;const{from:o,to:c}=e[0];n&&n(s.tr.insertText(t,o,c))}function Z(t,e,s,n){const u=e+1;if(!n[u])return null;const{from:o,to:c}=n[e],x=c-o-t.length+s,{from:m,to:i}=n[u];return n[u]={to:i-x,from:m-x},[x,n]}function _(t,e,{tr:s,dispatch:n}){let u=0,o=e.slice();if(o.length!==0){for(let c=0;c<o.length;c+=1){const{from:x,to:m}=o[c];s.insertText(t,x,m);const i=Z(t,c,u,o);i&&(u=i[0],o=i[1])}n(s)}}const F=G.Extension.create({name:"searchAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchTerm:"",replaceTerm:"",results:[],searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!0,onChange:()=>{},button:({editor:e,t:s})=>({componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:s("editor.searchAndReplace.tooltip"),isActive:()=>!0,editor:e}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.searchTerm=t,I(s,n),!1),setReplaceTerm:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.replaceTerm=t,I(s,n),!1),setCaseSensitive:t=>({editor:e,state:s,dispatch:n})=>(e.storage.searchAndReplace.caseSensitive=t,I(s,n),!1),resetIndex:()=>({editor:t,state:e,dispatch:s})=>(t.storage.searchAndReplace.resultIndex=0,I(e,s),!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:s}=t.storage.searchAndReplace,n=s+1;return e[n]?t.storage.searchAndReplace.resultIndex=n:t.storage.searchAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:s}=t.storage.searchAndReplace,n=s-1;return e[n]?t.storage.searchAndReplace.resultIndex=n:t.storage.searchAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:s})=>{const{replaceTerm:n,results:u,resultIndex:o}=t.storage.searchAndReplace,c=u[o];return c?(O(n,[c],{state:e,dispatch:s}),t.storage.searchAndReplace.results.splice(o,1)):(O(n,u,{state:e,dispatch:s}),t.storage.searchAndReplace.results.shift()),I(e,s),!1},replaceAll:()=>({editor:t,tr:e,state:s,dispatch:n})=>{const{replaceTerm:u,results:o}=t.storage.searchAndReplace;return _(u,o,{tr:e,dispatch:n}),t.storage.searchAndReplace.resultIndex=0,t.storage.searchAndReplace.results=[],I(s,n),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:s}=this.options,n=c=>t.storage.searchAndReplace.lastSearchTerm=c,u=c=>t.storage.searchAndReplace.lastCaseSensitive=c,o=c=>t.storage.searchAndReplace.lastResultIndex=c;return[new D.Plugin({key:new D.PluginKey(`richtextCustomPlugin${this.name}`),state:{init:()=>b.DecorationSet.empty,apply({doc:c,docChanged:x},m){const{searchTerm:i,lastSearchTerm:R,caseSensitive:f,lastCaseSensitive:p,resultIndex:T,lastResultIndex:C}=t.storage.searchAndReplace;if(!x&&R===i&&p===f&&C===T)return m;if(n(i),u(f),o(T),!i)return t.storage.searchAndReplace.results=[],b.DecorationSet.empty;const{decorationsToReturn:N,results:j}=Y(c,X(i,s,f),e,T);return t.storage.searchAndReplace.results=j,N}},props:{decorations(c){return this.getState(c)}}})]}});exports.RichTextSearchAndReplace=Q;exports.SearchAndReplace=F;
|