@atlaskit/collab-provider 9.7.3 → 9.8.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,17 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 9.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`aceff84b101`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aceff84b101) - initializing provider on setup if buffering is enabled
8
+
9
+ ## 9.7.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
14
+
3
15
  ## 9.7.3
4
16
 
5
17
  ### Patch Changes
@@ -10,7 +10,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
11
  var _const = require("../helpers/const");
12
12
  var _utils = require("../helpers/utils");
13
- var _prosemirrorTransform = require("prosemirror-transform");
13
+ var _transform = require("@atlaskit/editor-prosemirror/transform");
14
14
  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; } } }; }
15
15
  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); }
16
16
  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; }
@@ -114,11 +114,11 @@ var catchup = /*#__PURE__*/function () {
114
114
  inverted = _ref2.inverted;
115
115
  // Due to @types/prosemirror-transform mismatch with the actual
116
116
  // constructor, hack to set the `inverted`.
117
- var stepMap = new _prosemirrorTransform.StepMap(ranges);
117
+ var stepMap = new _transform.StepMap(ranges);
118
118
  stepMap.inverted = inverted;
119
119
  return stepMap;
120
120
  }); // create Mapping used for Step.map
121
- mapping = new _prosemirrorTransform.Mapping(stepMaps);
121
+ mapping = new _transform.Mapping(stepMaps);
122
122
  logger("".concat(_unconfirmedSteps.length, " unconfirmed steps before rebased: ").concat(JSON.stringify(_unconfirmedSteps)));
123
123
  newUnconfirmedSteps = rebaseSteps(_unconfirmedSteps, mapping);
124
124
  if ((newUnconfirmedSteps === null || newUnconfirmedSteps === void 0 ? void 0 : newUnconfirmedSteps.length) < _unconfirmedSteps.length) {
@@ -43,6 +43,10 @@ var Provider = /*#__PURE__*/function (_Emitter) {
43
43
  _this = _super.call(this);
44
44
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isChannelInitialized", false);
45
45
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isProviderInitialized", false);
46
+ // isBufferingEnabled is a boolean value passed to the config during provider creation.
47
+ // It determines if the provider should initialize immediately and will only be true if:
48
+ // the feature flag is enabled and the initial draft fetched from NCS is also passed in the config.
49
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isBufferingEnabled", false);
46
50
  // isPreinitializating acts as a feature flag to determine when the provider has been initialized early
47
51
  // and also contains the initial draft
48
52
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isPreinitializing", false);
@@ -96,6 +100,13 @@ var Provider = /*#__PURE__*/function (_Emitter) {
96
100
  var sid = _ref2.sid,
97
101
  initialized = _ref2.initialized;
98
102
  _this.sessionId = sid;
103
+ // if buffering is enabled and the provider is initialized before connection, call catchup
104
+ // once setup resolves with the defined editor state
105
+ if (_this.isBufferingEnabled && _this.isProviderInitialized) {
106
+ _this.onSetupPromise.then(function () {
107
+ _this.documentService.sendStepsFromCurrentState();
108
+ });
109
+ }
99
110
  _this.emitCallback('connected', {
100
111
  sid: sid,
101
112
  initial: !initialized
@@ -271,6 +282,7 @@ var Provider = /*#__PURE__*/function (_Emitter) {
271
282
  _this.channel = new _channel.Channel(config, _this.analyticsHelper);
272
283
  _this.isChannelInitialized = false;
273
284
  _this.initialDraft = _this.config.initialDraft;
285
+ _this.isBufferingEnabled = Boolean(_this.config.isBufferingEnabled);
274
286
  _this.isProviderInitialized = false;
275
287
  _this.isPreinitializing = false;
276
288
  _this.participantsService = new _participantsService.ParticipantsService(_this.analyticsHelper, undefined, _this.emitCallback, _this.config.getUser, _this.channel.broadcast, _this.channel.sendPresenceJoined, _this.getPresenceData, _this.setUserId);
@@ -341,6 +353,17 @@ var Provider = /*#__PURE__*/function (_Emitter) {
341
353
  // a defined getState (ie editor state is ready) AND after documentService sets the editor state
342
354
  if (this.isPreinitializing) {
343
355
  this.resolveOnSetupPromise();
356
+ if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
357
+ var _this$initialDraft2 = this.initialDraft,
358
+ document = _this$initialDraft2.document,
359
+ version = _this$initialDraft2.version,
360
+ metadata = _this$initialDraft2.metadata;
361
+ this.updateDocumentAndMetadata({
362
+ doc: document,
363
+ version: version,
364
+ metadata: metadata
365
+ });
366
+ }
344
367
  }
345
368
  }
346
369
  if (!this.isChannelInitialized) {
@@ -374,8 +397,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
374
397
  }, {
375
398
  key: "isDraftTimestampStale",
376
399
  value: function isDraftTimestampStale() {
377
- var _this$initialDraft2;
378
- if (!((_this$initialDraft2 = this.initialDraft) !== null && _this$initialDraft2 !== void 0 && _this$initialDraft2.timestamp)) {
400
+ var _this$initialDraft3;
401
+ if (!((_this$initialDraft3 = this.initialDraft) !== null && _this$initialDraft3 !== void 0 && _this$initialDraft3.timestamp)) {
379
402
  return false;
380
403
  }
381
404
  return Date.now() - this.initialDraft.timestamp >= PRELOAD_DRAFT_SYNC_PERIOD;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/collab-provider";
8
8
  exports.name = name;
9
- var version = "9.7.3";
9
+ var version = "9.8.0";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.7.3",
3
+ "version": "9.8.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { EVENT_ACTION, EVENT_STATUS } from '../helpers/const';
2
2
  import { createLogger } from '../helpers/utils';
3
- import { StepMap, Mapping } from 'prosemirror-transform';
3
+ import { StepMap, Mapping } from '@atlaskit/editor-prosemirror/transform';
4
4
  const logger = createLogger('Catchup', 'red');
5
5
 
6
6
  /**
@@ -20,6 +20,10 @@ export class Provider extends Emitter {
20
20
  super();
21
21
  _defineProperty(this, "isChannelInitialized", false);
22
22
  _defineProperty(this, "isProviderInitialized", false);
23
+ // isBufferingEnabled is a boolean value passed to the config during provider creation.
24
+ // It determines if the provider should initialize immediately and will only be true if:
25
+ // the feature flag is enabled and the initial draft fetched from NCS is also passed in the config.
26
+ _defineProperty(this, "isBufferingEnabled", false);
23
27
  // isPreinitializating acts as a feature flag to determine when the provider has been initialized early
24
28
  // and also contains the initial draft
25
29
  _defineProperty(this, "isPreinitializing", false);
@@ -73,6 +77,13 @@ export class Provider extends Emitter {
73
77
  initialized
74
78
  }) => {
75
79
  this.sessionId = sid;
80
+ // if buffering is enabled and the provider is initialized before connection, call catchup
81
+ // once setup resolves with the defined editor state
82
+ if (this.isBufferingEnabled && this.isProviderInitialized) {
83
+ this.onSetupPromise.then(() => {
84
+ this.documentService.sendStepsFromCurrentState();
85
+ });
86
+ }
76
87
  this.emitCallback('connected', {
77
88
  sid,
78
89
  initial: !initialized
@@ -225,6 +236,7 @@ export class Provider extends Emitter {
225
236
  this.channel = new Channel(config, this.analyticsHelper);
226
237
  this.isChannelInitialized = false;
227
238
  this.initialDraft = this.config.initialDraft;
239
+ this.isBufferingEnabled = Boolean(this.config.isBufferingEnabled);
228
240
  this.isProviderInitialized = false;
229
241
  this.isPreinitializing = false;
230
242
  this.participantsService = new ParticipantsService(this.analyticsHelper, undefined, this.emitCallback, this.config.getUser, this.channel.broadcast, this.channel.sendPresenceJoined, this.getPresenceData, this.setUserId);
@@ -286,6 +298,18 @@ export class Provider extends Emitter {
286
298
  // a defined getState (ie editor state is ready) AND after documentService sets the editor state
287
299
  if (this.isPreinitializing) {
288
300
  this.resolveOnSetupPromise();
301
+ if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
302
+ const {
303
+ document,
304
+ version,
305
+ metadata
306
+ } = this.initialDraft;
307
+ this.updateDocumentAndMetadata({
308
+ doc: document,
309
+ version,
310
+ metadata
311
+ });
312
+ }
289
313
  }
290
314
  }
291
315
  if (!this.isChannelInitialized) {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "9.7.3";
2
+ export const version = "9.8.0";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.7.3",
3
+ "version": "9.8.0",
4
4
  "sideEffects": false
5
5
  }
@@ -5,7 +5,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
5
5
  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; }
6
6
  import { EVENT_ACTION, EVENT_STATUS } from '../helpers/const';
7
7
  import { createLogger } from '../helpers/utils';
8
- import { StepMap, Mapping } from 'prosemirror-transform';
8
+ import { StepMap, Mapping } from '@atlaskit/editor-prosemirror/transform';
9
9
  var logger = createLogger('Catchup', 'red');
10
10
 
11
11
  /**
@@ -35,6 +35,10 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
35
35
  _this = _super.call(this);
36
36
  _defineProperty(_assertThisInitialized(_this), "isChannelInitialized", false);
37
37
  _defineProperty(_assertThisInitialized(_this), "isProviderInitialized", false);
38
+ // isBufferingEnabled is a boolean value passed to the config during provider creation.
39
+ // It determines if the provider should initialize immediately and will only be true if:
40
+ // the feature flag is enabled and the initial draft fetched from NCS is also passed in the config.
41
+ _defineProperty(_assertThisInitialized(_this), "isBufferingEnabled", false);
38
42
  // isPreinitializating acts as a feature flag to determine when the provider has been initialized early
39
43
  // and also contains the initial draft
40
44
  _defineProperty(_assertThisInitialized(_this), "isPreinitializing", false);
@@ -88,6 +92,13 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
88
92
  var sid = _ref2.sid,
89
93
  initialized = _ref2.initialized;
90
94
  _this.sessionId = sid;
95
+ // if buffering is enabled and the provider is initialized before connection, call catchup
96
+ // once setup resolves with the defined editor state
97
+ if (_this.isBufferingEnabled && _this.isProviderInitialized) {
98
+ _this.onSetupPromise.then(function () {
99
+ _this.documentService.sendStepsFromCurrentState();
100
+ });
101
+ }
91
102
  _this.emitCallback('connected', {
92
103
  sid: sid,
93
104
  initial: !initialized
@@ -263,6 +274,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
263
274
  _this.channel = new Channel(config, _this.analyticsHelper);
264
275
  _this.isChannelInitialized = false;
265
276
  _this.initialDraft = _this.config.initialDraft;
277
+ _this.isBufferingEnabled = Boolean(_this.config.isBufferingEnabled);
266
278
  _this.isProviderInitialized = false;
267
279
  _this.isPreinitializing = false;
268
280
  _this.participantsService = new ParticipantsService(_this.analyticsHelper, undefined, _this.emitCallback, _this.config.getUser, _this.channel.broadcast, _this.channel.sendPresenceJoined, _this.getPresenceData, _this.setUserId);
@@ -333,6 +345,17 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
333
345
  // a defined getState (ie editor state is ready) AND after documentService sets the editor state
334
346
  if (this.isPreinitializing) {
335
347
  this.resolveOnSetupPromise();
348
+ if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
349
+ var _this$initialDraft2 = this.initialDraft,
350
+ document = _this$initialDraft2.document,
351
+ version = _this$initialDraft2.version,
352
+ metadata = _this$initialDraft2.metadata;
353
+ this.updateDocumentAndMetadata({
354
+ doc: document,
355
+ version: version,
356
+ metadata: metadata
357
+ });
358
+ }
336
359
  }
337
360
  }
338
361
  if (!this.isChannelInitialized) {
@@ -366,8 +389,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
366
389
  }, {
367
390
  key: "isDraftTimestampStale",
368
391
  value: function isDraftTimestampStale() {
369
- var _this$initialDraft2;
370
- if (!((_this$initialDraft2 = this.initialDraft) !== null && _this$initialDraft2 !== void 0 && _this$initialDraft2.timestamp)) {
392
+ var _this$initialDraft3;
393
+ if (!((_this$initialDraft3 = this.initialDraft) !== null && _this$initialDraft3 !== void 0 && _this$initialDraft3.timestamp)) {
371
394
  return false;
372
395
  }
373
396
  return Date.now() - this.initialDraft.timestamp >= PRELOAD_DRAFT_SYNC_PERIOD;
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "9.7.3";
2
+ export var version = "9.8.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.7.3",
3
+ "version": "9.8.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import type { CatchupOptions } from '../types';
2
- import { Mapping, Step } from 'prosemirror-transform';
2
+ import { Mapping, Step } from '@atlaskit/editor-prosemirror/transform';
3
3
  /**
4
4
  * Rebase the steps based on the mapping pipeline.
5
5
  * Some steps could be lost, if they are no longer
@@ -2,10 +2,10 @@
2
2
  import AnalyticsHelper from '../analytics/analytics-helper';
3
3
  import { CatchupResponse, ChannelEvent, StepsPayload } from '../types';
4
4
  import type { SyncUpErrorFunction, ResolvedEditorState } from '@atlaskit/editor-common/collab';
5
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
5
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
6
6
  import type { MetadataService } from '../metadata/metadata-service';
7
7
  import type { CollabEvents, CollabInitPayload } from '@atlaskit/editor-common/collab';
8
- import type { EditorState, Transaction } from 'prosemirror-state';
8
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
9
9
  import { ParticipantsService } from '../participants/participants-service';
10
10
  import type { InternalError } from '../errors/error-types';
11
11
  export declare class DocumentService {
@@ -1,5 +1,5 @@
1
1
  import type { ProductInformation } from '../types';
2
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
2
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
3
3
  export declare const createLogger: (prefix: string, color?: string) => (msg: string, data?: any) => void;
4
4
  export declare function sleep(ms: number): Promise<unknown>;
5
5
  export declare const getProduct: (productInfo?: ProductInformation) => string;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="lodash" />
2
2
  import { ChannelEvent, StepsPayload } from '../types';
3
3
  import type { CollabCommitStatusEventPayload, CollabEvents } from '@atlaskit/editor-common/collab';
4
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
4
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
5
5
  import AnalyticsHelper from '../analytics/analytics-helper';
6
6
  import type { InternalError } from '../errors/error-types';
7
7
  export declare const commitStep: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, }: {
@@ -1,5 +1,5 @@
1
- import type { EditorState, Transaction } from 'prosemirror-state';
2
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
1
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
3
3
  import { Emitter } from '../emitter';
4
4
  import type { Config } from '../types';
5
5
  import type { CollabEditProvider, CollabEvents, CollabTelepointerPayload, ResolvedEditorState, Metadata, SyncUpErrorFunction } from '@atlaskit/editor-common/collab';
@@ -12,6 +12,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
12
12
  private isChannelInitialized;
13
13
  private initialDraft?;
14
14
  private isProviderInitialized;
15
+ private isBufferingEnabled;
15
16
  private isPreinitializing;
16
17
  private sessionId?;
17
18
  private clientId?;
@@ -1,4 +1,4 @@
1
- import type { Step } from 'prosemirror-transform';
1
+ import type { Step } from '@atlaskit/editor-prosemirror/transform';
2
2
  import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners';
3
3
  import type { Manager } from 'socket.io-client';
4
4
  import type { InternalError } from './errors/error-types';
@@ -53,6 +53,7 @@ export interface Config {
53
53
  */
54
54
  throwOnNotConnected?: boolean;
55
55
  initialDraft?: InitialDraft;
56
+ isBufferingEnabled?: boolean;
56
57
  /**
57
58
  * When a page is being published this number can control the number of failed steps until a catchup is triggered.
58
59
  * The default value is MAX_STEP_REJECTED_ERROR (15).
@@ -1,5 +1,5 @@
1
1
  import type { CatchupOptions } from '../types';
2
- import { Mapping, Step } from 'prosemirror-transform';
2
+ import { Mapping, Step } from '@atlaskit/editor-prosemirror/transform';
3
3
  /**
4
4
  * Rebase the steps based on the mapping pipeline.
5
5
  * Some steps could be lost, if they are no longer
@@ -2,10 +2,10 @@
2
2
  import AnalyticsHelper from '../analytics/analytics-helper';
3
3
  import { CatchupResponse, ChannelEvent, StepsPayload } from '../types';
4
4
  import type { SyncUpErrorFunction, ResolvedEditorState } from '@atlaskit/editor-common/collab';
5
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
5
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
6
6
  import type { MetadataService } from '../metadata/metadata-service';
7
7
  import type { CollabEvents, CollabInitPayload } from '@atlaskit/editor-common/collab';
8
- import type { EditorState, Transaction } from 'prosemirror-state';
8
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
9
9
  import { ParticipantsService } from '../participants/participants-service';
10
10
  import type { InternalError } from '../errors/error-types';
11
11
  export declare class DocumentService {
@@ -1,5 +1,5 @@
1
1
  import type { ProductInformation } from '../types';
2
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
2
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
3
3
  export declare const createLogger: (prefix: string, color?: string) => (msg: string, data?: any) => void;
4
4
  export declare function sleep(ms: number): Promise<unknown>;
5
5
  export declare const getProduct: (productInfo?: ProductInformation) => string;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="lodash" />
2
2
  import { ChannelEvent, StepsPayload } from '../types';
3
3
  import type { CollabCommitStatusEventPayload, CollabEvents } from '@atlaskit/editor-common/collab';
4
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
4
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
5
5
  import AnalyticsHelper from '../analytics/analytics-helper';
6
6
  import type { InternalError } from '../errors/error-types';
7
7
  export declare const commitStep: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, }: {
@@ -1,5 +1,5 @@
1
- import type { EditorState, Transaction } from 'prosemirror-state';
2
- import type { Step as ProseMirrorStep } from 'prosemirror-transform';
1
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { Step as ProseMirrorStep } from '@atlaskit/editor-prosemirror/transform';
3
3
  import { Emitter } from '../emitter';
4
4
  import type { Config } from '../types';
5
5
  import type { CollabEditProvider, CollabEvents, CollabTelepointerPayload, ResolvedEditorState, Metadata, SyncUpErrorFunction } from '@atlaskit/editor-common/collab';
@@ -12,6 +12,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
12
12
  private isChannelInitialized;
13
13
  private initialDraft?;
14
14
  private isProviderInitialized;
15
+ private isBufferingEnabled;
15
16
  private isPreinitializing;
16
17
  private sessionId?;
17
18
  private clientId?;
@@ -1,4 +1,4 @@
1
- import type { Step } from 'prosemirror-transform';
1
+ import type { Step } from '@atlaskit/editor-prosemirror/transform';
2
2
  import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners';
3
3
  import type { Manager } from 'socket.io-client';
4
4
  import type { InternalError } from './errors/error-types';
@@ -53,6 +53,7 @@ export interface Config {
53
53
  */
54
54
  throwOnNotConnected?: boolean;
55
55
  initialDraft?: InitialDraft;
56
+ isBufferingEnabled?: boolean;
56
57
  /**
57
58
  * When a page is being published this number can control the number of failed steps until a catchup is triggered.
58
59
  * The default value is MAX_STEP_REJECTED_ERROR (15).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "9.7.3",
3
+ "version": "9.8.0",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,15 +36,15 @@
36
36
  "dependencies": {
37
37
  "@atlaskit/analytics-gas-types": "^5.1.0",
38
38
  "@atlaskit/analytics-listeners": "^8.7.0",
39
- "@atlaskit/editor-common": "^74.24.0",
39
+ "@atlaskit/editor-common": "^74.35.0",
40
40
  "@atlaskit/editor-json-transformer": "^8.10.0",
41
+ "@atlaskit/editor-prosemirror": "1.0.2",
41
42
  "@atlaskit/prosemirror-collab": "^0.2.0",
42
43
  "@atlaskit/ufo": "^0.2.0",
43
44
  "@atlaskit/util-service-support": "^6.2.0",
44
45
  "@babel/runtime": "^7.0.0",
45
46
  "eventemitter2": "^4.1.0",
46
47
  "lodash": "^4.17.21",
47
- "prosemirror-transform": "1.3.2",
48
48
  "socket.io-client": "^4.7.1"
49
49
  },
50
50
  "techstack": {
@@ -62,12 +62,10 @@
62
62
  }
63
63
  },
64
64
  "devDependencies": {
65
- "@atlaskit/adf-schema": "^26.2.0",
65
+ "@atlaskit/adf-schema": "^26.4.0",
66
66
  "@atlaskit/analytics-listeners": "^8.7.0",
67
67
  "@atlaskit/editor-test-helpers": "^18.10.0",
68
68
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
69
- "prosemirror-model": "1.16.0",
70
- "prosemirror-state": "1.3.4",
71
69
  "typescript": "~4.9.5"
72
70
  },
73
71
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
package/report.api.md CHANGED
@@ -34,7 +34,7 @@ import { CollabParticipant } from '@atlaskit/editor-common/collab';
34
34
  import { CollabPresencePayload } from '@atlaskit/editor-common/collab';
35
35
  import { CollabSendableSelection } from '@atlaskit/editor-common/collab';
36
36
  import { CollabTelepointerPayload } from '@atlaskit/editor-common/collab';
37
- import type { EditorState } from 'prosemirror-state';
37
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
38
38
  import { JSONDocNode } from '@atlaskit/editor-json-transformer';
39
39
  import type { Manager } from 'socket.io-client';
40
40
  import type { Metadata as Metadata_2 } from '@atlaskit/editor-common/collab';
@@ -43,9 +43,9 @@ import { PROVIDER_ERROR_CODE } from '@atlaskit/editor-common/collab';
43
43
  import { ProviderError } from '@atlaskit/editor-common/collab';
44
44
  import { ProviderParticipant } from '@atlaskit/editor-common/collab';
45
45
  import { ResolvedEditorState } from '@atlaskit/editor-common/collab';
46
- import type { Step } from 'prosemirror-transform';
46
+ import type { Step } from '@atlaskit/editor-prosemirror/transform';
47
47
  import { SyncUpErrorFunction } from '@atlaskit/editor-common/collab';
48
- import type { Transaction } from 'prosemirror-state';
48
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
49
49
 
50
50
  // @public (undocumented)
51
51
  type AuthCallback = (cb: (data: InitAndAuthData) => void) => void;
@@ -138,6 +138,8 @@ interface Config {
138
138
  // (undocumented)
139
139
  initialDraft?: InitialDraft;
140
140
  // (undocumented)
141
+ isBufferingEnabled?: boolean;
142
+ // (undocumented)
141
143
  lifecycle?: Lifecycle;
142
144
  // (undocumented)
143
145
  need404?: boolean;
@@ -23,7 +23,7 @@ import { CollabParticipant } from '@atlaskit/editor-common/collab';
23
23
  import { CollabPresencePayload } from '@atlaskit/editor-common/collab';
24
24
  import { CollabSendableSelection } from '@atlaskit/editor-common/collab';
25
25
  import { CollabTelepointerPayload } from '@atlaskit/editor-common/collab';
26
- import type { EditorState } from 'prosemirror-state';
26
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
27
27
  import { JSONDocNode } from '@atlaskit/editor-json-transformer';
28
28
  import type { Manager } from 'socket.io-client';
29
29
  import type { Metadata as Metadata_2 } from '@atlaskit/editor-common/collab';
@@ -32,9 +32,9 @@ import { PROVIDER_ERROR_CODE } from '@atlaskit/editor-common/collab';
32
32
  import { ProviderError } from '@atlaskit/editor-common/collab';
33
33
  import { ProviderParticipant } from '@atlaskit/editor-common/collab';
34
34
  import { ResolvedEditorState } from '@atlaskit/editor-common/collab';
35
- import type { Step } from 'prosemirror-transform';
35
+ import type { Step } from '@atlaskit/editor-prosemirror/transform';
36
36
  import { SyncUpErrorFunction } from '@atlaskit/editor-common/collab';
37
- import type { Transaction } from 'prosemirror-state';
37
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
38
38
 
39
39
  // @public (undocumented)
40
40
  type AuthCallback = (cb: (data: InitAndAuthData) => void) => void;
@@ -114,6 +114,8 @@ interface Config {
114
114
  // (undocumented)
115
115
  initialDraft?: InitialDraft;
116
116
  // (undocumented)
117
+ isBufferingEnabled?: boolean;
118
+ // (undocumented)
117
119
  lifecycle?: Lifecycle;
118
120
  // (undocumented)
119
121
  need404?: boolean;