nmrium 0.37.0 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) 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/database/DatabaseSpectrum.js +2 -1
  4. package/lib/component/1d/integral/Integral.d.ts +2 -6
  5. package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
  6. package/lib/component/1d/integral/IntegralResizable.js +2 -3
  7. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  8. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  9. package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
  10. package/lib/component/1d/ranges/Range.js +9 -8
  11. package/lib/component/1d/ranges/Ranges.js +5 -7
  12. package/lib/component/1d/tool/BaseLineZones.js +1 -2
  13. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  14. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  15. package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
  16. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  17. package/lib/component/2d/Chart2D.js +1 -1
  18. package/lib/component/2d/Viewer2D.js +10 -9
  19. package/lib/component/2d/fid/FidCanvas.js +4 -6
  20. package/lib/component/2d/ft/Contours.js +1 -1
  21. package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
  22. package/lib/component/2d/utilities/scale.d.ts +2 -1
  23. package/lib/component/2d/utilities/scale.js +1 -1
  24. package/lib/component/2d/zones/Zones.js +1 -1
  25. package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
  26. package/lib/component/NMRium.js +15 -7
  27. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  28. package/lib/component/context/DispatchContext.d.ts +23 -3
  29. package/lib/component/context/DispatchContext.js +1 -1
  30. package/lib/component/context/LoggerContext.js +1 -1
  31. package/lib/component/elements/Button.js +7 -9
  32. package/lib/component/elements/IsotopesViewer.js +1 -1
  33. package/lib/component/elements/ReactTable/ReactTable.js +1 -2
  34. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  35. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  36. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  37. package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
  38. package/lib/component/elements/formik/FormikInput.js +1 -1
  39. package/lib/component/elements/formik/FormikSelect.js +2 -2
  40. package/lib/component/elements/formik/FormikSlider.js +1 -1
  41. package/lib/component/elements/formik/FormikTextarea.js +2 -2
  42. package/lib/component/header/ApodizationOptionsPanel.js +4 -5
  43. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
  44. package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
  45. package/lib/component/header/Header.js +4 -6
  46. package/lib/component/header/PhaseCorrectionPanel.js +7 -8
  47. package/lib/component/header/RangesPickingOptionPanel.js +1 -2
  48. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
  49. package/lib/component/header/Zones2DOptionPanel.js +5 -6
  50. package/lib/component/hooks/useExport.js +1 -0
  51. package/lib/component/hooks/useToolsFunctions.js +8 -10
  52. package/lib/component/loader/DropZone.js +4 -5
  53. package/lib/component/loader/NoData.js +1 -1
  54. package/lib/component/modal/AlignSpectraModal.js +1 -2
  55. package/lib/component/modal/EditPeakShapeModal.js +1 -2
  56. package/lib/component/modal/ImportPublicationStringModal.js +1 -2
  57. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  58. package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
  59. package/lib/component/modal/PredictSpectraModal.d.ts +1 -1
  60. package/lib/component/modal/PredictSpectraModal.js +24 -21
  61. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  62. package/lib/component/modal/editRange/EditRangeModal.js +3 -4
  63. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  64. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  65. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
  66. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  67. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  68. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  69. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  70. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  71. package/lib/component/panels/InformationPanel.js +6 -6
  72. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  73. package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  74. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  75. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  76. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  77. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  78. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  79. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +5 -6
  80. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
  81. package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
  82. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  83. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  84. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  85. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  86. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  87. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  88. package/lib/component/panels/Panels.js +1 -1
  89. package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  90. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
  91. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
  92. package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
  93. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  94. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  95. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  96. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  97. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  98. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  99. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  100. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  101. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  102. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  103. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  104. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  105. package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  106. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  107. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
  108. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  109. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
  110. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  111. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
  112. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  113. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  114. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
  115. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  116. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
  117. package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  118. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
  119. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
  120. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
  121. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
  122. package/lib/component/panels/databasePanel/DatabasePanel.js +15 -11
  123. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
  124. package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
  125. package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
  126. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  127. package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
  128. package/lib/component/reducer/IgnoreActions.d.ts +2 -1
  129. package/lib/component/reducer/IgnoreActions.js +35 -32
  130. package/lib/component/reducer/Reducer.d.ts +8 -5
  131. package/lib/component/reducer/Reducer.js +202 -220
  132. package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
  133. package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
  134. package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
  135. package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
  136. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
  137. package/lib/component/reducer/actions/DatabaseActions.js +5 -2
  138. package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
  139. package/lib/component/reducer/actions/DimensionsActions.js +3 -5
  140. package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
  141. package/lib/component/reducer/actions/DomainActions.js +13 -19
  142. package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
  143. package/lib/component/reducer/actions/FiltersActions.js +250 -255
  144. package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
  145. package/lib/component/reducer/actions/GlobalActions.js +3 -3
  146. package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
  147. package/lib/component/reducer/actions/IntegralsActions.js +16 -15
  148. package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
  149. package/lib/component/reducer/actions/LoadActions.js +52 -52
  150. package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
  151. package/lib/component/reducer/actions/MoleculeActions.js +27 -18
  152. package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
  153. package/lib/component/reducer/actions/PeaksActions.js +19 -11
  154. package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
  155. package/lib/component/reducer/actions/PreferencesActions.js +5 -3
  156. package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
  157. package/lib/component/reducer/actions/RangesActions.js +80 -65
  158. package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
  159. package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
  160. package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
  161. package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
  162. package/lib/component/reducer/actions/ToolsActions.js +54 -32
  163. package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
  164. package/lib/component/reducer/actions/ZonesActions.js +68 -49
  165. package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
  166. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  167. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
  168. package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
  169. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  170. package/lib/component/reducer/types/ActionType.d.ts +6 -0
  171. package/lib/component/reducer/types/ActionType.js +1 -0
  172. package/lib/component/toolbar/BasicToolBar.js +6 -9
  173. package/lib/component/toolbar/FunctionToolBar.js +4 -9
  174. package/lib/component/toolbar/ToolBar.js +1 -1
  175. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  176. package/lib/component/utility/Events.d.ts +4 -4
  177. package/lib/component/utility/Events.js +2 -2
  178. package/lib/component/utility/GroupByInfoKey.js +1 -1
  179. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  180. package/lib/data/PredictionManager.d.ts +7 -9
  181. package/lib/data/PredictionManager.js +3 -3
  182. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  183. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  184. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
  185. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  186. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
  187. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
  188. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
  189. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
  190. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  191. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  192. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
  193. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  194. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
  195. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
  196. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
  197. package/lib/data/matrixGeneration.js +4 -2
  198. package/lib/data/molecules/Molecule.d.ts +3 -3
  199. package/lib/data/molecules/MoleculeManager.d.ts +5 -5
  200. package/lib/data/molecules/MoleculeManager.js +1 -1
  201. package/lib/data/utilities/generateColor.js +1 -1
  202. package/lib/data/utilities/isNumber.d.ts +1 -0
  203. package/lib/data/utilities/isNumber.js +3 -0
  204. package/lib/versionInfo.js +1 -1
  205. package/lib-cjs/component/1d/FooterBanner.js +1 -1
  206. package/lib-cjs/component/1d/Viewer1D.js +25 -20
  207. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
  208. package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
  209. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  210. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  211. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
  212. package/lib-cjs/component/1d/ranges/Range.js +9 -8
  213. package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
  214. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
  215. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  216. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  217. package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
  218. package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  219. package/lib-cjs/component/2d/Chart2D.js +1 -1
  220. package/lib-cjs/component/2d/Viewer2D.js +10 -9
  221. package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
  222. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  223. package/lib-cjs/component/2d/utilities/scale.js +1 -1
  224. package/lib-cjs/component/2d/zones/Zones.js +1 -1
  225. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
  226. package/lib-cjs/component/NMRium.js +15 -7
  227. package/lib-cjs/component/context/DispatchContext.js +1 -1
  228. package/lib-cjs/component/context/LoggerContext.js +1 -1
  229. package/lib-cjs/component/elements/Button.js +7 -9
  230. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  231. package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
  232. package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
  233. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  234. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  235. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  236. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
  237. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  238. package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
  239. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  240. package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
  241. package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
  242. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
  243. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
  244. package/lib-cjs/component/header/Header.js +4 -6
  245. package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
  246. package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
  247. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
  248. package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
  249. package/lib-cjs/component/highlight/index.js +1 -1
  250. package/lib-cjs/component/hooks/useExport.js +1 -0
  251. package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
  252. package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
  253. package/lib-cjs/component/hooks/useXYReduce.js +1 -1
  254. package/lib-cjs/component/loader/DropZone.js +4 -5
  255. package/lib-cjs/component/loader/NoData.js +1 -1
  256. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  257. package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
  258. package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
  259. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
  260. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
  261. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
  262. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  263. package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
  264. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  265. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  266. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
  267. package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  268. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  269. package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  270. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  271. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  272. package/lib-cjs/component/panels/InformationPanel.js +6 -6
  273. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  274. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
  275. package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  276. package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  277. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  278. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  279. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  280. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +5 -6
  281. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
  282. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  283. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  284. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  285. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  286. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  287. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  288. package/lib-cjs/component/panels/Panels.js +1 -1
  289. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  290. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
  291. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
  292. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
  293. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
  294. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  295. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  296. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  297. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  298. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  299. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  300. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  301. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  302. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  303. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  304. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  305. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  306. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  307. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  308. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  309. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
  310. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  311. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
  312. package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
  313. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +14 -10
  314. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
  315. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
  316. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
  317. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  318. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
  319. package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
  320. package/lib-cjs/component/reducer/Reducer.js +202 -220
  321. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
  322. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
  323. package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
  324. package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
  325. package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
  326. package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
  327. package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
  328. package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
  329. package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
  330. package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
  331. package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
  332. package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
  333. package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
  334. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
  335. package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
  336. package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
  337. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  338. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
  339. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
  340. package/lib-cjs/component/reducer/types/ActionType.js +2 -0
  341. package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
  342. package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
  343. package/lib-cjs/component/toolbar/ToolBar.js +1 -1
  344. package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
  345. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  346. package/lib-cjs/data/PredictionManager.js +3 -3
  347. package/lib-cjs/data/SpectraManager.js +1 -1
  348. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  349. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  350. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  351. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
  352. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  353. package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  354. package/lib-cjs/data/matrixGeneration.js +4 -2
  355. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  356. package/lib-cjs/data/utilities/generateColor.js +1 -1
  357. package/lib-cjs/data/utilities/isNumber.js +7 -0
  358. package/lib-cjs/versionInfo.js +1 -1
  359. package/package.json +24 -23
  360. package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
  361. package/lib/component/reducer/actions/HistoryActions.js +0 -40
  362. package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
  363. package/lib/component/reducer/types/HistoryTypes.js +0 -4
  364. package/lib/component/reducer/types/Types.d.ts +0 -132
  365. package/lib/component/reducer/types/Types.js +0 -126
  366. package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
  367. package/lib/component/toolbar/HistoryToolBar.js +0 -30
  368. package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
  369. package/lib/data/utilities/isMolFileEmpty.js +0 -6
  370. package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
  371. package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
  372. package/lib-cjs/component/reducer/types/Types.js +0 -131
  373. package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
  374. package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
@@ -1,37 +1,4 @@
1
1
  import { Range, Spectrum1D } from 'nmr-load-save';
2
+ import { NMRRange } from 'nmr-processing';
2
3
  import { MapOptions } from '../../../types/common/MapOptions';
3
- export declare function mapRanges(ranges: Range[], spectrum: Spectrum1D, options?: MapOptions): {
4
- absolute: number;
5
- signals: {
6
- originDelta: number | undefined;
7
- delta: number;
8
- multiplicity: string;
9
- js: import("nmr-processing").Jcoupling[];
10
- integration?: number | undefined;
11
- diaIDs?: string[] | undefined;
12
- nbAtoms?: number | undefined;
13
- atoms?: number[] | undefined;
14
- assignment?: string | undefined;
15
- peaks?: import("nmr-processing").NMRPeak1D[] | undefined;
16
- statistic?: {
17
- mean: number;
18
- sd: number;
19
- min: number;
20
- max: number;
21
- nb: number;
22
- } | undefined;
23
- kind: string;
24
- id: string;
25
- }[];
26
- originFrom: number | undefined;
27
- originTo: number | undefined;
28
- from: number;
29
- to: number;
30
- id: string;
31
- kind: string;
32
- integration: number;
33
- nbAtoms?: number | undefined;
34
- diaIDs?: string[] | undefined;
35
- pubIntegral?: number | undefined;
36
- multiplicity?: string | undefined;
37
- }[];
4
+ export declare function mapRanges(ranges: Range[] | NMRRange[], spectrum: Spectrum1D, options?: MapOptions): any[];
@@ -8,21 +8,18 @@ export declare const DOMAIN_UPDATE_RULES: Readonly<FilterDomainUpdateRules>;
8
8
  * @param {Spectrum1D} spectrum
9
9
  */
10
10
  export type BaselineAlgorithms = 'airpls' | 'polynomial';
11
+ export interface BaselineCorrectionZone {
12
+ from: number;
13
+ to: number;
14
+ id: string;
15
+ }
11
16
  export interface PolynomialOptions {
12
- zones: Array<{
13
- from: number;
14
- to: number;
15
- id: string;
16
- }>;
17
+ zones: BaselineCorrectionZone[];
17
18
  algorithm: 'polynomial';
18
19
  degree: number;
19
20
  }
20
21
  export interface AirplsOptions {
21
- zones: Array<{
22
- from: number;
23
- to: number;
24
- id: string;
25
- }>;
22
+ zones: BaselineCorrectionZone[];
26
23
  algorithm: 'airpls';
27
24
  maxIterations: number;
28
25
  tolerance: number;
@@ -27,7 +27,7 @@ export interface AnalysisOptions {
27
27
  columns: SpectraAnalysisColumns;
28
28
  columnIndex: number;
29
29
  }
30
- interface AnalysisRow extends RangeDetectionResult {
30
+ export interface AnalysisRow extends RangeDetectionResult {
31
31
  SID: string;
32
32
  colKey?: string;
33
33
  value?: number;
@@ -26,7 +26,7 @@ export function initiateDatum2D(spectrum, usedColors = {}) {
26
26
  };
27
27
  datum.originalInfo = datum.info;
28
28
  datum.meta = { ...spectrum.meta };
29
- datum.metaInfo = { ...spectrum.metaInfo };
29
+ datum.customInfo = { ...spectrum.customInfo };
30
30
  datum.data = getData(datum, spectrum);
31
31
  datum.originalData = datum.data;
32
32
  datum.filters = Object.assign([], spectrum.filters);
@@ -7,7 +7,11 @@ import { Spectrum2D } from 'nmr-load-save';
7
7
  * @param {number} signal.y
8
8
  * @param {string} signal.id
9
9
  */
10
- export declare function changeZoneSignal(spectrum: Spectrum2D, zoneID: any, newSignal: any): {
10
+ export declare function changeZoneSignal(spectrum: Spectrum2D, zoneID: string, signal: {
11
+ id?: string;
12
+ deltaX?: number;
13
+ deltaY?: number;
14
+ }): {
11
15
  xShift: number;
12
16
  yShift: number;
13
17
  };
@@ -1,3 +1,4 @@
1
+ import { isNumber } from '../../../utilities/isNumber';
1
2
  /**
2
3
  *
3
4
  * @param {number} zoneID
@@ -6,19 +7,16 @@
6
7
  * @param {number} signal.y
7
8
  * @param {string} signal.id
8
9
  */
9
- export function changeZoneSignal(spectrum, zoneID, newSignal) {
10
+ export function changeZoneSignal(spectrum, zoneID, signal) {
10
11
  const zoneIndex = spectrum.zones.values.findIndex((zone) => zone.id === zoneID);
12
+ const { id, deltaX, deltaY } = signal;
11
13
  if (zoneIndex !== -1) {
12
- const signalIndex = spectrum.zones.values[zoneIndex].signals.findIndex((s) => s.id === newSignal.id);
14
+ const signalIndex = spectrum.zones.values[zoneIndex].signals.findIndex((s) => s.id === id);
13
15
  const zone = spectrum.zones.values[zoneIndex];
14
16
  if (signalIndex !== -1) {
15
17
  const originalSignal = zone.signals[signalIndex];
16
- const xShift = newSignal?.x || newSignal?.x === 0
17
- ? newSignal.x - originalSignal.x.delta
18
- : 0;
19
- const yShift = newSignal?.y || newSignal?.y === 0
20
- ? newSignal.y - originalSignal.y?.delta
21
- : 0;
18
+ const xShift = isNumber(deltaX) ? deltaX - originalSignal.x.delta : 0;
19
+ const yShift = isNumber(deltaY) ? deltaY - originalSignal.y?.delta : 0;
22
20
  return { xShift, yShift };
23
21
  }
24
22
  }
@@ -26,11 +26,13 @@ export declare function detectZonesManual(datum: any, options: DetectionZonesOpt
26
26
  x: {
27
27
  originDelta: number;
28
28
  delta: number;
29
+ nbAtoms?: number | undefined;
29
30
  diaIDs?: string[] | undefined;
30
31
  };
31
32
  y: {
32
33
  originDelta: number;
33
34
  delta: number;
35
+ nbAtoms?: number | undefined;
34
36
  diaIDs?: string[] | undefined;
35
37
  };
36
38
  sign?: number | undefined;
@@ -25,11 +25,13 @@ export declare function initiateZones(options: Partial<{
25
25
  x: {
26
26
  originDelta: number;
27
27
  delta: number;
28
+ nbAtoms?: number | undefined;
28
29
  diaIDs?: string[] | undefined;
29
30
  };
30
31
  y: {
31
32
  originDelta: number;
32
33
  delta: number;
34
+ nbAtoms?: number | undefined;
33
35
  diaIDs?: string[] | undefined;
34
36
  };
35
37
  sign?: number | undefined;
@@ -16,11 +16,13 @@ export declare function mapZones(zones: Zone[], datum: Spectrum2D, options?: Map
16
16
  x: {
17
17
  originDelta: number;
18
18
  delta: number;
19
+ nbAtoms?: number | undefined;
19
20
  diaIDs?: string[] | undefined;
20
21
  };
21
22
  y: {
22
23
  originDelta: number;
23
24
  delta: number;
25
+ nbAtoms?: number | undefined;
24
26
  diaIDs?: string[] | undefined;
25
27
  };
26
28
  sign?: number | undefined;
@@ -1,7 +1,7 @@
1
1
  import lodashSet from 'lodash/set';
2
2
  import filterXY from 'ml-signal-processing/FilterXYSchema.json';
3
3
  export function normalCase(str) {
4
- const result = str.replace(/(?<upper>[A-Z])/g, ' $<upper>').trim();
4
+ const result = str.replaceAll(/(?<upper>[A-Z])/g, ' $<upper>').trim();
5
5
  return result.charAt(0).toUpperCase() + result.slice(1);
6
6
  }
7
7
  function isLeave(fieldOptions) {
@@ -99,7 +99,9 @@ function generateFilterOptions(properties) {
99
99
  lodashSet(options, key, []);
100
100
  break;
101
101
  case 'select':
102
- lodashSet(options, key, field.default ? field.default.replace(/'|"/g, '') : field.choices[0]);
102
+ lodashSet(options, key, field.default
103
+ ? field.default.replaceAll(/'|"/g, '')
104
+ : field.choices[0]);
103
105
  break;
104
106
  case 'string':
105
107
  lodashSet(options, key, undefined);
@@ -1,9 +1,9 @@
1
1
  export interface StateMolecule {
2
- id: string;
2
+ id?: string;
3
3
  molfile: string;
4
- label: string;
4
+ label?: string;
5
5
  }
6
- export interface StateMoleculeExtended extends StateMolecule {
6
+ export interface StateMoleculeExtended extends Required<StateMolecule> {
7
7
  mf: string;
8
8
  em: number;
9
9
  mw: number;
@@ -1,7 +1,7 @@
1
- import { StateMoleculeExtended } from './Molecule';
2
- export declare function fromJSON(mols: StateMoleculeExtended[], reservedMolecules?: StateMoleculeExtended[]): StateMoleculeExtended[];
3
- export declare function addMolfile(molecules: any, molfile: any): void;
4
- export declare function setMolfile(molecules: any, currentMolecule: Pick<StateMoleculeExtended, 'id' | 'molfile' | 'label'>): void;
1
+ import { StateMolecule, StateMoleculeExtended } from './Molecule';
2
+ export declare function fromJSON(mols: StateMolecule[], reservedMolecules?: StateMolecule[]): StateMoleculeExtended[];
3
+ export declare function addMolfile(molecules: StateMoleculeExtended[], molfile: string): void;
4
+ export declare function setMolfile(molecules: StateMoleculeExtended[], currentMolecule: StateMolecule): void;
5
5
  export declare function extractNumber(value: string): string | null;
6
- export declare function extractLabelsNumbers(molecules: StateMoleculeExtended[]): number[];
6
+ export declare function extractLabelsNumbers(molecules: Pick<StateMolecule, 'label'>[]): number[];
7
7
  export declare function getLabelNumber(reserveNumbers: number[]): number;
@@ -64,7 +64,7 @@ export function extractNumber(value) {
64
64
  export function extractLabelsNumbers(molecules) {
65
65
  const values = [];
66
66
  for (const molecule of molecules) {
67
- const value = extractNumber(molecule.label);
67
+ const value = extractNumber(molecule?.label || '');
68
68
  if (value) {
69
69
  values.push(Number(value));
70
70
  }
@@ -52,7 +52,7 @@ export function generateColor(isRandom = false, usedColors = [], opacity = 100)
52
52
  }
53
53
  else {
54
54
  const lum = -0.25;
55
- let hex = String(`#${Math.random().toString(16).slice(2, 8).toUpperCase()}`).replace(/[^\da-f]/gi, '');
55
+ let hex = String(`#${Math.random().toString(16).slice(2, 8).toUpperCase()}`).replaceAll(/[^\da-f]/gi, '');
56
56
  if (hex.length < 6) {
57
57
  hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
58
58
  }
@@ -0,0 +1 @@
1
+ export declare function isNumber(value: any): value is number;
@@ -0,0 +1,3 @@
1
+ export function isNumber(value) {
2
+ return typeof value === 'number' && Number(value).toString() !== 'NaN';
3
+ }
@@ -1 +1 @@
1
- export default { version: 'v0.37.0' };
1
+ export default { version: 'v0.38.1' };
@@ -116,6 +116,6 @@ function FooterBanner() {
116
116
  const { margin, width, height, view: { spectra: { activeTab }, }, } = (0, ChartContext_1.useChartData)();
117
117
  const activeSpectrum = (0, useActiveSpectrum_1.useActiveSpectrum)();
118
118
  const spectrum = (0, useSpectrum_1.default)(null);
119
- return ((0, jsx_runtime_1.jsx)(MemoizedFooterBanner, { ...{ margin, width, height, activeSpectrum, spectrum, activeTab } }));
119
+ return ((0, jsx_runtime_1.jsx)(MemoizedFooterBanner, { margin, width, height, activeSpectrum, spectrum, activeTab }));
120
120
  }
121
121
  exports.default = FooterBanner;
@@ -49,7 +49,6 @@ const MultipletAnalysisModal_1 = __importDefault(require("../modal/MultipletAnal
49
49
  const Zoom1DManager_1 = require("../reducer/helper/Zoom1DManager");
50
50
  const getRange_1 = __importDefault(require("../reducer/helper/getRange"));
51
51
  const scaleReducer_1 = __importStar(require("../reducer/scaleReducer"));
52
- const Types_1 = require("../reducer/types/Types");
53
52
  const ToolTypes_1 = require("../toolbar/ToolTypes");
54
53
  const Events_1 = __importDefault(require("../utility/Events"));
55
54
  const Chart1D_1 = __importDefault(require("./Chart1D"));
@@ -125,8 +124,8 @@ function Viewer1D({ emptyText = undefined }) {
125
124
  switch (selectedTool) {
126
125
  case ToolTypes_1.options.integral.id:
127
126
  dispatch({
128
- type: Types_1.ADD_INTEGRAL,
129
- ...brushData,
127
+ type: 'ADD_INTEGRAL',
128
+ payload: brushData,
130
129
  });
131
130
  break;
132
131
  case ToolTypes_1.options.rangePicking.id: {
@@ -140,10 +139,8 @@ function Viewer1D({ emptyText = undefined }) {
140
139
  const { fromIndex, toIndex } = (0, ml_spectra_processing_1.xGetFromToIndex)(x, { from, to });
141
140
  if (toIndex - fromIndex <= detectSignal_1.MAX_LENGTH) {
142
141
  dispatch({
143
- type: Types_1.ADD_RANGE,
144
- payload: {
145
- ...brushData,
146
- },
142
+ type: 'ADD_RANGE',
143
+ payload: brushData,
147
144
  });
148
145
  }
149
146
  else {
@@ -168,20 +165,23 @@ function Viewer1D({ emptyText = undefined }) {
168
165
  break;
169
166
  case ToolTypes_1.options.peakPicking.id:
170
167
  dispatch({
171
- type: Types_1.ADD_PEAKS,
172
- ...brushData,
168
+ type: 'ADD_PEAKS',
169
+ payload: brushData,
173
170
  });
174
171
  break;
175
172
  case ToolTypes_1.options.baselineCorrection.id:
176
173
  dispatch({
177
- type: Types_1.ADD_BASE_LINE_ZONE,
178
- zone: { from: brushData.startX, to: brushData.endX },
174
+ type: 'ADD_BASE_LINE_ZONE',
175
+ payload: {
176
+ startX: brushData.startX,
177
+ endX: brushData.endX,
178
+ },
179
179
  });
180
180
  break;
181
181
  case ToolTypes_1.options.exclusionZones.id:
182
182
  dispatch({
183
- type: Types_1.ADD_EXCLUSION_ZONE,
184
- payload: { from: brushData.startX, to: brushData.endX },
183
+ type: 'ADD_EXCLUSION_ZONE',
184
+ payload: { startX: brushData.startX, endX: brushData.endX },
185
185
  });
186
186
  break;
187
187
  case ToolTypes_1.options.matrixGenerationExclusionZones.id: {
@@ -208,7 +208,7 @@ function Viewer1D({ emptyText = undefined }) {
208
208
  switch (selectedTool) {
209
209
  default:
210
210
  if (selectedTool != null) {
211
- dispatch({ type: Types_1.BRUSH_END, ...brushData });
211
+ dispatch({ type: 'BRUSH_END', payload: brushData });
212
212
  }
213
213
  break;
214
214
  }
@@ -227,10 +227,13 @@ function Viewer1D({ emptyText = undefined }) {
227
227
  alert,
228
228
  ]);
229
229
  const handelOnDoubleClick = (0, react_1.useCallback)(() => {
230
- dispatch({ type: Types_1.FULL_ZOOM_OUT, zoomType: Zoom1DManager_1.ZoomType.STEP_HORIZONTAL });
230
+ dispatch({
231
+ type: 'FULL_ZOOM_OUT',
232
+ payload: { zoomType: Zoom1DManager_1.ZOOM_TYPES.STEP_HORIZONTAL },
233
+ });
231
234
  }, [dispatch]);
232
235
  const handleZoom = (0, react_1.useCallback)((event) => {
233
- dispatch({ type: Types_1.SET_ZOOM, event, selectedTool });
236
+ dispatch({ type: 'SET_ZOOM', payload: { event, selectedTool } });
234
237
  }, [dispatch, selectedTool]);
235
238
  const mouseClick = (0, react_1.useCallback)((position) => {
236
239
  const propagateEvent = () => {
@@ -246,8 +249,8 @@ function Viewer1D({ emptyText = undefined }) {
246
249
  switch (selectedTool) {
247
250
  case ToolTypes_1.options.peakPicking.id:
248
251
  dispatch({
249
- type: Types_1.ADD_PEAK,
250
- mouseCoordinates: position,
252
+ type: 'ADD_PEAK',
253
+ payload: position,
251
254
  });
252
255
  break;
253
256
  case ToolTypes_1.options.editRange.id:
@@ -261,8 +264,10 @@ function Viewer1D({ emptyText = undefined }) {
261
264
  switch (selectedTool) {
262
265
  case ToolTypes_1.options.phaseCorrection.id:
263
266
  dispatch({
264
- type: Types_1.SET_VERTICAL_INDICATOR_X_POSITION,
265
- position: position.x,
267
+ type: 'SET_VERTICAL_INDICATOR_X_POSITION',
268
+ payload: {
269
+ position: position.x,
270
+ },
266
271
  });
267
272
  break;
268
273
  default:
@@ -36,8 +36,9 @@ function DatabaseSpectrum() {
36
36
  const loadSpectrum = (0, react_1.useRef)((0, throttle_1.default)(async (baseURL, jcampRelativeURL) => {
37
37
  try {
38
38
  setLoading(true);
39
+ const url = new URL(jcampRelativeURL, baseURL);
39
40
  const { data } = await (0, nmr_load_save_1.readFromWebSource)({
40
- entries: [{ relativePath: jcampRelativeURL, baseURL }],
41
+ entries: [{ relativePath: url.pathname, baseURL: url.origin }],
41
42
  });
42
43
  setLoading(false);
43
44
  const spectrum = data?.spectra?.[0] || null;
@@ -12,7 +12,6 @@ const GlobalContext_1 = require("../../context/GlobalContext");
12
12
  const ScaleContext_1 = require("../../context/ScaleContext");
13
13
  const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
14
14
  const index_1 = require("../../highlight/index");
15
- const Types_1 = require("../../reducer/types/Types");
16
15
  const ToolTypes_1 = require("../../toolbar/ToolTypes");
17
16
  const IntegralIndicator_1 = require("./IntegralIndicator");
18
17
  const stylesOnHover = (0, react_1.css) `
@@ -55,9 +54,9 @@ function IntegralResizable({ integralData, integralFormat, }) {
55
54
  });
56
55
  function handleOnStopResizing(position) {
57
56
  dispatch({
58
- type: Types_1.RESIZE_INTEGRAL,
57
+ type: 'RESIZE_INTEGRAL',
59
58
  payload: {
60
- data: {
59
+ integral: {
61
60
  ...integralData,
62
61
  from: scaleX().invert(position.x2),
63
62
  to: scaleX().invert(position.x1),
@@ -21,6 +21,6 @@ function MultiAnalysisRanges() {
21
21
  const { view: { spectra: { activeTab }, }, displayerKey, } = (0, ChartContext_1.useChartData)();
22
22
  const multipleSpectraAnalysis = (0, usePanelPreferences_1.usePanelPreferences)('multipleSpectraAnalysis', activeTab);
23
23
  const columns = multipleSpectraAnalysis.analysisOptions.columns;
24
- return ((0, jsx_runtime_1.jsx)(MemoizedMultiAnalysisRanges, { ...{ columns, displayerKey, activeTab } }));
24
+ return ((0, jsx_runtime_1.jsx)(MemoizedMultiAnalysisRanges, { columns, displayerKey, activeTab }));
25
25
  }
26
26
  exports.default = MultiAnalysisRanges;
@@ -59,15 +59,13 @@ function InnerMultiplicityTree({ labelOptions, onUnlink, data, width: widthProp,
59
59
  onUnlink(index);
60
60
  }
61
61
  const isHighlighted = highlight.isActive || assignment.isActive;
62
- return ((0, jsx_runtime_1.jsxs)("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles, ...{
63
- onMouseEnter: () => {
64
- assignment.show('x');
65
- highlight.show();
66
- },
67
- onMouseLeave: () => {
68
- assignment.hide();
69
- highlight.hide();
70
- },
62
+ return ((0, jsx_runtime_1.jsxs)("g", { style: isHighlighted ? { ...styles, opacity: 1, strokeWidth: 1.5 } : styles, onMouseEnter: () => {
63
+ assignment.show('x');
64
+ highlight.show();
65
+ },
66
+ onMouseLeave: () => {
67
+ assignment.hide();
68
+ highlight.hide();
71
69
  }, pointerEvents: "bounding-box", ...(!assignment.isActive && { css: cssStyle }), children: [drawTree(data, { scaleX, labelOptions, showLabels }), (0, jsx_runtime_1.jsx)("rect", { x: startX - BOX_PADDING, y: startY - BOX_PADDING, width: width + BOX_PADDING * 2, height: height + BOX_PADDING * 2, fill: isHighlighted ? '#ff6f0057' : 'transparent', "data-no-export": "true" }), (0, jsx_runtime_1.jsx)(AssignmentActionsButtons_1.AssignmentActionsButtons, { className: "signal-target", isActive: !!(assignment.isActive || signal?.diaIDs), y: startY, x: scaleX()(signal.delta) - 30, onAssign: assignHandler, onUnAssign: unAssignHandler, borderRadius: 16 })] }));
72
70
  }
73
71
  function MultiplicityTree(props) {
@@ -7,7 +7,6 @@ const react_2 = require("react");
7
7
  const DispatchContext_1 = require("../../context/DispatchContext");
8
8
  const highlight_1 = require("../../highlight");
9
9
  const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
10
- const Types_1 = require("../../reducer/types/Types");
11
10
  const formatNumber_1 = require("../../utility/formatNumber");
12
11
  const styles = (0, react_1.css) `
13
12
  input {
@@ -55,7 +54,7 @@ value, color, nucleus, }) {
55
54
  extra: { id },
56
55
  });
57
56
  const dispatch = (0, DispatchContext_1.useDispatch)();
58
- const handleOnPeakChange = (0, react_2.useCallback)((e) => dispatch({ type: Types_1.SHIFT_SPECTRUM, shiftValue: e.shiftValue }), [dispatch]);
57
+ const handleOnPeakChange = (0, react_2.useCallback)((e) => dispatch({ type: 'SHIFT_SPECTRUM', payload: { shift: e.shiftValue } }), [dispatch]);
59
58
  (0, react_2.useLayoutEffect)(() => {
60
59
  const textBox = refText.current?.getBBox();
61
60
  setContainerSize({
@@ -15,7 +15,6 @@ const GlobalContext_1 = require("../../context/GlobalContext");
15
15
  const ScaleContext_1 = require("../../context/ScaleContext");
16
16
  const Resizer_1 = __importDefault(require("../../elements/resizer/Resizer"));
17
17
  const highlight_1 = require("../../highlight");
18
- const Types_1 = require("../../reducer/types/Types");
19
18
  const ToolTypes_1 = require("../../toolbar/ToolTypes");
20
19
  const IntegralIndicator_1 = require("../integral/IntegralIndicator");
21
20
  const MultiplicityTree_1 = require("../multiplicityTree/MultiplicityTree");
@@ -42,11 +41,13 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
42
41
  const isBlockedByEditing = selectedTool && selectedTool === ToolTypes_1.options.editRange.id;
43
42
  function handleOnStopResizing(position) {
44
43
  dispatch({
45
- type: Types_1.RESIZE_RANGE,
46
- data: {
47
- ...range,
48
- from: scaleX().invert(position.x2),
49
- to: scaleX().invert(position.x1),
44
+ type: 'RESIZE_RANGE',
45
+ payload: {
46
+ range: {
47
+ ...range,
48
+ from: scaleX().invert(position.x2),
49
+ to: scaleX().invert(position.x1),
50
+ },
50
51
  },
51
52
  });
52
53
  }
@@ -60,9 +61,9 @@ function Range({ range, showMultiplicityTrees, selectedTool, relativeFormat, })
60
61
  }
61
62
  function unAssignHandler(signalIndex = -1) {
62
63
  dispatch({
63
- type: Types_1.UNLINK_RANGE,
64
+ type: 'UNLINK_RANGE',
64
65
  payload: {
65
- rangeData: range,
66
+ range,
66
67
  assignmentData,
67
68
  signalIndex,
68
69
  },
@@ -28,12 +28,10 @@ function Ranges() {
28
28
  if (!spectrum?.display?.isVisible) {
29
29
  return null;
30
30
  }
31
- return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ranges: spectrum.ranges, ...{
32
- showMultiplicityTrees,
33
- showRangesIntegrals,
34
- selectedTool,
35
- displayerKey,
36
- relativeFormat: rangesPreferences.relative.format,
37
- } }));
31
+ return ((0, jsx_runtime_1.jsx)(MemoizedRanges, { ranges: spectrum.ranges, showMultiplicityTrees,
32
+ showRangesIntegrals,
33
+ selectedTool,
34
+ displayerKey,
35
+ relativeFormat: rangesPreferences.relative.format }));
38
36
  }
39
37
  exports.default = Ranges;
@@ -10,7 +10,6 @@ const ChartContext_1 = require("../../context/ChartContext");
10
10
  const DispatchContext_1 = require("../../context/DispatchContext");
11
11
  const ScaleContext_1 = require("../../context/ScaleContext");
12
12
  const DeleteButton_1 = __importDefault(require("../../elements/DeleteButton"));
13
- const Types_1 = require("../../reducer/types/Types");
14
13
  const styles = (0, react_1.css) `
15
14
  pointer-events: bounding-box;
16
15
  user-select: 'none';
@@ -36,7 +35,7 @@ function BaseLineZones() {
36
35
  const { scaleX } = (0, ScaleContext_1.useScaleChecked)();
37
36
  const dispatch = (0, DispatchContext_1.useDispatch)();
38
37
  const deleteRangeHandler = (id) => {
39
- dispatch({ type: Types_1.DELETE_BASE_LINE_ZONE, id });
38
+ dispatch({ type: 'DELETE_BASE_LINE_ZONE', payload: { id } });
40
39
  };
41
40
  const baseLineZones = toolOptions.data.baselineCorrection.zones;
42
41
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: baseLineZones.length > 0 && ((0, jsx_runtime_1.jsx)("g", { children: baseLineZones.map((zone) => ((0, jsx_runtime_1.jsxs)("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, children: [(0, jsx_runtime_1.jsx)(DeleteButton_1.default, { x: -20, y: 10, onDelete: () => deleteRangeHandler(zone.id) }), (0, jsx_runtime_1.jsx)("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: "zone-area" })] }, zone.id))) })) }));
@@ -15,7 +15,6 @@ const DispatchContext_1 = require("../../../context/DispatchContext");
15
15
  const GlobalContext_1 = require("../../../context/GlobalContext");
16
16
  const MoleculeStructureEditorModal_1 = require("../../../modal/MoleculeStructureEditorModal");
17
17
  const useAtomAssignment_1 = __importDefault(require("../../../panels/MoleculesPanel/useAtomAssignment"));
18
- const Types_1 = require("../../../reducer/types/Types");
19
18
  const ActionsButton_1 = __importDefault(require("./ActionsButton"));
20
19
  const style = (0, react_1.css) `
21
20
  border: 1px solid transparent;
@@ -46,7 +45,7 @@ function DraggableStructure(props) {
46
45
  const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = (0, useAtomAssignment_1.default)({ zones, ranges, activeTab, displayerMode });
47
46
  function floatMoleculeHandler() {
48
47
  dispatch({
49
- type: Types_1.FLOAT_MOLECULE_OVER_SPECTRUM,
48
+ type: 'FLOAT_MOLECULE_OVER_SPECTRUM',
50
49
  payload: { id: molecule.id },
51
50
  });
52
51
  }
@@ -58,8 +57,8 @@ function DraggableStructure(props) {
58
57
  bounding.height += height;
59
58
  }
60
59
  dispatch({
61
- type: Types_1.CHANGE_FLOAT_MOLECULE_POSITION,
62
- payload: { id: molecule.id, bounding },
60
+ type: 'CHANGE_FLOAT_MOLECULE_POSITION',
61
+ payload: { id: molecule.id, bounding: bounding },
63
62
  });
64
63
  }
65
64
  if (!viewerRef)
@@ -71,7 +70,7 @@ function DraggableStructure(props) {
71
70
  ? currentDiaIDsToHighlight
72
71
  : assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: (molfile) => {
73
72
  dispatch({
74
- type: Types_1.SET_MOLECULE,
73
+ type: 'SET_MOLECULE',
75
74
  payload: {
76
75
  molfile,
77
76
  id: molecule.id,
@@ -20,15 +20,13 @@ function FloatMoleculeStructuresInner(props) {
20
20
  .map(([id, moleculeView], index) => {
21
21
  const molecule = molecules.find((m) => m.id === id);
22
22
  (0, assert_1.assert)(molecule !== undefined, 'molecule should be defined');
23
- return ((0, jsx_runtime_1.jsx)(DraggableStructure_1.DraggableStructure, { ...{
24
- zones,
25
- ranges,
26
- activeTab,
27
- displayerMode,
28
- moleculeView,
29
- molecule,
30
- index,
31
- } }, id));
23
+ return ((0, jsx_runtime_1.jsx)(DraggableStructure_1.DraggableStructure, { zones,
24
+ ranges,
25
+ activeTab,
26
+ displayerMode,
27
+ moleculeView,
28
+ molecule,
29
+ index }, id));
32
30
  }) }));
33
31
  }
34
32
  exports.FloatMoleculeStructuresInner = FloatMoleculeStructuresInner;
@@ -39,13 +37,11 @@ function FloatMoleculeStructures() {
39
37
  const data = (0, useSpectrum_1.default)(emptyData);
40
38
  const ranges = data?.ranges || {};
41
39
  const zones = data?.zones || {};
42
- return ((0, jsx_runtime_1.jsx)(MemoizedFloatMoleculeStructures, { ...{
43
- moleculesView,
44
- molecules,
45
- displayerMode,
46
- activeTab,
47
- ranges,
48
- zones,
49
- } }));
40
+ return ((0, jsx_runtime_1.jsx)(MemoizedFloatMoleculeStructures, { moleculesView,
41
+ molecules,
42
+ displayerMode,
43
+ activeTab,
44
+ ranges,
45
+ zones }));
50
46
  }
51
47
  exports.default = FloatMoleculeStructures;
@@ -44,7 +44,7 @@ function Left1DChart({ margin: marginValue = 10, data: spectrum, }) {
44
44
  const { x, re: y } = spectrum.data;
45
45
  const pathPoints = xyReduce({ x, y });
46
46
  const pathBuilder = new PathBuilder_1.PathBuilder();
47
- pathBuilder.moveTo(scaleY(pathPoints.y[pathPoints.y.length - 1]), scaleX(pathPoints.x.length - 1));
47
+ pathBuilder.moveTo(scaleY(pathPoints.y.at(-1)), scaleX(pathPoints.x.at(-1)));
48
48
  for (let i = pathPoints.x.length - 2; i >= 0; i--) {
49
49
  pathBuilder.lineTo(scaleY(pathPoints.y[i]), scaleX(pathPoints.x[i]));
50
50
  }