nmrium 0.37.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 (371) 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 -1
  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.js +15 -7
  26. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  27. package/lib/component/context/DispatchContext.d.ts +23 -3
  28. package/lib/component/context/DispatchContext.js +1 -1
  29. package/lib/component/context/LoggerContext.js +1 -1
  30. package/lib/component/elements/Button.js +7 -9
  31. package/lib/component/elements/IsotopesViewer.js +1 -1
  32. package/lib/component/elements/ReactTable/ReactTable.js +1 -2
  33. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  34. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  35. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  36. package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
  37. package/lib/component/elements/formik/FormikInput.js +1 -1
  38. package/lib/component/elements/formik/FormikSelect.js +2 -2
  39. package/lib/component/elements/formik/FormikSlider.js +1 -1
  40. package/lib/component/elements/formik/FormikTextarea.js +2 -2
  41. package/lib/component/header/ApodizationOptionsPanel.js +4 -5
  42. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
  43. package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
  44. package/lib/component/header/Header.js +4 -6
  45. package/lib/component/header/PhaseCorrectionPanel.js +7 -8
  46. package/lib/component/header/RangesPickingOptionPanel.js +1 -2
  47. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
  48. package/lib/component/header/Zones2DOptionPanel.js +5 -6
  49. package/lib/component/hooks/useExport.js +1 -0
  50. package/lib/component/hooks/useToolsFunctions.js +8 -10
  51. package/lib/component/loader/DropZone.js +4 -5
  52. package/lib/component/loader/NoData.js +1 -1
  53. package/lib/component/modal/AlignSpectraModal.js +1 -2
  54. package/lib/component/modal/EditPeakShapeModal.js +1 -2
  55. package/lib/component/modal/ImportPublicationStringModal.js +1 -2
  56. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  57. package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
  58. package/lib/component/modal/PredictSpectraModal.js +24 -21
  59. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  60. package/lib/component/modal/editRange/EditRangeModal.js +3 -4
  61. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  62. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  63. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
  64. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  65. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  66. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  67. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  68. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  69. package/lib/component/panels/InformationPanel.js +6 -6
  70. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  71. package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  72. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  73. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  74. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  75. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  76. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  77. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
  78. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
  79. package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
  80. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  81. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  82. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  83. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  84. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  85. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  86. package/lib/component/panels/Panels.js +1 -1
  87. package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  88. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
  89. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
  90. package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
  91. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  92. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  93. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  94. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  95. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  96. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  97. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  98. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  99. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  100. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  101. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  102. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  103. package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  104. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  105. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
  106. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  107. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
  108. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  109. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
  110. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  111. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  112. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
  113. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  114. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
  115. package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  116. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
  117. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
  118. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
  119. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
  120. package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
  121. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
  122. package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
  123. package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
  124. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  125. package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
  126. package/lib/component/reducer/IgnoreActions.d.ts +2 -1
  127. package/lib/component/reducer/IgnoreActions.js +35 -32
  128. package/lib/component/reducer/Reducer.d.ts +8 -5
  129. package/lib/component/reducer/Reducer.js +199 -221
  130. package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
  131. package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
  132. package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
  133. package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
  134. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
  135. package/lib/component/reducer/actions/DatabaseActions.js +5 -2
  136. package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
  137. package/lib/component/reducer/actions/DimensionsActions.js +3 -5
  138. package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
  139. package/lib/component/reducer/actions/DomainActions.js +13 -19
  140. package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
  141. package/lib/component/reducer/actions/FiltersActions.js +250 -255
  142. package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
  143. package/lib/component/reducer/actions/GlobalActions.js +3 -3
  144. package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
  145. package/lib/component/reducer/actions/IntegralsActions.js +16 -15
  146. package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
  147. package/lib/component/reducer/actions/LoadActions.js +52 -52
  148. package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
  149. package/lib/component/reducer/actions/MoleculeActions.js +27 -18
  150. package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
  151. package/lib/component/reducer/actions/PeaksActions.js +19 -11
  152. package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
  153. package/lib/component/reducer/actions/PreferencesActions.js +5 -3
  154. package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
  155. package/lib/component/reducer/actions/RangesActions.js +80 -65
  156. package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
  157. package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
  158. package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
  159. package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
  160. package/lib/component/reducer/actions/ToolsActions.js +54 -32
  161. package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
  162. package/lib/component/reducer/actions/ZonesActions.js +68 -49
  163. package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
  164. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  165. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
  166. package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
  167. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  168. package/lib/component/reducer/types/ActionType.d.ts +6 -0
  169. package/lib/component/reducer/types/ActionType.js +1 -0
  170. package/lib/component/toolbar/BasicToolBar.js +6 -9
  171. package/lib/component/toolbar/FunctionToolBar.js +4 -9
  172. package/lib/component/toolbar/ToolBar.js +1 -1
  173. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  174. package/lib/component/utility/Events.d.ts +4 -4
  175. package/lib/component/utility/Events.js +2 -2
  176. package/lib/component/utility/GroupByInfoKey.js +1 -1
  177. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  178. package/lib/data/PredictionManager.d.ts +5 -8
  179. package/lib/data/PredictionManager.js +3 -3
  180. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  181. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  182. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
  183. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  184. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
  185. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
  186. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
  187. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
  188. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  189. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  190. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
  191. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  192. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
  193. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
  194. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
  195. package/lib/data/matrixGeneration.js +4 -2
  196. package/lib/data/molecules/Molecule.d.ts +3 -3
  197. package/lib/data/molecules/MoleculeManager.d.ts +5 -5
  198. package/lib/data/molecules/MoleculeManager.js +1 -1
  199. package/lib/data/utilities/generateColor.js +1 -1
  200. package/lib/data/utilities/isNumber.d.ts +1 -0
  201. package/lib/data/utilities/isNumber.js +3 -0
  202. package/lib/versionInfo.js +1 -1
  203. package/lib-cjs/component/1d/FooterBanner.js +1 -1
  204. package/lib-cjs/component/1d/Viewer1D.js +25 -20
  205. package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
  206. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  207. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  208. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
  209. package/lib-cjs/component/1d/ranges/Range.js +9 -8
  210. package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
  211. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
  212. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  213. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  214. package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
  215. package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  216. package/lib-cjs/component/2d/Chart2D.js +1 -1
  217. package/lib-cjs/component/2d/Viewer2D.js +10 -9
  218. package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
  219. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  220. package/lib-cjs/component/2d/utilities/scale.js +1 -1
  221. package/lib-cjs/component/2d/zones/Zones.js +1 -1
  222. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
  223. package/lib-cjs/component/NMRium.js +15 -7
  224. package/lib-cjs/component/context/DispatchContext.js +1 -1
  225. package/lib-cjs/component/context/LoggerContext.js +1 -1
  226. package/lib-cjs/component/elements/Button.js +7 -9
  227. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  228. package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
  229. package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
  230. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  231. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  232. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  233. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
  234. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  235. package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
  236. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  237. package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
  238. package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
  239. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
  240. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
  241. package/lib-cjs/component/header/Header.js +4 -6
  242. package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
  243. package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
  244. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
  245. package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
  246. package/lib-cjs/component/highlight/index.js +1 -1
  247. package/lib-cjs/component/hooks/useExport.js +1 -0
  248. package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
  249. package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
  250. package/lib-cjs/component/hooks/useXYReduce.js +1 -1
  251. package/lib-cjs/component/loader/DropZone.js +4 -5
  252. package/lib-cjs/component/loader/NoData.js +1 -1
  253. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  254. package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
  255. package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
  256. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
  257. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
  258. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
  259. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  260. package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
  261. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  262. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  263. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
  264. package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  265. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  266. package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  267. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  268. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  269. package/lib-cjs/component/panels/InformationPanel.js +6 -6
  270. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  271. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  272. package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  273. package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  274. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  275. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  276. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  277. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
  278. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
  279. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  280. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  281. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  282. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  283. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  284. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  285. package/lib-cjs/component/panels/Panels.js +1 -1
  286. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  287. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
  288. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
  289. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
  290. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  291. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  292. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  293. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  294. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  295. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  296. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  297. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  298. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  299. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  300. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  301. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  302. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  303. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  304. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  305. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  306. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  307. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  308. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
  309. package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
  310. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
  311. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
  312. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
  313. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
  314. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  315. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
  316. package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
  317. package/lib-cjs/component/reducer/Reducer.js +199 -221
  318. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
  319. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
  320. package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
  321. package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
  322. package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
  323. package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
  324. package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
  325. package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
  326. package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
  327. package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
  328. package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
  329. package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
  330. package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
  331. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
  332. package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
  333. package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
  334. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  335. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
  336. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
  337. package/lib-cjs/component/reducer/types/ActionType.js +2 -0
  338. package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
  339. package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
  340. package/lib-cjs/component/toolbar/ToolBar.js +1 -1
  341. package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
  342. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  343. package/lib-cjs/data/PredictionManager.js +3 -3
  344. package/lib-cjs/data/SpectraManager.js +1 -1
  345. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  346. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  347. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  348. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
  349. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  350. package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  351. package/lib-cjs/data/matrixGeneration.js +4 -2
  352. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  353. package/lib-cjs/data/utilities/generateColor.js +1 -1
  354. package/lib-cjs/data/utilities/isNumber.js +7 -0
  355. package/lib-cjs/versionInfo.js +1 -1
  356. package/package.json +24 -23
  357. package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
  358. package/lib/component/reducer/actions/HistoryActions.js +0 -40
  359. package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
  360. package/lib/component/reducer/types/HistoryTypes.js +0 -4
  361. package/lib/component/reducer/types/Types.d.ts +0 -132
  362. package/lib/component/reducer/types/Types.js +0 -126
  363. package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
  364. package/lib/component/toolbar/HistoryToolBar.js +0 -30
  365. package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
  366. package/lib/data/utilities/isMolFileEmpty.js +0 -6
  367. package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
  368. package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
  369. package/lib-cjs/component/reducer/types/Types.js +0 -131
  370. package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
  371. package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { checkRangeKind } from '../../../../data/utilities/RangeUtilities';
3
3
  import { useDispatch } from '../../../context/DispatchContext';
4
4
  import EditableColumn from '../../../elements/EditableColumn';
5
- import { CHANGE_RANGE_RELATIVE } from '../../../reducer/types/Types';
6
5
  import { formatNumber } from '../../../utility/formatNumber';
7
6
  function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
8
7
  const dispatch = useDispatch();
@@ -11,9 +10,10 @@ function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
11
10
  const integralVal = flag ? formattedValue : `[ ${formattedValue} ]`;
12
11
  function saveHandler(event) {
13
12
  dispatch({
14
- type: CHANGE_RANGE_RELATIVE,
13
+ type: 'CHANGE_RANGE_RELATIVE',
15
14
  payload: {
16
- data: { value: event.target.value, id: row.id },
15
+ value: event.target.value,
16
+ id: row.id,
17
17
  },
18
18
  });
19
19
  }
@@ -2,14 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { checkMultiplicity } from 'nmr-processing';
3
3
  import { useDispatch } from '../../../context/DispatchContext';
4
4
  import EditableColumn from '../../../elements/EditableColumn';
5
- import { CHANGE_RANGE_SIGNAL_VALUE } from '../../../reducer/types/Types';
6
5
  import { formatNumber } from '../../../utility/formatNumber';
7
6
  function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
8
7
  const dispatch = useDispatch();
9
8
  const signal = row.tableMetaInfo.signal;
10
9
  function saveHandler(event) {
11
10
  dispatch({
12
- type: CHANGE_RANGE_SIGNAL_VALUE,
11
+ type: 'CHANGE_RANGE_SIGNAL_VALUE',
13
12
  payload: {
14
13
  value: event.target.value,
15
14
  rangeID: row.id,
@@ -3,5 +3,5 @@ export default function useEditRangeModal(range?: RangeData): {
3
3
  editRange: (isManual?: boolean) => void;
4
4
  deleteRange: (id?: string, resetSelectTool?: boolean) => void;
5
5
  zoomRange: (modalRange?: RangeData) => void;
6
- changeRangeSignalKind: (value: any) => void;
6
+ changeRangeSignalKind: (kind: any) => void;
7
7
  };
@@ -5,8 +5,6 @@ import { useDispatch } from '../../../context/DispatchContext';
5
5
  import { useModal } from '../../../elements/popup/Modal';
6
6
  import { positions, transitions } from '../../../elements/popup/options';
7
7
  import EditRangeModal from '../../../modal/editRange/EditRangeModal';
8
- import { CHANGE_RANGE_SIGNAL_KIND, DELETE_RANGE, SAVE_EDITED_RANGE, SET_SELECTED_TOOL, SET_X_DOMAIN, } from '../../../reducer/types/Types';
9
- import { options } from '../../../toolbar/ToolTypes';
10
8
  export default function useEditRangeModal(range) {
11
9
  const dispatch = useDispatch();
12
10
  const modal = useModal();
@@ -17,37 +15,41 @@ export default function useEditRangeModal(range) {
17
15
  const { from, to } = _range;
18
16
  const margin = Math.abs(from - to);
19
17
  dispatch({
20
- type: SET_X_DOMAIN,
21
- xDomain: [from - margin, to + margin],
18
+ type: 'SET_X_DOMAIN',
19
+ payload: {
20
+ xDomain: [from - margin, to + margin],
21
+ },
22
22
  });
23
23
  }
24
24
  }, [dispatch, range]);
25
25
  const deleteRange = useCallback((id, resetSelectTool = false) => {
26
26
  if (range || id) {
27
27
  dispatch({
28
- type: DELETE_RANGE,
28
+ type: 'DELETE_RANGE',
29
29
  payload: {
30
- data: { id: id || range?.id, assignmentData },
30
+ id: id || range?.id,
31
+ assignmentData,
31
32
  resetSelectTool,
32
33
  },
33
34
  });
34
35
  }
35
36
  }, [assignmentData, dispatch, range]);
36
- const changeRangeSignalKind = useCallback((value) => {
37
+ const changeRangeSignalKind = useCallback((kind) => {
37
38
  if (range) {
38
39
  dispatch({
39
- type: CHANGE_RANGE_SIGNAL_KIND,
40
+ type: 'CHANGE_RANGE_SIGNAL_KIND',
40
41
  payload: {
41
- data: { rowData: range, value },
42
+ range,
43
+ kind,
42
44
  },
43
45
  });
44
46
  }
45
47
  }, [dispatch, range]);
46
- const saveEditRangeHandler = useCallback((editedRowData, automaticCloseModal = true) => {
48
+ const saveEditRangeHandler = useCallback((editedRange, automaticCloseModal = true) => {
47
49
  dispatch({
48
- type: SAVE_EDITED_RANGE,
50
+ type: 'SAVE_EDITED_RANGE',
49
51
  payload: {
50
- editedRowData,
52
+ range: editedRange,
51
53
  assignmentData,
52
54
  },
53
55
  });
@@ -66,8 +68,8 @@ export default function useEditRangeModal(range) {
66
68
  }, [deleteRange, modal, saveEditRangeHandler]);
67
69
  const editRange = useCallback((isManual = false) => {
68
70
  dispatch({
69
- type: SET_SELECTED_TOOL,
70
- payload: { selectedTool: options.editRange.id },
71
+ type: 'SET_SELECTED_TOOL',
72
+ payload: { selectedTool: 'editRange' },
71
73
  });
72
74
  modal.show(_jsx(EditRangeModal, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: isManual ? {} : range, manualRange: isManual }), {
73
75
  position: positions.MIDDLE_RIGHT,
@@ -11,7 +11,6 @@ import { useModal } from '../../elements/popup/Modal';
11
11
  import { useActiveSpectra } from '../../hooks/useActiveSpectra';
12
12
  import useSpectrum from '../../hooks/useSpectrum';
13
13
  import { DISPLAYER_MODE } from '../../reducer/core/Constants';
14
- import { ADD_MISSING_PROJECTION, CHANGE_VISIBILITY, DELETE_SPECTRA, RECOLOR_SPECTRA_COLOR, RESET_SPECTRA_SCALE, SET_SPECTRA_SAME_TOP, } from '../../reducer/types/Types';
15
14
  import { getSpectraByNucleus } from '../../utility/getSpectraByNucleus';
16
15
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
17
16
  import { SpectraAutomaticPickingButton } from '../header/SpectraAutomaticPickingButton';
@@ -39,7 +38,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
39
38
  {
40
39
  text: 'Yes',
41
40
  handler: () => {
42
- dispatch({ type: DELETE_SPECTRA });
41
+ dispatch({ type: 'DELETE_SPECTRA', payload: {} });
43
42
  },
44
43
  },
45
44
  { text: 'No' },
@@ -48,34 +47,37 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
48
47
  }, [activeSpectra?.length, dispatch, modal]);
49
48
  function showAllSpectrumsHandler() {
50
49
  dispatch({
51
- type: CHANGE_VISIBILITY,
50
+ type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
52
51
  payload: { nucleus: activeTab, flag: true },
53
52
  });
54
53
  }
55
54
  function hideAllSpectrumsHandler() {
56
55
  dispatch({
57
- type: CHANGE_VISIBILITY,
56
+ type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
58
57
  payload: { nucleus: activeTab, flag: false },
59
58
  });
60
59
  }
61
60
  function addMissingProjectionHandler() {
62
61
  const missingNucleus = getMissingProjection(data, activeTab);
63
62
  if (missingNucleus.length > 0) {
64
- dispatch({ type: ADD_MISSING_PROJECTION, nucleus: missingNucleus });
63
+ dispatch({
64
+ type: 'ADD_MISSING_PROJECTION',
65
+ payload: { nucleus: missingNucleus },
66
+ });
65
67
  }
66
68
  else {
67
69
  alert.error('Nothing to calculate');
68
70
  }
69
71
  }
70
72
  function setSameTopHandler() {
71
- dispatch({ type: SET_SPECTRA_SAME_TOP });
73
+ dispatch({ type: 'SET_SPECTRA_SAME_TOP' });
72
74
  }
73
75
  function resetScaleHandler() {
74
- dispatch({ type: RESET_SPECTRA_SCALE });
76
+ dispatch({ type: 'RESET_SPECTRA_SCALE' });
75
77
  }
76
78
  function recolorSpectraHandler() {
77
79
  dispatch({
78
- type: RECOLOR_SPECTRA_COLOR,
80
+ type: 'RECOLOR_SPECTRA_COLOR',
79
81
  payload: {},
80
82
  });
81
83
  }
@@ -87,12 +89,10 @@ export default function SpectrumsTabs({ onSettingClick, }) {
87
89
  const { data, view: { spectra: { activeTab }, }, displayerMode, } = useChartData();
88
90
  const spectrum = useSpectrum();
89
91
  const activeSpectra = useActiveSpectra();
90
- return (_jsx(MemoizedSpectraPanelHeader, { ...{
91
- data,
92
- activeSpectrum: spectrum,
93
- activeSpectra,
94
- activeTab,
95
- displayerMode,
96
- onSettingClick,
97
- } }));
92
+ return (_jsx(MemoizedSpectraPanelHeader, { data,
93
+ activeSpectrum: spectrum,
94
+ activeSpectra,
95
+ activeTab,
96
+ displayerMode,
97
+ onSettingClick }));
98
98
  }
@@ -9,14 +9,13 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
9
9
  import { useAlert } from '../../elements/popup/Alert';
10
10
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
11
11
  import ExportAsJcampModal from '../../modal/ExportAsJcampModal';
12
- import { DELETE_SPECTRA, ORDER_SPECTRA, RECOLOR_SPECTRA_COLOR, } from '../../reducer/types/Types';
13
12
  import { copyTextToClipboard } from '../../utility/export';
14
13
  import ColorIndicator from './base/ColorIndicator';
15
14
  import ShowHideSpectrumButton from './base/ShowHideSpectrumButton';
16
15
  import { SpectrumName } from './base/SpectrumName';
17
16
  function formatValueAsHTML(value) {
18
17
  if (value) {
19
- value = value.replace(/(?<value>\d+)/g, '<sub>$<value></sub>');
18
+ value = value.replaceAll(/(?<value>\d+)/g, '<sub>$<value></sub>');
20
19
  }
21
20
  return value;
22
21
  }
@@ -145,7 +144,7 @@ export function SpectraTable(props) {
145
144
  }
146
145
  case SpectraContextMenuOptionsKeys.Delete: {
147
146
  setTimeout(() => {
148
- dispatch({ type: DELETE_SPECTRA, id: spectrum.id });
147
+ dispatch({ type: 'DELETE_SPECTRA', payload: { id: spectrum.id } });
149
148
  }, 0);
150
149
  break;
151
150
  }
@@ -195,7 +194,7 @@ export function SpectraTable(props) {
195
194
  }, [COLUMNS, spectraPreferences.columns]);
196
195
  function handleSortEnd(data) {
197
196
  dispatch({
198
- type: ORDER_SPECTRA,
197
+ type: 'ORDER_SPECTRA',
199
198
  payload: {
200
199
  data,
201
200
  },
@@ -217,7 +216,10 @@ const ColumnHeader = ({ label, col, }) => {
217
216
  const dispatch = useDispatch();
218
217
  function selectHandler() {
219
218
  if (col?.jpath) {
220
- dispatch({ type: RECOLOR_SPECTRA_COLOR, payload: { jpath: col?.jpath } });
219
+ dispatch({
220
+ type: 'RECOLOR_SPECTRA_COLOR',
221
+ payload: { jpath: col?.jpath },
222
+ });
221
223
  }
222
224
  }
223
225
  return (_jsx(DropdownMenu, { trigger: "contextMenu", options: options, onSelect: selectHandler, children: _jsx("div", { style: {
@@ -7,7 +7,6 @@ import { useDispatch } from '../../context/DispatchContext';
7
7
  import IsotopesViewer from '../../elements/IsotopesViewer';
8
8
  import Tab from '../../elements/Tab/Tab';
9
9
  import Tabs from '../../elements/Tab/Tabs';
10
- import { SET_ACTIVE_TAB, CHANGE_VISIBILITY, CHANGE_ACTIVE_SPECTRUM, } from '../../reducer/types/Types';
11
10
  import groupByInfoKey from '../../utility/GroupByInfoKey';
12
11
  import { SpectraTable } from './SpectraTable';
13
12
  import SpectrumSetting from './base/setting/SpectrumSetting';
@@ -23,7 +22,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
23
22
  return groupByNucleus(data, true);
24
23
  }, [data]);
25
24
  function onTabChangeHandler(tab) {
26
- dispatch({ type: SET_ACTIVE_TAB, tab: tab.tabid });
25
+ dispatch({ type: 'SET_ACTIVE_TAB', payload: { tab: tab.tabid } });
27
26
  }
28
27
  const openSettingHandler = useCallback((event, selectedSpectrum) => {
29
28
  event.stopPropagation();
@@ -36,7 +35,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
36
35
  }, []);
37
36
  const handleChangeVisibility = useCallback((d, key) => {
38
37
  dispatch({
39
- type: CHANGE_VISIBILITY,
38
+ type: 'CHANGE_SPECTRUM_VISIBILITY',
40
39
  payload: {
41
40
  id: d.id,
42
41
  key,
@@ -47,7 +46,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
47
46
  setTimeout(() => {
48
47
  const modifier = `shift[${e.shiftKey ? 'true' : 'false'}]_ctrl[${e.ctrlKey ? 'true' : 'false'}]`;
49
48
  dispatch({
50
- type: CHANGE_ACTIVE_SPECTRUM,
49
+ type: 'CHANGE_ACTIVE_SPECTRUM',
51
50
  payload: { modifier, id: spectrum.id },
52
51
  });
53
52
  }, 0);
@@ -65,5 +64,5 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
65
64
  const MemoizedSpectra = memo(SpectrumsTabsInner);
66
65
  export default function SpectrumsTabs() {
67
66
  const { data, view: { spectra: { activeTab, activeSpectra }, }, } = useChartData();
68
- return _jsx(MemoizedSpectra, { ...{ data, activeSpectra, activeTab } });
67
+ return _jsx(MemoizedSpectra, { data, activeSpectra, activeTab });
69
68
  }
@@ -18,13 +18,9 @@ function getStyle(display, key) {
18
18
  };
19
19
  }
20
20
  export default function ShowHideSpectrumButton({ data, onChangeVisibility, }) {
21
- return (_jsxs("div", { children: [_jsx(DisplayButtons1D, { ...{
22
- data,
23
- onChangeVisibility,
24
- } }), _jsx(DisplayButtons2D, { ...{
25
- data,
26
- onChangeVisibility,
27
- } })] }));
21
+ return (_jsxs("div", { children: [_jsx(DisplayButtons1D, { data,
22
+ onChangeVisibility }), _jsx(DisplayButtons2D, { data,
23
+ onChangeVisibility })] }));
28
24
  }
29
25
  function DisplayButtons1D(props) {
30
26
  const { data, onChangeVisibility } = props;
@@ -3,7 +3,6 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
3
3
  import { css } from '@emotion/react';
4
4
  import { memo, useCallback } from 'react';
5
5
  import { useDispatch } from '../../../../context/DispatchContext';
6
- import { CHANGE_SPECTRUM_SETTING } from '../../../../reducer/types/Types';
7
6
  import Spectrum1DSetting from './Spectrum1DSetting';
8
7
  import Spectrum2DSetting from './Spectrum2DSetting';
9
8
  const style = css `
@@ -68,7 +67,10 @@ function SpectrumSetting({ position, data, onClose }) {
68
67
  const dispatch = useDispatch();
69
68
  const { id, info } = data;
70
69
  const submitHandler = useCallback((values) => {
71
- dispatch({ type: CHANGE_SPECTRUM_SETTING, id, display: values });
70
+ dispatch({
71
+ type: 'CHANGE_SPECTRUM_SETTING',
72
+ payload: { id, display: values },
73
+ });
72
74
  }, [dispatch, id]);
73
75
  const clickHandler = useCallback((e) => {
74
76
  if (e.target === e.currentTarget) {
@@ -18,8 +18,8 @@ export function processSnapPlot(dimension, data, yLogBase) {
18
18
  function getLine(value, data, options) {
19
19
  const { log10, abs } = Math;
20
20
  const { yLogBase } = options;
21
- const first = data.length > 0 ? data[0].x : 0;
22
- const last = data.length > 0 ? data[data.length - 1].x : 0;
21
+ const first = data.at(0)?.x ?? 0;
22
+ const last = data.at(-1)?.x ?? 0;
23
23
  const inLogScale = log10(abs(value)) / log10(yLogBase);
24
24
  return [
25
25
  { x: first, y: inLogScale },
@@ -171,19 +171,15 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
171
171
  }, [contextRef]);
172
172
  const { title, ...otherTableDataProps } = tableDataProps;
173
173
  const t = title || '';
174
- return (_jsxs("tr", { style: styleRow, children: [_jsxs("td", { title: t, ...{
175
- ...otherTableDataProps,
176
- style: { ...tableDataProps.style, styleLabel },
177
- }, onContextMenu: (e) => {
174
+ return (_jsxs("tr", { style: styleRow, children: [_jsxs("td", { title: t, ...otherTableDataProps,
175
+ style: { ...tableDataProps.style, styleLabel }, onContextMenu: (e) => {
178
176
  if (contextMenu.length > 0) {
179
177
  contextMenuHandler(e);
180
178
  }
181
179
  }, children: [getLabel(correlations, correlation), _jsx(ContextMenu, { ref: contextRef, context: contextMenu })] }), _jsx("td", { title: t, ...otherTableDataProps, children: getCorrelationDelta(correlation)
182
180
  ? getCorrelationDelta(correlation)?.toFixed(2)
183
- : '' }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : (_jsx("text", { style: equivalenceCellStyle, children: correlation.equivalence })) }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), _jsx("td", { title: t, ...{
184
- ...otherTableDataProps,
185
- style: { ...tableDataProps.style, borderRight: '1px solid' },
186
- }, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "text", value: correlation.hybridization
181
+ : '' }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : (_jsx("text", { style: equivalenceCellStyle, children: correlation.equivalence })) }), _jsx("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), _jsx("td", { title: t, ...otherTableDataProps,
182
+ style: { ...tableDataProps.style, borderRight: '1px solid' }, children: correlation.atomType !== 'H' ? (_jsx(EditableColumn, { type: "text", value: correlation.hybridization
187
183
  .map((hybrid) => `sp${hybrid}`)
188
184
  .join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') })) : ('') }), additionalColumnFields] }));
189
185
  }
@@ -12,7 +12,6 @@ import Select from '../../elements/Select';
12
12
  import ToolTip from '../../elements/ToolTip/ToolTip';
13
13
  import { useModal } from '../../elements/popup/Modal';
14
14
  import { DISPLAYER_MODE } from '../../reducer/core/Constants';
15
- import { DELETE_1D_SIGNAL, DELETE_2D_SIGNAL, DELETE_CORRELATION, SET_2D_SIGNAL_PATH_LENGTH, SET_CORRELATION, SET_CORRELATIONS, SET_CORRELATIONS_MF, SET_CORRELATIONS_TOLERANCE, } from '../../reducer/types/Types';
16
15
  import DefaultPanelHeader from '../header/DefaultPanelHeader';
17
16
  import CorrelationTable from './CorrelationTable/CorrelationTable';
18
17
  import Overview from './Overview';
@@ -139,7 +138,7 @@ function SummaryPanel() {
139
138
  ]);
140
139
  const handleOnSetMolecularFormula = useCallback((mf) => {
141
140
  dispatch({
142
- type: SET_CORRELATIONS_MF,
141
+ type: 'SET_CORRELATIONS_MF',
143
142
  payload: {
144
143
  mf,
145
144
  },
@@ -147,7 +146,7 @@ function SummaryPanel() {
147
146
  }, [dispatch]);
148
147
  const handleOnSetShiftTolerance = useCallback((tolerance) => {
149
148
  dispatch({
150
- type: SET_CORRELATIONS_TOLERANCE,
149
+ type: 'SET_CORRELATIONS_TOLERANCE',
151
150
  payload: {
152
151
  tolerance,
153
152
  },
@@ -182,7 +181,7 @@ function SummaryPanel() {
182
181
  }, [filteredCorrelationsData, selectedAdditionalColumnsAtomType]);
183
182
  const editEquivalencesSaveHandler = useCallback((correlation, value) => {
184
183
  dispatch({
185
- type: SET_CORRELATION,
184
+ type: 'SET_CORRELATION',
186
185
  payload: {
187
186
  id: correlation.id,
188
187
  correlation: {
@@ -195,7 +194,7 @@ function SummaryPanel() {
195
194
  }, [dispatch]);
196
195
  const editNumericValuesSaveHandler = useCallback(({ correlation, values, key, }) => {
197
196
  dispatch({
198
- type: SET_CORRELATION,
197
+ type: 'SET_CORRELATION',
199
198
  payload: {
200
199
  id: correlation.id,
201
200
  correlation: {
@@ -211,7 +210,7 @@ function SummaryPanel() {
211
210
  }, [dispatch]);
212
211
  const setCorrelationsHandler = useCallback((correlations, options) => {
213
212
  dispatch({
214
- type: SET_CORRELATIONS,
213
+ type: 'SET_CORRELATIONS',
215
214
  payload: {
216
215
  correlations,
217
216
  options,
@@ -220,7 +219,7 @@ function SummaryPanel() {
220
219
  }, [dispatch]);
221
220
  const deleteCorrelationHandler = useCallback((correlation) => {
222
221
  dispatch({
223
- type: DELETE_CORRELATION,
222
+ type: 'DELETE_CORRELATION',
224
223
  payload: {
225
224
  correlation,
226
225
  assignmentData,
@@ -234,29 +233,33 @@ function SummaryPanel() {
234
233
  const spectrum = findSpectrum(spectraData, link.experimentID, false);
235
234
  const range = findRange(spectrum, link.signal.id);
236
235
  const signal = findSignal1D(spectrum, link.signal.id);
237
- dispatch({
238
- type: DELETE_1D_SIGNAL,
239
- payload: {
240
- spectrum,
241
- range,
242
- signal,
243
- assignmentData,
244
- },
245
- });
236
+ if (spectrum && range && signal) {
237
+ dispatch({
238
+ type: 'DELETE_1D_SIGNAL',
239
+ payload: {
240
+ spectrum,
241
+ range,
242
+ signal,
243
+ assignmentData,
244
+ },
245
+ });
246
+ }
246
247
  }
247
248
  else if (linkDim === 2) {
248
249
  const spectrum = findSpectrum(spectraData, link.experimentID, false);
249
250
  const zone = findZone(spectrum, link.signal.id);
250
251
  const signal = findSignal2D(spectrum, link.signal.id);
251
- dispatch({
252
- type: DELETE_2D_SIGNAL,
253
- payload: {
254
- spectrum,
255
- zone,
256
- signal,
257
- assignmentData,
258
- },
259
- });
252
+ if (zone && signal) {
253
+ dispatch({
254
+ type: 'DELETE_2D_SIGNAL',
255
+ payload: {
256
+ spectrum,
257
+ zone,
258
+ signal,
259
+ assignmentData,
260
+ },
261
+ });
262
+ }
260
263
  }
261
264
  }, [assignmentData, dispatch, spectraData]);
262
265
  const changeSignalPathLengthHandler = useCallback((link) => {
@@ -265,15 +268,17 @@ function SummaryPanel() {
265
268
  const spectrum = findSpectrum(spectraData, link.experimentID, false);
266
269
  const zone = findZone(spectrum, link.signal.id);
267
270
  const signal = findSignal2D(spectrum, link.signal.id);
268
- dispatch({
269
- type: SET_2D_SIGNAL_PATH_LENGTH,
270
- payload: {
271
- spectrum,
272
- zone,
273
- signal,
274
- pathLength: link.signal.j?.pathLength,
275
- },
276
- });
271
+ if (zone && signal) {
272
+ dispatch({
273
+ type: 'SET_2D_SIGNAL_PATH_LENGTH',
274
+ payload: {
275
+ spectrum,
276
+ zone,
277
+ signal,
278
+ pathLength: link.signal.j?.pathLength,
279
+ },
280
+ });
281
+ }
277
282
  }
278
283
  }, [dispatch, spectraData]);
279
284
  const editCorrelationTableCellHandler = useCallback((editedCorrelations, action, link, options) => {
@@ -252,7 +252,7 @@ function cloneCorrelationAndSetPathLength(correlation, editedLink, axis) {
252
252
  function convertValuesString(valuesString, key) {
253
253
  valuesString = valuesString
254
254
  .toLowerCase()
255
- .replace(/\s+/g, '')
255
+ .replaceAll(/\s+/g, '')
256
256
  .split(',')
257
257
  .map((token) => (token === 'sp' ? 'sp1' : token))
258
258
  .join(',');
@@ -1,17 +1,6 @@
1
- import { Zone } from 'nmr-load-save';
2
- export interface RowDataProps extends Zone {
3
- tableMetaInfo: {
4
- id: number;
5
- signalIndex: number;
6
- rowSpan: any;
7
- signal: {
8
- kind: any;
9
- };
10
- experiment: string;
11
- };
12
- }
1
+ import { ZoneData } from '../hooks/useMapZones';
13
2
  interface ActionsColumnProps {
14
- rowData: RowDataProps;
3
+ rowData: ZoneData;
15
4
  rowSpanTags: any;
16
5
  }
17
6
  declare function ActionsColumn({ rowData, rowSpanTags }: ActionsColumnProps): import("react/jsx-runtime").JSX.Element;
@@ -7,8 +7,6 @@ import { useDispatch } from '../../../context/DispatchContext';
7
7
  import Select from '../../../elements/Select';
8
8
  import { useModal, positions, transitions, } from '../../../elements/popup/Modal';
9
9
  import EditZoneModal from '../../../modal/editZone/EditZoneModal';
10
- import { CHANGE_ZONE_SIGNAL_KIND, DELETE_2D_ZONE, SAVE_EDITED_ZONE, SET_SELECTED_TOOL, SET_X_DOMAIN, SET_Y_DOMAIN, } from '../../../reducer/types/Types';
11
- import { options } from '../../../toolbar/ToolTypes';
12
10
  const selectBoxStyle = {
13
11
  marginLeft: 2,
14
12
  marginRight: 2,
@@ -19,18 +17,18 @@ function ActionsColumn({ rowData, rowSpanTags }) {
19
17
  const dispatch = useDispatch();
20
18
  const assignmentData = useAssignmentData();
21
19
  const modal = useModal();
22
- const changeSignalKindHandler = useCallback((value) => {
20
+ const changeSignalKindHandler = useCallback((kind) => {
23
21
  dispatch({
24
- type: CHANGE_ZONE_SIGNAL_KIND,
22
+ type: 'CHANGE_ZONE_SIGNAL_KIND',
25
23
  payload: {
26
- rowData,
27
- value,
24
+ zoneData: rowData,
25
+ kind,
28
26
  },
29
27
  });
30
28
  }, [dispatch, rowData]);
31
29
  const deleteZoneHandler = useCallback(() => {
32
30
  dispatch({
33
- type: DELETE_2D_ZONE,
31
+ type: 'DELETE_2D_ZONE',
34
32
  payload: {
35
33
  id: rowData.id,
36
34
  assignmentData,
@@ -40,31 +38,35 @@ function ActionsColumn({ rowData, rowSpanTags }) {
40
38
  const zoomZoneHandler = useCallback(() => {
41
39
  const xMargin = Math.abs(rowData.x.from - rowData.x.to) * 10;
42
40
  dispatch({
43
- type: SET_X_DOMAIN,
44
- xDomain: rowData.x.from <= rowData.x.to
45
- ? [rowData.x.from - xMargin, rowData.x.to + xMargin]
46
- : [rowData.x.to - xMargin, rowData.x.from + xMargin],
41
+ type: 'SET_X_DOMAIN',
42
+ payload: {
43
+ xDomain: rowData.x.from <= rowData.x.to
44
+ ? [rowData.x.from - xMargin, rowData.x.to + xMargin]
45
+ : [rowData.x.to - xMargin, rowData.x.from + xMargin],
46
+ },
47
47
  });
48
48
  const yMargin = Math.abs(rowData.y.from - rowData.y.to) * 10;
49
49
  dispatch({
50
- type: SET_Y_DOMAIN,
51
- yDomain: rowData.y.from <= rowData.y.to
52
- ? [rowData.y.from - yMargin, rowData.y.to + yMargin]
53
- : [rowData.y.to - yMargin, rowData.y.from + yMargin],
50
+ type: 'SET_Y_DOMAIN',
51
+ payload: {
52
+ yDomain: rowData.y.from <= rowData.y.to
53
+ ? [rowData.y.from - yMargin, rowData.y.to + yMargin]
54
+ : [rowData.y.to - yMargin, rowData.y.from + yMargin],
55
+ },
54
56
  });
55
57
  }, [dispatch, rowData.x.from, rowData.x.to, rowData.y.from, rowData.y.to]);
56
- const saveEditZoneHandler = useCallback((editedRowData) => {
58
+ const saveEditZoneHandler = useCallback((zone) => {
57
59
  dispatch({
58
- type: SAVE_EDITED_ZONE,
60
+ type: 'SAVE_EDITED_ZONE',
59
61
  payload: {
60
- editedRowData,
62
+ zone,
61
63
  },
62
64
  });
63
65
  }, [dispatch]);
64
66
  const openEditZoneHandler = useCallback(() => {
65
67
  dispatch({
66
- type: SET_SELECTED_TOOL,
67
- payload: { selectedTool: options.editRange.id },
68
+ type: 'SET_SELECTED_TOOL',
69
+ payload: { selectedTool: 'editRange' },
68
70
  });
69
71
  modal.show(_jsx(EditZoneModal, { onCloseEditZoneModal: () => modal.close(), onSaveEditZoneModal: saveEditZoneHandler, onZoomEditZoneModal: () => zoomZoneHandler(), rowData: rowData }), {
70
72
  position: positions.MIDDLE_RIGHT,
@@ -1,8 +1,8 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  import { AssignmentsData, Axis } from '../../../assignment/AssignmentsContext';
3
- import { RowDataProps } from './ActionsColumn';
3
+ import { ZoneData } from '../hooks/useMapZones';
4
4
  export interface SignalAssignmentsColumnProps {
5
- rowData: RowDataProps;
5
+ rowData: ZoneData;
6
6
  assignment: AssignmentsData;
7
7
  highlight: {
8
8
  isActive: any;
@@ -9,6 +9,6 @@ function SignalAssignmentsColumn({ rowData, assignment, highlight, onHover, onCl
9
9
  fontWeight: 'bold',
10
10
  }
11
11
  : {};
12
- return (_jsx("td", { ...onHover, ...{ onClick: (e) => onClick(e, assignment, axis) }, style: { padding: '0', ...tdCss }, css: !isAssignmentActive && removeAssignmentCssStyle, children: (diaIDs?.length > 0 || isAssignmentActive) && (_jsxs(_Fragment, { children: [_jsx("span", { children: diaIDs?.length || 0 }), _jsx(RemoveAssignmentsButton, { onClick: (e) => onUnlink(e, false, axis) })] })) }));
12
+ return (_jsx("td", { ...onHover, onClick: (e) => onClick(e, assignment, axis), style: { padding: '0', ...tdCss }, css: !isAssignmentActive && removeAssignmentCssStyle, children: (diaIDs?.length > 0 || isAssignmentActive) && (_jsxs(_Fragment, { children: [_jsx("span", { children: diaIDs?.length || 0 }), _jsx(RemoveAssignmentsButton, { onClick: (e) => onUnlink(e, false, axis) })] })) }));
13
13
  }
14
14
  export default SignalAssignmentsColumn;