]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/services/keyboard-handling.ts
Lexical: Updated tests for node changes
[bookstack] / resources / js / wysiwyg / services / keyboard-handling.ts
index 3f0b0c495e0c724337dd5f8831ca62c5c1898630..6a1345fac6d5596cfdf92c19919d8bf4fc9bd57c 100644 (file)
@@ -10,12 +10,12 @@ import {
     LexicalEditor,
     LexicalNode
 } from "lexical";
-import {$isImageNode} from "../nodes/image";
-import {$isMediaNode} from "../nodes/media";
+import {$isImageNode} from "@lexical/rich-text/LexicalImageNode";
+import {$isMediaNode} from "@lexical/rich-text/LexicalMediaNode";
 import {getLastSelection} from "../utils/selection";
 import {$getNearestNodeBlockParent} from "../utils/nodes";
-import {$isCustomListItemNode} from "../nodes/custom-list-item";
 import {$setInsetForSelection} from "../utils/lists";
+import {$isListItemNode} from "@lexical/list";
 
 function isSingleSelectedNode(nodes: LexicalNode[]): boolean {
     if (nodes.length === 1) {
@@ -62,7 +62,7 @@ function handleInsetOnTab(editor: LexicalEditor, event: KeyboardEvent|null): boo
     const change = event?.shiftKey ? -40 : 40;
     const selection = $getSelection();
     const nodes = selection?.getNodes() || [];
-    if (nodes.length > 1 || (nodes.length === 1 && $isCustomListItemNode(nodes[0].getParent()))) {
+    if (nodes.length > 1 || (nodes.length === 1 && $isListItemNode(nodes[0].getParent()))) {
         editor.update(() => {
             $setInsetForSelection(editor, change);
         });