@jupyter-notebook/lab-extension 7.0.0-beta.0 → 7.0.0-beta.2

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/index.js CHANGED
@@ -48,7 +48,7 @@ const interfaceSwitcher = {
48
48
  };
49
49
  const menubar = new MenuBar(overflowOptions);
50
50
  const switcher = new Menu({ commands });
51
- switcher.title.label = trans.__('Interface');
51
+ switcher.title.label = trans.__('Open in...');
52
52
  switcher.title.icon = caretDownIcon;
53
53
  menubar.addMenu(switcher);
54
54
  const isEnabled = () => {
@@ -56,28 +56,40 @@ const interfaceSwitcher = {
56
56
  notebookTracker.currentWidget === shell.currentWidget);
57
57
  };
58
58
  const addInterface = (option) => {
59
- const { command, commandLabel, urlPrefix } = option;
59
+ const { command, commandLabel, commandDescription, urlPrefix } = option;
60
+ const execute = () => {
61
+ const current = notebookTracker.currentWidget;
62
+ if (!current) {
63
+ return;
64
+ }
65
+ window.open(`${urlPrefix}${current.context.path}`);
66
+ };
60
67
  commands.addCommand(command, {
61
- label: (args) => (args.noLabel ? '' : commandLabel),
62
- caption: commandLabel,
63
- execute: () => {
64
- const current = notebookTracker.currentWidget;
65
- if (!current) {
66
- return;
68
+ label: (args) => {
69
+ args.noLabel ? '' : commandLabel;
70
+ if (args.isMenu || args.isPalette) {
71
+ return commandDescription;
67
72
  }
68
- window.open(`${urlPrefix}${current.context.path}`);
73
+ return commandLabel;
69
74
  },
75
+ caption: commandLabel,
76
+ execute,
70
77
  isEnabled,
71
78
  });
72
79
  if (palette) {
73
- palette.addItem({ command, category: 'Other' });
80
+ palette.addItem({
81
+ command,
82
+ category: 'Other',
83
+ args: { isPalette: true },
84
+ });
74
85
  }
75
86
  switcher.addItem({ command });
76
87
  };
77
88
  if (!notebookShell) {
78
89
  addInterface({
79
90
  command: CommandIDs.openNotebook,
80
- commandLabel: trans.__('Open With %1', 'Jupyter Notebook'),
91
+ commandLabel: trans.__('Notebook'),
92
+ commandDescription: trans.__('Open in %1', 'Jupyter Notebook'),
81
93
  buttonLabel: 'openNotebook',
82
94
  urlPrefix: `${baseUrl}tree/`,
83
95
  });
@@ -85,7 +97,8 @@ const interfaceSwitcher = {
85
97
  if (!labShell) {
86
98
  addInterface({
87
99
  command: CommandIDs.openLab,
88
- commandLabel: trans.__('Open With %1', 'JupyterLab'),
100
+ commandLabel: trans.__('JupyterLab'),
101
+ commandDescription: trans.__('Open in %1', 'JupyterLab'),
89
102
  buttonLabel: 'openLab',
90
103
  urlPrefix: `${baseUrl}doc/tree/`,
91
104
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter-notebook/lab-extension",
3
- "version": "7.0.0-beta.0",
3
+ "version": "7.0.0-beta.2",
4
4
  "description": "Jupyter Notebook - Lab Extension",
5
5
  "homepage": "https://github.com/jupyter/notebook",
6
6
  "bugs": {
@@ -43,19 +43,19 @@
43
43
  "watch:src": "tsc -w"
44
44
  },
45
45
  "dependencies": {
46
- "@jupyter-notebook/application": "^7.0.0-beta.0",
47
- "@jupyterlab/application": "^4.0.0-beta.0",
48
- "@jupyterlab/apputils": "^4.0.0-beta.0",
49
- "@jupyterlab/coreutils": "^6.0.0-beta.0",
50
- "@jupyterlab/docregistry": "^4.0.0-beta.0",
51
- "@jupyterlab/notebook": "^4.0.0-beta.0",
52
- "@jupyterlab/translation": "^4.0.0-beta.0",
53
- "@jupyterlab/ui-components": "^4.0.0-beta.0",
54
- "@lumino/commands": "^2.0.1",
55
- "@lumino/disposable": "^2.0.0"
46
+ "@jupyter-notebook/application": "^7.0.0-beta.2",
47
+ "@jupyterlab/application": "^4.0.0-rc.1",
48
+ "@jupyterlab/apputils": "^4.0.0-rc.1",
49
+ "@jupyterlab/coreutils": "^6.0.0-rc.1",
50
+ "@jupyterlab/docregistry": "^4.0.0-rc.1",
51
+ "@jupyterlab/notebook": "^4.0.0-rc.1",
52
+ "@jupyterlab/translation": "^4.0.0-rc.1",
53
+ "@jupyterlab/ui-components": "^4.0.0-rc.1",
54
+ "@lumino/commands": "^2.1.1",
55
+ "@lumino/disposable": "^2.1.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@jupyterlab/builder": "^4.0.0-beta.0",
58
+ "@jupyterlab/builder": "^4.0.0-rc.1",
59
59
  "rimraf": "^3.0.2",
60
60
  "typescript": "~5.0.2"
61
61
  },
@@ -11,11 +11,17 @@
11
11
  "items": [
12
12
  {
13
13
  "command": "jupyter-notebook:open-notebook",
14
- "rank": 10
14
+ "rank": 10,
15
+ "args": {
16
+ "isMenu": true
17
+ }
15
18
  },
16
19
  {
17
20
  "command": "jupyter-notebook:open-lab",
18
- "rank": 10
21
+ "rank": 10,
22
+ "args": {
23
+ "isMenu": true
24
+ }
19
25
  }
20
26
  ]
21
27
  }