@atlaskit/collab-provider 10.8.0 → 10.8.1

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,13 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 10.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#120905](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120905)
8
+ [`4194ea903d7d6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4194ea903d7d6) -
9
+ Refactor step merging while offline.
10
+
3
11
  ## 10.8.0
4
12
 
5
13
  ### Minor Changes
@@ -13,6 +13,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
14
  var _const = require("../helpers/const");
15
15
  var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
16
+ var _state = require("@atlaskit/editor-prosemirror/state");
16
17
  var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
17
18
  var _throttle = _interopRequireDefault(require("lodash/throttle"));
18
19
  var _performance = require("../analytics/performance");
@@ -935,10 +936,9 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
935
936
  // we need to lock them to ensure they don't get
936
937
  // mutated in: `packages/editor/editor-plugin-collab-edit/src/pm-plugins/mergeUnconfirmed.ts`
937
938
  if ((0, _platformFeatureFlags.fg)('platform_editor_merge_unconfirmed_steps')) {
938
- unconfirmedStepsData.steps.forEach(function (s) {
939
- if (isLockable(s)) {
940
- var _s$lockStep;
941
- (_s$lockStep = s.lockStep) === null || _s$lockStep === void 0 || _s$lockStep.call(s);
939
+ unconfirmedStepsData.origins.forEach(function (origin) {
940
+ if (origin instanceof _state.Transaction) {
941
+ return origin.setMeta('mergeIsLocked', true);
942
942
  }
943
943
  });
944
944
  }
@@ -967,7 +967,4 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
967
967
  });
968
968
  }
969
969
  }]);
970
- }(); // Based on: packages/editor/editor-plugin-collab-edit/src/pm-plugins/mergeUnconfirmed.ts
971
- function isLockable(step) {
972
- return (step === null || step === void 0 ? void 0 : step.lockStep) !== undefined;
973
- }
970
+ }();
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/collab-provider";
8
- var version = exports.version = "10.8.0";
8
+ var version = exports.version = "10.8.1";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { ACK_MAX_TRY, EVENT_ACTION, EVENT_STATUS, CatchupEventReason } from '../helpers/const';
4
4
  import { getCollabState, sendableSteps } from '@atlaskit/prosemirror-collab';
5
+ import { Transaction } from '@atlaskit/editor-prosemirror/state';
5
6
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
6
7
  import throttle from 'lodash/throttle';
7
8
  import { MEASURE_NAME, startMeasure, stopMeasure } from '../analytics/performance';
@@ -806,10 +807,9 @@ export class DocumentService {
806
807
  // we need to lock them to ensure they don't get
807
808
  // mutated in: `packages/editor/editor-plugin-collab-edit/src/pm-plugins/mergeUnconfirmed.ts`
808
809
  if (fg('platform_editor_merge_unconfirmed_steps')) {
809
- unconfirmedStepsData.steps.forEach(s => {
810
- if (isLockable(s)) {
811
- var _s$lockStep;
812
- (_s$lockStep = s.lockStep) === null || _s$lockStep === void 0 ? void 0 : _s$lockStep.call(s);
810
+ unconfirmedStepsData.origins.forEach(origin => {
811
+ if (origin instanceof Transaction) {
812
+ return origin.setMeta('mergeIsLocked', true);
813
813
  }
814
814
  });
815
815
  }
@@ -837,10 +837,4 @@ export class DocumentService {
837
837
  forcePublish
838
838
  });
839
839
  }
840
- }
841
-
842
- // Based on: packages/editor/editor-plugin-collab-edit/src/pm-plugins/mergeUnconfirmed.ts
843
-
844
- function isLockable(step) {
845
- return (step === null || step === void 0 ? void 0 : step.lockStep) !== undefined;
846
840
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "10.8.0";
2
+ export const version = "10.8.1";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -8,6 +8,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { ACK_MAX_TRY, EVENT_ACTION, EVENT_STATUS, CatchupEventReason } from '../helpers/const';
10
10
  import { getCollabState, sendableSteps } from '@atlaskit/prosemirror-collab';
11
+ import { Transaction } from '@atlaskit/editor-prosemirror/state';
11
12
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
12
13
  import throttle from 'lodash/throttle';
13
14
  import { MEASURE_NAME, startMeasure, stopMeasure } from '../analytics/performance';
@@ -928,10 +929,9 @@ export var DocumentService = /*#__PURE__*/function () {
928
929
  // we need to lock them to ensure they don't get
929
930
  // mutated in: `packages/editor/editor-plugin-collab-edit/src/pm-plugins/mergeUnconfirmed.ts`
930
931
  if (fg('platform_editor_merge_unconfirmed_steps')) {
931
- unconfirmedStepsData.steps.forEach(function (s) {
932
- if (isLockable(s)) {
933
- var _s$lockStep;
934
- (_s$lockStep = s.lockStep) === null || _s$lockStep === void 0 || _s$lockStep.call(s);
932
+ unconfirmedStepsData.origins.forEach(function (origin) {
933
+ if (origin instanceof Transaction) {
934
+ return origin.setMeta('mergeIsLocked', true);
935
935
  }
936
936
  });
937
937
  }
@@ -960,10 +960,4 @@ export var DocumentService = /*#__PURE__*/function () {
960
960
  });
961
961
  }
962
962
  }]);
963
- }();
964
-
965
- // Based on: packages/editor/editor-plugin-collab-edit/src/pm-plugins/mergeUnconfirmed.ts
966
-
967
- function isLockable(step) {
968
- return (step === null || step === void 0 ? void 0 : step.lockStep) !== undefined;
969
- }
963
+ }();
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "10.8.0";
2
+ export var version = "10.8.1";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -4,7 +4,8 @@ import type AnalyticsHelper from '../analytics/analytics-helper';
4
4
  import { CatchupEventReason } from '../helpers/const';
5
5
  import type { MetadataService } from '../metadata/metadata-service';
6
6
  import type { Catchupv2Response, ChannelEvent, ReconcileResponse, ReconnectionMetadata, StepsPayload } from '../types';
7
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
7
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
8
+ import { Transaction } from '@atlaskit/editor-prosemirror/state';
8
9
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
9
10
  import type { InternalError } from '../errors/internal-errors';
10
11
  import type { ParticipantsService } from '../participants/participants-service';
@@ -4,7 +4,8 @@ import type AnalyticsHelper from '../analytics/analytics-helper';
4
4
  import { CatchupEventReason } from '../helpers/const';
5
5
  import type { MetadataService } from '../metadata/metadata-service';
6
6
  import type { Catchupv2Response, ChannelEvent, ReconcileResponse, ReconnectionMetadata, StepsPayload } from '../types';
7
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
7
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
8
+ import { Transaction } from '@atlaskit/editor-prosemirror/state';
8
9
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
9
10
  import type { InternalError } from '../errors/internal-errors';
10
11
  import type { ParticipantsService } from '../participants/participants-service';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "10.8.0",
3
+ "version": "10.8.1",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"