@atlaskit/editor-plugin-collab-edit 1.1.0 → 1.1.2

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,18 @@
1
1
  # @atlaskit/editor-plugin-collab-edit
2
2
 
3
+ ## 1.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224) [`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) - ED-22219: adf-schema updated to 35.5.2
8
+ - Updated dependencies
9
+
10
+ ## 1.1.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [#74185](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74185) [`bdf01577a3b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bdf01577a3b3) - Exclude remote changes from firstContentBodyChange field
15
+
3
16
  ## 1.1.0
4
17
 
5
18
  ### Minor Changes
@@ -34,7 +34,8 @@ var createPlugin = exports.createPlugin = function createPlugin() {
34
34
  if (!shouldCheckDocument) {
35
35
  return prevPluginState;
36
36
  }
37
- var isDocumentReplaceFromRemote = Boolean(transaction.getMeta('isRemote')) && Boolean(transaction.getMeta('replaceDocument'));
37
+ var isRemote = Boolean(transaction.getMeta('isRemote'));
38
+ var isDocumentReplaceFromRemote = isRemote && Boolean(transaction.getMeta('replaceDocument'));
38
39
  if (isDocumentReplaceFromRemote) {
39
40
  return prevPluginState;
40
41
  }
@@ -44,6 +45,7 @@ var createPlugin = exports.createPlugin = function createPlugin() {
44
45
  if (transaction.docChanged && !transaction.doc.eq(oldState.doc)) {
45
46
  // For analytics purposes, inline comment annotations are not considered as edits to the document body
46
47
  // Transaction may contain other steps, but we know that they won't be user-generated (non synthetic) steps
48
+ // Additionally, for analytics purposes we do not want to trigger on other participants' changes (i.e. remote changes)
47
49
  var isAnnotationStep = !!transaction.steps.find(function (step) {
48
50
  var _step$mark;
49
51
  return step instanceof _transform.AddMarkStep && ((_step$mark = step.mark) === null || _step$mark === void 0 || (_step$mark = _step$mark.type) === null || _step$mark === void 0 ? void 0 : _step$mark.name) === 'annotation';
@@ -51,7 +53,7 @@ var createPlugin = exports.createPlugin = function createPlugin() {
51
53
  return {
52
54
  collabInitialisedAt: prevPluginState.collabInitialisedAt,
53
55
  firstChangeAfterInitAt: Date.now(),
54
- firstContentBodyChangeAfterInitAt: !isAnnotationStep ? Date.now() : prevPluginState.firstContentBodyChangeAfterInitAt
56
+ firstContentBodyChangeAfterInitAt: isAnnotationStep || isRemote ? prevPluginState.firstContentBodyChangeAfterInitAt : Date.now()
55
57
  };
56
58
  }
57
59
  return prevPluginState;
@@ -26,7 +26,8 @@ export const createPlugin = () => {
26
26
  if (!shouldCheckDocument) {
27
27
  return prevPluginState;
28
28
  }
29
- const isDocumentReplaceFromRemote = Boolean(transaction.getMeta('isRemote')) && Boolean(transaction.getMeta('replaceDocument'));
29
+ const isRemote = Boolean(transaction.getMeta('isRemote'));
30
+ const isDocumentReplaceFromRemote = isRemote && Boolean(transaction.getMeta('replaceDocument'));
30
31
  if (isDocumentReplaceFromRemote) {
31
32
  return prevPluginState;
32
33
  }
@@ -36,6 +37,7 @@ export const createPlugin = () => {
36
37
  if (transaction.docChanged && !transaction.doc.eq(oldState.doc)) {
37
38
  // For analytics purposes, inline comment annotations are not considered as edits to the document body
38
39
  // Transaction may contain other steps, but we know that they won't be user-generated (non synthetic) steps
40
+ // Additionally, for analytics purposes we do not want to trigger on other participants' changes (i.e. remote changes)
39
41
  const isAnnotationStep = !!transaction.steps.find(step => {
40
42
  var _step$mark, _step$mark$type;
41
43
  return step instanceof AddMarkStep && ((_step$mark = step.mark) === null || _step$mark === void 0 ? void 0 : (_step$mark$type = _step$mark.type) === null || _step$mark$type === void 0 ? void 0 : _step$mark$type.name) === 'annotation';
@@ -43,7 +45,7 @@ export const createPlugin = () => {
43
45
  return {
44
46
  collabInitialisedAt: prevPluginState.collabInitialisedAt,
45
47
  firstChangeAfterInitAt: Date.now(),
46
- firstContentBodyChangeAfterInitAt: !isAnnotationStep ? Date.now() : prevPluginState.firstContentBodyChangeAfterInitAt
48
+ firstContentBodyChangeAfterInitAt: isAnnotationStep || isRemote ? prevPluginState.firstContentBodyChangeAfterInitAt : Date.now()
47
49
  };
48
50
  }
49
51
  return prevPluginState;
@@ -27,7 +27,8 @@ export var createPlugin = function createPlugin() {
27
27
  if (!shouldCheckDocument) {
28
28
  return prevPluginState;
29
29
  }
30
- var isDocumentReplaceFromRemote = Boolean(transaction.getMeta('isRemote')) && Boolean(transaction.getMeta('replaceDocument'));
30
+ var isRemote = Boolean(transaction.getMeta('isRemote'));
31
+ var isDocumentReplaceFromRemote = isRemote && Boolean(transaction.getMeta('replaceDocument'));
31
32
  if (isDocumentReplaceFromRemote) {
32
33
  return prevPluginState;
33
34
  }
@@ -37,6 +38,7 @@ export var createPlugin = function createPlugin() {
37
38
  if (transaction.docChanged && !transaction.doc.eq(oldState.doc)) {
38
39
  // For analytics purposes, inline comment annotations are not considered as edits to the document body
39
40
  // Transaction may contain other steps, but we know that they won't be user-generated (non synthetic) steps
41
+ // Additionally, for analytics purposes we do not want to trigger on other participants' changes (i.e. remote changes)
40
42
  var isAnnotationStep = !!transaction.steps.find(function (step) {
41
43
  var _step$mark;
42
44
  return step instanceof AddMarkStep && ((_step$mark = step.mark) === null || _step$mark === void 0 || (_step$mark = _step$mark.type) === null || _step$mark === void 0 ? void 0 : _step$mark.name) === 'annotation';
@@ -44,7 +46,7 @@ export var createPlugin = function createPlugin() {
44
46
  return {
45
47
  collabInitialisedAt: prevPluginState.collabInitialisedAt,
46
48
  firstChangeAfterInitAt: Date.now(),
47
- firstContentBodyChangeAfterInitAt: !isAnnotationStep ? Date.now() : prevPluginState.firstContentBodyChangeAfterInitAt
49
+ firstContentBodyChangeAfterInitAt: isAnnotationStep || isRemote ? prevPluginState.firstContentBodyChangeAfterInitAt : Date.now()
48
50
  };
49
51
  }
50
52
  return prevPluginState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,8 +32,8 @@
32
32
  ".": "./src/index.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/editor-common": "^78.1.0",
36
- "@atlaskit/editor-plugin-analytics": "1.0.2",
35
+ "@atlaskit/editor-common": "^78.10.0",
36
+ "@atlaskit/editor-plugin-analytics": "1.0.3",
37
37
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
38
38
  "@atlaskit/editor-prosemirror": "3.0.0",
39
39
  "@atlaskit/prosemirror-collab": "^0.2.0",
@@ -46,9 +46,9 @@
46
46
  "devDependencies": {
47
47
  "@af/integration-testing": "*",
48
48
  "@af/visual-regression": "*",
49
- "@atlaskit/adf-schema": "^35.5.1",
49
+ "@atlaskit/adf-schema": "^35.5.2",
50
50
  "@atlaskit/editor-plugin-mentions": "^1.0.0",
51
- "@atlaskit/editor-plugin-text-formatting": "^1.0.0",
51
+ "@atlaskit/editor-plugin-text-formatting": "^1.2.0",
52
52
  "@atlaskit/editor-plugin-type-ahead": "^1.0.0",
53
53
  "@atlaskit/editor-plugin-unsupported-content": "^1.0.0",
54
54
  "@atlaskit/editor-test-helpers": "^18.18.0",