diff --git a/wax-prosemirror-components/src/components/tables/CreateTable.js b/wax-prosemirror-components/src/components/tables/CreateTable.js index d73814b07dcfbd6eebeb418cd696af998107b663..ec473050aebaa3e130ea46ad30f5ad54e9429aab 100644 --- a/wax-prosemirror-components/src/components/tables/CreateTable.js +++ b/wax-prosemirror-components/src/components/tables/CreateTable.js @@ -3,7 +3,6 @@ import React, { useState, useContext } from 'react'; import styled from 'styled-components'; import { ButtonStyles } from 'wax-prosemirror-themes'; import { WaxContext } from 'wax-prosemirror-core'; -import { Commands } from 'wax-prosemirror-utilities'; import InsertTableTool from '../../ui/tables/InsertTableTool'; const ButtonStyled = styled.button` @@ -60,7 +59,7 @@ const CreateTable = ({ view = {}, item }) => { <InsertTableToolContainer> <InsertTableTool onGridSelect={colRows => { - return Commands.createTable(colRows, state, dispatch); + item.run(colRows, state, dispatch); }} /> </InsertTableToolContainer> diff --git a/wax-prosemirror-services/src/TablesService/InsertTableService/Table.js b/wax-prosemirror-services/src/TablesService/InsertTableService/Table.js index a49047d1d9980fc0bdcea0c52e0e64aa5eda261d..f336a12e68903efb65f88b16e08a1980f4e1ed03 100644 --- a/wax-prosemirror-services/src/TablesService/InsertTableService/Table.js +++ b/wax-prosemirror-services/src/TablesService/InsertTableService/Table.js @@ -15,7 +15,9 @@ class Table extends Tools { name = 'Table'; get run() { - return (state, dispatch) => {}; + return (colRows, state, dispatch) => { + Commands.createTable(colRows, state, dispatch); + }; } select = (state, activeViewId) => {