nmrium 0.31.0 → 0.33.0-pre.1667632695

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 (492) hide show
  1. package/lib/component/1d/Chart1D.js +1 -1
  2. package/lib/component/1d/FooterBanner.js +17 -10
  3. package/lib/component/1d/LinesSeries.js +1 -1
  4. package/lib/component/1d/SpectraTracker.js +1 -1
  5. package/lib/component/1d/Viewer1D.js +1 -1
  6. package/lib/component/1d/XAxis.js +1 -1
  7. package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
  8. package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  9. package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
  10. package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
  11. package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
  12. package/lib/component/1d/integral/IntegralIndicator.js +27 -0
  13. package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
  14. package/lib/component/1d/integral/IntegralResizable.js +69 -0
  15. package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
  16. package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
  17. package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  18. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
  19. package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
  20. package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
  21. package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
  22. package/lib/component/1d/ranges/Range.js +27 -50
  23. package/lib/component/1d/tool/PeakPointer.js +1 -1
  24. package/lib/component/1d/utilities/scale.js +2 -2
  25. package/lib/component/2d/Contours.js +61 -42
  26. package/lib/component/2d/FooterBanner.js +2 -2
  27. package/lib/component/2d/Left1DChart.js +1 -1
  28. package/lib/component/2d/Top1DChart.js +1 -1
  29. package/lib/component/2d/Viewer2D.js +11 -14
  30. package/lib/component/2d/tools/XYLabelPointer.js +2 -2
  31. package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  32. package/lib/component/2d/zones/IndicationLines.js +5 -8
  33. package/lib/component/EventsTrackers/BrushTracker.js +30 -21
  34. package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
  35. package/lib/component/NMRium.d.ts +1 -1
  36. package/lib/component/NMRium.js +6 -6
  37. package/lib/component/SplitPaneWrapper.js +1 -1
  38. package/lib/component/assignment/actions/initAssignment.js +17 -17
  39. package/lib/component/assignment/index.js +2 -2
  40. package/lib/component/context/PreferencesContext.js +3 -6
  41. package/lib/component/elements/Button.js +1 -1
  42. package/lib/component/elements/CheckBoxCell.js +1 -1
  43. package/lib/component/elements/ContextMenu.js +2 -2
  44. package/lib/component/elements/EditableColumn.d.ts +3 -1
  45. package/lib/component/elements/EditableColumn.js +21 -8
  46. package/lib/component/elements/GroupPane.d.ts +12 -0
  47. package/lib/component/elements/GroupPane.js +14 -0
  48. package/lib/component/elements/Input.js +7 -4
  49. package/lib/component/elements/IsotopesViewer.js +1 -1
  50. package/lib/component/elements/Label.js +1 -2
  51. package/lib/component/elements/MolecularFormulaInput.js +2 -0
  52. package/lib/component/elements/NumberInput.js +2 -2
  53. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  54. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
  55. package/lib/component/elements/ReactTable/ReactTable.js +72 -38
  56. package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
  57. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  58. package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
  59. package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
  60. package/lib/component/elements/accordion/Accordion.js +2 -2
  61. package/lib/component/elements/draggble/useDraggable.js +1 -3
  62. package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
  63. package/lib/component/elements/formik/FormikCheckBox.js +1 -1
  64. package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
  65. package/lib/component/elements/formik/FormikColorPicker.js +5 -8
  66. package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
  67. package/lib/component/elements/formik/FormikForm.js +2 -2
  68. package/lib/component/elements/formik/FormikInput.d.ts +0 -1
  69. package/lib/component/elements/formik/FormikInput.js +12 -20
  70. package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
  71. package/lib/component/elements/formik/FormikOnChange.js +13 -10
  72. package/lib/component/elements/formik/FormikSelect.js +1 -1
  73. package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
  74. package/lib/component/elements/formik/FormikSlider.js +8 -11
  75. package/lib/component/elements/formik/FormikTextarea.js +1 -1
  76. package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
  77. package/lib/component/elements/popup/Alert/Provider.js +7 -7
  78. package/lib/component/elements/popup/Alert/index.d.ts +3 -4
  79. package/lib/component/elements/popup/Alert/index.js +3 -4
  80. package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
  81. package/lib/component/elements/popup/Modal/Provider.js +16 -31
  82. package/lib/component/elements/popup/Modal/index.d.ts +4 -5
  83. package/lib/component/elements/popup/Modal/index.js +4 -5
  84. package/lib/component/header/Header.js +1 -1
  85. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  86. package/lib/component/hooks/useCombinedRefs.js +2 -2
  87. package/lib/component/hooks/useExport.d.ts +1 -1
  88. package/lib/component/hooks/useExport.js +9 -6
  89. package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
  90. package/lib/component/hooks/usePanelPreferences.js +9 -7
  91. package/lib/component/loader/DropZone.js +10 -2
  92. package/lib/component/modal/AlignSpectraModal.js +1 -1
  93. package/lib/component/modal/ExportAsMatrixModal.js +1 -1
  94. package/lib/component/modal/LoadJCAMPModal.js +2 -2
  95. package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
  96. package/lib/component/modal/MultipletAnalysisModal.js +3 -3
  97. package/lib/component/modal/PredictSpectraModal.js +5 -5
  98. package/lib/component/modal/editRange/EditRangeModal.js +4 -4
  99. package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
  100. package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
  101. package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
  102. package/lib/component/modal/setting/DisplayTabContent.js +21 -27
  103. package/lib/component/modal/setting/FormattingTabContent.js +10 -10
  104. package/lib/component/modal/setting/GeneralSettings.js +11 -14
  105. package/lib/component/modal/setting/GeneralTabContent.js +3 -1
  106. package/lib/component/modal/setting/ToolsTabContent.js +18 -19
  107. package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
  108. package/lib/component/modal/setting/WorkspaceItem.js +36 -48
  109. package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
  110. package/lib/component/modal/setting/settingsValidation.js +14 -12
  111. package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
  112. package/lib/component/panels/InformationPanel.js +52 -56
  113. package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  114. package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
  115. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
  116. package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
  117. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
  118. package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  119. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
  120. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
  121. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
  122. package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  123. package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  124. package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
  125. package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
  126. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
  127. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  128. package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
  129. package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  130. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
  131. package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
  132. package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
  133. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
  134. package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
  135. package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  136. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
  137. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
  138. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
  139. package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
  140. package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
  141. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
  142. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
  143. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
  144. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
  145. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
  146. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
  147. package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
  148. package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
  149. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
  150. package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
  151. package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
  152. package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
  153. package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  154. package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
  155. package/lib/component/reducer/IgnoreActions.js +3 -3
  156. package/lib/component/reducer/Reducer.d.ts +26 -45
  157. package/lib/component/reducer/Reducer.js +13 -12
  158. package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
  159. package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
  160. package/lib/component/reducer/actions/DomainActions.js +52 -69
  161. package/lib/component/reducer/actions/FiltersActions.js +15 -6
  162. package/lib/component/reducer/actions/HistoryActions.js +5 -5
  163. package/lib/component/reducer/actions/IntegralsActions.js +6 -5
  164. package/lib/component/reducer/actions/LoadActions.js +12 -0
  165. package/lib/component/reducer/actions/PeaksActions.js +7 -6
  166. package/lib/component/reducer/actions/PreferencesActions.js +20 -38
  167. package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
  168. package/lib/component/reducer/actions/RangesActions.js +28 -24
  169. package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
  170. package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
  171. package/lib/component/reducer/actions/ToolsActions.js +28 -41
  172. package/lib/component/reducer/actions/ZonesActions.js +11 -10
  173. package/lib/component/reducer/core/Constants.js +1 -1
  174. package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
  175. package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
  176. package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
  177. package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
  178. package/lib/component/reducer/helper/getSpectrum.js +3 -5
  179. package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
  180. package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
  181. package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
  182. package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
  183. package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
  184. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
  185. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
  186. package/lib/component/tool/BrushX.js +3 -3
  187. package/lib/component/tool/BrushXY.js +5 -5
  188. package/lib/component/tool/CrossLinePointer.js +3 -3
  189. package/lib/component/toolbar/BasicToolBar.js +9 -8
  190. package/lib/component/utility/Evaluate.js +2 -2
  191. package/lib/component/utility/FileUtility.d.ts +2 -9
  192. package/lib/component/utility/FileUtility.js +11 -28
  193. package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
  194. package/lib/component/utility/GroupByInfoKey.js +11 -13
  195. package/lib/component/utility/PathBuilder.js +1 -1
  196. package/lib/component/utility/PreferencesHelper.js +2 -3
  197. package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
  198. package/lib/component/utility/{Export.js → export.js} +54 -73
  199. package/lib/component/utility/formatNumber.d.ts +6 -1
  200. package/lib/component/utility/formatNumber.js +5 -4
  201. package/lib/component/workspaces/Workspace.d.ts +1 -1
  202. package/lib/component/workspaces/exercise.js +4 -4
  203. package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
  204. package/lib/data/Filters.d.ts +16 -18
  205. package/lib/data/Filters.js +16 -18
  206. package/lib/data/FiltersManager.js +4 -3
  207. package/lib/data/PredictionManager.js +8 -10
  208. package/lib/data/SpectraManager.d.ts +1 -2
  209. package/lib/data/SpectraManager.js +25 -60
  210. package/lib/data/data1d/MultipleAnalysis.js +74 -70
  211. package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
  212. package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  213. package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
  214. package/lib/data/data1d/Spectrum1D/index.js +24 -25
  215. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  216. package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
  217. package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
  218. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
  219. package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
  220. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
  221. package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  222. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
  223. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
  224. package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
  225. package/lib/data/data1d/database.js +45 -28
  226. package/lib/data/data1d/filter1d/apodization.js +2 -1
  227. package/lib/data/data1d/filter1d/fft.js +24 -7
  228. package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
  229. package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
  230. package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
  231. package/lib/data/data2d/Processing2D.d.ts +3 -3
  232. package/lib/data/data2d/Processing2D.js +10 -20
  233. package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
  234. package/lib/data/data2d/Spectrum2D/contours.js +132 -0
  235. package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
  236. package/lib/data/data2d/Spectrum2D/index.js +10 -11
  237. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
  238. package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
  239. package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
  240. package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
  241. package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
  242. package/lib/data/molecules/MoleculeManager.js +1 -1
  243. package/lib/data/types/common/Source.d.ts +1 -0
  244. package/lib/data/types/data1d/index.d.ts +12 -13
  245. package/lib/data/types/data2d/Data2D.d.ts +2 -0
  246. package/lib/data/types/data2d/Datum2D.d.ts +0 -1
  247. package/lib/data/types/data2d/index.d.ts +8 -9
  248. package/lib/data/utilities/RangeUtilities.js +13 -9
  249. package/lib/data/utilities/ZoneUtilities.js +17 -13
  250. package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
  251. package/lib/data/utilities/calculateSanPlot.js +31 -0
  252. package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
  253. package/lib/data/utilities/generateChar.js +8 -6
  254. package/lib/data/utilities/getAtom.js +1 -1
  255. package/lib/data/utilities/getAtomsFromMF.js +2 -2
  256. package/lib/data/utilities/getColor.js +3 -3
  257. package/lib/data/utilities/getSum.js +6 -3
  258. package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
  259. package/lib/versionInfo.js +1 -1
  260. package/lib-cjs/component/1d/Chart1D.js +1 -1
  261. package/lib-cjs/component/1d/FooterBanner.js +16 -9
  262. package/lib-cjs/component/1d/LinesSeries.js +1 -1
  263. package/lib-cjs/component/1d/SpectraTracker.js +1 -1
  264. package/lib-cjs/component/1d/Viewer1D.js +1 -1
  265. package/lib-cjs/component/1d/XAxis.js +1 -1
  266. package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
  267. package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
  268. package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
  269. package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
  270. package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
  271. package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
  272. package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
  273. package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
  274. package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
  275. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
  276. package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
  277. package/lib-cjs/component/1d/ranges/Range.js +27 -50
  278. package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
  279. package/lib-cjs/component/1d/utilities/scale.js +2 -2
  280. package/lib-cjs/component/2d/Contours.js +60 -41
  281. package/lib-cjs/component/2d/FooterBanner.js +2 -2
  282. package/lib-cjs/component/2d/Left1DChart.js +1 -1
  283. package/lib-cjs/component/2d/Top1DChart.js +1 -1
  284. package/lib-cjs/component/2d/Viewer2D.js +11 -14
  285. package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
  286. package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
  287. package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
  288. package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
  289. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
  290. package/lib-cjs/component/NMRium.js +7 -7
  291. package/lib-cjs/component/SplitPaneWrapper.js +1 -1
  292. package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
  293. package/lib-cjs/component/assignment/index.js +2 -2
  294. package/lib-cjs/component/context/PreferencesContext.js +3 -6
  295. package/lib-cjs/component/elements/Button.js +1 -1
  296. package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
  297. package/lib-cjs/component/elements/ContextMenu.js +2 -2
  298. package/lib-cjs/component/elements/EditableColumn.js +21 -8
  299. package/lib-cjs/component/elements/GroupPane.js +18 -0
  300. package/lib-cjs/component/elements/Input.js +7 -4
  301. package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
  302. package/lib-cjs/component/elements/Label.js +1 -2
  303. package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
  304. package/lib-cjs/component/elements/NumberInput.js +2 -2
  305. package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  306. package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
  307. package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
  308. package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
  309. package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
  310. package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
  311. package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
  312. package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
  313. package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
  314. package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
  315. package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
  316. package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
  317. package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
  318. package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
  319. package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
  320. package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
  321. package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
  322. package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
  323. package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
  324. package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
  325. package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
  326. package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
  327. package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
  328. package/lib-cjs/component/header/Header.js +1 -1
  329. package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
  330. package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
  331. package/lib-cjs/component/hooks/useExport.js +14 -11
  332. package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
  333. package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
  334. package/lib-cjs/component/loader/DropZone.js +10 -2
  335. package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
  336. package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
  337. package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
  338. package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
  339. package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
  340. package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
  341. package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
  342. package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
  343. package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
  344. package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
  345. package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
  346. package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
  347. package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
  348. package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
  349. package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
  350. package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
  351. package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
  352. package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
  353. package/lib-cjs/component/panels/InformationPanel.js +51 -55
  354. package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
  355. package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
  356. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
  357. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
  358. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
  359. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
  360. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
  361. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
  362. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
  363. package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
  364. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
  365. package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
  366. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
  367. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
  368. package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
  369. package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
  370. package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
  371. package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
  372. package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
  373. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
  374. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
  375. package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
  376. package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
  377. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
  378. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
  379. package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
  380. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
  381. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
  382. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
  383. package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
  384. package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
  385. package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
  386. package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
  387. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
  388. package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
  389. package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
  390. package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
  391. package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
  392. package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
  393. package/lib-cjs/component/reducer/Reducer.js +12 -11
  394. package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
  395. package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
  396. package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
  397. package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
  398. package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
  399. package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
  400. package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
  401. package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
  402. package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
  403. package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
  404. package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
  405. package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
  406. package/lib-cjs/component/reducer/core/Constants.js +1 -1
  407. package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
  408. package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
  409. package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
  410. package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
  411. package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
  412. package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
  413. package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
  414. package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
  415. package/lib-cjs/component/tool/BrushX.js +3 -3
  416. package/lib-cjs/component/tool/BrushXY.js +5 -5
  417. package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
  418. package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
  419. package/lib-cjs/component/utility/Evaluate.js +2 -2
  420. package/lib-cjs/component/utility/FileUtility.js +11 -29
  421. package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
  422. package/lib-cjs/component/utility/PathBuilder.js +1 -1
  423. package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
  424. package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
  425. package/lib-cjs/component/utility/formatNumber.js +5 -4
  426. package/lib-cjs/component/workspaces/exercise.js +4 -4
  427. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
  428. package/lib-cjs/data/Filters.js +17 -35
  429. package/lib-cjs/data/FiltersManager.js +4 -3
  430. package/lib-cjs/data/PredictionManager.js +8 -10
  431. package/lib-cjs/data/SpectraManager.js +26 -62
  432. package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
  433. package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
  434. package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
  435. package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
  436. package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
  437. package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
  438. package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
  439. package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
  440. package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
  441. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
  442. package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
  443. package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
  444. package/lib-cjs/data/data1d/database.js +45 -28
  445. package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
  446. package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
  447. package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
  448. package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
  449. package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
  450. package/lib-cjs/data/data2d/Processing2D.js +10 -20
  451. package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
  452. package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
  453. package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
  454. package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
  455. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
  456. package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
  457. package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
  458. package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
  459. package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
  460. package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
  461. package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
  462. package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
  463. package/lib-cjs/data/utilities/generateChar.js +8 -6
  464. package/lib-cjs/data/utilities/getAtom.js +1 -1
  465. package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
  466. package/lib-cjs/data/utilities/getColor.js +3 -3
  467. package/lib-cjs/data/utilities/getSum.js +6 -3
  468. package/lib-cjs/versionInfo.js +1 -1
  469. package/package.json +36 -31
  470. package/lib/component/1d/IntegralResizable.js +0 -72
  471. package/lib/component/elements/popup/helpers.d.ts +0 -1
  472. package/lib/component/elements/popup/helpers.js +0 -9
  473. package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
  474. package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
  475. package/lib/data/data1d/Data1DManager.d.ts +0 -3
  476. package/lib/data/data1d/Data1DManager.js +0 -98
  477. package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
  478. package/lib/data/data1d/filter1d/absolute.js +0 -26
  479. package/lib/data/data2d/Data2DManager.d.ts +0 -3
  480. package/lib/data/data2d/Data2DManager.js +0 -34
  481. package/lib/data/types/data2d/Contour.d.ts +0 -4
  482. package/lib/data/types/data2d/Contour.js +0 -1
  483. package/lib/data/types/data2d/Contours.d.ts +0 -2
  484. package/lib/data/types/data2d/Contours.js +0 -1
  485. package/lib-cjs/component/1d/IntegralResizable.js +0 -77
  486. package/lib-cjs/component/elements/popup/helpers.js +0 -13
  487. package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
  488. package/lib-cjs/data/data1d/Data1DManager.js +0 -104
  489. package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
  490. package/lib-cjs/data/data2d/Data2DManager.js +0 -40
  491. package/lib-cjs/data/types/data2d/Contour.js +0 -2
  492. package/lib-cjs/data/types/data2d/Contours.js +0 -2
@@ -22,7 +22,7 @@ function FormikTextarea(props) {
22
22
  const isInvalid = (0, react_1.useMemo)(() => {
23
23
  return (0, get_1.default)(errors, name);
24
24
  }, [errors, name]);
25
- return ((0, jsx_runtime_1.jsx)("textarea", { ...{ name, className, placeholder }, value: value ? value : (0, get_1.default)(values, name), onChange: changeHandler, style: {
25
+ return ((0, jsx_runtime_1.jsx)("textarea", { ...{ name, className, placeholder }, value: value || (0, get_1.default)(values, name), onChange: changeHandler, style: {
26
26
  ...style,
27
27
  ...(isInvalid && {
28
28
  borderColor: 'red',
@@ -5,10 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_d3_utils_1 = require("react-d3-utils");
7
7
  const VerticalAxis = (0, react_1.forwardRef)((props, ref) => {
8
- const { x, y, height, showGrid, ticks } = props;
8
+ const { x, y, height, width, showGrid, ticks } = props;
9
9
  return ((0, jsx_runtime_1.jsxs)("g", { ref: ref, transform: `translate(${x}, ${y})`, children: [(0, jsx_runtime_1.jsx)("line", { y2: height, x1: 15, x2: 15, stroke: "black" }), ticks.map(({ label, position }, index) => (
10
10
  // eslint-disable-next-line react/no-array-index-key
11
- (0, jsx_runtime_1.jsxs)("g", { children: [showGrid && props.width && ((0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: props.width - x, stroke: "lightgray" })), (0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: 10, stroke: "black" }), (0, jsx_runtime_1.jsx)("text", { y: position, dominantBaseline: "middle", textAnchor: "end", children: label })] }, index + label + position)))] }));
11
+ (0, jsx_runtime_1.jsxs)("g", { children: [showGrid && width && ((0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: width - x, stroke: "lightgray" })), (0, jsx_runtime_1.jsx)("line", { y1: position, y2: position, x1: 15, x2: 10, stroke: "black" }), (0, jsx_runtime_1.jsx)("text", { y: position, dominantBaseline: "middle", textAnchor: "end", children: label })] }, index + label + position)))] }));
12
12
  });
13
13
  function LinearVerticalAxis(props) {
14
14
  const { scale, ...other } = props;
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const groupBy_1 = __importDefault(require("lodash/groupBy"));
7
8
  const react_1 = require("react");
8
9
  const react_dom_1 = require("react-dom");
9
10
  const fa_1 = require("react-icons/fa");
10
11
  const react_transition_group_1 = require("react-transition-group");
11
12
  const Transition_1 = __importDefault(require("../Transition"));
12
13
  const Wrapper_1 = __importDefault(require("../Wrapper"));
13
- const helpers_1 = require("../helpers");
14
14
  const options_1 = require("../options");
15
15
  const Context_1 = require("./Context");
16
16
  const ProgressIndicator_1 = __importDefault(require("./ProgressIndicator"));
@@ -23,14 +23,14 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
23
23
  const ref = root.current;
24
24
  const timersIdRef = timersId.current;
25
25
  if (wrapperRef) {
26
- wrapperRef.appendChild(ref);
26
+ wrapperRef.append(ref);
27
27
  }
28
28
  return () => {
29
- if (ref) {
30
- if (wrapperRef) {
31
- timersIdRef.forEach(clearTimeout);
32
- wrapperRef.removeChild(ref);
29
+ if (ref && wrapperRef) {
30
+ for (const id of timersIdRef) {
31
+ clearTimeout(id);
33
32
  }
33
+ ref.remove();
34
34
  }
35
35
  };
36
36
  }, [wrapperRef]);
@@ -45,7 +45,7 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
45
45
  });
46
46
  }, []);
47
47
  const show = (0, react_1.useCallback)((message = '', options = {}) => {
48
- const id = Math.random().toString(36).substring(2, 9);
48
+ const id = Math.random().toString(36).slice(2, 9);
49
49
  const alertOptions = {
50
50
  position: options.position || position,
51
51
  timeout,
@@ -101,7 +101,7 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = opti
101
101
  const closeHandler = (0, react_1.useCallback)((alert) => {
102
102
  remove(alert);
103
103
  }, [remove]);
104
- const alertsByPosition = (0, helpers_1.groupBy)(alerts, (alert) => alert.options.position);
104
+ const alertsByPosition = (0, groupBy_1.default)(alerts, (alert) => alert.options.position);
105
105
  const parentStyle = (0, react_1.useMemo)(() => {
106
106
  return wrapperRef
107
107
  ? wrapperRef.getBoundingClientRect()
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.transitions = exports.types = exports.positions = exports.useAlert = exports.AlertProvider = void 0;
7
- const options_1 = require("../options");
6
+ exports.AlertProvider = exports.useAlert = exports.transitions = exports.types = exports.positions = void 0;
7
+ var options_1 = require("../options");
8
8
  Object.defineProperty(exports, "positions", { enumerable: true, get: function () { return options_1.positions; } });
9
9
  Object.defineProperty(exports, "types", { enumerable: true, get: function () { return options_1.types; } });
10
10
  Object.defineProperty(exports, "transitions", { enumerable: true, get: function () { return options_1.transitions; } });
11
- const Context_1 = require("./Context");
11
+ var Context_1 = require("./Context");
12
12
  Object.defineProperty(exports, "useAlert", { enumerable: true, get: function () { return Context_1.useAlert; } });
13
- const Provider_1 = __importDefault(require("./Provider"));
14
- exports.AlertProvider = Provider_1.default;
13
+ var Provider_1 = require("./Provider");
14
+ Object.defineProperty(exports, "AlertProvider", { enumerable: true, get: function () { return __importDefault(Provider_1).default; } });
@@ -17,7 +17,9 @@ const ModalContent = ({ modal, onClose, onLayout }) => {
17
17
  }) }));
18
18
  });
19
19
  (0, react_1.useEffect)(() => {
20
- if (isFinite(height) && isFinite(width) && !contentSize.current) {
20
+ if (Number.isFinite(height) &&
21
+ Number.isFinite(width) &&
22
+ !contentSize.current) {
21
23
  contentSize.current = { width, height };
22
24
  onLayout({ modal, layout: { width, height } });
23
25
  }
@@ -36,13 +36,11 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
36
36
  root.current = document.createElement('div');
37
37
  const ref = root.current;
38
38
  if (wrapperRef) {
39
- wrapperRef.appendChild(ref);
39
+ wrapperRef.append(ref);
40
40
  }
41
41
  return () => {
42
- if (ref) {
43
- if (wrapperRef) {
44
- wrapperRef.removeChild(ref);
45
- }
42
+ if (ref && wrapperRef) {
43
+ ref.remove();
46
44
  }
47
45
  };
48
46
  }, [wrapperRef]);
@@ -82,10 +80,11 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
82
80
  * @param {Array<{ handler: Function,text: string,style: object}>} dialogOptions.buttons
83
81
  * @param {object} dialogOptions.tyle
84
82
  */
85
- const showConfirmDialog = (0, react_2.useCallback)((dialogOptions, options = { enableResizing: false }) => {
83
+ const showConfirmDialog = (0, react_2.useCallback)((dialogOptions, options = {}) => {
84
+ const { enableResizing = false, ...otherOptions } = options;
86
85
  const _modal = {
87
86
  component: (0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, { ...dialogOptions }),
88
- options: { isBackgroundBlur: true, ...options },
87
+ options: { isBackgroundBlur: true, enableResizing, ...otherOptions },
89
88
  };
90
89
  _modal.close = close;
91
90
  setModal(_modal);
@@ -126,28 +125,20 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
126
125
  : { pointerEvents: 'none' };
127
126
  const modalContextValue = (0, react_2.useMemo)(() => ({ show, close, showConfirmDialog }), [show, close, showConfirmDialog]);
128
127
  const contentLayoutHandler = (0, react_2.useCallback)(({ modal, layout }) => {
129
- const width = modal.options.width
130
- ? modal.options.width
131
- : layout.width > parentStyle.width
132
- ? parentStyle.width
133
- : layout.width;
134
- const height = modal.options.height
135
- ? modal.options.height
136
- : layout.height > parentStyle.height
128
+ const width = modal.options.width ||
129
+ (layout.width > parentStyle.width ? parentStyle.width : layout.width);
130
+ const height = modal.options.height ||
131
+ (layout.height > parentStyle.height
137
132
  ? parentStyle.height
138
- : layout.height;
133
+ : layout.height);
139
134
  modalRef.current.updateSize({ width, height });
140
135
  }, [parentStyle.height, parentStyle.width]);
141
136
  return ((0, jsx_runtime_1.jsxs)(Context_1.ModalProvider, { value: modalContextValue, children: [children, root.current &&
142
137
  (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(react_2.Fragment, { children: modal ? ((0, jsx_runtime_1.jsx)("div", { css: styles, style: {
143
138
  ...outerStyle,
144
139
  }, children: (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { appear: true, options: {
145
- position: modal.options.position
146
- ? modal.options.position
147
- : position,
148
- }, containerStyle: parentStyle, component: Wrapper_1.default, children: (0, jsx_runtime_1.jsx)(Transition_1.default, { type: modal.options.transition
149
- ? modal.options.transition
150
- : transition, transitionStyles: {
140
+ position: modal.options.position || position,
141
+ }, containerStyle: parentStyle, component: Wrapper_1.default, children: (0, jsx_runtime_1.jsx)(Transition_1.default, { type: modal.options.transition || transition, transitionStyles: {
151
142
  ...transitionStyles,
152
143
  default: {
153
144
  width: modal.options.width
@@ -158,12 +149,8 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
158
149
  ? `${modal.options.height}px`
159
150
  : 'auto',
160
151
  }, children: (0, jsx_runtime_1.jsx)(react_rnd_1.Rnd, { maxWidth: parentStyle.width, maxHeight: parentStyle.height, ref: modalRef, default: {
161
- width: modal.options.width
162
- ? modal.options.width
163
- : 'auto',
164
- height: modal.options.height
165
- ? modal.options.height
166
- : 'auto',
152
+ width: modal.options.width || 'auto',
153
+ height: modal.options.height || 'auto',
167
154
  x: 0,
168
155
  y: 0,
169
156
  }, className: "rnd-container", style: {
@@ -172,8 +159,6 @@ function Provider({ children, style, offset = '0px', position = options_1.positi
172
159
  position: 'static',
173
160
  pointerEvents: 'all',
174
161
  userSelect: 'none',
175
- }, enableResizing: modal.options.enableResizing, dragHandleClassName: "handle", enableUserSelectHack: false, children: (0, jsx_runtime_1.jsx)(ModalContent_1.default, { modal: modal, onClose: close, onLayout: contentLayoutHandler }) }) }, modal.id) }, options_1.positions[modal.options.transition
176
- ? modal.options.transition
177
- : transition]) })) : null }), root.current)] }));
162
+ }, enableResizing: modal.options.enableResizing, dragHandleClassName: "handle", enableUserSelectHack: false, children: (0, jsx_runtime_1.jsx)(ModalContent_1.default, { modal: modal, onClose: close, onLayout: contentLayoutHandler }) }) }, modal.id) }, options_1.positions[modal.options.transition || transition]) })) : null }), root.current)] }));
178
163
  }
179
164
  exports.default = Provider;
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.transitions = exports.positions = exports.useModal = exports.ModalProvider = exports.Modal = void 0;
7
- const options_1 = require("../options");
6
+ exports.ModalProvider = exports.Modal = exports.useModal = exports.transitions = exports.positions = void 0;
7
+ var options_1 = require("../options");
8
8
  Object.defineProperty(exports, "positions", { enumerable: true, get: function () { return options_1.positions; } });
9
9
  Object.defineProperty(exports, "transitions", { enumerable: true, get: function () { return options_1.transitions; } });
10
- const Context_1 = require("./Context");
10
+ var Context_1 = require("./Context");
11
11
  Object.defineProperty(exports, "useModal", { enumerable: true, get: function () { return Context_1.useModal; } });
12
- const Modal_1 = __importDefault(require("./Modal"));
13
- exports.Modal = Modal_1.default;
14
- const Provider_1 = __importDefault(require("./Provider"));
15
- exports.ModalProvider = Provider_1.default;
12
+ var Modal_1 = require("./Modal");
13
+ Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return __importDefault(Modal_1).default; } });
14
+ var Provider_1 = require("./Provider");
15
+ Object.defineProperty(exports, "ModalProvider", { enumerable: true, get: function () { return __importDefault(Provider_1).default; } });
@@ -51,7 +51,7 @@ function HeaderInner(props) {
51
51
  }, [selectedOptionPanel]);
52
52
  const openGeneralSettingsHandler = (0, react_1.useCallback)(() => {
53
53
  modal.show((0, jsx_runtime_1.jsx)(GeneralSettings_1.default, {}), {
54
- position: Modal_1.positions.TOP_CENTER,
54
+ position: Modal_1.positions.MIDDLE,
55
55
  enableResizing: true,
56
56
  width: 600,
57
57
  height: 400,
@@ -14,7 +14,7 @@ function useActiveSpectrumStyleOptions(id) {
14
14
  const isActive = activeSpectrum === null ? true : id === activeSpectrum.id;
15
15
  const opacity = isActive
16
16
  ? 1
17
- : (0, get_1.default)(preferences.current, 'general.dimmedSpectraTransparency', 0.1);
17
+ : (0, get_1.default)(preferences.current, 'general.dimmedSpectraOpacity', 0.1);
18
18
  return { isActive, opacity };
19
19
  }, [activeSpectrum, id, preferences]);
20
20
  }
@@ -4,7 +4,7 @@ const react_1 = require("react");
4
4
  function useCombinedRefs(refs) {
5
5
  const targetRef = (0, react_1.useRef)();
6
6
  (0, react_1.useEffect)(() => {
7
- refs.forEach((ref) => {
7
+ for (const ref of refs) {
8
8
  if (!ref)
9
9
  return;
10
10
  if (typeof ref === 'function') {
@@ -13,7 +13,7 @@ function useCombinedRefs(refs) {
13
13
  else {
14
14
  ref.current = targetRef.current;
15
15
  }
16
- });
16
+ }
17
17
  }, [refs]);
18
18
  return targetRef;
19
19
  }
@@ -11,7 +11,7 @@ const GlobalContext_1 = require("../context/GlobalContext");
11
11
  const Alert_1 = require("../elements/popup/Alert");
12
12
  const Modal_1 = require("../elements/popup/Modal");
13
13
  const SaveAsModal_1 = __importDefault(require("../modal/SaveAsModal"));
14
- const Export_1 = require("../utility/Export");
14
+ const export_1 = require("../utility/export");
15
15
  function useExport() {
16
16
  const { rootRef } = (0, GlobalContext_1.useGlobal)();
17
17
  const modal = (0, Modal_1.useModal)();
@@ -21,25 +21,28 @@ function useExport() {
21
21
  if (state.data.length > 0 && rootRef) {
22
22
  const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
23
23
  setTimeout(() => {
24
- (0, Export_1.copyPNGToClipboard)(rootRef, 'nmrSVG');
24
+ (0, export_1.copyPNGToClipboard)(rootRef, 'nmrSVG');
25
25
  hideLoading();
26
26
  alert.success('Image copied to clipboard');
27
27
  }, 0);
28
28
  }
29
29
  }, [rootRef, alert, state]);
30
- const saveAsJSONHandler = (0, react_1.useCallback)(async (spaceIndent = 0, isCompressed = true) => {
30
+ const saveAsJSONHandler = (0, react_1.useCallback)((spaceIndent = 0, isCompressed = true) => {
31
31
  if (state.data.length > 0) {
32
- const hideLoading = await alert.showLoading('Exporting as NMRium process in progress');
33
- setTimeout(() => {
32
+ alert
33
+ .showLoading('Exporting as NMRium process in progress')
34
+ .then((hideLoading) => {
34
35
  async function handle() {
35
36
  //exported file name by default will be the first spectrum name
36
37
  const fileName = state.data[0]?.display?.name;
37
38
  const exportedData = (0, SpectraManager_1.toJSON)(state, 'nmrium');
38
- await (0, Export_1.exportAsJSON)(exportedData, fileName, spaceIndent, isCompressed);
39
+ await (0, export_1.exportAsJSON)(exportedData, fileName, spaceIndent, isCompressed);
39
40
  hideLoading();
40
41
  }
41
- void handle();
42
- }, 0);
42
+ setTimeout(() => {
43
+ void handle();
44
+ }, 0);
45
+ });
43
46
  }
44
47
  }, [alert, state]);
45
48
  const saveAsSVGHandler = (0, react_1.useCallback)(async () => {
@@ -47,7 +50,7 @@ function useExport() {
47
50
  const hideLoading = await alert.showLoading('Exporting as SVG process in progress');
48
51
  setTimeout(() => {
49
52
  const fileName = state.data[0]?.display?.name;
50
- (0, Export_1.exportAsSVG)(rootRef, 'nmrSVG', fileName);
53
+ (0, export_1.exportAsSVG)(rootRef, 'nmrSVG', fileName);
51
54
  hideLoading();
52
55
  }, 0);
53
56
  }
@@ -57,7 +60,7 @@ function useExport() {
57
60
  const hideLoading = await alert.showLoading('Exporting as PNG process in progress');
58
61
  setTimeout(() => {
59
62
  const fileName = state.data[0]?.display?.name;
60
- (0, Export_1.exportAsPng)(rootRef, 'nmrSVG', fileName);
63
+ (0, export_1.exportAsPng)(rootRef, 'nmrSVG', fileName);
61
64
  hideLoading();
62
65
  }, 0);
63
66
  }
@@ -70,7 +73,7 @@ function useExport() {
70
73
  void (async () => {
71
74
  const exportedData = (0, SpectraManager_1.toJSON)(state, 'nmrium', dataExportOption);
72
75
  const spaceIndent = pretty ? 2 : 0;
73
- await (0, Export_1.exportAsJSON)(exportedData, name, spaceIndent, compressed);
76
+ await (0, export_1.exportAsJSON)(exportedData, name, spaceIndent, compressed);
74
77
  hideLoading();
75
78
  })();
76
79
  }, 0);
@@ -31,7 +31,7 @@ function useFormatNumberByNucleus(nucleus) {
31
31
  return nucleus.map((n) => formatFun(n));
32
32
  }
33
33
  else {
34
- throw Error('nuclus must be string or array of string');
34
+ throw new Error('nuclus must be string or array of string');
35
35
  }
36
36
  }, [nucleus, nucleusByKey]);
37
37
  }
@@ -51,12 +51,14 @@ function usePanelPreferencesByNuclei(panelKey, nuclei) {
51
51
  const { current } = (0, PreferencesContext_1.usePreferences)();
52
52
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
53
53
  const { nuclei: omitNuclei = null, ...restPreferences } = getPanelPreferences(current, panelKey);
54
- return (0, react_1.useMemo)(() => ({
55
- nuclei: nuclei.reduce((acc, nucleusLabel) => {
56
- acc[nucleusLabel] = getPanelPreferences(current, panelKey, nucleusLabel, true);
57
- return acc;
58
- }, {}),
59
- ...restPreferences,
60
- }), [current, nuclei, panelKey, restPreferences]);
54
+ return (0, react_1.useMemo)(() => {
55
+ return {
56
+ nuclei: Object.fromEntries(nuclei.map((nucleusLabel) => [
57
+ nucleusLabel,
58
+ getPanelPreferences(current, panelKey, nucleusLabel, true),
59
+ ])),
60
+ ...restPreferences,
61
+ };
62
+ }, [current, nuclei, panelKey, restPreferences]);
61
63
  }
62
64
  exports.usePanelPreferencesByNuclei = usePanelPreferencesByNuclei;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
4
4
  /** @jsxImportSource @emotion/react */
5
5
  const react_1 = require("@emotion/react");
6
+ const filelist_utils_1 = require("filelist-utils");
6
7
  const react_2 = require("react");
7
8
  const react_dropzone_1 = require("react-dropzone");
8
9
  const fa_1 = require("react-icons/fa");
@@ -47,10 +48,17 @@ function DropZone(props) {
47
48
  const dispatch = (0, DispatchContext_1.useDispatch)();
48
49
  const isToolEnabled = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
49
50
  const loadFilesHandler = (0, react_2.useCallback)((files) => {
50
- files.forEach((file) => {
51
+ for (const file of files) {
51
52
  Object.defineProperty(file, 'webkitRelativePath', { value: file.path });
53
+ }
54
+ (0, filelist_utils_1.fileCollectionFromFileList)(files)
55
+ .then((fileCollection) => {
56
+ dispatch({ type: Types_1.LOAD_DROP_FILES, fileCollection });
57
+ })
58
+ .catch((error) => {
59
+ dispatch({ type: Types_1.SET_LOADING_FLAG, isLoading: false });
60
+ reportError(error);
52
61
  });
53
- dispatch({ type: Types_1.LOAD_DROP_FILES, files });
54
62
  }, [dispatch]);
55
63
  const onDrop = (0, react_2.useCallback)((droppedFiles) => {
56
64
  dispatch({ type: Types_1.SET_LOADING_FLAG, isLoading: true });
@@ -26,7 +26,7 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
26
26
  ? Object.entries(References_1.REFERENCES[nucleus]).map((item) => ({
27
27
  value: item[0],
28
28
  label: item[0],
29
- }), [])
29
+ }))
30
30
  : [];
31
31
  return baseList.concat(list);
32
32
  }, [nucleus]);
@@ -13,7 +13,7 @@ const Label_1 = __importDefault(require("../elements/Label"));
13
13
  const FormikForm_1 = __importDefault(require("../elements/formik/FormikForm"));
14
14
  const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
15
15
  const Events_1 = __importDefault(require("../utility/Events"));
16
- const Export_1 = require("../utility/Export");
16
+ const export_1 = require("../utility/export");
17
17
  const ModalStyle_1 = require("./ModalStyle");
18
18
  const INITIAL_VALUE = { from: -1, to: 1, nbPoints: 1024 };
19
19
  function ExportAsMatrixModal({ onClose = () => null, }) {
@@ -23,7 +23,7 @@ function ExportAsMatrixModal({ onClose = () => null, }) {
23
23
  refForm.current.submitForm();
24
24
  }, []);
25
25
  const submitHandler = (0, react_1.useCallback)((options) => {
26
- (0, Export_1.exportAsMatrix)(data, options, 'fileName');
26
+ (0, export_1.exportAsMatrix)(data, options, 'fileName');
27
27
  onClose();
28
28
  }, [data, onClose]);
29
29
  (0, react_1.useEffect)(() => {
@@ -57,13 +57,13 @@ const styles = (0, react_1.css) `
57
57
  }
58
58
  }
59
59
  `;
60
- const allowedExtensions = ['dx', 'jdx'];
60
+ const allowedExtensions = new Set(['dx', 'jdx']);
61
61
  function LoadJCAMPModal({ onLoadClick, onClose, startLoading, }) {
62
62
  const pathReft = (0, react_2.useRef)();
63
63
  const loadJCAMPHandler = (0, react_2.useCallback)(() => {
64
64
  const path = pathReft.current.value;
65
65
  const { name, extension } = (0, FileUtility_1.extractFileMetaFromPath)(path);
66
- if (allowedExtensions.includes(extension)) {
66
+ if (allowedExtensions.has(extension)) {
67
67
  startLoading?.();
68
68
  void (0, FileUtility_1.loadFile)(path, { asBuffer: true }).then((data) => {
69
69
  const file = {
@@ -97,7 +97,7 @@ function MultipleSpectraFiltersModal({ onClose = () => null, nucleus = '', }) {
97
97
  ? Object.entries(References_1.REFERENCES[nucleus]).map((item) => ({
98
98
  value: item[0],
99
99
  label: item[0],
100
- }), [])
100
+ }))
101
101
  : [];
102
102
  return baseList.concat(list);
103
103
  }, [nucleus]);
@@ -132,9 +132,9 @@ function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, on
132
132
  setCalcFinished(true);
133
133
  setAnalysisData(result);
134
134
  }
135
- catch (err) {
136
- // eslint-disable-next-line no-console
137
- console.log(err);
135
+ catch (error) {
136
+ // TODO: handle error
137
+ reportError(error);
138
138
  }
139
139
  }
140
140
  }, [startX, endX, data, scaleX, activeSpectrum, calcStart]);
@@ -165,13 +165,13 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
165
165
  isLoading: true,
166
166
  });
167
167
  const predictedSpectra = Object.entries(values.spectra)
168
- .reduce((acc, [key, value]) => {
168
+ .map(([key, value]) => {
169
169
  if (value) {
170
- acc.push(key);
170
+ return key;
171
171
  }
172
- return acc;
173
- }, [])
174
- .join(' , ');
172
+ return undefined;
173
+ })
174
+ .join(',');
175
175
  const hideLoading = await alert.showLoading(`Predict ${predictedSpectra} in progress`);
176
176
  dispatch({
177
177
  type: Types_1.PREDICT_SPECTRA,
@@ -100,19 +100,19 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
100
100
  let counterJ = 0;
101
101
  const couplings = [];
102
102
  if (signal.multiplicity) {
103
- signal.multiplicity.split('').forEach((_multiplicity) => {
103
+ for (const multiplicity of signal.multiplicity.split('')) {
104
104
  let js = {
105
- multiplicity: _multiplicity,
105
+ multiplicity,
106
106
  coupling: '',
107
107
  };
108
- if ((0, MultiplicityUtilities_1.hasCouplingConstant)(_multiplicity) && signal?.js) {
108
+ if ((0, MultiplicityUtilities_1.hasCouplingConstant)(multiplicity) && signal?.js) {
109
109
  js = { ...signal.js[counterJ] };
110
110
  js.coupling = Number((0, formatNumber_1.formatNumber)(js.coupling, rangesPreferences.coupling.format));
111
111
  counterJ++;
112
112
  }
113
113
  js.multiplicity = (0, MultiplicityUtilities_1.translateMultiplet)(js.multiplicity || '');
114
114
  couplings.push(js);
115
- });
115
+ }
116
116
  }
117
117
  return { ...signal, js: couplings };
118
118
  });
@@ -21,7 +21,7 @@ const styles = {
21
21
  color: 'red',
22
22
  },
23
23
  };
24
- const EDIT_SIGNAL_INFO_TEXT = `Focus on an input field and press Shift + Drag &#38; Drop to draw a coupling constant in spectrum view.`;
24
+ const EDIT_SIGNAL_INFO_TEXT = `Focus on an input field and press Shift + Drag and Drop to draw a coupling constant in spectrum view.`;
25
25
  const ADD_SIGNAL_INFO_TEXT = `Focus on the input field and press Shift + Left mouse click to select new signal delta value in spectrum view.`;
26
26
  const InfoText = (props) => {
27
27
  const { value, type = 'info' } = props;
@@ -36,8 +36,8 @@ const useValidation = () => (0, react_1.useMemo)(() => {
36
36
  coupling: Yup.mixed().test('checkValue', '', function testCoupling(value) {
37
37
  const { path, createError } = this;
38
38
  const hasCoupling = (0, MultiplicityUtilities_1.hasCouplingConstant)(this.parent.multiplicity);
39
- if ((!hasCoupling && isNaN(value)) ||
40
- (hasCoupling && !isNaN(value))) {
39
+ if ((!hasCoupling && Number.isNaN(Number(value))) ||
40
+ (hasCoupling && !Number.isNaN(Number(value)))) {
41
41
  return true;
42
42
  }
43
43
  return createError({