@atlaskit/editor-plugin-collab-edit 16.0.8 → 16.0.10

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,19 @@
1
1
  # @atlaskit/editor-plugin-collab-edit
2
2
 
3
+ ## 16.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 16.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f24601e815f0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f24601e815f0b) -
14
+ Clean up the `platform_editor_reduce_noisy_steps_ncs` experiment.
15
+ - Updated dependencies
16
+
3
17
  ## 16.0.8
4
18
 
5
19
  ### Patch Changes
@@ -206,14 +206,9 @@ var collabEditPlugin = exports.collabEditPlugin = function collabEditPlugin(_ref
206
206
  _ref5$userId = _ref5.userId,
207
207
  userId = _ref5$userId === void 0 ? null : _ref5$userId;
208
208
  var transformUnconfirmed = function transformUnconfirmed(steps) {
209
- var transformed = steps;
210
- if ((0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true, {
211
- exposure: true
212
- })) {
213
- transformed = (0, _filterAnalytics.filterAnalyticsSteps)(transformed);
214
- }
209
+ var transformed = (0, _filterAnalytics.filterAnalyticsSteps)(steps);
215
210
  if ((0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true) || (0, _expValEquals.expValEquals)('platform_editor_enable_single_player_step_merging', 'isEnabled', true)) {
216
- transformed = (0, _mergeUnconfirmed.mergeUnconfirmedSteps)(transformed, api);
211
+ return (0, _mergeUnconfirmed.mergeUnconfirmedSteps)(transformed, api);
217
212
  }
218
213
  return transformed;
219
214
  };
@@ -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 _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
9
8
  var _actions = require("../actions");
10
9
  var _pluginKey = require("../main/plugin-key");
11
10
  var sendTransaction = exports.sendTransaction = function sendTransaction(_ref) {
@@ -30,15 +29,12 @@ var sendTransaction = exports.sendTransaction = function sendTransaction(_ref) {
30
29
  if (!(currentPluginState !== null && currentPluginState !== void 0 && currentPluginState.isReady)) {
31
30
  return;
32
31
  }
33
- var newTransaction = (0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true, {
34
- exposure: true
35
- }) ? trNoAnalytics : docChangedTransaction;
36
32
  var shouldSendStepForSynchronyCollabProvider = !originalTransaction.getMeta('isRemote') &&
37
33
  // TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
38
34
  // This metadata is coming from the scaleTable command in table-resizing plugin
39
- !originalTransaction.getMeta('scaleTable') && ((0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true) ? newTransaction === null || newTransaction === void 0 ? void 0 : newTransaction.docChanged : true);
35
+ !originalTransaction.getMeta('scaleTable') && trNoAnalytics.docChanged;
40
36
  if (useNativePlugin || shouldSendStepForSynchronyCollabProvider) {
41
- provider.send(newTransaction, oldEditorState, newEditorState);
37
+ provider.send(trNoAnalytics, oldEditorState, newEditorState);
42
38
  }
43
39
  var prevPluginState = _pluginKey.pluginKey.getState(oldEditorState);
44
40
  var _ref2 = prevPluginState || {},
@@ -9,7 +9,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
9
9
  var _steps = require("@atlaskit/adf-schema/steps");
10
10
  var _transform = require("@atlaskit/editor-prosemirror/transform");
11
11
  var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
12
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
12
  var _trackStepMetrics = require("./track-step-metrics");
14
13
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
15
14
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -184,9 +183,9 @@ var track = exports.track = function track(_ref4) {
184
183
  });
185
184
  (0, _trackStepMetrics.updateNcsSessionStepMetrics)({
186
185
  api: api,
187
- steps: (0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(function (step) {
186
+ steps: newSteps.filter(function (step) {
188
187
  return !(step instanceof _steps.AnalyticsStep);
189
- }) : newSteps
188
+ })
190
189
  });
191
190
  scheduler.postTask(function () {
192
191
  task(stepsSentCache, onTrackDataProcessed);
@@ -161,14 +161,9 @@ export const collabEditPlugin = ({
161
161
  userId = null
162
162
  } = options || {};
163
163
  const transformUnconfirmed = steps => {
164
- let transformed = steps;
165
- if (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
166
- exposure: true
167
- })) {
168
- transformed = filterAnalyticsSteps(transformed);
169
- }
164
+ const transformed = filterAnalyticsSteps(steps);
170
165
  if (editorExperiment('platform_editor_offline_editing_web', true) || expValEquals('platform_editor_enable_single_player_step_merging', 'isEnabled', true)) {
171
- transformed = mergeUnconfirmedSteps(transformed, api);
166
+ return mergeUnconfirmedSteps(transformed, api);
172
167
  }
173
168
  return transformed;
174
169
  };
@@ -1,5 +1,4 @@
1
1
  import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
2
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
2
  import { getSendableSelection } from '../actions';
4
3
  import { pluginKey } from '../main/plugin-key';
5
4
  export const sendTransaction = ({
@@ -22,15 +21,12 @@ export const sendTransaction = ({
22
21
  if (!(currentPluginState !== null && currentPluginState !== void 0 && currentPluginState.isReady)) {
23
22
  return;
24
23
  }
25
- const newTransaction = editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
26
- exposure: true
27
- }) ? trNoAnalytics : docChangedTransaction;
28
24
  const shouldSendStepForSynchronyCollabProvider = !originalTransaction.getMeta('isRemote') &&
29
25
  // TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
30
26
  // This metadata is coming from the scaleTable command in table-resizing plugin
31
- !originalTransaction.getMeta('scaleTable') && (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newTransaction === null || newTransaction === void 0 ? void 0 : newTransaction.docChanged : true);
27
+ !originalTransaction.getMeta('scaleTable') && trNoAnalytics.docChanged;
32
28
  if (useNativePlugin || shouldSendStepForSynchronyCollabProvider) {
33
- provider.send(newTransaction, oldEditorState, newEditorState);
29
+ provider.send(trNoAnalytics, oldEditorState, newEditorState);
34
30
  }
35
31
  const prevPluginState = pluginKey.getState(oldEditorState);
36
32
  const {
@@ -2,7 +2,6 @@
2
2
  import { AnalyticsStep, SetAttrsStep, BatchAttrsStep } from '@atlaskit/adf-schema/steps';
3
3
  import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
4
4
  import { sendableSteps } from '@atlaskit/prosemirror-collab';
5
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
5
  import { updateNcsSessionStepMetrics } from './track-step-metrics';
7
6
  function groupBy(array, keyGetter) {
8
7
  // Check group by exists, and that it's a function. If so, use the native browser code
@@ -162,7 +161,7 @@ export const track = ({
162
161
  });
163
162
  updateNcsSessionStepMetrics({
164
163
  api,
165
- steps: editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(step => !(step instanceof AnalyticsStep)) : newSteps
164
+ steps: newSteps.filter(step => !(step instanceof AnalyticsStep))
166
165
  });
167
166
  scheduler.postTask(() => {
168
167
  task(stepsSentCache, onTrackDataProcessed);
@@ -199,14 +199,9 @@ export var collabEditPlugin = function collabEditPlugin(_ref4) {
199
199
  _ref5$userId = _ref5.userId,
200
200
  userId = _ref5$userId === void 0 ? null : _ref5$userId;
201
201
  var transformUnconfirmed = function transformUnconfirmed(steps) {
202
- var transformed = steps;
203
- if (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
204
- exposure: true
205
- })) {
206
- transformed = filterAnalyticsSteps(transformed);
207
- }
202
+ var transformed = filterAnalyticsSteps(steps);
208
203
  if (editorExperiment('platform_editor_offline_editing_web', true) || expValEquals('platform_editor_enable_single_player_step_merging', 'isEnabled', true)) {
209
- transformed = mergeUnconfirmedSteps(transformed, api);
204
+ return mergeUnconfirmedSteps(transformed, api);
210
205
  }
211
206
  return transformed;
212
207
  };
@@ -1,5 +1,4 @@
1
1
  import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
2
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
2
  import { getSendableSelection } from '../actions';
4
3
  import { pluginKey } from '../main/plugin-key';
5
4
  export var sendTransaction = function sendTransaction(_ref) {
@@ -24,15 +23,12 @@ export var sendTransaction = function sendTransaction(_ref) {
24
23
  if (!(currentPluginState !== null && currentPluginState !== void 0 && currentPluginState.isReady)) {
25
24
  return;
26
25
  }
27
- var newTransaction = editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
28
- exposure: true
29
- }) ? trNoAnalytics : docChangedTransaction;
30
26
  var shouldSendStepForSynchronyCollabProvider = !originalTransaction.getMeta('isRemote') &&
31
27
  // TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
32
28
  // This metadata is coming from the scaleTable command in table-resizing plugin
33
- !originalTransaction.getMeta('scaleTable') && (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newTransaction === null || newTransaction === void 0 ? void 0 : newTransaction.docChanged : true);
29
+ !originalTransaction.getMeta('scaleTable') && trNoAnalytics.docChanged;
34
30
  if (useNativePlugin || shouldSendStepForSynchronyCollabProvider) {
35
- provider.send(newTransaction, oldEditorState, newEditorState);
31
+ provider.send(trNoAnalytics, oldEditorState, newEditorState);
36
32
  }
37
33
  var prevPluginState = pluginKey.getState(oldEditorState);
38
34
  var _ref2 = prevPluginState || {},
@@ -6,7 +6,6 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
6
6
  import { AnalyticsStep, SetAttrsStep, BatchAttrsStep } from '@atlaskit/adf-schema/steps';
7
7
  import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
8
8
  import { sendableSteps } from '@atlaskit/prosemirror-collab';
9
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
9
  import { updateNcsSessionStepMetrics } from './track-step-metrics';
11
10
  function groupBy(array, keyGetter) {
12
11
  // Check group by exists, and that it's a function. If so, use the native browser code
@@ -178,9 +177,9 @@ export var track = function track(_ref4) {
178
177
  });
179
178
  updateNcsSessionStepMetrics({
180
179
  api: api,
181
- steps: editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(function (step) {
180
+ steps: newSteps.filter(function (step) {
182
181
  return !(step instanceof AnalyticsStep);
183
- }) : newSteps
182
+ })
184
183
  });
185
184
  scheduler.postTask(function () {
186
185
  task(stepsSentCache, onTrackDataProcessed);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "16.0.8",
3
+ "version": "16.0.10",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,13 +32,13 @@
32
32
  "@atlaskit/platform-feature-experiments": "^0.3.0",
33
33
  "@atlaskit/platform-feature-flags": "^2.1.0",
34
34
  "@atlaskit/prosemirror-collab": "^1.0.0",
35
- "@atlaskit/tmp-editor-statsig": "^153.0.0",
35
+ "@atlaskit/tmp-editor-statsig": "^155.0.0",
36
36
  "@atlaskit/tokens": "^16.7.0",
37
37
  "@babel/runtime": "^7.0.0",
38
38
  "memoize-one": "^6.0.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "@atlaskit/editor-common": "^119.9.0",
41
+ "@atlaskit/editor-common": "^119.10.0",
42
42
  "react": "^18.2.0 || ^19.2.0",
43
43
  "react-dom": "^18.2.0 || ^19.2.0"
44
44
  },