"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.YfmTable = exports.yfmTableCellType = exports.yfmTableRowType = exports.yfmTableBodyType = exports.yfmTableType = exports.YfmTableNode = exports.convertToYfmTable = void 0;
const table_utils_1 = require("../../../table-utils/index.js");
const YfmTableSpecs_1 = require("./YfmTableSpecs/index.js");
const actions_1 = require("./actions.js");
const backspace_1 = require("./commands/backspace.js");
const goToNextRow_1 = require("./commands/goToNextRow.js");
const buttons_1 = require("./plugins/YfmTableControls/buttons.js");
const yfmTableTransformPastedPlugin_1 = require("./plugins/yfmTableTransformPastedPlugin.js");
const action = 'createYfmTable';
var convert_table_1 = require("./commands/convert-table.js");
Object.defineProperty(exports, "convertToYfmTable", { enumerable: true, get: function () { return convert_table_1.convertToYfmTable; } });
var YfmTableSpecs_2 = require("./YfmTableSpecs/index.js");
Object.defineProperty(exports, "YfmTableNode", { enumerable: true, get: function () { return YfmTableSpecs_2.YfmTableNode; } });
Object.defineProperty(exports, "yfmTableType", { enumerable: true, get: function () { return YfmTableSpecs_2.yfmTableType; } });
Object.defineProperty(exports, "yfmTableBodyType", { enumerable: true, get: function () { return YfmTableSpecs_2.yfmTableBodyType; } });
Object.defineProperty(exports, "yfmTableRowType", { enumerable: true, get: function () { return YfmTableSpecs_2.yfmTableRowType; } });
Object.defineProperty(exports, "yfmTableCellType", { enumerable: true, get: function () { return YfmTableSpecs_2.yfmTableCellType; } });
const YfmTable = (builder, options) => {
    builder.use(YfmTableSpecs_1.YfmTableSpecs, options);
    builder.addKeymap(() => ({
        Tab: (0, table_utils_1.goToNextCell)('next'),
        'Shift-Tab': (0, table_utils_1.goToNextCell)('prev'),
        ArrowDown: (0, goToNextRow_1.goToNextRow)('down'),
        ArrowUp: (0, goToNextRow_1.goToNextRow)('up'),
        Backspace: backspace_1.backspaceCommand,
    }));
    builder.addAction(action, () => actions_1.createYfmTable);
    builder.addPlugin(yfmTableTransformPastedPlugin_1.yfmTableTransformPastedPlugin);
    builder.addPlugin(buttons_1.yfmTableControlsPlugin);
};
exports.YfmTable = YfmTable;
//# sourceMappingURL=index.js.map
