nmrium 0.25.0 → 0.28.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/ExclusionZonesAnnotations.js +1 -1
- 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 +10 -5
- package/lib/component/1d/IntegralsSeries.js +5 -9
- package/lib/component/1d/Line.d.ts +2 -2
- package/lib/component/1d/PeakAnnotation.js +7 -6
- package/lib/component/1d/PeakAnnotations.js +2 -4
- package/lib/component/1d/SpectraTracker.js +2 -2
- package/lib/component/1d/Viewer1D.js +1 -1
- 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 +60 -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 +10 -5
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +5 -5
- package/lib/component/1d/ranges/Range.d.ts +2 -2
- package/lib/component/1d/ranges/Range.js +23 -15
- package/lib/component/1d/ranges/Ranges.js +6 -4
- package/lib/component/1d/tool/BaseLineZones.js +3 -6
- package/lib/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib/component/1d/tool/XLabelPointer.js +1 -1
- package/lib/component/2d/Chart2D.js +2 -1
- package/lib/component/2d/Contours.js +5 -6
- package/lib/component/2d/FooterBanner.js +1 -1
- package/lib/component/2d/SignalDeltaLine.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -1
- package/lib/component/2d/YAxis.js +2 -2
- 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/IndicationLines.js +2 -3
- package/lib/component/2d/zones/Signal.js +8 -8
- package/lib/component/2d/zones/Zone.js +3 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js +70 -46
- package/lib/component/NMRium.d.ts +15 -46
- package/lib/component/NMRium.js +20 -9
- 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 +3 -0
- package/lib/component/context/GlobalContext.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +15 -52
- package/lib/component/context/PreferencesContext.js +1 -1
- package/lib/component/elements/Button.js +4 -3
- package/lib/component/elements/ColorInput.js +2 -2
- package/lib/component/elements/ContextMenu.d.ts +8 -3
- 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/Logo.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +5 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +39 -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/Tab/Tabs.js +2 -1
- package/lib/component/elements/ToggleButton.d.ts +2 -1
- package/lib/component/elements/ToggleButton.js +4 -4
- package/lib/component/elements/accordion/Accordion.js +2 -6
- package/lib/component/elements/draggble/SVGDraggable.d.ts +17 -0
- package/lib/component/elements/draggble/SVGDraggable.js +33 -0
- package/lib/component/elements/{resizer → draggble}/useDraggable.d.ts +9 -6
- 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/formik/Input.js +1 -1
- package/lib/component/elements/popup/Alert/Provider.js +1 -1
- package/lib/component/elements/popup/Modal/Modal.js +1 -1
- package/lib/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib/component/elements/resizer/DivResizer.js +17 -62
- package/lib/component/elements/resizer/Resizer.d.ts +3 -1
- package/lib/component/elements/resizer/SVGResizer.js +24 -53
- package/lib/component/elements/resizer/useResizer.d.ts +11 -0
- package/lib/component/elements/resizer/useResizer.js +65 -0
- package/lib/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib/component/header/BaseLineCorrectionPanel.js +8 -5
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.d.ts +2 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib/component/hooks/useExport.d.ts +1 -1
- package/lib/component/hooks/useExport.js +2 -2
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +3 -0
- package/lib/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +4 -14
- 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 +8 -2
- package/lib/component/loader/NoData.d.ts +3 -2
- package/lib/component/loader/NoData.js +31 -30
- package/lib/component/loader/SpinnerContext.d.ts +3 -3
- package/lib/component/loader/SpinnerContext.js +2 -2
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +3 -4
- package/lib/component/modal/MoleculeStructureEditorModal.js +24 -3
- package/lib/component/modal/editRange/EditRangeModal.d.ts +3 -3
- package/lib/component/modal/editRange/EditRangeModal.js +52 -56
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +11 -27
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.d.ts +2 -0
- package/lib/component/modal/editRange/forms/components/SignalFormInfo.js +34 -0
- package/lib/component/modal/editRange/forms/components/SignalFormTab.d.ts +1 -1
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +11 -14
- package/lib/component/modal/editRange/forms/components/SignalsForm.d.ts +5 -2
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +29 -37
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/setting/DatabasesTabContent.d.ts +7 -0
- package/lib/component/modal/setting/DatabasesTabContent.js +73 -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 +3 -1
- package/lib/component/modal/setting/settingsValidation.d.ts +164 -0
- package/lib/component/modal/setting/settingsValidation.js +48 -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 +14 -19
- 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 +17 -35
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +11 -3
- 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/MultipleAnalysisCodeEditor.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +3 -3
- package/lib/component/panels/Panels.js +3 -4
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +4 -4
- 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 +28 -13
- package/lib/component/panels/RangesPanel/RangesPanel.js +23 -29
- 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.d.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/format.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +4 -4
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +49 -31
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +5 -18
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- 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/AdditionalColumnField.js +3 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +3 -3
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -9
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.d.ts → useInView.d.ts} +2 -2
- package/lib/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- 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 +14 -14
- 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.d.ts +4 -0
- package/lib/component/panels/databasePanel/DatabasePanel.js +129 -42
- package/lib/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.d.ts +7 -0
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +8 -0
- package/lib/component/panels/databasePanel/DatabaseTable.js +37 -20
- 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 +5 -7
- 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/DefaultPanelHeader.js +1 -3
- package/lib/component/panels/header/SpectraAutomaticPickingButton.d.ts +2 -0
- package/lib/component/panels/header/SpectraAutomaticPickingButton.js +30 -0
- package/lib/component/reducer/Reducer.d.ts +352 -95
- package/lib/component/reducer/Reducer.js +22 -10
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +9 -0
- package/lib/component/reducer/actions/AssignmentsActions.js +18 -0
- package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
- package/lib/component/reducer/actions/DatabaseActions.js +21 -3
- package/lib/component/reducer/actions/DomainActions.js +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts +2 -1
- package/lib/component/reducer/actions/FiltersActions.js +25 -4
- 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 +32 -20
- package/lib/component/reducer/actions/RangesActions.d.ts +2 -2
- package/lib/component/reducer/actions/RangesActions.js +45 -11
- package/lib/component/reducer/actions/SpectrumsActions.js +6 -9
- package/lib/component/reducer/actions/ToolsActions.js +67 -54
- package/lib/component/reducer/helper/getSpectrum.d.ts +5 -0
- package/lib/component/reducer/helper/getSpectrum.js +14 -0
- 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} +147 -17
- 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 +6 -1
- package/lib/component/reducer/types/Types.js +6 -1
- package/lib/component/tool/BrushX.js +1 -1
- package/lib/component/tool/BrushXY.js +1 -1
- package/lib/component/tool/CrossLinePointer.js +1 -1
- 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 +44 -0
- package/lib/component/tool/FloatMoleculeStructures/index.d.ts +15 -0
- package/lib/component/tool/FloatMoleculeStructures/index.js +28 -0
- package/lib/component/toolbar/BasicToolBar.js +0 -1
- package/lib/component/toolbar/FunctionToolBar.js +9 -13
- package/lib/component/toolbar/ToolTypes.d.ts +1 -1
- package/lib/component/toolbar/ToolTypes.js +3 -3
- package/lib/component/utility/Export.d.ts +7 -1
- package/lib/component/utility/Export.js +9 -3
- package/lib/component/utility/PathBuilder.js +2 -1
- package/lib/component/utility/formatNumber.d.ts +3 -0
- package/lib/component/utility/formatNumber.js +12 -0
- package/lib/component/utility/getUniqueNuclei.d.ts +1 -0
- package/lib/component/utility/getUniqueNuclei.js +10 -0
- package/lib/component/utility/isGoogleDocument.d.ts +1 -0
- package/lib/component/utility/isGoogleDocument.js +3 -0
- package/lib/component/utility/nmredataToNmrium.js +1 -2
- package/lib/component/utility/nmriumToNmredata.d.ts +2 -2
- package/lib/component/utility/nmriumToNmredata.js +2 -2
- package/lib/component/utility/util/nmredata/addSource.js +2 -2
- package/lib/component/workspaces/Workspace.d.ts +79 -5
- package/lib/component/workspaces/basic.js +25 -11
- package/lib/component/workspaces/embedded.d.ts +2 -0
- package/lib/component/workspaces/embedded.js +32 -0
- package/lib/component/workspaces/exercise.js +4 -2
- 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 +3 -1
- package/lib/data/FiltersManager.js +1 -1
- package/lib/data/PredictionManager.js +7 -9
- package/lib/data/SpectraManager.d.ts +4 -12
- package/lib/data/SpectraManager.js +37 -38
- package/lib/data/data1d/Data1DManager.d.ts +1 -1
- package/lib/data/data1d/Data1DManager.js +14 -2
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.d.ts +2 -0
- package/lib/data/data1d/Spectrum1D/convertDataToFloat64Array.js +10 -0
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib/data/data1d/Spectrum1D/get1DDataXY.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +36 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +38 -15
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -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 +11 -15
- package/lib/data/data1d/database.js +67 -22
- 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 +2 -2
- 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/Processing2D.js +1 -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 +6 -7
- package/lib/data/molecules/Molecule.js +9 -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/data/utilities/FindUtilities.js +1 -3
- package/lib/data/utilities/RangeUtilities.js +5 -6
- package/lib/data/utilities/ZoneUtilities.js +1 -1
- package/lib/data/utilities/getSum.js +1 -3
- package/lib/data/utilities/isMolFileEmpty.d.ts +1 -0
- package/lib/data/utilities/isMolFileEmpty.js +6 -0
- package/lib/types/NMRiumDataReturn.d.ts +15 -0
- package/lib/types/NMRiumDataReturn.js +1 -0
- package/lib/types/NMRiumGeneralPreferences.d.ts +10 -0
- package/lib/types/NMRiumGeneralPreferences.js +1 -0
- package/lib/types/NMRiumPanelPreferences.d.ts +16 -0
- package/lib/types/NMRiumPanelPreferences.js +1 -0
- package/lib/types/NMRiumToolBarPreferences.d.ts +20 -0
- package/lib/types/NMRiumToolBarPreferences.js +1 -0
- package/lib/types/Preferences.d.ts +5 -0
- package/lib/types/Preferences.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -1
- 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 +10 -5
- package/lib-cjs/component/1d/IntegralsSeries.js +5 -9
- package/lib-cjs/component/1d/PeakAnnotation.js +7 -6
- package/lib-cjs/component/1d/PeakAnnotations.js +2 -4
- package/lib-cjs/component/1d/SpectraTracker.js +2 -2
- package/lib-cjs/component/1d/Viewer1D.js +1 -1
- package/lib-cjs/component/1d/database/DatabaseElements.js +23 -0
- package/lib-cjs/component/1d/database/DatabaseSpectrum.js +65 -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 +10 -5
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +6 -6
- package/lib-cjs/component/1d/ranges/Range.js +25 -17
- package/lib-cjs/component/1d/ranges/Ranges.js +6 -4
- package/lib-cjs/component/1d/tool/BaseLineZones.js +3 -6
- package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
- 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 +5 -6
- package/lib-cjs/component/2d/FooterBanner.js +2 -2
- package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +2 -2
- package/lib-cjs/component/2d/zones/IndicationLines.js +2 -3
- 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 +71 -47
- package/lib-cjs/component/NMRium.js +18 -7
- 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/Button.js +4 -3
- package/lib-cjs/component/elements/ColorInput.js +2 -2
- package/lib-cjs/component/elements/EditableColumn.js +27 -20
- package/lib-cjs/component/elements/Input.js +18 -5
- package/lib-cjs/component/elements/Logo.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableRow.js +43 -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/Tab/Tabs.js +2 -1
- package/lib-cjs/component/elements/ToggleButton.js +4 -4
- package/lib-cjs/component/elements/accordion/Accordion.js +2 -6
- 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/formik/Input.js +1 -1
- package/lib-cjs/component/elements/popup/Alert/Provider.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/Modal.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ModalContent.js +1 -1
- package/lib-cjs/component/elements/resizer/DivResizer.js +17 -62
- package/lib-cjs/component/elements/resizer/SVGResizer.js +24 -53
- package/lib-cjs/component/elements/resizer/useResizer.js +71 -0
- package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +2 -2
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +7 -4
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -1
- package/lib-cjs/component/hooks/useExport.js +2 -2
- package/lib-cjs/component/{utility/FormatNumber.js → hooks/useFormatNumberByNucleus.js} +4 -15
- 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 +8 -2
- package/lib-cjs/component/loader/NoData.js +31 -30
- package/lib-cjs/component/loader/SpinnerContext.js +2 -2
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +26 -3
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +50 -54
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +11 -27
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +12 -50
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormInfo.js +38 -0
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +13 -16
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +29 -37
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/setting/DatabasesTabContent.js +78 -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 +3 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +74 -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 +13 -18
- 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 +17 -35
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +11 -3
- 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/MultipleSpectraAnalysisPreferences.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +2 -2
- package/lib-cjs/component/panels/Panels.js +3 -4
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +5 -5
- 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 +27 -12
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +23 -29
- 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 +49 -31
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -16
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- 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/AdditionalColumnField.js +3 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +3 -3
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +8 -10
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +6 -8
- package/lib-cjs/component/panels/SummaryPanel/utilities/{IsInView.js → useInView.js} +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +3 -3
- 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 +14 -14
- 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 +128 -41
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +10 -42
- package/lib-cjs/component/panels/databasePanel/DatabaseStructureSearchModal.js +15 -0
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +36 -19
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +2 -2
- package/lib-cjs/component/panels/extra/preferences/ColumnsHelper.js +5 -7
- 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/DefaultPanelHeader.js +1 -3
- package/lib-cjs/component/panels/header/SpectraAutomaticPickingButton.js +37 -0
- package/lib-cjs/component/reducer/Reducer.js +22 -10
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +21 -0
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +22 -3
- package/lib-cjs/component/reducer/actions/DomainActions.js +1 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +26 -4
- 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 +30 -18
- package/lib-cjs/component/reducer/actions/RangesActions.js +46 -12
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +4 -7
- package/lib-cjs/component/reducer/actions/ToolsActions.js +64 -74
- package/lib-cjs/component/reducer/helper/getSpectrum.js +18 -0
- 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 +9 -4
- package/lib-cjs/component/tool/BrushX.js +1 -1
- package/lib-cjs/component/tool/BrushXY.js +1 -1
- package/lib-cjs/component/tool/CrossLinePointer.js +1 -1
- package/lib-cjs/component/tool/FloatMoleculeStructures/ActionsButton.js +13 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/DraggableStructure.js +51 -0
- package/lib-cjs/component/tool/FloatMoleculeStructures/index.js +36 -0
- package/lib-cjs/component/toolbar/BasicToolBar.js +0 -1
- package/lib-cjs/component/toolbar/FunctionToolBar.js +9 -13
- package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
- package/lib-cjs/component/utility/Export.js +10 -3
- package/lib-cjs/component/utility/PathBuilder.js +2 -1
- package/lib-cjs/component/utility/formatNumber.js +19 -0
- package/lib-cjs/component/utility/getUniqueNuclei.js +14 -0
- package/lib-cjs/component/utility/isGoogleDocument.js +7 -0
- package/lib-cjs/component/utility/nmredataToNmrium.js +1 -2
- package/lib-cjs/component/utility/util/nmredata/addSource.js +2 -2
- package/lib-cjs/component/workspaces/basic.js +25 -11
- package/lib-cjs/component/workspaces/embedded.js +35 -0
- package/lib-cjs/component/workspaces/exercise.js +4 -2
- 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 +3 -1
- package/lib-cjs/data/FiltersManager.js +1 -1
- package/lib-cjs/data/PredictionManager.js +7 -9
- package/lib-cjs/data/SpectraManager.js +37 -38
- package/lib-cjs/data/data1d/Data1DManager.js +14 -2
- package/lib-cjs/data/data1d/Spectrum1D/convertDataToFloat64Array.js +14 -0
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +8 -10
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/integrals/updateRelatives.js +5 -7
- package/lib-cjs/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/peaks/mapPeaks.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +40 -16
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +2 -1
- package/lib-cjs/data/data1d/Spectrum1D/ranges/mapRanges.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/toJSON.js +1 -0
- package/lib-cjs/data/data1d/database.js +67 -23
- 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 +2 -2
- 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/Processing2D.js +1 -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 +9 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +37 -3
- package/lib-cjs/data/utilities/FindUtilities.js +1 -3
- package/lib-cjs/data/utilities/RangeUtilities.js +8 -6
- package/lib-cjs/data/utilities/ZoneUtilities.js +1 -1
- package/lib-cjs/data/utilities/getSum.js +1 -3
- package/lib-cjs/data/utilities/isMolFileEmpty.js +10 -0
- package/lib-cjs/types/NMRiumDataReturn.js +2 -0
- package/lib-cjs/types/NMRiumGeneralPreferences.js +2 -0
- package/lib-cjs/types/NMRiumPanelPreferences.js +2 -0
- package/lib-cjs/types/NMRiumToolBarPreferences.js +2 -0
- package/lib-cjs/types/Preferences.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +53 -51
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.d.ts +0 -2
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +0 -14
- package/lib/component/elements/resizer/useDraggable.js +0 -52
- 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/multiplicityTree/TempMultiplicityTree.js +0 -20
- package/lib-cjs/component/elements/resizer/useDraggable.js +0 -55
- package/lib-cjs/component/panels/extra/preferences/defaultValues.js +0 -61
- package/lib-cjs/component/reducer/preferencesReducer.js +0 -279
|
@@ -6,90 +6,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
9
|
-
const IsotopesViewer_1 = __importDefault(require("../../elements/IsotopesViewer"));
|
|
10
|
-
const FormikColumnFormatField_1 = __importDefault(require("../../elements/formik/FormikColumnFormatField"));
|
|
11
9
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
12
10
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
13
11
|
const useNucleus_1 = __importDefault(require("../../hooks/useNucleus"));
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
padding: 10,
|
|
19
|
-
backgroundColor: '#f1f1f1',
|
|
20
|
-
height: '100%',
|
|
21
|
-
overflowY: 'auto',
|
|
22
|
-
},
|
|
23
|
-
groupContainer: {
|
|
24
|
-
padding: '5px',
|
|
25
|
-
borderRadius: '5px',
|
|
26
|
-
margin: '10px 0px',
|
|
27
|
-
backgroundColor: 'white',
|
|
28
|
-
},
|
|
29
|
-
row: {
|
|
30
|
-
display: 'flex',
|
|
31
|
-
margin: '5px 0px',
|
|
32
|
-
},
|
|
33
|
-
header: {
|
|
34
|
-
borderBottom: '1px solid #e8e8e8',
|
|
35
|
-
paddingBottom: '5px',
|
|
36
|
-
fontWeight: 'bold',
|
|
37
|
-
color: '#4a4a4a',
|
|
38
|
-
},
|
|
39
|
-
inputLabel: {
|
|
40
|
-
flex: 2,
|
|
41
|
-
fontSize: '11px',
|
|
42
|
-
fontWeight: 'bold',
|
|
43
|
-
color: '#232323',
|
|
44
|
-
},
|
|
45
|
-
input: {
|
|
46
|
-
width: '30%',
|
|
47
|
-
textAlign: 'center',
|
|
48
|
-
},
|
|
49
|
-
};
|
|
12
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
13
|
+
const getUniqueNuclei_1 = require("../../utility/getUniqueNuclei");
|
|
14
|
+
const NucleusPreferences_1 = require("../extra/preferences/NucleusPreferences");
|
|
15
|
+
const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
|
|
50
16
|
const formatFields = [
|
|
51
17
|
{
|
|
52
18
|
id: 1,
|
|
53
|
-
label: '
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
id: 2,
|
|
59
|
-
label: 'To :',
|
|
60
|
-
checkController: 'showTo',
|
|
61
|
-
formatController: 'toFormat',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 3,
|
|
65
|
-
label: 'Absolute :',
|
|
66
|
-
checkController: 'showAbsolute',
|
|
67
|
-
formatController: 'absoluteFormat',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: 4,
|
|
71
|
-
label: 'Relative :',
|
|
72
|
-
checkController: 'showRelative',
|
|
73
|
-
formatController: 'relativeFormat',
|
|
19
|
+
label: 'δ (ppm) :',
|
|
20
|
+
checkControllerName: 'deltaPPM.show',
|
|
21
|
+
formatControllerName: 'deltaPPM.format',
|
|
22
|
+
hideCheckField: true,
|
|
74
23
|
},
|
|
75
24
|
];
|
|
76
|
-
function
|
|
25
|
+
function ZonesPreferences(props, ref) {
|
|
77
26
|
const alert = (0, Alert_1.useAlert)();
|
|
78
|
-
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
79
27
|
const formRef = (0, react_1.useRef)();
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return acc;
|
|
85
|
-
}, {});
|
|
86
|
-
const zonesPreferences = (0, LocalStorage_1.getValue)(preferences.current, `formatting.panels.zones`);
|
|
87
|
-
formRef.current.setValues(zonesPreferences ? zonesPreferences : defaultValues);
|
|
88
|
-
}
|
|
89
|
-
}, [nucleus, preferences]);
|
|
28
|
+
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
29
|
+
const nucleus = (0, useNucleus_1.default)();
|
|
30
|
+
const nuclei = (0, react_1.useMemo)(() => (0, getUniqueNuclei_1.getUniqueNuclei)(nucleus), [nucleus]);
|
|
31
|
+
const zonesPreferences = (0, usePanelPreferences_1.usePanelPreferencesByNuclei)('zones', nuclei);
|
|
90
32
|
(0, react_1.useEffect)(() => {
|
|
91
|
-
|
|
92
|
-
}, [
|
|
33
|
+
formRef.current.setValues(zonesPreferences);
|
|
34
|
+
}, [zonesPreferences]);
|
|
93
35
|
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
94
36
|
preferences.dispatch({
|
|
95
37
|
type: 'SET_PANELS_PREFERENCES',
|
|
@@ -97,17 +39,11 @@ function ZonesPreferencesInner({ nucleus, innerRef, }) {
|
|
|
97
39
|
});
|
|
98
40
|
alert.success('zones preferences saved successfully');
|
|
99
41
|
}, [alert, preferences]);
|
|
100
|
-
(0, react_1.useImperativeHandle)(
|
|
42
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
101
43
|
saveSetting: () => {
|
|
102
44
|
formRef.current.submitForm();
|
|
103
45
|
},
|
|
104
46
|
}), []);
|
|
105
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
106
|
-
}
|
|
107
|
-
const MemoizedZonesPreferences = (0, react_1.memo)(ZonesPreferencesInner);
|
|
108
|
-
// TODO: remove this hacky use of ref.
|
|
109
|
-
function ZonesPreferences(props, ref) {
|
|
110
|
-
const nucleus = (0, useNucleus_1.default)();
|
|
111
|
-
return (0, jsx_runtime_1.jsx)(MemoizedZonesPreferences, { innerRef: ref, ...{ nucleus } });
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsx)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: nuclei?.map((n) => ((0, jsx_runtime_1.jsx)(NucleusPreferences_1.NucleusPreferences, { nucleus: n, fields: formatFields }, n))) }) }));
|
|
112
48
|
}
|
|
113
|
-
exports.default = (0, react_1.forwardRef)(ZonesPreferences);
|
|
49
|
+
exports.default = (0, react_1.memo)((0, react_1.forwardRef)(ZonesPreferences));
|
|
@@ -10,6 +10,7 @@ const react_2 = require("react");
|
|
|
10
10
|
const fa_1 = require("react-icons/fa");
|
|
11
11
|
const checkModifierKeyActivated_1 = __importDefault(require("../../../data/utilities/checkModifierKeyActivated"));
|
|
12
12
|
const ContextMenu_1 = __importDefault(require("../../elements/ContextMenu"));
|
|
13
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
13
14
|
const useTableSortBy_1 = __importDefault(require("../../hooks/useTableSortBy"));
|
|
14
15
|
const ZonesTableRow_1 = __importDefault(require("./ZonesTableRow"));
|
|
15
16
|
const tableStyle = (0, react_1.css) `
|
|
@@ -116,7 +117,9 @@ function ZonesTable({ tableData, onUnlink, context, nuclei, experiment, }) {
|
|
|
116
117
|
return _data;
|
|
117
118
|
}, [experiment, nuclei, tableData]);
|
|
118
119
|
const { items: sortedData, isSortedDesc, onSort } = (0, useTableSortBy_1.default)(data);
|
|
119
|
-
const
|
|
120
|
+
const { deltaPPM: deltaX } = (0, usePanelPreferences_1.usePanelPreferences)('zones', nuclei[0]);
|
|
121
|
+
const { deltaPPM: deltaY } = (0, usePanelPreferences_1.usePanelPreferences)('zones', nuclei[1]);
|
|
122
|
+
const rows = (0, react_2.useMemo)(() => sortedData.map((rowData, index) => ((0, jsx_runtime_1.jsx)(ZonesTableRow_1.default, { rowIndex: index, rowData: rowData, onUnlink: onUnlink, onContextMenu: (e, rowData) => contextMenuHandler(e, rowData), format: { x: deltaX.format, y: deltaY.format } }, `${rowData.tableMetaInfo.id}`))), [sortedData, onUnlink, deltaX.format, deltaY.format, contextMenuHandler]);
|
|
120
123
|
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("table", { css: tableStyle, children: [(0, jsx_runtime_1.jsxs)("thead", { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: "#" }), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: "\u03B4 (ppm)" }), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: (0, jsx_runtime_1.jsx)(fa_1.FaLink, {}) }), (0, jsx_runtime_1.jsx)("th", { colSpan: 2, children: "\u03A3" }), (0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: "Kind" }), (0, jsx_runtime_1.jsx)("th", { rowSpan: 2, children: '' })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { id: "tableMetaInfo.signal.x.delta", ...onSort, children: (0, jsx_runtime_1.jsxs)(SurroundedText, { text: "F2", children: [nuclei[0], ' ', isSortedDesc('tableMetaInfo.signal.x.delta').content] }) }), (0, jsx_runtime_1.jsx)("th", { id: "tableMetaInfo.signal.y.delta", ...onSort, children: (0, jsx_runtime_1.jsxs)(SurroundedText, { text: "F1", children: [nuclei[1], ' ', isSortedDesc('tableMetaInfo.signal.y.delta').content] }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F2", children: nuclei[0] }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F1", children: nuclei[1] }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F2", children: nuclei[0] }) }), (0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsx)(SurroundedText, { text: "F1", children: nuclei[1] }) })] })] }), (0, jsx_runtime_1.jsx)("tbody", { children: rows })] }), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { ref: contextRef, context: context })] }));
|
|
121
124
|
}
|
|
122
125
|
function SurroundedText(props) {
|
|
@@ -8,7 +8,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const Concatenation_1 = require("../../../data/utilities/Concatenation");
|
|
11
|
-
const
|
|
11
|
+
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
12
12
|
const highlight_1 = require("../../highlight");
|
|
13
13
|
const ActionsColumn_1 = __importDefault(require("./TableColumns/ActionsColumn"));
|
|
14
14
|
const SignalAssignmentsColumns_1 = __importDefault(require("./TableColumns/SignalAssignmentsColumns"));
|
|
@@ -16,14 +16,14 @@ const SignalDeltaColumn_1 = __importDefault(require("./TableColumns/SignalDeltaC
|
|
|
16
16
|
const ZoneAssignmentsColumns_1 = __importDefault(require("./TableColumns/ZoneAssignmentsColumns"));
|
|
17
17
|
const HighlightedRowStyle = { backgroundColor: '#ff6f0057' };
|
|
18
18
|
const ConstantlyHighlightedRowStyle = { backgroundColor: '#f5f5dc' };
|
|
19
|
-
function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, }) {
|
|
20
|
-
const assignmentZone = (0,
|
|
19
|
+
function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, format, }) {
|
|
20
|
+
const assignmentZone = (0, AssignmentsContext_1.useAssignment)(rowData.id);
|
|
21
21
|
const highlightZone = (0, highlight_1.useHighlight)([assignmentZone.id]);
|
|
22
|
-
const highlightZoneX = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentZone.id, 'X')].concat(assignmentZone.assigned
|
|
23
|
-
const highlightZoneY = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentZone.id, 'Y')].concat(assignmentZone.assigned
|
|
24
|
-
const assignmentSignal = (0,
|
|
25
|
-
const highlightSignalX = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentSignal.id, 'X')].concat(assignmentSignal.assigned
|
|
26
|
-
const highlightSignalY = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentSignal.id, 'Y')].concat(assignmentSignal.assigned
|
|
22
|
+
const highlightZoneX = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentZone.id, 'X')].concat(assignmentZone.assigned?.x || []));
|
|
23
|
+
const highlightZoneY = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentZone.id, 'Y')].concat(assignmentZone.assigned?.y || []));
|
|
24
|
+
const assignmentSignal = (0, AssignmentsContext_1.useAssignment)(rowData.tableMetaInfo.id);
|
|
25
|
+
const highlightSignalX = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentSignal.id, 'X')].concat(assignmentSignal.assigned?.x || [], (0, Concatenation_1.buildID)(assignmentSignal.id, 'Crosshair')));
|
|
26
|
+
const highlightSignalY = (0, highlight_1.useHighlight)([(0, Concatenation_1.buildID)(assignmentSignal.id, 'Y')].concat(assignmentSignal.assigned?.y || [], (0, Concatenation_1.buildID)(assignmentSignal.id, 'Crosshair')));
|
|
27
27
|
const [showUnlinkButtonZoneX, setShowUnlinkButtonZoneX] = (0, react_1.useState)(false);
|
|
28
28
|
const [showUnlinkButtonZoneY, setShowUnlinkButtonZoneY] = (0, react_1.useState)(false);
|
|
29
29
|
const [showUnlinkButtonSignalX, setShowUnlinkButtonSignalX] = (0, react_1.useState)(false);
|
|
@@ -36,10 +36,10 @@ function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, }) {
|
|
|
36
36
|
: null,
|
|
37
37
|
};
|
|
38
38
|
}, [rowData]);
|
|
39
|
-
const unlinkHandler = (0, react_1.useCallback)((
|
|
39
|
+
const unlinkHandler = (0, react_1.useCallback)((event, isOnZoneLevel, axis) => {
|
|
40
40
|
// event handling here in case of unlink button clicked
|
|
41
|
-
if (
|
|
42
|
-
|
|
41
|
+
if (event) {
|
|
42
|
+
event.stopPropagation();
|
|
43
43
|
}
|
|
44
44
|
onUnlink(rowData, isOnZoneLevel, rowData.tableMetaInfo.signalIndex, axis);
|
|
45
45
|
if (axis === 'x') {
|
|
@@ -85,18 +85,18 @@ function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, }) {
|
|
|
85
85
|
assignmentSignal.removeAll('y');
|
|
86
86
|
}
|
|
87
87
|
}, [assignmentSignal, assignmentZone, onUnlink, rowData]);
|
|
88
|
-
const clickHandler = (0, react_1.useCallback)((
|
|
89
|
-
|
|
90
|
-
assignment.
|
|
88
|
+
const clickHandler = (0, react_1.useCallback)((event, assignment, axis) => {
|
|
89
|
+
event.stopPropagation();
|
|
90
|
+
assignment.setActive(axis);
|
|
91
91
|
}, []);
|
|
92
92
|
const onHoverZoneX = (0, react_1.useMemo)(() => {
|
|
93
93
|
return {
|
|
94
94
|
onMouseEnter: () => {
|
|
95
|
-
assignmentZone.
|
|
95
|
+
assignmentZone.show('x');
|
|
96
96
|
highlightZoneX.show();
|
|
97
97
|
},
|
|
98
98
|
onMouseLeave: () => {
|
|
99
|
-
assignmentZone.
|
|
99
|
+
assignmentZone.hide();
|
|
100
100
|
highlightZoneX.hide();
|
|
101
101
|
},
|
|
102
102
|
};
|
|
@@ -104,11 +104,11 @@ function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, }) {
|
|
|
104
104
|
const onHoverZoneY = (0, react_1.useMemo)(() => {
|
|
105
105
|
return {
|
|
106
106
|
onMouseEnter: () => {
|
|
107
|
-
assignmentZone.
|
|
107
|
+
assignmentZone.show('y');
|
|
108
108
|
highlightZoneY.show();
|
|
109
109
|
},
|
|
110
110
|
onMouseLeave: () => {
|
|
111
|
-
assignmentZone.
|
|
111
|
+
assignmentZone.hide();
|
|
112
112
|
highlightZoneY.hide();
|
|
113
113
|
},
|
|
114
114
|
};
|
|
@@ -116,11 +116,11 @@ function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, }) {
|
|
|
116
116
|
const onHoverSignalX = (0, react_1.useMemo)(() => {
|
|
117
117
|
return {
|
|
118
118
|
onMouseEnter: () => {
|
|
119
|
-
assignmentSignal.
|
|
119
|
+
assignmentSignal.show('x');
|
|
120
120
|
highlightSignalX.show();
|
|
121
121
|
},
|
|
122
122
|
onMouseLeave: () => {
|
|
123
|
-
assignmentSignal.
|
|
123
|
+
assignmentSignal.hide();
|
|
124
124
|
highlightSignalX.hide();
|
|
125
125
|
},
|
|
126
126
|
};
|
|
@@ -128,11 +128,11 @@ function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, }) {
|
|
|
128
128
|
const onHoverSignalY = (0, react_1.useMemo)(() => {
|
|
129
129
|
return {
|
|
130
130
|
onMouseEnter: () => {
|
|
131
|
-
assignmentSignal.
|
|
131
|
+
assignmentSignal.show('y');
|
|
132
132
|
highlightSignalY.show();
|
|
133
133
|
},
|
|
134
134
|
onMouseLeave: () => {
|
|
135
|
-
assignmentSignal.
|
|
135
|
+
assignmentSignal.hide();
|
|
136
136
|
highlightSignalY.hide();
|
|
137
137
|
},
|
|
138
138
|
};
|
|
@@ -141,6 +141,6 @@ function ZonesTableRow({ rowData, onUnlink, onContextMenu, rowIndex, }) {
|
|
|
141
141
|
? HighlightedRowStyle
|
|
142
142
|
: (0, get_1.default)(rowData, 'tableMetaInfo.isConstantlyHighlighted', false) === true
|
|
143
143
|
? ConstantlyHighlightedRowStyle
|
|
144
|
-
: null, ...highlightZone.onHover, children: [(0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, children: rowIndex + 1 }), (0, jsx_runtime_1.jsx)(SignalDeltaColumn_1.default, { rowData: rowData, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY }), (0, jsx_runtime_1.jsx)(SignalAssignmentsColumns_1.default, { rowData: rowData, assignmentSignal: assignmentSignal, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, showUnlinkButtonSignalX: showUnlinkButtonSignalX, showUnlinkButtonSignalY: showUnlinkButtonSignalY, setShowUnlinkButtonSignalX: (show) => setShowUnlinkButtonSignalX(show), setShowUnlinkButtonSignalY: (show) => setShowUnlinkButtonSignalY(show), onClick: clickHandler, onUnlink: unlinkHandler, highlightSignalX: highlightSignalX, highlightSignalY: highlightSignalY }), (0, jsx_runtime_1.jsx)(ZoneAssignmentsColumns_1.default, { rowData: rowData, assignmentZone: assignmentZone, onHoverZoneX: onHoverZoneX, onHoverZoneY: onHoverZoneY, showUnlinkButtonZoneX: showUnlinkButtonZoneX, showUnlinkButtonZoneY: showUnlinkButtonZoneY, setShowUnlinkButtonZoneX: (show) => setShowUnlinkButtonZoneX(show), setShowUnlinkButtonZoneY: (show) => setShowUnlinkButtonZoneY(show), rowSpanTags: rowSpanTags, onClick: clickHandler, onUnlink: unlinkHandler, highlightZoneX: highlightZoneX, highlightZoneY: highlightZoneY }), (0, jsx_runtime_1.jsx)(ActionsColumn_1.default, { rowData: rowData, rowSpanTags: rowSpanTags })] }));
|
|
144
|
+
: null, ...highlightZone.onHover, children: [(0, jsx_runtime_1.jsx)("td", { ...rowSpanTags, children: rowIndex + 1 }), (0, jsx_runtime_1.jsx)(SignalDeltaColumn_1.default, { rowData: rowData, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, format: format }), (0, jsx_runtime_1.jsx)(SignalAssignmentsColumns_1.default, { rowData: rowData, assignmentSignal: assignmentSignal, onHoverSignalX: onHoverSignalX, onHoverSignalY: onHoverSignalY, showUnlinkButtonSignalX: showUnlinkButtonSignalX, showUnlinkButtonSignalY: showUnlinkButtonSignalY, setShowUnlinkButtonSignalX: (show) => setShowUnlinkButtonSignalX(show), setShowUnlinkButtonSignalY: (show) => setShowUnlinkButtonSignalY(show), onClick: clickHandler, onUnlink: unlinkHandler, highlightSignalX: highlightSignalX, highlightSignalY: highlightSignalY }), (0, jsx_runtime_1.jsx)(ZoneAssignmentsColumns_1.default, { rowData: rowData, assignmentZone: assignmentZone, onHoverZoneX: onHoverZoneX, onHoverZoneY: onHoverZoneY, showUnlinkButtonZoneX: showUnlinkButtonZoneX, showUnlinkButtonZoneY: showUnlinkButtonZoneY, setShowUnlinkButtonZoneX: (show) => setShowUnlinkButtonZoneX(show), setShowUnlinkButtonZoneY: (show) => setShowUnlinkButtonZoneY(show), rowSpanTags: rowSpanTags, onClick: clickHandler, onUnlink: unlinkHandler, highlightZoneX: highlightZoneX, highlightZoneY: highlightZoneY }), (0, jsx_runtime_1.jsx)(ActionsColumn_1.default, { rowData: rowData, rowSpanTags: rowSpanTags })] }));
|
|
145
145
|
}
|
|
146
146
|
exports.default = ZonesTableRow;
|
|
@@ -8,23 +8,31 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
8
8
|
const react_1 = require("@emotion/react");
|
|
9
9
|
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
10
10
|
const react_2 = require("react");
|
|
11
|
+
const bs_1 = require("react-icons/bs");
|
|
11
12
|
const fa_1 = require("react-icons/fa");
|
|
12
13
|
const io5_1 = require("react-icons/io5");
|
|
13
14
|
const database_1 = require("../../../data/data1d/database");
|
|
14
15
|
const ChartContext_1 = require("../../context/ChartContext");
|
|
15
16
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
17
|
+
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
18
|
+
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
16
19
|
const Input_1 = __importDefault(require("../../elements/Input"));
|
|
17
20
|
const Select_1 = __importDefault(require("../../elements/Select"));
|
|
18
21
|
const ToggleButton_1 = __importDefault(require("../../elements/ToggleButton"));
|
|
22
|
+
const Alert_1 = require("../../elements/popup/Alert");
|
|
23
|
+
const Modal_1 = require("../../elements/popup/Modal");
|
|
24
|
+
const useFormatNumberByNucleus_1 = require("../../hooks/useFormatNumberByNucleus");
|
|
19
25
|
const useToolsFunctions_1 = __importDefault(require("../../hooks/useToolsFunctions"));
|
|
20
26
|
const Types_1 = require("../../reducer/types/Types");
|
|
21
27
|
const ToolTypes_1 = require("../../toolbar/ToolTypes");
|
|
22
28
|
const Events_1 = __importDefault(require("../../utility/Events"));
|
|
23
|
-
const
|
|
29
|
+
const FileUtility_1 = require("../../utility/FileUtility");
|
|
24
30
|
const BasicPanelStyle_1 = require("../extra/BasicPanelStyle");
|
|
31
|
+
const NoTableData_1 = __importDefault(require("../extra/placeholder/NoTableData"));
|
|
25
32
|
const DefaultPanelHeader_1 = __importDefault(require("../header/DefaultPanelHeader"));
|
|
26
33
|
const PreferencesHeader_1 = __importDefault(require("../header/PreferencesHeader"));
|
|
27
34
|
const DatabasePreferences_1 = __importDefault(require("./DatabasePreferences"));
|
|
35
|
+
const DatabaseStructureSearchModal_1 = require("./DatabaseStructureSearchModal");
|
|
28
36
|
const DatabaseTable_1 = __importDefault(require("./DatabaseTable"));
|
|
29
37
|
const style = (0, react_1.css) `
|
|
30
38
|
.header {
|
|
@@ -41,29 +49,29 @@ const style = (0, react_1.css) `
|
|
|
41
49
|
padding: 0 5px;
|
|
42
50
|
outline: none;
|
|
43
51
|
}
|
|
44
|
-
.smiles-container svg {
|
|
45
|
-
display: block;
|
|
46
|
-
margin: 0 auto;
|
|
47
|
-
}
|
|
48
52
|
`;
|
|
49
53
|
const emptyKeywords = {
|
|
50
54
|
solvent: '',
|
|
51
55
|
searchKeywords: '',
|
|
52
56
|
};
|
|
53
|
-
function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
57
|
+
function DatabasePanelInner({ nucleus, selectedTool, databases, defaultDatabase, }) {
|
|
54
58
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
59
|
+
const alert = (0, Alert_1.useAlert)();
|
|
60
|
+
const modal = (0, Modal_1.useModal)();
|
|
61
|
+
const { item } = (0, analysis_ui_components_1.useAccordionContext)('Databases');
|
|
55
62
|
const { handleChangeOption } = (0, useToolsFunctions_1.default)();
|
|
56
|
-
const format = (0,
|
|
63
|
+
const format = (0, useFormatNumberByNucleus_1.useFormatNumberByNucleus)(nucleus);
|
|
57
64
|
const [isFlipped, setFlipStatus] = (0, react_2.useState)(false);
|
|
58
65
|
const settingRef = (0, react_2.useRef)();
|
|
59
66
|
const [keywords, setKeywords] = (0, react_2.useState)(emptyKeywords);
|
|
60
67
|
const databaseInstance = (0, react_2.useRef)(null);
|
|
68
|
+
const databaseDataRef = (0, react_2.useRef)([]);
|
|
61
69
|
const [result, setResult] = (0, react_2.useState)({
|
|
62
70
|
data: [],
|
|
63
71
|
databases: [],
|
|
64
72
|
solvents: [],
|
|
65
73
|
});
|
|
66
|
-
const
|
|
74
|
+
const [idCode, setIdCode] = (0, react_2.useState)();
|
|
67
75
|
const settingsPanelHandler = (0, react_2.useCallback)(() => {
|
|
68
76
|
setFlipStatus(!isFlipped);
|
|
69
77
|
}, [isFlipped]);
|
|
@@ -83,49 +91,40 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
83
91
|
}));
|
|
84
92
|
}
|
|
85
93
|
}, []);
|
|
86
|
-
(0, react_2.useEffect)(() => {
|
|
87
|
-
if (item?.isOpen) {
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
const databases = mapDatabasesToSelect((0, database_1.getDatabasesNames)());
|
|
90
|
-
databaseInstance.current = (0, database_1.initiateDatabase)(databases[0].key, nucleus);
|
|
91
|
-
const data = databaseInstance.current.data;
|
|
92
|
-
const solvents = mapSolventsToSelect(databaseInstance.current.getSolvents());
|
|
93
|
-
setResult({ data, databases, solvents });
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}, [item?.isOpen, nucleus]);
|
|
97
94
|
(0, react_2.useEffect)(() => {
|
|
98
95
|
const { solvent, searchKeywords } = keywords;
|
|
99
|
-
setTimeout(() => {
|
|
96
|
+
setTimeout(async () => {
|
|
100
97
|
if (databaseInstance.current) {
|
|
98
|
+
const hideLoading = await alert.showLoading(`Preparing of the Result`);
|
|
101
99
|
if (!solvent && !searchKeywords) {
|
|
102
100
|
const data = databaseInstance.current.data;
|
|
103
101
|
const solvents = mapSolventsToSelect(databaseInstance.current.getSolvents());
|
|
104
102
|
setResult((prevResult) => ({ ...prevResult, data, solvents }));
|
|
105
103
|
}
|
|
106
104
|
else {
|
|
107
|
-
const values = [...searchKeywords.split('
|
|
105
|
+
const values = [...searchKeywords.split(' ')];
|
|
108
106
|
if (solvent !== '-1') {
|
|
109
107
|
values.unshift(`solvent:${solvent}`);
|
|
110
108
|
}
|
|
111
|
-
const data = databaseInstance.current.search(values);
|
|
109
|
+
const data = databaseInstance.current.search(values.join(' '));
|
|
112
110
|
setResult((prevResult) => ({ ...prevResult, data }));
|
|
113
111
|
}
|
|
112
|
+
hideLoading();
|
|
114
113
|
}
|
|
115
|
-
});
|
|
116
|
-
}, [keywords]);
|
|
114
|
+
}, 0);
|
|
115
|
+
}, [alert, keywords]);
|
|
117
116
|
(0, react_2.useEffect)(() => {
|
|
118
117
|
function handle(event) {
|
|
119
118
|
if (selectedTool === ToolTypes_1.options.databaseRangesSelection.id) {
|
|
120
119
|
setKeywords((prevState) => {
|
|
121
120
|
const oldKeywords = prevState.searchKeywords
|
|
122
|
-
? prevState.searchKeywords.split('
|
|
121
|
+
? prevState.searchKeywords.split(' ')
|
|
123
122
|
: [];
|
|
124
123
|
const [from, to] = event.range;
|
|
125
124
|
const searchKeywords = [
|
|
126
125
|
...oldKeywords,
|
|
127
126
|
`delta:${format(from)}..${format(to)}`,
|
|
128
|
-
].join('
|
|
127
|
+
].join(' ');
|
|
129
128
|
return { ...prevState, searchKeywords };
|
|
130
129
|
});
|
|
131
130
|
}
|
|
@@ -136,20 +135,83 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
136
135
|
};
|
|
137
136
|
}, [format, selectedTool]);
|
|
138
137
|
const handleChangeDatabase = (0, react_2.useCallback)((databaseKey) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
const database = databases.find((item) => item.key === databaseKey);
|
|
139
|
+
setTimeout(async () => {
|
|
140
|
+
if (database?.url) {
|
|
141
|
+
const { url, label } = database;
|
|
142
|
+
const hideLoading = await alert.showLoading(`load ${label} database`);
|
|
143
|
+
try {
|
|
144
|
+
databaseDataRef.current = await fetch(url)
|
|
145
|
+
.then((response) => response.json())
|
|
146
|
+
.then((databaseRecords) => databaseRecords.map((record) => ({
|
|
147
|
+
...record,
|
|
148
|
+
baseURL: url,
|
|
149
|
+
})));
|
|
150
|
+
}
|
|
151
|
+
catch (e) {
|
|
152
|
+
alert.error(`Failed to load ${url}`);
|
|
153
|
+
}
|
|
154
|
+
finally {
|
|
155
|
+
hideLoading();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
databaseDataRef.current = database
|
|
160
|
+
?.value;
|
|
161
|
+
}
|
|
162
|
+
const hideLoading = await alert.showLoading(`loading / preparing of the database`);
|
|
163
|
+
databaseInstance.current = (0, database_1.initiateDatabase)(databaseDataRef.current, nucleus);
|
|
164
|
+
setKeywords({ ...emptyKeywords });
|
|
165
|
+
hideLoading();
|
|
166
|
+
}, 0);
|
|
167
|
+
}, [alert, databases, nucleus]);
|
|
168
|
+
(0, react_2.useEffect)(() => {
|
|
169
|
+
setTimeout(async () => {
|
|
170
|
+
if (databaseInstance.current) {
|
|
171
|
+
const hideLoading = await alert.showLoading(`loading / preparing of the database`);
|
|
172
|
+
databaseInstance.current = (0, database_1.initiateDatabase)(databaseDataRef.current, nucleus);
|
|
173
|
+
hideLoading();
|
|
174
|
+
setKeywords({ ...emptyKeywords });
|
|
175
|
+
}
|
|
176
|
+
}, 0);
|
|
177
|
+
}, [alert, nucleus]);
|
|
178
|
+
(0, react_2.useEffect)(() => {
|
|
179
|
+
if (item?.isOpen && defaultDatabase && !databaseInstance.current) {
|
|
180
|
+
handleChangeDatabase(defaultDatabase);
|
|
181
|
+
}
|
|
182
|
+
}, [databases, defaultDatabase, handleChangeDatabase, item?.isOpen, nucleus]);
|
|
142
183
|
const tableData = (0, react_2.useMemo)(() => {
|
|
143
184
|
return (0, database_1.prepareData)(result.data);
|
|
144
185
|
}, [result.data]);
|
|
145
186
|
const resurrectHandler = (0, react_2.useCallback)((row) => {
|
|
146
|
-
const { index } = row.original;
|
|
187
|
+
const { index, baseURL, jcampURL: jcampRelativeURL } = row.original;
|
|
147
188
|
const { ranges, solvent, names = [] } = result.data[index];
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
189
|
+
if (jcampRelativeURL) {
|
|
190
|
+
setTimeout(async () => {
|
|
191
|
+
const hideLoading = await alert.showLoading(`load jcamp in progress...`);
|
|
192
|
+
try {
|
|
193
|
+
const jcampURL = new URL(jcampRelativeURL, baseURL);
|
|
194
|
+
const result = await (0, FileUtility_1.loadFile)(jcampURL);
|
|
195
|
+
dispatch({
|
|
196
|
+
type: Types_1.RESURRECTING_SPECTRUM_FROM_JCAMP,
|
|
197
|
+
payload: { file: result, ranges, jcampURL },
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
catch (e) {
|
|
201
|
+
alert.error(`Failed to load Jcamp`);
|
|
202
|
+
}
|
|
203
|
+
finally {
|
|
204
|
+
hideLoading();
|
|
205
|
+
}
|
|
206
|
+
}, 0);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
dispatch({
|
|
210
|
+
type: Types_1.RESURRECTING_SPECTRUM_FROM_RANGES,
|
|
211
|
+
payload: { ranges, info: { solvent, nucleus, name: names[0] } },
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}, [alert, dispatch, nucleus, result.data]);
|
|
153
215
|
const clearHandler = (0, react_2.useCallback)(() => {
|
|
154
216
|
setKeywords((prevState) => ({ ...prevState, searchKeywords: '' }));
|
|
155
217
|
}, []);
|
|
@@ -157,6 +219,22 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
157
219
|
const tool = !flag ? ToolTypes_1.options.zoom.id : ToolTypes_1.options.databaseRangesSelection.id;
|
|
158
220
|
handleChangeOption(tool);
|
|
159
221
|
}, [handleChangeOption]);
|
|
222
|
+
const searchByStructureHandler = (idCodeValue) => {
|
|
223
|
+
setTimeout(async () => {
|
|
224
|
+
const hideLoading = await alert.showLoading(`Searching in progress...`);
|
|
225
|
+
const data = databaseInstance.current?.searchByStructure(idCodeValue) || [];
|
|
226
|
+
setResult((prevResult) => ({ ...prevResult, data }));
|
|
227
|
+
setIdCode(idCodeValue);
|
|
228
|
+
hideLoading();
|
|
229
|
+
}, 0);
|
|
230
|
+
};
|
|
231
|
+
const openSearchByStructure = () => {
|
|
232
|
+
modal.show((0, jsx_runtime_1.jsx)(DatabaseStructureSearchModal_1.DatabaseStructureSearchModal, { onChange: searchByStructureHandler, idCode: idCode }), {
|
|
233
|
+
position: Modal_1.positions.MIDDLE,
|
|
234
|
+
transition: Modal_1.transitions.SCALE,
|
|
235
|
+
isBackgroundBlur: false,
|
|
236
|
+
});
|
|
237
|
+
};
|
|
160
238
|
return ((0, jsx_runtime_1.jsxs)("div", { css: [
|
|
161
239
|
BasicPanelStyle_1.tablePanelStyle,
|
|
162
240
|
style,
|
|
@@ -173,14 +251,23 @@ function DatabasePanelInner({ nucleus, selectedTool }) {
|
|
|
173
251
|
pointerEvents: 'none',
|
|
174
252
|
fontSize: '12px',
|
|
175
253
|
transform: 'rotate(90deg)',
|
|
176
|
-
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2 }, data:
|
|
254
|
+
} }) }, `${selectedTool}`), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 2 }, data: mapDatabasesToSelect(databases), onChange: handleChangeDatabase, placeholder: "Select database", defaultValue: defaultDatabase }), (0, jsx_runtime_1.jsx)(Select_1.default, { style: { flex: 1 }, data: result.solvents, placeholder: "Solvent", onChange: handleSearch }), (0, jsx_runtime_1.jsx)(Input_1.default, { value: keywords.searchKeywords, renderIcon: () => (0, jsx_runtime_1.jsx)(io5_1.IoSearchOutline, {}), style: { inputWrapper: { flex: 3 } }, className: "search-input", type: "text", debounceTime: 250, placeholder: "Search for parameter...", onChange: handleSearch, onClear: clearHandler, canClear: true }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { fill: "clear", onClick: openSearchByStructure, style: { marginLeft: '5px' }, children: !idCode ? ((0, jsx_runtime_1.jsx)(bs_1.BsHexagon, { style: {
|
|
255
|
+
fontSize: '14px',
|
|
256
|
+
} })) : ((0, jsx_runtime_1.jsx)(bs_1.BsHexagonFill, { style: {
|
|
257
|
+
fontSize: '14px',
|
|
258
|
+
} })) })] })), isFlipped && ((0, jsx_runtime_1.jsx)(PreferencesHeader_1.default, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), (0, jsx_runtime_1.jsx)("div", { className: "inner-container", children: !isFlipped ? (tableData && tableData.length > 0 ? ((0, jsx_runtime_1.jsx)(DatabaseTable_1.default, { data: tableData, onAdd: resurrectHandler })) : ((0, jsx_runtime_1.jsx)(NoTableData_1.default, { text: databases && databases?.length > 0
|
|
259
|
+
? 'Please select a database'
|
|
260
|
+
: 'Please add databases URL in the general preferences' }))) : ((0, jsx_runtime_1.jsx)(DatabasePreferences_1.default, { ref: settingRef })) })] }));
|
|
177
261
|
}
|
|
178
262
|
const MemoizedDatabasePanel = (0, react_2.memo)(DatabasePanelInner);
|
|
179
263
|
function PeaksPanel() {
|
|
180
264
|
const { activeTab, toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
265
|
+
const { current } = (0, PreferencesContext_1.usePreferences)();
|
|
266
|
+
const { data, defaultDatabase } = current.databases;
|
|
267
|
+
const databases = database_1.DATA_BASES.concat(data.filter((datum) => datum.enabled));
|
|
181
268
|
if (!activeTab)
|
|
182
269
|
return (0, jsx_runtime_1.jsx)("div", {});
|
|
183
|
-
return ((0, jsx_runtime_1.jsx)(MemoizedDatabasePanel, { nucleus: activeTab, selectedTool: selectedTool }));
|
|
270
|
+
return ((0, jsx_runtime_1.jsx)(MemoizedDatabasePanel, { nucleus: activeTab, selectedTool: selectedTool, databases: databases, defaultDatabase: defaultDatabase }));
|
|
184
271
|
}
|
|
185
272
|
exports.default = PeaksPanel;
|
|
186
273
|
function mapSolventsToSelect(solvents) {
|
|
@@ -195,9 +282,9 @@ function mapSolventsToSelect(solvents) {
|
|
|
195
282
|
return result;
|
|
196
283
|
}
|
|
197
284
|
function mapDatabasesToSelect(databases) {
|
|
198
|
-
return databases.map(({
|
|
199
|
-
key
|
|
200
|
-
value:
|
|
201
|
-
label
|
|
285
|
+
return databases.map(({ label, key }) => ({
|
|
286
|
+
key,
|
|
287
|
+
value: key,
|
|
288
|
+
label,
|
|
202
289
|
}));
|
|
203
290
|
}
|
|
@@ -6,55 +6,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
9
|
+
const Label_1 = __importDefault(require("../../elements/Label"));
|
|
10
|
+
const FormikColorInput_1 = __importDefault(require("../../elements/formik/FormikColorInput"));
|
|
9
11
|
const FormikColumnFormatField_1 = __importDefault(require("../../elements/formik/FormikColumnFormatField"));
|
|
10
12
|
const FormikForm_1 = __importDefault(require("../../elements/formik/FormikForm"));
|
|
13
|
+
const FormikInput_1 = __importDefault(require("../../elements/formik/FormikInput"));
|
|
11
14
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
container: {
|
|
16
|
-
padding: 10,
|
|
17
|
-
backgroundColor: '#f1f1f1',
|
|
18
|
-
height: '100%',
|
|
19
|
-
overflowY: 'auto',
|
|
20
|
-
},
|
|
21
|
-
groupContainer: {
|
|
22
|
-
padding: '5px',
|
|
23
|
-
borderRadius: '5px',
|
|
24
|
-
margin: '10px 0px',
|
|
25
|
-
backgroundColor: 'white',
|
|
26
|
-
},
|
|
27
|
-
header: {
|
|
28
|
-
borderBottom: '1px solid #e8e8e8',
|
|
29
|
-
paddingBottom: '5px',
|
|
30
|
-
fontWeight: 'bold',
|
|
31
|
-
color: '#4a4a4a',
|
|
32
|
-
},
|
|
33
|
-
inputContainer: {
|
|
34
|
-
flex: 4,
|
|
35
|
-
borderRadius: '5px',
|
|
36
|
-
},
|
|
37
|
-
inputLabel: {
|
|
38
|
-
flex: 2,
|
|
39
|
-
fontSize: '11px',
|
|
40
|
-
fontWeight: 'bold',
|
|
41
|
-
color: '#232323',
|
|
42
|
-
},
|
|
43
|
-
input: {
|
|
44
|
-
width: '100px',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
15
|
+
const usePanelPreferences_1 = require("../../hooks/usePanelPreferences");
|
|
16
|
+
const PreferencesContainer_1 = require("../extra/preferences/PreferencesContainer");
|
|
17
|
+
const PreferencesGroup_1 = require("../extra/preferences/PreferencesGroup");
|
|
47
18
|
function DatabasePreferences(props, ref) {
|
|
48
19
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
49
20
|
const alert = (0, Alert_1.useAlert)();
|
|
50
21
|
const formRef = (0, react_1.useRef)();
|
|
51
|
-
const
|
|
52
|
-
const databasePreferences = (0, LocalStorage_1.getValue)(preferences.current, `formatting.panels.database`);
|
|
53
|
-
formRef.current.setValues(databasePreferences ? databasePreferences : defaultValues_1.databaseDefaultValues);
|
|
54
|
-
}, [preferences]);
|
|
22
|
+
const databasePreferences = (0, usePanelPreferences_1.usePanelPreferences)('database');
|
|
55
23
|
(0, react_1.useEffect)(() => {
|
|
56
|
-
|
|
57
|
-
}, [
|
|
24
|
+
formRef.current.setValues(databasePreferences);
|
|
25
|
+
}, [databasePreferences]);
|
|
58
26
|
const saveHandler = (0, react_1.useCallback)((values) => {
|
|
59
27
|
preferences.dispatch({
|
|
60
28
|
type: 'SET_PANELS_PREFERENCES',
|
|
@@ -67,6 +35,6 @@ function DatabasePreferences(props, ref) {
|
|
|
67
35
|
formRef.current.submitForm();
|
|
68
36
|
},
|
|
69
37
|
}));
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(PreferencesContainer_1.PreferencesContainer, { children: (0, jsx_runtime_1.jsxs)(FormikForm_1.default, { onSubmit: saveHandler, ref: formRef, children: [(0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Preview jcamp", checkControllerName: "previewJcamp", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColorInput_1.default, { name: "color" }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Margin bottom (px) :", style: { label: { padding: 0, flex: 4 }, wrapper: { flex: 8 } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "marginBottom", type: "number" }) })] }), (0, jsx_runtime_1.jsxs)(PreferencesGroup_1.PreferencesGroup, { header: "Table Preferences", children: [(0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Structure", checkControllerName: "showSmiles", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Solvent", checkControllerName: "showSolvent", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Names", checkControllerName: "showNames", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Range", checkControllerName: "range.show", formatControllerName: "range.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "\u03B4 (ppm)", checkControllerName: "delta.show", formatControllerName: "delta.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Assignment", checkControllerName: "showAssignment", hideFormatField: true }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "J (Hz)", checkControllerName: "coupling.show", formatControllerName: "coupling.format" }), (0, jsx_runtime_1.jsx)(FormikColumnFormatField_1.default, { label: "Multiplicity", checkControllerName: "showMultiplicity", hideFormatField: true })] })] }) }));
|
|
71
39
|
}
|
|
72
40
|
exports.default = (0, react_1.forwardRef)(DatabasePreferences);
|