"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Checkbox = exports.checkboxInputType = exports.checkboxLabelType = exports.checkboxType = exports.CheckboxNode = exports.CheckboxAttr = void 0;
const inputrules_1 = require("../../../utils/inputrules.js");
const CheckboxSpecs_1 = require("./CheckboxSpecs/index.js");
const actions_1 = require("./actions.js");
const nodeviews_1 = require("./nodeviews.js");
const plugin_1 = require("./plugin.js");
const fix_paste_1 = require("./plugins/fix-paste.js");
const utils_1 = require("./utils.js");
require("./index.css");
const checkboxAction = 'addCheckbox';
var CheckboxSpecs_2 = require("./CheckboxSpecs/index.js");
Object.defineProperty(exports, "CheckboxAttr", { enumerable: true, get: function () { return CheckboxSpecs_2.CheckboxAttr; } });
Object.defineProperty(exports, "CheckboxNode", { enumerable: true, get: function () { return CheckboxSpecs_2.CheckboxNode; } });
Object.defineProperty(exports, "checkboxType", { enumerable: true, get: function () { return CheckboxSpecs_2.checkboxType; } });
Object.defineProperty(exports, "checkboxLabelType", { enumerable: true, get: function () { return CheckboxSpecs_2.checkboxLabelType; } });
Object.defineProperty(exports, "checkboxInputType", { enumerable: true, get: function () { return CheckboxSpecs_2.checkboxInputType; } });
const Checkbox = (builder, opts) => {
    builder.use(CheckboxSpecs_1.CheckboxSpecs, {
        ...opts,
        inputView: () => nodeviews_1.CheckboxInputView.create,
    });
    builder
        .addPlugin(plugin_1.keymapPlugin, builder.Priority.High)
        .addPlugin(fix_paste_1.fixPastePlugin)
        .addAction(checkboxAction, () => (0, actions_1.addCheckbox)())
        .addInputRules(({ schema }) => ({
        rules: [
            (0, inputrules_1.nodeInputRule)(/^\[(\s?)\]\s$/, (0, utils_1.checkboxType)(schema).createAndFill({}, (0, utils_1.checkboxInputType)(schema).create()), 2),
        ],
    }));
};
exports.Checkbox = Checkbox;
//# sourceMappingURL=index.js.map
