const defaultOptions = {
    name: 'paragraph',
    title: 'Paragraph',
    tag: 'P',
    attributes: { class: 'paragraph' },
    icon: '<b>¶</b>',
    shortcut: 'Alt + Digit0',
    hint: '0',
    command: 'convert-to-paragraph',
    marks: [
        {
            tag: 'P',
            attributes: [],
        },
        {
            tag: 'DIV',
            attributes: [],
        },
    ],
};
const paragraphPlugin = (opts) => ({
    register(textarena) {
        const { name, title, tag, attributes, icon, shortcut, hint, command, marks, } = Object.assign(Object.assign({}, defaultOptions), (opts || {}));
        const arena = textarena.registerArena({
            name,
            tag,
            attributes,
            hasText: true,
        }, marks);
        textarena.setDefaultTextArena(arena);
        textarena.addSimpleArenas(arena);
        if (command) {
            textarena.registerCommand(command, (ta, selection) => ta.applyArenaToSelection(selection, arena));
            if (shortcut) {
                textarena.registerShortcut(shortcut, command);
            }
            if (icon) {
                textarena.registerTool({
                    name,
                    title,
                    icon,
                    shortcut,
                    hint,
                    command,
                    checkStatus: (node) => node.arena === arena,
                });
            }
        }
    },
});
export default paragraphPlugin;
//# sourceMappingURL=paragraphPlugin.js.map