@jupyterlab/extensionmanager 4.0.0-alpha.9 → 4.0.0-beta.0

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/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
- padding-bottom: 0;
7
- color: var(--jp-ui-font-color1);
8
- background: var(--jp-layout-color1);
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
- flex-direction: column;
11
- font-size: var(--jp-ui-font-size1);
20
+ margin: 4px 10px 0;
12
21
  }
13
22
 
14
- .jp-extensionmanager-content {
15
- overflow: auto;
16
- overflow-x: hidden;
23
+ .jp-extensionmanager-title svg {
24
+ width: 14px;
17
25
  }
18
26
 
19
- /*
20
- Jupyter Org
21
- */
27
+ .jp-extensionmanager-title .jp-icon3[fill] {
28
+ fill: currentcolor;
29
+ }
22
30
 
23
- .jp-extensionmanager-is-jupyter-org {
24
- font-size: var(--jp-ui-font-size0);
25
- color: var(--jp-ui-font-color2);
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
- flex: 0 0 auto;
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-stack-panel-header {
53
- display: flex;
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,41 +94,13 @@
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: inline-block;
102
+ display: flex;
103
+ justify-content: center;
144
104
  padding-left: 0;
145
105
  padding-right: 0;
146
106
  }
@@ -151,7 +111,6 @@
151
111
 
152
112
  .jp-extensionmanager-view .pagination li a {
153
113
  padding: 0 5px;
154
- margin: 0 5px;
155
114
  }
156
115
 
157
116
  .jp-extensionmanager-view .pagination li.active a {
@@ -168,9 +127,9 @@
168
127
  cursor: default;
169
128
  }
170
129
 
171
- .jp-extensionmanager-pagination {
172
- display: flex;
173
- justify-content: center;
130
+ .jp-extensionmanager-installedlist,
131
+ .jp-extensionmanager-searchresults {
132
+ min-height: 100px;
174
133
  }
175
134
 
176
135
  /*
@@ -194,6 +153,7 @@
194
153
  display: flex;
195
154
  flex-direction: row;
196
155
  justify-content: space-between;
156
+ align-items: center;
197
157
  }
198
158
 
199
159
  .jp-extensionmanager-entry.jp-extensionmanager-entry-should-be-uninstalled {
@@ -212,11 +172,6 @@
212
172
  padding-left: 4px;
213
173
  }
214
174
 
215
- /* this is not styled */
216
-
217
- /* .jp-extensionmanager-entry.jp-extensionmanager-entry-warning {
218
- } */
219
-
220
175
  .jp-extensionmanager-entry-name {
221
176
  font-size: var(--jp-ui-font-size1);
222
177
  font-weight: 600;
@@ -313,7 +268,7 @@
313
268
  */
314
269
 
315
270
  .jp-extensionmanager-disclaimer-disable {
316
- background-color: var(--jp-brand-color1) !important;
271
+ background-color: var(--jp-reject-color-normal) !important;
317
272
  color: white !important;
318
273
  border: 0;
319
274
  background-image: none !important;
@@ -333,7 +288,8 @@
333
288
  .jp-extensionmanager-entry-buttons {
334
289
  display: flex;
335
290
  flex-direction: row;
336
- padding-top: 4px;
291
+ padding-block-start: 4px;
292
+ justify-content: flex-end;
337
293
  }
338
294
 
339
295
  /*
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';
@@ -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>;
@@ -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
@@ -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,OAA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B,KAAK,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE;wBAC7C,OAAO,EAAE,iCAAM,GAAG,CAAC,OAAO,CAAO;qBAClC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;aACN;iBAAM,IAAI,OAAO,CAAC,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"}
@@ -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
@@ -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,CAAC;QAC/D,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,CAAC,IAAI,CAAC,qCAAqC,OAAO,EAAE,CAAC,CAAC;YAC7D,SAAS;SACV;QACD,MAAM,OAAO,GAAG,MAAA,cAAc,CAAC,OAAO,CAAC,+DAAG,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,CAAC,IAAI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Q,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
- }
package/lib/listings.js DELETED
@@ -1,80 +0,0 @@
1
- // Copyright (c) Jupyter Development Team.
2
- // Distributed under the terms of the Modified BSD License.
3
- import { URLExt } from '@jupyterlab/coreutils';
4
- import { ServerConnection } from '@jupyterlab/services';
5
- import { Signal } from '@lumino/signaling';
6
- /**
7
- * An object for getting listings from the server API.
8
- */
9
- export class Lister {
10
- /**
11
- * Create a Lister object.
12
- */
13
- constructor() {
14
- this._listings = null;
15
- /**
16
- */
17
- this._listingsLoaded = new Signal(this);
18
- requestAPI('@jupyterlab/extensionmanager-extension/listings.json')
19
- .then(data => {
20
- this._listings = {
21
- mode: 'default',
22
- uris: [],
23
- entries: []
24
- };
25
- if (data.blocked_extensions_uris.length > 0 &&
26
- data.allowed_extensions_uris.length > 0) {
27
- console.warn('Simultaneous black and white list are not allowed.');
28
- this._listings = {
29
- mode: 'invalid',
30
- uris: [],
31
- entries: []
32
- };
33
- }
34
- else if (data.blocked_extensions_uris.length > 0 ||
35
- data.allowed_extensions_uris.length > 0) {
36
- this._listings = {
37
- mode: data.blocked_extensions_uris.length > 0 ? 'block' : 'allow',
38
- uris: data.blocked_extensions_uris.length > 0
39
- ? data.blocked_extensions_uris
40
- : data.allowed_extensions_uris,
41
- entries: data.blocked_extensions_uris.length > 0
42
- ? data.blocked_extensions
43
- : data.allowed_extensions
44
- };
45
- }
46
- this._listingsLoaded.emit(this._listings);
47
- })
48
- .catch(error => {
49
- console.error(error);
50
- });
51
- }
52
- get listingsLoaded() {
53
- return this._listingsLoaded;
54
- }
55
- }
56
- /**
57
- * Call the listings API REST handler.
58
- *
59
- * @param endPoint API REST end point for the extension
60
- * @param init Initial values for the request
61
- * @returns The response body interpreted as JSON
62
- */
63
- async function requestAPI(endPoint = '', init = {}) {
64
- // Make request to Jupyter API
65
- const settings = ServerConnection.makeSettings();
66
- const requestUrl = URLExt.join(settings.baseUrl, settings.appUrl, 'api/listings/', endPoint);
67
- let response;
68
- try {
69
- response = await ServerConnection.makeRequest(requestUrl, init, settings);
70
- }
71
- catch (error) {
72
- throw new ServerConnection.NetworkError(error);
73
- }
74
- const data = await response.json();
75
- if (!response.ok) {
76
- throw new ServerConnection.ResponseError(response, data.message);
77
- }
78
- return data;
79
- }
80
- //# sourceMappingURL=listings.js.map
@@ -1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