@tiptap/core 2.1.0-rc.10 → 2.1.0-rc.12

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
@@ -1315,7 +1315,9 @@ const cut = (originRange, targetPos) => ({ editor }) => {
1315
1315
  return editor
1316
1316
  .chain()
1317
1317
  .deleteRange(originRange)
1318
- .insertContentAt(targetPos, contentSlice.content.toJSON())
1318
+ .command(({ commands, tr }) => {
1319
+ return commands.insertContentAt(tr.mapping.map(targetPos), contentSlice.content.toJSON());
1320
+ })
1319
1321
  .focus()
1320
1322
  .run();
1321
1323
  };
@@ -1649,7 +1651,7 @@ const insertContentAt = (position, value, options) => ({ tr, dispatch, editor })
1649
1651
  if (content.toString() === '<>') {
1650
1652
  return true;
1651
1653
  }
1652
- let { from, to } = typeof position === 'number' ? { from: tr.mapping.map(position), to: tr.mapping.map(position) } : { from: tr.mapping.map(position.from), to: tr.mapping.map(position.to) };
1654
+ let { from, to } = typeof position === 'number' ? { from: position, to: position } : { from: position.from, to: position.to };
1653
1655
  let isOnlyTextContent = true;
1654
1656
  let isOnlyBlockContent = true;
1655
1657
  const nodes = isFragment(content) ? content : [content];