feat: add setAttributes method

This commit is contained in:
Michael Yang 2024-09-20 10:12:18 +08:00
parent 818a882b09
commit b25269c8af
1 changed files with 4 additions and 0 deletions

View File

@ -379,6 +379,10 @@ export class AiEditor {
return this.innerEditor.getAttributes(name);
}
setAttributes(name: string, attributes: Record<string, any>) {
this.innerEditor.commands.updateAttributes(name, attributes);
}
isActive(nameOrAttrs: any, attrs?: {}) {
if (typeof nameOrAttrs === "object" || !attrs) {
return this.innerEditor.isActive(nameOrAttrs);