nmrium 0.45.1-pre.1701344673 → 0.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/Chart1D.js +3 -1
- package/lib/component/1d/Viewer1D.js +4 -21
- package/lib/component/1d/tool/PeakPointer.js +6 -16
- package/lib/component/1d/utilities/scale.js +13 -8
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +15 -4
- package/lib/component/2d/1d-tracer/Top1DChart.js +1 -1
- package/lib/component/2d/zones/Signal.js +1 -1
- package/lib/component/2d/zones/Zone.js +1 -1
- package/lib/component/elements/ContextMenuBluePrint.d.ts +16 -0
- package/lib/component/elements/ContextMenuBluePrint.js +20 -0
- package/lib/component/elements/DropdownMenu.d.ts +9 -0
- package/lib/component/elements/DropdownMenu.js +7 -0
- package/lib/component/elements/Header.d.ts +1 -1
- package/lib/component/elements/Header.js +5 -7
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.d.ts +5 -5
- package/lib/component/header/Header.js +3 -4
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -1
- package/lib/component/hooks/useToolsFunctions.js +2 -2
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +0 -8
- package/lib/component/modal/MoleculeStructureEditorModal.js +31 -8
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/PredictSpectraModal.js +3 -2
- package/lib/component/modal/aboutUs/AboutUsModal.js +1 -5
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -0
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +4 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +1 -1
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +3 -1
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -14
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -2
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +12 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +1 -1
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +1 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +6 -2
- package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -1
- package/lib/component/reducer/actions/MoleculeActions.js +6 -2
- package/lib/component/reducer/actions/PeaksActions.js +4 -3
- package/lib/component/reducer/actions/utilities/deepReplaceDiaIDs.d.ts +3 -0
- package/lib/component/reducer/actions/utilities/deepReplaceDiaIDs.js +24 -0
- package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -1
- package/lib/component/toolbar/BasicToolBar.js +54 -35
- package/lib/component/toolbar/FunctionToolBar.js +102 -9
- package/lib/component/toolbar/ToolBar.js +1 -1
- package/lib/component/utility/getClosePeak.d.ts +10 -0
- package/lib/component/utility/getClosePeak.js +15 -0
- package/lib/component/utility/maxAbsoluteValue.d.ts +3 -0
- package/lib/component/utility/maxAbsoluteValue.js +21 -0
- package/lib/data/constants/Multiplets.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/index.js +0 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +6 -3
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +6 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +106 -19
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -0
- package/lib/data/data2d/Spectrum2D/contours.js +2 -2
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +2 -2
- package/lib/data/data2d/Spectrum2D/getSlice.js +3 -3
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/parseMeta/mapErrors.js +3 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +41 -40
- package/lib/component/elements/ToolbarMenu.d.ts +0 -18
- package/lib/component/elements/ToolbarMenu.js +0 -102
- package/lib/component/elements/toggle/ToggleButton.d.ts +0 -13
- package/lib/component/elements/toggle/ToggleButton.js +0 -24
- package/lib/component/elements/toggle/ToggleButtonGroup.d.ts +0 -8
- package/lib/component/elements/toggle/ToggleButtonGroup.js +0 -48
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +0 -17
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +0 -18
- package/lib/data/data2d/Processing2D.d.ts +0 -32
- package/lib/data/data2d/Processing2D.js +0 -130
|
@@ -18,6 +18,8 @@ import RangesIntegrals from './ranges/RangesIntegrals';
|
|
|
18
18
|
import BaseLineZones from './tool/BaseLineZones';
|
|
19
19
|
function Chart1D({ mode, width, height, margin, displayerKey }) {
|
|
20
20
|
const { current: { general: { spectraRendering }, }, } = usePreferences();
|
|
21
|
-
|
|
21
|
+
const innerWidth = width - margin.left - margin.right;
|
|
22
|
+
const innerHeight = height - margin.bottom;
|
|
23
|
+
return (_jsx(PeakEditionProvider, { children: _jsxs("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, id: "nmrSVG", shapeRendering: spectraRendering, children: [_jsx("defs", { children: _jsx("clipPath", { id: `${displayerKey}clip-chart-1d`, children: _jsx("rect", { width: innerWidth, height: innerHeight, x: margin.left, y: "0" }) }) }), _jsx(LinesSeries, {}), _jsx(ApodizationLine, {}), _jsx(IntegralsSeries, {}), _jsx(Peaks, { peaksSource: "peaks" }), _jsx(RangesIntegrals, {}), _jsx(Ranges, {}), _jsx(Peaks, { peaksSource: "ranges" }), _jsx(JGraph, {}), _jsx(MultiAnalysisRanges, {}), _jsx(BaseLineZones, {}), _jsx(ExclusionZonesAnnotations, {}), _jsx(DatabaseElements, {}), _jsx(PeaksShapes, {}), _jsx(SpectraTracker, {}), _jsx(SpectrumInfoBlock, {}), _jsx("g", { className: "container", style: { pointerEvents: 'none' }, children: _jsx(XAxis, { showGrid: true, mode: mode }) })] }) }));
|
|
22
24
|
}
|
|
23
25
|
export default Chart1D;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { xGetFromToIndex } from 'ml-spectra-processing';
|
|
3
2
|
import { useCallback, useEffect, useReducer, useRef, useState, } from 'react';
|
|
4
3
|
import { ResponsiveChart } from 'react-d3-utils';
|
|
5
4
|
import { useOnOff } from 'react-science/ui';
|
|
6
|
-
import { MAX_LENGTH } from '../../data/data1d/Spectrum1D/ranges/detectSignals';
|
|
7
5
|
import BrushXY, { BRUSH_TYPE } from '../1d-2d/tools/BrushXY';
|
|
8
6
|
import CrossLinePointer from '../1d-2d/tools/CrossLinePointer';
|
|
9
7
|
import { ViewerResponsiveWrapper } from '../2d/Viewer2D';
|
|
@@ -13,7 +11,6 @@ import { useChartData } from '../context/ChartContext';
|
|
|
13
11
|
import { useDispatch } from '../context/DispatchContext';
|
|
14
12
|
import { usePreferences } from '../context/PreferencesContext';
|
|
15
13
|
import { ScaleProvider } from '../context/ScaleContext';
|
|
16
|
-
import { useAlert } from '../elements/popup/Alert';
|
|
17
14
|
import { useActiveSpectrum } from '../hooks/useActiveSpectrum';
|
|
18
15
|
import { useVerticalAlign } from '../hooks/useVerticalAlign';
|
|
19
16
|
import Spinner from '../loader/Spinner';
|
|
@@ -37,7 +34,6 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
37
34
|
const activeSpectrum = useActiveSpectrum();
|
|
38
35
|
const dispatch = useDispatch();
|
|
39
36
|
const { dispatch: dispatchPreferences } = usePreferences();
|
|
40
|
-
const alert = useAlert();
|
|
41
37
|
const [scaleState, dispatchScale] = useReducer(scaleReducer, scaleInitialState);
|
|
42
38
|
useEffect(() => {
|
|
43
39
|
if (xDomain.length > 0 && yDomain.length > 0 && widthProp && heightProp) {
|
|
@@ -115,23 +111,12 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
115
111
|
});
|
|
116
112
|
break;
|
|
117
113
|
case options.rangePicking.id: {
|
|
118
|
-
const [from, to] = getRange(state, {
|
|
119
|
-
startX: brushData.startX,
|
|
120
|
-
endX: brushData.endX,
|
|
121
|
-
});
|
|
122
114
|
if (!activeSpectrum)
|
|
123
115
|
break;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
type: 'ADD_RANGE',
|
|
129
|
-
payload: brushData,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
alert.error(`Advanced peak picking only available for area up to ${MAX_LENGTH} points`);
|
|
134
|
-
}
|
|
116
|
+
dispatch({
|
|
117
|
+
type: 'ADD_RANGE',
|
|
118
|
+
payload: brushData,
|
|
119
|
+
});
|
|
135
120
|
break;
|
|
136
121
|
}
|
|
137
122
|
case options.multipleSpectraAnalysis.id:
|
|
@@ -203,7 +188,6 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
203
188
|
}, [
|
|
204
189
|
scaleState,
|
|
205
190
|
selectedTool,
|
|
206
|
-
data,
|
|
207
191
|
openAnalysisModal,
|
|
208
192
|
activeSpectrum,
|
|
209
193
|
dispatch,
|
|
@@ -211,7 +195,6 @@ function Viewer1D({ emptyText = undefined }) {
|
|
|
211
195
|
activeTab,
|
|
212
196
|
xDomain,
|
|
213
197
|
state,
|
|
214
|
-
alert,
|
|
215
198
|
]);
|
|
216
199
|
const handelOnDoubleClick = useCallback(() => {
|
|
217
200
|
dispatch({
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import max from 'ml-array-max';
|
|
3
|
-
import { get1DDataXY } from '../../../data/data1d/Spectrum1D/get1DDataXY';
|
|
4
2
|
import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
|
|
5
3
|
import { useMouseTracker } from '../../EventsTrackers/MouseTracker';
|
|
6
4
|
import { useChartData } from '../../context/ChartContext';
|
|
@@ -8,6 +6,7 @@ import { useScaleChecked } from '../../context/ScaleContext';
|
|
|
8
6
|
import { useActiveSpectrum } from '../../hooks/useActiveSpectrum';
|
|
9
7
|
import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus';
|
|
10
8
|
import { options } from '../../toolbar/ToolTypes';
|
|
9
|
+
import { getClosePeak } from '../../utility/getClosePeak';
|
|
11
10
|
const styles = {
|
|
12
11
|
radius: 10,
|
|
13
12
|
borderColor: '#1f1f1f',
|
|
@@ -16,18 +15,6 @@ const styles = {
|
|
|
16
15
|
SVGPadding: 1,
|
|
17
16
|
};
|
|
18
17
|
const LookWidth = 10;
|
|
19
|
-
function getClosePeak(spectrum, range) {
|
|
20
|
-
const datum = get1DDataXY(spectrum);
|
|
21
|
-
const maxIndex = datum.x.findIndex((number) => number >= range[1]) - 1;
|
|
22
|
-
const minIndex = datum.x.findIndex((number) => number >= range[0]);
|
|
23
|
-
const yDataRange = datum.y.slice(minIndex, maxIndex);
|
|
24
|
-
if (!yDataRange || yDataRange.length === 0)
|
|
25
|
-
return null;
|
|
26
|
-
const y = max(yDataRange);
|
|
27
|
-
const xIndex = minIndex + yDataRange.indexOf(y);
|
|
28
|
-
const x = datum.x[xIndex];
|
|
29
|
-
return { x, y };
|
|
30
|
-
}
|
|
31
18
|
function PeakPointer() {
|
|
32
19
|
const { height, width, margin, toolOptions: { selectedTool }, } = useChartData();
|
|
33
20
|
const { scaleX, scaleY, shiftY } = useScaleChecked();
|
|
@@ -48,13 +35,16 @@ function PeakPointer() {
|
|
|
48
35
|
const spectrumIndex = spectra.findIndex((d) => d.id === activeSpectrum.id);
|
|
49
36
|
if (spectrumIndex === -1)
|
|
50
37
|
return null;
|
|
51
|
-
const
|
|
38
|
+
const [from, to] = [
|
|
52
39
|
scaleX().invert(position.x - LookWidth),
|
|
53
40
|
scaleX().invert(position.x + LookWidth),
|
|
54
41
|
].sort((a, b) => {
|
|
55
42
|
return a - b;
|
|
56
43
|
});
|
|
57
|
-
const closePeak = getClosePeak(spectra[spectrumIndex],
|
|
44
|
+
const closePeak = getClosePeak(spectra[spectrumIndex], {
|
|
45
|
+
from,
|
|
46
|
+
to,
|
|
47
|
+
});
|
|
58
48
|
if (!closePeak)
|
|
59
49
|
return null;
|
|
60
50
|
const x = scaleX()(closePeak.x);
|
|
@@ -11,17 +11,22 @@ function getXScale(options, spectrumId = null) {
|
|
|
11
11
|
}
|
|
12
12
|
function getYScale(options, spectrumId = null) {
|
|
13
13
|
const { height, margin, verticalAlign, yDomain, yDomains } = options;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
let domainY = yDomain;
|
|
15
|
+
if (spectrumId && yDomains?.[spectrumId]) {
|
|
16
|
+
domainY = yDomains[spectrumId];
|
|
17
|
+
}
|
|
18
|
+
const [min, max] = domainY;
|
|
19
|
+
let bottomShift = 40;
|
|
20
|
+
if (verticalAlign === 'center') {
|
|
21
|
+
bottomShift = 0;
|
|
22
|
+
const maxim = Math.max(Math.abs(max), Math.abs(min));
|
|
23
|
+
domainY = [-maxim, maxim];
|
|
20
24
|
}
|
|
21
25
|
else {
|
|
22
|
-
domainY = [0,
|
|
26
|
+
domainY = [0, domainY[1]];
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
const innerHeight = height - margin.bottom - bottomShift;
|
|
29
|
+
return scaleLinear(domainY, [innerHeight, margin.top]);
|
|
25
30
|
}
|
|
26
31
|
function getIntegralYScale(options) {
|
|
27
32
|
const { height, margin, yDomain, scaleRatio } = options;
|
|
@@ -20,6 +20,20 @@ const styles = {
|
|
|
20
20
|
height: '2px',
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
|
+
function getInfoValue(spectrum, field) {
|
|
24
|
+
const { jpath, format } = field;
|
|
25
|
+
const value = lodashGet(spectrum, jpath, '');
|
|
26
|
+
switch (typeof value) {
|
|
27
|
+
case 'number':
|
|
28
|
+
return formatNumber(value, format);
|
|
29
|
+
case 'string':
|
|
30
|
+
return value;
|
|
31
|
+
case 'boolean':
|
|
32
|
+
return value ? 'Yes' : 'No';
|
|
33
|
+
default:
|
|
34
|
+
return JSON.stringify(value);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
23
37
|
function SpectrumInfoBlock() {
|
|
24
38
|
const { margin } = useChartData();
|
|
25
39
|
const spectrum = useSpectrum();
|
|
@@ -29,10 +43,7 @@ function SpectrumInfoBlock() {
|
|
|
29
43
|
return (_jsx("g", { className: "spectra-info-block", transform: `translate(${margin.left + 5} ${margin.top})`, children: fields
|
|
30
44
|
.filter((field) => field.visible)
|
|
31
45
|
.map((field, index) => {
|
|
32
|
-
|
|
33
|
-
return (_jsxs(SVGGroup, { transform: `translate(0,${20 * (index + 1)})`, space: 5, children: [_jsxs("text", { alignmentBaseline: "middle", style: styles.label, children: [field.label, " :"] }), _jsx("text", { alignmentBaseline: "middle", style: styles.value, children: field?.format && typeof value === 'number'
|
|
34
|
-
? formatNumber(value, field.format)
|
|
35
|
-
: value })] }, field.jpath + field.label));
|
|
46
|
+
return (_jsxs(SVGGroup, { transform: `translate(0,${20 * (index + 1)})`, space: 5, children: [_jsxs("text", { alignmentBaseline: "middle", style: styles.label, children: [field.label, " :"] }), _jsx("text", { alignmentBaseline: "middle", style: styles.value, children: getInfoValue(spectrum, field) })] }, field.jpath + field.label));
|
|
36
47
|
}) }));
|
|
37
48
|
}
|
|
38
49
|
export default SpectrumInfoBlock;
|
|
@@ -26,6 +26,6 @@ function Top1DChart({ verticalMargin = 10, data: spectrum }) {
|
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
const innerWidth = width - margin.left - margin.right;
|
|
29
|
-
return (_jsxs("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, children: [_jsx("defs", { children: _jsx("clipPath", { id: `${displayerKey}clip-top`, children: _jsx("rect", { width: innerWidth, height: height, x: margin.left, y:
|
|
29
|
+
return (_jsxs("svg", { viewBox: `0 0 ${width} ${height}`, width: width, height: height, children: [_jsx("defs", { children: _jsx("clipPath", { id: `${displayerKey}clip-top`, children: _jsx("rect", { width: innerWidth, height: height, x: margin.left, y: "0" }) }) }), _jsx("g", { clipPath: `url(#${displayerKey}clip-top)`, children: _jsx("path", { className: "line", stroke: spectrum.display.color, fill: "none", strokeWidth: "1px", d: path }) })] }));
|
|
30
30
|
}
|
|
31
31
|
export default memo(Top1DChart);
|
|
@@ -40,6 +40,6 @@ function Signal({ signal }) {
|
|
|
40
40
|
assignment?.hide();
|
|
41
41
|
highlight.hide();
|
|
42
42
|
}, cx: scaleX(signal.x.delta || 0), cy: scaleY(signal.y.delta || 0), r: isHighlighted ? 6 : 4, fill: isHighlighted ? 'green' : 'darkgreen' }, signal.id)] })), _jsx("g", { className: "zone-signal-peak", style: { pointerEvents: 'none' }, children: showPeaks &&
|
|
43
|
-
signal?.peaks?.map((peak, i) => (_jsx("circle", { cx: scaleX(peak.x), cy: scaleY(peak.y), r: 2, fill: "black" },
|
|
43
|
+
signal?.peaks?.map((peak, i) => (_jsx("circle", { cx: scaleX(peak.x), cy: scaleY(peak.y), r: 2, fill: "black" }, String(signal.id + i)))) })] }));
|
|
44
44
|
}
|
|
45
45
|
export default Signal;
|
|
@@ -61,6 +61,6 @@ function Zone({ zoneData }) {
|
|
|
61
61
|
}, onMouseLeave: () => {
|
|
62
62
|
assignmentZone.hide();
|
|
63
63
|
highlightZone.hide();
|
|
64
|
-
}, children: [showZones && (_jsx("g", { transform: `translate(${scaleX(x2)},${scaleY(y1)})`, children: _jsx("rect", { x: "0", width: scaleX(x1) - scaleX(x2), height: scaleY(y2) - scaleY(y1), className: "integral-area", fill: "#0000000f", stroke: reduceOpacity ? '#343a40' : 'darkgreen', strokeWidth: reduceOpacity ? '0' : '1' }) })), signals.map((_signal, i) => (_jsx(Signal, { signal: _signal },
|
|
64
|
+
}, children: [showZones && (_jsx("g", { transform: `translate(${scaleX(x2)},${scaleY(y1)})`, children: _jsx("rect", { x: "0", width: scaleX(x1) - scaleX(x2), height: scaleY(y2) - scaleY(y1), className: "integral-area", fill: "#0000000f", stroke: reduceOpacity ? '#343a40' : 'darkgreen', strokeWidth: reduceOpacity ? '0' : '1' }) })), signals.map((_signal, i) => (_jsx(Signal, { signal: _signal }, String(id + i))))] }, id));
|
|
65
65
|
}
|
|
66
66
|
export default Zone;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ContextMenuProps as BluePrintContextMenuProps, MenuItemProps } from '@blueprintjs/core';
|
|
2
|
+
import { ComponentProps, ElementType, ReactNode } from 'react';
|
|
3
|
+
export interface ContextMenuItem extends MenuItemProps {
|
|
4
|
+
data?: object;
|
|
5
|
+
}
|
|
6
|
+
type ElementProps<E = 'div'> = E extends ElementType ? ComponentProps<E> : never;
|
|
7
|
+
export interface BaseContextMenuProps {
|
|
8
|
+
options: ContextMenuItem[];
|
|
9
|
+
onSelect: (data?: object) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface ContextMenuProps<E> extends BaseContextMenuProps, Omit<BluePrintContextMenuProps, 'onSelect' | 'content' | 'children'> {
|
|
12
|
+
as?: E;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function ContextMenu<E extends ElementType = 'div'>(props: ContextMenuProps<E> & ElementProps<E>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Menu, MenuItem, showContextMenu, } from '@blueprintjs/core';
|
|
3
|
+
export function ContextMenu(props) {
|
|
4
|
+
const { options, onSelect, children, as: Wrapper = 'div', ...other } = props;
|
|
5
|
+
function handleContextMenu(event) {
|
|
6
|
+
if (!Array.isArray(options) || options.length === 0) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const content = (_jsx(Menu, { children: options.map((option) => (_jsx(MenuItem, { ...option, onClick: () => onSelect(option?.data) }, JSON.stringify(option)))) }));
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
showContextMenu({
|
|
12
|
+
content,
|
|
13
|
+
targetOffset: {
|
|
14
|
+
left: event.clientX,
|
|
15
|
+
top: event.clientY,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return (_jsx(Wrapper, { ...other, onContextMenu: handleContextMenu, children: children }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MenuItemProps, PopoverProps } from '@blueprintjs/core';
|
|
2
|
+
export interface DropdownMenuItem extends MenuItemProps {
|
|
3
|
+
data?: object;
|
|
4
|
+
}
|
|
5
|
+
export interface DropdownMenuProps extends Omit<PopoverProps, 'onSelect' | 'content'> {
|
|
6
|
+
options: DropdownMenuItem[];
|
|
7
|
+
onSelect: (data?: object) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function DropdownMenu(props: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Menu, MenuItem, Popover, } from '@blueprintjs/core';
|
|
3
|
+
export function DropdownMenu(props) {
|
|
4
|
+
const { options, onSelect, children, ...other } = props;
|
|
5
|
+
const content = (_jsx(Menu, { children: options.map((option) => (_jsx(MenuItem, { ...option, onClick: () => onSelect(option?.data) }, JSON.stringify(option)))) }));
|
|
6
|
+
return (_jsx(Popover, { ...other, content: content, children: children }));
|
|
7
|
+
}
|
|
@@ -7,5 +7,5 @@ interface HeaderProps {
|
|
|
7
7
|
containerStyle?: CSSProperties;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
export declare function Header(props: HeaderProps): import("
|
|
10
|
+
export declare function Header(props: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
2
|
const styles = {
|
|
5
|
-
header:
|
|
3
|
+
header: {
|
|
6
4
|
width: '100%',
|
|
7
5
|
display: 'flex',
|
|
8
6
|
flexDirection: 'row',
|
|
9
7
|
justifyContent: 'space-between',
|
|
10
|
-
borderBottom: '1px solid rgb(247, 247, 247)
|
|
8
|
+
borderBottom: '1px solid rgb(247, 247, 247)',
|
|
11
9
|
boxShadow: 'rgb(255, 255, 255) 0px 1px 0px 0px inset',
|
|
12
|
-
}
|
|
10
|
+
},
|
|
13
11
|
};
|
|
14
12
|
export function Header(props) {
|
|
15
13
|
const { children, style: { leftStyle = {}, rightStyle = {}, containerStyle = {} } = {}, } = props;
|
|
16
|
-
return (_jsxs("div", {
|
|
14
|
+
return (_jsxs("div", { style: { ...styles.header, ...containerStyle }, children: [_jsx("div", { style: leftStyle, children: children[0] }), _jsx("div", { style: rightStyle, children: children[1] })] }));
|
|
17
15
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { HighlightEventSource } from '../../../highlight/index';
|
|
3
|
-
import { BaseRowStyle,
|
|
3
|
+
import { BaseRowStyle, TableContextMenuProps } from '../ReactTable';
|
|
4
4
|
export interface ClickEvent {
|
|
5
5
|
onClick?: (event: Event, data: unknown) => void;
|
|
6
6
|
}
|
|
7
|
-
interface ReactTableRowProps extends ClickEvent,
|
|
7
|
+
interface ReactTableRowProps extends ClickEvent, TableContextMenuProps {
|
|
8
8
|
row: any;
|
|
9
9
|
highlightedSource?: HighlightEventSource;
|
|
10
10
|
isRowActive: boolean;
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useMemo, useEffect, useCallback } from 'react';
|
|
5
|
-
import { DropdownMenu } from 'react-science/ui';
|
|
6
5
|
import { HighlightEventSource, useHighlight } from '../../../highlight/index';
|
|
6
|
+
import { ContextMenu } from '../../ContextMenuBluePrint';
|
|
7
7
|
function getRowStyle(isActive, rowStyle = {}, disableDefaultRowStyle) {
|
|
8
8
|
const { hover = {}, active = {}, base = {}, activated = {} } = rowStyle;
|
|
9
9
|
const hoverStyle = disableDefaultRowStyle
|
|
@@ -51,7 +51,7 @@ function ReactTableRow(props) {
|
|
|
51
51
|
const clickHandler = useCallback((event) => {
|
|
52
52
|
onClick?.(event, row);
|
|
53
53
|
}, [onClick, row]);
|
|
54
|
-
return (_jsx(
|
|
54
|
+
return (_jsx(ContextMenu, { options: contextMenu, onSelect: (selected) => onContextMenuSelect?.(selected, row.original), as: "tr", style: { position: 'static' }, css: getRowStyle(highlight.isActive || isRowActive, rowStyle, disableDefaultRowStyle), ...row.getRowProps(), ...highlight.onHover, children: row.cells.map((cell) => {
|
|
55
55
|
const { style, padding } = cell.column;
|
|
56
56
|
if (cell.isRowSpanned) {
|
|
57
57
|
return null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { CSSObject, SerializedStyles } from '@emotion/react';
|
|
3
3
|
import { CSSProperties } from 'react';
|
|
4
|
-
import { DropdownMenuProps } from 'react-science/ui';
|
|
5
4
|
import { CellProps, Column as ReactColumn, UseSortByColumnOptions } from 'react-table';
|
|
6
5
|
import { HighlightEventSource } from '../../highlight';
|
|
6
|
+
import { BaseContextMenuProps } from '../ContextMenuBluePrint';
|
|
7
7
|
import { ClickEvent } from './Elements/ReactTableRow';
|
|
8
8
|
interface ExtraColumn<T extends object> {
|
|
9
9
|
enableRowSpan?: boolean;
|
|
@@ -20,11 +20,11 @@ export interface BaseRowStyle {
|
|
|
20
20
|
hover?: CSSProperties;
|
|
21
21
|
base?: CSSProperties;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
24
|
-
onContextMenuSelect?: (selected: Parameters<
|
|
25
|
-
contextMenu?:
|
|
23
|
+
export interface TableContextMenuProps {
|
|
24
|
+
onContextMenuSelect?: (selected: Parameters<BaseContextMenuProps['onSelect']>[0], data: any) => void;
|
|
25
|
+
contextMenu?: BaseContextMenuProps['options'];
|
|
26
26
|
}
|
|
27
|
-
interface ReactTableProps extends
|
|
27
|
+
interface ReactTableProps extends TableContextMenuProps, ClickEvent, SortEvent {
|
|
28
28
|
data: any;
|
|
29
29
|
columns: any;
|
|
30
30
|
highlightedSource?: HighlightEventSource;
|
|
@@ -87,7 +87,6 @@ function HeaderInner(props) {
|
|
|
87
87
|
return _jsx(Zones2DOptionPanel, {});
|
|
88
88
|
default:
|
|
89
89
|
return null;
|
|
90
|
-
break;
|
|
91
90
|
}
|
|
92
91
|
}, [selectedOptionPanel]);
|
|
93
92
|
const changeWorkspaceHandler = useCallback((option) => {
|
|
@@ -101,11 +100,11 @@ function HeaderInner(props) {
|
|
|
101
100
|
function renderItem(item) {
|
|
102
101
|
return _jsx(WorkspaceItem, { item: item });
|
|
103
102
|
}
|
|
104
|
-
return (_jsx("div", { css: styles, children: _jsxs(Header, { style: { leftStyle: { flex: 1 } }, children: [_jsxs(HeaderContainer, { style: {
|
|
103
|
+
return (_jsx("div", { css: styles, children: _jsxs(Header, { style: { leftStyle: { flex: 1 }, containerStyle: { padding: '2px' } }, children: [_jsxs(HeaderContainer, { style: {
|
|
105
104
|
alignItems: 'center',
|
|
106
|
-
}, children: [_jsx("div", { children: _jsx(Toolbar, {
|
|
105
|
+
}, children: [_jsx("div", { children: _jsx(Toolbar, { children: _jsx(AboutUsModal, {}) }) }), _jsx("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), _jsxs(HeaderContainer, { style: {
|
|
107
106
|
alignItems: 'center',
|
|
108
|
-
}, children: [!hideWorkspaces && (_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })), !hideGeneralSettings && _jsx(SaveButton, {}), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, {
|
|
107
|
+
}, children: [!hideWorkspaces && (_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })), !hideGeneralSettings && _jsx(SaveButton, {}), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { children: [!general?.hideHelp && (_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), icon: _jsx(FaQuestionCircle, {}) })), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreenEnabled && !general?.hideMaximize && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onEnableFullscreen, title: "Full Screen", className: "windowButton", icon: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
|
|
109
108
|
}
|
|
110
109
|
function SaveButton() {
|
|
111
110
|
const { workspace, workspaces, originalWorkspaces } = usePreferences();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NMRiumToolBarPreferences } from 'nmr-load-save';
|
|
2
2
|
import { Info1D, Info2D } from 'nmr-processing';
|
|
3
3
|
type SpectrumInfo = Info1D | Info2D;
|
|
4
|
-
interface CheckOptions {
|
|
4
|
+
export interface CheckOptions {
|
|
5
5
|
checkSpectrumType?: boolean;
|
|
6
6
|
checkMode?: boolean;
|
|
7
7
|
extraInfoCheckParameters?: SpectrumInfo;
|
|
@@ -34,7 +34,7 @@ export default function useToolsFunctions() {
|
|
|
34
34
|
if (debounceClickEventsRef.current.clicks.length === 0) {
|
|
35
35
|
dispatch({
|
|
36
36
|
type: 'FULL_ZOOM_OUT',
|
|
37
|
-
payload: { zoomType: '
|
|
37
|
+
payload: { zoomType: 'HORIZONTAL' },
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
const callback = lodashDebounce(() => {
|
|
@@ -47,7 +47,7 @@ export default function useToolsFunctions() {
|
|
|
47
47
|
debounceClickEventsRef.current.clicks = [];
|
|
48
48
|
dispatch({
|
|
49
49
|
type: 'FULL_ZOOM_OUT',
|
|
50
|
-
payload: {},
|
|
50
|
+
payload: { zoomType: 'FULL' },
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}, [dispatch, debounceClickEventsRef]);
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { StateMoleculeExtended } from '../../data/molecules/Molecule';
|
|
2
|
-
interface MoleculeStructureEditorModalProps {
|
|
3
|
-
onClose?: (element?: string) => void;
|
|
4
|
-
selectedMolecule?: StateMoleculeExtended;
|
|
5
|
-
floatMoleculeOnSave?: boolean;
|
|
6
|
-
isOpen?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare function MoleculeStructureEditorModal(props: MoleculeStructureEditorModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
2
|
export declare function useMoleculeEditor(floatMoleculeOnSave?: boolean): {
|
|
10
3
|
modal: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
4
|
openMoleculeEditor: (molecule?: StateMoleculeExtended) => void;
|
|
12
5
|
};
|
|
13
|
-
export default MoleculeStructureEditorModal;
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import {
|
|
3
|
+
import { Molecule } from 'openchemlib/full';
|
|
4
|
+
import { TopicMolecule } from 'openchemlib-utils';
|
|
5
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
4
6
|
import { StructureEditor } from 'react-ocl/full';
|
|
5
7
|
import { ConfirmModal, Modal, useOnOff } from 'react-science/ui';
|
|
6
8
|
import { useDispatch } from '../context/DispatchContext';
|
|
7
9
|
function MoleculeStructureEditorModal(props) {
|
|
8
10
|
const { onClose = () => null, selectedMolecule, floatMoleculeOnSave = false, isOpen = false, } = props;
|
|
11
|
+
const initialMolfile = selectedMolecule?.molfile;
|
|
12
|
+
const initialEnhancedMolfile = useMemo(() => {
|
|
13
|
+
if (!initialMolfile) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
// Add mapNo to molfile, so we can remap diaIDs after edition.
|
|
17
|
+
const molecule = Molecule.fromMolfile(initialMolfile);
|
|
18
|
+
const topicMolecule = new TopicMolecule(molecule);
|
|
19
|
+
topicMolecule.ensureMapNo();
|
|
20
|
+
const newMolfile = topicMolecule.toMolfile({ version: 3 });
|
|
21
|
+
return { molfile: newMolfile, topicMolecule };
|
|
22
|
+
}, [initialMolfile]);
|
|
9
23
|
const [molfile, setMolfile] = useState(null);
|
|
10
24
|
const dispatch = useDispatch();
|
|
11
25
|
useEffect(() => {
|
|
12
|
-
if (
|
|
13
|
-
setMolfile(
|
|
26
|
+
if (initialEnhancedMolfile) {
|
|
27
|
+
setMolfile(initialEnhancedMolfile.molfile);
|
|
14
28
|
}
|
|
15
29
|
else {
|
|
16
30
|
setMolfile(null);
|
|
17
31
|
}
|
|
18
|
-
}, [
|
|
32
|
+
}, [initialEnhancedMolfile]);
|
|
19
33
|
const cb = useCallback((newMolfile, molecule) => {
|
|
20
34
|
if (molecule.getAllAtoms() === 0) {
|
|
21
35
|
setMolfile(null);
|
|
@@ -29,14 +43,17 @@ function MoleculeStructureEditorModal(props) {
|
|
|
29
43
|
}, [onClose]);
|
|
30
44
|
const handleSave = useCallback(() => {
|
|
31
45
|
if (molfile) {
|
|
32
|
-
if (selectedMolecule) {
|
|
46
|
+
if (selectedMolecule && initialEnhancedMolfile) {
|
|
33
47
|
const { id, label } = selectedMolecule;
|
|
48
|
+
const editedMolecule = Molecule.fromMolfile(molfile);
|
|
49
|
+
const mappings = initialEnhancedMolfile.topicMolecule.getDiaIDsMapping(editedMolecule);
|
|
34
50
|
dispatch({
|
|
35
51
|
type: 'SET_MOLECULE',
|
|
36
52
|
payload: {
|
|
37
53
|
molfile,
|
|
38
54
|
id,
|
|
39
55
|
label,
|
|
56
|
+
mappings,
|
|
40
57
|
},
|
|
41
58
|
});
|
|
42
59
|
onClose('replace');
|
|
@@ -52,8 +69,15 @@ function MoleculeStructureEditorModal(props) {
|
|
|
52
69
|
onClose('new');
|
|
53
70
|
}
|
|
54
71
|
}
|
|
55
|
-
}, [
|
|
56
|
-
|
|
72
|
+
}, [
|
|
73
|
+
molfile,
|
|
74
|
+
selectedMolecule,
|
|
75
|
+
initialEnhancedMolfile,
|
|
76
|
+
dispatch,
|
|
77
|
+
floatMoleculeOnSave,
|
|
78
|
+
onClose,
|
|
79
|
+
]);
|
|
80
|
+
return (_jsx(ConfirmModal, { headerColor: "transparent", isOpen: isOpen, onRequestClose: handleClose, onCancel: handleClose, onConfirm: handleSave, maxWidth: 700, children: _jsx(Modal.Body, { children: _jsx(StructureEditor, { initialMolfile: initialEnhancedMolfile?.molfile, svgMenu: true, fragment: false, onChange: cb }) }) }));
|
|
57
81
|
}
|
|
58
82
|
export function useMoleculeEditor(floatMoleculeOnSave = false) {
|
|
59
83
|
const [isOpen, openModal, closeModal] = useOnOff(false);
|
|
@@ -65,4 +89,3 @@ export function useMoleculeEditor(floatMoleculeOnSave = false) {
|
|
|
65
89
|
}, [openModal]);
|
|
66
90
|
return { modal, openMoleculeEditor };
|
|
67
91
|
}
|
|
68
|
-
export default MoleculeStructureEditorModal;
|
|
@@ -114,7 +114,7 @@ function InnerMultipleAnalysis(props) {
|
|
|
114
114
|
maxTestedJ: 17,
|
|
115
115
|
takeBestPartMultiplet: true,
|
|
116
116
|
correctVerticalOffset: true,
|
|
117
|
-
symmetrizeEachStep:
|
|
117
|
+
symmetrizeEachStep: true,
|
|
118
118
|
decreasingJvalues: true,
|
|
119
119
|
makeShortCutForSpeed: true,
|
|
120
120
|
debug: true,
|
|
@@ -1,9 +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
4
|
import { css } from '@emotion/react';
|
|
4
5
|
import { SvgNmrFt } from 'cheminfo-font';
|
|
5
6
|
import { useCallback, useRef, useState, useMemo } from 'react';
|
|
6
|
-
import {
|
|
7
|
+
import { Modal, useOnOff } from 'react-science/ui';
|
|
7
8
|
import { getDefaultPredictionOptions, predictSpectra, } from '../../data/PredictionManager';
|
|
8
9
|
import { useChartData } from '../context/ChartContext';
|
|
9
10
|
import { useDispatch } from '../context/DispatchContext';
|
|
@@ -106,6 +107,6 @@ export function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
106
107
|
return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { color: { base: '#4e4e4e', hover: '#4e4e4e' }, onClick: openDialog, toolTip: "Predict spectra", tooltipOrientation: "horizontal", children: _jsx(SvgNmrFt, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
|
|
107
108
|
onClose();
|
|
108
109
|
closeDialog();
|
|
109
|
-
}, width: 600, maxWidth: 1000, children: _jsxs("div", { css: [ModalStyles, styles], children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header handle", children: _jsx("span", { children: "Prediction of NMR spectrum" }) }) }), _jsxs("div", { className: "inner-content", 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: setApproved, checked: isApproved, label: "I confirm that the chemical structure is not confidential." }
|
|
110
|
+
}, width: 600, maxWidth: 1000, children: _jsxs("div", { css: [ModalStyles, styles], children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header handle", children: _jsx("span", { children: "Prediction of NMR spectrum" }) }) }), _jsxs("div", { className: "inner-content", 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("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }) })] }));
|
|
110
111
|
}
|
|
111
112
|
export default PredictSpectraModal;
|
|
@@ -89,11 +89,7 @@ const styles = css `
|
|
|
89
89
|
`;
|
|
90
90
|
function AboutUsModal() {
|
|
91
91
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
92
|
-
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog,
|
|
93
|
-
display: 'flex',
|
|
94
|
-
alignItems: 'center',
|
|
95
|
-
justifyContent: 'center',
|
|
96
|
-
}, children: _jsx(SvgLogoNmrium, {}) }) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About NMRium" }) }) }), _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)." })] }) })] })] }) })] }));
|
|
92
|
+
return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo", title: "About NMRium", icon: _jsx(SvgLogoNmrium, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About NMRium" }) }) }), _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)." })] }) })] })] }) })] }));
|
|
97
93
|
}
|
|
98
94
|
export default AboutUsModal;
|
|
99
95
|
function VersionInfo() {
|
|
@@ -51,6 +51,7 @@ function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
|
|
|
51
51
|
return Yup.object().shape({
|
|
52
52
|
newSignalDelta: Yup.number()
|
|
53
53
|
.test(`test-range`, '', function testNewSignalDelta(value) {
|
|
54
|
+
// eslint-disable-next-line no-invalid-this
|
|
54
55
|
const { path, createError } = this;
|
|
55
56
|
if (value && value > range.from && value < range.to) {
|
|
56
57
|
return true;
|
|
@@ -7,8 +7,11 @@ const editRangeFormValidation = Yup.object().shape({
|
|
|
7
7
|
.of(Yup.object().shape({
|
|
8
8
|
multiplicity: Yup.string().required(),
|
|
9
9
|
coupling: Yup.mixed().test('checkValue', '', function testCoupling(value) {
|
|
10
|
+
// eslint-disable-next-line no-invalid-this
|
|
10
11
|
const { path, createError } = this;
|
|
11
|
-
const hasCoupling = hasCouplingConstant(
|
|
12
|
+
const hasCoupling = hasCouplingConstant(
|
|
13
|
+
// eslint-disable-next-line no-invalid-this
|
|
14
|
+
this.parent.multiplicity);
|
|
12
15
|
if ((!hasCoupling && !value) || (hasCoupling && value)) {
|
|
13
16
|
return true;
|
|
14
17
|
}
|