@jupyter/collaboration-extension 1.0.0-alpha.2 → 1.0.0-alpha.3

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 (2) hide show
  1. package/lib/filebrowser.js +24 -2
  2. package/package.json +4 -3
@@ -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,8 +17,13 @@ export const defaultFileBrowser = {
16
17
  id: '@jupyter/collaboration-extension:defaultFileBrowser',
17
18
  provides: IDefaultFileBrowser,
18
19
  requires: [IFileBrowserFactory, ITranslator],
19
- optional: [IRouter, JupyterFrontEnd.ITreeResolver, ILabShell],
20
- activate: async (app, fileBrowserFactory, translator, router, tree, labShell) => {
20
+ optional: [
21
+ IRouter,
22
+ JupyterFrontEnd.ITreeResolver,
23
+ ILabShell,
24
+ ISettingRegistry
25
+ ],
26
+ activate: async (app, fileBrowserFactory, translator, router, tree, labShell, settingRegistry) => {
21
27
  console.debug('@jupyter/collaboration-extension:defaultFileBrowser: activated');
22
28
  const { commands } = app;
23
29
  const trans = translator.load('jupyter_collaboration');
@@ -30,6 +36,22 @@ export const defaultFileBrowser = {
30
36
  driveName: 'YDrive'
31
37
  });
32
38
  void Private.restoreBrowser(defaultBrowser, commands, router, tree, labShell);
39
+ // Fetch settings if possible.
40
+ if (settingRegistry) {
41
+ settingRegistry
42
+ .load('@jupyterlab/notebook-extension:tracker')
43
+ .then(settings => {
44
+ const updateSettings = (settings) => {
45
+ var _a;
46
+ const enableDocWideUndo = settings === null || settings === void 0 ? void 0 : settings.get('experimentalEnableDocumentWideUndoRedo').composite;
47
+ drive.sharedModelFactory.setDocumentOptions('notebook', {
48
+ disableDocumentWideUndoRedo: (_a = !enableDocWideUndo) !== null && _a !== void 0 ? _a : true
49
+ });
50
+ };
51
+ updateSettings(settings);
52
+ settings.changed.connect((settings) => updateSettings(settings));
53
+ });
54
+ }
33
55
  return defaultBrowser;
34
56
  }
35
57
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/collaboration-extension",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
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.2",
56
- "@jupyter/docprovider": "^1.0.0-alpha.2",
55
+ "@jupyter/collaboration": "^1.0.0-alpha.3",
56
+ "@jupyter/docprovider": "^1.0.0-alpha.3",
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",