Create professional demos and 3D mockups in seconds, directly in your browser
feat: add hover support for element highlighting in LayersPanel and update related types
CristianOlivera180bf73ba4c23
diff --git a/app/components/ui/editor/LayersPanel.tsx b/app/components/ui/editor/LayersPanel.tsxindex 445ae47..ce89520 100644--- a/app/components/ui/editor/LayersPanel.tsx+++ b/app/components/ui/editor/LayersPanel.tsx@@ -30,6 +30,8 @@ export function LayersPanel({onVideoLayerSelect,isVideoLayerSelected = false,mediaType = "video",+ hoveredElementId = null,+ onHoverElement,}: LayersPanelProps) {const t = useTranslations("editor")const [isOpen, setIsOpen] = useState(true);@@ -489,6 +491,16 @@ export function LayersPanel({}setCtxMenu({ x: e.clientX, y: e.clientY, id });}}+ onMouseEnter={() => {+ if (!pointerDragRef.current?.active && onHoverElement) {+ onHoverElement(id);+ }+ }}+ onMouseLeave={() => {+ if (onHoverElement && hoveredElementId === id) {+ onHoverElement(null);+ }+ }}data-layer-row={id}className={["group relative flex items-center gap-1.5 h-7 rounded-md cursor-pointer select-none transition-all duration-100",@@ -587,6 +599,8 @@ export function LayersPanel({onToggleVisible,onToggleLock,onDelete,+ onHoverElement,+ hoveredElementId,t]);diff --git a/app/components/ui/editor/VideoCanvas.tsx b/app/components/ui/editor/VideoCanvas.tsxindex 4c0bca1..a9c9695 100644--- a/app/components/ui/editor/VideoCanvas.tsx+++ b/app/components/ui/editor/VideoCanvas.tsx@@ -2028,6 +2028,8 @@ export const VideoCanvas = forwardRef<VideoCanvasHandle, VideoCanvasProps>(functsetCanvasSelectedIds([]);}}mediaType={mediaType}+ hoveredElementId={hoveredElementId}+ onHoverElement={setHoveredElementId}/></div>diff --git a/lib/mockup-data.tsx b/lib/mockup-data.tsxindex afb6f70..2ceaa1f 100644--- a/lib/mockup-data.tsx+++ b/lib/mockup-data.tsx@@ -8,7 +8,6 @@ export const MOCKUPS: Mockup[] = [category: "browser",features: {...DEFAULT_MOCKUP_FEATURES,- // None no tiene configuraciones},preview: (<NonePreview />diff --git a/types/layers.types.ts b/types/layers.types.tsindex a1a2b00..bd59af1 100644--- a/types/layers.types.ts+++ b/types/layers.types.ts@@ -28,6 +28,9 @@ export interface LayersPanelProps {onVideoLayerSelect?: () => void;isVideoLayerSelected?: boolean;mediaType?: "video" | "image";+ // Hover support for element highlighting in canvas+ hoveredElementId?: string | null;+ onHoverElement?: (id: string | null) => void;}export interface CtxMenuState { x: number; y: number; id: string }