jupyterlab-pioneer 0.1.11 → 0.2.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/README.md +32 -0
- package/lib/index.js +10 -3
- package/lib/utils.d.ts +5 -0
- package/lib/utils.js +57 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# JupyterLab Pioneer
|
|
2
2
|
|
|
3
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
4
|
+
|
|
5
|
+
[](#contributors-)
|
|
6
|
+
|
|
7
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
8
|
+
|
|
3
9
|
[](https://pypi.org/project/jupyterlab-pioneer)
|
|
4
10
|
[](https://www.npmjs.com/package/jupyterlab-pioneer)
|
|
5
11
|
|
|
@@ -180,3 +186,29 @@ folder is located. Then you can remove the symlink named `jupyterlab-pioneer` wi
|
|
|
180
186
|
### Packaging the extension
|
|
181
187
|
|
|
182
188
|
See [RELEASE](RELEASE.md)
|
|
189
|
+
|
|
190
|
+
## Contributors ✨
|
|
191
|
+
|
|
192
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
193
|
+
|
|
194
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
195
|
+
<!-- prettier-ignore-start -->
|
|
196
|
+
<!-- markdownlint-disable -->
|
|
197
|
+
<table>
|
|
198
|
+
<tbody>
|
|
199
|
+
<tr>
|
|
200
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.wumengyan.com/"><img src="https://avatars.githubusercontent.com/u/85606983?v=4?s=100" width="100px;" alt="mengyanw"/><br /><sub><b>Mengyan Wu</b></sub></a><br /><a href="https://github.com/educational-technology-collective/jupyterlab-pioneer/commits?author=mengyanw" title="Code">💻</a> <a href="#ideas-mengyanw" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-mengyanw" title="Maintenance">🚧</a> <a href="#projectManagement-mengyanw" title="Project Management">📆</a> <a href="#infra-mengyanw" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/educational-technology-collective/jupyterlab-pioneer/commits?author=mengyanw" title="Tests">⚠️</a> <a href="https://github.com/educational-technology-collective/jupyterlab-pioneer/commits?author=mengyanw" title="Documentation">📖</a></td>
|
|
201
|
+
<td align="center" valign="top" width="14.28%"><a href="http://christopherbrooks.ca"><img src="https://avatars.githubusercontent.com/u/1355641?v=4?s=100" width="100px;" alt="Christopher Brooks"/><br /><sub><b>Christopher Brooks</b></sub></a><br /><a href="#ideas-cab938" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-cab938" title="Project Management">📆</a> <a href="#infra-cab938" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
202
|
+
<td align="center" valign="top" width="14.28%"><a href="http://from.so/Steve_Oney"><img src="https://avatars.githubusercontent.com/u/211262?v=4?s=100" width="100px;" alt="Steve Oney"/><br /><sub><b>Steve Oney</b></sub></a><br /><a href="#ideas-soney" title="Ideas, Planning, & Feedback">🤔</a> <a href="#projectManagement-soney" title="Project Management">📆</a></td>
|
|
203
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.chrisostrouchov.com"><img src="https://avatars.githubusercontent.com/u/1740337?v=4?s=100" width="100px;" alt="Christopher Ostrouchov"/><br /><sub><b>Christopher Ostrouchov</b></sub></a><br /><a href="#ideas-costrouc" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/educational-technology-collective/jupyterlab-pioneer/commits?author=costrouc" title="Code">💻</a></td>
|
|
204
|
+
<td align="center" valign="top" width="14.28%"><a href="https://iamit.in"><img src="https://avatars.githubusercontent.com/u/5647941?v=4?s=100" width="100px;" alt="Amit Kumar"/><br /><sub><b>Amit Kumar</b></sub></a><br /><a href="#infra-aktech" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
205
|
+
</tr>
|
|
206
|
+
</tbody>
|
|
207
|
+
</table>
|
|
208
|
+
|
|
209
|
+
<!-- markdownlint-restore -->
|
|
210
|
+
<!-- prettier-ignore-end -->
|
|
211
|
+
|
|
212
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
213
|
+
|
|
214
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { INotebookTracker } from '@jupyterlab/notebook';
|
|
2
|
+
import { IMainMenu } from '@jupyterlab/mainmenu';
|
|
2
3
|
import { Token } from '@lumino/coreutils';
|
|
3
4
|
import { requestAPI } from './handler';
|
|
4
5
|
import { producerCollection } from './producer';
|
|
6
|
+
import { sendInfoNotification, addInfoToHelpMenu } from './utils';
|
|
5
7
|
const PLUGIN_ID = 'jupyterlab-pioneer:plugin';
|
|
6
8
|
export const IJupyterLabPioneer = new Token(PLUGIN_ID);
|
|
7
9
|
class JupyterLabPioneer {
|
|
@@ -31,15 +33,17 @@ class JupyterLabPioneer {
|
|
|
31
33
|
const plugin = {
|
|
32
34
|
id: PLUGIN_ID,
|
|
33
35
|
autoStart: true,
|
|
34
|
-
requires: [INotebookTracker],
|
|
36
|
+
requires: [INotebookTracker, IMainMenu],
|
|
35
37
|
provides: IJupyterLabPioneer,
|
|
36
|
-
activate: async (app, notebookTracker) => {
|
|
38
|
+
activate: async (app, notebookTracker, mainMenu) => {
|
|
37
39
|
const version = await requestAPI('version');
|
|
38
40
|
console.log(`${PLUGIN_ID}: ${version}`);
|
|
39
41
|
const config = (await requestAPI('config'));
|
|
40
42
|
const pioneer = new JupyterLabPioneer();
|
|
43
|
+
addInfoToHelpMenu(app, mainMenu, version);
|
|
44
|
+
sendInfoNotification(config.exporters, true);
|
|
41
45
|
notebookTracker.widgetAdded.connect(async (_, notebookPanel) => {
|
|
42
|
-
var _a;
|
|
46
|
+
var _a, _b;
|
|
43
47
|
await notebookPanel.revealed;
|
|
44
48
|
await notebookPanel.sessionContext.ready;
|
|
45
49
|
const activeEvents = config.activeEvents;
|
|
@@ -67,6 +71,9 @@ const plugin = {
|
|
|
67
71
|
}
|
|
68
72
|
});
|
|
69
73
|
});
|
|
74
|
+
if ((_b = notebookPanel.content.model) === null || _b === void 0 ? void 0 : _b.getMetadata('exporters')) {
|
|
75
|
+
sendInfoNotification(processedExporters, false);
|
|
76
|
+
}
|
|
70
77
|
});
|
|
71
78
|
return pioneer;
|
|
72
79
|
}
|
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
2
|
+
import { IMainMenu } from '@jupyterlab/mainmenu';
|
|
3
|
+
import { Exporter } from './types';
|
|
4
|
+
export declare const sendInfoNotification: (exporters: Exporter[], isGlobal: boolean) => void;
|
|
5
|
+
export declare const addInfoToHelpMenu: (app: JupyterFrontEnd, mainMenu: IMainMenu, version: string) => void;
|
package/lib/utils.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog, showDialog, Notification } from '@jupyterlab/apputils';
|
|
3
|
+
export const sendInfoNotification = (exporters, isGlobal) => {
|
|
4
|
+
const exporterMessage = exporters
|
|
5
|
+
.map(each => { var _a; return ((_a = each.args) === null || _a === void 0 ? void 0 : _a.id) || each.type; })
|
|
6
|
+
.join(' & ');
|
|
7
|
+
let message;
|
|
8
|
+
if (isGlobal && exporterMessage) {
|
|
9
|
+
message = `Telemetry data is being logged to ${exporterMessage} through jupyterlab-pioneer. \n See Help menu -> JupyterLab Pioneer for more details.`;
|
|
10
|
+
}
|
|
11
|
+
else if (isGlobal && !exporterMessage) {
|
|
12
|
+
message = `Telemetry data is being logged through jupyterlab-pioneer. \n See Help menu -> JupyterLab Pioneer for more details.`;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
message = `Embedded telemetry settings loaded. Telemetry data is being logged to ${exporterMessage} now.`;
|
|
16
|
+
}
|
|
17
|
+
Notification.info(message, { autoClose: 20000 });
|
|
18
|
+
};
|
|
19
|
+
export const addInfoToHelpMenu = (app, mainMenu, version) => {
|
|
20
|
+
// Add extension info to help menu
|
|
21
|
+
app.commands.addCommand('help:pioneer', {
|
|
22
|
+
label: 'JupyterLab Pioneer',
|
|
23
|
+
execute: () => {
|
|
24
|
+
// Create the header of the dialog
|
|
25
|
+
const title = (React.createElement("span", { className: "jp-About-header" },
|
|
26
|
+
"JupyterLab Pioneer",
|
|
27
|
+
React.createElement("div", { className: "jp-About-header-info" },
|
|
28
|
+
React.createElement("span", { className: "jp-About-version-info" },
|
|
29
|
+
React.createElement("span", { className: "jp-About-version" },
|
|
30
|
+
"Version ",
|
|
31
|
+
version)))));
|
|
32
|
+
// Create the body of the dialog
|
|
33
|
+
const contributorsURL = 'https://github.com/educational-technology-collective/jupyterlab-pioneer/graphs/contributors';
|
|
34
|
+
const docURL = 'https://jupyterlab-pioneer.readthedocs.io/en/latest/';
|
|
35
|
+
const gitURL = 'https://github.com/educational-technology-collective/jupyterlab-pioneer';
|
|
36
|
+
const externalLinks = (React.createElement("span", { className: "jp-About-externalLinks" },
|
|
37
|
+
React.createElement("a", { href: contributorsURL, target: "_blank", rel: "noopener noreferrer", className: "jp-Button-flat" }, "CONTRIBUTOR LIST"),
|
|
38
|
+
React.createElement("a", { href: docURL, target: "_blank", rel: "noopener noreferrer", className: "jp-Button-flat" }, "DOCUMENTATION"),
|
|
39
|
+
React.createElement("a", { href: gitURL, target: "_blank", rel: "noopener noreferrer", className: "jp-Button-flat" }, "GITHUB REPO")));
|
|
40
|
+
const copyright = (React.createElement("span", { className: "jp-About-copyright" }, "\u00A9 2023 Educational Technology Collective"));
|
|
41
|
+
const body = (React.createElement("div", { className: "jp-About-body" },
|
|
42
|
+
externalLinks,
|
|
43
|
+
copyright));
|
|
44
|
+
return showDialog({
|
|
45
|
+
title,
|
|
46
|
+
body,
|
|
47
|
+
buttons: [
|
|
48
|
+
Dialog.createButton({
|
|
49
|
+
label: 'Dismiss',
|
|
50
|
+
className: 'jp-About-button jp-mod-reject jp-mod-styled'
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
mainMenu.helpMenu.addGroup([{ command: 'help:pioneer' }]);
|
|
57
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jupyterlab-pioneer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A JupyterLab extension.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -55,7 +55,9 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@jupyterlab/application": "^4.0.0",
|
|
58
|
+
"@jupyterlab/apputils": "^4.1.9",
|
|
58
59
|
"@jupyterlab/coreutils": "^6.0.0",
|
|
60
|
+
"@jupyterlab/mainmenu": "^4.0.9",
|
|
59
61
|
"@jupyterlab/notebook": "^4.0.5",
|
|
60
62
|
"@jupyterlab/services": "^7.0.0"
|
|
61
63
|
},
|