@atlaskit/prosemirror-collab 0.9.4 → 0.9.5

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,14 @@
1
1
  # @atlaskit/prosemirror-collab
2
2
 
3
+ ## 0.9.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#143146](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/143146)
8
+ [`5df86b2c5407e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5df86b2c5407e) -
9
+ Retire getVersion using getCollabState from prosemirror-collab, and adding error events on
10
+ checking undefined collab state in all collab-provider usages
11
+
3
12
  ## 0.9.4
4
13
 
5
14
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.collab = collab;
8
- exports.getVersion = getVersion;
8
+ exports.getCollabState = getCollabState;
9
9
  exports.rebaseSteps = rebaseSteps;
10
10
  exports.receiveTransaction = receiveTransaction;
11
11
  exports.sendableSteps = sendableSteps;
@@ -188,9 +188,9 @@ function sendableSteps(state) {
188
188
  };
189
189
  }
190
190
 
191
- /// Get the version up to which the collab plugin has synced with the
192
- /// central authority.
193
- function getVersion(state) {
194
- var _collabKey$getState;
195
- return ((_collabKey$getState = collabKey.getState(state)) === null || _collabKey$getState === void 0 ? void 0 : _collabKey$getState.version) || 0;
191
+ /// Get the collab state which would holds the version up to which the collab plugin has synced with the central authority.
192
+ /// Override getVersion to getCollabState to gain the benefit on analytics / monitoring in collab-provider
193
+ /// Override PR: https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/142331/overview
194
+ function getCollabState(state) {
195
+ return collabKey.getState(state);
196
196
  }
@@ -171,9 +171,9 @@ export function sendableSteps(state) {
171
171
  };
172
172
  }
173
173
 
174
- /// Get the version up to which the collab plugin has synced with the
175
- /// central authority.
176
- export function getVersion(state) {
177
- var _collabKey$getState;
178
- return ((_collabKey$getState = collabKey.getState(state)) === null || _collabKey$getState === void 0 ? void 0 : _collabKey$getState.version) || 0;
174
+ /// Get the collab state which would holds the version up to which the collab plugin has synced with the central authority.
175
+ /// Override getVersion to getCollabState to gain the benefit on analytics / monitoring in collab-provider
176
+ /// Override PR: https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/142331/overview
177
+ export function getCollabState(state) {
178
+ return collabKey.getState(state);
179
179
  }
package/dist/esm/index.js CHANGED
@@ -177,9 +177,9 @@ export function sendableSteps(state) {
177
177
  };
178
178
  }
179
179
 
180
- /// Get the version up to which the collab plugin has synced with the
181
- /// central authority.
182
- export function getVersion(state) {
183
- var _collabKey$getState;
184
- return ((_collabKey$getState = collabKey.getState(state)) === null || _collabKey$getState === void 0 ? void 0 : _collabKey$getState.version) || 0;
180
+ /// Get the collab state which would holds the version up to which the collab plugin has synced with the central authority.
181
+ /// Override getVersion to getCollabState to gain the benefit on analytics / monitoring in collab-provider
182
+ /// Override PR: https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/142331/overview
183
+ export function getCollabState(state) {
184
+ return collabKey.getState(state);
185
185
  }
@@ -8,6 +8,11 @@ declare class Rebaseable {
8
8
  constructor(step: ProseMirrorStep, inverted: ProseMirrorStep, origin: ProseMirrorTransform);
9
9
  }
10
10
  export declare function rebaseSteps(steps: readonly Rebaseable[], over: readonly ProseMirrorStep[], transform: ProseMirrorTransform): Rebaseable[];
11
+ declare class CollabState {
12
+ readonly version: number;
13
+ readonly unconfirmed: readonly Rebaseable[];
14
+ constructor(version: number, unconfirmed: readonly Rebaseable[]);
15
+ }
11
16
  type CollabConfig = {
12
17
  version?: number;
13
18
  clientID?: number | string | null;
@@ -22,5 +27,5 @@ export declare function sendableSteps(state: EditorState): {
22
27
  clientID: number | string;
23
28
  origins: readonly Transaction[];
24
29
  } | null;
25
- export declare function getVersion(state: EditorState): number;
30
+ export declare function getCollabState(state: EditorState): CollabState | undefined;
26
31
  export {};
@@ -8,6 +8,11 @@ declare class Rebaseable {
8
8
  constructor(step: ProseMirrorStep, inverted: ProseMirrorStep, origin: ProseMirrorTransform);
9
9
  }
10
10
  export declare function rebaseSteps(steps: readonly Rebaseable[], over: readonly ProseMirrorStep[], transform: ProseMirrorTransform): Rebaseable[];
11
+ declare class CollabState {
12
+ readonly version: number;
13
+ readonly unconfirmed: readonly Rebaseable[];
14
+ constructor(version: number, unconfirmed: readonly Rebaseable[]);
15
+ }
11
16
  type CollabConfig = {
12
17
  version?: number;
13
18
  clientID?: number | string | null;
@@ -22,5 +27,5 @@ export declare function sendableSteps(state: EditorState): {
22
27
  clientID: number | string;
23
28
  origins: readonly Transaction[];
24
29
  } | null;
25
- export declare function getVersion(state: EditorState): number;
30
+ export declare function getCollabState(state: EditorState): CollabState | undefined;
26
31
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/prosemirror-collab",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "Collaborative editing for ProseMirror - Atlassian Fork",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"