@atlaskit/collab-provider 9.16.0 → 9.17.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 +3 -0
- package/dist/cjs/feature-flags/index.js +4 -2
- package/dist/cjs/provider/index.js +23 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/channel.js +3 -0
- package/dist/es2019/feature-flags/index.js +4 -2
- package/dist/es2019/provider/index.js +19 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/channel.js +3 -0
- package/dist/esm/feature-flags/index.js +4 -2
- package/dist/esm/provider/index.js +23 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/channel.d.ts +1 -1
- package/dist/types/feature-flags/types.d.ts +1 -0
- package/dist/types/provider/index.d.ts +2 -0
- package/dist/types/types.d.ts +7 -0
- package/dist/types-ts4.5/channel.d.ts +1 -1
- package/dist/types-ts4.5/feature-flags/types.d.ts +1 -0
- package/dist/types-ts4.5/provider/index.d.ts +2 -0
- package/dist/types-ts4.5/types.d.ts +7 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/collab-provider
|
|
2
2
|
|
|
3
|
+
## 9.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#43813](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43813) [`417f8592c91`](https://bitbucket.org/atlassian/atlassian-frontend/commits/417f8592c91) - block view only steps and metadata traffic
|
|
8
|
+
|
|
9
|
+
## 9.16.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#43417](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43417) [`3f3c17f0273`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f3c17f0273) - ED-20971 Upgrade adf-schema package to ^34.0.0
|
|
14
|
+
|
|
3
15
|
## 9.16.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/cjs/channel.js
CHANGED
|
@@ -606,6 +606,9 @@ var Channel = exports.Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
606
606
|
// We should use `connect` for better cross platform compatibility(Mobile/Web).
|
|
607
607
|
this.socket.on('connect', this.onConnect);
|
|
608
608
|
this.socket.on('data', this.onReceiveData);
|
|
609
|
+
this.socket.on('permission', function (permit) {
|
|
610
|
+
_this2.emit('permission', permit);
|
|
611
|
+
});
|
|
609
612
|
this.socket.on('steps:added', function (data) {
|
|
610
613
|
_this2.emit('steps:added', data);
|
|
611
614
|
});
|
|
@@ -10,7 +10,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var defaultNCSFeatureFlags = {
|
|
11
11
|
testFF: false,
|
|
12
12
|
socketMessageMetricsFF: false,
|
|
13
|
-
sendStepsQueueFF: false
|
|
13
|
+
sendStepsQueueFF: false,
|
|
14
|
+
blockViewOnlyFF: false
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -20,7 +21,8 @@ var productKeys = {
|
|
|
20
21
|
confluence: {
|
|
21
22
|
testFF: 'confluence.frontend.collab.provider.testFF',
|
|
22
23
|
socketMessageMetricsFF: 'confluence.frontend.collab.provider.socketMessageMetricsFF',
|
|
23
|
-
sendStepsQueueFF: 'confluence.frontend.collab.provider.sendStepsQueueFF'
|
|
24
|
+
sendStepsQueueFF: 'confluence.frontend.collab.provider.sendStepsQueueFF',
|
|
25
|
+
blockViewOnlyFF: 'confluence.frontend.collab.provider.blockViewOnlyFF'
|
|
24
26
|
}
|
|
25
27
|
};
|
|
26
28
|
var filterFeatureFlagNames = function filterFeatureFlagNames(flags) {
|
|
@@ -50,6 +50,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
50
50
|
// It determines if the provider should initialize immediately and will only be true if:
|
|
51
51
|
// the feature flag is enabled and the initial draft fetched from NCS is also passed in the config.
|
|
52
52
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isBufferingEnabled", false);
|
|
53
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "permit", {});
|
|
53
54
|
/**
|
|
54
55
|
* Wrapper for this.emit, it binds scope for callbacks and waits for initialising of the editor before emitting events.
|
|
55
56
|
* Waiting for the collab provider to become connected to the editor ensures the editor doesn't miss any events.
|
|
@@ -142,7 +143,9 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
142
143
|
version: version,
|
|
143
144
|
metadata: metadata
|
|
144
145
|
});
|
|
145
|
-
}).on('restore', _this.documentService.onRestore).on('
|
|
146
|
+
}).on('restore', _this.documentService.onRestore).on('permission', function (permit) {
|
|
147
|
+
_this.permit = Object.assign(_this.permit, permit);
|
|
148
|
+
}).on('steps:added', _this.documentService.onStepsAdded).on('metadata:changed', _this.metadataService.onMetadataChanged).on('participant:telepointer', function (payload) {
|
|
146
149
|
return _this.participantsService.onParticipantTelepointer(payload, _this.sessionId);
|
|
147
150
|
}).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((0, _assertThisInitialized2.default)(_this))).on('error', _this.onErrorHandled).on('status', _this.namespaceService.onNamespaceStatusChanged).connect(shouldSkipDocumentInit);
|
|
148
151
|
});
|
|
@@ -379,6 +382,9 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
379
382
|
key: "send",
|
|
380
383
|
value: function send(_tr, _oldState, newState) {
|
|
381
384
|
try {
|
|
385
|
+
if (this.isViewOnly()) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
382
388
|
// Don't send steps while the document is locked (eg. when restoring the document)
|
|
383
389
|
if (this.namespaceService.getIsNamespaceLocked()) {
|
|
384
390
|
logger('The document is temporary locked');
|
|
@@ -392,8 +398,13 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
392
398
|
}
|
|
393
399
|
}
|
|
394
400
|
}, {
|
|
395
|
-
key: "
|
|
396
|
-
value:
|
|
401
|
+
key: "isViewOnly",
|
|
402
|
+
value: function isViewOnly() {
|
|
403
|
+
return (0, _featureFlags.getCollabProviderFeatureFlag)('blockViewOnlyFF', this.config.featureFlags) && this.permit &&
|
|
404
|
+
// isPermittedToEdit or isPermittedToView can be undefined, must use `===` here.
|
|
405
|
+
this.permit.isPermittedToEdit === false && this.permit.isPermittedToView === true;
|
|
406
|
+
}
|
|
407
|
+
|
|
397
408
|
/**
|
|
398
409
|
* Send messages, such as telepointers, to NCS and other participants. Only used for telepointer data (text and node selections) in the editor and JWM. JWM does some weird serialisation stuff on the node selections.
|
|
399
410
|
* Silently fails if an error occurs, since Presence isn't a critical functionality and self-restores over time.
|
|
@@ -402,7 +413,9 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
402
413
|
* @param {CollabSendableSelection} data.selection Object representing the selected element
|
|
403
414
|
* @param {string} data.sessionId Identifier identifying the session
|
|
404
415
|
*/
|
|
405
|
-
|
|
416
|
+
}, {
|
|
417
|
+
key: "sendMessage",
|
|
418
|
+
value: function sendMessage(data) {
|
|
406
419
|
try {
|
|
407
420
|
if ((data === null || data === void 0 ? void 0 : data.type) === 'telepointer') {
|
|
408
421
|
var payload = {
|
|
@@ -475,6 +488,9 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
475
488
|
key: "setTitle",
|
|
476
489
|
value: function setTitle(title, broadcast) {
|
|
477
490
|
try {
|
|
491
|
+
if (this.isViewOnly()) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
478
494
|
this.metadataService.setTitle(title, broadcast);
|
|
479
495
|
} catch (error) {
|
|
480
496
|
var _this$analyticsHelper12;
|
|
@@ -511,6 +527,9 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
511
527
|
key: "setMetadata",
|
|
512
528
|
value: function setMetadata(metadata) {
|
|
513
529
|
try {
|
|
530
|
+
if (this.isViewOnly()) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
514
533
|
this.metadataService.setMetadata(metadata);
|
|
515
534
|
} catch (error) {
|
|
516
535
|
var _this$analyticsHelper14;
|
|
@@ -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 = "9.
|
|
8
|
+
var version = exports.version = "9.17.0";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
package/dist/es2019/channel.js
CHANGED
|
@@ -409,6 +409,9 @@ export class Channel extends Emitter {
|
|
|
409
409
|
// We should use `connect` for better cross platform compatibility(Mobile/Web).
|
|
410
410
|
this.socket.on('connect', this.onConnect);
|
|
411
411
|
this.socket.on('data', this.onReceiveData);
|
|
412
|
+
this.socket.on('permission', permit => {
|
|
413
|
+
this.emit('permission', permit);
|
|
414
|
+
});
|
|
412
415
|
this.socket.on('steps:added', data => {
|
|
413
416
|
this.emit('steps:added', data);
|
|
414
417
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const defaultNCSFeatureFlags = {
|
|
2
2
|
testFF: false,
|
|
3
3
|
socketMessageMetricsFF: false,
|
|
4
|
-
sendStepsQueueFF: false
|
|
4
|
+
sendStepsQueueFF: false,
|
|
5
|
+
blockViewOnlyFF: false
|
|
5
6
|
};
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -11,7 +12,8 @@ const productKeys = {
|
|
|
11
12
|
confluence: {
|
|
12
13
|
testFF: 'confluence.frontend.collab.provider.testFF',
|
|
13
14
|
socketMessageMetricsFF: 'confluence.frontend.collab.provider.socketMessageMetricsFF',
|
|
14
|
-
sendStepsQueueFF: 'confluence.frontend.collab.provider.sendStepsQueueFF'
|
|
15
|
+
sendStepsQueueFF: 'confluence.frontend.collab.provider.sendStepsQueueFF',
|
|
16
|
+
blockViewOnlyFF: 'confluence.frontend.collab.provider.blockViewOnlyFF'
|
|
15
17
|
}
|
|
16
18
|
};
|
|
17
19
|
const filterFeatureFlagNames = flags => {
|
|
@@ -28,6 +28,7 @@ export class Provider extends Emitter {
|
|
|
28
28
|
// It determines if the provider should initialize immediately and will only be true if:
|
|
29
29
|
// the feature flag is enabled and the initial draft fetched from NCS is also passed in the config.
|
|
30
30
|
_defineProperty(this, "isBufferingEnabled", false);
|
|
31
|
+
_defineProperty(this, "permit", {});
|
|
31
32
|
/**
|
|
32
33
|
* Wrapper for this.emit, it binds scope for callbacks and waits for initialising of the editor before emitting events.
|
|
33
34
|
* Waiting for the collab provider to become connected to the editor ensures the editor doesn't miss any events.
|
|
@@ -122,7 +123,9 @@ export class Provider extends Emitter {
|
|
|
122
123
|
version,
|
|
123
124
|
metadata
|
|
124
125
|
});
|
|
125
|
-
}).on('restore', this.documentService.onRestore).on('
|
|
126
|
+
}).on('restore', this.documentService.onRestore).on('permission', permit => {
|
|
127
|
+
this.permit = Object.assign(this.permit, permit);
|
|
128
|
+
}).on('steps:added', this.documentService.onStepsAdded).on('metadata:changed', this.metadataService.onMetadataChanged).on('participant:telepointer', payload => this.participantsService.onParticipantTelepointer(payload, this.sessionId)).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);
|
|
126
129
|
});
|
|
127
130
|
_defineProperty(this, "setUserId", id => {
|
|
128
131
|
this.userId = id;
|
|
@@ -320,6 +323,9 @@ export class Provider extends Emitter {
|
|
|
320
323
|
*/
|
|
321
324
|
send(_tr, _oldState, newState) {
|
|
322
325
|
try {
|
|
326
|
+
if (this.isViewOnly()) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
323
329
|
// Don't send steps while the document is locked (eg. when restoring the document)
|
|
324
330
|
if (this.namespaceService.getIsNamespaceLocked()) {
|
|
325
331
|
logger('The document is temporary locked');
|
|
@@ -332,6 +338,12 @@ export class Provider extends Emitter {
|
|
|
332
338
|
throw new SendTransactionError('Error while sending steps for a transaction', error);
|
|
333
339
|
}
|
|
334
340
|
}
|
|
341
|
+
isViewOnly() {
|
|
342
|
+
return getCollabProviderFeatureFlag('blockViewOnlyFF', this.config.featureFlags) && this.permit &&
|
|
343
|
+
// isPermittedToEdit or isPermittedToView can be undefined, must use `===` here.
|
|
344
|
+
this.permit.isPermittedToEdit === false && this.permit.isPermittedToView === true;
|
|
345
|
+
}
|
|
346
|
+
|
|
335
347
|
/**
|
|
336
348
|
* Send messages, such as telepointers, to NCS and other participants. Only used for telepointer data (text and node selections) in the editor and JWM. JWM does some weird serialisation stuff on the node selections.
|
|
337
349
|
* Silently fails if an error occurs, since Presence isn't a critical functionality and self-restores over time.
|
|
@@ -404,6 +416,9 @@ export class Provider extends Emitter {
|
|
|
404
416
|
*/
|
|
405
417
|
setTitle(title, broadcast) {
|
|
406
418
|
try {
|
|
419
|
+
if (this.isViewOnly()) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
407
422
|
this.metadataService.setTitle(title, broadcast);
|
|
408
423
|
} catch (error) {
|
|
409
424
|
var _this$analyticsHelper12;
|
|
@@ -436,6 +451,9 @@ export class Provider extends Emitter {
|
|
|
436
451
|
*/
|
|
437
452
|
setMetadata(metadata) {
|
|
438
453
|
try {
|
|
454
|
+
if (this.isViewOnly()) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
439
457
|
this.metadataService.setMetadata(metadata);
|
|
440
458
|
} catch (error) {
|
|
441
459
|
var _this$analyticsHelper14;
|
package/dist/esm/channel.js
CHANGED
|
@@ -599,6 +599,9 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
599
599
|
// We should use `connect` for better cross platform compatibility(Mobile/Web).
|
|
600
600
|
this.socket.on('connect', this.onConnect);
|
|
601
601
|
this.socket.on('data', this.onReceiveData);
|
|
602
|
+
this.socket.on('permission', function (permit) {
|
|
603
|
+
_this2.emit('permission', permit);
|
|
604
|
+
});
|
|
602
605
|
this.socket.on('steps:added', function (data) {
|
|
603
606
|
_this2.emit('steps:added', data);
|
|
604
607
|
});
|
|
@@ -2,7 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
var defaultNCSFeatureFlags = {
|
|
3
3
|
testFF: false,
|
|
4
4
|
socketMessageMetricsFF: false,
|
|
5
|
-
sendStepsQueueFF: false
|
|
5
|
+
sendStepsQueueFF: false,
|
|
6
|
+
blockViewOnlyFF: false
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -12,7 +13,8 @@ var productKeys = {
|
|
|
12
13
|
confluence: {
|
|
13
14
|
testFF: 'confluence.frontend.collab.provider.testFF',
|
|
14
15
|
socketMessageMetricsFF: 'confluence.frontend.collab.provider.socketMessageMetricsFF',
|
|
15
|
-
sendStepsQueueFF: 'confluence.frontend.collab.provider.sendStepsQueueFF'
|
|
16
|
+
sendStepsQueueFF: 'confluence.frontend.collab.provider.sendStepsQueueFF',
|
|
17
|
+
blockViewOnlyFF: 'confluence.frontend.collab.provider.blockViewOnlyFF'
|
|
16
18
|
}
|
|
17
19
|
};
|
|
18
20
|
var filterFeatureFlagNames = function filterFeatureFlagNames(flags) {
|
|
@@ -43,6 +43,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
43
43
|
// It determines if the provider should initialize immediately and will only be true if:
|
|
44
44
|
// the feature flag is enabled and the initial draft fetched from NCS is also passed in the config.
|
|
45
45
|
_defineProperty(_assertThisInitialized(_this), "isBufferingEnabled", false);
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "permit", {});
|
|
46
47
|
/**
|
|
47
48
|
* Wrapper for this.emit, it binds scope for callbacks and waits for initialising of the editor before emitting events.
|
|
48
49
|
* Waiting for the collab provider to become connected to the editor ensures the editor doesn't miss any events.
|
|
@@ -135,7 +136,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
135
136
|
version: version,
|
|
136
137
|
metadata: metadata
|
|
137
138
|
});
|
|
138
|
-
}).on('restore', _this.documentService.onRestore).on('
|
|
139
|
+
}).on('restore', _this.documentService.onRestore).on('permission', function (permit) {
|
|
140
|
+
_this.permit = Object.assign(_this.permit, permit);
|
|
141
|
+
}).on('steps:added', _this.documentService.onStepsAdded).on('metadata:changed', _this.metadataService.onMetadataChanged).on('participant:telepointer', function (payload) {
|
|
139
142
|
return _this.participantsService.onParticipantTelepointer(payload, _this.sessionId);
|
|
140
143
|
}).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(shouldSkipDocumentInit);
|
|
141
144
|
});
|
|
@@ -372,6 +375,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
372
375
|
key: "send",
|
|
373
376
|
value: function send(_tr, _oldState, newState) {
|
|
374
377
|
try {
|
|
378
|
+
if (this.isViewOnly()) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
375
381
|
// Don't send steps while the document is locked (eg. when restoring the document)
|
|
376
382
|
if (this.namespaceService.getIsNamespaceLocked()) {
|
|
377
383
|
logger('The document is temporary locked');
|
|
@@ -385,8 +391,13 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
385
391
|
}
|
|
386
392
|
}
|
|
387
393
|
}, {
|
|
388
|
-
key: "
|
|
389
|
-
value:
|
|
394
|
+
key: "isViewOnly",
|
|
395
|
+
value: function isViewOnly() {
|
|
396
|
+
return getCollabProviderFeatureFlag('blockViewOnlyFF', this.config.featureFlags) && this.permit &&
|
|
397
|
+
// isPermittedToEdit or isPermittedToView can be undefined, must use `===` here.
|
|
398
|
+
this.permit.isPermittedToEdit === false && this.permit.isPermittedToView === true;
|
|
399
|
+
}
|
|
400
|
+
|
|
390
401
|
/**
|
|
391
402
|
* Send messages, such as telepointers, to NCS and other participants. Only used for telepointer data (text and node selections) in the editor and JWM. JWM does some weird serialisation stuff on the node selections.
|
|
392
403
|
* Silently fails if an error occurs, since Presence isn't a critical functionality and self-restores over time.
|
|
@@ -395,7 +406,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
395
406
|
* @param {CollabSendableSelection} data.selection Object representing the selected element
|
|
396
407
|
* @param {string} data.sessionId Identifier identifying the session
|
|
397
408
|
*/
|
|
398
|
-
|
|
409
|
+
}, {
|
|
410
|
+
key: "sendMessage",
|
|
411
|
+
value: function sendMessage(data) {
|
|
399
412
|
try {
|
|
400
413
|
if ((data === null || data === void 0 ? void 0 : data.type) === 'telepointer') {
|
|
401
414
|
var payload = {
|
|
@@ -468,6 +481,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
468
481
|
key: "setTitle",
|
|
469
482
|
value: function setTitle(title, broadcast) {
|
|
470
483
|
try {
|
|
484
|
+
if (this.isViewOnly()) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
471
487
|
this.metadataService.setTitle(title, broadcast);
|
|
472
488
|
} catch (error) {
|
|
473
489
|
var _this$analyticsHelper12;
|
|
@@ -504,6 +520,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
504
520
|
key: "setMetadata",
|
|
505
521
|
value: function setMetadata(metadata) {
|
|
506
522
|
try {
|
|
523
|
+
if (this.isViewOnly()) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
507
526
|
this.metadataService.setMetadata(metadata);
|
|
508
527
|
} catch (error) {
|
|
509
528
|
var _this$analyticsHelper14;
|
package/dist/types/channel.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Emitter } from './emitter';
|
|
2
2
|
import type { Config, ChannelEvent, CatchupResponse, ReconcileResponse } from './types';
|
|
3
3
|
import type { Socket } from 'socket.io-client';
|
|
4
|
-
import AnalyticsHelper from './analytics/analytics-helper';
|
|
4
|
+
import type AnalyticsHelper from './analytics/analytics-helper';
|
|
5
5
|
import type { Metadata } from '@atlaskit/editor-common/collab';
|
|
6
6
|
export declare class Channel extends Emitter<ChannelEvent> {
|
|
7
7
|
private readonly RATE_LIMIT_TYPE_NONE;
|
|
@@ -15,6 +15,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
15
15
|
private isProviderInitialized;
|
|
16
16
|
private isBuffered;
|
|
17
17
|
private isBufferingEnabled;
|
|
18
|
+
private permit;
|
|
18
19
|
private sessionId?;
|
|
19
20
|
private clientId?;
|
|
20
21
|
private userId?;
|
|
@@ -79,6 +80,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
79
80
|
* @param {InternalError} error The error to handle
|
|
80
81
|
*/
|
|
81
82
|
private onErrorHandled;
|
|
83
|
+
private isViewOnly;
|
|
82
84
|
/**
|
|
83
85
|
* Send messages, such as telepointers, to NCS and other participants. Only used for telepointer data (text and node selections) in the editor and JWM. JWM does some weird serialisation stuff on the node selections.
|
|
84
86
|
* Silently fails if an error occurs, since Presence isn't a critical functionality and self-restores over time.
|
package/dist/types/types.d.ts
CHANGED
|
@@ -146,6 +146,12 @@ export type NamespaceStatus = {
|
|
|
146
146
|
timestamp: number;
|
|
147
147
|
waitTimeInMs?: number;
|
|
148
148
|
};
|
|
149
|
+
export type Permit = {
|
|
150
|
+
reason?: string;
|
|
151
|
+
isPermittedToView?: boolean;
|
|
152
|
+
isPermittedToEdit?: boolean;
|
|
153
|
+
maintenanceMode?: boolean;
|
|
154
|
+
};
|
|
149
155
|
export type ChannelEvent = {
|
|
150
156
|
connected: {
|
|
151
157
|
sid: string;
|
|
@@ -164,6 +170,7 @@ export type ChannelEvent = {
|
|
|
164
170
|
};
|
|
165
171
|
'steps:added': StepsPayload;
|
|
166
172
|
'metadata:changed': Metadata;
|
|
173
|
+
permission: Permit;
|
|
167
174
|
error: InternalError;
|
|
168
175
|
disconnect: {
|
|
169
176
|
reason: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Emitter } from './emitter';
|
|
2
2
|
import type { Config, ChannelEvent, CatchupResponse, ReconcileResponse } from './types';
|
|
3
3
|
import type { Socket } from 'socket.io-client';
|
|
4
|
-
import AnalyticsHelper from './analytics/analytics-helper';
|
|
4
|
+
import type AnalyticsHelper from './analytics/analytics-helper';
|
|
5
5
|
import type { Metadata } from '@atlaskit/editor-common/collab';
|
|
6
6
|
export declare class Channel extends Emitter<ChannelEvent> {
|
|
7
7
|
private readonly RATE_LIMIT_TYPE_NONE;
|
|
@@ -15,6 +15,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
15
15
|
private isProviderInitialized;
|
|
16
16
|
private isBuffered;
|
|
17
17
|
private isBufferingEnabled;
|
|
18
|
+
private permit;
|
|
18
19
|
private sessionId?;
|
|
19
20
|
private clientId?;
|
|
20
21
|
private userId?;
|
|
@@ -79,6 +80,7 @@ export declare class Provider extends Emitter<CollabEvents> implements BaseEvent
|
|
|
79
80
|
* @param {InternalError} error The error to handle
|
|
80
81
|
*/
|
|
81
82
|
private onErrorHandled;
|
|
83
|
+
private isViewOnly;
|
|
82
84
|
/**
|
|
83
85
|
* Send messages, such as telepointers, to NCS and other participants. Only used for telepointer data (text and node selections) in the editor and JWM. JWM does some weird serialisation stuff on the node selections.
|
|
84
86
|
* Silently fails if an error occurs, since Presence isn't a critical functionality and self-restores over time.
|
|
@@ -146,6 +146,12 @@ export type NamespaceStatus = {
|
|
|
146
146
|
timestamp: number;
|
|
147
147
|
waitTimeInMs?: number;
|
|
148
148
|
};
|
|
149
|
+
export type Permit = {
|
|
150
|
+
reason?: string;
|
|
151
|
+
isPermittedToView?: boolean;
|
|
152
|
+
isPermittedToEdit?: boolean;
|
|
153
|
+
maintenanceMode?: boolean;
|
|
154
|
+
};
|
|
149
155
|
export type ChannelEvent = {
|
|
150
156
|
connected: {
|
|
151
157
|
sid: string;
|
|
@@ -164,6 +170,7 @@ export type ChannelEvent = {
|
|
|
164
170
|
};
|
|
165
171
|
'steps:added': StepsPayload;
|
|
166
172
|
'metadata:changed': Metadata;
|
|
173
|
+
permission: Permit;
|
|
167
174
|
error: InternalError;
|
|
168
175
|
disconnect: {
|
|
169
176
|
reason: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.17.0",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
38
38
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
39
|
-
"@atlaskit/editor-common": "^76.
|
|
39
|
+
"@atlaskit/editor-common": "^76.23.0",
|
|
40
40
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
42
42
|
"@atlaskit/prosemirror-collab": "^0.2.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@atlaskit/adf-schema": "^
|
|
65
|
+
"@atlaskit/adf-schema": "^34.0.0",
|
|
66
66
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
67
67
|
"typescript": "~4.9.5"
|
|
68
68
|
},
|