@zakodium/nmrium-core-plugins-ui 0.1.26 → 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.
Files changed (52) hide show
  1. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.d.ts.map +1 -1
  2. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts +400 -0
  3. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.d.ts.map +1 -0
  4. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.js +34 -0
  5. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.hook.js.map +1 -0
  6. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js +2 -0
  7. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization.js.map +1 -1
  8. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.d.ts +2 -2
  9. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.d.ts.map +1 -1
  10. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.js +4 -26
  11. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.js.map +1 -1
  12. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.d.ts.map +1 -1
  13. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.js +2 -3
  14. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_tool.js.map +1 -1
  15. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.d.ts +3 -0
  16. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.d.ts.map +1 -0
  17. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.js +33 -0
  18. package/lib/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.js.map +1 -0
  19. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.d.ts +2 -2
  20. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.d.ts.map +1 -1
  21. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.js +4 -5
  22. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.js.map +1 -1
  23. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.d.ts.map +1 -1
  24. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.js +2 -3
  25. package/lib/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.js.map +1 -1
  26. package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.d.ts +2 -2
  27. package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.d.ts.map +1 -1
  28. package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.js +3 -4
  29. package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.js.map +1 -1
  30. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.d.ts.map +1 -1
  31. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.js +2 -0
  32. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling.js.map +1 -1
  33. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.d.ts +2 -2
  34. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.d.ts.map +1 -1
  35. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.js +3 -4
  36. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.js.map +1 -1
  37. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.d.ts +3 -0
  38. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.d.ts.map +1 -0
  39. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.js +50 -0
  40. package/lib/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.js.map +1 -0
  41. package/package.json +5 -4
  42. package/src/plugins/spectrum_1d_processings_ui/operators/apodization.hook.ts +43 -0
  43. package/src/plugins/spectrum_1d_processings_ui/operators/apodization.ts +2 -0
  44. package/src/plugins/spectrum_1d_processings_ui/operators/apodization_expanded.tsx +7 -32
  45. package/src/plugins/spectrum_1d_processings_ui/operators/apodization_tool.tsx +2 -3
  46. package/src/plugins/spectrum_1d_processings_ui/operators/apodization_topbar.tsx +64 -0
  47. package/src/plugins/spectrum_1d_processings_ui/operators/phase_correction_expanded.tsx +6 -15
  48. package/src/plugins/spectrum_1d_processings_ui/operators/phase_correction_tool.tsx +2 -3
  49. package/src/plugins/spectrum_1d_processings_ui/operators/shift_x_expanded.tsx +5 -6
  50. package/src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx +2 -0
  51. package/src/plugins/spectrum_1d_processings_ui/operators/zero_filling_expand.tsx +5 -6
  52. package/src/plugins/spectrum_1d_processings_ui/operators/zero_filling_tool.tsx +92 -0
@@ -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, onChange, onLiveChange, onMount, spectrum, } = props;
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 (!onChange)
17
+ if (!onSubmit)
18
18
  return;
19
19
  const newOperation = {
20
20
  ...operation,
21
21
  settings: schemaSettings.parse(value),
22
22
  };
23
- onChange(newOperation);
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
- onLiveChange(liveOperation);
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,KAA2F;IAE3F,MAAM,EACJ,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,GACT,GAAG,KAAK,CAAC;IAEV,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,GAAG,SAAS;gBACZ,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC;aACtC,CAAC;YAEF,QAAQ,CAAC,YAAY,CAAC,CAAC;QACzB,CAAC;QACD,SAAS,EAAE;YACT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AAW,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
+ {"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,CA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ACJ,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,sCAoDxF"}
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, liveSpectrum, onTriggerOperation } = props;
20
- const firstLiveProcessing = liveSpectrum?.processings?.[0]?.operatorId;
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,C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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
+ {"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;A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AACJ,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { ProcessingOperatorUIExpandedProps } from '@zakodium/nmrium-core';
2
- export declare function ShiftXExpanded(props: ProcessingOperatorUIExpandedProps<'@zakodium/nmrium-core-plugins#shiftX1D'>): import("react").JSX.Element;
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,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAK/E,wBAAgB,cAAc,CAC5B,KAAK,EAAE,iCAAiC,CAAC,wCAAwC,CAAC,+BA+DnF"}
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, onLiveChange, onMount } = props;
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
- onChange(newOperation);
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
- onLiveChange(liveOperation);
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,KAAkF;IAElF,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE7E,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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ClC,IACR,CACX,CAAC;AACJ,CAAC"}
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,UAAU,EAAE;QACrC,eAAe,EAAE,eAAe,EAAE;QAClC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YACtB,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAEtB,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1C,MAAM,YAAY,GAAG;gBACnB,GAAG,SAAS;gBACZ,QAAQ,EAAE,KAAK;aAChB,CAAC;YAEF,QAAQ,CAAC,YAAY,CAAC,CAAC;QACzB,CAAC;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;gBACxB,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC1D,IAAI,CAAC,MAAM,CAAC,OAAO;oBAAE,OAAO;gBAE5B,MAAM,aAAa,GAAG,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACpE,QAAQ,CAAC,aAAa,CAAC,CAAC;YAC1B,CAAC;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,aACjC,QAAQ,EAAE,CACT,KAAC,IAAI,CAAC,YAAY,IAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAC,SAAS,sBAE/C,CACrB,EAED,KAAC,IAAI,CAAC,QAAQ,IAAC,IAAI,EAAC,OAAO,YACxB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,KAAK,CAAC,YAAY,IAAC,KAAK,EAAC,OAAO,GAAG,GAClC,IACR,CACX,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"zero_filling.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,qGAOxB,CAAC"}
1
+ {"version":3,"file":"zero_filling.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,qGAQxB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
2
2
  import { ZeroFillingExpand } from "./zero_filling_expand.js";
3
+ import { ZeroFillingTool } from "./zero_filling_tool.js";
3
4
  export const zeroFilling1D = defineProcessingOperatorUI({
4
5
  id: '@zakodium/nmrium-core-plugins#zeroFilling1D',
5
6
  name: 'Zero filling',
@@ -7,5 +8,6 @@ export const zeroFilling1D = defineProcessingOperatorUI({
7
8
  isLiveEditable: true,
8
9
  defaultShouldProcessAll: false,
9
10
  Expanded: ZeroFillingExpand,
11
+ Tool: ZeroFillingTool,
10
12
  });
11
13
  //# sourceMappingURL=zero_filling.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zero_filling.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA2B,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;IACtD,EAAE,EAAE,6CAA6C;IACjD,IAAI,EAAE,cAAc;IACpB,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,uBAAuB,EAAE,KAAK;IAC9B,QAAQ,EAAE,iBAAiB;CAC5B,CAAC,CAAC"}
1
+ {"version":3,"file":"zero_filling.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/zero_filling.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAyB,CAAC;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;IACtD,EAAE,EAAE,6CAA6C;IACjD,IAAI,EAAE,cAAc;IACpB,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,uBAAuB,EAAE,KAAK;IAC9B,QAAQ,EAAE,iBAAiB;IAC3B,IAAI,EAAE,eAAe;CACtB,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { ProcessingOperatorUIExpandedProps } from '@zakodium/nmrium-core';
2
- export declare function ZeroFillingExpand(props: ProcessingOperatorUIExpandedProps<'@zakodium/nmrium-core-plugins#zeroFilling1D'>): import("react").JSX.Element;
1
+ import type { ProcessingOperatorUISettingsFormProps } 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,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAsB/E,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,iCAAiC,CAAC,6CAA6C,CAAC,+BA8DxF"}
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, onChange, onLiveChange, onMount, core, children } = props;
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
- onChange({ ...operation, settings });
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
- onLiveChange({ ...operation, settings: result.data.size });
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,KAA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zB,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAExC,OAAO,CACL,MAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,aACjC,QAAQ,CACP,KAAC,YAAY,IAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,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
+ {"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/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I,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,aACjC,QAAQ,CACP,KAAC,YAAY,IAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,OAAO,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"}
@@ -0,0 +1,3 @@
1
+ import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
2
+ export declare function ZeroFillingTool(props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#zeroFilling1D'>): import("react").JSX.Element | null;
3
+ //# sourceMappingURL=zero_filling_tool.d.ts.map
@@ -0,0 +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,sCAmDpF"}
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useHotkeys } from '@blueprintjs/core';
3
+ import { castSpectrum1D, generateID, isSpectrum1DFid, } from '@zakodium/nmrium-core';
4
+ import { SvgNmrZeroFilling } from 'cheminfo-font';
5
+ import { useMemo } from 'react';
6
+ import { Toolbar, TooltipHelpContent } from 'react-science/ui';
7
+ import { useEventCallback } from 'usehooks-ts';
8
+ function defaultZeroFillingOperation(spectrum) {
9
+ castSpectrum1D(spectrum);
10
+ const zeroFillingSize = getZeroFillingSize(spectrum.data.x.length);
11
+ return {
12
+ operatorId: '@zakodium/nmrium-core-plugins#zeroFilling1D',
13
+ settings: zeroFillingSize,
14
+ options: undefined,
15
+ error: undefined,
16
+ uid: generateID(),
17
+ enabled: true,
18
+ };
19
+ }
20
+ export function ZeroFillingTool(props) {
21
+ const { onTriggerOperation, spectrum, activeOperatorId } = props;
22
+ const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#zeroFilling1D';
23
+ const isVisible = isSpectrum1DFid(spectrum) && spectrum.info.isComplex;
24
+ const triggerOperation = useEventCallback((event) => {
25
+ if ('stopImmediatePropagation' in event) {
26
+ // stopPropagation is not enough because
27
+ // nmrium keyboard listener is also on document
28
+ event.stopImmediatePropagation();
29
+ }
30
+ onTriggerOperation(defaultZeroFillingOperation(spectrum));
31
+ });
32
+ const hotkeys = useMemo(() => {
33
+ return [
34
+ {
35
+ combo: 'z',
36
+ label: 'Zero Filling',
37
+ global: true,
38
+ onKeyDown: triggerOperation,
39
+ },
40
+ ];
41
+ }, [triggerOperation]);
42
+ useHotkeys(isVisible ? hotkeys : []);
43
+ if (!isVisible)
44
+ return null;
45
+ return (_jsx(Toolbar.Item, { id: "@zakodium/nmrium-core-plugins#zeroFilling1D", icon: _jsx(SvgNmrZeroFilling, {}), tooltip: _jsx(TooltipHelpContent, { title: "Zero Filling", shortcuts: ['z'], description: "Improve spectrum quality by increasing the number of points. By default, the number of points is twise as many as in the original FID.", link: "https://docs.nmrium.org/help/zero-filling" }), active: isActive, onClick: triggerOperation }));
46
+ }
47
+ function getZeroFillingSize(length) {
48
+ return 2 ** Math.round(Math.log2(length * 2));
49
+ }
50
+ //# sourceMappingURL=zero_filling_tool.js.map
@@ -0,0 +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,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M,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,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.26",
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.50",
31
- "@zakodium/nmrium-core-plugins": "^0.7.67",
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": "5862adcdc11eb074b88b8303366f4ef923f36ee0"
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 { revalidateLogic } from '@tanstack/react-form';
2
- import type { ProcessingOperatorUIExpandedProps } from '@zakodium/nmrium-core';
3
- import { AppForm, useForm } from 'react-science/ui';
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: ProcessingOperatorUIExpandedProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
7
+ props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#apodization1D'>,
7
8
  ) {
8
- const { operation, onChange, onLiveChange, onMount, core, children } = props;
9
- const operator = core.getOperationOperator(
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, liveSpectrum, onTriggerOperation } = props;
30
+ const { spectrum, activeOperatorId, onTriggerOperation } = props;
31
31
 
32
- const firstLiveProcessing = liveSpectrum?.processings?.[0]?.operatorId;
33
32
  const isActive =
34
- firstLiveProcessing === '@zakodium/nmrium-core-plugins#apodization1D';
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 { ProcessingOperatorUIExpandedProps } from '@zakodium/nmrium-core';
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: ProcessingOperatorUIExpandedProps<'@zakodium/nmrium-core-plugins#phaseCorrection1D'>,
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 (!onChange) return;
26
+ if (!onSubmit) return;
35
27
 
36
28
  const newOperation = {
37
29
  ...operation,
38
30
  settings: schemaSettings.parse(value),
39
31
  };
40
32
 
41
- onChange(newOperation);
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
- onLiveChange(liveOperation);
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, liveSpectrum, onTriggerOperation } = props;
28
+ const { spectrum, activeOperatorId, onTriggerOperation } = props;
29
29
 
30
- const firstLiveProcessing = liveSpectrum?.processings?.[0]?.operatorId;
31
30
  const isActive =
32
- firstLiveProcessing === '@zakodium/nmrium-core-plugins#phaseCorrection1D';
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 { ProcessingOperatorUIExpandedProps } from '@zakodium/nmrium-core';
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: ProcessingOperatorUIExpandedProps<'@zakodium/nmrium-core-plugins#shiftX1D'>,
8
+ props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#shiftX1D'>,
9
9
  ) {
10
- const { operation, core, children, onChange, onLiveChange, onMount } = props;
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
- onChange(newOperation);
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
- onLiveChange(liveOperation);
52
+ onChange(liveOperation);
54
53
  },
55
54
  },
56
55
  });
@@ -1,6 +1,7 @@
1
1
  import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
2
2
 
3
3
  import { ZeroFillingExpand } from './zero_filling_expand.tsx';
4
+ import { ZeroFillingTool } from './zero_filling_tool.tsx';
4
5
 
5
6
  export const zeroFilling1D = defineProcessingOperatorUI({
6
7
  id: '@zakodium/nmrium-core-plugins#zeroFilling1D',
@@ -9,4 +10,5 @@ export const zeroFilling1D = defineProcessingOperatorUI({
9
10
  isLiveEditable: true,
10
11
  defaultShouldProcessAll: false,
11
12
  Expanded: ZeroFillingExpand,
13
+ Tool: ZeroFillingTool,
12
14
  });