@atlaskit/collab-provider 10.2.1 → 10.3.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 +19 -0
- package/dist/cjs/analytics/analytics-helper.js +1 -2
- package/dist/cjs/api/api.js +5 -7
- package/dist/cjs/api/null-api.js +1 -2
- package/dist/cjs/channel.js +34 -37
- package/dist/cjs/connectivity/network.js +1 -2
- package/dist/cjs/connectivity/reconnect-helper.js +1 -2
- package/dist/cjs/document/document-service.js +75 -49
- package/dist/cjs/document/null-document-service.js +1 -2
- package/dist/cjs/document/step-queue-state.js +1 -2
- package/dist/cjs/emitter.js +1 -2
- package/dist/cjs/errors/custom-errors.js +54 -69
- package/dist/cjs/metadata/metadata-service.js +1 -2
- package/dist/cjs/participants/participants-service.js +21 -26
- package/dist/cjs/provider/index.js +37 -34
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/document/document-service.js +67 -46
- package/dist/es2019/participants/participants-service.js +18 -22
- package/dist/es2019/provider/index.js +5 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/analytics/analytics-helper.js +1 -2
- package/dist/esm/api/api.js +5 -7
- package/dist/esm/api/null-api.js +1 -2
- package/dist/esm/channel.js +34 -37
- package/dist/esm/connectivity/network.js +1 -2
- package/dist/esm/connectivity/reconnect-helper.js +1 -2
- package/dist/esm/document/document-service.js +75 -49
- package/dist/esm/document/null-document-service.js +1 -2
- package/dist/esm/document/step-queue-state.js +1 -2
- package/dist/esm/emitter.js +1 -2
- package/dist/esm/errors/custom-errors.js +54 -69
- package/dist/esm/metadata/metadata-service.js +1 -2
- package/dist/esm/participants/participants-service.js +21 -26
- package/dist/esm/provider/index.js +37 -34
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/document/document-service.d.ts +1 -2
- package/dist/types-ts4.5/document/document-service.d.ts +1 -2
- package/package.json +5 -2
|
@@ -51,7 +51,7 @@ var MetadataService = exports.MetadataService = /*#__PURE__*/function () {
|
|
|
51
51
|
this.providerEmitCallback = providerEmitCallback;
|
|
52
52
|
this.broadcastMetadata = broadcastMetadata;
|
|
53
53
|
}
|
|
54
|
-
(0, _createClass2.default)(MetadataService, [{
|
|
54
|
+
return (0, _createClass2.default)(MetadataService, [{
|
|
55
55
|
key: "setTitle",
|
|
56
56
|
value: function setTitle(title, broadcast) {
|
|
57
57
|
if (broadcast) {
|
|
@@ -72,5 +72,4 @@ var MetadataService = exports.MetadataService = /*#__PURE__*/function () {
|
|
|
72
72
|
this.metadata.editorWidth = editorWidth;
|
|
73
73
|
}
|
|
74
74
|
}]);
|
|
75
|
-
return MetadataService;
|
|
76
75
|
}();
|
|
@@ -13,7 +13,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
var _disconnectedReasonMapper = require("../disconnected-reason-mapper");
|
|
14
14
|
var _const = require("../helpers/const");
|
|
15
15
|
var _telepointersHelper = require("./telepointers-helper");
|
|
16
|
-
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
17
16
|
var _participantsHelper = require("./participants-helper");
|
|
18
17
|
var _participantsState = require("./participants-state");
|
|
19
18
|
var _utils = require("../helpers/utils");
|
|
@@ -44,8 +43,7 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
44
43
|
var getAIProviderActiveIds = arguments.length > 8 ? arguments[8] : undefined;
|
|
45
44
|
(0, _classCallCheck2.default)(this, ParticipantsService);
|
|
46
45
|
(0, _defineProperty2.default)(this, "sendAIProviderChanged", function (payload) {
|
|
47
|
-
|
|
48
|
-
if (isFacepileExperimentEnabled && payload.providerId) {
|
|
46
|
+
if (payload.providerId) {
|
|
49
47
|
for (var propKey in payload.permit) {
|
|
50
48
|
if (payload.permit.hasOwnProperty(propKey)) {
|
|
51
49
|
payload.permit[propKey] = false;
|
|
@@ -155,29 +153,27 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
155
153
|
* We emit the `presence` event to update the active avatars in the editor.
|
|
156
154
|
*/
|
|
157
155
|
(0, _defineProperty2.default)(this, "onParticipantLeft", function (payload) {
|
|
156
|
+
var _payload$data;
|
|
158
157
|
var sessionId = payload.sessionId;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
userId: undefined,
|
|
177
|
-
clientId: ''
|
|
178
|
-
});
|
|
158
|
+
|
|
159
|
+
// When an agent leaves a session, the backend service returns the original user's
|
|
160
|
+
// session ID accompanied by a payload containing the agent's session ID.
|
|
161
|
+
// If the user session leaves, we also want to remove all agent sessions associated.
|
|
162
|
+
if (payload !== null && payload !== void 0 && (_payload$data = payload.data) !== null && _payload$data !== void 0 && _payload$data.sessionId && (0, _utils.isAIProviderID)(payload.data.sessionId)) {
|
|
163
|
+
sessionId = payload.data.sessionId;
|
|
164
|
+
} else {
|
|
165
|
+
var associatedAgents = _this.getAIProviderParticipants().filter(function (ap) {
|
|
166
|
+
return ap.sessionId.endsWith(sessionId);
|
|
167
|
+
});
|
|
168
|
+
associatedAgents.forEach(function (agent) {
|
|
169
|
+
_this.onParticipantLeft({
|
|
170
|
+
sessionId: sessionId,
|
|
171
|
+
timestamp: payload.timestamp,
|
|
172
|
+
data: agent,
|
|
173
|
+
userId: undefined,
|
|
174
|
+
clientId: ''
|
|
179
175
|
});
|
|
180
|
-
}
|
|
176
|
+
});
|
|
181
177
|
}
|
|
182
178
|
_this.participantsState.removeBySessionId(sessionId);
|
|
183
179
|
_this.emitPresence({
|
|
@@ -405,7 +401,7 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
405
401
|
this.setUserId = setUserId;
|
|
406
402
|
this.getAIProviderActiveIds = getAIProviderActiveIds;
|
|
407
403
|
}
|
|
408
|
-
(0, _createClass2.default)(ParticipantsService, [{
|
|
404
|
+
return (0, _createClass2.default)(ParticipantsService, [{
|
|
409
405
|
key: "emitTelepointersFromSteps",
|
|
410
406
|
value:
|
|
411
407
|
/**
|
|
@@ -422,5 +418,4 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
422
418
|
});
|
|
423
419
|
}
|
|
424
420
|
}]);
|
|
425
|
-
return ParticipantsService;
|
|
426
421
|
}();
|
|
@@ -9,11 +9,10 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
13
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
15
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
17
|
var _uuid = require("uuid");
|
|
19
18
|
var _emitter = require("../emitter");
|
|
@@ -36,27 +35,26 @@ var _performance = require("../analytics/performance");
|
|
|
36
35
|
var _nullApi = require("../api/null-api");
|
|
37
36
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
37
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
|
-
function
|
|
38
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
40
39
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
40
|
+
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
41
41
|
var logger = (0, _utils.createLogger)('Provider', 'black');
|
|
42
42
|
var OUT_OF_SYNC_PERIOD = 3 * 1000; // 3 seconds
|
|
43
43
|
|
|
44
44
|
var MAX_STEP_REJECTED_ERROR = exports.MAX_STEP_REJECTED_ERROR = 15;
|
|
45
45
|
var MAX_STEP_REJECTED_ERROR_AGGRESSIVE = exports.MAX_STEP_REJECTED_ERROR_AGGRESSIVE = 2;
|
|
46
46
|
var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
47
|
-
(0, _inherits2.default)(Provider, _Emitter);
|
|
48
|
-
var _super = _createSuper(Provider);
|
|
49
47
|
function Provider(config) {
|
|
50
48
|
var _this$config$productI;
|
|
51
49
|
var _this;
|
|
52
50
|
(0, _classCallCheck2.default)(this, Provider);
|
|
53
|
-
_this =
|
|
54
|
-
(0, _defineProperty2.default)(
|
|
55
|
-
(0, _defineProperty2.default)(
|
|
56
|
-
(0, _defineProperty2.default)(
|
|
51
|
+
_this = _callSuper(this, Provider);
|
|
52
|
+
(0, _defineProperty2.default)(_this, "isChannelInitialized", false);
|
|
53
|
+
(0, _defineProperty2.default)(_this, "isProviderInitialized", false);
|
|
54
|
+
(0, _defineProperty2.default)(_this, "isBuffered", false);
|
|
57
55
|
// User permit is used to determine if the user is allowed to view, comment or edit the document
|
|
58
56
|
// Therefore, the initial value is false for all three
|
|
59
|
-
(0, _defineProperty2.default)(
|
|
57
|
+
(0, _defineProperty2.default)(_this, "permit", {
|
|
60
58
|
isPermittedToView: false,
|
|
61
59
|
isPermittedToComment: false,
|
|
62
60
|
isPermittedToEdit: false
|
|
@@ -64,16 +62,16 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
64
62
|
// isBufferingEnabled is a boolean value passed to the config during provider creation.
|
|
65
63
|
// It determines if the provider should initialize immediately and will only be true if:
|
|
66
64
|
// the feature flag is enabled and the initial draft fetched from NCS is also passed in the config.
|
|
67
|
-
(0, _defineProperty2.default)(
|
|
65
|
+
(0, _defineProperty2.default)(_this, "isBufferingEnabled", false);
|
|
68
66
|
// Local IDs of active AI Providers
|
|
69
|
-
(0, _defineProperty2.default)(
|
|
67
|
+
(0, _defineProperty2.default)(_this, "aiProviderActiveIds", []);
|
|
70
68
|
/**
|
|
71
69
|
* Wrapper for this.emit, it binds scope for callbacks and waits for initialising of the editor before emitting events.
|
|
72
70
|
* Waiting for the collab provider to become connected to the editor ensures the editor doesn't miss any events.
|
|
73
71
|
* @param evt - Event name to emit to subscribers
|
|
74
72
|
* @param data - Event data to emit to subscribers
|
|
75
73
|
*/
|
|
76
|
-
(0, _defineProperty2.default)(
|
|
74
|
+
(0, _defineProperty2.default)(_this, "emitCallback", function (evt, data) {
|
|
77
75
|
return _this.emit(evt, data);
|
|
78
76
|
});
|
|
79
77
|
/**
|
|
@@ -81,7 +79,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
81
79
|
* Catches and logs any errors thrown by document service's updateDocument and updateMetadata methods and destroys the provider in case of errors.
|
|
82
80
|
* Passing the document, metadata, version (either from the initial draft or from collab service)
|
|
83
81
|
*/
|
|
84
|
-
(0, _defineProperty2.default)(
|
|
82
|
+
(0, _defineProperty2.default)(_this, "updateDocumentAndMetadata", function (_ref) {
|
|
85
83
|
var doc = _ref.doc,
|
|
86
84
|
version = _ref.version,
|
|
87
85
|
metadata = _ref.metadata;
|
|
@@ -100,7 +98,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
100
98
|
_this.destroy();
|
|
101
99
|
}
|
|
102
100
|
});
|
|
103
|
-
(0, _defineProperty2.default)(
|
|
101
|
+
(0, _defineProperty2.default)(_this, "initializeChannel", function () {
|
|
104
102
|
_this.emit('connecting', {
|
|
105
103
|
initial: true
|
|
106
104
|
});
|
|
@@ -161,12 +159,12 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
161
159
|
_this.emit('permission', permit);
|
|
162
160
|
}).on('steps:added', _this.documentService.onStepsAdded).on('metadata:changed', _this.metadataService.onMetadataChanged).on('participant:telepointer', function (payload) {
|
|
163
161
|
return _this.participantsService.onParticipantTelepointer(payload, _this.sessionId);
|
|
164
|
-
}).on('participant:activity-join', _this.participantsService.onParticipantActivityJoin).on('participant:activity-ack', _this.participantsService.onParticipantActivityAck).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(
|
|
162
|
+
}).on('participant:activity-join', _this.participantsService.onParticipantActivityJoin).on('participant:activity-ack', _this.participantsService.onParticipantActivityAck).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', _this.namespaceService.onNamespaceStatusChanged).connect(shouldSkipDocumentInit);
|
|
165
163
|
});
|
|
166
|
-
(0, _defineProperty2.default)(
|
|
164
|
+
(0, _defineProperty2.default)(_this, "setUserId", function (id) {
|
|
167
165
|
_this.userId = id;
|
|
168
166
|
});
|
|
169
|
-
(0, _defineProperty2.default)(
|
|
167
|
+
(0, _defineProperty2.default)(_this, "getPresenceData", function () {
|
|
170
168
|
return {
|
|
171
169
|
sessionId: _this.sessionId,
|
|
172
170
|
userId: _this.userId,
|
|
@@ -179,7 +177,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
179
177
|
/**
|
|
180
178
|
* @param {InternalError} error The error to handle
|
|
181
179
|
*/
|
|
182
|
-
(0, _defineProperty2.default)(
|
|
180
|
+
(0, _defineProperty2.default)(_this, "onErrorHandled", function (error) {
|
|
183
181
|
var _error$data, _error$data2;
|
|
184
182
|
// User tried committing steps but they were rejected because:
|
|
185
183
|
// HEAD_VERSION_UPDATE_FAILED: the collab service's latest stored step tail version didn't correspond to the head version of the first step submitted
|
|
@@ -198,11 +196,11 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
198
196
|
}
|
|
199
197
|
}
|
|
200
198
|
});
|
|
201
|
-
(0, _defineProperty2.default)(
|
|
199
|
+
(0, _defineProperty2.default)(_this, "getAIProviderActiveIds", function () {
|
|
202
200
|
return _this.aiProviderActiveIds;
|
|
203
201
|
});
|
|
204
202
|
// Note: this gets triggered on page reload for Firefox (not other browsers) because of closeOnBeforeunload: false
|
|
205
|
-
(0, _defineProperty2.default)(
|
|
203
|
+
(0, _defineProperty2.default)(_this, "onDisconnected", function (_ref4) {
|
|
206
204
|
var reason = _ref4.reason;
|
|
207
205
|
_this.disconnectedAt = Date.now();
|
|
208
206
|
_this.participantsService.disconnect(reason, _this.sessionId);
|
|
@@ -210,7 +208,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
210
208
|
/**
|
|
211
209
|
* Returns the documents metadata
|
|
212
210
|
*/
|
|
213
|
-
(0, _defineProperty2.default)(
|
|
211
|
+
(0, _defineProperty2.default)(_this, "getMetadata", function () {
|
|
214
212
|
return _this.metadataService.getMetaData();
|
|
215
213
|
});
|
|
216
214
|
/**
|
|
@@ -218,7 +216,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
218
216
|
* Used for draft sync, a process running every 5s for the first editor of a document to sync the document to the Confluence back-end.
|
|
219
217
|
* @throws {GetCurrentStateError} Something went wrong while returning the current state
|
|
220
218
|
*/
|
|
221
|
-
(0, _defineProperty2.default)(
|
|
219
|
+
(0, _defineProperty2.default)(_this, "getCurrentState", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
222
220
|
var _this$analyticsHelper5;
|
|
223
221
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
224
222
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -244,7 +242,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
244
242
|
* Used when returning the document to Confluence on publish.
|
|
245
243
|
* @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
|
|
246
244
|
*/
|
|
247
|
-
(0, _defineProperty2.default)(
|
|
245
|
+
(0, _defineProperty2.default)(_this, "getFinalAcknowledgedState", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
248
246
|
var _this$analyticsHelper6;
|
|
249
247
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
250
248
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -265,7 +263,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
265
263
|
}
|
|
266
264
|
}, _callee2, null, [[0, 6]]);
|
|
267
265
|
})));
|
|
268
|
-
(0, _defineProperty2.default)(
|
|
266
|
+
(0, _defineProperty2.default)(_this, "getUnconfirmedSteps", function () {
|
|
269
267
|
return _this.documentService.getUnconfirmedSteps();
|
|
270
268
|
});
|
|
271
269
|
/**
|
|
@@ -273,26 +271,26 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
273
271
|
*
|
|
274
272
|
* @returns {number} Returns the current ProseMirror version from the Editor State
|
|
275
273
|
*/
|
|
276
|
-
(0, _defineProperty2.default)(
|
|
274
|
+
(0, _defineProperty2.default)(_this, "getCurrentPmVersion", function () {
|
|
277
275
|
return _this.documentService.getCurrentPmVersion();
|
|
278
276
|
});
|
|
279
277
|
/**
|
|
280
278
|
* Used when the provider is disconnected or destroyed to prevent perpetual timers from continuously running
|
|
281
279
|
*/
|
|
282
|
-
(0, _defineProperty2.default)(
|
|
280
|
+
(0, _defineProperty2.default)(_this, "clearTimers", function () {
|
|
283
281
|
clearTimeout(_this.presenceUpdateTimeout);
|
|
284
282
|
_this.participantsService.clearTimers();
|
|
285
283
|
});
|
|
286
284
|
/**
|
|
287
285
|
*
|
|
288
286
|
*/
|
|
289
|
-
(0, _defineProperty2.default)(
|
|
287
|
+
(0, _defineProperty2.default)(_this, "getParticipants", function () {
|
|
290
288
|
return _this.participantsService.getParticipants();
|
|
291
289
|
});
|
|
292
|
-
(0, _defineProperty2.default)(
|
|
290
|
+
(0, _defineProperty2.default)(_this, "getAIProviderParticipants", function () {
|
|
293
291
|
return _this.participantsService.getAIProviderParticipants();
|
|
294
292
|
});
|
|
295
|
-
(0, _defineProperty2.default)(
|
|
293
|
+
(0, _defineProperty2.default)(_this, "getSessionId", function () {
|
|
296
294
|
return _this.sessionId;
|
|
297
295
|
});
|
|
298
296
|
_this.config = config;
|
|
@@ -325,9 +323,11 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
325
323
|
}, 5000);
|
|
326
324
|
return _this;
|
|
327
325
|
}
|
|
328
|
-
(0,
|
|
326
|
+
(0, _inherits2.default)(Provider, _Emitter);
|
|
327
|
+
return (0, _createClass2.default)(Provider, [{
|
|
329
328
|
key: "initialize",
|
|
330
329
|
value:
|
|
330
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
331
331
|
/**
|
|
332
332
|
* Initialisation logic, called by Jira with a dummy getState function, deprecated in favour of the setup method which allows more configuration
|
|
333
333
|
* @param {Function} getState Function that returns the editor state, used to retrieve collab-edit properties and to interact with prosemirror-collab
|
|
@@ -531,6 +531,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
531
531
|
return this.unsubscribeAll();
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
534
535
|
/**
|
|
535
536
|
* Disconnect the provider, disconnect it's connection to the back-end service and unsubscribe all event listeners on the provider.
|
|
536
537
|
* Used by Confluence to disable the provider when a user doesn't have access to a resource.
|
|
@@ -543,6 +544,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
543
544
|
return this.unsubscribeAll();
|
|
544
545
|
}
|
|
545
546
|
|
|
547
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
546
548
|
/**
|
|
547
549
|
* Disconnect the provider's connection to the back-end service and unsubscribe from all events emitted by this provider. Kept to keep roughly aligned to Synchrony API, which you need to call for each event.
|
|
548
550
|
* @deprecated use destroy instead, it does the same thing
|
|
@@ -552,7 +554,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
552
554
|
key: "unsubscribeAll",
|
|
553
555
|
value: function unsubscribeAll() {
|
|
554
556
|
try {
|
|
555
|
-
(
|
|
557
|
+
_superPropGet(Provider, "unsubscribeAll", this, 3)([]);
|
|
556
558
|
this.channel.disconnect();
|
|
557
559
|
if (this.sendStepsTimer) {
|
|
558
560
|
clearInterval(this.sendStepsTimer);
|
|
@@ -567,6 +569,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
567
569
|
return this;
|
|
568
570
|
}
|
|
569
571
|
|
|
572
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
570
573
|
/**
|
|
571
574
|
* Update the title of the document in the collab provider and optionally broadcast it to other participants and NCS
|
|
572
575
|
* @deprecated use setMetadata instead, it does the same thing
|
|
@@ -589,6 +592,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
589
592
|
}
|
|
590
593
|
}
|
|
591
594
|
|
|
595
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
592
596
|
/**
|
|
593
597
|
* Set editor width, not used any more
|
|
594
598
|
* @deprecated use setMetadata instead, it does the same thing
|
|
@@ -637,7 +641,6 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
637
641
|
return this.namespaceService.getIsNamespaceLocked();
|
|
638
642
|
}
|
|
639
643
|
}]);
|
|
640
|
-
return Provider;
|
|
641
644
|
}(_emitter.Emitter);
|
|
642
645
|
/**
|
|
643
646
|
* Callback for handling the broadcast response of participant activity.
|
|
@@ -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 = "10.
|
|
8
|
+
var version = exports.version = "10.3.0";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|