nmrium 0.45.1-pre.1701344673 → 0.46.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/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/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 +4 -6
- 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/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/InfoBlockTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +3 -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/ZonesPanel/ZonesTableRow.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
- 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 +53 -34
- 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/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.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- 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 +39 -38
- 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
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { SvgNmrApodization, SvgNmrBaselineCorrection, SvgNmrFourierTransform, SvgNmrIntegrate, SvgNmrMultipleAnalysis, SvgNmrPeakPicking, SvgNmrPhaseCorrection, SvgNmrRangePicking, SvgNmrZeroFilling, } from 'cheminfo-font';
|
|
3
3
|
import { useState, useEffect, useCallback, memo } from 'react';
|
|
4
4
|
import { FaSearchPlus, FaExpand, FaDiceFour } from 'react-icons/fa';
|
|
5
5
|
import { Toolbar } from 'react-science/ui';
|
|
6
6
|
import { useChartData } from '../context/ChartContext';
|
|
7
7
|
import { useDispatch } from '../context/DispatchContext';
|
|
8
|
-
import
|
|
9
|
-
import ToggleButtonGroup from '../elements/toggle/ToggleButtonGroup';
|
|
10
|
-
import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
|
|
8
|
+
import { useCheckToolsVisibility, } from '../hooks/useCheckToolsVisibility';
|
|
11
9
|
import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
|
|
12
10
|
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
13
11
|
import { options } from './ToolTypes';
|
|
@@ -38,11 +36,106 @@ function FunctionToolBarInner({ defaultValue, ftCounter, }) {
|
|
|
38
36
|
type: 'APPLY_FFT_DIMENSION_2_FILTER',
|
|
39
37
|
});
|
|
40
38
|
}, [dispatch]);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
const toolItems = [
|
|
40
|
+
{
|
|
41
|
+
id: 'zoom',
|
|
42
|
+
label: options.zoom.label,
|
|
43
|
+
icon: _jsx(FaSearchPlus, {}),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'zoomOut',
|
|
47
|
+
label: 'Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )',
|
|
48
|
+
onClick: handleFullZoomOut,
|
|
49
|
+
icon: _jsx(FaExpand, {}),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'peakPicking',
|
|
53
|
+
label: `${options.peakPicking.label} ( Press p )`,
|
|
54
|
+
icon: _jsx(SvgNmrPeakPicking, {}),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'integral',
|
|
58
|
+
label: `${options.integral.label} ( Press i )`,
|
|
59
|
+
icon: _jsx(SvgNmrIntegrate, {}),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'zonePicking',
|
|
63
|
+
label: `${options.zonePicking.label} ( Press r )`,
|
|
64
|
+
icon: _jsx(FaDiceFour, {}),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'slicing',
|
|
68
|
+
label: options.slicing.label,
|
|
69
|
+
icon: _jsx("p", { children: "Slic" }),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'rangePicking',
|
|
73
|
+
label: `${options.rangePicking.label} ( Press r )`,
|
|
74
|
+
icon: _jsx(SvgNmrRangePicking, {}),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'multipleSpectraAnalysis',
|
|
78
|
+
label: options.multipleSpectraAnalysis.label,
|
|
79
|
+
icon: _jsx(SvgNmrMultipleAnalysis, {}),
|
|
80
|
+
checkOptions: { checkSpectrumType: false },
|
|
81
|
+
condition: ftCounter > 1,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'apodization',
|
|
85
|
+
label: `${options.apodization.label} (Press a)`,
|
|
86
|
+
icon: _jsx(SvgNmrApodization, {}),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'zeroFilling',
|
|
90
|
+
label: `${options.zeroFilling.label} ( Press z )`,
|
|
91
|
+
icon: _jsx(SvgNmrZeroFilling, {}),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'phaseCorrection',
|
|
95
|
+
label: `${options.phaseCorrection.label} ( Press a )`,
|
|
96
|
+
icon: _jsx(SvgNmrPhaseCorrection, {}),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'phaseCorrectionTwoDimensions',
|
|
100
|
+
label: `${options.phaseCorrectionTwoDimensions.label} ( Press a )`,
|
|
101
|
+
icon: _jsx(SvgNmrPhaseCorrection, {}),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'baselineCorrection',
|
|
105
|
+
label: `${options.baselineCorrection.label} ( Press b )`,
|
|
106
|
+
icon: _jsx(SvgNmrBaselineCorrection, {}),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: 'exclusionZones',
|
|
110
|
+
label: `${options.exclusionZones.label} ( Press e )`,
|
|
111
|
+
icon: _jsx(SvgNmrMultipleAnalysis, {}),
|
|
112
|
+
checkOptions: { checkSpectrumType: false },
|
|
113
|
+
condition: ftCounter > 0,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'fft',
|
|
117
|
+
label: `${options.fft.label} ( Press t )`,
|
|
118
|
+
onClick: handleOnFFTFilter,
|
|
119
|
+
icon: _jsx(SvgNmrFourierTransform, {}),
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 'fftDimension1',
|
|
123
|
+
label: options.fftDimension1.label,
|
|
124
|
+
onClick: handleFFtDimension1Filter,
|
|
125
|
+
icon: _jsx(SvgNmrFourierTransform, {}),
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'fftDimension2',
|
|
129
|
+
label: options.fftDimension2.label,
|
|
130
|
+
onClick: handleFFtDimension2Filter,
|
|
131
|
+
icon: _jsx(SvgNmrFourierTransform, {}),
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
return (_jsx(_Fragment, { children: toolItems.map((item) => {
|
|
135
|
+
const { id, icon, label, checkOptions, onClick, condition } = item;
|
|
136
|
+
return (isButtonVisible(id, checkOptions) &&
|
|
137
|
+
(condition === undefined || condition) && (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), title: label, id: id, active: option === id, icon: icon }, id)));
|
|
138
|
+
}) }));
|
|
46
139
|
}
|
|
47
140
|
const MemoizedFunctionToolBar = memo(FunctionToolBarInner);
|
|
48
141
|
export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
|
|
@@ -5,7 +5,7 @@ import { useChartData } from '../context/ChartContext';
|
|
|
5
5
|
import BasicToolBar from './BasicToolBar';
|
|
6
6
|
import FunctionToolBar from './FunctionToolBar';
|
|
7
7
|
function ToolBarInner({ selectedTool }) {
|
|
8
|
-
return (_jsxs(Toolbar, {
|
|
8
|
+
return (_jsxs(Toolbar, { vertical: true, children: [_jsx(FunctionToolBar, { defaultValue: selectedTool }), _jsx(BasicToolBar, {})] }));
|
|
9
9
|
}
|
|
10
10
|
const MemoizedToolBar = memo(ToolBarInner);
|
|
11
11
|
export default function ToolBar() {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { get1DDataXY } from '../../data/data1d/Spectrum1D';
|
|
2
|
+
import { maxAbsoluteValue } from './maxAbsoluteValue';
|
|
3
|
+
export function getClosePeak(spectrum, lookRange) {
|
|
4
|
+
const { from, to } = lookRange;
|
|
5
|
+
const datum = get1DDataXY(spectrum);
|
|
6
|
+
const maxIndex = datum.x.findIndex((number) => number >= to) - 1;
|
|
7
|
+
const minIndex = datum.x.findIndex((number) => number >= from);
|
|
8
|
+
const yDataRange = datum.y.slice(minIndex, maxIndex);
|
|
9
|
+
if (!yDataRange || yDataRange.length === 0)
|
|
10
|
+
return null;
|
|
11
|
+
const y = maxAbsoluteValue(yDataRange);
|
|
12
|
+
const xIndex = minIndex + yDataRange.indexOf(y);
|
|
13
|
+
const x = datum.x[xIndex];
|
|
14
|
+
return { x, y };
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { xCheck, xGetFromToIndex, } from 'ml-spectra-processing';
|
|
2
|
+
//This function is an adapted version of the xMaxAbsoluteValue function from ml-spectra-processing. It identifies the maximum absolute value and returns the corresponding maximum value along with its sign
|
|
3
|
+
export function maxAbsoluteValue(array, options = {}) {
|
|
4
|
+
xCheck(array);
|
|
5
|
+
const { fromIndex, toIndex } = xGetFromToIndex(array, options);
|
|
6
|
+
let maxValue = array[fromIndex];
|
|
7
|
+
let sign = 1;
|
|
8
|
+
for (let i = fromIndex + 1; i <= toIndex; i++) {
|
|
9
|
+
if (array[i] >= 0) {
|
|
10
|
+
if (array[i] > maxValue) {
|
|
11
|
+
maxValue = array[i];
|
|
12
|
+
sign = 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
else if (-array[i] > maxValue) {
|
|
16
|
+
maxValue = -array[i];
|
|
17
|
+
sign = Math.sign(array[i]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return maxValue * sign;
|
|
21
|
+
}
|
|
@@ -5,7 +5,6 @@ export { initiateDatum1D } from './initiateDatum1D';
|
|
|
5
5
|
export { changeIntegralsRelative } from './integrals/changeIntegralsRelative';
|
|
6
6
|
export { isSpectrum1D } from './isSpectrum1D';
|
|
7
7
|
export { autoPeakPicking } from './peaks/autoPeakPicking';
|
|
8
|
-
export { lookupPeak } from './peaks/lookupPeak';
|
|
9
8
|
export { optimizePeaks } from './peaks/optimizePeaks';
|
|
10
9
|
export { addRange } from './ranges/addRange';
|
|
11
10
|
export { changeRange } from './ranges/changeRange';
|
|
@@ -5,7 +5,6 @@ export { initiateDatum1D } from './initiateDatum1D';
|
|
|
5
5
|
export { changeIntegralsRelative } from './integrals/changeIntegralsRelative';
|
|
6
6
|
export { isSpectrum1D } from './isSpectrum1D';
|
|
7
7
|
export { autoPeakPicking } from './peaks/autoPeakPicking';
|
|
8
|
-
export { lookupPeak } from './peaks/lookupPeak';
|
|
9
8
|
export { optimizePeaks } from './peaks/optimizePeaks';
|
|
10
9
|
export { addRange } from './ranges/addRange';
|
|
11
10
|
export { changeRange } from './ranges/changeRange';
|
|
@@ -19,9 +19,9 @@ export function initiateDatum1D(spectrum, options = {}) {
|
|
|
19
19
|
...get1DColor(spectrum, usedColors),
|
|
20
20
|
};
|
|
21
21
|
spectrumObj.info = {
|
|
22
|
-
nucleus: '1H',
|
|
22
|
+
nucleus: '1H', // 1H, 13C, 19F, ...
|
|
23
23
|
isFid: false,
|
|
24
|
-
isComplex: false,
|
|
24
|
+
isComplex: false, // if isComplex is true that mean it contains real/ imaginary x set, if not hid re/im button .
|
|
25
25
|
dimension: 1,
|
|
26
26
|
...spectrum.info,
|
|
27
27
|
};
|
|
@@ -15,7 +15,7 @@ export function autoPeakPicking(spectrum, options) {
|
|
|
15
15
|
direction,
|
|
16
16
|
shape: { kind: 'lorentzian' },
|
|
17
17
|
noiseLevel: noise * noiseFactor,
|
|
18
|
-
minMaxRatio,
|
|
18
|
+
minMaxRatio, // Threshold to determine if a given peak should be considered as a noise
|
|
19
19
|
realTopDetection: true,
|
|
20
20
|
smoothY: false,
|
|
21
21
|
});
|
|
@@ -75,7 +75,7 @@ function getRange(min, max, length, exp) {
|
|
|
75
75
|
const factors = [];
|
|
76
76
|
factors[0] = 0;
|
|
77
77
|
for (let i = 1; i <= length; i++) {
|
|
78
|
-
factors[i] = factors[i - 1] + (exp - 1) /
|
|
78
|
+
factors[i] = factors[i - 1] + (exp - 1) / exp ** i;
|
|
79
79
|
}
|
|
80
80
|
const lastFactor = factors[length];
|
|
81
81
|
const result = new Array(length);
|
|
@@ -119,7 +119,7 @@ function getContours(zoomLevel, options) {
|
|
|
119
119
|
const sanResult = calculateSanPlot('2D', data);
|
|
120
120
|
const median = sanResult.positive;
|
|
121
121
|
const max = Math.max(Math.abs(data.maxZ), Math.abs(data.minZ));
|
|
122
|
-
let _range = getRange(median * 1 *
|
|
122
|
+
let _range = getRange(median * 1 * 2 ** zoomLevel, max, nbLevels, 2);
|
|
123
123
|
if (negative) {
|
|
124
124
|
_range = _range.map((value) => -value);
|
|
125
125
|
}
|
|
@@ -33,9 +33,9 @@ export function getMissingProjection(datum, nucleus, datumInfo, usedColors) {
|
|
|
33
33
|
if (index === -1)
|
|
34
34
|
index = 0;
|
|
35
35
|
const info = {
|
|
36
|
-
nucleus: datumInfo.nucleus[index],
|
|
36
|
+
nucleus: datumInfo.nucleus[index], // 1H, 13C, 19F, ...
|
|
37
37
|
isFid: false,
|
|
38
|
-
isComplex: false,
|
|
38
|
+
isComplex: false, // if isComplex is true that mean it contains real/ imaginary x set, if not hid re/im button .
|
|
39
39
|
dimension: 1,
|
|
40
40
|
};
|
|
41
41
|
const data = getProjection(datum, index);
|
|
@@ -2,7 +2,7 @@ import { zoneToX } from 'ml-spectra-processing';
|
|
|
2
2
|
import { initiateDatum1D } from '../../data1d/Spectrum1D';
|
|
3
3
|
const BASE_INFO = {
|
|
4
4
|
isFid: false,
|
|
5
|
-
isComplex: false,
|
|
5
|
+
isComplex: false, // if isComplex is true that mean it contains real/ imaginary x set, if not hid re/im button .
|
|
6
6
|
dimension: 1,
|
|
7
7
|
};
|
|
8
8
|
export function getSlice(spectrum, position, options = {}) {
|
|
@@ -21,11 +21,11 @@ export function getSlice(spectrum, position, options = {}) {
|
|
|
21
21
|
if (yIndex < 0 || yIndex >= real.z.length)
|
|
22
22
|
return;
|
|
23
23
|
const infoX = {
|
|
24
|
-
nucleus: info.nucleus[0],
|
|
24
|
+
nucleus: info.nucleus[0], // 1H, 13C, 19F, ...
|
|
25
25
|
...BASE_INFO,
|
|
26
26
|
};
|
|
27
27
|
const infoY = {
|
|
28
|
-
nucleus: info.nucleus[1],
|
|
28
|
+
nucleus: info.nucleus[1], // 1H, 13C, 19F, ...
|
|
29
29
|
...BASE_INFO,
|
|
30
30
|
};
|
|
31
31
|
const dataX = initiateData(real.minX, real.maxX, xLength);
|
|
@@ -21,7 +21,7 @@ export function initiateDatum2D(spectrum, usedColors = {}) {
|
|
|
21
21
|
nucleus: ['1H', '1H'],
|
|
22
22
|
isFt: true,
|
|
23
23
|
isFid: false,
|
|
24
|
-
isComplex: false,
|
|
24
|
+
isComplex: false, // if isComplex is true that mean it contains real/ imaginary x set, if not hid re/im button .
|
|
25
25
|
dimension: 2,
|
|
26
26
|
...spectrum.info,
|
|
27
27
|
};
|
package/lib/versionInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v0.
|
|
1
|
+
export default { version: 'v0.46.0' };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nmrium",
|
|
3
3
|
"description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.46.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "lib/component/main/index.js",
|
|
7
7
|
"types": "lib/component/main/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"url": "git+https://github.com/cheminfo/nmrium.git"
|
|
46
46
|
},
|
|
47
47
|
"volta": {
|
|
48
|
-
"node": "20.
|
|
48
|
+
"node": "20.10.0"
|
|
49
49
|
},
|
|
50
50
|
"overrides": {
|
|
51
51
|
"react": "$react",
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"react-dom": ">=18.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@blueprintjs/core": "^5.
|
|
59
|
+
"@blueprintjs/core": "^5.7.2",
|
|
60
|
+
"@blueprintjs/icons": "^5.5.0",
|
|
60
61
|
"@emotion/react": "^11.11.1",
|
|
61
62
|
"@emotion/styled": "^11.11.0",
|
|
62
63
|
"@lukeed/uuid": "^2.0.1",
|
|
@@ -80,71 +81,71 @@
|
|
|
80
81
|
"ml-baseline-correction-regression": "^1.0.2",
|
|
81
82
|
"ml-conrec": "^5.0.2",
|
|
82
83
|
"ml-gsd": "^12.1.3",
|
|
83
|
-
"ml-matrix": "^6.
|
|
84
|
-
"ml-spectra-processing": "^12.
|
|
84
|
+
"ml-matrix": "^6.11.0",
|
|
85
|
+
"ml-spectra-processing": "^12.8.0",
|
|
85
86
|
"ml-stat": "^1.3.3",
|
|
86
87
|
"multiplet-analysis": "^2.1.2",
|
|
87
88
|
"nmr-correlation": "^2.3.3",
|
|
88
|
-
"nmr-load-save": "^0.23.
|
|
89
|
-
"nmr-processing": "^11.6.
|
|
90
|
-
"nmredata": "^0.9.
|
|
89
|
+
"nmr-load-save": "^0.23.11",
|
|
90
|
+
"nmr-processing": "^11.6.1",
|
|
91
|
+
"nmredata": "^0.9.9",
|
|
91
92
|
"numeral": "^2.0.6",
|
|
92
|
-
"openchemlib": "^8.7.
|
|
93
|
-
"openchemlib-utils": "^5.
|
|
93
|
+
"openchemlib": "^8.7.2",
|
|
94
|
+
"openchemlib-utils": "^5.6.1",
|
|
94
95
|
"papaparse": "^5.4.1",
|
|
95
96
|
"re-resizable": "6.9.11",
|
|
96
97
|
"react-d3-utils": "^1.0.0",
|
|
97
98
|
"react-dropzone": "^14.2.3",
|
|
98
99
|
"react-error-boundary": "^4.0.11",
|
|
99
|
-
"react-icons": "^4.
|
|
100
|
+
"react-icons": "^4.12.0",
|
|
100
101
|
"react-inspector": "^6.0.2",
|
|
101
102
|
"react-mf": "^2.0.2",
|
|
102
103
|
"react-ocl": "^6.1.0",
|
|
103
104
|
"react-ocl-nmr": "^3.0.1",
|
|
104
105
|
"react-plot": "^1.4.2",
|
|
105
106
|
"react-rnd": "^10.4.1",
|
|
106
|
-
"react-science": "^0.
|
|
107
|
+
"react-science": "^0.32.1",
|
|
107
108
|
"react-slider": "^2.0.6",
|
|
108
109
|
"react-table": "^7.8.0",
|
|
109
110
|
"react-transition-group": "^4.4.5",
|
|
110
|
-
"react-use": "^17.4.
|
|
111
|
+
"react-use": "^17.4.2",
|
|
111
112
|
"smart-array-filter": "^4.0.2",
|
|
112
113
|
"yup": "^1.3.2"
|
|
113
114
|
},
|
|
114
115
|
"devDependencies": {
|
|
115
|
-
"@babel/plugin-transform-modules-commonjs": "^7.23.
|
|
116
|
-
"@babel/preset-react": "^7.
|
|
117
|
-
"@babel/preset-typescript": "^7.23.
|
|
118
|
-
"@playwright/test": "^1.
|
|
116
|
+
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
|
|
117
|
+
"@babel/preset-react": "^7.23.3",
|
|
118
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
119
|
+
"@playwright/test": "^1.40.1",
|
|
119
120
|
"@simbathesailor/use-what-changed": "^2.0.0",
|
|
120
|
-
"@types/d3": "^7.4.
|
|
121
|
-
"@types/lodash": "^4.14.
|
|
122
|
-
"@types/node": "^20.
|
|
123
|
-
"@types/papaparse": "^5.3.
|
|
124
|
-
"@types/react": "^18.2.
|
|
125
|
-
"@types/react-dom": "^18.2.
|
|
126
|
-
"@types/react-table": "^7.7.
|
|
127
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
128
|
-
"@vitest/coverage-v8": "^0.
|
|
121
|
+
"@types/d3": "^7.4.3",
|
|
122
|
+
"@types/lodash": "^4.14.202",
|
|
123
|
+
"@types/node": "^20.10.4",
|
|
124
|
+
"@types/papaparse": "^5.3.14",
|
|
125
|
+
"@types/react": "^18.2.45",
|
|
126
|
+
"@types/react-dom": "^18.2.17",
|
|
127
|
+
"@types/react-table": "^7.7.18",
|
|
128
|
+
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
129
|
+
"@vitest/coverage-v8": "^1.0.4",
|
|
129
130
|
"cross-env": "^7.0.3",
|
|
130
|
-
"cspell": "^
|
|
131
|
-
"eslint": "^8.
|
|
132
|
-
"eslint-config-cheminfo-react": "^10.
|
|
133
|
-
"eslint-config-cheminfo-typescript": "^12.0
|
|
131
|
+
"cspell": "^8.1.3",
|
|
132
|
+
"eslint": "^8.55.0",
|
|
133
|
+
"eslint-config-cheminfo-react": "^10.1.0",
|
|
134
|
+
"eslint-config-cheminfo-typescript": "^12.1.0",
|
|
134
135
|
"modern-normalize": "^2.0.0",
|
|
135
136
|
"postcss-styled-syntax": "^0.5.0",
|
|
136
|
-
"prettier": "^3.
|
|
137
|
-
"rc-menu": "^9.12.
|
|
137
|
+
"prettier": "^3.1.1",
|
|
138
|
+
"rc-menu": "^9.12.4",
|
|
138
139
|
"react": "^18.2.0",
|
|
139
140
|
"react-dom": "^18.2.0",
|
|
140
|
-
"react-router-dom": "^6.
|
|
141
|
+
"react-router-dom": "^6.21.0",
|
|
141
142
|
"rimraf": "^5.0.5",
|
|
142
143
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
143
144
|
"serve": "^14.2.1",
|
|
144
|
-
"stylelint": "^
|
|
145
|
-
"stylelint-config-standard": "^
|
|
146
|
-
"typescript": "^5.
|
|
147
|
-
"vite": "^
|
|
148
|
-
"vitest": "^0.
|
|
145
|
+
"stylelint": "^16.0.2",
|
|
146
|
+
"stylelint-config-standard": "^35.0.0",
|
|
147
|
+
"typescript": "^5.3.3",
|
|
148
|
+
"vite": "^5.0.8",
|
|
149
|
+
"vitest": "^1.0.4"
|
|
149
150
|
}
|
|
150
151
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
interface MenuItemProps {
|
|
3
|
-
icon: ReactNode;
|
|
4
|
-
label: string;
|
|
5
|
-
onClick?: () => void;
|
|
6
|
-
}
|
|
7
|
-
interface MenuButtonProps {
|
|
8
|
-
component: ReactNode;
|
|
9
|
-
toolTip: string;
|
|
10
|
-
items?: Array<MenuItemProps & {
|
|
11
|
-
id: string;
|
|
12
|
-
}>;
|
|
13
|
-
onClick?: (element: MenuItemProps & {
|
|
14
|
-
id: string;
|
|
15
|
-
}) => void;
|
|
16
|
-
}
|
|
17
|
-
export default function ToolbarMenu({ component, toolTip, items, onClick, }: MenuButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { useState, useCallback, useRef, useLayoutEffect, } from 'react';
|
|
5
|
-
import { Toolbar } from 'react-science/ui';
|
|
6
|
-
const menuStyles = css `
|
|
7
|
-
.menu {
|
|
8
|
-
box-shadow: 0 0 10px rgb(0 0 0 / 50%);
|
|
9
|
-
margin: 0;
|
|
10
|
-
border-radius: 5px;
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
position: absolute;
|
|
14
|
-
z-index: 99999;
|
|
15
|
-
padding: 2px;
|
|
16
|
-
background-color: white;
|
|
17
|
-
|
|
18
|
-
button:hover {
|
|
19
|
-
background-color: #fafafa;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.menu-cover {
|
|
24
|
-
position: fixed;
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
top: 0;
|
|
28
|
-
left: 0;
|
|
29
|
-
z-index: 1;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.menu-item {
|
|
33
|
-
background-color: transparent;
|
|
34
|
-
border: none;
|
|
35
|
-
border-bottom: 0.55px solid whitesmoke;
|
|
36
|
-
height: 35px;
|
|
37
|
-
outline: outline;
|
|
38
|
-
display: table-cell;
|
|
39
|
-
vertical-align: middle;
|
|
40
|
-
text-align: left;
|
|
41
|
-
padding: 0 10px;
|
|
42
|
-
|
|
43
|
-
svg {
|
|
44
|
-
display: inline-block;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:focus {
|
|
48
|
-
outline: none !important;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
span {
|
|
52
|
-
font-size: 10px;
|
|
53
|
-
padding: 0 10px;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
function MenuItem({ icon, label, onClick }) {
|
|
58
|
-
return (_jsxs("button", { type: "button", className: "menu-item", onClick: onClick, children: [icon, _jsx("span", { children: label })] }));
|
|
59
|
-
}
|
|
60
|
-
function MenuList({ items, boxBounding = { x: 0, y: 0, width: 0, height: 0 }, onClick, }) {
|
|
61
|
-
const listRef = useRef();
|
|
62
|
-
const [translate, setTranslate] = useState({
|
|
63
|
-
x: boxBounding.width,
|
|
64
|
-
y: boxBounding.height,
|
|
65
|
-
});
|
|
66
|
-
useLayoutEffect(() => {
|
|
67
|
-
const boxSize = listRef.current.getBoundingClientRect();
|
|
68
|
-
setTranslate((oldTransform) => {
|
|
69
|
-
let y = boxBounding.height;
|
|
70
|
-
if (boxSize.bottom > window.innerHeight) {
|
|
71
|
-
y = boxBounding.height * 2 + (boxSize.bottom - window.innerHeight);
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
...oldTransform,
|
|
75
|
-
y,
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
}, [boxBounding.height]);
|
|
79
|
-
return (_jsx("div", { ref: listRef, className: "menu", style: {
|
|
80
|
-
transform: `translate(${translate.x}px, -${translate.y}px) `,
|
|
81
|
-
}, children: items?.map((item) => {
|
|
82
|
-
return (_jsx(MenuItem, { ...item, onClick: () => onClick(item) }, item.id));
|
|
83
|
-
}) }));
|
|
84
|
-
}
|
|
85
|
-
export default function ToolbarMenu({ component, toolTip = '', items = [], onClick = () => null, }) {
|
|
86
|
-
const menuButtonRef = useRef(null);
|
|
87
|
-
const [isShown, showMenu] = useState(false);
|
|
88
|
-
const closeMenuButton = useCallback(() => {
|
|
89
|
-
showMenu(false);
|
|
90
|
-
}, []);
|
|
91
|
-
const handleClick = useCallback(() => {
|
|
92
|
-
showMenu((flag) => !flag);
|
|
93
|
-
}, []);
|
|
94
|
-
const clickHandler = useCallback((e) => {
|
|
95
|
-
showMenu(false);
|
|
96
|
-
onClick(e);
|
|
97
|
-
}, [onClick]);
|
|
98
|
-
const boxBounding = useCallback(() => {
|
|
99
|
-
return menuButtonRef.current?.getBoundingClientRect();
|
|
100
|
-
}, []);
|
|
101
|
-
return (_jsxs("div", { style: { height: 'auto' }, css: menuStyles, children: [_jsx("div", { ref: menuButtonRef, children: _jsx(Toolbar.Item, { id: `menu-${toolTip}`, title: toolTip, active: isShown, onClick: handleClick, children: component }) }), isShown && (_jsx(MenuList, { items: items, boxBounding: boxBounding(), onClick: clickHandler })), isShown && _jsx("div", { className: "menu-cover", onClick: closeMenuButton })] }));
|
|
102
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
interface ToggleButtonProps {
|
|
3
|
-
isActive?: boolean;
|
|
4
|
-
value?: any;
|
|
5
|
-
onChange?: (value: any) => null;
|
|
6
|
-
children: ReactElement;
|
|
7
|
-
isVisible?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export default function ToggleButton(props: ToggleButtonProps & {
|
|
10
|
-
title: string;
|
|
11
|
-
id: string;
|
|
12
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useState, useEffect } from 'react';
|
|
3
|
-
import { Toolbar } from 'react-science/ui';
|
|
4
|
-
export default function ToggleButton(props) {
|
|
5
|
-
const { children, value = null, isActive = false, onChange = () => null, isVisible = true, id, title, } = props;
|
|
6
|
-
const [active, setActive] = useState(props.isActive);
|
|
7
|
-
const toggleButton = useCallback(() => {
|
|
8
|
-
const _isActive = !active;
|
|
9
|
-
setActive(_isActive);
|
|
10
|
-
if (_isActive) {
|
|
11
|
-
onChange(value);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
onChange(null);
|
|
15
|
-
}
|
|
16
|
-
}, [active, onChange, value]);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
setActive(isActive);
|
|
19
|
-
}, [isActive]);
|
|
20
|
-
if (!isVisible) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return (_jsx(Toolbar.Item, { onClick: toggleButton, title: title, id: id, active: active, children: children }));
|
|
24
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
interface ToggleButtonGroupProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
value: string;
|
|
5
|
-
onChange?: (value: any) => void;
|
|
6
|
-
}
|
|
7
|
-
export default function ToggleButtonGroup({ children, value, onChange, }: ToggleButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|