"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Strike = exports.strikeType = exports.strikeMarkName = void 0;
const prosemirror_commands_1 = require("prosemirror-commands");
const actions_1 = require("../../../utils/actions.js");
const inputrules_1 = require("../../../utils/inputrules.js");
const keymap_1 = require("../../../utils/keymap.js");
const StrikeSpecs_1 = require("./StrikeSpecs/index.js");
var StrikeSpecs_2 = require("./StrikeSpecs/index.js");
Object.defineProperty(exports, "strikeMarkName", { enumerable: true, get: function () { return StrikeSpecs_2.strikeMarkName; } });
Object.defineProperty(exports, "strikeType", { enumerable: true, get: function () { return StrikeSpecs_2.strikeType; } });
const sAction = 'strike';
const Strike = (builder, opts) => {
    builder.use(StrikeSpecs_1.StrikeSpecs);
    builder
        .addAction(sAction, ({ schema }) => (0, actions_1.createToggleMarkAction)((0, StrikeSpecs_1.strikeType)(schema)))
        .addInputRules(({ schema }) => ({
        rules: [
            (0, inputrules_1.markInputRule)({ open: '~~', close: '~~', ignoreBetween: '~' }, (0, StrikeSpecs_1.strikeType)(schema)),
        ],
    }));
    if (opts?.strikeKey) {
        const { strikeKey } = opts;
        builder.addKeymap(({ schema }) => ({
            [strikeKey]: (0, keymap_1.withLogAction)('strike', (0, prosemirror_commands_1.toggleMark)((0, StrikeSpecs_1.strikeType)(schema))),
        }));
    }
};
exports.Strike = Strike;
//# sourceMappingURL=index.js.map
