nmrium 0.48.0 → 0.50.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/Chart1D.js +3 -1
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SimilarityTree.d.ts +1 -0
- package/lib/component/1d/SimilarityTree.js +60 -0
- package/lib/component/1d/SpectraLegends.js +1 -1
- package/lib/component/1d/Viewer1D.js +142 -124
- package/lib/component/1d/jCouplingGraph/JsCoupling.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -7
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +114 -125
- package/lib/component/1d/multiplicityTree/MultiplicityTrees.d.ts +1 -0
- package/lib/component/1d/multiplicityTree/MultiplicityTrees.js +23 -0
- package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +18 -0
- package/lib/component/1d/multiplicityTree/generateTreeNodes.js +66 -0
- package/lib/component/1d/ranges/Atoms.d.ts +7 -0
- package/lib/component/1d/ranges/Atoms.js +43 -0
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/ranges/Range.js +10 -9
- package/lib/component/1d/tool/BaseLine.d.ts +2 -0
- package/lib/component/1d/tool/BaseLine.js +26 -0
- package/lib/component/1d/tool/BaseLineZones.js +18 -3
- package/lib/component/2d/Chart2D.js +6 -4
- package/lib/component/2d/Viewer2D.js +35 -26
- package/lib/component/context/KeyModifierContext.d.ts +13 -2
- package/lib/component/context/KeyModifierContext.js +35 -4
- package/lib/component/context/LoggerContext.d.ts +9 -0
- package/lib/component/context/LoggerContext.js +21 -7
- package/lib/component/context/PreferencesContext.d.ts +1 -108
- package/lib/component/context/TopicMoleculeContext.d.ts +8 -0
- package/lib/component/context/TopicMoleculeContext.js +30 -0
- package/lib/component/elements/CloseButton.d.ts +2 -10
- package/lib/component/elements/CloseButton.js +3 -20
- package/lib/component/elements/CounterLabel.js +0 -1
- package/lib/component/elements/DeleteButton.d.ts +5 -7
- package/lib/component/elements/DeleteButton.js +7 -5
- package/lib/component/elements/FilterButton.d.ts +6 -0
- package/lib/component/elements/FilterButton.js +8 -0
- package/lib/component/elements/Input.js +4 -1
- package/lib/component/elements/PreferencesButton.d.ts +2 -4
- package/lib/component/elements/PreferencesButton.js +5 -3
- package/lib/component/elements/ReactTable/ReactTable.js +5 -2
- package/lib/component/elements/ResizerWithScale.js +19 -2
- package/lib/component/elements/SVGGroup.js +2 -2
- package/lib/component/elements/SaveButton.d.ts +2 -11
- package/lib/component/elements/SaveButton.js +4 -19
- package/lib/component/elements/ToolBarButton.d.ts +9 -0
- package/lib/component/elements/ToolBarButton.js +14 -0
- package/lib/component/elements/formik/FormikTextarea.js +8 -9
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +2 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +11 -8
- package/lib/component/elements/resizer/SVGResizer.js +1 -1
- package/lib/component/header/BaseLineCorrectionPanel.js +3 -2
- package/lib/component/header/Header.js +2 -2
- package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
- package/lib/component/hooks/useSaveSettings.js +3 -2
- package/lib/component/hooks/useToolsFunctions.js +4 -2
- package/lib/component/main/InnerNMRium.js +2 -1
- package/lib/component/main/InnerNMRiumContents.js +1 -1
- package/lib/component/modal/AboutPredictionModal.js +4 -8
- package/lib/component/modal/AboutSpectrumSimulationModal.js +4 -8
- package/lib/component/modal/CopyClipboardModal.js +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +2 -2
- package/lib/component/modal/ExportAsJcampModal.d.ts +1 -1
- package/lib/component/modal/ExportAsJcampModal.js +8 -4
- package/lib/component/modal/ImportPublicationStringModal.d.ts +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +80 -32
- package/lib/component/modal/LoadJCAMPModal.js +12 -9
- package/lib/component/modal/LogsHistoryModal.d.ts +1 -1
- package/lib/component/modal/LogsHistoryModal.js +9 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +10 -3
- package/lib/component/modal/MultipletAnalysisModal.js +8 -8
- package/lib/component/modal/PredictSpectraModal.js +6 -5
- package/lib/component/modal/SaveAsModal.js +2 -2
- package/lib/component/modal/aboutUs/AboutUsModal.js +11 -26
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +4 -3
- package/lib/component/modal/changeSum/ChangeSumModal.js +10 -3
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +1 -3
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +9 -6
- package/lib/component/modal/editRange/EditRangeModal.js +8 -6
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -0
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +13 -10
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -0
- package/lib/component/modal/editZone/EditZoneModal.js +3 -3
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +17 -38
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +9 -11
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +2 -4
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -23
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -4
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +7 -8
- package/lib/component/panels/PeaksPanel/PeaksToggleActions.d.ts +8 -6
- package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +3 -6
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +8 -31
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +2 -2
- package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +39 -5
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +42 -11
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +4 -2
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +19 -16
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -3
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +2 -26
- package/lib/component/panels/databasePanel/DatabasePanel.js +6 -6
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +4 -6
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +12 -13
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +7 -8
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/panels/header/DefaultPanelHeader.js +9 -4
- package/lib/component/panels/header/PanelHeader.js +0 -1
- package/lib/component/panels/header/PreferencesHeader.d.ts +2 -4
- package/lib/component/panels/header/PreferencesHeader.js +9 -23
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -2
- package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -9
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +3 -3
- package/lib/component/reducer/Reducer.js +5 -0
- package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
- package/lib/component/reducer/actions/DatabaseActions.js +5 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +3 -4
- package/lib/component/reducer/actions/FiltersActions.js +92 -55
- package/lib/component/reducer/actions/LoadActions.js +10 -8
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -1
- package/lib/component/reducer/actions/SpectrumsActions.js +3 -3
- package/lib/component/reducer/actions/ToolsActions.d.ts +8 -5
- package/lib/component/reducer/actions/ToolsActions.js +51 -44
- package/lib/component/toolbar/BasicToolBar.js +11 -29
- package/lib/component/utility/export.js +3 -0
- package/lib/component/workspaces/exercise.js +1 -0
- package/lib/component/workspaces/prediction.js +1 -16
- package/lib/component/workspaces/simulation.js +1 -2
- package/lib/component/workspaces/workspaceDefaultProperties.js +4 -3
- package/lib/data/data1d/Spectrum1D/index.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/index.js +0 -1
- package/lib/utils/clipboard/clipboardComponents.d.ts +2 -2
- package/lib/utils/clipboard/clipboardComponents.js +8 -3
- package/lib/versionInfo.js +1 -1
- package/package.json +25 -23
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +0 -8
- package/lib/component/1d/multiplicityTree/LevelNode.js +0 -8
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +0 -11
- package/lib/component/1d/multiplicityTree/StringNode.js +0 -7
- package/lib/component/1d/multiplicityTree/TreeColors.d.ts +0 -1
- package/lib/component/1d/multiplicityTree/TreeColors.js +0 -1
- package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +0 -21
- package/lib/component/1d/multiplicityTree/TreeNodes.js +0 -23
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +0 -11
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +0 -57
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.js +0 -6
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
3
5
|
import { Formik } from 'formik';
|
|
4
6
|
import { readFromWebSource } from 'nmr-load-save';
|
|
5
7
|
import { useRef } from 'react';
|
|
6
|
-
import { Modal } from 'react-science/ui';
|
|
7
8
|
import * as Yup from 'yup';
|
|
8
9
|
import { useDispatch } from '../context/DispatchContext';
|
|
9
10
|
import Button from '../elements/Button';
|
|
@@ -59,12 +60,14 @@ export function LoadJCAMPModal({ onCloseDialog, isOpen }) {
|
|
|
59
60
|
onCloseDialog?.();
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
return (_jsxs(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
63
|
+
return (_jsxs(Dialog, { isOpen: true, onClose: onCloseDialog, title: "Load JCAMP Dialog", style: { minWidth: '400px' }, children: [_jsx(DialogBody, { css: css `
|
|
64
|
+
background-color: white;
|
|
65
|
+
`, children: _jsx(Formik, { initialValues: { url: '' }, validationSchema: loadFormValidation, onSubmit: loadJCAMPHandler, innerRef: ref, children: _jsx(Label, { title: "URL", style: labelStyle, children: _jsx(FormikError, { name: "url", style: { container: { flex: 1 } }, children: _jsx(FormikInput, { name: "url", type: "string", style: {
|
|
66
|
+
input: {
|
|
67
|
+
padding: '0.8em',
|
|
68
|
+
textAlign: 'left',
|
|
69
|
+
width: '100%',
|
|
70
|
+
},
|
|
71
|
+
inputWrapper: { width: '100%' },
|
|
72
|
+
}, placeholder: "Enter URL to JCAMP-DX file" }) }) }) }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button.Done, { onClick: () => ref.current?.submitForm(), children: "Load" }) }) })] }));
|
|
70
73
|
}
|
|
@@ -2,5 +2,5 @@ interface LogsHistoryModalProps {
|
|
|
2
2
|
autoOpen?: boolean;
|
|
3
3
|
onClose?: () => void;
|
|
4
4
|
}
|
|
5
|
-
export declare function LogsHistoryModal(props: LogsHistoryModalProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function LogsHistoryModal(props: LogsHistoryModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
2
5
|
import { useMemo } from 'react';
|
|
3
6
|
import { FaRegTrashAlt } from 'react-icons/fa';
|
|
4
7
|
import { IoBugOutline } from 'react-icons/io5';
|
|
5
8
|
import { ObjectInspector } from 'react-inspector';
|
|
6
|
-
import { useOnOff
|
|
9
|
+
import { useOnOff } from 'react-science/ui';
|
|
7
10
|
import { useLogger } from '../context/LoggerContext';
|
|
8
11
|
import Button from '../elements/Button';
|
|
9
12
|
import { ColumnWrapper } from '../elements/ColumnWrapper';
|
|
@@ -100,9 +103,11 @@ export function LogsHistoryModal(props) {
|
|
|
100
103
|
minWidth: '14px',
|
|
101
104
|
fontSize: '0.75em',
|
|
102
105
|
color: 'white',
|
|
103
|
-
}, children: count }))] }) })), _jsxs(
|
|
106
|
+
}, children: count }))] }) })), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: () => {
|
|
104
107
|
markAsRead();
|
|
105
108
|
closeDialog();
|
|
106
109
|
onClose?.();
|
|
107
|
-
},
|
|
110
|
+
}, title: "Logs History", style: { width: '50vw', height: '50vh' }, children: [_jsx(DialogBody, { css: css `
|
|
111
|
+
background-color: white;
|
|
112
|
+
`, children: _jsx(ReactTable, { columns: COLUMNS, data: sortedLogs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle }) }), _jsx(DialogFooter, { children: _jsx(Button.Danger, { onClick: () => logger.clear(), fill: "outline", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(FaRegTrashAlt, {}), _jsx("span", { style: { paddingLeft: '5px' }, children: "Clear Logs" })] }) }) })] })] }));
|
|
108
113
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
3
5
|
import { Molecule } from 'openchemlib/full';
|
|
4
6
|
import { TopicMolecule } from 'openchemlib-utils';
|
|
5
7
|
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
6
8
|
import { StructureEditor } from 'react-ocl/full';
|
|
7
|
-
import {
|
|
9
|
+
import { useOnOff } from 'react-science/ui';
|
|
8
10
|
import { useDispatch } from '../context/DispatchContext';
|
|
11
|
+
import ActionButtons from '../elements/ActionButtons';
|
|
9
12
|
function MoleculeStructureEditorModal(props) {
|
|
10
13
|
const { onClose = () => null, selectedMolecule, floatMoleculeOnSave = false, isOpen = false, } = props;
|
|
11
14
|
const initialMolfile = selectedMolecule?.molfile;
|
|
@@ -77,7 +80,11 @@ function MoleculeStructureEditorModal(props) {
|
|
|
77
80
|
floatMoleculeOnSave,
|
|
78
81
|
onClose,
|
|
79
82
|
]);
|
|
80
|
-
return (
|
|
83
|
+
return (_jsxs(Dialog, { isOpen: isOpen, onClose: handleClose, style: { width: 710 }, children: [_jsx(DialogBody, { css: css `
|
|
84
|
+
background-color: white;
|
|
85
|
+
`, children: _jsx(StructureEditor, { initialMolfile: initialEnhancedMolfile?.molfile, svgMenu: true, fragment: false, onChange: cb }) }), _jsx(DialogFooter, { children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => {
|
|
86
|
+
onClose();
|
|
87
|
+
} }) })] }));
|
|
81
88
|
}
|
|
82
89
|
export function useMoleculeEditor(floatMoleculeOnSave = false) {
|
|
83
90
|
const [isOpen, openModal, closeModal] = useOnOff(false);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Dialog, DialogBody } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
5
|
import { xGetFromToIndex, xyToXYObject } from 'ml-spectra-processing';
|
|
5
6
|
import { analyseMultiplet } from 'multiplet-analysis';
|
|
6
7
|
import { useState, useEffect } from 'react';
|
|
7
8
|
import { Plot, LineSeries, Axis } from 'react-plot';
|
|
8
|
-
import { Modal } from 'react-science/ui';
|
|
9
9
|
import { isSpectrum2D } from '../../data/data2d/Spectrum2D';
|
|
10
10
|
const styles = css `
|
|
11
|
+
background-color: white;
|
|
12
|
+
|
|
11
13
|
button:focus {
|
|
12
14
|
outline: none;
|
|
13
15
|
}
|
|
@@ -49,8 +51,6 @@ const loaderStyles = css `
|
|
|
49
51
|
justify-content: center;
|
|
50
52
|
flex-direction: column;
|
|
51
53
|
user-select: none;
|
|
52
|
-
width: 900px;
|
|
53
|
-
height: 400px;
|
|
54
54
|
|
|
55
55
|
svg {
|
|
56
56
|
animation-name: spin-animation;
|
|
@@ -74,11 +74,11 @@ const loaderStyles = css `
|
|
|
74
74
|
}
|
|
75
75
|
`;
|
|
76
76
|
export default function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, onClose, isOpen, }) {
|
|
77
|
-
return (_jsx(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
return (_jsx(Dialog, { isOpen: isOpen, onClose: () => onClose(), title: "Analyse Multiplet", style: { width: 900, height: 400 }, children: _jsx(DialogBody, { css: styles, children: _jsx(InnerMultipleAnalysis, { data,
|
|
78
|
+
activeSpectrum,
|
|
79
|
+
scaleX,
|
|
80
|
+
startX,
|
|
81
|
+
endX }) }) }));
|
|
82
82
|
}
|
|
83
83
|
function InnerMultipleAnalysis(props) {
|
|
84
84
|
const [calcStart, setCalcStartStatus] = useState(false);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { Checkbox } from '@blueprintjs/core';
|
|
3
|
+
import { Checkbox, Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
5
|
import { SvgNmrFt } from 'cheminfo-font';
|
|
6
6
|
import { useCallback, useRef, useState, useMemo } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { Toolbar, useOnOff } from 'react-science/ui';
|
|
8
8
|
import { getDefaultPredictionOptions, predictSpectra, } from '../../data/PredictionManager';
|
|
9
9
|
import { useChartData } from '../context/ChartContext';
|
|
10
10
|
import { useDispatch } from '../context/DispatchContext';
|
|
@@ -13,8 +13,9 @@ import Button from '../elements/Button';
|
|
|
13
13
|
import { useAlert } from '../elements/popup/Alert';
|
|
14
14
|
import PredictionPreferences from '../panels/predictionPanel/PredictionOptionsPanel';
|
|
15
15
|
import { useStateWithLocalStorage } from '../utility/LocalStorage';
|
|
16
|
-
import { ModalStyles } from './ModalStyle';
|
|
17
16
|
const styles = css `
|
|
17
|
+
background-color: white;
|
|
18
|
+
|
|
18
19
|
.inner-content {
|
|
19
20
|
flex: 1;
|
|
20
21
|
}
|
|
@@ -104,9 +105,9 @@ export function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
104
105
|
setPredictionPreferences,
|
|
105
106
|
closeDialog,
|
|
106
107
|
]);
|
|
107
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
108
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { icon: _jsx(SvgNmrFt, {}), title: "Predict spectra", onClick: openDialog }) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: () => {
|
|
108
109
|
onClose();
|
|
109
110
|
closeDialog();
|
|
110
|
-
}, width: 600, maxWidth: 1000
|
|
111
|
+
}, style: { width: 600, maxWidth: 1000 }, title: "Prediction of NMR spectrum", children: [_jsxs(DialogBody, { css: styles, children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsx("div", { className: "warning-container", children: _jsx(Checkbox, { onChange: (value) => setApproved(value.target.checked), checked: isApproved, label: "I confirm that the chemical structure is not confidential." }) })] }), _jsx(DialogFooter, { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] })] }));
|
|
111
112
|
}
|
|
112
113
|
export default PredictSpectraModal;
|
|
@@ -6,7 +6,7 @@ import { useCallback, useRef } from 'react';
|
|
|
6
6
|
import { DataExportOptions } from '../../data/SpectraManager';
|
|
7
7
|
import { useChartData } from '../context/ChartContext';
|
|
8
8
|
import ActionButtons from '../elements/ActionButtons';
|
|
9
|
-
import CloseButton from '../elements/CloseButton';
|
|
9
|
+
import { CloseButton } from '../elements/CloseButton';
|
|
10
10
|
import Label from '../elements/Label';
|
|
11
11
|
import FormikCheckBox from '../elements/formik/FormikCheckBox';
|
|
12
12
|
import FormikInput from '../elements/formik/FormikInput';
|
|
@@ -61,7 +61,7 @@ function SaveAsModal({ onClose, onSave, name }) {
|
|
|
61
61
|
onSave(values);
|
|
62
62
|
onClose?.();
|
|
63
63
|
}, [onClose, onSave]);
|
|
64
|
-
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { style: labelStyle, title: "Name", children: _jsx(FormikInput, { name: "name", className: "name", style: {
|
|
64
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Save as ... " }), _jsx(CloseButton, { onClick: () => onClose?.(), className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { innerRef: refForm, initialValues: { ...INITIAL_VALUE, name }, onSubmit: submitHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { style: labelStyle, title: "Name", children: _jsx(FormikInput, { name: "name", className: "name", style: {
|
|
65
65
|
inputWrapper: { width: '100%' },
|
|
66
66
|
input: { padding: '5px', textAlign: 'left' },
|
|
67
67
|
} }) }), _jsx(Label, { style: labelStyle, title: "Compressed", children: _jsx(FormikCheckBox, { name: "compressed" }) }), _jsx(Label, { style: labelStyle, title: "Pretty Format", children: _jsx(FormikCheckBox, { name: "pretty" }) }), _jsx(Label, { style: labelStyle, title: "Include view", children: _jsx(FormikCheckBox, { name: "include.view" }) }), _jsx(Label, { style: labelStyle, title: "Include settings", children: _jsx(FormikCheckBox, { name: "include.settings" }) }), _jsx(Label, { style: labelStyle, title: "Include Data", children: _jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: _jsxs("div", { className: "data-export-group", children: [_jsxs("label", { children: [_jsx(Field, { type: "radio", name: "include.dataType", value: DataExportOptions.ROW_DATA }), "Raw Data"] }), _jsxs("label", { style: {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Dialog, DialogBody } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
5
|
import { SvgLogoNmrium } from 'cheminfo-font';
|
|
5
|
-
import {
|
|
6
|
+
import { Toolbar, useOnOff } from 'react-science/ui';
|
|
6
7
|
import versionInfo from '../../../versionInfo';
|
|
7
8
|
import Logo from '../../elements/Logo';
|
|
8
9
|
import AboutUsZakodium from './AboutUsZakodium';
|
|
9
10
|
const styles = css `
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
user-select: none;
|
|
14
|
+
background-color: white;
|
|
12
15
|
|
|
13
16
|
button:focus {
|
|
14
17
|
outline: none;
|
|
@@ -64,32 +67,14 @@ const styles = css `
|
|
|
64
67
|
height: 1px;
|
|
65
68
|
margin: 10px 0;
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
.header {
|
|
69
|
-
span {
|
|
70
|
-
color: #464646;
|
|
71
|
-
font-size: 15px;
|
|
72
|
-
flex: 1;
|
|
73
|
-
user-select: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
button {
|
|
77
|
-
background-color: transparent;
|
|
78
|
-
border: none;
|
|
79
|
-
|
|
80
|
-
svg {
|
|
81
|
-
height: 16px;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
user-select: none;
|
|
89
70
|
`;
|
|
90
71
|
function AboutUsModal() {
|
|
91
72
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
92
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo", title: "About NMRium", icon: _jsx(SvgLogoNmrium, {}) }), _jsx(
|
|
73
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo", title: "About NMRium", icon: _jsx(SvgLogoNmrium, {}) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: {
|
|
74
|
+
maxWidth: 1000,
|
|
75
|
+
width: '40vw',
|
|
76
|
+
minWidth: '500px',
|
|
77
|
+
}, title: "About NMRium", children: _jsx(DialogBody, { css: styles, children: _jsxs("div", { className: "container", children: [_jsxs("div", { className: "center-container", children: [_jsx(Logo, { width: 160, height: 50 }), "Version ", _jsx(VersionInfo, {}), _jsx("span", { className: "separator" }), _jsx("a", { href: "https://git.nmrium.org", target: "_blank", rel: "noreferrer", children: "GitHub ( https://git.nmrium.org )" })] }), _jsx("div", { className: "center-container", children: _jsx("span", { className: "separator" }) }), _jsx("span", { className: "content", children: "This project is developed by Zakodium S\u00E0rl (Switzerland), the University of Cologne (Germany), Johannes Gutenberg University Mainz (Germany) and Universidad del Valle (Colombia)." }), _jsxs("div", { className: "center-container", children: [_jsx("span", { className: "separator" }), _jsx("span", { className: "title", children: "Funding is provided by" }), _jsx("span", { className: "separator" })] }), _jsx("div", { className: "content", children: _jsxs("ul", { children: [_jsx("li", { children: "IDNMR grant, which part of the Scientific Library Services and Information Systems (LIS) initiative of the DFG." }), _jsx("li", { children: _jsx(AboutUsZakodium, {}) }), _jsx("li", { children: "Universidad del Valle (Cali, Colombia)." })] }) })] }) }) })] }));
|
|
93
78
|
}
|
|
94
79
|
export default AboutUsModal;
|
|
95
80
|
function VersionInfo() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { ChangeSumModalContentsProps } from './ChangeSumModalContents';
|
|
3
2
|
export interface ChangeSumModalProps extends Omit<ChangeSumModalContentsProps, 'onClose'> {
|
|
4
|
-
|
|
3
|
+
currentSum: number | null;
|
|
4
|
+
sumType: string;
|
|
5
|
+
disabled?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export default function ChangeSumModal(
|
|
7
|
+
export default function ChangeSumModal(props: ChangeSumModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Dialog } from '@blueprintjs/core';
|
|
3
|
+
import { SvgNmrSum } from 'cheminfo-font';
|
|
4
|
+
import { Toolbar, useOnOff } from 'react-science/ui';
|
|
3
5
|
import { ChangeSumModalContents, } from './ChangeSumModalContents';
|
|
4
|
-
export default function ChangeSumModal(
|
|
6
|
+
export default function ChangeSumModal(props) {
|
|
7
|
+
const { disabled = false, currentSum, sumType, ...otherProps } = props;
|
|
5
8
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
6
|
-
return (_jsxs(_Fragment, { children: [
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { disabled: disabled, icon: _jsx(SvgNmrSum, {}), title: currentSum
|
|
10
|
+
? `Change ${sumType} sum (${currentSum.toFixed(2)})`
|
|
11
|
+
: `Change ${sumType} sum`, onClick: openDialog }), isOpenDialog && (_jsx(Dialog, { isOpen: true, onClose: closeDialog, style: { width: 500, height: 400 }, title: currentSum
|
|
12
|
+
? `Set new ${sumType} sum (Current: ${currentSum.toFixed(2)})`
|
|
13
|
+
: `Set new ${sumType} Sum`, children: _jsx(ChangeSumModalContents, { ...otherProps, onClose: closeDialog }) }))] }));
|
|
7
14
|
}
|
|
@@ -8,11 +8,9 @@ type SaveInput = {
|
|
|
8
8
|
sumAuto: true;
|
|
9
9
|
};
|
|
10
10
|
export interface ChangeSumModalContentsProps {
|
|
11
|
-
currentSum: number | null;
|
|
12
|
-
sumType: string;
|
|
13
11
|
sumOptions: SumOptions;
|
|
14
12
|
onSave: (saveInput: SaveInput) => void;
|
|
15
13
|
onClose: () => void;
|
|
16
14
|
}
|
|
17
|
-
export declare function ChangeSumModalContents(props: ChangeSumModalContentsProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function ChangeSumModalContents(props: ChangeSumModalContentsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
16
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
4
|
+
import { css } from '@emotion/react';
|
|
2
5
|
import styled from '@emotion/styled';
|
|
3
6
|
import { Formik } from 'formik';
|
|
4
7
|
import { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { Modal } from 'react-science/ui';
|
|
6
8
|
import * as Yup from 'yup';
|
|
7
9
|
import { usePreferences } from '../../context/PreferencesContext';
|
|
8
10
|
import Button from '../../elements/Button';
|
|
@@ -41,7 +43,7 @@ const ManualContainer = styled.div `
|
|
|
41
43
|
}
|
|
42
44
|
`;
|
|
43
45
|
export function ChangeSumModalContents(props) {
|
|
44
|
-
const {
|
|
46
|
+
const { sumOptions, onSave, onClose } = props;
|
|
45
47
|
const { current: { display: { panels }, }, } = usePreferences();
|
|
46
48
|
const [setOption, setActiveOption] = useState('auto');
|
|
47
49
|
const formRef = useRef(null);
|
|
@@ -88,7 +90,8 @@ export function ChangeSumModalContents(props) {
|
|
|
88
90
|
onClose();
|
|
89
91
|
}
|
|
90
92
|
const isStructurePanelVisible = panels?.structuresPanel?.display || false;
|
|
91
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
return (_jsxs(_Fragment, { children: [_jsx(DialogBody, { css: css `
|
|
94
|
+
padding: 0;
|
|
95
|
+
background-color: white;
|
|
96
|
+
`, children: _jsx(Formik, { innerRef: formRef, onSubmit: saveHandler, initialValues: { sum: '', molecule: null }, validationSchema: getValidationSchema(setOption), children: _jsxs(Tabs, { activeTab: setOption, onClick: onTabChangeHandler, children: [isStructurePanelVisible && (_jsx(Tab, { title: "Auto", tabid: "auto", children: _jsx(SelectMolecule, { name: "molecule" }) })), _jsx(Tab, { title: "Manual", tabid: "manual", children: _jsx(ManualContainer, { children: _jsx(FormikInput, { name: "sum", type: "number", placeholder: "Enter the new value", onKeyDown: handleKeyDown }) }) })] }) }) }), _jsx(DialogFooter, { children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), style: { width: 80 }, children: "Set" }) })] }));
|
|
94
97
|
}
|
|
@@ -9,8 +9,8 @@ import { FaSearchPlus } from 'react-icons/fa';
|
|
|
9
9
|
import { useChartData } from '../../context/ChartContext';
|
|
10
10
|
import { useDispatch } from '../../context/DispatchContext';
|
|
11
11
|
import Button from '../../elements/Button';
|
|
12
|
-
import CloseButton from '../../elements/CloseButton';
|
|
13
|
-
import SaveButton from '../../elements/SaveButton';
|
|
12
|
+
import { CloseButton } from '../../elements/CloseButton';
|
|
13
|
+
import { SaveButton } from '../../elements/SaveButton';
|
|
14
14
|
import FormikOnChange from '../../elements/formik/FormikOnChange';
|
|
15
15
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
16
16
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
@@ -19,8 +19,7 @@ import { formatNumber } from '../../utility/formatNumber';
|
|
|
19
19
|
import SignalsForm from './forms/components/SignalsForm';
|
|
20
20
|
import editRangeFormValidation from './forms/validation/EditRangeValidation';
|
|
21
21
|
const styles = css `
|
|
22
|
-
|
|
23
|
-
height: 500px;
|
|
22
|
+
min-height: 500px;
|
|
24
23
|
padding: 5px;
|
|
25
24
|
|
|
26
25
|
button:focus {
|
|
@@ -28,7 +27,6 @@ const styles = css `
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
.header {
|
|
31
|
-
height: 24px;
|
|
32
30
|
border-bottom: 1px solid #f0f0f0;
|
|
33
31
|
display: flex;
|
|
34
32
|
align-items: center;
|
|
@@ -51,6 +49,10 @@ const styles = css `
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
}
|
|
52
|
+
|
|
53
|
+
.tabs .tab-list {
|
|
54
|
+
overflow-x: auto;
|
|
55
|
+
}
|
|
54
56
|
`;
|
|
55
57
|
function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
|
|
56
58
|
const formRef = useRef(null);
|
|
@@ -152,7 +154,7 @@ function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
|
|
|
152
154
|
if (!rangesPreferences || !range) {
|
|
153
155
|
return;
|
|
154
156
|
}
|
|
155
|
-
return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(),
|
|
157
|
+
return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), title: "Save and Exit" }), _jsx(CloseButton, { onClick: handleOnClose })] }), _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsForm, { range: range, preferences: rangesPreferences }), _jsx(FormikOnChange, { onChange: changeHandler })] }) })] }));
|
|
156
158
|
}
|
|
157
159
|
function useRange(rangeId) {
|
|
158
160
|
const { ranges } = useSpectrum({
|
|
@@ -43,18 +43,21 @@ function CouplingsTable({ push, remove, onFocus, onBlur, }) {
|
|
|
43
43
|
}
|
|
44
44
|
}, [setFieldValue]);
|
|
45
45
|
const couplingsList = lodashGet(values, `signals[${values.activeTab}].js`, []);
|
|
46
|
-
return (_jsxs("div", { children: [_jsxs(Button.Done, { fill: "outline", style: {
|
|
46
|
+
return (_jsxs("div", { children: [_jsxs(Button.Done, { fill: "outline", style: { overflow: 'auto' }, onClick: () => push({
|
|
47
47
|
multiplicity: translateMultiplet('m'),
|
|
48
48
|
coupling: '',
|
|
49
|
-
}), children: [_jsx(FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), _jsx("table", { css: CouplingsTableStyle, children:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
input: {
|
|
53
|
-
width: '100%',
|
|
49
|
+
}), children: [_jsx(FaPlus, { title: "Add new coupling", style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block', paddingLeft: '5px' }, children: "Add New Coupling" })] }), _jsx("div", { style: { maxHeight: '300px', overflow: 'auto' }, children: _jsxs("table", { css: CouplingsTableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "#" }), _jsx("th", { children: "Multiplicity" }), _jsx("th", { children: "J (Hz)" }), _jsx("th", { children: '' })] }) }), _jsx("tbody", { style: { overflow: 'auto' }, children: couplingsList.map((_coupling, i) => (_jsxs("tr", { children: [_jsx("td", { children: i + 1 }), _jsx("td", { children: _jsx(FormikSelect, { className: "select-box", name: `signals.${values.activeTab}.js.${i}.multiplicity`, items: Multiplets, itemValueField: "label", onChange: (value) => {
|
|
50
|
+
multiplicityChangeHandler(value, `signals.${values.activeTab}.js.${i}.coupling`);
|
|
51
|
+
}, style: {
|
|
54
52
|
height: '26px',
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
} }) }), _jsx("td", { children: _jsx(FormikInput, { name: `signals.${values.activeTab}.js.${i}.coupling`, type: "number", placeholder: 'J (Hz)', disabled: !hasCouplingConstant(_coupling.multiplicity), onFocus: onFocus, onBlur: onBlur, style: {
|
|
54
|
+
input: {
|
|
55
|
+
width: '100%',
|
|
56
|
+
height: '26px',
|
|
57
|
+
padding: '0.25rem 0.5rem',
|
|
58
|
+
},
|
|
59
|
+
}, checkErrorAfterInputTouched: false }) }), _jsx("td", { children: _jsx("div", { style: { display: 'flex' }, children: _jsx(Button.Danger, { fill: "clear", onClick: () => {
|
|
60
|
+
remove(i);
|
|
61
|
+
}, children: _jsx(FaRegTrashAlt, { title: "Delete coupling" }) }) }) })] }, `editCouplings${values.activeTab}${i}`))) })] }) })] }));
|
|
59
62
|
}
|
|
60
63
|
export default memo(CouplingsTable);
|
|
@@ -13,6 +13,6 @@ const style = {
|
|
|
13
13
|
};
|
|
14
14
|
function SignalFormTab({ onFocus, onBlur }) {
|
|
15
15
|
const { values } = useFormikContext();
|
|
16
|
-
return (_jsx("div", { style: style, children: _jsx(FieldArray, { name: `signals.${values.activeTab}.js`, render: ({ push, remove }) => (_jsx(
|
|
16
|
+
return (_jsx("div", { style: style, children: _jsx(FieldArray, { name: `signals.${values.activeTab}.js`, render: ({ push, remove }) => (_jsx(CouplingsTable, { push: push, remove: remove, onFocus: onFocus, onBlur: onBlur })) }) }));
|
|
17
17
|
}
|
|
18
18
|
export default memo(SignalFormTab);
|
|
@@ -105,6 +105,7 @@ function SignalsForm({ range, preferences }) {
|
|
|
105
105
|
padding: '0 1.5rem',
|
|
106
106
|
fontSize: '12px',
|
|
107
107
|
color: '#28ba62',
|
|
108
|
+
textWrap: 'nowrap',
|
|
108
109
|
}, children: [_jsx(FaPlus, { style: { display: 'inline-block' } }), _jsx("span", { style: { display: 'inline-block' }, children: "New Signal" })] })), children: _jsx(AddSignalFormTab, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef, preferences: preferences }) }, "addSignalTab"));
|
|
109
110
|
return [...signalTabs, addSignalTab];
|
|
110
111
|
}, [handleOnFocus, preferences, range, tabContainsErrors, values.signals]);
|
|
@@ -6,8 +6,8 @@ import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
|
6
6
|
import { FaSearchPlus } from 'react-icons/fa';
|
|
7
7
|
import DefaultPathLengths from '../../../data/constants/DefaultPathLengths';
|
|
8
8
|
import Button from '../../elements/Button';
|
|
9
|
-
import CloseButton from '../../elements/CloseButton';
|
|
10
|
-
import SaveButton from '../../elements/SaveButton';
|
|
9
|
+
import { CloseButton } from '../../elements/CloseButton';
|
|
10
|
+
import { SaveButton } from '../../elements/SaveButton';
|
|
11
11
|
import SignalsForm from './SignalsForm';
|
|
12
12
|
import zoneFormValidation from './validation/EditZoneValidation';
|
|
13
13
|
import isDefaultPathLength from './validation/isDefaultPathLength';
|
|
@@ -96,6 +96,6 @@ function EditZoneModal({ onSaveEditZoneModal = () => null, onCloseEditZoneModal
|
|
|
96
96
|
}),
|
|
97
97
|
};
|
|
98
98
|
}, [rowData.signals, rowData.tableMetaInfo.experiment]);
|
|
99
|
-
return (_jsx("div", { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: zoneFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: `Zone and Signal edition` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(),
|
|
99
|
+
return (_jsx("div", { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: zoneFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: `Zone and Signal edition` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), title: "Save and Exit" }), _jsx(CloseButton, { onClick: handleOnClose })] }), _jsx(SignalsForm, {})] }) }) }));
|
|
100
100
|
}
|
|
101
101
|
export default EditZoneModal;
|
|
@@ -8,7 +8,7 @@ import { isMetaFile, linkMetaWithSpectra, parseMetaFile, TargetPathError, mapErr
|
|
|
8
8
|
import { useChartData } from '../../context/ChartContext';
|
|
9
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
10
10
|
import Button from '../../elements/Button';
|
|
11
|
-
import CloseButton from '../../elements/CloseButton';
|
|
11
|
+
import { CloseButton } from '../../elements/CloseButton';
|
|
12
12
|
import Label from '../../elements/Label';
|
|
13
13
|
import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
14
14
|
import FormikInput from '../../elements/formik/FormikInput';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { Dialog, DialogBody, DialogFooter, Classes } from '@blueprintjs/core';
|
|
3
4
|
import { css } from '@emotion/react';
|
|
4
5
|
import { Formik } from 'formik';
|
|
5
6
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
7
|
import { FaBolt, FaPaste, FaRegCopy, FaWrench } from 'react-icons/fa';
|
|
7
|
-
import {
|
|
8
|
+
import { Toolbar, useOnOff } from 'react-science/ui';
|
|
8
9
|
import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardComponents';
|
|
9
10
|
import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
|
|
10
11
|
import { usePreferences, useWorkspacesList, } from '../../context/PreferencesContext';
|
|
@@ -30,16 +31,6 @@ import SpectraColorsTabContent from './settings-tabs/SpectraColorsTabContent';
|
|
|
30
31
|
import ToolsTabContent from './settings-tabs/ToolsTabContent';
|
|
31
32
|
import { validation } from './settingsValidation';
|
|
32
33
|
const styles = css `
|
|
33
|
-
width: 50vw;
|
|
34
|
-
min-width: 800px;
|
|
35
|
-
|
|
36
|
-
.main-content {
|
|
37
|
-
width: 100%;
|
|
38
|
-
flex: 1;
|
|
39
|
-
overflow: auto;
|
|
40
|
-
border: none;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
34
|
.tab-content {
|
|
44
35
|
width: 100%;
|
|
45
36
|
}
|
|
@@ -63,18 +54,6 @@ const styles = css `
|
|
|
63
54
|
padding: 3px;
|
|
64
55
|
}
|
|
65
56
|
|
|
66
|
-
.close-bt {
|
|
67
|
-
border: none;
|
|
68
|
-
color: red;
|
|
69
|
-
background-color: transparent;
|
|
70
|
-
outline: none;
|
|
71
|
-
position: absolute;
|
|
72
|
-
right: 10px;
|
|
73
|
-
top: 2px;
|
|
74
|
-
width: 30px;
|
|
75
|
-
height: 30px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
57
|
.checkbox-label {
|
|
79
58
|
min-width: 300px;
|
|
80
59
|
display: inline-block;
|
|
@@ -222,21 +201,21 @@ function GeneralSettingsModal({ height }) {
|
|
|
222
201
|
function handlePastWorkspaceAction() {
|
|
223
202
|
void readText().then(handlePastWorkspace);
|
|
224
203
|
}
|
|
225
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
204
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", icon: _jsx(FaWrench, {}) }), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, style: { maxWidth: 1000, width: '50vw', minWidth: 800 }, title: "General Settings", icon: "cog", children: [_jsx("div", { children: _jsxs("div", { className: Classes.DIALOG_HEADER, style: {
|
|
205
|
+
cursor: 'default',
|
|
206
|
+
paddingTop: '10px',
|
|
207
|
+
boxShadow: 'none',
|
|
208
|
+
backgroundColor: '#f8f8f8',
|
|
209
|
+
}, children: [_jsx(Label, { title: "Workspace", children: _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences.workspace.current, onSelect: ChangeWorkspaceHandler }) }), _jsx(Button.Action, { size: "xSmall", onClick: handleReset, toolTip: "Reset workspace preferences", tooltipOrientation: "horizontal", style: {
|
|
210
|
+
marginLeft: '10px',
|
|
211
|
+
}, disabled: isRestDisabled, children: _jsx(FaBolt, {}) }), _jsx(Button.Done, { size: "xSmall", fill: "outline", onClick: handleCopyWorkspace, toolTip: "Copy workspace preferences", tooltipOrientation: "horizontal", style: {
|
|
212
|
+
marginLeft: '10px',
|
|
213
|
+
}, children: _jsx(FaRegCopy, {}) }), _jsx(Button.Action, { size: "xSmall", fill: "outline", onClick: handlePastWorkspaceAction, toolTip: "Past workspace preferences", tooltipOrientation: "horizontal", style: {
|
|
214
|
+
marginLeft: '10px',
|
|
215
|
+
}, children: _jsx(FaPaste, {}) })] }) }), _jsx(DialogBody, { css: css `
|
|
216
|
+
padding: 0;
|
|
217
|
+
background-color: white;
|
|
218
|
+
`, children: _jsx("div", { css: styles, style: { height }, children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { title: "General", tabid: "general", children: _jsx("div", { className: "inner-content", children: _jsx(GeneralTabContent, {}) }) }), _jsx(Tab, { title: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { title: "Panels", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, {}) }) }), _jsx(Tab, { title: "Tools", tabid: "tools", children: _jsx("div", { className: "inner-content", children: _jsx(ToolsTabContent, {}) }) }), _jsx(Tab, { title: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }) }), _jsx(Tab, { title: "Import filters", tabid: "importation-filters", children: _jsx("div", { className: "inner-content", children: _jsx(ImportationFiltersTabContent, {}) }) }), _jsx(Tab, { title: "Title Block", tabid: "title-block", children: _jsx("div", { className: "inner-content", children: _jsx(InfoBlockTabContent, {}) }) }), _jsx(Tab, { title: "On Load Processing", tabid: "on-load-processing", children: _jsx("div", { className: "inner-content", children: _jsx(OnLoadProcessingTabContent, {}) }) }), _jsx(Tab, { title: "Spectra colors", tabid: "spectra-colors", children: _jsx("div", { className: "inner-content", children: _jsx(SpectraColorsTabContent, {}) }) })] }) }) }) }), _jsx(DialogFooter, { children: _jsxs("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [_jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
|
|
240
219
|
closeDialog?.();
|
|
241
220
|
} }), _jsx(Button.Secondary, { style: { margin: '0 10px' }, onClick: applyPreferencesHandler, children: "Apply" })] }) })] }), _jsx(SaveSettingsModal, {}), _jsx(ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePastWorkspace, text: text, label: "Workspace" })] }));
|
|
242
221
|
}
|