@manuscripts/track-changes-plugin 2.0.3 → 2.0.5
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.
|
@@ -64,7 +64,6 @@ function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResult, curr
|
|
|
64
64
|
console.log('Detected backspacing');
|
|
65
65
|
changeSteps.splice(changeSteps.indexOf(backSpacedText));
|
|
66
66
|
}
|
|
67
|
-
const textWasDeleted = !!changeSteps.length && !(fromA === fromB);
|
|
68
67
|
if (!backSpacedText && newSliceContent.size > 0) {
|
|
69
68
|
logger_1.log.info('newSliceContent', newSliceContent);
|
|
70
69
|
let fragment = (0, setFragmentAsInserted_1.setFragmentAsInserted)(newSliceContent, trackUtils.createNewInsertAttrs(attrs), oldState.schema);
|
|
@@ -74,14 +73,13 @@ function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResult, curr
|
|
|
74
73
|
if (moveID) {
|
|
75
74
|
fragment = (0, setFragmentAsInserted_1.setFragmentAsMoveChange)(newSliceContent, trackUtils.createNewMoveAttrs(attrs));
|
|
76
75
|
}
|
|
77
|
-
const
|
|
78
|
-
const openEnd = slice.openStart !== slice.openEnd ? 0 : slice.openEnd;
|
|
76
|
+
const isSearchReplace = tr.getMeta('searchReplace');
|
|
79
77
|
changeSteps.push({
|
|
80
78
|
type: 'insert-slice',
|
|
81
|
-
from:
|
|
82
|
-
to:
|
|
79
|
+
from: isSearchReplace ? toA : fromA,
|
|
80
|
+
to: isSearchReplace ? toA : fromA,
|
|
83
81
|
sliceWasSplit,
|
|
84
|
-
slice: new prosemirror_model_1.Slice(fragment, openStart, openEnd),
|
|
82
|
+
slice: new prosemirror_model_1.Slice(fragment, slice.openStart, slice.openEnd),
|
|
85
83
|
});
|
|
86
84
|
}
|
|
87
85
|
else {
|
|
@@ -38,7 +38,6 @@ export function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResul
|
|
|
38
38
|
console.log('Detected backspacing');
|
|
39
39
|
changeSteps.splice(changeSteps.indexOf(backSpacedText));
|
|
40
40
|
}
|
|
41
|
-
const textWasDeleted = !!changeSteps.length && !(fromA === fromB);
|
|
42
41
|
if (!backSpacedText && newSliceContent.size > 0) {
|
|
43
42
|
log.info('newSliceContent', newSliceContent);
|
|
44
43
|
let fragment = setFragmentAsInserted(newSliceContent, trackUtils.createNewInsertAttrs(attrs), oldState.schema);
|
|
@@ -48,14 +47,13 @@ export function trackReplaceStep(step, oldState, newTr, attrsTemplate, stepResul
|
|
|
48
47
|
if (moveID) {
|
|
49
48
|
fragment = setFragmentAsMoveChange(newSliceContent, trackUtils.createNewMoveAttrs(attrs));
|
|
50
49
|
}
|
|
51
|
-
const
|
|
52
|
-
const openEnd = slice.openStart !== slice.openEnd ? 0 : slice.openEnd;
|
|
50
|
+
const isSearchReplace = tr.getMeta('searchReplace');
|
|
53
51
|
changeSteps.push({
|
|
54
52
|
type: 'insert-slice',
|
|
55
|
-
from:
|
|
56
|
-
to:
|
|
53
|
+
from: isSearchReplace ? toA : fromA,
|
|
54
|
+
to: isSearchReplace ? toA : fromA,
|
|
57
55
|
sliceWasSplit,
|
|
58
|
-
slice: new Slice(fragment, openStart, openEnd),
|
|
56
|
+
slice: new Slice(fragment, slice.openStart, slice.openEnd),
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
59
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/track-changes-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"author": "Atypon Systems LLC",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/Atypon-OpenSource/manuscripts-track-changes-plugin",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"debug": "4.4.1",
|
|
29
29
|
"prosemirror-commands": "1.7.1",
|
|
30
30
|
"prosemirror-history": "1.4.1",
|
|
31
|
-
"prosemirror-model": "1.25.
|
|
31
|
+
"prosemirror-model": "1.25.0",
|
|
32
32
|
"prosemirror-state": "1.4.3",
|
|
33
33
|
"prosemirror-transform": "1.10.4",
|
|
34
34
|
"prosemirror-view": "1.40.0"
|