nmrium 0.31.0 → 0.33.0-pre.1667632695
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/Chart1D.js +1 -1
- package/lib/component/1d/FooterBanner.js +17 -10
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/SpectraTracker.js +1 -1
- package/lib/component/1d/Viewer1D.js +1 -1
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib/component/1d/{Integral.d.ts → integral/Integral.d.ts} +0 -0
- package/lib/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib/component/1d/integral/IntegralIndicator.d.ts +9 -0
- package/lib/component/1d/integral/IntegralIndicator.js +27 -0
- package/lib/component/1d/{IntegralResizable.d.ts → integral/IntegralResizable.d.ts} +0 -0
- package/lib/component/1d/integral/IntegralResizable.js +69 -0
- package/lib/component/1d/{IntegralsSeries.d.ts → integral/IntegralsSeries.d.ts} +0 -0
- package/lib/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib/component/1d/ranges/Range.js +27 -50
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +2 -2
- package/lib/component/2d/Contours.js +61 -42
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +11 -14
- package/lib/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +5 -8
- package/lib/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib/component/NMRium.d.ts +1 -1
- package/lib/component/NMRium.js +6 -6
- package/lib/component/SplitPaneWrapper.js +1 -1
- package/lib/component/assignment/actions/initAssignment.js +17 -17
- package/lib/component/assignment/index.js +2 -2
- package/lib/component/context/PreferencesContext.js +3 -6
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/CheckBoxCell.js +1 -1
- package/lib/component/elements/ContextMenu.js +2 -2
- package/lib/component/elements/EditableColumn.d.ts +3 -1
- package/lib/component/elements/EditableColumn.js +21 -8
- package/lib/component/elements/GroupPane.d.ts +12 -0
- package/lib/component/elements/GroupPane.js +14 -0
- package/lib/component/elements/Input.js +7 -4
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -2
- package/lib/component/elements/MolecularFormulaInput.js +2 -0
- package/lib/component/elements/NumberInput.js +2 -2
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -1
- package/lib/component/elements/ReactTable/ReactTable.js +72 -38
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +3 -2
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib/component/elements/accordion/Accordion.js +2 -2
- package/lib/component/elements/draggble/useDraggable.js +1 -3
- package/lib/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.d.ts +0 -1
- package/lib/component/elements/formik/FormikColorPicker.js +5 -8
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +0 -1
- package/lib/component/elements/formik/FormikInput.js +12 -20
- package/lib/component/elements/formik/FormikOnChange.d.ts +1 -1
- package/lib/component/elements/formik/FormikOnChange.js +13 -10
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.d.ts +2 -4
- package/lib/component/elements/formik/FormikSlider.js +8 -11
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib/component/elements/popup/Alert/Provider.js +7 -7
- package/lib/component/elements/popup/Alert/index.d.ts +3 -4
- package/lib/component/elements/popup/Alert/index.js +3 -4
- package/lib/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib/component/elements/popup/Modal/Provider.js +16 -31
- package/lib/component/elements/popup/Modal/index.d.ts +4 -5
- package/lib/component/elements/popup/Modal/index.js +4 -5
- package/lib/component/header/Header.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js +2 -2
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +9 -6
- package/lib/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib/component/hooks/usePanelPreferences.js +9 -7
- package/lib/component/loader/DropZone.js +10 -2
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +2 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib/component/modal/PredictSpectraModal.js +5 -5
- package/lib/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib/component/modal/setting/GeneralSettings.js +11 -14
- package/lib/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib/component/modal/setting/WorkspaceItem.d.ts +2 -1
- package/lib/component/modal/setting/WorkspaceItem.js +36 -48
- package/lib/component/modal/setting/settingsValidation.d.ts +58 -57
- package/lib/component/modal/setting/settingsValidation.js +14 -12
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib/component/panels/InformationPanel.js +52 -56
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
- package/lib/component/panels/RangesPanel/RangesPanel.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.d.ts +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +3 -26
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts +2 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.d.ts +2 -2
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib/component/reducer/IgnoreActions.js +3 -3
- package/lib/component/reducer/Reducer.d.ts +26 -45
- package/lib/component/reducer/Reducer.js +13 -12
- package/lib/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
- package/lib/component/reducer/actions/DomainActions.js +52 -69
- package/lib/component/reducer/actions/FiltersActions.js +15 -6
- package/lib/component/reducer/actions/HistoryActions.js +5 -5
- package/lib/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib/component/reducer/actions/LoadActions.js +12 -0
- package/lib/component/reducer/actions/PeaksActions.js +7 -6
- package/lib/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +28 -24
- package/lib/component/reducer/actions/SpectrumsActions.js +13 -6
- package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +28 -41
- package/lib/component/reducer/actions/ZonesActions.js +11 -10
- package/lib/component/reducer/core/Constants.js +1 -1
- package/lib/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib/component/reducer/helper/getActiveSpectrum.d.ts +3 -0
- package/lib/component/reducer/helper/getActiveSpectrum.js +4 -0
- package/lib/component/reducer/helper/getSpectrum.js +3 -5
- package/lib/component/reducer/helper/getStrongestPeak.d.ts +1 -1
- package/lib/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib/component/reducer/preferences/actions/setPreferences.js +5 -6
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +1 -4
- package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib/component/tool/BrushX.js +3 -3
- package/lib/component/tool/BrushXY.js +5 -5
- package/lib/component/tool/CrossLinePointer.js +3 -3
- package/lib/component/toolbar/BasicToolBar.js +9 -8
- package/lib/component/utility/Evaluate.js +2 -2
- package/lib/component/utility/FileUtility.d.ts +2 -9
- package/lib/component/utility/FileUtility.js +11 -28
- package/lib/component/utility/GroupByInfoKey.d.ts +1 -1
- package/lib/component/utility/GroupByInfoKey.js +11 -13
- package/lib/component/utility/PathBuilder.js +1 -1
- package/lib/component/utility/PreferencesHelper.js +2 -3
- package/lib/component/utility/{Export.d.ts → export.d.ts} +0 -0
- package/lib/component/utility/{Export.js → export.js} +54 -73
- package/lib/component/utility/formatNumber.d.ts +6 -1
- package/lib/component/utility/formatNumber.js +5 -4
- package/lib/component/workspaces/Workspace.d.ts +1 -1
- package/lib/component/workspaces/exercise.js +4 -4
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib/data/Filters.d.ts +16 -18
- package/lib/data/Filters.js +16 -18
- package/lib/data/FiltersManager.js +4 -3
- package/lib/data/PredictionManager.js +8 -10
- package/lib/data/SpectraManager.d.ts +1 -2
- package/lib/data/SpectraManager.js +25 -60
- package/lib/data/data1d/MultipleAnalysis.js +74 -70
- package/lib/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/index.d.ts +24 -25
- package/lib/data/data1d/Spectrum1D/index.js +24 -25
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.d.ts +35 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib/data/data1d/database.js +45 -28
- package/lib/data/data1d/filter1d/apodization.js +2 -1
- package/lib/data/data1d/filter1d/fft.js +24 -7
- package/lib/data/data1d/filter1d/phaseCorrection.js +11 -5
- package/lib/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Processing2D.d.ts +3 -3
- package/lib/data/data2d/Processing2D.js +10 -20
- package/lib/data/data2d/Spectrum2D/contours.d.ts +40 -0
- package/lib/data/data2d/Spectrum2D/contours.js +132 -0
- package/lib/data/data2d/Spectrum2D/index.d.ts +10 -11
- package/lib/data/data2d/Spectrum2D/index.js +10 -11
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib/data/molecules/MoleculeManager.js +1 -1
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/index.d.ts +12 -13
- package/lib/data/types/data2d/Data2D.d.ts +2 -0
- package/lib/data/types/data2d/Datum2D.d.ts +0 -1
- package/lib/data/types/data2d/index.d.ts +8 -9
- package/lib/data/utilities/RangeUtilities.js +13 -9
- package/lib/data/utilities/ZoneUtilities.js +17 -13
- package/lib/data/utilities/calculateSanPlot.d.ts +8 -0
- package/lib/data/utilities/calculateSanPlot.js +31 -0
- package/lib/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib/data/utilities/generateChar.js +8 -6
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getAtomsFromMF.js +2 -2
- package/lib/data/utilities/getColor.js +3 -3
- package/lib/data/utilities/getSum.js +6 -3
- package/lib/types/NMRiumGeneralPreferences.d.ts +2 -2
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +16 -9
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/XAxis.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +2 -1
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +2 -2
- package/lib-cjs/component/1d/{Integral.js → integral/Integral.js} +2 -2
- package/lib-cjs/component/1d/integral/IntegralIndicator.js +31 -0
- package/lib-cjs/component/1d/integral/IntegralResizable.js +74 -0
- package/lib-cjs/component/1d/{IntegralsSeries.js → integral/IntegralsSeries.js} +4 -4
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +4 -4
- package/lib-cjs/component/1d/multiplicityTree/buildTreeNode.js +3 -3
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +1 -1
- package/lib-cjs/component/1d/peaks/usePeakShapesPath.js +10 -6
- package/lib-cjs/component/1d/ranges/Range.js +27 -50
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +2 -2
- package/lib-cjs/component/2d/Contours.js +60 -41
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/Left1DChart.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +11 -14
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib-cjs/component/2d/zones/IndicationLines.js +5 -8
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +30 -21
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +14 -15
- package/lib-cjs/component/NMRium.js +7 -7
- package/lib-cjs/component/SplitPaneWrapper.js +1 -1
- package/lib-cjs/component/assignment/actions/initAssignment.js +17 -17
- package/lib-cjs/component/assignment/index.js +2 -2
- package/lib-cjs/component/context/PreferencesContext.js +3 -6
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/CheckBoxCell.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +21 -8
- package/lib-cjs/component/elements/GroupPane.js +18 -0
- package/lib-cjs/component/elements/Input.js +7 -4
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -2
- package/lib-cjs/component/elements/MolecularFormulaInput.js +2 -0
- package/lib-cjs/component/elements/NumberInput.js +2 -2
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +71 -37
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/ReactTable/utility/addCustomColumn.js +3 -3
- package/lib-cjs/component/elements/ReactTable/utility/useRowSpan.js +3 -7
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -2
- package/lib-cjs/component/elements/draggble/useDraggable.js +1 -3
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +1 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +4 -7
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +12 -20
- package/lib-cjs/component/elements/formik/FormikOnChange.js +13 -10
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +7 -10
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +2 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +8 -8
- package/lib-cjs/component/elements/popup/Alert/index.js +5 -5
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +3 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +16 -31
- package/lib-cjs/component/elements/popup/Modal/index.js +7 -7
- package/lib-cjs/component/header/Header.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCombinedRefs.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +14 -11
- package/lib-cjs/component/hooks/useFormatNumberByNucleus.js +1 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +9 -7
- package/lib-cjs/component/loader/DropZone.js +10 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -2
- package/lib-cjs/component/modal/LoadJCAMPModal.js +2 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +1 -1
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +3 -3
- package/lib-cjs/component/modal/PredictSpectraModal.js +5 -5
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +4 -4
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +2 -2
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +25 -20
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +21 -27
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +10 -10
- package/lib-cjs/component/modal/setting/GeneralSettings.js +11 -14
- package/lib-cjs/component/modal/setting/GeneralTabContent.js +3 -1
- package/lib-cjs/component/modal/setting/ToolsTabContent.js +18 -19
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +37 -49
- package/lib-cjs/component/modal/setting/settingsValidation.js +14 -12
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +8 -7
- package/lib-cjs/component/panels/InformationPanel.js +51 -55
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +4 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +6 -6
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +16 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +18 -17
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +1 -1
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -3
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useMapRanges.js +8 -8
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +6 -6
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +2 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -25
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +13 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +16 -17
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +20 -21
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +12 -12
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -5
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +105 -94
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +8 -8
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +5 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +20 -5
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -2
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +1 -1
- package/lib-cjs/component/reducer/IgnoreActions.js +3 -3
- package/lib-cjs/component/reducer/Reducer.js +12 -11
- package/lib-cjs/component/reducer/actions/CorrelationsActions.js +4 -4
- package/lib-cjs/component/reducer/actions/DomainActions.js +52 -69
- package/lib-cjs/component/reducer/actions/FiltersActions.js +15 -6
- package/lib-cjs/component/reducer/actions/HistoryActions.js +5 -5
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +6 -5
- package/lib-cjs/component/reducer/actions/LoadActions.js +12 -0
- package/lib-cjs/component/reducer/actions/PeaksActions.js +7 -6
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +20 -38
- package/lib-cjs/component/reducer/actions/RangesActions.js +28 -24
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +12 -5
- package/lib-cjs/component/reducer/actions/ToolsActions.js +28 -41
- package/lib-cjs/component/reducer/actions/ZonesActions.js +11 -10
- package/lib-cjs/component/reducer/core/Constants.js +1 -1
- package/lib-cjs/component/reducer/helper/GetClosestNumber.js +2 -1
- package/lib-cjs/component/reducer/helper/Zoom1DManager.js +11 -10
- package/lib-cjs/component/reducer/helper/getActiveSpectrum.js +8 -0
- package/lib-cjs/component/reducer/helper/getSpectrum.js +3 -5
- package/lib-cjs/component/reducer/helper/getStrongestPeak.js +2 -3
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +3 -10
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +5 -9
- package/lib-cjs/component/reducer/preferences/utilities/mapNucleiFormatting.js +7 -5
- package/lib-cjs/component/tool/BrushX.js +3 -3
- package/lib-cjs/component/tool/BrushXY.js +5 -5
- package/lib-cjs/component/tool/CrossLinePointer.js +3 -3
- package/lib-cjs/component/toolbar/BasicToolBar.js +8 -7
- package/lib-cjs/component/utility/Evaluate.js +2 -2
- package/lib-cjs/component/utility/FileUtility.js +11 -29
- package/lib-cjs/component/utility/GroupByInfoKey.js +11 -13
- package/lib-cjs/component/utility/PathBuilder.js +1 -1
- package/lib-cjs/component/utility/PreferencesHelper.js +2 -3
- package/lib-cjs/component/utility/{Export.js → export.js} +78 -74
- package/lib-cjs/component/utility/formatNumber.js +5 -4
- package/lib-cjs/component/workspaces/exercise.js +4 -4
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -1
- package/lib-cjs/data/Filters.js +17 -35
- package/lib-cjs/data/FiltersManager.js +4 -3
- package/lib-cjs/data/PredictionManager.js +8 -10
- package/lib-cjs/data/SpectraManager.js +26 -62
- package/lib-cjs/data/data1d/MultipleAnalysis.js +74 -70
- package/lib-cjs/data/data1d/Spectrum1D/SumManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/index.js +25 -25
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +6 -5
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/peaks/lookupPeak.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/optimizePeaks.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +3 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRange.js +2 -2
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +6 -7
- package/lib-cjs/data/data1d/database.js +45 -28
- package/lib-cjs/data/data1d/filter1d/apodization.js +2 -1
- package/lib-cjs/data/data1d/filter1d/fft.js +23 -6
- package/lib-cjs/data/data1d/filter1d/phaseCorrection.js +10 -4
- package/lib-cjs/data/data1d/filter1d/utils/padDataToNextPowerOfTwo.js +1 -1
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Processing2D.js +10 -20
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +138 -0
- package/lib-cjs/data/data2d/Spectrum2D/index.js +11 -11
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +3 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +4 -5
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZones.js +11 -8
- package/lib-cjs/data/data2d/Spectrum2D/zones/detectZonesManual.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +1 -2
- package/lib-cjs/data/molecules/MoleculeManager.js +1 -1
- package/lib-cjs/data/utilities/RangeUtilities.js +13 -9
- package/lib-cjs/data/utilities/ZoneUtilities.js +17 -13
- package/lib-cjs/data/utilities/calculateSanPlot.js +35 -0
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +1 -2
- package/lib-cjs/data/utilities/generateChar.js +8 -6
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getAtomsFromMF.js +2 -2
- package/lib-cjs/data/utilities/getColor.js +3 -3
- package/lib-cjs/data/utilities/getSum.js +6 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +36 -31
- package/lib/component/1d/IntegralResizable.js +0 -72
- package/lib/component/elements/popup/helpers.d.ts +0 -1
- package/lib/component/elements/popup/helpers.js +0 -9
- package/lib/component/panels/RangesPanel/TableColumns/format.d.ts +0 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +0 -8
- package/lib/data/data1d/Data1DManager.d.ts +0 -3
- package/lib/data/data1d/Data1DManager.js +0 -98
- package/lib/data/data1d/filter1d/absolute.d.ts +0 -13
- package/lib/data/data1d/filter1d/absolute.js +0 -26
- package/lib/data/data2d/Data2DManager.d.ts +0 -3
- package/lib/data/data2d/Data2DManager.js +0 -34
- package/lib/data/types/data2d/Contour.d.ts +0 -4
- package/lib/data/types/data2d/Contour.js +0 -1
- package/lib/data/types/data2d/Contours.d.ts +0 -2
- package/lib/data/types/data2d/Contours.js +0 -1
- package/lib-cjs/component/1d/IntegralResizable.js +0 -77
- package/lib-cjs/component/elements/popup/helpers.js +0 -13
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +0 -14
- package/lib-cjs/data/data1d/Data1DManager.js +0 -104
- package/lib-cjs/data/data1d/filter1d/absolute.js +0 -32
- package/lib-cjs/data/data2d/Data2DManager.js +0 -40
- package/lib-cjs/data/types/data2d/Contour.js +0 -2
- package/lib-cjs/data/types/data2d/Contours.js +0 -2
|
@@ -3,22 +3,25 @@ import { useEffect, memo, useRef } from 'react';
|
|
|
3
3
|
const FormikOnChange = (props) => {
|
|
4
4
|
const { onChange = () => null, enableValidation = true } = props;
|
|
5
5
|
const oldValuesRef = useRef({});
|
|
6
|
-
const { values, errors,
|
|
6
|
+
const { values, errors, setTouched, initialValues } = useFormikContext();
|
|
7
7
|
useEffect(() => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const isNewValue = JSON.stringify(values) !== JSON.stringify(initialValues);
|
|
9
|
+
if (isNewValue) {
|
|
10
|
+
if (enableValidation) {
|
|
11
|
+
if (Object.keys(errors).length === 0 &&
|
|
12
|
+
JSON.stringify(oldValuesRef.current) !== JSON.stringify(values)) {
|
|
13
|
+
onChange(values);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
setTouched(errors);
|
|
17
|
+
}
|
|
12
18
|
}
|
|
13
19
|
else {
|
|
14
|
-
|
|
20
|
+
onChange(values);
|
|
15
21
|
}
|
|
16
22
|
}
|
|
17
|
-
else {
|
|
18
|
-
onChange(values);
|
|
19
|
-
}
|
|
20
23
|
oldValuesRef.current = values;
|
|
21
|
-
}, [values, enableValidation, errors, onChange,
|
|
24
|
+
}, [values, enableValidation, errors, onChange, setTouched, initialValues]);
|
|
22
25
|
return null;
|
|
23
26
|
};
|
|
24
27
|
export default memo(FormikOnChange);
|
|
@@ -15,6 +15,6 @@ const FormikSelect = function FormikSelect(props) {
|
|
|
15
15
|
setFieldValue(name, value);
|
|
16
16
|
}
|
|
17
17
|
}, [name, setFieldValue, value]);
|
|
18
|
-
return (_jsx(Select, { name: name, defaultValue: value
|
|
18
|
+
return (_jsx(Select, { name: name, defaultValue: value || lodashGet(values, name), onChange: changeHandler, ...resProps }));
|
|
19
19
|
};
|
|
20
20
|
export default FormikSelect;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface FormikSliderProps {
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
5
|
-
triggerSubmit?: boolean;
|
|
4
|
+
debounceTime?: number;
|
|
6
5
|
}
|
|
7
6
|
declare function FormikSlider(props: FormikSliderProps): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
7
|
+
export default FormikSlider;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFormikContext } from 'formik';
|
|
3
|
+
import debounce from 'lodash/debounce';
|
|
3
4
|
import lodashGet from 'lodash/get';
|
|
4
|
-
import {
|
|
5
|
+
import { useRef } from 'react';
|
|
5
6
|
import ReactSlider from 'react-slider';
|
|
6
7
|
function FormikSlider(props) {
|
|
7
|
-
const {
|
|
8
|
-
const { values, setFieldValue
|
|
9
|
-
const
|
|
10
|
-
onAfterChange(value);
|
|
8
|
+
const { name, debounceTime = 0 } = props;
|
|
9
|
+
const { values, setFieldValue } = useFormikContext();
|
|
10
|
+
const debounceOnChange = useRef(debounce((value) => {
|
|
11
11
|
setFieldValue(name, value);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}, [name, onAfterChange, setFieldValue, submitForm, triggerSubmit]);
|
|
16
|
-
return (_jsx(ReactSlider, { className: "horizontal-slider", thumbClassName: "thumb", trackClassName: "track", defaultValue: lodashGet(values, name, [0, 100]), onAfterChange: changeHandler, renderThumb: (props, state) => (_jsx("div", { ...props, children: _jsx("span", { children: state.valueNow }) })), pearling: true, minDistance: 10, ...sliderProps }));
|
|
12
|
+
}, debounceTime)).current;
|
|
13
|
+
return (_jsx(ReactSlider, { className: "horizontal-slider", thumbClassName: "thumb", trackClassName: "track", defaultValue: lodashGet(values, name, [0, 100]), onAfterChange: (value) => debounceOnChange(value), renderThumb: (props, state) => (_jsx("div", { ...props, children: _jsx("span", { children: state.valueNow }) })), pearling: true, minDistance: 10 }));
|
|
17
14
|
}
|
|
18
|
-
export default
|
|
15
|
+
export default FormikSlider;
|
|
@@ -17,7 +17,7 @@ function FormikTextarea(props) {
|
|
|
17
17
|
const isInvalid = useMemo(() => {
|
|
18
18
|
return lodashGet(errors, name);
|
|
19
19
|
}, [errors, name]);
|
|
20
|
-
return (_jsx("textarea", { ...{ name, className, placeholder }, value: value
|
|
20
|
+
return (_jsx("textarea", { ...{ name, className, placeholder }, value: value || lodashGet(values, name), onChange: changeHandler, style: {
|
|
21
21
|
...style,
|
|
22
22
|
...(isInvalid && {
|
|
23
23
|
borderColor: 'red',
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useRef } from 'react';
|
|
3
3
|
import { useLinearPrimaryTicks } from 'react-d3-utils';
|
|
4
4
|
const VerticalAxis = forwardRef((props, ref) => {
|
|
5
|
-
const { x, y, height, showGrid, ticks } = props;
|
|
5
|
+
const { x, y, height, width, showGrid, ticks } = props;
|
|
6
6
|
return (_jsxs("g", { ref: ref, transform: `translate(${x}, ${y})`, children: [_jsx("line", { y2: height, x1: 15, x2: 15, stroke: "black" }), ticks.map(({ label, position }, index) => (
|
|
7
7
|
// eslint-disable-next-line react/no-array-index-key
|
|
8
|
-
_jsxs("g", { children: [showGrid &&
|
|
8
|
+
_jsxs("g", { children: [showGrid && width && (_jsx("line", { y1: position, y2: position, x1: 15, x2: width - x, stroke: "lightgray" })), _jsx("line", { y1: position, y2: position, x1: 15, x2: 10, stroke: "black" }), _jsx("text", { y: position, dominantBaseline: "middle", textAnchor: "end", children: label })] }, index + label + position)))] }));
|
|
9
9
|
});
|
|
10
10
|
export function LinearVerticalAxis(props) {
|
|
11
11
|
const { scale, ...other } = props;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import groupBy from 'lodash/groupBy';
|
|
2
3
|
import { Fragment, useState, useRef, useEffect, useCallback, useMemo, memo, } from 'react';
|
|
3
4
|
import { createPortal } from 'react-dom';
|
|
4
5
|
import { FaTimes } from 'react-icons/fa';
|
|
5
6
|
import { TransitionGroup } from 'react-transition-group';
|
|
6
7
|
import Transition from '../Transition';
|
|
7
8
|
import Wrapper from '../Wrapper';
|
|
8
|
-
import { groupBy } from '../helpers';
|
|
9
9
|
import { positions, transitions, types } from '../options';
|
|
10
10
|
import { AlertProvider } from './Context';
|
|
11
11
|
import ProgressIndicator from './ProgressIndicator';
|
|
@@ -18,14 +18,14 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = posi
|
|
|
18
18
|
const ref = root.current;
|
|
19
19
|
const timersIdRef = timersId.current;
|
|
20
20
|
if (wrapperRef) {
|
|
21
|
-
wrapperRef.
|
|
21
|
+
wrapperRef.append(ref);
|
|
22
22
|
}
|
|
23
23
|
return () => {
|
|
24
|
-
if (ref) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
wrapperRef.removeChild(ref);
|
|
24
|
+
if (ref && wrapperRef) {
|
|
25
|
+
for (const id of timersIdRef) {
|
|
26
|
+
clearTimeout(id);
|
|
28
27
|
}
|
|
28
|
+
ref.remove();
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}, [wrapperRef]);
|
|
@@ -40,7 +40,7 @@ function Provider({ children, wrapperRef = null, offset = '5px', position = posi
|
|
|
40
40
|
});
|
|
41
41
|
}, []);
|
|
42
42
|
const show = useCallback((message = '', options = {}) => {
|
|
43
|
-
const id = Math.random().toString(36).
|
|
43
|
+
const id = Math.random().toString(36).slice(2, 9);
|
|
44
44
|
const alertOptions = {
|
|
45
45
|
position: options.position || position,
|
|
46
46
|
timeout,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { AlertProvider, useAlert, positions, types, transitions };
|
|
1
|
+
export { positions, types, transitions } from '../options';
|
|
2
|
+
export { useAlert } from './Context';
|
|
3
|
+
export { default as AlertProvider } from './Provider';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { AlertProvider, useAlert, positions, types, transitions };
|
|
1
|
+
export { positions, types, transitions } from '../options';
|
|
2
|
+
export { useAlert } from './Context';
|
|
3
|
+
export { default as AlertProvider } from './Provider';
|
|
@@ -15,7 +15,9 @@ const ModalContent = ({ modal, onClose, onLayout }) => {
|
|
|
15
15
|
}) }));
|
|
16
16
|
});
|
|
17
17
|
useEffect(() => {
|
|
18
|
-
if (isFinite(height) &&
|
|
18
|
+
if (Number.isFinite(height) &&
|
|
19
|
+
Number.isFinite(width) &&
|
|
20
|
+
!contentSize.current) {
|
|
19
21
|
contentSize.current = { width, height };
|
|
20
22
|
onLayout({ modal, layout: { width, height } });
|
|
21
23
|
}
|
|
@@ -31,13 +31,11 @@ function Provider({ children, style, offset = '0px', position = positions.MIDDLE
|
|
|
31
31
|
root.current = document.createElement('div');
|
|
32
32
|
const ref = root.current;
|
|
33
33
|
if (wrapperRef) {
|
|
34
|
-
wrapperRef.
|
|
34
|
+
wrapperRef.append(ref);
|
|
35
35
|
}
|
|
36
36
|
return () => {
|
|
37
|
-
if (ref) {
|
|
38
|
-
|
|
39
|
-
wrapperRef.removeChild(ref);
|
|
40
|
-
}
|
|
37
|
+
if (ref && wrapperRef) {
|
|
38
|
+
ref.remove();
|
|
41
39
|
}
|
|
42
40
|
};
|
|
43
41
|
}, [wrapperRef]);
|
|
@@ -77,10 +75,11 @@ function Provider({ children, style, offset = '0px', position = positions.MIDDLE
|
|
|
77
75
|
* @param {Array<{ handler: Function,text: string,style: object}>} dialogOptions.buttons
|
|
78
76
|
* @param {object} dialogOptions.tyle
|
|
79
77
|
*/
|
|
80
|
-
const showConfirmDialog = useCallback((dialogOptions, options = {
|
|
78
|
+
const showConfirmDialog = useCallback((dialogOptions, options = {}) => {
|
|
79
|
+
const { enableResizing = false, ...otherOptions } = options;
|
|
81
80
|
const _modal = {
|
|
82
81
|
component: _jsx(ConfirmDialog, { ...dialogOptions }),
|
|
83
|
-
options: { isBackgroundBlur: true, ...
|
|
82
|
+
options: { isBackgroundBlur: true, enableResizing, ...otherOptions },
|
|
84
83
|
};
|
|
85
84
|
_modal.close = close;
|
|
86
85
|
setModal(_modal);
|
|
@@ -121,28 +120,20 @@ function Provider({ children, style, offset = '0px', position = positions.MIDDLE
|
|
|
121
120
|
: { pointerEvents: 'none' };
|
|
122
121
|
const modalContextValue = useMemo(() => ({ show, close, showConfirmDialog }), [show, close, showConfirmDialog]);
|
|
123
122
|
const contentLayoutHandler = useCallback(({ modal, layout }) => {
|
|
124
|
-
const width = modal.options.width
|
|
125
|
-
?
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
: layout.width;
|
|
129
|
-
const height = modal.options.height
|
|
130
|
-
? modal.options.height
|
|
131
|
-
: layout.height > parentStyle.height
|
|
123
|
+
const width = modal.options.width ||
|
|
124
|
+
(layout.width > parentStyle.width ? parentStyle.width : layout.width);
|
|
125
|
+
const height = modal.options.height ||
|
|
126
|
+
(layout.height > parentStyle.height
|
|
132
127
|
? parentStyle.height
|
|
133
|
-
: layout.height;
|
|
128
|
+
: layout.height);
|
|
134
129
|
modalRef.current.updateSize({ width, height });
|
|
135
130
|
}, [parentStyle.height, parentStyle.width]);
|
|
136
131
|
return (_jsxs(ModalProvider, { value: modalContextValue, children: [children, root.current &&
|
|
137
132
|
createPortal(_jsx(Fragment, { children: modal ? (_jsx("div", { css: styles, style: {
|
|
138
133
|
...outerStyle,
|
|
139
134
|
}, children: _jsx(TransitionGroup, { appear: true, options: {
|
|
140
|
-
position: modal.options.position
|
|
141
|
-
|
|
142
|
-
: position,
|
|
143
|
-
}, containerStyle: parentStyle, component: Wrapper, children: _jsx(Transition, { type: modal.options.transition
|
|
144
|
-
? modal.options.transition
|
|
145
|
-
: transition, transitionStyles: {
|
|
135
|
+
position: modal.options.position || position,
|
|
136
|
+
}, containerStyle: parentStyle, component: Wrapper, children: _jsx(Transition, { type: modal.options.transition || transition, transitionStyles: {
|
|
146
137
|
...transitionStyles,
|
|
147
138
|
default: {
|
|
148
139
|
width: modal.options.width
|
|
@@ -153,12 +144,8 @@ function Provider({ children, style, offset = '0px', position = positions.MIDDLE
|
|
|
153
144
|
? `${modal.options.height}px`
|
|
154
145
|
: 'auto',
|
|
155
146
|
}, children: _jsx(Rnd, { maxWidth: parentStyle.width, maxHeight: parentStyle.height, ref: modalRef, default: {
|
|
156
|
-
width: modal.options.width
|
|
157
|
-
|
|
158
|
-
: 'auto',
|
|
159
|
-
height: modal.options.height
|
|
160
|
-
? modal.options.height
|
|
161
|
-
: 'auto',
|
|
147
|
+
width: modal.options.width || 'auto',
|
|
148
|
+
height: modal.options.height || 'auto',
|
|
162
149
|
x: 0,
|
|
163
150
|
y: 0,
|
|
164
151
|
}, className: "rnd-container", style: {
|
|
@@ -167,8 +154,6 @@ function Provider({ children, style, offset = '0px', position = positions.MIDDLE
|
|
|
167
154
|
position: 'static',
|
|
168
155
|
pointerEvents: 'all',
|
|
169
156
|
userSelect: 'none',
|
|
170
|
-
}, enableResizing: modal.options.enableResizing, dragHandleClassName: "handle", enableUserSelectHack: false, children: _jsx(ModalContent, { modal: modal, onClose: close, onLayout: contentLayoutHandler }) }) }, modal.id) }, positions[modal.options.transition
|
|
171
|
-
? modal.options.transition
|
|
172
|
-
: transition]) })) : null }), root.current)] }));
|
|
157
|
+
}, enableResizing: modal.options.enableResizing, dragHandleClassName: "handle", enableUserSelectHack: false, children: _jsx(ModalContent, { modal: modal, onClose: close, onLayout: contentLayoutHandler }) }) }, modal.id) }, positions[modal.options.transition || transition]) })) : null }), root.current)] }));
|
|
173
158
|
}
|
|
174
159
|
export default Provider;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { Modal, ModalProvider, useModal, positions, transitions };
|
|
1
|
+
export { positions, transitions } from '../options';
|
|
2
|
+
export { useModal } from './Context';
|
|
3
|
+
export { default as Modal } from './Modal';
|
|
4
|
+
export { default as ModalProvider } from './Provider';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { Modal, ModalProvider, useModal, positions, transitions };
|
|
1
|
+
export { positions, transitions } from '../options';
|
|
2
|
+
export { useModal } from './Context';
|
|
3
|
+
export { default as Modal } from './Modal';
|
|
4
|
+
export { default as ModalProvider } from './Provider';
|
|
@@ -46,7 +46,7 @@ function HeaderInner(props) {
|
|
|
46
46
|
}, [selectedOptionPanel]);
|
|
47
47
|
const openGeneralSettingsHandler = useCallback(() => {
|
|
48
48
|
modal.show(_jsx(GeneralSettings, {}), {
|
|
49
|
-
position: positions.
|
|
49
|
+
position: positions.MIDDLE,
|
|
50
50
|
enableResizing: true,
|
|
51
51
|
width: 600,
|
|
52
52
|
height: 400,
|
|
@@ -9,7 +9,7 @@ export default function useActiveSpectrumStyleOptions(id) {
|
|
|
9
9
|
const isActive = activeSpectrum === null ? true : id === activeSpectrum.id;
|
|
10
10
|
const opacity = isActive
|
|
11
11
|
? 1
|
|
12
|
-
: get(preferences.current, 'general.
|
|
12
|
+
: get(preferences.current, 'general.dimmedSpectraOpacity', 0.1);
|
|
13
13
|
return { isActive, opacity };
|
|
14
14
|
}, [activeSpectrum, id, preferences]);
|
|
15
15
|
}
|
|
@@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react';
|
|
|
2
2
|
export default function useCombinedRefs(refs) {
|
|
3
3
|
const targetRef = useRef();
|
|
4
4
|
useEffect(() => {
|
|
5
|
-
|
|
5
|
+
for (const ref of refs) {
|
|
6
6
|
if (!ref)
|
|
7
7
|
return;
|
|
8
8
|
if (typeof ref === 'function') {
|
|
@@ -11,7 +11,7 @@ export default function useCombinedRefs(refs) {
|
|
|
11
11
|
else {
|
|
12
12
|
ref.current = targetRef.current;
|
|
13
13
|
}
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
}, [refs]);
|
|
16
16
|
return targetRef;
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default function useExport(): {
|
|
2
2
|
saveToClipboardHandler: () => Promise<void>;
|
|
3
|
-
saveAsJSONHandler: (spaceIndent?: number, isCompressed?: boolean) =>
|
|
3
|
+
saveAsJSONHandler: (spaceIndent?: number, isCompressed?: boolean) => void;
|
|
4
4
|
saveAsSVGHandler: () => Promise<void>;
|
|
5
5
|
saveAsPNGHandler: () => Promise<void>;
|
|
6
6
|
saveAsHandler: () => Promise<void>;
|
|
@@ -6,7 +6,7 @@ import { useGlobal } from '../context/GlobalContext';
|
|
|
6
6
|
import { useAlert } from '../elements/popup/Alert';
|
|
7
7
|
import { positions, useModal } from '../elements/popup/Modal';
|
|
8
8
|
import SaveAsModal from '../modal/SaveAsModal';
|
|
9
|
-
import { copyPNGToClipboard, exportAsJSON, exportAsPng, exportAsSVG, } from '../utility/
|
|
9
|
+
import { copyPNGToClipboard, exportAsJSON, exportAsPng, exportAsSVG, } from '../utility/export';
|
|
10
10
|
export default function useExport() {
|
|
11
11
|
const { rootRef } = useGlobal();
|
|
12
12
|
const modal = useModal();
|
|
@@ -22,10 +22,11 @@ export default function useExport() {
|
|
|
22
22
|
}, 0);
|
|
23
23
|
}
|
|
24
24
|
}, [rootRef, alert, state]);
|
|
25
|
-
const saveAsJSONHandler = useCallback(
|
|
25
|
+
const saveAsJSONHandler = useCallback((spaceIndent = 0, isCompressed = true) => {
|
|
26
26
|
if (state.data.length > 0) {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
alert
|
|
28
|
+
.showLoading('Exporting as NMRium process in progress')
|
|
29
|
+
.then((hideLoading) => {
|
|
29
30
|
async function handle() {
|
|
30
31
|
//exported file name by default will be the first spectrum name
|
|
31
32
|
const fileName = state.data[0]?.display?.name;
|
|
@@ -33,8 +34,10 @@ export default function useExport() {
|
|
|
33
34
|
await exportAsJSON(exportedData, fileName, spaceIndent, isCompressed);
|
|
34
35
|
hideLoading();
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
void handle();
|
|
39
|
+
}, 0);
|
|
40
|
+
});
|
|
38
41
|
}
|
|
39
42
|
}, [alert, state]);
|
|
40
43
|
const saveAsSVGHandler = useCallback(async () => {
|
|
@@ -25,7 +25,7 @@ export function useFormatNumberByNucleus(nucleus) {
|
|
|
25
25
|
return nucleus.map((n) => formatFun(n));
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
throw Error('nuclus must be string or array of string');
|
|
28
|
+
throw new Error('nuclus must be string or array of string');
|
|
29
29
|
}
|
|
30
30
|
}, [nucleus, nucleusByKey]);
|
|
31
31
|
}
|
|
@@ -44,11 +44,13 @@ export function usePanelPreferencesByNuclei(panelKey, nuclei) {
|
|
|
44
44
|
const { current } = usePreferences();
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
46
|
const { nuclei: omitNuclei = null, ...restPreferences } = getPanelPreferences(current, panelKey);
|
|
47
|
-
return useMemo(() =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
return useMemo(() => {
|
|
48
|
+
return {
|
|
49
|
+
nuclei: Object.fromEntries(nuclei.map((nucleusLabel) => [
|
|
50
|
+
nucleusLabel,
|
|
51
|
+
getPanelPreferences(current, panelKey, nucleusLabel, true),
|
|
52
|
+
])),
|
|
53
|
+
...restPreferences,
|
|
54
|
+
};
|
|
55
|
+
}, [current, nuclei, panelKey, restPreferences]);
|
|
54
56
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
+
import { fileCollectionFromFileList } from 'filelist-utils';
|
|
4
5
|
import { useCallback } from 'react';
|
|
5
6
|
import { useDropzone } from 'react-dropzone';
|
|
6
7
|
import { FaUpload } from 'react-icons/fa';
|
|
@@ -45,10 +46,17 @@ function DropZone(props) {
|
|
|
45
46
|
const dispatch = useDispatch();
|
|
46
47
|
const isToolEnabled = useCheckToolsVisibility();
|
|
47
48
|
const loadFilesHandler = useCallback((files) => {
|
|
48
|
-
|
|
49
|
+
for (const file of files) {
|
|
49
50
|
Object.defineProperty(file, 'webkitRelativePath', { value: file.path });
|
|
51
|
+
}
|
|
52
|
+
fileCollectionFromFileList(files)
|
|
53
|
+
.then((fileCollection) => {
|
|
54
|
+
dispatch({ type: LOAD_DROP_FILES, fileCollection });
|
|
55
|
+
})
|
|
56
|
+
.catch((error) => {
|
|
57
|
+
dispatch({ type: SET_LOADING_FLAG, isLoading: false });
|
|
58
|
+
reportError(error);
|
|
50
59
|
});
|
|
51
|
-
dispatch({ type: LOAD_DROP_FILES, files });
|
|
52
60
|
}, [dispatch]);
|
|
53
61
|
const onDrop = useCallback((droppedFiles) => {
|
|
54
62
|
dispatch({ type: SET_LOADING_FLAG, isLoading: true });
|
|
@@ -8,7 +8,7 @@ import Label from '../elements/Label';
|
|
|
8
8
|
import FormikForm from '../elements/formik/FormikForm';
|
|
9
9
|
import FormikInput from '../elements/formik/FormikInput';
|
|
10
10
|
import Events from '../utility/Events';
|
|
11
|
-
import { exportAsMatrix } from '../utility/
|
|
11
|
+
import { exportAsMatrix } from '../utility/export';
|
|
12
12
|
import { ModalStyles } from './ModalStyle';
|
|
13
13
|
const INITIAL_VALUE = { from: -1, to: 1, nbPoints: 1024 };
|
|
14
14
|
function ExportAsMatrixModal({ onClose = () => null, }) {
|
|
@@ -52,13 +52,13 @@ const styles = css `
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
|
-
const allowedExtensions = ['dx', 'jdx'];
|
|
55
|
+
const allowedExtensions = new Set(['dx', 'jdx']);
|
|
56
56
|
export default function LoadJCAMPModal({ onLoadClick, onClose, startLoading, }) {
|
|
57
57
|
const pathReft = useRef();
|
|
58
58
|
const loadJCAMPHandler = useCallback(() => {
|
|
59
59
|
const path = pathReft.current.value;
|
|
60
60
|
const { name, extension } = extractFileMetaFromPath(path);
|
|
61
|
-
if (allowedExtensions.
|
|
61
|
+
if (allowedExtensions.has(extension)) {
|
|
62
62
|
startLoading?.();
|
|
63
63
|
void loadFile(path, { asBuffer: true }).then((data) => {
|
|
64
64
|
const file = {
|
|
@@ -127,9 +127,9 @@ export default function MultipletAnalysisModal({ data, activeSpectrum, scaleX, s
|
|
|
127
127
|
setCalcFinished(true);
|
|
128
128
|
setAnalysisData(result);
|
|
129
129
|
}
|
|
130
|
-
catch (
|
|
131
|
-
//
|
|
132
|
-
|
|
130
|
+
catch (error) {
|
|
131
|
+
// TODO: handle error
|
|
132
|
+
reportError(error);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}, [startX, endX, data, scaleX, activeSpectrum, calcStart]);
|
|
@@ -137,13 +137,13 @@ function PredictSpectraModal({ onClose = () => null, molfile, }) {
|
|
|
137
137
|
isLoading: true,
|
|
138
138
|
});
|
|
139
139
|
const predictedSpectra = Object.entries(values.spectra)
|
|
140
|
-
.
|
|
140
|
+
.map(([key, value]) => {
|
|
141
141
|
if (value) {
|
|
142
|
-
|
|
142
|
+
return key;
|
|
143
143
|
}
|
|
144
|
-
return
|
|
145
|
-
}
|
|
146
|
-
.join('
|
|
144
|
+
return undefined;
|
|
145
|
+
})
|
|
146
|
+
.join(',');
|
|
147
147
|
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra} in progress`);
|
|
148
148
|
dispatch({
|
|
149
149
|
type: PREDICT_SPECTRA,
|
|
@@ -95,19 +95,19 @@ function EditRangeModal({ onSaveEditRangeModal = () => null, onCloseEditRangeMod
|
|
|
95
95
|
let counterJ = 0;
|
|
96
96
|
const couplings = [];
|
|
97
97
|
if (signal.multiplicity) {
|
|
98
|
-
signal.multiplicity.split('')
|
|
98
|
+
for (const multiplicity of signal.multiplicity.split('')) {
|
|
99
99
|
let js = {
|
|
100
|
-
multiplicity
|
|
100
|
+
multiplicity,
|
|
101
101
|
coupling: '',
|
|
102
102
|
};
|
|
103
|
-
if (hasCouplingConstant(
|
|
103
|
+
if (hasCouplingConstant(multiplicity) && signal?.js) {
|
|
104
104
|
js = { ...signal.js[counterJ] };
|
|
105
105
|
js.coupling = Number(formatNumber(js.coupling, rangesPreferences.coupling.format));
|
|
106
106
|
counterJ++;
|
|
107
107
|
}
|
|
108
108
|
js.multiplicity = translateMultiplet(js.multiplicity || '');
|
|
109
109
|
couplings.push(js);
|
|
110
|
-
}
|
|
110
|
+
}
|
|
111
111
|
}
|
|
112
112
|
return { ...signal, js: couplings };
|
|
113
113
|
});
|
|
@@ -18,7 +18,7 @@ const styles = {
|
|
|
18
18
|
color: 'red',
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
|
-
const EDIT_SIGNAL_INFO_TEXT = `Focus on an input field and press Shift + Drag
|
|
21
|
+
const EDIT_SIGNAL_INFO_TEXT = `Focus on an input field and press Shift + Drag and Drop to draw a coupling constant in spectrum view.`;
|
|
22
22
|
const ADD_SIGNAL_INFO_TEXT = `Focus on the input field and press Shift + Left mouse click to select new signal delta value in spectrum view.`;
|
|
23
23
|
const InfoText = (props) => {
|
|
24
24
|
const { value, type = 'info' } = props;
|
|
@@ -11,8 +11,8 @@ const useValidation = () => useMemo(() => {
|
|
|
11
11
|
coupling: Yup.mixed().test('checkValue', '', function testCoupling(value) {
|
|
12
12
|
const { path, createError } = this;
|
|
13
13
|
const hasCoupling = hasCouplingConstant(this.parent.multiplicity);
|
|
14
|
-
if ((!hasCoupling && isNaN(value)) ||
|
|
15
|
-
(hasCoupling && !isNaN(value))) {
|
|
14
|
+
if ((!hasCoupling && Number.isNaN(Number(value))) ||
|
|
15
|
+
(hasCoupling && !Number.isNaN(Number(value)))) {
|
|
16
16
|
return true;
|
|
17
17
|
}
|
|
18
18
|
return createError({
|