chore: Update Lexical to 0.7.5 (#2117)

This commit is contained in:
Aman Harwara
2022-12-23 22:22:19 +05:30
committed by GitHub
parent 1ec173dcd6
commit 2f3bc9b85b
43 changed files with 217 additions and 164 deletions

View File

@@ -12,6 +12,7 @@ import {mergeRegister} from '@lexical/utils';
import {
$getNearestNodeFromDOMNode,
$getNodeByKey,
$getRoot,
COMMAND_PRIORITY_HIGH,
COMMAND_PRIORITY_LOW,
DRAGOVER_COMMAND,
@@ -58,8 +59,7 @@ function getCurrentIndex(keysLength: number): number {
}
function getTopLevelNodeKeys(editor: LexicalEditor): string[] {
const root = editor.getEditorState()._nodeMap.get('root');
return root ? root.__children : [];
return editor.getEditorState().read(() => $getRoot().getChildrenKeys());
}
function elementContainingEventLocation(