@jupyter/collaboration-extension 1.0.0 → 1.1.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.
@@ -3,7 +3,8 @@
3
3
  * @module collaboration-extension
4
4
  */
5
5
  import { JupyterFrontEndPlugin } from '@jupyterlab/application';
6
- import { IAwareness, IUserMenu } from '@jupyter/collaboration';
6
+ import { IUserMenu } from '@jupyter/collaboration';
7
+ import { IAwareness } from '@jupyter/docprovider';
7
8
  /**
8
9
  * Jupyter plugin providing the IUserMenu.
9
10
  */
@@ -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 WebsocketProvider(url, 'JupyterLab:globalAwareness', ydoc, {
71
- awareness: awareness
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/collaboration-extension",
3
- "version": "1.0.0",
3
+ "version": "1.1.0-alpha.0",
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.0",
57
- "@jupyter/docprovider": "^1.0.0",
56
+ "@jupyter/collaboration": "^1.1.0-alpha.0",
57
+ "@jupyter/docprovider": "^1.1.0-alpha.0",
58
58
  "@jupyterlab/application": "^4.0.0",
59
59
  "@jupyterlab/apputils": "^4.0.0",
60
60
  "@jupyterlab/codemirror": "^4.0.0",