@jupyterlite/repl-extension 0.1.0-beta.5 → 0.1.0-beta.8
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 +11 -5
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -8,6 +8,10 @@ import { clearIcon, refreshIcon, runIcon } from '@jupyterlab/ui-components';
|
|
|
8
8
|
import { SingleWidgetApp } from '@jupyterlite/application';
|
|
9
9
|
import { liteIcon } from '@jupyterlite/ui-components';
|
|
10
10
|
import { Widget } from '@lumino/widgets';
|
|
11
|
+
/**
|
|
12
|
+
* The name of the translation bundle for internationalized strings.
|
|
13
|
+
*/
|
|
14
|
+
const I18N_BUNDLE = 'jupyterlite';
|
|
11
15
|
/**
|
|
12
16
|
* A plugin to add buttons to the console toolbar.
|
|
13
17
|
*/
|
|
@@ -21,7 +25,7 @@ const buttons = {
|
|
|
21
25
|
return;
|
|
22
26
|
}
|
|
23
27
|
const { commands } = app;
|
|
24
|
-
const trans = translator.load(
|
|
28
|
+
const trans = translator.load(I18N_BUNDLE);
|
|
25
29
|
// wrapper commands to be able to override the icon
|
|
26
30
|
const runCommand = 'repl:run';
|
|
27
31
|
commands.addCommand(runCommand, {
|
|
@@ -96,14 +100,14 @@ const consolePlugin = {
|
|
|
96
100
|
if (!tracker) {
|
|
97
101
|
return;
|
|
98
102
|
}
|
|
99
|
-
const { commands } = app;
|
|
103
|
+
const { commands, serviceManager, started } = app;
|
|
100
104
|
const search = window.location.search;
|
|
101
105
|
const urlParams = new URLSearchParams(search);
|
|
102
106
|
const code = urlParams.getAll('code');
|
|
103
107
|
const kernel = urlParams.get('kernel') || undefined;
|
|
104
108
|
const theme = (_a = urlParams.get('theme')) === null || _a === void 0 ? void 0 : _a.trim();
|
|
105
109
|
const toolbar = urlParams.get('toolbar');
|
|
106
|
-
|
|
110
|
+
Promise.all([started, serviceManager.ready]).then(async () => {
|
|
107
111
|
commands.execute('console:create', { kernelPreference: { name: kernel } });
|
|
108
112
|
});
|
|
109
113
|
if (theme && themeManager) {
|
|
@@ -130,9 +134,11 @@ const status = {
|
|
|
130
134
|
id: '@jupyterlite/repl-extension:status',
|
|
131
135
|
autoStart: true,
|
|
132
136
|
provides: ILabStatus,
|
|
133
|
-
|
|
137
|
+
requires: [ITranslator],
|
|
138
|
+
activate: (app, translator) => {
|
|
134
139
|
if (!(app instanceof SingleWidgetApp)) {
|
|
135
|
-
|
|
140
|
+
const trans = translator.load(I18N_BUNDLE);
|
|
141
|
+
throw new Error(trans.__('%1 must be activated in SingleWidgetApp.', status.id));
|
|
136
142
|
}
|
|
137
143
|
return app.status;
|
|
138
144
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlite/repl-extension",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.8",
|
|
4
4
|
"description": "JupyterLite - Console Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyterlite/jupyterlite",
|
|
6
6
|
"bugs": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"watch": "tsc -b --watch"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@jupyterlab/application": "~3.
|
|
41
|
-
"@jupyterlab/apputils": "~3.
|
|
42
|
-
"@jupyterlab/console": "~3.
|
|
43
|
-
"@jupyterlab/translation": "~3.
|
|
44
|
-
"@jupyterlab/ui-components": "~3.
|
|
45
|
-
"@jupyterlite/application": "^0.1.0-beta.
|
|
46
|
-
"@jupyterlite/ui-components": "^0.1.0-beta.
|
|
40
|
+
"@jupyterlab/application": "~3.4.2",
|
|
41
|
+
"@jupyterlab/apputils": "~3.4.2",
|
|
42
|
+
"@jupyterlab/console": "~3.4.2",
|
|
43
|
+
"@jupyterlab/translation": "~3.4.2",
|
|
44
|
+
"@jupyterlab/ui-components": "~3.4.2",
|
|
45
|
+
"@jupyterlite/application": "^0.1.0-beta.8",
|
|
46
|
+
"@jupyterlite/ui-components": "^0.1.0-beta.8",
|
|
47
47
|
"@lumino/widgets": "^1.31.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|