fix build
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useRef } from "react";
|
||||
import { Star } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import type { ShapeProps } from "./types";
|
||||
|
||||
const AbstractShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const AbstractShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const shapeRef = useRef<Konva.Star>(null);
|
||||
|
||||
// Transformer is managed in EditorCanvas for multi-select support
|
||||
@@ -27,13 +27,13 @@ const AbstractShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, dr
|
||||
outerRadius={radius}
|
||||
fill={isMask ? "transparent" : obj.fill}
|
||||
stroke={
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
: (isMask && !showGuide)
|
||||
? "transparent"
|
||||
: obj.stroke
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
: (isMask && !showGuide)
|
||||
? "transparent"
|
||||
: obj.stroke
|
||||
}
|
||||
strokeWidth={isSelected ? 3 : (isMask && showGuide ? 2 : (obj.strokeWidth ?? 0))}
|
||||
dash={isMask && showGuide ? [10, 5] : undefined}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useRef } from "react";
|
||||
import { Arrow } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import type { ShapeProps } from "./types";
|
||||
|
||||
const ArrowShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const ArrowShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const shapeRef = useRef<Konva.Arrow>(null);
|
||||
|
||||
// Transformer is managed in EditorCanvas for multi-select support
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useRef } from "react";
|
||||
import { Circle } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import type { ShapeProps } from "./types";
|
||||
|
||||
const CircleShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const CircleShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const shapeRef = useRef<Konva.Circle>(null);
|
||||
|
||||
// Transformer is managed in EditorCanvas for multi-select support
|
||||
|
||||
const isMask = obj.isMask || false;
|
||||
const showGuide = obj.showMaskGuide !== false;
|
||||
|
||||
|
||||
return (
|
||||
<Circle
|
||||
ref={shapeRef}
|
||||
@@ -21,13 +21,13 @@ const CircleShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, drag
|
||||
radius={(obj.width || 50) / 2}
|
||||
fill={isMask ? "transparent" : obj.fill}
|
||||
stroke={
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
: (isMask && !showGuide)
|
||||
? "transparent"
|
||||
: obj.stroke
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
: (isMask && !showGuide)
|
||||
? "transparent"
|
||||
: obj.stroke
|
||||
}
|
||||
strokeWidth={isSelected ? 3 : (isMask && showGuide ? 2 : (obj.strokeWidth ?? 0))}
|
||||
dash={isMask && showGuide ? [10, 5] : undefined}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useRef } from "react";
|
||||
import { Image as KonvaImage } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import useImage from "use-image";
|
||||
@@ -7,7 +7,6 @@ import type { ShapeProps } from "./types";
|
||||
const ImageObject = ({
|
||||
obj,
|
||||
isSelected,
|
||||
transformerRef,
|
||||
onSelect,
|
||||
onUpdate,
|
||||
draggable,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useRef } from "react";
|
||||
import { Line } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import type { ShapeProps } from "./types";
|
||||
|
||||
const LineShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const LineShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const shapeRef = useRef<Konva.Line>(null);
|
||||
|
||||
// Transformer is managed in EditorCanvas for multi-select support
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef, useMemo } from "react";
|
||||
import { useRef, useMemo } from "react";
|
||||
import { Text } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import type { ShapeProps } from "./types";
|
||||
@@ -14,8 +14,6 @@ const getFontWeight = (fontWeight?: string): string => {
|
||||
|
||||
const LinkShape = ({
|
||||
obj,
|
||||
isSelected,
|
||||
transformerRef,
|
||||
onSelect,
|
||||
onUpdate,
|
||||
draggable,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useRef } from "react";
|
||||
import { Rect } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import type { ShapeProps } from "./types";
|
||||
|
||||
const RectangleShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const RectangleShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const shapeRef = useRef<Konva.Rect>(null);
|
||||
|
||||
// Transformer is managed in EditorCanvas for multi-select support
|
||||
@@ -22,10 +22,10 @@ const RectangleShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, d
|
||||
height={obj.height || 100}
|
||||
fill={isMask ? "transparent" : obj.fill}
|
||||
stroke={
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
: (isMask && !showGuide)
|
||||
? "transparent"
|
||||
: obj.stroke
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useRef } from "react";
|
||||
import { RegularPolygon } from "react-konva";
|
||||
import Konva from "konva";
|
||||
import type { ShapeProps } from "./types";
|
||||
|
||||
const TriangleShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const TriangleShape = ({ obj, isSelected, onSelect, onUpdate, draggable }: ShapeProps) => {
|
||||
const shapeRef = useRef<Konva.RegularPolygon>(null);
|
||||
|
||||
// Transformer is managed in EditorCanvas for multi-select support
|
||||
@@ -23,13 +23,13 @@ const TriangleShape = ({ obj, isSelected, transformerRef, onSelect, onUpdate, dr
|
||||
radius={radius}
|
||||
fill={isMask ? "transparent" : obj.fill}
|
||||
stroke={
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
: (isMask && !showGuide)
|
||||
? "transparent"
|
||||
: obj.stroke
|
||||
isSelected
|
||||
? "#3b82f6"
|
||||
: (isMask && showGuide)
|
||||
? "#ff6b6b"
|
||||
: (isMask && !showGuide)
|
||||
? "transparent"
|
||||
: obj.stroke
|
||||
}
|
||||
strokeWidth={isSelected ? 3 : (isMask && showGuide ? 2 : (obj.strokeWidth ?? 0))}
|
||||
dash={isMask && showGuide ? [10, 5] : undefined}
|
||||
|
||||
@@ -8,7 +8,6 @@ import { createPortal } from "react-dom";
|
||||
const VideoShape = ({
|
||||
obj,
|
||||
isSelected,
|
||||
transformerRef,
|
||||
onSelect,
|
||||
onUpdate,
|
||||
draggable,
|
||||
|
||||
Reference in New Issue
Block a user