nmrium 0.23.0 → 0.24.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 (588) hide show
  1. package/README.md +4 -0
  2. package/lib/component/1d/Chart1D.js +1 -1
  3. package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
  4. package/lib/component/1d/ExclusionZonesAnnotations.js +2 -2
  5. package/lib/component/1d/FooterBanner.js +7 -8
  6. package/lib/component/1d/Integral.js +2 -2
  7. package/lib/component/1d/IntegralResizable.js +1 -1
  8. package/lib/component/1d/IntegralsSeries.js +2 -2
  9. package/lib/component/1d/LinesSeries.js +1 -1
  10. package/lib/component/1d/PeakAnnotation.js +3 -3
  11. package/lib/component/1d/PeakAnnotations.js +1 -1
  12. package/lib/component/1d/Resizable.js +2 -2
  13. package/lib/component/1d/ResurrectedDatabaseRanges.js +1 -1
  14. package/lib/component/1d/SpectraTracker.js +3 -3
  15. package/lib/component/1d/Viewer1D.js +5 -5
  16. package/lib/component/1d/XAxis.js +1 -1
  17. package/lib/component/1d/YAxis.js +1 -1
  18. package/lib/component/1d/jCouplingGraph/JGraph.js +3 -4
  19. package/lib/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
  20. package/lib/component/1d/jCouplingGraph/JsCoupling.js +1 -1
  21. package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  22. package/lib/component/1d/jCouplingGraph/JsCouplings.js +2 -2
  23. package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  24. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  25. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
  26. package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
  27. package/lib/component/1d/multiplicityTree/TreeNodes.js +2 -2
  28. package/lib/component/1d/ranges/Range.js +2 -2
  29. package/lib/component/1d/ranges/RangeIntegral.js +1 -1
  30. package/lib/component/1d/ranges/Ranges.js +2 -2
  31. package/lib/component/1d/tool/BaseLineZones.js +1 -1
  32. package/lib/component/1d/tool/PeakPointer.js +1 -1
  33. package/lib/component/1d/tool/VerticalIndicator.js +1 -1
  34. package/lib/component/1d/tool/XLabelPointer.js +1 -1
  35. package/lib/component/2d/Chart2D.js +2 -2
  36. package/lib/component/2d/Contours.js +6 -6
  37. package/lib/component/2d/FooterBanner.js +3 -3
  38. package/lib/component/2d/Left1DChart.js +1 -1
  39. package/lib/component/2d/SignalDeltaLine.js +1 -1
  40. package/lib/component/2d/Top1DChart.js +1 -1
  41. package/lib/component/2d/Viewer2D.js +3 -3
  42. package/lib/component/2d/XAxis.js +1 -1
  43. package/lib/component/2d/YAxis.js +1 -1
  44. package/lib/component/2d/tools/XYLabelPointer.js +1 -1
  45. package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +1 -1
  46. package/lib/component/2d/tools/slicing/SlicingView.js +1 -1
  47. package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  48. package/lib/component/2d/zones/IndicationLines.js +1 -1
  49. package/lib/component/2d/zones/Signal.js +2 -2
  50. package/lib/component/2d/zones/SignalCrosshair.js +1 -1
  51. package/lib/component/2d/zones/Zone.js +1 -1
  52. package/lib/component/2d/zones/Zones.js +2 -2
  53. package/lib/component/ErrorOverlay.js +1 -1
  54. package/lib/component/EventsTrackers/BrushTracker.js +1 -1
  55. package/lib/component/EventsTrackers/MouseTracker.js +1 -1
  56. package/lib/component/NMRium.d.ts +34 -33
  57. package/lib/component/NMRium.js +10 -10
  58. package/lib/component/assignment/index.js +1 -1
  59. package/lib/component/context/PreferencesContext.d.ts +84 -2
  60. package/lib/component/context/PreferencesContext.js +30 -5
  61. package/lib/component/elements/Button.js +1 -1
  62. package/lib/component/elements/ButtonToolTip.js +1 -1
  63. package/lib/component/elements/CheckBox.js +1 -1
  64. package/lib/component/elements/CloseButton.js +1 -1
  65. package/lib/component/elements/ColorInput.js +1 -1
  66. package/lib/component/elements/ContextMenu.js +1 -1
  67. package/lib/component/elements/DeleteButton.js +1 -1
  68. package/lib/component/elements/EditableColumn.js +1 -1
  69. package/lib/component/elements/Input.js +1 -1
  70. package/lib/component/elements/InputRange.js +1 -1
  71. package/lib/component/elements/IsotopesViewer.js +1 -1
  72. package/lib/component/elements/Label.js +1 -1
  73. package/lib/component/elements/Logo.js +1 -1
  74. package/lib/component/elements/MenuButton.js +3 -3
  75. package/lib/component/elements/MolecularFormulaInput.js +1 -1
  76. package/lib/component/elements/MoleculeSelection.js +1 -1
  77. package/lib/component/elements/NextPrev.js +2 -2
  78. package/lib/component/elements/NumberInput.js +1 -1
  79. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
  80. package/lib/component/elements/ReactTable/ReactTable.js +3 -3
  81. package/lib/component/elements/ReactTable/ReactTableExpandable.js +3 -3
  82. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  83. package/lib/component/elements/SaveButton.js +1 -1
  84. package/lib/component/elements/Select.js +1 -1
  85. package/lib/component/elements/Tab/DeleteButton.js +1 -1
  86. package/lib/component/elements/Tab/Tab.js +3 -3
  87. package/lib/component/elements/Tab/Tabs.js +2 -2
  88. package/lib/component/elements/Table/Table.js +1 -1
  89. package/lib/component/elements/Table/TableBody.js +1 -1
  90. package/lib/component/elements/Table/TableCell.js +1 -1
  91. package/lib/component/elements/Table/TableHead.js +1 -1
  92. package/lib/component/elements/Table/TableRow.js +1 -1
  93. package/lib/component/elements/ToggleButton.js +1 -1
  94. package/lib/component/elements/ToolTip/ToolTip.js +2 -2
  95. package/lib/component/elements/ToolbarMenu.js +3 -3
  96. package/lib/component/elements/accordion/Accordion.js +1 -1
  97. package/lib/component/elements/accordion/AccordionItem.js +2 -2
  98. package/lib/component/elements/dropDownButton/DropDownButton.d.ts +20 -1
  99. package/lib/component/elements/dropDownButton/DropDownButton.js +32 -34
  100. package/lib/component/elements/dropDownButton/DropDownList.d.ts +2 -9
  101. package/lib/component/elements/dropDownButton/DropDownList.js +39 -25
  102. package/lib/component/elements/formik/ErrorMessage.js +2 -2
  103. package/lib/component/elements/formik/FormikCheckBox.d.ts +1 -0
  104. package/lib/component/elements/formik/FormikCheckBox.js +2 -2
  105. package/lib/component/elements/formik/FormikColorInput.js +1 -1
  106. package/lib/component/elements/formik/FormikColorPicker.js +1 -1
  107. package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
  108. package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
  109. package/lib/component/elements/formik/FormikForm.js +1 -1
  110. package/lib/component/elements/formik/FormikInput.js +1 -1
  111. package/lib/component/elements/formik/FormikNumberInput.js +1 -1
  112. package/lib/component/elements/formik/FormikSelect.js +1 -1
  113. package/lib/component/elements/formik/FormikSlider.js +1 -1
  114. package/lib/component/elements/formik/FormikTextarea.js +1 -1
  115. package/lib/component/elements/formik/Input.js +1 -1
  116. package/lib/component/elements/formik/SelectBox.js +1 -1
  117. package/lib/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
  118. package/lib/component/elements/popup/Alert/ProgressIndicator.js +1 -1
  119. package/lib/component/elements/popup/Alert/Provider.js +3 -3
  120. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  121. package/lib/component/elements/popup/Modal/Modal.js +1 -1
  122. package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
  123. package/lib/component/elements/popup/Modal/Provider.js +3 -3
  124. package/lib/component/elements/popup/Transition.js +1 -1
  125. package/lib/component/elements/popup/Wrapper.js +1 -1
  126. package/lib/component/elements/toggle/ToggleButton.js +1 -1
  127. package/lib/component/elements/toggle/ToggleButtonGroup.js +1 -1
  128. package/lib/component/header/AutoPeakPickingOptionPanel.js +3 -3
  129. package/lib/component/header/BaseLineCorrectionPanel.js +1 -1
  130. package/lib/component/header/Header.js +28 -14
  131. package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -2
  132. package/lib/component/header/RangesPickingOptionPanel.js +2 -2
  133. package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
  134. package/lib/component/header/Zones2DOptionPanel.js +1 -1
  135. package/lib/component/highlight/index.js +1 -1
  136. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  137. package/lib/component/hooks/useCheckExperimentalFeature.js +5 -4
  138. package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
  139. package/lib/component/hooks/useExport.js +15 -13
  140. package/lib/component/hooks/useTableSortBy.d.ts +2 -1
  141. package/lib/component/hooks/useTableSortBy.js +27 -16
  142. package/lib/component/loader/DefaultSpinnerComponent.js +1 -1
  143. package/lib/component/loader/DropZone.js +2 -2
  144. package/lib/component/loader/NoData.js +1 -3
  145. package/lib/component/loader/Spinner.js +1 -1
  146. package/lib/component/loader/SpinnerContext.js +1 -1
  147. package/lib/component/modal/AboutUsModal.js +4 -4
  148. package/lib/component/modal/AlignSpectraModal.js +1 -1
  149. package/lib/component/modal/CopyClipboardModal.js +2 -2
  150. package/lib/component/modal/ExportAsMatrixModal.js +1 -1
  151. package/lib/component/modal/ImportPublicationStringModal.js +13 -11
  152. package/lib/component/modal/LoadJCAMPModal.js +1 -1
  153. package/lib/component/modal/ModalStyle.js +1 -1
  154. package/lib/component/modal/MoleculeStructureEditorModal.js +1 -1
  155. package/lib/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
  156. package/lib/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
  157. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +4 -4
  158. package/lib/component/modal/MultipletAnalysisModal.js +5 -5
  159. package/lib/component/modal/PredictSpectraModal.js +30 -23
  160. package/lib/component/modal/SaveAsModal.js +2 -2
  161. package/lib/component/modal/changeSum/ChangeSumModal.js +8 -7
  162. package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
  163. package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -1
  164. package/lib/component/modal/editRange/EditRangeModal.js +13 -9
  165. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +33 -40
  166. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
  167. package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  168. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  169. package/lib/component/modal/editRange/forms/components/SignalsForm.js +5 -5
  170. package/lib/component/modal/editZone/EditPathLengthFormik.js +3 -3
  171. package/lib/component/modal/editZone/EditZoneModal.js +17 -15
  172. package/lib/component/modal/editZone/SignalFormTab.js +1 -1
  173. package/lib/component/modal/editZone/SignalsForm.js +2 -2
  174. package/lib/component/modal/setting/ControllersTabContent.js +1 -1
  175. package/lib/component/modal/setting/DisplayTabContent.d.ts +2 -2
  176. package/lib/component/modal/setting/DisplayTabContent.js +49 -15
  177. package/lib/component/modal/setting/FormattingTabContent.js +3 -3
  178. package/lib/component/modal/setting/GeneralSettings.js +61 -76
  179. package/lib/component/modal/setting/WorkspaceItem.d.ts +6 -0
  180. package/lib/component/modal/setting/WorkspaceItem.js +59 -0
  181. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
  182. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +2 -2
  183. package/lib/component/panels/InformationPanel.js +4 -4
  184. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
  185. package/lib/component/panels/IntegralsPanel/IntegralTable.js +6 -6
  186. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
  187. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  188. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +5 -5
  189. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
  190. package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  191. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  192. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
  193. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +3 -3
  194. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
  195. package/lib/component/panels/Panels.js +46 -34
  196. package/lib/component/panels/PeaksPanel/PeaksPanel.js +2 -2
  197. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
  198. package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -4
  199. package/lib/component/panels/RangesPanel/RangesHeader.js +16 -14
  200. package/lib/component/panels/RangesPanel/RangesPanel.js +3 -4
  201. package/lib/component/panels/RangesPanel/RangesPreferences.js +4 -5
  202. package/lib/component/panels/RangesPanel/RangesTable.js +3 -3
  203. package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -1
  204. package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
  205. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -6
  206. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +6 -66
  207. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  208. package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  209. package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
  210. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  211. package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  212. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  213. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +7 -0
  214. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +74 -0
  215. package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +7 -0
  216. package/lib/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
  217. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
  218. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
  219. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
  220. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
  221. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
  222. package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  223. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
  224. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
  225. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
  226. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
  227. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
  228. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
  229. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  230. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +4 -4
  231. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +1 -1
  232. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -4
  233. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
  234. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +3 -3
  235. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +3 -3
  236. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
  237. package/lib/component/panels/SummaryPanel/Overview.js +2 -2
  238. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  239. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
  240. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -4
  241. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
  242. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  243. package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  244. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  245. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
  246. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
  247. package/lib/component/panels/ZonesPanel/ZonesPanel.js +4 -7
  248. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
  249. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
  250. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
  251. package/lib/component/panels/databasePanel/DatabasePanel.js +3 -3
  252. package/lib/component/panels/databasePanel/DatabasePreferences.js +3 -4
  253. package/lib/component/panels/databasePanel/DatabaseTable.js +4 -4
  254. package/lib/component/panels/extra/placeholder/NoTableData.js +1 -1
  255. package/lib/component/panels/filtersPanel/FilterPanel.js +2 -2
  256. package/lib/component/panels/filtersPanel/FiltersTable.js +19 -15
  257. package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
  258. package/lib/component/panels/header/PreferencesHeader.js +1 -1
  259. package/lib/component/panels/predictionPanel/PredictionOptions.js +5 -3
  260. package/lib/component/panels/predictionPanel/PredictionPanel.js +19 -17
  261. package/lib/component/reducer/Reducer.d.ts +7 -0
  262. package/lib/component/reducer/Reducer.js +7 -3
  263. package/lib/component/reducer/actions/FiltersActions.js +1 -1
  264. package/lib/component/reducer/actions/LoadActions.d.ts +2 -2
  265. package/lib/component/reducer/actions/LoadActions.js +20 -15
  266. package/lib/component/reducer/actions/MoleculeActions.js +5 -1
  267. package/lib/component/reducer/preferencesReducer.d.ts +183 -36
  268. package/lib/component/reducer/preferencesReducer.js +192 -83
  269. package/lib/component/reducer/types/Types.d.ts +6 -0
  270. package/lib/component/tool/BrushX.js +1 -1
  271. package/lib/component/tool/BrushXY.js +1 -1
  272. package/lib/component/tool/CrossLinePointer.js +1 -1
  273. package/lib/component/toolbar/BasicToolBar.js +23 -27
  274. package/lib/component/toolbar/FunctionToolBar.js +17 -18
  275. package/lib/component/toolbar/HistoryToolBar.js +1 -1
  276. package/lib/component/toolbar/ToolBar.js +2 -2
  277. package/lib/component/utility/FormatNumber.js +1 -1
  278. package/lib/component/workspaces/Workspace.d.ts +17 -0
  279. package/lib/component/workspaces/basic.js +29 -34
  280. package/lib/component/workspaces/exercise.d.ts +2 -0
  281. package/lib/component/workspaces/exercise.js +49 -0
  282. package/lib/component/workspaces/index.d.ts +3 -2
  283. package/lib/component/workspaces/index.js +3 -2
  284. package/lib/component/workspaces/prediction.d.ts +2 -0
  285. package/lib/component/workspaces/prediction.js +26 -0
  286. package/lib/component/workspaces/process1D.js +21 -32
  287. package/lib/data/PredictionManager.d.ts +2 -1
  288. package/lib/data/PredictionManager.js +20 -13
  289. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +4 -1
  290. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +2 -3
  291. package/lib/data/utilities/getAtom.js +1 -1
  292. package/lib/data/utilities/getColor.d.ts +1 -0
  293. package/lib/data/utilities/getColor.js +1 -1
  294. package/lib/types/PanelPreferencesType.d.ts +10 -0
  295. package/lib/types/PanelPreferencesType.js +1 -0
  296. package/lib/versionInfo.js +1 -1
  297. package/lib-cjs/component/1d/Chart1D.js +1 -1
  298. package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +1 -1
  299. package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +7 -3
  300. package/lib-cjs/component/1d/FooterBanner.js +7 -8
  301. package/lib-cjs/component/1d/Integral.js +2 -2
  302. package/lib-cjs/component/1d/IntegralResizable.js +1 -1
  303. package/lib-cjs/component/1d/IntegralsSeries.js +2 -2
  304. package/lib-cjs/component/1d/Line.js +5 -1
  305. package/lib-cjs/component/1d/LinesSeries.js +1 -1
  306. package/lib-cjs/component/1d/PeakAnnotation.js +3 -3
  307. package/lib-cjs/component/1d/PeakAnnotations.js +1 -1
  308. package/lib-cjs/component/1d/Resizable.js +2 -2
  309. package/lib-cjs/component/1d/ResurrectedDatabaseRanges.js +1 -1
  310. package/lib-cjs/component/1d/SpectraTracker.js +3 -3
  311. package/lib-cjs/component/1d/Viewer1D.js +10 -6
  312. package/lib-cjs/component/1d/XAxis.js +6 -2
  313. package/lib-cjs/component/1d/YAxis.js +6 -2
  314. package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +3 -4
  315. package/lib-cjs/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
  316. package/lib-cjs/component/1d/jCouplingGraph/JsCoupling.js +1 -1
  317. package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
  318. package/lib-cjs/component/1d/jCouplingGraph/JsCouplings.js +2 -2
  319. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  320. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
  321. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
  322. package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
  323. package/lib-cjs/component/1d/multiplicityTree/TreeNodes.js +2 -2
  324. package/lib-cjs/component/1d/ranges/Range.js +2 -2
  325. package/lib-cjs/component/1d/ranges/RangeIntegral.js +1 -1
  326. package/lib-cjs/component/1d/ranges/Ranges.js +2 -2
  327. package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -1
  328. package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
  329. package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
  330. package/lib-cjs/component/1d/tool/XLabelPointer.js +1 -1
  331. package/lib-cjs/component/2d/Chart2D.js +2 -2
  332. package/lib-cjs/component/2d/Contours.js +6 -6
  333. package/lib-cjs/component/2d/FooterBanner.js +3 -3
  334. package/lib-cjs/component/2d/Left1DChart.js +6 -2
  335. package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
  336. package/lib-cjs/component/2d/Top1DChart.js +6 -2
  337. package/lib-cjs/component/2d/Viewer2D.js +8 -4
  338. package/lib-cjs/component/2d/XAxis.js +6 -2
  339. package/lib-cjs/component/2d/YAxis.js +6 -2
  340. package/lib-cjs/component/2d/tools/XYLabelPointer.js +1 -1
  341. package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +6 -2
  342. package/lib-cjs/component/2d/tools/slicing/SlicingView.js +1 -1
  343. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +6 -2
  344. package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
  345. package/lib-cjs/component/2d/zones/Signal.js +2 -2
  346. package/lib-cjs/component/2d/zones/SignalCrosshair.js +1 -1
  347. package/lib-cjs/component/2d/zones/Zone.js +1 -1
  348. package/lib-cjs/component/2d/zones/Zones.js +2 -2
  349. package/lib-cjs/component/ErrorOverlay.js +1 -1
  350. package/lib-cjs/component/EventsTrackers/BrushTracker.js +1 -1
  351. package/lib-cjs/component/EventsTrackers/MouseTracker.js +1 -1
  352. package/lib-cjs/component/NMRium.js +14 -10
  353. package/lib-cjs/component/assignment/index.js +1 -1
  354. package/lib-cjs/component/context/PreferencesContext.js +33 -4
  355. package/lib-cjs/component/elements/Button.js +1 -1
  356. package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
  357. package/lib-cjs/component/elements/CheckBox.js +1 -1
  358. package/lib-cjs/component/elements/CloseButton.js +1 -1
  359. package/lib-cjs/component/elements/ColorInput.js +1 -1
  360. package/lib-cjs/component/elements/ContextMenu.js +1 -1
  361. package/lib-cjs/component/elements/DeleteButton.js +1 -1
  362. package/lib-cjs/component/elements/EditableColumn.js +1 -1
  363. package/lib-cjs/component/elements/Input.js +1 -1
  364. package/lib-cjs/component/elements/InputRange.js +1 -1
  365. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  366. package/lib-cjs/component/elements/Label.js +1 -1
  367. package/lib-cjs/component/elements/Logo.js +1 -1
  368. package/lib-cjs/component/elements/MenuButton.js +3 -3
  369. package/lib-cjs/component/elements/MolecularFormulaInput.js +1 -1
  370. package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
  371. package/lib-cjs/component/elements/NextPrev.js +2 -2
  372. package/lib-cjs/component/elements/NumberInput.js +1 -1
  373. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
  374. package/lib-cjs/component/elements/ReactTable/ReactTable.js +8 -4
  375. package/lib-cjs/component/elements/ReactTable/ReactTableExpandable.js +3 -3
  376. package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  377. package/lib-cjs/component/elements/SaveButton.js +1 -1
  378. package/lib-cjs/component/elements/Select.js +1 -1
  379. package/lib-cjs/component/elements/Tab/DeleteButton.js +1 -1
  380. package/lib-cjs/component/elements/Tab/Tab.js +3 -3
  381. package/lib-cjs/component/elements/Tab/Tabs.js +2 -2
  382. package/lib-cjs/component/elements/Table/Table.js +1 -1
  383. package/lib-cjs/component/elements/Table/TableBody.js +1 -1
  384. package/lib-cjs/component/elements/Table/TableCell.js +1 -1
  385. package/lib-cjs/component/elements/Table/TableHead.js +1 -1
  386. package/lib-cjs/component/elements/Table/TableRow.js +1 -1
  387. package/lib-cjs/component/elements/ToggleButton.js +1 -1
  388. package/lib-cjs/component/elements/ToolTip/ToolTip.js +2 -2
  389. package/lib-cjs/component/elements/ToolbarMenu.js +3 -3
  390. package/lib-cjs/component/elements/accordion/Accordion.js +1 -1
  391. package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
  392. package/lib-cjs/component/elements/dropDownButton/DropDownButton.js +32 -34
  393. package/lib-cjs/component/elements/dropDownButton/DropDownList.js +39 -25
  394. package/lib-cjs/component/elements/formik/ErrorMessage.js +2 -2
  395. package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
  396. package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
  397. package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
  398. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
  399. package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
  400. package/lib-cjs/component/elements/formik/FormikForm.js +1 -1
  401. package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
  402. package/lib-cjs/component/elements/formik/FormikNumberInput.js +1 -1
  403. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  404. package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
  405. package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
  406. package/lib-cjs/component/elements/formik/Input.js +1 -1
  407. package/lib-cjs/component/elements/formik/SelectBox.js +1 -1
  408. package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
  409. package/lib-cjs/component/elements/popup/Alert/ProgressIndicator.js +1 -1
  410. package/lib-cjs/component/elements/popup/Alert/Provider.js +3 -3
  411. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  412. package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
  413. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
  414. package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -3
  415. package/lib-cjs/component/elements/popup/Transition.js +1 -1
  416. package/lib-cjs/component/elements/popup/Wrapper.js +1 -1
  417. package/lib-cjs/component/elements/toggle/ToggleButton.js +1 -1
  418. package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +1 -1
  419. package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -3
  420. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -2
  421. package/lib-cjs/component/header/Header.js +27 -13
  422. package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +7 -3
  423. package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -2
  424. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
  425. package/lib-cjs/component/header/Zones2DOptionPanel.js +1 -1
  426. package/lib-cjs/component/highlight/index.js +1 -1
  427. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  428. package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -4
  429. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +1 -1
  430. package/lib-cjs/component/hooks/useExport.js +15 -13
  431. package/lib-cjs/component/hooks/useTableSortBy.js +27 -16
  432. package/lib-cjs/component/loader/DefaultSpinnerComponent.js +1 -1
  433. package/lib-cjs/component/loader/DropZone.js +2 -2
  434. package/lib-cjs/component/loader/NoData.js +1 -3
  435. package/lib-cjs/component/loader/Spinner.js +1 -1
  436. package/lib-cjs/component/loader/SpinnerContext.js +1 -1
  437. package/lib-cjs/component/modal/AboutUsModal.js +4 -4
  438. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
  439. package/lib-cjs/component/modal/CopyClipboardModal.js +2 -2
  440. package/lib-cjs/component/modal/ExportAsMatrixModal.js +1 -1
  441. package/lib-cjs/component/modal/ImportPublicationStringModal.js +18 -12
  442. package/lib-cjs/component/modal/LoadJCAMPModal.js +1 -1
  443. package/lib-cjs/component/modal/ModalStyle.js +1 -1
  444. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +1 -1
  445. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
  446. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
  447. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +9 -5
  448. package/lib-cjs/component/modal/MultipletAnalysisModal.js +5 -5
  449. package/lib-cjs/component/modal/PredictSpectraModal.js +35 -24
  450. package/lib-cjs/component/modal/SaveAsModal.js +2 -2
  451. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +13 -8
  452. package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
  453. package/lib-cjs/component/modal/editRange/EditRangeModal.js +13 -9
  454. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +38 -41
  455. package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
  456. package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  457. package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  458. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +5 -5
  459. package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +5 -1
  460. package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +3 -3
  461. package/lib-cjs/component/modal/editZone/EditZoneModal.js +17 -15
  462. package/lib-cjs/component/modal/editZone/SignalFormTab.js +1 -1
  463. package/lib-cjs/component/modal/editZone/SignalsForm.js +2 -2
  464. package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +5 -1
  465. package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
  466. package/lib-cjs/component/modal/setting/DisplayTabContent.js +48 -14
  467. package/lib-cjs/component/modal/setting/FormattingTabContent.js +3 -3
  468. package/lib-cjs/component/modal/setting/GeneralSettings.js +64 -75
  469. package/lib-cjs/component/modal/setting/WorkspaceItem.js +64 -0
  470. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
  471. package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +2 -2
  472. package/lib-cjs/component/panels/InformationPanel.js +4 -4
  473. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
  474. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +6 -6
  475. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
  476. package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  477. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +5 -5
  478. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
  479. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  480. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
  481. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
  482. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +8 -4
  483. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
  484. package/lib-cjs/component/panels/Panels.js +46 -34
  485. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +2 -2
  486. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
  487. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +9 -5
  488. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +16 -14
  489. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +3 -4
  490. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -5
  491. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -3
  492. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -1
  493. package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
  494. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +5 -65
  495. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  496. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
  497. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
  498. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
  499. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  500. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
  501. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +80 -0
  502. package/lib-cjs/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
  503. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
  504. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
  505. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
  506. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
  507. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
  508. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
  509. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
  510. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
  511. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
  512. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
  513. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
  514. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
  515. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
  516. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +4 -4
  517. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +1 -1
  518. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -4
  519. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
  520. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +8 -4
  521. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +3 -3
  522. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
  523. package/lib-cjs/component/panels/SummaryPanel/Overview.js +2 -2
  524. package/lib-cjs/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  525. package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
  526. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +4 -4
  527. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
  528. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
  529. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
  530. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
  531. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
  532. package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
  533. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +4 -7
  534. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
  535. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -2
  536. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
  537. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -3
  538. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -4
  539. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +4 -4
  540. package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +1 -1
  541. package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +2 -2
  542. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +19 -15
  543. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +2 -2
  544. package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
  545. package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +10 -4
  546. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +19 -17
  547. package/lib-cjs/component/reducer/IgnoreActions.js +5 -1
  548. package/lib-cjs/component/reducer/Reducer.js +14 -5
  549. package/lib-cjs/component/reducer/actions/FiltersActions.js +6 -2
  550. package/lib-cjs/component/reducer/actions/LoadActions.js +25 -16
  551. package/lib-cjs/component/reducer/actions/MoleculeActions.js +10 -2
  552. package/lib-cjs/component/reducer/actions/RangesActions.js +5 -1
  553. package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -1
  554. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +5 -1
  555. package/lib-cjs/component/reducer/actions/ToolsActions.js +5 -1
  556. package/lib-cjs/component/reducer/actions/ZonesActions.js +5 -1
  557. package/lib-cjs/component/reducer/preferencesReducer.js +191 -81
  558. package/lib-cjs/component/tool/BrushX.js +1 -1
  559. package/lib-cjs/component/tool/BrushXY.js +1 -1
  560. package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
  561. package/lib-cjs/component/toolbar/BasicToolBar.js +23 -27
  562. package/lib-cjs/component/toolbar/FunctionToolBar.js +22 -19
  563. package/lib-cjs/component/toolbar/HistoryToolBar.js +1 -1
  564. package/lib-cjs/component/toolbar/ToolBar.js +2 -2
  565. package/lib-cjs/component/toolbar/ToolTypes.js +5 -1
  566. package/lib-cjs/component/utility/FormatNumber.js +1 -1
  567. package/lib-cjs/component/workspaces/basic.js +29 -34
  568. package/lib-cjs/component/workspaces/exercise.js +52 -0
  569. package/lib-cjs/component/workspaces/index.js +3 -2
  570. package/lib-cjs/component/workspaces/prediction.js +29 -0
  571. package/lib-cjs/component/workspaces/process1D.js +21 -32
  572. package/lib-cjs/data/Filters.js +5 -1
  573. package/lib-cjs/data/FiltersManager.js +5 -1
  574. package/lib-cjs/data/PredictionManager.js +19 -12
  575. package/lib-cjs/data/SpectraManager.js +5 -1
  576. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -2
  577. package/lib-cjs/data/data1d/Spectrum1D/shift/getShiftX.js +5 -1
  578. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +7 -4
  579. package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +5 -1
  580. package/lib-cjs/data/utilities/getAtom.js +1 -1
  581. package/lib-cjs/data/utilities/getColor.js +2 -1
  582. package/lib-cjs/types/PanelPreferencesType.js +2 -0
  583. package/lib-cjs/versionInfo.js +1 -1
  584. package/package.json +21 -21
  585. package/lib/component/panels/RangesPanel/useMapRanges.d.ts +0 -6
  586. package/lib/component/workspaces/exercise1D.d.ts +0 -2
  587. package/lib/component/workspaces/exercise1D.js +0 -46
  588. package/lib-cjs/component/workspaces/exercise1D.js +0 -49
@@ -1,157 +1,266 @@
1
- import { produce } from 'immer';
1
+ import { produce, original } from 'immer';
2
2
  import lodashMerge from 'lodash/merge';
3
+ import generateID from '../../data/utilities/generateID';
3
4
  import { getLocalStorage, removeData, storeData, } from '../utility/LocalStorage';
4
- import workspaces from '../workspaces';
5
- export const INIT_PREFERENCES = 'INIT_PREFERENCES';
6
- export const SET_PREFERENCES = 'SET_PREFERENCES';
7
- export const RESET_PREFERENCES = 'RESET_PREFERENCES';
8
- export const SET_PANELS_PREFERENCES = 'SET_PANELS_PREFERENCES';
9
- const LOCAL_STORAGE_VERSION = 3;
5
+ import Workspaces from '../workspaces';
6
+ const LOCAL_STORAGE_VERSION = 5;
7
+ export const WORKSPACES = [
8
+ {
9
+ key: 'default',
10
+ label: Workspaces.default.label,
11
+ },
12
+ {
13
+ key: 'process1D',
14
+ label: Workspaces.process1D.label,
15
+ },
16
+ {
17
+ key: 'exercise',
18
+ label: Workspaces.exercise.label,
19
+ },
20
+ {
21
+ key: 'prediction',
22
+ label: Workspaces.prediction.label,
23
+ },
24
+ ];
10
25
  function getPreferencesByWorkspace(workspace) {
11
26
  switch (workspace) {
12
- case 'exercise1D':
13
- return workspaces.exercise1D;
27
+ case 'exercise':
28
+ return Workspaces.exercise;
14
29
  case 'process1D':
15
- return workspaces.process1D;
30
+ return Workspaces.process1D;
31
+ case 'prediction':
32
+ return Workspaces.prediction;
33
+ case 'default':
34
+ return Workspaces.default;
16
35
  default:
17
- return workspaces.basic;
36
+ return {};
18
37
  }
19
38
  }
39
+ function getActiveWorkspace(draft) {
40
+ return draft.workspaces[draft.workspace.current || 'default'];
41
+ }
20
42
  export const preferencesInitialState = {
21
- basePreferences: {},
22
- display: workspaces.basic.display,
23
- controllers: {
24
- dimmedSpectraTransparency: 0.1,
25
- },
26
- formatting: {
27
- nucleus: [
28
- { key: '1H', name: '1H', ppm: '0.00', hz: '0.00' },
29
- { key: '13C', name: '13C', ppm: '0.00', hz: '0.00' },
30
- { key: '15N', name: '15N', ppm: '0.00', hz: '0.00' },
31
- { key: '19F', name: '19F', ppm: '0.00', hz: '0.00' },
32
- { key: '29Si', name: '29Si', ppm: '0.00', hz: '0.00' },
33
- { key: '31P', name: '31P', ppm: '0.00', hz: '0.00' },
34
- ],
35
- nucleusByKey: {},
36
- panels: {},
43
+ version: LOCAL_STORAGE_VERSION,
44
+ workspaces: {},
45
+ dispatch: () => null,
46
+ workspace: {
47
+ current: 'default',
48
+ base: null,
37
49
  },
38
- dispatch: null,
39
- workspace: 'default',
40
50
  };
41
- function getTruthyObjectValues(data) {
51
+ function filterObject(data) {
42
52
  return JSON.parse(JSON.stringify(data), (key, value) => {
43
- if (value) {
53
+ if (value?.hidden !== true) {
44
54
  return value;
45
55
  }
46
56
  });
47
57
  }
58
+ function FlatObject(data) {
59
+ let result = {};
60
+ JSON.parse(JSON.stringify(data), (key, value) => {
61
+ if (value?.hidden !== true && key) {
62
+ result[key] = result[key]++ || 1;
63
+ }
64
+ });
65
+ return result;
66
+ }
67
+ function checkKeysExists(sourceObject, targetObject) {
68
+ const source = FlatObject(sourceObject);
69
+ const target = FlatObject(targetObject);
70
+ if (Object.keys(target).length === 0) {
71
+ return false;
72
+ }
73
+ for (const [key, value] of Object.entries(source)) {
74
+ if (!target[key] || target[key] !== value) {
75
+ return false;
76
+ }
77
+ }
78
+ return true;
79
+ }
48
80
  function mapNucleus(draft) {
49
- if (draft.formatting.nucleus && Array.isArray(draft.formatting.nucleus)) {
50
- draft.formatting.nucleusByKey = draft.formatting.nucleus.reduce((acc, item) => {
51
- acc[item.name.toLowerCase()] = item;
52
- return { ...acc };
53
- }, {});
81
+ const currentWorkspacePreferences = getActiveWorkspace(draft);
82
+ if (currentWorkspacePreferences.formatting.nucleus &&
83
+ Array.isArray(currentWorkspacePreferences.formatting.nucleus)) {
84
+ currentWorkspacePreferences.formatting.nucleusByKey =
85
+ currentWorkspacePreferences.formatting.nucleus.reduce((acc, item) => {
86
+ acc[item.name.toLowerCase()] = item;
87
+ return { ...acc };
88
+ }, {});
54
89
  }
55
90
  }
56
- function handleInit(draft, action) {
91
+ export function initPreferencesState(state) {
57
92
  const nmrLocalStorageVersion = getLocalStorage('nmr-local-storage-version', false);
58
93
  let localData = getLocalStorage('nmr-general-settings');
59
94
  // remove old nmr-local-storage-version key
60
95
  if (nmrLocalStorageVersion && localData?.version) {
61
96
  removeData('nmr-local-storage-version');
62
97
  }
98
+ // if the local setting version != current settings version number
63
99
  if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
64
100
  removeData('nmr-general-settings');
65
101
  }
102
+ return {
103
+ ...state,
104
+ workspaces: localData?.workspaces || { default: Workspaces.default },
105
+ };
106
+ }
107
+ function handleInit(draft, action) {
66
108
  if (action.payload) {
109
+ const localData = getLocalStorage('nmr-general-settings');
67
110
  const { dispatch, workspace, ...resProps } = action.payload;
68
- draft.workspace = workspace;
69
- const workspacePreferences = getPreferencesByWorkspace(workspace);
70
- if (!localData ||
71
- !localData?.workspaces[workspace] ||
72
- workspacePreferences.version !== localData?.workspaces[workspace]?.version) {
73
- localData = localData || {};
74
- localData = {
75
- version: LOCAL_STORAGE_VERSION,
111
+ /**
112
+ * set the current workspace what the user-defined in the setting if the workspace is not defined at the level of component, otherwise
113
+ * use the default workspace
114
+ *
115
+ */
116
+ draft.workspace =
117
+ !workspace && localData?.currentWorkspace
118
+ ? { current: localData.currentWorkspace, base: null }
119
+ : { current: workspace || 'default', base: workspace };
120
+ const workspacePreferences = lodashMerge({}, getPreferencesByWorkspace(draft.workspace.current), resProps);
121
+ const currentWorkspacePreferences = getActiveWorkspace(draft);
122
+ /**
123
+ * Update the local storage general preferences
124
+ * 1- if local storage is empty.
125
+ * 2- if predefine workspaces.
126
+ * 3- b) if workspace not exists in the local storage
127
+ * c) if the local setting workspace version != current workspace version number
128
+ * d) if hard code workspace parameters != current workspace parameters
129
+ */
130
+ if ((Workspaces[draft.workspace.current] &&
131
+ (!currentWorkspacePreferences ||
132
+ workspacePreferences?.version !==
133
+ currentWorkspacePreferences?.version ||
134
+ !checkKeysExists(workspacePreferences.display, currentWorkspacePreferences?.display))) ||
135
+ !localData) {
136
+ const { workspaces, version } = draft || {};
137
+ const display = filterObject(workspacePreferences.display);
138
+ const data = {
139
+ version,
76
140
  workspaces: {
77
- ...localData.workspaces,
78
- [workspace]: {
141
+ ...workspaces,
142
+ [draft.workspace.current]: {
79
143
  ...workspacePreferences,
80
- controllers: draft.controllers,
81
- formatting: draft.formatting,
144
+ display,
82
145
  },
83
146
  },
84
147
  };
85
- storeData('nmr-general-settings', JSON.stringify(localData));
148
+ draft.workspaces[draft.workspace.current] = lodashMerge({}, currentWorkspacePreferences, workspacePreferences);
149
+ storeData('nmr-general-settings', JSON.stringify(data));
86
150
  }
87
- draft.basePreferences = lodashMerge({}, workspacePreferences, resProps);
88
- const hiddenModeFeatures = getTruthyObjectValues(draft.basePreferences.display);
89
- let hiddenLocalStorageFeatures = {};
90
- draft.dispatch = dispatch;
91
- const localStorageModePreferences = localData?.workspaces[workspace] || null;
92
- if (localStorageModePreferences) {
93
- Object.entries(localStorageModePreferences).forEach(([k, v]) => {
94
- if (k === 'display') {
95
- hiddenLocalStorageFeatures = getTruthyObjectValues(v);
96
- }
97
- else if (!['dispatch', 'basePreferences'].includes(k)) {
98
- draft[k] = lodashMerge({}, resProps[k] ? resProps[k] : {}, v);
99
- }
100
- });
101
- mapNucleus(draft);
151
+ else {
152
+ currentWorkspacePreferences.display = lodashMerge({}, workspacePreferences.display, currentWorkspacePreferences.display);
102
153
  }
103
- draft.display = lodashMerge({}, getPreferencesByWorkspace('default').display, hiddenModeFeatures, hiddenLocalStorageFeatures);
154
+ draft.dispatch = dispatch;
104
155
  }
105
156
  }
106
157
  function handleSetPreferences(draft, action) {
107
158
  if (action.payload) {
159
+ const currentWorkspacePreferences = getActiveWorkspace(draft);
108
160
  const { controllers, formatting, display } = action.payload;
109
161
  let localData = getLocalStorage('nmr-general-settings');
162
+ localData.currentWorkspace = draft.workspace.current;
110
163
  localData.workspaces = {
111
164
  ...localData.workspaces,
112
- [draft.workspace]: {
113
- ...localData.workspaces[draft.workspace],
165
+ [draft.workspace.current]: {
166
+ ...localData.workspaces[draft.workspace.current],
114
167
  controllers,
115
168
  formatting,
116
169
  display,
117
170
  },
118
171
  };
119
172
  storeData('nmr-general-settings', JSON.stringify(localData));
120
- draft.controllers = controllers;
121
- draft.formatting = formatting;
122
- draft.display.panels = display.panels;
123
- draft.display.general.hideExperimentalFeatures =
124
- display.general.hideExperimentalFeatures;
173
+ currentWorkspacePreferences.controllers = controllers;
174
+ currentWorkspacePreferences.formatting = formatting;
175
+ currentWorkspacePreferences.display = {
176
+ ...currentWorkspacePreferences.display,
177
+ panels: display.panels,
178
+ general: {
179
+ ...(currentWorkspacePreferences.display.general || {}),
180
+ experimentalFeatures: display.general.experimentalFeatures,
181
+ },
182
+ };
125
183
  mapNucleus(draft);
126
184
  }
127
185
  }
128
186
  function handleSetPanelsPreferences(draft, action) {
129
187
  if (action.payload) {
188
+ const currentWorkspacePreferences = getActiveWorkspace(draft);
130
189
  const { key, value } = action.payload;
131
190
  let localData = getLocalStorage('nmr-general-settings');
132
- localData.workspaces[draft.workspace].formatting.panels[key] = value;
191
+ localData.workspaces[draft.workspace.current].formatting.panels[key] =
192
+ value;
133
193
  storeData('nmr-general-settings', JSON.stringify(localData));
134
- draft.formatting.panels[key] = value;
194
+ currentWorkspacePreferences.formatting.panels[key] = value;
135
195
  }
136
196
  }
137
197
  function handleResetPreferences(draft) {
198
+ const currentWorkspacePreferences = getActiveWorkspace(draft);
138
199
  let localData = getLocalStorage('nmr-general-settings');
139
- const hiddenFeatures = getTruthyObjectValues(draft.basePreferences.display);
140
- const workSpaceDisplayPreferences = lodashMerge({}, getPreferencesByWorkspace(draft.workspace).display, hiddenFeatures);
141
- localData.workspaces[draft.workspace].display = workSpaceDisplayPreferences;
142
- draft.display = workSpaceDisplayPreferences;
200
+ const workSpaceDisplayPreferences = getPreferencesByWorkspace(draft.workspace.current).display;
201
+ if (localData.workspaces[draft.workspace.current]) {
202
+ localData.workspaces[draft.workspace.current].display =
203
+ workSpaceDisplayPreferences;
204
+ storeData('nmr-general-settings', JSON.stringify(localData));
205
+ }
206
+ currentWorkspacePreferences.display = workSpaceDisplayPreferences;
207
+ }
208
+ function handleSetWorkspace(draft, action) {
209
+ const workspaceKey = action.payload.workspace;
210
+ if (!draft.workspaces[workspaceKey]) {
211
+ draft.workspaces[workspaceKey] = getPreferencesByWorkspace(workspaceKey);
212
+ }
213
+ draft.workspace.current = workspaceKey;
214
+ }
215
+ function handleAddWorkspace(draft, action) {
216
+ const { workspace: workspaceName, data: { display, controllers, formatting }, } = action.payload;
217
+ const newWorkSpace = {
218
+ version: 1,
219
+ label: workspaceName,
220
+ display,
221
+ controllers,
222
+ formatting,
223
+ };
224
+ const newWorkspaceKey = generateID();
225
+ const localData = getLocalStorage('nmr-general-settings');
226
+ localData.workspaces[newWorkspaceKey] = newWorkSpace;
227
+ storeData('nmr-general-settings', JSON.stringify(localData));
228
+ draft.workspaces[newWorkspaceKey] = newWorkSpace;
229
+ draft.workspace.current = newWorkspaceKey;
230
+ }
231
+ function handleRemoveWorkspace(draft, action) {
232
+ const { workspace } = action.payload;
233
+ if (workspace === draft.workspace.current) {
234
+ draft.workspace.current = 'default';
235
+ }
236
+ let localData = getLocalStorage('nmr-general-settings');
237
+ const storedWorkspaces = original(draft)?.workspaces || {};
238
+ const workspaces = Object.keys(storedWorkspaces).reduce((acc, key) => {
239
+ if (key !== workspace) {
240
+ acc[key] = storedWorkspaces[key];
241
+ }
242
+ return acc;
243
+ }, {});
244
+ draft.workspaces = workspaces;
245
+ localData.workspaces = filterObject(workspaces);
143
246
  storeData('nmr-general-settings', JSON.stringify(localData));
144
247
  }
145
248
  function innerPreferencesReducer(draft, action) {
146
249
  switch (action.type) {
147
- case INIT_PREFERENCES:
250
+ case 'INIT_PREFERENCES':
148
251
  return handleInit(draft, action);
149
- case SET_PREFERENCES:
252
+ case 'SET_PREFERENCES':
150
253
  return handleSetPreferences(draft, action);
151
- case SET_PANELS_PREFERENCES:
254
+ case 'SET_PANELS_PREFERENCES':
152
255
  return handleSetPanelsPreferences(draft, action);
153
- case RESET_PREFERENCES:
256
+ case 'RESET_PREFERENCES':
154
257
  return handleResetPreferences(draft);
258
+ case 'SET_WORKSPACE':
259
+ return handleSetWorkspace(draft, action);
260
+ case 'ADD_WORKSPACE':
261
+ return handleAddWorkspace(draft, action);
262
+ case 'REMOVE_WORKSPACE':
263
+ return handleRemoveWorkspace(draft, action);
155
264
  default:
156
265
  return draft;
157
266
  }
@@ -1,3 +1,9 @@
1
+ export declare type ActionType<Action, Payload = void> = Payload extends void ? {
2
+ type: Action;
3
+ } : {
4
+ type: Action;
5
+ payload: Payload;
6
+ };
1
7
  export declare const INITIATE = "INITIATE";
2
8
  export declare const SAVE_DATA_AS_JSON = "SAVE_DATA_AS_JSON";
3
9
  export declare const LOAD_JSON_FILE = "LOAD_JSON_FILE";
@@ -31,5 +31,5 @@ export default function BrushX() {
31
31
  ...styles.container,
32
32
  transform: `translate(${startX}px, 0px) scaleX(${scale})`,
33
33
  willChange: 'transform',
34
- }, children: _jsxs("svg", { width: width, height: height, children: [_jsx("line", { x1: "0", y1: "0", x2: "0", y2: height, strokeWidth: "8", stroke: "red" }, void 0), _jsx("line", { x1: width, y1: "0", x2: width, y2: height, strokeWidth: "8", stroke: "red" }, void 0), _jsx("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" }, void 0)] }, void 0) }, void 0));
34
+ }, children: _jsxs("svg", { width: width, height: height, children: [_jsx("line", { x1: "0", y1: "0", x2: "0", y2: height, strokeWidth: "8", stroke: "red" }), _jsx("line", { x1: width, y1: "0", x2: width, y2: height, strokeWidth: "8", stroke: "red" }), _jsx("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" })] }) }));
35
35
  }
@@ -82,5 +82,5 @@ export default function BrushXY({ brushType = BRUSH_TYPE.XY, dimensionBorder = d
82
82
  ...styles.container,
83
83
  transform: `translate(${startX}px, ${startY}px) scale(${scaleX},${scaleY})`,
84
84
  willChange: 'transform',
85
- }, children: _jsx("svg", { width: width, height: height, children: _jsx("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" }, void 0) }, void 0) }, void 0));
85
+ }, children: _jsx("svg", { width: width, height: height, children: _jsx("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" }) }) }));
86
86
  }
@@ -50,6 +50,6 @@ function CrossLinePointer() {
50
50
  overflow: 'visible',
51
51
  width: 2 * width,
52
52
  height: 2 * height,
53
- }, children: _jsxs("svg", { width: 2 * width, height: 2 * height, children: [_jsx("line", { style: styles.line, x1: width, y1: "0", x2: width, y2: height * 2 }, "vertical_line"), _jsx("line", { style: styles.line, x1: "0", y1: height, x2: width * 2, y2: height }, "horizontal_line")] }, void 0) }, "crossLine"));
53
+ }, children: _jsxs("svg", { width: 2 * width, height: 2 * height, children: [_jsx("line", { style: styles.line, x1: width, y1: "0", x2: width, y2: height * 2 }, "vertical_line"), _jsx("line", { style: styles.line, x1: "0", y1: height, x2: width * 2, y2: height }, "horizontal_line")] }) }, "crossLine"));
54
54
  }
55
55
  export default CrossLinePointer;
@@ -1,17 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Toolbar } from 'analysis-ui-components';
3
3
  import { SvgNmrRealImag, SvgNmrOverlay3, SvgNmrOverlay3Aligned, SvgNmrAlignBottom, SvgNmrAlignCenter, } from 'cheminfo-font';
4
- import lodashGet from 'lodash/get';
5
4
  import { Fragment, useCallback, memo, useMemo } from 'react';
6
5
  import { FaDownload, FaFileDownload, FaFileImage, FaCopy, FaFileExport, FaFile, FaFileImport, } from 'react-icons/fa';
7
6
  import { useChartData } from '../context/ChartContext';
8
7
  import { useDispatch } from '../context/DispatchContext';
9
8
  import { useLoader } from '../context/LoaderContext';
10
- import { usePreferences } from '../context/PreferencesContext';
11
9
  import ToolbarMenu from '../elements/ToolbarMenu';
12
10
  import { useAlert } from '../elements/popup/Alert';
13
11
  import { useModal } from '../elements/popup/Modal';
14
12
  import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
13
+ import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
15
14
  import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
16
15
  import useExport from '../hooks/useExport';
17
16
  import useToolsFunctions from '../hooks/useToolsFunctions';
@@ -22,59 +21,59 @@ import { LOAD_JCAMP_FILE, SET_LOADING_FLAG } from '../reducer/types/Types';
22
21
  const IMPORT_MENU = [
23
22
  {
24
23
  id: 'importFile',
25
- icon: _jsx(FaFile, {}, void 0),
24
+ icon: _jsx(FaFile, {}),
26
25
  label: 'Import from file system (Press Ctrl + O)',
27
26
  },
28
27
  {
29
28
  id: 'importJDX',
30
- icon: _jsx(FaFile, {}, void 0),
29
+ icon: _jsx(FaFile, {}),
31
30
  label: 'Add JCAMP-DX from URL',
32
31
  },
33
32
  {
34
33
  id: 'importPublicationString',
35
- icon: _jsx(FaFile, {}, void 0),
34
+ icon: _jsx(FaFile, {}),
36
35
  label: 'Import from publication string',
37
36
  },
38
37
  ];
39
38
  const EXPORT_MENU = [
40
39
  {
41
40
  id: 'svg',
42
- icon: _jsx(FaDownload, {}, void 0),
41
+ icon: _jsx(FaDownload, {}),
43
42
  label: 'Export as SVG',
44
43
  },
45
44
  {
46
45
  id: 'png',
47
- icon: _jsx(FaFileImage, {}, void 0),
46
+ icon: _jsx(FaFileImage, {}),
48
47
  label: 'Export as PNG',
49
48
  },
50
49
  {
51
50
  id: 'json',
52
- icon: _jsx(FaFileDownload, {}, void 0),
51
+ icon: _jsx(FaFileDownload, {}),
53
52
  label: 'Save data ( Press Ctrl + S )',
54
53
  },
55
54
  {
56
55
  id: 'advance_save',
57
- icon: _jsx(FaFileDownload, {}, void 0),
56
+ icon: _jsx(FaFileDownload, {}),
58
57
  label: 'Save data as ( Press Ctrl + Shift + S )',
59
58
  },
60
59
  {
61
60
  id: 'nmre',
62
- icon: _jsx(FaFileDownload, {}, void 0),
61
+ icon: _jsx(FaFileDownload, {}),
63
62
  label: 'Save NMRE data',
64
63
  },
65
64
  {
66
65
  id: 'copy',
67
- icon: _jsx(FaCopy, {}, void 0),
66
+ icon: _jsx(FaCopy, {}),
68
67
  label: 'Copy image to Clipboard ( Press Ctrl + C )',
69
68
  },
70
69
  ];
71
70
  function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidCounter, activeSpectrum, }) {
72
71
  const dispatch = useDispatch();
73
- const preferences = usePreferences();
74
72
  const alert = useAlert();
75
73
  const modal = useModal();
76
74
  const openLoader = useLoader();
77
75
  const isExperimentalFeature = useCheckExperimentalFeature();
76
+ const isButtonVisible = useCheckToolsVisibility();
78
77
  const importMenu = useMemo(() => {
79
78
  return isExperimentalFeature
80
79
  ? IMPORT_MENU
@@ -96,14 +95,11 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
96
95
  dispatch({ type: SET_LOADING_FLAG, isLoading: true });
97
96
  }, [dispatch, modal]);
98
97
  const importJCAMPFile = useCallback(() => {
99
- modal.show(_jsx(LoadJCAMPModal, { onLoadClick: LoadJacmpHandler, onClose: () => modal.close(), startLoading: startLoadingHandler }, void 0), {});
98
+ modal.show(_jsx(LoadJCAMPModal, { onLoadClick: LoadJacmpHandler, onClose: () => modal.close(), startLoading: startLoadingHandler }), {});
100
99
  }, [LoadJacmpHandler, modal, startLoadingHandler]);
101
100
  const openImportPublicationStringModal = useCallback(() => {
102
- modal.show(_jsx(ImportPublicationStringModal, { onClose: () => modal.close() }, void 0), {});
101
+ modal.show(_jsx(ImportPublicationStringModal, { onClose: () => modal.close() }), {});
103
102
  }, [modal]);
104
- const isButtonVisible = useCallback((key) => {
105
- return !lodashGet(preferences, `display.toolBarButtons.${key}`);
106
- }, [preferences]);
107
103
  const importHandler = useCallback(({ id }) => {
108
104
  switch (id) {
109
105
  case 'importFile':
@@ -150,22 +146,22 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
150
146
  saveAsNMREHandler,
151
147
  saveToClipboardHandler,
152
148
  ]);
153
- return (_jsxs(Fragment, { children: [isButtonVisible('hideImport') && (_jsx(ToolbarMenu, { component: _jsx(FaFileImport, {}, void 0), toolTip: "Import", onClick: (element) => {
149
+ return (_jsxs(Fragment, { children: [isButtonVisible('import') && (_jsx(ToolbarMenu, { component: _jsx(FaFileImport, {}), toolTip: "Import", onClick: (element) => {
154
150
  importHandler(element);
155
151
  return null;
156
- }, items: importMenu }, void 0)), isButtonVisible('hideExportAs') && (_jsx(ToolbarMenu, { component: _jsx(FaFileExport, {}, void 0), toolTip: "Export As", onClick: (element) => {
152
+ }, items: importMenu })), isButtonVisible('exportAs') && (_jsx(ToolbarMenu, { component: _jsx(FaFileExport, {}), toolTip: "Export As", onClick: (element) => {
157
153
  exportHandler(element);
158
154
  return null;
159
- }, items: EXPORT_MENU }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D &&
160
- isButtonVisible('hideSpectraStackAlignments') &&
155
+ }, items: EXPORT_MENU })), displayerMode === DISPLAYER_MODE.DM_1D &&
156
+ isButtonVisible('spectraStackAlignments') &&
161
157
  ftCounter > 1 &&
162
- (info?.isFt || !activeSpectrum) && (_jsx(Toolbar.Item, { id: "spectra-alignment", className: "cheminfo", title: "Spectra alignment ( Press s )", onClick: changeDisplayViewModeHandler, children: verticalAlign.align === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {}, void 0)) : (_jsx(SvgNmrOverlay3, {}, void 0)) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D &&
163
- isButtonVisible('hideRealImaginary') &&
164
- info.isComplex && (_jsx(Toolbar.Item, { id: "display", title: isRealSpectrumShown ? 'Display Real ' : 'Display Imaginary', onClick: changeSpectrumViewHandler, className: "cheminfo", children: _jsx(SvgNmrRealImag, {}, void 0) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D &&
165
- isButtonVisible('hideSpectraCenterAlignments') &&
158
+ (info?.isFt || !activeSpectrum) && (_jsx(Toolbar.Item, { id: "spectra-alignment", className: "cheminfo", title: "Spectra alignment ( Press s )", onClick: changeDisplayViewModeHandler, children: verticalAlign.align === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {})) : (_jsx(SvgNmrOverlay3, {})) })), displayerMode === DISPLAYER_MODE.DM_1D &&
159
+ isButtonVisible('realImaginary') &&
160
+ info.isComplex && (_jsx(Toolbar.Item, { id: "display", title: isRealSpectrumShown ? 'Display Real ' : 'Display Imaginary', onClick: changeSpectrumViewHandler, className: "cheminfo", children: _jsx(SvgNmrRealImag, {}) })), displayerMode === DISPLAYER_MODE.DM_1D &&
161
+ isButtonVisible('spectraCenterAlignments') &&
166
162
  (ftCounter > 0 || fidCounter > 0) && (_jsx(Toolbar.Item, { id: "baseline-position", title: verticalAlign.align === 'bottom'
167
163
  ? 'Baseline Center ( Press c )'
168
- : 'Baseline Bottom ( Press c )', onClick: alignSpectrumsVerticallyHandler, className: "cheminfo", children: _jsx("div", { style: { fontSize: 24 }, children: verticalAlign.align === 'bottom' ? (_jsx(SvgNmrAlignCenter, {}, void 0)) : (_jsx(SvgNmrAlignBottom, {}, void 0)) }, void 0) }, void 0))] }, void 0));
164
+ : 'Baseline Bottom ( Press c )', onClick: alignSpectrumsVerticallyHandler, className: "cheminfo", children: _jsx("div", { style: { fontSize: 24 }, children: verticalAlign.align === 'bottom' ? (_jsx(SvgNmrAlignCenter, {})) : (_jsx(SvgNmrAlignBottom, {})) }) }))] }));
169
165
  }
170
166
  const MemoizedBasicToolBar = memo(BasicToolBarInner);
171
167
  export default function BasicToolBar() {
@@ -179,5 +175,5 @@ export default function BasicToolBar() {
179
175
  verticalAlign,
180
176
  displayerMode,
181
177
  activeTab,
182
- } }, void 0));
178
+ } }));
183
179
  }
@@ -33,33 +33,32 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
33
33
  });
34
34
  dispatch({ type: SET_SELECTED_FILTER, selectedFilter: null });
35
35
  }, [dispatch]);
36
- return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('hideZoomTool') && (_jsx(ToggleButton, { value: options.zoom.id, id: "zoomIn", title: `${options.zoom.label} ( Press z )`, children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaSearchPlus, {}, void 0) }, void 0) }, options.zoom.id)), isButtonVisible('hideZoomOutTool') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaExpand, {}, void 0) }, void 0) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D &&
37
- isButtonVisible('hidePeakTool') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: _jsx(SvgNmrPeakPicking, {}, void 0) }, options.peakPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
38
- isButtonVisible('hideIntegralTool') && (_jsx(ToggleButton, { value: options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${options.integral.label} ( Press i )`, children: _jsx(SvgNmrIntegrate, {}, void 0) }, options.integral.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
39
- isButtonVisible('hideZonePickingTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.zone2D.label} ( Press r )`, children: _jsx(FaDiceFour, {}, void 0) }, options.zone2D.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
40
- isButtonVisible('hideSlicingTool') && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${options.slicingTool.label}`, children: _jsx("p", { children: "Slic" }, void 0) }, options.slicingTool.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
41
- isButtonVisible('hideAutoRangesTool') && (_jsx(ToggleButton, { value: options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: _jsx(SvgNmrRangePicking, {}, void 0) }, options.rangesPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
42
- isButtonVisible('hideMultipleSpectraAnalysisTool') &&
36
+ return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('zoomTool') && (_jsx(ToggleButton, { value: options.zoom.id, id: "zoomIn", title: `${options.zoom.label} ( Press z )`, children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaSearchPlus, {}) }) }, options.zoom.id)), isButtonVisible('zoomOutTool') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaExpand, {}) }) })), displayerMode === DISPLAYER_MODE.DM_1D && isButtonVisible('peakTool') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: _jsx(SvgNmrPeakPicking, {}) }, options.peakPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
37
+ isButtonVisible('integralTool') && (_jsx(ToggleButton, { value: options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${options.integral.label} ( Press i )`, children: _jsx(SvgNmrIntegrate, {}) }, options.integral.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
38
+ isButtonVisible('zonePickingTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.zone2D.label} ( Press r )`, children: _jsx(FaDiceFour, {}) }, options.zone2D.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
39
+ isButtonVisible('slicingTool') && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${options.slicingTool.label}`, children: _jsx("p", { children: "Slic" }) }, options.slicingTool.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
40
+ isButtonVisible('autoRangesTool') && (_jsx(ToggleButton, { value: options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: _jsx(SvgNmrRangePicking, {}) }, options.rangesPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
41
+ isButtonVisible('multipleSpectraAnalysisTool') &&
43
42
  ftCounter > 1 &&
44
- mode === 'RTL' && (_jsx(ToggleButton, { value: options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: options.multipleSpectraAnalysis.label, children: _jsx(SvgNmrMultipleAnalysis, {}, void 0) }, options.multipleSpectraAnalysis.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
45
- isButtonVisible('hideZeroFillingTool') && (_jsx(ToggleButton, { value: options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: options.zeroFilling.label, children: _jsx(SvgNmrZeroFilling, {}, void 0) }, options.zeroFilling.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
46
- isButtonVisible('hidePhaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: `${options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
43
+ mode === 'RTL' && (_jsx(ToggleButton, { value: options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: options.multipleSpectraAnalysis.label, children: _jsx(SvgNmrMultipleAnalysis, {}) }, options.multipleSpectraAnalysis.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
44
+ isButtonVisible('zeroFillingTool') && (_jsx(ToggleButton, { value: options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: options.zeroFilling.label, children: _jsx(SvgNmrZeroFilling, {}) }, options.zeroFilling.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
45
+ isButtonVisible('phaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: `${options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
47
46
  info &&
48
47
  Filters.phaseCorrection.isApplicable({ info }) &&
49
48
  datum.im
50
49
  ? true
51
- : false, children: _jsx(SvgNmrPhaseCorrection, {}, void 0) }, options.phaseCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
52
- isButtonVisible('hideBaseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: `${options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
50
+ : false, children: _jsx(SvgNmrPhaseCorrection, {}) }, options.phaseCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
51
+ isButtonVisible('baseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: `${options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
53
52
  info &&
54
53
  Filters.baselineCorrection.isApplicable({ info })
55
54
  ? true
56
- : false, children: _jsx(SvgNmrBaselineCorrection, {}, void 0) }, options.baseLineCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
57
- isButtonVisible('hideExclusionZonesTool') &&
55
+ : false, children: _jsx(SvgNmrBaselineCorrection, {}) }, options.baseLineCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
56
+ isButtonVisible('exclusionZonesTool') &&
58
57
  !info?.isFid &&
59
- ftCounter > 0 && (_jsx(ToggleButton, { value: options.exclusionZones.id, title: `${options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: _jsx("div", { style: { fontSize: 18 }, children: _jsx(SvgNmrMultipleAnalysis, {}, void 0) }, void 0) }, options.exclusionZones.id))] }, void 0), displayerMode === DISPLAYER_MODE.DM_1D &&
60
- isButtonVisible('hideFFTTool') &&
58
+ ftCounter > 0 && (_jsx(ToggleButton, { value: options.exclusionZones.id, title: `${options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: _jsx("div", { style: { fontSize: 18 }, children: _jsx(SvgNmrMultipleAnalysis, {}) }) }, options.exclusionZones.id))] }), displayerMode === DISPLAYER_MODE.DM_1D &&
59
+ isButtonVisible('FFTTool') &&
61
60
  info &&
62
- Filters.fft.isApplicable({ info }) && (_jsx(Toolbar.Item, { id: "fft-filter", className: "cheminfo", title: "FFT Filter", onClick: handleOnFFTFilter, children: _jsx(SvgNmrFourierTransform, {}, void 0) }, void 0))] }, void 0));
61
+ Filters.fft.isApplicable({ info }) && (_jsx(Toolbar.Item, { id: "fft-filter", className: "cheminfo", title: "FFT Filter", onClick: handleOnFFTFilter, children: _jsx(SvgNmrFourierTransform, {}) }))] }));
63
62
  }
64
63
  const MemoizedFunctionToolBar = memo(FunctionToolBarInner);
65
64
  export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
@@ -72,5 +71,5 @@ export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
72
71
  activeTab,
73
72
  defaultValue,
74
73
  mode,
75
- } }, void 0));
74
+ } }));
76
75
  }
@@ -25,6 +25,6 @@ function HistoryToolBar({ isUndoButtonVisible = true, isRedoButtonVisible = true
25
25
  const { history } = useChartData();
26
26
  const dispatch = useDispatch();
27
27
  const handle = useCallback((type) => dispatch({ type }), [dispatch]);
28
- return (_jsxs(Fragment, { children: [isUndoButtonVisible && (_jsx("button", { style: styles.button, type: "button", onClick: () => handle(REDO), disabled: !history.hasRedo, children: _jsx(ToolTip, { title: "Redo", popupPlacement: "right", children: _jsx(FaRedo, {}, void 0) }, void 0) }, void 0)), isRedoButtonVisible && (_jsx("button", { type: "button", style: styles.button, onClick: () => handle(UNDO), disabled: !history.hasUndo, children: _jsx(ToolTip, { title: "Undo", popupPlacement: "right", children: _jsx(FaUndo, {}, void 0) }, void 0) }, void 0))] }, void 0));
28
+ return (_jsxs(Fragment, { children: [isUndoButtonVisible && (_jsx("button", { style: styles.button, type: "button", onClick: () => handle(REDO), disabled: !history.hasRedo, children: _jsx(ToolTip, { title: "Redo", popupPlacement: "right", children: _jsx(FaRedo, {}) }) })), isRedoButtonVisible && (_jsx("button", { type: "button", style: styles.button, onClick: () => handle(UNDO), disabled: !history.hasUndo, children: _jsx(ToolTip, { title: "Undo", popupPlacement: "right", children: _jsx(FaUndo, {}) }) }))] }));
29
29
  }
30
30
  export default memo(HistoryToolBar);
@@ -5,10 +5,10 @@ import { useChartData } from '../context/ChartContext';
5
5
  import BasicToolBar from './BasicToolBar';
6
6
  import FunctionToolBar from './FunctionToolBar';
7
7
  function ToolBarInner({ selectedTool }) {
8
- return (_jsx("div", { style: { fontSize: 18 }, children: _jsxs(Toolbar, { orientation: "vertical", children: [_jsx(FunctionToolBar, { defaultValue: selectedTool }, void 0), _jsx(BasicToolBar, {}, void 0)] }, void 0) }, void 0));
8
+ return (_jsx("div", { style: { fontSize: 18 }, children: _jsxs(Toolbar, { orientation: "vertical", children: [_jsx(FunctionToolBar, { defaultValue: selectedTool }), _jsx(BasicToolBar, {})] }) }));
9
9
  }
10
10
  const MemoizedToolBar = memo(ToolBarInner);
11
11
  export default function ToolBar() {
12
12
  const { toolOptions: { selectedTool }, } = useChartData();
13
- return _jsx(MemoizedToolBar, { ...{ selectedTool } }, void 0);
13
+ return _jsx(MemoizedToolBar, { ...{ selectedTool } });
14
14
  }
@@ -7,7 +7,7 @@ function FormatNumber(value, format, prefix = '', suffix = '') {
7
7
  }
8
8
  export function useFormatNumberByNucleus(nucleus) {
9
9
  const preferences = usePreferences();
10
- const nucleusByKey = lodashGet(preferences, `formatting.nucleusByKey`, {
10
+ const nucleusByKey = lodashGet(preferences.current, `formatting.nucleusByKey`, {
11
11
  ppm: '0.0',
12
12
  hz: '0.0',
13
13
  });