@zakodium/nmrium-core-plugins-ui 0.1.36 → 0.1.37
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/shift_x.d.ts.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.js +2 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x.js.map +1 -1
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.d.ts +3 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.d.ts.map +1 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.js +23 -0
- package/lib/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.js.map +1 -0
- package/package.json +5 -5
- package/src/plugins/spectrum_1d_processings_ui/operators/shift_x.ts +2 -0
- package/src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx +45 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shift_x.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shift_x.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,gGAOnB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
2
|
import { ShiftXExpanded } from "./shift_x_expanded.js";
|
|
3
|
+
import { ShiftXPanelTool } from "./shift_x_panel_tool.js";
|
|
3
4
|
export const shiftX1D = defineProcessingOperatorUI({
|
|
4
5
|
id: '@zakodium/nmrium-core-plugins#shiftX1D',
|
|
5
6
|
name: 'Shift x',
|
|
6
7
|
Expanded: ShiftXExpanded,
|
|
7
8
|
isEditable: true,
|
|
8
9
|
isLiveEditable: true,
|
|
10
|
+
PanelTool: ShiftXPanelTool,
|
|
9
11
|
});
|
|
10
12
|
//# sourceMappingURL=shift_x.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shift_x.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"shift_x.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAA0B,CAAC;AAE3D,MAAM,CAAC,MAAM,QAAQ,GAAG,0BAA0B,CAAC;IACjD,EAAE,EAAE,wCAAwC;IAC5C,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,cAAc;IACxB,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,SAAS,EAAE,eAAe;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProcessingOperatorUIToolProps } from '@zakodium/nmrium-core';
|
|
2
|
+
export declare function ShiftXPanelTool(props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#shiftX1D'>): import("react").JSX.Element | null;
|
|
3
|
+
//# sourceMappingURL=shift_x_panel_tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shift_x_panel_tool.d.ts","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,uBAAuB,CAAC;AAe/B,wBAAgB,eAAe,CAC7B,KAAK,EAAE,6BAA6B,CAAC,wCAAwC,CAAC,sCAwB/E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DoubleCaretHorizontalIcon } from '@blueprintjs/icons';
|
|
3
|
+
import { generateID, isSpectrum1DFt } from '@zakodium/nmrium-core';
|
|
4
|
+
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
5
|
+
function defaultShiftXOperation() {
|
|
6
|
+
return {
|
|
7
|
+
operatorId: '@zakodium/nmrium-core-plugins#shiftX1D',
|
|
8
|
+
settings: 0,
|
|
9
|
+
options: undefined,
|
|
10
|
+
error: undefined,
|
|
11
|
+
uid: generateID(),
|
|
12
|
+
enabled: true,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function ShiftXPanelTool(props) {
|
|
16
|
+
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
17
|
+
const isActive = activeOperatorId === '@zakodium/nmrium-core-plugins#shiftX1D';
|
|
18
|
+
const isVisible = isSpectrum1DFt(spectrum);
|
|
19
|
+
if (!isVisible)
|
|
20
|
+
return null;
|
|
21
|
+
return (_jsx(Toolbar.Item, { id: "@zakodium/nmrium-core-plugins#shiftX1D", icon: _jsx(DoubleCaretHorizontalIcon, {}), tooltip: _jsx(TooltipHelpContent, { title: "Shift X", description: "Move your spectrum along x-axis" }), active: isActive, onClick: () => onTriggerOperation(defaultShiftXOperation()) }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=shift_x_panel_tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shift_x_panel_tool.js","sourceRoot":"","sources":["../../../../src/plugins/spectrum_1d_processings_ui/operators/shift_x_panel_tool.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAK/D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,SAAS,sBAAsB;IAC7B,OAAO;QACL,UAAU,EAAE,wCAAwC;QACpD,QAAQ,EAAE,CAAC;QACX,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,KAA8E;IAE9E,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAEjE,MAAM,QAAQ,GACZ,gBAAgB,KAAK,wCAAwC,CAAC;IAEhE,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAE5B,OAAO,CACL,KAAC,OAAO,CAAC,IAAI,IACX,EAAE,EAAC,wCAAwC,EAC3C,IAAI,EAAE,KAAC,yBAAyB,KAAG,EACnC,OAAO,EACL,KAAC,kBAAkB,IACjB,KAAK,EAAC,SAAS,EACf,WAAW,EAAC,iCAAiC,GAC7C,EAEJ,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC,GAC3D,CACH,CAAC;AACJ,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.37",
|
|
4
4
|
"license": "CC-BY-NC-SA-4.0",
|
|
5
5
|
"description": "UI related plugins needed for cheminfo/nmrium",
|
|
6
6
|
"keywords": [],
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"@blueprintjs/select": "^6.3.3",
|
|
29
29
|
"@emotion/styled": "^11.14.1",
|
|
30
30
|
"@tanstack/react-form": "^1.33.2",
|
|
31
|
-
"@zakodium/nmrium-core": "^0.7.
|
|
32
|
-
"@zakodium/nmrium-core-plugins": "^0.7.
|
|
31
|
+
"@zakodium/nmrium-core": "^0.7.55",
|
|
32
|
+
"@zakodium/nmrium-core-plugins": "^0.7.73",
|
|
33
33
|
"@zakodium/utils": "^0.5.0",
|
|
34
34
|
"fifo-logger": "^2.0.1",
|
|
35
35
|
"react": "^18.3.1",
|
|
36
36
|
"react-dom": "^18.3.1",
|
|
37
|
-
"react-science": "^
|
|
37
|
+
"react-science": "^21.0.0",
|
|
38
38
|
"usehooks-ts": "^3.1.1",
|
|
39
39
|
"zod": "^4.4.3"
|
|
40
40
|
},
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"typescript": "~6.0.3",
|
|
46
46
|
"vitest": "^4.1.10"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "667f1052c4ed8b8c2cbb844d0a71f49ba5d03d91"
|
|
49
49
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineProcessingOperatorUI } from '@zakodium/nmrium-core';
|
|
2
2
|
|
|
3
3
|
import { ShiftXExpanded } from './shift_x_expanded.tsx';
|
|
4
|
+
import { ShiftXPanelTool } from './shift_x_panel_tool.tsx';
|
|
4
5
|
|
|
5
6
|
export const shiftX1D = defineProcessingOperatorUI({
|
|
6
7
|
id: '@zakodium/nmrium-core-plugins#shiftX1D',
|
|
@@ -8,4 +9,5 @@ export const shiftX1D = defineProcessingOperatorUI({
|
|
|
8
9
|
Expanded: ShiftXExpanded,
|
|
9
10
|
isEditable: true,
|
|
10
11
|
isLiveEditable: true,
|
|
12
|
+
PanelTool: ShiftXPanelTool,
|
|
11
13
|
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DoubleCaretHorizontalIcon } from '@blueprintjs/icons';
|
|
2
|
+
import type {
|
|
3
|
+
ProcessingOperatorUIToolProps,
|
|
4
|
+
Spectrum1DProcessingTypeRegistry,
|
|
5
|
+
} from '@zakodium/nmrium-core';
|
|
6
|
+
import { generateID, isSpectrum1DFt } from '@zakodium/nmrium-core';
|
|
7
|
+
import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
8
|
+
|
|
9
|
+
function defaultShiftXOperation(): Spectrum1DProcessingTypeRegistry['@zakodium/nmrium-core-plugins#shiftX1D'] {
|
|
10
|
+
return {
|
|
11
|
+
operatorId: '@zakodium/nmrium-core-plugins#shiftX1D',
|
|
12
|
+
settings: 0,
|
|
13
|
+
options: undefined,
|
|
14
|
+
error: undefined,
|
|
15
|
+
uid: generateID(),
|
|
16
|
+
enabled: true,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function ShiftXPanelTool(
|
|
21
|
+
props: ProcessingOperatorUIToolProps<'@zakodium/nmrium-core-plugins#shiftX1D'>,
|
|
22
|
+
) {
|
|
23
|
+
const { spectrum, activeOperatorId, onTriggerOperation } = props;
|
|
24
|
+
|
|
25
|
+
const isActive =
|
|
26
|
+
activeOperatorId === '@zakodium/nmrium-core-plugins#shiftX1D';
|
|
27
|
+
|
|
28
|
+
const isVisible = isSpectrum1DFt(spectrum);
|
|
29
|
+
if (!isVisible) return null;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Toolbar.Item
|
|
33
|
+
id="@zakodium/nmrium-core-plugins#shiftX1D"
|
|
34
|
+
icon={<DoubleCaretHorizontalIcon />}
|
|
35
|
+
tooltip={
|
|
36
|
+
<TooltipHelpContent
|
|
37
|
+
title="Shift X"
|
|
38
|
+
description="Move your spectrum along x-axis"
|
|
39
|
+
/>
|
|
40
|
+
}
|
|
41
|
+
active={isActive}
|
|
42
|
+
onClick={() => onTriggerOperation(defaultShiftXOperation())}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|