nmrium 0.28.0 → 0.29.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/component/1d/database/DatabaseSpectrum.js +9 -6
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +8 -6
- package/lib/component/2d/Contours.js +8 -8
- package/lib/component/context/PreferencesContext.d.ts +0 -2
- package/lib/component/elements/CheckBox.js +1 -1
- package/lib/component/elements/CheckBoxCell.d.ts +3 -0
- package/lib/component/elements/CheckBoxCell.js +8 -0
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +4 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +6 -5
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +3 -3
- package/lib/component/modal/setting/DisplayTabContent.d.ts +1 -5
- package/lib/component/modal/setting/DisplayTabContent.js +5 -14
- package/lib/component/modal/setting/GeneralSettings.js +19 -12
- package/lib/component/modal/setting/GeneralTabContent.d.ts +3 -0
- package/lib/component/modal/setting/{ControllersTabContent.js → GeneralTabContent.js} +3 -3
- package/lib/component/modal/setting/ToolsTabContent.d.ts +3 -0
- package/lib/component/modal/setting/ToolsTabContent.js +100 -0
- package/lib/component/panels/Panels.js +7 -4
- package/lib/component/panels/databasePanel/DatabasePanel.js +2 -2
- package/lib/component/reducer/actions/FiltersActions.js +11 -8
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/actions/initPreferences.js +4 -4
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +1 -1
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +13 -16
- package/lib/component/reducer/preferences/actions/setWorkspace.js +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -44
- package/lib/component/reducer/preferences/preferencesReducer.js +0 -3
- package/lib/component/reducer/preferences/{utilites → utilities}/checkKeysExists.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/checkKeysExists.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/filterObject.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/filterObject.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/flatObject.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/flatObject.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/getActiveWorkspace.d.ts +2 -1
- package/lib/component/reducer/preferences/{utilites → utilities}/getActiveWorkspace.js +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/getPreferencesByWorkspace.d.ts +2 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.js +6 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/mapNucleiFormatting.d.ts +0 -0
- package/lib/component/reducer/preferences/{utilites → utilities}/mapNucleiFormatting.js +0 -0
- package/lib/component/utility/Evaluate.js +1 -0
- package/lib/component/workspaces/Workspace.d.ts +12 -8
- package/lib/component/workspaces/basic.d.ts +2 -2
- package/lib/component/workspaces/basic.js +18 -39
- package/lib/component/workspaces/embedded.d.ts +2 -2
- package/lib/component/workspaces/embedded.js +19 -12
- package/lib/component/workspaces/exercise.d.ts +2 -2
- package/lib/component/workspaces/exercise.js +4 -33
- package/lib/component/workspaces/index.d.ts +5 -5
- package/lib/component/workspaces/prediction.d.ts +2 -2
- package/lib/component/workspaces/prediction.js +19 -16
- package/lib/component/workspaces/process1D.d.ts +2 -2
- package/lib/component/workspaces/process1D.js +12 -18
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +2 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +71 -0
- package/lib/data/data1d/MultipleAnalysis.js +1 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +11 -12
- package/lib/data/data1d/database.js +3 -10
- package/lib/data/data1d/filter1d/autoPhaseCorrection.js +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +14 -10
- package/lib/types/PanelPreferencesType.d.ts +1 -7
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +9 -6
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +8 -6
- package/lib-cjs/component/2d/Contours.js +8 -8
- package/lib-cjs/component/elements/CheckBox.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +15 -0
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +4 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -5
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +1 -1
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +3 -3
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +5 -14
- package/lib-cjs/component/modal/setting/GeneralSettings.js +19 -12
- package/lib-cjs/component/modal/setting/{ControllersTabContent.js → GeneralTabContent.js} +3 -3
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +105 -0
- package/lib-cjs/component/panels/Panels.js +7 -4
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +2 -2
- package/lib-cjs/component/reducer/actions/FiltersActions.js +11 -8
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +4 -4
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +16 -16
- package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +0 -3
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/checkKeysExists.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/filterObject.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/flatObject.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/getActiveWorkspace.js +0 -0
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/getPreferencesByWorkspace.js +3 -1
- package/lib-cjs/component/reducer/preferences/{utilites → utilities}/mapNucleiFormatting.js +0 -0
- package/lib-cjs/component/utility/Evaluate.js +1 -0
- package/lib-cjs/component/workspaces/basic.js +18 -39
- package/lib-cjs/component/workspaces/embedded.js +19 -12
- package/lib-cjs/component/workspaces/exercise.js +4 -33
- package/lib-cjs/component/workspaces/prediction.js +19 -16
- package/lib-cjs/component/workspaces/process1D.js +12 -18
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +74 -0
- package/lib-cjs/data/data1d/MultipleAnalysis.js +1 -0
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +11 -12
- package/lib-cjs/data/data1d/database.js +3 -10
- package/lib-cjs/data/data1d/filter1d/autoPhaseCorrection.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +14 -10
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +15 -14
- package/lib/component/modal/setting/ControllersTabContent.d.ts +0 -3
- package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +0 -3
- package/lib/component/reducer/preferences/actions/resetPreferences.js +0 -14
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +0 -4
- package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +0 -18
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
8
8
|
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
9
|
-
function
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: "section-header", children: "Spectra" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Transparency of Dimmed Spectra [ 0 - 1 ]", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "
|
|
9
|
+
function GeneralTabContent() {
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: "section-header", children: "Spectra" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Transparency of Dimmed Spectra [ 0 - 1 ]", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "general.dimmedSpectraTransparency", checkValue: (value) => value >= 0 && value <= 1, type: "number" }) })] }));
|
|
11
11
|
}
|
|
12
|
-
exports.default =
|
|
12
|
+
exports.default = GeneralTabContent;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const CheckBoxCell_1 = require("../../elements/CheckBoxCell");
|
|
9
|
+
const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTable"));
|
|
10
|
+
const LIST = [
|
|
11
|
+
{
|
|
12
|
+
label: 'Zoom in',
|
|
13
|
+
name: 'toolBarButtons.zoomTool',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: 'Zoom out',
|
|
17
|
+
name: 'toolBarButtons.zoomOutTool',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: 'Import',
|
|
21
|
+
name: 'toolBarButtons.import',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Export As',
|
|
25
|
+
name: 'toolBarButtons.exportAs',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'Stack Alignments',
|
|
29
|
+
name: 'toolBarButtons.spectraStackAlignments',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Center Alignments',
|
|
33
|
+
name: 'toolBarButtons.spectraCenterAlignments',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Real/Imaginary ',
|
|
37
|
+
name: 'toolBarButtons.realImaginary',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Peak picking',
|
|
41
|
+
name: 'toolBarButtons.peakTool',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Integral',
|
|
45
|
+
name: 'toolBarButtons.integralTool',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Zone Picking',
|
|
49
|
+
name: 'toolBarButtons.zonePickingTool',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'Range picking',
|
|
53
|
+
name: 'toolBarButtons.rangePickingTool',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: 'Slicing',
|
|
57
|
+
name: 'toolBarButtons.slicingTool',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'Zero filling',
|
|
61
|
+
name: 'toolBarButtons.zeroFillingTool',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Fourier transform',
|
|
65
|
+
name: 'toolBarButtons.FFTTool',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: 'Phase correction',
|
|
69
|
+
name: 'toolBarButtons.phaseCorrectionTool',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Baseline correction',
|
|
73
|
+
name: 'toolBarButtons.baselineCorrectionTool',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'Exclusion zones',
|
|
77
|
+
name: 'toolBarButtons.exclusionZonesTool',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Multiple spectra analysis',
|
|
81
|
+
name: 'toolBarButtons.multipleSpectraAnalysisTool',
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
function ToolsTabContent() {
|
|
85
|
+
const COLUMNS = (0, react_1.useMemo)(() => [
|
|
86
|
+
{
|
|
87
|
+
index: 1,
|
|
88
|
+
Header: '#',
|
|
89
|
+
Cell: ({ row }) => row.index + 1,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
index: 1,
|
|
93
|
+
Header: 'Tool',
|
|
94
|
+
accessor: 'label',
|
|
95
|
+
style: { width: '60%' },
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
index: 2,
|
|
99
|
+
Header: 'Active',
|
|
100
|
+
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)(CheckBoxCell_1.CheckBoxCell, { name: `display.${row.original.name}`, defaultValue: false })),
|
|
101
|
+
},
|
|
102
|
+
], []);
|
|
103
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%', overflow: 'hidden' }, children: (0, jsx_runtime_1.jsx)(ReactTable_1.default, { columns: COLUMNS, data: LIST }) }));
|
|
104
|
+
}
|
|
105
|
+
exports.default = ToolsTabContent;
|
|
@@ -125,7 +125,11 @@ exports.TOOLS_PANELS_ACCORDION = {
|
|
|
125
125
|
function usePanelPreferences() {
|
|
126
126
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
127
127
|
return (0, react_1.useCallback)((item) => {
|
|
128
|
-
|
|
128
|
+
const defaultValue = {
|
|
129
|
+
display: false,
|
|
130
|
+
open: false,
|
|
131
|
+
};
|
|
132
|
+
return (0, get_1.default)(preferences.current, `display.panels.${item.hidePreferenceKey}`, defaultValue);
|
|
129
133
|
}, [preferences]);
|
|
130
134
|
}
|
|
131
135
|
function PanelsInner({ displayerMode: displayedMode }) {
|
|
@@ -133,15 +137,14 @@ function PanelsInner({ displayerMode: displayedMode }) {
|
|
|
133
137
|
const isExperimental = (0, useCheckExperimentalFeature_1.default)();
|
|
134
138
|
const check = (0, react_1.useCallback)((item) => {
|
|
135
139
|
const panelOptions = getPanelPreferences(item);
|
|
136
|
-
return ((panelOptions?.
|
|
137
|
-
panelOptions?.display &&
|
|
140
|
+
return ((panelOptions?.display &&
|
|
138
141
|
item.isExperimental === undefined &&
|
|
139
142
|
(item.mode == null || item.mode === displayedMode)) ||
|
|
140
143
|
(item.isExperimental && isExperimental));
|
|
141
144
|
}, [displayedMode, getPanelPreferences, isExperimental]);
|
|
142
145
|
const isOpened = (0, react_1.useCallback)((item) => {
|
|
143
146
|
const panelOptions = getPanelPreferences(item);
|
|
144
|
-
return panelOptions?.
|
|
147
|
+
return panelOptions?.display && panelOptions?.open;
|
|
145
148
|
}, [getPanelPreferences]);
|
|
146
149
|
return ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%', height: '100%', flex: '1 1 0%' }, children: (0, jsx_runtime_1.jsx)(analysis_ui_components_1.Accordion, { children: accordionItems.map((item) => {
|
|
147
150
|
return (check(item) && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Accordion.Item, { title: item.title, defaultOpened: isOpened(item), children: item.component }, item.title)));
|
|
@@ -159,7 +159,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
159
159
|
databaseDataRef.current = database
|
|
160
160
|
?.value;
|
|
161
161
|
}
|
|
162
|
-
const hideLoading = await alert.showLoading(`
|
|
162
|
+
const hideLoading = await alert.showLoading(`Loading the database`);
|
|
163
163
|
databaseInstance.current = (0, database_1.initiateDatabase)(databaseDataRef.current, nucleus);
|
|
164
164
|
setKeywords({ ...emptyKeywords });
|
|
165
165
|
hideLoading();
|
|
@@ -168,7 +168,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
|
|
|
168
168
|
(0, react_2.useEffect)(() => {
|
|
169
169
|
setTimeout(async () => {
|
|
170
170
|
if (databaseInstance.current) {
|
|
171
|
-
const hideLoading = await alert.showLoading(`
|
|
171
|
+
const hideLoading = await alert.showLoading(`Loading the database`);
|
|
172
172
|
databaseInstance.current = (0, database_1.initiateDatabase)(databaseDataRef.current, nucleus);
|
|
173
173
|
hideLoading();
|
|
174
174
|
setKeywords({ ...emptyKeywords });
|
|
@@ -135,14 +135,17 @@ function calculateBaseLineCorrection(draft, action) {
|
|
|
135
135
|
...(action?.options ? { options: action.options } : {}),
|
|
136
136
|
};
|
|
137
137
|
const { zones, options } = draft.toolOptions.data.baselineCorrection;
|
|
138
|
-
|
|
139
|
-
(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
const { livePreview, ...filterOptions } = options;
|
|
139
|
+
if (livePreview) {
|
|
140
|
+
let _data = { data: { x, re, im }, info };
|
|
141
|
+
(0, baselineCorrection_1.apply)(_data, {
|
|
142
|
+
zones,
|
|
143
|
+
...filterOptions,
|
|
144
|
+
});
|
|
145
|
+
const { im: newIm, re: newRe } = _data.data;
|
|
146
|
+
draft.tempData[index].data.im = newIm;
|
|
147
|
+
draft.tempData[index].data.re = newRe;
|
|
148
|
+
}
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
exports.calculateBaseLineCorrection = calculateBaseLineCorrection;
|
|
@@ -7,12 +7,12 @@ exports.addWorkspace = void 0;
|
|
|
7
7
|
const generateID_1 = __importDefault(require("../../../../data/utilities/generateID"));
|
|
8
8
|
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
9
9
|
function addWorkspace(draft, action) {
|
|
10
|
-
const { workspace: workspaceName, data: { display,
|
|
10
|
+
const { workspace: workspaceName, data: { display, general, formatting, databases }, } = action.payload;
|
|
11
11
|
const newWorkSpace = {
|
|
12
12
|
version: 1,
|
|
13
13
|
label: workspaceName,
|
|
14
14
|
display,
|
|
15
|
-
|
|
15
|
+
general,
|
|
16
16
|
formatting,
|
|
17
17
|
databases,
|
|
18
18
|
};
|
|
@@ -7,10 +7,10 @@ exports.initPreferences = void 0;
|
|
|
7
7
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
8
|
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
9
9
|
const workspaces_1 = __importDefault(require("../../../workspaces"));
|
|
10
|
-
const checkKeysExists_1 = require("../
|
|
11
|
-
const filterObject_1 = require("../
|
|
12
|
-
const getActiveWorkspace_1 = require("../
|
|
13
|
-
const getPreferencesByWorkspace_1 = require("../
|
|
10
|
+
const checkKeysExists_1 = require("../utilities/checkKeysExists");
|
|
11
|
+
const filterObject_1 = require("../utilities/filterObject");
|
|
12
|
+
const getActiveWorkspace_1 = require("../utilities/getActiveWorkspace");
|
|
13
|
+
const getPreferencesByWorkspace_1 = require("../utilities/getPreferencesByWorkspace");
|
|
14
14
|
function initPreferences(draft, action) {
|
|
15
15
|
if (action.payload) {
|
|
16
16
|
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.removeWorkspace = void 0;
|
|
4
4
|
const immer_1 = require("immer");
|
|
5
5
|
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
6
|
-
const filterObject_1 = require("../
|
|
6
|
+
const filterObject_1 = require("../utilities/filterObject");
|
|
7
7
|
function removeWorkspace(draft, action) {
|
|
8
8
|
const { workspace } = action.payload;
|
|
9
9
|
if (workspace === draft.workspace.current) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setPanelsPreferences = void 0;
|
|
4
4
|
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
5
|
-
const getActiveWorkspace_1 = require("../
|
|
5
|
+
const getActiveWorkspace_1 = require("../utilities/getActiveWorkspace");
|
|
6
6
|
function setPanelsPreferences(draft, action) {
|
|
7
7
|
if (action.payload) {
|
|
8
8
|
const currentWorkspacePreferences = (0, getActiveWorkspace_1.getActiveWorkspace)(draft);
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.setPreferences = void 0;
|
|
7
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
4
8
|
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
5
|
-
const getActiveWorkspace_1 = require("../
|
|
6
|
-
const mapNucleiFormatting_1 = require("../
|
|
9
|
+
const getActiveWorkspace_1 = require("../utilities/getActiveWorkspace");
|
|
10
|
+
const mapNucleiFormatting_1 = require("../utilities/mapNucleiFormatting");
|
|
7
11
|
function setPreferences(draft, action) {
|
|
8
12
|
if (action.payload) {
|
|
9
|
-
|
|
10
|
-
let {
|
|
13
|
+
let currentWorkspacePreferences = (0, getActiveWorkspace_1.getActiveWorkspace)(draft);
|
|
14
|
+
let { general, formatting, display, databases } = action.payload;
|
|
11
15
|
formatting = (0, mapNucleiFormatting_1.mapNucleiFormatting)(formatting);
|
|
12
16
|
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
13
17
|
localData.currentWorkspace = draft.workspace.current;
|
|
@@ -15,24 +19,20 @@ function setPreferences(draft, action) {
|
|
|
15
19
|
...localData.workspaces,
|
|
16
20
|
[draft.workspace.current]: {
|
|
17
21
|
...localData.workspaces[draft.workspace.current],
|
|
18
|
-
|
|
22
|
+
general,
|
|
19
23
|
formatting,
|
|
20
24
|
display,
|
|
21
25
|
databases,
|
|
22
26
|
},
|
|
23
27
|
};
|
|
24
28
|
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
25
|
-
|
|
26
|
-
currentWorkspacePreferences
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...(currentWorkspacePreferences.display.general || {}),
|
|
33
|
-
experimentalFeatures: display.general.experimentalFeatures,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
currentWorkspacePreferences = (0, merge_1.default)(currentWorkspacePreferences, {
|
|
31
|
+
general,
|
|
32
|
+
formatting,
|
|
33
|
+
databases,
|
|
34
|
+
display,
|
|
35
|
+
});
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.setPreferences = setPreferences;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setWorkspace = void 0;
|
|
4
|
-
const getPreferencesByWorkspace_1 = require("../
|
|
4
|
+
const getPreferencesByWorkspace_1 = require("../utilities/getPreferencesByWorkspace");
|
|
5
5
|
function setWorkspace(draft, action) {
|
|
6
6
|
const workspaceKey = action.payload.workspace;
|
|
7
7
|
if (!draft.workspaces[workspaceKey]) {
|
|
@@ -10,7 +10,6 @@ const workspaces_1 = __importDefault(require("../../workspaces"));
|
|
|
10
10
|
const addWorkspace_1 = require("./actions/addWorkspace");
|
|
11
11
|
const initPreferences_1 = require("./actions/initPreferences");
|
|
12
12
|
const removeWorkspace_1 = require("./actions/removeWorkspace");
|
|
13
|
-
const resetPreferences_1 = require("./actions/resetPreferences");
|
|
14
13
|
const setPanelsPreferences_1 = require("./actions/setPanelsPreferences");
|
|
15
14
|
const setPreferences_1 = require("./actions/setPreferences");
|
|
16
15
|
const setWorkspace_1 = require("./actions/setWorkspace");
|
|
@@ -71,8 +70,6 @@ function innerPreferencesReducer(draft, action) {
|
|
|
71
70
|
return (0, setPreferences_1.setPreferences)(draft, action);
|
|
72
71
|
case 'SET_PANELS_PREFERENCES':
|
|
73
72
|
return (0, setPanelsPreferences_1.setPanelsPreferences)(draft, action);
|
|
74
|
-
case 'RESET_PREFERENCES':
|
|
75
|
-
return (0, resetPreferences_1.resetPreferences)(draft);
|
|
76
73
|
case 'SET_WORKSPACE':
|
|
77
74
|
return (0, setWorkspace_1.setWorkspace)(draft, action);
|
|
78
75
|
case 'ADD_WORKSPACE':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib-cjs/component/reducer/preferences/{utilites → utilities}/getPreferencesByWorkspace.js
RENAMED
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getPreferencesByWorkspace = void 0;
|
|
7
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
7
8
|
const workspaces_1 = __importDefault(require("../../../workspaces"));
|
|
9
|
+
const workspaceDefaultProperties_1 = require("../../../workspaces/workspaceDefaultProperties");
|
|
8
10
|
function getPreferencesByWorkspace(workspace) {
|
|
9
|
-
return workspaces_1.default?.[workspace]
|
|
11
|
+
return (0, merge_1.default)({}, workspaceDefaultProperties_1.workspaceDefaultProperties, workspaces_1.default?.[workspace]);
|
|
10
12
|
}
|
|
11
13
|
exports.getPreferencesByWorkspace = getPreferencesByWorkspace;
|
|
File without changes
|
|
@@ -2,57 +2,36 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.basic = void 0;
|
|
4
4
|
exports.basic = {
|
|
5
|
-
version:
|
|
5
|
+
version: 2,
|
|
6
6
|
label: 'Default workspace',
|
|
7
7
|
display: {
|
|
8
|
-
general: {
|
|
9
|
-
disableMultipletAnalysis: false,
|
|
10
|
-
hideSetSumFromMolecule: false,
|
|
11
|
-
hideGeneralSettings: false,
|
|
12
|
-
experimentalFeatures: { display: false },
|
|
13
|
-
},
|
|
14
8
|
panels: {
|
|
15
9
|
spectraPanel: { display: true, open: true },
|
|
16
10
|
informationPanel: { display: true, open: false },
|
|
17
|
-
peaksPanel: { display:
|
|
11
|
+
peaksPanel: { display: true, open: false },
|
|
18
12
|
integralsPanel: { display: true, open: false },
|
|
19
13
|
rangesPanel: { display: true, open: false },
|
|
20
14
|
structuresPanel: { display: true, open: false },
|
|
21
15
|
filtersPanel: { display: true, open: false },
|
|
22
16
|
zonesPanel: { display: true, open: false },
|
|
23
|
-
summaryPanel: { display: false, open: false },
|
|
24
|
-
multipleSpectraAnalysisPanel: { display: false, open: false },
|
|
25
|
-
databasePanel: { display: false, open: false },
|
|
26
|
-
predictionPanel: { display: false, open: false },
|
|
27
|
-
automaticAssignmentPanel: { display: false, open: false },
|
|
28
17
|
},
|
|
29
18
|
toolBarButtons: {
|
|
30
|
-
|
|
19
|
+
zoomTool: true,
|
|
20
|
+
zoomOutTool: true,
|
|
21
|
+
import: true,
|
|
22
|
+
exportAs: true,
|
|
23
|
+
spectraStackAlignments: true,
|
|
24
|
+
spectraCenterAlignments: true,
|
|
25
|
+
realImaginary: true,
|
|
26
|
+
peakTool: true,
|
|
27
|
+
integralTool: true,
|
|
28
|
+
zonePickingTool: true,
|
|
29
|
+
rangePickingTool: true,
|
|
30
|
+
slicingTool: true,
|
|
31
|
+
zeroFillingTool: true,
|
|
32
|
+
FFTTool: true,
|
|
33
|
+
phaseCorrectionTool: true,
|
|
34
|
+
baselineCorrectionTool: true,
|
|
31
35
|
},
|
|
32
36
|
},
|
|
33
|
-
controllers: {
|
|
34
|
-
dimmedSpectraTransparency: 0.1,
|
|
35
|
-
},
|
|
36
|
-
formatting: {
|
|
37
|
-
nuclei: {
|
|
38
|
-
'1h': { name: '1H', ppm: '0.00', hz: '0.00' },
|
|
39
|
-
'13c': { name: '13C', ppm: '0.00', hz: '0.00' },
|
|
40
|
-
'15n': { name: '15N', ppm: '0.00', hz: '0.00' },
|
|
41
|
-
'19f': { name: '19F', ppm: '0.00', hz: '0.00' },
|
|
42
|
-
'29si': { name: '29Si', ppm: '0.00', hz: '0.00' },
|
|
43
|
-
'31p': { name: '31P', ppm: '0.00', hz: '0.00' },
|
|
44
|
-
},
|
|
45
|
-
panels: {},
|
|
46
|
-
},
|
|
47
|
-
databases: {
|
|
48
|
-
defaultDatabase: '',
|
|
49
|
-
data: [
|
|
50
|
-
{
|
|
51
|
-
key: 'toc',
|
|
52
|
-
label: 'Toc',
|
|
53
|
-
url: 'https://data.cheminfo.org/nmr/database/toc.json',
|
|
54
|
-
enabled: true,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
37
|
};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.embedded = void 0;
|
|
4
|
-
const basic_1 = require("./basic");
|
|
5
4
|
exports.embedded = {
|
|
6
5
|
version: 1,
|
|
7
6
|
label: 'Embedded workspace',
|
|
8
7
|
display: {
|
|
9
8
|
general: {
|
|
10
|
-
disableMultipletAnalysis: false,
|
|
11
|
-
hideSetSumFromMolecule: false,
|
|
12
|
-
hideGeneralSettings: false,
|
|
13
9
|
experimentalFeatures: { display: true },
|
|
14
10
|
hidePanelOnLoad: true,
|
|
15
11
|
},
|
|
@@ -22,14 +18,25 @@ exports.embedded = {
|
|
|
22
18
|
structuresPanel: { display: true, open: false },
|
|
23
19
|
filtersPanel: { display: true, open: false },
|
|
24
20
|
zonesPanel: { display: true, open: false },
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
},
|
|
22
|
+
toolBarButtons: {
|
|
23
|
+
baselineCorrectionTool: true,
|
|
24
|
+
exclusionZonesTool: true,
|
|
25
|
+
exportAs: true,
|
|
26
|
+
FFTTool: true,
|
|
27
|
+
import: true,
|
|
28
|
+
integralTool: true,
|
|
29
|
+
multipleSpectraAnalysisTool: true,
|
|
30
|
+
phaseCorrectionTool: true,
|
|
31
|
+
rangePickingTool: true,
|
|
32
|
+
realImaginary: true,
|
|
33
|
+
slicingTool: true,
|
|
34
|
+
spectraCenterAlignments: true,
|
|
35
|
+
spectraStackAlignments: true,
|
|
36
|
+
zeroFillingTool: true,
|
|
37
|
+
zonePickingTool: true,
|
|
38
|
+
zoomOutTool: true,
|
|
39
|
+
zoomTool: true,
|
|
30
40
|
},
|
|
31
41
|
},
|
|
32
|
-
controllers: basic_1.basic.controllers,
|
|
33
|
-
formatting: basic_1.basic.formatting,
|
|
34
|
-
databases: basic_1.basic.databases,
|
|
35
42
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.exercise = void 0;
|
|
4
|
-
const basic_1 = require("./basic");
|
|
5
4
|
exports.exercise = {
|
|
6
5
|
version: 1,
|
|
7
6
|
label: 'Exercise workspace',
|
|
@@ -10,45 +9,17 @@ exports.exercise = {
|
|
|
10
9
|
disableMultipletAnalysis: true,
|
|
11
10
|
hideSetSumFromMolecule: true,
|
|
12
11
|
hideGeneralSettings: true,
|
|
13
|
-
experimentalFeatures: { hidden: true },
|
|
14
12
|
},
|
|
15
13
|
panels: {
|
|
16
14
|
spectraPanel: { display: true, open: true },
|
|
17
|
-
informationPanel: { hidden: true },
|
|
18
|
-
peaksPanel: { hidden: true },
|
|
19
15
|
integralsPanel: { display: true },
|
|
20
|
-
rangesPanel: { hidden: true },
|
|
21
|
-
structuresPanel: { hidden: true },
|
|
22
|
-
filtersPanel: { hidden: true },
|
|
23
|
-
zonesPanel: { hidden: true },
|
|
24
|
-
summaryPanel: { hidden: true },
|
|
25
|
-
multipleSpectraAnalysisPanel: { hidden: true },
|
|
26
|
-
databasePanel: { hidden: true },
|
|
27
|
-
predictionPanel: { hidden: true },
|
|
28
|
-
automaticAssignmentPanel: { hidden: true },
|
|
29
16
|
},
|
|
30
17
|
toolBarButtons: {
|
|
31
|
-
zoomTool: true,
|
|
32
|
-
zoomOutTool: true,
|
|
33
|
-
import: false,
|
|
34
|
-
exportAs: false,
|
|
35
|
-
spectraStackAlignments: true,
|
|
36
|
-
spectraCenterAlignments: true,
|
|
37
|
-
realImaginary: false,
|
|
38
|
-
peakTool: true,
|
|
39
18
|
integralTool: true,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
phaseCorrectionTool: false,
|
|
45
|
-
baselineCorrectionTool: false,
|
|
46
|
-
FFTTool: false,
|
|
47
|
-
multipleSpectraAnalysisTool: false,
|
|
48
|
-
exclusionZonesTool: false,
|
|
19
|
+
spectraCenterAlignments: true,
|
|
20
|
+
spectraStackAlignments: true,
|
|
21
|
+
zoomOutTool: true,
|
|
22
|
+
zoomTool: true,
|
|
49
23
|
},
|
|
50
24
|
},
|
|
51
|
-
controllers: basic_1.basic.controllers,
|
|
52
|
-
formatting: basic_1.basic.formatting,
|
|
53
|
-
databases: basic_1.basic.databases,
|
|
54
25
|
};
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prediction = void 0;
|
|
4
|
-
const basic_1 = require("./basic");
|
|
5
4
|
exports.prediction = {
|
|
6
5
|
version: 1,
|
|
7
6
|
label: 'Prediction workspace',
|
|
8
7
|
display: {
|
|
9
|
-
general: {
|
|
10
|
-
experimentalFeatures: { display: false },
|
|
11
|
-
},
|
|
12
8
|
panels: {
|
|
13
9
|
spectraPanel: { display: true },
|
|
14
10
|
rangesPanel: { display: true },
|
|
15
11
|
zonesPanel: { display: true },
|
|
16
12
|
predictionPanel: { display: true, open: true },
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
},
|
|
14
|
+
toolBarButtons: {
|
|
15
|
+
baselineCorrectionTool: true,
|
|
16
|
+
exclusionZonesTool: true,
|
|
17
|
+
exportAs: true,
|
|
18
|
+
FFTTool: true,
|
|
19
|
+
import: true,
|
|
20
|
+
integralTool: true,
|
|
21
|
+
multipleSpectraAnalysisTool: true,
|
|
22
|
+
phaseCorrectionTool: true,
|
|
23
|
+
rangePickingTool: true,
|
|
24
|
+
realImaginary: true,
|
|
25
|
+
slicingTool: true,
|
|
26
|
+
spectraCenterAlignments: true,
|
|
27
|
+
spectraStackAlignments: true,
|
|
28
|
+
zeroFillingTool: true,
|
|
29
|
+
zonePickingTool: true,
|
|
30
|
+
zoomOutTool: true,
|
|
31
|
+
zoomTool: true,
|
|
26
32
|
},
|
|
27
33
|
},
|
|
28
|
-
controllers: basic_1.basic.controllers,
|
|
29
|
-
formatting: basic_1.basic.formatting,
|
|
30
|
-
databases: basic_1.basic.databases,
|
|
31
34
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.process1D = void 0;
|
|
4
|
-
const basic_1 = require("./basic");
|
|
5
4
|
exports.process1D = {
|
|
6
5
|
version: 1,
|
|
7
6
|
label: 'Process 1D workspace',
|
|
@@ -14,25 +13,20 @@ exports.process1D = {
|
|
|
14
13
|
summaryPanel: { display: true },
|
|
15
14
|
multipleSpectraAnalysisPanel: { display: true, open: true },
|
|
16
15
|
spectraPanel: { display: true, open: true },
|
|
17
|
-
informationPanel: { hidden: true },
|
|
18
|
-
peaksPanel: { hidden: true },
|
|
19
|
-
integralsPanel: { hidden: true },
|
|
20
|
-
rangesPanel: { hidden: true },
|
|
21
|
-
structuresPanel: { hidden: true },
|
|
22
|
-
filtersPanel: { hidden: true },
|
|
23
|
-
databasePanel: { hidden: true },
|
|
24
|
-
predictionPanel: { hidden: true },
|
|
25
|
-
automaticAssignmentPanel: { hidden: true },
|
|
26
16
|
},
|
|
27
17
|
toolBarButtons: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
baselineCorrectionTool: true,
|
|
19
|
+
FFTTool: true,
|
|
20
|
+
integralTool: true,
|
|
21
|
+
phaseCorrectionTool: true,
|
|
22
|
+
realImaginary: true,
|
|
23
|
+
slicingTool: true,
|
|
24
|
+
spectraCenterAlignments: true,
|
|
25
|
+
spectraStackAlignments: true,
|
|
26
|
+
zeroFillingTool: true,
|
|
27
|
+
zonePickingTool: true,
|
|
28
|
+
zoomOutTool: true,
|
|
29
|
+
zoomTool: true,
|
|
33
30
|
},
|
|
34
31
|
},
|
|
35
|
-
controllers: basic_1.basic.controllers,
|
|
36
|
-
formatting: basic_1.basic.formatting,
|
|
37
|
-
databases: basic_1.basic.databases,
|
|
38
32
|
};
|