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,155 @@
|
|
|
1
|
+
import { withFieldGroup, withForm } from 'react-science/ui';
|
|
2
|
+
|
|
3
|
+
import { defaultGeneralSettingsFormValues } from '../validation.ts';
|
|
4
|
+
|
|
5
|
+
export const ToolsTab = withForm({
|
|
6
|
+
defaultValues: defaultGeneralSettingsFormValues,
|
|
7
|
+
render: ({ form }) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<ChartTools form={form} fields="display.toolBarButtons" />
|
|
11
|
+
<ImportExportTools form={form} fields="display.toolBarButtons" />
|
|
12
|
+
<Spectra1DManipulationTools
|
|
13
|
+
form={form}
|
|
14
|
+
fields="display.toolBarButtons"
|
|
15
|
+
/>
|
|
16
|
+
<Spectra2DManipulationTools
|
|
17
|
+
form={form}
|
|
18
|
+
fields="display.toolBarButtons"
|
|
19
|
+
/>
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const ChartTools = withFieldGroup({
|
|
26
|
+
defaultValues: defaultGeneralSettingsFormValues.display.toolBarButtons,
|
|
27
|
+
render: ({ group }) => {
|
|
28
|
+
const { Section, AppField } = group;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Section title="Chart">
|
|
32
|
+
<AppField name="zoom">
|
|
33
|
+
{({ Checkbox }) => <Checkbox label="Zoom in" />}
|
|
34
|
+
</AppField>
|
|
35
|
+
<AppField name="zoomOut">
|
|
36
|
+
{({ Checkbox }) => <Checkbox label="Zoom out" />}
|
|
37
|
+
</AppField>
|
|
38
|
+
<AppField name="inset">
|
|
39
|
+
{({ Checkbox }) => <Checkbox label="Inset" />}
|
|
40
|
+
</AppField>
|
|
41
|
+
<AppField name="spectraStackAlignments">
|
|
42
|
+
{({ Checkbox }) => <Checkbox label="Stack alignments" />}
|
|
43
|
+
</AppField>
|
|
44
|
+
<AppField name="spectraCenterAlignments">
|
|
45
|
+
{({ Checkbox }) => <Checkbox label="Center alignments" />}
|
|
46
|
+
</AppField>
|
|
47
|
+
<AppField name="realImaginary">
|
|
48
|
+
{({ Checkbox }) => <Checkbox label="Real / Imaginary" />}
|
|
49
|
+
</AppField>
|
|
50
|
+
</Section>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const ImportExportTools = withFieldGroup({
|
|
56
|
+
defaultValues: defaultGeneralSettingsFormValues.display.toolBarButtons,
|
|
57
|
+
render: ({ group }) => {
|
|
58
|
+
const { Section, AppField } = group;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Section title="Import / Export">
|
|
62
|
+
<AppField name="import">
|
|
63
|
+
{({ Checkbox }) => <Checkbox label="Import" />}
|
|
64
|
+
</AppField>
|
|
65
|
+
<AppField name="exportAs">
|
|
66
|
+
{({ Checkbox }) => <Checkbox label="Export as" />}
|
|
67
|
+
</AppField>
|
|
68
|
+
</Section>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const Spectra1DManipulationTools = withFieldGroup({
|
|
74
|
+
defaultValues: defaultGeneralSettingsFormValues.display.toolBarButtons,
|
|
75
|
+
render: ({ group }) => {
|
|
76
|
+
const { Section, AppField } = group;
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<Section title="1D Spectra">
|
|
80
|
+
<AppField name="peakPicking">
|
|
81
|
+
{({ Checkbox }) => <Checkbox label="Peak picking" />}
|
|
82
|
+
</AppField>
|
|
83
|
+
<AppField name="integral">
|
|
84
|
+
{({ Checkbox }) => <Checkbox label="Integrals" />}
|
|
85
|
+
</AppField>
|
|
86
|
+
<AppField name="zonePicking">
|
|
87
|
+
{({ Checkbox }) => <Checkbox label="Zone picking" />}
|
|
88
|
+
</AppField>
|
|
89
|
+
<AppField name="rangePicking">
|
|
90
|
+
{({ Checkbox }) => <Checkbox label="Range picking" />}
|
|
91
|
+
</AppField>
|
|
92
|
+
<AppField name="zeroFilling">
|
|
93
|
+
{({ Checkbox }) => <Checkbox label="Zero filling" />}
|
|
94
|
+
</AppField>
|
|
95
|
+
<AppField name="slicing">
|
|
96
|
+
{({ Checkbox }) => <Checkbox label="Slicing" />}
|
|
97
|
+
</AppField>
|
|
98
|
+
<AppField name="apodization">
|
|
99
|
+
{({ Checkbox }) => <Checkbox label="Apodization" />}
|
|
100
|
+
</AppField>
|
|
101
|
+
<AppField name="phaseCorrection">
|
|
102
|
+
{({ Checkbox }) => <Checkbox label="Phase correction" />}
|
|
103
|
+
</AppField>
|
|
104
|
+
<AppField name="baselineCorrection">
|
|
105
|
+
{({ Checkbox }) => <Checkbox label="Baseline correction" />}
|
|
106
|
+
</AppField>
|
|
107
|
+
<AppField name="fft">
|
|
108
|
+
{({ Checkbox }) => <Checkbox label="Fourier transform" />}
|
|
109
|
+
</AppField>
|
|
110
|
+
<AppField name="exclusionZones">
|
|
111
|
+
{({ Checkbox }) => <Checkbox label="Exclusion zones" />}
|
|
112
|
+
</AppField>
|
|
113
|
+
<AppField name="autoRangeAndZonePicking">
|
|
114
|
+
{({ Checkbox }) => <Checkbox label="Auto range and zone picking" />}
|
|
115
|
+
</AppField>
|
|
116
|
+
<AppField name="multipleSpectraAnalysis">
|
|
117
|
+
{({ Checkbox }) => <Checkbox label="Multiple spectra integration" />}
|
|
118
|
+
</AppField>
|
|
119
|
+
</Section>
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const Spectra2DManipulationTools = withFieldGroup({
|
|
125
|
+
defaultValues: defaultGeneralSettingsFormValues.display.toolBarButtons,
|
|
126
|
+
render: ({ group }) => {
|
|
127
|
+
const { Section, AppField } = group;
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<Section title="2D Spectra">
|
|
131
|
+
<AppField name="zeroFillingDimension1">
|
|
132
|
+
{({ Checkbox }) => <Checkbox label="Zero filling direct" />}
|
|
133
|
+
</AppField>
|
|
134
|
+
<AppField name="zeroFillingDimension2">
|
|
135
|
+
{({ Checkbox }) => <Checkbox label="Zero filling indirect" />}
|
|
136
|
+
</AppField>
|
|
137
|
+
<AppField name="apodizationDimension1">
|
|
138
|
+
{({ Checkbox }) => <Checkbox label="Apodization direct" />}
|
|
139
|
+
</AppField>
|
|
140
|
+
<AppField name="apodizationDimension2">
|
|
141
|
+
{({ Checkbox }) => <Checkbox label="Apodization indirect" />}
|
|
142
|
+
</AppField>
|
|
143
|
+
<AppField name="fftDimension1">
|
|
144
|
+
{({ Checkbox }) => <Checkbox label="Fourier transform direct" />}
|
|
145
|
+
</AppField>
|
|
146
|
+
<AppField name="fftDimension2">
|
|
147
|
+
{({ Checkbox }) => <Checkbox label="Fourier transform indirect" />}
|
|
148
|
+
</AppField>
|
|
149
|
+
<AppField name="phaseCorrectionTwoDimensions">
|
|
150
|
+
{({ Checkbox }) => <Checkbox label="Phase correction" />}
|
|
151
|
+
</AppField>
|
|
152
|
+
</Section>
|
|
153
|
+
);
|
|
154
|
+
},
|
|
155
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Checkbox, Classes, NumericInput } from '@blueprintjs/core';
|
|
2
|
+
import type { StyledComponent } from '@emotion/styled';
|
|
3
|
+
import styled from '@emotion/styled';
|
|
4
|
+
import type { RowData } from '@tanstack/react-table';
|
|
5
|
+
import type { ComponentProps } from 'react';
|
|
6
|
+
import type { ButtonProps, TableProps } from 'react-science/ui';
|
|
7
|
+
import { Button, ColorPickerDropdown, Table } from 'react-science/ui';
|
|
8
|
+
|
|
9
|
+
import { Input2 } from '../../../../elements/Input2.js';
|
|
10
|
+
|
|
11
|
+
export const CellInput = styled(Input2)`
|
|
12
|
+
input {
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
box-shadow: none;
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
input.${Classes.INPUT}:focus {
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
outline: none;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export const CellNumericInput = styled(NumericInput)`
|
|
25
|
+
margin-top: 1px;
|
|
26
|
+
margin-right: 1px;
|
|
27
|
+
|
|
28
|
+
input {
|
|
29
|
+
background-color: transparent;
|
|
30
|
+
box-shadow: none;
|
|
31
|
+
outline: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input.${Classes.INPUT}:focus {
|
|
35
|
+
box-shadow: none;
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.${Classes.CONTROL_GROUP} .${Classes.BUTTON_GROUP}.${Classes.VERTICAL} {
|
|
40
|
+
border-left: 1px dotted lightgray;
|
|
41
|
+
|
|
42
|
+
> .${Classes.BUTTON} {
|
|
43
|
+
margin: 0 !important;
|
|
44
|
+
border-radius: 0;
|
|
45
|
+
background: transparent;
|
|
46
|
+
box-shadow: none;
|
|
47
|
+
|
|
48
|
+
:first-of-type {
|
|
49
|
+
border-bottom: 1px dotted lightgray;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export const CellCheckbox = styled(Checkbox)`
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
|
|
60
|
+
&.${Classes.CONTROL} {
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin: 0;
|
|
63
|
+
|
|
64
|
+
.${Classes.CONTROL_INDICATOR} {
|
|
65
|
+
margin: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
export function CellColorPicker(
|
|
71
|
+
props: ComponentProps<typeof ColorPickerDropdown>,
|
|
72
|
+
) {
|
|
73
|
+
return (
|
|
74
|
+
<CellColorPickerContainer>
|
|
75
|
+
<ColorPickerDropdown {...props} />
|
|
76
|
+
</CellColorPickerContainer>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
const CellColorPickerContainer = styled.div`
|
|
80
|
+
.${Classes.POPOVER_TARGET} button {
|
|
81
|
+
border: none;
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
export const CellActions = styled.div`
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
gap: 0.25em;
|
|
90
|
+
margin-left: 3px;
|
|
91
|
+
margin-right: 2px;
|
|
92
|
+
`;
|
|
93
|
+
|
|
94
|
+
export function CellActionsButton(props: ButtonProps) {
|
|
95
|
+
const { size = 'small', variant = 'minimal' } = props;
|
|
96
|
+
|
|
97
|
+
return <Button {...props} size={size} variant={variant} />;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
101
|
+
|
|
102
|
+
type TableSettingsProps<Data extends RowData> = MakeRequired<
|
|
103
|
+
TableProps<Data>,
|
|
104
|
+
'getRowId'
|
|
105
|
+
>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Return stylized table.
|
|
109
|
+
* It set `compact`, `bordered` and `stickyHeader` props to true by default.
|
|
110
|
+
* It adds supports for `tdStyle` `meta` property in columns definition.
|
|
111
|
+
* It needs a mandatory ` getRowId ` prop.
|
|
112
|
+
* Table with fields in the columns is known to cause issue if the row key is index.
|
|
113
|
+
* use `withUUID` validation helper to have items with uuid
|
|
114
|
+
*/
|
|
115
|
+
export function TableSettings<Data extends RowData>(
|
|
116
|
+
props: TableSettingsProps<Data>,
|
|
117
|
+
) {
|
|
118
|
+
// We should not create a component in another component,
|
|
119
|
+
// But here it's OK, it is just an alias to fix the type
|
|
120
|
+
const Table = TableSettingsStyled as StyledComponent<
|
|
121
|
+
TableSettingsProps<Data>
|
|
122
|
+
>;
|
|
123
|
+
|
|
124
|
+
return <Table compact bordered stickyHeader {...props} />;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const TableSettingsStyled = styled(Table)`
|
|
128
|
+
overflow: auto;
|
|
129
|
+
|
|
130
|
+
${(props) => (props.bordered ? `border: 1px solid #11141826;` : '')}
|
|
131
|
+
|
|
132
|
+
&.${Classes.HTML_TABLE} {
|
|
133
|
+
font-size: 12px;
|
|
134
|
+
width: 100%;
|
|
135
|
+
|
|
136
|
+
thead th {
|
|
137
|
+
padding: 2px 8px;
|
|
138
|
+
text-align: center;
|
|
139
|
+
vertical-align: bottom;
|
|
140
|
+
font-weight: bold;
|
|
141
|
+
|
|
142
|
+
/* See getThProps in react-science table_header_cell */
|
|
143
|
+
> div > div {
|
|
144
|
+
flex: 1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
tbody {
|
|
149
|
+
tr:active {
|
|
150
|
+
background-color: #f5f5f5;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
tr:hover {
|
|
154
|
+
background-color: #f7f7f7;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
td {
|
|
158
|
+
padding: 0;
|
|
159
|
+
vertical-align: middle;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
const Section = styled.section`
|
|
5
|
+
margin-top: 15px;
|
|
6
|
+
gap: 5px;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
|
|
10
|
+
> header {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
|
|
14
|
+
> h2 {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
align-items: baseline;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
font-size: 1rem;
|
|
20
|
+
line-height: 1.75rem;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const Actions = styled.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 0.5em;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
interface TableSectionProps {
|
|
31
|
+
title: ReactNode;
|
|
32
|
+
description?: ReactNode;
|
|
33
|
+
actions?: ReactNode;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export function TableSection(props: TableSectionProps) {
|
|
37
|
+
const { title, description, actions, children } = props;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Section>
|
|
41
|
+
<header>
|
|
42
|
+
<h2>
|
|
43
|
+
{title}
|
|
44
|
+
{actions && <Actions>{actions}</Actions>}
|
|
45
|
+
</h2>
|
|
46
|
+
{description && <p>{description}</p>}
|
|
47
|
+
</header>
|
|
48
|
+
|
|
49
|
+
{children}
|
|
50
|
+
</Section>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Filters1D, Filters2D } from 'nmr-processing';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
|
|
4
|
+
const filtersEnumNames = [
|
|
5
|
+
...Object.values(Filters1D).map((f) => f.name),
|
|
6
|
+
...Object.values(Filters2D).map((f) => f.name),
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
const outputFiltersValidation = z
|
|
10
|
+
.array(
|
|
11
|
+
z.object({
|
|
12
|
+
name: z.enum(filtersEnumNames),
|
|
13
|
+
enabled: z.boolean().optional(),
|
|
14
|
+
}),
|
|
15
|
+
)
|
|
16
|
+
.optional();
|
|
17
|
+
|
|
18
|
+
const inputFiltersElement = z
|
|
19
|
+
.object({
|
|
20
|
+
apodization: z.boolean().optional(),
|
|
21
|
+
apodizationDimension1: z.boolean().optional(),
|
|
22
|
+
apodizationDimension2: z.boolean().optional(),
|
|
23
|
+
backwardLinearPrediction: z.boolean().optional(),
|
|
24
|
+
baselineCorrection: z.boolean().optional(),
|
|
25
|
+
baselineCorrectionTwoDimensions: z.boolean().optional(),
|
|
26
|
+
blpDimension1: z.boolean().optional(),
|
|
27
|
+
blpDimension2: z.boolean().optional(),
|
|
28
|
+
digitalFilter: z.boolean().optional(),
|
|
29
|
+
digitalFilter2D: z.boolean().optional(),
|
|
30
|
+
equallySpaced: z.boolean().optional(),
|
|
31
|
+
exclusionZones: z.boolean().optional(),
|
|
32
|
+
fft: z.boolean().optional(),
|
|
33
|
+
fftDimension1: z.boolean().optional(),
|
|
34
|
+
fftDimension2: z.boolean().optional(),
|
|
35
|
+
flpDimension1: z.boolean().optional(),
|
|
36
|
+
flpDimension2: z.boolean().optional(),
|
|
37
|
+
forwardLinearPrediction: z.boolean().optional(),
|
|
38
|
+
nusDimension2: z.boolean().optional(),
|
|
39
|
+
phaseCorrection: z.boolean().optional(),
|
|
40
|
+
phaseCorrectionTwoDimensions: z.boolean().optional(),
|
|
41
|
+
shift2DX: z.boolean().optional(),
|
|
42
|
+
shift2DY: z.boolean().optional(),
|
|
43
|
+
shiftX: z.boolean().optional(),
|
|
44
|
+
signalProcessing: z.boolean().optional(),
|
|
45
|
+
symmetrizeCosyLike: z.boolean().optional(),
|
|
46
|
+
trim: z.boolean().optional(),
|
|
47
|
+
zeroFilling: z.boolean().optional(),
|
|
48
|
+
zeroFillingDimension1: z.boolean().optional(),
|
|
49
|
+
zeroFillingDimension2: z.boolean().optional(),
|
|
50
|
+
})
|
|
51
|
+
.optional();
|
|
52
|
+
|
|
53
|
+
const filtersCodec = z.codec(inputFiltersElement, outputFiltersValidation, {
|
|
54
|
+
encode: (value) => {
|
|
55
|
+
if (!value) return undefined;
|
|
56
|
+
|
|
57
|
+
const entries = value.map((item) => [item.name, item.enabled]);
|
|
58
|
+
return Object.fromEntries(entries);
|
|
59
|
+
},
|
|
60
|
+
decode: (value) => {
|
|
61
|
+
if (!value) return undefined;
|
|
62
|
+
|
|
63
|
+
return Object.entries(value).map(([name, enabled]) => ({
|
|
64
|
+
name: name as (typeof filtersEnumNames)[number],
|
|
65
|
+
enabled,
|
|
66
|
+
}));
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const autoProcessingTabValidation = z.object({
|
|
71
|
+
autoProcessing: z.boolean(),
|
|
72
|
+
filters: z.record(z.string(), filtersCodec).optional(),
|
|
73
|
+
});
|
package/src/component/modal/setting/tanstack_general_settings/validation/database_tab_validation.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
|
|
3
|
+
import { checkUniqueByKey } from './check_unique_by_key.ts';
|
|
4
|
+
|
|
5
|
+
export const databasesValidation = z.object({
|
|
6
|
+
defaultDatabase: z.string(),
|
|
7
|
+
data: z
|
|
8
|
+
.array(
|
|
9
|
+
z.object({
|
|
10
|
+
key: z.string(),
|
|
11
|
+
label: z.string(),
|
|
12
|
+
url: z.string(),
|
|
13
|
+
enabled: z.boolean(),
|
|
14
|
+
}),
|
|
15
|
+
)
|
|
16
|
+
.superRefine((data, ctx) => {
|
|
17
|
+
checkUniqueByKey({
|
|
18
|
+
data,
|
|
19
|
+
checkKey: 'key',
|
|
20
|
+
context: ctx,
|
|
21
|
+
});
|
|
22
|
+
}),
|
|
23
|
+
});
|
package/src/component/modal/setting/tanstack_general_settings/validation/external_apis_validation.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EXTERNAL_API_KEYS } from '@zakodium/nmrium-core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import { withUUID } from './utils.ts';
|
|
5
|
+
|
|
6
|
+
const externalAPIValidation = z.object({
|
|
7
|
+
key: z.enum(EXTERNAL_API_KEYS.map(({ key }) => key)),
|
|
8
|
+
serverLink: z.url(),
|
|
9
|
+
APIKey: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export const externalAPIWithUUIDValidation = withUUID(externalAPIValidation);
|
|
12
|
+
export const externalAPIsValidation = z.array(externalAPIWithUUIDValidation);
|
package/src/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
import type { LoggerType } from '../../../../context/LoggerContext.js';
|
|
4
4
|
|
|
5
|
+
import { panelPreferencesTypeValidation } from './panels_tab_validation.ts';
|
|
6
|
+
|
|
5
7
|
const loggingLevel: LoggerType[] = [
|
|
6
8
|
'fatal',
|
|
7
9
|
'error',
|
|
@@ -13,7 +15,7 @@ const loggingLevel: LoggerType[] = [
|
|
|
13
15
|
];
|
|
14
16
|
|
|
15
17
|
export const peaksLabelValidation = z.object({
|
|
16
|
-
marginTop: z.coerce.number()
|
|
18
|
+
marginTop: z.coerce.number(),
|
|
17
19
|
});
|
|
18
20
|
|
|
19
21
|
export const generalValidation = z.object({
|
|
@@ -32,11 +34,7 @@ export const generalValidation = z.object({
|
|
|
32
34
|
|
|
33
35
|
export const displayGeneralValidation = z
|
|
34
36
|
.object({
|
|
35
|
-
experimentalFeatures:
|
|
36
|
-
.object({
|
|
37
|
-
display: z.boolean(),
|
|
38
|
-
})
|
|
39
|
-
.optional(),
|
|
37
|
+
experimentalFeatures: panelPreferencesTypeValidation,
|
|
40
38
|
hidePanelsBar: z.boolean().optional(),
|
|
41
39
|
})
|
|
42
40
|
.optional();
|
package/src/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
import { checkUniqueByKey } from '
|
|
3
|
+
import { checkUniqueByKey } from './check_unique_by_key.js';
|
|
4
|
+
import { withUUID } from './utils.ts';
|
|
4
5
|
|
|
5
6
|
export const nucleiValidation = z
|
|
6
7
|
.array(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
withUUID(
|
|
9
|
+
z.object({
|
|
10
|
+
nucleus: z.string({ error: 'Nucleus is a required field' }),
|
|
11
|
+
ppmFormat: z.string({ error: 'PPM format is a required field' }),
|
|
12
|
+
hzFormat: z.string({ error: 'Hz format is a required field' }),
|
|
13
|
+
axisFrom: z.coerce.number<string>().optional(),
|
|
14
|
+
axisTo: z.coerce.number<string>().optional(),
|
|
15
|
+
}),
|
|
16
|
+
),
|
|
14
17
|
)
|
|
15
18
|
.superRefine((nuclei, ctx) => {
|
|
16
19
|
checkUniqueByKey({
|
package/src/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.ts
CHANGED
|
@@ -8,20 +8,26 @@ export const displayPanelsStatus = [
|
|
|
8
8
|
];
|
|
9
9
|
|
|
10
10
|
type PanelStatus = (typeof displayPanelsStatus)[number]['value'];
|
|
11
|
-
const panelStatusValidation = z.enum(
|
|
11
|
+
const panelStatusValidation = z.enum([
|
|
12
|
+
...displayPanelsStatus.map((s) => s.value),
|
|
13
|
+
'undefined',
|
|
14
|
+
]);
|
|
12
15
|
|
|
16
|
+
export const panelPreferencesTypeValidation = z
|
|
17
|
+
.object({
|
|
18
|
+
display: z.boolean(),
|
|
19
|
+
visible: z.boolean(),
|
|
20
|
+
open: z.boolean().optional(),
|
|
21
|
+
})
|
|
22
|
+
.optional();
|
|
13
23
|
const panelCodec = z.codec(
|
|
14
24
|
panelStatusValidation,
|
|
15
|
-
|
|
16
|
-
.object({
|
|
17
|
-
display: z.boolean(),
|
|
18
|
-
visible: z.boolean(),
|
|
19
|
-
open: z.boolean().optional(),
|
|
20
|
-
})
|
|
21
|
-
.optional(),
|
|
25
|
+
panelPreferencesTypeValidation,
|
|
22
26
|
{
|
|
23
27
|
encode: (status) => {
|
|
24
|
-
|
|
28
|
+
if (!status) return 'undefined';
|
|
29
|
+
|
|
30
|
+
const { display = false, visible = false, open = false } = status;
|
|
25
31
|
let value: PanelStatus = 'hidden';
|
|
26
32
|
const isActive = visible && display;
|
|
27
33
|
|
|
@@ -36,6 +42,8 @@ const panelCodec = z.codec(
|
|
|
36
42
|
return value;
|
|
37
43
|
},
|
|
38
44
|
decode: (status) => {
|
|
45
|
+
if (status === 'undefined') return undefined;
|
|
46
|
+
|
|
39
47
|
let visible = false;
|
|
40
48
|
let display = false;
|
|
41
49
|
let open = false;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
|
|
3
|
+
import { jpathCodec, withUUID } from './utils.ts';
|
|
4
|
+
|
|
5
|
+
const spectraColorsTabOneDimensionValidation = z.object({
|
|
6
|
+
jpath: jpathCodec,
|
|
7
|
+
value: z.string(),
|
|
8
|
+
color: z.string(),
|
|
9
|
+
});
|
|
10
|
+
export const spectraColorsTabOneDimensionWithUUIDValidation = withUUID(
|
|
11
|
+
spectraColorsTabOneDimensionValidation,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const spectraColorsTabTwoDimensionValidation = z.object({
|
|
15
|
+
jpath: jpathCodec,
|
|
16
|
+
value: z.string(),
|
|
17
|
+
positiveColor: z.string(),
|
|
18
|
+
negativeColor: z.string(),
|
|
19
|
+
});
|
|
20
|
+
export const spectraColorsTabTwoDimensionWithUUIDValidation = withUUID(
|
|
21
|
+
spectraColorsTabTwoDimensionValidation,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const spectraColorsTabValidation = z.object({
|
|
25
|
+
highlightColor: z.string(),
|
|
26
|
+
indicatorLineColor: z.string(),
|
|
27
|
+
oneDimension: z.array(spectraColorsTabOneDimensionWithUUIDValidation),
|
|
28
|
+
twoDimensions: z.array(spectraColorsTabTwoDimensionWithUUIDValidation),
|
|
29
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { svgTextStyleFieldsSchema } from 'react-science/ui';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import { jpathCodec, withUUID } from './utils.ts';
|
|
5
|
+
|
|
6
|
+
const infoBlockFieldTabValidation = z.object({
|
|
7
|
+
format: z.string(),
|
|
8
|
+
jpath: jpathCodec,
|
|
9
|
+
visible: z.boolean(),
|
|
10
|
+
label: z.string().min(1),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const infoBlockFieldTabValidationWithUUID = withUUID(
|
|
14
|
+
infoBlockFieldTabValidation,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const infoBlockFieldsTabValidation = z.array(
|
|
18
|
+
infoBlockFieldTabValidationWithUUID,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const infoBlockTabValidation = z.object({
|
|
22
|
+
visible: z.boolean(),
|
|
23
|
+
fields: infoBlockFieldsTabValidation,
|
|
24
|
+
nameStyle: svgTextStyleFieldsSchema.optional(),
|
|
25
|
+
valueStyle: svgTextStyleFieldsSchema.optional(),
|
|
26
|
+
});
|
package/src/component/modal/setting/tanstack_general_settings/validation/tools_tab_validation.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const toolBarButtonsValidation = z
|
|
4
|
+
.object({
|
|
5
|
+
zoom: z.boolean().optional(),
|
|
6
|
+
zoomOut: z.boolean().optional(),
|
|
7
|
+
import: z.boolean().optional(),
|
|
8
|
+
exportAs: z.boolean().optional(),
|
|
9
|
+
spectraStackAlignments: z.boolean().optional(),
|
|
10
|
+
spectraCenterAlignments: z.boolean().optional(),
|
|
11
|
+
realImaginary: z.boolean().optional(),
|
|
12
|
+
peakPicking: z.boolean().optional(),
|
|
13
|
+
integral: z.boolean().optional(),
|
|
14
|
+
zonePicking: z.boolean().optional(),
|
|
15
|
+
slicing: z.boolean().optional(),
|
|
16
|
+
rangePicking: z.boolean().optional(),
|
|
17
|
+
zeroFilling: z.boolean().optional(),
|
|
18
|
+
zeroFillingDimension1: z.boolean().optional(),
|
|
19
|
+
zeroFillingDimension2: z.boolean().optional(),
|
|
20
|
+
apodization: z.boolean().optional(),
|
|
21
|
+
apodizationDimension1: z.boolean().optional(),
|
|
22
|
+
apodizationDimension2: z.boolean().optional(),
|
|
23
|
+
phaseCorrection: z.boolean().optional(),
|
|
24
|
+
phaseCorrectionTwoDimensions: z.boolean().optional(),
|
|
25
|
+
baselineCorrection: z.boolean().optional(),
|
|
26
|
+
fft: z.boolean().optional(),
|
|
27
|
+
fftDimension1: z.boolean().optional(),
|
|
28
|
+
fftDimension2: z.boolean().optional(),
|
|
29
|
+
multipleSpectraAnalysis: z.boolean().optional(),
|
|
30
|
+
exclusionZones: z.boolean().optional(),
|
|
31
|
+
autoRangeAndZonePicking: z.boolean().optional(),
|
|
32
|
+
inset: z.boolean().optional(),
|
|
33
|
+
})
|
|
34
|
+
.optional();
|