phx-react 1.3.1569 → 1.3.1571
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/dist/cjs/components/Combobox/Combobox.js +9 -3
- package/dist/cjs/components/Combobox/Combobox.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/commenting/index.d.ts +41 -0
- package/dist/cjs/components/TextEditorV2/commenting/index.js +340 -0
- package/dist/cjs/components/TextEditorV2/commenting/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/constants.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/constants.js +5 -0
- package/dist/cjs/components/TextEditorV2/constants.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/context/SettingsContext.d.ts +12 -0
- package/dist/cjs/components/TextEditorV2/context/SettingsContext.js +59 -0
- package/dist/cjs/components/TextEditorV2/context/SettingsContext.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/context/SharedAutocompleteContext.d.ts +10 -0
- package/dist/cjs/components/TextEditorV2/context/SharedAutocompleteContext.js +50 -0
- package/dist/cjs/components/TextEditorV2/context/SharedAutocompleteContext.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/context/SharedHistoryContext.d.ts +11 -0
- package/dist/cjs/components/TextEditorV2/context/SharedHistoryContext.js +17 -0
- package/dist/cjs/components/TextEditorV2/context/SharedHistoryContext.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/editor.d.ts +10 -0
- package/dist/cjs/components/TextEditorV2/editor.js +203 -0
- package/dist/cjs/components/TextEditorV2/editor.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/hooks/useModal.d.ts +5 -0
- package/dist/cjs/components/TextEditorV2/hooks/useModal.js +32 -0
- package/dist/cjs/components/TextEditorV2/hooks/useModal.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/hooks/useReport.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/hooks/useReport.js +45 -0
- package/dist/cjs/components/TextEditorV2/hooks/useReport.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/lib/Settings.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/lib/Settings.js +52 -0
- package/dist/cjs/components/TextEditorV2/lib/Settings.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/lib/appSettings.d.ts +19 -0
- package/dist/cjs/components/TextEditorV2/lib/appSettings.js +21 -0
- package/dist/cjs/components/TextEditorV2/lib/appSettings.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/lib/collaboration.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/lib/collaboration.js +26 -0
- package/dist/cjs/components/TextEditorV2/lib/collaboration.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/lib/setupEnv.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/lib/setupEnv.js +23 -0
- package/dist/cjs/components/TextEditorV2/lib/setupEnv.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.d.ts +25 -0
- package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.js +58 -0
- package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.d.ts +18 -0
- package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.js +62 -0
- package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.d.ts +9 -0
- package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.js +72 -0
- package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/EquationNode.d.ts +26 -0
- package/dist/cjs/components/TextEditorV2/nodes/EquationNode.js +126 -0
- package/dist/cjs/components/TextEditorV2/nodes/EquationNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js +117 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +50 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js +59 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.d.ts +44 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js +143 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/index.d.ts +22 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/index.js +103 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExtendedTextNode.d.ts +12 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExtendedTextNode.js +106 -0
- package/dist/cjs/components/TextEditorV2/nodes/ExtendedTextNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/FigmaNode.d.ts +19 -0
- package/dist/cjs/components/TextEditorV2/nodes/FigmaNode.js +63 -0
- package/dist/cjs/components/TextEditorV2/nodes/FigmaNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.d.ts +14 -0
- package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js +212 -0
- package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/ImageNode.d.ts +56 -0
- package/dist/cjs/components/TextEditorV2/nodes/ImageNode.js +136 -0
- package/dist/cjs/components/TextEditorV2/nodes/ImageNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.d.ts +18 -0
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.js +194 -0
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageNode.d.ts +54 -0
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageNode.js +142 -0
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/KeywordNode.d.ts +15 -0
- package/dist/cjs/components/TextEditorV2/nodes/KeywordNode.js +54 -0
- package/dist/cjs/components/TextEditorV2/nodes/KeywordNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/LayoutContainerNode.d.ts +21 -0
- package/dist/cjs/components/TextEditorV2/nodes/LayoutContainerNode.js +63 -0
- package/dist/cjs/components/TextEditorV2/nodes/LayoutContainerNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/LayoutItemNode.d.ts +15 -0
- package/dist/cjs/components/TextEditorV2/nodes/LayoutItemNode.js +51 -0
- package/dist/cjs/components/TextEditorV2/nodes/LayoutItemNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/MentionNode.d.ts +20 -0
- package/dist/cjs/components/TextEditorV2/nodes/MentionNode.js +89 -0
- package/dist/cjs/components/TextEditorV2/nodes/MentionNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/PageBreakNode/index.d.ts +17 -0
- package/dist/cjs/components/TextEditorV2/nodes/PageBreakNode/index.js +113 -0
- package/dist/cjs/components/TextEditorV2/nodes/PageBreakNode/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.js +68 -0
- package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/PollComponent.d.ts +8 -0
- package/dist/cjs/components/TextEditorV2/nodes/PollComponent.js +113 -0
- package/dist/cjs/components/TextEditorV2/nodes/PollComponent.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/PollNode.d.ts +33 -0
- package/dist/cjs/components/TextEditorV2/nodes/PollNode.js +149 -0
- package/dist/cjs/components/TextEditorV2/nodes/PollNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.d.ts +9 -0
- package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.js +167 -0
- package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/StickyNode.d.ts +37 -0
- package/dist/cjs/components/TextEditorV2/nodes/StickyNode.js +94 -0
- package/dist/cjs/components/TextEditorV2/nodes/StickyNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/TableNode.d.ts +54 -0
- package/dist/cjs/components/TextEditorV2/nodes/TableNode.js +198 -0
- package/dist/cjs/components/TextEditorV2/nodes/TableNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/TweetNode.d.ts +28 -0
- package/dist/cjs/components/TextEditorV2/nodes/TweetNode.js +156 -0
- package/dist/cjs/components/TextEditorV2/nodes/TweetNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/nodes/YouTubeNode.d.ts +28 -0
- package/dist/cjs/components/TextEditorV2/nodes/YouTubeNode.js +103 -0
- package/dist/cjs/components/TextEditorV2/nodes/YouTubeNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.js +183 -0
- package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.d.ts +19 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js +179 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutoLinkPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutoLinkPlugin/index.js +16 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutoLinkPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.js +2465 -0
- package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +8 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +55 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +10 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +159 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.d.ts +4 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js +111 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js +21 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js +12 -0
- package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +23 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +88 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +17 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js +70 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +18 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +95 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.js +148 -0
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ComponentPickerPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js +264 -0
- package/dist/cjs/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.d.ts +11 -0
- package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.js +171 -0
- package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/DocsPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/DocsPlugin/index.js +10 -0
- package/dist/cjs/components/TextEditorV2/plugins/DocsPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/DragDropPastePlugin/index.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/DragDropPastePlugin/index.js +44 -0
- package/dist/cjs/components/TextEditorV2/plugins/DragDropPastePlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/DraggableBlockPlugin/index.d.ts +4 -0
- package/dist/cjs/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js +288 -0
- package/dist/cjs/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js +97 -0
- package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.js +64 -0
- package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.d.ts +14 -0
- package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.js +42 -0
- package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js +28 -0
- package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.js +25 -0
- package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.d.ts +7 -0
- package/dist/cjs/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js +200 -0
- package/dist/cjs/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +4 -0
- package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js +229 -0
- package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ImagesPlugin/index.d.ts +22 -0
- package/dist/cjs/components/TextEditorV2/plugins/ImagesPlugin/index.js +188 -0
- package/dist/cjs/components/TextEditorV2/plugins/ImagesPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/InlineImagePlugin/index.d.ts +17 -0
- package/dist/cjs/components/TextEditorV2/plugins/InlineImagePlugin/index.js +193 -0
- package/dist/cjs/components/TextEditorV2/plugins/InlineImagePlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.js +33 -0
- package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js +34 -0
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.d.ts +7 -0
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js +89 -0
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/LinkPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/LinkPlugin/index.js +11 -0
- package/dist/cjs/components/TextEditorV2/plugins/LinkPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.d.ts +5 -0
- package/dist/cjs/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js +44 -0
- package/dist/cjs/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js +11 -0
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.d.ts +8 -0
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.js +242 -0
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/MaxLengthPlugin/index.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/plugins/MaxLengthPlugin/index.js +41 -0
- package/dist/cjs/components/TextEditorV2/plugins/MaxLengthPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.js +560 -0
- package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.js +31 -0
- package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/PasteLogPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/PasteLogPlugin/index.js +37 -0
- package/dist/cjs/components/TextEditorV2/plugins/PasteLogPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.d.ts +8 -0
- package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.js +46 -0
- package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.js +16 -0
- package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.js +38 -0
- package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableActionMenuPlugin/index.d.ts +5 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js +487 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.js +253 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js +117 -0
- package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TablePlugin.d.ts +32 -0
- package/dist/cjs/components/TextEditorV2/plugins/TablePlugin.js +85 -0
- package/dist/cjs/components/TextEditorV2/plugins/TablePlugin.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js +18 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js +28 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js +65 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js +71 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js +18 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/link.d.ts +5 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js +46 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js +28 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js +52 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js +28 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js +19 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js +41 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.d.ts +11 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js +162 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.d.ts +4 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.js +163 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TreeViewPlugin/index.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/TreeViewPlugin/index.js +12 -0
- package/dist/cjs/components/TextEditorV2/plugins/TreeViewPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.js +25 -0
- package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.js +25 -0
- package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/shared/canUseDOM.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/shared/canUseDOM.js +7 -0
- package/dist/cjs/components/TextEditorV2/shared/canUseDOM.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/shared/caretFromPoint.d.ts +4 -0
- package/dist/cjs/components/TextEditorV2/shared/caretFromPoint.js +32 -0
- package/dist/cjs/components/TextEditorV2/shared/caretFromPoint.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/shared/environment.d.ts +16 -0
- package/dist/cjs/components/TextEditorV2/shared/environment.js +17 -0
- package/dist/cjs/components/TextEditorV2/shared/environment.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/shared/invariant.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/shared/invariant.js +15 -0
- package/dist/cjs/components/TextEditorV2/shared/invariant.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/shared/simpleDiffWithCursor.d.ts +5 -0
- package/dist/cjs/components/TextEditorV2/shared/simpleDiffWithCursor.js +28 -0
- package/dist/cjs/components/TextEditorV2/shared/simpleDiffWithCursor.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/shared/useLayoutEffect.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/shared/useLayoutEffect.js +7 -0
- package/dist/cjs/components/TextEditorV2/shared/useLayoutEffect.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/shared/warnOnlyOnce.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/shared/warnOnlyOnce.js +16 -0
- package/dist/cjs/components/TextEditorV2/shared/warnOnlyOnce.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/style.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/style.js +9 -0
- package/dist/cjs/components/TextEditorV2/style.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/themes/CommentEditorTheme.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/themes/CommentEditorTheme.js +7 -0
- package/dist/cjs/components/TextEditorV2/themes/CommentEditorTheme.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/themes/PlaygroundEditorTheme.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/themes/PlaygroundEditorTheme.js +107 -0
- package/dist/cjs/components/TextEditorV2/themes/PlaygroundEditorTheme.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/themes/StickyEditorTheme.d.ts +3 -0
- package/dist/cjs/components/TextEditorV2/themes/StickyEditorTheme.js +7 -0
- package/dist/cjs/components/TextEditorV2/themes/StickyEditorTheme.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/Button.d.ts +11 -0
- package/dist/cjs/components/TextEditorV2/ui/Button.js +11 -0
- package/dist/cjs/components/TextEditorV2/ui/Button.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/ColorPicker.d.ts +12 -0
- package/dist/cjs/components/TextEditorV2/ui/ColorPicker.js +216 -0
- package/dist/cjs/components/TextEditorV2/ui/ColorPicker.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/ContentEditable.d.ts +4 -0
- package/dist/cjs/components/TextEditorV2/ui/ContentEditable.js +11 -0
- package/dist/cjs/components/TextEditorV2/ui/ContentEditable.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/Dialog.d.ts +9 -0
- package/dist/cjs/components/TextEditorV2/ui/Dialog.js +15 -0
- package/dist/cjs/components/TextEditorV2/ui/Dialog.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/DropDown.d.ts +17 -0
- package/dist/cjs/components/TextEditorV2/ui/DropDown.js +133 -0
- package/dist/cjs/components/TextEditorV2/ui/DropDown.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/DropdownColorPicker.d.ts +21 -0
- package/dist/cjs/components/TextEditorV2/ui/DropdownColorPicker.js +20 -0
- package/dist/cjs/components/TextEditorV2/ui/DropdownColorPicker.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/EquationEditor.d.ts +8 -0
- package/dist/cjs/components/TextEditorV2/ui/EquationEditor.js +20 -0
- package/dist/cjs/components/TextEditorV2/ui/EquationEditor.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/FileInput.d.ts +9 -0
- package/dist/cjs/components/TextEditorV2/ui/FileInput.js +12 -0
- package/dist/cjs/components/TextEditorV2/ui/FileInput.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/ImageResizer.d.ts +11 -0
- package/dist/cjs/components/TextEditorV2/ui/ImageResizer.js +178 -0
- package/dist/cjs/components/TextEditorV2/ui/ImageResizer.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.d.ts +7 -0
- package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.js +39 -0
- package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/KatexRenderer.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/ui/KatexRenderer.js +33 -0
- package/dist/cjs/components/TextEditorV2/ui/KatexRenderer.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/Modal.d.ts +8 -0
- package/dist/cjs/components/TextEditorV2/ui/Modal.js +54 -0
- package/dist/cjs/components/TextEditorV2/ui/Modal.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/Placeholder.d.ts +6 -0
- package/dist/cjs/components/TextEditorV2/ui/Placeholder.js +10 -0
- package/dist/cjs/components/TextEditorV2/ui/Placeholder.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/Select.d.ts +7 -0
- package/dist/cjs/components/TextEditorV2/ui/Select.js +12 -0
- package/dist/cjs/components/TextEditorV2/ui/Select.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/Switch.d.ts +7 -0
- package/dist/cjs/components/TextEditorV2/ui/Switch.js +15 -0
- package/dist/cjs/components/TextEditorV2/ui/Switch.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/ui/TextInput.d.ts +12 -0
- package/dist/cjs/components/TextEditorV2/ui/TextInput.js +14 -0
- package/dist/cjs/components/TextEditorV2/ui/TextInput.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/emoji-list.d.ts +20 -0
- package/dist/cjs/components/TextEditorV2/utils/emoji-list.js +16607 -0
- package/dist/cjs/components/TextEditorV2/utils/emoji-list.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/getDOMRangeRect.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/utils/getDOMRangeRect.js +19 -0
- package/dist/cjs/components/TextEditorV2/utils/getDOMRangeRect.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/getPrepopulatedRichText.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/utils/getPrepopulatedRichText.js +35 -0
- package/dist/cjs/components/TextEditorV2/utils/getPrepopulatedRichText.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/getSelectedNode.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/utils/getSelectedNode.js +21 -0
- package/dist/cjs/components/TextEditorV2/utils/getSelectedNode.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/guard.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/utils/guard.js +7 -0
- package/dist/cjs/components/TextEditorV2/utils/guard.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/isMobileWidth.d.ts +0 -0
- package/dist/cjs/components/TextEditorV2/utils/isMobileWidth.js +2 -0
- package/dist/cjs/components/TextEditorV2/utils/isMobileWidth.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/joinClasses.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/utils/joinClasses.js +11 -0
- package/dist/cjs/components/TextEditorV2/utils/joinClasses.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/point.d.ts +14 -0
- package/dist/cjs/components/TextEditorV2/utils/point.js +51 -0
- package/dist/cjs/components/TextEditorV2/utils/point.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/rect.d.ts +38 -0
- package/dist/cjs/components/TextEditorV2/utils/rect.js +125 -0
- package/dist/cjs/components/TextEditorV2/utils/rect.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPosition.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPosition.js +33 -0
- package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPosition.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js +31 -0
- package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/swipe.d.ts +4 -0
- package/dist/cjs/components/TextEditorV2/utils/swipe.js +97 -0
- package/dist/cjs/components/TextEditorV2/utils/swipe.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/utils/url.d.ts +2 -0
- package/dist/cjs/components/TextEditorV2/utils/url.js +26 -0
- package/dist/cjs/components/TextEditorV2/utils/url.js.map +1 -0
- package/dist/cjs/components/Textarea/Textarea.js +28 -4
- package/dist/cjs/components/Textarea/Textarea.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js +9 -3
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/TextEditorV2/commenting/index.d.ts +41 -0
- package/dist/esm/components/TextEditorV2/commenting/index.js +334 -0
- package/dist/esm/components/TextEditorV2/commenting/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/constants.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/constants.js +2 -0
- package/dist/esm/components/TextEditorV2/constants.js.map +1 -0
- package/dist/esm/components/TextEditorV2/context/SettingsContext.d.ts +12 -0
- package/dist/esm/components/TextEditorV2/context/SettingsContext.js +54 -0
- package/dist/esm/components/TextEditorV2/context/SettingsContext.js.map +1 -0
- package/dist/esm/components/TextEditorV2/context/SharedAutocompleteContext.d.ts +10 -0
- package/dist/esm/components/TextEditorV2/context/SharedAutocompleteContext.js +44 -0
- package/dist/esm/components/TextEditorV2/context/SharedAutocompleteContext.js.map +1 -0
- package/dist/esm/components/TextEditorV2/context/SharedHistoryContext.d.ts +11 -0
- package/dist/esm/components/TextEditorV2/context/SharedHistoryContext.js +11 -0
- package/dist/esm/components/TextEditorV2/context/SharedHistoryContext.js.map +1 -0
- package/dist/esm/components/TextEditorV2/editor.d.ts +10 -0
- package/dist/esm/components/TextEditorV2/editor.js +200 -0
- package/dist/esm/components/TextEditorV2/editor.js.map +1 -0
- package/dist/esm/components/TextEditorV2/hooks/useModal.d.ts +5 -0
- package/dist/esm/components/TextEditorV2/hooks/useModal.js +28 -0
- package/dist/esm/components/TextEditorV2/hooks/useModal.js.map +1 -0
- package/dist/esm/components/TextEditorV2/hooks/useReport.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/hooks/useReport.js +42 -0
- package/dist/esm/components/TextEditorV2/hooks/useReport.js.map +1 -0
- package/dist/esm/components/TextEditorV2/lib/Settings.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/lib/Settings.js +48 -0
- package/dist/esm/components/TextEditorV2/lib/Settings.js.map +1 -0
- package/dist/esm/components/TextEditorV2/lib/appSettings.d.ts +19 -0
- package/dist/esm/components/TextEditorV2/lib/appSettings.js +18 -0
- package/dist/esm/components/TextEditorV2/lib/appSettings.js.map +1 -0
- package/dist/esm/components/TextEditorV2/lib/collaboration.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/lib/collaboration.js +23 -0
- package/dist/esm/components/TextEditorV2/lib/collaboration.js.map +1 -0
- package/dist/esm/components/TextEditorV2/lib/setupEnv.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/lib/setupEnv.js +21 -0
- package/dist/esm/components/TextEditorV2/lib/setupEnv.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.d.ts +25 -0
- package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.js +54 -0
- package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/EmojiNode.d.ts +18 -0
- package/dist/esm/components/TextEditorV2/nodes/EmojiNode.js +57 -0
- package/dist/esm/components/TextEditorV2/nodes/EmojiNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/EquationComponent.d.ts +9 -0
- package/dist/esm/components/TextEditorV2/nodes/EquationComponent.js +68 -0
- package/dist/esm/components/TextEditorV2/nodes/EquationComponent.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/EquationNode.d.ts +26 -0
- package/dist/esm/components/TextEditorV2/nodes/EquationNode.js +121 -0
- package/dist/esm/components/TextEditorV2/nodes/EquationNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js +113 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +50 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js +56 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.d.ts +44 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js +137 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/index.d.ts +22 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/index.js +98 -0
- package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/ExtendedTextNode.d.ts +12 -0
- package/dist/esm/components/TextEditorV2/nodes/ExtendedTextNode.js +101 -0
- package/dist/esm/components/TextEditorV2/nodes/ExtendedTextNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/FigmaNode.d.ts +19 -0
- package/dist/esm/components/TextEditorV2/nodes/FigmaNode.js +58 -0
- package/dist/esm/components/TextEditorV2/nodes/FigmaNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/ImageComponent.d.ts +14 -0
- package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js +207 -0
- package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/ImageNode.d.ts +56 -0
- package/dist/esm/components/TextEditorV2/nodes/ImageNode.js +131 -0
- package/dist/esm/components/TextEditorV2/nodes/ImageNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.d.ts +18 -0
- package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.js +189 -0
- package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/InlineImageNode.d.ts +54 -0
- package/dist/esm/components/TextEditorV2/nodes/InlineImageNode.js +137 -0
- package/dist/esm/components/TextEditorV2/nodes/InlineImageNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/KeywordNode.d.ts +15 -0
- package/dist/esm/components/TextEditorV2/nodes/KeywordNode.js +49 -0
- package/dist/esm/components/TextEditorV2/nodes/KeywordNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/LayoutContainerNode.d.ts +21 -0
- package/dist/esm/components/TextEditorV2/nodes/LayoutContainerNode.js +58 -0
- package/dist/esm/components/TextEditorV2/nodes/LayoutContainerNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/LayoutItemNode.d.ts +15 -0
- package/dist/esm/components/TextEditorV2/nodes/LayoutItemNode.js +46 -0
- package/dist/esm/components/TextEditorV2/nodes/LayoutItemNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/MentionNode.d.ts +20 -0
- package/dist/esm/components/TextEditorV2/nodes/MentionNode.js +84 -0
- package/dist/esm/components/TextEditorV2/nodes/MentionNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/PageBreakNode/index.d.ts +17 -0
- package/dist/esm/components/TextEditorV2/nodes/PageBreakNode/index.js +108 -0
- package/dist/esm/components/TextEditorV2/nodes/PageBreakNode/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.js +66 -0
- package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/PollComponent.d.ts +8 -0
- package/dist/esm/components/TextEditorV2/nodes/PollComponent.js +109 -0
- package/dist/esm/components/TextEditorV2/nodes/PollComponent.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/PollNode.d.ts +33 -0
- package/dist/esm/components/TextEditorV2/nodes/PollNode.js +143 -0
- package/dist/esm/components/TextEditorV2/nodes/PollNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/StickyComponent.d.ts +9 -0
- package/dist/esm/components/TextEditorV2/nodes/StickyComponent.js +163 -0
- package/dist/esm/components/TextEditorV2/nodes/StickyComponent.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/StickyNode.d.ts +37 -0
- package/dist/esm/components/TextEditorV2/nodes/StickyNode.js +89 -0
- package/dist/esm/components/TextEditorV2/nodes/StickyNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/TableNode.d.ts +54 -0
- package/dist/esm/components/TextEditorV2/nodes/TableNode.js +188 -0
- package/dist/esm/components/TextEditorV2/nodes/TableNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/TweetNode.d.ts +28 -0
- package/dist/esm/components/TextEditorV2/nodes/TweetNode.js +151 -0
- package/dist/esm/components/TextEditorV2/nodes/TweetNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/nodes/YouTubeNode.d.ts +28 -0
- package/dist/esm/components/TextEditorV2/nodes/YouTubeNode.js +98 -0
- package/dist/esm/components/TextEditorV2/nodes/YouTubeNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.js +180 -0
- package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.d.ts +19 -0
- package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js +174 -0
- package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/AutoLinkPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/AutoLinkPlugin/index.js +12 -0
- package/dist/esm/components/TextEditorV2/plugins/AutoLinkPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.js +2461 -0
- package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +8 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +52 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +10 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +155 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.d.ts +4 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js +108 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js +18 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js +9 -0
- package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +23 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +82 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +17 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js +64 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +18 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +89 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.js +144 -0
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ComponentPickerPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js +261 -0
- package/dist/esm/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.d.ts +11 -0
- package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.js +167 -0
- package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/DocsPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/DocsPlugin/index.js +6 -0
- package/dist/esm/components/TextEditorV2/plugins/DocsPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/DragDropPastePlugin/index.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/DragDropPastePlugin/index.js +41 -0
- package/dist/esm/components/TextEditorV2/plugins/DragDropPastePlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/DraggableBlockPlugin/index.d.ts +4 -0
- package/dist/esm/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js +284 -0
- package/dist/esm/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js +94 -0
- package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.js +61 -0
- package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.d.ts +14 -0
- package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.js +36 -0
- package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js +24 -0
- package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.js +21 -0
- package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.d.ts +7 -0
- package/dist/esm/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js +196 -0
- package/dist/esm/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +4 -0
- package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js +225 -0
- package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ImagesPlugin/index.d.ts +22 -0
- package/dist/esm/components/TextEditorV2/plugins/ImagesPlugin/index.js +181 -0
- package/dist/esm/components/TextEditorV2/plugins/ImagesPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/InlineImagePlugin/index.d.ts +17 -0
- package/dist/esm/components/TextEditorV2/plugins/InlineImagePlugin/index.js +187 -0
- package/dist/esm/components/TextEditorV2/plugins/InlineImagePlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.js +30 -0
- package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js +30 -0
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.d.ts +7 -0
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js +85 -0
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/LinkPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/LinkPlugin/index.js +7 -0
- package/dist/esm/components/TextEditorV2/plugins/LinkPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.d.ts +5 -0
- package/dist/esm/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js +41 -0
- package/dist/esm/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js +7 -0
- package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.d.ts +8 -0
- package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.js +239 -0
- package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/MaxLengthPlugin/index.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/plugins/MaxLengthPlugin/index.js +38 -0
- package/dist/esm/components/TextEditorV2/plugins/MaxLengthPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.js +557 -0
- package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.js +27 -0
- package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/PasteLogPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/PasteLogPlugin/index.js +33 -0
- package/dist/esm/components/TextEditorV2/plugins/PasteLogPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.d.ts +8 -0
- package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.js +40 -0
- package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.js +13 -0
- package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.js +35 -0
- package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TableActionMenuPlugin/index.d.ts +5 -0
- package/dist/esm/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js +483 -0
- package/dist/esm/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.js +249 -0
- package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js +113 -0
- package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TablePlugin.d.ts +32 -0
- package/dist/esm/components/TextEditorV2/plugins/TablePlugin.js +78 -0
- package/dist/esm/components/TextEditorV2/plugins/TablePlugin.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js +14 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js +24 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js +61 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js +67 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js +14 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/link.d.ts +5 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js +42 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js +24 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js +48 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js +24 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js +15 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js +37 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.d.ts +11 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js +159 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.d.ts +4 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.js +159 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TreeViewPlugin/index.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/plugins/TreeViewPlugin/index.js +8 -0
- package/dist/esm/components/TextEditorV2/plugins/TreeViewPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.js +21 -0
- package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.js +21 -0
- package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/shared/canUseDOM.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/shared/canUseDOM.js +4 -0
- package/dist/esm/components/TextEditorV2/shared/canUseDOM.js.map +1 -0
- package/dist/esm/components/TextEditorV2/shared/caretFromPoint.d.ts +4 -0
- package/dist/esm/components/TextEditorV2/shared/caretFromPoint.js +29 -0
- package/dist/esm/components/TextEditorV2/shared/caretFromPoint.js.map +1 -0
- package/dist/esm/components/TextEditorV2/shared/environment.d.ts +16 -0
- package/dist/esm/components/TextEditorV2/shared/environment.js +14 -0
- package/dist/esm/components/TextEditorV2/shared/environment.js.map +1 -0
- package/dist/esm/components/TextEditorV2/shared/invariant.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/shared/invariant.js +12 -0
- package/dist/esm/components/TextEditorV2/shared/invariant.js.map +1 -0
- package/dist/esm/components/TextEditorV2/shared/simpleDiffWithCursor.d.ts +5 -0
- package/dist/esm/components/TextEditorV2/shared/simpleDiffWithCursor.js +25 -0
- package/dist/esm/components/TextEditorV2/shared/simpleDiffWithCursor.js.map +1 -0
- package/dist/esm/components/TextEditorV2/shared/useLayoutEffect.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/shared/useLayoutEffect.js +5 -0
- package/dist/esm/components/TextEditorV2/shared/useLayoutEffect.js.map +1 -0
- package/dist/esm/components/TextEditorV2/shared/warnOnlyOnce.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/shared/warnOnlyOnce.js +13 -0
- package/dist/esm/components/TextEditorV2/shared/warnOnlyOnce.js.map +1 -0
- package/dist/esm/components/TextEditorV2/style.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/style.js +5 -0
- package/dist/esm/components/TextEditorV2/style.js.map +1 -0
- package/dist/esm/components/TextEditorV2/themes/CommentEditorTheme.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/themes/CommentEditorTheme.js +5 -0
- package/dist/esm/components/TextEditorV2/themes/CommentEditorTheme.js.map +1 -0
- package/dist/esm/components/TextEditorV2/themes/PlaygroundEditorTheme.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/themes/PlaygroundEditorTheme.js +105 -0
- package/dist/esm/components/TextEditorV2/themes/PlaygroundEditorTheme.js.map +1 -0
- package/dist/esm/components/TextEditorV2/themes/StickyEditorTheme.d.ts +3 -0
- package/dist/esm/components/TextEditorV2/themes/StickyEditorTheme.js +5 -0
- package/dist/esm/components/TextEditorV2/themes/StickyEditorTheme.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/Button.d.ts +11 -0
- package/dist/esm/components/TextEditorV2/ui/Button.js +8 -0
- package/dist/esm/components/TextEditorV2/ui/Button.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/ColorPicker.d.ts +12 -0
- package/dist/esm/components/TextEditorV2/ui/ColorPicker.js +212 -0
- package/dist/esm/components/TextEditorV2/ui/ColorPicker.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/ContentEditable.d.ts +4 -0
- package/dist/esm/components/TextEditorV2/ui/ContentEditable.js +7 -0
- package/dist/esm/components/TextEditorV2/ui/ContentEditable.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/Dialog.d.ts +9 -0
- package/dist/esm/components/TextEditorV2/ui/Dialog.js +10 -0
- package/dist/esm/components/TextEditorV2/ui/Dialog.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/DropDown.d.ts +17 -0
- package/dist/esm/components/TextEditorV2/ui/DropDown.js +129 -0
- package/dist/esm/components/TextEditorV2/ui/DropDown.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/DropdownColorPicker.d.ts +21 -0
- package/dist/esm/components/TextEditorV2/ui/DropdownColorPicker.js +17 -0
- package/dist/esm/components/TextEditorV2/ui/DropdownColorPicker.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/EquationEditor.d.ts +8 -0
- package/dist/esm/components/TextEditorV2/ui/EquationEditor.js +17 -0
- package/dist/esm/components/TextEditorV2/ui/EquationEditor.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/FileInput.d.ts +9 -0
- package/dist/esm/components/TextEditorV2/ui/FileInput.js +8 -0
- package/dist/esm/components/TextEditorV2/ui/FileInput.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/ImageResizer.d.ts +11 -0
- package/dist/esm/components/TextEditorV2/ui/ImageResizer.js +174 -0
- package/dist/esm/components/TextEditorV2/ui/ImageResizer.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.d.ts +7 -0
- package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.js +35 -0
- package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/KatexRenderer.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/ui/KatexRenderer.js +29 -0
- package/dist/esm/components/TextEditorV2/ui/KatexRenderer.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/Modal.d.ts +8 -0
- package/dist/esm/components/TextEditorV2/ui/Modal.js +50 -0
- package/dist/esm/components/TextEditorV2/ui/Modal.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/Placeholder.d.ts +6 -0
- package/dist/esm/components/TextEditorV2/ui/Placeholder.js +6 -0
- package/dist/esm/components/TextEditorV2/ui/Placeholder.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/Select.d.ts +7 -0
- package/dist/esm/components/TextEditorV2/ui/Select.js +9 -0
- package/dist/esm/components/TextEditorV2/ui/Select.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/Switch.d.ts +7 -0
- package/dist/esm/components/TextEditorV2/ui/Switch.js +11 -0
- package/dist/esm/components/TextEditorV2/ui/Switch.js.map +1 -0
- package/dist/esm/components/TextEditorV2/ui/TextInput.d.ts +12 -0
- package/dist/esm/components/TextEditorV2/ui/TextInput.js +10 -0
- package/dist/esm/components/TextEditorV2/ui/TextInput.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/emoji-list.d.ts +20 -0
- package/dist/esm/components/TextEditorV2/utils/emoji-list.js +16605 -0
- package/dist/esm/components/TextEditorV2/utils/emoji-list.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/getDOMRangeRect.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/utils/getDOMRangeRect.js +16 -0
- package/dist/esm/components/TextEditorV2/utils/getDOMRangeRect.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/getPrepopulatedRichText.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/utils/getPrepopulatedRichText.js +32 -0
- package/dist/esm/components/TextEditorV2/utils/getPrepopulatedRichText.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/getSelectedNode.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/utils/getSelectedNode.js +18 -0
- package/dist/esm/components/TextEditorV2/utils/getSelectedNode.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/guard.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/utils/guard.js +4 -0
- package/dist/esm/components/TextEditorV2/utils/guard.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/isMobileWidth.d.ts +0 -0
- package/dist/esm/components/TextEditorV2/utils/isMobileWidth.js +2 -0
- package/dist/esm/components/TextEditorV2/utils/isMobileWidth.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/joinClasses.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/utils/joinClasses.js +8 -0
- package/dist/esm/components/TextEditorV2/utils/joinClasses.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/point.d.ts +14 -0
- package/dist/esm/components/TextEditorV2/utils/point.js +47 -0
- package/dist/esm/components/TextEditorV2/utils/point.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/rect.d.ts +38 -0
- package/dist/esm/components/TextEditorV2/utils/rect.js +122 -0
- package/dist/esm/components/TextEditorV2/utils/rect.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/setFloatingElemPosition.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/utils/setFloatingElemPosition.js +30 -0
- package/dist/esm/components/TextEditorV2/utils/setFloatingElemPosition.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js +28 -0
- package/dist/esm/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/swipe.d.ts +4 -0
- package/dist/esm/components/TextEditorV2/utils/swipe.js +91 -0
- package/dist/esm/components/TextEditorV2/utils/swipe.js.map +1 -0
- package/dist/esm/components/TextEditorV2/utils/url.d.ts +2 -0
- package/dist/esm/components/TextEditorV2/utils/url.js +22 -0
- package/dist/esm/components/TextEditorV2/utils/url.js.map +1 -0
- package/dist/esm/components/Textarea/Textarea.js +28 -4
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +11 -2
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RIGHT_CLICK_IMAGE_COMMAND = void 0;
|
|
4
|
+
exports.default = ImageComponent;
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
var LexicalAutoFocusPlugin_1 = require("@lexical/react/LexicalAutoFocusPlugin");
|
|
7
|
+
var LexicalCollaborationContext_1 = require("@lexical/react/LexicalCollaborationContext");
|
|
8
|
+
var LexicalCollaborationPlugin_1 = require("@lexical/react/LexicalCollaborationPlugin");
|
|
9
|
+
var LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
10
|
+
var LexicalErrorBoundary_1 = tslib_1.__importDefault(require("@lexical/react/LexicalErrorBoundary"));
|
|
11
|
+
var LexicalHashtagPlugin_1 = require("@lexical/react/LexicalHashtagPlugin");
|
|
12
|
+
var LexicalHistoryPlugin_1 = require("@lexical/react/LexicalHistoryPlugin");
|
|
13
|
+
var LexicalNestedComposer_1 = require("@lexical/react/LexicalNestedComposer");
|
|
14
|
+
var LexicalRichTextPlugin_1 = require("@lexical/react/LexicalRichTextPlugin");
|
|
15
|
+
var useLexicalNodeSelection_1 = require("@lexical/react/useLexicalNodeSelection");
|
|
16
|
+
var utils_1 = require("@lexical/utils");
|
|
17
|
+
var lexical_1 = require("lexical");
|
|
18
|
+
var React = tslib_1.__importStar(require("react"));
|
|
19
|
+
var react_1 = require("react");
|
|
20
|
+
var SettingsContext_1 = require("../context/SettingsContext");
|
|
21
|
+
var SharedHistoryContext_1 = require("../context/SharedHistoryContext");
|
|
22
|
+
var collaboration_1 = require("../lib/collaboration");
|
|
23
|
+
var EmojisPlugin_1 = tslib_1.__importDefault(require("../plugins/EmojisPlugin"));
|
|
24
|
+
var KeywordsPlugin_1 = tslib_1.__importDefault(require("../plugins/KeywordsPlugin"));
|
|
25
|
+
var LinkPlugin_1 = tslib_1.__importDefault(require("../plugins/LinkPlugin"));
|
|
26
|
+
var MentionsPlugin_1 = tslib_1.__importDefault(require("../plugins/MentionsPlugin"));
|
|
27
|
+
var TreeViewPlugin_1 = tslib_1.__importDefault(require("../plugins/TreeViewPlugin"));
|
|
28
|
+
var ContentEditable_1 = tslib_1.__importDefault(require("../ui/ContentEditable"));
|
|
29
|
+
var ImageResizer_1 = tslib_1.__importDefault(require("../ui/ImageResizer"));
|
|
30
|
+
var Placeholder_1 = tslib_1.__importDefault(require("../ui/Placeholder"));
|
|
31
|
+
var ImageNode_1 = require("./ImageNode");
|
|
32
|
+
var imageCache = new Set();
|
|
33
|
+
exports.RIGHT_CLICK_IMAGE_COMMAND = (0, lexical_1.createCommand)('RIGHT_CLICK_IMAGE_COMMAND');
|
|
34
|
+
function useSuspenseImage(src) {
|
|
35
|
+
if (!imageCache.has(src)) {
|
|
36
|
+
throw new Promise(function (resolve) {
|
|
37
|
+
var img = new Image();
|
|
38
|
+
img.src = src;
|
|
39
|
+
img.onload = function () {
|
|
40
|
+
imageCache.add(src);
|
|
41
|
+
resolve(null);
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function LazyImage(_a) {
|
|
47
|
+
var altText = _a.altText, className = _a.className, height = _a.height, imageRef = _a.imageRef, maxWidth = _a.maxWidth, src = _a.src, width = _a.width;
|
|
48
|
+
useSuspenseImage(src);
|
|
49
|
+
return (React.createElement("img", { ref: imageRef, alt: altText, className: className || undefined, draggable: 'false', src: src, style: {
|
|
50
|
+
height: height,
|
|
51
|
+
maxWidth: maxWidth,
|
|
52
|
+
width: width,
|
|
53
|
+
} }));
|
|
54
|
+
}
|
|
55
|
+
function ImageComponent(_a) {
|
|
56
|
+
var altText = _a.altText, caption = _a.caption, height = _a.height, maxWidth = _a.maxWidth, nodeKey = _a.nodeKey, resizable = _a.resizable, showCaption = _a.showCaption, src = _a.src, width = _a.width;
|
|
57
|
+
var imageRef = (0, react_1.useRef)(null);
|
|
58
|
+
var buttonRef = (0, react_1.useRef)(null);
|
|
59
|
+
var _b = (0, useLexicalNodeSelection_1.useLexicalNodeSelection)(nodeKey), isSelected = _b[0], setSelected = _b[1], clearSelection = _b[2];
|
|
60
|
+
var _c = (0, react_1.useState)(false), isResizing = _c[0], setIsResizing = _c[1];
|
|
61
|
+
var isCollabActive = (0, LexicalCollaborationContext_1.useCollaborationContext)().isCollabActive;
|
|
62
|
+
var editor = (0, LexicalComposerContext_1.useLexicalComposerContext)()[0];
|
|
63
|
+
var _d = (0, react_1.useState)(null), selection = _d[0], setSelection = _d[1];
|
|
64
|
+
var activeEditorRef = (0, react_1.useRef)(null);
|
|
65
|
+
var onDelete = (0, react_1.useCallback)(function (payload) {
|
|
66
|
+
if (isSelected && (0, lexical_1.$isNodeSelection)((0, lexical_1.$getSelection)())) {
|
|
67
|
+
var event_1 = payload;
|
|
68
|
+
event_1.preventDefault();
|
|
69
|
+
var node = (0, lexical_1.$getNodeByKey)(nodeKey);
|
|
70
|
+
if ((0, ImageNode_1.$isImageNode)(node)) {
|
|
71
|
+
node.remove();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}, [isSelected, nodeKey]);
|
|
76
|
+
var onEnter = (0, react_1.useCallback)(function (event) {
|
|
77
|
+
var latestSelection = (0, lexical_1.$getSelection)();
|
|
78
|
+
var buttonElem = buttonRef.current;
|
|
79
|
+
if (isSelected && (0, lexical_1.$isNodeSelection)(latestSelection) && latestSelection.getNodes().length === 1) {
|
|
80
|
+
if (showCaption) {
|
|
81
|
+
// Move focus into nested editor
|
|
82
|
+
(0, lexical_1.$setSelection)(null);
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
caption.focus();
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
else if (buttonElem !== null && buttonElem !== document.activeElement) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
buttonElem.focus();
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}, [caption, isSelected, showCaption]);
|
|
95
|
+
var onEscape = (0, react_1.useCallback)(function (event) {
|
|
96
|
+
if (activeEditorRef.current === caption || buttonRef.current === event.target) {
|
|
97
|
+
(0, lexical_1.$setSelection)(null);
|
|
98
|
+
editor.update(function () {
|
|
99
|
+
setSelected(true);
|
|
100
|
+
var parentRootElement = editor.getRootElement();
|
|
101
|
+
if (parentRootElement !== null) {
|
|
102
|
+
parentRootElement.focus();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
}, [caption, editor, setSelected]);
|
|
109
|
+
var onClick = (0, react_1.useCallback)(function (payload) {
|
|
110
|
+
var event = payload;
|
|
111
|
+
if (isResizing) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
if (event.target === imageRef.current) {
|
|
115
|
+
if (event.shiftKey) {
|
|
116
|
+
setSelected(!isSelected);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
clearSelection();
|
|
120
|
+
setSelected(true);
|
|
121
|
+
}
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
}, [isResizing, isSelected, setSelected, clearSelection]);
|
|
126
|
+
var onRightClick = (0, react_1.useCallback)(function (event) {
|
|
127
|
+
editor.getEditorState().read(function () {
|
|
128
|
+
var latestSelection = (0, lexical_1.$getSelection)();
|
|
129
|
+
var domElement = event.target;
|
|
130
|
+
if (domElement.tagName === 'IMG' &&
|
|
131
|
+
(0, lexical_1.$isRangeSelection)(latestSelection) &&
|
|
132
|
+
latestSelection.getNodes().length === 1) {
|
|
133
|
+
editor.dispatchCommand(exports.RIGHT_CLICK_IMAGE_COMMAND, event);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}, [editor]);
|
|
137
|
+
(0, react_1.useEffect)(function () {
|
|
138
|
+
var isMounted = true;
|
|
139
|
+
var rootElement = editor.getRootElement();
|
|
140
|
+
var unregister = (0, utils_1.mergeRegister)(editor.registerUpdateListener(function (_a) {
|
|
141
|
+
var editorState = _a.editorState;
|
|
142
|
+
if (isMounted) {
|
|
143
|
+
setSelection(editorState.read(function () { return (0, lexical_1.$getSelection)(); }));
|
|
144
|
+
}
|
|
145
|
+
}), editor.registerCommand(lexical_1.SELECTION_CHANGE_COMMAND, function (_, activeEditor) {
|
|
146
|
+
activeEditorRef.current = activeEditor;
|
|
147
|
+
return false;
|
|
148
|
+
}, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.CLICK_COMMAND, onClick, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(exports.RIGHT_CLICK_IMAGE_COMMAND, onClick, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.DRAGSTART_COMMAND, function (event) {
|
|
149
|
+
if (event.target === imageRef.current) {
|
|
150
|
+
// TODO This is just a temporary workaround for FF to behave like other browsers.
|
|
151
|
+
// Ideally, this handles drag & drop too (and all browsers).
|
|
152
|
+
event.preventDefault();
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_DELETE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_BACKSPACE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ENTER_COMMAND, onEnter, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ESCAPE_COMMAND, onEscape, lexical_1.COMMAND_PRIORITY_LOW));
|
|
157
|
+
rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('contextmenu', onRightClick);
|
|
158
|
+
return function () {
|
|
159
|
+
isMounted = false;
|
|
160
|
+
unregister();
|
|
161
|
+
rootElement === null || rootElement === void 0 ? void 0 : rootElement.removeEventListener('contextmenu', onRightClick);
|
|
162
|
+
};
|
|
163
|
+
}, [
|
|
164
|
+
clearSelection,
|
|
165
|
+
editor,
|
|
166
|
+
isResizing,
|
|
167
|
+
isSelected,
|
|
168
|
+
nodeKey,
|
|
169
|
+
onDelete,
|
|
170
|
+
onEnter,
|
|
171
|
+
onEscape,
|
|
172
|
+
onClick,
|
|
173
|
+
onRightClick,
|
|
174
|
+
setSelected,
|
|
175
|
+
]);
|
|
176
|
+
var onResizeEnd = function (nextWidth, nextHeight) {
|
|
177
|
+
// Delay hiding the resize bars for click case
|
|
178
|
+
setTimeout(function () {
|
|
179
|
+
setIsResizing(false);
|
|
180
|
+
}, 200);
|
|
181
|
+
editor.update(function () {
|
|
182
|
+
var node = (0, lexical_1.$getNodeByKey)(nodeKey);
|
|
183
|
+
if ((0, ImageNode_1.$isImageNode)(node)) {
|
|
184
|
+
node.setWidthAndHeight(nextWidth, nextHeight);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
var onResizeStart = function () {
|
|
189
|
+
setIsResizing(true);
|
|
190
|
+
};
|
|
191
|
+
var historyState = (0, SharedHistoryContext_1.useSharedHistoryContext)().historyState;
|
|
192
|
+
var showNestedEditorTreeView = (0, SettingsContext_1.useSettings)().settings.showNestedEditorTreeView;
|
|
193
|
+
var draggable = isSelected && (0, lexical_1.$isNodeSelection)(selection) && !isResizing;
|
|
194
|
+
var isFocused = isSelected || isResizing;
|
|
195
|
+
return (React.createElement(react_1.Suspense, { fallback: null },
|
|
196
|
+
React.createElement(React.Fragment, null,
|
|
197
|
+
React.createElement("div", { draggable: draggable },
|
|
198
|
+
React.createElement(LazyImage, { altText: altText, className: isFocused ? "focused ".concat((0, lexical_1.$isNodeSelection)(selection) ? 'draggable' : '') : null, height: height, imageRef: imageRef, maxWidth: maxWidth, src: src, width: width })),
|
|
199
|
+
showCaption && (React.createElement("div", { className: 'image-caption-container' },
|
|
200
|
+
React.createElement(LexicalNestedComposer_1.LexicalNestedComposer, { initialEditor: caption },
|
|
201
|
+
React.createElement(LexicalAutoFocusPlugin_1.AutoFocusPlugin, null),
|
|
202
|
+
React.createElement(MentionsPlugin_1.default, null),
|
|
203
|
+
React.createElement(LinkPlugin_1.default, null),
|
|
204
|
+
React.createElement(EmojisPlugin_1.default, null),
|
|
205
|
+
React.createElement(LexicalHashtagPlugin_1.HashtagPlugin, null),
|
|
206
|
+
React.createElement(KeywordsPlugin_1.default, null),
|
|
207
|
+
isCollabActive ? (React.createElement(LexicalCollaborationPlugin_1.CollaborationPlugin, { id: caption.getKey(), providerFactory: collaboration_1.createWebsocketProvider, shouldBootstrap: true })) : (React.createElement(LexicalHistoryPlugin_1.HistoryPlugin, { externalHistoryState: historyState })),
|
|
208
|
+
React.createElement(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: React.createElement(ContentEditable_1.default, { className: 'ImageNode__contentEditable' }), ErrorBoundary: LexicalErrorBoundary_1.default, placeholder: React.createElement(Placeholder_1.default, { className: 'ImageNode__placeholder' }, "Enter a caption...") }),
|
|
209
|
+
showNestedEditorTreeView === true ? React.createElement(TreeViewPlugin_1.default, null) : null))),
|
|
210
|
+
resizable && (0, lexical_1.$isNodeSelection)(selection) && isFocused && (React.createElement(ImageResizer_1.default, { editor: editor, imageRef: imageRef, maxWidth: maxWidth, onResizeEnd: onResizeEnd, onResizeStart: onResizeStart })))));
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=ImageComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageComponent.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/ImageComponent.tsx"],"names":[],"mappings":";;;AA+FA,iCAiQC;;AA9VD,gFAAuE;AACvE,0FAAoF;AACpF,wFAA+E;AAC/E,gFAAiF;AACjF,qGAAsE;AACtE,4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AgB,EAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CACxD,oBAAC,sBAAY,IACX,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,GAC5B,CACH,CACA,CACM,CACZ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditor, SerializedLexicalNode, Spread } from 'lexical';
|
|
9
|
+
import { DecoratorNode } from 'lexical';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
export interface ImagePayload {
|
|
12
|
+
altText: string;
|
|
13
|
+
caption?: LexicalEditor;
|
|
14
|
+
height?: number;
|
|
15
|
+
key?: NodeKey;
|
|
16
|
+
maxWidth?: number;
|
|
17
|
+
showCaption?: boolean;
|
|
18
|
+
src: string;
|
|
19
|
+
width?: number;
|
|
20
|
+
captionsEnabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type SerializedImageNode = Spread<{
|
|
23
|
+
altText: string;
|
|
24
|
+
caption: SerializedEditor;
|
|
25
|
+
height?: number;
|
|
26
|
+
maxWidth: number;
|
|
27
|
+
showCaption: boolean;
|
|
28
|
+
src: string;
|
|
29
|
+
width?: number;
|
|
30
|
+
}, SerializedLexicalNode>;
|
|
31
|
+
export declare class ImageNode extends DecoratorNode<React.JSX.Element> {
|
|
32
|
+
__src: string;
|
|
33
|
+
__altText: string;
|
|
34
|
+
__width: 'inherit' | number;
|
|
35
|
+
__height: 'inherit' | number;
|
|
36
|
+
__maxWidth: number;
|
|
37
|
+
__showCaption: boolean;
|
|
38
|
+
__caption: LexicalEditor;
|
|
39
|
+
__captionsEnabled: boolean;
|
|
40
|
+
static getType(): string;
|
|
41
|
+
static clone(node: ImageNode): ImageNode;
|
|
42
|
+
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
43
|
+
exportDOM(): DOMExportOutput;
|
|
44
|
+
static importDOM(): DOMConversionMap | null;
|
|
45
|
+
constructor(src: string, altText: string, maxWidth: number, width?: 'inherit' | number, height?: 'inherit' | number, showCaption?: boolean, caption?: LexicalEditor, captionsEnabled?: boolean, key?: NodeKey);
|
|
46
|
+
exportJSON(): SerializedImageNode;
|
|
47
|
+
setWidthAndHeight(width: 'inherit' | number, height: 'inherit' | number): void;
|
|
48
|
+
setShowCaption(showCaption: boolean): void;
|
|
49
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
50
|
+
updateDOM(): false;
|
|
51
|
+
getSrc(): string;
|
|
52
|
+
getAltText(): string;
|
|
53
|
+
decorate(): React.JSX.Element;
|
|
54
|
+
}
|
|
55
|
+
export declare function $createImageNode({ altText, caption, captionsEnabled, height, key, maxWidth, showCaption, src, width, }: ImagePayload): ImageNode;
|
|
56
|
+
export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ImageNode = void 0;
|
|
11
|
+
exports.$createImageNode = $createImageNode;
|
|
12
|
+
exports.$isImageNode = $isImageNode;
|
|
13
|
+
var tslib_1 = require("tslib");
|
|
14
|
+
var lexical_1 = require("lexical");
|
|
15
|
+
var React = tslib_1.__importStar(require("react"));
|
|
16
|
+
var react_1 = require("react");
|
|
17
|
+
var ImageComponent = React.lazy(
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
function () { return Promise.resolve().then(function () { return tslib_1.__importStar(require('./ImageComponent')); }); });
|
|
20
|
+
function convertImageElement(domNode) {
|
|
21
|
+
if (domNode instanceof HTMLImageElement) {
|
|
22
|
+
var altText = domNode.alt, height = domNode.height, src = domNode.src, width = domNode.width;
|
|
23
|
+
var node = $createImageNode({ altText: altText, height: height, src: src, width: width });
|
|
24
|
+
return { node: node };
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
var ImageNode = /** @class */ (function (_super) {
|
|
29
|
+
tslib_1.__extends(ImageNode, _super);
|
|
30
|
+
function ImageNode(src, altText, maxWidth, width, height, showCaption, caption, captionsEnabled, key) {
|
|
31
|
+
var _this = _super.call(this, key) || this;
|
|
32
|
+
_this.__src = src;
|
|
33
|
+
_this.__altText = altText;
|
|
34
|
+
_this.__maxWidth = maxWidth;
|
|
35
|
+
_this.__width = width || 'inherit';
|
|
36
|
+
_this.__height = height || 'inherit';
|
|
37
|
+
_this.__showCaption = showCaption || false;
|
|
38
|
+
_this.__caption = caption || (0, lexical_1.createEditor)();
|
|
39
|
+
_this.__captionsEnabled = captionsEnabled || captionsEnabled === undefined;
|
|
40
|
+
return _this;
|
|
41
|
+
}
|
|
42
|
+
ImageNode.getType = function () {
|
|
43
|
+
return 'image';
|
|
44
|
+
};
|
|
45
|
+
ImageNode.clone = function (node) {
|
|
46
|
+
return new ImageNode(node.__src, node.__altText, node.__maxWidth, node.__width, node.__height, node.__showCaption, node.__caption, node.__captionsEnabled, node.__key);
|
|
47
|
+
};
|
|
48
|
+
ImageNode.importJSON = function (serializedNode) {
|
|
49
|
+
var altText = serializedNode.altText, caption = serializedNode.caption, height = serializedNode.height, maxWidth = serializedNode.maxWidth, showCaption = serializedNode.showCaption, src = serializedNode.src, width = serializedNode.width;
|
|
50
|
+
var node = $createImageNode({
|
|
51
|
+
altText: altText,
|
|
52
|
+
height: height,
|
|
53
|
+
maxWidth: maxWidth,
|
|
54
|
+
showCaption: showCaption,
|
|
55
|
+
src: src,
|
|
56
|
+
width: width,
|
|
57
|
+
});
|
|
58
|
+
var nestedEditor = node.__caption;
|
|
59
|
+
var editorState = nestedEditor.parseEditorState(caption.editorState);
|
|
60
|
+
if (!editorState.isEmpty()) {
|
|
61
|
+
nestedEditor.setEditorState(editorState);
|
|
62
|
+
}
|
|
63
|
+
return node;
|
|
64
|
+
};
|
|
65
|
+
ImageNode.prototype.exportDOM = function () {
|
|
66
|
+
var element = document.createElement('img');
|
|
67
|
+
element.setAttribute('src', this.__src);
|
|
68
|
+
element.setAttribute('alt', this.__altText);
|
|
69
|
+
element.setAttribute('width', this.__width.toString());
|
|
70
|
+
element.setAttribute('height', this.__height.toString());
|
|
71
|
+
return { element: element };
|
|
72
|
+
};
|
|
73
|
+
ImageNode.importDOM = function () {
|
|
74
|
+
return {
|
|
75
|
+
img: function () { return ({
|
|
76
|
+
conversion: convertImageElement,
|
|
77
|
+
priority: 0,
|
|
78
|
+
}); },
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
ImageNode.prototype.exportJSON = function () {
|
|
82
|
+
return {
|
|
83
|
+
altText: this.getAltText(),
|
|
84
|
+
caption: this.__caption.toJSON(),
|
|
85
|
+
height: this.__height === 'inherit' ? 0 : this.__height,
|
|
86
|
+
maxWidth: this.__maxWidth,
|
|
87
|
+
showCaption: this.__showCaption,
|
|
88
|
+
src: this.getSrc(),
|
|
89
|
+
type: 'image',
|
|
90
|
+
version: 1,
|
|
91
|
+
width: this.__width === 'inherit' ? 0 : this.__width,
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
ImageNode.prototype.setWidthAndHeight = function (width, height) {
|
|
95
|
+
var writable = this.getWritable();
|
|
96
|
+
writable.__width = width;
|
|
97
|
+
writable.__height = height;
|
|
98
|
+
};
|
|
99
|
+
ImageNode.prototype.setShowCaption = function (showCaption) {
|
|
100
|
+
var writable = this.getWritable();
|
|
101
|
+
writable.__showCaption = showCaption;
|
|
102
|
+
};
|
|
103
|
+
// View
|
|
104
|
+
ImageNode.prototype.createDOM = function (config) {
|
|
105
|
+
var span = document.createElement('span');
|
|
106
|
+
var theme = config.theme;
|
|
107
|
+
var className = theme.image;
|
|
108
|
+
if (className !== undefined) {
|
|
109
|
+
span.className = className;
|
|
110
|
+
}
|
|
111
|
+
return span;
|
|
112
|
+
};
|
|
113
|
+
ImageNode.prototype.updateDOM = function () {
|
|
114
|
+
return false;
|
|
115
|
+
};
|
|
116
|
+
ImageNode.prototype.getSrc = function () {
|
|
117
|
+
return this.__src;
|
|
118
|
+
};
|
|
119
|
+
ImageNode.prototype.getAltText = function () {
|
|
120
|
+
return this.__altText;
|
|
121
|
+
};
|
|
122
|
+
ImageNode.prototype.decorate = function () {
|
|
123
|
+
return (React.createElement(react_1.Suspense, { fallback: null },
|
|
124
|
+
React.createElement(ImageComponent, { altText: this.__altText, caption: this.__caption, height: this.__height, maxWidth: this.__maxWidth, nodeKey: this.getKey(), resizable: true, showCaption: this.__showCaption, src: this.__src, width: this.__width })));
|
|
125
|
+
};
|
|
126
|
+
return ImageNode;
|
|
127
|
+
}(lexical_1.DecoratorNode));
|
|
128
|
+
exports.ImageNode = ImageNode;
|
|
129
|
+
function $createImageNode(_a) {
|
|
130
|
+
var altText = _a.altText, caption = _a.caption, captionsEnabled = _a.captionsEnabled, height = _a.height, key = _a.key, _b = _a.maxWidth, maxWidth = _b === void 0 ? 500 : _b, showCaption = _a.showCaption, src = _a.src, width = _a.width;
|
|
131
|
+
return (0, lexical_1.$applyNodeReplacement)(new ImageNode(src, altText, maxWidth, width, height, showCaption, caption, captionsEnabled, key));
|
|
132
|
+
}
|
|
133
|
+
function $isImageNode(node) {
|
|
134
|
+
return node instanceof ImageNode;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=ImageNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AD,CAAC,AAzJD,CAA+B,uBAAa,GAyJ3C;AAzJY,8BAAS;AA2JtB,SAAgB,gBAAgB,CAAC,EAUlB;QATb,OAAO,aAAA,EACP,OAAO,aAAA,EACP,eAAe,qBAAA,EACf,MAAM,YAAA,EACN,GAAG,SAAA,EACH,gBAAc,EAAd,QAAQ,mBAAG,GAAG,KAAA,EACd,WAAW,iBAAA,EACX,GAAG,SAAA,EACH,KAAK,WAAA;IAEL,OAAO,IAAA,+BAAqB,EAC1B,IAAI,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,CAAC,CACjG,CAAA;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,IAAoC;IAC/D,OAAO,IAAI,YAAY,SAAS,CAAA;AAClC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Position } from './InlineImageNode';
|
|
2
|
+
import type { LexicalEditor, NodeKey } from 'lexical';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export declare function UpdateInlineImageDialog({ activeEditor, nodeKey, onClose, }: {
|
|
5
|
+
activeEditor: LexicalEditor;
|
|
6
|
+
nodeKey: NodeKey;
|
|
7
|
+
onClose(): void;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export default function InlineImageComponent({ altText, caption, height, nodeKey, position, showCaption, src, width, }: {
|
|
10
|
+
altText: string;
|
|
11
|
+
caption: LexicalEditor;
|
|
12
|
+
height: 'inherit' | number;
|
|
13
|
+
nodeKey: NodeKey;
|
|
14
|
+
showCaption: boolean;
|
|
15
|
+
src: string;
|
|
16
|
+
width: 'inherit' | number;
|
|
17
|
+
position: Position;
|
|
18
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateInlineImageDialog = UpdateInlineImageDialog;
|
|
4
|
+
exports.default = InlineImageComponent;
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
var LexicalAutoFocusPlugin_1 = require("@lexical/react/LexicalAutoFocusPlugin");
|
|
7
|
+
var LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
8
|
+
var LexicalErrorBoundary_1 = tslib_1.__importDefault(require("@lexical/react/LexicalErrorBoundary"));
|
|
9
|
+
var LexicalNestedComposer_1 = require("@lexical/react/LexicalNestedComposer");
|
|
10
|
+
var LexicalRichTextPlugin_1 = require("@lexical/react/LexicalRichTextPlugin");
|
|
11
|
+
var useLexicalNodeSelection_1 = require("@lexical/react/useLexicalNodeSelection");
|
|
12
|
+
var utils_1 = require("@lexical/utils");
|
|
13
|
+
var lexical_1 = require("lexical");
|
|
14
|
+
var React = tslib_1.__importStar(require("react"));
|
|
15
|
+
var react_1 = require("react");
|
|
16
|
+
var useModal_1 = tslib_1.__importDefault(require("../hooks/useModal"));
|
|
17
|
+
var FloatingLinkEditorPlugin_1 = tslib_1.__importDefault(require("../plugins/FloatingLinkEditorPlugin"));
|
|
18
|
+
var FloatingTextFormatToolbarPlugin_1 = tslib_1.__importDefault(require("../plugins/FloatingTextFormatToolbarPlugin"));
|
|
19
|
+
var LinkPlugin_1 = tslib_1.__importDefault(require("../plugins/LinkPlugin"));
|
|
20
|
+
var Button_1 = tslib_1.__importDefault(require("../ui/Button"));
|
|
21
|
+
var ContentEditable_1 = tslib_1.__importDefault(require("../ui/ContentEditable"));
|
|
22
|
+
var Dialog_1 = require("../ui/Dialog");
|
|
23
|
+
var Placeholder_1 = tslib_1.__importDefault(require("../ui/Placeholder"));
|
|
24
|
+
var Select_1 = tslib_1.__importDefault(require("../ui/Select"));
|
|
25
|
+
var TextInput_1 = tslib_1.__importDefault(require("../ui/TextInput"));
|
|
26
|
+
var InlineImageNode_1 = require("./InlineImageNode");
|
|
27
|
+
var imageCache = new Set();
|
|
28
|
+
function useSuspenseImage(src) {
|
|
29
|
+
if (!imageCache.has(src)) {
|
|
30
|
+
throw new Promise(function (resolve) {
|
|
31
|
+
var img = new Image();
|
|
32
|
+
img.src = src;
|
|
33
|
+
img.onload = function () {
|
|
34
|
+
imageCache.add(src);
|
|
35
|
+
resolve(null);
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function LazyImage(_a) {
|
|
41
|
+
var altText = _a.altText, className = _a.className, height = _a.height, imageRef = _a.imageRef, position = _a.position, src = _a.src, width = _a.width;
|
|
42
|
+
useSuspenseImage(src);
|
|
43
|
+
return (React.createElement("img", { ref: imageRef, alt: altText, className: className || undefined, "data-position": position, draggable: 'false', src: src, style: {
|
|
44
|
+
display: 'block',
|
|
45
|
+
height: height,
|
|
46
|
+
width: width,
|
|
47
|
+
} }));
|
|
48
|
+
}
|
|
49
|
+
function UpdateInlineImageDialog(_a) {
|
|
50
|
+
var activeEditor = _a.activeEditor, nodeKey = _a.nodeKey, onClose = _a.onClose;
|
|
51
|
+
var editorState = activeEditor.getEditorState();
|
|
52
|
+
var node = editorState.read(function () { return (0, lexical_1.$getNodeByKey)(nodeKey); });
|
|
53
|
+
var _b = (0, react_1.useState)(node.getAltText()), altText = _b[0], setAltText = _b[1];
|
|
54
|
+
var _c = (0, react_1.useState)(node.getShowCaption()), showCaption = _c[0], setShowCaption = _c[1];
|
|
55
|
+
var _d = (0, react_1.useState)(node.getPosition()), position = _d[0], setPosition = _d[1];
|
|
56
|
+
var handleShowCaptionChange = function (e) {
|
|
57
|
+
setShowCaption(e.target.checked);
|
|
58
|
+
};
|
|
59
|
+
var handlePositionChange = function (e) {
|
|
60
|
+
setPosition(e.target.value);
|
|
61
|
+
};
|
|
62
|
+
var handleOnConfirm = function () {
|
|
63
|
+
var payload = { altText: altText, position: position, showCaption: showCaption };
|
|
64
|
+
if (node) {
|
|
65
|
+
activeEditor.update(function () {
|
|
66
|
+
node.update(payload);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
onClose();
|
|
70
|
+
};
|
|
71
|
+
return (React.createElement(React.Fragment, null,
|
|
72
|
+
React.createElement("div", { style: { marginBottom: '1em' } },
|
|
73
|
+
React.createElement(TextInput_1.default, { "data-test-id": 'image-modal-alt-text-input', label: 'Alt Text', onChange: setAltText, placeholder: 'Descriptive alternative text', value: altText })),
|
|
74
|
+
React.createElement(Select_1.default, { id: 'position-select', label: 'Position', name: 'position', onChange: handlePositionChange, style: { marginBottom: '1em', width: '208px' }, value: position },
|
|
75
|
+
React.createElement("option", { value: 'left' }, "Left"),
|
|
76
|
+
React.createElement("option", { value: 'right' }, "Right"),
|
|
77
|
+
React.createElement("option", { value: 'full' }, "Full Width")),
|
|
78
|
+
React.createElement("div", { className: 'Input__wrapper' },
|
|
79
|
+
React.createElement("input", { checked: showCaption, id: 'caption', onChange: handleShowCaptionChange, type: 'checkbox' }),
|
|
80
|
+
React.createElement("label", { htmlFor: 'caption' }, "Show Caption")),
|
|
81
|
+
React.createElement(Dialog_1.DialogActions, null,
|
|
82
|
+
React.createElement(Button_1.default, { "data-test-id": 'image-modal-file-upload-btn', onClick: function () { return handleOnConfirm(); } }, "Confirm"))));
|
|
83
|
+
}
|
|
84
|
+
function InlineImageComponent(_a) {
|
|
85
|
+
var altText = _a.altText, caption = _a.caption, height = _a.height, nodeKey = _a.nodeKey, position = _a.position, showCaption = _a.showCaption, src = _a.src, width = _a.width;
|
|
86
|
+
var _b = (0, useModal_1.default)(), modal = _b[0], showModal = _b[1];
|
|
87
|
+
var imageRef = (0, react_1.useRef)(null);
|
|
88
|
+
var buttonRef = (0, react_1.useRef)(null);
|
|
89
|
+
var _c = (0, useLexicalNodeSelection_1.useLexicalNodeSelection)(nodeKey), isSelected = _c[0], setSelected = _c[1], clearSelection = _c[2];
|
|
90
|
+
var editor = (0, LexicalComposerContext_1.useLexicalComposerContext)()[0];
|
|
91
|
+
var _d = (0, react_1.useState)(null), selection = _d[0], setSelection = _d[1];
|
|
92
|
+
var activeEditorRef = (0, react_1.useRef)(null);
|
|
93
|
+
var onDelete = (0, react_1.useCallback)(function (payload) {
|
|
94
|
+
if (isSelected && (0, lexical_1.$isNodeSelection)((0, lexical_1.$getSelection)())) {
|
|
95
|
+
var event_1 = payload;
|
|
96
|
+
event_1.preventDefault();
|
|
97
|
+
var node = (0, lexical_1.$getNodeByKey)(nodeKey);
|
|
98
|
+
if ((0, InlineImageNode_1.$isInlineImageNode)(node)) {
|
|
99
|
+
node.remove();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}, [isSelected, nodeKey]);
|
|
104
|
+
var onEnter = (0, react_1.useCallback)(function (event) {
|
|
105
|
+
var latestSelection = (0, lexical_1.$getSelection)();
|
|
106
|
+
var buttonElem = buttonRef.current;
|
|
107
|
+
if (isSelected && (0, lexical_1.$isNodeSelection)(latestSelection) && latestSelection.getNodes().length === 1) {
|
|
108
|
+
if (showCaption) {
|
|
109
|
+
// Move focus into nested editor
|
|
110
|
+
(0, lexical_1.$setSelection)(null);
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
caption.focus();
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
else if (buttonElem !== null && buttonElem !== document.activeElement) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
buttonElem.focus();
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}, [caption, isSelected, showCaption]);
|
|
123
|
+
var onEscape = (0, react_1.useCallback)(function (event) {
|
|
124
|
+
if (activeEditorRef.current === caption || buttonRef.current === event.target) {
|
|
125
|
+
(0, lexical_1.$setSelection)(null);
|
|
126
|
+
editor.update(function () {
|
|
127
|
+
setSelected(true);
|
|
128
|
+
var parentRootElement = editor.getRootElement();
|
|
129
|
+
if (parentRootElement !== null) {
|
|
130
|
+
parentRootElement.focus();
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}, [caption, editor, setSelected]);
|
|
137
|
+
(0, react_1.useEffect)(function () {
|
|
138
|
+
var isMounted = true;
|
|
139
|
+
var unregister = (0, utils_1.mergeRegister)(editor.registerUpdateListener(function (_a) {
|
|
140
|
+
var editorState = _a.editorState;
|
|
141
|
+
if (isMounted) {
|
|
142
|
+
setSelection(editorState.read(function () { return (0, lexical_1.$getSelection)(); }));
|
|
143
|
+
}
|
|
144
|
+
}), editor.registerCommand(lexical_1.SELECTION_CHANGE_COMMAND, function (_, activeEditor) {
|
|
145
|
+
activeEditorRef.current = activeEditor;
|
|
146
|
+
return false;
|
|
147
|
+
}, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.CLICK_COMMAND, function (payload) {
|
|
148
|
+
var event = payload;
|
|
149
|
+
if (event.target === imageRef.current) {
|
|
150
|
+
if (event.shiftKey) {
|
|
151
|
+
setSelected(!isSelected);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
clearSelection();
|
|
155
|
+
setSelected(true);
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.DRAGSTART_COMMAND, function (event) {
|
|
161
|
+
if (event.target === imageRef.current) {
|
|
162
|
+
// TODO This is just a temporary workaround for FF to behave like other browsers.
|
|
163
|
+
// Ideally, this handles drag & drop too (and all browsers).
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
return false;
|
|
168
|
+
}, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_DELETE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_BACKSPACE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ENTER_COMMAND, onEnter, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ESCAPE_COMMAND, onEscape, lexical_1.COMMAND_PRIORITY_LOW));
|
|
169
|
+
return function () {
|
|
170
|
+
isMounted = false;
|
|
171
|
+
unregister();
|
|
172
|
+
};
|
|
173
|
+
}, [clearSelection, editor, isSelected, nodeKey, onDelete, onEnter, onEscape, setSelected]);
|
|
174
|
+
var draggable = isSelected && (0, lexical_1.$isNodeSelection)(selection);
|
|
175
|
+
var isFocused = isSelected;
|
|
176
|
+
return (React.createElement(react_1.Suspense, { fallback: null },
|
|
177
|
+
React.createElement(React.Fragment, null,
|
|
178
|
+
React.createElement("div", { draggable: draggable },
|
|
179
|
+
React.createElement("button", { ref: buttonRef, className: 'image-edit-button', onClick: function () {
|
|
180
|
+
showModal('Update Inline Image', function (onClose) { return (React.createElement(UpdateInlineImageDialog, { activeEditor: editor, nodeKey: nodeKey, onClose: onClose })); });
|
|
181
|
+
}, type: 'button' }, "Edit"),
|
|
182
|
+
React.createElement(LazyImage, { altText: altText, className: isFocused ? "focused ".concat((0, lexical_1.$isNodeSelection)(selection) ? 'draggable' : '') : null, height: height, imageRef: imageRef, position: position, src: src, width: width })),
|
|
183
|
+
showCaption && (React.createElement("div", { className: 'image-caption-container' },
|
|
184
|
+
React.createElement(LexicalNestedComposer_1.LexicalNestedComposer, { initialEditor: caption },
|
|
185
|
+
React.createElement(LexicalAutoFocusPlugin_1.AutoFocusPlugin, null),
|
|
186
|
+
React.createElement(LinkPlugin_1.default, null),
|
|
187
|
+
React.createElement(FloatingLinkEditorPlugin_1.default, { isLinkEditMode: false, setIsLinkEditMode: function () {
|
|
188
|
+
console.log('FloatingLinkEditorPlugin');
|
|
189
|
+
} }),
|
|
190
|
+
React.createElement(FloatingTextFormatToolbarPlugin_1.default, null),
|
|
191
|
+
React.createElement(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: React.createElement(ContentEditable_1.default, { className: 'InlineImageNode__contentEditable' }), ErrorBoundary: LexicalErrorBoundary_1.default, placeholder: React.createElement(Placeholder_1.default, { className: 'InlineImageNode__placeholder' }, "Enter a caption...") }))))),
|
|
192
|
+
modal));
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=InlineImageComponent.js.map
|