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,137 +0,0 @@
|
|
|
1
|
-
import { DecoratorNode, } from 'lexical';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Suspense } from 'react';
|
|
4
|
-
const PollComponent = React.lazy(
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
() => import('./PollComponent'));
|
|
7
|
-
function createUID() {
|
|
8
|
-
return Math.random()
|
|
9
|
-
.toString(36)
|
|
10
|
-
.replace(/[^a-z]+/g, '')
|
|
11
|
-
.substr(0, 5);
|
|
12
|
-
}
|
|
13
|
-
export function createPollOption(text = '') {
|
|
14
|
-
return {
|
|
15
|
-
text,
|
|
16
|
-
uid: createUID(),
|
|
17
|
-
votes: [],
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function cloneOption(option, text, votes) {
|
|
21
|
-
return {
|
|
22
|
-
text,
|
|
23
|
-
uid: option.uid,
|
|
24
|
-
votes: votes || Array.from(option.votes),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function convertPollElement(domNode) {
|
|
28
|
-
const question = domNode.getAttribute('data-lexical-poll-question');
|
|
29
|
-
const options = domNode.getAttribute('data-lexical-poll-options');
|
|
30
|
-
if (question !== null && options !== null) {
|
|
31
|
-
const node = $createPollNode(question, JSON.parse(options));
|
|
32
|
-
return { node };
|
|
33
|
-
}
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
export class PollNode extends DecoratorNode {
|
|
37
|
-
static getType() {
|
|
38
|
-
return 'poll';
|
|
39
|
-
}
|
|
40
|
-
static clone(node) {
|
|
41
|
-
return new PollNode(node.__question, node.__options, node.__key);
|
|
42
|
-
}
|
|
43
|
-
static importJSON(serializedNode) {
|
|
44
|
-
const node = $createPollNode(serializedNode.question, serializedNode.options);
|
|
45
|
-
serializedNode.options.forEach(node.addOption);
|
|
46
|
-
return node;
|
|
47
|
-
}
|
|
48
|
-
constructor(question, options, key) {
|
|
49
|
-
super(key);
|
|
50
|
-
this.__question = question;
|
|
51
|
-
this.__options = options;
|
|
52
|
-
}
|
|
53
|
-
exportJSON() {
|
|
54
|
-
return {
|
|
55
|
-
options: this.__options,
|
|
56
|
-
question: this.__question,
|
|
57
|
-
type: 'poll',
|
|
58
|
-
version: 1,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
addOption(option) {
|
|
62
|
-
const self = this.getWritable();
|
|
63
|
-
const options = Array.from(self.__options);
|
|
64
|
-
options.push(option);
|
|
65
|
-
self.__options = options;
|
|
66
|
-
}
|
|
67
|
-
deleteOption(option) {
|
|
68
|
-
const self = this.getWritable();
|
|
69
|
-
const options = Array.from(self.__options);
|
|
70
|
-
const index = options.indexOf(option);
|
|
71
|
-
options.splice(index, 1);
|
|
72
|
-
self.__options = options;
|
|
73
|
-
}
|
|
74
|
-
setOptionText(option, text) {
|
|
75
|
-
const self = this.getWritable();
|
|
76
|
-
const clonedOption = cloneOption(option, text);
|
|
77
|
-
const options = Array.from(self.__options);
|
|
78
|
-
const index = options.indexOf(option);
|
|
79
|
-
options[index] = clonedOption;
|
|
80
|
-
self.__options = options;
|
|
81
|
-
}
|
|
82
|
-
toggleVote(option, clientID) {
|
|
83
|
-
const self = this.getWritable();
|
|
84
|
-
const votes = option.votes;
|
|
85
|
-
const votesClone = Array.from(votes);
|
|
86
|
-
const voteIndex = votes.indexOf(clientID);
|
|
87
|
-
if (voteIndex === -1) {
|
|
88
|
-
votesClone.push(clientID);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
votesClone.splice(voteIndex, 1);
|
|
92
|
-
}
|
|
93
|
-
const clonedOption = cloneOption(option, option.text, votesClone);
|
|
94
|
-
const options = Array.from(self.__options);
|
|
95
|
-
const index = options.indexOf(option);
|
|
96
|
-
options[index] = clonedOption;
|
|
97
|
-
self.__options = options;
|
|
98
|
-
}
|
|
99
|
-
static importDOM() {
|
|
100
|
-
return {
|
|
101
|
-
span: (domNode) => {
|
|
102
|
-
if (!domNode.hasAttribute('data-lexical-poll-question')) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
conversion: convertPollElement,
|
|
107
|
-
priority: 2,
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
exportDOM() {
|
|
113
|
-
const element = document.createElement('span');
|
|
114
|
-
element.setAttribute('data-lexical-poll-question', this.__question);
|
|
115
|
-
element.setAttribute('data-lexical-poll-options', JSON.stringify(this.__options));
|
|
116
|
-
return { element };
|
|
117
|
-
}
|
|
118
|
-
createDOM() {
|
|
119
|
-
const elem = document.createElement('span');
|
|
120
|
-
elem.style.display = 'inline-block';
|
|
121
|
-
return elem;
|
|
122
|
-
}
|
|
123
|
-
updateDOM() {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
decorate() {
|
|
127
|
-
return (React.createElement(Suspense, { fallback: null },
|
|
128
|
-
React.createElement(PollComponent, { nodeKey: this.__key, options: this.__options, question: this.__question })));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
export function $createPollNode(question, options) {
|
|
132
|
-
return new PollNode(question, options);
|
|
133
|
-
}
|
|
134
|
-
export function $isPollNode(node) {
|
|
135
|
-
return node instanceof PollNode;
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=PollNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PollNode.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/PollNode.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,GAQd,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAWhC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI;AAC9B,aAAa;AACb,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAChC,CAAA;AAED,SAAS,SAAS;IAChB,OAAO,IAAI,CAAC,MAAM,EAAE;SACjB,QAAQ,CAAC,EAAE,CAAC;SACZ,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAI,GAAG,EAAE;IACxC,OAAO;QACL,IAAI;QACJ,GAAG,EAAE,SAAS,EAAE;QAChB,KAAK,EAAE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AAA;QAC9C,OAAO,CAAC,YAAY,CAAC,4BAA4B,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QACnE,OAAO,CAAC,YAAY,CAAC,2BAA2B,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;QACjF,OAAO,EAAE,OAAO,EAAE,CAAA;IACpB,CAAC;IAEM,SAAS;QACd,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,cAAc,CAAA;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,SAAS;QACd,OAAO,KAAK,CAAA;IACd,CAAC;IAEM,QAAQ;QACb,OAAO,CACL,oBAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI;YACtB,oBAAC,aAAa,IAAC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,GAAI,CACjF,CACZ,CAAA;IACH,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,OAAgB;IAChE,OAAO,IAAI,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;AACxC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAoC;IAC9D,OAAO,IAAI,YAAY,QAAQ,CAAA;AACjC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LexicalEditor, NodeKey } from 'lexical';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
export default function StickyComponent({ caption, color, nodeKey, x, y, }: {
|
|
4
|
-
caption: LexicalEditor;
|
|
5
|
-
color: 'pink' | 'yellow';
|
|
6
|
-
nodeKey: NodeKey;
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
}): React.JSX.Element;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { useCollaborationContext } from '@lexical/react/LexicalCollaborationContext';
|
|
2
|
-
import { CollaborationPlugin } from '@lexical/react/LexicalCollaborationPlugin';
|
|
3
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
4
|
-
import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary';
|
|
5
|
-
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
|
6
|
-
import { LexicalNestedComposer } from '@lexical/react/LexicalNestedComposer';
|
|
7
|
-
import { PlainTextPlugin } from '@lexical/react/LexicalPlainTextPlugin';
|
|
8
|
-
import { $getNodeByKey } from 'lexical';
|
|
9
|
-
import * as React from 'react';
|
|
10
|
-
import { useEffect, useRef } from 'react';
|
|
11
|
-
import { useSharedHistoryContext } from '../context/SharedHistoryContext';
|
|
12
|
-
import { createWebsocketProvider } from '../lib/collaboration';
|
|
13
|
-
import useLayoutEffect from '../shared/useLayoutEffect';
|
|
14
|
-
import StickyEditorTheme from '../themes/StickyEditorTheme';
|
|
15
|
-
import ContentEditable from '../ui/ContentEditable';
|
|
16
|
-
import Placeholder from '../ui/Placeholder';
|
|
17
|
-
import { $isStickyNode } from './StickyNode';
|
|
18
|
-
function positionSticky(stickyElem, positioning) {
|
|
19
|
-
const style = stickyElem.style;
|
|
20
|
-
const rootElementRect = positioning.rootElementRect;
|
|
21
|
-
const rectLeft = rootElementRect !== null ? rootElementRect.left : 0;
|
|
22
|
-
const rectTop = rootElementRect !== null ? rootElementRect.top : 0;
|
|
23
|
-
style.top = rectTop + positioning.y + 'px';
|
|
24
|
-
style.left = rectLeft + positioning.x + 'px';
|
|
25
|
-
}
|
|
26
|
-
export default function StickyComponent({ caption, color, nodeKey, x, y, }) {
|
|
27
|
-
const [editor] = useLexicalComposerContext();
|
|
28
|
-
const stickyContainerRef = useRef(null);
|
|
29
|
-
const positioningRef = useRef({
|
|
30
|
-
isDragging: false,
|
|
31
|
-
offsetX: 0,
|
|
32
|
-
offsetY: 0,
|
|
33
|
-
rootElementRect: null,
|
|
34
|
-
x: 0,
|
|
35
|
-
y: 0,
|
|
36
|
-
});
|
|
37
|
-
const { isCollabActive } = useCollaborationContext();
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
const position = positioningRef.current;
|
|
40
|
-
position.x = x;
|
|
41
|
-
position.y = y;
|
|
42
|
-
const stickyContainer = stickyContainerRef.current;
|
|
43
|
-
if (stickyContainer !== null) {
|
|
44
|
-
positionSticky(stickyContainer, position);
|
|
45
|
-
}
|
|
46
|
-
}, [x, y]);
|
|
47
|
-
useLayoutEffect(() => {
|
|
48
|
-
const position = positioningRef.current;
|
|
49
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
50
|
-
for (let i = 0; i < entries.length; i++) {
|
|
51
|
-
const entry = entries[i];
|
|
52
|
-
const { target } = entry;
|
|
53
|
-
position.rootElementRect = target.getBoundingClientRect();
|
|
54
|
-
const stickyContainer = stickyContainerRef.current;
|
|
55
|
-
if (stickyContainer !== null) {
|
|
56
|
-
positionSticky(stickyContainer, position);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
const removeRootListener = editor.registerRootListener((nextRootElem, prevRootElem) => {
|
|
61
|
-
if (prevRootElem !== null) {
|
|
62
|
-
resizeObserver.unobserve(prevRootElem);
|
|
63
|
-
}
|
|
64
|
-
if (nextRootElem !== null) {
|
|
65
|
-
resizeObserver.observe(nextRootElem);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
const handleWindowResize = () => {
|
|
69
|
-
const rootElement = editor.getRootElement();
|
|
70
|
-
const stickyContainer = stickyContainerRef.current;
|
|
71
|
-
if (rootElement !== null && stickyContainer !== null) {
|
|
72
|
-
position.rootElementRect = rootElement.getBoundingClientRect();
|
|
73
|
-
positionSticky(stickyContainer, position);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
window.addEventListener('resize', handleWindowResize);
|
|
77
|
-
return () => {
|
|
78
|
-
window.removeEventListener('resize', handleWindowResize);
|
|
79
|
-
removeRootListener();
|
|
80
|
-
};
|
|
81
|
-
}, [editor]);
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
const stickyContainer = stickyContainerRef.current;
|
|
84
|
-
if (stickyContainer !== null) {
|
|
85
|
-
// Delay adding transition so we don't trigger the
|
|
86
|
-
// transition on load of the sticky.
|
|
87
|
-
setTimeout(() => {
|
|
88
|
-
stickyContainer.style.setProperty('transition', 'top 0.3s ease 0s, left 0.3s ease 0s');
|
|
89
|
-
}, 500);
|
|
90
|
-
}
|
|
91
|
-
}, []);
|
|
92
|
-
const handlePointerMove = (event) => {
|
|
93
|
-
const stickyContainer = stickyContainerRef.current;
|
|
94
|
-
const positioning = positioningRef.current;
|
|
95
|
-
const rootElementRect = positioning.rootElementRect;
|
|
96
|
-
if (stickyContainer !== null && positioning.isDragging && rootElementRect !== null) {
|
|
97
|
-
positioning.x = event.pageX - positioning.offsetX - rootElementRect.left;
|
|
98
|
-
positioning.y = event.pageY - positioning.offsetY - rootElementRect.top;
|
|
99
|
-
positionSticky(stickyContainer, positioning);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
const handlePointerUp = () => {
|
|
103
|
-
const stickyContainer = stickyContainerRef.current;
|
|
104
|
-
const positioning = positioningRef.current;
|
|
105
|
-
if (stickyContainer !== null) {
|
|
106
|
-
positioning.isDragging = false;
|
|
107
|
-
stickyContainer.classList.remove('dragging');
|
|
108
|
-
editor.update(() => {
|
|
109
|
-
const node = $getNodeByKey(nodeKey);
|
|
110
|
-
if ($isStickyNode(node)) {
|
|
111
|
-
node.setPosition(positioning.x, positioning.y);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
document.removeEventListener('pointermove', handlePointerMove);
|
|
116
|
-
document.removeEventListener('pointerup', handlePointerUp);
|
|
117
|
-
};
|
|
118
|
-
const handleDelete = () => {
|
|
119
|
-
editor.update(() => {
|
|
120
|
-
const node = $getNodeByKey(nodeKey);
|
|
121
|
-
if ($isStickyNode(node)) {
|
|
122
|
-
node.remove();
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
const handleColorChange = () => {
|
|
127
|
-
editor.update(() => {
|
|
128
|
-
const node = $getNodeByKey(nodeKey);
|
|
129
|
-
if ($isStickyNode(node)) {
|
|
130
|
-
node.toggleColor();
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
const { historyState } = useSharedHistoryContext();
|
|
135
|
-
return (React.createElement("div", { ref: stickyContainerRef, className: 'sticky-note-container' },
|
|
136
|
-
React.createElement("div", { className: `sticky-note ${color}`, onPointerDown: (event) => {
|
|
137
|
-
const stickyContainer = stickyContainerRef.current;
|
|
138
|
-
if (stickyContainer == null || event.button === 2 || event.target !== stickyContainer.firstChild) {
|
|
139
|
-
// Right click or click on editor should not work
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
const stickContainer = stickyContainer;
|
|
143
|
-
const positioning = positioningRef.current;
|
|
144
|
-
if (stickContainer !== null) {
|
|
145
|
-
const { left, top } = stickContainer.getBoundingClientRect();
|
|
146
|
-
positioning.offsetX = event.clientX - left;
|
|
147
|
-
positioning.offsetY = event.clientY - top;
|
|
148
|
-
positioning.isDragging = true;
|
|
149
|
-
stickContainer.classList.add('dragging');
|
|
150
|
-
document.addEventListener('pointermove', handlePointerMove);
|
|
151
|
-
document.addEventListener('pointerup', handlePointerUp);
|
|
152
|
-
event.preventDefault();
|
|
153
|
-
}
|
|
154
|
-
} },
|
|
155
|
-
React.createElement("button", { "aria-label": 'Delete sticky note', className: 'delete', onClick: handleDelete, title: 'Delete', type: 'button' }, "X"),
|
|
156
|
-
React.createElement("button", { "aria-label": 'Change sticky note color', className: 'color', onClick: handleColorChange, title: 'Color', type: 'button' },
|
|
157
|
-
React.createElement("i", { className: 'bucket' })),
|
|
158
|
-
React.createElement(LexicalNestedComposer, { initialEditor: caption, initialTheme: StickyEditorTheme },
|
|
159
|
-
isCollabActive ? (React.createElement(CollaborationPlugin, { id: caption.getKey(), providerFactory: createWebsocketProvider, shouldBootstrap: true })) : (React.createElement(HistoryPlugin, { externalHistoryState: historyState })),
|
|
160
|
-
React.createElement(PlainTextPlugin, { contentEditable: React.createElement(ContentEditable, { className: 'StickyNode__contentEditable' }), ErrorBoundary: LexicalErrorBoundary, placeholder: React.createElement(Placeholder, { className: 'StickyNode__placeholder' }, "What's up?") })))));
|
|
161
|
-
}
|
|
162
|
-
//# sourceMappingURL=StickyComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StickyComponent.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/StickyComponent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAA;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AACjF,OAAO,oBAAoB,MAAM,qCAAqC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,eAAe,MAAM,2BAA2B,CAAA;AACvD,OAAO,iBAAiB,MAAM,6BAA6B,CAAA;AAC3D,OAAO,eAAe,MAAM,uBAAuB,CAAA;AACnD,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,aAAa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E,CAAA;gBACxB,CAAC;YACH,CAAC;YAED,8CAAmB,oBAAoB,EAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,QAErG;YACT,8CACa,0BAA0B,EACrC,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,QAAQ;gBAEb,2BAAG,SAAS,EAAC,QAAQ,GAAG,CACjB;YACT,oBAAC,qBAAqB,IAAC,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,iBAAiB;gBAC3E,cAAc,CAAC,CAAC,CAAC,CAChB,oBAAC,mBAAmB,IAAC,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,uBAAuB,EAAE,eAAe,SAAG,CACxG,CAAC,CAAC,CAAC,CACF,oBAAC,aAAa,IAAC,oBAAoB,EAAE,YAAY,GAAI,CACtD;gBACD,oBAAC,eAAe,IACd,eAAe,EAAE,oBAAC,eAAe,IAAC,SAAS,EAAC,6BAA6B,GAAG,EAC5E,aAAa,EAAE,oBAAoB,EACnC,WAAW,EAAE,oBAAC,WAAW,IAAC,SAAS,EAAC,yBAAyB,iBAA8B,GAC3F,CACoB,CACpB,CACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
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 { EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditor, SerializedLexicalNode, Spread } from 'lexical';
|
|
9
|
-
import { DecoratorNode } from 'lexical';
|
|
10
|
-
import * as React from 'react';
|
|
11
|
-
type StickyNoteColor = 'pink' | 'yellow';
|
|
12
|
-
export type SerializedStickyNode = Spread<{
|
|
13
|
-
xOffset: number;
|
|
14
|
-
yOffset: number;
|
|
15
|
-
color: StickyNoteColor;
|
|
16
|
-
caption: SerializedEditor;
|
|
17
|
-
}, SerializedLexicalNode>;
|
|
18
|
-
export declare class StickyNode extends DecoratorNode<React.JSX.Element> {
|
|
19
|
-
__x: number;
|
|
20
|
-
__y: number;
|
|
21
|
-
__color: StickyNoteColor;
|
|
22
|
-
__caption: LexicalEditor;
|
|
23
|
-
static getType(): string;
|
|
24
|
-
static clone(node: StickyNode): StickyNode;
|
|
25
|
-
static importJSON(serializedNode: SerializedStickyNode): StickyNode;
|
|
26
|
-
constructor(x: number, y: number, color: 'pink' | 'yellow', caption?: LexicalEditor, key?: NodeKey);
|
|
27
|
-
exportJSON(): SerializedStickyNode;
|
|
28
|
-
createDOM(config: EditorConfig): HTMLElement;
|
|
29
|
-
updateDOM(): false;
|
|
30
|
-
setPosition(x: number, y: number): void;
|
|
31
|
-
toggleColor(): void;
|
|
32
|
-
decorate(editor: LexicalEditor, config: EditorConfig): React.JSX.Element;
|
|
33
|
-
isIsolated(): true;
|
|
34
|
-
}
|
|
35
|
-
export declare function $isStickyNode(node: LexicalNode | null | undefined): node is StickyNode;
|
|
36
|
-
export declare function $createStickyNode(xOffset: number, yOffset: number): StickyNode;
|
|
37
|
-
export {};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
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
|
-
import { $setSelection, createEditor, DecoratorNode } from 'lexical';
|
|
10
|
-
import * as React from 'react';
|
|
11
|
-
import { Suspense } from 'react';
|
|
12
|
-
import { createPortal } from 'react-dom';
|
|
13
|
-
const StickyComponent = React.lazy(
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
() => import('./StickyComponent'));
|
|
16
|
-
export class StickyNode extends DecoratorNode {
|
|
17
|
-
static getType() {
|
|
18
|
-
return 'sticky';
|
|
19
|
-
}
|
|
20
|
-
static clone(node) {
|
|
21
|
-
return new StickyNode(node.__x, node.__y, node.__color, node.__caption, node.__key);
|
|
22
|
-
}
|
|
23
|
-
static importJSON(serializedNode) {
|
|
24
|
-
const stickyNode = new StickyNode(serializedNode.xOffset, serializedNode.yOffset, serializedNode.color);
|
|
25
|
-
const caption = serializedNode.caption;
|
|
26
|
-
const nestedEditor = stickyNode.__caption;
|
|
27
|
-
const editorState = nestedEditor.parseEditorState(caption.editorState);
|
|
28
|
-
if (!editorState.isEmpty()) {
|
|
29
|
-
nestedEditor.setEditorState(editorState);
|
|
30
|
-
}
|
|
31
|
-
return stickyNode;
|
|
32
|
-
}
|
|
33
|
-
constructor(x, y, color, caption, key) {
|
|
34
|
-
super(key);
|
|
35
|
-
this.__x = x;
|
|
36
|
-
this.__y = y;
|
|
37
|
-
this.__caption = caption || createEditor();
|
|
38
|
-
this.__color = color;
|
|
39
|
-
}
|
|
40
|
-
exportJSON() {
|
|
41
|
-
return {
|
|
42
|
-
caption: this.__caption.toJSON(),
|
|
43
|
-
color: this.__color,
|
|
44
|
-
type: 'sticky',
|
|
45
|
-
version: 1,
|
|
46
|
-
xOffset: this.__x,
|
|
47
|
-
yOffset: this.__y,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
createDOM(config) {
|
|
51
|
-
console.log(config);
|
|
52
|
-
const div = document.createElement('div');
|
|
53
|
-
div.style.display = 'contents';
|
|
54
|
-
return div;
|
|
55
|
-
}
|
|
56
|
-
updateDOM() {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
setPosition(x, y) {
|
|
60
|
-
const writable = this.getWritable();
|
|
61
|
-
writable.__x = x;
|
|
62
|
-
writable.__y = y;
|
|
63
|
-
$setSelection(null);
|
|
64
|
-
}
|
|
65
|
-
toggleColor() {
|
|
66
|
-
const writable = this.getWritable();
|
|
67
|
-
writable.__color = writable.__color === 'pink' ? 'yellow' : 'pink';
|
|
68
|
-
}
|
|
69
|
-
decorate(editor, config) {
|
|
70
|
-
console.log(editor, config);
|
|
71
|
-
return createPortal(React.createElement(Suspense, { fallback: null },
|
|
72
|
-
React.createElement(StickyComponent, { caption: this.__caption, color: this.__color, nodeKey: this.getKey(), x: this.__x, y: this.__y })), document.body);
|
|
73
|
-
}
|
|
74
|
-
isIsolated() {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
export function $isStickyNode(node) {
|
|
79
|
-
return node instanceof StickyNode;
|
|
80
|
-
}
|
|
81
|
-
export function $createStickyNode(xOffset, yOffset) {
|
|
82
|
-
return new StickyNode(xOffset, yOffset, 'yellow');
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=StickyNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StickyNode.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/StickyNode.tsx"],"names":[],"mappings":"AAAA,sDAAsD;AACtD;;;;;;GAMG;AAWH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI;AAChC,aAAa;AACb,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAClC,CAAA;AAcD,MAAM,OAAO,UAAW,SAAQ,aAAgC;IAMvD,MAAM,CAAC,OAAO;QACnB,OAAO,QAAQ,CAAA;IACjB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,IAAgB;QAClC,OAAO,IAAI,U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AU,iBAAiB,CAAC,OAAe,EAAE,OAAe;IAChE,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;AACnD,CAAC"}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { $createCodeNode, $isCodeNode } from '@lexical/code';
|
|
2
|
-
import { exportFile, importFile } from '@lexical/file';
|
|
3
|
-
import { $convertFromMarkdownString, $convertToMarkdownString } from '@lexical/markdown';
|
|
4
|
-
import { useCollaborationContext } from '@lexical/react/LexicalCollaborationContext';
|
|
5
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
|
-
import { mergeRegister } from '@lexical/utils';
|
|
7
|
-
import { CONNECTED_COMMAND, TOGGLE_CONNECT_COMMAND } from '@lexical/yjs';
|
|
8
|
-
import { $createTextNode, $getRoot, $isParagraphNode, CLEAR_EDITOR_COMMAND, COMMAND_PRIORITY_EDITOR } from 'lexical';
|
|
9
|
-
import * as React from 'react';
|
|
10
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
11
|
-
import useModal from '../../hooks/useModal';
|
|
12
|
-
import Button from '../../ui/Button';
|
|
13
|
-
import { PLAYGROUND_TRANSFORMERS } from '../MarkdownTransformers';
|
|
14
|
-
async function sendEditorState(editor) {
|
|
15
|
-
const stringifiedEditorState = JSON.stringify(editor.getEditorState());
|
|
16
|
-
try {
|
|
17
|
-
await fetch('http://localhost:1235/setEditorState', {
|
|
18
|
-
body: stringifiedEditorState,
|
|
19
|
-
headers: {
|
|
20
|
-
Accept: 'application/json',
|
|
21
|
-
'Content-type': 'application/json',
|
|
22
|
-
},
|
|
23
|
-
method: 'POST',
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
catch (_a) {
|
|
27
|
-
// NO-OP
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async function validateEditorState(editor) {
|
|
31
|
-
const stringifiedEditorState = JSON.stringify(editor.getEditorState());
|
|
32
|
-
let response = null;
|
|
33
|
-
try {
|
|
34
|
-
response = await fetch('http://localhost:1235/validateEditorState', {
|
|
35
|
-
body: stringifiedEditorState,
|
|
36
|
-
headers: {
|
|
37
|
-
Accept: 'application/json',
|
|
38
|
-
'Content-type': 'application/json',
|
|
39
|
-
},
|
|
40
|
-
method: 'POST',
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
catch (_a) {
|
|
44
|
-
// NO-OP
|
|
45
|
-
}
|
|
46
|
-
if (response !== null && response.status === 403) {
|
|
47
|
-
throw new Error('Editor state validation failed! Server did not accept changes.');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
export default function ActionsPlugin() {
|
|
51
|
-
const [editor] = useLexicalComposerContext();
|
|
52
|
-
const [isEditable, setIsEditable] = useState(() => editor.isEditable());
|
|
53
|
-
const [connected, setConnected] = useState(false);
|
|
54
|
-
const [isEditorEmpty, setIsEditorEmpty] = useState(true);
|
|
55
|
-
const [modal, showModal] = useModal();
|
|
56
|
-
const { isCollabActive } = useCollaborationContext();
|
|
57
|
-
useEffect(() => mergeRegister(editor.registerEditableListener((editable) => {
|
|
58
|
-
setIsEditable(editable);
|
|
59
|
-
}), editor.registerCommand(CONNECTED_COMMAND, (payload) => {
|
|
60
|
-
const isConnected = payload;
|
|
61
|
-
setConnected(isConnected);
|
|
62
|
-
return false;
|
|
63
|
-
}, COMMAND_PRIORITY_EDITOR)), [editor]);
|
|
64
|
-
useEffect(() => editor.registerUpdateListener(({ dirtyElements, tags }) => {
|
|
65
|
-
// If we are in read only mode, send the editor state
|
|
66
|
-
// to server and ask for validation if possible.
|
|
67
|
-
if (!isEditable && dirtyElements.size > 0 && !tags.has('historic') && !tags.has('collaboration')) {
|
|
68
|
-
validateEditorState(editor);
|
|
69
|
-
}
|
|
70
|
-
editor.getEditorState().read(() => {
|
|
71
|
-
const root = $getRoot();
|
|
72
|
-
const children = root.getChildren();
|
|
73
|
-
if (children.length > 1) {
|
|
74
|
-
setIsEditorEmpty(false);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
if ($isParagraphNode(children[0])) {
|
|
78
|
-
const paragraphChildren = children[0].getChildren();
|
|
79
|
-
setIsEditorEmpty(paragraphChildren.length === 0);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
setIsEditorEmpty(false);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}), [editor, isEditable]);
|
|
87
|
-
const handleMarkdownToggle = useCallback(() => {
|
|
88
|
-
editor.update(() => {
|
|
89
|
-
const root = $getRoot();
|
|
90
|
-
const firstChild = root.getFirstChild();
|
|
91
|
-
if ($isCodeNode(firstChild) && firstChild.getLanguage() === 'markdown') {
|
|
92
|
-
$convertFromMarkdownString(firstChild.getTextContent(), PLAYGROUND_TRANSFORMERS);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
const markdown = $convertToMarkdownString(PLAYGROUND_TRANSFORMERS);
|
|
96
|
-
root.clear().append($createCodeNode('markdown').append($createTextNode(markdown)));
|
|
97
|
-
}
|
|
98
|
-
root.selectEnd();
|
|
99
|
-
});
|
|
100
|
-
}, [editor]);
|
|
101
|
-
return (React.createElement("div", { className: 'actions' },
|
|
102
|
-
React.createElement("button", { "aria-label": 'Import editor state from JSON', className: 'action-button import', onClick: () => importFile(editor), title: 'Import', type: 'button' },
|
|
103
|
-
React.createElement("i", { className: 'import' })),
|
|
104
|
-
React.createElement("button", { "aria-label": 'Export editor state to JSON', className: 'action-button export', onClick: () => exportFile(editor, {
|
|
105
|
-
fileName: `Playground ${new Date().toISOString()}`,
|
|
106
|
-
source: 'Playground',
|
|
107
|
-
}), title: 'Export', type: 'button' },
|
|
108
|
-
React.createElement("i", { className: 'export' })),
|
|
109
|
-
React.createElement("button", { "aria-label": 'Clear editor contents', className: 'action-button clear', disabled: isEditorEmpty, onClick: () => {
|
|
110
|
-
showModal('Clear editor', (onClose) => React.createElement(ShowClearDialog, { editor: editor, onClose: onClose }));
|
|
111
|
-
}, title: 'Clear', type: 'button' },
|
|
112
|
-
React.createElement("i", { className: 'clear' })),
|
|
113
|
-
React.createElement("button", { "aria-label": `${!isEditable ? 'Unlock' : 'Lock'} read-only mode`, className: `action-button ${!isEditable ? 'unlock' : 'lock'}`, onClick: () => {
|
|
114
|
-
// Send latest editor state to commenting validation server
|
|
115
|
-
if (isEditable) {
|
|
116
|
-
sendEditorState(editor);
|
|
117
|
-
}
|
|
118
|
-
editor.setEditable(!editor.isEditable());
|
|
119
|
-
}, title: 'Read-Only Mode', type: 'button' },
|
|
120
|
-
React.createElement("i", { className: !isEditable ? 'unlock' : 'lock' })),
|
|
121
|
-
React.createElement("button", { "aria-label": 'Convert from markdown', className: 'action-button', onClick: handleMarkdownToggle, title: 'Convert From Markdown', type: 'button' },
|
|
122
|
-
React.createElement("i", { className: 'markdown' })),
|
|
123
|
-
isCollabActive && (React.createElement("button", { "aria-label": `${connected ? 'Disconnect from' : 'Connect to'} a collaborative editing server`, className: 'action-button connect', onClick: () => {
|
|
124
|
-
editor.dispatchCommand(TOGGLE_CONNECT_COMMAND, !connected);
|
|
125
|
-
}, title: `${connected ? 'Disconnect' : 'Connect'} Collaborative Editing`, type: 'button' },
|
|
126
|
-
React.createElement("i", { className: connected ? 'disconnect' : 'connect' }))),
|
|
127
|
-
modal));
|
|
128
|
-
}
|
|
129
|
-
function ShowClearDialog({ editor, onClose }) {
|
|
130
|
-
return (React.createElement(React.Fragment, null,
|
|
131
|
-
"Are you sure you want to clear the editor?",
|
|
132
|
-
React.createElement("div", { className: 'Modal__content' },
|
|
133
|
-
React.createElement(Button, { onClick: () => {
|
|
134
|
-
editor.dispatchCommand(CLEAR_EDITOR_COMMAND, undefined);
|
|
135
|
-
editor.focus();
|
|
136
|
-
onClose();
|
|
137
|
-
} }, "Clear"),
|
|
138
|
-
' ',
|
|
139
|
-
React.createElement(Button, { onClick: () => {
|
|
140
|
-
editor.focus();
|
|
141
|
-
onClose();
|
|
142
|
-
} }, "Cancel"))));
|
|
143
|
-
}
|
|
144
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/TextEditorV2/plugins/ActionsPlugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAA;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAExE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AACpH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACxD,OAAO,QAAQ,MAAM,sBAAsB,CAAA;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,KAAK,UAAU,eAAe,CAAC,MAAqB;IAClD,MAAM,sBAAsB,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAA;IACtE,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,sCAAsC,EAAE;YAClD,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,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AAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,YAAY,iCAAiC,EAC5F,SAAS,EAAC,uBAAuB,EACjC,OAAO,EAAE,GAAG,EAAE;gBACZ,MAAM,CAAC,eAAe,CAAC,sBAAsB,EAAE,CAAC,SAAS,CAAC,CAAA;YAC5D,CAAC,EACD,KAAK,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,wBAAwB,EACtE,IAAI,EAAC,QAAQ;YAEb,2BAAG,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,GAAI,CAC/C,CACV;QACA,KAAK,CACF,CACP,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,EAA8C;IACtF,OAAO,CACL;;QAEE,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,oBAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;oBACZ,MAAM,CAAC,eAAe,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAA;oBACvD,MAAM,CAAC,KAAK,EAAE,CAAA;oBACd,OAAO,EAAE,CAAA;gBACX,CAAC,YAGM;YAAC,GAAG;YACb,oBAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;oBACZ,MAAM,CAAC,KAAK,EAAE,CAAA;oBACd,OAAO,EAAE,CAAA;gBACX,CAAC,aAGM,CACL,CACL,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EmbedConfig } from '@lexical/react/LexicalAutoEmbedPlugin';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
interface PlaygroundEmbedConfig extends EmbedConfig {
|
|
4
|
-
contentName: string;
|
|
5
|
-
icon?: React.JSX.Element;
|
|
6
|
-
exampleUrl: string;
|
|
7
|
-
keywords: Array<string>;
|
|
8
|
-
description?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const YoutubeEmbedConfig: PlaygroundEmbedConfig;
|
|
11
|
-
export declare const TwitterEmbedConfig: PlaygroundEmbedConfig;
|
|
12
|
-
export declare const FigmaEmbedConfig: PlaygroundEmbedConfig;
|
|
13
|
-
export declare const EmbedConfigs: PlaygroundEmbedConfig[];
|
|
14
|
-
export declare function AutoEmbedDialog({ embedConfig, onClose, }: {
|
|
15
|
-
embedConfig: PlaygroundEmbedConfig;
|
|
16
|
-
onClose(): void;
|
|
17
|
-
}): React.JSX.Element;
|
|
18
|
-
export default function AutoEmbedPlugin(): React.JSX.Element;
|
|
19
|
-
export {};
|