import { nodeInputRule } from "../../../utils/inputrules.js";
import { CheckboxSpecs } from "./CheckboxSpecs/index.js";
import { addCheckbox } from "./actions.js";
import { CheckboxInputView } from "./nodeviews.js";
import { keymapPlugin } from "./plugin.js";
import { fixPastePlugin } from "./plugins/fix-paste.js";
import { checkboxInputType, checkboxType } from "./utils.js";
import "./index.css";
const checkboxAction = 'addCheckbox';
export { CheckboxAttr, CheckboxNode, checkboxType, checkboxLabelType, checkboxInputType, } from "./CheckboxSpecs/index.js";
export const Checkbox = (builder, opts) => {
    builder.use(CheckboxSpecs, {
        ...opts,
        inputView: () => CheckboxInputView.create,
    });
    builder
        .addPlugin(keymapPlugin, builder.Priority.High)
        .addPlugin(fixPastePlugin)
        .addAction(checkboxAction, () => addCheckbox())
        .addInputRules(({ schema }) => ({
        rules: [
            nodeInputRule(/^\[(\s?)\]\s$/, checkboxType(schema).createAndFill({}, checkboxInputType(schema).create()), 2),
        ],
    }));
};
//# sourceMappingURL=index.js.map
