"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.YfmTabsSpecs = exports.tabsListType = exports.tabsType = exports.tabType = exports.tabPanelType = exports.TabsNode = void 0;
const tabs_extension_1 = require("@diplodoc/tabs-extension");
const schema_1 = require("../../../../utils/schema.js");
const const_1 = require("./const.js");
const md_plugin_1 = require("./md-plugin.js");
const parser_1 = require("./parser.js");
const schema_2 = require("./schema.js");
const serializer_1 = require("./serializer.js");
var const_2 = require("./const.js");
Object.defineProperty(exports, "TabsNode", { enumerable: true, get: function () { return const_2.TabsNode; } });
exports.tabPanelType = (0, schema_1.nodeTypeFactory)(const_1.TabsNode.TabPanel);
exports.tabType = (0, schema_1.nodeTypeFactory)(const_1.TabsNode.Tab);
exports.tabsType = (0, schema_1.nodeTypeFactory)(const_1.TabsNode.Tabs);
exports.tabsListType = (0, schema_1.nodeTypeFactory)(const_1.TabsNode.TabsList);
const YfmTabsSpecs = (builder, opts) => {
    const schemaSpecs = (0, schema_2.getSchemaSpecs)(opts);
    builder
        .configureMd((md) => md
        .use((0, tabs_extension_1.transform)({
        bundle: false,
        features: {
            enabledVariants: {
                regular: true,
                radio: true,
                dropdown: false,
                accordion: false,
            },
        },
    }))
        .use(md_plugin_1.tabsPostPlugin))
        .addNode(const_1.TabsNode.Tab, () => ({
        spec: schemaSpecs[const_1.TabsNode.Tab],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.Tab],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.Tab],
            tokenName: 'tab',
        },
        view: opts.tabView,
    }))
        .addNode(const_1.TabsNode.TabsList, () => ({
        spec: schemaSpecs[const_1.TabsNode.TabsList],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.TabsList],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.TabsList],
            tokenName: 'tab-list',
        },
        view: opts.tabsListView,
    }))
        .addNode(const_1.TabsNode.TabPanel, () => ({
        spec: schemaSpecs[const_1.TabsNode.TabPanel],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.TabPanel],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.TabPanel],
            tokenName: 'tab-panel',
        },
        view: opts.tabPanelView,
    }))
        .addNode(const_1.TabsNode.Tabs, () => ({
        spec: schemaSpecs[const_1.TabsNode.Tabs],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.Tabs],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.Tabs],
            tokenName: 'tabs',
        },
        view: opts.tabsView,
    }));
    builder
        .addNode(const_1.TabsNode.RadioTabs, () => ({
        spec: schemaSpecs[const_1.TabsNode.RadioTabs],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.RadioTabs],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.RadioTabs],
            tokenName: 'r-tabs',
        },
    }))
        .addNode(const_1.TabsNode.RadioTab, () => ({
        spec: schemaSpecs[const_1.TabsNode.RadioTab],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.RadioTab],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.RadioTab],
            tokenName: 'r-tab',
        },
        view: opts.vtabView,
    }))
        .addNode(const_1.TabsNode.RadioTabInput, () => ({
        spec: schemaSpecs[const_1.TabsNode.RadioTabInput],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.RadioTabInput],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.RadioTabInput],
            tokenName: 'r-tab-input',
        },
        view: opts.vtabInputView,
    }))
        .addNode(const_1.TabsNode.RadioTabLabel, () => ({
        spec: schemaSpecs[const_1.TabsNode.RadioTabLabel],
        toMd: serializer_1.serializerTokens[const_1.TabsNode.RadioTabLabel],
        fromMd: {
            tokenSpec: parser_1.parserTokens[const_1.TabsNode.RadioTabLabel],
            tokenName: 'r-tab-label',
        },
    }));
};
exports.YfmTabsSpecs = YfmTabsSpecs;
//# sourceMappingURL=index.js.map
