nmrium 0.36.0 → 0.38.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 (411) hide show
  1. package/lib/component/1d/FooterBanner.js +1 -1
  2. package/lib/component/1d/Viewer1D.js +26 -21
  3. package/lib/component/1d/integral/Integral.d.ts +2 -6
  4. package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
  5. package/lib/component/1d/integral/IntegralResizable.js +2 -3
  6. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  7. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  8. package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
  9. package/lib/component/1d/ranges/Range.js +9 -8
  10. package/lib/component/1d/ranges/Ranges.js +5 -7
  11. package/lib/component/1d/tool/BaseLineZones.js +1 -2
  12. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  13. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  14. package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
  15. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  16. package/lib/component/2d/Chart2D.js +1 -1
  17. package/lib/component/2d/Viewer2D.js +10 -9
  18. package/lib/component/2d/fid/FidCanvas.js +4 -6
  19. package/lib/component/2d/ft/Contours.js +1 -7
  20. package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
  21. package/lib/component/2d/utilities/scale.d.ts +2 -1
  22. package/lib/component/2d/utilities/scale.js +1 -1
  23. package/lib/component/2d/zones/Zones.js +1 -1
  24. package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
  25. package/lib/component/NMRium.d.ts +2 -0
  26. package/lib/component/NMRium.js +22 -15
  27. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  28. package/lib/component/context/DispatchContext.d.ts +23 -3
  29. package/lib/component/context/DispatchContext.js +1 -1
  30. package/lib/component/context/LoggerContext.js +1 -1
  31. package/lib/component/elements/Button.js +7 -9
  32. package/lib/component/elements/IsotopesViewer.js +1 -1
  33. package/lib/component/elements/ReactTable/ReactTable.js +1 -2
  34. package/lib/component/elements/RemoveAssignmentsButton.d.ts +4 -0
  35. package/lib/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +14 -1
  36. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  37. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  38. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  39. package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
  40. package/lib/component/elements/formik/FormikInput.js +1 -1
  41. package/lib/component/elements/formik/FormikSelect.js +2 -2
  42. package/lib/component/elements/formik/FormikSlider.js +1 -1
  43. package/lib/component/elements/formik/FormikTextarea.js +2 -2
  44. package/lib/component/header/ApodizationOptionsPanel.js +4 -5
  45. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
  46. package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
  47. package/lib/component/header/Header.js +5 -7
  48. package/lib/component/header/PhaseCorrectionPanel.js +7 -8
  49. package/lib/component/header/RangesPickingOptionPanel.js +1 -2
  50. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
  51. package/lib/component/header/Zones2DOptionPanel.js +5 -6
  52. package/lib/component/hooks/useExport.js +1 -0
  53. package/lib/component/hooks/useToolsFunctions.js +8 -10
  54. package/lib/component/loader/DropZone.js +4 -5
  55. package/lib/component/loader/NoData.js +1 -1
  56. package/lib/component/modal/AboutPredictionModal.d.ts +2 -0
  57. package/lib/component/modal/AboutPredictionModal.js +49 -0
  58. package/lib/component/modal/AlignSpectraModal.js +1 -2
  59. package/lib/component/modal/EditPeakShapeModal.js +1 -2
  60. package/lib/component/modal/ImportPublicationStringModal.js +1 -2
  61. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  62. package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
  63. package/lib/component/modal/PredictSpectraModal.js +24 -21
  64. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  65. package/lib/component/modal/editRange/EditRangeModal.js +3 -4
  66. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  67. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  68. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
  69. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  70. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  71. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  72. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  73. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  74. package/lib/component/panels/InformationPanel.js +6 -6
  75. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  76. package/lib/component/panels/IntegralsPanel/IntegralTable.js +27 -23
  77. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
  78. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  79. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  80. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  81. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  82. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  83. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -0
  84. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  85. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
  86. package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
  87. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  88. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  89. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  90. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  91. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  92. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  93. package/lib/component/panels/Panels.js +1 -1
  94. package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  95. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
  96. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
  97. package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
  98. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +0 -1
  99. package/lib/component/panels/RangesPanel/RangesTableRow.js +0 -11
  100. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
  101. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  102. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
  103. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  104. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  105. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  106. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  107. package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
  108. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  109. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  110. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  111. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
  112. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  113. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  114. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  115. package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  116. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  117. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -21
  118. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  119. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +4 -5
  120. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -16
  121. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +3 -7
  122. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
  123. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  124. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  125. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +4 -5
  126. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -19
  127. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +3 -7
  128. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
  129. package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  130. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
  131. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
  132. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -22
  133. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
  134. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
  135. package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
  136. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
  137. package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
  138. package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
  139. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  140. package/lib/component/panels/predictionPanel/PredictionPanel.js +10 -6
  141. package/lib/component/reducer/IgnoreActions.d.ts +2 -1
  142. package/lib/component/reducer/IgnoreActions.js +35 -32
  143. package/lib/component/reducer/Reducer.d.ts +8 -5
  144. package/lib/component/reducer/Reducer.js +199 -221
  145. package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
  146. package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
  147. package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
  148. package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
  149. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
  150. package/lib/component/reducer/actions/DatabaseActions.js +5 -2
  151. package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
  152. package/lib/component/reducer/actions/DimensionsActions.js +3 -5
  153. package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
  154. package/lib/component/reducer/actions/DomainActions.js +13 -19
  155. package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
  156. package/lib/component/reducer/actions/FiltersActions.js +250 -255
  157. package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
  158. package/lib/component/reducer/actions/GlobalActions.js +3 -3
  159. package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
  160. package/lib/component/reducer/actions/IntegralsActions.js +16 -15
  161. package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
  162. package/lib/component/reducer/actions/LoadActions.js +65 -57
  163. package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
  164. package/lib/component/reducer/actions/MoleculeActions.js +53 -20
  165. package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
  166. package/lib/component/reducer/actions/PeaksActions.js +19 -11
  167. package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
  168. package/lib/component/reducer/actions/PreferencesActions.js +22 -7
  169. package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
  170. package/lib/component/reducer/actions/RangesActions.js +80 -65
  171. package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
  172. package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
  173. package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
  174. package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
  175. package/lib/component/reducer/actions/ToolsActions.js +54 -32
  176. package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
  177. package/lib/component/reducer/actions/ZonesActions.js +68 -49
  178. package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
  179. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  180. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
  181. package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
  182. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
  183. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  184. package/lib/component/reducer/types/ActionType.d.ts +6 -0
  185. package/lib/component/reducer/types/ActionType.js +1 -0
  186. package/lib/component/toolbar/BasicToolBar.js +6 -9
  187. package/lib/component/toolbar/FunctionToolBar.js +4 -9
  188. package/lib/component/toolbar/ToolBar.js +1 -1
  189. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  190. package/lib/component/utility/Events.d.ts +4 -4
  191. package/lib/component/utility/Events.js +2 -2
  192. package/lib/component/utility/GroupByInfoKey.js +1 -1
  193. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  194. package/lib/component/workspaces/Workspace.d.ts +2 -1
  195. package/lib/component/workspaces/exercise.js +31 -0
  196. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  197. package/lib/data/PredictionManager.d.ts +5 -8
  198. package/lib/data/PredictionManager.js +3 -3
  199. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  200. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  201. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
  202. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  203. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
  204. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
  205. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
  206. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
  207. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  208. package/lib/data/data2d/Processing2D.d.ts +3 -3
  209. package/lib/data/data2d/Spectrum2D/contours.d.ts +1 -4
  210. package/lib/data/data2d/Spectrum2D/contours.js +0 -1
  211. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  212. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
  213. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  214. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
  215. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
  216. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
  217. package/lib/data/matrixGeneration.js +4 -2
  218. package/lib/data/molecules/Molecule.d.ts +3 -3
  219. package/lib/data/molecules/MoleculeManager.d.ts +5 -5
  220. package/lib/data/molecules/MoleculeManager.js +1 -1
  221. package/lib/data/utilities/ZoneUtilities.js +0 -1
  222. package/lib/data/utilities/generateColor.js +1 -1
  223. package/lib/data/utilities/isNumber.d.ts +1 -0
  224. package/lib/data/utilities/isNumber.js +3 -0
  225. package/lib/types/NMRiumGeneralPreferences.d.ts +1 -0
  226. package/lib/versionInfo.js +1 -1
  227. package/lib-cjs/component/1d/FooterBanner.js +1 -1
  228. package/lib-cjs/component/1d/Viewer1D.js +25 -20
  229. package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
  230. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  231. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  232. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
  233. package/lib-cjs/component/1d/ranges/Range.js +9 -8
  234. package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
  235. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
  236. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  237. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  238. package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
  239. package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  240. package/lib-cjs/component/2d/Chart2D.js +1 -1
  241. package/lib-cjs/component/2d/Viewer2D.js +10 -9
  242. package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
  243. package/lib-cjs/component/2d/ft/Contours.js +1 -7
  244. package/lib-cjs/component/2d/utilities/scale.js +1 -1
  245. package/lib-cjs/component/2d/zones/Zones.js +1 -1
  246. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
  247. package/lib-cjs/component/NMRium.js +19 -12
  248. package/lib-cjs/component/context/DispatchContext.js +1 -1
  249. package/lib-cjs/component/context/LoggerContext.js +1 -1
  250. package/lib-cjs/component/elements/Button.js +7 -9
  251. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  252. package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
  253. package/lib-cjs/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +15 -2
  254. package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
  255. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  256. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  257. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  258. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
  259. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  260. package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
  261. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  262. package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
  263. package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
  264. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
  265. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
  266. package/lib-cjs/component/header/Header.js +5 -7
  267. package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
  268. package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
  269. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
  270. package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
  271. package/lib-cjs/component/highlight/index.js +1 -1
  272. package/lib-cjs/component/hooks/useExport.js +1 -0
  273. package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
  274. package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
  275. package/lib-cjs/component/hooks/useXYReduce.js +1 -1
  276. package/lib-cjs/component/loader/DropZone.js +4 -5
  277. package/lib-cjs/component/loader/NoData.js +1 -1
  278. package/lib-cjs/component/modal/AboutPredictionModal.js +54 -0
  279. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  280. package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
  281. package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
  282. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
  283. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
  284. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
  285. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  286. package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
  287. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  288. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  289. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
  290. package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  291. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  292. package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  293. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  294. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  295. package/lib-cjs/component/panels/InformationPanel.js +6 -6
  296. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  297. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +27 -23
  298. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -4
  299. package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  300. package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  301. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  302. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  303. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  304. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  305. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
  306. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  307. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  308. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  309. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  310. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  311. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  312. package/lib-cjs/component/panels/Panels.js +1 -1
  313. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  314. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
  315. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
  316. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
  317. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +0 -12
  318. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
  319. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  320. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
  321. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  322. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  323. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  324. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
  325. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  326. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  327. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  328. package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
  329. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  330. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  331. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  332. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  333. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  334. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  335. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -19
  336. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
  337. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  338. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -22
  339. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
  340. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  341. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
  342. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -21
  343. package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
  344. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
  345. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
  346. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
  347. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
  348. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  349. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +10 -6
  350. package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
  351. package/lib-cjs/component/reducer/Reducer.js +199 -221
  352. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
  353. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
  354. package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
  355. package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
  356. package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
  357. package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
  358. package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
  359. package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
  360. package/lib-cjs/component/reducer/actions/LoadActions.js +68 -60
  361. package/lib-cjs/component/reducer/actions/MoleculeActions.js +56 -23
  362. package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
  363. package/lib-cjs/component/reducer/actions/PreferencesActions.js +24 -9
  364. package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
  365. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
  366. package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
  367. package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
  368. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  369. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
  370. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
  371. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
  372. package/lib-cjs/component/reducer/types/ActionType.js +2 -0
  373. package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
  374. package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
  375. package/lib-cjs/component/toolbar/ToolBar.js +1 -1
  376. package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
  377. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  378. package/lib-cjs/component/workspaces/exercise.js +31 -0
  379. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
  380. package/lib-cjs/data/PredictionManager.js +3 -3
  381. package/lib-cjs/data/SpectraManager.js +1 -1
  382. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  383. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  384. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  385. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
  386. package/lib-cjs/data/data2d/Spectrum2D/contours.js +0 -1
  387. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  388. package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  389. package/lib-cjs/data/matrixGeneration.js +4 -2
  390. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  391. package/lib-cjs/data/utilities/ZoneUtilities.js +0 -1
  392. package/lib-cjs/data/utilities/generateColor.js +1 -1
  393. package/lib-cjs/data/utilities/isNumber.js +7 -0
  394. package/lib-cjs/versionInfo.js +1 -1
  395. package/package.json +35 -34
  396. package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +0 -3
  397. package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
  398. package/lib/component/reducer/actions/HistoryActions.js +0 -40
  399. package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
  400. package/lib/component/reducer/types/HistoryTypes.js +0 -4
  401. package/lib/component/reducer/types/Types.d.ts +0 -132
  402. package/lib/component/reducer/types/Types.js +0 -126
  403. package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
  404. package/lib/component/toolbar/HistoryToolBar.js +0 -30
  405. package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
  406. package/lib/data/utilities/isMolFileEmpty.js +0 -6
  407. package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
  408. package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
  409. package/lib-cjs/component/reducer/types/Types.js +0 -131
  410. package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
  411. package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
@@ -2,8 +2,8 @@ import { original } from 'immer';
2
2
  import lodashCloneDeep from 'lodash/cloneDeep';
3
3
  import { buildCorrelationData, setCorrelation, } from 'nmr-correlation';
4
4
  import { findRange, findSignal1D, findSignal2D, findSpectrum, findZone, } from '../../../data/utilities/FindUtilities';
5
- import { handleDeleteSignal as handleDeleteSignal1D } from './RangesActions';
6
- import { handleDeleteSignal as handleDeleteSignal2D } from './ZonesActions';
5
+ import { deleteSignal1D } from './RangesActions';
6
+ import { deleteSignal2D } from './ZonesActions';
7
7
  function handleUpdateCorrelations(draft) {
8
8
  const { data: spectra, correlations } = draft;
9
9
  draft.correlations = buildCorrelationData(spectra, {
@@ -11,10 +11,11 @@ function handleUpdateCorrelations(draft) {
11
11
  values: lodashCloneDeep(correlations.values),
12
12
  });
13
13
  }
14
- function handleSetMF(draft, payload) {
14
+ //action
15
+ function handleSetMF(draft, action) {
15
16
  const state = original(draft);
16
17
  const { data: spectra, correlations } = state;
17
- const { mf } = payload;
18
+ const { mf } = action.payload;
18
19
  // update of correlation data is needed only if the following is true
19
20
  if (correlations.options.mf === '' || correlations.options.mf !== mf) {
20
21
  draft.correlations = buildCorrelationData(spectra, {
@@ -24,20 +25,22 @@ function handleSetMF(draft, payload) {
24
25
  });
25
26
  }
26
27
  }
27
- function handleSetTolerance(draft, payload) {
28
+ //action
29
+ function handleSetTolerance(draft, action) {
28
30
  const state = original(draft);
29
31
  const { data: spectra, correlations } = state;
30
- const { tolerance } = payload;
32
+ const { tolerance } = action.payload;
31
33
  draft.correlations = buildCorrelationData(spectra, {
32
34
  ...correlations.options,
33
35
  tolerance,
34
36
  values: lodashCloneDeep(correlations.values),
35
37
  });
36
38
  }
37
- function handleSetCorrelation(draft, payload) {
39
+ //action
40
+ function handleSetCorrelation(draft, action) {
38
41
  const state = original(draft);
39
42
  const { correlations } = state;
40
- const { id, correlation, options } = payload;
43
+ const { id, correlation, options } = action.payload;
41
44
  draft.correlations = setCorrelation(correlations, id, correlation);
42
45
  if (options) {
43
46
  draft.correlations = {
@@ -47,8 +50,9 @@ function handleSetCorrelation(draft, payload) {
47
50
  }
48
51
  handleUpdateCorrelations(draft);
49
52
  }
50
- function handleSetCorrelations(draft, payload) {
51
- const { correlations, options } = payload;
53
+ //action
54
+ function handleSetCorrelations(draft, action) {
55
+ const { correlations, options } = action.payload;
52
56
  const state = original(draft);
53
57
  let correlationsData = lodashCloneDeep(state.correlations);
54
58
  for (const correlation of correlations) {
@@ -63,8 +67,9 @@ function handleSetCorrelations(draft, payload) {
63
67
  }
64
68
  handleUpdateCorrelations(draft);
65
69
  }
66
- function handleDeleteCorrelation(draft, payload) {
67
- const { correlation, assignmentData } = payload;
70
+ //action
71
+ function handleDeleteCorrelation(draft, action) {
72
+ const { correlation, assignmentData } = action.payload;
68
73
  // delete all signals linked to the correlation
69
74
  for (const link of correlation.links) {
70
75
  const spectrum = findSpectrum(draft.data, link.experimentID, false);
@@ -72,26 +77,26 @@ function handleDeleteCorrelation(draft, payload) {
72
77
  if (spectrum.info.dimension === 1) {
73
78
  const range = findRange(spectrum, link.signal.id);
74
79
  const signal = findSignal1D(spectrum, link.signal.id);
75
- handleDeleteSignal1D(draft, {
76
- payload: {
80
+ if (range && signal) {
81
+ deleteSignal1D(draft, {
77
82
  spectrum,
78
83
  range,
79
84
  signal,
80
85
  assignmentData,
81
- },
82
- });
86
+ });
87
+ }
83
88
  }
84
89
  else if (spectrum.info.dimension === 2) {
85
90
  const zone = findZone(spectrum, link.signal.id);
86
91
  const signal = findSignal2D(spectrum, link.signal.id);
87
- handleDeleteSignal2D(draft, {
88
- payload: {
92
+ if (zone && signal) {
93
+ deleteSignal2D(draft, {
89
94
  spectrum,
90
95
  zone,
91
96
  signal,
92
97
  assignmentData,
93
- },
94
- });
98
+ });
99
+ }
95
100
  }
96
101
  }
97
102
  }
@@ -1,5 +1,18 @@
1
1
  import { Draft } from 'immer';
2
+ import { Spectrum1D } from 'nmr-load-save';
3
+ import { NMRRange } from 'nmr-processing';
4
+ import { ResurrectSpectrumInfo } from '../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges';
2
5
  import { State } from '../Reducer';
3
- declare function handleResurrectSpectrumFromJcamp(draft: Draft<State>, action: any): void;
4
- declare function handleResurrectSpectrumFromRanges(draft: Draft<State>, action: any): void;
6
+ import { ActionType } from '../types/ActionType';
7
+ type ResurrectSpectrumFromJcampAction = ActionType<'RESURRECTING_SPECTRUM_FROM_JCAMP', {
8
+ ranges: NMRRange[];
9
+ spectrum: Spectrum1D;
10
+ }>;
11
+ type ResurrectSpectrumFromRangesAction = ActionType<'RESURRECTING_SPECTRUM_FROM_RANGES', {
12
+ ranges: NMRRange[];
13
+ info: ResurrectSpectrumInfo;
14
+ }>;
15
+ export type DatabaseActions = ResurrectSpectrumFromJcampAction | ResurrectSpectrumFromRangesAction;
16
+ declare function handleResurrectSpectrumFromJcamp(draft: Draft<State>, action: ResurrectSpectrumFromJcampAction): void;
17
+ declare function handleResurrectSpectrumFromRanges(draft: Draft<State>, action: ResurrectSpectrumFromRangesAction): void;
5
18
  export { handleResurrectSpectrumFromRanges, handleResurrectSpectrumFromJcamp };
@@ -1,12 +1,15 @@
1
1
  import { get1DColor, mapRanges } from '../../../data/data1d/Spectrum1D';
2
- import { generateSpectrumFromRanges } from '../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges';
2
+ import { generateSpectrumFromRanges, } from '../../../data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges';
3
3
  import { setZoom } from '../helper/Zoom1DManager';
4
4
  import { setDomain, setIntegralsYDomain } from './DomainActions';
5
5
  function handleResurrectSpectrumFromJcamp(draft, action) {
6
6
  let { ranges, spectrum } = action.payload;
7
7
  spectrum = {
8
8
  ...spectrum,
9
- ranges: { ...spectrum.ranges, values: mapRanges(ranges, spectrum) },
9
+ ranges: {
10
+ ...spectrum.ranges,
11
+ values: mapRanges(ranges, spectrum),
12
+ },
10
13
  display: {
11
14
  ...spectrum.display,
12
15
  ...get1DColor(spectrum.display, draft.usedColors),
@@ -1,5 +1,10 @@
1
1
  import { Draft } from 'immer';
2
2
  import { State } from '../Reducer';
3
- declare function setWidth(draft: Draft<State>, width: any): void;
4
- declare function handleSetDimensions(draft: Draft<State>, width: any, height: any): void;
5
- export { setWidth, handleSetDimensions };
3
+ import { ActionType } from '../types/ActionType';
4
+ type SetDimensionsAction = ActionType<'SET_DIMENSIONS', {
5
+ width: number;
6
+ height: number;
7
+ }>;
8
+ export type DimensionsActions = SetDimensionsAction;
9
+ declare function handleSetDimensions(draft: Draft<State>, action: SetDimensionsAction): void;
10
+ export { handleSetDimensions };
@@ -1,8 +1,6 @@
1
- function setWidth(draft, width) {
2
- draft.width = width;
3
- }
4
- function handleSetDimensions(draft, width, height) {
1
+ function handleSetDimensions(draft, action) {
2
+ const { width, height } = action.payload;
5
3
  draft.width = width;
6
4
  draft.height = height;
7
5
  }
8
- export { setWidth, handleSetDimensions };
6
+ export { handleSetDimensions };
@@ -1,6 +1,14 @@
1
1
  import { Draft } from 'immer';
2
2
  import { Spectrum1D } from 'nmr-load-save';
3
3
  import { State } from '../Reducer';
4
+ import { ActionType } from '../types/ActionType';
5
+ type SetXDomainAction = ActionType<'SET_X_DOMAIN', {
6
+ xDomain: [number, number];
7
+ }>;
8
+ type SetYDomainAction = ActionType<'SET_Y_DOMAIN', {
9
+ yDomain: [number, number];
10
+ }>;
11
+ export type DomainActions = SetXDomainAction | SetYDomainAction;
4
12
  declare function getDomain(draft: Draft<State>): {
5
13
  xDomain: [number, number] | [undefined, undefined];
6
14
  yDomain: [number, number] | [undefined, undefined];
@@ -14,9 +22,7 @@ export interface SetDomainOptions {
14
22
  }
15
23
  declare function setDomain(draft: Draft<State>, options?: SetDomainOptions): void;
16
24
  declare function setIntegralsYDomain(draft: Draft<State>, data: Spectrum1D[] | Spectrum1D): void;
17
- declare function setOriginalDomain(draft: Draft<State>, originDomain: any): void;
18
- declare function setXDomain(draft: Draft<State>, xDomain: any): void;
19
- declare function setYDomain(draft: Draft<State>, yDomain: any): void;
20
- declare function handelResetDomain(draft: Draft<State>): void;
21
25
  declare function setMode(draft: Draft<State>): void;
22
- export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, setIntegralsYDomain, };
26
+ declare function handleSetXDomain(draft: Draft<State>, action: SetXDomainAction): void;
27
+ declare function handleSetYDomain(draft: Draft<State>, action: SetYDomainAction): void;
28
+ export { getDomain, setDomain, setMode, setIntegralsYDomain, handleSetXDomain, handleSetYDomain, };
@@ -32,7 +32,7 @@ function getDomain(draft) {
32
32
  const { display, data, id } = d;
33
33
  const { y } = get1DDataXY(d);
34
34
  const _extent = extent(y);
35
- const domain = [data.x[0], data.x[data.x.length - 1]];
35
+ const domain = [data.x[0], data.x.at(-1)];
36
36
  yDomains[id] = _extent;
37
37
  xDomains[id] = domain;
38
38
  if (display.isVisible) {
@@ -101,7 +101,7 @@ function get2DDomain(state) {
101
101
  try {
102
102
  for (const d of filteredData) {
103
103
  const { x, re } = d.data;
104
- const domain = [x[0], x[x.length - 1]];
104
+ const domain = [x[0], x.at(-1)];
105
105
  xDomains[d.id] = domain;
106
106
  const _extent = extent(re);
107
107
  yDomains[d.id] = _extent;
@@ -176,25 +176,19 @@ function setIntegralsYDomain(draft, data) {
176
176
  }
177
177
  }
178
178
  }
179
- function setOriginalDomain(draft, originDomain) {
180
- draft.originDomain = originDomain;
181
- }
182
- function setXDomain(draft, xDomain) {
183
- draft.xDomain = xDomain;
184
- }
185
- function setYDomain(draft, yDomain) {
186
- draft.yDomain = yDomain;
187
- }
188
- function handelResetDomain(draft) {
189
- const { xDomain, yDomain, xDomains, yDomains } = draft.originDomain;
190
- draft.xDomain = xDomain;
191
- draft.yDomain = yDomain;
192
- draft.xDomains = xDomains;
193
- draft.yDomains = yDomains;
194
- }
195
179
  function setMode(draft) {
196
180
  const datum_ = draft.data.find((datum) => draft.xDomains[datum.id] &&
197
181
  nucleusToString(datum.info.nucleus) === draft.view.spectra.activeTab);
198
182
  draft.mode = datum_?.info.isFid ? 'LTR' : 'RTL';
199
183
  }
200
- export { getDomain, setOriginalDomain, setXDomain, setYDomain, handelResetDomain, setDomain, setMode, setIntegralsYDomain, };
184
+ //action
185
+ function handleSetXDomain(draft, action) {
186
+ const xDomain = action.payload.xDomain;
187
+ draft.xDomain = xDomain;
188
+ }
189
+ //action
190
+ function handleSetYDomain(draft, action) {
191
+ const yDomain = action.payload.yDomain;
192
+ draft.yDomain = yDomain;
193
+ }
194
+ export { getDomain, setDomain, setMode, setIntegralsYDomain, handleSetXDomain, handleSetYDomain, };
@@ -1,37 +1,84 @@
1
1
  import { Draft } from 'immer';
2
+ import { ApodizationOptions } from '../../../data/data1d/filter1d/apodization';
3
+ import { BaselineCorrectionOptions } from '../../../data/data1d/filter1d/baselineCorrection';
4
+ import { ExclusionZone } from '../../../data/types/data1d/ExclusionZone';
5
+ import { MatrixOptions } from '../../../data/types/data1d/MatrixOptions';
2
6
  import { ActiveSpectrum, State } from '../Reducer';
3
- declare function shiftSpectrumAlongXAxis(draft: Draft<State>, shift: any): void;
4
- declare function applyZeroFillingFilter(draft: Draft<State>, action: any): void;
5
- declare function calculateApodizationFilter(draft: Draft<State>, action: any): void;
6
- declare function applyApodizationFilter(draft: Draft<State>, action: any): void;
7
- declare function calculateZeroFillingFilter(draft: Draft<State>, action: any): void;
8
- declare function applyFFTFilter(draft: Draft<State>): void;
9
- declare function applyManualPhaseCorrectionFilter(draft: Draft<State>, filterOptions: any): void;
10
- declare function applyAbsoluteFilter(draft: Draft<State>): void;
11
- declare function applyAutoPhaseCorrectionFilter(draft: Draft<State>): void;
12
- declare function calculateBaseLineCorrection(draft: Draft<State>, action?: any): void;
13
- declare function calculateManualPhaseCorrection(draft: Draft<State>, filterOptions: any): void;
14
- declare function enableFilter(draft: Draft<State>, filterID: any, checked: any): void;
15
- declare function deleteFilter(draft: Draft<State>, actions: any): void;
16
- declare function deleteSpectraFilter(draft: Draft<State>, actions: any): void;
17
- declare function handleBaseLineCorrectionFilter(draft: Draft<State>, action: any): void;
18
- declare function rollbackSpectrumByFilter(draft: Draft<State>, options?: {
7
+ import { ActionType } from '../types/ActionType';
8
+ type ShiftSpectrumAlongXAxisAction = ActionType<'SHIFT_SPECTRUM', {
9
+ shift: number;
10
+ }>;
11
+ type ApodizationFilterAction = ActionType<'APPLY_APODIZATION_FILTER' | 'CALCULATE_APODIZATION_FILTER', ApodizationOptions>;
12
+ type ZeroFillingFilterAction = ActionType<'APPLY_ZERO_FILLING_FILTER' | 'CALCULATE_ZERO_FILLING_FILTER', {
13
+ nbPoints: number;
14
+ }>;
15
+ type ManualPhaseCorrectionFilterAction = ActionType<'APPLY_MANUAL_PHASE_CORRECTION_FILTER' | 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER', {
16
+ ph0: number;
17
+ ph1: number;
18
+ }>;
19
+ type BaselineCorrectionFilterProps = Omit<BaselineCorrectionOptions, 'zones'> & {
20
+ livePreview: boolean;
21
+ };
22
+ type BaselineCorrectionFilterAction = ActionType<'APPLY_BASE_LINE_CORRECTION_FILTER' | 'CALCULATE_BASE_LINE_CORRECTION_FILTER', BaselineCorrectionFilterProps>;
23
+ type EnableFilterAction = ActionType<'ENABLE_FILTER', {
24
+ id: string;
25
+ enabled: boolean;
26
+ }>;
27
+ type DeleteFilterAction = ActionType<'DELETE_FILTER', {
28
+ id?: string;
29
+ }>;
30
+ type DeleteSpectraFilterAction = ActionType<'DELETE_SPECTRA_FILTER', {
31
+ filterName: string;
32
+ }>;
33
+ type SetFilterSnapshotAction = ActionType<'SET_FILTER_SNAPSHOT', {
34
+ name: string;
35
+ id: string;
36
+ }>;
37
+ type AddExclusionZoneAction = ActionType<'ADD_EXCLUSION_ZONE', {
38
+ startX: number;
39
+ endX: number;
40
+ }>;
41
+ type DeleteExclusionZoneAction = ActionType<'DELETE_EXCLUSION_ZONE', {
42
+ zone: ExclusionZone;
43
+ spectrumId?: string;
44
+ }>;
45
+ type ApplySignalProcessingAction = ActionType<'APPLY_SIGNAL_PROCESSING_FILTER', {
46
+ options: MatrixOptions;
47
+ }>;
48
+ export type FiltersActions = ShiftSpectrumAlongXAxisAction | ApodizationFilterAction | ZeroFillingFilterAction | ManualPhaseCorrectionFilterAction | BaselineCorrectionFilterAction | EnableFilterAction | DeleteFilterAction | DeleteSpectraFilterAction | SetFilterSnapshotAction | AddExclusionZoneAction | DeleteExclusionZoneAction | ApplySignalProcessingAction | ActionType<'APPLY_FFT_FILTER' | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' | 'APPLY_ABSOLUTE_FILTER'>;
49
+ interface RollbackSpectrumByFilterOptions {
19
50
  applyFilter?: boolean;
20
51
  reset?: boolean;
21
52
  searchBy?: 'id' | 'name';
22
53
  key?: string | null;
23
54
  activeSpectrum?: ActiveSpectrum | null;
24
55
  triggerSource?: 'Apply' | 'none';
25
- }): void;
26
- declare function filterSnapshotHandler(draft: Draft<State>, action: any): void;
27
- declare function handleMultipleSpectraFilter(draft: Draft<State>, action: any): void;
28
- declare function handleSignalProcessingFilter(draft: Draft<State>, action: any): void;
29
- declare function handleAddExclusionZone(draft: Draft<State>, action: any): void;
30
- declare function handleDeleteExclusionZone(draft: Draft<State>, action: any): void;
56
+ }
57
+ declare function rollbackSpectrumByFilter(draft: Draft<State>, options?: RollbackSpectrumByFilterOptions): void;
31
58
  interface RollbackSpectrumOptions {
32
59
  updateFilterViewOptions?: boolean;
33
60
  filterKey: string;
34
61
  reset?: boolean;
35
62
  }
36
63
  declare function rollbackSpectrum(draft: Draft<State>, options: RollbackSpectrumOptions): void;
37
- export { shiftSpectrumAlongXAxis, applyZeroFillingFilter, applyApodizationFilter, applyFFTFilter, applyManualPhaseCorrectionFilter, applyAutoPhaseCorrectionFilter, applyAbsoluteFilter, calculateManualPhaseCorrection, calculateBaseLineCorrection, calculateApodizationFilter, calculateZeroFillingFilter, handleMultipleSpectraFilter, enableFilter, deleteFilter, deleteSpectraFilter, handleBaseLineCorrectionFilter, filterSnapshotHandler, rollbackSpectrumByFilter, handleAddExclusionZone, handleDeleteExclusionZone, rollbackSpectrum, handleSignalProcessingFilter, };
64
+ declare function handleShiftSpectrumAlongXAxis(draft: Draft<State>, action: ShiftSpectrumAlongXAxisAction): void;
65
+ declare function handleApplyZeroFillingFilter(draft: Draft<State>, action: ZeroFillingFilterAction): void;
66
+ declare function handleCalculateZeroFillingFilter(draft: Draft<State>, action: ZeroFillingFilterAction): void;
67
+ declare function handleCalculateApodizationFilter(draft: Draft<State>, action: ApodizationFilterAction): void;
68
+ declare function handleApplyApodizationFilter(draft: Draft<State>, action: ApodizationFilterAction): void;
69
+ declare function handleApplyFFTFilter(draft: Draft<State>): void;
70
+ declare function handleApplyManualPhaseCorrectionFilter(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
71
+ declare function handleCalculateManualPhaseCorrection(draft: Draft<State>, action: ManualPhaseCorrectionFilterAction): void;
72
+ declare function handleApplyAbsoluteFilter(draft: Draft<State>): void;
73
+ declare function handleApplyAutoPhaseCorrectionFilter(draft: Draft<State>): void;
74
+ declare function handleBaseLineCorrectionFilter(draft: Draft<State>, action: BaselineCorrectionFilterAction): void;
75
+ declare function calculateBaseLineCorrection(draft: Draft<State>, baseLineOptions?: BaselineCorrectionFilterProps): void;
76
+ declare function handleCalculateBaseLineCorrection(draft: Draft<State>, action: BaselineCorrectionFilterAction): void;
77
+ declare function handleEnableFilter(draft: Draft<State>, action: EnableFilterAction): void;
78
+ declare function handleDeleteFilter(draft: Draft<State>, action: DeleteFilterAction): void;
79
+ declare function handleDeleteSpectraFilter(draft: Draft<State>, action: DeleteSpectraFilterAction): void;
80
+ declare function handleSetFilterSnapshotHandler(draft: Draft<State>, action: SetFilterSnapshotAction): void;
81
+ declare function handleSignalProcessingFilter(draft: Draft<State>, action: ApplySignalProcessingAction): void;
82
+ declare function handleAddExclusionZone(draft: Draft<State>, action: AddExclusionZoneAction): void;
83
+ declare function handleDeleteExclusionZone(draft: Draft<State>, action: DeleteExclusionZoneAction): void;
84
+ export { handleShiftSpectrumAlongXAxis, handleApplyZeroFillingFilter, handleApplyApodizationFilter, handleApplyFFTFilter, handleApplyManualPhaseCorrectionFilter, handleApplyAutoPhaseCorrectionFilter, handleApplyAbsoluteFilter, handleCalculateManualPhaseCorrection, calculateBaseLineCorrection, handleCalculateBaseLineCorrection, handleCalculateApodizationFilter, handleCalculateZeroFillingFilter, handleEnableFilter, handleDeleteFilter, handleDeleteSpectraFilter, handleBaseLineCorrectionFilter, handleSetFilterSnapshotHandler, handleAddExclusionZone, handleDeleteExclusionZone, handleSignalProcessingFilter, rollbackSpectrum, rollbackSpectrumByFilter, };