nmrium 0.57.1 → 0.59.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 (139) hide show
  1. package/lib/component/1d/integral/IntegralResizable.js +2 -2
  2. package/lib/component/1d/matrix/useMatrix.d.ts +1 -1
  3. package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  4. package/lib/component/1d/ranges/Atoms.js +6 -4
  5. package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts +1 -1
  6. package/lib/component/1d-2d/components/SpectrumInfoBlock.js +114 -7
  7. package/lib/component/2d/Viewer2D.js +6 -2
  8. package/lib/component/2d/zones/Zone.js +2 -2
  9. package/lib/component/EventsTrackers/KeysListenerTracker.js +8 -8
  10. package/lib/component/context/ChartContext.js +12 -1
  11. package/lib/component/context/ShareDataContext.d.ts +1 -1
  12. package/lib/component/context/ShareDataContext.js +2 -4
  13. package/lib/component/context/ToasterContext.d.ts +1 -0
  14. package/lib/component/context/ToasterContext.js +12 -3
  15. package/lib/component/elements/ActionsButtonsPopover.d.ts +7 -1
  16. package/lib/component/elements/ActionsButtonsPopover.js +7 -6
  17. package/lib/component/elements/Alert.d.ts +20 -0
  18. package/lib/component/elements/Alert.js +80 -0
  19. package/lib/component/elements/ContextMenuBluePrint.d.ts +7 -2
  20. package/lib/component/elements/ContextMenuBluePrint.js +9 -3
  21. package/lib/component/elements/Input2.js +2 -2
  22. package/lib/component/elements/Input2Controller.d.ts +4 -2
  23. package/lib/component/elements/Input2Controller.js +22 -6
  24. package/lib/component/elements/MoleculeSelection.js +2 -2
  25. package/lib/component/elements/NextPrev.d.ts +4 -5
  26. package/lib/component/elements/NextPrev.js +76 -79
  27. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  28. package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +0 -3
  29. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +1 -1
  30. package/lib/component/elements/Select2.d.ts +12 -7
  31. package/lib/component/elements/Select2.js +5 -4
  32. package/lib/component/elements/Select2Controller.d.ts +2 -2
  33. package/lib/component/elements/Select2Controller.js +5 -5
  34. package/lib/component/elements/ToolbarPopoverItem.d.ts +7 -6
  35. package/lib/component/elements/ToolbarPopoverItem.js +13 -5
  36. package/lib/component/elements/print/PrintContent.d.ts +17 -0
  37. package/lib/component/elements/print/PrintContent.js +281 -0
  38. package/lib/component/elements/print/PrintProvider.d.ts +12 -0
  39. package/lib/component/elements/print/PrintProvider.js +28 -0
  40. package/lib/component/elements/print/index.d.ts +2 -0
  41. package/lib/component/elements/print/index.js +2 -0
  42. package/lib/component/header/ApodizationOptionsPanel.js +14 -7
  43. package/lib/component/header/BaseLineCorrectionPanel.js +20 -10
  44. package/lib/component/header/ZeroFillingOptionsPanel.js +17 -10
  45. package/lib/component/hooks/useSaveSettings.js +43 -26
  46. package/lib/component/hooks/useToggleSpectraVisibility.d.ts +14 -9
  47. package/lib/component/hooks/useToggleSpectraVisibility.js +45 -16
  48. package/lib/component/hooks/useWorkspaceAction.js +12 -14
  49. package/lib/component/loader/DropZone.js +3 -67
  50. package/lib/component/loader/useLoadFiles.d.ts +1 -0
  51. package/lib/component/loader/useLoadFiles.js +78 -0
  52. package/lib/component/main/InnerNMRium.d.ts +4 -3
  53. package/lib/component/main/InnerNMRium.js +4 -9
  54. package/lib/component/main/InnerNMRiumContents.d.ts +3 -2
  55. package/lib/component/main/InnerNMRiumContents.js +33 -29
  56. package/lib/component/main/NMRium.d.ts +2 -5
  57. package/lib/component/main/NMRium.js +1 -1
  58. package/lib/component/main/NMRiumRefAPI.d.ts +7 -0
  59. package/lib/component/main/NMRiumRefAPI.js +12 -0
  60. package/lib/component/main/NMRiumViewer.d.ts +10 -0
  61. package/lib/component/main/NMRiumViewer.js +35 -0
  62. package/lib/component/main/index.d.ts +1 -0
  63. package/lib/component/modal/CopyClipboardModal.d.ts +3 -2
  64. package/lib/component/modal/CopyClipboardModal.js +18 -32
  65. package/lib/component/modal/ExportAsJcampModal.d.ts +6 -3
  66. package/lib/component/modal/ExportAsJcampModal.js +69 -35
  67. package/lib/component/modal/ImportPublicationStringModal.js +1 -1
  68. package/lib/component/modal/LoadJCAMPModal.d.ts +3 -1
  69. package/lib/component/modal/LoadJCAMPModal.js +17 -18
  70. package/lib/component/modal/SaveAsModal.d.ts +3 -1
  71. package/lib/component/modal/SaveAsModal.js +20 -30
  72. package/lib/component/modal/changeSum/ChangeSumModal.js +1 -1
  73. package/lib/component/modal/changeSum/ChangeSumModalContents.js +35 -47
  74. package/lib/component/modal/changeSum/SelectMolecule.d.ts +2 -5
  75. package/lib/component/modal/changeSum/SelectMolecule.js +9 -8
  76. package/lib/component/modal/setting/GeneralSettings.js +4 -2
  77. package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.d.ts +1 -0
  78. package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +89 -0
  79. package/lib/component/modal/setting/settingsValidation.js +15 -1
  80. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +8 -5
  81. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +5 -1
  82. package/lib/component/panels/MoleculesPanel/MoleculePanel.js +5 -3
  83. package/lib/component/panels/Panels.js +15 -15
  84. package/lib/component/panels/PeaksPanel/PeaksPanel.js +8 -5
  85. package/lib/component/panels/RangesPanel/RangesHeader.js +52 -12
  86. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +13 -6
  87. package/lib/component/panels/SpectraPanel/SpectraTable.js +63 -21
  88. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +6 -2
  89. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +6 -2
  90. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -0
  91. package/lib/component/panels/ZonesPanel/ZonesPanel.js +16 -8
  92. package/lib/component/panels/databasePanel/DatabasePanel.js +7 -8
  93. package/lib/component/panels/filtersPanel/FilterPanel.js +9 -6
  94. package/lib/component/panels/filtersPanel/FiltersTable.js +12 -10
  95. package/lib/component/panels/header/DefaultPanelHeader.d.ts +1 -0
  96. package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
  97. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +10 -12
  98. package/lib/component/panels/predictionPanel/PredictionPanel.js +2 -2
  99. package/lib/component/reducer/IgnoreActions.js +1 -0
  100. package/lib/component/reducer/Reducer.js +2 -4
  101. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -13
  102. package/lib/component/reducer/actions/DatabaseActions.js +52 -34
  103. package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
  104. package/lib/component/reducer/actions/FiltersActions.js +9 -4
  105. package/lib/component/reducer/actions/SpectraActions.d.ts +2 -1
  106. package/lib/component/reducer/actions/SpectraActions.js +53 -43
  107. package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.d.ts +3 -0
  108. package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js +16 -0
  109. package/lib/component/reducer/preferences/actions/changeInformationBlockPosition.d.ts +3 -0
  110. package/lib/component/reducer/preferences/actions/changeInformationBlockPosition.js +5 -0
  111. package/lib/component/reducer/preferences/actions/changePrintPageSettings.d.ts +3 -0
  112. package/lib/component/reducer/preferences/actions/changePrintPageSettings.js +6 -0
  113. package/lib/component/reducer/preferences/actions/toggleInformationBlock.d.ts +3 -0
  114. package/lib/component/reducer/preferences/actions/toggleInformationBlock.js +7 -0
  115. package/lib/component/reducer/preferences/preferencesReducer.d.ts +12 -2
  116. package/lib/component/reducer/preferences/preferencesReducer.js +9 -0
  117. package/lib/component/toolbar/ToolBar.js +33 -14
  118. package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
  119. package/lib/data/SpectraManager.d.ts +7 -10
  120. package/lib/data/SpectraManager.js +51 -30
  121. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +0 -1
  122. package/lib/data/data1d/Spectrum1D/SumManager.js +2 -10
  123. package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +1 -1
  124. package/lib/data/data1d/Spectrum1D/index.d.ts +1 -1
  125. package/lib/data/data1d/Spectrum1D/index.js +1 -1
  126. package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +10 -10
  127. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +2 -1
  128. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +10 -10
  129. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +10 -10
  130. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.d.ts +13 -0
  131. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +65 -0
  132. package/lib/data/molecules/MoleculeManager.js +16 -38
  133. package/lib/data/utilities/getCustomColor.d.ts +1 -1
  134. package/lib/data/utilities/removeByPaths.d.ts +3 -0
  135. package/lib/data/utilities/removeByPaths.js +33 -0
  136. package/lib/versionInfo.js +1 -1
  137. package/package.json +36 -36
  138. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +0 -11
  139. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +0 -29
@@ -11,18 +11,18 @@ export declare function createRange(spectrum: Spectrum1D, options: Pick<Range, '
11
11
  delta: number;
12
12
  multiplicity: string;
13
13
  js: import("nmr-processing").Jcoupling[];
14
- atoms?: number[];
15
- assignment?: string;
16
- diaIDs?: string[];
17
- nbAtoms?: number;
18
- integration?: number;
14
+ atoms?: number[] | undefined;
15
+ assignment?: string | undefined;
16
+ diaIDs?: string[] | undefined;
17
+ nbAtoms?: number | undefined;
18
+ integration?: number | undefined;
19
19
  statistic?: {
20
20
  mean: number;
21
21
  sd: number;
22
22
  min: number;
23
23
  max: number;
24
24
  nb: number;
25
- };
25
+ } | undefined;
26
26
  kind: string;
27
27
  id: string;
28
28
  peaks: {
@@ -43,8 +43,8 @@ export declare function createRange(spectrum: Spectrum1D, options: Pick<Range, '
43
43
  kind: string;
44
44
  integration: number;
45
45
  nbAtoms?: number;
46
- multiplicity?: string;
47
- assignment?: string;
48
- diaIDs?: string[];
49
- pubIntegral?: number;
46
+ multiplicity?: string | undefined;
47
+ assignment?: string | undefined;
48
+ diaIDs?: string[] | undefined;
49
+ pubIntegral?: number | undefined;
50
50
  } | undefined;
@@ -7,6 +7,7 @@ export default function detectSignals(data, options) {
7
7
  const { fromIndex, toIndex } = xGetFromToIndex(data.x, { from, to });
8
8
  const size = toIndex - fromIndex;
9
9
  if (size <= 16 || size >= MAX_LENGTH) {
10
+ const frequencyCluster = (to - from) * frequency;
10
11
  const ranges = xyAutoRangesPicking(data, {
11
12
  logger,
12
13
  peakPicking: {
@@ -25,7 +26,7 @@ export default function detectSignals(data, options) {
25
26
  frequency,
26
27
  nucleus,
27
28
  compile: true,
28
- frequencyCluster: 16,
29
+ frequencyCluster,
29
30
  keepPeaks: true,
30
31
  clean: 0.3,
31
32
  },
@@ -11,18 +11,18 @@ export declare function initiateRanges(inputSpectrum: Partial<Spectrum1D>, spect
11
11
  delta: number;
12
12
  multiplicity: string;
13
13
  js: import("nmr-processing").Jcoupling[];
14
- atoms?: number[];
15
- assignment?: string;
16
- diaIDs?: string[];
17
- nbAtoms?: number;
18
- integration?: number;
14
+ atoms?: number[] | undefined;
15
+ assignment?: string | undefined;
16
+ diaIDs?: string[] | undefined;
17
+ nbAtoms?: number | undefined;
18
+ integration?: number | undefined;
19
19
  statistic?: {
20
20
  mean: number;
21
21
  sd: number;
22
22
  min: number;
23
23
  max: number;
24
24
  nb: number;
25
- };
25
+ } | undefined;
26
26
  kind: string;
27
27
  id: string;
28
28
  peaks: {
@@ -43,9 +43,9 @@ export declare function initiateRanges(inputSpectrum: Partial<Spectrum1D>, spect
43
43
  kind: string;
44
44
  integration: number;
45
45
  nbAtoms?: number;
46
- multiplicity?: string;
47
- assignment?: string;
48
- diaIDs?: string[];
49
- pubIntegral?: number;
46
+ multiplicity?: string | undefined;
47
+ assignment?: string | undefined;
48
+ diaIDs?: string[] | undefined;
49
+ pubIntegral?: number | undefined;
50
50
  }[];
51
51
  };
@@ -13,18 +13,18 @@ export declare function resizeRange(spectrum: Spectrum1D, options: {
13
13
  delta: number;
14
14
  multiplicity: string;
15
15
  js: import("nmr-processing").Jcoupling[];
16
- atoms?: number[];
17
- assignment?: string;
18
- diaIDs?: string[];
19
- nbAtoms?: number;
20
- integration?: number;
16
+ atoms?: number[] | undefined;
17
+ assignment?: string | undefined;
18
+ diaIDs?: string[] | undefined;
19
+ nbAtoms?: number | undefined;
20
+ integration?: number | undefined;
21
21
  statistic?: {
22
22
  mean: number;
23
23
  sd: number;
24
24
  min: number;
25
25
  max: number;
26
26
  nb: number;
27
- };
27
+ } | undefined;
28
28
  kind: string;
29
29
  id: string;
30
30
  peaks: {
@@ -45,8 +45,8 @@ export declare function resizeRange(spectrum: Spectrum1D, options: {
45
45
  kind: string;
46
46
  integration: number;
47
47
  nbAtoms?: number;
48
- multiplicity?: string;
49
- assignment?: string;
50
- diaIDs?: string[];
51
- pubIntegral?: number;
48
+ multiplicity?: string | undefined;
49
+ assignment?: string | undefined;
50
+ diaIDs?: string[] | undefined;
51
+ pubIntegral?: number | undefined;
52
52
  };
@@ -0,0 +1,13 @@
1
+ import { Spectrum1D } from 'nmr-load-save';
2
+ import { Info1D, NMRRange, NMRSignal1D } from 'nmr-processing';
3
+ import { UsedColors } from '../../../../types/UsedColors';
4
+ interface ResurrectSpectrumOptions {
5
+ info: Partial<Info1D>;
6
+ usedColors: UsedColors;
7
+ from?: number;
8
+ to?: number;
9
+ spectrumID?: string;
10
+ }
11
+ declare function resurrectSpectrumFromRanges(ranges: NMRRange[], options: ResurrectSpectrumOptions): Spectrum1D | undefined;
12
+ declare function resurrectSpectrumFromSignals(signals: NMRSignal1D[], options: ResurrectSpectrumOptions): Spectrum1D | undefined;
13
+ export { resurrectSpectrumFromRanges, resurrectSpectrumFromSignals };
@@ -0,0 +1,65 @@
1
+ import { rangesToXY, signalsToXY, } from 'nmr-processing';
2
+ import { initiateDatum1D } from '../initiateDatum1D';
3
+ function resurrectSpectrumFromRanges(ranges, options) {
4
+ const { spectrumID, usedColors, from, to, info } = options;
5
+ const { nucleus, solvent, name = null, baseFrequency = 400, originFrequency = 400, numberOfPoints = 2 ** 17, } = info;
6
+ try {
7
+ const { x, y } = rangesToXY(ranges, {
8
+ nucleus,
9
+ frequency: baseFrequency,
10
+ nbPoints: numberOfPoints,
11
+ from,
12
+ to,
13
+ });
14
+ const datum = initiateDatum1D({
15
+ id: spectrumID,
16
+ data: { x, im: null, re: y },
17
+ info: {
18
+ numberOfPoints,
19
+ nucleus,
20
+ originFrequency,
21
+ baseFrequency,
22
+ pulseSequence: '',
23
+ solvent,
24
+ isFt: true,
25
+ name,
26
+ },
27
+ ranges: { values: ranges, options: { sum: 100 } },
28
+ }, { usedColors });
29
+ return datum;
30
+ }
31
+ catch (error) {
32
+ reportError(error);
33
+ }
34
+ }
35
+ function resurrectSpectrumFromSignals(signals, options) {
36
+ const { spectrumID, usedColors, from, to, info } = options;
37
+ const { nucleus, solvent, name = null, baseFrequency = 400, originFrequency = 400, numberOfPoints: nbPoints = 2 ** 17, } = info;
38
+ try {
39
+ const { x, y } = signalsToXY(signals, {
40
+ frequency: baseFrequency,
41
+ nbPoints,
42
+ from,
43
+ to,
44
+ });
45
+ const datum = initiateDatum1D({
46
+ id: spectrumID,
47
+ data: { x, im: null, re: y },
48
+ info: {
49
+ nucleus,
50
+ originFrequency,
51
+ baseFrequency,
52
+ pulseSequence: '',
53
+ solvent,
54
+ isFt: true,
55
+ name,
56
+ },
57
+ ranges: { values: signals, options: { sum: 100 } },
58
+ }, { usedColors });
59
+ return datum;
60
+ }
61
+ catch (error) {
62
+ reportError(error);
63
+ }
64
+ }
65
+ export { resurrectSpectrumFromRanges, resurrectSpectrumFromSignals };
@@ -7,14 +7,11 @@ export function fromJSON(mols, reservedMolecules = []) {
7
7
  const molecules = [];
8
8
  for (const mol of mols) {
9
9
  const molecule = OCLMolecule.fromMolfile(mol.molfile);
10
- const fragments = molecule.getFragments();
11
- for (const fragment of fragments) {
12
- molecules.push(initMolecule({
13
- molfile: fragment.toMolfileV3(),
14
- label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
15
- id: mol.id,
16
- }));
17
- }
10
+ molecules.push(initMolecule({
11
+ molfile: molecule.toMolfileV3(),
12
+ label: mol.label || `P${getLabelNumber(reservedNumbers)}`,
13
+ id: mol.id,
14
+ }));
18
15
  }
19
16
  return molecules;
20
17
  }
@@ -23,42 +20,23 @@ export function addMolfile(molecules, molfile) {
23
20
  // try to parse molfile
24
21
  // this will throw if the molecule can not be parsed !
25
22
  const molecule = OCLMolecule.fromMolfile(molfile);
26
- const fragments = molecule.getFragments();
27
- for (const fragment of fragments) {
28
- molecules.push(initMolecule({
29
- molfile: fragment.toMolfileV3(),
30
- label: `P${getLabelNumber(reservedNumbers)}`,
31
- }));
32
- }
33
- // we will split if we have many fragments
23
+ molecules.push(initMolecule({
24
+ molfile: molecule.toMolfileV3(),
25
+ label: `P${getLabelNumber(reservedNumbers)}`,
26
+ }));
34
27
  }
35
28
  export function setMolfile(molecules, currentMolecule) {
36
29
  const { molfile, id, label } = currentMolecule;
37
- const reservedNumbers = extractLabelsNumbers(molecules);
38
30
  // try to parse molfile
39
31
  // this will throw if the molecule can not be parsed !
40
32
  const molecule = OCLMolecule.fromMolfile(molfile);
41
- const fragments = molecule.getFragments();
42
- if (fragments.length > 1) {
43
- molecules = molecules.filter((m) => m.id !== id);
44
- for (const fragment of fragments) {
45
- molecules.push(initMolecule({
46
- molfile: fragment.toMolfileV3(),
47
- label: `P${getLabelNumber(reservedNumbers)}`,
48
- }));
49
- }
50
- }
51
- else if (fragments.length === 1) {
52
- const fragment = fragments[0];
53
- const _mol = initMolecule({
54
- molfile: fragment.toMolfileV3(),
55
- id,
56
- label,
57
- });
58
- const molIndex = molecules.findIndex((m) => m.id === id);
59
- molecules.splice(molIndex, 1, _mol);
60
- }
61
- // we will split if we have many fragments
33
+ const _mol = initMolecule({
34
+ molfile: molecule.toMolfileV3(),
35
+ id,
36
+ label,
37
+ });
38
+ const molIndex = molecules.findIndex((m) => m.id === id);
39
+ molecules.splice(molIndex, 1, _mol);
62
40
  }
63
41
  export function extractNumber(value) {
64
42
  return /(?<number>\d+)/.exec(value)?.groups?.number || null;
@@ -1,4 +1,4 @@
1
1
  import { Color2D, Spectrum1D, Spectrum2D, SpectrumOneDimensionColor, SpectrumTwoDimensionsColor } from 'nmr-load-save';
2
2
  type ReturnColor<ColorType> = ColorType extends SpectrumOneDimensionColor ? string : Color2D;
3
- export declare function getCustomColor<SpectrumType extends Spectrum1D | Spectrum2D, ColorType extends SpectrumOneDimensionColor | SpectrumTwoDimensionsColor>(spectrum: SpectrumType, colors?: ColorType[]): ReturnColor<ColorType> | null;
3
+ export declare function getCustomColor<ColorType extends SpectrumOneDimensionColor | SpectrumTwoDimensionsColor>(spectrum: Spectrum1D | Spectrum2D, colors?: ColorType[]): ReturnColor<ColorType> | null;
4
4
  export {};
@@ -0,0 +1,3 @@
1
+ type Path = [string, string | null];
2
+ export declare function removeByPaths(obj: any, pathsWithKeys: Path[], matchValue: string | number): void;
3
+ export {};
@@ -0,0 +1,33 @@
1
+ export function removeByPaths(obj, pathsWithKeys, matchValue) {
2
+ for (const [path, key] of pathsWithKeys) {
3
+ remove(obj, path, key, matchValue);
4
+ }
5
+ }
6
+ function remove(obj, path, key, value) {
7
+ const pathParts = path.split('.');
8
+ let current = obj;
9
+ for (let i = 0; i < pathParts.length - 1; i++) {
10
+ current = current[pathParts[i]];
11
+ if (current === undefined || current === null) {
12
+ // eslint-disable-next-line no-console
13
+ console.error('Path not found:', path);
14
+ return;
15
+ }
16
+ }
17
+ const finalKey = pathParts.at(-1);
18
+ if (!finalKey)
19
+ return;
20
+ const target = current[finalKey];
21
+ if (Array.isArray(target)) {
22
+ if (target.length > 0 && typeof target[0] === 'object' && key) {
23
+ current[finalKey] = target.filter((item) => item[key] !== value);
24
+ }
25
+ }
26
+ else if (typeof target === 'object' && target !== null) {
27
+ // eslint-disable-next-line unicorn/no-lonely-if
28
+ if (Object.hasOwn(target, value)) {
29
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
30
+ delete target[value];
31
+ }
32
+ }
33
+ }
@@ -1 +1 @@
1
- export default { version: 'v0.57.1' };
1
+ export default { version: 'v0.59.0' };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nmrium",
3
3
  "description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
4
- "version": "0.57.1",
4
+ "version": "0.59.0",
5
5
  "license": "MIT",
6
6
  "module": "lib/component/main/index.js",
7
7
  "types": "lib/component/main/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "compile": "tsc --project tsconfig.esm.json",
20
20
  "copy-samples-toc": "cp src/demo/samples.json build/",
21
21
  "clean-lib": "rimraf lib",
22
- "dev": "vite --host localhost --port 3000 --strictPort --open",
22
+ "dev": "vite --host localhost --port 3000 --open",
23
23
  "eslint": "eslint . --cache",
24
24
  "eslint-fix": "npm run eslint -- --fix",
25
25
  "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
@@ -46,7 +46,7 @@
46
46
  "url": "git+https://github.com/cheminfo/nmrium.git"
47
47
  },
48
48
  "volta": {
49
- "node": "20.15.0"
49
+ "node": "22.5.1"
50
50
  },
51
51
  "overrides": {
52
52
  "react": "$react",
@@ -57,22 +57,22 @@
57
57
  "react-dom": ">=18.0.0"
58
58
  },
59
59
  "dependencies": {
60
- "@blueprintjs/core": "^5.10.4",
61
- "@blueprintjs/icons": "^5.10.0",
62
- "@blueprintjs/select": "^5.2.0",
63
- "@emotion/react": "^11.11.4",
64
- "@emotion/styled": "^11.11.5",
65
- "@hookform/resolvers": "^3.6.0",
60
+ "@blueprintjs/core": "^5.11.0",
61
+ "@blueprintjs/icons": "^5.11.0",
62
+ "@blueprintjs/select": "^5.2.2",
63
+ "@emotion/react": "^11.13.0",
64
+ "@emotion/styled": "^11.13.0",
65
+ "@hookform/resolvers": "^3.9.0",
66
66
  "@lukeed/uuid": "^2.0.1",
67
67
  "cheminfo-font": "^1.13.0",
68
- "cheminfo-types": "^1.7.3",
68
+ "cheminfo-types": "^1.8.0",
69
69
  "clipboard-polyfill": "^4.1.0",
70
70
  "convert-to-jcamp": "^5.4.10",
71
71
  "d3": "^7.9.0",
72
72
  "eventemitter3": "^5.0.1",
73
73
  "fifo-logger": "^1.0.0",
74
74
  "file-saver": "^2.0.5",
75
- "filelist-utils": "^1.11.0",
75
+ "filelist-utils": "^1.11.1",
76
76
  "formik": "^2.4.6",
77
77
  "immer": "^10.1.1",
78
78
  "jszip": "^3.10.1",
@@ -86,71 +86,71 @@
86
86
  "ml-gsd": "^12.1.6",
87
87
  "ml-matrix": "^6.11.1",
88
88
  "ml-signal-processing": "^1.0.4",
89
- "ml-spectra-processing": "^14.5.1",
89
+ "ml-spectra-processing": "^14.5.3",
90
90
  "ml-stat": "^1.3.3",
91
91
  "ml-tree-similarity": "^2.2.0",
92
92
  "multiplet-analysis": "^2.1.2",
93
93
  "nmr-correlation": "^2.3.3",
94
- "nmr-load-save": "^0.34.2",
95
- "nmr-processing": "^12.5.0",
94
+ "nmr-load-save": "^0.36.0",
95
+ "nmr-processing": "^12.11.0",
96
96
  "nmredata": "^0.9.11",
97
97
  "numeral": "^2.0.6",
98
- "openchemlib": "^8.14.0",
99
- "openchemlib-utils": "^6.1.0",
98
+ "openchemlib": "^8.15.0",
99
+ "openchemlib-utils": "^6.4.1",
100
100
  "papaparse": "^5.4.1",
101
101
  "re-resizable": "6.9.17",
102
102
  "react-d3-utils": "^1.0.0",
103
103
  "react-dropzone": "^14.2.3",
104
104
  "react-error-boundary": "^4.0.13",
105
- "react-hook-form": "^7.52.0",
105
+ "react-hook-form": "^7.52.2",
106
106
  "react-icons": "^5.2.1",
107
107
  "react-inspector": "^6.0.2",
108
108
  "react-mf": "^2.0.3",
109
109
  "react-ocl": "^6.1.0",
110
110
  "react-ocl-nmr": "^3.0.2",
111
- "react-plot": "^1.4.2",
112
- "react-rnd": "^10.4.11",
113
- "react-science": "^4.1.2",
111
+ "react-plot": "^2.0.0",
112
+ "react-rnd": "^10.4.12",
113
+ "react-science": "^6.0.0",
114
114
  "react-table": "^7.8.0",
115
115
  "react-transition-group": "^4.4.5",
116
- "react-use": "^17.5.0",
116
+ "react-use": "^17.5.1",
117
117
  "smart-array-filter": "^4.0.2",
118
118
  "yup": "^1.4.0"
119
119
  },
120
120
  "devDependencies": {
121
- "@babel/plugin-transform-modules-commonjs": "^7.24.7",
121
+ "@babel/plugin-transform-modules-commonjs": "^7.24.8",
122
122
  "@babel/preset-react": "^7.24.7",
123
123
  "@babel/preset-typescript": "^7.24.7",
124
- "@playwright/test": "^1.45.0",
124
+ "@playwright/test": "^1.46.0",
125
125
  "@simbathesailor/use-what-changed": "^2.0.0",
126
126
  "@types/d3": "^7.4.3",
127
- "@types/lodash": "^4.17.6",
128
- "@types/node": "^20.14.9",
127
+ "@types/lodash": "^4.17.7",
128
+ "@types/node": "^22.1.0",
129
129
  "@types/papaparse": "^5.3.14",
130
130
  "@types/react": "^18.3.3",
131
131
  "@types/react-dom": "^18.3.0",
132
132
  "@types/react-table": "^7.7.20",
133
133
  "@vitejs/plugin-react-swc": "^3.7.0",
134
- "@vitest/coverage-v8": "^1.6.0",
134
+ "@vitest/coverage-v8": "^2.0.5",
135
135
  "cross-env": "^7.0.3",
136
- "cspell": "^8.9.1",
136
+ "cspell": "^8.13.2",
137
137
  "eslint": "^8.57.0",
138
- "eslint-config-cheminfo-react": "^12.0.0",
139
- "eslint-config-cheminfo-typescript": "^13.0.0",
138
+ "eslint-config-cheminfo-react": "^13.0.0",
139
+ "eslint-config-cheminfo-typescript": "^15.0.0",
140
140
  "modern-normalize": "^2.0.0",
141
141
  "postcss-styled-syntax": "^0.6.4",
142
- "prettier": "^3.3.2",
142
+ "prettier": "^3.3.3",
143
143
  "rc-menu": "^9.14.1",
144
144
  "react": "^18.3.1",
145
145
  "react-dom": "^18.3.1",
146
- "react-router-dom": "^6.24.0",
147
- "rimraf": "^5.0.7",
146
+ "react-router-dom": "^6.26.0",
147
+ "rimraf": "^6.0.1",
148
148
  "rollup-plugin-analyzer": "^4.0.0",
149
149
  "serve": "^14.2.3",
150
- "stylelint": "^16.6.1",
150
+ "stylelint": "^16.8.1",
151
151
  "stylelint-config-standard": "^36.0.1",
152
- "typescript": "^5.5.2",
153
- "vite": "^5.3.2",
154
- "vitest": "^1.6.0"
152
+ "typescript": "^5.5.4",
153
+ "vite": "^5.4.0",
154
+ "vitest": "^2.0.5"
155
155
  }
156
156
  }
@@ -1,11 +0,0 @@
1
- import { Spectrum1D } from 'nmr-load-save';
2
- import { NMRRange } from 'nmr-processing';
3
- import { UsedColors } from '../../../../types/UsedColors';
4
- export interface ResurrectSpectrumInfo {
5
- nucleus: string;
6
- solvent: string;
7
- name?: string;
8
- frequency?: number;
9
- color?: string;
10
- }
11
- export declare function generateSpectrumFromRanges(ranges: NMRRange[], info: ResurrectSpectrumInfo, usedColors: UsedColors): Spectrum1D | undefined;
@@ -1,29 +0,0 @@
1
- import { rangesToXY } from 'nmr-processing';
2
- import { initiateDatum1D } from '../initiateDatum1D';
3
- export function generateSpectrumFromRanges(ranges, info, usedColors) {
4
- const { nucleus, solvent, name = null, frequency = 400 } = info;
5
- try {
6
- const { x, y } = rangesToXY(ranges, {
7
- nucleus,
8
- frequency,
9
- nbPoints: 2 ** 17,
10
- });
11
- const datum = initiateDatum1D({
12
- data: { x, im: null, re: y },
13
- info: {
14
- nucleus,
15
- originFrequency: frequency,
16
- baseFrequency: frequency,
17
- pulseSequence: '',
18
- solvent,
19
- isFt: true,
20
- name,
21
- },
22
- ranges: { values: ranges, options: { sum: 100 } },
23
- }, { usedColors });
24
- return datum;
25
- }
26
- catch (error) {
27
- reportError(error);
28
- }
29
- }