@@ -3,69 +3,72 @@ import * as ReactDOM from "react-dom";
3
3
4
4
import { LabToastContainer , INotification } from "./ToastJupyterLab" ;
5
5
6
- import { JupyterLab , JupyterLabPlugin } from "@jupyterlab/application" ;
6
+ import {
7
+ JupyterFrontEndPlugin ,
8
+ JupyterFrontEnd
9
+ } from "@jupyterlab/application" ;
7
10
8
11
import "../style/index.css" ;
9
12
10
13
/**
11
14
* Initialization data for the jupyterlab_toastify extension.
12
15
*/
13
- const extension : JupyterLabPlugin < void > = {
16
+ const extension : JupyterFrontEndPlugin < void > = {
14
17
id : "jupyterlab_toastify" ,
15
18
autoStart : true ,
16
- activate : ( app : JupyterLab ) => {
19
+ activate : ( app : JupyterFrontEnd ) => {
17
20
app . restored . then ( ( ) => {
18
21
const node = document . createElement ( "div" ) ;
19
22
document . body . appendChild ( node ) ;
20
23
ReactDOM . render ( < LabToastContainer /> , node ) ;
21
24
22
25
// For testing
23
- // let id = INotification.inProgress("Task in progress!");
24
- // setTimeout(INotification.update, 2500, {
25
- // toastId: id,
26
- // message: "Updating task..."
27
- // });
28
- // setTimeout(INotification.update, 3500, {
29
- // toastId: id,
30
- // message: "Task succeed",
31
- // type: "success",
32
- // autoClose: 3000
33
- // });
34
- // INotification.error("Error");
35
- // setTimeout(
36
- // INotification.info,
37
- // 500,
38
- // "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis blandit tellus, non pulvinar justo."
39
- // );
40
- // setTimeout(INotification.warning, 1000, "Warning");
41
- // setTimeout(INotification.success, 1500, "Success");
42
- // setTimeout(INotification.notify, 2000, "Default");
26
+ // let id = INotification.inProgress("Task in progress!");
27
+ // setTimeout(INotification.update, 2500, {
28
+ // toastId: id,
29
+ // message: "Updating task..."
30
+ // });
31
+ // setTimeout(INotification.update, 3500, {
32
+ // toastId: id,
33
+ // message: "Task succeed",
34
+ // type: "success",
35
+ // autoClose: 3000
36
+ // });
37
+ // INotification.error("Error");
38
+ // setTimeout(
39
+ // INotification.info,
40
+ // 500,
41
+ // "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis blandit tellus, non pulvinar justo."
42
+ // );
43
+ // setTimeout(INotification.warning, 1000, "Warning");
44
+ // setTimeout(INotification.success, 1500, "Success");
45
+ // setTimeout(INotification.notify, 2000, "Default");
43
46
44
- // INotification.error("Error with button", {
45
- // buttons: [
46
- // {
47
- // label: "Action1",
48
- // callback: () => alert("Action1 was clicked")
49
- // },
50
- // {
51
- // label: "Action2",
52
- // callback: () => alert("Action2 was clicked")
53
- // }
54
- // ]
55
- // });
47
+ // INotification.error("Error with button", {
48
+ // buttons: [
49
+ // {
50
+ // label: "Action1",
51
+ // callback: () => alert("Action1 was clicked")
52
+ // },
53
+ // {
54
+ // label: "Action2",
55
+ // callback: () => alert("Action2 was clicked")
56
+ // }
57
+ // ]
58
+ // });
56
59
57
- // let id2 = INotification.inProgress("Task2 in progress! But how long will it take to get it done?");
58
- // setTimeout(INotification.update, 4500, {
59
- // toastId: id2,
60
- // message: "Task2 succeed",
61
- // type: "success",
62
- // buttons: [
63
- // {
64
- // label: "Action3",
65
- // callback: () => alert("Action3 was clicked")
66
- // }
67
- // ]
68
- // });
60
+ // let id2 = INotification.inProgress("Task2 in progress! But how long will it take to get it done?");
61
+ // setTimeout(INotification.update, 4500, {
62
+ // toastId: id2,
63
+ // message: "Task2 succeed",
64
+ // type: "success",
65
+ // buttons: [
66
+ // {
67
+ // label: "Action3",
68
+ // callback: () => alert("Action3 was clicked")
69
+ // }
70
+ // ]
71
+ // });
69
72
} ) ;
70
73
}
71
74
} ;
0 commit comments