@atlaskit/editor-plugin-collab-edit 7.1.3 → 7.1.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.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/pm-plugins/mergeUnconfirmed.js +1 -6
- package/dist/cjs/pm-plugins/track-steps.js +6 -9
- package/dist/cjs/pm-plugins/utils.js +11 -0
- package/dist/es2019/pm-plugins/mergeUnconfirmed.js +1 -6
- package/dist/es2019/pm-plugins/track-steps.js +4 -7
- package/dist/es2019/pm-plugins/utils.js +8 -1
- package/dist/esm/pm-plugins/mergeUnconfirmed.js +1 -6
- package/dist/esm/pm-plugins/track-steps.js +6 -9
- package/dist/esm/pm-plugins/utils.js +12 -1
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 7.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a05464ea42678`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a05464ea42678) -
|
|
8
|
+
EDITOR-2791 bump adf-schema
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.1.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`b9fcf9966a0a4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b9fcf9966a0a4) -
|
|
16
|
+
Treat BatchAttrsStep as not organic when only localIds are being changed
|
|
17
|
+
|
|
3
18
|
## 7.1.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.mergeUnconfirmedSteps = mergeUnconfirmedSteps;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
|
|
10
9
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
10
|
var isLocked = function isLocked(step) {
|
|
@@ -41,11 +40,7 @@ function mergeUnconfirmedSteps(steps, api) {
|
|
|
41
40
|
// As we want to wait until all the transactions have been pushed through
|
|
42
41
|
var origin = lastStep.origin;
|
|
43
42
|
if (mergedStep && inverted) {
|
|
44
|
-
|
|
45
|
-
acc[acc.length - 1] = new _prosemirrorCollab.Rebaseable(mergedStep, inverted, origin instanceof _state.Transaction ? origin.setMeta('isOffline', origin.getMeta('isOffline') === true || isOffline) : origin);
|
|
46
|
-
} else {
|
|
47
|
-
acc[acc.length - 1] = new _prosemirrorCollab.Rebaseable(mergedStep, inverted, origin instanceof _state.Transaction ? origin.setMeta('isOffline', isOffline) : origin);
|
|
48
|
-
}
|
|
43
|
+
acc[acc.length - 1] = new _prosemirrorCollab.Rebaseable(mergedStep, inverted, origin instanceof _state.Transaction ? origin.setMeta('isOffline', origin.getMeta('isOffline') === true || isOffline) : origin);
|
|
49
44
|
return acc;
|
|
50
45
|
}
|
|
51
46
|
}
|
|
@@ -8,7 +8,6 @@ exports.track = exports.task = exports.sanitizeStep = exports.groupSteps = void
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
10
10
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
|
|
13
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var _trackStepMetrics = require("./track-step-metrics");
|
|
@@ -177,14 +176,12 @@ var track = exports.track = function track(_ref3) {
|
|
|
177
176
|
endedAt: endedAt,
|
|
178
177
|
steps: steps
|
|
179
178
|
});
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
});
|
|
187
|
-
}
|
|
179
|
+
(0, _trackStepMetrics.updateNcsSessionStepMetrics)({
|
|
180
|
+
api: api,
|
|
181
|
+
steps: (0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(function (step) {
|
|
182
|
+
return !(step instanceof _steps.AnalyticsStep);
|
|
183
|
+
}) : newSteps
|
|
184
|
+
});
|
|
188
185
|
scheduler.postTask(function () {
|
|
189
186
|
task(stepsSentCache, onTrackDataProcessed);
|
|
190
187
|
}, {
|
|
@@ -17,6 +17,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
17
17
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
18
18
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
19
19
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var findPointers = exports.findPointers = function findPointers(id, decorations) {
|
|
21
22
|
return decorations.find().reduce(function (arr, deco) {
|
|
22
23
|
return deco.spec.pointer.presenceId === id ? arr.concat(deco) : arr;
|
|
@@ -216,6 +217,16 @@ var isOrganicChange = exports.isOrganicChange = function isOrganicChange(tr) {
|
|
|
216
217
|
return false;
|
|
217
218
|
}
|
|
218
219
|
|
|
220
|
+
// editor-plugin-local-id uses BatchAttrStep to set the localId attribute
|
|
221
|
+
if (step instanceof _steps.BatchAttrsStep && (0, _platformFeatureFlags.fg)('platform_editor_inorganic_batchattrsstep_localid')) {
|
|
222
|
+
var _allAttributes = step.data.map(function (data) {
|
|
223
|
+
return Object.keys(data.attrs);
|
|
224
|
+
}).flat();
|
|
225
|
+
return _allAttributes.some(function (attr) {
|
|
226
|
+
return attr !== 'localId';
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
219
230
|
// If a step is not an instance of SetAttrsStep, it is considered organic
|
|
220
231
|
if (!(step instanceof _steps.SetAttrsStep)) {
|
|
221
232
|
return true;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { Rebaseable } from '@atlaskit/prosemirror-collab';
|
|
4
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
const isLocked = step => {
|
|
@@ -35,11 +34,7 @@ export function mergeUnconfirmedSteps(steps, api) {
|
|
|
35
34
|
// As we want to wait until all the transactions have been pushed through
|
|
36
35
|
const origin = lastStep.origin;
|
|
37
36
|
if (mergedStep && inverted) {
|
|
38
|
-
|
|
39
|
-
acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', origin.getMeta('isOffline') === true || isOffline) : origin);
|
|
40
|
-
} else {
|
|
41
|
-
acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', isOffline) : origin);
|
|
42
|
-
}
|
|
37
|
+
acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', origin.getMeta('isOffline') === true || isOffline) : origin);
|
|
43
38
|
return acc;
|
|
44
39
|
}
|
|
45
40
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AnalyticsStep, SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
2
2
|
import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { sendableSteps } from '@atlaskit/prosemirror-collab';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { updateNcsSessionStepMetrics } from './track-step-metrics';
|
|
@@ -155,12 +154,10 @@ export const track = ({
|
|
|
155
154
|
endedAt,
|
|
156
155
|
steps
|
|
157
156
|
});
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
});
|
|
163
|
-
}
|
|
157
|
+
updateNcsSessionStepMetrics({
|
|
158
|
+
api,
|
|
159
|
+
steps: editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(step => !(step instanceof AnalyticsStep)) : newSteps
|
|
160
|
+
});
|
|
164
161
|
scheduler.postTask(() => {
|
|
165
162
|
task(stepsSentCache, onTrackDataProcessed);
|
|
166
163
|
}, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsStep, SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
1
|
+
import { AnalyticsStep, BatchAttrsStep, SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { TELEPOINTER_DATA_SESSION_ID_ATTR, TELEPOINTER_PULSE_DURING_TR_CLASS, TELEPOINTER_PULSE_DURING_TR_DURATION_MS } from '@atlaskit/editor-common/collab';
|
|
4
4
|
import { processRawValueWithoutValidation } from '@atlaskit/editor-common/process-raw-value';
|
|
@@ -7,6 +7,7 @@ import { Transaction, Selection, TextSelection } from '@atlaskit/editor-prosemir
|
|
|
7
7
|
import { AttrStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
8
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import { getParticipantColor } from '@atlaskit/editor-shared-styles';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
export const findPointers = (id, decorations) => decorations.find().reduce((arr, deco) => deco.spec.pointer.presenceId === id ? arr.concat(deco) : arr, []);
|
|
11
12
|
function style(options) {
|
|
12
13
|
const color = options && options.color || 'black';
|
|
@@ -204,6 +205,12 @@ export const isOrganicChange = tr => {
|
|
|
204
205
|
return false;
|
|
205
206
|
}
|
|
206
207
|
|
|
208
|
+
// editor-plugin-local-id uses BatchAttrStep to set the localId attribute
|
|
209
|
+
if (step instanceof BatchAttrsStep && fg('platform_editor_inorganic_batchattrsstep_localid')) {
|
|
210
|
+
const allAttributes = step.data.map(data => Object.keys(data.attrs)).flat();
|
|
211
|
+
return allAttributes.some(attr => attr !== 'localId');
|
|
212
|
+
}
|
|
213
|
+
|
|
207
214
|
// If a step is not an instance of SetAttrsStep, it is considered organic
|
|
208
215
|
if (!(step instanceof SetAttrsStep)) {
|
|
209
216
|
return true;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { Rebaseable } from '@atlaskit/prosemirror-collab';
|
|
4
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
var isLocked = function isLocked(step) {
|
|
@@ -35,11 +34,7 @@ export function mergeUnconfirmedSteps(steps, api) {
|
|
|
35
34
|
// As we want to wait until all the transactions have been pushed through
|
|
36
35
|
var origin = lastStep.origin;
|
|
37
36
|
if (mergedStep && inverted) {
|
|
38
|
-
|
|
39
|
-
acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', origin.getMeta('isOffline') === true || isOffline) : origin);
|
|
40
|
-
} else {
|
|
41
|
-
acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', isOffline) : origin);
|
|
42
|
-
}
|
|
37
|
+
acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', origin.getMeta('isOffline') === true || isOffline) : origin);
|
|
43
38
|
return acc;
|
|
44
39
|
}
|
|
45
40
|
}
|
|
@@ -4,7 +4,6 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
5
|
import { AnalyticsStep, SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
6
6
|
import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { sendableSteps } from '@atlaskit/prosemirror-collab';
|
|
9
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
9
|
import { updateNcsSessionStepMetrics } from './track-step-metrics';
|
|
@@ -170,14 +169,12 @@ export var track = function track(_ref3) {
|
|
|
170
169
|
endedAt: endedAt,
|
|
171
170
|
steps: steps
|
|
172
171
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
});
|
|
180
|
-
}
|
|
172
|
+
updateNcsSessionStepMetrics({
|
|
173
|
+
api: api,
|
|
174
|
+
steps: editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(function (step) {
|
|
175
|
+
return !(step instanceof AnalyticsStep);
|
|
176
|
+
}) : newSteps
|
|
177
|
+
});
|
|
181
178
|
scheduler.postTask(function () {
|
|
182
179
|
task(stepsSentCache, onTrackDataProcessed);
|
|
183
180
|
}, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
-
import { AnalyticsStep, SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
2
|
+
import { AnalyticsStep, BatchAttrsStep, SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { TELEPOINTER_DATA_SESSION_ID_ATTR, TELEPOINTER_PULSE_DURING_TR_CLASS, TELEPOINTER_PULSE_DURING_TR_DURATION_MS } from '@atlaskit/editor-common/collab';
|
|
5
5
|
import { processRawValueWithoutValidation } from '@atlaskit/editor-common/process-raw-value';
|
|
@@ -8,6 +8,7 @@ import { Transaction, Selection, TextSelection } from '@atlaskit/editor-prosemir
|
|
|
8
8
|
import { AttrStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
9
9
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
10
10
|
import { getParticipantColor } from '@atlaskit/editor-shared-styles';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
export var findPointers = function findPointers(id, decorations) {
|
|
12
13
|
return decorations.find().reduce(function (arr, deco) {
|
|
13
14
|
return deco.spec.pointer.presenceId === id ? arr.concat(deco) : arr;
|
|
@@ -208,6 +209,16 @@ export var isOrganicChange = function isOrganicChange(tr) {
|
|
|
208
209
|
return false;
|
|
209
210
|
}
|
|
210
211
|
|
|
212
|
+
// editor-plugin-local-id uses BatchAttrStep to set the localId attribute
|
|
213
|
+
if (step instanceof BatchAttrsStep && fg('platform_editor_inorganic_batchattrsstep_localid')) {
|
|
214
|
+
var _allAttributes = step.data.map(function (data) {
|
|
215
|
+
return Object.keys(data.attrs);
|
|
216
|
+
}).flat();
|
|
217
|
+
return _allAttributes.some(function (attr) {
|
|
218
|
+
return attr !== 'localId';
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
211
222
|
// If a step is not an instance of SetAttrsStep, it is considered organic
|
|
212
223
|
if (!(step instanceof SetAttrsStep)) {
|
|
213
224
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.5",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^51.
|
|
30
|
+
"@atlaskit/adf-schema": "^51.4.0",
|
|
31
31
|
"@atlaskit/custom-steps": "^0.16.0",
|
|
32
32
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
38
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
38
|
+
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
39
39
|
"@atlaskit/frontend-utilities": "^3.2.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
41
|
"@atlaskit/prosemirror-collab": "^0.22.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^13.38.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"memoize-one": "^6.0.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/editor-common": "^110.
|
|
47
|
+
"@atlaskit/editor-common": "^110.32.0",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
49
|
"react-dom": "^18.2.0"
|
|
50
50
|
},
|
|
@@ -97,13 +97,10 @@
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
"platform-feature-flags": {
|
|
100
|
-
"
|
|
101
|
-
"type": "boolean"
|
|
102
|
-
},
|
|
103
|
-
"platform_editor_offline_editing_resync_flicker_fix": {
|
|
100
|
+
"aifc_create_enabled": {
|
|
104
101
|
"type": "boolean"
|
|
105
102
|
},
|
|
106
|
-
"
|
|
103
|
+
"platform_editor_inorganic_batchattrsstep_localid": {
|
|
107
104
|
"type": "boolean"
|
|
108
105
|
}
|
|
109
106
|
}
|