@tiptap/core 2.5.0-beta.3 → 2.5.0-beta.4

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
@@ -462,6 +462,7 @@
462
462
  selectable: callOrReturn(getExtensionField(extension, 'selectable', context)),
463
463
  draggable: callOrReturn(getExtensionField(extension, 'draggable', context)),
464
464
  code: callOrReturn(getExtensionField(extension, 'code', context)),
465
+ whitespace: callOrReturn(getExtensionField(extension, 'whitespace', context)),
465
466
  defining: callOrReturn(getExtensionField(extension, 'defining', context)),
466
467
  isolating: callOrReturn(getExtensionField(extension, 'isolating', context)),
467
468
  attrs: Object.fromEntries(extensionAttributes.map(extensionAttribute => {
@@ -1079,7 +1080,7 @@
1079
1080
  const addKeyboardShortcuts = getExtensionField(extension, 'addKeyboardShortcuts', context);
1080
1081
  let defaultBindings = {};
1081
1082
  // bind exit handling
1082
- if (extension.type === 'mark' && extension.config.exitable) {
1083
+ if (extension.type === 'mark' && getExtensionField(extension, 'exitable', context)) {
1083
1084
  defaultBindings.ArrowRight = () => Mark.handleExit({ editor, mark: extension });
1084
1085
  }
1085
1086
  if (addKeyboardShortcuts) {
@@ -1285,13 +1286,17 @@
1285
1286
  configure(options = {}) {
1286
1287
  // return a new instance so we can use the same extension
1287
1288
  // with different calls of `configure`
1288
- const extension = this.extend();
1289
+ const extension = this.extend({
1290
+ ...this.config,
1291
+ addOptions() {
1292
+ var _a;
1293
+ return mergeDeep(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)) || {}, options);
1294
+ },
1295
+ });
1296
+ // Always preserve the current name
1297
+ extension.name = this.name;
1298
+ // Set the parent to be our parent
1289
1299
  extension.parent = this.parent;
1290
- extension.options = mergeDeep(this.options, options);
1291
- extension.storage = callOrReturn(getExtensionField(extension, 'addStorage', {
1292
- name: extension.name,
1293
- options: extension.options,
1294
- }));
1295
1300
  return extension;
1296
1301
  }
1297
1302
  extend(extendedConfig = {}) {
@@ -1299,7 +1304,7 @@
1299
1304
  extension.parent = this;
1300
1305
  this.child = extension;
1301
1306
  extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
1302
- if (extendedConfig.defaultOptions) {
1307
+ if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
1303
1308
  console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
1304
1309
  }
1305
1310
  extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
@@ -3637,7 +3642,7 @@
3637
3642
  new state.Plugin({
3638
3643
  key: new state.PluginKey('tabindex'),
3639
3644
  props: {
3640
- attributes: this.editor.isEditable ? { tabindex: '0' } : {},
3645
+ attributes: () => (this.editor.isEditable ? { tabindex: '0' } : {}),
3641
3646
  },
3642
3647
  }),
3643
3648
  ];
@@ -4552,20 +4557,25 @@ img.ProseMirror-separator {
4552
4557
  configure(options = {}) {
4553
4558
  // return a new instance so we can use the same extension
4554
4559
  // with different calls of `configure`
4555
- const extension = this.extend();
4556
- extension.options = mergeDeep(this.options, options);
4557
- extension.storage = callOrReturn(getExtensionField(extension, 'addStorage', {
4558
- name: extension.name,
4559
- options: extension.options,
4560
- }));
4560
+ const extension = this.extend({
4561
+ ...this.config,
4562
+ addOptions() {
4563
+ var _a;
4564
+ return mergeDeep(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)) || {}, options);
4565
+ },
4566
+ });
4567
+ // Always preserve the current name
4568
+ extension.name = this.name;
4569
+ // Set the parent to be our parent
4570
+ extension.parent = this.parent;
4561
4571
  return extension;
4562
4572
  }
4563
4573
  extend(extendedConfig = {}) {
4564
- const extension = new Mark({ ...this.config, ...extendedConfig });
4574
+ const extension = new Mark(extendedConfig);
4565
4575
  extension.parent = this;
4566
4576
  this.child = extension;
4567
4577
  extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
4568
- if (extendedConfig.defaultOptions) {
4578
+ if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
4569
4579
  console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
4570
4580
  }
4571
4581
  extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {
@@ -4639,20 +4649,25 @@ img.ProseMirror-separator {
4639
4649
  configure(options = {}) {
4640
4650
  // return a new instance so we can use the same extension
4641
4651
  // with different calls of `configure`
4642
- const extension = this.extend();
4643
- extension.options = mergeDeep(this.options, options);
4644
- extension.storage = callOrReturn(getExtensionField(extension, 'addStorage', {
4645
- name: extension.name,
4646
- options: extension.options,
4647
- }));
4652
+ const extension = this.extend({
4653
+ ...this.config,
4654
+ addOptions() {
4655
+ var _a;
4656
+ return mergeDeep(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.call(this)) || {}, options);
4657
+ },
4658
+ });
4659
+ // Always preserve the current name
4660
+ extension.name = this.name;
4661
+ // Set the parent to be our parent
4662
+ extension.parent = this.parent;
4648
4663
  return extension;
4649
4664
  }
4650
4665
  extend(extendedConfig = {}) {
4651
- const extension = new Node({ ...this.config, ...extendedConfig });
4666
+ const extension = new Node(extendedConfig);
4652
4667
  extension.parent = this;
4653
4668
  this.child = extension;
4654
4669
  extension.name = extendedConfig.name ? extendedConfig.name : extension.parent.name;
4655
- if (extendedConfig.defaultOptions) {
4670
+ if (extendedConfig.defaultOptions && Object.keys(extendedConfig.defaultOptions).length > 0) {
4656
4671
  console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${extension.name}".`);
4657
4672
  }
4658
4673
  extension.options = callOrReturn(getExtensionField(extension, 'addOptions', {