nmrium 1.7.0 → 1.9.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 (258) hide show
  1. package/lib/component/1d/ranges/Atoms.d.ts.map +1 -1
  2. package/lib/component/1d/ranges/Atoms.js +24 -9
  3. package/lib/component/1d/ranges/Atoms.js.map +1 -1
  4. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -1
  5. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts.map +1 -1
  6. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +32 -42
  7. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
  8. package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.d.ts.map +1 -1
  9. package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.js.map +1 -1
  10. package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
  11. package/lib/component/2d/useTracesSpectra.js +2 -0
  12. package/lib/component/2d/useTracesSpectra.js.map +1 -1
  13. package/lib/component/2d/zones/SignalsGuideLines.js +1 -1
  14. package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
  15. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
  16. package/lib/component/EventsTrackers/KeysListenerTracker.js +6 -0
  17. package/lib/component/EventsTrackers/KeysListenerTracker.js.map +1 -1
  18. package/lib/component/hooks/useExport.js +1 -1
  19. package/lib/component/hooks/useExport.js.map +1 -1
  20. package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
  21. package/lib/component/loader/useLoadFiles.js +17 -7
  22. package/lib/component/loader/useLoadFiles.js.map +1 -1
  23. package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
  24. package/lib/component/main/NMRiumStateProvider.js +2 -3
  25. package/lib/component/main/NMRiumStateProvider.js.map +1 -1
  26. package/lib/component/modal/LoadJCAMPModal.js +7 -2
  27. package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
  28. package/lib/component/modal/MoleculeStructureEditorModal.d.ts.map +1 -1
  29. package/lib/component/modal/MoleculeStructureEditorModal.js +7 -3
  30. package/lib/component/modal/MoleculeStructureEditorModal.js.map +1 -1
  31. package/lib/component/modal/MultipletAnalysisModal.js +1 -1
  32. package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
  33. package/lib/component/modal/SaveAsModal.js +6 -2
  34. package/lib/component/modal/SaveAsModal.js.map +1 -1
  35. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.d.ts.map +1 -1
  36. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +17 -1
  37. package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js.map +1 -1
  38. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts +6 -0
  39. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts.map +1 -0
  40. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js +87 -0
  41. package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js.map +1 -0
  42. package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts.map +1 -1
  43. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +18 -26
  44. package/lib/component/panels/MoleculesPanel/MoleculePanel.js.map +1 -1
  45. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
  46. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +36 -31
  47. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
  48. package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts +13 -0
  49. package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -0
  50. package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +66 -0
  51. package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -0
  52. package/lib/component/panels/MoleculesPanel/{useAtomAssignment.d.ts → hooks/useAtomAssignment.d.ts} +1 -1
  53. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -0
  54. package/lib/component/panels/MoleculesPanel/{useAtomAssignment.js → hooks/useAtomAssignment.js} +32 -16
  55. package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -0
  56. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts +12 -0
  57. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts.map +1 -0
  58. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js +58 -0
  59. package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js.map +1 -0
  60. package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts +5 -0
  61. package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts.map +1 -0
  62. package/lib/component/panels/MoleculesPanel/utilities/AtomData.js +2 -0
  63. package/lib/component/panels/MoleculesPanel/utilities/AtomData.js.map +1 -0
  64. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts +16 -0
  65. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts.map +1 -0
  66. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js +47 -0
  67. package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js.map +1 -0
  68. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts +18 -0
  69. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -0
  70. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +31 -0
  71. package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -0
  72. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts +3 -0
  73. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts.map +1 -0
  74. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js +12 -0
  75. package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js.map +1 -0
  76. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts +4 -0
  77. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts.map +1 -0
  78. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js +25 -0
  79. package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js.map +1 -0
  80. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts +6 -0
  81. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts.map +1 -0
  82. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js +18 -0
  83. package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js.map +1 -0
  84. package/lib/component/panels/databasePanel/DatabaseInfo.d.ts +5 -0
  85. package/lib/component/panels/databasePanel/DatabaseInfo.d.ts.map +1 -0
  86. package/lib/component/panels/databasePanel/DatabaseInfo.js +29 -0
  87. package/lib/component/panels/databasePanel/DatabaseInfo.js.map +1 -0
  88. package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
  89. package/lib/component/panels/databasePanel/DatabaseTable.js +21 -3
  90. package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
  91. package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts +9 -0
  92. package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts.map +1 -0
  93. package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +27 -0
  94. package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -0
  95. package/lib/component/panels/informationPanel/InformationEditionModal.js +1 -1
  96. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  97. package/lib/component/reducer/IgnoreActions.d.ts.map +1 -1
  98. package/lib/component/reducer/IgnoreActions.js +2 -1
  99. package/lib/component/reducer/IgnoreActions.js.map +1 -1
  100. package/lib/component/reducer/Reducer.d.ts +11 -5
  101. package/lib/component/reducer/Reducer.d.ts.map +1 -1
  102. package/lib/component/reducer/Reducer.js +8 -3
  103. package/lib/component/reducer/Reducer.js.map +1 -1
  104. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  105. package/lib/component/reducer/actions/DatabaseActions.js +4 -2
  106. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  107. package/lib/component/reducer/actions/LoadAction.d.ts +7 -4
  108. package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
  109. package/lib/component/reducer/actions/LoadAction.js +35 -26
  110. package/lib/component/reducer/actions/LoadAction.js.map +1 -1
  111. package/lib/component/reducer/actions/MoleculeActions.d.ts +20 -5
  112. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  113. package/lib/component/reducer/actions/MoleculeActions.js +42 -28
  114. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  115. package/lib/component/reducer/actions/RangesActions.d.ts +10 -4
  116. package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
  117. package/lib/component/reducer/actions/RangesActions.js +24 -3
  118. package/lib/component/reducer/actions/RangesActions.js.map +1 -1
  119. package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
  120. package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
  121. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts +4 -0
  122. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts.map +1 -0
  123. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js +7 -0
  124. package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js.map +1 -0
  125. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -1
  126. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
  127. package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -2
  128. package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
  129. package/lib/component/reducer/preferences/preferencesReducer.js +3 -0
  130. package/lib/component/reducer/preferences/preferencesReducer.js.map +1 -1
  131. package/lib/component/toolbar/ToolBar.d.ts.map +1 -1
  132. package/lib/component/toolbar/ToolBar.js +5 -1
  133. package/lib/component/toolbar/ToolBar.js.map +1 -1
  134. package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
  135. package/lib/component/toolbar/ToolTypes.js +2 -1
  136. package/lib/component/toolbar/ToolTypes.js.map +1 -1
  137. package/lib/component/utility/filterDatabaseInfoEntry.d.ts +3 -0
  138. package/lib/component/utility/filterDatabaseInfoEntry.d.ts.map +1 -0
  139. package/lib/component/utility/filterDatabaseInfoEntry.js +9 -0
  140. package/lib/component/utility/filterDatabaseInfoEntry.js.map +1 -0
  141. package/lib/component/workspaces/assignment.d.ts.map +1 -1
  142. package/lib/component/workspaces/assignment.js +7 -0
  143. package/lib/component/workspaces/assignment.js.map +1 -1
  144. package/lib/component/workspaces/basic.d.ts.map +1 -1
  145. package/lib/component/workspaces/basic.js +5 -0
  146. package/lib/component/workspaces/basic.js.map +1 -1
  147. package/lib/component/workspaces/embedded.d.ts.map +1 -1
  148. package/lib/component/workspaces/embedded.js +5 -0
  149. package/lib/component/workspaces/embedded.js.map +1 -1
  150. package/lib/component/workspaces/exercise.d.ts.map +1 -1
  151. package/lib/component/workspaces/exercise.js +5 -0
  152. package/lib/component/workspaces/exercise.js.map +1 -1
  153. package/lib/component/workspaces/prediction.d.ts.map +1 -1
  154. package/lib/component/workspaces/prediction.js +6 -1
  155. package/lib/component/workspaces/prediction.js.map +1 -1
  156. package/lib/component/workspaces/process1D.d.ts.map +1 -1
  157. package/lib/component/workspaces/process1D.js +6 -0
  158. package/lib/component/workspaces/process1D.js.map +1 -1
  159. package/lib/component/workspaces/simulation.js +1 -1
  160. package/lib/component/workspaces/simulation.js.map +1 -1
  161. package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
  162. package/lib/component/workspaces/workspaceDefaultProperties.js +19 -1
  163. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  164. package/lib/data/SpectraManager.d.ts +1 -1
  165. package/lib/data/SpectraManager.d.ts.map +1 -1
  166. package/lib/data/SpectraManager.js.map +1 -1
  167. package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +0 -1
  168. package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts.map +1 -1
  169. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +17 -16
  170. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
  171. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
  172. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +2 -1
  173. package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
  174. package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +0 -1
  175. package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
  176. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +7 -6
  177. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  178. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
  179. package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
  180. package/lib/data/molecules/Molecule.d.ts +1 -17
  181. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  182. package/lib/data/molecules/Molecule.js +3 -7
  183. package/lib/data/molecules/Molecule.js.map +1 -1
  184. package/lib/data/molecules/MoleculeManager.d.ts +3 -2
  185. package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
  186. package/lib/data/molecules/MoleculeManager.js +31 -7
  187. package/lib/data/molecules/MoleculeManager.js.map +1 -1
  188. package/lib/utils/clipboard/clipboardHooks.js +4 -4
  189. package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
  190. package/lib/versionInfo.js +1 -1
  191. package/package.json +30 -29
  192. package/src/component/1d/ranges/Atoms.tsx +36 -13
  193. package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +38 -79
  194. package/src/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.tsx +5 -2
  195. package/src/component/2d/useTracesSpectra.ts +2 -0
  196. package/src/component/2d/zones/SignalsGuideLines.tsx +1 -1
  197. package/src/component/EventsTrackers/KeysListenerTracker.tsx +6 -0
  198. package/src/component/hooks/useExport.tsx +1 -1
  199. package/src/component/loader/useLoadFiles.ts +19 -7
  200. package/src/component/main/NMRiumStateProvider.tsx +2 -3
  201. package/src/component/modal/LoadJCAMPModal.tsx +10 -4
  202. package/src/component/modal/MoleculeStructureEditorModal.tsx +10 -3
  203. package/src/component/modal/MultipletAnalysisModal.tsx +1 -1
  204. package/src/component/modal/SaveAsModal.tsx +8 -2
  205. package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +17 -1
  206. package/src/component/panels/MoleculesPanel/MoleculeOptionsPanel.tsx +160 -0
  207. package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +77 -101
  208. package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +63 -42
  209. package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +117 -0
  210. package/src/component/panels/MoleculesPanel/{useAtomAssignment.tsx → hooks/useAtomAssignment.tsx} +47 -25
  211. package/src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts +74 -0
  212. package/src/component/panels/MoleculesPanel/utilities/AtomData.ts +4 -0
  213. package/src/component/panels/MoleculesPanel/utilities/extractFromAtom.ts +63 -0
  214. package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +59 -0
  215. package/src/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.ts +12 -0
  216. package/src/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.ts +36 -0
  217. package/src/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.ts +20 -0
  218. package/src/component/panels/databasePanel/DatabaseInfo.tsx +43 -0
  219. package/src/component/panels/databasePanel/DatabaseTable.tsx +33 -1
  220. package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +36 -0
  221. package/src/component/panels/informationPanel/InformationEditionModal.tsx +2 -0
  222. package/src/component/reducer/IgnoreActions.ts +2 -1
  223. package/src/component/reducer/Reducer.ts +21 -8
  224. package/src/component/reducer/actions/DatabaseActions.ts +4 -2
  225. package/src/component/reducer/actions/LoadAction.ts +51 -38
  226. package/src/component/reducer/actions/MoleculeActions.ts +85 -37
  227. package/src/component/reducer/actions/RangesActions.ts +50 -5
  228. package/src/component/reducer/actions/ZonesActions.ts +1 -1
  229. package/src/component/reducer/preferences/actions/changeDefaultMoleculeSettings.ts +16 -0
  230. package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +1 -1
  231. package/src/component/reducer/preferences/preferencesReducer.ts +11 -1
  232. package/src/component/toolbar/ToolBar.tsx +6 -1
  233. package/src/component/toolbar/ToolTypes.ts +2 -1
  234. package/src/component/utility/filterDatabaseInfoEntry.ts +10 -0
  235. package/src/component/workspaces/assignment.ts +7 -0
  236. package/src/component/workspaces/basic.ts +5 -0
  237. package/src/component/workspaces/embedded.ts +5 -0
  238. package/src/component/workspaces/exercise.ts +5 -0
  239. package/src/component/workspaces/prediction.ts +6 -1
  240. package/src/component/workspaces/process1D.ts +6 -0
  241. package/src/component/workspaces/simulation.ts +1 -1
  242. package/src/component/workspaces/workspaceDefaultProperties.ts +19 -1
  243. package/src/data/SpectraManager.ts +1 -7
  244. package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +17 -19
  245. package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +2 -1
  246. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +7 -10
  247. package/src/data/molecules/Molecule.ts +5 -25
  248. package/src/data/molecules/MoleculeManager.ts +40 -8
  249. package/src/index.tsx +0 -3
  250. package/src/utils/clipboard/clipboardHooks.ts +6 -6
  251. package/src/versionInfo.ts +1 -1
  252. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +0 -43
  253. package/lib/component/panels/MoleculesPanel/Utilities.d.ts.map +0 -1
  254. package/lib/component/panels/MoleculesPanel/Utilities.js +0 -129
  255. package/lib/component/panels/MoleculesPanel/Utilities.js.map +0 -1
  256. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts.map +0 -1
  257. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js.map +0 -1
  258. package/src/component/panels/MoleculesPanel/Utilities.ts +0 -188
@@ -1 +1 @@
1
- {"version":3,"file":"clipboardHooks.js","sourceRoot":"","sources":["../../../src/utils/clipboard/clipboardHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,GACV,MAAM,gBAAgB,CAAC;AA6DxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAEjD,CAAC;IACJ,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAsB,CAAC;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAsB,CAAC;IACzD,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC3C,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC7B,OAAO,CAAC,SAAS,CAAC,CAAC;QACnB,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,CAAC,IAAI;YACR,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,EAAE,CAAC;YACt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BAAiB,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QACD,KAAK,CAAC,SAAS,CAAC,IAAY;YAC1B,IAAI,CAAC;gBACH,OAAO,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,IAAI,CAAC,CAAC;gBACd,iBAAiB,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;KACF,CAAC,EACF,EAAE,CACH,CAAC;IAEF,OAAO;QACL,GAAG,YAAY;QACf,cAAc;QACd,IAAI;QACJ,KAAK;QACL,mBAAmB;KACpB,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- export default { version: 'v1.7.0' };
1
+ export default { version: 'v1.9.0' };
2
2
  //# sourceMappingURL=versionInfo.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nmrium",
3
3
  "description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
4
- "version": "1.7.0",
4
+ "version": "1.9.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
@@ -68,11 +68,11 @@
68
68
  "@emotion/react": "^11.14.0",
69
69
  "@emotion/styled": "^11.14.1",
70
70
  "@hookform/resolvers": "^5.2.2",
71
- "@zakodium/nmr-types": "^0.4.0",
72
- "@zakodium/nmrium-core": "^0.4.3",
73
- "@zakodium/nmrium-core-plugins": "^0.6.0",
71
+ "@zakodium/nmr-types": "^0.4.3",
72
+ "@zakodium/nmrium-core": "^0.4.10",
73
+ "@zakodium/nmrium-core-plugins": "^0.6.12",
74
74
  "@zakodium/pdnd-esm": "^1.0.2",
75
- "@zip.js/zip.js": "^2.8.8",
75
+ "@zip.js/zip.js": "^2.8.11",
76
76
  "cheminfo-font": "^1.13.1",
77
77
  "cheminfo-types": "^1.8.1",
78
78
  "clipboard-polyfill": "^4.1.1",
@@ -82,32 +82,33 @@
82
82
  "dlv": "^1.1.3",
83
83
  "eventemitter3": "^5.0.1",
84
84
  "fifo-logger": "^2.0.1",
85
- "file-collection": "^6.0.0",
85
+ "file-collection": "^6.3.0",
86
86
  "file-saver": "^2.0.5",
87
+ "get-jpaths": "^1.1.0",
87
88
  "immer": "^10.2.0",
88
89
  "lodash": "^4.17.21",
89
90
  "mf-parser": "^3.6.0",
90
91
  "ml-array-mean": "^1.1.6",
91
92
  "ml-array-median": "^1.1.6",
92
93
  "ml-conrec": "^5.0.3",
93
- "ml-gsd": "^13.1.0",
94
+ "ml-gsd": "^13.1.1",
94
95
  "ml-signal-processing": "^2.1.0",
95
- "ml-spectra-processing": "^14.18.0",
96
+ "ml-spectra-processing": "^14.18.1",
96
97
  "ml-tree-similarity": "^2.2.0",
97
98
  "nmr-correlation": "2.3.3",
98
- "nmr-processing": "^21.0.0",
99
+ "nmr-processing": "^21.2.0",
99
100
  "numeral": "^2.0.6",
100
- "openchemlib": "^9.15.0",
101
- "openchemlib-utils": "^8.7.0",
101
+ "openchemlib": "^9.18.1",
102
+ "openchemlib-utils": "^8.8.1",
102
103
  "papaparse": "^5.5.3",
103
104
  "react-d3-utils": "^3.1.2",
104
105
  "react-dropzone": "^14.3.8",
105
106
  "react-error-boundary": "^6.0.0",
106
- "react-hook-form": "^7.65.0",
107
+ "react-hook-form": "^7.66.1",
107
108
  "react-icons": "^5.5.0",
108
109
  "react-inspector": "^9.0.0",
109
110
  "react-mf": "^3.1.1",
110
- "react-ocl": "^8.3.0",
111
+ "react-ocl": "^8.4.0",
111
112
  "react-ocl-nmr": "^4.1.1",
112
113
  "react-plot": "^3.1.1",
113
114
  "react-rnd": "^10.5.2",
@@ -117,9 +118,9 @@
117
118
  "yup": "^1.7.1"
118
119
  },
119
120
  "devDependencies": {
120
- "@blueprintjs/core": "^6.3.2",
121
- "@blueprintjs/icons": "^6.2.0",
122
- "@blueprintjs/select": "^6.0.6",
121
+ "@blueprintjs/core": "^6.3.4",
122
+ "@blueprintjs/icons": "^6.3.1",
123
+ "@blueprintjs/select": "^6.0.8",
123
124
  "@playwright/test": "^1.56.1",
124
125
  "@simbathesailor/use-what-changed": "^2.0.0",
125
126
  "@types/d3-array": "^3.2.2",
@@ -128,21 +129,21 @@
128
129
  "@types/dlv": "^1.1.5",
129
130
  "@types/file-saver": "^2.0.7",
130
131
  "@types/lodash": "^4.17.20",
131
- "@types/node": "^24.9.2",
132
+ "@types/node": "^24.10.1",
132
133
  "@types/numeral": "^2.0.5",
133
- "@types/papaparse": "^5.3.16",
134
+ "@types/papaparse": "^5.5.0",
134
135
  "@types/react": "^18.3.13",
135
136
  "@types/react-dom": "^18.3.1",
136
137
  "@types/react-table": "^7.7.20",
137
- "@vitejs/plugin-react": "^5.1.0",
138
- "@vitest/coverage-v8": "^4.0.5",
138
+ "@vitejs/plugin-react": "^5.1.1",
139
+ "@vitest/coverage-v8": "^4.0.12",
139
140
  "@zakodium/tsconfig": "^1.0.2",
140
141
  "cross-env": "^10.1.0",
141
- "cspell": "^9.2.2",
142
- "eslint": "^9.38.0",
143
- "eslint-config-cheminfo-react": "^18.0.1",
144
- "eslint-config-cheminfo-typescript": "^20.0.0",
145
- "knip": "^5.66.4",
142
+ "cspell": "^9.3.2",
143
+ "eslint": "^9.39.1",
144
+ "eslint-config-cheminfo-react": "^19.0.0",
145
+ "eslint-config-cheminfo-typescript": "^21.0.1",
146
+ "knip": "^5.70.1",
146
147
  "modern-normalize": "^3.0.1",
147
148
  "postcss": "^8.5.6",
148
149
  "postcss-styled-syntax": "^0.7.1",
@@ -150,15 +151,15 @@
150
151
  "rc-menu": "^9.16.1",
151
152
  "react": "^18.3.1",
152
153
  "react-dom": "^18.3.1",
153
- "react-router-dom": "^7.9.5",
154
- "rimraf": "^6.1.0",
154
+ "react-router-dom": "^7.9.6",
155
+ "rimraf": "^6.1.2",
155
156
  "rollup-plugin-analyzer": "^4.0.0",
156
157
  "serve": "^14.2.5",
157
158
  "stylelint": "^16.25.0",
158
159
  "stylelint-config-standard": "^39.0.1",
159
160
  "typescript": "~5.9.3",
160
- "vite": "^7.1.12",
161
- "vitest": "^4.0.5"
161
+ "vite": "^7.2.4",
162
+ "vitest": "^4.0.12"
162
163
  },
163
164
  "volta": {
164
165
  "node": "24.11.0"
@@ -1,4 +1,5 @@
1
1
  import type { Range } from '@zakodium/nmr-types';
2
+ import type { MoleculesView } from '@zakodium/nmrium-core';
2
3
 
3
4
  import { useChartData } from '../../context/ChartContext.js';
4
5
  import { useTopicMolecule } from '../../context/TopicMoleculeContext.js';
@@ -19,24 +20,48 @@ function getDiaIds(range: Range) {
19
20
  return ids;
20
21
  }
21
22
 
22
- function useAtoms(range: Range) {
23
+ function useAtoms(range: Range, moleculesView: MoleculesView) {
23
24
  const topicMolecule = useTopicMolecule();
24
25
  const diaIDs = getDiaIds(range);
25
- const atomsList: Array<{ id: string; atoms: number[] }> = [];
26
+ const atomsList: Array<{ id: string; atoms: Array<string | number> }> = [];
26
27
 
27
28
  for (const [id, topicMoleculeObject] of Object.entries(topicMolecule)) {
28
- const atoms: number[] = [];
29
+ const atoms: Array<string | number> = [];
29
30
  const diaIDsObject = topicMoleculeObject.getDiaIDsObject();
30
- if (diaIDsObject) {
31
- for (const id of diaIDs) {
32
- const existingAtoms = diaIDsObject[id]?.existingAtoms;
33
- if (existingAtoms?.length > 0) {
34
- atoms.push(...existingAtoms);
35
- }
31
+
32
+ if (!diaIDsObject || !(id in moleculesView)) continue;
33
+
34
+ const { atomAnnotation } = moleculesView[id];
35
+ for (const id of diaIDs) {
36
+ if (!(id in diaIDsObject)) continue;
37
+
38
+ const {
39
+ existingAtoms = [],
40
+ customLabels = [],
41
+ heavyAtomsCustomLabels = [],
42
+ } = diaIDsObject[id];
43
+
44
+ if (atomAnnotation === 'atom-numbers') {
45
+ atoms.push(...existingAtoms);
46
+ }
47
+
48
+ if (atomAnnotation === 'custom-labels') {
49
+ const labels =
50
+ customLabels.length > 0 ? customLabels : heavyAtomsCustomLabels;
51
+ atoms.push(...labels);
36
52
  }
37
53
  }
54
+
38
55
  if (atoms.length > 0) {
39
- atoms.sort((a, b) => a - b);
56
+ atoms.sort((a, b) => {
57
+ if (typeof a === 'number' && typeof b === 'number') {
58
+ return a - b;
59
+ }
60
+ if (typeof a === 'string' && typeof b === 'string') {
61
+ return a.localeCompare(b);
62
+ }
63
+ return 0;
64
+ });
40
65
  atomsList.push({
41
66
  id,
42
67
  atoms: Array.from(new Set(atoms)),
@@ -56,9 +81,7 @@ export function Atoms(props: AtomsProps) {
56
81
  const {
57
82
  view: { molecules },
58
83
  } = useChartData();
59
- const atomsList = useAtoms(range).filter(
60
- (atomsList) => molecules?.[atomsList.id]?.showAtomNumber,
61
- );
84
+ const atomsList = useAtoms(range, molecules);
62
85
 
63
86
  return (
64
87
  <SVGGroup
@@ -1,33 +1,26 @@
1
1
  import styled from '@emotion/styled';
2
+ import type { MoleculeView } from '@zakodium/nmrium-core';
2
3
  import { useEffect, useState } from 'react';
3
4
  import { ResponsiveChart } from 'react-d3-utils';
4
5
  import { BsArrowsMove } from 'react-icons/bs';
5
- import { FaTimes } from 'react-icons/fa';
6
- import type { MolfileSvgRendererProps } from 'react-ocl';
7
- import { MolfileSvgRenderer } from 'react-ocl';
8
- import OCLnmr from 'react-ocl-nmr';
6
+ import { FaRegBookmark, FaTimes } from 'react-icons/fa';
7
+ import { MdFormatColorText, MdNumbers } from 'react-icons/md';
9
8
  import { Rnd } from 'react-rnd';
10
9
 
11
10
  import type {
12
11
  MoleculeBoundingRect,
13
- MoleculeView,
14
12
  StateMoleculeExtended,
15
13
  } from '../../../../data/molecules/Molecule.js';
16
14
  import { useDispatch } from '../../../context/DispatchContext.js';
17
15
  import { useGlobal } from '../../../context/GlobalContext.js';
18
16
  import type { ActionsButtonsPopoverProps } from '../../../elements/ActionsButtonsPopover.js';
19
17
  import { ActionsButtonsPopover } from '../../../elements/ActionsButtonsPopover.js';
20
- import { useHighlightColor } from '../../../hooks/useHighlightColor.js';
21
18
  import { useSVGUnitConverter } from '../../../hooks/useSVGUnitConverter.js';
22
19
  import { useCheckExportStatus } from '../../../hooks/useViewportSize.js';
23
20
  import { useMoleculeEditor } from '../../../modal/MoleculeStructureEditorModal.js';
24
- import useAtomAssignment from '../../../panels/MoleculesPanel/useAtomAssignment.js';
25
-
26
- interface DraggableMoleculeProps extends DraggableStructureProps {
27
- width: number;
28
- height: number;
29
- renderAsSVG?: boolean;
30
- }
21
+ import { MoleculeStructure } from '../../../panels/MoleculesPanel/MoleculeStructure.tsx';
22
+ import { useMoleculeAnnotationCore } from '../../../panels/hooks/useMoleculeAnnotationCore.ts';
23
+ import { booleanToString } from '../../../utility/booleanToString.ts';
31
24
 
32
25
  interface DraggableStructureProps {
33
26
  moleculeView: MoleculeView;
@@ -103,6 +96,12 @@ export function DraggableStructure(props: DraggableStructureProps) {
103
96
  return { x: pixelToPercent(x, 'x'), y: pixelToPercent(y, 'y') };
104
97
  }
105
98
 
99
+ const {
100
+ handleChangeAtomAnnotation,
101
+ isAnnotation,
102
+ handleToggleMoleculeLabel,
103
+ } = useMoleculeAnnotationCore(molecule.id, moleculeView);
104
+
106
105
  if (!viewerRef) return null;
107
106
 
108
107
  const actionsButtons: ActionsButtonsPopoverProps['buttons'] = [
@@ -119,8 +118,31 @@ export function DraggableStructure(props: DraggableStructureProps) {
119
118
  title: 'Hide molecule',
120
119
  onClick: floatMoleculeHandler,
121
120
  },
121
+ {
122
+ elementType: 'separator',
123
+ },
124
+ {
125
+ icon: <MdFormatColorText />,
126
+ title: `${booleanToString(!moleculeView.showLabel)} molecule label`,
127
+ onClick: handleToggleMoleculeLabel,
128
+ active: moleculeView.showLabel,
129
+ },
130
+ {
131
+ elementType: 'separator',
132
+ },
133
+ {
134
+ icon: <MdNumbers />,
135
+ title: `${booleanToString(!isAnnotation('atom-numbers'))} atom number`,
136
+ onClick: () => handleChangeAtomAnnotation('atom-numbers'),
137
+ active: isAnnotation('atom-numbers'),
138
+ },
139
+ {
140
+ icon: <FaRegBookmark />,
141
+ title: `${booleanToString(!isAnnotation('custom-labels'))} custom labels`,
142
+ onClick: () => handleChangeAtomAnnotation('custom-labels'),
143
+ active: isAnnotation('custom-labels'),
144
+ },
122
145
  ];
123
-
124
146
  const { x: xInPercent, y: yInPercent, width, height } = bounding;
125
147
 
126
148
  const x = percentToPixel(xInPercent, 'x');
@@ -129,7 +151,7 @@ export function DraggableStructure(props: DraggableStructureProps) {
129
151
  if (isExportProcessStart) {
130
152
  return (
131
153
  <g transform={`translate(${x} ${y})`}>
132
- <DraggableMolecule renderAsSVG {...{ width, height }} {...props} />
154
+ <MoleculeStructure renderAsSVG {...{ width, height }} {...props} />
133
155
  </g>
134
156
  );
135
157
  }
@@ -176,7 +198,7 @@ export function DraggableStructure(props: DraggableStructureProps) {
176
198
  >
177
199
  <ResponsiveChart>
178
200
  {({ width, height }) => {
179
- return <DraggableMolecule {...{ width, height }} {...props} />;
201
+ return <MoleculeStructure {...{ width, height }} {...props} />;
180
202
  }}
181
203
  </ResponsiveChart>
182
204
  </div>
@@ -186,66 +208,3 @@ export function DraggableStructure(props: DraggableStructureProps) {
186
208
  </ReactRnd>
187
209
  );
188
210
  }
189
-
190
- function DraggableMolecule(props: DraggableMoleculeProps) {
191
- const {
192
- molecule,
193
- index,
194
- moleculeView,
195
- width,
196
- height,
197
- renderAsSVG = false,
198
- } = props;
199
- const {
200
- currentDiaIDsToHighlight,
201
- handleOnAtomHover,
202
- handleOnClickAtom,
203
- assignedDiaIDsMerged,
204
- } = useAtomAssignment();
205
- const highlightColor = useHighlightColor();
206
- const dispatch = useDispatch();
207
-
208
- const atomHighlightColor =
209
- currentDiaIDsToHighlight?.length > 0 ? '#ff000080' : highlightColor;
210
- const baseProps: MolfileSvgRendererProps = {
211
- id: `molSVG${index || ''}`,
212
- height,
213
- width,
214
- label: molecule.label,
215
- labelFontSize: 15,
216
- labelColor: 'rgb(0,0,0)',
217
- molfile: molecule.molfile,
218
- atomHighlightColor,
219
- atomHighlightOpacity: 1,
220
- showAtomNumber: moleculeView.showAtomNumber,
221
- noCarbonLabelWithCustomLabel: true,
222
- };
223
-
224
- if (renderAsSVG) {
225
- return <MolfileSvgRenderer {...baseProps} />;
226
- }
227
-
228
- return (
229
- <OCLnmr
230
- {...baseProps}
231
- setSelectedAtom={handleOnClickAtom}
232
- highlights={
233
- currentDiaIDsToHighlight?.length > 0
234
- ? currentDiaIDsToHighlight
235
- : assignedDiaIDsMerged
236
- }
237
- atomHighlightStrategy="prefer-editor-props"
238
- setHoverAtom={handleOnAtomHover}
239
- setMolfile={(molfile) => {
240
- dispatch({
241
- type: 'SET_MOLECULE',
242
- payload: {
243
- molfile,
244
- id: molecule.id,
245
- label: molecule.label,
246
- },
247
- });
248
- }}
249
- />
250
- );
251
- }
@@ -1,10 +1,13 @@
1
1
  import type { Ranges, Zones } from '@zakodium/nmr-types';
2
- import type { Spectrum1D, Spectrum2D } from '@zakodium/nmrium-core';
2
+ import type {
3
+ MoleculeView,
4
+ Spectrum1D,
5
+ Spectrum2D,
6
+ } from '@zakodium/nmrium-core';
3
7
  import { memo } from 'react';
4
8
  import { assert } from 'react-science/ui';
5
9
 
6
10
  import type {
7
- MoleculeView,
8
11
  MoleculesView,
9
12
  StateMoleculeExtended,
10
13
  } from '../../../../data/molecules/Molecule.js';
@@ -43,6 +43,8 @@ export function useTracesSpectra() {
43
43
  } = useChartData();
44
44
 
45
45
  return useMemo(() => {
46
+ if (!activeTab) return [];
47
+
46
48
  const nuclei = activeTab.split(',');
47
49
 
48
50
  if (nuclei.length !== 2) return [];
@@ -258,7 +258,7 @@ function IndicationLine(props: IndicationLineProps) {
258
258
 
259
259
  function assignHandler() {
260
260
  isAssignBtnTrigged.current = true;
261
- assignmentContext.activate('x');
261
+ assignmentContext.activate(axis);
262
262
  }
263
263
 
264
264
  function unAssignHandler() {
@@ -360,6 +360,12 @@ function KeysListenerTracker(props: KeysListenerTrackerProps) {
360
360
 
361
361
  break;
362
362
  }
363
+ case 'm': {
364
+ if (isToolVisible('multipleSpectraAnalysis')) {
365
+ handleChangeOption(options.multipleSpectraAnalysis.id);
366
+ }
367
+ break;
368
+ }
363
369
  case 't': {
364
370
  if (isToolVisible('fft')) {
365
371
  dispatch({
@@ -94,7 +94,7 @@ export function useExport() {
94
94
  const archive = await core.serializeNmriumArchive({
95
95
  molecules: state.molecules,
96
96
  spectra: state.data,
97
- fileCollections: state.fileCollections,
97
+ aggregator: state.aggregator,
98
98
  includeData: options.include.dataType === 'SELF_CONTAINED',
99
99
  serializedState: blob,
100
100
  });
@@ -40,24 +40,30 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
40
40
  let nmriumState: Partial<NmriumState>;
41
41
  let containsNmrium: boolean;
42
42
  let parseMetaFileResult: ParseResult<any> | null = null;
43
- const { onLoadProcessing, spectraColors } = workspacePreferences;
44
- const { nmrLoaders: sourceSelector } = preferences.current;
43
+ const { onLoadProcessing, spectraColors, defaultMoleculeSettings } =
44
+ workspacePreferences;
45
+ const { nmrLoaders: selector } = preferences.current;
45
46
 
46
47
  const parsingOptions: Partial<ParsingOptions> = {
47
- sourceSelector,
48
+ selector,
48
49
  logger: logger.child({ context: 'nmr-processing' }),
49
50
  onLoadProcessing,
50
51
  experimentalFeatures,
51
52
  };
52
53
 
54
+ let aggregator: FileCollection | undefined;
53
55
  let fileCollection: FileCollection | undefined;
54
- let fileCollections: Map<string, FileCollection> | undefined;
56
+ let selectorRoot: string | undefined;
57
+ let resetSourceObject = false;
58
+
55
59
  if (files.length === 1 && files[0].name.endsWith('.nmrium.zip')) {
56
- [nmriumState, fileCollections] = await core.readNMRiumArchive(
60
+ const [state, ium] = await core.readNMRiumArchive(
57
61
  files[0].stream(),
58
62
  parsingOptions,
59
63
  );
64
+ nmriumState = state;
60
65
  containsNmrium = true;
66
+ aggregator = ium;
61
67
  } else {
62
68
  for (const file of files) {
63
69
  if (file.name.endsWith('.nmrium.zip')) {
@@ -84,10 +90,13 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
84
90
  if (metaFile) {
85
91
  parseMetaFileResult = await parseMetaFile(metaFile);
86
92
  }
87
- ({ nmriumState, containsNmrium } = await core.read(
93
+ ({ nmriumState, containsNmrium, selectorRoot } = await core.read(
88
94
  fileCollection,
89
95
  parsingOptions,
90
96
  ));
97
+ if (containsNmrium) {
98
+ resetSourceObject = true;
99
+ }
91
100
  }
92
101
 
93
102
  if (nmriumState.settings) {
@@ -106,8 +115,11 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
106
115
  containsNmrium,
107
116
  parseMetaFileResult,
108
117
  spectraColors,
118
+ aggregator,
109
119
  fileCollection,
110
- fileCollections,
120
+ selectorRoot,
121
+ resetSourceObject,
122
+ defaultMoleculeSettings,
111
123
  },
112
124
  });
113
125
  }
@@ -78,7 +78,6 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
78
78
  sources,
79
79
  view,
80
80
  actionType,
81
- fileCollections: {},
82
81
  },
83
82
  { current: workspaces[workspace.current] },
84
83
  { serialize: false, exportTarget: 'onChange' },
@@ -120,7 +119,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
120
119
  void core
121
120
  .readNMRiumObject(nmriumData)
122
121
  .then((result) => {
123
- const [nmriumState, fileCollections] = result;
122
+ const [nmriumState, aggregator] = result;
124
123
  if (nmriumState?.settings) {
125
124
  dispatchPreferences({
126
125
  type: 'SET_WORKSPACE',
@@ -132,7 +131,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
132
131
  }
133
132
  dispatch({
134
133
  type: 'INITIATE',
135
- payload: { nmriumState, fileCollections },
134
+ payload: { nmriumState, aggregator },
136
135
  });
137
136
  })
138
137
  .catch((error: unknown) => {
@@ -66,13 +66,19 @@ function InnerLoadJCAMPModal({ onCloseDialog }: InnerLoadJCAMPModalProps) {
66
66
  });
67
67
  const { pathname, origin } = new URL(url);
68
68
  try {
69
- const [nmriumState, fileCollection] = await core.readFromWebSource({
70
- entries: [{ relativePath: pathname, baseURL: origin }],
71
- });
69
+ const [nmriumState, fileCollection, selectorRoot] =
70
+ await core.readFromWebSource({
71
+ entries: [{ relativePath: pathname, baseURL: origin }],
72
+ });
72
73
 
73
74
  dispatch({
74
75
  type: 'LOAD_DROP_FILES',
75
- payload: { nmriumState, resetSourceObject: false, fileCollection },
76
+ payload: {
77
+ nmriumState,
78
+ resetSourceObject: false,
79
+ fileCollection,
80
+ selectorRoot,
81
+ },
76
82
  });
77
83
  } catch {
78
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) {
@@ -92,6 +97,7 @@ function MoleculeStructureEditorModal(
92
97
  payload: {
93
98
  molfile,
94
99
  floatMoleculeOnSave,
100
+ defaultMoleculeSettings,
95
101
  },
96
102
  });
97
103
  onClose('new');
@@ -102,8 +108,9 @@ function MoleculeStructureEditorModal(
102
108
  selectedMolecule,
103
109
  initialEnhancedMolfile,
104
110
  dispatch,
105
- floatMoleculeOnSave,
106
111
  onClose,
112
+ floatMoleculeOnSave,
113
+ defaultMoleculeSettings,
107
114
  ]);
108
115
 
109
116
  return (
@@ -132,7 +139,7 @@ function MoleculeStructureEditorModal(
132
139
  );
133
140
  }
134
141
 
135
- export function useMoleculeEditor(floatMoleculeOnSave = false) {
142
+ export function useMoleculeEditor(floatMoleculeOnSave?: boolean) {
136
143
  const [isOpen, openModal, closeModal] = useOnOff(false);
137
144
  const [molecule, setMolecule] = useState<StateMoleculeExtended | undefined>();
138
145
  const modal = (
@@ -151,7 +151,7 @@ function InnerMultipleAnalysis(props: InnerMultipleAnalysisProps) {
151
151
  frequency: info.originFrequency,
152
152
  minimalResolution: 0.1,
153
153
  critFoundJ: 0.75,
154
- maxTestedJ: 17,
154
+ maxTestedJ: 25,
155
155
  minTestedJ: 1,
156
156
  checkSymmetryFirst: false,
157
157
  takeBestPartMultiplet: true,
@@ -5,6 +5,7 @@ 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';
@@ -58,7 +59,7 @@ function SaveAsModal(props: SaveAsModalProps) {
58
59
  }
59
60
  function InnerSaveAsModal(props: InnerSaveAsModalProps) {
60
61
  const { onCloseDialog } = props;
61
- const { sources, data } = useChartData();
62
+ const { sources, data, aggregator } = useChartData();
62
63
  const { saveHandler } = useExport();
63
64
  const experimentalFlagEnabled = useCheckExperimentalFeature();
64
65
 
@@ -72,6 +73,11 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
72
73
  const { handleSubmit, control, register } = useForm({
73
74
  defaultValues: { ...INITIAL_VALUE, name: fileName },
74
75
  });
76
+
77
+ const containsLinkedFiles = useMemo(() => {
78
+ return aggregator.sources.some((s) => !s.baseURL?.startsWith('ium:'));
79
+ }, [aggregator]);
80
+
75
81
  return (
76
82
  <Dialog
77
83
  isOpen
@@ -129,7 +135,7 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
129
135
  {experimentalFlagEnabled && (
130
136
  <Radio
131
137
  label="Full data (external data linked, experimental)"
132
- disabled={Object.keys(sources).length === 0}
138
+ disabled={!containsLinkedFiles}
133
139
  value={
134
140
  DataExportOptions.SELF_CONTAINED_EXTERNAL_DATASOURCE
135
141
  }