nmrium 0.36.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/lib/component/1d/FooterBanner.js +1 -1
  2. package/lib/component/1d/Viewer1D.js +26 -21
  3. package/lib/component/1d/integral/Integral.d.ts +2 -6
  4. package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
  5. package/lib/component/1d/integral/IntegralResizable.js +2 -3
  6. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  7. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  8. package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
  9. package/lib/component/1d/ranges/Range.js +9 -8
  10. package/lib/component/1d/ranges/Ranges.js +5 -7
  11. package/lib/component/1d/tool/BaseLineZones.js +1 -2
  12. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  13. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  14. package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
  15. package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  16. package/lib/component/2d/Chart2D.js +1 -1
  17. package/lib/component/2d/Viewer2D.js +10 -9
  18. package/lib/component/2d/fid/FidCanvas.js +4 -6
  19. package/lib/component/2d/ft/Contours.js +1 -7
  20. package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
  21. package/lib/component/2d/utilities/scale.d.ts +2 -1
  22. package/lib/component/2d/utilities/scale.js +1 -1
  23. package/lib/component/2d/zones/Zones.js +1 -1
  24. package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
  25. package/lib/component/NMRium.d.ts +2 -0
  26. package/lib/component/NMRium.js +22 -15
  27. package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
  28. package/lib/component/context/DispatchContext.d.ts +23 -3
  29. package/lib/component/context/DispatchContext.js +1 -1
  30. package/lib/component/context/LoggerContext.js +1 -1
  31. package/lib/component/elements/Button.js +7 -9
  32. package/lib/component/elements/IsotopesViewer.js +1 -1
  33. package/lib/component/elements/ReactTable/ReactTable.js +1 -2
  34. package/lib/component/elements/RemoveAssignmentsButton.d.ts +4 -0
  35. package/lib/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +14 -1
  36. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  37. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  38. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  39. package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
  40. package/lib/component/elements/formik/FormikInput.js +1 -1
  41. package/lib/component/elements/formik/FormikSelect.js +2 -2
  42. package/lib/component/elements/formik/FormikSlider.js +1 -1
  43. package/lib/component/elements/formik/FormikTextarea.js +2 -2
  44. package/lib/component/header/ApodizationOptionsPanel.js +4 -5
  45. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
  46. package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
  47. package/lib/component/header/Header.js +5 -7
  48. package/lib/component/header/PhaseCorrectionPanel.js +7 -8
  49. package/lib/component/header/RangesPickingOptionPanel.js +1 -2
  50. package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
  51. package/lib/component/header/Zones2DOptionPanel.js +5 -6
  52. package/lib/component/hooks/useExport.js +1 -0
  53. package/lib/component/hooks/useToolsFunctions.js +8 -10
  54. package/lib/component/loader/DropZone.js +4 -5
  55. package/lib/component/loader/NoData.js +1 -1
  56. package/lib/component/modal/AboutPredictionModal.d.ts +2 -0
  57. package/lib/component/modal/AboutPredictionModal.js +49 -0
  58. package/lib/component/modal/AlignSpectraModal.js +1 -2
  59. package/lib/component/modal/EditPeakShapeModal.js +1 -2
  60. package/lib/component/modal/ImportPublicationStringModal.js +1 -2
  61. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  62. package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
  63. package/lib/component/modal/PredictSpectraModal.js +24 -21
  64. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  65. package/lib/component/modal/editRange/EditRangeModal.js +3 -4
  66. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  67. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  68. package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
  69. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  70. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  71. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  72. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  73. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  74. package/lib/component/panels/InformationPanel.js +6 -6
  75. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  76. package/lib/component/panels/IntegralsPanel/IntegralTable.js +27 -23
  77. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +8 -5
  78. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  79. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  80. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  81. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  82. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  83. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -0
  84. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  85. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
  86. package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
  87. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  88. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  89. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  90. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  91. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  92. package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  93. package/lib/component/panels/Panels.js +1 -1
  94. package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  95. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
  96. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
  97. package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
  98. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +0 -1
  99. package/lib/component/panels/RangesPanel/RangesTableRow.js +0 -11
  100. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
  101. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  102. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
  103. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  104. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
  105. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  106. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  107. package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
  108. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  109. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  110. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  111. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
  112. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  113. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  114. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  115. package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  116. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  117. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -21
  118. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  119. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +4 -5
  120. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -16
  121. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +3 -7
  122. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
  123. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  124. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  125. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +4 -5
  126. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -19
  127. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +3 -7
  128. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
  129. package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  130. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
  131. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
  132. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -22
  133. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
  134. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
  135. package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
  136. package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
  137. package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
  138. package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
  139. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  140. package/lib/component/panels/predictionPanel/PredictionPanel.js +10 -6
  141. package/lib/component/reducer/IgnoreActions.d.ts +2 -1
  142. package/lib/component/reducer/IgnoreActions.js +35 -32
  143. package/lib/component/reducer/Reducer.d.ts +8 -5
  144. package/lib/component/reducer/Reducer.js +199 -221
  145. package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
  146. package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
  147. package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
  148. package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
  149. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
  150. package/lib/component/reducer/actions/DatabaseActions.js +5 -2
  151. package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
  152. package/lib/component/reducer/actions/DimensionsActions.js +3 -5
  153. package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
  154. package/lib/component/reducer/actions/DomainActions.js +13 -19
  155. package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
  156. package/lib/component/reducer/actions/FiltersActions.js +250 -255
  157. package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
  158. package/lib/component/reducer/actions/GlobalActions.js +3 -3
  159. package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
  160. package/lib/component/reducer/actions/IntegralsActions.js +16 -15
  161. package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
  162. package/lib/component/reducer/actions/LoadActions.js +65 -57
  163. package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
  164. package/lib/component/reducer/actions/MoleculeActions.js +53 -20
  165. package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
  166. package/lib/component/reducer/actions/PeaksActions.js +19 -11
  167. package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
  168. package/lib/component/reducer/actions/PreferencesActions.js +22 -7
  169. package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
  170. package/lib/component/reducer/actions/RangesActions.js +80 -65
  171. package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
  172. package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
  173. package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
  174. package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
  175. package/lib/component/reducer/actions/ToolsActions.js +54 -32
  176. package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
  177. package/lib/component/reducer/actions/ZonesActions.js +68 -49
  178. package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
  179. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  180. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
  181. package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
  182. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
  183. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  184. package/lib/component/reducer/types/ActionType.d.ts +6 -0
  185. package/lib/component/reducer/types/ActionType.js +1 -0
  186. package/lib/component/toolbar/BasicToolBar.js +6 -9
  187. package/lib/component/toolbar/FunctionToolBar.js +4 -9
  188. package/lib/component/toolbar/ToolBar.js +1 -1
  189. package/lib/component/toolbar/ToolTypes.d.ts +2 -2
  190. package/lib/component/utility/Events.d.ts +4 -4
  191. package/lib/component/utility/Events.js +2 -2
  192. package/lib/component/utility/GroupByInfoKey.js +1 -1
  193. package/lib/component/utility/getSpectraObjectPaths.js +1 -1
  194. package/lib/component/workspaces/Workspace.d.ts +2 -1
  195. package/lib/component/workspaces/exercise.js +31 -0
  196. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
  197. package/lib/data/PredictionManager.d.ts +5 -8
  198. package/lib/data/PredictionManager.js +3 -3
  199. package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  200. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  201. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
  202. package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  203. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
  204. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
  205. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
  206. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
  207. package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
  208. package/lib/data/data2d/Processing2D.d.ts +3 -3
  209. package/lib/data/data2d/Spectrum2D/contours.d.ts +1 -4
  210. package/lib/data/data2d/Spectrum2D/contours.js +0 -1
  211. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  212. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
  213. package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  214. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
  215. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
  216. package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
  217. package/lib/data/matrixGeneration.js +4 -2
  218. package/lib/data/molecules/Molecule.d.ts +3 -3
  219. package/lib/data/molecules/MoleculeManager.d.ts +5 -5
  220. package/lib/data/molecules/MoleculeManager.js +1 -1
  221. package/lib/data/utilities/ZoneUtilities.js +0 -1
  222. package/lib/data/utilities/generateColor.js +1 -1
  223. package/lib/data/utilities/isNumber.d.ts +1 -0
  224. package/lib/data/utilities/isNumber.js +3 -0
  225. package/lib/types/NMRiumGeneralPreferences.d.ts +1 -0
  226. package/lib/versionInfo.js +1 -1
  227. package/lib-cjs/component/1d/FooterBanner.js +1 -1
  228. package/lib-cjs/component/1d/Viewer1D.js +25 -20
  229. package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
  230. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  231. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
  232. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
  233. package/lib-cjs/component/1d/ranges/Range.js +9 -8
  234. package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
  235. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
  236. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
  237. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
  238. package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
  239. package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
  240. package/lib-cjs/component/2d/Chart2D.js +1 -1
  241. package/lib-cjs/component/2d/Viewer2D.js +10 -9
  242. package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
  243. package/lib-cjs/component/2d/ft/Contours.js +1 -7
  244. package/lib-cjs/component/2d/utilities/scale.js +1 -1
  245. package/lib-cjs/component/2d/zones/Zones.js +1 -1
  246. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
  247. package/lib-cjs/component/NMRium.js +19 -12
  248. package/lib-cjs/component/context/DispatchContext.js +1 -1
  249. package/lib-cjs/component/context/LoggerContext.js +1 -1
  250. package/lib-cjs/component/elements/Button.js +7 -9
  251. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  252. package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
  253. package/lib-cjs/component/{panels/RangesPanel/TableColumns → elements}/RemoveAssignmentsButton.js +15 -2
  254. package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
  255. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  256. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  257. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  258. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
  259. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  260. package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
  261. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  262. package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
  263. package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
  264. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
  265. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
  266. package/lib-cjs/component/header/Header.js +5 -7
  267. package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
  268. package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
  269. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
  270. package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
  271. package/lib-cjs/component/highlight/index.js +1 -1
  272. package/lib-cjs/component/hooks/useExport.js +1 -0
  273. package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
  274. package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
  275. package/lib-cjs/component/hooks/useXYReduce.js +1 -1
  276. package/lib-cjs/component/loader/DropZone.js +4 -5
  277. package/lib-cjs/component/loader/NoData.js +1 -1
  278. package/lib-cjs/component/modal/AboutPredictionModal.js +54 -0
  279. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
  280. package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
  281. package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
  282. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
  283. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
  284. package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
  285. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  286. package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
  287. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
  288. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
  289. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
  290. package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
  291. package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
  292. package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
  293. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
  294. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
  295. package/lib-cjs/component/panels/InformationPanel.js +6 -6
  296. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
  297. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +27 -23
  298. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -4
  299. package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
  300. package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
  301. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
  302. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
  303. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
  304. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
  305. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
  306. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  307. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
  308. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
  309. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
  310. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
  311. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
  312. package/lib-cjs/component/panels/Panels.js +1 -1
  313. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
  314. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
  315. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
  316. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
  317. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +0 -12
  318. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -3
  319. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
  320. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +2 -3
  321. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
  322. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
  323. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
  324. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPreferences.js +2 -2
  325. package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
  326. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
  327. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
  328. package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +1 -1
  329. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
  330. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
  331. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
  332. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
  333. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  334. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
  335. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +12 -19
  336. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +2 -2
  337. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
  338. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +27 -22
  339. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +2 -2
  340. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
  341. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
  342. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -21
  343. package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
  344. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
  345. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
  346. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
  347. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
  348. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
  349. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +10 -6
  350. package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
  351. package/lib-cjs/component/reducer/Reducer.js +199 -221
  352. package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
  353. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
  354. package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
  355. package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
  356. package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
  357. package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
  358. package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
  359. package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
  360. package/lib-cjs/component/reducer/actions/LoadActions.js +68 -60
  361. package/lib-cjs/component/reducer/actions/MoleculeActions.js +56 -23
  362. package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
  363. package/lib-cjs/component/reducer/actions/PreferencesActions.js +24 -9
  364. package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
  365. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
  366. package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
  367. package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
  368. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  369. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
  370. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
  371. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -0
  372. package/lib-cjs/component/reducer/types/ActionType.js +2 -0
  373. package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
  374. package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
  375. package/lib-cjs/component/toolbar/ToolBar.js +1 -1
  376. package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
  377. package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
  378. package/lib-cjs/component/workspaces/exercise.js +31 -0
  379. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
  380. package/lib-cjs/data/PredictionManager.js +3 -3
  381. package/lib-cjs/data/SpectraManager.js +1 -1
  382. package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
  383. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  384. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
  385. package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
  386. package/lib-cjs/data/data2d/Spectrum2D/contours.js +0 -1
  387. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  388. package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
  389. package/lib-cjs/data/matrixGeneration.js +4 -2
  390. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  391. package/lib-cjs/data/utilities/ZoneUtilities.js +0 -1
  392. package/lib-cjs/data/utilities/generateColor.js +1 -1
  393. package/lib-cjs/data/utilities/isNumber.js +7 -0
  394. package/lib-cjs/versionInfo.js +1 -1
  395. package/package.json +35 -34
  396. package/lib/component/panels/RangesPanel/TableColumns/RemoveAssignmentsButton.d.ts +0 -3
  397. package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
  398. package/lib/component/reducer/actions/HistoryActions.js +0 -40
  399. package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
  400. package/lib/component/reducer/types/HistoryTypes.js +0 -4
  401. package/lib/component/reducer/types/Types.d.ts +0 -132
  402. package/lib/component/reducer/types/Types.js +0 -126
  403. package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
  404. package/lib/component/toolbar/HistoryToolBar.js +0 -30
  405. package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
  406. package/lib/data/utilities/isMolFileEmpty.js +0 -6
  407. package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
  408. package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
  409. package/lib-cjs/component/reducer/types/Types.js +0 -131
  410. package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
  411. package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
@@ -12,7 +12,6 @@ import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
12
12
  import useExport from '../hooks/useExport';
13
13
  import useToolsFunctions from '../hooks/useToolsFunctions';
14
14
  import { DISPLAYER_MODE } from '../reducer/core/Constants';
15
- import { SET_KEY_PREFERENCES, APPLY_KEY_PREFERENCES, DELETE_INTEGRAL, DELETE_PEAK_NOTATION, DELETE_RANGE, DELETE_2D_ZONE, DELETE_EXCLUSION_ZONE, CHANGE_ACTIVE_SPECTRUM, } from '../reducer/types/Types';
16
15
  import { options } from '../toolbar/ToolTypes';
17
16
  function KeysListenerTracker() {
18
17
  const { keysPreferences, displayerMode, overDisplayer, data, view: { spectra: { activeTab }, }, } = useChartData();
@@ -34,8 +33,10 @@ function KeysListenerTracker() {
34
33
  switch (type) {
35
34
  case HighlightEventSource.INTEGRAL: {
36
35
  dispatch({
37
- type: DELETE_INTEGRAL,
38
- integralID: id,
36
+ type: 'DELETE_INTEGRAL',
37
+ payload: {
38
+ id,
39
+ },
39
40
  });
40
41
  // remove keys from the highlighted list after delete
41
42
  remove();
@@ -43,8 +44,10 @@ function KeysListenerTracker() {
43
44
  }
44
45
  case HighlightEventSource.PEAK: {
45
46
  dispatch({
46
- type: DELETE_PEAK_NOTATION,
47
- data: { id },
47
+ type: 'DELETE_PEAK',
48
+ payload: {
49
+ id,
50
+ },
48
51
  });
49
52
  // remove keys from the highlighted list after delete
50
53
  remove();
@@ -52,12 +55,10 @@ function KeysListenerTracker() {
52
55
  }
53
56
  case HighlightEventSource.RANGE: {
54
57
  dispatch({
55
- type: DELETE_RANGE,
58
+ type: 'DELETE_RANGE',
56
59
  payload: {
57
- data: {
58
- id,
59
- assignmentData,
60
- },
60
+ id,
61
+ assignmentData,
61
62
  },
62
63
  });
63
64
  // remove keys from the highlighted list after delete
@@ -66,7 +67,7 @@ function KeysListenerTracker() {
66
67
  }
67
68
  case HighlightEventSource.ZONE: {
68
69
  dispatch({
69
- type: DELETE_2D_ZONE,
70
+ type: 'DELETE_2D_ZONE',
70
71
  payload: {
71
72
  id,
72
73
  assignmentData,
@@ -83,7 +84,7 @@ function KeysListenerTracker() {
83
84
  handler: async () => {
84
85
  const hideLoading = await alert.showLoading('Delete all spectra exclusion zones in progress');
85
86
  dispatch({
86
- type: DELETE_EXCLUSION_ZONE,
87
+ type: 'DELETE_EXCLUSION_ZONE',
87
88
  payload: {
88
89
  zone,
89
90
  },
@@ -96,10 +97,10 @@ function KeysListenerTracker() {
96
97
  handler: async () => {
97
98
  const hideLoading = await alert.showLoading('Delete exclusion zones in progress');
98
99
  dispatch({
99
- type: DELETE_EXCLUSION_ZONE,
100
+ type: 'DELETE_EXCLUSION_ZONE',
100
101
  payload: {
101
102
  zone,
102
- spectrumID,
103
+ spectrumId: spectrumID,
103
104
  },
104
105
  });
105
106
  hideLoading();
@@ -162,22 +163,28 @@ function KeysListenerTracker() {
162
163
  if (data && data.length > 0 && num >= 1 && num <= 9) {
163
164
  if (e.shiftKey) {
164
165
  dispatch({
165
- type: SET_KEY_PREFERENCES,
166
- keyCode: num,
166
+ type: 'SET_KEY_PREFERENCES',
167
+ payload: {
168
+ keyCode: num,
169
+ },
167
170
  });
168
171
  alert.show(`Configuration Reset, press '${num}' again to reload it.`);
169
172
  }
170
173
  else if (!checkModifierKeyActivated(e)) {
171
174
  if (keysPreferences?.[num]) {
172
175
  dispatch({
173
- type: APPLY_KEY_PREFERENCES,
174
- keyCode: num,
176
+ type: 'APPLY_KEY_PREFERENCES',
177
+ payload: {
178
+ keyCode: num,
179
+ },
175
180
  });
176
181
  }
177
182
  else {
178
183
  dispatch({
179
- type: SET_KEY_PREFERENCES,
180
- keyCode: num,
184
+ type: 'SET_KEY_PREFERENCES',
185
+ payload: {
186
+ keyCode: num,
187
+ },
181
188
  });
182
189
  alert.show(`Configuration saved, press '${num}' again to reload it.`);
183
190
  }
@@ -274,7 +281,7 @@ function KeysListenerTracker() {
274
281
  break;
275
282
  case 'a': {
276
283
  dispatch({
277
- type: CHANGE_ACTIVE_SPECTRUM,
284
+ type: 'CHANGE_ACTIVE_SPECTRUM',
278
285
  payload: {},
279
286
  });
280
287
  e.preventDefault();
@@ -2,6 +2,7 @@
2
2
  import { CorrelationData } from 'nmr-correlation';
3
3
  import { Source, NmriumState, Spectrum } from 'nmr-load-save';
4
4
  import { ReactElement, ReactNode } from 'react';
5
+ import { ErrorBoundaryPropsWithComponent } from 'react-error-boundary';
5
6
  import { BlobObject } from './utility/export';
6
7
  import { CustomWorkspaces, WorkspacePreferences as NMRiumPreferences } from './workspaces/Workspace';
7
8
  export { serializeNmriumState } from 'nmr-load-save';
@@ -12,6 +13,7 @@ export type OnNMRiumChange = (state: NmriumState, source: 'data' | 'view' | 'set
12
13
  export interface NMRiumProps {
13
14
  data?: NMRiumData;
14
15
  onChange?: OnNMRiumChange;
16
+ onError?: ErrorBoundaryPropsWithComponent['onError'];
15
17
  workspace?: NMRiumWorkspace;
16
18
  customWorkspaces?: CustomWorkspaces;
17
19
  preferences?: NMRiumPreferences;
@@ -3,9 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
3
3
  import { css } from '@emotion/react';
4
4
  import { readNMRiumObject } from 'nmr-load-save';
5
5
  import { useEffect, useCallback, useReducer, useMemo, useRef, memo, forwardRef, useImperativeHandle, } from 'react';
6
- import { ErrorBoundary } from 'react-error-boundary';
7
- import { RootLayout } from 'react-science/ui';
8
- import { useToggle, useFullscreen } from 'react-use';
6
+ import { ErrorBoundary, } from 'react-error-boundary';
7
+ import { RootLayout, useOnOff } from 'react-science/ui';
8
+ import { useFullscreen } from 'react-use';
9
9
  import { toJSON } from '../data/SpectraManager';
10
10
  import checkModifierKeyActivated from '../data/utilities/checkModifierKeyActivated';
11
11
  import Viewer1D from './1d/Viewer1D';
@@ -31,7 +31,6 @@ import checkActionType from './reducer/IgnoreActions';
31
31
  import { spectrumReducer, initialState, dispatchMiddleware, initState, } from './reducer/Reducer';
32
32
  import { DISPLAYER_MODE } from './reducer/core/Constants';
33
33
  import preferencesReducer, { preferencesInitialState, initPreferencesState, } from './reducer/preferences/preferencesReducer';
34
- import { INITIATE, SET_LOADING_FLAG, SET_MOUSE_OVER_DISPLAYER, } from './reducer/types/Types';
35
34
  import ToolBar from './toolbar/ToolBar';
36
35
  import { getBlob } from './utility/export';
37
36
  const viewerContainerStyle = css `
@@ -80,21 +79,20 @@ const defaultData = {
80
79
  spectra: [],
81
80
  };
82
81
  const NMRium = forwardRef(function NMRium(props, ref) {
83
- return (_jsx(RootLayout, { style: { width: '100%' }, children: _jsx(ErrorBoundary, { FallbackComponent: ErrorOverlay, children: _jsx(InnerNMRium, { ...props, innerRef: ref }) }) }));
82
+ const { onError, ...otherProps } = props;
83
+ return (_jsx(RootLayout, { style: { width: '100%' }, children: _jsx(ErrorBoundary, { FallbackComponent: ErrorOverlay, onError: onError, children: _jsx(InnerNMRium, { ...otherProps, innerRef: ref }) }) }));
84
84
  });
85
85
  function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces, preferences, getSpinner = defaultGetSpinner, onChange, emptyText, innerRef, }) {
86
86
  const rootRef = useRef(null);
87
87
  const elementsWrapperRef = useRef(null);
88
88
  const viewerRef = useRef(null);
89
- const [show, toggle] = useToggle(false);
89
+ const [show, , setOff, toggle] = useOnOff(false);
90
90
  const handleChange = useRef(onChange);
91
91
  useEffect(() => {
92
92
  handleChange.current = onChange;
93
93
  }, [onChange]);
94
94
  const isFullscreen = useFullscreen(rootRef, show, {
95
- onClose: () => {
96
- toggle(false);
97
- },
95
+ onClose: setOff,
98
96
  });
99
97
  const [state, dispatch] = useReducer(spectrumReducer, initialState, initState);
100
98
  const [preferencesState, dispatchPreferences] = useReducer(preferencesReducer, preferencesInitialState, initPreferencesState);
@@ -149,14 +147,17 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
149
147
  },
150
148
  }), []);
151
149
  useEffect(() => {
152
- dispatchMiddleWare({ type: SET_LOADING_FLAG, isLoading: true });
150
+ dispatchMiddleWare({
151
+ type: 'SET_LOADING_FLAG',
152
+ payload: { isLoading: true },
153
+ });
153
154
  if (dataProp) {
154
155
  void readNMRiumObject(dataProp)
155
- .then((nmriumObject) => {
156
- dispatchMiddleWare({ type: INITIATE, payload: nmriumObject });
156
+ .then((nmriumState) => {
157
+ dispatchMiddleWare({ type: 'INITIATE', payload: { nmriumState } });
157
158
  })
158
159
  .catch((error) => {
159
- dispatch({ type: SET_LOADING_FLAG, isLoading: false });
160
+ dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
160
161
  // eslint-disable-next-line no-alert
161
162
  alert(error.message);
162
163
  reportError(error);
@@ -175,10 +176,16 @@ function InnerNMRium({ data: dataProp = defaultData, workspace, customWorkspaces
175
176
  return;
176
177
  }
177
178
  function mouseEnterHandler() {
178
- dispatchMiddleWare({ type: SET_MOUSE_OVER_DISPLAYER, payload: true });
179
+ dispatchMiddleWare({
180
+ type: 'SET_MOUSE_OVER_DISPLAYER',
181
+ payload: { isMouseOverDisplayer: true },
182
+ });
179
183
  }
180
184
  function mouseLeaveHandler() {
181
- dispatchMiddleWare({ type: SET_MOUSE_OVER_DISPLAYER, payload: false });
185
+ dispatchMiddleWare({
186
+ type: 'SET_MOUSE_OVER_DISPLAYER',
187
+ payload: { isMouseOverDisplayer: false },
188
+ });
182
189
  }
183
190
  div.addEventListener('mouseenter', mouseEnterHandler);
184
191
  div.addEventListener('mouseleave', mouseLeaveHandler);
@@ -1,5 +1,5 @@
1
1
  import { Data1D, Data2D } from 'nmr-load-save';
2
- import { ActionType } from '../reducer/types/Types';
2
+ import { ActionType } from '../reducer/types/ActionType';
3
3
  import { AssignmentDimension, AssignmentState, Axis } from './AssignmentsContext';
4
4
  export type InitiateAction = ActionType<'INITIATE_ASSIGNMENTS', {
5
5
  spectra: (Data1D | Data2D)[];
@@ -1,4 +1,24 @@
1
1
  /// <reference types="react" />
2
- export declare const dispatchContext: import("react").Context<any>;
3
- export declare const DispatchProvider: import("react").Provider<any>;
4
- export declare function useDispatch(): any;
2
+ import { AssignmentsActions } from '../reducer/actions/AssignmentsActions';
3
+ import { CorrelationsActions } from '../reducer/actions/CorrelationsActions';
4
+ import { DatabaseActions } from '../reducer/actions/DatabaseActions';
5
+ import { DimensionsActions } from '../reducer/actions/DimensionsActions';
6
+ import { DomainActions } from '../reducer/actions/DomainActions';
7
+ import { FiltersActions } from '../reducer/actions/FiltersActions';
8
+ import { GlobalActions } from '../reducer/actions/GlobalActions';
9
+ import { IntegralsActions } from '../reducer/actions/IntegralsActions';
10
+ import { LoadActions } from '../reducer/actions/LoadActions';
11
+ import { MoleculeActions } from '../reducer/actions/MoleculeActions';
12
+ import { PeaksActions } from '../reducer/actions/PeaksActions';
13
+ import { PreferencesActions } from '../reducer/actions/PreferencesActions';
14
+ import { RangesActions } from '../reducer/actions/RangesActions';
15
+ import { SpectraAnalysisActions } from '../reducer/actions/SpectraAnalysisAction';
16
+ import { SpectrumActions } from '../reducer/actions/SpectrumsActions';
17
+ import { ToolsActions } from '../reducer/actions/ToolsActions';
18
+ import { ZonesActions } from '../reducer/actions/ZonesActions';
19
+ import { ActionType } from '../reducer/types/ActionType';
20
+ export type Action = ToolsActions | SpectrumActions | SpectraAnalysisActions | GlobalActions | LoadActions | IntegralsActions | RangesActions | DatabaseActions | DimensionsActions | AssignmentsActions | DomainActions | PreferencesActions | PeaksActions | MoleculeActions | ZonesActions | FiltersActions | CorrelationsActions | ActionType<'INITIALIZE_NMRIUM'>;
21
+ export type Dispatch = (action: Action) => void;
22
+ export declare const dispatchContext: import("react").Context<Dispatch>;
23
+ export declare const DispatchProvider: import("react").Provider<Dispatch>;
24
+ export declare function useDispatch(): Dispatch;
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from 'react';
2
- export const dispatchContext = createContext({});
2
+ export const dispatchContext = createContext(() => null);
3
3
  export const DispatchProvider = dispatchContext.Provider;
4
4
  export function useDispatch() {
5
5
  return useContext(dispatchContext);
@@ -26,7 +26,7 @@ export function LoggerProvider({ children }) {
26
26
  }, [loggingLevel]);
27
27
  const markAsRead = useCallback(() => {
28
28
  if (logsHistory.length > 0) {
29
- const id = logsHistory[logsHistory.length - 1].id;
29
+ const id = logsHistory.at(-1).id;
30
30
  setLastLogId(id);
31
31
  }
32
32
  }, [logsHistory]);
@@ -210,14 +210,12 @@ Button.Info = function ButtonInfo(props) {
210
210
  };
211
211
  Button.BarButton = function BarButton(props) {
212
212
  const { ...otherProps } = props;
213
- return (_jsx(Button, { ...{
214
- backgroundColor: { base: 'white', hover: '#f7f7f7', active: '#e7e7e7' },
215
- color: {
216
- base: 'black',
217
- hover: 'black',
218
- },
219
- style: { padding: '0.25rem' },
220
- ...otherProps,
221
- } }));
213
+ return (_jsx(Button, { backgroundColor: { base: 'white', hover: '#f7f7f7', active: '#e7e7e7' },
214
+ color: {
215
+ base: 'black',
216
+ hover: 'black',
217
+ },
218
+ style: { padding: '0.25rem' },
219
+ ...otherProps }));
222
220
  };
223
221
  export default Button;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  function renderIsotope(value) {
3
- return value.replace(/(?<isotope>\d+)/g, '<sup>$<isotope></sup>');
3
+ return value.replaceAll(/(?<isotope>\d+)/g, '<sup>$<isotope></sup>');
4
4
  }
5
5
  function IsotopesViewer({ value = '', ...othersProps }) {
6
6
  return (_jsx("div", { ...othersProps,
@@ -85,8 +85,7 @@ const ReactTableInner = forwardRef(function ReactTableInner(props, ref) {
85
85
  const rowsData = enableVirtualScroll
86
86
  ? rows.slice(virtualBoundary.rows.start, end)
87
87
  : rows;
88
- const index = rowsData[rowsData.length - 1]?.original[indexKey] ||
89
- rowsData[rowsData.length - 1]?.index;
88
+ const index = rowsData.at(-1)?.original[indexKey] || rowsData.at(-1)?.index;
90
89
  const total = totalCount ? totalCount : data.length;
91
90
  const startColumn = columns[virtualBoundary.columns.start].Header;
92
91
  return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: ref, className: "table-container", style: {
@@ -0,0 +1,4 @@
1
+ export declare const removeAssignmentCssStyle: import("@emotion/react").SerializedStyles;
2
+ export declare function RemoveAssignmentsButton({ onClick }: {
3
+ onClick: any;
4
+ }): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,5 +1,18 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { css } from '@emotion/react';
2
4
  import { FaMinusCircle } from 'react-icons/fa';
5
+ export const removeAssignmentCssStyle = css `
6
+ .remove-assignment {
7
+ visibility: hidden;
8
+ }
9
+
10
+ &:hover {
11
+ .remove-assignment {
12
+ visibility: visible;
13
+ }
14
+ }
15
+ `;
3
16
  export function RemoveAssignmentsButton({ onClick }) {
4
17
  return (_jsx("sup", { className: "remove-assignment", children: _jsx("button", { type: "button", style: {
5
18
  padding: 0,
@@ -12,7 +12,7 @@ function FormikCheckBox(props) {
12
12
  const changeHandler = useCallback((e) => {
13
13
  e.persist();
14
14
  onChange(e);
15
- setFieldValue(name, reverse ? value : !value);
15
+ void setFieldValue(name, reverse ? value : !value);
16
16
  }, [name, onChange, reverse, setFieldValue, value]);
17
17
  return (_jsxs("div", { className: `${className} check-${value}`, style: style.container || {}, children: [label && (_jsx("label", { htmlFor: name, className: "checkbox-label", style: style.label || {}, children: label })), _jsx(CheckBox, { ...resProps, name: name, checked: value, onChange: changeHandler, style: style.checkbox || {} })] }));
18
18
  }
@@ -8,7 +8,7 @@ function FormikColorPicker(props) {
8
8
  const { values, setFieldValue } = useFormikContext();
9
9
  const colorChangeHandler = useCallback((color) => {
10
10
  onColorChange(color);
11
- setFieldValue(name, color.hex);
11
+ void setFieldValue(name, color.hex);
12
12
  }, [name, onColorChange, setFieldValue]);
13
13
  return (_jsx(ColorInput, { ...colorPickerProps, name: name, onColorChange: colorChangeHandler, value: lodashGet(values, name) }));
14
14
  }
@@ -8,7 +8,7 @@ function FormikColorPicker(props) {
8
8
  const { onColorChange = () => null, name } = props;
9
9
  const { values, setFieldValue } = useFormikContext();
10
10
  function colorChangeHandler(color) {
11
- setFieldValue(name, `${color.hex}${Math.round(color.rgb.a * 255).toString(16)}`, false);
11
+ void setFieldValue(name, `${color.hex}${Math.round(color.rgb.a * 255).toString(16)}`, false);
12
12
  onColorChange(color);
13
13
  }
14
14
  return (_jsx(ColorPicker, { color: { hex: lodashGet(values, name, '#000') }, presetColors: COLORS, onChangeComplete: colorChangeHandler, style: { boxShadow: 'none' } }));
@@ -27,7 +27,7 @@ function FormikColumnFormatField(props) {
27
27
  handleChange(e);
28
28
  }, [handleChange]);
29
29
  const checkChangeHandler = useCallback((e) => {
30
- setFieldValue(e.target.name, e.target.checked);
30
+ void setFieldValue(e.target.name, e.target.checked);
31
31
  }, [setFieldValue]);
32
32
  return (_jsxs("div", { style: styles.row, children: [_jsx("span", { style: styles.inputLabel, children: label }), _jsxs("div", { style: {
33
33
  flex: 4,
@@ -11,7 +11,7 @@ function FormikInput(props) {
11
11
  function changeHandler(e) {
12
12
  onChange(e);
13
13
  if (mapOnChangeValue) {
14
- setFieldValue(name, mapOnChangeValue(e.target.value));
14
+ void setFieldValue(name, mapOnChangeValue(e.target.value));
15
15
  }
16
16
  else {
17
17
  handleChange(e);
@@ -8,11 +8,11 @@ const FormikSelect = function FormikSelect(props) {
8
8
  const { values, errors, touched, setFieldValue } = useFormikContext();
9
9
  const changeHandler = useCallback((value) => {
10
10
  onChange(value);
11
- setFieldValue(name, value);
11
+ void setFieldValue(name, value);
12
12
  }, [name, onChange, setFieldValue]);
13
13
  useEffect(() => {
14
14
  if (value) {
15
- setFieldValue(name, value);
15
+ void setFieldValue(name, value);
16
16
  }
17
17
  }, [name, setFieldValue, value]);
18
18
  let isInvalid = lodashGet(errors, name);
@@ -8,7 +8,7 @@ function FormikSlider(props) {
8
8
  const { name, debounceTime = 0 } = props;
9
9
  const { values, setFieldValue } = useFormikContext();
10
10
  const debounceOnChange = useRef(debounce((value) => {
11
- setFieldValue(name, value);
11
+ void setFieldValue(name, value);
12
12
  }, debounceTime)).current;
13
13
  return (_jsx(ReactSlider, { className: "horizontal-slider", thumbClassName: "thumb", trackClassName: "track", defaultValue: lodashGet(values, name, [0, 100]), onAfterChange: (value) => debounceOnChange(value), renderThumb: (props, state) => (_jsx("div", { ...props, children: _jsx("span", { children: state.valueNow }) })), pearling: true, minDistance: 10 }));
14
14
  }
@@ -11,13 +11,13 @@ function FormikTextarea(props) {
11
11
  }, [handleChange, onChange]);
12
12
  useEffect(() => {
13
13
  if (value) {
14
- setFieldValue(name, value);
14
+ void setFieldValue(name, value);
15
15
  }
16
16
  }, [name, setFieldValue, value]);
17
17
  const isInvalid = useMemo(() => {
18
18
  return lodashGet(errors, name);
19
19
  }, [errors, name]);
20
- return (_jsx("textarea", { ...{ name, className, placeholder }, value: value || lodashGet(values, name), onChange: changeHandler, style: {
20
+ return (_jsx("textarea", { name, className, placeholder, value: value || lodashGet(values, name), onChange: changeHandler, style: {
21
21
  ...style,
22
22
  ...(isInvalid && {
23
23
  borderColor: 'red',
@@ -3,7 +3,7 @@ import { Formik } from 'formik';
3
3
  import { useRef, memo } from 'react';
4
4
  import * as Yup from 'yup';
5
5
  import * as Filters from '../../data/Filters';
6
- import { defaultApodizationOptions } from '../../data/data1d/filter1d/apodization';
6
+ import { defaultApodizationOptions, } from '../../data/data1d/filter1d/apodization';
7
7
  import { useDispatch } from '../context/DispatchContext';
8
8
  import ActionButtons from '../elements/ActionButtons';
9
9
  import Label from '../elements/Label';
@@ -11,7 +11,6 @@ import FormikCheckBox from '../elements/formik/FormikCheckBox';
11
11
  import FormikInput from '../elements/formik/FormikInput';
12
12
  import FormikOnChange from '../elements/formik/FormikOnChange';
13
13
  import { useFilter } from '../hooks/useFilter';
14
- import { APPLY_APODIZATION_FILTER, CALCULATE_APODIZATION_FILTER, RESET_SELECTED_TOOL, } from '../reducer/types/Types';
15
14
  import { headerLabelStyle } from './Header';
16
15
  import { HeaderContainer } from './HeaderContainer';
17
16
  const inputStyle = {
@@ -33,20 +32,20 @@ function ApodizationOptionsInnerPanel(props) {
33
32
  const { livePreview, ...filterOptions } = values;
34
33
  if (livePreview && triggerSource === 'onChange') {
35
34
  dispatch({
36
- type: CALCULATE_APODIZATION_FILTER,
35
+ type: 'CALCULATE_APODIZATION_FILTER',
37
36
  payload: filterOptions,
38
37
  });
39
38
  }
40
39
  else if (triggerSource === 'apply') {
41
40
  dispatch({
42
- type: APPLY_APODIZATION_FILTER,
41
+ type: 'APPLY_APODIZATION_FILTER',
43
42
  payload: filterOptions,
44
43
  });
45
44
  }
46
45
  }
47
46
  function handleCancelFilter() {
48
47
  dispatch({
49
- type: RESET_SELECTED_TOOL,
48
+ type: 'RESET_SELECTED_TOOL',
50
49
  });
51
50
  }
52
51
  let formData = initialValues;
@@ -7,7 +7,6 @@ import Button from '../elements/Button';
7
7
  import Label from '../elements/Label';
8
8
  import FormikNumberInput from '../elements/formik/FormikNumberInput';
9
9
  import FormikSelect from '../elements/formik/FormikSelect';
10
- import { AUTO_PEAK_PICKING } from '../reducer/types/Types';
11
10
  import { headerLabelStyle } from './Header';
12
11
  import { HeaderContainer } from './HeaderContainer';
13
12
  const inputStyle = {
@@ -42,7 +41,7 @@ function AutoPeakPickingOptionPanel() {
42
41
  const dispatch = useDispatch();
43
42
  const handlePeakPicking = useCallback((values) => {
44
43
  dispatch({
45
- type: AUTO_PEAK_PICKING,
44
+ type: 'AUTO_PEAK_PICKING',
46
45
  payload: values,
47
46
  });
48
47
  }, [dispatch]);
@@ -11,7 +11,6 @@ import FormikCheckBox from '../elements/formik/FormikCheckBox';
11
11
  import FormikInput from '../elements/formik/FormikInput';
12
12
  import FormikOnChange from '../elements/formik/FormikOnChange';
13
13
  import { useFilter } from '../hooks/useFilter';
14
- import { RESET_SELECTED_TOOL, APPLY_BASE_LINE_CORRECTION_FILTER, CALCULATE_BASE_LINE_CORRECTION_FILTER, } from '../reducer/types/Types';
15
14
  import { headerLabelStyle } from './Header';
16
15
  import { HeaderContainer } from './HeaderContainer';
17
16
  const getAlgorithmsList = () => {
@@ -69,14 +68,14 @@ function BaseLineCorrectionInnerPanel(props) {
69
68
  const handleApplyFilter = (values, triggerSource = 'apply') => {
70
69
  dispatch({
71
70
  type: triggerSource === 'onChange'
72
- ? CALCULATE_BASE_LINE_CORRECTION_FILTER
73
- : APPLY_BASE_LINE_CORRECTION_FILTER,
74
- options: values,
71
+ ? 'CALCULATE_BASE_LINE_CORRECTION_FILTER'
72
+ : 'APPLY_BASE_LINE_CORRECTION_FILTER',
73
+ payload: values,
75
74
  });
76
75
  };
77
76
  const handleCancelFilter = () => {
78
77
  dispatch({
79
- type: RESET_SELECTED_TOOL,
78
+ type: 'RESET_SELECTED_TOOL',
80
79
  });
81
80
  };
82
81
  function handleChangeAlgorithm(selectedAlgorithm) {
@@ -100,7 +100,7 @@ function HeaderInner(props) {
100
100
  alignItems: 'center',
101
101
  }, children: [_jsx("div", { children: _jsx(Toolbar, { orientation: "horizontal", children: _jsx(AboutUsModal, {}) }) }), _jsx("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), _jsxs(HeaderContainer, { style: {
102
102
  alignItems: 'center',
103
- }, children: [!hideGeneralSettings && (_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })), _jsx(SaveButton, {}), _jsx(LogsHistory, {}), _jsx("div", { children: _jsxs(Toolbar, { orientation: "horizontal", children: [_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), children: _jsx(FaQuestionCircle, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreen && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onMaximize, title: "Full Screen", className: "windowButton", children: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
103
+ }, children: [!hideGeneralSettings && (_jsxs(_Fragment, { children: [_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), _jsx(SaveButton, {})] })), !general?.hideLogs && _jsx(LogsHistory, {}), _jsx("div", { children: _jsxs(Toolbar, { orientation: "horizontal", children: [_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), children: _jsx(FaQuestionCircle, {}) }), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreen && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onMaximize, title: "Full Screen", className: "windowButton", children: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
104
104
  }
105
105
  function SaveButton() {
106
106
  const { workspace, workspaces, originalWorkspaces } = usePreferences();
@@ -119,10 +119,8 @@ function SaveButton() {
119
119
  const MemoizedHeader = memo(HeaderInner);
120
120
  export default function HeaderWrapper({ isFullscreen, onMaximize }) {
121
121
  const { toolOptions: { selectedOptionPanel }, height, } = useChartData();
122
- return (_jsx(MemoizedHeader, { ...{
123
- selectedOptionPanel,
124
- isFullscreen,
125
- onMaximize,
126
- height,
127
- } }));
122
+ return (_jsx(MemoizedHeader, { selectedOptionPanel,
123
+ isFullscreen,
124
+ onMaximize,
125
+ height }));
128
126
  }
@@ -10,7 +10,6 @@ import Label from '../elements/Label';
10
10
  import Select from '../elements/Select';
11
11
  import { useFilter } from '../hooks/useFilter';
12
12
  import useSpectrum from '../hooks/useSpectrum';
13
- import { APPLY_MANUAL_PHASE_CORRECTION_FILTER, APPLY_AUTO_PHASE_CORRECTION_FILTER, CALCULATE_MANUAL_PHASE_CORRECTION_FILTER, RESET_SELECTED_TOOL, APPLY_ABSOLUTE_FILTER, } from '../reducer/types/Types';
14
13
  import { headerLabelStyle } from './Header';
15
14
  import { HeaderContainer } from './HeaderContainer';
16
15
  const selectStyle = {
@@ -74,20 +73,20 @@ export default function PhaseCorrectionPanel() {
74
73
  switch (phaseCorrectionType) {
75
74
  case phaseCorrectionTypes.automatic: {
76
75
  dispatch({
77
- type: APPLY_AUTO_PHASE_CORRECTION_FILTER,
76
+ type: 'APPLY_AUTO_PHASE_CORRECTION_FILTER',
78
77
  });
79
78
  break;
80
79
  }
81
80
  case phaseCorrectionTypes.manual: {
82
81
  dispatch({
83
- type: APPLY_MANUAL_PHASE_CORRECTION_FILTER,
84
- value,
82
+ type: 'APPLY_MANUAL_PHASE_CORRECTION_FILTER',
83
+ payload: value,
85
84
  });
86
85
  break;
87
86
  }
88
87
  case phaseCorrectionTypes.absolute: {
89
88
  dispatch({
90
- type: APPLY_ABSOLUTE_FILTER,
89
+ type: 'APPLY_ABSOLUTE_FILTER',
91
90
  });
92
91
  break;
93
92
  }
@@ -103,8 +102,8 @@ export default function PhaseCorrectionPanel() {
103
102
  diff0 - (diff1 * (data.re.length - pivot?.index)) / data.re.length;
104
103
  }
105
104
  dispatch({
106
- type: CALCULATE_MANUAL_PHASE_CORRECTION_FILTER,
107
- value: newValues,
105
+ type: 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER',
106
+ payload: newValues,
108
107
  });
109
108
  }, [data.re, dispatch, pivot?.index]);
110
109
  const updateInputRangeInitialValue = useCallback((value) => {
@@ -133,7 +132,7 @@ export default function PhaseCorrectionPanel() {
133
132
  }, [calcPhaseCorrectionHandler, updateInputRangeInitialValue]);
134
133
  const handleCancelFilter = useCallback(() => {
135
134
  dispatch({
136
- type: RESET_SELECTED_TOOL,
135
+ type: 'RESET_SELECTED_TOOL',
137
136
  });
138
137
  }, [dispatch]);
139
138
  const onChangeHandler = useCallback((val) => {
@@ -7,7 +7,6 @@ import Button from '../elements/Button';
7
7
  import Label from '../elements/Label';
8
8
  import FormikCheckBox from '../elements/formik/FormikCheckBox';
9
9
  import FormikNumberInput from '../elements/formik/FormikNumberInput';
10
- import { AUTO_RANGES_DETECTION } from '../reducer/types/Types';
11
10
  import { headerLabelStyle } from './Header';
12
11
  import { HeaderContainer } from './HeaderContainer';
13
12
  const validationSchema = Yup.object().shape({
@@ -21,7 +20,7 @@ function RangesPickingOptionPanel() {
21
20
  const dispatch = useDispatch();
22
21
  const handleRangesPicking = useCallback((values) => {
23
22
  dispatch({
24
- type: AUTO_RANGES_DETECTION,
23
+ type: 'AUTO_RANGES_DETECTION',
25
24
  payload: values,
26
25
  });
27
26
  }, [dispatch]);