import { mergeAttributes } from '@tiptap/core';
import { VueNodeViewRenderer } from '@tiptap/vue-2';
import Component from './paragraph-component.vue';
import Paragraph from '@tiptap/extension-paragraph';
export default Paragraph.extend({
    name: 'node-paragraph',
    draggable: true,
    group: 'block',
    content: 'inline*',
    addAttributes() {
        return {
            id: { default: null },
            type: { default: 'person' }
        };
    },
    parseHTML() {
        return [
            {
                tag: 'node-paragraph',
            },
        ];
    },
    renderHTML({ HTMLAttributes }) {
        return ['node-paragraph', mergeAttributes(HTMLAttributes), 0];
    },
    addCommands() {
        return {
            toggleNodeParagraph: attributes => ({ commands }) => {
                return commands.toggleNode('node-paragraph', 'paragraph', attributes);
            },
            setNodeParagraph: (entity) => ({ tr, dispatch }) => {
                if (dispatch) {
                }
                return true;
            },
        };
    },
    addNodeView() {
        return VueNodeViewRenderer(Component);
    },
});
//# sourceMappingURL=paragraph-extension.js.map