@jupyter/collaboration-extension 1.0.0-alpha.9 → 1.0.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/lib/collaboration.d.ts +2 -1
- package/lib/collaboration.js +6 -11
- package/lib/filebrowser.js +1 -1
- package/package.json +3 -3
package/lib/collaboration.d.ts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @module collaboration-extension
|
|
4
4
|
*/
|
|
5
5
|
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
|
|
6
|
-
import {
|
|
6
|
+
import { IUserMenu } from '@jupyter/collaboration';
|
|
7
|
+
import { IAwareness } from '@jupyter/docprovider';
|
|
7
8
|
/**
|
|
8
9
|
* Jupyter plugin providing the IUserMenu.
|
|
9
10
|
*/
|
package/lib/collaboration.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { DOMUtils, IToolbarWidgetRegistry } from '@jupyterlab/apputils';
|
|
8
8
|
import { EditorExtensionRegistry, IEditorExtensionRegistry } from '@jupyterlab/codemirror';
|
|
9
9
|
import { CollaboratorsPanel, IGlobalAwareness, IUserMenu, remoteUserCursors, RendererUserMenu, UserInfoPanel, UserMenu } from '@jupyter/collaboration';
|
|
10
|
+
import { WebSocketAwarenessProvider } from '@jupyter/docprovider';
|
|
10
11
|
import { SidePanel, usersIcon } from '@jupyterlab/ui-components';
|
|
11
12
|
import { MenuBar } from '@lumino/widgets';
|
|
12
13
|
import { URLExt } from '@jupyterlab/coreutils';
|
|
@@ -15,7 +16,6 @@ import { IStateDB } from '@jupyterlab/statedb';
|
|
|
15
16
|
import { ITranslator, nullTranslator } from '@jupyterlab/translation';
|
|
16
17
|
import * as Y from 'yjs';
|
|
17
18
|
import { Awareness } from 'y-protocols/awareness';
|
|
18
|
-
import { WebsocketProvider } from 'y-websocket';
|
|
19
19
|
/**
|
|
20
20
|
* Jupyter plugin providing the IUserMenu.
|
|
21
21
|
*/
|
|
@@ -67,17 +67,12 @@ export const rtcGlobalAwarenessPlugin = {
|
|
|
67
67
|
const awareness = new Awareness(ydoc);
|
|
68
68
|
const server = ServerConnection.makeSettings();
|
|
69
69
|
const url = URLExt.join(server.wsUrl, 'api/collaboration/room');
|
|
70
|
-
new
|
|
71
|
-
|
|
70
|
+
new WebSocketAwarenessProvider({
|
|
71
|
+
url: url,
|
|
72
|
+
roomID: 'JupyterLab:globalAwareness',
|
|
73
|
+
awareness: awareness,
|
|
74
|
+
user: user
|
|
72
75
|
});
|
|
73
|
-
const userChanged = () => {
|
|
74
|
-
awareness.setLocalStateField('user', user.identity);
|
|
75
|
-
};
|
|
76
|
-
if (user.isReady) {
|
|
77
|
-
userChanged();
|
|
78
|
-
}
|
|
79
|
-
user.ready.then(userChanged).catch(e => console.error(e));
|
|
80
|
-
user.userChanged.connect(userChanged);
|
|
81
76
|
state.changed.connect(async () => {
|
|
82
77
|
var _a, _b;
|
|
83
78
|
const data = await state.toJSON();
|
package/lib/filebrowser.js
CHANGED
|
@@ -168,7 +168,7 @@ export const logger = {
|
|
|
168
168
|
showDialog({
|
|
169
169
|
title: trans.__('Warning'),
|
|
170
170
|
body: trans.__(`Two collaborative sessions are accessing the file %1 simultaneously.
|
|
171
|
-
\
|
|
171
|
+
\nOpening a document with multiple views simultaneously is not supported. Please close one view; otherwise, you might lose some of your progress.`, emission.path),
|
|
172
172
|
buttons: [Dialog.warnButton({ label: trans.__('Ok') })]
|
|
173
173
|
});
|
|
174
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/collaboration-extension",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "JupyterLab - Real-Time Collaboration Extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"watch:labextension": "jupyter labextension watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaboration": "^1.0.
|
|
57
|
-
"@jupyter/docprovider": "^1.0.
|
|
56
|
+
"@jupyter/collaboration": "^1.0.1",
|
|
57
|
+
"@jupyter/docprovider": "^1.0.1",
|
|
58
58
|
"@jupyterlab/application": "^4.0.0",
|
|
59
59
|
"@jupyterlab/apputils": "^4.0.0",
|
|
60
60
|
"@jupyterlab/codemirror": "^4.0.0",
|