@tiptap/core 2.7.1 → 2.7.3

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