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,210 @@
|
|
|
1
|
+
import { Classes } from '@blueprintjs/core';
|
|
2
|
+
import { useField } from '@tanstack/react-form';
|
|
3
|
+
import { createColumnHelper } from '@tanstack/react-table';
|
|
4
|
+
import { useCallback, useMemo } from 'react';
|
|
5
|
+
import { FaLink, FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
6
|
+
import { Button, withForm } from 'react-science/ui';
|
|
7
|
+
import type { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
import { isGoogleDocument } from '../../../../utility/isGoogleDocument.ts';
|
|
10
|
+
import {
|
|
11
|
+
CellActions,
|
|
12
|
+
CellActionsButton,
|
|
13
|
+
CellCheckbox,
|
|
14
|
+
CellInput,
|
|
15
|
+
TableSettings,
|
|
16
|
+
} from '../ui/table.tsx';
|
|
17
|
+
import { TableSection } from '../ui/table_section.tsx';
|
|
18
|
+
import type { databasesValidation } from '../validation/database_tab_validation.ts';
|
|
19
|
+
import { defaultGeneralSettingsFormValues } from '../validation.ts';
|
|
20
|
+
|
|
21
|
+
type DatabaseForm = z.input<typeof databasesValidation>;
|
|
22
|
+
type DatabaseFormElement = DatabaseForm['data'][number];
|
|
23
|
+
|
|
24
|
+
function emptyDatabaseFormElement(): DatabaseFormElement {
|
|
25
|
+
return {
|
|
26
|
+
key: crypto.randomUUID(),
|
|
27
|
+
label: '',
|
|
28
|
+
url: '',
|
|
29
|
+
enabled: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const DatabaseTab = withForm({
|
|
34
|
+
defaultValues: defaultGeneralSettingsFormValues,
|
|
35
|
+
render: function Render({ form }) {
|
|
36
|
+
const field = useField({ form, name: 'databases.data', mode: 'array' });
|
|
37
|
+
const { removeValue, insertValue } = field;
|
|
38
|
+
const { resetField, Field } = form;
|
|
39
|
+
|
|
40
|
+
const handleDelete = useCallback(
|
|
41
|
+
(index: number) => {
|
|
42
|
+
removeValue(index);
|
|
43
|
+
},
|
|
44
|
+
[removeValue],
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const handleAdd = useCallback(
|
|
48
|
+
(index: number) => {
|
|
49
|
+
insertValue(index, emptyDatabaseFormElement());
|
|
50
|
+
},
|
|
51
|
+
[insertValue],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const handleReset = useCallback(() => {
|
|
55
|
+
resetField('databases');
|
|
56
|
+
}, [resetField]);
|
|
57
|
+
|
|
58
|
+
const COLUMNS = useMemo(() => {
|
|
59
|
+
const helper = createColumnHelper<DatabaseFormElement>();
|
|
60
|
+
return [
|
|
61
|
+
helper.accessor('label', {
|
|
62
|
+
meta: {
|
|
63
|
+
thStyle: {
|
|
64
|
+
minWidth: '100px',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
cell: ({ row: { index } }) => (
|
|
68
|
+
<Field key={index} name={`databases.data[${index}].label`}>
|
|
69
|
+
{(subField) => (
|
|
70
|
+
<CellInput
|
|
71
|
+
value={subField.state.value}
|
|
72
|
+
onChange={subField.handleChange}
|
|
73
|
+
onBlur={subField.handleBlur}
|
|
74
|
+
/>
|
|
75
|
+
)}
|
|
76
|
+
</Field>
|
|
77
|
+
),
|
|
78
|
+
}),
|
|
79
|
+
helper.accessor('url', {
|
|
80
|
+
header: 'URL',
|
|
81
|
+
meta: {
|
|
82
|
+
thStyle: {
|
|
83
|
+
width: '100%',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
cell: ({ row: { index } }) => (
|
|
87
|
+
<Field key={index} name={`databases.data[${index}].url`}>
|
|
88
|
+
{(subField) => (
|
|
89
|
+
<CellInput
|
|
90
|
+
value={subField.state.value}
|
|
91
|
+
onChange={subField.handleChange}
|
|
92
|
+
onBlur={subField.handleBlur}
|
|
93
|
+
/>
|
|
94
|
+
)}
|
|
95
|
+
</Field>
|
|
96
|
+
),
|
|
97
|
+
}),
|
|
98
|
+
helper.accessor('enabled', {
|
|
99
|
+
header: 'Enabled',
|
|
100
|
+
cell: ({ row: { index } }) => (
|
|
101
|
+
<Field key={index} name={`databases.data[${index}].enabled`}>
|
|
102
|
+
{(subField) => (
|
|
103
|
+
<CellCheckbox
|
|
104
|
+
checked={subField.state.value}
|
|
105
|
+
onChange={(event) => {
|
|
106
|
+
subField.handleChange(event.currentTarget.checked);
|
|
107
|
+
}}
|
|
108
|
+
onBlur={subField.handleBlur}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
</Field>
|
|
112
|
+
),
|
|
113
|
+
}),
|
|
114
|
+
helper.display({
|
|
115
|
+
id: 'defaultDatabase',
|
|
116
|
+
header: 'Auto Load',
|
|
117
|
+
cell: ({
|
|
118
|
+
row: {
|
|
119
|
+
index,
|
|
120
|
+
original: { key },
|
|
121
|
+
},
|
|
122
|
+
}) => (
|
|
123
|
+
<Field key={index} name="databases.defaultDatabase">
|
|
124
|
+
{(subField) => (
|
|
125
|
+
<CellCheckbox
|
|
126
|
+
name={subField.name}
|
|
127
|
+
value={key}
|
|
128
|
+
checked={subField.state.value === key}
|
|
129
|
+
onChange={() => {
|
|
130
|
+
subField.handleChange(
|
|
131
|
+
subField.state.value === key ? '' : key,
|
|
132
|
+
);
|
|
133
|
+
}}
|
|
134
|
+
onBlur={subField.handleBlur}
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
</Field>
|
|
138
|
+
),
|
|
139
|
+
}),
|
|
140
|
+
helper.display({
|
|
141
|
+
id: 'actions',
|
|
142
|
+
cell: ({ row: { index, original } }) => (
|
|
143
|
+
<CellActions>
|
|
144
|
+
<CellActionsButton
|
|
145
|
+
intent="success"
|
|
146
|
+
onClick={() => handleAdd(index + 1)}
|
|
147
|
+
>
|
|
148
|
+
<FaPlus className={Classes.ICON} />
|
|
149
|
+
</CellActionsButton>
|
|
150
|
+
<CellActionsButton
|
|
151
|
+
intent="danger"
|
|
152
|
+
onClick={() => handleDelete(index)}
|
|
153
|
+
>
|
|
154
|
+
<FaRegTrashAlt className={Classes.ICON} />
|
|
155
|
+
</CellActionsButton>
|
|
156
|
+
|
|
157
|
+
{isGoogleDocument(original.url) && (
|
|
158
|
+
<CellActionsButton
|
|
159
|
+
intent="primary"
|
|
160
|
+
onClick={() => window.open(original.url, '_blank')}
|
|
161
|
+
tooltipProps={{ content: 'Open document', compact: true }}
|
|
162
|
+
>
|
|
163
|
+
<FaLink className={Classes.ICON} />
|
|
164
|
+
</CellActionsButton>
|
|
165
|
+
)}
|
|
166
|
+
</CellActions>
|
|
167
|
+
),
|
|
168
|
+
}),
|
|
169
|
+
];
|
|
170
|
+
}, [Field, handleAdd, handleDelete]);
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<TableSection
|
|
174
|
+
title="Databases"
|
|
175
|
+
actions={
|
|
176
|
+
<>
|
|
177
|
+
<Button
|
|
178
|
+
size="small"
|
|
179
|
+
variant="minimal"
|
|
180
|
+
intent="danger"
|
|
181
|
+
onClick={handleReset}
|
|
182
|
+
>
|
|
183
|
+
Reset Databases
|
|
184
|
+
</Button>
|
|
185
|
+
|
|
186
|
+
<Button
|
|
187
|
+
size="small"
|
|
188
|
+
variant="outlined"
|
|
189
|
+
intent="success"
|
|
190
|
+
onClick={() => handleAdd(0)}
|
|
191
|
+
>
|
|
192
|
+
Add Database
|
|
193
|
+
</Button>
|
|
194
|
+
</>
|
|
195
|
+
}
|
|
196
|
+
>
|
|
197
|
+
<TableSettings
|
|
198
|
+
data={field.state.value}
|
|
199
|
+
columns={COLUMNS}
|
|
200
|
+
getRowId={getRowId}
|
|
201
|
+
emptyContent="No database item"
|
|
202
|
+
/>
|
|
203
|
+
</TableSection>
|
|
204
|
+
);
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
function getRowId(row: DatabaseFormElement) {
|
|
209
|
+
return row.key;
|
|
210
|
+
}
|
|
@@ -47,6 +47,33 @@ const layoutItems: Array<SelectItem<Layout>> = [
|
|
|
47
47
|
{ value: 'landscape', label: 'Landscape' },
|
|
48
48
|
];
|
|
49
49
|
|
|
50
|
+
function safeNumber(value: number) {
|
|
51
|
+
if (Number.isNaN(value)) value = 1;
|
|
52
|
+
else if (value <= 0) value = 1;
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function safeStringNumber(str: string, onInvalid: (str: string) => void) {
|
|
57
|
+
let isInvalid = false;
|
|
58
|
+
let value = Number(str);
|
|
59
|
+
if (Number.isNaN(value)) {
|
|
60
|
+
value = 1;
|
|
61
|
+
isInvalid = true;
|
|
62
|
+
}
|
|
63
|
+
if (value <= 0) {
|
|
64
|
+
value = 1;
|
|
65
|
+
isInvalid = true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!isInvalid) {
|
|
69
|
+
const result = String(value);
|
|
70
|
+
onInvalid(result);
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return str;
|
|
75
|
+
}
|
|
76
|
+
|
|
50
77
|
export const ExportFields = withFieldGroup({
|
|
51
78
|
defaultValues: defaultGeneralSettingsFormValues.export.png,
|
|
52
79
|
render: function ExportFields({ group }) {
|
|
@@ -68,14 +95,18 @@ export const ExportFields = withFieldGroup({
|
|
|
68
95
|
|
|
69
96
|
function onChangeUnit({ value }: { value: Unit }) {
|
|
70
97
|
const { width, height } = advancedTransforms.changeUnit({ unit: value });
|
|
71
|
-
group.setFieldValue('width', String(width), {
|
|
98
|
+
group.setFieldValue('width', String(safeNumber(width)), {
|
|
72
99
|
dontRunListeners: true,
|
|
73
100
|
});
|
|
74
|
-
group.setFieldValue('height', String(height), {
|
|
101
|
+
group.setFieldValue('height', String(safeNumber(height)), {
|
|
75
102
|
dontRunListeners: true,
|
|
76
103
|
});
|
|
77
104
|
}
|
|
78
105
|
function onWidthChange({ value }: { value: string }) {
|
|
106
|
+
value = safeStringNumber(value, (width) =>
|
|
107
|
+
group.setFieldValue('width', width, { dontRunListeners: true }),
|
|
108
|
+
);
|
|
109
|
+
|
|
79
110
|
const height = advancedTransforms.changeSize(
|
|
80
111
|
Number(value),
|
|
81
112
|
'height',
|
|
@@ -84,11 +115,15 @@ export const ExportFields = withFieldGroup({
|
|
|
84
115
|
if (!advancedTransforms.isAspectRatioEnabled) {
|
|
85
116
|
return;
|
|
86
117
|
}
|
|
87
|
-
group.setFieldValue('height', String(height), {
|
|
118
|
+
group.setFieldValue('height', String(safeNumber(height)), {
|
|
88
119
|
dontRunListeners: true,
|
|
89
120
|
});
|
|
90
121
|
}
|
|
91
122
|
function onHeightChange({ value }: { value: string }) {
|
|
123
|
+
value = safeStringNumber(value, (height) =>
|
|
124
|
+
group.setFieldValue('height', height, { dontRunListeners: true }),
|
|
125
|
+
);
|
|
126
|
+
|
|
92
127
|
const width = advancedTransforms.changeSize(
|
|
93
128
|
Number(value),
|
|
94
129
|
'width',
|
|
@@ -97,20 +132,23 @@ export const ExportFields = withFieldGroup({
|
|
|
97
132
|
if (!advancedTransforms.isAspectRatioEnabled) {
|
|
98
133
|
return;
|
|
99
134
|
}
|
|
100
|
-
group.setFieldValue('width', String(width), {
|
|
135
|
+
group.setFieldValue('width', String(safeNumber(width)), {
|
|
101
136
|
dontRunListeners: true,
|
|
102
137
|
});
|
|
103
138
|
}
|
|
104
139
|
|
|
105
140
|
function onDPIChange({ value }: { value: string }) {
|
|
106
|
-
if (
|
|
107
|
-
if (
|
|
141
|
+
if (inputValues.mode !== 'advance') return;
|
|
142
|
+
if (inputValues.unit !== 'px') return;
|
|
108
143
|
|
|
144
|
+
value = safeStringNumber(value, (dpi) =>
|
|
145
|
+
group.setFieldValue('dpi', dpi, { dontRunListeners: true }),
|
|
146
|
+
);
|
|
109
147
|
const { width, height } = advancedTransforms.changeDPI(Number(value));
|
|
110
|
-
group.setFieldValue('width', String(width), {
|
|
148
|
+
group.setFieldValue('width', String(safeNumber(width)), {
|
|
111
149
|
dontRunListeners: true,
|
|
112
150
|
});
|
|
113
|
-
group.setFieldValue('height', String(height), {
|
|
151
|
+
group.setFieldValue('height', String(safeNumber(height)), {
|
|
114
152
|
dontRunListeners: true,
|
|
115
153
|
});
|
|
116
154
|
}
|
|
@@ -179,6 +217,7 @@ export const ExportFields = withFieldGroup({
|
|
|
179
217
|
{({ NumericInput }) => (
|
|
180
218
|
<NumericInput
|
|
181
219
|
label="Width"
|
|
220
|
+
min={1}
|
|
182
221
|
rightElement={<Tag>{unit}</Tag>}
|
|
183
222
|
/>
|
|
184
223
|
)}
|
|
@@ -190,6 +229,7 @@ export const ExportFields = withFieldGroup({
|
|
|
190
229
|
{({ NumericInput }) => (
|
|
191
230
|
<NumericInput
|
|
192
231
|
label="Height"
|
|
232
|
+
min={1}
|
|
193
233
|
rightElement={<Tag>{unit}</Tag>}
|
|
194
234
|
/>
|
|
195
235
|
)}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Classes } from '@blueprintjs/core';
|
|
2
|
+
import { useField } from '@tanstack/react-form';
|
|
3
|
+
import { createColumnHelper } from '@tanstack/react-table';
|
|
4
|
+
import { EXTERNAL_API_KEYS } from '@zakodium/nmrium-core';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import { FaPlus, FaRegTrashAlt } from 'react-icons/fa';
|
|
7
|
+
import { Button, withForm } from 'react-science/ui';
|
|
8
|
+
import type { z } from 'zod';
|
|
9
|
+
|
|
10
|
+
import { Select2 } from '../../../../elements/Select2.js';
|
|
11
|
+
import {
|
|
12
|
+
CellActions,
|
|
13
|
+
CellActionsButton,
|
|
14
|
+
CellInput,
|
|
15
|
+
TableSettings,
|
|
16
|
+
} from '../ui/table.js';
|
|
17
|
+
import { TableSection } from '../ui/table_section.js';
|
|
18
|
+
import type { externalAPIWithUUIDValidation } from '../validation/external_apis_validation.js';
|
|
19
|
+
import { defaultGeneralSettingsFormValues } from '../validation.js';
|
|
20
|
+
|
|
21
|
+
type API = z.input<typeof externalAPIWithUUIDValidation>;
|
|
22
|
+
function emptyApi(): API {
|
|
23
|
+
return { key: 'CT', serverLink: '', APIKey: '', uuid: crypto.randomUUID() };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const itemsAPI = EXTERNAL_API_KEYS.slice();
|
|
27
|
+
|
|
28
|
+
export const ExternalApiTab = withForm({
|
|
29
|
+
defaultValues: defaultGeneralSettingsFormValues,
|
|
30
|
+
render: function ExternalApiTab({ form }) {
|
|
31
|
+
const { Field } = form;
|
|
32
|
+
const field = useField({ form, name: 'externalAPIs', mode: 'array' });
|
|
33
|
+
const { name, pushValue, insertValue, removeValue } = field;
|
|
34
|
+
|
|
35
|
+
const columns = useMemo(() => {
|
|
36
|
+
const helper = createColumnHelper<API>();
|
|
37
|
+
return [
|
|
38
|
+
helper.accessor('key', {
|
|
39
|
+
header: 'Service',
|
|
40
|
+
cell: ({ row: { index } }) => (
|
|
41
|
+
<Field name={`${name}[${index}].key`}>
|
|
42
|
+
{(field) => (
|
|
43
|
+
<Select2
|
|
44
|
+
items={itemsAPI}
|
|
45
|
+
itemValueKey="key"
|
|
46
|
+
itemTextKey="description"
|
|
47
|
+
selectedItemValue={field.state.value}
|
|
48
|
+
onItemSelect={({ key }) => field.handleChange(key)}
|
|
49
|
+
intent={!field.state.meta.isValid ? 'danger' : 'none'}
|
|
50
|
+
fill
|
|
51
|
+
/>
|
|
52
|
+
)}
|
|
53
|
+
</Field>
|
|
54
|
+
),
|
|
55
|
+
}),
|
|
56
|
+
helper.accessor('serverLink', {
|
|
57
|
+
header: 'Server link',
|
|
58
|
+
cell: ({ row: { index } }) => (
|
|
59
|
+
<Field name={`${name}[${index}].serverLink`}>
|
|
60
|
+
{(field) => (
|
|
61
|
+
<CellInput
|
|
62
|
+
name={field.name}
|
|
63
|
+
value={field.state.value}
|
|
64
|
+
onChange={field.handleChange}
|
|
65
|
+
onBlur={field.handleBlur}
|
|
66
|
+
intent={
|
|
67
|
+
!field.state.meta.isValid && field.state.meta.isDirty
|
|
68
|
+
? 'danger'
|
|
69
|
+
: 'none'
|
|
70
|
+
}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
</Field>
|
|
74
|
+
),
|
|
75
|
+
}),
|
|
76
|
+
helper.accessor('APIKey', {
|
|
77
|
+
header: 'API key',
|
|
78
|
+
cell: ({ row: { index } }) => (
|
|
79
|
+
<Field name={`${name}[${index}].APIKey`}>
|
|
80
|
+
{(field) => (
|
|
81
|
+
<CellInput
|
|
82
|
+
name={field.name}
|
|
83
|
+
value={field.state.value}
|
|
84
|
+
onChange={field.handleChange}
|
|
85
|
+
onBlur={field.handleBlur}
|
|
86
|
+
intent={
|
|
87
|
+
!field.state.meta.isValid && field.state.meta.isDirty
|
|
88
|
+
? 'danger'
|
|
89
|
+
: 'none'
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
</Field>
|
|
94
|
+
),
|
|
95
|
+
}),
|
|
96
|
+
helper.display({
|
|
97
|
+
id: 'actions',
|
|
98
|
+
header: '',
|
|
99
|
+
cell: ({ row: { index } }) => (
|
|
100
|
+
<CellActions>
|
|
101
|
+
<CellActionsButton
|
|
102
|
+
intent="success"
|
|
103
|
+
onClick={() => insertValue(index, emptyApi())}
|
|
104
|
+
>
|
|
105
|
+
<FaPlus className={Classes.ICON} />
|
|
106
|
+
</CellActionsButton>
|
|
107
|
+
<CellActionsButton
|
|
108
|
+
intent="danger"
|
|
109
|
+
onClick={() => removeValue(index)}
|
|
110
|
+
>
|
|
111
|
+
<FaRegTrashAlt className={Classes.ICON} />
|
|
112
|
+
</CellActionsButton>
|
|
113
|
+
</CellActions>
|
|
114
|
+
),
|
|
115
|
+
}),
|
|
116
|
+
];
|
|
117
|
+
}, [Field, insertValue, name, removeValue]);
|
|
118
|
+
|
|
119
|
+
function onAddField() {
|
|
120
|
+
pushValue(emptyApi());
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<TableSection
|
|
125
|
+
title="External APIs"
|
|
126
|
+
actions={
|
|
127
|
+
<Button
|
|
128
|
+
size="small"
|
|
129
|
+
variant="outlined"
|
|
130
|
+
intent="success"
|
|
131
|
+
onClick={onAddField}
|
|
132
|
+
>
|
|
133
|
+
Add an external API
|
|
134
|
+
</Button>
|
|
135
|
+
}
|
|
136
|
+
>
|
|
137
|
+
<TableSettings
|
|
138
|
+
data={field.state.value}
|
|
139
|
+
columns={columns}
|
|
140
|
+
getRowId={getRowId}
|
|
141
|
+
emptyContent="No external APIs"
|
|
142
|
+
/>
|
|
143
|
+
</TableSection>
|
|
144
|
+
);
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
function getRowId(row: API) {
|
|
149
|
+
return row.uuid;
|
|
150
|
+
}
|
|
@@ -47,15 +47,15 @@ export const GeneralTab = withForm({
|
|
|
47
47
|
)}
|
|
48
48
|
</form.AppField>
|
|
49
49
|
<form.AppField name="general.invert">
|
|
50
|
-
{(field) => <field.
|
|
50
|
+
{(field) => <field.Checkbox label="Invert actions" />}
|
|
51
51
|
</form.AppField>
|
|
52
52
|
<form.AppField name="general.invertScroll">
|
|
53
|
-
{(field) => <field.
|
|
53
|
+
{(field) => <field.Checkbox label="Invert scroll" />}
|
|
54
54
|
</form.AppField>
|
|
55
55
|
</form.Section>
|
|
56
56
|
<form.Section title="Experimental features">
|
|
57
57
|
<form.AppField name="display.general.experimentalFeatures.display">
|
|
58
|
-
{(field) => <field.
|
|
58
|
+
{(field) => <field.Checkbox label="Enable experimental features" />}
|
|
59
59
|
</form.AppField>
|
|
60
60
|
</form.Section>
|
|
61
61
|
<form.Section title="Rendering">
|