@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.js CHANGED
@@ -1896,7 +1896,7 @@ const joinForward = () => ({ state, dispatch }) => {
1896
1896
  return joinForward$1(state, dispatch);
1897
1897
  };
1898
1898
 
1899
- const joinItemBackward = () => ({ tr, state, dispatch, }) => {
1899
+ const joinItemBackward = () => ({ state, dispatch, tr, }) => {
1900
1900
  try {
1901
1901
  const point = joinPoint(state.doc, state.selection.$from.pos, -1);
1902
1902
  if (point === null || point === undefined) {
@@ -1908,7 +1908,7 @@ const joinItemBackward = () => ({ tr, state, dispatch, }) => {
1908
1908
  }
1909
1909
  return true;
1910
1910
  }
1911
- catch {
1911
+ catch (e) {
1912
1912
  return false;
1913
1913
  }
1914
1914
  };
@@ -4316,7 +4316,8 @@ function nodeInputRule(config) {
4316
4316
  tr.replaceWith(matchStart, end, newNode);
4317
4317
  }
4318
4318
  else if (match[0]) {
4319
- tr.insert(start - 1, config.type.create(attributes)).delete(tr.mapping.map(start), tr.mapping.map(end));
4319
+ const insertionStart = config.type.isInline ? start : start - 1;
4320
+ tr.insert(insertionStart, config.type.create(attributes)).delete(tr.mapping.map(start), tr.mapping.map(end));
4320
4321
  }
4321
4322
  tr.scrollIntoView();
4322
4323
  },