@tiptap/core 2.0.0-rc.2 → 2.0.0-rc.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
@@ -406,14 +406,16 @@
406
406
  }
407
407
 
408
408
  function cleanUpSchemaItem(data) {
409
- return Object.fromEntries(Object.entries(data).filter(([key, value]) => {
409
+ return Object.fromEntries(
410
+ // @ts-ignore
411
+ Object.entries(data).filter(([key, value]) => {
410
412
  if (key === 'attrs' && isEmptyObject(value)) {
411
413
  return false;
412
414
  }
413
415
  return value !== null && value !== undefined;
414
416
  }));
415
417
  }
416
- function getSchemaByResolvedExtensions(extensions) {
418
+ function getSchemaByResolvedExtensions(extensions, editor) {
417
419
  var _a;
418
420
  const allAttributes = getAttributesFromExtensions(extensions);
419
421
  const { nodeExtensions, markExtensions } = splitExtensions(extensions);
@@ -424,6 +426,7 @@
424
426
  name: extension.name,
425
427
  options: extension.options,
426
428
  storage: extension.storage,
429
+ editor,
427
430
  };
428
431
  const extraNodeFields = extensions.reduce((fields, e) => {
429
432
  const extendNodeSchema = getExtensionField(e, 'extendNodeSchema', context);
@@ -472,6 +475,7 @@
472
475
  name: extension.name,
473
476
  options: extension.options,
474
477
  storage: extension.storage,
478
+ editor,
475
479
  };
476
480
  const extraMarkFields = extensions.reduce((fields, e) => {
477
481
  const extendMarkSchema = getExtensionField(e, 'extendMarkSchema', context);
@@ -874,7 +878,7 @@
874
878
  this.splittableMarks = [];
875
879
  this.editor = editor;
876
880
  this.extensions = ExtensionManager.resolve(extensions);
877
- this.schema = getSchemaByResolvedExtensions(this.extensions);
881
+ this.schema = getSchemaByResolvedExtensions(this.extensions, editor);
878
882
  this.extensions.forEach(extension => {
879
883
  var _a;
880
884
  // store extension storage in editor
@@ -2026,9 +2030,9 @@
2026
2030
  return container.innerHTML;
2027
2031
  }
2028
2032
 
2029
- function getSchema(extensions) {
2033
+ function getSchema(extensions, editor) {
2030
2034
  const resolvedExtensions = ExtensionManager.resolve(extensions);
2031
- return getSchemaByResolvedExtensions(resolvedExtensions);
2035
+ return getSchemaByResolvedExtensions(resolvedExtensions, editor);
2032
2036
  }
2033
2037
 
2034
2038
  function generateHTML(doc, extensions) {