@jupyter-notebook/application-extension 7.2.0 → 7.3.0-alpha.0

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
@@ -32,6 +32,10 @@ const JUPYTERLAB_DOCMANAGER_PLUGIN_ID = '@jupyterlab/docmanager-extension:plugin
32
32
  */
33
33
  var CommandIDs;
34
34
  (function (CommandIDs) {
35
+ /**
36
+ * Duplicate the current document and open the new document
37
+ */
38
+ CommandIDs.duplicate = 'application:duplicate';
35
39
  /**
36
40
  * Handle local links
37
41
  */
@@ -484,6 +488,18 @@ const title = {
484
488
  const { currentWidget } = shell;
485
489
  return !!(currentWidget && docManager.contextForWidget(currentWidget));
486
490
  };
491
+ commands.addCommand(CommandIDs.duplicate, {
492
+ label: () => trans.__('Duplicate'),
493
+ isEnabled,
494
+ execute: async () => {
495
+ if (!isEnabled()) {
496
+ return;
497
+ }
498
+ // Duplicate the file, and open the new file.
499
+ const result = await docManager.duplicate(current.context.path);
500
+ await commands.execute('docmanager:open', { path: result.path });
501
+ },
502
+ });
487
503
  commands.addCommand(CommandIDs.rename, {
488
504
  label: () => trans.__('Rename…'),
489
505
  isEnabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter-notebook/application-extension",
3
- "version": "7.2.0",
3
+ "version": "7.3.0-alpha.0",
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.2.0",
42
- "@jupyter-notebook/ui-components": "^7.2.0",
43
- "@jupyterlab/application": "~4.2.0",
44
- "@jupyterlab/apputils": "~4.3.0",
45
- "@jupyterlab/codeeditor": "~4.2.0",
46
- "@jupyterlab/console": "~4.2.0",
47
- "@jupyterlab/coreutils": "~6.2.0",
48
- "@jupyterlab/docmanager": "~4.2.0",
49
- "@jupyterlab/docregistry": "~4.2.0",
50
- "@jupyterlab/mainmenu": "~4.2.0",
51
- "@jupyterlab/rendermime": "~4.2.0",
52
- "@jupyterlab/settingregistry": "~4.2.0",
53
- "@jupyterlab/translation": "~4.2.0",
41
+ "@jupyter-notebook/application": "^7.3.0-alpha.0",
42
+ "@jupyter-notebook/ui-components": "^7.3.0-alpha.0",
43
+ "@jupyterlab/application": "~4.3.0-alpha.0",
44
+ "@jupyterlab/apputils": "~4.4.0-alpha.0",
45
+ "@jupyterlab/codeeditor": "~4.3.0-alpha.0",
46
+ "@jupyterlab/console": "~4.3.0-alpha.0",
47
+ "@jupyterlab/coreutils": "~6.3.0-alpha.0",
48
+ "@jupyterlab/docmanager": "~4.3.0-alpha.0",
49
+ "@jupyterlab/docregistry": "~4.3.0-alpha.0",
50
+ "@jupyterlab/mainmenu": "~4.3.0-alpha.0",
51
+ "@jupyterlab/rendermime": "~4.3.0-alpha.0",
52
+ "@jupyterlab/settingregistry": "~4.3.0-alpha.0",
53
+ "@jupyterlab/translation": "~4.3.0-alpha.0",
54
54
  "@lumino/coreutils": "^2.1.2",
55
55
  "@lumino/disposable": "^2.1.2",
56
56
  "@lumino/widgets": "^2.3.2"
package/schema/menus.json CHANGED
@@ -10,6 +10,10 @@
10
10
  "command": "application:rename",
11
11
  "rank": 4.5
12
12
  },
13
+ {
14
+ "command": "application:duplicate",
15
+ "rank": 4.8
16
+ },
13
17
  {
14
18
  "command": "notebook:trust",
15
19
  "rank": 20