jupyterlab_commands_extension 1.1.1 → 1.1.3
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 +2 -0
- package/lib/widget.js +2 -1
- package/package.json +1 -1
- package/src/widget.ts +2 -1
- package/style/base.css +127 -18
package/README.md
CHANGED
|
@@ -65,6 +65,8 @@ Exit codes: 0 success, 2 discovery or usage error, 3 no browser client, 4 comman
|
|
|
65
65
|
|
|
66
66
|
The browser tab is the executor: the command runs in the lab, not in the terminal.
|
|
67
67
|
|
|
68
|
+
Every execute request reaches the JupyterLab server log: the outcome, the command ID, the arguments as compact JSON truncated to 500 characters, the elapsed milliseconds and the caller's remote IP, at INFO on success and WARNING on refusal or failure.
|
|
69
|
+
|
|
68
70
|
## Allowlist
|
|
69
71
|
|
|
70
72
|
The `allowedCommands` setting holds the command IDs the CLI may run. The defaults are `docmanager:open`, `help:open`, `apputils:notify`, `notebook:create-new`, `console:create`, `terminal:create-new`, `launcher:create`, `jupyterlab-commands-reference:open` and `file:download`.
|
package/lib/widget.js
CHANGED
|
@@ -47,7 +47,8 @@ export class CommandsReferenceWidget extends Widget {
|
|
|
47
47
|
this._searchInput = document.createElement('input');
|
|
48
48
|
this._searchInput.type = 'text';
|
|
49
49
|
this._searchInput.placeholder = 'Filter commands...';
|
|
50
|
-
this._searchInput.className =
|
|
50
|
+
this._searchInput.className =
|
|
51
|
+
'jp-CommandsReferenceWidget-search jp-mod-styled';
|
|
51
52
|
this._searchInput.addEventListener('input', () => {
|
|
52
53
|
this._filterCommands();
|
|
53
54
|
});
|
package/package.json
CHANGED
package/src/widget.ts
CHANGED
|
@@ -69,7 +69,8 @@ export class CommandsReferenceWidget extends Widget {
|
|
|
69
69
|
this._searchInput = document.createElement('input');
|
|
70
70
|
this._searchInput.type = 'text';
|
|
71
71
|
this._searchInput.placeholder = 'Filter commands...';
|
|
72
|
-
this._searchInput.className =
|
|
72
|
+
this._searchInput.className =
|
|
73
|
+
'jp-CommandsReferenceWidget-search jp-mod-styled';
|
|
73
74
|
this._searchInput.addEventListener('input', () => {
|
|
74
75
|
this._filterCommands();
|
|
75
76
|
});
|
package/style/base.css
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
12
12
|
overflow: hidden;
|
|
13
|
+
container-type: inline-size;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/* Header with search and count */
|
|
@@ -23,23 +24,28 @@
|
|
|
23
24
|
flex-shrink: 0;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
/*
|
|
27
|
-
.jp-
|
|
27
|
+
/*
|
|
28
|
+
* Search input. jp-mod-styled supplies the same properties at a higher
|
|
29
|
+
* specificity, so each rule repeats the class after it.
|
|
30
|
+
*/
|
|
31
|
+
input.jp-mod-styled.jp-CommandsReferenceWidget-search {
|
|
28
32
|
flex: 1;
|
|
29
|
-
|
|
33
|
+
height: 24px;
|
|
34
|
+
padding: 0 9px;
|
|
30
35
|
border: 1px solid var(--jp-border-color1);
|
|
31
|
-
border-radius:
|
|
36
|
+
border-radius: 2px;
|
|
32
37
|
background: var(--jp-layout-color0);
|
|
33
38
|
color: var(--jp-ui-font-color1);
|
|
34
39
|
font-size: var(--jp-ui-font-size1);
|
|
35
40
|
outline: none;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
.jp-CommandsReferenceWidget-search:focus {
|
|
43
|
+
input.jp-mod-styled.jp-CommandsReferenceWidget-search:focus {
|
|
39
44
|
border-color: var(--jp-brand-color1);
|
|
45
|
+
box-shadow: none;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
.jp-CommandsReferenceWidget-search::placeholder {
|
|
48
|
+
input.jp-mod-styled.jp-CommandsReferenceWidget-search::placeholder {
|
|
43
49
|
color: var(--jp-ui-font-color3);
|
|
44
50
|
}
|
|
45
51
|
|
|
@@ -60,6 +66,7 @@
|
|
|
60
66
|
/* Commands table */
|
|
61
67
|
.jp-CommandsReferenceWidget-table {
|
|
62
68
|
width: 100%;
|
|
69
|
+
table-layout: fixed;
|
|
63
70
|
border-collapse: collapse;
|
|
64
71
|
font-size: var(--jp-ui-font-size1);
|
|
65
72
|
}
|
|
@@ -73,21 +80,29 @@
|
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
.jp-CommandsReferenceWidget-table th {
|
|
76
|
-
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
padding: 6px 12px;
|
|
85
|
+
overflow: hidden;
|
|
77
86
|
text-align: left;
|
|
78
|
-
|
|
79
|
-
color: var(--jp-ui-font-color1);
|
|
80
|
-
border-bottom: 2px solid var(--jp-border-color1);
|
|
87
|
+
text-overflow: ellipsis;
|
|
81
88
|
white-space: nowrap;
|
|
89
|
+
font-size: 10px;
|
|
90
|
+
font-weight: 600;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
letter-spacing: 0.08em;
|
|
93
|
+
text-transform: uppercase;
|
|
94
|
+
color: var(--jp-ui-font-color3);
|
|
95
|
+
border-bottom: 1px solid var(--jp-border-color2);
|
|
82
96
|
}
|
|
83
97
|
|
|
84
98
|
/* Table cells */
|
|
85
99
|
.jp-CommandsReferenceWidget-table td {
|
|
100
|
+
box-sizing: border-box;
|
|
86
101
|
padding: 6px 12px;
|
|
87
102
|
border-bottom: 1px solid var(--jp-border-color2);
|
|
88
103
|
color: var(--jp-ui-font-color1);
|
|
89
104
|
vertical-align: top;
|
|
90
|
-
|
|
105
|
+
white-space: nowrap;
|
|
91
106
|
overflow: hidden;
|
|
92
107
|
text-overflow: ellipsis;
|
|
93
108
|
}
|
|
@@ -101,6 +116,43 @@
|
|
|
101
116
|
white-space: nowrap;
|
|
102
117
|
}
|
|
103
118
|
|
|
119
|
+
/* Command executor cell - the row action sits at the right edge */
|
|
120
|
+
.jp-CommandsReferenceWidget-executor {
|
|
121
|
+
text-align: right;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* In-row action button */
|
|
125
|
+
.jp-CommandsReferenceWidget-add {
|
|
126
|
+
display: inline-block;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
max-width: 100%;
|
|
129
|
+
height: 20px;
|
|
130
|
+
padding: 0 8px;
|
|
131
|
+
overflow: hidden;
|
|
132
|
+
border: 1px solid transparent;
|
|
133
|
+
border-radius: 2px;
|
|
134
|
+
background: transparent;
|
|
135
|
+
color: var(--jp-ui-font-color2);
|
|
136
|
+
font-family: inherit;
|
|
137
|
+
font-size: var(--jp-ui-font-size0);
|
|
138
|
+
line-height: 18px;
|
|
139
|
+
text-overflow: ellipsis;
|
|
140
|
+
white-space: nowrap;
|
|
141
|
+
vertical-align: top;
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Added state, and no settings to add to */
|
|
146
|
+
.jp-CommandsReferenceWidget-add:disabled {
|
|
147
|
+
opacity: 0.45;
|
|
148
|
+
cursor: default;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.jp-CommandsReferenceWidget-add:enabled:hover {
|
|
152
|
+
background: var(--jp-layout-color2);
|
|
153
|
+
color: var(--jp-ui-font-color1);
|
|
154
|
+
}
|
|
155
|
+
|
|
104
156
|
/* Alternating row colors */
|
|
105
157
|
.jp-CommandsReferenceWidget-table tbody tr:nth-child(even) {
|
|
106
158
|
background: var(--jp-layout-color1);
|
|
@@ -115,27 +167,84 @@
|
|
|
115
167
|
background: var(--jp-layout-color2);
|
|
116
168
|
}
|
|
117
169
|
|
|
118
|
-
/* Column widths */
|
|
170
|
+
/* Column widths - five shares summing to 100% under the fixed layout */
|
|
119
171
|
.jp-CommandsReferenceWidget-table th:nth-child(1),
|
|
120
172
|
.jp-CommandsReferenceWidget-table td:nth-child(1) {
|
|
121
|
-
width:
|
|
122
|
-
min-width: 200px;
|
|
173
|
+
width: 25%;
|
|
123
174
|
}
|
|
124
175
|
|
|
125
176
|
.jp-CommandsReferenceWidget-table th:nth-child(2),
|
|
126
177
|
.jp-CommandsReferenceWidget-table td:nth-child(2) {
|
|
127
|
-
width:
|
|
178
|
+
width: 17%;
|
|
128
179
|
}
|
|
129
180
|
|
|
130
181
|
.jp-CommandsReferenceWidget-table th:nth-child(3),
|
|
131
182
|
.jp-CommandsReferenceWidget-table td:nth-child(3) {
|
|
132
|
-
width:
|
|
183
|
+
width: 26%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.jp-CommandsReferenceWidget-table th:nth-child(4) {
|
|
187
|
+
width: 17%;
|
|
133
188
|
}
|
|
134
189
|
|
|
135
|
-
.jp-CommandsReferenceWidget-table th:nth-child(4),
|
|
136
190
|
.jp-CommandsReferenceWidget-table td:nth-child(4) {
|
|
137
|
-
width:
|
|
191
|
+
width: 17%;
|
|
138
192
|
font-family: var(--jp-code-font-family);
|
|
139
193
|
font-size: var(--jp-code-font-size);
|
|
140
194
|
color: var(--jp-ui-font-color2);
|
|
141
195
|
}
|
|
196
|
+
|
|
197
|
+
.jp-CommandsReferenceWidget-table th:nth-child(5),
|
|
198
|
+
.jp-CommandsReferenceWidget-table td:nth-child(5) {
|
|
199
|
+
width: 15%;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* Adaptive columns - keyed to the panel width, not the viewport. Narrower blocks come later so they win. */
|
|
203
|
+
@container (max-width: 1099px) {
|
|
204
|
+
.jp-CommandsReferenceWidget-table th:nth-child(3),
|
|
205
|
+
.jp-CommandsReferenceWidget-table td:nth-child(3) {
|
|
206
|
+
display: none;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.jp-CommandsReferenceWidget-table th:nth-child(1),
|
|
210
|
+
.jp-CommandsReferenceWidget-table td:nth-child(1) {
|
|
211
|
+
width: 29%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.jp-CommandsReferenceWidget-table th:nth-child(2),
|
|
215
|
+
.jp-CommandsReferenceWidget-table td:nth-child(2) {
|
|
216
|
+
width: 21%;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.jp-CommandsReferenceWidget-table th:nth-child(4),
|
|
220
|
+
.jp-CommandsReferenceWidget-table td:nth-child(4) {
|
|
221
|
+
width: 32%;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.jp-CommandsReferenceWidget-table th:nth-child(5),
|
|
225
|
+
.jp-CommandsReferenceWidget-table td:nth-child(5) {
|
|
226
|
+
width: 18%;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@container (max-width: 899px) {
|
|
231
|
+
.jp-CommandsReferenceWidget-table th:nth-child(4),
|
|
232
|
+
.jp-CommandsReferenceWidget-table td:nth-child(4) {
|
|
233
|
+
display: none;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.jp-CommandsReferenceWidget-table th:nth-child(1),
|
|
237
|
+
.jp-CommandsReferenceWidget-table td:nth-child(1) {
|
|
238
|
+
width: 47%;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.jp-CommandsReferenceWidget-table th:nth-child(2),
|
|
242
|
+
.jp-CommandsReferenceWidget-table td:nth-child(2) {
|
|
243
|
+
width: 32%;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.jp-CommandsReferenceWidget-table th:nth-child(5),
|
|
247
|
+
.jp-CommandsReferenceWidget-table td:nth-child(5) {
|
|
248
|
+
width: 21%;
|
|
249
|
+
}
|
|
250
|
+
}
|