import { toggleMark } from 'prosemirror-commands';
import { createToggleMarkAction } from "../../../utils/actions.js";
import { markInputRule } from "../../../utils/inputrules.js";
import { withLogAction } from "../../../utils/keymap.js";
import { StrikeSpecs, strikeType } from "./StrikeSpecs/index.js";
export { strikeMarkName, strikeType } from "./StrikeSpecs/index.js";
const sAction = 'strike';
export const Strike = (builder, opts) => {
    builder.use(StrikeSpecs);
    builder
        .addAction(sAction, ({ schema }) => createToggleMarkAction(strikeType(schema)))
        .addInputRules(({ schema }) => ({
        rules: [
            markInputRule({ open: '~~', close: '~~', ignoreBetween: '~' }, strikeType(schema)),
        ],
    }));
    if (opts?.strikeKey) {
        const { strikeKey } = opts;
        builder.addKeymap(({ schema }) => ({
            [strikeKey]: withLogAction('strike', toggleMark(strikeType(schema))),
        }));
    }
};
//# sourceMappingURL=index.js.map
