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