@jupyter-notebook/application-extension 7.5.0-alpha.1 → 7.5.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.
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Jupyter Development Team.
2
2
  // Distributed under the terms of the Modified BSD License.
3
3
  import { ILabStatus, IRouter, ITreePathUpdater, JupyterFrontEnd, JupyterLab, } from '@jupyterlab/application';
4
- import { DOMUtils, ICommandPalette, ISanitizer, ISplashScreen, IToolbarWidgetRegistry, } from '@jupyterlab/apputils';
4
+ import { DOMUtils, ICommandPalette, ISanitizer, ISplashScreen, IToolbarWidgetRegistry, showErrorMessage, } from '@jupyterlab/apputils';
5
5
  import { ConsolePanel } from '@jupyterlab/console';
6
6
  import { PageConfig, PathExt, URLExt } from '@jupyterlab/coreutils';
7
7
  import { IDocumentManager, renameDialog } from '@jupyterlab/docmanager';
@@ -522,12 +522,19 @@ const title = {
522
522
  if (!isEnabled()) {
523
523
  return;
524
524
  }
525
- const result = await renameDialog(docManager, current.context);
526
- // activate the current widget to bring the focus
527
- if (current) {
528
- current.activate();
525
+ try {
526
+ const result = await renameDialog(docManager, current.context);
527
+ // activate the current widget to bring the focus
528
+ if (current) {
529
+ current.activate();
530
+ }
531
+ if (result === null) {
532
+ return;
533
+ }
529
534
  }
530
- if (result === null) {
535
+ catch (error) {
536
+ showErrorMessage(trans.__('Rename Error'), error.message ||
537
+ trans.__('An error occurred while renaming the file.'));
531
538
  return;
532
539
  }
533
540
  const newPath = current.context.path;
@@ -805,6 +812,18 @@ const sidePanelVisibility = {
805
812
  });
806
813
  },
807
814
  };
815
+ /**
816
+ * A plugin for defining keyboard shortcuts specific to the notebook application.
817
+ */
818
+ const shortcuts = {
819
+ id: '@jupyter-notebook/application-extension:shortcuts',
820
+ description: 'A plugin for defining keyboard shortcuts specific to the notebook application.',
821
+ autoStart: true,
822
+ activate: (app) => {
823
+ // for now this plugin is mostly useful for defining keyboard shortcuts
824
+ // specific to the notebook application
825
+ },
826
+ };
808
827
  /**
809
828
  * The default tree route resolver plugin.
810
829
  */
@@ -947,6 +966,7 @@ const plugins = [
947
966
  rendermime,
948
967
  shell,
949
968
  sidePanelVisibility,
969
+ shortcuts,
950
970
  splash,
951
971
  status,
952
972
  tabTitle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter-notebook/application-extension",
3
- "version": "7.5.0-alpha.1",
3
+ "version": "7.5.0-alpha.3",
4
4
  "description": "Jupyter Notebook - Application Extension",
5
5
  "homepage": "https://github.com/jupyter/notebook",
6
6
  "bugs": {
@@ -38,19 +38,19 @@
38
38
  "watch": "tsc -b --watch"
39
39
  },
40
40
  "dependencies": {
41
- "@jupyter-notebook/application": "^7.5.0-alpha.1",
42
- "@jupyter-notebook/ui-components": "^7.5.0-alpha.1",
43
- "@jupyterlab/application": "~4.5.0-alpha.2",
44
- "@jupyterlab/apputils": "~4.6.0-alpha.2",
45
- "@jupyterlab/codeeditor": "~4.5.0-alpha.2",
46
- "@jupyterlab/console": "~4.5.0-alpha.2",
47
- "@jupyterlab/coreutils": "~6.5.0-alpha.2",
48
- "@jupyterlab/docmanager": "~4.5.0-alpha.2",
49
- "@jupyterlab/docregistry": "~4.5.0-alpha.2",
50
- "@jupyterlab/mainmenu": "~4.5.0-alpha.2",
51
- "@jupyterlab/rendermime": "~4.5.0-alpha.2",
52
- "@jupyterlab/settingregistry": "~4.5.0-alpha.2",
53
- "@jupyterlab/translation": "~4.5.0-alpha.2",
41
+ "@jupyter-notebook/application": "^7.5.0-alpha.3",
42
+ "@jupyter-notebook/ui-components": "^7.5.0-alpha.3",
43
+ "@jupyterlab/application": "~4.5.0-alpha.4",
44
+ "@jupyterlab/apputils": "~4.6.0-alpha.4",
45
+ "@jupyterlab/codeeditor": "~4.5.0-alpha.4",
46
+ "@jupyterlab/console": "~4.5.0-alpha.4",
47
+ "@jupyterlab/coreutils": "~6.5.0-alpha.4",
48
+ "@jupyterlab/docmanager": "~4.5.0-alpha.4",
49
+ "@jupyterlab/docregistry": "~4.5.0-alpha.4",
50
+ "@jupyterlab/mainmenu": "~4.5.0-alpha.4",
51
+ "@jupyterlab/rendermime": "~4.5.0-alpha.4",
52
+ "@jupyterlab/settingregistry": "~4.5.0-alpha.4",
53
+ "@jupyterlab/translation": "~4.5.0-alpha.4",
54
54
  "@lumino/coreutils": "^2.2.1",
55
55
  "@lumino/disposable": "^2.1.4",
56
56
  "@lumino/widgets": "^2.7.1"
@@ -0,0 +1,16 @@
1
+ {
2
+ "jupyter.lab.setting-icon": "notebook-ui-components:jupyter",
3
+ "jupyter.lab.setting-icon-label": "Jupyter Notebook shortcuts",
4
+ "title": "Jupyter Notebook Shortcuts",
5
+ "description": "Keyboard shortcuts for Jupyter Notebook",
6
+ "jupyter.lab.shortcuts": [
7
+ {
8
+ "args": {},
9
+ "command": "notebook:toggle-cell-outputs",
10
+ "keys": ["O"],
11
+ "selector": ".jp-Notebook.jp-mod-commandMode"
12
+ }
13
+ ],
14
+ "additionalProperties": false,
15
+ "type": "object"
16
+ }