@jupyter-notebook/application 7.4.0-beta.3 → 7.4.0

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/shell.d.ts CHANGED
@@ -21,7 +21,7 @@ export declare namespace INotebookShell {
21
21
  /**
22
22
  * The areas of the application shell where widgets can reside.
23
23
  */
24
- type Area = 'main' | 'top' | 'menu' | 'left' | 'right';
24
+ type Area = 'main' | 'top' | 'menu' | 'left' | 'right' | 'down';
25
25
  /**
26
26
  * Widget position
27
27
  */
@@ -145,6 +145,10 @@ export declare class NotebookShell extends Widget implements JupyterFrontEnd.ISh
145
145
  * Restore the layout state and configuration for the application shell.
146
146
  */
147
147
  restoreLayout(configuration: INotebookShell.IUserLayout): Promise<void>;
148
+ /**
149
+ * Handle a change on the down panel widgets
150
+ */
151
+ private _onTabPanelChanged;
148
152
  private _topWrapper;
149
153
  private _topHandler;
150
154
  private _menuWrapper;
@@ -155,6 +159,7 @@ export declare class NotebookShell extends Widget implements JupyterFrontEnd.ISh
155
159
  private _spacer_bottom;
156
160
  private _skipLinkWidgetHandler;
157
161
  private _main;
162
+ private _downPanel;
158
163
  private _translator;
159
164
  private _currentChanged;
160
165
  private _mainWidgetLoaded;
package/lib/shell.js CHANGED
@@ -6,6 +6,7 @@ import { JSONExt, PromiseDelegate, Token } from '@lumino/coreutils';
6
6
  import { Signal } from '@lumino/signaling';
7
7
  import { BoxLayout, Panel, SplitPanel, Widget, } from '@lumino/widgets';
8
8
  import { PanelHandler, SidePanelHandler } from './panelhandler';
9
+ import { TabPanelSvg } from '@jupyterlab/ui-components';
9
10
  /**
10
11
  * The Jupyter Notebook application shell token.
11
12
  */
@@ -71,6 +72,16 @@ export class NotebookShell extends Widget {
71
72
  middlePanel.addWidget(this._main);
72
73
  middlePanel.addWidget(this._spacer_bottom);
73
74
  middlePanel.layout = middleLayout;
75
+ const vsplitPanel = new SplitPanel();
76
+ vsplitPanel.id = 'jp-main-vsplit-panel';
77
+ vsplitPanel.spacing = 1;
78
+ vsplitPanel.orientation = 'vertical';
79
+ SplitPanel.setStretch(vsplitPanel, 1);
80
+ const downPanel = new TabPanelSvg({
81
+ tabsMovable: true,
82
+ });
83
+ this._downPanel = downPanel;
84
+ this._downPanel.id = 'jp-down-stack';
74
85
  // TODO: Consider storing this as an attribute this._hsplitPanel if saving/restoring layout needed
75
86
  const hsplitPanel = new SplitPanel();
76
87
  hsplitPanel.id = 'main-split-panel';
@@ -86,8 +97,15 @@ export class NotebookShell extends Widget {
86
97
  // This will still respect the min-size of children widget in the stacked
87
98
  // panel.
88
99
  hsplitPanel.setRelativeSizes([1, 2.5, 1]);
100
+ vsplitPanel.addWidget(hsplitPanel);
101
+ vsplitPanel.addWidget(downPanel);
89
102
  rootLayout.spacing = 0;
90
- rootLayout.addWidget(hsplitPanel);
103
+ rootLayout.addWidget(vsplitPanel);
104
+ // initially hiding the down panel
105
+ this._downPanel.hide();
106
+ // Connect down panel change listeners
107
+ this._downPanel.tabBar.tabMoved.connect(this._onTabPanelChanged, this);
108
+ this._downPanel.stackedPanel.widgetRemoved.connect(this._onTabPanelChanged, this);
91
109
  this.layout = rootLayout;
92
110
  // Added Skip to Main Link
93
111
  const skipLinkWidgetHandler = (this._skipLinkWidgetHandler =
@@ -176,7 +194,7 @@ export class NotebookShell extends Widget {
176
194
  */
177
195
  activateById(id) {
178
196
  // Search all areas that can have widgets for this widget, starting with main.
179
- for (const area of ['main', 'top', 'left', 'right', 'menu']) {
197
+ for (const area of ['main', 'top', 'left', 'right', 'menu', 'down']) {
180
198
  const widget = find(this.widgets(area), (w) => w.id === id);
181
199
  if (widget) {
182
200
  if (area === 'left') {
@@ -185,6 +203,10 @@ export class NotebookShell extends Widget {
185
203
  else if (area === 'right') {
186
204
  this.expandRight(id);
187
205
  }
206
+ else if (area === 'down') {
207
+ this._downPanel.show();
208
+ widget.activate();
209
+ }
188
210
  else {
189
211
  widget.activate();
190
212
  }
@@ -245,6 +267,8 @@ export class NotebookShell extends Widget {
245
267
  return this._leftHandler.addWidget(widget, rank);
246
268
  case 'right':
247
269
  return this._rightHandler.addWidget(widget, rank);
270
+ case 'down':
271
+ return this._downPanel.addWidget(widget);
248
272
  default:
249
273
  console.warn(`Cannot add widget to area: ${area}`);
250
274
  }
@@ -285,6 +309,9 @@ export class NotebookShell extends Widget {
285
309
  case 'right':
286
310
  yield* this._rightHandler.widgets;
287
311
  return;
312
+ case 'down':
313
+ yield* this._downPanel.widgets;
314
+ return;
288
315
  default:
289
316
  console.error(`This shell has no area called "${area}"`);
290
317
  return;
@@ -324,6 +351,14 @@ export class NotebookShell extends Widget {
324
351
  async restoreLayout(configuration) {
325
352
  this._userLayout = configuration;
326
353
  }
354
+ /**
355
+ * Handle a change on the down panel widgets
356
+ */
357
+ _onTabPanelChanged() {
358
+ if (this._downPanel.stackedPanel.widgets.length === 0) {
359
+ this._downPanel.hide();
360
+ }
361
+ }
327
362
  }
328
363
  export var Private;
329
364
  (function (Private) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter-notebook/application",
3
- "version": "7.4.0-beta.3",
3
+ "version": "7.4.0",
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.4.0-rc.0",
46
- "@jupyterlab/coreutils": "~6.4.0-rc.0",
47
- "@jupyterlab/docregistry": "~4.4.0-rc.0",
48
- "@jupyterlab/rendermime-interfaces": "~3.12.0-rc.0",
49
- "@jupyterlab/ui-components": "~4.4.0-rc.0",
45
+ "@jupyterlab/application": "~4.4.0",
46
+ "@jupyterlab/coreutils": "~6.4.0",
47
+ "@jupyterlab/docregistry": "~4.4.0",
48
+ "@jupyterlab/rendermime-interfaces": "~3.12.0",
49
+ "@jupyterlab/ui-components": "~4.4.0",
50
50
  "@lumino/algorithm": "^2.0.2",
51
51
  "@lumino/coreutils": "^2.2.0",
52
52
  "@lumino/messaging": "^2.0.2",