nmrium 0.42.0 → 0.43.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 (217) hide show
  1. package/lib/component/1d/ApodizationLine.js +1 -1
  2. package/lib/component/1d/Chart1D.js +3 -2
  3. package/lib/component/1d/Line.js +1 -1
  4. package/lib/component/1d/Viewer1D.js +15 -3
  5. package/lib/component/1d/integral/IntegralResizable.js +4 -3
  6. package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  7. package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
  8. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
  9. package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
  10. package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
  11. package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
  12. package/lib/component/1d/peaks/Peaks.d.ts +1 -0
  13. package/lib/component/1d/peaks/Peaks.js +22 -0
  14. package/lib/component/1d/ranges/Range.js +3 -1
  15. package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
  16. package/lib/component/1d/tool/BaseLineZones.js +11 -31
  17. package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
  18. package/lib/component/1d/utilities/intersectionResolver.js +71 -0
  19. package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -2
  20. package/lib/component/2d/SlicingView.js +1 -1
  21. package/lib/component/2d/ft/Contours.js +1 -1
  22. package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
  23. package/lib/component/EventsTrackers/KeysListenerTracker.js +47 -6
  24. package/lib/component/assignment/index.d.ts +6 -1
  25. package/lib/component/assignment/index.js +5 -1
  26. package/lib/component/context/DispatchContext.d.ts +1 -2
  27. package/lib/component/context/KeyModifierContext.d.ts +13 -0
  28. package/lib/component/context/KeyModifierContext.js +39 -0
  29. package/lib/component/context/PreferencesContext.d.ts +39 -39
  30. package/lib/component/elements/Button.js +2 -0
  31. package/lib/component/elements/NumberInput.d.ts +1 -0
  32. package/lib/component/elements/NumberInput.js +10 -3
  33. package/lib/component/elements/formik/FormikOnChange.js +1 -1
  34. package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  35. package/lib/component/header/ApodizationOptionsPanel.js +23 -14
  36. package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
  37. package/lib/component/header/Header.d.ts +10 -3
  38. package/lib/component/header/Header.js +5 -5
  39. package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
  40. package/lib/component/highlight/index.d.ts +1 -0
  41. package/lib/component/highlight/index.js +1 -0
  42. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  43. package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
  44. package/lib/component/hooks/useResizerStatus.d.ts +2 -0
  45. package/lib/component/hooks/useResizerStatus.js +7 -0
  46. package/lib/component/hooks/useSpectrum.js +1 -1
  47. package/lib/component/main/ErrorOverlay.js +20 -0
  48. package/lib/component/main/InnerNMRium.d.ts +7 -0
  49. package/lib/component/main/InnerNMRium.js +52 -0
  50. package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
  51. package/lib/component/main/InnerNMRiumContents.js +89 -0
  52. package/lib/component/main/NMRium.d.ts +23 -0
  53. package/lib/component/main/NMRium.js +13 -0
  54. package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
  55. package/lib/component/main/NMRiumStateProvider.js +74 -0
  56. package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  57. package/lib/component/main/StateError.d.ts +4 -0
  58. package/lib/component/main/StateError.js +16 -0
  59. package/lib/component/main/index.d.ts +3 -0
  60. package/lib/component/main/index.js +3 -0
  61. package/lib/component/main/types.d.ts +18 -0
  62. package/lib/component/main/types.js +2 -0
  63. package/lib/component/modal/PredictSpectraModal.js +1 -1
  64. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
  65. package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
  66. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
  67. package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
  68. package/lib/component/modal/setting/GeneralSettings.js +2 -2
  69. package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
  70. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
  71. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  72. package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
  73. package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
  74. package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +3 -3
  75. package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +4 -4
  76. package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
  77. package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
  78. package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  79. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -3
  80. package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
  81. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  82. package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
  83. package/lib/component/panels/header/DefaultPanelHeader.js +9 -5
  84. package/lib/component/panels/predictionPanel/PredictionPanel.js +1 -1
  85. package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  86. package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  87. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  88. package/lib/component/reducer/IgnoreActions.js +0 -1
  89. package/lib/component/reducer/Reducer.d.ts +1 -6
  90. package/lib/component/reducer/Reducer.js +30 -6
  91. package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
  92. package/lib/component/reducer/actions/FiltersActions.js +96 -28
  93. package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
  94. package/lib/component/reducer/actions/IntegralsActions.js +44 -20
  95. package/lib/component/reducer/actions/MoleculeActions.js +1 -1
  96. package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
  97. package/lib/component/reducer/actions/PeaksActions.js +19 -1
  98. package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
  99. package/lib/component/reducer/actions/RangesActions.js +31 -3
  100. package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
  101. package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
  102. package/lib/component/toolbar/FunctionToolBar.js +13 -3
  103. package/lib/component/toolbar/ToolTypes.d.ts +1 -0
  104. package/lib/component/toolbar/ToolTypes.js +36 -0
  105. package/lib/component/utility/export.js +7 -4
  106. package/lib/component/utility/filterType.d.ts +3 -0
  107. package/lib/component/utility/filterType.js +1 -0
  108. package/lib/component/workspaces/basic.js +2 -0
  109. package/lib/component/workspaces/embedded.js +2 -0
  110. package/lib/component/workspaces/exercise.js +2 -0
  111. package/lib/component/workspaces/prediction.js +9 -0
  112. package/lib/component/workspaces/process1D.js +2 -0
  113. package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
  114. package/lib/data/PredictionManager.d.ts +3 -3
  115. package/lib/data/PredictionManager.js +10 -10
  116. package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
  117. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
  118. package/lib/data/molecules/Molecule.js +2 -2
  119. package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
  120. package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
  121. package/lib/versionInfo.js +1 -1
  122. package/lib-cjs/component/1d/ApodizationLine.js +1 -1
  123. package/lib-cjs/component/1d/Chart1D.js +3 -2
  124. package/lib-cjs/component/1d/Line.js +1 -1
  125. package/lib-cjs/component/1d/Viewer1D.js +15 -3
  126. package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
  127. package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
  128. package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
  129. package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
  130. package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
  131. package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
  132. package/lib-cjs/component/1d/ranges/Range.js +3 -1
  133. package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
  134. package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
  135. package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +3 -2
  136. package/lib-cjs/component/2d/SlicingView.js +1 -1
  137. package/lib-cjs/component/2d/ft/Contours.js +1 -1
  138. package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +46 -5
  139. package/lib-cjs/component/assignment/index.js +5 -1
  140. package/lib-cjs/component/context/KeyModifierContext.js +44 -0
  141. package/lib-cjs/component/elements/Button.js +2 -0
  142. package/lib-cjs/component/elements/NumberInput.js +12 -2
  143. package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
  144. package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
  145. package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
  146. package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
  147. package/lib-cjs/component/header/Header.js +5 -5
  148. package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
  149. package/lib-cjs/component/highlight/index.js +1 -0
  150. package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
  151. package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
  152. package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
  153. package/lib-cjs/component/hooks/useSpectrum.js +1 -1
  154. package/lib-cjs/component/main/ErrorOverlay.js +26 -0
  155. package/lib-cjs/component/main/InnerNMRium.js +82 -0
  156. package/lib-cjs/component/main/InnerNMRiumContents.js +96 -0
  157. package/lib-cjs/component/main/NMRium.js +19 -0
  158. package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
  159. package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
  160. package/lib-cjs/component/main/StateError.js +20 -0
  161. package/lib-cjs/component/main/index.js +21 -0
  162. package/lib-cjs/component/main/types.js +3 -0
  163. package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
  164. package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
  165. package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
  166. package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
  167. package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
  168. package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
  169. package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
  170. package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +4 -4
  171. package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
  172. package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
  173. package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
  174. package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +27 -3
  175. package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
  176. package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
  177. package/lib-cjs/component/panels/header/DefaultPanelHeader.js +11 -5
  178. package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +1 -1
  179. package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
  180. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
  181. package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
  182. package/lib-cjs/component/reducer/IgnoreActions.js +0 -1
  183. package/lib-cjs/component/reducer/Reducer.js +29 -5
  184. package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
  185. package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
  186. package/lib-cjs/component/reducer/actions/MoleculeActions.js +1 -1
  187. package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
  188. package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
  189. package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
  190. package/lib-cjs/component/toolbar/ToolTypes.js +36 -0
  191. package/lib-cjs/component/utility/export.js +7 -4
  192. package/lib-cjs/component/utility/filterType.js +2 -0
  193. package/lib-cjs/component/workspaces/basic.js +2 -0
  194. package/lib-cjs/component/workspaces/embedded.js +2 -0
  195. package/lib-cjs/component/workspaces/exercise.js +2 -0
  196. package/lib-cjs/component/workspaces/prediction.js +9 -0
  197. package/lib-cjs/component/workspaces/process1D.js +2 -0
  198. package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
  199. package/lib-cjs/data/PredictionManager.js +9 -9
  200. package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
  201. package/lib-cjs/data/molecules/Molecule.js +2 -2
  202. package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
  203. package/lib-cjs/versionInfo.js +1 -1
  204. package/package.json +26 -25
  205. package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
  206. package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
  207. package/lib/component/ErrorOverlay.js +0 -27
  208. package/lib/component/NMRium.d.ts +0 -42
  209. package/lib/component/NMRium.js +0 -237
  210. package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
  211. package/lib/component/reducer/actions/GlobalActions.js +0 -4
  212. package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
  213. package/lib-cjs/component/ErrorOverlay.js +0 -30
  214. package/lib-cjs/component/NMRium.js +0 -267
  215. package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
  216. /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
  217. /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
@@ -4,6 +4,13 @@ exports.prediction = void 0;
4
4
  exports.prediction = {
5
5
  version: 1,
6
6
  label: 'Prediction',
7
+ general: {
8
+ dimmedSpectraOpacity: 0.5,
9
+ verticalSplitterPosition: '440px',
10
+ verticalSplitterCloseThreshold: 600,
11
+ spectraRendering: 'auto',
12
+ loggingLevel: 'info',
13
+ },
7
14
  display: {
8
15
  panels: {
9
16
  spectraPanel: { display: true },
@@ -31,6 +38,8 @@ exports.prediction = {
31
38
  zoomOut: true,
32
39
  zoom: true,
33
40
  autoRangeAndZonePicking: true,
41
+ fftDimension1: true,
42
+ fftDimension2: true,
34
43
  },
35
44
  },
36
45
  formatting: {
@@ -31,6 +31,8 @@ exports.process1D = {
31
31
  exclusionZones: true,
32
32
  multipleSpectraAnalysis: true,
33
33
  autoRangeAndZonePicking: true,
34
+ fftDimension1: true,
35
+ fftDimension2: true,
34
36
  },
35
37
  },
36
38
  };
@@ -47,6 +47,8 @@ exports.workspaceDefaultProperties = {
47
47
  zoom: false,
48
48
  peakPicking: false,
49
49
  autoRangeAndZonePicking: false,
50
+ fftDimension1: false,
51
+ fftDimension2: false,
50
52
  },
51
53
  },
52
54
  general: {
@@ -49,16 +49,16 @@ exports.FREQUENCIES = [
49
49
  { value: 1000, label: '1000 MHz' },
50
50
  { value: 1200, label: '1200 MHz' },
51
51
  ];
52
- const baseURL = 'https://nmr-prediction.service.zakodium.com';
53
- async function predictSpectra(molfile) {
52
+ async function predictSpectra(molfile, options) {
54
53
  const molecule = full_1.default.Molecule.fromMolfile(molfile);
55
- return (0, nmr_processing_1.predictAll)(molecule, {
56
- predictOptions: {
57
- C: {
58
- webserviceURL: `${baseURL}/v1/predict/carbon`,
59
- },
60
- },
61
- });
54
+ const predictOptions = {};
55
+ for (const key in options) {
56
+ if (!options[key])
57
+ continue;
58
+ const experiment = key === 'proton' ? 'H' : key === 'carbon' ? 'C' : key;
59
+ predictOptions[experiment] = {};
60
+ }
61
+ return (0, nmr_processing_1.predict)(molecule, { predictOptions });
62
62
  }
63
63
  exports.predictSpectra = predictSpectra;
64
64
  function generateName(name, options) {
@@ -8,7 +8,6 @@ const uuid_1 = require("@lukeed/uuid");
8
8
  const ml_spectra_processing_1 = require("ml-spectra-processing");
9
9
  const nmr_processing_1 = require("nmr-processing");
10
10
  const SignalsKinds_1 = require("../../../constants/SignalsKinds");
11
- const SumManager_1 = require("../SumManager");
12
11
  const detectSignal_1 = __importDefault(require("./detectSignal"));
13
12
  function createRangeObj({ from, to, absolute, signal, }) {
14
13
  return {
@@ -23,7 +22,7 @@ function createRangeObj({ from, to, absolute, signal, }) {
23
22
  }
24
23
  exports.createRangeObj = createRangeObj;
25
24
  function addRange(spectrum, options) {
26
- const { from, to, molecules, nucleus } = options;
25
+ const { from, to } = options;
27
26
  const { x, re } = spectrum.data;
28
27
  const absolute = (0, ml_spectra_processing_1.xyIntegration)({ x, y: re }, { from, to, reverse: true });
29
28
  // detectSignal use the advance multiplet-analysis that can crash if too many points
@@ -43,12 +42,7 @@ function addRange(spectrum, options) {
43
42
  }
44
43
  try {
45
44
  if (range) {
46
- spectrum.ranges.options = (0, SumManager_1.initSumOptions)(spectrum.ranges.options, {
47
- molecules,
48
- nucleus,
49
- });
50
45
  spectrum.ranges.values = spectrum.ranges.values.concat((0, nmr_processing_1.mapRanges)([range], spectrum));
51
- (0, nmr_processing_1.updateRangesRelativeValues)(spectrum);
52
46
  }
53
47
  }
54
48
  catch (error) {
@@ -10,8 +10,8 @@ const getAtomsFromMF_1 = __importDefault(require("../utilities/getAtomsFromMF"))
10
10
  exports.DRAGGABLE_STRUCTURE_INITIAL_BOUNDING_REACT = {
11
11
  x: 100,
12
12
  y: 50,
13
- width: 100,
14
- height: 100,
13
+ width: 190,
14
+ height: 200,
15
15
  };
16
16
  function initMolecule(options = {}) {
17
17
  const id = options.id || (0, uuid_1.v4)();
@@ -1,18 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const modifiersKeys = [
4
+ 'Alt',
5
+ 'AltGraph',
6
+ 'Control',
7
+ 'Meta',
8
+ 'Shift',
9
+ ];
3
10
  function checkModifierKeyActivated(event) {
4
- const modifiersKeys = [
5
- 'Alt',
6
- 'AltGraph',
7
- 'Control',
8
- 'Meta',
9
- 'Shift',
10
- ];
11
- for (const key of modifiersKeys) {
12
- if (event.getModifierState(key)) {
13
- return true;
14
- }
15
- }
16
- return false;
11
+ return modifiersKeys.some((key) => event.getModifierState(key));
17
12
  }
18
13
  exports.default = checkModifierKeyActivated;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = { version: 'v0.42.0' };
3
+ exports.default = { version: 'v0.43.0' };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "nmrium",
3
3
  "description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
4
- "version": "0.42.0",
4
+ "version": "0.43.0",
5
5
  "license": "MIT",
6
- "main": "lib-cjs/component/NMRium.js",
7
- "module": "lib/component/NMRium.js",
8
- "types": "lib/component/NMRium.d.ts",
6
+ "main": "lib-cjs/component/main/index.js",
7
+ "module": "lib/component/main/index.js",
8
+ "types": "lib/component/main/index.d.ts",
9
9
  "files": [
10
10
  "lib",
11
11
  "lib-cjs"
@@ -47,7 +47,7 @@
47
47
  "url": "git+https://github.com/cheminfo/nmrium.git"
48
48
  },
49
49
  "volta": {
50
- "node": "18.16.1"
50
+ "node": "18.17.0"
51
51
  },
52
52
  "overrides": {
53
53
  "react": "$react",
@@ -59,8 +59,9 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@emotion/react": "^11.11.1",
62
+ "@emotion/styled": "^11.11.0",
62
63
  "@lukeed/uuid": "^2.0.1",
63
- "cheminfo-font": "^1.10.0",
64
+ "cheminfo-font": "^1.11.0",
64
65
  "cheminfo-types": "^1.7.2",
65
66
  "clipboard-polyfill": "^4.0.0",
66
67
  "convert-to-jcamp": "^5.4.7",
@@ -68,8 +69,8 @@
68
69
  "eventemitter3": "^5.0.1",
69
70
  "fifo-logger": "^0.6.1",
70
71
  "file-saver": "^2.0.5",
71
- "filelist-utils": "^1.10.0",
72
- "formik": "^2.4.2",
72
+ "filelist-utils": "^1.10.2",
73
+ "formik": "^2.4.3",
73
74
  "immer": "^10.0.2",
74
75
  "jszip": "^3.10.1",
75
76
  "lodash": "^4.17.21",
@@ -86,25 +87,25 @@
86
87
  "ml-stat": "^1.3.3",
87
88
  "multiplet-analysis": "^2.1.2",
88
89
  "nmr-correlation": "^2.3.3",
89
- "nmr-load-save": "^0.15.1",
90
- "nmr-processing": "^9.7.8",
90
+ "nmr-load-save": "^0.17.2",
91
+ "nmr-processing": "^10.0.5",
91
92
  "nmredata": "^0.9.2",
92
93
  "numeral": "^2.0.6",
93
94
  "openchemlib": "^8.3.0",
94
- "openchemlib-utils": "^2.7.1",
95
+ "openchemlib-utils": "^4.3.2",
95
96
  "papaparse": "^5.4.1",
96
- "re-resizable": "^6.9.9",
97
+ "re-resizable": "6.9.6",
97
98
  "react-d3-utils": "^1.0.0",
98
99
  "react-dropzone": "^14.2.3",
99
100
  "react-error-boundary": "^4.0.10",
100
101
  "react-icons": "^4.10.1",
101
102
  "react-inspector": "^6.0.2",
102
103
  "react-mf": "^2.0.2",
103
- "react-ocl": "^5.0.1",
104
- "react-ocl-nmr": "^2.0.0",
104
+ "react-ocl": "^6.1.0",
105
+ "react-ocl-nmr": "^3.0.0",
105
106
  "react-plot": "^1.4.2",
106
107
  "react-rnd": "^10.4.1",
107
- "react-science": "^0.24.3",
108
+ "react-science": "^0.25.0",
108
109
  "react-slider": "^2.0.6",
109
110
  "react-table": "^7.8.0",
110
111
  "react-transition-group": "^4.4.5",
@@ -116,25 +117,25 @@
116
117
  "@babel/plugin-transform-modules-commonjs": "^7.22.5",
117
118
  "@babel/preset-react": "^7.22.5",
118
119
  "@babel/preset-typescript": "^7.22.5",
119
- "@playwright/test": "^1.36.1",
120
+ "@playwright/test": "^1.36.2",
120
121
  "@simbathesailor/use-what-changed": "^2.0.0",
121
122
  "@types/d3": "^7.4.0",
122
- "@types/node": "^20.4.2",
123
+ "@types/node": "^20.4.8",
123
124
  "@types/papaparse": "^5.3.7",
124
- "@types/react": "^18.2.15",
125
+ "@types/react": "^18.2.19",
125
126
  "@types/react-dom": "^18.2.7",
126
127
  "@types/react-table": "^7.7.14",
127
128
  "@vitejs/plugin-react-swc": "^3.3.2",
128
- "@vitest/coverage-v8": "^0.33.0",
129
+ "@vitest/coverage-v8": "^0.34.1",
129
130
  "cross-env": "^7.0.3",
130
131
  "cspell": "^6.31.2",
131
- "eslint": "^8.45.0",
132
+ "eslint": "^8.46.0",
132
133
  "eslint-config-cheminfo-react": "^10.0.0",
133
- "eslint-config-cheminfo-typescript": "^12.0.3",
134
+ "eslint-config-cheminfo-typescript": "^12.0.4",
134
135
  "modern-normalize": "^2.0.0",
135
136
  "postcss-styled-syntax": "^0.4.0",
136
- "prettier": "^3.0.0",
137
- "rc-menu": "^9.11.0",
137
+ "prettier": "^3.0.1",
138
+ "rc-menu": "^9.11.1",
138
139
  "react": "^18.2.0",
139
140
  "react-dom": "^18.2.0",
140
141
  "react-router-dom": "^6.14.2",
@@ -144,7 +145,7 @@
144
145
  "stylelint": "^15.10.2",
145
146
  "stylelint-config-standard": "^34.0.0",
146
147
  "typescript": "~5.1.6",
147
- "vite": "^4.4.4",
148
- "vitest": "^0.33.0"
148
+ "vite": "^4.4.9",
149
+ "vitest": "^0.34.1"
149
150
  }
150
151
  }
@@ -1,12 +0,0 @@
1
- interface PeakAnnotationProps {
2
- id: string;
3
- x: number;
4
- y: number;
5
- sign: number;
6
- color: string;
7
- value: number;
8
- nucleus: string;
9
- }
10
- declare function PeakAnnotation({ id, x, y, sign, // 1 positive -1 negative
11
- value, color, nucleus, }: PeakAnnotationProps): import("@emotion/react/jsx-runtime").JSX.Element;
12
- export default PeakAnnotation;
@@ -1,116 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import { css } from '@emotion/react';
4
- import { useRef, useState, useCallback, useLayoutEffect, useEffect, useMemo, } from 'react';
5
- import { useDispatch } from '../../context/DispatchContext';
6
- import { HighlightEventSource, useHighlight } from '../../highlight';
7
- import { usePanelPreferences } from '../../hooks/usePanelPreferences';
8
- import { formatNumber } from '../../utility/formatNumber';
9
- const styles = css `
10
- input {
11
- user-select: text;
12
- }
13
-
14
- input[type='number']::-webkit-outer-spin-button,
15
- input[type='number']::-webkit-inner-spin-button {
16
- appearance: none;
17
- margin: 0;
18
- }
19
-
20
- input[type='number'] {
21
- appearance: textfield;
22
- }
23
-
24
- .notification-input-normal {
25
- opacity: 1;
26
- left: 4px;
27
- position: fixed;
28
- font-size: 10px;
29
- outline: none;
30
- background-color: transparent;
31
- }
32
-
33
- .notification-input-normal input:focus {
34
- outline: none;
35
- background-color: white;
36
- }
37
-
38
- .input-over {
39
- background-color: white;
40
- outline: none;
41
- }
42
- `;
43
- function PeakAnnotation({ id, x, y, sign, // 1 positive -1 negative
44
- value, color, nucleus, }) {
45
- const refText = useRef(null);
46
- const [isSelected, setIsSelected] = useState(false);
47
- const [_value, setValue] = useState(value);
48
- const [containerSize, setContainerSize] = useState({ width: 0, height: 0 });
49
- const { deltaPPM } = usePanelPreferences('peaks', nucleus);
50
- const highlight = useHighlight([id], {
51
- type: HighlightEventSource.PEAK,
52
- extra: { id },
53
- });
54
- const dispatch = useDispatch();
55
- const handleOnPeakChange = useCallback((e) => dispatch({ type: 'SHIFT_SPECTRUM', payload: { shift: e.shiftValue } }), [dispatch]);
56
- useLayoutEffect(() => {
57
- const textBox = refText.current?.getBBox();
58
- setContainerSize({
59
- width: textBox?.width || 0,
60
- height: textBox?.height || 0,
61
- });
62
- }, [isSelected]);
63
- useEffect(() => {
64
- setValue(value);
65
- }, [value]);
66
- const handleKeyDown = useCallback((event) => {
67
- if (event.key === 'Enter') {
68
- const newValue = event.currentTarget.valueAsNumber;
69
- if (!Number.isNaN(newValue)) {
70
- const shiftValue = newValue - value;
71
- handleOnPeakChange({
72
- id,
73
- value: newValue,
74
- oldValue: value,
75
- shiftValue,
76
- });
77
- event.currentTarget.blur();
78
- setIsSelected(false);
79
- }
80
- }
81
- else if (event.key === 'Escape') {
82
- setValue(value);
83
- event.currentTarget.blur();
84
- setIsSelected(false);
85
- }
86
- }, [value, handleOnPeakChange, id]);
87
- const handleChange = useCallback((event) => {
88
- setValue(event.target.value);
89
- }, []);
90
- const handleSelectPeakAnnotation = useCallback((e) => {
91
- e.stopPropagation();
92
- setIsSelected(true);
93
- return false;
94
- }, []);
95
- const handleOnEnterNotation = useCallback(() => {
96
- highlight.show();
97
- }, [highlight]);
98
- const handleOnMouseLeaveNotation = useCallback(() => {
99
- highlight.hide();
100
- }, [highlight]);
101
- const newValue = useMemo(() => (isSelected ? value : formatNumber(value, deltaPPM.format)), [deltaPPM.format, isSelected, value]);
102
- const oldValue = useMemo(() => (isSelected ? _value : formatNumber(_value, deltaPPM.format)), [_value, deltaPPM.format, isSelected]);
103
- return (_jsxs("g", { css: styles, id: id, style: { outline: 'none' }, transform: `translate(${x}, ${y})`, onMouseEnter: handleOnEnterNotation, onMouseLeave: handleOnMouseLeaveNotation, children: [_jsx("line", { x1: "0", x2: "0", y1: sign === -1 ? 10 : 0, y2: sign === -1 ? 28 : -18, stroke: color, strokeWidth: highlight.isActive ? '7px' : '1px' }), _jsx("text", { ref: refText, className: "peaks-text", x: "0", y: sign === -1 ? 28 : -12, dy: "0", dx: "0.35em", fill: "transparent", fontSize: "10px", fontWeight: "100", style: {
104
- position: 'absolute',
105
- }, children: newValue }), _jsx("foreignObject", { x: "0", y: sign === -1 ? 16 : -22, dy: "0.1em", dx: "0.35em", width: containerSize.width + 20, height: "40px", "data-no-export": "true", children: _jsx("div", { style: {
106
- width: containerSize.width + 20,
107
- height: '100%',
108
- paddingRight: 5,
109
- }, children: _jsx("input", { onClick: handleSelectPeakAnnotation, className: isSelected ? 'input-over' : 'notification-input-normal', style: {
110
- width: 'inherit',
111
- border: isSelected ? `1px solid ${color}` : `0`,
112
- userSelect: 'none',
113
- color,
114
- }, value: oldValue, onKeyDown: handleKeyDown, onChange: handleChange, type: "number" }) }) })] }));
115
- }
116
- export default PeakAnnotation;
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const styles = {
3
- container: {
4
- margin: '25px',
5
- },
6
- header: {
7
- backgroundColor: '#ffffff',
8
- padding: '20px',
9
- borderRadius: '10px',
10
- fontSize: '30px',
11
- textAlign: 'center',
12
- },
13
- title: {
14
- textDecoration: 'underline',
15
- },
16
- body: {
17
- marginTop: '10px',
18
- whiteSpace: 'pre-wrap',
19
- backgroundColor: 'white',
20
- padding: '20px',
21
- borderRadius: '10px',
22
- color: 'red',
23
- },
24
- };
25
- export default function ErrorOverlay(props) {
26
- return (_jsxs("div", { style: styles.container, children: [_jsx("p", { style: styles.header, children: "Something went wrong." }), _jsxs("details", { style: styles.body, children: [_jsx("p", { style: styles.title, children: props.error.message }), props.error.stack] })] }));
27
- }
@@ -1,42 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { WebSource } from 'filelist-utils';
3
- import { CorrelationData } from 'nmr-correlation';
4
- import { NmriumState, CustomWorkspaces, WorkspacePreferences as NMRiumPreferences, Spectrum } from 'nmr-load-save';
5
- import { ReactElement, ReactNode } from 'react';
6
- import { ErrorBoundaryPropsWithComponent } from 'react-error-boundary';
7
- import { BlobObject } from './utility/export';
8
- export { serializeNmriumState } from 'nmr-load-save';
9
- export type { NmriumState, WorkspacePreferences as NMRiumPreferences, } from 'nmr-load-save';
10
- export type NMRiumWorkspace = 'exercise' | 'process1D' | 'default' | 'prediction' | 'embedded' | 'assignment' | 'simulation' | (string & {});
11
- export type OnNMRiumChange = (state: NmriumState, source: 'data' | 'view' | 'settings') => void;
12
- export interface NMRiumProps {
13
- data?: NMRiumData;
14
- onChange?: OnNMRiumChange;
15
- noErrorBoundary?: boolean;
16
- onError?: ErrorBoundaryPropsWithComponent['onError'];
17
- workspace?: NMRiumWorkspace;
18
- customWorkspaces?: CustomWorkspaces;
19
- preferences?: NMRiumPreferences;
20
- emptyText?: ReactNode;
21
- /**
22
- * Returns a custom spinner that will be rendered while loading data.
23
- */
24
- getSpinner?: () => ReactElement;
25
- }
26
- export type Molecules = Array<{
27
- molfile: string;
28
- }>;
29
- type DeepPartial<T> = {
30
- [P in keyof T]?: DeepPartial<T[P]>;
31
- };
32
- export interface NMRiumData {
33
- source?: WebSource;
34
- molecules?: Molecules;
35
- spectra: Array<DeepPartial<Spectrum>>;
36
- correlations?: CorrelationData;
37
- }
38
- export interface NMRiumRef {
39
- getSpectraViewerAsBlob: () => BlobObject | null;
40
- }
41
- declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<NMRiumProps & import("react").RefAttributes<NMRiumRef>>>;
42
- export default _default;