nmrium 0.20.2 → 0.21.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.
Files changed (87) hide show
  1. package/lib/component/EventsTrackers/KeysListenerTracker.js +98 -81
  2. package/lib/component/NMRium.d.ts +7 -2
  3. package/lib/component/NMRium.js +9 -9
  4. package/lib/component/header/Header.js +10 -3
  5. package/lib/component/hooks/useCheckExperimentalFeature.js +2 -1
  6. package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -0
  7. package/lib/component/hooks/useCheckToolsVisibility.js +6 -0
  8. package/lib/component/hooks/useToolsFunctions.js +2 -1
  9. package/lib/component/loader/DropZone.js +87 -87
  10. package/lib/component/modal/changeSum/ChangeSumModal.js +4 -2
  11. package/lib/component/modal/setting/DisplayTabContent.js +1 -1
  12. package/lib/component/modal/setting/GeneralSettings.js +1 -5
  13. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
  14. package/lib/component/panels/IntegralsPanel/IntegralsPreferences.js +4 -17
  15. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
  16. package/lib/component/panels/PeaksPanel/PeaksPanel.js +0 -3
  17. package/lib/component/panels/PeaksPanel/PeaksPreferences.js +5 -14
  18. package/lib/component/panels/RangesPanel/RangesPanel.js +0 -3
  19. package/lib/component/panels/RangesPanel/RangesPreferences.js +5 -18
  20. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
  21. package/lib/component/panels/ZonesPanel/ZonesPanel.js +0 -3
  22. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +5 -18
  23. package/lib/component/panels/databasePanel/DatabasePanel.js +0 -3
  24. package/lib/component/panels/databasePanel/DatabasePreferences.js +4 -17
  25. package/lib/component/reducer/actions/ToolsActions.js +12 -29
  26. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -0
  27. package/lib/component/reducer/helper/ZoomHistoryManager.js +2 -1
  28. package/lib/component/reducer/preferencesReducer.d.ts +2 -0
  29. package/lib/component/reducer/preferencesReducer.js +76 -36
  30. package/lib/component/toolbar/FunctionToolBar.js +7 -10
  31. package/lib/component/toolbar/ToolTypes.js +3 -3
  32. package/lib/component/workspaces/Workspace.d.ts +6 -0
  33. package/lib/component/workspaces/Workspace.js +1 -0
  34. package/lib/component/workspaces/basic.d.ts +2 -0
  35. package/lib/component/workspaces/basic.js +45 -0
  36. package/lib/component/workspaces/exercise1D.d.ts +2 -0
  37. package/lib/component/workspaces/exercise1D.js +45 -0
  38. package/lib/component/workspaces/index.d.ts +6 -0
  39. package/lib/component/workspaces/index.js +4 -0
  40. package/lib/component/workspaces/process1D.d.ts +2 -0
  41. package/lib/component/workspaces/process1D.js +43 -0
  42. package/lib/data/migration/MigrationManager.js +3 -0
  43. package/lib/versionInfo.js +1 -1
  44. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +98 -81
  45. package/lib-cjs/component/NMRium.js +10 -10
  46. package/lib-cjs/component/header/Header.js +10 -3
  47. package/lib-cjs/component/hooks/useCheckExperimentalFeature.js +5 -1
  48. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +13 -0
  49. package/lib-cjs/component/hooks/useToolsFunctions.js +2 -1
  50. package/lib-cjs/component/loader/DropZone.js +87 -87
  51. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +4 -2
  52. package/lib-cjs/component/modal/setting/DisplayTabContent.js +1 -1
  53. package/lib-cjs/component/modal/setting/GeneralSettings.js +1 -5
  54. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +0 -3
  55. package/lib-cjs/component/panels/IntegralsPanel/IntegralsPreferences.js +3 -16
  56. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +1 -1
  57. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +0 -3
  58. package/lib-cjs/component/panels/PeaksPanel/PeaksPreferences.js +4 -13
  59. package/lib-cjs/component/panels/RangesPanel/RangesPanel.js +0 -3
  60. package/lib-cjs/component/panels/RangesPanel/RangesPreferences.js +4 -17
  61. package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +13 -3
  62. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +0 -3
  63. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +4 -17
  64. package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +0 -3
  65. package/lib-cjs/component/panels/databasePanel/DatabasePreferences.js +3 -16
  66. package/lib-cjs/component/reducer/actions/ToolsActions.js +12 -29
  67. package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +2 -1
  68. package/lib-cjs/component/reducer/preferencesReducer.js +75 -35
  69. package/lib-cjs/component/toolbar/FunctionToolBar.js +7 -10
  70. package/lib-cjs/component/toolbar/ToolTypes.js +3 -3
  71. package/lib-cjs/component/workspaces/Workspace.js +2 -0
  72. package/lib-cjs/component/workspaces/basic.js +48 -0
  73. package/lib-cjs/component/workspaces/exercise1D.js +48 -0
  74. package/lib-cjs/component/workspaces/index.js +6 -0
  75. package/lib-cjs/component/workspaces/process1D.js +46 -0
  76. package/lib-cjs/data/migration/MigrationManager.js +3 -0
  77. package/lib-cjs/versionInfo.js +1 -1
  78. package/package.json +1 -1
  79. package/lib/component/nmriumMode/basic.d.ts +0 -38
  80. package/lib/component/nmriumMode/basic.js +0 -37
  81. package/lib/component/nmriumMode/exercise1D.d.ts +0 -38
  82. package/lib/component/nmriumMode/exercise1D.js +0 -37
  83. package/lib/component/nmriumMode/process1D.d.ts +0 -38
  84. package/lib/component/nmriumMode/process1D.js +0 -37
  85. package/lib-cjs/component/nmriumMode/basic.js +0 -39
  86. package/lib-cjs/component/nmriumMode/exercise1D.js +0 -39
  87. package/lib-cjs/component/nmriumMode/process1D.js +0 -39
@@ -1,27 +1,25 @@
1
1
  import { produce } from 'immer';
2
2
  import lodashMerge from 'lodash/merge';
3
- import { NMRiumMode } from '../NMRium';
4
- import basic from '../nmriumMode/basic';
5
- import exercise1D from '../nmriumMode/exercise1D';
6
- import process1D from '../nmriumMode/process1D';
3
+ import { NMRiumWorkspaces } from '../NMRium';
7
4
  import { getLocalStorage, removeData, storeData, } from '../utility/LocalStorage';
5
+ import workspaces from '../workspaces';
8
6
  export const INIT_PREFERENCES = 'INIT_PREFERENCES';
9
7
  export const SET_PREFERENCES = 'SET_PREFERENCES';
10
8
  export const SET_PANELS_PREFERENCES = 'SET_PANELS_PREFERENCES';
11
- const LOCAL_STORGAE_VERSION = '1.1';
12
- function getPreferencesByMode(mode) {
13
- switch (mode) {
14
- case NMRiumMode.EXERCISE_1D:
15
- return exercise1D;
16
- case NMRiumMode.PROCESS_1D:
17
- return process1D;
9
+ const LOCAL_STORAGE_VERSION = 3;
10
+ function getPreferencesByWorkspace(workspace) {
11
+ switch (workspace) {
12
+ case NMRiumWorkspaces.EXERCISE_1D:
13
+ return workspaces.exercise1D;
14
+ case NMRiumWorkspaces.PROCESS_1D:
15
+ return workspaces.process1D;
18
16
  default:
19
- return basic;
17
+ return workspaces.basic;
20
18
  }
21
19
  }
22
20
  export const preferencesInitialState = {
23
21
  basePreferences: {},
24
- display: basic,
22
+ display: workspaces.basic.display,
25
23
  controllers: {
26
24
  mws: { low: 2, high: 20 },
27
25
  dimmedSpectraTransparency: 0.1,
@@ -39,7 +37,15 @@ export const preferencesInitialState = {
39
37
  panels: {},
40
38
  },
41
39
  dispatch: null,
40
+ workspace: 'default',
42
41
  };
42
+ function getTruthyObjectValues(data) {
43
+ return JSON.parse(JSON.stringify(data), (key, value) => {
44
+ if (value) {
45
+ return value;
46
+ }
47
+ });
48
+ }
43
49
  function mapNucleus(draft) {
44
50
  if (draft.formatting.nucleus && Array.isArray(draft.formatting.nucleus)) {
45
51
  draft.formatting.nucleusByKey = draft.formatting.nucleus.reduce((acc, item) => {
@@ -50,48 +56,82 @@ function mapNucleus(draft) {
50
56
  }
51
57
  function handleInit(draft, action) {
52
58
  const nmrLocalStorageVersion = getLocalStorage('nmr-local-storage-version', false);
53
- if (!nmrLocalStorageVersion ||
54
- nmrLocalStorageVersion !== LOCAL_STORGAE_VERSION) {
59
+ let localData = getLocalStorage('nmr-general-settings');
60
+ // remove old nmr-local-storage-version key
61
+ if (nmrLocalStorageVersion && localData?.version) {
62
+ removeData('nmr-local-storage-version');
63
+ }
64
+ if (!localData?.version || localData?.version !== LOCAL_STORAGE_VERSION) {
55
65
  removeData('nmr-general-settings');
56
- storeData('nmr-local-storage-version', LOCAL_STORGAE_VERSION);
57
66
  }
58
- const localData = getLocalStorage('nmr-general-settings');
59
67
  if (action.payload) {
60
- const { dispatch, mode, ...resProps } = action.payload;
61
- draft.basePreferences = lodashMerge({}, {
62
- display: mode === NMRiumMode.DEFAULT ? {} : getPreferencesByMode(mode),
63
- }, resProps);
64
- const hiddenFeatures = JSON.parse(JSON.stringify(draft.basePreferences.display), (key, value) => {
65
- if (value) {
66
- return value;
67
- }
68
- });
69
- draft.display = lodashMerge({}, getPreferencesByMode(NMRiumMode.DEFAULT), hiddenFeatures);
68
+ const { dispatch, workspace, ...resProps } = action.payload;
69
+ draft.workspace = workspace;
70
+ const workspacePreferences = getPreferencesByWorkspace(workspace);
71
+ if (!localData ||
72
+ !localData?.workspaces[workspace] ||
73
+ workspacePreferences.version !== localData?.workspaces[workspace]?.version) {
74
+ localData = localData || {};
75
+ localData = {
76
+ version: LOCAL_STORAGE_VERSION,
77
+ workspaces: {
78
+ ...localData.workspaces,
79
+ [workspace]: {
80
+ ...workspacePreferences,
81
+ controllers: draft.controllers,
82
+ formatting: draft.formatting,
83
+ },
84
+ },
85
+ };
86
+ storeData('nmr-general-settings', JSON.stringify(localData));
87
+ }
88
+ draft.basePreferences = lodashMerge({}, workspacePreferences, resProps);
89
+ const hiddenModeFeatures = getTruthyObjectValues(draft.basePreferences.display);
90
+ let hiddenLocalStorageFeatures = {};
70
91
  draft.dispatch = dispatch;
71
- if (localData) {
72
- Object.entries(localData).forEach(([k, v]) => {
73
- if (!['dispatch', 'basePreferences'].includes(k)) {
92
+ const localStorageModePreferences = localData?.workspaces[workspace] || null;
93
+ if (localStorageModePreferences) {
94
+ Object.entries(localStorageModePreferences).forEach(([k, v]) => {
95
+ if (k === 'display') {
96
+ hiddenLocalStorageFeatures = getTruthyObjectValues(v);
97
+ }
98
+ else if (!['dispatch', 'basePreferences'].includes(k)) {
74
99
  draft[k] = lodashMerge({}, resProps[k] ? resProps[k] : {}, v);
75
100
  }
76
101
  });
77
102
  mapNucleus(draft);
78
103
  }
104
+ draft.display = lodashMerge({}, getPreferencesByWorkspace(NMRiumWorkspaces.DEFAULT).display, hiddenModeFeatures, hiddenLocalStorageFeatures);
79
105
  }
80
106
  }
81
107
  function handleSetPreferences(draft, action) {
82
108
  if (action.payload) {
83
- const data = action.payload;
84
- draft.controllers = data.controllers;
85
- draft.formatting = data.formatting;
86
- draft.display.panels = data.display.panels;
87
- draft.display.hideExperimentalFeatures =
88
- data.display.hideExperimentalFeatures;
109
+ const { controllers, formatting, display } = action.payload;
110
+ let localData = getLocalStorage('nmr-general-settings');
111
+ localData.workspaces = {
112
+ ...localData.workspaces,
113
+ [draft.workspace]: {
114
+ ...localData.workspaces[draft.workspace],
115
+ controllers,
116
+ formatting,
117
+ display,
118
+ },
119
+ };
120
+ storeData('nmr-general-settings', JSON.stringify(localData));
121
+ draft.controllers = controllers;
122
+ draft.formatting = formatting;
123
+ draft.display.panels = display.panels;
124
+ draft.display.general.hideExperimentalFeatures =
125
+ display.general.hideExperimentalFeatures;
89
126
  mapNucleus(draft);
90
127
  }
91
128
  }
92
129
  function handleSetPanelsPreferences(draft, action) {
93
130
  if (action.payload) {
94
131
  const { key, value } = action.payload;
132
+ let localData = getLocalStorage('nmr-general-settings');
133
+ localData.workspaces[draft.workspace].formatting.panels[key] = value;
134
+ storeData('nmr-general-settings', JSON.stringify(localData));
95
135
  draft.formatting.panels[key] = value;
96
136
  }
97
137
  }
@@ -1,15 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Toolbar } from 'analysis-ui-components';
3
3
  import { SvgNmrBaselineCorrection, SvgNmrFourierTransform, SvgNmrIntegrate, SvgNmrMultipleAnalysis, SvgNmrPeakPicking, SvgNmrPhaseCorrection, SvgNmrRangePicking, SvgNmrZeroFilling, } from 'cheminfo-font';
4
- import lodashGet from 'lodash/get';
5
4
  import { useState, useEffect, useCallback, memo } from 'react';
6
5
  import { FaSearchPlus, FaExpand, FaDiceFour } from 'react-icons/fa';
7
6
  import * as Filters from '../../data/Filters';
8
7
  import { useChartData } from '../context/ChartContext';
9
8
  import { useDispatch } from '../context/DispatchContext';
10
- import { usePreferences } from '../context/PreferencesContext';
11
9
  import ToggleButton from '../elements/toggle/ToggleButton';
12
10
  import ToggleButtonGroup from '../elements/toggle/ToggleButtonGroup';
11
+ import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
13
12
  import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
14
13
  import useToolsFunctions from '../hooks/useToolsFunctions';
15
14
  import { DISPLAYER_MODE } from '../reducer/core/Constants';
@@ -17,7 +16,7 @@ import { APPLY_FFT_FILTER, SET_SELECTED_FILTER } from '../reducer/types/Types';
17
16
  import { options } from './ToolTypes';
18
17
  function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displayerMode, ftCounter, mode, }) {
19
18
  const [option, setOption] = useState('');
20
- const preferences = usePreferences();
19
+ const isButtonVisible = useCheckToolsVisibility();
21
20
  const dispatch = useDispatch();
22
21
  const { handleChangeOption, handleFullZoomOut } = useToolsFunctions();
23
22
  const handleChange = useCallback((selectedOption) => {
@@ -34,25 +33,23 @@ function FunctionToolBarInner({ defaultValue, activeSpectrum, info, datum, displ
34
33
  });
35
34
  dispatch({ type: SET_SELECTED_FILTER, selectedFilter: null });
36
35
  }, [dispatch]);
37
- const isButtonVisible = useCallback((toolKey) => {
38
- return !lodashGet(preferences, `display.toolBarButtons.${toolKey}`);
39
- }, [preferences]);
40
36
  return (_jsxs(_Fragment, { children: [_jsxs(ToggleButtonGroup, { value: option, onChange: handleChange, children: [isButtonVisible('hideZoomTool') && (_jsx(ToggleButton, { value: options.zoom.id, id: "zoomIn", title: `${options.zoom.label} ( Press z )`, children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaSearchPlus, {}, void 0) }, void 0) }, options.zoom.id)), isButtonVisible('hideZoomOutTool') && (_jsx(Toolbar.Item, { id: "zoom-out", onClick: handleFullZoomOut, title: "Horizontal zoom out ( Press f ), Horizontal and Vertical zoom out, double click ( Press ff )", children: _jsx("div", { style: { fontSize: 14 }, children: _jsx(FaExpand, {}, void 0) }, void 0) }, void 0)), displayerMode === DISPLAYER_MODE.DM_1D &&
41
37
  isButtonVisible('hidePeakTool') && (_jsx(ToggleButton, { value: options.peakPicking.id, title: `${options.peakPicking.label} ( Press p )`, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "peakPicking", children: _jsx(SvgNmrPeakPicking, {}, void 0) }, options.peakPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
42
38
  isButtonVisible('hideIntegralTool') && (_jsx(ToggleButton, { value: options.integral.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "integralPicking", title: `${options.integral.label} ( Press i )`, children: _jsx(SvgNmrIntegrate, {}, void 0) }, options.integral.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
43
- isButtonVisible('hideIntegralTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.zone2D.label} ( Press r )`, children: _jsx(FaDiceFour, {}, void 0) }, options.zone2D.id)), displayerMode === DISPLAYER_MODE.DM_2D && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${options.slicingTool.label}`, children: _jsx("p", { children: "Slic" }, void 0) }, options.slicingTool.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
44
- isButtonVisible('hideAutoRangesTool') && (_jsx(ToggleButton, { value: options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: options.rangesPicking.label, id: "ranges-pick", children: _jsx(SvgNmrRangePicking, {}, void 0) }, options.rangesPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
39
+ isButtonVisible('hideZonePickingTool') && (_jsx(ToggleButton, { value: options.zone2D.id, id: "zone2d", isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.zone2D.label} ( Press r )`, children: _jsx(FaDiceFour, {}, void 0) }, options.zone2D.id)), displayerMode === DISPLAYER_MODE.DM_2D &&
40
+ isButtonVisible('hideSlicingTool') && (_jsx(ToggleButton, { value: options.slicingTool.id, isVisible: activeSpectrum && !info?.isFid ? true : false, id: "slic", title: `${options.slicingTool.label}`, children: _jsx("p", { children: "Slic" }, void 0) }, options.slicingTool.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
41
+ isButtonVisible('hideAutoRangesTool') && (_jsx(ToggleButton, { value: options.rangesPicking.id, isVisible: activeSpectrum && !info?.isFid ? true : false, title: `${options.rangesPicking.label} ( Press r )`, id: "ranges-pick", children: _jsx(SvgNmrRangePicking, {}, void 0) }, options.rangesPicking.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
45
42
  isButtonVisible('hideMultipleSpectraAnalysisTool') &&
46
43
  ftCounter > 1 &&
47
44
  mode === 'RTL' && (_jsx(ToggleButton, { value: options.multipleSpectraAnalysis.id, id: "multipleSpectraAnalysis", title: options.multipleSpectraAnalysis.label, children: _jsx(SvgNmrMultipleAnalysis, {}, void 0) }, options.multipleSpectraAnalysis.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
48
45
  isButtonVisible('hideZeroFillingTool') && (_jsx(ToggleButton, { value: options.zeroFilling.id, isVisible: Filters.zeroFilling.isApplicable({ info }), id: "zeroFilling", title: options.zeroFilling.label, children: _jsx(SvgNmrZeroFilling, {}, void 0) }, options.zeroFilling.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
49
- isButtonVisible('hidePhaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: options.phaseCorrection.label, isVisible: activeSpectrum &&
46
+ isButtonVisible('hidePhaseCorrectionTool') && (_jsx(ToggleButton, { value: options.phaseCorrection.id, id: "phaseCorrection", title: `${options.phaseCorrection.label} ( Press a )`, isVisible: activeSpectrum &&
50
47
  info &&
51
48
  Filters.phaseCorrection.isApplicable({ info }) &&
52
49
  datum.im
53
50
  ? true
54
51
  : false, children: _jsx(SvgNmrPhaseCorrection, {}, void 0) }, options.phaseCorrection.id)), displayerMode === DISPLAYER_MODE.DM_1D &&
55
- isButtonVisible('hideBaseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: options.baseLineCorrection.label, isVisible: activeSpectrum &&
52
+ isButtonVisible('hideBaseLineCorrectionTool') && (_jsx(ToggleButton, { value: options.baseLineCorrection.id, id: "baseLineCorrection", title: `${options.baseLineCorrection.label} ( Press b )`, isVisible: activeSpectrum &&
56
53
  info &&
57
54
  Filters.baselineCorrection.isApplicable({ info })
58
55
  ? true
@@ -44,7 +44,7 @@ export const options = {
44
44
  },
45
45
  rangesPicking: {
46
46
  id: 'rangesPicking',
47
- label: 'Ranges Picking ( Press r )',
47
+ label: 'Ranges Picking',
48
48
  hasOptionPanel: true,
49
49
  isFilter: false,
50
50
  },
@@ -56,13 +56,13 @@ export const options = {
56
56
  },
57
57
  phaseCorrection: {
58
58
  id: Filters.phaseCorrection.id,
59
- label: `${Filters.phaseCorrection.name} ( Press a )`,
59
+ label: Filters.phaseCorrection.name,
60
60
  hasOptionPanel: true,
61
61
  isFilter: true,
62
62
  },
63
63
  baseLineCorrection: {
64
64
  id: 'baseLineCorrection',
65
- label: 'baseline correction ( Press b )',
65
+ label: 'baseline correction',
66
66
  hasOptionPanel: true,
67
67
  isFilter: true,
68
68
  },
@@ -0,0 +1,6 @@
1
+ import { NMRiumPreferences } from '../NMRium';
2
+ export interface Workspace {
3
+ version: number;
4
+ label: string;
5
+ display: NMRiumPreferences;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Workspace } from './Workspace';
2
+ export declare const basic: Workspace;
@@ -0,0 +1,45 @@
1
+ export const basic = {
2
+ version: 1,
3
+ label: 'Default Mode',
4
+ display: {
5
+ general: {
6
+ disableMultipletAnalysis: false,
7
+ hideSetSumFromMolecule: false,
8
+ hideGeneralSettings: false,
9
+ hideExperimentalFeatures: false,
10
+ },
11
+ panels: {
12
+ hideSpectraPanel: false,
13
+ hideInformationPanel: false,
14
+ hidePeaksPanel: false,
15
+ hideIntegralsPanel: false,
16
+ hideRangesPanel: false,
17
+ hideStructuresPanel: false,
18
+ hideFiltersPanel: false,
19
+ hideZonesPanel: false,
20
+ hideSummaryPanel: false,
21
+ hideMultipleSpectraAnalysisPanel: false,
22
+ hideDatabasePanel: false,
23
+ },
24
+ toolBarButtons: {
25
+ hideZoomTool: false,
26
+ hideZoomOutTool: false,
27
+ hideImport: false,
28
+ hideExportAs: false,
29
+ hideSpectraStackAlignments: false,
30
+ hideSpectraCenterAlignments: false,
31
+ hideRealImaginary: false,
32
+ hidePeakTool: false,
33
+ hideIntegralTool: false,
34
+ hideZonePickingTool: false,
35
+ hideSlicingTool: false,
36
+ hideAutoRangesTool: false,
37
+ hideZeroFillingTool: false,
38
+ hidePhaseCorrectionTool: false,
39
+ hideBaseLineCorrectionTool: false,
40
+ hideFFTTool: false,
41
+ hideMultipleSpectraAnalysisTool: false,
42
+ hideExclusionZonesTool: false,
43
+ },
44
+ },
45
+ };
@@ -0,0 +1,2 @@
1
+ import { Workspace } from './Workspace';
2
+ export declare const exercise1D: Workspace;
@@ -0,0 +1,45 @@
1
+ export const exercise1D = {
2
+ version: 1,
3
+ label: 'Exercise 1D Mode',
4
+ display: {
5
+ general: {
6
+ disableMultipletAnalysis: true,
7
+ hideSetSumFromMolecule: true,
8
+ hideGeneralSettings: true,
9
+ hideExperimentalFeatures: true,
10
+ },
11
+ panels: {
12
+ hideSpectraPanel: false,
13
+ hideInformationPanel: true,
14
+ hidePeaksPanel: true,
15
+ hideIntegralsPanel: false,
16
+ hideRangesPanel: true,
17
+ hideStructuresPanel: true,
18
+ hideFiltersPanel: true,
19
+ hideZonesPanel: true,
20
+ hideSummaryPanel: true,
21
+ hideMultipleSpectraAnalysisPanel: true,
22
+ hideDatabasePanel: true,
23
+ },
24
+ toolBarButtons: {
25
+ hideZoomTool: false,
26
+ hideZoomOutTool: false,
27
+ hideImport: true,
28
+ hideExportAs: true,
29
+ hideSpectraStackAlignments: false,
30
+ hideSpectraCenterAlignments: false,
31
+ hideRealImaginary: true,
32
+ hidePeakTool: false,
33
+ hideIntegralTool: false,
34
+ hideZonePickingTool: true,
35
+ hideSlicingTool: true,
36
+ hideAutoRangesTool: true,
37
+ hideZeroFillingTool: true,
38
+ hidePhaseCorrectionTool: true,
39
+ hideBaseLineCorrectionTool: true,
40
+ hideFFTTool: true,
41
+ hideMultipleSpectraAnalysisTool: true,
42
+ hideExclusionZonesTool: true,
43
+ },
44
+ },
45
+ };
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ exercise1D: import("./Workspace").Workspace;
3
+ basic: import("./Workspace").Workspace;
4
+ process1D: import("./Workspace").Workspace;
5
+ };
6
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { basic } from './basic';
2
+ import { exercise1D } from './exercise1D';
3
+ import { process1D } from './process1D';
4
+ export default { exercise1D, basic, process1D };
@@ -0,0 +1,2 @@
1
+ import { Workspace } from './Workspace';
2
+ export declare const process1D: Workspace;
@@ -0,0 +1,43 @@
1
+ export const process1D = {
2
+ version: 1,
3
+ label: 'Process 1D Mode',
4
+ display: {
5
+ general: {
6
+ disableMultipletAnalysis: true,
7
+ hideSetSumFromMolecule: false,
8
+ hideGeneralSettings: false,
9
+ hideExperimentalFeatures: false,
10
+ },
11
+ panels: {
12
+ hideSpectraPanel: false,
13
+ hideInformationPanel: false,
14
+ hidePeaksPanel: false,
15
+ hideIntegralsPanel: false,
16
+ hideRangesPanel: true,
17
+ hideStructuresPanel: false,
18
+ hideFiltersPanel: false,
19
+ hideZonesPanel: true,
20
+ hideSummaryPanel: true,
21
+ hideMultipleSpectraAnalysisPanel: true,
22
+ hideDatabasePanel: false,
23
+ },
24
+ toolBarButtons: {
25
+ hideZoomTool: false,
26
+ hideZoomOutTool: false,
27
+ hideImport: true,
28
+ hideExportAs: true,
29
+ hideSpectraStackAlignments: false,
30
+ hideSpectraCenterAlignments: false,
31
+ hideRealImaginary: false,
32
+ hidePeakTool: false,
33
+ hideIntegralTool: false,
34
+ hideAutoRangesTool: true,
35
+ hideZeroFillingTool: false,
36
+ hidePhaseCorrectionTool: false,
37
+ hideBaseLineCorrectionTool: false,
38
+ hideFFTTool: false,
39
+ hideMultipleSpectraAnalysisTool: true,
40
+ hideExclusionZonesTool: true,
41
+ },
42
+ },
43
+ };
@@ -10,5 +10,8 @@ export function migrate(data) {
10
10
  migrateToVersion2,
11
11
  ];
12
12
  let index = data?.version || 0;
13
+ if (index > CURRENT_EXPORT_VERSION) {
14
+ throw new Error('This file can not be imported using the current NMRium version, Please move to the new one !!! ');
15
+ }
13
16
  return migrationPipe(migrationsFuncs.slice(index))(data);
14
17
  }
@@ -1 +1 @@
1
- export default { version: 'v0.20.2' };
1
+ export default { version: 'v0.21.0' };