@blocklet/editor-lite 2.6.0
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 +13 -0
- package/README.md +33 -0
- package/lib/blocklet-editor-viewer.d.ts +4 -0
- package/lib/blocklet-editor-viewer.js +12 -0
- package/lib/blocklet-editor.d.ts +2 -0
- package/lib/blocklet-editor.js +12 -0
- package/lib/components/Loading.d.ts +4 -0
- package/lib/components/Loading.js +13 -0
- package/lib/components/SelectionPopper.d.ts +14 -0
- package/lib/components/SelectionPopper.js +73 -0
- package/lib/components/animateText.d.ts +3 -0
- package/lib/components/animateText.js +29 -0
- package/lib/components/createPortal.d.ts +2 -0
- package/lib/components/createPortal.js +16 -0
- package/lib/config.d.ts +37 -0
- package/lib/config.js +12 -0
- package/lib/ext/AIPlugin/AIIcon.d.ts +5 -0
- package/lib/ext/AIPlugin/AIIcon.js +7 -0
- package/lib/ext/AIPlugin/Arrow.d.ts +1 -0
- package/lib/ext/AIPlugin/Arrow.js +5 -0
- package/lib/ext/AIPlugin/TextGeneration.d.ts +6 -0
- package/lib/ext/AIPlugin/TextGeneration.js +131 -0
- package/lib/ext/AIPlugin/Writing.d.ts +1 -0
- package/lib/ext/AIPlugin/Writing.js +7 -0
- package/lib/ext/AIPlugin/index.d.ts +9 -0
- package/lib/ext/AIPlugin/index.js +180 -0
- package/lib/ext/AIPlugin/utils.d.ts +6 -0
- package/lib/ext/AIPlugin/utils.js +44 -0
- package/lib/ext/AITranslationPlugin/index.d.ts +9 -0
- package/lib/ext/AITranslationPlugin/index.js +124 -0
- package/lib/ext/AITranslationPlugin/selection.d.ts +3 -0
- package/lib/ext/AITranslationPlugin/selection.js +45 -0
- package/lib/ext/AITranslationPlugin/translation.d.ts +3 -0
- package/lib/ext/AITranslationPlugin/translation.js +67 -0
- package/lib/ext/AITranslationPlugin/types.d.ts +49 -0
- package/lib/ext/AITranslationPlugin/types.js +1 -0
- package/lib/ext/AITranslationPlugin/utils.d.ts +46 -0
- package/lib/ext/AITranslationPlugin/utils.js +343 -0
- package/lib/ext/Aide/Aide.d.ts +4 -0
- package/lib/ext/Aide/Aide.js +30 -0
- package/lib/ext/Aide/Delayed.d.ts +7 -0
- package/lib/ext/Aide/Delayed.js +12 -0
- package/lib/ext/Aide/Input.d.ts +6 -0
- package/lib/ext/Aide/Input.js +49 -0
- package/lib/ext/Aide/Menu.d.ts +4 -0
- package/lib/ext/Aide/Menu.js +29 -0
- package/lib/ext/Aide/Output.d.ts +4 -0
- package/lib/ext/Aide/Output.js +14 -0
- package/lib/ext/Aide/Templates.d.ts +4 -0
- package/lib/ext/Aide/Templates.js +34 -0
- package/lib/ext/Aide/builtin-templates.d.ts +3 -0
- package/lib/ext/Aide/builtin-templates.js +48 -0
- package/lib/ext/Aide/context.d.ts +47 -0
- package/lib/ext/Aide/context.js +114 -0
- package/lib/ext/Aide/external-templates/Breadcrumb.d.ts +10 -0
- package/lib/ext/Aide/external-templates/Breadcrumb.js +11 -0
- package/lib/ext/Aide/external-templates/Output.d.ts +8 -0
- package/lib/ext/Aide/external-templates/Output.js +22 -0
- package/lib/ext/Aide/external-templates/Search.d.ts +6 -0
- package/lib/ext/Aide/external-templates/Search.js +14 -0
- package/lib/ext/Aide/external-templates/Tags.d.ts +4 -0
- package/lib/ext/Aide/external-templates/Tags.js +44 -0
- package/lib/ext/Aide/external-templates/Template.d.ts +7 -0
- package/lib/ext/Aide/external-templates/Template.js +110 -0
- package/lib/ext/Aide/external-templates/Templates.d.ts +6 -0
- package/lib/ext/Aide/external-templates/Templates.js +61 -0
- package/lib/ext/Aide/external-templates/index.d.ts +4 -0
- package/lib/ext/Aide/external-templates/index.js +83 -0
- package/lib/ext/Aide/external-templates/parameter-field.d.ts +6 -0
- package/lib/ext/Aide/external-templates/parameter-field.js +92 -0
- package/lib/ext/Aide/hooks.d.ts +7 -0
- package/lib/ext/Aide/hooks.js +14 -0
- package/lib/ext/Aide/index.d.ts +2 -0
- package/lib/ext/Aide/index.js +2 -0
- package/lib/ext/Aide/types.d.ts +84 -0
- package/lib/ext/Aide/types.js +25 -0
- package/lib/ext/Aide/withAiAvailable.d.ts +5 -0
- package/lib/ext/Aide/withAiAvailable.js +11 -0
- package/lib/ext/Alert/AlertComponent.d.ts +10 -0
- package/lib/ext/Alert/AlertComponent.js +38 -0
- package/lib/ext/Alert/AlertNode.d.ts +28 -0
- package/lib/ext/Alert/AlertNode.js +105 -0
- package/lib/ext/Alert/AlertPlugin.d.ts +11 -0
- package/lib/ext/Alert/AlertPlugin.js +41 -0
- package/lib/ext/BilibiliPlugin/BilibiliNode.d.ts +31 -0
- package/lib/ext/BilibiliPlugin/BilibiliNode.js +95 -0
- package/lib/ext/BilibiliPlugin/BilibiliVideo.d.ts +6 -0
- package/lib/ext/BilibiliPlugin/BilibiliVideo.js +24 -0
- package/lib/ext/BilibiliPlugin/config.d.ts +2 -0
- package/lib/ext/BilibiliPlugin/config.js +40 -0
- package/lib/ext/BilibiliPlugin/index.d.ts +5 -0
- package/lib/ext/BilibiliPlugin/index.js +20 -0
- package/lib/ext/BlockletEmbedPlugin/BlockletEmbed.d.ts +7 -0
- package/lib/ext/BlockletEmbedPlugin/BlockletEmbed.js +51 -0
- package/lib/ext/BlockletEmbedPlugin/BlockletEmbedNode.d.ts +30 -0
- package/lib/ext/BlockletEmbedPlugin/BlockletEmbedNode.js +96 -0
- package/lib/ext/BlockletEmbedPlugin/index.d.ts +12 -0
- package/lib/ext/BlockletEmbedPlugin/index.js +76 -0
- package/lib/ext/BlurTextPlugin.d.ts +1 -0
- package/lib/ext/BlurTextPlugin.js +40 -0
- package/lib/ext/BookmarkPlugin/Bookmark.d.ts +7 -0
- package/lib/ext/BookmarkPlugin/Bookmark.js +175 -0
- package/lib/ext/BookmarkPlugin/BookmarkNode.d.ts +35 -0
- package/lib/ext/BookmarkPlugin/BookmarkNode.js +110 -0
- package/lib/ext/BookmarkPlugin/index.d.ts +11 -0
- package/lib/ext/BookmarkPlugin/index.js +45 -0
- package/lib/ext/BusyPlugin.d.ts +9 -0
- package/lib/ext/BusyPlugin.js +17 -0
- package/lib/ext/CharacterCountPlugin/index.d.ts +10 -0
- package/lib/ext/CharacterCountPlugin/index.js +39 -0
- package/lib/ext/CharacterCountPlugin/useCharacterCount.d.ts +11 -0
- package/lib/ext/CharacterCountPlugin/useCharacterCount.js +49 -0
- package/lib/ext/CharacterLimitPlugin/index.d.ts +9 -0
- package/lib/ext/CharacterLimitPlugin/index.js +49 -0
- package/lib/ext/CheckboxPlugin.d.ts +3 -0
- package/lib/ext/CheckboxPlugin.js +75 -0
- package/lib/ext/CodeCopyPlugin/CodeCopyPlugin.d.ts +2 -0
- package/lib/ext/CodeCopyPlugin/CodeCopyPlugin.js +90 -0
- package/lib/ext/CodeCopyPlugin/copy.svg +1 -0
- package/lib/ext/CodeCopyPlugin/index.d.ts +1 -0
- package/lib/ext/CodeCopyPlugin/index.js +1 -0
- package/lib/ext/CodeCopyPlugin/style.css +12 -0
- package/lib/ext/ContentLocale.d.ts +7 -0
- package/lib/ext/ContentLocale.js +15 -0
- package/lib/ext/CustomOnChangePlugin/index.d.ts +5 -0
- package/lib/ext/CustomOnChangePlugin/index.js +17 -0
- package/lib/ext/CustomOnChangePlugin/styles.css +14 -0
- package/lib/ext/CustomOnChangePlugin/utils.d.ts +30 -0
- package/lib/ext/CustomOnChangePlugin/utils.js +148 -0
- package/lib/ext/EditorHolderPlugin/EditorHolderContext.d.ts +13 -0
- package/lib/ext/EditorHolderPlugin/EditorHolderContext.js +15 -0
- package/lib/ext/EditorHolderPlugin/EditorHolderPlugin.d.ts +1 -0
- package/lib/ext/EditorHolderPlugin/EditorHolderPlugin.js +11 -0
- package/lib/ext/EditorHolderPlugin/index.d.ts +2 -0
- package/lib/ext/EditorHolderPlugin/index.js +2 -0
- package/lib/ext/EditorReadyPlugin.d.ts +3 -0
- package/lib/ext/EditorReadyPlugin.js +15 -0
- package/lib/ext/FilePlugin/FileNode.d.ts +44 -0
- package/lib/ext/FilePlugin/FileNode.js +195 -0
- package/lib/ext/FilePlugin/FilePlugin.d.ts +7 -0
- package/lib/ext/FilePlugin/FilePlugin.js +27 -0
- package/lib/ext/FilePlugin/index.d.ts +2 -0
- package/lib/ext/FilePlugin/index.js +2 -0
- package/lib/ext/HeadingsIdPlugin.d.ts +1 -0
- package/lib/ext/HeadingsIdPlugin.js +67 -0
- package/lib/ext/ImagePathFixerPlugin.d.ts +1 -0
- package/lib/ext/ImagePathFixerPlugin.js +31 -0
- package/lib/ext/InlineTranslationPlugin/EditorTranslator.d.ts +42 -0
- package/lib/ext/InlineTranslationPlugin/EditorTranslator.js +199 -0
- package/lib/ext/InlineTranslationPlugin/InlineTranslationPlugin.d.ts +12 -0
- package/lib/ext/InlineTranslationPlugin/InlineTranslationPlugin.js +232 -0
- package/lib/ext/InlineTranslationPlugin/TranslationNode.d.ts +23 -0
- package/lib/ext/InlineTranslationPlugin/TranslationNode.js +49 -0
- package/lib/ext/InlineTranslationPlugin/index.d.ts +4 -0
- package/lib/ext/InlineTranslationPlugin/index.js +4 -0
- package/lib/ext/InlineTranslationPlugin/store.d.ts +50 -0
- package/lib/ext/InlineTranslationPlugin/store.js +94 -0
- package/lib/ext/InlineTranslationPlugin/types.d.ts +1 -0
- package/lib/ext/InlineTranslationPlugin/types.js +1 -0
- package/lib/ext/LexicalEditorRefPlugin.d.ts +14 -0
- package/lib/ext/LexicalEditorRefPlugin.js +26 -0
- package/lib/ext/OnContentChangePlugin.d.ts +14 -0
- package/lib/ext/OnContentChangePlugin.js +35 -0
- package/lib/ext/PasteSlackImagePlugin/index.d.ts +2 -0
- package/lib/ext/PasteSlackImagePlugin/index.js +22 -0
- package/lib/ext/PostLinkEmbedPlugin/PostLinkNode.d.ts +32 -0
- package/lib/ext/PostLinkEmbedPlugin/PostLinkNode.js +140 -0
- package/lib/ext/PostLinkEmbedPlugin/fixInvalidPostLinkNodes.d.ts +1 -0
- package/lib/ext/PostLinkEmbedPlugin/fixInvalidPostLinkNodes.js +15 -0
- package/lib/ext/PostLinkEmbedPlugin/index.d.ts +21 -0
- package/lib/ext/PostLinkEmbedPlugin/index.js +148 -0
- package/lib/ext/RemoveListPlugin.d.ts +1 -0
- package/lib/ext/RemoveListPlugin.js +63 -0
- package/lib/ext/SafeAreaPlugin.d.ts +12 -0
- package/lib/ext/SafeAreaPlugin.js +56 -0
- package/lib/ext/SelectBlockPlugin.d.ts +1 -0
- package/lib/ext/SelectBlockPlugin.js +95 -0
- package/lib/ext/ShortcutPlugin/CtrlsShortcutPlugin.d.ts +6 -0
- package/lib/ext/ShortcutPlugin/CtrlsShortcutPlugin.js +17 -0
- package/lib/ext/ShortcutPlugin/index.d.ts +1 -0
- package/lib/ext/ShortcutPlugin/index.js +1 -0
- package/lib/ext/TemplatePlugin.d.ts +8 -0
- package/lib/ext/TemplatePlugin.js +170 -0
- package/lib/ext/VideoPathFixerPlugin.d.ts +1 -0
- package/lib/ext/VideoPathFixerPlugin.js +31 -0
- package/lib/ext/VideoPlugin/VideoComponent.d.ts +5 -0
- package/lib/ext/VideoPlugin/VideoComponent.js +5 -0
- package/lib/ext/VideoPlugin/VideoNode.d.ts +37 -0
- package/lib/ext/VideoPlugin/VideoNode.js +97 -0
- package/lib/ext/VideoPlugin/VideoPlugin.d.ts +7 -0
- package/lib/ext/VideoPlugin/VideoPlugin.js +26 -0
- package/lib/ext/VideoPlugin/index.d.ts +2 -0
- package/lib/ext/VideoPlugin/index.js +2 -0
- package/lib/ext/common.d.ts +15 -0
- package/lib/ext/common.js +62 -0
- package/lib/ext/nodes/GithubComp.d.ts +3 -0
- package/lib/ext/nodes/GithubComp.js +20 -0
- package/lib/ext/nodes/GithubNode.d.ts +28 -0
- package/lib/ext/nodes/GithubNode.js +94 -0
- package/lib/ext/nodes/util.d.ts +5 -0
- package/lib/ext/nodes/util.js +1 -0
- package/lib/ext/translation/translation-utils.d.ts +16 -0
- package/lib/ext/translation/translation-utils.js +63 -0
- package/lib/ext/utils.d.ts +21 -0
- package/lib/ext/utils.js +88 -0
- package/lib/global.d.ts +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +5 -0
- package/lib/lexical-utils/index.d.ts +46 -0
- package/lib/lexical-utils/index.js +243 -0
- package/lib/libs/sort-array-by-key.d.ts +4 -0
- package/lib/libs/sort-array-by-key.js +68 -0
- package/lib/libs/utm.d.ts +9 -0
- package/lib/libs/utm.js +43 -0
- package/lib/main/appSettings.d.ts +11 -0
- package/lib/main/appSettings.js +20 -0
- package/lib/main/context/SharedAutocompleteContext.d.ts +16 -0
- package/lib/main/context/SharedAutocompleteContext.js +35 -0
- package/lib/main/context/SharedHistoryContext.d.ts +17 -0
- package/lib/main/context/SharedHistoryContext.js +11 -0
- package/lib/main/editor-root.d.ts +2 -0
- package/lib/main/editor-root.js +46 -0
- package/lib/main/editor.d.ts +21 -0
- package/lib/main/editor.js +99 -0
- package/lib/main/hooks/hooks.d.ts +15 -0
- package/lib/main/hooks/hooks.js +49 -0
- package/lib/main/hooks/medium-zoom.d.ts +9 -0
- package/lib/main/hooks/medium-zoom.js +34 -0
- package/lib/main/hooks/use-mobile.d.ts +4 -0
- package/lib/main/hooks/use-mobile.js +6 -0
- package/lib/main/hooks/useBeforeUnload.d.ts +1 -0
- package/lib/main/hooks/useBeforeUnload.js +15 -0
- package/lib/main/hooks/useHasNodes.d.ts +1 -0
- package/lib/main/hooks/useHasNodes.js +8 -0
- package/lib/main/hooks/useIsFocused.d.ts +1 -0
- package/lib/main/hooks/useIsFocused.js +20 -0
- package/lib/main/hooks/useModal.d.ts +12 -0
- package/lib/main/hooks/useModal.js +33 -0
- package/lib/main/hooks/useReport.d.ts +8 -0
- package/lib/main/hooks/useReport.js +48 -0
- package/lib/main/hooks/useResponsiveTable.d.ts +5 -0
- package/lib/main/hooks/useResponsiveTable.js +31 -0
- package/lib/main/hooks/useTranslationListener.d.ts +4 -0
- package/lib/main/hooks/useTranslationListener.js +94 -0
- package/lib/main/icons.d.ts +3 -0
- package/lib/main/icons.js +25 -0
- package/lib/main/images/emoji/1F600.png +0 -0
- package/lib/main/images/emoji/1F641.png +0 -0
- package/lib/main/images/emoji/1F642.png +0 -0
- package/lib/main/images/emoji/2764.png +0 -0
- package/lib/main/images/excalidraw.svg +3 -0
- package/lib/main/images/icons/arrow-clockwise.svg +1 -0
- package/lib/main/images/icons/arrow-counterclockwise.svg +1 -0
- package/lib/main/images/icons/bg-color.svg +1 -0
- package/lib/main/images/icons/camera.svg +1 -0
- package/lib/main/images/icons/caret-right-fill.svg +1 -0
- package/lib/main/images/icons/chat-left-text.svg +1 -0
- package/lib/main/images/icons/chat-right-dots.svg +1 -0
- package/lib/main/images/icons/chat-right-text.svg +1 -0
- package/lib/main/images/icons/chat-right.svg +1 -0
- package/lib/main/images/icons/chat-square-quote.svg +1 -0
- package/lib/main/images/icons/chevron-down.svg +1 -0
- package/lib/main/images/icons/clipboard.svg +1 -0
- package/lib/main/images/icons/close.svg +1 -0
- package/lib/main/images/icons/code.svg +1 -0
- package/lib/main/images/icons/comments.svg +1 -0
- package/lib/main/images/icons/copy.svg +1 -0
- package/lib/main/images/icons/diagram-2.svg +1 -0
- package/lib/main/images/icons/download.svg +1 -0
- package/lib/main/images/icons/draggable-block-menu.svg +1 -0
- package/lib/main/images/icons/dropdown-more.svg +1 -0
- package/lib/main/images/icons/figma.svg +1 -0
- package/lib/main/images/icons/file-image.svg +1 -0
- package/lib/main/images/icons/filetype-gif.svg +1 -0
- package/lib/main/images/icons/font-color.svg +1 -0
- package/lib/main/images/icons/font-family.svg +1 -0
- package/lib/main/images/icons/gear.svg +1 -0
- package/lib/main/images/icons/horizontal-rule.svg +1 -0
- package/lib/main/images/icons/indent.svg +1 -0
- package/lib/main/images/icons/journal-code.svg +1 -0
- package/lib/main/images/icons/journal-text.svg +1 -0
- package/lib/main/images/icons/justify.svg +1 -0
- package/lib/main/images/icons/link.svg +1 -0
- package/lib/main/images/icons/list-ol.svg +1 -0
- package/lib/main/images/icons/list-ul.svg +1 -0
- package/lib/main/images/icons/lock-fill.svg +1 -0
- package/lib/main/images/icons/lock.svg +1 -0
- package/lib/main/images/icons/markdown.svg +1 -0
- package/lib/main/images/icons/mic.svg +1 -0
- package/lib/main/images/icons/outdent.svg +1 -0
- package/lib/main/images/icons/paint-bucket.svg +1 -0
- package/lib/main/images/icons/palette.svg +1 -0
- package/lib/main/images/icons/pencil-fill.svg +1 -0
- package/lib/main/images/icons/plug-fill.svg +1 -0
- package/lib/main/images/icons/plug.svg +1 -0
- package/lib/main/images/icons/plus-slash-minus.svg +1 -0
- package/lib/main/images/icons/plus.svg +1 -0
- package/lib/main/images/icons/prettier-error.svg +1 -0
- package/lib/main/images/icons/prettier.svg +1 -0
- package/lib/main/images/icons/send.svg +1 -0
- package/lib/main/images/icons/square-check.svg +1 -0
- package/lib/main/images/icons/sticky.svg +1 -0
- package/lib/main/images/icons/success.svg +1 -0
- package/lib/main/images/icons/table.svg +1 -0
- package/lib/main/images/icons/text-center.svg +1 -0
- package/lib/main/images/icons/text-left.svg +1 -0
- package/lib/main/images/icons/text-paragraph.svg +1 -0
- package/lib/main/images/icons/text-right.svg +1 -0
- package/lib/main/images/icons/trash.svg +1 -0
- package/lib/main/images/icons/trash3.svg +1 -0
- package/lib/main/images/icons/tweet.svg +1 -0
- package/lib/main/images/icons/type-bold.svg +1 -0
- package/lib/main/images/icons/type-h1.svg +1 -0
- package/lib/main/images/icons/type-h2.svg +1 -0
- package/lib/main/images/icons/type-h3.svg +1 -0
- package/lib/main/images/icons/type-h4.svg +1 -0
- package/lib/main/images/icons/type-h5.svg +1 -0
- package/lib/main/images/icons/type-h6.svg +1 -0
- package/lib/main/images/icons/type-italic.svg +1 -0
- package/lib/main/images/icons/type-strikethrough.svg +1 -0
- package/lib/main/images/icons/type-subscript.svg +1 -0
- package/lib/main/images/icons/type-superscript.svg +1 -0
- package/lib/main/images/icons/type-underline.svg +1 -0
- package/lib/main/images/icons/upload.svg +1 -0
- package/lib/main/images/icons/user.svg +1 -0
- package/lib/main/images/icons/youtube.svg +1 -0
- package/lib/main/images/landscape.jpg +0 -0
- package/lib/main/index.css +257 -0
- package/lib/main/index.d.ts +28 -0
- package/lib/main/index.js +52 -0
- package/lib/main/nodes/EmojiNode.d.ts +25 -0
- package/lib/main/nodes/EmojiNode.js +57 -0
- package/lib/main/nodes/EquationNode.d.ts +31 -0
- package/lib/main/nodes/EquationNode.js +65 -0
- package/lib/main/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +13 -0
- package/lib/main/nodes/ExcalidrawNode/ExcalidrawComponent.js +155 -0
- package/lib/main/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +58 -0
- package/lib/main/nodes/ExcalidrawNode/ExcalidrawImage.js +60 -0
- package/lib/main/nodes/ExcalidrawNode/ExcalidrawModal.css +75 -0
- package/lib/main/nodes/ExcalidrawNode/ExcalidrawModal.d.ts +49 -0
- package/lib/main/nodes/ExcalidrawNode/ExcalidrawModal.js +197 -0
- package/lib/main/nodes/ExcalidrawNode/index.d.ts +30 -0
- package/lib/main/nodes/ExcalidrawNode/index.js +95 -0
- package/lib/main/nodes/ExcalidrawNode/utils.d.ts +5 -0
- package/lib/main/nodes/ExcalidrawNode/utils.js +71 -0
- package/lib/main/nodes/FigmaNode.d.ts +30 -0
- package/lib/main/nodes/FigmaNode.js +59 -0
- package/lib/main/nodes/ImageComponent.d.ts +27 -0
- package/lib/main/nodes/ImageComponent.js +432 -0
- package/lib/main/nodes/ImageNode.css +51 -0
- package/lib/main/nodes/ImageNode.d.ts +74 -0
- package/lib/main/nodes/ImageNode.js +151 -0
- package/lib/main/nodes/KeywordNode.d.ts +25 -0
- package/lib/main/nodes/KeywordNode.js +52 -0
- package/lib/main/nodes/MentionNode.d.ts +27 -0
- package/lib/main/nodes/MentionNode.js +88 -0
- package/lib/main/nodes/PlaygroundNodes.d.ts +10 -0
- package/lib/main/nodes/PlaygroundNodes.js +70 -0
- package/lib/main/nodes/TweetNode.d.ts +31 -0
- package/lib/main/nodes/TweetNode.js +126 -0
- package/lib/main/nodes/YouTubeNode.d.ts +32 -0
- package/lib/main/nodes/YouTubeNode.js +94 -0
- package/lib/main/plugins/AutoEmbedPlugin/index.d.ts +27 -0
- package/lib/main/plugins/AutoEmbedPlugin/index.js +353 -0
- package/lib/main/plugins/AutoEmbedPlugin/urlParseCache.d.ts +2 -0
- package/lib/main/plugins/AutoEmbedPlugin/urlParseCache.js +14 -0
- package/lib/main/plugins/AutoLinkPlugin/index.d.ts +9 -0
- package/lib/main/plugins/AutoLinkPlugin/index.js +39 -0
- package/lib/main/plugins/ClickableLinkPlugin/index.d.ts +8 -0
- package/lib/main/plugins/ClickableLinkPlugin/index.js +141 -0
- package/lib/main/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +7 -0
- package/lib/main/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +44 -0
- package/lib/main/plugins/CodeActionMenuPlugin/index.css +46 -0
- package/lib/main/plugins/CodeActionMenuPlugin/index.d.ts +12 -0
- package/lib/main/plugins/CodeActionMenuPlugin/index.js +100 -0
- package/lib/main/plugins/CodeActionMenuPlugin/utils.d.ts +2 -0
- package/lib/main/plugins/CodeActionMenuPlugin/utils.js +18 -0
- package/lib/main/plugins/CodeHighlightPlugin/index.d.ts +9 -0
- package/lib/main/plugins/CodeHighlightPlugin/index.js +17 -0
- package/lib/main/plugins/CollapsiblePlugin/Collapsible.css +61 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +30 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +120 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +24 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleContentNode.js +90 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +24 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +95 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleUtils.d.ts +9 -0
- package/lib/main/plugins/CollapsiblePlugin/CollapsibleUtils.js +15 -0
- package/lib/main/plugins/CollapsiblePlugin/index.d.ts +11 -0
- package/lib/main/plugins/CollapsiblePlugin/index.js +147 -0
- package/lib/main/plugins/ComponentPickerPlugin/index.d.ts +12 -0
- package/lib/main/plugins/ComponentPickerPlugin/index.js +438 -0
- package/lib/main/plugins/DragDropPastePlugin/index.d.ts +8 -0
- package/lib/main/plugins/DragDropPastePlugin/index.js +32 -0
- package/lib/main/plugins/DraggableBlockPlugin/index.css +36 -0
- package/lib/main/plugins/DraggableBlockPlugin/index.d.ts +12 -0
- package/lib/main/plugins/DraggableBlockPlugin/index.js +288 -0
- package/lib/main/plugins/EmojisPlugin/index.d.ts +9 -0
- package/lib/main/plugins/EmojisPlugin/index.js +63 -0
- package/lib/main/plugins/ExcalidrawPlugin/index.d.ts +3 -0
- package/lib/main/plugins/ExcalidrawPlugin/index.js +30 -0
- package/lib/main/plugins/FigmaPlugin/index.d.ts +11 -0
- package/lib/main/plugins/FigmaPlugin/index.js +27 -0
- package/lib/main/plugins/FloatingLinkEditorPlugin/index.css +39 -0
- package/lib/main/plugins/FloatingLinkEditorPlugin/index.d.ts +12 -0
- package/lib/main/plugins/FloatingLinkEditorPlugin/index.js +181 -0
- package/lib/main/plugins/FloatingTextFormatToolbarPlugin/ColorPickerButton.d.ts +5 -0
- package/lib/main/plugins/FloatingTextFormatToolbarPlugin/ColorPickerButton.js +24 -0
- package/lib/main/plugins/FloatingTextFormatToolbarPlugin/index.css +128 -0
- package/lib/main/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +12 -0
- package/lib/main/plugins/FloatingTextFormatToolbarPlugin/index.js +216 -0
- package/lib/main/plugins/HorizontalRulePlugin/index.d.ts +8 -0
- package/lib/main/plugins/HorizontalRulePlugin/index.js +30 -0
- package/lib/main/plugins/ImagesPlugin/index.d.ts +15 -0
- package/lib/main/plugins/ImagesPlugin/index.js +36 -0
- package/lib/main/plugins/LexicalTypeaheadMenuPlugin/index.d.ts +64 -0
- package/lib/main/plugins/LexicalTypeaheadMenuPlugin/index.js +493 -0
- package/lib/main/plugins/MarkdownShortcutPlugin/index.d.ts +9 -0
- package/lib/main/plugins/MarkdownShortcutPlugin/index.js +22 -0
- package/lib/main/plugins/MarkdownTransformers/index.d.ts +12 -0
- package/lib/main/plugins/MarkdownTransformers/index.js +185 -0
- package/lib/main/plugins/MaxLengthPlugin/index.d.ts +10 -0
- package/lib/main/plugins/MaxLengthPlugin/index.js +43 -0
- package/lib/main/plugins/MentionsPlugin/HighlightStyle.d.ts +2 -0
- package/lib/main/plugins/MentionsPlugin/HighlightStyle.js +13 -0
- package/lib/main/plugins/MentionsPlugin/index.d.ts +9 -0
- package/lib/main/plugins/MentionsPlugin/index.js +175 -0
- package/lib/main/plugins/TabFocusPlugin/index.d.ts +8 -0
- package/lib/main/plugins/TabFocusPlugin/index.js +41 -0
- package/lib/main/plugins/TableActionMenuPlugin/index.d.ts +12 -0
- package/lib/main/plugins/TableActionMenuPlugin/index.js +486 -0
- package/lib/main/plugins/TableCellResizer/index.css +20 -0
- package/lib/main/plugins/TableCellResizer/index.d.ts +3 -0
- package/lib/main/plugins/TableCellResizer/index.js +295 -0
- package/lib/main/plugins/TableOfContentsPlugin/index.css +87 -0
- package/lib/main/plugins/TableOfContentsPlugin/index.d.ts +2 -0
- package/lib/main/plugins/TableOfContentsPlugin/index.js +106 -0
- package/lib/main/plugins/TablePlugin.d.ts +38 -0
- package/lib/main/plugins/TablePlugin.js +63 -0
- package/lib/main/plugins/ToolbarPlugin/index.d.ts +8 -0
- package/lib/main/plugins/ToolbarPlugin/index.js +467 -0
- package/lib/main/plugins/TreeViewPlugin/index.d.ts +9 -0
- package/lib/main/plugins/TreeViewPlugin/index.js +14 -0
- package/lib/main/plugins/TwitterPlugin/index.d.ts +11 -0
- package/lib/main/plugins/TwitterPlugin/index.js +27 -0
- package/lib/main/plugins/TypingPerfPlugin/index.d.ts +9 -0
- package/lib/main/plugins/TypingPerfPlugin/index.js +100 -0
- package/lib/main/plugins/YouTubePlugin/index.d.ts +11 -0
- package/lib/main/plugins/YouTubePlugin/index.js +27 -0
- package/lib/main/server/validation.d.ts +8 -0
- package/lib/main/server/validation.js +119 -0
- package/lib/main/setupEnv.d.ts +8 -0
- package/lib/main/setupEnv.js +25 -0
- package/lib/main/style/editable.css +476 -0
- package/lib/main/styled-editor-content.d.ts +5 -0
- package/lib/main/styled-editor-content.js +206 -0
- package/lib/main/themes/code-highlight/index.d.ts +32 -0
- package/lib/main/themes/code-highlight/index.js +58 -0
- package/lib/main/themes/customTheme.d.ts +2 -0
- package/lib/main/themes/customTheme.js +324 -0
- package/lib/main/themes/defaultTheme.d.ts +10 -0
- package/lib/main/themes/defaultTheme.js +554 -0
- package/lib/main/themes/table/index.d.ts +3 -0
- package/lib/main/themes/table/index.js +20 -0
- package/lib/main/themes/table/table.css +214 -0
- package/lib/main/ui/Button.css +36 -0
- package/lib/main/ui/Button.d.ts +18 -0
- package/lib/main/ui/Button.js +13 -0
- package/lib/main/ui/ColorPicker.css +89 -0
- package/lib/main/ui/ColorPicker.d.ts +28 -0
- package/lib/main/ui/ColorPicker.js +206 -0
- package/lib/main/ui/ContentEditable.d.ts +2 -0
- package/lib/main/ui/ContentEditable.js +15 -0
- package/lib/main/ui/Dialog.css +17 -0
- package/lib/main/ui/Dialog.d.ts +16 -0
- package/lib/main/ui/Dialog.js +15 -0
- package/lib/main/ui/DropDown.d.ts +25 -0
- package/lib/main/ui/DropDown.js +146 -0
- package/lib/main/ui/FileInput.d.ts +17 -0
- package/lib/main/ui/FileInput.js +5 -0
- package/lib/main/ui/FrameMockup/browser.css +52 -0
- package/lib/main/ui/FrameMockup/browser.d.ts +13 -0
- package/lib/main/ui/FrameMockup/browser.js +22 -0
- package/lib/main/ui/FrameMockup/index.d.ts +113 -0
- package/lib/main/ui/FrameMockup/index.js +61 -0
- package/lib/main/ui/ImageEnhancer.d.ts +29 -0
- package/lib/main/ui/ImageEnhancer.js +113 -0
- package/lib/main/ui/ImageResizer.d.ts +24 -0
- package/lib/main/ui/ImageResizer.js +154 -0
- package/lib/main/ui/Input.css +30 -0
- package/lib/main/ui/Modal.css +62 -0
- package/lib/main/ui/Modal.d.ts +15 -0
- package/lib/main/ui/Modal.js +50 -0
- package/lib/main/ui/Placeholder.d.ts +6 -0
- package/lib/main/ui/Placeholder.js +20 -0
- package/lib/main/ui/TextInput.d.ts +20 -0
- package/lib/main/ui/TextInput.js +14 -0
- package/lib/main/utils/getDOMRangeRect.d.ts +8 -0
- package/lib/main/utils/getDOMRangeRect.js +22 -0
- package/lib/main/utils/getSelectedNode.d.ts +2 -0
- package/lib/main/utils/getSelectedNode.js +22 -0
- package/lib/main/utils/guard.d.ts +14 -0
- package/lib/main/utils/guard.js +36 -0
- package/lib/main/utils/images.d.ts +10 -0
- package/lib/main/utils/images.js +16 -0
- package/lib/main/utils/join-classes.d.ts +8 -0
- package/lib/main/utils/join-classes.js +10 -0
- package/lib/main/utils/point.d.ts +21 -0
- package/lib/main/utils/point.js +42 -0
- package/lib/main/utils/prevent-duplicate-upload.d.ts +2 -0
- package/lib/main/utils/prevent-duplicate-upload.js +25 -0
- package/lib/main/utils/rect.d.ts +45 -0
- package/lib/main/utils/rect.js +98 -0
- package/lib/main/utils/sanitizeUrl.d.ts +8 -0
- package/lib/main/utils/sanitizeUrl.js +17 -0
- package/lib/main/utils/setFloatingElemPosition.d.ts +1 -0
- package/lib/main/utils/setFloatingElemPosition.js +32 -0
- package/lib/main/utils/swipe.d.ts +11 -0
- package/lib/main/utils/swipe.js +98 -0
- package/lib/main/viewer/index.d.ts +5 -0
- package/lib/main/viewer/index.js +25 -0
- package/lib/main/viewer/types.d.ts +14 -0
- package/lib/main/viewer/types.js +1 -0
- package/lib/main/viewer/viewer.d.ts +3 -0
- package/lib/main/viewer/viewer.js +31 -0
- package/lib/shared/canUseDOM.d.ts +8 -0
- package/lib/shared/canUseDOM.js +10 -0
- package/lib/shared/environment.d.ts +24 -0
- package/lib/shared/environment.js +21 -0
- package/lib/shared/getDOMSelection.d.ts +9 -0
- package/lib/shared/getDOMSelection.js +10 -0
- package/lib/shared/invariant.d.ts +8 -0
- package/lib/shared/invariant.js +16 -0
- package/lib/shared/useLayoutEffect.d.ts +10 -0
- package/lib/shared/useLayoutEffect.js +11 -0
- package/lib/types.d.ts +19 -0
- package/lib/types.js +1 -0
- package/lib/vendor/LexicalCharacterLimitPlugin/LexicalCharacterLimitPlugin.d.ts +15 -0
- package/lib/vendor/LexicalCharacterLimitPlugin/LexicalCharacterLimitPlugin.js +45 -0
- package/lib/vendor/LexicalCharacterLimitPlugin/index.d.ts +1 -0
- package/lib/vendor/LexicalCharacterLimitPlugin/index.js +1 -0
- package/lib/vendor/LexicalCharacterLimitPlugin/useCharacterLimit.d.ts +16 -0
- package/lib/vendor/LexicalCharacterLimitPlugin/useCharacterLimit.js +208 -0
- package/lib/vendor/history/LexicalHistoryPlugin.d.ts +14 -0
- package/lib/vendor/history/LexicalHistoryPlugin.js +15 -0
- package/lib/vendor/history/history/index.d.ts +63 -0
- package/lib/vendor/history/history/index.js +351 -0
- package/lib/vendor/history/useHistory.d.ts +10 -0
- package/lib/vendor/history/useHistory.js +15 -0
- package/package.json +109 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DecoratorNode } from 'lexical';
|
|
3
|
+
import { Suspense } from 'react';
|
|
4
|
+
import { joinURL, withFragment } from 'ufo';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
import { useTheme } from '@mui/material';
|
|
7
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
8
|
+
import { exhaustiveGuard, safeParseJSON, discussKitMountPoint } from '../utils';
|
|
9
|
+
function PostLinkComponent(postInfo) {
|
|
10
|
+
const { locale } = useLocaleContext();
|
|
11
|
+
const { palette } = useTheme();
|
|
12
|
+
// PostLinkNode 新/旧版本对于 link 的处理:
|
|
13
|
+
// - 旧版本: 存储 post link, 渲染 link 时直接使用 post link
|
|
14
|
+
// - 新版本: 连同 id, type, boardId 等信息一并存储, 渲染 link 时动态拼接 post link (与 embed 时的 post link 解耦)
|
|
15
|
+
let { link } = postInfo;
|
|
16
|
+
// pageGroup 模式下 path 需要特殊处理
|
|
17
|
+
const { pageGroup } = window.blocklet;
|
|
18
|
+
// 存在 type, 说明是新版本, 拼接 post link
|
|
19
|
+
if (postInfo.type && !postInfo.external) {
|
|
20
|
+
switch (postInfo.type) {
|
|
21
|
+
case 'post':
|
|
22
|
+
link =
|
|
23
|
+
pageGroup === 'discussion'
|
|
24
|
+
? joinURL(window.blocklet.prefix, postInfo.id)
|
|
25
|
+
: joinURL(discussKitMountPoint, '/discussions', postInfo.id);
|
|
26
|
+
break;
|
|
27
|
+
case 'blog':
|
|
28
|
+
link =
|
|
29
|
+
pageGroup === 'blog'
|
|
30
|
+
? joinURL(window.blocklet.prefix, locale, postInfo.id)
|
|
31
|
+
: joinURL(discussKitMountPoint, '/blog', locale, postInfo.id);
|
|
32
|
+
break;
|
|
33
|
+
case 'doc':
|
|
34
|
+
link =
|
|
35
|
+
pageGroup === 'doc'
|
|
36
|
+
? joinURL(window.blocklet.prefix, postInfo.boardId, locale, postInfo.id)
|
|
37
|
+
: joinURL(discussKitMountPoint, '/docs', postInfo.boardId, locale, postInfo.id);
|
|
38
|
+
break;
|
|
39
|
+
case 'task':
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
exhaustiveGuard(postInfo.type);
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
link = withFragment(link, new URL(postInfo.link).hash.slice(1));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// ignore
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return (_jsxs(Box, { sx: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
'&:hover': { bgcolor: 'grey.200', boxShadow: `0 0 0 3px ${palette.grey[200]}`, borderRadius: 1 },
|
|
55
|
+
}, children: [_jsx(Box, { component: "i", className: "iconify", "data-icon": postInfo.type === 'task' ? 'lucide:list-todo' : 'ri:file-list-2-line', sx: { flex: '0 0 auto', width: 18, height: 18, mr: 0.25, color: 'grey.600' } }), _jsx(Box, { component: "a", href: link, sx: {
|
|
56
|
+
display: 'inline-block',
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
textOverflow: 'ellipsis',
|
|
59
|
+
whiteSpace: 'nowrap',
|
|
60
|
+
wordBreak: 'break-word',
|
|
61
|
+
height: 18,
|
|
62
|
+
lineHeight: '18px',
|
|
63
|
+
borderBottom: '1px solid',
|
|
64
|
+
borderColor: 'divider',
|
|
65
|
+
fontSize: 14,
|
|
66
|
+
textDecoration: 'none',
|
|
67
|
+
fontWeight: 'medium',
|
|
68
|
+
color: 'inherit',
|
|
69
|
+
}, title: postInfo.title ?? link, children: postInfo.title ?? link }), !!postInfo.external && (_jsx(Box, { component: "i", className: "iconify", "data-icon": "majesticons:external-link-line", sx: { flex: '0 0 auto', width: 16, height: 16, ml: 0.5, color: 'grey.600' } }))] }));
|
|
70
|
+
}
|
|
71
|
+
function convertPostElement(domNode) {
|
|
72
|
+
if (domNode instanceof HTMLElement && domNode.getAttribute('data-lexical-post-link-json')) {
|
|
73
|
+
const postInfo = domNode.getAttribute('data-lexical-post-link-json');
|
|
74
|
+
const node = $createPostLinkNode(safeParseJSON(postInfo, {}));
|
|
75
|
+
return { node };
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
export class PostLinkNode extends DecoratorNode {
|
|
80
|
+
__postInfo;
|
|
81
|
+
static getType() {
|
|
82
|
+
return 'post-link';
|
|
83
|
+
}
|
|
84
|
+
static clone(node) {
|
|
85
|
+
return new PostLinkNode({ ...node.__postInfo }, node.__key);
|
|
86
|
+
}
|
|
87
|
+
static importJSON(serializedNode) {
|
|
88
|
+
const { postInfo } = serializedNode;
|
|
89
|
+
const node = $createPostLinkNode(safeParseJSON(postInfo, {}));
|
|
90
|
+
return node;
|
|
91
|
+
}
|
|
92
|
+
exportDOM() {
|
|
93
|
+
const element = document.createElement('a');
|
|
94
|
+
element.setAttribute('href', this.__postInfo.link || '');
|
|
95
|
+
element.setAttribute('data-lexical-post-link-json', JSON.stringify(this.__postInfo));
|
|
96
|
+
const text = document.createTextNode(this.__postInfo.title ?? this.__postInfo.link);
|
|
97
|
+
element.appendChild(text);
|
|
98
|
+
return { element };
|
|
99
|
+
}
|
|
100
|
+
static importDOM() {
|
|
101
|
+
return {
|
|
102
|
+
img: (node) => ({
|
|
103
|
+
conversion: convertPostElement,
|
|
104
|
+
priority: 0,
|
|
105
|
+
}),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
constructor(postInfo, key) {
|
|
109
|
+
super(key);
|
|
110
|
+
this.__postInfo = postInfo;
|
|
111
|
+
}
|
|
112
|
+
exportJSON() {
|
|
113
|
+
return {
|
|
114
|
+
postInfo: JSON.stringify(this.__postInfo),
|
|
115
|
+
type: 'post-link',
|
|
116
|
+
version: 1,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// View
|
|
120
|
+
createDOM(config) {
|
|
121
|
+
const span = document.createElement('span');
|
|
122
|
+
span.className = 'inline-embed-container';
|
|
123
|
+
return span;
|
|
124
|
+
}
|
|
125
|
+
updateDOM() {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
getPostInfo() {
|
|
129
|
+
return this.__postInfo;
|
|
130
|
+
}
|
|
131
|
+
decorate() {
|
|
132
|
+
return (_jsx(Suspense, { fallback: null, children: _jsx(PostLinkComponent, { ...this.__postInfo }) }));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export function $createPostLinkNode(postInfo) {
|
|
136
|
+
return new PostLinkNode(postInfo);
|
|
137
|
+
}
|
|
138
|
+
export function $isPostLinkNode(node) {
|
|
139
|
+
return node instanceof PostLinkNode;
|
|
140
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFixInvalidPostLinkNodes(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
|
+
import { PostLinkNode } from './PostLinkNode';
|
|
4
|
+
// 移除 postInfo 为空的无效 PostLinkNode (可能是复制粘贴产生的)
|
|
5
|
+
export function useFixInvalidPostLinkNodes() {
|
|
6
|
+
const [editor] = useLexicalComposerContext();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
function transform(node) {
|
|
9
|
+
if (!node.getPostInfo()) {
|
|
10
|
+
node.remove();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return editor.registerNodeTransform(PostLinkNode, transform);
|
|
14
|
+
}, [editor]);
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LexicalCommand, LexicalEditor } from 'lexical';
|
|
2
|
+
import { type JSX } from 'react';
|
|
3
|
+
import { AutoEmbedOption } from '@lexical/react/LexicalAutoEmbedPlugin';
|
|
4
|
+
import { EditorConfig } from '../../config';
|
|
5
|
+
type PostType = 'post' | 'blog' | 'doc' | 'task';
|
|
6
|
+
type Payload = {
|
|
7
|
+
id: string;
|
|
8
|
+
type: PostType;
|
|
9
|
+
url: string;
|
|
10
|
+
title: string;
|
|
11
|
+
boardId: string;
|
|
12
|
+
external?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const INSERT_POST_LINK_COMMAND: LexicalCommand<Payload>;
|
|
15
|
+
/**
|
|
16
|
+
* 创建 "Embed Post Link" AutoEmbedOption
|
|
17
|
+
* 未挂载 discuss kit 或 url 不匹配 discussion/blog/doc 详情页 => 不显示 "Embed Post Link" option
|
|
18
|
+
*/
|
|
19
|
+
export declare const createPostLinkAutoEmbedOption: (editor: LexicalEditor, editorConfig: EditorConfig) => AutoEmbedOption | null;
|
|
20
|
+
export default function PostLinkEmbedPlugin(): JSX.Element | null;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
2
|
+
import { $createTextNode, $insertNodes, COMMAND_PRIORITY_EDITOR, createCommand, } from 'lexical';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { AutoEmbedOption } from '@lexical/react/LexicalAutoEmbedPlugin';
|
|
5
|
+
import { $createLinkNode } from '@lexical/link';
|
|
6
|
+
import { Path } from 'path-parser';
|
|
7
|
+
import { joinURL } from 'ufo';
|
|
8
|
+
import { $createPostLinkNode, PostLinkNode } from './PostLinkNode';
|
|
9
|
+
import { $createEmojiNode } from '../../main/nodes/EmojiNode';
|
|
10
|
+
import { $getLinkNode, getBlockletMountPointInfo, isSameHost } from '../utils';
|
|
11
|
+
const taskMountPoint = window.blocklet.componentMountPoints?.find((x) => x.did === 'z2qa4xMVAJxvA1GgfnPpMFqhdSjU9pe37NCiY')?.mountPoint;
|
|
12
|
+
const paths = [
|
|
13
|
+
{ path: '/discussions/:id', type: 'post' },
|
|
14
|
+
{ path: '/blog/:locale/:id', type: 'blog' },
|
|
15
|
+
{
|
|
16
|
+
path: '/blog/:locale/post/:year/:month/:date/:id',
|
|
17
|
+
type: 'blog',
|
|
18
|
+
getId: (match) => `${match.year}-${match.month}-${match.date}-${match.id}`,
|
|
19
|
+
},
|
|
20
|
+
{ path: '/docs/:board/:locale/:id', type: 'doc' },
|
|
21
|
+
];
|
|
22
|
+
if (taskMountPoint) {
|
|
23
|
+
paths.push({ path: joinURL(taskMountPoint, '/task/:id'), type: 'task' });
|
|
24
|
+
}
|
|
25
|
+
const discussKitMountPoint = getBlockletMountPointInfo('did-comments')?.mountPoint;
|
|
26
|
+
const fetchPostInfo = async ({ id, url, type, }) => {
|
|
27
|
+
try {
|
|
28
|
+
const urlObj = new URL(url);
|
|
29
|
+
if (type === 'task' && taskMountPoint) {
|
|
30
|
+
const taskRes = await fetch(joinURL(urlObj.origin, taskMountPoint, `/api/task/item/${id}`)).then((res) => res.json());
|
|
31
|
+
if (taskRes.data.task) {
|
|
32
|
+
return { id, title: taskRes.data.task.title, boardId: '', external: true };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (isSameHost(urlObj)) {
|
|
36
|
+
const res = await fetch(joinURL(discussKitMountPoint, `/api/embed/posts/slug/${id}`));
|
|
37
|
+
return await res.json();
|
|
38
|
+
}
|
|
39
|
+
const blockletJs = joinURL(urlObj.origin, '/__blocklet__.js?type=json');
|
|
40
|
+
const blockletInfo = await fetch(blockletJs).then((res) => res.json());
|
|
41
|
+
const mountPoint = blockletInfo?.componentMountPoints?.find((x) => x.name === 'did-comments')?.mountPoint;
|
|
42
|
+
if (mountPoint) {
|
|
43
|
+
const postInfo = await fetch(joinURL(urlObj.origin, mountPoint, `/api/embed/posts/slug/${id}`)).then((res) => res.json());
|
|
44
|
+
return { ...postInfo, external: true };
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const parsePostLink = (url) => {
|
|
53
|
+
try {
|
|
54
|
+
const urlObj = new URL(url);
|
|
55
|
+
// 无论 host 是否相同, 都尝试与 paths 匹配
|
|
56
|
+
for (const { path, type, getId } of paths) {
|
|
57
|
+
const match = new Path(path).test(urlObj.pathname) || new Path(`/:prefix${path}`).test(urlObj.pathname);
|
|
58
|
+
if (match) {
|
|
59
|
+
return {
|
|
60
|
+
id: getId ? getId(match) : match.id,
|
|
61
|
+
type,
|
|
62
|
+
url,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.error(e);
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
};
|
|
72
|
+
export const INSERT_POST_LINK_COMMAND = createCommand('INSERT_POST_LINK_COMMAND');
|
|
73
|
+
/**
|
|
74
|
+
* 创建 "Embed Post Link" AutoEmbedOption
|
|
75
|
+
* 未挂载 discuss kit 或 url 不匹配 discussion/blog/doc 详情页 => 不显示 "Embed Post Link" option
|
|
76
|
+
*/
|
|
77
|
+
export const createPostLinkAutoEmbedOption = (editor, editorConfig) => {
|
|
78
|
+
const linkNode = $getLinkNode(editor);
|
|
79
|
+
const url = linkNode?.__url;
|
|
80
|
+
if (editorConfig.openGraphEndpoint && url) {
|
|
81
|
+
const parsed = parsePostLink(url);
|
|
82
|
+
if (!parsed) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return new AutoEmbedOption('Embed Post Link', {
|
|
86
|
+
onSelect: () => {
|
|
87
|
+
editor.update(async () => {
|
|
88
|
+
linkNode.selectEnd();
|
|
89
|
+
linkNode.remove();
|
|
90
|
+
const whitespace = $createTextNode(' ');
|
|
91
|
+
const loadingNode = $createEmojiNode('global-loading', '');
|
|
92
|
+
$insertNodes([loadingNode, whitespace]);
|
|
93
|
+
try {
|
|
94
|
+
const postInfo = await fetchPostInfo(parsed);
|
|
95
|
+
if (!postInfo) {
|
|
96
|
+
throw new Error('PostLinkEmbedPlugin: postInfo not found');
|
|
97
|
+
}
|
|
98
|
+
editor.update(() => {
|
|
99
|
+
loadingNode.remove();
|
|
100
|
+
editor.dispatchCommand(INSERT_POST_LINK_COMMAND, { ...postInfo, type: parsed.type, url });
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
if (e instanceof Error) {
|
|
105
|
+
console.error('PostLinkEmbedPlugin: ', e.message);
|
|
106
|
+
}
|
|
107
|
+
editor.update(() => {
|
|
108
|
+
loadingNode.remove();
|
|
109
|
+
// 获取 postInfo 失败, 恢复显示 link
|
|
110
|
+
$insertNodes([
|
|
111
|
+
$createLinkNode(linkNode.__url).append($createTextNode(linkNode.__url)),
|
|
112
|
+
$createTextNode(' '),
|
|
113
|
+
]);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
};
|
|
122
|
+
export default function PostLinkEmbedPlugin() {
|
|
123
|
+
const [editor] = useLexicalComposerContext();
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (!editor.hasNodes([PostLinkNode])) {
|
|
126
|
+
throw new Error('PostLinkEmbedPlugin: PostLinkNode not registered on editor');
|
|
127
|
+
}
|
|
128
|
+
return editor.registerCommand(INSERT_POST_LINK_COMMAND, (payload) => {
|
|
129
|
+
editor.update(() => {
|
|
130
|
+
if (payload) {
|
|
131
|
+
const postLinkNode = $createPostLinkNode({
|
|
132
|
+
id: payload.id,
|
|
133
|
+
title: payload.title,
|
|
134
|
+
link: payload.url || '',
|
|
135
|
+
type: payload.type,
|
|
136
|
+
boardId: payload.boardId,
|
|
137
|
+
external: payload.external,
|
|
138
|
+
});
|
|
139
|
+
$insertNodes([postLinkNode, $createTextNode(' ')]);
|
|
140
|
+
// 删除前面的空格 (与 loadingNode 一起插入的空格)
|
|
141
|
+
postLinkNode.getPreviousSibling()?.remove();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return true;
|
|
145
|
+
}, COMMAND_PRIORITY_EDITOR);
|
|
146
|
+
}, [editor]);
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function RemoveListPlugin(): null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { $isListItemNode, $isListNode, ListItemNode } from '@lexical/list';
|
|
2
|
+
import { mergeRegister, $getNearestNodeOfType } from '@lexical/utils';
|
|
3
|
+
import { COMMAND_PRIORITY_CRITICAL, KEY_DOWN_COMMAND, $getSelection, $isRangeSelection, $createParagraphNode, } from 'lexical';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
|
+
function $isLastItemInList(listItem) {
|
|
7
|
+
let isLast = true;
|
|
8
|
+
const firstChild = listItem.getFirstChild();
|
|
9
|
+
if ($isListNode(firstChild)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
let parent = listItem;
|
|
13
|
+
while (parent !== null) {
|
|
14
|
+
if ($isListItemNode(parent)) {
|
|
15
|
+
if (parent.getNextSiblings().length > 0) {
|
|
16
|
+
isLast = false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
parent = parent.getParent();
|
|
20
|
+
}
|
|
21
|
+
return isLast;
|
|
22
|
+
}
|
|
23
|
+
export default function RemoveListPlugin() {
|
|
24
|
+
const [editor] = useLexicalComposerContext();
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
return mergeRegister(editor.registerCommand(KEY_DOWN_COMMAND, (event) => {
|
|
27
|
+
const DELETE_CODE = ['Backspace', 'Delete'].map((key) => key.toLocaleLowerCase());
|
|
28
|
+
if (DELETE_CODE.includes(event.code.toLocaleLowerCase())) {
|
|
29
|
+
const selection = $getSelection();
|
|
30
|
+
if ($isRangeSelection(selection)) {
|
|
31
|
+
try {
|
|
32
|
+
const anchorNode = selection.anchor.getNode();
|
|
33
|
+
const listItemNode = $getNearestNodeOfType(anchorNode, ListItemNode);
|
|
34
|
+
const isLastItemInList = listItemNode ? $isLastItemInList(listItemNode) : false;
|
|
35
|
+
if (isLastItemInList && listItemNode) {
|
|
36
|
+
if (!selection.anchor.offset) {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
const childrens = listItemNode.getChildren();
|
|
39
|
+
const paragraph = $createParagraphNode();
|
|
40
|
+
if (Array.isArray(childrens) && childrens.length) {
|
|
41
|
+
childrens.forEach((child) => {
|
|
42
|
+
paragraph.append(child);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
listItemNode.insertAfter(paragraph);
|
|
46
|
+
listItemNode.remove();
|
|
47
|
+
selection.anchor.set(paragraph.getKey(), 0, 'element');
|
|
48
|
+
selection.focus.set(paragraph.getKey(), 0, 'element');
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error(error);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}, COMMAND_PRIORITY_CRITICAL));
|
|
61
|
+
}, [editor]);
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* - 在 editor 底部增加一个 30vh 的安全区域
|
|
3
|
+
* - 仅在 edit mode 下生效
|
|
4
|
+
* - 在 comment list 这种纵向空间有限的场景建议禁用该插件
|
|
5
|
+
*/
|
|
6
|
+
export declare function SafeAreaPlugin({ size }: {
|
|
7
|
+
size?: number | string;
|
|
8
|
+
}): null;
|
|
9
|
+
export declare function useSafeArea({ enabled, size }: {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
size?: number | string;
|
|
12
|
+
}): void;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
const normalizeCssSize = (size) => {
|
|
4
|
+
if (typeof size === 'number') {
|
|
5
|
+
return `${size}px`;
|
|
6
|
+
}
|
|
7
|
+
return size;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* - 在 editor 底部增加一个 30vh 的安全区域
|
|
11
|
+
* - 仅在 edit mode 下生效
|
|
12
|
+
* - 在 comment list 这种纵向空间有限的场景建议禁用该插件
|
|
13
|
+
*/
|
|
14
|
+
export function SafeAreaPlugin({ size = '30vh' }) {
|
|
15
|
+
const [editor] = useLexicalComposerContext();
|
|
16
|
+
const originalValue = useRef(undefined);
|
|
17
|
+
// TODO: editable true->false 时恢复原值
|
|
18
|
+
// const restore = () => {
|
|
19
|
+
// const rootElement = editor.getRootElement();
|
|
20
|
+
// if (rootElement) {
|
|
21
|
+
// rootElement.style.paddingBottom = originalValue.current || '';
|
|
22
|
+
// }
|
|
23
|
+
// };
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
return editor.registerRootListener((rootElement, prevRootElement) => {
|
|
26
|
+
if (rootElement !== null && editor.isEditable()) {
|
|
27
|
+
if (originalValue.current === undefined) {
|
|
28
|
+
originalValue.current = rootElement.style.paddingBottom;
|
|
29
|
+
}
|
|
30
|
+
rootElement.style.paddingBottom = normalizeCssSize(size);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}, [editor]);
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
export function useSafeArea({ enabled, size = '30vh' }) {
|
|
37
|
+
const [editor] = useLexicalComposerContext();
|
|
38
|
+
const originalValue = useRef(undefined);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const cleanup = editor.registerRootListener((rootElement, prevRootElement) => {
|
|
41
|
+
if (rootElement !== null && editor.isEditable() && enabled) {
|
|
42
|
+
if (originalValue.current === undefined) {
|
|
43
|
+
originalValue.current = rootElement.style.paddingBottom;
|
|
44
|
+
}
|
|
45
|
+
rootElement.style.paddingBottom = normalizeCssSize(size);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return () => {
|
|
49
|
+
const rootElement = editor.getRootElement();
|
|
50
|
+
if (rootElement && originalValue.current !== undefined) {
|
|
51
|
+
rootElement.style.paddingBottom = originalValue.current;
|
|
52
|
+
}
|
|
53
|
+
cleanup();
|
|
54
|
+
};
|
|
55
|
+
}, [editor, enabled]);
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SelectBlockWrapper(): null;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
|
+
import { $getSelection, $isRangeSelection, $isElementNode, $isTextNode, KEY_DOWN_COMMAND, COMMAND_PRIORITY_CRITICAL, } from 'lexical';
|
|
4
|
+
import { $selectAll } from '@lexical/selection';
|
|
5
|
+
import { IS_APPLE } from '../shared/environment';
|
|
6
|
+
export default function SelectBlockWrapper() {
|
|
7
|
+
const [editor] = useLexicalComposerContext();
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
return editor.registerCommand(KEY_DOWN_COMMAND, (event) => {
|
|
10
|
+
if (event.keyCode === 65 && (IS_APPLE ? event.metaKey : event.ctrlKey)) {
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
editor.update(() => {
|
|
13
|
+
const selection = $getSelection();
|
|
14
|
+
if ($isRangeSelection(selection)) {
|
|
15
|
+
// 是否是从底部开始选择
|
|
16
|
+
const isBottomToToSelect = selection.isBackward();
|
|
17
|
+
// 选区的起始节点
|
|
18
|
+
const { anchor } = selection;
|
|
19
|
+
// 选区的结束节点
|
|
20
|
+
const { focus } = selection;
|
|
21
|
+
// 选区起始节点所在的最顶层元素
|
|
22
|
+
const anchorTopLevelElement = anchor.getNode().getTopLevelElementOrThrow();
|
|
23
|
+
// 选区结束节点所在的最顶层元素
|
|
24
|
+
const focusTopLevelElement = focus.getNode().getTopLevelElementOrThrow();
|
|
25
|
+
// 选区起始节点
|
|
26
|
+
let anchorNode = isBottomToToSelect
|
|
27
|
+
? anchorTopLevelElement.getLastDescendant()
|
|
28
|
+
: anchorTopLevelElement.getFirstDescendant();
|
|
29
|
+
// 选区结束节点
|
|
30
|
+
let focusNode = isBottomToToSelect
|
|
31
|
+
? focusTopLevelElement.getFirstDescendant()
|
|
32
|
+
: focusTopLevelElement.getLastDescendant();
|
|
33
|
+
/**
|
|
34
|
+
* 设置选择区域
|
|
35
|
+
* @param anchorOffset 起始偏移量
|
|
36
|
+
* @param focusOffset 结束偏移量
|
|
37
|
+
* @param anchorType 起始类型
|
|
38
|
+
* @param lastType 结束类型
|
|
39
|
+
*/
|
|
40
|
+
const setSelection = ({ anchorOffset, focusOffset, anchorType, focusType, }) => {
|
|
41
|
+
if (anchor.offset === anchorOffset && focus.offset === focusOffset) {
|
|
42
|
+
$selectAll(selection);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
anchor.set(anchorNode.getKey(), anchorOffset, anchorType);
|
|
46
|
+
focus.set(focusNode.getKey(), focusOffset, focusType);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
let anchorType = 'element'; // 锚点类型,默认为 element
|
|
50
|
+
let focusType = 'element'; // 焦点类型,默认为 element
|
|
51
|
+
let anchorOffset = 0; // 锚点偏移量
|
|
52
|
+
let focusOffset = 0; // 焦点偏移量
|
|
53
|
+
if ($isTextNode(anchorNode)) {
|
|
54
|
+
// 如果锚点为文本节点
|
|
55
|
+
anchorType = 'text'; // 锚点类型设置为 text
|
|
56
|
+
anchorOffset = anchorNode.getTextContentSize(); // 锚点偏移量设置为文本内容长度
|
|
57
|
+
}
|
|
58
|
+
else if (!$isElementNode(anchorNode) && anchorNode !== null) {
|
|
59
|
+
// 如果锚点不是元素节点,并且不为 null
|
|
60
|
+
// eslint-disable-next-line no-self-assign
|
|
61
|
+
anchorNode = anchorNode;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
anchorNode = anchorTopLevelElement; // 锚点设置为父节点
|
|
65
|
+
}
|
|
66
|
+
if ($isTextNode(focusNode)) {
|
|
67
|
+
// 如果焦点为文本节点
|
|
68
|
+
focusType = 'text'; // 焦点类型设置为 text
|
|
69
|
+
focusOffset = focusNode.getTextContentSize(); // 焦点偏移量设置为文本内容长度
|
|
70
|
+
}
|
|
71
|
+
else if (!$isElementNode(focusNode) && focusNode !== null) {
|
|
72
|
+
// 如果焦点不是元素节点,并且不为 null
|
|
73
|
+
// eslint-disable-next-line no-self-assign
|
|
74
|
+
focusNode = focusNode;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
focusNode = focusTopLevelElement; // 焦点设置为父节点
|
|
78
|
+
}
|
|
79
|
+
if (anchorNode && focusNode) {
|
|
80
|
+
setSelection({
|
|
81
|
+
anchorOffset: isBottomToToSelect ? anchorOffset : 0,
|
|
82
|
+
focusOffset: isBottomToToSelect ? 0 : focusOffset,
|
|
83
|
+
anchorType,
|
|
84
|
+
focusType,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
}, COMMAND_PRIORITY_CRITICAL);
|
|
93
|
+
}, [editor]);
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export function CtrlsShortcutPlugin({ callback }) {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
const handleKeyDown = (e) => {
|
|
5
|
+
if (e.key === 's' && (e.metaKey || e.ctrlKey)) {
|
|
6
|
+
e.preventDefault();
|
|
7
|
+
callback();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
11
|
+
return () => {
|
|
12
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
13
|
+
};
|
|
14
|
+
}, [callback]);
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
export default CtrlsShortcutPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CtrlsShortcutPlugin } from './CtrlsShortcutPlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CtrlsShortcutPlugin } from './CtrlsShortcutPlugin';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export declare const INSERT_TEMPLATE_COMMAND: import("lexical").LexicalCommand<unknown>;
|
|
3
|
+
export declare function TemplatePlugin(): JSX.Element | null;
|
|
4
|
+
export declare function TemplateSelect({ onSelect, onHover, templateList, }: {
|
|
5
|
+
onSelect: (item: any) => void;
|
|
6
|
+
onHover: (item: any) => void;
|
|
7
|
+
templateList?: any[];
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|