@jupyterlab/extensionmanager 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/dialog.js +2 -2
- package/lib/dialog.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +1 -1
- package/lib/model.d.ts +90 -193
- package/lib/model.js +210 -451
- package/lib/model.js.map +1 -1
- package/lib/widget.d.ts +18 -207
- package/lib/widget.js +201 -317
- package/lib/widget.js.map +1 -1
- package/package.json +16 -15
- package/src/dialog.tsx +39 -0
- package/src/index.ts +9 -0
- package/src/model.ts +691 -0
- package/src/widget.tsx +759 -0
- package/style/base.css +68 -110
- package/style/index.css +1 -1
- package/style/index.js +1 -1
- package/lib/build-helper.d.ts +0 -9
- package/lib/build-helper.js +0 -60
- package/lib/build-helper.js.map +0 -1
- package/lib/companions.d.ts +0 -88
- package/lib/companions.js +0 -98
- package/lib/companions.js.map +0 -1
- package/lib/listings.d.ts +0 -50
- package/lib/listings.js +0 -80
- package/lib/listings.js.map +0 -1
- package/lib/npm.d.ts +0 -223
- package/lib/npm.js +0 -76
- package/lib/npm.js.map +0 -1
package/style/base.css
CHANGED
|
@@ -1,28 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Jupyter Development Team.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
/*
|
|
2
7
|
Main widget layout and styling
|
|
3
8
|
*/
|
|
4
9
|
|
|
5
|
-
.jp-extensionmanager-view {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
.jp-extensionmanager-view .lm-SplitPanel-child {
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.jp-extensionmanager-header {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.jp-extensionmanager-title {
|
|
9
19
|
display: flex;
|
|
10
|
-
|
|
11
|
-
font-size: var(--jp-ui-font-size1);
|
|
20
|
+
margin: 4px 10px 0;
|
|
12
21
|
}
|
|
13
22
|
|
|
14
|
-
.jp-extensionmanager-
|
|
15
|
-
|
|
16
|
-
overflow-x: hidden;
|
|
23
|
+
.jp-extensionmanager-title svg {
|
|
24
|
+
width: 14px;
|
|
17
25
|
}
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
.jp-extensionmanager-title .jp-icon3[fill] {
|
|
28
|
+
fill: currentcolor;
|
|
29
|
+
}
|
|
22
30
|
|
|
23
|
-
.jp-extensionmanager-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
.jp-extensionmanager-path {
|
|
32
|
+
display: inline flex;
|
|
33
|
+
padding-left: 4px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.jp-extensionmanager-header .jp-FilterBox {
|
|
37
|
+
margin: 4px 10px 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.jp-extensionmanager-disclaimer {
|
|
41
|
+
padding: 0 8px;
|
|
42
|
+
min-height: 160px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.jp-extensionmanager-disclaimer a {
|
|
46
|
+
color: var(--jp-content-link-color);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.jp-extensionmanager-disclaimer a:hover {
|
|
50
|
+
color: var(--jp-content-link-color);
|
|
51
|
+
text-decoration: underline;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.jp-extensionmanager-disclaimer .jp-Button {
|
|
55
|
+
margin: 0 5px;
|
|
26
56
|
}
|
|
27
57
|
|
|
28
58
|
/*
|
|
@@ -32,10 +62,9 @@
|
|
|
32
62
|
.jp-extensionmanager-listview-wrapper {
|
|
33
63
|
margin: 0;
|
|
34
64
|
padding: 0;
|
|
35
|
-
padding-bottom: 8px;
|
|
36
65
|
display: flex;
|
|
37
66
|
flex-direction: column;
|
|
38
|
-
|
|
67
|
+
height: 100%;
|
|
39
68
|
}
|
|
40
69
|
|
|
41
70
|
.jp-extensionmanager-listview {
|
|
@@ -43,57 +72,16 @@
|
|
|
43
72
|
margin: 0;
|
|
44
73
|
padding: 0;
|
|
45
74
|
min-height: 0;
|
|
75
|
+
flex: 1 1 auto;
|
|
76
|
+
overflow: auto;
|
|
46
77
|
}
|
|
47
78
|
|
|
48
79
|
/*
|
|
49
80
|
Section headers
|
|
50
81
|
*/
|
|
51
82
|
|
|
52
|
-
.jp-extensionmanager-view .jp-
|
|
53
|
-
|
|
54
|
-
justify-content: space-between;
|
|
55
|
-
flex: 0 0 auto;
|
|
56
|
-
margin: 0;
|
|
57
|
-
font-weight: 600;
|
|
58
|
-
text-transform: uppercase;
|
|
59
|
-
border-bottom: var(--jp-border-width) solid var(--jp-border-color2);
|
|
60
|
-
letter-spacing: 1px;
|
|
61
|
-
font-size: var(--jp-ui-font-size0);
|
|
62
|
-
line-height: 24px;
|
|
63
|
-
height: 24px;
|
|
64
|
-
padding: 4px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.jp-extensionmanager-view .jp-stack-panel-header > .jp-ToolbarButtonComponent {
|
|
68
|
-
padding: 0 2px;
|
|
69
|
-
border: 1px solid transparent;
|
|
70
|
-
background-color: var(--jp-layout-color1);
|
|
71
|
-
color: var(--jp-ui-font-color1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.jp-extensionmanager-view
|
|
75
|
-
.jp-stack-panel-header
|
|
76
|
-
.jp-extensionmanager-headerText {
|
|
77
|
-
flex: 1 0 auto;
|
|
78
|
-
margin: 0 4px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.jp-extensionmanager-view
|
|
82
|
-
.jp-stack-panel-header
|
|
83
|
-
.jp-extensionmanager-headerTextDisabled {
|
|
84
|
-
flex: 1 0 auto;
|
|
85
|
-
margin: 0 4px;
|
|
86
|
-
color: var(--jp-layout-color3);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/*
|
|
90
|
-
Listing messages
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
.jp-extensionmanager-listingmessage {
|
|
94
|
-
background-color: var(--jp-brand-color1);
|
|
95
|
-
color: var(--jp-ui-inverse-font-color1);
|
|
96
|
-
padding: 4px 8px;
|
|
83
|
+
.jp-extensionmanager-view .jp-SidePanel-header .jp-extensionmanager-error {
|
|
84
|
+
text-transform: none;
|
|
97
85
|
font-size: var(--jp-ui-font-size1);
|
|
98
86
|
font-weight: 400;
|
|
99
87
|
}
|
|
@@ -106,71 +94,44 @@
|
|
|
106
94
|
white-space: pre-wrap;
|
|
107
95
|
}
|
|
108
96
|
|
|
109
|
-
/*
|
|
110
|
-
Search bar layout and styling
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
.jp-extensionmanager-search-bar {
|
|
114
|
-
padding: 4px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.jp-extensionmanager-disclaimer {
|
|
118
|
-
color: var(--jp-ui-font-color1);
|
|
119
|
-
font-size: var(--jp-ui-font-size1);
|
|
120
|
-
font-weight: normal;
|
|
121
|
-
margin: 8px 8px 8px 32px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.jp-extensionmanager-search-wrapper input {
|
|
125
|
-
background: transparent;
|
|
126
|
-
font-size: var(--jp-ui-font-size1);
|
|
127
|
-
color: var(--jp-ui-font-color0);
|
|
128
|
-
line-height: var(--jp-private-commandpalette-search-height);
|
|
129
|
-
box-sizing: border-box;
|
|
130
|
-
border-radius: 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.jp-extensionmanager-search-wrapper input:focus {
|
|
134
|
-
box-shadow: inset 0 0 0 1px var(--jp-input-active-box-shadow-color),
|
|
135
|
-
inset 0 0 0 3px var(--jp-input-active-box-shadow-color);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
97
|
/*
|
|
139
98
|
List view pagination styling
|
|
140
99
|
*/
|
|
141
100
|
|
|
142
101
|
.jp-extensionmanager-view ul.pagination {
|
|
143
|
-
display:
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
144
104
|
padding-left: 0;
|
|
145
105
|
padding-right: 0;
|
|
146
106
|
}
|
|
147
107
|
|
|
148
|
-
.jp-extensionmanager-
|
|
108
|
+
.jp-extensionmanager-pagination li {
|
|
149
109
|
display: inline-block;
|
|
150
110
|
}
|
|
151
111
|
|
|
152
|
-
|
|
112
|
+
/* stylelint-disable selector-max-type */
|
|
113
|
+
.jp-extensionmanager-pagination li > a {
|
|
153
114
|
padding: 0 5px;
|
|
154
|
-
|
|
115
|
+
cursor: pointer;
|
|
155
116
|
}
|
|
117
|
+
/* stylelint-enable selector-max-type */
|
|
156
118
|
|
|
157
|
-
.jp-extensionmanager-
|
|
119
|
+
.jp-extensionmanager-pagination li.active > a {
|
|
158
120
|
background: var(--jp-brand-color1);
|
|
159
|
-
color:
|
|
121
|
+
color: var(--jp-layout-color1);
|
|
160
122
|
}
|
|
161
123
|
|
|
162
|
-
.jp-extensionmanager-
|
|
124
|
+
.jp-extensionmanager-pagination li > a:hover {
|
|
163
125
|
background-color: var(--jp-layout-color2);
|
|
164
|
-
color: unset;
|
|
165
126
|
}
|
|
166
127
|
|
|
167
|
-
.jp-extensionmanager-
|
|
128
|
+
.jp-extensionmanager-pagination .break > a {
|
|
168
129
|
cursor: default;
|
|
169
130
|
}
|
|
170
131
|
|
|
171
|
-
.jp-extensionmanager-
|
|
172
|
-
|
|
173
|
-
|
|
132
|
+
.jp-extensionmanager-installedlist,
|
|
133
|
+
.jp-extensionmanager-searchresults {
|
|
134
|
+
min-height: 100px;
|
|
174
135
|
}
|
|
175
136
|
|
|
176
137
|
/*
|
|
@@ -194,6 +155,7 @@
|
|
|
194
155
|
display: flex;
|
|
195
156
|
flex-direction: row;
|
|
196
157
|
justify-content: space-between;
|
|
158
|
+
align-items: center;
|
|
197
159
|
}
|
|
198
160
|
|
|
199
161
|
.jp-extensionmanager-entry.jp-extensionmanager-entry-should-be-uninstalled {
|
|
@@ -212,11 +174,6 @@
|
|
|
212
174
|
padding-left: 4px;
|
|
213
175
|
}
|
|
214
176
|
|
|
215
|
-
/* this is not styled */
|
|
216
|
-
|
|
217
|
-
/* .jp-extensionmanager-entry.jp-extensionmanager-entry-warning {
|
|
218
|
-
} */
|
|
219
|
-
|
|
220
177
|
.jp-extensionmanager-entry-name {
|
|
221
178
|
font-size: var(--jp-ui-font-size1);
|
|
222
179
|
font-weight: 600;
|
|
@@ -313,7 +270,7 @@
|
|
|
313
270
|
*/
|
|
314
271
|
|
|
315
272
|
.jp-extensionmanager-disclaimer-disable {
|
|
316
|
-
background-color: var(--jp-
|
|
273
|
+
background-color: var(--jp-reject-color-normal) !important;
|
|
317
274
|
color: white !important;
|
|
318
275
|
border: 0;
|
|
319
276
|
background-image: none !important;
|
|
@@ -333,7 +290,8 @@
|
|
|
333
290
|
.jp-extensionmanager-entry-buttons {
|
|
334
291
|
display: flex;
|
|
335
292
|
flex-direction: row;
|
|
336
|
-
padding-
|
|
293
|
+
padding-block-start: 4px;
|
|
294
|
+
justify-content: flex-end;
|
|
337
295
|
}
|
|
338
296
|
|
|
339
297
|
/*
|
package/style/index.css
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
|
|
7
|
+
@import url('~@lumino/widgets/style/index.css');
|
|
7
8
|
@import url('~@jupyterlab/ui-components/style/index.css');
|
|
8
9
|
@import url('~@jupyterlab/apputils/style/index.css');
|
|
9
|
-
@import url('~@jupyterlab/application/style/index.css');
|
|
10
10
|
|
|
11
11
|
@import url('./base.css');
|
package/style/index.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
/* This file was auto-generated by ensurePackage() in @jupyterlab/buildutils */
|
|
7
|
+
import '@lumino/widgets/style/index.js';
|
|
7
8
|
import '@jupyterlab/ui-components/style/index.js';
|
|
8
9
|
import '@jupyterlab/apputils/style/index.js';
|
|
9
|
-
import '@jupyterlab/application/style/index.js';
|
|
10
10
|
|
|
11
11
|
import './base.css';
|
package/lib/build-helper.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { JupyterFrontEnd } from '@jupyterlab/application';
|
|
2
|
-
import { Builder } from '@jupyterlab/services';
|
|
3
|
-
import { ITranslator } from '@jupyterlab/translation';
|
|
4
|
-
/**
|
|
5
|
-
* Instruct the server to perform a build
|
|
6
|
-
*
|
|
7
|
-
* @param builder the build manager
|
|
8
|
-
*/
|
|
9
|
-
export declare function doBuild(app: JupyterFrontEnd, builder: Builder.IManager, translator?: ITranslator): Promise<void>;
|
package/lib/build-helper.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Jupyter Development Team.
|
|
2
|
-
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
import { Dialog, showDialog, showErrorMessage } from '@jupyterlab/apputils';
|
|
4
|
-
import { nullTranslator } from '@jupyterlab/translation';
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
/**
|
|
7
|
-
* Instruct the server to perform a build
|
|
8
|
-
*
|
|
9
|
-
* @param builder the build manager
|
|
10
|
-
*/
|
|
11
|
-
export function doBuild(app, builder, translator) {
|
|
12
|
-
translator = translator || nullTranslator;
|
|
13
|
-
const trans = translator.load('jupyterlab');
|
|
14
|
-
if (builder.isAvailable) {
|
|
15
|
-
return builder
|
|
16
|
-
.build()
|
|
17
|
-
.then(() => {
|
|
18
|
-
return showDialog({
|
|
19
|
-
title: trans.__('Build Complete'),
|
|
20
|
-
body: (React.createElement("div", null,
|
|
21
|
-
trans.__('Build successfully completed, reload page?'),
|
|
22
|
-
React.createElement("br", null),
|
|
23
|
-
trans.__('You will lose any unsaved changes.'))),
|
|
24
|
-
buttons: [
|
|
25
|
-
Dialog.cancelButton({
|
|
26
|
-
label: trans.__('Reload Without Saving'),
|
|
27
|
-
actions: ['reload']
|
|
28
|
-
}),
|
|
29
|
-
Dialog.okButton({ label: trans.__('Save and Reload') })
|
|
30
|
-
],
|
|
31
|
-
hasClose: true
|
|
32
|
-
});
|
|
33
|
-
})
|
|
34
|
-
.then(({ button: { accept, actions } }) => {
|
|
35
|
-
if (accept) {
|
|
36
|
-
void app.commands
|
|
37
|
-
.execute('docmanager:save')
|
|
38
|
-
.then(() => {
|
|
39
|
-
location.reload();
|
|
40
|
-
})
|
|
41
|
-
.catch((err) => {
|
|
42
|
-
void showErrorMessage(trans.__('Save Failed'), {
|
|
43
|
-
message: React.createElement("pre", null, err.message)
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
else if (actions.includes('reload')) {
|
|
48
|
-
location.reload();
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
.catch(err => {
|
|
52
|
-
void showDialog({
|
|
53
|
-
title: trans.__('Build Failed'),
|
|
54
|
-
body: React.createElement("pre", null, err.message)
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return Promise.resolve();
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=build-helper.js.map
|
package/lib/build-helper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-helper.js","sourceRoot":"","sources":["../src/build-helper.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,OAAO,CACrB,GAAoB,EACpB,OAAyB,EACzB,UAAwB;IAExB,UAAU,GAAG,UAAU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AAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBACrC,QAAQ,CAAC,MAAM,EAAE,CAAC;aACnB;QACH,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,CAAC,EAAE;YACX,KAAK,UAAU,CAAC;gBACd,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC;gBAC/B,IAAI,EAAE,iCAAM,GAAG,CAAC,OAAO,CAAO;aAC/B,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACN;IACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
package/lib/companions.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { KernelSpec } from '@jupyterlab/services';
|
|
2
|
-
import { ITranslator } from '@jupyterlab/translation';
|
|
3
|
-
/**
|
|
4
|
-
* An object representing a companion installation info.
|
|
5
|
-
*/
|
|
6
|
-
export interface IInstallInfoEntry {
|
|
7
|
-
/**
|
|
8
|
-
* The name of the companion package/module.
|
|
9
|
-
*/
|
|
10
|
-
name?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the package also includes the lab extension.
|
|
13
|
-
*/
|
|
14
|
-
bundles_extension?: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* An object representing a server extension install info.
|
|
18
|
-
*/
|
|
19
|
-
export interface IInstallInfo {
|
|
20
|
-
/**
|
|
21
|
-
* The base/default install info.
|
|
22
|
-
*/
|
|
23
|
-
base: IInstallInfoEntry;
|
|
24
|
-
/**
|
|
25
|
-
* Which package managers that have the package/module.
|
|
26
|
-
*/
|
|
27
|
-
managers: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Overrides of the base install info on a per-manager basis.
|
|
30
|
-
*/
|
|
31
|
-
overrides?: {
|
|
32
|
-
[key: string]: IInstallInfoEntry | undefined;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* An object representing a kernel companion install info.
|
|
37
|
-
*/
|
|
38
|
-
export interface IKernelInstallInfo extends IInstallInfo {
|
|
39
|
-
/**
|
|
40
|
-
* A specification of which kernels the current install info applies to.
|
|
41
|
-
*/
|
|
42
|
-
kernel_spec: {
|
|
43
|
-
/**
|
|
44
|
-
* A regular expression for matching kernel language.
|
|
45
|
-
*/
|
|
46
|
-
language: string;
|
|
47
|
-
/**
|
|
48
|
-
* A regular expression for matching kernel display name.
|
|
49
|
-
*/
|
|
50
|
-
display_name?: string;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* An object combining a kernel companion install info with matching specs.
|
|
55
|
-
*/
|
|
56
|
-
export declare type KernelCompanion = {
|
|
57
|
-
/**
|
|
58
|
-
* The kernel companion install info.
|
|
59
|
-
*/
|
|
60
|
-
kernelInfo: IKernelInstallInfo;
|
|
61
|
-
/**
|
|
62
|
-
* The kernels that match the install info.
|
|
63
|
-
*/
|
|
64
|
-
kernels: KernelSpec.ISpecModel[];
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* An object representing the companion discovery metadata in package.json.
|
|
68
|
-
*/
|
|
69
|
-
export interface IJupyterLabPackageData {
|
|
70
|
-
jupyterlab?: {
|
|
71
|
-
discovery?: {
|
|
72
|
-
/**
|
|
73
|
-
* Information about any server extension companions.
|
|
74
|
-
*/
|
|
75
|
-
server?: IInstallInfo;
|
|
76
|
-
/**
|
|
77
|
-
* Information about any kernel companions.
|
|
78
|
-
*/
|
|
79
|
-
kernel?: IKernelInstallInfo[];
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Prompt the user what do about companion packages, if present.
|
|
85
|
-
*
|
|
86
|
-
* @param builder the build manager
|
|
87
|
-
*/
|
|
88
|
-
export declare function presentCompanions(kernelCompanions: KernelCompanion[], serverCompanion: IInstallInfo | undefined, translator?: ITranslator): Promise<boolean>;
|
package/lib/companions.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Jupyter Development Team.
|
|
2
|
-
// Distributed under the terms of the Modified BSD License.
|
|
3
|
-
import { Dialog, showDialog } from '@jupyterlab/apputils';
|
|
4
|
-
import { nullTranslator } from '@jupyterlab/translation';
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
// Mapping of manager name to function that take name and gives command
|
|
7
|
-
const managerCommand = {
|
|
8
|
-
pip: name => `pip install ${name}`,
|
|
9
|
-
conda: name => `conda install -c conda-forge ${name}`
|
|
10
|
-
};
|
|
11
|
-
function getInstallCommands(info) {
|
|
12
|
-
var _a, _b, _c, _d;
|
|
13
|
-
const commands = Array();
|
|
14
|
-
for (const manager of info.managers) {
|
|
15
|
-
const name = (_c = (_b = (_a = info.overrides) === null || _a === void 0 ? void 0 : _a[manager]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : info.base.name;
|
|
16
|
-
if (!name) {
|
|
17
|
-
console.warn(`No package name found for manager ${manager}`);
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
const command = (_d = managerCommand[manager]) === null || _d === void 0 ? void 0 : _d.call(managerCommand, name);
|
|
21
|
-
if (!command) {
|
|
22
|
-
console.warn(`Don't know how to install packages for manager ${manager}`);
|
|
23
|
-
}
|
|
24
|
-
commands.push(command);
|
|
25
|
-
}
|
|
26
|
-
return commands;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Prompt the user what do about companion packages, if present.
|
|
30
|
-
*
|
|
31
|
-
* @param builder the build manager
|
|
32
|
-
*/
|
|
33
|
-
export function presentCompanions(kernelCompanions, serverCompanion, translator) {
|
|
34
|
-
translator = translator || nullTranslator;
|
|
35
|
-
const trans = translator.load('jupyterlab');
|
|
36
|
-
const entries = [];
|
|
37
|
-
if (serverCompanion) {
|
|
38
|
-
entries.push(React.createElement("p", { key: "server-companion" },
|
|
39
|
-
trans.__(`This package has indicated that it needs a corresponding server
|
|
40
|
-
extension. Please contact your Administrator to update the server with
|
|
41
|
-
one of the following commands:`),
|
|
42
|
-
getInstallCommands(serverCompanion).map(command => {
|
|
43
|
-
return (React.createElement("p", { key: command },
|
|
44
|
-
React.createElement("code", null, command)));
|
|
45
|
-
})));
|
|
46
|
-
}
|
|
47
|
-
if (kernelCompanions.length > 0) {
|
|
48
|
-
entries.push(React.createElement("p", { key: 'kernel-companion' }, trans.__('This package has indicated that it needs a corresponding package for the kernel.')));
|
|
49
|
-
for (const [index, entry] of kernelCompanions.entries()) {
|
|
50
|
-
entries.push(React.createElement("p", { key: `companion-${index}` }, trans.__(`The package <code>%1</code>, is required by the following kernels:`, entry.kernelInfo.base.name)));
|
|
51
|
-
const kernelEntries = [];
|
|
52
|
-
for (const [index, kernel] of entry.kernels.entries()) {
|
|
53
|
-
kernelEntries.push(React.createElement("li", { key: `kernels-${index}` },
|
|
54
|
-
React.createElement("code", null, kernel.display_name)));
|
|
55
|
-
}
|
|
56
|
-
entries.push(React.createElement("ul", { key: 'kernel-companion-end' }, kernelEntries));
|
|
57
|
-
entries.push(React.createElement("p", { key: `kernel-companion-${index}` },
|
|
58
|
-
trans.__(`This package has indicated that it needs a corresponding kernel
|
|
59
|
-
package. Please contact your Administrator to update the server with
|
|
60
|
-
one of the following commands:`),
|
|
61
|
-
getInstallCommands(entry.kernelInfo).map(command => {
|
|
62
|
-
return (React.createElement("p", { key: command },
|
|
63
|
-
React.createElement("code", null, command)));
|
|
64
|
-
})));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const body = (React.createElement("div", null,
|
|
68
|
-
entries,
|
|
69
|
-
React.createElement("p", null, trans.__(`You should make sure that the indicated packages are installed before
|
|
70
|
-
trying to use the extension. Do you want to continue with the extension
|
|
71
|
-
installation?`))));
|
|
72
|
-
const hasKernelCompanions = kernelCompanions.length > 0;
|
|
73
|
-
const hasServerCompanion = !!serverCompanion;
|
|
74
|
-
let title = '';
|
|
75
|
-
if (hasKernelCompanions && hasServerCompanion) {
|
|
76
|
-
title = trans.__('Kernel and Server Companions');
|
|
77
|
-
}
|
|
78
|
-
else if (hasKernelCompanions) {
|
|
79
|
-
title = trans.__('Kernel Companions');
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
title = trans.__('Server Companion');
|
|
83
|
-
}
|
|
84
|
-
return showDialog({
|
|
85
|
-
title,
|
|
86
|
-
body,
|
|
87
|
-
buttons: [
|
|
88
|
-
Dialog.cancelButton({ label: trans.__('Cancel') }),
|
|
89
|
-
Dialog.okButton({
|
|
90
|
-
label: trans.__('OK'),
|
|
91
|
-
caption: trans.__('Install the JupyterLab extension.')
|
|
92
|
-
})
|
|
93
|
-
]
|
|
94
|
-
}).then(result => {
|
|
95
|
-
return result.button.accept;
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=companions.js.map
|
package/lib/companions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"companions.js","sourceRoot":"","sources":["../src/companions.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2F/B,uEAAuE;AACvE,MAAM,cAAc,GAAgD;IAClE,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,eAAe,IAAI,EAAE;IAClC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,gCAAgC,IAAI,EAAE;CACtD,CAAC;AAEF,SAAS,kBAAkB,CAAC,IAAkB;;IAC5C,MAAM,QAAQ,GAAG,KAAK,EAAU,CAAC;IACjC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;QACnC,MAAM,IAAI,GAAG,MAAA,MAAA,MAAA,IAAI,CAAC,SAAS,0CAAG,OAAO,CAAC,0CAAE,IAAI,mCAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAA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CAAC,mBAAmB,CAAC,CAAC;KACvC;SAAM;QACL,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;KACtC;IACD,OAAO,UAAU,CAAC;QAChB,KAAK;QACL,IAAI;QACJ,OAAO,EAAE;YACP,MAAM,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,MAAM,CAAC,QAAQ,CAAC;gBACd,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC;gBACrB,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,mCAAmC,CAAC;aACvD,CAAC;SACH;KACF,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACf,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/lib/listings.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ISignal } from '@lumino/signaling';
|
|
2
|
-
/** *
|
|
3
|
-
* Information about a listed entry.
|
|
4
|
-
*/
|
|
5
|
-
export interface IListEntry {
|
|
6
|
-
/**
|
|
7
|
-
* The name of the extension.
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
regexp: RegExp | undefined;
|
|
11
|
-
type: string | undefined;
|
|
12
|
-
reason: string | undefined;
|
|
13
|
-
creation_date: string | undefined;
|
|
14
|
-
last_update_date: string | undefined;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Listing search result type.
|
|
18
|
-
*
|
|
19
|
-
* - The mode for the listings, can be black or white.
|
|
20
|
-
* - A collection of URIs for black or white listings, depending
|
|
21
|
-
* on the mode.
|
|
22
|
-
* - A collection of black or white listed extensions, depending
|
|
23
|
-
* on the mode.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
export declare type ListResult = null | {
|
|
27
|
-
mode: 'block' | 'allow' | 'default' | 'invalid';
|
|
28
|
-
uris: string[];
|
|
29
|
-
entries: IListEntry[];
|
|
30
|
-
};
|
|
31
|
-
export interface IListingApi {
|
|
32
|
-
blocked_extensions_uris: string[];
|
|
33
|
-
allowed_extensions_uris: string[];
|
|
34
|
-
blocked_extensions: IListEntry[];
|
|
35
|
-
allowed_extensions: IListEntry[];
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* An object for getting listings from the server API.
|
|
39
|
-
*/
|
|
40
|
-
export declare class Lister {
|
|
41
|
-
/**
|
|
42
|
-
* Create a Lister object.
|
|
43
|
-
*/
|
|
44
|
-
constructor();
|
|
45
|
-
get listingsLoaded(): ISignal<this, ListResult>;
|
|
46
|
-
private _listings;
|
|
47
|
-
/**
|
|
48
|
-
*/
|
|
49
|
-
private _listingsLoaded;
|
|
50
|
-
}
|