@ekz/lexical-react 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@ekz/lexicalExtensionComponent.dev.js +53 -0
- package/@ekz/lexicalExtensionComponent.dev.mjs +51 -0
- package/@ekz/lexicalExtensionComponent.js +11 -0
- package/@ekz/lexicalExtensionComponent.mjs +12 -0
- package/@ekz/lexicalExtensionComponent.node.mjs +10 -0
- package/@ekz/lexicalExtensionComponent.prod.js +9 -0
- package/@ekz/lexicalExtensionComponent.prod.mjs +9 -0
- package/@ekz/lexicalReactExtension.dev.js +187 -0
- package/@ekz/lexicalReactExtension.dev.mjs +184 -0
- package/@ekz/lexicalReactExtension.js +11 -0
- package/@ekz/lexicalReactExtension.mjs +13 -0
- package/@ekz/lexicalReactExtension.node.mjs +11 -0
- package/@ekz/lexicalReactExtension.prod.js +9 -0
- package/@ekz/lexicalReactExtension.prod.mjs +9 -0
- package/@ekz/lexicalReactPluginHostExtension.dev.js +189 -0
- package/@ekz/lexicalReactPluginHostExtension.dev.mjs +181 -0
- package/@ekz/lexicalReactPluginHostExtension.js +11 -0
- package/@ekz/lexicalReactPluginHostExtension.mjs +18 -0
- package/@ekz/lexicalReactPluginHostExtension.node.mjs +16 -0
- package/@ekz/lexicalReactPluginHostExtension.prod.js +9 -0
- package/@ekz/lexicalReactPluginHostExtension.prod.mjs +9 -0
- package/@ekz/lexicalReactProviderExtension.dev.js +33 -0
- package/@ekz/lexicalReactProviderExtension.dev.mjs +31 -0
- package/@ekz/lexicalReactProviderExtension.js +11 -0
- package/@ekz/lexicalReactProviderExtension.mjs +12 -0
- package/@ekz/lexicalReactProviderExtension.node.mjs +10 -0
- package/@ekz/lexicalReactProviderExtension.prod.js +9 -0
- package/@ekz/lexicalReactProviderExtension.prod.mjs +9 -0
- package/@ekz/lexicalTreeViewExtension.dev.js +57 -0
- package/@ekz/lexicalTreeViewExtension.dev.mjs +54 -0
- package/@ekz/lexicalTreeViewExtension.js +11 -0
- package/@ekz/lexicalTreeViewExtension.mjs +13 -0
- package/@ekz/lexicalTreeViewExtension.node.mjs +11 -0
- package/@ekz/lexicalTreeViewExtension.prod.js +9 -0
- package/@ekz/lexicalTreeViewExtension.prod.mjs +9 -0
- package/ExtensionComponent.d.ts +42 -0
- package/LICENSE +21 -0
- package/LexicalAutoEmbedPlugin.d.ts +39 -0
- package/LexicalAutoEmbedPlugin.dev.js +146 -0
- package/LexicalAutoEmbedPlugin.dev.mjs +141 -0
- package/LexicalAutoEmbedPlugin.js +11 -0
- package/LexicalAutoEmbedPlugin.js.flow +64 -0
- package/LexicalAutoEmbedPlugin.mjs +15 -0
- package/LexicalAutoEmbedPlugin.node.mjs +13 -0
- package/LexicalAutoEmbedPlugin.prod.js +9 -0
- package/LexicalAutoEmbedPlugin.prod.mjs +9 -0
- package/LexicalAutoFocusPlugin.d.ts +12 -0
- package/LexicalAutoFocusPlugin.dev.js +47 -0
- package/LexicalAutoFocusPlugin.dev.mjs +45 -0
- package/LexicalAutoFocusPlugin.js +11 -0
- package/LexicalAutoFocusPlugin.js.flow +14 -0
- package/LexicalAutoFocusPlugin.mjs +12 -0
- package/LexicalAutoFocusPlugin.node.mjs +10 -0
- package/LexicalAutoFocusPlugin.prod.js +9 -0
- package/LexicalAutoFocusPlugin.prod.mjs +9 -0
- package/LexicalAutoLinkPlugin.d.ts +14 -0
- package/LexicalAutoLinkPlugin.dev.js +54 -0
- package/LexicalAutoLinkPlugin.dev.mjs +52 -0
- package/LexicalAutoLinkPlugin.js +11 -0
- package/LexicalAutoLinkPlugin.js.flow +18 -0
- package/LexicalAutoLinkPlugin.mjs +13 -0
- package/LexicalAutoLinkPlugin.node.mjs +11 -0
- package/LexicalAutoLinkPlugin.prod.js +9 -0
- package/LexicalAutoLinkPlugin.prod.mjs +9 -0
- package/LexicalBlockWithAlignableContents.d.ts +21 -0
- package/LexicalBlockWithAlignableContents.dev.js +81 -0
- package/LexicalBlockWithAlignableContents.dev.mjs +79 -0
- package/LexicalBlockWithAlignableContents.js +11 -0
- package/LexicalBlockWithAlignableContents.js.flow +28 -0
- package/LexicalBlockWithAlignableContents.mjs +12 -0
- package/LexicalBlockWithAlignableContents.node.mjs +10 -0
- package/LexicalBlockWithAlignableContents.prod.js +9 -0
- package/LexicalBlockWithAlignableContents.prod.mjs +9 -0
- package/LexicalCharacterLimitPlugin.d.ts +15 -0
- package/LexicalCharacterLimitPlugin.dev.js +292 -0
- package/LexicalCharacterLimitPlugin.dev.mjs +290 -0
- package/LexicalCharacterLimitPlugin.js +11 -0
- package/LexicalCharacterLimitPlugin.js.flow +12 -0
- package/LexicalCharacterLimitPlugin.mjs +12 -0
- package/LexicalCharacterLimitPlugin.node.mjs +10 -0
- package/LexicalCharacterLimitPlugin.prod.js +9 -0
- package/LexicalCharacterLimitPlugin.prod.mjs +9 -0
- package/LexicalCheckListPlugin.d.ts +8 -0
- package/LexicalCheckListPlugin.dev.js +31 -0
- package/LexicalCheckListPlugin.dev.mjs +29 -0
- package/LexicalCheckListPlugin.js +11 -0
- package/LexicalCheckListPlugin.js.flow +10 -0
- package/LexicalCheckListPlugin.mjs +12 -0
- package/LexicalCheckListPlugin.node.mjs +10 -0
- package/LexicalCheckListPlugin.prod.js +9 -0
- package/LexicalCheckListPlugin.prod.mjs +9 -0
- package/LexicalClearEditorPlugin.d.ts +13 -0
- package/LexicalClearEditorPlugin.dev.js +55 -0
- package/LexicalClearEditorPlugin.dev.mjs +53 -0
- package/LexicalClearEditorPlugin.js +11 -0
- package/LexicalClearEditorPlugin.js.flow +14 -0
- package/LexicalClearEditorPlugin.mjs +12 -0
- package/LexicalClearEditorPlugin.node.mjs +10 -0
- package/LexicalClearEditorPlugin.prod.js +9 -0
- package/LexicalClearEditorPlugin.prod.mjs +9 -0
- package/LexicalClickableLinkPlugin.d.ts +11 -0
- package/LexicalClickableLinkPlugin.dev.js +38 -0
- package/LexicalClickableLinkPlugin.dev.mjs +36 -0
- package/LexicalClickableLinkPlugin.js +11 -0
- package/LexicalClickableLinkPlugin.js.flow +12 -0
- package/LexicalClickableLinkPlugin.mjs +12 -0
- package/LexicalClickableLinkPlugin.node.mjs +10 -0
- package/LexicalClickableLinkPlugin.prod.js +9 -0
- package/LexicalClickableLinkPlugin.prod.mjs +9 -0
- package/LexicalCollaborationContext.d.ts +19 -0
- package/LexicalCollaborationContext.dev.js +69 -0
- package/LexicalCollaborationContext.dev.mjs +65 -0
- package/LexicalCollaborationContext.js +11 -0
- package/LexicalCollaborationContext.js.flow +22 -0
- package/LexicalCollaborationContext.mjs +14 -0
- package/LexicalCollaborationContext.node.mjs +12 -0
- package/LexicalCollaborationContext.prod.js +9 -0
- package/LexicalCollaborationContext.prod.mjs +9 -0
- package/LexicalCollaborationPlugin.d.ts +39 -0
- package/LexicalCollaborationPlugin.dev.js +584 -0
- package/LexicalCollaborationPlugin.dev.mjs +569 -0
- package/LexicalCollaborationPlugin.js +11 -0
- package/LexicalCollaborationPlugin.js.flow +50 -0
- package/LexicalCollaborationPlugin.mjs +13 -0
- package/LexicalCollaborationPlugin.node.mjs +11 -0
- package/LexicalCollaborationPlugin.prod.js +9 -0
- package/LexicalCollaborationPlugin.prod.mjs +9 -0
- package/LexicalComposer.d.ts +25 -0
- package/LexicalComposer.dev.js +134 -0
- package/LexicalComposer.dev.mjs +132 -0
- package/LexicalComposer.js +11 -0
- package/LexicalComposer.js.flow +40 -0
- package/LexicalComposer.mjs +12 -0
- package/LexicalComposer.node.mjs +10 -0
- package/LexicalComposer.prod.js +9 -0
- package/LexicalComposer.prod.mjs +9 -0
- package/LexicalComposerContext.d.ts +18 -0
- package/LexicalComposerContext.dev.js +55 -0
- package/LexicalComposerContext.dev.mjs +51 -0
- package/LexicalComposerContext.js +11 -0
- package/LexicalComposerContext.js.flow +27 -0
- package/LexicalComposerContext.mjs +14 -0
- package/LexicalComposerContext.node.mjs +12 -0
- package/LexicalComposerContext.prod.js +9 -0
- package/LexicalComposerContext.prod.mjs +9 -0
- package/LexicalContentEditable.d.ts +26 -0
- package/LexicalContentEditable.dev.js +242 -0
- package/LexicalContentEditable.dev.mjs +239 -0
- package/LexicalContentEditable.js +11 -0
- package/LexicalContentEditable.js.flow +80 -0
- package/LexicalContentEditable.mjs +13 -0
- package/LexicalContentEditable.node.mjs +11 -0
- package/LexicalContentEditable.prod.js +9 -0
- package/LexicalContentEditable.prod.mjs +9 -0
- package/LexicalContextMenuPlugin.d.ts +36 -0
- package/LexicalContextMenuPlugin.dev.js +524 -0
- package/LexicalContextMenuPlugin.dev.mjs +509 -0
- package/LexicalContextMenuPlugin.js +11 -0
- package/LexicalContextMenuPlugin.js.flow +13 -0
- package/LexicalContextMenuPlugin.mjs +13 -0
- package/LexicalContextMenuPlugin.node.mjs +11 -0
- package/LexicalContextMenuPlugin.prod.js +9 -0
- package/LexicalContextMenuPlugin.prod.mjs +9 -0
- package/LexicalDecoratorBlockNode.d.ts +25 -0
- package/LexicalDecoratorBlockNode.dev.js +59 -0
- package/LexicalDecoratorBlockNode.dev.mjs +56 -0
- package/LexicalDecoratorBlockNode.js +11 -0
- package/LexicalDecoratorBlockNode.js.flow +35 -0
- package/LexicalDecoratorBlockNode.mjs +13 -0
- package/LexicalDecoratorBlockNode.node.mjs +11 -0
- package/LexicalDecoratorBlockNode.prod.js +9 -0
- package/LexicalDecoratorBlockNode.prod.mjs +9 -0
- package/LexicalDraggableBlockPlugin.d.ts +18 -0
- package/LexicalDraggableBlockPlugin.dev.js +655 -0
- package/LexicalDraggableBlockPlugin.dev.mjs +653 -0
- package/LexicalDraggableBlockPlugin.js +11 -0
- package/LexicalDraggableBlockPlugin.js.flow +24 -0
- package/LexicalDraggableBlockPlugin.mjs +12 -0
- package/LexicalDraggableBlockPlugin.node.mjs +10 -0
- package/LexicalDraggableBlockPlugin.prod.js +9 -0
- package/LexicalDraggableBlockPlugin.prod.mjs +9 -0
- package/LexicalEditorRefPlugin.d.ts +20 -0
- package/LexicalEditorRefPlugin.dev.js +58 -0
- package/LexicalEditorRefPlugin.dev.mjs +43 -0
- package/LexicalEditorRefPlugin.js +11 -0
- package/LexicalEditorRefPlugin.js.flow +19 -0
- package/LexicalEditorRefPlugin.mjs +12 -0
- package/LexicalEditorRefPlugin.node.mjs +10 -0
- package/LexicalEditorRefPlugin.prod.js +9 -0
- package/LexicalEditorRefPlugin.prod.mjs +9 -0
- package/LexicalErrorBoundary.d.ts +13 -0
- package/LexicalErrorBoundary.dev.js +40 -0
- package/LexicalErrorBoundary.dev.mjs +38 -0
- package/LexicalErrorBoundary.js +11 -0
- package/LexicalErrorBoundary.js.flow +17 -0
- package/LexicalErrorBoundary.mjs +12 -0
- package/LexicalErrorBoundary.node.mjs +10 -0
- package/LexicalErrorBoundary.prod.js +9 -0
- package/LexicalErrorBoundary.prod.mjs +9 -0
- package/LexicalExtensionComponent.js.flow +12 -0
- package/LexicalExtensionComposer.d.ts +69 -0
- package/LexicalExtensionComposer.dev.js +105 -0
- package/LexicalExtensionComposer.dev.mjs +103 -0
- package/LexicalExtensionComposer.js +11 -0
- package/LexicalExtensionComposer.js.flow +20 -0
- package/LexicalExtensionComposer.mjs +12 -0
- package/LexicalExtensionComposer.node.mjs +10 -0
- package/LexicalExtensionComposer.prod.js +9 -0
- package/LexicalExtensionComposer.prod.mjs +9 -0
- package/LexicalHashtagPlugin.d.ts +9 -0
- package/LexicalHashtagPlugin.dev.js +34 -0
- package/LexicalHashtagPlugin.dev.mjs +32 -0
- package/LexicalHashtagPlugin.js +11 -0
- package/LexicalHashtagPlugin.js.flow +10 -0
- package/LexicalHashtagPlugin.mjs +12 -0
- package/LexicalHashtagPlugin.node.mjs +10 -0
- package/LexicalHashtagPlugin.prod.js +9 -0
- package/LexicalHashtagPlugin.prod.mjs +9 -0
- package/LexicalHistoryPlugin.d.ts +14 -0
- package/LexicalHistoryPlugin.dev.js +48 -0
- package/LexicalHistoryPlugin.dev.mjs +46 -0
- package/LexicalHistoryPlugin.js +11 -0
- package/LexicalHistoryPlugin.js.flow +28 -0
- package/LexicalHistoryPlugin.mjs +13 -0
- package/LexicalHistoryPlugin.node.mjs +11 -0
- package/LexicalHistoryPlugin.prod.js +9 -0
- package/LexicalHistoryPlugin.prod.mjs +9 -0
- package/LexicalHorizontalRuleNode.d.ts +25 -0
- package/LexicalHorizontalRuleNode.dev.js +102 -0
- package/LexicalHorizontalRuleNode.dev.mjs +98 -0
- package/LexicalHorizontalRuleNode.js +11 -0
- package/LexicalHorizontalRuleNode.js.flow +27 -0
- package/LexicalHorizontalRuleNode.mjs +15 -0
- package/LexicalHorizontalRuleNode.node.mjs +13 -0
- package/LexicalHorizontalRuleNode.prod.js +9 -0
- package/LexicalHorizontalRuleNode.prod.mjs +9 -0
- package/LexicalHorizontalRulePlugin.d.ts +8 -0
- package/LexicalHorizontalRulePlugin.dev.js +44 -0
- package/LexicalHorizontalRulePlugin.dev.mjs +42 -0
- package/LexicalHorizontalRulePlugin.js +11 -0
- package/LexicalHorizontalRulePlugin.js.flow +12 -0
- package/LexicalHorizontalRulePlugin.mjs +12 -0
- package/LexicalHorizontalRulePlugin.node.mjs +10 -0
- package/LexicalHorizontalRulePlugin.prod.js +9 -0
- package/LexicalHorizontalRulePlugin.prod.mjs +9 -0
- package/LexicalLinkPlugin.d.ts +14 -0
- package/LexicalLinkPlugin.dev.js +43 -0
- package/LexicalLinkPlugin.dev.mjs +41 -0
- package/LexicalLinkPlugin.js +11 -0
- package/LexicalLinkPlugin.js.flow +21 -0
- package/LexicalLinkPlugin.mjs +12 -0
- package/LexicalLinkPlugin.node.mjs +10 -0
- package/LexicalLinkPlugin.prod.js +9 -0
- package/LexicalLinkPlugin.prod.mjs +9 -0
- package/LexicalListPlugin.d.ts +20 -0
- package/LexicalListPlugin.dev.js +55 -0
- package/LexicalListPlugin.dev.mjs +53 -0
- package/LexicalListPlugin.js +11 -0
- package/LexicalListPlugin.js.flow +15 -0
- package/LexicalListPlugin.mjs +12 -0
- package/LexicalListPlugin.node.mjs +10 -0
- package/LexicalListPlugin.prod.js +9 -0
- package/LexicalListPlugin.prod.mjs +9 -0
- package/LexicalMarkdownShortcutPlugin.d.ts +12 -0
- package/LexicalMarkdownShortcutPlugin.dev.js +55 -0
- package/LexicalMarkdownShortcutPlugin.dev.mjs +52 -0
- package/LexicalMarkdownShortcutPlugin.js +11 -0
- package/LexicalMarkdownShortcutPlugin.js.flow +16 -0
- package/LexicalMarkdownShortcutPlugin.mjs +13 -0
- package/LexicalMarkdownShortcutPlugin.node.mjs +11 -0
- package/LexicalMarkdownShortcutPlugin.prod.js +9 -0
- package/LexicalMarkdownShortcutPlugin.prod.mjs +9 -0
- package/LexicalNestedComposer.d.ts +57 -0
- package/LexicalNestedComposer.dev.js +161 -0
- package/LexicalNestedComposer.dev.mjs +159 -0
- package/LexicalNestedComposer.js +11 -0
- package/LexicalNestedComposer.js.flow +26 -0
- package/LexicalNestedComposer.mjs +12 -0
- package/LexicalNestedComposer.node.mjs +10 -0
- package/LexicalNestedComposer.prod.js +9 -0
- package/LexicalNestedComposer.prod.mjs +9 -0
- package/LexicalNodeContextMenuPlugin.d.ts +46 -0
- package/LexicalNodeContextMenuPlugin.dev.js +257 -0
- package/LexicalNodeContextMenuPlugin.dev.mjs +253 -0
- package/LexicalNodeContextMenuPlugin.js +11 -0
- package/LexicalNodeContextMenuPlugin.js.flow +12 -0
- package/LexicalNodeContextMenuPlugin.mjs +14 -0
- package/LexicalNodeContextMenuPlugin.node.mjs +12 -0
- package/LexicalNodeContextMenuPlugin.prod.js +9 -0
- package/LexicalNodeContextMenuPlugin.prod.mjs +9 -0
- package/LexicalNodeEventPlugin.d.ts +13 -0
- package/LexicalNodeEventPlugin.dev.js +61 -0
- package/LexicalNodeEventPlugin.dev.mjs +59 -0
- package/LexicalNodeEventPlugin.js +11 -0
- package/LexicalNodeEventPlugin.js.flow +20 -0
- package/LexicalNodeEventPlugin.mjs +12 -0
- package/LexicalNodeEventPlugin.node.mjs +10 -0
- package/LexicalNodeEventPlugin.prod.js +9 -0
- package/LexicalNodeEventPlugin.prod.mjs +9 -0
- package/LexicalNodeMenuPlugin.d.ts +24 -0
- package/LexicalNodeMenuPlugin.dev.js +527 -0
- package/LexicalNodeMenuPlugin.dev.mjs +524 -0
- package/LexicalNodeMenuPlugin.js +11 -0
- package/LexicalNodeMenuPlugin.js.flow +64 -0
- package/LexicalNodeMenuPlugin.mjs +13 -0
- package/LexicalNodeMenuPlugin.node.mjs +11 -0
- package/LexicalNodeMenuPlugin.prod.js +9 -0
- package/LexicalNodeMenuPlugin.prod.mjs +9 -0
- package/LexicalOnChangePlugin.d.ts +13 -0
- package/LexicalOnChangePlugin.dev.js +72 -0
- package/LexicalOnChangePlugin.dev.mjs +70 -0
- package/LexicalOnChangePlugin.js +11 -0
- package/LexicalOnChangePlugin.js.flow +16 -0
- package/LexicalOnChangePlugin.mjs +12 -0
- package/LexicalOnChangePlugin.node.mjs +10 -0
- package/LexicalOnChangePlugin.prod.js +9 -0
- package/LexicalOnChangePlugin.prod.mjs +9 -0
- package/LexicalPlainTextPlugin.d.ts +14 -0
- package/LexicalPlainTextPlugin.dev.js +235 -0
- package/LexicalPlainTextPlugin.dev.mjs +233 -0
- package/LexicalPlainTextPlugin.js +11 -0
- package/LexicalPlainTextPlugin.js.flow +29 -0
- package/LexicalPlainTextPlugin.mjs +12 -0
- package/LexicalPlainTextPlugin.node.mjs +10 -0
- package/LexicalPlainTextPlugin.prod.js +9 -0
- package/LexicalPlainTextPlugin.prod.mjs +9 -0
- package/LexicalReactExtension.js.flow +68 -0
- package/LexicalReactPluginHostExtension.js.flow +84 -0
- package/LexicalReactProviderExtension.js.flow +12 -0
- package/LexicalRichTextPlugin.d.ts +14 -0
- package/LexicalRichTextPlugin.dev.js +235 -0
- package/LexicalRichTextPlugin.dev.mjs +233 -0
- package/LexicalRichTextPlugin.js +11 -0
- package/LexicalRichTextPlugin.js.flow +29 -0
- package/LexicalRichTextPlugin.mjs +12 -0
- package/LexicalRichTextPlugin.node.mjs +10 -0
- package/LexicalRichTextPlugin.prod.js +9 -0
- package/LexicalRichTextPlugin.prod.mjs +9 -0
- package/LexicalSelectionAlwaysOnDisplay.d.ts +12 -0
- package/LexicalSelectionAlwaysOnDisplay.dev.js +33 -0
- package/LexicalSelectionAlwaysOnDisplay.dev.mjs +31 -0
- package/LexicalSelectionAlwaysOnDisplay.js +11 -0
- package/LexicalSelectionAlwaysOnDisplay.js.flow +15 -0
- package/LexicalSelectionAlwaysOnDisplay.mjs +12 -0
- package/LexicalSelectionAlwaysOnDisplay.node.mjs +10 -0
- package/LexicalSelectionAlwaysOnDisplay.prod.js +9 -0
- package/LexicalSelectionAlwaysOnDisplay.prod.mjs +9 -0
- package/LexicalTabIndentationPlugin.d.ts +17 -0
- package/LexicalTabIndentationPlugin.dev.js +40 -0
- package/LexicalTabIndentationPlugin.dev.mjs +38 -0
- package/LexicalTabIndentationPlugin.js +11 -0
- package/LexicalTabIndentationPlugin.js.flow +21 -0
- package/LexicalTabIndentationPlugin.mjs +13 -0
- package/LexicalTabIndentationPlugin.node.mjs +11 -0
- package/LexicalTabIndentationPlugin.prod.js +9 -0
- package/LexicalTabIndentationPlugin.prod.mjs +9 -0
- package/LexicalTableOfContentsPlugin.d.ts +20 -0
- package/LexicalTableOfContentsPlugin.dev.js +209 -0
- package/LexicalTableOfContentsPlugin.dev.mjs +207 -0
- package/LexicalTableOfContentsPlugin.js +11 -0
- package/LexicalTableOfContentsPlugin.js.flow +18 -0
- package/LexicalTableOfContentsPlugin.mjs +12 -0
- package/LexicalTableOfContentsPlugin.node.mjs +10 -0
- package/LexicalTableOfContentsPlugin.prod.js +9 -0
- package/LexicalTableOfContentsPlugin.prod.mjs +9 -0
- package/LexicalTablePlugin.d.ts +46 -0
- package/LexicalTablePlugin.dev.js +81 -0
- package/LexicalTablePlugin.dev.mjs +79 -0
- package/LexicalTablePlugin.js +11 -0
- package/LexicalTablePlugin.js.flow +15 -0
- package/LexicalTablePlugin.mjs +12 -0
- package/LexicalTablePlugin.node.mjs +10 -0
- package/LexicalTablePlugin.prod.js +9 -0
- package/LexicalTablePlugin.prod.mjs +9 -0
- package/LexicalTreeView.d.ts +37 -0
- package/LexicalTreeView.dev.js +105 -0
- package/LexicalTreeView.dev.mjs +91 -0
- package/LexicalTreeView.js +11 -0
- package/LexicalTreeView.js.flow +21 -0
- package/LexicalTreeView.mjs +12 -0
- package/LexicalTreeView.node.mjs +10 -0
- package/LexicalTreeView.prod.js +9 -0
- package/LexicalTreeView.prod.mjs +9 -0
- package/LexicalTreeViewExtension.js.flow +12 -0
- package/LexicalTypeaheadMenuPlugin.d.ts +40 -0
- package/LexicalTypeaheadMenuPlugin.dev.js +654 -0
- package/LexicalTypeaheadMenuPlugin.dev.mjs +646 -0
- package/LexicalTypeaheadMenuPlugin.js +11 -0
- package/LexicalTypeaheadMenuPlugin.js.flow +83 -0
- package/LexicalTypeaheadMenuPlugin.mjs +18 -0
- package/LexicalTypeaheadMenuPlugin.node.mjs +16 -0
- package/LexicalTypeaheadMenuPlugin.prod.js +9 -0
- package/LexicalTypeaheadMenuPlugin.prod.mjs +9 -0
- package/README.md +90 -0
- package/ReactExtension.d.ts +41 -0
- package/ReactPluginHostExtension.d.ts +56 -0
- package/ReactProviderExtension.d.ts +9 -0
- package/TreeViewExtension.d.ts +18 -0
- package/package.json +1549 -0
- package/shared/LegacyDecorators.d.ts +23 -0
- package/shared/LexicalContentEditableElement.d.ts +43 -0
- package/shared/LexicalMenu.d.ts +52 -0
- package/shared/buildEditorComponent.d.ts +11 -0
- package/shared/mergeRefs.d.ts +9 -0
- package/shared/point.d.ts +21 -0
- package/shared/rect.d.ts +45 -0
- package/shared/types.d.ts +89 -0
- package/shared/useCanShowPlaceholder.d.ts +9 -0
- package/shared/useCharacterLimit.d.ts +16 -0
- package/shared/useDecorators.d.ts +17 -0
- package/shared/useHistory.d.ts +10 -0
- package/shared/useList.d.ts +9 -0
- package/shared/usePlainTextSetup.d.ts +9 -0
- package/shared/useReactDecorators.d.ts +12 -0
- package/shared/useRichTextSetup.d.ts +9 -0
- package/shared/useYjsCollaboration.d.ts +25 -0
- package/useExtensionComponent.d.ts +10 -0
- package/useLexicalEditable.d.ts +16 -0
- package/useLexicalEditable.dev.js +102 -0
- package/useLexicalEditable.dev.mjs +100 -0
- package/useLexicalEditable.js +11 -0
- package/useLexicalEditable.js.flow +12 -0
- package/useLexicalEditable.mjs +12 -0
- package/useLexicalEditable.node.mjs +10 -0
- package/useLexicalEditable.prod.js +9 -0
- package/useLexicalEditable.prod.mjs +9 -0
- package/useLexicalExtensionComponent.dev.js +37 -0
- package/useLexicalExtensionComponent.dev.mjs +34 -0
- package/useLexicalExtensionComponent.js +11 -0
- package/useLexicalExtensionComponent.js.flow +12 -0
- package/useLexicalExtensionComponent.mjs +13 -0
- package/useLexicalExtensionComponent.node.mjs +11 -0
- package/useLexicalExtensionComponent.prod.js +9 -0
- package/useLexicalExtensionComponent.prod.mjs +9 -0
- package/useLexicalIsTextContentEmpty.d.ts +9 -0
- package/useLexicalIsTextContentEmpty.dev.js +60 -0
- package/useLexicalIsTextContentEmpty.dev.mjs +58 -0
- package/useLexicalIsTextContentEmpty.js +11 -0
- package/useLexicalIsTextContentEmpty.js.flow +15 -0
- package/useLexicalIsTextContentEmpty.mjs +12 -0
- package/useLexicalIsTextContentEmpty.node.mjs +10 -0
- package/useLexicalIsTextContentEmpty.prod.js +9 -0
- package/useLexicalIsTextContentEmpty.prod.mjs +9 -0
- package/useLexicalNodeSelection.d.ts +24 -0
- package/useLexicalNodeSelection.dev.js +102 -0
- package/useLexicalNodeSelection.dev.mjs +100 -0
- package/useLexicalNodeSelection.js +11 -0
- package/useLexicalNodeSelection.js.flow +14 -0
- package/useLexicalNodeSelection.mjs +12 -0
- package/useLexicalNodeSelection.node.mjs +10 -0
- package/useLexicalNodeSelection.prod.js +9 -0
- package/useLexicalNodeSelection.prod.mjs +9 -0
- package/useLexicalSubscription.d.ts +17 -0
- package/useLexicalSubscription.dev.js +73 -0
- package/useLexicalSubscription.dev.mjs +71 -0
- package/useLexicalSubscription.js +11 -0
- package/useLexicalSubscription.js.flow +19 -0
- package/useLexicalSubscription.mjs +12 -0
- package/useLexicalSubscription.node.mjs +10 -0
- package/useLexicalSubscription.prod.js +9 -0
- package/useLexicalSubscription.prod.mjs +9 -0
- package/useLexicalTextEntity.d.ts +10 -0
- package/useLexicalTextEntity.dev.js +31 -0
- package/useLexicalTextEntity.dev.mjs +29 -0
- package/useLexicalTextEntity.js +11 -0
- package/useLexicalTextEntity.js.flow +18 -0
- package/useLexicalTextEntity.mjs +12 -0
- package/useLexicalTextEntity.node.mjs +10 -0
- package/useLexicalTextEntity.prod.js +9 -0
- package/useLexicalTextEntity.prod.mjs +9 -0
|
@@ -0,0 +1,253 @@
|
|
|
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
|
+
|
|
9
|
+
import { useFloating, autoUpdate, offset, flip, shift, useRole, useDismiss, useListNavigation, useTypeahead, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager } from '@floating-ui/react';
|
|
10
|
+
import { useLexicalComposerContext } from '@ekz/lexical-react/LexicalComposerContext';
|
|
11
|
+
import { $getNearestNodeFromDOMNode } from '@ekz/lexical';
|
|
12
|
+
import { forwardRef, useState, useRef, useEffect, createElement } from 'react';
|
|
13
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the MIT license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
class MenuOption {
|
|
24
|
+
key;
|
|
25
|
+
ref;
|
|
26
|
+
constructor(key) {
|
|
27
|
+
this.key = key;
|
|
28
|
+
this.ref = {
|
|
29
|
+
current: null
|
|
30
|
+
};
|
|
31
|
+
this.setRefElement = this.setRefElement.bind(this);
|
|
32
|
+
}
|
|
33
|
+
setRefElement(element) {
|
|
34
|
+
this.ref = {
|
|
35
|
+
current: element
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class NodeContextMenuOption extends MenuOption {
|
|
40
|
+
type;
|
|
41
|
+
title;
|
|
42
|
+
icon;
|
|
43
|
+
disabled;
|
|
44
|
+
$onSelect;
|
|
45
|
+
$showOn;
|
|
46
|
+
constructor(title, options) {
|
|
47
|
+
super(title);
|
|
48
|
+
this.type = 'item';
|
|
49
|
+
this.title = title;
|
|
50
|
+
this.disabled = options.disabled ?? false;
|
|
51
|
+
this.icon = options.icon ?? null;
|
|
52
|
+
this.$onSelect = options.$onSelect;
|
|
53
|
+
if (options.$showOn) {
|
|
54
|
+
this.$showOn = options.$showOn;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
class NodeContextMenuSeparator extends MenuOption {
|
|
59
|
+
type;
|
|
60
|
+
$showOn;
|
|
61
|
+
constructor(options) {
|
|
62
|
+
super('_separator');
|
|
63
|
+
this.type = 'separator';
|
|
64
|
+
if (options && options.$showOn) {
|
|
65
|
+
this.$showOn = options.$showOn;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const ContextMenuSeparatorItem = /*#__PURE__*/forwardRef(({
|
|
70
|
+
className,
|
|
71
|
+
disabled,
|
|
72
|
+
...props
|
|
73
|
+
}, ref) => {
|
|
74
|
+
return /*#__PURE__*/jsx("hr", {
|
|
75
|
+
className: className
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
const ContextMenuItem = /*#__PURE__*/forwardRef(({
|
|
79
|
+
className,
|
|
80
|
+
label,
|
|
81
|
+
disabled,
|
|
82
|
+
icon,
|
|
83
|
+
...props
|
|
84
|
+
}, ref) => {
|
|
85
|
+
return /*#__PURE__*/jsxs("button", {
|
|
86
|
+
...props,
|
|
87
|
+
className: className,
|
|
88
|
+
ref: ref,
|
|
89
|
+
role: "menuitem",
|
|
90
|
+
disabled: disabled,
|
|
91
|
+
children: [icon, label]
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
const NodeContextMenuPlugin = /*#__PURE__*/forwardRef(({
|
|
95
|
+
items,
|
|
96
|
+
className,
|
|
97
|
+
itemClassName,
|
|
98
|
+
separatorClassName
|
|
99
|
+
}, forwardedRef) => {
|
|
100
|
+
const [editor] = useLexicalComposerContext();
|
|
101
|
+
const [activeIndex, setActiveIndex] = useState(null);
|
|
102
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
103
|
+
const listItemsRef = useRef([]);
|
|
104
|
+
const listContentRef = useRef([]);
|
|
105
|
+
const {
|
|
106
|
+
refs,
|
|
107
|
+
floatingStyles,
|
|
108
|
+
context
|
|
109
|
+
} = useFloating({
|
|
110
|
+
middleware: [offset({
|
|
111
|
+
alignmentAxis: 4,
|
|
112
|
+
mainAxis: 5
|
|
113
|
+
}), flip({
|
|
114
|
+
fallbackPlacements: ['left-start']
|
|
115
|
+
}), shift({
|
|
116
|
+
padding: 10
|
|
117
|
+
})],
|
|
118
|
+
onOpenChange: setIsOpen,
|
|
119
|
+
open: isOpen,
|
|
120
|
+
placement: 'right-start',
|
|
121
|
+
strategy: 'fixed',
|
|
122
|
+
whileElementsMounted: autoUpdate
|
|
123
|
+
});
|
|
124
|
+
const role = useRole(context, {
|
|
125
|
+
role: 'menu'
|
|
126
|
+
});
|
|
127
|
+
const dismiss = useDismiss(context);
|
|
128
|
+
const listNavigation = useListNavigation(context, {
|
|
129
|
+
activeIndex,
|
|
130
|
+
listRef: listItemsRef,
|
|
131
|
+
onNavigate: setActiveIndex
|
|
132
|
+
});
|
|
133
|
+
const typeahead = useTypeahead(context, {
|
|
134
|
+
activeIndex,
|
|
135
|
+
enabled: isOpen,
|
|
136
|
+
listRef: listContentRef,
|
|
137
|
+
onMatch: setActiveIndex
|
|
138
|
+
});
|
|
139
|
+
const {
|
|
140
|
+
getFloatingProps,
|
|
141
|
+
getItemProps
|
|
142
|
+
} = useInteractions([role, dismiss, listNavigation, typeahead]);
|
|
143
|
+
const [renderItems, setRenderItems] = useState([]);
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
function onContextMenu(e) {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
refs.setPositionReference({
|
|
148
|
+
getBoundingClientRect() {
|
|
149
|
+
return {
|
|
150
|
+
bottom: e.clientY,
|
|
151
|
+
height: 0,
|
|
152
|
+
left: e.clientX,
|
|
153
|
+
right: e.clientX,
|
|
154
|
+
top: e.clientY,
|
|
155
|
+
width: 0,
|
|
156
|
+
x: e.clientX,
|
|
157
|
+
y: e.clientY
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
let visibleItems = [];
|
|
162
|
+
if (items) {
|
|
163
|
+
editor.read(() => {
|
|
164
|
+
const node = $getNearestNodeFromDOMNode(e.target);
|
|
165
|
+
if (node) {
|
|
166
|
+
visibleItems = items.filter(option => option.$showOn ? option.$showOn(node) : true);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
const renderableItems = visibleItems.map((option, index) => {
|
|
171
|
+
if (option.type === 'separator') {
|
|
172
|
+
return {
|
|
173
|
+
className: separatorClassName,
|
|
174
|
+
key: option.key + '-' + index,
|
|
175
|
+
type: option.type
|
|
176
|
+
};
|
|
177
|
+
} else {
|
|
178
|
+
return {
|
|
179
|
+
className: itemClassName,
|
|
180
|
+
disabled: option.disabled,
|
|
181
|
+
icon: option.icon,
|
|
182
|
+
key: option.key,
|
|
183
|
+
label: option.title,
|
|
184
|
+
onClick: () => editor.update(() => option.$onSelect()),
|
|
185
|
+
title: option.title,
|
|
186
|
+
type: option.type
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
listContentRef.current = renderableItems.map(item => item.key);
|
|
191
|
+
setRenderItems(renderableItems);
|
|
192
|
+
setIsOpen(true);
|
|
193
|
+
}
|
|
194
|
+
return editor.registerRootListener((rootElement, prevRootElement) => {
|
|
195
|
+
if (prevRootElement !== null) {
|
|
196
|
+
prevRootElement.removeEventListener('contextmenu', onContextMenu);
|
|
197
|
+
}
|
|
198
|
+
if (rootElement !== null) {
|
|
199
|
+
rootElement.addEventListener('contextmenu', onContextMenu);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}, [items, itemClassName, separatorClassName, refs, editor]);
|
|
203
|
+
return /*#__PURE__*/jsx(FloatingPortal, {
|
|
204
|
+
children: isOpen && /*#__PURE__*/jsx(FloatingOverlay, {
|
|
205
|
+
lockScroll: true,
|
|
206
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
207
|
+
context: context,
|
|
208
|
+
initialFocus: refs.floating,
|
|
209
|
+
children: /*#__PURE__*/jsx("div", {
|
|
210
|
+
className: className,
|
|
211
|
+
ref: refs.setFloating,
|
|
212
|
+
style: floatingStyles,
|
|
213
|
+
...getFloatingProps(),
|
|
214
|
+
children: renderItems.map((item, index) => {
|
|
215
|
+
if (item.type === 'item') {
|
|
216
|
+
return /*#__PURE__*/createElement(ContextMenuItem, {
|
|
217
|
+
...getItemProps({
|
|
218
|
+
...item,
|
|
219
|
+
onClick() {
|
|
220
|
+
item.onClick();
|
|
221
|
+
setIsOpen(false);
|
|
222
|
+
},
|
|
223
|
+
onMouseUp() {
|
|
224
|
+
item.onClick();
|
|
225
|
+
setIsOpen(false);
|
|
226
|
+
},
|
|
227
|
+
ref(node) {
|
|
228
|
+
listItemsRef.current[index] = node;
|
|
229
|
+
},
|
|
230
|
+
tabIndex: activeIndex === index ? 0 : -1
|
|
231
|
+
}),
|
|
232
|
+
key: item.key
|
|
233
|
+
});
|
|
234
|
+
} else if (item.type === 'separator') {
|
|
235
|
+
return /*#__PURE__*/createElement(ContextMenuSeparatorItem, {
|
|
236
|
+
...getItemProps({
|
|
237
|
+
...item,
|
|
238
|
+
ref(node) {
|
|
239
|
+
listItemsRef.current[index] = node;
|
|
240
|
+
},
|
|
241
|
+
tabIndex: activeIndex === index ? 0 : -1
|
|
242
|
+
}),
|
|
243
|
+
key: item.key
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
export { NodeContextMenuOption, NodeContextMenuPlugin, NodeContextMenuSeparator };
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalNodeContextMenuPlugin = process.env.NODE_ENV !== 'production' ? require('./LexicalNodeContextMenuPlugin.dev.js') : require('./LexicalNodeContextMenuPlugin.prod.js');
|
|
11
|
+
module.exports = LexicalNodeContextMenuPlugin;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* LexicalNodeContextMenuPlugin
|
|
12
|
+
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
|
|
9
|
+
import * as modDev from './LexicalNodeContextMenuPlugin.dev.mjs';
|
|
10
|
+
import * as modProd from './LexicalNodeContextMenuPlugin.prod.mjs';
|
|
11
|
+
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
12
|
+
export const NodeContextMenuOption = mod.NodeContextMenuOption;
|
|
13
|
+
export const NodeContextMenuPlugin = mod.NodeContextMenuPlugin;
|
|
14
|
+
export const NodeContextMenuSeparator = mod.NodeContextMenuSeparator;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalNodeContextMenuPlugin.dev.mjs') : import('./LexicalNodeContextMenuPlugin.prod.mjs'));
|
|
10
|
+
export const NodeContextMenuOption = mod.NodeContextMenuOption;
|
|
11
|
+
export const NodeContextMenuPlugin = mod.NodeContextMenuPlugin;
|
|
12
|
+
export const NodeContextMenuSeparator = mod.NodeContextMenuSeparator;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
|
|
9
|
+
"use strict";var e=require("@floating-ui/react"),t=require("@ekz/lexical-react/LexicalComposerContext"),s=require("@ekz/lexical"),n=require("react"),i=require("react/jsx-runtime");class a{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const l=n.forwardRef(({className:e,disabled:t,...s},n)=>i.jsx("hr",{className:e})),o=n.forwardRef(({className:e,label:t,disabled:s,icon:n,...a},l)=>i.jsxs("button",{...a,className:e,ref:l,role:"menuitem",disabled:s,children:[n,t]})),r=n.forwardRef(({items:a,className:r,itemClassName:c,separatorClassName:u},d)=>{const[m]=t.useLexicalComposerContext(),[p,h]=n.useState(null),[f,x]=n.useState(!1),y=n.useRef([]),g=n.useRef([]),{refs:k,floatingStyles:N,context:b}=e.useFloating({middleware:[e.offset({alignmentAxis:4,mainAxis:5}),e.flip({fallbackPlacements:["left-start"]}),e.shift({padding:10})],onOpenChange:x,open:f,placement:"right-start",strategy:"fixed",whileElementsMounted:e.autoUpdate}),w=e.useRole(b,{role:"menu"}),C=e.useDismiss(b),$=e.useListNavigation(b,{activeIndex:p,listRef:y,onNavigate:h}),O=e.useTypeahead(b,{activeIndex:p,enabled:f,listRef:g,onMatch:h}),{getFloatingProps:R,getItemProps:v}=e.useInteractions([w,C,$,O]),[S,E]=n.useState([]);return n.useEffect(()=>{function e(e){e.preventDefault(),k.setPositionReference({getBoundingClientRect:()=>({bottom:e.clientY,height:0,left:e.clientX,right:e.clientX,top:e.clientY,width:0,x:e.clientX,y:e.clientY})});let t=[];a&&m.read(()=>{const n=s.$getNearestNodeFromDOMNode(e.target);n&&(t=a.filter(e=>!e.$showOn||e.$showOn(n)))});const n=t.map((e,t)=>"separator"===e.type?{className:u,key:e.key+"-"+t,type:e.type}:{className:c,disabled:e.disabled,icon:e.icon,key:e.key,label:e.title,onClick:()=>m.update(()=>e.$onSelect()),title:e.title,type:e.type});g.current=n.map(e=>e.key),E(n),x(!0)}return m.registerRootListener((t,s)=>{null!==s&&s.removeEventListener("contextmenu",e),null!==t&&t.addEventListener("contextmenu",e)})},[a,c,u,k,m]),i.jsx(e.FloatingPortal,{children:f&&i.jsx(e.FloatingOverlay,{lockScroll:!0,children:i.jsx(e.FloatingFocusManager,{context:b,initialFocus:k.floating,children:i.jsx("div",{className:r,ref:k.setFloating,style:N,...R(),children:S.map((e,t)=>"item"===e.type?n.createElement(o,{...v({...e,onClick(){e.onClick(),x(!1)},onMouseUp(){e.onClick(),x(!1)},ref(e){y.current[t]=e},tabIndex:p===t?0:-1}),key:e.key}):"separator"===e.type?n.createElement(l,{...v({...e,ref(e){y.current[t]=e},tabIndex:p===t?0:-1}),key:e.key}):void 0)})})})})});exports.NodeContextMenuOption=class extends a{type;title;icon;disabled;$onSelect;$showOn;constructor(e,t){super(e),this.type="item",this.title=e,this.disabled=t.disabled??!1,this.icon=t.icon??null,this.$onSelect=t.$onSelect,t.$showOn&&(this.$showOn=t.$showOn)}},exports.NodeContextMenuPlugin=r,exports.NodeContextMenuSeparator=class extends a{type;$showOn;constructor(e){super("_separator"),this.type="separator",e&&e.$showOn&&(this.$showOn=e.$showOn)}};
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
|
|
9
|
+
import{useFloating as e,autoUpdate as t,offset as n,flip as s,shift as i,useRole as l,useDismiss as o,useListNavigation as r,useTypeahead as a,useInteractions as c,FloatingPortal as m,FloatingOverlay as d,FloatingFocusManager as h}from"@floating-ui/react";import{useLexicalComposerContext as p}from"@ekz/lexical-react/LexicalComposerContext";import{$getNearestNodeFromDOMNode as u}from"@ekz/lexical";import{forwardRef as f,useState as y,useRef as x,useEffect as g,createElement as k}from"react";import{jsx as b,jsxs as $}from"react/jsx-runtime";class w{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}class N extends w{type;title;icon;disabled;$onSelect;$showOn;constructor(e,t){super(e),this.type="item",this.title=e,this.disabled=t.disabled??!1,this.icon=t.icon??null,this.$onSelect=t.$onSelect,t.$showOn&&(this.$showOn=t.$showOn)}}class O extends w{type;$showOn;constructor(e){super("_separator"),this.type="separator",e&&e.$showOn&&(this.$showOn=e.$showOn)}}const C=f(({className:e,disabled:t,...n},s)=>b("hr",{className:e})),v=f(({className:e,label:t,disabled:n,icon:s,...i},l)=>$("button",{...i,className:e,ref:l,role:"menuitem",disabled:n,children:[s,t]})),R=f(({items:f,className:$,itemClassName:w,separatorClassName:N},O)=>{const[R]=p(),[E,S]=y(null),[I,L]=y(!1),P=x([]),F=x([]),{refs:M,floatingStyles:X,context:Y}=e({middleware:[n({alignmentAxis:4,mainAxis:5}),s({fallbackPlacements:["left-start"]}),i({padding:10})],onOpenChange:L,open:I,placement:"right-start",strategy:"fixed",whileElementsMounted:t}),z=l(Y,{role:"menu"}),A=o(Y),j=r(Y,{activeIndex:E,listRef:P,onNavigate:S}),B=a(Y,{activeIndex:E,enabled:I,listRef:F,onMatch:S}),{getFloatingProps:D,getItemProps:U}=c([z,A,j,B]),[_,q]=y([]);return g(()=>{function e(e){e.preventDefault(),M.setPositionReference({getBoundingClientRect:()=>({bottom:e.clientY,height:0,left:e.clientX,right:e.clientX,top:e.clientY,width:0,x:e.clientX,y:e.clientY})});let t=[];f&&R.read(()=>{const n=u(e.target);n&&(t=f.filter(e=>!e.$showOn||e.$showOn(n)))});const n=t.map((e,t)=>"separator"===e.type?{className:N,key:e.key+"-"+t,type:e.type}:{className:w,disabled:e.disabled,icon:e.icon,key:e.key,label:e.title,onClick:()=>R.update(()=>e.$onSelect()),title:e.title,type:e.type});F.current=n.map(e=>e.key),q(n),L(!0)}return R.registerRootListener((t,n)=>{null!==n&&n.removeEventListener("contextmenu",e),null!==t&&t.addEventListener("contextmenu",e)})},[f,w,N,M,R]),b(m,{children:I&&b(d,{lockScroll:!0,children:b(h,{context:Y,initialFocus:M.floating,children:b("div",{className:$,ref:M.setFloating,style:X,...D(),children:_.map((e,t)=>"item"===e.type?k(v,{...U({...e,onClick(){e.onClick(),L(!1)},onMouseUp(){e.onClick(),L(!1)},ref(e){P.current[t]=e},tabIndex:E===t?0:-1}),key:e.key}):"separator"===e.type?k(C,{...U({...e,ref(e){P.current[t]=e},tabIndex:E===t?0:-1}),key:e.key}):void 0)})})})})});export{N as NodeContextMenuOption,R as NodeContextMenuPlugin,O as NodeContextMenuSeparator};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 { Klass, LexicalEditor, LexicalNode, NodeKey } from '@ekz/lexical';
|
|
9
|
+
export declare function NodeEventPlugin({ nodeType, eventType, eventListener, }: {
|
|
10
|
+
nodeType: Klass<LexicalNode>;
|
|
11
|
+
eventType: string;
|
|
12
|
+
eventListener: (event: Event, editor: LexicalEditor, nodeKey: NodeKey) => void;
|
|
13
|
+
}): null;
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
var LexicalComposerContext = require('@ekz/lexical-react/LexicalComposerContext');
|
|
12
|
+
var lexicalUtils = require('@ekz/lexical-utils');
|
|
13
|
+
var lexical = require('@ekz/lexical');
|
|
14
|
+
var react = require('react');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const capturedEvents = new Set(['mouseenter', 'mouseleave']);
|
|
25
|
+
function NodeEventPlugin({
|
|
26
|
+
nodeType,
|
|
27
|
+
eventType,
|
|
28
|
+
eventListener
|
|
29
|
+
}) {
|
|
30
|
+
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
31
|
+
const listenerRef = react.useRef(eventListener);
|
|
32
|
+
listenerRef.current = eventListener;
|
|
33
|
+
react.useEffect(() => {
|
|
34
|
+
const isCaptured = capturedEvents.has(eventType);
|
|
35
|
+
const onEvent = event => {
|
|
36
|
+
editor.update(() => {
|
|
37
|
+
const nearestNode = lexical.$getNearestNodeFromDOMNode(event.target);
|
|
38
|
+
if (nearestNode !== null) {
|
|
39
|
+
const targetNode = isCaptured ? nearestNode instanceof nodeType ? nearestNode : null : lexicalUtils.$findMatchingParent(nearestNode, node => node instanceof nodeType);
|
|
40
|
+
if (targetNode !== null) {
|
|
41
|
+
listenerRef.current(event, editor, targetNode.getKey());
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
return editor.registerRootListener((rootElement, prevRootElement) => {
|
|
48
|
+
if (rootElement) {
|
|
49
|
+
rootElement.addEventListener(eventType, onEvent, isCaptured);
|
|
50
|
+
}
|
|
51
|
+
if (prevRootElement) {
|
|
52
|
+
prevRootElement.removeEventListener(eventType, onEvent, isCaptured);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
// We intentionally don't respect changes to eventType.
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
}, [editor, nodeType]);
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
exports.NodeEventPlugin = NodeEventPlugin;
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
|
|
9
|
+
import { useLexicalComposerContext } from '@ekz/lexical-react/LexicalComposerContext';
|
|
10
|
+
import { $findMatchingParent } from '@ekz/lexical-utils';
|
|
11
|
+
import { $getNearestNodeFromDOMNode } from '@ekz/lexical';
|
|
12
|
+
import { useRef, useEffect } from 'react';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const capturedEvents = new Set(['mouseenter', 'mouseleave']);
|
|
23
|
+
function NodeEventPlugin({
|
|
24
|
+
nodeType,
|
|
25
|
+
eventType,
|
|
26
|
+
eventListener
|
|
27
|
+
}) {
|
|
28
|
+
const [editor] = useLexicalComposerContext();
|
|
29
|
+
const listenerRef = useRef(eventListener);
|
|
30
|
+
listenerRef.current = eventListener;
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const isCaptured = capturedEvents.has(eventType);
|
|
33
|
+
const onEvent = event => {
|
|
34
|
+
editor.update(() => {
|
|
35
|
+
const nearestNode = $getNearestNodeFromDOMNode(event.target);
|
|
36
|
+
if (nearestNode !== null) {
|
|
37
|
+
const targetNode = isCaptured ? nearestNode instanceof nodeType ? nearestNode : null : $findMatchingParent(nearestNode, node => node instanceof nodeType);
|
|
38
|
+
if (targetNode !== null) {
|
|
39
|
+
listenerRef.current(event, editor, targetNode.getKey());
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
return editor.registerRootListener((rootElement, prevRootElement) => {
|
|
46
|
+
if (rootElement) {
|
|
47
|
+
rootElement.addEventListener(eventType, onEvent, isCaptured);
|
|
48
|
+
}
|
|
49
|
+
if (prevRootElement) {
|
|
50
|
+
prevRootElement.removeEventListener(eventType, onEvent, isCaptured);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
// We intentionally don't respect changes to eventType.
|
|
54
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
+
}, [editor, nodeType]);
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { NodeEventPlugin };
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
const LexicalNodeEventPlugin = process.env.NODE_ENV !== 'production' ? require('./LexicalNodeEventPlugin.dev.js') : require('./LexicalNodeEventPlugin.prod.js');
|
|
11
|
+
module.exports = LexicalNodeEventPlugin;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type {LexicalEditor, LexicalNode, NodeKey} from '@ekz/lexical';
|
|
11
|
+
|
|
12
|
+
declare export function NodeEventPlugin({
|
|
13
|
+
nodeType: Class<LexicalNode>;
|
|
14
|
+
eventType: string;
|
|
15
|
+
eventListener: (
|
|
16
|
+
event: Event,
|
|
17
|
+
editor: LexicalEditor,
|
|
18
|
+
nodeKey: NodeKey,
|
|
19
|
+
) => void;
|
|
20
|
+
}): null;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
|
|
9
|
+
import * as modDev from './LexicalNodeEventPlugin.dev.mjs';
|
|
10
|
+
import * as modProd from './LexicalNodeEventPlugin.prod.mjs';
|
|
11
|
+
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
12
|
+
export const NodeEventPlugin = mod.NodeEventPlugin;
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
|
|
9
|
+
const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalNodeEventPlugin.dev.mjs') : import('./LexicalNodeEventPlugin.prod.mjs'));
|
|
10
|
+
export const NodeEventPlugin = mod.NodeEventPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
|
|
9
|
+
"use strict";var e=require("@ekz/lexical-react/LexicalComposerContext"),t=require("@ekz/lexical-utils"),n=require("@ekz/lexical"),r=require("react");const o=new Set(["mouseenter","mouseleave"]);exports.NodeEventPlugin=function({nodeType:i,eventType:s,eventListener:u}){const[c]=e.useLexicalComposerContext(),l=r.useRef(u);return l.current=u,r.useEffect(()=>{const e=o.has(s),r=r=>{c.update(()=>{const o=n.$getNearestNodeFromDOMNode(r.target);if(null!==o){const n=e?o instanceof i?o:null:t.$findMatchingParent(o,e=>e instanceof i);if(null!==n)return void l.current(r,c,n.getKey())}})};return c.registerRootListener((t,n)=>{t&&t.addEventListener(s,r,e),n&&n.removeEventListener(s,r,e)})},[c,i]),null};
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
|
|
9
|
+
import{useLexicalComposerContext as e}from"@ekz/lexical-react/LexicalComposerContext";import{$findMatchingParent as t}from"@ekz/lexical-utils";import{$getNearestNodeFromDOMNode as n}from"@ekz/lexical";import{useRef as r,useEffect as o}from"react";const i=new Set(["mouseenter","mouseleave"]);function l({nodeType:l,eventType:s,eventListener:c}){const[u]=e(),a=r(c);return a.current=c,o(()=>{const e=i.has(s),r=r=>{u.update(()=>{const o=n(r.target);if(null!==o){const n=e?o instanceof l?o:null:t(o,e=>e instanceof l);if(null!==n)return void a.current(r,u,n.getKey())}})};return u.registerRootListener((t,n)=>{t&&t.addEventListener(s,r,e),n&&n.removeEventListener(s,r,e)})},[u,l]),null}export{l as NodeEventPlugin};
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { MenuRenderFn, MenuResolution } from './shared/LexicalMenu';
|
|
9
|
+
import type { JSX } from 'react';
|
|
10
|
+
import { CommandListenerPriority, NodeKey, TextNode } from '@ekz/lexical';
|
|
11
|
+
import { MenuOption } from './shared/LexicalMenu';
|
|
12
|
+
export type NodeMenuPluginProps<TOption extends MenuOption> = {
|
|
13
|
+
onSelectOption: (option: TOption, textNodeContainingQuery: TextNode | null, closeMenu: () => void, matchingString: string) => void;
|
|
14
|
+
options: Array<TOption>;
|
|
15
|
+
nodeKey: NodeKey | null;
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
onOpen?: (resolution: MenuResolution) => void;
|
|
18
|
+
menuRenderFn: MenuRenderFn<TOption>;
|
|
19
|
+
anchorClassName?: string;
|
|
20
|
+
commandPriority?: CommandListenerPriority;
|
|
21
|
+
parent?: HTMLElement;
|
|
22
|
+
};
|
|
23
|
+
export declare function LexicalNodeMenuPlugin<TOption extends MenuOption>({ options, nodeKey, onClose, onOpen, onSelectOption, menuRenderFn, anchorClassName, commandPriority, parent, }: NodeMenuPluginProps<TOption>): JSX.Element | null;
|
|
24
|
+
export { MenuOption, MenuRenderFn, MenuResolution };
|