"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSchemaSpecs = void 0;
const const_1 = require("./const.js");
const DEFAULT_PLACEHOLDERS = {
    Term: 'Definition term',
    Desc: 'Definition description',
};
const getSchemaSpecs = (opts, placeholder) => ({
    [const_1.DeflistNode.List]: {
        group: 'block',
        content: `(${const_1.DeflistNode.Term} ${const_1.DeflistNode.Desc})+`,
        parseDOM: [{ tag: 'dl' }],
        toDOM() {
            return ['dl', 0];
        },
        selectable: true,
        allowSelection: true,
        complex: 'root',
    },
    [const_1.DeflistNode.Term]: {
        defining: true,
        group: 'block',
        content: 'inline*',
        parseDOM: [{ tag: 'dt' }],
        toDOM() {
            return ['dt', 0];
        },
        placeholder: {
            content: placeholder?.[const_1.DeflistNode.Term] ??
                opts?.deflistTermPlaceholder ??
                DEFAULT_PLACEHOLDERS.Term,
            alwaysVisible: true,
        },
        selectable: false,
        allowSelection: false,
        complex: 'leaf',
    },
    [const_1.DeflistNode.Desc]: {
        defining: true,
        group: 'block',
        content: 'block+',
        parseDOM: [{ tag: 'dd' }],
        toDOM() {
            return ['dd', 0];
        },
        placeholder: {
            content: placeholder?.[const_1.DeflistNode.Desc] ??
                opts?.deflistDescPlaceholder ??
                DEFAULT_PLACEHOLDERS.Desc,
            alwaysVisible: true,
        },
        selectable: false,
        allowSelection: false,
        complex: 'leaf',
    },
});
exports.getSchemaSpecs = getSchemaSpecs;
//# sourceMappingURL=schema.js.map
