nmrium 1.12.0 → 2.0.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 (309) hide show
  1. package/lib/component/1d/database/DatabaseSpectrum.d.ts.map +1 -1
  2. package/lib/component/1d/database/DatabaseSpectrum.js +1 -1
  3. package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
  4. package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts.map +1 -1
  5. package/lib/component/1d-2d/components/SpectrumInfoBlock.js +3 -17
  6. package/lib/component/1d-2d/components/SpectrumInfoBlock.js.map +1 -1
  7. package/lib/component/2d/ft/Contours.d.ts.map +1 -1
  8. package/lib/component/2d/ft/Contours.js +10 -12
  9. package/lib/component/2d/ft/Contours.js.map +1 -1
  10. package/lib/component/elements/ActionsButtonsPopover.js +1 -1
  11. package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
  12. package/lib/component/hooks/reduce2DSpectrum.d.ts +4 -0
  13. package/lib/component/hooks/reduce2DSpectrum.d.ts.map +1 -0
  14. package/lib/component/hooks/reduce2DSpectrum.js +60 -0
  15. package/lib/component/hooks/reduce2DSpectrum.js.map +1 -0
  16. package/lib/component/hooks/use2DReducer.d.ts +14 -0
  17. package/lib/component/hooks/use2DReducer.d.ts.map +1 -0
  18. package/lib/component/hooks/use2DReducer.js +30 -0
  19. package/lib/component/hooks/use2DReducer.js.map +1 -0
  20. package/lib/component/hooks/useCreateNmriumZip.d.ts +3 -0
  21. package/lib/component/hooks/useCreateNmriumZip.d.ts.map +1 -0
  22. package/lib/component/hooks/useCreateNmriumZip.js +28 -0
  23. package/lib/component/hooks/useCreateNmriumZip.js.map +1 -0
  24. package/lib/component/hooks/useExport.d.ts +8 -5
  25. package/lib/component/hooks/useExport.d.ts.map +1 -1
  26. package/lib/component/hooks/useExport.js +4 -21
  27. package/lib/component/hooks/useExport.js.map +1 -1
  28. package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
  29. package/lib/component/loader/useLoadFiles.js +4 -5
  30. package/lib/component/loader/useLoadFiles.js.map +1 -1
  31. package/lib/component/main/InnerNMRium.d.ts.map +1 -1
  32. package/lib/component/main/InnerNMRium.js +2 -2
  33. package/lib/component/main/InnerNMRium.js.map +1 -1
  34. package/lib/component/main/NMRium.d.ts +48 -3
  35. package/lib/component/main/NMRium.d.ts.map +1 -1
  36. package/lib/component/main/NMRium.js.map +1 -1
  37. package/lib/component/main/NMRiumRefAPI.d.ts +2 -0
  38. package/lib/component/main/NMRiumRefAPI.d.ts.map +1 -1
  39. package/lib/component/main/NMRiumRefAPI.js +4 -1
  40. package/lib/component/main/NMRiumRefAPI.js.map +1 -1
  41. package/lib/component/main/NMRiumStateProvider.d.ts +5 -2
  42. package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
  43. package/lib/component/main/NMRiumStateProvider.js +36 -30
  44. package/lib/component/main/NMRiumStateProvider.js.map +1 -1
  45. package/lib/component/modal/LoadJCAMPModal.js +4 -4
  46. package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
  47. package/lib/component/modal/setting/general_settings.d.ts.map +1 -1
  48. package/lib/component/modal/setting/general_settings.js +3 -3
  49. package/lib/component/modal/setting/general_settings.js.map +1 -1
  50. package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts +4 -2
  51. package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -1
  52. package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +46 -29
  53. package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
  54. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +920 -188
  55. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -1
  56. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js +10 -2
  57. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js.map +1 -1
  58. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +920 -188
  59. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -1
  60. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +1353 -6
  61. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -1
  62. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js +43 -32
  63. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js.map +1 -1
  64. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts +1353 -6
  65. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts.map +1 -1
  66. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js +88 -83
  67. package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js.map +1 -1
  68. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +466 -0
  69. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts.map +1 -0
  70. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.js +59 -0
  71. package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.js.map +1 -0
  72. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +1354 -0
  73. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts.map +1 -0
  74. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js +32 -0
  75. package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js.map +1 -0
  76. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +1354 -0
  77. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts.map +1 -0
  78. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.js +80 -0
  79. package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.js.map +1 -0
  80. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +920 -188
  81. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -1
  82. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts.map +1 -1
  83. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +37 -9
  84. package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -1
  85. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +1354 -0
  86. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts.map +1 -0
  87. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.js +58 -0
  88. package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.js.map +1 -0
  89. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +920 -188
  90. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -1
  91. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js +1 -1
  92. package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js.map +1 -1
  93. package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +920 -188
  94. package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -1
  95. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +920 -188
  96. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -1
  97. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js +65 -112
  98. package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js.map +1 -1
  99. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +920 -188
  100. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -1
  101. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js +3 -3
  102. package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js.map +1 -1
  103. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +1354 -0
  104. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts.map +1 -0
  105. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.js +142 -0
  106. package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.js.map +1 -0
  107. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +1354 -0
  108. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -0
  109. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js +112 -0
  110. package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js.map +1 -0
  111. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +1354 -0
  112. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts.map +1 -0
  113. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js +38 -0
  114. package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js.map +1 -0
  115. package/lib/component/modal/setting/tanstack_general_settings/ui/table.d.ts +68 -0
  116. package/lib/component/modal/setting/tanstack_general_settings/ui/table.d.ts.map +1 -0
  117. package/lib/component/modal/setting/tanstack_general_settings/ui/table.js +133 -0
  118. package/lib/component/modal/setting/tanstack_general_settings/ui/table.js.map +1 -0
  119. package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.d.ts +10 -0
  120. package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.d.ts.map +1 -0
  121. package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.js +31 -0
  122. package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.js.map +1 -0
  123. package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.d.ts +71 -0
  124. package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.d.ts.map +1 -0
  125. package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.js +67 -0
  126. package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.js.map +1 -0
  127. package/lib/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.d.ts → validation/check_unique_by_key.d.ts} +1 -1
  128. package/lib/component/modal/setting/tanstack_general_settings/validation/check_unique_by_key.d.ts.map +1 -0
  129. package/lib/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.js → validation/check_unique_by_key.js} +1 -1
  130. package/lib/component/modal/setting/tanstack_general_settings/validation/check_unique_by_key.js.map +1 -0
  131. package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.d.ts +11 -0
  132. package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.d.ts.map +1 -0
  133. package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.js +20 -0
  134. package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.js.map +1 -0
  135. package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.d.ts +32 -0
  136. package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.d.ts.map +1 -0
  137. package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.js +11 -0
  138. package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.js.map +1 -0
  139. package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts +2 -0
  140. package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts.map +1 -1
  141. package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js +3 -6
  142. package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js.map +1 -1
  143. package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts +12 -4
  144. package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts.map +1 -1
  145. package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js +4 -3
  146. package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js.map +1 -1
  147. package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts +20 -0
  148. package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts.map +1 -1
  149. package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js +12 -4
  150. package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js.map +1 -1
  151. package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.d.ts +54 -0
  152. package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.d.ts.map +1 -0
  153. package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.js +22 -0
  154. package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.js.map +1 -0
  155. package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.d.ts +55 -0
  156. package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.d.ts.map +1 -0
  157. package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.js +18 -0
  158. package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.js.map +1 -0
  159. package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts +32 -0
  160. package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts.map +1 -0
  161. package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js +34 -0
  162. package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js.map +1 -0
  163. package/lib/component/modal/setting/tanstack_general_settings/validation/utils.d.ts +13 -0
  164. package/lib/component/modal/setting/tanstack_general_settings/validation/utils.d.ts.map +1 -0
  165. package/lib/component/modal/setting/tanstack_general_settings/validation/utils.js +20 -0
  166. package/lib/component/modal/setting/tanstack_general_settings/validation/utils.js.map +1 -0
  167. package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +255 -39
  168. package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts.map +1 -1
  169. package/lib/component/modal/setting/tanstack_general_settings/validation.js +16 -27
  170. package/lib/component/modal/setting/tanstack_general_settings/validation.js.map +1 -1
  171. package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -1
  172. package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +27 -0
  173. package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -1
  174. package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.d.ts.map +1 -1
  175. package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js +3 -2
  176. package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js.map +1 -1
  177. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.d.ts +2 -1
  178. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.d.ts.map +1 -1
  179. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js +8 -3
  180. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js.map +1 -1
  181. package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js +1 -1
  182. package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js.map +1 -1
  183. package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
  184. package/lib/component/panels/databasePanel/DatabasePanel.js +2 -2
  185. package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
  186. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts.map +1 -1
  187. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +26 -33
  188. package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
  189. package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
  190. package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
  191. package/lib/component/reducer/Reducer.d.ts.map +1 -1
  192. package/lib/component/reducer/Reducer.js +1 -3
  193. package/lib/component/reducer/Reducer.js.map +1 -1
  194. package/lib/component/reducer/actions/FiltersActions.d.ts +2 -4
  195. package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
  196. package/lib/component/reducer/actions/FiltersActions.js +14 -5
  197. package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
  198. package/lib/component/reducer/actions/LoadAction.d.ts +1 -4
  199. package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
  200. package/lib/component/reducer/actions/LoadAction.js +8 -17
  201. package/lib/component/reducer/actions/LoadAction.js.map +1 -1
  202. package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
  203. package/lib/component/reducer/actions/MoleculeActions.js +3 -0
  204. package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
  205. package/lib/component/reducer/actions/SpectraActions.d.ts +5 -1
  206. package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
  207. package/lib/component/reducer/actions/SpectraActions.js +4 -2
  208. package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
  209. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  210. package/lib/component/reducer/actions/ToolsActions.js +1 -1
  211. package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
  212. package/lib/component/reducer/preferences/actions/applyGeneralPreferences.d.ts.map +1 -1
  213. package/lib/component/reducer/preferences/actions/applyGeneralPreferences.js.map +1 -1
  214. package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
  215. package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
  216. package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
  217. package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
  218. package/lib/component/workspaces/workspaceDefaultProperties.js +9 -0
  219. package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
  220. package/lib/data/PredictionManager.d.ts.map +1 -1
  221. package/lib/data/PredictionManager.js +3 -0
  222. package/lib/data/PredictionManager.js.map +1 -1
  223. package/lib/data/data2d/Spectrum2D/contours.d.ts +7 -6
  224. package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
  225. package/lib/data/data2d/Spectrum2D/contours.js +22 -6
  226. package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
  227. package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
  228. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -10
  229. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
  230. package/lib/data/molecules/Molecule.d.ts +5 -1
  231. package/lib/data/molecules/Molecule.d.ts.map +1 -1
  232. package/lib/data/molecules/Molecule.js +9 -7
  233. package/lib/data/molecules/Molecule.js.map +1 -1
  234. package/lib/data/molecules/MoleculeManager.d.ts +0 -6
  235. package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
  236. package/lib/data/molecules/MoleculeManager.js +25 -25
  237. package/lib/data/molecules/MoleculeManager.js.map +1 -1
  238. package/lib/versionInfo.d.ts.map +1 -1
  239. package/lib/versionInfo.js +1 -1
  240. package/lib/versionInfo.js.map +1 -1
  241. package/package.json +30 -29
  242. package/src/component/1d/database/DatabaseSpectrum.tsx +3 -1
  243. package/src/component/1d-2d/components/SpectrumInfoBlock.tsx +10 -22
  244. package/src/component/2d/ft/Contours.tsx +14 -27
  245. package/src/component/elements/ActionsButtonsPopover.tsx +1 -1
  246. package/src/component/hooks/reduce2DSpectrum.ts +98 -0
  247. package/src/component/hooks/use2DReducer.tsx +56 -0
  248. package/src/component/hooks/useCreateNmriumZip.ts +37 -0
  249. package/src/component/hooks/useExport.tsx +16 -31
  250. package/src/component/loader/useLoadFiles.ts +6 -10
  251. package/src/component/main/InnerNMRium.tsx +4 -2
  252. package/src/component/main/NMRium.tsx +50 -2
  253. package/src/component/main/NMRiumRefAPI.ts +7 -1
  254. package/src/component/main/NMRiumStateProvider.tsx +57 -35
  255. package/src/component/modal/LoadJCAMPModal.tsx +4 -4
  256. package/src/component/modal/setting/general_settings.tsx +4 -3
  257. package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +80 -54
  258. package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +48 -1
  259. package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.tsx +75 -68
  260. package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.tsx +165 -184
  261. package/src/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.ts +95 -0
  262. package/src/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.tsx +81 -0
  263. package/src/component/modal/setting/tanstack_general_settings/tabs/database_tab.tsx +210 -0
  264. package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +48 -8
  265. package/src/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.tsx +150 -0
  266. package/src/component/modal/setting/tanstack_general_settings/tabs/general_tab.tsx +3 -3
  267. package/src/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.tsx +164 -233
  268. package/src/component/modal/setting/tanstack_general_settings/tabs/panels_tab.tsx +10 -10
  269. package/src/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.tsx +352 -0
  270. package/src/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.tsx +248 -0
  271. package/src/component/modal/setting/tanstack_general_settings/tabs/tools_tab.tsx +155 -0
  272. package/src/component/modal/setting/tanstack_general_settings/ui/table.tsx +163 -0
  273. package/src/component/modal/setting/tanstack_general_settings/ui/table_section.tsx +52 -0
  274. package/src/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.ts +73 -0
  275. package/src/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.ts +23 -0
  276. package/src/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.ts +12 -0
  277. package/src/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.ts +4 -6
  278. package/src/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.ts +11 -8
  279. package/src/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.ts +17 -9
  280. package/src/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.ts +29 -0
  281. package/src/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.ts +26 -0
  282. package/src/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.ts +34 -0
  283. package/src/component/modal/setting/tanstack_general_settings/validation/utils.ts +30 -0
  284. package/src/component/modal/setting/tanstack_general_settings/validation.ts +16 -31
  285. package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +35 -0
  286. package/src/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.tsx +3 -2
  287. package/src/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.tsx +12 -4
  288. package/src/component/panels/SpectraPanel/base/setting/SpectrumSetting.tsx +1 -1
  289. package/src/component/panels/databasePanel/DatabasePanel.tsx +6 -4
  290. package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +34 -49
  291. package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -1
  292. package/src/component/reducer/Reducer.ts +1 -3
  293. package/src/component/reducer/actions/FiltersActions.ts +16 -10
  294. package/src/component/reducer/actions/LoadAction.ts +12 -27
  295. package/src/component/reducer/actions/MoleculeActions.ts +3 -0
  296. package/src/component/reducer/actions/SpectraActions.ts +14 -6
  297. package/src/component/reducer/actions/ToolsActions.ts +3 -1
  298. package/src/component/reducer/preferences/actions/applyGeneralPreferences.ts +1 -2
  299. package/src/component/reducer/preferences/preferencesReducer.ts +4 -4
  300. package/src/component/workspaces/workspaceDefaultProperties.ts +9 -0
  301. package/src/data/PredictionManager.ts +3 -0
  302. package/src/data/data2d/Spectrum2D/contours.ts +28 -12
  303. package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +1 -17
  304. package/src/data/molecules/Molecule.ts +17 -7
  305. package/src/data/molecules/MoleculeManager.ts +31 -29
  306. package/src/versionInfo.ts +1 -1
  307. package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.d.ts.map +0 -1
  308. package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.js.map +0 -1
  309. /package/src/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.ts → validation/check_unique_by_key.ts} +0 -0
@@ -1,261 +1,192 @@
1
- import { Classes, NumericInput } from '@blueprintjs/core';
2
- import styled from '@emotion/styled';
3
- import { useStore } from '@tanstack/react-form';
1
+ import { Classes } from '@blueprintjs/core';
2
+ import { useField } from '@tanstack/react-form';
4
3
  import { useCallback, useMemo } from 'react';
5
4
  import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
6
- import { Button, withForm } from 'react-science/ui';
7
- import type { CellProps } from 'react-table';
5
+ import { Button, createTableColumnHelper, withForm } from 'react-science/ui';
6
+ import type { z } from 'zod';
8
7
 
9
- import { GroupPane } from '../../../../elements/GroupPane.js';
10
- import { Input2 } from '../../../../elements/Input2.js';
11
- import type { Column } from '../../../../elements/ReactTable/ReactTable.js';
12
- import ReactTable from '../../../../elements/ReactTable/ReactTable.js';
13
- import { Section } from '../../general_settings.js';
8
+ import {
9
+ CellActions,
10
+ CellActionsButton,
11
+ CellInput,
12
+ CellNumericInput,
13
+ TableSettings,
14
+ } from '../ui/table.tsx';
15
+ import { TableSection } from '../ui/table_section.tsx';
16
+ import type { nucleiValidation } from '../validation/nuclei_tab_validation.ts';
14
17
  import { defaultGeneralSettingsFormValues } from '../validation.js';
15
18
 
16
- interface NucleiFormElement {
17
- nucleus: string;
18
- ppmFormat: string;
19
- hzFormat: string;
20
- }
19
+ type NucleiFormElement = z.input<typeof nucleiValidation>[number];
21
20
 
22
- const emptyNucleiFormElement: NucleiFormElement = {
23
- nucleus: '',
24
- ppmFormat: '0.00',
25
- hzFormat: '0.00',
26
- };
21
+ function emptyNucleiFormElement(): NucleiFormElement {
22
+ return {
23
+ nucleus: '',
24
+ ppmFormat: '0.00',
25
+ hzFormat: '0.00',
26
+ uuid: crypto.randomUUID(),
27
+ };
28
+ }
27
29
 
28
30
  export const NucleiTab = withForm({
29
31
  defaultValues: defaultGeneralSettingsFormValues,
30
32
  render: function Render({ form }) {
31
- const fields = useStore(form.store, (state) => state.values.nuclei);
33
+ const nucleiField = useField({ form, name: 'nuclei', mode: 'array' });
32
34
 
33
- const handleAdd = useCallback(
34
- (data: readonly NucleiFormElement[], index: number) => {
35
- let columns: NucleiFormElement[] = [];
35
+ const { Field } = form;
36
+ const { insertValue, removeValue, pushValue } = nucleiField;
36
37
 
37
- if (data) {
38
- columns = [
39
- ...data.slice(0, index),
40
- emptyNucleiFormElement,
41
- ...data.slice(index),
42
- ];
43
- } else {
44
- columns.push(emptyNucleiFormElement);
45
- }
46
-
47
- form.setFieldValue('nuclei', columns);
38
+ const insertNucleus = useCallback(
39
+ (index: number) => {
40
+ insertValue(index, emptyNucleiFormElement());
48
41
  },
49
- [form],
42
+ [insertValue],
50
43
  );
51
-
52
- const handleDelete = useCallback(
53
- (data: readonly NucleiFormElement[], formElement: NucleiFormElement) => {
54
- const fields = data.filter((element) => {
55
- return element.nucleus !== formElement.nucleus;
56
- });
57
-
58
- form.setFieldValue('nuclei', fields);
44
+ const pushNucleus = useCallback(() => {
45
+ pushValue(emptyNucleiFormElement());
46
+ }, [pushValue]);
47
+ const deleteNucleus = useCallback(
48
+ (index: number) => {
49
+ removeValue(index);
59
50
  },
60
- [form],
51
+ [removeValue],
61
52
  );
62
53
 
63
- const COLUMNS = useMemo<Array<Column<NucleiFormElement>>>(
64
- () => [
65
- {
66
- Header: 'Nucleus',
67
- style: { padding: 0 },
68
- Cell: ({ row: { index } }: CellProps<NucleiFormElement>) => {
69
- return (
70
- <form.Field key={index} name={`nuclei[${index}].nucleus`}>
71
- {(subField) => (
72
- <Input2
73
- style={{
74
- backgroundColor: 'transparent',
75
- boxShadow: 'none',
76
- }}
77
- value={subField.state.value}
78
- onChange={subField.handleChange}
79
- />
80
- )}
81
- </form.Field>
82
- );
83
- },
84
- },
85
- {
86
- Header: 'δ (ppm)',
87
- style: { padding: 0 },
88
- Cell: ({ row: { index } }: CellProps<NucleiFormElement>) => {
89
- return (
90
- <form.Field key={index} name={`nuclei[${index}].ppmFormat`}>
91
- {(subField) => (
92
- <Input2
93
- style={{
94
- backgroundColor: 'transparent',
95
- boxShadow: 'none',
96
- }}
97
- value={subField.state.value}
98
- onChange={subField.handleChange}
99
- />
100
- )}
101
- </form.Field>
102
- );
103
- },
104
- },
105
- {
106
- Header: 'Coupling (Hz)',
107
- style: { padding: 0 },
108
- Cell: ({ row: { index } }: CellProps<NucleiFormElement>) => {
109
- return (
110
- <form.Field key={index} name={`nuclei[${index}].hzFormat`}>
111
- {(subField) => (
112
- <Input2
113
- style={{
114
- backgroundColor: 'transparent',
115
- boxShadow: 'none',
116
- }}
117
- value={subField.state.value}
118
- onChange={subField.handleChange}
119
- />
120
- )}
121
- </form.Field>
122
- );
123
- },
124
- },
125
- {
126
- Header: 'Axis from',
127
- style: { padding: 0 },
128
- Cell: ({ row: { index } }: CellProps<NucleiFormElement>) => {
129
- return (
130
- <form.Field key={index} name={`nuclei[${index}].axisFrom`}>
131
- {(subField) => (
132
- <NumericInput
133
- style={{
134
- backgroundColor: 'transparent',
135
- boxShadow: 'none',
136
- }}
137
- value={Number(subField.state.value) || undefined}
138
- fill
139
- onValueChange={(valueAsNumber) =>
140
- subField.handleChange(valueAsNumber)
141
- }
142
- />
143
- )}
144
- </form.Field>
145
- );
146
- },
147
- },
148
- {
149
- Header: 'Axis to',
150
- style: { padding: 0 },
151
- Cell: ({ row: { index } }: CellProps<NucleiFormElement>) => {
152
- return (
153
- <form.Field key={index} name={`nuclei[${index}].axisTo`}>
154
- {(subField) => (
155
- <NumericInput
156
- style={{
157
- backgroundColor: 'transparent',
158
- boxShadow: 'none',
159
- }}
160
- value={Number(subField.state.value) || undefined}
161
- fill
162
- onValueChange={(valueAsNumber) =>
163
- subField.handleChange(valueAsNumber)
164
- }
165
- />
166
- )}
167
- </form.Field>
168
- );
54
+ const COLUMNS = useMemo(() => {
55
+ const columnHelper = createTableColumnHelper<NucleiFormElement>();
56
+ return [
57
+ columnHelper.accessor('nucleus', {
58
+ header: 'Nucleus',
59
+ cell: ({ row: { index } }) => (
60
+ <Field key={index} name={`nuclei[${index}].nucleus`}>
61
+ {(subField) => (
62
+ <CellInput
63
+ value={subField.state.value}
64
+ onChange={subField.handleChange}
65
+ onBlur={subField.handleBlur}
66
+ />
67
+ )}
68
+ </Field>
69
+ ),
70
+ }),
71
+ columnHelper.accessor('ppmFormat', {
72
+ header: 'δ (ppm)',
73
+ cell: ({ row: { index } }) => (
74
+ <Field key={index} name={`nuclei[${index}].ppmFormat`}>
75
+ {(subField) => (
76
+ <CellInput
77
+ value={subField.state.value}
78
+ onChange={subField.handleChange}
79
+ onBlur={subField.handleBlur}
80
+ />
81
+ )}
82
+ </Field>
83
+ ),
84
+ }),
85
+ columnHelper.accessor('hzFormat', {
86
+ header: 'Coupling (Hz)',
87
+ cell: ({ row: { index } }) => (
88
+ <Field key={index} name={`nuclei[${index}].hzFormat`}>
89
+ {(subField) => (
90
+ <CellInput
91
+ value={subField.state.value}
92
+ onChange={subField.handleChange}
93
+ onBlur={subField.handleBlur}
94
+ />
95
+ )}
96
+ </Field>
97
+ ),
98
+ }),
99
+ columnHelper.display({
100
+ id: 'axisFrom',
101
+ header: 'Axis from',
102
+ cell: ({ row: { index } }) => (
103
+ <Field key={index} name={`nuclei[${index}].axisFrom`}>
104
+ {(subField) => (
105
+ <CellNumericInput
106
+ value={subField.state.value}
107
+ onChange={(event) =>
108
+ subField.handleChange(event.currentTarget.value)
109
+ }
110
+ onBlur={subField.handleBlur}
111
+ fill
112
+ />
113
+ )}
114
+ </Field>
115
+ ),
116
+ }),
117
+ columnHelper.display({
118
+ id: 'axisTo',
119
+ header: 'Axis to',
120
+ cell: ({ row: { index } }) => (
121
+ <Field key={index} name={`nuclei[${index}].axisTo`}>
122
+ {(subField) => (
123
+ <CellNumericInput
124
+ value={subField.state.value}
125
+ onChange={(event) =>
126
+ subField.handleChange(event.currentTarget.value)
127
+ }
128
+ onBlur={subField.handleBlur}
129
+ fill
130
+ />
131
+ )}
132
+ </Field>
133
+ ),
134
+ }),
135
+ columnHelper.display({
136
+ id: 'actions',
137
+ header: '',
138
+ meta: {
139
+ thStyle: {
140
+ width: '60px',
141
+ },
169
142
  },
170
- },
171
- {
172
- Header: '',
173
- style: {
174
- width: 60,
175
- },
176
- id: 'op-buttons',
177
- Cell: ({
178
- row: { original, index: rowIndex },
179
- data,
180
- }: CellProps<NucleiFormElement>) => {
181
- return (
182
- <Buttons>
183
- <Button
184
- size="small"
185
- variant="outlined"
186
- intent="success"
187
- onClick={() => handleAdd(data, rowIndex + 1)}
188
- >
189
- <FaPlus className={Classes.ICON} />
190
- </Button>
191
- <Button
192
- size="small"
193
- variant="outlined"
194
- intent="danger"
195
- onClick={() => handleDelete(data, original)}
196
- >
197
- <FaRegTrashAlt className={Classes.ICON} />
198
- </Button>
199
- </Buttons>
200
- );
201
- },
202
- },
203
- ],
204
- [form, handleAdd, handleDelete],
205
- );
143
+ cell: ({ row: { index } }) => (
144
+ <CellActions>
145
+ <CellActionsButton
146
+ intent="success"
147
+ onClick={() => insertNucleus(index + 1)}
148
+ >
149
+ <FaPlus className={Classes.ICON} />
150
+ </CellActionsButton>
151
+ <CellActionsButton
152
+ intent="danger"
153
+ onClick={() => deleteNucleus(index)}
154
+ >
155
+ <FaRegTrashAlt className={Classes.ICON} />
156
+ </CellActionsButton>
157
+ </CellActions>
158
+ ),
159
+ }),
160
+ ];
161
+ }, [Field, deleteNucleus, insertNucleus]);
206
162
 
207
163
  return (
208
- <GroupPane
209
- text="Number formatting for crosshair and info line and axis domain"
210
- renderHeader={(text) => {
211
- return (
212
- <FieldsBlockHeader text={text} onAdd={() => handleAdd(fields, 0)} />
213
- );
214
- }}
164
+ <TableSection
165
+ title="Nuclei number formatting"
166
+ description="for crosshair, info line and axis domain"
167
+ actions={
168
+ <Button
169
+ size="small"
170
+ variant="outlined"
171
+ intent="success"
172
+ tooltipProps={{ content: '', disabled: true }}
173
+ onClick={pushNucleus}
174
+ >
175
+ Add nuclei preferences
176
+ </Button>
177
+ }
215
178
  >
216
- <ReactTable
217
- style={{
218
- 'thead tr th': { zIndex: 1 },
219
- td: { padding: 0 },
220
- }}
221
- rowStyle={{
222
- hover: { backgroundColor: '#f7f7f7' },
223
- active: { backgroundColor: '#f5f5f5' },
224
- }}
225
- data={fields}
179
+ <TableSettings
180
+ data={nucleiField.state.value}
226
181
  columns={COLUMNS}
227
- emptyDataRowText="No Nucleus"
182
+ emptyContent="No nucleus"
183
+ getRowId={getRowId}
228
184
  />
229
- </GroupPane>
185
+ </TableSection>
230
186
  );
231
187
  },
232
188
  });
233
189
 
234
- interface FieldsBlockHeaderProps {
235
- onAdd: () => void;
236
- text: string;
190
+ function getRowId(row: NucleiFormElement) {
191
+ return row.uuid;
237
192
  }
238
-
239
- function FieldsBlockHeader(props: FieldsBlockHeaderProps) {
240
- const { onAdd, text } = props;
241
- return (
242
- <Section>
243
- <p style={{ flex: 1 }}>{text}</p>
244
-
245
- <Button
246
- size="small"
247
- variant="outlined"
248
- intent="success"
249
- tooltipProps={{ content: '', disabled: true }}
250
- onClick={onAdd}
251
- >
252
- Add nuclei preferences
253
- </Button>
254
- </Section>
255
- );
256
- }
257
-
258
- const Buttons = styled.div`
259
- display: flex;
260
- justify-content: space-evenly;
261
- `;
@@ -46,14 +46,6 @@ const SpectraSettings = withFieldGroup({
46
46
  <Select label="Processing" items={displayPanelsStatus} />
47
47
  )}
48
48
  </AppField>
49
- <AppField name="multipleSpectraAnalysisPanel">
50
- {({ Select }) => (
51
- <Select
52
- label="Multiple spectra analysis"
53
- items={displayPanelsStatus}
54
- />
55
- )}
56
- </AppField>
57
49
  </Section>
58
50
  );
59
51
  },
@@ -65,7 +57,7 @@ const Spectra1dSettings = withFieldGroup({
65
57
  const { Section, AppField } = group;
66
58
 
67
59
  return (
68
- <Section title="Spectra 1D">
60
+ <Section title="1D Spectra">
69
61
  <AppField name="peaksPanel">
70
62
  {({ Select }) => <Select label="Peaks" items={displayPanelsStatus} />}
71
63
  </AppField>
@@ -92,6 +84,14 @@ const Spectra1dSettings = withFieldGroup({
92
84
  <Select label="Spectrum simulation" items={displayPanelsStatus} />
93
85
  )}
94
86
  </AppField>
87
+ <AppField name="multipleSpectraAnalysisPanel">
88
+ {({ Select }) => (
89
+ <Select
90
+ label="Multiple spectra analysis"
91
+ items={displayPanelsStatus}
92
+ />
93
+ )}
94
+ </AppField>
95
95
  </Section>
96
96
  );
97
97
  },
@@ -103,7 +103,7 @@ const Spectra2dSettings = withFieldGroup({
103
103
  const { Section, AppField } = group;
104
104
 
105
105
  return (
106
- <Section title="Spectra 2D">
106
+ <Section title="2D Spectra">
107
107
  <AppField name="zonesPanel">
108
108
  {({ Select }) => <Select label="Zones" items={displayPanelsStatus} />}
109
109
  </AppField>