nmrium 0.50.0 → 0.50.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.
Files changed (59) hide show
  1. package/README.md +7 -7
  2. package/lib/component/elements/CloseButton.d.ts +2 -2
  3. package/lib/component/elements/CloseButton.js +1 -1
  4. package/lib/component/elements/CounterLabel.d.ts +3 -3
  5. package/lib/component/elements/CounterLabel.js +3 -3
  6. package/lib/component/elements/PreferencesButton.d.ts +2 -2
  7. package/lib/component/elements/PreferencesButton.js +2 -4
  8. package/lib/component/elements/SaveButton.d.ts +2 -2
  9. package/lib/component/elements/SaveButton.js +1 -1
  10. package/lib/component/elements/ToolBarButton.d.ts +1 -8
  11. package/lib/component/elements/ToolBarButton.js +2 -11
  12. package/lib/component/elements/ToolbarPopoverItem.d.ts +11 -0
  13. package/lib/component/elements/ToolbarPopoverItem.js +10 -0
  14. package/lib/component/modal/CopyClipboardModal.js +1 -1
  15. package/lib/component/modal/EditPeakShapeModal.js +1 -1
  16. package/lib/component/modal/SaveAsModal.js +1 -1
  17. package/lib/component/modal/aboutUs/AboutUsModal.js +1 -1
  18. package/lib/component/modal/editRange/EditRangeModal.js +1 -1
  19. package/lib/component/modal/editZone/EditZoneModal.js +1 -1
  20. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  21. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +16 -2
  22. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +20 -6
  23. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +16 -3
  24. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  25. package/lib/component/panels/PeaksPanel/PeaksPanel.js +42 -11
  26. package/lib/component/panels/RangesPanel/RangesHeader.js +70 -10
  27. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +46 -5
  28. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
  29. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  30. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -1
  31. package/lib/component/panels/SummaryPanel/SummaryPanel.js +28 -18
  32. package/lib/component/panels/ZonesPanel/ZonesPanel.js +28 -4
  33. package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +3 -3
  34. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +4 -4
  35. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -1
  36. package/lib/component/panels/header/DefaultPanelHeader.d.ts +10 -6
  37. package/lib/component/panels/header/DefaultPanelHeader.js +26 -10
  38. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +32 -3
  39. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +5 -1
  40. package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
  41. package/lib/component/toolbar/ToolBar.js +237 -9
  42. package/lib/component/toolbar/toolbarMenu.d.ts +4 -0
  43. package/lib/component/toolbar/toolbarMenu.js +77 -0
  44. package/lib/component/utility/booleanToString.d.ts +6 -0
  45. package/lib/component/utility/booleanToString.js +4 -0
  46. package/lib/versionInfo.js +1 -1
  47. package/package.json +3 -3
  48. package/lib/component/elements/DeleteButton.d.ts +0 -6
  49. package/lib/component/elements/DeleteButton.js +0 -8
  50. package/lib/component/elements/DropdownMenu.d.ts +0 -9
  51. package/lib/component/elements/DropdownMenu.js +0 -7
  52. package/lib/component/elements/FilterButton.d.ts +0 -6
  53. package/lib/component/elements/FilterButton.js +0 -8
  54. package/lib/component/panels/PeaksPanel/PeaksToggleActions.d.ts +0 -12
  55. package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +0 -7
  56. package/lib/component/toolbar/BasicToolBar.d.ts +0 -1
  57. package/lib/component/toolbar/BasicToolBar.js +0 -165
  58. package/lib/component/toolbar/FunctionToolBar.d.ts +0 -3
  59. package/lib/component/toolbar/FunctionToolBar.js +0 -148
@@ -1,148 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { SvgNmrApodization, SvgNmrBaselineCorrection, SvgNmrFourierTransform, SvgNmrIntegrate, SvgNmrMultipleAnalysis, SvgNmrPeakPicking, SvgNmrPhaseCorrection, SvgNmrRangePicking, SvgNmrZeroFilling, } from 'cheminfo-font';
3
- import { useState, useEffect, useCallback, memo } from 'react';
4
- import { FaSearchPlus, FaExpand, FaDiceFour } from 'react-icons/fa';
5
- import { PiKnifeBold } from 'react-icons/pi';
6
- import { Toolbar } from 'react-science/ui';
7
- import { useChartData } from '../context/ChartContext';
8
- import { useDispatch } from '../context/DispatchContext';
9
- import { useCheckToolsVisibility, } from '../hooks/useCheckToolsVisibility';
10
- import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
11
- import useToolsFunctions from '../hooks/useToolsFunctions';
12
- import { options } from './ToolTypes';
13
- function FunctionToolBarInner({ defaultValue, ftCounter, }) {
14
- const [option, setOption] = useState('');
15
- const isButtonVisible = useCheckToolsVisibility();
16
- const dispatch = useDispatch();
17
- const { handleChangeOption, handleFullZoomOut } = useToolsFunctions();
18
- const handleChange = useCallback((selectedOption) => {
19
- setOption(selectedOption);
20
- handleChangeOption(selectedOption);
21
- }, [handleChangeOption]);
22
- useEffect(() => {
23
- setOption(defaultValue);
24
- }, [defaultValue]);
25
- const handleOnFFTFilter = useCallback(() => {
26
- dispatch({
27
- type: 'APPLY_FFT_FILTER',
28
- });
29
- }, [dispatch]);
30
- const handleFFtDimension1Filter = useCallback(() => {
31
- dispatch({
32
- type: 'APPLY_FFT_DIMENSION_1_FILTER',
33
- });
34
- }, [dispatch]);
35
- const handleFFtDimension2Filter = useCallback(() => {
36
- dispatch({
37
- type: 'APPLY_FFT_DIMENSION_2_FILTER',
38
- });
39
- }, [dispatch]);
40
- const toolItems = [
41
- {
42
- id: 'zoom',
43
- label: options.zoom.label,
44
- icon: _jsx(FaSearchPlus, {}),
45
- },
46
- {
47
- id: 'zoomOut',
48
- label: 'Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )',
49
- onClick: handleFullZoomOut,
50
- icon: _jsx(FaExpand, {}),
51
- },
52
- {
53
- id: 'peakPicking',
54
- label: `${options.peakPicking.label} ( Press p )`,
55
- icon: _jsx(SvgNmrPeakPicking, {}),
56
- },
57
- {
58
- id: 'integral',
59
- label: `${options.integral.label} ( Press i )`,
60
- icon: _jsx(SvgNmrIntegrate, {}),
61
- },
62
- {
63
- id: 'zonePicking',
64
- label: `${options.zonePicking.label} ( Press r )`,
65
- icon: _jsx(FaDiceFour, {}),
66
- },
67
- {
68
- id: 'slicing',
69
- label: options.slicing.label,
70
- icon: _jsx(PiKnifeBold, {}),
71
- },
72
- {
73
- id: 'rangePicking',
74
- label: `${options.rangePicking.label} ( Press r )`,
75
- icon: _jsx(SvgNmrRangePicking, {}),
76
- },
77
- {
78
- id: 'multipleSpectraAnalysis',
79
- label: options.multipleSpectraAnalysis.label,
80
- icon: _jsx(SvgNmrMultipleAnalysis, {}),
81
- checkOptions: { checkSpectrumType: false },
82
- condition: ftCounter > 1,
83
- },
84
- {
85
- id: 'apodization',
86
- label: `${options.apodization.label} (Press a)`,
87
- icon: _jsx(SvgNmrApodization, {}),
88
- },
89
- {
90
- id: 'zeroFilling',
91
- label: `${options.zeroFilling.label} ( Press z )`,
92
- icon: _jsx(SvgNmrZeroFilling, {}),
93
- },
94
- {
95
- id: 'phaseCorrection',
96
- label: `${options.phaseCorrection.label} ( Press a )`,
97
- icon: _jsx(SvgNmrPhaseCorrection, {}),
98
- },
99
- {
100
- id: 'phaseCorrectionTwoDimensions',
101
- label: `${options.phaseCorrectionTwoDimensions.label} ( Press a )`,
102
- icon: _jsx(SvgNmrPhaseCorrection, {}),
103
- },
104
- {
105
- id: 'baselineCorrection',
106
- label: `${options.baselineCorrection.label} ( Press b )`,
107
- icon: _jsx(SvgNmrBaselineCorrection, {}),
108
- },
109
- {
110
- id: 'exclusionZones',
111
- label: `${options.exclusionZones.label} ( Press e )`,
112
- icon: _jsx(SvgNmrMultipleAnalysis, {}),
113
- checkOptions: { checkSpectrumType: false },
114
- condition: ftCounter > 0,
115
- },
116
- {
117
- id: 'fft',
118
- label: `${options.fft.label} ( Press t )`,
119
- onClick: handleOnFFTFilter,
120
- icon: _jsx(SvgNmrFourierTransform, {}),
121
- },
122
- {
123
- id: 'fftDimension1',
124
- label: options.fftDimension1.label,
125
- onClick: handleFFtDimension1Filter,
126
- icon: _jsx(SvgNmrFourierTransform, {}),
127
- },
128
- {
129
- id: 'fftDimension2',
130
- label: options.fftDimension2.label,
131
- onClick: handleFFtDimension2Filter,
132
- icon: _jsx(SvgNmrFourierTransform, {}),
133
- },
134
- ];
135
- return (_jsx(_Fragment, { children: toolItems.map((item) => {
136
- const { id, icon, label, checkOptions, onClick, condition } = item;
137
- return (isButtonVisible(id, checkOptions) &&
138
- (condition === undefined || condition) && (_jsx(Toolbar.Item, { onClick: onClick || (() => handleChange(id)), title: label, id: id, active: option === id, icon: icon }, id)));
139
- }) }));
140
- }
141
- const MemoizedFunctionToolBar = memo(FunctionToolBarInner);
142
- export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
143
- const { displayerMode } = useChartData();
144
- const data = useDatumWithSpectraStatistics();
145
- return (_jsx(MemoizedFunctionToolBar, { ...data,
146
- displayerMode,
147
- defaultValue }));
148
- }