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.
- package/lib/component/1d/database/DatabaseSpectrum.d.ts.map +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts.map +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +3 -17
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js.map +1 -1
- package/lib/component/2d/ft/Contours.d.ts.map +1 -1
- package/lib/component/2d/ft/Contours.js +10 -12
- package/lib/component/2d/ft/Contours.js.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/hooks/reduce2DSpectrum.d.ts +4 -0
- package/lib/component/hooks/reduce2DSpectrum.d.ts.map +1 -0
- package/lib/component/hooks/reduce2DSpectrum.js +60 -0
- package/lib/component/hooks/reduce2DSpectrum.js.map +1 -0
- package/lib/component/hooks/use2DReducer.d.ts +14 -0
- package/lib/component/hooks/use2DReducer.d.ts.map +1 -0
- package/lib/component/hooks/use2DReducer.js +30 -0
- package/lib/component/hooks/use2DReducer.js.map +1 -0
- package/lib/component/hooks/useCreateNmriumZip.d.ts +3 -0
- package/lib/component/hooks/useCreateNmriumZip.d.ts.map +1 -0
- package/lib/component/hooks/useCreateNmriumZip.js +28 -0
- package/lib/component/hooks/useCreateNmriumZip.js.map +1 -0
- package/lib/component/hooks/useExport.d.ts +8 -5
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +4 -21
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
- package/lib/component/loader/useLoadFiles.js +4 -5
- package/lib/component/loader/useLoadFiles.js.map +1 -1
- package/lib/component/main/InnerNMRium.d.ts.map +1 -1
- package/lib/component/main/InnerNMRium.js +2 -2
- package/lib/component/main/InnerNMRium.js.map +1 -1
- package/lib/component/main/NMRium.d.ts +48 -3
- package/lib/component/main/NMRium.d.ts.map +1 -1
- package/lib/component/main/NMRium.js.map +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts +2 -0
- package/lib/component/main/NMRiumRefAPI.d.ts.map +1 -1
- package/lib/component/main/NMRiumRefAPI.js +4 -1
- package/lib/component/main/NMRiumRefAPI.js.map +1 -1
- package/lib/component/main/NMRiumStateProvider.d.ts +5 -2
- package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
- package/lib/component/main/NMRiumStateProvider.js +36 -30
- package/lib/component/main/NMRiumStateProvider.js.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +4 -4
- package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
- package/lib/component/modal/setting/general_settings.d.ts.map +1 -1
- package/lib/component/modal/setting/general_settings.js +3 -3
- package/lib/component/modal/setting/general_settings.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts +4 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +46 -29
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js +10 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +1353 -6
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js +43 -32
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts +1353 -6
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js +88 -83
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +466 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.js +59 -0
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js +32 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.js +80 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +37 -9
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.js +58 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js +65 -112
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +920 -188
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js +3 -3
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.js +142 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js +112 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +1354 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js +38 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.d.ts +68 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.js +133 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.d.ts +10 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.js +31 -0
- package/lib/component/modal/setting/tanstack_general_settings/ui/table_section.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.d.ts +71 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.js +67 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.d.ts → validation/check_unique_by_key.d.ts} +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/check_unique_by_key.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.js → validation/check_unique_by_key.js} +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/check_unique_by_key.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.d.ts +11 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.js +20 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.d.ts +32 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.js +11 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts +2 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js +3 -6
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts +12 -4
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js +4 -3
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts +20 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js +12 -4
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.d.ts +54 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.js +22 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.d.ts +55 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.js +18 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts +32 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js +34 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.d.ts +13 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.js +20 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/utils.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +255 -39
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation.js +16 -27
- package/lib/component/modal/setting/tanstack_general_settings/validation.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +27 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js +3 -2
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.d.ts +2 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js +8 -3
- package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +2 -2
- package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +26 -33
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +1 -3
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +2 -4
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js +14 -5
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/LoadAction.d.ts +1 -4
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
- package/lib/component/reducer/actions/LoadAction.js +8 -17
- package/lib/component/reducer/actions/LoadAction.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +3 -0
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts +5 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.js +4 -2
- package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/preferences/actions/applyGeneralPreferences.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/applyGeneralPreferences.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +9 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/PredictionManager.d.ts.map +1 -1
- package/lib/data/PredictionManager.js +3 -0
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.d.ts +7 -6
- package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +22 -6
- package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -10
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/molecules/Molecule.d.ts +5 -1
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js +9 -7
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +0 -6
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +25 -25
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib/versionInfo.js.map +1 -1
- package/package.json +30 -29
- package/src/component/1d/database/DatabaseSpectrum.tsx +3 -1
- package/src/component/1d-2d/components/SpectrumInfoBlock.tsx +10 -22
- package/src/component/2d/ft/Contours.tsx +14 -27
- package/src/component/elements/ActionsButtonsPopover.tsx +1 -1
- package/src/component/hooks/reduce2DSpectrum.ts +98 -0
- package/src/component/hooks/use2DReducer.tsx +56 -0
- package/src/component/hooks/useCreateNmriumZip.ts +37 -0
- package/src/component/hooks/useExport.tsx +16 -31
- package/src/component/loader/useLoadFiles.ts +6 -10
- package/src/component/main/InnerNMRium.tsx +4 -2
- package/src/component/main/NMRium.tsx +50 -2
- package/src/component/main/NMRiumRefAPI.ts +7 -1
- package/src/component/main/NMRiumStateProvider.tsx +57 -35
- package/src/component/modal/LoadJCAMPModal.tsx +4 -4
- package/src/component/modal/setting/general_settings.tsx +4 -3
- package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +80 -54
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +48 -1
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.tsx +75 -68
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.tsx +165 -184
- package/src/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.ts +95 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.tsx +81 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/database_tab.tsx +210 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +48 -8
- package/src/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.tsx +150 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/general_tab.tsx +3 -3
- package/src/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.tsx +164 -233
- package/src/component/modal/setting/tanstack_general_settings/tabs/panels_tab.tsx +10 -10
- package/src/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.tsx +352 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.tsx +248 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/tools_tab.tsx +155 -0
- package/src/component/modal/setting/tanstack_general_settings/ui/table.tsx +163 -0
- package/src/component/modal/setting/tanstack_general_settings/ui/table_section.tsx +52 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.ts +73 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.ts +23 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.ts +12 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.ts +4 -6
- package/src/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.ts +11 -8
- package/src/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.ts +17 -9
- package/src/component/modal/setting/tanstack_general_settings/validation/spectra_colors_tab_validation.ts +29 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/title_block_tab_validation.ts +26 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.ts +34 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/utils.ts +30 -0
- package/src/component/modal/setting/tanstack_general_settings/validation.ts +16 -31
- package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +35 -0
- package/src/component/panels/SpectraPanel/base/setting/Spectrum1DSetting.tsx +3 -2
- package/src/component/panels/SpectraPanel/base/setting/Spectrum2DSetting.tsx +12 -4
- package/src/component/panels/SpectraPanel/base/setting/SpectrumSetting.tsx +1 -1
- package/src/component/panels/databasePanel/DatabasePanel.tsx +6 -4
- package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +34 -49
- package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -1
- package/src/component/reducer/Reducer.ts +1 -3
- package/src/component/reducer/actions/FiltersActions.ts +16 -10
- package/src/component/reducer/actions/LoadAction.ts +12 -27
- package/src/component/reducer/actions/MoleculeActions.ts +3 -0
- package/src/component/reducer/actions/SpectraActions.ts +14 -6
- package/src/component/reducer/actions/ToolsActions.ts +3 -1
- package/src/component/reducer/preferences/actions/applyGeneralPreferences.ts +1 -2
- package/src/component/reducer/preferences/preferencesReducer.ts +4 -4
- package/src/component/workspaces/workspaceDefaultProperties.ts +9 -0
- package/src/data/PredictionManager.ts +3 -0
- package/src/data/data2d/Spectrum2D/contours.ts +28 -12
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +1 -17
- package/src/data/molecules/Molecule.ts +17 -7
- package/src/data/molecules/MoleculeManager.ts +31 -29
- package/src/versionInfo.ts +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.d.ts.map +0 -1
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.js.map +0 -1
- /package/src/component/modal/setting/tanstack_general_settings/{utils/checkUniqueByKey.ts → validation/check_unique_by_key.ts} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Spectrum2D } from '@zakodium/nmrium-core';
|
|
2
|
+
import type { NmrData2DContent, NmrData2DFt } from 'cheminfo-types';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
|
|
5
|
+
import { isFt2DSpectrum } from '../../data/data2d/Spectrum2D/isSpectrum2D.ts';
|
|
6
|
+
import { useChartData } from '../context/ChartContext.tsx';
|
|
7
|
+
import { getSpectraByNucleus } from '../utility/getSpectraByNucleus.ts';
|
|
8
|
+
|
|
9
|
+
import { reduce2DSpectrum } from './reduce2DSpectrum.ts';
|
|
10
|
+
|
|
11
|
+
export interface SpectrumFTData extends Pick<Spectrum2D, 'display' | 'id'> {
|
|
12
|
+
data: NmrData2DContent;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function use2DReducer(): SpectrumFTData[] {
|
|
16
|
+
const {
|
|
17
|
+
xDomain,
|
|
18
|
+
yDomain,
|
|
19
|
+
view: {
|
|
20
|
+
spectra: { activeTab },
|
|
21
|
+
},
|
|
22
|
+
data,
|
|
23
|
+
} = useChartData();
|
|
24
|
+
const [fromX, toX] = xDomain;
|
|
25
|
+
const [fromY, toY] = yDomain;
|
|
26
|
+
|
|
27
|
+
return useMemo(() => {
|
|
28
|
+
const outputSpectra: SpectrumFTData[] = [];
|
|
29
|
+
for (const spectrum of getSpectraByNucleus(activeTab, data).filter(
|
|
30
|
+
isFt2DSpectrum,
|
|
31
|
+
)) {
|
|
32
|
+
const { id, display, data } = spectrum;
|
|
33
|
+
const { rr } = data as NmrData2DFt;
|
|
34
|
+
const reducedData = reduce2DSpectrum(rr, {
|
|
35
|
+
fromX,
|
|
36
|
+
fromY,
|
|
37
|
+
toX,
|
|
38
|
+
toY,
|
|
39
|
+
});
|
|
40
|
+
outputSpectra.push({
|
|
41
|
+
data: reducedData,
|
|
42
|
+
id,
|
|
43
|
+
display,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return outputSpectra;
|
|
47
|
+
}, [activeTab, data, fromX, fromY, toX, toY]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface Reduce2DSpectrumOptions {
|
|
51
|
+
numberOfPoints?: number;
|
|
52
|
+
fromX?: number;
|
|
53
|
+
toX?: number;
|
|
54
|
+
fromY?: number;
|
|
55
|
+
toY?: number;
|
|
56
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { NmriumState } from '@zakodium/nmrium-core';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
import { toJSON } from '../../data/SpectraManager.ts';
|
|
5
|
+
import { useChartData } from '../context/ChartContext.tsx';
|
|
6
|
+
import { useCore } from '../context/CoreContext.tsx';
|
|
7
|
+
import { usePreferences } from '../context/PreferencesContext.tsx';
|
|
8
|
+
|
|
9
|
+
import type { SaveIncludeOptions } from './useExport.tsx';
|
|
10
|
+
|
|
11
|
+
export function useCreateNmriumZip() {
|
|
12
|
+
const state = useChartData();
|
|
13
|
+
const preferencesState = usePreferences();
|
|
14
|
+
const core = useCore();
|
|
15
|
+
|
|
16
|
+
return useCallback(
|
|
17
|
+
async (include: SaveIncludeOptions): Promise<Blob> => {
|
|
18
|
+
const nmriumState = toJSON(core, state, preferencesState, {
|
|
19
|
+
serialize: false,
|
|
20
|
+
exportTarget: 'nmrium',
|
|
21
|
+
}) as NmriumState;
|
|
22
|
+
const archive = await core.serializeNmriumArchive({
|
|
23
|
+
state: nmriumState,
|
|
24
|
+
aggregator: state.aggregator,
|
|
25
|
+
includeData: include.dataType !== 'NO_DATA',
|
|
26
|
+
externalData:
|
|
27
|
+
include.dataType === 'SELF_CONTAINED' ? 'embedded' : 'linked',
|
|
28
|
+
includeSettings: include.settings,
|
|
29
|
+
includeView: include.view,
|
|
30
|
+
});
|
|
31
|
+
return new Blob([archive], {
|
|
32
|
+
type: 'chemical/x-nmrium+zip',
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
[core, preferencesState, state],
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type { NmriumState } from '@zakodium/nmrium-core';
|
|
2
1
|
import { useCallback } from 'react';
|
|
3
2
|
|
|
4
|
-
import { toJSON } from '../../data/SpectraManager.js';
|
|
5
3
|
import { useChartData } from '../context/ChartContext.js';
|
|
6
|
-
import { useCore } from '../context/CoreContext.js';
|
|
7
|
-
import { usePreferences } from '../context/PreferencesContext.js';
|
|
8
4
|
import { useToaster } from '../context/ToasterContext.js';
|
|
9
5
|
import {
|
|
10
6
|
browserNotSupportedErrorToast,
|
|
@@ -14,23 +10,27 @@ import {
|
|
|
14
10
|
} from '../utility/export.js';
|
|
15
11
|
import { saveAs } from '../utility/save_as.js';
|
|
16
12
|
|
|
13
|
+
import { useCreateNmriumZip } from './useCreateNmriumZip.ts';
|
|
14
|
+
|
|
15
|
+
type DataType =
|
|
16
|
+
| 'NO_DATA'
|
|
17
|
+
| 'SELF_CONTAINED'
|
|
18
|
+
| 'SELF_CONTAINED_EXTERNAL_DATASOURCE';
|
|
19
|
+
|
|
20
|
+
export interface SaveIncludeOptions {
|
|
21
|
+
settings: boolean;
|
|
22
|
+
view: boolean;
|
|
23
|
+
dataType: DataType;
|
|
24
|
+
}
|
|
17
25
|
export interface SaveOptions {
|
|
18
|
-
include:
|
|
19
|
-
settings: boolean;
|
|
20
|
-
view: boolean;
|
|
21
|
-
dataType:
|
|
22
|
-
| 'NO_DATA'
|
|
23
|
-
| 'SELF_CONTAINED'
|
|
24
|
-
| 'SELF_CONTAINED_EXTERNAL_DATASOURCE';
|
|
25
|
-
};
|
|
26
|
+
include: SaveIncludeOptions;
|
|
26
27
|
name: string;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export function useExport() {
|
|
30
31
|
const toaster = useToaster();
|
|
31
32
|
const state = useChartData();
|
|
32
|
-
const
|
|
33
|
-
const core = useCore();
|
|
33
|
+
const createNmriumZip = useCreateNmriumZip();
|
|
34
34
|
|
|
35
35
|
const saveHandler = useCallback(
|
|
36
36
|
(options: SaveOptions) => {
|
|
@@ -43,22 +43,7 @@ export function useExport() {
|
|
|
43
43
|
});
|
|
44
44
|
setTimeout(async () => {
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
serialize: false,
|
|
48
|
-
exportTarget: 'nmrium',
|
|
49
|
-
}) as NmriumState;
|
|
50
|
-
const archive = await core.serializeNmriumArchive({
|
|
51
|
-
state: nmriumState,
|
|
52
|
-
aggregator: state.aggregator,
|
|
53
|
-
includeData: include.dataType !== 'NO_DATA',
|
|
54
|
-
externalData:
|
|
55
|
-
include.dataType === 'SELF_CONTAINED' ? 'embedded' : 'linked',
|
|
56
|
-
includeSettings: include.settings,
|
|
57
|
-
includeView: include.view,
|
|
58
|
-
});
|
|
59
|
-
const zipBlob = new Blob([archive], {
|
|
60
|
-
type: 'chemical/x-nmrium+zip',
|
|
61
|
-
});
|
|
46
|
+
const zipBlob = await createNmriumZip(include);
|
|
62
47
|
saveAs({ blob: zipBlob, name, extension: '.nmrium.zip' });
|
|
63
48
|
} catch (error) {
|
|
64
49
|
toaster.show({
|
|
@@ -74,7 +59,7 @@ export function useExport() {
|
|
|
74
59
|
|
|
75
60
|
void handler();
|
|
76
61
|
},
|
|
77
|
-
[
|
|
62
|
+
[createNmriumZip, toaster],
|
|
78
63
|
);
|
|
79
64
|
|
|
80
65
|
const defaultName = state.data[0]?.info?.name || 'experiment';
|
|
@@ -48,12 +48,10 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
|
48
48
|
|
|
49
49
|
const loadNmriumArchives = useCallback(
|
|
50
50
|
async (file: File, parsingOptions: Partial<ParsingOptions>) => {
|
|
51
|
-
const
|
|
52
|
-
file.stream(),
|
|
53
|
-
parsingOptions,
|
|
54
|
-
);
|
|
51
|
+
const { state, aggregator, containsNmrium } =
|
|
52
|
+
await core.readNMRiumArchive(file.stream(), parsingOptions);
|
|
55
53
|
|
|
56
|
-
dispatchPayload({ nmriumState, aggregator, containsNmrium
|
|
54
|
+
dispatchPayload({ nmriumState: state, aggregator, containsNmrium });
|
|
57
55
|
},
|
|
58
56
|
[core, dispatchPayload],
|
|
59
57
|
);
|
|
@@ -68,10 +66,9 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
|
68
66
|
? await parseMetaFile(metaFile)
|
|
69
67
|
: null;
|
|
70
68
|
const {
|
|
71
|
-
nmriumState,
|
|
69
|
+
state: nmriumState,
|
|
72
70
|
containsNmrium,
|
|
73
|
-
|
|
74
|
-
fileCollection: sanitizedCollection,
|
|
71
|
+
aggregator,
|
|
75
72
|
} = await core.read(fileCollection, parsingOptions);
|
|
76
73
|
const resetSourceObject = containsNmrium;
|
|
77
74
|
|
|
@@ -79,8 +76,7 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
|
79
76
|
nmriumState,
|
|
80
77
|
containsNmrium,
|
|
81
78
|
parseMetaFileResult,
|
|
82
|
-
|
|
83
|
-
selectorRoot,
|
|
79
|
+
aggregator,
|
|
84
80
|
resetSourceObject,
|
|
85
81
|
});
|
|
86
82
|
},
|
|
@@ -38,7 +38,8 @@ type InnerNMRiumProps = Omit<NMRiumProps, 'onError'> & {
|
|
|
38
38
|
|
|
39
39
|
export function InnerNMRium(props: InnerNMRiumProps) {
|
|
40
40
|
const {
|
|
41
|
-
|
|
41
|
+
state,
|
|
42
|
+
aggregator,
|
|
42
43
|
workspace,
|
|
43
44
|
customWorkspaces,
|
|
44
45
|
preferences,
|
|
@@ -110,7 +111,8 @@ export function InnerNMRium(props: InnerNMRiumProps) {
|
|
|
110
111
|
<SortSpectraProvider>
|
|
111
112
|
<NMRiumStateProvider
|
|
112
113
|
onChange={onChange}
|
|
113
|
-
|
|
114
|
+
state={state}
|
|
115
|
+
aggregator={aggregator}
|
|
114
116
|
>
|
|
115
117
|
<TopicMoleculeProvider>
|
|
116
118
|
<DialogProvider>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
CustomWorkspaces,
|
|
3
3
|
NMRiumCore,
|
|
4
|
+
NmriumState,
|
|
4
5
|
WorkspacePreferences as NMRiumPreferences,
|
|
5
6
|
} from '@zakodium/nmrium-core';
|
|
7
|
+
import type { FileCollection } from 'file-collection';
|
|
6
8
|
import type { ReactElement, ReactNode } from 'react';
|
|
7
9
|
import { forwardRef, memo } from 'react';
|
|
8
10
|
import type { ErrorBoundaryPropsWithComponent } from 'react-error-boundary';
|
|
@@ -12,10 +14,56 @@ import { RootLayout } from 'react-science/ui';
|
|
|
12
14
|
import ErrorOverlay from './ErrorOverlay.js';
|
|
13
15
|
import { InnerNMRium } from './InnerNMRium.js';
|
|
14
16
|
import type { NMRiumRefAPI } from './NMRiumRefAPI.js';
|
|
15
|
-
import type { NMRiumChangeCb,
|
|
17
|
+
import type { NMRiumChangeCb, NMRiumWorkspace } from './types.js';
|
|
16
18
|
|
|
17
19
|
export interface NMRiumProps {
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* If you choose to bind the state to the component, you have to use a valid one.
|
|
22
|
+
* - It must have the latest version supported by the core used by the NMRium component.
|
|
23
|
+
* - It must come from a read api of `nmrium-core`.
|
|
24
|
+
* - It will be transmitted as-is to the state reducer of `NMRium` component.
|
|
25
|
+
* - `aggregator` must also be provided.
|
|
26
|
+
*/
|
|
27
|
+
state?: Partial<NmriumState>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Each of the core read apis returns a file collection.
|
|
31
|
+
* Sometimes with the `fileCollection` name (not in aggregated form), sometimes with `ium` or `aggregator` name (already aggregated).
|
|
32
|
+
* `aggregator` is a meta file collection. Each user source of data is placed in his dedicated uuid folder.
|
|
33
|
+
* In the UI, it means one drag n drop (with possibly multiple files) = one uuid folder.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const {nmriumState, fileCollection, containsNmrium, selectorRoot} = core.read();
|
|
38
|
+
* const aggregator = containsNmrium
|
|
39
|
+
* ? fileCollection
|
|
40
|
+
* : new FileCollection().appendFileCollection(fileCollection, selectorRoot);
|
|
41
|
+
*
|
|
42
|
+
* <NMRium state={nmriumState} aggregator={aggregator} />
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* const [state, ium] = core.readNMRiumArchive();
|
|
47
|
+
*
|
|
48
|
+
* <NMRium state={state} aggregator={ium} />
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* const [state, aggregator] = core.readNMRiumObject();
|
|
53
|
+
* // const [state, aggregator] = core.readNMRiumFile();
|
|
54
|
+
*
|
|
55
|
+
* <NMRium state={state} aggregator={aggregator} />
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* const [state, fileCollection, selectorRoot] = core.readFromWebSource();
|
|
60
|
+
* const aggregator = new FileCollection().appendFileCollection(fileCollection, selectorRoot);
|
|
61
|
+
*
|
|
62
|
+
* <NMRium state={state} aggregator={aggregator} />
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
aggregator?: FileCollection;
|
|
66
|
+
|
|
19
67
|
onChange?: NMRiumChangeCb;
|
|
20
68
|
noErrorBoundary?: boolean;
|
|
21
69
|
onError?: ErrorBoundaryPropsWithComponent['onError'];
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { ForwardedRef, RefObject } from 'react';
|
|
2
2
|
import { useImperativeHandle } from 'react';
|
|
3
3
|
|
|
4
|
+
import { useCreateNmriumZip } from '../hooks/useCreateNmriumZip.ts';
|
|
5
|
+
import type { SaveIncludeOptions } from '../hooks/useExport.tsx';
|
|
4
6
|
import { useLoadFiles } from '../loader/useLoadFiles.js';
|
|
5
7
|
import type { BlobObject } from '../utility/export.js';
|
|
6
8
|
import { getBlob } from '../utility/export.js';
|
|
7
9
|
|
|
8
10
|
export interface NMRiumRefAPI {
|
|
9
11
|
getSpectraViewerAsBlob: () => BlobObject | null;
|
|
12
|
+
getNMRiumFile: (option: SaveIncludeOptions) => Promise<Blob>;
|
|
10
13
|
loadFiles: (files: File[]) => void;
|
|
11
14
|
}
|
|
12
15
|
|
|
@@ -15,6 +18,8 @@ export function useNMRiumRefAPI(
|
|
|
15
18
|
rootRef: RefObject<HTMLDivElement>,
|
|
16
19
|
) {
|
|
17
20
|
const loadFiles = useLoadFiles();
|
|
21
|
+
const createNmriumZip = useCreateNmriumZip();
|
|
22
|
+
|
|
18
23
|
useImperativeHandle(
|
|
19
24
|
ref,
|
|
20
25
|
() => ({
|
|
@@ -24,7 +29,8 @@ export function useNMRiumRefAPI(
|
|
|
24
29
|
: null;
|
|
25
30
|
},
|
|
26
31
|
loadFiles,
|
|
32
|
+
getNMRiumFile: (options) => createNmriumZip(options),
|
|
27
33
|
}),
|
|
28
|
-
[rootRef,
|
|
34
|
+
[loadFiles, rootRef, createNmriumZip],
|
|
29
35
|
);
|
|
30
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NmriumState } from '@zakodium/nmrium-core';
|
|
2
|
+
import { FileCollection } from 'file-collection';
|
|
2
3
|
import { produce } from 'immer';
|
|
3
4
|
import type { ReactNode } from 'react';
|
|
4
5
|
import { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
|
|
@@ -17,20 +18,22 @@ import {
|
|
|
17
18
|
spectrumReducer,
|
|
18
19
|
} from '../reducer/Reducer.js';
|
|
19
20
|
|
|
20
|
-
import type { NMRiumChangeCb
|
|
21
|
+
import type { NMRiumChangeCb } from './types.js';
|
|
21
22
|
|
|
22
23
|
interface NMRiumStateProviderProps {
|
|
23
24
|
children: ReactNode;
|
|
24
25
|
onChange: NMRiumChangeCb | undefined;
|
|
25
|
-
|
|
26
|
+
state: Partial<NmriumState> | undefined;
|
|
27
|
+
aggregator: FileCollection | undefined;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
const defaultData: NMRiumData = {
|
|
29
|
-
spectra: [],
|
|
30
|
-
};
|
|
31
|
-
|
|
32
30
|
export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
33
|
-
const {
|
|
31
|
+
const {
|
|
32
|
+
children,
|
|
33
|
+
onChange,
|
|
34
|
+
state: externalState,
|
|
35
|
+
aggregator: externalAggregator,
|
|
36
|
+
} = props;
|
|
34
37
|
|
|
35
38
|
const core = useCore();
|
|
36
39
|
const { logger } = useLogger();
|
|
@@ -110,41 +113,60 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
110
113
|
handleChange.current?.(stateRef.current as NmriumState, 'settings');
|
|
111
114
|
}, [preferencesState]);
|
|
112
115
|
|
|
116
|
+
const loggerRef = useRef(logger);
|
|
117
|
+
useEffect(() => void (loggerRef.current = logger));
|
|
113
118
|
useEffect(() => {
|
|
119
|
+
const logger = loggerRef.current;
|
|
120
|
+
|
|
114
121
|
dispatch({
|
|
115
122
|
type: 'SET_LOADING_FLAG',
|
|
116
123
|
payload: { isLoading: true },
|
|
117
124
|
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
reportError(error);
|
|
125
|
+
|
|
126
|
+
function loadingEmptyState() {
|
|
127
|
+
dispatch({
|
|
128
|
+
type: 'INITIATE',
|
|
129
|
+
payload: { nmriumState: {}, aggregator: new FileCollection() },
|
|
130
|
+
});
|
|
131
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (externalState && externalAggregator) {
|
|
135
|
+
if (externalState.version !== core.version) {
|
|
136
|
+
logger.warn(
|
|
137
|
+
externalState,
|
|
138
|
+
`The provided state is for a different version of NMRium (${externalState.version}) than the current version (${core.version}). The provided state is ignored.`,
|
|
139
|
+
);
|
|
140
|
+
loadingEmptyState();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (externalState.settings) {
|
|
145
|
+
dispatchPreferences({
|
|
146
|
+
type: 'SET_WORKSPACE',
|
|
147
|
+
payload: {
|
|
148
|
+
data: externalState.settings,
|
|
149
|
+
workspaceSource: 'nmriumFile',
|
|
150
|
+
},
|
|
145
151
|
});
|
|
152
|
+
}
|
|
153
|
+
dispatch({
|
|
154
|
+
type: 'INITIATE',
|
|
155
|
+
payload: { nmriumState: externalState, aggregator: externalAggregator },
|
|
156
|
+
});
|
|
157
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (externalState && !externalAggregator) {
|
|
162
|
+
logger.warn(
|
|
163
|
+
externalState,
|
|
164
|
+
'`aggregator` is mandatory with `state` props. The provided `state` is ignored',
|
|
165
|
+
);
|
|
146
166
|
}
|
|
147
|
-
|
|
167
|
+
|
|
168
|
+
loadingEmptyState();
|
|
169
|
+
}, [dispatch, dispatchPreferences, core, externalState, externalAggregator]);
|
|
148
170
|
const { sortOptions } = useSortSpectra();
|
|
149
171
|
|
|
150
172
|
const spectra = useMemo(() => {
|
|
@@ -67,7 +67,7 @@ function InnerLoadJCAMPModal({ onCloseDialog }: InnerLoadJCAMPModalProps) {
|
|
|
67
67
|
});
|
|
68
68
|
const { pathname, origin } = new URL(url);
|
|
69
69
|
try {
|
|
70
|
-
const
|
|
70
|
+
const { state, aggregator, containsNmrium } =
|
|
71
71
|
await core.readFromWebSource({
|
|
72
72
|
entries: [{ relativePath: pathname, baseURL: origin }],
|
|
73
73
|
});
|
|
@@ -75,10 +75,10 @@ function InnerLoadJCAMPModal({ onCloseDialog }: InnerLoadJCAMPModalProps) {
|
|
|
75
75
|
dispatch({
|
|
76
76
|
type: 'LOAD_DROP_FILES',
|
|
77
77
|
payload: {
|
|
78
|
-
nmriumState,
|
|
78
|
+
nmriumState: state,
|
|
79
|
+
containsNmrium,
|
|
80
|
+
aggregator,
|
|
79
81
|
resetSourceObject: false,
|
|
80
|
-
fileCollection,
|
|
81
|
-
selectorRoot,
|
|
82
82
|
},
|
|
83
83
|
});
|
|
84
84
|
} catch {
|
|
@@ -47,7 +47,7 @@ import OnLoadProcessingTabContent from './settings-tabs/OnLoadProcessingTabConte
|
|
|
47
47
|
import SpectraColorsTabContent from './settings-tabs/SpectraColorsTabContent.js';
|
|
48
48
|
import ToolsTabContent from './settings-tabs/ToolsTabContent.js';
|
|
49
49
|
import { validation } from './settingsValidation.js';
|
|
50
|
-
import {
|
|
50
|
+
import { GeneralSettingsDialog } from './tanstack_general_settings/general_settings.js';
|
|
51
51
|
|
|
52
52
|
export const Section = styled.div`
|
|
53
53
|
border-bottom: 0.55px solid #f9f9f9;
|
|
@@ -159,10 +159,11 @@ function GeneralSettingsModal(props: GeneralSettingsModalProps) {
|
|
|
159
159
|
)}
|
|
160
160
|
|
|
161
161
|
{isOpenGeneralSettingsDialog && (
|
|
162
|
-
<
|
|
162
|
+
<GeneralSettingsDialog
|
|
163
163
|
height={otherProps.height}
|
|
164
164
|
isOpen={isOpenGeneralSettingsDialog}
|
|
165
165
|
close={closeGeneralSettingsDialog}
|
|
166
|
+
onSave={saveSettings}
|
|
166
167
|
/>
|
|
167
168
|
)}
|
|
168
169
|
</>
|
|
@@ -493,7 +494,7 @@ function DialogActionButtons(props: BasseGeneralModalProps) {
|
|
|
493
494
|
}
|
|
494
495
|
|
|
495
496
|
dispatch({
|
|
496
|
-
type: '
|
|
497
|
+
type: 'APPLY_GENERAL_PREFERENCES',
|
|
497
498
|
payload: {
|
|
498
499
|
data: values as any,
|
|
499
500
|
},
|