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
@@ -16,13 +16,11 @@ const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
16
16
  const DispatchContext_1 = require("../../context/DispatchContext");
17
17
  const ActiveButton_1 = __importDefault(require("../../elements/ActiveButton"));
18
18
  const ButtonToolTip_1 = __importDefault(require("../../elements/ButtonToolTip"));
19
- const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
20
19
  const Alert_1 = require("../../elements/popup/Alert");
21
20
  const Modal_1 = require("../../elements/popup/Modal");
22
21
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
23
22
  const CopyClipboardModal_1 = __importDefault(require("../../modal/CopyClipboardModal"));
24
23
  const ChangeSumModal_1 = __importDefault(require("../../modal/changeSum/ChangeSumModal"));
25
- const Types_1 = require("../../reducer/types/Types");
26
24
  const export_1 = require("../../utility/export");
27
25
  const formatNumber_1 = require("../../utility/formatNumber");
28
26
  const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
@@ -52,8 +50,8 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
52
50
  const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
53
51
  const currentSum = (0, get_1.default)(ranges, 'options.sum', null);
54
52
  const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
55
- const changeRangesSumHandler = (0, react_2.useCallback)((value) => {
56
- dispatch({ type: Types_1.CHANGE_RANGE_SUM, value });
53
+ const changeRangesSumHandler = (0, react_2.useCallback)((options) => {
54
+ dispatch({ type: 'CHANGE_RANGE_SUM', payload: { options } });
57
55
  modal.close();
58
56
  }, [dispatch, modal]);
59
57
  const showChangeRangesSumModal = (0, react_2.useCallback)(() => {
@@ -78,8 +76,8 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
78
76
  text: 'Yes',
79
77
  handler: () => {
80
78
  dispatch({
81
- type: Types_1.DELETE_RANGE,
82
- payload: { data: { assignmentData } },
79
+ type: 'DELETE_RANGE',
80
+ payload: { assignmentData },
83
81
  });
84
82
  },
85
83
  },
@@ -88,13 +86,13 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
88
86
  });
89
87
  }, [assignmentData, dispatch, modal]);
90
88
  const handleSetShowMultiplicityTrees = (0, react_2.useCallback)(() => {
91
- dispatch({ type: Types_1.SHOW_MULTIPLICITY_TREES, payload: { id } });
89
+ dispatch({ type: 'SHOW_MULTIPLICITY_TREES', payload: { id } });
92
90
  }, [dispatch, id]);
93
91
  const handleShowIntegrals = (0, react_2.useCallback)(() => {
94
- dispatch({ type: Types_1.SHOW_RANGES_INTEGRALS, payload: { id } });
92
+ dispatch({ type: 'SHOW_RANGES_INTEGRALS', payload: { id } });
95
93
  }, [dispatch, id]);
96
94
  const handleShowJGraph = (0, react_2.useCallback)(() => {
97
- dispatch({ type: Types_1.SHOW_J_GRAPH, payload: { id } });
95
+ dispatch({ type: 'SHOW_J_GRAPH', payload: { id } });
98
96
  }, [dispatch, id]);
99
97
  const saveToClipboardHandler = (0, react_2.useCallback)((value) => {
100
98
  void (async () => {
@@ -126,17 +124,16 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
126
124
  rangesPreferences?.deltaPPM?.format,
127
125
  saveToClipboardHandler,
128
126
  ]);
129
- const changeSumConstantFlagHandler = (0, react_2.useCallback)((flag) => {
127
+ const changeSumConstantFlagHandler = (0, react_2.useCallback)(() => {
130
128
  dispatch({
131
- type: Types_1.CHANGE_RANGES_SUM_FLAG,
132
- payload: flag,
129
+ type: 'CHANGE_RANGES_SUM_FLAG',
133
130
  });
134
131
  }, [dispatch]);
135
132
  const { editRange } = (0, useEditRangeModal_1.default)();
136
133
  const addRangeHandler = (0, react_2.useCallback)(() => {
137
134
  dispatch({
138
- type: Types_1.ADD_RANGE,
139
- payload: { id: 'new' },
135
+ type: 'ADD_RANGE',
136
+ payload: {},
140
137
  });
141
138
  editRange(true);
142
139
  }, [dispatch, editRange]);
@@ -144,6 +141,6 @@ function RangesHeader({ id, ranges, info, onUnlink, onFilterActivated, onSetting
144
141
  ? `Change ranges sum (${Number(currentSum).toFixed(2)})`
145
142
  : 'Change ranges sum', popupPlacement: "right", onClick: showChangeRangesSumModal, className: "btn icon", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrSum, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Remove all assignments", popupPlacement: "right", onClick: handleOnRemoveAssignments, disabled: !ranges?.values || ranges.values.length === 0, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaUnlink, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showMultiplicityTrees
146
143
  ? 'Hide multiplicity trees in spectrum'
147
- : 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !ranges?.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !ranges?.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !ranges?.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ToggleButton_1.default, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add range", popupPlacement: "right", onClick: addRangeHandler, className: "btn icon", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) })] }) }));
144
+ : 'Show multiplicity trees in spectrum', popupPlacement: "right", onClick: handleSetShowMultiplicityTrees, value: showMultiplicityTrees, disabled: !ranges?.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaSitemap, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showJGraph ? 'Hide J Graph' : 'Show J Graph', popupPlacement: "right", onClick: handleShowJGraph, value: showJGraph, disabled: !ranges?.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(fa_1.FaChartBar, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { popupTitle: showRangesIntegrals ? 'Hide integrals' : 'Show integrals', popupPlacement: "right", onClick: handleShowIntegrals, value: showRangesIntegrals, disabled: !ranges?.values || ranges.values.length === 0, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, { style: { pointerEvents: 'none', fontSize: '12px' } }) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: changeSumConstantFlagHandler, value: ranges?.options?.isSumConstant, children: (0, jsx_runtime_1.jsx)(im_1.ImLink, {}) }), (0, jsx_runtime_1.jsx)(ButtonToolTip_1.default, { popupTitle: "Add range", popupPlacement: "right", onClick: addRangeHandler, className: "btn icon", disabled: !ranges?.values, children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) })] }) }));
148
145
  }
149
146
  exports.default = RangesHeader;
@@ -16,7 +16,6 @@ const Alert_1 = require("../../elements/popup/Alert");
16
16
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
17
17
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
18
18
  const Reducer_1 = require("../../reducer/Reducer");
19
- const Types_1 = require("../../reducer/types/Types");
20
19
  const export_1 = require("../../utility/export");
21
20
  const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
22
21
  const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
@@ -66,9 +65,9 @@ function RangesTablePanelInner({ id, ranges, data, info, xDomain, preferences, a
66
65
  }, [isFilterActive, ranges.values, xDomain]);
67
66
  const unlinkRangeHandler = (0, react_2.useCallback)((rangeData, signalIndex = -1) => {
68
67
  dispatch({
69
- type: Types_1.UNLINK_RANGE,
68
+ type: 'UNLINK_RANGE',
70
69
  payload: {
71
- rangeData,
70
+ range: rangeData,
72
71
  assignmentData,
73
72
  signalIndex,
74
73
  },
@@ -117,17 +116,15 @@ function RangesTablePanelInner({ id, ranges, data, info, xDomain, preferences, a
117
116
  position: relative;
118
117
  }
119
118
  `,
120
- ], children: [!isFlipped && ((0, jsx_runtime_1.jsx)(RangesHeader_1.default, { ...{
121
- id,
122
- ranges,
123
- info,
124
- activeTab,
125
- molecules,
126
- showRangesIntegrals,
127
- showMultiplicityTrees,
128
- showJGraph,
129
- isFilterActive,
130
- }, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? ((0, jsx_runtime_1.jsx)(RangesTable_1.default, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, contextMenu: rangesContextMenuOptions, onContextMenuSelect: contextMenuSelectHandler, preferences: preferences, info: info })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {})) })) : ((0, jsx_runtime_1.jsx)(RangesPreferences_1.default, { ref: settingRef })) })] }));
119
+ ], children: [!isFlipped && ((0, jsx_runtime_1.jsx)(RangesHeader_1.default, { id,
120
+ ranges,
121
+ info,
122
+ activeTab,
123
+ molecules,
124
+ showRangesIntegrals,
125
+ showMultiplicityTrees,
126
+ showJGraph,
127
+ isFilterActive, onUnlink: unlinkRangeHandler, onFilterActivated: filterHandler, onSettingClick: settingsPanelHandler, filterCounter: rangesData.length })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? ((0, jsx_runtime_1.jsx)("div", { className: "table-container", children: rangesData && rangesData.length > 0 ? ((0, jsx_runtime_1.jsx)(RangesTable_1.default, { activeTab: activeTab, tableData: rangesData, onUnlink: unlinkRangeHandler, contextMenu: rangesContextMenuOptions, onContextMenuSelect: contextMenuSelectHandler, preferences: preferences, info: info })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, {})) })) : ((0, jsx_runtime_1.jsx)(RangesPreferences_1.default, { ref: settingRef })) })] }));
131
128
  }
132
129
  const MemoizedRangesTablePanel = (0, react_2.memo)(RangesTablePanelInner);
133
130
  const emptyData = { ranges: {}, data: {}, info: {} };
@@ -136,20 +133,18 @@ function RangesTablePanel() {
136
133
  const { displayerKey, xDomain, view: { spectra: { activeTab }, }, molecules, toolOptions: { selectedTool }, view: { ranges: rangeState }, } = (0, ChartContext_1.useChartData)();
137
134
  const { showMultiplicityTrees, showRangesIntegrals, showJGraph } = (0, react_2.useMemo)(() => rangeState.find((r) => r.spectrumID === id) || Reducer_1.rangeStateInit, [id, rangeState]);
138
135
  const rangesPreferences = (0, usePanelPreferences_1.usePanelPreferences)('ranges', activeTab);
139
- return ((0, jsx_runtime_1.jsx)(MemoizedRangesTablePanel, { ...{
140
- id,
141
- ranges,
142
- data,
143
- info,
144
- showMultiplicityTrees,
145
- showJGraph,
146
- showRangesIntegrals,
147
- selectedTool,
148
- displayerKey,
149
- preferences: rangesPreferences,
150
- xDomain,
151
- activeTab,
152
- molecules,
153
- } }));
136
+ return ((0, jsx_runtime_1.jsx)(MemoizedRangesTablePanel, { id,
137
+ ranges,
138
+ data,
139
+ info,
140
+ showMultiplicityTrees,
141
+ showJGraph,
142
+ showRangesIntegrals,
143
+ selectedTool,
144
+ displayerKey,
145
+ preferences: rangesPreferences,
146
+ xDomain,
147
+ activeTab,
148
+ molecules }));
154
149
  }
155
150
  exports.default = RangesTablePanel;
@@ -38,6 +38,6 @@ function RangeAssignmentsColumn({ row, assignment, highlight, onLink, onUnlink,
38
38
  return ((0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, style: {
39
39
  ...columnStyle,
40
40
  ...rowSpanTags.style,
41
- }, ...onHover, ...{ onClick: (e) => onLink?.(e, assignment) }, css: !assignment.isActive && RemoveAssignmentsButton_1.removeAssignmentCssStyle, children: (totalNumberOfAtoms > 0 || assignment.isActive) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [totalNumberOfAtoms, " ", ' ( ', (0, jsx_runtime_1.jsx)("span", { style: getStyle(flag, isCompletelyAssigned), children: diaIDs?.length || 0 }), ' ) ', (0, jsx_runtime_1.jsx)(RemoveAssignmentsButton_1.RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, true) })] })) }));
41
+ }, ...onHover, onClick: (e) => onLink?.(e, assignment), css: !assignment.isActive && RemoveAssignmentsButton_1.removeAssignmentCssStyle, children: (totalNumberOfAtoms > 0 || assignment.isActive) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [totalNumberOfAtoms, " ", ' ( ', (0, jsx_runtime_1.jsx)("span", { style: getStyle(flag, isCompletelyAssigned), children: diaIDs?.length || 0 }), ' ) ', (0, jsx_runtime_1.jsx)(RemoveAssignmentsButton_1.RemoveAssignmentsButton, { onClick: (e) => onUnlink?.(e, true) })] })) }));
42
42
  }
43
43
  exports.default = (0, react_1.memo)(RangeAssignmentsColumn);
@@ -7,7 +7,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const RangeUtilities_1 = require("../../../../data/utilities/RangeUtilities");
8
8
  const DispatchContext_1 = require("../../../context/DispatchContext");
9
9
  const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
10
- const Types_1 = require("../../../reducer/types/Types");
11
10
  const formatNumber_1 = require("../../../utility/formatNumber");
12
11
  function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
13
12
  const dispatch = (0, DispatchContext_1.useDispatch)();
@@ -16,9 +15,10 @@ function RelativeColumn({ row, rowSpanTags, onHover, format, }) {
16
15
  const integralVal = flag ? formattedValue : `[ ${formattedValue} ]`;
17
16
  function saveHandler(event) {
18
17
  dispatch({
19
- type: Types_1.CHANGE_RANGE_RELATIVE,
18
+ type: 'CHANGE_RANGE_RELATIVE',
20
19
  payload: {
21
- data: { value: event.target.value, id: row.id },
20
+ value: event.target.value,
21
+ id: row.id,
22
22
  },
23
23
  });
24
24
  }
@@ -7,14 +7,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const nmr_processing_1 = require("nmr-processing");
8
8
  const DispatchContext_1 = require("../../../context/DispatchContext");
9
9
  const EditableColumn_1 = __importDefault(require("../../../elements/EditableColumn"));
10
- const Types_1 = require("../../../reducer/types/Types");
11
10
  const formatNumber_1 = require("../../../utility/formatNumber");
12
11
  function SignalDeltaColumn({ row, onHover, format, rowSpanTags, }) {
13
12
  const dispatch = (0, DispatchContext_1.useDispatch)();
14
13
  const signal = row.tableMetaInfo.signal;
15
14
  function saveHandler(event) {
16
15
  dispatch({
17
- type: Types_1.CHANGE_RANGE_SIGNAL_VALUE,
16
+ type: 'CHANGE_RANGE_SIGNAL_VALUE',
18
17
  payload: {
19
18
  value: event.target.value,
20
19
  rangeID: row.id,
@@ -10,8 +10,6 @@ const DispatchContext_1 = require("../../../context/DispatchContext");
10
10
  const Modal_1 = require("../../../elements/popup/Modal");
11
11
  const options_1 = require("../../../elements/popup/options");
12
12
  const EditRangeModal_1 = __importDefault(require("../../../modal/editRange/EditRangeModal"));
13
- const Types_1 = require("../../../reducer/types/Types");
14
- const ToolTypes_1 = require("../../../toolbar/ToolTypes");
15
13
  function useEditRangeModal(range) {
16
14
  const dispatch = (0, DispatchContext_1.useDispatch)();
17
15
  const modal = (0, Modal_1.useModal)();
@@ -22,37 +20,41 @@ function useEditRangeModal(range) {
22
20
  const { from, to } = _range;
23
21
  const margin = Math.abs(from - to);
24
22
  dispatch({
25
- type: Types_1.SET_X_DOMAIN,
26
- xDomain: [from - margin, to + margin],
23
+ type: 'SET_X_DOMAIN',
24
+ payload: {
25
+ xDomain: [from - margin, to + margin],
26
+ },
27
27
  });
28
28
  }
29
29
  }, [dispatch, range]);
30
30
  const deleteRange = (0, react_1.useCallback)((id, resetSelectTool = false) => {
31
31
  if (range || id) {
32
32
  dispatch({
33
- type: Types_1.DELETE_RANGE,
33
+ type: 'DELETE_RANGE',
34
34
  payload: {
35
- data: { id: id || range?.id, assignmentData },
35
+ id: id || range?.id,
36
+ assignmentData,
36
37
  resetSelectTool,
37
38
  },
38
39
  });
39
40
  }
40
41
  }, [assignmentData, dispatch, range]);
41
- const changeRangeSignalKind = (0, react_1.useCallback)((value) => {
42
+ const changeRangeSignalKind = (0, react_1.useCallback)((kind) => {
42
43
  if (range) {
43
44
  dispatch({
44
- type: Types_1.CHANGE_RANGE_SIGNAL_KIND,
45
+ type: 'CHANGE_RANGE_SIGNAL_KIND',
45
46
  payload: {
46
- data: { rowData: range, value },
47
+ range,
48
+ kind,
47
49
  },
48
50
  });
49
51
  }
50
52
  }, [dispatch, range]);
51
- const saveEditRangeHandler = (0, react_1.useCallback)((editedRowData, automaticCloseModal = true) => {
53
+ const saveEditRangeHandler = (0, react_1.useCallback)((editedRange, automaticCloseModal = true) => {
52
54
  dispatch({
53
- type: Types_1.SAVE_EDITED_RANGE,
55
+ type: 'SAVE_EDITED_RANGE',
54
56
  payload: {
55
- editedRowData,
57
+ range: editedRange,
56
58
  assignmentData,
57
59
  },
58
60
  });
@@ -71,8 +73,8 @@ function useEditRangeModal(range) {
71
73
  }, [deleteRange, modal, saveEditRangeHandler]);
72
74
  const editRange = (0, react_1.useCallback)((isManual = false) => {
73
75
  dispatch({
74
- type: Types_1.SET_SELECTED_TOOL,
75
- payload: { selectedTool: ToolTypes_1.options.editRange.id },
76
+ type: 'SET_SELECTED_TOOL',
77
+ payload: { selectedTool: 'editRange' },
76
78
  });
77
79
  modal.show((0, jsx_runtime_1.jsx)(EditRangeModal_1.default, { onCloseEditRangeModal: closeEditRangeHandler, onSaveEditRangeModal: saveEditRangeHandler, onZoomEditRangeModal: zoomRange, range: isManual ? {} : range, manualRange: isManual }), {
78
80
  position: options_1.positions.MIDDLE_RIGHT,
@@ -16,7 +16,6 @@ const Modal_1 = require("../../elements/popup/Modal");
16
16
  const useActiveSpectra_1 = require("../../hooks/useActiveSpectra");
17
17
  const useSpectrum_1 = __importDefault(require("../../hooks/useSpectrum"));
18
18
  const Constants_1 = require("../../reducer/core/Constants");
19
- const Types_1 = require("../../reducer/types/Types");
20
19
  const getSpectraByNucleus_1 = require("../../utility/getSpectraByNucleus");
21
20
  const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
22
21
  const SpectraAutomaticPickingButton_1 = require("../header/SpectraAutomaticPickingButton");
@@ -44,7 +43,7 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
44
43
  {
45
44
  text: 'Yes',
46
45
  handler: () => {
47
- dispatch({ type: Types_1.DELETE_SPECTRA });
46
+ dispatch({ type: 'DELETE_SPECTRA', payload: {} });
48
47
  },
49
48
  },
50
49
  { text: 'No' },
@@ -53,34 +52,37 @@ function SpectraPanelHeaderInner({ data, activeSpectrum, activeSpectra, activeTa
53
52
  }, [activeSpectra?.length, dispatch, modal]);
54
53
  function showAllSpectrumsHandler() {
55
54
  dispatch({
56
- type: Types_1.CHANGE_VISIBILITY,
55
+ type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
57
56
  payload: { nucleus: activeTab, flag: true },
58
57
  });
59
58
  }
60
59
  function hideAllSpectrumsHandler() {
61
60
  dispatch({
62
- type: Types_1.CHANGE_VISIBILITY,
61
+ type: 'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
63
62
  payload: { nucleus: activeTab, flag: false },
64
63
  });
65
64
  }
66
65
  function addMissingProjectionHandler() {
67
66
  const missingNucleus = getMissingProjection(data, activeTab);
68
67
  if (missingNucleus.length > 0) {
69
- dispatch({ type: Types_1.ADD_MISSING_PROJECTION, nucleus: missingNucleus });
68
+ dispatch({
69
+ type: 'ADD_MISSING_PROJECTION',
70
+ payload: { nucleus: missingNucleus },
71
+ });
70
72
  }
71
73
  else {
72
74
  alert.error('Nothing to calculate');
73
75
  }
74
76
  }
75
77
  function setSameTopHandler() {
76
- dispatch({ type: Types_1.SET_SPECTRA_SAME_TOP });
78
+ dispatch({ type: 'SET_SPECTRA_SAME_TOP' });
77
79
  }
78
80
  function resetScaleHandler() {
79
- dispatch({ type: Types_1.RESET_SPECTRA_SCALE });
81
+ dispatch({ type: 'RESET_SPECTRA_SCALE' });
80
82
  }
81
83
  function recolorSpectraHandler() {
82
84
  dispatch({
83
- type: Types_1.RECOLOR_SPECTRA_COLOR,
85
+ type: 'RECOLOR_SPECTRA_COLOR',
84
86
  payload: {},
85
87
  });
86
88
  }
@@ -92,13 +94,11 @@ function SpectrumsTabs({ onSettingClick, }) {
92
94
  const { data, view: { spectra: { activeTab }, }, displayerMode, } = (0, ChartContext_1.useChartData)();
93
95
  const spectrum = (0, useSpectrum_1.default)();
94
96
  const activeSpectra = (0, useActiveSpectra_1.useActiveSpectra)();
95
- return ((0, jsx_runtime_1.jsx)(MemoizedSpectraPanelHeader, { ...{
96
- data,
97
- activeSpectrum: spectrum,
98
- activeSpectra,
99
- activeTab,
100
- displayerMode,
101
- onSettingClick,
102
- } }));
97
+ return ((0, jsx_runtime_1.jsx)(MemoizedSpectraPanelHeader, { data,
98
+ activeSpectrum: spectrum,
99
+ activeSpectra,
100
+ activeTab,
101
+ displayerMode,
102
+ onSettingClick }));
103
103
  }
104
104
  exports.default = SpectrumsTabs;
@@ -15,14 +15,13 @@ const ReactTable_1 = __importDefault(require("../../elements/ReactTable/ReactTab
15
15
  const Alert_1 = require("../../elements/popup/Alert");
16
16
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
17
17
  const ExportAsJcampModal_1 = __importDefault(require("../../modal/ExportAsJcampModal"));
18
- const Types_1 = require("../../reducer/types/Types");
19
18
  const export_1 = require("../../utility/export");
20
19
  const ColorIndicator_1 = __importDefault(require("./base/ColorIndicator"));
21
20
  const ShowHideSpectrumButton_1 = __importDefault(require("./base/ShowHideSpectrumButton"));
22
21
  const SpectrumName_1 = require("./base/SpectrumName");
23
22
  function formatValueAsHTML(value) {
24
23
  if (value) {
25
- value = value.replace(/(?<value>\d+)/g, '<sub>$<value></sub>');
24
+ value = value.replaceAll(/(?<value>\d+)/g, '<sub>$<value></sub>');
26
25
  }
27
26
  return value;
28
27
  }
@@ -151,7 +150,7 @@ function SpectraTable(props) {
151
150
  }
152
151
  case SpectraContextMenuOptionsKeys.Delete: {
153
152
  setTimeout(() => {
154
- dispatch({ type: Types_1.DELETE_SPECTRA, id: spectrum.id });
153
+ dispatch({ type: 'DELETE_SPECTRA', payload: { id: spectrum.id } });
155
154
  }, 0);
156
155
  break;
157
156
  }
@@ -201,7 +200,7 @@ function SpectraTable(props) {
201
200
  }, [COLUMNS, spectraPreferences.columns]);
202
201
  function handleSortEnd(data) {
203
202
  dispatch({
204
- type: Types_1.ORDER_SPECTRA,
203
+ type: 'ORDER_SPECTRA',
205
204
  payload: {
206
205
  data,
207
206
  },
@@ -224,7 +223,10 @@ const ColumnHeader = ({ label, col, }) => {
224
223
  const dispatch = (0, DispatchContext_1.useDispatch)();
225
224
  function selectHandler() {
226
225
  if (col?.jpath) {
227
- dispatch({ type: Types_1.RECOLOR_SPECTRA_COLOR, payload: { jpath: col?.jpath } });
226
+ dispatch({
227
+ type: 'RECOLOR_SPECTRA_COLOR',
228
+ payload: { jpath: col?.jpath },
229
+ });
228
230
  }
229
231
  }
230
232
  return ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "contextMenu", options: options, onSelect: selectHandler, children: (0, jsx_runtime_1.jsx)("div", { style: {
@@ -12,7 +12,6 @@ const DispatchContext_1 = require("../../context/DispatchContext");
12
12
  const IsotopesViewer_1 = __importDefault(require("../../elements/IsotopesViewer"));
13
13
  const Tab_1 = __importDefault(require("../../elements/Tab/Tab"));
14
14
  const Tabs_1 = __importDefault(require("../../elements/Tab/Tabs"));
15
- const Types_1 = require("../../reducer/types/Types");
16
15
  const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
17
16
  const SpectraTable_1 = require("./SpectraTable");
18
17
  const SpectrumSetting_1 = __importDefault(require("./base/setting/SpectrumSetting"));
@@ -28,7 +27,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
28
27
  return groupByNucleus(data, true);
29
28
  }, [data]);
30
29
  function onTabChangeHandler(tab) {
31
- dispatch({ type: Types_1.SET_ACTIVE_TAB, tab: tab.tabid });
30
+ dispatch({ type: 'SET_ACTIVE_TAB', payload: { tab: tab.tabid } });
32
31
  }
33
32
  const openSettingHandler = (0, react_2.useCallback)((event, selectedSpectrum) => {
34
33
  event.stopPropagation();
@@ -41,7 +40,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
41
40
  }, []);
42
41
  const handleChangeVisibility = (0, react_2.useCallback)((d, key) => {
43
42
  dispatch({
44
- type: Types_1.CHANGE_VISIBILITY,
43
+ type: 'CHANGE_SPECTRUM_VISIBILITY',
45
44
  payload: {
46
45
  id: d.id,
47
46
  key,
@@ -52,7 +51,7 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
52
51
  setTimeout(() => {
53
52
  const modifier = `shift[${e.shiftKey ? 'true' : 'false'}]_ctrl[${e.ctrlKey ? 'true' : 'false'}]`;
54
53
  dispatch({
55
- type: Types_1.CHANGE_ACTIVE_SPECTRUM,
54
+ type: 'CHANGE_ACTIVE_SPECTRUM',
56
55
  payload: { modifier, id: spectrum.id },
57
56
  });
58
57
  }, 0);
@@ -70,6 +69,6 @@ function SpectrumsTabsInner({ data, activeSpectra, activeTab, }) {
70
69
  const MemoizedSpectra = (0, react_2.memo)(SpectrumsTabsInner);
71
70
  function SpectrumsTabs() {
72
71
  const { data, view: { spectra: { activeTab, activeSpectra }, }, } = (0, ChartContext_1.useChartData)();
73
- return (0, jsx_runtime_1.jsx)(MemoizedSpectra, { ...{ data, activeSpectra, activeTab } });
72
+ return (0, jsx_runtime_1.jsx)(MemoizedSpectra, { data, activeSpectra, activeTab });
74
73
  }
75
74
  exports.default = SpectrumsTabs;
@@ -20,13 +20,9 @@ function getStyle(display, key) {
20
20
  };
21
21
  }
22
22
  function ShowHideSpectrumButton({ data, onChangeVisibility, }) {
23
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(DisplayButtons1D, { ...{
24
- data,
25
- onChangeVisibility,
26
- } }), (0, jsx_runtime_1.jsx)(DisplayButtons2D, { ...{
27
- data,
28
- onChangeVisibility,
29
- } })] }));
23
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(DisplayButtons1D, { data,
24
+ onChangeVisibility }), (0, jsx_runtime_1.jsx)(DisplayButtons2D, { data,
25
+ onChangeVisibility })] }));
30
26
  }
31
27
  exports.default = ShowHideSpectrumButton;
32
28
  function DisplayButtons1D(props) {
@@ -8,7 +8,6 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
8
  const react_1 = require("@emotion/react");
9
9
  const react_2 = require("react");
10
10
  const DispatchContext_1 = require("../../../../context/DispatchContext");
11
- const Types_1 = require("../../../../reducer/types/Types");
12
11
  const Spectrum1DSetting_1 = __importDefault(require("./Spectrum1DSetting"));
13
12
  const Spectrum2DSetting_1 = __importDefault(require("./Spectrum2DSetting"));
14
13
  const style = (0, react_1.css) `
@@ -73,7 +72,10 @@ function SpectrumSetting({ position, data, onClose }) {
73
72
  const dispatch = (0, DispatchContext_1.useDispatch)();
74
73
  const { id, info } = data;
75
74
  const submitHandler = (0, react_2.useCallback)((values) => {
76
- dispatch({ type: Types_1.CHANGE_SPECTRUM_SETTING, id, display: values });
75
+ dispatch({
76
+ type: 'CHANGE_SPECTRUM_SETTING',
77
+ payload: { id, display: values },
78
+ });
77
79
  }, [dispatch, id]);
78
80
  const clickHandler = (0, react_2.useCallback)((e) => {
79
81
  if (e.target === e.currentTarget) {
@@ -22,8 +22,8 @@ exports.processSnapPlot = processSnapPlot;
22
22
  function getLine(value, data, options) {
23
23
  const { log10, abs } = Math;
24
24
  const { yLogBase } = options;
25
- const first = data.length > 0 ? data[0].x : 0;
26
- const last = data.length > 0 ? data[data.length - 1].x : 0;
25
+ const first = data.at(0)?.x ?? 0;
26
+ const last = data.at(-1)?.x ?? 0;
27
27
  const inLogScale = log10(abs(value)) / log10(yLogBase);
28
28
  return [
29
29
  { x: first, y: inLogScale },
@@ -176,19 +176,15 @@ function CorrelationTableRow({ additionalColumnData, correlations, correlation,
176
176
  }, [contextRef]);
177
177
  const { title, ...otherTableDataProps } = tableDataProps;
178
178
  const t = title || '';
179
- return ((0, jsx_runtime_1.jsxs)("tr", { style: styleRow, children: [(0, jsx_runtime_1.jsxs)("td", { title: t, ...{
180
- ...otherTableDataProps,
181
- style: { ...tableDataProps.style, styleLabel },
182
- }, onContextMenu: (e) => {
179
+ return ((0, jsx_runtime_1.jsxs)("tr", { style: styleRow, children: [(0, jsx_runtime_1.jsxs)("td", { title: t, ...otherTableDataProps,
180
+ style: { ...tableDataProps.style, styleLabel }, onContextMenu: (e) => {
183
181
  if (contextMenu.length > 0) {
184
182
  contextMenuHandler(e);
185
183
  }
186
184
  }, children: [(0, nmr_correlation_1.getLabel)(correlations, correlation), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: contextMenu })] }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: (0, nmr_correlation_1.getCorrelationDelta)(correlation)
187
185
  ? (0, nmr_correlation_1.getCorrelationDelta)(correlation)?.toFixed(2)
188
- : '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("text", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...{
189
- ...otherTableDataProps,
190
- style: { ...tableDataProps.style, borderRight: '1px solid' },
191
- }, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
186
+ : '' }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "number", value: correlation.equivalence, style: equivalenceCellStyle, onSave: onSaveEquivalencesHandler })) : ((0, jsx_runtime_1.jsx)("text", { style: equivalenceCellStyle, children: correlation.equivalence })) }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.protonsCount.join(','), style: correlation.edited.protonsCount ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'protonsCount') })) : ('') }), (0, jsx_runtime_1.jsx)("td", { title: t, ...otherTableDataProps,
187
+ style: { ...tableDataProps.style, borderRight: '1px solid' }, children: correlation.atomType !== 'H' ? ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { type: "text", value: correlation.hybridization
192
188
  .map((hybrid) => `sp${hybrid}`)
193
189
  .join(','), style: correlation.edited.hybridization ? { color: 'blue' } : {}, onSave: (e) => onSaveEditNumericValuesHandler(e, 'hybridization') })) : ('') }), additionalColumnFields] }));
194
190
  }