@jupyter-notebook/application 7.6.0-alpha.0 → 7.6.0-alpha.2
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/panelhandler.js +10 -14
- package/lib/shell.d.ts +19 -0
- package/lib/shell.js +61 -0
- package/package.json +6 -6
package/lib/panelhandler.js
CHANGED
|
@@ -141,22 +141,18 @@ export class SidePanelHandler extends PanelHandler {
|
|
|
141
141
|
* if there is no most recently used.
|
|
142
142
|
*/
|
|
143
143
|
expand(id) {
|
|
144
|
+
if (this._currentWidget) {
|
|
145
|
+
this.collapse();
|
|
146
|
+
}
|
|
144
147
|
if (id) {
|
|
145
|
-
|
|
146
|
-
this.collapse();
|
|
147
|
-
this.hide();
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
this.collapse();
|
|
151
|
-
this.hide();
|
|
152
|
-
this.activate(id);
|
|
153
|
-
this.show();
|
|
154
|
-
}
|
|
148
|
+
this.activate(id);
|
|
155
149
|
}
|
|
156
|
-
else
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
150
|
+
else {
|
|
151
|
+
const visibleWidget = this.currentWidget;
|
|
152
|
+
if (visibleWidget) {
|
|
153
|
+
this._currentWidget = visibleWidget;
|
|
154
|
+
this.activate(visibleWidget.id);
|
|
155
|
+
}
|
|
160
156
|
}
|
|
161
157
|
}
|
|
162
158
|
/**
|
package/lib/shell.d.ts
CHANGED
|
@@ -111,6 +111,25 @@ export declare class NotebookShell extends Widget implements JupyterFrontEnd.ISh
|
|
|
111
111
|
*
|
|
112
112
|
*/
|
|
113
113
|
add(widget: Widget, area?: INotebookShell.Area, options?: DocumentRegistry.IOpenOptions): void;
|
|
114
|
+
/**
|
|
115
|
+
* Return a boolean whether the side panel is visible.
|
|
116
|
+
*/
|
|
117
|
+
isSidePanelVisible(area: string): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Get the area of a widget, given its id.
|
|
120
|
+
*
|
|
121
|
+
* @param id - the widget id
|
|
122
|
+
* @returns the area where the widget belongs, or null.
|
|
123
|
+
*/
|
|
124
|
+
getWidgetArea(id: string): string | null;
|
|
125
|
+
/**
|
|
126
|
+
* Expand an area.
|
|
127
|
+
*/
|
|
128
|
+
expand(area: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Collapse an area.
|
|
131
|
+
*/
|
|
132
|
+
collapse(area: string): void;
|
|
114
133
|
/**
|
|
115
134
|
* Collapse the top area and the spacer to make the view more compact.
|
|
116
135
|
*/
|
package/lib/shell.js
CHANGED
|
@@ -273,6 +273,67 @@ export class NotebookShell extends Widget {
|
|
|
273
273
|
console.warn(`Cannot add widget to area: ${area}`);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Return a boolean whether the side panel is visible.
|
|
278
|
+
*/
|
|
279
|
+
isSidePanelVisible(area) {
|
|
280
|
+
if (area === 'left') {
|
|
281
|
+
return this._leftHandler.isVisible;
|
|
282
|
+
}
|
|
283
|
+
else if (area === 'right') {
|
|
284
|
+
return this._rightHandler.isVisible;
|
|
285
|
+
}
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Get the area of a widget, given its id.
|
|
290
|
+
*
|
|
291
|
+
* @param id - the widget id
|
|
292
|
+
* @returns the area where the widget belongs, or null.
|
|
293
|
+
*/
|
|
294
|
+
getWidgetArea(id) {
|
|
295
|
+
for (const area of ['main', 'top', 'left', 'right', 'menu', 'down']) {
|
|
296
|
+
const widget = find(this.widgets(area), (w) => w.id === id);
|
|
297
|
+
if (widget) {
|
|
298
|
+
return area;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Expand an area.
|
|
305
|
+
*/
|
|
306
|
+
expand(area) {
|
|
307
|
+
if (!['top', 'left', 'right'].includes(area)) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (area === 'top') {
|
|
311
|
+
this.expandTop();
|
|
312
|
+
}
|
|
313
|
+
else if (area === 'left') {
|
|
314
|
+
this.expandLeft();
|
|
315
|
+
}
|
|
316
|
+
else if (area === 'right') {
|
|
317
|
+
this.expandRight();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Collapse an area.
|
|
322
|
+
*/
|
|
323
|
+
collapse(area) {
|
|
324
|
+
if (!['top', 'left', 'right'].includes(area)) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (area === 'top') {
|
|
328
|
+
this.collapseTop();
|
|
329
|
+
}
|
|
330
|
+
else if (area === 'left') {
|
|
331
|
+
this.collapseLeft();
|
|
332
|
+
}
|
|
333
|
+
else if (area === 'right') {
|
|
334
|
+
this.collapseRight();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
276
337
|
/**
|
|
277
338
|
* Collapse the top area and the spacer to make the view more compact.
|
|
278
339
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/application",
|
|
3
|
-
"version": "7.6.0-alpha.
|
|
3
|
+
"version": "7.6.0-alpha.2",
|
|
4
4
|
"description": "Jupyter Notebook - Application",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"watch": "tsc -b --watch"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@jupyterlab/application": "~4.6.0-alpha.
|
|
46
|
-
"@jupyterlab/coreutils": "~6.6.0-alpha.
|
|
47
|
-
"@jupyterlab/docregistry": "~4.6.0-alpha.
|
|
48
|
-
"@jupyterlab/rendermime-interfaces": "~3.14.0-alpha.
|
|
49
|
-
"@jupyterlab/ui-components": "~4.6.0-alpha.
|
|
45
|
+
"@jupyterlab/application": "~4.6.0-alpha.2",
|
|
46
|
+
"@jupyterlab/coreutils": "~6.6.0-alpha.2",
|
|
47
|
+
"@jupyterlab/docregistry": "~4.6.0-alpha.2",
|
|
48
|
+
"@jupyterlab/rendermime-interfaces": "~3.14.0-alpha.2",
|
|
49
|
+
"@jupyterlab/ui-components": "~4.6.0-alpha.2",
|
|
50
50
|
"@lumino/algorithm": "^2.0.4",
|
|
51
51
|
"@lumino/coreutils": "^2.2.2",
|
|
52
52
|
"@lumino/messaging": "^2.0.4",
|