@jupyterlab/apputils 4.0.0-alpha.1 → 4.0.0-alpha.12
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/dialog.d.ts +7 -0
- package/lib/dialog.js +21 -3
- package/lib/dialog.js.map +1 -1
- package/lib/domutils.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/lib/kernelstatuses.d.ts +74 -2
- package/lib/kernelstatuses.js +142 -2
- package/lib/kernelstatuses.js.map +1 -1
- package/lib/mainareawidget.d.ts +9 -0
- package/lib/mainareawidget.js +28 -3
- package/lib/mainareawidget.js.map +1 -1
- package/lib/menufactory.js +4 -0
- package/lib/menufactory.js.map +1 -1
- package/lib/runningSessions.d.ts +72 -0
- package/lib/runningSessions.js +119 -0
- package/lib/runningSessions.js.map +1 -0
- package/lib/sanitizer.js +14 -6
- package/lib/sanitizer.js.map +1 -1
- package/lib/semanticCommand.js +4 -0
- package/lib/semanticCommand.js.map +1 -1
- package/lib/sessioncontext.d.ts +1 -1
- package/lib/sessioncontext.js +42 -21
- package/lib/sessioncontext.js.map +1 -1
- package/lib/thememanager.js +5 -0
- package/lib/thememanager.js.map +1 -1
- package/lib/tokens.d.ts +26 -9
- package/lib/tokens.js +1 -6
- package/lib/tokens.js.map +1 -1
- package/lib/toolbar/factory.d.ts +12 -2
- package/lib/toolbar/factory.js +236 -142
- package/lib/toolbar/factory.js.map +1 -1
- package/lib/toolbar/index.js +4 -0
- package/lib/toolbar/index.js.map +1 -1
- package/lib/toolbar/registry.d.ts +11 -0
- package/lib/toolbar/registry.js +19 -2
- package/lib/toolbar/registry.js.map +1 -1
- package/lib/toolbar/widget.js.map +1 -1
- package/lib/widgettracker.js.map +1 -1
- package/package.json +17 -16
- package/style/base.css +0 -1
- package/style/commandpalette.css +7 -10
- package/style/dialog.css +7 -6
- package/style/index.css +1 -0
- package/style/index.js +1 -0
- package/style/inputdialog.css +5 -0
- package/style/materialcolors.css +8 -21
- package/lib/hoverbox.d.ts +0 -82
- package/lib/hoverbox.js +0 -100
- package/lib/hoverbox.js.map +0 -1
- package/style/hoverbox.css +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/apputils",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.12",
|
|
4
4
|
"description": "JupyterLab - Application Utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -44,36 +44,37 @@
|
|
|
44
44
|
"watch": "tsc -b --watch"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@jupyterlab/coreutils": "^6.0.0-alpha.
|
|
48
|
-
"@jupyterlab/observables": "^5.0.0-alpha.
|
|
49
|
-
"@jupyterlab/
|
|
50
|
-
"@jupyterlab/
|
|
51
|
-
"@jupyterlab/
|
|
52
|
-
"@jupyterlab/
|
|
53
|
-
"@jupyterlab/
|
|
47
|
+
"@jupyterlab/coreutils": "^6.0.0-alpha.12",
|
|
48
|
+
"@jupyterlab/observables": "^5.0.0-alpha.12",
|
|
49
|
+
"@jupyterlab/rendermime-interfaces": "^3.8.0-alpha.12",
|
|
50
|
+
"@jupyterlab/services": "^7.0.0-alpha.12",
|
|
51
|
+
"@jupyterlab/settingregistry": "^4.0.0-alpha.12",
|
|
52
|
+
"@jupyterlab/statedb": "^4.0.0-alpha.12",
|
|
53
|
+
"@jupyterlab/statusbar": "^4.0.0-alpha.12",
|
|
54
|
+
"@jupyterlab/translation": "^4.0.0-alpha.12",
|
|
55
|
+
"@jupyterlab/ui-components": "^4.0.0-alpha.27",
|
|
54
56
|
"@lumino/algorithm": "^1.9.1",
|
|
55
|
-
"@lumino/commands": "^1.
|
|
56
|
-
"@lumino/coreutils": "^1.
|
|
57
|
+
"@lumino/commands": "^1.20.0",
|
|
58
|
+
"@lumino/coreutils": "^1.12.0",
|
|
57
59
|
"@lumino/disposable": "^1.10.1",
|
|
58
60
|
"@lumino/domutils": "^1.8.1",
|
|
59
61
|
"@lumino/messaging": "^1.10.1",
|
|
60
62
|
"@lumino/signaling": "^1.10.1",
|
|
61
63
|
"@lumino/virtualdom": "^1.14.1",
|
|
62
|
-
"@lumino/widgets": "^1.
|
|
64
|
+
"@lumino/widgets": "^1.33.0",
|
|
63
65
|
"@types/react": "^17.0.0",
|
|
64
66
|
"react": "^17.0.1",
|
|
65
|
-
"sanitize-html": "~2.5.3"
|
|
66
|
-
"url": "^0.11.0"
|
|
67
|
+
"sanitize-html": "~2.5.3"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@jupyterlab/testutils": "^4.0.0-alpha.
|
|
70
|
+
"@jupyterlab/testutils": "^4.0.0-alpha.12",
|
|
70
71
|
"@types/jest": "^26.0.10",
|
|
71
72
|
"@types/sanitize-html": "^2.3.1",
|
|
72
73
|
"jest": "^26.4.2",
|
|
73
74
|
"rimraf": "~3.0.0",
|
|
74
75
|
"ts-jest": "^26.3.0",
|
|
75
|
-
"typedoc": "~0.
|
|
76
|
-
"typescript": "~4.
|
|
76
|
+
"typedoc": "~0.22.10",
|
|
77
|
+
"typescript": "~4.7.3"
|
|
77
78
|
},
|
|
78
79
|
"publishConfig": {
|
|
79
80
|
"access": "public"
|
package/style/base.css
CHANGED
package/style/commandpalette.css
CHANGED
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
|----------------------------------------------------------------------------*/
|
|
17
17
|
|
|
18
18
|
.lm-CommandPalette {
|
|
19
|
-
padding-bottom:
|
|
19
|
+
padding-bottom: 0;
|
|
20
20
|
color: var(--jp-ui-font-color1);
|
|
21
21
|
background: var(--jp-layout-color1);
|
|
22
|
+
|
|
22
23
|
/* This is needed so that all font sizing of children done in ems is
|
|
23
24
|
* relative to this base size */
|
|
24
25
|
font-size: var(--jp-ui-font-size1);
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
|
|
77
78
|
.lm-CommandPalette-wrapper {
|
|
78
79
|
overflow: overlay;
|
|
79
|
-
padding:
|
|
80
|
+
padding: 0 9px;
|
|
80
81
|
background-color: var(--jp-input-active-background);
|
|
81
82
|
height: 30px;
|
|
82
83
|
box-shadow: inset 0 0 0 var(--jp-border-width) var(--jp-input-border-color);
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
position: absolute;
|
|
94
95
|
top: 4px;
|
|
95
96
|
right: 4px;
|
|
96
|
-
padding: 5px 5px 1px
|
|
97
|
+
padding: 5px 5px 1px;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
.jp-SearchIconGroup svg {
|
|
@@ -128,7 +129,7 @@
|
|
|
128
129
|
|----------------------------------------------------------------------------*/
|
|
129
130
|
|
|
130
131
|
.lm-CommandPalette-header:first-child {
|
|
131
|
-
margin-top:
|
|
132
|
+
margin-top: 0;
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
.lm-CommandPalette-header {
|
|
@@ -179,10 +180,6 @@
|
|
|
179
180
|
fill: var(--jp-layout-color0);
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
.lm-CommandPalette-item.lm-mod-active .lm-CommandPalette-itemLabel > mark {
|
|
183
|
-
color: var(--jp-ui-inverse-font-color0);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
183
|
.lm-CommandPalette-item.lm-mod-active:hover:not(.lm-mod-disabled) {
|
|
187
184
|
color: var(--jp-ui-inverse-font-color1);
|
|
188
185
|
background: var(--jp-brand-color1);
|
|
@@ -230,7 +227,7 @@
|
|
|
230
227
|
background-color: var(--jp-layout-color1);
|
|
231
228
|
}
|
|
232
229
|
|
|
233
|
-
.lm-CommandPalette-content:empty
|
|
230
|
+
.lm-CommandPalette-content:empty::after {
|
|
234
231
|
content: 'No results';
|
|
235
232
|
margin: auto;
|
|
236
233
|
margin-top: 20px;
|
|
@@ -245,6 +242,6 @@
|
|
|
245
242
|
text-align: center;
|
|
246
243
|
margin-top: 24px;
|
|
247
244
|
line-height: 1.32;
|
|
248
|
-
padding:
|
|
245
|
+
padding: 0 8px;
|
|
249
246
|
color: var(--jp-content-font-color3);
|
|
250
247
|
}
|
package/style/dialog.css
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
align-items: center;
|
|
13
13
|
justify-content: center;
|
|
14
|
-
top:
|
|
15
|
-
left:
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
16
|
margin: 0;
|
|
17
17
|
padding: 0;
|
|
18
18
|
width: 100%;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
margin-left: auto;
|
|
27
27
|
margin-right: auto;
|
|
28
28
|
background: var(--jp-layout-color1);
|
|
29
|
-
padding: 24px 24px 12px
|
|
29
|
+
padding: 24px 24px 12px;
|
|
30
30
|
min-width: 300px;
|
|
31
31
|
min-height: 150px;
|
|
32
32
|
max-width: 1000px;
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
box-shadow: var(--jp-elevation-z20);
|
|
36
36
|
word-wrap: break-word;
|
|
37
37
|
border-radius: var(--jp-border-radius);
|
|
38
|
+
|
|
38
39
|
/* This is needed so that all font sizing of children done in ems is
|
|
39
40
|
* relative to this base size */
|
|
40
41
|
font-size: var(--jp-ui-font-size1);
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
button.jp-Dialog-button:focus {
|
|
54
55
|
outline: 1px solid var(--jp-brand-color1);
|
|
55
56
|
outline-offset: 4px;
|
|
56
|
-
-moz-outline-radius:
|
|
57
|
+
-moz-outline-radius: 0;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
button.jp-Dialog-button:focus::-moz-focus-inner {
|
|
@@ -64,7 +65,7 @@ button.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus,
|
|
|
64
65
|
button.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus,
|
|
65
66
|
button.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus {
|
|
66
67
|
outline-offset: 4px;
|
|
67
|
-
-moz-outline-radius:
|
|
68
|
+
-moz-outline-radius: 0;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
button.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus {
|
|
@@ -126,7 +127,7 @@ button.jp-Dialog-close-button {
|
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
.jp-Dialog-body > button {
|
|
129
|
-
padding:
|
|
130
|
+
padding: 0 16px;
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
.jp-Dialog-body > label {
|
package/style/index.css
CHANGED
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
|
|
7
7
|
@import url('~@lumino/widgets/style/index.css');
|
|
8
8
|
@import url('~@jupyterlab/ui-components/style/index.css');
|
|
9
|
+
@import url('~@jupyterlab/statusbar/style/index.css');
|
|
9
10
|
|
|
10
11
|
@import url('./base.css');
|
package/style/index.js
CHANGED
package/style/inputdialog.css
CHANGED
package/style/materialcolors.css
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Jupyter Development Team.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* google-material-color v1.2.6
|
|
3
8
|
* https://github.com/danlevan/google-material-color
|
|
@@ -17,7 +22,6 @@
|
|
|
17
22
|
--md-red-A200: #ff5252;
|
|
18
23
|
--md-red-A400: #ff1744;
|
|
19
24
|
--md-red-A700: #d50000;
|
|
20
|
-
|
|
21
25
|
--md-pink-50: #fce4ec;
|
|
22
26
|
--md-pink-100: #f8bbd0;
|
|
23
27
|
--md-pink-200: #f48fb1;
|
|
@@ -32,7 +36,6 @@
|
|
|
32
36
|
--md-pink-A200: #ff4081;
|
|
33
37
|
--md-pink-A400: #f50057;
|
|
34
38
|
--md-pink-A700: #c51162;
|
|
35
|
-
|
|
36
39
|
--md-purple-50: #f3e5f5;
|
|
37
40
|
--md-purple-100: #e1bee7;
|
|
38
41
|
--md-purple-200: #ce93d8;
|
|
@@ -46,8 +49,7 @@
|
|
|
46
49
|
--md-purple-A100: #ea80fc;
|
|
47
50
|
--md-purple-A200: #e040fb;
|
|
48
51
|
--md-purple-A400: #d500f9;
|
|
49
|
-
--md-purple-A700: #
|
|
50
|
-
|
|
52
|
+
--md-purple-A700: #a0f;
|
|
51
53
|
--md-deep-purple-50: #ede7f6;
|
|
52
54
|
--md-deep-purple-100: #d1c4e9;
|
|
53
55
|
--md-deep-purple-200: #b39ddb;
|
|
@@ -62,7 +64,6 @@
|
|
|
62
64
|
--md-deep-purple-A200: #7c4dff;
|
|
63
65
|
--md-deep-purple-A400: #651fff;
|
|
64
66
|
--md-deep-purple-A700: #6200ea;
|
|
65
|
-
|
|
66
67
|
--md-indigo-50: #e8eaf6;
|
|
67
68
|
--md-indigo-100: #c5cae9;
|
|
68
69
|
--md-indigo-200: #9fa8da;
|
|
@@ -77,7 +78,6 @@
|
|
|
77
78
|
--md-indigo-A200: #536dfe;
|
|
78
79
|
--md-indigo-A400: #3d5afe;
|
|
79
80
|
--md-indigo-A700: #304ffe;
|
|
80
|
-
|
|
81
81
|
--md-blue-50: #e3f2fd;
|
|
82
82
|
--md-blue-100: #bbdefb;
|
|
83
83
|
--md-blue-200: #90caf9;
|
|
@@ -92,7 +92,6 @@
|
|
|
92
92
|
--md-blue-A200: #448aff;
|
|
93
93
|
--md-blue-A400: #2979ff;
|
|
94
94
|
--md-blue-A700: #2962ff;
|
|
95
|
-
|
|
96
95
|
--md-light-blue-50: #e1f5fe;
|
|
97
96
|
--md-light-blue-100: #b3e5fc;
|
|
98
97
|
--md-light-blue-200: #81d4fa;
|
|
@@ -107,7 +106,6 @@
|
|
|
107
106
|
--md-light-blue-A200: #40c4ff;
|
|
108
107
|
--md-light-blue-A400: #00b0ff;
|
|
109
108
|
--md-light-blue-A700: #0091ea;
|
|
110
|
-
|
|
111
109
|
--md-cyan-50: #e0f7fa;
|
|
112
110
|
--md-cyan-100: #b2ebf2;
|
|
113
111
|
--md-cyan-200: #80deea;
|
|
@@ -122,7 +120,6 @@
|
|
|
122
120
|
--md-cyan-A200: #18ffff;
|
|
123
121
|
--md-cyan-A400: #00e5ff;
|
|
124
122
|
--md-cyan-A700: #00b8d4;
|
|
125
|
-
|
|
126
123
|
--md-teal-50: #e0f2f1;
|
|
127
124
|
--md-teal-100: #b2dfdb;
|
|
128
125
|
--md-teal-200: #80cbc4;
|
|
@@ -137,7 +134,6 @@
|
|
|
137
134
|
--md-teal-A200: #64ffda;
|
|
138
135
|
--md-teal-A400: #1de9b6;
|
|
139
136
|
--md-teal-A700: #00bfa5;
|
|
140
|
-
|
|
141
137
|
--md-green-50: #e8f5e9;
|
|
142
138
|
--md-green-100: #c8e6c9;
|
|
143
139
|
--md-green-200: #a5d6a7;
|
|
@@ -152,7 +148,6 @@
|
|
|
152
148
|
--md-green-A200: #69f0ae;
|
|
153
149
|
--md-green-A400: #00e676;
|
|
154
150
|
--md-green-A700: #00c853;
|
|
155
|
-
|
|
156
151
|
--md-light-green-50: #f1f8e9;
|
|
157
152
|
--md-light-green-100: #dcedc8;
|
|
158
153
|
--md-light-green-200: #c5e1a5;
|
|
@@ -167,7 +162,6 @@
|
|
|
167
162
|
--md-light-green-A200: #b2ff59;
|
|
168
163
|
--md-light-green-A400: #76ff03;
|
|
169
164
|
--md-light-green-A700: #64dd17;
|
|
170
|
-
|
|
171
165
|
--md-lime-50: #f9fbe7;
|
|
172
166
|
--md-lime-100: #f0f4c3;
|
|
173
167
|
--md-lime-200: #e6ee9c;
|
|
@@ -182,7 +176,6 @@
|
|
|
182
176
|
--md-lime-A200: #eeff41;
|
|
183
177
|
--md-lime-A400: #c6ff00;
|
|
184
178
|
--md-lime-A700: #aeea00;
|
|
185
|
-
|
|
186
179
|
--md-yellow-50: #fffde7;
|
|
187
180
|
--md-yellow-100: #fff9c4;
|
|
188
181
|
--md-yellow-200: #fff59d;
|
|
@@ -194,10 +187,9 @@
|
|
|
194
187
|
--md-yellow-800: #f9a825;
|
|
195
188
|
--md-yellow-900: #f57f17;
|
|
196
189
|
--md-yellow-A100: #ffff8d;
|
|
197
|
-
--md-yellow-A200: #
|
|
190
|
+
--md-yellow-A200: #ff0;
|
|
198
191
|
--md-yellow-A400: #ffea00;
|
|
199
192
|
--md-yellow-A700: #ffd600;
|
|
200
|
-
|
|
201
193
|
--md-amber-50: #fff8e1;
|
|
202
194
|
--md-amber-100: #ffecb3;
|
|
203
195
|
--md-amber-200: #ffe082;
|
|
@@ -212,7 +204,6 @@
|
|
|
212
204
|
--md-amber-A200: #ffd740;
|
|
213
205
|
--md-amber-A400: #ffc400;
|
|
214
206
|
--md-amber-A700: #ffab00;
|
|
215
|
-
|
|
216
207
|
--md-orange-50: #fff3e0;
|
|
217
208
|
--md-orange-100: #ffe0b2;
|
|
218
209
|
--md-orange-200: #ffcc80;
|
|
@@ -227,7 +218,6 @@
|
|
|
227
218
|
--md-orange-A200: #ffab40;
|
|
228
219
|
--md-orange-A400: #ff9100;
|
|
229
220
|
--md-orange-A700: #ff6d00;
|
|
230
|
-
|
|
231
221
|
--md-deep-orange-50: #fbe9e7;
|
|
232
222
|
--md-deep-orange-100: #ffccbc;
|
|
233
223
|
--md-deep-orange-200: #ffab91;
|
|
@@ -242,7 +232,6 @@
|
|
|
242
232
|
--md-deep-orange-A200: #ff6e40;
|
|
243
233
|
--md-deep-orange-A400: #ff3d00;
|
|
244
234
|
--md-deep-orange-A700: #dd2c00;
|
|
245
|
-
|
|
246
235
|
--md-brown-50: #efebe9;
|
|
247
236
|
--md-brown-100: #d7ccc8;
|
|
248
237
|
--md-brown-200: #bcaaa4;
|
|
@@ -253,10 +242,9 @@
|
|
|
253
242
|
--md-brown-700: #5d4037;
|
|
254
243
|
--md-brown-800: #4e342e;
|
|
255
244
|
--md-brown-900: #3e2723;
|
|
256
|
-
|
|
257
245
|
--md-grey-50: #fafafa;
|
|
258
246
|
--md-grey-100: #f5f5f5;
|
|
259
|
-
--md-grey-200: #
|
|
247
|
+
--md-grey-200: #eee;
|
|
260
248
|
--md-grey-300: #e0e0e0;
|
|
261
249
|
--md-grey-400: #bdbdbd;
|
|
262
250
|
--md-grey-500: #9e9e9e;
|
|
@@ -264,7 +252,6 @@
|
|
|
264
252
|
--md-grey-700: #616161;
|
|
265
253
|
--md-grey-800: #424242;
|
|
266
254
|
--md-grey-900: #212121;
|
|
267
|
-
|
|
268
255
|
--md-blue-grey-50: #eceff1;
|
|
269
256
|
--md-blue-grey-100: #cfd8dc;
|
|
270
257
|
--md-blue-grey-200: #b0bec5;
|
package/lib/hoverbox.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A namespace for `HoverBox` members.
|
|
3
|
-
*/
|
|
4
|
-
export declare namespace HoverBox {
|
|
5
|
-
/**
|
|
6
|
-
* Options for setting the geometry of a hovering node and its anchor node.
|
|
7
|
-
*/
|
|
8
|
-
interface IOptions {
|
|
9
|
-
/**
|
|
10
|
-
* The referent anchor rectangle to which the hover box is bound.
|
|
11
|
-
*
|
|
12
|
-
* #### Notes
|
|
13
|
-
* In an editor context, this value will typically be the cursor's
|
|
14
|
-
* coordinate position, which can be retrieved via calling the
|
|
15
|
-
* `getCoordinateForPosition` method.
|
|
16
|
-
*/
|
|
17
|
-
anchor: ClientRect;
|
|
18
|
-
/**
|
|
19
|
-
* The node that hosts the anchor.
|
|
20
|
-
*
|
|
21
|
-
* #### Notes
|
|
22
|
-
* The visibility of the anchor rectangle within this host node is the
|
|
23
|
-
* heuristic that determines whether the hover box ought to be visible.
|
|
24
|
-
*/
|
|
25
|
-
host: HTMLElement;
|
|
26
|
-
/**
|
|
27
|
-
* The maximum height of a hover box.
|
|
28
|
-
*
|
|
29
|
-
* #### Notes
|
|
30
|
-
* This value is only used if a CSS max-height attribute is not set for the
|
|
31
|
-
* hover box. It is a fallback value.
|
|
32
|
-
*/
|
|
33
|
-
maxHeight: number;
|
|
34
|
-
/**
|
|
35
|
-
* The minimum height of a hover box.
|
|
36
|
-
*/
|
|
37
|
-
minHeight: number;
|
|
38
|
-
/**
|
|
39
|
-
* The hover box node.
|
|
40
|
-
*/
|
|
41
|
-
node: HTMLElement;
|
|
42
|
-
/**
|
|
43
|
-
* Optional pixel offset values added to where the hover box should render.
|
|
44
|
-
*
|
|
45
|
-
* #### Notes
|
|
46
|
-
* This option is useful for passing in values that may pertain to CSS
|
|
47
|
-
* borders or padding in cases where the text inside the hover box may need
|
|
48
|
-
* to align with the text of the referent editor.
|
|
49
|
-
*
|
|
50
|
-
* Because the hover box calculation may render a box either above or below
|
|
51
|
-
* the cursor, the `vertical` offset accepts `above` and `below` values for
|
|
52
|
-
* the different render modes.
|
|
53
|
-
*/
|
|
54
|
-
offset?: {
|
|
55
|
-
horizontal?: number;
|
|
56
|
-
vertical?: {
|
|
57
|
-
above?: number;
|
|
58
|
-
below?: number;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* If space is available both above and below the anchor, denote which
|
|
63
|
-
* location is privileged. Use forceBelow and forceAbove to mandate where
|
|
64
|
-
* hover box should render relative to anchor.
|
|
65
|
-
*
|
|
66
|
-
* #### Notes
|
|
67
|
-
* The default value is `'below'`.
|
|
68
|
-
*/
|
|
69
|
-
privilege?: 'above' | 'below' | 'forceAbove' | 'forceBelow';
|
|
70
|
-
/**
|
|
71
|
-
* If the style of the node has already been computed, it can be passed into
|
|
72
|
-
* the hover box for geometry calculation.
|
|
73
|
-
*/
|
|
74
|
-
style?: CSSStyleDeclaration;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Set the visible dimensions of a hovering box anchored to an editor cursor.
|
|
78
|
-
*
|
|
79
|
-
* @param options - The hover box geometry calculation options.
|
|
80
|
-
*/
|
|
81
|
-
function setGeometry(options: IOptions): void;
|
|
82
|
-
}
|
package/lib/hoverbox.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Jupyter Development Team.
|
|
2
|
-
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
/**
|
|
4
|
-
* The class name added to all hover boxes.
|
|
5
|
-
*/
|
|
6
|
-
const HOVERBOX_CLASS = 'jp-HoverBox';
|
|
7
|
-
/**
|
|
8
|
-
* The class name added to a hovering node that is scrolled out of view.
|
|
9
|
-
*/
|
|
10
|
-
const OUTOFVIEW_CLASS = 'jp-mod-outofview';
|
|
11
|
-
/**
|
|
12
|
-
* A namespace for `HoverBox` members.
|
|
13
|
-
*/
|
|
14
|
-
export var HoverBox;
|
|
15
|
-
(function (HoverBox) {
|
|
16
|
-
/**
|
|
17
|
-
* Set the visible dimensions of a hovering box anchored to an editor cursor.
|
|
18
|
-
*
|
|
19
|
-
* @param options - The hover box geometry calculation options.
|
|
20
|
-
*/
|
|
21
|
-
function setGeometry(options) {
|
|
22
|
-
const { anchor, host, node, privilege } = options;
|
|
23
|
-
// Add hover box class if it does not exist.
|
|
24
|
-
node.classList.add(HOVERBOX_CLASS);
|
|
25
|
-
// Hide the hover box before querying the DOM for the anchor coordinates.
|
|
26
|
-
node.classList.add(OUTOFVIEW_CLASS);
|
|
27
|
-
// If the current coordinates are not visible, bail.
|
|
28
|
-
if (!host.contains(document.elementFromPoint(anchor.left, anchor.top))) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
// Clear any previously set max-height.
|
|
32
|
-
node.style.maxHeight = '';
|
|
33
|
-
// Clear any programmatically set margin-top.
|
|
34
|
-
node.style.marginTop = '';
|
|
35
|
-
// Make sure the node is visible so that its dimensions can be queried.
|
|
36
|
-
node.classList.remove(OUTOFVIEW_CLASS);
|
|
37
|
-
const style = options.style || window.getComputedStyle(node);
|
|
38
|
-
const innerHeight = window.innerHeight;
|
|
39
|
-
const spaceAbove = anchor.top;
|
|
40
|
-
const spaceBelow = innerHeight - anchor.bottom;
|
|
41
|
-
const marginTop = parseInt(style.marginTop, 10) || 0;
|
|
42
|
-
const minHeight = parseInt(style.minHeight, 10) || options.minHeight;
|
|
43
|
-
let maxHeight = parseInt(style.maxHeight, 10) || options.maxHeight;
|
|
44
|
-
// Determine whether to render above or below; check privilege.
|
|
45
|
-
const renderBelow = privilege === 'forceAbove'
|
|
46
|
-
? false
|
|
47
|
-
: privilege === 'forceBelow'
|
|
48
|
-
? true
|
|
49
|
-
: privilege === 'above'
|
|
50
|
-
? spaceAbove < maxHeight && spaceAbove < spaceBelow
|
|
51
|
-
: spaceBelow >= maxHeight || spaceBelow >= spaceAbove;
|
|
52
|
-
if (renderBelow) {
|
|
53
|
-
maxHeight = Math.min(spaceBelow - marginTop, maxHeight);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
maxHeight = Math.min(spaceAbove, maxHeight);
|
|
57
|
-
// If the box renders above the text, its top margin is irrelevant.
|
|
58
|
-
node.style.marginTop = '0px';
|
|
59
|
-
}
|
|
60
|
-
node.style.maxHeight = `${maxHeight}px`;
|
|
61
|
-
// Make sure the box ought to be visible.
|
|
62
|
-
const withinBounds = maxHeight > minHeight &&
|
|
63
|
-
(spaceBelow >= minHeight || spaceAbove >= minHeight);
|
|
64
|
-
if (!withinBounds) {
|
|
65
|
-
node.classList.add(OUTOFVIEW_CLASS);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
// Position the box vertically.
|
|
69
|
-
const offsetAbove = (options.offset &&
|
|
70
|
-
options.offset.vertical &&
|
|
71
|
-
options.offset.vertical.above) ||
|
|
72
|
-
0;
|
|
73
|
-
const offsetBelow = (options.offset &&
|
|
74
|
-
options.offset.vertical &&
|
|
75
|
-
options.offset.vertical.below) ||
|
|
76
|
-
0;
|
|
77
|
-
const top = renderBelow
|
|
78
|
-
? innerHeight - spaceBelow + offsetBelow
|
|
79
|
-
: spaceAbove - node.getBoundingClientRect().height + offsetAbove;
|
|
80
|
-
node.style.top = `${Math.floor(top)}px`;
|
|
81
|
-
// Position the box horizontally.
|
|
82
|
-
const offsetHorizontal = (options.offset && options.offset.horizontal) || 0;
|
|
83
|
-
let left = anchor.left + offsetHorizontal;
|
|
84
|
-
node.style.left = `${Math.ceil(left)}px`;
|
|
85
|
-
node.style.width = 'auto';
|
|
86
|
-
// Expand the menu width by the scrollbar size, if present.
|
|
87
|
-
if (node.scrollHeight >= maxHeight) {
|
|
88
|
-
node.style.width = `${2 * node.offsetWidth - node.clientWidth}`;
|
|
89
|
-
node.scrollTop = 0;
|
|
90
|
-
}
|
|
91
|
-
// Move left to fit in the window.
|
|
92
|
-
const right = node.getBoundingClientRect().right;
|
|
93
|
-
if (right > window.innerWidth) {
|
|
94
|
-
left -= right - window.innerWidth;
|
|
95
|
-
node.style.left = `${Math.ceil(left)}px`;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
HoverBox.setGeometry = setGeometry;
|
|
99
|
-
})(HoverBox || (HoverBox = {}));
|
|
100
|
-
//# sourceMappingURL=hoverbox.js.map
|
package/lib/hoverbox.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hoverbox.js","sourceRoot":"","sources":["../src/hoverbox.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D;;GAEG;AACH,MAAM,cAAc,GAAG,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C;;GAEG;AACH,MAAM,KAAW,QAAQ,CAmLxB;AAnLD,WAAiB,QAAQ;IA6EvB;;;;OAIG;IACH,SAAgB,WAAW,CAAC,OAAiB;QAC3C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;QAElD,4CAA4C;QAC5C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAEnC,yEAAyE;QACzE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAEpC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AAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC5E,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAE1C,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QACzC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC;QAE1B,2DAA2D;QAC3D,IAAI,IAAI,CAAC,YAAY,IAAI,SAAS,EAAE;YAClC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YAChE,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;SACpB;QAED,kCAAkC;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;QACjD,IAAI,KAAK,GAAG,MAAM,CAAC,UAAU,EAAE;YAC7B,IAAI,IAAI,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;YAClC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;SAC1C;IACH,CAAC;IAhGe,oBAAW,cAgG1B,CAAA;AACH,CAAC,EAnLgB,QAAQ,KAAR,QAAQ,QAmLxB"}
|
package/style/hoverbox.css
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*-----------------------------------------------------------------------------
|
|
2
|
-
| Copyright (c) 2014-2016, Jupyter Development Team.
|
|
3
|
-
|
|
|
4
|
-
| Distributed under the terms of the Modified BSD License.
|
|
5
|
-
|----------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
.jp-HoverBox {
|
|
8
|
-
position: fixed;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.jp-HoverBox.jp-mod-outofview {
|
|
12
|
-
display: none;
|
|
13
|
-
}
|