@jupyterlab/apputils 3.4.1 → 4.0.0-alpha.10

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.
Files changed (85) hide show
  1. package/lib/commandpalette.d.ts +0 -32
  2. package/lib/commandpalette.js +1 -7
  3. package/lib/commandpalette.js.map +1 -1
  4. package/lib/dialog.d.ts +10 -1
  5. package/lib/dialog.js +1 -3
  6. package/lib/dialog.js.map +1 -1
  7. package/lib/domutils.js.map +1 -1
  8. package/lib/index.d.ts +29 -10
  9. package/lib/index.js +29 -10
  10. package/lib/index.js.map +1 -1
  11. package/lib/inputdialog.js +1 -1
  12. package/lib/inputdialog.js.map +1 -1
  13. package/lib/kernelstatuses.d.ts +73 -1
  14. package/lib/kernelstatuses.js +140 -1
  15. package/lib/kernelstatuses.js.map +1 -1
  16. package/lib/mainareawidget.d.ts +2 -2
  17. package/lib/mainareawidget.js +1 -2
  18. package/lib/mainareawidget.js.map +1 -1
  19. package/lib/menufactory.js.map +1 -1
  20. package/lib/runningSessions.d.ts +72 -0
  21. package/lib/runningSessions.js +119 -0
  22. package/lib/runningSessions.js.map +1 -0
  23. package/lib/sanitizer.js +1 -2
  24. package/lib/sanitizer.js.map +1 -1
  25. package/lib/semanticCommand.d.ts +48 -0
  26. package/lib/semanticCommand.js +42 -0
  27. package/lib/semanticCommand.js.map +1 -0
  28. package/lib/sessioncontext.js +7 -5
  29. package/lib/sessioncontext.js.map +1 -1
  30. package/lib/thememanager.d.ts +2 -3
  31. package/lib/thememanager.js +1 -1
  32. package/lib/thememanager.js.map +1 -1
  33. package/lib/tokens.d.ts +87 -10
  34. package/lib/tokens.js +13 -3
  35. package/lib/tokens.js.map +1 -1
  36. package/lib/toolbar/factory.d.ts +3 -2
  37. package/lib/toolbar/factory.js +125 -101
  38. package/lib/toolbar/factory.js.map +1 -1
  39. package/lib/toolbar/registry.d.ts +11 -0
  40. package/lib/toolbar/registry.js +16 -4
  41. package/lib/toolbar/registry.js.map +1 -1
  42. package/lib/toolbar/widget.d.ts +1 -435
  43. package/lib/toolbar/widget.js +3 -866
  44. package/lib/toolbar/widget.js.map +1 -1
  45. package/lib/widgettracker.js.map +1 -1
  46. package/lib/windowresolver.d.ts +1 -14
  47. package/lib/windowresolver.js +1 -6
  48. package/lib/windowresolver.js.map +1 -1
  49. package/package.json +23 -26
  50. package/style/base.css +0 -6
  51. package/style/commandpalette.css +7 -10
  52. package/style/dialog.css +10 -9
  53. package/style/index.css +1 -0
  54. package/style/index.js +1 -0
  55. package/style/materialcolors.css +3 -21
  56. package/lib/collapse.d.ts +0 -64
  57. package/lib/collapse.js +0 -145
  58. package/lib/collapse.js.map +0 -1
  59. package/lib/hoverbox.d.ts +0 -82
  60. package/lib/hoverbox.js +0 -100
  61. package/lib/hoverbox.js.map +0 -1
  62. package/lib/iframe.d.ts +0 -77
  63. package/lib/iframe.js +0 -89
  64. package/lib/iframe.js.map +0 -1
  65. package/lib/search.d.ts +0 -37
  66. package/lib/search.js +0 -102
  67. package/lib/search.js.map +0 -1
  68. package/lib/spinner.d.ts +0 -15
  69. package/lib/spinner.js +0 -28
  70. package/lib/spinner.js.map +0 -1
  71. package/lib/splash.d.ts +0 -19
  72. package/lib/splash.js +0 -9
  73. package/lib/splash.js.map +0 -1
  74. package/lib/styling.d.ts +0 -27
  75. package/lib/styling.js +0 -100
  76. package/lib/styling.js.map +0 -1
  77. package/lib/vdom.d.ts +0 -189
  78. package/lib/vdom.js +0 -203
  79. package/lib/vdom.js.map +0 -1
  80. package/style/collapse.css +0 -30
  81. package/style/hoverbox.css +0 -13
  82. package/style/iframe.css +0 -33
  83. package/style/spinner.css +0 -79
  84. package/style/styling.css +0 -101
  85. package/style/toolbar.css +0 -115
@@ -1,202 +1,10 @@
1
- /// <reference types="react" />
2
1
  import { ITranslator } from '@jupyterlab/translation';
3
- import { LabIcon } from '@jupyterlab/ui-components';
4
- import { IIterator } from '@lumino/algorithm';
5
- import { CommandRegistry } from '@lumino/commands';
6
- import { ReadonlyJSONObject } from '@lumino/coreutils';
7
- import { Message } from '@lumino/messaging';
8
- import { Layout, Widget } from '@lumino/widgets';
2
+ import { Widget } from '@lumino/widgets';
9
3
  import { ISessionContext } from '../sessioncontext';
10
- import { ReactWidget } from '../vdom';
11
- /**
12
- * A class which provides a toolbar widget.
13
- */
14
- export declare class Toolbar<T extends Widget = Widget> extends Widget {
15
- /**
16
- * Construct a new toolbar widget.
17
- */
18
- constructor(options?: Toolbar.IOptions);
19
- /**
20
- * Get an iterator over the ordered toolbar item names.
21
- *
22
- * @returns An iterator over the toolbar item names.
23
- */
24
- names(): IIterator<string>;
25
- /**
26
- * Add an item to the end of the toolbar.
27
- *
28
- * @param name - The name of the widget to add to the toolbar.
29
- *
30
- * @param widget - The widget to add to the toolbar.
31
- *
32
- * @param index - The optional name of the item to insert after.
33
- *
34
- * @returns Whether the item was added to toolbar. Returns false if
35
- * an item of the same name is already in the toolbar.
36
- *
37
- * #### Notes
38
- * The item can be removed from the toolbar by setting its parent to `null`.
39
- */
40
- addItem(name: string, widget: T): boolean;
41
- /**
42
- * Insert an item into the toolbar at the specified index.
43
- *
44
- * @param index - The index at which to insert the item.
45
- *
46
- * @param name - The name of the item.
47
- *
48
- * @param widget - The widget to add.
49
- *
50
- * @returns Whether the item was added to the toolbar. Returns false if
51
- * an item of the same name is already in the toolbar.
52
- *
53
- * #### Notes
54
- * The index will be clamped to the bounds of the items.
55
- * The item can be removed from the toolbar by setting its parent to `null`.
56
- */
57
- insertItem(index: number, name: string, widget: T): boolean;
58
- /**
59
- * Insert an item into the toolbar at the after a target item.
60
- *
61
- * @param at - The target item to insert after.
62
- *
63
- * @param name - The name of the item.
64
- *
65
- * @param widget - The widget to add.
66
- *
67
- * @returns Whether the item was added to the toolbar. Returns false if
68
- * an item of the same name is already in the toolbar.
69
- *
70
- * #### Notes
71
- * The index will be clamped to the bounds of the items.
72
- * The item can be removed from the toolbar by setting its parent to `null`.
73
- */
74
- insertAfter(at: string, name: string, widget: T): boolean;
75
- /**
76
- * Insert an item into the toolbar at the before a target item.
77
- *
78
- * @param at - The target item to insert before.
79
- *
80
- * @param name - The name of the item.
81
- *
82
- * @param widget - The widget to add.
83
- *
84
- * @returns Whether the item was added to the toolbar. Returns false if
85
- * an item of the same name is already in the toolbar.
86
- *
87
- * #### Notes
88
- * The index will be clamped to the bounds of the items.
89
- * The item can be removed from the toolbar by setting its parent to `null`.
90
- */
91
- insertBefore(at: string, name: string, widget: T): boolean;
92
- private _insertRelative;
93
- /**
94
- * Handle the DOM events for the widget.
95
- *
96
- * @param event - The DOM event sent to the widget.
97
- *
98
- * #### Notes
99
- * This method implements the DOM `EventListener` interface and is
100
- * called in response to events on the dock panel's node. It should
101
- * not be called directly by user code.
102
- */
103
- handleEvent(event: Event): void;
104
- /**
105
- * Handle a DOM click event.
106
- */
107
- protected handleClick(event: Event): void;
108
- /**
109
- * Handle `after-attach` messages for the widget.
110
- */
111
- protected onAfterAttach(msg: Message): void;
112
- /**
113
- * Handle `before-detach` messages for the widget.
114
- */
115
- protected onBeforeDetach(msg: Message): void;
116
- }
117
- /**
118
- * A class which provides a toolbar widget.
119
- */
120
- export declare class ReactiveToolbar extends Toolbar<Widget> {
121
- /**
122
- * Construct a new toolbar widget.
123
- */
124
- constructor();
125
- /**
126
- * Dispose of the widget and its descendant widgets.
127
- */
128
- dispose(): void;
129
- /**
130
- * Insert an item into the toolbar at the after a target item.
131
- *
132
- * @param at - The target item to insert after.
133
- *
134
- * @param name - The name of the item.
135
- *
136
- * @param widget - The widget to add.
137
- *
138
- * @returns Whether the item was added to the toolbar. Returns false if
139
- * an item of the same name is already in the toolbar or if the target
140
- * is the toolbar pop-up opener.
141
- *
142
- * #### Notes
143
- * The index will be clamped to the bounds of the items.
144
- * The item can be removed from the toolbar by setting its parent to `null`.
145
- */
146
- insertAfter(at: string, name: string, widget: Widget): boolean;
147
- /**
148
- * Insert an item into the toolbar at the specified index.
149
- *
150
- * @param index - The index at which to insert the item.
151
- *
152
- * @param name - The name of the item.
153
- *
154
- * @param widget - The widget to add.
155
- *
156
- * @returns Whether the item was added to the toolbar. Returns false if
157
- * an item of the same name is already in the toolbar.
158
- *
159
- * #### Notes
160
- * The index will be clamped to the bounds of the items.
161
- * The item can be removed from the toolbar by setting its parent to `null`.
162
- */
163
- insertItem(index: number, name: string, widget: Widget): boolean;
164
- /**
165
- * A message handler invoked on a `'before-hide'` message.
166
- *
167
- * It will hide the pop-up panel
168
- */
169
- onBeforeHide(msg: Message): void;
170
- protected onResize(msg: Widget.ResizeMessage): void;
171
- private _onResize;
172
- private _saveWidgetWidth;
173
- private _getWidgetWidth;
174
- protected readonly popupOpener: ToolbarPopupOpener;
175
- private readonly _widgetWidths;
176
- private readonly _resizer;
177
- }
178
4
  /**
179
5
  * The namespace for Toolbar class statics.
180
6
  */
181
7
  export declare namespace Toolbar {
182
- /**
183
- * The options used to create a toolbar.
184
- */
185
- interface IOptions {
186
- /**
187
- * Toolbar widget layout.
188
- */
189
- layout?: Layout;
190
- }
191
- /**
192
- * Widget with associated toolbar
193
- */
194
- interface IWidgetToolbar extends Widget {
195
- /**
196
- * Toolbar of actions on the widget
197
- */
198
- toolbar?: Toolbar;
199
- }
200
8
  /**
201
9
  * Create an interrupt toolbar item.
202
10
  *
@@ -211,14 +19,6 @@ export declare namespace Toolbar {
211
19
  * This is dead code now.
212
20
  */
213
21
  function createRestartButton(sessionContext: ISessionContext, dialogs?: ISessionContext.IDialogs, translator?: ITranslator): Widget;
214
- /**
215
- * Create a toolbar spacer item.
216
- *
217
- * #### Notes
218
- * It is a flex spacer that separates the left toolbar items
219
- * from the right toolbar items.
220
- */
221
- function createSpacerItem(): Widget;
222
22
  /**
223
23
  * Create a kernel name indicator item.
224
24
  *
@@ -237,237 +37,3 @@ export declare namespace Toolbar {
237
37
  */
238
38
  function createKernelStatusItem(sessionContext: ISessionContext, translator?: ITranslator): Widget;
239
39
  }
240
- /**
241
- * Namespace for ToolbarButtonComponent.
242
- */
243
- export declare namespace ToolbarButtonComponent {
244
- /**
245
- * Interface for ToolbarButtonComponent props.
246
- */
247
- interface IProps {
248
- className?: string;
249
- /**
250
- * Data set of the button
251
- */
252
- dataset?: DOMStringMap;
253
- label?: string;
254
- icon?: LabIcon.IMaybeResolvable;
255
- iconClass?: string;
256
- iconLabel?: string;
257
- tooltip?: string;
258
- onClick?: () => void;
259
- enabled?: boolean;
260
- pressed?: boolean;
261
- pressedIcon?: LabIcon.IMaybeResolvable;
262
- pressedTooltip?: string;
263
- disabledTooltip?: string;
264
- /**
265
- * Trigger the button on the actual onClick event rather than onMouseDown.
266
- *
267
- * See note in ToolbarButtonComponent below as to why the default is to
268
- * trigger on onMouseDown.
269
- */
270
- actualOnClick?: boolean;
271
- /**
272
- * The application language translator.
273
- */
274
- translator?: ITranslator;
275
- }
276
- }
277
- /**
278
- * React component for a toolbar button.
279
- *
280
- * @param props - The props for ToolbarButtonComponent.
281
- */
282
- export declare function ToolbarButtonComponent(props: ToolbarButtonComponent.IProps): JSX.Element;
283
- /**
284
- * Adds the toolbar button class to the toolbar widget.
285
- * @param w Toolbar button widget.
286
- */
287
- export declare function addToolbarButtonClass(w: Widget): Widget;
288
- /**
289
- * Phosphor Widget version of static ToolbarButtonComponent.
290
- */
291
- export declare class ToolbarButton extends ReactWidget {
292
- private props;
293
- /**
294
- * Creates a toolbar button
295
- * @param props props for underlying `ToolbarButton` component
296
- */
297
- constructor(props?: ToolbarButtonComponent.IProps);
298
- /**
299
- * Sets the pressed state for the button
300
- * @param value true if button is pressed, false otherwise
301
- */
302
- set pressed(value: boolean);
303
- /**
304
- * Returns true if button is pressed, false otherwise
305
- */
306
- get pressed(): boolean;
307
- /**
308
- * Sets the enabled state for the button
309
- * @param value true to enable the button, false otherwise
310
- */
311
- set enabled(value: boolean);
312
- /**
313
- * Returns true if button is enabled, false otherwise
314
- */
315
- get enabled(): boolean;
316
- /**
317
- * Sets the click handler for the button
318
- * @param value click handler
319
- */
320
- set onClick(value: () => void);
321
- /**
322
- * Returns the click handler for the button
323
- */
324
- get onClick(): () => void;
325
- render(): JSX.Element;
326
- private _pressed;
327
- private _enabled;
328
- private _onClick;
329
- }
330
- /**
331
- * Namespace for CommandToolbarButtonComponent.
332
- */
333
- export declare namespace CommandToolbarButtonComponent {
334
- /**
335
- * Interface for CommandToolbarButtonComponent props.
336
- */
337
- interface IProps {
338
- /**
339
- * Application commands registry
340
- */
341
- commands: CommandRegistry;
342
- /**
343
- * Command unique id
344
- */
345
- id: string;
346
- /**
347
- * Command arguments
348
- */
349
- args?: ReadonlyJSONObject;
350
- /**
351
- * Overrides command icon
352
- */
353
- icon?: LabIcon;
354
- /**
355
- * Overrides command label
356
- */
357
- label?: string;
358
- }
359
- }
360
- /**
361
- * React component for a toolbar button that wraps a command.
362
- *
363
- * This wraps the ToolbarButtonComponent and watches the command registry
364
- * for changes to the command.
365
- */
366
- export declare function CommandToolbarButtonComponent(props: CommandToolbarButtonComponent.IProps): JSX.Element;
367
- export declare function addCommandToolbarButtonClass(w: Widget): Widget;
368
- /**
369
- * Phosphor Widget version of CommandToolbarButtonComponent.
370
- */
371
- export declare class CommandToolbarButton extends ReactWidget {
372
- private props;
373
- /**
374
- * Creates a command toolbar button
375
- * @param props props for underlying `CommandToolbarButtonComponent` component
376
- */
377
- constructor(props: CommandToolbarButtonComponent.IProps);
378
- render(): JSX.Element;
379
- }
380
- /**
381
- * A class which provides a toolbar popup
382
- * used to store widgets that don't fit
383
- * in the toolbar when it is resized
384
- */
385
- declare class ToolbarPopup extends Widget {
386
- width: number;
387
- /**
388
- * Construct a new ToolbarPopup
389
- */
390
- constructor();
391
- /**
392
- * Updates the width of the popup, this
393
- * should match with the toolbar width
394
- *
395
- * @param width - The width to resize to
396
- * @protected
397
- */
398
- updateWidth(width: number): void;
399
- /**
400
- * Aligns the popup to left bottom of widget
401
- *
402
- * @param widget the widget to align to
403
- * @private
404
- */
405
- alignTo(widget: Widget): void;
406
- /**
407
- * Inserts the widget at specified index
408
- * @param index the index
409
- * @param widget widget to add
410
- */
411
- insertWidget(index: number, widget: Widget): void;
412
- /**
413
- * Total number of widgets in the popup
414
- */
415
- widgetCount(): number;
416
- /**
417
- * Returns the widget at index
418
- * @param index the index
419
- */
420
- widgetAt(index: number): Widget;
421
- }
422
- /**
423
- * A class that provides a ToolbarPopupOpener,
424
- * which is a button added to toolbar when
425
- * the toolbar items overflow toolbar width
426
- */
427
- declare class ToolbarPopupOpener extends ToolbarButton {
428
- /**
429
- * Create a new popup opener
430
- */
431
- constructor();
432
- /**
433
- * Add widget to the popup, prepends widgets
434
- * @param widget the widget to add
435
- */
436
- addWidget(widget: Widget): void;
437
- /**
438
- * Dispose of the widget and its descendant widgets.
439
- *
440
- * #### Notes
441
- * It is unsafe to use the widget after it has been disposed.
442
- *
443
- * All calls made to this method after the first are a no-op.
444
- */
445
- dispose(): void;
446
- /**
447
- * Hides the opener and the popup
448
- */
449
- hide(): void;
450
- /**
451
- * Hides the popup
452
- */
453
- hidePopup(): void;
454
- /**
455
- * Updates width and position of the popup
456
- * to align with the toolbar
457
- */
458
- updatePopup(): void;
459
- /**
460
- * Returns widget at index in the popup
461
- * @param index
462
- */
463
- widgetAt(index: number): Widget;
464
- /**
465
- * Returns total number of widgets in the popup
466
- *
467
- * @returns Number of widgets
468
- */
469
- widgetCount(): number;
470
- protected handleClick(): void;
471
- protected popup: ToolbarPopup;
472
- }
473
- export {};