nmrium 0.23.0 → 0.24.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/README.md +4 -0
- package/lib/component/1d/Chart1D.js +1 -1
- package/lib/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib/component/1d/ExclusionZonesAnnotations.js +2 -2
- package/lib/component/1d/FooterBanner.js +7 -8
- package/lib/component/1d/Integral.js +2 -2
- package/lib/component/1d/IntegralResizable.js +1 -1
- package/lib/component/1d/IntegralsSeries.js +2 -2
- package/lib/component/1d/LinesSeries.js +1 -1
- package/lib/component/1d/PeakAnnotation.js +3 -3
- package/lib/component/1d/PeakAnnotations.js +1 -1
- package/lib/component/1d/Resizable.js +2 -2
- package/lib/component/1d/ResurrectedDatabaseRanges.js +1 -1
- package/lib/component/1d/SpectraTracker.js +3 -3
- package/lib/component/1d/Viewer1D.js +5 -5
- package/lib/component/1d/XAxis.js +1 -1
- package/lib/component/1d/YAxis.js +1 -1
- package/lib/component/1d/jCouplingGraph/JGraph.js +3 -4
- package/lib/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
- package/lib/component/1d/jCouplingGraph/JsCoupling.js +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplings.js +2 -2
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
- package/lib/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
- package/lib/component/1d/multiplicityTree/TreeNodes.js +2 -2
- package/lib/component/1d/ranges/Range.js +2 -2
- package/lib/component/1d/ranges/RangeIntegral.js +1 -1
- package/lib/component/1d/ranges/Ranges.js +2 -2
- package/lib/component/1d/tool/BaseLineZones.js +1 -1
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- 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 -2
- package/lib/component/2d/Contours.js +6 -6
- package/lib/component/2d/FooterBanner.js +3 -3
- package/lib/component/2d/Left1DChart.js +1 -1
- package/lib/component/2d/SignalDeltaLine.js +1 -1
- package/lib/component/2d/Top1DChart.js +1 -1
- package/lib/component/2d/Viewer2D.js +3 -3
- package/lib/component/2d/XAxis.js +1 -1
- package/lib/component/2d/YAxis.js +1 -1
- package/lib/component/2d/tools/XYLabelPointer.js +1 -1
- package/lib/component/2d/tools/slicing/HorizontalSliceChart.js +1 -1
- package/lib/component/2d/tools/slicing/SlicingView.js +1 -1
- package/lib/component/2d/tools/slicing/VerticalSliceChart.js +1 -1
- package/lib/component/2d/zones/IndicationLines.js +1 -1
- package/lib/component/2d/zones/Signal.js +2 -2
- package/lib/component/2d/zones/SignalCrosshair.js +1 -1
- package/lib/component/2d/zones/Zone.js +1 -1
- package/lib/component/2d/zones/Zones.js +2 -2
- package/lib/component/ErrorOverlay.js +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +1 -1
- package/lib/component/EventsTrackers/MouseTracker.js +1 -1
- package/lib/component/NMRium.d.ts +34 -33
- package/lib/component/NMRium.js +10 -10
- package/lib/component/assignment/index.js +1 -1
- package/lib/component/context/PreferencesContext.d.ts +84 -2
- package/lib/component/context/PreferencesContext.js +30 -5
- package/lib/component/elements/Button.js +1 -1
- package/lib/component/elements/ButtonToolTip.js +1 -1
- package/lib/component/elements/CheckBox.js +1 -1
- package/lib/component/elements/CloseButton.js +1 -1
- package/lib/component/elements/ColorInput.js +1 -1
- package/lib/component/elements/ContextMenu.js +1 -1
- package/lib/component/elements/DeleteButton.js +1 -1
- package/lib/component/elements/EditableColumn.js +1 -1
- package/lib/component/elements/Input.js +1 -1
- package/lib/component/elements/InputRange.js +1 -1
- package/lib/component/elements/IsotopesViewer.js +1 -1
- package/lib/component/elements/Label.js +1 -1
- package/lib/component/elements/Logo.js +1 -1
- package/lib/component/elements/MenuButton.js +3 -3
- package/lib/component/elements/MolecularFormulaInput.js +1 -1
- package/lib/component/elements/MoleculeSelection.js +1 -1
- package/lib/component/elements/NextPrev.js +2 -2
- package/lib/component/elements/NumberInput.js +1 -1
- package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
- package/lib/component/elements/ReactTable/ReactTable.js +3 -3
- package/lib/component/elements/ReactTable/ReactTableExpandable.js +3 -3
- package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib/component/elements/SaveButton.js +1 -1
- package/lib/component/elements/Select.js +1 -1
- package/lib/component/elements/Tab/DeleteButton.js +1 -1
- package/lib/component/elements/Tab/Tab.js +3 -3
- package/lib/component/elements/Tab/Tabs.js +2 -2
- package/lib/component/elements/Table/Table.js +1 -1
- package/lib/component/elements/Table/TableBody.js +1 -1
- package/lib/component/elements/Table/TableCell.js +1 -1
- package/lib/component/elements/Table/TableHead.js +1 -1
- package/lib/component/elements/Table/TableRow.js +1 -1
- package/lib/component/elements/ToggleButton.js +1 -1
- package/lib/component/elements/ToolTip/ToolTip.js +2 -2
- package/lib/component/elements/ToolbarMenu.js +3 -3
- package/lib/component/elements/accordion/Accordion.js +1 -1
- package/lib/component/elements/accordion/AccordionItem.js +2 -2
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +20 -1
- package/lib/component/elements/dropDownButton/DropDownButton.js +32 -34
- package/lib/component/elements/dropDownButton/DropDownList.d.ts +2 -9
- package/lib/component/elements/dropDownButton/DropDownList.js +39 -25
- package/lib/component/elements/formik/ErrorMessage.js +2 -2
- package/lib/component/elements/formik/FormikCheckBox.d.ts +1 -0
- package/lib/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib/component/elements/formik/FormikColorInput.js +1 -1
- package/lib/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib/component/elements/formik/FormikForm.js +1 -1
- package/lib/component/elements/formik/FormikInput.js +1 -1
- package/lib/component/elements/formik/FormikNumberInput.js +1 -1
- package/lib/component/elements/formik/FormikSelect.js +1 -1
- package/lib/component/elements/formik/FormikSlider.js +1 -1
- package/lib/component/elements/formik/FormikTextarea.js +1 -1
- package/lib/component/elements/formik/Input.js +1 -1
- package/lib/component/elements/formik/SelectBox.js +1 -1
- package/lib/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
- package/lib/component/elements/popup/Alert/ProgressIndicator.js +1 -1
- package/lib/component/elements/popup/Alert/Provider.js +3 -3
- package/lib/component/elements/popup/Modal/ConfirmDialog.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/popup/Modal/Provider.js +3 -3
- package/lib/component/elements/popup/Transition.js +1 -1
- package/lib/component/elements/popup/Wrapper.js +1 -1
- package/lib/component/elements/toggle/ToggleButton.js +1 -1
- package/lib/component/elements/toggle/ToggleButtonGroup.js +1 -1
- package/lib/component/header/AutoPeakPickingOptionPanel.js +3 -3
- package/lib/component/header/BaseLineCorrectionPanel.js +1 -1
- package/lib/component/header/Header.js +28 -14
- package/lib/component/header/ManualPhaseCorrectionPanel.js +2 -2
- package/lib/component/header/RangesPickingOptionPanel.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib/component/header/Zones2DOptionPanel.js +1 -1
- package/lib/component/highlight/index.js +1 -1
- package/lib/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib/component/hooks/useCheckExperimentalFeature.js +5 -4
- package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
- package/lib/component/hooks/useExport.js +15 -13
- package/lib/component/hooks/useTableSortBy.d.ts +2 -1
- package/lib/component/hooks/useTableSortBy.js +27 -16
- package/lib/component/loader/DefaultSpinnerComponent.js +1 -1
- package/lib/component/loader/DropZone.js +2 -2
- package/lib/component/loader/NoData.js +1 -3
- package/lib/component/loader/Spinner.js +1 -1
- package/lib/component/loader/SpinnerContext.js +1 -1
- package/lib/component/modal/AboutUsModal.js +4 -4
- package/lib/component/modal/AlignSpectraModal.js +1 -1
- package/lib/component/modal/CopyClipboardModal.js +2 -2
- package/lib/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib/component/modal/ImportPublicationStringModal.js +13 -11
- package/lib/component/modal/LoadJCAMPModal.js +1 -1
- package/lib/component/modal/ModalStyle.js +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +1 -1
- package/lib/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
- package/lib/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
- package/lib/component/modal/MultipleSpectraFiltersModal/index.js +4 -4
- package/lib/component/modal/MultipletAnalysisModal.js +5 -5
- package/lib/component/modal/PredictSpectraModal.js +30 -23
- package/lib/component/modal/SaveAsModal.js +2 -2
- package/lib/component/modal/changeSum/ChangeSumModal.js +8 -7
- package/lib/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -1
- package/lib/component/modal/editRange/EditRangeModal.js +13 -9
- package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +33 -40
- package/lib/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
- package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
- package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +5 -5
- package/lib/component/modal/editZone/EditPathLengthFormik.js +3 -3
- package/lib/component/modal/editZone/EditZoneModal.js +17 -15
- package/lib/component/modal/editZone/SignalFormTab.js +1 -1
- package/lib/component/modal/editZone/SignalsForm.js +2 -2
- package/lib/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib/component/modal/setting/DisplayTabContent.d.ts +2 -2
- package/lib/component/modal/setting/DisplayTabContent.js +49 -15
- package/lib/component/modal/setting/FormattingTabContent.js +3 -3
- package/lib/component/modal/setting/GeneralSettings.js +61 -76
- package/lib/component/modal/setting/WorkspaceItem.d.ts +6 -0
- package/lib/component/modal/setting/WorkspaceItem.js +59 -0
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +2 -2
- package/lib/component/panels/InformationPanel.js +4 -4
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +6 -6
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
- package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +5 -5
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +3 -3
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
- package/lib/component/panels/Panels.js +46 -34
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +2 -2
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +4 -4
- package/lib/component/panels/RangesPanel/RangesHeader.js +16 -14
- package/lib/component/panels/RangesPanel/RangesPanel.js +3 -4
- package/lib/component/panels/RangesPanel/RangesPreferences.js +4 -5
- package/lib/component/panels/RangesPanel/RangesTable.js +3 -3
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.d.ts +2 -6
- package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +6 -66
- package/lib/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +7 -0
- package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +74 -0
- package/lib/component/panels/RangesPanel/hooks/useMapRanges.d.ts +7 -0
- package/lib/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
- package/lib/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
- package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
- package/lib/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
- package/lib/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -4
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +3 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +3 -3
- package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
- package/lib/component/panels/SummaryPanel/Overview.js +2 -2
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -4
- package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +4 -7
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
- package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +3 -3
- package/lib/component/panels/databasePanel/DatabasePreferences.js +3 -4
- package/lib/component/panels/databasePanel/DatabaseTable.js +4 -4
- package/lib/component/panels/extra/placeholder/NoTableData.js +1 -1
- package/lib/component/panels/filtersPanel/FilterPanel.js +2 -2
- package/lib/component/panels/filtersPanel/FiltersTable.js +19 -15
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib/component/panels/header/PreferencesHeader.js +1 -1
- package/lib/component/panels/predictionPanel/PredictionOptions.js +5 -3
- package/lib/component/panels/predictionPanel/PredictionPanel.js +19 -17
- package/lib/component/reducer/Reducer.d.ts +7 -0
- package/lib/component/reducer/Reducer.js +7 -3
- package/lib/component/reducer/actions/FiltersActions.js +1 -1
- package/lib/component/reducer/actions/LoadActions.d.ts +2 -2
- package/lib/component/reducer/actions/LoadActions.js +20 -15
- package/lib/component/reducer/actions/MoleculeActions.js +5 -1
- package/lib/component/reducer/preferencesReducer.d.ts +183 -36
- package/lib/component/reducer/preferencesReducer.js +192 -83
- package/lib/component/reducer/types/Types.d.ts +6 -0
- 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/toolbar/BasicToolBar.js +23 -27
- package/lib/component/toolbar/FunctionToolBar.js +17 -18
- package/lib/component/toolbar/HistoryToolBar.js +1 -1
- package/lib/component/toolbar/ToolBar.js +2 -2
- package/lib/component/utility/FormatNumber.js +1 -1
- package/lib/component/workspaces/Workspace.d.ts +17 -0
- package/lib/component/workspaces/basic.js +29 -34
- package/lib/component/workspaces/exercise.d.ts +2 -0
- package/lib/component/workspaces/exercise.js +49 -0
- package/lib/component/workspaces/index.d.ts +3 -2
- package/lib/component/workspaces/index.js +3 -2
- package/lib/component/workspaces/prediction.d.ts +2 -0
- package/lib/component/workspaces/prediction.js +26 -0
- package/lib/component/workspaces/process1D.js +21 -32
- package/lib/data/PredictionManager.d.ts +2 -1
- package/lib/data/PredictionManager.js +20 -13
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +4 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +2 -3
- package/lib/data/utilities/getAtom.js +1 -1
- package/lib/data/utilities/getColor.d.ts +1 -0
- package/lib/data/utilities/getColor.js +1 -1
- package/lib/types/PanelPreferencesType.d.ts +10 -0
- package/lib/types/PanelPreferencesType.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +1 -1
- package/lib-cjs/component/1d/ExclusionZoneAnnotation.js +1 -1
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +7 -3
- package/lib-cjs/component/1d/FooterBanner.js +7 -8
- package/lib-cjs/component/1d/Integral.js +2 -2
- package/lib-cjs/component/1d/IntegralResizable.js +1 -1
- package/lib-cjs/component/1d/IntegralsSeries.js +2 -2
- package/lib-cjs/component/1d/Line.js +5 -1
- package/lib-cjs/component/1d/LinesSeries.js +1 -1
- package/lib-cjs/component/1d/PeakAnnotation.js +3 -3
- package/lib-cjs/component/1d/PeakAnnotations.js +1 -1
- package/lib-cjs/component/1d/Resizable.js +2 -2
- package/lib-cjs/component/1d/ResurrectedDatabaseRanges.js +1 -1
- package/lib-cjs/component/1d/SpectraTracker.js +3 -3
- package/lib-cjs/component/1d/Viewer1D.js +10 -6
- package/lib-cjs/component/1d/XAxis.js +6 -2
- package/lib-cjs/component/1d/YAxis.js +6 -2
- package/lib-cjs/component/1d/jCouplingGraph/JGraph.js +3 -4
- package/lib-cjs/component/1d/jCouplingGraph/JGraphVerticalAxis.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCoupling.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCouplings.js +2 -2
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +1 -1
- package/lib-cjs/component/1d/multiAnalysis/MultiAnalysisRanges.js +2 -2
- package/lib-cjs/component/1d/multiplicityTree/MultiplicityTree.js +3 -3
- package/lib-cjs/component/1d/multiplicityTree/TempMultiplicityTree.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/TreeNodes.js +2 -2
- package/lib-cjs/component/1d/ranges/Range.js +2 -2
- package/lib-cjs/component/1d/ranges/RangeIntegral.js +1 -1
- package/lib-cjs/component/1d/ranges/Ranges.js +2 -2
- package/lib-cjs/component/1d/tool/BaseLineZones.js +1 -1
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/tool/VerticalIndicator.js +1 -1
- package/lib-cjs/component/1d/tool/XLabelPointer.js +1 -1
- package/lib-cjs/component/2d/Chart2D.js +2 -2
- package/lib-cjs/component/2d/Contours.js +6 -6
- package/lib-cjs/component/2d/FooterBanner.js +3 -3
- package/lib-cjs/component/2d/Left1DChart.js +6 -2
- package/lib-cjs/component/2d/SignalDeltaLine.js +1 -1
- package/lib-cjs/component/2d/Top1DChart.js +6 -2
- package/lib-cjs/component/2d/Viewer2D.js +8 -4
- package/lib-cjs/component/2d/XAxis.js +6 -2
- package/lib-cjs/component/2d/YAxis.js +6 -2
- package/lib-cjs/component/2d/tools/XYLabelPointer.js +1 -1
- package/lib-cjs/component/2d/tools/slicing/HorizontalSliceChart.js +6 -2
- package/lib-cjs/component/2d/tools/slicing/SlicingView.js +1 -1
- package/lib-cjs/component/2d/tools/slicing/VerticalSliceChart.js +6 -2
- package/lib-cjs/component/2d/zones/IndicationLines.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +2 -2
- package/lib-cjs/component/2d/zones/SignalCrosshair.js +1 -1
- package/lib-cjs/component/2d/zones/Zone.js +1 -1
- package/lib-cjs/component/2d/zones/Zones.js +2 -2
- package/lib-cjs/component/ErrorOverlay.js +1 -1
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +1 -1
- package/lib-cjs/component/EventsTrackers/MouseTracker.js +1 -1
- package/lib-cjs/component/NMRium.js +14 -10
- package/lib-cjs/component/assignment/index.js +1 -1
- package/lib-cjs/component/context/PreferencesContext.js +33 -4
- package/lib-cjs/component/elements/Button.js +1 -1
- package/lib-cjs/component/elements/ButtonToolTip.js +1 -1
- package/lib-cjs/component/elements/CheckBox.js +1 -1
- package/lib-cjs/component/elements/CloseButton.js +1 -1
- package/lib-cjs/component/elements/ColorInput.js +1 -1
- package/lib-cjs/component/elements/ContextMenu.js +1 -1
- package/lib-cjs/component/elements/DeleteButton.js +1 -1
- package/lib-cjs/component/elements/EditableColumn.js +1 -1
- package/lib-cjs/component/elements/Input.js +1 -1
- package/lib-cjs/component/elements/InputRange.js +1 -1
- package/lib-cjs/component/elements/IsotopesViewer.js +1 -1
- package/lib-cjs/component/elements/Label.js +1 -1
- package/lib-cjs/component/elements/Logo.js +1 -1
- package/lib-cjs/component/elements/MenuButton.js +3 -3
- package/lib-cjs/component/elements/MolecularFormulaInput.js +1 -1
- package/lib-cjs/component/elements/MoleculeSelection.js +1 -1
- package/lib-cjs/component/elements/NextPrev.js +2 -2
- package/lib-cjs/component/elements/NumberInput.js +1 -1
- package/lib-cjs/component/elements/ReactTable/Elements/ReactTableHeader.js +1 -1
- package/lib-cjs/component/elements/ReactTable/ReactTable.js +8 -4
- package/lib-cjs/component/elements/ReactTable/ReactTableExpandable.js +3 -3
- package/lib-cjs/component/elements/ReactTable/ReactTableFlexLayout.js +2 -2
- package/lib-cjs/component/elements/SaveButton.js +1 -1
- package/lib-cjs/component/elements/Select.js +1 -1
- package/lib-cjs/component/elements/Tab/DeleteButton.js +1 -1
- package/lib-cjs/component/elements/Tab/Tab.js +3 -3
- package/lib-cjs/component/elements/Tab/Tabs.js +2 -2
- package/lib-cjs/component/elements/Table/Table.js +1 -1
- package/lib-cjs/component/elements/Table/TableBody.js +1 -1
- package/lib-cjs/component/elements/Table/TableCell.js +1 -1
- package/lib-cjs/component/elements/Table/TableHead.js +1 -1
- package/lib-cjs/component/elements/Table/TableRow.js +1 -1
- package/lib-cjs/component/elements/ToggleButton.js +1 -1
- package/lib-cjs/component/elements/ToolTip/ToolTip.js +2 -2
- package/lib-cjs/component/elements/ToolbarMenu.js +3 -3
- package/lib-cjs/component/elements/accordion/Accordion.js +1 -1
- package/lib-cjs/component/elements/accordion/AccordionItem.js +2 -2
- package/lib-cjs/component/elements/dropDownButton/DropDownButton.js +32 -34
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +39 -25
- package/lib-cjs/component/elements/formik/ErrorMessage.js +2 -2
- package/lib-cjs/component/elements/formik/FormikCheckBox.js +2 -2
- package/lib-cjs/component/elements/formik/FormikColorInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColorPicker.js +1 -1
- package/lib-cjs/component/elements/formik/FormikColumnFormatField.js +2 -2
- package/lib-cjs/component/elements/formik/FormikErrorsSummary.js +2 -2
- package/lib-cjs/component/elements/formik/FormikForm.js +1 -1
- package/lib-cjs/component/elements/formik/FormikInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikNumberInput.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSelect.js +1 -1
- package/lib-cjs/component/elements/formik/FormikSlider.js +1 -1
- package/lib-cjs/component/elements/formik/FormikTextarea.js +1 -1
- package/lib-cjs/component/elements/formik/Input.js +1 -1
- package/lib-cjs/component/elements/formik/SelectBox.js +1 -1
- package/lib-cjs/component/elements/linearAxis/LinearVerticalAxis.js +3 -3
- package/lib-cjs/component/elements/popup/Alert/ProgressIndicator.js +1 -1
- package/lib-cjs/component/elements/popup/Alert/Provider.js +3 -3
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.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/popup/Modal/Provider.js +3 -3
- package/lib-cjs/component/elements/popup/Transition.js +1 -1
- package/lib-cjs/component/elements/popup/Wrapper.js +1 -1
- package/lib-cjs/component/elements/toggle/ToggleButton.js +1 -1
- package/lib-cjs/component/elements/toggle/ToggleButtonGroup.js +1 -1
- package/lib-cjs/component/header/AutoPeakPickingOptionPanel.js +3 -3
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +6 -2
- package/lib-cjs/component/header/Header.js +27 -13
- package/lib-cjs/component/header/ManualPhaseCorrectionPanel.js +7 -3
- package/lib-cjs/component/header/RangesPickingOptionPanel.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +1 -1
- package/lib-cjs/component/header/Zones2DOptionPanel.js +1 -1
- package/lib-cjs/component/highlight/index.js +1 -1
- package/lib-cjs/component/hooks/useActiveSpectrumStyleOptions.js +1 -1
- package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -4
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +1 -1
- package/lib-cjs/component/hooks/useExport.js +15 -13
- package/lib-cjs/component/hooks/useTableSortBy.js +27 -16
- package/lib-cjs/component/loader/DefaultSpinnerComponent.js +1 -1
- package/lib-cjs/component/loader/DropZone.js +2 -2
- package/lib-cjs/component/loader/NoData.js +1 -3
- package/lib-cjs/component/loader/Spinner.js +1 -1
- package/lib-cjs/component/loader/SpinnerContext.js +1 -1
- package/lib-cjs/component/modal/AboutUsModal.js +4 -4
- package/lib-cjs/component/modal/AlignSpectraModal.js +1 -1
- package/lib-cjs/component/modal/CopyClipboardModal.js +2 -2
- package/lib-cjs/component/modal/ExportAsMatrixModal.js +1 -1
- package/lib-cjs/component/modal/ImportPublicationStringModal.js +18 -12
- package/lib-cjs/component/modal/LoadJCAMPModal.js +1 -1
- package/lib-cjs/component/modal/ModalStyle.js +1 -1
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +1 -1
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/EquallySpacedFilter.js +1 -1
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/FromToFilter.js +1 -1
- package/lib-cjs/component/modal/MultipleSpectraFiltersModal/index.js +9 -5
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +5 -5
- package/lib-cjs/component/modal/PredictSpectraModal.js +35 -24
- package/lib-cjs/component/modal/SaveAsModal.js +2 -2
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +13 -8
- package/lib-cjs/component/modal/changeSum/SelectMolecule.js +1 -1
- package/lib-cjs/component/modal/editRange/EditRangeModal.js +13 -9
- package/lib-cjs/component/modal/editRange/forms/components/AddSignalFormTab.js +38 -41
- package/lib-cjs/component/modal/editRange/forms/components/CouplingsTable.js +5 -5
- package/lib-cjs/component/modal/editRange/forms/components/DeltaInput.js +3 -3
- package/lib-cjs/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +5 -5
- package/lib-cjs/component/modal/editRange/forms/validation/EditRangeValidation.js +5 -1
- package/lib-cjs/component/modal/editZone/EditPathLengthFormik.js +3 -3
- package/lib-cjs/component/modal/editZone/EditZoneModal.js +17 -15
- package/lib-cjs/component/modal/editZone/SignalFormTab.js +1 -1
- package/lib-cjs/component/modal/editZone/SignalsForm.js +2 -2
- package/lib-cjs/component/modal/editZone/validation/EditZoneValidation.js +5 -1
- package/lib-cjs/component/modal/setting/ControllersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/DisplayTabContent.js +48 -14
- package/lib-cjs/component/modal/setting/FormattingTabContent.js +3 -3
- package/lib-cjs/component/modal/setting/GeneralSettings.js +64 -75
- package/lib-cjs/component/modal/setting/WorkspaceItem.js +64 -0
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignment.js +1 -1
- package/lib-cjs/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +2 -2
- package/lib-cjs/component/panels/InformationPanel.js +4 -4
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +4 -4
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +6 -6
- package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +5 -6
- package/lib-cjs/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +5 -5
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -6
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/ColumnHeader.js +1 -1
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleAnalysisCodeEditor.js +2 -2
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +16 -14
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPreferences.js +8 -4
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisTable.js +5 -5
- package/lib-cjs/component/panels/Panels.js +46 -34
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +2 -2
- package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -5
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +9 -5
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +16 -14
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +3 -4
- package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -5
- package/lib-cjs/component/panels/RangesPanel/RangesTable.js +3 -3
- package/lib-cjs/component/panels/RangesPanel/RangesTableRow.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/AbsoluteColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/ActionsColumn.js +5 -65
- package/lib-cjs/component/panels/RangesPanel/TableColumns/CouplingColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RangeColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +2 -2
- package/lib-cjs/component/panels/RangesPanel/hooks/useEditRangeModal.js +80 -0
- package/lib-cjs/component/panels/RangesPanel/{useMapRanges.js → hooks/useMapRanges.js} +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +12 -10
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListItem.js +4 -4
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumListPanel.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectrumsTabs.js +13 -11
- package/lib-cjs/component/panels/SpectrumsPanel/base/ColorIndicator.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideMarkersButton.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +3 -3
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DHistogram.js +5 -5
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum1DSetting.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DHistogram.js +5 -5
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/Spectrum2DSetting.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +3 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTable.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +4 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/Confirmation.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +8 -4
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/EditPathLength.js +3 -3
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/editLink/MoveLink.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/Overview.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/SetShiftTolerancesModal.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +4 -4
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +3 -3
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumns.js +1 -1
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +4 -7
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -5
- package/lib-cjs/component/panels/ZonesPanel/ZonesTable.js +2 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesTableRow.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -3
- package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -4
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +4 -4
- package/lib-cjs/component/panels/extra/placeholder/NoTableData.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FilterPanel.js +2 -2
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +19 -15
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +2 -2
- package/lib-cjs/component/panels/header/PreferencesHeader.js +1 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionOptions.js +10 -4
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +19 -17
- package/lib-cjs/component/reducer/IgnoreActions.js +5 -1
- package/lib-cjs/component/reducer/Reducer.js +14 -5
- package/lib-cjs/component/reducer/actions/FiltersActions.js +6 -2
- package/lib-cjs/component/reducer/actions/LoadActions.js +25 -16
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +10 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +5 -1
- package/lib-cjs/component/reducer/actions/SpectraAnalysisAction.js +5 -1
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +5 -1
- package/lib-cjs/component/reducer/actions/ToolsActions.js +5 -1
- package/lib-cjs/component/reducer/actions/ZonesActions.js +5 -1
- package/lib-cjs/component/reducer/preferencesReducer.js +191 -81
- 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/toolbar/BasicToolBar.js +23 -27
- package/lib-cjs/component/toolbar/FunctionToolBar.js +22 -19
- package/lib-cjs/component/toolbar/HistoryToolBar.js +1 -1
- package/lib-cjs/component/toolbar/ToolBar.js +2 -2
- package/lib-cjs/component/toolbar/ToolTypes.js +5 -1
- package/lib-cjs/component/utility/FormatNumber.js +1 -1
- package/lib-cjs/component/workspaces/basic.js +29 -34
- package/lib-cjs/component/workspaces/exercise.js +52 -0
- package/lib-cjs/component/workspaces/index.js +3 -2
- package/lib-cjs/component/workspaces/prediction.js +29 -0
- package/lib-cjs/component/workspaces/process1D.js +21 -32
- package/lib-cjs/data/Filters.js +5 -1
- package/lib-cjs/data/FiltersManager.js +5 -1
- package/lib-cjs/data/PredictionManager.js +19 -12
- package/lib-cjs/data/SpectraManager.js +5 -1
- package/lib-cjs/data/data1d/Spectrum1D/initiateDatum1D.js +9 -2
- package/lib-cjs/data/data1d/Spectrum1D/shift/getShiftX.js +5 -1
- package/lib-cjs/data/data2d/Spectrum2D/initiateDatum2D.js +7 -4
- package/lib-cjs/data/data2d/Spectrum2D/shift/getShift.js +5 -1
- package/lib-cjs/data/utilities/getAtom.js +1 -1
- package/lib-cjs/data/utilities/getColor.js +2 -1
- package/lib-cjs/types/PanelPreferencesType.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +21 -21
- package/lib/component/panels/RangesPanel/useMapRanges.d.ts +0 -6
- package/lib/component/workspaces/exercise1D.d.ts +0 -2
- package/lib/component/workspaces/exercise1D.js +0 -46
- package/lib-cjs/component/workspaces/exercise1D.js +0 -49
|
@@ -1,157 +1,266 @@
|
|
|
1
|
-
import { produce } from 'immer';
|
|
1
|
+
import { produce, original } from 'immer';
|
|
2
2
|
import lodashMerge from 'lodash/merge';
|
|
3
|
+
import generateID from '../../data/utilities/generateID';
|
|
3
4
|
import { getLocalStorage, removeData, storeData, } from '../utility/LocalStorage';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
export const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import Workspaces from '../workspaces';
|
|
6
|
+
const LOCAL_STORAGE_VERSION = 5;
|
|
7
|
+
export const WORKSPACES = [
|
|
8
|
+
{
|
|
9
|
+
key: 'default',
|
|
10
|
+
label: Workspaces.default.label,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'process1D',
|
|
14
|
+
label: Workspaces.process1D.label,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: 'exercise',
|
|
18
|
+
label: Workspaces.exercise.label,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: 'prediction',
|
|
22
|
+
label: Workspaces.prediction.label,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
10
25
|
function getPreferencesByWorkspace(workspace) {
|
|
11
26
|
switch (workspace) {
|
|
12
|
-
case '
|
|
13
|
-
return
|
|
27
|
+
case 'exercise':
|
|
28
|
+
return Workspaces.exercise;
|
|
14
29
|
case 'process1D':
|
|
15
|
-
return
|
|
30
|
+
return Workspaces.process1D;
|
|
31
|
+
case 'prediction':
|
|
32
|
+
return Workspaces.prediction;
|
|
33
|
+
case 'default':
|
|
34
|
+
return Workspaces.default;
|
|
16
35
|
default:
|
|
17
|
-
return
|
|
36
|
+
return {};
|
|
18
37
|
}
|
|
19
38
|
}
|
|
39
|
+
function getActiveWorkspace(draft) {
|
|
40
|
+
return draft.workspaces[draft.workspace.current || 'default'];
|
|
41
|
+
}
|
|
20
42
|
export const preferencesInitialState = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
nucleus: [
|
|
28
|
-
{ key: '1H', name: '1H', ppm: '0.00', hz: '0.00' },
|
|
29
|
-
{ key: '13C', name: '13C', ppm: '0.00', hz: '0.00' },
|
|
30
|
-
{ key: '15N', name: '15N', ppm: '0.00', hz: '0.00' },
|
|
31
|
-
{ key: '19F', name: '19F', ppm: '0.00', hz: '0.00' },
|
|
32
|
-
{ key: '29Si', name: '29Si', ppm: '0.00', hz: '0.00' },
|
|
33
|
-
{ key: '31P', name: '31P', ppm: '0.00', hz: '0.00' },
|
|
34
|
-
],
|
|
35
|
-
nucleusByKey: {},
|
|
36
|
-
panels: {},
|
|
43
|
+
version: LOCAL_STORAGE_VERSION,
|
|
44
|
+
workspaces: {},
|
|
45
|
+
dispatch: () => null,
|
|
46
|
+
workspace: {
|
|
47
|
+
current: 'default',
|
|
48
|
+
base: null,
|
|
37
49
|
},
|
|
38
|
-
dispatch: null,
|
|
39
|
-
workspace: 'default',
|
|
40
50
|
};
|
|
41
|
-
function
|
|
51
|
+
function filterObject(data) {
|
|
42
52
|
return JSON.parse(JSON.stringify(data), (key, value) => {
|
|
43
|
-
if (value) {
|
|
53
|
+
if (value?.hidden !== true) {
|
|
44
54
|
return value;
|
|
45
55
|
}
|
|
46
56
|
});
|
|
47
57
|
}
|
|
58
|
+
function FlatObject(data) {
|
|
59
|
+
let result = {};
|
|
60
|
+
JSON.parse(JSON.stringify(data), (key, value) => {
|
|
61
|
+
if (value?.hidden !== true && key) {
|
|
62
|
+
result[key] = result[key]++ || 1;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
function checkKeysExists(sourceObject, targetObject) {
|
|
68
|
+
const source = FlatObject(sourceObject);
|
|
69
|
+
const target = FlatObject(targetObject);
|
|
70
|
+
if (Object.keys(target).length === 0) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
for (const [key, value] of Object.entries(source)) {
|
|
74
|
+
if (!target[key] || target[key] !== value) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
48
80
|
function mapNucleus(draft) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
81
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
82
|
+
if (currentWorkspacePreferences.formatting.nucleus &&
|
|
83
|
+
Array.isArray(currentWorkspacePreferences.formatting.nucleus)) {
|
|
84
|
+
currentWorkspacePreferences.formatting.nucleusByKey =
|
|
85
|
+
currentWorkspacePreferences.formatting.nucleus.reduce((acc, item) => {
|
|
86
|
+
acc[item.name.toLowerCase()] = item;
|
|
87
|
+
return { ...acc };
|
|
88
|
+
}, {});
|
|
54
89
|
}
|
|
55
90
|
}
|
|
56
|
-
function
|
|
91
|
+
export function initPreferencesState(state) {
|
|
57
92
|
const nmrLocalStorageVersion = getLocalStorage('nmr-local-storage-version', false);
|
|
58
93
|
let localData = getLocalStorage('nmr-general-settings');
|
|
59
94
|
// remove old nmr-local-storage-version key
|
|
60
95
|
if (nmrLocalStorageVersion && localData?.version) {
|
|
61
96
|
removeData('nmr-local-storage-version');
|
|
62
97
|
}
|
|
98
|
+
// if the local setting version != current settings version number
|
|
63
99
|
if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
|
|
64
100
|
removeData('nmr-general-settings');
|
|
65
101
|
}
|
|
102
|
+
return {
|
|
103
|
+
...state,
|
|
104
|
+
workspaces: localData?.workspaces || { default: Workspaces.default },
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function handleInit(draft, action) {
|
|
66
108
|
if (action.payload) {
|
|
109
|
+
const localData = getLocalStorage('nmr-general-settings');
|
|
67
110
|
const { dispatch, workspace, ...resProps } = action.payload;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
111
|
+
/**
|
|
112
|
+
* set the current workspace what the user-defined in the setting if the workspace is not defined at the level of component, otherwise
|
|
113
|
+
* use the default workspace
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
draft.workspace =
|
|
117
|
+
!workspace && localData?.currentWorkspace
|
|
118
|
+
? { current: localData.currentWorkspace, base: null }
|
|
119
|
+
: { current: workspace || 'default', base: workspace };
|
|
120
|
+
const workspacePreferences = lodashMerge({}, getPreferencesByWorkspace(draft.workspace.current), resProps);
|
|
121
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
122
|
+
/**
|
|
123
|
+
* Update the local storage general preferences
|
|
124
|
+
* 1- if local storage is empty.
|
|
125
|
+
* 2- if predefine workspaces.
|
|
126
|
+
* 3- b) if workspace not exists in the local storage
|
|
127
|
+
* c) if the local setting workspace version != current workspace version number
|
|
128
|
+
* d) if hard code workspace parameters != current workspace parameters
|
|
129
|
+
*/
|
|
130
|
+
if ((Workspaces[draft.workspace.current] &&
|
|
131
|
+
(!currentWorkspacePreferences ||
|
|
132
|
+
workspacePreferences?.version !==
|
|
133
|
+
currentWorkspacePreferences?.version ||
|
|
134
|
+
!checkKeysExists(workspacePreferences.display, currentWorkspacePreferences?.display))) ||
|
|
135
|
+
!localData) {
|
|
136
|
+
const { workspaces, version } = draft || {};
|
|
137
|
+
const display = filterObject(workspacePreferences.display);
|
|
138
|
+
const data = {
|
|
139
|
+
version,
|
|
76
140
|
workspaces: {
|
|
77
|
-
...
|
|
78
|
-
[workspace]: {
|
|
141
|
+
...workspaces,
|
|
142
|
+
[draft.workspace.current]: {
|
|
79
143
|
...workspacePreferences,
|
|
80
|
-
|
|
81
|
-
formatting: draft.formatting,
|
|
144
|
+
display,
|
|
82
145
|
},
|
|
83
146
|
},
|
|
84
147
|
};
|
|
85
|
-
|
|
148
|
+
draft.workspaces[draft.workspace.current] = lodashMerge({}, currentWorkspacePreferences, workspacePreferences);
|
|
149
|
+
storeData('nmr-general-settings', JSON.stringify(data));
|
|
86
150
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
let hiddenLocalStorageFeatures = {};
|
|
90
|
-
draft.dispatch = dispatch;
|
|
91
|
-
const localStorageModePreferences = localData?.workspaces[workspace] || null;
|
|
92
|
-
if (localStorageModePreferences) {
|
|
93
|
-
Object.entries(localStorageModePreferences).forEach(([k, v]) => {
|
|
94
|
-
if (k === 'display') {
|
|
95
|
-
hiddenLocalStorageFeatures = getTruthyObjectValues(v);
|
|
96
|
-
}
|
|
97
|
-
else if (!['dispatch', 'basePreferences'].includes(k)) {
|
|
98
|
-
draft[k] = lodashMerge({}, resProps[k] ? resProps[k] : {}, v);
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
mapNucleus(draft);
|
|
151
|
+
else {
|
|
152
|
+
currentWorkspacePreferences.display = lodashMerge({}, workspacePreferences.display, currentWorkspacePreferences.display);
|
|
102
153
|
}
|
|
103
|
-
draft.
|
|
154
|
+
draft.dispatch = dispatch;
|
|
104
155
|
}
|
|
105
156
|
}
|
|
106
157
|
function handleSetPreferences(draft, action) {
|
|
107
158
|
if (action.payload) {
|
|
159
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
108
160
|
const { controllers, formatting, display } = action.payload;
|
|
109
161
|
let localData = getLocalStorage('nmr-general-settings');
|
|
162
|
+
localData.currentWorkspace = draft.workspace.current;
|
|
110
163
|
localData.workspaces = {
|
|
111
164
|
...localData.workspaces,
|
|
112
|
-
[draft.workspace]: {
|
|
113
|
-
...localData.workspaces[draft.workspace],
|
|
165
|
+
[draft.workspace.current]: {
|
|
166
|
+
...localData.workspaces[draft.workspace.current],
|
|
114
167
|
controllers,
|
|
115
168
|
formatting,
|
|
116
169
|
display,
|
|
117
170
|
},
|
|
118
171
|
};
|
|
119
172
|
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
display.
|
|
173
|
+
currentWorkspacePreferences.controllers = controllers;
|
|
174
|
+
currentWorkspacePreferences.formatting = formatting;
|
|
175
|
+
currentWorkspacePreferences.display = {
|
|
176
|
+
...currentWorkspacePreferences.display,
|
|
177
|
+
panels: display.panels,
|
|
178
|
+
general: {
|
|
179
|
+
...(currentWorkspacePreferences.display.general || {}),
|
|
180
|
+
experimentalFeatures: display.general.experimentalFeatures,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
125
183
|
mapNucleus(draft);
|
|
126
184
|
}
|
|
127
185
|
}
|
|
128
186
|
function handleSetPanelsPreferences(draft, action) {
|
|
129
187
|
if (action.payload) {
|
|
188
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
130
189
|
const { key, value } = action.payload;
|
|
131
190
|
let localData = getLocalStorage('nmr-general-settings');
|
|
132
|
-
localData.workspaces[draft.workspace].formatting.panels[key] =
|
|
191
|
+
localData.workspaces[draft.workspace.current].formatting.panels[key] =
|
|
192
|
+
value;
|
|
133
193
|
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
134
|
-
|
|
194
|
+
currentWorkspacePreferences.formatting.panels[key] = value;
|
|
135
195
|
}
|
|
136
196
|
}
|
|
137
197
|
function handleResetPreferences(draft) {
|
|
198
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
138
199
|
let localData = getLocalStorage('nmr-general-settings');
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
200
|
+
const workSpaceDisplayPreferences = getPreferencesByWorkspace(draft.workspace.current).display;
|
|
201
|
+
if (localData.workspaces[draft.workspace.current]) {
|
|
202
|
+
localData.workspaces[draft.workspace.current].display =
|
|
203
|
+
workSpaceDisplayPreferences;
|
|
204
|
+
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
205
|
+
}
|
|
206
|
+
currentWorkspacePreferences.display = workSpaceDisplayPreferences;
|
|
207
|
+
}
|
|
208
|
+
function handleSetWorkspace(draft, action) {
|
|
209
|
+
const workspaceKey = action.payload.workspace;
|
|
210
|
+
if (!draft.workspaces[workspaceKey]) {
|
|
211
|
+
draft.workspaces[workspaceKey] = getPreferencesByWorkspace(workspaceKey);
|
|
212
|
+
}
|
|
213
|
+
draft.workspace.current = workspaceKey;
|
|
214
|
+
}
|
|
215
|
+
function handleAddWorkspace(draft, action) {
|
|
216
|
+
const { workspace: workspaceName, data: { display, controllers, formatting }, } = action.payload;
|
|
217
|
+
const newWorkSpace = {
|
|
218
|
+
version: 1,
|
|
219
|
+
label: workspaceName,
|
|
220
|
+
display,
|
|
221
|
+
controllers,
|
|
222
|
+
formatting,
|
|
223
|
+
};
|
|
224
|
+
const newWorkspaceKey = generateID();
|
|
225
|
+
const localData = getLocalStorage('nmr-general-settings');
|
|
226
|
+
localData.workspaces[newWorkspaceKey] = newWorkSpace;
|
|
227
|
+
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
228
|
+
draft.workspaces[newWorkspaceKey] = newWorkSpace;
|
|
229
|
+
draft.workspace.current = newWorkspaceKey;
|
|
230
|
+
}
|
|
231
|
+
function handleRemoveWorkspace(draft, action) {
|
|
232
|
+
const { workspace } = action.payload;
|
|
233
|
+
if (workspace === draft.workspace.current) {
|
|
234
|
+
draft.workspace.current = 'default';
|
|
235
|
+
}
|
|
236
|
+
let localData = getLocalStorage('nmr-general-settings');
|
|
237
|
+
const storedWorkspaces = original(draft)?.workspaces || {};
|
|
238
|
+
const workspaces = Object.keys(storedWorkspaces).reduce((acc, key) => {
|
|
239
|
+
if (key !== workspace) {
|
|
240
|
+
acc[key] = storedWorkspaces[key];
|
|
241
|
+
}
|
|
242
|
+
return acc;
|
|
243
|
+
}, {});
|
|
244
|
+
draft.workspaces = workspaces;
|
|
245
|
+
localData.workspaces = filterObject(workspaces);
|
|
143
246
|
storeData('nmr-general-settings', JSON.stringify(localData));
|
|
144
247
|
}
|
|
145
248
|
function innerPreferencesReducer(draft, action) {
|
|
146
249
|
switch (action.type) {
|
|
147
|
-
case INIT_PREFERENCES:
|
|
250
|
+
case 'INIT_PREFERENCES':
|
|
148
251
|
return handleInit(draft, action);
|
|
149
|
-
case SET_PREFERENCES:
|
|
252
|
+
case 'SET_PREFERENCES':
|
|
150
253
|
return handleSetPreferences(draft, action);
|
|
151
|
-
case SET_PANELS_PREFERENCES:
|
|
254
|
+
case 'SET_PANELS_PREFERENCES':
|
|
152
255
|
return handleSetPanelsPreferences(draft, action);
|
|
153
|
-
case RESET_PREFERENCES:
|
|
256
|
+
case 'RESET_PREFERENCES':
|
|
154
257
|
return handleResetPreferences(draft);
|
|
258
|
+
case 'SET_WORKSPACE':
|
|
259
|
+
return handleSetWorkspace(draft, action);
|
|
260
|
+
case 'ADD_WORKSPACE':
|
|
261
|
+
return handleAddWorkspace(draft, action);
|
|
262
|
+
case 'REMOVE_WORKSPACE':
|
|
263
|
+
return handleRemoveWorkspace(draft, action);
|
|
155
264
|
default:
|
|
156
265
|
return draft;
|
|
157
266
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export declare type ActionType<Action, Payload = void> = Payload extends void ? {
|
|
2
|
+
type: Action;
|
|
3
|
+
} : {
|
|
4
|
+
type: Action;
|
|
5
|
+
payload: Payload;
|
|
6
|
+
};
|
|
1
7
|
export declare const INITIATE = "INITIATE";
|
|
2
8
|
export declare const SAVE_DATA_AS_JSON = "SAVE_DATA_AS_JSON";
|
|
3
9
|
export declare const LOAD_JSON_FILE = "LOAD_JSON_FILE";
|
|
@@ -31,5 +31,5 @@ export default function BrushX() {
|
|
|
31
31
|
...styles.container,
|
|
32
32
|
transform: `translate(${startX}px, 0px) scaleX(${scale})`,
|
|
33
33
|
willChange: 'transform',
|
|
34
|
-
}, children: _jsxs("svg", { width: width, height: height, children: [_jsx("line", { x1: "0", y1: "0", x2: "0", y2: height, strokeWidth: "8", stroke: "red" }
|
|
34
|
+
}, children: _jsxs("svg", { width: width, height: height, children: [_jsx("line", { x1: "0", y1: "0", x2: "0", y2: height, strokeWidth: "8", stroke: "red" }), _jsx("line", { x1: width, y1: "0", x2: width, y2: height, strokeWidth: "8", stroke: "red" }), _jsx("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" })] }) }));
|
|
35
35
|
}
|
|
@@ -82,5 +82,5 @@ export default function BrushXY({ brushType = BRUSH_TYPE.XY, dimensionBorder = d
|
|
|
82
82
|
...styles.container,
|
|
83
83
|
transform: `translate(${startX}px, ${startY}px) scale(${scaleX},${scaleY})`,
|
|
84
84
|
willChange: 'transform',
|
|
85
|
-
}, children: _jsx("svg", { width: width, height: height, children: _jsx("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" }
|
|
85
|
+
}, children: _jsx("svg", { width: width, height: height, children: _jsx("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" }) }) }));
|
|
86
86
|
}
|
|
@@ -50,6 +50,6 @@ function CrossLinePointer() {
|
|
|
50
50
|
overflow: 'visible',
|
|
51
51
|
width: 2 * width,
|
|
52
52
|
height: 2 * height,
|
|
53
|
-
}, children: _jsxs("svg", { width: 2 * width, height: 2 * height, children: [_jsx("line", { style: styles.line, x1: width, y1: "0", x2: width, y2: height * 2 }, "vertical_line"), _jsx("line", { style: styles.line, x1: "0", y1: height, x2: width * 2, y2: height }, "horizontal_line")] }
|
|
53
|
+
}, children: _jsxs("svg", { width: 2 * width, height: 2 * height, children: [_jsx("line", { style: styles.line, x1: width, y1: "0", x2: width, y2: height * 2 }, "vertical_line"), _jsx("line", { style: styles.line, x1: "0", y1: height, x2: width * 2, y2: height }, "horizontal_line")] }) }, "crossLine"));
|
|
54
54
|
}
|
|
55
55
|
export default CrossLinePointer;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Toolbar } from 'analysis-ui-components';
|
|
3
3
|
import { SvgNmrRealImag, SvgNmrOverlay3, SvgNmrOverlay3Aligned, SvgNmrAlignBottom, SvgNmrAlignCenter, } from 'cheminfo-font';
|
|
4
|
-
import lodashGet from 'lodash/get';
|
|
5
4
|
import { Fragment, useCallback, memo, useMemo } from 'react';
|
|
6
5
|
import { FaDownload, FaFileDownload, FaFileImage, FaCopy, FaFileExport, FaFile, FaFileImport, } from 'react-icons/fa';
|
|
7
6
|
import { useChartData } from '../context/ChartContext';
|
|
8
7
|
import { useDispatch } from '../context/DispatchContext';
|
|
9
8
|
import { useLoader } from '../context/LoaderContext';
|
|
10
|
-
import { usePreferences } from '../context/PreferencesContext';
|
|
11
9
|
import ToolbarMenu from '../elements/ToolbarMenu';
|
|
12
10
|
import { useAlert } from '../elements/popup/Alert';
|
|
13
11
|
import { useModal } from '../elements/popup/Modal';
|
|
14
12
|
import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
|
|
13
|
+
import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
|
|
15
14
|
import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
|
|
16
15
|
import useExport from '../hooks/useExport';
|
|
17
16
|
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
@@ -22,59 +21,59 @@ import { LOAD_JCAMP_FILE, SET_LOADING_FLAG } from '../reducer/types/Types';
|
|
|
22
21
|
const IMPORT_MENU = [
|
|
23
22
|
{
|
|
24
23
|
id: 'importFile',
|
|
25
|
-
icon: _jsx(FaFile, {}
|
|
24
|
+
icon: _jsx(FaFile, {}),
|
|
26
25
|
label: 'Import from file system (Press Ctrl + O)',
|
|
27
26
|
},
|
|
28
27
|
{
|
|
29
28
|
id: 'importJDX',
|
|
30
|
-
icon: _jsx(FaFile, {}
|
|
29
|
+
icon: _jsx(FaFile, {}),
|
|
31
30
|
label: 'Add JCAMP-DX from URL',
|
|
32
31
|
},
|
|
33
32
|
{
|
|
34
33
|
id: 'importPublicationString',
|
|
35
|
-
icon: _jsx(FaFile, {}
|
|
34
|
+
icon: _jsx(FaFile, {}),
|
|
36
35
|
label: 'Import from publication string',
|
|
37
36
|
},
|
|
38
37
|
];
|
|
39
38
|
const EXPORT_MENU = [
|
|
40
39
|
{
|
|
41
40
|
id: 'svg',
|
|
42
|
-
icon: _jsx(FaDownload, {}
|
|
41
|
+
icon: _jsx(FaDownload, {}),
|
|
43
42
|
label: 'Export as SVG',
|
|
44
43
|
},
|
|
45
44
|
{
|
|
46
45
|
id: 'png',
|
|
47
|
-
icon: _jsx(FaFileImage, {}
|
|
46
|
+
icon: _jsx(FaFileImage, {}),
|
|
48
47
|
label: 'Export as PNG',
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
50
|
id: 'json',
|
|
52
|
-
icon: _jsx(FaFileDownload, {}
|
|
51
|
+
icon: _jsx(FaFileDownload, {}),
|
|
53
52
|
label: 'Save data ( Press Ctrl + S )',
|
|
54
53
|
},
|
|
55
54
|
{
|
|
56
55
|
id: 'advance_save',
|
|
57
|
-
icon: _jsx(FaFileDownload, {}
|
|
56
|
+
icon: _jsx(FaFileDownload, {}),
|
|
58
57
|
label: 'Save data as ( Press Ctrl + Shift + S )',
|
|
59
58
|
},
|
|
60
59
|
{
|
|
61
60
|
id: 'nmre',
|
|
62
|
-
icon: _jsx(FaFileDownload, {}
|
|
61
|
+
icon: _jsx(FaFileDownload, {}),
|
|
63
62
|
label: 'Save NMRE data',
|
|
64
63
|
},
|
|
65
64
|
{
|
|
66
65
|
id: 'copy',
|
|
67
|
-
icon: _jsx(FaCopy, {}
|
|
66
|
+
icon: _jsx(FaCopy, {}),
|
|
68
67
|
label: 'Copy image to Clipboard ( Press Ctrl + C )',
|
|
69
68
|
},
|
|
70
69
|
];
|
|
71
70
|
function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidCounter, activeSpectrum, }) {
|
|
72
71
|
const dispatch = useDispatch();
|
|
73
|
-
const preferences = usePreferences();
|
|
74
72
|
const alert = useAlert();
|
|
75
73
|
const modal = useModal();
|
|
76
74
|
const openLoader = useLoader();
|
|
77
75
|
const isExperimentalFeature = useCheckExperimentalFeature();
|
|
76
|
+
const isButtonVisible = useCheckToolsVisibility();
|
|
78
77
|
const importMenu = useMemo(() => {
|
|
79
78
|
return isExperimentalFeature
|
|
80
79
|
? IMPORT_MENU
|
|
@@ -96,14 +95,11 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
|
|
|
96
95
|
dispatch({ type: SET_LOADING_FLAG, isLoading: true });
|
|
97
96
|
}, [dispatch, modal]);
|
|
98
97
|
const importJCAMPFile = useCallback(() => {
|
|
99
|
-
modal.show(_jsx(LoadJCAMPModal, { onLoadClick: LoadJacmpHandler, onClose: () => modal.close(), startLoading: startLoadingHandler }
|
|
98
|
+
modal.show(_jsx(LoadJCAMPModal, { onLoadClick: LoadJacmpHandler, onClose: () => modal.close(), startLoading: startLoadingHandler }), {});
|
|
100
99
|
}, [LoadJacmpHandler, modal, startLoadingHandler]);
|
|
101
100
|
const openImportPublicationStringModal = useCallback(() => {
|
|
102
|
-
modal.show(_jsx(ImportPublicationStringModal, { onClose: () => modal.close() }
|
|
101
|
+
modal.show(_jsx(ImportPublicationStringModal, { onClose: () => modal.close() }), {});
|
|
103
102
|
}, [modal]);
|
|
104
|
-
const isButtonVisible = useCallback((key) => {
|
|
105
|
-
return !lodashGet(preferences, `display.toolBarButtons.${key}`);
|
|
106
|
-
}, [preferences]);
|
|
107
103
|
const importHandler = useCallback(({ id }) => {
|
|
108
104
|
switch (id) {
|
|
109
105
|
case 'importFile':
|
|
@@ -150,22 +146,22 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
|
|
|
150
146
|
saveAsNMREHandler,
|
|
151
147
|
saveToClipboardHandler,
|
|
152
148
|
]);
|
|
153
|
-
return (_jsxs(Fragment, { children: [isButtonVisible('
|
|
149
|
+
return (_jsxs(Fragment, { children: [isButtonVisible('import') && (_jsx(ToolbarMenu, { component: _jsx(FaFileImport, {}), toolTip: "Import", onClick: (element) => {
|
|
154
150
|
importHandler(element);
|
|
155
151
|
return null;
|
|
156
|
-
}, items: importMenu }
|
|
152
|
+
}, items: importMenu })), isButtonVisible('exportAs') && (_jsx(ToolbarMenu, { component: _jsx(FaFileExport, {}), toolTip: "Export As", onClick: (element) => {
|
|
157
153
|
exportHandler(element);
|
|
158
154
|
return null;
|
|
159
|
-
}, items: EXPORT_MENU }
|
|
160
|
-
isButtonVisible('
|
|
155
|
+
}, items: EXPORT_MENU })), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
156
|
+
isButtonVisible('spectraStackAlignments') &&
|
|
161
157
|
ftCounter > 1 &&
|
|
162
|
-
(info?.isFt || !activeSpectrum) && (_jsx(Toolbar.Item, { id: "spectra-alignment", className: "cheminfo", title: "Spectra alignment ( Press s )", onClick: changeDisplayViewModeHandler, children: verticalAlign.align === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {}
|
|
163
|
-
isButtonVisible('
|
|
164
|
-
info.isComplex && (_jsx(Toolbar.Item, { id: "display", title: isRealSpectrumShown ? 'Display Real ' : 'Display Imaginary', onClick: changeSpectrumViewHandler, className: "cheminfo", children: _jsx(SvgNmrRealImag, {}
|
|
165
|
-
isButtonVisible('
|
|
158
|
+
(info?.isFt || !activeSpectrum) && (_jsx(Toolbar.Item, { id: "spectra-alignment", className: "cheminfo", title: "Spectra alignment ( Press s )", onClick: changeDisplayViewModeHandler, children: verticalAlign.align === 'stack' ? (_jsx(SvgNmrOverlay3Aligned, {})) : (_jsx(SvgNmrOverlay3, {})) })), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
159
|
+
isButtonVisible('realImaginary') &&
|
|
160
|
+
info.isComplex && (_jsx(Toolbar.Item, { id: "display", title: isRealSpectrumShown ? 'Display Real ' : 'Display Imaginary', onClick: changeSpectrumViewHandler, className: "cheminfo", children: _jsx(SvgNmrRealImag, {}) })), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
161
|
+
isButtonVisible('spectraCenterAlignments') &&
|
|
166
162
|
(ftCounter > 0 || fidCounter > 0) && (_jsx(Toolbar.Item, { id: "baseline-position", title: verticalAlign.align === 'bottom'
|
|
167
163
|
? 'Baseline Center ( Press c )'
|
|
168
|
-
: 'Baseline Bottom ( Press c )', onClick: alignSpectrumsVerticallyHandler, className: "cheminfo", children: _jsx("div", { style: { fontSize: 24 }, children: verticalAlign.align === 'bottom' ? (_jsx(SvgNmrAlignCenter, {}
|
|
164
|
+
: 'Baseline Bottom ( Press c )', onClick: alignSpectrumsVerticallyHandler, className: "cheminfo", children: _jsx("div", { style: { fontSize: 24 }, children: verticalAlign.align === 'bottom' ? (_jsx(SvgNmrAlignCenter, {})) : (_jsx(SvgNmrAlignBottom, {})) }) }))] }));
|
|
169
165
|
}
|
|
170
166
|
const MemoizedBasicToolBar = memo(BasicToolBarInner);
|
|
171
167
|
export default function BasicToolBar() {
|
|
@@ -179,5 +175,5 @@ export default function BasicToolBar() {
|
|
|
179
175
|
verticalAlign,
|
|
180
176
|
displayerMode,
|
|
181
177
|
activeTab,
|
|
182
|
-
} }
|
|
178
|
+
} }));
|
|
183
179
|
}
|
|
@@ -33,33 +33,32 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
|
|
|
33
33
|
});
|
|
34
34
|
dispatch({ type: SET_SELECTED_FILTER, selectedFilter: null });
|
|
35
35
|
}, [dispatch]);
|
|
36
|
-
return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('
|
|
37
|
-
isButtonVisible('
|
|
38
|
-
isButtonVisible('
|
|
39
|
-
isButtonVisible('
|
|
40
|
-
isButtonVisible('
|
|
41
|
-
isButtonVisible('
|
|
42
|
-
isButtonVisible('hideMultipleSpectraAnalysisTool') &&
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('zoomTool') && (_jsx(ToggleButton, { value: options.zoom.id, id: "zoomIn", title: `${options.zoom.label} ( Press z )`, children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaSearchPlus, {}) }) }, options.zoom.id)), isButtonVisible('zoomOutTool') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaExpand, {}) }) })), displayerMode === DISPLAYER_MODE.DM_1D && isButtonVisible('peakTool') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: _jsx(SvgNmrPeakPicking, {}) }, options.peakPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
37
|
+
isButtonVisible('integralTool') && (_jsx(ToggleButton, { value: options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${options.integral.label} ( Press i )`, children: _jsx(SvgNmrIntegrate, {}) }, options.integral.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
|
|
38
|
+
isButtonVisible('zonePickingTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.zone2D.label} ( Press r )`, children: _jsx(FaDiceFour, {}) }, options.zone2D.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
|
|
39
|
+
isButtonVisible('slicingTool') && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${options.slicingTool.label}`, children: _jsx("p", { children: "Slic" }) }, options.slicingTool.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
40
|
+
isButtonVisible('autoRangesTool') && (_jsx(ToggleButton, { value: options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: _jsx(SvgNmrRangePicking, {}) }, options.rangesPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
41
|
+
isButtonVisible('multipleSpectraAnalysisTool') &&
|
|
43
42
|
ftCounter > 1 &&
|
|
44
|
-
mode === 'RTL' && (_jsx(ToggleButton, { value: options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: options.multipleSpectraAnalysis.label, children: _jsx(SvgNmrMultipleAnalysis, {}
|
|
45
|
-
isButtonVisible('
|
|
46
|
-
isButtonVisible('
|
|
43
|
+
mode === 'RTL' && (_jsx(ToggleButton, { value: options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: options.multipleSpectraAnalysis.label, children: _jsx(SvgNmrMultipleAnalysis, {}) }, options.multipleSpectraAnalysis.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
44
|
+
isButtonVisible('zeroFillingTool') && (_jsx(ToggleButton, { value: options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: options.zeroFilling.label, children: _jsx(SvgNmrZeroFilling, {}) }, options.zeroFilling.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
45
|
+
isButtonVisible('phaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: `${options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
|
|
47
46
|
info &&
|
|
48
47
|
Filters.phaseCorrection.isApplicable({ info }) &&
|
|
49
48
|
datum.im
|
|
50
49
|
? true
|
|
51
|
-
: false, children: _jsx(SvgNmrPhaseCorrection, {}
|
|
52
|
-
isButtonVisible('
|
|
50
|
+
: false, children: _jsx(SvgNmrPhaseCorrection, {}) }, options.phaseCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
51
|
+
isButtonVisible('baseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: `${options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
|
|
53
52
|
info &&
|
|
54
53
|
Filters.baselineCorrection.isApplicable({ info })
|
|
55
54
|
? true
|
|
56
|
-
: false, children: _jsx(SvgNmrBaselineCorrection, {}
|
|
57
|
-
isButtonVisible('
|
|
55
|
+
: false, children: _jsx(SvgNmrBaselineCorrection, {}) }, options.baseLineCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
56
|
+
isButtonVisible('exclusionZonesTool') &&
|
|
58
57
|
!info?.isFid &&
|
|
59
|
-
ftCounter > 0 && (_jsx(ToggleButton, { value: options.exclusionZones.id, title: `${options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: _jsx("div", { style: { fontSize: 18 }, children: _jsx(SvgNmrMultipleAnalysis, {}
|
|
60
|
-
isButtonVisible('
|
|
58
|
+
ftCounter > 0 && (_jsx(ToggleButton, { value: options.exclusionZones.id, title: `${options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: _jsx("div", { style: { fontSize: 18 }, children: _jsx(SvgNmrMultipleAnalysis, {}) }) }, options.exclusionZones.id))] }), displayerMode === DISPLAYER_MODE.DM_1D &&
|
|
59
|
+
isButtonVisible('FFTTool') &&
|
|
61
60
|
info &&
|
|
62
|
-
Filters.fft.isApplicable({ info }) && (_jsx(Toolbar.Item, { id: "fft-filter", className: "cheminfo", title: "FFT Filter", onClick: handleOnFFTFilter, children: _jsx(SvgNmrFourierTransform, {}
|
|
61
|
+
Filters.fft.isApplicable({ info }) && (_jsx(Toolbar.Item, { id: "fft-filter", className: "cheminfo", title: "FFT Filter", onClick: handleOnFFTFilter, children: _jsx(SvgNmrFourierTransform, {}) }))] }));
|
|
63
62
|
}
|
|
64
63
|
const MemoizedFunctionToolBar = memo(FunctionToolBarInner);
|
|
65
64
|
export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
|
|
@@ -72,5 +71,5 @@ export default function FunctionToolBar({ defaultValue = options.zoom.id, }) {
|
|
|
72
71
|
activeTab,
|
|
73
72
|
defaultValue,
|
|
74
73
|
mode,
|
|
75
|
-
} }
|
|
74
|
+
} }));
|
|
76
75
|
}
|
|
@@ -25,6 +25,6 @@ function HistoryToolBar({ isUndoButtonVisible = true, isRedoButtonVisible = true
|
|
|
25
25
|
const { history } = useChartData();
|
|
26
26
|
const dispatch = useDispatch();
|
|
27
27
|
const handle = useCallback((type) => dispatch({ type }), [dispatch]);
|
|
28
|
-
return (_jsxs(Fragment, { children: [isUndoButtonVisible && (_jsx("button", { style: styles.button, type: "button", onClick: () => handle(REDO), disabled: !history.hasRedo, children: _jsx(ToolTip, { title: "Redo", popupPlacement: "right", children: _jsx(FaRedo, {}
|
|
28
|
+
return (_jsxs(Fragment, { children: [isUndoButtonVisible && (_jsx("button", { style: styles.button, type: "button", onClick: () => handle(REDO), disabled: !history.hasRedo, children: _jsx(ToolTip, { title: "Redo", popupPlacement: "right", children: _jsx(FaRedo, {}) }) })), isRedoButtonVisible && (_jsx("button", { type: "button", style: styles.button, onClick: () => handle(UNDO), disabled: !history.hasUndo, children: _jsx(ToolTip, { title: "Undo", popupPlacement: "right", children: _jsx(FaUndo, {}) }) }))] }));
|
|
29
29
|
}
|
|
30
30
|
export default memo(HistoryToolBar);
|
|
@@ -5,10 +5,10 @@ import { useChartData } from '../context/ChartContext';
|
|
|
5
5
|
import BasicToolBar from './BasicToolBar';
|
|
6
6
|
import FunctionToolBar from './FunctionToolBar';
|
|
7
7
|
function ToolBarInner({ selectedTool }) {
|
|
8
|
-
return (_jsx("div", { style: { fontSize: 18 }, children: _jsxs(Toolbar, { orientation: "vertical", children: [_jsx(FunctionToolBar, { defaultValue: selectedTool }
|
|
8
|
+
return (_jsx("div", { style: { fontSize: 18 }, children: _jsxs(Toolbar, { orientation: "vertical", children: [_jsx(FunctionToolBar, { defaultValue: selectedTool }), _jsx(BasicToolBar, {})] }) }));
|
|
9
9
|
}
|
|
10
10
|
const MemoizedToolBar = memo(ToolBarInner);
|
|
11
11
|
export default function ToolBar() {
|
|
12
12
|
const { toolOptions: { selectedTool }, } = useChartData();
|
|
13
|
-
return _jsx(MemoizedToolBar, { ...{ selectedTool } }
|
|
13
|
+
return _jsx(MemoizedToolBar, { ...{ selectedTool } });
|
|
14
14
|
}
|
|
@@ -7,7 +7,7 @@ function FormatNumber(value, format, prefix = '', suffix = '') {
|
|
|
7
7
|
}
|
|
8
8
|
export function useFormatNumberByNucleus(nucleus) {
|
|
9
9
|
const preferences = usePreferences();
|
|
10
|
-
const nucleusByKey = lodashGet(preferences, `formatting.nucleusByKey`, {
|
|
10
|
+
const nucleusByKey = lodashGet(preferences.current, `formatting.nucleusByKey`, {
|
|
11
11
|
ppm: '0.0',
|
|
12
12
|
hz: '0.0',
|
|
13
13
|
});
|