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
|
@@ -3,161 +3,271 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.initPreferencesState = exports.preferencesInitialState = exports.WORKSPACES = void 0;
|
|
7
7
|
const immer_1 = require("immer");
|
|
8
8
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
9
|
+
const generateID_1 = __importDefault(require("../../data/utilities/generateID"));
|
|
9
10
|
const LocalStorage_1 = require("../utility/LocalStorage");
|
|
10
11
|
const workspaces_1 = __importDefault(require("../workspaces"));
|
|
11
|
-
|
|
12
|
-
exports.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const LOCAL_STORAGE_VERSION = 5;
|
|
13
|
+
exports.WORKSPACES = [
|
|
14
|
+
{
|
|
15
|
+
key: 'default',
|
|
16
|
+
label: workspaces_1.default.default.label,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: 'process1D',
|
|
20
|
+
label: workspaces_1.default.process1D.label,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'exercise',
|
|
24
|
+
label: workspaces_1.default.exercise.label,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'prediction',
|
|
28
|
+
label: workspaces_1.default.prediction.label,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
16
31
|
function getPreferencesByWorkspace(workspace) {
|
|
17
32
|
switch (workspace) {
|
|
18
|
-
case '
|
|
19
|
-
return workspaces_1.default.
|
|
33
|
+
case 'exercise':
|
|
34
|
+
return workspaces_1.default.exercise;
|
|
20
35
|
case 'process1D':
|
|
21
36
|
return workspaces_1.default.process1D;
|
|
37
|
+
case 'prediction':
|
|
38
|
+
return workspaces_1.default.prediction;
|
|
39
|
+
case 'default':
|
|
40
|
+
return workspaces_1.default.default;
|
|
22
41
|
default:
|
|
23
|
-
return
|
|
42
|
+
return {};
|
|
24
43
|
}
|
|
25
44
|
}
|
|
45
|
+
function getActiveWorkspace(draft) {
|
|
46
|
+
return draft.workspaces[draft.workspace.current || 'default'];
|
|
47
|
+
}
|
|
26
48
|
exports.preferencesInitialState = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
nucleus: [
|
|
34
|
-
{ key: '1H', name: '1H', ppm: '0.00', hz: '0.00' },
|
|
35
|
-
{ key: '13C', name: '13C', ppm: '0.00', hz: '0.00' },
|
|
36
|
-
{ key: '15N', name: '15N', ppm: '0.00', hz: '0.00' },
|
|
37
|
-
{ key: '19F', name: '19F', ppm: '0.00', hz: '0.00' },
|
|
38
|
-
{ key: '29Si', name: '29Si', ppm: '0.00', hz: '0.00' },
|
|
39
|
-
{ key: '31P', name: '31P', ppm: '0.00', hz: '0.00' },
|
|
40
|
-
],
|
|
41
|
-
nucleusByKey: {},
|
|
42
|
-
panels: {},
|
|
49
|
+
version: LOCAL_STORAGE_VERSION,
|
|
50
|
+
workspaces: {},
|
|
51
|
+
dispatch: () => null,
|
|
52
|
+
workspace: {
|
|
53
|
+
current: 'default',
|
|
54
|
+
base: null,
|
|
43
55
|
},
|
|
44
|
-
dispatch: null,
|
|
45
|
-
workspace: 'default',
|
|
46
56
|
};
|
|
47
|
-
function
|
|
57
|
+
function filterObject(data) {
|
|
48
58
|
return JSON.parse(JSON.stringify(data), (key, value) => {
|
|
49
|
-
if (value) {
|
|
59
|
+
if (value?.hidden !== true) {
|
|
50
60
|
return value;
|
|
51
61
|
}
|
|
52
62
|
});
|
|
53
63
|
}
|
|
64
|
+
function FlatObject(data) {
|
|
65
|
+
let result = {};
|
|
66
|
+
JSON.parse(JSON.stringify(data), (key, value) => {
|
|
67
|
+
if (value?.hidden !== true && key) {
|
|
68
|
+
result[key] = result[key]++ || 1;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
function checkKeysExists(sourceObject, targetObject) {
|
|
74
|
+
const source = FlatObject(sourceObject);
|
|
75
|
+
const target = FlatObject(targetObject);
|
|
76
|
+
if (Object.keys(target).length === 0) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
for (const [key, value] of Object.entries(source)) {
|
|
80
|
+
if (!target[key] || target[key] !== value) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
54
86
|
function mapNucleus(draft) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
87
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
88
|
+
if (currentWorkspacePreferences.formatting.nucleus &&
|
|
89
|
+
Array.isArray(currentWorkspacePreferences.formatting.nucleus)) {
|
|
90
|
+
currentWorkspacePreferences.formatting.nucleusByKey =
|
|
91
|
+
currentWorkspacePreferences.formatting.nucleus.reduce((acc, item) => {
|
|
92
|
+
acc[item.name.toLowerCase()] = item;
|
|
93
|
+
return { ...acc };
|
|
94
|
+
}, {});
|
|
60
95
|
}
|
|
61
96
|
}
|
|
62
|
-
function
|
|
97
|
+
function initPreferencesState(state) {
|
|
63
98
|
const nmrLocalStorageVersion = (0, LocalStorage_1.getLocalStorage)('nmr-local-storage-version', false);
|
|
64
99
|
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
65
100
|
// remove old nmr-local-storage-version key
|
|
66
101
|
if (nmrLocalStorageVersion && localData?.version) {
|
|
67
102
|
(0, LocalStorage_1.removeData)('nmr-local-storage-version');
|
|
68
103
|
}
|
|
104
|
+
// if the local setting version != current settings version number
|
|
69
105
|
if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
|
|
70
106
|
(0, LocalStorage_1.removeData)('nmr-general-settings');
|
|
71
107
|
}
|
|
108
|
+
return {
|
|
109
|
+
...state,
|
|
110
|
+
workspaces: localData?.workspaces || { default: workspaces_1.default.default },
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
exports.initPreferencesState = initPreferencesState;
|
|
114
|
+
function handleInit(draft, action) {
|
|
72
115
|
if (action.payload) {
|
|
116
|
+
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
73
117
|
const { dispatch, workspace, ...resProps } = action.payload;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
118
|
+
/**
|
|
119
|
+
* set the current workspace what the user-defined in the setting if the workspace is not defined at the level of component, otherwise
|
|
120
|
+
* use the default workspace
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
draft.workspace =
|
|
124
|
+
!workspace && localData?.currentWorkspace
|
|
125
|
+
? { current: localData.currentWorkspace, base: null }
|
|
126
|
+
: { current: workspace || 'default', base: workspace };
|
|
127
|
+
const workspacePreferences = (0, merge_1.default)({}, getPreferencesByWorkspace(draft.workspace.current), resProps);
|
|
128
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
129
|
+
/**
|
|
130
|
+
* Update the local storage general preferences
|
|
131
|
+
* 1- if local storage is empty.
|
|
132
|
+
* 2- if predefine workspaces.
|
|
133
|
+
* 3- b) if workspace not exists in the local storage
|
|
134
|
+
* c) if the local setting workspace version != current workspace version number
|
|
135
|
+
* d) if hard code workspace parameters != current workspace parameters
|
|
136
|
+
*/
|
|
137
|
+
if ((workspaces_1.default[draft.workspace.current] &&
|
|
138
|
+
(!currentWorkspacePreferences ||
|
|
139
|
+
workspacePreferences?.version !==
|
|
140
|
+
currentWorkspacePreferences?.version ||
|
|
141
|
+
!checkKeysExists(workspacePreferences.display, currentWorkspacePreferences?.display))) ||
|
|
142
|
+
!localData) {
|
|
143
|
+
const { workspaces, version } = draft || {};
|
|
144
|
+
const display = filterObject(workspacePreferences.display);
|
|
145
|
+
const data = {
|
|
146
|
+
version,
|
|
82
147
|
workspaces: {
|
|
83
|
-
...
|
|
84
|
-
[workspace]: {
|
|
148
|
+
...workspaces,
|
|
149
|
+
[draft.workspace.current]: {
|
|
85
150
|
...workspacePreferences,
|
|
86
|
-
|
|
87
|
-
formatting: draft.formatting,
|
|
151
|
+
display,
|
|
88
152
|
},
|
|
89
153
|
},
|
|
90
154
|
};
|
|
91
|
-
(0,
|
|
155
|
+
draft.workspaces[draft.workspace.current] = (0, merge_1.default)({}, currentWorkspacePreferences, workspacePreferences);
|
|
156
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(data));
|
|
92
157
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
let hiddenLocalStorageFeatures = {};
|
|
96
|
-
draft.dispatch = dispatch;
|
|
97
|
-
const localStorageModePreferences = localData?.workspaces[workspace] || null;
|
|
98
|
-
if (localStorageModePreferences) {
|
|
99
|
-
Object.entries(localStorageModePreferences).forEach(([k, v]) => {
|
|
100
|
-
if (k === 'display') {
|
|
101
|
-
hiddenLocalStorageFeatures = getTruthyObjectValues(v);
|
|
102
|
-
}
|
|
103
|
-
else if (!['dispatch', 'basePreferences'].includes(k)) {
|
|
104
|
-
draft[k] = (0, merge_1.default)({}, resProps[k] ? resProps[k] : {}, v);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
mapNucleus(draft);
|
|
158
|
+
else {
|
|
159
|
+
currentWorkspacePreferences.display = (0, merge_1.default)({}, workspacePreferences.display, currentWorkspacePreferences.display);
|
|
108
160
|
}
|
|
109
|
-
draft.
|
|
161
|
+
draft.dispatch = dispatch;
|
|
110
162
|
}
|
|
111
163
|
}
|
|
112
164
|
function handleSetPreferences(draft, action) {
|
|
113
165
|
if (action.payload) {
|
|
166
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
114
167
|
const { controllers, formatting, display } = action.payload;
|
|
115
168
|
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
169
|
+
localData.currentWorkspace = draft.workspace.current;
|
|
116
170
|
localData.workspaces = {
|
|
117
171
|
...localData.workspaces,
|
|
118
|
-
[draft.workspace]: {
|
|
119
|
-
...localData.workspaces[draft.workspace],
|
|
172
|
+
[draft.workspace.current]: {
|
|
173
|
+
...localData.workspaces[draft.workspace.current],
|
|
120
174
|
controllers,
|
|
121
175
|
formatting,
|
|
122
176
|
display,
|
|
123
177
|
},
|
|
124
178
|
};
|
|
125
179
|
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
display.
|
|
180
|
+
currentWorkspacePreferences.controllers = controllers;
|
|
181
|
+
currentWorkspacePreferences.formatting = formatting;
|
|
182
|
+
currentWorkspacePreferences.display = {
|
|
183
|
+
...currentWorkspacePreferences.display,
|
|
184
|
+
panels: display.panels,
|
|
185
|
+
general: {
|
|
186
|
+
...(currentWorkspacePreferences.display.general || {}),
|
|
187
|
+
experimentalFeatures: display.general.experimentalFeatures,
|
|
188
|
+
},
|
|
189
|
+
};
|
|
131
190
|
mapNucleus(draft);
|
|
132
191
|
}
|
|
133
192
|
}
|
|
134
193
|
function handleSetPanelsPreferences(draft, action) {
|
|
135
194
|
if (action.payload) {
|
|
195
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
136
196
|
const { key, value } = action.payload;
|
|
137
197
|
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
138
|
-
localData.workspaces[draft.workspace].formatting.panels[key] =
|
|
198
|
+
localData.workspaces[draft.workspace.current].formatting.panels[key] =
|
|
199
|
+
value;
|
|
139
200
|
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
140
|
-
|
|
201
|
+
currentWorkspacePreferences.formatting.panels[key] = value;
|
|
141
202
|
}
|
|
142
203
|
}
|
|
143
204
|
function handleResetPreferences(draft) {
|
|
205
|
+
const currentWorkspacePreferences = getActiveWorkspace(draft);
|
|
144
206
|
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
207
|
+
const workSpaceDisplayPreferences = getPreferencesByWorkspace(draft.workspace.current).display;
|
|
208
|
+
if (localData.workspaces[draft.workspace.current]) {
|
|
209
|
+
localData.workspaces[draft.workspace.current].display =
|
|
210
|
+
workSpaceDisplayPreferences;
|
|
211
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
212
|
+
}
|
|
213
|
+
currentWorkspacePreferences.display = workSpaceDisplayPreferences;
|
|
214
|
+
}
|
|
215
|
+
function handleSetWorkspace(draft, action) {
|
|
216
|
+
const workspaceKey = action.payload.workspace;
|
|
217
|
+
if (!draft.workspaces[workspaceKey]) {
|
|
218
|
+
draft.workspaces[workspaceKey] = getPreferencesByWorkspace(workspaceKey);
|
|
219
|
+
}
|
|
220
|
+
draft.workspace.current = workspaceKey;
|
|
221
|
+
}
|
|
222
|
+
function handleAddWorkspace(draft, action) {
|
|
223
|
+
const { workspace: workspaceName, data: { display, controllers, formatting }, } = action.payload;
|
|
224
|
+
const newWorkSpace = {
|
|
225
|
+
version: 1,
|
|
226
|
+
label: workspaceName,
|
|
227
|
+
display,
|
|
228
|
+
controllers,
|
|
229
|
+
formatting,
|
|
230
|
+
};
|
|
231
|
+
const newWorkspaceKey = (0, generateID_1.default)();
|
|
232
|
+
const localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
233
|
+
localData.workspaces[newWorkspaceKey] = newWorkSpace;
|
|
234
|
+
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
235
|
+
draft.workspaces[newWorkspaceKey] = newWorkSpace;
|
|
236
|
+
draft.workspace.current = newWorkspaceKey;
|
|
237
|
+
}
|
|
238
|
+
function handleRemoveWorkspace(draft, action) {
|
|
239
|
+
const { workspace } = action.payload;
|
|
240
|
+
if (workspace === draft.workspace.current) {
|
|
241
|
+
draft.workspace.current = 'default';
|
|
242
|
+
}
|
|
243
|
+
let localData = (0, LocalStorage_1.getLocalStorage)('nmr-general-settings');
|
|
244
|
+
const storedWorkspaces = (0, immer_1.original)(draft)?.workspaces || {};
|
|
245
|
+
const workspaces = Object.keys(storedWorkspaces).reduce((acc, key) => {
|
|
246
|
+
if (key !== workspace) {
|
|
247
|
+
acc[key] = storedWorkspaces[key];
|
|
248
|
+
}
|
|
249
|
+
return acc;
|
|
250
|
+
}, {});
|
|
251
|
+
draft.workspaces = workspaces;
|
|
252
|
+
localData.workspaces = filterObject(workspaces);
|
|
149
253
|
(0, LocalStorage_1.storeData)('nmr-general-settings', JSON.stringify(localData));
|
|
150
254
|
}
|
|
151
255
|
function innerPreferencesReducer(draft, action) {
|
|
152
256
|
switch (action.type) {
|
|
153
|
-
case
|
|
257
|
+
case 'INIT_PREFERENCES':
|
|
154
258
|
return handleInit(draft, action);
|
|
155
|
-
case
|
|
259
|
+
case 'SET_PREFERENCES':
|
|
156
260
|
return handleSetPreferences(draft, action);
|
|
157
|
-
case
|
|
261
|
+
case 'SET_PANELS_PREFERENCES':
|
|
158
262
|
return handleSetPanelsPreferences(draft, action);
|
|
159
|
-
case
|
|
263
|
+
case 'RESET_PREFERENCES':
|
|
160
264
|
return handleResetPreferences(draft);
|
|
265
|
+
case 'SET_WORKSPACE':
|
|
266
|
+
return handleSetWorkspace(draft, action);
|
|
267
|
+
case 'ADD_WORKSPACE':
|
|
268
|
+
return handleAddWorkspace(draft, action);
|
|
269
|
+
case 'REMOVE_WORKSPACE':
|
|
270
|
+
return handleRemoveWorkspace(draft, action);
|
|
161
271
|
default:
|
|
162
272
|
return draft;
|
|
163
273
|
}
|
|
@@ -33,6 +33,6 @@ function BrushX() {
|
|
|
33
33
|
...styles.container,
|
|
34
34
|
transform: `translate(${startX}px, 0px) scaleX(${scale})`,
|
|
35
35
|
willChange: 'transform',
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsxs)("svg", { width: width, height: height, children: [(0, jsx_runtime_1.jsx)("line", { x1: "0", y1: "0", x2: "0", y2: height, strokeWidth: "8", stroke: "red" }
|
|
36
|
+
}, children: (0, jsx_runtime_1.jsxs)("svg", { width: width, height: height, children: [(0, jsx_runtime_1.jsx)("line", { x1: "0", y1: "0", x2: "0", y2: height, strokeWidth: "8", stroke: "red" }), (0, jsx_runtime_1.jsx)("line", { x1: width, y1: "0", x2: width, y2: height, strokeWidth: "8", stroke: "red" }), (0, jsx_runtime_1.jsx)("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" })] }) }));
|
|
37
37
|
}
|
|
38
38
|
exports.default = BrushX;
|
|
@@ -85,6 +85,6 @@ function BrushXY({ brushType = exports.BRUSH_TYPE.XY, dimensionBorder = defaultD
|
|
|
85
85
|
...styles.container,
|
|
86
86
|
transform: `translate(${startX}px, ${startY}px) scale(${scaleX},${scaleY})`,
|
|
87
87
|
willChange: 'transform',
|
|
88
|
-
}, children: (0, jsx_runtime_1.jsx)("svg", { width: width, height: height, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" }
|
|
88
|
+
}, children: (0, jsx_runtime_1.jsx)("svg", { width: width, height: height, children: (0, jsx_runtime_1.jsx)("rect", { x: "0", y: "0", width: width, height: height, fill: "gray", opacity: "0.2" }) }) }));
|
|
89
89
|
}
|
|
90
90
|
exports.default = BrushXY;
|
|
@@ -52,6 +52,6 @@ function CrossLinePointer() {
|
|
|
52
52
|
overflow: 'visible',
|
|
53
53
|
width: 2 * width,
|
|
54
54
|
height: 2 * height,
|
|
55
|
-
}, children: (0, jsx_runtime_1.jsxs)("svg", { width: 2 * width, height: 2 * height, children: [(0, jsx_runtime_1.jsx)("line", { style: styles.line, x1: width, y1: "0", x2: width, y2: height * 2 }, "vertical_line"), (0, jsx_runtime_1.jsx)("line", { style: styles.line, x1: "0", y1: height, x2: width * 2, y2: height }, "horizontal_line")] }
|
|
55
|
+
}, children: (0, jsx_runtime_1.jsxs)("svg", { width: 2 * width, height: 2 * height, children: [(0, jsx_runtime_1.jsx)("line", { style: styles.line, x1: width, y1: "0", x2: width, y2: height * 2 }, "vertical_line"), (0, jsx_runtime_1.jsx)("line", { style: styles.line, x1: "0", y1: height, x2: width * 2, y2: height }, "horizontal_line")] }) }, "crossLine"));
|
|
56
56
|
}
|
|
57
57
|
exports.default = CrossLinePointer;
|
|
@@ -6,17 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const analysis_ui_components_1 = require("analysis-ui-components");
|
|
8
8
|
const cheminfo_font_1 = require("cheminfo-font");
|
|
9
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
10
9
|
const react_1 = require("react");
|
|
11
10
|
const fa_1 = require("react-icons/fa");
|
|
12
11
|
const ChartContext_1 = require("../context/ChartContext");
|
|
13
12
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
14
13
|
const LoaderContext_1 = require("../context/LoaderContext");
|
|
15
|
-
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
16
14
|
const ToolbarMenu_1 = __importDefault(require("../elements/ToolbarMenu"));
|
|
17
15
|
const Alert_1 = require("../elements/popup/Alert");
|
|
18
16
|
const Modal_1 = require("../elements/popup/Modal");
|
|
19
17
|
const useCheckExperimentalFeature_1 = __importDefault(require("../hooks/useCheckExperimentalFeature"));
|
|
18
|
+
const useCheckToolsVisibility_1 = require("../hooks/useCheckToolsVisibility");
|
|
20
19
|
const useDatumWithSpectraStatistics_1 = __importDefault(require("../hooks/useDatumWithSpectraStatistics"));
|
|
21
20
|
const useExport_1 = __importDefault(require("../hooks/useExport"));
|
|
22
21
|
const useToolsFunctions_1 = __importDefault(require("../hooks/useToolsFunctions"));
|
|
@@ -27,59 +26,59 @@ const Types_1 = require("../reducer/types/Types");
|
|
|
27
26
|
const IMPORT_MENU = [
|
|
28
27
|
{
|
|
29
28
|
id: 'importFile',
|
|
30
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFile, {}
|
|
29
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFile, {}),
|
|
31
30
|
label: 'Import from file system (Press Ctrl + O)',
|
|
32
31
|
},
|
|
33
32
|
{
|
|
34
33
|
id: 'importJDX',
|
|
35
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFile, {}
|
|
34
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFile, {}),
|
|
36
35
|
label: 'Add JCAMP-DX from URL',
|
|
37
36
|
},
|
|
38
37
|
{
|
|
39
38
|
id: 'importPublicationString',
|
|
40
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFile, {}
|
|
39
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFile, {}),
|
|
41
40
|
label: 'Import from publication string',
|
|
42
41
|
},
|
|
43
42
|
];
|
|
44
43
|
const EXPORT_MENU = [
|
|
45
44
|
{
|
|
46
45
|
id: 'svg',
|
|
47
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaDownload, {}
|
|
46
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaDownload, {}),
|
|
48
47
|
label: 'Export as SVG',
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
50
|
id: 'png',
|
|
52
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileImage, {}
|
|
51
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileImage, {}),
|
|
53
52
|
label: 'Export as PNG',
|
|
54
53
|
},
|
|
55
54
|
{
|
|
56
55
|
id: 'json',
|
|
57
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileDownload, {}
|
|
56
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileDownload, {}),
|
|
58
57
|
label: 'Save data ( Press Ctrl + S )',
|
|
59
58
|
},
|
|
60
59
|
{
|
|
61
60
|
id: 'advance_save',
|
|
62
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileDownload, {}
|
|
61
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileDownload, {}),
|
|
63
62
|
label: 'Save data as ( Press Ctrl + Shift + S )',
|
|
64
63
|
},
|
|
65
64
|
{
|
|
66
65
|
id: 'nmre',
|
|
67
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileDownload, {}
|
|
66
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaFileDownload, {}),
|
|
68
67
|
label: 'Save NMRE data',
|
|
69
68
|
},
|
|
70
69
|
{
|
|
71
70
|
id: 'copy',
|
|
72
|
-
icon: (0, jsx_runtime_1.jsx)(fa_1.FaCopy, {}
|
|
71
|
+
icon: (0, jsx_runtime_1.jsx)(fa_1.FaCopy, {}),
|
|
73
72
|
label: 'Copy image to Clipboard ( Press Ctrl + C )',
|
|
74
73
|
},
|
|
75
74
|
];
|
|
76
75
|
function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidCounter, activeSpectrum, }) {
|
|
77
76
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
78
|
-
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
79
77
|
const alert = (0, Alert_1.useAlert)();
|
|
80
78
|
const modal = (0, Modal_1.useModal)();
|
|
81
79
|
const openLoader = (0, LoaderContext_1.useLoader)();
|
|
82
80
|
const isExperimentalFeature = (0, useCheckExperimentalFeature_1.default)();
|
|
81
|
+
const isButtonVisible = (0, useCheckToolsVisibility_1.useCheckToolsVisibility)();
|
|
83
82
|
const importMenu = (0, react_1.useMemo)(() => {
|
|
84
83
|
return isExperimentalFeature
|
|
85
84
|
? IMPORT_MENU
|
|
@@ -101,14 +100,11 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
|
|
|
101
100
|
dispatch({ type: Types_1.SET_LOADING_FLAG, isLoading: true });
|
|
102
101
|
}, [dispatch, modal]);
|
|
103
102
|
const importJCAMPFile = (0, react_1.useCallback)(() => {
|
|
104
|
-
modal.show((0, jsx_runtime_1.jsx)(LoadJCAMPModal_1.default, { onLoadClick: LoadJacmpHandler, onClose: () => modal.close(), startLoading: startLoadingHandler }
|
|
103
|
+
modal.show((0, jsx_runtime_1.jsx)(LoadJCAMPModal_1.default, { onLoadClick: LoadJacmpHandler, onClose: () => modal.close(), startLoading: startLoadingHandler }), {});
|
|
105
104
|
}, [LoadJacmpHandler, modal, startLoadingHandler]);
|
|
106
105
|
const openImportPublicationStringModal = (0, react_1.useCallback)(() => {
|
|
107
|
-
modal.show((0, jsx_runtime_1.jsx)(ImportPublicationStringModal_1.default, { onClose: () => modal.close() }
|
|
106
|
+
modal.show((0, jsx_runtime_1.jsx)(ImportPublicationStringModal_1.default, { onClose: () => modal.close() }), {});
|
|
108
107
|
}, [modal]);
|
|
109
|
-
const isButtonVisible = (0, react_1.useCallback)((key) => {
|
|
110
|
-
return !(0, get_1.default)(preferences, `display.toolBarButtons.${key}`);
|
|
111
|
-
}, [preferences]);
|
|
112
108
|
const importHandler = (0, react_1.useCallback)(({ id }) => {
|
|
113
109
|
switch (id) {
|
|
114
110
|
case 'importFile':
|
|
@@ -155,22 +151,22 @@ function BasicToolBarInner({ info, verticalAlign, displayerMode, ftCounter, fidC
|
|
|
155
151
|
saveAsNMREHandler,
|
|
156
152
|
saveToClipboardHandler,
|
|
157
153
|
]);
|
|
158
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isButtonVisible('
|
|
154
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isButtonVisible('import') && ((0, jsx_runtime_1.jsx)(ToolbarMenu_1.default, { component: (0, jsx_runtime_1.jsx)(fa_1.FaFileImport, {}), toolTip: "Import", onClick: (element) => {
|
|
159
155
|
importHandler(element);
|
|
160
156
|
return null;
|
|
161
|
-
}, items: importMenu }
|
|
157
|
+
}, items: importMenu })), isButtonVisible('exportAs') && ((0, jsx_runtime_1.jsx)(ToolbarMenu_1.default, { component: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}), toolTip: "Export As", onClick: (element) => {
|
|
162
158
|
exportHandler(element);
|
|
163
159
|
return null;
|
|
164
|
-
}, items: EXPORT_MENU }
|
|
165
|
-
isButtonVisible('
|
|
160
|
+
}, items: EXPORT_MENU })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
161
|
+
isButtonVisible('spectraStackAlignments') &&
|
|
166
162
|
ftCounter > 1 &&
|
|
167
|
-
(info?.isFt || !activeSpectrum) && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "spectra-alignment", className: "cheminfo", title: "Spectra alignment ( Press s )", onClick: changeDisplayViewModeHandler, children: verticalAlign.align === 'stack' ? ((0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay3Aligned, {}
|
|
168
|
-
isButtonVisible('
|
|
169
|
-
info.isComplex && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "display", title: isRealSpectrumShown ? 'Display Real ' : 'Display Imaginary', onClick: changeSpectrumViewHandler, className: "cheminfo", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRealImag, {}
|
|
170
|
-
isButtonVisible('
|
|
163
|
+
(info?.isFt || !activeSpectrum) && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "spectra-alignment", className: "cheminfo", title: "Spectra alignment ( Press s )", onClick: changeDisplayViewModeHandler, children: verticalAlign.align === 'stack' ? ((0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay3Aligned, {})) : ((0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrOverlay3, {})) })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
164
|
+
isButtonVisible('realImaginary') &&
|
|
165
|
+
info.isComplex && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "display", title: isRealSpectrumShown ? 'Display Real ' : 'Display Imaginary', onClick: changeSpectrumViewHandler, className: "cheminfo", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRealImag, {}) })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
166
|
+
isButtonVisible('spectraCenterAlignments') &&
|
|
171
167
|
(ftCounter > 0 || fidCounter > 0) && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "baseline-position", title: verticalAlign.align === 'bottom'
|
|
172
168
|
? 'Baseline Center ( Press c )'
|
|
173
|
-
: 'Baseline Bottom ( Press c )', onClick: alignSpectrumsVerticallyHandler, className: "cheminfo", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 24 }, children: verticalAlign.align === 'bottom' ? ((0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAlignCenter, {}
|
|
169
|
+
: 'Baseline Bottom ( Press c )', onClick: alignSpectrumsVerticallyHandler, className: "cheminfo", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 24 }, children: verticalAlign.align === 'bottom' ? ((0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAlignCenter, {})) : ((0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrAlignBottom, {})) }) }))] }));
|
|
174
170
|
}
|
|
175
171
|
const MemoizedBasicToolBar = (0, react_1.memo)(BasicToolBarInner);
|
|
176
172
|
function BasicToolBar() {
|
|
@@ -184,6 +180,6 @@ function BasicToolBar() {
|
|
|
184
180
|
verticalAlign,
|
|
185
181
|
displayerMode,
|
|
186
182
|
activeTab,
|
|
187
|
-
} }
|
|
183
|
+
} }));
|
|
188
184
|
}
|
|
189
185
|
exports.default = BasicToolBar;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -57,33 +61,32 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
|
|
|
57
61
|
});
|
|
58
62
|
dispatch({ type: Types_1.SET_SELECTED_FILTER, selectedFilter: null });
|
|
59
63
|
}, [dispatch]);
|
|
60
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(ToggleButtonGroup_1.default, { value: option, onChange: handleChange, children: [isButtonVisible('
|
|
61
|
-
isButtonVisible('
|
|
62
|
-
isButtonVisible('
|
|
63
|
-
isButtonVisible('
|
|
64
|
-
isButtonVisible('
|
|
65
|
-
isButtonVisible('
|
|
66
|
-
isButtonVisible('hideMultipleSpectraAnalysisTool') &&
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(ToggleButtonGroup_1.default, { value: option, onChange: handleChange, children: [isButtonVisible('zoomTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zoom.id, id: "zoomIn", title: `${ToolTypes_1.options.zoom.label} ( Press z )`, children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaSearchPlus, {}) }) }, ToolTypes_1.options.zoom.id)), isButtonVisible('zoomOutTool') && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 14 }, children: (0, jsx_runtime_1.jsx)(fa_1.FaExpand, {}) }) })), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D && isButtonVisible('peakTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.peakPicking.id, title: `${ToolTypes_1.options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPeakPicking, {}) }, ToolTypes_1.options.peakPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
65
|
+
isButtonVisible('integralTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${ToolTypes_1.options.integral.label} ( Press i )`, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrIntegrate, {}) }, ToolTypes_1.options.integral.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
66
|
+
isButtonVisible('zonePickingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${ToolTypes_1.options.zone2D.label} ( Press r )`, children: (0, jsx_runtime_1.jsx)(fa_1.FaDiceFour, {}) }, ToolTypes_1.options.zone2D.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_2D &&
|
|
67
|
+
isButtonVisible('slicingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${ToolTypes_1.options.slicingTool.label}`, children: (0, jsx_runtime_1.jsx)("p", { children: "Slic" }) }, ToolTypes_1.options.slicingTool.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
68
|
+
isButtonVisible('autoRangesTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${ToolTypes_1.options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrRangePicking, {}) }, ToolTypes_1.options.rangesPicking.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
69
|
+
isButtonVisible('multipleSpectraAnalysisTool') &&
|
|
67
70
|
ftCounter > 1 &&
|
|
68
|
-
mode === 'RTL' && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: ToolTypes_1.options.multipleSpectraAnalysis.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}
|
|
69
|
-
isButtonVisible('
|
|
70
|
-
isButtonVisible('
|
|
71
|
+
mode === 'RTL' && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: ToolTypes_1.options.multipleSpectraAnalysis.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}) }, ToolTypes_1.options.multipleSpectraAnalysis.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
72
|
+
isButtonVisible('zeroFillingTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: ToolTypes_1.options.zeroFilling.label, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrZeroFilling, {}) }, ToolTypes_1.options.zeroFilling.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
73
|
+
isButtonVisible('phaseCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.phaseCorrection.id, id: "phaseCorrection", title: `${ToolTypes_1.options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
|
|
71
74
|
info &&
|
|
72
75
|
Filters.phaseCorrection.isApplicable({ info }) &&
|
|
73
76
|
datum.im
|
|
74
77
|
? true
|
|
75
|
-
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPhaseCorrection, {}
|
|
76
|
-
isButtonVisible('
|
|
78
|
+
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrPhaseCorrection, {}) }, ToolTypes_1.options.phaseCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
79
|
+
isButtonVisible('baseLineCorrectionTool') && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.baseLineCorrection.id, id: "baseLineCorrection", title: `${ToolTypes_1.options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
|
|
77
80
|
info &&
|
|
78
81
|
Filters.baselineCorrection.isApplicable({ info })
|
|
79
82
|
? true
|
|
80
|
-
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrBaselineCorrection, {}
|
|
81
|
-
isButtonVisible('
|
|
83
|
+
: false, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrBaselineCorrection, {}) }, ToolTypes_1.options.baseLineCorrection.id)), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
84
|
+
isButtonVisible('exclusionZonesTool') &&
|
|
82
85
|
!info?.isFid &&
|
|
83
|
-
ftCounter > 0 && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.exclusionZones.id, title: `${ToolTypes_1.options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 18 }, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}
|
|
84
|
-
isButtonVisible('
|
|
86
|
+
ftCounter > 0 && ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { value: ToolTypes_1.options.exclusionZones.id, title: `${ToolTypes_1.options.exclusionZones.label} ( Press e )`, id: "exclusionZones", children: (0, jsx_runtime_1.jsx)("div", { style: { fontSize: 18 }, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrMultipleAnalysis, {}) }) }, ToolTypes_1.options.exclusionZones.id))] }), displayerMode === Constants_1.DISPLAYER_MODE.DM_1D &&
|
|
87
|
+
isButtonVisible('FFTTool') &&
|
|
85
88
|
info &&
|
|
86
|
-
Filters.fft.isApplicable({ info }) && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "fft-filter", className: "cheminfo", title: "FFT Filter", onClick: handleOnFFTFilter, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFourierTransform, {}
|
|
89
|
+
Filters.fft.isApplicable({ info }) && ((0, jsx_runtime_1.jsx)(analysis_ui_components_1.Toolbar.Item, { id: "fft-filter", className: "cheminfo", title: "FFT Filter", onClick: handleOnFFTFilter, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFourierTransform, {}) }))] }));
|
|
87
90
|
}
|
|
88
91
|
const MemoizedFunctionToolBar = (0, react_1.memo)(FunctionToolBarInner);
|
|
89
92
|
function FunctionToolBar({ defaultValue = ToolTypes_1.options.zoom.id, }) {
|
|
@@ -96,6 +99,6 @@ function FunctionToolBar({ defaultValue = ToolTypes_1.options.zoom.id, }) {
|
|
|
96
99
|
activeTab,
|
|
97
100
|
defaultValue,
|
|
98
101
|
mode,
|
|
99
|
-
} }
|
|
102
|
+
} }));
|
|
100
103
|
}
|
|
101
104
|
exports.default = FunctionToolBar;
|
|
@@ -30,6 +30,6 @@ function HistoryToolBar({ isUndoButtonVisible = true, isRedoButtonVisible = true
|
|
|
30
30
|
const { history } = (0, ChartContext_1.useChartData)();
|
|
31
31
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
32
32
|
const handle = (0, react_1.useCallback)((type) => dispatch({ type }), [dispatch]);
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isUndoButtonVisible && ((0, jsx_runtime_1.jsx)("button", { style: styles.button, type: "button", onClick: () => handle(HistoryTypes_1.REDO), disabled: !history.hasRedo, children: (0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Redo", popupPlacement: "right", children: (0, jsx_runtime_1.jsx)(fa_1.FaRedo, {}
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isUndoButtonVisible && ((0, jsx_runtime_1.jsx)("button", { style: styles.button, type: "button", onClick: () => handle(HistoryTypes_1.REDO), disabled: !history.hasRedo, children: (0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Redo", popupPlacement: "right", children: (0, jsx_runtime_1.jsx)(fa_1.FaRedo, {}) }) })), isRedoButtonVisible && ((0, jsx_runtime_1.jsx)("button", { type: "button", style: styles.button, onClick: () => handle(HistoryTypes_1.UNDO), disabled: !history.hasUndo, children: (0, jsx_runtime_1.jsx)(ToolTip_1.default, { title: "Undo", popupPlacement: "right", children: (0, jsx_runtime_1.jsx)(fa_1.FaUndo, {}) }) }))] }));
|
|
34
34
|
}
|
|
35
35
|
exports.default = (0, react_1.memo)(HistoryToolBar);
|