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
@@ -3,6 +3,7 @@ import type {
3
3
  CustomWorkspaces,
4
4
  ExportPreferences,
5
5
  ExportSettings,
6
+ MoleculeView,
6
7
  MultipleSpectraAnalysisPreferences,
7
8
  NMRiumPanelPreferences,
8
9
  PanelPreferencesType,
@@ -30,6 +31,7 @@ import {
30
31
  setSpectraAnalysisPanelsPreferences,
31
32
  } from './actions/analyzeSpectra.js';
32
33
  import { applyGeneralPreferences } from './actions/applyGeneralPreferences.js';
34
+ import { changeDefaultMoleculeSettings } from './actions/changeDefaultMoleculeSettings.ts';
33
35
  import { changeExportAcsSettings } from './actions/changeExportAcsSettings.ts';
34
36
  import { changeExportSettings } from './actions/changeExportSettings.js';
35
37
  import { changeInformationBlockPosition } from './actions/changeInformationBlockPosition.js';
@@ -170,6 +172,11 @@ export type TogglePanelAction = ActionType<
170
172
  }
171
173
  >;
172
174
 
175
+ export type ChangeDefaultMoleculeSettingsAction = ActionType<
176
+ 'CHANGE_DEFAULT_MOLECULE_SETTINGS',
177
+ MoleculeView
178
+ >;
179
+
173
180
  export type PreferencesActions =
174
181
  | InitPreferencesAction
175
182
  | SetPreferencesAction
@@ -190,7 +197,8 @@ export type PreferencesActions =
190
197
  | ChangeExportSettingsAction
191
198
  | ChangePeaksLabelPositionAction
192
199
  | TogglePanelAction
193
- | ChangeExportACSSettingsAction;
200
+ | ChangeExportACSSettingsAction
201
+ | ChangeDefaultMoleculeSettingsAction;
194
202
 
195
203
  export type WorkspaceWithSource = Workspace & { source: WorkSpaceSource };
196
204
  type WorkspacesWithSource = Record<string, WorkspaceWithSource>;
@@ -314,6 +322,8 @@ function innerPreferencesReducer(
314
322
  return togglePanel(draft, action);
315
323
  case 'CHANGE_EXPORT_ACS_SETTINGS':
316
324
  return changeExportAcsSettings(draft, action);
325
+ case 'CHANGE_DEFAULT_MOLECULE_SETTINGS':
326
+ return changeDefaultMoleculeSettings(draft, action);
317
327
 
318
328
  default:
319
329
  return draft;
@@ -296,7 +296,12 @@ export default function ToolBar() {
296
296
  },
297
297
  {
298
298
  id: 'multipleSpectraAnalysis',
299
- tooltip: options.multipleSpectraAnalysis.label,
299
+ tooltip: {
300
+ title: options.multipleSpectraAnalysis.label,
301
+ shortcuts: ['m'],
302
+ description:
303
+ 'Integrate multiple spectra at once and adjust integration zones by dragging their edges.',
304
+ },
300
305
  icon: <SvgNmrMultipleAnalysis />,
301
306
  checkOptions: { checkSpectrumType: false },
302
307
  isVisible: ftCounter > 0,
@@ -227,7 +227,7 @@ export const options: RecordOptions = {
227
227
  },
228
228
  multipleSpectraAnalysis: {
229
229
  id: 'multipleSpectraAnalysis',
230
- label: 'Multiple spectra analysis',
230
+ label: 'Multiple spectra integration',
231
231
  hasOptionPanel: false,
232
232
  isFilter: false,
233
233
  mode: '1D',
@@ -357,6 +357,7 @@ export const options: RecordOptions = {
357
357
  mode: '2D',
358
358
  spectraOptions: [
359
359
  {
360
+ info: [{ key: 'isFt', value: true }],
360
361
  active: true,
361
362
  },
362
363
  ],
@@ -0,0 +1,10 @@
1
+ import { getJPathsAsObject } from 'get-jpaths';
2
+ import type { DatabaseNMREntry } from 'nmr-processing';
3
+
4
+ export function filterDatabaseInfoEntry(input: DatabaseNMREntry) {
5
+ return getJPathsAsObject(input, {
6
+ maxArrayElements: 5,
7
+ maxDepth: 10,
8
+ includeJPathRegexps: [/^(smiles|names|meta)\./],
9
+ });
10
+ }
@@ -29,6 +29,13 @@ export const assignment: InnerWorkspace = {
29
29
  phaseCorrection: true,
30
30
  baselineCorrection: true,
31
31
  autoRangeAndZonePicking: true,
32
+ fftDimension1: true,
33
+ fftDimension2: true,
34
+ apodizationDimension1: true,
35
+ apodizationDimension2: true,
36
+ phaseCorrectionTwoDimensions: true,
37
+ zeroFillingDimension1: true,
38
+ zeroFillingDimension2: true,
32
39
  inset: true,
33
40
  },
34
41
  },
@@ -35,6 +35,11 @@ export const basic: InnerWorkspace = {
35
35
  autoRangeAndZonePicking: true,
36
36
  fftDimension1: true,
37
37
  fftDimension2: true,
38
+ apodizationDimension1: true,
39
+ apodizationDimension2: true,
40
+ phaseCorrectionTwoDimensions: true,
41
+ zeroFillingDimension1: true,
42
+ zeroFillingDimension2: true,
38
43
  inset: true,
39
44
  },
40
45
  },
@@ -46,6 +46,11 @@ export const embedded: InnerWorkspace = {
46
46
  autoRangeAndZonePicking: true,
47
47
  fftDimension1: true,
48
48
  fftDimension2: true,
49
+ apodizationDimension1: true,
50
+ apodizationDimension2: true,
51
+ phaseCorrectionTwoDimensions: true,
52
+ zeroFillingDimension1: true,
53
+ zeroFillingDimension2: true,
49
54
  inset: true,
50
55
  },
51
56
  },
@@ -26,6 +26,11 @@ export const exercise: InnerWorkspace = {
26
26
  spectraStackAlignments: true,
27
27
  fftDimension1: true,
28
28
  fftDimension2: true,
29
+ apodizationDimension1: true,
30
+ apodizationDimension2: true,
31
+ phaseCorrectionTwoDimensions: true,
32
+ zeroFillingDimension1: true,
33
+ zeroFillingDimension2: true,
29
34
  inset: true,
30
35
  },
31
36
  },
@@ -9,8 +9,8 @@ export const prediction: InnerWorkspace = {
9
9
  spectraRendering: 'auto',
10
10
  loggingLevel: 'info',
11
11
  popupLoggingLevel: 'error',
12
- invert: false,
13
12
  invertScroll: false,
13
+ invert: true,
14
14
  },
15
15
  display: {
16
16
  general: {
@@ -46,6 +46,11 @@ export const prediction: InnerWorkspace = {
46
46
  autoRangeAndZonePicking: true,
47
47
  fftDimension1: true,
48
48
  fftDimension2: true,
49
+ apodizationDimension1: true,
50
+ apodizationDimension2: true,
51
+ phaseCorrectionTwoDimensions: true,
52
+ zeroFillingDimension1: true,
53
+ zeroFillingDimension2: true,
49
54
  inset: true,
50
55
  },
51
56
  },
@@ -23,9 +23,15 @@ export const process1D: InnerWorkspace = {
23
23
  spectraCenterAlignments: true,
24
24
  peakPicking: true,
25
25
  apodization: true,
26
+ apodizationDimension1: true,
27
+ apodizationDimension2: true,
26
28
  zeroFilling: true,
29
+ zeroFillingDimension1: true,
30
+ zeroFillingDimension2: true,
31
+ zonePicking: true,
27
32
  fft: true,
28
33
  phaseCorrection: true,
34
+ phaseCorrectionTwoDimensions: true,
29
35
  baselineCorrection: true,
30
36
  exclusionZones: true,
31
37
  multipleSpectraAnalysis: true,
@@ -9,7 +9,7 @@ export const simulation: InnerWorkspace = {
9
9
  spectraRendering: 'auto',
10
10
  loggingLevel: 'info',
11
11
  popupLoggingLevel: 'error',
12
- invert: false,
12
+ invert: true,
13
13
  invertScroll: false,
14
14
  },
15
15
  display: {
@@ -60,6 +60,11 @@ export const workspaceDefaultProperties: Required<WorkspacePreferences> = {
60
60
  fftDimension1: false,
61
61
  fftDimension2: false,
62
62
  inset: false,
63
+ apodizationDimension1: false,
64
+ apodizationDimension2: false,
65
+ zeroFillingDimension1: false,
66
+ zeroFillingDimension2: false,
67
+ phaseCorrectionTwoDimensions: false,
63
68
  },
64
69
  },
65
70
 
@@ -70,7 +75,7 @@ export const workspaceDefaultProperties: Required<WorkspacePreferences> = {
70
75
  spectraRendering: 'auto',
71
76
  loggingLevel: 'info',
72
77
  popupLoggingLevel: 'error',
73
- invert: false,
78
+ invert: true,
74
79
  invertScroll: false,
75
80
  },
76
81
  nuclei: [
@@ -271,4 +276,17 @@ export const workspaceDefaultProperties: Required<WorkspacePreferences> = {
271
276
  deltaFormat: '0.00',
272
277
  },
273
278
  },
279
+ defaultMoleculeSettings: {
280
+ showLabel: false,
281
+ atomAnnotation: 'custom-labels',
282
+ floating: {
283
+ visible: true,
284
+ bounding: {
285
+ x: 10,
286
+ y: 10,
287
+ width: 130,
288
+ height: 120,
289
+ },
290
+ },
291
+ },
274
292
  };
@@ -129,13 +129,7 @@ export function toJSON(
129
129
  core: NMRiumCore,
130
130
  state: Pick<
131
131
  State,
132
- | 'data'
133
- | 'sources'
134
- | 'molecules'
135
- | 'correlations'
136
- | 'actionType'
137
- | 'view'
138
- | 'fileCollections'
132
+ 'data' | 'sources' | 'molecules' | 'correlations' | 'actionType' | 'view'
139
133
  >,
140
134
  preferencesState: {
141
135
  current: Workspace;
@@ -19,33 +19,31 @@ interface InitiateDatum1DOptions {
19
19
  usedColors?: UsedColors;
20
20
  molecules?: StateMoleculeExtended[];
21
21
  colors?: SpectrumOneDimensionColor[];
22
- fileCollectionId?: string | undefined;
23
22
  }
24
23
 
25
24
  export function initiateDatum1D(
26
25
  spectrum: any,
27
26
  options: InitiateDatum1DOptions = {},
28
27
  ): Spectrum1D {
29
- const { usedColors, colors, molecules = [], fileCollectionId } = options;
28
+ const { usedColors, colors, molecules = [] } = options;
30
29
 
31
30
  const { integrals, ranges, ...restSpectrum } = spectrum;
32
- const spectrumObj: Spectrum1D = { ...restSpectrum };
33
- spectrumObj.id = spectrum.id || crypto.randomUUID();
34
- spectrumObj.fileCollectionId = spectrum.fileCollectionId || fileCollectionId;
35
-
36
- spectrumObj.display = {
37
- isVisible: true,
38
- isRealSpectrumVisible: true,
39
- ...spectrum.display,
40
- ...get1DColor(spectrum, { usedColors, colors }),
41
- };
42
-
43
- spectrumObj.info = {
44
- nucleus: '1H', // 1H, 13C, 19F, ...
45
- isFid: false,
46
- isComplex: false, // if isComplex is true that mean it contains real/ imaginary x set, if not hid re/im button .
47
- dimension: 1,
48
- ...spectrum.info,
31
+ const spectrumObj: Spectrum1D = {
32
+ ...restSpectrum,
33
+ id: spectrum.id || crypto.randomUUID(),
34
+ display: {
35
+ isVisible: true,
36
+ isRealSpectrumVisible: true,
37
+ ...spectrum.display,
38
+ ...get1DColor(spectrum, { usedColors, colors }),
39
+ },
40
+ info: {
41
+ nucleus: '1H', // 1H, 13C, 19F, ...
42
+ isFid: false,
43
+ isComplex: false, // if isComplex is true that mean it contains real/ imaginary x set, if not hid re/im button .
44
+ dimension: 1,
45
+ ...spectrum.info,
46
+ },
49
47
  };
50
48
 
51
49
  spectrumObj.originalInfo = spectrumObj.info;
@@ -19,6 +19,7 @@ export function detectSignalsByMultipletAnalysis(
19
19
  };
20
20
  const from = data.x[fromIndex];
21
21
  const to = data.x[toIndex];
22
+ const widthHz = (to - from) * frequency;
22
23
 
23
24
  const peaks = xyAutoPeaksPicking(data, {
24
25
  from,
@@ -87,7 +88,7 @@ export function detectSignalsByMultipletAnalysis(
87
88
  analyzer: {
88
89
  frequency,
89
90
  minimalResolution: 0.1,
90
- maxTestedJ: 17,
91
+ maxTestedJ: widthHz,
91
92
  checkSymmetryFirst: true,
92
93
  takeBestPartMultiplet: true,
93
94
  correctVerticalOffset: true,
@@ -19,7 +19,6 @@ const defaultMinMax = { z: [], minX: 0, minY: 0, maxX: 0, maxY: 0 };
19
19
  interface InitiateDatum2DOptions {
20
20
  usedColors?: UsedColors;
21
21
  colors?: SpectrumTwoDimensionsColor[];
22
- fileCollectionId?: string;
23
22
  }
24
23
 
25
24
  function initiateDisplay(spectrum: any, options: InitiateDatum2DOptions) {
@@ -60,15 +59,13 @@ export function initiateDatum2D(
60
59
  spectrum: any,
61
60
  options: InitiateDatum2DOptions = {},
62
61
  ): Spectrum2D {
63
- const { usedColors, colors, fileCollectionId } = options;
64
- const datum: any = { ...spectrum };
65
-
66
- datum.id = spectrum.id || crypto.randomUUID();
67
- datum.fileCollectionId = spectrum.fileCollectionId || fileCollectionId;
68
-
69
- datum.display = initiateDisplay(spectrum, { usedColors, colors });
70
-
71
- datum.info = initiateInfo(spectrum);
62
+ const { usedColors, colors } = options;
63
+ const datum: any = {
64
+ ...spectrum,
65
+ id: spectrum.id || crypto.randomUUID(),
66
+ display: initiateDisplay(spectrum, { usedColors, colors }),
67
+ info: initiateInfo(spectrum),
68
+ };
72
69
 
73
70
  datum.originalInfo = datum.info;
74
71
 
@@ -1,4 +1,4 @@
1
- import type { StateMolecule } from '@zakodium/nmrium-core';
1
+ import type { MoleculeView, StateMolecule } from '@zakodium/nmrium-core';
2
2
  import { Molecule } from 'openchemlib';
3
3
 
4
4
  import getAtomsFromMF from '../utilities/getAtomsFromMF.js';
@@ -29,22 +29,7 @@ export const DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT: MoleculeBoundingRect =
29
29
  };
30
30
 
31
31
  export type MoleculesView = Record<string, MoleculeView>;
32
- export interface MoleculeView {
33
- floating: {
34
- /**
35
- * If the floating molecule is shown.
36
- */
37
- visible: boolean;
38
- /**
39
- * Floating molecule position.
40
- */
41
- bounding: MoleculeBoundingRect;
42
- };
43
- /**
44
- * Show/Hide atoms numbers on the molecule.
45
- */
46
- showAtomNumber: boolean;
47
- }
32
+
48
33
  export function initMolecule(
49
34
  options: Partial<StateMolecule> = {},
50
35
  ): StateMoleculeExtended {
@@ -59,9 +44,7 @@ export function initMolecule(
59
44
  id,
60
45
  molfile,
61
46
  label,
62
- sourceSelector: options.sourceSelector,
63
- sourceId: options.sourceId,
64
- fileCollectionId: options.fileCollectionId,
47
+ selector: options.selector,
65
48
  mf: mfInfo.formula,
66
49
  em: mfInfo.absoluteWeight,
67
50
  mw: mfInfo.relativeWeight,
@@ -71,15 +54,12 @@ export function initMolecule(
71
54
  }
72
55
 
73
56
  export function toJSON(molecule: StateMoleculeExtended): StateMolecule {
74
- const { molfile, label, id, fileCollectionId, sourceSelector, sourceId } =
75
- molecule;
57
+ const { molfile, label, id, selector } = molecule;
76
58
 
77
59
  return {
78
60
  molfile,
79
61
  label,
80
62
  id,
81
- fileCollectionId,
82
- sourceSelector,
83
- sourceId,
63
+ selector,
84
64
  };
85
65
  }
@@ -8,7 +8,6 @@ import { initMolecule } from './Molecule.js';
8
8
  //TODO: Move molecule initialization to nmrium-core and log an error if the molecule cannot be parsed.
9
9
  export function fromJSON(
10
10
  mols: StateMolecule[],
11
- fileCollectionId: string | undefined,
12
11
  reservedMolecules: StateMolecule[] = [],
13
12
  ) {
14
13
  const reservedNumbers = extractLabelsNumbers(reservedMolecules.concat(mols));
@@ -29,9 +28,6 @@ export function fromJSON(
29
28
  label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
30
29
  id: mol.id,
31
30
  };
32
- if (fileCollectionId) {
33
- moleculeOverride.fileCollectionId = fileCollectionId;
34
- }
35
31
 
36
32
  molecules.push(initMolecule(moleculeOverride));
37
33
  }
@@ -104,16 +100,52 @@ function getLabelNumber(reserveNumbers: number[]): number {
104
100
  return 1;
105
101
  }
106
102
 
103
+ export const parseErrorMessage =
104
+ 'Failed to parse SMILES or molfile. Please paste a valid format';
105
+
106
+ function validateMolecules(molecules: StateMolecule[]) {
107
+ if (!molecules?.length) {
108
+ throw new Error(parseErrorMessage);
109
+ }
110
+
111
+ const failedIndexes: number[] = [];
112
+ for (let i = 0; i < molecules.length; i++) {
113
+ const { molfile } = molecules[i];
114
+ const molecule = Molecule.fromMolfile(molfile);
115
+ const atomCount = molecule.getAllAtoms();
116
+
117
+ if (atomCount === 0) {
118
+ failedIndexes.push(i);
119
+ }
120
+ }
121
+
122
+ if (failedIndexes.length > 0) {
123
+ throw new Error(
124
+ `Error parsing molecule at position(s):[${failedIndexes.join(', ')}]. ${parseErrorMessage}`,
125
+ );
126
+ }
127
+ }
128
+
107
129
  /**
108
130
  * We will extract the molecule(s) from the text.
109
131
  * Because a molfile is actually a SDF we can just call 'readSDF' method
110
132
  * @param text - text containing one or several molecules in SMILES, molfile or SDF format
111
133
  * @returns
112
134
  */
113
- export function getMolecules(text: string) {
135
+ export function getMolecules(text?: string) {
136
+ if (!text?.trim()) {
137
+ throw new Error(parseErrorMessage);
138
+ }
139
+
114
140
  // parse SDF
115
- if (/v[23]000/i.test(text)) {
116
- return readSDF(text);
141
+ let molecules = [];
142
+ const parse = /v[23]000/i.test(text) ? readSDF : readSMILES;
143
+ try {
144
+ molecules = parse(text);
145
+ } catch (error) {
146
+ throw new Error(parseErrorMessage, { cause: error });
117
147
  }
118
- return readSMILES(text);
148
+
149
+ validateMolecules(molecules);
150
+ return molecules;
119
151
  }
package/src/index.tsx CHANGED
@@ -1,4 +1,3 @@
1
- import { FocusStyleManager } from '@blueprintjs/core';
2
1
  import { createRoot } from 'react-dom/client';
3
2
  import { HashRouter, Route, Routes } from 'react-router-dom';
4
3
 
@@ -15,8 +14,6 @@ import '@blueprintjs/select/lib/css/blueprint-select.css';
15
14
 
16
15
  import './demo/index.css';
17
16
 
18
- FocusStyleManager.alwaysShowFocus();
19
-
20
17
  const rootElement = document.querySelector('#root');
21
18
  if (!rootElement) {
22
19
  throw new Error('#root element not found');
@@ -115,20 +115,20 @@ export function useClipboard(): UseClipboardReturn {
115
115
 
116
116
  const clipboardAPI = useMemo(
117
117
  () => ({
118
- async read(): Promise<ClipboardItems | undefined> {
118
+ async read(): Promise<ClipboardItems> {
119
119
  try {
120
120
  return await read();
121
- } catch {
121
+ } catch (error) {
122
122
  setShouldFallback('read');
123
- return undefined;
123
+ throw new Error('Failed to read from clipboard', { cause: error });
124
124
  }
125
125
  },
126
- async readText(): Promise<string | undefined> {
126
+ async readText(): Promise<string> {
127
127
  try {
128
128
  return await readText();
129
- } catch {
129
+ } catch (error) {
130
130
  setShouldFallback('readText');
131
- return undefined;
131
+ throw new Error('Failed to read from clipboard', { cause: error });
132
132
  }
133
133
  },
134
134
  async write(data: ClipboardItems): Promise<void> {
@@ -1 +1 @@
1
- export default { version: 'v1.7.0' };
1
+ export default { version: 'v1.9.0' };
@@ -1,43 +0,0 @@
1
- import type { Spectrum } from '@zakodium/nmrium-core';
2
- import type { DiaIDAndInfo } from 'openchemlib-utils';
3
- import type { AssignmentContext, Axis } from '../../assignment/AssignmentsContext.js';
4
- interface TargetAssignment {
5
- key: string;
6
- index: number;
7
- }
8
- interface RangeTargetAssignKey extends TargetAssignment {
9
- target: 'range';
10
- }
11
- interface ZoneTargetAssignKey extends TargetAssignment {
12
- target: 'zone';
13
- }
14
- interface SignalTargetAssignKey extends TargetAssignment {
15
- target: 'signal';
16
- }
17
- export type TargetAssignKeys = [RangeTargetAssignKey | ZoneTargetAssignKey] | [RangeTargetAssignKey | ZoneTargetAssignKey, SignalTargetAssignKey];
18
- export interface AtomData {
19
- oclIDs: string[];
20
- nbAtoms: number;
21
- }
22
- /**
23
- * Returns the OCL id(s) and number of atoms of an atom when hovering over
24
- * or clicking on it. This is depending on an optional given axis.
25
- * In case of an heavy atom with bonded hydrogens the OCL id(s)
26
- * and number of these hydrogens are added as well.
27
- *
28
- * @param {DiaIDAndInfo} diaIDAndInfo - atom returned by OCLnmr component
29
- * @param {string} activeTab - active tab
30
- * @param {Axis} axis - current axis
31
- *
32
- */
33
- export declare function extractFromAtom(diaIDAndInfo: DiaIDAndInfo | undefined, activeTab: string, axis?: Axis | null): AtomData;
34
- export declare function getAssignIds(spectrum: Spectrum, id: string): TargetAssignKeys | null;
35
- export declare function getHighlightsOnHover(assignments: AssignmentContext, oclIDs: string[], spectra: Spectrum[]): string[];
36
- export declare function getCurrentDiaIDsToHighlight(assignmentData: AssignmentContext): string[];
37
- /** */
38
- export declare function getUniqueDiaIDs(diaIDs: string[], atomInformation: AtomData): {
39
- diaIDs: string[];
40
- nbAtoms: number;
41
- };
42
- export {};
43
- //# sourceMappingURL=Utilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Utilities.d.ts","sourceRoot":"","sources":["../../../../src/component/panels/MoleculesPanel/Utilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,KAAK,EACV,iBAAiB,EACjB,IAAI,EACL,MAAM,wCAAwC,CAAC;AAGhD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,oBAAqB,SAAQ,gBAAgB;IACrD,MAAM,EAAE,OAAO,CAAC;CACjB;AACD,UAAU,mBAAoB,SAAQ,gBAAgB;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,UAAU,qBAAsB,SAAQ,gBAAgB;IACtD,MAAM,EAAE,QAAQ,CAAC;CAClB;AACD,MAAM,MAAM,gBAAgB,GACxB,CAAC,oBAAoB,GAAG,mBAAmB,CAAC,GAC5C,CAAC,oBAAoB,GAAG,mBAAmB,EAAE,qBAAqB,CAAC,CAAC;AAExE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,YAAY,GAAG,SAAS,EACtC,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GACjB,QAAQ,CAkCV;AAUD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,MAAM,GACT,gBAAgB,GAAG,IAAI,CAwBzB;AAED,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,QAAQ,EAAE,YAyBpB;AAED,wBAAgB,2BAA2B,CAAC,cAAc,EAAE,iBAAiB,YAS5E;AACD,MAAM;AACN,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,QAAQ;;;EAiB1E"}