import '@diplodoc/tabs-extension/runtime';
import { chainCommands } from 'prosemirror-commands';
import { YfmTabsSpecs } from "./YfmTabsSpecs/index.js";
import { createYfmTabs } from "./actions.js";
import { dragAutoSwitch, joinBackwardToOpenTab, liftEmptyBlockFromTabPanel, removeTabWhenCursorAtTheStartOfTab, tabEnter, tabPanelArrowDown, } from "./plugins.js";
import { tabPanelView, tabView, vtabInputView, vtabView } from "./views.js";
import '@diplodoc/tabs-extension/runtime/styles.css';
export { TabsNode, tabType, tabsType, tabsListType, tabPanelType } from "./YfmTabsSpecs/index.js";
const actionName = 'toYfmTabs';
export const YfmTabs = (builder) => {
    builder.use(YfmTabsSpecs, {
        tabView: () => tabView,
        tabPanelView: () => tabPanelView,
        vtabView: () => vtabView,
        vtabInputView: () => vtabInputView,
    });
    builder.addKeymap(() => ({
        Backspace: chainCommands(removeTabWhenCursorAtTheStartOfTab, joinBackwardToOpenTab),
        ArrowDown: tabPanelArrowDown,
        Enter: chainCommands(tabEnter, liftEmptyBlockFromTabPanel),
        'Shift-Enter': tabEnter,
    }), builder.Priority.High);
    builder.addAction(actionName, () => createYfmTabs);
    builder.addPlugin(dragAutoSwitch);
};
//# sourceMappingURL=index.js.map
