@atlaskit/collab-provider 19.0.4 → 19.0.6
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/analytics/analytics-helper.js +12 -11
- package/dist/cjs/api/api.js +43 -48
- package/dist/cjs/api/null-api.js +1 -1
- package/dist/cjs/channel.js +145 -159
- package/dist/cjs/document/catchupv2.js +23 -23
- package/dist/cjs/document/document-service.js +100 -100
- package/dist/cjs/helpers/utils.js +20 -20
- package/dist/cjs/namespace/namespace-service.js +4 -4
- package/dist/cjs/participants/participants-helper.js +10 -10
- package/dist/cjs/participants/participants-service.js +87 -87
- package/dist/cjs/provider/index.js +33 -33
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/analytics/analytics-helper.js +12 -11
- package/dist/esm/api/api.js +43 -48
- package/dist/esm/api/null-api.js +1 -1
- package/dist/esm/channel.js +145 -159
- package/dist/esm/document/catchupv2.js +23 -23
- package/dist/esm/document/document-service.js +100 -100
- package/dist/esm/helpers/utils.js +20 -20
- package/dist/esm/namespace/namespace-service.js +4 -4
- package/dist/esm/participants/participants-helper.js +10 -10
- package/dist/esm/participants/participants-service.js +87 -87
- package/dist/esm/provider/index.js +33 -33
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +7 -7
|
@@ -107,31 +107,31 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
107
107
|
_defineProperty(this, "handleAnonymousUser", /*#__PURE__*/function () {
|
|
108
108
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(payload) {
|
|
109
109
|
var _previousParticipant$, _ref2, _previousParticipant$2, _asset2;
|
|
110
|
-
var sessionId, previousParticipant, asset, name, _asset$name, _asset, _this$analyticsHelper, participant;
|
|
111
|
-
return _regeneratorRuntime.wrap(function
|
|
110
|
+
var sessionId, previousParticipant, asset, name, _asset$name, _asset, _this$analyticsHelper, participant, _t;
|
|
111
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
112
112
|
while (1) switch (_context.prev = _context.next) {
|
|
113
113
|
case 0:
|
|
114
114
|
sessionId = payload.sessionId;
|
|
115
115
|
previousParticipant = _this.participantsState.getBySessionId(sessionId);
|
|
116
116
|
name = (_previousParticipant$ = previousParticipant === null || previousParticipant === void 0 ? void 0 : previousParticipant.name) !== null && _previousParticipant$ !== void 0 ? _previousParticipant$ : '';
|
|
117
117
|
if (!(!previousParticipant && _this.fetchAnonymousAsset)) {
|
|
118
|
-
_context.next =
|
|
118
|
+
_context.next = 5;
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
|
-
_context.prev =
|
|
122
|
-
_context.next =
|
|
121
|
+
_context.prev = 1;
|
|
122
|
+
_context.next = 2;
|
|
123
123
|
return _this.fetchAnonymousAsset(payload.presenceId);
|
|
124
|
-
case
|
|
124
|
+
case 2:
|
|
125
125
|
asset = _context.sent;
|
|
126
|
-
_context.next =
|
|
126
|
+
_context.next = 4;
|
|
127
127
|
break;
|
|
128
|
-
case
|
|
129
|
-
_context.prev =
|
|
130
|
-
|
|
131
|
-
(_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 || _this$analyticsHelper.sendErrorEvent(
|
|
132
|
-
case
|
|
128
|
+
case 3:
|
|
129
|
+
_context.prev = 3;
|
|
130
|
+
_t = _context["catch"](1);
|
|
131
|
+
(_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 || _this$analyticsHelper.sendErrorEvent(_t, 'Error while fetching anonymous assets');
|
|
132
|
+
case 4:
|
|
133
133
|
name = (_asset$name = (_asset = asset) === null || _asset === void 0 ? void 0 : _asset.name) !== null && _asset$name !== void 0 ? _asset$name : name;
|
|
134
|
-
case
|
|
134
|
+
case 5:
|
|
135
135
|
participant = _objectSpread(_objectSpread({}, payload), {}, {
|
|
136
136
|
lastActive: payload.timestamp,
|
|
137
137
|
name: name,
|
|
@@ -144,11 +144,11 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
144
144
|
_this.emitPresence({
|
|
145
145
|
joined: [participant]
|
|
146
146
|
}, 'handling updated anonymous participant');
|
|
147
|
-
case
|
|
147
|
+
case 6:
|
|
148
148
|
case "end":
|
|
149
149
|
return _context.stop();
|
|
150
150
|
}
|
|
151
|
-
}, _callee, null, [[
|
|
151
|
+
}, _callee, null, [[1, 3]]);
|
|
152
152
|
}));
|
|
153
153
|
return function (_x) {
|
|
154
154
|
return _ref.apply(this, arguments);
|
|
@@ -161,46 +161,46 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
161
161
|
*/
|
|
162
162
|
_defineProperty(this, "updateParticipantEager", /*#__PURE__*/function () {
|
|
163
163
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(payload) {
|
|
164
|
-
var userId, participant, _this$analyticsHelper2, previousParticipant;
|
|
165
|
-
return _regeneratorRuntime.wrap(function
|
|
164
|
+
var userId, participant, _this$analyticsHelper2, previousParticipant, _t2;
|
|
165
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
166
166
|
while (1) switch (_context2.prev = _context2.next) {
|
|
167
167
|
case 0:
|
|
168
168
|
userId = payload.userId;
|
|
169
169
|
if (!(!userId || userId === UNIDENTIFIED)) {
|
|
170
|
-
_context2.next =
|
|
170
|
+
_context2.next = 2;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
|
-
_context2.next =
|
|
173
|
+
_context2.next = 1;
|
|
174
174
|
return _this.handleAnonymousUser(payload);
|
|
175
|
-
case
|
|
175
|
+
case 1:
|
|
176
176
|
return _context2.abrupt("return");
|
|
177
|
-
case
|
|
178
|
-
_context2.prev =
|
|
179
|
-
_context2.next =
|
|
177
|
+
case 2:
|
|
178
|
+
_context2.prev = 2;
|
|
179
|
+
_context2.next = 3;
|
|
180
180
|
return enrichParticipant( // userId _must_ be defined, this lets the compiler know
|
|
181
181
|
_objectSpread(_objectSpread({}, payload), {}, {
|
|
182
182
|
userId: userId
|
|
183
183
|
}), _this.getUser);
|
|
184
|
-
case
|
|
184
|
+
case 3:
|
|
185
185
|
participant = _context2.sent;
|
|
186
|
-
_context2.next =
|
|
186
|
+
_context2.next = 5;
|
|
187
187
|
break;
|
|
188
|
-
case
|
|
189
|
-
_context2.prev =
|
|
190
|
-
|
|
188
|
+
case 4:
|
|
189
|
+
_context2.prev = 4;
|
|
190
|
+
_t2 = _context2["catch"](2);
|
|
191
191
|
// We don't want to throw errors for Presence features as they tend to self-restore
|
|
192
|
-
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 || _this$analyticsHelper2.sendErrorEvent(
|
|
193
|
-
case
|
|
192
|
+
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 || _this$analyticsHelper2.sendErrorEvent(_t2, 'Error while enriching participant');
|
|
193
|
+
case 5:
|
|
194
194
|
if (participant) {
|
|
195
|
-
_context2.next =
|
|
195
|
+
_context2.next = 6;
|
|
196
196
|
break;
|
|
197
197
|
}
|
|
198
198
|
return _context2.abrupt("return");
|
|
199
|
-
case
|
|
199
|
+
case 6:
|
|
200
200
|
previousParticipant = _this.participantsState.getBySessionId(participant.sessionId);
|
|
201
201
|
_this.participantsState.setBySessionId(participant.sessionId, participant);
|
|
202
202
|
if (!previousParticipant) {
|
|
203
|
-
_context2.next =
|
|
203
|
+
_context2.next = 7;
|
|
204
204
|
break;
|
|
205
205
|
}
|
|
206
206
|
if (_this.hasPresenceActivityChanged(previousParticipant, participant)) {
|
|
@@ -210,16 +210,16 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
210
210
|
}, 'handling participant activity changed event');
|
|
211
211
|
}
|
|
212
212
|
return _context2.abrupt("return");
|
|
213
|
-
case
|
|
213
|
+
case 7:
|
|
214
214
|
// Only emit the joined presence event if this is a new participant
|
|
215
215
|
_this.emitPresence({
|
|
216
216
|
joined: [participant]
|
|
217
217
|
}, 'handling participant updated event');
|
|
218
|
-
case
|
|
218
|
+
case 8:
|
|
219
219
|
case "end":
|
|
220
220
|
return _context2.stop();
|
|
221
221
|
}
|
|
222
|
-
}, _callee2, null, [[
|
|
222
|
+
}, _callee2, null, [[2, 4]]);
|
|
223
223
|
}));
|
|
224
224
|
return function (_x2) {
|
|
225
225
|
return _ref3.apply(this, arguments);
|
|
@@ -239,24 +239,24 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
239
239
|
_defineProperty(this, "updateParticipantLazy", /*#__PURE__*/function () {
|
|
240
240
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(payload) {
|
|
241
241
|
var userId, sessionId, previousParticipant, _this$batchProps, _participant, participant;
|
|
242
|
-
return _regeneratorRuntime.wrap(function
|
|
242
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
243
243
|
while (1) switch (_context3.prev = _context3.next) {
|
|
244
244
|
case 0:
|
|
245
245
|
userId = payload.userId, sessionId = payload.sessionId; // anonymous users always skip hydration but are marked as hydrated since we don't want to attempt to fetch data
|
|
246
246
|
// this can cause interesting behavior if batchProps.participantsLimit exists
|
|
247
247
|
// for example if limit = 5 and we've hydrated 5 real users and 2 anonymous users join, it'll look like we've hydrated 7 users
|
|
248
248
|
if (!(!userId || userId === UNIDENTIFIED)) {
|
|
249
|
-
_context3.next =
|
|
249
|
+
_context3.next = 2;
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
|
-
_context3.next =
|
|
252
|
+
_context3.next = 1;
|
|
253
253
|
return _this.handleAnonymousUser(payload);
|
|
254
|
-
case
|
|
254
|
+
case 1:
|
|
255
255
|
return _context3.abrupt("return");
|
|
256
|
-
case
|
|
256
|
+
case 2:
|
|
257
257
|
previousParticipant = _this.participantsState.getBySessionId(sessionId);
|
|
258
258
|
if (previousParticipant) {
|
|
259
|
-
_context3.next =
|
|
259
|
+
_context3.next = 4;
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
262
|
_participant = _objectSpread(_objectSpread({}, payload), {}, {
|
|
@@ -268,14 +268,14 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
268
268
|
});
|
|
269
269
|
_this.participantsState.setBySessionId(sessionId, _participant);
|
|
270
270
|
if (!isAIProviderID(userId)) {
|
|
271
|
-
_context3.next =
|
|
271
|
+
_context3.next = 3;
|
|
272
272
|
break;
|
|
273
273
|
}
|
|
274
274
|
_this.emitPresence({
|
|
275
275
|
joined: [_participant]
|
|
276
276
|
}, 'handling updated new agent lazy');
|
|
277
277
|
return _context3.abrupt("return");
|
|
278
|
-
case
|
|
278
|
+
case 3:
|
|
279
279
|
// prevent running multiple debounces concurrently
|
|
280
280
|
if (!_this.currentlyPollingFetchUsers) {
|
|
281
281
|
void _this.batchFetchUsers();
|
|
@@ -291,7 +291,7 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
291
291
|
}, 'handling updated new participant lazy');
|
|
292
292
|
}
|
|
293
293
|
return _context3.abrupt("return");
|
|
294
|
-
case
|
|
294
|
+
case 4:
|
|
295
295
|
// would handle activity and lastActive changes
|
|
296
296
|
participant = _objectSpread(_objectSpread({}, previousParticipant), {}, {
|
|
297
297
|
presenceActivity: payload.presenceActivity,
|
|
@@ -305,7 +305,7 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
305
305
|
}, 'handling participant activity changed event');
|
|
306
306
|
}
|
|
307
307
|
return _context3.abrupt("return");
|
|
308
|
-
case
|
|
308
|
+
case 5:
|
|
309
309
|
case "end":
|
|
310
310
|
return _context3.stop();
|
|
311
311
|
}
|
|
@@ -317,20 +317,20 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
317
317
|
}());
|
|
318
318
|
_defineProperty(this, "onParticipantUpdated", /*#__PURE__*/function () {
|
|
319
319
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(payload) {
|
|
320
|
-
return _regeneratorRuntime.wrap(function
|
|
320
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
321
321
|
while (1) switch (_context4.prev = _context4.next) {
|
|
322
322
|
case 0:
|
|
323
323
|
if (!_this.batchProps) {
|
|
324
|
-
_context4.next =
|
|
324
|
+
_context4.next = 1;
|
|
325
325
|
break;
|
|
326
326
|
}
|
|
327
327
|
_this.updateParticipantLazy(payload);
|
|
328
|
-
_context4.next =
|
|
328
|
+
_context4.next = 2;
|
|
329
329
|
break;
|
|
330
|
-
case
|
|
331
|
-
_context4.next =
|
|
330
|
+
case 1:
|
|
331
|
+
_context4.next = 2;
|
|
332
332
|
return _this.updateParticipantEager(payload);
|
|
333
|
-
case
|
|
333
|
+
case 2:
|
|
334
334
|
case "end":
|
|
335
335
|
return _context4.stop();
|
|
336
336
|
}
|
|
@@ -453,33 +453,33 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
453
453
|
});
|
|
454
454
|
_defineProperty(this, "enrichParticipants", /*#__PURE__*/function () {
|
|
455
455
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(props) {
|
|
456
|
-
var participants, _props$onError, _this$analyticsHelper5;
|
|
457
|
-
return _regeneratorRuntime.wrap(function
|
|
456
|
+
var participants, _props$onError, _this$analyticsHelper5, _t3;
|
|
457
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
458
458
|
while (1) switch (_context5.prev = _context5.next) {
|
|
459
459
|
case 0:
|
|
460
460
|
_context5.prev = 0;
|
|
461
|
-
_context5.next =
|
|
461
|
+
_context5.next = 1;
|
|
462
462
|
return fetchParticipants(_this.participantsState, props);
|
|
463
|
-
case
|
|
463
|
+
case 1:
|
|
464
464
|
participants = _context5.sent;
|
|
465
465
|
if (participants.length) {
|
|
466
466
|
_this.emitPresence({
|
|
467
467
|
joined: participants
|
|
468
468
|
}, 'handling participant updated event');
|
|
469
469
|
}
|
|
470
|
-
_context5.next =
|
|
470
|
+
_context5.next = 3;
|
|
471
471
|
break;
|
|
472
|
-
case
|
|
473
|
-
_context5.prev =
|
|
474
|
-
|
|
475
|
-
(_props$onError = props.onError) === null || _props$onError === void 0 || _props$onError.call(props,
|
|
472
|
+
case 2:
|
|
473
|
+
_context5.prev = 2;
|
|
474
|
+
_t3 = _context5["catch"](0);
|
|
475
|
+
(_props$onError = props.onError) === null || _props$onError === void 0 || _props$onError.call(props, _t3);
|
|
476
476
|
_this.hasBatchFetchError = true;
|
|
477
|
-
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(
|
|
478
|
-
case
|
|
477
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(_t3, 'Failed while fetching participants');
|
|
478
|
+
case 3:
|
|
479
479
|
case "end":
|
|
480
480
|
return _context5.stop();
|
|
481
481
|
}
|
|
482
|
-
}, _callee5, null, [[0,
|
|
482
|
+
}, _callee5, null, [[0, 2]]);
|
|
483
483
|
}));
|
|
484
484
|
return function (_x5) {
|
|
485
485
|
return _ref6.apply(this, arguments);
|
|
@@ -499,67 +499,67 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
499
499
|
*/
|
|
500
500
|
_defineProperty(this, "batchFetchUsers", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
501
501
|
var _this$batchProps2, debounceTime, participantsLimit, size;
|
|
502
|
-
return _regeneratorRuntime.wrap(function
|
|
502
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
503
503
|
while (1) switch (_context6.prev = _context6.next) {
|
|
504
504
|
case 0:
|
|
505
505
|
if (_this.batchProps) {
|
|
506
|
-
_context6.next =
|
|
506
|
+
_context6.next = 1;
|
|
507
507
|
break;
|
|
508
508
|
}
|
|
509
509
|
return _context6.abrupt("return");
|
|
510
|
-
case
|
|
510
|
+
case 1:
|
|
511
511
|
if (!_this.hasBatchFetchError) {
|
|
512
|
-
_context6.next =
|
|
512
|
+
_context6.next = 2;
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
515
|
// no retry logic yet
|
|
516
516
|
logger('Cannot continue to fetch users due to fetch error');
|
|
517
517
|
clearTimeout(_this.presenceFetchTimeout);
|
|
518
518
|
return _context6.abrupt("return");
|
|
519
|
-
case
|
|
519
|
+
case 2:
|
|
520
520
|
_this.currentlyPollingFetchUsers = true;
|
|
521
521
|
clearTimeout(_this.presenceFetchTimeout);
|
|
522
522
|
_this$batchProps2 = _this.batchProps, debounceTime = _this$batchProps2.debounceTime, participantsLimit = _this$batchProps2.participantsLimit;
|
|
523
523
|
if (!participantsLimit) {
|
|
524
|
-
_context6.next =
|
|
524
|
+
_context6.next = 6;
|
|
525
525
|
break;
|
|
526
526
|
}
|
|
527
527
|
size = _this.participantsState.getUniqueParticipants({
|
|
528
528
|
isHydrated: true
|
|
529
529
|
}).length;
|
|
530
530
|
if (!(size < participantsLimit)) {
|
|
531
|
-
_context6.next =
|
|
531
|
+
_context6.next = 4;
|
|
532
532
|
break;
|
|
533
533
|
}
|
|
534
|
-
_context6.next =
|
|
534
|
+
_context6.next = 3;
|
|
535
535
|
return _this.enrichParticipants(_objectSpread(_objectSpread({}, _this.batchProps), {}, {
|
|
536
536
|
batchSize: participantsLimit
|
|
537
537
|
}));
|
|
538
|
-
case
|
|
538
|
+
case 3:
|
|
539
539
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
540
|
-
_context6.next =
|
|
540
|
+
_context6.next = 5;
|
|
541
541
|
break;
|
|
542
|
-
case
|
|
542
|
+
case 4:
|
|
543
543
|
_this.currentlyPollingFetchUsers = false;
|
|
544
|
-
case
|
|
545
|
-
_context6.next =
|
|
544
|
+
case 5:
|
|
545
|
+
_context6.next = 8;
|
|
546
546
|
break;
|
|
547
|
-
case
|
|
547
|
+
case 6:
|
|
548
548
|
if (participantsLimit) {
|
|
549
|
-
_context6.next =
|
|
549
|
+
_context6.next = 8;
|
|
550
550
|
break;
|
|
551
551
|
}
|
|
552
|
-
_context6.next =
|
|
552
|
+
_context6.next = 7;
|
|
553
553
|
return _this.enrichParticipants(_this.batchProps);
|
|
554
|
-
case
|
|
554
|
+
case 7:
|
|
555
555
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
556
|
-
case
|
|
556
|
+
case 8:
|
|
557
557
|
if (_this.currentlyPollingFetchUsers) {
|
|
558
558
|
_this.presenceFetchTimeout = window.setTimeout(function () {
|
|
559
559
|
return _this.batchFetchUsers();
|
|
560
560
|
}, debounceTime !== null && debounceTime !== void 0 ? debounceTime : DEFAULT_FETCH_USERS_INTERVAL);
|
|
561
561
|
}
|
|
562
|
-
case
|
|
562
|
+
case 9:
|
|
563
563
|
case "end":
|
|
564
564
|
return _context6.stop();
|
|
565
565
|
}
|
|
@@ -571,17 +571,17 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
571
571
|
* @example
|
|
572
572
|
*/
|
|
573
573
|
_defineProperty(this, "initializeFirstBatchFetchUsers", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
574
|
-
return _regeneratorRuntime.wrap(function
|
|
574
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
575
575
|
while (1) switch (_context7.prev = _context7.next) {
|
|
576
576
|
case 0:
|
|
577
|
-
_context7.next =
|
|
577
|
+
_context7.next = 1;
|
|
578
578
|
return new Promise(function (r) {
|
|
579
579
|
var _this$batchProps$debo, _this$batchProps3;
|
|
580
580
|
return window.setTimeout(r, (_this$batchProps$debo = (_this$batchProps3 = _this.batchProps) === null || _this$batchProps3 === void 0 ? void 0 : _this$batchProps3.debounceTime) !== null && _this$batchProps$debo !== void 0 ? _this$batchProps$debo : DEFAULT_FETCH_USERS_INTERVAL);
|
|
581
581
|
});
|
|
582
|
-
case
|
|
582
|
+
case 1:
|
|
583
583
|
void _this.batchFetchUsers();
|
|
584
|
-
case
|
|
584
|
+
case 2:
|
|
585
585
|
case "end":
|
|
586
586
|
return _context7.stop();
|
|
587
587
|
}
|
|
@@ -192,17 +192,17 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
192
192
|
}).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(_this)).on('error', _this.onErrorHandled).on('status', /*#__PURE__*/function () {
|
|
193
193
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(status) {
|
|
194
194
|
var isLocked;
|
|
195
|
-
return _regeneratorRuntime.wrap(function
|
|
195
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
196
196
|
while (1) switch (_context.prev = _context.next) {
|
|
197
197
|
case 0:
|
|
198
|
-
_context.next =
|
|
198
|
+
_context.next = 1;
|
|
199
199
|
return _this.namespaceService.onNamespaceStatusChanged(status);
|
|
200
|
-
case
|
|
200
|
+
case 1:
|
|
201
201
|
isLocked = _this.namespaceService.getIsNamespaceLocked();
|
|
202
202
|
_this.emit('namespace-lock:check', {
|
|
203
203
|
isLocked: isLocked
|
|
204
204
|
});
|
|
205
|
-
case
|
|
205
|
+
case 2:
|
|
206
206
|
case "end":
|
|
207
207
|
return _context.stop();
|
|
208
208
|
}
|
|
@@ -295,25 +295,25 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
295
295
|
* @throws {GetCurrentStateError} Something went wrong while returning the current state
|
|
296
296
|
*/
|
|
297
297
|
_defineProperty(_this, "getCurrentState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
298
|
-
var _this$analyticsHelper4;
|
|
299
|
-
return _regeneratorRuntime.wrap(function
|
|
298
|
+
var _this$analyticsHelper4, _t;
|
|
299
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
300
300
|
while (1) switch (_context2.prev = _context2.next) {
|
|
301
301
|
case 0:
|
|
302
302
|
_context2.prev = 0;
|
|
303
|
-
_context2.next =
|
|
303
|
+
_context2.next = 1;
|
|
304
304
|
return _this.documentService.getCurrentState();
|
|
305
|
-
case
|
|
305
|
+
case 1:
|
|
306
306
|
return _context2.abrupt("return", _context2.sent);
|
|
307
|
-
case
|
|
308
|
-
_context2.prev =
|
|
309
|
-
|
|
310
|
-
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 || _this$analyticsHelper4.sendErrorEvent(
|
|
311
|
-
throw new GetCurrentStateError('Error while returning the current state of the draft document',
|
|
312
|
-
case
|
|
307
|
+
case 2:
|
|
308
|
+
_context2.prev = 2;
|
|
309
|
+
_t = _context2["catch"](0);
|
|
310
|
+
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 || _this$analyticsHelper4.sendErrorEvent(_t, 'Error while returning ADF version of current draft document');
|
|
311
|
+
throw new GetCurrentStateError('Error while returning the current state of the draft document', _t);
|
|
312
|
+
case 3:
|
|
313
313
|
case "end":
|
|
314
314
|
return _context2.stop();
|
|
315
315
|
}
|
|
316
|
-
}, _callee2, null, [[0,
|
|
316
|
+
}, _callee2, null, [[0, 2]]);
|
|
317
317
|
})));
|
|
318
318
|
/**
|
|
319
319
|
* Return the final acknowledged (by NCS) ADF version of the current draft document, together with it's title and the current step version.
|
|
@@ -322,25 +322,25 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
322
322
|
*/
|
|
323
323
|
_defineProperty(_this, "getFinalAcknowledgedState", /*#__PURE__*/function () {
|
|
324
324
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(reason) {
|
|
325
|
-
var _this$analyticsHelper5;
|
|
326
|
-
return _regeneratorRuntime.wrap(function
|
|
325
|
+
var _this$analyticsHelper5, _t2;
|
|
326
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
327
327
|
while (1) switch (_context3.prev = _context3.next) {
|
|
328
328
|
case 0:
|
|
329
329
|
_context3.prev = 0;
|
|
330
|
-
_context3.next =
|
|
330
|
+
_context3.next = 1;
|
|
331
331
|
return _this.documentService.getFinalAcknowledgedState(reason);
|
|
332
|
-
case
|
|
332
|
+
case 1:
|
|
333
333
|
return _context3.abrupt("return", _context3.sent);
|
|
334
|
-
case
|
|
335
|
-
_context3.prev =
|
|
336
|
-
|
|
337
|
-
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(
|
|
338
|
-
throw new GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document',
|
|
339
|
-
case
|
|
334
|
+
case 2:
|
|
335
|
+
_context3.prev = 2;
|
|
336
|
+
_t2 = _context3["catch"](0);
|
|
337
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(_t2, 'Error while returning ADF version of the final draft document');
|
|
338
|
+
throw new GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', _t2);
|
|
339
|
+
case 3:
|
|
340
340
|
case "end":
|
|
341
341
|
return _context3.stop();
|
|
342
342
|
}
|
|
343
|
-
}, _callee3, null, [[0,
|
|
343
|
+
}, _callee3, null, [[0, 2]]);
|
|
344
344
|
}));
|
|
345
345
|
return function (_x2) {
|
|
346
346
|
return _ref7.apply(this, arguments);
|
|
@@ -386,23 +386,23 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
386
386
|
_defineProperty(_this, "fetchMore", /*#__PURE__*/function () {
|
|
387
387
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(props) {
|
|
388
388
|
var _props$fetchSize;
|
|
389
|
-
return _regeneratorRuntime.wrap(function
|
|
389
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
390
390
|
while (1) switch (_context4.prev = _context4.next) {
|
|
391
391
|
case 0:
|
|
392
392
|
if (!_this.config.batchProps) {
|
|
393
|
-
_context4.next =
|
|
393
|
+
_context4.next = 2;
|
|
394
394
|
break;
|
|
395
395
|
}
|
|
396
|
-
_context4.next =
|
|
396
|
+
_context4.next = 1;
|
|
397
397
|
return _this.participantsService.enrichParticipants(_objectSpread(_objectSpread({}, _this.config.batchProps), {}, {
|
|
398
398
|
batchSize: (_props$fetchSize = props === null || props === void 0 ? void 0 : props.fetchSize) !== null && _props$fetchSize !== void 0 ? _props$fetchSize : _this.config.batchProps.batchSize
|
|
399
399
|
}));
|
|
400
|
-
case
|
|
401
|
-
_context4.next =
|
|
400
|
+
case 1:
|
|
401
|
+
_context4.next = 3;
|
|
402
402
|
break;
|
|
403
|
-
case
|
|
403
|
+
case 2:
|
|
404
404
|
throw new Error('Must provide batch properties to use fetchMore');
|
|
405
|
-
case
|
|
405
|
+
case 3:
|
|
406
406
|
case "end":
|
|
407
407
|
return _context4.stop();
|
|
408
408
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.6",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"team": "Editor: Collaboration"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/adf-utils": "^19.
|
|
29
|
+
"@atlaskit/adf-utils": "^19.32.0",
|
|
30
30
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
31
31
|
"@atlaskit/analytics-listeners": "^10.1.0",
|
|
32
32
|
"@atlaskit/anonymous-assets": "^1.1.0",
|
|
33
33
|
"@atlaskit/atlassian-context": "^0.9.0",
|
|
34
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
34
|
+
"@atlaskit/editor-json-transformer": "^8.33.0",
|
|
35
35
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
36
36
|
"@atlaskit/feature-gate-js-client": "^5.7.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
38
38
|
"@atlaskit/prosemirror-collab": "^0.22.0",
|
|
39
|
-
"@atlaskit/react-ufo": "^6.
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
39
|
+
"@atlaskit/react-ufo": "^6.6.0",
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^86.0.0",
|
|
41
41
|
"@atlaskit/ufo": "^0.5.0",
|
|
42
42
|
"@atlaskit/util-service-support": "^6.4.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@atlaskit/adf-schema": "^52.
|
|
66
|
+
"@atlaskit/adf-schema": "^52.15.0",
|
|
67
67
|
"@atlassian/a11y-jest-testing": "^0.11.0",
|
|
68
68
|
"@atlassian/feature-flags-test-utils": "^1.1.0"
|
|
69
69
|
},
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@atlaskit/editor-common": "^114.
|
|
79
|
+
"@atlaskit/editor-common": "^114.54.0"
|
|
80
80
|
}
|
|
81
81
|
}
|