@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.cjs CHANGED
@@ -2856,7 +2856,6 @@ var insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) =
2856
2856
  ...options
2857
2857
  };
2858
2858
  let content;
2859
- const { selection } = editor.state;
2860
2859
  const emitContentError = (error) => {
2861
2860
  editor.emit("contentError", {
2862
2861
  editor,
@@ -2929,9 +2928,11 @@ var insertContentAt = (position, value, options) => ({ tr, dispatch, editor }) =
2929
2928
  tr.insertText(newContent, from, to);
2930
2929
  } else {
2931
2930
  newContent = content;
2932
- const fromSelectionAtStart = selection.$from.parentOffset === 0;
2933
- const isTextSelection2 = selection.$from.node().isText || selection.$from.node().isTextblock;
2934
- const hasContent = selection.$from.node().content.size > 0;
2931
+ const $from = tr.doc.resolve(from);
2932
+ const $fromNode = $from.node();
2933
+ const fromSelectionAtStart = $from.parentOffset === 0;
2934
+ const isTextSelection2 = $fromNode.isText || $fromNode.isTextblock;
2935
+ const hasContent = $fromNode.content.size > 0;
2935
2936
  if (fromSelectionAtStart && isTextSelection2 && hasContent) {
2936
2937
  from = Math.max(0, from - 1);
2937
2938
  }
@@ -4756,13 +4757,14 @@ var Editor = class extends EventEmitter {
4756
4757
  ...(_a = this.options.editorProps) == null ? void 0 : _a.attributes
4757
4758
  },
4758
4759
  dispatchTransaction: this.dispatchTransaction.bind(this),
4759
- state: this.editorState
4760
+ state: this.editorState,
4761
+ markViews: this.extensionManager.markViews,
4762
+ nodeViews: this.extensionManager.nodeViews
4760
4763
  });
4761
4764
  const newState = this.state.reconfigure({
4762
4765
  plugins: this.extensionManager.plugins
4763
4766
  });
4764
4767
  this.view.updateState(newState);
4765
- this.createNodeViews();
4766
4768
  this.prependClass();
4767
4769
  this.injectCSS();
4768
4770
  const dom = this.view.dom;