diff --git a/src/components/Instrument.tsx b/src/components/Instrument.tsx index 0b9964e..06b7e17 100644 --- a/src/components/Instrument.tsx +++ b/src/components/Instrument.tsx @@ -54,10 +54,10 @@ const InstrumentFrame: React.FC = memo(forwardRef( )} /> ); - }), -); + }, +)); -export const Instrument: React.FC = ({ uuid, name, element, x, y, width, height }) => { +export const Instrument: React.FC = ({ uuid, name, element, x, y, width, height, onMouseEnter, onMouseLeave }) => { const iframeRef = useRef(null); const containerRef = useRef(null); @@ -122,7 +122,7 @@ export const Instrument: React.FC = ({ uuid, name, element, x, y, width element={{ uuid, name, element, x, y, width, height }} x={e.clientX} y={e.clientY} - /> + />, )) ), [dispatch]); @@ -152,6 +152,8 @@ export const Instrument: React.FC = ({ uuid, name, element, x, y, width width, height, }} + onMouseEnter={onMouseEnter} + onMouseLeave={onMouseLeave} >
diff --git a/src/pages/Workspace.tsx b/src/pages/Workspace.tsx index 9a0bb16..889e8a0 100644 --- a/src/pages/Workspace.tsx +++ b/src/pages/Workspace.tsx @@ -83,11 +83,13 @@ const CanvasLayer: React.FC = () => { const project = useWorkspaceSelector((state: WorkspaceState) => state.project.active); const dispatch = useWorkspaceDispatch(); + const [transformDisabled, setTransformDisabled] = useState(false); + const dndContext = useDndContext(); return ( { }} > {project?.config.elements?.map((props) => ( - + setTransformDisabled(true)} + onMouseLeave={() => setTransformDisabled(false)} + /> ))}
diff --git a/src/types.ts b/src/types.ts index e2af403..2a7100d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -8,6 +8,8 @@ export interface Element { height: number; x: number; y: number; + onMouseEnter?: () => void; + onMouseLeave?: () => void; } export interface AceConfig {