@jupyterlab/apputils 3.3.0-alpha.15 → 3.3.0-alpha.16
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/collapse.d.ts +64 -0
- package/lib/collapse.js +145 -0
- package/lib/collapse.js.map +1 -0
- package/lib/commandpalette.d.ts +32 -0
- package/lib/commandpalette.js +7 -1
- package/lib/commandpalette.js.map +1 -1
- package/lib/dialog.d.ts +8 -10
- package/lib/dialog.js +20 -2
- package/lib/dialog.js.map +1 -1
- package/lib/iframe.d.ts +77 -0
- package/lib/iframe.js +89 -0
- package/lib/iframe.js.map +1 -0
- package/lib/index.d.ts +7 -27
- package/lib/index.js +7 -27
- package/lib/index.js.map +1 -1
- package/lib/inputdialog.js +1 -1
- package/lib/inputdialog.js.map +1 -1
- package/lib/mainareawidget.d.ts +2 -2
- package/lib/mainareawidget.js +2 -2
- package/lib/mainareawidget.js.map +1 -1
- package/lib/menufactory.js +3 -3
- package/lib/menufactory.js.map +1 -1
- package/lib/printing.js +1 -1
- package/lib/printing.js.map +1 -1
- package/lib/sanitizer.js +0 -1
- package/lib/sanitizer.js.map +1 -1
- package/lib/sessioncontext.d.ts +0 -4
- package/lib/sessioncontext.js +7 -37
- package/lib/sessioncontext.js.map +1 -1
- package/lib/spinner.d.ts +15 -0
- package/lib/spinner.js +28 -0
- package/lib/spinner.js.map +1 -0
- package/lib/splash.d.ts +19 -0
- package/lib/splash.js +9 -0
- package/lib/splash.js.map +1 -0
- package/lib/styling.d.ts +27 -0
- package/lib/styling.js +100 -0
- package/lib/styling.js.map +1 -0
- package/lib/thememanager.d.ts +2 -1
- package/lib/thememanager.js.map +1 -1
- package/lib/tokens.d.ts +0 -131
- package/lib/tokens.js +0 -19
- package/lib/tokens.js.map +1 -1
- package/lib/toolbar.d.ts +428 -0
- package/lib/toolbar.js +1016 -0
- package/lib/toolbar.js.map +1 -0
- package/lib/vdom.d.ts +189 -0
- package/lib/vdom.js +203 -0
- package/lib/vdom.js.map +1 -0
- package/lib/windowresolver.d.ts +14 -1
- package/lib/windowresolver.js +6 -1
- package/lib/windowresolver.js.map +1 -1
- package/package.json +25 -20
- package/style/base.css +5 -0
- package/style/collapse.css +30 -0
- package/style/dialog.css +3 -3
- package/style/iframe.css +33 -0
- package/style/mainareawidget.css +0 -16
- package/style/spinner.css +79 -0
- package/style/styling.css +101 -0
- package/style/toolbar.css +115 -0
- package/lib/kernelstatuses.d.ts +0 -10
- package/lib/kernelstatuses.js +0 -29
- package/lib/kernelstatuses.js.map +0 -1
- package/lib/toolbar/factory.d.ts +0 -17
- package/lib/toolbar/factory.js +0 -218
- package/lib/toolbar/factory.js.map +0 -1
- package/lib/toolbar/index.d.ts +0 -3
- package/lib/toolbar/index.js +0 -4
- package/lib/toolbar/index.js.map +0 -1
- package/lib/toolbar/registry.d.ts +0 -41
- package/lib/toolbar/registry.js +0 -87
- package/lib/toolbar/registry.js.map +0 -1
- package/lib/toolbar/widget.d.ts +0 -39
- package/lib/toolbar/widget.js +0 -158
- package/lib/toolbar/widget.js.map +0 -1
package/style/mainareawidget.css
CHANGED
|
@@ -7,19 +7,3 @@
|
|
|
7
7
|
.jp-MainAreaWidget > :focus {
|
|
8
8
|
outline: none;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
.jp-MainAreaWidget .jp-MainAreaWidget-error {
|
|
12
|
-
padding: 6px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.jp-MainAreaWidget .jp-MainAreaWidget-error > pre {
|
|
16
|
-
width: auto;
|
|
17
|
-
padding: 10px;
|
|
18
|
-
background: var(--jp-error-color3);
|
|
19
|
-
border: var(--jp-border-width) solid var(--jp-error-color1);
|
|
20
|
-
border-radius: var(--jp-border-radius);
|
|
21
|
-
color: var(--jp-ui-font-color1);
|
|
22
|
-
font-size: var(--jp-ui-font-size1);
|
|
23
|
-
white-space: pre-wrap;
|
|
24
|
-
word-wrap: break-word;
|
|
25
|
-
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*-----------------------------------------------------------------------------
|
|
2
|
+
| Copyright (c) 2017, Jupyter Development Team.
|
|
3
|
+
|
|
|
4
|
+
| Distributed under the terms of the Modified BSD License.
|
|
5
|
+
|----------------------------------------------------------------------------*/
|
|
6
|
+
|
|
7
|
+
.jp-Spinner {
|
|
8
|
+
position: absolute;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
z-index: 10;
|
|
13
|
+
left: 0;
|
|
14
|
+
top: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
background: var(--jp-layout-color0);
|
|
18
|
+
outline: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.jp-SpinnerContent {
|
|
22
|
+
font-size: 10px;
|
|
23
|
+
margin: 50px auto;
|
|
24
|
+
text-indent: -9999em;
|
|
25
|
+
width: 3em;
|
|
26
|
+
height: 3em;
|
|
27
|
+
border-radius: 50%;
|
|
28
|
+
background: var(--jp-brand-color3);
|
|
29
|
+
background: linear-gradient(
|
|
30
|
+
to right,
|
|
31
|
+
#f37626 10%,
|
|
32
|
+
rgba(255, 255, 255, 0) 42%
|
|
33
|
+
);
|
|
34
|
+
position: relative;
|
|
35
|
+
animation: load3 1s infinite linear, fadeIn 1s;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.jp-SpinnerContent:before {
|
|
39
|
+
width: 50%;
|
|
40
|
+
height: 50%;
|
|
41
|
+
background: #f37626;
|
|
42
|
+
border-radius: 100% 0 0 0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
content: '';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.jp-SpinnerContent:after {
|
|
50
|
+
background: var(--jp-layout-color0);
|
|
51
|
+
width: 75%;
|
|
52
|
+
height: 75%;
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
content: '';
|
|
55
|
+
margin: auto;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes fadeIn {
|
|
64
|
+
0% {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
}
|
|
67
|
+
100% {
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@keyframes load3 {
|
|
73
|
+
0% {
|
|
74
|
+
transform: rotate(0deg);
|
|
75
|
+
}
|
|
76
|
+
100% {
|
|
77
|
+
transform: rotate(360deg);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*-----------------------------------------------------------------------------
|
|
2
|
+
| Copyright (c) 2014-2017, Jupyter Development Team.
|
|
3
|
+
|
|
|
4
|
+
| Distributed under the terms of the Modified BSD License.
|
|
5
|
+
|----------------------------------------------------------------------------*/
|
|
6
|
+
|
|
7
|
+
button.jp-mod-styled {
|
|
8
|
+
font-size: var(--jp-ui-font-size1);
|
|
9
|
+
color: var(--jp-ui-font-color0);
|
|
10
|
+
border: none;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
text-align: center;
|
|
13
|
+
line-height: 32px;
|
|
14
|
+
height: 32px;
|
|
15
|
+
padding: 0px 12px;
|
|
16
|
+
letter-spacing: 0.8px;
|
|
17
|
+
outline: none;
|
|
18
|
+
appearance: none;
|
|
19
|
+
-webkit-appearance: none;
|
|
20
|
+
-moz-appearance: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
input.jp-mod-styled {
|
|
24
|
+
background: var(--jp-input-background);
|
|
25
|
+
height: 28px;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
border: var(--jp-border-width) solid var(--jp-border-color1);
|
|
28
|
+
padding-left: 7px;
|
|
29
|
+
padding-right: 7px;
|
|
30
|
+
font-size: var(--jp-ui-font-size2);
|
|
31
|
+
color: var(--jp-ui-font-color0);
|
|
32
|
+
outline: none;
|
|
33
|
+
appearance: none;
|
|
34
|
+
-webkit-appearance: none;
|
|
35
|
+
-moz-appearance: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
input[type='checkbox'].jp-mod-styled {
|
|
39
|
+
appearance: checkbox;
|
|
40
|
+
-webkit-appearance: checkbox;
|
|
41
|
+
-moz-appearance: checkbox;
|
|
42
|
+
height: auto;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
input.jp-mod-styled:focus {
|
|
46
|
+
border: var(--jp-border-width) solid var(--md-blue-500);
|
|
47
|
+
box-shadow: inset 0 0 4px var(--md-blue-300);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.jp-FileDialog-Checkbox {
|
|
51
|
+
margin-top: 35px;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
align-items: end;
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.jp-FileDialog-Checkbox > label {
|
|
59
|
+
flex: 1 1 auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.jp-select-wrapper {
|
|
63
|
+
display: flex;
|
|
64
|
+
position: relative;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
padding: 1px;
|
|
67
|
+
background-color: var(--jp-layout-color1);
|
|
68
|
+
height: 28px;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
margin-bottom: 12px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.jp-select-wrapper.jp-mod-focused select.jp-mod-styled {
|
|
74
|
+
border: var(--jp-border-width) solid var(--jp-input-active-border-color);
|
|
75
|
+
box-shadow: var(--jp-input-box-shadow);
|
|
76
|
+
background-color: var(--jp-input-active-background);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
select.jp-mod-styled:hover {
|
|
80
|
+
background-color: var(--jp-layout-color1);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
color: var(--jp-ui-font-color0);
|
|
83
|
+
background-color: var(--jp-input-hover-background);
|
|
84
|
+
box-shadow: inset 0 0px 1px rgba(0, 0, 0, 0.5);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
select.jp-mod-styled {
|
|
88
|
+
flex: 1 1 auto;
|
|
89
|
+
height: 32px;
|
|
90
|
+
width: 100%;
|
|
91
|
+
font-size: var(--jp-ui-font-size2);
|
|
92
|
+
background: var(--jp-input-background);
|
|
93
|
+
color: var(--jp-ui-font-color0);
|
|
94
|
+
padding: 0 25px 0 8px;
|
|
95
|
+
border: var(--jp-border-width) solid var(--jp-input-border-color);
|
|
96
|
+
border-radius: 0px;
|
|
97
|
+
outline: none;
|
|
98
|
+
appearance: none;
|
|
99
|
+
-webkit-appearance: none;
|
|
100
|
+
-moz-appearance: none;
|
|
101
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*-----------------------------------------------------------------------------
|
|
2
|
+
| Copyright (c) 2014-2016, Jupyter Development Team.
|
|
3
|
+
|
|
|
4
|
+
| Distributed under the terms of the Modified BSD License.
|
|
5
|
+
|----------------------------------------------------------------------------*/
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--jp-private-toolbar-height: calc(
|
|
9
|
+
28px + var(--jp-border-width)
|
|
10
|
+
); /* leave 28px for content */
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.jp-Toolbar {
|
|
14
|
+
color: var(--jp-ui-font-color1);
|
|
15
|
+
flex: 0 0 auto;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);
|
|
19
|
+
box-shadow: var(--jp-toolbar-box-shadow);
|
|
20
|
+
background: var(--jp-toolbar-background);
|
|
21
|
+
min-height: var(--jp-toolbar-micro-height);
|
|
22
|
+
padding: 2px;
|
|
23
|
+
z-index: 1;
|
|
24
|
+
overflow-x: hidden;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Toolbar items */
|
|
28
|
+
|
|
29
|
+
.jp-Toolbar > .jp-Toolbar-item.jp-Toolbar-spacer {
|
|
30
|
+
flex-grow: 1;
|
|
31
|
+
flex-shrink: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.jp-Toolbar-item.jp-Toolbar-kernelStatus {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
width: 32px;
|
|
37
|
+
background-repeat: no-repeat;
|
|
38
|
+
background-position: center;
|
|
39
|
+
background-size: 16px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.jp-Toolbar > .jp-Toolbar-item {
|
|
43
|
+
flex: 0 0 auto;
|
|
44
|
+
display: flex;
|
|
45
|
+
padding-left: 1px;
|
|
46
|
+
padding-right: 1px;
|
|
47
|
+
font-size: var(--jp-ui-font-size1);
|
|
48
|
+
line-height: var(--jp-private-toolbar-height);
|
|
49
|
+
height: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Toolbar buttons */
|
|
53
|
+
|
|
54
|
+
/* This is the div we use to wrap the react component into a Widget */
|
|
55
|
+
div.jp-ToolbarButton {
|
|
56
|
+
color: transparent;
|
|
57
|
+
border: none;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
outline: none;
|
|
60
|
+
appearance: none;
|
|
61
|
+
-webkit-appearance: none;
|
|
62
|
+
-moz-appearance: none;
|
|
63
|
+
padding: 0px;
|
|
64
|
+
margin: 0px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
button.jp-ToolbarButtonComponent {
|
|
68
|
+
background: var(--jp-layout-color1);
|
|
69
|
+
border: none;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
outline: none;
|
|
72
|
+
appearance: none;
|
|
73
|
+
-webkit-appearance: none;
|
|
74
|
+
-moz-appearance: none;
|
|
75
|
+
padding: 0px 6px;
|
|
76
|
+
margin: 0px;
|
|
77
|
+
height: 24px;
|
|
78
|
+
border-radius: var(--jp-border-radius);
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
text-align: center;
|
|
82
|
+
font-size: 14px;
|
|
83
|
+
min-width: unset;
|
|
84
|
+
min-height: unset;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
button.jp-ToolbarButtonComponent:disabled {
|
|
88
|
+
opacity: 0.4;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
button.jp-ToolbarButtonComponent span {
|
|
92
|
+
padding: 0px;
|
|
93
|
+
flex: 0 0 auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
button.jp-ToolbarButtonComponent .jp-ToolbarButtonComponent-label {
|
|
97
|
+
font-size: var(--jp-ui-font-size1);
|
|
98
|
+
line-height: 100%;
|
|
99
|
+
padding-left: 2px;
|
|
100
|
+
color: var(--jp-ui-font-color1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#jp-main-dock-panel[data-mode='single-document']
|
|
104
|
+
.jp-MainAreaWidget
|
|
105
|
+
> .jp-Toolbar.jp-Toolbar-micro {
|
|
106
|
+
padding: 0;
|
|
107
|
+
min-height: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
#jp-main-dock-panel[data-mode='single-document']
|
|
111
|
+
.jp-MainAreaWidget
|
|
112
|
+
> .jp-Toolbar {
|
|
113
|
+
border: none;
|
|
114
|
+
box-shadow: none;
|
|
115
|
+
}
|
package/lib/kernelstatuses.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ITranslator } from '@jupyterlab/translation';
|
|
2
|
-
import { ISessionContext } from './sessioncontext';
|
|
3
|
-
/**
|
|
4
|
-
* Helper function to translate kernel statuses mapping by using
|
|
5
|
-
* input translator.
|
|
6
|
-
*
|
|
7
|
-
* @param translator - - Language translator.
|
|
8
|
-
* @return The translated kernel status mapping.
|
|
9
|
-
*/
|
|
10
|
-
export declare function translateKernelStatuses(translator?: ITranslator): Record<ISessionContext.KernelDisplayStatus, string>;
|
package/lib/kernelstatuses.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { nullTranslator } from '@jupyterlab/translation';
|
|
2
|
-
/**
|
|
3
|
-
* Helper function to translate kernel statuses mapping by using
|
|
4
|
-
* input translator.
|
|
5
|
-
*
|
|
6
|
-
* @param translator - - Language translator.
|
|
7
|
-
* @return The translated kernel status mapping.
|
|
8
|
-
*/
|
|
9
|
-
export function translateKernelStatuses(translator) {
|
|
10
|
-
translator = translator || nullTranslator;
|
|
11
|
-
const trans = translator.load('jupyterlab');
|
|
12
|
-
const translated = {
|
|
13
|
-
unknown: trans.__('Unknown'),
|
|
14
|
-
starting: trans.__('Starting'),
|
|
15
|
-
idle: trans.__('Idle'),
|
|
16
|
-
busy: trans.__('Busy'),
|
|
17
|
-
terminating: trans.__('Terminating'),
|
|
18
|
-
restarting: trans.__('Restarting'),
|
|
19
|
-
autorestarting: trans.__('Autorestarting'),
|
|
20
|
-
dead: trans.__('Dead'),
|
|
21
|
-
connected: trans.__('Connected'),
|
|
22
|
-
connecting: trans.__('Connecting'),
|
|
23
|
-
disconnected: trans.__('Disconnected'),
|
|
24
|
-
initializing: trans.__('Initializing'),
|
|
25
|
-
'': ''
|
|
26
|
-
};
|
|
27
|
-
return translated;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=kernelstatuses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kernelstatuses.js","sourceRoot":"","sources":["../src/kernelstatuses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGtE;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAAwB;IAExB,UAAU,GAAG,UAAU,IAAI,cAAc,CAAC;IAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAwD;QACtE,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC;QAC5B,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC;QAC9B,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC;QACtB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC;QACpC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC;QAClC,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC;QAC1C,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC;QAChC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC;QAClC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC;QACtC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC;QACtC,EAAE,EAAE,EAAE;KACP,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/lib/toolbar/factory.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
2
|
-
import { ITranslator } from '@jupyterlab/translation';
|
|
3
|
-
import { Widget } from '@lumino/widgets';
|
|
4
|
-
import { IToolbarWidgetRegistry, ToolbarRegistry } from '../tokens';
|
|
5
|
-
/**
|
|
6
|
-
* Create the toolbar factory for a given container widget based
|
|
7
|
-
* on a data description stored in settings
|
|
8
|
-
*
|
|
9
|
-
* @param toolbarRegistry Toolbar widgets registry
|
|
10
|
-
* @param settingsRegistry Settings registry
|
|
11
|
-
* @param factoryName Toolbar container factory name
|
|
12
|
-
* @param pluginId Settings plugin id
|
|
13
|
-
* @param translator Translator
|
|
14
|
-
* @param propertyId Toolbar definition key in the settings plugin
|
|
15
|
-
* @returns List of toolbar widgets
|
|
16
|
-
*/
|
|
17
|
-
export declare function createToolbarFactory(toolbarRegistry: IToolbarWidgetRegistry, settingsRegistry: ISettingRegistry, factoryName: string, pluginId: string, translator: ITranslator, propertyId?: string): (widget: Widget) => ToolbarRegistry.IToolbarItem[];
|
package/lib/toolbar/factory.js
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { ObservableList } from '@jupyterlab/observables';
|
|
2
|
-
import { SettingRegistry } from '@jupyterlab/settingregistry';
|
|
3
|
-
import { findIndex, toArray } from '@lumino/algorithm';
|
|
4
|
-
import { JSONExt } from '@lumino/coreutils';
|
|
5
|
-
import { Dialog, showDialog } from '../dialog';
|
|
6
|
-
/**
|
|
7
|
-
* Default toolbar item rank
|
|
8
|
-
*
|
|
9
|
-
* #### Notes
|
|
10
|
-
* This will place item just before the white spacer item in the notebook toolbar.
|
|
11
|
-
*/
|
|
12
|
-
const DEFAULT_TOOLBAR_ITEM_RANK = 50;
|
|
13
|
-
/**
|
|
14
|
-
* Display warning when the toolbar definition have been modified.
|
|
15
|
-
*
|
|
16
|
-
* @param trans Translation bundle
|
|
17
|
-
*/
|
|
18
|
-
async function displayInformation(trans) {
|
|
19
|
-
const result = await showDialog({
|
|
20
|
-
title: trans.__('Information'),
|
|
21
|
-
body: trans.__('Toolbar customization has changed. You will need to reload JupyterLab to see the changes.'),
|
|
22
|
-
buttons: [
|
|
23
|
-
Dialog.cancelButton(),
|
|
24
|
-
Dialog.okButton({ label: trans.__('Reload') })
|
|
25
|
-
]
|
|
26
|
-
});
|
|
27
|
-
if (result.button.accept) {
|
|
28
|
-
location.reload();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Accumulate the toolbar definition from all settings and set the default value from it.
|
|
33
|
-
*
|
|
34
|
-
* @param registry Application settings registry
|
|
35
|
-
* @param factoryName Widget factory name that needs a toolbar
|
|
36
|
-
* @param pluginId Settings plugin id
|
|
37
|
-
* @param translator Translator object
|
|
38
|
-
* @param propertyId Property holding the toolbar definition in the settings; default 'toolbar'
|
|
39
|
-
* @returns List of toolbar items
|
|
40
|
-
*/
|
|
41
|
-
async function getToolbarItems(registry, factoryName, pluginId, translator, propertyId = 'toolbar') {
|
|
42
|
-
var _a;
|
|
43
|
-
const trans = translator.load('jupyterlab');
|
|
44
|
-
let canonical;
|
|
45
|
-
let loaded = {};
|
|
46
|
-
/**
|
|
47
|
-
* Populate the plugin's schema defaults.
|
|
48
|
-
*
|
|
49
|
-
* We keep track of disabled entries in case the plugin is loaded
|
|
50
|
-
* after the toolbar initialization.
|
|
51
|
-
*/
|
|
52
|
-
function populate(schema) {
|
|
53
|
-
var _a, _b;
|
|
54
|
-
loaded = {};
|
|
55
|
-
schema.properties[propertyId].default = Object.keys(registry.plugins)
|
|
56
|
-
.map(plugin => {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
const items = (_b = ((_a = registry.plugins[plugin].schema['jupyter.lab.toolbars']) !== null && _a !== void 0 ? _a : {})[factoryName]) !== null && _b !== void 0 ? _b : [];
|
|
59
|
-
loaded[plugin] = items;
|
|
60
|
-
return items;
|
|
61
|
-
})
|
|
62
|
-
.concat([
|
|
63
|
-
(_b = ((_a = schema['jupyter.lab.toolbars']) !== null && _a !== void 0 ? _a : {})[factoryName]) !== null && _b !== void 0 ? _b : [],
|
|
64
|
-
schema.properties[propertyId].default
|
|
65
|
-
])
|
|
66
|
-
.reduceRight((acc, val) => SettingRegistry.reconcileToolbarItems(acc, val, true), []) // flatten one level
|
|
67
|
-
.sort((a, b) => {
|
|
68
|
-
var _a, _b;
|
|
69
|
-
return ((_a = a.rank) !== null && _a !== void 0 ? _a : DEFAULT_TOOLBAR_ITEM_RANK) -
|
|
70
|
-
((_b = b.rank) !== null && _b !== void 0 ? _b : DEFAULT_TOOLBAR_ITEM_RANK);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
// Transform the plugin object to return different schema than the default.
|
|
74
|
-
registry.transform(pluginId, {
|
|
75
|
-
compose: plugin => {
|
|
76
|
-
var _a, _b, _c, _d, _e;
|
|
77
|
-
// Only override the canonical schema the first time.
|
|
78
|
-
if (!canonical) {
|
|
79
|
-
canonical = JSONExt.deepCopy(plugin.schema);
|
|
80
|
-
populate(canonical);
|
|
81
|
-
}
|
|
82
|
-
const defaults = (_c = ((_b = ((_a = canonical.properties) !== null && _a !== void 0 ? _a : {})[propertyId]) !== null && _b !== void 0 ? _b : {}).default) !== null && _c !== void 0 ? _c : [];
|
|
83
|
-
// Initialize the settings
|
|
84
|
-
const user = plugin.data.user;
|
|
85
|
-
const composite = plugin.data.composite;
|
|
86
|
-
// Overrides the value with using the aggregated default for the toolbar property
|
|
87
|
-
user[propertyId] = (_d = plugin.data.user[propertyId]) !== null && _d !== void 0 ? _d : [];
|
|
88
|
-
composite[propertyId] = (_e = SettingRegistry.reconcileToolbarItems(defaults, user[propertyId], false)) !== null && _e !== void 0 ? _e : [];
|
|
89
|
-
plugin.data = { composite, user };
|
|
90
|
-
return plugin;
|
|
91
|
-
},
|
|
92
|
-
fetch: plugin => {
|
|
93
|
-
// Only override the canonical schema the first time.
|
|
94
|
-
if (!canonical) {
|
|
95
|
-
canonical = JSONExt.deepCopy(plugin.schema);
|
|
96
|
-
populate(canonical);
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
data: plugin.data,
|
|
100
|
-
id: plugin.id,
|
|
101
|
-
raw: plugin.raw,
|
|
102
|
-
schema: canonical,
|
|
103
|
-
version: plugin.version
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
// Repopulate the canonical variable after the setting registry has
|
|
108
|
-
// preloaded all initial plugins.
|
|
109
|
-
canonical = null;
|
|
110
|
-
const settings = await registry.load(pluginId);
|
|
111
|
-
const toolbarItems = new ObservableList({
|
|
112
|
-
values: (_a = JSONExt.deepCopy(settings.composite[propertyId])) !== null && _a !== void 0 ? _a : [],
|
|
113
|
-
itemCmp: (a, b) => JSONExt.deepEqual(a, b)
|
|
114
|
-
});
|
|
115
|
-
// React to customization by the user
|
|
116
|
-
settings.changed.connect(() => {
|
|
117
|
-
var _a;
|
|
118
|
-
// As extension may change the toolbar through API,
|
|
119
|
-
// prompt the user to reload if the toolbar definition has been updated.
|
|
120
|
-
const newItems = (_a = settings.composite[propertyId]) !== null && _a !== void 0 ? _a : [];
|
|
121
|
-
if (!JSONExt.deepEqual(toArray(toolbarItems.iter()), newItems)) {
|
|
122
|
-
void displayInformation(trans);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
// React to plugin changes
|
|
126
|
-
registry.pluginChanged.connect(async (sender, plugin) => {
|
|
127
|
-
var _a, _b, _c, _d;
|
|
128
|
-
// As the plugin storing the toolbar definition is transformed using
|
|
129
|
-
// the above definition, if it changes, this means that a request to
|
|
130
|
-
// reloaded was triggered. Hence the toolbar definitions from the other
|
|
131
|
-
// plugins has been automatically reset during the transform step.
|
|
132
|
-
if (plugin !== pluginId) {
|
|
133
|
-
// If a plugin changed its toolbar items
|
|
134
|
-
const oldItems = (_a = loaded[plugin]) !== null && _a !== void 0 ? _a : [];
|
|
135
|
-
const newItems = (_c = ((_b = registry.plugins[plugin].schema['jupyter.lab.toolbars']) !== null && _b !== void 0 ? _b : {})[factoryName]) !== null && _c !== void 0 ? _c : [];
|
|
136
|
-
if (!JSONExt.deepEqual(oldItems, newItems)) {
|
|
137
|
-
if (loaded[plugin]) {
|
|
138
|
-
// The plugin has changed, request the user to reload the UI
|
|
139
|
-
await displayInformation(trans);
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
// The plugin was not yet loaded => update the toolbar items list
|
|
143
|
-
loaded[plugin] = JSONExt.deepCopy(newItems);
|
|
144
|
-
const newList = (_d = SettingRegistry.reconcileToolbarItems(toArray(toolbarItems), newItems, false)) !== null && _d !== void 0 ? _d : [];
|
|
145
|
-
// Existing items cannot be removed.
|
|
146
|
-
newList === null || newList === void 0 ? void 0 : newList.forEach(item => {
|
|
147
|
-
const index = findIndex(toolbarItems, value => item.name === value.name);
|
|
148
|
-
if (index < 0) {
|
|
149
|
-
toolbarItems.push(item);
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
toolbarItems.set(index, item);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
return toolbarItems;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Create the toolbar factory for a given container widget based
|
|
163
|
-
* on a data description stored in settings
|
|
164
|
-
*
|
|
165
|
-
* @param toolbarRegistry Toolbar widgets registry
|
|
166
|
-
* @param settingsRegistry Settings registry
|
|
167
|
-
* @param factoryName Toolbar container factory name
|
|
168
|
-
* @param pluginId Settings plugin id
|
|
169
|
-
* @param translator Translator
|
|
170
|
-
* @param propertyId Toolbar definition key in the settings plugin
|
|
171
|
-
* @returns List of toolbar widgets
|
|
172
|
-
*/
|
|
173
|
-
export function createToolbarFactory(toolbarRegistry, settingsRegistry, factoryName, pluginId, translator, propertyId = 'toolbar') {
|
|
174
|
-
const items = [];
|
|
175
|
-
let rawItems;
|
|
176
|
-
const transfer = (list, change) => {
|
|
177
|
-
switch (change.type) {
|
|
178
|
-
case 'move':
|
|
179
|
-
break;
|
|
180
|
-
case 'add':
|
|
181
|
-
case 'remove':
|
|
182
|
-
case 'set':
|
|
183
|
-
items.length = 0;
|
|
184
|
-
items.push(...toArray(list)
|
|
185
|
-
.filter(item => !item.disabled)
|
|
186
|
-
.sort((a, b) => {
|
|
187
|
-
var _a, _b;
|
|
188
|
-
return ((_a = a.rank) !== null && _a !== void 0 ? _a : DEFAULT_TOOLBAR_ITEM_RANK) -
|
|
189
|
-
((_b = b.rank) !== null && _b !== void 0 ? _b : DEFAULT_TOOLBAR_ITEM_RANK);
|
|
190
|
-
}));
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
// Get toolbar definition from the settings
|
|
195
|
-
getToolbarItems(settingsRegistry, factoryName, pluginId, translator, propertyId)
|
|
196
|
-
.then(candidates => {
|
|
197
|
-
rawItems = candidates;
|
|
198
|
-
rawItems.changed.connect(transfer);
|
|
199
|
-
// Force initialization of items
|
|
200
|
-
transfer(rawItems, {
|
|
201
|
-
type: 'add',
|
|
202
|
-
newIndex: 0,
|
|
203
|
-
newValues: [],
|
|
204
|
-
oldIndex: 0,
|
|
205
|
-
oldValues: []
|
|
206
|
-
});
|
|
207
|
-
})
|
|
208
|
-
.catch(reason => {
|
|
209
|
-
console.error(`Failed to load toolbar items for factory ${factoryName} from ${pluginId}`, reason);
|
|
210
|
-
});
|
|
211
|
-
return (widget) => items.map(item => {
|
|
212
|
-
return {
|
|
213
|
-
name: item.name,
|
|
214
|
-
widget: toolbarRegistry.createWidget(factoryName, widget, item)
|
|
215
|
-
};
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
//# sourceMappingURL=factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/toolbar/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAqB,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC;;;;GAIG;AACH,KAAK,UAAU,kBAAkB,CAAC,KAAwB;IACxD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC;QAC9B,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC;QAC9B,IAAI,EAAE,KAAK,CAAC,EAAE,CAC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CAAC,CAAC;IACL,CAAC,CAAC;SACD,KAAK,CAAC,MAAM,CAAC,EAAE;QACd,OAAO,CAAC,KAAK,CACX,4CAA4C,WAAW,SAAS,QAAQ,EAAE,EAC1E,MAAM,CACP,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,MAAc,EAAE,EAAE,CACxB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACf,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,eAAe,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC;SAChE,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/lib/toolbar/index.d.ts
DELETED
package/lib/toolbar/index.js
DELETED
package/lib/toolbar/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { CommandRegistry } from '@lumino/commands';
|
|
2
|
-
import { Widget } from '@lumino/widgets';
|
|
3
|
-
import { IToolbarWidgetRegistry, ToolbarRegistry } from '../tokens';
|
|
4
|
-
/**
|
|
5
|
-
* Concrete implementation of IToolbarWidgetRegistry interface
|
|
6
|
-
*/
|
|
7
|
-
export declare class ToolbarWidgetRegistry implements IToolbarWidgetRegistry {
|
|
8
|
-
constructor(options: ToolbarRegistry.IOptions);
|
|
9
|
-
/**
|
|
10
|
-
* Default toolbar item factory
|
|
11
|
-
*/
|
|
12
|
-
get defaultFactory(): (widgetFactory: string, widget: Widget, toolbarItem: ToolbarRegistry.IWidget) => Widget;
|
|
13
|
-
set defaultFactory(factory: (widgetFactory: string, widget: Widget, toolbarItem: ToolbarRegistry.IWidget) => Widget);
|
|
14
|
-
/**
|
|
15
|
-
* Create a toolbar item widget
|
|
16
|
-
*
|
|
17
|
-
* @param widgetFactory The widget factory name that creates the toolbar
|
|
18
|
-
* @param widget The newly widget containing the toolbar
|
|
19
|
-
* @param toolbarItem The toolbar item definition
|
|
20
|
-
* @returns The widget to be inserted in the toolbar.
|
|
21
|
-
*/
|
|
22
|
-
createWidget(widgetFactory: string, widget: Widget, toolbarItem: ToolbarRegistry.IWidget): Widget;
|
|
23
|
-
/**
|
|
24
|
-
* Register a new toolbar item factory
|
|
25
|
-
*
|
|
26
|
-
* @param widgetFactory The widget factory name that creates the toolbar
|
|
27
|
-
* @param toolbarItemName The unique toolbar item
|
|
28
|
-
* @param factory The factory function that receives the widget containing the toolbar and returns the toolbar widget.
|
|
29
|
-
* @returns The previously defined factory
|
|
30
|
-
*/
|
|
31
|
-
registerFactory<T extends Widget = Widget>(widgetFactory: string, toolbarItemName: string, factory: (main: T) => Widget): ((main: T) => Widget) | undefined;
|
|
32
|
-
protected _defaultFactory: (widgetFactory: string, widget: Widget, toolbarItem: ToolbarRegistry.IWidget) => Widget;
|
|
33
|
-
protected _widgets: Map<string, Map<string, (main: Widget) => Widget>>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create the default toolbar item widget factory
|
|
37
|
-
*
|
|
38
|
-
* @param commands Application commands registry
|
|
39
|
-
* @returns Default factory
|
|
40
|
-
*/
|
|
41
|
-
export declare function createDefaultFactory(commands: CommandRegistry): (widgetFactory: string, widget: Widget, toolbarItem: ToolbarRegistry.IWidget) => Widget;
|