@jupyterlab/apputils 0.18.2 → 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/LICENSE +34 -0
- package/lib/clientsession.js +3 -8
- package/lib/mainareawidget.d.ts +0 -19
- package/lib/mainareawidget.js +0 -40
- package/lib/sanitizer.d.ts +8 -0
- package/lib/sanitizer.js +869 -22
- package/lib/splash.d.ts +3 -1
- package/lib/thememanager.js +1 -1
- package/lib/toolbar.d.ts +1 -0
- package/lib/toolbar.js +7 -2
- package/package.json +20 -14
- package/style/index.css +1 -0
- package/style/materialcolors.css +278 -0
- package/lib/clientsession.js.map +0 -1
- package/lib/clipboard.js.map +0 -1
- package/lib/commandlinker.js.map +0 -1
- package/lib/commandpalette.js.map +0 -1
- package/lib/dialog.js.map +0 -1
- package/lib/domutils.js.map +0 -1
- package/lib/hoverbox.js.map +0 -1
- package/lib/iframe.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/instancetracker.js.map +0 -1
- package/lib/mainareawidget.js.map +0 -1
- package/lib/sanitizer.js.map +0 -1
- package/lib/spinner.js.map +0 -1
- package/lib/splash.js.map +0 -1
- package/lib/styling.js.map +0 -1
- package/lib/thememanager.js.map +0 -1
- package/lib/toolbar.js.map +0 -1
- package/lib/vdom.js.map +0 -1
- package/lib/windowresolver.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Copyright (c) 2015 Project Jupyter Contributors
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
15
|
+
contributors may be used to endorse or promote products derived from
|
|
16
|
+
this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
22
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
23
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
25
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
26
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
|
|
29
|
+
Semver File License
|
|
30
|
+
===================
|
|
31
|
+
|
|
32
|
+
The semver.py file is from https://github.com/podhmo/python-semver
|
|
33
|
+
which is licensed under the "MIT" license. See the semver.py file for details.
|
|
34
|
+
|
package/lib/clientsession.js
CHANGED
|
@@ -720,7 +720,6 @@ var Private;
|
|
|
720
720
|
while (node.firstChild) {
|
|
721
721
|
node.removeChild(node.firstChild);
|
|
722
722
|
}
|
|
723
|
-
let maxLength = 10;
|
|
724
723
|
let { preference, sessions, specs } = options;
|
|
725
724
|
let { name, id, language, canStart, shouldStart } = preference;
|
|
726
725
|
if (!specs || canStart === false) {
|
|
@@ -736,7 +735,6 @@ var Private;
|
|
|
736
735
|
for (let name in specs.kernelspecs) {
|
|
737
736
|
let spec = specs.kernelspecs[name];
|
|
738
737
|
displayNames[name] = spec.display_name;
|
|
739
|
-
maxLength = Math.max(maxLength, displayNames[name].length);
|
|
740
738
|
languages[name] = spec.language;
|
|
741
739
|
}
|
|
742
740
|
// Handle a kernel by name.
|
|
@@ -819,7 +817,7 @@ var Private;
|
|
|
819
817
|
});
|
|
820
818
|
algorithm_1.each(matchingSessions, session => {
|
|
821
819
|
let name = displayNames[session.kernel.name];
|
|
822
|
-
matching.appendChild(optionForSession(session, name
|
|
820
|
+
matching.appendChild(optionForSession(session, name));
|
|
823
821
|
});
|
|
824
822
|
}
|
|
825
823
|
let otherSessionsNode = document.createElement('optgroup');
|
|
@@ -831,7 +829,7 @@ var Private;
|
|
|
831
829
|
});
|
|
832
830
|
algorithm_1.each(otherSessions, session => {
|
|
833
831
|
let name = displayNames[session.kernel.name] || session.kernel.name;
|
|
834
|
-
otherSessionsNode.appendChild(optionForSession(session, name
|
|
832
|
+
otherSessionsNode.appendChild(optionForSession(session, name));
|
|
835
833
|
});
|
|
836
834
|
}
|
|
837
835
|
}
|
|
@@ -870,12 +868,9 @@ var Private;
|
|
|
870
868
|
/**
|
|
871
869
|
* Create an option element for a session.
|
|
872
870
|
*/
|
|
873
|
-
function optionForSession(session, displayName
|
|
871
|
+
function optionForSession(session, displayName) {
|
|
874
872
|
let option = document.createElement('option');
|
|
875
873
|
let sessionName = session.name || coreutils_1.PathExt.basename(session.path);
|
|
876
|
-
if (sessionName.length > maxLength) {
|
|
877
|
-
sessionName = sessionName.slice(0, maxLength - 3) + '...';
|
|
878
|
-
}
|
|
879
874
|
option.text = sessionName;
|
|
880
875
|
option.value = JSON.stringify({ id: session.kernel.id });
|
|
881
876
|
option.title =
|
package/lib/mainareawidget.d.ts
CHANGED
|
@@ -33,25 +33,6 @@ export declare class MainAreaWidget<T extends Widget = Widget> extends Widget {
|
|
|
33
33
|
* A promise that resolves when the widget is revealed.
|
|
34
34
|
*/
|
|
35
35
|
readonly revealed: Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Handle the DOM events for the widget.
|
|
38
|
-
*
|
|
39
|
-
* @param event - The DOM event sent to the widget.
|
|
40
|
-
*
|
|
41
|
-
* #### Notes
|
|
42
|
-
* This method implements the DOM `EventListener` interface and is
|
|
43
|
-
* called in response to events on the main area widget's node. It should
|
|
44
|
-
* not be called directly by user code.
|
|
45
|
-
*/
|
|
46
|
-
handleEvent(event: Event): void;
|
|
47
|
-
/**
|
|
48
|
-
* Handle `after-attach` messages for the widget.
|
|
49
|
-
*/
|
|
50
|
-
protected onAfterAttach(msg: Message): void;
|
|
51
|
-
/**
|
|
52
|
-
* Handle `before-detach` messages for the widget.
|
|
53
|
-
*/
|
|
54
|
-
protected onBeforeDetach(msg: Message): void;
|
|
55
36
|
/**
|
|
56
37
|
* Handle `'activate-request'` messages.
|
|
57
38
|
*/
|
package/lib/mainareawidget.js
CHANGED
|
@@ -113,46 +113,6 @@ class MainAreaWidget extends widgets_1.Widget {
|
|
|
113
113
|
get revealed() {
|
|
114
114
|
return this._revealed;
|
|
115
115
|
}
|
|
116
|
-
/**
|
|
117
|
-
* Handle the DOM events for the widget.
|
|
118
|
-
*
|
|
119
|
-
* @param event - The DOM event sent to the widget.
|
|
120
|
-
*
|
|
121
|
-
* #### Notes
|
|
122
|
-
* This method implements the DOM `EventListener` interface and is
|
|
123
|
-
* called in response to events on the main area widget's node. It should
|
|
124
|
-
* not be called directly by user code.
|
|
125
|
-
*/
|
|
126
|
-
handleEvent(event) {
|
|
127
|
-
switch (event.type) {
|
|
128
|
-
case 'mouseup':
|
|
129
|
-
case 'mouseout':
|
|
130
|
-
let target = event.target;
|
|
131
|
-
if (this._isRevealed &&
|
|
132
|
-
this._content &&
|
|
133
|
-
this.toolbar.node.contains(document.activeElement) &&
|
|
134
|
-
target.tagName !== 'SELECT') {
|
|
135
|
-
this._focusContent();
|
|
136
|
-
}
|
|
137
|
-
break;
|
|
138
|
-
default:
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Handle `after-attach` messages for the widget.
|
|
144
|
-
*/
|
|
145
|
-
onAfterAttach(msg) {
|
|
146
|
-
this.toolbar.node.addEventListener('mouseup', this);
|
|
147
|
-
this.toolbar.node.addEventListener('mouseout', this);
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Handle `before-detach` messages for the widget.
|
|
151
|
-
*/
|
|
152
|
-
onBeforeDetach(msg) {
|
|
153
|
-
this.toolbar.node.removeEventListener('mouseup', this);
|
|
154
|
-
this.toolbar.node.removeEventListener('mouseout', this);
|
|
155
|
-
}
|
|
156
116
|
/**
|
|
157
117
|
* Handle `'activate-request'` messages.
|
|
158
118
|
*/
|
package/lib/sanitizer.d.ts
CHANGED
|
@@ -28,6 +28,14 @@ export declare namespace ISanitizer {
|
|
|
28
28
|
allowedAttributes?: {
|
|
29
29
|
[key: string]: string[];
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* The allowed style values for a given tag.
|
|
33
|
+
*/
|
|
34
|
+
allowedStyles?: {
|
|
35
|
+
[key: string]: {
|
|
36
|
+
[key: string]: RegExp[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
/**
|