@jupyterlab/settingeditor 4.0.0-alpha.2 → 4.0.0-alpha.20
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/SettingsFormEditor.d.ts +101 -0
- package/lib/SettingsFormEditor.js +151 -0
- package/lib/SettingsFormEditor.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/inspector.js +24 -30
- package/lib/inspector.js.map +1 -1
- package/lib/{settingeditor.d.ts → jsonsettingeditor.d.ts} +5 -6
- package/lib/{settingeditor.js → jsonsettingeditor.js} +25 -43
- package/lib/jsonsettingeditor.js.map +1 -0
- package/lib/plugineditor.d.ts +3 -3
- package/lib/plugineditor.js +2 -6
- package/lib/plugineditor.js.map +1 -1
- package/lib/pluginlist.d.ts +58 -22
- package/lib/pluginlist.js +246 -109
- package/lib/pluginlist.js.map +1 -1
- package/lib/raweditor.d.ts +2 -6
- package/lib/raweditor.js +22 -33
- package/lib/raweditor.js.map +1 -1
- package/lib/settingseditor.d.ts +81 -0
- package/lib/settingseditor.js +121 -0
- package/lib/settingseditor.js.map +1 -0
- package/lib/settingspanel.d.ts +54 -0
- package/lib/settingspanel.js +102 -0
- package/lib/settingspanel.js.map +1 -0
- package/lib/tokens.d.ts +12 -2
- package/lib/tokens.js +4 -1
- package/lib/tokens.js.map +1 -1
- package/package.json +28 -21
- package/src/SettingsFormEditor.tsx +306 -0
- package/src/index.ts +10 -0
- package/src/inspector.ts +144 -0
- package/src/jsonsettingeditor.tsx +482 -0
- package/src/plugineditor.ts +257 -0
- package/src/pluginlist.tsx +538 -0
- package/src/raweditor.ts +422 -0
- package/src/settingseditor.tsx +210 -0
- package/src/settingspanel.tsx +218 -0
- package/src/tokens.ts +33 -0
- package/style/base.css +213 -89
- package/style/index.css +1 -0
- package/style/index.js +1 -0
- package/lib/settingeditor.js.map +0 -1
- package/lib/splitpanel.d.ts +0 -13
- package/lib/splitpanel.js +0 -26
- package/lib/splitpanel.js.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ISettingRegistry, Settings } from '@jupyterlab/settingregistry';
|
|
2
|
+
import { ITranslator } from '@jupyterlab/translation';
|
|
3
|
+
import { Field, UiSchema } from '@rjsf/utils';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Namespace for a React component that prepares the settings for a
|
|
7
|
+
* given plugin to be rendered in the FormEditor.
|
|
8
|
+
*/
|
|
9
|
+
export declare namespace SettingsFormEditor {
|
|
10
|
+
/**
|
|
11
|
+
* Props passed to the SettingsFormEditor component
|
|
12
|
+
*/
|
|
13
|
+
interface IProps {
|
|
14
|
+
/**
|
|
15
|
+
* Settings object with schema and user defined values.
|
|
16
|
+
*/
|
|
17
|
+
settings: Settings;
|
|
18
|
+
/**
|
|
19
|
+
* Dictionary used for custom field renderers in the form.
|
|
20
|
+
*/
|
|
21
|
+
renderers: {
|
|
22
|
+
[id: string]: {
|
|
23
|
+
[property: string]: Field;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Whether the form is collapsed or not.
|
|
28
|
+
*/
|
|
29
|
+
isCollapsed: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Callback with the collapse state value.
|
|
32
|
+
*/
|
|
33
|
+
onCollapseChange: (v: boolean) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Translator object
|
|
36
|
+
*/
|
|
37
|
+
translator: ITranslator;
|
|
38
|
+
/**
|
|
39
|
+
* Callback to update the plugin list when a validation error occurs.
|
|
40
|
+
*/
|
|
41
|
+
hasError: (error: boolean) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Handler for when selection change is triggered by scrolling
|
|
44
|
+
* in the SettingsPanel.
|
|
45
|
+
*/
|
|
46
|
+
onSelect: (id: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Sends whether this editor has unsaved changes to the parent class.
|
|
49
|
+
*/
|
|
50
|
+
updateDirtyState: (dirty: boolean) => void;
|
|
51
|
+
/**
|
|
52
|
+
* List of strings that match search value.
|
|
53
|
+
*/
|
|
54
|
+
filteredValues: string[] | null;
|
|
55
|
+
}
|
|
56
|
+
interface IState {
|
|
57
|
+
/**
|
|
58
|
+
* Indicates whether the settings have been modified. Used for hiding
|
|
59
|
+
* the "Restore to Default" button when there are no changes.
|
|
60
|
+
*/
|
|
61
|
+
isModified: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Form UI schema
|
|
64
|
+
*/
|
|
65
|
+
uiSchema: UiSchema;
|
|
66
|
+
/**
|
|
67
|
+
* Filtered schema
|
|
68
|
+
*/
|
|
69
|
+
filteredSchema?: ISettingRegistry.ISchema;
|
|
70
|
+
/**
|
|
71
|
+
* Form context
|
|
72
|
+
*/
|
|
73
|
+
formContext?: any;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A React component that prepares the settings for a
|
|
78
|
+
* given plugin to be rendered in the FormEditor.
|
|
79
|
+
*/
|
|
80
|
+
export declare class SettingsFormEditor extends React.Component<SettingsFormEditor.IProps, SettingsFormEditor.IState> {
|
|
81
|
+
constructor(props: SettingsFormEditor.IProps);
|
|
82
|
+
componentDidMount(): void;
|
|
83
|
+
componentDidUpdate(prevProps: SettingsFormEditor.IProps): void;
|
|
84
|
+
componentWillUnmount(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Handler for edits made in the form editor.
|
|
87
|
+
*/
|
|
88
|
+
handleChange(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Handler for the "Restore to defaults" button - clears all
|
|
91
|
+
* modified settings then calls `setFormData` to restore the
|
|
92
|
+
* values.
|
|
93
|
+
*/
|
|
94
|
+
reset: (event: React.MouseEvent) => Promise<void>;
|
|
95
|
+
render(): JSX.Element;
|
|
96
|
+
private _onChange;
|
|
97
|
+
private _setUiSchema;
|
|
98
|
+
private _setFilteredSchema;
|
|
99
|
+
private _debouncer;
|
|
100
|
+
private _formData;
|
|
101
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* -----------------------------------------------------------------------------
|
|
2
|
+
| Copyright (c) Jupyter Development Team.
|
|
3
|
+
| Distributed under the terms of the Modified BSD License.
|
|
4
|
+
|----------------------------------------------------------------------------*/
|
|
5
|
+
import { showErrorMessage } from '@jupyterlab/apputils';
|
|
6
|
+
import { caretDownIcon, caretRightIcon, FormComponent } from '@jupyterlab/ui-components';
|
|
7
|
+
import { JSONExt } from '@lumino/coreutils';
|
|
8
|
+
import { Debouncer } from '@lumino/polling';
|
|
9
|
+
import validatorAjv8 from '@rjsf/validator-ajv8';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* Indentation to use when saving the settings as JSON document.
|
|
13
|
+
*/
|
|
14
|
+
const JSON_INDENTATION = 4;
|
|
15
|
+
/**
|
|
16
|
+
* A React component that prepares the settings for a
|
|
17
|
+
* given plugin to be rendered in the FormEditor.
|
|
18
|
+
*/
|
|
19
|
+
export class SettingsFormEditor extends React.Component {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
/**
|
|
23
|
+
* Handler for the "Restore to defaults" button - clears all
|
|
24
|
+
* modified settings then calls `setFormData` to restore the
|
|
25
|
+
* values.
|
|
26
|
+
*/
|
|
27
|
+
this.reset = async (event) => {
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
for (const field in this.props.settings.user) {
|
|
30
|
+
await this.props.settings.remove(field);
|
|
31
|
+
}
|
|
32
|
+
this._formData = this.props.settings.composite;
|
|
33
|
+
this.setState({ isModified: false });
|
|
34
|
+
};
|
|
35
|
+
this._onChange = (e) => {
|
|
36
|
+
this.props.hasError(e.errors.length !== 0);
|
|
37
|
+
this._formData = e.formData;
|
|
38
|
+
if (e.errors.length === 0) {
|
|
39
|
+
this.props.updateDirtyState(true);
|
|
40
|
+
void this._debouncer.invoke();
|
|
41
|
+
}
|
|
42
|
+
this.props.onSelect(this.props.settings.id);
|
|
43
|
+
};
|
|
44
|
+
const { settings } = props;
|
|
45
|
+
this._formData = settings.composite;
|
|
46
|
+
this.state = {
|
|
47
|
+
isModified: settings.isModified,
|
|
48
|
+
uiSchema: {},
|
|
49
|
+
filteredSchema: this.props.settings.schema,
|
|
50
|
+
formContext: {
|
|
51
|
+
defaultFormData: this.props.settings.default(),
|
|
52
|
+
settings: this.props.settings
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
this.handleChange = this.handleChange.bind(this);
|
|
56
|
+
this._debouncer = new Debouncer(this.handleChange);
|
|
57
|
+
}
|
|
58
|
+
componentDidMount() {
|
|
59
|
+
this._setUiSchema();
|
|
60
|
+
this._setFilteredSchema();
|
|
61
|
+
}
|
|
62
|
+
componentDidUpdate(prevProps) {
|
|
63
|
+
this._setUiSchema(prevProps.renderers[prevProps.settings.id]);
|
|
64
|
+
this._setFilteredSchema(prevProps.filteredValues);
|
|
65
|
+
if (prevProps.settings !== this.props.settings) {
|
|
66
|
+
this.setState({
|
|
67
|
+
formContext: {
|
|
68
|
+
settings: this.props.settings,
|
|
69
|
+
defaultFormData: this.props.settings.default()
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
componentWillUnmount() {
|
|
75
|
+
this._debouncer.dispose();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Handler for edits made in the form editor.
|
|
79
|
+
*/
|
|
80
|
+
handleChange() {
|
|
81
|
+
// Prevent unnecessary save when opening settings that haven't been modified.
|
|
82
|
+
if (!this.props.settings.isModified &&
|
|
83
|
+
this.props.settings.isDefault(this._formData)) {
|
|
84
|
+
this.props.updateDirtyState(false);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this.props.settings
|
|
88
|
+
.save(JSON.stringify(this._formData, undefined, JSON_INDENTATION))
|
|
89
|
+
.then(() => {
|
|
90
|
+
this.props.updateDirtyState(false);
|
|
91
|
+
this.setState({ isModified: this.props.settings.isModified });
|
|
92
|
+
})
|
|
93
|
+
.catch((reason) => {
|
|
94
|
+
this.props.updateDirtyState(false);
|
|
95
|
+
const trans = this.props.translator.load('jupyterlab');
|
|
96
|
+
void showErrorMessage(trans.__('Error saving settings.'), reason);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
const trans = this.props.translator.load('jupyterlab');
|
|
101
|
+
const icon = this.props.isCollapsed ? caretRightIcon : caretDownIcon;
|
|
102
|
+
return (React.createElement("div", null,
|
|
103
|
+
React.createElement("div", { className: "jp-SettingsHeader", onClick: () => {
|
|
104
|
+
this.props.onCollapseChange(!this.props.isCollapsed);
|
|
105
|
+
this.props.onSelect(this.props.settings.id);
|
|
106
|
+
} },
|
|
107
|
+
React.createElement("header", { className: "jp-SettingsTitle" },
|
|
108
|
+
React.createElement(icon.react, { tag: "span", elementPosition: "center", className: "jp-SettingsTitle-caret" }),
|
|
109
|
+
React.createElement("h2", null, this.props.settings.schema.title),
|
|
110
|
+
React.createElement("div", { className: "jp-SettingsHeader-description" }, this.props.settings.schema.description)),
|
|
111
|
+
this.state.isModified && (React.createElement("button", { className: "jp-RestoreButton", onClick: this.reset }, trans.__('Restore to Defaults')))),
|
|
112
|
+
!this.props.isCollapsed && (React.createElement(FormComponent, { validator: validatorAjv8, schema: this.state.filteredSchema, formData: this._formData, uiSchema: this.state.uiSchema, fields: this.props.renderers[this.props.settings.id], formContext: this.state.formContext, liveValidate: true, idPrefix: `jp-SettingsEditor-${this.props.settings.id}`, onChange: this._onChange, translator: this.props.translator }))));
|
|
113
|
+
}
|
|
114
|
+
_setUiSchema(prevRenderers) {
|
|
115
|
+
var _a;
|
|
116
|
+
const renderers = this.props.renderers[this.props.settings.id];
|
|
117
|
+
if (!JSONExt.deepEqual(Object.keys(prevRenderers !== null && prevRenderers !== void 0 ? prevRenderers : {}).sort(), Object.keys(renderers !== null && renderers !== void 0 ? renderers : {}).sort())) {
|
|
118
|
+
/**
|
|
119
|
+
* Construct uiSchema to pass any custom renderers to the form editor.
|
|
120
|
+
*/
|
|
121
|
+
const uiSchema = {};
|
|
122
|
+
for (const id in this.props.renderers[this.props.settings.id]) {
|
|
123
|
+
if (Object.keys((_a = this.props.settings.schema.properties) !== null && _a !== void 0 ? _a : {}).includes(id)) {
|
|
124
|
+
uiSchema[id] = {
|
|
125
|
+
'ui:field': id
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
this.setState({ uiSchema });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
_setFilteredSchema(prevFilteredValues) {
|
|
133
|
+
var _a, _b, _c, _d;
|
|
134
|
+
if (prevFilteredValues === undefined ||
|
|
135
|
+
!JSONExt.deepEqual(prevFilteredValues, this.props.filteredValues)) {
|
|
136
|
+
/**
|
|
137
|
+
* Only show fields that match search value.
|
|
138
|
+
*/
|
|
139
|
+
const filteredSchema = JSONExt.deepCopy(this.props.settings.schema);
|
|
140
|
+
if ((_b = (_a = this.props.filteredValues) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) {
|
|
141
|
+
for (const field in filteredSchema.properties) {
|
|
142
|
+
if (!((_c = this.props.filteredValues) === null || _c === void 0 ? void 0 : _c.includes((_d = filteredSchema.properties[field].title) !== null && _d !== void 0 ? _d : field))) {
|
|
143
|
+
delete filteredSchema.properties[field];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
this.setState({ filteredSchema });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=SettingsFormEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsFormEditor.js","sourceRoot":"","sources":["../src/SettingsFormEditor.tsx"],"names":[],"mappings":"AAAA;;;+EAG+E;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EACL,aAAa,EACb,cAAc,E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MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACpE,IAAI,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,cAAc,0CAAE,MAAM,mCAAI,CAAC,GAAG,CAAC,EAAE;gBAC9C,KAAK,MAAM,KAAK,IAAI,cAAc,CAAC,UAAU,EAAE;oBAC7C,IACE,CAAC,CAAA,MAAA,IAAI,CAAC,KAAK,CAAC,cAAc,0CAAE,QAAQ,CAClC,MAAA,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,mCAAI,KAAK,CAChD,CAAA,EACD;wBACA,OAAO,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;qBACzC;iBACF;aACF;YAED,IAAI,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;SACnC;IACH,CAAC;CAIF"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAC3D;;;GAGG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAC3D;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC"}
|
package/lib/inspector.js
CHANGED
|
@@ -42,9 +42,8 @@ class InspectorConnector extends DataConnector {
|
|
|
42
42
|
constructor(editor, translator) {
|
|
43
43
|
super();
|
|
44
44
|
this._current = 0;
|
|
45
|
-
this.translator = translator || nullTranslator;
|
|
46
45
|
this._editor = editor;
|
|
47
|
-
this._trans =
|
|
46
|
+
this._trans = (translator !== null && translator !== void 0 ? translator : nullTranslator).load('jupyterlab');
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
50
49
|
* Fetch inspection requests.
|
|
@@ -63,50 +62,45 @@ class InspectorConnector extends DataConnector {
|
|
|
63
62
|
metadata: {}
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
|
-
resolve({ data:
|
|
65
|
+
resolve({ data: this.render(errors), metadata: {} });
|
|
67
66
|
}, 100));
|
|
68
67
|
});
|
|
69
68
|
}
|
|
70
|
-
_validate(raw) {
|
|
71
|
-
const editor = this._editor;
|
|
72
|
-
if (!editor.settings) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
const { id, schema, version } = editor.settings;
|
|
76
|
-
const data = { composite: {}, user: {} };
|
|
77
|
-
const validator = editor.registry.validator;
|
|
78
|
-
return validator.validateData({ data, id, raw, schema, version }, false);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A namespace for private module data.
|
|
83
|
-
*/
|
|
84
|
-
var Private;
|
|
85
|
-
(function (Private) {
|
|
86
69
|
/**
|
|
87
70
|
* Render validation errors as an HTML string.
|
|
88
71
|
*/
|
|
89
|
-
|
|
90
|
-
return {
|
|
72
|
+
render(errors) {
|
|
73
|
+
return {
|
|
74
|
+
'text/markdown': errors.map(this.renderError.bind(this)).join('')
|
|
75
|
+
};
|
|
91
76
|
}
|
|
92
|
-
Private.render = render;
|
|
93
77
|
/**
|
|
94
78
|
* Render an individual validation error as a markdown string.
|
|
95
79
|
*/
|
|
96
|
-
|
|
80
|
+
renderError(error) {
|
|
97
81
|
var _a;
|
|
98
82
|
switch (error.keyword) {
|
|
99
83
|
case 'additionalProperties':
|
|
100
|
-
return `**\`[additional property error]\`**
|
|
101
|
-
|
|
84
|
+
return `**\`[${this._trans.__('additional property error')}]\`**
|
|
85
|
+
${this._trans.__('`%1` is not a valid property', (_a = error.params) === null || _a === void 0 ? void 0 : _a.additionalProperty)}`;
|
|
102
86
|
case 'syntax':
|
|
103
|
-
return `**\`[syntax error]\`** *${error.message}*`;
|
|
87
|
+
return `**\`[${this._trans.__('syntax error')}]\`** *${error.message}*`;
|
|
104
88
|
case 'type':
|
|
105
|
-
return `**\`[type error]\`**
|
|
106
|
-
\`${error.
|
|
89
|
+
return `**\`[${this._trans.__('type error')}]\`**
|
|
90
|
+
\`${error.instancePath}\` ${error.message}`;
|
|
107
91
|
default:
|
|
108
|
-
return `**\`[error]\`** *${error.message}*`;
|
|
92
|
+
return `**\`[${this._trans.__('error')}]\`** *${error.message}*`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
_validate(raw) {
|
|
96
|
+
const editor = this._editor;
|
|
97
|
+
if (!editor.settings) {
|
|
98
|
+
return null;
|
|
109
99
|
}
|
|
100
|
+
const { id, schema, version } = editor.settings;
|
|
101
|
+
const data = { composite: {}, user: {} };
|
|
102
|
+
const validator = editor.registry.validator;
|
|
103
|
+
return validator.validateData({ data, id, raw, schema, version }, false);
|
|
110
104
|
}
|
|
111
|
-
}
|
|
105
|
+
}
|
|
112
106
|
//# sourceMappingURL=inspector.js.map
|
package/lib/inspector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../src/inspector.ts"],"names":[],"mappings":"AAAA;;;+EAG+E;AAE/E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAEL,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAEL,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAIjC;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAiB,EACjB,UAAgC,EAChC,UAAwB;IAExB,UAAU,GAAG,UAAU,IAAI,cAAc,CAAC;IAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC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,OAAO,CAAC,UAAU,KAAK,CAAC,OAAO,GAAG,CAAC;SACpE;IACH,CAAC;IAEO,SAAS,CAAC,GAAW;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YACpB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChD,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QAE5C,OAAO,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;CAKF"}
|
|
@@ -7,15 +7,15 @@ import { CommandRegistry } from '@lumino/commands';
|
|
|
7
7
|
import { JSONObject } from '@lumino/coreutils';
|
|
8
8
|
import { Message } from '@lumino/messaging';
|
|
9
9
|
import { ISignal } from '@lumino/signaling';
|
|
10
|
-
import {
|
|
10
|
+
import { SplitPanel } from '@lumino/widgets';
|
|
11
11
|
/**
|
|
12
12
|
* An interface for modifying and saving application settings.
|
|
13
13
|
*/
|
|
14
|
-
export declare class
|
|
14
|
+
export declare class JsonSettingEditor extends SplitPanel {
|
|
15
15
|
/**
|
|
16
16
|
* Create a new setting editor.
|
|
17
17
|
*/
|
|
18
|
-
constructor(options:
|
|
18
|
+
constructor(options: JsonSettingEditor.IOptions);
|
|
19
19
|
/**
|
|
20
20
|
* The state database key for the editor's state management.
|
|
21
21
|
*/
|
|
@@ -93,15 +93,14 @@ export declare class SettingEditor extends Widget {
|
|
|
93
93
|
private _fetching;
|
|
94
94
|
private _instructions;
|
|
95
95
|
private _list;
|
|
96
|
-
private _panel;
|
|
97
96
|
private _saving;
|
|
98
97
|
private _state;
|
|
99
98
|
private _when;
|
|
100
99
|
}
|
|
101
100
|
/**
|
|
102
|
-
* A namespace for `
|
|
101
|
+
* A namespace for `JsonSettingEditor` statics.
|
|
103
102
|
*/
|
|
104
|
-
export declare namespace
|
|
103
|
+
export declare namespace JsonSettingEditor {
|
|
105
104
|
/**
|
|
106
105
|
* The instantiation options for a setting editor.
|
|
107
106
|
*/
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
| Distributed under the terms of the Modified BSD License.
|
|
4
4
|
|----------------------------------------------------------------------------*/
|
|
5
5
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
6
|
-
import { jupyterIcon } from '@jupyterlab/ui-components';
|
|
6
|
+
import { jupyterIcon, ReactWidget } from '@jupyterlab/ui-components';
|
|
7
7
|
import { JSONExt } from '@lumino/coreutils';
|
|
8
|
-
import {
|
|
8
|
+
import { SplitPanel } from '@lumino/widgets';
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
import * as ReactDOM from 'react-dom';
|
|
11
10
|
import { PluginEditor } from './plugineditor';
|
|
12
11
|
import { PluginList } from './pluginlist';
|
|
13
|
-
import { SplitPanel } from './splitpanel';
|
|
14
12
|
/**
|
|
15
13
|
* The ratio panes in the setting editor.
|
|
16
14
|
*/
|
|
@@ -25,28 +23,32 @@ const DEFAULT_LAYOUT = {
|
|
|
25
23
|
/**
|
|
26
24
|
* An interface for modifying and saving application settings.
|
|
27
25
|
*/
|
|
28
|
-
export class
|
|
26
|
+
export class JsonSettingEditor extends SplitPanel {
|
|
29
27
|
/**
|
|
30
28
|
* Create a new setting editor.
|
|
31
29
|
*/
|
|
32
30
|
constructor(options) {
|
|
33
|
-
super(
|
|
31
|
+
super({
|
|
32
|
+
orientation: 'horizontal',
|
|
33
|
+
renderer: SplitPanel.defaultRenderer,
|
|
34
|
+
spacing: 1
|
|
35
|
+
});
|
|
34
36
|
this._fetching = null;
|
|
35
37
|
this._saving = false;
|
|
36
38
|
this._state = JSONExt.deepCopy(DEFAULT_LAYOUT);
|
|
37
39
|
this.translator = options.translator || nullTranslator;
|
|
40
|
+
const trans = this.translator.load('jupyterlab');
|
|
38
41
|
this.addClass('jp-SettingEditor');
|
|
39
42
|
this.key = options.key;
|
|
40
43
|
this.state = options.state;
|
|
41
44
|
const { commands, editorFactory, rendermime } = options;
|
|
42
|
-
const layout = (this.layout = new PanelLayout());
|
|
43
45
|
const registry = (this.registry = options.registry);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const instructions = (this._instructions = ReactWidget.create(React.createElement(React.Fragment, null,
|
|
47
|
+
React.createElement("h2", null,
|
|
48
|
+
React.createElement(jupyterIcon.react, { className: "jp-SettingEditorInstructions-icon", tag: "span", elementPosition: "center", height: "auto", width: "60px" }),
|
|
49
|
+
React.createElement("span", { className: "jp-SettingEditorInstructions-title" }, trans.__('Settings'))),
|
|
50
|
+
React.createElement("span", { className: "jp-SettingEditorInstructions-text" }, trans.__('Select a plugin from the list to view and edit its preferences.')))));
|
|
51
|
+
instructions.addClass('jp-SettingEditorInstructions');
|
|
50
52
|
const editor = (this._editor = new PluginEditor({
|
|
51
53
|
commands,
|
|
52
54
|
editorFactory,
|
|
@@ -61,21 +63,17 @@ export class SettingEditor extends Widget {
|
|
|
61
63
|
translator: this.translator
|
|
62
64
|
}));
|
|
63
65
|
const when = options.when;
|
|
64
|
-
instructions.addClass('jp-SettingEditorInstructions');
|
|
65
|
-
Private.populateInstructionsNode(instructions.node, this.translator);
|
|
66
66
|
if (when) {
|
|
67
67
|
this._when = Array.isArray(when) ? Promise.all(when) : when;
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
panel.addWidget(list);
|
|
72
|
-
panel.addWidget(instructions);
|
|
69
|
+
this.addWidget(list);
|
|
70
|
+
this.addWidget(instructions);
|
|
73
71
|
SplitPanel.setStretch(list, 0);
|
|
74
72
|
SplitPanel.setStretch(instructions, 1);
|
|
75
73
|
SplitPanel.setStretch(editor, 1);
|
|
76
74
|
editor.stateChanged.connect(this._onStateChanged, this);
|
|
77
75
|
list.changed.connect(this._onStateChanged, this);
|
|
78
|
-
|
|
76
|
+
this.handleMoved.connect(this._onStateChanged, this);
|
|
79
77
|
}
|
|
80
78
|
/**
|
|
81
79
|
* Whether the raw editor revert functionality is enabled.
|
|
@@ -118,7 +116,6 @@ export class SettingEditor extends Widget {
|
|
|
118
116
|
this._editor.dispose();
|
|
119
117
|
this._instructions.dispose();
|
|
120
118
|
this._list.dispose();
|
|
121
|
-
this._panel.dispose();
|
|
122
119
|
}
|
|
123
120
|
/**
|
|
124
121
|
* Revert raw editor back to original settings.
|
|
@@ -137,15 +134,15 @@ export class SettingEditor extends Widget {
|
|
|
137
134
|
*/
|
|
138
135
|
onAfterAttach(msg) {
|
|
139
136
|
super.onAfterAttach(msg);
|
|
140
|
-
this.
|
|
137
|
+
this.hide();
|
|
141
138
|
this._fetchState()
|
|
142
139
|
.then(() => {
|
|
143
|
-
this.
|
|
140
|
+
this.show();
|
|
144
141
|
this._setState();
|
|
145
142
|
})
|
|
146
143
|
.catch(reason => {
|
|
147
144
|
console.error('Fetching setting editor state failed', reason);
|
|
148
|
-
this.
|
|
145
|
+
this.show();
|
|
149
146
|
this._setState();
|
|
150
147
|
});
|
|
151
148
|
}
|
|
@@ -184,7 +181,7 @@ export class SettingEditor extends Widget {
|
|
|
184
181
|
* Handle root level layout state changes.
|
|
185
182
|
*/
|
|
186
183
|
async _onStateChanged() {
|
|
187
|
-
this._state.sizes = this.
|
|
184
|
+
this._state.sizes = this.relativeSizes();
|
|
188
185
|
this._state.container = this._editor.state;
|
|
189
186
|
this._state.container.plugin = this._list.selection;
|
|
190
187
|
try {
|
|
@@ -216,13 +213,12 @@ export class SettingEditor extends Widget {
|
|
|
216
213
|
*/
|
|
217
214
|
_setLayout() {
|
|
218
215
|
const editor = this._editor;
|
|
219
|
-
const panel = this._panel;
|
|
220
216
|
const state = this._state;
|
|
221
217
|
editor.state = state.container;
|
|
222
218
|
// Allow the message queue (which includes fit requests that might disrupt
|
|
223
219
|
// setting relative sizes) to clear before setting sizes.
|
|
224
220
|
requestAnimationFrame(() => {
|
|
225
|
-
|
|
221
|
+
this.setRelativeSizes(state.sizes);
|
|
226
222
|
});
|
|
227
223
|
}
|
|
228
224
|
/**
|
|
@@ -231,7 +227,6 @@ export class SettingEditor extends Widget {
|
|
|
231
227
|
_setState() {
|
|
232
228
|
const editor = this._editor;
|
|
233
229
|
const list = this._list;
|
|
234
|
-
const panel = this._panel;
|
|
235
230
|
const { container } = this._state;
|
|
236
231
|
if (!container.plugin) {
|
|
237
232
|
editor.settings = null;
|
|
@@ -251,7 +246,7 @@ export class SettingEditor extends Widget {
|
|
|
251
246
|
instructions.parent = null;
|
|
252
247
|
}
|
|
253
248
|
if (!editor.isAttached) {
|
|
254
|
-
|
|
249
|
+
this.addWidget(editor);
|
|
255
250
|
}
|
|
256
251
|
editor.settings = settings;
|
|
257
252
|
list.selection = container.plugin;
|
|
@@ -270,19 +265,6 @@ export class SettingEditor extends Widget {
|
|
|
270
265
|
*/
|
|
271
266
|
var Private;
|
|
272
267
|
(function (Private) {
|
|
273
|
-
/**
|
|
274
|
-
* Populate the instructions text node.
|
|
275
|
-
*/
|
|
276
|
-
function populateInstructionsNode(node, translator) {
|
|
277
|
-
translator = translator || nullTranslator;
|
|
278
|
-
const trans = translator.load('jupyterlab');
|
|
279
|
-
ReactDOM.render(React.createElement(React.Fragment, null,
|
|
280
|
-
React.createElement("h2", null,
|
|
281
|
-
React.createElement(jupyterIcon.react, { className: "jp-SettingEditorInstructions-icon", tag: "span", elementPosition: "center", height: "auto", width: "60px" }),
|
|
282
|
-
React.createElement("span", { className: "jp-SettingEditorInstructions-title" }, "Settings")),
|
|
283
|
-
React.createElement("span", { className: "jp-SettingEditorInstructions-text" }, trans.__('Select a plugin from the list to view and edit its preferences.'))), node);
|
|
284
|
-
}
|
|
285
|
-
Private.populateInstructionsNode = populateInstructionsNode;
|
|
286
268
|
/**
|
|
287
269
|
* Return a normalized restored layout state that defaults to the presets.
|
|
288
270
|
*/
|
|
@@ -320,4 +302,4 @@ var Private;
|
|
|
320
302
|
return Array.isArray(value) && value.every(x => typeof x === 'number');
|
|
321
303
|
}
|
|
322
304
|
})(Private || (Private = {}));
|
|
323
|
-
//# sourceMappingURL=
|
|
305
|
+
//# sourceMappingURL=jsonsettingeditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonsettingeditor.js","sourceRoot":"","sources":["../src/jsonsettingeditor.tsx"],"names":[],"mappings":"AAAA;;;+EAG+E;AAM/E,OAAO,EAAe,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAyB,MAAM,mBAAmB,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAU,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,cAAc,GAAmC;IACrD,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACb,SAAS,EAAE;QACT,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KACd;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAC/C;;OAEG;IACH,YAAY,OAAmC;QAC7C,KAAK,CAAC;YACJ,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,UAAU,CAAC,eAAe;YACpC,OAAO,EAAE,CAAC;SACX,CAAC,CAAC;QAgSG,cAAS,GAAyB,IAAI,CAA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@ import { Message } from '@lumino/messaging';
|
|
|
7
7
|
import { ISignal } from '@lumino/signaling';
|
|
8
8
|
import { Widget } from '@lumino/widgets';
|
|
9
9
|
import { RawEditor } from './raweditor';
|
|
10
|
-
import {
|
|
10
|
+
import { JsonSettingEditor } from './jsonsettingeditor';
|
|
11
11
|
/**
|
|
12
12
|
* An individual plugin settings editor.
|
|
13
13
|
*/
|
|
@@ -34,8 +34,8 @@ export declare class PluginEditor extends Widget {
|
|
|
34
34
|
/**
|
|
35
35
|
* The plugin editor layout state.
|
|
36
36
|
*/
|
|
37
|
-
get state():
|
|
38
|
-
set state(state:
|
|
37
|
+
get state(): JsonSettingEditor.IPluginLayout;
|
|
38
|
+
set state(state: JsonSettingEditor.IPluginLayout);
|
|
39
39
|
/**
|
|
40
40
|
* A signal that emits when editor layout state changes and needs to be saved.
|
|
41
41
|
*/
|