@zakodium/nmrium-core-plugins-ui 0.1.34 → 0.1.35

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.
@@ -1 +1 @@
1
- {"version":3,"file":"phase_correction.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,yGAQ5B,CAAC"}
1
+ {"version":3,"file":"phase_correction.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,yGAS5B,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
2
2
  import { PhaseCorrectionExpanded } from "./phase_correction_expanded.js";
3
3
  import { PhaseCorrectionTool } from "./phase_correction_tool.js";
4
+ import { PhaseCorrectionTopbar } from "./phase_correction_topbar.js";
4
5
  export const phaseCorrection1D = defineProcessingOperatorUI({
5
6
  id: '@zakodium/nmrium-core-plugins#phaseCorrection1D',
6
7
  name: 'Phase correction',
@@ -9,5 +10,6 @@ export const phaseCorrection1D = defineProcessingOperatorUI({
9
10
  Expanded: PhaseCorrectionExpanded,
10
11
  defaultShouldProcessAll: false,
11
12
  Tool: PhaseCorrectionTool,
13
+ TopBar: PhaseCorrectionTopbar,
12
14
  });
13
15
  //# sourceMappingURL=phase_correction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"phase_correction.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAiC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA6B,CAAC;AAElE,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;IAC1D,EAAE,EAAE,iDAAiD;IACrD,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,uBAAuB;IACjC,uBAAuB,EAAE,KAAK;IAC9B,IAAI,EAAE,mBAAmB;CAC1B,CAAC,CAAC"}
1
+ {"version":3,"file":"phase_correction.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAiC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA6B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA+B,CAAC;AAEtE,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;IAC1D,EAAE,EAAE,iDAAiD;IACrD,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,uBAAuB;IACjC,uBAAuB,EAAE,KAAK;IAC9B,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,qBAAqB;CAC9B,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
2
+ export declare function PhaseCorrectionTopbar(props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#phaseCorrection1D'>): import("react").JSX.Element;
3
+ //# sourceMappingURL=phase_correction_topbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase_correction_topbar.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_topbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,uBAAuB,CAAC;AAOnF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,qCAAqC,CAAC,iDAAiD,CAAC,+BAiDhG"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { castSpectrum1D } from '@zakodium/nmrium-core';
3
+ import { HorizontalAppForm } from "../utils/horizontal_app_form.js";
4
+ import { usePhaseCorrectionForm } from "./phase_correction.hook.js";
5
+ export function PhaseCorrectionTopbar(props) {
6
+ const { children, spectrum } = props;
7
+ castSpectrum1D(spectrum);
8
+ const { form, selectModeProps, appFieldModeListeners } = usePhaseCorrectionForm(props);
9
+ return (_jsxs(HorizontalAppForm, { form: form, layout: "inline", children: [_jsx(form.AppField, { name: "mode", listeners: appFieldModeListeners, children: (field) => (_jsxs(_Fragment, { children: [_jsx(field.Select, { layout: "inline", ...selectModeProps }), field.state.value === 'manual' && (_jsxs(_Fragment, { children: [_jsx(form.AppField, { name: "ph0", children: (field) => (_jsx(field.DraggableNumericInput, { hideInput: true, draggableLabel: "Change PH0 (click and drag)", draggableIntent: "success" })) }), _jsx(form.AppField, { name: "ph1", children: (field) => (_jsx(field.DraggableNumericInput, { hideInput: true, draggableLabel: "Change PH1 (click and drag)", draggableIntent: "success" })) })] }))] })) }), children(_jsx(form.SubmitButton, { variant: "outlined", size: "small", intent: "success", children: "Apply" }))] }));
10
+ }
11
+ //# sourceMappingURL=phase_correction_topbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase_correction_topbar.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/phase_correction_topbar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAkC,CAAC;AAErE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,UAAU,qBAAqB,CACnC,KAA+F;IAE/F,MAAM,E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4
  "license": "CC-BY-NC-SA-4.0",
5
5
  "description": "UI related plugins needed for cheminfo/nmrium",
6
6
  "keywords": [],
@@ -45,5 +45,5 @@
45
45
  "typescript": "~6.0.3",
46
46
  "vitest": "^4.1.10"
47
47
  },
48
- "gitHead": "699ffe8485c79fa4cc9a6e1f8c54282fa14f8506"
48
+ "gitHead": "036eec508d66c5fa9ed8c395ace4112803ff50bb"
49
49
  }
@@ -2,6 +2,7 @@ import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
2
2
 
3
3
  import { PhaseCorrectionExpanded } from './phase_correction_expanded.tsx';
4
4
  import { PhaseCorrectionTool } from './phase_correction_tool.tsx';
5
+ import { PhaseCorrectionTopbar } from './phase_correction_topbar.tsx';
5
6
 
6
7
  export const phaseCorrection1D = defineProcessingOperatorUI({
7
8
  id: '@zakodium/nmrium-core-plugins#phaseCorrection1D',
@@ -11,4 +12,5 @@ export const phaseCorrection1D = defineProcessingOperatorUI({
11
12
  Expanded: PhaseCorrectionExpanded,
12
13
  defaultShouldProcessAll: false,
13
14
  Tool: PhaseCorrectionTool,
15
+ TopBar: PhaseCorrectionTopbar,
14
16
  });
@@ -0,0 +1,58 @@
1
+ import type { ProcessingOperatorUISettingsFormProps } from '@zakodium/nmrium-core';
2
+ import { castSpectrum1D } from '@zakodium/nmrium-core';
3
+
4
+ import { HorizontalAppForm } from '../utils/horizontal_app_form.tsx';
5
+
6
+ import { usePhaseCorrectionForm } from './phase_correction.hook.ts';
7
+
8
+ export function PhaseCorrectionTopbar(
9
+ props: ProcessingOperatorUISettingsFormProps<'@zakodium/nmrium-core-plugins#phaseCorrection1D'>,
10
+ ) {
11
+ const { children, spectrum } = props;
12
+ castSpectrum1D(spectrum);
13
+
14
+ const { form, selectModeProps, appFieldModeListeners } =
15
+ usePhaseCorrectionForm(props);
16
+
17
+ return (
18
+ <HorizontalAppForm form={form} layout="inline">
19
+ <form.AppField name="mode" listeners={appFieldModeListeners}>
20
+ {(field) => (
21
+ <>
22
+ <field.Select layout="inline" {...selectModeProps} />
23
+
24
+ {field.state.value === 'manual' && (
25
+ <>
26
+ <form.AppField name="ph0">
27
+ {(field) => (
28
+ <field.DraggableNumericInput
29
+ hideInput
30
+ draggableLabel="Change PH0 (click and drag)"
31
+ draggableIntent="success"
32
+ />
33
+ )}
34
+ </form.AppField>
35
+
36
+ <form.AppField name="ph1">
37
+ {(field) => (
38
+ <field.DraggableNumericInput
39
+ hideInput
40
+ draggableLabel="Change PH1 (click and drag)"
41
+ draggableIntent="success"
42
+ />
43
+ )}
44
+ </form.AppField>
45
+ </>
46
+ )}
47
+ </>
48
+ )}
49
+ </form.AppField>
50
+
51
+ {children(
52
+ <form.SubmitButton variant="outlined" size="small" intent="success">
53
+ Apply
54
+ </form.SubmitButton>,
55
+ )}
56
+ </HorizontalAppForm>
57
+ );
58
+ }