nmrium 0.38.1 → 0.39.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/ApodizationLine.js +27 -4
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -1
- package/lib/component/1d/FooterBanner.js +5 -5
- package/lib/component/1d/SpectraLegends.js +2 -3
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/integral/Integral.d.ts +1 -1
- package/lib/component/1d/integral/IntegralResizable.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.d.ts +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/LevelNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/StringNode.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +2 -1
- package/lib/component/1d/ranges/Range.d.ts +1 -1
- package/lib/component/1d/tool/PeakPointer.js +6 -6
- package/lib/component/1d/tool/XLabelPointer.js +5 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushX.js +2 -3
- package/lib/component/1d-2d/tools/BrushXY.js +2 -3
- package/lib/component/1d-2d/tools/CrossLinePointer.js +4 -5
- package/lib/component/2d/Chart2D.js +4 -4
- package/lib/component/2d/FooterBanner.js +5 -5
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +5 -5
- package/lib/component/2d/zones/Signal.d.ts +1 -1
- package/lib/component/2d/zones/SignalCrosshair.d.ts +1 -1
- package/lib/component/2d/zones/Zone.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +20 -12
- package/lib/component/EventsTrackers/BrushTracker.js +35 -22
- package/lib/component/EventsTrackers/KeysListenerTracker.js +90 -67
- package/lib/component/EventsTrackers/MouseTracker.d.ts +6 -2
- package/lib/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib/component/NMRium.d.ts +5 -5
- package/lib/component/NMRium.js +15 -16
- package/lib/component/assignment/AssignmentsReducer.d.ts +2 -2
- package/lib/component/context/LoggerContext.js +5 -0
- package/lib/component/context/PreferencesContext.d.ts +10 -8
- package/lib/component/elements/Button.d.ts +13 -11
- package/lib/component/elements/Button.js +16 -25
- package/lib/component/elements/ColorInput.d.ts +0 -1
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/EditableColumn.js +5 -2
- package/lib/component/elements/Input.js +2 -4
- package/lib/component/elements/Label.d.ts +1 -0
- package/lib/component/elements/Label.js +2 -2
- package/lib/component/elements/MolecularFormulaInput.d.ts +2 -2
- package/lib/component/elements/MolecularFormulaInput.js +15 -18
- package/lib/component/elements/NextPrev.d.ts +5 -3
- package/lib/component/elements/NextPrev.js +26 -8
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib/component/elements/formik/FormikCheckBox.d.ts +2 -1
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +4 -0
- package/lib/component/elements/formik/FormikColumnFormatField.js +19 -16
- package/lib/component/elements/formik/FormikError.d.ts +8 -0
- package/lib/component/elements/formik/FormikError.js +22 -0
- package/lib/component/elements/formik/FormikInput.js +10 -6
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +4 -3
- package/lib/component/header/AutoPeakPickingOptionPanel.js +16 -7
- package/lib/component/header/BaseLineCorrectionPanel.js +5 -2
- package/lib/component/header/PhaseCorrectionPanel.js +5 -2
- package/lib/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectra.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrum.d.ts +1 -1
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.d.ts +1 -1
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +2 -0
- package/lib/component/hooks/useCheckPointsNumberInWindowArea.js +17 -0
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -2
- package/lib/component/hooks/useDatumWithSpectraStatistics.d.ts +3 -2
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useFilter.d.ts +2 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.js +4 -0
- package/lib/component/hooks/useSaveSettings.d.ts +1 -1
- package/lib/component/hooks/useSaveSettings.js +17 -15
- package/lib/component/hooks/useVerticalAlign.d.ts +1 -1
- package/lib/component/loader/DropZone.js +1 -2
- package/lib/component/modal/EditPeakShapeModal.d.ts +2 -2
- package/lib/component/modal/LoadJCAMPModal.d.ts +3 -3
- package/lib/component/modal/LoadJCAMPModal.js +56 -74
- package/lib/component/modal/ModalStyle.js +0 -10
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +2 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib/component/modal/MultipletAnalysisModal.d.ts +2 -2
- package/lib/component/modal/PredictSpectraModal.d.ts +4 -2
- package/lib/component/modal/PredictSpectraModal.js +53 -105
- package/lib/component/modal/SaveAsModal.d.ts +2 -0
- package/lib/component/modal/SaveAsModal.js +21 -14
- package/lib/component/modal/changeSum/ChangeSumModal.js +25 -38
- package/lib/component/modal/editRange/EditRangeModal.d.ts +7 -6
- package/lib/component/modal/editRange/EditRangeModal.js +33 -13
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +2 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib/component/modal/setting/GeneralSettings.js +2 -7
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +7 -15
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts +1 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +20 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +6 -11
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +71 -81
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib/component/panels/Panels.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +39 -53
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +7 -22
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib/component/panels/databasePanel/DatabasePreferences.js +2 -2
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +2 -3
- package/lib/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib/component/panels/header/PanelHeader.d.ts +7 -0
- package/lib/component/panels/header/PanelHeader.js +12 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.d.ts +9 -0
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +94 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +1 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +109 -37
- package/lib/component/panels/predictionPanel/PredictionPreferences.d.ts +3 -0
- package/lib/component/panels/predictionPanel/PredictionPreferences.js +24 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +44 -0
- package/lib/component/reducer/Reducer.d.ts +5 -87
- package/lib/component/reducer/Reducer.js +1 -29
- package/lib/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib/component/reducer/actions/DomainActions.js +3 -0
- package/lib/component/reducer/actions/FiltersActions.d.ts +1 -2
- package/lib/component/reducer/actions/FiltersActions.js +47 -52
- package/lib/component/reducer/actions/HistoryActions.d.ts +4 -0
- package/lib/component/reducer/actions/HistoryActions.js +40 -0
- package/lib/component/reducer/actions/IntegralsActions.d.ts +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js +3 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -2
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +7 -4
- package/lib/component/reducer/actions/MoleculeActions.js +57 -28
- package/lib/component/reducer/actions/PeaksActions.d.ts +1 -2
- package/lib/component/reducer/actions/PeaksActions.js +3 -3
- package/lib/component/reducer/actions/RangesActions.d.ts +4 -5
- package/lib/component/reducer/actions/RangesActions.js +5 -27
- package/lib/component/reducer/actions/SpectrumsActions.js +8 -8
- package/lib/component/reducer/actions/ToolsActions.d.ts +2 -2
- package/lib/component/reducer/actions/ToolsActions.js +3 -32
- package/lib/component/reducer/actions/ZonesActions.d.ts +2 -1
- package/lib/component/reducer/actions/ZonesActions.js +3 -6
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +8 -0
- package/lib/component/reducer/helper/ZoomHistoryManager.js +35 -0
- package/lib/component/reducer/helper/getActiveSpectra.d.ts +1 -1
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +1 -1
- package/lib/component/reducer/helper/getVerticalAlign.d.ts +1 -1
- package/lib/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -3
- package/lib/component/reducer/preferences/utilities/getActiveWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +2 -3
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +1 -1
- package/lib/component/toolbar/BasicToolBar.js +6 -11
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/toolbar/ToolTypes.js +1 -1
- package/lib/component/workspaces/assignment.d.ts +1 -1
- package/lib/component/workspaces/basic.d.ts +1 -1
- package/lib/component/workspaces/embedded.d.ts +1 -1
- package/lib/component/workspaces/exercise.d.ts +1 -1
- package/lib/component/workspaces/index.d.ts +6 -6
- package/lib/component/workspaces/prediction.d.ts +1 -1
- package/lib/component/workspaces/prediction.js +193 -0
- package/lib/component/workspaces/process1D.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/PredictionManager.d.ts +3 -1
- package/lib/data/PredictionManager.js +43 -3
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/constants/DefaultApodizationOptions.d.ts +2 -0
- package/lib/data/constants/DefaultApodizationOptions.js +5 -0
- package/lib/data/data1d/Spectrum1D/SumManager.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/index.d.ts +1 -5
- package/lib/data/data1d/Spectrum1D/index.js +1 -5
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +3 -3
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.d.ts +3 -2
- package/lib/data/data1d/Spectrum1D/peaks/initiatePeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +7 -7
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +5 -24
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.d.ts +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/checkRangeKind.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +37 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.js +1 -1
- package/lib/data/data1d/database.js +2 -4
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +3 -30
- package/lib/data/data1d/multipleSpectraAnalysis.js +4 -15
- package/lib/data/data2d/Spectrum2D/getMissingProjection.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZones.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +3 -2
- package/lib/data/data2d/Spectrum2D/zones/isZoneExists.d.ts +2 -1
- package/lib/data/data2d/Spectrum2D/zones/mapZones.d.ts +3 -2
- package/lib/data/getDefaultMatrixFilters.d.ts +1 -1
- package/lib/data/types/data1d/ComplexData1D.d.ts +2 -2
- package/lib/data/types/data1d/RangeDetectionResult.d.ts +1 -1
- package/lib/data/utilities/FindUtilities.d.ts +2 -1
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.d.ts +2 -2
- package/lib/types/NMRiumDataReturn.d.ts +1 -3
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +28 -5
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +3 -26
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +5 -28
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/SpectraLegends.js +1 -2
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/tool/PeakPointer.js +3 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/1d-2d/tools/BrushX.js +1 -2
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +1 -2
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +2 -3
- package/lib-cjs/component/2d/Chart2D.js +4 -4
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +36 -22
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +90 -67
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +4 -1
- package/lib-cjs/component/NMRium.js +12 -13
- package/lib-cjs/component/context/LoggerContext.js +5 -0
- package/lib-cjs/component/elements/Button.js +16 -25
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +5 -2
- package/lib-cjs/component/elements/Input.js +2 -4
- package/lib-cjs/component/elements/Label.js +2 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +14 -16
- package/lib-cjs/component/elements/NextPrev.js +26 -8
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +4 -4
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +20 -16
- package/lib-cjs/component/elements/formik/FormikError.js +27 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +10 -6
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +6 -5
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +15 -6
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -3
- package/lib-cjs/component/header/PhaseCorrectionPanel.js +6 -26
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +15 -7
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -25
- package/lib-cjs/component/hooks/useCheckPointsNumberInWindowArea.js +24 -0
- package/lib-cjs/component/hooks/useExport.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +4 -0
- package/lib-cjs/component/hooks/useSaveSettings.js +16 -14
- package/lib-cjs/component/loader/DropZone.js +1 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +81 -75
- package/lib-cjs/component/modal/ModalStyle.js +0 -10
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +12 -6
- package/lib-cjs/component/modal/PredictSpectraModal.js +53 -126
- package/lib-cjs/component/modal/SaveAsModal.js +22 -14
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +24 -37
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +32 -12
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +2 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +15 -5
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -7
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +6 -14
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +19 -24
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +76 -86
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +3 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/base/AnalysisColumnHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/AnalysisTablePreferences.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/preferences/index.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +38 -52
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +5 -20
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +9 -12
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +5 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +10 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -24
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +25 -2
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +18 -26
- package/lib-cjs/component/panels/header/PanelHeader.js +15 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +122 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +109 -37
- package/lib-cjs/component/panels/predictionPanel/PredictionPreferences.js +29 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +72 -0
- package/lib-cjs/component/reducer/Reducer.js +2 -31
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +6 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +3 -0
- package/lib-cjs/component/reducer/actions/FiltersActions.js +66 -94
- package/lib-cjs/component/reducer/actions/HistoryActions.js +45 -0
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +3 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +58 -32
- package/lib-cjs/component/reducer/actions/PeaksActions.js +3 -3
- package/lib-cjs/component/reducer/actions/RangesActions.js +7 -52
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +10 -33
- package/lib-cjs/component/reducer/actions/ToolsActions.js +26 -32
- package/lib-cjs/component/reducer/actions/ZonesActions.js +6 -32
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +37 -0
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +2 -2
- package/lib-cjs/component/toolbar/BasicToolBar.js +5 -10
- package/lib-cjs/component/toolbar/ToolTypes.js +9 -32
- package/lib-cjs/component/workspaces/prediction.js +193 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +21 -44
- package/lib-cjs/data/PredictionManager.js +43 -3
- package/lib-cjs/data/constants/DefaultApodizationOptions.js +8 -0
- package/lib-cjs/data/data1d/Spectrum1D/index.js +7 -11
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -32
- package/lib-cjs/data/data1d/Spectrum1D/integrals/initiateIntegrals.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/initiatePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +1 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +7 -26
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectRanges.js +3 -4
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +13 -6
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +23 -18
- package/lib-cjs/data/data1d/Spectrum1D/ranges/initiateRanges.js +2 -2
- package/lib-cjs/data/data1d/database.js +2 -4
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +5 -16
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +3 -26
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +2 -25
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +29 -29
- package/lib/component/panels/predictionPanel/PredictionOptions.d.ts +0 -7
- package/lib/component/panels/predictionPanel/PredictionOptions.js +0 -74
- package/lib/component/workspaces/Workspace.d.ts +0 -188
- package/lib/component/workspaces/Workspace.js +0 -1
- package/lib/data/Filters.d.ts +0 -12
- package/lib/data/Filters.js +0 -12
- package/lib/data/FiltersManager.d.ts +0 -30
- package/lib/data/FiltersManager.js +0 -175
- package/lib/data/data1d/Spectrum1D/getShiftX.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getShiftX.js +0 -6
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -4
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.d.ts +0 -7
- package/lib/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -9
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.d.ts +0 -12
- package/lib/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -36
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -6
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -26
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.d.ts +0 -3
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -45
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -7
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +0 -4
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -78
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -9
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.d.ts +0 -2
- package/lib/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -5
- package/lib/data/data1d/filter1d/apodization.d.ts +0 -27
- package/lib/data/data1d/filter1d/apodization.js +0 -81
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +0 -33
- package/lib/data/data1d/filter1d/baselineCorrection.js +0 -51
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +0 -20
- package/lib/data/data1d/filter1d/digitalFilter.js +0 -44
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +0 -33
- package/lib/data/data1d/filter1d/equallySpaced.js +0 -52
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +0 -15
- package/lib/data/data1d/filter1d/exclusionZones.js +0 -32
- package/lib/data/data1d/filter1d/fft.d.ts +0 -18
- package/lib/data/data1d/filter1d/fft.js +0 -90
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +0 -26
- package/lib/data/data1d/filter1d/phaseCorrection.js +0 -64
- package/lib/data/data1d/filter1d/shiftX.d.ts +0 -20
- package/lib/data/data1d/filter1d/shiftX.js +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.d.ts +0 -26
- package/lib/data/data1d/filter1d/signalProcessing.js +0 -65
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.d.ts +0 -2
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -35
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +0 -22
- package/lib/data/data1d/filter1d/zeroFilling.js +0 -60
- package/lib/data/data2d/filter2d/shiftX.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftX.js +0 -27
- package/lib/data/data2d/filter2d/shiftY.d.ts +0 -18
- package/lib/data/data2d/filter2d/shiftY.js +0 -27
- package/lib/data/types/view-state/PeaksViewState.d.ts +0 -17
- package/lib/data/types/view-state/PeaksViewState.js +0 -1
- package/lib/types/NMRiumGeneralPreferences.d.ts +0 -7
- package/lib/types/NMRiumGeneralPreferences.js +0 -1
- package/lib/types/NMRiumPanelPreferences.d.ts +0 -17
- package/lib/types/NMRiumPanelPreferences.js +0 -1
- package/lib/types/NMRiumToolBarPreferences.d.ts +0 -22
- package/lib/types/NMRiumToolBarPreferences.js +0 -1
- package/lib/types/PanelPreferencesType.d.ts +0 -4
- package/lib/types/PanelPreferencesType.js +0 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +0 -102
- package/lib-cjs/component/workspaces/Workspace.js +0 -2
- package/lib-cjs/data/Filters.js +0 -38
- package/lib-cjs/data/FiltersManager.js +0 -206
- package/lib-cjs/data/data1d/Spectrum1D/getShiftX.js +0 -33
- package/lib-cjs/data/data1d/Spectrum1D/getSpectrumErrorValue.js +0 -8
- package/lib-cjs/data/data1d/Spectrum1D/integrals/checkIntegralKind.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/integrals/mapIntegrals.js +0 -40
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegrals.js +0 -10
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateIntegralsRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +0 -30
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +0 -49
- package/lib-cjs/data/data1d/Spectrum1D/peaks/updatePeaks.js +0 -11
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +0 -82
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRanges.js +0 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/updateRangesRelativeValues.js +0 -9
- package/lib-cjs/data/data1d/filter1d/apodization.js +0 -88
- package/lib-cjs/data/data1d/filter1d/baselineCorrection.js +0 -60
- package/lib-cjs/data/data1d/filter1d/digitalFilter.js +0 -50
- package/lib-cjs/data/data1d/filter1d/equallySpaced.js +0 -61
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +0 -38
- package/lib-cjs/data/data1d/filter1d/fft.js +0 -96
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +0 -70
- package/lib-cjs/data/data1d/filter1d/shiftX.js +0 -32
- package/lib-cjs/data/data1d/filter1d/signalProcessing.js +0 -95
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +0 -39
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +0 -66
- package/lib-cjs/data/data2d/filter2d/shiftX.js +0 -33
- package/lib-cjs/data/data2d/filter2d/shiftY.js +0 -33
- package/lib-cjs/data/types/view-state/PeaksViewState.js +0 -2
- package/lib-cjs/types/NMRiumGeneralPreferences.js +0 -2
- package/lib-cjs/types/NMRiumPanelPreferences.js +0 -2
- package/lib-cjs/types/NMRiumToolBarPreferences.js +0 -2
- package/lib-cjs/types/PanelPreferencesType.js +0 -2
|
@@ -35,6 +35,8 @@ const Button_1 = __importDefault(require("../elements/Button"));
|
|
|
35
35
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
36
36
|
const FormikNumberInput_1 = __importDefault(require("../elements/formik/FormikNumberInput"));
|
|
37
37
|
const FormikSelect_1 = __importDefault(require("../elements/formik/FormikSelect"));
|
|
38
|
+
const Alert_1 = require("../elements/popup/Alert");
|
|
39
|
+
const useCheckPointsNumberInWindowArea_1 = require("../hooks/useCheckPointsNumberInWindowArea");
|
|
38
40
|
const Header_1 = require("./Header");
|
|
39
41
|
const HeaderContainer_1 = require("./HeaderContainer");
|
|
40
42
|
const inputStyle = {
|
|
@@ -67,12 +69,19 @@ const INIT_VALUES = {
|
|
|
67
69
|
};
|
|
68
70
|
function AutoPeakPickingOptionPanel() {
|
|
69
71
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
const pointsNumber = (0, useCheckPointsNumberInWindowArea_1.useCheckPointsNumberInWindowArea)();
|
|
73
|
+
const alert = (0, Alert_1.useAlert)();
|
|
74
|
+
function handlePeakPicking(values) {
|
|
75
|
+
if (pointsNumber > useCheckPointsNumberInWindowArea_1.MIN_AREA_POINTS) {
|
|
76
|
+
dispatch({
|
|
77
|
+
type: 'AUTO_PEAK_PICKING',
|
|
78
|
+
payload: values,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
alert.error(`Auto peak picking only available for area more than ${useCheckPointsNumberInWindowArea_1.MIN_AREA_POINTS} points`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
76
85
|
return ((0, jsx_runtime_1.jsx)(HeaderContainer_1.HeaderContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: INIT_VALUES, onSubmit: handlePeakPicking, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Direction : ", shortTitle: "", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { name: "direction", items: LookFor, style: { width: '85px' } }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Max Number Of Peaks :", shortTitle: "Peaks number :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "maxNumberOfPeaks", style: inputStyle, min: 0 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Noise factor :", shortTitle: "Noise :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "noiseFactor", style: inputStyle, min: 0 }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Min Max Ratio :", shortTitle: "Ratio :", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "minMaxRatio", style: inputStyle, step: "0.01", min: 0 }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Apply" })] })) }) }));
|
|
77
86
|
}
|
|
78
87
|
exports.default = (0, react_1.memo)(AutoPeakPickingOptionPanel);
|
|
@@ -28,9 +28,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
30
|
const formik_1 = require("formik");
|
|
31
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
31
32
|
const react_1 = require("react");
|
|
32
33
|
const Yup = __importStar(require("yup"));
|
|
33
|
-
const Filters = __importStar(require("../../data/Filters"));
|
|
34
34
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
35
35
|
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
36
36
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
@@ -47,7 +47,10 @@ const getAlgorithmsList = () => {
|
|
|
47
47
|
value: val.toLowerCase(),
|
|
48
48
|
}));
|
|
49
49
|
};
|
|
50
|
-
const inputStyle = {
|
|
50
|
+
const inputStyle = {
|
|
51
|
+
input: { width: '50px' },
|
|
52
|
+
inputWrapper: { height: '100%' },
|
|
53
|
+
};
|
|
51
54
|
const formData = (algorithm, filterValues) => {
|
|
52
55
|
switch (algorithm) {
|
|
53
56
|
case 'airpls': {
|
|
@@ -115,7 +118,7 @@ function BaseLineCorrectionInnerPanel(props) {
|
|
|
115
118
|
}
|
|
116
119
|
const MemoizedBaseLineCorrectionPanel = (0, react_1.memo)(BaseLineCorrectionInnerPanel);
|
|
117
120
|
function BaseLineCorrectionPanel() {
|
|
118
|
-
const filter = (0, useFilter_1.useFilter)(Filters.baselineCorrection.id);
|
|
121
|
+
const filter = (0, useFilter_1.useFilter)(nmr_processing_1.Filters.baselineCorrection.id);
|
|
119
122
|
return (0, jsx_runtime_1.jsx)(MemoizedBaseLineCorrectionPanel, { filter: filter });
|
|
120
123
|
}
|
|
121
124
|
exports.default = BaseLineCorrectionPanel;
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
30
8
|
const react_1 = require("react");
|
|
31
|
-
const Filters = __importStar(require("../../data/Filters"));
|
|
32
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
33
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
11
|
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
@@ -47,9 +24,12 @@ const selectStyle = {
|
|
|
47
24
|
height: '20px',
|
|
48
25
|
};
|
|
49
26
|
const inputStyle = {
|
|
50
|
-
|
|
27
|
+
input: {
|
|
51
28
|
width: '70px',
|
|
52
29
|
},
|
|
30
|
+
inputWrapper: {
|
|
31
|
+
height: '100%',
|
|
32
|
+
},
|
|
53
33
|
};
|
|
54
34
|
const phaseCorrectionTypes = {
|
|
55
35
|
manual: 'manual',
|
|
@@ -74,7 +54,7 @@ const emptyData = { datum: {}, filter: null };
|
|
|
74
54
|
function PhaseCorrectionPanel() {
|
|
75
55
|
const { toolOptions: { data: { pivot }, }, } = (0, ChartContext_1.useChartData)();
|
|
76
56
|
const { data } = (0, useSpectrum_1.default)(emptyData);
|
|
77
|
-
const filter = (0, useFilter_1.useFilter)(Filters.phaseCorrection.id);
|
|
57
|
+
const filter = (0, useFilter_1.useFilter)(nmr_processing_1.Filters.phaseCorrection.id);
|
|
78
58
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
79
59
|
const [value, setValue] = (0, react_1.useState)({ ph0: 0, ph1: 0 });
|
|
80
60
|
const valueRef = (0, react_1.useRef)({ ph0: 0, ph1: 0 });
|
|
@@ -28,13 +28,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
30
|
const formik_1 = require("formik");
|
|
31
|
-
const react_1 = require("react");
|
|
32
31
|
const Yup = __importStar(require("yup"));
|
|
33
32
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
33
|
const Button_1 = __importDefault(require("../elements/Button"));
|
|
35
34
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
36
35
|
const FormikCheckBox_1 = __importDefault(require("../elements/formik/FormikCheckBox"));
|
|
37
36
|
const FormikNumberInput_1 = __importDefault(require("../elements/formik/FormikNumberInput"));
|
|
37
|
+
const Alert_1 = require("../elements/popup/Alert");
|
|
38
|
+
const useCheckPointsNumberInWindowArea_1 = require("../hooks/useCheckPointsNumberInWindowArea");
|
|
38
39
|
const Header_1 = require("./Header");
|
|
39
40
|
const HeaderContainer_1 = require("./HeaderContainer");
|
|
40
41
|
const validationSchema = Yup.object().shape({
|
|
@@ -46,12 +47,19 @@ const initialValues = {
|
|
|
46
47
|
};
|
|
47
48
|
function RangesPickingOptionPanel() {
|
|
48
49
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const pointsNumber = (0, useCheckPointsNumberInWindowArea_1.useCheckPointsNumberInWindowArea)();
|
|
51
|
+
const alert = (0, Alert_1.useAlert)();
|
|
52
|
+
function handleRangesPicking(values) {
|
|
53
|
+
if (pointsNumber > useCheckPointsNumberInWindowArea_1.MIN_AREA_POINTS) {
|
|
54
|
+
dispatch({
|
|
55
|
+
type: 'AUTO_RANGES_DETECTION',
|
|
56
|
+
payload: values,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
alert.error(`Auto range picking only available for area more than ${useCheckPointsNumberInWindowArea_1.MIN_AREA_POINTS} points`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
return ((0, jsx_runtime_1.jsx)(HeaderContainer_1.HeaderContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { onSubmit: handleRangesPicking, initialValues: initialValues, validationSchema: validationSchema, children: ({ handleSubmit, isValid }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Detect negative:", htmlFor: "lookNegative", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "lookNegative" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Min Max Ratio:", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikNumberInput_1.default, { name: "minMaxRatio", style: {
|
|
56
64
|
width: '70px',
|
|
57
65
|
}, step: "0.01", min: 0 }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => handleSubmit(), style: { margin: '0 10px' }, disabled: !isValid, children: "Auto ranges picking" })] })) }) }));
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const nmr_processing_1 = require("nmr-processing");
|
|
30
8
|
const react_1 = require("react");
|
|
31
|
-
const Filters = __importStar(require("../../data/Filters"));
|
|
32
9
|
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
33
10
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
34
11
|
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
@@ -41,7 +18,7 @@ const Header_1 = require("./Header");
|
|
|
41
18
|
const HeaderContainer_1 = require("./HeaderContainer");
|
|
42
19
|
const Sizes = (0, generateNumbersPowerOfX_1.default)(8, 21);
|
|
43
20
|
function useInitZeroFillingSize() {
|
|
44
|
-
const filter = (0, useFilter_1.useFilter)(Filters.zeroFilling.id);
|
|
21
|
+
const filter = (0, useFilter_1.useFilter)(nmr_processing_1.Filters.zeroFilling.id);
|
|
45
22
|
const { data } = (0, useSpectrum_1.default)();
|
|
46
23
|
if (filter) {
|
|
47
24
|
return filter.value.nbPoints;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useCheckPointsNumberInWindowArea = exports.MIN_AREA_POINTS = void 0;
|
|
7
|
+
const ml_spectra_processing_1 = require("ml-spectra-processing");
|
|
8
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
9
|
+
const useSpectrum_1 = __importDefault(require("./useSpectrum"));
|
|
10
|
+
exports.MIN_AREA_POINTS = 5;
|
|
11
|
+
function useCheckPointsNumberInWindowArea() {
|
|
12
|
+
const state = (0, ChartContext_1.useChartData)();
|
|
13
|
+
const spectrum = (0, useSpectrum_1.default)(null);
|
|
14
|
+
const { xDomain: [from, to], } = state;
|
|
15
|
+
if (spectrum) {
|
|
16
|
+
const { fromIndex, toIndex } = (0, ml_spectra_processing_1.xGetFromToIndex)(spectrum.data.x, {
|
|
17
|
+
from,
|
|
18
|
+
to,
|
|
19
|
+
});
|
|
20
|
+
return toIndex - fromIndex;
|
|
21
|
+
}
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
exports.useCheckPointsNumberInWindowArea = useCheckPointsNumberInWindowArea;
|
|
@@ -91,7 +91,7 @@ function useExport() {
|
|
|
91
91
|
modal.show((0, jsx_runtime_1.jsx)(SaveAsModal_1.default, { name: fileName, onSave: saveHandler }), {
|
|
92
92
|
isBackgroundBlur: false,
|
|
93
93
|
position: Modal_1.positions.TOP_CENTER,
|
|
94
|
-
width:
|
|
94
|
+
width: 500,
|
|
95
95
|
});
|
|
96
96
|
}, [modal, saveHandler, state.data]);
|
|
97
97
|
return {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.usePanelPreferencesByNuclei = exports.usePanelPreferences = void 0;
|
|
7
7
|
const has_1 = __importDefault(require("lodash/has"));
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
+
const PredictionManager_1 = require("../../data/PredictionManager");
|
|
9
10
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
10
11
|
const panelsPreferencesDefaultValues_1 = require("../reducer/preferences/panelsPreferencesDefaultValues");
|
|
11
12
|
const LocalStorage_1 = require("../utility/LocalStorage");
|
|
@@ -26,6 +27,8 @@ function getDefaultPreferences(panelKey, nucleus) {
|
|
|
26
27
|
return panelsPreferencesDefaultValues_1.databaseDefaultValues;
|
|
27
28
|
case 'multipleSpectraAnalysis':
|
|
28
29
|
return (0, panelsPreferencesDefaultValues_1.getMultipleSpectraAnalysisDefaultValues)(nucleus);
|
|
30
|
+
case 'prediction':
|
|
31
|
+
return PredictionManager_1.defaultPredictionOptions;
|
|
29
32
|
default:
|
|
30
33
|
return {};
|
|
31
34
|
}
|
|
@@ -63,6 +66,7 @@ function getPanelPreferences(preferences, panelKey, nucleus, returnOnlyNucleusPr
|
|
|
63
66
|
case 'matrixGeneration':
|
|
64
67
|
return nucleus ? panelPreferences[nucleus] : {};
|
|
65
68
|
case 'database':
|
|
69
|
+
case 'prediction':
|
|
66
70
|
return panelPreferences;
|
|
67
71
|
default:
|
|
68
72
|
return nucleus
|
|
@@ -52,30 +52,32 @@ const WorkspaceAddForm = (0, react_1.forwardRef)(({ className, message, onSave }
|
|
|
52
52
|
function useSaveSettings() {
|
|
53
53
|
const alert = (0, Context_1.useAlert)();
|
|
54
54
|
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(false);
|
|
55
|
-
const
|
|
55
|
+
const settingsRef = (0, react_1.useRef)();
|
|
56
56
|
const { dispatch, current } = (0, PreferencesContext_1.usePreferences)();
|
|
57
57
|
const formRef = (0, react_1.useRef)(null);
|
|
58
|
-
function addNewWorkspace(workspaceName
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
function addNewWorkspace({ workspaceName }) {
|
|
59
|
+
if (settingsRef.current) {
|
|
60
|
+
dispatch({
|
|
61
|
+
type: 'ADD_WORKSPACE',
|
|
62
|
+
payload: {
|
|
63
|
+
workspaceKey: workspaceName,
|
|
64
|
+
data: settingsRef.current,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
closeDialog();
|
|
68
|
+
alert.success('Preferences saved successfully');
|
|
69
|
+
}
|
|
68
70
|
}
|
|
69
71
|
return {
|
|
70
72
|
saveSettings: (values) => {
|
|
71
|
-
|
|
73
|
+
settingsRef.current = values;
|
|
72
74
|
if (current.source !== 'user') {
|
|
73
75
|
openDialog();
|
|
74
76
|
}
|
|
75
77
|
else {
|
|
76
78
|
dispatch({
|
|
77
79
|
type: 'SET_PREFERENCES',
|
|
78
|
-
payload: values,
|
|
80
|
+
...(values && { payload: values }),
|
|
79
81
|
});
|
|
80
82
|
closeDialog();
|
|
81
83
|
}
|
|
@@ -83,7 +85,7 @@ function useSaveSettings() {
|
|
|
83
85
|
SaveSettingsModal: () => {
|
|
84
86
|
const alertConfig = {
|
|
85
87
|
message: 'Please enter a new user workspace name in order to save your changes locally',
|
|
86
|
-
render: (props) => ((0, jsx_runtime_1.jsx)(WorkspaceAddForm, { ...props, onSave:
|
|
88
|
+
render: (props) => ((0, jsx_runtime_1.jsx)(WorkspaceAddForm, { ...props, onSave: addNewWorkspace, ref: formRef })),
|
|
87
89
|
buttons: [
|
|
88
90
|
{
|
|
89
91
|
text: 'Save',
|
|
@@ -72,7 +72,7 @@ function DropZone(props) {
|
|
|
72
72
|
const { nmrLoaders: sourceSelector } = preferences.current;
|
|
73
73
|
const { nmriumState, containsNmrium } = await (0, nmr_load_save_1.read)(fileCollection, {
|
|
74
74
|
sourceSelector,
|
|
75
|
-
logger: logger.child({ context: 'nmr-
|
|
75
|
+
logger: logger.child({ context: 'nmr-processing' }),
|
|
76
76
|
});
|
|
77
77
|
if (nmriumState?.settings) {
|
|
78
78
|
dispatchPreferences({
|
|
@@ -97,7 +97,6 @@ function DropZone(props) {
|
|
|
97
97
|
catch (error) {
|
|
98
98
|
alert.error(error.message);
|
|
99
99
|
logger.error(error);
|
|
100
|
-
reportError(error);
|
|
101
100
|
}
|
|
102
101
|
finally {
|
|
103
102
|
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
@@ -1,94 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.LoadJCAMPModal = void 0;
|
|
6
30
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
31
|
/** @jsxImportSource @emotion/react */
|
|
8
|
-
const
|
|
32
|
+
const formik_1 = require("formik");
|
|
9
33
|
const nmr_load_save_1 = require("nmr-load-save");
|
|
10
|
-
const
|
|
34
|
+
const react_1 = require("react");
|
|
35
|
+
const ui_1 = require("react-science/ui");
|
|
36
|
+
const Yup = __importStar(require("yup"));
|
|
11
37
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
12
38
|
const Button_1 = __importDefault(require("../elements/Button"));
|
|
13
|
-
const
|
|
39
|
+
const Label_1 = __importDefault(require("../elements/Label"));
|
|
40
|
+
const FormikError_1 = __importDefault(require("../elements/formik/FormikError"));
|
|
41
|
+
const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
|
|
14
42
|
const Context_1 = require("../elements/popup/Alert/Context");
|
|
15
|
-
const FileUtility_1 = require("../utility/FileUtility");
|
|
16
|
-
const styles = (0, react_1.css) `
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
width: 450px;
|
|
20
|
-
padding: 5px;
|
|
21
|
-
|
|
22
|
-
button:focus {
|
|
23
|
-
outline: none;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.header {
|
|
27
|
-
height: 24px;
|
|
28
|
-
border-bottom: 1px solid #f0f0f0;
|
|
29
|
-
display: flex;
|
|
30
|
-
|
|
31
|
-
span {
|
|
32
|
-
color: #464646;
|
|
33
|
-
font-size: 15px;
|
|
34
|
-
flex: 1;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
button {
|
|
38
|
-
background-color: transparent;
|
|
39
|
-
border: none;
|
|
40
|
-
|
|
41
|
-
svg {
|
|
42
|
-
height: 16px;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.container {
|
|
48
|
-
display: flex;
|
|
49
|
-
margin: 30px 5px;
|
|
50
|
-
align-items: center;
|
|
51
|
-
height: 36px;
|
|
52
|
-
|
|
53
|
-
input {
|
|
54
|
-
padding: 5px;
|
|
55
|
-
border: 1px solid gray;
|
|
56
|
-
border-radius: 5px;
|
|
57
|
-
margin: 2px;
|
|
58
|
-
flex: 10;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
button {
|
|
62
|
-
flex: 2;
|
|
63
|
-
height: 100%;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
43
|
const allowedExtensions = new Set(['dx', 'jdx', 'jcamp']);
|
|
68
|
-
|
|
69
|
-
|
|
44
|
+
const loadFormValidation = Yup.object({
|
|
45
|
+
url: Yup.string()
|
|
46
|
+
.url()
|
|
47
|
+
.required()
|
|
48
|
+
.test('file type', 'Imported file must be one of those extensions [ .jdx, .dx, .jcamp ]', (url) => {
|
|
49
|
+
try {
|
|
50
|
+
const fileURL = new URL(url);
|
|
51
|
+
const extension = fileURL.pathname.split('.')?.[1] || '';
|
|
52
|
+
if (allowedExtensions.has(extension)) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}),
|
|
61
|
+
});
|
|
62
|
+
const labelStyle = {
|
|
63
|
+
wrapper: { display: 'flex', height: '100%', flex: 1 },
|
|
64
|
+
};
|
|
65
|
+
function LoadJCAMPModal({ onCloseDialog, isOpen }) {
|
|
70
66
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
71
67
|
const alert = (0, Context_1.useAlert)();
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
const ref = (0, react_1.useRef)(null);
|
|
69
|
+
if (!isOpen)
|
|
70
|
+
return;
|
|
71
|
+
async function loadJCAMPHandler({ url }) {
|
|
72
|
+
const hidLoading = await alert.showLoading('Load JCAMP from external URL in progress ...');
|
|
73
|
+
const { pathname, origin } = new URL(url);
|
|
74
|
+
try {
|
|
75
|
+
const nmriumState = await (0, nmr_load_save_1.readFromWebSource)({
|
|
79
76
|
entries: [{ relativePath: pathname, baseURL: origin }],
|
|
80
|
-
}).then((nmriumState) => {
|
|
81
|
-
dispatch({
|
|
82
|
-
type: 'LOAD_DROP_FILES',
|
|
83
|
-
payload: { nmriumState, resetSourceObject: false },
|
|
84
|
-
});
|
|
85
|
-
onClose?.();
|
|
86
77
|
});
|
|
78
|
+
dispatch({
|
|
79
|
+
type: 'LOAD_DROP_FILES',
|
|
80
|
+
payload: { nmriumState, resetSourceObject: false },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
alert.error(`Failed to load ${url}`);
|
|
87
85
|
}
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
finally {
|
|
87
|
+
hidLoading();
|
|
88
|
+
onCloseDialog?.();
|
|
90
89
|
}
|
|
91
|
-
}
|
|
92
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
90
|
+
}
|
|
91
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Modal, { hasCloseButton: true, isOpen: true, onRequestClose: onCloseDialog, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: "Load JCAMP Dialog" }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsx)("div", { style: { minWidth: '400px', padding: '1.5em' }, children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { initialValues: { url: '' }, validationSchema: loadFormValidation, onSubmit: loadJCAMPHandler, innerRef: ref, children: (0, jsx_runtime_1.jsx)(Label_1.default, { title: "URL", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikError_1.default, { name: "url", style: { container: { flex: 1 } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "url", type: "string", style: {
|
|
92
|
+
input: {
|
|
93
|
+
padding: '0.8em',
|
|
94
|
+
textAlign: 'left',
|
|
95
|
+
width: '100%',
|
|
96
|
+
},
|
|
97
|
+
inputWrapper: { width: '100%' },
|
|
98
|
+
}, placeholder: "Enter URL to JCAMP-DX file" }) }) }) }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Footer, { children: (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: () => ref.current?.submitForm(), children: "Load" }) }) })] }));
|
|
93
99
|
}
|
|
94
|
-
exports.
|
|
100
|
+
exports.LoadJCAMPModal = LoadJCAMPModal;
|
|
@@ -69,16 +69,6 @@ exports.ModalStyles = (0, react_1.css) `
|
|
|
69
69
|
margin: 10px;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.input {
|
|
73
|
-
font-size: 14px;
|
|
74
|
-
border-radius: 5px;
|
|
75
|
-
border: 1px solid #cccccc;
|
|
76
|
-
padding: 5px;
|
|
77
|
-
width: 100px;
|
|
78
|
-
margin-right: 10px;
|
|
79
|
-
height: initial !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
72
|
.close-bt {
|
|
83
73
|
border: none;
|
|
84
74
|
color: red;
|
|
@@ -14,7 +14,7 @@ const Modal_1 = require("../elements/popup/Modal");
|
|
|
14
14
|
const options_1 = require("../elements/popup/options");
|
|
15
15
|
const ModalStyle_1 = require("./ModalStyle");
|
|
16
16
|
function MoleculeStructureEditorModal(props) {
|
|
17
|
-
const { onClose = () => null, selectedMolecule } = props;
|
|
17
|
+
const { onClose = () => null, selectedMolecule, floatMoleculeOnSave = false, } = props;
|
|
18
18
|
const [molfile, setMolfile] = (0, react_1.useState)(null);
|
|
19
19
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
20
20
|
(0, react_1.useEffect)(() => {
|
|
@@ -51,22 +51,28 @@ function MoleculeStructureEditorModal(props) {
|
|
|
51
51
|
onClose('replace');
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
|
-
dispatch({
|
|
54
|
+
dispatch({
|
|
55
|
+
type: 'ADD_MOLECULE',
|
|
56
|
+
payload: {
|
|
57
|
+
molfile,
|
|
58
|
+
floatMoleculeOnSave,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
55
61
|
onClose('new');
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
|
-
}, [
|
|
64
|
+
}, [molfile, selectedMolecule, dispatch, floatMoleculeOnSave, onClose]);
|
|
59
65
|
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsx)(full_1.StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: handleClose }) })] }));
|
|
60
66
|
}
|
|
61
|
-
function useMoleculeEditor() {
|
|
67
|
+
function useMoleculeEditor(floatMoleculeOnSave = false) {
|
|
62
68
|
const modal = (0, Modal_1.useModal)();
|
|
63
69
|
return (0, react_1.useCallback)((molecule) => {
|
|
64
|
-
modal.show((0, jsx_runtime_1.jsx)(MoleculeStructureEditorModal, { selectedMolecule: molecule }), {
|
|
70
|
+
modal.show((0, jsx_runtime_1.jsx)(MoleculeStructureEditorModal, { selectedMolecule: molecule, floatMoleculeOnSave: floatMoleculeOnSave }), {
|
|
65
71
|
position: options_1.positions.TOP_CENTER,
|
|
66
72
|
width: 700,
|
|
67
73
|
height: 500,
|
|
68
74
|
});
|
|
69
|
-
}, [modal]);
|
|
75
|
+
}, [floatMoleculeOnSave, modal]);
|
|
70
76
|
}
|
|
71
77
|
exports.useMoleculeEditor = useMoleculeEditor;
|
|
72
78
|
exports.default = MoleculeStructureEditorModal;
|