nmrium 0.37.0 → 0.38.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/FooterBanner.js +1 -1
- package/lib/component/1d/Viewer1D.js +26 -21
- package/lib/component/1d/integral/Integral.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.d.ts +2 -6
- package/lib/component/1d/integral/IntegralResizable.js +2 -3
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib/component/1d/ranges/Range.js +9 -8
- package/lib/component/1d/ranges/Ranges.js +5 -7
- package/lib/component/1d/tool/BaseLineZones.js +1 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib/component/2d/Chart2D.js +1 -1
- package/lib/component/2d/Viewer2D.js +10 -9
- package/lib/component/2d/fid/FidCanvas.js +4 -6
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/2d/utilities/DimensionLayout.d.ts +9 -24
- package/lib/component/2d/utilities/scale.d.ts +2 -1
- package/lib/component/2d/utilities/scale.js +1 -1
- package/lib/component/2d/zones/Zones.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib/component/NMRium.js +15 -7
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/context/DispatchContext.d.ts +23 -3
- package/lib/component/context/DispatchContext.js +1 -1
- package/lib/component/context/LoggerContext.js +1 -1
- package/lib/component/elements/Button.js +7 -9
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorInput.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib/component/elements/formik/FormikInput.js +1 -1
- package/lib/component/elements/formik/FormikSelect.js +2 -2
- package/lib/component/elements/formik/FormikSlider.js +1 -1
- package/lib/component/elements/formik/FormikTextarea.js +2 -2
- package/lib/component/header/ApodizationOptionsPanel.js +4 -5
- package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib/component/header/Header.js +4 -6
- package/lib/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib/component/header/Zones2DOptionPanel.js +5 -6
- package/lib/component/hooks/useExport.js +1 -0
- package/lib/component/hooks/useToolsFunctions.js +8 -10
- package/lib/component/loader/DropZone.js +4 -5
- package/lib/component/loader/NoData.js +1 -1
- package/lib/component/modal/AlignSpectraModal.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.js +1 -2
- package/lib/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib/component/modal/LoadJCAMPModal.js +2 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib/component/modal/PredictSpectraModal.js +24 -21
- package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib/component/panels/InformationPanel.js +6 -6
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +4 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/Panels.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.d.ts +2 -13
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +2 -2
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +3 -3
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +16 -0
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +52 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +9 -7
- package/lib/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib/component/reducer/IgnoreActions.d.ts +2 -1
- package/lib/component/reducer/IgnoreActions.js +35 -32
- package/lib/component/reducer/Reducer.d.ts +8 -5
- package/lib/component/reducer/Reducer.js +199 -221
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +7 -6
- package/lib/component/reducer/actions/AssignmentsActions.js +2 -2
- package/lib/component/reducer/actions/CorrelationsActions.d.ts +21 -13
- package/lib/component/reducer/actions/CorrelationsActions.js +25 -20
- package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -2
- package/lib/component/reducer/actions/DatabaseActions.js +5 -2
- package/lib/component/reducer/actions/DimensionsActions.d.ts +8 -3
- package/lib/component/reducer/actions/DimensionsActions.js +3 -5
- package/lib/component/reducer/actions/DomainActions.d.ts +11 -5
- package/lib/component/reducer/actions/DomainActions.js +13 -19
- package/lib/component/reducer/actions/FiltersActions.d.ts +70 -23
- package/lib/component/reducer/actions/FiltersActions.js +250 -255
- package/lib/component/reducer/actions/GlobalActions.d.ts +7 -2
- package/lib/component/reducer/actions/GlobalActions.js +3 -3
- package/lib/component/reducer/actions/IntegralsActions.d.ts +28 -7
- package/lib/component/reducer/actions/IntegralsActions.js +16 -15
- package/lib/component/reducer/actions/LoadActions.d.ts +23 -5
- package/lib/component/reducer/actions/LoadActions.js +52 -52
- package/lib/component/reducer/actions/MoleculeActions.d.ts +38 -9
- package/lib/component/reducer/actions/MoleculeActions.js +27 -18
- package/lib/component/reducer/actions/PeaksActions.d.ts +39 -8
- package/lib/component/reducer/actions/PeaksActions.js +19 -11
- package/lib/component/reducer/actions/PreferencesActions.d.ts +8 -3
- package/lib/component/reducer/actions/PreferencesActions.js +5 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +85 -18
- package/lib/component/reducer/actions/RangesActions.js +80 -65
- package/lib/component/reducer/actions/SpectraAnalysisAction.d.ts +7 -1
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +57 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +69 -60
- package/lib/component/reducer/actions/ToolsActions.d.ts +59 -21
- package/lib/component/reducer/actions/ToolsActions.js +54 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +79 -15
- package/lib/component/reducer/actions/ZonesActions.js +68 -49
- package/lib/component/reducer/helper/Zoom1DManager.d.ts +6 -5
- package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib/component/reducer/helper/get2DRange.d.ts +7 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/types/ActionType.d.ts +6 -0
- package/lib/component/reducer/types/ActionType.js +1 -0
- package/lib/component/toolbar/BasicToolBar.js +6 -9
- package/lib/component/toolbar/FunctionToolBar.js +4 -9
- package/lib/component/toolbar/ToolBar.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/utility/Events.d.ts +4 -4
- package/lib/component/utility/Events.js +2 -2
- package/lib/component/utility/GroupByInfoKey.js +1 -1
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/data/PredictionManager.d.ts +5 -8
- package/lib/data/PredictionManager.js +3 -3
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.d.ts +2 -3
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +1 -35
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +2 -35
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +7 -10
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.d.ts +5 -1
- package/lib/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +2 -0
- package/lib/data/matrixGeneration.js +4 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/MoleculeManager.d.ts +5 -5
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/utilities/generateColor.js +1 -1
- package/lib/data/utilities/isNumber.d.ts +1 -0
- package/lib/data/utilities/isNumber.js +3 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +25 -20
- package/lib-cjs/component/1d/integral/IntegralResizable.js +2 -3
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +7 -9
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -2
- package/lib-cjs/component/1d/ranges/Range.js +9 -8
- package/lib-cjs/component/1d/ranges/Ranges.js +5 -7
- package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -2
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +4 -5
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/index.js +13 -17
- package/lib-cjs/component/2d/1d-tracer/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/1d-tracer/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/Chart2D.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +10 -9
- package/lib-cjs/component/2d/fid/FidCanvas.js +4 -6
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/2d/utilities/scale.js +1 -1
- package/lib-cjs/component/2d/zones/Zones.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +28 -21
- package/lib-cjs/component/NMRium.js +15 -7
- package/lib-cjs/component/context/DispatchContext.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +1 -1
- package/lib-cjs/component/elements/Button.js +7 -9
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +1 -2
- package/lib-cjs/component/elements/Tab/Tabs.js +1 -1
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +1 -1
- package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSelect.js +2 -2
- package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
- package/lib-cjs/component/elements/formik/FormikTextarea.js +2 -2
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +3 -4
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +4 -5
- package/lib-cjs/component/header/Header.js +4 -6
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +7 -8
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +1 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -11
- package/lib-cjs/component/header/Zones2DOptionPanel.js +5 -6
- package/lib-cjs/component/highlight/index.js +1 -1
- package/lib-cjs/component/hooks/useExport.js +1 -0
- package/lib-cjs/component/hooks/useTableSortBy.js +1 -1
- package/lib-cjs/component/hooks/useToolsFunctions.js +8 -10
- package/lib-cjs/component/hooks/useXYReduce.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +4 -5
- package/lib-cjs/component/loader/NoData.js +1 -1
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -2
- package/lib-cjs/component/modal/EditPeakShapeModal.js +1 -2
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -3
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +24 -19
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -21
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +3 -4
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +2 -2
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +2 -3
- package/lib-cjs/component/modal/setting/settings-tabs/DatabasesTabContent.js +4 -4
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/InfoBlockTabContent.js +2 -2
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +1 -2
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +7 -6
- package/lib-cjs/component/panels/InformationPanel.js +6 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +11 -20
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -10
- package/lib-cjs/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +1 -1
- package/lib-cjs/component/panels/MatrixGenerationPanel/FiltersOptions.js +4 -4
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +10 -13
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -5
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +3 -4
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/LegendsPreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/Panels.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -5
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +4 -5
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +12 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +24 -29
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +16 -14
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +16 -16
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +7 -5
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +4 -5
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -7
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +4 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -8
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +39 -34
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +22 -20
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +6 -7
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +15 -18
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -51
- package/lib-cjs/component/panels/ZonesPanel/hooks/useMapZones.js +56 -0
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +8 -6
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +1 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +8 -9
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +1 -1
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +2 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +4 -5
- package/lib-cjs/component/reducer/IgnoreActions.js +35 -55
- package/lib-cjs/component/reducer/Reducer.js +199 -221
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +3 -3
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +23 -18
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +4 -1
- package/lib-cjs/component/reducer/actions/DimensionsActions.js +3 -6
- package/lib-cjs/component/reducer/actions/DomainActions.js +15 -23
- package/lib-cjs/component/reducer/actions/FiltersActions.js +267 -272
- package/lib-cjs/component/reducer/actions/GlobalActions.js +4 -4
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +19 -18
- package/lib-cjs/component/reducer/actions/LoadActions.js +55 -55
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +31 -22
- package/lib-cjs/component/reducer/actions/PeaksActions.js +23 -15
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +7 -5
- package/lib-cjs/component/reducer/actions/RangesActions.js +81 -64
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +77 -67
- package/lib-cjs/component/reducer/actions/ToolsActions.js +54 -31
- package/lib-cjs/component/reducer/actions/ZonesActions.js +73 -52
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +2 -2
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -2
- package/lib-cjs/component/reducer/types/ActionType.js +2 -0
- package/lib-cjs/component/toolbar/BasicToolBar.js +6 -9
- package/lib-cjs/component/toolbar/FunctionToolBar.js +4 -9
- package/lib-cjs/component/toolbar/ToolBar.js +1 -1
- package/lib-cjs/component/utility/GroupByInfoKey.js +1 -1
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/data/PredictionManager.js +3 -3
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +5 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +2 -2
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/changeZoneSignal.js +6 -8
- package/lib-cjs/data/matrixGeneration.js +4 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/generateColor.js +1 -1
- package/lib-cjs/data/utilities/isNumber.js +7 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +24 -23
- package/lib/component/reducer/actions/HistoryActions.d.ts +0 -4
- package/lib/component/reducer/actions/HistoryActions.js +0 -40
- package/lib/component/reducer/types/HistoryTypes.d.ts +0 -4
- package/lib/component/reducer/types/HistoryTypes.js +0 -4
- package/lib/component/reducer/types/Types.d.ts +0 -132
- package/lib/component/reducer/types/Types.js +0 -126
- package/lib/component/toolbar/HistoryToolBar.d.ts +0 -8
- package/lib/component/toolbar/HistoryToolBar.js +0 -30
- package/lib/data/utilities/isMolFileEmpty.d.ts +0 -1
- package/lib/data/utilities/isMolFileEmpty.js +0 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +0 -45
- package/lib-cjs/component/reducer/types/HistoryTypes.js +0 -7
- package/lib-cjs/component/reducer/types/Types.js +0 -131
- package/lib-cjs/component/toolbar/HistoryToolBar.js +0 -35
- package/lib-cjs/data/utilities/isMolFileEmpty.js +0 -10
|
@@ -5,8 +5,6 @@ import { useToggleAccordion } from 'react-science/ui';
|
|
|
5
5
|
import { useDispatch } from '../context/DispatchContext';
|
|
6
6
|
import { useAlert } from '../elements/popup/Alert';
|
|
7
7
|
import { TOOLS_PANELS_ACCORDION } from '../panels/Panels';
|
|
8
|
-
import { ZoomType } from '../reducer/helper/Zoom1DManager';
|
|
9
|
-
import { CHANGE_SPECTRUM_DISPLAY_VIEW_MODE, FULL_ZOOM_OUT, SET_SELECTED_TOOL, SET_SPECTRUMS_VERTICAL_ALIGN, TOGGLE_REAL_IMAGINARY_VISIBILITY, } from '../reducer/types/Types';
|
|
10
8
|
import { options } from '../toolbar/ToolTypes';
|
|
11
9
|
export default function useToolsFunctions() {
|
|
12
10
|
const dispatch = useDispatch();
|
|
@@ -28,15 +26,15 @@ export default function useToolsFunctions() {
|
|
|
28
26
|
openPanel(TOOLS_PANELS_ACCORDION[selectedTool]);
|
|
29
27
|
}
|
|
30
28
|
dispatch({
|
|
31
|
-
type: SET_SELECTED_TOOL,
|
|
29
|
+
type: 'SET_SELECTED_TOOL',
|
|
32
30
|
payload: { selectedTool: selectedTool || options.zoom.id },
|
|
33
31
|
});
|
|
34
32
|
}, [alert, dispatch, openPanel]);
|
|
35
33
|
const handleFullZoomOut = useCallback(() => {
|
|
36
34
|
if (debounceClickEventsRef.current.clicks.length === 0) {
|
|
37
35
|
dispatch({
|
|
38
|
-
type: FULL_ZOOM_OUT,
|
|
39
|
-
zoomType:
|
|
36
|
+
type: 'FULL_ZOOM_OUT',
|
|
37
|
+
payload: { zoomType: 'HORIZONTAL' },
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
40
|
const callback = lodashDebounce(() => {
|
|
@@ -48,25 +46,25 @@ export default function useToolsFunctions() {
|
|
|
48
46
|
lodashMap(debounceClickEventsRef.current.clicks, (debounce) => debounce.cancel());
|
|
49
47
|
debounceClickEventsRef.current.clicks = [];
|
|
50
48
|
dispatch({
|
|
51
|
-
type: FULL_ZOOM_OUT,
|
|
49
|
+
type: 'FULL_ZOOM_OUT',
|
|
50
|
+
payload: {},
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
53
|
}, [dispatch, debounceClickEventsRef]);
|
|
55
54
|
const changeDisplayViewModeHandler = useCallback(() => {
|
|
56
55
|
dispatch({
|
|
57
|
-
type: CHANGE_SPECTRUM_DISPLAY_VIEW_MODE,
|
|
56
|
+
type: 'CHANGE_SPECTRUM_DISPLAY_VIEW_MODE',
|
|
58
57
|
});
|
|
59
58
|
}, [dispatch]);
|
|
60
59
|
const changeSpectrumViewHandler = useCallback(() => {
|
|
61
60
|
dispatch({
|
|
62
|
-
type: TOGGLE_REAL_IMAGINARY_VISIBILITY,
|
|
63
|
-
isRealSpectrumVisible: !isRealSpectrumShown,
|
|
61
|
+
type: 'TOGGLE_REAL_IMAGINARY_VISIBILITY',
|
|
64
62
|
});
|
|
65
63
|
setIsRealSpectrumShown(!isRealSpectrumShown);
|
|
66
64
|
}, [dispatch, isRealSpectrumShown]);
|
|
67
65
|
const alignSpectrumsVerticallyHandler = useCallback(() => {
|
|
68
66
|
dispatch({
|
|
69
|
-
type: SET_SPECTRUMS_VERTICAL_ALIGN,
|
|
67
|
+
type: 'SET_SPECTRUMS_VERTICAL_ALIGN',
|
|
70
68
|
});
|
|
71
69
|
}, [dispatch]);
|
|
72
70
|
return {
|
|
@@ -15,7 +15,6 @@ import { usePreferences } from '../context/PreferencesContext';
|
|
|
15
15
|
import { useAlert } from '../elements/popup/Alert';
|
|
16
16
|
import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
|
|
17
17
|
import { useMetaInformationImportationModal } from '../modal/metaImportation/index';
|
|
18
|
-
import { SET_LOADING_FLAG, LOAD_DROP_FILES } from '../reducer/types/Types';
|
|
19
18
|
const style = css `
|
|
20
19
|
height: 100%;
|
|
21
20
|
background-color: #b5b5b599;
|
|
@@ -83,9 +82,9 @@ function DropZone(props) {
|
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
84
|
dispatch({
|
|
86
|
-
type: LOAD_DROP_FILES,
|
|
85
|
+
type: 'LOAD_DROP_FILES',
|
|
87
86
|
payload: {
|
|
88
|
-
|
|
87
|
+
nmriumState,
|
|
89
88
|
containsNmrium,
|
|
90
89
|
onLoadProcessing: current.onLoadProcessing,
|
|
91
90
|
parseMetaFileResult,
|
|
@@ -99,11 +98,11 @@ function DropZone(props) {
|
|
|
99
98
|
reportError(error);
|
|
100
99
|
}
|
|
101
100
|
finally {
|
|
102
|
-
dispatch({ type: SET_LOADING_FLAG, isLoading: false });
|
|
101
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
function onDrop(droppedFiles) {
|
|
106
|
-
dispatch({ type: SET_LOADING_FLAG, isLoading: true });
|
|
105
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: true } });
|
|
107
106
|
void loadFilesHandler(droppedFiles);
|
|
108
107
|
}
|
|
109
108
|
const isImportEnabled = isToolEnabled('import');
|
|
@@ -31,7 +31,7 @@ function NoData({ isEmpty = true, emptyText = 'Drag and drop here a JCAMP-DX, Br
|
|
|
31
31
|
if (!isEmpty) {
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
|
-
return (_jsx("div", { style: { ...styles.container, ...style }, ...(canOpenLoader && { onClick: openLoader }), children: _jsx("
|
|
34
|
+
return (_jsx("div", { style: { ...styles.container, ...style }, ...(canOpenLoader && { onClick: openLoader }), children: _jsx("div", { style: styles.text, children: isToolEnabled('import')
|
|
35
35
|
? emptyText
|
|
36
36
|
: 'Importation feature has been disabled' }) }));
|
|
37
37
|
}
|
|
@@ -9,7 +9,6 @@ import CloseButton from '../elements/CloseButton';
|
|
|
9
9
|
import Label from '../elements/Label';
|
|
10
10
|
import Select from '../elements/Select';
|
|
11
11
|
import FormikInput from '../elements/formik/FormikInput';
|
|
12
|
-
import { ALIGN_SPECTRA } from '../reducer/types/Types';
|
|
13
12
|
import Events from '../utility/Events';
|
|
14
13
|
import { ModalStyles } from './ModalStyle';
|
|
15
14
|
const baseList = [{ key: 1, value: 'manual', label: 'Manual' }];
|
|
@@ -29,7 +28,7 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
|
29
28
|
refForm.current.submitForm();
|
|
30
29
|
}, []);
|
|
31
30
|
const submitHandler = useCallback((values) => {
|
|
32
|
-
dispatch({ type: ALIGN_SPECTRA, payload: values });
|
|
31
|
+
dispatch({ type: 'ALIGN_SPECTRA', payload: values });
|
|
33
32
|
onClose();
|
|
34
33
|
}, [dispatch, onClose]);
|
|
35
34
|
useEffect(() => {
|
|
@@ -10,7 +10,6 @@ import CloseButton from '../elements/CloseButton';
|
|
|
10
10
|
import Label from '../elements/Label';
|
|
11
11
|
import Select from '../elements/Select';
|
|
12
12
|
import FormikInput from '../elements/formik/FormikInput';
|
|
13
|
-
import { CHANGE_PEAK_SHAPE } from '../reducer/types/Types';
|
|
14
13
|
import { formatNumber } from '../utility/formatNumber';
|
|
15
14
|
import { ModalStyles } from './ModalStyle';
|
|
16
15
|
const styles = css `
|
|
@@ -68,7 +67,7 @@ function EditPeakShapeModal({ onClose = () => null, peak, peaksPreferences, }) {
|
|
|
68
67
|
const [kind, setKind] = useState(peak.shape?.kind);
|
|
69
68
|
const changePeakShapeHandler = useCallback((values) => {
|
|
70
69
|
dispatch({
|
|
71
|
-
type: CHANGE_PEAK_SHAPE,
|
|
70
|
+
type: 'CHANGE_PEAK_SHAPE',
|
|
72
71
|
payload: {
|
|
73
72
|
id: peak.id,
|
|
74
73
|
shape: {
|
|
@@ -9,7 +9,6 @@ import Button from '../elements/Button';
|
|
|
9
9
|
import CloseButton from '../elements/CloseButton';
|
|
10
10
|
import FormikTextarea from '../elements/formik/FormikTextarea';
|
|
11
11
|
import { useAlert } from '../elements/popup/Alert';
|
|
12
|
-
import { GENERATE_SPECTRUM_FROM_PUBLICATION_STRING } from '../reducer/types/Types';
|
|
13
12
|
import { ModalStyles } from './ModalStyle';
|
|
14
13
|
const styles = css `
|
|
15
14
|
width: 600px;
|
|
@@ -42,7 +41,7 @@ function ImportPublicationStringModal({ onClose, }) {
|
|
|
42
41
|
const hideLoading = await alert.showLoading('Generate spectrum from publication string in progress');
|
|
43
42
|
setTimeout(() => {
|
|
44
43
|
dispatch({
|
|
45
|
-
type: GENERATE_SPECTRUM_FROM_PUBLICATION_STRING,
|
|
44
|
+
type: 'GENERATE_SPECTRUM_FROM_PUBLICATION_STRING',
|
|
46
45
|
payload: values,
|
|
47
46
|
});
|
|
48
47
|
hideLoading();
|
|
@@ -7,7 +7,6 @@ import { useDispatch } from '../context/DispatchContext';
|
|
|
7
7
|
import Button from '../elements/Button';
|
|
8
8
|
import CloseButton from '../elements/CloseButton';
|
|
9
9
|
import { useAlert } from '../elements/popup/Alert/Context';
|
|
10
|
-
import { LOAD_DROP_FILES } from '../reducer/types/Types';
|
|
11
10
|
import { extractFileMetaFromPath } from '../utility/FileUtility';
|
|
12
11
|
const styles = css `
|
|
13
12
|
display: flex;
|
|
@@ -75,8 +74,8 @@ export default function LoadJCAMPModal({ onClose, startLoading, }) {
|
|
|
75
74
|
entries: [{ relativePath: pathname, baseURL: origin }],
|
|
76
75
|
}).then((nmriumState) => {
|
|
77
76
|
dispatch({
|
|
78
|
-
type: LOAD_DROP_FILES,
|
|
79
|
-
payload: {
|
|
77
|
+
type: 'LOAD_DROP_FILES',
|
|
78
|
+
payload: { nmriumState, resetSourceObject: false },
|
|
80
79
|
});
|
|
81
80
|
onClose?.();
|
|
82
81
|
});
|
|
@@ -2,12 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { useState, useEffect, useCallback } from 'react';
|
|
4
4
|
import { StructureEditor } from 'react-ocl/full';
|
|
5
|
-
import { isMolFileEmpty } from '../../data/utilities/isMolFileEmpty';
|
|
6
5
|
import { useDispatch } from '../context/DispatchContext';
|
|
7
6
|
import ActionButtons from '../elements/ActionButtons';
|
|
8
7
|
import { useModal } from '../elements/popup/Modal';
|
|
9
8
|
import { positions } from '../elements/popup/options';
|
|
10
|
-
import { SET_MOLECULE, ADD_MOLECULE } from '../reducer/types/Types';
|
|
11
9
|
import { ModalStyles } from './ModalStyle';
|
|
12
10
|
function MoleculeStructureEditorModal(props) {
|
|
13
11
|
const { onClose = () => null, selectedMolecule } = props;
|
|
@@ -21,28 +19,35 @@ function MoleculeStructureEditorModal(props) {
|
|
|
21
19
|
setMolfile(null);
|
|
22
20
|
}
|
|
23
21
|
}, [selectedMolecule]);
|
|
24
|
-
const cb = useCallback((newMolfile) => {
|
|
25
|
-
|
|
22
|
+
const cb = useCallback((newMolfile, molecule) => {
|
|
23
|
+
if (molecule.getAllAtoms() === 0) {
|
|
24
|
+
setMolfile(null);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
setMolfile(newMolfile);
|
|
28
|
+
}
|
|
26
29
|
}, [setMolfile]);
|
|
27
30
|
const handleClose = useCallback(() => {
|
|
28
31
|
onClose();
|
|
29
32
|
}, [onClose]);
|
|
30
33
|
const handleSave = useCallback(() => {
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
if (molfile) {
|
|
35
|
+
if (selectedMolecule) {
|
|
36
|
+
const { id, label } = selectedMolecule;
|
|
37
|
+
dispatch({
|
|
38
|
+
type: 'SET_MOLECULE',
|
|
39
|
+
payload: {
|
|
40
|
+
molfile,
|
|
41
|
+
id,
|
|
42
|
+
label,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
onClose('replace');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
dispatch({ type: 'ADD_MOLECULE', payload: { molfile } });
|
|
49
|
+
onClose('new');
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
}, [dispatch, selectedMolecule, molfile, onClose]);
|
|
48
53
|
return (_jsxs("div", { css: ModalStyles, children: [_jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
|
|
@@ -18,7 +18,6 @@ import FormikErrorsSummary from '../elements/formik/FormikErrorsSummary';
|
|
|
18
18
|
import FormikInput from '../elements/formik/FormikInput';
|
|
19
19
|
import FormikSelect from '../elements/formik/FormikSelect';
|
|
20
20
|
import { useAlert } from '../elements/popup/Alert';
|
|
21
|
-
import { PREDICT_SPECTRA, SET_LOADING_FLAG } from '../reducer/types/Types';
|
|
22
21
|
import { useStateWithLocalStorage } from '../utility/LocalStorage';
|
|
23
22
|
import { ModalStyles } from './ModalStyle';
|
|
24
23
|
const styles = css `
|
|
@@ -133,26 +132,30 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
|
133
132
|
}, [predictionPreferences, predictionIndex]);
|
|
134
133
|
const submitHandler = useCallback((values) => {
|
|
135
134
|
void (async () => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
135
|
+
if (molfile) {
|
|
136
|
+
setPredictionPreferences({ ...values, isApproved });
|
|
137
|
+
dispatch({
|
|
138
|
+
type: 'SET_LOADING_FLAG',
|
|
139
|
+
payload: {
|
|
140
|
+
isLoading: true,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
const predictedSpectra = Object.entries(values.spectra)
|
|
144
|
+
.map(([key, value]) => {
|
|
145
|
+
if (value) {
|
|
146
|
+
return key;
|
|
147
|
+
}
|
|
148
|
+
return undefined;
|
|
149
|
+
})
|
|
150
|
+
.join(',');
|
|
151
|
+
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra} in progress`);
|
|
152
|
+
dispatch({
|
|
153
|
+
type: 'PREDICT_SPECTRA',
|
|
154
|
+
payload: { molfile, options: values },
|
|
155
|
+
});
|
|
156
|
+
hideLoading();
|
|
157
|
+
onClose();
|
|
158
|
+
}
|
|
156
159
|
})();
|
|
157
160
|
}, [alert, dispatch, isApproved, molfile, onClose, setPredictionPreferences]);
|
|
158
161
|
const approveCheckHandler = useCallback((e) => {
|
|
@@ -54,7 +54,7 @@ export default function SelectMolecule(props) {
|
|
|
54
54
|
}, [currentIndex, element, molecules]);
|
|
55
55
|
const setValue = useCallback((index) => {
|
|
56
56
|
setCurrentIndex(index);
|
|
57
|
-
setFieldValue(props.name, molecules[index]);
|
|
57
|
+
void setFieldValue(props.name, molecules[index]);
|
|
58
58
|
}, [molecules, props.name, setFieldValue]);
|
|
59
59
|
useEffect(() => {
|
|
60
60
|
if (molecules && molecules.length > 0) {
|
|
@@ -15,7 +15,6 @@ import FormikOnChange from '../../elements/formik/FormikOnChange';
|
|
|
15
15
|
import { usePanelPreferences } from '../../hooks/usePanelPreferences';
|
|
16
16
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
17
17
|
import { hasCouplingConstant } from '../../panels/extra/utilities/MultiplicityUtilities';
|
|
18
|
-
import { UPDATE_RANGE } from '../../reducer/types/Types';
|
|
19
18
|
import { formatNumber } from '../../utility/formatNumber';
|
|
20
19
|
import SignalsForm from './forms/components/SignalsForm';
|
|
21
20
|
import editRangeFormValidation from './forms/validation/EditRangeValidation';
|
|
@@ -103,12 +102,12 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
103
102
|
multiplicity,
|
|
104
103
|
coupling: '',
|
|
105
104
|
};
|
|
106
|
-
if (hasCouplingConstant(multiplicity) && signal?.js) {
|
|
105
|
+
if (hasCouplingConstant(multiplicity) && signal?.js.length > 0) {
|
|
107
106
|
js = { ...signal.js[counterJ] };
|
|
108
107
|
js.coupling = Number(formatNumber(js.coupling, rangesPreferences.coupling.format));
|
|
109
108
|
counterJ++;
|
|
110
109
|
}
|
|
111
|
-
js.multiplicity = translateMultiplet(js.multiplicity ||
|
|
110
|
+
js.multiplicity = translateMultiplet(js.multiplicity || multiplicity);
|
|
112
111
|
couplings.push(js);
|
|
113
112
|
}
|
|
114
113
|
}
|
|
@@ -127,7 +126,7 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
127
126
|
return value;
|
|
128
127
|
})) {
|
|
129
128
|
dispatch({
|
|
130
|
-
type: UPDATE_RANGE,
|
|
129
|
+
type: 'UPDATE_RANGE',
|
|
131
130
|
payload: { range: { ...range, signals } },
|
|
132
131
|
});
|
|
133
132
|
}
|
|
@@ -44,8 +44,8 @@ function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
|
|
|
44
44
|
js: [{ multiplicity: translateMultiplet('m'), coupling: '' }],
|
|
45
45
|
};
|
|
46
46
|
const _signals = values.signals.slice().concat(newSignal);
|
|
47
|
-
setFieldValue('signals', _signals);
|
|
48
|
-
setFieldValue('activeTab', String(_signals.length - 1));
|
|
47
|
+
void setFieldValue('signals', _signals);
|
|
48
|
+
void setFieldValue('activeTab', String(_signals.length - 1));
|
|
49
49
|
}, [setFieldValue, values.signals]);
|
|
50
50
|
const validation = useMemo(() => {
|
|
51
51
|
return Yup.object().shape({
|
|
@@ -39,7 +39,7 @@ function CouplingsTable({ push, remove, onFocus, onBlur, }) {
|
|
|
39
39
|
const { values, setFieldValue } = useFormikContext();
|
|
40
40
|
const multiplicityChangeHandler = useCallback((value, name) => {
|
|
41
41
|
if (!hasCouplingConstant(value)) {
|
|
42
|
-
setFieldValue(name, '');
|
|
42
|
+
void setFieldValue(name, '');
|
|
43
43
|
}
|
|
44
44
|
}, [setFieldValue]);
|
|
45
45
|
const couplingsList = lodashGet(values, `signals[${values.activeTab}].js`, []);
|
|
@@ -13,7 +13,6 @@ import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
|
13
13
|
import FormikInput from '../../elements/formik/FormikInput';
|
|
14
14
|
import FormikSelect from '../../elements/formik/FormikSelect';
|
|
15
15
|
import { useAlert } from '../../elements/popup/Alert/Context';
|
|
16
|
-
import { IMPORT_SPECTRA_META_INFO } from '../../reducer/types/Types';
|
|
17
16
|
import { convertPathArrayToString } from '../../utility/convertPathArrayToString';
|
|
18
17
|
import { getSpectraObjectPaths } from '../../utility/getSpectraObjectPaths';
|
|
19
18
|
import { ModalStyles } from '../ModalStyle';
|
|
@@ -132,7 +131,7 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
132
131
|
}
|
|
133
132
|
catch (error) {
|
|
134
133
|
if (error instanceof TargetPathError) {
|
|
135
|
-
formRef.current?.setFieldValue('target', null);
|
|
134
|
+
void formRef.current?.setFieldValue('target', null);
|
|
136
135
|
formRef.current?.setFieldError('target', '');
|
|
137
136
|
}
|
|
138
137
|
alert.error(error.message);
|
|
@@ -161,7 +160,7 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
161
160
|
}
|
|
162
161
|
function handleImport() {
|
|
163
162
|
dispatch({
|
|
164
|
-
type: IMPORT_SPECTRA_META_INFO,
|
|
163
|
+
type: 'IMPORT_SPECTRA_META_INFO',
|
|
165
164
|
payload: { spectraMeta: matches },
|
|
166
165
|
});
|
|
167
166
|
onClose?.();
|
|
@@ -36,7 +36,7 @@ function DatabasesTabContent({ currentWorkspace, originalWorkspaces, }) {
|
|
|
36
36
|
function deleteHandler(index) {
|
|
37
37
|
const _database = databases.data.slice();
|
|
38
38
|
_database.splice(index, 1);
|
|
39
|
-
setFieldValue('databases.data', _database);
|
|
39
|
+
void setFieldValue('databases.data', _database);
|
|
40
40
|
}
|
|
41
41
|
function addHandler() {
|
|
42
42
|
const newDatabase = {
|
|
@@ -45,17 +45,17 @@ function DatabasesTabContent({ currentWorkspace, originalWorkspaces, }) {
|
|
|
45
45
|
url: '',
|
|
46
46
|
enabled: true,
|
|
47
47
|
};
|
|
48
|
-
setFieldValue('databases.data', [...databases.data, newDatabase]);
|
|
48
|
+
void setFieldValue('databases.data', [...databases.data, newDatabase]);
|
|
49
49
|
}
|
|
50
50
|
function resetHandler() {
|
|
51
51
|
const workSpaceDisplayPreferences = getPreferencesByWorkspace(currentWorkspace, originalWorkspaces);
|
|
52
52
|
const database = workSpaceDisplayPreferences.databases.data;
|
|
53
|
-
setFieldValue('databases.data', database);
|
|
53
|
+
void setFieldValue('databases.data', database);
|
|
54
54
|
}
|
|
55
55
|
return (_jsx("fieldset", { onClick: (e) => {
|
|
56
56
|
if (e.target.checked) {
|
|
57
57
|
e.target.checked = false;
|
|
58
|
-
setFieldValue('databases.defaultDatabase', '');
|
|
58
|
+
void setFieldValue('databases.defaultDatabase', '');
|
|
59
59
|
}
|
|
60
60
|
}, children: _jsx(GroupPane, { text: "Databases", renderHeader: (text) => {
|
|
61
61
|
return (_jsx(DataBaseHeader, { text: text, onReset: resetHandler, onAdd: addHandler }));
|
|
@@ -59,7 +59,7 @@ function FormattingTabContent() {
|
|
|
59
59
|
_nuclei[nucleus] = nuclei[nucleus];
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
setFieldValue('formatting.nuclei', _nuclei);
|
|
62
|
+
void setFieldValue('formatting.nuclei', _nuclei);
|
|
63
63
|
}
|
|
64
64
|
function addHandler() {
|
|
65
65
|
const newFormat = {
|
|
@@ -69,7 +69,7 @@ function FormattingTabContent() {
|
|
|
69
69
|
};
|
|
70
70
|
const key = v4();
|
|
71
71
|
const newNuclei = { ...nuclei, [key]: newFormat };
|
|
72
|
-
setFieldValue('formatting.nuclei', newNuclei);
|
|
72
|
+
void setFieldValue('formatting.nuclei', newNuclei);
|
|
73
73
|
}
|
|
74
74
|
const nucleiList = Object.keys(nuclei);
|
|
75
75
|
return (_jsx(GroupPane, { text: "Number formatting for crosshair and info line", children: _jsx("div", { css: styles, children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "counter-col", children: "#" }), _jsx("th", { className: "nucleus-label-col", children: "Nucleus " }), _jsx("th", { className: "nucleus-format-input-col", children: "\u03B4 (ppm)" }), _jsx("th", { className: "nucleus-format-input-col", children: "Coupling (Hz)" }), _jsx("th", { className: "nucleus-format-input-col" })] }) }), _jsx("tbody", { children: nucleiList?.map((key, index) => {
|
|
@@ -38,11 +38,11 @@ function InfoBlockTabContent() {
|
|
|
38
38
|
else {
|
|
39
39
|
columns.push(emptyField);
|
|
40
40
|
}
|
|
41
|
-
setFieldValue('infoBlock.fields', columns);
|
|
41
|
+
void setFieldValue('infoBlock.fields', columns);
|
|
42
42
|
}, [setFieldValue]);
|
|
43
43
|
const deleteHandler = useCallback((data, index) => {
|
|
44
44
|
const _fields = data.filter((_, columnIndex) => columnIndex !== index);
|
|
45
|
-
setFieldValue('infoBlock.fields', _fields);
|
|
45
|
+
void setFieldValue('infoBlock.fields', _fields);
|
|
46
46
|
}, [setFieldValue]);
|
|
47
47
|
const COLUMNS = useMemo(() => [
|
|
48
48
|
{
|
|
@@ -3,14 +3,13 @@ import { SvgNmrAssignment } from 'cheminfo-font';
|
|
|
3
3
|
import { useCallback, useMemo, memo } from 'react';
|
|
4
4
|
import { useDispatch } from '../../context/DispatchContext';
|
|
5
5
|
import ReactTable from '../../elements/ReactTable/ReactTable';
|
|
6
|
-
import { SET_AUTOMATIC_ASSIGNMENTS } from '../../reducer/types/Types';
|
|
7
6
|
function AutomaticAssignmentTable({ data }) {
|
|
8
7
|
const dispatch = useDispatch();
|
|
9
8
|
const assignHandler = useCallback((e, row) => {
|
|
10
9
|
e.preventDefault();
|
|
11
10
|
e.stopPropagation();
|
|
12
11
|
dispatch({
|
|
13
|
-
type: SET_AUTOMATIC_ASSIGNMENTS,
|
|
12
|
+
type: 'SET_AUTOMATIC_ASSIGNMENTS',
|
|
14
13
|
payload: { assignments: row.original.assignment },
|
|
15
14
|
});
|
|
16
15
|
}, [dispatch]);
|
|
@@ -4,7 +4,6 @@ import { useRef, useState } from 'react';
|
|
|
4
4
|
import { useChartData } from '../../context/ChartContext';
|
|
5
5
|
import { useDispatch } from '../../context/DispatchContext';
|
|
6
6
|
import { useAlert } from '../../elements/popup/Alert';
|
|
7
|
-
import { SET_AUTOMATIC_ASSIGNMENTS } from '../../reducer/types/Types';
|
|
8
7
|
import { assert } from '../../utility/assert';
|
|
9
8
|
function mapSpectra(data) {
|
|
10
9
|
return data.map((spectrum) => {
|
|
@@ -28,10 +27,12 @@ export function useAutoAssignments() {
|
|
|
28
27
|
const alert = useAlert();
|
|
29
28
|
const [assignments, setAssignments] = useState([]);
|
|
30
29
|
function restAssignments() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
if (originData.current) {
|
|
31
|
+
dispatch({
|
|
32
|
+
type: 'SET_AUTOMATIC_ASSIGNMENTS',
|
|
33
|
+
payload: { assignments: originData.current },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
35
36
|
}
|
|
36
37
|
function getAssignments() {
|
|
37
38
|
void (async () => {
|
|
@@ -47,7 +48,7 @@ export function useAutoAssignments() {
|
|
|
47
48
|
}, { minScore: 0 });
|
|
48
49
|
if (result[0]?.assignment) {
|
|
49
50
|
dispatch({
|
|
50
|
-
type: SET_AUTOMATIC_ASSIGNMENTS,
|
|
51
|
+
type: 'SET_AUTOMATIC_ASSIGNMENTS',
|
|
51
52
|
payload: { assignments: result[0].assignment },
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -72,12 +72,12 @@ const columns = [
|
|
|
72
72
|
}, children: `${row.original.value}` })),
|
|
73
73
|
},
|
|
74
74
|
];
|
|
75
|
-
function InformationPanelInner({ info, meta,
|
|
75
|
+
function InformationPanelInner({ info, meta, customInfo, }) {
|
|
76
76
|
const [searchKey, setSearchKey] = useState();
|
|
77
77
|
const [panelsStatus, openPanel] = useState({
|
|
78
78
|
info: true,
|
|
79
79
|
meta: true,
|
|
80
|
-
|
|
80
|
+
customInfo: true,
|
|
81
81
|
});
|
|
82
82
|
function handleSearch(e) {
|
|
83
83
|
const searchKey = e.target.value.toLowerCase();
|
|
@@ -85,7 +85,7 @@ function InformationPanelInner({ info, meta, metaInfo, }) {
|
|
|
85
85
|
}
|
|
86
86
|
const matchesInfo = filter(searchKey, info);
|
|
87
87
|
const matchesMeta = filter(searchKey, meta);
|
|
88
|
-
const matchesMetaInfo = filter(searchKey,
|
|
88
|
+
const matchesMetaInfo = filter(searchKey, customInfo);
|
|
89
89
|
function handleOpen(key) {
|
|
90
90
|
openPanel((prevPanelsStatus) => ({
|
|
91
91
|
...prevPanelsStatus,
|
|
@@ -95,11 +95,11 @@ function InformationPanelInner({ info, meta, metaInfo, }) {
|
|
|
95
95
|
return (_jsxs("div", { style: styles.container, children: [_jsx("div", { children: _jsx(Input, { placeholder: "Search for parameter...", onChange: handleSearch, debounceTime: 250, style: {
|
|
96
96
|
inputWrapper: { width: '100%' },
|
|
97
97
|
input: { textAlign: 'left', padding: '5px' },
|
|
98
|
-
} }) }), _jsxs("div", { style: styles.tableContainer, children: [_jsx(InformationTable, { data:
|
|
98
|
+
} }) }), _jsxs("div", { style: styles.tableContainer, children: [_jsx(InformationTable, { data: matchesMetaInfo, columns: columns, title: "Custom information", onClick: () => handleOpen('customInfo'), isOpen: panelsStatus.customInfo }), _jsx(InformationTable, { data: matchesInfo, columns: columns, title: "Spectrum information", onClick: () => handleOpen('info'), isOpen: panelsStatus.info }), _jsx(InformationTable, { data: matchesMeta, columns: columns, title: "Other spectrum parameters", onClick: () => handleOpen('meta'), isOpen: panelsStatus.meta })] })] }));
|
|
99
99
|
}
|
|
100
100
|
const MemoizedInformationPanel = memo(InformationPanelInner);
|
|
101
101
|
const emptyData = { info: {}, meta: {} };
|
|
102
102
|
export default function InformationPanel() {
|
|
103
|
-
const { info, meta,
|
|
104
|
-
return _jsx(MemoizedInformationPanel, {
|
|
103
|
+
const { info, meta, customInfo } = useSpectrum(emptyData);
|
|
104
|
+
return _jsx(MemoizedInformationPanel, { info, meta, customInfo });
|
|
105
105
|
}
|
|
@@ -7,12 +7,11 @@ import { useCallback, useMemo, useState, useRef, memo } from 'react';
|
|
|
7
7
|
import { ImLink } from 'react-icons/im';
|
|
8
8
|
import { useChartData } from '../../context/ChartContext';
|
|
9
9
|
import { useDispatch } from '../../context/DispatchContext';
|
|
10
|
-
import
|
|
10
|
+
import ActiveButton from '../../elements/ActiveButton';
|
|
11
11
|
import ToolTip from '../../elements/ToolTip/ToolTip';
|
|
12
12
|
import { useModal } from '../../elements/popup/Modal';
|
|
13
13
|
import useSpectrum from '../../hooks/useSpectrum';
|
|
14
14
|
import ChangeSumModal from '../../modal/changeSum/ChangeSumModal';
|
|
15
|
-
import { DELETE_INTEGRAL, CHANGE_INTEGRAL_SUM, CHANGE_INTEGRALS_SUM_FLAG, } from '../../reducer/types/Types';
|
|
16
15
|
import { tablePanelStyle } from '../extra/BasicPanelStyle';
|
|
17
16
|
import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
18
17
|
import PreferencesHeader from '../header/PreferencesHeader';
|
|
@@ -26,12 +25,6 @@ const style = css `
|
|
|
26
25
|
align-items: center;
|
|
27
26
|
justify-content: center;
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
.fix-integral-toggle-btn {
|
|
31
|
-
svg {
|
|
32
|
-
font-size: 12px !important;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
28
|
`;
|
|
36
29
|
function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
37
30
|
const [filterIsActive, setFilterIsActive] = useState(false);
|
|
@@ -40,7 +33,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
40
33
|
const [isFlipped, setFlipStatus] = useState(false);
|
|
41
34
|
const settingRef = useRef();
|
|
42
35
|
const yesHandler = useCallback(() => {
|
|
43
|
-
dispatch({ type: DELETE_INTEGRAL,
|
|
36
|
+
dispatch({ type: 'DELETE_INTEGRAL', payload: {} });
|
|
44
37
|
}, [dispatch]);
|
|
45
38
|
const handleDeleteAll = useCallback(() => {
|
|
46
39
|
modal.showConfirmDialog({
|
|
@@ -48,8 +41,8 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
48
41
|
buttons: [{ text: 'Yes', handler: yesHandler }, { text: 'No' }],
|
|
49
42
|
});
|
|
50
43
|
}, [modal, yesHandler]);
|
|
51
|
-
const changeIntegralSumHandler = useCallback((
|
|
52
|
-
dispatch({ type: CHANGE_INTEGRAL_SUM,
|
|
44
|
+
const changeIntegralSumHandler = useCallback((options) => {
|
|
45
|
+
dispatch({ type: 'CHANGE_INTEGRAL_SUM', payload: { options } });
|
|
53
46
|
modal.close();
|
|
54
47
|
}, [dispatch, modal]);
|
|
55
48
|
const currentSum = useMemo(() => {
|
|
@@ -70,8 +63,8 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
70
63
|
const handleOnFilter = useCallback(() => {
|
|
71
64
|
setFilterIsActive(!filterIsActive);
|
|
72
65
|
}, [filterIsActive]);
|
|
73
|
-
const toggleConstantSumHandler = useCallback((
|
|
74
|
-
dispatch({ type: CHANGE_INTEGRALS_SUM_FLAG
|
|
66
|
+
const toggleConstantSumHandler = useCallback(() => {
|
|
67
|
+
dispatch({ type: 'CHANGE_INTEGRALS_SUM_FLAG' });
|
|
75
68
|
}, [dispatch]);
|
|
76
69
|
const filteredData = useMemo(() => {
|
|
77
70
|
function isInRange(from, to) {
|
|
@@ -105,17 +98,15 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, }) {
|
|
|
105
98
|
`,
|
|
106
99
|
], children: [!isFlipped && (_jsxs(DefaultPanelHeader, { counter: integrals?.values?.length, onDelete: handleDeleteAll, deleteToolTip: "Delete All Integrals", onFilter: handleOnFilter, filterToolTip: filterIsActive ? 'Show all integrals' : 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: currentSum
|
|
107
100
|
? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
|
|
108
|
-
: 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(
|
|
101
|
+
: 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(ActiveButton, { className: "icon", popupTitle: "Fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, value: integrals?.options?.isSumConstant || false, children: _jsx(ImLink, {}) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(IntegralTable, { data: filteredData, activeTab: activeTab })) : (_jsx(IntegralsPreferences, { ref: settingRef })) })] }));
|
|
109
102
|
}
|
|
110
103
|
const MemoizedIntegralPanel = memo(IntegralPanelInner);
|
|
111
104
|
const emptyData = { integrals: {}, info: {} };
|
|
112
105
|
export default function IntegralPanel() {
|
|
113
106
|
const { xDomain, view: { spectra: { activeTab }, }, } = useChartData();
|
|
114
107
|
const { integrals, info } = useSpectrum(emptyData);
|
|
115
|
-
return (_jsx(MemoizedIntegralPanel, {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
activeTab,
|
|
120
|
-
} }));
|
|
108
|
+
return (_jsx(MemoizedIntegralPanel, { integrals,
|
|
109
|
+
info,
|
|
110
|
+
xDomain,
|
|
111
|
+
activeTab }));
|
|
121
112
|
}
|