"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.YfmTabs = exports.tabPanelType = exports.tabsListType = exports.tabsType = exports.tabType = exports.TabsNode = void 0;
require("@diplodoc/tabs-extension/runtime");
const prosemirror_commands_1 = require("prosemirror-commands");
const YfmTabsSpecs_1 = require("./YfmTabsSpecs/index.js");
const actions_1 = require("./actions.js");
const plugins_1 = require("./plugins.js");
const views_1 = require("./views.js");
require("@diplodoc/tabs-extension/runtime/styles.css");
var YfmTabsSpecs_2 = require("./YfmTabsSpecs/index.js");
Object.defineProperty(exports, "TabsNode", { enumerable: true, get: function () { return YfmTabsSpecs_2.TabsNode; } });
Object.defineProperty(exports, "tabType", { enumerable: true, get: function () { return YfmTabsSpecs_2.tabType; } });
Object.defineProperty(exports, "tabsType", { enumerable: true, get: function () { return YfmTabsSpecs_2.tabsType; } });
Object.defineProperty(exports, "tabsListType", { enumerable: true, get: function () { return YfmTabsSpecs_2.tabsListType; } });
Object.defineProperty(exports, "tabPanelType", { enumerable: true, get: function () { return YfmTabsSpecs_2.tabPanelType; } });
const actionName = 'toYfmTabs';
const YfmTabs = (builder) => {
    builder.use(YfmTabsSpecs_1.YfmTabsSpecs, {
        tabView: () => views_1.tabView,
        tabPanelView: () => views_1.tabPanelView,
        vtabView: () => views_1.vtabView,
        vtabInputView: () => views_1.vtabInputView,
    });
    builder.addKeymap(() => ({
        Backspace: (0, prosemirror_commands_1.chainCommands)(plugins_1.removeTabWhenCursorAtTheStartOfTab, plugins_1.joinBackwardToOpenTab),
        ArrowDown: plugins_1.tabPanelArrowDown,
        Enter: (0, prosemirror_commands_1.chainCommands)(plugins_1.tabEnter, plugins_1.liftEmptyBlockFromTabPanel),
        'Shift-Enter': plugins_1.tabEnter,
    }), builder.Priority.High);
    builder.addAction(actionName, () => actions_1.createYfmTabs);
    builder.addPlugin(plugins_1.dragAutoSwitch);
};
exports.YfmTabs = YfmTabs;
//# sourceMappingURL=index.js.map
