@tiptap/core 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +5 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/packages/core/src/Editor.d.ts +4 -2
- package/package.json +2 -2
- package/src/Editor.ts +9 -3
package/dist/index.cjs
CHANGED
|
@@ -4173,6 +4173,7 @@ class Editor extends EventEmitter {
|
|
|
4173
4173
|
*
|
|
4174
4174
|
* @param plugin A ProseMirror plugin
|
|
4175
4175
|
* @param handlePlugins Control how to merge the plugin into the existing plugins.
|
|
4176
|
+
* @returns The new editor state
|
|
4176
4177
|
*/
|
|
4177
4178
|
registerPlugin(plugin, handlePlugins) {
|
|
4178
4179
|
const plugins = isFunction(handlePlugins)
|
|
@@ -4180,15 +4181,17 @@ class Editor extends EventEmitter {
|
|
|
4180
4181
|
: [...this.state.plugins, plugin];
|
|
4181
4182
|
const state = this.state.reconfigure({ plugins });
|
|
4182
4183
|
this.view.updateState(state);
|
|
4184
|
+
return state;
|
|
4183
4185
|
}
|
|
4184
4186
|
/**
|
|
4185
4187
|
* Unregister a ProseMirror plugin.
|
|
4186
4188
|
*
|
|
4187
4189
|
* @param nameOrPluginKey The plugins name
|
|
4190
|
+
* @returns The new editor state or undefined if the editor is destroyed
|
|
4188
4191
|
*/
|
|
4189
4192
|
unregisterPlugin(nameOrPluginKey) {
|
|
4190
4193
|
if (this.isDestroyed) {
|
|
4191
|
-
return;
|
|
4194
|
+
return undefined;
|
|
4192
4195
|
}
|
|
4193
4196
|
// @ts-ignore
|
|
4194
4197
|
const name = typeof nameOrPluginKey === 'string' ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
|
|
@@ -4197,6 +4200,7 @@ class Editor extends EventEmitter {
|
|
|
4197
4200
|
plugins: this.state.plugins.filter(plugin => !plugin.key.startsWith(name)),
|
|
4198
4201
|
});
|
|
4199
4202
|
this.view.updateState(state);
|
|
4203
|
+
return state;
|
|
4200
4204
|
}
|
|
4201
4205
|
/**
|
|
4202
4206
|
* Creates an extension manager.
|