@manuscripts/track-changes-plugin 2.1.0 → 2.1.1

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.
@@ -67,7 +67,7 @@ function processChangeSteps(changes, startPos, newTr, emptyAttrs, schema, delete
67
67
  deletesCounter++;
68
68
  const prevDeletedNodeInserted = isInserted;
69
69
  const trackedData = (0, nodeHelpers_1.getBlockInlineTrackedData)(c.node);
70
- const inserted = trackedData === null || trackedData === void 0 ? void 0 : trackedData.find((d) => d.operation === change_1.CHANGE_OPERATION.insert);
70
+ const inserted = trackedData === null || trackedData === void 0 ? void 0 : trackedData.find((d) => d.operation === change_1.CHANGE_OPERATION.insert || d.operation === change_1.CHANGE_OPERATION.wrap_with_node);
71
71
  const structure = trackedData === null || trackedData === void 0 ? void 0 : trackedData.find((c) => c.operation === change_1.CHANGE_OPERATION.structure &&
72
72
  deleteAttrs.moveNodeId &&
73
73
  c.moveNodeId !== deleteAttrs.moveNodeId);
@@ -39,7 +39,7 @@ function revertWrapNodeChange(tr, change, deleteMap) {
39
39
  tr.doc.nodesBetween(from, to, (node, pos) => {
40
40
  const $fromPos = tr.doc.resolve(tr.mapping.map(pos));
41
41
  const $toPos = tr.doc.resolve(tr.mapping.map(pos + node.nodeSize - 1));
42
- const nodeRange = $fromPos.blockRange($toPos);
42
+ const nodeRange = $fromPos.blockRange($toPos, (node) => { var _a; return !!((_a = change.node) === null || _a === void 0 ? void 0 : _a.type.contentMatch.matchType(node.type)); });
43
43
  if (!nodeRange) {
44
44
  return;
45
45
  }
@@ -31,7 +31,7 @@ export function processChangeSteps(changes, startPos, newTr, emptyAttrs, schema,
31
31
  deletesCounter++;
32
32
  const prevDeletedNodeInserted = isInserted;
33
33
  const trackedData = getBlockInlineTrackedData(c.node);
34
- const inserted = trackedData === null || trackedData === void 0 ? void 0 : trackedData.find((d) => d.operation === CHANGE_OPERATION.insert);
34
+ const inserted = trackedData === null || trackedData === void 0 ? void 0 : trackedData.find((d) => d.operation === CHANGE_OPERATION.insert || d.operation === CHANGE_OPERATION.wrap_with_node);
35
35
  const structure = trackedData === null || trackedData === void 0 ? void 0 : trackedData.find((c) => c.operation === CHANGE_OPERATION.structure &&
36
36
  deleteAttrs.moveNodeId &&
37
37
  c.moveNodeId !== deleteAttrs.moveNodeId);
@@ -35,7 +35,7 @@ export function revertWrapNodeChange(tr, change, deleteMap) {
35
35
  tr.doc.nodesBetween(from, to, (node, pos) => {
36
36
  const $fromPos = tr.doc.resolve(tr.mapping.map(pos));
37
37
  const $toPos = tr.doc.resolve(tr.mapping.map(pos + node.nodeSize - 1));
38
- const nodeRange = $fromPos.blockRange($toPos);
38
+ const nodeRange = $fromPos.blockRange($toPos, (node) => { var _a; return !!((_a = change.node) === null || _a === void 0 ? void 0 : _a.type.contentMatch.matchType(node.type)); });
39
39
  if (!nodeRange) {
40
40
  return;
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manuscripts/track-changes-plugin",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "author": "Atypon Systems LLC",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/Atypon-OpenSource/manuscripts-track-changes-plugin",