@jupyter-notebook/application 7.6.0-alpha.3 → 7.6.0-alpha.5

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.
@@ -2,6 +2,7 @@ import { ICommandPalette } from '@jupyterlab/apputils';
2
2
  import { IDisposable } from '@lumino/disposable';
3
3
  import { ISignal } from '@lumino/signaling';
4
4
  import { Panel, Widget } from '@lumino/widgets';
5
+ import { ITranslator } from '@jupyterlab/translation';
5
6
  /**
6
7
  * A class which manages a panel and sorts its widgets by rank.
7
8
  */
@@ -31,7 +32,7 @@ export declare class SidePanelHandler extends PanelHandler {
31
32
  /**
32
33
  * Construct a new side panel handler.
33
34
  */
34
- constructor(area: SidePanel.Area);
35
+ constructor(area: SidePanel.Area, translator: ITranslator);
35
36
  /**
36
37
  * Get the current widget in the sidebar panel.
37
38
  */
@@ -125,6 +126,7 @@ export declare class SidePanelHandler extends PanelHandler {
125
126
  private _closeButton;
126
127
  private _widgetAdded;
127
128
  private _widgetRemoved;
129
+ private _translator;
128
130
  }
129
131
  /**
130
132
  * A name space for SideBarPanel functions.
@@ -155,9 +157,9 @@ export declare class SidePanelPalette {
155
157
  * Remove an item from the command palette.
156
158
  */
157
159
  removeItem(widget: Readonly<Widget>, area: 'left' | 'right'): void;
158
- _command: string;
159
- _commandPalette: ICommandPalette;
160
- _items: SidePanelPaletteItem[];
160
+ private _command;
161
+ private _commandPalette;
162
+ private _items;
161
163
  }
162
164
  type SidePanelPaletteItem = {
163
165
  /**
@@ -5,6 +5,7 @@ import { ArrayExt, find } from '@lumino/algorithm';
5
5
  import { MessageLoop } from '@lumino/messaging';
6
6
  import { Signal } from '@lumino/signaling';
7
7
  import { Panel, StackedPanel, Widget } from '@lumino/widgets';
8
+ import { nullTranslator } from '@jupyterlab/translation';
8
9
  /**
9
10
  * A class which manages a panel and sorts its widgets by rank.
10
11
  */
@@ -56,13 +57,15 @@ export class SidePanelHandler extends PanelHandler {
56
57
  /**
57
58
  * Construct a new side panel handler.
58
59
  */
59
- constructor(area) {
60
+ constructor(area, translator) {
60
61
  super();
61
62
  this._isHiddenByUser = false;
62
63
  this._widgetAdded = new Signal(this);
63
64
  this._widgetRemoved = new Signal(this);
65
+ this._translator = nullTranslator;
64
66
  this._area = area;
65
67
  this._panel.hide();
68
+ this._translator = translator;
66
69
  this._currentWidget = null;
67
70
  this._lastCurrentWidget = null;
68
71
  this._widgetPanel = new StackedPanel();
@@ -77,8 +80,9 @@ export class SidePanelHandler extends PanelHandler {
77
80
  this.collapse();
78
81
  this.hide();
79
82
  };
83
+ const trans = this._translator.load('notebook');
80
84
  this._closeButton.className = 'jp-Button jp-SidePanel-collapse';
81
- this._closeButton.title = 'Collapse side panel';
85
+ this._closeButton.title = trans.__('Collapse side panel');
82
86
  const icon = new Widget({ node: this._closeButton });
83
87
  this._panel.addWidget(icon);
84
88
  this._panel.addWidget(this._widgetPanel);
@@ -227,8 +231,8 @@ export class SidePanelHandler extends PanelHandler {
227
231
  * Find the widget with the given id, or `null`.
228
232
  */
229
233
  _findWidgetByID(id) {
230
- const item = find(this._items, (value) => value.widget.id === id);
231
- return item ? item.widget : null;
234
+ var _a, _b;
235
+ return (_b = (_a = find(this._items, (value) => value.widget.id === id)) === null || _a === void 0 ? void 0 : _a.widget) !== null && _b !== void 0 ? _b : null;
232
236
  }
233
237
  /**
234
238
  * Refresh the visibility of the stacked panel.
@@ -264,14 +268,8 @@ export class SidePanelPalette {
264
268
  * Get a command palette item from the widget id and the area.
265
269
  */
266
270
  getItem(widget, area) {
267
- const itemList = this._items;
268
- for (let i = 0; i < itemList.length; i++) {
269
- const item = itemList[i];
270
- if (item.widgetId === widget.id && item.area === area) {
271
- return item;
272
- }
273
- }
274
- return null;
271
+ var _a;
272
+ return ((_a = this._items.find((item) => item.widgetId === widget.id && item.area === area)) !== null && _a !== void 0 ? _a : null);
275
273
  }
276
274
  /**
277
275
  * Add an item to the command palette.
package/lib/shell.js CHANGED
@@ -28,8 +28,8 @@ export class NotebookShell extends Widget {
28
28
  this._userLayout = {};
29
29
  this._topHandler = new PanelHandler();
30
30
  this._menuHandler = new PanelHandler();
31
- this._leftHandler = new SidePanelHandler('left');
32
- this._rightHandler = new SidePanelHandler('right');
31
+ this._leftHandler = new SidePanelHandler('left', this.translator);
32
+ this._rightHandler = new SidePanelHandler('right', this.translator);
33
33
  this._main = new Panel();
34
34
  const topWrapper = (this._topWrapper = new Panel());
35
35
  const menuWrapper = (this._menuWrapper = new Panel());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter-notebook/application",
3
- "version": "7.6.0-alpha.3",
3
+ "version": "7.6.0-alpha.5",
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.3",
46
- "@jupyterlab/coreutils": "~6.6.0-alpha.3",
47
- "@jupyterlab/docregistry": "~4.6.0-alpha.3",
48
- "@jupyterlab/rendermime-interfaces": "~3.14.0-alpha.3",
49
- "@jupyterlab/ui-components": "~4.6.0-alpha.3",
45
+ "@jupyterlab/application": "~4.6.0-alpha.5",
46
+ "@jupyterlab/coreutils": "~6.6.0-alpha.5",
47
+ "@jupyterlab/docregistry": "~4.6.0-alpha.5",
48
+ "@jupyterlab/rendermime-interfaces": "~3.14.0-alpha.5",
49
+ "@jupyterlab/ui-components": "~4.6.0-alpha.5",
50
50
  "@lumino/algorithm": "^2.0.4",
51
51
  "@lumino/coreutils": "^2.2.2",
52
52
  "@lumino/messaging": "^2.0.4",
@@ -57,12 +57,12 @@
57
57
  "devDependencies": {
58
58
  "@babel/core": "^7.11.6",
59
59
  "@babel/preset-env": "^7.12.1",
60
- "@jupyterlab/testutils": "~4.6.0-alpha.0",
60
+ "@jupyterlab/testutils": "~4.6.0-alpha.5",
61
61
  "@types/jest": "^29.2.5",
62
62
  "jest": "^29.3.1",
63
63
  "rimraf": "^3.0.2",
64
64
  "ts-jest": "^29.0.3",
65
- "typescript": "~5.5.4"
65
+ "typescript": "~5.9.3"
66
66
  },
67
67
  "publishConfig": {
68
68
  "access": "public"