diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 3a094673..19e6b327 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -117,6 +117,19 @@ export class Editor extends EventEmitter { this.view.updateState(state) } + public unregisterPlugin(name: string) { + if (!name) { + return + } + + const state = this.state.reconfigure({ + // @ts-ignore + plugins: this.state.plugins.filter(plugin => !plugin.key.startsWith(`${name}$`)), + }) + + this.view.updateState(state) + } + public command(name: string, ...args: any) { return this.commands[name](...args) }