@tiptap/core 3.4.3 → 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
  }