@jupyterlab/settingeditor 3.3.0-beta.0 → 3.3.0-rc.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/lib/SettingsFormEditor.js +54 -29
- package/lib/SettingsFormEditor.js.map +1 -1
- package/package.json +10 -10
- package/style/base.css +79 -42
|
@@ -7,10 +7,14 @@ import { caretDownIcon, caretRightIcon } from '@jupyterlab/ui-components';
|
|
|
7
7
|
import { reduce } from '@lumino/algorithm';
|
|
8
8
|
import { JSONExt } from '@lumino/coreutils';
|
|
9
9
|
import { Debouncer } from '@lumino/polling';
|
|
10
|
-
import Form from '@rjsf/core';
|
|
10
|
+
import Form, { utils } from '@rjsf/core';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Indentation to use when saving the settings as JSON document.
|
|
14
|
+
*/
|
|
15
|
+
const JSON_INDENTATION = 4;
|
|
16
|
+
/**
|
|
17
|
+
* Template to allow for custom buttons to re-order/remove entries in an array.
|
|
14
18
|
* Necessary to create accessible buttons.
|
|
15
19
|
*/
|
|
16
20
|
const CustomArrayTemplateFactory = (translator) => {
|
|
@@ -19,27 +23,41 @@ const CustomArrayTemplateFactory = (translator) => {
|
|
|
19
23
|
var _a;
|
|
20
24
|
return (React.createElement("div", { className: props.className },
|
|
21
25
|
React.createElement(props.TitleField, { title: props.title, required: props.required, id: `${props.idSchema.$id}-title` }),
|
|
22
|
-
React.createElement(props.DescriptionField, { id: `${props.idSchema.$id}-
|
|
26
|
+
React.createElement(props.DescriptionField, { id: `${props.idSchema.$id}-description`, description: (_a = props.schema.description) !== null && _a !== void 0 ? _a : '' }),
|
|
23
27
|
props.items.map(item => {
|
|
24
28
|
return (React.createElement("div", { key: item.key, className: item.className },
|
|
25
29
|
item.children,
|
|
26
30
|
React.createElement("div", { className: "jp-ArrayOperations" },
|
|
27
|
-
React.createElement("button", { onClick: item.onReorderClick(item.index, item.index - 1), disabled: !item.hasMoveUp }, trans.__('Move Up')),
|
|
28
|
-
React.createElement("button", { onClick: item.onReorderClick(item.index, item.index + 1), disabled: !item.hasMoveDown }, trans.__('Move Down')),
|
|
29
|
-
React.createElement("button", { onClick: item.onDropIndexClick(item.index), disabled: !item.hasRemove }, trans.__('Remove')))));
|
|
31
|
+
React.createElement("button", { className: "jp-mod-styled jp-mod-reject", onClick: item.onReorderClick(item.index, item.index - 1), disabled: !item.hasMoveUp }, trans.__('Move Up')),
|
|
32
|
+
React.createElement("button", { className: "jp-mod-styled jp-mod-reject", onClick: item.onReorderClick(item.index, item.index + 1), disabled: !item.hasMoveDown }, trans.__('Move Down')),
|
|
33
|
+
React.createElement("button", { className: "jp-mod-styled jp-mod-warn", onClick: item.onDropIndexClick(item.index), disabled: !item.hasRemove }, trans.__('Remove')))));
|
|
30
34
|
}),
|
|
31
|
-
props.canAdd && (React.createElement("button", { className: "
|
|
32
|
-
props.onAddClick();
|
|
33
|
-
} }, trans.__('Add')))));
|
|
35
|
+
props.canAdd && (React.createElement("button", { className: "jp-mod-styled jp-mod-reject", onClick: props.onAddClick }, trans.__('Add')))));
|
|
34
36
|
};
|
|
35
37
|
factory.displayName = 'CustomArrayTemplate';
|
|
36
38
|
return factory;
|
|
37
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Template with custom add button, necessary for accessiblity and internationalization.
|
|
42
|
+
*/
|
|
43
|
+
const CustomObjectTemplateFactory = (translator) => {
|
|
44
|
+
const trans = translator.load('jupyterlab');
|
|
45
|
+
const factory = (props) => {
|
|
46
|
+
const { TitleField, DescriptionField } = props;
|
|
47
|
+
return (React.createElement("fieldset", { id: props.idSchema.$id },
|
|
48
|
+
(props.uiSchema['ui:title'] || props.title) && (React.createElement(TitleField, { id: `${props.idSchema.$id}__title`, title: props.title || props.uiSchema['ui:title'], required: props.required })),
|
|
49
|
+
props.description && (React.createElement(DescriptionField, { id: `${props.idSchema.$id}__description`, description: props.description })),
|
|
50
|
+
props.properties.map(property => property.content),
|
|
51
|
+
utils.canExpand(props.schema, props.uiSchema, props.formData) && (React.createElement("button", { className: "jp-mod-styled jp-mod-reject", onClick: props.onAddClick(props.schema), disabled: props.disabled || props.readonly }, trans.__('Add')))));
|
|
52
|
+
};
|
|
53
|
+
factory.displayName = 'CustomObjectTemplate';
|
|
54
|
+
return factory;
|
|
55
|
+
};
|
|
38
56
|
/**
|
|
39
57
|
* Renders the modified indicator and errors
|
|
40
58
|
*/
|
|
41
59
|
const CustomTemplate = (props) => {
|
|
42
|
-
const { formData, schema, label, displayLabel, id, formContext, errors, rawErrors, children } = props;
|
|
60
|
+
const { formData, schema, label, displayLabel, id, formContext, errors, rawErrors, children, onKeyChange, onDropPropertyClick } = props;
|
|
43
61
|
/**
|
|
44
62
|
* Determine if the field has been modified
|
|
45
63
|
* Schema Id is formatted as 'root_<field name>.<nexted field name>'
|
|
@@ -66,17 +84,30 @@ const CustomTemplate = (props) => {
|
|
|
66
84
|
!schema.properties &&
|
|
67
85
|
schema.type !== 'array' &&
|
|
68
86
|
!JSONExt.deepEqual(formData, defaultValue);
|
|
69
|
-
|
|
87
|
+
const isRoot = schemaId === '';
|
|
88
|
+
const needsDescription = !isRoot &&
|
|
89
|
+
schema.type != 'object' &&
|
|
90
|
+
id !=
|
|
91
|
+
'jp-SettingsEditor-@jupyterlab/shortcuts-extension:shortcuts_shortcuts';
|
|
92
|
+
// While we can implement "remove" button for array items in array template,
|
|
93
|
+
// object templates do not provide a way to do this; instead we need to add
|
|
94
|
+
// buttons here (and first check if the field can be removed = is additional).
|
|
95
|
+
const isAdditional = schema.hasOwnProperty(utils.ADDITIONAL_PROPERTY_FLAG);
|
|
96
|
+
return (React.createElement("div", { className: `form-group ${displayLabel || schema.type === 'boolean' ? 'small-field' : ''}` },
|
|
70
97
|
// Only show the modified indicator if there are no errors
|
|
71
98
|
isModified && !rawErrors && React.createElement("div", { className: "jp-modifiedIndicator" }),
|
|
72
99
|
// Shows a red indicator for fields that have validation errors
|
|
73
100
|
rawErrors && React.createElement("div", { className: "jp-modifiedIndicator jp-errorIndicator" }),
|
|
74
|
-
React.createElement("div",
|
|
75
|
-
displayLabel &&
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
101
|
+
React.createElement("div", { className: "jp-FormGroup-content" },
|
|
102
|
+
displayLabel && !isRoot && label && !isAdditional && (React.createElement("h3", { className: "jp-FormGroup-fieldLabel jp-FormGroup-contentItem" }, label)),
|
|
103
|
+
isAdditional && (React.createElement("input", { className: "jp-FormGroup-contentItem jp-mod-styled", type: "text", onBlur: event => onKeyChange(event.target.value), defaultValue: label })),
|
|
104
|
+
React.createElement("div", { className: `${isRoot
|
|
105
|
+
? 'jp-root'
|
|
106
|
+
: schema.type === 'object'
|
|
107
|
+
? 'jp-objectFieldWrapper'
|
|
108
|
+
: 'jp-inputFieldWrapper jp-FormGroup-contentItem'}` }, children),
|
|
109
|
+
isAdditional && (React.createElement("button", { className: "jp-FormGroup-contentItem jp-mod-styled jp-mod-warn jp-FormGroup-removeButton", onClick: onDropPropertyClick(label) }, 'Remove')),
|
|
110
|
+
schema.description && needsDescription && (React.createElement("div", { className: "jp-FormGroup-description" }, schema.description)),
|
|
80
111
|
React.createElement("div", { className: "validationErrors" }, errors))));
|
|
81
112
|
};
|
|
82
113
|
/**
|
|
@@ -125,7 +156,7 @@ export class SettingsFormEditor extends React.Component {
|
|
|
125
156
|
return;
|
|
126
157
|
}
|
|
127
158
|
this.props.settings
|
|
128
|
-
.save(JSON.stringify(this.state.formData))
|
|
159
|
+
.save(JSON.stringify(this.state.formData, undefined, JSON_INDENTATION))
|
|
129
160
|
.then(() => {
|
|
130
161
|
this.props.updateDirtyState(false);
|
|
131
162
|
this.setState({ isModified: this.props.settings.isModified });
|
|
@@ -156,18 +187,12 @@ export class SettingsFormEditor extends React.Component {
|
|
|
156
187
|
this.props.onCollapseChange(!this.props.isCollapsed);
|
|
157
188
|
this.props.onSelect(this.props.settings.id);
|
|
158
189
|
} },
|
|
159
|
-
React.createElement("
|
|
160
|
-
React.createElement(icon.react, { tag: "span", elementPosition: "center" }),
|
|
161
|
-
React.createElement("h2", null,
|
|
162
|
-
|
|
163
|
-
this.props.settings.schema.title,
|
|
164
|
-
" "),
|
|
165
|
-
React.createElement("h3", null,
|
|
166
|
-
" ",
|
|
167
|
-
this.props.settings.schema.description,
|
|
168
|
-
" ")),
|
|
190
|
+
React.createElement("header", { className: "jp-SettingsTitle" },
|
|
191
|
+
React.createElement(icon.react, { tag: "span", elementPosition: "center", className: "jp-SettingsTitle-caret" }),
|
|
192
|
+
React.createElement("h2", null, this.props.settings.schema.title),
|
|
193
|
+
React.createElement("div", { className: "jp-SettingsHeader-description" }, this.props.settings.schema.description)),
|
|
169
194
|
this.state.isModified && (React.createElement("button", { className: "jp-RestoreButton", onClick: this.reset }, trans.__('Restore to Defaults')))),
|
|
170
|
-
!this.props.isCollapsed && (React.createElement(Form, { schema: this.props.settings.schema, formData: this.state.formData, FieldTemplate: CustomTemplate, ArrayFieldTemplate: CustomArrayTemplateFactory(this.props.translator), uiSchema: uiSchema, fields: this.props.renderers, formContext: { settings: this.props.settings }, liveValidate: true, idPrefix: `jp-SettingsEditor-${this.props.settings.id}`, onChange: (e) => {
|
|
195
|
+
!this.props.isCollapsed && (React.createElement(Form, { schema: this.props.settings.schema, formData: this.state.formData, FieldTemplate: CustomTemplate, ArrayFieldTemplate: CustomArrayTemplateFactory(this.props.translator), ObjectFieldTemplate: CustomObjectTemplateFactory(this.props.translator), uiSchema: uiSchema, fields: this.props.renderers, formContext: { settings: this.props.settings }, liveValidate: true, idPrefix: `jp-SettingsEditor-${this.props.settings.id}`, onChange: (e) => {
|
|
171
196
|
this.props.hasError(e.errors.length !== 0);
|
|
172
197
|
this.setState({ formData: e.formData });
|
|
173
198
|
if (e.errors.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsFormEditor.js","sourceRoot":"","sources":["../src/SettingsFormEditor.tsx"],"names":[],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@@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/settingeditor",
|
|
3
|
-
"version": "3.3.0-
|
|
3
|
+
"version": "3.3.0-rc.0",
|
|
4
4
|
"description": "The JupyterLab default setting editor interface",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"watch": "tsc -b --watch"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jupyterlab/application": "^3.3.0-
|
|
40
|
-
"@jupyterlab/apputils": "^3.3.0-
|
|
41
|
-
"@jupyterlab/codeeditor": "^3.3.0-
|
|
42
|
-
"@jupyterlab/inspector": "^3.3.0-
|
|
43
|
-
"@jupyterlab/rendermime": "^3.3.0-
|
|
44
|
-
"@jupyterlab/settingregistry": "^3.3.0-
|
|
45
|
-
"@jupyterlab/statedb": "^3.3.0-
|
|
46
|
-
"@jupyterlab/translation": "^3.3.0-
|
|
47
|
-
"@jupyterlab/ui-components": "^3.3.0-
|
|
39
|
+
"@jupyterlab/application": "^3.3.0-rc.0",
|
|
40
|
+
"@jupyterlab/apputils": "^3.3.0-rc.0",
|
|
41
|
+
"@jupyterlab/codeeditor": "^3.3.0-rc.0",
|
|
42
|
+
"@jupyterlab/inspector": "^3.3.0-rc.0",
|
|
43
|
+
"@jupyterlab/rendermime": "^3.3.0-rc.0",
|
|
44
|
+
"@jupyterlab/settingregistry": "^3.3.0-rc.0",
|
|
45
|
+
"@jupyterlab/statedb": "^3.3.0-rc.0",
|
|
46
|
+
"@jupyterlab/translation": "^3.3.0-rc.0",
|
|
47
|
+
"@jupyterlab/ui-components": "^3.3.0-rc.0",
|
|
48
48
|
"@lumino/algorithm": "^1.3.3",
|
|
49
49
|
"@lumino/commands": "^1.12.0",
|
|
50
50
|
"@lumino/coreutils": "^1.5.3",
|
package/style/base.css
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
--jp-private-settingeditor-row-height: 16px;
|
|
11
11
|
--jp-private-settingeditor-toolbar-height: 28px;
|
|
12
12
|
--jp-private-settingeditor-type-width: 75px;
|
|
13
|
+
--jp-private-settingeditor-modifier-indent: 5px;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
.jp-SettingsPanel,
|
|
@@ -226,18 +227,31 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
226
227
|
padding: 6px 8px;
|
|
227
228
|
background: none;
|
|
228
229
|
color: var(--jp-content-font-color0);
|
|
230
|
+
height: inherit;
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
.jp-SettingsPanel fieldset input[type='checkbox'] {
|
|
232
234
|
position: relative;
|
|
233
235
|
top: 2px;
|
|
236
|
+
margin-left: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** copy of `input.jp-mod-styled:focus` style */
|
|
240
|
+
.jp-SettingsPanel fieldset input:focus {
|
|
241
|
+
border: var(--jp-border-width) solid var(--md-blue-500);
|
|
242
|
+
box-shadow: inset 0 0 4px var(--md-blue-300);
|
|
234
243
|
}
|
|
235
244
|
|
|
236
245
|
.jp-SettingsPanel .checkbox label {
|
|
237
246
|
cursor: pointer;
|
|
238
247
|
}
|
|
239
|
-
|
|
240
|
-
|
|
248
|
+
|
|
249
|
+
.jp-SettingsPanel .checkbox .field-description {
|
|
250
|
+
/* Disable default description field for checkbox:
|
|
251
|
+
because other widgets do not have description fields,
|
|
252
|
+
we add descriptions to each widget on the field level.
|
|
253
|
+
*/
|
|
254
|
+
display: none;
|
|
241
255
|
}
|
|
242
256
|
|
|
243
257
|
.jp-SettingsPanel button[type='submit'] {
|
|
@@ -245,17 +259,37 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
245
259
|
}
|
|
246
260
|
|
|
247
261
|
.jp-SettingsPanel .form-group {
|
|
248
|
-
padding: 0 16px 16px 5px;
|
|
249
262
|
display: flex;
|
|
263
|
+
padding: 4px 8px 4px var(--jp-private-settingeditor-modifier-indent);
|
|
250
264
|
margin-top: 5px;
|
|
251
265
|
}
|
|
252
266
|
|
|
253
|
-
.jp-SettingsPanel
|
|
254
|
-
|
|
267
|
+
.jp-SettingsPanel .jp-objectFieldWrapper .form-group {
|
|
268
|
+
padding: 2px 8px 2px var(--jp-private-settingeditor-modifier-indent);
|
|
269
|
+
margin-top: 2px;
|
|
255
270
|
}
|
|
256
271
|
|
|
257
|
-
.jp-
|
|
258
|
-
|
|
272
|
+
.jp-ArrayOperations {
|
|
273
|
+
margin-left: 8px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.jp-SettingsPanel .jp-FormGroup-content {
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
flex-wrap: wrap;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.jp-SettingsPanel .jp-FormGroup-contentItem {
|
|
283
|
+
margin-left: 7px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.jp-SettingsPanel .jp-FormGroup-description {
|
|
287
|
+
flex-basis: 100%;
|
|
288
|
+
padding: 4px 7px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.jp-SettingsPanel #root__description {
|
|
292
|
+
display: none;
|
|
259
293
|
}
|
|
260
294
|
|
|
261
295
|
.jp-SettingsPanel fieldset {
|
|
@@ -263,6 +297,10 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
263
297
|
padding: 0;
|
|
264
298
|
}
|
|
265
299
|
|
|
300
|
+
.jp-SettingsPanel fieldset:not(:first-child) {
|
|
301
|
+
margin-left: 7px;
|
|
302
|
+
}
|
|
303
|
+
|
|
266
304
|
.jp-SettingsPanel .jp-SaveSettingsBanner {
|
|
267
305
|
position: absolute;
|
|
268
306
|
bottom: 0;
|
|
@@ -287,25 +325,18 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
287
325
|
.jp-SettingsPanel .form-group.small-field:hover {
|
|
288
326
|
background: var(--jp-border-color3);
|
|
289
327
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
background-color: var(--jp-layout-color2);
|
|
328
|
+
|
|
329
|
+
.jp-SettingsPanel button.jp-mod-styled {
|
|
293
330
|
cursor: pointer;
|
|
294
|
-
margin: 2px;
|
|
295
|
-
padding: 5px;
|
|
296
|
-
border: none;
|
|
297
331
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
background-color: var(--jp-layout-color1);
|
|
332
|
+
|
|
333
|
+
.jp-SettingsPanel button.jp-mod-styled:disabled {
|
|
301
334
|
cursor: not-allowed;
|
|
335
|
+
opacity: 0.5;
|
|
302
336
|
}
|
|
303
337
|
|
|
304
|
-
.jp-SettingsPanel .array-item button
|
|
305
|
-
|
|
306
|
-
box-shadow: none;
|
|
307
|
-
border: none;
|
|
308
|
-
padding: 10px;
|
|
338
|
+
.jp-SettingsPanel .array-item button {
|
|
339
|
+
margin: 2px;
|
|
309
340
|
}
|
|
310
341
|
|
|
311
342
|
.jp-openJSONSettingsEditor {
|
|
@@ -339,10 +370,20 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
339
370
|
margin: 4px;
|
|
340
371
|
}
|
|
341
372
|
|
|
342
|
-
.jp-SettingsPanel .
|
|
373
|
+
.jp-SettingsPanel .field-array-of-string .array-item {
|
|
374
|
+
/* Display `jp-ArrayOperations` buttons side-by-side with content except
|
|
375
|
+
for small screens where flex-wrap will place them one below the other.
|
|
376
|
+
*/
|
|
377
|
+
display: flex;
|
|
378
|
+
align-items: center;
|
|
379
|
+
flex-wrap: wrap;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.jp-SettingsPanel .jp-root > fieldset > legend {
|
|
343
383
|
display: none;
|
|
344
384
|
}
|
|
345
|
-
|
|
385
|
+
|
|
386
|
+
.jp-SettingsPanel .jp-root > fieldset > p {
|
|
346
387
|
display: none;
|
|
347
388
|
}
|
|
348
389
|
|
|
@@ -353,7 +394,7 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
353
394
|
margin: 1em;
|
|
354
395
|
}
|
|
355
396
|
|
|
356
|
-
.jp-SettingsPanel .jp-SettingsHeader
|
|
397
|
+
.jp-SettingsPanel .jp-SettingsHeader-description {
|
|
357
398
|
font-size: var(--jp-content-font-size2);
|
|
358
399
|
color: var(--jp-ui-font-color1);
|
|
359
400
|
font-weight: 200;
|
|
@@ -361,28 +402,29 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
361
402
|
line-height: var(--jp-content-font-size3);
|
|
362
403
|
}
|
|
363
404
|
|
|
364
|
-
.jp-SettingsPanel p {
|
|
365
|
-
font-size: var(--jp-content-font-size2);
|
|
366
|
-
margin: 0.5em;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
405
|
.jp-SettingsPanel legend {
|
|
370
|
-
font-size: var(--jp-content-font-
|
|
406
|
+
font-size: var(--jp-content-font-size2);
|
|
371
407
|
color: var(--jp-ui-font-color0);
|
|
372
408
|
flex-basis: 100%;
|
|
373
|
-
padding: 0
|
|
409
|
+
padding: 4px 0;
|
|
374
410
|
font-weight: var(--jp-content-header-font-weight);
|
|
375
411
|
border-bottom: 1px solid var(--jp-border-color2);
|
|
376
412
|
}
|
|
377
413
|
|
|
414
|
+
.jp-SettingsPanel .field-description {
|
|
415
|
+
padding: 4px 0;
|
|
416
|
+
white-space: pre-wrap;
|
|
417
|
+
}
|
|
418
|
+
|
|
378
419
|
.jp-SettingsPanel .jp-SettingsTitle {
|
|
379
420
|
display: flex;
|
|
380
421
|
align-items: center;
|
|
381
422
|
padding-left: 1em;
|
|
382
423
|
}
|
|
383
424
|
|
|
384
|
-
.jp-SettingsPanel .jp-SettingsTitle
|
|
425
|
+
.jp-SettingsPanel .jp-SettingsTitle-caret {
|
|
385
426
|
width: 2em;
|
|
427
|
+
flex-shrink: 0;
|
|
386
428
|
}
|
|
387
429
|
|
|
388
430
|
.jp-SettingsForm {
|
|
@@ -422,19 +464,14 @@ ul.jp-PluginList li.jp-mod-selected span.jp-PluginList-icon.jp-FileIcon {
|
|
|
422
464
|
width: 5px;
|
|
423
465
|
background-color: var(--jp-brand-color2);
|
|
424
466
|
margin-top: 0;
|
|
425
|
-
margin-
|
|
426
|
-
|
|
467
|
+
margin-left: calc(var(--jp-private-settingeditor-modifier-indent) * -1);
|
|
468
|
+
flex-shrink: 0;
|
|
427
469
|
}
|
|
428
470
|
|
|
429
|
-
.jp-SettingsPanel .
|
|
430
|
-
.jp-SettingsPanel .form-group p#field-description {
|
|
471
|
+
.jp-SettingsPanel .jp-FormGroup-fieldLabel {
|
|
431
472
|
font-size: var(--jp-content-font-size1);
|
|
432
|
-
font-weight:
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.jp-SettingsPanel .inputFieldWrapper {
|
|
437
|
-
margin-left: 7px;
|
|
473
|
+
font-weight: normal;
|
|
474
|
+
min-width: 120px;
|
|
438
475
|
}
|
|
439
476
|
|
|
440
477
|
.jp-SettingsPanel .jp-modifiedIndicator.jp-errorIndicator {
|