nmrium 1.6.1 → 1.7.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 (378) 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/Range.d.ts.map +1 -1
  21. package/lib/component/1d/ranges/Range.js +3 -3
  22. package/lib/component/1d/ranges/Range.js.map +1 -1
  23. package/lib/component/1d/ranges/RangesIntegrals.d.ts.map +1 -1
  24. package/lib/component/1d/ranges/RangesIntegrals.js +5 -3
  25. package/lib/component/1d/ranges/RangesIntegrals.js.map +1 -1
  26. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +1 -0
  27. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
  28. package/lib/component/2d/FooterBanner.js +2 -2
  29. package/lib/component/2d/FooterBanner.js.map +1 -1
  30. package/lib/component/2d/YAxis.d.ts +0 -1
  31. package/lib/component/2d/YAxis.d.ts.map +1 -1
  32. package/lib/component/2d/YAxis.js +11 -4
  33. package/lib/component/2d/YAxis.js.map +1 -1
  34. package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
  35. package/lib/component/2d/useTracesSpectra.js +2 -0
  36. package/lib/component/2d/useTracesSpectra.js.map +1 -1
  37. package/lib/component/2d/utilities/extractSpectrumSignals.d.ts +2 -9
  38. package/lib/component/2d/utilities/extractSpectrumSignals.d.ts.map +1 -1
  39. package/lib/component/2d/utilities/extractSpectrumSignals.js +4 -5
  40. package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
  41. package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
  42. package/lib/component/2d/zones/SignalsGuideLines.js +7 -10
  43. package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
  44. package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts.map +1 -1
  45. package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
  46. package/lib/component/context/DispatchContext.d.ts +2 -2
  47. package/lib/component/context/DispatchContext.d.ts.map +1 -1
  48. package/lib/component/context/LoggerContext.d.ts.map +1 -1
  49. package/lib/component/context/LoggerContext.js +8 -9
  50. package/lib/component/context/LoggerContext.js.map +1 -1
  51. package/lib/component/context/PreferencesContext.d.ts +7 -3
  52. package/lib/component/context/PreferencesContext.d.ts.map +1 -1
  53. package/lib/component/context/PreferencesContext.js +1 -2
  54. package/lib/component/context/PreferencesContext.js.map +1 -1
  55. package/lib/component/elements/D3Axis.d.ts.map +1 -1
  56. package/lib/component/elements/D3Axis.js +1 -1
  57. package/lib/component/elements/D3Axis.js.map +1 -1
  58. package/lib/component/elements/Sections.js +1 -1
  59. package/lib/component/elements/Sections.js.map +1 -1
  60. package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
  61. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -2
  62. package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
  63. package/lib/component/hooks/useExport.d.ts.map +1 -1
  64. package/lib/component/hooks/useExport.js +24 -6
  65. package/lib/component/hooks/useExport.js.map +1 -1
  66. package/lib/component/loader/Spinner.js +1 -1
  67. package/lib/component/loader/Spinner.js.map +1 -1
  68. package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
  69. package/lib/component/loader/useLoadFiles.js +51 -26
  70. package/lib/component/loader/useLoadFiles.js.map +1 -1
  71. package/lib/component/main/InnerNMRium.d.ts.map +1 -1
  72. package/lib/component/main/InnerNMRium.js +4 -2
  73. package/lib/component/main/InnerNMRium.js.map +1 -1
  74. package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
  75. package/lib/component/main/NMRiumStateProvider.js +18 -6
  76. package/lib/component/main/NMRiumStateProvider.js.map +1 -1
  77. package/lib/component/modal/LoadJCAMPModal.d.ts.map +1 -1
  78. package/lib/component/modal/LoadJCAMPModal.js +2 -3
  79. package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
  80. package/lib/component/modal/MoleculeStructureEditorModal.d.ts.map +1 -1
  81. package/lib/component/modal/MoleculeStructureEditorModal.js.map +1 -1
  82. package/lib/component/modal/MultipletAnalysisModal.js +0 -2
  83. package/lib/component/modal/MultipletAnalysisModal.js.map +1 -1
  84. package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
  85. package/lib/component/modal/SaveAsModal.js +6 -3
  86. package/lib/component/modal/SaveAsModal.js.map +1 -1
  87. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts.map +1 -1
  88. package/lib/component/modal/changeSum/ChangeSumModalContents.js +0 -2
  89. package/lib/component/modal/changeSum/ChangeSumModalContents.js.map +1 -1
  90. package/lib/component/modal/changeSum/SelectMolecule.d.ts.map +1 -1
  91. package/lib/component/modal/changeSum/SelectMolecule.js +0 -2
  92. package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
  93. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +2 -2
  94. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts.map +1 -1
  95. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +1 -2
  96. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js.map +1 -1
  97. package/lib/component/modal/setting/settingsValidation.js +2 -2
  98. package/lib/component/modal/setting/settingsValidation.js.map +1 -1
  99. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts.map +1 -1
  100. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -1
  101. package/lib/component/panels/IntegralsPanel/IntegralPanel.js.map +1 -1
  102. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
  103. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  104. package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -3
  105. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  106. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts.map +1 -1
  107. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -3
  108. package/lib/component/panels/MoleculesPanel/MoleculePanel.js.map +1 -1
  109. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
  110. package/lib/component/panels/MoleculesPanel/Utilities.d.ts.map +1 -1
  111. package/lib/component/panels/MoleculesPanel/Utilities.js +6 -3
  112. package/lib/component/panels/MoleculesPanel/Utilities.js.map +1 -1
  113. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts.map +1 -1
  114. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +20 -5
  115. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js.map +1 -1
  116. package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
  117. package/lib/component/panels/PeaksPanel/PeaksPanel.js +24 -26
  118. package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
  119. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -1
  120. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
  121. package/lib/component/panels/PeaksPanel/PeaksTable.js +3 -2
  122. package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
  123. package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
  124. package/lib/component/panels/RangesPanel/RangesHeader.js +3 -2
  125. package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
  126. package/lib/component/panels/RangesPanel/RangesTable.d.ts +1 -1
  127. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  128. package/lib/component/panels/RangesPanel/RangesTable.js +2 -1
  129. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  130. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  131. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +1 -1
  132. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
  133. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js.map +1 -1
  134. package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
  135. package/lib/component/panels/SpectraPanel/SpectraTable.js +3 -2
  136. package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
  137. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -2
  138. package/lib/component/panels/SummaryPanel/utilities/Utilities.js.map +1 -1
  139. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  140. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js.map +1 -1
  141. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts.map +1 -1
  142. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +0 -4
  143. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js.map +1 -1
  144. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +8 -8
  145. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js.map +1 -1
  146. package/lib/component/panels/ZonesPanel/ZonesPanel.d.ts.map +1 -1
  147. package/lib/component/panels/ZonesPanel/ZonesPanel.js +6 -1
  148. package/lib/component/panels/ZonesPanel/ZonesPanel.js.map +1 -1
  149. package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +8 -9
  150. package/lib/component/panels/ZonesPanel/ZonesTable.d.ts.map +1 -1
  151. package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -2
  152. package/lib/component/panels/ZonesPanel/ZonesTable.js.map +1 -1
  153. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
  154. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +0 -2
  155. package/lib/component/panels/ZonesPanel/ZonesTableRow.js.map +1 -1
  156. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +7 -7
  157. package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts.map +1 -1
  158. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +3 -3
  159. package/lib/component/panels/ZonesPanel/hooks/useMapZones.js.map +1 -1
  160. package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
  161. package/lib/component/panels/databasePanel/DatabasePanel.js +13 -10
  162. package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
  163. package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.d.ts.map +1 -1
  164. package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js +0 -2
  165. package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js.map +1 -1
  166. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts.map +1 -1
  167. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +0 -2
  168. package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js.map +1 -1
  169. package/lib/component/reducer/Reducer.d.ts +8 -2
  170. package/lib/component/reducer/Reducer.d.ts.map +1 -1
  171. package/lib/component/reducer/Reducer.js +3 -1
  172. package/lib/component/reducer/Reducer.js.map +1 -1
  173. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  174. package/lib/component/reducer/actions/DatabaseActions.js +2 -1
  175. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  176. package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
  177. package/lib/component/reducer/actions/{LoadActions.d.ts → LoadAction.d.ts} +11 -3
  178. package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -0
  179. package/lib/component/reducer/actions/{LoadActions.js → LoadAction.js} +53 -18
  180. package/lib/component/reducer/actions/LoadAction.js.map +1 -0
  181. package/lib/component/reducer/actions/MoleculeActions.d.ts +3 -2
  182. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  183. package/lib/component/reducer/actions/MoleculeActions.js +1 -1
  184. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  185. package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
  186. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  187. package/lib/component/reducer/actions/RangesActions.js +13 -13
  188. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  189. package/lib/component/reducer/actions/ZonesActions.d.ts +2 -2
  190. package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
  191. package/lib/component/reducer/actions/ZonesActions.js +9 -4
  192. package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
  193. package/lib/component/reducer/preferences/actions/initPreferences.d.ts.map +1 -1
  194. package/lib/component/reducer/preferences/actions/initPreferences.js +1 -2
  195. package/lib/component/reducer/preferences/actions/initPreferences.js.map +1 -1
  196. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
  197. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +2 -1
  198. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
  199. package/lib/component/reducer/preferences/preferencesReducer.d.ts +8 -8
  200. package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
  201. package/lib/component/reducer/preferences/preferencesReducer.js +0 -1
  202. package/lib/component/reducer/preferences/preferencesReducer.js.map +1 -1
  203. package/lib/component/utility/export.d.ts +3 -3
  204. package/lib/component/utility/export.d.ts.map +1 -1
  205. package/lib/component/utility/export.js +13 -21
  206. package/lib/component/utility/export.js.map +1 -1
  207. package/lib/component/utility/getClosePeak.js +1 -1
  208. package/lib/component/utility/getClosePeak.js.map +1 -1
  209. package/lib/component/utility/save_as.d.ts +9 -0
  210. package/lib/component/utility/save_as.d.ts.map +1 -0
  211. package/lib/component/utility/save_as.js +7 -0
  212. package/lib/component/utility/save_as.js.map +1 -0
  213. package/lib/data/PredictionManager.d.ts.map +1 -1
  214. package/lib/data/PredictionManager.js +13 -9
  215. package/lib/data/PredictionManager.js.map +1 -1
  216. package/lib/data/SpectraManager.d.ts +45 -4
  217. package/lib/data/SpectraManager.d.ts.map +1 -1
  218. package/lib/data/SpectraManager.js +69 -12
  219. package/lib/data/SpectraManager.js.map +1 -1
  220. package/lib/data/constants/signalsKinds.d.ts +1 -6
  221. package/lib/data/constants/signalsKinds.d.ts.map +1 -1
  222. package/lib/data/constants/signalsKinds.js +2 -17
  223. package/lib/data/constants/signalsKinds.js.map +1 -1
  224. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  225. package/lib/data/data1d/Spectrum1D/generateJGraphData.js.map +1 -1
  226. package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +1 -0
  227. package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts.map +1 -1
  228. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
  229. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
  230. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +1 -10
  231. package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts.map +1 -1
  232. package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
  233. package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
  234. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
  235. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
  236. package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
  237. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
  238. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +5 -1
  239. package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
  240. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -1
  241. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +1 -1
  242. package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
  243. package/lib/data/data2d/Spectrum2D/contours.js +1 -1
  244. package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
  245. package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +1 -0
  246. package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
  247. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +2 -1
  248. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  249. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -2
  250. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  251. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -2
  252. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  253. package/lib/data/molecules/Molecule.d.ts +2 -6
  254. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  255. package/lib/data/molecules/Molecule.js +7 -1
  256. package/lib/data/molecules/Molecule.js.map +1 -1
  257. package/lib/data/molecules/MoleculeManager.d.ts +4 -3
  258. package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
  259. package/lib/data/molecules/MoleculeManager.js +8 -3
  260. package/lib/data/molecules/MoleculeManager.js.map +1 -1
  261. package/lib/data/utilities/RangeUtilities.d.ts +3 -2
  262. package/lib/data/utilities/RangeUtilities.d.ts.map +1 -1
  263. package/lib/data/utilities/RangeUtilities.js +9 -3
  264. package/lib/data/utilities/RangeUtilities.js.map +1 -1
  265. package/lib/data/utilities/ZoneUtilities.d.ts.map +1 -1
  266. package/lib/data/utilities/ZoneUtilities.js +1 -2
  267. package/lib/data/utilities/ZoneUtilities.js.map +1 -1
  268. package/lib/data/utilities/isProton.d.ts +2 -0
  269. package/lib/data/utilities/isProton.d.ts.map +1 -0
  270. package/lib/data/utilities/isProton.js +4 -0
  271. package/lib/data/utilities/isProton.js.map +1 -0
  272. package/lib/versionInfo.js +1 -1
  273. package/package.json +27 -27
  274. package/src/component/1d/FloatingRanges.tsx +5 -5
  275. package/src/component/1d/database/DatabaseSpectrum.tsx +1 -1
  276. package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +1 -1
  277. package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +4 -2
  278. package/src/component/1d/peaks/PeakAnnotations.tsx +2 -1
  279. package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +11 -1
  280. package/src/component/1d/peaks/Peaks.tsx +9 -3
  281. package/src/component/1d/ranges/Range.tsx +4 -3
  282. package/src/component/1d/ranges/RangesIntegrals.tsx +6 -2
  283. package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +1 -0
  284. package/src/component/2d/FooterBanner.tsx +2 -2
  285. package/src/component/2d/YAxis.tsx +31 -13
  286. package/src/component/2d/useTracesSpectra.ts +3 -0
  287. package/src/component/2d/utilities/extractSpectrumSignals.ts +6 -16
  288. package/src/component/2d/zones/SignalsGuideLines.tsx +11 -9
  289. package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +2 -3
  290. package/src/component/context/DispatchContext.tsx +2 -2
  291. package/src/component/context/LoggerContext.tsx +8 -11
  292. package/src/component/context/PreferencesContext.tsx +8 -5
  293. package/src/component/elements/D3Axis.tsx +1 -2
  294. package/src/component/elements/Sections.tsx +1 -1
  295. package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -2
  296. package/src/component/hooks/useExport.tsx +38 -6
  297. package/src/component/loader/Spinner.tsx +1 -1
  298. package/src/component/loader/useLoadFiles.ts +67 -30
  299. package/src/component/main/InnerNMRium.tsx +6 -2
  300. package/src/component/main/NMRiumStateProvider.tsx +19 -7
  301. package/src/component/modal/LoadJCAMPModal.tsx +2 -3
  302. package/src/component/modal/MoleculeStructureEditorModal.tsx +1 -0
  303. package/src/component/modal/MultipletAnalysisModal.tsx +0 -2
  304. package/src/component/modal/SaveAsModal.tsx +29 -6
  305. package/src/component/modal/changeSum/ChangeSumModalContents.tsx +0 -2
  306. package/src/component/modal/changeSum/SelectMolecule.tsx +0 -2
  307. package/src/component/modal/setting/settings-tabs/DatabasesTabContent.tsx +1 -3
  308. package/src/component/modal/setting/settingsValidation.ts +2 -2
  309. package/src/component/panels/IntegralsPanel/IntegralPanel.tsx +2 -6
  310. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -3
  311. package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +1 -2
  312. package/src/component/panels/MoleculesPanel/Utilities.ts +8 -6
  313. package/src/component/panels/MoleculesPanel/useAtomAssignment.tsx +26 -7
  314. package/src/component/panels/PeaksPanel/PeaksPanel.tsx +25 -35
  315. package/src/component/panels/PeaksPanel/PeaksTable.tsx +3 -2
  316. package/src/component/panels/RangesPanel/RangesHeader.tsx +3 -2
  317. package/src/component/panels/RangesPanel/RangesTable.tsx +10 -8
  318. package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +3 -3
  319. package/src/component/panels/RangesPanel/TableColumns/RelativeColumn.tsx +2 -2
  320. package/src/component/panels/SpectraPanel/SpectraTable.tsx +3 -2
  321. package/src/component/panels/SummaryPanel/utilities/Utilities.ts +2 -2
  322. package/src/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.tsx +1 -1
  323. package/src/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.tsx +0 -4
  324. package/src/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.tsx +9 -9
  325. package/src/component/panels/ZonesPanel/ZonesPanel.tsx +15 -5
  326. package/src/component/panels/ZonesPanel/ZonesTable.tsx +9 -10
  327. package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +0 -2
  328. package/src/component/panels/ZonesPanel/hooks/useMapZones.ts +11 -11
  329. package/src/component/panels/databasePanel/DatabasePanel.tsx +18 -14
  330. package/src/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.tsx +0 -2
  331. package/src/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.tsx +0 -2
  332. package/src/component/reducer/Reducer.ts +14 -3
  333. package/src/component/reducer/actions/DatabaseActions.ts +3 -0
  334. package/src/component/reducer/actions/IntegralsActions.ts +1 -1
  335. package/src/component/reducer/actions/{LoadActions.ts → LoadAction.ts} +74 -25
  336. package/src/component/reducer/actions/MoleculeActions.ts +7 -8
  337. package/src/component/reducer/actions/RangesActions.ts +16 -25
  338. package/src/component/reducer/actions/ZonesActions.ts +17 -9
  339. package/src/component/reducer/preferences/actions/initPreferences.ts +0 -3
  340. package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +2 -1
  341. package/src/component/reducer/preferences/preferencesReducer.ts +9 -10
  342. package/src/component/utility/export.ts +15 -20
  343. package/src/component/utility/getClosePeak.ts +1 -1
  344. package/src/component/utility/save_as.ts +16 -0
  345. package/src/data/PredictionManager.ts +21 -14
  346. package/src/data/SpectraManager.ts +96 -19
  347. package/src/data/constants/signalsKinds.ts +5 -20
  348. package/src/data/data1d/Spectrum1D/generateJGraphData.ts +1 -1
  349. package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +3 -1
  350. package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +1 -0
  351. package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +7 -4
  352. package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +8 -1
  353. package/src/data/data1d/Spectrum1D/ranges/detectSignals.ts +1 -1
  354. package/src/data/data2d/Spectrum2D/contours.ts +2 -3
  355. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +3 -1
  356. package/src/data/molecules/Molecule.ts +13 -7
  357. package/src/data/molecules/MoleculeManager.ts +14 -8
  358. package/src/data/utilities/RangeUtilities.ts +12 -4
  359. package/src/data/utilities/ZoneUtilities.ts +1 -3
  360. package/src/data/utilities/isProton.ts +3 -0
  361. package/src/versionInfo.ts +1 -1
  362. package/lib/component/reducer/actions/LoadActions.d.ts.map +0 -1
  363. package/lib/component/reducer/actions/LoadActions.js.map +0 -1
  364. package/lib/component/utility/isHomoNuclear.d.ts +0 -2
  365. package/lib/component/utility/isHomoNuclear.d.ts.map +0 -1
  366. package/lib/component/utility/isHomoNuclear.js +0 -11
  367. package/lib/component/utility/isHomoNuclear.js.map +0 -1
  368. package/lib/data/types/common/SignalKind.d.ts +0 -2
  369. package/lib/data/types/common/SignalKind.d.ts.map +0 -1
  370. package/lib/data/types/common/SignalKind.js +0 -2
  371. package/lib/data/types/common/SignalKind.js.map +0 -1
  372. package/lib/utils/stringCapitalize.d.ts +0 -2
  373. package/lib/utils/stringCapitalize.d.ts.map +0 -1
  374. package/lib/utils/stringCapitalize.js +0 -4
  375. package/lib/utils/stringCapitalize.js.map +0 -1
  376. package/src/component/utility/isHomoNuclear.ts +0 -11
  377. package/src/data/types/common/SignalKind.ts +0 -10
  378. package/src/utils/stringCapitalize.ts +0 -3
@@ -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
+ fileCollections: state.fileCollections,
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,84 @@ 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 } = workspacePreferences;
44
+ const { nmrLoaders: sourceSelector } = preferences.current;
45
+
46
+ const parsingOptions: Partial<ParsingOptions> = {
47
+ sourceSelector,
48
+ logger: logger.child({ context: 'nmr-processing' }),
49
+ onLoadProcessing,
50
+ experimentalFeatures,
51
+ };
52
+
53
+ let fileCollection: FileCollection | undefined;
54
+ let fileCollections: Map<string, FileCollection> | undefined;
55
+ if (files.length === 1 && files[0].name.endsWith('.nmrium.zip')) {
56
+ [nmriumState, fileCollections] = await core.readNMRiumArchive(
57
+ files[0].stream(),
58
+ parsingOptions,
59
+ );
60
+ containsNmrium = true;
34
61
  } else {
35
- const fileCollection = await new FileCollection().appendFileList(
36
- files,
62
+ for (const file of files) {
63
+ if (file.name.endsWith('.nmrium.zip')) {
64
+ nmriumArchiveFiles.push(file);
65
+ } else {
66
+ otherFiles.push(file);
67
+ }
68
+ }
69
+
70
+ if (nmriumArchiveFiles.length > 0) {
71
+ await Promise.all(
72
+ nmriumArchiveFiles.map((file) => loadFiles([file])),
73
+ );
74
+ }
75
+
76
+ fileCollection = await new FileCollection().appendFileList(
77
+ otherFiles,
37
78
  );
79
+
38
80
  const metaFile = Object.values(fileCollection.files).find((file) =>
39
81
  isMetaFile(file),
40
82
  );
41
- let parseMetaFileResult: ParseResult<any> | null = null;
83
+
42
84
  if (metaFile) {
43
85
  parseMetaFileResult = await parseMetaFile(metaFile);
44
86
  }
45
- const { nmrLoaders: sourceSelector } = preferences.current;
46
- const { onLoadProcessing, spectraColors } = workspacePreferences;
47
- const { nmriumState, containsNmrium } = await core.read(
87
+ ({ nmriumState, containsNmrium } = await core.read(
48
88
  fileCollection,
49
- {
50
- sourceSelector,
51
- logger: logger.child({ context: 'nmr-processing' }),
52
- onLoadProcessing,
53
- experimentalFeatures,
54
- },
55
- );
89
+ parsingOptions,
90
+ ));
91
+ }
56
92
 
57
- if (nmriumState.settings) {
58
- dispatchPreferences({
59
- type: 'SET_WORKSPACE',
60
- payload: {
61
- data: nmriumState.settings,
62
- workspaceSource: 'nmriumFile',
63
- },
64
- });
65
- }
66
- dispatch({
67
- type: 'LOAD_DROP_FILES',
93
+ if (nmriumState.settings) {
94
+ dispatchPreferences({
95
+ type: 'SET_WORKSPACE',
68
96
  payload: {
69
- nmriumState,
70
- containsNmrium,
71
- parseMetaFileResult,
72
- spectraColors,
97
+ data: nmriumState.settings,
98
+ workspaceSource: 'nmriumFile',
73
99
  },
74
100
  });
75
101
  }
102
+ dispatch({
103
+ type: 'LOAD_DROP_FILES',
104
+ payload: {
105
+ nmriumState,
106
+ containsNmrium,
107
+ parseMetaFileResult,
108
+ spectraColors,
109
+ fileCollection,
110
+ fileCollections,
111
+ },
112
+ });
76
113
  }
77
114
 
78
115
  loadFiles(files)
@@ -8,6 +8,7 @@ import { CoreProvider } from '../context/CoreContext.js';
8
8
  import { GlobalProvider } from '../context/GlobalContext.js';
9
9
  import { KeyModifiersProvider } from '../context/KeyModifierContext.js';
10
10
  import { LoggerProvider } from '../context/LoggerContext.js';
11
+ import type { PreferencesStateContext } from '../context/PreferencesContext.js';
11
12
  import { PreferencesProvider } from '../context/PreferencesContext.js';
12
13
  import { SortSpectraProvider } from '../context/SortSpectraContext.js';
13
14
  import { ToasterProvider } from '../context/ToasterContext.js';
@@ -66,6 +67,10 @@ export function InnerNMRium(props: InnerNMRiumProps) {
66
67
  initPreferencesState,
67
68
  );
68
69
 
70
+ const preferencesProviderValue = useMemo<PreferencesStateContext>(() => {
71
+ return { ...preferencesState, dispatch: dispatchPreferences };
72
+ }, [preferencesState]);
73
+
69
74
  useEffect(() => {
70
75
  rootRef.current?.focus();
71
76
  }, [isFullScreen]);
@@ -79,7 +84,6 @@ export function InnerNMRium(props: InnerNMRiumProps) {
79
84
  workspace,
80
85
  customWorkspaces,
81
86
  currentWorkspace: settings?.currentWorkspace,
82
- dispatch: dispatchPreferences,
83
87
  },
84
88
  });
85
89
  }, [customWorkspaces, preferences, workspace]);
@@ -99,7 +103,7 @@ export function InnerNMRium(props: InnerNMRiumProps) {
99
103
  viewerRef: viewerRef.current,
100
104
  }}
101
105
  >
102
- <PreferencesProvider value={preferencesState}>
106
+ <PreferencesProvider value={preferencesProviderValue}>
103
107
  <LoggerProvider>
104
108
  <KeyModifiersProvider>
105
109
  <ToasterProvider>
@@ -52,7 +52,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
52
52
  );
53
53
 
54
54
  const {
55
- source,
55
+ sources,
56
56
  data: spectraData,
57
57
  molecules,
58
58
  correlations,
@@ -71,17 +71,25 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
71
71
  const { workspace, workspaces = {} } = preferencesState;
72
72
  stateRef.current = toJSON(
73
73
  core,
74
- { data: spectraData, molecules, correlations, source, view, actionType },
74
+ {
75
+ data: spectraData,
76
+ molecules,
77
+ correlations,
78
+ sources,
79
+ view,
80
+ actionType,
81
+ fileCollections: {},
82
+ },
75
83
  { current: workspaces[workspace.current] },
76
84
  { serialize: false, exportTarget: 'onChange' },
77
- );
85
+ ) as NmriumState;
78
86
  }, [
79
87
  actionType,
80
88
  core,
81
89
  correlations,
82
90
  molecules,
83
91
  preferencesState,
84
- source,
92
+ sources,
85
93
  spectraData,
86
94
  view,
87
95
  ]);
@@ -91,7 +99,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
91
99
  if (checkActionType(actionType)) {
92
100
  handleChange.current?.(stateRef.current as NmriumState, 'data');
93
101
  }
94
- }, [actionType, correlations, molecules, source, spectraData]);
102
+ }, [actionType, correlations, molecules, sources, spectraData]);
95
103
 
96
104
  useEffect(() => {
97
105
  // trigger onChange callback if view object changed
@@ -111,7 +119,8 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
111
119
  if (nmriumData) {
112
120
  void core
113
121
  .readNMRiumObject(nmriumData)
114
- .then((nmriumState) => {
122
+ .then((result) => {
123
+ const [nmriumState, fileCollections] = result;
115
124
  if (nmriumState?.settings) {
116
125
  dispatchPreferences({
117
126
  type: 'SET_WORKSPACE',
@@ -121,7 +130,10 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
121
130
  },
122
131
  });
123
132
  }
124
- dispatch({ type: 'INITIATE', payload: { nmriumState } });
133
+ dispatch({
134
+ type: 'INITIATE',
135
+ payload: { nmriumState, fileCollections },
136
+ });
125
137
  })
126
138
  .catch((error: unknown) => {
127
139
  dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
@@ -15,7 +15,6 @@ const allowedExtensions = new Set(['dx', 'jdx', 'jcamp']);
15
15
 
16
16
  const loadFormValidation = Yup.object({
17
17
  url: Yup.string()
18
- .url()
19
18
  .required()
20
19
  .test(
21
20
  'file type',
@@ -67,13 +66,13 @@ function InnerLoadJCAMPModal({ onCloseDialog }: InnerLoadJCAMPModalProps) {
67
66
  });
68
67
  const { pathname, origin } = new URL(url);
69
68
  try {
70
- const nmriumState = await core.readFromWebSource({
69
+ const [nmriumState, fileCollection] = await core.readFromWebSource({
71
70
  entries: [{ relativePath: pathname, baseURL: origin }],
72
71
  });
73
72
 
74
73
  dispatch({
75
74
  type: 'LOAD_DROP_FILES',
76
- payload: { nmriumState, resetSourceObject: false },
75
+ payload: { nmriumState, resetSourceObject: false, fileCollection },
77
76
  });
78
77
  } catch {
79
78
  toaster.show({ message: `Failed to load ${url}`, intent: 'danger' });
@@ -75,6 +75,7 @@ function MoleculeStructureEditorModal(
75
75
  const editedMolecule = Molecule.fromMolfile(molfile);
76
76
  const mappings =
77
77
  initialEnhancedMolfile.topicMolecule.getDiaIDsMapping(editedMolecule);
78
+
78
79
  dispatch({
79
80
  type: 'SET_MOLECULE',
80
81
  payload: {
@@ -162,8 +162,6 @@ function InnerMultipleAnalysis(props: InnerMultipleAnalysisProps) {
162
162
  debug: true,
163
163
  },
164
164
  });
165
- // TODO: refactor to not use an effect
166
- // eslint-disable-next-line react-hooks/set-state-in-effect
167
165
  setCalcFinished(true);
168
166
  setAnalysisData(result);
169
167
  } catch (error) {
@@ -8,12 +8,14 @@ import {
8
8
  import { Controller, useForm } from 'react-hook-form';
9
9
 
10
10
  import type { ExportOptions } from '../../data/SpectraManager.js';
11
+ import { DataExportOptions } from '../../data/SpectraManager.js';
11
12
  import { useChartData } from '../context/ChartContext.js';
12
13
  import ActionButtons from '../elements/ActionButtons.js';
13
14
  import { Input2Controller } from '../elements/Input2Controller.js';
14
15
  import type { LabelStyle } from '../elements/Label.js';
15
16
  import Label from '../elements/Label.js';
16
17
  import { StyledDialogBody } from '../elements/StyledDialogBody.js';
18
+ import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature.js';
17
19
  import { useExport } from '../hooks/useExport.js';
18
20
 
19
21
  const INITIAL_VALUE = {
@@ -21,7 +23,7 @@ const INITIAL_VALUE = {
21
23
  compressed: false,
22
24
  pretty: false,
23
25
  include: {
24
- dataType: 'ROW_DATA',
26
+ dataType: DataExportOptions.RAW_DATA,
25
27
  view: false,
26
28
  settings: false,
27
29
  } satisfies ExportOptions,
@@ -56,8 +58,9 @@ function SaveAsModal(props: SaveAsModalProps) {
56
58
  }
57
59
  function InnerSaveAsModal(props: InnerSaveAsModalProps) {
58
60
  const { onCloseDialog } = props;
59
- const { source, data } = useChartData();
61
+ const { sources, data } = useChartData();
60
62
  const { saveHandler } = useExport();
63
+ const experimentalFlagEnabled = useCheckExperimentalFeature();
61
64
 
62
65
  const fileName = data[0]?.info?.name;
63
66
 
@@ -105,13 +108,33 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
105
108
  const { value, ref, ...otherFieldProps } = field;
106
109
  return (
107
110
  <RadioGroup inline selectedValue={value} {...otherFieldProps}>
108
- <Radio label="Raw data" value="ROW_DATA" />
111
+ <Radio label="Raw data" value={DataExportOptions.RAW_DATA} />
109
112
  <Radio
110
113
  label="Data source"
111
- value="DATA_SOURCE"
112
- disabled={!source}
114
+ value={DataExportOptions.DATA_SOURCE}
115
+ disabled={Object.keys(sources).length === 0}
113
116
  />
114
- <Radio label="No data" value="NO_DATA" />
117
+ <Radio label="No data" value={DataExportOptions.NO_DATA} />
118
+
119
+ {/*
120
+ * Radio group works with Children.map.
121
+ * So Radio must be direct children of RadioGroup.
122
+ */}
123
+ {experimentalFlagEnabled && (
124
+ <Radio
125
+ label="Full data (external data embed, experimental)"
126
+ value={DataExportOptions.SELF_CONTAINED}
127
+ />
128
+ )}
129
+ {experimentalFlagEnabled && (
130
+ <Radio
131
+ label="Full data (external data linked, experimental)"
132
+ disabled={Object.keys(sources).length === 0}
133
+ value={
134
+ DataExportOptions.SELF_CONTAINED_EXTERNAL_DATASOURCE
135
+ }
136
+ />
137
+ )}
115
138
  </RadioGroup>
116
139
  );
117
140
  }}
@@ -80,8 +80,6 @@ export function ChangeSumModalContents(props: ChangeSumModalContentsProps) {
80
80
 
81
81
  useEffect(() => {
82
82
  if (sumOptions?.sumAuto && panels?.structuresPanel?.display) {
83
- // TODO: refactor to not use an effect
84
- // eslint-disable-next-line react-hooks/set-state-in-effect
85
83
  setActiveOption('auto');
86
84
  const { mf, moleculeId: id } = sumOptions;
87
85
  reset({
@@ -76,8 +76,6 @@ export default function SelectMolecule<
76
76
  const index = value
77
77
  ? molecules.findIndex((molecule) => molecule.id === value.id)
78
78
  : -1;
79
- // TODO: refactor to not use an effect
80
- // eslint-disable-next-line react-hooks/set-state-in-effect
81
79
  setValue(index !== -1 ? index : 0);
82
80
  }
83
81
  }, [molecules, setValue, value]);
@@ -37,7 +37,7 @@ interface DatabasesTabContentProps {
37
37
  originalWorkspaces: CustomWorkspaces;
38
38
  }
39
39
 
40
- function DatabasesTabContent({
40
+ export default function DatabasesTabContent({
41
41
  currentWorkspace,
42
42
  originalWorkspaces,
43
43
  }: DatabasesTabContentProps) {
@@ -276,5 +276,3 @@ function DataBaseHeader(props: DataBaseHeaderProps) {
276
276
  </Section>
277
277
  );
278
278
  }
279
-
280
- export default DatabasesTabContent;
@@ -22,7 +22,7 @@ const databasesValidation = object().shape({
22
22
  data: array().of(
23
23
  object().shape({
24
24
  label: string().trim().required('Label is a required field'),
25
- url: string().trim().url().required('URL is a required field'),
25
+ url: string().trim().required('URL is a required field'),
26
26
  }),
27
27
  ),
28
28
  });
@@ -58,7 +58,7 @@ const externalAPIsValidation = array()
58
58
  key: mixed<ExternalAPIKeyType>()
59
59
  .oneOf(EXTERNAL_API_KEYS.map(({ key }) => key))
60
60
  .required(),
61
- serverLink: string().url().required(),
61
+ serverLink: string().required(),
62
62
  APIKey: string().required(),
63
63
  }),
64
64
  )
@@ -26,12 +26,8 @@ export interface IntegralPanelInnerProps {
26
26
  xDomain: number[];
27
27
  }
28
28
 
29
- function IntegralPanelInner({
30
- integrals,
31
- info,
32
- activeTab,
33
- xDomain,
34
- }: IntegralPanelInnerProps) {
29
+ function IntegralPanelInner(props: IntegralPanelInnerProps) {
30
+ const { integrals, info, activeTab, xDomain } = props;
35
31
  const [filterIsActive, setFilterIsActive] = useState(false);
36
32
 
37
33
  const dispatch = useDispatch();
@@ -29,7 +29,8 @@ interface IntegralTableProps
29
29
  info: Info1D;
30
30
  }
31
31
 
32
- function IntegralTable({ activeTab, data, info }: IntegralTableProps) {
32
+ function IntegralTable(props: IntegralTableProps) {
33
+ const { activeTab, data, info } = props;
33
34
  const dispatch = useDispatch();
34
35
 
35
36
  const deleteIntegralHandler = useCallback(
@@ -179,11 +180,11 @@ function IntegralTable({ activeTab, data, info }: IntegralTableProps) {
179
180
  return columns;
180
181
  }, [COLUMNS, integralsPreferences]);
181
182
 
182
- if (info?.isFid) {
183
+ if (info.isFid) {
183
184
  return <NoDataForFid />;
184
185
  }
185
186
 
186
- if (!data || data.length === 0) {
187
+ if (data.length === 0) {
187
188
  return <EmptyText text="No data" />;
188
189
  }
189
190
 
@@ -75,8 +75,6 @@ function MoleculePanelInner(props: MoleculePanelInnerProps) {
75
75
 
76
76
  useEffect(() => {
77
77
  if (moleculesProp) {
78
- // TODO: refactor to not use an effect
79
- // eslint-disable-next-line react-hooks/set-state-in-effect
80
78
  setMolecules((prevMolecules) => {
81
79
  if (moleculesProp.length > prevMolecules.length) {
82
80
  setCurrentIndex(molecules.length);
@@ -164,6 +162,7 @@ function MoleculePanelInner(props: MoleculePanelInnerProps) {
164
162
  showAtomNumber={
165
163
  moleculesView?.[mol.id]?.showAtomNumber || false
166
164
  }
165
+ noCarbonLabelWithCustomLabel
167
166
  />
168
167
  </div>
169
168
  </div>
@@ -129,8 +129,8 @@ export function getAssignIds(
129
129
 
130
130
  export function getHighlightsOnHover(
131
131
  assignments: AssignmentContext,
132
- oclIDs: any,
133
- spectrum: any,
132
+ oclIDs: string[],
133
+ spectra: Spectrum[],
134
134
  ) {
135
135
  // set all IDs to highlight when hovering over an atom from AssignKey data
136
136
  let highlights: string[] = [];
@@ -138,12 +138,15 @@ export function getHighlightsOnHover(
138
138
 
139
139
  for (const key in assignmentsByKey) {
140
140
  const assignments = assignmentsByKey[key];
141
-
142
141
  for (const axis of assignmentAxes) {
143
142
  if (assignments[axis]?.some((oclKey: any) => oclIDs.includes(oclKey))) {
144
143
  highlights = highlights.concat(assignments[axis]);
145
- const assignIds = getAssignIds(spectrum, key);
146
- if (assignIds) {
144
+ for (const spectrum of spectra) {
145
+ const assignIds = getAssignIds(spectrum, key);
146
+ if (!assignIds) {
147
+ continue;
148
+ }
149
+
147
150
  const ids = assignIds.map<string>((item) => item.key);
148
151
  highlights.push(...ids);
149
152
  }
@@ -158,7 +161,6 @@ export function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext) {
158
161
  const { highlighted, data } = assignmentData;
159
162
  const assignment = highlighted ? data[highlighted.id] : null;
160
163
  const axisHover = highlighted ? highlighted.axis : null;
161
-
162
164
  if (axisHover && assignment?.[axisHover]) {
163
165
  return assignment[axisHover];
164
166
  } else {
@@ -4,8 +4,10 @@ import type { MouseEvent } from 'react';
4
4
  import { useMemo, useRef } from 'react';
5
5
 
6
6
  import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/isSpectrum1D.js';
7
+ import { isSpectrum2D } from '../../../data/data2d/Spectrum2D/isSpectrum2D.ts';
7
8
  import { ConcatenationString } from '../../../data/utilities/Concatenation.js';
8
9
  import checkModifierKeyActivated from '../../../data/utilities/checkModifierKeyActivated.js';
10
+ import { useTracesSpectra } from '../../2d/useTracesSpectra.ts';
9
11
  import type { Assignments, Axis } from '../../assignment/AssignmentsContext.js';
10
12
  import { useAssignmentContext } from '../../assignment/AssignmentsContext.js';
11
13
  import { useChartData } from '../../context/ChartContext.js';
@@ -75,6 +77,8 @@ export default function useAtomAssignment() {
75
77
  },
76
78
  } = useChartData();
77
79
  const spectrum = useSpectrum();
80
+ const tracesSpectra = useTracesSpectra();
81
+
78
82
  const toaster = useToaster();
79
83
  const dispatch = useDispatch();
80
84
  const highlightData = useHighlightData();
@@ -94,20 +98,33 @@ export default function useAtomAssignment() {
94
98
 
95
99
  const currentDiaIDsToHighlight = useMemo(() => {
96
100
  const { highlighted, sourceData } = highlightData.highlight;
97
- const type = sourceData?.type;
101
+ const { type, extra } = sourceData || {};
102
+ const { spectrumID } = extra || {};
103
+
104
+ let currentSpectrum = spectrum;
105
+
106
+ if (isSpectrum2D(spectrum) && spectrumID) {
107
+ const traceSpectrum = tracesSpectra.find(
108
+ (traceSpectrum) => traceSpectrum.id === spectrumID,
109
+ );
110
+ if (traceSpectrum) {
111
+ currentSpectrum = traceSpectrum;
112
+ }
113
+ }
98
114
 
99
- if (!type || !isValidHighlightEventSource(type)) return [];
115
+ if (!type || !isValidHighlightEventSource(type) || !currentSpectrum) {
116
+ return [];
117
+ }
100
118
 
101
119
  const highlightedAssignmentsIDs = highlighted.filter((highlightID) => {
102
120
  return assignments.data[highlightID];
103
121
  });
104
122
 
105
123
  const highlights = highlightedAssignmentsIDs.flatMap((highlightID) =>
106
- getSignalsDiaIDs(spectrum, assignments.data, highlightID),
124
+ getSignalsDiaIDs(currentSpectrum, assignments.data, highlightID),
107
125
  );
108
-
109
126
  return getCurrentDiaIDsToHighlight(assignments).concat(highlights);
110
- }, [assignments, highlightData.highlight, spectrum]);
127
+ }, [assignments, highlightData.highlight, spectrum, tracesSpectra]);
111
128
 
112
129
  function assign1DAtom(spectrum: Spectrum1D, key: string, atom: AtomData) {
113
130
  const assignKeys = getAssignIds(spectrum, key);
@@ -223,11 +240,13 @@ export default function useAtomAssignment() {
223
240
 
224
241
  function handleOnAtomHover(diaIDAndInfo: DiaIDAndInfo | undefined) {
225
242
  const { oclIDs } = extractFromAtom(diaIDAndInfo, nucleus);
226
-
227
243
  // on enter the atom
228
244
  if (oclIDs.length > 0) {
229
245
  // set all IDs to highlight when hovering over an atom from assignment data
230
- const highlights = getHighlightsOnHover(assignments, oclIDs, spectrum);
246
+ const highlights = getHighlightsOnHover(assignments, oclIDs, [
247
+ spectrum,
248
+ ...tracesSpectra,
249
+ ]);
231
250
  highlightedIdDsRef.current = highlights;
232
251
  highlightData.dispatch({
233
252
  type: 'SHOW',