@ckeditor/ckeditor5-real-time-collaboration 48.2.0-alpha.7 → 48.3.0-alpha.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/dist/augmentation.d.ts +67 -67
- package/dist/common-translations.d.ts +6 -6
- package/dist/config.d.ts +43 -43
- package/dist/index.d.ts +19 -19
- package/dist/index.js +6 -6
- package/dist/presencelist/presencelistui.d.ts +54 -54
- package/dist/presencelist/view/presencecounterview.d.ts +10 -10
- package/dist/presencelist/view/presencedropdownlistitemview.d.ts +14 -14
- package/dist/presencelist/view/presencedropdownlistview.d.ts +0 -4
- package/dist/presencelist/view/presenceinlinelistitemview.d.ts +15 -15
- package/dist/presencelist/view/presenceinlinelistview.d.ts +34 -34
- package/dist/presencelist/view/presencelistview.d.ts +5 -4
- package/dist/presencelist.d.ts +32 -32
- package/dist/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +56 -56
- package/dist/realtimecollaborativecomments.d.ts +40 -40
- package/dist/realtimecollaborativeediting/realtimecollaborationclient.d.ts +129 -140
- package/dist/realtimecollaborativeediting/sessions.d.ts +115 -117
- package/dist/realtimecollaborativeediting/usermarkers.d.ts +46 -46
- package/dist/realtimecollaborativeediting/websocketgateway.d.ts +59 -59
- package/dist/realtimecollaborativeediting.d.ts +29 -29
- package/dist/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +53 -53
- package/dist/realtimecollaborativerevisionhistory.d.ts +33 -33
- package/dist/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +47 -47
- package/dist/realtimecollaborativetrackchanges.d.ts +31 -31
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +13 -13
|
@@ -1,145 +1,134 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { Plugin, PendingActions, type Editor } from
|
|
10
|
-
import { Notification } from
|
|
11
|
-
import { WebSocketGateway } from
|
|
12
|
-
import { Sessions } from
|
|
13
|
-
import { UserMarkers } from
|
|
14
|
-
import { Users, type CollaborationHistory } from
|
|
15
|
-
import { CollaborativeEditingService } from
|
|
6
|
+
* @module real-time-collaboration/realtimecollaborativeediting/realtimecollaborationclient
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin, PendingActions, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { Notification } from "@ckeditor/ckeditor5-ui";
|
|
11
|
+
import { WebSocketGateway } from "./websocketgateway.js";
|
|
12
|
+
import { Sessions } from "./sessions.js";
|
|
13
|
+
import { UserMarkers } from "./usermarkers.js";
|
|
14
|
+
import { Users, type CollaborationHistory } from "@ckeditor/ckeditor5-collaboration-core";
|
|
15
|
+
import { CollaborativeEditingService } from "@ckeditor/ckeditor-cloud-services-collaboration";
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
* Handles the real-time collaborative editing.
|
|
18
|
+
*/
|
|
19
19
|
export declare class RealTimeCollaborationClient extends Plugin {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
* - connection
|
|
135
|
-
* - reconnection
|
|
136
|
-
* - sending buffered operations.
|
|
137
|
-
*
|
|
138
|
-
* @param sentOperations Operations sent to the server.
|
|
139
|
-
* @param response The server's response.
|
|
140
|
-
* @param requestId
|
|
141
|
-
* @returns Resolves to `true` if the updates process has finished,
|
|
142
|
-
* resolves to `false` if next batch of updates was sent to the server.
|
|
143
|
-
*/
|
|
144
|
-
private _handleServerResponse;
|
|
20
|
+
static CollaborativeEditingService: typeof CollaborativeEditingService;
|
|
21
|
+
/**
|
|
22
|
+
* The ID of the current editing session to which the client is connected (or was connected before losing the connection).
|
|
23
|
+
*/
|
|
24
|
+
sessionId: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Holds the history of operations that have been applied on the collaboration server.
|
|
27
|
+
*
|
|
28
|
+
* Contains only these operations, that have been already synchronized. It is exactly the same for all clients
|
|
29
|
+
* connected to the same editing session.
|
|
30
|
+
*
|
|
31
|
+
* All original operations are cloned.
|
|
32
|
+
*/
|
|
33
|
+
serverHistory: CollaborationHistory;
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static get requires(): PluginDependenciesOf<[WebSocketGateway, Sessions, UserMarkers, PendingActions, Users, Notification]>;
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
static get pluginName(): "RealTimeCollaborationClient";
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
static override get isOfficialPlugin(): true;
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
static override get isPremiumPlugin(): true;
|
|
50
|
+
/**
|
|
51
|
+
* Incremented every time the document is synchronized with Cloud Services server. It can be treated as the server's current document
|
|
52
|
+
* version. This number is stored between editing sessions, so even when all clients disconnect, the editing session is closed, the
|
|
53
|
+
* next time the document is initialized, the version number will stay the same and will continue to be incremented with
|
|
54
|
+
* subsequent document changes.
|
|
55
|
+
*
|
|
56
|
+
* Use this version to compare which client has a newer version of the document. It is recommended to save it together with the
|
|
57
|
+
* document content in the database. Comparing `cloudDocumentVersion` can be used to prevent overwriting a newer content with
|
|
58
|
+
* an older one from another client.
|
|
59
|
+
*/
|
|
60
|
+
get cloudDocumentVersion(): number;
|
|
61
|
+
/**
|
|
62
|
+
* The last document version synchronized with the server during current real-time collaboration session.
|
|
63
|
+
*
|
|
64
|
+
* Equals to `0` when the client is not connected to the server yet.
|
|
65
|
+
*
|
|
66
|
+
* This includes only operations created by this or other clients. Notably, user selection markers operations created by
|
|
67
|
+
* the server are excluded.
|
|
68
|
+
*/
|
|
69
|
+
get lastSyncVersion(): number;
|
|
70
|
+
constructor(editor: Editor);
|
|
71
|
+
/**
|
|
72
|
+
* @inheritDoc
|
|
73
|
+
*/
|
|
74
|
+
init(): void;
|
|
75
|
+
/**
|
|
76
|
+
* @inheritDoc
|
|
77
|
+
*/
|
|
78
|
+
override destroy(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Handles the server response after the reconnection.
|
|
81
|
+
*/
|
|
82
|
+
private _handleReconnectionResponse;
|
|
83
|
+
/**
|
|
84
|
+
* Connects the client to the editing session.
|
|
85
|
+
*
|
|
86
|
+
* If this client is the first one that tries connecting to the session, the session will be created based on its
|
|
87
|
+
* local operations. Otherwise, the server will respond with server operations that are already stored on the server for the
|
|
88
|
+
* existing session and those operations will replace this client's editor content.
|
|
89
|
+
*
|
|
90
|
+
* @param isReconnectionProcess Set to `true` when reconnecting to the document after the document has been flushed.
|
|
91
|
+
*/
|
|
92
|
+
private _connectService;
|
|
93
|
+
/**
|
|
94
|
+
* Handles operations received from the server. Callback for the `CollaborativeEditingService#event:operationsReceived`.
|
|
95
|
+
*/
|
|
96
|
+
private _handleReceivedOperations;
|
|
97
|
+
/**
|
|
98
|
+
* Connects the client to the editing session after it has been flushed. The client will use the local operations history to re-create
|
|
99
|
+
* the editing session on the server.
|
|
100
|
+
*/
|
|
101
|
+
private _connectAfterSessionHasBeenFlushed;
|
|
102
|
+
/**
|
|
103
|
+
* Fetches missing users based on author IDs of the given operations.
|
|
104
|
+
*/
|
|
105
|
+
private _fetchMissingUsers;
|
|
106
|
+
/**
|
|
107
|
+
* Performs root loading in a way that is safe for real-time collaboration. Synchronizes with the server and use the local data only
|
|
108
|
+
* if the given root has not been loaded on any other client yet. Returns a promise which resolves after the root is ready.
|
|
109
|
+
*
|
|
110
|
+
* It transforms given data and root attributes into operations and tries to send them to the server. The operations are sent in
|
|
111
|
+
* a regular way. The root is ready after they are finally applied on the server.
|
|
112
|
+
*
|
|
113
|
+
* @private
|
|
114
|
+
*/
|
|
115
|
+
private _loadRoot;
|
|
116
|
+
/**
|
|
117
|
+
* Handles the initial connection.
|
|
118
|
+
*/
|
|
119
|
+
private _handleInitialConnectionData;
|
|
120
|
+
private _sendBufferedOperations;
|
|
121
|
+
/**
|
|
122
|
+
* Handles a response from the server for the following actions:
|
|
123
|
+
* - connection
|
|
124
|
+
* - reconnection
|
|
125
|
+
* - sending buffered operations.
|
|
126
|
+
*
|
|
127
|
+
* @param sentOperations Operations sent to the server.
|
|
128
|
+
* @param response The server's response.
|
|
129
|
+
* @param requestId
|
|
130
|
+
* @returns Resolves to `true` if the updates process has finished,
|
|
131
|
+
* resolves to `false` if next batch of updates was sent to the server.
|
|
132
|
+
*/
|
|
133
|
+
private _handleServerResponse;
|
|
145
134
|
}
|
|
@@ -1,126 +1,124 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { ContextPlugin, type Editor, type Context } from
|
|
10
|
-
import { Collection } from
|
|
11
|
-
import { WebSocketGateway } from
|
|
12
|
-
import { Users, type User } from
|
|
13
|
-
import type { User as ServerUserModel, SessionCollection, ISocket } from
|
|
6
|
+
* @module real-time-collaboration/realtimecollaborativeediting/sessions
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin, type Editor, type Context, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { Collection } from "@ckeditor/ckeditor5-utils";
|
|
11
|
+
import { WebSocketGateway } from "./websocketgateway.js";
|
|
12
|
+
import { Users, type User } from "@ckeditor/ckeditor5-collaboration-core";
|
|
13
|
+
import type { User as ServerUserModel, SessionCollection, ISocket } from "@ckeditor/ckeditor-cloud-services-collaboration";
|
|
14
14
|
export type RtcServerUser = ServerUserModel & User;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
*
|
|
17
|
+
* The `Sessions` plugin stores the information about the users and sessions connected to the rich text editor.
|
|
18
|
+
*
|
|
19
|
+
* The difference between the sessions plugin and the {@link module:collaboration-core/users~Users `Users` plugin} is that
|
|
20
|
+
* `Users` also keeps information about the users who are not currently connected to the editor (for example, a comment
|
|
21
|
+
* author who is currently offline).
|
|
22
|
+
*
|
|
23
|
+
* If your integration uses {@link module:core/context~Context} and there are multiple channels used, the `Sessions` plugin
|
|
24
|
+
* aggregates users connected to all the channels.
|
|
25
|
+
*
|
|
26
|
+
* There are two types of entries in the sessions plugin: connected users and sessions.
|
|
27
|
+
*
|
|
28
|
+
* There is one session for each connection to a given channel. For example, for each open editor instance connecting
|
|
29
|
+
* to a given channel ID, there will be a session. Every session has a user. However, the same user can be linked
|
|
30
|
+
* with multiple sessions (for example, the same user opened the same URL in multiple tabs).
|
|
31
|
+
*
|
|
32
|
+
* In other words, if the same user (with the same user ID) opens the same document in two different tabs, they will create
|
|
33
|
+
* two sessions but only one user will be connected. You will be able to see two selections in the same document, both in
|
|
34
|
+
* the same color, but only a single user in the {@link module:real-time-collaboration/presencelist~PresenceList user presence list}.
|
|
35
|
+
*/
|
|
36
36
|
export declare class Sessions extends ContextPlugin {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
37
|
+
/**
|
|
38
|
+
* A map of session collections connected to the separate channels.
|
|
39
|
+
*
|
|
40
|
+
* The keys of the map are channel IDs and the values are collections of sessions.
|
|
41
|
+
*
|
|
42
|
+
* A session is represented by an object with the following properties:
|
|
43
|
+
* * `id` - A unique session ID.
|
|
44
|
+
* * `user` - A reference to the user.
|
|
45
|
+
*/
|
|
46
|
+
channelSessions: Map<string, Collection<ISocket>>;
|
|
47
|
+
/**
|
|
48
|
+
* A map of user collections connected to the separate channels.
|
|
49
|
+
*
|
|
50
|
+
* The keys of the map are channel IDs and the values are collections of users.
|
|
51
|
+
*/
|
|
52
|
+
channelConnectedUsers: Map<string, Collection<ISocket>>;
|
|
53
|
+
/**
|
|
54
|
+
* A collection of users currently connected to all channels.
|
|
55
|
+
*
|
|
56
|
+
* A local user is always the first element in this collection.
|
|
57
|
+
*/
|
|
58
|
+
allConnectedUsers: Collection<User>;
|
|
59
|
+
/**
|
|
60
|
+
* @inheritDoc
|
|
61
|
+
*/
|
|
62
|
+
static get pluginName(): "Sessions";
|
|
63
|
+
/**
|
|
64
|
+
* @inheritDoc
|
|
65
|
+
*/
|
|
66
|
+
static override get isOfficialPlugin(): true;
|
|
67
|
+
/**
|
|
68
|
+
* @inheritDoc
|
|
69
|
+
*/
|
|
70
|
+
static override get isPremiumPlugin(): true;
|
|
71
|
+
/**
|
|
72
|
+
* @inheritDoc
|
|
73
|
+
*/
|
|
74
|
+
static get requires(): PluginDependenciesOf<[WebSocketGateway, Users]>;
|
|
75
|
+
/**
|
|
76
|
+
* @inheritDoc
|
|
77
|
+
*/
|
|
78
|
+
constructor(context: Editor | Context);
|
|
79
|
+
/**
|
|
80
|
+
* @inheritDoc
|
|
81
|
+
*/
|
|
82
|
+
init(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Observes given service sessions and updates session and users according to it.
|
|
85
|
+
*/
|
|
86
|
+
register(channelId: string, serviceSessions: SessionCollection): void;
|
|
87
|
+
/**
|
|
88
|
+
* Stops observing given service sessions and remove all related sessions and users.
|
|
89
|
+
*/
|
|
90
|
+
unregister(channelId: string): void;
|
|
91
|
+
/**
|
|
92
|
+
* Session id of the current client.
|
|
93
|
+
*/
|
|
94
|
+
get mySessionId(): string;
|
|
95
|
+
/**
|
|
96
|
+
* Returns a reference to the user connected with a session with the given ID.
|
|
97
|
+
*/
|
|
98
|
+
getUserBySessionId(sessionId: string): RtcServerUser | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Returns a set of ids of all currently connected sessions for the given user.
|
|
101
|
+
*
|
|
102
|
+
* When one user is connected to the same document in two separate browser tabs
|
|
103
|
+
* then this users belongs to the two sessions.
|
|
104
|
+
*
|
|
105
|
+
* Optionally the result can be limited to the given channelId.
|
|
106
|
+
*/
|
|
107
|
+
getUserSessions(user: RtcServerUser, channelId?: string): Set<string>;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the role of a given user.
|
|
110
|
+
*/
|
|
111
|
+
getUserRole(user: RtcServerUser): string | undefined;
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
* Fired when the new user session is added.
|
|
115
|
+
*
|
|
116
|
+
* @eventName ~Sessions#sessionAdd:channelId
|
|
117
|
+
*/
|
|
118
118
|
export type RtcSessionAddEvent = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
];
|
|
119
|
+
name: "sessionAdd" | `sessionAdd:${string}`;
|
|
120
|
+
args: [{
|
|
121
|
+
channelId: string;
|
|
122
|
+
session: ISocket;
|
|
123
|
+
}];
|
|
126
124
|
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { Sessions } from
|
|
10
|
-
import
|
|
6
|
+
* @module real-time-collaboration/realtimecollaborativeediting/usermarkers
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { Sessions } from "./sessions.js";
|
|
10
|
+
import "../../theme/usermarkers.css";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
* This plugin:
|
|
13
|
+
*
|
|
14
|
+
* 1. Creates marker operations with current user selection on demand.
|
|
15
|
+
* 2. Renders clients selection markers.
|
|
16
|
+
*
|
|
17
|
+
* This plugin does not create markers automatically, instead it provides an API for it {@link #createUserMarkerOperations}.
|
|
18
|
+
* {@link RealTimeCollaborationClient} uses this API to create user selection operations in the most optimal moment
|
|
19
|
+
* (as the last operation in the operations package) - this is to reach the best compression result.
|
|
20
|
+
*/
|
|
21
21
|
export declare class UserMarkers extends Plugin {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get requires(): PluginDependenciesOf<[Sessions]>;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get pluginName(): "UserMarkers";
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static override get isOfficialPlugin(): true;
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static override get isPremiumPlugin(): true;
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
init(): void;
|
|
42
|
+
afterInit(): void;
|
|
43
|
+
/**
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
override destroy(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Creates marker operations with current user selection.
|
|
49
|
+
*/
|
|
50
|
+
createUserMarkerOperations(): void;
|
|
51
51
|
}
|