@jupyter-notebook/notebook-extension 7.0.0-alpha.16 → 7.0.0-alpha.18
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 +14 -14
- package/lib/trusted.d.ts +1 -1
- package/lib/trusted.js +3 -4
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Jupyter Development Team.
|
|
2
2
|
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
import { DOMUtils, IToolbarWidgetRegistry } from '@jupyterlab/apputils';
|
|
3
|
+
import { DOMUtils, IToolbarWidgetRegistry, } from '@jupyterlab/apputils';
|
|
4
4
|
import { Text, Time } from '@jupyterlab/coreutils';
|
|
5
5
|
import { IDocumentManager } from '@jupyterlab/docmanager';
|
|
6
|
-
import { NotebookPanel, INotebookTracker, INotebookTools } from '@jupyterlab/notebook';
|
|
6
|
+
import { NotebookPanel, INotebookTracker, INotebookTools, } from '@jupyterlab/notebook';
|
|
7
7
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
8
8
|
import { ITranslator } from '@jupyterlab/translation';
|
|
9
9
|
import { INotebookShell } from '@jupyter-notebook/application';
|
|
@@ -43,7 +43,7 @@ const checkpoints = {
|
|
|
43
43
|
const trans = translator.load('notebook');
|
|
44
44
|
const node = document.createElement('div');
|
|
45
45
|
if (toolbarRegistry) {
|
|
46
|
-
toolbarRegistry.addFactory('TopBar', 'checkpoint', toolbar => {
|
|
46
|
+
toolbarRegistry.addFactory('TopBar', 'checkpoint', (toolbar) => {
|
|
47
47
|
const widget = new Widget({ node });
|
|
48
48
|
widget.id = DOMUtils.createDomID();
|
|
49
49
|
widget.addClass('jp-NotebookCheckpoint');
|
|
@@ -73,11 +73,11 @@ const checkpoints = {
|
|
|
73
73
|
factory: () => onChange(),
|
|
74
74
|
frequency: {
|
|
75
75
|
interval: 2000,
|
|
76
|
-
backoff: false
|
|
76
|
+
backoff: false,
|
|
77
77
|
},
|
|
78
|
-
standby: 'when-hidden'
|
|
78
|
+
standby: 'when-hidden',
|
|
79
79
|
});
|
|
80
|
-
}
|
|
80
|
+
},
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
83
83
|
* The kernel logo plugin.
|
|
@@ -118,7 +118,7 @@ const kernelLogo = {
|
|
|
118
118
|
img.title = spec.display_name;
|
|
119
119
|
};
|
|
120
120
|
if (toolbarRegistry) {
|
|
121
|
-
toolbarRegistry.addFactory('TopBar', 'kernelLogo', toolbar => {
|
|
121
|
+
toolbarRegistry.addFactory('TopBar', 'kernelLogo', (toolbar) => {
|
|
122
122
|
const widget = new Widget({ node });
|
|
123
123
|
widget.addClass('jp-NotebookKernelLogo');
|
|
124
124
|
return widget;
|
|
@@ -127,7 +127,7 @@ const kernelLogo = {
|
|
|
127
127
|
app.started.then(() => {
|
|
128
128
|
shell.currentChanged.connect(onChange);
|
|
129
129
|
});
|
|
130
|
-
}
|
|
130
|
+
},
|
|
131
131
|
};
|
|
132
132
|
/**
|
|
133
133
|
* A plugin to display the kernel status;
|
|
@@ -180,7 +180,7 @@ const kernelStatus = {
|
|
|
180
180
|
sessionContext.statusChanged.connect(onStatusChanged);
|
|
181
181
|
};
|
|
182
182
|
shell.currentChanged.connect(onChange);
|
|
183
|
-
}
|
|
183
|
+
},
|
|
184
184
|
};
|
|
185
185
|
/**
|
|
186
186
|
* A plugin to enable scrolling for outputs by default.
|
|
@@ -248,7 +248,7 @@ const scrollOutput = {
|
|
|
248
248
|
Promise.all([loadSettings, app.restored])
|
|
249
249
|
.then(([settings]) => {
|
|
250
250
|
updateSettings(settings);
|
|
251
|
-
settings.changed.connect(settings => {
|
|
251
|
+
settings.changed.connect((settings) => {
|
|
252
252
|
updateSettings(settings);
|
|
253
253
|
});
|
|
254
254
|
})
|
|
@@ -256,7 +256,7 @@ const scrollOutput = {
|
|
|
256
256
|
console.error(reason.message);
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
}
|
|
259
|
+
},
|
|
260
260
|
};
|
|
261
261
|
/**
|
|
262
262
|
* A plugin to add the NotebookTools to the side panel;
|
|
@@ -278,7 +278,7 @@ const notebookToolsWidget = {
|
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
280
|
shell.currentChanged.connect(onChange);
|
|
281
|
-
}
|
|
281
|
+
},
|
|
282
282
|
};
|
|
283
283
|
/**
|
|
284
284
|
* A plugin that adds a Trusted indicator to the menu area
|
|
@@ -299,7 +299,7 @@ const trusted = {
|
|
|
299
299
|
notebookShell.add(widget, 'menu', { rank: 11000 });
|
|
300
300
|
};
|
|
301
301
|
notebookShell.currentChanged.connect(onChange);
|
|
302
|
-
}
|
|
302
|
+
},
|
|
303
303
|
};
|
|
304
304
|
/**
|
|
305
305
|
* Export the plugins as default.
|
|
@@ -310,6 +310,6 @@ const plugins = [
|
|
|
310
310
|
kernelStatus,
|
|
311
311
|
scrollOutput,
|
|
312
312
|
notebookToolsWidget,
|
|
313
|
-
trusted
|
|
313
|
+
trusted,
|
|
314
314
|
];
|
|
315
315
|
export default plugins;
|
package/lib/trusted.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare namespace TrustedComponent {
|
|
|
11
11
|
* @param notebook The notebook
|
|
12
12
|
* @param translator The translator
|
|
13
13
|
*/
|
|
14
|
-
const create: ({ notebook, translator }: {
|
|
14
|
+
const create: ({ notebook, translator, }: {
|
|
15
15
|
notebook: Notebook;
|
|
16
16
|
translator: ITranslator;
|
|
17
17
|
}) => ReactWidget;
|
package/lib/trusted.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactWidget } from '@jupyterlab/apputils';
|
|
2
2
|
import { NotebookActions } from '@jupyterlab/notebook';
|
|
3
|
-
import { toArray } from '@lumino/algorithm';
|
|
4
3
|
import React, { useEffect, useState } from 'react';
|
|
5
4
|
/**
|
|
6
5
|
* Check if a notebook is trusted
|
|
@@ -12,7 +11,7 @@ const isTrusted = (notebook) => {
|
|
|
12
11
|
if (!model) {
|
|
13
12
|
return false;
|
|
14
13
|
}
|
|
15
|
-
const cells =
|
|
14
|
+
const cells = Array.from(model.cells);
|
|
16
15
|
const trusted = cells.reduce((accum, current) => {
|
|
17
16
|
if (current.trusted) {
|
|
18
17
|
return accum + 1;
|
|
@@ -29,7 +28,7 @@ const isTrusted = (notebook) => {
|
|
|
29
28
|
* @param notebook The Notebook
|
|
30
29
|
* @param translator The Translation service
|
|
31
30
|
*/
|
|
32
|
-
const TrustedButton = ({ notebook, translator }) => {
|
|
31
|
+
const TrustedButton = ({ notebook, translator, }) => {
|
|
33
32
|
const trans = translator.load('notebook');
|
|
34
33
|
const [trusted, setTrusted] = useState(isTrusted(notebook));
|
|
35
34
|
const checkTrust = () => {
|
|
@@ -64,7 +63,7 @@ export var TrustedComponent;
|
|
|
64
63
|
* @param notebook The notebook
|
|
65
64
|
* @param translator The translator
|
|
66
65
|
*/
|
|
67
|
-
TrustedComponent.create = ({ notebook, translator }) => {
|
|
66
|
+
TrustedComponent.create = ({ notebook, translator, }) => {
|
|
68
67
|
return ReactWidget.create(React.createElement(TrustedButton, { notebook: notebook, translator: translator }));
|
|
69
68
|
};
|
|
70
69
|
})(TrustedComponent || (TrustedComponent = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/notebook-extension",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.18",
|
|
4
4
|
"description": "Jupyter Notebook - Notebook Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"watch": "tsc -b --watch"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@jupyter-notebook/application": "^7.0.0-alpha.
|
|
42
|
-
"@jupyterlab/application": "^4.0.0-alpha.
|
|
43
|
-
"@jupyterlab/apputils": "^4.0.0-alpha.
|
|
44
|
-
"@jupyterlab/cells": "^4.0.0-alpha.
|
|
45
|
-
"@jupyterlab/docmanager": "^4.0.0-alpha.
|
|
46
|
-
"@jupyterlab/notebook": "^4.0.0-alpha.
|
|
47
|
-
"@jupyterlab/settingregistry": "^4.0.0-alpha.
|
|
48
|
-
"@jupyterlab/translation": "^4.0.0-alpha.
|
|
49
|
-
"@lumino/polling": "^2.0.0
|
|
50
|
-
"@lumino/widgets": "^2.0.0
|
|
41
|
+
"@jupyter-notebook/application": "^7.0.0-alpha.18",
|
|
42
|
+
"@jupyterlab/application": "^4.0.0-alpha.22",
|
|
43
|
+
"@jupyterlab/apputils": "^4.0.0-alpha.22",
|
|
44
|
+
"@jupyterlab/cells": "^4.0.0-alpha.22",
|
|
45
|
+
"@jupyterlab/docmanager": "^4.0.0-alpha.22",
|
|
46
|
+
"@jupyterlab/notebook": "^4.0.0-alpha.22",
|
|
47
|
+
"@jupyterlab/settingregistry": "^4.0.0-alpha.22",
|
|
48
|
+
"@jupyterlab/translation": "^4.0.0-alpha.22",
|
|
49
|
+
"@lumino/polling": "^2.0.0",
|
|
50
|
+
"@lumino/widgets": "^2.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"rimraf": "^3.0.2",
|
|
54
|
-
"typescript": "5.0.
|
|
54
|
+
"typescript": "~5.0.2"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|