@atlaskit/editor-plugin-collab-edit 8.0.0 → 8.0.1

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-collab-edit
2
2
 
3
+ ## 8.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7080196995b11`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7080196995b11) -
8
+ Cleaning up FG platform_editor_ai_generic_prep_for_aifc
9
+ - Updated dependencies
10
+
3
11
  ## 8.0.0
4
12
 
5
13
  ### 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,51 +47,39 @@ 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, _platformFeatureFlags.fg)('platform_editor_ai_generic_prep_for_aifc')) {
52
- if (!sessionId || viewMode !== 'edit') {
53
- return;
54
- }
50
+ if (!sessionId || viewMode !== 'edit') {
51
+ return;
52
+ }
55
53
 
56
- // uiEvent is standard metdata (docs: https://prosemirror.net/docs/ref/#state.Transaction)
57
- var isPaste = (docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.getMeta('uiEvent')) === 'paste';
54
+ // uiEvent is standard metdata (docs: https://prosemirror.net/docs/ref/#state.Transaction)
55
+ var isPaste = (docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.getMeta('uiEvent')) === 'paste';
58
56
 
59
- // If this metadata is truthy then it means a selection bookmark might be declared as the meta value OR the transaction
60
- // doesn't want the tr.selection to be sent to remote users at all.
61
- var remoteSelectionBookmark = originalTransaction.getMeta('useSelectionBookmarkForRemote');
62
- if (!!remoteSelectionBookmark) {
63
- if (remoteSelectionBookmark !== true && 'resolve' in remoteSelectionBookmark) {
64
- var selection = remoteSelectionBookmark.resolve(newEditorState.doc);
65
- var message = {
66
- type: 'telepointer',
67
- selection: (0, _actions.getSendableSelection)(selection),
68
- sessionId: sessionId
69
- };
70
- provider.sendMessage(message);
71
- }
72
- } else if (
73
- // Broadcast the position if the selection has changed, and the doc hasn't changed (it is mapped
74
- // by the receiver).
75
- // If we're pasting content though make an exception (as doc has changed)
76
- // as on a ranged selection it results in not clearing the ranged selection after the paste
77
- selectionChanged && (!docChangedTransaction || isPaste) || participantsChanged && !hideTelecursorOnLoad) {
78
- var _selection = (0, _actions.getSendableSelection)(newEditorState.selection);
79
- var _message = {
80
- type: 'telepointer',
81
- selection: _selection,
82
- sessionId: sessionId
83
- };
84
- provider.sendMessage(_message);
85
- }
86
- } else {
87
- if (sessionId && viewMode === 'edit' && (selectionChanged && !docChangedTransaction || participantsChanged && !hideTelecursorOnLoad)) {
88
- var _selection2 = (0, _actions.getSendableSelection)(newEditorState.selection);
89
- var _message2 = {
57
+ // If this metadata is truthy then it means a selection bookmark might be declared as the meta value OR the transaction
58
+ // doesn't want the tr.selection to be sent to remote users at all.
59
+ var remoteSelectionBookmark = originalTransaction.getMeta('useSelectionBookmarkForRemote');
60
+ if (!!remoteSelectionBookmark) {
61
+ if (remoteSelectionBookmark !== true && 'resolve' in remoteSelectionBookmark) {
62
+ var selection = remoteSelectionBookmark.resolve(newEditorState.doc);
63
+ var message = {
90
64
  type: 'telepointer',
91
- selection: _selection2,
65
+ selection: (0, _actions.getSendableSelection)(selection),
92
66
  sessionId: sessionId
93
67
  };
94
- provider.sendMessage(_message2);
68
+ provider.sendMessage(message);
95
69
  }
70
+ } else if (
71
+ // Broadcast the position if the selection has changed, and the doc hasn't changed (it is mapped
72
+ // by the receiver).
73
+ // If we're pasting content though make an exception (as doc has changed)
74
+ // as on a ranged selection it results in not clearing the ranged selection after the paste
75
+ selectionChanged && (!docChangedTransaction || isPaste) || participantsChanged && !hideTelecursorOnLoad) {
76
+ var _selection = (0, _actions.getSendableSelection)(newEditorState.selection);
77
+ var _message = {
78
+ type: 'telepointer',
79
+ selection: _selection,
80
+ sessionId: sessionId
81
+ };
82
+ provider.sendMessage(_message);
96
83
  }
97
84
  };
98
85
  };
@@ -12,7 +12,6 @@ var _browser = require("@atlaskit/editor-common/browser");
12
12
  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
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
16
  var _participants = require("../participants");
18
17
  var _utils = require("../utils");
@@ -174,26 +173,6 @@ var PluginState = exports.PluginState = /*#__PURE__*/function () {
174
173
  } catch (err) {
175
174
  this.onError(err);
176
175
  }
177
- if (!(0, _platformFeatureFlags.fg)('platform_editor_ai_generic_prep_for_aifc')) {
178
- // Remove any selection decoration within the change range,
179
- // takes care of the issue when after pasting we end up with a dead selection
180
- tr.steps.filter(_utils.isReplaceStep).forEach(function (s) {
181
- // Ignored via go/ees005
182
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
183
- var _ref2 = s,
184
- from = _ref2.from,
185
- to = _ref2.to;
186
- // Ignored via go/ees005
187
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
- _this.decorationSet.find(from, to).forEach(function (deco) {
189
- // `type` is private, `from` and `to` are public in latest version
190
- // `from` != `to` means it's a selection
191
- if (deco.from !== deco.to) {
192
- remove.push(deco);
193
- }
194
- });
195
- });
196
- }
197
176
  }
198
177
  var selection = tr.selection;
199
178
  // Ignored via go/ees005
@@ -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,50 +42,38 @@ 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 (fg('platform_editor_ai_generic_prep_for_aifc')) {
47
- if (!sessionId || viewMode !== 'edit') {
48
- return;
49
- }
45
+ if (!sessionId || viewMode !== 'edit') {
46
+ return;
47
+ }
50
48
 
51
- // uiEvent is standard metdata (docs: https://prosemirror.net/docs/ref/#state.Transaction)
52
- const isPaste = (docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.getMeta('uiEvent')) === 'paste';
49
+ // uiEvent is standard metdata (docs: https://prosemirror.net/docs/ref/#state.Transaction)
50
+ const isPaste = (docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.getMeta('uiEvent')) === 'paste';
53
51
 
54
- // If this metadata is truthy then it means a selection bookmark might be declared as the meta value OR the transaction
55
- // doesn't want the tr.selection to be sent to remote users at all.
56
- const remoteSelectionBookmark = originalTransaction.getMeta('useSelectionBookmarkForRemote');
57
- if (!!remoteSelectionBookmark) {
58
- if (remoteSelectionBookmark !== true && 'resolve' in remoteSelectionBookmark) {
59
- const selection = remoteSelectionBookmark.resolve(newEditorState.doc);
60
- const message = {
61
- type: 'telepointer',
62
- selection: getSendableSelection(selection),
63
- sessionId
64
- };
65
- provider.sendMessage(message);
66
- }
67
- } else if (
68
- // Broadcast the position if the selection has changed, and the doc hasn't changed (it is mapped
69
- // by the receiver).
70
- // If we're pasting content though make an exception (as doc has changed)
71
- // as on a ranged selection it results in not clearing the ranged selection after the paste
72
- selectionChanged && (!docChangedTransaction || isPaste) || participantsChanged && !hideTelecursorOnLoad) {
73
- const selection = getSendableSelection(newEditorState.selection);
74
- const message = {
75
- type: 'telepointer',
76
- selection,
77
- sessionId
78
- };
79
- provider.sendMessage(message);
80
- }
81
- } else {
82
- if (sessionId && viewMode === 'edit' && (selectionChanged && !docChangedTransaction || participantsChanged && !hideTelecursorOnLoad)) {
83
- const selection = getSendableSelection(newEditorState.selection);
52
+ // If this metadata is truthy then it means a selection bookmark might be declared as the meta value OR the transaction
53
+ // doesn't want the tr.selection to be sent to remote users at all.
54
+ const remoteSelectionBookmark = originalTransaction.getMeta('useSelectionBookmarkForRemote');
55
+ if (!!remoteSelectionBookmark) {
56
+ if (remoteSelectionBookmark !== true && 'resolve' in remoteSelectionBookmark) {
57
+ const selection = remoteSelectionBookmark.resolve(newEditorState.doc);
84
58
  const message = {
85
59
  type: 'telepointer',
86
- selection,
60
+ selection: getSendableSelection(selection),
87
61
  sessionId
88
62
  };
89
63
  provider.sendMessage(message);
90
64
  }
65
+ } else if (
66
+ // Broadcast the position if the selection has changed, and the doc hasn't changed (it is mapped
67
+ // by the receiver).
68
+ // If we're pasting content though make an exception (as doc has changed)
69
+ // as on a ranged selection it results in not clearing the ranged selection after the paste
70
+ selectionChanged && (!docChangedTransaction || isPaste) || participantsChanged && !hideTelecursorOnLoad) {
71
+ const selection = getSendableSelection(newEditorState.selection);
72
+ const message = {
73
+ type: 'telepointer',
74
+ selection,
75
+ sessionId
76
+ };
77
+ provider.sendMessage(message);
91
78
  }
92
79
  };
@@ -3,7 +3,6 @@ import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-commo
3
3
  import { TELEPOINTER_DIM_CLASS, TELEPOINTER_PULSE_CLASS, TELEPOINTER_PULSE_DURING_TR_CLASS } from '@atlaskit/editor-common/collab';
4
4
  import { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
7
  import { Participants } from '../participants';
9
8
  import { createTelepointers, findPointers, getPositionOfTelepointer, isReplaceStep, hasExistingNudge } from '../utils';
@@ -155,27 +154,6 @@ export class PluginState {
155
154
  } catch (err) {
156
155
  this.onError(err);
157
156
  }
158
- if (!fg('platform_editor_ai_generic_prep_for_aifc')) {
159
- // Remove any selection decoration within the change range,
160
- // takes care of the issue when after pasting we end up with a dead selection
161
- tr.steps.filter(isReplaceStep).forEach(s => {
162
- // Ignored via go/ees005
163
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
164
- const {
165
- from,
166
- to
167
- } = s;
168
- // Ignored via go/ees005
169
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
170
- this.decorationSet.find(from, to).forEach(deco => {
171
- // `type` is private, `from` and `to` are public in latest version
172
- // `from` != `to` means it's a selection
173
- if (deco.from !== deco.to) {
174
- remove.push(deco);
175
- }
176
- });
177
- });
178
- }
179
157
  }
180
158
  const {
181
159
  selection
@@ -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,51 +41,39 @@ 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 (fg('platform_editor_ai_generic_prep_for_aifc')) {
46
- if (!sessionId || viewMode !== 'edit') {
47
- return;
48
- }
44
+ if (!sessionId || viewMode !== 'edit') {
45
+ return;
46
+ }
49
47
 
50
- // uiEvent is standard metdata (docs: https://prosemirror.net/docs/ref/#state.Transaction)
51
- var isPaste = (docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.getMeta('uiEvent')) === 'paste';
48
+ // uiEvent is standard metdata (docs: https://prosemirror.net/docs/ref/#state.Transaction)
49
+ var isPaste = (docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.getMeta('uiEvent')) === 'paste';
52
50
 
53
- // If this metadata is truthy then it means a selection bookmark might be declared as the meta value OR the transaction
54
- // doesn't want the tr.selection to be sent to remote users at all.
55
- var remoteSelectionBookmark = originalTransaction.getMeta('useSelectionBookmarkForRemote');
56
- if (!!remoteSelectionBookmark) {
57
- if (remoteSelectionBookmark !== true && 'resolve' in remoteSelectionBookmark) {
58
- var selection = remoteSelectionBookmark.resolve(newEditorState.doc);
59
- var message = {
60
- type: 'telepointer',
61
- selection: getSendableSelection(selection),
62
- sessionId: sessionId
63
- };
64
- provider.sendMessage(message);
65
- }
66
- } else if (
67
- // Broadcast the position if the selection has changed, and the doc hasn't changed (it is mapped
68
- // by the receiver).
69
- // If we're pasting content though make an exception (as doc has changed)
70
- // as on a ranged selection it results in not clearing the ranged selection after the paste
71
- selectionChanged && (!docChangedTransaction || isPaste) || participantsChanged && !hideTelecursorOnLoad) {
72
- var _selection = getSendableSelection(newEditorState.selection);
73
- var _message = {
74
- type: 'telepointer',
75
- selection: _selection,
76
- sessionId: sessionId
77
- };
78
- provider.sendMessage(_message);
79
- }
80
- } else {
81
- if (sessionId && viewMode === 'edit' && (selectionChanged && !docChangedTransaction || participantsChanged && !hideTelecursorOnLoad)) {
82
- var _selection2 = getSendableSelection(newEditorState.selection);
83
- var _message2 = {
51
+ // If this metadata is truthy then it means a selection bookmark might be declared as the meta value OR the transaction
52
+ // doesn't want the tr.selection to be sent to remote users at all.
53
+ var remoteSelectionBookmark = originalTransaction.getMeta('useSelectionBookmarkForRemote');
54
+ if (!!remoteSelectionBookmark) {
55
+ if (remoteSelectionBookmark !== true && 'resolve' in remoteSelectionBookmark) {
56
+ var selection = remoteSelectionBookmark.resolve(newEditorState.doc);
57
+ var message = {
84
58
  type: 'telepointer',
85
- selection: _selection2,
59
+ selection: getSendableSelection(selection),
86
60
  sessionId: sessionId
87
61
  };
88
- provider.sendMessage(_message2);
62
+ provider.sendMessage(message);
89
63
  }
64
+ } else if (
65
+ // Broadcast the position if the selection has changed, and the doc hasn't changed (it is mapped
66
+ // by the receiver).
67
+ // If we're pasting content though make an exception (as doc has changed)
68
+ // as on a ranged selection it results in not clearing the ranged selection after the paste
69
+ selectionChanged && (!docChangedTransaction || isPaste) || participantsChanged && !hideTelecursorOnLoad) {
70
+ var _selection = getSendableSelection(newEditorState.selection);
71
+ var _message = {
72
+ type: 'telepointer',
73
+ selection: _selection,
74
+ sessionId: sessionId
75
+ };
76
+ provider.sendMessage(_message);
90
77
  }
91
78
  };
92
79
  };
@@ -5,7 +5,6 @@ import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-commo
5
5
  import { TELEPOINTER_DIM_CLASS, TELEPOINTER_PULSE_CLASS, TELEPOINTER_PULSE_DURING_TR_CLASS } from '@atlaskit/editor-common/collab';
6
6
  import { Selection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
9
  import { Participants } from '../participants';
11
10
  import { createTelepointers, findPointers, getPositionOfTelepointer, isReplaceStep, hasExistingNudge } from '../utils';
@@ -168,26 +167,6 @@ export var PluginState = /*#__PURE__*/function () {
168
167
  } catch (err) {
169
168
  this.onError(err);
170
169
  }
171
- if (!fg('platform_editor_ai_generic_prep_for_aifc')) {
172
- // Remove any selection decoration within the change range,
173
- // takes care of the issue when after pasting we end up with a dead selection
174
- tr.steps.filter(isReplaceStep).forEach(function (s) {
175
- // Ignored via go/ees005
176
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
177
- var _ref2 = s,
178
- from = _ref2.from,
179
- to = _ref2.to;
180
- // Ignored via go/ees005
181
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
182
- _this.decorationSet.find(from, to).forEach(function (deco) {
183
- // `type` is private, `from` and `to` are public in latest version
184
- // `from` != `to` means it's a selection
185
- if (deco.from !== deco.to) {
186
- remove.push(deco);
187
- }
188
- });
189
- });
190
- }
191
170
  }
192
171
  var selection = tr.selection;
193
172
  // Ignored via go/ees005
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,12 +39,12 @@
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": "^16.3.0",
42
+ "@atlaskit/tmp-editor-statsig": "^16.30.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "memoize-one": "^6.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "@atlaskit/editor-common": "^111.0.0",
47
+ "@atlaskit/editor-common": "^111.8.0",
48
48
  "react": "^18.2.0",
49
49
  "react-dom": "^18.2.0"
50
50
  },
@@ -89,9 +89,6 @@
89
89
  }
90
90
  },
91
91
  "platform-feature-flags": {
92
- "platform_editor_ai_generic_prep_for_aifc": {
93
- "type": "boolean"
94
- },
95
92
  "platform_editor_inorganic_batchattrsstep_localid": {
96
93
  "type": "boolean"
97
94
  },