"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeYfmTable = void 0;
// @ts-ignore // TODO: fix cjs build
const prosemirror_utils_1 = require("prosemirror-utils");
const utils_1 = require("../utils.js");
const removeYfmTable = (state, dispatch) => {
    const parentTable = (0, prosemirror_utils_1.findParentNodeOfType)((0, utils_1.yfmTableType)(state.schema))(state.selection);
    if (!parentTable)
        return false;
    dispatch?.((0, prosemirror_utils_1.removeParentNodeOfType)(parentTable.node.type)(state.tr));
    return true;
};
exports.removeYfmTable = removeYfmTable;
//# sourceMappingURL=remove-table.js.map
