]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/ui/framework/helpers/table-selection-handler.ts
Lexical: Added mobile toolbar support
[bookstack] / resources / js / wysiwyg / ui / framework / helpers / table-selection-handler.ts
index 0557b37e53ef4e9dc2a8606ac9a6a880d5173eec..d3d8925505f8a71074b4138c35caec38c51b611e 100644 (file)
@@ -7,7 +7,6 @@ import {
     TableNode,
     TableObserver
 } from "@lexical/table";
-import {$isCustomTableNode, CustomTableNode} from "../../../nodes/custom-table";
 
 // File adapted from logic in:
 // https://github.com/facebook/lexical/blob/f373759a7849f473d34960a6bf4e34b2a011e762/packages/lexical-react/src/LexicalTablePlugin.ts#L49
@@ -26,12 +25,12 @@ class TableSelectionHandler {
     }
 
     protected init() {
-        this.unregisterMutationListener = this.editor.registerMutationListener(CustomTableNode, (mutations) => {
+        this.unregisterMutationListener = this.editor.registerMutationListener(TableNode, (mutations) => {
             for (const [nodeKey, mutation] of mutations) {
                 if (mutation === 'created') {
                     this.editor.getEditorState().read(() => {
-                        const tableNode = $getNodeByKey<CustomTableNode>(nodeKey);
-                        if ($isCustomTableNode(tableNode)) {
+                        const tableNode = $getNodeByKey<TableNode>(nodeKey);
+                        if ($isTableNode(tableNode)) {
                             this.initializeTableNode(tableNode);
                         }
                     });