@jupyterlab/apputils-extension 4.7.0-alpha.0 → 4.7.0-alpha.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/settingconnector.d.ts +4 -28
- package/lib/settingconnector.js +4 -45
- package/lib/settingconnector.js.map +1 -1
- package/lib/settingsplugin.js +1 -2
- package/lib/settingsplugin.js.map +1 -1
- package/package.json +22 -22
- package/src/settingconnector.ts +5 -70
- package/src/settingsplugin.ts +1 -1
|
@@ -1,30 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import type { IDataConnector } from '@jupyterlab/statedb';
|
|
3
|
-
import { DataConnector } from '@jupyterlab/statedb';
|
|
1
|
+
export {
|
|
4
2
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* #### Notes
|
|
8
|
-
* This connector adds a query parameter to the base services setting manager.
|
|
3
|
+
* @deprecated The setting connector is now in the settingregistry package. Import from '@jupyterlab/settingregistry' instead.
|
|
4
|
+
* Use: import { SettingConnector } from '@jupyterlab/settingregistry';
|
|
9
5
|
*/
|
|
10
|
-
|
|
11
|
-
constructor(connector: IDataConnector<ISettingRegistry.IPlugin, string>);
|
|
12
|
-
/**
|
|
13
|
-
* Fetch settings for a plugin.
|
|
14
|
-
* @param id - The plugin ID
|
|
15
|
-
*
|
|
16
|
-
* #### Notes
|
|
17
|
-
* The REST API requests are throttled at one request per plugin per 100ms.
|
|
18
|
-
*/
|
|
19
|
-
fetch(id: string): Promise<ISettingRegistry.IPlugin | undefined>;
|
|
20
|
-
list(query: 'ids'): Promise<{
|
|
21
|
-
ids: string[];
|
|
22
|
-
}>;
|
|
23
|
-
list(query: 'active' | 'all'): Promise<{
|
|
24
|
-
ids: string[];
|
|
25
|
-
values: ISettingRegistry.IPlugin[];
|
|
26
|
-
}>;
|
|
27
|
-
save(id: string, raw: string): Promise<void>;
|
|
28
|
-
private _connector;
|
|
29
|
-
private _throttlers;
|
|
30
|
-
}
|
|
6
|
+
SettingConnector } from '@jupyterlab/settingregistry';
|
package/lib/settingconnector.js
CHANGED
|
@@ -2,51 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Jupyter Development Team.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
import { DataConnector } from '@jupyterlab/statedb';
|
|
7
|
-
import { Throttler } from '@lumino/polling';
|
|
5
|
+
export {
|
|
8
6
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* #### Notes
|
|
12
|
-
* This connector adds a query parameter to the base services setting manager.
|
|
7
|
+
* @deprecated The setting connector is now in the settingregistry package. Import from '@jupyterlab/settingregistry' instead.
|
|
8
|
+
* Use: import { SettingConnector } from '@jupyterlab/settingregistry';
|
|
13
9
|
*/
|
|
14
|
-
|
|
15
|
-
constructor(connector) {
|
|
16
|
-
super();
|
|
17
|
-
this._throttlers = Object.create(null);
|
|
18
|
-
this._connector = connector;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Fetch settings for a plugin.
|
|
22
|
-
* @param id - The plugin ID
|
|
23
|
-
*
|
|
24
|
-
* #### Notes
|
|
25
|
-
* The REST API requests are throttled at one request per plugin per 100ms.
|
|
26
|
-
*/
|
|
27
|
-
fetch(id) {
|
|
28
|
-
const throttlers = this._throttlers;
|
|
29
|
-
if (!(id in throttlers)) {
|
|
30
|
-
throttlers[id] = new Throttler(() => this._connector.fetch(id), 100);
|
|
31
|
-
}
|
|
32
|
-
return throttlers[id].invoke();
|
|
33
|
-
}
|
|
34
|
-
async list(query = 'all') {
|
|
35
|
-
const { isDisabled } = PageConfig.Extension;
|
|
36
|
-
const { ids, values } = await this._connector.list(query === 'ids' ? 'ids' : undefined);
|
|
37
|
-
if (query === 'all') {
|
|
38
|
-
return { ids, values };
|
|
39
|
-
}
|
|
40
|
-
if (query === 'ids') {
|
|
41
|
-
return { ids };
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
ids: ids.filter(id => !isDisabled(id)),
|
|
45
|
-
values: values.filter(({ id }) => !isDisabled(id))
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
async save(id, raw) {
|
|
49
|
-
await this._connector.save(id, raw);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
10
|
+
SettingConnector } from '@jupyterlab/settingregistry';
|
|
52
11
|
//# sourceMappingURL=settingconnector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingconnector.js","sourceRoot":"","sources":["../src/settingconnector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO
|
|
1
|
+
{"version":3,"file":"settingconnector.js","sourceRoot":"","sources":["../src/settingconnector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACL;;;GAGG;AACH,gBAAgB,EACjB,MAAM,6BAA6B,CAAC"}
|
package/lib/settingsplugin.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
| Distributed under the terms of the Modified BSD License.
|
|
4
4
|
|----------------------------------------------------------------------------*/
|
|
5
5
|
import { PageConfig } from '@jupyterlab/coreutils';
|
|
6
|
-
import { ISettingConnector, ISettingRegistry, SettingRegistry } from '@jupyterlab/settingregistry';
|
|
7
|
-
import { SettingConnector } from './settingconnector';
|
|
6
|
+
import { ISettingConnector, ISettingRegistry, SettingConnector, SettingRegistry } from '@jupyterlab/settingregistry';
|
|
8
7
|
/**
|
|
9
8
|
* Provides the settings connector as a separate plugin to allow for alternative
|
|
10
9
|
* implementations that may want to fetch settings from a different source or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsplugin.js","sourceRoot":"","sources":["../src/settingsplugin.ts"],"names":[],"mappings":"AAAA;;;+EAG+E;AAM/E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
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CAC9D,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CACxB;SACF,CAAC,CAAC;QAEH,qEAAqE;QACrE,yEAAyE;QACzE,qEAAqE;QACrE,oBAAoB;QACpB,KAAK,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YAChC,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAC,EAAE,EAAC,EAAE;gBAC7B,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;oBACnE,OAAO;gBACT,CAAC;gBAED,IAAI,CAAC;oBACH,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC1B,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,IAAI,CAAC,gCAAgC,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;oBAC3D,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC;wBAC/B,OAAO,CAAC,IAAI,CACV,6DAA6D;4BAC3D,wCAAwC,EAAE,gBAAgB;4BAC1D,+CAA+C,CAClD,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/apputils-extension",
|
|
3
|
-
"version": "4.7.0-alpha.
|
|
3
|
+
"version": "4.7.0-alpha.1",
|
|
4
4
|
"description": "JupyterLab - Application Utilities Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -42,32 +42,32 @@
|
|
|
42
42
|
"watch": "tsc -b --watch"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@jupyterlab/application": "^4.7.0-alpha.
|
|
46
|
-
"@jupyterlab/apputils": "^4.8.0-alpha.
|
|
47
|
-
"@jupyterlab/coreutils": "^6.7.0-alpha.
|
|
48
|
-
"@jupyterlab/docregistry": "^4.7.0-alpha.
|
|
49
|
-
"@jupyterlab/mainmenu": "^4.7.0-alpha.
|
|
50
|
-
"@jupyterlab/rendermime-interfaces": "^3.15.0-alpha.
|
|
51
|
-
"@jupyterlab/services": "^7.7.0-alpha.
|
|
52
|
-
"@jupyterlab/settingregistry": "^4.7.0-alpha.
|
|
53
|
-
"@jupyterlab/statedb": "^4.7.0-alpha.
|
|
54
|
-
"@jupyterlab/statusbar": "^4.7.0-alpha.
|
|
55
|
-
"@jupyterlab/translation": "^4.7.0-alpha.
|
|
56
|
-
"@jupyterlab/ui-components": "^4.7.0-alpha.
|
|
57
|
-
"@jupyterlab/workspaces": "^4.7.0-alpha.
|
|
58
|
-
"@lumino/algorithm": "^2.0.
|
|
59
|
-
"@lumino/commands": "^2.3.
|
|
60
|
-
"@lumino/coreutils": "^2.2.
|
|
61
|
-
"@lumino/disposable": "^2.1.
|
|
62
|
-
"@lumino/domutils": "^2.0.
|
|
63
|
-
"@lumino/polling": "^2.1.
|
|
64
|
-
"@lumino/widgets": "^2.
|
|
45
|
+
"@jupyterlab/application": "^4.7.0-alpha.1",
|
|
46
|
+
"@jupyterlab/apputils": "^4.8.0-alpha.1",
|
|
47
|
+
"@jupyterlab/coreutils": "^6.7.0-alpha.1",
|
|
48
|
+
"@jupyterlab/docregistry": "^4.7.0-alpha.1",
|
|
49
|
+
"@jupyterlab/mainmenu": "^4.7.0-alpha.1",
|
|
50
|
+
"@jupyterlab/rendermime-interfaces": "^3.15.0-alpha.1",
|
|
51
|
+
"@jupyterlab/services": "^7.7.0-alpha.1",
|
|
52
|
+
"@jupyterlab/settingregistry": "^4.7.0-alpha.1",
|
|
53
|
+
"@jupyterlab/statedb": "^4.7.0-alpha.1",
|
|
54
|
+
"@jupyterlab/statusbar": "^4.7.0-alpha.1",
|
|
55
|
+
"@jupyterlab/translation": "^4.7.0-alpha.1",
|
|
56
|
+
"@jupyterlab/ui-components": "^4.7.0-alpha.1",
|
|
57
|
+
"@jupyterlab/workspaces": "^4.7.0-alpha.1",
|
|
58
|
+
"@lumino/algorithm": "^2.0.5",
|
|
59
|
+
"@lumino/commands": "^2.3.4",
|
|
60
|
+
"@lumino/coreutils": "^2.2.3",
|
|
61
|
+
"@lumino/disposable": "^2.1.6",
|
|
62
|
+
"@lumino/domutils": "^2.0.5",
|
|
63
|
+
"@lumino/polling": "^2.1.6",
|
|
64
|
+
"@lumino/widgets": "^2.9.0",
|
|
65
65
|
"react": "^18.2.0",
|
|
66
66
|
"react-dom": "^18.2.0",
|
|
67
67
|
"react-toastify": "^9.0.8"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@jupyterlab/testing": "^4.7.0-alpha.
|
|
70
|
+
"@jupyterlab/testing": "^4.7.0-alpha.1",
|
|
71
71
|
"@types/jest": "^29.2.0",
|
|
72
72
|
"jest": "^29.2.0",
|
|
73
73
|
"rimraf": "~5.0.5",
|
package/src/settingconnector.ts
CHANGED
|
@@ -3,75 +3,10 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
import type {
|
|
8
|
-
ISettingConnector,
|
|
9
|
-
ISettingRegistry
|
|
10
|
-
} from '@jupyterlab/settingregistry';
|
|
11
|
-
import type { IDataConnector } from '@jupyterlab/statedb';
|
|
12
|
-
import { DataConnector } from '@jupyterlab/statedb';
|
|
13
|
-
import { Throttler } from '@lumino/polling';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A data connector for fetching settings.
|
|
17
|
-
*
|
|
18
|
-
* #### Notes
|
|
19
|
-
* This connector adds a query parameter to the base services setting manager.
|
|
20
|
-
*/
|
|
21
|
-
export class SettingConnector
|
|
22
|
-
extends DataConnector<ISettingRegistry.IPlugin, string>
|
|
23
|
-
implements ISettingConnector
|
|
24
|
-
{
|
|
25
|
-
constructor(connector: IDataConnector<ISettingRegistry.IPlugin, string>) {
|
|
26
|
-
super();
|
|
27
|
-
this._connector = connector;
|
|
28
|
-
}
|
|
29
|
-
|
|
6
|
+
export {
|
|
30
7
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* #### Notes
|
|
35
|
-
* The REST API requests are throttled at one request per plugin per 100ms.
|
|
8
|
+
* @deprecated The setting connector is now in the settingregistry package. Import from '@jupyterlab/settingregistry' instead.
|
|
9
|
+
* Use: import { SettingConnector } from '@jupyterlab/settingregistry';
|
|
36
10
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!(id in throttlers)) {
|
|
40
|
-
throttlers[id] = new Throttler(() => this._connector.fetch(id), 100);
|
|
41
|
-
}
|
|
42
|
-
return throttlers[id].invoke();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async list(query: 'ids'): Promise<{ ids: string[] }>;
|
|
46
|
-
async list(
|
|
47
|
-
query: 'active' | 'all'
|
|
48
|
-
): Promise<{ ids: string[]; values: ISettingRegistry.IPlugin[] }>;
|
|
49
|
-
async list(
|
|
50
|
-
query: 'active' | 'all' | 'ids' = 'all'
|
|
51
|
-
): Promise<{ ids: string[]; values?: ISettingRegistry.IPlugin[] }> {
|
|
52
|
-
const { isDisabled } = PageConfig.Extension;
|
|
53
|
-
const { ids, values } = await this._connector.list(
|
|
54
|
-
query === 'ids' ? 'ids' : undefined
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
if (query === 'all') {
|
|
58
|
-
return { ids, values };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (query === 'ids') {
|
|
62
|
-
return { ids };
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
ids: ids.filter(id => !isDisabled(id)),
|
|
67
|
-
values: values.filter(({ id }) => !isDisabled(id))
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async save(id: string, raw: string): Promise<void> {
|
|
72
|
-
await this._connector.save(id, raw);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
private _connector: IDataConnector<ISettingRegistry.IPlugin, string>;
|
|
76
|
-
private _throttlers: { [key: string]: Throttler } = Object.create(null);
|
|
77
|
-
}
|
|
11
|
+
SettingConnector
|
|
12
|
+
} from '@jupyterlab/settingregistry';
|
package/src/settingsplugin.ts
CHANGED
|
@@ -11,9 +11,9 @@ import { PageConfig } from '@jupyterlab/coreutils';
|
|
|
11
11
|
import {
|
|
12
12
|
ISettingConnector,
|
|
13
13
|
ISettingRegistry,
|
|
14
|
+
SettingConnector,
|
|
14
15
|
SettingRegistry
|
|
15
16
|
} from '@jupyterlab/settingregistry';
|
|
16
|
-
import { SettingConnector } from './settingconnector';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Provides the settings connector as a separate plugin to allow for alternative
|