@jupyterlab/apputils 4.0.0-alpha.9 → 4.0.0-beta.1
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/clipboard.d.ts +1 -1
- package/lib/dialog.d.ts +66 -4
- package/lib/dialog.js +126 -29
- package/lib/dialog.js.map +1 -1
- package/lib/domutils.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/inputdialog.d.ts +35 -3
- package/lib/inputdialog.js +122 -12
- package/lib/inputdialog.js.map +1 -1
- package/lib/kernelstatuses.js +26 -25
- package/lib/kernelstatuses.js.map +1 -1
- package/lib/mainareawidget.js +1 -1
- package/lib/mainareawidget.js.map +1 -1
- package/lib/menufactory.js +14 -15
- package/lib/menufactory.js.map +1 -1
- package/lib/notification.d.ts +336 -0
- package/lib/notification.js +310 -0
- package/lib/notification.js.map +1 -0
- package/lib/runningSessions.js +2 -2
- package/lib/runningSessions.js.map +1 -1
- package/lib/sanitizer.d.ts +20 -7
- package/lib/sanitizer.js +34 -7
- package/lib/sanitizer.js.map +1 -1
- package/lib/semanticCommand.js +11 -2
- package/lib/semanticCommand.js.map +1 -1
- package/lib/sessioncontext.d.ts +53 -6
- package/lib/sessioncontext.js +100 -68
- package/lib/sessioncontext.js.map +1 -1
- package/lib/testutils.d.ts +5 -0
- package/lib/testutils.js +46 -0
- package/lib/testutils.js.map +1 -0
- package/lib/thememanager.js +20 -5
- package/lib/thememanager.js.map +1 -1
- package/lib/tokens.d.ts +21 -42
- package/lib/tokens.js.map +1 -1
- package/lib/toolbar/factory.d.ts +2 -1
- package/lib/toolbar/factory.js +135 -105
- package/lib/toolbar/factory.js.map +1 -1
- package/lib/toolbar/index.js +4 -0
- package/lib/toolbar/index.js.map +1 -1
- package/lib/toolbar/registry.d.ts +11 -0
- package/lib/toolbar/registry.js +20 -3
- package/lib/toolbar/registry.js.map +1 -1
- package/lib/toolbar/widget.d.ts +3 -0
- package/lib/toolbar/widget.js +8 -5
- package/lib/toolbar/widget.js.map +1 -1
- package/lib/widgettracker.d.ts +13 -1
- package/lib/widgettracker.js +29 -2
- package/lib/widgettracker.js.map +1 -1
- package/package.json +31 -30
- package/src/clipboard.ts +107 -0
- package/src/commandlinker.ts +209 -0
- package/src/commandpalette.ts +175 -0
- package/src/dialog.tsx +1133 -0
- package/src/domutils.ts +53 -0
- package/src/index.ts +78 -0
- package/src/inputdialog.ts +551 -0
- package/src/kernelstatuses.tsx +279 -0
- package/src/mainareawidget.ts +362 -0
- package/src/menufactory.ts +201 -0
- package/src/notification.ts +559 -0
- package/src/printing.ts +180 -0
- package/src/runningSessions.tsx +233 -0
- package/src/sanitizer.ts +986 -0
- package/src/semanticCommand.ts +77 -0
- package/src/sessioncontext.tsx +1774 -0
- package/src/testutils.ts +49 -0
- package/src/thememanager.ts +530 -0
- package/src/tokens.ts +351 -0
- package/src/toolbar/factory.ts +426 -0
- package/src/toolbar/index.ts +8 -0
- package/src/toolbar/registry.ts +158 -0
- package/src/toolbar/widget.tsx +242 -0
- package/src/widgettracker.ts +391 -0
- package/src/windowresolver.ts +218 -0
- package/style/dialog.css +16 -1
- package/style/inputdialog.css +5 -0
- package/style/materialcolors.css +5 -0
package/src/tokens.ts
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
|
|
4
|
+
import { IChangedArgs } from '@jupyterlab/coreutils';
|
|
5
|
+
import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
|
|
6
|
+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
7
|
+
import { Token } from '@lumino/coreutils';
|
|
8
|
+
import { IDisposable } from '@lumino/disposable';
|
|
9
|
+
import { ISignal } from '@lumino/signaling';
|
|
10
|
+
import { CommandPalette, Widget } from '@lumino/widgets';
|
|
11
|
+
import { ISessionContext } from './sessioncontext';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The command palette token.
|
|
15
|
+
*/
|
|
16
|
+
export const ICommandPalette = new Token<ICommandPalette>(
|
|
17
|
+
'@jupyterlab/apputils:ICommandPalette'
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The options for creating a command palette item.
|
|
22
|
+
*/
|
|
23
|
+
export interface IPaletteItem extends CommandPalette.IItemOptions {}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The interface for a Jupyter Lab command palette.
|
|
27
|
+
*/
|
|
28
|
+
export interface ICommandPalette {
|
|
29
|
+
/**
|
|
30
|
+
* The placeholder text of the command palette's search input.
|
|
31
|
+
*/
|
|
32
|
+
placeholder: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Activate the command palette for user input.
|
|
36
|
+
*/
|
|
37
|
+
activate(): void;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Add a command item to the command palette.
|
|
41
|
+
*
|
|
42
|
+
* @param options - The options for creating the command item.
|
|
43
|
+
*
|
|
44
|
+
* @returns A disposable that will remove the item from the palette.
|
|
45
|
+
*/
|
|
46
|
+
addItem(options: IPaletteItem): IDisposable;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const IKernelStatusModel = new Token<IKernelStatusModel>(
|
|
50
|
+
'@jupyterlab/apputils:IKernelStatusModel'
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Kernel status indicator model.
|
|
55
|
+
*/
|
|
56
|
+
export interface IKernelStatusModel {
|
|
57
|
+
/**
|
|
58
|
+
* Add a session context provider.
|
|
59
|
+
*
|
|
60
|
+
* A provider will receive the currently active widget and must return the
|
|
61
|
+
* associated session context if it can or null otherwise.
|
|
62
|
+
*/
|
|
63
|
+
addSessionProvider: (
|
|
64
|
+
provider: (widget: Widget | null) => ISessionContext | null
|
|
65
|
+
) => void;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* An interface for the session context dialogs.
|
|
70
|
+
*/
|
|
71
|
+
export interface ISessionContextDialogs extends ISessionContext.IDialogs {}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The session context dialogs token.
|
|
75
|
+
*/
|
|
76
|
+
export const ISessionContextDialogs = new Token<ISessionContext.IDialogs>(
|
|
77
|
+
'@jupyterlab/apputils:ISessionContextDialogs'
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The theme manager token.
|
|
82
|
+
*/
|
|
83
|
+
export const IThemeManager = new Token<IThemeManager>(
|
|
84
|
+
'@jupyterlab/apputils:IThemeManager'
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* An interface for a theme manager.
|
|
89
|
+
*/
|
|
90
|
+
export interface IThemeManager {
|
|
91
|
+
/**
|
|
92
|
+
* Get the name of the current theme.
|
|
93
|
+
*/
|
|
94
|
+
readonly theme: string | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The names of the registered themes.
|
|
98
|
+
*/
|
|
99
|
+
readonly themes: ReadonlyArray<string>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A signal fired when the application theme changes.
|
|
103
|
+
*/
|
|
104
|
+
readonly themeChanged: ISignal<this, IChangedArgs<string, string | null>>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Load a theme CSS file by path.
|
|
108
|
+
*
|
|
109
|
+
* @param path - The path of the file to load.
|
|
110
|
+
*/
|
|
111
|
+
loadCSS(path: string): Promise<void>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Register a theme with the theme manager.
|
|
115
|
+
*
|
|
116
|
+
* @param theme - The theme to register.
|
|
117
|
+
*
|
|
118
|
+
* @returns A disposable that can be used to unregister the theme.
|
|
119
|
+
*/
|
|
120
|
+
register(theme: IThemeManager.ITheme): IDisposable;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Set the current theme.
|
|
124
|
+
*/
|
|
125
|
+
setTheme(name: string): Promise<void>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Test whether a given theme is light.
|
|
129
|
+
*/
|
|
130
|
+
isLight(name: string): boolean;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Test whether a given theme styles scrollbars,
|
|
134
|
+
* and if the user has scrollbar styling enabled.
|
|
135
|
+
*/
|
|
136
|
+
themeScrollbars(name: string): boolean;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Get display name for theme.
|
|
140
|
+
*/
|
|
141
|
+
getDisplayName(name: string): string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* A namespace for the `IThemeManager` sub-types.
|
|
146
|
+
*/
|
|
147
|
+
export namespace IThemeManager {
|
|
148
|
+
/**
|
|
149
|
+
* An interface for a theme.
|
|
150
|
+
*/
|
|
151
|
+
export interface ITheme {
|
|
152
|
+
/**
|
|
153
|
+
* The unique identifier name of the theme.
|
|
154
|
+
*/
|
|
155
|
+
name: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The display name of the theme.
|
|
159
|
+
*/
|
|
160
|
+
displayName?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Whether the theme is light or dark. Downstream authors
|
|
164
|
+
* of extensions can use this information to customize their
|
|
165
|
+
* UI depending upon the current theme.
|
|
166
|
+
*/
|
|
167
|
+
isLight: boolean;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Whether the theme includes styling for the scrollbar.
|
|
171
|
+
* If set to false, this theme will leave the native scrollbar untouched.
|
|
172
|
+
*/
|
|
173
|
+
themeScrollbars?: boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Load the theme.
|
|
177
|
+
*
|
|
178
|
+
* @returns A promise that resolves when the theme has loaded.
|
|
179
|
+
*/
|
|
180
|
+
load(): Promise<void>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Unload the theme.
|
|
184
|
+
*
|
|
185
|
+
* @returns A promise that resolves when the theme has unloaded.
|
|
186
|
+
*/
|
|
187
|
+
unload(): Promise<void>;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The sanitizer token.
|
|
193
|
+
*/
|
|
194
|
+
export const ISanitizer = new Token<IRenderMime.ISanitizer>(
|
|
195
|
+
'@jupyterlab/apputils:ISanitizer'
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @deprecated since v4 use {@link IRenderMime.ISanitizer}
|
|
200
|
+
*/
|
|
201
|
+
export type ISanitizer = IRenderMime.ISanitizer;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The namespace for `ISanitizer` related interfaces.
|
|
205
|
+
*/
|
|
206
|
+
export namespace ISanitizer {
|
|
207
|
+
/**
|
|
208
|
+
* The options used to sanitize.
|
|
209
|
+
*
|
|
210
|
+
* @deprecated in v4 use {@link IRenderMime.ISanitizerOptions}
|
|
211
|
+
*/
|
|
212
|
+
export type IOptions = IRenderMime.ISanitizerOptions;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The main menu token.
|
|
217
|
+
*/
|
|
218
|
+
export const ISplashScreen = new Token<ISplashScreen>(
|
|
219
|
+
'@jupyterlab/apputils:ISplashScreen'
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The interface for an application splash screen.
|
|
224
|
+
*/
|
|
225
|
+
export interface ISplashScreen {
|
|
226
|
+
/**
|
|
227
|
+
* Show the application splash screen.
|
|
228
|
+
*
|
|
229
|
+
* @param light - Whether to show the light splash screen or the dark one.
|
|
230
|
+
*
|
|
231
|
+
* @returns A disposable used to clear the splash screen.
|
|
232
|
+
*/
|
|
233
|
+
show(light?: boolean): IDisposable;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* The default window resolver token.
|
|
238
|
+
*/
|
|
239
|
+
export const IWindowResolver = new Token<IWindowResolver>(
|
|
240
|
+
'@jupyterlab/apputils:IWindowResolver'
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The description of a window name resolver.
|
|
245
|
+
*/
|
|
246
|
+
export interface IWindowResolver {
|
|
247
|
+
/**
|
|
248
|
+
* A window name to use as a handle among shared resources.
|
|
249
|
+
*/
|
|
250
|
+
readonly name: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The namespace for `IToolbarWidgetRegistry` related interfaces
|
|
255
|
+
*/
|
|
256
|
+
export namespace ToolbarRegistry {
|
|
257
|
+
/**
|
|
258
|
+
* Interface of item to be inserted in a toolbar
|
|
259
|
+
*/
|
|
260
|
+
export interface IToolbarItem extends IRenderMime.IToolbarItem {}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Interface describing a toolbar item widget
|
|
264
|
+
*/
|
|
265
|
+
export interface IWidget extends ISettingRegistry.IToolbarItem {}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Options to set up the toolbar widget registry
|
|
269
|
+
*/
|
|
270
|
+
export interface IOptions {
|
|
271
|
+
/**
|
|
272
|
+
* Default toolbar widget factory
|
|
273
|
+
*
|
|
274
|
+
* The factory is receiving 3 arguments:
|
|
275
|
+
* @param widgetFactory The widget factory name that creates the toolbar
|
|
276
|
+
* @param widget The newly widget containing the toolbar
|
|
277
|
+
* @param toolbarItem The toolbar item definition
|
|
278
|
+
* @returns The widget to be inserted in the toolbar.
|
|
279
|
+
*/
|
|
280
|
+
defaultFactory: (
|
|
281
|
+
widgetFactory: string,
|
|
282
|
+
widget: Widget,
|
|
283
|
+
toolbarItem: IWidget
|
|
284
|
+
) => Widget;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Toolbar widget registry interface
|
|
290
|
+
*/
|
|
291
|
+
export interface IToolbarWidgetRegistry {
|
|
292
|
+
/**
|
|
293
|
+
* Add a new toolbar item factory
|
|
294
|
+
*
|
|
295
|
+
* @param widgetFactory The widget factory name that creates the toolbar
|
|
296
|
+
* @param toolbarItemName The unique toolbar item
|
|
297
|
+
* @param factory The factory function that receives the widget containing the toolbar and returns the toolbar widget.
|
|
298
|
+
* @returns The previously defined factory
|
|
299
|
+
*/
|
|
300
|
+
addFactory<T extends Widget = Widget>(
|
|
301
|
+
widgetFactory: string,
|
|
302
|
+
toolbarItemName: string,
|
|
303
|
+
factory: (main: T) => Widget
|
|
304
|
+
): ((main: T) => Widget) | undefined;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Default toolbar item factory
|
|
308
|
+
*/
|
|
309
|
+
defaultFactory: (
|
|
310
|
+
widgetFactory: string,
|
|
311
|
+
widget: Widget,
|
|
312
|
+
toolbarItem: ToolbarRegistry.IWidget
|
|
313
|
+
) => Widget;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Create a toolbar item widget
|
|
317
|
+
*
|
|
318
|
+
* @param widgetFactory The widget factory name that creates the toolbar
|
|
319
|
+
* @param widget The newly widget containing the toolbar
|
|
320
|
+
* @param toolbarItem The toolbar item definition
|
|
321
|
+
* @returns The widget to be inserted in the toolbar.
|
|
322
|
+
*/
|
|
323
|
+
createWidget(
|
|
324
|
+
widgetFactory: string,
|
|
325
|
+
widget: Widget,
|
|
326
|
+
toolbarItem: ToolbarRegistry.IWidget
|
|
327
|
+
): Widget;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Register a new toolbar item factory
|
|
331
|
+
*
|
|
332
|
+
* @param widgetFactory The widget factory name that creates the toolbar
|
|
333
|
+
* @param toolbarItemName The unique toolbar item
|
|
334
|
+
* @param factory The factory function that receives the widget containing the toolbar and returns the toolbar widget.
|
|
335
|
+
* @returns The previously defined factory
|
|
336
|
+
*
|
|
337
|
+
* @deprecated since v4 use `addFactory` instead
|
|
338
|
+
*/
|
|
339
|
+
registerFactory<T extends Widget = Widget>(
|
|
340
|
+
widgetFactory: string,
|
|
341
|
+
toolbarItemName: string,
|
|
342
|
+
factory: (main: T) => Widget
|
|
343
|
+
): ((main: T) => Widget) | undefined;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The toolbar registry token.
|
|
348
|
+
*/
|
|
349
|
+
export const IToolbarWidgetRegistry = new Token<IToolbarWidgetRegistry>(
|
|
350
|
+
'@jupyterlab/apputils:IToolbarWidgetRegistry'
|
|
351
|
+
);
|