@atlaskit/collab-provider 15.3.16 → 15.3.17

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,11 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 15.3.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 15.3.16
4
10
 
5
11
  ### Patch Changes
@@ -450,10 +450,13 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
450
450
  key: "setup",
451
451
  value: function setup(_ref9) {
452
452
  var getState = _ref9.getState,
453
- _editorApi = _ref9._editorApi,
453
+ _editorApi = _ref9.editorApi,
454
454
  onSyncUpError = _ref9.onSyncUpError;
455
455
  this.checkForCookies();
456
456
  try {
457
+ if (!getState) {
458
+ throw new _customErrors.ProviderInitialisationError('Collab provider attempted to initialise, but getState is required');
459
+ }
457
460
  // Ignored via go/ees005
458
461
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
459
462
  var collabPlugin = getState().plugins.find(function (p) {
@@ -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 = "15.3.15";
8
+ var version = exports.version = "15.3.16";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -358,12 +358,15 @@ export class Provider extends Emitter {
358
358
  */
359
359
  setup({
360
360
  getState,
361
- _editorApi,
361
+ editorApi: _editorApi,
362
362
  // eslint says unused vars should start with _
363
363
  onSyncUpError
364
364
  }) {
365
365
  this.checkForCookies();
366
366
  try {
367
+ if (!getState) {
368
+ throw new ProviderInitialisationError('Collab provider attempted to initialise, but getState is required');
369
+ }
367
370
  // Ignored via go/ees005
368
371
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
369
372
  const collabPlugin = getState().plugins.find(p => p.key === 'collab$');
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "15.3.15";
2
+ export const version = "15.3.16";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -444,10 +444,13 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
444
444
  key: "setup",
445
445
  value: function setup(_ref9) {
446
446
  var getState = _ref9.getState,
447
- _editorApi = _ref9._editorApi,
447
+ _editorApi = _ref9.editorApi,
448
448
  onSyncUpError = _ref9.onSyncUpError;
449
449
  this.checkForCookies();
450
450
  try {
451
+ if (!getState) {
452
+ throw new ProviderInitialisationError('Collab provider attempted to initialise, but getState is required');
453
+ }
451
454
  // Ignored via go/ees005
452
455
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
453
456
  var collabPlugin = getState().plugins.find(function (p) {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "15.3.15";
2
+ export var version = "15.3.16";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -8,8 +8,7 @@ import { NullApi } from '../api/null-api';
8
8
  import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
9
9
  export declare const MAX_STEP_REJECTED_ERROR = 15;
10
10
  export declare const MAX_STEP_REJECTED_ERROR_AGGRESSIVE = 2;
11
- type BaseEvents = Pick<CollabEditProvider<CollabEvents>, 'setup' | 'send' | 'sendMessage'>;
12
- export declare class Provider extends Emitter<CollabEvents> implements BaseEvents {
11
+ export declare class Provider extends Emitter<CollabEvents> implements CollabEditProvider<CollabEvents> {
13
12
  api: Api | NullApi;
14
13
  private channel;
15
14
  private config;
@@ -66,10 +65,10 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
66
65
  * @param {SyncUpErrorFunction} options.onSyncUpError (Optional) Function that gets called when the sync of steps fails after retrying 30 times, used by Editor to log to analytics
67
66
  * @throws {ProviderInitialisationError} Something went wrong during provider initialisation
68
67
  */
69
- setup({ getState, _editorApi, // eslint says unused vars should start with _
68
+ setup({ getState, editorApi: _editorApi, // eslint says unused vars should start with _
70
69
  onSyncUpError, }: {
71
- _editorApi?: any;
72
- getState: () => EditorState;
70
+ editorApi?: any;
71
+ getState?: () => EditorState;
73
72
  onSyncUpError?: SyncUpErrorFunction;
74
73
  }): this;
75
74
  setupForPresenceOnly(clientId: string): this;
@@ -185,4 +184,3 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
185
184
  getSessionId: () => string | undefined;
186
185
  getDocumentAri: () => string;
187
186
  }
188
- export {};
@@ -8,8 +8,7 @@ import { NullApi } from '../api/null-api';
8
8
  import type { GetResolvedEditorStateReason } from '@atlaskit/editor-common/types';
9
9
  export declare const MAX_STEP_REJECTED_ERROR = 15;
10
10
  export declare const MAX_STEP_REJECTED_ERROR_AGGRESSIVE = 2;
11
- type BaseEvents = Pick<CollabEditProvider<CollabEvents>, 'setup' | 'send' | 'sendMessage'>;
12
- export declare class Provider extends Emitter<CollabEvents> implements BaseEvents {
11
+ export declare class Provider extends Emitter<CollabEvents> implements CollabEditProvider<CollabEvents> {
13
12
  api: Api | NullApi;
14
13
  private channel;
15
14
  private config;
@@ -66,10 +65,10 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
66
65
  * @param {SyncUpErrorFunction} options.onSyncUpError (Optional) Function that gets called when the sync of steps fails after retrying 30 times, used by Editor to log to analytics
67
66
  * @throws {ProviderInitialisationError} Something went wrong during provider initialisation
68
67
  */
69
- setup({ getState, _editorApi, // eslint says unused vars should start with _
68
+ setup({ getState, editorApi: _editorApi, // eslint says unused vars should start with _
70
69
  onSyncUpError, }: {
71
- _editorApi?: any;
72
- getState: () => EditorState;
70
+ editorApi?: any;
71
+ getState?: () => EditorState;
73
72
  onSyncUpError?: SyncUpErrorFunction;
74
73
  }): this;
75
74
  setupForPresenceOnly(clientId: string): this;
@@ -185,4 +184,3 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
185
184
  getSessionId: () => string | undefined;
186
185
  getDocumentAri: () => string;
187
186
  }
188
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "15.3.16",
3
+ "version": "15.3.17",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,8 +36,8 @@
36
36
  "@atlaskit/feature-gate-js-client": "^5.5.0",
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/prosemirror-collab": "^0.22.0",
39
- "@atlaskit/react-ufo": "^5.2.0",
40
- "@atlaskit/tmp-editor-statsig": "^29.0.0",
39
+ "@atlaskit/react-ufo": "^5.3.0",
40
+ "@atlaskit/tmp-editor-statsig": "^30.0.0",
41
41
  "@atlaskit/ufo": "^0.4.0",
42
42
  "@atlaskit/util-service-support": "^6.3.0",
43
43
  "@babel/runtime": "^7.0.0",
@@ -73,6 +73,6 @@
73
73
  }
74
74
  },
75
75
  "peerDependencies": {
76
- "@atlaskit/editor-common": "^111.16.0"
76
+ "@atlaskit/editor-common": "^111.20.0"
77
77
  }
78
78
  }