@jupyterlab/settingeditor 4.0.0-alpha.1 → 4.0.0-alpha.10

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.
@@ -0,0 +1,117 @@
1
+ import { showDialog } from '@jupyterlab/apputils';
2
+ import { nullTranslator } from '@jupyterlab/translation';
3
+ import { ReactWidget } from '@jupyterlab/ui-components';
4
+ import { Signal } from '@lumino/signaling';
5
+ import { SplitPanel } from '@lumino/widgets';
6
+ import React from 'react';
7
+ import { PluginList } from './pluginlist';
8
+ import { SettingsPanel } from './settingspanel';
9
+ /**
10
+ * Form based interface for editing settings.
11
+ */
12
+ export class SettingsEditor extends SplitPanel {
13
+ constructor(options) {
14
+ super({
15
+ orientation: 'horizontal',
16
+ renderer: SplitPanel.defaultRenderer,
17
+ spacing: 1
18
+ });
19
+ this._clearDirty = null;
20
+ this._dirty = false;
21
+ this._saveStateChange = new Signal(this);
22
+ this.translator = options.translator || nullTranslator;
23
+ this._status = options.status;
24
+ const list = (this._list = new PluginList({
25
+ registry: options.registry,
26
+ toSkip: options.toSkip,
27
+ translator: this.translator,
28
+ query: options.query
29
+ }));
30
+ this.addWidget(list);
31
+ this.setDirtyState = this.setDirtyState.bind(this);
32
+ /**
33
+ * Initializes the settings panel after loading the schema for all plugins.
34
+ */
35
+ void Promise.all(PluginList.sortPlugins(options.registry)
36
+ .filter(plugin => {
37
+ const { schema } = plugin;
38
+ const deprecated = schema['jupyter.lab.setting-deprecated'] === true;
39
+ const editable = Object.keys(schema.properties || {}).length > 0;
40
+ const extensible = schema.additionalProperties !== false;
41
+ return !deprecated && (editable || extensible);
42
+ })
43
+ .map(async (plugin) => await options.registry.load(plugin.id)))
44
+ .then(settings => {
45
+ const settingsPanel = ReactWidget.create(React.createElement(SettingsPanel, { settings: settings.filter(pluginSettings => { var _a; return !((_a = options.toSkip) !== null && _a !== void 0 ? _a : []).includes(pluginSettings.id); }), editorRegistry: options.editorRegistry, handleSelectSignal: this._list.handleSelectSignal, onSelect: (id) => (this._list.selection = id), hasError: this._list.setError, updateFilterSignal: this._list.updateFilterSignal, updateDirtyState: this.setDirtyState, translator: this.translator, initialFilter: this._list.filter }));
46
+ this.addWidget(settingsPanel);
47
+ })
48
+ .catch(reason => {
49
+ console.error(`Fail to load the setting plugins:\n${reason}`);
50
+ });
51
+ }
52
+ /**
53
+ * A signal emitted on the start and end of a saving operation.
54
+ */
55
+ get saveStateChanged() {
56
+ return this._saveStateChange;
57
+ }
58
+ /**
59
+ * Set the dirty state status
60
+ *
61
+ * @param dirty New status
62
+ */
63
+ setDirtyState(dirty) {
64
+ this._dirty = dirty;
65
+ if (this._dirty && !this._clearDirty) {
66
+ this._clearDirty = this._status.setDirty();
67
+ }
68
+ else if (!this._dirty && this._clearDirty) {
69
+ this._clearDirty.dispose();
70
+ this._clearDirty = null;
71
+ }
72
+ if (dirty) {
73
+ if (!this.title.className.includes('jp-mod-dirty')) {
74
+ this.title.className += ' jp-mod-dirty';
75
+ }
76
+ }
77
+ else {
78
+ this.title.className = this.title.className.replace('jp-mod-dirty', '');
79
+ }
80
+ this._saveStateChange.emit(dirty ? 'started' : 'completed');
81
+ }
82
+ /**
83
+ * A message handler invoked on a `'close-request'` message.
84
+ *
85
+ * @param msg Widget message
86
+ */
87
+ onCloseRequest(msg) {
88
+ const trans = this.translator.load('jupyterlab');
89
+ if (this._list.hasErrors) {
90
+ showDialog({
91
+ title: trans.__('Warning'),
92
+ body: trans.__('Unsaved changes due to validation error. Continue without saving?')
93
+ }).then(value => {
94
+ if (value.button.accept) {
95
+ this.dispose();
96
+ super.onCloseRequest(msg);
97
+ }
98
+ });
99
+ }
100
+ else if (this._dirty) {
101
+ showDialog({
102
+ title: trans.__('Warning'),
103
+ body: trans.__('Some changes have not been saved. Continue without saving?')
104
+ }).then(value => {
105
+ if (value.button.accept) {
106
+ this.dispose();
107
+ super.onCloseRequest(msg);
108
+ }
109
+ });
110
+ }
111
+ else {
112
+ this.dispose();
113
+ super.onCloseRequest(msg);
114
+ }
115
+ }
116
+ }
117
+ //# sourceMappingURL=settingseditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingseditor.js","sourceRoot":"","sources":["../src/settingseditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAA0B,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIhF,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C,YAAY,OAAgC;QAC1C,KAAK,CAAC;YACJ,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,UAAU,CAAC,eAAe;YACpC,OAAO,EAAE,CAAC;SACX,CAAC,CAAC;QAyHG,gBAAW,GAAuB,IAAI,CAAC;QAEvC,WAAM,GAAY,KAAK,CAAC;QAExB,qBAAgB,GAAG,IAAI,MAAM,CAAiC,IAAI,CAAC,CAAC;QA5H1E,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,cAAc,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC;YACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC,CA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from '@jupyterlab/translation';
3
+ import { IFormComponentRegistry } from '@jupyterlab/ui-components';
4
+ import { ISignal } from '@lumino/signaling';
5
+ import React from 'react';
6
+ import { PluginList } from './pluginlist';
7
+ export interface ISettingsPanelProps {
8
+ /**
9
+ * List of Settings objects that provide schema and values
10
+ * of plugins.
11
+ */
12
+ settings: Settings[];
13
+ /**
14
+ * Form component registry that provides renderers
15
+ * for the form editor.
16
+ */
17
+ editorRegistry: IFormComponentRegistry;
18
+ /**
19
+ * Handler for when selection change is triggered by scrolling
20
+ * in the SettingsPanel.
21
+ */
22
+ onSelect: (id: string) => void;
23
+ /**
24
+ * Signal that fires when a selection is made in the plugin list.
25
+ */
26
+ handleSelectSignal: ISignal<PluginList, string>;
27
+ /**
28
+ * Translator object
29
+ */
30
+ translator: ITranslator;
31
+ /**
32
+ * Callback to update the plugin list to display plugins with
33
+ * invalid / unsaved settings in red.
34
+ */
35
+ hasError: (id: string, error: boolean) => void;
36
+ /**
37
+ * Sends the updated dirty state to the parent class.
38
+ */
39
+ updateDirtyState: (dirty: boolean) => void;
40
+ /**
41
+ * Signal that sends updated filter when search value changes.
42
+ */
43
+ updateFilterSignal: ISignal<PluginList, (plugin: ISettingRegistry.IPlugin) => string[] | null>;
44
+ /**
45
+ * If the settings editor is created with an initial search query, an initial
46
+ * filter function is passed to the settings panel.
47
+ */
48
+ initialFilter: (item: ISettingRegistry.IPlugin) => string[] | null;
49
+ }
50
+ /**
51
+ * React component that displays a list of SettingsFormEditor
52
+ * components.
53
+ */
54
+ export declare const SettingsPanel: React.FC<ISettingsPanelProps>;
@@ -0,0 +1,90 @@
1
+ /* -----------------------------------------------------------------------------
2
+ | Copyright (c) Jupyter Development Team.
3
+ | Distributed under the terms of the Modified BSD License.
4
+ |----------------------------------------------------------------------------*/
5
+ import React, { useEffect, useState } from 'react';
6
+ import { SettingsFormEditor } from './SettingsFormEditor';
7
+ /**
8
+ * React component that displays a list of SettingsFormEditor
9
+ * components.
10
+ */
11
+ export const SettingsPanel = ({ settings, editorRegistry, onSelect, handleSelectSignal, hasError, updateDirtyState, updateFilterSignal, translator, initialFilter }) => {
12
+ const [expandedPlugin, setExpandedPlugin] = useState(null);
13
+ const [filterPlugin, setFilter] = useState(() => initialFilter);
14
+ // Refs used to keep track of "selected" plugin based on scroll location
15
+ const editorRefs = {};
16
+ for (const setting of settings) {
17
+ editorRefs[setting.id] = React.useRef(null);
18
+ }
19
+ const wrapperRef = React.useRef(null);
20
+ const editorDirtyStates = React.useRef({});
21
+ useEffect(() => {
22
+ var _a;
23
+ const onFilterUpdate = (list, newFilter) => {
24
+ setFilter(() => newFilter);
25
+ for (const pluginSettings of settings) {
26
+ const filtered = newFilter(pluginSettings.plugin);
27
+ if (filtered === null || filtered.length > 0) {
28
+ setExpandedPlugin(pluginSettings.id);
29
+ break;
30
+ }
31
+ }
32
+ };
33
+ // Set first visible plugin as expanded plugin on initial load.
34
+ for (const pluginSettings of settings) {
35
+ const filtered = filterPlugin(pluginSettings.plugin);
36
+ if (filtered === null || filtered.length > 0) {
37
+ setExpandedPlugin(pluginSettings.id);
38
+ break;
39
+ }
40
+ }
41
+ // When filter updates, only show plugins that match search.
42
+ updateFilterSignal.connect(onFilterUpdate);
43
+ const onSelectChange = (list, pluginId) => {
44
+ var _a, _b;
45
+ setExpandedPlugin(expandedPlugin !== pluginId ? pluginId : null);
46
+ // Scroll to the plugin when a selection is made in the left panel.
47
+ (_b = (_a = editorRefs[pluginId]) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.scrollIntoView(true);
48
+ };
49
+ (_a = handleSelectSignal === null || handleSelectSignal === void 0 ? void 0 : handleSelectSignal.connect) === null || _a === void 0 ? void 0 : _a.call(handleSelectSignal, onSelectChange);
50
+ return () => {
51
+ var _a;
52
+ updateFilterSignal.disconnect(onFilterUpdate);
53
+ (_a = handleSelectSignal === null || handleSelectSignal === void 0 ? void 0 : handleSelectSignal.disconnect) === null || _a === void 0 ? void 0 : _a.call(handleSelectSignal, onSelectChange);
54
+ };
55
+ }, []);
56
+ const updateDirtyStates = (id, dirty) => {
57
+ if (editorDirtyStates.current) {
58
+ editorDirtyStates.current[id] = dirty;
59
+ for (const editor in editorDirtyStates.current) {
60
+ if (editorDirtyStates.current[editor]) {
61
+ updateDirtyState(true);
62
+ return;
63
+ }
64
+ }
65
+ }
66
+ updateDirtyState(false);
67
+ };
68
+ return (React.createElement("div", { className: "jp-SettingsPanel", ref: wrapperRef }, settings.map(pluginSettings => {
69
+ // Pass filtered results to SettingsFormEditor to only display filtered fields.
70
+ const filtered = filterPlugin(pluginSettings.plugin);
71
+ // If filtered results are an array, only show if the array is non-empty.
72
+ if (filtered !== null && filtered.length === 0) {
73
+ return undefined;
74
+ }
75
+ return (React.createElement("div", { ref: editorRefs[pluginSettings.id], className: "jp-SettingsForm", key: `${pluginSettings.id}SettingsEditor` },
76
+ React.createElement(SettingsFormEditor, { isCollapsed: pluginSettings.id !== expandedPlugin, onCollapseChange: (willCollapse) => {
77
+ if (!willCollapse) {
78
+ setExpandedPlugin(pluginSettings.id);
79
+ }
80
+ else if (pluginSettings.id === expandedPlugin) {
81
+ setExpandedPlugin(null);
82
+ }
83
+ }, filteredValues: filtered, settings: pluginSettings, renderers: editorRegistry.renderers, hasError: (error) => {
84
+ hasError(pluginSettings.id, error);
85
+ }, updateDirtyState: (dirty) => {
86
+ updateDirtyStates(pluginSettings.id, dirty);
87
+ }, onSelect: onSelect, translator: translator })));
88
+ })));
89
+ };
90
+ //# sourceMappingURL=settingspanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingspanel.js","sourceRoot":"","sources":["../src/settingspanel.tsx"],"names":[],"mappings":"AAAA;;;+EAG+E;AAM/E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAyD1D;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GA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
@@ -1,12 +1,22 @@
1
1
  import { IWidgetTracker, MainAreaWidget } from '@jupyterlab/apputils';
2
2
  import { Token } from '@lumino/coreutils';
3
- import { SettingEditor } from './settingeditor';
3
+ import { JsonSettingEditor as JSONSettingEditor } from './jsonsettingeditor';
4
+ import { SettingsEditor } from './settingseditor';
4
5
  /**
5
6
  * The setting editor tracker token.
6
7
  */
7
8
  export declare const ISettingEditorTracker: Token<ISettingEditorTracker>;
9
+ /**
10
+ * The setting editor tracker token.
11
+ */
12
+ export declare const IJSONSettingEditorTracker: Token<IJSONSettingEditorTracker>;
13
+ /**
14
+ * A class that tracks the setting editor.
15
+ */
16
+ export interface IJSONSettingEditorTracker extends IWidgetTracker<MainAreaWidget<JSONSettingEditor>> {
17
+ }
8
18
  /**
9
19
  * A class that tracks the setting editor.
10
20
  */
11
- export interface ISettingEditorTracker extends IWidgetTracker<MainAreaWidget<SettingEditor>> {
21
+ export interface ISettingEditorTracker extends IWidgetTracker<MainAreaWidget<SettingsEditor>> {
12
22
  }
package/lib/tokens.js CHANGED
@@ -1,9 +1,12 @@
1
1
  // Copyright (c) Jupyter Development Team.
2
2
  // Distributed under the terms of the Modified BSD License.
3
3
  import { Token } from '@lumino/coreutils';
4
- /* tslint:disable */
5
4
  /**
6
5
  * The setting editor tracker token.
7
6
  */
8
7
  export const ISettingEditorTracker = new Token('@jupyterlab/settingeditor:ISettingEditorTracker');
8
+ /**
9
+ * The setting editor tracker token.
10
+ */
11
+ export const IJSONSettingEditorTracker = new Token('@jupyterlab/settingeditor:IJSONSettingEditorTracker');
9
12
  //# sourceMappingURL=tokens.js.map
package/lib/tokens.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,oBAAoB;AACpB;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,KAAK,CAC5C,iDAAiD,CAClD,CAAC"}
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,KAAK,CAC5C,iDAAiD,CAClD,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,KAAK,CAChD,qDAAqD,CACtD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/settingeditor",
3
- "version": "4.0.0-alpha.1",
3
+ "version": "4.0.0-alpha.10",
4
4
  "description": "The JupyterLab default setting editor interface",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -36,28 +36,32 @@
36
36
  "watch": "tsc -b --watch"
37
37
  },
38
38
  "dependencies": {
39
- "@jupyterlab/apputils": "^4.0.0-alpha.1",
40
- "@jupyterlab/codeeditor": "^4.0.0-alpha.1",
41
- "@jupyterlab/inspector": "^4.0.0-alpha.1",
42
- "@jupyterlab/rendermime": "^4.0.0-alpha.1",
43
- "@jupyterlab/settingregistry": "^4.0.0-alpha.1",
44
- "@jupyterlab/statedb": "^4.0.0-alpha.1",
45
- "@jupyterlab/translation": "^4.0.0-alpha.1",
46
- "@jupyterlab/ui-components": "^4.0.0-alpha.16",
47
- "@lumino/commands": "^1.19.0",
48
- "@lumino/coreutils": "^1.11.1",
39
+ "@jupyterlab/application": "^4.0.0-alpha.10",
40
+ "@jupyterlab/apputils": "^4.0.0-alpha.10",
41
+ "@jupyterlab/codeeditor": "^4.0.0-alpha.10",
42
+ "@jupyterlab/inspector": "^4.0.0-alpha.10",
43
+ "@jupyterlab/rendermime": "^4.0.0-alpha.10",
44
+ "@jupyterlab/settingregistry": "^4.0.0-alpha.10",
45
+ "@jupyterlab/statedb": "^4.0.0-alpha.10",
46
+ "@jupyterlab/translation": "^4.0.0-alpha.10",
47
+ "@jupyterlab/ui-components": "^4.0.0-alpha.25",
48
+ "@lumino/algorithm": "^1.9.1",
49
+ "@lumino/commands": "^1.20.0",
50
+ "@lumino/coreutils": "^1.12.0",
51
+ "@lumino/disposable": "^1.10.1",
49
52
  "@lumino/messaging": "^1.10.1",
53
+ "@lumino/polling": "^1.10.0",
50
54
  "@lumino/signaling": "^1.10.1",
51
- "@lumino/widgets": "^1.30.0",
52
- "react": "^17.0.1",
53
- "react-dom": "^17.0.1"
55
+ "@lumino/widgets": "^1.32.0",
56
+ "@rjsf/core": "^3.1.0",
57
+ "json-schema": "^0.4.0",
58
+ "react": "^17.0.1"
54
59
  },
55
60
  "devDependencies": {
56
61
  "@types/react": "^17.0.0",
57
- "@types/react-dom": "^17.0.0",
58
62
  "rimraf": "~3.0.0",
59
- "typedoc": "~0.21.2",
60
- "typescript": "~4.1.3"
63
+ "typedoc": "~0.22.10",
64
+ "typescript": "~4.6.3"
61
65
  },
62
66
  "publishConfig": {
63
67
  "access": "public"