"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.schemaSpecs = void 0;
const const_1 = require("./const.js");
exports.schemaSpecs = {
    [const_1.ListNode.ListItem]: {
        attrs: {
            [const_1.ListsAttr.Tight]: { default: false },
            [const_1.ListsAttr.Markup]: { default: null },
        },
        content: '(paragraph|block)+',
        defining: true,
        parseDOM: [{ tag: 'li' }],
        toDOM() {
            return ['li', 0];
        },
        selectable: true,
        allowSelection: false,
        disableGapCursor: true,
        complex: 'leaf',
    },
    [const_1.ListNode.BulletList]: {
        content: `${const_1.ListNode.ListItem}+`,
        group: 'block',
        attrs: {
            [const_1.ListsAttr.Tight]: { default: false },
            [const_1.ListsAttr.Markup]: { default: const_1.Markup.bullet.default },
        },
        parseDOM: [
            {
                tag: 'ul',
                getAttrs: (dom) => ({
                    [const_1.ListsAttr.Tight]: dom.hasAttribute('data-tight'),
                }),
            },
        ],
        toDOM(node) {
            return ['ul', { 'data-tight': node.attrs[const_1.ListsAttr.Tight] ? 'true' : null }, 0];
        },
        selectable: false,
        allowSelection: false,
        complex: 'root',
    },
    [const_1.ListNode.OrderedList]: {
        attrs: {
            [const_1.ListsAttr.Order]: { default: 1 },
            [const_1.ListsAttr.Tight]: { default: false },
            [const_1.ListsAttr.Markup]: { default: const_1.Markup.ordered.default },
        },
        content: `${const_1.ListNode.ListItem}+`,
        group: 'block',
        parseDOM: [
            {
                tag: 'ol',
                getAttrs(dom) {
                    return {
                        [const_1.ListsAttr.Order]: dom.hasAttribute('start')
                            ? Number(dom.getAttribute('start'))
                            : 1,
                        [const_1.ListsAttr.Tight]: dom.hasAttribute('data-tight'),
                    };
                },
            },
        ],
        toDOM(node) {
            return [
                'ol',
                {
                    start: node.attrs[const_1.ListsAttr.Order] === 1 ? null : node.attrs[const_1.ListsAttr.Order],
                    'data-tight': node.attrs[const_1.ListsAttr.Tight] ? 'true' : null,
                },
                0,
            ];
        },
        selectable: false,
        allowSelection: false,
        complex: 'root',
    },
};
//# sourceMappingURL=schema.js.map
