nmrium 0.20.1 → 0.22.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/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Integral.js +1 -6
- package/lib/component/1d/Viewer1D.js +4 -4
- package/lib/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib/component/1d/utilities/scale.d.ts +1 -1
- package/lib/component/1d/utilities/scale.js +7 -6
- package/lib/component/2d/Viewer2D.js +5 -5
- package/lib/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib/component/NMRium.d.ts +9 -2
- package/lib/component/NMRium.js +9 -9
- package/lib/component/elements/EditableColumn.d.ts +1 -1
- package/lib/component/elements/NumberInput.d.ts +1 -2
- package/lib/component/elements/Tab/Tab.js +1 -0
- package/lib/component/header/Header.js +13 -10
- package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
- package/lib/component/{1d/utilities → hooks}/useIntegralPath.d.ts +0 -0
- package/lib/component/hooks/useIntegralPath.js +53 -0
- package/lib/component/hooks/useToolsFunctions.js +6 -6
- package/lib/component/hooks/useXScale.d.ts +2 -0
- package/lib/component/hooks/useXScale.js +7 -0
- package/lib/component/loader/DropZone.js +88 -88
- package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +5 -0
- package/lib/component/modal/editZone/EditPathLengthFormik.js +72 -0
- package/lib/component/modal/editZone/EditZoneModal.d.ts +8 -0
- package/lib/component/modal/editZone/EditZoneModal.js +96 -0
- package/lib/component/modal/editZone/SignalFormTab.d.ts +6 -0
- package/lib/component/modal/editZone/SignalFormTab.js +6 -0
- package/lib/component/modal/editZone/SignalsForm.d.ts +2 -0
- package/lib/component/modal/editZone/SignalsForm.js +62 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +534 -0
- package/lib/component/modal/editZone/validation/EditZoneValidation.js +17 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +3 -0
- package/lib/component/modal/editZone/validation/isDefaultPathLength.js +7 -0
- package/lib/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts +1 -2
- package/lib/component/modal/setting/GeneralSettings.js +13 -9
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.d.ts +2 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +13 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +7 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +38 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib/component/panels/Panels.d.ts +1 -1
- package/lib/component/panels/Panels.js +10 -14
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
- package/lib/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.d.ts +1 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -7
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +24 -30
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +8 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +89 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.d.ts +6 -6
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +40 -43
- package/lib/component/panels/SummaryPanel/utilities/IsInView.d.ts +6 -0
- package/lib/component/panels/SummaryPanel/utilities/IsInView.js +16 -0
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +29 -0
- package/lib/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +155 -19
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +1 -0
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +26 -3
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/Reducer.d.ts +20 -34
- package/lib/component/reducer/Reducer.js +7 -8
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +7 -7
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +3 -1
- package/lib/component/reducer/actions/DomainActions.js +20 -1
- package/lib/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib/component/reducer/actions/LoadActions.js +22 -1
- package/lib/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib/component/reducer/actions/RangesActions.js +3 -1
- package/lib/component/reducer/actions/SpectrumsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +43 -56
- package/lib/component/reducer/actions/ZonesActions.d.ts +3 -1
- package/lib/component/reducer/actions/ZonesActions.js +33 -2
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +17 -21
- package/lib/component/reducer/helper/Zoom1DManager.js +53 -69
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib/component/reducer/preferencesReducer.d.ts +3 -8
- package/lib/component/reducer/preferencesReducer.js +87 -37
- package/lib/component/reducer/types/Types.d.ts +3 -1
- package/lib/component/reducer/types/Types.js +3 -1
- package/lib/component/toolbar/FunctionToolBar.js +7 -10
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/workspaces/Workspace.d.ts +6 -0
- package/lib/component/workspaces/Workspace.js +1 -0
- package/lib/component/workspaces/basic.d.ts +2 -0
- package/lib/component/workspaces/basic.js +45 -0
- package/lib/component/workspaces/exercise1D.d.ts +2 -0
- package/lib/component/workspaces/exercise1D.js +45 -0
- package/lib/component/workspaces/index.d.ts +6 -0
- package/lib/component/workspaces/index.js +4 -0
- package/lib/component/workspaces/process1D.d.ts +2 -0
- package/lib/component/workspaces/process1D.js +43 -0
- package/lib/data/constants/DefaultPathLengths.d.ts +6 -0
- package/lib/data/constants/DefaultPathLengths.js +8 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +4 -0
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +11 -0
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +11 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +9 -0
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +7 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +29 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +13 -0
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +14 -0
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib/data/migration/MigrationManager.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Integral.js +1 -6
- package/lib-cjs/component/1d/Viewer1D.js +4 -4
- package/lib-cjs/component/1d/ranges/RangeIntegral.js +2 -6
- package/lib-cjs/component/1d/utilities/scale.js +7 -6
- package/lib-cjs/component/2d/Viewer2D.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +98 -81
- package/lib-cjs/component/NMRium.js +10 -10
- package/lib-cjs/component/elements/Tab/Tab.js +1 -0
- package/lib-cjs/component/header/Header.js +13 -10
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
- package/lib-cjs/component/hooks/useIntegralPath.js +56 -0
- package/lib-cjs/component/hooks/useToolsFunctions.js +6 -6
- package/lib-cjs/component/hooks/useXScale.js +11 -0
- package/lib-cjs/component/loader/DropZone.js +88 -88
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +1 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +77 -0
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +101 -0
- package/lib-cjs/component/modal/editZone/SignalFormTab.js +11 -0
- package/lib-cjs/component/modal/editZone/SignalsForm.js +67 -0
- package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +38 -0
- package/lib-cjs/component/modal/editZone/validation/isDefaultPathLength.js +12 -0
- package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +12 -8
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +18 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +43 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
- package/lib-cjs/component/panels/Panels.js +11 -15
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +7 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/Constants.js +1 -8
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +4 -5
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +21 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +43 -30
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +94 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +38 -41
- package/lib-cjs/component/panels/SummaryPanel/utilities/IsInView.js +18 -0
- package/lib-cjs/component/panels/SummaryPanel/{Utilities.js → utilities/Utilities.js} +157 -19
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +24 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -7
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +5 -2
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
- package/lib-cjs/component/reducer/IgnoreActions.js +2 -1
- package/lib-cjs/component/reducer/Reducer.js +7 -8
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -2
- package/lib-cjs/component/reducer/actions/DomainActions.js +21 -1
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +2 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +22 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +0 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +2 -0
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +50 -63
- package/lib-cjs/component/reducer/actions/ZonesActions.js +35 -2
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +55 -73
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +87 -37
- package/lib-cjs/component/reducer/types/Types.js +6 -4
- package/lib-cjs/component/toolbar/FunctionToolBar.js +7 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/workspaces/Workspace.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +48 -0
- package/lib-cjs/component/workspaces/exercise1D.js +48 -0
- package/lib-cjs/component/workspaces/index.js +6 -0
- package/lib-cjs/component/workspaces/process1D.js +46 -0
- package/lib-cjs/data/constants/DefaultPathLengths.js +10 -0
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +7 -19
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +18 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +2 -21
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +36 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +21 -0
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +13 -8
- package/lib-cjs/data/migration/MigrationManager.js +3 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +15 -16
- package/lib/component/1d/utilities/useIntegralPath.js +0 -63
- package/lib/component/nmriumMode/basic.d.ts +0 -38
- package/lib/component/nmriumMode/basic.js +0 -37
- package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
- package/lib/component/nmriumMode/exercise1D.js +0 -37
- package/lib/component/nmriumMode/process1D.d.ts +0 -38
- package/lib/component/nmriumMode/process1D.js +0 -37
- package/lib/component/panels/SummaryPanel/Utilities.d.ts +0 -25
- package/lib/component/reducer/actions/Zoom.d.ts +0 -16
- package/lib/component/reducer/actions/Zoom.js +0 -92
- package/lib-cjs/component/1d/utilities/useIntegralPath.js +0 -66
- package/lib-cjs/component/nmriumMode/basic.js +0 -39
- package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
- package/lib-cjs/component/nmriumMode/process1D.js +0 -39
- package/lib-cjs/component/reducer/actions/Zoom.js +0 -116
|
@@ -31,8 +31,8 @@ const CloseButton_1 = __importDefault(require("../../elements/CloseButton"));
|
|
|
31
31
|
const Tab_1 = __importDefault(require("../../elements/Tab/Tab"));
|
|
32
32
|
const Tabs_1 = __importStar(require("../../elements/Tab/Tabs"));
|
|
33
33
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
34
|
+
const Alert_1 = require("../../elements/popup/Alert");
|
|
34
35
|
const preferencesReducer_1 = require("../../reducer/preferencesReducer");
|
|
35
|
-
const LocalStorage_1 = require("../../utility/LocalStorage");
|
|
36
36
|
const ControllersTabContent_1 = __importDefault(require("./ControllersTabContent"));
|
|
37
37
|
const DisplayTabContent_1 = __importDefault(require("./DisplayTabContent"));
|
|
38
38
|
const FormattingTabContent_1 = __importDefault(require("./FormattingTabContent"));
|
|
@@ -163,23 +163,27 @@ const styles = (0, react_1.css) `
|
|
|
163
163
|
margin-bottom: 5px;
|
|
164
164
|
}
|
|
165
165
|
`;
|
|
166
|
-
function GeneralSettings({ onClose
|
|
166
|
+
function GeneralSettings({ onClose }) {
|
|
167
167
|
const [activeTab, setActiveTab] = (0, react_2.useState)('controllers');
|
|
168
168
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
169
|
-
const
|
|
169
|
+
const alert = (0, Alert_1.useAlert)();
|
|
170
170
|
const refForm = (0, react_2.useRef)();
|
|
171
171
|
const handleSave = (0, react_2.useCallback)(() => {
|
|
172
172
|
refForm.current.submitForm();
|
|
173
173
|
}, []);
|
|
174
|
+
const handleReset = (0, react_2.useCallback)(() => {
|
|
175
|
+
preferences.dispatch({ type: preferencesReducer_1.RESET_PREFERENCES });
|
|
176
|
+
alert.success('Settings saved successfully');
|
|
177
|
+
onClose?.();
|
|
178
|
+
}, [alert, onClose, preferences]);
|
|
174
179
|
const submitHandler = (0, react_2.useCallback)((values) => {
|
|
175
|
-
const { dispatch, basePreferences, ...resValues } = values;
|
|
176
|
-
setSettingsData(resValues);
|
|
177
180
|
preferences.dispatch({ type: preferencesReducer_1.SET_PREFERENCES, payload: values });
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
alert.success('Settings saved successfully');
|
|
182
|
+
onClose?.();
|
|
183
|
+
}, [alert, onClose, preferences]);
|
|
180
184
|
const tabChangeHandler = (0, react_2.useCallback)((tab) => {
|
|
181
185
|
setActiveTab(tab.tabid);
|
|
182
186
|
}, []);
|
|
183
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "General Settings" }, void 0), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}, void 0) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}, void 0) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences }, void 0) }, void 0) }, void 0)] }, void 0) }, void 0) }, void 0), (0, jsx_runtime_1.
|
|
187
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "General Settings" }, void 0), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" }, void 0)] }, void 0), (0, jsx_runtime_1.jsx)("div", { className: "main-content", children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { ref: refForm, initialValues: preferences, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Controllers", tabid: "controllers", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ControllersTabContent_1.default, {}, void 0) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}, void 0) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)(Tab_1.default, { tablabel: "Display", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, { preferences: preferences }, void 0) }, void 0) }, void 0)] }, void 0) }, void 0) }, void 0), (0, jsx_runtime_1.jsxs)("div", { className: "footer-container", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleReset, className: "btn", children: "Reset" }, void 0), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleSave, className: "btn", children: "Save" }, void 0)] }, void 0)] }, void 0));
|
|
184
188
|
}
|
|
185
189
|
exports.default = GeneralSettings;
|
|
@@ -0,0 +1,18 @@
|
|
|
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("@emotion/react/jsx-runtime");
|
|
7
|
+
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const cheminfo_font_1 = require("cheminfo-font");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
11
|
+
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
12
|
+
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
13
|
+
function AutomaticAssignment() {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
15
|
+
const automaticAssignmentHandler = (0, react_1.useCallback)(() => { }, []);
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: BasicPanelStyle_1.tablePanelStyle, children: [(0, jsx_runtime_1.jsx)(DefaultPanelHeader_1.default, { showSettingButton: false, canDelete: false, children: (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "automatic assignment", onClick: automaticAssignmentHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAssignment2, { style: { fontSize: '18px' } }, void 0) }, void 0) }, void 0), (0, jsx_runtime_1.jsx)("div", { className: "inner-container" }, void 0)] }, void 0));
|
|
17
|
+
}
|
|
18
|
+
exports.default = AutomaticAssignment;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 cheminfo_font_1 = require("cheminfo-font");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTable"));
|
|
10
|
+
const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
|
|
11
|
+
function PeaksTable({ data }) {
|
|
12
|
+
const assignHandler = (0, react_1.useCallback)((e, row) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
const params = row.original;
|
|
17
|
+
}, []);
|
|
18
|
+
const COLUMNS = (0, react_1.useMemo)(() => [
|
|
19
|
+
{
|
|
20
|
+
index: 1,
|
|
21
|
+
Header: '#',
|
|
22
|
+
Cell: ({ row }) => row.index + 1,
|
|
23
|
+
style: { width: '1%', maxWidth: '40px', minWidth: '40px' },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
index: 2,
|
|
27
|
+
Header: 'Score',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
index: 3,
|
|
31
|
+
Header: '',
|
|
32
|
+
style: {
|
|
33
|
+
width: '1%',
|
|
34
|
+
maxWidth: '24px',
|
|
35
|
+
minWidth: '24px',
|
|
36
|
+
},
|
|
37
|
+
id: 'assign-button',
|
|
38
|
+
Cell: ({ row }) => ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "assign-button", onClick: (e) => assignHandler(e, row), children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAssignment, {}, void 0) }, void 0)),
|
|
39
|
+
},
|
|
40
|
+
], [assignHandler]);
|
|
41
|
+
return data && data.length > 0 ? ((0, jsx_runtime_1.jsx)(ReactTable_1.default, { data: data, columns: COLUMNS }, void 0)) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {}, void 0));
|
|
42
|
+
}
|
|
43
|
+
exports.default = (0, react_1.memo)(PeaksTable);
|
|
@@ -68,9 +68,6 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, preferences,
|
|
|
68
68
|
}, [changeIntegralSumHandler, currentSum, integrals?.options, modal]);
|
|
69
69
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
70
70
|
setFlipStatus(!isFlipped);
|
|
71
|
-
if (!isFlipped) {
|
|
72
|
-
settingRef.current.cancelSetting();
|
|
73
|
-
}
|
|
74
71
|
}, [isFlipped]);
|
|
75
72
|
const saveSettingHandler = (0, react_2.useCallback)(() => {
|
|
76
73
|
settingRef.current.saveSetting();
|
|
@@ -66,7 +66,6 @@ const formatFields = [
|
|
|
66
66
|
];
|
|
67
67
|
function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
68
68
|
const alert = (0, Alert_1.useAlert)();
|
|
69
|
-
const [, setSettingsData] = (0, LocalStorage_1.useStateWithLocalStorage)('nmr-general-settings');
|
|
70
69
|
const formRef = (0, react_1.useRef)();
|
|
71
70
|
const updateValues = (0, react_1.useCallback)(() => {
|
|
72
71
|
if (nucleus) {
|
|
@@ -83,31 +82,19 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
83
82
|
(0, react_1.useEffect)(() => {
|
|
84
83
|
updateValues();
|
|
85
84
|
}, [updateValues]);
|
|
86
|
-
const
|
|
87
|
-
setSettingsData(values, 'formatting.panels.integrals');
|
|
88
|
-
};
|
|
89
|
-
const saveHandler = (0, react_1.useCallback)((values, showMessage = false) => {
|
|
85
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
90
86
|
preferences.dispatch({
|
|
91
87
|
type: preferencesReducer_1.SET_PANELS_PREFERENCES,
|
|
92
88
|
payload: { key: 'integrals', value: values },
|
|
93
89
|
});
|
|
94
|
-
|
|
95
|
-
alert.success('Integrals preferences saved successfully');
|
|
96
|
-
}
|
|
90
|
+
alert.success('Integrals preferences saved successfully');
|
|
97
91
|
}, [alert, preferences]);
|
|
98
92
|
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
99
93
|
saveSetting: () => {
|
|
100
94
|
formRef.current.submitForm();
|
|
101
95
|
},
|
|
102
|
-
cancelSetting: () => {
|
|
103
|
-
updateValues();
|
|
104
|
-
},
|
|
105
96
|
}));
|
|
106
|
-
|
|
107
|
-
saveHandler(values, true);
|
|
108
|
-
saveToLocalStorgate(values);
|
|
109
|
-
};
|
|
110
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { onSubmit: handleSubmit, ref: formRef, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)("p", { style: styles.header, children: "General" }, void 0), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }, void 0), (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "strokeWidth", label: "stroke width :", style: {
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: [(0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)("p", { style: styles.header, children: "General" }, void 0), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }, void 0), (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "strokeWidth", label: "stroke width :", style: {
|
|
111
98
|
label: { fontSize: '11px', fontWeight: 'bold', color: '#232323' },
|
|
112
99
|
input: {
|
|
113
100
|
width: '60%',
|
|
@@ -96,7 +96,7 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
96
96
|
currentDiaIDsToHighlight.length > 0
|
|
97
97
|
? currentDiaIDsToHighlight
|
|
98
98
|
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }, void 0));
|
|
99
|
-
} }, void 0) }, void 0)] }, mol.key)))) : ((0, jsx_runtime_1.jsx)("div", {
|
|
99
|
+
} }, void 0) }, void 0)] }, mol.key)))) : ((0, jsx_runtime_1.jsx)("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditorHandler(), children: (0, jsx_runtime_1.jsx)("span", { children: "Click to draw molecule" }, void 0) }, void 0)) }, void 0) }, void 0)] }, void 0));
|
|
100
100
|
}
|
|
101
101
|
const MemoizedMoleculePanel = (0, react_2.memo)(MoleculePanelInner);
|
|
102
102
|
const emptyData = { ranges: {}, zones: {} };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.TOOLS_PANELS_ACCORDION = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
@@ -12,7 +12,7 @@ const ChartContext_1 = require("../context/ChartContext");
|
|
|
12
12
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
13
13
|
const useCheckExperimentalFeature_1 = __importDefault(require("../hooks/useCheckExperimentalFeature"));
|
|
14
14
|
const Constants_1 = require("../reducer/core/Constants");
|
|
15
|
-
const
|
|
15
|
+
const AutomaticAssignment_1 = __importDefault(require("./AutomaticAssignment/AutomaticAssignment"));
|
|
16
16
|
const InformationPanel_1 = __importDefault(require("./InformationPanel"));
|
|
17
17
|
const IntegralPanel_1 = __importDefault(require("./IntegralsPanel/IntegralPanel"));
|
|
18
18
|
const MatrixGenerationPanel_1 = __importDefault(require("./MatrixGenerationPanel/MatrixGenerationPanel"));
|
|
@@ -29,14 +29,12 @@ const accordionItems = [
|
|
|
29
29
|
{
|
|
30
30
|
title: 'Spectra',
|
|
31
31
|
component: (0, jsx_runtime_1.jsx)(SpectrumListPanel_1.default, {}, void 0),
|
|
32
|
-
openWhen: null,
|
|
33
32
|
hidePreferenceKey: 'hideSpectraPanel',
|
|
34
33
|
mode: null,
|
|
35
34
|
},
|
|
36
35
|
{
|
|
37
36
|
title: 'Information',
|
|
38
37
|
component: (0, jsx_runtime_1.jsx)(InformationPanel_1.default, {}, void 0),
|
|
39
|
-
openWhen: null,
|
|
40
38
|
style: { overflow: 'hidden' },
|
|
41
39
|
hidePreferenceKey: 'hideInformationPanel',
|
|
42
40
|
mode: null,
|
|
@@ -44,42 +42,36 @@ const accordionItems = [
|
|
|
44
42
|
{
|
|
45
43
|
title: 'Peaks',
|
|
46
44
|
component: (0, jsx_runtime_1.jsx)(PeaksPanel_1.default, {}, void 0),
|
|
47
|
-
openWhen: [ToolTypes_1.options.peakPicking.id],
|
|
48
45
|
hidePreferenceKey: 'hidePeaksPanel',
|
|
49
46
|
mode: null,
|
|
50
47
|
},
|
|
51
48
|
{
|
|
52
49
|
title: 'Filters',
|
|
53
50
|
component: (0, jsx_runtime_1.jsx)(FilterPanel_1.default, {}, void 0),
|
|
54
|
-
openWhen: null,
|
|
55
51
|
hidePreferenceKey: 'hideFiltersPanel',
|
|
56
52
|
mode: null,
|
|
57
53
|
},
|
|
58
54
|
{
|
|
59
55
|
title: 'Integrals',
|
|
60
56
|
component: (0, jsx_runtime_1.jsx)(IntegralPanel_1.default, {}, void 0),
|
|
61
|
-
openWhen: [ToolTypes_1.options.integral.id],
|
|
62
57
|
hidePreferenceKey: 'hideIntegralsPanel',
|
|
63
58
|
mode: null,
|
|
64
59
|
},
|
|
65
60
|
{
|
|
66
61
|
title: 'Ranges',
|
|
67
62
|
component: (0, jsx_runtime_1.jsx)(RangesPanel_1.default, {}, void 0),
|
|
68
|
-
openWhen: [ToolTypes_1.options.rangesPicking.id],
|
|
69
63
|
hidePreferenceKey: 'hideRangesPanel',
|
|
70
64
|
mode: Constants_1.DISPLAYER_MODE.DM_1D,
|
|
71
65
|
},
|
|
72
66
|
{
|
|
73
67
|
title: 'Multiple Spectra Analysis',
|
|
74
68
|
component: (0, jsx_runtime_1.jsx)(MultipleSpectraAnalysisPanel_1.default, {}, void 0),
|
|
75
|
-
openWhen: [ToolTypes_1.options.multipleSpectraAnalysis.id],
|
|
76
69
|
hidePreferenceKey: 'hideMultipleSpectraAnalysisPanel',
|
|
77
70
|
mode: null,
|
|
78
71
|
},
|
|
79
72
|
{
|
|
80
73
|
title: 'Matrix Generation',
|
|
81
74
|
component: (0, jsx_runtime_1.jsx)(MatrixGenerationPanel_1.default, {}, void 0),
|
|
82
|
-
openWhen: [],
|
|
83
75
|
hidePreferenceKey: '',
|
|
84
76
|
mode: null,
|
|
85
77
|
isExperimental: true,
|
|
@@ -87,38 +79,42 @@ const accordionItems = [
|
|
|
87
79
|
{
|
|
88
80
|
title: 'Zones',
|
|
89
81
|
component: (0, jsx_runtime_1.jsx)(ZonesPanel_1.default, {}, void 0),
|
|
90
|
-
openWhen: [ToolTypes_1.options.zone2D.id],
|
|
91
82
|
hidePreferenceKey: 'hideZonesPanel',
|
|
92
83
|
mode: Constants_1.DISPLAYER_MODE.DM_2D,
|
|
93
84
|
},
|
|
94
85
|
{
|
|
95
86
|
title: 'Summary',
|
|
96
87
|
component: (0, jsx_runtime_1.jsx)(SummaryPanel_1.default, {}, void 0),
|
|
97
|
-
openWhen: [],
|
|
98
88
|
hidePreferenceKey: 'hideSummaryPanel',
|
|
99
89
|
mode: null,
|
|
100
90
|
},
|
|
101
91
|
{
|
|
102
92
|
title: 'Structures',
|
|
103
93
|
component: (0, jsx_runtime_1.jsx)(MoleculePanel_1.default, {}, void 0),
|
|
104
|
-
openWhen: [ToolTypes_1.options.rangesPicking.id],
|
|
105
94
|
hidePreferenceKey: 'hideStructuresPanel',
|
|
106
95
|
mode: null,
|
|
107
96
|
},
|
|
108
97
|
{
|
|
109
98
|
title: 'Database',
|
|
110
99
|
component: (0, jsx_runtime_1.jsx)(DatabasePanel_1.default, {}, void 0),
|
|
111
|
-
openWhen: [],
|
|
112
100
|
hidePreferenceKey: 'hideDatabasePanel',
|
|
113
101
|
mode: null,
|
|
114
102
|
},
|
|
103
|
+
{
|
|
104
|
+
title: 'Automatic Assignment',
|
|
105
|
+
component: (0, jsx_runtime_1.jsx)(AutomaticAssignment_1.default, {}, void 0),
|
|
106
|
+
hidePreferenceKey: '',
|
|
107
|
+
mode: null,
|
|
108
|
+
isExperimental: true,
|
|
109
|
+
},
|
|
115
110
|
];
|
|
116
|
-
exports.
|
|
111
|
+
exports.TOOLS_PANELS_ACCORDION = {
|
|
117
112
|
null: 'Spectra',
|
|
118
113
|
peakPicking: 'Peaks',
|
|
119
114
|
integral: 'Integrals',
|
|
120
115
|
rangesPicking: 'Ranges',
|
|
121
116
|
zone2D: 'Zones',
|
|
117
|
+
multipleSpectraAnalysis: 'Multiple Spectra Analysis',
|
|
122
118
|
};
|
|
123
119
|
function PanelsInner({ displayerMode }) {
|
|
124
120
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
@@ -37,9 +37,6 @@ function PeaksPanelInner({ peaks, info, xDomain, activeTab, preferences, }) {
|
|
|
37
37
|
}, [modal, yesHandler]);
|
|
38
38
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
39
39
|
setFlipStatus(!isFlipped);
|
|
40
|
-
if (!isFlipped) {
|
|
41
|
-
settingRef.current.cancelSetting();
|
|
42
|
-
}
|
|
43
40
|
}, [isFlipped]);
|
|
44
41
|
const saveSettingHandler = (0, react_2.useCallback)(() => {
|
|
45
42
|
settingRef.current.saveSetting();
|
|
@@ -88,7 +88,6 @@ const formatFields = [
|
|
|
88
88
|
];
|
|
89
89
|
function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
90
90
|
const alert = (0, Alert_1.useAlert)();
|
|
91
|
-
const [, setSettingsData] = (0, LocalStorage_1.useStateWithLocalStorage)('nmr-general-settings');
|
|
92
91
|
const formRef = (0, react_1.useRef)(null);
|
|
93
92
|
const updateValues = (0, react_1.useCallback)(() => {
|
|
94
93
|
if (nucleus) {
|
|
@@ -103,27 +102,19 @@ function PeaksPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
103
102
|
(0, react_1.useEffect)(() => {
|
|
104
103
|
updateValues();
|
|
105
104
|
}, [updateValues]);
|
|
106
|
-
const saveHandler = (0, react_1.useCallback)((values
|
|
105
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
107
106
|
preferences.dispatch({
|
|
108
107
|
type: preferencesReducer_1.SET_PANELS_PREFERENCES,
|
|
109
108
|
payload: { key: 'peaks', value: values },
|
|
110
109
|
});
|
|
111
|
-
|
|
112
|
-
alert.success('Peaks preferences saved successfully');
|
|
110
|
+
alert.success('Peaks preferences saved successfully');
|
|
113
111
|
}, [alert, preferences]);
|
|
114
112
|
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
115
113
|
saveSetting: () => {
|
|
116
114
|
formRef.current.submitForm();
|
|
117
115
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
}), [updateValues]);
|
|
122
|
-
const handleSubmit = (0, react_1.useCallback)((values) => {
|
|
123
|
-
saveHandler(values, true);
|
|
124
|
-
setSettingsData(values, 'formatting.panels.peaks');
|
|
125
|
-
}, [saveHandler, setSettingsData]);
|
|
126
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
116
|
+
}), []);
|
|
117
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}`, hideFormat: field.formatController === 'deltaPPMFormat' }, field.id)))] }, nucleusLabel))) }, void 0) }, void 0));
|
|
127
118
|
}
|
|
128
119
|
const MemoizedPeaksPreferences = (0, react_1.memo)(PeaksPreferencesInner);
|
|
129
120
|
// TODO: remove this hacky use of ref.
|
|
@@ -76,8 +76,8 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
|
|
|
76
76
|
to,
|
|
77
77
|
});
|
|
78
78
|
const dataToClipboard = {
|
|
79
|
-
x: x.slice(fromIndex, toIndex),
|
|
80
|
-
y: re.slice(fromIndex, toIndex),
|
|
79
|
+
x: Array.from(x.slice(fromIndex, toIndex)),
|
|
80
|
+
y: Array.from(re.slice(fromIndex, toIndex)),
|
|
81
81
|
...value,
|
|
82
82
|
};
|
|
83
83
|
const success = await (0, Export_1.copyTextToClipboard)(JSON.stringify(dataToClipboard, undefined, 2));
|
|
@@ -105,9 +105,6 @@ function RangesTablePanelInner({ ranges, data, info, xDomain, preferences, activ
|
|
|
105
105
|
}, [isFilterActive]);
|
|
106
106
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
107
107
|
setFlipStatus(!isFlipped);
|
|
108
|
-
if (!isFlipped) {
|
|
109
|
-
settingRef.current.cancelSetting();
|
|
110
|
-
}
|
|
111
108
|
}, [isFlipped]);
|
|
112
109
|
const saveSettingHandler = (0, react_2.useCallback)(() => {
|
|
113
110
|
settingRef.current.saveSetting();
|
|
@@ -76,7 +76,6 @@ const formatFields = [
|
|
|
76
76
|
];
|
|
77
77
|
function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
78
78
|
const alert = (0, Alert_1.useAlert)();
|
|
79
|
-
const [, setSettingsData] = (0, LocalStorage_1.useStateWithLocalStorage)('nmr-general-settings');
|
|
80
79
|
const formRef = (0, react_1.useRef)();
|
|
81
80
|
const updateValues = (0, react_1.useCallback)(() => {
|
|
82
81
|
if (nucleus) {
|
|
@@ -91,31 +90,19 @@ function RangesPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
91
90
|
(0, react_1.useEffect)(() => {
|
|
92
91
|
updateValues();
|
|
93
92
|
}, [updateValues]);
|
|
94
|
-
const
|
|
95
|
-
setSettingsData(values, 'formatting.panels.ranges');
|
|
96
|
-
};
|
|
97
|
-
const saveHandler = (0, react_1.useCallback)((values, showMessage = false) => {
|
|
93
|
+
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
98
94
|
preferences.dispatch({
|
|
99
95
|
type: preferencesReducer_1.SET_PANELS_PREFERENCES,
|
|
100
96
|
payload: { key: 'ranges', value: values },
|
|
101
97
|
});
|
|
102
|
-
|
|
103
|
-
alert.success('ranges preferences saved successfully');
|
|
104
|
-
}
|
|
98
|
+
alert.success('ranges preferences saved successfully');
|
|
105
99
|
}, [alert, preferences]);
|
|
106
100
|
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
107
101
|
saveSetting: () => {
|
|
108
102
|
formRef.current.submitForm();
|
|
109
103
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
}), [updateValues]);
|
|
114
|
-
const handleSubmit = (values) => {
|
|
115
|
-
saveHandler(values, true);
|
|
116
|
-
saveToLocalStorgate(values);
|
|
117
|
-
};
|
|
118
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: handleSubmit, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }, void 0) }, void 0)] }, nucleusLabel))) }, void 0) }, void 0));
|
|
104
|
+
}), []);
|
|
105
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: styles.container, children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: nucleus?.map((nucleusLabel) => ((0, jsx_runtime_1.jsxs)("div", { style: styles.groupContainer, children: [(0, jsx_runtime_1.jsx)(IsotopesViewer_1.default, { style: styles.header, value: nucleusLabel }, void 0), formatFields.map((field) => ((0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id))), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "J Graph tolerance (Hz) :", style: { label: styles.inputLabel, wrapper: styles.inputWrapper }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: `${nucleusLabel}.jGraphTolerance`, type: "number" }, void 0) }, void 0)] }, nucleusLabel))) }, void 0) }, void 0));
|
|
119
106
|
}
|
|
120
107
|
const MemoizedRangesPreferences = (0, react_1.memo)(RangesPreferencesInner);
|
|
121
108
|
// TODO: remove this hacky use of ref.
|
|
@@ -12,10 +12,11 @@ const DispatchContext_1 = require("../../context/DispatchContext");
|
|
|
12
12
|
const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
|
|
13
13
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
14
14
|
const Modal_1 = require("../../elements/popup/Modal");
|
|
15
|
+
const useCheckToolsVisibility_1 = require("../../hooks/useCheckToolsVisibility");
|
|
15
16
|
const Constants_1 = require("../../reducer/core/Constants");
|
|
16
17
|
const Types_1 = require("../../reducer/types/Types");
|
|
17
18
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
18
|
-
function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMode, spectrums, }) {
|
|
19
|
+
function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMode, spectrums, isAutomaticPickingVisible, }) {
|
|
19
20
|
const modal = (0, Modal_1.useModal)();
|
|
20
21
|
const alert = (0, Alert_1.useAlert)();
|
|
21
22
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
@@ -77,11 +78,20 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeTab, displayerMod
|
|
|
77
78
|
hideLoading();
|
|
78
79
|
}, 0);
|
|
79
80
|
}, [dispatch, alert]);
|
|
80
|
-
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}, void 0) }, void 0), activeSpectrum && activeTab && activeTab.split(',').length > 1 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaCreativeCommonsSamplingPlus, {}, void 0) }, void 0)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && spectrums.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrResetScale, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Same Top", onClick: setSameTopHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSameTop, {}, void 0) }, void 0)] }, void 0)), data && data.length > 0 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}, void 0) }, void 0))] }, void 0));
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(DefaultPanelHeader_1.default, { onDelete: handleDelete, counter: spectrums?.length, deleteToolTip: "Delete all spectra", children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Hide all spectra", onClick: hideAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEyeSlash, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Show all spectra", onClick: showAllSpectrumsHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaEye, {}, void 0) }, void 0), activeSpectrum && activeTab && activeTab.split(',').length > 1 && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add missing projection", onClick: addMissingProjectionHandler, children: (0, jsx_runtime_1.jsx)(fa_1.FaCreativeCommonsSamplingPlus, {}, void 0) }, void 0)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && spectrums.length > 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Reset Scale", onClick: resetScaleHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrResetScale, {}, void 0) }, void 0), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Same Top", onClick: setSameTopHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSameTop, {}, void 0) }, void 0)] }, void 0)), data && data.length > 0 && isAutomaticPickingVisible && ((0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Automatic Ranges/Zones picking for all spectra", onClick: automaticPickingHandler, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}, void 0) }, void 0))] }, void 0));
|
|
81
82
|
}
|
|
82
83
|
const MemoizedSpectraPanelHeader = (0, react_1.memo)(SpectraPanelHeaderInner);
|
|
83
84
|
function SpectrumsTabs({ spectrums }) {
|
|
84
85
|
const { data, activeSpectrum, activeTab, displayerMode } = (0, ChartContext_1.useChartData)();
|
|
85
|
-
|
|
86
|
+
const isToolVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
87
|
+
const isAutomaticPickingVisible = isToolVisible('hideAutoRangesTool');
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(MemoizedSpectraPanelHeader, { ...{
|
|
89
|
+
data,
|
|
90
|
+
activeSpectrum,
|
|
91
|
+
activeTab,
|
|
92
|
+
displayerMode,
|
|
93
|
+
spectrums,
|
|
94
|
+
isAutomaticPickingVisible,
|
|
95
|
+
} }, void 0));
|
|
86
96
|
}
|
|
87
97
|
exports.default = SpectrumsTabs;
|
|
@@ -12,7 +12,8 @@ const generateID_1 = __importDefault(require("../../../../data/utilities/generat
|
|
|
12
12
|
const ContextMenu_1 = __importDefault(require("../../../elements/ContextMenu"));
|
|
13
13
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
14
14
|
const highlight_1 = require("../../../highlight");
|
|
15
|
-
const
|
|
15
|
+
const IsInView_1 = __importDefault(require("../utilities/IsInView"));
|
|
16
|
+
const Utilities_1 = require("../utilities/Utilities");
|
|
16
17
|
const EditLinkModal_1 = __importDefault(require("./editLink/EditLinkModal"));
|
|
17
18
|
function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks, correlations, spectraData, onEdit, }) {
|
|
18
19
|
const contextRef = (0, react_1.useRef)();
|
|
@@ -140,6 +141,8 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
140
141
|
return arr;
|
|
141
142
|
}, [])
|
|
142
143
|
.join('/'), [commonLinks]);
|
|
144
|
+
const isInViewRow = (0, IsInView_1.default)({ correlation: rowCorrelation });
|
|
145
|
+
const isInViewColumn = (0, IsInView_1.default)({ correlation: columnCorrelation });
|
|
143
146
|
return ((0, jsx_runtime_1.jsxs)("td", { onContextMenu: (e) => {
|
|
144
147
|
if (contextMenu.length > 0) {
|
|
145
148
|
contextMenuHandler(e);
|
|
@@ -147,7 +150,9 @@ function AdditionalColumnField({ rowCorrelation, columnCorrelation, commonLinks,
|
|
|
147
150
|
}, style: {
|
|
148
151
|
backgroundColor: highlightCommonLinks.isActive
|
|
149
152
|
? '#ff6f0057'
|
|
150
|
-
:
|
|
153
|
+
: isInViewColumn || isInViewRow
|
|
154
|
+
? '#f5f5dc'
|
|
155
|
+
: 'inherit',
|
|
151
156
|
}, title: title, onMouseEnter: mouseEnterHandler, onMouseLeave: mouseLeaveHandler, children: [contentLabel, (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: contextMenu }, void 0)] }, void 0));
|
|
152
157
|
}
|
|
153
158
|
exports.default = AdditionalColumnField;
|
|
@@ -12,7 +12,8 @@ const FindUtilities_1 = require("../../../../data/utilities/FindUtilities");
|
|
|
12
12
|
const ContextMenu_1 = __importDefault(require("../../../elements/ContextMenu"));
|
|
13
13
|
const Modal_1 = require("../../../elements/popup/Modal");
|
|
14
14
|
const highlight_1 = require("../../../highlight");
|
|
15
|
-
const
|
|
15
|
+
const IsInView_1 = __importDefault(require("../utilities/IsInView"));
|
|
16
|
+
const Utilities_1 = require("../utilities/Utilities");
|
|
16
17
|
const EditLinkModal_1 = __importDefault(require("./editLink/EditLinkModal"));
|
|
17
18
|
function AdditionalColumnHeader({ spectraData, correlationsData, correlation, onEdit, }) {
|
|
18
19
|
const contextRef = (0, react_1.useRef)();
|
|
@@ -43,13 +44,16 @@ function AdditionalColumnHeader({ spectraData, correlationsData, correlation, on
|
|
|
43
44
|
event.currentTarget.blur();
|
|
44
45
|
highlightAdditionalColumn.hide();
|
|
45
46
|
}, [highlightAdditionalColumn]);
|
|
47
|
+
const isInView = (0, IsInView_1.default)({ correlation });
|
|
46
48
|
const tableHeaderProps = (0, react_1.useMemo)(() => {
|
|
47
49
|
return {
|
|
48
50
|
style: {
|
|
49
51
|
...{ color: (0, Utilities_1.getLabelColor)(correlationsData, correlation) || undefined },
|
|
50
52
|
backgroundColor: highlightAdditionalColumn.isActive
|
|
51
53
|
? '#ff6f0057'
|
|
52
|
-
:
|
|
54
|
+
: isInView
|
|
55
|
+
? '#f5f5dc'
|
|
56
|
+
: 'inherit',
|
|
53
57
|
},
|
|
54
58
|
title: correlation.pseudo === false &&
|
|
55
59
|
correlation.link
|
|
@@ -69,6 +73,7 @@ function AdditionalColumnHeader({ spectraData, correlationsData, correlation, on
|
|
|
69
73
|
correlation,
|
|
70
74
|
correlationsData,
|
|
71
75
|
highlightAdditionalColumn.isActive,
|
|
76
|
+
isInView,
|
|
72
77
|
mouseEnterHandler,
|
|
73
78
|
mouseLeaveHandler,
|
|
74
79
|
]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hybridizations = exports.ErrorColors = exports.Errors = exports.
|
|
3
|
+
exports.Hybridizations = exports.ErrorColors = exports.Errors = exports.DefaultTolerance = void 0;
|
|
4
4
|
// error colors in priority order
|
|
5
5
|
const ErrorColors = [
|
|
6
6
|
{ key: 'outOfLimit', color: 'red' },
|
|
@@ -43,10 +43,3 @@ const DefaultTolerance = {
|
|
|
43
43
|
P: 0.25,
|
|
44
44
|
};
|
|
45
45
|
exports.DefaultTolerance = DefaultTolerance;
|
|
46
|
-
const EditLinkActions = [
|
|
47
|
-
{ key: '-', value: '-', label: 'Select Action' },
|
|
48
|
-
{ key: 'delete', value: 'delete', label: 'Delete' },
|
|
49
|
-
{ key: 'move', value: 'move', label: 'Move' },
|
|
50
|
-
{ key: 'unmove', value: 'unmove', label: 'Unmove' },
|
|
51
|
-
];
|
|
52
|
-
exports.EditLinkActions = EditLinkActions;
|
|
@@ -7,7 +7,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
7
7
|
/** @jsxImportSource @emotion/react */
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const react_2 = require("react");
|
|
10
|
-
const Utilities_1 = require("../Utilities");
|
|
10
|
+
const Utilities_1 = require("../utilities/Utilities");
|
|
11
11
|
const AdditionalColumnHeader_1 = __importDefault(require("./AdditionalColumnHeader"));
|
|
12
12
|
const CorrelationTableRow_1 = __importDefault(require("./CorrelationTableRow"));
|
|
13
13
|
const tableStyle = (0, react_1.css) `
|
|
@@ -55,7 +55,7 @@ const tableStyle = (0, react_1.css) `
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
`;
|
|
58
|
-
function CorrelationTable({ correlationsData, filteredCorrelationsData, additionalColumnData, editEquivalencesSaveHandler,
|
|
58
|
+
function CorrelationTable({ correlationsData, filteredCorrelationsData, additionalColumnData, editEquivalencesSaveHandler, onSaveEditNumericValues, onEditCorrelationTableCellHandler, showProtonsAsRows, spectraData, }) {
|
|
59
59
|
const rows = (0, react_2.useMemo)(() => {
|
|
60
60
|
if (!filteredCorrelationsData) {
|
|
61
61
|
return [];
|
|
@@ -68,15 +68,14 @@ function CorrelationTable({ correlationsData, filteredCorrelationsData, addition
|
|
|
68
68
|
? {
|
|
69
69
|
color: (0, Utilities_1.getLabelColor)(correlationsData, correlation),
|
|
70
70
|
}
|
|
71
|
-
: {}, onSaveEditEquivalences: editEquivalencesSaveHandler,
|
|
71
|
+
: {}, onSaveEditEquivalences: editEquivalencesSaveHandler, onSaveEditNumericValues: onSaveEditNumericValues, onEditCorrelationTableCellHandler: onEditCorrelationTableCellHandler, spectraData: spectraData }, `correlation${correlation.atomType}${correlation.id}`)));
|
|
72
72
|
}, [
|
|
73
73
|
filteredCorrelationsData,
|
|
74
74
|
showProtonsAsRows,
|
|
75
75
|
additionalColumnData,
|
|
76
76
|
correlationsData,
|
|
77
77
|
editEquivalencesSaveHandler,
|
|
78
|
-
|
|
79
|
-
editProtonsCountSaveHandler,
|
|
78
|
+
onSaveEditNumericValues,
|
|
80
79
|
onEditCorrelationTableCellHandler,
|
|
81
80
|
spectraData,
|
|
82
81
|
]);
|