@jupyter-notebook/application 7.0.0-beta.0 → 7.0.0-beta.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/shell.d.ts +33 -0
- package/lib/shell.js +74 -0
- package/package.json +11 -11
package/lib/shell.d.ts
CHANGED
|
@@ -114,6 +114,7 @@ export declare class NotebookShell extends Widget implements JupyterFrontEnd.ISh
|
|
|
114
114
|
private _rightHandler;
|
|
115
115
|
private _spacer_top;
|
|
116
116
|
private _spacer_bottom;
|
|
117
|
+
private _skipLinkWidgetHandler;
|
|
117
118
|
private _main;
|
|
118
119
|
private _translator;
|
|
119
120
|
private _currentChanged;
|
|
@@ -128,3 +129,35 @@ export declare namespace Shell {
|
|
|
128
129
|
*/
|
|
129
130
|
type Area = 'main' | 'top' | 'left' | 'right' | 'menu';
|
|
130
131
|
}
|
|
132
|
+
export declare namespace Private {
|
|
133
|
+
class SkipLinkWidgetHandler {
|
|
134
|
+
/**
|
|
135
|
+
* Construct a new skipLink widget handler.
|
|
136
|
+
*/
|
|
137
|
+
constructor(shell: INotebookShell);
|
|
138
|
+
handleEvent(event: Event): void;
|
|
139
|
+
private _focusMain;
|
|
140
|
+
/**
|
|
141
|
+
* Get the input element managed by the handler.
|
|
142
|
+
*/
|
|
143
|
+
get skipLinkWidget(): Widget;
|
|
144
|
+
/**
|
|
145
|
+
* Dispose of the handler and the resources it holds.
|
|
146
|
+
*/
|
|
147
|
+
dispose(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Hide the skipLink widget.
|
|
150
|
+
*/
|
|
151
|
+
hide(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Show the skipLink widget.
|
|
154
|
+
*/
|
|
155
|
+
show(): void;
|
|
156
|
+
/**
|
|
157
|
+
* Test whether the handler has been disposed.
|
|
158
|
+
*/
|
|
159
|
+
get isDisposed(): boolean;
|
|
160
|
+
private _skipLinkWidget;
|
|
161
|
+
private _isDisposed;
|
|
162
|
+
}
|
|
163
|
+
}
|
package/lib/shell.js
CHANGED
|
@@ -88,6 +88,11 @@ export class NotebookShell extends Widget {
|
|
|
88
88
|
rootLayout.spacing = 0;
|
|
89
89
|
rootLayout.addWidget(hsplitPanel);
|
|
90
90
|
this.layout = rootLayout;
|
|
91
|
+
// Added Skip to Main Link
|
|
92
|
+
const skipLinkWidgetHandler = (this._skipLinkWidgetHandler =
|
|
93
|
+
new Private.SkipLinkWidgetHandler(this));
|
|
94
|
+
this.add(skipLinkWidgetHandler.skipLinkWidget, 'top', { rank: 0 });
|
|
95
|
+
this._skipLinkWidgetHandler.show();
|
|
91
96
|
}
|
|
92
97
|
/**
|
|
93
98
|
* A signal emitted when the current widget changes.
|
|
@@ -287,3 +292,72 @@ export class NotebookShell extends Widget {
|
|
|
287
292
|
this._rightHandler.panel.hide();
|
|
288
293
|
}
|
|
289
294
|
}
|
|
295
|
+
export var Private;
|
|
296
|
+
(function (Private) {
|
|
297
|
+
class SkipLinkWidgetHandler {
|
|
298
|
+
/**
|
|
299
|
+
* Construct a new skipLink widget handler.
|
|
300
|
+
*/
|
|
301
|
+
constructor(shell) {
|
|
302
|
+
this._isDisposed = false;
|
|
303
|
+
const skipLinkWidget = (this._skipLinkWidget = new Widget());
|
|
304
|
+
const skipToMain = document.createElement('a');
|
|
305
|
+
skipToMain.href = '#first-cell';
|
|
306
|
+
skipToMain.tabIndex = 1;
|
|
307
|
+
skipToMain.text = 'Skip to Main';
|
|
308
|
+
skipToMain.className = 'skip-link';
|
|
309
|
+
skipToMain.addEventListener('click', this);
|
|
310
|
+
skipLinkWidget.addClass('jp-skiplink');
|
|
311
|
+
skipLinkWidget.id = 'jp-skiplink';
|
|
312
|
+
skipLinkWidget.node.appendChild(skipToMain);
|
|
313
|
+
}
|
|
314
|
+
handleEvent(event) {
|
|
315
|
+
switch (event.type) {
|
|
316
|
+
case 'click':
|
|
317
|
+
this._focusMain();
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
_focusMain() {
|
|
322
|
+
const input = document.querySelector('#main-panel .jp-InputArea-editor');
|
|
323
|
+
input.tabIndex = 1;
|
|
324
|
+
input.focus();
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Get the input element managed by the handler.
|
|
328
|
+
*/
|
|
329
|
+
get skipLinkWidget() {
|
|
330
|
+
return this._skipLinkWidget;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Dispose of the handler and the resources it holds.
|
|
334
|
+
*/
|
|
335
|
+
dispose() {
|
|
336
|
+
if (this.isDisposed) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
this._isDisposed = true;
|
|
340
|
+
this._skipLinkWidget.node.removeEventListener('click', this);
|
|
341
|
+
this._skipLinkWidget.dispose();
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Hide the skipLink widget.
|
|
345
|
+
*/
|
|
346
|
+
hide() {
|
|
347
|
+
this._skipLinkWidget.hide();
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Show the skipLink widget.
|
|
351
|
+
*/
|
|
352
|
+
show() {
|
|
353
|
+
this._skipLinkWidget.show();
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Test whether the handler has been disposed.
|
|
357
|
+
*/
|
|
358
|
+
get isDisposed() {
|
|
359
|
+
return this._isDisposed;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
Private.SkipLinkWidgetHandler = SkipLinkWidgetHandler;
|
|
363
|
+
})(Private || (Private = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter-notebook/application",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.2",
|
|
4
4
|
"description": "Jupyter Notebook - Application",
|
|
5
5
|
"homepage": "https://github.com/jupyter/notebook",
|
|
6
6
|
"bugs": {
|
|
@@ -42,22 +42,22 @@
|
|
|
42
42
|
"watch": "tsc -b --watch"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@jupyterlab/application": "^4.0.0-
|
|
46
|
-
"@jupyterlab/coreutils": "^6.0.0-
|
|
47
|
-
"@jupyterlab/docregistry": "^4.0.0-
|
|
48
|
-
"@jupyterlab/rendermime-interfaces": "^3.8.0-
|
|
49
|
-
"@jupyterlab/ui-components": "^4.0.0-
|
|
45
|
+
"@jupyterlab/application": "^4.0.0-rc.1",
|
|
46
|
+
"@jupyterlab/coreutils": "^6.0.0-rc.1",
|
|
47
|
+
"@jupyterlab/docregistry": "^4.0.0-rc.1",
|
|
48
|
+
"@jupyterlab/rendermime-interfaces": "^3.8.0-rc.1",
|
|
49
|
+
"@jupyterlab/ui-components": "^4.0.0-rc.1",
|
|
50
50
|
"@lumino/algorithm": "^2.0.0",
|
|
51
|
-
"@lumino/coreutils": "^2.
|
|
51
|
+
"@lumino/coreutils": "^2.1.1",
|
|
52
52
|
"@lumino/messaging": "^2.0.0",
|
|
53
|
-
"@lumino/polling": "^2.
|
|
54
|
-
"@lumino/signaling": "^2.
|
|
55
|
-
"@lumino/widgets": "^2.
|
|
53
|
+
"@lumino/polling": "^2.1.1",
|
|
54
|
+
"@lumino/signaling": "^2.1.1",
|
|
55
|
+
"@lumino/widgets": "^2.1.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@babel/core": "^7.11.6",
|
|
59
59
|
"@babel/preset-env": "^7.12.1",
|
|
60
|
-
"@jupyterlab/testutils": "^4.0.0-
|
|
60
|
+
"@jupyterlab/testutils": "^4.0.0-rc.1",
|
|
61
61
|
"@types/jest": "^29.2.5",
|
|
62
62
|
"jest": "^29.3.1",
|
|
63
63
|
"rimraf": "^3.0.2",
|