"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FoldingHeading = void 0;
const FoldingHeadingSpec_1 = require("./FoldingHeadingSpec/index.js");
const actions_1 = require("./actions.js");
const commands_1 = require("./commands/index.js");
const input_rules_1 = require("./input-rules.js");
const Folding_1 = require("./plugins/Folding.js");
const utils_1 = require("./utils.js");
require("@diplodoc/folding-headings-extension/runtime/styles.css");
const action = 'toggleHeadingFolding';
const FoldingHeading = (builder) => {
    builder.use(FoldingHeadingSpec_1.FoldingHeadingSpecs);
    builder.addAction(action, () => actions_1.toggleHeadingFoldingAction);
    builder.addInputRules(({ schema }) => ({ rules: [(0, input_rules_1.foldingHeadingRule)((0, utils_1.headingType)(schema), 6)] }));
    builder.addKeymap(() => ({
        Enter: commands_1.openHeadingAndCreateParagraphAfterIfCursorAtEndOfHeading,
        Backspace: commands_1.removeFoldingIfCursorAtStartOfHeading,
    }), builder.Priority.High);
    builder.addPlugin(Folding_1.foldingPlugin);
};
exports.FoldingHeading = FoldingHeading;
//# sourceMappingURL=FoldingHeading.js.map
