nmrium 0.22.0 → 0.24.1
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 -36
- package/lib/component/NMRium.js +10 -16
- 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.d.ts +0 -28
- package/lib/component/modal/PredictSpectraModal.js +31 -54
- 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 +52 -14
- 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.d.ts +10 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +28 -18
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +9 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
- 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 +51 -32
- 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.d.ts +6 -0
- package/lib/component/panels/predictionPanel/PredictionOptions.js +90 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.d.ts +2 -0
- package/lib/component/panels/predictionPanel/PredictionPanel.js +35 -0
- 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 -8
- package/lib/component/reducer/actions/MoleculeActions.js +5 -1
- package/lib/component/reducer/preferencesReducer.d.ts +183 -36
- package/lib/component/reducer/preferencesReducer.js +196 -85
- 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 -33
- 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 -31
- package/lib/data/PredictionManager.d.ts +36 -3
- package/lib/data/PredictionManager.js +62 -17
- 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 -17
- 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 +36 -55
- 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 +51 -13
- 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 +28 -18
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -7
- 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 +51 -32
- 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 +118 -0
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +41 -0
- 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 -9
- 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 +195 -83
- 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 -33
- 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 -31
- package/lib-cjs/data/Filters.js +5 -1
- package/lib-cjs/data/FiltersManager.js +5 -1
- package/lib-cjs/data/PredictionManager.js +62 -17
- 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 -45
- package/lib-cjs/component/workspaces/exercise1D.js +0 -48
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { useCallback, useRef, useState } from 'react';
|
|
5
|
-
import { usePreferences } from '../../context/PreferencesContext';
|
|
4
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { usePreferences, useWorkspacesList, } from '../../context/PreferencesContext';
|
|
6
6
|
import CloseButton from '../../elements/CloseButton';
|
|
7
7
|
import Tab from '../../elements/Tab/Tab';
|
|
8
8
|
import Tabs, { PositionsEnum } from '../../elements/Tab/Tabs';
|
|
9
|
+
import DropDownButton from '../../elements/dropDownButton/DropDownButton';
|
|
9
10
|
import FormikForm from '../../elements/formik/FormikForm';
|
|
10
11
|
import { useAlert } from '../../elements/popup/Alert';
|
|
11
|
-
import {
|
|
12
|
+
import { ModalStyles } from '../ModalStyle';
|
|
12
13
|
import ControllersTabContent from './ControllersTabContent';
|
|
13
14
|
import DisplayTabContent from './DisplayTabContent';
|
|
14
15
|
import FormattingTabContent from './FormattingTabContent';
|
|
16
|
+
import WorkspaceItem from './WorkspaceItem';
|
|
15
17
|
const styles = css `
|
|
16
|
-
overflow: auto;
|
|
17
|
-
height: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
|
|
21
|
-
.header {
|
|
22
|
-
text-align: center;
|
|
23
|
-
padding: 10px 0 10px 0px;
|
|
24
|
-
margin: 0px;
|
|
25
|
-
color: #005d9e;
|
|
26
|
-
place-items: normal;
|
|
27
|
-
text-transform: none;
|
|
28
|
-
background-color: #fcfcfc;
|
|
29
|
-
}
|
|
30
18
|
.main-content {
|
|
31
19
|
width: 100%;
|
|
32
20
|
flex: 1;
|
|
@@ -38,57 +26,6 @@ const styles = css `
|
|
|
38
26
|
width: 100%;
|
|
39
27
|
}
|
|
40
28
|
|
|
41
|
-
.inner-content {
|
|
42
|
-
padding: 15px 30px;
|
|
43
|
-
width: 100%;
|
|
44
|
-
overflow: auto;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
button:focus {
|
|
48
|
-
outline: none;
|
|
49
|
-
}
|
|
50
|
-
button:hover {
|
|
51
|
-
color: #007bff;
|
|
52
|
-
}
|
|
53
|
-
.btn:hover {
|
|
54
|
-
background-color: #ffffff;
|
|
55
|
-
}
|
|
56
|
-
.btn {
|
|
57
|
-
border: none;
|
|
58
|
-
padding: 0 15px;
|
|
59
|
-
background-color: #ffffff5e;
|
|
60
|
-
border-radius: 5px;
|
|
61
|
-
height: 25px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.footer-container {
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: flex-end;
|
|
67
|
-
justify-content: flex-end;
|
|
68
|
-
background: rgb(242, 242, 242);
|
|
69
|
-
background: -moz-linear-gradient(
|
|
70
|
-
0deg,
|
|
71
|
-
rgba(242, 242, 242, 1) 0%,
|
|
72
|
-
rgba(245, 245, 245, 1) 37%,
|
|
73
|
-
rgba(255, 255, 255, 1) 90%
|
|
74
|
-
);
|
|
75
|
-
background: -webkit-linear-gradient(
|
|
76
|
-
0deg,
|
|
77
|
-
rgba(242, 242, 242, 1) 0%,
|
|
78
|
-
rgba(245, 245, 245, 1) 37%,
|
|
79
|
-
rgba(255, 255, 255, 1) 90%
|
|
80
|
-
);
|
|
81
|
-
background: linear-gradient(
|
|
82
|
-
0deg,
|
|
83
|
-
rgba(242, 242, 242, 1) 0%,
|
|
84
|
-
rgba(245, 245, 245, 1) 37%,
|
|
85
|
-
rgba(255, 255, 255, 1) 90%
|
|
86
|
-
);
|
|
87
|
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#f2f2f2",endColorstr="#ffffff",GradientType=1);
|
|
88
|
-
padding: 6px 15px;
|
|
89
|
-
height: 55px;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
29
|
.section-header {
|
|
93
30
|
font-size: 13px;
|
|
94
31
|
color: #2ca8ff;
|
|
@@ -135,31 +72,79 @@ const styles = css `
|
|
|
135
72
|
width: 260px;
|
|
136
73
|
}
|
|
137
74
|
}
|
|
138
|
-
|
|
139
|
-
|
|
75
|
+
|
|
76
|
+
.workspace-container {
|
|
77
|
+
display: flex;
|
|
78
|
+
background-color: #f4f4f4;
|
|
79
|
+
align-items: center;
|
|
80
|
+
cursor: default;
|
|
81
|
+
padding: 0.5em;
|
|
82
|
+
.dropdown {
|
|
83
|
+
padding: 0.4em 1em;
|
|
84
|
+
}
|
|
85
|
+
& .label {
|
|
86
|
+
font-size: 0.8em;
|
|
87
|
+
}
|
|
140
88
|
}
|
|
141
89
|
`;
|
|
142
90
|
function GeneralSettings({ onClose }) {
|
|
143
91
|
const [activeTab, setActiveTab] = useState('controllers');
|
|
144
|
-
const preferences = usePreferences();
|
|
92
|
+
const { dispatch, ...preferences } = usePreferences();
|
|
145
93
|
const alert = useAlert();
|
|
146
94
|
const refForm = useRef();
|
|
95
|
+
const workspaces = useWorkspacesList();
|
|
96
|
+
const workspacesList = useMemo(() => {
|
|
97
|
+
return workspaces.concat([
|
|
98
|
+
{
|
|
99
|
+
key: 'new',
|
|
100
|
+
label: 'Custom workspace',
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
}, [workspaces]);
|
|
147
104
|
const handleSave = useCallback(() => {
|
|
148
105
|
refForm.current.submitForm();
|
|
149
106
|
}, []);
|
|
150
107
|
const handleReset = useCallback(() => {
|
|
151
|
-
|
|
108
|
+
dispatch({ type: 'RESET_PREFERENCES' });
|
|
152
109
|
alert.success('Settings saved successfully');
|
|
153
110
|
onClose?.();
|
|
154
|
-
}, [alert,
|
|
111
|
+
}, [alert, dispatch, onClose]);
|
|
155
112
|
const submitHandler = useCallback((values) => {
|
|
156
|
-
|
|
113
|
+
dispatch({ type: 'SET_PREFERENCES', payload: values });
|
|
157
114
|
alert.success('Settings saved successfully');
|
|
158
115
|
onClose?.();
|
|
159
|
-
}, [alert,
|
|
116
|
+
}, [alert, dispatch, onClose]);
|
|
160
117
|
const tabChangeHandler = useCallback((tab) => {
|
|
161
118
|
setActiveTab(tab.tabid);
|
|
162
119
|
}, []);
|
|
163
|
-
|
|
120
|
+
const addWorkSpaceHandler = useCallback((name) => {
|
|
121
|
+
dispatch({
|
|
122
|
+
type: 'ADD_WORKSPACE',
|
|
123
|
+
payload: {
|
|
124
|
+
workspace: name,
|
|
125
|
+
data: refForm.current.values,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}, [dispatch]);
|
|
129
|
+
const deleteWorkSpaceHandler = useCallback((key) => {
|
|
130
|
+
dispatch({
|
|
131
|
+
type: 'REMOVE_WORKSPACE',
|
|
132
|
+
payload: {
|
|
133
|
+
workspace: key,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}, [dispatch]);
|
|
137
|
+
const ChangeWorkspaceHandler = useCallback((option) => {
|
|
138
|
+
dispatch({
|
|
139
|
+
type: 'SET_WORKSPACE',
|
|
140
|
+
payload: {
|
|
141
|
+
workspace: option.key,
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}, [dispatch]);
|
|
145
|
+
const renderItem = useCallback((item) => {
|
|
146
|
+
return (_jsx(WorkspaceItem, { item: item, onSave: addWorkSpaceHandler, onDelete: deleteWorkSpaceHandler }));
|
|
147
|
+
}, [addWorkSpaceHandler, deleteWorkSpaceHandler]);
|
|
148
|
+
return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "General Settings" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsxs("div", { className: "workspace-container", children: [_jsx("span", { className: "label", children: "Workspace : " }), _jsx(DropDownButton, { data: workspacesList, renderItem: renderItem, selectedKey: preferences?.workspace.current, onSelect: ChangeWorkspaceHandler })] }), _jsx("div", { className: "main-content", children: _jsx(FormikForm, { ref: refForm, initialValues: preferences.current, onSubmit: submitHandler, children: _jsxs(Tabs, { position: PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [_jsx(Tab, { tablabel: "Controllers", tabid: "controllers", children: _jsx("div", { className: "inner-content", children: _jsx(ControllersTabContent, {}) }) }), _jsx(Tab, { tablabel: "Formatting", tabid: "formatting", children: _jsx("div", { className: "inner-content", children: _jsx(FormattingTabContent, {}) }) }), _jsx(Tab, { tablabel: "Display", tabid: "display", children: _jsx("div", { className: "inner-content", children: _jsx(DisplayTabContent, { preferences: preferences.current.display }) }) })] }) }, JSON.stringify(preferences.current)) }), _jsxs("div", { className: "footer-container", children: [_jsx("button", { type: "button", onClick: handleSave, className: "btn", children: "Save" }), _jsx("button", { type: "button", onClick: handleReset, className: "btn", children: "Reset" })] })] }));
|
|
164
149
|
}
|
|
165
150
|
export default GeneralSettings;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @emotion/react */
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { useCallback, useState } from 'react';
|
|
5
|
+
import workspaces from '../../workspaces';
|
|
6
|
+
const styles = css `
|
|
7
|
+
.container {
|
|
8
|
+
display: flex;
|
|
9
|
+
span {
|
|
10
|
+
padding: 5px !important;
|
|
11
|
+
}
|
|
12
|
+
span {
|
|
13
|
+
flex: 1;
|
|
14
|
+
text-align: left !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.new-container {
|
|
19
|
+
background-color: #f6f6f6;
|
|
20
|
+
display: flex;
|
|
21
|
+
padding: 0.3em;
|
|
22
|
+
|
|
23
|
+
input {
|
|
24
|
+
padding: 0.5em;
|
|
25
|
+
color: black;
|
|
26
|
+
outline: none;
|
|
27
|
+
background-color: transparent !important;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.delete-button:hover {
|
|
32
|
+
color: white;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.save-button:hover {
|
|
36
|
+
color: green;
|
|
37
|
+
}
|
|
38
|
+
.delete-button,
|
|
39
|
+
.save-button {
|
|
40
|
+
padding: 5px;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
const WorkspaceItem = ({ item, onSave, onDelete }) => {
|
|
44
|
+
const [name, setName] = useState('');
|
|
45
|
+
const addWorkspaceHandler = useCallback((e) => {
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
setName('');
|
|
48
|
+
onSave(name);
|
|
49
|
+
}, [name, onSave]);
|
|
50
|
+
const deleteWorkspaceHandler = useCallback((e) => {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
onDelete(item.key);
|
|
53
|
+
}, [item.key, onDelete]);
|
|
54
|
+
const onTextChange = useCallback((e) => {
|
|
55
|
+
setName(e.target.value);
|
|
56
|
+
}, []);
|
|
57
|
+
return (_jsx("div", { css: styles, children: item.key === 'new' ? (_jsxs("div", { className: "new-container", children: [_jsx("input", { value: name, placeholder: "Custom workspace", onClick: (e) => e.stopPropagation(), onChange: onTextChange }), _jsx("button", { type: "button", className: "save-button", onClick: addWorkspaceHandler, disabled: !name, children: "save" })] })) : (_jsxs("div", { className: "container", children: [_jsx("span", { children: item.label }), !workspaces[item.key] && (_jsx("button", { type: "button", className: "delete-button", onClick: deleteWorkspaceHandler, children: "Delete" }))] })) }));
|
|
58
|
+
};
|
|
59
|
+
export default WorkspaceItem;
|
|
@@ -8,6 +8,6 @@ import DefaultPanelHeader from '../header/DefaultPanelHeader';
|
|
|
8
8
|
function AutomaticAssignment() {
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
10
10
|
const automaticAssignmentHandler = useCallback(() => { }, []);
|
|
11
|
-
return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { showSettingButton: false, canDelete: false, children: _jsx(Button, { popupTitle: "automatic assignment", onClick: automaticAssignmentHandler, children: _jsx(SvgNmrAssignment2, { style: { fontSize: '18px' } }
|
|
11
|
+
return (_jsxs("div", { css: tablePanelStyle, children: [_jsx(DefaultPanelHeader, { showSettingButton: false, canDelete: false, children: _jsx(Button, { popupTitle: "automatic assignment", onClick: automaticAssignmentHandler, children: _jsx(SvgNmrAssignment2, { style: { fontSize: '18px' } }) }) }), _jsx("div", { className: "inner-container" })] }));
|
|
12
12
|
}
|
|
13
13
|
export default AutomaticAssignment;
|
|
@@ -30,9 +30,9 @@ function PeaksTable({ data }) {
|
|
|
30
30
|
minWidth: '24px',
|
|
31
31
|
},
|
|
32
32
|
id: 'assign-button',
|
|
33
|
-
Cell: ({ row }) => (_jsx("button", { type: "button", className: "assign-button", onClick: (e) => assignHandler(e, row), children: _jsx(SvgNmrAssignment, {}
|
|
33
|
+
Cell: ({ row }) => (_jsx("button", { type: "button", className: "assign-button", onClick: (e) => assignHandler(e, row), children: _jsx(SvgNmrAssignment, {}) })),
|
|
34
34
|
},
|
|
35
35
|
], [assignHandler]);
|
|
36
|
-
return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: COLUMNS }
|
|
36
|
+
return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: COLUMNS })) : (_jsx(NoTableData, {}));
|
|
37
37
|
}
|
|
38
38
|
export default memo(PeaksTable);
|
|
@@ -54,7 +54,7 @@ function InformationPanelInner({ info, meta }) {
|
|
|
54
54
|
minWidth: 100,
|
|
55
55
|
width: 20,
|
|
56
56
|
maxWidth: 20,
|
|
57
|
-
Cell: ({ row }) => (_jsx("p", { style: { padding: '5px', backgroundColor: 'white' }, children: row.original }
|
|
57
|
+
Cell: ({ row }) => (_jsx("p", { style: { padding: '5px', backgroundColor: 'white' }, children: row.original })),
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
Header: 'Value',
|
|
@@ -67,14 +67,14 @@ function InformationPanelInner({ info, meta }) {
|
|
|
67
67
|
fontFamily: 'monospace',
|
|
68
68
|
whiteSpace: 'pre',
|
|
69
69
|
overflow: 'hidden',
|
|
70
|
-
}, children: `${information[row.original]}` }
|
|
70
|
+
}, children: `${information[row.original]}` })),
|
|
71
71
|
},
|
|
72
72
|
], [information]);
|
|
73
|
-
return (_jsxs("div", { style: styles.container, children: [_jsx("div", { children: _jsx("input", { type: "text", style: styles.searchInput, placeholder: "Search for parameter...", onChange: handleSearch, ref: searchRef }
|
|
73
|
+
return (_jsxs("div", { style: styles.container, children: [_jsx("div", { children: _jsx("input", { type: "text", style: styles.searchInput, placeholder: "Search for parameter...", onChange: handleSearch, ref: searchRef }) }), _jsx("div", { style: styles.tableContainer, children: _jsx(ReactTableFlexLayout, { data: matches, columns: columns }) })] }));
|
|
74
74
|
}
|
|
75
75
|
const MemoizedInformationPanel = memo(InformationPanelInner);
|
|
76
76
|
const emptyData = { info: {}, meta: {} };
|
|
77
77
|
export default function InformationPanel() {
|
|
78
78
|
const { info, meta } = useSpectrum(emptyData);
|
|
79
|
-
return _jsx(MemoizedInformationPanel, { ...{ info, meta } }
|
|
79
|
+
return _jsx(MemoizedInformationPanel, { ...{ info, meta } });
|
|
80
80
|
}
|
|
@@ -59,7 +59,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, preferences,
|
|
|
59
59
|
const showChangeIntegralSumModal = useCallback(() => {
|
|
60
60
|
modal.show(_jsx(ChangeSumModal, { onClose: () => modal.close(), onSave: changeIntegralSumHandler, header: currentSum
|
|
61
61
|
? `Set new Integrals Sum (Current: ${Number(currentSum).toFixed(2)})`
|
|
62
|
-
: 'Set new Integrals Sum', sumOptions: integrals?.options }
|
|
62
|
+
: 'Set new Integrals Sum', sumOptions: integrals?.options }));
|
|
63
63
|
}, [changeIntegralSumHandler, currentSum, integrals?.options, modal]);
|
|
64
64
|
const settingsPanelHandler = useCallback(() => {
|
|
65
65
|
setFlipStatus(!isFlipped);
|
|
@@ -108,7 +108,7 @@ function IntegralPanelInner({ integrals, info, activeTab, xDomain, preferences,
|
|
|
108
108
|
? 'Show all integrals'
|
|
109
109
|
: 'Hide integrals out of view', filterIsActive: filterIsActive, counterFiltered: filteredData.length, showSettingButton: true, onSettingClick: settingsPanelHandler, children: [_jsx(ToolTip, { title: currentSum
|
|
110
110
|
? `Change Integrals Sum (${Number(currentSum).toFixed(2)})`
|
|
111
|
-
: 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}
|
|
111
|
+
: 'Change Integrals Sum', popupPlacement: "right", children: _jsx("button", { className: "sum-button", type: "button", onClick: showChangeIntegralSumModal, children: _jsx(SvgNmrSum, {}) }) }), _jsx(ToggleButton, { className: "fix-integral-toggle-btn", popupTitle: "fix integral values", popupPlacement: "right", onClick: toggleConstantSumHandler, children: _jsx(ImLink, {}) })] })), isFlipped && (_jsx(PreferencesHeader, { onSave: saveSettingHandler, onClose: settingsPanelHandler })), _jsx("div", { className: "inner-container", children: !isFlipped ? (_jsx(IntegralTable, { data: filteredData, activeTab: activeTab, preferences: preferences })) : (_jsx(IntegralsPreferences, { ref: settingRef })) })] }) }));
|
|
112
112
|
}
|
|
113
113
|
const MemoizedIntegralPanel = memo(IntegralPanelInner);
|
|
114
114
|
const emptyData = { integrals: {}, info: {} };
|
|
@@ -119,8 +119,8 @@ export default function IntegralPanel() {
|
|
|
119
119
|
return (_jsx(MemoizedIntegralPanel, { ...{
|
|
120
120
|
integrals,
|
|
121
121
|
info,
|
|
122
|
-
preferences,
|
|
122
|
+
preferences: preferences.current,
|
|
123
123
|
xDomain,
|
|
124
124
|
activeTab,
|
|
125
|
-
} }
|
|
125
|
+
} }));
|
|
126
126
|
}
|
|
@@ -60,13 +60,13 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
60
60
|
sortType: 'basic',
|
|
61
61
|
resizable: true,
|
|
62
62
|
accessor: (row) => row.kind,
|
|
63
|
-
Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), data: SignalKinds, style: selectStyle, defaultValue: row.original.kind }
|
|
63
|
+
Cell: ({ row }) => (_jsx(Select, { onChange: (value) => changeIntegralDataHandler(value, row), data: SignalKinds, style: selectStyle, defaultValue: row.original.kind })),
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
index: 7,
|
|
67
67
|
style: { width: '1%', maxWidth: '24px', minWidth: '24px' },
|
|
68
68
|
id: 'delete-button',
|
|
69
|
-
Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deleteIntegralHandler(e, row), children: _jsx(FaRegTrashAlt, {}
|
|
69
|
+
Cell: ({ row }) => (_jsx("button", { type: "button", className: "delete-button", onClick: (e) => deleteIntegralHandler(e, row), children: _jsx(FaRegTrashAlt, {}) })),
|
|
70
70
|
},
|
|
71
71
|
], [changeIntegralDataHandler, deleteIntegralHandler]);
|
|
72
72
|
const saveRelativeHandler = useCallback((event, row) => {
|
|
@@ -76,7 +76,7 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
76
76
|
payload: { data },
|
|
77
77
|
});
|
|
78
78
|
}, [dispatch]);
|
|
79
|
-
const integralsPreferences = useMemo(() => getValue(preferences, `formatting.panels.integrals.[${activeTab}]`, integralDefaultValues), [activeTab, preferences]);
|
|
79
|
+
const integralsPreferences = useMemo(() => getValue(preferences.current, `formatting.panels.integrals.[${activeTab}]`, integralDefaultValues), [activeTab, preferences]);
|
|
80
80
|
const COLUMNS = useMemo(() => [
|
|
81
81
|
{
|
|
82
82
|
showWhen: 'showAbsolute',
|
|
@@ -90,7 +90,7 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
90
90
|
id: 'relative',
|
|
91
91
|
Header: () => {
|
|
92
92
|
const n = activeTab?.replace(/[0-9]/g, '');
|
|
93
|
-
return _jsx("span", { children: `Relative ${n}` }
|
|
93
|
+
return _jsx("span", { children: `Relative ${n}` });
|
|
94
94
|
},
|
|
95
95
|
accessor: (row) => {
|
|
96
96
|
return formatNumber(row.integral, lodashGet(integralsPreferences, 'relativeFormat', integralDefaultValues.relativeFormat));
|
|
@@ -99,7 +99,7 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
99
99
|
const value = formatNumber(row.original.integral, lodashGet(integralsPreferences, 'relativeFormat', integralDefaultValues.relativeFormat));
|
|
100
100
|
const flag = checkIntegralKind(row.original);
|
|
101
101
|
const integral = flag ? value : `[ ${value} ]`;
|
|
102
|
-
return (_jsx(EditableColumn, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }
|
|
102
|
+
return (_jsx(EditableColumn, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
], [activeTab, integralsPreferences, saveRelativeHandler]);
|
|
@@ -113,6 +113,6 @@ function IntegralTable({ activeTab, data, preferences }) {
|
|
|
113
113
|
}
|
|
114
114
|
return columns.sort((object1, object2) => object1.index - object2.index);
|
|
115
115
|
}, [COLUMNS, initialColumns, integralsPreferences]);
|
|
116
|
-
return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: tableColumns }
|
|
116
|
+
return data && data.length > 0 ? (_jsx(ReactTable, { data: data, columns: tableColumns })) : (_jsx(NoTableData, {}));
|
|
117
117
|
}
|
|
118
118
|
export default memo(IntegralTable);
|
|
@@ -8,7 +8,6 @@ import FormikForm from '../../elements/formik/FormikForm';
|
|
|
8
8
|
import FormikNumberInput from '../../elements/formik/FormikNumberInput';
|
|
9
9
|
import { useAlert } from '../../elements/popup/Alert';
|
|
10
10
|
import useNucleus from '../../hooks/useNucleus';
|
|
11
|
-
import { SET_PANELS_PREFERENCES } from '../../reducer/preferencesReducer';
|
|
12
11
|
import { getValue as getValueByKeyPath } from '../../utility/LocalStorage';
|
|
13
12
|
import { integralDefaultValues } from '../extra/preferences/defaultValues';
|
|
14
13
|
const styles = {
|
|
@@ -65,7 +64,7 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
65
64
|
const updateValues = useCallback(() => {
|
|
66
65
|
if (nucleus) {
|
|
67
66
|
const { color, strokeWidth, ...restProps } = integralDefaultValues;
|
|
68
|
-
const integralPreferences = getValueByKeyPath(preferences, `formatting.panels.integrals`);
|
|
67
|
+
const integralPreferences = getValueByKeyPath(preferences.current, `formatting.panels.integrals`);
|
|
69
68
|
let defaultValues = nucleus.reduce((acc, nucleusLabel) => {
|
|
70
69
|
acc[nucleusLabel] = restProps;
|
|
71
70
|
return acc;
|
|
@@ -79,7 +78,7 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
79
78
|
}, [updateValues]);
|
|
80
79
|
const saveHandler = useCallback((values) => {
|
|
81
80
|
preferences.dispatch({
|
|
82
|
-
type: SET_PANELS_PREFERENCES,
|
|
81
|
+
type: 'SET_PANELS_PREFERENCES',
|
|
83
82
|
payload: { key: 'integrals', value: values },
|
|
84
83
|
});
|
|
85
84
|
alert.success('Integrals preferences saved successfully');
|
|
@@ -89,14 +88,14 @@ function IntegralsPreferencesInner({ nucleus, preferences, innerRef, }) {
|
|
|
89
88
|
formRef.current.submitForm();
|
|
90
89
|
},
|
|
91
90
|
}));
|
|
92
|
-
return (_jsx("div", { style: styles.container, children: _jsxs(FormikForm, { onSubmit: saveHandler, ref: formRef, children: [_jsxs("div", { style: styles.groupContainer, children: [_jsx("p", { style: styles.header, children: "General" }
|
|
91
|
+
return (_jsx("div", { style: styles.container, children: _jsxs(FormikForm, { onSubmit: saveHandler, ref: formRef, children: [_jsxs("div", { style: styles.groupContainer, children: [_jsx("p", { style: styles.header, children: "General" }), _jsx(FormikColorInput, { name: "color" }), _jsx(FormikNumberInput, { name: "strokeWidth", label: "stroke width :", style: {
|
|
93
92
|
label: { fontSize: '11px', fontWeight: 'bold', color: '#232323' },
|
|
94
93
|
input: {
|
|
95
94
|
width: '60%',
|
|
96
95
|
textAlign: 'center',
|
|
97
96
|
borderRadius: '5px',
|
|
98
97
|
},
|
|
99
|
-
}, min: 1, max: 9, pattern: "[1-9]+" }
|
|
98
|
+
}, min: 1, max: 9, pattern: "[1-9]+" })] }), nucleus?.map((nucleusLabel) => (_jsxs("div", { style: styles.groupContainer, children: [_jsx("p", { style: styles.header, children: _jsx(MF, { mf: nucleusLabel }) }), formatFields.map((field) => (_jsx(FormikColumnFormatField, { label: field.label, checkControllerName: `${nucleusLabel}.${field.checkController}`, formatControllerName: `${nucleusLabel}.${field.formatController}` }, field.id)))] }, nucleusLabel)))] }) }));
|
|
100
99
|
}
|
|
101
100
|
const MemoizedIntegralsPreferences = memo(IntegralsPreferencesInner);
|
|
102
101
|
// TODO: remove this hacky use of ref.
|
|
@@ -106,6 +105,6 @@ function IntegralsPreferences(props, ref) {
|
|
|
106
105
|
return (_jsx(MemoizedIntegralsPreferences, { innerRef: ref, ...{
|
|
107
106
|
nucleus,
|
|
108
107
|
preferences,
|
|
109
|
-
} }
|
|
108
|
+
} }));
|
|
110
109
|
}
|
|
111
110
|
export default forwardRef(IntegralsPreferences);
|
|
@@ -15,7 +15,7 @@ function MatrixGenerationPanel() {
|
|
|
15
15
|
const dispatch = useDispatch();
|
|
16
16
|
const openFiltersModal = useCallback(() => {
|
|
17
17
|
dispatch({ type: RESET_SELECTED_TOOL });
|
|
18
|
-
modal.show(_jsx(MultipleSpectraFiltersModal, {}
|
|
18
|
+
modal.show(_jsx(MultipleSpectraFiltersModal, {}), {
|
|
19
19
|
isBackgroundBlur: false,
|
|
20
20
|
position: positions.TOP_CENTER,
|
|
21
21
|
width: 550,
|
|
@@ -24,12 +24,12 @@ function MatrixGenerationPanel() {
|
|
|
24
24
|
}, [modal, dispatch]);
|
|
25
25
|
const openExportAsMatrixModal = useCallback(() => {
|
|
26
26
|
dispatch({ type: RESET_SELECTED_TOOL });
|
|
27
|
-
modal.show(_jsx(ExportAsMatrixModal, {}
|
|
27
|
+
modal.show(_jsx(ExportAsMatrixModal, {}), {
|
|
28
28
|
isBackgroundBlur: false,
|
|
29
29
|
position: positions.TOP_CENTER,
|
|
30
30
|
width: 500,
|
|
31
31
|
});
|
|
32
32
|
}, [modal, dispatch]);
|
|
33
|
-
return (_jsxs("div", { css: tablePanelStyle, children: [_jsxs(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, children: [_jsx(Button, { popupTitle: "Add Filter", onClick: openFiltersModal, children: _jsx(SvgNmrAddFilter, { style: { fontSize: '18px' } }
|
|
33
|
+
return (_jsxs("div", { css: tablePanelStyle, children: [_jsxs(DefaultPanelHeader, { deleteToolTip: "Delete All Peaks", showSettingButton: true, canDelete: false, children: [_jsx(Button, { popupTitle: "Add Filter", onClick: openFiltersModal, children: _jsx(SvgNmrAddFilter, { style: { fontSize: '18px' } }) }), _jsx(Button, { popupTitle: "Export spectra as a Matrix", onClick: openExportAsMatrixModal, children: _jsx(SvgNmrExportAsMatrix, {}) })] }), _jsx("div", { className: "inner-container" })] }));
|
|
34
34
|
}
|
|
35
35
|
export default MatrixGenerationPanel;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Molecule } from '../../../data/molecules/Molecule';
|
|
3
|
+
import { MoleculeHeaderActionsOptions } from './MoleculePanelHeader';
|
|
4
|
+
interface MoleculePanelProps {
|
|
5
|
+
onMoleculeChange?: (molecule: Molecule) => void;
|
|
6
|
+
children?: ReactElement;
|
|
7
|
+
actionsOptions?: MoleculeHeaderActionsOptions;
|
|
8
|
+
}
|
|
9
|
+
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }: MoleculePanelProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -18,16 +18,21 @@ import useAtomAssignment from './useAtomAssignment';
|
|
|
18
18
|
const styles = {
|
|
19
19
|
panel: css({
|
|
20
20
|
display: 'flex',
|
|
21
|
+
overflow: 'auto',
|
|
21
22
|
flexGrow: 1,
|
|
22
23
|
width: '100%',
|
|
23
24
|
height: '100%',
|
|
24
25
|
flexDirection: 'column',
|
|
25
26
|
}),
|
|
26
|
-
|
|
27
|
+
innerPanel: css({
|
|
27
28
|
display: 'flex',
|
|
28
|
-
flex: '1
|
|
29
|
+
flex: '1',
|
|
29
30
|
flexDirection: 'column',
|
|
30
|
-
|
|
31
|
+
overflow: 'auto',
|
|
32
|
+
}),
|
|
33
|
+
molecule: css({
|
|
34
|
+
display: 'flex',
|
|
35
|
+
flex: '1',
|
|
31
36
|
}),
|
|
32
37
|
toolbar: css({
|
|
33
38
|
display: 'flex',
|
|
@@ -52,7 +57,7 @@ const styles = {
|
|
|
52
57
|
minHeight: 0,
|
|
53
58
|
}),
|
|
54
59
|
};
|
|
55
|
-
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, }) {
|
|
60
|
+
function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab, displayerMode, onMoleculeChange, actionsOptions, children, }) {
|
|
56
61
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
57
62
|
const [molecules, setMolecules] = useState([]);
|
|
58
63
|
const dispatch = useDispatch();
|
|
@@ -68,11 +73,14 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
68
73
|
});
|
|
69
74
|
}
|
|
70
75
|
}, [molecules.length, moleculesProp]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
onMoleculeChange?.(molecules[currentIndex] || null);
|
|
78
|
+
}, [currentIndex, molecules, onMoleculeChange]);
|
|
71
79
|
const handleReplaceMolecule = useCallback((key, molfile) => {
|
|
72
80
|
dispatch({ type: SET_MOLECULE, molfile, key });
|
|
73
81
|
}, [dispatch]);
|
|
74
82
|
const openMoleculeEditorHandler = useCallback((moleclue = null) => {
|
|
75
|
-
modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: moleclue }
|
|
83
|
+
modal.show(_jsx(MoleculeStructureEditorModal, { selectedMolecule: moleclue }), {
|
|
76
84
|
position: positions.TOP_CENTER,
|
|
77
85
|
width: 700,
|
|
78
86
|
height: 500,
|
|
@@ -81,21 +89,21 @@ function MoleculePanelInner({ zones, ranges, molecules: moleculesProp, activeTab
|
|
|
81
89
|
const moleculeIndexHandler = useCallback((index) => {
|
|
82
90
|
setCurrentIndex(index);
|
|
83
91
|
}, []);
|
|
84
|
-
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), onMoleculeIndexChange: moleculeIndexHandler },
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
return (_jsxs("div", { css: styles.panel, children: [_jsx(MoleculePanelHeader, { currentIndex: currentIndex, molecules: molecules, onOpenMoleculeEditor: () => openMoleculeEditorHandler(), onMoleculeIndexChange: moleculeIndexHandler, actionsOptions: actionsOptions }), _jsxs("div", { css: styles.innerPanel, children: [_jsx("div", { css: styles.molecule, children: _jsx(NextPrev, { onChange: (slideIndex) => setCurrentIndex(slideIndex), defaultIndex: currentIndex, children: molecules && molecules.length > 0 ? (molecules.map((mol, index) => (_jsxs("div", { css: styles.items, children: [_jsxs("span", { css: styles.toolbar, children: [_jsx(MF, { mf: mol.mf }), " - ", mol.mw?.toFixed(2)] }), _jsx("div", { css: styles.slider, className: "mol-svg-container", onDoubleClick: () => openMoleculeEditorHandler(mol), style: {
|
|
93
|
+
backgroundColor: (index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
94
|
+
}, children: _jsx(ResponsiveChart, { children: ({ height, width }) => {
|
|
95
|
+
return (_jsx(OCLnmr, { OCL: OCL, id: `molSVG${index}`, width: width, height: height, molfile: mol.molfile || '', setMolfile: (molfile) => handleReplaceMolecule(mol.key, molfile), setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight &&
|
|
96
|
+
currentDiaIDsToHighlight.length > 0
|
|
97
|
+
? 'red'
|
|
98
|
+
: '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight &&
|
|
99
|
+
currentDiaIDsToHighlight.length > 0
|
|
100
|
+
? currentDiaIDsToHighlight
|
|
101
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover }));
|
|
102
|
+
} }) })] }, mol.key)))) : (_jsx("div", { css: styles.slider, style: { height: '100%' }, onClick: () => openMoleculeEditorHandler(), children: _jsx("span", { children: "Click to draw molecule" }) })) }) }), children] })] }));
|
|
95
103
|
}
|
|
96
104
|
const MemoizedMoleculePanel = memo(MoleculePanelInner);
|
|
97
105
|
const emptyData = { ranges: {}, zones: {} };
|
|
98
|
-
export default function MoleculePanel() {
|
|
106
|
+
export default function MoleculePanel({ onMoleculeChange, children, actionsOptions, }) {
|
|
99
107
|
const { molecules, displayerMode, activeTab } = useChartData();
|
|
100
108
|
const data = useSpectrum(emptyData);
|
|
101
109
|
const ranges = data?.ranges || {};
|
|
@@ -106,5 +114,7 @@ export default function MoleculePanel() {
|
|
|
106
114
|
activeTab,
|
|
107
115
|
ranges,
|
|
108
116
|
zones,
|
|
109
|
-
|
|
117
|
+
onMoleculeChange,
|
|
118
|
+
actionsOptions,
|
|
119
|
+
}, children: children }));
|
|
110
120
|
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
export interface MoleculeHeaderActionsOptions {
|
|
2
|
+
hidePast?: boolean;
|
|
3
|
+
hideAdd?: boolean;
|
|
4
|
+
hideExport?: boolean;
|
|
5
|
+
hideDelete?: boolean;
|
|
6
|
+
hidePredict?: boolean;
|
|
7
|
+
}
|
|
1
8
|
interface MoleculePanelHeaderProps {
|
|
2
9
|
currentIndex: number;
|
|
3
10
|
molecules: Array<any>;
|
|
4
11
|
onMoleculeIndexChange: (index: number) => void;
|
|
5
12
|
onOpenMoleculeEditor: () => void;
|
|
13
|
+
actionsOptions?: MoleculeHeaderActionsOptions;
|
|
6
14
|
}
|
|
7
|
-
export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange, onOpenMoleculeEditor, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange, onOpenMoleculeEditor, actionsOptions, }: MoleculePanelHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
16
|
export {};
|
|
@@ -41,21 +41,21 @@ const toolbarStyle = css `
|
|
|
41
41
|
const MOL_EXPORT_MENU = [
|
|
42
42
|
{
|
|
43
43
|
id: 'molfile',
|
|
44
|
-
icon: _jsx(FaCopy, {}
|
|
44
|
+
icon: _jsx(FaCopy, {}),
|
|
45
45
|
label: 'Copy as molfile',
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
id: 'png',
|
|
49
|
-
icon: _jsx(FaFileImage, {}
|
|
49
|
+
icon: _jsx(FaFileImage, {}),
|
|
50
50
|
label: 'Copy as PNG',
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
id: 'svg',
|
|
54
|
-
icon: _jsx(FaDownload, {}
|
|
54
|
+
icon: _jsx(FaDownload, {}),
|
|
55
55
|
label: 'Export as SVG',
|
|
56
56
|
},
|
|
57
57
|
];
|
|
58
|
-
export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, }) {
|
|
58
|
+
export default function MoleculePanelHeader({ currentIndex, molecules, onMoleculeIndexChange = () => null, onOpenMoleculeEditor = () => null, actionsOptions = {}, }) {
|
|
59
59
|
const alert = useAlert();
|
|
60
60
|
const dispatch = useDispatch();
|
|
61
61
|
const modal = useModal();
|
|
@@ -115,13 +115,13 @@ export default function MoleculePanelHeader({ currentIndex, molecules, onMolecul
|
|
|
115
115
|
assignmentData,
|
|
116
116
|
]);
|
|
117
117
|
const openPredictSpectraModal = useCallback(() => {
|
|
118
|
-
modal.show(_jsx(PredictSpectraModal, { molfile: molecules[currentIndex] }
|
|
118
|
+
modal.show(_jsx(PredictSpectraModal, { molfile: molecules[currentIndex] }), {
|
|
119
119
|
position: positions.TOP_CENTER,
|
|
120
120
|
enableResizing: true,
|
|
121
121
|
width: 600,
|
|
122
122
|
});
|
|
123
123
|
}, [modal, molecules, currentIndex]);
|
|
124
|
-
return (_jsxs("div", { css: toolbarStyle, children: [_jsx(MenuButton, { component: _jsx(FaFileExport, {}
|
|
124
|
+
return (_jsxs("div", { css: toolbarStyle, children: [!actionsOptions.hideExport && (_jsx(MenuButton, { component: _jsx(FaFileExport, {}), toolTip: "Export As", items: MOL_EXPORT_MENU, onClick: exportHandler })), !actionsOptions.hidePast && (_jsx(ToolTip, { title: "Paste molfile", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handlePaste, children: _jsx(FaPaste, {}) }) })), !actionsOptions.hideAdd && (_jsx(ToolTip, { title: "Add Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: onOpenMoleculeEditor, "data-test-id": "panel-structures-button-add", children: _jsx(FaPlus, {}) }) })), !actionsOptions.hideDelete && (_jsx(ToolTip, { title: "Delete Molecule", popupPlacement: "left", children: _jsx("button", { className: "bar-button", type: "button", onClick: handleDelete, children: _jsx(FaRegTrashAlt, {}) }) })), !actionsOptions.hidePredict && molecules && molecules.length > 0 && (_jsx(ButtonToolTip, { popupTitle: "Predict Spectra", popupPlacement: "left", onClick: openPredictSpectraModal, children: _jsx(SvgNmrFt, {}) })), _jsxs("p", { children: [molecules &&
|
|
125
125
|
molecules.length > 0 &&
|
|
126
|
-
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] }
|
|
126
|
+
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] })] }));
|
|
127
127
|
}
|