@zakodium/nmrium-core-plugins-ui 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts +400 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.js +34 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.d.ts +2 -2
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.js +4 -26
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.js +2 -3
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.d.ts +3 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.js +33 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.js.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.d.ts +2 -2
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.js +4 -5
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.js +2 -3
- package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.d.ts +2 -2
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.js +3 -4
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.d.ts +2 -2
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.js +3 -4
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.js +2 -3
- package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.js.map +1 -1
- package/package.json +5 -4
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization.hook.ts +43 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization.ts +2 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.tsx +7 -32
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization_tool.tsx +2 -3
- package/src/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.tsx +64 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.tsx +6 -15
- package/src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx +2 -3
- package/src/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.tsx +5 -6
- package/src/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.tsx +5 -6
- package/src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx +2 -3
|
@@ -4,7 +4,7 @@ import { castSpectrum1D } from '@zakodium/nmrium-core';
|
|
|
4
4
|
import { autoPhaseCorrection } from 'nmr-processing';
|
|
5
5
|
import { AppForm, useForm } from 'react-science/ui';
|
|
6
6
|
export function PhaseCorrectionExpanded(props) {
|
|
7
|
-
const { operation, core, children,
|
|
7
|
+
const { operation, core, children, onSubmit, onChange, spectrum } = props;
|
|
8
8
|
castSpectrum1D(spectrum);
|
|
9
9
|
const { settings } = operation;
|
|
10
10
|
const operator = core.getOperationOperator('@zakodium/nmrium-core-plugins#phaseCorrection1D', operation);
|
|
@@ -14,22 +14,21 @@ export function PhaseCorrectionExpanded(props) {
|
|
|
14
14
|
validators: { onDynamic: schemaSettings },
|
|
15
15
|
validationLogic: revalidateLogic(),
|
|
16
16
|
onSubmit: ({ value }) => {
|
|
17
|
-
if (!
|
|
17
|
+
if (!onSubmit)
|
|
18
18
|
return;
|
|
19
19
|
const newOperation = {
|
|
20
20
|
...operation,
|
|
21
21
|
settings: schemaSettings.parse(value),
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
onSubmit(newOperation);
|
|
24
24
|
},
|
|
25
25
|
listeners: {
|
|
26
|
-
onMount: () => onMount(),
|
|
27
26
|
onChange: ({ formApi }) => {
|
|
28
27
|
const result = schemaSettings.safeParse(formApi.state.values);
|
|
29
28
|
if (!result.success)
|
|
30
29
|
return;
|
|
31
30
|
const liveOperation = { ...operation, settings: result.data };
|
|
32
|
-
|
|
31
|
+
onChange(liveOperation);
|
|
33
32
|
},
|
|
34
33
|
},
|
|
35
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase_correction_expanded.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,UAAU,uBAAuB,CACrC,
|
|
1
|
+
{"version":3,"file":"phase_correction_expanded.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,UAAU,uBAAuB,CACrC,KAA+F;IAE/F,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE1E,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEzB,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CACxC,iDAAiD,EACjD,SAAS,CACV,CAAC;IAEF,MAAM,EAAE,cAAc,EAAE,GAAG,QAAQ,CAAC;IACpC,MAAM,IAAI,GAAG,OAAO,CAAC;QACnB,aAAa,EAAE,QAAQ;QACvB,UAAU,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE;QACzC,eAAe,EAAE,eAAe,EAAE;QAClC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YACtB,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAEtB,MAAM,YAAY,GAAG;gBACnB,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,CAAC,MAAM,IACX,KAAK,EAAC,MAAM,EACZ,MAAM,EAAC,QAAQ,EACf,KAAK,EAAE;gCACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;gCAC1C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gCACpC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;6BACzC,GACD,EAED,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,CACjC,8BACE,KAAC,IAAI,CAAC,QAAQ,IAAC,IAAI,EAAC,KAAK,YACtB,CAAC,KAAK,EAAE,EAAE,CAAC,CACV,KAAC,KAAK,CAAC,qBAAqB,IAC1B,KAAK,EAAC,KAAK,EACX,cAAc,EAAC,6BAA6B,EAC5C,eAAe,EAAC,SAAS,GACzB,CACH,GACa,EAEhB,KAAC,IAAI,CAAC,QAAQ,IAAC,IAAI,EAAC,KAAK,YACtB,CAAC,KAAK,EAAE,EAAE,CAAC,CACV,KAAC,KAAK,CAAC,qBAAqB,IAC1B,KAAK,EAAC,KAAK,EACX,cAAc,EAAC,6BAA6B,EAC5C,eAAe,EAAC,SAAS,GACzB,CACH,GACa,IACf,CACJ,IACA,CACJ,GACa,IACR,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase_correction_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,uBAAuB,CAAC;AAmB/B,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,6BAA6B,CAAC,iDAAiD,CAAC,
|
|
1
|
+
{"version":3,"file":"phase_correction_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,uBAAuB,CAAC;AAmB/B,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,6BAA6B,CAAC,iDAAiD,CAAC,sCAmDxF"}
|
|
@@ -16,9 +16,8 @@ function defaultPhaseCorrectionOperation() {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export function PhaseCorrectionTool(props) {
|
|
19
|
-
const { spectrum,
|
|
20
|
-
const
|
|
21
|
-
const isActive = firstLiveProcessing === '@zakodium/nmrium-core-plugins#phaseCorrection1D';
|
|
19
|
+
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
20
|
+
const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#phaseCorrection1D';
|
|
22
21
|
const isVisible = isSpectrum1DFt(spectrum) && spectrum.info.isComplex;
|
|
23
22
|
const triggerOperation = useEventCallback((event) => {
|
|
24
23
|
if ('stopImmediatePropagation' in event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase_correction_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,SAAS,+BAA+B;IACtC,OAAO;QACL,UAAU,EAAE,iDAAiD;QAC7D,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;QAC/B,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,UAAU,EAAE;QACjB,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,KAAuF;IAEvF,MAAM,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"phase_correction_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,SAAS,+BAA+B;IACtC,OAAO;QACL,UAAU,EAAE,iDAAiD;QAC7D,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;QAC/B,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,UAAU,EAAE;QACjB,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,KAAuF;IAEvF,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEjE,MAAM,QAAQ,GACZ,gBAAgB,KAAK,iDAAiD,CAAC;IAEzE,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;IAEtE,MAAM,gBAAgB,GAAG,gBAAgB,CACvC,CAAC,KAAiC,EAAE,EAAE;QACpC,IAAI,0BAA0B,IAAI,KAAK,EAAE,CAAC;YACxC,wCAAwC;YACxC,+CAA+C;YAC/C,KAAK,CAAC,wBAAwB,EAAE,CAAC;QACnC,CAAC;QAED,kBAAkB,CAAC,+BAA+B,EAAE,CAAC,CAAC;IACxD,CAAC,CACF,CAAC;IAEF,MAAM,OAAO,GAAG,OAAO,CAAiB,GAAG,EAAE;QAC3C,OAAO;YACL;gBACE,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,kBAAkB;gBACzB,MAAM,EAAE,IAAI;gBACZ,SAAS,EAAE,gBAAgB;aAC5B;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAE5B,OAAO,CACL,KAAC,OAAO,CAAC,IAAI,IACX,EAAE,EAAC,iDAAiD,EACpD,IAAI,EAAE,KAAC,qBAAqB,KAAG,EAC/B,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,kBAAkB,EACxB,SAAS,EAAE,CAAC,GAAG,CAAC,EAChB,WAAW,EAAC,gLAAgL,EAC5L,IAAI,EAAC,qCAAqC,GAC1C,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function ShiftXExpanded(props:
|
|
1
|
+
import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
2
|
+
export declare function ShiftXExpanded(props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#shiftX1D'>): import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=shift_x_expanded.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shift_x_expanded.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"shift_x_expanded.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAKnF,wBAAgB,cAAc,CAC5B,KAAK,EAAE,qCAAqC,CAAC,wCAAwC,CAAC,+BA8DvF"}
|
|
@@ -4,7 +4,7 @@ import { useMemo } from 'react';
|
|
|
4
4
|
import { AppForm, useForm } from 'react-science/ui';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
export function ShiftXExpanded(props) {
|
|
7
|
-
const { operation, core, children, onChange,
|
|
7
|
+
const { operation, core, children, onChange, onSubmit } = props;
|
|
8
8
|
const { settings } = operation;
|
|
9
9
|
const operator = core.getOperationOperator('@zakodium/nmrium-core-plugins#shiftX1D', operation);
|
|
10
10
|
const defaultValues = useMemo(() => {
|
|
@@ -30,16 +30,15 @@ export function ShiftXExpanded(props) {
|
|
|
30
30
|
...operation,
|
|
31
31
|
settings: shift,
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
onSubmit(newOperation);
|
|
34
34
|
},
|
|
35
35
|
listeners: {
|
|
36
|
-
onMount: () => onMount(),
|
|
37
36
|
onChange: ({ formApi }) => {
|
|
38
37
|
const result = validation.safeParse(formApi.state.values);
|
|
39
38
|
if (!result.success)
|
|
40
39
|
return;
|
|
41
40
|
const liveOperation = { ...operation, settings: result.data.shift };
|
|
42
|
-
|
|
41
|
+
onChange(liveOperation);
|
|
43
42
|
},
|
|
44
43
|
},
|
|
45
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shift_x_expanded.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,UAAU,cAAc,CAC5B,
|
|
1
|
+
{"version":3,"file":"shift_x_expanded.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,UAAU,cAAc,CAC5B,KAAsF;IAEtF,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEhE,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CACxC,wCAAwC,EACxC,SAAS,CACV,CAAC;IAEF,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO;YACL,KAAK,EAAE,QAAQ;SAChB,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,MAAM,EAAE,cAAc,EAAE,GAAG,QAAQ,CAAC;IACpC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,OAAO,CAAC,CAAC,MAAM,CAAC;YACd,KAAK,EAAE,cAAc;SACtB,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,MAAM,IAAI,GAAG,OAAO,CAAC;QACnB,aAAa;QACb,UAAU,EAAE,EAAE,SAAS,EAAE,UA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peratorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
2
|
+
export declare function ZeroFillingExpand(props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#zeroFilling1D'>): import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=zero_filling_expand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero_filling_expand.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"zero_filling_expand.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAsBnF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,qCAAqC,CAAC,6CAA6C,CAAC,+BA6D5F"}
|
|
@@ -20,7 +20,7 @@ const options = [
|
|
|
20
20
|
{ label: '2M', value: 2 ** 21 },
|
|
21
21
|
];
|
|
22
22
|
export function ZeroFillingExpand(props) {
|
|
23
|
-
const { operation,
|
|
23
|
+
const { operation, onSubmit, onChange, core, children } = props;
|
|
24
24
|
const operator = core.getOperationOperator('@zakodium/nmrium-core-plugins#zeroFilling1D', operation);
|
|
25
25
|
const validator = useMemo(() => z.object({
|
|
26
26
|
size: operator.schemaSettings,
|
|
@@ -32,15 +32,14 @@ export function ZeroFillingExpand(props) {
|
|
|
32
32
|
validationLogic: revalidateLogic(),
|
|
33
33
|
onSubmit: ({ value }) => {
|
|
34
34
|
const { size: settings } = validator.parse(value);
|
|
35
|
-
|
|
35
|
+
onSubmit({ ...operation, settings });
|
|
36
36
|
},
|
|
37
37
|
listeners: {
|
|
38
|
-
onMount: () => onMount(),
|
|
39
38
|
onChange: ({ formApi }) => {
|
|
40
39
|
const result = validator.safeParse(formApi.state.values);
|
|
41
40
|
if (!result.success)
|
|
42
41
|
return;
|
|
43
|
-
|
|
42
|
+
onChange({ ...operation, settings: result.data.size });
|
|
44
43
|
},
|
|
45
44
|
},
|
|
46
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero_filling_expand.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAChC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IACjC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IACjC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IACjC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;CAChC,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAC/B,
|
|
1
|
+
{"version":3,"file":"zero_filling_expand.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;IAChC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,C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EAAC,MAAM,EAAC,SAAS,sBAE/C,CAChB,EAED,KAAC,QAAQ,IAAC,IAAI,EAAC,MAAM,YAClB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAC,MAAM,IAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,UAAU,GAAI,GAClD,IACH,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero_filling_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,6BAA6B,EAG9B,MAAM,uBAAuB,CAAC;AA6B/B,wBAAgB,eAAe,CAC7B,KAAK,EAAE,6BAA6B,CAAC,6CAA6C,CAAC,
|
|
1
|
+
{"version":3,"file":"zero_filling_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,6BAA6B,EAG9B,MAAM,uBAAuB,CAAC;AA6B/B,wBAAgB,eAAe,CAC7B,KAAK,EAAE,6BAA6B,CAAC,6CAA6C,CAAC,sCAmDpF"}
|
|
@@ -18,9 +18,8 @@ function defaultZeroFillingOperation(spectrum) {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export function ZeroFillingTool(props) {
|
|
21
|
-
const {
|
|
22
|
-
const
|
|
23
|
-
const isActive = firstLiveProcessing === '@zakodium/nmrium-core-plugins#zeroFilling1D';
|
|
21
|
+
const { onTriggerOperation, spectrum, activeOperatorId } = props;
|
|
22
|
+
const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#zeroFilling1D';
|
|
24
23
|
const isVisible = isSpectrum1DFid(spectrum) && spectrum.info.isComplex;
|
|
25
24
|
const triggerOperation = useEventCallback((event) => {
|
|
26
25
|
if ('stopImmediatePropagation' in event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero_filling_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM/C,OAAO,EACL,cAAc,EACd,UAAU,EACV,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,SAAS,2BAA2B,CAClC,QAAkB;IAElB,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEzB,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAEnE,OAAO;QACL,UAAU,EAAE,6CAA6C;QACzD,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,UAAU,EAAE;QACjB,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAmF;IAEnF,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"zero_filling_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM/C,OAAO,EACL,cAAc,EACd,UAAU,EACV,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,kBAA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C,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAE5B,OAAO,CACL,KAAC,OAAO,CAAC,IAAI,IACX,EAAE,EAAC,6CAA6C,EAChD,IAAI,EAAE,KAAC,iBAAiB,KAAG,EAC3B,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,cAAc,EACpB,SAAS,EAAE,CAAC,GAAG,CAAC,EAChB,WAAW,EAAC,wIAAwI,EACpJ,IAAI,EAAC,2CAA2C,GAChD,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,gBAAgB,GACzB,CACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,OAAO,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakodium/nmrium-core-plugins-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"license": "CC-BY-NC-SA-4.0",
|
|
5
5
|
"description": "UI related plugins needed for cheminfo/nmrium",
|
|
6
6
|
"keywords": [],
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
"@blueprintjs/core": "^6.17.2",
|
|
27
27
|
"@blueprintjs/icons": "^6.13.0",
|
|
28
28
|
"@blueprintjs/select": "^6.3.3",
|
|
29
|
+
"@emotion/styled": "^11.14.1",
|
|
29
30
|
"@tanstack/react-form": "^1.33.2",
|
|
30
|
-
"@zakodium/nmrium-core": "^0.7.
|
|
31
|
-
"@zakodium/nmrium-core-plugins": "^0.7.
|
|
31
|
+
"@zakodium/nmrium-core": "^0.7.51",
|
|
32
|
+
"@zakodium/nmrium-core-plugins": "^0.7.68",
|
|
32
33
|
"fifo-logger": "^2.0.1",
|
|
33
34
|
"react": "^18.3.1",
|
|
34
35
|
"react-dom": "^18.3.1",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"typescript": "~6.0.3",
|
|
44
45
|
"vitest": "^4.1.10"
|
|
45
46
|
},
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "e25197c70fd9c0f6d4e0e30222d9840321df80ce"
|
|
47
48
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { revalidateLogic } from '@tanstack/react-form';
|
|
2
|
+
import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useForm } from 'react-science/ui';
|
|
5
|
+
|
|
6
|
+
export function useApodizationForm(
|
|
7
|
+
props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
|
|
8
|
+
) {
|
|
9
|
+
const { operation, onSubmit, onChange, core } = props;
|
|
10
|
+
const operator = core.getOperationOperator(
|
|
11
|
+
'@zakodium/nmrium-core-plugins#apodization1D',
|
|
12
|
+
operation,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const validator = operator.schemaSettings;
|
|
16
|
+
const defaultValues = operation.settings;
|
|
17
|
+
const form = useForm({
|
|
18
|
+
defaultValues,
|
|
19
|
+
validators: { onDynamic: validator },
|
|
20
|
+
validationLogic: revalidateLogic(),
|
|
21
|
+
onSubmit: ({ value }) => {
|
|
22
|
+
if (!onSubmit) return;
|
|
23
|
+
|
|
24
|
+
const newOperation = { ...operation, settings: validator.parse(value) };
|
|
25
|
+
onSubmit(newOperation);
|
|
26
|
+
},
|
|
27
|
+
listeners: {
|
|
28
|
+
onChange: ({ formApi }) => {
|
|
29
|
+
const result = validator.safeParse(formApi.state.values);
|
|
30
|
+
if (!result.success) return;
|
|
31
|
+
|
|
32
|
+
const liveOperation = { ...operation, settings: result.data };
|
|
33
|
+
onChange(liveOperation);
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
form.reset(defaultValues, { keepDefaultValues: true });
|
|
40
|
+
}, [form, defaultValues]);
|
|
41
|
+
|
|
42
|
+
return form;
|
|
43
|
+
}
|
|
@@ -2,6 +2,7 @@ import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
|
2
2
|
|
|
3
3
|
import { ApodizationExpanded } from './apodization_expanded.tsx';
|
|
4
4
|
import { ApodizationTool } from './apodization_tool.tsx';
|
|
5
|
+
import { ApodizationTopBar } from './apodization_topbar.tsx';
|
|
5
6
|
|
|
6
7
|
export const apodization1D = defineProcessingOperatorUI({
|
|
7
8
|
id: '@zakodium/nmrium-core-plugins#apodization1D',
|
|
@@ -11,4 +12,5 @@ export const apodization1D = defineProcessingOperatorUI({
|
|
|
11
12
|
defaultShouldProcessAll: false,
|
|
12
13
|
Expanded: ApodizationExpanded,
|
|
13
14
|
Tool: ApodizationTool,
|
|
15
|
+
TopBar: ApodizationTopBar,
|
|
14
16
|
});
|
|
@@ -1,38 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
2
|
+
import { AppForm } from 'react-science/ui';
|
|
3
|
+
|
|
4
|
+
import { useApodizationForm } from './apodization.hook.ts';
|
|
4
5
|
|
|
5
6
|
export function ApodizationExpanded(
|
|
6
|
-
props:
|
|
7
|
+
props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
|
|
7
8
|
) {
|
|
8
|
-
const {
|
|
9
|
-
const
|
|
10
|
-
'@zakodium/nmrium-core-plugins#apodization1D',
|
|
11
|
-
operation,
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
const validator = operator.schemaSettings;
|
|
15
|
-
const form = useForm({
|
|
16
|
-
defaultValues: operation.settings,
|
|
17
|
-
validators: { onDynamic: validator },
|
|
18
|
-
validationLogic: revalidateLogic(),
|
|
19
|
-
onSubmit: ({ value }) => {
|
|
20
|
-
if (!onChange) return;
|
|
21
|
-
|
|
22
|
-
const newOperation = { ...operation, settings: validator.parse(value) };
|
|
23
|
-
onChange(newOperation);
|
|
24
|
-
},
|
|
25
|
-
listeners: {
|
|
26
|
-
onMount: () => onMount(),
|
|
27
|
-
onChange: ({ formApi }) => {
|
|
28
|
-
const result = validator.safeParse(formApi.state.values);
|
|
29
|
-
if (!result.success) return;
|
|
30
|
-
|
|
31
|
-
const liveOperation = { ...operation, settings: result.data };
|
|
32
|
-
onLiveChange(liveOperation);
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
});
|
|
9
|
+
const { children } = props;
|
|
10
|
+
const form = useApodizationForm(props);
|
|
36
11
|
|
|
37
12
|
const { AppField, SubmitButton } = form;
|
|
38
13
|
|
|
@@ -27,11 +27,10 @@ const NO_SHORTCUTS: HotkeyConfig[] = [];
|
|
|
27
27
|
export function ApodizationTool(
|
|
28
28
|
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
|
|
29
29
|
) {
|
|
30
|
-
const { spectrum,
|
|
30
|
+
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
31
31
|
|
|
32
|
-
const firstLiveProcessing = liveSpectrum?.processings?.[0]?.operatorId;
|
|
33
32
|
const isActive =
|
|
34
|
-
|
|
33
|
+
activeOperatorId === '@zakodium/nmrium-core-plugins#apodization1D';
|
|
35
34
|
|
|
36
35
|
const isVisible = isSpectrum1DFid(spectrum) && spectrum.info.isComplex;
|
|
37
36
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Classes } from '@blueprintjs/core';
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
4
|
+
import { AppForm } from 'react-science/ui';
|
|
5
|
+
|
|
6
|
+
import { useApodizationForm } from './apodization.hook.ts';
|
|
7
|
+
|
|
8
|
+
export function ApodizationTopBar(
|
|
9
|
+
props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
|
|
10
|
+
) {
|
|
11
|
+
const { children } = props;
|
|
12
|
+
const form = useApodizationForm(props);
|
|
13
|
+
|
|
14
|
+
const { AppField, SubmitButton, Subscribe } = form;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<HorizontalAppForm form={form} layout="inline">
|
|
18
|
+
<Subscribe selector={(state) => state.values.exponential?.apply ?? false}>
|
|
19
|
+
{(apply) => (
|
|
20
|
+
<AppField name="exponential.options.lineBroadening">
|
|
21
|
+
{({ NumericInput }) => (
|
|
22
|
+
<NumericInput
|
|
23
|
+
readOnly={!apply}
|
|
24
|
+
disabled={!apply}
|
|
25
|
+
label="Line broadening"
|
|
26
|
+
minorStepSize={0.01}
|
|
27
|
+
step={0.1}
|
|
28
|
+
majorStepSize={1}
|
|
29
|
+
/>
|
|
30
|
+
)}
|
|
31
|
+
</AppField>
|
|
32
|
+
)}
|
|
33
|
+
</Subscribe>
|
|
34
|
+
|
|
35
|
+
{children(
|
|
36
|
+
<SubmitButton variant="outlined" size="small" intent="success">
|
|
37
|
+
Apply
|
|
38
|
+
</SubmitButton>,
|
|
39
|
+
)}
|
|
40
|
+
</HorizontalAppForm>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const HorizontalAppForm = styled(AppForm)`
|
|
45
|
+
display: contents;
|
|
46
|
+
|
|
47
|
+
.${Classes.FORM_GROUP} {
|
|
48
|
+
min-height: unset;
|
|
49
|
+
width: unset;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 5px;
|
|
54
|
+
|
|
55
|
+
> :not(.${Classes.LABEL}) {
|
|
56
|
+
min-width: unset;
|
|
57
|
+
width: unset;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.${Classes.INPUT} {
|
|
61
|
+
width: 5em;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { revalidateLogic } from '@tanstack/react-form';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
3
3
|
import { castSpectrum1D } from '@zakodium/nmrium-core';
|
|
4
4
|
import { autoPhaseCorrection } from 'nmr-processing';
|
|
5
5
|
import { AppForm, useForm } from 'react-science/ui';
|
|
6
6
|
|
|
7
7
|
export function PhaseCorrectionExpanded(
|
|
8
|
-
props:
|
|
8
|
+
props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#phaseCorrection1D'>,
|
|
9
9
|
) {
|
|
10
|
-
const {
|
|
11
|
-
operation,
|
|
12
|
-
core,
|
|
13
|
-
children,
|
|
14
|
-
onChange,
|
|
15
|
-
onLiveChange,
|
|
16
|
-
onMount,
|
|
17
|
-
spectrum,
|
|
18
|
-
} = props;
|
|
10
|
+
const { operation, core, children, onSubmit, onChange, spectrum } = props;
|
|
19
11
|
|
|
20
12
|
castSpectrum1D(spectrum);
|
|
21
13
|
|
|
@@ -31,23 +23,22 @@ export function PhaseCorrectionExpanded(
|
|
|
31
23
|
validators: { onDynamic: schemaSettings },
|
|
32
24
|
validationLogic: revalidateLogic(),
|
|
33
25
|
onSubmit: ({ value }) => {
|
|
34
|
-
if (!
|
|
26
|
+
if (!onSubmit) return;
|
|
35
27
|
|
|
36
28
|
const newOperation = {
|
|
37
29
|
...operation,
|
|
38
30
|
settings: schemaSettings.parse(value),
|
|
39
31
|
};
|
|
40
32
|
|
|
41
|
-
|
|
33
|
+
onSubmit(newOperation);
|
|
42
34
|
},
|
|
43
35
|
listeners: {
|
|
44
|
-
onMount: () => onMount(),
|
|
45
36
|
onChange: ({ formApi }) => {
|
|
46
37
|
const result = schemaSettings.safeParse(formApi.state.values);
|
|
47
38
|
if (!result.success) return;
|
|
48
39
|
|
|
49
40
|
const liveOperation = { ...operation, settings: result.data };
|
|
50
|
-
|
|
41
|
+
onChange(liveOperation);
|
|
51
42
|
},
|
|
52
43
|
},
|
|
53
44
|
});
|
|
@@ -25,11 +25,10 @@ function defaultPhaseCorrectionOperation(): Spectrum1DProcessingTypeRegistry['@z
|
|
|
25
25
|
export function PhaseCorrectionTool(
|
|
26
26
|
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#phaseCorrection1D'>,
|
|
27
27
|
) {
|
|
28
|
-
const { spectrum,
|
|
28
|
+
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
29
29
|
|
|
30
|
-
const firstLiveProcessing = liveSpectrum?.processings?.[0]?.operatorId;
|
|
31
30
|
const isActive =
|
|
32
|
-
|
|
31
|
+
activeOperatorId === '@zakodium/nmrium-core-plugins#phaseCorrection1D';
|
|
33
32
|
|
|
34
33
|
const isVisible = isSpectrum1DFt(spectrum) && spectrum.info.isComplex;
|
|
35
34
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { revalidateLogic } from '@tanstack/react-form';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { AppForm, useForm } from 'react-science/ui';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
export function ShiftXExpanded(
|
|
8
|
-
props:
|
|
8
|
+
props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#shiftX1D'>,
|
|
9
9
|
) {
|
|
10
|
-
const { operation, core, children, onChange,
|
|
10
|
+
const { operation, core, children, onChange, onSubmit } = props;
|
|
11
11
|
|
|
12
12
|
const { settings } = operation;
|
|
13
13
|
const operator = core.getOperationOperator(
|
|
@@ -41,16 +41,15 @@ export function ShiftXExpanded(
|
|
|
41
41
|
settings: shift,
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
onSubmit(newOperation);
|
|
45
45
|
},
|
|
46
46
|
listeners: {
|
|
47
|
-
onMount: () => onMount(),
|
|
48
47
|
onChange: ({ formApi }) => {
|
|
49
48
|
const result = validation.safeParse(formApi.state.values);
|
|
50
49
|
if (!result.success) return;
|
|
51
50
|
|
|
52
51
|
const liveOperation = { ...operation, settings: result.data.shift };
|
|
53
|
-
|
|
52
|
+
onChange(liveOperation);
|
|
54
53
|
},
|
|
55
54
|
},
|
|
56
55
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { revalidateLogic } from '@tanstack/react-form';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { AppForm, useForm } from 'react-science/ui';
|
|
5
5
|
import { z } from 'zod';
|
|
@@ -22,9 +22,9 @@ const options = [
|
|
|
22
22
|
];
|
|
23
23
|
|
|
24
24
|
export function ZeroFillingExpand(
|
|
25
|
-
props:
|
|
25
|
+
props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#zeroFilling1D'>,
|
|
26
26
|
) {
|
|
27
|
-
const { operation,
|
|
27
|
+
const { operation, onSubmit, onChange, core, children } = props;
|
|
28
28
|
const operator = core.getOperationOperator(
|
|
29
29
|
'@zakodium/nmrium-core-plugins#zeroFilling1D',
|
|
30
30
|
operation,
|
|
@@ -47,15 +47,14 @@ export function ZeroFillingExpand(
|
|
|
47
47
|
validationLogic: revalidateLogic(),
|
|
48
48
|
onSubmit: ({ value }) => {
|
|
49
49
|
const { size: settings } = validator.parse(value);
|
|
50
|
-
|
|
50
|
+
onSubmit({ ...operation, settings });
|
|
51
51
|
},
|
|
52
52
|
listeners: {
|
|
53
|
-
onMount: () => onMount(),
|
|
54
53
|
onChange: ({ formApi }) => {
|
|
55
54
|
const result = validator.safeParse(formApi.state.values);
|
|
56
55
|
if (!result.success) return;
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
onChange({ ...operation, settings: result.data.size });
|
|
59
58
|
},
|
|
60
59
|
},
|
|
61
60
|
});
|
|
@@ -36,11 +36,10 @@ function defaultZeroFillingOperation(
|
|
|
36
36
|
export function ZeroFillingTool(
|
|
37
37
|
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#zeroFilling1D'>,
|
|
38
38
|
) {
|
|
39
|
-
const {
|
|
39
|
+
const { onTriggerOperation, spectrum, activeOperatorId } = props;
|
|
40
40
|
|
|
41
|
-
const firstLiveProcessing = liveSpectrum?.processings?.[0]?.operatorId;
|
|
42
41
|
const isActive =
|
|
43
|
-
|
|
42
|
+
activeOperatorId === '@zakodium/nmrium-core-plugins#zeroFilling1D';
|
|
44
43
|
|
|
45
44
|
const isVisible = isSpectrum1DFid(spectrum) && spectrum.info.isComplex;
|
|
46
45
|
|