@tiptap/core 2.4.0 → 2.5.0-beta.0

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
@@ -1894,7 +1894,7 @@
1894
1894
  return commands$1.joinForward(state, dispatch);
1895
1895
  };
1896
1896
 
1897
- const joinItemBackward = () => ({ tr, state, dispatch, }) => {
1897
+ const joinItemBackward = () => ({ state, dispatch, tr, }) => {
1898
1898
  try {
1899
1899
  const point = transform.joinPoint(state.doc, state.selection.$from.pos, -1);
1900
1900
  if (point === null || point === undefined) {
@@ -1906,7 +1906,7 @@
1906
1906
  }
1907
1907
  return true;
1908
1908
  }
1909
- catch {
1909
+ catch (e) {
1910
1910
  return false;
1911
1911
  }
1912
1912
  };
@@ -4314,7 +4314,8 @@ img.ProseMirror-separator {
4314
4314
  tr.replaceWith(matchStart, end, newNode);
4315
4315
  }
4316
4316
  else if (match[0]) {
4317
- tr.insert(start - 1, config.type.create(attributes)).delete(tr.mapping.map(start), tr.mapping.map(end));
4317
+ const insertionStart = config.type.isInline ? start : start - 1;
4318
+ tr.insert(insertionStart, config.type.create(attributes)).delete(tr.mapping.map(start), tr.mapping.map(end));
4318
4319
  }
4319
4320
  tr.scrollIntoView();
4320
4321
  },