@jupyterlab/running 4.2.0-alpha.1 → 4.2.0-beta.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/index.d.ts +118 -7
- package/lib/index.js +485 -47
- package/lib/index.js.map +1 -1
- package/package.json +6 -4
- package/src/index.tsx +677 -64
- package/style/base.css +158 -11
package/lib/index.d.ts
CHANGED
|
@@ -3,14 +3,22 @@
|
|
|
3
3
|
* @module running
|
|
4
4
|
*/
|
|
5
5
|
import { ITranslator } from '@jupyterlab/translation';
|
|
6
|
-
import { LabIcon, SidePanel } from '@jupyterlab/ui-components';
|
|
6
|
+
import { IScore, LabIcon, ReactWidget, SidePanel, Toolbar } from '@jupyterlab/ui-components';
|
|
7
|
+
import { IStateDB } from '@jupyterlab/statedb';
|
|
7
8
|
import { Token } from '@lumino/coreutils';
|
|
8
9
|
import { IDisposable } from '@lumino/disposable';
|
|
10
|
+
import { Message } from '@lumino/messaging';
|
|
9
11
|
import { ISignal } from '@lumino/signaling';
|
|
12
|
+
import { Panel } from '@lumino/widgets';
|
|
13
|
+
import { ReactNode } from 'react';
|
|
10
14
|
/**
|
|
11
|
-
* The running sessions token.
|
|
15
|
+
* The running sessions managers token.
|
|
12
16
|
*/
|
|
13
17
|
export declare const IRunningSessionManagers: Token<IRunningSessionManagers>;
|
|
18
|
+
/**
|
|
19
|
+
* The running sessions token.
|
|
20
|
+
*/
|
|
21
|
+
export declare const IRunningSessionSidebar: Token<IRunningSessionSidebar>;
|
|
14
22
|
/**
|
|
15
23
|
* The running interface.
|
|
16
24
|
*/
|
|
@@ -50,14 +58,38 @@ export declare class RunningSessionManagers implements IRunningSessionManagers {
|
|
|
50
58
|
private _added;
|
|
51
59
|
private _managers;
|
|
52
60
|
}
|
|
61
|
+
interface IFilterProvider {
|
|
62
|
+
filter(item: IRunningSessions.IRunningItem): Partial<IScore> | null;
|
|
63
|
+
filterChanged: ISignal<IFilterProvider, void>;
|
|
64
|
+
}
|
|
65
|
+
declare class FilterWidget extends ReactWidget implements IFilterProvider {
|
|
66
|
+
constructor(translator: ITranslator);
|
|
67
|
+
get filterChanged(): ISignal<FilterWidget, void>;
|
|
68
|
+
render(): JSX.Element;
|
|
69
|
+
filter(item: IRunningSessions.IRunningItem): Partial<IScore> | null;
|
|
70
|
+
private _getTextContent;
|
|
71
|
+
private _updateFilter;
|
|
72
|
+
private _filterFn;
|
|
73
|
+
private _filterChanged;
|
|
74
|
+
private _trans;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The interface exposing the running sessions sidebar widget properties.
|
|
78
|
+
*/
|
|
79
|
+
export interface IRunningSessionSidebar {
|
|
80
|
+
/**
|
|
81
|
+
* The toolbar of the running sidebar.
|
|
82
|
+
*/
|
|
83
|
+
readonly toolbar: Toolbar;
|
|
84
|
+
}
|
|
53
85
|
/**
|
|
54
86
|
* A class that exposes the running terminal and kernel sessions.
|
|
55
87
|
*/
|
|
56
|
-
export declare class RunningSessions extends SidePanel {
|
|
88
|
+
export declare class RunningSessions extends SidePanel implements IRunningSessionSidebar {
|
|
57
89
|
/**
|
|
58
90
|
* Construct a new running widget.
|
|
59
91
|
*/
|
|
60
|
-
constructor(managers: IRunningSessionManagers, translator?: ITranslator);
|
|
92
|
+
constructor(managers: IRunningSessionManagers, translator?: ITranslator, stateDB?: IStateDB | null);
|
|
61
93
|
/**
|
|
62
94
|
* Dispose the resources held by the widget
|
|
63
95
|
*/
|
|
@@ -68,9 +100,87 @@ export declare class RunningSessions extends SidePanel {
|
|
|
68
100
|
* @param managers Managers
|
|
69
101
|
* @param manager New manager
|
|
70
102
|
*/
|
|
71
|
-
protected addSection(_: unknown, manager: IRunningSessions.IManager): void
|
|
103
|
+
protected addSection(_: unknown, manager: IRunningSessions.IManager): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Update state database with the new state of a given section.
|
|
106
|
+
*/
|
|
107
|
+
private _updateState;
|
|
108
|
+
/**
|
|
109
|
+
* Get current state from the state database.
|
|
110
|
+
*/
|
|
111
|
+
private _getState;
|
|
72
112
|
protected managers: IRunningSessionManagers;
|
|
73
113
|
protected translator: ITranslator;
|
|
114
|
+
private _stateDB;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A panel intended for use within `Dialog` to allow searching tabs and running sessions.
|
|
118
|
+
*/
|
|
119
|
+
export declare class SearchableSessions extends Panel {
|
|
120
|
+
constructor(managers: IRunningSessionManagers, translator?: ITranslator);
|
|
121
|
+
/**
|
|
122
|
+
* Dispose the resources held by the widget
|
|
123
|
+
*/
|
|
124
|
+
dispose(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Click active element when the user confirmed the choice in the dialog.
|
|
127
|
+
*/
|
|
128
|
+
getValue(): void;
|
|
129
|
+
/**
|
|
130
|
+
* Handle incoming events.
|
|
131
|
+
*/
|
|
132
|
+
handleEvent(event: Event): void;
|
|
133
|
+
/**
|
|
134
|
+
* A message handler invoked on an `'after-attach'` message.
|
|
135
|
+
*/
|
|
136
|
+
protected onAfterAttach(_: Message): void;
|
|
137
|
+
/**
|
|
138
|
+
* A message handler invoked on an `'after-detach'` message.
|
|
139
|
+
*/
|
|
140
|
+
protected onAfterDetach(_: Message): void;
|
|
141
|
+
/**
|
|
142
|
+
* Force focus on the filter input.
|
|
143
|
+
*
|
|
144
|
+
* Note: forces focus because this widget is intended to be used in `Dialog`,
|
|
145
|
+
* which does not support focusing React widget nested within a non-React
|
|
146
|
+
* widget (a limitation of `focusNodeSelector` option implementation).
|
|
147
|
+
*/
|
|
148
|
+
private _forceFocusInput;
|
|
149
|
+
/**
|
|
150
|
+
* Navigate between items using up/down keys by shifting focus.
|
|
151
|
+
*/
|
|
152
|
+
private _evtKeydown;
|
|
153
|
+
/**
|
|
154
|
+
* Set and mark active item relative to the current.
|
|
155
|
+
*
|
|
156
|
+
* Returns whether an active item was set.
|
|
157
|
+
*/
|
|
158
|
+
private _updateActive;
|
|
159
|
+
private _translator;
|
|
160
|
+
private _filterWidget;
|
|
161
|
+
private _activeIndex;
|
|
162
|
+
private _list;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A panel list of searchable sessions.
|
|
166
|
+
*/
|
|
167
|
+
export declare class SearchableSessionsList extends Panel {
|
|
168
|
+
constructor(managers: IRunningSessionManagers, filterWidget: FilterWidget, translator?: ITranslator);
|
|
169
|
+
/**
|
|
170
|
+
* Dispose the resources held by the widget
|
|
171
|
+
*/
|
|
172
|
+
dispose(): void;
|
|
173
|
+
/**
|
|
174
|
+
* Add a section for a new manager.
|
|
175
|
+
*
|
|
176
|
+
* @param managers Managers
|
|
177
|
+
* @param manager New manager
|
|
178
|
+
*/
|
|
179
|
+
protected addSection(_: unknown, manager: IRunningSessions.IManager): void;
|
|
180
|
+
private _managers;
|
|
181
|
+
private _translator;
|
|
182
|
+
private _emptyIndicator;
|
|
183
|
+
private _filterWidget;
|
|
74
184
|
}
|
|
75
185
|
/**
|
|
76
186
|
* The namespace for the `IRunningSessions` class statics.
|
|
@@ -103,7 +213,7 @@ export declare namespace IRunningSessions {
|
|
|
103
213
|
/**
|
|
104
214
|
* A string used to describe the shutdown action.
|
|
105
215
|
*/
|
|
106
|
-
shutdownLabel?: string;
|
|
216
|
+
shutdownLabel?: string | ((item: IRunningSessions.IRunningItem) => string);
|
|
107
217
|
/**
|
|
108
218
|
* A string used to describe the shutdown all action.
|
|
109
219
|
*/
|
|
@@ -149,7 +259,7 @@ export declare namespace IRunningSessions {
|
|
|
149
259
|
/**
|
|
150
260
|
* Called to determine the label for each item.
|
|
151
261
|
*/
|
|
152
|
-
label: () =>
|
|
262
|
+
label: () => ReactNode;
|
|
153
263
|
/**
|
|
154
264
|
* Called to determine the `title` attribute for each item, which is
|
|
155
265
|
* revealed on hover.
|
|
@@ -162,3 +272,4 @@ export declare namespace IRunningSessions {
|
|
|
162
272
|
detail?: () => string;
|
|
163
273
|
}
|
|
164
274
|
}
|
|
275
|
+
export {};
|