@jupyterlab/apputils 0.19.1-alpha.0 → 0.19.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/spinner.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { Message } from '@phosphor/messaging';
2
- import { Widget } from '@phosphor/widgets';
3
- /**
4
- * The spinner class.
5
- */
6
- export declare class Spinner extends Widget {
7
- /**
8
- * Construct a spinner widget.
9
- */
10
- constructor();
11
- /**
12
- * Handle `'activate-request'` messages.
13
- */
14
- protected onActivateRequest(msg: Message): void;
15
- }
1
+ import { Message } from '@phosphor/messaging';
2
+ import { Widget } from '@phosphor/widgets';
3
+ /**
4
+ * The spinner class.
5
+ */
6
+ export declare class Spinner extends Widget {
7
+ /**
8
+ * Construct a spinner widget.
9
+ */
10
+ constructor();
11
+ /**
12
+ * Handle `'activate-request'` messages.
13
+ */
14
+ protected onActivateRequest(msg: Message): void;
15
+ }
package/lib/spinner.js CHANGED
@@ -1,30 +1,30 @@
1
- "use strict";
2
- /*-----------------------------------------------------------------------------
3
- | Copyright (c) Jupyter Development Team.
4
- | Distributed under the terms of the Modified BSD License.
5
- |----------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const widgets_1 = require("@phosphor/widgets");
8
- /**
9
- * The spinner class.
10
- */
11
- class Spinner extends widgets_1.Widget {
12
- /**
13
- * Construct a spinner widget.
14
- */
15
- constructor() {
16
- super();
17
- this.addClass('jp-Spinner');
18
- this.node.tabIndex = -1;
19
- let content = document.createElement('div');
20
- content.className = 'jp-SpinnerContent';
21
- this.node.appendChild(content);
22
- }
23
- /**
24
- * Handle `'activate-request'` messages.
25
- */
26
- onActivateRequest(msg) {
27
- this.node.focus();
28
- }
29
- }
30
- exports.Spinner = Spinner;
1
+ "use strict";
2
+ /*-----------------------------------------------------------------------------
3
+ | Copyright (c) Jupyter Development Team.
4
+ | Distributed under the terms of the Modified BSD License.
5
+ |----------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const widgets_1 = require("@phosphor/widgets");
8
+ /**
9
+ * The spinner class.
10
+ */
11
+ class Spinner extends widgets_1.Widget {
12
+ /**
13
+ * Construct a spinner widget.
14
+ */
15
+ constructor() {
16
+ super();
17
+ this.addClass('jp-Spinner');
18
+ this.node.tabIndex = -1;
19
+ let content = document.createElement('div');
20
+ content.className = 'jp-SpinnerContent';
21
+ this.node.appendChild(content);
22
+ }
23
+ /**
24
+ * Handle `'activate-request'` messages.
25
+ */
26
+ onActivateRequest(msg) {
27
+ this.node.focus();
28
+ }
29
+ }
30
+ exports.Spinner = Spinner;
package/lib/splash.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- import { IDisposable } from '@phosphor/disposable';
2
- import { Token } from '@phosphor/coreutils';
3
- /**
4
- * The main menu token.
5
- */
6
- export declare const ISplashScreen: Token<ISplashScreen>;
7
- /**
8
- * The interface for an application splash screen.
9
- */
10
- export interface ISplashScreen {
11
- /**
12
- * Show the application splash screen.
13
- *
14
- * @param light - Whether to show the light splash screen or the dark one.
15
- *
16
- * @returns A disposable used to clear the splash screen.
17
- */
18
- show(light?: boolean): IDisposable;
19
- }
1
+ import { IDisposable } from '@phosphor/disposable';
2
+ import { Token } from '@phosphor/coreutils';
3
+ /**
4
+ * The main menu token.
5
+ */
6
+ export declare const ISplashScreen: Token<ISplashScreen>;
7
+ /**
8
+ * The interface for an application splash screen.
9
+ */
10
+ export interface ISplashScreen {
11
+ /**
12
+ * Show the application splash screen.
13
+ *
14
+ * @param light - Whether to show the light splash screen or the dark one.
15
+ *
16
+ * @returns A disposable used to clear the splash screen.
17
+ */
18
+ show(light?: boolean): IDisposable;
19
+ }
package/lib/splash.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";
2
- // Copyright (c) Jupyter Development Team.
3
- // Distributed under the terms of the Modified BSD License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- const coreutils_1 = require("@phosphor/coreutils");
6
- /* tslint:disable */
7
- /**
8
- * The main menu token.
9
- */
10
- exports.ISplashScreen = new coreutils_1.Token('@jupyterlab/apputils:ISplashScreen');
1
+ "use strict";
2
+ // Copyright (c) Jupyter Development Team.
3
+ // Distributed under the terms of the Modified BSD License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ const coreutils_1 = require("@phosphor/coreutils");
6
+ /* tslint:disable */
7
+ /**
8
+ * The main menu token.
9
+ */
10
+ exports.ISplashScreen = new coreutils_1.Token('@jupyterlab/apputils:ISplashScreen');
package/lib/styling.d.ts CHANGED
@@ -1,27 +1,27 @@
1
- /**
2
- * A namespace for node styling.
3
- */
4
- export declare namespace Styling {
5
- /**
6
- * Style a node and its child elements with the default tag names.
7
- *
8
- * @param node - The base node.
9
- *
10
- * @param className - The optional CSS class to add to styled nodes.
11
- */
12
- function styleNode(node: HTMLElement, className?: string): void;
13
- /**
14
- * Style a node and its elements that have a given tag name.
15
- *
16
- * @param node - The base node.
17
- *
18
- * @param tagName - The html tag name to style.
19
- *
20
- * @param className - The optional CSS class to add to styled nodes.
21
- */
22
- function styleNodeByTag(node: HTMLElement, tagName: string, className?: string): void;
23
- /**
24
- * Wrap a select node.
25
- */
26
- function wrapSelect(node: HTMLSelectElement): HTMLElement;
27
- }
1
+ /**
2
+ * A namespace for node styling.
3
+ */
4
+ export declare namespace Styling {
5
+ /**
6
+ * Style a node and its child elements with the default tag names.
7
+ *
8
+ * @param node - The base node.
9
+ *
10
+ * @param className - The optional CSS class to add to styled nodes.
11
+ */
12
+ function styleNode(node: HTMLElement, className?: string): void;
13
+ /**
14
+ * Style a node and its elements that have a given tag name.
15
+ *
16
+ * @param node - The base node.
17
+ *
18
+ * @param tagName - The html tag name to style.
19
+ *
20
+ * @param className - The optional CSS class to add to styled nodes.
21
+ */
22
+ function styleNodeByTag(node: HTMLElement, tagName: string, className?: string): void;
23
+ /**
24
+ * Wrap a select node.
25
+ */
26
+ function wrapSelect(node: HTMLSelectElement): HTMLElement;
27
+ }
package/lib/styling.js CHANGED
@@ -1,92 +1,92 @@
1
- "use strict";
2
- // Copyright (c) Jupyter Development Team.
3
- // Distributed under the terms of the Modified BSD License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- /**
6
- * A namespace for node styling.
7
- */
8
- var Styling;
9
- (function (Styling) {
10
- /**
11
- * Style a node and its child elements with the default tag names.
12
- *
13
- * @param node - The base node.
14
- *
15
- * @param className - The optional CSS class to add to styled nodes.
16
- */
17
- function styleNode(node, className = '') {
18
- styleNodeByTag(node, 'select', className);
19
- styleNodeByTag(node, 'textarea', className);
20
- styleNodeByTag(node, 'input', className);
21
- styleNodeByTag(node, 'button', className);
22
- }
23
- Styling.styleNode = styleNode;
24
- /**
25
- * Style a node and its elements that have a given tag name.
26
- *
27
- * @param node - The base node.
28
- *
29
- * @param tagName - The html tag name to style.
30
- *
31
- * @param className - The optional CSS class to add to styled nodes.
32
- */
33
- function styleNodeByTag(node, tagName, className = '') {
34
- if (node.localName === tagName) {
35
- node.classList.add('jp-mod-styled');
36
- }
37
- if (node.localName === 'select') {
38
- wrapSelect(node);
39
- }
40
- let nodes = node.getElementsByTagName(tagName);
41
- for (let i = 0; i < nodes.length; i++) {
42
- let child = nodes[i];
43
- child.classList.add('jp-mod-styled');
44
- if (className) {
45
- child.classList.add(className);
46
- }
47
- if (tagName === 'select') {
48
- wrapSelect(child);
49
- }
50
- }
51
- }
52
- Styling.styleNodeByTag = styleNodeByTag;
53
- /**
54
- * Wrap a select node.
55
- */
56
- function wrapSelect(node) {
57
- let wrapper = document.createElement('div');
58
- wrapper.classList.add('jp-select-wrapper');
59
- node.addEventListener('focus', Private.onFocus);
60
- node.addEventListener('blur', Private.onFocus);
61
- node.classList.add('jp-mod-styled');
62
- if (node.parentElement) {
63
- node.parentElement.replaceChild(wrapper, node);
64
- }
65
- wrapper.appendChild(node);
66
- return wrapper;
67
- }
68
- Styling.wrapSelect = wrapSelect;
69
- })(Styling = exports.Styling || (exports.Styling = {}));
70
- /**
71
- * The namespace for module private data.
72
- */
73
- var Private;
74
- (function (Private) {
75
- /**
76
- * Handle a focus event on a styled select.
77
- */
78
- function onFocus(event) {
79
- let target = event.target;
80
- let parent = target.parentElement;
81
- if (!parent) {
82
- return;
83
- }
84
- if (event.type === 'focus') {
85
- parent.classList.add('jp-mod-focused');
86
- }
87
- else {
88
- parent.classList.remove('jp-mod-focused');
89
- }
90
- }
91
- Private.onFocus = onFocus;
92
- })(Private || (Private = {}));
1
+ "use strict";
2
+ // Copyright (c) Jupyter Development Team.
3
+ // Distributed under the terms of the Modified BSD License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ /**
6
+ * A namespace for node styling.
7
+ */
8
+ var Styling;
9
+ (function (Styling) {
10
+ /**
11
+ * Style a node and its child elements with the default tag names.
12
+ *
13
+ * @param node - The base node.
14
+ *
15
+ * @param className - The optional CSS class to add to styled nodes.
16
+ */
17
+ function styleNode(node, className = '') {
18
+ styleNodeByTag(node, 'select', className);
19
+ styleNodeByTag(node, 'textarea', className);
20
+ styleNodeByTag(node, 'input', className);
21
+ styleNodeByTag(node, 'button', className);
22
+ }
23
+ Styling.styleNode = styleNode;
24
+ /**
25
+ * Style a node and its elements that have a given tag name.
26
+ *
27
+ * @param node - The base node.
28
+ *
29
+ * @param tagName - The html tag name to style.
30
+ *
31
+ * @param className - The optional CSS class to add to styled nodes.
32
+ */
33
+ function styleNodeByTag(node, tagName, className = '') {
34
+ if (node.localName === tagName) {
35
+ node.classList.add('jp-mod-styled');
36
+ }
37
+ if (node.localName === 'select') {
38
+ wrapSelect(node);
39
+ }
40
+ let nodes = node.getElementsByTagName(tagName);
41
+ for (let i = 0; i < nodes.length; i++) {
42
+ let child = nodes[i];
43
+ child.classList.add('jp-mod-styled');
44
+ if (className) {
45
+ child.classList.add(className);
46
+ }
47
+ if (tagName === 'select') {
48
+ wrapSelect(child);
49
+ }
50
+ }
51
+ }
52
+ Styling.styleNodeByTag = styleNodeByTag;
53
+ /**
54
+ * Wrap a select node.
55
+ */
56
+ function wrapSelect(node) {
57
+ let wrapper = document.createElement('div');
58
+ wrapper.classList.add('jp-select-wrapper');
59
+ node.addEventListener('focus', Private.onFocus);
60
+ node.addEventListener('blur', Private.onFocus);
61
+ node.classList.add('jp-mod-styled');
62
+ if (node.parentElement) {
63
+ node.parentElement.replaceChild(wrapper, node);
64
+ }
65
+ wrapper.appendChild(node);
66
+ return wrapper;
67
+ }
68
+ Styling.wrapSelect = wrapSelect;
69
+ })(Styling = exports.Styling || (exports.Styling = {}));
70
+ /**
71
+ * The namespace for module private data.
72
+ */
73
+ var Private;
74
+ (function (Private) {
75
+ /**
76
+ * Handle a focus event on a styled select.
77
+ */
78
+ function onFocus(event) {
79
+ let target = event.target;
80
+ let parent = target.parentElement;
81
+ if (!parent) {
82
+ return;
83
+ }
84
+ if (event.type === 'focus') {
85
+ parent.classList.add('jp-mod-focused');
86
+ }
87
+ else {
88
+ parent.classList.remove('jp-mod-focused');
89
+ }
90
+ }
91
+ Private.onFocus = onFocus;
92
+ })(Private || (Private = {}));
@@ -1,141 +1,141 @@
1
- import { IChangedArgs, ISettingRegistry } from '@jupyterlab/coreutils';
2
- import { Token } from '@phosphor/coreutils';
3
- import { IDisposable } from '@phosphor/disposable';
4
- import { Widget } from '@phosphor/widgets';
5
- import { ISignal } from '@phosphor/signaling';
6
- import { ISplashScreen } from './splash';
7
- /**
8
- * The theme manager token.
9
- */
10
- export declare const IThemeManager: Token<IThemeManager>;
11
- /**
12
- * An interface for a theme manager.
13
- */
14
- export interface IThemeManager extends ThemeManager {
15
- }
16
- /**
17
- * A class that provides theme management.
18
- */
19
- export declare class ThemeManager {
20
- /**
21
- * Construct a new theme manager.
22
- */
23
- constructor(options: ThemeManager.IOptions);
24
- /**
25
- * Get the name of the current theme.
26
- */
27
- readonly theme: string | null;
28
- /**
29
- * The names of the registered themes.
30
- */
31
- readonly themes: ReadonlyArray<string>;
32
- /**
33
- * A signal fired when the application theme changes.
34
- */
35
- readonly themeChanged: ISignal<this, IChangedArgs<string>>;
36
- /**
37
- * Load a theme CSS file by path.
38
- *
39
- * @param path - The path of the file to load.
40
- */
41
- loadCSS(path: string): Promise<void>;
42
- /**
43
- * Register a theme with the theme manager.
44
- *
45
- * @param theme - The theme to register.
46
- *
47
- * @returns A disposable that can be used to unregister the theme.
48
- */
49
- register(theme: ThemeManager.ITheme): IDisposable;
50
- /**
51
- * Set the current theme.
52
- */
53
- setTheme(name: string): Promise<void>;
54
- /**
55
- * Test whether a given theme is light.
56
- */
57
- isLight(name: string): boolean;
58
- /**
59
- * Handle the current settings.
60
- */
61
- private _loadSettings;
62
- /**
63
- * Load the theme.
64
- *
65
- * #### Notes
66
- * This method assumes that the `theme` exists.
67
- */
68
- private _loadTheme;
69
- /**
70
- * Handle a theme error.
71
- */
72
- private _onError;
73
- private _base;
74
- private _current;
75
- private _host;
76
- private _links;
77
- private _outstanding;
78
- private _pending;
79
- private _requests;
80
- private _settings;
81
- private _splash;
82
- private _themes;
83
- private _themeChanged;
84
- }
85
- /**
86
- * A namespace for `ThemeManager` statics.
87
- */
88
- export declare namespace ThemeManager {
89
- /**
90
- * The options used to create a theme manager.
91
- */
92
- interface IOptions {
93
- /**
94
- * The host widget for the theme manager.
95
- */
96
- host: Widget;
97
- /**
98
- * The setting registry key that holds theme setting data.
99
- */
100
- key: string;
101
- /**
102
- * The settings registry.
103
- */
104
- settings: ISettingRegistry;
105
- /**
106
- * The splash screen to show when loading themes.
107
- */
108
- splash: ISplashScreen;
109
- /**
110
- * The url for local theme loading.
111
- */
112
- url: string;
113
- }
114
- /**
115
- * An interface for a theme.
116
- */
117
- interface ITheme {
118
- /**
119
- * The display name of the theme.
120
- */
121
- name: string;
122
- /**
123
- * Whether the theme is light or dark. Downstream authors
124
- * of extensions can use this information to customize their
125
- * UI depending upon the current theme.
126
- */
127
- isLight: boolean;
128
- /**
129
- * Load the theme.
130
- *
131
- * @returns A promise that resolves when the theme has loaded.
132
- */
133
- load(): Promise<void>;
134
- /**
135
- * Unload the theme.
136
- *
137
- * @returns A promise that resolves when the theme has unloaded.
138
- */
139
- unload(): Promise<void>;
140
- }
141
- }
1
+ import { IChangedArgs, ISettingRegistry } from '@jupyterlab/coreutils';
2
+ import { Token } from '@phosphor/coreutils';
3
+ import { IDisposable } from '@phosphor/disposable';
4
+ import { Widget } from '@phosphor/widgets';
5
+ import { ISignal } from '@phosphor/signaling';
6
+ import { ISplashScreen } from './splash';
7
+ /**
8
+ * The theme manager token.
9
+ */
10
+ export declare const IThemeManager: Token<IThemeManager>;
11
+ /**
12
+ * An interface for a theme manager.
13
+ */
14
+ export interface IThemeManager extends ThemeManager {
15
+ }
16
+ /**
17
+ * A class that provides theme management.
18
+ */
19
+ export declare class ThemeManager {
20
+ /**
21
+ * Construct a new theme manager.
22
+ */
23
+ constructor(options: ThemeManager.IOptions);
24
+ /**
25
+ * Get the name of the current theme.
26
+ */
27
+ readonly theme: string | null;
28
+ /**
29
+ * The names of the registered themes.
30
+ */
31
+ readonly themes: ReadonlyArray<string>;
32
+ /**
33
+ * A signal fired when the application theme changes.
34
+ */
35
+ readonly themeChanged: ISignal<this, IChangedArgs<string>>;
36
+ /**
37
+ * Load a theme CSS file by path.
38
+ *
39
+ * @param path - The path of the file to load.
40
+ */
41
+ loadCSS(path: string): Promise<void>;
42
+ /**
43
+ * Register a theme with the theme manager.
44
+ *
45
+ * @param theme - The theme to register.
46
+ *
47
+ * @returns A disposable that can be used to unregister the theme.
48
+ */
49
+ register(theme: ThemeManager.ITheme): IDisposable;
50
+ /**
51
+ * Set the current theme.
52
+ */
53
+ setTheme(name: string): Promise<void>;
54
+ /**
55
+ * Test whether a given theme is light.
56
+ */
57
+ isLight(name: string): boolean;
58
+ /**
59
+ * Handle the current settings.
60
+ */
61
+ private _loadSettings;
62
+ /**
63
+ * Load the theme.
64
+ *
65
+ * #### Notes
66
+ * This method assumes that the `theme` exists.
67
+ */
68
+ private _loadTheme;
69
+ /**
70
+ * Handle a theme error.
71
+ */
72
+ private _onError;
73
+ private _base;
74
+ private _current;
75
+ private _host;
76
+ private _links;
77
+ private _outstanding;
78
+ private _pending;
79
+ private _requests;
80
+ private _settings;
81
+ private _splash;
82
+ private _themes;
83
+ private _themeChanged;
84
+ }
85
+ /**
86
+ * A namespace for `ThemeManager` statics.
87
+ */
88
+ export declare namespace ThemeManager {
89
+ /**
90
+ * The options used to create a theme manager.
91
+ */
92
+ interface IOptions {
93
+ /**
94
+ * The host widget for the theme manager.
95
+ */
96
+ host: Widget;
97
+ /**
98
+ * The setting registry key that holds theme setting data.
99
+ */
100
+ key: string;
101
+ /**
102
+ * The settings registry.
103
+ */
104
+ settings: ISettingRegistry;
105
+ /**
106
+ * The splash screen to show when loading themes.
107
+ */
108
+ splash: ISplashScreen;
109
+ /**
110
+ * The url for local theme loading.
111
+ */
112
+ url: string;
113
+ }
114
+ /**
115
+ * An interface for a theme.
116
+ */
117
+ interface ITheme {
118
+ /**
119
+ * The display name of the theme.
120
+ */
121
+ name: string;
122
+ /**
123
+ * Whether the theme is light or dark. Downstream authors
124
+ * of extensions can use this information to customize their
125
+ * UI depending upon the current theme.
126
+ */
127
+ isLight: boolean;
128
+ /**
129
+ * Load the theme.
130
+ *
131
+ * @returns A promise that resolves when the theme has loaded.
132
+ */
133
+ load(): Promise<void>;
134
+ /**
135
+ * Unload the theme.
136
+ *
137
+ * @returns A promise that resolves when the theme has unloaded.
138
+ */
139
+ unload(): Promise<void>;
140
+ }
141
+ }