From 8db3bead13441a5882d8689dfc6a9f09c82375d9 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 25 Mar 2026 16:47:22 +0100 Subject: feat: masks, properties refactor, shaders, storage migrations, and more --- .../editor/panels/timeline/timeline-track.tsx | 62 +++++++++++++--------- 1 file changed, 38 insertions(+), 24 deletions(-) (limited to 'apps/web/src/components/editor/panels/timeline/timeline-track.tsx') diff --git a/apps/web/src/components/editor/panels/timeline/timeline-track.tsx b/apps/web/src/components/editor/panels/timeline/timeline-track.tsx index 81cda7a6..6a9e4dfe 100644 --- a/apps/web/src/components/editor/panels/timeline/timeline-track.tsx +++ b/apps/web/src/components/editor/panels/timeline/timeline-track.tsx @@ -2,12 +2,12 @@ import { useElementSelection } from "@/hooks/timeline/element/use-element-selection"; import { TimelineElement } from "./timeline-element"; -import type { TimelineTrack } from "@/types/timeline"; -import type { TimelineElement as TimelineElementType } from "@/types/timeline"; +import type { TimelineTrack } from "@/lib/timeline"; +import type { TimelineElement as TimelineElementType } from "@/lib/timeline"; import type { SnapPoint } from "@/lib/timeline/snap-utils"; -import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants"; +import { TIMELINE_CONSTANTS, TIMELINE_LAYERS } from "@/constants/timeline-constants"; import { useEdgeAutoScroll } from "@/hooks/timeline/use-edge-auto-scroll"; -import type { ElementDragState } from "@/types/timeline"; +import type { ElementDragState } from "@/lib/timeline"; import { useEditor } from "@/hooks/use-editor"; interface TimelineTrackContentProps { @@ -30,7 +30,7 @@ interface TimelineTrackContentProps { track: TimelineTrack; }) => void; onTrackMouseDown?: (event: React.MouseEvent) => void; - onTrackClick?: (event: React.MouseEvent) => void; + onTrackMouseUp?: (event: React.MouseEvent) => void; shouldIgnoreClick?: () => boolean; targetElementId?: string | null; } @@ -47,14 +47,12 @@ export function TimelineTrackContent({ onElementMouseDown, onElementClick, onTrackMouseDown, - onTrackClick, + onTrackMouseUp, shouldIgnoreClick, targetElementId = null, }: TimelineTrackContentProps) { - const editor = useEditor(); const { isElementSelected } = useElementSelection(); - - const duration = editor.timeline.getTotalDuration(); + const duration = useEditor((e) => e.timeline.getTotalDuration()); useEdgeAutoScroll({ isActive: dragState.isDragging, @@ -65,21 +63,37 @@ export function TimelineTrackContent({ }); return ( - + ); } -- cgit v1.3.1