@atlaskit/editor-plugin-collab-edit 18.0.5 → 18.0.7
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,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 18.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e80305319abbb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e80305319abbb) -
|
|
8
|
+
CCI-19338: Gate Review moment on `platform_editor_ai_streaming_ux_experience_m1` and
|
|
9
|
+
`platform_editor_ai_xstate_migration` only, dropping
|
|
10
|
+
`platform_editor_ai_new_aifc_editor_experience` and its FE/BE params. Optional Review moment
|
|
11
|
+
slices now read prefixed tokens from `platform_editor_ai_streaming_ux_m1_config`.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 18.0.6
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`e345ad014bb3c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e345ad014bb3c) -
|
|
19
|
+
Avoid duplicate agent highlights and telepointers for locally acknowledged frontend steps under
|
|
20
|
+
platform_editor_agent_be_streaming, while preserving remote collaborator and backend edit visuals.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 18.0.5
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -100,12 +100,31 @@ var applyRemoteSteps = exports.applyRemoteSteps = function applyRemoteSteps(json
|
|
|
100
100
|
var shimmerDurationMs = 0;
|
|
101
101
|
var highlightDurationMs = 0;
|
|
102
102
|
var agentShimmers = [];
|
|
103
|
+
var visualJson = json;
|
|
104
|
+
var visualSteps = steps;
|
|
105
|
+
if (options !== null && options !== void 0 && options.useNativePlugin && userIds && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_agent_be_streaming')) {
|
|
106
|
+
var _sendableSteps;
|
|
107
|
+
// Read the client ID before applying the acknowledgement, while the local steps
|
|
108
|
+
// are still unconfirmed. receiveTransaction removes this same local prefix.
|
|
109
|
+
// Exclude it from visuals too: the originating FE stream already owns its UI.
|
|
110
|
+
var localClientId = (_sendableSteps = (0, _prosemirrorCollab.sendableSteps)(state)) === null || _sendableSteps === void 0 ? void 0 : _sendableSteps.clientID;
|
|
111
|
+
var acknowledgedSteps = 0;
|
|
112
|
+
if (localClientId != null) {
|
|
113
|
+
while (userIds[acknowledgedSteps] != null && String(userIds[acknowledgedSteps]) === String(localClientId)) {
|
|
114
|
+
acknowledgedSteps++;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Slice both visual inputs so remote steps stay aligned with tr.docs. The
|
|
118
|
+
// full batch still participates in collaboration, presence and attribution.
|
|
119
|
+
visualJson = json.slice(acknowledgedSteps);
|
|
120
|
+
visualSteps = steps.slice(acknowledgedSteps);
|
|
121
|
+
}
|
|
103
122
|
var isUnifiedPostApplyChromeEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_ai_unified_post_apply_chrome');
|
|
104
123
|
if (isUnifiedPostApplyChromeEnabled && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_agent_be_streaming')) {
|
|
105
|
-
var ranges = (0, _agentShimmerRanges.getAgentEditChromeRanges)(
|
|
124
|
+
var ranges = (0, _agentShimmerRanges.getAgentEditChromeRanges)(visualJson, visualSteps, tr, view, function (reason, agentType, error) {
|
|
106
125
|
return editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.getAgentEditShimmerNotShownPayload)(reason, agentType, error))(tr);
|
|
107
126
|
});
|
|
108
|
-
var requester = (0, _agentEditRequester.getAgentEditRequester)(
|
|
127
|
+
var requester = (0, _agentEditRequester.getAgentEditRequester)(visualJson, view);
|
|
109
128
|
if (ranges.length && requester) {
|
|
110
129
|
// Collab supplies a machine agent type, not a display name; preserve the legacy
|
|
111
130
|
// uppercase telepointer label.
|
|
@@ -127,7 +146,7 @@ var applyRemoteSteps = exports.applyRemoteSteps = function applyRemoteSteps(json
|
|
|
127
146
|
// Telepointer shown by default; `telepointerDisabled` hides it (inverted because `expVal`
|
|
128
147
|
// only permits `false` as a boolean default).
|
|
129
148
|
var telepointerEnabled = !(0, _expVal.expVal)('platform_editor_agent_be_streaming', 'telepointerDisabled', false);
|
|
130
|
-
agentShimmers = (0, _agentShimmerRanges.getAgentShimmerRanges)(
|
|
149
|
+
agentShimmers = (0, _agentShimmerRanges.getAgentShimmerRanges)(visualJson, visualSteps, tr, view, shimmerDurationMs, highlightDurationMs, telepointerEnabled,
|
|
131
150
|
// An agent edit that applied without the shimmer fires the operational event on the same
|
|
132
151
|
// transaction, so success stays event-free and only degrades are reported.
|
|
133
152
|
function (reason, agentType, error) {
|
|
@@ -140,11 +159,10 @@ var applyRemoteSteps = exports.applyRemoteSteps = function applyRemoteSteps(json
|
|
|
140
159
|
|
|
141
160
|
// Record the agent's edit (original + new slice per change) onto this
|
|
142
161
|
// transaction; `editor-plugin-ai` consumes the meta to open the BE Review moment.
|
|
143
|
-
//
|
|
144
|
-
// `
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_ai_new_aifc_editor_experience', 'isBackendReviewMomentEnabled', true)) {
|
|
162
|
+
// Same eligibility as FE Review moment: xstate AND the M1 streaming UX
|
|
163
|
+
// experiment. `getAgentEditSegments` self-gates (returns null for non-agent
|
|
164
|
+
// edits, never throws), so this is a no-op for ordinary collaborator edits.
|
|
165
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_ai_xstate_migration', 'isEnabled', true) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_ai_streaming_ux_experience_m1')) {
|
|
148
166
|
var reviewData = (0, _agentReviewSegments.getAgentEditSegments)(json, steps, tr, view);
|
|
149
167
|
if (reviewData) {
|
|
150
168
|
tr.setMeta(_collabAgentRemoteEditReview.AGENT_REMOTE_EDIT_REVIEW_DATA, reviewData);
|
|
@@ -11,7 +11,7 @@ import { Step } from '@atlaskit/editor-prosemirror/transform-override';
|
|
|
11
11
|
import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
12
12
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
14
|
-
import { receiveTransaction } from '@atlaskit/prosemirror-collab';
|
|
14
|
+
import { receiveTransaction, sendableSteps } from '@atlaskit/prosemirror-collab';
|
|
15
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
16
|
import { getAgentEditShimmerNotShownPayload } from './analytics';
|
|
17
17
|
import { getAgentEditSegments } from './main/agent-review-segments';
|
|
@@ -103,10 +103,29 @@ export const applyRemoteSteps = (json, view, userIds, options, editorAnalyticsAp
|
|
|
103
103
|
let shimmerDurationMs = 0;
|
|
104
104
|
let highlightDurationMs = 0;
|
|
105
105
|
let agentShimmers = [];
|
|
106
|
+
let visualJson = json;
|
|
107
|
+
let visualSteps = steps;
|
|
108
|
+
if (options !== null && options !== void 0 && options.useNativePlugin && userIds && isExperimentEnabled('platform_editor_agent_be_streaming')) {
|
|
109
|
+
var _sendableSteps;
|
|
110
|
+
// Read the client ID before applying the acknowledgement, while the local steps
|
|
111
|
+
// are still unconfirmed. receiveTransaction removes this same local prefix.
|
|
112
|
+
// Exclude it from visuals too: the originating FE stream already owns its UI.
|
|
113
|
+
const localClientId = (_sendableSteps = sendableSteps(state)) === null || _sendableSteps === void 0 ? void 0 : _sendableSteps.clientID;
|
|
114
|
+
let acknowledgedSteps = 0;
|
|
115
|
+
if (localClientId != null) {
|
|
116
|
+
while (userIds[acknowledgedSteps] != null && String(userIds[acknowledgedSteps]) === String(localClientId)) {
|
|
117
|
+
acknowledgedSteps++;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Slice both visual inputs so remote steps stay aligned with tr.docs. The
|
|
121
|
+
// full batch still participates in collaboration, presence and attribution.
|
|
122
|
+
visualJson = json.slice(acknowledgedSteps);
|
|
123
|
+
visualSteps = steps.slice(acknowledgedSteps);
|
|
124
|
+
}
|
|
106
125
|
const isUnifiedPostApplyChromeEnabled = isExperimentEnabled('platform_editor_ai_unified_post_apply_chrome');
|
|
107
126
|
if (isUnifiedPostApplyChromeEnabled && isExperimentEnabled('platform_editor_agent_be_streaming')) {
|
|
108
|
-
const ranges = getAgentEditChromeRanges(
|
|
109
|
-
const requester = getAgentEditRequester(
|
|
127
|
+
const ranges = getAgentEditChromeRanges(visualJson, visualSteps, tr, view, (reason, agentType, error) => editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(getAgentEditShimmerNotShownPayload(reason, agentType, error))(tr));
|
|
128
|
+
const requester = getAgentEditRequester(visualJson, view);
|
|
110
129
|
if (ranges.length && requester) {
|
|
111
130
|
// Collab supplies a machine agent type, not a display name; preserve the legacy
|
|
112
131
|
// uppercase telepointer label.
|
|
@@ -130,7 +149,7 @@ export const applyRemoteSteps = (json, view, userIds, options, editorAnalyticsAp
|
|
|
130
149
|
// Telepointer shown by default; `telepointerDisabled` hides it (inverted because `expVal`
|
|
131
150
|
// only permits `false` as a boolean default).
|
|
132
151
|
const telepointerEnabled = !expVal('platform_editor_agent_be_streaming', 'telepointerDisabled', false);
|
|
133
|
-
agentShimmers = getAgentShimmerRanges(
|
|
152
|
+
agentShimmers = getAgentShimmerRanges(visualJson, visualSteps, tr, view, shimmerDurationMs, highlightDurationMs, telepointerEnabled,
|
|
134
153
|
// An agent edit that applied without the shimmer fires the operational event on the same
|
|
135
154
|
// transaction, so success stays event-free and only degrades are reported.
|
|
136
155
|
(reason, agentType, error) => editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(getAgentEditShimmerNotShownPayload(reason, agentType, error))(tr));
|
|
@@ -141,11 +160,10 @@ export const applyRemoteSteps = (json, view, userIds, options, editorAnalyticsAp
|
|
|
141
160
|
|
|
142
161
|
// Record the agent's edit (original + new slice per change) onto this
|
|
143
162
|
// transaction; `editor-plugin-ai` consumes the meta to open the BE Review moment.
|
|
144
|
-
//
|
|
145
|
-
// `
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
if (expValEquals('platform_editor_ai_new_aifc_editor_experience', 'isBackendReviewMomentEnabled', true)) {
|
|
163
|
+
// Same eligibility as FE Review moment: xstate AND the M1 streaming UX
|
|
164
|
+
// experiment. `getAgentEditSegments` self-gates (returns null for non-agent
|
|
165
|
+
// edits, never throws), so this is a no-op for ordinary collaborator edits.
|
|
166
|
+
if (expValEquals('platform_editor_ai_xstate_migration', 'isEnabled', true) && isExperimentEnabled('platform_editor_ai_streaming_ux_experience_m1')) {
|
|
149
167
|
const reviewData = getAgentEditSegments(json, steps, tr, view);
|
|
150
168
|
if (reviewData) {
|
|
151
169
|
tr.setMeta(AGENT_REMOTE_EDIT_REVIEW_DATA, reviewData);
|
|
@@ -14,7 +14,7 @@ import { Step } from '@atlaskit/editor-prosemirror/transform-override';
|
|
|
14
14
|
import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
15
15
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
17
|
-
import { receiveTransaction } from '@atlaskit/prosemirror-collab';
|
|
17
|
+
import { receiveTransaction, sendableSteps } from '@atlaskit/prosemirror-collab';
|
|
18
18
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
19
|
import { getAgentEditShimmerNotShownPayload } from './analytics';
|
|
20
20
|
import { getAgentEditSegments } from './main/agent-review-segments';
|
|
@@ -93,12 +93,31 @@ export var applyRemoteSteps = function applyRemoteSteps(json, view, userIds, opt
|
|
|
93
93
|
var shimmerDurationMs = 0;
|
|
94
94
|
var highlightDurationMs = 0;
|
|
95
95
|
var agentShimmers = [];
|
|
96
|
+
var visualJson = json;
|
|
97
|
+
var visualSteps = steps;
|
|
98
|
+
if (options !== null && options !== void 0 && options.useNativePlugin && userIds && isExperimentEnabled('platform_editor_agent_be_streaming')) {
|
|
99
|
+
var _sendableSteps;
|
|
100
|
+
// Read the client ID before applying the acknowledgement, while the local steps
|
|
101
|
+
// are still unconfirmed. receiveTransaction removes this same local prefix.
|
|
102
|
+
// Exclude it from visuals too: the originating FE stream already owns its UI.
|
|
103
|
+
var localClientId = (_sendableSteps = sendableSteps(state)) === null || _sendableSteps === void 0 ? void 0 : _sendableSteps.clientID;
|
|
104
|
+
var acknowledgedSteps = 0;
|
|
105
|
+
if (localClientId != null) {
|
|
106
|
+
while (userIds[acknowledgedSteps] != null && String(userIds[acknowledgedSteps]) === String(localClientId)) {
|
|
107
|
+
acknowledgedSteps++;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Slice both visual inputs so remote steps stay aligned with tr.docs. The
|
|
111
|
+
// full batch still participates in collaboration, presence and attribution.
|
|
112
|
+
visualJson = json.slice(acknowledgedSteps);
|
|
113
|
+
visualSteps = steps.slice(acknowledgedSteps);
|
|
114
|
+
}
|
|
96
115
|
var isUnifiedPostApplyChromeEnabled = isExperimentEnabled('platform_editor_ai_unified_post_apply_chrome');
|
|
97
116
|
if (isUnifiedPostApplyChromeEnabled && isExperimentEnabled('platform_editor_agent_be_streaming')) {
|
|
98
|
-
var ranges = getAgentEditChromeRanges(
|
|
117
|
+
var ranges = getAgentEditChromeRanges(visualJson, visualSteps, tr, view, function (reason, agentType, error) {
|
|
99
118
|
return editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(getAgentEditShimmerNotShownPayload(reason, agentType, error))(tr);
|
|
100
119
|
});
|
|
101
|
-
var requester = getAgentEditRequester(
|
|
120
|
+
var requester = getAgentEditRequester(visualJson, view);
|
|
102
121
|
if (ranges.length && requester) {
|
|
103
122
|
// Collab supplies a machine agent type, not a display name; preserve the legacy
|
|
104
123
|
// uppercase telepointer label.
|
|
@@ -120,7 +139,7 @@ export var applyRemoteSteps = function applyRemoteSteps(json, view, userIds, opt
|
|
|
120
139
|
// Telepointer shown by default; `telepointerDisabled` hides it (inverted because `expVal`
|
|
121
140
|
// only permits `false` as a boolean default).
|
|
122
141
|
var telepointerEnabled = !expVal('platform_editor_agent_be_streaming', 'telepointerDisabled', false);
|
|
123
|
-
agentShimmers = getAgentShimmerRanges(
|
|
142
|
+
agentShimmers = getAgentShimmerRanges(visualJson, visualSteps, tr, view, shimmerDurationMs, highlightDurationMs, telepointerEnabled,
|
|
124
143
|
// An agent edit that applied without the shimmer fires the operational event on the same
|
|
125
144
|
// transaction, so success stays event-free and only degrades are reported.
|
|
126
145
|
function (reason, agentType, error) {
|
|
@@ -133,11 +152,10 @@ export var applyRemoteSteps = function applyRemoteSteps(json, view, userIds, opt
|
|
|
133
152
|
|
|
134
153
|
// Record the agent's edit (original + new slice per change) onto this
|
|
135
154
|
// transaction; `editor-plugin-ai` consumes the meta to open the BE Review moment.
|
|
136
|
-
//
|
|
137
|
-
// `
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
if (expValEquals('platform_editor_ai_new_aifc_editor_experience', 'isBackendReviewMomentEnabled', true)) {
|
|
155
|
+
// Same eligibility as FE Review moment: xstate AND the M1 streaming UX
|
|
156
|
+
// experiment. `getAgentEditSegments` self-gates (returns null for non-agent
|
|
157
|
+
// edits, never throws), so this is a no-op for ordinary collaborator edits.
|
|
158
|
+
if (expValEquals('platform_editor_ai_xstate_migration', 'isEnabled', true) && isExperimentEnabled('platform_editor_ai_streaming_ux_experience_m1')) {
|
|
141
159
|
var reviewData = getAgentEditSegments(json, steps, tr, view);
|
|
142
160
|
if (reviewData) {
|
|
143
161
|
tr.setMeta(AGENT_REMOTE_EDIT_REVIEW_DATA, reviewData);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.7",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"@atlaskit/editor-plugin-feature-flags": "^16.0.0",
|
|
29
29
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
30
30
|
"@atlaskit/editor-shared-styles": "^4.1.0",
|
|
31
|
-
"@atlaskit/frontend-utilities": "^4.
|
|
31
|
+
"@atlaskit/frontend-utilities": "^4.4.0",
|
|
32
32
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
34
34
|
"@atlaskit/prosemirror-collab": "^1.1.0",
|
|
35
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
35
|
+
"@atlaskit/tmp-editor-statsig": "^185.0.0",
|
|
36
36
|
"@atlaskit/tokens": "^16.11.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|
|
38
38
|
"memoize-one": "^6.0.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@atlaskit/editor-common": "^121.
|
|
41
|
+
"@atlaskit/editor-common": "^121.4.0",
|
|
42
42
|
"react": "^18.2.0 || ^19.2.0",
|
|
43
43
|
"react-dom": "^18.2.0 || ^19.2.0"
|
|
44
44
|
},
|