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
@@ -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,24 @@ 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
+ },
75
82
  { current: workspaces[workspace.current] },
76
83
  { serialize: false, exportTarget: 'onChange' },
77
- );
84
+ ) as NmriumState;
78
85
  }, [
79
86
  actionType,
80
87
  core,
81
88
  correlations,
82
89
  molecules,
83
90
  preferencesState,
84
- source,
91
+ sources,
85
92
  spectraData,
86
93
  view,
87
94
  ]);
@@ -91,7 +98,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
91
98
  if (checkActionType(actionType)) {
92
99
  handleChange.current?.(stateRef.current as NmriumState, 'data');
93
100
  }
94
- }, [actionType, correlations, molecules, source, spectraData]);
101
+ }, [actionType, correlations, molecules, sources, spectraData]);
95
102
 
96
103
  useEffect(() => {
97
104
  // trigger onChange callback if view object changed
@@ -111,7 +118,8 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
111
118
  if (nmriumData) {
112
119
  void core
113
120
  .readNMRiumObject(nmriumData)
114
- .then((nmriumState) => {
121
+ .then((result) => {
122
+ const [nmriumState, aggregator] = result;
115
123
  if (nmriumState?.settings) {
116
124
  dispatchPreferences({
117
125
  type: 'SET_WORKSPACE',
@@ -121,7 +129,10 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
121
129
  },
122
130
  });
123
131
  }
124
- dispatch({ type: 'INITIATE', payload: { nmriumState } });
132
+ dispatch({
133
+ type: 'INITIATE',
134
+ payload: { nmriumState, aggregator },
135
+ });
125
136
  })
126
137
  .catch((error: unknown) => {
127
138
  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,19 @@ function InnerLoadJCAMPModal({ onCloseDialog }: InnerLoadJCAMPModalProps) {
67
66
  });
68
67
  const { pathname, origin } = new URL(url);
69
68
  try {
70
- const nmriumState = await core.readFromWebSource({
71
- entries: [{ relativePath: pathname, baseURL: origin }],
72
- });
69
+ const [nmriumState, fileCollection, selectorRoot] =
70
+ await core.readFromWebSource({
71
+ entries: [{ relativePath: pathname, baseURL: origin }],
72
+ });
73
73
 
74
74
  dispatch({
75
75
  type: 'LOAD_DROP_FILES',
76
- payload: { nmriumState, resetSourceObject: false },
76
+ payload: {
77
+ nmriumState,
78
+ resetSourceObject: false,
79
+ fileCollection,
80
+ selectorRoot,
81
+ },
77
82
  });
78
83
  } catch {
79
84
  toaster.show({ message: `Failed to load ${url}`, intent: 'danger' });
@@ -8,6 +8,7 @@ import { useOnOff } from 'react-science/ui';
8
8
 
9
9
  import type { StateMoleculeExtended } from '../../data/molecules/Molecule.js';
10
10
  import { useDispatch } from '../context/DispatchContext.js';
11
+ import { usePreferences } from '../context/PreferencesContext.tsx';
11
12
  import ActionButtons from '../elements/ActionButtons.js';
12
13
  import { StyledDialogBody } from '../elements/StyledDialogBody.js';
13
14
 
@@ -24,10 +25,14 @@ function MoleculeStructureEditorModal(
24
25
  const {
25
26
  onClose = () => null,
26
27
  selectedMolecule,
27
- floatMoleculeOnSave = false,
28
+ floatMoleculeOnSave,
28
29
  isOpen = false,
29
30
  } = props;
30
31
 
32
+ const {
33
+ current: { defaultMoleculeSettings },
34
+ } = usePreferences();
35
+
31
36
  const initialMolfile = selectedMolecule?.molfile;
32
37
  const initialEnhancedMolfile = useMemo(() => {
33
38
  if (!initialMolfile) {
@@ -75,6 +80,7 @@ function MoleculeStructureEditorModal(
75
80
  const editedMolecule = Molecule.fromMolfile(molfile);
76
81
  const mappings =
77
82
  initialEnhancedMolfile.topicMolecule.getDiaIDsMapping(editedMolecule);
83
+
78
84
  dispatch({
79
85
  type: 'SET_MOLECULE',
80
86
  payload: {
@@ -91,6 +97,7 @@ function MoleculeStructureEditorModal(
91
97
  payload: {
92
98
  molfile,
93
99
  floatMoleculeOnSave,
100
+ defaultMoleculeSettings,
94
101
  },
95
102
  });
96
103
  onClose('new');
@@ -101,8 +108,9 @@ function MoleculeStructureEditorModal(
101
108
  selectedMolecule,
102
109
  initialEnhancedMolfile,
103
110
  dispatch,
104
- floatMoleculeOnSave,
105
111
  onClose,
112
+ floatMoleculeOnSave,
113
+ defaultMoleculeSettings,
106
114
  ]);
107
115
 
108
116
  return (
@@ -131,7 +139,7 @@ function MoleculeStructureEditorModal(
131
139
  );
132
140
  }
133
141
 
134
- export function useMoleculeEditor(floatMoleculeOnSave = false) {
142
+ export function useMoleculeEditor(floatMoleculeOnSave?: boolean) {
135
143
  const [isOpen, openModal, closeModal] = useOnOff(false);
136
144
  const [molecule, setMolecule] = useState<StateMoleculeExtended | undefined>();
137
145
  const modal = (
@@ -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) {
@@ -5,15 +5,18 @@ import {
5
5
  Radio,
6
6
  RadioGroup,
7
7
  } from '@blueprintjs/core';
8
+ import { useMemo } from 'react';
8
9
  import { Controller, useForm } from 'react-hook-form';
9
10
 
10
11
  import type { ExportOptions } from '../../data/SpectraManager.js';
12
+ import { DataExportOptions } from '../../data/SpectraManager.js';
11
13
  import { useChartData } from '../context/ChartContext.js';
12
14
  import ActionButtons from '../elements/ActionButtons.js';
13
15
  import { Input2Controller } from '../elements/Input2Controller.js';
14
16
  import type { LabelStyle } from '../elements/Label.js';
15
17
  import Label from '../elements/Label.js';
16
18
  import { StyledDialogBody } from '../elements/StyledDialogBody.js';
19
+ import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature.js';
17
20
  import { useExport } from '../hooks/useExport.js';
18
21
 
19
22
  const INITIAL_VALUE = {
@@ -21,7 +24,7 @@ const INITIAL_VALUE = {
21
24
  compressed: false,
22
25
  pretty: false,
23
26
  include: {
24
- dataType: 'ROW_DATA',
27
+ dataType: DataExportOptions.RAW_DATA,
25
28
  view: false,
26
29
  settings: false,
27
30
  } satisfies ExportOptions,
@@ -56,8 +59,9 @@ function SaveAsModal(props: SaveAsModalProps) {
56
59
  }
57
60
  function InnerSaveAsModal(props: InnerSaveAsModalProps) {
58
61
  const { onCloseDialog } = props;
59
- const { source, data } = useChartData();
62
+ const { sources, data, aggregator } = useChartData();
60
63
  const { saveHandler } = useExport();
64
+ const experimentalFlagEnabled = useCheckExperimentalFeature();
61
65
 
62
66
  const fileName = data[0]?.info?.name;
63
67
 
@@ -69,6 +73,11 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
69
73
  const { handleSubmit, control, register } = useForm({
70
74
  defaultValues: { ...INITIAL_VALUE, name: fileName },
71
75
  });
76
+
77
+ const containsLinkedFiles = useMemo(() => {
78
+ return aggregator.sources.some((s) => !s.baseURL?.startsWith('ium:'));
79
+ }, [aggregator]);
80
+
72
81
  return (
73
82
  <Dialog
74
83
  isOpen
@@ -105,13 +114,33 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
105
114
  const { value, ref, ...otherFieldProps } = field;
106
115
  return (
107
116
  <RadioGroup inline selectedValue={value} {...otherFieldProps}>
108
- <Radio label="Raw data" value="ROW_DATA" />
117
+ <Radio label="Raw data" value={DataExportOptions.RAW_DATA} />
109
118
  <Radio
110
119
  label="Data source"
111
- value="DATA_SOURCE"
112
- disabled={!source}
120
+ value={DataExportOptions.DATA_SOURCE}
121
+ disabled={Object.keys(sources).length === 0}
113
122
  />
114
- <Radio label="No data" value="NO_DATA" />
123
+ <Radio label="No data" value={DataExportOptions.NO_DATA} />
124
+
125
+ {/*
126
+ * Radio group works with Children.map.
127
+ * So Radio must be direct children of RadioGroup.
128
+ */}
129
+ {experimentalFlagEnabled && (
130
+ <Radio
131
+ label="Full data (external data embed, experimental)"
132
+ value={DataExportOptions.SELF_CONTAINED}
133
+ />
134
+ )}
135
+ {experimentalFlagEnabled && (
136
+ <Radio
137
+ label="Full data (external data linked, experimental)"
138
+ disabled={!containsLinkedFiles}
139
+ value={
140
+ DataExportOptions.SELF_CONTAINED_EXTERNAL_DATASOURCE
141
+ }
142
+ />
143
+ )}
115
144
  </RadioGroup>
116
145
  );
117
146
  }}
@@ -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;
@@ -60,6 +60,10 @@ const LIST: ListItem[] = [
60
60
  label: 'Range picking',
61
61
  name: 'rangePicking',
62
62
  },
63
+ {
64
+ label: 'Inset',
65
+ name: 'inset',
66
+ },
63
67
  {
64
68
  label: 'Slicing',
65
69
  name: 'slicing',
@@ -92,10 +96,22 @@ const LIST: ListItem[] = [
92
96
  label: 'Fourier transform',
93
97
  name: 'fft',
94
98
  },
99
+ {
100
+ label: 'Fourier transform dimension one',
101
+ name: 'fftDimension1',
102
+ },
103
+ {
104
+ label: 'Fourier transform dimension two',
105
+ name: 'fftDimension2',
106
+ },
95
107
  {
96
108
  label: 'Phase correction',
97
109
  name: 'phaseCorrection',
98
110
  },
111
+ {
112
+ label: 'Two-Dimensional phase correction',
113
+ name: 'phaseCorrectionTwoDimensions',
114
+ },
99
115
  {
100
116
  label: 'Baseline correction',
101
117
  name: 'baselineCorrection',
@@ -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
 
@@ -0,0 +1,160 @@
1
+ import styled from '@emotion/styled';
2
+ import { yupResolver } from '@hookform/resolvers/yup';
3
+ import type { BoundingBox, MoleculeView } from '@zakodium/nmrium-core';
4
+ import { useForm } from 'react-hook-form';
5
+ import * as Yup from 'yup';
6
+
7
+ import { usePreferences } from '../../context/PreferencesContext.tsx';
8
+ import { CheckController } from '../../elements/CheckController.js';
9
+ import { GroupPane } from '../../elements/GroupPane.js';
10
+ import type { LabelStyle } from '../../elements/Label.js';
11
+ import Label from '../../elements/Label.js';
12
+ import { NumberInput2Controller } from '../../elements/NumberInput2Controller.js';
13
+ import { Select2Controller } from '../../elements/Select2Controller.js';
14
+ import PreferencesHeader from '../header/PreferencesHeader.tsx';
15
+
16
+ const atomAnnotations: Array<{
17
+ value: MoleculeView['atomAnnotation'];
18
+ label: string;
19
+ }> = [
20
+ { value: 'none', label: 'None' },
21
+ { value: 'atom-numbers', label: 'Atoms number' },
22
+ { value: 'custom-labels', label: 'Custom labels' },
23
+ ];
24
+ const Container = styled.div`
25
+ display: flex;
26
+ flex-direction: column;
27
+ height: 100%;
28
+ width: 100%;
29
+ `;
30
+ const InnerContainer = styled.div`
31
+ overflow: auto;
32
+ height: 100%;
33
+ display: block;
34
+ background-color: white;
35
+ `;
36
+ const boundingBoxSchema: Yup.ObjectSchema<BoundingBox> = Yup.object({
37
+ width: Yup.number().required().min(0, 'Width must be positive'),
38
+ height: Yup.number().required().min(0, 'Height must be positive'),
39
+ x: Yup.number().required(),
40
+ y: Yup.number().required(),
41
+ }).defined();
42
+
43
+ const moleculeViewSchema: Yup.ObjectSchema<MoleculeView> = Yup.object({
44
+ floating: Yup.object({
45
+ visible: Yup.boolean().required(),
46
+ bounding: boundingBoxSchema.required(),
47
+ }),
48
+ showLabel: Yup.boolean().required(),
49
+ atomAnnotation: Yup.mixed<'none' | 'atom-numbers' | 'custom-labels'>()
50
+ .oneOf(['none', 'atom-numbers', 'custom-labels'])
51
+ .required()
52
+ .default('none'),
53
+ }).defined();
54
+
55
+ const labelStyle: LabelStyle = {
56
+ label: { flex: 4, fontWeight: '500' },
57
+ wrapper: { flex: 8, display: 'flex', alignItems: 'center' },
58
+ container: { padding: '5px 0' },
59
+ };
60
+
61
+ const styles = {
62
+ select: {
63
+ width: '100%',
64
+ minWidth: '100px',
65
+ maxWidth: '280px',
66
+ height: 30,
67
+ margin: 0,
68
+ },
69
+ groupHeader: {
70
+ borderBottom: '1px solid #efefef',
71
+ paddingBottom: '5px',
72
+ fontWeight: '600',
73
+ color: '#005d9e',
74
+ },
75
+ };
76
+
77
+ interface MoleculeOptionsPanelProps {
78
+ onClose: () => void;
79
+ }
80
+
81
+ export function MoleculeOptionsPanel(props: MoleculeOptionsPanelProps) {
82
+ const { onClose } = props;
83
+ const {
84
+ current: { defaultMoleculeSettings },
85
+ } = usePreferences();
86
+ const { handleSubmit, control } = useForm<MoleculeView>({
87
+ defaultValues: defaultMoleculeSettings,
88
+ resolver: yupResolver(moleculeViewSchema),
89
+ });
90
+ const { dispatch } = usePreferences();
91
+
92
+ function handleSave() {
93
+ void handleSubmit((values) => {
94
+ dispatch({ type: 'CHANGE_DEFAULT_MOLECULE_SETTINGS', payload: values });
95
+ onClose();
96
+ })();
97
+ }
98
+ return (
99
+ <Container>
100
+ <PreferencesHeader onSave={handleSave} onClose={onClose} />
101
+ <InnerContainer>
102
+ <GroupPane
103
+ text="General"
104
+ style={{
105
+ header: styles.groupHeader,
106
+ }}
107
+ >
108
+ <Label title="Show label" style={labelStyle}>
109
+ <CheckController control={control} name="showLabel" />
110
+ </Label>
111
+ <Label title="Atom annotation" style={labelStyle}>
112
+ <Select2Controller
113
+ control={control}
114
+ items={atomAnnotations}
115
+ name="atomAnnotation"
116
+ />
117
+ </Label>
118
+ </GroupPane>
119
+ <GroupPane
120
+ text="Size & position"
121
+ style={{
122
+ header: styles.groupHeader,
123
+ }}
124
+ >
125
+ <Label title="Floating molecule" style={labelStyle}>
126
+ <CheckController control={control} name="floating.visible" />
127
+ </Label>
128
+ <Label title="X (%)" style={labelStyle}>
129
+ <NumberInput2Controller
130
+ control={control}
131
+ name="floating.bounding.x"
132
+ fill
133
+ />
134
+ </Label>
135
+ <Label title="Y (%)" style={labelStyle}>
136
+ <NumberInput2Controller
137
+ control={control}
138
+ name="floating.bounding.y"
139
+ fill
140
+ />
141
+ </Label>
142
+ <Label title="Width" style={labelStyle}>
143
+ <NumberInput2Controller
144
+ control={control}
145
+ name="floating.bounding.width"
146
+ fill
147
+ />
148
+ </Label>
149
+ <Label title="Height" style={labelStyle}>
150
+ <NumberInput2Controller
151
+ control={control}
152
+ name="floating.bounding.height"
153
+ fill
154
+ />
155
+ </Label>
156
+ </GroupPane>
157
+ </InnerContainer>
158
+ </Container>
159
+ );
160
+ }