"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.headingAction = void 0;
const prosemirror_commands_1 = require("prosemirror-commands");
const const_1 = require("./const.js");
const utils_1 = require("./utils.js");
const headingAction = (nodeType, level) => {
    const cmd = (0, prosemirror_commands_1.setBlockType)(nodeType, { [const_1.headingLevelAttr]: level });
    return {
        isActive: (0, utils_1.hasParentHeading)(level),
        isEnable: cmd,
        run: cmd,
    };
};
exports.headingAction = headingAction;
//# sourceMappingURL=actions.js.map
