@atlaskit/collab-provider 8.9.1 → 9.0.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/channel.js +6 -8
  3. package/dist/cjs/document/catchup.js +8 -1
  4. package/dist/cjs/document/document-service.js +3 -2
  5. package/dist/cjs/helpers/const.js +2 -1
  6. package/dist/cjs/participants/participants-service.js +11 -5
  7. package/dist/cjs/provider/index.js +20 -7
  8. package/dist/cjs/types.js +2 -3
  9. package/dist/cjs/version-wrapper.js +1 -1
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/es2019/channel.js +6 -6
  12. package/dist/es2019/document/catchup.js +8 -0
  13. package/dist/es2019/document/document-service.js +3 -2
  14. package/dist/es2019/helpers/const.js +2 -1
  15. package/dist/es2019/participants/participants-service.js +10 -6
  16. package/dist/es2019/provider/index.js +13 -3
  17. package/dist/es2019/types.js +4 -4
  18. package/dist/es2019/version-wrapper.js +1 -1
  19. package/dist/es2019/version.json +1 -1
  20. package/dist/esm/channel.js +6 -8
  21. package/dist/esm/document/catchup.js +8 -1
  22. package/dist/esm/document/document-service.js +3 -2
  23. package/dist/esm/helpers/const.js +2 -1
  24. package/dist/esm/participants/participants-service.js +11 -5
  25. package/dist/esm/provider/index.js +20 -7
  26. package/dist/esm/types.js +4 -4
  27. package/dist/esm/version-wrapper.js +1 -1
  28. package/dist/esm/version.json +1 -1
  29. package/dist/types/channel.d.ts +1 -1
  30. package/dist/types/document/document-service.d.ts +2 -3
  31. package/dist/types/helpers/const.d.ts +11 -3
  32. package/dist/types/index.d.ts +1 -1
  33. package/dist/types/participants/participants-helper.d.ts +4 -3
  34. package/dist/types/participants/participants-service.d.ts +4 -3
  35. package/dist/types/participants/telepointers-helper.d.ts +2 -2
  36. package/dist/types/provider/index.d.ts +6 -5
  37. package/dist/types/types.d.ts +58 -8
  38. package/dist/types-ts4.5/channel.d.ts +1 -1
  39. package/dist/types-ts4.5/document/document-service.d.ts +2 -3
  40. package/dist/types-ts4.5/helpers/const.d.ts +11 -3
  41. package/dist/types-ts4.5/index.d.ts +1 -1
  42. package/dist/types-ts4.5/participants/participants-helper.d.ts +4 -3
  43. package/dist/types-ts4.5/participants/participants-service.d.ts +4 -3
  44. package/dist/types-ts4.5/participants/telepointers-helper.d.ts +2 -2
  45. package/dist/types-ts4.5/provider/index.d.ts +6 -5
  46. package/dist/types-ts4.5/types.d.ts +58 -8
  47. package/package.json +3 -4
  48. package/report.api.md +105 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "8.9.1",
3
+ "version": "9.0.1",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,7 +36,6 @@
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.1.0",
40
39
  "@atlaskit/editor-json-transformer": "^8.9.0",
41
40
  "@atlaskit/prosemirror-collab": "^0.2.0",
42
41
  "@atlaskit/ufo": "^0.2.0",
@@ -62,9 +61,9 @@
62
61
  }
63
62
  },
64
63
  "devDependencies": {
65
- "@atlaskit/adf-schema": "^25.6.0",
64
+ "@atlaskit/adf-schema": "^25.7.0",
66
65
  "@atlaskit/analytics-listeners": "^8.7.0",
67
- "@atlaskit/editor-test-helpers": "^18.3.0",
66
+ "@atlaskit/editor-test-helpers": "^18.5.0",
68
67
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
69
68
  "@types/prosemirror-model": "^1.11.0",
70
69
  "@types/prosemirror-state": "^1.2.0",
package/report.api.md CHANGED
@@ -16,18 +16,10 @@
16
16
 
17
17
  ```ts
18
18
  import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners';
19
- import type { CollabEventConnectingData } from '@atlaskit/editor-common/collab';
20
- import type { CollabEventConnectionData } from '@atlaskit/editor-common/collab';
21
- import type { CollabEventInitData } from '@atlaskit/editor-common/collab';
22
- import type { CollabEventPresenceData } from '@atlaskit/editor-common/collab';
23
- import type { CollabEventRemoteData } from '@atlaskit/editor-common/collab';
24
- import type { CollabParticipant } from '@atlaskit/editor-common/collab';
25
19
  import type { EditorState } from 'prosemirror-state';
26
20
  import { JSONDocNode } from '@atlaskit/editor-json-transformer';
27
21
  import type { Manager } from 'socket.io-client';
28
- import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
29
22
  import type { Step } from 'prosemirror-transform';
30
- import type { SyncUpErrorFunction } from '@atlaskit/editor-common/types';
31
23
  import type { Transaction } from 'prosemirror-state';
32
24
 
33
25
  // @public (undocumented)
@@ -92,8 +84,73 @@ export interface CollabEditProvider<
92
84
  unsubscribeAll(evt: keyof Events): this;
93
85
  }
94
86
 
95
- // @public @deprecated (undocumented)
96
- export type CollabErrorPayload = ProviderError;
87
+ // @public (undocumented)
88
+ export interface CollabEventConnectingData {
89
+ // (undocumented)
90
+ initial: boolean;
91
+ }
92
+
93
+ // @public (undocumented)
94
+ export interface CollabEventConnectionData {
95
+ // (undocumented)
96
+ initial: boolean;
97
+ // (undocumented)
98
+ sid: string;
99
+ }
100
+
101
+ // @public (undocumented)
102
+ export interface CollabEventDisconnectedData {
103
+ // (undocumented)
104
+ reason:
105
+ | 'CLIENT_DISCONNECT'
106
+ | 'SERVER_DISCONNECT'
107
+ | 'SOCKET_CLOSED'
108
+ | 'SOCKET_ERROR'
109
+ | 'SOCKET_TIMEOUT'
110
+ | 'UNKNOWN_DISCONNECT';
111
+ // (undocumented)
112
+ sid: string;
113
+ }
114
+
115
+ // @public (undocumented)
116
+ export interface CollabEventInitData {
117
+ // (undocumented)
118
+ doc?: any;
119
+ // (undocumented)
120
+ json?: any;
121
+ // (undocumented)
122
+ reserveCursor?: boolean;
123
+ // (undocumented)
124
+ sid?: string;
125
+ // (undocumented)
126
+ version?: number;
127
+ }
128
+
129
+ // @public (undocumented)
130
+ export interface CollabEventLocalStepData {
131
+ // (undocumented)
132
+ steps: Array<Step>;
133
+ }
134
+
135
+ // @public (undocumented)
136
+ export interface CollabEventPresenceData {
137
+ // (undocumented)
138
+ joined?: CollabParticipant[];
139
+ // (undocumented)
140
+ left?: {
141
+ sessionId: string;
142
+ }[];
143
+ }
144
+
145
+ // @public (undocumented)
146
+ export interface CollabEventRemoteData {
147
+ // (undocumented)
148
+ json?: any;
149
+ // (undocumented)
150
+ newState?: EditorState;
151
+ // (undocumented)
152
+ userIds?: (number | string)[];
153
+ }
97
154
 
98
155
  // @public (undocumented)
99
156
  export interface CollabEvents {
@@ -112,7 +169,7 @@ export interface CollabEvents {
112
169
  // (undocumented)
113
170
  entity: any;
114
171
  // (undocumented)
115
- error: CollabErrorPayload;
172
+ error: ProviderError;
116
173
  // (undocumented)
117
174
  init: CollabInitPayload;
118
175
  // (undocumented)
@@ -122,7 +179,7 @@ export interface CollabEvents {
122
179
  }
123
180
 
124
181
  // @public (undocumented)
125
- interface CollabEventTelepointerData {
182
+ export interface CollabEventTelepointerData {
126
183
  // (undocumented)
127
184
  selection: CollabSendableSelection;
128
185
  // (undocumented)
@@ -151,6 +208,20 @@ export type CollabLocalStepsPayload = {
151
208
  // @public (undocumented)
152
209
  export type CollabMetadataPayload = Metadata_2;
153
210
 
211
+ // @public (undocumented)
212
+ export interface CollabParticipant {
213
+ // (undocumented)
214
+ avatar: string;
215
+ // (undocumented)
216
+ cursorPos?: number;
217
+ // (undocumented)
218
+ lastActive: number;
219
+ // (undocumented)
220
+ name: string;
221
+ // (undocumented)
222
+ sessionId: string;
223
+ }
224
+
154
225
  // @public (undocumented)
155
226
  export type CollabPresencePayload = CollabEventPresenceData;
156
227
 
@@ -359,6 +430,15 @@ type NetworkIssue = {
359
430
  status?: number;
360
431
  };
361
432
 
433
+ // @public (undocumented)
434
+ export type NewCollabSyncUpErrorAttributes = {
435
+ lengthOfUnconfirmedSteps?: number;
436
+ tries: number;
437
+ maxRetries: number;
438
+ clientId?: number | string;
439
+ version: number;
440
+ };
441
+
362
442
  // @public (undocumented)
363
443
  type NodeJson = {
364
444
  type: string;
@@ -396,7 +476,7 @@ export class Provider extends Emitter<CollabEvents> implements BaseEvents {
396
476
  _oldState: EditorState | null,
397
477
  newState: EditorState,
398
478
  ): void;
399
- sendMessage(data: CollabEventTelepointerData): void;
479
+ sendMessage(data: CollabTelepointerPayload): void;
400
480
  // @deprecated
401
481
  setEditorWidth(editorWidth: string, broadcast?: boolean): void;
402
482
  setMetadata(metadata: Metadata_2): void;
@@ -456,6 +536,13 @@ type ProviderParticipant = CollabParticipant & {
456
536
  clientId: number | string;
457
537
  };
458
538
 
539
+ // @public (undocumented)
540
+ export type ResolvedEditorState<T = any> = {
541
+ content: JSONDocNode | T;
542
+ title: null | string;
543
+ stepVersion: number;
544
+ };
545
+
459
546
  // @public (undocumented)
460
547
  interface SimpleEventEmitter {
461
548
  // (undocumented)
@@ -505,6 +592,11 @@ interface Storage_2 {
505
592
  set(key: string, value: string): Promise<void>;
506
593
  }
507
594
 
595
+ // @public (undocumented)
596
+ export type SyncUpErrorFunction = (
597
+ attributes: NewCollabSyncUpErrorAttributes,
598
+ ) => void;
599
+
508
600
  // (No @packageDocumentation comment for this package)
509
601
  ```
510
602