@manuscripts/track-changes-plugin 1.7.5-LEAN-3278 → 1.7.6-LEAN-3278

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.
@@ -23,7 +23,6 @@ function getUpdatedDataTracked(dataTracked, changeId) {
23
23
  if (!dataTracked) {
24
24
  return null;
25
25
  }
26
- console.log(dataTracked);
27
26
  const newDataTracked = dataTracked.filter((c) => c.id !== changeId);
28
27
  return newDataTracked.length ? newDataTracked : null;
29
28
  }
@@ -33,6 +32,7 @@ function applyAcceptedRejectedChanges(tr, schema, changes, deleteMap = new prose
33
32
  const arr = attrsChangesLog.get(nodeId) || attrsChangesLog.set(nodeId, []).get(nodeId);
34
33
  arr.push(changeId);
35
34
  }
35
+ changes.sort((c1, c2) => c1.dataTracked.updatedAt - c2.dataTracked.updatedAt);
36
36
  changes.forEach((change) => {
37
37
  const { pos: from, deleted } = deleteMap.mapResult(change.from), node = tr.doc.nodeAt(from), noChangeNeeded = deleted || !ChangeSet_1.ChangeSet.shouldDeleteChange(change);
38
38
  if (!node) {
@@ -20,7 +20,6 @@ function getUpdatedDataTracked(dataTracked, changeId) {
20
20
  if (!dataTracked) {
21
21
  return null;
22
22
  }
23
- console.log(dataTracked);
24
23
  const newDataTracked = dataTracked.filter((c) => c.id !== changeId);
25
24
  return newDataTracked.length ? newDataTracked : null;
26
25
  }
@@ -30,6 +29,7 @@ export function applyAcceptedRejectedChanges(tr, schema, changes, deleteMap = ne
30
29
  const arr = attrsChangesLog.get(nodeId) || attrsChangesLog.set(nodeId, []).get(nodeId);
31
30
  arr.push(changeId);
32
31
  }
32
+ changes.sort((c1, c2) => c1.dataTracked.updatedAt - c2.dataTracked.updatedAt);
33
33
  changes.forEach((change) => {
34
34
  const { pos: from, deleted } = deleteMap.mapResult(change.from), node = tr.doc.nodeAt(from), noChangeNeeded = deleted || !ChangeSet.shouldDeleteChange(change);
35
35
  if (!node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manuscripts/track-changes-plugin",
3
- "version": "1.7.5-LEAN-3278",
3
+ "version": "1.7.6-LEAN-3278",
4
4
  "author": "Atypon Systems LLC",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/Atypon-OpenSource/manuscripts-track-changes-plugin",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@manuscripts/eslint-config": "^0.5.1",
29
- "@manuscripts/transform": "^1.5.1",
29
+ "@manuscripts/transform": "2.1.1",
30
30
  "@types/debug": "^4.1.7",
31
31
  "@types/jest": "27.5.1",
32
32
  "@types/node": "^18.7.18",