@atlaskit/collab-provider 21.0.22 → 21.0.24
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/helpers/utils.js +10 -0
- package/dist/cjs/types.js +9 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/helpers/utils.js +10 -0
- package/dist/es2019/types.js +10 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/helpers/utils.js +10 -0
- package/dist/esm/types.js +10 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/helpers/utils.d.ts +9 -0
- package/dist/types/types.d.ts +24 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -42,6 +42,16 @@ function sleep(ms) {
|
|
|
42
42
|
setTimeout(resolve, ms);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns whether an id belongs to an agent — referred to as an "AI provider" in this
|
|
48
|
+
* package's terminology.
|
|
49
|
+
*
|
|
50
|
+
* @remarks Agents are not a distinct type: they are ordinary participants distinguished
|
|
51
|
+
* only by the `agent:` prefix on their `userId`/`sessionId`. This predicate is the single
|
|
52
|
+
* source of truth for that convention and gates agent-specific presence handling across the
|
|
53
|
+
* provider (e.g. immediate `presence` emission and agent-leave cleanup).
|
|
54
|
+
*/
|
|
45
55
|
var isAIProviderID = exports.isAIProviderID = function isAIProviderID(id) {
|
|
46
56
|
return typeof id === 'string' && id.startsWith('agent:');
|
|
47
57
|
};
|
package/dist/cjs/types.js
CHANGED
|
@@ -13,6 +13,15 @@ exports.AcknowledgementResponseTypes = void 0;
|
|
|
13
13
|
* @param {string} sessionId socket.id from NCS
|
|
14
14
|
* @param data event specific data from NCS
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Presence details broadcast for a single participant (human or agent) on a document.
|
|
18
|
+
*
|
|
19
|
+
* @remarks Agents are modelled as ordinary participants distinguished only by the
|
|
20
|
+
* `agent:` prefix on their `userId`/`sessionId` (see `isAIProviderID`); this package
|
|
21
|
+
* refers to them as "AI providers". Note this base type carries no last-active time —
|
|
22
|
+
* a participant's `lastActive` is derived from {@link PresencePayload.timestamp} when the
|
|
23
|
+
* payload is hydrated into a participant.
|
|
24
|
+
*/
|
|
16
25
|
var AcknowledgementResponseTypes = exports.AcknowledgementResponseTypes = /*#__PURE__*/function (AcknowledgementResponseTypes) {
|
|
17
26
|
AcknowledgementResponseTypes["SUCCESS"] = "SUCCESS";
|
|
18
27
|
AcknowledgementResponseTypes["ERROR"] = "ERROR";
|
|
@@ -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 = "21.0.
|
|
8
|
+
var version = exports.version = "21.0.23";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -22,6 +22,16 @@ export function sleep(ms) {
|
|
|
22
22
|
setTimeout(resolve, ms);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Returns whether an id belongs to an agent — referred to as an "AI provider" in this
|
|
28
|
+
* package's terminology.
|
|
29
|
+
*
|
|
30
|
+
* @remarks Agents are not a distinct type: they are ordinary participants distinguished
|
|
31
|
+
* only by the `agent:` prefix on their `userId`/`sessionId`. This predicate is the single
|
|
32
|
+
* source of truth for that convention and gates agent-specific presence handling across the
|
|
33
|
+
* provider (e.g. immediate `presence` emission and agent-leave cleanup).
|
|
34
|
+
*/
|
|
25
35
|
export const isAIProviderID = id => typeof id === 'string' && id.startsWith('agent:');
|
|
26
36
|
export const getProduct = productInfo => {
|
|
27
37
|
var _productInfo$product;
|
package/dist/es2019/types.js
CHANGED
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
* @param data event specific data from NCS
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Presence details broadcast for a single participant (human or agent) on a document.
|
|
16
|
+
*
|
|
17
|
+
* @remarks Agents are modelled as ordinary participants distinguished only by the
|
|
18
|
+
* `agent:` prefix on their `userId`/`sessionId` (see `isAIProviderID`); this package
|
|
19
|
+
* refers to them as "AI providers". Note this base type carries no last-active time —
|
|
20
|
+
* a participant's `lastActive` is derived from {@link PresencePayload.timestamp} when the
|
|
21
|
+
* payload is hydrated into a participant.
|
|
22
|
+
*/
|
|
23
|
+
|
|
14
24
|
export let AcknowledgementResponseTypes = /*#__PURE__*/function (AcknowledgementResponseTypes) {
|
|
15
25
|
AcknowledgementResponseTypes["SUCCESS"] = "SUCCESS";
|
|
16
26
|
AcknowledgementResponseTypes["ERROR"] = "ERROR";
|
|
@@ -32,6 +32,16 @@ export function sleep(ms) {
|
|
|
32
32
|
setTimeout(resolve, ms);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Returns whether an id belongs to an agent — referred to as an "AI provider" in this
|
|
38
|
+
* package's terminology.
|
|
39
|
+
*
|
|
40
|
+
* @remarks Agents are not a distinct type: they are ordinary participants distinguished
|
|
41
|
+
* only by the `agent:` prefix on their `userId`/`sessionId`. This predicate is the single
|
|
42
|
+
* source of truth for that convention and gates agent-specific presence handling across the
|
|
43
|
+
* provider (e.g. immediate `presence` emission and agent-leave cleanup).
|
|
44
|
+
*/
|
|
35
45
|
export var isAIProviderID = function isAIProviderID(id) {
|
|
36
46
|
return typeof id === 'string' && id.startsWith('agent:');
|
|
37
47
|
};
|
package/dist/esm/types.js
CHANGED
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
* @param data event specific data from NCS
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Presence details broadcast for a single participant (human or agent) on a document.
|
|
16
|
+
*
|
|
17
|
+
* @remarks Agents are modelled as ordinary participants distinguished only by the
|
|
18
|
+
* `agent:` prefix on their `userId`/`sessionId` (see `isAIProviderID`); this package
|
|
19
|
+
* refers to them as "AI providers". Note this base type carries no last-active time —
|
|
20
|
+
* a participant's `lastActive` is derived from {@link PresencePayload.timestamp} when the
|
|
21
|
+
* payload is hydrated into a participant.
|
|
22
|
+
*/
|
|
23
|
+
|
|
14
24
|
export var AcknowledgementResponseTypes = /*#__PURE__*/function (AcknowledgementResponseTypes) {
|
|
15
25
|
AcknowledgementResponseTypes["SUCCESS"] = "SUCCESS";
|
|
16
26
|
AcknowledgementResponseTypes["ERROR"] = "ERROR";
|
|
@@ -8,6 +8,15 @@ import type { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model
|
|
|
8
8
|
import { CustomError } from '../errors/custom-errors';
|
|
9
9
|
export declare const createLogger: (prefix: string, color?: string) => (msg: string, data?: any) => void;
|
|
10
10
|
export declare function sleep(ms: number): Promise<any>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns whether an id belongs to an agent — referred to as an "AI provider" in this
|
|
13
|
+
* package's terminology.
|
|
14
|
+
*
|
|
15
|
+
* @remarks Agents are not a distinct type: they are ordinary participants distinguished
|
|
16
|
+
* only by the `agent:` prefix on their `userId`/`sessionId`. This predicate is the single
|
|
17
|
+
* source of truth for that convention and gates agent-specific presence handling across the
|
|
18
|
+
* provider (e.g. immediate `presence` emission and agent-leave cleanup).
|
|
19
|
+
*/
|
|
11
20
|
export declare const isAIProviderID: (id: string) => boolean;
|
|
12
21
|
export declare const getProduct: (productInfo?: ProductInformation) => string;
|
|
13
22
|
export declare const getSubProduct: (productInfo?: ProductInformation) => string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -143,16 +143,40 @@ export type BroadcastIncomingPayload = {
|
|
|
143
143
|
sessionId?: string;
|
|
144
144
|
timestamp?: number;
|
|
145
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* Presence details broadcast for a single participant (human or agent) on a document.
|
|
148
|
+
*
|
|
149
|
+
* @remarks Agents are modelled as ordinary participants distinguished only by the
|
|
150
|
+
* `agent:` prefix on their `userId`/`sessionId` (see `isAIProviderID`); this package
|
|
151
|
+
* refers to them as "AI providers". Note this base type carries no last-active time —
|
|
152
|
+
* a participant's `lastActive` is derived from {@link PresencePayload.timestamp} when the
|
|
153
|
+
* payload is hydrated into a participant.
|
|
154
|
+
*/
|
|
146
155
|
export type PresenceData = {
|
|
147
156
|
clientId: number | string;
|
|
157
|
+
/** Permission level the participant holds on the document (view / comment / edit). */
|
|
148
158
|
permit?: UserPermitType;
|
|
159
|
+
/** Whether the participant is a `viewer` or an `editor`; drives the presence facepile. */
|
|
149
160
|
presenceActivity?: PresenceActivity;
|
|
161
|
+
/**
|
|
162
|
+
* Correlates the presence connection with the editor websocket connection so avatar
|
|
163
|
+
* colours and telepointers line up across both.
|
|
164
|
+
*/
|
|
150
165
|
presenceId?: string;
|
|
166
|
+
/** Stable identifier for this presence session. For agents, carries the `agent:` prefix. */
|
|
151
167
|
sessionId: string;
|
|
168
|
+
/** Participant identity. For agents, carries the `agent:` prefix. */
|
|
152
169
|
userId: string | undefined;
|
|
153
170
|
};
|
|
154
171
|
export type PresencePayload = PresenceData & {
|
|
155
172
|
data?: Record<string, any>;
|
|
173
|
+
/**
|
|
174
|
+
* Epoch milliseconds of when this presence was last observed (added by NCS).
|
|
175
|
+
*
|
|
176
|
+
* @remarks Hydrated into the participant's `lastActive` (see `createParticipantFromPayload`),
|
|
177
|
+
* which drives inactivity filtering and, for agents, is the last-active time surfaced on the
|
|
178
|
+
* presence facepile. On the server this same value is the agent session's `updatedAt`.
|
|
179
|
+
*/
|
|
156
180
|
timestamp: number;
|
|
157
181
|
};
|
|
158
182
|
export type TelepointerPayload = PresencePayload & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.24",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
30
30
|
"@atlaskit/prosemirror-collab": "^1.0.0",
|
|
31
31
|
"@atlaskit/react-ufo": "^7.3.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^127.0.0",
|
|
33
33
|
"@atlaskit/ufo": "^1.0.0",
|
|
34
34
|
"@atlaskit/util-service-support": "^7.2.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@atlaskit/editor-common": "^116.
|
|
71
|
+
"@atlaskit/editor-common": "^116.33.0"
|
|
72
72
|
}
|
|
73
73
|
}
|