@jupyter/docprovider-extension 5.1.0-alpha.0 → 5.1.0-alpha.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/yprovider.js +6 -20
- package/package.json +3 -3
package/lib/yprovider.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
| Distributed under the terms of the Modified BSD License.
|
|
4
4
|
|----------------------------------------------------------------------------*/
|
|
5
5
|
import { ITranslator } from '@jupyterlab/translation';
|
|
6
|
-
import { ILabShell } from '@jupyterlab/application';
|
|
7
6
|
import { WebSocketProvider, ExternalChangeNoticePresenter, WebSocketAwarenessProvider, IAwarenessProviderFactory, IDocumentProviderFactory } from '@jupyter/docprovider';
|
|
8
7
|
import { URLExt } from '@jupyterlab/coreutils';
|
|
9
8
|
import { MainAreaWidget, ToolbarButton } from '@jupyterlab/apputils';
|
|
@@ -24,13 +23,6 @@ const PLUGIN_ID = '@jupyter/docprovider-extension:websocket-provider';
|
|
|
24
23
|
*/
|
|
25
24
|
class WebSocketDocumentProviderFactory {
|
|
26
25
|
constructor(options) {
|
|
27
|
-
this._viewSignals = [];
|
|
28
|
-
if (options.shell.currentChanged) {
|
|
29
|
-
this._viewSignals.push(options.shell.currentChanged);
|
|
30
|
-
}
|
|
31
|
-
if (options.labShell) {
|
|
32
|
-
this._viewSignals.push(options.labShell.layoutModified);
|
|
33
|
-
}
|
|
34
26
|
this._settings = options.settings;
|
|
35
27
|
this._trans = options.translator;
|
|
36
28
|
this._commands = options.commands;
|
|
@@ -101,18 +93,13 @@ class WebSocketDocumentProviderFactory {
|
|
|
101
93
|
translator: this._trans,
|
|
102
94
|
serverSettings: options.serverSettings,
|
|
103
95
|
autoReload: () => { var _a; return ((_a = this._settings) === null || _a === void 0 ? void 0 : _a.get('autoReload').composite) === true; },
|
|
104
|
-
showNotice: (notice, beforeSave, createNotice) =>
|
|
96
|
+
showNotice: (notice, beforeSave, createNotice) => ExternalChangeNoticePresenter.forDocument({
|
|
105
97
|
notice,
|
|
106
98
|
beforeSave,
|
|
107
99
|
createNotice,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const context = this._docManager.contextForWidget(view);
|
|
112
|
-
return (context === null || context === void 0 ? void 0 : context.model.sharedModel) === options.model
|
|
113
|
-
? context
|
|
114
|
-
: undefined;
|
|
115
|
-
}
|
|
100
|
+
shell,
|
|
101
|
+
docManager: this._docManager,
|
|
102
|
+
model: options.model
|
|
116
103
|
}),
|
|
117
104
|
onCloseDocument: () => {
|
|
118
105
|
var _a;
|
|
@@ -193,15 +180,14 @@ export const documentProviderFactoryPlugin = {
|
|
|
193
180
|
IRenderMimeRegistry,
|
|
194
181
|
IDocumentManager
|
|
195
182
|
],
|
|
196
|
-
optional: [ISettingRegistry
|
|
183
|
+
optional: [ISettingRegistry],
|
|
197
184
|
provides: IDocumentProviderFactory,
|
|
198
|
-
activate: async (app, translator, editorServices, rendermime, docManager, settingRegistry
|
|
185
|
+
activate: async (app, translator, editorServices, rendermime, docManager, settingRegistry) => {
|
|
199
186
|
const trans = translator.load('jupyter_collaboration');
|
|
200
187
|
const settings = settingRegistry
|
|
201
188
|
? await settingRegistry.load(PLUGIN_ID + '-document-factory')
|
|
202
189
|
: null;
|
|
203
190
|
return new WebSocketDocumentProviderFactory({
|
|
204
|
-
labShell,
|
|
205
191
|
settings,
|
|
206
192
|
translator: trans,
|
|
207
193
|
commands: app.commands,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider-extension",
|
|
3
|
-
"version": "5.1.0-alpha.
|
|
3
|
+
"version": "5.1.0-alpha.1",
|
|
4
4
|
"description": "JupyterLab - Collaborative Shared Models",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"watch:labextension": "jupyter-builder watch ."
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@jupyter/collaborative-drive": "^5.1.0-alpha.
|
|
57
|
-
"@jupyter/docprovider": "^5.1.0-alpha.
|
|
56
|
+
"@jupyter/collaborative-drive": "^5.1.0-alpha.1",
|
|
57
|
+
"@jupyter/docprovider": "^5.1.0-alpha.1",
|
|
58
58
|
"@jupyter/ydoc": "^4.0.0",
|
|
59
59
|
"@jupyterlab/application": "^4.6.0",
|
|
60
60
|
"@jupyterlab/apputils": "^4.7.0",
|