@lexical/react 0.49.1-nightly.20260901.0 → 0.50.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/dist/LexicalAutoEmbedPlugin.d.ts +4 -47
- package/dist/LexicalAutoEmbedPlugin.dev.js +5 -31
- package/dist/LexicalAutoEmbedPlugin.dev.mjs +5 -30
- package/dist/LexicalAutoEmbedPlugin.prod.js +1 -1
- package/dist/LexicalAutoEmbedPlugin.prod.mjs +1 -1
- package/dist/LexicalAutoEmbedPluginUtils.d.ts +53 -0
- package/dist/LexicalAutoEmbedPluginUtils.dev.js +66 -0
- package/dist/LexicalAutoEmbedPluginUtils.dev.mjs +62 -0
- package/dist/LexicalAutoEmbedPluginUtils.js +11 -0
- package/dist/LexicalAutoEmbedPluginUtils.js.flow +40 -0
- package/dist/LexicalAutoEmbedPluginUtils.mjs +14 -0
- package/dist/LexicalAutoEmbedPluginUtils.node.mjs +12 -0
- package/dist/LexicalAutoEmbedPluginUtils.prod.js +9 -0
- package/dist/LexicalAutoEmbedPluginUtils.prod.mjs +9 -0
- package/dist/LexicalCollaborationContext.d.ts +1 -26
- package/dist/LexicalCollaborationContext.dev.js +5 -55
- package/dist/LexicalCollaborationContext.dev.mjs +4 -53
- package/dist/LexicalCollaborationContext.prod.js +2 -2
- package/dist/LexicalCollaborationContext.prod.mjs +2 -2
- package/dist/LexicalCollaborationContextUtils.d.ts +35 -0
- package/dist/LexicalCollaborationContextUtils.dev.js +83 -0
- package/dist/LexicalCollaborationContextUtils.dev.mjs +79 -0
- package/dist/LexicalCollaborationContextUtils.js +11 -0
- package/dist/LexicalCollaborationContextUtils.js.flow +25 -0
- package/dist/LexicalCollaborationContextUtils.mjs +14 -0
- package/dist/LexicalCollaborationContextUtils.node.mjs +12 -0
- package/dist/LexicalCollaborationContextUtils.prod.js +9 -0
- package/dist/LexicalCollaborationContextUtils.prod.mjs +9 -0
- package/dist/LexicalMenuOption.d.ts +29 -0
- package/dist/LexicalMenuOption.dev.js +51 -0
- package/dist/LexicalMenuOption.dev.mjs +49 -0
- package/dist/LexicalMenuOption.js +11 -0
- package/dist/LexicalMenuOption.js.flow +20 -0
- package/dist/LexicalMenuOption.mjs +12 -0
- package/dist/LexicalMenuOption.node.mjs +10 -0
- package/dist/LexicalMenuOption.prod.js +9 -0
- package/dist/LexicalMenuOption.prod.mjs +9 -0
- package/dist/LexicalNodeMenuPlugin.dev.js +5 -28
- package/dist/LexicalNodeMenuPlugin.dev.mjs +4 -27
- package/dist/LexicalNodeMenuPlugin.prod.js +1 -1
- package/dist/LexicalNodeMenuPlugin.prod.mjs +1 -1
- package/dist/LexicalTypeaheadMenuPlugin.d.ts +2 -34
- package/dist/LexicalTypeaheadMenuPlugin.dev.js +10 -78
- package/dist/LexicalTypeaheadMenuPlugin.dev.mjs +9 -76
- package/dist/LexicalTypeaheadMenuPlugin.prod.js +1 -1
- package/dist/LexicalTypeaheadMenuPlugin.prod.mjs +1 -1
- package/dist/LexicalTypeaheadMenuPluginUtils.d.ts +44 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.dev.js +81 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.dev.mjs +76 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.js +11 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.js.flow +34 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.mjs +15 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.node.mjs +13 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.prod.js +9 -0
- package/dist/LexicalTypeaheadMenuPluginUtils.prod.mjs +9 -0
- package/dist/shared/LexicalMenu.d.ts +5 -19
- package/package.json +164 -20
- package/src/LexicalAutoEmbedPlugin.tsx +12 -70
- package/src/LexicalAutoEmbedPluginUtils.ts +80 -0
- package/src/LexicalCollaborationContext.tsx +11 -90
- package/src/LexicalCollaborationContextUtils.ts +99 -0
- package/src/LexicalMenuOption.ts +39 -0
- package/src/LexicalTypeaheadMenuPlugin.tsx +6 -80
- package/src/LexicalTypeaheadMenuPluginUtils.ts +93 -0
- package/src/shared/LexicalMenu.tsx +12 -28
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
|
|
10
|
+
import {MenuOption} from '@lexical/react/LexicalMenuOption';
|
|
11
|
+
import {SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND} from '@lexical/react/LexicalTypeaheadMenuPluginUtils';
|
|
10
12
|
import {getScrollParent} from '@lexical/utils';
|
|
11
13
|
import {
|
|
12
14
|
$getSelection,
|
|
@@ -14,7 +16,6 @@ import {
|
|
|
14
16
|
CAN_USE_DOM,
|
|
15
17
|
COMMAND_PRIORITY_LOW,
|
|
16
18
|
type CommandListenerPriority,
|
|
17
|
-
createCommand,
|
|
18
19
|
getDOMShadowRoots,
|
|
19
20
|
getParentElement,
|
|
20
21
|
getRootOwnerDocument,
|
|
@@ -25,7 +26,6 @@ import {
|
|
|
25
26
|
KEY_ENTER_COMMAND,
|
|
26
27
|
KEY_ESCAPE_COMMAND,
|
|
27
28
|
KEY_TAB_COMMAND,
|
|
28
|
-
type LexicalCommand,
|
|
29
29
|
type LexicalEditor,
|
|
30
30
|
mergeRegister,
|
|
31
31
|
registerEventListener,
|
|
@@ -67,28 +67,10 @@ export type MenuResolution = {
|
|
|
67
67
|
getRect: () => DOMRect;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* Subclass it to attach your own data such as a label or callback.
|
|
75
|
-
*/
|
|
76
|
-
export class MenuOption {
|
|
77
|
-
key: string;
|
|
78
|
-
ref?: RefObject<HTMLElement | null>;
|
|
79
|
-
icon?: JSX.Element;
|
|
80
|
-
title?: JSX.Element | string;
|
|
81
|
-
|
|
82
|
-
constructor(key: string) {
|
|
83
|
-
this.key = key;
|
|
84
|
-
this.ref = {current: null};
|
|
85
|
-
this.setRefElement = this.setRefElement.bind(this);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
setRefElement(element: HTMLElement | null) {
|
|
89
|
-
this.ref = {current: element};
|
|
90
|
-
}
|
|
91
|
-
}
|
|
70
|
+
// Defined in its own entry point rather than here, for the same reason as the
|
|
71
|
+
// command above: this module is inlined into every entry that reaches it, so a
|
|
72
|
+
// class defined here would be a different class in each of them.
|
|
73
|
+
export {MenuOption};
|
|
92
74
|
|
|
93
75
|
/**
|
|
94
76
|
* A render function for a menu's contents. It receives the anchor element ref,
|
|
@@ -283,10 +265,12 @@ export function useDynamicPositioning(
|
|
|
283
265
|
}, [targetElement, editor, onVisibilityChange, onReposition, resolution]);
|
|
284
266
|
}
|
|
285
267
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
268
|
+
// Imported through the package path rather than defined here: this module is
|
|
269
|
+
// not an entry point, so it is inlined into every entry that reaches it, and a
|
|
270
|
+
// command created here would be a different object in each of them — including
|
|
271
|
+
// a different one from the command this package exports, which is the one a
|
|
272
|
+
// consumer dispatches. Re-exported for anything that imports it from here.
|
|
273
|
+
export {SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND};
|
|
290
274
|
|
|
291
275
|
function MenuItem({
|
|
292
276
|
index,
|