import checkboxPlugin from '@diplodoc/transform/lib/plugins/checkbox';
import { CheckboxNode, b, idPrefix } from "./const.js";
import { parserTokens } from "./parser.js";
import { getSchemaSpecs } from "./schema.js";
import { serializerTokens } from "./serializer.js";
export { CheckboxAttr, CheckboxNode, checkboxType, checkboxLabelType, checkboxInputType, } from "./const.js";
export const CheckboxSpecs = (builder, opts) => {
    const schemaSpecs = getSchemaSpecs(opts, builder.context.get('placeholder'));
    builder
        .configureMd((md) => md.use(checkboxPlugin, { idPrefix, divClass: b() }))
        .addNode(CheckboxNode.Checkbox, () => ({
        spec: schemaSpecs[CheckboxNode.Checkbox],
        toMd: serializerTokens[CheckboxNode.Checkbox],
        fromMd: {
            tokenSpec: parserTokens[CheckboxNode.Checkbox],
        },
        view: opts.checkboxView,
    }))
        .addNode(CheckboxNode.Input, () => ({
        spec: schemaSpecs[CheckboxNode.Input],
        toMd: serializerTokens[CheckboxNode.Input],
        fromMd: {
            tokenSpec: parserTokens[CheckboxNode.Input],
        },
        view: opts.inputView,
    }))
        .addNode(CheckboxNode.Label, () => ({
        spec: schemaSpecs[CheckboxNode.Label],
        toMd: serializerTokens[CheckboxNode.Label],
        fromMd: {
            tokenSpec: parserTokens[CheckboxNode.Label],
            tokenName: 'checkbox_label',
        },
        view: opts.labelView,
    }));
};
//# sourceMappingURL=index.js.map
