@atlaskit/editor-plugin-collab-edit 1.8.7 → 1.10.0

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,25 @@
1
1
  # @atlaskit/editor-plugin-collab-edit
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#122895](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122895)
8
+ [`49b8c7658f3b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/49b8c7658f3b5) -
9
+ [ED-24173] bump @atlaskit/adf-schema to 40.3.0 and @atlassian/adf-schema-json to 1.18.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.9.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#121784](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121784)
20
+ [`af7f2ef6f68ab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/af7f2ef6f68ab) -
21
+ Improved steps analytics
22
+
3
23
  ## 1.8.7
4
24
 
5
25
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.track = exports.task = exports.sanitizeStep = exports.groupSteps = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _steps = require("@atlaskit/adf-schema/steps");
9
10
  var _transform = require("@atlaskit/editor-prosemirror/transform");
10
11
  var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
11
12
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
@@ -50,6 +51,9 @@ var sanitizeStep = exports.sanitizeStep = function sanitizeStep(step) {
50
51
  };
51
52
  if (step instanceof _transform.AttrStep || step instanceof _transform.DocAttrStep) {
52
53
  sanitizedStep.attr = step.attr;
54
+ } else if (step instanceof _steps.SetAttrsStep) {
55
+ // Combines all attrs keys separated by _ to one single string
56
+ sanitizedStep.attr = Object.keys(step.attrs).sort().join('_');
53
57
  } else if (step instanceof _transform.AddMarkStep || step instanceof _transform.RemoveMarkStep || step instanceof _transform.RemoveNodeMarkStep || step instanceof _transform.AddNodeMarkStep) {
54
58
  sanitizedStep.markType = step.mark.type.name;
55
59
  }
@@ -1,3 +1,4 @@
1
+ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
1
2
  import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
2
3
  import { sendableSteps } from '@atlaskit/prosemirror-collab';
3
4
  function groupBy(array, keyGetter) {
@@ -39,6 +40,9 @@ export const sanitizeStep = step => {
39
40
  };
40
41
  if (step instanceof AttrStep || step instanceof DocAttrStep) {
41
42
  sanitizedStep.attr = step.attr;
43
+ } else if (step instanceof SetAttrsStep) {
44
+ // Combines all attrs keys separated by _ to one single string
45
+ sanitizedStep.attr = Object.keys(step.attrs).sort().join('_');
42
46
  } else if (step instanceof AddMarkStep || step instanceof RemoveMarkStep || step instanceof RemoveNodeMarkStep || step instanceof AddNodeMarkStep) {
43
47
  sanitizedStep.markType = step.mark.type.name;
44
48
  }
@@ -2,6 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
5
6
  import { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, RemoveMarkStep, RemoveNodeMarkStep } from '@atlaskit/editor-prosemirror/transform';
6
7
  import { sendableSteps } from '@atlaskit/prosemirror-collab';
7
8
  function groupBy(array, keyGetter) {
@@ -43,6 +44,9 @@ export var sanitizeStep = function sanitizeStep(step) {
43
44
  };
44
45
  if (step instanceof AttrStep || step instanceof DocAttrStep) {
45
46
  sanitizedStep.attr = step.attr;
47
+ } else if (step instanceof SetAttrsStep) {
48
+ // Combines all attrs keys separated by _ to one single string
49
+ sanitizedStep.attr = Object.keys(step.attrs).sort().join('_');
46
50
  } else if (step instanceof AddMarkStep || step instanceof RemoveMarkStep || step instanceof RemoveNodeMarkStep || step instanceof AddNodeMarkStep) {
47
51
  sanitizedStep.markType = step.mark.type.name;
48
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "1.8.7",
3
+ "version": "1.10.0",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,16 +32,16 @@
32
32
  ".": "./src/index.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^39.0.3",
36
- "@atlaskit/custom-steps": "^0.4.0",
37
- "@atlaskit/editor-common": "^86.0.0",
38
- "@atlaskit/editor-plugin-analytics": "1.4.4",
35
+ "@atlaskit/adf-schema": "^40.3.0",
36
+ "@atlaskit/custom-steps": "^0.5.0",
37
+ "@atlaskit/editor-common": "^86.7.0",
38
+ "@atlaskit/editor-plugin-analytics": "1.5.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^2.0.0",
40
40
  "@atlaskit/editor-plugin-feature-flags": "^1.1.0",
41
41
  "@atlaskit/editor-prosemirror": "4.0.1",
42
42
  "@atlaskit/editor-shared-styles": "^2.13.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
- "@atlaskit/prosemirror-collab": "^0.6.0",
44
+ "@atlaskit/prosemirror-collab": "^0.7.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "memoize-one": "^6.0.0"
47
47
  },
@@ -51,11 +51,11 @@
51
51
  "devDependencies": {
52
52
  "@af/integration-testing": "*",
53
53
  "@af/visual-regression": "*",
54
- "@atlaskit/editor-plugin-mentions": "^2.0.0",
55
- "@atlaskit/editor-plugin-text-formatting": "^1.9.0",
56
- "@atlaskit/editor-plugin-type-ahead": "^1.4.0",
57
- "@atlaskit/editor-plugin-unsupported-content": "^1.5.0",
58
- "@atlaskit/editor-test-helpers": "^18.26.0",
54
+ "@atlaskit/editor-plugin-mentions": "^2.1.0",
55
+ "@atlaskit/editor-plugin-text-formatting": "^1.10.0",
56
+ "@atlaskit/editor-plugin-type-ahead": "^1.5.0",
57
+ "@atlaskit/editor-plugin-unsupported-content": "^1.6.0",
58
+ "@atlaskit/editor-test-helpers": "^18.27.0",
59
59
  "@atlaskit/ssr": "*",
60
60
  "@atlaskit/synchrony-test-helpers": "^2.4.0",
61
61
  "@atlaskit/util-data-test": "^17.9.0",