@tiptap/core 2.0.0-beta.181 → 2.0.0-beta.182

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.
@@ -546,10 +546,10 @@ function isExtensionRulesEnabled(extension, enabled) {
546
546
  const getTextContentFromNodes = ($from, maxMatch = 500) => {
547
547
  let textBefore = '';
548
548
  $from.parent.nodesBetween(Math.max(0, $from.parentOffset - maxMatch), $from.parentOffset, (node, pos, parent, index) => {
549
- var _a, _b;
549
+ var _a, _b, _c;
550
550
  textBefore += ((_b = (_a = node.type.spec).toText) === null || _b === void 0 ? void 0 : _b.call(_a, {
551
551
  node, pos, parent, index,
552
- })) || node.textContent || '%leaf%';
552
+ })) || ((_c = $from.nodeBefore) === null || _c === void 0 ? void 0 : _c.text) || '%leaf%';
553
553
  });
554
554
  return textBefore;
555
555
  };
@@ -1938,10 +1938,8 @@ function createDocument(content, schema, parseOptions = {}) {
1938
1938
  const setContent = (content, emitUpdate = false, parseOptions = {}) => ({ tr, editor, dispatch }) => {
1939
1939
  const { doc } = tr;
1940
1940
  const document = createDocument(content, editor.schema, parseOptions);
1941
- const selection = prosemirrorState.TextSelection.create(doc, 0, doc.content.size);
1942
1941
  if (dispatch) {
1943
- tr.setSelection(selection)
1944
- .replaceSelectionWith(document, false)
1942
+ tr.replaceWith(0, doc.content.size, document)
1945
1943
  .setMeta('preventUpdate', !emitUpdate);
1946
1944
  }
1947
1945
  return true;