import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js';
export default class UmbTiptapToolbarTextAlignCenterExtensionApi extends UmbTiptapToolbarElementApiBase {
    isActive(editor) {
        return editor?.isActive({ textAlign: 'center' }) === true;
    }
    execute(editor) {
        if (!this.isActive(editor)) {
            editor?.chain().focus().setTextAlign('center').run();
        }
        else {
            editor?.chain().focus().unsetTextAlign().run();
        }
    }
}
