@atlaskit/editor-plugin-collab-edit 3.9.4 → 3.9.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-collab-edit
2
2
 
3
+ ## 3.9.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#171054](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/171054)
8
+ [`46a532280fd7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/46a532280fd7c) -
9
+ Filter out AnalyticsSteps from metric
10
+ - [#169039](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/169039)
11
+ [`d2488752fcad8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d2488752fcad8) -
12
+ EDITOR-508 Part 1 of cleaning up `platform_editor_use_nested_table_pm_nodes`
13
+ - Updated dependencies
14
+
3
15
  ## 3.9.4
4
16
 
5
17
  ### Patch Changes
@@ -10,6 +10,7 @@ var _steps = require("@atlaskit/adf-schema/steps");
10
10
  var _transform = require("@atlaskit/editor-prosemirror/transform");
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
12
  var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
13
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
14
  var _trackStepMetrics = require("./track-step-metrics");
14
15
  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
16
  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; } }
@@ -179,7 +180,9 @@ var track = exports.track = function track(_ref3) {
179
180
  if ((0, _platformFeatureFlags.fg)('platform_enable_ncs_step_metrics')) {
180
181
  (0, _trackStepMetrics.updateNcsSessionStepMetrics)({
181
182
  api: api,
182
- steps: newSteps
183
+ steps: (0, _experiments.editorExperiment)('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(function (step) {
184
+ return !(step instanceof _steps.AnalyticsStep);
185
+ }) : newSteps
183
186
  });
184
187
  }
185
188
  scheduler.postTask(function () {
@@ -121,20 +121,9 @@ var createTelepointers = exports.createTelepointers = function createTelepointer
121
121
  var replaceDocument = exports.replaceDocument = function replaceDocument(doc, state, version, options, reserveCursor, editorAnalyticsAPI) {
122
122
  var schema = state.schema,
123
123
  tr = state.tr;
124
- var hasContent;
125
- var content;
126
- if ((0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes')) {
127
- var parsedDoc = (0, _processRawValue.processRawValueWithoutValidation)(schema, doc, editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.fireAnalyticsEvent);
128
- hasContent = !!(parsedDoc !== null && parsedDoc !== void 0 && parsedDoc.childCount);
129
- content = parsedDoc === null || parsedDoc === void 0 ? void 0 : parsedDoc.content;
130
- } else {
131
- // Ignored via go/ees005
132
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
- content = (doc.content || []).map(function (child) {
134
- return schema.nodeFromJSON(child);
135
- });
136
- hasContent = Array.isArray(content) && !!content.length;
137
- }
124
+ var parsedDoc = (0, _processRawValue.processRawValueWithoutValidation)(schema, doc, editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.fireAnalyticsEvent);
125
+ var hasContent = !!(parsedDoc !== null && parsedDoc !== void 0 && parsedDoc.childCount);
126
+ var content = parsedDoc === null || parsedDoc === void 0 ? void 0 : parsedDoc.content;
138
127
  if (hasContent) {
139
128
  tr.setMeta('addToHistory', false);
140
129
  // Ignored via go/ees005
@@ -1,7 +1,8 @@
1
- import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
1
+ import { AnalyticsStep, 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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
6
  import { updateNcsSessionStepMetrics } from './track-step-metrics';
6
7
  function groupBy(array, keyGetter) {
7
8
  // Check group by exists, and that it's a function. If so, use the native browser code
@@ -157,7 +158,7 @@ export const track = ({
157
158
  if (fg('platform_enable_ncs_step_metrics')) {
158
159
  updateNcsSessionStepMetrics({
159
160
  api,
160
- steps: newSteps
161
+ steps: editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(step => !(step instanceof AnalyticsStep)) : newSteps
161
162
  });
162
163
  }
163
164
  scheduler.postTask(() => {
@@ -105,18 +105,9 @@ export const replaceDocument = (doc, state, version, options, reserveCursor, edi
105
105
  schema,
106
106
  tr
107
107
  } = state;
108
- let hasContent;
109
- let content;
110
- if (fg('platform_editor_use_nested_table_pm_nodes')) {
111
- const parsedDoc = processRawValueWithoutValidation(schema, doc, editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.fireAnalyticsEvent);
112
- hasContent = !!(parsedDoc !== null && parsedDoc !== void 0 && parsedDoc.childCount);
113
- content = parsedDoc === null || parsedDoc === void 0 ? void 0 : parsedDoc.content;
114
- } else {
115
- // Ignored via go/ees005
116
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
117
- content = (doc.content || []).map(child => schema.nodeFromJSON(child));
118
- hasContent = Array.isArray(content) && !!content.length;
119
- }
108
+ const parsedDoc = processRawValueWithoutValidation(schema, doc, editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.fireAnalyticsEvent);
109
+ const hasContent = !!(parsedDoc !== null && parsedDoc !== void 0 && parsedDoc.childCount);
110
+ const content = parsedDoc === null || parsedDoc === void 0 ? void 0 : parsedDoc.content;
120
111
  if (hasContent) {
121
112
  tr.setMeta('addToHistory', false);
122
113
  // Ignored via go/ees005
@@ -2,10 +2,11 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  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; } } }; }
3
3
  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; } }
4
4
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
- import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
5
+ import { AnalyticsStep, 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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
10
  import { updateNcsSessionStepMetrics } from './track-step-metrics';
10
11
  function groupBy(array, keyGetter) {
11
12
  // Check group by exists, and that it's a function. If so, use the native browser code
@@ -172,7 +173,9 @@ export var track = function track(_ref3) {
172
173
  if (fg('platform_enable_ncs_step_metrics')) {
173
174
  updateNcsSessionStepMetrics({
174
175
  api: api,
175
- steps: newSteps
176
+ steps: editorExperiment('platform_editor_reduce_noisy_steps_ncs', true) ? newSteps.filter(function (step) {
177
+ return !(step instanceof AnalyticsStep);
178
+ }) : newSteps
176
179
  });
177
180
  }
178
181
  scheduler.postTask(function () {
@@ -112,20 +112,9 @@ export var createTelepointers = function createTelepointers(from, to, sessionId,
112
112
  export var replaceDocument = function replaceDocument(doc, state, version, options, reserveCursor, editorAnalyticsAPI) {
113
113
  var schema = state.schema,
114
114
  tr = state.tr;
115
- var hasContent;
116
- var content;
117
- if (fg('platform_editor_use_nested_table_pm_nodes')) {
118
- var parsedDoc = processRawValueWithoutValidation(schema, doc, editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.fireAnalyticsEvent);
119
- hasContent = !!(parsedDoc !== null && parsedDoc !== void 0 && parsedDoc.childCount);
120
- content = parsedDoc === null || parsedDoc === void 0 ? void 0 : parsedDoc.content;
121
- } else {
122
- // Ignored via go/ees005
123
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
124
- content = (doc.content || []).map(function (child) {
125
- return schema.nodeFromJSON(child);
126
- });
127
- hasContent = Array.isArray(content) && !!content.length;
128
- }
115
+ var parsedDoc = processRawValueWithoutValidation(schema, doc, editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.fireAnalyticsEvent);
116
+ var hasContent = !!(parsedDoc !== null && parsedDoc !== void 0 && parsedDoc.childCount);
117
+ var content = parsedDoc === null || parsedDoc === void 0 ? void 0 : parsedDoc.content;
129
118
  if (hasContent) {
130
119
  tr.setMeta('addToHistory', false);
131
120
  // Ignored via go/ees005
@@ -1,6 +1,6 @@
1
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
3
- import { CollabEditPlugin } from '../collabEditPluginType';
3
+ import type { CollabEditPlugin } from '../collabEditPluginType';
4
4
  type StepSessionMetrics = {
5
5
  totalStepSize: number;
6
6
  numberOfSteps: number;
@@ -1,7 +1,7 @@
1
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
4
- import { CollabEditPlugin } from '../collabEditPluginType';
4
+ import type { CollabEditPlugin } from '../collabEditPluginType';
5
5
  export type SanitizedStep = {
6
6
  stepType: string;
7
7
  attr?: string;
@@ -1,6 +1,6 @@
1
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
3
- import { CollabEditPlugin } from '../collabEditPluginType';
3
+ import type { CollabEditPlugin } from '../collabEditPluginType';
4
4
  type StepSessionMetrics = {
5
5
  totalStepSize: number;
6
6
  numberOfSteps: number;
@@ -1,7 +1,7 @@
1
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
4
- import { CollabEditPlugin } from '../collabEditPluginType';
4
+ import type { CollabEditPlugin } from '../collabEditPluginType';
5
5
  export type SanitizedStep = {
6
6
  stepType: string;
7
7
  attr?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "3.9.4",
3
+ "version": "3.9.5",
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.6.0",
36
+ "@atlaskit/editor-common": "^106.7.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",
@@ -56,7 +56,7 @@
56
56
  "@af/integration-testing": "workspace:^",
57
57
  "@af/visual-regression": "workspace:^",
58
58
  "@atlaskit/editor-plugin-mentions": "^4.7.0",
59
- "@atlaskit/editor-plugin-text-formatting": "^2.2.0",
59
+ "@atlaskit/editor-plugin-text-formatting": "^2.3.0",
60
60
  "@atlaskit/editor-plugin-type-ahead": "^2.7.0",
61
61
  "@atlaskit/editor-plugin-unsupported-content": "^2.1.0",
62
62
  "@atlaskit/editor-test-helpers": "workspace:^",
@@ -105,9 +105,6 @@
105
105
  }
106
106
  },
107
107
  "platform-feature-flags": {
108
- "platform_editor_use_nested_table_pm_nodes": {
109
- "type": "boolean"
110
- },
111
108
  "platform_editor_selection_without_left_shift": {
112
109
  "type": "boolean"
113
110
  },