@lexical/react 0.14.2 → 0.14.3
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/{LexicalAutoEmbedPlugin.esm.js → LexicalAutoEmbedPlugin.mjs} +2 -2
- package/LexicalAutoEmbedPlugin.node.mjs +11 -0
- package/{LexicalHashtagPlugin.esm.js → LexicalAutoFocusPlugin.mjs} +3 -3
- package/LexicalAutoFocusPlugin.node.mjs +8 -0
- package/{LexicalAutoLinkPlugin.esm.js → LexicalAutoLinkPlugin.mjs} +2 -2
- package/LexicalAutoLinkPlugin.node.mjs +9 -0
- package/{LexicalBlockWithAlignableContents.esm.js → LexicalBlockWithAlignableContents.mjs} +2 -2
- package/LexicalBlockWithAlignableContents.node.mjs +8 -0
- package/{LexicalClearEditorPlugin.esm.js → LexicalCharacterLimitPlugin.mjs} +3 -3
- package/LexicalCharacterLimitPlugin.node.mjs +8 -0
- package/LexicalCheckListPlugin.dev.js +1 -1
- package/{LexicalCheckListPlugin.dev.esm.js → LexicalCheckListPlugin.dev.mjs} +2 -2
- package/LexicalCheckListPlugin.mjs +10 -0
- package/LexicalCheckListPlugin.node.mjs +8 -0
- package/LexicalCheckListPlugin.prod.js +1 -1
- package/LexicalCheckListPlugin.prod.mjs +7 -0
- package/{LexicalCheckListPlugin.esm.js → LexicalClearEditorPlugin.mjs} +3 -3
- package/LexicalClearEditorPlugin.node.mjs +8 -0
- package/LexicalClickableLinkPlugin.d.ts +2 -1
- package/LexicalClickableLinkPlugin.dev.js +8 -3
- package/{LexicalClickableLinkPlugin.dev.esm.js → LexicalClickableLinkPlugin.dev.mjs} +8 -3
- package/LexicalClickableLinkPlugin.mjs +10 -0
- package/LexicalClickableLinkPlugin.node.mjs +8 -0
- package/LexicalClickableLinkPlugin.prod.js +4 -3
- package/LexicalClickableLinkPlugin.prod.mjs +7 -0
- package/{LexicalCollaborationContext.esm.js → LexicalCollaborationContext.mjs} +2 -2
- package/LexicalCollaborationContext.node.mjs +9 -0
- package/LexicalCollaborationPlugin.mjs +10 -0
- package/LexicalCollaborationPlugin.node.mjs +8 -0
- package/{LexicalListPlugin.esm.js → LexicalComposer.mjs} +3 -3
- package/LexicalComposer.node.mjs +8 -0
- package/{LexicalComposerContext.esm.js → LexicalComposerContext.mjs} +2 -2
- package/LexicalComposerContext.node.mjs +10 -0
- package/LexicalContentEditable.mjs +10 -0
- package/LexicalContentEditable.node.mjs +8 -0
- package/LexicalContextMenuPlugin.d.ts +2 -1
- package/LexicalContextMenuPlugin.dev.js +9 -4
- package/{LexicalContextMenuPlugin.dev.esm.js → LexicalContextMenuPlugin.dev.mjs} +9 -4
- package/{LexicalContextMenuPlugin.esm.js → LexicalContextMenuPlugin.mjs} +2 -2
- package/LexicalContextMenuPlugin.node.mjs +9 -0
- package/LexicalContextMenuPlugin.prod.js +16 -16
- package/LexicalContextMenuPlugin.prod.mjs +7 -0
- package/{LexicalDecoratorBlockNode.esm.js → LexicalDecoratorBlockNode.mjs} +2 -2
- package/LexicalDecoratorBlockNode.node.mjs +9 -0
- package/LexicalEditorRefPlugin.mjs +10 -0
- package/LexicalEditorRefPlugin.node.mjs +8 -0
- package/{useLexicalEditable.esm.js → LexicalErrorBoundary.mjs} +2 -2
- package/LexicalErrorBoundary.node.mjs +8 -0
- package/{LexicalClickableLinkPlugin.esm.js → LexicalHashtagPlugin.mjs} +3 -3
- package/LexicalHashtagPlugin.node.mjs +8 -0
- package/{LexicalHistoryPlugin.esm.js → LexicalHistoryPlugin.mjs} +2 -2
- package/LexicalHistoryPlugin.node.mjs +9 -0
- package/{LexicalHorizontalRuleNode.esm.js → LexicalHorizontalRuleNode.mjs} +2 -2
- package/LexicalHorizontalRuleNode.node.mjs +11 -0
- package/{LexicalCollaborationPlugin.esm.js → LexicalHorizontalRulePlugin.mjs} +3 -3
- package/LexicalHorizontalRulePlugin.node.mjs +8 -0
- package/{LexicalTableOfContents.esm.js → LexicalLinkPlugin.mjs} +3 -3
- package/LexicalLinkPlugin.node.mjs +8 -0
- package/LexicalListPlugin.mjs +10 -0
- package/LexicalListPlugin.node.mjs +8 -0
- package/{LexicalMarkdownShortcutPlugin.esm.js → LexicalMarkdownShortcutPlugin.mjs} +2 -2
- package/LexicalMarkdownShortcutPlugin.node.mjs +9 -0
- package/LexicalNestedComposer.dev.js +6 -2
- package/{LexicalNestedComposer.dev.esm.js → LexicalNestedComposer.dev.mjs} +6 -2
- package/LexicalNestedComposer.mjs +10 -0
- package/LexicalNestedComposer.node.mjs +8 -0
- package/LexicalNestedComposer.prod.js +5 -4
- package/LexicalNestedComposer.prod.mjs +7 -0
- package/LexicalNodeEventPlugin.mjs +10 -0
- package/LexicalNodeEventPlugin.node.mjs +8 -0
- package/LexicalNodeMenuPlugin.dev.js +1 -1
- package/{LexicalNodeMenuPlugin.dev.esm.js → LexicalNodeMenuPlugin.dev.mjs} +1 -1
- package/{LexicalNodeMenuPlugin.esm.js → LexicalNodeMenuPlugin.mjs} +2 -2
- package/LexicalNodeMenuPlugin.node.mjs +9 -0
- package/LexicalNodeMenuPlugin.prod.js +1 -1
- package/{LexicalNodeMenuPlugin.prod.esm.js → LexicalNodeMenuPlugin.prod.mjs} +1 -1
- package/{LexicalComposer.esm.js → LexicalOnChangePlugin.mjs} +3 -3
- package/LexicalOnChangePlugin.node.mjs +8 -0
- package/LexicalPlainTextPlugin.mjs +10 -0
- package/LexicalPlainTextPlugin.node.mjs +8 -0
- package/{LexicalLinkPlugin.esm.js → LexicalRichTextPlugin.mjs} +3 -3
- package/LexicalRichTextPlugin.node.mjs +8 -0
- package/{LexicalTabIndentationPlugin.esm.js → LexicalTabIndentationPlugin.mjs} +2 -2
- package/LexicalTabIndentationPlugin.node.mjs +9 -0
- package/{LexicalErrorBoundary.esm.js → LexicalTableOfContents.mjs} +2 -2
- package/LexicalTableOfContents.node.mjs +8 -0
- package/LexicalTablePlugin.mjs +10 -0
- package/LexicalTablePlugin.node.mjs +8 -0
- package/{LexicalTreeView.esm.js → LexicalTreeView.mjs} +2 -2
- package/LexicalTreeView.node.mjs +8 -0
- package/LexicalTypeaheadMenuPlugin.dev.js +1 -1
- package/{LexicalTypeaheadMenuPlugin.dev.esm.js → LexicalTypeaheadMenuPlugin.dev.mjs} +1 -1
- package/{LexicalTypeaheadMenuPlugin.esm.js → LexicalTypeaheadMenuPlugin.mjs} +2 -2
- package/LexicalTypeaheadMenuPlugin.node.mjs +14 -0
- package/LexicalTypeaheadMenuPlugin.prod.js +1 -1
- package/{LexicalTypeaheadMenuPlugin.prod.esm.js → LexicalTypeaheadMenuPlugin.prod.mjs} +1 -1
- package/package.json +499 -179
- package/useLexicalEditable.mjs +10 -0
- package/useLexicalEditable.node.mjs +8 -0
- package/{useLexicalIsTextContentEmpty.esm.js → useLexicalIsTextContentEmpty.mjs} +2 -2
- package/useLexicalIsTextContentEmpty.node.mjs +8 -0
- package/{useLexicalNodeSelection.esm.js → useLexicalNodeSelection.mjs} +2 -2
- package/useLexicalNodeSelection.node.mjs +8 -0
- package/useLexicalSubscription.mjs +10 -0
- package/useLexicalSubscription.node.mjs +8 -0
- package/{LexicalAutoFocusPlugin.esm.js → useLexicalTextEntity.mjs} +3 -3
- package/useLexicalTextEntity.node.mjs +8 -0
- package/LexicalCharacterLimitPlugin.esm.js +0 -10
- package/LexicalCheckListPlugin.prod.esm.js +0 -7
- package/LexicalClickableLinkPlugin.prod.esm.js +0 -7
- package/LexicalContentEditable.esm.js +0 -10
- package/LexicalContextMenuPlugin.prod.esm.js +0 -7
- package/LexicalEditorRefPlugin.esm.js +0 -10
- package/LexicalHorizontalRulePlugin.esm.js +0 -10
- package/LexicalNestedComposer.esm.js +0 -10
- package/LexicalNestedComposer.prod.esm.js +0 -7
- package/LexicalNodeEventPlugin.esm.js +0 -10
- package/LexicalOnChangePlugin.esm.js +0 -10
- package/LexicalPlainTextPlugin.esm.js +0 -10
- package/LexicalRichTextPlugin.esm.js +0 -10
- package/LexicalTablePlugin.esm.js +0 -10
- package/useLexicalSubscription.esm.js +0 -10
- package/useLexicalTextEntity.esm.js +0 -10
- /package/{LexicalAutoEmbedPlugin.dev.esm.js → LexicalAutoEmbedPlugin.dev.mjs} +0 -0
- /package/{LexicalAutoEmbedPlugin.prod.esm.js → LexicalAutoEmbedPlugin.prod.mjs} +0 -0
- /package/{LexicalAutoFocusPlugin.dev.esm.js → LexicalAutoFocusPlugin.dev.mjs} +0 -0
- /package/{LexicalAutoFocusPlugin.prod.esm.js → LexicalAutoFocusPlugin.prod.mjs} +0 -0
- /package/{LexicalAutoLinkPlugin.dev.esm.js → LexicalAutoLinkPlugin.dev.mjs} +0 -0
- /package/{LexicalAutoLinkPlugin.prod.esm.js → LexicalAutoLinkPlugin.prod.mjs} +0 -0
- /package/{LexicalBlockWithAlignableContents.dev.esm.js → LexicalBlockWithAlignableContents.dev.mjs} +0 -0
- /package/{LexicalBlockWithAlignableContents.prod.esm.js → LexicalBlockWithAlignableContents.prod.mjs} +0 -0
- /package/{LexicalCharacterLimitPlugin.dev.esm.js → LexicalCharacterLimitPlugin.dev.mjs} +0 -0
- /package/{LexicalCharacterLimitPlugin.prod.esm.js → LexicalCharacterLimitPlugin.prod.mjs} +0 -0
- /package/{LexicalClearEditorPlugin.dev.esm.js → LexicalClearEditorPlugin.dev.mjs} +0 -0
- /package/{LexicalClearEditorPlugin.prod.esm.js → LexicalClearEditorPlugin.prod.mjs} +0 -0
- /package/{LexicalCollaborationContext.dev.esm.js → LexicalCollaborationContext.dev.mjs} +0 -0
- /package/{LexicalCollaborationContext.prod.esm.js → LexicalCollaborationContext.prod.mjs} +0 -0
- /package/{LexicalCollaborationPlugin.dev.esm.js → LexicalCollaborationPlugin.dev.mjs} +0 -0
- /package/{LexicalCollaborationPlugin.prod.esm.js → LexicalCollaborationPlugin.prod.mjs} +0 -0
- /package/{LexicalComposer.dev.esm.js → LexicalComposer.dev.mjs} +0 -0
- /package/{LexicalComposer.prod.esm.js → LexicalComposer.prod.mjs} +0 -0
- /package/{LexicalComposerContext.dev.esm.js → LexicalComposerContext.dev.mjs} +0 -0
- /package/{LexicalComposerContext.prod.esm.js → LexicalComposerContext.prod.mjs} +0 -0
- /package/{LexicalContentEditable.dev.esm.js → LexicalContentEditable.dev.mjs} +0 -0
- /package/{LexicalContentEditable.prod.esm.js → LexicalContentEditable.prod.mjs} +0 -0
- /package/{LexicalDecoratorBlockNode.dev.esm.js → LexicalDecoratorBlockNode.dev.mjs} +0 -0
- /package/{LexicalDecoratorBlockNode.prod.esm.js → LexicalDecoratorBlockNode.prod.mjs} +0 -0
- /package/{LexicalEditorRefPlugin.dev.esm.js → LexicalEditorRefPlugin.dev.mjs} +0 -0
- /package/{LexicalEditorRefPlugin.prod.esm.js → LexicalEditorRefPlugin.prod.mjs} +0 -0
- /package/{LexicalErrorBoundary.dev.esm.js → LexicalErrorBoundary.dev.mjs} +0 -0
- /package/{LexicalErrorBoundary.prod.esm.js → LexicalErrorBoundary.prod.mjs} +0 -0
- /package/{LexicalHashtagPlugin.dev.esm.js → LexicalHashtagPlugin.dev.mjs} +0 -0
- /package/{LexicalHashtagPlugin.prod.esm.js → LexicalHashtagPlugin.prod.mjs} +0 -0
- /package/{LexicalHistoryPlugin.dev.esm.js → LexicalHistoryPlugin.dev.mjs} +0 -0
- /package/{LexicalHistoryPlugin.prod.esm.js → LexicalHistoryPlugin.prod.mjs} +0 -0
- /package/{LexicalHorizontalRuleNode.dev.esm.js → LexicalHorizontalRuleNode.dev.mjs} +0 -0
- /package/{LexicalHorizontalRuleNode.prod.esm.js → LexicalHorizontalRuleNode.prod.mjs} +0 -0
- /package/{LexicalHorizontalRulePlugin.dev.esm.js → LexicalHorizontalRulePlugin.dev.mjs} +0 -0
- /package/{LexicalHorizontalRulePlugin.prod.esm.js → LexicalHorizontalRulePlugin.prod.mjs} +0 -0
- /package/{LexicalLinkPlugin.dev.esm.js → LexicalLinkPlugin.dev.mjs} +0 -0
- /package/{LexicalLinkPlugin.prod.esm.js → LexicalLinkPlugin.prod.mjs} +0 -0
- /package/{LexicalListPlugin.dev.esm.js → LexicalListPlugin.dev.mjs} +0 -0
- /package/{LexicalListPlugin.prod.esm.js → LexicalListPlugin.prod.mjs} +0 -0
- /package/{LexicalMarkdownShortcutPlugin.dev.esm.js → LexicalMarkdownShortcutPlugin.dev.mjs} +0 -0
- /package/{LexicalMarkdownShortcutPlugin.prod.esm.js → LexicalMarkdownShortcutPlugin.prod.mjs} +0 -0
- /package/{LexicalNodeEventPlugin.dev.esm.js → LexicalNodeEventPlugin.dev.mjs} +0 -0
- /package/{LexicalNodeEventPlugin.prod.esm.js → LexicalNodeEventPlugin.prod.mjs} +0 -0
- /package/{LexicalOnChangePlugin.dev.esm.js → LexicalOnChangePlugin.dev.mjs} +0 -0
- /package/{LexicalOnChangePlugin.prod.esm.js → LexicalOnChangePlugin.prod.mjs} +0 -0
- /package/{LexicalPlainTextPlugin.dev.esm.js → LexicalPlainTextPlugin.dev.mjs} +0 -0
- /package/{LexicalPlainTextPlugin.prod.esm.js → LexicalPlainTextPlugin.prod.mjs} +0 -0
- /package/{LexicalRichTextPlugin.dev.esm.js → LexicalRichTextPlugin.dev.mjs} +0 -0
- /package/{LexicalRichTextPlugin.prod.esm.js → LexicalRichTextPlugin.prod.mjs} +0 -0
- /package/{LexicalTabIndentationPlugin.dev.esm.js → LexicalTabIndentationPlugin.dev.mjs} +0 -0
- /package/{LexicalTabIndentationPlugin.prod.esm.js → LexicalTabIndentationPlugin.prod.mjs} +0 -0
- /package/{LexicalTableOfContents.dev.esm.js → LexicalTableOfContents.dev.mjs} +0 -0
- /package/{LexicalTableOfContents.prod.esm.js → LexicalTableOfContents.prod.mjs} +0 -0
- /package/{LexicalTablePlugin.dev.esm.js → LexicalTablePlugin.dev.mjs} +0 -0
- /package/{LexicalTablePlugin.prod.esm.js → LexicalTablePlugin.prod.mjs} +0 -0
- /package/{LexicalTreeView.dev.esm.js → LexicalTreeView.dev.mjs} +0 -0
- /package/{LexicalTreeView.prod.esm.js → LexicalTreeView.prod.mjs} +0 -0
- /package/{useLexicalEditable.dev.esm.js → useLexicalEditable.dev.mjs} +0 -0
- /package/{useLexicalEditable.prod.esm.js → useLexicalEditable.prod.mjs} +0 -0
- /package/{useLexicalIsTextContentEmpty.dev.esm.js → useLexicalIsTextContentEmpty.dev.mjs} +0 -0
- /package/{useLexicalIsTextContentEmpty.prod.esm.js → useLexicalIsTextContentEmpty.prod.mjs} +0 -0
- /package/{useLexicalNodeSelection.dev.esm.js → useLexicalNodeSelection.dev.mjs} +0 -0
- /package/{useLexicalNodeSelection.prod.esm.js → useLexicalNodeSelection.prod.mjs} +0 -0
- /package/{useLexicalSubscription.dev.esm.js → useLexicalSubscription.dev.mjs} +0 -0
- /package/{useLexicalSubscription.prod.esm.js → useLexicalSubscription.prod.mjs} +0 -0
- /package/{useLexicalTextEntity.dev.esm.js → useLexicalTextEntity.dev.mjs} +0 -0
- /package/{useLexicalTextEntity.prod.esm.js → useLexicalTextEntity.prod.mjs} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalPlainTextPlugin.dev.mjs') : import('./LexicalPlainTextPlugin.prod.mjs'));
|
|
8
|
+
export const PlainTextPlugin = mod.PlainTextPlugin;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import * as modDev from './
|
|
8
|
-
import * as modProd from './
|
|
7
|
+
import * as modDev from './LexicalRichTextPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalRichTextPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
-
export const
|
|
10
|
+
export const RichTextPlugin = mod.RichTextPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalRichTextPlugin.dev.mjs') : import('./LexicalRichTextPlugin.prod.mjs'));
|
|
8
|
+
export const RichTextPlugin = mod.RichTextPlugin;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import * as modDev from './LexicalTabIndentationPlugin.dev.
|
|
8
|
-
import * as modProd from './LexicalTabIndentationPlugin.prod.
|
|
7
|
+
import * as modDev from './LexicalTabIndentationPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalTabIndentationPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const TabIndentationPlugin = mod.TabIndentationPlugin;
|
|
11
11
|
export const registerTabIndentation = mod.registerTabIndentation;
|
|
@@ -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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalTabIndentationPlugin.dev.mjs') : import('./LexicalTabIndentationPlugin.prod.mjs'));
|
|
8
|
+
export const TabIndentationPlugin = mod.TabIndentationPlugin;
|
|
9
|
+
export const registerTabIndentation = mod.registerTabIndentation;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import * as modDev from './
|
|
8
|
-
import * as modProd from './
|
|
7
|
+
import * as modDev from './LexicalTableOfContents.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalTableOfContents.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export default mod.default;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalTableOfContents.dev.mjs') : import('./LexicalTableOfContents.prod.mjs'));
|
|
8
|
+
export default mod.default;
|
|
@@ -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
|
+
import * as modDev from './LexicalTablePlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalTablePlugin.prod.mjs';
|
|
9
|
+
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
+
export const TablePlugin = mod.TablePlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalTablePlugin.dev.mjs') : import('./LexicalTablePlugin.prod.mjs'));
|
|
8
|
+
export const TablePlugin = mod.TablePlugin;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import * as modDev from './LexicalTreeView.dev.
|
|
8
|
-
import * as modProd from './LexicalTreeView.prod.
|
|
7
|
+
import * as modDev from './LexicalTreeView.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalTreeView.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const TreeView = mod.TreeView;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalTreeView.dev.mjs') : import('./LexicalTreeView.prod.mjs'));
|
|
8
|
+
export const TreeView = mod.TreeView;
|
|
@@ -323,7 +323,7 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = documen
|
|
|
323
323
|
height
|
|
324
324
|
} = resolution.getRect();
|
|
325
325
|
const anchorHeight = anchorElementRef.current.offsetHeight; // use to position under anchor
|
|
326
|
-
containerDiv.style.top = `${top +
|
|
326
|
+
containerDiv.style.top = `${top + anchorHeight + 3}px`;
|
|
327
327
|
containerDiv.style.left = `${left + window.pageXOffset}px`;
|
|
328
328
|
containerDiv.style.height = `${height}px`;
|
|
329
329
|
containerDiv.style.width = `${width}px`;
|
|
@@ -322,7 +322,7 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = documen
|
|
|
322
322
|
height
|
|
323
323
|
} = resolution.getRect();
|
|
324
324
|
const anchorHeight = anchorElementRef.current.offsetHeight; // use to position under anchor
|
|
325
|
-
containerDiv.style.top = `${top +
|
|
325
|
+
containerDiv.style.top = `${top + anchorHeight + 3}px`;
|
|
326
326
|
containerDiv.style.left = `${left + window.pageXOffset}px`;
|
|
327
327
|
containerDiv.style.height = `${height}px`;
|
|
328
328
|
containerDiv.style.width = `${width}px`;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import * as modDev from './LexicalTypeaheadMenuPlugin.dev.
|
|
8
|
-
import * as modProd from './LexicalTypeaheadMenuPlugin.prod.
|
|
7
|
+
import * as modDev from './LexicalTypeaheadMenuPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalTypeaheadMenuPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const LexicalTypeaheadMenuPlugin = mod.LexicalTypeaheadMenuPlugin;
|
|
11
11
|
export const MenuOption = mod.MenuOption;
|
|
@@ -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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalTypeaheadMenuPlugin.dev.mjs') : import('./LexicalTypeaheadMenuPlugin.prod.mjs'));
|
|
8
|
+
export const LexicalTypeaheadMenuPlugin = mod.LexicalTypeaheadMenuPlugin;
|
|
9
|
+
export const MenuOption = mod.MenuOption;
|
|
10
|
+
export const PUNCTUATION = mod.PUNCTUATION;
|
|
11
|
+
export const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND = mod.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND;
|
|
12
|
+
export const getScrollParent = mod.getScrollParent;
|
|
13
|
+
export const useBasicTypeaheadTriggerMatch = mod.useBasicTypeaheadTriggerMatch;
|
|
14
|
+
export const useDynamicPositioning = mod.useDynamicPositioning;
|
|
@@ -14,7 +14,7 @@ function L({close:b,editor:a,anchorElementRef:c,resolution:d,options:f,menuRende
|
|
|
14
14
|
"typeahead-item-"+g),h(g))},[a]);y.useEffect(()=>()=>{let g=a.getRootElement();null!==g&&g.removeAttribute("aria-activedescendant")},[a]);B(()=>{null===f?h(null):null===e&&t(0)},[f,e,t]);y.useEffect(()=>A.mergeRegister(a.registerCommand(K,({option:g})=>g.ref&&null!=g.ref.current?(D(g.ref.current),!0):!1,p)),[a,t,p]);y.useEffect(()=>A.mergeRegister(a.registerCommand(q.KEY_ARROW_DOWN_COMMAND,g=>{if(null!==f&&f.length&&null!==e){let m=e!==f.length-1?e+1:0;t(m);let w=f[m];null!=w.ref&&w.ref.current&&
|
|
15
15
|
a.dispatchCommand(K,{index:m,option:w});g.preventDefault();g.stopImmediatePropagation()}return!0},p),a.registerCommand(q.KEY_ARROW_UP_COMMAND,g=>{if(null!==f&&f.length&&null!==e){var m=0!==e?e-1:f.length-1;t(m);m=f[m];null!=m.ref&&m.ref.current&&D(m.ref.current);g.preventDefault();g.stopImmediatePropagation()}return!0},p),a.registerCommand(q.KEY_ESCAPE_COMMAND,g=>{g.preventDefault();g.stopImmediatePropagation();b();return!0},p),a.registerCommand(q.KEY_TAB_COMMAND,g=>{if(null===f||null===e||null==
|
|
16
16
|
f[e])return!1;g.preventDefault();g.stopImmediatePropagation();k(f[e]);return!0},p),a.registerCommand(q.KEY_ENTER_COMMAND,g=>{if(null===f||null===e||null==f[e])return!1;null!==g&&(g.preventDefault(),g.stopImmediatePropagation());k(f[e]);return!0},p)),[k,b,a,f,e,t,p]);let u=y.useMemo(()=>({options:f,selectOptionAndCleanUp:k,selectedIndex:e,setHighlightedIndex:h}),[k,e,f]);return n(c,u,d.match?d.match.matchingString:"")}
|
|
17
|
-
function M(b,a,c,d=document.body){let [f]=l.useLexicalComposerContext(),n=y.useRef(document.createElement("div")),r=y.useCallback(()=>{n.current.style.top=n.current.style.bottom;const p=f.getRootElement(),e=n.current;var h=e.firstChild;if(null!==p&&null!==b){const {left:t,top:u,width:g,height:m}=b.getRect();e.style.top=`${u+
|
|
17
|
+
function M(b,a,c,d=document.body){let [f]=l.useLexicalComposerContext(),n=y.useRef(document.createElement("div")),r=y.useCallback(()=>{n.current.style.top=n.current.style.bottom;const p=f.getRootElement(),e=n.current;var h=e.firstChild;if(null!==p&&null!==b){const {left:t,top:u,width:g,height:m}=b.getRect();e.style.top=`${u+n.current.offsetHeight+3}px`;e.style.left=`${t+window.pageXOffset}px`;e.style.height=`${m}px`;e.style.width=`${g}px`;if(null!==h){h.style.top=`${u}`;var k=h.getBoundingClientRect();
|
|
18
18
|
h=k.height;k=k.width;const w=p.getBoundingClientRect();t+k>w.right&&(e.style.left=`${w.right-k+window.pageXOffset}px`);(u+h>window.innerHeight||u+h>w.bottom)&&u-w.top>h&&(e.style.top=`${u-h+window.pageYOffset-m}px`)}e.isConnected||(null!=c&&(e.className=c),e.setAttribute("aria-label","Typeahead menu"),e.setAttribute("id","typeahead-menu"),e.setAttribute("role","listbox"),e.style.display="block",e.style.position="absolute",d.append(e));n.current=e;p.setAttribute("aria-controls","typeahead-menu")}},
|
|
19
19
|
[f,b,c,d]);y.useEffect(()=>{let p=f.getRootElement();if(null!==b)return r(),()=>{null!==p&&p.removeAttribute("aria-controls");let e=n.current;null!==e&&e.isConnected&&e.remove()}},[f,r,b]);let v=y.useCallback(p=>{null!==b&&(p||a(null))},[b,a]);J(b,n.current,r,v);return n}function N(b,a,c){var d=c.getSelection();if(null===d||!d.isCollapsed)return!1;c=d.anchorNode;d=d.anchorOffset;if(null==c||null==d)return!1;try{a.setStart(c,b),a.setEnd(c,d)}catch(f){return!1}return!0}
|
|
20
20
|
function O(b){let a=null;b.getEditorState().read(()=>{var c=q.$getSelection();if(q.$isRangeSelection(c)){var d=c.anchor;"text"!==d.type?a=null:(c=d.getNode(),c.isSimpleText()?(d=d.offset,a=c.getTextContent().slice(0,d)):a=null)}});return a}function P(b,a){return 0!==a?!1:b.getEditorState().read(()=>{var c=q.$getSelection();return q.$isRangeSelection(c)?(c=c.anchor.getNode().getPreviousSibling(),q.$isTextNode(c)&&c.isTextEntity()):!1})}function Q(b){y.startTransition?y.startTransition(b):b()}
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createCommand as e,KEY_ARROW_DOWN_COMMAND as n,KEY_ARROW_UP_COMMAND as o,KEY_ESCAPE_COMMAND as r,KEY_TAB_COMMAND as l,KEY_ENTER_COMMAND as i,COMMAND_PRIORITY_LOW as
|
|
7
|
+
import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createCommand as e,KEY_ARROW_DOWN_COMMAND as n,KEY_ARROW_UP_COMMAND as o,KEY_ESCAPE_COMMAND as r,KEY_TAB_COMMAND as l,KEY_ENTER_COMMAND as i,COMMAND_PRIORITY_LOW as u,$getSelection as s,$isRangeSelection as c,$isTextNode as a}from"lexical";import*as d from"react";import{useLayoutEffect as m,useEffect as f,useState as p,useCallback as g,useMemo as h,useRef as y}from"react";import{mergeRegister as w}from"@lexical/utils";var C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?m:f;class b{constructor(t){this.key=t,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(t){this.ref={current:t}}}const v=t=>{const e=document.getElementById("typeahead-menu");if(!e)return;const n=e.getBoundingClientRect();n.top+n.height>window.innerHeight&&e.scrollIntoView({block:"center"}),n.top<0&&e.scrollIntoView({block:"center"}),t.scrollIntoView({block:"nearest"})};function E(t,e){const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return n.top>o.top&&n.top<o.bottom}function x(e,n,o,r){const[l]=t();f((()=>{if(null!=n&&null!=e){const t=l.getRootElement(),e=null!=t?function(t,e){let n=getComputedStyle(t);const o="absolute"===n.position,r=e?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let e=t;e=e.parentElement;)if(n=getComputedStyle(e),(!o||"static"!==n.position)&&r.test(n.overflow+n.overflowY+n.overflowX))return e;return document.body}(t,!1):document.body;let i=!1,u=E(n,e);const s=function(){i||(window.requestAnimationFrame((function(){o(),i=!1})),i=!0);const t=E(n,e);t!==u&&(u=t,null!=r&&r(t))},c=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",s,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",o),document.removeEventListener("scroll",s,!0)}}}),[n,l,r,o,e])}const S=e("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function R({close:t,editor:e,anchorElementRef:a,resolution:d,options:m,menuRenderFn:y,onSelectOption:b,shouldSplitNodeWithQuery:E=!1,commandPriority:x=u}){const[R,O]=p(null),I=d.match&&d.match.matchingString;f((()=>{O(0)}),[I]);const T=g((n=>{e.update((()=>{const e=null!=d.match&&E?function(t){const e=s();if(!c(e)||!e.isCollapsed())return null;const n=e.anchor;if("text"!==n.type)return null;const o=n.getNode();if(!o.isSimpleText())return null;const r=n.offset,l=o.getTextContent().slice(0,r),i=t.replaceableString.length,u=r-function(t,e,n){let o=n;for(let n=o;n<=e.length;n++)t.substr(-n)===e.substr(0,n)&&(o=n);return o}(l,t.matchingString,i);if(u<0)return null;let a;return 0===u?[a]=o.splitText(r):[,a]=o.splitText(u,r),a}(d.match):null;b(n,e,t,d.match?d.match.matchingString:"")}))}),[e,E,d.match,b,t]),A=g((t=>{const n=e.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+t),O(t))}),[e]);f((()=>()=>{const t=e.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")}),[e]),C((()=>{null===m?O(null):null===R&&A(0)}),[m,R,A]),f((()=>w(e.registerCommand(S,(({option:t})=>!(!t.ref||null==t.ref.current)&&(v(t.ref.current),!0)),x))),[e,A,x]),f((()=>w(e.registerCommand(n,(t=>{const n=t;if(null!==m&&m.length&&null!==R){const t=R!==m.length-1?R+1:0;A(t);const o=m[t];null!=o.ref&&o.ref.current&&e.dispatchCommand(S,{index:t,option:o}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),x),e.registerCommand(o,(t=>{const e=t;if(null!==m&&m.length&&null!==R){const t=0!==R?R-1:m.length-1;A(t);const n=m[t];null!=n.ref&&n.ref.current&&v(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0}),x),e.registerCommand(r,(e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0}),x),e.registerCommand(l,(t=>{const e=t;return null!==m&&null!==R&&null!=m[R]&&(e.preventDefault(),e.stopImmediatePropagation(),T(m[R]),!0)}),x),e.registerCommand(i,(t=>null!==m&&null!==R&&null!=m[R]&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),T(m[R]),!0)),x))),[T,t,e,m,R,A,x]);return y(a,h((()=>({options:m,selectOptionAndCleanUp:T,selectedIndex:R,setHighlightedIndex:O})),[T,R,m]),d.match?d.match.matchingString:"")}const O="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";function I(t,e){let n=getComputedStyle(t);const o="absolute"===n.position,r=e?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let e=t;e=e.parentElement;)if(n=getComputedStyle(e),(!o||"static"!==n.position)&&r.test(n.overflow+n.overflowY+n.overflowX))return e;return document.body}const T=e("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function A(t,{minLength:e=1,maxLength:n=75}){return g((o=>{const r=new RegExp("(^|\\s|\\()(["+t+"]((?:"+("[^"+t+O+"\\s]")+"){0,"+n+"}))$").exec(o);if(null!==r){const t=r[1],n=r[3];if(n.length>=e)return{leadOffset:r.index+t.length,matchingString:n,replaceableString:r[2]}}return null}),[n,e,t])}function N({options:e,onQueryChange:n,onSelectOption:o,onOpen:r,onClose:l,menuRenderFn:i,triggerFn:m,anchorClassName:h,commandPriority:w=u,parent:C}){const[b]=t(),[v,E]=p(null),S=function(e,n,o,r=document.body){const[l]=t(),i=y(document.createElement("div")),u=g((()=>{i.current.style.top=i.current.style.bottom;const t=l.getRootElement(),n=i.current,u=n.firstChild;if(null!==t&&null!==e){const{left:l,top:s,width:c,height:a}=e.getRect(),d=i.current.offsetHeight;if(n.style.top=`${s+d+3}px`,n.style.left=`${l+window.pageXOffset}px`,n.style.height=`${a}px`,n.style.width=`${c}px`,null!==u){u.style.top=`${s}`;const e=u.getBoundingClientRect(),o=e.height,r=e.width,i=t.getBoundingClientRect();l+r>i.right&&(n.style.left=`${i.right-r+window.pageXOffset}px`),(s+o>window.innerHeight||s+o>i.bottom)&&s-i.top>o&&(n.style.top=s-o+window.pageYOffset-a+"px")}n.isConnected||(null!=o&&(n.className=o),n.setAttribute("aria-label","Typeahead menu"),n.setAttribute("id","typeahead-menu"),n.setAttribute("role","listbox"),n.style.display="block",n.style.position="absolute",r.append(n)),i.current=n,t.setAttribute("aria-controls","typeahead-menu")}}),[l,e,o,r]);f((()=>{const t=l.getRootElement();if(null!==e)return u(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=i.current;null!==e&&e.isConnected&&e.remove()}}),[l,u,e]);const s=g((t=>{null!==e&&(t||n(null))}),[e,n]);return x(e,i.current,u,s),i}(v,E,h,C),O=g((()=>{E(null),null!=l&&null!==v&&l()}),[l,v]),I=g((t=>{E(t),null!=r&&null===v&&r(t)}),[r,v]);return f((()=>{const t=b.registerUpdateListener((()=>{b.getEditorState().read((()=>{const t=b._window||window,e=t.document.createRange(),o=s(),r=function(t){let e=null;return t.getEditorState().read((()=>{const t=s();c(t)&&(e=function(t){const e=t.anchor;if("text"!==e.type)return null;const n=e.getNode();if(!n.isSimpleText())return null;const o=e.offset;return n.getTextContent().slice(0,o)}(t))})),e}(b);if(!c(o)||!o.isCollapsed()||null===r||null===e)return void O();const l=m(r,b);if(n(l?l.matchingString:null),null!==l&&!function(t,e){return 0===e&&t.getEditorState().read((()=>{const t=s();if(c(t)){const e=t.anchor.getNode().getPreviousSibling();return a(e)&&e.isTextEntity()}return!1}))}(b,l.leadOffset)){const n=function(t,e,n){const o=n.getSelection();if(null===o||!o.isCollapsed)return!1;const r=o.anchorNode,l=t,i=o.anchorOffset;if(null==r||null==i)return!1;try{e.setStart(r,l),e.setEnd(r,i)}catch(t){return!1}return!0}(l.leadOffset,e,t);if(null!==n)return i=()=>I({getRect:()=>e.getBoundingClientRect(),match:l}),void(d.startTransition?d.startTransition(i):i())}var i;O()}))}));return()=>{t()}}),[b,m,n,v,O,I]),null===v||null===b?null:d.createElement(R,{close:O,resolution:v,editor:b,anchorElementRef:S,options:e,menuRenderFn:i,shouldSplitNodeWithQuery:!0,onSelectOption:o,commandPriority:w})}export{N as LexicalTypeaheadMenuPlugin,b as MenuOption,O as PUNCTUATION,T as SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,I as getScrollParent,A as useBasicTypeaheadTriggerMatch,x as useDynamicPositioning};
|