@atlaskit/editor-plugin-collab-edit 7.1.10 → 7.2.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,19 @@
1
1
  # @atlaskit/editor-plugin-collab-edit
2
2
 
3
+ ## 7.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c6d3be25ea8e1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6d3be25ea8e1) -
8
+ Export LastOrganicChangeMetadata
9
+
10
+ ## 7.1.11
11
+
12
+ ### Patch Changes
13
+
14
+ - [`60f37549e619c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/60f37549e619c) -
15
+ Added exclusion list to batchattrs update
16
+
3
17
  ## 7.1.10
4
18
 
5
19
  ### Patch Changes
@@ -223,8 +223,8 @@ var isOrganicChange = exports.isOrganicChange = function isOrganicChange(tr) {
223
223
  return Object.keys(data.attrs);
224
224
  }).flat();
225
225
  return _allAttributes.some(function (attr) {
226
- return attr !== 'localId';
227
- });
226
+ return !blockedAttrsList.includes(attr);
227
+ }) && !tr.doc.eq(tr.before);
228
228
  }
229
229
 
230
230
  // If a step is not an instance of SetAttrsStep, it is considered organic
@@ -236,9 +236,7 @@ var isOrganicChange = exports.isOrganicChange = function isOrganicChange(tr) {
236
236
  // are not in the `blockedAttributes`. If one of the attributes not on the list, it considers the change
237
237
  // organic but only if the entire document is not equal to the previous state.
238
238
  return allAttributes.some(function (attr) {
239
- if (!blockedAttrsList.includes(attr)) {
240
- return true;
241
- }
239
+ return !blockedAttrsList.includes(attr);
242
240
  }) && !tr.doc.eq(tr.before);
243
241
  });
244
242
  };
@@ -208,7 +208,7 @@ export const isOrganicChange = tr => {
208
208
  // editor-plugin-local-id uses BatchAttrStep to set the localId attribute
209
209
  if (step instanceof BatchAttrsStep && fg('platform_editor_inorganic_batchattrsstep_localid')) {
210
210
  const allAttributes = step.data.map(data => Object.keys(data.attrs)).flat();
211
- return allAttributes.some(attr => attr !== 'localId');
211
+ return allAttributes.some(attr => !blockedAttrsList.includes(attr)) && !tr.doc.eq(tr.before);
212
212
  }
213
213
 
214
214
  // If a step is not an instance of SetAttrsStep, it is considered organic
@@ -219,11 +219,7 @@ export const isOrganicChange = tr => {
219
219
  // If a step is an instance of SetAttrsStep, it checks if the attributes in the step
220
220
  // are not in the `blockedAttributes`. If one of the attributes not on the list, it considers the change
221
221
  // organic but only if the entire document is not equal to the previous state.
222
- return allAttributes.some(attr => {
223
- if (!blockedAttrsList.includes(attr)) {
224
- return true;
225
- }
226
- }) && !tr.doc.eq(tr.before);
222
+ return allAttributes.some(attr => !blockedAttrsList.includes(attr)) && !tr.doc.eq(tr.before);
227
223
  });
228
224
  };
229
225
 
@@ -215,8 +215,8 @@ export var isOrganicChange = function isOrganicChange(tr) {
215
215
  return Object.keys(data.attrs);
216
216
  }).flat();
217
217
  return _allAttributes.some(function (attr) {
218
- return attr !== 'localId';
219
- });
218
+ return !blockedAttrsList.includes(attr);
219
+ }) && !tr.doc.eq(tr.before);
220
220
  }
221
221
 
222
222
  // If a step is not an instance of SetAttrsStep, it is considered organic
@@ -228,9 +228,7 @@ export var isOrganicChange = function isOrganicChange(tr) {
228
228
  // are not in the `blockedAttributes`. If one of the attributes not on the list, it considers the change
229
229
  // organic but only if the entire document is not equal to the previous state.
230
230
  return allAttributes.some(function (attr) {
231
- if (!blockedAttrsList.includes(attr)) {
232
- return true;
233
- }
231
+ return !blockedAttrsList.includes(attr);
234
232
  }) && !tr.doc.eq(tr.before);
235
233
  });
236
234
  };
@@ -1,3 +1,3 @@
1
1
  export { collabEditPlugin } from './collabEditPlugin';
2
2
  export type { CollabEditPlugin, CollabEditPluginOptions, CollabEditPluginDependencies, } from './collabEditPluginType';
3
- export type { CollabInitializedMetadata, CollabEditPluginSharedState, ReadOnlyParticipants, PrivateCollabEditOptions, CollabSendableSteps, } from './types';
3
+ export type { CollabInitializedMetadata, LastOrganicChangeMetadata, CollabEditPluginSharedState, ReadOnlyParticipants, PrivateCollabEditOptions, CollabSendableSteps, } from './types';
@@ -1,3 +1,3 @@
1
1
  export { collabEditPlugin } from './collabEditPlugin';
2
2
  export type { CollabEditPlugin, CollabEditPluginOptions, CollabEditPluginDependencies, } from './collabEditPluginType';
3
- export type { CollabInitializedMetadata, CollabEditPluginSharedState, ReadOnlyParticipants, PrivateCollabEditOptions, CollabSendableSteps, } from './types';
3
+ export type { CollabInitializedMetadata, LastOrganicChangeMetadata, CollabEditPluginSharedState, ReadOnlyParticipants, PrivateCollabEditOptions, CollabSendableSteps, } from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-collab-edit",
3
- "version": "7.1.10",
3
+ "version": "7.2.0",
4
4
  "description": "Collab Edit plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,12 +39,12 @@
39
39
  "@atlaskit/frontend-utilities": "^3.2.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
41
  "@atlaskit/prosemirror-collab": "^0.22.0",
42
- "@atlaskit/tmp-editor-statsig": "^15.10.0",
42
+ "@atlaskit/tmp-editor-statsig": "^15.11.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "memoize-one": "^6.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "@atlaskit/editor-common": "^110.42.0",
47
+ "@atlaskit/editor-common": "^110.44.0",
48
48
  "react": "^18.2.0",
49
49
  "react-dom": "^18.2.0"
50
50
  },