@tiptap/core 3.4.2 → 3.4.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.js CHANGED
@@ -2735,7 +2735,6 @@ var insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) =
2735
2735
  ...options
2736
2736
  };
2737
2737
  let content;
2738
- const { selection } = editor.state;
2739
2738
  const emitContentError = (error) => {
2740
2739
  editor.emit("contentError", {
2741
2740
  editor,
@@ -2808,9 +2807,11 @@ var insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) =
2808
2807
  tr.insertText(newContent, from, to);
2809
2808
  } else {
2810
2809
  newContent = content;
2811
- const fromSelectionAtStart = selection.$from.parentOffset === 0;
2812
- const isTextSelection2 = selection.$from.node().isText || selection.$from.node().isTextblock;
2813
- const hasContent = selection.$from.node().content.size > 0;
2810
+ const $from = tr.doc.resolve(from);
2811
+ const $fromNode = $from.node();
2812
+ const fromSelectionAtStart = $from.parentOffset === 0;
2813
+ const isTextSelection2 = $fromNode.isText || $fromNode.isTextblock;
2814
+ const hasContent = $fromNode.content.size > 0;
2814
2815
  if (fromSelectionAtStart && isTextSelection2 && hasContent) {
2815
2816
  from = Math.max(0, from - 1);
2816
2817
  }
@@ -4640,13 +4641,14 @@ var Editor = class extends EventEmitter {
4640
4641
  ...(_a = this.options.editorProps) == null ? void 0 : _a.attributes
4641
4642
  },
4642
4643
  dispatchTransaction: this.dispatchTransaction.bind(this),
4643
- state: this.editorState
4644
+ state: this.editorState,
4645
+ markViews: this.extensionManager.markViews,
4646
+ nodeViews: this.extensionManager.nodeViews
4644
4647
  });
4645
4648
  const newState = this.state.reconfigure({
4646
4649
  plugins: this.extensionManager.plugins
4647
4650
  });
4648
4651
  this.view.updateState(newState);
4649
- this.createNodeViews();
4650
4652
  this.prependClass();
4651
4653
  this.injectCSS();
4652
4654
  const dom = this.view.dom;