@jupyterlab/settingeditor-extension 4.3.4 → 4.4.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/importSettingsWidget.d.ts +45 -0
- package/lib/importSettingsWidget.js +67 -0
- package/lib/importSettingsWidget.js.map +1 -0
- package/lib/index.js +146 -2
- package/lib/index.js.map +1 -1
- package/package.json +13 -12
- package/src/importSettingsWidget.tsx +145 -0
- package/src/index.ts +208 -5
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ITranslator } from '@jupyterlab/translation';
|
|
2
|
+
import { ReactWidget } from '@jupyterlab/ui-components';
|
|
3
|
+
/**
|
|
4
|
+
* A namespace for ImportSettings.
|
|
5
|
+
*/
|
|
6
|
+
declare namespace ImportSettings {
|
|
7
|
+
/**
|
|
8
|
+
* The props for the ImportSettings component.
|
|
9
|
+
*/
|
|
10
|
+
interface IOptions {
|
|
11
|
+
importedSettings: string[];
|
|
12
|
+
handleImport: (settings: string[]) => void;
|
|
13
|
+
translator: ITranslator;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The props for the ImportSettings DialogBox body.
|
|
17
|
+
*/
|
|
18
|
+
interface IDialogBodyBodyOptions {
|
|
19
|
+
successMessage: string;
|
|
20
|
+
failureMessage?: string;
|
|
21
|
+
failedSettings?: string[];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A widget for importing settings with checkboxes.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ImportSettingsWidget extends ReactWidget {
|
|
28
|
+
/**
|
|
29
|
+
* Constructs a new ImportSettingsWidget.
|
|
30
|
+
*
|
|
31
|
+
* @param importedSettings - The settings to display.
|
|
32
|
+
* @param handleImport - A callback for handling imports.
|
|
33
|
+
*/
|
|
34
|
+
constructor(options: ImportSettings.IOptions);
|
|
35
|
+
render(): JSX.Element;
|
|
36
|
+
private importedSettings;
|
|
37
|
+
private handleImport;
|
|
38
|
+
private translator;
|
|
39
|
+
}
|
|
40
|
+
export declare class ImportSettingsDialogBodyWidget extends ReactWidget {
|
|
41
|
+
private _props;
|
|
42
|
+
constructor(_props: ImportSettings.IDialogBodyBodyOptions);
|
|
43
|
+
render(): JSX.Element;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Jupyter Development Team.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
import { ReactWidget } from '@jupyterlab/ui-components';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
const SettingsImport = (props) => {
|
|
8
|
+
const trans = props.translator.load('jupyterlab');
|
|
9
|
+
const [checkedStates, setCheckedStates] = useState(props.importedSettings.reduce((acc, key) => {
|
|
10
|
+
acc[key] = true;
|
|
11
|
+
return acc;
|
|
12
|
+
}, {}));
|
|
13
|
+
const handleCheckboxChange = (key, isChecked) => {
|
|
14
|
+
const updatedStates = { ...checkedStates, [key]: isChecked };
|
|
15
|
+
setCheckedStates(updatedStates);
|
|
16
|
+
};
|
|
17
|
+
return (React.createElement("div", { className: "jp-SettingsImport-container" },
|
|
18
|
+
React.createElement("div", { className: "jp-SettingsImport-header" },
|
|
19
|
+
React.createElement("span", { className: "jp-SettingsImport-title" }, trans.__('Select settings sections to import')),
|
|
20
|
+
React.createElement("button", { className: "jp-Button jp-mod-styled jp-mod-accept", onClick: () => {
|
|
21
|
+
props.handleImport(Object.keys(checkedStates).filter(key => !checkedStates[key]));
|
|
22
|
+
} }, trans.__('Import'))),
|
|
23
|
+
React.createElement("div", { className: "jp-SettingsImport-list" }, props.importedSettings.map(key => (React.createElement("label", { key: key, className: "jp-SettingsImport-item" },
|
|
24
|
+
React.createElement("span", { className: "jp-SettingsImport-itemKey" }, key),
|
|
25
|
+
React.createElement("input", { type: "checkbox", checked: checkedStates[key], onChange: e => handleCheckboxChange(key, e.target.checked), className: "jp-SettingsImport-checkbox" })))))));
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A widget for importing settings with checkboxes.
|
|
29
|
+
*/
|
|
30
|
+
export class ImportSettingsWidget extends ReactWidget {
|
|
31
|
+
/**
|
|
32
|
+
* Constructs a new ImportSettingsWidget.
|
|
33
|
+
*
|
|
34
|
+
* @param importedSettings - The settings to display.
|
|
35
|
+
* @param handleImport - A callback for handling imports.
|
|
36
|
+
*/
|
|
37
|
+
constructor(options) {
|
|
38
|
+
const { importedSettings, handleImport, translator } = options;
|
|
39
|
+
super();
|
|
40
|
+
this.importedSettings = importedSettings;
|
|
41
|
+
this.handleImport = handleImport;
|
|
42
|
+
this.addClass('jp-SettingsImport-widget');
|
|
43
|
+
this.translator = translator;
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
return (React.createElement(SettingsImport, { importedSettings: this.importedSettings, handleImport: this.handleImport, translator: this.translator }));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const ImportSettingsDialogBody = (props) => {
|
|
50
|
+
return (React.createElement("div", null,
|
|
51
|
+
React.createElement("div", null, props.successMessage),
|
|
52
|
+
props.failureMessage && (React.createElement("div", null,
|
|
53
|
+
React.createElement("br", null),
|
|
54
|
+
React.createElement("div", null, props.failureMessage),
|
|
55
|
+
props.failedSettings &&
|
|
56
|
+
props.failedSettings.map((setting, index) => (React.createElement("div", { key: index }, setting)))))));
|
|
57
|
+
};
|
|
58
|
+
export class ImportSettingsDialogBodyWidget extends ReactWidget {
|
|
59
|
+
constructor(_props) {
|
|
60
|
+
super();
|
|
61
|
+
this._props = _props;
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return React.createElement(ImportSettingsDialogBody, { ...this._props });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=importSettingsWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importSettingsWidget.js","sourceRoot":"","sources":["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,cAAc;gBACnB,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3C,6BAAK,GAAG,EAAE,KAAK,IAAG,OAAO,CAAO,CACjC,CAAC,CACA,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,8BAA+B,SAAQ,WAAW;IAC7D,YAAoB,MAA6C;QAC/D,KAAK,EAAE,CAAC;QADU,WAAM,GAAN,MAAM,CAAuC;IAEjE,CAAC;IAED,MAAM;QACJ,OAAO,oBAAC,wBAAwB,OAAK,IAAI,CAAC,MAAM,GAAI,CAAC;IACvD,CAAC;CACF"}
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module settingeditor-extension
|
|
8
8
|
*/
|
|
9
9
|
import { ILabStatus, ILayoutRestorer } from '@jupyterlab/application';
|
|
10
|
-
import { ICommandPalette, MainAreaWidget, WidgetTracker } from '@jupyterlab/apputils';
|
|
10
|
+
import { Dialog, ICommandPalette, MainAreaWidget, showDialog, showErrorMessage, WidgetTracker } from '@jupyterlab/apputils';
|
|
11
11
|
import { IEditorServices } from '@jupyterlab/codeeditor';
|
|
12
12
|
import { CommandToolbarButton, IFormRendererRegistry, launchIcon, Toolbar, ToolbarButton } from '@jupyterlab/ui-components';
|
|
13
13
|
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
@@ -16,7 +16,8 @@ import { IPluginManager } from '@jupyterlab/pluginmanager';
|
|
|
16
16
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
17
17
|
import { IStateDB } from '@jupyterlab/statedb';
|
|
18
18
|
import { ITranslator } from '@jupyterlab/translation';
|
|
19
|
-
import { saveIcon, settingsIcon, undoIcon } from '@jupyterlab/ui-components';
|
|
19
|
+
import { downloadIcon, fileUploadIcon, saveIcon, settingsIcon, undoIcon } from '@jupyterlab/ui-components';
|
|
20
|
+
import { ImportSettingsDialogBodyWidget, ImportSettingsWidget } from './importSettingsWidget';
|
|
20
21
|
/**
|
|
21
22
|
* The command IDs used by the setting editor.
|
|
22
23
|
*/
|
|
@@ -26,6 +27,8 @@ var CommandIDs;
|
|
|
26
27
|
CommandIDs.openJSON = 'settingeditor:open-json';
|
|
27
28
|
CommandIDs.revert = 'settingeditor:revert';
|
|
28
29
|
CommandIDs.save = 'settingeditor:save';
|
|
30
|
+
CommandIDs.exportSettings = 'settingeditor:export';
|
|
31
|
+
CommandIDs.importSettings = 'settingeditor:import';
|
|
29
32
|
})(CommandIDs || (CommandIDs = {}));
|
|
30
33
|
/**
|
|
31
34
|
* The default setting editor extension.
|
|
@@ -94,6 +97,20 @@ function activate(app, registry, state, translator, editorRegistry, status, rest
|
|
|
94
97
|
query: args.query
|
|
95
98
|
})
|
|
96
99
|
});
|
|
100
|
+
editor.toolbar.addItem('export-settings', new CommandToolbarButton({
|
|
101
|
+
commands,
|
|
102
|
+
id: CommandIDs.exportSettings,
|
|
103
|
+
icon: downloadIcon,
|
|
104
|
+
label: trans.__('Export'),
|
|
105
|
+
caption: trans.__('Export settings to a JSON file')
|
|
106
|
+
}));
|
|
107
|
+
editor.toolbar.addItem('import-settings', new CommandToolbarButton({
|
|
108
|
+
commands,
|
|
109
|
+
id: CommandIDs.importSettings,
|
|
110
|
+
icon: fileUploadIcon,
|
|
111
|
+
label: trans.__('Import'),
|
|
112
|
+
caption: trans.__('Import settings from a JSON file')
|
|
113
|
+
}));
|
|
97
114
|
editor.toolbar.addItem('spacer', Toolbar.createSpacerItem());
|
|
98
115
|
if (pluginManager) {
|
|
99
116
|
editor.toolbar.addItem('open-plugin-manager', new ToolbarButton({
|
|
@@ -277,6 +294,133 @@ function activateJSON(app, registry, editorServices, state, rendermime, status,
|
|
|
277
294
|
label: trans.__('Save User Settings'),
|
|
278
295
|
isEnabled: () => { var _a, _b; return (_b = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content.canSaveRaw) !== null && _b !== void 0 ? _b : false; }
|
|
279
296
|
});
|
|
297
|
+
commands.addCommand(CommandIDs.exportSettings, {
|
|
298
|
+
execute: () => {
|
|
299
|
+
const userSettings = collectUserSettings(registry);
|
|
300
|
+
const jsonContent = JSON.stringify(userSettings, null, 2);
|
|
301
|
+
downloadSettings(jsonContent, 'overrides.json');
|
|
302
|
+
},
|
|
303
|
+
label: trans.__('Export Settings'),
|
|
304
|
+
icon: downloadIcon
|
|
305
|
+
});
|
|
306
|
+
commands.addCommand(CommandIDs.importSettings, {
|
|
307
|
+
execute: () => {
|
|
308
|
+
const fileInput = document.createElement('input');
|
|
309
|
+
fileInput.type = 'file';
|
|
310
|
+
fileInput.accept = '.json'; // Accept only JSON files
|
|
311
|
+
const JSON_INDENTATION = 4; // Indentation for the JSON file to be uploaded
|
|
312
|
+
fileInput.addEventListener('change', async (event) => {
|
|
313
|
+
var _a;
|
|
314
|
+
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
315
|
+
if (!file) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
try {
|
|
319
|
+
const fileContent = await file.text();
|
|
320
|
+
const importedSettings = JSON.parse(fileContent);
|
|
321
|
+
// Validate the JSON structure
|
|
322
|
+
if (typeof importedSettings !== 'object' ||
|
|
323
|
+
Array.isArray(importedSettings)) {
|
|
324
|
+
throw new Error('Invalid settings file format');
|
|
325
|
+
}
|
|
326
|
+
const errorUploading = [];
|
|
327
|
+
const applySettings = async (settings) => {
|
|
328
|
+
var _a;
|
|
329
|
+
const settingsEntries = Object.entries(importedSettings);
|
|
330
|
+
for (const [pluginId, pluginSettings] of settingsEntries) {
|
|
331
|
+
if (typeof pluginSettings === 'object' &&
|
|
332
|
+
!Array.isArray(pluginSettings)) {
|
|
333
|
+
try {
|
|
334
|
+
await registry.upload(pluginId, JSON.stringify(pluginSettings, undefined, JSON_INDENTATION));
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
console.warn(`Failed to save settings for ${pluginId}:`, error);
|
|
338
|
+
errorUploading.push(pluginId);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
console.warn(`Invalid settings for plugin ${pluginId}. Skipping.`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
(_a = app.shell.currentWidget) === null || _a === void 0 ? void 0 : _a.close();
|
|
346
|
+
if (settingsEntries.length) {
|
|
347
|
+
const successCount = settingsEntries.length - errorUploading.length;
|
|
348
|
+
const successMessage = trans.__(`Imported settings across ${successCount} ${successCount === 1 ? 'category' : 'categories'} successfully.`);
|
|
349
|
+
const failureMessage = errorUploading.length
|
|
350
|
+
? trans.__(`Failed to upload settings for the following ${errorUploading.length} ${errorUploading.length === 1 ? 'plugin' : 'plugins'}`)
|
|
351
|
+
: '';
|
|
352
|
+
const body = new ImportSettingsDialogBodyWidget({
|
|
353
|
+
successMessage,
|
|
354
|
+
failureMessage,
|
|
355
|
+
failedSettings: errorUploading
|
|
356
|
+
});
|
|
357
|
+
await showDialog({
|
|
358
|
+
title: trans.__('Settings Imported'),
|
|
359
|
+
body,
|
|
360
|
+
buttons: [Dialog.okButton()]
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
const settingsKeys = Object.keys(importedSettings);
|
|
365
|
+
const content = new ImportSettingsWidget({
|
|
366
|
+
importedSettings: settingsKeys,
|
|
367
|
+
handleImport: applySettings,
|
|
368
|
+
translator: translator
|
|
369
|
+
});
|
|
370
|
+
const widget = new MainAreaWidget({ content });
|
|
371
|
+
widget.title.label = trans.__('Import Settings');
|
|
372
|
+
widget.title.icon = fileUploadIcon;
|
|
373
|
+
app.shell.add(widget, 'main');
|
|
374
|
+
app.shell.activateById(widget.id);
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
await showErrorMessage('Failed to import settings', error);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
// Trigger the file input
|
|
381
|
+
fileInput.click();
|
|
382
|
+
},
|
|
383
|
+
label: trans.__('Import Settings'),
|
|
384
|
+
icon: fileUploadIcon
|
|
385
|
+
});
|
|
386
|
+
/**
|
|
387
|
+
* Collect user settings from the registry.
|
|
388
|
+
*/
|
|
389
|
+
function collectUserSettings(registry) {
|
|
390
|
+
const userSettings = {};
|
|
391
|
+
for (const [pluginId, plugin] of Object.entries(registry.plugins)) {
|
|
392
|
+
if (plugin) {
|
|
393
|
+
try {
|
|
394
|
+
if (plugin.raw) {
|
|
395
|
+
const withoutSingleLineComments = plugin.raw.replace(/\/\/.*$/gm, '');
|
|
396
|
+
const withoutComments = withoutSingleLineComments.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
397
|
+
const preferredSettings = JSON.parse(withoutComments);
|
|
398
|
+
if (Object.keys(preferredSettings).length > 0) {
|
|
399
|
+
userSettings[pluginId] = preferredSettings;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
console.error(`Error loading settings for plugin ${pluginId}:`, error);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return userSettings;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Trigger a download of the settings as a JSON file.
|
|
412
|
+
*/
|
|
413
|
+
function downloadSettings(jsonContent, filename) {
|
|
414
|
+
const blob = new Blob([jsonContent], { type: 'application/json' });
|
|
415
|
+
const url = URL.createObjectURL(blob);
|
|
416
|
+
const a = document.createElement('a');
|
|
417
|
+
a.href = url;
|
|
418
|
+
a.download = filename;
|
|
419
|
+
document.body.appendChild(a);
|
|
420
|
+
a.click();
|
|
421
|
+
document.body.removeChild(a);
|
|
422
|
+
URL.revokeObjectURL(url);
|
|
423
|
+
}
|
|
280
424
|
return tracker;
|
|
281
425
|
}
|
|
282
426
|
export default [plugin, jsonPlugin];
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"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,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlab/settingeditor-extension",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-alpha.1",
|
|
4
4
|
"description": "JupyterLab - Setting Editor Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyterlab",
|
|
6
6
|
"bugs": {
|
|
@@ -37,17 +37,18 @@
|
|
|
37
37
|
"watch": "tsc -b --watch"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@jupyterlab/application": "^4.
|
|
41
|
-
"@jupyterlab/apputils": "^4.
|
|
42
|
-
"@jupyterlab/codeeditor": "^4.
|
|
43
|
-
"@jupyterlab/pluginmanager": "^4.
|
|
44
|
-
"@jupyterlab/rendermime": "^4.
|
|
45
|
-
"@jupyterlab/settingeditor": "^4.
|
|
46
|
-
"@jupyterlab/settingregistry": "^4.
|
|
47
|
-
"@jupyterlab/statedb": "^4.
|
|
48
|
-
"@jupyterlab/translation": "^4.
|
|
49
|
-
"@jupyterlab/ui-components": "^4.
|
|
50
|
-
"@lumino/disposable": "^2.1.3"
|
|
40
|
+
"@jupyterlab/application": "^4.4.0-alpha.1",
|
|
41
|
+
"@jupyterlab/apputils": "^4.5.0-alpha.1",
|
|
42
|
+
"@jupyterlab/codeeditor": "^4.4.0-alpha.1",
|
|
43
|
+
"@jupyterlab/pluginmanager": "^4.4.0-alpha.1",
|
|
44
|
+
"@jupyterlab/rendermime": "^4.4.0-alpha.1",
|
|
45
|
+
"@jupyterlab/settingeditor": "^4.4.0-alpha.1",
|
|
46
|
+
"@jupyterlab/settingregistry": "^4.4.0-alpha.1",
|
|
47
|
+
"@jupyterlab/statedb": "^4.4.0-alpha.1",
|
|
48
|
+
"@jupyterlab/translation": "^4.4.0-alpha.1",
|
|
49
|
+
"@jupyterlab/ui-components": "^4.4.0-alpha.1",
|
|
50
|
+
"@lumino/disposable": "^2.1.3",
|
|
51
|
+
"react": "^18.2.0"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"rimraf": "~5.0.5",
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Jupyter Development Team.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ITranslator } from '@jupyterlab/translation';
|
|
7
|
+
import { ReactWidget } from '@jupyterlab/ui-components';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A namespace for ImportSettings.
|
|
12
|
+
*/
|
|
13
|
+
namespace ImportSettings {
|
|
14
|
+
/**
|
|
15
|
+
* The props for the ImportSettings component.
|
|
16
|
+
*/
|
|
17
|
+
export interface IOptions {
|
|
18
|
+
importedSettings: string[];
|
|
19
|
+
handleImport: (settings: string[]) => void;
|
|
20
|
+
translator: ITranslator;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The props for the ImportSettings DialogBox body.
|
|
24
|
+
*/
|
|
25
|
+
export interface IDialogBodyBodyOptions {
|
|
26
|
+
successMessage: string;
|
|
27
|
+
failureMessage?: string;
|
|
28
|
+
failedSettings?: string[];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const SettingsImport = (props: ImportSettings.IOptions): JSX.Element => {
|
|
33
|
+
const trans = props.translator.load('jupyterlab');
|
|
34
|
+
const [checkedStates, setCheckedStates] = useState<Record<string, boolean>>(
|
|
35
|
+
props.importedSettings.reduce(
|
|
36
|
+
(acc, key) => {
|
|
37
|
+
acc[key] = true;
|
|
38
|
+
return acc;
|
|
39
|
+
},
|
|
40
|
+
{} as Record<string, boolean>
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const handleCheckboxChange = (key: string, isChecked: boolean) => {
|
|
45
|
+
const updatedStates = { ...checkedStates, [key]: isChecked };
|
|
46
|
+
setCheckedStates(updatedStates);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className="jp-SettingsImport-container">
|
|
51
|
+
<div className="jp-SettingsImport-header">
|
|
52
|
+
<span className="jp-SettingsImport-title">
|
|
53
|
+
{trans.__('Select settings sections to import')}
|
|
54
|
+
</span>
|
|
55
|
+
<button
|
|
56
|
+
className="jp-Button jp-mod-styled jp-mod-accept"
|
|
57
|
+
onClick={() => {
|
|
58
|
+
props.handleImport(
|
|
59
|
+
Object.keys(checkedStates).filter(key => !checkedStates[key])
|
|
60
|
+
);
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
{trans.__('Import')}
|
|
64
|
+
</button>
|
|
65
|
+
</div>
|
|
66
|
+
<div className="jp-SettingsImport-list">
|
|
67
|
+
{props.importedSettings.map(key => (
|
|
68
|
+
<label key={key} className="jp-SettingsImport-item">
|
|
69
|
+
<span className="jp-SettingsImport-itemKey">{key}</span>
|
|
70
|
+
<input
|
|
71
|
+
type="checkbox"
|
|
72
|
+
checked={checkedStates[key]}
|
|
73
|
+
onChange={e => handleCheckboxChange(key, e.target.checked)}
|
|
74
|
+
className="jp-SettingsImport-checkbox"
|
|
75
|
+
/>
|
|
76
|
+
</label>
|
|
77
|
+
))}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* A widget for importing settings with checkboxes.
|
|
85
|
+
*/
|
|
86
|
+
export class ImportSettingsWidget extends ReactWidget {
|
|
87
|
+
/**
|
|
88
|
+
* Constructs a new ImportSettingsWidget.
|
|
89
|
+
*
|
|
90
|
+
* @param importedSettings - The settings to display.
|
|
91
|
+
* @param handleImport - A callback for handling imports.
|
|
92
|
+
*/
|
|
93
|
+
constructor(options: ImportSettings.IOptions) {
|
|
94
|
+
const { importedSettings, handleImport, translator } = options;
|
|
95
|
+
super();
|
|
96
|
+
this.importedSettings = importedSettings;
|
|
97
|
+
this.handleImport = handleImport;
|
|
98
|
+
this.addClass('jp-SettingsImport-widget');
|
|
99
|
+
this.translator = translator;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
render(): JSX.Element {
|
|
103
|
+
return (
|
|
104
|
+
<SettingsImport
|
|
105
|
+
importedSettings={this.importedSettings}
|
|
106
|
+
handleImport={this.handleImport}
|
|
107
|
+
translator={this.translator}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private importedSettings: string[];
|
|
113
|
+
private handleImport: (settings: string[]) => void;
|
|
114
|
+
private translator: ITranslator;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const ImportSettingsDialogBody = (
|
|
118
|
+
props: ImportSettings.IDialogBodyBodyOptions
|
|
119
|
+
): JSX.Element => {
|
|
120
|
+
return (
|
|
121
|
+
<div>
|
|
122
|
+
<div>{props.successMessage}</div>
|
|
123
|
+
{props.failureMessage && (
|
|
124
|
+
<div>
|
|
125
|
+
<br />
|
|
126
|
+
<div>{props.failureMessage}</div>
|
|
127
|
+
{props.failedSettings &&
|
|
128
|
+
props.failedSettings.map((setting, index) => (
|
|
129
|
+
<div key={index}>{setting}</div>
|
|
130
|
+
))}
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export class ImportSettingsDialogBodyWidget extends ReactWidget {
|
|
138
|
+
constructor(private _props: ImportSettings.IDialogBodyBodyOptions) {
|
|
139
|
+
super();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
render(): JSX.Element {
|
|
143
|
+
return <ImportSettingsDialogBody {...this._props} />;
|
|
144
|
+
}
|
|
145
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -14,8 +14,11 @@ import {
|
|
|
14
14
|
JupyterFrontEndPlugin
|
|
15
15
|
} from '@jupyterlab/application';
|
|
16
16
|
import {
|
|
17
|
+
Dialog,
|
|
17
18
|
ICommandPalette,
|
|
18
19
|
MainAreaWidget,
|
|
20
|
+
showDialog,
|
|
21
|
+
showErrorMessage,
|
|
19
22
|
WidgetTracker
|
|
20
23
|
} from '@jupyterlab/apputils';
|
|
21
24
|
import { IEditorServices } from '@jupyterlab/codeeditor';
|
|
@@ -31,16 +34,23 @@ import {
|
|
|
31
34
|
IJSONSettingEditorTracker,
|
|
32
35
|
ISettingEditorTracker
|
|
33
36
|
} from '@jupyterlab/settingeditor/lib/tokens';
|
|
34
|
-
import
|
|
35
|
-
JsonSettingEditor,
|
|
36
|
-
SettingsEditor
|
|
37
|
-
} from '@jupyterlab/settingeditor';
|
|
37
|
+
import { JsonSettingEditor, SettingsEditor } from '@jupyterlab/settingeditor';
|
|
38
38
|
import { IPluginManager } from '@jupyterlab/pluginmanager';
|
|
39
39
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
40
40
|
import { IStateDB } from '@jupyterlab/statedb';
|
|
41
41
|
import { ITranslator } from '@jupyterlab/translation';
|
|
42
|
-
import {
|
|
42
|
+
import {
|
|
43
|
+
downloadIcon,
|
|
44
|
+
fileUploadIcon,
|
|
45
|
+
saveIcon,
|
|
46
|
+
settingsIcon,
|
|
47
|
+
undoIcon
|
|
48
|
+
} from '@jupyterlab/ui-components';
|
|
43
49
|
import { IDisposable } from '@lumino/disposable';
|
|
50
|
+
import {
|
|
51
|
+
ImportSettingsDialogBodyWidget,
|
|
52
|
+
ImportSettingsWidget
|
|
53
|
+
} from './importSettingsWidget';
|
|
44
54
|
|
|
45
55
|
/**
|
|
46
56
|
* The command IDs used by the setting editor.
|
|
@@ -53,6 +63,10 @@ namespace CommandIDs {
|
|
|
53
63
|
export const revert = 'settingeditor:revert';
|
|
54
64
|
|
|
55
65
|
export const save = 'settingeditor:save';
|
|
66
|
+
|
|
67
|
+
export const exportSettings = 'settingeditor:export';
|
|
68
|
+
|
|
69
|
+
export const importSettings = 'settingeditor:import';
|
|
56
70
|
}
|
|
57
71
|
|
|
58
72
|
type SettingEditorType = 'ui' | 'json';
|
|
@@ -142,6 +156,28 @@ function activate(
|
|
|
142
156
|
})
|
|
143
157
|
});
|
|
144
158
|
|
|
159
|
+
editor.toolbar.addItem(
|
|
160
|
+
'export-settings',
|
|
161
|
+
new CommandToolbarButton({
|
|
162
|
+
commands,
|
|
163
|
+
id: CommandIDs.exportSettings,
|
|
164
|
+
icon: downloadIcon,
|
|
165
|
+
label: trans.__('Export'),
|
|
166
|
+
caption: trans.__('Export settings to a JSON file')
|
|
167
|
+
})
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
editor.toolbar.addItem(
|
|
171
|
+
'import-settings',
|
|
172
|
+
new CommandToolbarButton({
|
|
173
|
+
commands,
|
|
174
|
+
id: CommandIDs.importSettings,
|
|
175
|
+
icon: fileUploadIcon,
|
|
176
|
+
label: trans.__('Import'),
|
|
177
|
+
caption: trans.__('Import settings from a JSON file')
|
|
178
|
+
})
|
|
179
|
+
);
|
|
180
|
+
|
|
145
181
|
editor.toolbar.addItem('spacer', Toolbar.createSpacerItem());
|
|
146
182
|
if (pluginManager) {
|
|
147
183
|
editor.toolbar.addItem(
|
|
@@ -357,6 +393,173 @@ function activateJSON(
|
|
|
357
393
|
isEnabled: () => tracker.currentWidget?.content.canSaveRaw ?? false
|
|
358
394
|
});
|
|
359
395
|
|
|
396
|
+
commands.addCommand(CommandIDs.exportSettings, {
|
|
397
|
+
execute: () => {
|
|
398
|
+
const userSettings = collectUserSettings(registry);
|
|
399
|
+
const jsonContent = JSON.stringify(userSettings, null, 2);
|
|
400
|
+
downloadSettings(jsonContent, 'overrides.json');
|
|
401
|
+
},
|
|
402
|
+
label: trans.__('Export Settings'),
|
|
403
|
+
icon: downloadIcon
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
commands.addCommand(CommandIDs.importSettings, {
|
|
407
|
+
execute: () => {
|
|
408
|
+
const fileInput = document.createElement('input');
|
|
409
|
+
fileInput.type = 'file';
|
|
410
|
+
fileInput.accept = '.json'; // Accept only JSON files
|
|
411
|
+
const JSON_INDENTATION = 4; // Indentation for the JSON file to be uploaded
|
|
412
|
+
|
|
413
|
+
fileInput.addEventListener('change', async event => {
|
|
414
|
+
const file = (event.target as HTMLInputElement).files?.[0];
|
|
415
|
+
if (!file) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
try {
|
|
420
|
+
const fileContent = await file.text();
|
|
421
|
+
const importedSettings = JSON.parse(fileContent);
|
|
422
|
+
|
|
423
|
+
// Validate the JSON structure
|
|
424
|
+
if (
|
|
425
|
+
typeof importedSettings !== 'object' ||
|
|
426
|
+
Array.isArray(importedSettings)
|
|
427
|
+
) {
|
|
428
|
+
throw new Error('Invalid settings file format');
|
|
429
|
+
}
|
|
430
|
+
const errorUploading: string[] = [];
|
|
431
|
+
const applySettings = async (settings: string[]) => {
|
|
432
|
+
const settingsEntries = Object.entries(importedSettings);
|
|
433
|
+
for (const [pluginId, pluginSettings] of settingsEntries) {
|
|
434
|
+
if (
|
|
435
|
+
typeof pluginSettings === 'object' &&
|
|
436
|
+
!Array.isArray(pluginSettings)
|
|
437
|
+
) {
|
|
438
|
+
try {
|
|
439
|
+
await registry.upload(
|
|
440
|
+
pluginId,
|
|
441
|
+
JSON.stringify(pluginSettings, undefined, JSON_INDENTATION)
|
|
442
|
+
);
|
|
443
|
+
} catch (error) {
|
|
444
|
+
console.warn(
|
|
445
|
+
`Failed to save settings for ${pluginId}:`,
|
|
446
|
+
error
|
|
447
|
+
);
|
|
448
|
+
errorUploading.push(pluginId);
|
|
449
|
+
}
|
|
450
|
+
} else {
|
|
451
|
+
console.warn(
|
|
452
|
+
`Invalid settings for plugin ${pluginId}. Skipping.`
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
app.shell.currentWidget?.close();
|
|
458
|
+
|
|
459
|
+
if (settingsEntries.length) {
|
|
460
|
+
const successCount =
|
|
461
|
+
settingsEntries.length - errorUploading.length;
|
|
462
|
+
const successMessage = trans.__(
|
|
463
|
+
`Imported settings across ${successCount} ${
|
|
464
|
+
successCount === 1 ? 'category' : 'categories'
|
|
465
|
+
} successfully.`
|
|
466
|
+
);
|
|
467
|
+
const failureMessage = errorUploading.length
|
|
468
|
+
? trans.__(
|
|
469
|
+
`Failed to upload settings for the following ${
|
|
470
|
+
errorUploading.length
|
|
471
|
+
} ${errorUploading.length === 1 ? 'plugin' : 'plugins'}`
|
|
472
|
+
)
|
|
473
|
+
: '';
|
|
474
|
+
|
|
475
|
+
const body = new ImportSettingsDialogBodyWidget({
|
|
476
|
+
successMessage,
|
|
477
|
+
failureMessage,
|
|
478
|
+
failedSettings: errorUploading
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
await showDialog({
|
|
482
|
+
title: trans.__('Settings Imported'),
|
|
483
|
+
body,
|
|
484
|
+
buttons: [Dialog.okButton()]
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
const settingsKeys = Object.keys(importedSettings);
|
|
490
|
+
const content = new ImportSettingsWidget({
|
|
491
|
+
importedSettings: settingsKeys,
|
|
492
|
+
handleImport: applySettings,
|
|
493
|
+
translator: translator
|
|
494
|
+
});
|
|
495
|
+
const widget = new MainAreaWidget<ImportSettingsWidget>({ content });
|
|
496
|
+
widget.title.label = trans.__('Import Settings');
|
|
497
|
+
widget.title.icon = fileUploadIcon;
|
|
498
|
+
app.shell.add(widget, 'main');
|
|
499
|
+
app.shell.activateById(widget.id);
|
|
500
|
+
} catch (error) {
|
|
501
|
+
await showErrorMessage('Failed to import settings', error);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
// Trigger the file input
|
|
506
|
+
fileInput.click();
|
|
507
|
+
},
|
|
508
|
+
label: trans.__('Import Settings'),
|
|
509
|
+
icon: fileUploadIcon
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Collect user settings from the registry.
|
|
514
|
+
*/
|
|
515
|
+
function collectUserSettings(
|
|
516
|
+
registry: ISettingRegistry
|
|
517
|
+
): Record<string, any> {
|
|
518
|
+
const userSettings: Record<string, any> = {};
|
|
519
|
+
for (const [pluginId, plugin] of Object.entries(registry.plugins)) {
|
|
520
|
+
if (plugin) {
|
|
521
|
+
try {
|
|
522
|
+
if (plugin.raw) {
|
|
523
|
+
const withoutSingleLineComments = plugin.raw.replace(
|
|
524
|
+
/\/\/.*$/gm,
|
|
525
|
+
''
|
|
526
|
+
);
|
|
527
|
+
const withoutComments = withoutSingleLineComments.replace(
|
|
528
|
+
/\/\*[\s\S]*?\*\//g,
|
|
529
|
+
''
|
|
530
|
+
);
|
|
531
|
+
const preferredSettings = JSON.parse(withoutComments);
|
|
532
|
+
if (Object.keys(preferredSettings).length > 0) {
|
|
533
|
+
userSettings[pluginId] = preferredSettings;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
} catch (error) {
|
|
537
|
+
console.error(
|
|
538
|
+
`Error loading settings for plugin ${pluginId}:`,
|
|
539
|
+
error
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return userSettings;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Trigger a download of the settings as a JSON file.
|
|
549
|
+
*/
|
|
550
|
+
function downloadSettings(jsonContent: string, filename: string): void {
|
|
551
|
+
const blob = new Blob([jsonContent], { type: 'application/json' });
|
|
552
|
+
const url = URL.createObjectURL(blob);
|
|
553
|
+
|
|
554
|
+
const a = document.createElement('a');
|
|
555
|
+
a.href = url;
|
|
556
|
+
a.download = filename;
|
|
557
|
+
document.body.appendChild(a);
|
|
558
|
+
a.click();
|
|
559
|
+
document.body.removeChild(a);
|
|
560
|
+
URL.revokeObjectURL(url);
|
|
561
|
+
}
|
|
562
|
+
|
|
360
563
|
return tracker;
|
|
361
564
|
}
|
|
362
565
|
|