@abidibo/react-cam-roi 0.14.1 → 0.14.2
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/dist/index.cjs.js
CHANGED
|
@@ -1741,7 +1741,7 @@ var styles$1 = {"toolbar":"Toolbar-module_toolbar__ywNcv","toolbar-light":"Toolb
|
|
|
1741
1741
|
|
|
1742
1742
|
var Toolbar = function (_a) {
|
|
1743
1743
|
var _b;
|
|
1744
|
-
var canvasRef = _a.canvasRef,
|
|
1744
|
+
var canvasRef = _a.canvasRef, canvasSize = _a.canvasSize;
|
|
1745
1745
|
var _c = React.useContext(UiContext), IconButton = _c.IconButton, themeMode = _c.themeMode, primaryColor = _c.primaryColor, Typography = _c.Typography, strings = _c.strings, Tooltip = _c.Tooltip;
|
|
1746
1746
|
var _d = useEditorContext(), activeTool = _d.activeTool, setActiveTool = _d.setActiveTool, configuration = _d.configuration, shapes = _d.shapes, editorId = _d.editorId, activeColor = _d.activeColor;
|
|
1747
1747
|
var iconColor = function (tool) { return (tool === activeTool ? primaryColor : themeMode === 'light' ? 'black' : 'white'); };
|
|
@@ -1756,7 +1756,7 @@ var Toolbar = function (_a) {
|
|
|
1756
1756
|
var handleRenderFullImagePolygon = function () {
|
|
1757
1757
|
if (!canvasRef.current)
|
|
1758
1758
|
return;
|
|
1759
|
-
renderFullImagePolygon(editorId, canvasRef.current, activeColor,
|
|
1759
|
+
renderFullImagePolygon(editorId, canvasRef.current, activeColor, canvasSize);
|
|
1760
1760
|
};
|
|
1761
1761
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: css('toolbar', styles$1, themeMode), children: enableRois(configuration) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { title: strings.selection, children: jsxRuntime.jsx(IconButton, { onClick: setTool("pointer" /* ToolEnum.Pointer */), children: jsxRuntime.jsx(PointerIcon, { color: iconColor("pointer" /* ToolEnum.Pointer */) }) }) }), (!hideForbiddenTools || pointEnabled) && (jsxRuntime.jsx(Tooltip, { title: strings.point, children: jsxRuntime.jsx(IconButton, { onClick: setTool("point" /* ToolEnum.Point */), disabled: !pointEnabled, children: jsxRuntime.jsx(PointIcon, { color: iconColor("point" /* ToolEnum.Point */) }) }) })), (!hideForbiddenTools || polylineEnabled) && (jsxRuntime.jsx(Tooltip, { title: strings.polyline, children: jsxRuntime.jsx(IconButton, { onClick: setTool("polyline" /* ToolEnum.Polyline */), disabled: !polylineEnabled, children: jsxRuntime.jsx(PolylineIcon, { color: iconColor("polyline" /* ToolEnum.Polyline */) }) }) })), (!hideForbiddenTools || polygonEnabled) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { title: strings.polygon, children: jsxRuntime.jsx(IconButton, { onClick: setTool("polygon" /* ToolEnum.Polygon */), disabled: !polygonEnabled, children: jsxRuntime.jsx(PolygonIcon, { color: iconColor("polygon" /* ToolEnum.Polygon */) }) }) }), jsxRuntime.jsx(Tooltip, { title: strings.fullImage, children: jsxRuntime.jsx(IconButton, { onClick: handleRenderFullImagePolygon, disabled: !polygonEnabled, children: jsxRuntime.jsx(FullRoiIcon, { color: iconColor("polygon" /* ToolEnum.Polygon */) }) }) })] })), (!hideForbiddenTools || rectangleEnabled) && (jsxRuntime.jsx(Tooltip, { title: strings.rect, children: jsxRuntime.jsx(IconButton, { onClick: setTool("rect" /* ToolEnum.Rectangle */), disabled: !rectangleEnabled, children: jsxRuntime.jsx(RectangleIcon, { color: iconColor("rect" /* ToolEnum.Rectangle */) }) }) })), jsxRuntime.jsx(ColorPicker, { style: { marginLeft: 'auto', marginRight: '.5rem' } })] })) }), enableRois(configuration) && (jsxRuntime.jsx("div", { className: css('toolbar-helper', styles$1, themeMode), children: jsxRuntime.jsxs(Typography, { children: [strings[activeTool], ": ", strings["".concat(activeTool, "HelpText")]] }) }))] }));
|
|
1762
1762
|
};
|
|
@@ -1865,11 +1865,12 @@ var RoiEditor = function (_a) {
|
|
|
1865
1865
|
}, [onSubmit, configuration, shapes, metadata, prepareOutput, strings, notify, presetName, presetDescription]);
|
|
1866
1866
|
log('info', enableLogs, 'react-cam-roi', 'active tool', activeTool);
|
|
1867
1867
|
log('info', enableLogs, 'react-cam-roi', 'canvas size', canvasSize);
|
|
1868
|
+
log('info', enableLogs, 'react-cam-roi', 'image size', imageSize);
|
|
1868
1869
|
log('info', enableLogs, 'react-cam-roi', 'metadata', metadata);
|
|
1869
1870
|
if (!isReady) {
|
|
1870
1871
|
return jsxRuntime.jsx(Loader, {});
|
|
1871
1872
|
}
|
|
1872
|
-
return (jsxRuntime.jsx(EditorProvider, { editorId: editorId, hideForbiddenTools: (_f = (_e = configuration.options) === null || _e === void 0 ? void 0 : _e.hideForbiddenTools) !== null && _f !== void 0 ? _f : false, activeTool: activeTool, setActiveTool: setActiveTool, activeColor: activeColor, setActiveColor: setActiveColor, presetName: presetName, setPresetName: setPresetName, presetDescription: presetDescription, setPresetDescription: setPresetDescription, shapes: shapes, setShapes: setShapes, addShape: addShape, addShapes: addShapes, removeShape: removeShape, configuration: configuration, metadata: metadata, setMetadata: setMetadata, onSubmit: handleSubmit, children: jsxRuntime.jsxs("div", { style: { maxWidth: '100%', width: "".concat(imageSize.width, "px") }, ref: wrapperRef, children: [jsxRuntime.jsx(TopBar, {}), configuration.rois && configuration.rois.length > 0 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(slots === null || slots === void 0 ? void 0 : slots.roiAbove) && slots.roiAbove, jsxRuntime.jsxs("div", { className: css('rois-wrapper', styles$5, themeMode), children: [jsxRuntime.jsx(Header, {}), jsxRuntime.jsx(Toolbar, { canvasRef: canvasRef,
|
|
1873
|
+
return (jsxRuntime.jsx(EditorProvider, { editorId: editorId, hideForbiddenTools: (_f = (_e = configuration.options) === null || _e === void 0 ? void 0 : _e.hideForbiddenTools) !== null && _f !== void 0 ? _f : false, activeTool: activeTool, setActiveTool: setActiveTool, activeColor: activeColor, setActiveColor: setActiveColor, presetName: presetName, setPresetName: setPresetName, presetDescription: presetDescription, setPresetDescription: setPresetDescription, shapes: shapes, setShapes: setShapes, addShape: addShape, addShapes: addShapes, removeShape: removeShape, configuration: configuration, metadata: metadata, setMetadata: setMetadata, onSubmit: handleSubmit, children: jsxRuntime.jsxs("div", { style: { maxWidth: '100%', width: "".concat(imageSize.width, "px") }, ref: wrapperRef, children: [jsxRuntime.jsx(TopBar, {}), configuration.rois && configuration.rois.length > 0 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(slots === null || slots === void 0 ? void 0 : slots.roiAbove) && slots.roiAbove, jsxRuntime.jsxs("div", { className: css('rois-wrapper', styles$5, themeMode), children: [jsxRuntime.jsx(Header, {}), jsxRuntime.jsx(Toolbar, { canvasRef: canvasRef, canvasSize: canvasSize }), jsxRuntime.jsx("div", { className: css('canvas-wrapper', styles$5, themeMode), style: {
|
|
1873
1874
|
width: "".concat(canvasSize.width, "px"),
|
|
1874
1875
|
height: "".concat(canvasSize.height, "px"),
|
|
1875
1876
|
backgroundImage: "url(".concat(imageUrl, ")"),
|