@theia/collaboration 1.46.0-next.241

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.
Files changed (43) hide show
  1. package/README.md +34 -0
  2. package/lib/browser/collaboration-color-service.d.ts +27 -0
  3. package/lib/browser/collaboration-color-service.d.ts.map +1 -0
  4. package/lib/browser/collaboration-color-service.js +76 -0
  5. package/lib/browser/collaboration-color-service.js.map +1 -0
  6. package/lib/browser/collaboration-file-system-provider.d.ts +37 -0
  7. package/lib/browser/collaboration-file-system-provider.d.ts.map +1 -0
  8. package/lib/browser/collaboration-file-system-provider.js +107 -0
  9. package/lib/browser/collaboration-file-system-provider.js.map +1 -0
  10. package/lib/browser/collaboration-frontend-contribution.d.ts +43 -0
  11. package/lib/browser/collaboration-frontend-contribution.d.ts.map +1 -0
  12. package/lib/browser/collaboration-frontend-contribution.js +334 -0
  13. package/lib/browser/collaboration-frontend-contribution.js.map +1 -0
  14. package/lib/browser/collaboration-frontend-module.d.ts +4 -0
  15. package/lib/browser/collaboration-frontend-module.d.ts.map +1 -0
  16. package/lib/browser/collaboration-frontend-module.js +38 -0
  17. package/lib/browser/collaboration-frontend-module.js.map +1 -0
  18. package/lib/browser/collaboration-instance.d.ts +94 -0
  19. package/lib/browser/collaboration-instance.d.ts.map +1 -0
  20. package/lib/browser/collaboration-instance.js +806 -0
  21. package/lib/browser/collaboration-instance.js.map +1 -0
  22. package/lib/browser/collaboration-utils.d.ts +8 -0
  23. package/lib/browser/collaboration-utils.d.ts.map +1 -0
  24. package/lib/browser/collaboration-utils.js +63 -0
  25. package/lib/browser/collaboration-utils.js.map +1 -0
  26. package/lib/browser/collaboration-workspace-service.d.ts +12 -0
  27. package/lib/browser/collaboration-workspace-service.d.ts.map +1 -0
  28. package/lib/browser/collaboration-workspace-service.js +67 -0
  29. package/lib/browser/collaboration-workspace-service.js.map +1 -0
  30. package/lib/package.spec.d.ts +1 -0
  31. package/lib/package.spec.d.ts.map +1 -0
  32. package/lib/package.spec.js +26 -0
  33. package/lib/package.spec.js.map +1 -0
  34. package/package.json +58 -0
  35. package/src/browser/collaboration-color-service.ts +77 -0
  36. package/src/browser/collaboration-file-system-provider.ts +117 -0
  37. package/src/browser/collaboration-frontend-contribution.ts +327 -0
  38. package/src/browser/collaboration-frontend-module.ts +37 -0
  39. package/src/browser/collaboration-instance.ts +819 -0
  40. package/src/browser/collaboration-utils.ts +59 -0
  41. package/src/browser/collaboration-workspace-service.ts +69 -0
  42. package/src/browser/style/index.css +22 -0
  43. package/src/package.spec.ts +28 -0
@@ -0,0 +1,334 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CollaborationFrontendContribution = exports.DEFAULT_COLLABORATION_SERVER_URL = exports.COLLABORATION_SERVER_URL = exports.COLLABORATION_AUTH_TOKEN = exports.COLLABORATION_STATUS_BAR_ID = exports.CollaborationCommands = exports.COLLABORATION_CATEGORY = void 0;
19
+ const tslib_1 = require("tslib");
20
+ require("../../src/browser/style/index.css");
21
+ const core_1 = require("@theia/core");
22
+ const inversify_1 = require("@theia/core/shared/inversify");
23
+ const open_collaboration_protocol_1 = require("open-collaboration-protocol");
24
+ const window_service_1 = require("@theia/core/lib/browser/window/window-service");
25
+ const collaboration_instance_1 = require("./collaboration-instance");
26
+ const env_variables_1 = require("@theia/core/lib/common/env-variables");
27
+ const promise_util_1 = require("@theia/core/lib/common/promise-util");
28
+ const collaboration_workspace_service_1 = require("./collaboration-workspace-service");
29
+ const status_bar_1 = require("@theia/core/lib/browser/status-bar");
30
+ const widget_1 = require("@theia/core/lib/browser/widgets/widget");
31
+ const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
32
+ exports.COLLABORATION_CATEGORY = 'Collaboration';
33
+ var CollaborationCommands;
34
+ (function (CollaborationCommands) {
35
+ CollaborationCommands.CREATE_ROOM = {
36
+ id: 'collaboration.create-room'
37
+ };
38
+ CollaborationCommands.JOIN_ROOM = {
39
+ id: 'collaboration.join-room'
40
+ };
41
+ })(CollaborationCommands || (exports.CollaborationCommands = CollaborationCommands = {}));
42
+ exports.COLLABORATION_STATUS_BAR_ID = 'statusBar.collaboration';
43
+ exports.COLLABORATION_AUTH_TOKEN = 'THEIA_COLLAB_AUTH_TOKEN';
44
+ exports.COLLABORATION_SERVER_URL = 'COLLABORATION_SERVER_URL';
45
+ exports.DEFAULT_COLLABORATION_SERVER_URL = 'https://api.open-collab.tools/';
46
+ let CollaborationFrontendContribution = class CollaborationFrontendContribution {
47
+ constructor() {
48
+ this.connectionProvider = new promise_util_1.Deferred();
49
+ }
50
+ init() {
51
+ this.setStatusBarEntryDefault();
52
+ this.getCollaborationServerUrl().then(serverUrl => {
53
+ var _a;
54
+ const authHandler = new open_collaboration_protocol_1.ConnectionProvider({
55
+ url: serverUrl,
56
+ client: frontend_application_config_provider_1.FrontendApplicationConfigProvider.get().applicationName,
57
+ fetch: window.fetch.bind(window),
58
+ opener: url => this.windowService.openNewWindow(url, { external: true }),
59
+ transports: [open_collaboration_protocol_1.SocketIoTransportProvider],
60
+ userToken: (_a = localStorage.getItem(exports.COLLABORATION_AUTH_TOKEN)) !== null && _a !== void 0 ? _a : undefined
61
+ });
62
+ this.connectionProvider.resolve(authHandler);
63
+ }, err => this.connectionProvider.reject(err));
64
+ }
65
+ async onStatusDefaultClick() {
66
+ var _a;
67
+ const items = [];
68
+ if (this.workspaceService.opened) {
69
+ items.push({
70
+ label: core_1.nls.localize('theia/collaboration/createRoom', 'Create New Collaboration Session'),
71
+ iconClasses: (0, widget_1.codiconArray)('add'),
72
+ execute: () => this.commands.executeCommand(CollaborationCommands.CREATE_ROOM.id)
73
+ });
74
+ }
75
+ items.push({
76
+ label: core_1.nls.localize('theia/collaboration/joinRoom', 'Join Collaboration Session'),
77
+ iconClasses: (0, widget_1.codiconArray)('vm-connect'),
78
+ execute: () => this.commands.executeCommand(CollaborationCommands.JOIN_ROOM.id)
79
+ });
80
+ await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(items, {
81
+ placeholder: core_1.nls.localize('theia/collaboration/selectCollaboration', 'Select collaboration option')
82
+ }));
83
+ }
84
+ async onStatusSharedClick(code) {
85
+ var _a;
86
+ const items = [{
87
+ label: core_1.nls.localize('theia/collaboration/invite', 'Invite Others'),
88
+ detail: core_1.nls.localize('theia/collaboration/inviteDetail', 'Copy the invitation code for sharing it with others to join the session.'),
89
+ iconClasses: (0, widget_1.codiconArray)('clippy'),
90
+ execute: () => this.displayCopyNotification(code)
91
+ }];
92
+ if (this.currentInstance) {
93
+ // TODO: Implement readonly mode
94
+ // if (this.currentInstance.readonly) {
95
+ // items.push({
96
+ // label: nls.localize('theia/collaboration/enableEditing', 'Enable Workspace Editing'),
97
+ // detail: nls.localize('theia/collaboration/enableEditingDetail', 'Allow collaborators to modify content in your workspace.'),
98
+ // iconClasses: codiconArray('unlock'),
99
+ // execute: () => {
100
+ // if (this.currentInstance) {
101
+ // this.currentInstance.readonly = false;
102
+ // }
103
+ // }
104
+ // });
105
+ // } else {
106
+ // items.push({
107
+ // label: nls.localize('theia/collaboration/disableEditing', 'Disable Workspace Editing'),
108
+ // detail: nls.localize('theia/collaboration/disableEditingDetail', 'Restrict others from making changes to your workspace.'),
109
+ // iconClasses: codiconArray('lock'),
110
+ // execute: () => {
111
+ // if (this.currentInstance) {
112
+ // this.currentInstance.readonly = true;
113
+ // }
114
+ // }
115
+ // });
116
+ // }
117
+ }
118
+ items.push({
119
+ label: core_1.nls.localize('theia/collaboration/end', 'End Collaboration Session'),
120
+ detail: core_1.nls.localize('theia/collaboration/endDetail', 'Terminate the session, cease content sharing, and revoke access for others.'),
121
+ iconClasses: (0, widget_1.codiconArray)('circle-slash'),
122
+ execute: () => { var _a; return (_a = this.currentInstance) === null || _a === void 0 ? void 0 : _a.dispose(); }
123
+ });
124
+ await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(items, {
125
+ placeholder: core_1.nls.localize('theia/collaboration/whatToDo', 'What would you like to do with other collaborators?')
126
+ }));
127
+ }
128
+ async onStatusConnectedClick(code) {
129
+ var _a;
130
+ const items = [{
131
+ label: core_1.nls.localize('theia/collaboration/invite', 'Invite Others'),
132
+ detail: core_1.nls.localize('theia/collaboration/inviteDetail', 'Copy the invitation code for sharing it with others to join the session.'),
133
+ iconClasses: (0, widget_1.codiconArray)('clippy'),
134
+ execute: () => this.displayCopyNotification(code)
135
+ }];
136
+ items.push({
137
+ label: core_1.nls.localize('theia/collaboration/leave', 'Leave Collaboration Session'),
138
+ detail: core_1.nls.localize('theia/collaboration/leaveDetail', 'Disconnect from the current collaboration session and close the workspace.'),
139
+ iconClasses: (0, widget_1.codiconArray)('circle-slash'),
140
+ execute: () => { var _a; return (_a = this.currentInstance) === null || _a === void 0 ? void 0 : _a.dispose(); }
141
+ });
142
+ await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.showQuickPick(items, {
143
+ placeholder: core_1.nls.localize('theia/collaboration/whatToDo', 'What would you like to do with other collaborators?')
144
+ }));
145
+ }
146
+ async setStatusBarEntryDefault() {
147
+ await this.setStatusBarEntry({
148
+ text: '$(codicon-live-share) ' + core_1.nls.localize('theia/collaboration/collaborate', 'Collaborate'),
149
+ tooltip: core_1.nls.localize('theia/collaboration/startSession', 'Start or join collaboration session'),
150
+ onclick: () => this.onStatusDefaultClick()
151
+ });
152
+ }
153
+ async setStatusBarEntryShared(code) {
154
+ await this.setStatusBarEntry({
155
+ text: '$(codicon-broadcast) ' + core_1.nls.localizeByDefault('Shared'),
156
+ tooltip: core_1.nls.localize('theia/collaboration/sharedSession', 'Shared a collaboration session'),
157
+ onclick: () => this.onStatusSharedClick(code)
158
+ });
159
+ }
160
+ async setStatusBarEntryConnected(code) {
161
+ await this.setStatusBarEntry({
162
+ text: '$(codicon-broadcast) ' + core_1.nls.localize('theia/collaboration/connected', 'Connected'),
163
+ tooltip: core_1.nls.localize('theia/collaboration/connectedSession', 'Connected to a collaboration session'),
164
+ onclick: () => this.onStatusConnectedClick(code)
165
+ });
166
+ }
167
+ async setStatusBarEntry(entry) {
168
+ await this.statusBar.setElement(exports.COLLABORATION_STATUS_BAR_ID, {
169
+ ...entry,
170
+ alignment: status_bar_1.StatusBarAlignment.LEFT,
171
+ priority: 5
172
+ });
173
+ }
174
+ async getCollaborationServerUrl() {
175
+ const serverUrlVariable = await this.envVariables.getValue(exports.COLLABORATION_SERVER_URL);
176
+ return (serverUrlVariable === null || serverUrlVariable === void 0 ? void 0 : serverUrlVariable.value) || exports.DEFAULT_COLLABORATION_SERVER_URL;
177
+ }
178
+ registerCommands(commands) {
179
+ commands.registerCommand(CollaborationCommands.CREATE_ROOM, {
180
+ execute: async () => {
181
+ var _a;
182
+ const cancelTokenSource = new core_1.CancellationTokenSource();
183
+ const progress = await this.messageService.showProgress({
184
+ text: core_1.nls.localize('theia/collaboration/creatingRoom', 'Creating Session'),
185
+ options: {
186
+ cancelable: true
187
+ }
188
+ }, () => cancelTokenSource.cancel());
189
+ try {
190
+ const authHandler = await this.connectionProvider.promise;
191
+ const roomClaim = await authHandler.createRoom({
192
+ reporter: info => progress.report({ message: info.message }),
193
+ abortSignal: this.toAbortSignal(cancelTokenSource.token)
194
+ });
195
+ if (roomClaim.loginToken) {
196
+ localStorage.setItem(exports.COLLABORATION_AUTH_TOKEN, roomClaim.loginToken);
197
+ }
198
+ (_a = this.currentInstance) === null || _a === void 0 ? void 0 : _a.dispose();
199
+ const connection = await authHandler.connect(roomClaim.roomToken);
200
+ this.currentInstance = this.collaborationInstanceFactory({
201
+ role: 'host',
202
+ connection
203
+ });
204
+ this.currentInstance.onDidClose(() => {
205
+ this.setStatusBarEntryDefault();
206
+ });
207
+ const roomCode = roomClaim.roomId;
208
+ this.setStatusBarEntryShared(roomCode);
209
+ this.displayCopyNotification(roomCode, true);
210
+ }
211
+ catch (err) {
212
+ await this.messageService.error(core_1.nls.localize('theia/collaboration/failedCreate', 'Failed to create room: {0}', err.message));
213
+ }
214
+ finally {
215
+ progress.cancel();
216
+ }
217
+ }
218
+ });
219
+ commands.registerCommand(CollaborationCommands.JOIN_ROOM, {
220
+ execute: async () => {
221
+ var _a, _b;
222
+ let joinRoomProgress;
223
+ const cancelTokenSource = new core_1.CancellationTokenSource();
224
+ try {
225
+ const authHandler = await this.connectionProvider.promise;
226
+ const id = await ((_a = this.quickInputService) === null || _a === void 0 ? void 0 : _a.input({
227
+ placeHolder: core_1.nls.localize('theia/collaboration/enterCode', 'Enter collaboration session code')
228
+ }));
229
+ if (!id) {
230
+ return;
231
+ }
232
+ joinRoomProgress = await this.messageService.showProgress({
233
+ text: core_1.nls.localize('theia/collaboration/joiningRoom', 'Joining Session'),
234
+ options: {
235
+ cancelable: true
236
+ }
237
+ }, () => cancelTokenSource.cancel());
238
+ const roomClaim = await authHandler.joinRoom({
239
+ roomId: id,
240
+ reporter: info => joinRoomProgress === null || joinRoomProgress === void 0 ? void 0 : joinRoomProgress.report({ message: info.message }),
241
+ abortSignal: this.toAbortSignal(cancelTokenSource.token)
242
+ });
243
+ joinRoomProgress.cancel();
244
+ if (roomClaim.loginToken) {
245
+ localStorage.setItem(exports.COLLABORATION_AUTH_TOKEN, roomClaim.loginToken);
246
+ }
247
+ (_b = this.currentInstance) === null || _b === void 0 ? void 0 : _b.dispose();
248
+ const connection = await authHandler.connect(roomClaim.roomToken, roomClaim.host);
249
+ this.currentInstance = this.collaborationInstanceFactory({
250
+ role: 'guest',
251
+ connection
252
+ });
253
+ this.currentInstance.onDidClose(() => {
254
+ this.setStatusBarEntryDefault();
255
+ });
256
+ this.setStatusBarEntryConnected(roomClaim.roomId);
257
+ }
258
+ catch (err) {
259
+ joinRoomProgress === null || joinRoomProgress === void 0 ? void 0 : joinRoomProgress.cancel();
260
+ await this.messageService.error(core_1.nls.localize('theia/collaboration/failedJoin', 'Failed to join room: {0}', err.message));
261
+ }
262
+ }
263
+ });
264
+ }
265
+ toAbortSignal(...tokens) {
266
+ const controller = new AbortController();
267
+ tokens.forEach(token => token.onCancellationRequested(() => controller.abort()));
268
+ return controller.signal;
269
+ }
270
+ async displayCopyNotification(code, firstTime = false) {
271
+ navigator.clipboard.writeText(code);
272
+ const notification = core_1.nls.localize('theia/collaboration/copiedInvitation', 'Invitation code copied to clipboard.');
273
+ if (firstTime) {
274
+ // const makeReadonly = nls.localize('theia/collaboration/makeReadonly', 'Make readonly');
275
+ const copyAgain = core_1.nls.localize('theia/collaboration/copyAgain', 'Copy Again');
276
+ const copyResult = await this.messageService.info(notification,
277
+ // makeReadonly,
278
+ copyAgain);
279
+ // if (copyResult === makeReadonly && this.currentInstance) {
280
+ // this.currentInstance.readonly = true;
281
+ // }
282
+ if (copyResult === copyAgain) {
283
+ navigator.clipboard.writeText(code);
284
+ }
285
+ }
286
+ else {
287
+ await this.messageService.info(notification);
288
+ }
289
+ }
290
+ };
291
+ exports.CollaborationFrontendContribution = CollaborationFrontendContribution;
292
+ tslib_1.__decorate([
293
+ (0, inversify_1.inject)(window_service_1.WindowService),
294
+ tslib_1.__metadata("design:type", Object)
295
+ ], CollaborationFrontendContribution.prototype, "windowService", void 0);
296
+ tslib_1.__decorate([
297
+ (0, inversify_1.inject)(core_1.QuickInputService),
298
+ (0, inversify_1.optional)(),
299
+ tslib_1.__metadata("design:type", Object)
300
+ ], CollaborationFrontendContribution.prototype, "quickInputService", void 0);
301
+ tslib_1.__decorate([
302
+ (0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
303
+ tslib_1.__metadata("design:type", Object)
304
+ ], CollaborationFrontendContribution.prototype, "envVariables", void 0);
305
+ tslib_1.__decorate([
306
+ (0, inversify_1.inject)(collaboration_workspace_service_1.CollaborationWorkspaceService),
307
+ tslib_1.__metadata("design:type", collaboration_workspace_service_1.CollaborationWorkspaceService)
308
+ ], CollaborationFrontendContribution.prototype, "workspaceService", void 0);
309
+ tslib_1.__decorate([
310
+ (0, inversify_1.inject)(core_1.MessageService),
311
+ tslib_1.__metadata("design:type", core_1.MessageService)
312
+ ], CollaborationFrontendContribution.prototype, "messageService", void 0);
313
+ tslib_1.__decorate([
314
+ (0, inversify_1.inject)(core_1.CommandRegistry),
315
+ tslib_1.__metadata("design:type", core_1.CommandRegistry)
316
+ ], CollaborationFrontendContribution.prototype, "commands", void 0);
317
+ tslib_1.__decorate([
318
+ (0, inversify_1.inject)(status_bar_1.StatusBar),
319
+ tslib_1.__metadata("design:type", Object)
320
+ ], CollaborationFrontendContribution.prototype, "statusBar", void 0);
321
+ tslib_1.__decorate([
322
+ (0, inversify_1.inject)(collaboration_instance_1.CollaborationInstanceFactory),
323
+ tslib_1.__metadata("design:type", Function)
324
+ ], CollaborationFrontendContribution.prototype, "collaborationInstanceFactory", void 0);
325
+ tslib_1.__decorate([
326
+ (0, inversify_1.postConstruct)(),
327
+ tslib_1.__metadata("design:type", Function),
328
+ tslib_1.__metadata("design:paramtypes", []),
329
+ tslib_1.__metadata("design:returntype", void 0)
330
+ ], CollaborationFrontendContribution.prototype, "init", null);
331
+ exports.CollaborationFrontendContribution = CollaborationFrontendContribution = tslib_1.__decorate([
332
+ (0, inversify_1.injectable)()
333
+ ], CollaborationFrontendContribution);
334
+ //# sourceMappingURL=collaboration-frontend-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collaboration-frontend-contribution.js","sourceRoot":"","sources":["../../src/browser/collaboration-frontend-contribution.ts"],"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,kBAAM,EAAC,kCAAkB,CAAC;;uEACyB;AAGjC;IADlB,IAAA,kBAAM,EAAC,+DAA6B,CAAC;sCACD,+DAA6B;2EAAC;AAGhD;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACY,qBAAc;yEAAC;AAG/B;IADlB,IAAA,kBAAM,EAAC,sBAAe,CAAC;sCACK,sBAAe;mEAAC;AAG1B;IADlB,IAAA,kBAAM,EAAC,sBAAS,CAAC;;oEACsB;AAGrB;IADlB,IAAA,kBAAM,EAAC,qDAA4B,CAAC;;uFACyC;AAKpE;IADT,IAAA,yBAAa,GAAE;;;;6DAcf;4CA5CQ,iCAAiC;IAD7C,IAAA,sBAAU,GAAE;GACA,iCAAiC,CAoR7C"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=collaboration-frontend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collaboration-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/collaboration-frontend-module.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAQ/D,wBAWG"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const core_1 = require("@theia/core");
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const browser_1 = require("@theia/workspace/lib/browser");
21
+ const collaboration_color_service_1 = require("./collaboration-color-service");
22
+ const collaboration_frontend_contribution_1 = require("./collaboration-frontend-contribution");
23
+ const collaboration_instance_1 = require("./collaboration-instance");
24
+ const collaboration_utils_1 = require("./collaboration-utils");
25
+ const collaboration_workspace_service_1 = require("./collaboration-workspace-service");
26
+ exports.default = new inversify_1.ContainerModule((bind, _, __, rebind) => {
27
+ bind(collaboration_workspace_service_1.CollaborationWorkspaceService).toSelf().inSingletonScope();
28
+ rebind(browser_1.WorkspaceService).toService(collaboration_workspace_service_1.CollaborationWorkspaceService);
29
+ bind(collaboration_utils_1.CollaborationUtils).toSelf().inSingletonScope();
30
+ bind(collaboration_frontend_contribution_1.CollaborationFrontendContribution).toSelf().inSingletonScope();
31
+ bind(core_1.CommandContribution).toService(collaboration_frontend_contribution_1.CollaborationFrontendContribution);
32
+ bind(collaboration_instance_1.CollaborationInstanceFactory).toFactory(context => (options) => {
33
+ const container = (0, collaboration_instance_1.createCollaborationInstanceContainer)(context.container, options);
34
+ return container.get(collaboration_instance_1.CollaborationInstance);
35
+ });
36
+ bind(collaboration_color_service_1.CollaborationColorService).toSelf().inSingletonScope();
37
+ });
38
+ //# sourceMappingURL=collaboration-frontend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collaboration-frontend-module.js","sourceRoot":"","sources":["../../src/browser/collaboration-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,sCAAkD;AAClD,4DAA+D;AAC/D,0DAAgE;AAChE,+EAA0E;AAC1E,+FAA0F;AAC1F,qEAAmK;AACnK,+DAA2D;AAC3D,uFAAkF;AAElF,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;IACvD,IAAI,CAAC,+DAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,MAAM,CAAC,0BAAgB,CAAC,CAAC,SAAS,CAAC,+DAA6B,CAAC,CAAC;IAClE,IAAI,CAAC,wCAAkB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACrD,IAAI,CAAC,uEAAiC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACpE,IAAI,CAAC,0BAAmB,CAAC,CAAC,SAAS,CAAC,uEAAiC,CAAC,CAAC;IACvE,IAAI,CAAC,qDAA4B,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAqC,EAAE,EAAE;QAC9F,MAAM,SAAS,GAAG,IAAA,6DAAoC,EAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnF,OAAO,SAAS,CAAC,GAAG,CAAC,8CAAqB,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,uDAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AAChE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,94 @@
1
+ import * as types from 'open-collaboration-protocol';
2
+ import * as Y from 'yjs';
3
+ import * as awarenessProtocol from 'y-protocols/awareness';
4
+ import { Disposable, DisposableCollection, Emitter, Event, MessageService, URI } from '@theia/core';
5
+ import { Container, interfaces } from '@theia/core/shared/inversify';
6
+ import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shell';
7
+ import { EditorManager } from '@theia/editor/lib/browser/editor-manager';
8
+ import { FileService } from '@theia/filesystem/lib/browser/file-service';
9
+ import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
10
+ import { CollaborationWorkspaceService } from './collaboration-workspace-service';
11
+ import { Range as MonacoRange } from '@theia/monaco-editor-core';
12
+ import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
13
+ import { Deferred } from '@theia/core/lib/common/promise-util';
14
+ import { EditorDecoration, EditorWidget, Selection, TextEditorDocument } from '@theia/editor/lib/browser';
15
+ import { OpenerService } from '@theia/core/lib/browser';
16
+ import { CollaborationFileSystemProvider } from './collaboration-file-system-provider';
17
+ import { Range } from '@theia/core/shared/vscode-languageserver-protocol';
18
+ import { CollaborationColorService } from './collaboration-color-service';
19
+ import { OpenCollaborationYjsProvider } from 'open-collaboration-yjs';
20
+ import { CollaborationUtils } from './collaboration-utils';
21
+ export declare const CollaborationInstanceFactory: unique symbol;
22
+ export type CollaborationInstanceFactory = (connection: CollaborationInstanceOptions) => CollaborationInstance;
23
+ export declare const CollaborationInstanceOptions: unique symbol;
24
+ export interface CollaborationInstanceOptions {
25
+ role: 'host' | 'guest';
26
+ connection: types.ProtocolBroadcastConnection;
27
+ }
28
+ export declare function createCollaborationInstanceContainer(parent: interfaces.Container, options: CollaborationInstanceOptions): Container;
29
+ export interface DisposablePeer extends Disposable {
30
+ peer: types.Peer;
31
+ }
32
+ export declare const COLLABORATION_SELECTION = "theia-collaboration-selection";
33
+ export declare const COLLABORATION_SELECTION_MARKER = "theia-collaboration-selection-marker";
34
+ export declare const COLLABORATION_SELECTION_INVERTED = "theia-collaboration-selection-inverted";
35
+ export declare class CollaborationInstance implements Disposable {
36
+ protected readonly messageService: MessageService;
37
+ protected readonly workspaceService: CollaborationWorkspaceService;
38
+ protected readonly fileService: FileService;
39
+ protected readonly monacoModelService: MonacoTextModelService;
40
+ protected readonly editorManager: EditorManager;
41
+ protected readonly openerService: OpenerService;
42
+ protected readonly shell: ApplicationShell;
43
+ protected readonly options: CollaborationInstanceOptions;
44
+ protected readonly collaborationColorService: CollaborationColorService;
45
+ protected readonly utils: CollaborationUtils;
46
+ protected identity: Deferred<types.Peer>;
47
+ protected peers: Map<string, DisposablePeer>;
48
+ protected yjs: Y.Doc;
49
+ protected yjsAwareness: awarenessProtocol.Awareness;
50
+ protected yjsProvider: OpenCollaborationYjsProvider;
51
+ protected colorIndex: number;
52
+ protected editorDecorations: Map<EditorWidget, string[]>;
53
+ protected fileSystem?: CollaborationFileSystemProvider;
54
+ protected permissions: types.Permissions;
55
+ protected onDidCloseEmitter: Emitter<void>;
56
+ get onDidClose(): Event<void>;
57
+ protected toDispose: DisposableCollection;
58
+ protected _readonly: boolean;
59
+ get readonly(): boolean;
60
+ set readonly(value: boolean);
61
+ get isHost(): boolean;
62
+ get host(): types.Peer;
63
+ protected init(): void;
64
+ protected registerProtocolEvents(connection: types.ProtocolBroadcastConnection): void;
65
+ protected registerEditorEvents(connection: types.ProtocolBroadcastConnection): void;
66
+ protected isSharedResource(resource?: URI): boolean;
67
+ protected registerFileSystemEvents(connection: types.ProtocolBroadcastConnection): void;
68
+ protected rerenderPresence(...widgets: EditorWidget[]): void;
69
+ protected rerenderPresenceDecorations(decorations: Map<string, EditorDecoration[]>, ...widgets: EditorWidget[]): void;
70
+ protected registerFileSystemChanges(): void;
71
+ protected registerPresenceUpdate(widget: EditorWidget): Promise<void>;
72
+ protected updateEditorPresence(widget: EditorWidget): void;
73
+ protected setSharedSelection(selection?: types.ClientSelection): void;
74
+ protected rangeEqual(a: Range, b: Range): boolean;
75
+ initialize(data: types.InitData): Promise<void>;
76
+ protected addPeer(peer: types.Peer): void;
77
+ protected createPeerStyleSheet(peer: types.Peer): Disposable;
78
+ protected getOpenEditors(uri?: URI): EditorWidget[];
79
+ protected createSelectionFromRelative(selection: types.RelativeTextSelection, model: MonacoEditorModel): Selection | undefined;
80
+ protected createRelativeSelection(selection: Selection, model: TextEditorDocument, ytext: Y.Text): types.RelativeTextSelection;
81
+ protected readonly yjsMutex: import("lib0/mutex").mutex;
82
+ protected registerModelUpdate(model: MonacoEditorModel): void;
83
+ protected resetYjsText(yjsText: Y.Text, text: string): void;
84
+ protected getModel(uri: URI): MonacoEditorModel | undefined;
85
+ protected pushChangesToModel(model: MonacoEditorModel, changes: {
86
+ range: MonacoRange;
87
+ text: string;
88
+ forceMoveMarkers?: boolean;
89
+ }[]): void;
90
+ protected softReplaceModel(model: MonacoEditorModel, text: string): void;
91
+ protected openUri(uri: URI): Promise<void>;
92
+ dispose(): void;
93
+ }
94
+ //# sourceMappingURL=collaboration-instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collaboration-instance.d.ts","sourceRoot":"","sources":["../../src/browser/collaboration-instance.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAO,MAAM,aAAa,CAAC;AACzG,OAAO,EAAE,SAAS,EAAsB,UAAU,EAAiB,MAAM,8BAA8B,CAAC;AACxG,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAA0B,MAAM,2BAA2B,CA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