phx-react 1.3.1718 → 1.3.1719
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/TextEditorV2/constants.d.ts +1 -1
- package/dist/cjs/components/TextEditorV2/constants.js +15 -0
- package/dist/cjs/components/TextEditorV2/constants.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/editor.js +10 -58
- package/dist/cjs/components/TextEditorV2/editor.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js +2 -8
- package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.js +2 -2
- package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.js +0 -19
- package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js +1 -2
- package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/SanitizePastePlugin/index.d.ts +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/SanitizePastePlugin/index.js +58 -0
- package/dist/cjs/components/TextEditorV2/plugins/SanitizePastePlugin/index.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js +4 -6
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.d.ts +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js +22 -10
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js +2 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/list-marker-format.d.ts +5 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/list-marker-format.js +27 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/list-marker-format.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js +1 -3
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.js +0 -4
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/shared/LexicalErrorBoundary.d.ts +13 -0
- package/dist/cjs/components/TextEditorV2/shared/LexicalErrorBoundary.js +25 -0
- package/dist/cjs/components/TextEditorV2/shared/LexicalErrorBoundary.js.map +1 -0
- package/dist/cjs/components/TextEditorV2/style.js +21 -0
- package/dist/cjs/components/TextEditorV2/style.js.map +1 -1
- package/dist/esm/components/TextEditorV2/constants.d.ts +1 -1
- package/dist/esm/components/TextEditorV2/constants.js +15 -0
- package/dist/esm/components/TextEditorV2/constants.js.map +1 -1
- package/dist/esm/components/TextEditorV2/editor.js +9 -57
- package/dist/esm/components/TextEditorV2/editor.js.map +1 -1
- package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js +1 -7
- package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js.map +1 -1
- package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.js +1 -1
- package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.js.map +1 -1
- package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.js +0 -19
- package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js +1 -2
- package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/SanitizePastePlugin/index.d.ts +1 -0
- package/dist/esm/components/TextEditorV2/plugins/SanitizePastePlugin/index.js +55 -0
- package/dist/esm/components/TextEditorV2/plugins/SanitizePastePlugin/index.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js +2 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js +5 -7
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.d.ts +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js +23 -11
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js +2 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/list-marker-format.d.ts +5 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/list-marker-format.js +24 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/list-marker-format.js.map +1 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js +2 -4
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.js +0 -4
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.js.map +1 -1
- package/dist/esm/components/TextEditorV2/shared/LexicalErrorBoundary.d.ts +13 -0
- package/dist/esm/components/TextEditorV2/shared/LexicalErrorBoundary.js +21 -0
- package/dist/esm/components/TextEditorV2/shared/LexicalErrorBoundary.js.map +1 -0
- package/dist/esm/components/TextEditorV2/style.js +21 -0
- package/dist/esm/components/TextEditorV2/style.js.map +1 -1
- package/package.json +9 -7
- package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.d.ts +0 -25
- package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.js +0 -60
- package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.d.ts +0 -18
- package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.js +0 -62
- package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.d.ts +0 -9
- package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.js +0 -70
- package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/nodes/EquationNode.d.ts +0 -26
- package/dist/cjs/components/TextEditorV2/nodes/EquationNode.js +0 -121
- package/dist/cjs/components/TextEditorV2/nodes/EquationNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/nodes/PollComponent.d.ts +0 -8
- package/dist/cjs/components/TextEditorV2/nodes/PollComponent.js +0 -108
- package/dist/cjs/components/TextEditorV2/nodes/PollComponent.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/nodes/PollNode.d.ts +0 -33
- package/dist/cjs/components/TextEditorV2/nodes/PollNode.js +0 -145
- package/dist/cjs/components/TextEditorV2/nodes/PollNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.d.ts +0 -9
- package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.js +0 -166
- package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/nodes/StickyNode.d.ts +0 -37
- package/dist/cjs/components/TextEditorV2/nodes/StickyNode.js +0 -91
- package/dist/cjs/components/TextEditorV2/nodes/StickyNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.d.ts +0 -2
- package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.js +0 -148
- package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.d.ts +0 -19
- package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js +0 -168
- package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.d.ts +0 -2
- package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.js +0 -2459
- package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.d.ts +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js +0 -12
- package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +0 -23
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +0 -88
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +0 -17
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js +0 -68
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +0 -18
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +0 -92
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.d.ts +0 -3
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.js +0 -145
- package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.d.ts +0 -11
- package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.js +0 -129
- package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.d.ts +0 -2
- package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js +0 -83
- package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.d.ts +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.js +0 -63
- package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.d.ts +0 -14
- package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.js +0 -41
- package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.d.ts +0 -3
- package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js +0 -28
- package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.d.ts +0 -3
- package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.js +0 -25
- package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.d.ts +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.js +0 -33
- package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +0 -6
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js +0 -30
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.d.ts +0 -7
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js +0 -85
- package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.d.ts +0 -2
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js +0 -11
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.d.ts +0 -8
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.js +0 -241
- package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.d.ts +0 -2
- package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.js +0 -551
- package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.d.ts +0 -3
- package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.js +0 -31
- package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.d.ts +0 -8
- package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.js +0 -45
- package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.d.ts +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.js +0 -16
- package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.d.ts +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.js +0 -38
- package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.d.ts +0 -2
- package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.js +0 -248
- package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.d.ts +0 -2
- package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js +0 -116
- package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.d.ts +0 -3
- package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.js +0 -25
- package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.d.ts +0 -3
- package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.js +0 -25
- package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.js.map +0 -1
- package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.d.ts +0 -7
- package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.js +0 -38
- package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.d.ts +0 -25
- package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.js +0 -54
- package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/EmojiNode.d.ts +0 -18
- package/dist/esm/components/TextEditorV2/nodes/EmojiNode.js +0 -56
- package/dist/esm/components/TextEditorV2/nodes/EmojiNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/EquationComponent.d.ts +0 -9
- package/dist/esm/components/TextEditorV2/nodes/EquationComponent.js +0 -66
- package/dist/esm/components/TextEditorV2/nodes/EquationComponent.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/EquationNode.d.ts +0 -26
- package/dist/esm/components/TextEditorV2/nodes/EquationNode.js +0 -114
- package/dist/esm/components/TextEditorV2/nodes/EquationNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/PollComponent.d.ts +0 -8
- package/dist/esm/components/TextEditorV2/nodes/PollComponent.js +0 -104
- package/dist/esm/components/TextEditorV2/nodes/PollComponent.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/PollNode.d.ts +0 -33
- package/dist/esm/components/TextEditorV2/nodes/PollNode.js +0 -137
- package/dist/esm/components/TextEditorV2/nodes/PollNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/StickyComponent.d.ts +0 -9
- package/dist/esm/components/TextEditorV2/nodes/StickyComponent.js +0 -162
- package/dist/esm/components/TextEditorV2/nodes/StickyComponent.js.map +0 -1
- package/dist/esm/components/TextEditorV2/nodes/StickyNode.d.ts +0 -37
- package/dist/esm/components/TextEditorV2/nodes/StickyNode.js +0 -84
- package/dist/esm/components/TextEditorV2/nodes/StickyNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.d.ts +0 -2
- package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.js +0 -144
- package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.d.ts +0 -19
- package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js +0 -162
- package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.d.ts +0 -2
- package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.js +0 -2455
- package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.d.ts +0 -1
- package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js +0 -9
- package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +0 -23
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +0 -81
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +0 -17
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js +0 -61
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +0 -18
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +0 -85
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.d.ts +0 -3
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.js +0 -141
- package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.d.ts +0 -11
- package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.js +0 -123
- package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.d.ts +0 -2
- package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js +0 -79
- package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.d.ts +0 -1
- package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.js +0 -60
- package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.d.ts +0 -14
- package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.js +0 -35
- package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.d.ts +0 -3
- package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js +0 -24
- package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.d.ts +0 -3
- package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.js +0 -21
- package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.d.ts +0 -1
- package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.js +0 -30
- package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +0 -6
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js +0 -26
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.d.ts +0 -7
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js +0 -81
- package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.d.ts +0 -2
- package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js +0 -7
- package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.d.ts +0 -8
- package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.js +0 -237
- package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.d.ts +0 -2
- package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.js +0 -547
- package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.d.ts +0 -3
- package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.js +0 -27
- package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.d.ts +0 -8
- package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.js +0 -39
- package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.d.ts +0 -1
- package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.js +0 -13
- package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.d.ts +0 -1
- package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.js +0 -35
- package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.d.ts +0 -2
- package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.js +0 -244
- package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.d.ts +0 -2
- package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js +0 -112
- package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.d.ts +0 -3
- package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.js +0 -21
- package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.d.ts +0 -3
- package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.js +0 -21
- package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.js.map +0 -1
- package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.d.ts +0 -7
- package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.js +0 -34
- package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.js.map +0 -1
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContextMenuOption = void 0;
|
|
4
|
-
exports.default = ContextMenuPlugin;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
7
|
-
const LexicalContextMenuPlugin_1 = require("@lexical/react/LexicalContextMenuPlugin");
|
|
8
|
-
const lexical_1 = require("lexical");
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const React = tslib_1.__importStar(require("react"));
|
|
11
|
-
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
12
|
-
function ContextMenuItem({ index, isSelected, onClick, onMouseEnter, option, }) {
|
|
13
|
-
let className = 'item';
|
|
14
|
-
if (isSelected) {
|
|
15
|
-
className += ' selected';
|
|
16
|
-
}
|
|
17
|
-
return (React.createElement("li", { key: option.key, ref: option.setRefElement, "aria-selected": isSelected, className: className, id: 'typeahead-item-' + index, onClick: onClick, onMouseEnter: onMouseEnter, role: 'option', tabIndex: -1 },
|
|
18
|
-
React.createElement("span", { className: 'text' }, option.title)));
|
|
19
|
-
}
|
|
20
|
-
function ContextMenu({ onOptionClick, onOptionMouseEnter, options, selectedItemIndex, }) {
|
|
21
|
-
return (React.createElement("div", { className: 'typeahead-popover' },
|
|
22
|
-
React.createElement("ul", null, options.map((option, i) => (React.createElement(ContextMenuItem, { key: option.key, index: i, isSelected: selectedItemIndex === i, onClick: () => onOptionClick(option, i), onMouseEnter: () => onOptionMouseEnter(i), option: option }))))));
|
|
23
|
-
}
|
|
24
|
-
class ContextMenuOption extends LexicalContextMenuPlugin_1.MenuOption {
|
|
25
|
-
constructor(title, options) {
|
|
26
|
-
super(title);
|
|
27
|
-
this.title = title;
|
|
28
|
-
this.onSelect = options.onSelect.bind(this);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.ContextMenuOption = ContextMenuOption;
|
|
32
|
-
function ContextMenuPlugin() {
|
|
33
|
-
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
34
|
-
const options = (0, react_1.useMemo)(() => [
|
|
35
|
-
new ContextMenuOption(`Copy`, {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
|
-
onSelect: (_node) => {
|
|
38
|
-
editor.dispatchCommand(lexical_1.COPY_COMMAND, null);
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
new ContextMenuOption(`Cut`, {
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43
|
-
onSelect: (_node) => {
|
|
44
|
-
editor.dispatchCommand(lexical_1.CUT_COMMAND, null);
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
47
|
-
new ContextMenuOption(`Paste`, {
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
|
-
onSelect: (_node) => {
|
|
50
|
-
navigator.clipboard.read().then(async () => {
|
|
51
|
-
const data = new DataTransfer();
|
|
52
|
-
const items = await navigator.clipboard.read();
|
|
53
|
-
const item = items[0];
|
|
54
|
-
const permission = await navigator.permissions.query({
|
|
55
|
-
// @ts-ignore These types are incorrect.
|
|
56
|
-
name: 'clipboard-read',
|
|
57
|
-
});
|
|
58
|
-
if (permission.state === 'denied') {
|
|
59
|
-
alert('Not allowed to paste from clipboard.');
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
for (const type of item.types) {
|
|
63
|
-
const dataString = await (await item.getType(type)).text();
|
|
64
|
-
data.setData(type, dataString);
|
|
65
|
-
}
|
|
66
|
-
const event = new ClipboardEvent('paste', {
|
|
67
|
-
clipboardData: data,
|
|
68
|
-
});
|
|
69
|
-
editor.dispatchCommand(lexical_1.PASTE_COMMAND, event);
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
}),
|
|
73
|
-
new ContextMenuOption(`Paste as Plain Text`, {
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
75
|
-
onSelect: (_node) => {
|
|
76
|
-
navigator.clipboard.read().then(async () => {
|
|
77
|
-
const permission = await navigator.permissions.query({
|
|
78
|
-
// @ts-ignore These types are incorrect.
|
|
79
|
-
name: 'clipboard-read',
|
|
80
|
-
});
|
|
81
|
-
if (permission.state === 'denied') {
|
|
82
|
-
alert('Not allowed to paste from clipboard.');
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const data = new DataTransfer();
|
|
86
|
-
const items = await navigator.clipboard.readText();
|
|
87
|
-
data.setData('text/plain', items);
|
|
88
|
-
const event = new ClipboardEvent('paste', {
|
|
89
|
-
clipboardData: data,
|
|
90
|
-
});
|
|
91
|
-
editor.dispatchCommand(lexical_1.PASTE_COMMAND, event);
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
}),
|
|
95
|
-
new ContextMenuOption(`Delete Node`, {
|
|
96
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
97
|
-
onSelect: (_node) => {
|
|
98
|
-
const selection = (0, lexical_1.$getSelection)();
|
|
99
|
-
if ((0, lexical_1.$isRangeSelection)(selection)) {
|
|
100
|
-
const currentNode = selection.anchor.getNode();
|
|
101
|
-
const ancestorNodeWithRootAsParent = currentNode.getParents().at(-2);
|
|
102
|
-
ancestorNodeWithRootAsParent === null || ancestorNodeWithRootAsParent === void 0 ? void 0 : ancestorNodeWithRootAsParent.remove();
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
}),
|
|
106
|
-
], [editor]);
|
|
107
|
-
const onSelectOption = (0, react_1.useCallback)((selectedOption, targetNode, closeMenu) => {
|
|
108
|
-
editor.update(() => {
|
|
109
|
-
selectedOption.onSelect(targetNode);
|
|
110
|
-
closeMenu();
|
|
111
|
-
});
|
|
112
|
-
}, [editor]);
|
|
113
|
-
return (React.createElement(LexicalContextMenuPlugin_1.LexicalContextMenuPlugin, { menuRenderFn: (anchorElementRef, {
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
115
|
-
options: _options, selectOptionAndCleanUp, selectedIndex, setHighlightedIndex, }, { setMenuRef }) => anchorElementRef.current
|
|
116
|
-
? ReactDOM.createPortal(React.createElement("div", { ref: setMenuRef, className: 'typeahead-popover auto-embed-menu', style: {
|
|
117
|
-
marginLeft: anchorElementRef.current.style.width,
|
|
118
|
-
userSelect: 'none',
|
|
119
|
-
width: 200,
|
|
120
|
-
} },
|
|
121
|
-
React.createElement(ContextMenu, { onOptionClick: (option, index) => {
|
|
122
|
-
setHighlightedIndex(index);
|
|
123
|
-
selectOptionAndCleanUp(option);
|
|
124
|
-
}, onOptionMouseEnter: (index) => {
|
|
125
|
-
setHighlightedIndex(index);
|
|
126
|
-
}, options: options, selectedItemIndex: selectedIndex })), anchorElementRef.current)
|
|
127
|
-
: null, onSelectOption: onSelectOption, options: options }));
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/ContextMenuPlugin/index.tsx"],"names":[],"mappings":";;;AAyFA,oCA+IC;;AAxOD,kFAAiF;AACjF,sFAA8F;AAC9F,qCAAsH;AACtH,iCAA4C;AAC5C,qDAA8B;AAC9B,4DAAqC;AAErC,SAAS,eAAe,CAAC,EACvB,KAAK,EACL,UAAU,EACV,OAAO,EACP,YAAY,EACZ,MAAM,GAQP;IACC,IAAI,SAAS,GAAG,MAAM,CAAA;IACtB,IAAI,UAAU,EAAE,CAAC;QACf,SAAS,IAAI,WAAW,CAAA;IAC1B,CAAC;IACD,OAAO,CACL,4BACE,GAAG,EAAE,MAAM,CAAC,GAAG,EACf,GAAG,EAAE,MAAM,CAAC,aAAa,mBACV,UAAU,EACzB,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,iBAAiB,GAAG,KAAK,EAC7B,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,CAAC;QAEZ,8BAAM,SAAS,EAAC,MAAM,IAAE,MAAM,CAAC,KAAK,CAAQ,CACzC,CACN,CAAA;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,aAAa,EACb,kBAAkB,EAClB,OAAO,EACP,iBAAiB,GAQlB;IACC,O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qB,EAAE,EAAE;QAC3F,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;YACjB,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;YACnC,SAAS,EAAE,CAAA;QACb,CAAC,CAAC,CAAA;IACJ,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAA;IAED,OAAO,CACL,oBAAC,mDAAwB,IACvB,YAAY,EAAE,CACZ,gBAAgB,EAChB;QACE,6DAA6D;QAC7D,OAAO,EAAE,QAAQ,EACjB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,GACpB,EACD,EAAE,UAAU,EAAE,EACd,EAAE,CACF,gBAAgB,CAAC,OAAO;YACtB,CAAC,CAAC,QAAQ,CAAC,YAAY,CACnB,6BACE,GAAG,EAAE,UAAU,EACf,SAAS,EAAC,mCAAmC,EAC7C,KAAK,EAAE;oBACL,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;oBAChD,UAAU,EAAE,MAAM;oBAClB,KAAK,EAAE,GAAG;iBACX;gBAED,oBAAC,WAAW,IACV,aAAa,EAAE,CAAC,MAAyB,EAAE,KAAa,EAAE,EAAE;wBAC1D,mBAAmB,CAAC,KAAK,CAAC,CAAA;wBAC1B,sBAAsB,CAAC,MAAM,CAAC,CAAA;oBAChC,CAAC,EACD,kBAAkB,EAAE,CAAC,KAAa,EAAE,EAAE;wBACpC,mBAAmB,CAAC,KAAK,CAAC,CAAA;oBAC5B,CAAC,EACD,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,aAAa,GAChC,CACE,EACN,gBAAgB,CAAC,OAAO,CACzB;YACH,CAAC,CAAC,IAAI,EAEV,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,OAAO,GAChB,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = EmojiPickerPlugin;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
6
|
-
const LexicalTypeaheadMenuPlugin_1 = require("@lexical/react/LexicalTypeaheadMenuPlugin");
|
|
7
|
-
const lexical_1 = require("lexical");
|
|
8
|
-
const React = tslib_1.__importStar(require("react"));
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
11
|
-
class EmojiOption extends LexicalTypeaheadMenuPlugin_1.MenuOption {
|
|
12
|
-
constructor(title, emoji, options) {
|
|
13
|
-
super(title);
|
|
14
|
-
this.title = title;
|
|
15
|
-
this.emoji = emoji;
|
|
16
|
-
this.keywords = options.keywords || [];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function EmojiMenuItem({ index, isSelected, onClick, onMouseEnter, option, }) {
|
|
20
|
-
let className = 'item';
|
|
21
|
-
if (isSelected) {
|
|
22
|
-
className += ' selected';
|
|
23
|
-
}
|
|
24
|
-
return (React.createElement("li", { key: option.key, ref: option.setRefElement, "aria-selected": isSelected, className: className, id: 'typeahead-item-' + index, onClick: onClick, onMouseEnter: onMouseEnter, role: 'option', tabIndex: -1 },
|
|
25
|
-
React.createElement("span", { className: 'text' },
|
|
26
|
-
option.emoji,
|
|
27
|
-
" ",
|
|
28
|
-
option.title)));
|
|
29
|
-
}
|
|
30
|
-
const MAX_EMOJI_SUGGESTION_COUNT = 10;
|
|
31
|
-
function EmojiPickerPlugin() {
|
|
32
|
-
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
33
|
-
const [queryString, setQueryString] = (0, react_1.useState)(null);
|
|
34
|
-
const [emojis, setEmojis] = (0, react_1.useState)([]);
|
|
35
|
-
(0, react_1.useEffect)(() => {
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
Promise.resolve().then(() => tslib_1.__importStar(require('../../utils/emoji-list.js'))).then((file) => setEmojis(file.default));
|
|
38
|
-
}, []);
|
|
39
|
-
const emojiOptions = (0, react_1.useMemo)(() => emojis != null
|
|
40
|
-
? emojis.map(({ aliases, emoji, tags }) => new EmojiOption(aliases[0], emoji, {
|
|
41
|
-
keywords: [...aliases, ...tags],
|
|
42
|
-
}))
|
|
43
|
-
: [], [emojis]);
|
|
44
|
-
const checkForTriggerMatch = (0, LexicalTypeaheadMenuPlugin_1.useBasicTypeaheadTriggerMatch)(':', {
|
|
45
|
-
minLength: 0,
|
|
46
|
-
});
|
|
47
|
-
const options = (0, react_1.useMemo)(() => emojiOptions
|
|
48
|
-
.filter((option) => queryString != null
|
|
49
|
-
? new RegExp(queryString, 'gi').exec(option.title) || option.keywords != null
|
|
50
|
-
? option.keywords.some((keyword) => new RegExp(queryString, 'gi').exec(keyword))
|
|
51
|
-
: false
|
|
52
|
-
: emojiOptions)
|
|
53
|
-
.slice(0, MAX_EMOJI_SUGGESTION_COUNT), [emojiOptions, queryString]);
|
|
54
|
-
const onSelectOption = (0, react_1.useCallback)((selectedOption, nodeToRemove, closeMenu) => {
|
|
55
|
-
editor.update(() => {
|
|
56
|
-
const selection = (0, lexical_1.$getSelection)();
|
|
57
|
-
if (!(0, lexical_1.$isRangeSelection)(selection) || selectedOption == null) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (nodeToRemove) {
|
|
61
|
-
nodeToRemove.remove();
|
|
62
|
-
}
|
|
63
|
-
selection.insertNodes([(0, lexical_1.$createTextNode)(selectedOption.emoji)]);
|
|
64
|
-
closeMenu();
|
|
65
|
-
});
|
|
66
|
-
}, [editor]);
|
|
67
|
-
return (React.createElement(LexicalTypeaheadMenuPlugin_1.LexicalTypeaheadMenuPlugin, { menuRenderFn: (anchorElementRef, { selectOptionAndCleanUp, selectedIndex, setHighlightedIndex }) => {
|
|
68
|
-
if (anchorElementRef.current == null || options.length === 0) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
return anchorElementRef.current && options.length > 0
|
|
72
|
-
? ReactDOM.createPortal(React.createElement("div", { className: 'typeahead-popover emoji-menu' },
|
|
73
|
-
React.createElement("ul", null, options.map((option, index) => (React.createElement("div", { key: option.key },
|
|
74
|
-
React.createElement(EmojiMenuItem, { index: index, isSelected: selectedIndex === index, onClick: () => {
|
|
75
|
-
setHighlightedIndex(index);
|
|
76
|
-
selectOptionAndCleanUp(option);
|
|
77
|
-
}, onMouseEnter: () => {
|
|
78
|
-
setHighlightedIndex(index);
|
|
79
|
-
}, option: option })))))), anchorElementRef.current)
|
|
80
|
-
: null;
|
|
81
|
-
}, onQueryChange: setQueryString, onSelectOption: onSelectOption, options: options, triggerFn: checkForTriggerMatch }));
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/EmojiPickerPlugin/index.tsx"],"names":[],"mappings":";;AA8EA,oCAqGC;;AAnLD,kFAAiF;AACjF,0FAIkD;AAClD,qCAAqF;AACrF,qDAA8B;AAC9B,iCAAiE;AACjE,4DAAqC;AAErC,MAAM,WAAY,SAAQ,uCAAU;IAKlC,YACE,KAAa,EACb,KAAa,EACb,OAEC;QAED,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAA;IACxC,CAAC;CACF;AACD,SAAS,aAAa,CAAC,EACrB,KAAK,EACL,UAAU,EACV,OAAO,EACP,YAAY,EACZ,MAAM,GAOP;IACC,IAAI,SAAS,GAAG,MAAM,CAAA;IACtB,IAAI,UAAU,EAAE,CAAC;QACf,SAAS,IAAI,WAAW,CAAA;IAC1B,CAAC;IACD,OAAO,CACL,4BACE,GAAG,EAAE,MAAM,CAAC,GAAG,EACf,GAAG,EAAE,MAA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C,uDAA0B,IACzB,YAAY,EAAE,CAAC,gBAAgB,EAAE,EAAE,sBAAsB,EAAE,aAAa,EAAE,mBAAmB,EAAE,EAAE,EAAE;YACjG,IAAI,gBAAgB,CAAC,OAAO,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7D,OAAO,IAAI,CAAA;YACb,CAAC;YAED,OAAO,gBAAgB,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;gBACnD,CAAC,CAAC,QAAQ,CAAC,YAAY,CACnB,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,gCACG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAmB,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3C,6BAAK,GAAG,EAAE,MAAM,CAAC,GAAG;wBAClB,oBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,aAAa,KAAK,KAAK,EACnC,OAAO,EAAE,GAAG,EAAE;gCACZ,mBAAmB,CAAC,KAAK,CAAC,CAAA;gCAC1B,sBAAsB,CAAC,MAAM,CAAC,CAAA;4BAChC,CAAC,EACD,YAAY,EAAE,GAAG,EAAE;gCACjB,mBAAmB,CAAC,KAAK,CAAC,CAAA;4BAC5B,CAAC,EACD,MAAM,EAAE,MAAM,GACd,CACE,CACP,CAAC,CACC,CACD,EACN,gBAAgB,CAAC,OAAO,CACzB;gBACH,CAAC,CAAC,IAAI,CAAA;QACV,CAAC,EACD,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,oBAAoB,GAC/B,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function EmojisPlugin(): React.JSX.Element | null;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = EmojisPlugin;
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-extra-semi */
|
|
5
|
-
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
6
|
-
const lexical_1 = require("lexical");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const EmojiNode_1 = require("../../nodes/EmojiNode");
|
|
9
|
-
const emojis = new Map([
|
|
10
|
-
[':)', ['emoji happysmile', '🙂']],
|
|
11
|
-
[':D', ['emoji veryhappysmile', '😀']],
|
|
12
|
-
[':(', ['emoji unhappysmile', '🙁']],
|
|
13
|
-
['<3', ['emoji heart', '❤']],
|
|
14
|
-
['🙂', ['emoji happysmile', '🙂']],
|
|
15
|
-
['😀', ['emoji veryhappysmile', '😀']],
|
|
16
|
-
['🙁', ['emoji unhappysmile', '🙁']],
|
|
17
|
-
['❤', ['emoji heart', '❤']],
|
|
18
|
-
]);
|
|
19
|
-
function findAndTransformEmoji(node) {
|
|
20
|
-
const text = node.getTextContent();
|
|
21
|
-
for (let i = 0; i < text.length; i++) {
|
|
22
|
-
const emojiData = emojis.get(text[i]) || emojis.get(text.slice(i, i + 2));
|
|
23
|
-
if (emojiData !== undefined) {
|
|
24
|
-
const [emojiStyle, emojiText] = emojiData;
|
|
25
|
-
let targetNode;
|
|
26
|
-
if (i === 0) {
|
|
27
|
-
;
|
|
28
|
-
[targetNode] = node.splitText(i + 2);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
;
|
|
32
|
-
[, targetNode] = node.splitText(i, i + 2);
|
|
33
|
-
}
|
|
34
|
-
const emojiNode = (0, EmojiNode_1.$createEmojiNode)(emojiStyle, emojiText);
|
|
35
|
-
targetNode.replace(emojiNode);
|
|
36
|
-
return emojiNode;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
function textNodeTransform(node) {
|
|
42
|
-
let targetNode = node;
|
|
43
|
-
while (targetNode !== null) {
|
|
44
|
-
if (!targetNode.isSimpleText()) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
targetNode = findAndTransformEmoji(targetNode);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function useEmojis(editor) {
|
|
51
|
-
(0, react_1.useEffect)(() => {
|
|
52
|
-
if (!editor.hasNodes([EmojiNode_1.EmojiNode])) {
|
|
53
|
-
throw new Error('EmojisPlugin: EmojiNode not registered on editor');
|
|
54
|
-
}
|
|
55
|
-
return editor.registerNodeTransform(lexical_1.TextNode, textNodeTransform);
|
|
56
|
-
}, [editor]);
|
|
57
|
-
}
|
|
58
|
-
function EmojisPlugin() {
|
|
59
|
-
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
60
|
-
useEmojis(editor);
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/EmojisPlugin/index.ts"],"names":[],"mappings":";;AAiEA,+BAIC;AArED,qDAAqD;AACrD,kFAAiF;AAEjF,qCAAkC;AAClC,iCAAiC;AACjC,qDAAmE;AAEnE,MAAM,MAAM,GAAkC,IAAI,GAAG,CAAC;IACpD,CAAC,IAAI,EAAE,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC,IAAI,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC,IAAI,EAAE,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,IAAI,EAAE,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC,IAAI,EAAE,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC,IAAI,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC,IAAI,EAAE,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,GAAG,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,OAAM;QACR,CAAC;QAED,UAAU,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAA;IAChD,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,MAAqB;IACtC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAS,CAAC,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;QACrE,CAAC;QAED,OAAO,MAAM,CAAC,qBAAqB,CAAC,kBAAQ,EAAE,iBAAiB,CAAC,CAAA;IAClE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AACd,CAAC;AAED,SAAwB,YAAY;IAClC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAA;IAC5C,SAAS,CAAC,MAAM,CAAC,CAAA;IACjB,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import 'katex/dist/katex.css';
|
|
2
|
-
import { LexicalCommand, LexicalEditor } from 'lexical';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
type CommandPayload = {
|
|
5
|
-
equation: string;
|
|
6
|
-
inline: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare const INSERT_EQUATION_COMMAND: LexicalCommand<CommandPayload>;
|
|
9
|
-
export declare function InsertEquationDialog({ activeEditor, onClose, }: {
|
|
10
|
-
activeEditor: LexicalEditor;
|
|
11
|
-
onClose(): void;
|
|
12
|
-
}): React.JSX.Element;
|
|
13
|
-
export default function EquationsPlugin(): React.JSX.Element | null;
|
|
14
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INSERT_EQUATION_COMMAND = void 0;
|
|
4
|
-
exports.InsertEquationDialog = InsertEquationDialog;
|
|
5
|
-
exports.default = EquationsPlugin;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
require("katex/dist/katex.css");
|
|
8
|
-
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
9
|
-
const utils_1 = require("@lexical/utils");
|
|
10
|
-
const lexical_1 = require("lexical");
|
|
11
|
-
const react_1 = require("react");
|
|
12
|
-
const React = tslib_1.__importStar(require("react"));
|
|
13
|
-
const EquationNode_1 = require("../../nodes/EquationNode");
|
|
14
|
-
const KatexEquationAlterer_1 = tslib_1.__importDefault(require("../../ui/KatexEquationAlterer"));
|
|
15
|
-
exports.INSERT_EQUATION_COMMAND = (0, lexical_1.createCommand)('INSERT_EQUATION_COMMAND');
|
|
16
|
-
function InsertEquationDialog({ activeEditor, onClose, }) {
|
|
17
|
-
const onEquationConfirm = (0, react_1.useCallback)((equation, inline) => {
|
|
18
|
-
activeEditor.dispatchCommand(exports.INSERT_EQUATION_COMMAND, { equation, inline });
|
|
19
|
-
onClose();
|
|
20
|
-
}, [activeEditor, onClose]);
|
|
21
|
-
return React.createElement(KatexEquationAlterer_1.default, { onConfirm: onEquationConfirm });
|
|
22
|
-
}
|
|
23
|
-
function EquationsPlugin() {
|
|
24
|
-
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
25
|
-
(0, react_1.useEffect)(() => {
|
|
26
|
-
if (!editor.hasNodes([EquationNode_1.EquationNode])) {
|
|
27
|
-
throw new Error('EquationsPlugins: EquationsNode not registered on editor');
|
|
28
|
-
}
|
|
29
|
-
return editor.registerCommand(exports.INSERT_EQUATION_COMMAND, (payload) => {
|
|
30
|
-
const { equation, inline } = payload;
|
|
31
|
-
const equationNode = (0, EquationNode_1.$createEquationNode)(equation, inline);
|
|
32
|
-
(0, lexical_1.$insertNodes)([equationNode]);
|
|
33
|
-
if ((0, lexical_1.$isRootOrShadowRoot)(equationNode.getParentOrThrow())) {
|
|
34
|
-
(0, utils_1.$wrapNodeInElement)(equationNode, lexical_1.$createParagraphNode).selectEnd();
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
}, lexical_1.COMMAND_PRIORITY_EDITOR);
|
|
38
|
-
}, [editor]);
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/EquationsPlugin/index.tsx"],"names":[],"mappings":";;;AAyBA,oDAgBC;AAED,kCA0BC;;AArED,gCAA6B;AAE7B,kFAAiF;AACjF,0CAAmD;AACnD,qCAQgB;AAChB,iCAA8C;AAC9C,qDAA8B;AAC9B,2DAA4E;AAC5E,iGAAgE;AAOnD,QAAA,uBAAuB,GAAmC,IAAA,uBAAa,EAAC,yBAAyB,CAAC,CAAA;AAE/G,SAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,OAAO,GAIR;IACC,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,CAAC,QAAgB,EAAE,MAAe,EAAE,EAAE;QACpC,YAAY,CAAC,eAAe,CAAC,+BAAuB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;QAC3E,OAAO,EAAE,CAAA;IACX,CAAC,EACD,CAAC,YAAY,EAAE,OAAO,CAAC,CACxB,CAAA;IAED,OAAO,oBAAC,8BAAoB,IAAC,SAAS,EAAE,iBAAiB,GAAI,CAAA;AAC/D,CAAC;AAED,SAAwB,eAAe;IACrC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAA;IAE5C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,2BAAY,CAAC,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;QAC7E,CAAC;QAED,OAAO,MAAM,CAAC,eAAe,CAC3B,+BAAuB,EACvB,CAAC,OAAO,EAAE,EAAE;YACV,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;YACpC,MAAM,YAAY,GAAG,IAAA,kCAAmB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAE1D,IAAA,sBAAY,EAAC,CAAC,YAAY,CAAC,CAAC,CAAA;YAC5B,IAAI,IAAA,6BAAmB,EAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC,EAAE,CAAC;gBACzD,IAAA,0BAAkB,EAAC,YAAY,EAAE,8BAAoB,CAAC,CAAC,SAAS,EAAE,CAAA;YACpE,CAAC;YAED,OAAO,IAAI,CAAA;QACb,CAAC,EACD,iCAAuB,CACxB,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INSERT_EXCALIDRAW_COMMAND = void 0;
|
|
4
|
-
exports.default = ExcalidrawPlugin;
|
|
5
|
-
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
6
|
-
const utils_1 = require("@lexical/utils");
|
|
7
|
-
const lexical_1 = require("lexical");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ExcalidrawNode_1 = require("../../nodes/ExcalidrawNode");
|
|
10
|
-
exports.INSERT_EXCALIDRAW_COMMAND = (0, lexical_1.createCommand)('INSERT_EXCALIDRAW_COMMAND');
|
|
11
|
-
function ExcalidrawPlugin() {
|
|
12
|
-
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
13
|
-
(0, react_1.useEffect)(() => {
|
|
14
|
-
if (!editor.hasNodes([ExcalidrawNode_1.ExcalidrawNode])) {
|
|
15
|
-
throw new Error('ExcalidrawPlugin: ExcalidrawNode not registered on editor');
|
|
16
|
-
}
|
|
17
|
-
return editor.registerCommand(exports.INSERT_EXCALIDRAW_COMMAND, () => {
|
|
18
|
-
const excalidrawNode = (0, ExcalidrawNode_1.$createExcalidrawNode)();
|
|
19
|
-
(0, lexical_1.$insertNodes)([excalidrawNode]);
|
|
20
|
-
if ((0, lexical_1.$isRootOrShadowRoot)(excalidrawNode.getParentOrThrow())) {
|
|
21
|
-
(0, utils_1.$wrapNodeInElement)(excalidrawNode, lexical_1.$createParagraphNode).selectEnd();
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
}, lexical_1.COMMAND_PRIORITY_EDITOR);
|
|
25
|
-
}, [editor]);
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/ExcalidrawPlugin/index.ts"],"names":[],"mappings":";;;AAeA,mCAwBC;AAvCD,kFAAiF;AACjF,0CAAmD;AACnD,qCAOgB;AAChB,iCAAiC;AACjC,+DAAkF;AAErE,QAAA,yBAAyB,GAAyB,IAAA,uBAAa,EAAC,2BAA2B,CAAC,CAAA;AAEzG,SAAwB,gBAAgB;IACtC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAA;IAC5C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,+BAAc,CAAC,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;QAC9E,CAAC;QAED,OAAO,MAAM,CAAC,eAAe,CAC3B,iCAAyB,EACzB,GAAG,EAAE;YACH,MAAM,cAAc,GAAG,IAAA,sCAAqB,GAAE,CAAA;YAE9C,IAAA,sBAAY,EAAC,CAAC,cAAc,CAAC,CAAC,CAAA;YAC9B,IAAI,IAAA,6BAAmB,EAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,EAAE,CAAC;gBAC3D,IAAA,0BAAkB,EAAC,cAAc,EAAE,8BAAoB,CAAC,CAAC,SAAS,EAAE,CAAA;YACtE,CAAC;YAED,OAAO,IAAI,CAAA;QACb,CAAC,EACD,iCAAuB,CACxB,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INSERT_FIGMA_COMMAND = void 0;
|
|
4
|
-
exports.default = FigmaPlugin;
|
|
5
|
-
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
6
|
-
const utils_1 = require("@lexical/utils");
|
|
7
|
-
const lexical_1 = require("lexical");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const FigmaNode_1 = require("../../nodes/FigmaNode");
|
|
10
|
-
exports.INSERT_FIGMA_COMMAND = (0, lexical_1.createCommand)('INSERT_FIGMA_COMMAND');
|
|
11
|
-
function FigmaPlugin() {
|
|
12
|
-
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
13
|
-
(0, react_1.useEffect)(() => {
|
|
14
|
-
if (!editor.hasNodes([FigmaNode_1.FigmaNode])) {
|
|
15
|
-
throw new Error('FigmaPlugin: FigmaNode not registered on editor');
|
|
16
|
-
}
|
|
17
|
-
return editor.registerCommand(exports.INSERT_FIGMA_COMMAND, (payload) => {
|
|
18
|
-
const figmaNode = (0, FigmaNode_1.$createFigmaNode)(payload);
|
|
19
|
-
(0, utils_1.$insertNodeToNearestRoot)(figmaNode);
|
|
20
|
-
return true;
|
|
21
|
-
}, lexical_1.COMMAND_PRIORITY_EDITOR);
|
|
22
|
-
}, [editor]);
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/FigmaPlugin/index.tsx"],"names":[],"mappings":";;;AAQA,8BAoBC;AA5BD,kFAAiF;AACjF,0CAAyD;AACzD,qCAAgF;AAChF,iCAAiC;AACjC,qDAAmE;AAEtD,QAAA,oBAAoB,GAA2B,IAAA,uBAAa,EAAC,sBAAsB,CAAC,CAAA;AAEjG,SAAwB,WAAW;IACjC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAA;IAE5C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAS,CAAC,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAA;QACpE,CAAC;QAED,OAAO,MAAM,CAAC,eAAe,CAC3B,4BAAoB,EACpB,CAAC,OAAO,EAAE,EAAE;YACV,MAAM,SAAS,GAAG,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAA;YAC3C,IAAA,gCAAwB,EAAC,SAAS,CAAC,CAAA;YACnC,OAAO,IAAI,CAAA;QACb,CAAC,EACD,iCAAuB,CACxB,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function KeywordsPlugin(): React.JSX.Element | null;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = KeywordsPlugin;
|
|
4
|
-
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
5
|
-
const useLexicalTextEntity_1 = require("@lexical/react/useLexicalTextEntity");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const KeywordNode_1 = require("../../nodes/KeywordNode");
|
|
8
|
-
const KEYWORDS_REGEX = /(^|$|[^A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ])(congrats|congratulations|gratuluju|gratuluji|gratulujeme|blahopřeju|blahopřeji|blahopřejeme|Til lykke|Tillykke|Glückwunsch|Gratuliere|felicitaciones|enhorabuena|paljon onnea|onnittelut|Félicitations|gratula|gratulálok|gratulálunk|congratulazioni|complimenti|おめでとう|おめでとうございます|축하해|축하해요|gratulerer|Gefeliciteerd|gratulacje|Parabéns|parabéns|felicitações|felicitări|мои поздравления|поздравляем|поздравляю|gratulujem|blahoželám|ยินดีด้วย|ขอแสดงความยินดี|tebrikler|tebrik ederim|恭喜|祝贺你|恭喜你|恭喜|恭喜|baie geluk|veels geluk|অভিনন্দন|Čestitam|Čestitke|Čestitamo|Συγχαρητήρια|Μπράβο|અભિનંદન|badhai|बधाई|अभिनंदन|Честитам|Свака част|hongera|வாழ்த்துகள்|வாழ்த்துக்கள்|అభినందనలు|അഭിനന്ദനങ്ങൾ|Chúc mừng|מזל טוב|mazel tov|mazal tov)(^|$|[^A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ])/i;
|
|
9
|
-
function KeywordsPlugin() {
|
|
10
|
-
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
11
|
-
(0, react_1.useEffect)(() => {
|
|
12
|
-
if (!editor.hasNodes([KeywordNode_1.KeywordNode])) {
|
|
13
|
-
throw new Error('KeywordsPlugin: KeywordNode not registered on editor');
|
|
14
|
-
}
|
|
15
|
-
}, [editor]);
|
|
16
|
-
const createKeywordNode = (0, react_1.useCallback)((textNode) => (0, KeywordNode_1.$createKeywordNode)(textNode.getTextContent()), []);
|
|
17
|
-
const getKeywordMatch = (0, react_1.useCallback)((text) => {
|
|
18
|
-
const matchArr = KEYWORDS_REGEX.exec(text);
|
|
19
|
-
if (matchArr === null) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
const hashtagLength = matchArr[2].length;
|
|
23
|
-
const startOffset = matchArr.index + matchArr[1].length;
|
|
24
|
-
const endOffset = startOffset + hashtagLength;
|
|
25
|
-
return {
|
|
26
|
-
end: endOffset,
|
|
27
|
-
start: startOffset,
|
|
28
|
-
};
|
|
29
|
-
}, []);
|
|
30
|
-
(0, useLexicalTextEntity_1.useLexicalTextEntity)(getKeywordMatch, KeywordNode_1.KeywordNode, createKeywordNode);
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/KeywordsPlugin/index.ts"],"names":[],"mappings":";;AASA,iCAiCC;AA1CD,kFAAiF;AACjF,8EAA0E;AAE1E,iCAA8C;AAC9C,yDAAyE;AAEzE,MAAM,cAAc,GAClB,0/EAA0/E,CAAA;AAE5/E,SAAwB,cAAc;IACpC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,kDAAyB,GAAE,CAAA;IAE5C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,yBAAW,CAAC,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;QACzE,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAEZ,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EACnC,CAAC,QAAkB,EAAe,EAAE,CAAC,IAAA,gCAAkB,EAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,EAClF,EAAE,CACH,CAAA;IAED,MAAM,eAAe,GAAG,IAAA,mBAAW,EAAC,CAAC,IAAY,EAAE,EAAE;QACnD,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAE1C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;QACxC,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;QACvD,MAAM,SAAS,GAAG,WAAW,GAAG,aAAa,CAAA;QAC7C,OAAO;YACL,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,WAAW;SACnB,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,IAAA,2CAAoB,EAAc,eAAe,EAAE,yBAAW,EAAE,iBAAiB,CAAC,CAAA;IAElF,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = InsertLayoutDialog;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const Button_1 = tslib_1.__importDefault(require("../../ui/Button"));
|
|
8
|
-
const DropDown_1 = tslib_1.__importStar(require("../../ui/DropDown"));
|
|
9
|
-
const LayoutPlugin_1 = require("./LayoutPlugin");
|
|
10
|
-
const LAYOUTS = [
|
|
11
|
-
{ label: '2 columns (equal width)', value: '1fr 1fr' },
|
|
12
|
-
{ label: '2 columns (25% - 75%)', value: '1fr 3fr' },
|
|
13
|
-
{ label: '3 columns (equal width)', value: '1fr 1fr 1fr' },
|
|
14
|
-
{ label: '3 columns (25% - 50% - 25%)', value: '1fr 2fr 1fr' },
|
|
15
|
-
{ label: '4 columns (equal width)', value: '1fr 1fr 1fr 1fr' },
|
|
16
|
-
];
|
|
17
|
-
function InsertLayoutDialog({ activeEditor, onClose, }) {
|
|
18
|
-
var _a;
|
|
19
|
-
const [layout, setLayout] = (0, react_1.useState)(LAYOUTS[0].value);
|
|
20
|
-
const buttonLabel = (_a = LAYOUTS.find((item) => item.value === layout)) === null || _a === void 0 ? void 0 : _a.label;
|
|
21
|
-
const onClick = () => {
|
|
22
|
-
activeEditor.dispatchCommand(LayoutPlugin_1.INSERT_LAYOUT_COMMAND, layout);
|
|
23
|
-
onClose();
|
|
24
|
-
};
|
|
25
|
-
return (React.createElement(React.Fragment, null,
|
|
26
|
-
React.createElement(DropDown_1.default, { buttonClassName: 'toolbar-item dialog-dropdown', buttonLabel: buttonLabel }, LAYOUTS.map(({ label, value }) => (React.createElement(DropDown_1.DropDownItem, { key: value, className: 'item', onClick: () => setLayout(value) },
|
|
27
|
-
React.createElement("span", { className: 'text' }, label))))),
|
|
28
|
-
React.createElement(Button_1.default, { onClick: onClick }, "Insert")));
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=InsertLayoutDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InsertLayoutDialog.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.tsx"],"names":[],"mappings":";;AAeA,qCA2BC;;AAzCD,qDAA8B;AAC9B,iCAAgC;AAChC,qEAAoC;AACpC,sEAA0D;AAC1D,iDAAsD;AAEtD,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,SAAS,EAAE;IACtD,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,SAAS,EAAE;IACpD,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,aAAa,EAAE;IAC1D,EAAE,KAAK,EAAE,6BAA6B,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9D,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,iBAAiB,EAAE;CAC/D,CAAA;AAED,SAAwB,kBAAkB,CAAC,EACzC,YAAY,EACZ,OAAO,GAIR;;IACC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACtD,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,0CAAE,KAAK,CAAA;IAExE,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,YAAY,CAAC,eAAe,CAAC,oCAAqB,EAAE,MAAM,CAAC,CAAA;QAC3D,OAAO,EAAE,CAAA;IACX,CAAC,CAAA;IAED,OAAO,CACL;QACE,oBAAC,kBAAQ,IAAC,eAAe,EAAC,8BAA8B,EAAC,WAAW,EAAE,WAAW,IAC9E,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACjC,oBAAC,uBAAY,IAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC;YACxE,8BAAM,SAAS,EAAC,MAAM,IAAE,KAAK,CAAQ,CACxB,CAChB,CAAC,CACO;QACX,oBAAC,gBAAM,IAAC,OAAO,EAAE,OAAO,aAAiB,CACxC,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LexicalCommand, NodeKey } from 'lexical';
|
|
2
|
-
export declare const INSERT_LAYOUT_COMMAND: LexicalCommand<string>;
|
|
3
|
-
export declare const UPDATE_LAYOUT_COMMAND: LexicalCommand<{
|
|
4
|
-
template: string;
|
|
5
|
-
nodeKey: NodeKey;
|
|
6
|
-
}>;
|
|
7
|
-
export declare function LayoutPlugin(): null;
|