nmrium 1.6.1 → 1.8.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 (488) hide show
  1. package/lib/component/1d/FloatingRanges.js +4 -4
  2. package/lib/component/1d/FloatingRanges.js.map +1 -1
  3. package/lib/component/1d/database/DatabaseSpectrum.js +1 -1
  4. package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
  5. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  6. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js.map +1 -1
  7. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
  8. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -2
  9. package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
  10. package/lib/component/1d/peaks/PeakAnnotations.d.ts.map +1 -1
  11. package/lib/component/1d/peaks/PeakAnnotations.js +2 -2
  12. package/lib/component/1d/peaks/PeakAnnotations.js.map +1 -1
  13. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
  14. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +4 -4
  15. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
  16. package/lib/component/1d/peaks/Peaks.d.ts +4 -1
  17. package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
  18. package/lib/component/1d/peaks/Peaks.js +5 -2
  19. package/lib/component/1d/peaks/Peaks.js.map +1 -1
  20. package/lib/component/1d/ranges/Atoms.d.ts.map +1 -1
  21. package/lib/component/1d/ranges/Atoms.js +24 -9
  22. package/lib/component/1d/ranges/Atoms.js.map +1 -1
  23. package/lib/component/1d/ranges/Range.d.ts.map +1 -1
  24. package/lib/component/1d/ranges/Range.js +3 -3
  25. package/lib/component/1d/ranges/Range.js.map +1 -1
  26. package/lib/component/1d/ranges/RangesIntegrals.d.ts.map +1 -1
  27. package/lib/component/1d/ranges/RangesIntegrals.js +5 -3
  28. package/lib/component/1d/ranges/RangesIntegrals.js.map +1 -1
  29. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -1
  30. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts.map +1 -1
  31. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +32 -41
  32. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
  33. package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.d.ts.map +1 -1
  34. package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.js.map +1 -1
  35. package/lib/component/2d/FooterBanner.js +2 -2
  36. package/lib/component/2d/FooterBanner.js.map +1 -1
  37. package/lib/component/2d/YAxis.d.ts +0 -1
  38. package/lib/component/2d/YAxis.d.ts.map +1 -1
  39. package/lib/component/2d/YAxis.js +11 -4
  40. package/lib/component/2d/YAxis.js.map +1 -1
  41. package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
  42. package/lib/component/2d/useTracesSpectra.js +2 -0
  43. package/lib/component/2d/useTracesSpectra.js.map +1 -1
  44. package/lib/component/2d/utilities/extractSpectrumSignals.d.ts +2 -9
  45. package/lib/component/2d/utilities/extractSpectrumSignals.d.ts.map +1 -1
  46. package/lib/component/2d/utilities/extractSpectrumSignals.js +4 -5
  47. package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
  48. package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
  49. package/lib/component/2d/zones/SignalsGuideLines.js +7 -10
  50. package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
  51. package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts.map +1 -1
  52. package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
  53. package/lib/component/context/DispatchContext.d.ts +2 -2
  54. package/lib/component/context/DispatchContext.d.ts.map +1 -1
  55. package/lib/component/context/LoggerContext.d.ts.map +1 -1
  56. package/lib/component/context/LoggerContext.js +8 -9
  57. package/lib/component/context/LoggerContext.js.map +1 -1
  58. package/lib/component/context/PreferencesContext.d.ts +7 -3
  59. package/lib/component/context/PreferencesContext.d.ts.map +1 -1
  60. package/lib/component/context/PreferencesContext.js +1 -2
  61. package/lib/component/context/PreferencesContext.js.map +1 -1
  62. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  63. package/lib/component/elements/D3Axis.js +1 -1
  64. package/lib/component/elements/D3Axis.js.map +1 -1
  65. package/lib/component/elements/Sections.js +1 -1
  66. package/lib/component/elements/Sections.js.map +1 -1
  67. package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
  68. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -2
  69. package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
  70. package/lib/component/hooks/useExport.d.ts.map +1 -1
  71. package/lib/component/hooks/useExport.js +24 -6
  72. package/lib/component/hooks/useExport.js.map +1 -1
  73. package/lib/component/loader/Spinner.js +1 -1
  74. package/lib/component/loader/Spinner.js.map +1 -1
  75. package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
  76. package/lib/component/loader/useLoadFiles.js +60 -25
  77. package/lib/component/loader/useLoadFiles.js.map +1 -1
  78. package/lib/component/main/InnerNMRium.d.ts.map +1 -1
  79. package/lib/component/main/InnerNMRium.js +4 -2
  80. package/lib/component/main/InnerNMRium.js.map +1 -1
  81. package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
  82. package/lib/component/main/NMRiumStateProvider.js +17 -6
  83. package/lib/component/main/NMRiumStateProvider.js.map +1 -1
  84. package/lib/component/modal/LoadJCAMPModal.d.ts.map +1 -1
  85. package/lib/component/modal/LoadJCAMPModal.js +7 -3
  86. package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
  87. package/lib/component/modal/MoleculeStructureEditorModal.d.ts.map +1 -1
  88. package/lib/component/modal/MoleculeStructureEditorModal.js +7 -3
  89. package/lib/component/modal/MoleculeStructureEditorModal.js.map +1 -1
  90. package/lib/component/modal/MultipletAnalysisModal.js +0 -2
  91. package/lib/component/modal/MultipletAnalysisModal.js.map +1 -1
  92. package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
  93. package/lib/component/modal/SaveAsModal.js +10 -3
  94. package/lib/component/modal/SaveAsModal.js.map +1 -1
  95. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts.map +1 -1
  96. package/lib/component/modal/changeSum/ChangeSumModalContents.js +0 -2
  97. package/lib/component/modal/changeSum/ChangeSumModalContents.js.map +1 -1
  98. package/lib/component/modal/changeSum/SelectMolecule.d.ts.map +1 -1
  99. package/lib/component/modal/changeSum/SelectMolecule.js +0 -2
  100. package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
  101. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +2 -2
  102. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts.map +1 -1
  103. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +1 -2
  104. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js.map +1 -1
  105. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.d.ts.map +1 -1
  106. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +16 -0
  107. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js.map +1 -1
  108. package/lib/component/modal/setting/settingsValidation.js +2 -2
  109. package/lib/component/modal/setting/settingsValidation.js.map +1 -1
  110. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts.map +1 -1
  111. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -1
  112. package/lib/component/panels/IntegralsPanel/IntegralPanel.js.map +1 -1
  113. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  114. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  115. package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -3
  116. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  117. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts +6 -0
  118. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts.map +1 -0
  119. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js +87 -0
  120. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js.map +1 -0
  121. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts.map +1 -1
  122. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +18 -28
  123. package/lib/component/panels/MoleculesPanel/MoleculePanel.js.map +1 -1
  124. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
  125. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +32 -25
  126. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
  127. package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts +13 -0
  128. package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -0
  129. package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +66 -0
  130. package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -0
  131. package/lib/component/panels/MoleculesPanel/{useAtomAssignment.d.ts → hooks/useAtomAssignment.d.ts} +1 -1
  132. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -0
  133. package/lib/component/panels/MoleculesPanel/{useAtomAssignment.js → hooks/useAtomAssignment.js} +50 -19
  134. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -0
  135. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts +12 -0
  136. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts.map +1 -0
  137. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js +58 -0
  138. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js.map +1 -0
  139. package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts +5 -0
  140. package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts.map +1 -0
  141. package/lib/component/panels/MoleculesPanel/utilities/AtomData.js +2 -0
  142. package/lib/component/panels/MoleculesPanel/utilities/AtomData.js.map +1 -0
  143. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts +16 -0
  144. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts.map +1 -0
  145. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js +47 -0
  146. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js.map +1 -0
  147. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts +18 -0
  148. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -0
  149. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +31 -0
  150. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -0
  151. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts +3 -0
  152. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts.map +1 -0
  153. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js +12 -0
  154. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js.map +1 -0
  155. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts +4 -0
  156. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts.map +1 -0
  157. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js +25 -0
  158. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js.map +1 -0
  159. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts +6 -0
  160. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts.map +1 -0
  161. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js +18 -0
  162. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js.map +1 -0
  163. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
  164. package/lib/component/panels/PeaksPanel/PeaksPanel.js +24 -26
  165. package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
  166. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -1
  167. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
  168. package/lib/component/panels/PeaksPanel/PeaksTable.js +3 -2
  169. package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
  170. package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
  171. package/lib/component/panels/RangesPanel/RangesHeader.js +3 -2
  172. package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
  173. package/lib/component/panels/RangesPanel/RangesTable.d.ts +1 -1
  174. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  175. package/lib/component/panels/RangesPanel/RangesTable.js +2 -1
  176. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  177. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  178. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +1 -1
  179. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
  180. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js.map +1 -1
  181. package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
  182. package/lib/component/panels/SpectraPanel/SpectraTable.js +3 -2
  183. package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
  184. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -2
  185. package/lib/component/panels/SummaryPanel/utilities/Utilities.js.map +1 -1
  186. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  187. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js.map +1 -1
  188. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts.map +1 -1
  189. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +0 -4
  190. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js.map +1 -1
  191. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +8 -8
  192. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js.map +1 -1
  193. package/lib/component/panels/ZonesPanel/ZonesPanel.d.ts.map +1 -1
  194. package/lib/component/panels/ZonesPanel/ZonesPanel.js +6 -1
  195. package/lib/component/panels/ZonesPanel/ZonesPanel.js.map +1 -1
  196. package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +8 -9
  197. package/lib/component/panels/ZonesPanel/ZonesTable.d.ts.map +1 -1
  198. package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -2
  199. package/lib/component/panels/ZonesPanel/ZonesTable.js.map +1 -1
  200. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
  201. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +0 -2
  202. package/lib/component/panels/ZonesPanel/ZonesTableRow.js.map +1 -1
  203. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +7 -7
  204. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts.map +1 -1
  205. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +3 -3
  206. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js.map +1 -1
  207. package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
  208. package/lib/component/panels/databasePanel/DatabasePanel.js +13 -10
  209. package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
  210. package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.d.ts.map +1 -1
  211. package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js +0 -2
  212. package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js.map +1 -1
  213. package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts +9 -0
  214. package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts.map +1 -0
  215. package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +27 -0
  216. package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -0
  217. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts.map +1 -1
  218. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +0 -2
  219. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js.map +1 -1
  220. package/lib/component/reducer/IgnoreActions.d.ts.map +1 -1
  221. package/lib/component/reducer/IgnoreActions.js +2 -1
  222. package/lib/component/reducer/IgnoreActions.js.map +1 -1
  223. package/lib/component/reducer/Reducer.d.ts +13 -1
  224. package/lib/component/reducer/Reducer.d.ts.map +1 -1
  225. package/lib/component/reducer/Reducer.js +10 -3
  226. package/lib/component/reducer/Reducer.js.map +1 -1
  227. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  228. package/lib/component/reducer/actions/DatabaseActions.js +2 -1
  229. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  230. package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
  231. package/lib/component/reducer/actions/{LoadActions.d.ts → LoadAction.d.ts} +16 -5
  232. package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -0
  233. package/lib/component/reducer/actions/{LoadActions.js → LoadAction.js} +60 -16
  234. package/lib/component/reducer/actions/LoadAction.js.map +1 -0
  235. package/lib/component/reducer/actions/MoleculeActions.d.ts +22 -6
  236. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  237. package/lib/component/reducer/actions/MoleculeActions.js +43 -29
  238. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  239. package/lib/component/reducer/actions/RangesActions.d.ts +12 -6
  240. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  241. package/lib/component/reducer/actions/RangesActions.js +37 -16
  242. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  243. package/lib/component/reducer/actions/ZonesActions.d.ts +3 -3
  244. package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
  245. package/lib/component/reducer/actions/ZonesActions.js +9 -4
  246. package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
  247. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts +4 -0
  248. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts.map +1 -0
  249. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js +7 -0
  250. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js.map +1 -0
  251. package/lib/component/reducer/preferences/actions/initPreferences.d.ts.map +1 -1
  252. package/lib/component/reducer/preferences/actions/initPreferences.js +1 -2
  253. package/lib/component/reducer/preferences/actions/initPreferences.js.map +1 -1
  254. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
  255. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +2 -1
  256. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
  257. package/lib/component/reducer/preferences/preferencesReducer.d.ts +9 -8
  258. package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
  259. package/lib/component/reducer/preferences/preferencesReducer.js +3 -1
  260. package/lib/component/reducer/preferences/preferencesReducer.js.map +1 -1
  261. package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
  262. package/lib/component/toolbar/ToolTypes.js +1 -0
  263. package/lib/component/toolbar/ToolTypes.js.map +1 -1
  264. package/lib/component/utility/export.d.ts +3 -3
  265. package/lib/component/utility/export.d.ts.map +1 -1
  266. package/lib/component/utility/export.js +13 -21
  267. package/lib/component/utility/export.js.map +1 -1
  268. package/lib/component/utility/getClosePeak.js +1 -1
  269. package/lib/component/utility/getClosePeak.js.map +1 -1
  270. package/lib/component/utility/save_as.d.ts +9 -0
  271. package/lib/component/utility/save_as.d.ts.map +1 -0
  272. package/lib/component/utility/save_as.js +7 -0
  273. package/lib/component/utility/save_as.js.map +1 -0
  274. package/lib/component/workspaces/assignment.d.ts.map +1 -1
  275. package/lib/component/workspaces/assignment.js +7 -0
  276. package/lib/component/workspaces/assignment.js.map +1 -1
  277. package/lib/component/workspaces/basic.d.ts.map +1 -1
  278. package/lib/component/workspaces/basic.js +5 -0
  279. package/lib/component/workspaces/basic.js.map +1 -1
  280. package/lib/component/workspaces/embedded.d.ts.map +1 -1
  281. package/lib/component/workspaces/embedded.js +5 -0
  282. package/lib/component/workspaces/embedded.js.map +1 -1
  283. package/lib/component/workspaces/exercise.d.ts.map +1 -1
  284. package/lib/component/workspaces/exercise.js +5 -0
  285. package/lib/component/workspaces/exercise.js.map +1 -1
  286. package/lib/component/workspaces/prediction.d.ts.map +1 -1
  287. package/lib/component/workspaces/prediction.js +5 -0
  288. package/lib/component/workspaces/prediction.js.map +1 -1
  289. package/lib/component/workspaces/process1D.d.ts.map +1 -1
  290. package/lib/component/workspaces/process1D.js +6 -0
  291. package/lib/component/workspaces/process1D.js.map +1 -1
  292. package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
  293. package/lib/component/workspaces/workspaceDefaultProperties.js +18 -0
  294. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  295. package/lib/data/PredictionManager.d.ts.map +1 -1
  296. package/lib/data/PredictionManager.js +13 -9
  297. package/lib/data/PredictionManager.js.map +1 -1
  298. package/lib/data/SpectraManager.d.ts +45 -4
  299. package/lib/data/SpectraManager.d.ts.map +1 -1
  300. package/lib/data/SpectraManager.js +69 -12
  301. package/lib/data/SpectraManager.js.map +1 -1
  302. package/lib/data/constants/signalsKinds.d.ts +1 -6
  303. package/lib/data/constants/signalsKinds.d.ts.map +1 -1
  304. package/lib/data/constants/signalsKinds.js +2 -17
  305. package/lib/data/constants/signalsKinds.js.map +1 -1
  306. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  307. package/lib/data/data1d/Spectrum1D/generateJGraphData.js.map +1 -1
  308. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -14
  309. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
  310. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +1 -10
  311. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts.map +1 -1
  312. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
  313. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
  314. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
  315. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
  316. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
  317. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
  318. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +5 -1
  319. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
  320. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -1
  321. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +1 -1
  322. package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
  323. package/lib/data/data2d/Spectrum2D/contours.js +1 -1
  324. package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
  325. package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
  326. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +6 -4
  327. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  328. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -2
  329. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  330. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -2
  331. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  332. package/lib/data/molecules/Molecule.d.ts +2 -22
  333. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  334. package/lib/data/molecules/Molecule.js +3 -1
  335. package/lib/data/molecules/Molecule.js.map +1 -1
  336. package/lib/data/molecules/MoleculeManager.d.ts +3 -2
  337. package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
  338. package/lib/data/molecules/MoleculeManager.js +4 -2
  339. package/lib/data/molecules/MoleculeManager.js.map +1 -1
  340. package/lib/data/utilities/RangeUtilities.d.ts +3 -2
  341. package/lib/data/utilities/RangeUtilities.d.ts.map +1 -1
  342. package/lib/data/utilities/RangeUtilities.js +9 -3
  343. package/lib/data/utilities/RangeUtilities.js.map +1 -1
  344. package/lib/data/utilities/ZoneUtilities.d.ts.map +1 -1
  345. package/lib/data/utilities/ZoneUtilities.js +1 -2
  346. package/lib/data/utilities/ZoneUtilities.js.map +1 -1
  347. package/lib/data/utilities/isProton.d.ts +2 -0
  348. package/lib/data/utilities/isProton.d.ts.map +1 -0
  349. package/lib/data/utilities/isProton.js +4 -0
  350. package/lib/data/utilities/isProton.js.map +1 -0
  351. package/lib/versionInfo.js +1 -1
  352. package/package.json +32 -32
  353. package/src/component/1d/FloatingRanges.tsx +5 -5
  354. package/src/component/1d/database/DatabaseSpectrum.tsx +1 -1
  355. package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +1 -1
  356. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +4 -2
  357. package/src/component/1d/peaks/PeakAnnotations.tsx +2 -1
  358. package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +11 -1
  359. package/src/component/1d/peaks/Peaks.tsx +9 -3
  360. package/src/component/1d/ranges/Atoms.tsx +36 -13
  361. package/src/component/1d/ranges/Range.tsx +4 -3
  362. package/src/component/1d/ranges/RangesIntegrals.tsx +6 -2
  363. package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +38 -78
  364. package/src/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.tsx +5 -2
  365. package/src/component/2d/FooterBanner.tsx +2 -2
  366. package/src/component/2d/YAxis.tsx +31 -13
  367. package/src/component/2d/useTracesSpectra.ts +3 -0
  368. package/src/component/2d/utilities/extractSpectrumSignals.ts +6 -16
  369. package/src/component/2d/zones/SignalsGuideLines.tsx +11 -9
  370. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +2 -3
  371. package/src/component/context/DispatchContext.tsx +2 -2
  372. package/src/component/context/LoggerContext.tsx +8 -11
  373. package/src/component/context/PreferencesContext.tsx +8 -5
  374. package/src/component/elements/D3Axis.tsx +1 -2
  375. package/src/component/elements/Sections.tsx +1 -1
  376. package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -2
  377. package/src/component/hooks/useExport.tsx +38 -6
  378. package/src/component/loader/Spinner.tsx +1 -1
  379. package/src/component/loader/useLoadFiles.ts +79 -30
  380. package/src/component/main/InnerNMRium.tsx +6 -2
  381. package/src/component/main/NMRiumStateProvider.tsx +18 -7
  382. package/src/component/modal/LoadJCAMPModal.tsx +10 -5
  383. package/src/component/modal/MoleculeStructureEditorModal.tsx +11 -3
  384. package/src/component/modal/MultipletAnalysisModal.tsx +0 -2
  385. package/src/component/modal/SaveAsModal.tsx +35 -6
  386. package/src/component/modal/changeSum/ChangeSumModalContents.tsx +0 -2
  387. package/src/component/modal/changeSum/SelectMolecule.tsx +0 -2
  388. package/src/component/modal/setting/settings-tabs/DatabasesTabContent.tsx +1 -3
  389. package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +16 -0
  390. package/src/component/modal/setting/settingsValidation.ts +2 -2
  391. package/src/component/panels/IntegralsPanel/IntegralPanel.tsx +2 -6
  392. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -3
  393. package/src/component/panels/MoleculesPanel/MoleculeOptionsPanel.tsx +160 -0
  394. package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +77 -102
  395. package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +54 -35
  396. package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +117 -0
  397. package/src/component/panels/MoleculesPanel/{useAtomAssignment.tsx → hooks/useAtomAssignment.tsx} +71 -30
  398. package/src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts +74 -0
  399. package/src/component/panels/MoleculesPanel/utilities/AtomData.ts +4 -0
  400. package/src/component/panels/MoleculesPanel/utilities/extractFromAtom.ts +63 -0
  401. package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +59 -0
  402. package/src/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.ts +12 -0
  403. package/src/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.ts +36 -0
  404. package/src/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.ts +20 -0
  405. package/src/component/panels/PeaksPanel/PeaksPanel.tsx +25 -35
  406. package/src/component/panels/PeaksPanel/PeaksTable.tsx +3 -2
  407. package/src/component/panels/RangesPanel/RangesHeader.tsx +3 -2
  408. package/src/component/panels/RangesPanel/RangesTable.tsx +10 -8
  409. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +3 -3
  410. package/src/component/panels/RangesPanel/TableColumns/RelativeColumn.tsx +2 -2
  411. package/src/component/panels/SpectraPanel/SpectraTable.tsx +3 -2
  412. package/src/component/panels/SummaryPanel/utilities/Utilities.ts +2 -2
  413. package/src/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.tsx +1 -1
  414. package/src/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.tsx +0 -4
  415. package/src/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.tsx +9 -9
  416. package/src/component/panels/ZonesPanel/ZonesPanel.tsx +15 -5
  417. package/src/component/panels/ZonesPanel/ZonesTable.tsx +9 -10
  418. package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +0 -2
  419. package/src/component/panels/ZonesPanel/hooks/useMapZones.ts +11 -11
  420. package/src/component/panels/databasePanel/DatabasePanel.tsx +18 -14
  421. package/src/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.tsx +0 -2
  422. package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +36 -0
  423. package/src/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.tsx +0 -2
  424. package/src/component/reducer/IgnoreActions.ts +2 -1
  425. package/src/component/reducer/Reducer.ts +28 -4
  426. package/src/component/reducer/actions/DatabaseActions.ts +3 -0
  427. package/src/component/reducer/actions/IntegralsActions.ts +1 -1
  428. package/src/component/reducer/actions/{LoadActions.ts → LoadAction.ts} +87 -25
  429. package/src/component/reducer/actions/MoleculeActions.ts +91 -44
  430. package/src/component/reducer/actions/RangesActions.ts +66 -30
  431. package/src/component/reducer/actions/ZonesActions.ts +18 -10
  432. package/src/component/reducer/preferences/actions/changeDefaultMoleculeSettings.ts +16 -0
  433. package/src/component/reducer/preferences/actions/initPreferences.ts +0 -3
  434. package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +2 -1
  435. package/src/component/reducer/preferences/preferencesReducer.ts +20 -11
  436. package/src/component/toolbar/ToolTypes.ts +1 -0
  437. package/src/component/utility/export.ts +15 -20
  438. package/src/component/utility/getClosePeak.ts +1 -1
  439. package/src/component/utility/save_as.ts +16 -0
  440. package/src/component/workspaces/assignment.ts +7 -0
  441. package/src/component/workspaces/basic.ts +5 -0
  442. package/src/component/workspaces/embedded.ts +5 -0
  443. package/src/component/workspaces/exercise.ts +5 -0
  444. package/src/component/workspaces/prediction.ts +5 -0
  445. package/src/component/workspaces/process1D.ts +6 -0
  446. package/src/component/workspaces/workspaceDefaultProperties.ts +18 -0
  447. package/src/data/PredictionManager.ts +21 -14
  448. package/src/data/SpectraManager.ts +90 -19
  449. package/src/data/constants/signalsKinds.ts +5 -20
  450. package/src/data/data1d/Spectrum1D/generateJGraphData.ts +1 -1
  451. package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +16 -16
  452. package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +1 -0
  453. package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +7 -4
  454. package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +8 -1
  455. package/src/data/data1d/Spectrum1D/ranges/detectSignals.ts +1 -1
  456. package/src/data/data2d/Spectrum2D/contours.ts +2 -3
  457. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +6 -7
  458. package/src/data/molecules/Molecule.ts +9 -23
  459. package/src/data/molecules/MoleculeManager.ts +10 -8
  460. package/src/data/utilities/RangeUtilities.ts +12 -4
  461. package/src/data/utilities/ZoneUtilities.ts +1 -3
  462. package/src/data/utilities/isProton.ts +3 -0
  463. package/src/index.tsx +0 -3
  464. package/src/versionInfo.ts +1 -1
  465. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +0 -43
  466. package/lib/component/panels/MoleculesPanel/Utilities.d.ts.map +0 -1
  467. package/lib/component/panels/MoleculesPanel/Utilities.js +0 -126
  468. package/lib/component/panels/MoleculesPanel/Utilities.js.map +0 -1
  469. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts.map +0 -1
  470. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js.map +0 -1
  471. package/lib/component/reducer/actions/LoadActions.d.ts.map +0 -1
  472. package/lib/component/reducer/actions/LoadActions.js.map +0 -1
  473. package/lib/component/utility/isHomoNuclear.d.ts +0 -2
  474. package/lib/component/utility/isHomoNuclear.d.ts.map +0 -1
  475. package/lib/component/utility/isHomoNuclear.js +0 -11
  476. package/lib/component/utility/isHomoNuclear.js.map +0 -1
  477. package/lib/data/types/common/SignalKind.d.ts +0 -2
  478. package/lib/data/types/common/SignalKind.d.ts.map +0 -1
  479. package/lib/data/types/common/SignalKind.js +0 -2
  480. package/lib/data/types/common/SignalKind.js.map +0 -1
  481. package/lib/utils/stringCapitalize.d.ts +0 -2
  482. package/lib/utils/stringCapitalize.d.ts.map +0 -1
  483. package/lib/utils/stringCapitalize.js +0 -4
  484. package/lib/utils/stringCapitalize.js.map +0 -1
  485. package/src/component/panels/MoleculesPanel/Utilities.ts +0 -186
  486. package/src/component/utility/isHomoNuclear.ts +0 -11
  487. package/src/data/types/common/SignalKind.ts +0 -10
  488. package/src/utils/stringCapitalize.ts +0 -3
@@ -56,7 +56,7 @@ export default function FooterBanner(props: FooterBannerProps) {
56
56
  const [formatX, formatY] = useFormatNumberByNucleus(nuclei);
57
57
 
58
58
  const scaleX = useMemo(() => {
59
- if (!data1D || data1D.length === 0) {
59
+ if (data1D.length === 0) {
60
60
  return get2DXScale({ width, margin, xDomain, mode });
61
61
  }
62
62
  if (selectedTool !== options.slicing.id) {
@@ -86,7 +86,7 @@ export default function FooterBanner(props: FooterBannerProps) {
86
86
  ]);
87
87
 
88
88
  const scaleY = useMemo(() => {
89
- if (!data1D || data1D.length === 0) {
89
+ if (data1D.length === 0) {
90
90
  return get2DYScale({ height, margin, yDomain });
91
91
  }
92
92
  if (selectedTool !== options.slicing.id) {
@@ -3,13 +3,14 @@ import { useLinearPrimaryTicks } from 'react-d3-utils';
3
3
 
4
4
  import { useChartData } from '../context/ChartContext.js';
5
5
  import { D3Axis } from '../elements/D3Axis.js';
6
+ import { useActiveNucleusTab } from '../hooks/useActiveNucleusTab.ts';
7
+ import { useTextMetrics } from '../hooks/useTextMetrics.ts';
6
8
 
7
9
  import { useScale2DY } from './utilities/scale.js';
8
10
 
9
11
  const defaultMargin = { right: 50, top: 0, bottom: 0, left: 0 };
10
12
 
11
13
  interface YAxisProps {
12
- label?: string;
13
14
  margin?: {
14
15
  right: number;
15
16
  top: number;
@@ -19,9 +20,13 @@ interface YAxisProps {
19
20
  }
20
21
 
21
22
  function YAxis(props: YAxisProps) {
22
- const { label = '', margin: marginProps = defaultMargin } = props;
23
+ const { margin: marginProps = defaultMargin } = props;
24
+
25
+ const { width, height, margin } = useChartData();
26
+ const nucleusStr = useActiveNucleusTab();
27
+ const [, unit] = nucleusStr.split(',');
28
+ const { getTextWidth } = useTextMetrics(10);
23
29
 
24
- const { width, height } = useChartData();
25
30
  const scaleY = useScale2DY();
26
31
 
27
32
  const refAxis = useRef<SVGGElement>(null);
@@ -36,6 +41,9 @@ function YAxis(props: YAxisProps) {
36
41
  return null;
37
42
  }
38
43
 
44
+ const label = /^[0-9]+[A-Z][a-z]?$/.test(unit) ? 'δ [ppm]' : unit;
45
+ const labelHeight = getTextWidth(label);
46
+
39
47
  return (
40
48
  <D3Axis
41
49
  ref={refAxis}
@@ -44,16 +52,26 @@ function YAxis(props: YAxisProps) {
44
52
  axisPosition="right"
45
53
  ticks={ticks}
46
54
  >
47
- <text
48
- fill="#000"
49
- x={-marginProps.top}
50
- y={-(marginProps.right - 5)}
51
- dy="0.71em"
52
- transform="rotate(-90)"
53
- textAnchor="end"
54
- >
55
- {label}
56
- </text>
55
+ <g transform={`translate(${marginProps.right - 20}, ${margin.top})`}>
56
+ <rect
57
+ fill="white"
58
+ rx={5}
59
+ ry={5}
60
+ width={20}
61
+ height={labelHeight + 10}
62
+ x={-10}
63
+ y={-5}
64
+ opacity={0.8}
65
+ />
66
+ <text
67
+ fill="#000"
68
+ transform="rotate(-90)"
69
+ dominantBaseline="middle"
70
+ textAnchor="end"
71
+ >
72
+ {label}
73
+ </text>
74
+ </g>
57
75
  </D3Axis>
58
76
  );
59
77
  }
@@ -44,6 +44,9 @@ export function useTracesSpectra() {
44
44
 
45
45
  return useMemo(() => {
46
46
  const nuclei = activeTab.split(',');
47
+
48
+ if (nuclei.length !== 2) return [];
49
+
47
50
  return getTracesSpectra({ nuclei, spectra, activeSpectra });
48
51
  }, [activeTab, spectra, activeSpectra]);
49
52
  }
@@ -1,17 +1,8 @@
1
- import type { Range } from '@zakodium/nmr-types';
1
+ import type { Range, Signal1D } from '@zakodium/nmr-types';
2
2
  import type { Spectrum1D } from '@zakodium/nmrium-core';
3
+ import { signalKindsToInclude } from 'nmr-processing';
3
4
 
4
- import { SIGNAL_INCLUDED_KINDS } from '../../../data/constants/signalsKinds.js';
5
-
6
- export interface BaseSignal {
7
- nbAtoms?: number;
8
- diaIDs?: string[];
9
- assignment?: string;
10
- delta: number;
11
- id: string;
12
- }
13
-
14
- export type ExtractedSignal<T> = BaseSignal & T;
5
+ export type ExtractedSignal<T> = Signal1D & T;
15
6
 
16
7
  interface ExtractSpectrumSignalsOptions<T> {
17
8
  from?: number;
@@ -48,12 +39,11 @@ export function extractSpectrumSignals<T extends object = object>(
48
39
  const { assignment, signals = [] } = range;
49
40
  let index = 0;
50
41
  for (const signal of signals) {
51
- const { id, delta, kind } = signal;
52
- if (SIGNAL_INCLUDED_KINDS.includes(kind as string)) {
42
+ const { kind } = signal;
43
+ if (kind && signalKindsToInclude.has(kind)) {
53
44
  result.push({
45
+ ...signal,
54
46
  assignment: index === 0 ? assignment : '',
55
- delta,
56
- id,
57
47
  ...include?.(range),
58
48
  } as ExtractedSignal<T>);
59
49
  index++;
@@ -21,11 +21,9 @@ import {
21
21
  import type { ActionsButtonsPopoverProps } from '../../elements/ActionsButtonsPopover.js';
22
22
  import { ActionsButtonsPopover } from '../../elements/ActionsButtonsPopover.js';
23
23
  import { useHighlight } from '../../highlight/index.js';
24
- import { useActiveNucleusTab } from '../../hooks/useActiveNucleusTab.ts';
25
24
  import { useHighlightColor } from '../../hooks/useHighlightColor.ts';
26
25
  import { useTextMetrics } from '../../hooks/useTextMetrics.ts';
27
26
  import { useTriggerNewAssignmentLabel } from '../../hooks/useTriggerNewAssignmentLabel.js';
28
- import { isHomoNuclear } from '../../utility/isHomoNuclear.ts';
29
27
  import { stackOverlappingLabelsArray } from '../../utility/stackOverlappingLabels.js';
30
28
  import { useTracesSpectra } from '../useTracesSpectra.js';
31
29
  import type { ExtractedSignal } from '../utilities/extractSpectrumSignals.js';
@@ -138,6 +136,7 @@ interface IndicationLineProps extends ExtraExtractProperties {
138
136
  axis: IndicationLinesAxis;
139
137
  diaIDs?: string[];
140
138
  nbAtoms?: number;
139
+ id: string;
141
140
  }
142
141
 
143
142
  interface GetAxisRangeIdOptions {
@@ -154,6 +153,7 @@ interface UseRangeAssignmentOptions {
154
153
  rangeId: string;
155
154
  signalsIds: string[];
156
155
  spectrumId: string;
156
+ signalId: string;
157
157
  }
158
158
 
159
159
  function useRangeAssignment(options: UseRangeAssignmentOptions) {
@@ -169,10 +169,11 @@ function useRangeAssignment(options: UseRangeAssignmentOptions) {
169
169
  type: 'RANGE',
170
170
  extra: { id: rangeId, spectrumID: spectrumId },
171
171
  });
172
+
172
173
  return { highlightContext, assignmentContext };
173
174
  }
174
175
 
175
- function isSignalAssigned(
176
+ function isRangeSignalAssigned(
176
177
  options: Pick<IndicationLineProps, 'range' | 'nbAtoms' | 'diaIDs'>,
177
178
  ) {
178
179
  const { range, ...otherProps } = options;
@@ -194,23 +195,24 @@ function IndicationLine(props: IndicationLineProps) {
194
195
  range,
195
196
  diaIDs,
196
197
  nbAtoms,
198
+ id: signalId,
197
199
  } = props;
198
200
  const { id: rangeId, diaIDs: rangeDiaIDs = [], signals } = range;
199
201
  const highlightColor = useHighlightColor();
200
- const isAssigned = isSignalAssigned({ range, diaIDs, nbAtoms });
202
+ const isSignalAssigned = isRangeSignalAssigned({ range, diaIDs, nbAtoms });
201
203
 
202
204
  const signalsIds = signals.map(({ id }) => id);
203
205
  const { margin, width, height } = useChartData();
204
206
  const { setData: addNewAssignmentLabel } = useShareData();
205
- const nuclei = useActiveNucleusTab();
206
- const isHomoNuclei = isHomoNuclear(nuclei);
207
207
 
208
208
  const dispatch = useDispatch();
209
209
  const { assignmentContext, highlightContext } = useRangeAssignment({
210
210
  rangeId,
211
211
  spectrumId,
212
212
  signalsIds,
213
+ signalId,
213
214
  });
215
+
214
216
  const hasDiaIDs = rangeDiaIDs.length > 0;
215
217
  const isAssignmentActive = assignmentContext.isActive;
216
218
  const isHighlighted = highlightContext.isActive || isAssignmentActive;
@@ -245,7 +247,7 @@ function IndicationLine(props: IndicationLineProps) {
245
247
  }
246
248
 
247
249
  function mouseEnterHandler() {
248
- assignmentContext.highlight(isHomoNuclei ? 'x' : axis);
250
+ assignmentContext.highlight('x');
249
251
  highlightContext.show();
250
252
  }
251
253
 
@@ -256,7 +258,7 @@ function IndicationLine(props: IndicationLineProps) {
256
258
 
257
259
  function assignHandler() {
258
260
  isAssignBtnTrigged.current = true;
259
- assignmentContext.activate(isHomoNuclei ? 'x' : axis);
261
+ assignmentContext.activate(axis);
260
262
  }
261
263
 
262
264
  function unAssignHandler() {
@@ -318,7 +320,7 @@ function IndicationLine(props: IndicationLineProps) {
318
320
  onMouseLeave={mouseLeaveHandler}
319
321
  >
320
322
  <line
321
- stroke={isAssigned ? highlightColor : 'lightgrey'}
323
+ stroke={isSignalAssigned ? highlightColor : 'lightgrey'}
322
324
  x1={0}
323
325
  x2={x2}
324
326
  y1={0}
@@ -1,5 +1,5 @@
1
1
  import styled from '@emotion/styled';
2
- import type { Zone, Zones as ZonesType } from '@zakodium/nmr-types';
2
+ import type { Signal1D, Zone, Zones as ZonesType } from '@zakodium/nmr-types';
3
3
  import type { Spectrum2D } from '@zakodium/nmrium-core';
4
4
  import { useEffect, useLayoutEffect, useRef, useState } from 'react';
5
5
  import { PiTextTSlash } from 'react-icons/pi';
@@ -18,7 +18,6 @@ import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZo
18
18
  import useSpectrum from '../../hooks/useSpectrum.js';
19
19
  import type { GetTracesSpectraOptions } from '../useTracesSpectra.js';
20
20
  import { getTracesSpectra } from '../useTracesSpectra.js';
21
- import type { BaseSignal } from '../utilities/extractSpectrumSignals.js';
22
21
  import { extractSpectrumSignals } from '../utilities/extractSpectrumSignals.js';
23
22
  import { useScale2DX, useScale2DY } from '../utilities/scale.js';
24
23
 
@@ -232,7 +231,7 @@ interface GetDefaultAssignmentOptions extends GetTracesSpectraOptions {
232
231
  zone: Zone;
233
232
  }
234
233
 
235
- function findClosestAssignment(signals: BaseSignal[], target: number) {
234
+ function findClosestAssignment(signals: Signal1D[], target: number) {
236
235
  if (signals.length === 0) return '';
237
236
  let closest = signals[0];
238
237
  let minDiff = Math.abs(closest.delta - target);
@@ -8,7 +8,7 @@ import type { DomainActions } from '../reducer/actions/DomainActions.js';
8
8
  import type { FiltersActions } from '../reducer/actions/FiltersActions.js';
9
9
  import type { InsetsActions } from '../reducer/actions/InsetActions.js';
10
10
  import type { IntegralsActions } from '../reducer/actions/IntegralsActions.js';
11
- import type { LoadActions } from '../reducer/actions/LoadActions.js';
11
+ import type { LoadAction } from '../reducer/actions/LoadAction.js';
12
12
  import type { MoleculeActions } from '../reducer/actions/MoleculeActions.js';
13
13
  import type { PeaksActions } from '../reducer/actions/PeaksActions.js';
14
14
  import type { PreferencesActions } from '../reducer/actions/PreferencesActions.js';
@@ -21,7 +21,7 @@ import type { ActionType } from '../reducer/types/ActionType.js';
21
21
  export type Action =
22
22
  | ToolsActions
23
23
  | SpectrumActions
24
- | LoadActions
24
+ | LoadAction
25
25
  | IntegralsActions
26
26
  | RangesActions
27
27
  | DatabaseActions
@@ -55,8 +55,7 @@ export function LoggerProvider({ children }: LoggerProviderProps) {
55
55
  const [logsHistory, setLogsHistory] = useState<LogEntry[]>([]);
56
56
  const [isLogHistoryOpened, openLogHistory] = useState(false);
57
57
  const popupLoggingLevelRef = useRef<LogEntry['levelLabel']>();
58
-
59
- const loggerRef = useRef<FifoLogger>(new FifoLogger());
58
+ const [logger] = useState(() => new FifoLogger());
60
59
 
61
60
  useEffect(() => {
62
61
  function handleLogger({ detail: { logs } }: ChangeEvent) {
@@ -74,20 +73,18 @@ export function LoggerProvider({ children }: LoggerProviderProps) {
74
73
  }
75
74
  setLogsHistory(logs.slice());
76
75
  }
77
- const loggerInstance = loggerRef.current;
78
-
79
- loggerInstance.addEventListener('change', handleLogger);
80
76
 
77
+ logger.addEventListener('change', handleLogger);
81
78
  return () => {
82
- loggerInstance.removeEventListener('change', handleLogger);
79
+ logger.removeEventListener('change', handleLogger);
83
80
  };
84
- }, []);
81
+ }, [logger]);
85
82
 
86
83
  useEffect(() => {
87
84
  if (loggingLevel) {
88
- loggerRef.current.setLevel(loggingLevel);
85
+ logger.setLevel(loggingLevel);
89
86
  }
90
- }, [loggingLevel]);
87
+ }, [logger, loggingLevel]);
91
88
 
92
89
  const markAsRead = useCallback(() => {
93
90
  if (logsHistory.length > 0) {
@@ -98,12 +95,12 @@ export function LoggerProvider({ children }: LoggerProviderProps) {
98
95
 
99
96
  const loggerState = useMemo(() => {
100
97
  return {
101
- logger: loggerRef.current,
98
+ logger,
102
99
  logsHistory,
103
100
  markAsRead,
104
101
  lastReadLogId,
105
102
  };
106
- }, [lastReadLogId, logsHistory, markAsRead]);
103
+ }, [logger, lastReadLogId, logsHistory, markAsRead]);
107
104
 
108
105
  useEffect(() => {
109
106
  popupLoggingLevelRef.current = popupLoggingLevel;
@@ -1,20 +1,23 @@
1
+ import type { Dispatch } from 'react';
1
2
  import { createContext, useContext, useMemo } from 'react';
2
3
 
3
4
  import type {
5
+ PreferencesActions,
4
6
  PreferencesState,
5
7
  WorkspaceWithSource,
6
8
  } from '../reducer/preferences/preferencesReducer.js';
7
- import { preferencesInitialState } from '../reducer/preferences/preferencesReducer.js';
8
9
  import { isReadOnlyWorkspace } from '../reducer/preferences/utilities/isReadOnlyWorkspace.js';
9
10
 
10
- interface PreferencesContextData extends PreferencesState {
11
+ export interface PreferencesStateContext extends PreferencesState {
12
+ dispatch: Dispatch<PreferencesActions>;
13
+ }
14
+
15
+ interface PreferencesContextData extends PreferencesStateContext {
11
16
  isCurrentWorkspaceReadOnly: boolean;
12
17
  current: WorkspaceWithSource;
13
18
  }
14
19
 
15
- const PreferencesContext = createContext<PreferencesState>(
16
- preferencesInitialState,
17
- );
20
+ const PreferencesContext = createContext<PreferencesStateContext | null>(null);
18
21
  export const PreferencesProvider = PreferencesContext.Provider;
19
22
 
20
23
  export function usePreferences(): PreferencesContextData {
@@ -181,8 +181,6 @@ export const D3Axis = forwardRef<SVGGElement | null, D3AxisProps>(
181
181
  {...otherProps}
182
182
  >
183
183
  <g className="axis">
184
- {children}
185
-
186
184
  <BaseLine
187
185
  axisPosition={axisPosition}
188
186
  scale={scale}
@@ -194,6 +192,7 @@ export const D3Axis = forwardRef<SVGGElement | null, D3AxisProps>(
194
192
  scale={scale}
195
193
  tickLength={tickLength}
196
194
  />
195
+ {children}
197
196
  </g>
198
197
  {showGrid && (
199
198
  <g className="grid">
@@ -385,7 +385,7 @@ function SectionItem(props: SectionItemProps) {
385
385
  <div
386
386
  style={{
387
387
  position: 'relative',
388
- opacity: state && state.type === 'dragging' ? 0.3 : 1,
388
+ opacity: state.type === 'dragging' ? 0.3 : 1,
389
389
  }}
390
390
  ref={wrapperRef}
391
391
  >
@@ -1,19 +1,19 @@
1
1
  import type { RangesViewState } from '@zakodium/nmrium-core';
2
2
 
3
+ import { isProton } from '../../data/utilities/isProton.ts';
3
4
  import { useInsetOptions } from '../1d/inset/InsetProvider.js';
4
5
  import { useChartData } from '../context/ChartContext.js';
5
6
 
6
7
  import { useActiveSpectrum } from './useActiveSpectrum.js';
7
8
 
8
9
  export function getDefaultRangesViewState(nucleus: string): RangesViewState {
9
- const isProton = nucleus === '1H';
10
10
  const isCarbon = nucleus === '13C';
11
11
 
12
12
  return {
13
13
  showPeaks: isCarbon,
14
14
  showMultiplicityTrees: false,
15
15
  showIntegrals: false,
16
- showIntegralsValues: isProton,
16
+ showIntegralsValues: isProton(nucleus),
17
17
  showJGraph: false,
18
18
  displayingMode: 'spread',
19
19
  integralsScaleRatio: 1,
@@ -9,10 +9,11 @@ import { useToaster } from '../context/ToasterContext.js';
9
9
  import {
10
10
  browserNotSupportedErrorToast,
11
11
  copyPNGToClipboard,
12
- exportAsJSON,
12
+ exportAsJsonBlob,
13
13
  exportAsPng,
14
14
  exportAsSVG,
15
15
  } from '../utility/export.js';
16
+ import { saveAs } from '../utility/save_as.ts';
16
17
 
17
18
  interface SaveOptions {
18
19
  include: ExportOptions;
@@ -34,13 +35,19 @@ export function useExport() {
34
35
  });
35
36
  setTimeout(async () => {
36
37
  try {
37
- const fileName = state.data[0]?.info?.name;
38
+ const name = state.data[0]?.info?.name || 'experiment';
38
39
  const exportedData = toJSON(core, state, preferencesState, {
39
40
  exportTarget: 'nmrium',
40
41
  view: true,
41
42
  });
42
43
 
43
- await exportAsJSON(exportedData, fileName, spaceIndent, isCompressed);
44
+ const blob = await exportAsJsonBlob(
45
+ exportedData,
46
+ name,
47
+ spaceIndent,
48
+ isCompressed,
49
+ );
50
+ saveAs({ blob, name, extension: '.nmrium' });
44
51
  } catch (error) {
45
52
  toaster.show({
46
53
  intent: 'danger',
@@ -58,7 +65,11 @@ export function useExport() {
58
65
  const saveHandler = useCallback(
59
66
  (options: SaveOptions) => {
60
67
  async function handler() {
61
- const { name, pretty, compressed, include } = options;
68
+ const { pretty, compressed, include } = options;
69
+ const name = options.name || 'experiment';
70
+ const exportArchive =
71
+ include.dataType?.startsWith('SELF_CONTAINED') ?? false;
72
+
62
73
  const hideLoading = toaster.showLoading({
63
74
  message: `Exporting as ${name}.nmrium process in progress`,
64
75
  });
@@ -68,8 +79,29 @@ export function useExport() {
68
79
  ...include,
69
80
  exportTarget: 'nmrium',
70
81
  });
71
- const spaceIndent = pretty ? 2 : 0;
72
- await exportAsJSON(exportedData, name, spaceIndent, compressed);
82
+ const spaceIndent = pretty || exportArchive ? 2 : 0;
83
+ const blob = await exportAsJsonBlob(
84
+ exportedData,
85
+ name,
86
+ spaceIndent,
87
+ compressed && !exportArchive,
88
+ );
89
+
90
+ if (!exportArchive) {
91
+ return saveAs({ blob, name, extension: '.nmrium' });
92
+ }
93
+
94
+ const archive = await core.serializeNmriumArchive({
95
+ molecules: state.molecules,
96
+ spectra: state.data,
97
+ aggregator: state.aggregator,
98
+ includeData: options.include.dataType === 'SELF_CONTAINED',
99
+ serializedState: blob,
100
+ });
101
+ const zipBlob = new Blob([archive], {
102
+ type: 'application/nmrium+zip',
103
+ });
104
+ saveAs({ blob: zipBlob, name, extension: '.nmrium.zip' });
73
105
  } catch (error) {
74
106
  toaster.show({
75
107
  intent: 'danger',
@@ -33,7 +33,7 @@ function Spinner({ isLoading = true, emptyText = undefined }: SpinnerProps) {
33
33
  <Fragment>
34
34
  {isLoading && getSpinner()}
35
35
  {checkEmpty && !isLoading && (
36
- <NoData isEmpty={data && data.length === 0} emptyText={emptyText} />
36
+ <NoData isEmpty={data.length === 0} emptyText={emptyText} />
37
37
  )}
38
38
  </Fragment>
39
39
  );
@@ -1,3 +1,4 @@
1
+ import type { NmriumState, ParsingOptions } from '@zakodium/nmrium-core';
1
2
  import { FileCollection } from 'file-collection';
2
3
  import type { ParseResult } from 'papaparse';
3
4
  import { useCallback } from 'react';
@@ -12,9 +13,9 @@ import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature.js
12
13
 
13
14
  export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
14
15
  const dispatch = useDispatch();
15
- const { dispatch: dispatchPreferences, current: workspacePreferences } =
16
- usePreferences();
17
16
  const preferences = usePreferences();
17
+ const { dispatch: dispatchPreferences, current: workspacePreferences } =
18
+ preferences;
18
19
  const toaster = useToaster();
19
20
  const { logger } = useLogger();
20
21
  const experimentalFeatures = useCheckExperimentalFeature();
@@ -31,48 +32,96 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
31
32
  isMetaFile(files[0])
32
33
  ) {
33
34
  onOpenMetaInformation(files[0]);
35
+ return;
36
+ }
37
+
38
+ const nmriumArchiveFiles: File[] = [];
39
+ const otherFiles: File[] = [];
40
+ let nmriumState: Partial<NmriumState>;
41
+ let containsNmrium: boolean;
42
+ let parseMetaFileResult: ParseResult<any> | null = null;
43
+ const { onLoadProcessing, spectraColors, defaultMoleculeSettings } =
44
+ workspacePreferences;
45
+ const { nmrLoaders: selector } = preferences.current;
46
+
47
+ const parsingOptions: Partial<ParsingOptions> = {
48
+ selector,
49
+ logger: logger.child({ context: 'nmr-processing' }),
50
+ onLoadProcessing,
51
+ experimentalFeatures,
52
+ };
53
+
54
+ let aggregator: FileCollection | undefined;
55
+ let fileCollection: FileCollection | undefined;
56
+ let selectorRoot: string | undefined;
57
+ let resetSourceObject = false;
58
+
59
+ if (files.length === 1 && files[0].name.endsWith('.nmrium.zip')) {
60
+ const [state, ium] = await core.readNMRiumArchive(
61
+ files[0].stream(),
62
+ parsingOptions,
63
+ );
64
+ nmriumState = state;
65
+ containsNmrium = true;
66
+ aggregator = ium;
34
67
  } else {
35
- const fileCollection = await new FileCollection().appendFileList(
36
- files,
68
+ for (const file of files) {
69
+ if (file.name.endsWith('.nmrium.zip')) {
70
+ nmriumArchiveFiles.push(file);
71
+ } else {
72
+ otherFiles.push(file);
73
+ }
74
+ }
75
+
76
+ if (nmriumArchiveFiles.length > 0) {
77
+ await Promise.all(
78
+ nmriumArchiveFiles.map((file) => loadFiles([file])),
79
+ );
80
+ }
81
+
82
+ fileCollection = await new FileCollection().appendFileList(
83
+ otherFiles,
37
84
  );
85
+
38
86
  const metaFile = Object.values(fileCollection.files).find((file) =>
39
87
  isMetaFile(file),
40
88
  );
41
- let parseMetaFileResult: ParseResult<any> | null = null;
89
+
42
90
  if (metaFile) {
43
91
  parseMetaFileResult = await parseMetaFile(metaFile);
44
92
  }
45
- const { nmrLoaders: sourceSelector } = preferences.current;
46
- const { onLoadProcessing, spectraColors } = workspacePreferences;
47
- const { nmriumState, containsNmrium } = await core.read(
93
+ ({ nmriumState, containsNmrium, selectorRoot } = await core.read(
48
94
  fileCollection,
49
- {
50
- sourceSelector,
51
- logger: logger.child({ context: 'nmr-processing' }),
52
- onLoadProcessing,
53
- experimentalFeatures,
54
- },
55
- );
56
-
57
- if (nmriumState.settings) {
58
- dispatchPreferences({
59
- type: 'SET_WORKSPACE',
60
- payload: {
61
- data: nmriumState.settings,
62
- workspaceSource: 'nmriumFile',
63
- },
64
- });
95
+ parsingOptions,
96
+ ));
97
+ if (containsNmrium) {
98
+ resetSourceObject = true;
65
99
  }
66
- dispatch({
67
- type: 'LOAD_DROP_FILES',
100
+ }
101
+
102
+ if (nmriumState.settings) {
103
+ dispatchPreferences({
104
+ type: 'SET_WORKSPACE',
68
105
  payload: {
69
- nmriumState,
70
- containsNmrium,
71
- parseMetaFileResult,
72
- spectraColors,
106
+ data: nmriumState.settings,
107
+ workspaceSource: 'nmriumFile',
73
108
  },
74
109
  });
75
110
  }
111
+ dispatch({
112
+ type: 'LOAD_DROP_FILES',
113
+ payload: {
114
+ nmriumState,
115
+ containsNmrium,
116
+ parseMetaFileResult,
117
+ spectraColors,
118
+ aggregator,
119
+ fileCollection,
120
+ selectorRoot,
121
+ resetSourceObject,
122
+ defaultMoleculeSettings,
123
+ },
124
+ });
76
125
  }
77
126
 
78
127
  loadFiles(files)