@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
|
@@ -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 './LexicalAutoEmbedPlugin.dev.
|
|
8
|
-
import * as modProd from './LexicalAutoEmbedPlugin.prod.
|
|
7
|
+
import * as modDev from './LexicalAutoEmbedPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalAutoEmbedPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const AutoEmbedOption = mod.AutoEmbedOption;
|
|
11
11
|
export const INSERT_EMBED_COMMAND = mod.INSERT_EMBED_COMMAND;
|
|
@@ -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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalAutoEmbedPlugin.dev.mjs') : import('./LexicalAutoEmbedPlugin.prod.mjs'));
|
|
8
|
+
export const AutoEmbedOption = mod.AutoEmbedOption;
|
|
9
|
+
export const INSERT_EMBED_COMMAND = mod.INSERT_EMBED_COMMAND;
|
|
10
|
+
export const LexicalAutoEmbedPlugin = mod.LexicalAutoEmbedPlugin;
|
|
11
|
+
export const URL_MATCHER = mod.URL_MATCHER;
|
|
@@ -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 './LexicalAutoFocusPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalAutoFocusPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
-
export const
|
|
10
|
+
export const AutoFocusPlugin = mod.AutoFocusPlugin;
|
|
@@ -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('./LexicalAutoFocusPlugin.dev.mjs') : import('./LexicalAutoFocusPlugin.prod.mjs'));
|
|
8
|
+
export const AutoFocusPlugin = mod.AutoFocusPlugin;
|
|
@@ -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 './LexicalAutoLinkPlugin.dev.
|
|
8
|
-
import * as modProd from './LexicalAutoLinkPlugin.prod.
|
|
7
|
+
import * as modDev from './LexicalAutoLinkPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalAutoLinkPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const AutoLinkPlugin = mod.AutoLinkPlugin;
|
|
11
11
|
export const createLinkMatcherWithRegExp = mod.createLinkMatcherWithRegExp;
|
|
@@ -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('./LexicalAutoLinkPlugin.dev.mjs') : import('./LexicalAutoLinkPlugin.prod.mjs'));
|
|
8
|
+
export const AutoLinkPlugin = mod.AutoLinkPlugin;
|
|
9
|
+
export const createLinkMatcherWithRegExp = mod.createLinkMatcherWithRegExp;
|
|
@@ -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 './LexicalBlockWithAlignableContents.dev.
|
|
8
|
-
import * as modProd from './LexicalBlockWithAlignableContents.prod.
|
|
7
|
+
import * as modDev from './LexicalBlockWithAlignableContents.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalBlockWithAlignableContents.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const BlockWithAlignableContents = mod.BlockWithAlignableContents;
|
|
@@ -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('./LexicalBlockWithAlignableContents.dev.mjs') : import('./LexicalBlockWithAlignableContents.prod.mjs'));
|
|
8
|
+
export const BlockWithAlignableContents = mod.BlockWithAlignableContents;
|
|
@@ -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 './LexicalCharacterLimitPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalCharacterLimitPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
-
export const
|
|
10
|
+
export const CharacterLimitPlugin = mod.CharacterLimitPlugin;
|
|
@@ -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('./LexicalCharacterLimitPlugin.dev.mjs') : import('./LexicalCharacterLimitPlugin.prod.mjs'));
|
|
8
|
+
export const CharacterLimitPlugin = mod.CharacterLimitPlugin;
|
|
@@ -108,8 +108,8 @@ function handleCheckItemEvent(event, callback) {
|
|
|
108
108
|
if (!parentNode || parentNode.__lexicalListType !== 'check') {
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
const pageX = event.pageX;
|
|
112
111
|
const rect = target.getBoundingClientRect();
|
|
112
|
+
const pageX = event.pageX / utils.calculateZoomLevel(target);
|
|
113
113
|
if (target.dir === 'rtl' ? pageX < rect.right && pageX > rect.right - 20 : pageX > rect.left && pageX < rect.left + 20) {
|
|
114
114
|
callback();
|
|
115
115
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { INSERT_CHECK_LIST_COMMAND, insertList, $isListItemNode, $isListNode } from '@lexical/list';
|
|
8
8
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
9
|
-
import { mergeRegister, $findMatchingParent, isHTMLElement } from '@lexical/utils';
|
|
9
|
+
import { mergeRegister, $findMatchingParent, isHTMLElement, calculateZoomLevel } from '@lexical/utils';
|
|
10
10
|
import { COMMAND_PRIORITY_LOW, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_SPACE_COMMAND, $getNearestNodeFromDOMNode, KEY_ARROW_LEFT_COMMAND, $getSelection, $isRangeSelection, $isElementNode } from 'lexical';
|
|
11
11
|
import { useEffect } from 'react';
|
|
12
12
|
|
|
@@ -106,8 +106,8 @@ function handleCheckItemEvent(event, callback) {
|
|
|
106
106
|
if (!parentNode || parentNode.__lexicalListType !== 'check') {
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
const pageX = event.pageX;
|
|
110
109
|
const rect = target.getBoundingClientRect();
|
|
110
|
+
const pageX = event.pageX / calculateZoomLevel(target);
|
|
111
111
|
if (target.dir === 'rtl' ? pageX < rect.right && pageX > rect.right - 20 : pageX > rect.left && pageX < rect.left + 20) {
|
|
112
112
|
callback();
|
|
113
113
|
}
|
|
@@ -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 './LexicalCheckListPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalCheckListPlugin.prod.mjs';
|
|
9
|
+
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
+
export const CheckListPlugin = mod.CheckListPlugin;
|
|
@@ -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('./LexicalCheckListPlugin.dev.mjs') : import('./LexicalCheckListPlugin.prod.mjs'));
|
|
8
|
+
export const CheckListPlugin = mod.CheckListPlugin;
|
|
@@ -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
|
-
'use strict';var e=require("@lexical/list"),g=require("@lexical/react/LexicalComposerContext"),k=require("@lexical/utils"),l=require("lexical"),m=require("react");function n(a,c){let b=a.target;if(null!==b&&k.isHTMLElement(b)){var d=b.firstChild;(null==d||!k.isHTMLElement(d)||"UL"!==d.tagName&&"OL"!==d.tagName)&&(d=b.parentNode)&&"check"===d.__lexicalListType&&(a=a.pageX
|
|
7
|
+
'use strict';var e=require("@lexical/list"),g=require("@lexical/react/LexicalComposerContext"),k=require("@lexical/utils"),l=require("lexical"),m=require("react");function n(a,c){let b=a.target;if(null!==b&&k.isHTMLElement(b)){var d=b.firstChild;(null==d||!k.isHTMLElement(d)||"UL"!==d.tagName&&"OL"!==d.tagName)&&(d=b.parentNode)&&"check"===d.__lexicalListType&&(d=b.getBoundingClientRect(),a=a.pageX/k.calculateZoomLevel(b),("rtl"===b.dir?a<d.right&&a>d.right-20:a>d.left&&a<d.left+20)&&c())}}
|
|
8
8
|
function p(a){n(a,()=>{let c=a.target,b=q(c);null!=b&&b.isEditable()&&b.update(()=>{if(a.target){let d=l.$getNearestNodeFromDOMNode(c);e.$isListItemNode(d)&&(c.focus(),d.toggleChecked())}})})}function r(a){n(a,()=>{a.preventDefault()})}function q(a){for(;a;){if(a.__lexicalEditor)return a.__lexicalEditor;a=a.parentNode}return null}function t(){let a=document.activeElement;return null!=a&&"LI"===a.tagName&&null!=a.parentNode&&"check"===a.parentNode.__lexicalListType?a:null}
|
|
9
9
|
function u(a,c){let b=c?a.getPreviousSibling():a.getNextSibling();for(;null==b&&e.$isListItemNode(a);)a=a.getParentOrThrow().getParent(),null!=a&&(b=c?a.getPreviousSibling():a.getNextSibling());for(;e.$isListItemNode(b);){a=c?b.getLastChild():b.getFirstChild();if(!e.$isListNode(a))return b;b=c?a.getLastChild():a.getFirstChild()}return null}
|
|
10
10
|
function v(a,c,b){let d=t();null!=d&&c.update(()=>{var f=l.$getNearestNodeFromDOMNode(d);if(e.$isListItemNode(f)&&(f=u(f,b),null!=f)){f.selectStart();let h=c.getElementByKey(f.__key);null!=h&&(a.preventDefault(),setTimeout(()=>{h.focus()},0))}});return!1}
|
|
@@ -0,0 +1,7 @@
|
|
|
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{INSERT_CHECK_LIST_COMMAND as e,insertList as t,$isListItemNode as n,$isListNode as r}from"@lexical/list";import{useLexicalComposerContext as i}from"@lexical/react/LexicalComposerContext";import{mergeRegister as l,$findMatchingParent as o,isHTMLElement as c,calculateZoomLevel as u}from"@lexical/utils";import{COMMAND_PRIORITY_LOW as s,KEY_ARROW_DOWN_COMMAND as a,KEY_ARROW_UP_COMMAND as g,KEY_ESCAPE_COMMAND as f,KEY_SPACE_COMMAND as d,$getNearestNodeFromDOMNode as m,KEY_ARROW_LEFT_COMMAND as p,$getSelection as C,$isRangeSelection as h,$isElementNode as v}from"lexical";import{useEffect as E}from"react";function L(){const[c]=i();return E((()=>l(c.registerCommand(e,(()=>(t(c,"check"),!0)),s),c.registerCommand(a,(e=>N(e,c,!1)),s),c.registerCommand(g,(e=>N(e,c,!0)),s),c.registerCommand(f,(e=>{if(null!=y()){const e=c.getRootElement();return null!=e&&e.focus(),!0}return!1}),s),c.registerCommand(d,(e=>{const t=y();return!(null==t||!c.isEditable())&&(c.update((()=>{const r=m(t);n(r)&&(e.preventDefault(),r.toggleChecked())})),!0)}),s),c.registerCommand(p,(e=>c.getEditorState().read((()=>{const t=C();if(h(t)&&t.isCollapsed()){const{anchor:i}=t,l="element"===i.type;if(l||0===i.offset){const t=i.getNode(),u=o(t,(e=>v(e)&&!e.isInline()));if(n(u)){const n=u.getParent();if(r(n)&&"check"===n.getListType()&&(l||u.getFirstDescendant()===t)){const t=c.getElementByKey(u.__key);if(null!=t&&document.activeElement!==t)return t.focus(),e.preventDefault(),!0}}}}return!1}))),s),c.registerRootListener(((e,t)=>{null!==e&&(e.addEventListener("click",_),e.addEventListener("pointerdown",k)),null!==t&&(t.removeEventListener("click",_),t.removeEventListener("pointerdown",k))}))))),null}function x(e,t){const n=e.target;if(null===n||!c(n))return;const r=n.firstChild;if(null!=r&&c(r)&&("UL"===r.tagName||"OL"===r.tagName))return;const i=n.parentNode;if(!i||"check"!==i.__lexicalListType)return;const l=n.getBoundingClientRect(),o=e.pageX/u(n);("rtl"===n.dir?o<l.right&&o>l.right-20:o>l.left&&o<l.left+20)&&t()}function _(e){x(e,(()=>{const t=e.target,r=function(e){let t=e;for(;t;){if(t.__lexicalEditor)return t.__lexicalEditor;t=t.parentNode}return null}(t);null!=r&&r.isEditable()&&r.update((()=>{if(e.target){const e=m(t);n(e)&&(t.focus(),e.toggleChecked())}}))}))}function k(e){x(e,(()=>{e.preventDefault()}))}function y(){const e=document.activeElement;return null!=e&&"LI"===e.tagName&&null!=e.parentNode&&"check"===e.parentNode.__lexicalListType?e:null}function N(e,t,i){const l=y();return null!=l&&t.update((()=>{const o=m(l);if(!n(o))return;const c=function(e,t){let i=t?e.getPreviousSibling():e.getNextSibling(),l=e;for(;null==i&&n(l);)l=l.getParentOrThrow().getParent(),null!=l&&(i=t?l.getPreviousSibling():l.getNextSibling());for(;n(i);){const e=t?i.getLastChild():i.getFirstChild();if(!r(e))return i;i=t?e.getLastChild():e.getFirstChild()}return null}(o,i);if(null!=c){c.selectStart();const n=t.getElementByKey(c.__key);null!=n&&(e.preventDefault(),setTimeout((()=>{n.focus()}),0))}})),!1}export{L as CheckListPlugin};
|
|
@@ -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 './LexicalClearEditorPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalClearEditorPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
-
export const
|
|
10
|
+
export const ClearEditorPlugin = mod.ClearEditorPlugin;
|
|
@@ -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('./LexicalClearEditorPlugin.dev.mjs') : import('./LexicalClearEditorPlugin.prod.mjs'));
|
|
8
|
+
export const ClearEditorPlugin = mod.ClearEditorPlugin;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export default function LexicalClickableLinkPlugin({ newTab, }: {
|
|
8
|
+
export default function LexicalClickableLinkPlugin({ newTab, disabled, }: {
|
|
9
9
|
newTab?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
10
11
|
}): null;
|
|
@@ -30,11 +30,16 @@ function findMatchingDOM(startNode, predicate) {
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
function LexicalClickableLinkPlugin({
|
|
33
|
-
newTab = true
|
|
33
|
+
newTab = true,
|
|
34
|
+
disabled = false
|
|
34
35
|
}) {
|
|
35
36
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
36
37
|
react.useEffect(() => {
|
|
37
38
|
const onClick = event => {
|
|
39
|
+
if (disabled) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
38
43
|
const target = event.target;
|
|
39
44
|
if (!(target instanceof Node)) {
|
|
40
45
|
return;
|
|
@@ -76,7 +81,7 @@ function LexicalClickableLinkPlugin({
|
|
|
76
81
|
event.preventDefault();
|
|
77
82
|
};
|
|
78
83
|
const onMouseUp = event => {
|
|
79
|
-
if (event.button === 1
|
|
84
|
+
if (!disabled && event.button === 1) {
|
|
80
85
|
onClick(event);
|
|
81
86
|
}
|
|
82
87
|
};
|
|
@@ -90,7 +95,7 @@ function LexicalClickableLinkPlugin({
|
|
|
90
95
|
rootElement.addEventListener('mouseup', onMouseUp);
|
|
91
96
|
}
|
|
92
97
|
});
|
|
93
|
-
}, [editor, newTab]);
|
|
98
|
+
}, [editor, newTab, disabled]);
|
|
94
99
|
return null;
|
|
95
100
|
}
|
|
96
101
|
|
|
@@ -28,11 +28,16 @@ function findMatchingDOM(startNode, predicate) {
|
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
function LexicalClickableLinkPlugin({
|
|
31
|
-
newTab = true
|
|
31
|
+
newTab = true,
|
|
32
|
+
disabled = false
|
|
32
33
|
}) {
|
|
33
34
|
const [editor] = useLexicalComposerContext();
|
|
34
35
|
useEffect(() => {
|
|
35
36
|
const onClick = event => {
|
|
37
|
+
if (disabled) {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
36
41
|
const target = event.target;
|
|
37
42
|
if (!(target instanceof Node)) {
|
|
38
43
|
return;
|
|
@@ -74,7 +79,7 @@ function LexicalClickableLinkPlugin({
|
|
|
74
79
|
event.preventDefault();
|
|
75
80
|
};
|
|
76
81
|
const onMouseUp = event => {
|
|
77
|
-
if (event.button === 1
|
|
82
|
+
if (!disabled && event.button === 1) {
|
|
78
83
|
onClick(event);
|
|
79
84
|
}
|
|
80
85
|
};
|
|
@@ -88,7 +93,7 @@ function LexicalClickableLinkPlugin({
|
|
|
88
93
|
rootElement.addEventListener('mouseup', onMouseUp);
|
|
89
94
|
}
|
|
90
95
|
});
|
|
91
|
-
}, [editor, newTab]);
|
|
96
|
+
}, [editor, newTab, disabled]);
|
|
92
97
|
return null;
|
|
93
98
|
}
|
|
94
99
|
|
|
@@ -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 './LexicalClickableLinkPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalClickableLinkPlugin.prod.mjs';
|
|
9
|
+
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
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('./LexicalClickableLinkPlugin.dev.mjs') : import('./LexicalClickableLinkPlugin.prod.mjs'));
|
|
8
|
+
export default mod.default;
|
|
@@ -4,6 +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
|
-
'use strict';var e=require("@lexical/link"),
|
|
8
|
-
module.exports=function({newTab:
|
|
9
|
-
|
|
7
|
+
'use strict';var e=require("@lexical/link"),n=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/utils"),t=require("lexical"),u=require("react");
|
|
8
|
+
module.exports=function({newTab:p=!0,disabled:h=!1}){let [k]=n.useLexicalComposerContext();u.useEffect(()=>{let m=a=>{if(h)a.preventDefault();else{var c=a.target;if(c instanceof Node){var d=t.getNearestEditorFromDOMNode(c);if(null!==d){var f=null,l=null;d.update(()=>{var b=t.$getNearestNodeFromDOMNode(c);if(null!==b)if(b=r.$findMatchingParent(b,t.$isElementNode),e.$isLinkNode(b))f=b.sanitizeUrl(b.getURL()),l=b.getTarget();else{a:{b=r.isHTMLAnchorElement;let g=c;for(;null!=g;){if(b(g)){b=g;break a}g=
|
|
9
|
+
g.parentNode}b=null}null!==b&&(f=b.href,l=b.target)}});if(null!==f&&""!==f){d=k.getEditorState().read(t.$getSelection);if(!t.$isRangeSelection(d)||d.isCollapsed())d="auxclick"===a.type&&1===a.button,window.open(f,p||d||a.metaKey||a.ctrlKey||"_blank"===l?"_blank":"_self");a.preventDefault()}}}}},q=a=>{h||1!==a.button||m(a)};return k.registerRootListener((a,c)=>{null!==c&&(c.removeEventListener("click",m),c.removeEventListener("mouseup",q));null!==a&&(a.addEventListener("click",m),a.addEventListener("mouseup",
|
|
10
|
+
q))})},[k,p,h]);return null}
|
|
@@ -0,0 +1,7 @@
|
|
|
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{$isLinkNode as e}from"@lexical/link";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as n,isHTMLAnchorElement as r}from"@lexical/utils";import{getNearestEditorFromDOMNode as l,$getNearestNodeFromDOMNode as o,$isElementNode as i,$getSelection as u,$isRangeSelection as a}from"lexical";import{useEffect as s}from"react";function c({newTab:c=!0,disabled:f=!1}){const[p]=t();return s((()=>{const t=t=>{if(f)return void t.preventDefault();const s=t.target;if(!(s instanceof Node))return;const d=l(s);if(null===d)return;let m=null,v=null;if(d.update((()=>{const t=o(s);if(null!==t){const l=n(t,i);if(e(l))m=l.sanitizeUrl(l.getURL()),v=l.getTarget();else{const e=function(e,t){let n=e;for(;null!=n;){if(t(n))return n;n=n.parentNode}return null}(s,r);null!==e&&(m=e.href,v=e.target)}}})),null===m||""===m)return;const x=p.getEditorState().read(u);if(a(x)&&!x.isCollapsed())return void t.preventDefault();const g="auxclick"===t.type&&1===t.button;window.open(m,c||g||t.metaKey||t.ctrlKey||"_blank"===v?"_blank":"_self"),t.preventDefault()},s=e=>{f||1!==e.button||t(e)};return p.registerRootListener(((e,n)=>{null!==n&&(n.removeEventListener("click",t),n.removeEventListener("mouseup",s)),null!==e&&(e.addEventListener("click",t),e.addEventListener("mouseup",s))}))}),[p,c,f]),null}export{c as default};
|
|
@@ -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 './LexicalCollaborationContext.dev.
|
|
8
|
-
import * as modProd from './LexicalCollaborationContext.prod.
|
|
7
|
+
import * as modDev from './LexicalCollaborationContext.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalCollaborationContext.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const CollaborationContext = mod.CollaborationContext;
|
|
11
11
|
export const useCollaborationContext = mod.useCollaborationContext;
|
|
@@ -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('./LexicalCollaborationContext.dev.mjs') : import('./LexicalCollaborationContext.prod.mjs'));
|
|
8
|
+
export const CollaborationContext = mod.CollaborationContext;
|
|
9
|
+
export const useCollaborationContext = mod.useCollaborationContext;
|
|
@@ -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 './LexicalCollaborationPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalCollaborationPlugin.prod.mjs';
|
|
9
|
+
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
+
export const CollaborationPlugin = mod.CollaborationPlugin;
|
|
@@ -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('./LexicalCollaborationPlugin.dev.mjs') : import('./LexicalCollaborationPlugin.prod.mjs'));
|
|
8
|
+
export const CollaborationPlugin = mod.CollaborationPlugin;
|
|
@@ -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 './LexicalComposer.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalComposer.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
-
export const
|
|
10
|
+
export const LexicalComposer = mod.LexicalComposer;
|
|
@@ -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('./LexicalComposer.dev.mjs') : import('./LexicalComposer.prod.mjs'));
|
|
8
|
+
export const LexicalComposer = mod.LexicalComposer;
|
|
@@ -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 './LexicalComposerContext.dev.
|
|
8
|
-
import * as modProd from './LexicalComposerContext.prod.
|
|
7
|
+
import * as modDev from './LexicalComposerContext.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalComposerContext.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const LexicalComposerContext = mod.LexicalComposerContext;
|
|
11
11
|
export const createLexicalComposerContext = mod.createLexicalComposerContext;
|
|
@@ -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
|
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalComposerContext.dev.mjs') : import('./LexicalComposerContext.prod.mjs'));
|
|
8
|
+
export const LexicalComposerContext = mod.LexicalComposerContext;
|
|
9
|
+
export const createLexicalComposerContext = mod.createLexicalComposerContext;
|
|
10
|
+
export const useLexicalComposerContext = mod.useLexicalComposerContext;
|
|
@@ -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 './LexicalContentEditable.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalContentEditable.prod.mjs';
|
|
9
|
+
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
|
+
export const ContentEditable = mod.ContentEditable;
|
|
@@ -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('./LexicalContentEditable.dev.mjs') : import('./LexicalContentEditable.prod.mjs'));
|
|
8
|
+
export const ContentEditable = mod.ContentEditable;
|
|
@@ -21,11 +21,12 @@ export type LexicalContextMenuPluginProps<TOption extends MenuOption> = {
|
|
|
21
21
|
onSelectOption: (option: TOption, textNodeContainingQuery: LexicalNode | null, closeMenu: () => void, matchingString: string) => void;
|
|
22
22
|
options: Array<TOption>;
|
|
23
23
|
onClose?: () => void;
|
|
24
|
+
onWillOpen?: (event: MouseEvent) => void;
|
|
24
25
|
onOpen?: (resolution: MenuResolution) => void;
|
|
25
26
|
menuRenderFn: ContextMenuRenderFn<TOption>;
|
|
26
27
|
anchorClassName?: string;
|
|
27
28
|
commandPriority?: CommandListenerPriority;
|
|
28
29
|
parent?: HTMLElement;
|
|
29
30
|
};
|
|
30
|
-
export declare function LexicalContextMenuPlugin<TOption extends MenuOption>({ options, onClose, onOpen, onSelectOption, menuRenderFn: contextMenuRenderFn, anchorClassName, commandPriority, parent, }: LexicalContextMenuPluginProps<TOption>): JSX.Element | null;
|
|
31
|
+
export declare function LexicalContextMenuPlugin<TOption extends MenuOption>({ options, onWillOpen, onClose, onOpen, onSelectOption, menuRenderFn: contextMenuRenderFn, anchorClassName, commandPriority, parent, }: LexicalContextMenuPluginProps<TOption>): JSX.Element | null;
|
|
31
32
|
export { MenuOption, MenuRenderFn, MenuResolution };
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
|
|
10
|
+
var utils = require('@lexical/utils');
|
|
10
11
|
var lexical = require('lexical');
|
|
11
12
|
var React = require('react');
|
|
12
|
-
var utils = require('@lexical/utils');
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -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`;
|
|
@@ -391,6 +391,7 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = documen
|
|
|
391
391
|
const PRE_PORTAL_DIV_SIZE = 1;
|
|
392
392
|
function LexicalContextMenuPlugin({
|
|
393
393
|
options,
|
|
394
|
+
onWillOpen,
|
|
394
395
|
onClose,
|
|
395
396
|
onOpen,
|
|
396
397
|
onSelectOption,
|
|
@@ -417,10 +418,14 @@ function LexicalContextMenuPlugin({
|
|
|
417
418
|
}, [onOpen, resolution]);
|
|
418
419
|
const handleContextMenu = React.useCallback(event => {
|
|
419
420
|
event.preventDefault();
|
|
421
|
+
if (onWillOpen != null) {
|
|
422
|
+
onWillOpen(event);
|
|
423
|
+
}
|
|
424
|
+
const zoom = utils.calculateZoomLevel(event.target);
|
|
420
425
|
openNodeMenu({
|
|
421
|
-
getRect: () => new DOMRect(event.clientX, event.clientY, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
|
|
426
|
+
getRect: () => new DOMRect(event.clientX / zoom, event.clientY / zoom, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
|
|
422
427
|
});
|
|
423
|
-
}, [openNodeMenu]);
|
|
428
|
+
}, [openNodeMenu, onWillOpen]);
|
|
424
429
|
const handleClick = React.useCallback(event => {
|
|
425
430
|
if (resolution !== null && menuRef.current != null && event.target != null && !menuRef.current.contains(event.target)) {
|
|
426
431
|
closeNodeMenu();
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
8
|
+
import { mergeRegister, calculateZoomLevel } from '@lexical/utils';
|
|
8
9
|
import { createCommand, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $getSelection, $isRangeSelection } from 'lexical';
|
|
9
10
|
import * as React from 'react';
|
|
10
11
|
import { useLayoutEffect as useLayoutEffect$1, useEffect, useState, useCallback, useMemo, useRef } from 'react';
|
|
11
|
-
import { mergeRegister } from '@lexical/utils';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -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`;
|
|
@@ -390,6 +390,7 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = documen
|
|
|
390
390
|
const PRE_PORTAL_DIV_SIZE = 1;
|
|
391
391
|
function LexicalContextMenuPlugin({
|
|
392
392
|
options,
|
|
393
|
+
onWillOpen,
|
|
393
394
|
onClose,
|
|
394
395
|
onOpen,
|
|
395
396
|
onSelectOption,
|
|
@@ -416,10 +417,14 @@ function LexicalContextMenuPlugin({
|
|
|
416
417
|
}, [onOpen, resolution]);
|
|
417
418
|
const handleContextMenu = useCallback(event => {
|
|
418
419
|
event.preventDefault();
|
|
420
|
+
if (onWillOpen != null) {
|
|
421
|
+
onWillOpen(event);
|
|
422
|
+
}
|
|
423
|
+
const zoom = calculateZoomLevel(event.target);
|
|
419
424
|
openNodeMenu({
|
|
420
|
-
getRect: () => new DOMRect(event.clientX, event.clientY, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
|
|
425
|
+
getRect: () => new DOMRect(event.clientX / zoom, event.clientY / zoom, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
|
|
421
426
|
});
|
|
422
|
-
}, [openNodeMenu]);
|
|
427
|
+
}, [openNodeMenu, onWillOpen]);
|
|
423
428
|
const handleClick = useCallback(event => {
|
|
424
429
|
if (resolution !== null && menuRef.current != null && event.target != null && !menuRef.current.contains(event.target)) {
|
|
425
430
|
closeNodeMenu();
|
|
@@ -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 './LexicalContextMenuPlugin.dev.
|
|
8
|
-
import * as modProd from './LexicalContextMenuPlugin.prod.
|
|
7
|
+
import * as modDev from './LexicalContextMenuPlugin.dev.mjs';
|
|
8
|
+
import * as modProd from './LexicalContextMenuPlugin.prod.mjs';
|
|
9
9
|
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
|
|
10
10
|
export const LexicalContextMenuPlugin = mod.LexicalContextMenuPlugin;
|
|
11
11
|
export const MenuOption = mod.MenuOption;
|
|
@@ -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('./LexicalContextMenuPlugin.dev.mjs') : import('./LexicalContextMenuPlugin.prod.mjs'));
|
|
8
|
+
export const LexicalContextMenuPlugin = mod.LexicalContextMenuPlugin;
|
|
9
|
+
export const MenuOption = mod.MenuOption;
|