@atlaskit/editor-plugin-collab-edit 4.1.3 → 4.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 +14 -0
- package/dist/cjs/pm-plugins/events/send-transaction.js +1 -2
- package/dist/cjs/pm-plugins/main/plugin-state.js +2 -1
- package/dist/cjs/pm-plugins/mergeUnconfirmed.js +4 -5
- package/dist/es2019/pm-plugins/events/send-transaction.js +1 -2
- package/dist/es2019/pm-plugins/main/plugin-state.js +2 -1
- package/dist/es2019/pm-plugins/mergeUnconfirmed.js +4 -5
- package/dist/esm/pm-plugins/events/send-transaction.js +1 -2
- package/dist/esm/pm-plugins/main/plugin-state.js +2 -1
- package/dist/esm/pm-plugins/mergeUnconfirmed.js +4 -5
- package/dist/types/pm-plugins/utils.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +2 -1
- package/package.json +5 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-collab-edit
|
|
2
2
|
|
|
3
|
+
## 4.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6ca68bbf39757`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6ca68bbf39757) -
|
|
8
|
+
Change all AIFC feature gates over to an experiment platform_editor_ai_aifc
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 4.1.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 4.1.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.sendTransaction = void 0;
|
|
7
7
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
10
9
|
var _actions = require("../actions");
|
|
11
10
|
var _pluginKey = require("../main/plugin-key");
|
|
@@ -48,7 +47,7 @@ var sendTransaction = exports.sendTransaction = function sendTransaction(_ref) {
|
|
|
48
47
|
sessionId = currentPluginState.sessionId;
|
|
49
48
|
var selectionChanged = !oldEditorState.selection.eq(newEditorState.selection);
|
|
50
49
|
var participantsChanged = prevActiveParticipants && !prevActiveParticipants.eq(activeParticipants);
|
|
51
|
-
if ((0,
|
|
50
|
+
if ((0, _experiments.editorExperiment)('platform_editor_ai_aifc', true)) {
|
|
52
51
|
if (!sessionId || viewMode !== 'edit') {
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
@@ -13,6 +13,7 @@ var _collab = require("@atlaskit/editor-common/collab");
|
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
17
|
var _participants = require("../participants");
|
|
17
18
|
var _utils = require("../utils");
|
|
18
19
|
/**
|
|
@@ -183,7 +184,7 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
|
|
|
183
184
|
} catch (err) {
|
|
184
185
|
this.onError(err);
|
|
185
186
|
}
|
|
186
|
-
if (!(0,
|
|
187
|
+
if (!(0, _experiments.editorExperiment)('platform_editor_ai_aifc', true)) {
|
|
187
188
|
// Remove any selection decoration within the change range,
|
|
188
189
|
// takes care of the issue when after pasting we end up with a dead selection
|
|
189
190
|
tr.steps.filter(_utils.isReplaceStep).forEach(function (s) {
|
|
@@ -26,13 +26,12 @@ var isLocked = function isLocked(step) {
|
|
|
26
26
|
*/
|
|
27
27
|
function mergeUnconfirmedSteps(steps, api) {
|
|
28
28
|
var mergedSteps = steps.reduce(function (acc, rebaseable) {
|
|
29
|
-
var _api$connectivity
|
|
29
|
+
var _api$connectivity;
|
|
30
30
|
var lastStep = acc[acc.length - 1];
|
|
31
31
|
var isOffline = (api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode) === 'offline';
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
if (isOfflineOrSinglePlayer && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
|
|
32
|
+
var isOnlineMergeEnabled = (0, _expValEquals.expValEquals)('platform_editor_enable_single_player_step_merging', 'isEnabled', true);
|
|
33
|
+
var isMergingEnabled = isOffline || isOnlineMergeEnabled;
|
|
34
|
+
if (isMergingEnabled && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
|
|
36
35
|
var mergedStep = lastStep.step.merge(rebaseable.step);
|
|
37
36
|
var inverted = rebaseable.inverted.merge(lastStep.inverted);
|
|
38
37
|
// Always take the origin of the new step.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
3
|
import { getSendableSelection } from '../actions';
|
|
5
4
|
import { pluginKey } from '../main/plugin-key';
|
|
@@ -43,7 +42,7 @@ export const sendTransaction = ({
|
|
|
43
42
|
} = currentPluginState;
|
|
44
43
|
const selectionChanged = !oldEditorState.selection.eq(newEditorState.selection);
|
|
45
44
|
const participantsChanged = prevActiveParticipants && !prevActiveParticipants.eq(activeParticipants);
|
|
46
|
-
if (
|
|
45
|
+
if (editorExperiment('platform_editor_ai_aifc', true)) {
|
|
47
46
|
if (!sessionId || viewMode !== 'edit') {
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
@@ -4,6 +4,7 @@ import { TELEPOINTER_DIM_CLASS, TELEPOINTER_PULSE_CLASS, TELEPOINTER_PULSE_DURIN
|
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { Participants } from '../participants';
|
|
8
9
|
import { createTelepointers, _findPointers, findPointers, getPositionOfTelepointer, isReplaceStep, hasExistingNudge } from '../utils';
|
|
9
10
|
|
|
@@ -164,7 +165,7 @@ export class PluginState {
|
|
|
164
165
|
} catch (err) {
|
|
165
166
|
this.onError(err);
|
|
166
167
|
}
|
|
167
|
-
if (!
|
|
168
|
+
if (!editorExperiment('platform_editor_ai_aifc', true)) {
|
|
168
169
|
// Remove any selection decoration within the change range,
|
|
169
170
|
// takes care of the issue when after pasting we end up with a dead selection
|
|
170
171
|
tr.steps.filter(isReplaceStep).forEach(s => {
|
|
@@ -20,13 +20,12 @@ const isLocked = step => {
|
|
|
20
20
|
*/
|
|
21
21
|
export function mergeUnconfirmedSteps(steps, api) {
|
|
22
22
|
const mergedSteps = steps.reduce((acc, rebaseable) => {
|
|
23
|
-
var _api$connectivity, _api$connectivity$sha
|
|
23
|
+
var _api$connectivity, _api$connectivity$sha;
|
|
24
24
|
const lastStep = acc[acc.length - 1];
|
|
25
25
|
const isOffline = (api === null || api === void 0 ? void 0 : (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 ? void 0 : (_api$connectivity$sha = _api$connectivity.sharedState.currentState()) === null || _api$connectivity$sha === void 0 ? void 0 : _api$connectivity$sha.mode) === 'offline';
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
if (isOfflineOrSinglePlayer && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
|
|
26
|
+
const isOnlineMergeEnabled = expValEquals('platform_editor_enable_single_player_step_merging', 'isEnabled', true);
|
|
27
|
+
const isMergingEnabled = isOffline || isOnlineMergeEnabled;
|
|
28
|
+
if (isMergingEnabled && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
|
|
30
29
|
const mergedStep = lastStep.step.merge(rebaseable.step);
|
|
31
30
|
const inverted = rebaseable.inverted.merge(lastStep.inverted);
|
|
32
31
|
// Always take the origin of the new step.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
3
|
import { getSendableSelection } from '../actions';
|
|
5
4
|
import { pluginKey } from '../main/plugin-key';
|
|
@@ -42,7 +41,7 @@ export var sendTransaction = function sendTransaction(_ref) {
|
|
|
42
41
|
sessionId = currentPluginState.sessionId;
|
|
43
42
|
var selectionChanged = !oldEditorState.selection.eq(newEditorState.selection);
|
|
44
43
|
var participantsChanged = prevActiveParticipants && !prevActiveParticipants.eq(activeParticipants);
|
|
45
|
-
if (
|
|
44
|
+
if (editorExperiment('platform_editor_ai_aifc', true)) {
|
|
46
45
|
if (!sessionId || viewMode !== 'edit') {
|
|
47
46
|
return;
|
|
48
47
|
}
|
|
@@ -6,6 +6,7 @@ import { TELEPOINTER_DIM_CLASS, TELEPOINTER_PULSE_CLASS, TELEPOINTER_PULSE_DURIN
|
|
|
6
6
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
10
|
import { Participants } from '../participants';
|
|
10
11
|
import { createTelepointers, _findPointers, findPointers, getPositionOfTelepointer, isReplaceStep, hasExistingNudge } from '../utils';
|
|
11
12
|
|
|
@@ -177,7 +178,7 @@ export var PluginState = /*#__PURE__*/function () {
|
|
|
177
178
|
} catch (err) {
|
|
178
179
|
this.onError(err);
|
|
179
180
|
}
|
|
180
|
-
if (!
|
|
181
|
+
if (!editorExperiment('platform_editor_ai_aifc', true)) {
|
|
181
182
|
// Remove any selection decoration within the change range,
|
|
182
183
|
// takes care of the issue when after pasting we end up with a dead selection
|
|
183
184
|
tr.steps.filter(isReplaceStep).forEach(function (s) {
|
|
@@ -20,13 +20,12 @@ var isLocked = function isLocked(step) {
|
|
|
20
20
|
*/
|
|
21
21
|
export function mergeUnconfirmedSteps(steps, api) {
|
|
22
22
|
var mergedSteps = steps.reduce(function (acc, rebaseable) {
|
|
23
|
-
var _api$connectivity
|
|
23
|
+
var _api$connectivity;
|
|
24
24
|
var lastStep = acc[acc.length - 1];
|
|
25
25
|
var isOffline = (api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode) === 'offline';
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
if (isOfflineOrSinglePlayer && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
|
|
26
|
+
var isOnlineMergeEnabled = expValEquals('platform_editor_enable_single_player_step_merging', 'isEnabled', true);
|
|
27
|
+
var isMergingEnabled = isOffline || isOnlineMergeEnabled;
|
|
28
|
+
if (isMergingEnabled && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
|
|
30
29
|
var mergedStep = lastStep.step.merge(rebaseable.step);
|
|
31
30
|
var inverted = rebaseable.inverted.merge(lastStep.inverted);
|
|
32
31
|
// Always take the origin of the new step.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { type CollabEditOptions, type CollabParticipant } from '@atlaskit/editor-common/collab';
|
|
3
3
|
import { type EditorState, type ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
5
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
5
6
|
import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -15,7 +16,7 @@ export declare const createTelepointers: (from: number, to: number, sessionId: s
|
|
|
15
16
|
export declare const replaceDocument: (doc: any, state: EditorState, version?: number, options?: CollabEditOptions, reserveCursor?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => Transaction;
|
|
16
17
|
export declare const scrollToCollabCursor: (editorView: EditorView, participants: CollabParticipant[], sessionId: string | undefined, index: number, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => void;
|
|
17
18
|
export declare const getPositionOfTelepointer: (sessionId: string, decorationSet: DecorationSet) => undefined | number;
|
|
18
|
-
export declare const isReplaceStep: (step: Step) =>
|
|
19
|
+
export declare const isReplaceStep: (step: Step) => step is ReplaceStep;
|
|
19
20
|
export declare const originalTransactionHasMeta: (transaction: Transaction | ReadonlyTransaction, metaTag: string) => boolean;
|
|
20
21
|
/**
|
|
21
22
|
* Takes the transaction and editor state and checks if the transaction is considered organic change
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { type CollabEditOptions, type CollabParticipant } from '@atlaskit/editor-common/collab';
|
|
3
3
|
import { type EditorState, type ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
5
|
import type { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
5
6
|
import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -15,7 +16,7 @@ export declare const createTelepointers: (from: number, to: number, sessionId: s
|
|
|
15
16
|
export declare const replaceDocument: (doc: any, state: EditorState, version?: number, options?: CollabEditOptions, reserveCursor?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => Transaction;
|
|
16
17
|
export declare const scrollToCollabCursor: (editorView: EditorView, participants: CollabParticipant[], sessionId: string | undefined, index: number, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => void;
|
|
17
18
|
export declare const getPositionOfTelepointer: (sessionId: string, decorationSet: DecorationSet) => undefined | number;
|
|
18
|
-
export declare const isReplaceStep: (step: Step) =>
|
|
19
|
+
export declare const isReplaceStep: (step: Step) => step is ReplaceStep;
|
|
19
20
|
export declare const originalTransactionHasMeta: (transaction: Transaction | ReadonlyTransaction, metaTag: string) => boolean;
|
|
20
21
|
/**
|
|
21
22
|
* Takes the transaction and editor state and checks if the transaction is considered organic change
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-collab-edit",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.5",
|
|
4
4
|
"description": "Collab Edit plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
41
|
+
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
42
42
|
"@atlaskit/frontend-utilities": "^3.1.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/prosemirror-collab": "^0.17.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^11.0.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"memoize-one": "^6.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@atlaskit/editor-common": "^107.
|
|
50
|
+
"@atlaskit/editor-common": "^107.25.0",
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-dom": "^18.2.0"
|
|
53
53
|
},
|
|
@@ -61,10 +61,9 @@
|
|
|
61
61
|
"@atlaskit/editor-test-helpers": "workspace:^",
|
|
62
62
|
"@atlaskit/ssr": "workspace:^",
|
|
63
63
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
64
|
-
"@atlaskit/util-data-test": "^18.
|
|
64
|
+
"@atlaskit/util-data-test": "^18.1.0",
|
|
65
65
|
"@atlaskit/visual-regression": "workspace:^",
|
|
66
66
|
"@testing-library/react": "^13.4.0",
|
|
67
|
-
"typescript": "~5.4.2",
|
|
68
67
|
"wait-for-expect": "^1.2.0"
|
|
69
68
|
},
|
|
70
69
|
"techstack": {
|
|
@@ -107,9 +106,6 @@
|
|
|
107
106
|
"confluence_team_presence_scroll_to_pointer": {
|
|
108
107
|
"type": "boolean"
|
|
109
108
|
},
|
|
110
|
-
"platform_editor_ai_in_document_streaming": {
|
|
111
|
-
"type": "boolean"
|
|
112
|
-
},
|
|
113
109
|
"platform_enable_ncs_step_metrics": {
|
|
114
110
|
"type": "boolean"
|
|
115
111
|
}
|