nmrium 0.24.1 → 0.27.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/Chart1D.js +3 -2
- package/lib/component/1d/FooterBanner.js +1 -1
- package/lib/component/1d/Integral.d.ts +2 -1
- package/lib/component/1d/Integral.js +5 -12
- package/lib/component/1d/IntegralResizable.d.ts +2 -1
- package/lib/component/1d/IntegralResizable.js +21 -16
- package/lib/component/1d/IntegralsSeries.js +3 -3
- package/lib/component/1d/Line.d.ts +2 -2
- package/lib/component/1d/PeakAnnotation.js +5 -4
- package/lib/component/1d/database/DatabaseElements.d.ts +3 -0
- package/lib/component/1d/database/DatabaseElements.js +18 -0
- package/lib/component/1d/database/DatabaseSpectrum.d.ts +3 -0
- package/lib/component/1d/database/DatabaseSpectrum.js +58 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.d.ts → database/ResurrectedDatabaseRanges.d.ts} +0 -0
- package/lib/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +36 -32
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +5 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -1
- package/lib/component/1d/ranges/Range.js +38 -39
- package/lib/component/1d/ranges/Ranges.js +6 -3
- package/lib/component/1d/tool/XLabelPointer.js +1 -1
- package/lib/component/2d/Chart2D.js +2 -1
- package/lib/component/2d/Contours.js +4 -1
- package/lib/component/2d/FooterBanner.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +1 -1
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.d.ts +2 -2
- package/lib/component/2d/tools/slicing/SliceScale.d.ts +1 -1
- package/lib/component/2d/tools/slicing/VerticalSliceChart.d.ts +2 -2
- package/lib/component/2d/zones/Signal.js +8 -8
- package/lib/component/2d/zones/Zone.js +3 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +11 -5
- package/lib/component/NMRium.d.ts +5 -1
- package/lib/component/NMRium.js +28 -32
- package/lib/component/SplitPaneWrapper.d.ts +4 -0
- package/lib/component/SplitPaneWrapper.js +8 -0
- package/lib/component/assignment/AssignmentsContext.d.ts +35 -0
- package/lib/component/assignment/AssignmentsContext.js +83 -0
- package/lib/component/assignment/AssignmentsReducer.d.ts +32 -0
- package/lib/component/assignment/AssignmentsReducer.js +39 -0
- package/lib/component/assignment/actions/initAssignment.d.ts +5 -0
- package/lib/component/assignment/actions/initAssignment.js +62 -0
- package/lib/component/assignment/actions/removeAssignment.d.ts +16 -0
- package/lib/component/assignment/actions/removeAssignment.js +24 -0
- package/lib/component/assignment/actions/setActiveAssignment.d.ts +10 -0
- package/lib/component/assignment/actions/setActiveAssignment.js +8 -0
- package/lib/component/assignment/actions/toggleAssignment.d.ts +7 -0
- package/lib/component/assignment/actions/toggleAssignment.js +44 -0
- package/lib/component/assignment/index.d.ts +0 -18
- package/lib/component/assignment/index.js +12 -266
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.d.ts +2 -0
- package/lib/component/assignment/utilities/filterForIDsWithAssignment.js +3 -0
- package/lib/component/context/GlobalContext.d.ts +15 -3
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +15 -12
- package/lib/component/context/PreferencesContext.js +1 -1
- package/lib/component/elements/ActionButtons.d.ts +10 -0
- package/lib/component/elements/ActionButtons.js +14 -0
- package/lib/component/elements/Button.d.ts +30 -5
- package/lib/component/elements/Button.js +151 -4
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- package/lib/component/elements/ContextMenu.js +6 -6
- package/lib/component/elements/EditableColumn.d.ts +3 -2
- package/lib/component/elements/EditableColumn.js +27 -20
- package/lib/component/elements/Input.d.ts +9 -1
- package/lib/component/elements/Input.js +18 -5
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +5 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +38 -10
- package/lib/component/elements/ReactTable/ReactTable.d.ts +3 -1
- package/lib/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib/component/elements/ReactTable/Style.d.ts +1 -3
- package/lib/component/elements/ReactTable/Style.js +1 -7
- package/lib/component/elements/Select.d.ts +1 -0
- package/lib/component/elements/Select.js +21 -15
- package/lib/component/elements/ToggleButton.d.ts +2 -1
- package/lib/component/elements/ToggleButton.js +2 -2
- package/lib/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/draggble/useDraggable.d.ts +22 -0
- package/lib/component/elements/draggble/useDraggable.js +70 -0
- package/lib/component/elements/formik/FormikColorPicker.d.ts +1 -0
- package/lib/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib/component/elements/formik/FormikColumnFormatField.d.ts +5 -4
- package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib/component/elements/formik/FormikInput.d.ts +1 -0
- package/lib/component/elements/formik/FormikInput.js +6 -3
- package/lib/component/elements/formik/FormikSlider.d.ts +1 -0
- package/lib/component/elements/formik/FormikSlider.js +6 -3
- package/lib/component/elements/popup/Alert/Provider.js +1 -1
- package/lib/component/elements/resizer/DivResizer.d.ts +2 -0
- package/lib/component/elements/resizer/DivResizer.js +62 -0
- package/lib/component/elements/resizer/Resizer.d.ts +20 -0
- package/lib/component/elements/resizer/Resizer.js +12 -0
- package/lib/component/elements/resizer/SVGResizer.d.ts +2 -0
- package/lib/component/elements/resizer/SVGResizer.js +42 -0
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/header/AutoPeakPickingOptionPanel.js +4 -15
- package/lib/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib/component/header/RangesPickingOptionPanel.js +3 -16
- package/lib/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib/component/header/Zones2DOptionPanel.js +3 -14
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +11 -9
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +1 -10
- package/lib/component/hooks/usePanelPreferences.d.ts +7 -0
- package/lib/component/hooks/usePanelPreferences.js +54 -0
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/loader/DefaultSpinnerComponent.d.ts +3 -1
- package/lib/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib/component/loader/DropZone.js +1 -0
- package/lib/component/loader/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/AlignSpectraModal.js +2 -1
- package/lib/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -6
- package/lib/component/modal/ModalStyle.js +4 -26
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -2
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib/component/modal/PredictSpectraModal.js +2 -7
- package/lib/component/modal/SaveAsModal.d.ts +1 -1
- package/lib/component/modal/SaveAsModal.js +2 -1
- package/lib/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +3 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +6 -0
- package/lib/component/modal/setting/DatabasesTabContent.js +75 -0
- package/lib/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib/component/modal/setting/FormattingTabContent.js +20 -14
- package/lib/component/modal/setting/GeneralSettings.js +4 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +56 -0
- package/lib/component/modal/setting/settingsValidation.js +46 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +4 -3
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.d.ts +10 -0
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +65 -0
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +0 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +26 -74
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.d.ts +8 -0
- package/lib/component/panels/MoleculesPanel/MoleculeHeader.js +38 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +31 -11
- package/lib/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +2 -2
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +1 -1
- package/lib/component/panels/Panels.js +2 -3
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +3 -3
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +29 -82
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +18 -25
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts +2 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +16 -10
- package/lib/component/panels/RangesPanel/RangesPanel.js +5 -11
- package/lib/component/panels/RangesPanel/RangesPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +55 -66
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +11 -6
- package/lib/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +5 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +15 -14
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.d.ts +2 -1
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.d.ts +16 -9
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.d.ts +2 -3
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.d.ts +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.d.ts +13 -0
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +14 -0
- package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +5 -18
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.d.ts +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/PlotChart.js +18 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.d.ts +1 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +7 -68
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.d.ts +6 -0
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +51 -0
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.d.ts +5 -7
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts +5 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.d.ts +5 -9
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.d.ts +4 -8
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +20 -84
- package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +7 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +22 -22
- package/lib/component/panels/databasePanel/DatabasePanel.js +73 -40
- package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib/component/panels/databasePanel/DatabaseTable.js +23 -11
- package/lib/component/panels/databasePanel/useDatabases.d.ts +5 -0
- package/lib/component/panels/databasePanel/useDatabases.js +10 -0
- package/lib/component/panels/extra/placeholder/NoTableData.d.ts +3 -1
- package/lib/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib/component/panels/extra/preferences/NucleusPreferences.d.ts +13 -0
- package/lib/component/panels/extra/preferences/NucleusPreferences.js +22 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.d.ts +6 -0
- package/lib/component/panels/extra/preferences/PreferencesContainer.js +10 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.d.ts +7 -0
- package/lib/component/panels/extra/preferences/PreferencesGroup.js +21 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +2 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +30 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib/component/reducer/Reducer.d.ts +360 -45
- package/lib/component/reducer/Reducer.js +9 -2
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +9 -0
- package/lib/component/reducer/actions/AssignmentsActions.js +18 -0
- package/lib/component/reducer/actions/LoadActions.d.ts +1 -1
- package/lib/component/reducer/actions/LoadActions.js +11 -6
- package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -2
- package/lib/component/reducer/actions/MoleculeActions.js +15 -3
- package/lib/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +1 -1
- package/lib/component/reducer/preferences/actions/addWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/addWorkspace.js +19 -0
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/initPreferences.js +60 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/removeWorkspace.js +20 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/resetPreferences.js +14 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +13 -0
- package/lib/component/reducer/preferences/actions/setPreferences.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setPreferences.js +34 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/actions/setWorkspace.js +8 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts +7 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +55 -0
- package/lib/component/reducer/{preferencesReducer.d.ts → preferences/preferencesReducer.d.ts} +132 -15
- package/lib/component/reducer/preferences/preferencesReducer.js +80 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/checkKeysExists.js +14 -0
- package/lib/component/reducer/preferences/utilites/filterObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/filterObject.js +7 -0
- package/lib/component/reducer/preferences/utilites/flatObject.d.ts +1 -0
- package/lib/component/reducer/preferences/utilites/flatObject.js +9 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.d.ts +3 -0
- package/lib/component/reducer/preferences/utilites/getActiveWorkspace.js +3 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.d.ts +2 -0
- package/lib/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +4 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.d.ts +5 -0
- package/lib/component/reducer/preferences/utilites/mapNucleiFormatting.js +8 -0
- package/lib/component/reducer/types/Types.d.ts +3 -0
- package/lib/component/reducer/types/Types.js +3 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.d.ts +4 -0
- package/lib/component/tool/FloatMoleculeStructures/ActionsButton.js +7 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.d.ts +14 -0
- package/lib/component/tool/FloatMoleculeStructures/DraggableStructure.js +43 -0
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
- package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
- package/lib/component/utility/Export.d.ts +3 -3
- package/lib/component/utility/Export.js +16 -9
- package/lib/component/utility/PathBuilder.js +2 -1
- package/lib/component/utility/formatNumber.d.ts +3 -0
- package/lib/component/utility/formatNumber.js +10 -0
- package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
- package/lib/component/utility/getUniqueNuclei.js +10 -0
- package/lib/component/workspaces/Workspace.d.ts +74 -5
- package/lib/component/workspaces/basic.js +17 -10
- package/lib/component/workspaces/embedded.d.ts +2 -0
- package/lib/component/workspaces/embedded.js +32 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -1
- package/lib/component/workspaces/prediction.js +2 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/data/SpectraManager.js +23 -15
- package/lib/data/data1d/Data1DManager.d.ts +1 -1
- package/lib/data/data1d/Data1DManager.js +6 -1
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib/data/data1d/Spectrum1D/toJSON.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib/data/data1d/database.d.ts +9 -15
- package/lib/data/data1d/database.js +15 -20
- package/lib/data/data1d/filter1d/absolute.d.ts +3 -2
- package/lib/data/data1d/filter1d/autoPhaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/baselineCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/centerMean.d.ts +3 -2
- package/lib/data/data1d/filter1d/digitalFilter.d.ts +3 -2
- package/lib/data/data1d/filter1d/equallySpaced.d.ts +3 -2
- package/lib/data/data1d/filter1d/exclusionZones.d.ts +1 -4
- package/lib/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib/data/data1d/filter1d/fft.d.ts +3 -2
- package/lib/data/data1d/filter1d/fft.js +2 -2
- package/lib/data/data1d/filter1d/fromTo.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.d.ts +3 -2
- package/lib/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib/data/data1d/filter1d/pareto.d.ts +3 -2
- package/lib/data/data1d/filter1d/pareto.js +2 -2
- package/lib/data/data1d/filter1d/phaseCorrection.d.ts +3 -2
- package/lib/data/data1d/filter1d/shiftX.d.ts +2 -1
- package/lib/data/data1d/filter1d/standardDeviation.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.d.ts +3 -2
- package/lib/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib/data/data2d/Data2DManager.d.ts +1 -1
- package/lib/data/data2d/Data2DManager.js +6 -1
- package/lib/data/data2d/Spectrum2D/toJSON.d.ts +2 -0
- package/lib/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib/data/data2d/filter2d/shiftX.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftX.js +2 -2
- package/lib/data/data2d/filter2d/shiftY.d.ts +4 -3
- package/lib/data/data2d/filter2d/shiftY.js +2 -2
- package/lib/data/molecules/Molecule.d.ts +3 -3
- package/lib/data/molecules/Molecule.js +7 -1
- package/lib/data/molecules/MoleculeManager.d.ts +4 -1
- package/lib/data/molecules/MoleculeManager.js +33 -2
- package/lib/data/types/common/Source.d.ts +1 -0
- package/lib/data/types/data1d/Data1D.d.ts +3 -3
- package/lib/data/types/data1d/Info1D.d.ts +1 -0
- package/lib/data/types/data2d/Signal2DAxisData.d.ts +1 -1
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/FooterBanner.js +2 -2
- package/lib-cjs/component/1d/Integral.js +5 -12
- package/lib-cjs/component/1d/IntegralResizable.js +20 -15
- package/lib-cjs/component/1d/IntegralsSeries.js +3 -3
- package/lib-cjs/component/1d/PeakAnnotation.js +5 -4
- package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +60 -0
- package/lib-cjs/component/1d/{ResurrectedDatabaseRanges.js → database/ResurrectedDatabaseRanges.js} +9 -6
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +4 -10
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +35 -31
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +6 -6
- package/lib-cjs/component/1d/ranges/Range.js +40 -41
- package/lib-cjs/component/1d/ranges/Ranges.js +6 -3
- package/lib-cjs/component/1d/tool/XLabelPointer.js +2 -2
- package/lib-cjs/component/2d/Chart2D.js +2 -1
- package/lib-cjs/component/2d/Contours.js +4 -1
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/zones/Signal.js +9 -9
- package/lib-cjs/component/2d/zones/Zone.js +4 -4
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +12 -6
- package/lib-cjs/component/NMRium.js +27 -31
- package/lib-cjs/component/SplitPaneWrapper.js +12 -0
- package/lib-cjs/component/assignment/AssignmentsContext.js +88 -0
- package/lib-cjs/component/assignment/AssignmentsReducer.js +45 -0
- package/lib-cjs/component/assignment/actions/initAssignment.js +65 -0
- package/lib-cjs/component/assignment/actions/removeAssignment.js +29 -0
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +11 -0
- package/lib-cjs/component/assignment/actions/toggleAssignment.js +47 -0
- package/lib-cjs/component/assignment/index.js +15 -269
- package/lib-cjs/component/assignment/utilities/filterForIDsWithAssignment.js +7 -0
- package/lib-cjs/component/context/GlobalContext.js +1 -1
- package/lib-cjs/component/context/PreferencesContext.js +1 -1
- package/lib-cjs/component/elements/ActionButtons.js +20 -0
- package/lib-cjs/component/elements/Button.js +150 -4
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/ContextMenu.js +6 -6
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +42 -14
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +7 -2
- package/lib-cjs/component/elements/ReactTable/Style.js +1 -9
- package/lib-cjs/component/elements/Select.js +20 -14
- package/lib-cjs/component/elements/ToggleButton.js +2 -2
- package/lib-cjs/component/elements/ToolTip/ToolTip.js +3 -2
- package/lib-cjs/component/elements/draggble/SVGDraggable.js +39 -0
- package/lib-cjs/component/elements/draggble/useDraggable.js +73 -0
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +10 -7
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib-cjs/component/elements/formik/FormikInput.js +6 -3
- package/lib-cjs/component/elements/formik/FormikSlider.js +6 -3
- package/lib-cjs/component/elements/popup/Alert/Provider.js +1 -1
- package/lib-cjs/component/elements/resizer/DivResizer.js +68 -0
- package/lib-cjs/component/elements/resizer/Resizer.js +18 -0
- package/lib-cjs/component/elements/resizer/SVGResizer.js +48 -0
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +2 -9
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -15
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +2 -9
- package/lib-cjs/component/header/Zones2DOptionPanel.js +2 -13
- package/lib-cjs/component/hooks/useExport.js +11 -9
- package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +2 -12
- package/lib-cjs/component/hooks/usePanelPreferences.js +62 -0
- package/lib-cjs/component/loader/DefaultSpinnerComponent.js +2 -2
- package/lib-cjs/component/loader/DropZone.js +1 -0
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +2 -1
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +2 -1
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +2 -1
- package/lib-cjs/component/modal/LoadJCAMPModal.js +7 -6
- package/lib-cjs/component/modal/ModalStyle.js +4 -26
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +29 -2
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +2 -7
- package/lib-cjs/component/modal/SaveAsModal.js +2 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +6 -5
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +3 -6
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +12 -9
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +80 -0
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +11 -7
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +19 -13
- package/lib-cjs/component/modal/setting/GeneralSettings.js +4 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +72 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +6 -4
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +13 -6
- package/lib-cjs/component/panels/AutomaticAssignment/useAutoAssignments.js +72 -0
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +2 -5
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +10 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +24 -72
- package/lib-cjs/component/panels/MoleculesPanel/MoleculeHeader.js +44 -0
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +12 -23
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +21 -7
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +61 -68
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +55 -60
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/Panels.js +2 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +4 -4
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +27 -80
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +18 -48
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +17 -11
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +6 -12
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +53 -64
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -7
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +18 -17
- package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +5 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +2 -5
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +3 -4
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaHzColumn.js +16 -0
- package/lib-cjs/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -16
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/PlotChart.js +21 -0
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -8
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +10 -68
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +8 -21
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +55 -0
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +3 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +4 -4
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +18 -82
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +4 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +23 -23
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +72 -39
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +22 -10
- package/lib-cjs/component/panels/databasePanel/useDatabases.js +14 -0
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +3 -3
- package/lib-cjs/component/panels/extra/preferences/NucleusPreferences.js +29 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesContainer.js +14 -0
- package/lib-cjs/component/panels/extra/preferences/PreferencesGroup.js +25 -0
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +37 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +2 -18
- package/lib-cjs/component/reducer/Reducer.js +9 -2
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +21 -0
- package/lib-cjs/component/reducer/actions/LoadActions.js +10 -5
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +17 -3
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/addWorkspace.js +26 -0
- package/lib-cjs/component/reducer/preferences/actions/initPreferences.js +67 -0
- package/lib-cjs/component/reducer/preferences/actions/removeWorkspace.js +24 -0
- package/lib-cjs/component/reducer/preferences/actions/resetPreferences.js +18 -0
- package/lib-cjs/component/reducer/preferences/actions/setPanelsPreferences.js +17 -0
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +38 -0
- package/lib-cjs/component/reducer/preferences/actions/setWorkspace.js +12 -0
- package/lib-cjs/component/reducer/preferences/panelsPreferencesDefaultValues.js +62 -0
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +87 -0
- package/lib-cjs/component/reducer/preferences/utilites/checkKeysExists.js +18 -0
- package/lib-cjs/component/reducer/preferences/utilites/filterObject.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/flatObject.js +13 -0
- package/lib-cjs/component/reducer/preferences/utilites/getActiveWorkspace.js +7 -0
- package/lib-cjs/component/reducer/preferences/utilites/getPreferencesByWorkspace.js +11 -0
- package/lib-cjs/component/reducer/preferences/utilites/mapNucleiFormatting.js +12 -0
- package/lib-cjs/component/reducer/types/Types.js +6 -3
- package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +50 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
- package/lib-cjs/component/utility/Export.js +16 -9
- package/lib-cjs/component/utility/PathBuilder.js +2 -1
- package/lib-cjs/component/utility/formatNumber.js +17 -0
- package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
- package/lib-cjs/component/workspaces/basic.js +17 -10
- package/lib-cjs/component/workspaces/embedded.js +35 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/index.js +2 -1
- package/lib-cjs/component/workspaces/prediction.js +2 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/data/SpectraManager.js +23 -15
- package/lib-cjs/data/data1d/Data1DManager.js +6 -1
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib-cjs/data/data1d/database.js +15 -21
- package/lib-cjs/data/data1d/filter1d/exclusionZones.js +4 -4
- package/lib-cjs/data/data1d/filter1d/fft.js +2 -2
- package/lib-cjs/data/data1d/filter1d/lineBroadening.js +1 -1
- package/lib-cjs/data/data1d/filter1d/pareto.js +2 -2
- package/lib-cjs/data/data1d/filter1d/shiftX.js +2 -2
- package/lib-cjs/data/data1d/filter1d/zeroFilling.js +1 -1
- package/lib-cjs/data/data2d/Data2DManager.js +6 -1
- package/lib-cjs/data/data2d/Spectrum2D/toJSON.js +1 -0
- package/lib-cjs/data/data2d/filter2d/shiftX.js +4 -4
- package/lib-cjs/data/data2d/filter2d/shiftY.js +4 -4
- package/lib-cjs/data/molecules/Molecule.js +7 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +49 -48
- package/lib/component/1d/Resizable.d.ts +0 -12
- package/lib/component/1d/Resizable.js +0 -105
- package/lib/component/panels/extra/preferences/defaultValues.d.ts +0 -54
- package/lib/component/panels/extra/preferences/defaultValues.js +0 -54
- package/lib/component/reducer/preferencesReducer.js +0 -272
- package/lib/component/utility/FormatNumber.d.ts +0 -6
- package/lib-cjs/component/1d/Resizable.js +0 -110
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -279
|
@@ -96,11 +96,16 @@ function setPreferences(draft, data) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
function initiate(draft, action) {
|
|
99
|
-
|
|
99
|
+
const state = (0, Reducer_1.getInitialState)();
|
|
100
|
+
setData(state, action.payload);
|
|
100
101
|
const preferences = action.payload?.preferences || {};
|
|
101
|
-
(0, ToolsActions_1.setActiveTab)(
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
(0, ToolsActions_1.setActiveTab)(state, { tab: preferences?.activeTab || '' });
|
|
103
|
+
state.width = draft.width;
|
|
104
|
+
state.height = draft.height;
|
|
105
|
+
setPreferences(state, action.payload);
|
|
106
|
+
state.isLoading = false;
|
|
107
|
+
state.actionType = Types_1.INITIATE;
|
|
108
|
+
return state;
|
|
104
109
|
}
|
|
105
110
|
exports.initiate = initiate;
|
|
106
111
|
function loadJDFFile(draft, actions) {
|
|
@@ -129,9 +134,9 @@ function handleLoadJsonFile(draft, action) {
|
|
|
129
134
|
setData(state, action.payload);
|
|
130
135
|
const preferences = action.payload?.preferences || {};
|
|
131
136
|
(0, ToolsActions_1.setActiveTab)(state, { tab: preferences?.activeTab || '' });
|
|
132
|
-
setPreferences(state, preferences);
|
|
133
137
|
state.width = draft.width;
|
|
134
138
|
state.height = draft.height;
|
|
139
|
+
setPreferences(state, preferences);
|
|
135
140
|
state.isLoading = false;
|
|
136
141
|
state.actionType = Types_1.LOAD_JSON_FILE;
|
|
137
142
|
return state;
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.predictSpectraFromMoleculeHandler = exports.deleteMoleculeHandler = exports.setMoleculeHandler = exports.addMoleculeHandler = void 0;
|
|
29
|
+
exports.changeMoleculeLabel = exports.floatMoleculeOverSpectrum = exports.predictSpectraFromMoleculeHandler = exports.deleteMoleculeHandler = exports.setMoleculeHandler = exports.addMoleculeHandler = void 0;
|
|
30
30
|
const PredictionManager_1 = require("../../../data/PredictionManager");
|
|
31
31
|
const SumManager_1 = require("../../../data/data1d/Spectrum1D/SumManager");
|
|
32
32
|
const MoleculeManager = __importStar(require("../../../data/molecules/MoleculeManager"));
|
|
@@ -49,8 +49,9 @@ function addMoleculeHandler(draft, molfile) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
exports.addMoleculeHandler = addMoleculeHandler;
|
|
52
|
-
function setMoleculeHandler(draft,
|
|
53
|
-
|
|
52
|
+
function setMoleculeHandler(draft, action) {
|
|
53
|
+
const { key, label, molfile, isFloat } = action.payload;
|
|
54
|
+
MoleculeManager.setMolfile(draft.molecules, { key, label, molfile, isFloat });
|
|
54
55
|
/**
|
|
55
56
|
* update all spectra that its sum was based on this molecule with the new molecule
|
|
56
57
|
*/
|
|
@@ -100,3 +101,16 @@ function predictSpectraFromMoleculeHandler(draft, action) {
|
|
|
100
101
|
draft.isLoading = false;
|
|
101
102
|
}
|
|
102
103
|
exports.predictSpectraFromMoleculeHandler = predictSpectraFromMoleculeHandler;
|
|
104
|
+
function floatMoleculeOverSpectrum(draft, action) {
|
|
105
|
+
const { key } = action.payload;
|
|
106
|
+
const moleculeIndex = draft.molecules.findIndex((molecule) => molecule.key === key);
|
|
107
|
+
draft.molecules[moleculeIndex].isFloat =
|
|
108
|
+
!draft.molecules[moleculeIndex].isFloat;
|
|
109
|
+
}
|
|
110
|
+
exports.floatMoleculeOverSpectrum = floatMoleculeOverSpectrum;
|
|
111
|
+
function changeMoleculeLabel(draft, action) {
|
|
112
|
+
const { key, label } = action.payload;
|
|
113
|
+
const moleculeIndex = draft.molecules.findIndex((molecule) => molecule.key === key);
|
|
114
|
+
draft.molecules[moleculeIndex].label = label;
|
|
115
|
+
}
|
|
116
|
+
exports.changeMoleculeLabel = changeMoleculeLabel;
|
|
@@ -38,7 +38,7 @@ function changeSpectrumVerticalAlignment(draft, options) {
|
|
|
38
38
|
case 'stack': {
|
|
39
39
|
draft.verticalAlign.align = 'stack';
|
|
40
40
|
const visibleSpectra = dataPerNucleus.filter((datum) => datum.display.isVisible === true);
|
|
41
|
-
draft.verticalAlign.verticalShift = Math.floor((draft.height - draft.margin.bottom) / (visibleSpectra.length + 2));
|
|
41
|
+
draft.verticalAlign.verticalShift = Math.abs(Math.floor((draft.height - draft.margin.bottom) / (visibleSpectra.length + 2)));
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
default:
|
|
@@ -425,7 +425,7 @@ exports.setTab = setTab;
|
|
|
425
425
|
function setActiveTab(draft, options) {
|
|
426
426
|
const { tab = null, refreshActiveTab = false, domainOptions = {}, } = options || {};
|
|
427
427
|
const groupByNucleus = (0, GroupByInfoKey_1.default)('nucleus');
|
|
428
|
-
const dataGroupByNucleus = groupByNucleus(draft.data);
|
|
428
|
+
const dataGroupByNucleus = groupByNucleus(draft.data, true);
|
|
429
429
|
const tabs = Object.keys(dataGroupByNucleus);
|
|
430
430
|
const currentTab = !tab || !tabs.includes(tab || '') ? tabs[0] : tab;
|
|
431
431
|
setTab(draft, dataGroupByNucleus, currentTab, refreshActiveTab);
|
|
@@ -0,0 +1,26 @@
|
|
|
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.addWorkspace = void 0;
|
|
7
|
+
const generateID_1 = __importDefault(require("../../../../data/utilities/generateID"));
|
|
8
|
+
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
9
|
+
function addWorkspace(draft, action) {
|
|
10
|
+
const { workspace: workspaceName, data: { display, controllers, formatting, databases }, } = action.payload;
|
|
11
|
+
const newWorkSpace = {
|
|
12
|
+
version: 1,
|
|
13
|
+
label: workspaceName,
|
|
14
|
+
display,
|
|
15
|
+
controllers,
|
|
16
|
+
formatting,
|
|
17
|
+
databases,
|
|
18
|
+
};
|
|
19
|
+
const newWorkspaceKey = (0, generateID_1.default)();
|
|
20
|
+
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
21
|
+
localData.workspaces[newWorkspaceKey] = newWorkSpace;
|
|
22
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
23
|
+
draft.workspaces[newWorkspaceKey] = newWorkSpace;
|
|
24
|
+
draft.workspace.current = newWorkspaceKey;
|
|
25
|
+
}
|
|
26
|
+
exports.addWorkspace = addWorkspace;
|
|
@@ -0,0 +1,67 @@
|
|
|
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.initPreferences = void 0;
|
|
7
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
8
|
+
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
9
|
+
const workspaces_1 = __importDefault(require("../../../workspaces"));
|
|
10
|
+
const checkKeysExists_1 = require("../utilites/checkKeysExists");
|
|
11
|
+
const filterObject_1 = require("../utilites/filterObject");
|
|
12
|
+
const getActiveWorkspace_1 = require("../utilites/getActiveWorkspace");
|
|
13
|
+
const getPreferencesByWorkspace_1 = require("../utilites/getPreferencesByWorkspace");
|
|
14
|
+
function initPreferences(draft, action) {
|
|
15
|
+
if (action.payload) {
|
|
16
|
+
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
17
|
+
const { dispatch, workspace, ...resProps } = action.payload;
|
|
18
|
+
/**
|
|
19
|
+
* set the current workspace what the user-defined in the setting if the workspace is not defined at the level of component, otherwise
|
|
20
|
+
* use the default workspace
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
draft.workspace =
|
|
24
|
+
!workspace && localData?.currentWorkspace
|
|
25
|
+
? { current: localData.currentWorkspace, base: null }
|
|
26
|
+
: { current: workspace || 'default', base: workspace };
|
|
27
|
+
const workspacePreferences = (0, merge_1.default)({}, (0, getPreferencesByWorkspace_1.getPreferencesByWorkspace)(draft.workspace.current), resProps);
|
|
28
|
+
const currentWorkspacePreferences = (0, getActiveWorkspace_1.getActiveWorkspace)(draft);
|
|
29
|
+
/**
|
|
30
|
+
* Update the local storage general preferences
|
|
31
|
+
* 1- if local storage is empty.
|
|
32
|
+
* 2- if predefine workspaces.
|
|
33
|
+
* 3- b) if workspace not exists in the local storage
|
|
34
|
+
* c) if the local setting workspace version != current workspace version number
|
|
35
|
+
* d) if hard code workspace parameters != current workspace parameters
|
|
36
|
+
*/
|
|
37
|
+
if ((workspaces_1.default[draft.workspace.current] &&
|
|
38
|
+
(!currentWorkspacePreferences ||
|
|
39
|
+
workspacePreferences?.version !==
|
|
40
|
+
currentWorkspacePreferences?.version ||
|
|
41
|
+
!(0, checkKeysExists_1.checkKeysExists)(workspacePreferences.display, currentWorkspacePreferences?.display))) ||
|
|
42
|
+
!localData) {
|
|
43
|
+
const { workspaces, version, workspace: { current }, } = draft || {};
|
|
44
|
+
const display = (0, filterObject_1.filterObject)(workspacePreferences.display);
|
|
45
|
+
const data = {
|
|
46
|
+
version,
|
|
47
|
+
...(localData?.currentWorkspace && {
|
|
48
|
+
currentWorkspace: localData?.currentWorkspace,
|
|
49
|
+
}),
|
|
50
|
+
workspaces: {
|
|
51
|
+
...workspaces,
|
|
52
|
+
[current]: {
|
|
53
|
+
...workspacePreferences,
|
|
54
|
+
display,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
draft.workspaces[current] = (0, merge_1.default)({}, currentWorkspacePreferences, workspacePreferences);
|
|
59
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(data));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
currentWorkspacePreferences.display = (0, merge_1.default)({}, workspacePreferences.display, currentWorkspacePreferences.display);
|
|
63
|
+
}
|
|
64
|
+
draft.dispatch = dispatch;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.initPreferences = initPreferences;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeWorkspace = void 0;
|
|
4
|
+
const immer_1 = require("immer");
|
|
5
|
+
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
6
|
+
const filterObject_1 = require("../utilites/filterObject");
|
|
7
|
+
function removeWorkspace(draft, action) {
|
|
8
|
+
const { workspace } = action.payload;
|
|
9
|
+
if (workspace === draft.workspace.current) {
|
|
10
|
+
draft.workspace.current = 'default';
|
|
11
|
+
}
|
|
12
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
13
|
+
const storedWorkspaces = (0, immer_1.original)(draft)?.workspaces || {};
|
|
14
|
+
const workspaces = Object.keys(storedWorkspaces).reduce((acc, key) => {
|
|
15
|
+
if (key !== workspace) {
|
|
16
|
+
acc[key] = storedWorkspaces[key];
|
|
17
|
+
}
|
|
18
|
+
return acc;
|
|
19
|
+
}, {});
|
|
20
|
+
draft.workspaces = workspaces;
|
|
21
|
+
localData.workspaces = (0, filterObject_1.filterObject)(workspaces);
|
|
22
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
23
|
+
}
|
|
24
|
+
exports.removeWorkspace = removeWorkspace;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resetPreferences = void 0;
|
|
4
|
+
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
5
|
+
const getActiveWorkspace_1 = require("../utilites/getActiveWorkspace");
|
|
6
|
+
const getPreferencesByWorkspace_1 = require("../utilites/getPreferencesByWorkspace");
|
|
7
|
+
function resetPreferences(draft) {
|
|
8
|
+
const currentWorkspacePreferences = (0, getActiveWorkspace_1.getActiveWorkspace)(draft);
|
|
9
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
10
|
+
const workSpaceDisplayPreferences = (0, getPreferencesByWorkspace_1.getPreferencesByWorkspace)(draft.workspace.current).display;
|
|
11
|
+
if (localData.workspaces[draft.workspace.current]) {
|
|
12
|
+
localData.workspaces[draft.workspace.current].display =
|
|
13
|
+
workSpaceDisplayPreferences;
|
|
14
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
15
|
+
}
|
|
16
|
+
currentWorkspacePreferences.display = workSpaceDisplayPreferences;
|
|
17
|
+
}
|
|
18
|
+
exports.resetPreferences = resetPreferences;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPanelsPreferences = void 0;
|
|
4
|
+
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
5
|
+
const getActiveWorkspace_1 = require("../utilites/getActiveWorkspace");
|
|
6
|
+
function setPanelsPreferences(draft, action) {
|
|
7
|
+
if (action.payload) {
|
|
8
|
+
const currentWorkspacePreferences = (0, getActiveWorkspace_1.getActiveWorkspace)(draft);
|
|
9
|
+
const { key, value } = action.payload;
|
|
10
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
11
|
+
localData.workspaces[draft.workspace.current].formatting.panels[key] =
|
|
12
|
+
value;
|
|
13
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
14
|
+
currentWorkspacePreferences.formatting.panels[key] = value;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.setPanelsPreferences = setPanelsPreferences;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPreferences = void 0;
|
|
4
|
+
const LocalStorage_1 = require("../../../utility/LocalStorage");
|
|
5
|
+
const getActiveWorkspace_1 = require("../utilites/getActiveWorkspace");
|
|
6
|
+
const mapNucleiFormatting_1 = require("../utilites/mapNucleiFormatting");
|
|
7
|
+
function setPreferences(draft, action) {
|
|
8
|
+
if (action.payload) {
|
|
9
|
+
const currentWorkspacePreferences = (0, getActiveWorkspace_1.getActiveWorkspace)(draft);
|
|
10
|
+
let { controllers, formatting, display, databases } = action.payload;
|
|
11
|
+
formatting = (0, mapNucleiFormatting_1.mapNucleiFormatting)(formatting);
|
|
12
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
13
|
+
localData.currentWorkspace = draft.workspace.current;
|
|
14
|
+
localData.workspaces = {
|
|
15
|
+
...localData.workspaces,
|
|
16
|
+
[draft.workspace.current]: {
|
|
17
|
+
...localData.workspaces[draft.workspace.current],
|
|
18
|
+
controllers,
|
|
19
|
+
formatting,
|
|
20
|
+
display,
|
|
21
|
+
databases,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
25
|
+
currentWorkspacePreferences.controllers = controllers;
|
|
26
|
+
currentWorkspacePreferences.formatting = formatting;
|
|
27
|
+
currentWorkspacePreferences.databases = databases;
|
|
28
|
+
currentWorkspacePreferences.display = {
|
|
29
|
+
...currentWorkspacePreferences.display,
|
|
30
|
+
panels: display.panels,
|
|
31
|
+
general: {
|
|
32
|
+
...(currentWorkspacePreferences.display.general || {}),
|
|
33
|
+
experimentalFeatures: display.general.experimentalFeatures,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.setPreferences = setPreferences;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setWorkspace = void 0;
|
|
4
|
+
const getPreferencesByWorkspace_1 = require("../utilites/getPreferencesByWorkspace");
|
|
5
|
+
function setWorkspace(draft, action) {
|
|
6
|
+
const workspaceKey = action.payload.workspace;
|
|
7
|
+
if (!draft.workspaces[workspaceKey]) {
|
|
8
|
+
draft.workspaces[workspaceKey] = (0, getPreferencesByWorkspace_1.getPreferencesByWorkspace)(workspaceKey);
|
|
9
|
+
}
|
|
10
|
+
draft.workspace.current = workspaceKey;
|
|
11
|
+
}
|
|
12
|
+
exports.setWorkspace = setWorkspace;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.databaseDefaultValues = exports.getZoneDefaultValues = exports.getRangeDefaultValues = exports.getIntegralDefaultValues = exports.getPeaksDefaultValues = void 0;
|
|
4
|
+
function getPreferences(data, nucleus) {
|
|
5
|
+
return { nuclei: { ...(nucleus ? { [nucleus]: data } : {}) } };
|
|
6
|
+
}
|
|
7
|
+
const getIntegralDefaultValues = (nucleus) => {
|
|
8
|
+
const preferences = {
|
|
9
|
+
absolute: { show: false, format: '0.00' },
|
|
10
|
+
relative: { show: true, format: '0.00' },
|
|
11
|
+
color: '#000000',
|
|
12
|
+
strokeWidth: 1,
|
|
13
|
+
};
|
|
14
|
+
return getPreferences(preferences, nucleus);
|
|
15
|
+
};
|
|
16
|
+
exports.getIntegralDefaultValues = getIntegralDefaultValues;
|
|
17
|
+
const getZoneDefaultValues = (nucleus) => ({
|
|
18
|
+
absolute: { show: false, format: '0.00' },
|
|
19
|
+
relative: { show: true, format: '0.00' },
|
|
20
|
+
...getPreferences({ deltaPPM: { show: true, format: '0.00' } }, nucleus),
|
|
21
|
+
});
|
|
22
|
+
exports.getZoneDefaultValues = getZoneDefaultValues;
|
|
23
|
+
const getRangeDefaultValues = (nucleus) => {
|
|
24
|
+
const preferences = {
|
|
25
|
+
from: { show: false, format: '0.00' },
|
|
26
|
+
to: { show: false, format: '0.00' },
|
|
27
|
+
absolute: { show: false, format: '0.00' },
|
|
28
|
+
relative: { show: true, format: '0.00' },
|
|
29
|
+
deltaPPM: { show: true, format: '0.00' },
|
|
30
|
+
deltaHz: { show: false, format: '0.00' },
|
|
31
|
+
coupling: { show: true, format: '0.00' },
|
|
32
|
+
jGraphTolerance: nucleus === '1H' ? 0.2 : nucleus === '13C' ? 2 : 0,
|
|
33
|
+
showKind: true,
|
|
34
|
+
};
|
|
35
|
+
return getPreferences(preferences, nucleus);
|
|
36
|
+
};
|
|
37
|
+
exports.getRangeDefaultValues = getRangeDefaultValues;
|
|
38
|
+
const getPeaksDefaultValues = (nucleus) => {
|
|
39
|
+
const preferences = {
|
|
40
|
+
peakNumber: { show: true, format: '0' },
|
|
41
|
+
deltaPPM: { show: true, format: '0.00' },
|
|
42
|
+
deltaHz: { show: false, format: '0.00' },
|
|
43
|
+
peakWidth: { show: false, format: '0.00' },
|
|
44
|
+
intensity: { show: true, format: '0.00' },
|
|
45
|
+
};
|
|
46
|
+
return getPreferences(preferences, nucleus);
|
|
47
|
+
};
|
|
48
|
+
exports.getPeaksDefaultValues = getPeaksDefaultValues;
|
|
49
|
+
const databaseDefaultValues = {
|
|
50
|
+
previewJcamp: true,
|
|
51
|
+
showSmiles: true,
|
|
52
|
+
showSolvent: false,
|
|
53
|
+
showNames: true,
|
|
54
|
+
showRange: false,
|
|
55
|
+
showDelta: true,
|
|
56
|
+
showAssignment: false,
|
|
57
|
+
showCoupling: true,
|
|
58
|
+
showMultiplicity: true,
|
|
59
|
+
color: 'black',
|
|
60
|
+
marginBottom: 30,
|
|
61
|
+
};
|
|
62
|
+
exports.databaseDefaultValues = databaseDefaultValues;
|
|
@@ -0,0 +1,87 @@
|
|
|
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.initPreferencesState = exports.preferencesInitialState = exports.WORKSPACES = void 0;
|
|
7
|
+
const immer_1 = require("immer");
|
|
8
|
+
const LocalStorage_1 = require("../../utility/LocalStorage");
|
|
9
|
+
const workspaces_1 = __importDefault(require("../../workspaces"));
|
|
10
|
+
const addWorkspace_1 = require("./actions/addWorkspace");
|
|
11
|
+
const initPreferences_1 = require("./actions/initPreferences");
|
|
12
|
+
const removeWorkspace_1 = require("./actions/removeWorkspace");
|
|
13
|
+
const resetPreferences_1 = require("./actions/resetPreferences");
|
|
14
|
+
const setPanelsPreferences_1 = require("./actions/setPanelsPreferences");
|
|
15
|
+
const setPreferences_1 = require("./actions/setPreferences");
|
|
16
|
+
const setWorkspace_1 = require("./actions/setWorkspace");
|
|
17
|
+
const LOCAL_STORAGE_VERSION = 8;
|
|
18
|
+
exports.WORKSPACES = [
|
|
19
|
+
{
|
|
20
|
+
key: 'default',
|
|
21
|
+
label: workspaces_1.default.default.label,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: 'process1D',
|
|
25
|
+
label: workspaces_1.default.process1D.label,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: 'exercise',
|
|
29
|
+
label: workspaces_1.default.exercise.label,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: 'prediction',
|
|
33
|
+
label: workspaces_1.default.prediction.label,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'embedded',
|
|
37
|
+
label: workspaces_1.default.embedded.label,
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
exports.preferencesInitialState = {
|
|
41
|
+
version: LOCAL_STORAGE_VERSION,
|
|
42
|
+
workspaces: {},
|
|
43
|
+
dispatch: () => null,
|
|
44
|
+
workspace: {
|
|
45
|
+
current: 'default',
|
|
46
|
+
base: null,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
function initPreferencesState(state) {
|
|
50
|
+
const nmrLocalStorageVersion = (0, LocalStorage_1.getLocalStorage)('nmr-local-storage-version', false);
|
|
51
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
52
|
+
// remove old nmr-local-storage-version key
|
|
53
|
+
if (nmrLocalStorageVersion && localData?.version) {
|
|
54
|
+
(0, LocalStorage_1.removeData)('nmr-local-storage-version');
|
|
55
|
+
}
|
|
56
|
+
// if the local setting version != current settings version number
|
|
57
|
+
if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
|
|
58
|
+
(0, LocalStorage_1.removeData)('nmr-general-settings');
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
...state,
|
|
62
|
+
workspaces: localData?.workspaces || { default: workspaces_1.default.default },
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
exports.initPreferencesState = initPreferencesState;
|
|
66
|
+
function innerPreferencesReducer(draft, action) {
|
|
67
|
+
switch (action.type) {
|
|
68
|
+
case 'INIT_PREFERENCES':
|
|
69
|
+
return (0, initPreferences_1.initPreferences)(draft, action);
|
|
70
|
+
case 'SET_PREFERENCES':
|
|
71
|
+
return (0, setPreferences_1.setPreferences)(draft, action);
|
|
72
|
+
case 'SET_PANELS_PREFERENCES':
|
|
73
|
+
return (0, setPanelsPreferences_1.setPanelsPreferences)(draft, action);
|
|
74
|
+
case 'RESET_PREFERENCES':
|
|
75
|
+
return (0, resetPreferences_1.resetPreferences)(draft);
|
|
76
|
+
case 'SET_WORKSPACE':
|
|
77
|
+
return (0, setWorkspace_1.setWorkspace)(draft, action);
|
|
78
|
+
case 'ADD_WORKSPACE':
|
|
79
|
+
return (0, addWorkspace_1.addWorkspace)(draft, action);
|
|
80
|
+
case 'REMOVE_WORKSPACE':
|
|
81
|
+
return (0, removeWorkspace_1.removeWorkspace)(draft, action);
|
|
82
|
+
default:
|
|
83
|
+
return draft;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const preferencesReducer = (0, immer_1.produce)(innerPreferencesReducer);
|
|
87
|
+
exports.default = preferencesReducer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkKeysExists = void 0;
|
|
4
|
+
const flatObject_1 = require("./flatObject");
|
|
5
|
+
function checkKeysExists(sourceObject, targetObject) {
|
|
6
|
+
const source = (0, flatObject_1.flatObject)(sourceObject);
|
|
7
|
+
const target = (0, flatObject_1.flatObject)(targetObject);
|
|
8
|
+
if (Object.keys(target).length === 0) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
for (const [key, value] of Object.entries(source)) {
|
|
12
|
+
if (!target[key] || target[key] !== value) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
exports.checkKeysExists = checkKeysExists;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterObject = void 0;
|
|
4
|
+
function filterObject(data) {
|
|
5
|
+
return JSON.parse(JSON.stringify(data), (key, value) => {
|
|
6
|
+
if (value?.hidden !== true) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
exports.filterObject = filterObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flatObject = void 0;
|
|
4
|
+
function flatObject(data) {
|
|
5
|
+
let result = {};
|
|
6
|
+
JSON.parse(JSON.stringify(data), (key, value) => {
|
|
7
|
+
if (value?.hidden !== true && key) {
|
|
8
|
+
result[key] = result[key]++ || 1;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
exports.flatObject = flatObject;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getActiveWorkspace = void 0;
|
|
4
|
+
function getActiveWorkspace(draft) {
|
|
5
|
+
return draft.workspaces[draft.workspace.current || 'default'];
|
|
6
|
+
}
|
|
7
|
+
exports.getActiveWorkspace = getActiveWorkspace;
|
|
@@ -0,0 +1,11 @@
|
|
|
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.getPreferencesByWorkspace = void 0;
|
|
7
|
+
const workspaces_1 = __importDefault(require("../../../workspaces"));
|
|
8
|
+
function getPreferencesByWorkspace(workspace) {
|
|
9
|
+
return workspaces_1.default?.[workspace] || {};
|
|
10
|
+
}
|
|
11
|
+
exports.getPreferencesByWorkspace = getPreferencesByWorkspace;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapNucleiFormatting = void 0;
|
|
4
|
+
function mapNucleiFormatting(formatting) {
|
|
5
|
+
const { nuclei, ...res } = formatting;
|
|
6
|
+
const _nuclei = Object.keys(nuclei).reduce((nucleusFormatting, key) => {
|
|
7
|
+
nucleusFormatting[nuclei[key].name.trim().toLowerCase()] = nuclei[key];
|
|
8
|
+
return nucleusFormatting;
|
|
9
|
+
}, {});
|
|
10
|
+
return { nuclei: _nuclei, ...res };
|
|
11
|
+
}
|
|
12
|
+
exports.mapNucleiFormatting = mapNucleiFormatting;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.CHANGE_TEMP_RANGE = exports.CHANGE_ZONES_NOISE_FACTOR = exports.CHANGE_INTEGRALS_SUM_FLAG = exports.CHANGE_RANGES_SUM_FLAG = exports.DELETE_EXCLUSION_ZONE = exports.ADD_EXCLUSION_ZONE = exports.APPLY_MULTIPLE_SPECTRA_FILTER = exports.SET_MOUSE_OVER_DISPLAYER = exports.RESET_SPECTRA_SCALE = exports.SET_SPECTRA_SAME_TOP = void 0;
|
|
3
|
+
exports.APPLY_FFT_FILTER = exports.APPLY_ZERO_FILLING_FILTER = exports.DELETE_SPECTRA_FILTER = exports.DELETE_FILTER = exports.ENABLE_FILTER = exports.RESET_DOMAIN = exports.BRUSH_END = exports.RESIZE_INTEGRAL = exports.CHANGE_SPECTRUM_DISPLAY_VIEW_MODE = exports.DELETE_SPECTRA = exports.SET_CORRELATIONS_TOLERANCE = exports.SET_CORRELATIONS_MF = exports.DELETE_CORRELATION = exports.SET_CORRELATIONS = exports.SET_CORRELATION = exports.CHANGE_MOLECULE_LABEL = exports.FLOAT_MOLECULE_OVER_SPECTRUM = exports.DELETE_MOLECULE = exports.SET_MOLECULE = exports.ADD_MOLECULE = exports.SET_ZOOM = exports.TOGGLE_REAL_IMAGINARY_VISIBILITY = exports.DELETE_INTEGRAL = exports.ADD_INTEGRAL = exports.CHANGE_SPECTRUM_COLOR = exports.CHANGE_ACTIVE_SPECTRUM = exports.CHANGE_PEAKS_MARKERS_VISIBILITY = exports.CHANGE_VISIBILITY = exports.FULL_ZOOM_OUT = exports.CHANGE_SPECTRUM_TYPE = exports.CHANGE_SPECTRUM_SETTING = exports.SET_SELECTED_FILTER = exports.SET_SELECTED_TOOL = exports.SET_DIMENSIONS = exports.SET_WIDTH = exports.SET_ORIGINAL_DOMAIN = exports.SET_Y_DOMAIN = exports.SET_X_DOMAIN = exports.SHIFT_SPECTRUM = exports.DELETE_PEAK_NOTATION = exports.ADD_PEAKS = exports.ADD_PEAK = exports.LOAD_JDF_FILE = exports.LOAD_ZIP_FILE = exports.LOAD_MOL_FILE = exports.LOAD_NMREDATA_FILE = exports.LOAD_JCAMP_FILE = exports.LOAD_JSON_FILE = exports.SAVE_DATA_AS_JSON = exports.INITIATE = void 0;
|
|
4
|
+
exports.UNLINK_ZONE = exports.SAVE_EDITED_ZONE = exports.CHANGE_ZONE_SIGNAL_KIND = exports.CHANGE_ZONE_SIGNAL_VALUE = exports.ALIGN_SPECTRA = exports.FILTER_SPECTRA_COLUMN = exports.SET_ANALYZE_SPECTRA_COLUMNS = exports.RESIZE_ANALYZE_SPECTRA_RANGE = exports.DELETE_ANALYZE_SPECTRA_RANGE = exports.ANALYZE_SPECTRA = exports.CHANGE_INTEGRAL_RELATIVE = exports.SET_DIAID_RANGE = exports.UNLINK_RANGE = exports.SAVE_EDITED_RANGE = exports.CHANGE_RANGE_SIGNAL_KIND = exports.CHANGE_RANGE_SIGNAL_VALUE = exports.CHANGE_RANGE_RELATIVE = exports.SET_FILTER_SNAPSHOT = exports.ADD_MISSING_PROJECTION = exports.SET_2D_SIGNAL_PATH_LENGTH = exports.DELETE_2D_SIGNAL = exports.DELETE_2D_ZONE = exports.ADD_2D_ZONE = exports.SET_2D_LEVEL = exports.ADD_RANGE = exports.CHANGE_RANGE_SUM = exports.RESIZE_RANGE = exports.APPLY_KEY_PREFERENCES = exports.SET_KEY_PREFERENCES = exports.APPLY_BASE_LINE_CORRECTION_FILTER = exports.DELETE_BASE_LINE_ZONE = exports.ADD_BASE_LINE_ZONE = exports.CHANGE_INTEGRAL_SUM = exports.SET_ACTIVE_TAB = exports.CHANGE_INTEGRAL_DATA = exports.SAVE_AS_SVG = exports.SET_SPECTRUMS_VERTICAL_ALIGN = exports.RESET_SELECTED_TOOL = exports.SET_LOADING_FLAG = exports.SET_SELECTED_OPTIONS_PANEL = exports.DELETE_1D_SIGNAL = exports.DELETE_RANGE = exports.AUTO_ZONES_DETECTION = exports.AUTO_RANGES_DETECTION = exports.AUTO_PEAK_PICKING = exports.SET_VERTICAL_INDICATOR_X_POSITION = exports.APPLY_ABSOLUTE_FILTER = exports.APPLY_AUTO_PHASE_CORRECTION_FILTER = exports.APPLY_MANUAL_PHASE_CORRECTION_FILTER = exports.CALCULATE_MANUAL_PHASE_CORRECTION_FILTER = void 0;
|
|
5
|
+
exports.SET_AUTOMATIC_ASSIGNMENTS = exports.SHOW_J_GRAPH = exports.RESURRECTING_SPECTRUM_FROM_RANGES = exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = exports.AUTO_ZONES_SPECTRA_PICKING = exports.AUTO_RANGES_SPECTRA_PICKING = exports.SHOW_RANGES_INTEGRALS = exports.SHOW_MULTIPLICTY_TREES = exports.CHANGE_TEMP_RANGE = exports.CHANGE_ZONES_NOISE_FACTOR = exports.CHANGE_INTEGRALS_SUM_FLAG = exports.CHANGE_RANGES_SUM_FLAG = exports.DELETE_EXCLUSION_ZONE = exports.ADD_EXCLUSION_ZONE = exports.APPLY_MULTIPLE_SPECTRA_FILTER = exports.SET_MOUSE_OVER_DISPLAYER = exports.RESET_SPECTRA_SCALE = exports.SET_SPECTRA_SAME_TOP = exports.PREDICT_SPECTRA = exports.SET_DIAID_ZONE = void 0;
|
|
6
6
|
exports.INITIATE = 'INITIATE';
|
|
7
7
|
exports.SAVE_DATA_AS_JSON = 'SAVE_DATA_AS_JSON';
|
|
8
8
|
exports.LOAD_JSON_FILE = 'LOAD_JSON_FILE';
|
|
@@ -36,6 +36,8 @@ exports.SET_ZOOM = 'SET_ZOOM';
|
|
|
36
36
|
exports.ADD_MOLECULE = 'ADD_MOLECULE';
|
|
37
37
|
exports.SET_MOLECULE = 'SET_MOLECULE';
|
|
38
38
|
exports.DELETE_MOLECULE = 'DELETE_MOLECULE';
|
|
39
|
+
exports.FLOAT_MOLECULE_OVER_SPECTRUM = 'FLOAT_MOLECULE_OVER_SPECTRUM';
|
|
40
|
+
exports.CHANGE_MOLECULE_LABEL = 'CHANGE_MOLECULE_LABEL';
|
|
39
41
|
exports.SET_CORRELATION = 'SET_CORRELATION';
|
|
40
42
|
exports.SET_CORRELATIONS = 'SET_CORRELATIONS';
|
|
41
43
|
exports.DELETE_CORRELATION = 'DELETE_CORRELATION';
|
|
@@ -120,3 +122,4 @@ exports.AUTO_ZONES_SPECTRA_PICKING = 'AUTO_ZONES_SPECTRA_PICKING';
|
|
|
120
122
|
exports.GENERATE_SPECTRUM_FROM_PUBLICATION_STRING = 'GENERATE_SPECTRUM_FROM_PUBLICATION_STRING';
|
|
121
123
|
exports.RESURRECTING_SPECTRUM_FROM_RANGES = 'RESURRECTING_SPECTRUM_FROM_RANGES';
|
|
122
124
|
exports.SHOW_J_GRAPH = 'SHOW_J_GRAPH';
|
|
125
|
+
exports.SET_AUTOMATIC_ASSIGNMENTS = 'SET_AUTOMATIC_ASSIGNMENTS';
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const bs_1 = require("react-icons/bs");
|
|
8
|
+
const fa_1 = require("react-icons/fa");
|
|
9
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
10
|
+
function ActionsButton({ onFloatBtnClick }) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { "data-no-export": "true", style: { display: 'flex', zIndex: 0 }, children: [(0, jsx_runtime_1.jsx)(Button_1.default.Action, { style: { fontSize: '14px' }, fill: "clear", className: "handle", children: (0, jsx_runtime_1.jsx)(bs_1.BsArrowsMove, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: onFloatBtnClick, children: (0, jsx_runtime_1.jsx)(fa_1.FaTimes, {}) })] }));
|
|
12
|
+
}
|
|
13
|
+
exports.default = ActionsButton;
|
|
@@ -0,0 +1,50 @@
|
|
|
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.DraggableStructure = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
8
|
+
/** @jsxImportSource @emotion/react */
|
|
9
|
+
const react_1 = require("@emotion/react");
|
|
10
|
+
const full_1 = __importDefault(require("openchemlib/full"));
|
|
11
|
+
const react_2 = require("react");
|
|
12
|
+
const react_ocl_nmr_1 = __importDefault(require("react-ocl-nmr"));
|
|
13
|
+
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
14
|
+
const GlobalContext_1 = require("../../context/GlobalContext");
|
|
15
|
+
const SVGDraggable_1 = __importDefault(require("../../elements/draggble/SVGDraggable"));
|
|
16
|
+
const MoleculeStructureEditorModal_1 = require("../../modal/MoleculeStructureEditorModal");
|
|
17
|
+
const useAtomAssignment_1 = __importDefault(require("../../panels/MoleculesPanel/useAtomAssignment"));
|
|
18
|
+
const Types_1 = require("../../reducer/types/Types");
|
|
19
|
+
const ActionsButton_1 = __importDefault(require("./ActionsButton"));
|
|
20
|
+
const style = (0, react_1.css) `
|
|
21
|
+
border: 1px solid transparent;
|
|
22
|
+
button {
|
|
23
|
+
visibility: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
border: 1px solid #ebecf1;
|
|
28
|
+
background-color: white;
|
|
29
|
+
button {
|
|
30
|
+
visibility: visible;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
function DraggableStructure(props) {
|
|
35
|
+
const { zones, ranges, molecule, activeTab, displayerMode, index } = props;
|
|
36
|
+
const { viewerRef } = (0, GlobalContext_1.useGlobal)();
|
|
37
|
+
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
38
|
+
const openMoleculeEditor = (0, MoleculeStructureEditorModal_1.useMoleculeEditor)();
|
|
39
|
+
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = (0, useAtomAssignment_1.default)({ zones, ranges, activeTab, displayerMode });
|
|
40
|
+
const floatMoleculeHandler = (0, react_2.useCallback)(() => {
|
|
41
|
+
dispatch({
|
|
42
|
+
type: Types_1.FLOAT_MOLECULE_OVER_SPECTRUM,
|
|
43
|
+
payload: { key: molecule.key },
|
|
44
|
+
});
|
|
45
|
+
}, [dispatch, molecule]);
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(SVGDraggable_1.default, { width: 150, height: 100, initialPosition: { x: 100, y: 50 }, dragHandleClassName: "handle", parentElement: viewerRef, children: (width, height) => ((0, jsx_runtime_1.jsxs)("foreignObject", { width: width, height: height + 30, "data-replace-float-structure": "true", css: style, onDoubleClick: () => openMoleculeEditor(molecule), children: [(0, jsx_runtime_1.jsx)(ActionsButton_1.default, { onFloatBtnClick: floatMoleculeHandler }), (0, jsx_runtime_1.jsx)(react_ocl_nmr_1.default, { OCL: full_1.default, autoCrop: true, id: `molSVG${index || ''}`, width: width - 20, height: height, molfile: molecule.molfile, setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight?.length > 0 ? 'red' : '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight?.length > 0
|
|
47
|
+
? currentDiaIDsToHighlight
|
|
48
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: () => null })] })) }, molecule.key));
|
|
49
|
+
}
|
|
50
|
+
exports.DraggableStructure = DraggableStructure;
|