nmrium 0.27.0 → 0.28.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 (307) hide show
  1. package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
  2. package/lib/component/1d/IntegralsSeries.js +2 -6
  3. package/lib/component/1d/PeakAnnotation.js +2 -2
  4. package/lib/component/1d/PeakAnnotations.js +2 -4
  5. package/lib/component/1d/SpectraTracker.js +2 -2
  6. package/lib/component/1d/Viewer1D.js +1 -1
  7. package/lib/component/1d/database/DatabaseSpectrum.js +28 -26
  8. package/lib/component/1d/ranges/Range.d.ts +1 -2
  9. package/lib/component/1d/ranges/Range.js +3 -4
  10. package/lib/component/1d/ranges/Ranges.js +3 -4
  11. package/lib/component/1d/tool/BaseLineZones.js +3 -6
  12. package/lib/component/1d/tool/VerticalIndicator.js +1 -1
  13. package/lib/component/2d/Contours.js +1 -5
  14. package/lib/component/2d/SignalDeltaLine.js +1 -1
  15. package/lib/component/2d/Viewer2D.js +1 -1
  16. package/lib/component/2d/YAxis.js +2 -2
  17. package/lib/component/2d/zones/IndicationLines.js +2 -3
  18. package/lib/component/EventsTrackers/KeysListenerTracker.js +59 -41
  19. package/lib/component/NMRium.d.ts +14 -49
  20. package/lib/component/NMRium.js +14 -6
  21. package/lib/component/SplitPaneWrapper.js +2 -2
  22. package/lib/component/context/PreferencesContext.d.ts +3 -43
  23. package/lib/component/elements/Button.js +1 -1
  24. package/lib/component/elements/Logo.js +1 -1
  25. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
  26. package/lib/component/elements/Tab/Tabs.js +2 -1
  27. package/lib/component/elements/ToggleButton.js +2 -2
  28. package/lib/component/elements/accordion/Accordion.js +2 -6
  29. package/lib/component/elements/formik/Input.js +1 -1
  30. package/lib/component/elements/popup/Modal/Modal.js +1 -1
  31. package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
  32. package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
  33. package/lib/component/header/BaseLineCorrectionPanel.js +7 -4
  34. package/lib/component/header/Header.js +2 -2
  35. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  36. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  37. package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -1
  38. package/lib/component/hooks/useCheckToolsVisibility.js +2 -1
  39. package/lib/component/hooks/useExport.js +2 -2
  40. package/lib/component/hooks/useFormatNumberByNucleus.js +3 -4
  41. package/lib/component/loader/DropZone.js +8 -2
  42. package/lib/component/loader/NoData.d.ts +3 -2
  43. package/lib/component/loader/NoData.js +31 -30
  44. package/lib/component/modal/MoleculeStructureEditorModal.js +2 -2
  45. package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
  46. package/lib/component/modal/editRange/EditRangeModal.js +49 -54
  47. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
  48. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
  49. package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +2 -0
  50. package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +34 -0
  51. package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
  52. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +11 -14
  53. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -1
  54. package/lib/component/modal/editRange/forms/components/SignalsForm.js +18 -29
  55. package/lib/component/modal/editZone/SignalsForm.js +1 -1
  56. package/lib/component/modal/setting/DatabasesTabContent.d.ts +2 -1
  57. package/lib/component/modal/setting/DatabasesTabContent.js +28 -30
  58. package/lib/component/modal/setting/settingsValidation.d.ts +150 -42
  59. package/lib/component/modal/setting/settingsValidation.js +6 -4
  60. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +13 -15
  61. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
  62. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
  63. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  64. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
  65. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  66. package/lib/component/panels/Panels.js +1 -1
  67. package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  68. package/lib/component/panels/RangesPanel/RangesHeader.js +12 -3
  69. package/lib/component/panels/RangesPanel/RangesPanel.js +19 -19
  70. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  71. package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +1 -1
  72. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
  73. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +48 -30
  74. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
  75. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  76. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  77. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
  78. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
  79. package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -8
  80. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
  81. package/lib/component/panels/SummaryPanel/utilities/{IsInView.d.ts → useInView.d.ts} +2 -2
  82. package/lib/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
  83. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  84. package/lib/component/panels/ZonesPanel/ZonesPanel.js +13 -13
  85. package/lib/component/panels/databasePanel/DatabasePanel.d.ts +4 -0
  86. package/lib/component/panels/databasePanel/DatabasePanel.js +80 -26
  87. package/lib/component/panels/databasePanel/DatabasePreferences.js +1 -1
  88. package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.d.ts +7 -0
  89. package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +8 -0
  90. package/lib/component/panels/databasePanel/DatabaseTable.js +14 -9
  91. package/lib/component/panels/extra/preferences/ColumnsHelper.js +2 -4
  92. package/lib/component/panels/header/DefaultPanelHeader.js +1 -3
  93. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  94. package/lib/component/reducer/Reducer.d.ts +8 -66
  95. package/lib/component/reducer/Reducer.js +13 -8
  96. package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
  97. package/lib/component/reducer/actions/DatabaseActions.js +21 -3
  98. package/lib/component/reducer/actions/DomainActions.js +1 -1
  99. package/lib/component/reducer/actions/FiltersActions.d.ts +2 -1
  100. package/lib/component/reducer/actions/FiltersActions.js +25 -4
  101. package/lib/component/reducer/actions/PreferencesActions.js +32 -20
  102. package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
  103. package/lib/component/reducer/actions/RangesActions.js +45 -11
  104. package/lib/component/reducer/actions/SpectrumsActions.js +6 -9
  105. package/lib/component/reducer/actions/ToolsActions.js +66 -53
  106. package/lib/component/reducer/helper/getSpectrum.d.ts +5 -0
  107. package/lib/component/reducer/helper/getSpectrum.js +14 -0
  108. package/lib/component/reducer/preferences/actions/initPreferences.js +1 -1
  109. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
  110. package/lib/component/reducer/preferences/preferencesReducer.d.ts +23 -10
  111. package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
  112. package/lib/component/reducer/types/Types.d.ts +3 -1
  113. package/lib/component/reducer/types/Types.js +3 -1
  114. package/lib/component/tool/BrushX.js +1 -1
  115. package/lib/component/tool/BrushXY.js +1 -1
  116. package/lib/component/tool/CrossLinePointer.js +1 -1
  117. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +4 -3
  118. package/lib/component/toolbar/BasicToolBar.js +0 -1
  119. package/lib/component/toolbar/FunctionToolBar.js +9 -13
  120. package/lib/component/toolbar/ToolTypes.d.ts +1 -1
  121. package/lib/component/toolbar/ToolTypes.js +3 -3
  122. package/lib/component/utility/Export.d.ts +7 -1
  123. package/lib/component/utility/Export.js +3 -3
  124. package/lib/component/utility/formatNumber.d.ts +1 -1
  125. package/lib/component/utility/formatNumber.js +4 -2
  126. package/lib/component/utility/isGoogleDocument.d.ts +1 -0
  127. package/lib/component/utility/isGoogleDocument.js +3 -0
  128. package/lib/component/utility/nmredataToNmrium.js +1 -2
  129. package/lib/component/utility/nmriumToNmredata.d.ts +2 -2
  130. package/lib/component/utility/nmriumToNmredata.js +2 -2
  131. package/lib/component/utility/util/nmredata/addSource.js +2 -2
  132. package/lib/component/workspaces/Workspace.d.ts +9 -4
  133. package/lib/component/workspaces/basic.js +15 -8
  134. package/lib/component/workspaces/exercise.js +2 -2
  135. package/lib/component/workspaces/process1D.js +1 -1
  136. package/lib/data/FiltersManager.js +1 -1
  137. package/lib/data/PredictionManager.js +7 -9
  138. package/lib/data/SpectraManager.d.ts +4 -12
  139. package/lib/data/SpectraManager.js +14 -23
  140. package/lib/data/data1d/Data1DManager.js +8 -1
  141. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
  142. package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
  143. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
  144. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
  145. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +36 -2
  146. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +38 -15
  147. package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
  148. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
  149. package/lib/data/data1d/database.d.ts +5 -3
  150. package/lib/data/data1d/database.js +54 -4
  151. package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
  152. package/lib/data/data2d/Processing2D.js +1 -1
  153. package/lib/data/molecules/Molecule.d.ts +4 -5
  154. package/lib/data/molecules/Molecule.js +3 -1
  155. package/lib/data/utilities/FindUtilities.js +1 -3
  156. package/lib/data/utilities/RangeUtilities.js +5 -6
  157. package/lib/data/utilities/ZoneUtilities.js +1 -1
  158. package/lib/data/utilities/getSum.js +1 -3
  159. package/lib/data/utilities/isMolFileEmpty.d.ts +1 -0
  160. package/lib/data/utilities/isMolFileEmpty.js +6 -0
  161. package/lib/types/NMRiumDataReturn.d.ts +15 -0
  162. package/lib/types/NMRiumDataReturn.js +1 -0
  163. package/lib/types/NMRiumGeneralPreferences.d.ts +10 -0
  164. package/lib/types/NMRiumGeneralPreferences.js +1 -0
  165. package/lib/types/NMRiumPanelPreferences.d.ts +16 -0
  166. package/lib/types/NMRiumPanelPreferences.js +1 -0
  167. package/lib/types/NMRiumToolBarPreferences.d.ts +20 -0
  168. package/lib/types/NMRiumToolBarPreferences.js +1 -0
  169. package/lib/types/Preferences.d.ts +5 -0
  170. package/lib/types/Preferences.js +1 -0
  171. package/lib/versionInfo.js +1 -1
  172. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
  173. package/lib-cjs/component/1d/IntegralsSeries.js +2 -6
  174. package/lib-cjs/component/1d/PeakAnnotation.js +2 -2
  175. package/lib-cjs/component/1d/PeakAnnotations.js +2 -4
  176. package/lib-cjs/component/1d/SpectraTracker.js +2 -2
  177. package/lib-cjs/component/1d/Viewer1D.js +1 -1
  178. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +30 -25
  179. package/lib-cjs/component/1d/ranges/Range.js +3 -4
  180. package/lib-cjs/component/1d/ranges/Ranges.js +3 -4
  181. package/lib-cjs/component/1d/tool/BaseLineZones.js +3 -6
  182. package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
  183. package/lib-cjs/component/2d/Contours.js +1 -5
  184. package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
  185. package/lib-cjs/component/2d/Viewer2D.js +1 -1
  186. package/lib-cjs/component/2d/YAxis.js +1 -1
  187. package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
  188. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +59 -41
  189. package/lib-cjs/component/NMRium.js +13 -5
  190. package/lib-cjs/component/SplitPaneWrapper.js +2 -2
  191. package/lib-cjs/component/elements/Button.js +1 -1
  192. package/lib-cjs/component/elements/Logo.js +1 -1
  193. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -0
  194. package/lib-cjs/component/elements/Tab/Tabs.js +2 -1
  195. package/lib-cjs/component/elements/ToggleButton.js +2 -2
  196. package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
  197. package/lib-cjs/component/elements/formik/Input.js +1 -1
  198. package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
  199. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
  200. package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
  201. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
  202. package/lib-cjs/component/header/Header.js +2 -2
  203. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
  204. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  205. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -1
  206. package/lib-cjs/component/hooks/useExport.js +2 -2
  207. package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +2 -3
  208. package/lib-cjs/component/loader/DropZone.js +8 -2
  209. package/lib-cjs/component/loader/NoData.js +31 -30
  210. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +2 -2
  211. package/lib-cjs/component/modal/editRange/EditRangeModal.js +47 -52
  212. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +9 -22
  213. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
  214. package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +38 -0
  215. package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +13 -16
  216. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +18 -29
  217. package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
  218. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +31 -33
  219. package/lib-cjs/component/modal/setting/settingsValidation.js +6 -4
  220. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +12 -14
  221. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +8 -15
  222. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +1 -1
  223. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
  224. package/lib-cjs/component/panels/Panels.js +1 -1
  225. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  226. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +10 -1
  227. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +18 -18
  228. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +1 -1
  229. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +47 -29
  230. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +1 -1
  231. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  232. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  233. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
  234. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
  235. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +6 -8
  236. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
  237. package/lib-cjs/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
  238. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
  239. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +12 -12
  240. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +78 -24
  241. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +1 -1
  242. package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
  243. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +14 -9
  244. package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +2 -4
  245. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -3
  246. package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +1 -1
  247. package/lib-cjs/component/reducer/Reducer.js +13 -8
  248. package/lib-cjs/component/reducer/actions/DatabaseActions.js +22 -3
  249. package/lib-cjs/component/reducer/actions/DomainActions.js +1 -1
  250. package/lib-cjs/component/reducer/actions/FiltersActions.js +26 -4
  251. package/lib-cjs/component/reducer/actions/PreferencesActions.js +30 -18
  252. package/lib-cjs/component/reducer/actions/RangesActions.js +46 -12
  253. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -7
  254. package/lib-cjs/component/reducer/actions/ToolsActions.js +63 -73
  255. package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
  256. package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +1 -1
  257. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +4 -4
  258. package/lib-cjs/component/reducer/preferences/preferencesReducer.js +1 -1
  259. package/lib-cjs/component/reducer/types/Types.js +5 -3
  260. package/lib-cjs/component/tool/BrushX.js +1 -1
  261. package/lib-cjs/component/tool/BrushXY.js +1 -1
  262. package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
  263. package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +3 -2
  264. package/lib-cjs/component/toolbar/BasicToolBar.js +0 -1
  265. package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -13
  266. package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
  267. package/lib-cjs/component/utility/Export.js +4 -3
  268. package/lib-cjs/component/utility/formatNumber.js +3 -1
  269. package/lib-cjs/component/utility/isGoogleDocument.js +7 -0
  270. package/lib-cjs/component/utility/nmredataToNmrium.js +1 -2
  271. package/lib-cjs/component/utility/util/nmredata/addSource.js +2 -2
  272. package/lib-cjs/component/workspaces/basic.js +15 -8
  273. package/lib-cjs/component/workspaces/exercise.js +2 -2
  274. package/lib-cjs/component/workspaces/process1D.js +1 -1
  275. package/lib-cjs/data/FiltersManager.js +1 -1
  276. package/lib-cjs/data/PredictionManager.js +7 -9
  277. package/lib-cjs/data/SpectraManager.js +14 -23
  278. package/lib-cjs/data/data1d/Data1DManager.js +8 -1
  279. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
  280. package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
  281. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
  282. package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
  283. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +40 -16
  284. package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
  285. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
  286. package/lib-cjs/data/data1d/database.js +55 -5
  287. package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
  288. package/lib-cjs/data/data2d/Processing2D.js +1 -1
  289. package/lib-cjs/data/molecules/Molecule.js +3 -1
  290. package/lib-cjs/data/utilities/FindUtilities.js +1 -3
  291. package/lib-cjs/data/utilities/RangeUtilities.js +8 -6
  292. package/lib-cjs/data/utilities/ZoneUtilities.js +1 -1
  293. package/lib-cjs/data/utilities/getSum.js +1 -3
  294. package/lib-cjs/data/utilities/isMolFileEmpty.js +10 -0
  295. package/lib-cjs/types/NMRiumDataReturn.js +2 -0
  296. package/lib-cjs/types/NMRiumGeneralPreferences.js +2 -0
  297. package/lib-cjs/types/NMRiumPanelPreferences.js +2 -0
  298. package/lib-cjs/types/NMRiumToolBarPreferences.js +2 -0
  299. package/lib-cjs/types/Preferences.js +2 -0
  300. package/lib-cjs/versionInfo.js +1 -1
  301. package/package.json +31 -31
  302. package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
  303. package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
  304. package/lib/component/panels/databasePanel/useDatabases.d.ts +0 -5
  305. package/lib/component/panels/databasePanel/useDatabases.js +0 -10
  306. package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -20
  307. package/lib-cjs/component/panels/databasePanel/useDatabases.js +0 -14
@@ -8,7 +8,7 @@ import ExclusionZoneAnnotation from './ExclusionZoneAnnotation';
8
8
  import getVerticalShift from './utilities/getVerticalShift';
9
9
  function ExclusionZonesAnnotationsInner({ displayerKey, xDomains, spectra, verticalAlign, }) {
10
10
  return (_jsx("g", { className: "spectrum-exclusion-zones-group", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: spectra
11
- .filter((d) => d.display.isVisible === true && xDomains[d.id])
11
+ .filter((d) => d.display.isVisible && xDomains[d.id])
12
12
  .map((d, index) => getExclusionZones(d).map((zone) => {
13
13
  return (_jsx(ExclusionZoneAnnotation, { spectrumID: d.id, vAlign: getVerticalShift(verticalAlign, { index }), zone: zone, color: d.display.color }, zone.id));
14
14
  })) }));
@@ -7,15 +7,11 @@ function IntegralsSeries() {
7
7
  const { xDomains, activeSpectrum, data, displayerKey, activeTab: nucleus, } = useChartData();
8
8
  const Integrals = useMemo(() => {
9
9
  const isActive = (id) => {
10
- return activeSpectrum === null
11
- ? true
12
- : id === activeSpectrum.id
13
- ? true
14
- : false;
10
+ return activeSpectrum === null ? true : id === activeSpectrum.id;
15
11
  };
16
12
  return (_jsx("g", { className: "integrals", children: data?.[0] &&
17
13
  data
18
- .filter((d) => d.display.isVisible === true && xDomains[d.id])
14
+ .filter((d) => d.display.isVisible && xDomains[d.id])
19
15
  .filter(isSpectrum1D)
20
16
  .map((spectrum) => spectrum.integrals.values.map((integral) => (_jsx(Integral, { nucleus: nucleus, integral: integral, isActive: isActive(spectrum.id) }, integral.id)))) }));
21
17
  }, [activeSpectrum, data, nucleus, xDomains]);
@@ -76,7 +76,7 @@ value, color, isActive, nucleus, }) {
76
76
  id,
77
77
  value: newValue,
78
78
  oldValue: value,
79
- shiftValue: shiftValue,
79
+ shiftValue,
80
80
  });
81
81
  event.currentTarget.blur();
82
82
  setIsSelected(false);
@@ -115,7 +115,7 @@ value, color, isActive, nucleus, }) {
115
115
  border: isSelected ? `1px solid ${color}` : `0`,
116
116
  opacity: isActive ? 1 : 0.2,
117
117
  userSelect: 'none',
118
- color: color,
118
+ color,
119
119
  }, value: oldValue, onKeyDown: handleKeyDown, onChange: handleChange, type: "number", disabled: !isActive }) }) })] }));
120
120
  }
121
121
  export default PeakAnnotation;
@@ -27,15 +27,13 @@ function PeakAnnotations() {
27
27
  };
28
28
  return (data &&
29
29
  reSortData()
30
- .filter((d) => d.display.isVisible === true && xDomains[d.id])
30
+ .filter((d) => d.display.isVisible && xDomains[d.id])
31
31
  .filter(isSpectrum1D)
32
32
  .map((d) => {
33
33
  return (d.peaks?.values &&
34
34
  d.display.isPeaksMarkersVisible && (_jsx("g", { transform: `translate(0,-${getVerticalAlign(d.id)})`, children: d.peaks.values.map(({ x, y, id }) => (_jsx(PeakAnnotation, { x: scaleX()(x), y: scaleY(d.id)(y) - 5, sign: Math.sign(y), id: id, value: x, color: "#730000", nucleus: d.info.nucleus, isActive: activeSpectrum == null
35
35
  ? false
36
- : activeSpectrum.id === d.id
37
- ? true
38
- : false }, id))) }, d.id)));
36
+ : activeSpectrum.id === d.id }, id))) }, d.id)));
39
37
  }));
40
38
  }, [data, verticalAlign, activeSpectrum, xDomains, scaleX, scaleY]);
41
39
  return (_jsx("g", { className: "peaks", clipPath: `url(#${displayerKey}clip-chart-1d)`, children: Peaks }));
@@ -40,10 +40,10 @@ function YTracker({ datum }) {
40
40
  }
41
41
  function SpectraTracker() {
42
42
  const { data, activeTab, xDomains } = useChartData();
43
- const [isVisible, ToggleVisibility] = useState(false);
43
+ const [isVisible, toggleVisibility] = useState(false);
44
44
  useEffect(() => {
45
45
  function handler(flag) {
46
- ToggleVisibility(flag);
46
+ toggleVisibility(flag);
47
47
  }
48
48
  Events.on('showYSpectraTrackers', handler);
49
49
  return () => {
@@ -134,7 +134,7 @@ function Viewer1D({ emptyText = undefined }) {
134
134
  ...brushData,
135
135
  });
136
136
  break;
137
- case options.baseLineCorrection.id:
137
+ case options.baselineCorrection.id:
138
138
  dispatch({
139
139
  type: ADD_BASE_LINE_ZONE,
140
140
  zone: { from: brushData.startX, to: brushData.endX },
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useContext, useEffect, useState } from 'react';
2
+ import throttle from 'lodash/throttle';
3
+ import { useCallback, useContext, useEffect, useRef, useState } from 'react';
3
4
  import { addJcamp } from '../../../data/SpectraManager';
4
5
  import { useChartData } from '../../context/ChartContext';
5
6
  import { useScaleChecked } from '../../context/ScaleContext';
@@ -20,36 +21,37 @@ function DatabaseSpectrum() {
20
21
  const { jcampURL: jcampRelativeURL, baseURL } = highlight?.sourceData?.extra || [];
21
22
  const getSpinner = useContext(spinnerContext);
22
23
  const scaleY = useCallback(() => getYScale({
23
- height: height,
24
+ height,
24
25
  margin: { top: margin.top, bottom: margin.bottom + marginBottom },
25
26
  verticalAlign,
26
27
  yDomain,
27
28
  }), [height, margin, marginBottom, verticalAlign, yDomain]);
28
- useEffect(() => {
29
- void (async () => {
30
- try {
31
- setLoading(true);
32
- const jcampURL = new URL(jcampRelativeURL, baseURL);
33
- const result = await loadFile(jcampURL);
34
- const spectra = [];
35
- addJcamp(spectra, result, {}, {});
36
- setLoading(false);
37
- const spectrum = spectra?.[0] || null;
38
- if (spectrum) {
39
- const { x, re: y } = spectrum?.data;
40
- let path = `M ${scaleX()(x[0])} ${scaleY()(y[0])} `;
41
- path += x.slice(1).reduce((accumulator, point, i) => {
42
- accumulator += ` L ${scaleX()(point)} ${scaleY()(y[i + 1])}`;
43
- return accumulator;
44
- }, '');
45
- setPath(path);
46
- }
47
- }
48
- catch (e) {
49
- alert.error('Failed to Load spectrum');
29
+ const loadSpectrum = useRef(throttle(async (baseURL, jcampRelativeURL) => {
30
+ try {
31
+ setLoading(true);
32
+ const jcampURL = new URL(jcampRelativeURL, baseURL);
33
+ const result = await loadFile(jcampURL);
34
+ const spectra = [];
35
+ addJcamp(spectra, result, {}, {});
36
+ setLoading(false);
37
+ const spectrum = spectra?.[0] || null;
38
+ if (spectrum) {
39
+ const { x, re: y } = spectrum.data;
40
+ let path = `M ${scaleX()(x[0])} ${scaleY()(y[0])} `;
41
+ path += x.slice(1).reduce((accumulator, point, i) => {
42
+ accumulator += ` L ${scaleX()(point)} ${scaleY()(y[i + 1])}`;
43
+ return accumulator;
44
+ }, '');
45
+ setPath(path);
50
46
  }
51
- })();
52
- }, [alert, baseURL, jcampRelativeURL, scaleX, scaleY]);
47
+ }
48
+ catch (e) {
49
+ alert.error('Failed to Load spectrum');
50
+ }
51
+ }, 250));
52
+ useEffect(() => {
53
+ void loadSpectrum.current(baseURL, jcampRelativeURL);
54
+ }, [baseURL, jcampRelativeURL, loadSpectrum]);
53
55
  if (highlight.sourceData?.type !== HighlightedSource.DATABASE) {
54
56
  return null;
55
57
  }
@@ -10,8 +10,7 @@ interface RangeProps {
10
10
  showMultiplicityTrees: boolean;
11
11
  selectedTool: string;
12
12
  rangeData: RangeData;
13
- startEditMode: boolean;
14
13
  relativeFormat: string;
15
14
  }
16
- declare function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, relativeFormat, }: RangeProps): import("@emotion/react/jsx-runtime").JSX.Element;
15
+ declare function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat, }: RangeProps): import("@emotion/react/jsx-runtime").JSX.Element;
17
16
  export default Range;
@@ -14,7 +14,6 @@ import { RESIZE_RANGE } from '../../reducer/types/Types';
14
14
  import { options } from '../../toolbar/ToolTypes';
15
15
  import { formatNumber } from '../../utility/formatNumber';
16
16
  import MultiplicityTree from '../multiplicityTree/MultiplicityTree';
17
- import TempMultiplicityTree from '../multiplicityTree/TempMultiplicityTree';
18
17
  const stylesOnHover = css `
19
18
  pointer-events: bounding-box;
20
19
  @-moz-document url-prefix() {
@@ -43,7 +42,7 @@ const stylesHighlighted = css `
43
42
  cursor: pointer;
44
43
  }
45
44
  `;
46
- function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode, relativeFormat, }) {
45
+ function Range({ rangeData, showMultiplicityTrees, selectedTool, relativeFormat, }) {
47
46
  const { viewerRef } = useGlobal();
48
47
  const { id, integration, signals } = rangeData;
49
48
  const assignmentData = useAssignmentData();
@@ -106,9 +105,9 @@ function Range({ rangeData, showMultiplicityTrees, selectedTool, startEditMode,
106
105
  ? 1
107
106
  : 0.6, children: integration !== undefined
108
107
  ? formatNumber(integration, relativeFormat)
109
- : '' })] })) }, `${id}_${to}_${from}`), startEditMode ? (_jsx(TempMultiplicityTree, {})) : (showMultiplicityTrees &&
108
+ : '' })] })) }, `${id}_${to}_${from}`), showMultiplicityTrees &&
110
109
  signals &&
111
110
  signals.length > 0 &&
112
- signals.map((_signal) => (_jsx(MultiplicityTree, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id))))] }, id));
111
+ signals.map((_signal) => (_jsx(MultiplicityTree, { rangeFrom: rangeData.from, rangeTo: rangeData.to, signal: _signal }, _signal.id)))] }, id));
113
112
  }
114
113
  export default Range;
@@ -5,13 +5,13 @@ import { usePanelPreferences } from '../../hooks/usePanelPreferences';
5
5
  import useSpectrum from '../../hooks/useSpectrum';
6
6
  import Range from './Range';
7
7
  import RangeIntegral from './RangeIntegral';
8
- function RangesInner({ ranges, displayerKey, selectedTool, editRangeID, showMultiplicityTrees, showRangesIntegrals, relativeFormat, }) {
9
- return (_jsx("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => (_jsxs(Fragment, { children: [_jsx(Range, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees, startEditMode: editRangeID && editRangeID === range.id ? true : false, relativeFormat: relativeFormat }), showRangesIntegrals && _jsx(RangeIntegral, { range: range })] }, range.id))) }));
8
+ function RangesInner({ ranges, displayerKey, selectedTool, showMultiplicityTrees, showRangesIntegrals, relativeFormat, }) {
9
+ return (_jsx("g", { clipPath: `url(#${displayerKey}clip-chart-1d)`, children: ranges?.values?.map((range) => (_jsxs(Fragment, { children: [_jsx(Range, { rangeData: range, selectedTool: selectedTool, showMultiplicityTrees: showMultiplicityTrees, relativeFormat: relativeFormat }), showRangesIntegrals && _jsx(RangeIntegral, { range: range })] }, range.id))) }));
10
10
  }
11
11
  const MemoizedRanges = memo(RangesInner);
12
12
  const empyData = { ranges: {} };
13
13
  export default function Ranges() {
14
- const { displayerKey, toolOptions: { selectedTool, data: { tempRange, showMultiplicityTrees, showRangesIntegrals }, }, activeTab, } = useChartData();
14
+ const { displayerKey, toolOptions: { selectedTool, data: { showMultiplicityTrees, showRangesIntegrals }, }, activeTab, } = useChartData();
15
15
  const { ranges } = useSpectrum(empyData);
16
16
  const rangesPreferences = usePanelPreferences('ranges', activeTab);
17
17
  return (_jsx(MemoizedRanges, { ...{
@@ -20,7 +20,6 @@ export default function Ranges() {
20
20
  showRangesIntegrals,
21
21
  selectedTool,
22
22
  displayerKey,
23
- editRangeID: tempRange?.id || '',
24
23
  relativeFormat: rangesPreferences.relative.format,
25
24
  } }));
26
25
  }
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
- import { useCallback, useMemo } from 'react';
5
4
  import { useChartData } from '../../context/ChartContext';
6
5
  import { useDispatch } from '../../context/DispatchContext';
7
6
  import { useScaleChecked } from '../../context/ScaleContext';
@@ -30,12 +29,10 @@ function BaseLineZones() {
30
29
  const { toolOptions } = useChartData();
31
30
  const { scaleX } = useScaleChecked();
32
31
  const dispatch = useDispatch();
33
- const deleteRangeHandler = useCallback((id) => {
32
+ const deleteRangeHandler = (id) => {
34
33
  dispatch({ type: DELETE_BASE_LINE_ZONE, id });
35
- }, [dispatch]);
36
- const baseLineZones = useMemo(() => {
37
- return toolOptions.data.baseLineZones;
38
- }, [toolOptions]);
34
+ };
35
+ const baseLineZones = toolOptions.data.baselineCorrection.zones;
39
36
  return (_jsx(_Fragment, { children: baseLineZones.length > 0 && (_jsx("g", { children: baseLineZones.map((zone) => (_jsxs("g", { transform: `translate(${scaleX()(zone.to)},0)`, css: styles, children: [_jsx(DeleteButton, { x: -20, y: 10, onDelete: () => deleteRangeHandler(zone.id) }), _jsx("rect", { x: "0", width: `${scaleX()(zone.from) - scaleX()(zone.to)}`, className: "zone-area" })] }, zone.id))) })) }));
40
37
  }
41
38
  export default BaseLineZones;
@@ -18,7 +18,7 @@ function VerticalIndicator() {
18
18
  return (_jsx("div", { style: {
19
19
  ...styles,
20
20
  transform: `translate(${scaleX()(pivot.value)}px, 0px)`,
21
- height: height,
21
+ height,
22
22
  } }));
23
23
  }
24
24
  export default VerticalIndicator;
@@ -11,11 +11,7 @@ function ContoursPaths({ id: spectrumID, sign, color, datum, }) {
11
11
  const preferences = usePreferences();
12
12
  const { xShift, yShift } = getShift(datum);
13
13
  const isActive = useMemo(() => {
14
- return activeSpectrum === null
15
- ? true
16
- : spectrumID === activeSpectrum.id
17
- ? true
18
- : false;
14
+ return activeSpectrum === null ? true : spectrumID === activeSpectrum.id;
19
15
  }, [activeSpectrum, spectrumID]);
20
16
  function buildContourPath(data) {
21
17
  const _scaleX = get2DXScale({ margin, width, xDomain });
@@ -14,7 +14,7 @@ function SignalDeltaLine({ delta, axis, show }) {
14
14
  const scaleX = get2DXScale({ margin, width, xDomain });
15
15
  const scaleY = get2DYScale({ margin, height, yDomain });
16
16
  const line = useMemo(() => {
17
- return show === true ? (axis === 'X' ? (_jsx("line", { css: lineStyle, x1: scaleX(delta), x2: scaleX(delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `signalLine_${delta}_X`)) : axis === 'Y' ? (_jsx("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(delta), y2: scaleY(delta) }, `signalLine_${delta}_Y`)) : null) : null;
17
+ return show ? (axis === 'X' ? (_jsx("line", { css: lineStyle, x1: scaleX(delta), x2: scaleX(delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `signalLine_${delta}_X`)) : axis === 'Y' ? (_jsx("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(delta), y2: scaleY(delta) }, `signalLine_${delta}_Y`)) : null) : null;
18
18
  }, [axis, delta, scaleX, scaleY, show, xDomain, yDomain]);
19
19
  return _jsx("g", { children: line });
20
20
  }
@@ -100,7 +100,7 @@ function Viewer2D({ emptyText = undefined }) {
100
100
  }
101
101
  }, [selectedTool]);
102
102
  if (!isVisible) {
103
- return (_jsx(NoData, { emptyText: "Currently FID can not be displayed for 2D spectra", canOpenLoader: false }));
103
+ return (_jsx(NoData, { emptyText: "2D FID spectra can not be displayed yet", canOpenLoader: false, style: { outline: 'none' } }));
104
104
  }
105
105
  return (_jsx(ResponsiveChart, { children: ({ width, height }) => (_jsxs(ViewerResponsiveWrapper, { width: width, height: height, children: [_jsx(Spinner, { isLoading: isLoading, emptyText: emptyText }), data && data.length > 0 && (_jsx(BrushTracker, { onBrush: handelBrushEnd, onDoubleClick: handelOnDoubleClick, onClick: mouseClick, onZoom: handleZoom, style: {
106
106
  width: '100%',
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import * as d3 from 'd3';
@@ -38,6 +38,6 @@ function YAxis(props) {
38
38
  if (!width || !height) {
39
39
  return null;
40
40
  }
41
- return (_jsx(_Fragment, { children: _jsx("g", { className: "y", css: axisStyles, transform: `translate(${width - marginProps.right})`, ref: refAxis, children: _jsx("text", { fill: "#000", x: -marginProps.top, y: -(marginProps.right - 5), dy: "0.71em", transform: "rotate(-90)", textAnchor: "end", children: label }) }) }));
41
+ return (_jsx("g", { className: "y", css: axisStyles, transform: `translate(${width - marginProps.right})`, ref: refAxis, children: _jsx("text", { fill: "#000", x: -marginProps.top, y: -(marginProps.right - 5), dy: "0.71em", transform: "rotate(-90)", textAnchor: "end", children: label }) }));
42
42
  }
43
43
  export default memo(YAxis);
@@ -20,8 +20,7 @@ function IndicationLines({ axis, show }) {
20
20
  const nucleus = axis === 'X' ? split[0] : axis === 'Y' ? split[1] : null;
21
21
  if (nucleus !== null) {
22
22
  const ranges = data
23
- .filter((_datum) => _datum.display.isVisible === true &&
24
- _datum.info.nucleus === nucleus)
23
+ .filter((_datum) => _datum.display.isVisible && _datum.info.nucleus === nucleus)
25
24
  .filter(isSpectrum1D)
26
25
  .map((_datum) => _datum.ranges.values)
27
26
  .flat();
@@ -37,7 +36,7 @@ function IndicationLines({ axis, show }) {
37
36
  }
38
37
  }, [activeTab, axis, data, displayerMode]);
39
38
  const indicationLines = useMemo(() => {
40
- if (show === true && deltas1D.length > 0) {
39
+ if (show && deltas1D.length > 0) {
41
40
  const lines = deltas1D.map((_delta, i) => {
42
41
  return axis === 'X' ? (_jsx("line", { css: lineStyle, x1: scaleX(_delta), x2: scaleX(_delta), y1: scaleY(yDomain[0]), y2: scaleY(yDomain[1]) }, `indicationLine${axis}${i}`)) : axis === 'Y' ? (_jsx("line", { css: lineStyle, x1: scaleX(xDomain[0]), x2: scaleX(xDomain[1]), y1: scaleY(_delta), y2: scaleY(_delta) }, `indicationLine${axis}${i}`)) : null;
43
42
  });
@@ -6,6 +6,7 @@ import { useDispatch } from '../context/DispatchContext';
6
6
  import { useLoader } from '../context/LoaderContext';
7
7
  import { useAlert } from '../elements/popup/Alert';
8
8
  import { HighlightedSource, useHighlightData } from '../highlight/index';
9
+ import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
9
10
  import useExport from '../hooks/useExport';
10
11
  import useToolsFunctions from '../hooks/useToolsFunctions';
11
12
  import { DISPLAYER_MODE } from '../reducer/core/Constants';
@@ -18,6 +19,7 @@ function KeysListenerTracker() {
18
19
  const openLoader = useLoader();
19
20
  const { handleChangeOption, handleFullZoomOut, alignSpectrumsVerticallyHandler, changeDisplayViewModeHandler, } = useToolsFunctions();
20
21
  const { saveToClipboardHandler, saveAsJSONHandler, saveAsHandler } = useExport();
22
+ const isToolVisible = useCheckToolsVisibility();
21
23
  const { highlight, remove } = useHighlightData();
22
24
  const assignmentData = useAssignmentData();
23
25
  const allow1DTool = useMemo(() => {
@@ -97,21 +99,19 @@ function KeysListenerTracker() {
97
99
  });
98
100
  alert.show(`Configuration Reset, press '${num}' again to reload it.`);
99
101
  }
100
- else {
101
- if (!checkModifierKeyActivated(e)) {
102
- if (keysPreferences?.[num]) {
103
- dispatch({
104
- type: APPLY_KEY_PREFERENCES,
105
- keyCode: num,
106
- });
107
- }
108
- else {
109
- dispatch({
110
- type: SET_KEY_PREFERENCES,
111
- keyCode: num,
112
- });
113
- alert.show(`Configuration saved, press '${num}' again to reload it.`);
114
- }
102
+ else if (!checkModifierKeyActivated(e)) {
103
+ if (keysPreferences?.[num]) {
104
+ dispatch({
105
+ type: APPLY_KEY_PREFERENCES,
106
+ keyCode: num,
107
+ });
108
+ }
109
+ else {
110
+ dispatch({
111
+ type: SET_KEY_PREFERENCES,
112
+ keyCode: num,
113
+ });
114
+ alert.show(`Configuration saved, press '${num}' again to reload it.`);
115
115
  }
116
116
  }
117
117
  }
@@ -137,46 +137,62 @@ function KeysListenerTracker() {
137
137
  if (!e.shiftKey && !e.metaKey) {
138
138
  switch (e.key) {
139
139
  case 'f':
140
- handleFullZoomOut();
140
+ if (isToolVisible('zoomOutTool')) {
141
+ handleFullZoomOut();
142
+ }
141
143
  break;
142
144
  case 'z':
143
145
  case 'Escape':
144
- handleChangeOption(options.zoom.id);
146
+ if (isToolVisible('zoomTool')) {
147
+ handleChangeOption(options.zoom.id);
148
+ }
145
149
  break;
146
150
  case 'r': {
147
151
  if (displayerMode === DISPLAYER_MODE.DM_2D) {
148
- check2DModeWithActiveSpectrum(options.zone2D.label, false);
149
- handleChangeOption(options.zone2D.id);
152
+ if (isToolVisible('zonePickingTool')) {
153
+ check2DModeWithActiveSpectrum(options.zone2D.label, false);
154
+ handleChangeOption(options.zone2D.id);
155
+ }
150
156
  }
151
- else {
157
+ else if (isToolVisible('rangePickingTool')) {
152
158
  check1DModeWithActiveSpectrum(options.rangesPicking.label, false);
153
159
  handleChangeOption(options.rangesPicking.id);
154
160
  }
155
161
  break;
156
162
  }
157
163
  case 'a': {
158
- check1DModeWithActiveSpectrum(options.phaseCorrection.label);
159
- handleChangeOption(options.phaseCorrection.id);
164
+ if (isToolVisible('phaseCorrectionTool')) {
165
+ check1DModeWithActiveSpectrum(options.phaseCorrection.label);
166
+ handleChangeOption(options.phaseCorrection.id);
167
+ }
160
168
  break;
161
169
  }
162
170
  case 'b': {
163
- check1DModeWithActiveSpectrum(options.baseLineCorrection.label);
164
- handleChangeOption(options.baseLineCorrection.id);
171
+ if (isToolVisible('baselineCorrectionTool')) {
172
+ check1DModeWithActiveSpectrum(options.baselineCorrection.label);
173
+ handleChangeOption(options.baselineCorrection.id);
174
+ }
165
175
  break;
166
176
  }
167
177
  case 'p': {
168
- check1DModeWithActiveSpectrum(options.peakPicking.label);
169
- handleChangeOption(options.peakPicking.id);
178
+ if (isToolVisible('peakTool')) {
179
+ check1DModeWithActiveSpectrum(options.peakPicking.label);
180
+ handleChangeOption(options.peakPicking.id);
181
+ }
170
182
  break;
171
183
  }
172
184
  case 'i': {
173
- check1DModeWithActiveSpectrum(options.integral.label);
174
- handleChangeOption(options.integral.id);
185
+ if (isToolVisible('integralTool')) {
186
+ check1DModeWithActiveSpectrum(options.integral.label);
187
+ handleChangeOption(options.integral.id);
188
+ }
175
189
  break;
176
190
  }
177
191
  case 'e': {
178
- check1DModeWithActiveSpectrum(options.exclusionZones.label);
179
- handleChangeOption(options.exclusionZones.id);
192
+ if (isToolVisible('exclusionZonesTool')) {
193
+ check1DModeWithActiveSpectrum(options.exclusionZones.label);
194
+ handleChangeOption(options.exclusionZones.id);
195
+ }
180
196
  break;
181
197
  }
182
198
  default:
@@ -185,13 +201,13 @@ function KeysListenerTracker() {
185
201
  if (!e.shiftKey && !e.metaKey && !e.ctrlKey) {
186
202
  switch (e.key) {
187
203
  case 'c': {
188
- if (allow1DTool) {
204
+ if (allow1DTool && isToolVisible('spectraCenterAlignments')) {
189
205
  alignSpectrumsVerticallyHandler();
190
206
  }
191
207
  break;
192
208
  }
193
209
  case 's': {
194
- if (allow1DTool) {
210
+ if (allow1DTool && isToolVisible('spectraStackAlignments')) {
195
211
  changeDisplayViewModeHandler();
196
212
  }
197
213
  break;
@@ -206,8 +222,10 @@ function KeysListenerTracker() {
206
222
  e.preventDefault();
207
223
  break;
208
224
  case 's':
209
- void saveAsJSONHandler();
210
- e.preventDefault();
225
+ if (isToolVisible('exportAs')) {
226
+ void saveAsJSONHandler();
227
+ e.preventDefault();
228
+ }
211
229
  break;
212
230
  case 'o':
213
231
  openLoader();
@@ -239,6 +257,7 @@ function KeysListenerTracker() {
239
257
  displayerMode,
240
258
  handleChangeOption,
241
259
  handleFullZoomOut,
260
+ isToolVisible,
242
261
  openLoader,
243
262
  saveAsHandler,
244
263
  saveAsJSONHandler,
@@ -257,14 +276,13 @@ function KeysListenerTracker() {
257
276
  if (num > 0) {
258
277
  keysPreferencesListenerHandler(e, num);
259
278
  }
279
+ else if (['Delete', 'Backspace'].includes(e.key) &&
280
+ highlight.sourceData) {
281
+ e.preventDefault();
282
+ void deleteHandler(highlight.sourceData);
283
+ }
260
284
  else {
261
- if (['Delete', 'Backspace'].includes(e.key) && highlight.sourceData) {
262
- e.preventDefault();
263
- void deleteHandler(highlight.sourceData);
264
- }
265
- else {
266
- toolsListenerHandler(e);
267
- }
285
+ toolsListenerHandler(e);
268
286
  }
269
287
  }
270
288
  }, [
@@ -1,15 +1,18 @@
1
1
  /** @jsxImportSource @emotion/react */
2
- import { InitialSeparation } from 'analysis-ui-components/lib-esm/components/SplitPane';
3
2
  import { CorrelationData } from 'nmr-correlation';
4
3
  import { ReactElement, ReactNode } from 'react';
5
4
  import { Datum1D } from '../data/types/data1d';
6
5
  import { Datum2D } from '../data/types/data2d';
7
- import { PanelPreferencesType } from '../types/PanelPreferencesType';
8
- import { State } from './reducer/Reducer';
6
+ import { NMRiumDataReturn } from '../types/NMRiumDataReturn';
7
+ import { NMRiumGeneralPreferences } from '../types/NMRiumGeneralPreferences';
8
+ import { NMRiumPanelPreferences } from '../types/NMRiumPanelPreferences';
9
+ import { NMRiumToolBarPreferences } from '../types/NMRiumToolBarPreferences';
10
+ import { BlobObject } from './utility/Export';
11
+ export type { NMRiumDataReturn } from '../types/NMRiumDataReturn';
9
12
  export declare type NMRiumWorkspace = 'exercise' | 'process1D' | 'default' | 'prediction' | 'embedded';
10
13
  export interface NMRiumProps {
11
14
  data?: NMRiumData;
12
- onDataChange?: (data: State) => void;
15
+ onDataChange?: (data: NMRiumDataReturn) => void;
13
16
  workspace?: NMRiumWorkspace;
14
17
  preferences?: NMRiumPreferences;
15
18
  emptyText?: ReactNode;
@@ -19,49 +22,9 @@ export interface NMRiumProps {
19
22
  getSpinner?: () => ReactElement;
20
23
  }
21
24
  export declare type NMRiumPreferences = Partial<{
22
- general: Partial<{
23
- disableMultipletAnalysis: boolean;
24
- hideSetSumFromMolecule: boolean;
25
- hideGeneralSettings: boolean;
26
- experimentalFeatures: PanelPreferencesType;
27
- hidePanelOnLoad: boolean;
28
- initialPanelWidth?: InitialSeparation;
29
- }>;
30
- panels: Partial<{
31
- spectraPanel: PanelPreferencesType;
32
- informationPanel: PanelPreferencesType;
33
- peaksPanel: PanelPreferencesType;
34
- integralsPanel: PanelPreferencesType;
35
- rangesPanel: PanelPreferencesType;
36
- structuresPanel: PanelPreferencesType;
37
- filtersPanel: PanelPreferencesType;
38
- zonesPanel: PanelPreferencesType;
39
- summaryPanel: PanelPreferencesType;
40
- multipleSpectraAnalysisPanel: PanelPreferencesType;
41
- databasePanel: PanelPreferencesType;
42
- predictionPanel: PanelPreferencesType;
43
- automaticAssignmentPanel: PanelPreferencesType;
44
- }>;
45
- toolBarButtons: Partial<{
46
- zoomTool: boolean;
47
- zoomOutTool: boolean;
48
- import: boolean;
49
- exportAs: boolean;
50
- spectraStackAlignments: boolean;
51
- spectraCenterAlignments: boolean;
52
- realImaginary: boolean;
53
- peakTool: boolean;
54
- integralTool: boolean;
55
- zonePickingTool: boolean;
56
- slicingTool: boolean;
57
- autoRangesTool: boolean;
58
- zeroFillingTool: boolean;
59
- phaseCorrectionTool: boolean;
60
- baseLineCorrectionTool: boolean;
61
- FFTTool: boolean;
62
- multipleSpectraAnalysisTool: boolean;
63
- exclusionZonesTool: boolean;
64
- }>;
25
+ general: Partial<NMRiumGeneralPreferences>;
26
+ panels: Partial<NMRiumPanelPreferences>;
27
+ toolBarButtons: Partial<NMRiumToolBarPreferences>;
65
28
  }>;
66
29
  export declare type Molecules = Array<{
67
30
  molfile: string;
@@ -75,6 +38,8 @@ export interface NMRiumData {
75
38
  spectra: DeepPartial<Spectra>;
76
39
  correlations?: CorrelationData;
77
40
  }
78
- declare function NMRium(props: NMRiumProps): import("@emotion/react/jsx-runtime").JSX.Element;
79
- declare const _default: import("react").MemoExoticComponent<typeof NMRium>;
41
+ export interface NMRiumRef {
42
+ getSpectraViewerAsBlob: () => BlobObject | null;
43
+ }
44
+ declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<NMRiumProps & import("react").RefAttributes<NMRiumRef>>>;
80
45
  export default _default;