nmrium 0.54.0 → 0.55.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 (106) hide show
  1. package/lib/component/1d/XAxis.js +1 -1
  2. package/lib/component/1d/integral/IntegralsSeries.js +2 -2
  3. package/lib/component/1d/integral/Integration.d.ts +3 -1
  4. package/lib/component/1d/integral/Integration.js +3 -2
  5. package/lib/component/1d/peaks/PeakEditionManager.js +5 -3
  6. package/lib/component/1d/ranges/AssignmentActionsButtons.d.ts +1 -0
  7. package/lib/component/1d/ranges/AssignmentActionsButtons.js +3 -3
  8. package/lib/component/1d/ranges/AssignmentLabel.d.ts +1 -1
  9. package/lib/component/1d/ranges/AssignmentLabel.js +31 -4
  10. package/lib/component/1d/ranges/Atoms.js +4 -5
  11. package/lib/component/1d/ranges/Range.js +48 -6
  12. package/lib/component/1d/ranges/Ranges.js +2 -1
  13. package/lib/component/1d/ranges/RangesIntegrals.js +11 -4
  14. package/lib/component/1d-2d/FieldEdition.d.ts +13 -0
  15. package/lib/component/1d-2d/FieldEdition.js +42 -0
  16. package/lib/component/2d/Chart2D.js +5 -3
  17. package/lib/component/2d/zones/Zone.js +18 -2
  18. package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts +7 -0
  19. package/lib/component/2d/zones/ZonesAssignmentsLabels.js +286 -0
  20. package/lib/component/EventsTrackers/KeysListenerTracker.js +14 -1
  21. package/lib/component/context/ShareDataContext.d.ts +10 -0
  22. package/lib/component/context/ShareDataContext.js +22 -0
  23. package/lib/component/elements/ActionsButtonsPopover.d.ts +10 -0
  24. package/lib/component/elements/ActionsButtonsPopover.js +22 -0
  25. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +7 -5
  26. package/lib/component/elements/ReactTable/ReactTable.d.ts +2 -2
  27. package/lib/component/elements/SVGButton.d.ts +14 -0
  28. package/lib/component/elements/SVGButton.js +6 -0
  29. package/lib/component/elements/SVGGroup.js +15 -13
  30. package/lib/component/elements/SVGText.d.ts +8 -0
  31. package/lib/component/elements/SVGText.js +24 -0
  32. package/lib/component/elements/draggable/SVGDraggable.d.ts +2 -2
  33. package/lib/component/elements/formik/FormikInput.d.ts +2 -1
  34. package/lib/component/elements/formik/FormikInput.js +4 -3
  35. package/lib/component/header/Header.js +7 -10
  36. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +1 -0
  37. package/lib/component/hooks/useCheckPointsNumberInWindowArea.d.ts +1 -1
  38. package/lib/component/hooks/useFormatNumberByNucleus.d.ts +1 -1
  39. package/lib/component/hooks/useFormatNumberByNucleus.js +8 -7
  40. package/lib/component/hooks/useIntegralPath.d.ts +2 -0
  41. package/lib/component/hooks/useIntegralPath.js +3 -1
  42. package/lib/component/hooks/usePanelPreferences.js +1 -2
  43. package/lib/component/hooks/useSaveSettings.js +7 -14
  44. package/lib/component/hooks/useTriggerNewAssignmentLabel.d.ts +4 -0
  45. package/lib/component/hooks/useTriggerNewAssignmentLabel.js +8 -0
  46. package/lib/component/hooks/useWorkspaceAction.d.ts +7 -0
  47. package/lib/component/hooks/useWorkspaceAction.js +89 -0
  48. package/lib/component/loader/DropZone.js +0 -3
  49. package/lib/component/main/InnerNMRium.js +3 -1
  50. package/lib/component/main/InnerNMRiumContents.js +14 -2
  51. package/lib/component/main/NMRiumStateProvider.js +4 -2
  52. package/lib/component/modal/editRange/forms/components/DeltaInput.js +3 -3
  53. package/lib/component/modal/editRange/forms/components/NewSignalTab.js +17 -12
  54. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +30 -13
  55. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +26 -16
  56. package/lib/component/modal/setting/GeneralSettings.js +7 -21
  57. package/lib/component/modal/setting/WorkspaceItem.js +1 -1
  58. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.d.ts +2 -0
  59. package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +99 -0
  60. package/lib/component/modal/setting/settingsValidation.js +36 -40
  61. package/lib/component/panels/SpectraPanel/SpectraPreferences.js +13 -1
  62. package/lib/component/panels/SpectraPanel/base/setting/PlotChart.js +1 -1
  63. package/lib/component/panels/SpectraPanel/base/setting/Spectrum2DHistogram.js +1 -1
  64. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.d.ts +6 -0
  65. package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentLabelColumn.js +16 -0
  66. package/lib/component/panels/ZonesPanel/ZonesPanel.js +18 -2
  67. package/lib/component/panels/ZonesPanel/ZonesPreferences.js +15 -9
  68. package/lib/component/panels/ZonesPanel/ZonesTable.js +2 -2
  69. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +3 -2
  70. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +1 -1
  71. package/lib/component/reducer/IgnoreActions.js +1 -0
  72. package/lib/component/reducer/Reducer.js +6 -0
  73. package/lib/component/reducer/actions/DomainActions.d.ts +7 -2
  74. package/lib/component/reducer/actions/DomainActions.js +29 -1
  75. package/lib/component/reducer/actions/RangesActions.js +12 -6
  76. package/lib/component/reducer/actions/ZonesActions.d.ts +15 -2
  77. package/lib/component/reducer/actions/ZonesActions.js +47 -13
  78. package/lib/component/reducer/helper/setRangesViewProperty.d.ts +1 -0
  79. package/lib/component/reducer/helper/setRangesViewProperty.js +11 -11
  80. package/lib/component/reducer/preferences/actions/addWorkspace.js +4 -23
  81. package/lib/component/reducer/preferences/actions/analyzeSpectra.js +4 -4
  82. package/lib/component/reducer/preferences/actions/initPreferences.js +2 -4
  83. package/lib/component/reducer/preferences/actions/matrixGeneration.js +3 -3
  84. package/lib/component/reducer/preferences/actions/removeWorkspace.js +0 -5
  85. package/lib/component/reducer/preferences/actions/setActiveWorkspace.js +0 -4
  86. package/lib/component/reducer/preferences/actions/setPanelsPreferences.js +1 -1
  87. package/lib/component/reducer/preferences/actions/setPreferences.js +2 -16
  88. package/lib/component/reducer/preferences/preferencesReducer.d.ts +7 -0
  89. package/lib/component/reducer/preferences/preferencesReducer.js +21 -18
  90. package/lib/component/toolbar/ToolBar.js +18 -14
  91. package/lib/component/utility/PreferencesHelper.js +5 -4
  92. package/lib/component/utility/export.js +4 -0
  93. package/lib/component/workspaces/assignment.js +0 -1
  94. package/lib/component/workspaces/basic.js +0 -1
  95. package/lib/component/workspaces/embedded.js +0 -1
  96. package/lib/component/workspaces/exercise.js +26 -29
  97. package/lib/component/workspaces/prediction.js +171 -174
  98. package/lib/component/workspaces/process1D.js +0 -1
  99. package/lib/component/workspaces/simulation.js +35 -38
  100. package/lib/component/workspaces/workspaceDefaultProperties.js +9 -11
  101. package/lib/versionInfo.js +1 -1
  102. package/package.json +31 -31
  103. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.d.ts +0 -2
  104. package/lib/component/modal/setting/settings-tabs/FormattingTabContent.js +0 -80
  105. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.d.ts +0 -2
  106. package/lib/component/reducer/preferences/utilities/mapNucleiFormatting.js +0 -10
@@ -1,80 +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 { v4 } from '@lukeed/uuid';
5
- import { useFormikContext } from 'formik';
6
- import lodashGet from 'lodash/get';
7
- import { FaPlus, FaTimes } from 'react-icons/fa';
8
- import Button from '../../../elements/Button';
9
- import { GroupPane } from '../../../elements/GroupPane';
10
- import FormikInput from '../../../elements/formik/FormikInput';
11
- const styles = css `
12
- .counter-col {
13
- width: 30px;
14
- }
15
-
16
- .nucleus-label-col {
17
- display: flex;
18
- justify-content: center;
19
- width: 80px;
20
- }
21
-
22
- .input {
23
- width: 100% !important;
24
- margin: 0 !important;
25
- }
26
-
27
- .nucleus-format-input-col {
28
- text-align: center;
29
- width: 100px;
30
- }
31
-
32
- th {
33
- font-size: 11px;
34
- font-weight: 600;
35
- }
36
-
37
- .operation-container {
38
- display: flex;
39
- }
40
-
41
- .add {
42
- background-color: transparent;
43
- border: 0;
44
- outline: none;
45
-
46
- svg {
47
- font-size: 14px;
48
- fill: green;
49
- }
50
- }
51
- `;
52
- function FormattingTabContent() {
53
- const { values, setFieldValue } = useFormikContext();
54
- const nuclei = lodashGet(values, 'formatting.nuclei', {});
55
- function deleteHandler(key) {
56
- const _nuclei = {};
57
- for (const nucleus in nuclei) {
58
- if (nucleus !== key) {
59
- _nuclei[nucleus] = nuclei[nucleus];
60
- }
61
- }
62
- void setFieldValue('formatting.nuclei', _nuclei);
63
- }
64
- function addHandler() {
65
- const newFormat = {
66
- name: '',
67
- ppm: '0.00',
68
- hz: '0.00',
69
- };
70
- const key = v4();
71
- const newNuclei = { ...nuclei, [key]: newFormat };
72
- void setFieldValue('formatting.nuclei', newNuclei);
73
- }
74
- const nucleiList = Object.keys(nuclei);
75
- return (_jsx(GroupPane, { text: "Number formatting for crosshair and info line", children: _jsx("div", { css: styles, children: _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: "counter-col", children: "#" }), _jsx("th", { className: "nucleus-label-col", children: "Nucleus " }), _jsx("th", { className: "nucleus-format-input-col", children: "\u03B4 (ppm)" }), _jsx("th", { className: "nucleus-format-input-col", children: "Coupling (Hz)" }), _jsx("th", { className: "nucleus-format-input-col" })] }) }), _jsx("tbody", { children: nucleiList?.map((key, index) => {
76
- const num = index + 1;
77
- return (_jsxs("tr", { children: [_jsxs("td", { className: "counter-col", children: [_jsxs("span", { children: [num, " - "] }), ' '] }), _jsx("td", { className: "nucleus-label-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.name`, className: "input", checkErrorAfterInputTouched: false }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.ppm`, className: "input" }) }), _jsx("td", { className: "nucleus-format-input-col", children: _jsx(FormikInput, { name: `formatting.nuclei.${key}.hz`, className: "input" }) }), _jsxs("td", { className: "operation-container", children: [_jsx(Button.Danger, { style: { fontSize: '14px' }, fill: "clear", onClick: () => deleteHandler(key), children: _jsx(FaTimes, {}) }), nucleiList.length === index + 1 && (_jsx(Button.Done, { fill: "clear", style: { fontSize: '14px' }, onClick: addHandler, children: _jsx(FaPlus, {}) }))] })] }, key));
78
- }) })] }) }) }));
79
- }
80
- export default FormattingTabContent;
@@ -1,2 +0,0 @@
1
- import { Formatting } from 'nmr-load-save';
2
- export declare function mapNucleiFormatting(formatting: Formatting): Formatting;
@@ -1,10 +0,0 @@
1
- export function mapNucleiFormatting(formatting) {
2
- const { nuclei, ...res } = formatting;
3
- return {
4
- nuclei: Object.fromEntries(Object.keys(nuclei).map((key) => [
5
- nuclei[key].name.trim().toLowerCase(),
6
- nuclei[key],
7
- ])),
8
- ...res,
9
- };
10
- }