@atlaskit/editor-plugin-collab-edit 3.9.1 → 3.9.3

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
+ ## 3.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.9.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#161613](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/161613)
14
+ [`081ebfcee0d82`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/081ebfcee0d82) -
15
+ [EDITOR-752] Add ncsSessionStepMetrics analytics event
16
+
3
17
  ## 3.9.1
4
18
 
5
19
  ### Patch Changes
@@ -17,6 +17,7 @@ var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
17
17
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
18
  var _analytics2 = require("./pm-plugins/analytics");
19
19
  var _sendTransaction = require("./pm-plugins/events/send-transaction");
20
+ var _filterAnalytics = require("./pm-plugins/filterAnalytics");
20
21
  var _main = require("./pm-plugins/main");
21
22
  var _pluginKey = require("./pm-plugins/main/plugin-key");
22
23
  var _mergeUnconfirmed = require("./pm-plugins/mergeUnconfirmed");
@@ -203,8 +204,10 @@ var collabEditPlugin = exports.collabEditPlugin = function collabEditPlugin(_ref
203
204
  userId = _ref5$userId === void 0 ? null : _ref5$userId;
204
205
  var transformUnconfirmed = function transformUnconfirmed(steps) {
205
206
  var transformed = steps;
206
- if ((0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true)) {
207
- transformed = (0, _mergeUnconfirmed.filterAnalyticsSteps)(transformed);
207
+ if ((0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true, {
208
+ exposure: true
209
+ })) {
210
+ transformed = (0, _filterAnalytics.filterAnalyticsSteps)(transformed);
208
211
  }
209
212
  if ((0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true)) {
210
213
  transformed = (0, _mergeUnconfirmed.mergeUnconfirmedSteps)(transformed, api);
@@ -22,17 +22,18 @@ var sendTransaction = exports.sendTransaction = function sendTransaction(_ref) {
22
22
  return tr.docChanged;
23
23
  });
24
24
  var currentPluginState = _pluginKey.pluginKey.getState(newEditorState);
25
- var tr = oldEditorState.tr;
26
- var trNoAnalytics = docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.steps.reduce(function (nextTr, step) {
25
+ var trNoAnalytics = oldEditorState.tr;
26
+ docChangedTransaction === null || docChangedTransaction === void 0 || docChangedTransaction.steps.forEach(function (step) {
27
27
  if (!(step instanceof _steps.AnalyticsStep)) {
28
- return nextTr.step(step);
28
+ trNoAnalytics.step(step);
29
29
  }
30
- return nextTr;
31
- }, tr);
30
+ });
32
31
  if (!(currentPluginState !== null && currentPluginState !== void 0 && currentPluginState.isReady)) {
33
32
  return;
34
33
  }
35
- var newTransaction = (0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true) ? trNoAnalytics : docChangedTransaction;
34
+ var newTransaction = (0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true, {
35
+ exposure: true
36
+ }) ? trNoAnalytics : docChangedTransaction;
36
37
  var shouldSendStepForSynchronyCollabProvider = !originalTransaction.getMeta('isRemote') &&
37
38
  // TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
38
39
  // This metadata is coming from the scaleTable command in table-resizing plugin
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.filterAnalyticsSteps = filterAnalyticsSteps;
7
+ var _steps = require("@atlaskit/adf-schema/steps");
8
+ var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
9
+ /**
10
+ * Filter out AnalyticsStep from the steps.
11
+ *
12
+ * @param steps Rebaseable steps
13
+ * @returns Rebaseable steps
14
+ * @example
15
+ */
16
+ function filterAnalyticsSteps(steps) {
17
+ var filteredSteps = steps.reduce(function (acc, rebaseable) {
18
+ if (!(rebaseable.step instanceof _steps.AnalyticsStep)) {
19
+ acc.push(new _prosemirrorCollab.Rebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin));
20
+ }
21
+ return acc;
22
+ }, []);
23
+ return filteredSteps;
24
+ }
@@ -1,23 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.LockableRebaseable = void 0;
8
- exports.filterAnalyticsSteps = filterAnalyticsSteps;
9
6
  exports.mergeUnconfirmedSteps = mergeUnconfirmedSteps;
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _steps = require("@atlaskit/adf-schema/steps");
13
7
  var _state = require("@atlaskit/editor-prosemirror/state");
14
- // Based on: `packages/editor/prosemirror-collab/src/index.ts`
15
- var LockableRebaseable = exports.LockableRebaseable = /*#__PURE__*/(0, _createClass2.default)(function LockableRebaseable(step, inverted, origin) {
16
- (0, _classCallCheck2.default)(this, LockableRebaseable);
17
- this.step = step;
18
- this.inverted = inverted;
19
- this.origin = origin;
20
- });
8
+ var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
21
9
  var isLocked = function isLocked(step) {
22
10
  if (step.origin instanceof _state.Transaction) {
23
11
  return step.origin.getMeta('mergeIsLocked');
@@ -42,35 +30,19 @@ function mergeUnconfirmedSteps(steps, api) {
42
30
  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';
43
31
  if (isOffline && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
44
32
  var mergedStep = lastStep.step.merge(rebaseable.step);
45
- var _inverted = rebaseable.inverted.merge(lastStep.inverted);
33
+ var inverted = rebaseable.inverted.merge(lastStep.inverted);
46
34
  // Always take the origin of the new step.
47
35
  // We use this in packages/editor/collab-provider/src/document/document-service.ts:commitUnconfirmedSteps
48
36
  // to confirm that the last transaction has been sent. Since we're taking the latest this still works as expected
49
37
  // As we want to wait until all the transactions have been pushed through
50
- var _origin = lastStep.origin;
51
- if (mergedStep && _inverted) {
52
- acc[acc.length - 1] = new LockableRebaseable(mergedStep, _inverted, _origin instanceof _state.Transaction ? _origin.setMeta('isOffline', isOffline) : _origin);
38
+ var origin = lastStep.origin;
39
+ if (mergedStep && inverted) {
40
+ acc[acc.length - 1] = new _prosemirrorCollab.Rebaseable(mergedStep, inverted, origin instanceof _state.Transaction ? origin.setMeta('isOffline', isOffline) : origin);
53
41
  return acc;
54
42
  }
55
43
  }
56
- return acc.concat(new LockableRebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin instanceof _state.Transaction ? rebaseable.origin.setMeta('isOffline', rebaseable.origin.getMeta('isOffline') === true || isOffline) : rebaseable.origin));
44
+ acc.push(new _prosemirrorCollab.Rebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin instanceof _state.Transaction ? rebaseable.origin.setMeta('isOffline', rebaseable.origin.getMeta('isOffline') === true || isOffline) : rebaseable.origin));
45
+ return acc;
57
46
  }, []);
58
47
  return mergedSteps;
59
- }
60
-
61
- /**
62
- * Filter out AnalyticsStep from the steps.
63
- *
64
- * @param steps Rebaseable steps
65
- * @returns Rebaseable steps
66
- * @example
67
- */
68
- function filterAnalyticsSteps(steps) {
69
- var filteredSteps = steps.reduce(function (acc, rebaseable) {
70
- if (rebaseable.step instanceof _steps.AnalyticsStep) {
71
- return acc;
72
- }
73
- return acc.concat(new LockableRebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin));
74
- }, []);
75
- return filteredSteps;
76
48
  }
@@ -4,13 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.updateStepSessionMetrics = exports.updateActiveSessions = exports.getStepSessionMetrics = void 0;
7
+ exports.updateNcsSessionStepMetrics = exports.updateNcsActiveSessions = exports.getNcsSessionStepMetrics = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _ncsStepMetrics = require("@atlaskit/editor-common/ncs-step-metrics");
9
10
  var _frontendUtilities = require("@atlaskit/frontend-utilities");
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
- var STORAGE_CLIENT_KEY = 'ncs-step-metrics-storage';
13
- var storageClient = new _frontendUtilities.StorageClient(STORAGE_CLIENT_KEY);
13
+ var storageClient = new _frontendUtilities.StorageClient(_ncsStepMetrics.NCS_STORAGE.NCS_STORAGE_CLIENT_KEY);
14
14
 
15
15
  /**
16
16
  * Gets the current step session metrics for a given session ID
@@ -23,9 +23,10 @@ var storageClient = new _frontendUtilities.StorageClient(STORAGE_CLIENT_KEY);
23
23
  * @param steps - The steps to calculate the metrics from.
24
24
  * @returns The updated step session metrics for the given session ID.
25
25
  */
26
- var getStepSessionMetrics = exports.getStepSessionMetrics = function getStepSessionMetrics(metrics, sessionId, steps) {
26
+ var getNcsSessionStepMetrics = exports.getNcsSessionStepMetrics = function getNcsSessionStepMetrics(metrics, sessionId, steps) {
27
27
  var _metrics$sessionId;
28
28
  var current = (_metrics$sessionId = metrics[sessionId]) !== null && _metrics$sessionId !== void 0 ? _metrics$sessionId : {
29
+ ncsSessionId: sessionId,
29
30
  totalStepSize: 0,
30
31
  numberOfSteps: 0,
31
32
  maxStepSize: 0,
@@ -51,10 +52,10 @@ var getStepSessionMetrics = exports.getStepSessionMetrics = function getStepSess
51
52
  * @param sessionId - The session ID to check or update in local storage.
52
53
  * @returns void
53
54
  */
54
- var updateActiveSessions = exports.updateActiveSessions = function updateActiveSessions(sessionId) {
55
- var currentActiveSessions = JSON.parse(storageClient.getItem('ncsActiveSessions') || '{}');
55
+ var updateNcsActiveSessions = exports.updateNcsActiveSessions = function updateNcsActiveSessions(sessionId) {
56
+ var currentActiveSessions = JSON.parse(storageClient.getItem(_ncsStepMetrics.NCS_STORAGE.NCS_ACTIVE_SESSIONS) || '{}');
56
57
  if (!currentActiveSessions[sessionId]) {
57
- storageClient.setItemWithExpiry('ncsActiveSessions', JSON.stringify(_objectSpread(_objectSpread({}, currentActiveSessions), {}, (0, _defineProperty2.default)({}, sessionId, true))));
58
+ storageClient.setItemWithExpiry(_ncsStepMetrics.NCS_STORAGE.NCS_ACTIVE_SESSIONS, JSON.stringify(_objectSpread(_objectSpread({}, currentActiveSessions), {}, (0, _defineProperty2.default)({}, sessionId, true))));
58
59
  }
59
60
  };
60
61
  /**
@@ -65,7 +66,7 @@ var updateActiveSessions = exports.updateActiveSessions = function updateActiveS
65
66
  * @param steps - The steps to calculate the metrics from.
66
67
  * @return void
67
68
  */
68
- var updateStepSessionMetrics = exports.updateStepSessionMetrics = function updateStepSessionMetrics(_ref) {
69
+ var updateNcsSessionStepMetrics = exports.updateNcsSessionStepMetrics = function updateNcsSessionStepMetrics(_ref) {
69
70
  var _api$collabEdit;
70
71
  var api = _ref.api,
71
72
  steps = _ref.steps;
@@ -73,8 +74,8 @@ var updateStepSessionMetrics = exports.updateStepSessionMetrics = function updat
73
74
  if (!sessionId) {
74
75
  return;
75
76
  }
76
- var existingMetrics = JSON.parse(storageClient.getItem('ncsStepSessionMetrics') || '{}');
77
- var stepSessionMetrics = getStepSessionMetrics(existingMetrics, sessionId, steps);
78
- storageClient.setItemWithExpiry('ncsStepSessionMetrics', JSON.stringify(_objectSpread(_objectSpread({}, existingMetrics), {}, (0, _defineProperty2.default)({}, sessionId, stepSessionMetrics))));
79
- updateActiveSessions(sessionId);
77
+ var existingMetrics = JSON.parse(storageClient.getItem(_ncsStepMetrics.NCS_STORAGE.NCS_SESSION_STEP_METRICS) || '{}');
78
+ var ncsSessionStepMetrics = getNcsSessionStepMetrics(existingMetrics, sessionId, steps);
79
+ storageClient.setItemWithExpiry(_ncsStepMetrics.NCS_STORAGE.NCS_SESSION_STEP_METRICS, JSON.stringify(_objectSpread(_objectSpread({}, existingMetrics), {}, (0, _defineProperty2.default)({}, sessionId, ncsSessionStepMetrics))));
80
+ updateNcsActiveSessions(sessionId);
80
81
  };
@@ -176,13 +176,13 @@ var track = exports.track = function track(_ref3) {
176
176
  endedAt: endedAt,
177
177
  steps: steps
178
178
  });
179
+ if ((0, _platformFeatureFlags.fg)('platform_enable_ncs_step_metrics')) {
180
+ (0, _trackStepMetrics.updateNcsSessionStepMetrics)({
181
+ api: api,
182
+ steps: newSteps
183
+ });
184
+ }
179
185
  scheduler.postTask(function () {
180
- if ((0, _platformFeatureFlags.fg)('platform_enable_ncs_step_metrics')) {
181
- (0, _trackStepMetrics.updateStepSessionMetrics)({
182
- api: api,
183
- steps: newSteps
184
- });
185
- }
186
186
  task(stepsSentCache, onTrackDataProcessed);
187
187
  }, {
188
188
  priority: 'background',
@@ -6,9 +6,10 @@ import { collab, getCollabState, sendableSteps } from '@atlaskit/prosemirror-col
6
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
7
  import { addSynchronyErrorAnalytics } from './pm-plugins/analytics';
8
8
  import { sendTransaction } from './pm-plugins/events/send-transaction';
9
+ import { filterAnalyticsSteps } from './pm-plugins/filterAnalytics';
9
10
  import { createPlugin } from './pm-plugins/main';
10
11
  import { pluginKey as mainPluginKey } from './pm-plugins/main/plugin-key';
11
- import { filterAnalyticsSteps, mergeUnconfirmedSteps } from './pm-plugins/mergeUnconfirmed';
12
+ import { mergeUnconfirmedSteps } from './pm-plugins/mergeUnconfirmed';
12
13
  import { nativeCollabProviderPlugin } from './pm-plugins/native-collab-provider-plugin';
13
14
  import { sanitizeFilteredStep, createPlugin as trackSpammingStepsPlugin } from './pm-plugins/track-and-filter-spamming-steps';
14
15
  import { createPlugin as createLastOrganicChangePlugin, trackLastOrganicChangePluginKey } from './pm-plugins/track-last-organic-change';
@@ -158,7 +159,9 @@ export const collabEditPlugin = ({
158
159
  } = options || {};
159
160
  const transformUnconfirmed = steps => {
160
161
  let transformed = steps;
161
- if (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true)) {
162
+ if (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
163
+ exposure: true
164
+ })) {
162
165
  transformed = filterAnalyticsSteps(transformed);
163
166
  }
164
167
  if (editorExperiment('platform_editor_offline_editing_web', true)) {
@@ -14,17 +14,18 @@ export const sendTransaction = ({
14
14
  }) => provider => {
15
15
  const docChangedTransaction = transactions.find(tr => tr.docChanged);
16
16
  const currentPluginState = pluginKey.getState(newEditorState);
17
- const tr = oldEditorState.tr;
18
- const trNoAnalytics = docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.steps.reduce((nextTr, step) => {
17
+ const trNoAnalytics = oldEditorState.tr;
18
+ docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.steps.forEach(step => {
19
19
  if (!(step instanceof AnalyticsStep)) {
20
- return nextTr.step(step);
20
+ trNoAnalytics.step(step);
21
21
  }
22
- return nextTr;
23
- }, tr);
22
+ });
24
23
  if (!(currentPluginState !== null && currentPluginState !== void 0 && currentPluginState.isReady)) {
25
24
  return;
26
25
  }
27
- const newTransaction = editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? trNoAnalytics : docChangedTransaction;
26
+ const newTransaction = editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
27
+ exposure: true
28
+ }) ? trNoAnalytics : docChangedTransaction;
28
29
  const shouldSendStepForSynchronyCollabProvider = !originalTransaction.getMeta('isRemote') &&
29
30
  // TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
30
31
  // This metadata is coming from the scaleTable command in table-resizing plugin
@@ -0,0 +1,19 @@
1
+ import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
2
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
3
+
4
+ /**
5
+ * Filter out AnalyticsStep from the steps.
6
+ *
7
+ * @param steps Rebaseable steps
8
+ * @returns Rebaseable steps
9
+ * @example
10
+ */
11
+ export function filterAnalyticsSteps(steps) {
12
+ const filteredSteps = steps.reduce((acc, rebaseable) => {
13
+ if (!(rebaseable.step instanceof AnalyticsStep)) {
14
+ acc.push(new Rebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin));
15
+ }
16
+ return acc;
17
+ }, []);
18
+ return filteredSteps;
19
+ }
@@ -1,13 +1,5 @@
1
- import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
2
1
  import { Transaction } from '@atlaskit/editor-prosemirror/state';
3
- // Based on: `packages/editor/prosemirror-collab/src/index.ts`
4
- export class LockableRebaseable {
5
- constructor(step, inverted, origin) {
6
- this.step = step;
7
- this.inverted = inverted;
8
- this.origin = origin;
9
- }
10
- }
2
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
11
3
  const isLocked = step => {
12
4
  if (step.origin instanceof Transaction) {
13
5
  return step.origin.getMeta('mergeIsLocked');
@@ -39,28 +31,12 @@ export function mergeUnconfirmedSteps(steps, api) {
39
31
  // As we want to wait until all the transactions have been pushed through
40
32
  const origin = lastStep.origin;
41
33
  if (mergedStep && inverted) {
42
- acc[acc.length - 1] = new LockableRebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', isOffline) : origin);
34
+ acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', isOffline) : origin);
43
35
  return acc;
44
36
  }
45
37
  }
46
- return acc.concat(new LockableRebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin instanceof Transaction ? rebaseable.origin.setMeta('isOffline', rebaseable.origin.getMeta('isOffline') === true || isOffline) : rebaseable.origin));
38
+ acc.push(new Rebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin instanceof Transaction ? rebaseable.origin.setMeta('isOffline', rebaseable.origin.getMeta('isOffline') === true || isOffline) : rebaseable.origin));
39
+ return acc;
47
40
  }, []);
48
41
  return mergedSteps;
49
- }
50
-
51
- /**
52
- * Filter out AnalyticsStep from the steps.
53
- *
54
- * @param steps Rebaseable steps
55
- * @returns Rebaseable steps
56
- * @example
57
- */
58
- export function filterAnalyticsSteps(steps) {
59
- const filteredSteps = steps.reduce((acc, rebaseable) => {
60
- if (rebaseable.step instanceof AnalyticsStep) {
61
- return acc;
62
- }
63
- return acc.concat(new LockableRebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin));
64
- }, []);
65
- return filteredSteps;
66
42
  }
@@ -1,6 +1,6 @@
1
+ import { NCS_STORAGE } from '@atlaskit/editor-common/ncs-step-metrics';
1
2
  import { StorageClient } from '@atlaskit/frontend-utilities';
2
- const STORAGE_CLIENT_KEY = 'ncs-step-metrics-storage';
3
- const storageClient = new StorageClient(STORAGE_CLIENT_KEY);
3
+ const storageClient = new StorageClient(NCS_STORAGE.NCS_STORAGE_CLIENT_KEY);
4
4
 
5
5
  /**
6
6
  * Gets the current step session metrics for a given session ID
@@ -13,9 +13,10 @@ const storageClient = new StorageClient(STORAGE_CLIENT_KEY);
13
13
  * @param steps - The steps to calculate the metrics from.
14
14
  * @returns The updated step session metrics for the given session ID.
15
15
  */
16
- export const getStepSessionMetrics = (metrics, sessionId, steps) => {
16
+ export const getNcsSessionStepMetrics = (metrics, sessionId, steps) => {
17
17
  var _metrics$sessionId;
18
18
  const current = (_metrics$sessionId = metrics[sessionId]) !== null && _metrics$sessionId !== void 0 ? _metrics$sessionId : {
19
+ ncsSessionId: sessionId,
19
20
  totalStepSize: 0,
20
21
  numberOfSteps: 0,
21
22
  maxStepSize: 0,
@@ -41,10 +42,10 @@ export const getStepSessionMetrics = (metrics, sessionId, steps) => {
41
42
  * @param sessionId - The session ID to check or update in local storage.
42
43
  * @returns void
43
44
  */
44
- export const updateActiveSessions = sessionId => {
45
- const currentActiveSessions = JSON.parse(storageClient.getItem('ncsActiveSessions') || '{}');
45
+ export const updateNcsActiveSessions = sessionId => {
46
+ const currentActiveSessions = JSON.parse(storageClient.getItem(NCS_STORAGE.NCS_ACTIVE_SESSIONS) || '{}');
46
47
  if (!currentActiveSessions[sessionId]) {
47
- storageClient.setItemWithExpiry('ncsActiveSessions', JSON.stringify({
48
+ storageClient.setItemWithExpiry(NCS_STORAGE.NCS_ACTIVE_SESSIONS, JSON.stringify({
48
49
  ...currentActiveSessions,
49
50
  [sessionId]: true
50
51
  }));
@@ -58,7 +59,7 @@ export const updateActiveSessions = sessionId => {
58
59
  * @param steps - The steps to calculate the metrics from.
59
60
  * @return void
60
61
  */
61
- export const updateStepSessionMetrics = ({
62
+ export const updateNcsSessionStepMetrics = ({
62
63
  api,
63
64
  steps
64
65
  }) => {
@@ -67,11 +68,11 @@ export const updateStepSessionMetrics = ({
67
68
  if (!sessionId) {
68
69
  return;
69
70
  }
70
- const existingMetrics = JSON.parse(storageClient.getItem('ncsStepSessionMetrics') || '{}');
71
- const stepSessionMetrics = getStepSessionMetrics(existingMetrics, sessionId, steps);
72
- storageClient.setItemWithExpiry('ncsStepSessionMetrics', JSON.stringify({
71
+ const existingMetrics = JSON.parse(storageClient.getItem(NCS_STORAGE.NCS_SESSION_STEP_METRICS) || '{}');
72
+ const ncsSessionStepMetrics = getNcsSessionStepMetrics(existingMetrics, sessionId, steps);
73
+ storageClient.setItemWithExpiry(NCS_STORAGE.NCS_SESSION_STEP_METRICS, JSON.stringify({
73
74
  ...existingMetrics,
74
- [sessionId]: stepSessionMetrics
75
+ [sessionId]: ncsSessionStepMetrics
75
76
  }));
76
- updateActiveSessions(sessionId);
77
+ updateNcsActiveSessions(sessionId);
77
78
  };
@@ -2,7 +2,7 @@ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
2
2
  import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  import { sendableSteps } from '@atlaskit/prosemirror-collab';
5
- import { updateStepSessionMetrics } from './track-step-metrics';
5
+ import { updateNcsSessionStepMetrics } from './track-step-metrics';
6
6
  function groupBy(array, keyGetter) {
7
7
  // Check group by exists, and that it's a function. If so, use the native browser code
8
8
  if ('groupBy' in Object && typeof Object.groupBy === 'function') {
@@ -154,13 +154,13 @@ export const track = ({
154
154
  endedAt,
155
155
  steps
156
156
  });
157
+ if (fg('platform_enable_ncs_step_metrics')) {
158
+ updateNcsSessionStepMetrics({
159
+ api,
160
+ steps: newSteps
161
+ });
162
+ }
157
163
  scheduler.postTask(() => {
158
- if (fg('platform_enable_ncs_step_metrics')) {
159
- updateStepSessionMetrics({
160
- api,
161
- steps: newSteps
162
- });
163
- }
164
164
  task(stepsSentCache, onTrackDataProcessed);
165
165
  }, {
166
166
  priority: 'background',
@@ -12,9 +12,10 @@ import { collab, getCollabState, sendableSteps } from '@atlaskit/prosemirror-col
12
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
13
  import { addSynchronyErrorAnalytics } from './pm-plugins/analytics';
14
14
  import { sendTransaction } from './pm-plugins/events/send-transaction';
15
+ import { filterAnalyticsSteps } from './pm-plugins/filterAnalytics';
15
16
  import { createPlugin } from './pm-plugins/main';
16
17
  import { pluginKey as mainPluginKey } from './pm-plugins/main/plugin-key';
17
- import { filterAnalyticsSteps, mergeUnconfirmedSteps } from './pm-plugins/mergeUnconfirmed';
18
+ import { mergeUnconfirmedSteps } from './pm-plugins/mergeUnconfirmed';
18
19
  import { nativeCollabProviderPlugin } from './pm-plugins/native-collab-provider-plugin';
19
20
  import { sanitizeFilteredStep, createPlugin as trackSpammingStepsPlugin } from './pm-plugins/track-and-filter-spamming-steps';
20
21
  import { createPlugin as createLastOrganicChangePlugin, trackLastOrganicChangePluginKey } from './pm-plugins/track-last-organic-change';
@@ -196,7 +197,9 @@ export var collabEditPlugin = function collabEditPlugin(_ref4) {
196
197
  userId = _ref5$userId === void 0 ? null : _ref5$userId;
197
198
  var transformUnconfirmed = function transformUnconfirmed(steps) {
198
199
  var transformed = steps;
199
- if (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true)) {
200
+ if (editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
201
+ exposure: true
202
+ })) {
200
203
  transformed = filterAnalyticsSteps(transformed);
201
204
  }
202
205
  if (editorExperiment('platform_editor_offline_editing_web', true)) {
@@ -16,17 +16,18 @@ export var sendTransaction = function sendTransaction(_ref) {
16
16
  return tr.docChanged;
17
17
  });
18
18
  var currentPluginState = pluginKey.getState(newEditorState);
19
- var tr = oldEditorState.tr;
20
- var trNoAnalytics = docChangedTransaction === null || docChangedTransaction === void 0 ? void 0 : docChangedTransaction.steps.reduce(function (nextTr, step) {
19
+ var trNoAnalytics = oldEditorState.tr;
20
+ docChangedTransaction === null || docChangedTransaction === void 0 || docChangedTransaction.steps.forEach(function (step) {
21
21
  if (!(step instanceof AnalyticsStep)) {
22
- return nextTr.step(step);
22
+ trNoAnalytics.step(step);
23
23
  }
24
- return nextTr;
25
- }, tr);
24
+ });
26
25
  if (!(currentPluginState !== null && currentPluginState !== void 0 && currentPluginState.isReady)) {
27
26
  return;
28
27
  }
29
- var newTransaction = editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? trNoAnalytics : docChangedTransaction;
28
+ var newTransaction = editorExperiment('platform_editor_reduce_noisy_steps_ncs', true, {
29
+ exposure: true
30
+ }) ? trNoAnalytics : docChangedTransaction;
30
31
  var shouldSendStepForSynchronyCollabProvider = !originalTransaction.getMeta('isRemote') &&
31
32
  // TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
32
33
  // This metadata is coming from the scaleTable command in table-resizing plugin
@@ -0,0 +1,19 @@
1
+ import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
2
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
3
+
4
+ /**
5
+ * Filter out AnalyticsStep from the steps.
6
+ *
7
+ * @param steps Rebaseable steps
8
+ * @returns Rebaseable steps
9
+ * @example
10
+ */
11
+ export function filterAnalyticsSteps(steps) {
12
+ var filteredSteps = steps.reduce(function (acc, rebaseable) {
13
+ if (!(rebaseable.step instanceof AnalyticsStep)) {
14
+ acc.push(new Rebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin));
15
+ }
16
+ return acc;
17
+ }, []);
18
+ return filteredSteps;
19
+ }
@@ -1,14 +1,5 @@
1
- import _createClass from "@babel/runtime/helpers/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
4
1
  import { Transaction } from '@atlaskit/editor-prosemirror/state';
5
- // Based on: `packages/editor/prosemirror-collab/src/index.ts`
6
- export var LockableRebaseable = /*#__PURE__*/_createClass(function LockableRebaseable(step, inverted, origin) {
7
- _classCallCheck(this, LockableRebaseable);
8
- this.step = step;
9
- this.inverted = inverted;
10
- this.origin = origin;
11
- });
2
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
12
3
  var isLocked = function isLocked(step) {
13
4
  if (step.origin instanceof Transaction) {
14
5
  return step.origin.getMeta('mergeIsLocked');
@@ -33,35 +24,19 @@ export function mergeUnconfirmedSteps(steps, api) {
33
24
  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';
34
25
  if (isOffline && lastStep && !isLocked(lastStep) && !isLocked(rebaseable)) {
35
26
  var mergedStep = lastStep.step.merge(rebaseable.step);
36
- var _inverted = rebaseable.inverted.merge(lastStep.inverted);
27
+ var inverted = rebaseable.inverted.merge(lastStep.inverted);
37
28
  // Always take the origin of the new step.
38
29
  // We use this in packages/editor/collab-provider/src/document/document-service.ts:commitUnconfirmedSteps
39
30
  // to confirm that the last transaction has been sent. Since we're taking the latest this still works as expected
40
31
  // As we want to wait until all the transactions have been pushed through
41
- var _origin = lastStep.origin;
42
- if (mergedStep && _inverted) {
43
- acc[acc.length - 1] = new LockableRebaseable(mergedStep, _inverted, _origin instanceof Transaction ? _origin.setMeta('isOffline', isOffline) : _origin);
32
+ var origin = lastStep.origin;
33
+ if (mergedStep && inverted) {
34
+ acc[acc.length - 1] = new Rebaseable(mergedStep, inverted, origin instanceof Transaction ? origin.setMeta('isOffline', isOffline) : origin);
44
35
  return acc;
45
36
  }
46
37
  }
47
- return acc.concat(new LockableRebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin instanceof Transaction ? rebaseable.origin.setMeta('isOffline', rebaseable.origin.getMeta('isOffline') === true || isOffline) : rebaseable.origin));
38
+ acc.push(new Rebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin instanceof Transaction ? rebaseable.origin.setMeta('isOffline', rebaseable.origin.getMeta('isOffline') === true || isOffline) : rebaseable.origin));
39
+ return acc;
48
40
  }, []);
49
41
  return mergedSteps;
50
- }
51
-
52
- /**
53
- * Filter out AnalyticsStep from the steps.
54
- *
55
- * @param steps Rebaseable steps
56
- * @returns Rebaseable steps
57
- * @example
58
- */
59
- export function filterAnalyticsSteps(steps) {
60
- var filteredSteps = steps.reduce(function (acc, rebaseable) {
61
- if (rebaseable.step instanceof AnalyticsStep) {
62
- return acc;
63
- }
64
- return acc.concat(new LockableRebaseable(rebaseable.step, rebaseable.inverted, rebaseable.origin));
65
- }, []);
66
- return filteredSteps;
67
42
  }
@@ -1,9 +1,9 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ import { NCS_STORAGE } from '@atlaskit/editor-common/ncs-step-metrics';
4
5
  import { StorageClient } from '@atlaskit/frontend-utilities';
5
- var STORAGE_CLIENT_KEY = 'ncs-step-metrics-storage';
6
- var storageClient = new StorageClient(STORAGE_CLIENT_KEY);
6
+ var storageClient = new StorageClient(NCS_STORAGE.NCS_STORAGE_CLIENT_KEY);
7
7
 
8
8
  /**
9
9
  * Gets the current step session metrics for a given session ID
@@ -16,9 +16,10 @@ var storageClient = new StorageClient(STORAGE_CLIENT_KEY);
16
16
  * @param steps - The steps to calculate the metrics from.
17
17
  * @returns The updated step session metrics for the given session ID.
18
18
  */
19
- export var getStepSessionMetrics = function getStepSessionMetrics(metrics, sessionId, steps) {
19
+ export var getNcsSessionStepMetrics = function getNcsSessionStepMetrics(metrics, sessionId, steps) {
20
20
  var _metrics$sessionId;
21
21
  var current = (_metrics$sessionId = metrics[sessionId]) !== null && _metrics$sessionId !== void 0 ? _metrics$sessionId : {
22
+ ncsSessionId: sessionId,
22
23
  totalStepSize: 0,
23
24
  numberOfSteps: 0,
24
25
  maxStepSize: 0,
@@ -44,10 +45,10 @@ export var getStepSessionMetrics = function getStepSessionMetrics(metrics, sessi
44
45
  * @param sessionId - The session ID to check or update in local storage.
45
46
  * @returns void
46
47
  */
47
- export var updateActiveSessions = function updateActiveSessions(sessionId) {
48
- var currentActiveSessions = JSON.parse(storageClient.getItem('ncsActiveSessions') || '{}');
48
+ export var updateNcsActiveSessions = function updateNcsActiveSessions(sessionId) {
49
+ var currentActiveSessions = JSON.parse(storageClient.getItem(NCS_STORAGE.NCS_ACTIVE_SESSIONS) || '{}');
49
50
  if (!currentActiveSessions[sessionId]) {
50
- storageClient.setItemWithExpiry('ncsActiveSessions', JSON.stringify(_objectSpread(_objectSpread({}, currentActiveSessions), {}, _defineProperty({}, sessionId, true))));
51
+ storageClient.setItemWithExpiry(NCS_STORAGE.NCS_ACTIVE_SESSIONS, JSON.stringify(_objectSpread(_objectSpread({}, currentActiveSessions), {}, _defineProperty({}, sessionId, true))));
51
52
  }
52
53
  };
53
54
  /**
@@ -58,7 +59,7 @@ export var updateActiveSessions = function updateActiveSessions(sessionId) {
58
59
  * @param steps - The steps to calculate the metrics from.
59
60
  * @return void
60
61
  */
61
- export var updateStepSessionMetrics = function updateStepSessionMetrics(_ref) {
62
+ export var updateNcsSessionStepMetrics = function updateNcsSessionStepMetrics(_ref) {
62
63
  var _api$collabEdit;
63
64
  var api = _ref.api,
64
65
  steps = _ref.steps;
@@ -66,8 +67,8 @@ export var updateStepSessionMetrics = function updateStepSessionMetrics(_ref) {
66
67
  if (!sessionId) {
67
68
  return;
68
69
  }
69
- var existingMetrics = JSON.parse(storageClient.getItem('ncsStepSessionMetrics') || '{}');
70
- var stepSessionMetrics = getStepSessionMetrics(existingMetrics, sessionId, steps);
71
- storageClient.setItemWithExpiry('ncsStepSessionMetrics', JSON.stringify(_objectSpread(_objectSpread({}, existingMetrics), {}, _defineProperty({}, sessionId, stepSessionMetrics))));
72
- updateActiveSessions(sessionId);
70
+ var existingMetrics = JSON.parse(storageClient.getItem(NCS_STORAGE.NCS_SESSION_STEP_METRICS) || '{}');
71
+ var ncsSessionStepMetrics = getNcsSessionStepMetrics(existingMetrics, sessionId, steps);
72
+ storageClient.setItemWithExpiry(NCS_STORAGE.NCS_SESSION_STEP_METRICS, JSON.stringify(_objectSpread(_objectSpread({}, existingMetrics), {}, _defineProperty({}, sessionId, ncsSessionStepMetrics))));
73
+ updateNcsActiveSessions(sessionId);
73
74
  };
@@ -6,7 +6,7 @@ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
6
6
  import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { sendableSteps } from '@atlaskit/prosemirror-collab';
9
- import { updateStepSessionMetrics } from './track-step-metrics';
9
+ import { updateNcsSessionStepMetrics } from './track-step-metrics';
10
10
  function groupBy(array, keyGetter) {
11
11
  // Check group by exists, and that it's a function. If so, use the native browser code
12
12
  if ('groupBy' in Object && typeof Object.groupBy === 'function') {
@@ -169,13 +169,13 @@ export var track = function track(_ref3) {
169
169
  endedAt: endedAt,
170
170
  steps: steps
171
171
  });
172
+ if (fg('platform_enable_ncs_step_metrics')) {
173
+ updateNcsSessionStepMetrics({
174
+ api: api,
175
+ steps: newSteps
176
+ });
177
+ }
172
178
  scheduler.postTask(function () {
173
- if (fg('platform_enable_ncs_step_metrics')) {
174
- updateStepSessionMetrics({
175
- api: api,
176
- steps: newSteps
177
- });
178
- }
179
179
  task(stepsSentCache, onTrackDataProcessed);
180
180
  }, {
181
181
  priority: 'background',
@@ -0,0 +1,9 @@
1
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
2
+ /**
3
+ * Filter out AnalyticsStep from the steps.
4
+ *
5
+ * @param steps Rebaseable steps
6
+ * @returns Rebaseable steps
7
+ * @example
8
+ */
9
+ export declare function filterAnalyticsSteps(steps: Rebaseable[]): Rebaseable[];
@@ -1,13 +1,6 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
3
- import type { Transform as ProseMirrorTransform } from '@atlaskit/editor-prosemirror/transform';
2
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
4
3
  import type { CollabEditPlugin } from '../collabEditPluginType';
5
- export declare class LockableRebaseable {
6
- readonly step: ProseMirrorStep;
7
- readonly inverted: ProseMirrorStep;
8
- readonly origin: ProseMirrorTransform;
9
- constructor(step: ProseMirrorStep, inverted: ProseMirrorStep, origin: ProseMirrorTransform);
10
- }
11
4
  /**
12
5
  * Merge a set of steps together to reduce the total number of steps stored in memory.
13
6
  *
@@ -18,12 +11,4 @@ export declare class LockableRebaseable {
18
11
  * @param steps Rebaseable steps
19
12
  * @returns Rebaseable steps
20
13
  */
21
- export declare function mergeUnconfirmedSteps(steps: LockableRebaseable[], api: ExtractInjectionAPI<CollabEditPlugin> | undefined): LockableRebaseable[];
22
- /**
23
- * Filter out AnalyticsStep from the steps.
24
- *
25
- * @param steps Rebaseable steps
26
- * @returns Rebaseable steps
27
- * @example
28
- */
29
- export declare function filterAnalyticsSteps(steps: LockableRebaseable[]): LockableRebaseable[];
14
+ export declare function mergeUnconfirmedSteps(steps: Rebaseable[], api: ExtractInjectionAPI<CollabEditPlugin> | undefined): Rebaseable[];
@@ -18,7 +18,7 @@ type StepSessionMetrics = {
18
18
  * @param steps - The steps to calculate the metrics from.
19
19
  * @returns The updated step session metrics for the given session ID.
20
20
  */
21
- export declare const getStepSessionMetrics: (metrics: {
21
+ export declare const getNcsSessionStepMetrics: (metrics: {
22
22
  [sessionId: string]: StepSessionMetrics;
23
23
  }, sessionId: string, steps: Step[]) => StepSessionMetrics;
24
24
  /**
@@ -31,8 +31,8 @@ export declare const getStepSessionMetrics: (metrics: {
31
31
  * @param sessionId - The session ID to check or update in local storage.
32
32
  * @returns void
33
33
  */
34
- export declare const updateActiveSessions: (sessionId: string) => void;
35
- type UpdateStepSessionMetricProps = {
34
+ export declare const updateNcsActiveSessions: (sessionId: string) => void;
35
+ type UpdateNcsSessionStepMetricProps = {
36
36
  api: ExtractInjectionAPI<CollabEditPlugin> | undefined;
37
37
  steps: Step[];
38
38
  };
@@ -44,5 +44,5 @@ type UpdateStepSessionMetricProps = {
44
44
  * @param steps - The steps to calculate the metrics from.
45
45
  * @return void
46
46
  */
47
- export declare const updateStepSessionMetrics: ({ api, steps }: UpdateStepSessionMetricProps) => void;
47
+ export declare const updateNcsSessionStepMetrics: ({ api, steps }: UpdateNcsSessionStepMetricProps) => void;
48
48
  export {};
@@ -0,0 +1,9 @@
1
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
2
+ /**
3
+ * Filter out AnalyticsStep from the steps.
4
+ *
5
+ * @param steps Rebaseable steps
6
+ * @returns Rebaseable steps
7
+ * @example
8
+ */
9
+ export declare function filterAnalyticsSteps(steps: Rebaseable[]): Rebaseable[];
@@ -1,13 +1,6 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
3
- import type { Transform as ProseMirrorTransform } from '@atlaskit/editor-prosemirror/transform';
2
+ import { Rebaseable } from '@atlaskit/prosemirror-collab';
4
3
  import type { CollabEditPlugin } from '../collabEditPluginType';
5
- export declare class LockableRebaseable {
6
- readonly step: ProseMirrorStep;
7
- readonly inverted: ProseMirrorStep;
8
- readonly origin: ProseMirrorTransform;
9
- constructor(step: ProseMirrorStep, inverted: ProseMirrorStep, origin: ProseMirrorTransform);
10
- }
11
4
  /**
12
5
  * Merge a set of steps together to reduce the total number of steps stored in memory.
13
6
  *
@@ -18,12 +11,4 @@ export declare class LockableRebaseable {
18
11
  * @param steps Rebaseable steps
19
12
  * @returns Rebaseable steps
20
13
  */
21
- export declare function mergeUnconfirmedSteps(steps: LockableRebaseable[], api: ExtractInjectionAPI<CollabEditPlugin> | undefined): LockableRebaseable[];
22
- /**
23
- * Filter out AnalyticsStep from the steps.
24
- *
25
- * @param steps Rebaseable steps
26
- * @returns Rebaseable steps
27
- * @example
28
- */
29
- export declare function filterAnalyticsSteps(steps: LockableRebaseable[]): LockableRebaseable[];
14
+ export declare function mergeUnconfirmedSteps(steps: Rebaseable[], api: ExtractInjectionAPI<CollabEditPlugin> | undefined): Rebaseable[];
@@ -18,7 +18,7 @@ type StepSessionMetrics = {
18
18
  * @param steps - The steps to calculate the metrics from.
19
19
  * @returns The updated step session metrics for the given session ID.
20
20
  */
21
- export declare const getStepSessionMetrics: (metrics: {
21
+ export declare const getNcsSessionStepMetrics: (metrics: {
22
22
  [sessionId: string]: StepSessionMetrics;
23
23
  }, sessionId: string, steps: Step[]) => StepSessionMetrics;
24
24
  /**
@@ -31,8 +31,8 @@ export declare const getStepSessionMetrics: (metrics: {
31
31
  * @param sessionId - The session ID to check or update in local storage.
32
32
  * @returns void
33
33
  */
34
- export declare const updateActiveSessions: (sessionId: string) => void;
35
- type UpdateStepSessionMetricProps = {
34
+ export declare const updateNcsActiveSessions: (sessionId: string) => void;
35
+ type UpdateNcsSessionStepMetricProps = {
36
36
  api: ExtractInjectionAPI<CollabEditPlugin> | undefined;
37
37
  steps: Step[];
38
38
  };
@@ -44,5 +44,5 @@ type UpdateStepSessionMetricProps = {
44
44
  * @param steps - The steps to calculate the metrics from.
45
45
  * @return void
46
46
  */
47
- export declare const updateStepSessionMetrics: ({ api, steps }: UpdateStepSessionMetricProps) => void;
47
+ export declare const updateNcsSessionStepMetrics: ({ api, steps }: UpdateNcsSessionStepMetricProps) => void;
48
48
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "3.9.1",
3
+ "version": "3.9.3",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^47.6.0",
35
35
  "@atlaskit/custom-steps": "^0.11.0",
36
- "@atlaskit/editor-common": "^106.1.0",
36
+ "@atlaskit/editor-common": "^106.5.0",
37
37
  "@atlaskit/editor-json-transformer": "^8.24.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
39
39
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/frontend-utilities": "^3.0.0",
45
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
46
  "@atlaskit/prosemirror-collab": "^0.17.0",
47
- "@atlaskit/tmp-editor-statsig": "^5.5.0",
47
+ "@atlaskit/tmp-editor-statsig": "^6.0.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "memoize-one": "^6.0.0"
50
50
  },