@atlaskit/collab-provider 10.4.1 → 10.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/connectivity/reconnect-helper.js +1 -0
- package/dist/cjs/document/document-service.js +3 -2
- package/dist/cjs/participants/participants-service.js +3 -0
- package/dist/cjs/provider/commit-step.js +3 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/document/document-service.js +3 -2
- package/dist/es2019/participants/participants-service.js +3 -0
- package/dist/es2019/provider/commit-step.js +3 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/connectivity/reconnect-helper.js +1 -0
- package/dist/esm/document/document-service.js +3 -2
- package/dist/esm/participants/participants-service.js +3 -0
- package/dist/esm/provider/commit-step.js +3 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/participants/participants-service.d.ts +1 -0
- package/dist/types/provider/commit-step.d.ts +2 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.5/participants/participants-service.d.ts +1 -0
- package/dist/types-ts4.5/provider/commit-step.d.ts +2 -1
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/collab-provider
|
|
2
2
|
|
|
3
|
+
## 10.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 10.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#107250](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107250)
|
|
14
|
+
[`9a71e848fdc06`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9a71e848fdc06) -
|
|
15
|
+
Send collabMode flag to NCS via step commits
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 10.4.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -28,7 +28,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
28
28
|
var CATCHUP_THROTTLE = 1 * 1000; // 1 second
|
|
29
29
|
|
|
30
30
|
var noop = function noop() {};
|
|
31
|
-
var logger = (0, _utils.createLogger)('documentService', '
|
|
31
|
+
var logger = (0, _utils.createLogger)('documentService', 'red');
|
|
32
32
|
var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
33
33
|
// ClientID is the unique ID for a prosemirror client. Used for step-rebasing.
|
|
34
34
|
|
|
@@ -891,7 +891,8 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
|
|
|
891
891
|
analyticsHelper: this.analyticsHelper,
|
|
892
892
|
emit: this.providerEmitCallback,
|
|
893
893
|
__livePage: this.options.__livePage,
|
|
894
|
-
hasRecovered: this.hasRecovered
|
|
894
|
+
hasRecovered: this.hasRecovered,
|
|
895
|
+
collabMode: this.participantsService.getCollabMode()
|
|
895
896
|
});
|
|
896
897
|
}
|
|
897
898
|
}]);
|
|
@@ -395,6 +395,9 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
395
395
|
(0, _defineProperty2.default)(this, "getAIProviderParticipants", function () {
|
|
396
396
|
return _this.participantsState.getAIProviderParticipants();
|
|
397
397
|
});
|
|
398
|
+
(0, _defineProperty2.default)(this, "getCollabMode", function () {
|
|
399
|
+
return _this.participantsState.size() > 1 ? 'collab' : 'single';
|
|
400
|
+
});
|
|
398
401
|
this.analyticsHelper = analyticsHelper;
|
|
399
402
|
this.participantsState = participantsState;
|
|
400
403
|
this.emit = emit;
|
|
@@ -28,7 +28,8 @@ var commitStepQueue = exports.commitStepQueue = function commitStepQueue(_ref) {
|
|
|
28
28
|
analyticsHelper = _ref.analyticsHelper,
|
|
29
29
|
emit = _ref.emit,
|
|
30
30
|
__livePage = _ref.__livePage,
|
|
31
|
-
hasRecovered = _ref.hasRecovered
|
|
31
|
+
hasRecovered = _ref.hasRecovered,
|
|
32
|
+
collabMode = _ref.collabMode;
|
|
32
33
|
if (!readyToCommit) {
|
|
33
34
|
logger('Not ready to commit, skip');
|
|
34
35
|
return;
|
|
@@ -87,6 +88,7 @@ var commitStepQueue = exports.commitStepQueue = function commitStepQueue(_ref) {
|
|
|
87
88
|
});
|
|
88
89
|
try {
|
|
89
90
|
broadcast('steps:commit', {
|
|
91
|
+
collabMode: collabMode,
|
|
90
92
|
steps: stepsWithClientAndUserId,
|
|
91
93
|
version: version,
|
|
92
94
|
userId: userId
|
|
@@ -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.5.1";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -15,7 +15,7 @@ import { CantSyncUpError, UpdateDocumentError } from '../errors/custom-errors';
|
|
|
15
15
|
const CATCHUP_THROTTLE = 1 * 1000; // 1 second
|
|
16
16
|
|
|
17
17
|
const noop = () => {};
|
|
18
|
-
const logger = createLogger('documentService', '
|
|
18
|
+
const logger = createLogger('documentService', 'red');
|
|
19
19
|
export class DocumentService {
|
|
20
20
|
// ClientID is the unique ID for a prosemirror client. Used for step-rebasing.
|
|
21
21
|
|
|
@@ -764,7 +764,8 @@ export class DocumentService {
|
|
|
764
764
|
analyticsHelper: this.analyticsHelper,
|
|
765
765
|
emit: this.providerEmitCallback,
|
|
766
766
|
__livePage: this.options.__livePage,
|
|
767
|
-
hasRecovered: this.hasRecovered
|
|
767
|
+
hasRecovered: this.hasRecovered,
|
|
768
|
+
collabMode: this.participantsService.getCollabMode()
|
|
768
769
|
});
|
|
769
770
|
}
|
|
770
771
|
}
|
|
@@ -340,6 +340,9 @@ export class ParticipantsService {
|
|
|
340
340
|
_defineProperty(this, "getAIProviderParticipants", () => {
|
|
341
341
|
return this.participantsState.getAIProviderParticipants();
|
|
342
342
|
});
|
|
343
|
+
_defineProperty(this, "getCollabMode", () => {
|
|
344
|
+
return this.participantsState.size() > 1 ? 'collab' : 'single';
|
|
345
|
+
});
|
|
343
346
|
this.analyticsHelper = analyticsHelper;
|
|
344
347
|
this.participantsState = participantsState;
|
|
345
348
|
this.emit = emit;
|
|
@@ -18,7 +18,8 @@ export const commitStepQueue = ({
|
|
|
18
18
|
analyticsHelper,
|
|
19
19
|
emit,
|
|
20
20
|
__livePage,
|
|
21
|
-
hasRecovered
|
|
21
|
+
hasRecovered,
|
|
22
|
+
collabMode
|
|
22
23
|
}) => {
|
|
23
24
|
if (!readyToCommit) {
|
|
24
25
|
logger('Not ready to commit, skip');
|
|
@@ -79,6 +80,7 @@ export const commitStepQueue = ({
|
|
|
79
80
|
});
|
|
80
81
|
try {
|
|
81
82
|
broadcast('steps:commit', {
|
|
83
|
+
collabMode,
|
|
82
84
|
steps: stepsWithClientAndUserId,
|
|
83
85
|
version,
|
|
84
86
|
userId
|
|
@@ -21,7 +21,7 @@ import { CantSyncUpError, UpdateDocumentError } from '../errors/custom-errors';
|
|
|
21
21
|
var CATCHUP_THROTTLE = 1 * 1000; // 1 second
|
|
22
22
|
|
|
23
23
|
var noop = function noop() {};
|
|
24
|
-
var logger = createLogger('documentService', '
|
|
24
|
+
var logger = createLogger('documentService', 'red');
|
|
25
25
|
export var DocumentService = /*#__PURE__*/function () {
|
|
26
26
|
// ClientID is the unique ID for a prosemirror client. Used for step-rebasing.
|
|
27
27
|
|
|
@@ -884,7 +884,8 @@ export var DocumentService = /*#__PURE__*/function () {
|
|
|
884
884
|
analyticsHelper: this.analyticsHelper,
|
|
885
885
|
emit: this.providerEmitCallback,
|
|
886
886
|
__livePage: this.options.__livePage,
|
|
887
|
-
hasRecovered: this.hasRecovered
|
|
887
|
+
hasRecovered: this.hasRecovered,
|
|
888
|
+
collabMode: this.participantsService.getCollabMode()
|
|
888
889
|
});
|
|
889
890
|
}
|
|
890
891
|
}]);
|
|
@@ -388,6 +388,9 @@ export var ParticipantsService = /*#__PURE__*/function () {
|
|
|
388
388
|
_defineProperty(this, "getAIProviderParticipants", function () {
|
|
389
389
|
return _this.participantsState.getAIProviderParticipants();
|
|
390
390
|
});
|
|
391
|
+
_defineProperty(this, "getCollabMode", function () {
|
|
392
|
+
return _this.participantsState.size() > 1 ? 'collab' : 'single';
|
|
393
|
+
});
|
|
391
394
|
this.analyticsHelper = analyticsHelper;
|
|
392
395
|
this.participantsState = participantsState;
|
|
393
396
|
this.emit = emit;
|
|
@@ -21,7 +21,8 @@ export var commitStepQueue = function commitStepQueue(_ref) {
|
|
|
21
21
|
analyticsHelper = _ref.analyticsHelper,
|
|
22
22
|
emit = _ref.emit,
|
|
23
23
|
__livePage = _ref.__livePage,
|
|
24
|
-
hasRecovered = _ref.hasRecovered
|
|
24
|
+
hasRecovered = _ref.hasRecovered,
|
|
25
|
+
collabMode = _ref.collabMode;
|
|
25
26
|
if (!readyToCommit) {
|
|
26
27
|
logger('Not ready to commit, skip');
|
|
27
28
|
return;
|
|
@@ -80,6 +81,7 @@ export var commitStepQueue = function commitStepQueue(_ref) {
|
|
|
80
81
|
});
|
|
81
82
|
try {
|
|
82
83
|
broadcast('steps:commit', {
|
|
84
|
+
collabMode: collabMode,
|
|
83
85
|
steps: stepsWithClientAndUserId,
|
|
84
86
|
version: version,
|
|
85
87
|
userId: userId
|
|
@@ -5,7 +5,7 @@ import type AnalyticsHelper from '../analytics/analytics-helper';
|
|
|
5
5
|
import type { InternalError } from '../errors/internal-errors';
|
|
6
6
|
export declare let readyToCommit: boolean;
|
|
7
7
|
export declare const RESET_READYTOCOMMIT_INTERVAL_MS = 5000;
|
|
8
|
-
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, }: {
|
|
8
|
+
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, collabMode, }: {
|
|
9
9
|
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], 'timestamp'>, callback?: Function) => void;
|
|
10
10
|
steps: readonly ProseMirrorStep[];
|
|
11
11
|
version: number;
|
|
@@ -17,4 +17,5 @@ export declare const commitStepQueue: ({ broadcast, steps, version, userId, clie
|
|
|
17
17
|
emit: (evt: keyof CollabEvents, data: CollabCommitStatusEventPayload) => void;
|
|
18
18
|
__livePage: boolean;
|
|
19
19
|
hasRecovered: boolean;
|
|
20
|
+
collabMode: string;
|
|
20
21
|
}) => void;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type AnalyticsHelper from '../analytics/analytics-helper';
|
|
|
5
5
|
import type { InternalError } from '../errors/internal-errors';
|
|
6
6
|
export declare let readyToCommit: boolean;
|
|
7
7
|
export declare const RESET_READYTOCOMMIT_INTERVAL_MS = 5000;
|
|
8
|
-
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, }: {
|
|
8
|
+
export declare const commitStepQueue: ({ broadcast, steps, version, userId, clientId, onStepsAdded, onErrorHandled, analyticsHelper, emit, __livePage, hasRecovered, collabMode, }: {
|
|
9
9
|
broadcast: <K extends keyof ChannelEvent>(type: K, data: Omit<ChannelEvent[K], 'timestamp'>, callback?: Function) => void;
|
|
10
10
|
steps: readonly ProseMirrorStep[];
|
|
11
11
|
version: number;
|
|
@@ -17,4 +17,5 @@ export declare const commitStepQueue: ({ broadcast, steps, version, userId, clie
|
|
|
17
17
|
emit: (evt: keyof CollabEvents, data: CollabCommitStatusEventPayload) => void;
|
|
18
18
|
__livePage: boolean;
|
|
19
19
|
hasRecovered: boolean;
|
|
20
|
+
collabMode: string;
|
|
20
21
|
}) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.1",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"./version-wrapper": "./src/version-wrapper.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-utils": "^19.
|
|
35
|
+
"@atlaskit/adf-utils": "^19.18.0",
|
|
36
36
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
37
|
-
"@atlaskit/analytics-listeners": "^8.
|
|
38
|
-
"@atlaskit/editor-common": "^99.
|
|
39
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
37
|
+
"@atlaskit/analytics-listeners": "^8.14.0",
|
|
38
|
+
"@atlaskit/editor-common": "^99.7.0",
|
|
39
|
+
"@atlaskit/editor-json-transformer": "^8.22.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
41
41
|
"@atlaskit/feature-gate-js-client": "^4.22.0",
|
|
42
|
-
"@atlaskit/platform-feature-flags": "^0.
|
|
42
|
+
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
43
43
|
"@atlaskit/prosemirror-collab": "^0.11.0",
|
|
44
|
-
"@atlaskit/react-ufo": "^2.
|
|
44
|
+
"@atlaskit/react-ufo": "^2.14.0",
|
|
45
45
|
"@atlaskit/ufo": "^0.3.0",
|
|
46
46
|
"@atlaskit/util-service-support": "^6.2.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
69
|
-
"@atlassian/feature-flags-test-utils": "^0.
|
|
69
|
+
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
70
70
|
"typescript": "~5.4.2"
|
|
71
71
|
},
|
|
72
72
|
"platform-feature-flags": {
|