nmrium 0.26.0 → 0.27.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 (425) hide show
  1. package/lib/component/1d/Chart1D.js +3 -2
  2. package/lib/component/1d/FooterBanner.js +1 -1
  3. package/lib/component/1d/Integral.d.ts +2 -1
  4. package/lib/component/1d/Integral.js +5 -12
  5. package/lib/component/1d/IntegralResizable.d.ts +2 -1
  6. package/lib/component/1d/IntegralResizable.js +10 -5
  7. package/lib/component/1d/IntegralsSeries.js +3 -3
  8. package/lib/component/1d/Line.d.ts +2 -2
  9. package/lib/component/1d/PeakAnnotation.js +5 -4
  10. package/lib/component/1d/database/DatabaseElements.d.ts +3 -0
  11. package/lib/component/1d/database/DatabaseElements.js +18 -0
  12. package/lib/component/1d/database/DatabaseSpectrum.d.ts +3 -0
  13. package/lib/component/1d/database/DatabaseSpectrum.js +58 -0
  14. package/lib/component/1d/{ResurrectedDatabaseRanges.d.ts → database/ResurrectedDatabaseRanges.d.ts} +0 -0
  15. package/lib/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
  16. package/lib/component/1d/jCouplingGraph/JGraph.js +4 -10
  17. package/lib/component/1d/multiAnalysis/AnalysisRange.js +10 -5
  18. package/lib/component/1d/ranges/Range.d.ts +2 -1
  19. package/lib/component/1d/ranges/Range.js +17 -9
  20. package/lib/component/1d/ranges/Ranges.js +6 -3
  21. package/lib/component/1d/tool/XLabelPointer.js +1 -1
  22. package/lib/component/2d/Chart2D.js +2 -1
  23. package/lib/component/2d/Contours.js +4 -1
  24. package/lib/component/2d/FooterBanner.js +1 -1
  25. package/lib/component/2d/tools/XYLabelPointer.js +1 -1
  26. package/lib/component/2d/tools/slicing/HorizontalSliceChart.d.ts +2 -2
  27. package/lib/component/2d/tools/slicing/SliceScale.d.ts +1 -1
  28. package/lib/component/2d/tools/slicing/VerticalSliceChart.d.ts +2 -2
  29. package/lib/component/EventsTrackers/KeysListenerTracker.js +10 -4
  30. package/lib/component/NMRium.d.ts +5 -1
  31. package/lib/component/NMRium.js +6 -3
  32. package/lib/component/SplitPaneWrapper.d.ts +4 -0
  33. package/lib/component/SplitPaneWrapper.js +8 -0
  34. package/lib/component/context/GlobalContext.d.ts +3 -0
  35. package/lib/component/context/GlobalContext.js +1 -1
  36. package/lib/component/context/PreferencesContext.d.ts +15 -12
  37. package/lib/component/context/PreferencesContext.js +1 -1
  38. package/lib/component/elements/Button.js +1 -1
  39. package/lib/component/elements/ColorInput.js +2 -2
  40. package/lib/component/elements/ContextMenu.d.ts +8 -3
  41. package/lib/component/elements/EditableColumn.d.ts +3 -2
  42. package/lib/component/elements/EditableColumn.js +27 -20
  43. package/lib/component/elements/Input.d.ts +9 -1
  44. package/lib/component/elements/Input.js +18 -5
  45. package/lib/component/elements/Select.d.ts +1 -0
  46. package/lib/component/elements/Select.js +21 -15
  47. package/lib/component/elements/ToggleButton.d.ts +2 -1
  48. package/lib/component/elements/ToggleButton.js +2 -2
  49. package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
  50. package/lib/component/elements/draggble/SVGDraggable.js +33 -0
  51. package/lib/component/elements/{resizer → draggble}/useDraggable.d.ts +9 -6
  52. package/lib/component/elements/draggble/useDraggable.js +70 -0
  53. package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -0
  54. package/lib/component/elements/formik/FormikColorPicker.js +10 -7
  55. package/lib/component/elements/formik/FormikColumnFormatField.d.ts +5 -4
  56. package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
  57. package/lib/component/elements/formik/FormikInput.d.ts +1 -0
  58. package/lib/component/elements/formik/FormikInput.js +6 -3
  59. package/lib/component/elements/formik/FormikSlider.d.ts +1 -0
  60. package/lib/component/elements/formik/FormikSlider.js +6 -3
  61. package/lib/component/elements/popup/Alert/Provider.js +1 -1
  62. package/lib/component/elements/resizer/DivResizer.js +17 -62
  63. package/lib/component/elements/resizer/Resizer.d.ts +3 -1
  64. package/lib/component/elements/resizer/SVGResizer.js +24 -53
  65. package/lib/component/elements/resizer/useResizer.d.ts +11 -0
  66. package/lib/component/elements/resizer/useResizer.js +65 -0
  67. package/lib/component/hooks/useExport.d.ts +1 -1
  68. package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
  69. package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +0 -9
  70. package/lib/component/hooks/usePanelPreferences.d.ts +7 -0
  71. package/lib/component/hooks/usePanelPreferences.js +54 -0
  72. package/lib/component/hooks/useXYReduce.d.ts +2 -2
  73. package/lib/component/loader/DefaultSpinnerComponent.d.ts +3 -1
  74. package/lib/component/loader/DefaultSpinnerComponent.js +2 -2
  75. package/lib/component/loader/SpinnerContext.d.ts +3 -3
  76. package/lib/component/loader/SpinnerContext.js +2 -2
  77. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
  78. package/lib/component/modal/MoleculeStructureEditorModal.js +22 -1
  79. package/lib/component/modal/editRange/EditRangeModal.js +6 -5
  80. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
  81. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
  82. package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +3 -1
  83. package/lib/component/modal/editRange/forms/components/SignalsForm.js +12 -9
  84. package/lib/component/modal/setting/DatabasesTabContent.d.ts +6 -0
  85. package/lib/component/modal/setting/DatabasesTabContent.js +75 -0
  86. package/lib/component/modal/setting/DisplayTabContent.js +11 -7
  87. package/lib/component/modal/setting/FormattingTabContent.js +5 -5
  88. package/lib/component/modal/setting/GeneralSettings.js +2 -1
  89. package/lib/component/modal/setting/settingsValidation.d.ts +48 -0
  90. package/lib/component/modal/setting/settingsValidation.js +33 -27
  91. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
  92. package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +0 -1
  93. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
  94. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +2 -2
  95. package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -11
  96. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
  97. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +26 -74
  98. package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +8 -0
  99. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +38 -0
  100. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
  101. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +10 -2
  102. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +12 -1
  103. package/lib/component/panels/MoleculesPanel/Utilities.js +11 -0
  104. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -1
  105. package/lib/component/panels/Panels.js +2 -3
  106. package/lib/component/panels/PeaksPanel/PeaksPanel.js +3 -3
  107. package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
  108. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +29 -82
  109. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -5
  110. package/lib/component/panels/PeaksPanel/PeaksTable.js +18 -25
  111. package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
  112. package/lib/component/panels/RangesPanel/RangesHeader.js +15 -9
  113. package/lib/component/panels/RangesPanel/RangesPanel.js +4 -10
  114. package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
  115. package/lib/component/panels/RangesPanel/RangesPreferences.js +55 -66
  116. package/lib/component/panels/RangesPanel/RangesTable.d.ts +11 -6
  117. package/lib/component/panels/RangesPanel/RangesTable.js +3 -7
  118. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -2
  119. package/lib/component/panels/RangesPanel/RangesTableRow.js +3 -3
  120. package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -2
  121. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -1
  122. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
  123. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +2 -1
  124. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
  125. package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -2
  126. package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
  127. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
  128. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
  129. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +13 -0
  130. package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +14 -0
  131. package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
  132. package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +18 -0
  133. package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +18 -0
  134. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -2
  135. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +7 -68
  136. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
  137. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -2
  138. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +7 -68
  139. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
  140. package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
  141. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +6 -0
  142. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +51 -0
  143. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  144. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
  145. package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
  146. package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
  147. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +20 -84
  148. package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
  149. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +5 -1
  150. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
  151. package/lib/component/panels/databasePanel/DatabasePanel.js +73 -40
  152. package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
  153. package/lib/component/panels/databasePanel/DatabaseTable.js +23 -11
  154. package/lib/component/panels/databasePanel/useDatabases.d.ts +5 -0
  155. package/lib/component/panels/databasePanel/useDatabases.js +10 -0
  156. package/lib/component/panels/extra/placeholder/NoTableData.d.ts +3 -1
  157. package/lib/component/panels/extra/placeholder/NoTableData.js +2 -2
  158. package/lib/component/panels/extra/preferences/ColumnsHelper.js +3 -3
  159. package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +13 -0
  160. package/lib/component/panels/extra/preferences/NucleusPreferences.js +22 -0
  161. package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +6 -0
  162. package/lib/component/panels/extra/preferences/PreferencesContainer.js +10 -0
  163. package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +7 -0
  164. package/lib/component/panels/extra/preferences/PreferencesGroup.js +21 -0
  165. package/lib/component/reducer/Reducer.d.ts +358 -45
  166. package/lib/component/reducer/Reducer.js +5 -1
  167. package/lib/component/reducer/actions/LoadActions.js +2 -2
  168. package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -2
  169. package/lib/component/reducer/actions/MoleculeActions.js +15 -3
  170. package/lib/component/reducer/actions/PreferencesActions.js +1 -1
  171. package/lib/component/reducer/actions/ToolsActions.js +1 -1
  172. package/lib/component/reducer/preferences/actions/addWorkspace.d.ts +3 -0
  173. package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -0
  174. package/lib/component/reducer/preferences/actions/initPreferences.d.ts +3 -0
  175. package/lib/component/reducer/preferences/actions/initPreferences.js +60 -0
  176. package/lib/component/reducer/preferences/actions/removeWorkspace.d.ts +3 -0
  177. package/lib/component/reducer/preferences/actions/removeWorkspace.js +20 -0
  178. package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +3 -0
  179. package/lib/component/reducer/preferences/actions/resetPreferences.js +14 -0
  180. package/lib/component/reducer/preferences/actions/setPanelsPreferences.d.ts +3 -0
  181. package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +13 -0
  182. package/lib/component/reducer/preferences/actions/setPreferences.d.ts +3 -0
  183. package/lib/component/reducer/preferences/actions/setPreferences.js +34 -0
  184. package/lib/component/reducer/preferences/actions/setWorkspace.d.ts +3 -0
  185. package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -0
  186. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -0
  187. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +55 -0
  188. package/lib/component/reducer/{preferencesReducer.d.ts → preferences/preferencesReducer.d.ts} +131 -7
  189. package/lib/component/reducer/preferences/preferencesReducer.js +80 -0
  190. package/lib/component/reducer/preferences/utilites/checkKeysExists.d.ts +1 -0
  191. package/lib/component/reducer/preferences/utilites/checkKeysExists.js +14 -0
  192. package/lib/component/reducer/preferences/utilites/filterObject.d.ts +1 -0
  193. package/lib/component/reducer/preferences/utilites/filterObject.js +7 -0
  194. package/lib/component/reducer/preferences/utilites/flatObject.d.ts +1 -0
  195. package/lib/component/reducer/preferences/utilites/flatObject.js +9 -0
  196. package/lib/component/reducer/preferences/utilites/getActiveWorkspace.d.ts +3 -0
  197. package/lib/component/reducer/preferences/utilites/getActiveWorkspace.js +3 -0
  198. package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.d.ts +2 -0
  199. package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +4 -0
  200. package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.d.ts +5 -0
  201. package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.js +8 -0
  202. package/lib/component/reducer/types/Types.d.ts +2 -0
  203. package/lib/component/reducer/types/Types.js +2 -0
  204. package/lib/component/tool/FloatMoleculeStructures/ActionsButton.d.ts +4 -0
  205. package/lib/component/tool/FloatMoleculeStructures/ActionsButton.js +7 -0
  206. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +14 -0
  207. package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +43 -0
  208. package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
  209. package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
  210. package/lib/component/utility/Export.js +6 -0
  211. package/lib/component/utility/PathBuilder.js +2 -1
  212. package/lib/component/utility/formatNumber.d.ts +3 -0
  213. package/lib/component/utility/formatNumber.js +10 -0
  214. package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
  215. package/lib/component/utility/getUniqueNuclei.js +10 -0
  216. package/lib/component/workspaces/Workspace.d.ts +72 -1
  217. package/lib/component/workspaces/basic.js +9 -1
  218. package/lib/component/workspaces/embedded.d.ts +2 -0
  219. package/lib/component/workspaces/embedded.js +32 -0
  220. package/lib/component/workspaces/exercise.js +2 -0
  221. package/lib/component/workspaces/index.d.ts +1 -0
  222. package/lib/component/workspaces/index.js +2 -1
  223. package/lib/component/workspaces/prediction.js +2 -0
  224. package/lib/component/workspaces/process1D.js +2 -0
  225. package/lib/data/data1d/Data1DManager.js +4 -0
  226. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
  227. package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
  228. package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
  229. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
  230. package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
  231. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
  232. package/lib/data/data1d/database.d.ts +8 -13
  233. package/lib/data/data1d/database.js +14 -19
  234. package/lib/data/data1d/filter1d/absolute.d.ts +3 -2
  235. package/lib/data/data1d/filter1d/autoPhaseCorrection.d.ts +3 -2
  236. package/lib/data/data1d/filter1d/baselineCorrection.d.ts +3 -2
  237. package/lib/data/data1d/filter1d/centerMean.d.ts +3 -2
  238. package/lib/data/data1d/filter1d/digitalFilter.d.ts +3 -2
  239. package/lib/data/data1d/filter1d/equallySpaced.d.ts +3 -2
  240. package/lib/data/data1d/filter1d/exclusionZones.js +4 -4
  241. package/lib/data/data1d/filter1d/fft.d.ts +3 -2
  242. package/lib/data/data1d/filter1d/fft.js +2 -2
  243. package/lib/data/data1d/filter1d/fromTo.d.ts +3 -2
  244. package/lib/data/data1d/filter1d/lineBroadening.d.ts +3 -2
  245. package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
  246. package/lib/data/data1d/filter1d/pareto.d.ts +3 -2
  247. package/lib/data/data1d/filter1d/pareto.js +2 -2
  248. package/lib/data/data1d/filter1d/phaseCorrection.d.ts +3 -2
  249. package/lib/data/data1d/filter1d/shiftX.d.ts +2 -1
  250. package/lib/data/data1d/filter1d/standardDeviation.d.ts +3 -2
  251. package/lib/data/data1d/filter1d/zeroFilling.d.ts +3 -2
  252. package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
  253. package/lib/data/data2d/Data2DManager.js +4 -0
  254. package/lib/data/data2d/filter2d/shiftX.d.ts +4 -3
  255. package/lib/data/data2d/filter2d/shiftX.js +2 -2
  256. package/lib/data/data2d/filter2d/shiftY.d.ts +4 -3
  257. package/lib/data/data2d/filter2d/shiftY.js +2 -2
  258. package/lib/data/molecules/Molecule.d.ts +3 -3
  259. package/lib/data/molecules/Molecule.js +7 -1
  260. package/lib/data/molecules/MoleculeManager.d.ts +4 -1
  261. package/lib/data/molecules/MoleculeManager.js +33 -2
  262. package/lib/data/types/data1d/Data1D.d.ts +3 -3
  263. package/lib/data/types/data1d/Info1D.d.ts +1 -0
  264. package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -1
  265. package/lib/versionInfo.js +1 -1
  266. package/lib-cjs/component/1d/Chart1D.js +3 -2
  267. package/lib-cjs/component/1d/FooterBanner.js +2 -2
  268. package/lib-cjs/component/1d/Integral.js +5 -12
  269. package/lib-cjs/component/1d/IntegralResizable.js +10 -5
  270. package/lib-cjs/component/1d/IntegralsSeries.js +3 -3
  271. package/lib-cjs/component/1d/PeakAnnotation.js +5 -4
  272. package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
  273. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +60 -0
  274. package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
  275. package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +4 -10
  276. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +10 -5
  277. package/lib-cjs/component/1d/ranges/Range.js +17 -9
  278. package/lib-cjs/component/1d/ranges/Ranges.js +6 -3
  279. package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
  280. package/lib-cjs/component/2d/Chart2D.js +2 -1
  281. package/lib-cjs/component/2d/Contours.js +4 -1
  282. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  283. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  284. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +10 -4
  285. package/lib-cjs/component/NMRium.js +5 -2
  286. package/lib-cjs/component/SplitPaneWrapper.js +12 -0
  287. package/lib-cjs/component/context/GlobalContext.js +1 -1
  288. package/lib-cjs/component/context/PreferencesContext.js +1 -1
  289. package/lib-cjs/component/elements/Button.js +1 -1
  290. package/lib-cjs/component/elements/ColorInput.js +2 -2
  291. package/lib-cjs/component/elements/EditableColumn.js +27 -20
  292. package/lib-cjs/component/elements/Input.js +18 -5
  293. package/lib-cjs/component/elements/Select.js +20 -14
  294. package/lib-cjs/component/elements/ToggleButton.js +2 -2
  295. package/lib-cjs/component/elements/draggble/SVGDraggable.js +39 -0
  296. package/lib-cjs/component/elements/draggble/useDraggable.js +73 -0
  297. package/lib-cjs/component/elements/formik/FormikColorPicker.js +10 -7
  298. package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
  299. package/lib-cjs/component/elements/formik/FormikInput.js +6 -3
  300. package/lib-cjs/component/elements/formik/FormikSlider.js +6 -3
  301. package/lib-cjs/component/elements/popup/Alert/Provider.js +1 -1
  302. package/lib-cjs/component/elements/resizer/DivResizer.js +17 -62
  303. package/lib-cjs/component/elements/resizer/SVGResizer.js +24 -53
  304. package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
  305. package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -11
  306. package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
  307. package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
  308. package/lib-cjs/component/loader/SpinnerContext.js +2 -2
  309. package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -1
  310. package/lib-cjs/component/modal/editRange/EditRangeModal.js +6 -5
  311. package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
  312. package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +12 -9
  313. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +80 -0
  314. package/lib-cjs/component/modal/setting/DisplayTabContent.js +11 -7
  315. package/lib-cjs/component/modal/setting/FormattingTabContent.js +4 -4
  316. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -1
  317. package/lib-cjs/component/modal/setting/settingsValidation.js +33 -27
  318. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +10 -5
  319. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
  320. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -11
  321. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +24 -72
  322. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +44 -0
  323. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
  324. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +9 -1
  325. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +11 -0
  326. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  327. package/lib-cjs/component/panels/Panels.js +2 -3
  328. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -4
  329. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +27 -80
  330. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +18 -48
  331. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +15 -9
  332. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +4 -10
  333. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +53 -64
  334. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -7
  335. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +3 -3
  336. package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -5
  337. package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
  338. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
  339. package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -5
  340. package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
  341. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
  342. package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +16 -0
  343. package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +2 -2
  344. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/PlotChart.js +21 -0
  345. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +10 -68
  346. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
  347. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +10 -68
  348. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
  349. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
  350. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +55 -0
  351. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
  352. package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
  353. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +18 -82
  354. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +4 -1
  355. package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
  356. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +72 -39
  357. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
  358. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +22 -10
  359. package/lib-cjs/component/panels/databasePanel/useDatabases.js +14 -0
  360. package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
  361. package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +3 -3
  362. package/lib-cjs/component/panels/extra/preferences/NucleusPreferences.js +29 -0
  363. package/lib-cjs/component/panels/extra/preferences/PreferencesContainer.js +14 -0
  364. package/lib-cjs/component/panels/extra/preferences/PreferencesGroup.js +25 -0
  365. package/lib-cjs/component/reducer/Reducer.js +5 -1
  366. package/lib-cjs/component/reducer/actions/LoadActions.js +2 -2
  367. package/lib-cjs/component/reducer/actions/MoleculeActions.js +17 -3
  368. package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -1
  369. package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -1
  370. package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +26 -0
  371. package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +67 -0
  372. package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +24 -0
  373. package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +18 -0
  374. package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +17 -0
  375. package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +38 -0
  376. package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +12 -0
  377. package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +62 -0
  378. package/lib-cjs/component/reducer/preferences/preferencesReducer.js +87 -0
  379. package/lib-cjs/component/reducer/preferences/utilites/checkKeysExists.js +18 -0
  380. package/lib-cjs/component/reducer/preferences/utilites/filterObject.js +11 -0
  381. package/lib-cjs/component/reducer/preferences/utilites/flatObject.js +13 -0
  382. package/lib-cjs/component/reducer/preferences/utilites/getActiveWorkspace.js +7 -0
  383. package/lib-cjs/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +11 -0
  384. package/lib-cjs/component/reducer/preferences/utilites/mapNucleiFormatting.js +12 -0
  385. package/lib-cjs/component/reducer/types/Types.js +5 -3
  386. package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
  387. package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +50 -0
  388. package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
  389. package/lib-cjs/component/utility/Export.js +6 -0
  390. package/lib-cjs/component/utility/PathBuilder.js +2 -1
  391. package/lib-cjs/component/utility/formatNumber.js +17 -0
  392. package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
  393. package/lib-cjs/component/workspaces/basic.js +9 -1
  394. package/lib-cjs/component/workspaces/embedded.js +35 -0
  395. package/lib-cjs/component/workspaces/exercise.js +2 -0
  396. package/lib-cjs/component/workspaces/index.js +2 -1
  397. package/lib-cjs/component/workspaces/prediction.js +2 -0
  398. package/lib-cjs/component/workspaces/process1D.js +2 -0
  399. package/lib-cjs/data/data1d/Data1DManager.js +4 -0
  400. package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
  401. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
  402. package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
  403. package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
  404. package/lib-cjs/data/data1d/database.js +15 -21
  405. package/lib-cjs/data/data1d/filter1d/exclusionZones.js +4 -4
  406. package/lib-cjs/data/data1d/filter1d/fft.js +2 -2
  407. package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
  408. package/lib-cjs/data/data1d/filter1d/pareto.js +2 -2
  409. package/lib-cjs/data/data1d/filter1d/shiftX.js +2 -2
  410. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
  411. package/lib-cjs/data/data2d/Data2DManager.js +4 -0
  412. package/lib-cjs/data/data2d/filter2d/shiftX.js +4 -4
  413. package/lib-cjs/data/data2d/filter2d/shiftY.js +4 -4
  414. package/lib-cjs/data/molecules/Molecule.js +7 -1
  415. package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
  416. package/lib-cjs/versionInfo.js +1 -1
  417. package/package.json +42 -40
  418. package/lib/component/elements/resizer/useDraggable.js +0 -52
  419. package/lib/component/panels/extra/preferences/defaultValues.d.ts +0 -54
  420. package/lib/component/panels/extra/preferences/defaultValues.js +0 -54
  421. package/lib/component/reducer/preferencesReducer.js +0 -269
  422. package/lib/component/utility/FormatNumber.d.ts +0 -6
  423. package/lib-cjs/component/elements/resizer/useDraggable.js +0 -55
  424. package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
  425. package/lib-cjs/component/reducer/preferencesReducer.js +0 -276
@@ -34,6 +34,6 @@ const styles = css `
34
34
  }
35
35
  }
36
36
  `;
37
- export default function DefaultSpinnerComponent() {
38
- return (_jsxs("div", { css: styles, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: _jsxs("g", { fill: "#61DAFB", children: [_jsx("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z" }), _jsx("path", { d: "M520.5 78.1z" })] }) }), _jsx("p", { children: "Loading ..." })] }));
37
+ export default function DefaultSpinnerComponent({ loadingText = 'Loading ...', }) {
38
+ return (_jsxs("div", { css: styles, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 841.9 595.3", children: _jsxs("g", { fill: "#61DAFB", children: [_jsx("path", { d: "M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z" }), _jsx("path", { d: "M520.5 78.1z" })] }) }), _jsx("p", { children: loadingText })] }));
39
39
  }
@@ -1,4 +1,4 @@
1
1
  import { ReactElement } from 'react';
2
- export declare function defaultGetSpinner(): JSX.Element;
3
- export declare const spinnerContext: import("react").Context<() => ReactElement>;
4
- export declare const SpinnerProvider: import("react").Provider<() => ReactElement>;
2
+ export declare function defaultGetSpinner(loadingText?: string): JSX.Element;
3
+ export declare const spinnerContext: import("react").Context<(loadingText?: string) => ReactElement>;
4
+ export declare const SpinnerProvider: import("react").Provider<(loadingText?: string) => ReactElement>;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext } from 'react';
3
3
  import DefaultSpinnerComponent from './DefaultSpinnerComponent';
4
- export function defaultGetSpinner() {
5
- return _jsx(DefaultSpinnerComponent, {});
4
+ export function defaultGetSpinner(loadingText = 'Loading ...') {
5
+ return _jsx(DefaultSpinnerComponent, { loadingText: loadingText });
6
6
  }
7
7
  export const spinnerContext = createContext(defaultGetSpinner);
8
8
  export const SpinnerProvider = spinnerContext.Provider;
@@ -1,9 +1,8 @@
1
+ import { Molecule } from '../../data/molecules/Molecule';
1
2
  interface MoleculeStructureEditorModalProps {
2
3
  onClose?: (element?: string) => void;
3
- selectedMolecule: {
4
- key: any;
5
- molfile: string;
6
- };
4
+ selectedMolecule?: Molecule;
7
5
  }
8
6
  declare function MoleculeStructureEditorModal(props: MoleculeStructureEditorModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare function useMoleculeEditor(): (molecule?: Molecule) => void;
9
8
  export default MoleculeStructureEditorModal;
@@ -4,6 +4,8 @@ import { useState, useEffect, useCallback } from 'react';
4
4
  import { StructureEditor } from 'react-ocl/full';
5
5
  import { useDispatch } from '../context/DispatchContext';
6
6
  import ActionButtons from '../elements/ActionButtons';
7
+ import { useModal } from '../elements/popup/Modal';
8
+ import { positions } from '../elements/popup/options';
7
9
  import { SET_MOLECULE, ADD_MOLECULE } from '../reducer/types/Types';
8
10
  import { ModalStyles } from './ModalStyle';
9
11
  function MoleculeStructureEditorModal(props) {
@@ -27,7 +29,16 @@ function MoleculeStructureEditorModal(props) {
27
29
  }, [onClose]);
28
30
  const handleSave = useCallback(() => {
29
31
  if (selectedMolecule) {
30
- dispatch({ type: SET_MOLECULE, molfile, key: selectedMolecule.key });
32
+ const { key, isFloat, label } = selectedMolecule;
33
+ dispatch({
34
+ type: SET_MOLECULE,
35
+ payload: {
36
+ molfile,
37
+ key,
38
+ isFloat,
39
+ label,
40
+ },
41
+ });
31
42
  onClose('replace');
32
43
  }
33
44
  else {
@@ -37,4 +48,14 @@ function MoleculeStructureEditorModal(props) {
37
48
  }, [dispatch, selectedMolecule, molfile, onClose]);
38
49
  return (_jsxs("div", { css: ModalStyles, children: [_jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
39
50
  }
51
+ export function useMoleculeEditor() {
52
+ const modal = useModal();
53
+ return useCallback((molecule) => {
54
+ modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: molecule }), {
55
+ position: positions.TOP_CENTER,
56
+ width: 700,
57
+ height: 500,
58
+ });
59
+ }, [modal]);
60
+ }
40
61
  export default MoleculeStructureEditorModal;
@@ -11,9 +11,10 @@ import CloseButton from '../../elements/CloseButton';
11
11
  import SaveButton from '../../elements/SaveButton';
12
12
  import FormikForm from '../../elements/formik/FormikForm';
13
13
  import FormikOnChange from '../../elements/formik/FormikOnChange';
14
+ import { usePanelPreferences } from '../../hooks/usePanelPreferences';
14
15
  import { hasCouplingConstant, translateMultiplet, } from '../../panels/extra/utilities/MultiplicityUtilities';
15
16
  import { CHANGE_TEMP_RANGE } from '../../reducer/types/Types';
16
- import { useFormatNumberByNucleus } from '../../utility/FormatNumber';
17
+ import { formatNumber } from '../../utility/formatNumber';
17
18
  import SignalsForm from './forms/components/SignalsForm';
18
19
  import useRangeFormValidation from './forms/validation/EditRangeValidation';
19
20
  const styles = css `
@@ -71,7 +72,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
71
72
  const formRef = useRef(null);
72
73
  const { activeTab } = useChartData();
73
74
  const dispatch = useDispatch();
74
- const format = useFormatNumberByNucleus(activeTab);
75
+ const rangesPreferences = usePanelPreferences('ranges', activeTab);
75
76
  const validation = useRangeFormValidation();
76
77
  const handleOnZoom = useCallback(() => {
77
78
  onZoomEditRangeModal(range);
@@ -124,7 +125,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
124
125
  };
125
126
  if (hasCouplingConstant(_multiplicity)) {
126
127
  coupling = { ...signal.js[counterJ] };
127
- coupling.coupling = Number(format(coupling.coupling));
128
+ coupling.coupling = Number(formatNumber(coupling.coupling, rangesPreferences.coupling.format));
128
129
  counterJ++;
129
130
  }
130
131
  coupling.multiplicity = translateMultiplet(coupling.multiplicity);
@@ -133,7 +134,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
133
134
  return { ...signal, js: couplings };
134
135
  });
135
136
  return { activeTab: '0', signals };
136
- }, [format, range]);
137
+ }, [range.signals, rangesPreferences.coupling.format]);
137
138
  const changeHandler = useCallback((values) => {
138
139
  const signals = getSignals(values.signals);
139
140
  dispatch({
@@ -141,6 +142,6 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
141
142
  payload: { tempRange: Object.assign({}, range, { signals }) },
142
143
  });
143
144
  }, [dispatch, getSignals, range]);
144
- return (_jsx("div", { css: styles, children: _jsxs(FormikForm, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: ` Range and Signal edition: ${format(range.from)} ppm to ${format(range.to)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), popupTitle: "Save and exit" }), _jsx(CloseButton, { onClick: handleOnClose })] }), _jsx(SignalsForm, { range: range }), _jsx(FormikOnChange, { onChange: changeHandler })] }) }));
145
+ return (_jsx("div", { css: styles, children: _jsxs(FormikForm, { ref: formRef, initialValues: data, validationSchema: validation, onSubmit: handleOnSave, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: ` Range and Signal edition: ${formatNumber(range.from, rangesPreferences.from.format)} ppm to ${formatNumber(range.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), popupTitle: "Save and exit" }), _jsx(CloseButton, { onClick: handleOnClose })] }), _jsx(SignalsForm, { range: range, preferences: rangesPreferences }), _jsx(FormikOnChange, { onChange: changeHandler })] }) }));
145
146
  }
146
147
  export default EditRangeModal;
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import { WorkSpacePanelPreferences } from '../../../../workspaces/Workspace';
2
3
  interface AddSignalFormTabProps {
3
4
  onFocus: (element: any) => void;
4
5
  onBlur?: () => void;
5
6
  range: any;
7
+ preferences: WorkSpacePanelPreferences['ranges'];
6
8
  }
7
9
  declare const _default: import("react").ForwardRefExoticComponent<AddSignalFormTabProps & import("react").RefAttributes<unknown>>;
8
10
  export default _default;
@@ -5,12 +5,11 @@ import { useFormikContext } from 'formik';
5
5
  import { forwardRef, useCallback, useMemo } from 'react';
6
6
  import { FaPlus } from 'react-icons/fa';
7
7
  import * as Yup from 'yup';
8
- import { useChartData } from '../../../../context/ChartContext';
9
8
  import Button from '../../../../elements/Button';
10
9
  import FormikForm from '../../../../elements/formik/FormikForm';
11
10
  import FormikInput from '../../../../elements/formik/FormikInput';
12
11
  import { translateMultiplet } from '../../../../panels/extra/utilities/MultiplicityUtilities';
13
- import { useFormatNumberByNucleus } from '../../../../utility/FormatNumber';
12
+ import { formatNumber } from '../../../../utility/formatNumber';
14
13
  const styles = {
15
14
  container: css `
16
15
  text-align: center;
@@ -52,10 +51,8 @@ const styles = {
52
51
  `,
53
52
  };
54
53
  // TODO: this seems to be a hacky use of ref.
55
- function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
54
+ function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
56
55
  const { values, setFieldValue } = useFormikContext();
57
- const { activeTab } = useChartData();
58
- const format = useFormatNumberByNucleus(activeTab);
59
56
  const saveHandler = useCallback((val) => {
60
57
  const newSignal = {
61
58
  multiplicity: 'm',
@@ -91,6 +88,6 @@ function AddSignalFormTab({ onFocus, onBlur, range }, ref) {
91
88
  width: '250px',
92
89
  height: '30px',
93
90
  },
94
- }, checkErrorAfterInputTouched: false }) }), _jsxs("p", { css: styles.inputInfo, children: ["[ ", `${format(range.from)} ppm - ${format(range.to)} ppm`, " ]"] }), _jsx(Button, { css: styles.addSignalBtn, onClick: triggerSubmitHandler, children: _jsx(FaPlus, { title: "Add new signal" }) })] })] }) }));
91
+ }, checkErrorAfterInputTouched: false }) }), _jsxs("p", { css: styles.inputInfo, children: ["[", `${formatNumber(range.from, preferences.from.format)} ppm - ${formatNumber(range.to, preferences.to.format)} ppm`, "]"] }), _jsx(Button, { css: styles.addSignalBtn, onClick: triggerSubmitHandler, children: _jsx(FaPlus, { title: "Add new signal" }) })] })] }) }));
95
92
  }
96
93
  export default forwardRef(AddSignalFormTab);
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
+ import { WorkSpacePanelPreferences } from '../../../../workspaces/Workspace';
2
3
  interface SignalsFormProps {
3
4
  range: number;
5
+ preferences: WorkSpacePanelPreferences['ranges'];
4
6
  }
5
- declare function SignalsForm({ range }: SignalsFormProps): import("@emotion/react/jsx-runtime").JSX.Element;
7
+ declare function SignalsForm({ range, preferences }: SignalsFormProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
8
  declare const _default: import("react").MemoExoticComponent<typeof SignalsForm>;
7
9
  export default _default;
@@ -3,12 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
3
3
  import { css } from '@emotion/react';
4
4
  import { useFormikContext } from 'formik';
5
5
  import { useCallback, useMemo, memo, useEffect, useState, useRef } from 'react';
6
- import { useChartData } from '../../../../context/ChartContext';
7
6
  import Tab from '../../../../elements/Tab/Tab';
8
7
  import Tabs from '../../../../elements/Tab/Tabs';
9
8
  import useSpectrum from '../../../../hooks/useSpectrum';
10
9
  import Events from '../../../../utility/Events';
11
- import { useFormatNumberByNucleus } from '../../../../utility/FormatNumber';
10
+ import { formatNumber } from '../../../../utility/formatNumber';
12
11
  import AddSignalFormTab from './AddSignalFormTab';
13
12
  import DeltaInput from './DeltaInput';
14
13
  import SignalFormTab from './SignalFormTab';
@@ -38,13 +37,11 @@ const tabStyles = css `
38
37
  list-style: none;
39
38
  padding: 0.5rem 1.5rem;
40
39
  `;
41
- function SignalsForm({ range }) {
40
+ function SignalsForm({ range, preferences }) {
42
41
  const newSignalFormRef = useRef();
43
42
  const [activeField, setActiveField] = useState(null);
44
43
  const { values, setFieldValue, errors, } = useFormikContext();
45
- const { activeTab } = useChartData();
46
44
  const { info } = useSpectrum({ info: {} });
47
- const format = useFormatNumberByNucleus(activeTab);
48
45
  useEffect(() => {
49
46
  function handle(event) {
50
47
  if (info?.originFrequency && activeField) {
@@ -57,7 +54,7 @@ function SignalsForm({ range }) {
57
54
  setFieldValue(activeField, (event.range[1] - event.range[0]) / 2 + event.range[0]);
58
55
  }
59
56
  else {
60
- const value = Number(format(Math.abs(event.range[0] - event.range[1]) * info.originFrequency));
57
+ const value = Number(formatNumber(Math.abs(event.range[0] - event.range[1]) * info.originFrequency, preferences.deltaHz.format));
61
58
  setFieldValue(activeField, value);
62
59
  }
63
60
  }
@@ -67,7 +64,13 @@ function SignalsForm({ range }) {
67
64
  return () => {
68
65
  Events.off('brushEnd', handle);
69
66
  };
70
- }, [activeField, setFieldValue, values.activeTab, format, info]);
67
+ }, [
68
+ activeField,
69
+ setFieldValue,
70
+ values.activeTab,
71
+ info,
72
+ preferences?.deltaHz?.format,
73
+ ]);
71
74
  useEffect(() => {
72
75
  function handle(event) {
73
76
  if (activeField) {
@@ -109,9 +112,9 @@ function SignalsForm({ range }) {
109
112
  // eslint-disable-next-line react/no-array-index-key
110
113
  , { tabid: `${i}`, tabstyles: tabContainsErrors(i) ? tabStylesAddition : tabStyles, canDelete: true, render: () => (_jsx(DeltaInput, { signal: signal, index: i, onFocus: handleOnFocus })), children: _jsx(SignalFormTab, { onFocus: handleOnFocus }) }, `signalForm${i}`)))
111
114
  : [];
112
- const addSignalTab = (_jsx(Tab, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: _jsx(AddSignalFormTab, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef }) }, "addSignalTab"));
115
+ const addSignalTab = (_jsx(Tab, { tablabel: "+", tabid: "addSignalTab", canDelete: false, className: "add-signal-tab", children: _jsx(AddSignalFormTab, { onFocus: handleOnFocus, range: range, ref: newSignalFormRef, preferences: preferences }) }, "addSignalTab"));
113
116
  return signalTabs.concat(addSignalTab);
114
- }, [handleOnFocus, range, tabContainsErrors, values.signals]);
117
+ }, [handleOnFocus, preferences, range, tabContainsErrors, values.signals]);
115
118
  const editSignalInfoText = (_jsx("p", { className: "infoText", children: "Focus on an input field and press Shift + Drag & Drop to draw a coupling constant in spectrum view." }));
116
119
  const addSignalInfoText = (_jsx("p", { className: "infoText", children: "Focus on the input field and press Shift + Left mouse click to select new signal delta value in spectrum view." }));
117
120
  return (_jsxs("div", { children: [_jsx("div", { css: textStyles, children: errors.signals &&
@@ -0,0 +1,6 @@
1
+ import { NMRiumWorkspace } from '../../NMRium';
2
+ interface DatabasesTabContentProps {
3
+ currentWorkspace: NMRiumWorkspace;
4
+ }
5
+ declare function DatabasesTabContent({ currentWorkspace }: DatabasesTabContentProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
+ export default DatabasesTabContent;
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { css } from '@emotion/react';
4
+ import { useFormikContext } from 'formik';
5
+ import lodashGet from 'lodash/get';
6
+ import { useCallback, useMemo } from 'react';
7
+ import { FaPlus, FaTimes } from 'react-icons/fa';
8
+ import Button from '../../elements/Button';
9
+ import FormikCheckBox from '../../elements/formik/FormikCheckBox';
10
+ import FormikInput from '../../elements/formik/FormikInput';
11
+ import Workspaces from '../../workspaces';
12
+ const style = {
13
+ addButton: css `
14
+ background-color: transparent;
15
+ border: 0;
16
+ outline: none;
17
+ margin-left: 5px;
18
+ svg {
19
+ font-size: 14px;
20
+ fill: green;
21
+ }
22
+ `,
23
+ table: {
24
+ width: '100%',
25
+ },
26
+ th: {
27
+ fontSize: '12px',
28
+ },
29
+ input: {
30
+ input: { width: '100%' },
31
+ },
32
+ labelCol: {
33
+ width: '30%',
34
+ },
35
+ serialCol: {
36
+ width: '5%',
37
+ },
38
+ };
39
+ function DatabasesTabContent({ currentWorkspace }) {
40
+ const { values, setFieldValue } = useFormikContext();
41
+ const databases = useMemo(() => lodashGet(values, 'databases', []), [values]);
42
+ const deleteHandler = useCallback((index) => {
43
+ const _database = databases.slice();
44
+ _database.splice(index, 1);
45
+ setFieldValue('databases', _database);
46
+ }, [databases, setFieldValue]);
47
+ const addNewDatabaseHandler = useCallback(() => {
48
+ const newDatabase = {
49
+ label: '',
50
+ url: '',
51
+ enabled: true,
52
+ };
53
+ setFieldValue('databases', [...databases, newDatabase]);
54
+ }, [databases, setFieldValue]);
55
+ const resetDatabaseHandler = useCallback(() => {
56
+ const database = Workspaces?.[currentWorkspace]?.databases || Workspaces.default.databases;
57
+ setFieldValue('databases', database);
58
+ }, [currentWorkspace, setFieldValue]);
59
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "section-header", style: { display: 'flex' }, children: [_jsx("p", { style: { flex: 1 }, children: "Databases" }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between' }, children: [_jsx(Button.Danger, { fill: "clear", size: "xSmall", onClick: resetDatabaseHandler, style: { margin: '0 5px' }, children: "Reset Databases" }), _jsx(Button.Done, { fill: "outline", size: "xSmall", onClick: addNewDatabaseHandler, children: "Add Database" })] })] }), _jsx("div", { children: _jsxs("table", { style: style.table, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: style.th, children: "#" }), _jsx("th", { style: style.th, children: "Label " }), _jsx("th", { style: style.th, children: "URL" }), _jsx("th", { style: style.th, children: "Enabled" }), _jsx("th", {})] }) }), _jsx("tbody", { children: databases?.map((item, index) => {
60
+ const num = index + 1;
61
+ return (
62
+ // eslint-disable-next-line react/no-array-index-key
63
+ _jsxs("tr", { style: { height: '33px' }, children: [_jsxs("td", { style: style.serialCol, children: [_jsx("span", { children: num }), ' '] }), _jsx("td", { style: style.labelCol, children: _jsx(FormikInput, { style: style.input, name: `databases.${index}.label`, checkErrorAfterInputTouched: false }) }), _jsx("td", { children: _jsx(FormikInput, { style: style.input, name: `databases.${index}.url`, checkErrorAfterInputTouched: false }) }), _jsx("td", { children: _jsx(FormikCheckBox, { style: {
64
+ container: {
65
+ display: 'block',
66
+ margin: '0 auto',
67
+ width: 'fit-content',
68
+ },
69
+ }, className: "checkbox-element", name: `databases.${index}.enabled` }) }), _jsx("td", { children: _jsxs("div", { style: {
70
+ display: 'flex',
71
+ height: '100%',
72
+ }, children: [_jsx(Button.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(index), children: _jsx(FaTimes, {}) }), databases.length === index + 1 && (_jsx(Button.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewDatabaseHandler, children: _jsx(FaPlus, {}) }))] }) })] }, `${index}`));
73
+ }) })] }) })] }));
74
+ }
75
+ export default DatabasesTabContent;
@@ -9,7 +9,7 @@ const LIST = [
9
9
  name: 'panels.spectraPanel',
10
10
  },
11
11
  {
12
- label: 'Spectra information Panel',
12
+ label: 'Spectra information panel',
13
13
  name: 'panels.informationPanel',
14
14
  },
15
15
  {
@@ -29,7 +29,7 @@ const LIST = [
29
29
  name: 'panels.structuresPanel',
30
30
  },
31
31
  {
32
- label: 'Filters Panel',
32
+ label: 'Filters panel',
33
33
  name: 'panels.filtersPanel',
34
34
  },
35
35
  {
@@ -37,23 +37,27 @@ const LIST = [
37
37
  name: 'panels.zonesPanel',
38
38
  },
39
39
  {
40
- label: 'Assignment summary Panel',
40
+ label: 'Assignment summary panel',
41
41
  name: 'panels.summaryPanel',
42
42
  },
43
43
  {
44
- label: 'Multiple Spectra Analysis Panel',
44
+ label: 'Multiple spectra analysis panel',
45
45
  name: 'panels.multipleSpectraAnalysisPanel',
46
46
  },
47
47
  {
48
- label: 'Database Panel',
48
+ label: 'Databases panel',
49
49
  name: 'panels.databasePanel',
50
50
  },
51
51
  {
52
- label: 'Prediction Panel',
52
+ label: 'Prediction panel',
53
53
  name: 'panels.predictionPanel',
54
54
  },
55
55
  {
56
- label: 'Experimental Features',
56
+ label: 'Automatic assignment panel',
57
+ name: 'panels.automaticAssignmentPanel',
58
+ },
59
+ {
60
+ label: 'Experimental features',
57
61
  name: 'general.experimentalFeatures',
58
62
  hideOpenOption: true,
59
63
  },
@@ -4,9 +4,9 @@ import { css } from '@emotion/react';
4
4
  import { useFormikContext } from 'formik';
5
5
  import lodashGet from 'lodash/get';
6
6
  import { Fragment, useCallback, useMemo } from 'react';
7
- import { FaPlus } from 'react-icons/fa';
7
+ import { FaPlus, FaTimes } from 'react-icons/fa';
8
8
  import generateID from '../../../data/utilities/generateID';
9
- import CloseButton from '../../elements/CloseButton';
9
+ import Button from '../../elements/Button';
10
10
  import FormikInput from '../../elements/formik/FormikInput';
11
11
  const styles = css `
12
12
  .counter-col {
@@ -18,7 +18,7 @@ const styles = css `
18
18
  width: 80px;
19
19
  }
20
20
 
21
- .width-100 {
21
+ .input {
22
22
  width: 100% !important;
23
23
  margin: 0px !important;
24
24
  }
@@ -68,9 +68,9 @@ function FormattingTabContent() {
68
68
  setFieldValue('formatting.nuclei', newNuclei);
69
69
  }, [nuclei, setFieldValue]);
70
70
  const nucleiList = Object.keys(nuclei);
71
- return (_jsxs(Fragment, { children: [_jsx("p", { className: "section-header", children: "Nuclei Formatting" }), _jsx("div", { css: styles, children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "counter-col", children: "#" }), _jsx("th", { className: "nucleus-label-col", children: "Nucleus " }), _jsx("th", { className: "nucleus-format-input-col", children: "\u03B4 (ppm)" }), _jsx("th", { className: "nucleus-format-input-col", children: "Coupling (Hz)" }), _jsx("th", { className: "nucleus-format-input-col" })] }) }), _jsx("tbody", { children: nucleiList?.map((key, index) => {
71
+ return (_jsxs(Fragment, { children: [_jsx("p", { className: "section-header", children: "Number formatting for crosshair and info line" }), _jsx("div", { css: styles, children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "counter-col", children: "#" }), _jsx("th", { className: "nucleus-label-col", children: "Nucleus " }), _jsx("th", { className: "nucleus-format-input-col", children: "\u03B4 (ppm)" }), _jsx("th", { className: "nucleus-format-input-col", children: "Coupling (Hz)" }), _jsx("th", { className: "nucleus-format-input-col" })] }) }), _jsx("tbody", { children: nucleiList?.map((key, index) => {
72
72
  const num = index + 1;
73
- return (_jsxs("tr", { children: [_jsxs("td", { className: "counter-col", children: [_jsxs("span", { children: [num, " - "] }), ' '] }), _jsx("td", { className: "nucleus-label-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.name`, className: "width-100", checkErrorAfterInputTouched: false }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.ppm`, className: "width-100" }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.hz`, className: "width-100" }) }), _jsxs("td", { className: "operation-container", children: [_jsx(CloseButton, { onClick: () => deleteHandler(key), popupTitle: `remove ${nuclei[key].name}`, popupPlacement: "right" }), nucleiList.length === index + 1 && (_jsx("button", { className: "add", type: "button", onClick: addNewNucleusFormatHandler, children: _jsx(FaPlus, {}) }))] })] }, `${key}`));
73
+ return (_jsxs("tr", { children: [_jsxs("td", { className: "counter-col", children: [_jsxs("span", { children: [num, " - "] }), ' '] }), _jsx("td", { className: "nucleus-label-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.name`, className: "input", checkErrorAfterInputTouched: false }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.ppm`, className: "input" }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.hz`, className: "input" }) }), _jsxs("td", { className: "operation-container", children: [_jsx(Button.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(key), children: _jsx(FaTimes, {}) }), nucleiList.length === index + 1 && (_jsx(Button.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addNewNucleusFormatHandler, children: _jsx(FaPlus, {}) }))] })] }, `${key}`));
74
74
  }) })] }) })] }));
75
75
  }
76
76
  export default FormattingTabContent;
@@ -12,6 +12,7 @@ import FormikForm from '../../elements/formik/FormikForm';
12
12
  import { useAlert } from '../../elements/popup/Alert';
13
13
  import { ModalStyles } from '../ModalStyle';
14
14
  import ControllersTabContent from './ControllersTabContent';
15
+ import DatabasesTabContent from './DatabasesTabContent';
15
16
  import DisplayTabContent from './DisplayTabContent';
16
17
  import FormattingTabContent from './FormattingTabContent';
17
18
  import WorkspaceItem from './WorkspaceItem';
@@ -147,6 +148,6 @@ function GeneralSettings({ onClose }) {
147
148
  const renderItem = useCallback((item) => {
148
149
  return (_jsx(WorkspaceItem, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
149
150
  }, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
150
- return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "workspace-container", children: [_jsx("span", { className: "label", children: "Workspace : " }), _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: preferences.current, validationSchema: validation, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "Controllers", tabid: "controllers", children: _jsx("div", { className: "inner-content", children: _jsx(ControllersTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "Display", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, { preferences: preferences.current.display }) }) })] }) }, JSON.stringify(preferences.current)) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleReset, cancelLabel: "Reset" }) })] }));
151
+ return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "workspace-container", children: [_jsx("span", { className: "label", children: "Workspace : " }), _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: preferences.current, validationSchema: validation, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "Controllers", tabid: "controllers", children: _jsx("div", { className: "inner-content", children: _jsx(ControllersTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "Display", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, { preferences: preferences.current.display }) }) }), _jsx(Tab, { tablabel: "Databases", tabid: "databases", children: _jsx("div", { className: "inner-content", children: _jsx(DatabasesTabContent, { currentWorkspace: preferences.workspace.current }) }) })] }) }, JSON.stringify(preferences.current)) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleReset, cancelLabel: "Reset" }) })] }));
151
152
  }
152
153
  export default GeneralSettings;
@@ -1,8 +1,56 @@
1
1
  import * as Yup from 'yup';
2
2
  export declare const validation: import("yup/lib/Lazy").default<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
3
  formatting: Yup.ObjectSchema<any, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<any>, import("yup/lib/object").AssertsShape<any>>;
4
+ databases: Yup.ArraySchema<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
8
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
9
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
11
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
12
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
13
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
14
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
15
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
16
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
17
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
19
+ }>>[] | undefined>;
4
20
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
21
  formatting: Yup.ObjectSchema<any, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<any>, import("yup/lib/object").AssertsShape<any>>;
22
+ databases: Yup.ArraySchema<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
23
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
24
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
25
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
26
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
27
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
28
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
29
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
30
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
31
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
32
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
33
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
34
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
35
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
36
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
37
+ }>>[] | undefined>;
6
38
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
39
  formatting: Yup.ObjectSchema<any, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<any>, import("yup/lib/object").AssertsShape<any>>;
40
+ databases: Yup.ArraySchema<Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
41
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
42
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
43
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
44
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
45
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
46
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
47
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
48
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
49
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
50
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
51
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
52
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
53
+ label: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
54
+ url: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
55
+ }>>[] | undefined>;
8
56
  }>>>, import("yup/lib/object").AnyObject>;
@@ -1,5 +1,5 @@
1
1
  import * as Yup from 'yup';
2
- const formattingValidation = (obj) => Object.keys(obj.formatting.nuclei).reduce((validate, key) => {
2
+ const formattingElementValidation = (obj) => Object.keys(obj.formatting.nuclei).reduce((validate, key) => {
3
3
  validate[key] = Yup.object().shape({
4
4
  name: Yup.string().trim().required('Nucleus is a required field'),
5
5
  ppm: Yup.string().trim().required('PPM format is a required field'),
@@ -7,34 +7,40 @@ const formattingValidation = (obj) => Object.keys(obj.formatting.nuclei).reduce(
7
7
  });
8
8
  return validate;
9
9
  }, {});
10
- export const validation = Yup.lazy((obj) => Yup.object().shape({
11
- formatting: Yup.object().shape({
12
- nuclei: Yup.object()
13
- .shape(formattingValidation(obj))
14
- .test('Unique', 'Nuclei need te be unique', function check(nuclei) {
15
- let nucleusFrequencies = {};
16
- for (const key of Object.keys(nuclei)) {
17
- const _key = nuclei[key].name?.toLowerCase() || '';
18
- if (_key) {
19
- if (nucleusFrequencies[_key]) {
20
- ++nucleusFrequencies[_key].value;
21
- nucleusFrequencies[_key].fields.push(key);
22
- }
23
- else {
24
- nucleusFrequencies[_key] = { value: 1, fields: [key] };
25
- }
10
+ const formattingValidation = (obj) => Yup.object().shape({
11
+ nuclei: Yup.object()
12
+ .shape(formattingElementValidation(obj))
13
+ .test('Unique', 'Nuclei need te be unique', function check(nuclei) {
14
+ let nucleusFrequencies = {};
15
+ for (const key of Object.keys(nuclei)) {
16
+ const _key = nuclei[key].name?.toLowerCase() || '';
17
+ if (_key) {
18
+ if (nucleusFrequencies[_key]) {
19
+ ++nucleusFrequencies[_key].value;
20
+ nucleusFrequencies[_key].fields.push(key);
21
+ }
22
+ else {
23
+ nucleusFrequencies[_key] = { value: 1, fields: [key] };
26
24
  }
27
25
  }
28
- const errors = Object.keys(nucleusFrequencies).reduce((errorList, key) => {
29
- const { value, fields } = nucleusFrequencies[key];
30
- if (value > 1) {
31
- for (let field of fields) {
32
- errorList.push(new Yup.ValidationError(`${key} nucleus must te be unique`, nuclei[key].name, `${this.path}.${field}.name`));
33
- }
26
+ }
27
+ const errors = Object.keys(nucleusFrequencies).reduce((errorList, key) => {
28
+ const { value, fields } = nucleusFrequencies[key];
29
+ if (value > 1) {
30
+ for (let field of fields) {
31
+ errorList.push(new Yup.ValidationError(`${key} nucleus must te be unique`, nuclei[key].name, `${this.path}.${field}.name`));
34
32
  }
35
- return errorList;
36
- }, []);
37
- return new Yup.ValidationError(errors);
38
- }),
33
+ }
34
+ return errorList;
35
+ }, []);
36
+ return new Yup.ValidationError(errors);
39
37
  }),
38
+ });
39
+ const databasesValidation = Yup.array().of(Yup.object().shape({
40
+ label: Yup.string().trim().required('Label is a required field'),
41
+ url: Yup.string().trim().url().required('URL is a required field'),
42
+ }));
43
+ export const validation = Yup.lazy((obj) => Yup.object().shape({
44
+ formatting: formattingValidation(obj),
45
+ databases: databasesValidation,
40
46
  }));