@atlaskit/collab-provider 9.6.3 → 9.7.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 +12 -0
- package/dist/cjs/channel.js +7 -6
- package/dist/cjs/document/document-service.js +2 -1
- package/dist/cjs/provider/index.js +96 -74
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/channel.js +9 -8
- package/dist/es2019/document/document-service.js +2 -1
- package/dist/es2019/provider/index.js +78 -58
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/channel.js +7 -6
- package/dist/esm/document/document-service.js +2 -1
- package/dist/esm/provider/index.js +96 -74
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/helpers/const.d.ts +1 -0
- package/dist/types/provider/index.d.ts +8 -2
- package/dist/types-ts4.5/helpers/const.d.ts +1 -0
- package/dist/types-ts4.5/provider/index.d.ts +8 -2
- package/package.json +1 -1
- package/report.api.md +2 -2
- package/tmp/api-report-tmp.d.ts +0 -581
|
@@ -45,24 +45,48 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
45
45
|
* @param data - Event data to emit to subscribers
|
|
46
46
|
*/
|
|
47
47
|
_defineProperty(_assertThisInitialized(_this), "emitCallback", function (evt, data) {
|
|
48
|
-
// When the provider is initialized early, we want the editor state
|
|
48
|
+
// When the provider is initialized early, we want to ensure the editor state exists after setup is called before emitting events
|
|
49
49
|
// to ensure that it is ready to listen to the events fired by NCS
|
|
50
50
|
if (_this.isPreinitializing) {
|
|
51
|
-
_this.
|
|
51
|
+
_this.onSetupPromise.then(function () {
|
|
52
52
|
return _this.emit(evt, data);
|
|
53
53
|
});
|
|
54
54
|
} else {
|
|
55
55
|
_this.emit(evt, data);
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
+
/**
|
|
59
|
+
* Wrapper to update document and metadata.
|
|
60
|
+
* Catches and logs any errors thrown by document service's updateDocument and updateMetadata methods and destroys the provider in case of errors.
|
|
61
|
+
* Passing the document, metadata, version (either from the initial draft or from collab service)
|
|
62
|
+
*/
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "updateDocumentAndMetadata", function (_ref) {
|
|
64
|
+
var doc = _ref.doc,
|
|
65
|
+
version = _ref.version,
|
|
66
|
+
metadata = _ref.metadata;
|
|
67
|
+
try {
|
|
68
|
+
_this.documentService.updateDocument({
|
|
69
|
+
doc: doc,
|
|
70
|
+
version: version,
|
|
71
|
+
metadata: metadata
|
|
72
|
+
});
|
|
73
|
+
_this.metadataService.updateMetadata(metadata);
|
|
74
|
+
_this.isProviderInitialized = true;
|
|
75
|
+
} catch (e) {
|
|
76
|
+
var _this$analyticsHelper;
|
|
77
|
+
(_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 ? void 0 : _this$analyticsHelper.sendErrorEvent(e, 'Failed to update with the init document, destroying provider');
|
|
78
|
+
// Stop events and connections to step us trying to talk to the backend with an invalid state.
|
|
79
|
+
_this.destroy();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
58
82
|
_defineProperty(_assertThisInitialized(_this), "initializeChannel", function () {
|
|
59
83
|
_this.emit('connecting', {
|
|
60
84
|
initial: true
|
|
61
85
|
});
|
|
62
86
|
var shouldInitialize = Boolean(_this.initialDraft) && !_this.isProviderInitialized;
|
|
63
|
-
_this.channel.on('connected', function (
|
|
64
|
-
var sid =
|
|
65
|
-
initialized =
|
|
87
|
+
_this.channel.on('connected', function (_ref2) {
|
|
88
|
+
var sid = _ref2.sid,
|
|
89
|
+
initialized = _ref2.initialized;
|
|
66
90
|
_this.sessionId = sid;
|
|
67
91
|
_this.emitCallback('connected', {
|
|
68
92
|
sid: sid,
|
|
@@ -81,22 +105,24 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
81
105
|
document = _this$initialDraft.document,
|
|
82
106
|
version = _this$initialDraft.version,
|
|
83
107
|
metadata = _this$initialDraft.metadata;
|
|
84
|
-
|
|
85
|
-
//
|
|
86
|
-
|
|
108
|
+
if (_this.isPreinitializing) {
|
|
109
|
+
// When the provider is initialized early, we wait until setup is called with a defined getState before the document is updated to ensure that the editor state exists
|
|
110
|
+
// The `isPreinitializing` check is an extra precaution behind a FF - if the state is already resolved, onSetupPromise will resolve immediately
|
|
111
|
+
_this.onSetupPromise.then(function () {
|
|
112
|
+
_this.updateDocumentAndMetadata({
|
|
113
|
+
doc: document,
|
|
114
|
+
version: version,
|
|
115
|
+
metadata: metadata
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
_this.updateDocumentAndMetadata({
|
|
87
120
|
doc: document,
|
|
88
121
|
version: version,
|
|
89
122
|
metadata: metadata
|
|
90
123
|
});
|
|
91
|
-
} catch (e) {
|
|
92
|
-
var _this$analyticsHelper;
|
|
93
|
-
(_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 ? void 0 : _this$analyticsHelper.sendErrorEvent(e, 'Failed to update the document on reconnect, destroying provider');
|
|
94
|
-
// Stop events and connections to step us trying to talk to the backend with an invalid state.
|
|
95
|
-
_this.destroy();
|
|
96
124
|
}
|
|
97
|
-
_this.metadataService.updateMetadata(metadata);
|
|
98
125
|
}
|
|
99
|
-
_this.isProviderInitialized = true;
|
|
100
126
|
}
|
|
101
127
|
// If already initialized, `connected` means reconnected
|
|
102
128
|
if (initialized && _this.disconnectedAt &&
|
|
@@ -106,25 +132,16 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
106
132
|
}
|
|
107
133
|
_this.participantsService.startInactiveRemover(_this.sessionId);
|
|
108
134
|
_this.disconnectedAt = undefined;
|
|
109
|
-
}).on('init', function (
|
|
110
|
-
var doc =
|
|
111
|
-
version =
|
|
112
|
-
metadata =
|
|
135
|
+
}).on('init', function (_ref3) {
|
|
136
|
+
var doc = _ref3.doc,
|
|
137
|
+
version = _ref3.version,
|
|
138
|
+
metadata = _ref3.metadata;
|
|
113
139
|
// Initial document and version
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
_this.metadataService.updateMetadata(metadata);
|
|
121
|
-
_this.isProviderInitialized = true;
|
|
122
|
-
} catch (e) {
|
|
123
|
-
var _this$analyticsHelper2;
|
|
124
|
-
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 ? void 0 : _this$analyticsHelper2.sendErrorEvent(e, 'Failed to update with the init document, destroying provider');
|
|
125
|
-
// Stop events and connections to step us trying to talk to the backend with an invalid state.
|
|
126
|
-
_this.destroy();
|
|
127
|
-
}
|
|
140
|
+
_this.updateDocumentAndMetadata({
|
|
141
|
+
doc: doc,
|
|
142
|
+
version: version,
|
|
143
|
+
metadata: metadata
|
|
144
|
+
});
|
|
128
145
|
}).on('restore', _this.documentService.onRestore).on('steps:added', _this.documentService.onStepsAdded).on('metadata:changed', _this.metadataService.onMetadataChanged).on('participant:telepointer', function (payload) {
|
|
129
146
|
return _this.participantsService.onParticipantTelepointer(payload, _this.sessionId);
|
|
130
147
|
}).on('presence:joined', _this.participantsService.onPresenceJoined).on('presence', _this.participantsService.onPresence).on('participant:left', _this.participantsService.onParticipantLeft).on('participant:updated', _this.participantsService.onParticipantUpdated).on('disconnect', _this.onDisconnected.bind(_assertThisInitialized(_this))).on('error', _this.onErrorHandled).on('status', _this.namespaceService.onNamespaceStatusChanged).connect(shouldInitialize);
|
|
@@ -150,20 +167,20 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
150
167
|
if (((_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.code) === NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED || ((_error$data2 = error.data) === null || _error$data2 === void 0 ? void 0 : _error$data2.code) === NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS) {
|
|
151
168
|
_this.documentService.onStepRejectedError();
|
|
152
169
|
} else {
|
|
153
|
-
var _this$
|
|
154
|
-
(_this$
|
|
170
|
+
var _this$analyticsHelper2;
|
|
171
|
+
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 ? void 0 : _this$analyticsHelper2.sendErrorEvent(error, 'Error handled');
|
|
155
172
|
var mappedError = errorCodeMapper(error);
|
|
156
173
|
// Temporarily only emit errors to Confluence very intentionally because they will disconnect the collab provider
|
|
157
174
|
if (mappedError) {
|
|
158
|
-
var _this$
|
|
159
|
-
(_this$
|
|
175
|
+
var _this$analyticsHelper3;
|
|
176
|
+
(_this$analyticsHelper3 = _this.analyticsHelper) === null || _this$analyticsHelper3 === void 0 ? void 0 : _this$analyticsHelper3.sendErrorEvent(mappedError, 'Error emitted');
|
|
160
177
|
_this.emitCallback('error', mappedError);
|
|
161
178
|
}
|
|
162
179
|
}
|
|
163
180
|
});
|
|
164
181
|
// Note: this gets triggered on page reload for Firefox (not other browsers) because of closeOnBeforeunload: false
|
|
165
|
-
_defineProperty(_assertThisInitialized(_this), "onDisconnected", function (
|
|
166
|
-
var reason =
|
|
182
|
+
_defineProperty(_assertThisInitialized(_this), "onDisconnected", function (_ref4) {
|
|
183
|
+
var reason = _ref4.reason;
|
|
167
184
|
_this.disconnectedAt = Date.now();
|
|
168
185
|
_this.participantsService.disconnect(reason, _this.sessionId);
|
|
169
186
|
});
|
|
@@ -179,22 +196,25 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
179
196
|
* @throws {GetCurrentStateError} Something went wrong while returning the current state
|
|
180
197
|
*/
|
|
181
198
|
_defineProperty(_assertThisInitialized(_this), "getCurrentState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
182
|
-
var _this$
|
|
199
|
+
var _this$analyticsHelper4;
|
|
183
200
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
184
201
|
while (1) switch (_context.prev = _context.next) {
|
|
185
202
|
case 0:
|
|
186
203
|
_context.prev = 0;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
204
|
+
_context.next = 3;
|
|
205
|
+
return _this.documentService.getCurrentState();
|
|
206
|
+
case 3:
|
|
207
|
+
return _context.abrupt("return", _context.sent);
|
|
208
|
+
case 6:
|
|
209
|
+
_context.prev = 6;
|
|
190
210
|
_context.t0 = _context["catch"](0);
|
|
191
|
-
(_this$
|
|
211
|
+
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 ? void 0 : _this$analyticsHelper4.sendErrorEvent(_context.t0, 'Error while returning ADF version of current draft document');
|
|
192
212
|
throw new GetCurrentStateError('Error while returning the current state of the draft document', _context.t0);
|
|
193
|
-
case
|
|
213
|
+
case 10:
|
|
194
214
|
case "end":
|
|
195
215
|
return _context.stop();
|
|
196
216
|
}
|
|
197
|
-
}, _callee, null, [[0,
|
|
217
|
+
}, _callee, null, [[0, 6]]);
|
|
198
218
|
})));
|
|
199
219
|
/**
|
|
200
220
|
* Return the final acknowledged (by NCS) ADF version of the current draft document, together with it's title and the current step version.
|
|
@@ -202,7 +222,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
202
222
|
* @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
|
|
203
223
|
*/
|
|
204
224
|
_defineProperty(_assertThisInitialized(_this), "getFinalAcknowledgedState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
205
|
-
var _this$
|
|
225
|
+
var _this$analyticsHelper5;
|
|
206
226
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
207
227
|
while (1) switch (_context2.prev = _context2.next) {
|
|
208
228
|
case 0:
|
|
@@ -214,7 +234,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
214
234
|
case 6:
|
|
215
235
|
_context2.prev = 6;
|
|
216
236
|
_context2.t0 = _context2["catch"](0);
|
|
217
|
-
(_this$
|
|
237
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(_context2.t0, 'Error while returning ADF version of the final draft document');
|
|
218
238
|
throw new GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', _context2.t0);
|
|
219
239
|
case 10:
|
|
220
240
|
case "end":
|
|
@@ -250,8 +270,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
250
270
|
_this.documentService = new DocumentService(_this.participantsService, _this.analyticsHelper, _this.channel.fetchCatchup, _this.emitCallback, _this.channel.broadcast, function () {
|
|
251
271
|
return _this.userId;
|
|
252
272
|
}, _this.onErrorHandled, _this.metadataService, _this.config.failedStepLimitBeforeCatchupOnPublish, _this.config.enableErrorOnFailedDocumentApply);
|
|
253
|
-
_this.
|
|
254
|
-
_this.
|
|
273
|
+
_this.onSetupPromise = new Promise(function (resolve) {
|
|
274
|
+
_this.resolveOnSetupPromise = resolve;
|
|
255
275
|
});
|
|
256
276
|
_this.namespaceService = new NamespaceService();
|
|
257
277
|
return _this;
|
|
@@ -285,21 +305,17 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
285
305
|
*/
|
|
286
306
|
}, {
|
|
287
307
|
key: "setup",
|
|
288
|
-
value: function setup(
|
|
289
|
-
var getState =
|
|
290
|
-
onSyncUpError =
|
|
308
|
+
value: function setup(_ref7) {
|
|
309
|
+
var getState = _ref7.getState,
|
|
310
|
+
onSyncUpError = _ref7.onSyncUpError;
|
|
291
311
|
this.checkForCookies();
|
|
292
312
|
try {
|
|
293
|
-
// if setup is called with no
|
|
313
|
+
// if setup is called with no getState and the initial draft is already provided
|
|
294
314
|
// set a flag to mark early provider setup
|
|
295
315
|
if (!getState && this.initialDraft) {
|
|
296
316
|
this.isPreinitializing = true;
|
|
297
317
|
}
|
|
298
318
|
if (getState) {
|
|
299
|
-
// if provider has already been initialized earlier, resolve the state once it is available
|
|
300
|
-
if (this.isPreinitializing) {
|
|
301
|
-
this.getStatePromiseResolve();
|
|
302
|
-
}
|
|
303
319
|
var collabPlugin = getState().plugins.find(function (p) {
|
|
304
320
|
return p.key === 'collab$';
|
|
305
321
|
});
|
|
@@ -312,14 +328,20 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
312
328
|
onSyncUpError: onSyncUpError,
|
|
313
329
|
clientId: this.clientId
|
|
314
330
|
});
|
|
331
|
+
|
|
332
|
+
// if provider has already been initialized earlier, resolve the setup promise once setup has been called with
|
|
333
|
+
// a defined getState (ie editor state is ready) AND after documentService sets the editor state
|
|
334
|
+
if (this.isPreinitializing) {
|
|
335
|
+
this.resolveOnSetupPromise();
|
|
336
|
+
}
|
|
315
337
|
}
|
|
316
338
|
if (!this.isChannelInitialized) {
|
|
317
339
|
this.initializeChannel();
|
|
318
340
|
this.isChannelInitialized = true;
|
|
319
341
|
}
|
|
320
342
|
} catch (initError) {
|
|
321
|
-
var _this$
|
|
322
|
-
(_this$
|
|
343
|
+
var _this$analyticsHelper6;
|
|
344
|
+
(_this$analyticsHelper6 = this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendErrorEvent(initError, 'Error while initialising the provider');
|
|
323
345
|
// Throw error so consumers are aware the initialisation failed when initialising themselves
|
|
324
346
|
throw new ProviderInitialisationError('Provider initialisation error', initError);
|
|
325
347
|
}
|
|
@@ -329,9 +351,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
329
351
|
key: "checkForCookies",
|
|
330
352
|
value: function checkForCookies() {
|
|
331
353
|
if (!global.navigator.cookieEnabled) {
|
|
332
|
-
var _this$
|
|
354
|
+
var _this$analyticsHelper7;
|
|
333
355
|
var initError = new ProviderInitialisationError('Cookies are not enabled. Please enable cookies to use collaborative editing.');
|
|
334
|
-
(_this$
|
|
356
|
+
(_this$analyticsHelper7 = this.analyticsHelper) === null || _this$analyticsHelper7 === void 0 ? void 0 : _this$analyticsHelper7.sendErrorEvent(initError, 'Error while initialising the provider - cookies disabled');
|
|
335
357
|
throw new ProviderInitialisationError('Provider initialisation error - cookies disabled', initError);
|
|
336
358
|
}
|
|
337
359
|
}
|
|
@@ -369,8 +391,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
369
391
|
}
|
|
370
392
|
this.documentService.send(_tr, _oldState, newState);
|
|
371
393
|
} catch (error) {
|
|
372
|
-
var _this$
|
|
373
|
-
(_this$
|
|
394
|
+
var _this$analyticsHelper8;
|
|
395
|
+
(_this$analyticsHelper8 = this.analyticsHelper) === null || _this$analyticsHelper8 === void 0 ? void 0 : _this$analyticsHelper8.sendErrorEvent(error, 'Error while sending steps for a transaction');
|
|
374
396
|
throw new SendTransactionError('Error while sending steps for a transaction', error);
|
|
375
397
|
}
|
|
376
398
|
}
|
|
@@ -398,9 +420,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
398
420
|
this.channel.broadcast('participant:telepointer', payload, callback);
|
|
399
421
|
}
|
|
400
422
|
} catch (error) {
|
|
401
|
-
var _this$
|
|
423
|
+
var _this$analyticsHelper9;
|
|
402
424
|
// We don't want to throw errors for Presence features as they tend to self-restore
|
|
403
|
-
(_this$
|
|
425
|
+
(_this$analyticsHelper9 = this.analyticsHelper) === null || _this$analyticsHelper9 === void 0 ? void 0 : _this$analyticsHelper9.sendErrorEvent(error, 'Error while sending message - telepointer');
|
|
404
426
|
}
|
|
405
427
|
}
|
|
406
428
|
}, {
|
|
@@ -439,8 +461,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
439
461
|
_get(_getPrototypeOf(Provider.prototype), "unsubscribeAll", this).call(this);
|
|
440
462
|
this.channel.disconnect();
|
|
441
463
|
} catch (error) {
|
|
442
|
-
var _this$
|
|
443
|
-
(_this$
|
|
464
|
+
var _this$analyticsHelper10;
|
|
465
|
+
(_this$analyticsHelper10 = this.analyticsHelper) === null || _this$analyticsHelper10 === void 0 ? void 0 : _this$analyticsHelper10.sendErrorEvent(error, 'Error while shutting down the collab provider');
|
|
444
466
|
throw new DestroyError('Error while shutting down the collab provider', error);
|
|
445
467
|
}
|
|
446
468
|
this.clearTimers();
|
|
@@ -460,8 +482,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
460
482
|
try {
|
|
461
483
|
this.metadataService.setTitle(title, broadcast);
|
|
462
484
|
} catch (error) {
|
|
463
|
-
var _this$
|
|
464
|
-
(_this$
|
|
485
|
+
var _this$analyticsHelper11;
|
|
486
|
+
(_this$analyticsHelper11 = this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendErrorEvent(error, 'Error while setting title');
|
|
465
487
|
throw new SetTitleError('Error while setting title', error);
|
|
466
488
|
}
|
|
467
489
|
}
|
|
@@ -479,8 +501,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
479
501
|
try {
|
|
480
502
|
this.metadataService.setEditorWidth(editorWidth, broadcast);
|
|
481
503
|
} catch (error) {
|
|
482
|
-
var _this$
|
|
483
|
-
(_this$
|
|
504
|
+
var _this$analyticsHelper12;
|
|
505
|
+
(_this$analyticsHelper12 = this.analyticsHelper) === null || _this$analyticsHelper12 === void 0 ? void 0 : _this$analyticsHelper12.sendErrorEvent(error, 'Error while setting editor width');
|
|
484
506
|
throw new SetEditorWidthError('Error while setting editor width', error);
|
|
485
507
|
}
|
|
486
508
|
}
|
|
@@ -496,8 +518,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
496
518
|
try {
|
|
497
519
|
this.metadataService.setMetadata(metadata);
|
|
498
520
|
} catch (error) {
|
|
499
|
-
var _this$
|
|
500
|
-
(_this$
|
|
521
|
+
var _this$analyticsHelper13;
|
|
522
|
+
(_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 ? void 0 : _this$analyticsHelper13.sendErrorEvent(error, 'Error while setting metadata');
|
|
501
523
|
throw new SetMetadataError('Error while setting metadata', error);
|
|
502
524
|
}
|
|
503
525
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -29,8 +29,14 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
29
29
|
* @param data - Event data to emit to subscribers
|
|
30
30
|
*/
|
|
31
31
|
private readonly emitCallback;
|
|
32
|
-
private
|
|
33
|
-
|
|
32
|
+
private onSetupPromise;
|
|
33
|
+
resolveOnSetupPromise: (value: void | PromiseLike<void>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Wrapper to update document and metadata.
|
|
36
|
+
* Catches and logs any errors thrown by document service's updateDocument and updateMetadata methods and destroys the provider in case of errors.
|
|
37
|
+
* Passing the document, metadata, version (either from the initial draft or from collab service)
|
|
38
|
+
*/
|
|
39
|
+
private readonly updateDocumentAndMetadata;
|
|
34
40
|
constructor(config: Config);
|
|
35
41
|
private initializeChannel;
|
|
36
42
|
private setUserId;
|
|
@@ -29,8 +29,14 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
29
29
|
* @param data - Event data to emit to subscribers
|
|
30
30
|
*/
|
|
31
31
|
private readonly emitCallback;
|
|
32
|
-
private
|
|
33
|
-
|
|
32
|
+
private onSetupPromise;
|
|
33
|
+
resolveOnSetupPromise: (value: void | PromiseLike<void>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Wrapper to update document and metadata.
|
|
36
|
+
* Catches and logs any errors thrown by document service's updateDocument and updateMetadata methods and destroys the provider in case of errors.
|
|
37
|
+
* Passing the document, metadata, version (either from the initial draft or from collab service)
|
|
38
|
+
*/
|
|
39
|
+
private readonly updateDocumentAndMetadata;
|
|
34
40
|
constructor(config: Config);
|
|
35
41
|
private initializeChannel;
|
|
36
42
|
private setUserId;
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -487,11 +487,11 @@ export class Provider extends Emitter<CollabEvents> implements BaseEvents {
|
|
|
487
487
|
// (undocumented)
|
|
488
488
|
getParticipants: () => ProviderParticipant[];
|
|
489
489
|
// (undocumented)
|
|
490
|
-
getStatePromiseResolve: (value: PromiseLike<void> | void) => void;
|
|
491
|
-
// (undocumented)
|
|
492
490
|
getUnconfirmedSteps: () => readonly Step[] | undefined;
|
|
493
491
|
// @deprecated
|
|
494
492
|
initialize(getState: () => EditorState): this;
|
|
493
|
+
// (undocumented)
|
|
494
|
+
resolveOnSetupPromise: (value: PromiseLike<void> | void) => void;
|
|
495
495
|
send(
|
|
496
496
|
_tr: Transaction | null,
|
|
497
497
|
_oldState: EditorState | null,
|