@atlaskit/editor-plugin-track-changes 3.0.2 → 3.0.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-track-changes
|
|
2
2
|
|
|
3
|
+
## 3.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`12afb3988d02e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/12afb3988d02e) -
|
|
8
|
+
[EDITOR-1429] fixed bug where creating inline comment is considered as changes in editor
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 3.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -79,7 +79,10 @@ var createTrackChangesPlugin = exports.createTrackChangesPlugin = function creat
|
|
|
79
79
|
var isDocChanged = tr.docChanged && tr.steps.some(function (step) {
|
|
80
80
|
return step instanceof _transform.ReplaceStep || step instanceof _transform.ReplaceAroundStep || step instanceof _transform.AddMarkStep || step instanceof _transform.RemoveMarkStep || step instanceof _transform.AttrStep;
|
|
81
81
|
});
|
|
82
|
-
|
|
82
|
+
var isAnnotationStep = function isAnnotationStep(step) {
|
|
83
|
+
return step instanceof _transform.AddMarkStep && step.mark.type.name === 'annotation';
|
|
84
|
+
};
|
|
85
|
+
if (!isDocChanged || tr.getMeta('isRemote') || tr.getMeta('replaceDocument') || tr.steps.some(isAnnotationStep)) {
|
|
83
86
|
// If the transaction is remote, we need to map the steps to the current document
|
|
84
87
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
85
88
|
steps: state.steps.map(function (s) {
|
|
@@ -54,7 +54,8 @@ export const createTrackChangesPlugin = api => {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
const isDocChanged = tr.docChanged && tr.steps.some(step => step instanceof ReplaceStep || step instanceof ReplaceAroundStep || step instanceof AddMarkStep || step instanceof RemoveMarkStep || step instanceof AttrStep);
|
|
57
|
-
|
|
57
|
+
const isAnnotationStep = step => step instanceof AddMarkStep && step.mark.type.name === 'annotation';
|
|
58
|
+
if (!isDocChanged || tr.getMeta('isRemote') || tr.getMeta('replaceDocument') || tr.steps.some(isAnnotationStep)) {
|
|
58
59
|
// If the transaction is remote, we need to map the steps to the current document
|
|
59
60
|
return {
|
|
60
61
|
...state,
|
|
@@ -72,7 +72,10 @@ export var createTrackChangesPlugin = function createTrackChangesPlugin(api) {
|
|
|
72
72
|
var isDocChanged = tr.docChanged && tr.steps.some(function (step) {
|
|
73
73
|
return step instanceof ReplaceStep || step instanceof ReplaceAroundStep || step instanceof AddMarkStep || step instanceof RemoveMarkStep || step instanceof AttrStep;
|
|
74
74
|
});
|
|
75
|
-
|
|
75
|
+
var isAnnotationStep = function isAnnotationStep(step) {
|
|
76
|
+
return step instanceof AddMarkStep && step.mark.type.name === 'annotation';
|
|
77
|
+
};
|
|
78
|
+
if (!isDocChanged || tr.getMeta('isRemote') || tr.getMeta('replaceDocument') || tr.steps.some(isAnnotationStep)) {
|
|
76
79
|
// If the transaction is remote, we need to map the steps to the current document
|
|
77
80
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
78
81
|
steps: state.steps.map(function (s) {
|