@jupyter/collaboration-extension 1.0.0-alpha.2 → 1.0.0-alpha.4
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/filebrowser.js +24 -3
- package/package.json +4 -3
package/lib/filebrowser.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ILabShell, IRouter, JupyterFrontEnd } from '@jupyterlab/application';
|
|
2
2
|
import { IDefaultFileBrowser, IFileBrowserFactory } from '@jupyterlab/filebrowser';
|
|
3
3
|
import { ITranslator } from '@jupyterlab/translation';
|
|
4
|
+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
4
5
|
import { YDrive } from '@jupyter/docprovider';
|
|
5
6
|
/**
|
|
6
7
|
* The command IDs used by the file browser plugin.
|
|
@@ -16,9 +17,13 @@ export const defaultFileBrowser = {
|
|
|
16
17
|
id: '@jupyter/collaboration-extension:defaultFileBrowser',
|
|
17
18
|
provides: IDefaultFileBrowser,
|
|
18
19
|
requires: [IFileBrowserFactory, ITranslator],
|
|
19
|
-
optional: [
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
optional: [
|
|
21
|
+
IRouter,
|
|
22
|
+
JupyterFrontEnd.ITreeResolver,
|
|
23
|
+
ILabShell,
|
|
24
|
+
ISettingRegistry
|
|
25
|
+
],
|
|
26
|
+
activate: async (app, fileBrowserFactory, translator, router, tree, labShell, settingRegistry) => {
|
|
22
27
|
const { commands } = app;
|
|
23
28
|
const trans = translator.load('jupyter_collaboration');
|
|
24
29
|
const drive = new YDrive(app.serviceManager.user, trans);
|
|
@@ -30,6 +35,22 @@ export const defaultFileBrowser = {
|
|
|
30
35
|
driveName: 'YDrive'
|
|
31
36
|
});
|
|
32
37
|
void Private.restoreBrowser(defaultBrowser, commands, router, tree, labShell);
|
|
38
|
+
// Fetch settings if possible.
|
|
39
|
+
if (settingRegistry) {
|
|
40
|
+
settingRegistry
|
|
41
|
+
.load('@jupyterlab/notebook-extension:tracker')
|
|
42
|
+
.then(settings => {
|
|
43
|
+
const updateSettings = (settings) => {
|
|
44
|
+
var _a;
|
|
45
|
+
const enableDocWideUndo = settings === null || settings === void 0 ? void 0 : settings.get('experimentalEnableDocumentWideUndoRedo').composite;
|
|
46
|
+
drive.sharedModelFactory.setDocumentOptions('notebook', {
|
|
47
|
+
disableDocumentWideUndoRedo: (_a = !enableDocWideUndo) !== null && _a !== void 0 ? _a : true
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
updateSettings(settings);
|
|
51
|
+
settings.changed.connect((settings) => updateSettings(settings));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
33
54
|
return defaultBrowser;
|
|
34
55
|
}
|
|
35
56
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/collaboration-extension",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"description": "JupyterLab - Real-Time Collaboration Extension",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -52,13 +52,14 @@
|
|
|
52
52
|
"watch:labextension": "jupyter labextension watch ."
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@jupyter/collaboration": "^1.0.0-alpha.
|
|
56
|
-
"@jupyter/docprovider": "^1.0.0-alpha.
|
|
55
|
+
"@jupyter/collaboration": "^1.0.0-alpha.4",
|
|
56
|
+
"@jupyter/docprovider": "^1.0.0-alpha.4",
|
|
57
57
|
"@jupyterlab/application": "^4.0.0-alpha.19",
|
|
58
58
|
"@jupyterlab/apputils": "^4.0.0-alpha.19",
|
|
59
59
|
"@jupyterlab/coreutils": "^6.0.0-alpha.19",
|
|
60
60
|
"@jupyterlab/filebrowser": "^4.0.0-alpha.19",
|
|
61
61
|
"@jupyterlab/services": "^7.0.0-alpha.19",
|
|
62
|
+
"@jupyterlab/settingregistry": "^4.0.0-alpha.19",
|
|
62
63
|
"@jupyterlab/statedb": "^4.0.0-alpha.19",
|
|
63
64
|
"@jupyterlab/translation": "^4.0.0-alpha.19",
|
|
64
65
|
"@jupyterlab/ui-components": "^4.0.0-alpha.34",
|