From b25269c8af2db389af8e28908cc30c01681696d7 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 20 Sep 2024 10:12:18 +0800 Subject: [PATCH] feat: add setAttributes method --- src/core/AiEditor.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/AiEditor.ts b/src/core/AiEditor.ts index 6b9ed44..bc50b14 100644 --- a/src/core/AiEditor.ts +++ b/src/core/AiEditor.ts @@ -379,6 +379,10 @@ export class AiEditor { return this.innerEditor.getAttributes(name); } + setAttributes(name: string, attributes: Record) { + this.innerEditor.commands.updateAttributes(name, attributes); + } + isActive(nameOrAttrs: any, attrs?: {}) { if (typeof nameOrAttrs === "object" || !attrs) { return this.innerEditor.isActive(nameOrAttrs);