import { transform as yfmCut } from '@diplodoc/cut-extension';
import { CutNode } from "./const.js";
import { parserTokens } from "./parser.js";
import { getSchemaSpecs } from "./schema.js";
import { getSerializerTokens } from "./serializer.js";
export { CutAttr, CutNode, cutType, cutTitleType, cutContentType } from "./const.js";
export const YfmCutSpecs = (builder, opts) => {
    const schemaSpecs = getSchemaSpecs(opts, builder.context.get('placeholder'));
    const directiveSyntax = builder.context.get('directiveSyntax');
    const serializerTokens = getSerializerTokens({ directiveSyntax });
    builder
        .configureMd((md) => md.use(yfmCut({
        bundle: false,
        directiveSyntax: directiveSyntax?.mdPluginValueFor('yfmCut'),
    })))
        .addNode(CutNode.Cut, () => ({
        spec: schemaSpecs[CutNode.Cut],
        toMd: serializerTokens[CutNode.Cut],
        fromMd: {
            tokenSpec: parserTokens[CutNode.Cut],
        },
        view: opts.cutView,
    }))
        .addNode(CutNode.CutTitle, () => ({
        spec: schemaSpecs[CutNode.CutTitle],
        toMd: serializerTokens[CutNode.CutTitle],
        fromMd: {
            tokenSpec: parserTokens[CutNode.CutTitle],
        },
        view: opts.cutTitleView,
    }))
        .addNode(CutNode.CutContent, () => ({
        spec: schemaSpecs[CutNode.CutContent],
        toMd: serializerTokens[CutNode.CutContent],
        fromMd: {
            tokenSpec: parserTokens[CutNode.CutContent],
        },
        view: opts.cutContentView,
    }));
};
//# sourceMappingURL=index.js.map
