@tiptap/core 2.7.0 → 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.umd.js CHANGED
@@ -4169,6 +4169,7 @@ img.ProseMirror-separator {
4169
4169
  *
4170
4170
  * @param plugin A ProseMirror plugin
4171
4171
  * @param handlePlugins Control how to merge the plugin into the existing plugins.
4172
+ * @returns The new editor state
4172
4173
  */
4173
4174
  registerPlugin(plugin, handlePlugins) {
4174
4175
  const plugins = isFunction(handlePlugins)
@@ -4176,15 +4177,17 @@ img.ProseMirror-separator {
4176
4177
  : [...this.state.plugins, plugin];
4177
4178
  const state = this.state.reconfigure({ plugins });
4178
4179
  this.view.updateState(state);
4180
+ return state;
4179
4181
  }
4180
4182
  /**
4181
4183
  * Unregister a ProseMirror plugin.
4182
4184
  *
4183
4185
  * @param nameOrPluginKey The plugins name
4186
+ * @returns The new editor state or undefined if the editor is destroyed
4184
4187
  */
4185
4188
  unregisterPlugin(nameOrPluginKey) {
4186
4189
  if (this.isDestroyed) {
4187
- return;
4190
+ return undefined;
4188
4191
  }
4189
4192
  // @ts-ignore
4190
4193
  const name = typeof nameOrPluginKey === 'string' ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
@@ -4193,6 +4196,7 @@ img.ProseMirror-separator {
4193
4196
  plugins: this.state.plugins.filter(plugin => !plugin.key.startsWith(name)),
4194
4197
  });
4195
4198
  this.view.updateState(state);
4199
+ return state;
4196
4200
  }
4197
4201
  /**
4198
4202
  * Creates an extension manager.