nmrium 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/FooterBanner.js +5 -4
- package/lib/component/1d/Viewer1D.js +121 -104
- package/lib/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib/component/1d/jCouplingGraph/JGraphContext.d.ts +1 -1
- package/lib/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.d.ts +1 -1
- package/lib/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +7 -4
- package/lib/component/1d/tool/PeakPointer.js +1 -1
- package/lib/component/1d/utilities/scale.js +1 -3
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib/component/2d/FooterBanner.js +3 -2
- package/lib/component/2d/Viewer2D.js +51 -29
- package/lib/component/2d/XAxis.js +1 -1
- package/lib/component/2d/YAxis.js +1 -1
- package/lib/component/2d/utilities/SliceScale.d.ts +2 -2
- package/lib/component/2d/utilities/scale.d.ts +5 -5
- package/lib/component/2d/zones/Signal.js +1 -2
- package/lib/component/EventsTrackers/BrushTracker.d.ts +4 -1
- package/lib/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib/component/NMRium.d.ts +2 -2
- package/lib/component/NMRium.js +39 -26
- package/lib/component/assignment/AssignmentsReducer.d.ts +1 -1
- package/lib/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib/component/context/LoggerContext.js +11 -6
- package/lib/component/elements/InputRange.js +1 -1
- package/lib/component/elements/MenuButton.d.ts +1 -1
- package/lib/component/elements/MoleculeSelection.d.ts +1 -1
- package/lib/component/elements/ReactTable/ReactTable.d.ts +1 -1
- package/lib/component/elements/Tab/DeleteButton.d.ts +1 -1
- package/lib/component/elements/ToolbarMenu.d.ts +1 -1
- package/lib/component/elements/accordion/Accordion.d.ts +1 -1
- package/lib/component/elements/draggable/SVGDraggable.d.ts +1 -1
- package/lib/component/elements/draggable/useDraggable.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts +1 -1
- package/lib/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib/component/elements/formik/SelectBox.d.ts +1 -1
- package/lib/component/elements/popup/Alert/AlertBlock.d.ts +8 -0
- package/lib/component/elements/popup/Alert/AlertBlock.js +30 -0
- package/lib/component/elements/popup/Alert/Context.d.ts +26 -2
- package/lib/component/elements/popup/Alert/Context.js +6 -2
- package/lib/component/elements/popup/Alert/Provider.d.ts +4 -3
- package/lib/component/elements/popup/Alert/Provider.js +5 -23
- package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +2 -1
- package/lib/component/elements/popup/Modal/Provider.js +3 -1
- package/lib/component/elements/popup/options.d.ts +22 -19
- package/lib/component/elements/resizer/Resizer.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.d.ts +2 -2
- package/lib/component/elements/toggle/ToggleButton.js +1 -1
- package/lib/component/header/Header.js +2 -2
- package/lib/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib/component/highlight/index.d.ts +1 -1
- package/lib/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib/component/hooks/useExport.js +2 -1
- package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
- package/lib/component/hooks/usePanelPreferences.js +2 -2
- package/lib/component/hooks/useXScale.d.ts +1 -1
- package/lib/component/hooks/useXYReduce.d.ts +2 -2
- package/lib/component/modal/AboutSpectrumSimulationModal.d.ts +2 -0
- package/lib/component/modal/AboutSpectrumSimulationModal.js +49 -0
- package/lib/component/modal/AboutUsModal.js +4 -2
- package/lib/component/modal/AlignSpectraModal.js +11 -1
- package/lib/component/modal/LogsHistoryModal.d.ts +6 -0
- package/lib/component/{header/LogsHistory.js → modal/LogsHistoryModal.js} +6 -4
- package/lib/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib/component/modal/PredictSpectraModal.d.ts +1 -2
- package/lib/component/modal/PredictSpectraModal.js +25 -28
- package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib/component/modal/editZone/SignalsForm.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +28 -27
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +19 -19
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -13
- package/lib/component/panels/Panels.js +13 -0
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +9 -15
- package/lib/component/panels/RangesPanel/RangesPanel.js +7 -10
- package/lib/component/panels/SpectrumsPanel/SpectraTable.js +8 -11
- package/lib/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +2 -2
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.d.ts +1 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +88 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.d.ts +11 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +37 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.d.ts +4 -0
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +25 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts +5 -0
- package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +60 -0
- package/lib/component/reducer/Reducer.d.ts +13 -12
- package/lib/component/reducer/Reducer.js +251 -239
- package/lib/component/reducer/actions/AssignmentsActions.d.ts +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
- package/lib/component/reducer/actions/DomainActions.js +30 -1
- package/lib/component/reducer/actions/FiltersActions.js +4 -4
- package/lib/component/reducer/actions/LoadActions.js +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +2 -0
- package/lib/component/reducer/actions/MoleculeActions.js +51 -2
- package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -2
- package/lib/component/reducer/actions/SpectrumsActions.js +43 -4
- package/lib/component/reducer/actions/ToolsActions.js +2 -2
- package/lib/component/reducer/actions/ZonesActions.js +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +4 -6
- package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +4 -4
- package/lib/component/utility/export.d.ts +5 -4
- package/lib/component/utility/export.js +33 -61
- package/lib/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib/component/utility/getUniqueNuclei.js +1 -1
- package/lib/component/utility/jpathToArray.js +1 -1
- package/lib/component/workspaces/index.d.ts +1 -0
- package/lib/component/workspaces/index.js +2 -0
- package/lib/component/workspaces/simulation.d.ts +2 -0
- package/lib/component/workspaces/simulation.js +68 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib/data/PredictionManager.d.ts +8 -7
- package/lib/data/PredictionManager.js +95 -22
- package/lib/data/SpectraManager.js +1 -1
- package/lib/data/constants/DefaultPathLengths.d.ts +1 -3
- package/lib/data/constants/SignalsKinds.d.ts +2 -2
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib/data/data1d/database.d.ts +5 -5
- package/lib/data/data1d/database.js +3 -3
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib/data/data1d/spectrumSimulation.d.ts +14 -0
- package/lib/data/data1d/spectrumSimulation.js +53 -0
- package/lib/data/data2d/Spectrum2D/contours.d.ts +8 -4
- package/lib/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib/data/getDefaultMatrixFilters.d.ts +2 -2
- package/lib/data/matrixGeneration.js +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +1 -1
- package/lib/data/molecules/MoleculeManager.js +7 -7
- package/lib/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib/data/types/data1d/MatrixOptions.d.ts +2 -2
- package/lib/data/utilities/FindUtilities.js +4 -4
- package/lib/data/utilities/RangeUtilities.d.ts +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts +1 -1
- package/lib/data/utilities/calculateSanPlot.js +3 -3
- package/lib/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib/utils/clipboard/clipboard.d.ts +12 -0
- package/lib/utils/clipboard/clipboard.js +15 -0
- package/lib/utils/clipboard/clipboardComponents.d.ts +45 -0
- package/lib/utils/clipboard/clipboardComponents.js +150 -0
- package/lib/utils/clipboard/clipboardHooks.d.ts +94 -0
- package/lib/utils/clipboard/clipboardHooks.js +142 -0
- package/lib/utils/clipboard/types.d.ts +1 -0
- package/lib/utils/clipboard/types.js +1 -0
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/FooterBanner.js +5 -4
- package/lib-cjs/component/1d/Viewer1D.js +120 -103
- package/lib-cjs/component/1d/database/ResurrectedDatabaseRanges.js +1 -1
- package/lib-cjs/component/1d/jCouplingGraph/JsCouplingLinks.js +1 -1
- package/lib-cjs/component/1d/multiplicityTree/TreeColors.js +1 -6
- package/lib-cjs/component/1d/tool/BaseLineZones.js +6 -3
- package/lib-cjs/component/1d/tool/PeakPointer.js +1 -1
- package/lib-cjs/component/1d/utilities/scale.js +1 -3
- package/lib-cjs/component/1d-2d/tools/BrushXY.js +10 -7
- package/lib-cjs/component/1d-2d/tools/CrossLinePointer.js +1 -1
- package/lib-cjs/component/2d/FooterBanner.js +3 -2
- package/lib-cjs/component/2d/Viewer2D.js +50 -28
- package/lib-cjs/component/2d/XAxis.js +1 -1
- package/lib-cjs/component/2d/YAxis.js +1 -1
- package/lib-cjs/component/2d/zones/Signal.js +1 -2
- package/lib-cjs/component/EventsTrackers/BrushTracker.js +21 -6
- package/lib-cjs/component/NMRium.js +37 -24
- package/lib-cjs/component/assignment/actions/setActiveAssignment.js +1 -1
- package/lib-cjs/component/context/LoggerContext.js +10 -5
- package/lib-cjs/component/elements/InputRange.js +1 -1
- package/lib-cjs/component/elements/dropDownButton/DropDownList.js +3 -1
- package/lib-cjs/component/elements/popup/Alert/AlertBlock.js +36 -0
- package/lib-cjs/component/elements/popup/Alert/Context.js +6 -2
- package/lib-cjs/component/elements/popup/Alert/Provider.js +4 -22
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +2 -1
- package/lib-cjs/component/elements/popup/Modal/Provider.js +3 -1
- package/lib-cjs/component/header/Header.js +2 -2
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +3 -8
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +2 -2
- package/lib-cjs/component/hooks/useExport.js +2 -1
- package/lib-cjs/component/hooks/usePanelPreferences.js +1 -1
- package/lib-cjs/component/modal/AboutSpectrumSimulationModal.js +54 -0
- package/lib-cjs/component/modal/AboutUsModal.js +4 -2
- package/lib-cjs/component/modal/AlignSpectraModal.js +11 -1
- package/lib-cjs/component/{header/LogsHistory.js → modal/LogsHistoryModal.js} +8 -6
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +2 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +24 -27
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +1 -1
- package/lib-cjs/component/modal/editRange/forms/components/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/editZone/SignalsForm.js +1 -1
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +28 -27
- package/lib-cjs/component/modal/setting/settings-tabs/DisplayTabContent.js +4 -0
- package/lib-cjs/component/modal/setting/settings-tabs/FormattingTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +2 -2
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +4 -7
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +18 -18
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +3 -5
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -13
- package/lib-cjs/component/panels/Panels.js +13 -0
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +9 -15
- package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +7 -10
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraTable.js +8 -11
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/SpectrumSetting.js +3 -1
- package/lib-cjs/component/panels/SpectrumsPanel/base/setting/processSnapPlot.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib-cjs/component/panels/extra/utilities/MultiplicityUtilities.js +2 -2
- package/lib-cjs/component/panels/extra/utilities/UseToggleStatus.js +1 -1
- package/lib-cjs/component/panels/filtersPanel/FiltersTable.js +2 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionOptionsPanel.js +2 -1
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -2
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +94 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationPreferences.js +42 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +31 -0
- package/lib-cjs/component/panels/spectrumSimulation/SpinSystemTable.js +67 -0
- package/lib-cjs/component/reducer/Reducer.js +251 -239
- package/lib-cjs/component/reducer/actions/AssignmentsActions.js +1 -1
- package/lib-cjs/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib-cjs/component/reducer/actions/DomainActions.js +31 -1
- package/lib-cjs/component/reducer/actions/FiltersActions.js +4 -4
- package/lib-cjs/component/reducer/actions/LoadActions.js +1 -1
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +54 -2
- package/lib-cjs/component/reducer/actions/SpectrumsActions.js +43 -3
- package/lib-cjs/component/reducer/actions/ToolsActions.js +2 -2
- package/lib-cjs/component/reducer/actions/ZonesActions.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setActiveWorkspace.js +1 -1
- package/lib-cjs/component/reducer/preferences/actions/setPreferences.js +3 -4
- package/lib-cjs/component/reducer/preferences/preferencesReducer.js +5 -1
- package/lib-cjs/component/reducer/preferences/utilities/flatObject.js +1 -1
- package/lib-cjs/component/utility/export.js +33 -63
- package/lib-cjs/component/utility/getSpectraObjectPaths.js +1 -1
- package/lib-cjs/component/utility/getUniqueNuclei.js +1 -1
- package/lib-cjs/component/utility/jpathToArray.js +1 -1
- package/lib-cjs/component/workspaces/index.js +2 -0
- package/lib-cjs/component/workspaces/simulation.js +71 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +1 -0
- package/lib-cjs/data/PredictionManager.js +96 -22
- package/lib-cjs/data/SpectraManager.js +1 -1
- package/lib-cjs/data/data1d/Spectrum1D/generateJGraphData.js +3 -3
- package/lib-cjs/data/data1d/Spectrum1D/getReferenceShift.js +5 -4
- package/lib-cjs/data/data1d/Spectrum1D/integrals/changeIntegralsRelative.js +12 -13
- package/lib-cjs/data/data1d/Spectrum1D/ranges/changeRangeRelativeValue.js +10 -9
- package/lib-cjs/data/data1d/database.js +3 -3
- package/lib-cjs/data/data1d/multipleSpectraAnalysis.js +1 -1
- package/lib-cjs/data/data1d/spectrumSimulation.js +58 -0
- package/lib-cjs/data/data2d/Spectrum2D/contours.js +7 -1
- package/lib-cjs/data/data2d/Spectrum2D/getMissingProjection.js +6 -6
- package/lib-cjs/data/data2d/Spectrum2D/getShift.js +1 -1
- package/lib-cjs/data/data2d/Spectrum2D/getSlice.js +4 -4
- package/lib-cjs/data/data2d/Spectrum2D/zones/getDetectionZones.js +5 -5
- package/lib-cjs/data/matrixGeneration.js +1 -1
- package/lib-cjs/data/molecules/MoleculeManager.js +7 -7
- package/lib-cjs/data/parseMeta/linkMetaWithSpectra.js +2 -1
- package/lib-cjs/data/utilities/FindUtilities.js +4 -4
- package/lib-cjs/data/utilities/calculateSanPlot.js +3 -3
- package/lib-cjs/data/utilities/generateNumbersPowerOfX.js +1 -1
- package/lib-cjs/utils/clipboard/clipboard.js +23 -0
- package/lib-cjs/utils/clipboard/clipboardComponents.js +158 -0
- package/lib-cjs/utils/clipboard/clipboardHooks.js +147 -0
- package/lib-cjs/utils/clipboard/types.js +2 -0
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +26 -25
- package/lib/component/header/LogsHistory.d.ts +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
7
|
+
/** @jsxImportSource @emotion/react */
|
|
8
|
+
const react_1 = require("@emotion/react");
|
|
9
|
+
const fa_1 = require("react-icons/fa");
|
|
10
|
+
const ui_1 = require("react-science/ui");
|
|
11
|
+
const Button_1 = __importDefault(require("../elements/Button"));
|
|
12
|
+
const styles = (0, react_1.css) `
|
|
13
|
+
width: 600px;
|
|
14
|
+
|
|
15
|
+
.content {
|
|
16
|
+
padding: 2em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ul {
|
|
20
|
+
list-style-type: disc;
|
|
21
|
+
margin-left: 25px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
p,
|
|
25
|
+
li {
|
|
26
|
+
user-select: text;
|
|
27
|
+
font-size: 1.1em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
a {
|
|
31
|
+
color: #00bcd4;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
a:hover,
|
|
35
|
+
a:focus {
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.header span {
|
|
40
|
+
color: #464646;
|
|
41
|
+
font-size: 15px;
|
|
42
|
+
flex: 1;
|
|
43
|
+
user-select: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
p {
|
|
47
|
+
padding: 0.8em 0;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
function AboutSpectrumSimulationModal() {
|
|
51
|
+
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(false);
|
|
52
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: (0, jsx_runtime_1.jsx)(fa_1.FaInfo, {}) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: (0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header", children: (0, jsx_runtime_1.jsx)("span", { children: "About spectrum simulation" }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [(0, jsx_runtime_1.jsx)("p", { children: "If you are using our tools please cite us:" }), (0, jsx_runtime_1.jsx)("ul", { children: (0, jsx_runtime_1.jsxs)("li", { children: ["Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems. Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist Journal of Magnetic Resonance 2011.", (0, jsx_runtime_1.jsx)("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "10.1016/j.jmr.2010.12.008" })] }) })] }) })] }) })] }));
|
|
53
|
+
}
|
|
54
|
+
exports.default = AboutSpectrumSimulationModal;
|
|
@@ -11,6 +11,9 @@ const ui_1 = require("react-science/ui");
|
|
|
11
11
|
const versionInfo_1 = __importDefault(require("../../versionInfo"));
|
|
12
12
|
const Logo_1 = __importDefault(require("../elements/Logo"));
|
|
13
13
|
const styles = (0, react_1.css) `
|
|
14
|
+
width: 40vw;
|
|
15
|
+
min-width: 500px;
|
|
16
|
+
|
|
14
17
|
button:focus {
|
|
15
18
|
outline: none;
|
|
16
19
|
}
|
|
@@ -87,7 +90,6 @@ const styles = (0, react_1.css) `
|
|
|
87
90
|
display: flex;
|
|
88
91
|
flex-direction: column;
|
|
89
92
|
user-select: none;
|
|
90
|
-
width: 500px;
|
|
91
93
|
`;
|
|
92
94
|
function AboutUsModal() {
|
|
93
95
|
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(false);
|
|
@@ -95,7 +97,7 @@ function AboutUsModal() {
|
|
|
95
97
|
display: 'flex',
|
|
96
98
|
alignItems: 'center',
|
|
97
99
|
justifyContent: 'center',
|
|
98
|
-
}, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgLogoNmrium, {}) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: (0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header", children: (0, jsx_runtime_1.jsx)("span", { children: "About NMRium" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "container", children: [(0, jsx_runtime_1.jsxs)("div", { className: "center-container", children: [(0, jsx_runtime_1.jsx)(Logo_1.default, { width: 160, height: 50 }), "Version ", (0, jsx_runtime_1.jsx)(VersionInfo, {}), (0, jsx_runtime_1.jsx)("span", { className: "separator" }), (0, jsx_runtime_1.jsx)("a", { href: "https://git.nmrium.org", target: "_blank", rel: "noreferrer", children: "GitHub ( https://git.nmrium.org )" })] }), (0, jsx_runtime_1.jsx)("div", { className: "center-container", children: (0, jsx_runtime_1.jsx)("span", { className: "separator" }) }), (0, jsx_runtime_1.jsx)("span", { className: "content", children: "This project is developed by Zakodium S\u00E0rl (Switzerland), the University of Cologne (Germany), Johannes Gutenberg University Mainz (Germany) and Universidad del Valle (Colombia)." }), (0, jsx_runtime_1.jsxs)("div", { className: "center-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "separator" }), (0, jsx_runtime_1.jsx)("span", { className: "title", children: "Funding is provided by" }), (0, jsx_runtime_1.jsx)("span", { className: "separator" })] }), (0, jsx_runtime_1.jsx)("div", { className: "content", children: (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "IDNMR grant, which part of the Scientific Library Services and Information Systems (LIS) initiative of the DFG." }), (0, jsx_runtime_1.jsx)("li", { children: "Zakodium S\u00E0rl (Switzerland)." }), (0, jsx_runtime_1.jsx)("li", { children: "Universidad del Valle (Cali, Colombia)." })] }) })] })] }) })] }));
|
|
100
|
+
}, children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgLogoNmrium, {}) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: (0, jsx_runtime_1.jsxs)("div", { css: styles, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header", children: (0, jsx_runtime_1.jsx)("span", { children: "About NMRium" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "container", children: [(0, jsx_runtime_1.jsxs)("div", { className: "center-container", children: [(0, jsx_runtime_1.jsx)(Logo_1.default, { width: 160, height: 50 }), "Version ", (0, jsx_runtime_1.jsx)(VersionInfo, {}), (0, jsx_runtime_1.jsx)("span", { className: "separator" }), (0, jsx_runtime_1.jsx)("a", { href: "https://git.nmrium.org", target: "_blank", rel: "noreferrer", children: "GitHub ( https://git.nmrium.org )" })] }), (0, jsx_runtime_1.jsx)("div", { className: "center-container", children: (0, jsx_runtime_1.jsx)("span", { className: "separator" }) }), (0, jsx_runtime_1.jsx)("span", { className: "content", children: "This project is developed by Zakodium S\u00E0rl (Switzerland), the University of Cologne (Germany), Johannes Gutenberg University Mainz (Germany) and Universidad del Valle (Colombia)." }), (0, jsx_runtime_1.jsxs)("div", { className: "center-container", children: [(0, jsx_runtime_1.jsx)("span", { className: "separator" }), (0, jsx_runtime_1.jsx)("span", { className: "title", children: "Funding is provided by" }), (0, jsx_runtime_1.jsx)("span", { className: "separator" })] }), (0, jsx_runtime_1.jsx)("div", { className: "content", children: (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "IDNMR grant, which part of the Scientific Library Services and Information Systems (LIS) initiative of the DFG." }), (0, jsx_runtime_1.jsx)("li", { children: "Zakodium S\u00E0rl (Switzerland)." }), (0, jsx_runtime_1.jsx)("li", { children: "Universidad del Valle (Cali, Colombia)." })] }) })] })] }) })] }));
|
|
99
101
|
}
|
|
100
102
|
exports.default = AboutUsModal;
|
|
101
103
|
function VersionInfo() {
|
|
@@ -16,6 +16,16 @@ const Select_1 = __importDefault(require("../elements/Select"));
|
|
|
16
16
|
const FormikInput_1 = __importDefault(require("../elements/formik/FormikInput"));
|
|
17
17
|
const Events_1 = __importDefault(require("../utility/Events"));
|
|
18
18
|
const ModalStyle_1 = require("./ModalStyle");
|
|
19
|
+
const labelStyle = {
|
|
20
|
+
label: { flex: 4, fontWeight: '500' },
|
|
21
|
+
wrapper: { flex: 8, display: 'flex', alignItems: 'center' },
|
|
22
|
+
container: { padding: '5px 0' },
|
|
23
|
+
};
|
|
24
|
+
const inputStyle = {
|
|
25
|
+
input: {
|
|
26
|
+
padding: '5px',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
19
29
|
const baseList = [{ key: 1, value: 'manual', label: 'Manual' }];
|
|
20
30
|
function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
21
31
|
const refForm = (0, react_1.useRef)();
|
|
@@ -55,6 +65,6 @@ function AlignSpectraModal({ onClose = () => null, nucleus, }) {
|
|
|
55
65
|
...resValues,
|
|
56
66
|
});
|
|
57
67
|
}, [nucleus]);
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)("div", { css: ModalStyle_1.ModalStyles, children: [(0, jsx_runtime_1.jsxs)("div", { className: "header handle", children: [(0, jsx_runtime_1.jsx)("span", { children: "Spectra calibration" }), (0, jsx_runtime_1.jsx)(CloseButton_1.default, { onClick: onClose, className: "close-bt" })] }), (0, jsx_runtime_1.jsx)("div", { className: "inner-content", style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { innerRef: refForm, initialValues: { from: -1, to: 1, nbPeaks: 1, targetX: 0 }, onSubmit: submitHandler, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Options", style: labelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: List, style: { width: '100%', height: 30 }, onChange: optionChangeHandler }) }), (0, jsx_runtime_1.jsxs)(Label_1.default, { title: "Range", style: labelStyle, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "From", children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "from", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "To", style: { label: { padding: '0 10px' } }, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "to", type: "number", style: inputStyle }) })] }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Number of Peaks", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "nbPeaks", type: "number", style: inputStyle }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Target PPM", style: labelStyle, children: (0, jsx_runtime_1.jsx)(FormikInput_1.default, { name: "targetX", type: "number", style: inputStyle }) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, children: "Done" }) })] }));
|
|
59
69
|
}
|
|
60
70
|
exports.default = AlignSpectraModal;
|
|
@@ -3,7 +3,7 @@ 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.LogsHistoryModal = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const fa_1 = require("react-icons/fa");
|
|
@@ -53,9 +53,10 @@ function getMaxLevelLogs(logs, lastReadLogId) {
|
|
|
53
53
|
}
|
|
54
54
|
return { backgroundColor, count: logsCounts[maxLevel] };
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function LogsHistoryModal(props) {
|
|
57
|
+
const { autoOpen = false, onClose } = props;
|
|
57
58
|
const { logsHistory, logger, markAsRead, lastReadLogId } = (0, LoggerContext_1.useLogger)();
|
|
58
|
-
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(
|
|
59
|
+
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(autoOpen);
|
|
59
60
|
const { count, backgroundColor } = getMaxLevelLogs(logsHistory, lastReadLogId);
|
|
60
61
|
const COLUMNS = (0, react_1.useMemo)(() => [
|
|
61
62
|
{
|
|
@@ -94,7 +95,7 @@ function LogsHistory() {
|
|
|
94
95
|
},
|
|
95
96
|
], [lastReadLogId]);
|
|
96
97
|
const sortedLogs = logsHistory.slice().sort((a, b) => b.time - a.time);
|
|
97
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: () => {
|
|
98
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!autoOpen && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: () => {
|
|
98
99
|
openDialog();
|
|
99
100
|
}, children: (0, jsx_runtime_1.jsxs)("div", { style: { position: 'relative' }, children: [(0, jsx_runtime_1.jsx)(io5_1.IoBugOutline, { fontSize: "1.4em" }), count && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
100
101
|
position: 'absolute',
|
|
@@ -105,9 +106,10 @@ function LogsHistory() {
|
|
|
105
106
|
minWidth: '14px',
|
|
106
107
|
fontSize: '0.75em',
|
|
107
108
|
color: 'white',
|
|
108
|
-
}, children: count }))] }) }), (0, jsx_runtime_1.jsxs)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
|
|
109
|
+
}, children: count }))] }) })), (0, jsx_runtime_1.jsxs)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
|
|
109
110
|
markAsRead();
|
|
110
111
|
closeDialog();
|
|
112
|
+
onClose?.();
|
|
111
113
|
}, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: "Logs History " }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsx)("div", { style: { width: '50vw', height: '50vh', padding: '0.5em' }, children: (0, jsx_runtime_1.jsx)(ReactTable_1.default, { columns: COLUMNS, data: sortedLogs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Footer, { children: (0, jsx_runtime_1.jsx)(Button_1.default.Danger, { onClick: () => logger.clear(), fill: "outline", children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}), (0, jsx_runtime_1.jsx)("span", { style: { paddingLeft: '5px' }, children: "Clear Logs" })] }) }) })] })] }));
|
|
112
114
|
}
|
|
113
|
-
exports.
|
|
115
|
+
exports.LogsHistoryModal = LogsHistoryModal;
|
|
@@ -156,7 +156,8 @@ function MultipletAnalysisModal({ data, activeSpectrum, scaleX, startX, endX, on
|
|
|
156
156
|
return (
|
|
157
157
|
// eslint-disable-next-line react/no-array-index-key
|
|
158
158
|
(0, jsx_runtime_1.jsxs)("div", { className: "row", children: [(0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: 400, height: 200, svgStyle: { overflow: 'visible' }, seriesViewportStyle: { stroke: 'black' }, children: [(0, jsx_runtime_1.jsx)(react_plot_1.LineSeries, { data: (0, ml_spectra_processing_1.xyToXYObject)(d.multiplet) }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "y", position: "left", tickPosition: "inner", displayPrimaryGridLines: true, hiddenTicks: true, paddingStart: 0.1, paddingEnd: 0.1 }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "x", position: "bottom", tickPosition: "inner", displayPrimaryGridLines: true })] }), (0, jsx_runtime_1.jsx)("div", { className: "multiplicity", children: (0, jsx_runtime_1.jsx)("p", { children: analysisData.js[index]
|
|
159
|
-
? `${analysisData.js[index]
|
|
159
|
+
? `${analysisData.js[index]
|
|
160
|
+
?.multiplicity}: ${analysisData.js[index]?.coupling.toFixed(3)} Hz`
|
|
160
161
|
: '' }) }), (0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: 400, height: 200, seriesViewportStyle: { stroke: 'black' }, children: [(0, jsx_runtime_1.jsx)(react_plot_1.LineSeries, { data: (0, ml_spectra_processing_1.xyToXYObject)(d.errorFunction), lineStyle: { strokeWidth: 1 } }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "y", position: "left", tickPosition: "inner", displayPrimaryGridLines: true, hiddenTicks: true, paddingStart: 0.1, paddingEnd: 0.1 }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { id: "x", position: "bottom", tickPosition: "inner", displayPrimaryGridLines: true })] })] }, index));
|
|
161
162
|
}) })] }));
|
|
162
163
|
}
|
|
@@ -3,21 +3,19 @@ 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.PredictSpectraModal = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
8
8
|
/** @jsxImportSource @emotion/react */
|
|
9
9
|
const react_1 = require("@emotion/react");
|
|
10
|
+
const cheminfo_font_1 = require("cheminfo-font");
|
|
10
11
|
const react_2 = require("react");
|
|
12
|
+
const ui_1 = require("react-science/ui");
|
|
11
13
|
const PredictionManager_1 = require("../../data/PredictionManager");
|
|
12
14
|
const ChartContext_1 = require("../context/ChartContext");
|
|
13
15
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
14
16
|
const LoggerContext_1 = require("../context/LoggerContext");
|
|
15
17
|
const Button_1 = __importDefault(require("../elements/Button"));
|
|
16
|
-
const CheckBox_1 = __importDefault(require("../elements/CheckBox"));
|
|
17
|
-
const CloseButton_1 = __importDefault(require("../elements/CloseButton"));
|
|
18
18
|
const Alert_1 = require("../elements/popup/Alert");
|
|
19
|
-
const Modal_1 = require("../elements/popup/Modal");
|
|
20
|
-
const options_1 = require("../elements/popup/options");
|
|
21
19
|
const PredictionOptionsPanel_1 = __importDefault(require("../panels/predictionPanel/PredictionOptionsPanel"));
|
|
22
20
|
const LocalStorage_1 = require("../utility/LocalStorage");
|
|
23
21
|
const ModalStyle_1 = require("./ModalStyle");
|
|
@@ -42,24 +40,30 @@ const styles = (0, react_1.css) `
|
|
|
42
40
|
margin: 5px 5px 5px 0;
|
|
43
41
|
}
|
|
44
42
|
}
|
|
43
|
+
|
|
44
|
+
.header {
|
|
45
|
+
padding: 0;
|
|
46
|
+
margin: 0 30%;
|
|
47
|
+
width: 40%;
|
|
48
|
+
}
|
|
45
49
|
`;
|
|
46
50
|
function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
51
|
+
const [isOpenDialog, openDialog, closeDialog] = (0, ui_1.useOnOff)(false);
|
|
47
52
|
const refForm = (0, react_2.useRef)();
|
|
48
53
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
49
54
|
const alert = (0, Alert_1.useAlert)();
|
|
50
|
-
const [isApproved, setApproved] = (0, react_2.useState)(false);
|
|
51
55
|
const [predictionPreferences, setPredictionPreferences] = (0, LocalStorage_1.useStateWithLocalStorage)('nmrium-prediction-preferences');
|
|
56
|
+
const { isApproved: isAgree = false, ...options } = predictionPreferences;
|
|
57
|
+
const [isApproved, setApproved] = (0, react_2.useState)(isAgree);
|
|
52
58
|
const { toolOptions: { data: { predictionIndex }, }, } = (0, ChartContext_1.useChartData)();
|
|
53
59
|
const handleSave = (0, react_2.useCallback)(() => {
|
|
54
60
|
refForm.current.submitForm();
|
|
55
61
|
}, []);
|
|
56
62
|
const initValues = (0, react_2.useMemo)(() => {
|
|
57
|
-
|
|
58
|
-
setApproved(isAgree);
|
|
59
|
-
return Object.assign(PredictionManager_1.defaultPredictionOptions, options, {
|
|
63
|
+
return Object.assign((0, PredictionManager_1.getDefaultPredictionOptions)(), options, {
|
|
60
64
|
name: `Prediction ${predictionIndex + 1}`,
|
|
61
65
|
});
|
|
62
|
-
}, [
|
|
66
|
+
}, [options, predictionIndex]);
|
|
63
67
|
const { logger } = (0, LoggerContext_1.useLogger)();
|
|
64
68
|
const submitHandler = (0, react_2.useCallback)((values) => {
|
|
65
69
|
void (async () => {
|
|
@@ -72,12 +76,15 @@ function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
72
76
|
predictedSpectra.push(key);
|
|
73
77
|
}
|
|
74
78
|
}
|
|
79
|
+
onClose();
|
|
80
|
+
closeDialog();
|
|
75
81
|
const hideLoading = await alert.showLoading(`Predict ${predictedSpectra.join(',')} in progress`);
|
|
76
82
|
try {
|
|
77
|
-
const data = await (0, PredictionManager_1.predictSpectra)(molfile
|
|
83
|
+
const data = await (0, PredictionManager_1.predictSpectra)(molfile);
|
|
78
84
|
dispatch({
|
|
79
85
|
type: 'PREDICT_SPECTRA',
|
|
80
86
|
payload: {
|
|
87
|
+
logger,
|
|
81
88
|
predictedSpectra: data.spectra,
|
|
82
89
|
options: values,
|
|
83
90
|
molecule,
|
|
@@ -89,7 +96,6 @@ function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
89
96
|
}
|
|
90
97
|
finally {
|
|
91
98
|
hideLoading();
|
|
92
|
-
onClose();
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
})();
|
|
@@ -101,21 +107,12 @@ function PredictSpectraModal({ onClose = () => null, molecule, }) {
|
|
|
101
107
|
onClose,
|
|
102
108
|
logger,
|
|
103
109
|
setPredictionPreferences,
|
|
110
|
+
closeDialog,
|
|
104
111
|
]);
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
function usePredictSpectraModal() {
|
|
111
|
-
const modal = (0, Modal_1.useModal)();
|
|
112
|
-
return (molecule) => {
|
|
113
|
-
modal.show((0, jsx_runtime_1.jsx)(PredictSpectraModal, { molecule: molecule }), {
|
|
114
|
-
position: options_1.positions.TOP_CENTER,
|
|
115
|
-
enableResizing: true,
|
|
116
|
-
width: 600,
|
|
117
|
-
});
|
|
118
|
-
};
|
|
112
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: '#4e4e4e', hover: '#4e4e4e' }, onClick: openDialog, toolTip: "Predict spectra", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(cheminfo_font_1.SvgNmrFt, {}) }), (0, jsx_runtime_1.jsx)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
|
|
113
|
+
onClose();
|
|
114
|
+
closeDialog();
|
|
115
|
+
}, width: 600, maxWidth: 1000, children: (0, jsx_runtime_1.jsxs)("div", { css: [ModalStyle_1.ModalStyles, styles], children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsx)("div", { className: "header handle", children: (0, jsx_runtime_1.jsx)("span", { children: "Prediction of NMR spectrum" }) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "inner-content", children: [(0, jsx_runtime_1.jsx)(PredictionOptionsPanel_1.default, { onSubmit: submitHandler, options: initValues, ref: refForm }), (0, jsx_runtime_1.jsx)("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), (0, jsx_runtime_1.jsx)("div", { className: "warning-container", children: (0, jsx_runtime_1.jsx)(ui_1.Checkbox, { onChange: setApproved, checked: isApproved, label: "I confirm that the chemical structure is not confidential." }, String(isApproved)) })] }), (0, jsx_runtime_1.jsx)("div", { className: "footer-container", children: (0, jsx_runtime_1.jsx)(Button_1.default.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }) })] }));
|
|
119
116
|
}
|
|
120
|
-
exports.
|
|
117
|
+
exports.PredictSpectraModal = PredictSpectraModal;
|
|
121
118
|
exports.default = PredictSpectraModal;
|
|
@@ -117,7 +117,7 @@ function ChangeSumModal({ onSave, onClose, header, sumOptions, }) {
|
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
119
|
setActiveOption(SumSetOptions.Manual);
|
|
120
|
-
formRef.current.setValues({ sum: sumOptions?.sum
|
|
120
|
+
formRef.current.setValues({ sum: sumOptions?.sum ?? '', molecule: null });
|
|
121
121
|
}
|
|
122
122
|
}, [panels?.structuresPanel, sumOptions]);
|
|
123
123
|
function saveHandler(values) {
|
|
@@ -96,7 +96,7 @@ function SignalsForm({ range, preferences }) {
|
|
|
96
96
|
: 'addSignalTab');
|
|
97
97
|
}, [setFieldValue, values.signals.length]);
|
|
98
98
|
const tabContainsErrors = (0, react_2.useCallback)((i) => {
|
|
99
|
-
return !!
|
|
99
|
+
return !!errors?.signals?.[i];
|
|
100
100
|
}, [errors]);
|
|
101
101
|
const signalFormTabs = (0, react_2.useMemo)(() => {
|
|
102
102
|
const signalTabs = values.signals.length > 0
|
|
@@ -30,7 +30,7 @@ const tabStyles = (0, react_1.css) `
|
|
|
30
30
|
function SignalsForm() {
|
|
31
31
|
const { values, setFieldValue, errors, } = (0, formik_1.useFormikContext)();
|
|
32
32
|
const tabContainsErrors = (0, react_2.useCallback)((i) => {
|
|
33
|
-
return !!
|
|
33
|
+
return !!errors?.signals?.[i];
|
|
34
34
|
}, [errors]);
|
|
35
35
|
const signalFormTabs = (0, react_2.useMemo)(() => {
|
|
36
36
|
const signalTabs = values.signals.length > 0
|
|
@@ -143,7 +143,7 @@ function MetaImportationModal({ onClose, file }) {
|
|
|
143
143
|
return columns;
|
|
144
144
|
}, [parseResult?.meta.fields]);
|
|
145
145
|
function handleLinkSpectra(fields) {
|
|
146
|
-
|
|
146
|
+
const { source, target } = fields;
|
|
147
147
|
if (data && parseResult) {
|
|
148
148
|
try {
|
|
149
149
|
const { compareResult, matches } = (0, parseMeta_1.linkMetaWithSpectra)({
|
|
@@ -33,6 +33,8 @@ const formik_1 = require("formik");
|
|
|
33
33
|
const react_2 = require("react");
|
|
34
34
|
const fa_1 = require("react-icons/fa");
|
|
35
35
|
const ui_1 = require("react-science/ui");
|
|
36
|
+
const clipboardComponents_1 = require("../../../utils/clipboard/clipboardComponents");
|
|
37
|
+
const clipboardHooks_1 = require("../../../utils/clipboard/clipboardHooks");
|
|
36
38
|
const PreferencesContext_1 = require("../../context/PreferencesContext");
|
|
37
39
|
const ActionButtons_1 = __importDefault(require("../../elements/ActionButtons"));
|
|
38
40
|
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
@@ -43,7 +45,6 @@ const DropDownButton_1 = __importDefault(require("../../elements/dropDownButton/
|
|
|
43
45
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
44
46
|
const useSaveSettings_1 = require("../../hooks/useSaveSettings");
|
|
45
47
|
const getPreferencesByWorkspace_1 = require("../../reducer/preferences/utilities/getPreferencesByWorkspace");
|
|
46
|
-
const export_1 = require("../../utility/export");
|
|
47
48
|
const workspaces_1 = __importDefault(require("../../workspaces"));
|
|
48
49
|
const WorkspaceItem_1 = __importDefault(require("./WorkspaceItem"));
|
|
49
50
|
const DatabasesTabContent_1 = __importDefault(require("./settings-tabs/DatabasesTabContent"));
|
|
@@ -56,7 +57,8 @@ const OnLoadProcessingTabContent_1 = __importDefault(require("./settings-tabs/On
|
|
|
56
57
|
const ToolsTabContent_1 = __importDefault(require("./settings-tabs/ToolsTabContent"));
|
|
57
58
|
const settingsValidation_1 = require("./settingsValidation");
|
|
58
59
|
const styles = (0, react_1.css) `
|
|
59
|
-
width:
|
|
60
|
+
width: 50vw;
|
|
61
|
+
min-width: 800px;
|
|
60
62
|
|
|
61
63
|
.main-content {
|
|
62
64
|
width: 100%;
|
|
@@ -203,20 +205,16 @@ function GeneralSettingsModal({ height }) {
|
|
|
203
205
|
function handleDisabledRestButton(values) {
|
|
204
206
|
setRestDisabled(isRestButtonDisable(values, workspaceName, originalWorkspaces));
|
|
205
207
|
}
|
|
208
|
+
const { readText, rawWriteWithType, shouldFallback, cleanShouldFallback, text, } = (0, clipboardHooks_1.useClipboard)();
|
|
206
209
|
function handleCopyWorkspace() {
|
|
207
210
|
const data = { [workspaceName]: refForm.current?.values };
|
|
208
|
-
void (
|
|
209
|
-
|
|
210
|
-
alert.success('Workspace copied to clipboard');
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
alert.error('copied not completed');
|
|
214
|
-
}
|
|
211
|
+
void rawWriteWithType(JSON.stringify(data)).then(() => {
|
|
212
|
+
alert.success('Workspace copied to clipboard');
|
|
215
213
|
});
|
|
216
214
|
}
|
|
217
215
|
const setWorkspaceSetting = (0, react_2.useCallback)((inputWorkspace) => {
|
|
218
216
|
const parseWorkspaceName = Object.keys(inputWorkspace)[0];
|
|
219
|
-
if (preferences
|
|
217
|
+
if (preferences.workspace.current === parseWorkspaceName) {
|
|
220
218
|
refForm.current?.setValues(inputWorkspace[parseWorkspaceName]);
|
|
221
219
|
}
|
|
222
220
|
else if (preferences.workspaces[parseWorkspaceName]) {
|
|
@@ -229,41 +227,44 @@ function GeneralSettingsModal({ height }) {
|
|
|
229
227
|
},
|
|
230
228
|
});
|
|
231
229
|
}
|
|
232
|
-
}, [dispatch, preferences
|
|
233
|
-
function handlePastWorkspace() {
|
|
234
|
-
void navigator.clipboard.readText().then((text) => {
|
|
235
|
-
try {
|
|
236
|
-
const parseWorkspaces = JSON.parse(text);
|
|
237
|
-
setWorkspaceSetting(parseWorkspaces);
|
|
238
|
-
}
|
|
239
|
-
catch {
|
|
240
|
-
alert.error('object parse error');
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
230
|
+
}, [dispatch, preferences.workspace, preferences.workspaces]);
|
|
244
231
|
(0, react_2.useEffect)(() => {
|
|
245
232
|
if (pastRef.current) {
|
|
246
233
|
setWorkspaceSetting(pastRef.current);
|
|
247
234
|
pastRef.current = null;
|
|
248
235
|
}
|
|
249
236
|
}, [setWorkspaceSetting]);
|
|
250
|
-
|
|
237
|
+
function handlePastWorkspace(text) {
|
|
238
|
+
if (!text)
|
|
239
|
+
return;
|
|
240
|
+
try {
|
|
241
|
+
const parseWorkspaces = JSON.parse(text);
|
|
242
|
+
setWorkspaceSetting(parseWorkspaces);
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
alert.error('object parse error');
|
|
246
|
+
}
|
|
247
|
+
cleanShouldFallback();
|
|
248
|
+
}
|
|
249
|
+
function handlePastWorkspaceAction() {
|
|
250
|
+
void readText().then(handlePastWorkspace);
|
|
251
|
+
}
|
|
252
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ui_1.Toolbar.Item, { id: "general-settings", onClick: openDialog, title: "General settings", children: (0, jsx_runtime_1.jsx)(fa_1.FaWrench, {}) }), (0, jsx_runtime_1.jsxs)(ui_1.Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: [(0, jsx_runtime_1.jsx)(ui_1.Modal.Header, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
251
253
|
display: 'flex',
|
|
252
254
|
flexDirection: 'column',
|
|
253
|
-
width: '100%',
|
|
254
255
|
}, children: [(0, jsx_runtime_1.jsx)("span", { children: "General Settings" }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
255
256
|
display: 'flex',
|
|
256
257
|
alignItems: 'center',
|
|
257
258
|
cursor: 'default',
|
|
258
259
|
paddingTop: '10px',
|
|
259
|
-
}, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Workspace", children: (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences
|
|
260
|
+
}, children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Workspace", children: (0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, renderItem: renderItem, selectedKey: preferences.workspace.current, onSelect: ChangeWorkspaceHandler }) }), (0, jsx_runtime_1.jsx)(Button_1.default.Action, { size: "xSmall", onClick: handleReset, toolTip: "Reset workspace preferences", tooltipOrientation: "horizontal", style: {
|
|
260
261
|
marginLeft: '10px',
|
|
261
262
|
}, disabled: isRestDisabled, children: (0, jsx_runtime_1.jsx)(fa_1.FaBolt, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.Done, { size: "xSmall", fill: "outline", onClick: handleCopyWorkspace, toolTip: "Copy workspace preferences", tooltipOrientation: "horizontal", style: {
|
|
262
263
|
marginLeft: '10px',
|
|
263
|
-
}, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegCopy, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.Action, { size: "xSmall", fill: "outline", onClick:
|
|
264
|
+
}, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegCopy, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.Action, { size: "xSmall", fill: "outline", onClick: handlePastWorkspaceAction, toolTip: "Past workspace preferences", tooltipOrientation: "horizontal", style: {
|
|
264
265
|
marginLeft: '10px',
|
|
265
266
|
}, children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) })] })] }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Body, { children: (0, jsx_runtime_1.jsx)("div", { css: styles, style: { height }, children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { enableReinitialize: true, innerRef: refForm, initialValues: currentWorkspace, validationSchema: settingsValidation_1.validation, onSubmit: submitHandler, validate: handleDisabledRestButton, children: (0, jsx_runtime_1.jsxs)(Tabs_1.default, { position: Tabs_1.PositionsEnum.LEFT, activeTab: activeTab, onClick: tabChangeHandler, children: [(0, jsx_runtime_1.jsx)(Tab_1.default, { title: "General", tabid: "general", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(GeneralTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Formatting", tabid: "formatting", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(FormattingTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Panels", tabid: "display", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DisplayTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Tools", tabid: "tools", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ToolsTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Databases", tabid: "databases", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(DatabasesTabContent_1.default, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Import filters", tabid: "importation-filters", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(ImportationFiltersTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "Title Block", tabid: "title-block", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(InfoBlockTabContent_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(Tab_1.default, { title: "On Load Processing", tabid: "on-load-processing", children: (0, jsx_runtime_1.jsx)("div", { className: "inner-content", children: (0, jsx_runtime_1.jsx)(OnLoadProcessingTabContent_1.default, {}) }) })] }) }) }) }), (0, jsx_runtime_1.jsx)(ui_1.Modal.Footer, { children: (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: [(0, jsx_runtime_1.jsx)(ActionButtons_1.default, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "Apply and Save", onCancel: () => {
|
|
266
267
|
closeDialog?.();
|
|
267
|
-
} }), (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { style: { margin: '0 10px' }, onClick: applyPreferencesHandler, children: "Apply" })] }) })] }), (0, jsx_runtime_1.jsx)(SaveSettingsModal, {})] }));
|
|
268
|
+
} }), (0, jsx_runtime_1.jsx)(Button_1.default.Secondary, { style: { margin: '0 10px' }, onClick: applyPreferencesHandler, children: "Apply" })] }) })] }), (0, jsx_runtime_1.jsx)(SaveSettingsModal, {}), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePastWorkspace, text: text, label: "Workspace" })] }));
|
|
268
269
|
}
|
|
269
270
|
exports.default = GeneralSettingsModal;
|
|
@@ -58,7 +58,7 @@ function FormattingTabContent() {
|
|
|
58
58
|
const { values, setFieldValue } = (0, formik_1.useFormikContext)();
|
|
59
59
|
const nuclei = (0, get_1.default)(values, 'formatting.nuclei', {});
|
|
60
60
|
function deleteHandler(key) {
|
|
61
|
-
|
|
61
|
+
const _nuclei = {};
|
|
62
62
|
for (const nucleus in nuclei) {
|
|
63
63
|
if (nucleus !== key) {
|
|
64
64
|
_nuclei[nucleus] = nuclei[nucleus];
|
|
@@ -16,7 +16,7 @@ const formattingValidation = (obj) => (0, yup_1.object)().shape({
|
|
|
16
16
|
nuclei: (0, yup_1.object)()
|
|
17
17
|
.shape(formattingElementValidation(obj))
|
|
18
18
|
.test('Unique', 'Nuclei need te be unique', function check(nuclei) {
|
|
19
|
-
|
|
19
|
+
const nucleusFrequencies = {};
|
|
20
20
|
for (const key of Object.keys(nuclei)) {
|
|
21
21
|
const _key = nuclei[key].name?.toLowerCase() || '';
|
|
22
22
|
if (_key) {
|
|
@@ -33,7 +33,7 @@ const formattingValidation = (obj) => (0, yup_1.object)().shape({
|
|
|
33
33
|
for (const key in nucleusFrequencies) {
|
|
34
34
|
const { value, fields } = nucleusFrequencies[key];
|
|
35
35
|
if (value > 1) {
|
|
36
|
-
for (
|
|
36
|
+
for (const field of fields) {
|
|
37
37
|
errors.push(new yup_1.ValidationError(`${key} nucleus must te be unique`, nuclei[key].name, `${this.path}.${field}.name`));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -89,12 +89,9 @@ function IntegralTable({ activeTab, data }) {
|
|
|
89
89
|
},
|
|
90
90
|
accessor: 'integral',
|
|
91
91
|
Cell: ({ row }) => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const flag = (0, Spectrum1D_1.checkIntegralKind)(row.original);
|
|
96
|
-
integral = flag ? value : `[ ${value} ]`;
|
|
97
|
-
}
|
|
92
|
+
const value = (0, formatNumber_1.formatNumber)(row.original.integral || 0, integralsPreferences.relative.format);
|
|
93
|
+
const flag = (0, Spectrum1D_1.checkIntegralKind)(row.original);
|
|
94
|
+
const integral = flag ? value : `[ ${value} ]`;
|
|
98
95
|
return ((0, jsx_runtime_1.jsx)(EditableColumn_1.default, { value: integral, onSave: (event) => saveRelativeHandler(event, row.original), type: "number" }));
|
|
99
96
|
},
|
|
100
97
|
},
|
|
@@ -114,7 +111,7 @@ function IntegralTable({ activeTab, data }) {
|
|
|
114
111
|
saveRelativeHandler,
|
|
115
112
|
]);
|
|
116
113
|
const tableColumns = (0, react_1.useMemo)(() => {
|
|
117
|
-
|
|
114
|
+
const columns = [...initialColumns];
|
|
118
115
|
for (const col of COLUMNS) {
|
|
119
116
|
const { showWhen, ...colParams } = col;
|
|
120
117
|
if ((0, get_1.default)(integralsPreferences, showWhen)) {
|
|
@@ -4,12 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const cheminfo_font_1 = require("cheminfo-font");
|
|
8
7
|
const full_1 = require("openchemlib/full");
|
|
9
8
|
const react_1 = require("react");
|
|
10
9
|
const fa_1 = require("react-icons/fa");
|
|
11
10
|
const io5_1 = require("react-icons/io5");
|
|
12
11
|
const ui_1 = require("react-science/ui");
|
|
12
|
+
const clipboardComponents_1 = require("../../../utils/clipboard/clipboardComponents");
|
|
13
|
+
const clipboardHooks_1 = require("../../../utils/clipboard/clipboardHooks");
|
|
13
14
|
const AssignmentsContext_1 = require("../../assignment/AssignmentsContext");
|
|
14
15
|
const DispatchContext_1 = require("../../context/DispatchContext");
|
|
15
16
|
const GlobalContext_1 = require("../../context/GlobalContext");
|
|
@@ -17,7 +18,7 @@ const ActiveButton_1 = __importDefault(require("../../elements/ActiveButton"));
|
|
|
17
18
|
const Button_1 = __importDefault(require("../../elements/Button"));
|
|
18
19
|
const Alert_1 = require("../../elements/popup/Alert");
|
|
19
20
|
const AboutPredictionModal_1 = __importDefault(require("../../modal/AboutPredictionModal"));
|
|
20
|
-
const PredictSpectraModal_1 = require("../../modal/PredictSpectraModal");
|
|
21
|
+
const PredictSpectraModal_1 = __importDefault(require("../../modal/PredictSpectraModal"));
|
|
21
22
|
const export_1 = require("../../utility/export");
|
|
22
23
|
const PanelHeader_1 = __importDefault(require("../header/PanelHeader"));
|
|
23
24
|
const styles = {
|
|
@@ -80,7 +81,6 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
80
81
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
81
82
|
const assignmentData = (0, AssignmentsContext_1.useAssignmentData)();
|
|
82
83
|
const moleculeKey = molecules?.[currentIndex]?.id;
|
|
83
|
-
const openPredictSpectraModal = (0, PredictSpectraModal_1.usePredictSpectraModal)();
|
|
84
84
|
const saveAsSVGHandler = (0, react_1.useCallback)(() => {
|
|
85
85
|
if (!rootRef)
|
|
86
86
|
return;
|
|
@@ -92,16 +92,12 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
92
92
|
(0, export_1.copyPNGToClipboard)(rootRef, `molSVG${currentIndex} `);
|
|
93
93
|
alert.success('MOL copied as PNG to clipboard');
|
|
94
94
|
}, [rootRef, alert, currentIndex]);
|
|
95
|
+
const { rawWriteWithType, readText, shouldFallback, cleanShouldFallback, text, } = (0, clipboardHooks_1.useClipboard)();
|
|
95
96
|
const saveAsMolHandler = (0, react_1.useCallback)((molfile) => {
|
|
96
|
-
void (
|
|
97
|
-
|
|
98
|
-
alert.success('MOLFile copied to clipboard');
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
alert.error('copied not completed');
|
|
102
|
-
}
|
|
97
|
+
void rawWriteWithType(molfile).then(() => {
|
|
98
|
+
alert.success('MOLFile copied to clipboard');
|
|
103
99
|
});
|
|
104
|
-
}, [alert]);
|
|
100
|
+
}, [alert, rawWriteWithType]);
|
|
105
101
|
const exportHandler = (0, react_1.useCallback)((selected) => {
|
|
106
102
|
const molecule = molecules?.[currentIndex];
|
|
107
103
|
if (molecule) {
|
|
@@ -130,11 +126,15 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
130
126
|
saveAsPNGHandler,
|
|
131
127
|
saveAsSVGHandler,
|
|
132
128
|
]);
|
|
133
|
-
|
|
134
|
-
void
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
function handlePasteMolfileAction() {
|
|
130
|
+
void readText().then(handlePasteMolfile);
|
|
131
|
+
}
|
|
132
|
+
function handlePasteMolfile(molfile) {
|
|
133
|
+
if (!molfile)
|
|
134
|
+
return;
|
|
135
|
+
dispatch({ type: 'ADD_MOLECULE', payload: { molfile } });
|
|
136
|
+
cleanShouldFallback();
|
|
137
|
+
}
|
|
138
138
|
const handleDelete = (0, react_1.useCallback)(() => {
|
|
139
139
|
if (molecules[currentIndex]?.id) {
|
|
140
140
|
onMoleculeIndexChange?.(0);
|
|
@@ -163,8 +163,8 @@ function MoleculePanelHeader({ currentIndex, molecules, moleculesView, onMolecul
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
const hasMolecules = molecules && molecules.length > 0;
|
|
166
|
-
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { children: [renderSource === 'predictionPanel' && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }) })), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick:
|
|
166
|
+
return ((0, jsx_runtime_1.jsxs)(PanelHeader_1.default, { children: [renderSource === 'predictionPanel' && (0, jsx_runtime_1.jsx)(AboutPredictionModal_1.default, {}), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsx)(ui_1.DropdownMenu, { trigger: "click", options: MOL_EXPORT_MENU, onSelect: exportHandler, children: (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { as: "div", disabled: !hasMolecules, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Export As", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaFileExport, {}) }) })), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handlePasteMolfileAction, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Paste molfile", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPaste, {}) }), (0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: onOpenMoleculeEditor, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Add molecule", tooltipOrientation: "horizontal", children: (0, jsx_runtime_1.jsx)(fa_1.FaPlus, {}) }), renderSource === 'moleculePanel' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { onClick: handleDelete, color: { base: '#4e4e4e', hover: '#4e4e4e' }, toolTip: "Delete molecule", tooltipOrientation: "horizontal", disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(fa_1.FaRegTrashAlt, {}) }), hasMolecules && ((0, jsx_runtime_1.jsx)(PredictSpectraModal_1.default, { molecule: molecules[currentIndex] }))] })), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { value: moleculesView?.[moleculeKey]?.floating.visible || false, popupTitle: "Float molecule", popupPlacement: "left", onClick: floatMoleculeHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)(io5_1.IoOpenOutline, {}) }), (0, jsx_runtime_1.jsx)(ActiveButton_1.default, { style: { marginLeft: '2px' }, value: moleculesView?.[moleculeKey]?.showAtomNumber || false, popupTitle: "Show atom number", popupPlacement: "left", onClick: showAtomNumbersHandler, disabled: !hasMolecules, children: (0, jsx_runtime_1.jsx)("p", { style: styles.atomLabel, children: "#" }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 }, children: children }), (0, jsx_runtime_1.jsxs)("p", { style: styles.counter, children: [molecules &&
|
|
167
167
|
molecules.length > 0 &&
|
|
168
|
-
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] }), onClickPreferences && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) }))] }));
|
|
168
|
+
`${+(currentIndex + 1)} / ${molecules.length}`, ' '] }), onClickPreferences && ((0, jsx_runtime_1.jsx)(Button_1.default.BarButton, { color: { base: 'black', hover: 'black' }, onClick: onClickPreferences, toolTip: "Preferences", tooltipOrientation: "vertical", children: (0, jsx_runtime_1.jsx)(fa_1.FaCog, {}) })), (0, jsx_runtime_1.jsx)(clipboardComponents_1.ClipboardFallbackModal, { mode: shouldFallback, onDismiss: cleanShouldFallback, onReadText: handlePasteMolfile, text: text, label: "Molfile" })] }));
|
|
169
169
|
}
|
|
170
170
|
exports.default = MoleculePanelHeader;
|