react-video-annotation-tool
Version:
A React-based video player with built-in annotation features, enabling interactive video tagging and markup for seamless media annotation workflows
39 lines • 1.52 kB
JavaScript
import React, { forwardRef } from "react";
import { Rect } from "react-konva";
export var Rectangle = /*#__PURE__*/forwardRef(function (_ref, ref) {
var properties = _ref.properties,
scaleX = _ref.scaleX,
scaleY = _ref.scaleY,
color = _ref.color,
draggable = _ref.draggable,
onClick = _ref.onClick,
onDragEnd = _ref.onDragEnd,
onDragStart = _ref.onDragStart,
onTransformEnd = _ref.onTransformEnd,
onTransformStart = _ref.onTransformStart,
onDragMove = _ref.onDragMove,
dragBoundFunc = _ref.dragBoundFunc,
currentWidth = _ref.currentWidth,
currentHeight = _ref.currentHeight,
onMouseEnter = _ref.onMouseEnter;
return /*#__PURE__*/React.createElement(Rect, {
ref: ref,
x: properties.x * (currentWidth / properties.screenWidth),
y: properties.y * (currentHeight / properties.screenHeight),
width: properties.width * (currentWidth / properties.screenWidth),
height: properties.height * (currentHeight / properties.screenHeight),
shadowBlur: 5,
stroke: color,
strokeWidth: (properties === null || properties === void 0 ? void 0 : properties.strokeWidth) || 2,
opacity: (properties === null || properties === void 0 ? void 0 : properties.opacity) || 1,
draggable: draggable,
onClick: onClick,
onDragEnd: onDragEnd,
onDragStart: onDragStart,
onDragMove: onDragMove,
onMouseEnter: onMouseEnter,
dragBoundFunc: dragBoundFunc,
onTransformStart: onTransformStart,
onTransformEnd: onTransformEnd
});
});