nmrium 0.50.1 → 0.51.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.
Files changed (151) hide show
  1. package/lib/component/1d/Chart1D.js +1 -1
  2. package/lib/component/1d/LinesSeries.js +2 -2
  3. package/lib/component/1d/Viewer1D.js +6 -11
  4. package/lib/component/1d/database/DatabaseSpectrum.js +3 -3
  5. package/lib/component/2d/1d-tracer/HorizontalSliceChart.js +6 -2
  6. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +8 -1
  7. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraceWithMouse.js +2 -21
  8. package/lib/component/2d/1d-tracer/phase-correction-traces/PhaseTraces.js +1 -1
  9. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.d.ts +1 -1
  10. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectraPhaseTraces.js +6 -17
  11. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.d.ts +6 -10
  12. package/lib/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.js +62 -13
  13. package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.d.ts +1 -0
  14. package/lib/component/2d/1d-tracer/phase-correction-traces/useActivePhaseTraces.js +2 -1
  15. package/lib/component/2d/Viewer2D.js +16 -15
  16. package/lib/component/2d/ft/Contours.js +6 -3
  17. package/lib/component/2d/utilities/scale.d.ts +2 -1
  18. package/lib/component/2d/utilities/scale.js +12 -2
  19. package/lib/component/EventsTrackers/BrushTracker.d.ts +5 -3
  20. package/lib/component/EventsTrackers/BrushTracker.js +2 -2
  21. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +1 -1
  22. package/lib/component/EventsTrackers/KeysListenerTracker.js +29 -15
  23. package/lib/component/context/ToasterContext.d.ts +13 -0
  24. package/lib/component/context/ToasterContext.js +34 -0
  25. package/lib/component/elements/Select.js +2 -2
  26. package/lib/component/elements/ToolbarPopoverItem.js +1 -1
  27. package/lib/component/header/AutoPeakPickingOptionPanel.js +6 -3
  28. package/lib/component/header/Header.d.ts +1 -11
  29. package/lib/component/header/Header.js +5 -6
  30. package/lib/component/header/PhaseCorrectionPanel.js +24 -33
  31. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.d.ts +1 -1
  32. package/lib/component/header/PhaseCorrectionTwoDimensionsPanel.js +96 -42
  33. package/lib/component/header/RangesPickingOptionPanel.js +6 -3
  34. package/lib/component/hooks/useDialogToggle.d.ts +5 -0
  35. package/lib/component/hooks/useDialogToggle.js +16 -0
  36. package/lib/component/hooks/useExport.d.ts +9 -1
  37. package/lib/component/hooks/useExport.js +34 -36
  38. package/lib/component/hooks/useSaveSettings.js +6 -3
  39. package/lib/component/hooks/useToolsFunctions.js +6 -4
  40. package/lib/component/loader/DropZone.js +14 -14
  41. package/lib/component/main/InnerNMRium.js +5 -9
  42. package/lib/component/main/InnerNMRiumContents.d.ts +0 -2
  43. package/lib/component/main/InnerNMRiumContents.js +5 -3
  44. package/lib/component/main/NMRium.js +2 -2
  45. package/lib/component/modal/AboutPredictionModal.js +1 -1
  46. package/lib/component/modal/ExportAsJcampModal.js +15 -15
  47. package/lib/component/modal/ImportPublicationStringModal.js +5 -3
  48. package/lib/component/modal/LoadJCAMPModal.js +6 -4
  49. package/lib/component/modal/PredictSpectraModal.js +11 -9
  50. package/lib/component/modal/SaveAsModal.d.ts +3 -4
  51. package/lib/component/modal/SaveAsModal.js +27 -27
  52. package/lib/component/modal/editRange/EditRangeModal.js +2 -2
  53. package/lib/component/modal/editRange/forms/components/DeltaInput.d.ts +2 -3
  54. package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -3
  55. package/lib/component/modal/editRange/forms/components/InfoBlock.d.ts +1 -0
  56. package/lib/component/modal/editRange/forms/components/{SignalFormInfo.js → InfoBlock.js} +2 -2
  57. package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts +5 -0
  58. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +85 -0
  59. package/lib/component/modal/editRange/forms/components/SignalTab.d.ts +7 -0
  60. package/lib/component/modal/editRange/forms/components/SignalTab.js +24 -0
  61. package/lib/component/modal/editRange/forms/components/SignalsContent.d.ts +8 -0
  62. package/lib/component/modal/editRange/forms/components/SignalsContent.js +57 -0
  63. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts +5 -0
  64. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +133 -0
  65. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts +5 -0
  66. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +141 -0
  67. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts +7 -4
  68. package/lib/component/modal/metaImportation/MetaImportationModal.js +23 -13
  69. package/lib/component/modal/metaImportation/utils/mapColumnToSelectItems.js +1 -1
  70. package/lib/component/modal/setting/GeneralSettings.js +7 -4
  71. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -4
  72. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +13 -7
  73. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +6 -4
  74. package/lib/component/panels/PeaksPanel/PeaksPanel.js +6 -3
  75. package/lib/component/panels/RangesPanel/RangesHeader.js +3 -3
  76. package/lib/component/panels/RangesPanel/RangesPanel.js +4 -4
  77. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -3
  78. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +11 -5
  79. package/lib/component/panels/databasePanel/DatabasePanel.js +37 -19
  80. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +1 -1
  81. package/lib/component/panels/filtersPanel/FilterPanel.js +5 -3
  82. package/lib/component/panels/filtersPanel/FiltersTable.js +27 -23
  83. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +6 -4
  84. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +2 -2
  85. package/lib/component/panels/multipleAnalysisPanel/AnalysisChart.js +3 -3
  86. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
  87. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +4 -2
  88. package/lib/component/panels/predictionPanel/PredictionPanel.js +7 -5
  89. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -0
  90. package/lib/component/reducer/Reducer.d.ts +2 -2
  91. package/lib/component/reducer/Reducer.js +23 -16
  92. package/lib/component/reducer/actions/FiltersActions.d.ts +11 -4
  93. package/lib/component/reducer/actions/FiltersActions.js +243 -91
  94. package/lib/component/reducer/actions/IntegralsActions.js +2 -2
  95. package/lib/component/reducer/actions/MoleculeActions.js +0 -1
  96. package/lib/component/reducer/actions/RangesActions.js +16 -6
  97. package/lib/component/reducer/actions/ToolsActions.d.ts +3 -3
  98. package/lib/component/reducer/actions/ToolsActions.js +75 -14
  99. package/lib/component/reducer/helper/Zoom1DManager.d.ts +4 -3
  100. package/lib/component/reducer/helper/Zoom1DManager.js +4 -4
  101. package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -5
  102. package/lib/component/reducer/helper/findStrongestPeak.d.ts +6 -0
  103. package/lib/component/reducer/helper/findStrongestPeak.js +13 -0
  104. package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.d.ts +2 -1
  105. package/lib/component/reducer/helper/getTwoDimensionPhaseCorrectionOptions.js +7 -1
  106. package/lib/component/toolbar/ToolBar.js +17 -12
  107. package/lib/component/utility/Events.d.ts +11 -0
  108. package/lib/component/utility/Events.js +22 -0
  109. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +0 -33
  110. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -15
  111. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
  112. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
  113. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  114. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts +6 -4
  115. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +13 -3
  116. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +6 -0
  117. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts +13 -3
  118. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +78 -18
  119. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +2 -2
  120. package/lib/data/data1d/spectrumSimulation.d.ts +1 -1
  121. package/lib/data/data2d/Spectrum2D/contours.js +3 -3
  122. package/lib/data/data2d/Spectrum2D/getMissingProjection.js +2 -2
  123. package/lib/data/data2d/Spectrum2D/getSlice.js +3 -3
  124. package/lib/data/getDefaultMatrixFilters.js +2 -2
  125. package/lib/data/matrixGeneration.js +1 -1
  126. package/lib/data/utilities/calculateSanPlot.d.ts +1 -6
  127. package/lib/versionInfo.js +1 -1
  128. package/package.json +31 -30
  129. package/lib/component/elements/popup/Alert/AlertBlock.d.ts +0 -8
  130. package/lib/component/elements/popup/Alert/AlertBlock.js +0 -30
  131. package/lib/component/elements/popup/Alert/Context.d.ts +0 -27
  132. package/lib/component/elements/popup/Alert/Context.js +0 -10
  133. package/lib/component/elements/popup/Alert/ProgressIndicator.d.ts +0 -1
  134. package/lib/component/elements/popup/Alert/ProgressIndicator.js +0 -33
  135. package/lib/component/elements/popup/Alert/Provider.d.ts +0 -19
  136. package/lib/component/elements/popup/Alert/Provider.js +0 -127
  137. package/lib/component/elements/popup/Alert/index.d.ts +0 -3
  138. package/lib/component/elements/popup/Alert/index.js +0 -3
  139. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +0 -10
  140. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +0 -81
  141. package/lib/component/modal/editRange/forms/components/CouplingsTable.d.ts +0 -13
  142. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +0 -63
  143. package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +0 -1
  144. package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +0 -8
  145. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +0 -18
  146. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +0 -10
  147. package/lib/component/modal/editRange/forms/components/SignalsForm.js +0 -114
  148. package/lib/component/modal/metaImportation/index.d.ts +0 -2
  149. package/lib/component/modal/metaImportation/index.js +0 -17
  150. package/lib/component/reducer/helper/getStrongestPeak.d.ts +0 -7
  151. package/lib/component/reducer/helper/getStrongestPeak.js +0 -15
@@ -12,7 +12,7 @@ import { initiateDatabase, prepareData, DATA_BASES, } from '../../../data/data1d
12
12
  import { useChartData } from '../../context/ChartContext';
13
13
  import { useDispatch } from '../../context/DispatchContext';
14
14
  import { usePreferences } from '../../context/PreferencesContext';
15
- import { useAlert } from '../../elements/popup/Alert';
15
+ import { useToaster } from '../../context/ToasterContext';
16
16
  import { useFormatNumberByNucleus } from '../../hooks/useFormatNumberByNucleus';
17
17
  import { options } from '../../toolbar/ToolTypes';
18
18
  import Events from '../../utility/Events';
@@ -44,7 +44,7 @@ function mapKeywordsToArray(searchKeywords, solvent) {
44
44
  }
45
45
  function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase, }) {
46
46
  const dispatch = useDispatch();
47
- const alert = useAlert();
47
+ const toaster = useToaster();
48
48
  const { item } = useAccordionContext('Databases');
49
49
  const format = useFormatNumberByNucleus(nucleus);
50
50
  const [isFlipped, setFlipStatus] = useState(false);
@@ -80,9 +80,11 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
80
80
  }, [idCode, keywords]);
81
81
  useEffect(() => {
82
82
  const { solvent, searchKeywords } = keywords;
83
- setTimeout(async () => {
83
+ setTimeout(() => {
84
84
  if (databaseInstance.current) {
85
- const hideLoading = await alert.showLoading(`Preparing of the Result`);
85
+ const hideLoading = toaster.showLoading({
86
+ message: 'Preparing of the Result',
87
+ });
86
88
  if (solvent === '-1' && !searchKeywords) {
87
89
  const solvents = mapSolventsToSelect(databaseInstance.current.getSolvents());
88
90
  search(solvents);
@@ -93,7 +95,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
93
95
  hideLoading();
94
96
  }
95
97
  }, 0);
96
- }, [alert, idCode, keywords, search]);
98
+ }, [idCode, keywords, search, toaster]);
97
99
  useEffect(() => {
98
100
  function handle(event) {
99
101
  if (selectedTool === options.databaseRangesSelection.id) {
@@ -116,21 +118,25 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
116
118
  };
117
119
  }, [format, selectedTool]);
118
120
  useEffect(() => {
119
- setTimeout(async () => {
121
+ setTimeout(() => {
120
122
  if (databaseInstance.current) {
121
- const hideLoading = await alert.showLoading(`Loading the database`);
123
+ const hideLoading = toaster.showLoading({
124
+ message: 'Loading the database',
125
+ });
122
126
  databaseInstance.current = initiateDatabase(databaseDataRef.current, nucleus);
123
127
  hideLoading();
124
128
  setKeywords({ ...emptyKeywords });
125
129
  }
126
130
  }, 0);
127
- }, [alert, nucleus]);
131
+ }, [nucleus, toaster]);
128
132
  const handleChangeDatabase = useCallback((databaseKey) => {
129
133
  const database = databases.find((item) => item.key === databaseKey);
130
134
  setTimeout(async () => {
131
135
  if (database?.url) {
132
136
  const { url, label } = database;
133
- const hideLoading = await alert.showLoading(`load ${label} database`);
137
+ const hideLoading = toaster.showLoading({
138
+ message: `load ${label} database`,
139
+ });
134
140
  try {
135
141
  databaseDataRef.current = await fetch(url)
136
142
  .then((response) => response.json())
@@ -140,7 +146,10 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
140
146
  })));
141
147
  }
142
148
  catch {
143
- alert.error(`Failed to load ${url}`);
149
+ toaster.show({
150
+ message: `Failed to load ${url}`,
151
+ intent: 'danger',
152
+ });
144
153
  }
145
154
  finally {
146
155
  hideLoading();
@@ -150,12 +159,14 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
150
159
  databaseDataRef.current = database
151
160
  ?.value;
152
161
  }
153
- const hideLoading = await alert.showLoading(`Loading the database`);
162
+ const hideLoading = toaster.showLoading({
163
+ message: 'Loading the database',
164
+ });
154
165
  databaseInstance.current = initiateDatabase(databaseDataRef.current, nucleus);
155
166
  setKeywords({ ...emptyKeywords });
156
167
  hideLoading();
157
168
  }, 0);
158
- }, [alert, databases, nucleus]);
169
+ }, [databases, nucleus, toaster]);
159
170
  useEffect(() => {
160
171
  if (item?.isOpen && defaultDatabase && !databaseInstance.current) {
161
172
  handleChangeDatabase(defaultDatabase);
@@ -170,7 +181,9 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
170
181
  if (jcampRelativeURL) {
171
182
  const url = new URL(jcampRelativeURL, baseURL);
172
183
  setTimeout(async () => {
173
- const hideLoading = await alert.showLoading(`load jcamp in progress...`);
184
+ const hideLoading = toaster.showLoading({
185
+ message: `load jcamp in progress...`,
186
+ });
174
187
  try {
175
188
  const { data } = await readFromWebSource({
176
189
  entries: [{ baseURL: url.origin, relativePath: url.pathname }],
@@ -184,7 +197,7 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
184
197
  }
185
198
  }
186
199
  catch {
187
- alert.error(`Failed to load Jcamp`);
200
+ toaster.show({ message: 'Failed to load Jcamp', intent: 'danger' });
188
201
  }
189
202
  finally {
190
203
  hideLoading();
@@ -197,17 +210,22 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
197
210
  payload: { ranges, info: { solvent, nucleus, name: names[0] } },
198
211
  });
199
212
  }
200
- }, [alert, dispatch, nucleus, result.data]);
213
+ }, [dispatch, nucleus, result.data, toaster]);
201
214
  const saveHandler = useCallback((row) => {
202
215
  if (row?.jcampURL) {
203
216
  setTimeout(async () => {
204
- const hideLoading = await alert.showLoading(`Download jcamp in progress...`);
217
+ const hideLoading = toaster.showLoading({
218
+ message: `Download jcamp in progress...`,
219
+ });
205
220
  try {
206
221
  await saveJcampAsJson(row, result);
207
222
  hideLoading();
208
223
  }
209
224
  catch {
210
- alert.error(`Failed to download the jcamp`);
225
+ toaster.show({
226
+ message: 'Failed to download the jcamp',
227
+ intent: 'danger',
228
+ });
211
229
  }
212
230
  finally {
213
231
  hideLoading();
@@ -215,9 +233,9 @@ function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase,
215
233
  }, 0);
216
234
  }
217
235
  else {
218
- alert.error(`No jcamp file to save`);
236
+ toaster.show({ message: 'No jcamp file to save', intent: 'danger' });
219
237
  }
220
- }, [alert, result]);
238
+ }, [result, toaster]);
221
239
  const searchByStructureHandler = (idCodeValue) => {
222
240
  setIdCode(idCodeValue);
223
241
  };
@@ -48,5 +48,5 @@ export function DatabaseSearchOptions({ databases, defaultDatabase, keywords, re
48
48
  alignItems: 'center',
49
49
  flex: 2,
50
50
  justifyContent: 'flex-end',
51
- }, children: [_jsx(CounterLabel, { value: formatCounterLabel(total || 0, result.data.length) }), _jsx(PreferencesButton, { title: "Preferences", onClick: onSettingClick })] })] }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [_jsx(ToolBarButton, { title: "Filter by select ranges", icon: _jsx(FaICursor, {}), active: selectedTool === options.databaseRangesSelection.id, onClick: enableFilterHandler }), _jsx(Input, { value: keywords.searchKeywords, renderIcon: () => _jsx(IoSearchOutline, {}), style: { inputWrapper: { flex: 3, margin: '0 5px' } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), _jsx(ToolBarButton, { title: "Search by stricture", icon: !idCode ? _jsx(BsHexagon, {}) : _jsx(BsHexagonFill, {}), intent: "success", active: !!idCode, onClick: onStructureClick })] })] }));
51
+ }, children: [_jsx(CounterLabel, { value: formatCounterLabel(total || 0, result.data.length) }), _jsx(PreferencesButton, { title: "Preferences", onClick: onSettingClick })] })] }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [_jsx(ToolBarButton, { title: "Filter by select ranges", icon: _jsx(FaICursor, {}), active: selectedTool === options.databaseRangesSelection.id, onClick: enableFilterHandler }), _jsx(Input, { value: keywords.searchKeywords, renderIcon: () => _jsx(IoSearchOutline, {}), style: { inputWrapper: { flex: 3, margin: '0 5px' } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), _jsx(ToolBarButton, { title: "Search by substructure", icon: !idCode ? _jsx(BsHexagon, {}) : _jsx(BsHexagonFill, {}), intent: "success", active: !!idCode, onClick: onStructureClick })] })] }));
52
52
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  import { useDispatch } from '../../context/DispatchContext';
3
- import { useAlert } from '../../elements/popup/Alert/Context';
3
+ import { useToaster } from '../../context/ToasterContext';
4
4
  import { useModal } from '../../elements/popup/Modal/Context';
5
5
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
6
6
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
@@ -8,13 +8,15 @@ import FiltersTable from './FiltersTable';
8
8
  export default function FiltersPanel() {
9
9
  const dispatch = useDispatch();
10
10
  const modal = useModal();
11
- const alert = useAlert();
11
+ const toaster = useToaster();
12
12
  function handelDeleteFilter() {
13
13
  const buttons = [
14
14
  {
15
15
  text: 'Yes',
16
16
  handler: async () => {
17
- const hideLoading = await alert.showLoading('Delete filters process in progress');
17
+ const hideLoading = toaster.showLoading({
18
+ message: 'Delete filters process in progress',
19
+ });
18
20
  dispatch({ type: 'DELETE_FILTER', payload: {} });
19
21
  hideLoading();
20
22
  },
@@ -5,10 +5,10 @@ import { FaRegTrashAlt } from 'react-icons/fa';
5
5
  import { ObjectInspector } from 'react-inspector';
6
6
  import { useChartData } from '../../context/ChartContext';
7
7
  import { useDispatch } from '../../context/DispatchContext';
8
+ import { useToaster } from '../../context/ToasterContext';
8
9
  import Button from '../../elements/Button';
9
10
  import { ColumnWrapper } from '../../elements/ColumnWrapper';
10
11
  import ReactTable from '../../elements/ReactTable/ReactTable';
11
- import { useAlert } from '../../elements/popup/Alert';
12
12
  import { useModal } from '../../elements/popup/Modal';
13
13
  import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus';
14
14
  import useSpectrum from '../../hooks/useSpectrum';
@@ -31,24 +31,26 @@ const rowColors = {
31
31
  function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
32
32
  const dispatch = useDispatch();
33
33
  const modal = useModal();
34
- const alert = useAlert();
34
+ const toaster = useToaster();
35
35
  const selectedFilterIndex = useRef();
36
36
  const handelFilterCheck = useCallback((id, event) => {
37
37
  const { checked: enabled } = event.target;
38
- void (async () => {
39
- const hideLoading = await alert.showLoading(`${enabled ? 'Enable' : 'Disable'} filter in progress`);
40
- setTimeout(() => {
41
- dispatch({ type: 'ENABLE_FILTER', payload: { id, enabled } });
42
- hideLoading();
43
- }, 0);
44
- })();
45
- }, [alert, dispatch]);
38
+ const hideLoading = toaster.showLoading({
39
+ message: `${enabled ? 'Enable' : 'Disable'} filter in progress`,
40
+ });
41
+ setTimeout(() => {
42
+ dispatch({ type: 'ENABLE_FILTER', payload: { id, enabled } });
43
+ hideLoading();
44
+ }, 0);
45
+ }, [dispatch, toaster]);
46
46
  const handelDeleteFilter = useCallback(({ id, name, label }) => {
47
47
  const buttons = [
48
48
  {
49
49
  text: 'Yes',
50
- handler: async () => {
51
- const hideLoading = await alert.showLoading('Delete filter process in progress');
50
+ handler: () => {
51
+ const hideLoading = toaster.showLoading({
52
+ message: 'Delete filter process in progress',
53
+ });
52
54
  dispatch({ type: 'DELETE_FILTER', payload: { id } });
53
55
  hideLoading();
54
56
  },
@@ -58,8 +60,10 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
58
60
  if (spectraCounter > 1) {
59
61
  buttons.unshift({
60
62
  text: 'Yes, for all spectra',
61
- handler: async () => {
62
- const hideLoading = await alert.showLoading('Delete all spectra filter process in progress');
63
+ handler: () => {
64
+ const hideLoading = toaster.showLoading({
65
+ message: 'Delete all spectra filter process in progress',
66
+ });
63
67
  dispatch({
64
68
  type: 'DELETE_SPECTRA_FILTER',
65
69
  payload: { filterName: name },
@@ -72,20 +76,20 @@ function FiltersTableInner({ filters, spectraCounter, activeFilterID, }) {
72
76
  message: (_jsxs("span", { children: ["You are about to delete this processing step", _jsxs("span", { style: { color: 'black' }, children: [" ", label, " "] }), " , Are you sure?"] })),
73
77
  buttons,
74
78
  }, { height: 'auto', width: 'auto' });
75
- }, [alert, dispatch, modal, spectraCounter]);
79
+ }, [dispatch, modal, spectraCounter, toaster]);
76
80
  const filterSnapShotHandler = useCallback((filter, index) => {
77
81
  selectedFilterIndex.current =
78
82
  selectedFilterIndex.current && index === selectedFilterIndex.current
79
83
  ? null
80
84
  : index;
81
- void (async () => {
82
- const hideLoading = await alert.showLoading('Filter snapshot process in progress');
83
- setTimeout(() => {
84
- dispatch({ type: 'SET_FILTER_SNAPSHOT', payload: filter });
85
- hideLoading();
86
- }, 0);
87
- })();
88
- }, [alert, dispatch]);
85
+ const hideLoading = toaster.showLoading({
86
+ message: 'Filter snapshot process in progress',
87
+ });
88
+ setTimeout(() => {
89
+ dispatch({ type: 'SET_FILTER_SNAPSHOT', payload: filter });
90
+ hideLoading();
91
+ }, 0);
92
+ }, [dispatch, toaster]);
89
93
  const COLUMNS = useMemo(() => [
90
94
  {
91
95
  Header: '#',
@@ -4,23 +4,25 @@ import { useCallback } from 'react';
4
4
  import { Toolbar } from 'react-science/ui';
5
5
  import { useChartData } from '../../context/ChartContext';
6
6
  import { useDispatch } from '../../context/DispatchContext';
7
- import { useAlert } from '../../elements/popup/Alert';
7
+ import { useToaster } from '../../context/ToasterContext';
8
8
  import { useCheckToolsVisibility } from '../../hooks/useCheckToolsVisibility';
9
9
  export function SpectraAutomaticPickingButton() {
10
10
  const dispatch = useDispatch();
11
- const alert = useAlert();
11
+ const toaster = useToaster();
12
12
  const { data } = useChartData();
13
13
  const isToolVisible = useCheckToolsVisibility();
14
14
  const automaticPickingHandler = useCallback(() => {
15
15
  void (async () => {
16
- const hideLoading = await alert.showLoading('Automatic Ranges/Zones detection for all spectra in progress');
16
+ const hideLoading = toaster.showLoading({
17
+ message: 'Automatic Ranges/Zones detection for all spectra in progress',
18
+ });
17
19
  setTimeout(() => {
18
20
  dispatch({ type: 'AUTO_RANGES_SPECTRA_PICKING' });
19
21
  dispatch({ type: 'AUTO_ZONES_SPECTRA_PICKING' });
20
22
  hideLoading();
21
23
  }, 0);
22
24
  })();
23
- }, [dispatch, alert]);
25
+ }, [toaster, dispatch]);
24
26
  if ((Array.isArray(data) && data.length === 0) ||
25
27
  !isToolVisible('autoRangeAndZonePicking')) {
26
28
  return null;
@@ -7,7 +7,7 @@ import { useEffect, useState } from 'react';
7
7
  import * as Yup from 'yup';
8
8
  import { REFERENCES } from '../../../data/constants/References';
9
9
  import { useDispatch } from '../../context/DispatchContext';
10
- import Button from '../../elements/Button';
10
+ import ActionButtons from '../../elements/ActionButtons';
11
11
  import Label from '../../elements/Label';
12
12
  import Message from '../../elements/Message';
13
13
  import Select from '../../elements/Select';
@@ -131,6 +131,6 @@ function AlignSpectra({ onClose = () => null, nucleus }) {
131
131
  padding-top: 5px;
132
132
  }
133
133
  `;
134
- return (_jsx("div", { css: styles, children: _jsx(Formik, { initialValues: options, enableReinitialize: true, onSubmit: submitHandler, validationSchema: schemaValidation, validate: () => setError(''), children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "body", style: { flex: 1 }, children: [_jsx("div", { className: "header", children: _jsx("span", { children: "Spectra calibration" }) }), error && _jsx(Message, { type: "error", children: error }), _jsx(Label, { title: "Options", style: labelStyle, children: _jsx(Select, { items: List, style: { width: '100%', height: 30 }, onChange: optionChangeHandler }) }), _jsxs(Label, { title: "Range", style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "to", type: "number", style: inputStyle }) })] }), _jsx(Label, { title: "Number of Peaks", style: labelStyle, children: _jsx(FormikInput, { name: "nbPeaks", type: "number", style: inputStyle }) }), _jsx(Label, { title: "Target PPM", style: labelStyle, children: _jsx(FormikInput, { name: "targetX", type: "number", style: inputStyle }) })] }), _jsx("div", { className: "footer", children: _jsx(Button.Done, { style: { padding: '5px 14px', fontSize: 14 }, onClick: submitForm, children: "Done" }) })] })) }) }));
134
+ return (_jsx("div", { css: styles, children: _jsx(Formik, { initialValues: options, enableReinitialize: true, onSubmit: submitHandler, validationSchema: schemaValidation, validate: () => setError(''), children: ({ submitForm }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "body", style: { flex: 1 }, children: [_jsx("div", { className: "header", children: _jsx("span", { children: "Spectra calibration" }) }), error && _jsx(Message, { type: "error", children: error }), _jsx(Label, { title: "Options", style: labelStyle, children: _jsx(Select, { items: List, style: { width: '100%', height: 30 }, onChange: optionChangeHandler }) }), _jsxs(Label, { title: "Range", style: labelStyle, children: [_jsx(Label, { title: "From", children: _jsx(FormikInput, { name: "from", type: "number", style: inputStyle }) }), _jsx(Label, { title: "To", style: { label: { padding: '0 10px' } }, children: _jsx(FormikInput, { name: "to", type: "number", style: inputStyle }) })] }), _jsx(Label, { title: "Number of Peaks", style: labelStyle, children: _jsx(FormikInput, { name: "nbPeaks", type: "number", style: inputStyle }) }), _jsx(Label, { title: "Target PPM", style: labelStyle, children: _jsx(FormikInput, { name: "targetX", type: "number", style: inputStyle }) })] }), _jsx("div", { className: "footer", children: _jsx(ActionButtons, { onDone: submitForm, onCancel: onClose }) })] })) }) }));
135
135
  }
136
136
  export default AlignSpectra;
@@ -6,10 +6,10 @@ import { ResponsiveChart } from 'react-d3-utils';
6
6
  import { FaFileExport } from 'react-icons/fa';
7
7
  import { Axis, LineSeries, Plot } from 'react-plot';
8
8
  import { useChartData } from '../../context/ChartContext';
9
+ import { useToaster } from '../../context/ToasterContext';
9
10
  import Button from '../../elements/Button';
10
11
  import Input from '../../elements/Input';
11
12
  import Label from '../../elements/Label';
12
- import { useAlert } from '../../elements/popup/Alert';
13
13
  import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus';
14
14
  import { copyPNGToClipboard } from '../../utility/export';
15
15
  import { getSpectraObjectPaths } from '../../utility/getSpectraObjectPaths';
@@ -70,7 +70,7 @@ function getAnalysisColumnsPaths(spectraAnalysisData) {
70
70
  export default function AnalysisChart(props) {
71
71
  const { spectraAnalysisData } = props;
72
72
  const { data } = useChartData();
73
- const alert = useAlert();
73
+ const toaster = useToaster();
74
74
  const chartParentRef = useRef(null);
75
75
  const [plotOptions, setPlotOptions] = useState({
76
76
  xPath: '',
@@ -94,7 +94,7 @@ export default function AnalysisChart(props) {
94
94
  function handleCopy() {
95
95
  if (chartParentRef.current) {
96
96
  void copyPNGToClipboard(chartParentRef.current, svgId, css({ text: { fill: 'black' } }));
97
- alert.success('Chart copied to clipboard');
97
+ toaster.show({ message: 'Chart copied to clipboard', intent: 'success' });
98
98
  }
99
99
  }
100
100
  const plotData = usePlotData(spectraAnalysisData, { ...plotOptions, paths });
@@ -11,10 +11,10 @@ import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardCompon
11
11
  import { useClipboard } from '../../../utils/clipboard/clipboardHooks';
12
12
  import { useChartData } from '../../context/ChartContext';
13
13
  import { useDispatch } from '../../context/DispatchContext';
14
- import { useAlert } from '../../elements/popup/Alert';
14
+ import { useToaster } from '../../context/ToasterContext';
15
15
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
16
- import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
17
16
  import { booleanToString } from '../../utility/booleanToString';
17
+ import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
18
18
  import { tablePanelStyle } from '../extra/BasicPanelStyle';
19
19
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
20
20
  import PreferencesHeader from '../header/PreferencesHeader';
@@ -30,7 +30,7 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, dis
30
30
  const [showAnalysisChart, toggleAnalysisChart] = useToggle(false);
31
31
  const spectraAnalysis = generateAnalyzeSpectra(preferences, spectra, activeTab);
32
32
  const settingRef = useRef();
33
- const alert = useAlert();
33
+ const toaster = useToaster();
34
34
  const dispatch = useDispatch();
35
35
  const settingsPanelHandler = useCallback(() => {
36
36
  setFlipStatus(!isFlipped);
@@ -49,8 +49,8 @@ function MultipleSpectraAnalysisPanelInner({ activeTab, spectra, showLegend, dis
49
49
  const data = getDataAsString(spectraAnalysis, spectra, spectraPreferences);
50
50
  if (!data)
51
51
  return;
52
- void rawWriteWithType(data).then(() => alert.success('Data copied to clipboard'));
53
- }, [alert, rawWriteWithType, spectra, spectraAnalysis, spectraPreferences]);
52
+ void rawWriteWithType(data).then(() => toaster.show({ message: 'Data copied to clipboard', intent: 'success' }));
53
+ }, [rawWriteWithType, spectra, spectraAnalysis, spectraPreferences, toaster]);
54
54
  function handleSpectraCalibration() {
55
55
  setCalibration((value) => {
56
56
  if (value)
@@ -7,6 +7,7 @@ import { usePreferences } from '../../../context/PreferencesContext';
7
7
  import { GroupPane } from '../../../elements/GroupPane';
8
8
  import Label from '../../../elements/Label';
9
9
  import FormikCheckBox from '../../../elements/formik/FormikCheckBox';
10
+ import useCheckExperimentalFeature from '../../../hooks/useCheckExperimentalFeature';
10
11
  import { usePanelPreferences } from '../../../hooks/usePanelPreferences';
11
12
  import { PreferencesContainer } from '../../extra/preferences/PreferencesContainer';
12
13
  import { AnalysisTablePreferences } from './AnalysisTablePreferences';
@@ -34,6 +35,7 @@ function MultipleSpectraAnalysisPreferences({ data, activeTab, onAfterSave }, re
34
35
  const panelPreferences = usePanelPreferences('multipleSpectraAnalysis', activeTab);
35
36
  const preferences = usePreferences();
36
37
  const columns = getMultipleSpectraAnalysisData(panelPreferences);
38
+ const isExperimental = useCheckExperimentalFeature();
37
39
  useImperativeHandle(ref, () => ({
38
40
  saveSetting() {
39
41
  refForm.current.submitForm();
@@ -58,10 +60,10 @@ function MultipleSpectraAnalysisPreferences({ data, activeTab, onAfterSave }, re
58
60
  }, children: _jsx(Label, { title: "Enable resort spectra", htmlFor: "resortSpectra", children: _jsx(FormikCheckBox, { name: "resortSpectra" }) }) }), _jsx(GroupPane, { text: "Columns Settings ", style: {
59
61
  header: { color: 'black' },
60
62
  container: { padding: '5px' },
61
- }, children: _jsx(AnalysisTablePreferences, {}) }), _jsx(GroupPane, { text: "Execute code ", style: {
63
+ }, children: _jsx(AnalysisTablePreferences, {}) }), isExperimental && (_jsx(GroupPane, { text: "Execute code ", style: {
62
64
  header: { color: 'black' },
63
65
  container: { padding: '5px' },
64
- }, children: _jsx(MultipleAnalysisCodeEditor, { data: data }) })] }) }) }));
66
+ }, children: _jsx(MultipleAnalysisCodeEditor, { data: data }) }))] }) }) }));
65
67
  }
66
68
  function columnSchema(columns) {
67
69
  return Yup.object().shape({
@@ -7,9 +7,9 @@ import { predictSpectra } from '../../../data/PredictionManager';
7
7
  import { useChartData } from '../../context/ChartContext';
8
8
  import { useDispatch } from '../../context/DispatchContext';
9
9
  import { useLogger } from '../../context/LoggerContext';
10
+ import { useToaster } from '../../context/ToasterContext';
10
11
  import Button from '../../elements/Button';
11
12
  import NextPrev from '../../elements/NextPrev';
12
- import { useAlert } from '../../elements/popup/Alert';
13
13
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
14
14
  import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal';
15
15
  import MoleculeHeader from '../MoleculesPanel/MoleculeHeader';
@@ -31,7 +31,7 @@ const styles = {
31
31
  export default function PredictionPanel() {
32
32
  const { molecules, view: { molecules: moleculesView, predictions }, } = useChartData();
33
33
  const dispatch = useDispatch();
34
- const alert = useAlert();
34
+ const toaster = useToaster();
35
35
  const { logger } = useLogger();
36
36
  const [currentIndex, setCurrentIndex] = useState(0);
37
37
  const [molfile, setMolfile] = useState(null);
@@ -70,7 +70,9 @@ export default function PredictionPanel() {
70
70
  predictedSpectra.push(key);
71
71
  }
72
72
  }
73
- const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
73
+ const hideLoading = toaster.showLoading({
74
+ message: `Predict ${predictedSpectra.join(',')} in progress`,
75
+ });
74
76
  try {
75
77
  const data = await predictSpectra(molfile, predictionPreferences.spectra);
76
78
  dispatch({
@@ -88,14 +90,14 @@ export default function PredictionPanel() {
88
90
  }
89
91
  }
90
92
  catch (error) {
91
- alert.error(error.message);
93
+ toaster.show({ message: error.message, intent: 'danger' });
92
94
  }
93
95
  finally {
94
96
  hideLoading();
95
97
  }
96
98
  }
97
99
  else {
98
- alert.error('No Molecule selected');
100
+ toaster.show({ message: 'No Molecule selected', intent: 'danger' });
99
101
  }
100
102
  })();
101
103
  }
@@ -35,6 +35,7 @@ function PredictionSimpleOptions() {
35
35
  // eslint-disable-next-line @typescript-eslint/no-empty-function
36
36
  onSubmit: () => { }, children: _jsxs("div", { style: {
37
37
  display: 'flex',
38
+ flexWrap: 'wrap',
38
39
  justifyContent: 'flex-end',
39
40
  flex: '1',
40
41
  height: '100%',
@@ -1,4 +1,3 @@
1
- import { NmrData1D } from 'cheminfo-types';
2
1
  import { WebSource as Source } from 'filelist-utils';
3
2
  import { CorrelationData } from 'nmr-correlation';
4
3
  import { Spectrum, ViewState } from 'nmr-load-save';
@@ -25,7 +24,6 @@ export type SpectraDirection = 'RTL' | 'LTR';
25
24
  export type TraceDirection = 'vertical' | 'horizontal';
26
25
  export interface SpectrumTrace {
27
26
  id: string;
28
- data: NmrData1D;
29
27
  x: number;
30
28
  y: number;
31
29
  }
@@ -39,7 +37,9 @@ export interface PhaseCorrectionTraceData {
39
37
  export interface TwoDimensionPhaseCorrection {
40
38
  traces: Record<TraceDirection, PhaseCorrectionTraceData>;
41
39
  activeTraceDirection: TraceDirection;
40
+ addTracesToBothDirections: boolean;
42
41
  }
42
+ export declare const getDefaultTwoDimensionsPhaseCorrectionTraceOptions: () => TwoDimensionPhaseCorrection['traces'];
43
43
  export declare function getDefaultViewState(): ViewState;
44
44
  export declare const getInitialState: () => State;
45
45
  export declare const initialState: State;
@@ -18,6 +18,23 @@ import * as SpectraAnalysisActions from './actions/SpectraAnalysisAction';
18
18
  import * as SpectrumsActions from './actions/SpectrumsActions';
19
19
  import * as ToolsActions from './actions/ToolsActions';
20
20
  import * as ZonesActions from './actions/ZonesActions';
21
+ export const getDefaultTwoDimensionsPhaseCorrectionTraceOptions = () => {
22
+ const directions = [
23
+ 'horizontal',
24
+ 'vertical',
25
+ ];
26
+ const result = {};
27
+ for (const direction of directions) {
28
+ result[direction] = {
29
+ ph0: 0,
30
+ ph1: 0,
31
+ pivot: null,
32
+ spectra: [],
33
+ scaleRatio: 1,
34
+ };
35
+ }
36
+ return result;
37
+ };
21
38
  export function getDefaultViewState() {
22
39
  return {
23
40
  molecules: {},
@@ -93,22 +110,8 @@ export const getInitialState = () => ({
93
110
  apodizationOptions: {},
94
111
  twoDimensionPhaseCorrection: {
95
112
  activeTraceDirection: 'horizontal',
96
- traces: {
97
- horizontal: {
98
- ph0: 0,
99
- ph1: 0,
100
- pivot: null,
101
- spectra: [],
102
- scaleRatio: 1,
103
- },
104
- vertical: {
105
- ph0: 0,
106
- ph1: 0,
107
- pivot: null,
108
- spectra: [],
109
- scaleRatio: 1,
110
- },
111
- },
113
+ addTracesToBothDirections: true,
114
+ traces: getDefaultTwoDimensionsPhaseCorrectionTraceOptions(),
112
115
  },
113
116
  pivot: { value: 0, index: 0 },
114
117
  zonesNoiseFactor: 1,
@@ -230,6 +233,8 @@ function innerSpectrumReducer(draft, action) {
230
233
  return FiltersActions.handleAddPhaseCorrectionTrace(draft, action);
231
234
  case 'CHANGE_PHASE_CORRECTION_DIRECTION':
232
235
  return FiltersActions.handleChangePhaseCorrectionDirection(draft, action);
236
+ case 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS':
237
+ return FiltersActions.handleToggleAddTracesToBothDirections(draft);
233
238
  case 'DELETE_PHASE_CORRECTION_TRACE':
234
239
  return FiltersActions.handleDeletePhaseCorrectionTrace(draft, action);
235
240
  case 'SET_ONE_DIMENSION_PIVOT_POINT':
@@ -238,6 +243,8 @@ function innerSpectrumReducer(draft, action) {
238
243
  return FiltersActions.handleSetTwoDimensionPhaseCorrectionPivotPoint(draft, action);
239
244
  case 'CALCULATE_TOW_DIMENSIONS_MANUAL_PHASE_CORRECTION_FILTER':
240
245
  return FiltersActions.handleCalculateManualTwoDimensionPhaseCorrection(draft, action);
246
+ case 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER':
247
+ return FiltersActions.handleApplyManualTowDimensionsPhaseCorrectionFilter(draft);
241
248
  case 'CHANGE_SPECTRUM_VISIBILITY':
242
249
  return SpectrumsActions.handleChangeSpectrumVisibilityById(draft, action);
243
250
  case 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS':
@@ -26,10 +26,15 @@ type ZeroFillingFilterLiveAction = ActionType<'CALCULATE_ZERO_FILLING_FILTER', {
26
26
  };
27
27
  livePreview: boolean;
28
28
  }>;
29
- type ManualPhaseCorrectionFilterAction = ActionType<'APPLY_MANUAL_PHASE_CORRECTION_FILTER' | 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER' | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' | 'CALCULATE_TOW_DIMENSIONS_MANUAL_PHASE_CORRECTION_FILTER', {
29
+ type ManualPhaseCorrectionFilterAction = ActionType<'APPLY_MANUAL_PHASE_CORRECTION_FILTER' | 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER', {
30
30
  ph0: number;
31
31
  ph1: number;
32
32
  }>;
33
+ type ManualTwoDimensionsPhaseCorrectionFilterAction = ActionType<'CALCULATE_TOW_DIMENSIONS_MANUAL_PHASE_CORRECTION_FILTER', {
34
+ ph0: number;
35
+ ph1: number;
36
+ applyOn2D?: boolean;
37
+ }>;
33
38
  type BaselineCorrectionFilterOptions = Omit<BaselineCorrectionOptions, 'zones'>;
34
39
  interface BaselineCorrectionFilterProps {
35
40
  options: BaselineCorrectionFilterOptions;
@@ -81,7 +86,7 @@ type SetTwoDimensionPhaseCorrectionPivotPoint = ActionType<'SET_TWO_DIMENSION_PI
81
86
  x: number;
82
87
  y: number;
83
88
  }>;
84
- export type FiltersActions = ShiftSpectrumAlongXAxisAction | ApodizationFilterAction | ApodizationFilterLiveAction | ZeroFillingFilterAction | ZeroFillingFilterLiveAction | ManualPhaseCorrectionFilterAction | BaselineCorrectionFilterAction | BaselineCorrectionFilterLiveAction | EnableFilterAction | DeleteFilterAction | DeleteSpectraFilterAction | SetFilterSnapshotAction | AddExclusionZoneAction | DeleteExclusionZoneAction | ApplySignalProcessingAction | AddPhaseCorrectionTraceAction | ChangePhaseCorrectionDirectionAction | DeletePhaseCorrectionTrace | SetOneDimensionPhaseCorrectionPivotPoint | SetTwoDimensionPhaseCorrectionPivotPoint | ActionType<'APPLY_FFT_FILTER' | 'APPLY_FFT_DIMENSION_1_FILTER' | 'APPLY_FFT_DIMENSION_2_FILTER' | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' | 'APPLY_ABSOLUTE_FILTER'>;
89
+ export type FiltersActions = ShiftSpectrumAlongXAxisAction | ApodizationFilterAction | ApodizationFilterLiveAction | ZeroFillingFilterAction | ZeroFillingFilterLiveAction | ManualPhaseCorrectionFilterAction | BaselineCorrectionFilterAction | BaselineCorrectionFilterLiveAction | EnableFilterAction | DeleteFilterAction | DeleteSpectraFilterAction | SetFilterSnapshotAction | AddExclusionZoneAction | DeleteExclusionZoneAction | ApplySignalProcessingAction | AddPhaseCorrectionTraceAction | ChangePhaseCorrectionDirectionAction | DeletePhaseCorrectionTrace | SetOneDimensionPhaseCorrectionPivotPoint | SetTwoDimensionPhaseCorrectionPivotPoint | ManualTwoDimensionsPhaseCorrectionFilterAction | ActionType<'APPLY_FFT_FILTER' | 'APPLY_FFT_DIMENSION_1_FILTER' | 'APPLY_FFT_DIMENSION_2_FILTER' | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' | 'APPLY_ABSOLUTE_FILTER' | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' | 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS'>;
85
90
  export interface RollbackSpectrumByFilterOptions {
86
91
  applyFilter?: boolean;
87
92
  reset?: boolean;
@@ -106,6 +111,7 @@ declare function handleApplyFFtDimension1Filter(draft: Draft<State>): void;
106
111
  declare function handleApplyFFtDimension2Filter(draft: Draft<State>): void;
107
112
  declare function handleApplyManualPhaseCorrectionFilter(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
108
113
  declare function handleAddPhaseCorrectionTrace(draft: Draft<State>, action: AddPhaseCorrectionTraceAction): void;
114
+ declare function handleToggleAddTracesToBothDirections(draft: Draft<State>): void;
109
115
  declare function handleChangePhaseCorrectionDirection(draft: Draft<State>, action: ChangePhaseCorrectionDirectionAction): void;
110
116
  declare function handleDeletePhaseCorrectionTrace(draft: Draft<State>, action: DeletePhaseCorrectionTrace): void;
111
117
  declare function handleCalculateManualPhaseCorrection(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
@@ -123,5 +129,6 @@ declare function handleAddExclusionZone(draft: Draft<State>, action: AddExclusio
123
129
  declare function handleDeleteExclusionZone(draft: Draft<State>, action: DeleteExclusionZoneAction): void;
124
130
  declare function handleSetOneDimensionPhaseCorrectionPivotPoint(draft: Draft<State>, action: SetOneDimensionPhaseCorrectionPivotPoint): void;
125
131
  declare function handleSetTwoDimensionPhaseCorrectionPivotPoint(draft: Draft<State>, action: SetTwoDimensionPhaseCorrectionPivotPoint): void;
126
- declare function handleCalculateManualTwoDimensionPhaseCorrection(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
127
- export { handleShiftSpectrumAlongXAxis, handleApplyZeroFillingFilter, handleApplyApodizationFilter, handleApplyFFTFilter, handleApplyFFtDimension1Filter, handleApplyFFtDimension2Filter, handleApplyManualPhaseCorrectionFilter, handleApplyAutoPhaseCorrectionFilter, handleApplyAbsoluteFilter, handleCalculateManualPhaseCorrection, calculateBaseLineCorrection, handleCalculateBaseLineCorrection, handleCalculateApodizationFilter, handleCalculateZeroFillingFilter, handleEnableFilter, handleDeleteFilter, handleDeleteSpectraFilter, handleBaseLineCorrectionFilter, handleSetFilterSnapshotHandler, handleAddExclusionZone, handleDeleteExclusionZone, handleSignalProcessingFilter, rollbackSpectrum, rollbackSpectrumByFilter, handleAddPhaseCorrectionTrace, handleChangePhaseCorrectionDirection, handleDeletePhaseCorrectionTrace, handleSetOneDimensionPhaseCorrectionPivotPoint, handleSetTwoDimensionPhaseCorrectionPivotPoint, handleCalculateManualTwoDimensionPhaseCorrection, };
132
+ declare function handleCalculateManualTwoDimensionPhaseCorrection(draft: Draft<State>, action: ManualTwoDimensionsPhaseCorrectionFilterAction): void;
133
+ declare function handleApplyManualTowDimensionsPhaseCorrectionFilter(draft: Draft<State>): void;
134
+ export { handleShiftSpectrumAlongXAxis, handleApplyZeroFillingFilter, handleApplyApodizationFilter, handleApplyFFTFilter, handleApplyFFtDimension1Filter, handleApplyFFtDimension2Filter, handleApplyManualPhaseCorrectionFilter, handleApplyManualTowDimensionsPhaseCorrectionFilter, handleApplyAutoPhaseCorrectionFilter, handleApplyAbsoluteFilter, handleCalculateManualPhaseCorrection, calculateBaseLineCorrection, handleCalculateBaseLineCorrection, handleCalculateApodizationFilter, handleCalculateZeroFillingFilter, handleEnableFilter, handleDeleteFilter, handleDeleteSpectraFilter, handleBaseLineCorrectionFilter, handleSetFilterSnapshotHandler, handleAddExclusionZone, handleDeleteExclusionZone, handleSignalProcessingFilter, rollbackSpectrum, rollbackSpectrumByFilter, handleAddPhaseCorrectionTrace, handleChangePhaseCorrectionDirection, handleDeletePhaseCorrectionTrace, handleSetOneDimensionPhaseCorrectionPivotPoint, handleSetTwoDimensionPhaseCorrectionPivotPoint, handleCalculateManualTwoDimensionPhaseCorrection, handleToggleAddTracesToBothDirections, };