nmrium 0.42.0 → 0.43.1-pre.1692874523

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 (306) hide show
  1. package/lib/component/1d/ApodizationLine.js +1 -1
  2. package/lib/component/1d/Chart1D.js +3 -2
  3. package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
  4. package/lib/component/1d/Line.js +1 -1
  5. package/lib/component/1d/Viewer1D.js +15 -3
  6. package/lib/component/1d/integral/IntegralResizable.js +4 -3
  7. package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  8. package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
  9. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
  10. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
  11. package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
  12. package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
  13. package/lib/component/1d/peaks/Peaks.d.ts +1 -0
  14. package/lib/component/1d/peaks/Peaks.js +22 -0
  15. package/lib/component/1d/ranges/Range.js +3 -1
  16. package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
  17. package/lib/component/1d/tool/BaseLineZones.js +11 -31
  18. package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
  19. package/lib/component/1d/utilities/intersectionResolver.js +71 -0
  20. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
  21. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
  22. package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -2
  23. package/lib/component/2d/SlicingView.js +1 -1
  24. package/lib/component/2d/Viewer2D.js +1 -3
  25. package/lib/component/2d/ft/Contours.js +1 -1
  26. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
  27. package/lib/component/EventsTrackers/KeysListenerTracker.js +48 -8
  28. package/lib/component/assignment/index.d.ts +6 -1
  29. package/lib/component/assignment/index.js +5 -1
  30. package/lib/component/context/DispatchContext.d.ts +3 -2
  31. package/lib/component/context/KeyModifierContext.d.ts +13 -0
  32. package/lib/component/context/KeyModifierContext.js +39 -0
  33. package/lib/component/context/PreferencesContext.d.ts +39 -39
  34. package/lib/component/elements/Button.js +2 -0
  35. package/lib/component/elements/CounterLabel.d.ts +7 -0
  36. package/lib/component/elements/CounterLabel.js +12 -0
  37. package/lib/component/elements/EditableColumn.js +12 -6
  38. package/lib/component/elements/Input.d.ts +3 -12
  39. package/lib/component/elements/Input.js +24 -76
  40. package/lib/component/elements/Message.js +0 -1
  41. package/lib/component/elements/NumberInput.d.ts +1 -0
  42. package/lib/component/elements/NumberInput.js +10 -3
  43. package/lib/component/elements/PreferencesButton.d.ts +4 -0
  44. package/lib/component/elements/PreferencesButton.js +6 -0
  45. package/lib/component/elements/formik/FormikInput.d.ts +2 -2
  46. package/lib/component/elements/formik/FormikInput.js +3 -6
  47. package/lib/component/elements/formik/FormikOnChange.js +1 -1
  48. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  49. package/lib/component/header/ApodizationOptionsPanel.js +23 -14
  50. package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
  51. package/lib/component/header/Header.d.ts +10 -3
  52. package/lib/component/header/Header.js +6 -6
  53. package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
  54. package/lib/component/highlight/index.d.ts +1 -0
  55. package/lib/component/highlight/index.js +1 -0
  56. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  57. package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
  58. package/lib/component/hooks/useResizerStatus.d.ts +2 -0
  59. package/lib/component/hooks/useResizerStatus.js +7 -0
  60. package/lib/component/hooks/useSpectrum.js +1 -1
  61. package/lib/component/main/ErrorOverlay.js +20 -0
  62. package/lib/component/main/InnerNMRium.d.ts +7 -0
  63. package/lib/component/main/InnerNMRium.js +52 -0
  64. package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
  65. package/lib/component/main/InnerNMRiumContents.js +88 -0
  66. package/lib/component/main/NMRium.d.ts +23 -0
  67. package/lib/component/main/NMRium.js +13 -0
  68. package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
  69. package/lib/component/main/NMRiumStateProvider.js +74 -0
  70. package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  71. package/lib/component/main/StateError.d.ts +4 -0
  72. package/lib/component/main/StateError.js +16 -0
  73. package/lib/component/main/index.d.ts +3 -0
  74. package/lib/component/main/index.js +3 -0
  75. package/lib/component/main/types.d.ts +18 -0
  76. package/lib/component/main/types.js +2 -0
  77. package/lib/component/modal/AlignSpectraModal.js +78 -29
  78. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +5 -1
  79. package/lib/component/modal/MoleculeStructureEditorModal.js +12 -15
  80. package/lib/component/modal/MultipletAnalysisModal.js +1 -1
  81. package/lib/component/modal/PredictSpectraModal.js +1 -1
  82. package/lib/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
  83. package/lib/component/modal/aboutUs/AboutUsZakodium.d.ts +1 -0
  84. package/lib/component/modal/aboutUs/AboutUsZakodium.js +33 -0
  85. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
  86. package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
  87. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
  88. package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
  89. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  90. package/lib/component/modal/setting/GeneralSettings.js +2 -2
  91. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  92. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
  93. package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
  94. package/lib/component/modal/setting/settingsValidation.js +5 -1
  95. package/lib/component/panels/InformationPanel.js +9 -100
  96. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
  97. package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  98. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
  99. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  100. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
  101. package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
  102. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +13 -9
  103. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  104. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
  105. package/lib/component/panels/Panels.js +6 -7
  106. package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
  107. package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
  108. package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
  109. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  110. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  111. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
  112. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  113. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
  114. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
  115. package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -3
  116. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -3
  117. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +8 -9
  118. package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
  119. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  120. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +18 -1
  121. package/lib/component/panels/databasePanel/DatabasePanel.js +3 -40
  122. package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +18 -0
  123. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +53 -0
  124. package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
  125. package/lib/component/panels/header/DefaultPanelHeader.js +11 -13
  126. package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -3
  127. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  128. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  129. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  130. package/lib/component/reducer/IgnoreActions.js +1 -1
  131. package/lib/component/reducer/Reducer.d.ts +3 -8
  132. package/lib/component/reducer/Reducer.js +34 -8
  133. package/lib/component/reducer/actions/DomainActions.js +2 -3
  134. package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
  135. package/lib/component/reducer/actions/FiltersActions.js +96 -28
  136. package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
  137. package/lib/component/reducer/actions/IntegralsActions.js +44 -20
  138. package/lib/component/reducer/actions/MoleculeActions.js +4 -4
  139. package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
  140. package/lib/component/reducer/actions/PeaksActions.js +19 -1
  141. package/lib/component/reducer/actions/PreferencesActions.js +1 -2
  142. package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
  143. package/lib/component/reducer/actions/RangesActions.js +31 -3
  144. package/lib/component/reducer/actions/ToolsActions.js +10 -10
  145. package/lib/component/reducer/core/Constants.d.ts +0 -4
  146. package/lib/component/reducer/core/Constants.js +0 -5
  147. package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -2
  148. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  149. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
  150. package/lib/component/toolbar/FunctionToolBar.js +13 -3
  151. package/lib/component/toolbar/ToolTypes.d.ts +3 -2
  152. package/lib/component/toolbar/ToolTypes.js +57 -22
  153. package/lib/component/utility/export.js +7 -4
  154. package/lib/component/utility/filterType.d.ts +3 -0
  155. package/lib/component/utility/filterType.js +1 -0
  156. package/lib/component/workspaces/basic.js +2 -0
  157. package/lib/component/workspaces/embedded.js +2 -0
  158. package/lib/component/workspaces/exercise.js +2 -0
  159. package/lib/component/workspaces/prediction.js +9 -0
  160. package/lib/component/workspaces/process1D.js +2 -0
  161. package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
  162. package/lib/data/PredictionManager.d.ts +3 -3
  163. package/lib/data/PredictionManager.js +10 -10
  164. package/lib/data/constants/References.d.ts +5 -3
  165. package/lib/data/data1d/Spectrum1D/getReferenceShift.d.ts +10 -1
  166. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
  167. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
  168. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
  169. package/lib/data/molecules/Molecule.js +2 -2
  170. package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
  171. package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
  172. package/lib/versionInfo.js +1 -1
  173. package/lib-cjs/component/1d/ApodizationLine.js +1 -1
  174. package/lib-cjs/component/1d/Chart1D.js +3 -2
  175. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
  176. package/lib-cjs/component/1d/Line.js +1 -1
  177. package/lib-cjs/component/1d/Viewer1D.js +15 -3
  178. package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
  179. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  180. package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
  181. package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
  182. package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
  183. package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
  184. package/lib-cjs/component/1d/ranges/Range.js +3 -1
  185. package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
  186. package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
  187. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
  188. package/lib-cjs/component/2d/SlicingView.js +1 -1
  189. package/lib-cjs/component/2d/Viewer2D.js +1 -3
  190. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  191. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +47 -7
  192. package/lib-cjs/component/assignment/index.js +5 -1
  193. package/lib-cjs/component/context/KeyModifierContext.js +44 -0
  194. package/lib-cjs/component/elements/Button.js +2 -0
  195. package/lib-cjs/component/elements/CounterLabel.js +16 -0
  196. package/lib-cjs/component/elements/EditableColumn.js +12 -6
  197. package/lib-cjs/component/elements/Input.js +23 -75
  198. package/lib-cjs/component/elements/Message.js +0 -1
  199. package/lib-cjs/component/elements/NumberInput.js +12 -2
  200. package/lib-cjs/component/elements/PreferencesButton.js +13 -0
  201. package/lib-cjs/component/elements/formik/FormikInput.js +3 -6
  202. package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
  203. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  204. package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
  205. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
  206. package/lib-cjs/component/header/Header.js +6 -6
  207. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
  208. package/lib-cjs/component/highlight/index.js +1 -0
  209. package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  210. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
  211. package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
  212. package/lib-cjs/component/hooks/useSpectrum.js +1 -1
  213. package/lib-cjs/component/main/ErrorOverlay.js +26 -0
  214. package/lib-cjs/component/main/InnerNMRium.js +82 -0
  215. package/lib-cjs/component/main/InnerNMRiumContents.js +95 -0
  216. package/lib-cjs/component/main/NMRium.js +19 -0
  217. package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
  218. package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  219. package/lib-cjs/component/main/StateError.js +20 -0
  220. package/lib-cjs/component/main/index.js +21 -0
  221. package/lib-cjs/component/main/types.js +3 -0
  222. package/lib-cjs/component/modal/AlignSpectraModal.js +100 -28
  223. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +11 -17
  224. package/lib-cjs/component/modal/MultipletAnalysisModal.js +1 -1
  225. package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
  226. package/lib-cjs/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
  227. package/lib-cjs/component/modal/aboutUs/AboutUsZakodium.js +39 -0
  228. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
  229. package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
  230. package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
  231. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
  232. package/lib-cjs/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
  233. package/lib-cjs/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
  234. package/lib-cjs/component/modal/setting/settingsValidation.js +4 -0
  235. package/lib-cjs/component/panels/InformationPanel.js +7 -98
  236. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
  237. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  238. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
  239. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  240. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
  241. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
  242. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
  243. package/lib-cjs/component/panels/Panels.js +6 -7
  244. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
  245. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
  246. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
  247. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  248. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  249. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
  250. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  251. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
  252. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +29 -6
  253. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +4 -5
  254. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +7 -8
  255. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
  256. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  257. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -40
  258. package/lib-cjs/component/panels/databasePanel/DatabaseSearchOptions.js +60 -0
  259. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +12 -12
  260. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -3
  261. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  262. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  263. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  264. package/lib-cjs/component/reducer/IgnoreActions.js +1 -1
  265. package/lib-cjs/component/reducer/Reducer.js +33 -7
  266. package/lib-cjs/component/reducer/actions/DomainActions.js +2 -3
  267. package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
  268. package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
  269. package/lib-cjs/component/reducer/actions/MoleculeActions.js +3 -3
  270. package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
  271. package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -2
  272. package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
  273. package/lib-cjs/component/reducer/actions/ToolsActions.js +9 -9
  274. package/lib-cjs/component/reducer/core/Constants.js +1 -6
  275. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +1 -2
  276. package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
  277. package/lib-cjs/component/toolbar/ToolTypes.js +57 -22
  278. package/lib-cjs/component/utility/export.js +7 -4
  279. package/lib-cjs/component/utility/filterType.js +2 -0
  280. package/lib-cjs/component/workspaces/basic.js +2 -0
  281. package/lib-cjs/component/workspaces/embedded.js +2 -0
  282. package/lib-cjs/component/workspaces/exercise.js +2 -0
  283. package/lib-cjs/component/workspaces/prediction.js +9 -0
  284. package/lib-cjs/component/workspaces/process1D.js +2 -0
  285. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
  286. package/lib-cjs/data/PredictionManager.js +9 -9
  287. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
  288. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
  289. package/lib-cjs/data/molecules/Molecule.js +2 -2
  290. package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
  291. package/lib-cjs/versionInfo.js +1 -1
  292. package/package.json +26 -25
  293. package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
  294. package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
  295. package/lib/component/ErrorOverlay.js +0 -27
  296. package/lib/component/NMRium.d.ts +0 -42
  297. package/lib/component/NMRium.js +0 -237
  298. package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
  299. package/lib/component/reducer/actions/GlobalActions.js +0 -4
  300. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
  301. package/lib-cjs/component/ErrorOverlay.js +0 -30
  302. package/lib-cjs/component/NMRium.js +0 -267
  303. package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
  304. /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
  305. /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
  306. /package/lib/component/modal/{AboutUsModal.d.ts → aboutUs/AboutUsModal.d.ts} +0 -0
@@ -44,7 +44,7 @@ function PredictionPanel() {
44
44
  const settingRef = (0, react_1.useRef)();
45
45
  const { item: spectraPanelState, utils: { toggle: openSpectraPanel }, } = (0, ui_1.useAccordionContext)('Spectra');
46
46
  const predictionPreferences = (0, usePanelPreferences_1.usePanelPreferences)('prediction');
47
- const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)(true);
47
+ const { modal, openMoleculeEditor } = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)(true);
48
48
  const refreshSlider = (0, react_1.useRef)(false);
49
49
  (0, react_1.useEffect)(() => {
50
50
  if (Array.isArray(molecules) &&
@@ -77,7 +77,7 @@ function PredictionPanel() {
77
77
  }
78
78
  const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
79
79
  try {
80
- const data = await (0, PredictionManager_1.predictSpectra)(molfile);
80
+ const data = await (0, PredictionManager_1.predictSpectra)(molfile, predictionPreferences.spectra);
81
81
  dispatch({
82
82
  type: 'PREDICT_SPECTRA',
83
83
  payload: {
@@ -125,6 +125,6 @@ function PredictionPanel() {
125
125
  ...styles.slider,
126
126
  height: height - 31,
127
127
  }, children: molIndex === currentIndex && ((0, jsx_runtime_1.jsx)(full_1.StructureEditor, { width: width, initialMolfile: mol.molfile, svgMenu: true, fragment: false, onChange: changeHandler })) })] }, mol.id)))) : ((0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: molfile || '', width: width, height: height, svgMenu: true, fragment: false, onChange: changeHandler })) }));
128
- } }) }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: '5px' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => predictHandler('save'), disabled: !molfile, children: isPredictedBefore ? 'Replace prediction' : 'Predict spectra' }), isPredictedBefore && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { marginLeft: '5px' }, onClick: () => predictHandler('add'), children: "Add prediction" }))] })] })] }))] }));
128
+ } }) }), (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', padding: '5px' }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => predictHandler('save'), disabled: !molfile, children: isPredictedBefore ? 'Replace prediction' : 'Predict spectra' }), isPredictedBefore && ((0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { marginLeft: '5px' }, onClick: () => predictHandler('add'), children: "Add prediction" }))] })] })] })), modal] }));
129
129
  }
130
130
  exports.default = PredictionPanel;
@@ -65,7 +65,6 @@ function PredictionSimpleOptions() {
65
65
  display: 'flex',
66
66
  justifyContent: 'flex-end',
67
67
  flex: '1',
68
- padding: '0 10px',
69
68
  height: '100%',
70
69
  }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: selectStyles, name: "frequency" }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "1d.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 5px' }, children: "Hz" })] }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { enableValidation: true, onChange: optionsChangeHandler })] }) }));
71
70
  }
@@ -69,7 +69,7 @@ function SpectrumSimulation() {
69
69
  }
70
70
  function saveSettingsHandler(values) {
71
71
  simulateHandler(values);
72
- formRef.current?.setValues(values);
72
+ void formRef.current?.setValues(values);
73
73
  }
74
74
  return ((0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: { ...spectrumSimulation_1.defaultSimulationOptions, data }, enableReinitialize: true,
75
75
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -25,7 +25,6 @@ function SpectrumSimulationSimpleOptions({ onSpinSystemChange, spinSystem, }) {
25
25
  display: 'flex',
26
26
  justifyContent: 'flex-end',
27
27
  flex: '1',
28
- padding: '0 10px',
29
- }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Spin system", style: labelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: SPIN_SYSTEMS, style: selectStyles, onChange: onSpinSystemChange, value: spinSystem }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "options.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 5px' }, children: "Hz" })] })] }));
28
+ }, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "", style: labelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: SPIN_SYSTEMS, style: selectStyles, onChange: onSpinSystemChange, value: spinSystem }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Frequency", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: PredictionManager_1.FREQUENCIES, style: selectStyles, name: "options.frequency" }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Line Width", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "options.lineWidth", type: "number", style: { margin: 0, width: '40px' } }), (0, jsx_runtime_1.jsx)("span", { style: { padding: '0 5px' }, children: "Hz" })] })] }));
30
29
  }
31
30
  exports.default = SpectrumSimulationSimpleOptions;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ignoreActions = new Set([
4
4
  'INITIALIZE_NMRIUM',
5
+ 'SECRET_THROW_ERROR',
5
6
  'APPLY_KEY_PREFERENCES',
6
7
  'BRUSH_END',
7
8
  'RESET_SELECTED_TOOL',
@@ -21,7 +22,6 @@ const ignoreActions = new Set([
21
22
  'CHANGE_SPECTRUM_VISIBILITY',
22
23
  'CHANGE_SPECTRA_VISIBILITY_BY_NUCLEUS',
23
24
  'CHANGE_ACTIVE_SPECTRUM',
24
- 'SET_MOUSE_OVER_DISPLAYER',
25
25
  'CHANGE_FLOAT_MOLECULE_POSITION',
26
26
  'ALIGN_SPECTRA',
27
27
  'TOGGLE_REAL_IMAGINARY_VISIBILITY',
@@ -34,7 +34,6 @@ const DatabaseActions = __importStar(require("./actions/DatabaseActions"));
34
34
  const DimensionsActions = __importStar(require("./actions/DimensionsActions"));
35
35
  const DomainActions = __importStar(require("./actions/DomainActions"));
36
36
  const FiltersActions = __importStar(require("./actions/FiltersActions"));
37
- const GlobalActions = __importStar(require("./actions/GlobalActions"));
38
37
  const IntegralsActions = __importStar(require("./actions/IntegralsActions"));
39
38
  const LoadActions = __importStar(require("./actions/LoadActions"));
40
39
  const MoleculeActions = __importStar(require("./actions/MoleculeActions"));
@@ -45,7 +44,6 @@ const SpectraAnalysisActions = __importStar(require("./actions/SpectraAnalysisAc
45
44
  const SpectrumsActions = __importStar(require("./actions/SpectrumsActions"));
46
45
  const ToolsActions = __importStar(require("./actions/ToolsActions"));
47
46
  const ZonesActions = __importStar(require("./actions/ZonesActions"));
48
- const Constants_2 = require("./core/Constants");
49
47
  exports.rangeStateInit = {
50
48
  showMultiplicityTrees: false,
51
49
  showRangesIntegrals: true,
@@ -113,13 +111,12 @@ const getInitialState = () => ({
113
111
  },
114
112
  isLoading: false,
115
113
  keysPreferences: {},
116
- displayerMode: Constants_2.DISPLAYER_MODE.DM_1D,
114
+ displayerMode: '1D',
117
115
  correlations: {},
118
116
  displayerKey: '',
119
117
  zoom: {
120
118
  history: {},
121
119
  },
122
- overDisplayer: false,
123
120
  toolOptions: {
124
121
  selectedTool: 'zoom',
125
122
  selectedOptionPanel: null,
@@ -127,6 +124,7 @@ const getInitialState = () => ({
127
124
  baselineCorrection: {
128
125
  options: {},
129
126
  zones: [],
127
+ livePreview: true,
130
128
  },
131
129
  apodizationOptions: {},
132
130
  pivot: { value: 0, index: 0 },
@@ -178,6 +176,8 @@ function innerSpectrumReducer(draft, action) {
178
176
  return PeaksActions.handleChangePeakShape(draft, action);
179
177
  case 'TOGGLE_PEAKS_VIEW_PROPERTY':
180
178
  return PeaksActions.handleTogglePeaksViewProperty(draft, action);
179
+ case 'TOGGLE_PEAKS_DISPLAYING_MODE':
180
+ return PeaksActions.handleChangePeaksDisplayingMode(draft);
181
181
  case 'ADD_INTEGRAL':
182
182
  return IntegralsActions.handleAddIntegral(draft, action);
183
183
  case 'DELETE_INTEGRAL':
@@ -191,6 +191,8 @@ function innerSpectrumReducer(draft, action) {
191
191
  return IntegralsActions.handleChangeIntegralsSumFlag(draft);
192
192
  case 'CHANGE_INTEGRAL_RELATIVE':
193
193
  return IntegralsActions.handleChangeIntegralsRelativeValue(draft, action);
194
+ case 'CUT_INTEGRAL':
195
+ return IntegralsActions.handleCutIntegral(draft, action);
194
196
  case 'SET_X_DOMAIN':
195
197
  return DomainActions.handleSetXDomain(draft, action);
196
198
  case 'SET_Y_DOMAIN':
@@ -211,6 +213,10 @@ function innerSpectrumReducer(draft, action) {
211
213
  return FiltersActions.handleCalculateZeroFillingFilter(draft, action);
212
214
  case 'APPLY_FFT_FILTER':
213
215
  return FiltersActions.handleApplyFFTFilter(draft);
216
+ case 'APPLY_FFT_DIMENSION_1_FILTER':
217
+ return FiltersActions.handleApplyFFtDimension1Filter(draft);
218
+ case 'APPLY_FFT_DIMENSION_2_FILTER':
219
+ return FiltersActions.handleApplyFFtDimension2Filter(draft);
214
220
  case 'APPLY_MANUAL_PHASE_CORRECTION_FILTER':
215
221
  return FiltersActions.handleApplyManualPhaseCorrectionFilter(draft, action);
216
222
  case 'CALCULATE_MANUAL_PHASE_CORRECTION_FILTER':
@@ -357,6 +363,8 @@ function innerSpectrumReducer(draft, action) {
357
363
  return RangesActions.handleAutoSpectraRangesDetection(draft);
358
364
  case 'SHOW_J_GRAPH':
359
365
  return RangesActions.handleShowJGraph(draft, action);
366
+ case 'CUT_RANGE':
367
+ return RangesActions.handleCutRange(draft, action);
360
368
  case 'SET_KEY_PREFERENCES':
361
369
  return PreferencesActions.handleSetKeyPreferences(draft, action);
362
370
  case 'APPLY_KEY_PREFERENCES':
@@ -399,15 +407,33 @@ function innerSpectrumReducer(draft, action) {
399
407
  return DatabaseActions.handleResurrectSpectrumFromJcamp(draft, action);
400
408
  case 'SET_AUTOMATIC_ASSIGNMENTS':
401
409
  return AssignmentsActions.handleSetAutomaticAssignments(draft, action);
402
- case 'SET_MOUSE_OVER_DISPLAYER':
403
- return GlobalActions.handleSetIsOverDisplayer(draft, action);
410
+ case 'SECRET_THROW_ERROR': {
411
+ throw new Error('Error thrown in main reducer');
412
+ }
404
413
  default:
405
414
  }
406
415
  }
407
416
  catch (error) {
408
417
  draft.errorAction = error;
409
- error.data = { action };
418
+ error.data = { action, state: getDebugState(draft) };
410
419
  reportError(error);
411
420
  }
412
421
  }
413
422
  exports.spectrumReducer = (0, immer_1.produce)(innerSpectrumReducer);
423
+ function getDebugState(draft) {
424
+ const state = (0, immer_1.original)(draft);
425
+ const string = JSON.stringify(state, (key, value) => {
426
+ if (ArrayBuffer.isView(value)) {
427
+ return Array.from(value).slice(0, 20);
428
+ }
429
+ if (Array.isArray(value) && typeof value[0] === 'number') {
430
+ return value.slice(0, 20);
431
+ }
432
+ return value;
433
+ });
434
+ if (string.length > 800000) {
435
+ // fallback, better to have something as a string t han nothing
436
+ return string.slice(0, 800000);
437
+ }
438
+ return JSON.parse(string);
439
+ }
@@ -8,7 +8,6 @@ const d3_1 = require("d3");
8
8
  const get1DDataXY_1 = require("../../../data/data1d/Spectrum1D/get1DDataXY");
9
9
  const Spectrum2D_1 = require("../../../data/data2d/Spectrum2D");
10
10
  const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
11
- const Constants_1 = require("../core/Constants");
12
11
  const ZoomHistoryManager_1 = require("../helper/ZoomHistoryManager");
13
12
  const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
14
13
  function getActiveData(draft) {
@@ -130,7 +129,7 @@ function setDomain(draft, options) {
130
129
  const { updateYDomain = true, isYDomainShared = true, updateXDomain = true, } = options || {};
131
130
  let domain;
132
131
  if (draft.view.spectra.activeTab) {
133
- if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
132
+ if (draft.displayerMode === '1D') {
134
133
  domain = getDomain(draft);
135
134
  }
136
135
  else {
@@ -143,7 +142,7 @@ function setDomain(draft, options) {
143
142
  // draft.originDomain = domain;
144
143
  if (updateYDomain) {
145
144
  draft.yDomain = domain.yDomain;
146
- if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && isYDomainShared) {
145
+ if (draft.displayerMode === '1D' && isYDomainShared) {
147
146
  draft.yDomains = Object.fromEntries(Object.keys(domain.yDomains).map((key) => {
148
147
  return [key, domain.yDomain];
149
148
  }));
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.rollbackSpectrumByFilter = exports.rollbackSpectrum = exports.handleSignalProcessingFilter = exports.handleDeleteExclusionZone = exports.handleAddExclusionZone = exports.handleSetFilterSnapshotHandler = exports.handleBaseLineCorrectionFilter = exports.handleDeleteSpectraFilter = exports.handleDeleteFilter = exports.handleEnableFilter = exports.handleCalculateZeroFillingFilter = exports.handleCalculateApodizationFilter = exports.handleCalculateBaseLineCorrection = exports.calculateBaseLineCorrection = exports.handleCalculateManualPhaseCorrection = exports.handleApplyAbsoluteFilter = exports.handleApplyAutoPhaseCorrectionFilter = exports.handleApplyManualPhaseCorrectionFilter = exports.handleApplyFFTFilter = exports.handleApplyApodizationFilter = exports.handleApplyZeroFillingFilter = exports.handleShiftSpectrumAlongXAxis = void 0;
6
+ exports.rollbackSpectrumByFilter = exports.rollbackSpectrum = exports.handleSignalProcessingFilter = exports.handleDeleteExclusionZone = exports.handleAddExclusionZone = exports.handleSetFilterSnapshotHandler = exports.handleBaseLineCorrectionFilter = exports.handleDeleteSpectraFilter = exports.handleDeleteFilter = exports.handleEnableFilter = exports.handleCalculateZeroFillingFilter = exports.handleCalculateApodizationFilter = exports.handleCalculateBaseLineCorrection = exports.calculateBaseLineCorrection = exports.handleCalculateManualPhaseCorrection = exports.handleApplyAbsoluteFilter = exports.handleApplyAutoPhaseCorrectionFilter = exports.handleApplyManualPhaseCorrectionFilter = exports.handleApplyFFtDimension2Filter = exports.handleApplyFFtDimension1Filter = exports.handleApplyFFTFilter = exports.handleApplyApodizationFilter = exports.handleApplyZeroFillingFilter = exports.handleShiftSpectrumAlongXAxis = void 0;
7
7
  const uuid_1 = require("@lukeed/uuid");
8
8
  const immer_1 = require("immer");
9
9
  const nmr_processing_1 = require("nmr-processing");
@@ -19,7 +19,7 @@ const getStrongestPeak_1 = require("../helper/getStrongestPeak");
19
19
  const DomainActions_1 = require("./DomainActions");
20
20
  const PreferencesActions_1 = require("./PreferencesActions");
21
21
  const ToolsActions_1 = require("./ToolsActions");
22
- const { fft, apodization, baselineCorrection, phaseCorrection, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, } = nmr_processing_1.Filters;
22
+ const { fft, fftDimension1, fftDimension2, apodization, baselineCorrection, phaseCorrection, zeroFilling, shiftX, shift2DX, shift2DY, exclusionZones, signalProcessing, } = nmr_processing_1.Filters;
23
23
  function getFilterUpdateDomainRules(filterName) {
24
24
  return (nmr_processing_1.Filters[filterName]?.DOMAIN_UPDATE_RULES || {
25
25
  updateXDomain: false,
@@ -166,6 +166,25 @@ function updateView(draft, filterUpdateDomainRules) {
166
166
  (0, DomainActions_1.setMode)(draft);
167
167
  (0, PreferencesActions_1.changeSpectrumVerticalAlignment)(draft, { verticalAlign: 'auto-check' });
168
168
  }
169
+ function disableLivePreview(draft, id) {
170
+ const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
171
+ if (activeSpectrum) {
172
+ const index = activeSpectrum.index;
173
+ const { data } = draft.tempData[index];
174
+ draft.data[index].data = data;
175
+ (0, DomainActions_1.setDomain)(draft);
176
+ // reset default options
177
+ switch (id) {
178
+ case apodization.name: {
179
+ draft.toolOptions.data.apodizationOptions = DefaultApodizationOptions_1.defaultApodizationOptions;
180
+ break;
181
+ }
182
+ default: {
183
+ return null;
184
+ }
185
+ }
186
+ }
187
+ }
169
188
  //action
170
189
  function handleShiftSpectrumAlongXAxis(draft, action) {
171
190
  //apply filter into the spectrum
@@ -199,7 +218,7 @@ function handleApplyZeroFillingFilter(draft, action) {
199
218
  const filters = [
200
219
  {
201
220
  name: zeroFilling.id,
202
- value: action.payload,
221
+ value: action.payload.options,
203
222
  },
204
223
  ];
205
224
  nmr_processing_1.FiltersManager.applyFilter(draft.data[index], filters, {
@@ -222,16 +241,22 @@ exports.handleApplyZeroFillingFilter = handleApplyZeroFillingFilter;
222
241
  function handleCalculateZeroFillingFilter(draft, action) {
223
242
  const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
224
243
  if (activeSpectrum) {
225
- const index = activeSpectrum.index;
226
- const { data: { x, re, im }, filters, info, } = draft.tempData[index];
227
- const _data = { data: { x, re, im }, filters, info };
228
- zeroFilling.apply(_data, action.payload);
229
- const { im: newIm, re: newRe, x: newX } = _data.data;
230
- const datum = draft.data[index];
231
- datum.data.x = newX;
232
- datum.data.im = newIm;
233
- datum.data.re = newRe;
234
- draft.xDomain = [newX[0], newX.at(-1)];
244
+ const { options, livePreview } = action.payload;
245
+ if (livePreview) {
246
+ const index = activeSpectrum.index;
247
+ const { data: { x, re, im }, filters, info, } = draft.tempData[index];
248
+ const _data = { data: { x, re, im }, filters, info };
249
+ zeroFilling.apply(_data, options);
250
+ const { im: newIm, re: newRe, x: newX } = _data.data;
251
+ const datum = draft.data[index];
252
+ datum.data.x = newX;
253
+ datum.data.im = newIm;
254
+ datum.data.re = newRe;
255
+ draft.xDomain = [newX[0], newX.at(-1)];
256
+ }
257
+ else {
258
+ disableLivePreview(draft, zeroFilling.name);
259
+ }
235
260
  }
236
261
  }
237
262
  exports.handleCalculateZeroFillingFilter = handleCalculateZeroFillingFilter;
@@ -240,15 +265,20 @@ function handleCalculateApodizationFilter(draft, action) {
240
265
  const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
241
266
  if (activeSpectrum) {
242
267
  const index = activeSpectrum.index;
243
- const options = action.payload;
244
- const { data: { x, re, im }, info, } = draft.tempData[index];
245
- const _data = { data: { x, re, im }, info };
246
- draft.toolOptions.data.apodizationOptions = options;
247
- apodization.apply(_data, options);
248
- const { im: newIm, re: newRe } = _data.data;
249
- const datum = draft.data[index];
250
- datum.data.im = newIm;
251
- datum.data.re = newRe;
268
+ const { livePreview, options } = action.payload;
269
+ if (livePreview) {
270
+ const { data: { x, re, im }, info, } = draft.tempData[index];
271
+ const _data = { data: { x, re, im }, info };
272
+ draft.toolOptions.data.apodizationOptions = options;
273
+ apodization.apply(_data, options);
274
+ const { im: newIm, re: newRe } = _data.data;
275
+ const datum = draft.data[index];
276
+ datum.data.im = newIm;
277
+ datum.data.re = newRe;
278
+ }
279
+ else {
280
+ disableLivePreview(draft, apodization.name);
281
+ }
252
282
  }
253
283
  }
254
284
  exports.handleCalculateApodizationFilter = handleCalculateApodizationFilter;
@@ -261,7 +291,7 @@ function handleApplyApodizationFilter(draft, action) {
261
291
  nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [
262
292
  {
263
293
  name: apodization.id,
264
- value: action.payload,
294
+ value: action.payload.options,
265
295
  },
266
296
  ], { filterIndex: activeFilterIndex });
267
297
  if (activeFilterIndex !== -1) {
@@ -297,6 +327,44 @@ function handleApplyFFTFilter(draft) {
297
327
  }
298
328
  }
299
329
  exports.handleApplyFFTFilter = handleApplyFFTFilter;
330
+ function handleApplyFFtDimension1Filter(draft) {
331
+ const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
332
+ if (activeSpectrum) {
333
+ const { index } = activeSpectrum;
334
+ const activeFilterIndex = getActiveFilterIndex(draft);
335
+ //apply filter into the spectrum
336
+ nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [{ name: fftDimension1.id, value: {} }], { filterIndex: activeFilterIndex });
337
+ if (activeFilterIndex !== -1) {
338
+ rollbackSpectrumByFilter(draft, {
339
+ searchBy: 'name',
340
+ key: fftDimension1.id,
341
+ });
342
+ }
343
+ else {
344
+ updateView(draft, fftDimension1.DOMAIN_UPDATE_RULES);
345
+ }
346
+ }
347
+ }
348
+ exports.handleApplyFFtDimension1Filter = handleApplyFFtDimension1Filter;
349
+ function handleApplyFFtDimension2Filter(draft) {
350
+ const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
351
+ if (activeSpectrum) {
352
+ const { index } = activeSpectrum;
353
+ const activeFilterIndex = getActiveFilterIndex(draft);
354
+ //apply filter into the spectrum
355
+ nmr_processing_1.FiltersManager.applyFilter(draft.data[index], [{ name: fftDimension2.id, value: {} }], { filterIndex: activeFilterIndex });
356
+ if (activeFilterIndex !== -1) {
357
+ rollbackSpectrumByFilter(draft, {
358
+ searchBy: 'name',
359
+ key: fftDimension2.id,
360
+ });
361
+ }
362
+ else {
363
+ updateView(draft, fftDimension2.DOMAIN_UPDATE_RULES);
364
+ }
365
+ }
366
+ }
367
+ exports.handleApplyFFtDimension2Filter = handleApplyFFtDimension2Filter;
300
368
  //action
301
369
  function handleApplyManualPhaseCorrectionFilter(draft, action) {
302
370
  const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
@@ -395,7 +463,7 @@ function handleBaseLineCorrectionFilter(draft, action) {
395
463
  const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
396
464
  if (activeSpectrum) {
397
465
  const { zones } = draft.toolOptions.data.baselineCorrection;
398
- const { livePreview, ...options } = action.payload;
466
+ const { options } = action.payload;
399
467
  const activeFilterIndex = getActiveFilterIndex(draft);
400
468
  nmr_processing_1.FiltersManager.applyFilter(draft.data[activeSpectrum.index], [
401
469
  {
@@ -427,21 +495,23 @@ function calculateBaseLineCorrection(draft, baseLineOptions) {
427
495
  // save the baseline options temporary
428
496
  draft.toolOptions.data.baselineCorrection = {
429
497
  ...draft.toolOptions.data.baselineCorrection,
430
- ...(baseLineOptions ? { options: baseLineOptions } : {}),
498
+ ...(baseLineOptions && baseLineOptions),
431
499
  };
432
- const { zones, options } = draft.toolOptions.data.baselineCorrection;
433
- const { livePreview, ...filterOptions } = options;
500
+ const { zones, options, livePreview } = draft.toolOptions.data.baselineCorrection;
434
501
  if (livePreview) {
435
502
  const _data = { data: { x, re, im }, info };
436
503
  baselineCorrection.apply(_data, {
437
504
  zones,
438
- ...filterOptions,
505
+ ...options,
439
506
  });
440
507
  const { im: newIm, re: newRe } = _data.data;
441
508
  const datum = draft.data[index];
442
509
  datum.data.im = newIm;
443
510
  datum.data.re = newRe;
444
511
  }
512
+ else {
513
+ disableLivePreview(draft, baselineCorrection.id);
514
+ }
445
515
  }
446
516
  }
447
517
  exports.calculateBaseLineCorrection = calculateBaseLineCorrection;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handleChangeIntegralsSumFlag = exports.handleChangeIntegralsRelativeValue = exports.handleChangeIntegral = exports.handleDeleteIntegral = exports.handleAddIntegral = exports.handleChangeIntegralSum = void 0;
6
+ exports.handleChangeIntegralsSumFlag = exports.handleChangeIntegralsRelativeValue = exports.handleChangeIntegral = exports.handleDeleteIntegral = exports.handleAddIntegral = exports.handleChangeIntegralSum = exports.handleCutIntegral = void 0;
7
7
  const uuid_1 = require("@lukeed/uuid");
8
8
  const immer_1 = require("immer");
9
9
  const ml_spectra_processing_1 = require("ml-spectra-processing");
@@ -11,6 +11,7 @@ const Spectrum1D_1 = require("../../../data/data1d/Spectrum1D");
11
11
  const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
12
12
  const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
13
13
  const getRange_1 = __importDefault(require("../helper/getRange"));
14
+ const getSpectrum_1 = require("../helper/getSpectrum");
14
15
  const DomainActions_1 = require("./DomainActions");
15
16
  function handleChangeIntegralSum(draft, action) {
16
17
  const { options } = action.payload;
@@ -24,31 +25,39 @@ function handleChangeIntegralSum(draft, action) {
24
25
  }
25
26
  }
26
27
  exports.handleChangeIntegralSum = handleChangeIntegralSum;
28
+ function initiateIntergalSumOptions(datum, options) {
29
+ const { molecules, nucleus } = options;
30
+ datum.integrals.options = (0, SumManager_1.initSumOptions)(datum.integrals.options, {
31
+ molecules,
32
+ nucleus,
33
+ });
34
+ }
35
+ function addIntegral(datum, options) {
36
+ const { from, to } = options;
37
+ const { x, re } = datum.data;
38
+ const shiftX = (0, Spectrum1D_1.getShiftX)(datum);
39
+ const integration = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
40
+ const integral = {
41
+ id: (0, uuid_1.v4)(),
42
+ originFrom: from - shiftX,
43
+ originTo: to - shiftX,
44
+ from,
45
+ to,
46
+ integral: integration,
47
+ absolute: integration,
48
+ kind: 'signal',
49
+ };
50
+ datum.integrals.values.push(integral);
51
+ }
27
52
  function handleAddIntegral(draft, action) {
28
53
  const { startX, endX } = action.payload;
29
54
  const { data, molecules, view: { spectra: { activeTab: nucleus }, }, } = draft;
30
55
  const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
31
- const [from, to] = (0, getRange_1.default)(draft, { startX, endX });
32
56
  if (activeSpectrum?.id) {
57
+ const [from, to] = (0, getRange_1.default)(draft, { startX, endX });
33
58
  const datum = data[activeSpectrum.index];
34
- const { x, re } = datum.data;
35
- const shiftX = (0, Spectrum1D_1.getShiftX)(datum);
36
- const integration = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
37
- const integral = {
38
- id: (0, uuid_1.v4)(),
39
- originFrom: from - shiftX,
40
- originTo: to - shiftX,
41
- from,
42
- to,
43
- integral: integration,
44
- absolute: integration,
45
- kind: 'signal',
46
- };
47
- datum.integrals.values.push(integral);
48
- datum.integrals.options = (0, SumManager_1.initSumOptions)(datum.integrals.options, {
49
- molecules,
50
- nucleus,
51
- });
59
+ addIntegral(datum, { from, to });
60
+ initiateIntergalSumOptions(datum, { molecules, nucleus });
52
61
  (0, Spectrum1D_1.updateIntegralsRelativeValues)(datum);
53
62
  (0, DomainActions_1.setIntegralsYDomain)(draft, datum);
54
63
  }
@@ -112,3 +121,19 @@ function handleChangeIntegralsSumFlag(draft) {
112
121
  }
113
122
  }
114
123
  exports.handleChangeIntegralsSumFlag = handleChangeIntegralsSumFlag;
124
+ function handleCutIntegral(draft, action) {
125
+ const { cutValue } = action.payload;
126
+ const spectrum = (0, getSpectrum_1.getSpectrum)(draft);
127
+ const integrals = spectrum.integrals.values;
128
+ for (let i = 0; i < integrals.length; i++) {
129
+ const { to, from } = integrals[i];
130
+ if (cutValue > from && cutValue < to) {
131
+ integrals.splice(i, 1);
132
+ addIntegral(spectrum, { from, to: cutValue });
133
+ addIntegral(spectrum, { from: cutValue, to });
134
+ }
135
+ }
136
+ (0, Spectrum1D_1.updateIntegralsRelativeValues)(spectrum);
137
+ (0, DomainActions_1.setIntegralsYDomain)(draft, spectrum);
138
+ }
139
+ exports.handleCutIntegral = handleCutIntegral;
@@ -87,10 +87,10 @@ function handleSetMolecule(draft, action) {
87
87
  }
88
88
  exports.handleSetMolecule = handleSetMolecule;
89
89
  function removeAssignments(draft, assignmentData) {
90
- if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_1D) {
90
+ if (draft.displayerMode === '1D') {
91
91
  (0, RangesActions_1.unlinkRange)(draft, { assignmentData });
92
92
  }
93
- if (draft.displayerMode === Constants_1.DISPLAYER_MODE.DM_2D) {
93
+ if (draft.displayerMode === '2D') {
94
94
  (0, ZonesActions_1.unlinkZone)(draft, { assignmentData });
95
95
  }
96
96
  }
@@ -147,7 +147,7 @@ function checkPredictions(predictedSpectra, inputOptions, molfile, logger) {
147
147
  const { spectra } = inputOptions;
148
148
  const missing2DPrediction = [];
149
149
  const molecule = full_1.default.Molecule.fromMolfile(molfile);
150
- molecule.addImplicitHydrogens();
150
+ //@ts-expect-error Will be fixed once OCL-utils is typed correctly
151
151
  const { atoms } = (0, openchemlib_utils_1.getAtoms)(molecule);
152
152
  for (const [experiment, required] of Object.entries(spectra)) {
153
153
  if (!required || predictedSpectra[experiment])
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handleTogglePeaksViewProperty = exports.handleChangePeakShape = exports.handleOptimizePeaks = exports.handleAutoPeakPicking = exports.handleDeletePeak = exports.handleAddPeaks = exports.handleAddPeak = void 0;
6
+ exports.handleChangePeaksDisplayingMode = exports.handleTogglePeaksViewProperty = exports.handleChangePeakShape = exports.handleOptimizePeaks = exports.handleAutoPeakPicking = exports.handleDeletePeak = exports.handleAddPeaks = exports.handleAddPeak = void 0;
7
7
  const uuid_1 = require("@lukeed/uuid");
8
8
  const immer_1 = require("immer");
9
9
  const ml_spectra_processing_1 = require("ml-spectra-processing");
@@ -158,3 +158,22 @@ function togglePeaksViewProperty(draft, key) {
158
158
  }
159
159
  }
160
160
  }
161
+ function handleChangePeaksDisplayingMode(draft) {
162
+ const activeSpectrum = (0, getActiveSpectrum_1.getActiveSpectrum)(draft);
163
+ if (activeSpectrum?.id) {
164
+ const peaksView = draft.view.peaks;
165
+ if (peaksView[activeSpectrum.id]) {
166
+ peaksView[activeSpectrum.id].displayingMode =
167
+ peaksView[activeSpectrum.id].displayingMode === 'single'
168
+ ? 'spread'
169
+ : 'single';
170
+ }
171
+ else {
172
+ const defaultPeaksView = { ...useActiveSpectrumPeaksViewState_1.defaultPeaksViewState };
173
+ defaultPeaksView.displayingMode =
174
+ defaultPeaksView.displayingMode === 'single' ? 'spread' : 'single';
175
+ peaksView[activeSpectrum.id] = defaultPeaksView;
176
+ }
177
+ }
178
+ }
179
+ exports.handleChangePeaksDisplayingMode = handleChangePeaksDisplayingMode;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.handleApplyKeyPreferences = exports.handleSetKeyPreferences = exports.changeSpectrumVerticalAlignment = void 0;
7
7
  const GroupByInfoKey_1 = __importDefault(require("../../utility/GroupByInfoKey"));
8
8
  const nucleusToString_1 = __importDefault(require("../../utility/nucleusToString"));
9
- const Constants_1 = require("../core/Constants");
10
9
  const getActiveSpectrum_1 = require("../helper/getActiveSpectrum");
11
10
  const DomainActions_1 = require("./DomainActions");
12
11
  function changeSpectrumVerticalAlignment(draft, options) {
@@ -100,7 +99,7 @@ function handleApplyKeyPreferences(draft, action) {
100
99
  draft.yDomain = preferences.yDomain;
101
100
  draft.originDomain = preferences.originDomain;
102
101
  draft.yDomains = preferences.yDomains;
103
- if (draft.displayerMode !== Constants_1.DISPLAYER_MODE.DM_2D) {
102
+ if (draft.displayerMode !== '2D') {
104
103
  draft.zoom = preferences.zoom;
105
104
  }
106
105
  }