@manuscripts/track-changes-plugin 1.9.3-LEAN-4179.0 → 1.9.3
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.
|
@@ -30,7 +30,10 @@ function applyAcceptedRejectedChanges(tr, schema, changes, changeSet, deleteMap
|
|
|
30
30
|
}
|
|
31
31
|
const { pos: from, deleted } = deleteMap.mapResult(change.from);
|
|
32
32
|
const node = tr.doc.nodeAt(from);
|
|
33
|
-
const noChangeNeeded =
|
|
33
|
+
const noChangeNeeded = !ChangeSet_1.ChangeSet.shouldDeleteChange(change);
|
|
34
|
+
if (deleted) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
34
37
|
if (!node) {
|
|
35
38
|
!deleted && logger_1.log.warn('no node found to update for change', change);
|
|
36
39
|
return;
|
|
@@ -14,7 +14,7 @@ function mergeNode(node, pos, tr) {
|
|
|
14
14
|
const resPos = tr.doc.resolve(pos);
|
|
15
15
|
const canMergeToNodeAbove = (resPos.parent !== tr.doc || resPos.nodeBefore) && ((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.isText);
|
|
16
16
|
if (canMergeToNodeAbove) {
|
|
17
|
-
return tr.replaceWith(
|
|
17
|
+
return tr.replaceWith(pos - 1, pos + 1, prosemirror_model_1.Fragment.empty);
|
|
18
18
|
}
|
|
19
19
|
return undefined;
|
|
20
20
|
}
|
|
@@ -26,7 +26,10 @@ export function applyAcceptedRejectedChanges(tr, schema, changes, changeSet, del
|
|
|
26
26
|
}
|
|
27
27
|
const { pos: from, deleted } = deleteMap.mapResult(change.from);
|
|
28
28
|
const node = tr.doc.nodeAt(from);
|
|
29
|
-
const noChangeNeeded =
|
|
29
|
+
const noChangeNeeded = !ChangeSet.shouldDeleteChange(change);
|
|
30
|
+
if (deleted) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
30
33
|
if (!node) {
|
|
31
34
|
!deleted && log.warn('no node found to update for change', change);
|
|
32
35
|
return;
|
|
@@ -11,7 +11,7 @@ export function mergeNode(node, pos, tr) {
|
|
|
11
11
|
const resPos = tr.doc.resolve(pos);
|
|
12
12
|
const canMergeToNodeAbove = (resPos.parent !== tr.doc || resPos.nodeBefore) && ((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.isText);
|
|
13
13
|
if (canMergeToNodeAbove) {
|
|
14
|
-
return tr.replaceWith(
|
|
14
|
+
return tr.replaceWith(pos - 1, pos + 1, Fragment.empty);
|
|
15
15
|
}
|
|
16
16
|
return undefined;
|
|
17
17
|
}
|
package/package.json
CHANGED