diff --git a/src/components/video-editor/timeline/TimelineEditor.tsx b/src/components/video-editor/timeline/TimelineEditor.tsx index 455cde09..1beb0bfc 100644 --- a/src/components/video-editor/timeline/TimelineEditor.tsx +++ b/src/components/video-editor/timeline/TimelineEditor.tsx @@ -26,9 +26,9 @@ import type { ZoomFocus, ZoomRegion, } from "../types"; -import KeyframeMarkers from "./KeyframeMarkers"; -import TimelineWrapper from "./TimelineWrapper"; -import { useAudioPeaks } from "./useAudioPeaks"; +import KeyframeMarkers from "./components/markers/KeyframeMarkers"; +import TimelineWrapper from "./components/wrapper/TimelineWrapper"; +import { useTimelineAudioPeaks } from "./hooks/useTimelineAudioPeaks"; import { calculateTimelineScale } from "./core/time"; import { useTimelineEditorRuntime } from "./hooks/useTimelineEditorRuntime"; import { useTimelineRange } from "./hooks/useTimelineRange"; @@ -177,7 +177,7 @@ const TimelineEditor = forwardRef( zoom: "Ctrl + Scroll", }); const { shortcuts: keyShortcuts, isMac } = useShortcuts(); - const audioPeaks = useAudioPeaks(videoPath); + const audioPeaks = useTimelineAudioPeaks(videoPath); useEffect(() => { if (aspectRatio === "native") { diff --git a/src/components/video-editor/timeline/KeyframeMarkers.tsx b/src/components/video-editor/timeline/components/markers/KeyframeMarkers.tsx similarity index 100% rename from src/components/video-editor/timeline/KeyframeMarkers.tsx rename to src/components/video-editor/timeline/components/markers/KeyframeMarkers.tsx diff --git a/src/components/video-editor/timeline/components/viewport/TimelineCanvasRows.tsx b/src/components/video-editor/timeline/components/viewport/TimelineCanvasRows.tsx index 1acafc15..4dd1f107 100644 --- a/src/components/video-editor/timeline/components/viewport/TimelineCanvasRows.tsx +++ b/src/components/video-editor/timeline/components/viewport/TimelineCanvasRows.tsx @@ -1,7 +1,7 @@ import { Plus } from "@phosphor-icons/react"; import { memo, useMemo, type MouseEventHandler } from "react"; import { cn } from "@/lib/utils"; -import AudioWaveform from "../../AudioWaveform"; +import AudioWaveform from "../waveform/AudioWaveform"; import glassStyles from "../../ItemGlass.module.css"; import Item from "../../Item"; import Row from "../../Row"; diff --git a/src/components/video-editor/timeline/AudioWaveform.tsx b/src/components/video-editor/timeline/components/waveform/AudioWaveform.tsx similarity index 97% rename from src/components/video-editor/timeline/AudioWaveform.tsx rename to src/components/video-editor/timeline/components/waveform/AudioWaveform.tsx index 5c809768..def1d607 100644 --- a/src/components/video-editor/timeline/AudioWaveform.tsx +++ b/src/components/video-editor/timeline/components/waveform/AudioWaveform.tsx @@ -1,6 +1,6 @@ import { useTimelineContext } from "dnd-timeline"; import { memo, useCallback, useEffect, useRef, useState } from "react"; -import type { AudioPeaksData } from "./core/timelineTypes"; +import type { AudioPeaksData } from "../../core/timelineTypes"; interface AudioWaveformProps { peaks: AudioPeaksData; diff --git a/src/components/video-editor/timeline/TimelineWrapper.tsx b/src/components/video-editor/timeline/components/wrapper/TimelineWrapper.tsx similarity index 98% rename from src/components/video-editor/timeline/TimelineWrapper.tsx rename to src/components/video-editor/timeline/components/wrapper/TimelineWrapper.tsx index 3191dc4c..5e777e70 100644 --- a/src/components/video-editor/timeline/TimelineWrapper.tsx +++ b/src/components/video-editor/timeline/components/wrapper/TimelineWrapper.tsx @@ -10,12 +10,12 @@ import type { import { TimelineContext } from "dnd-timeline"; import type { Dispatch, ReactNode, SetStateAction } from "react"; import { useCallback, useRef } from "react"; +import type { TimelineRegionSpan } from "../../core/timelineTypes"; import { clampRange, resolveDragEnd, resolveResizeEnd, - type TimelineRegionSpan, -} from "./dnd/engine"; +} from "../../dnd/engine"; interface TimelineWrapperProps { children: ReactNode; diff --git a/src/components/video-editor/timeline/hooks/useTimelineAnnotationsActions.ts b/src/components/video-editor/timeline/hooks/actions/useTimelineAnnotationsActions.ts similarity index 100% rename from src/components/video-editor/timeline/hooks/useTimelineAnnotationsActions.ts rename to src/components/video-editor/timeline/hooks/actions/useTimelineAnnotationsActions.ts diff --git a/src/components/video-editor/timeline/hooks/useTimelineAudioActions.ts b/src/components/video-editor/timeline/hooks/actions/useTimelineAudioActions.ts similarity index 94% rename from src/components/video-editor/timeline/hooks/useTimelineAudioActions.ts rename to src/components/video-editor/timeline/hooks/actions/useTimelineAudioActions.ts index 18e332c9..b0e1fff6 100644 --- a/src/components/video-editor/timeline/hooks/useTimelineAudioActions.ts +++ b/src/components/video-editor/timeline/hooks/actions/useTimelineAudioActions.ts @@ -1,8 +1,8 @@ import { useCallback, useMemo } from "react"; import { resolveMediaElementSource } from "@/lib/exporter/localMediaSource"; -import type { TimelineAudioRegion } from "../core/timelineTypes"; -import { resolveAudioPlacement } from "./timelineAudioPlacement"; -import { timelineNotifications } from "./timelineNotifications"; +import type { TimelineAudioRegion } from "../../core/timelineTypes"; +import { resolveAudioPlacement } from "../utils/timelineAudioPlacement"; +import { timelineNotifications } from "../utils/timelineNotifications"; interface AudioFilePickerResult { success: boolean; diff --git a/src/components/video-editor/timeline/hooks/useTimelineZoomActions.ts b/src/components/video-editor/timeline/hooks/actions/useTimelineZoomActions.ts similarity index 97% rename from src/components/video-editor/timeline/hooks/useTimelineZoomActions.ts rename to src/components/video-editor/timeline/hooks/actions/useTimelineZoomActions.ts index 156b747c..0981ffe8 100644 --- a/src/components/video-editor/timeline/hooks/useTimelineZoomActions.ts +++ b/src/components/video-editor/timeline/hooks/actions/useTimelineZoomActions.ts @@ -1,8 +1,8 @@ import type { Span } from "dnd-timeline"; import { useCallback, useEffect, useMemo } from "react"; -import type { CursorTelemetryPoint, ZoomFocus, ZoomRegion } from "../../types"; -import { buildInteractionZoomSuggestions } from "../zoomSuggestionUtils"; -import { timelineNotifications } from "./timelineNotifications"; +import type { CursorTelemetryPoint, ZoomFocus, ZoomRegion } from "../../../types"; +import { buildInteractionZoomSuggestions } from "../../zoomSuggestionUtils"; +import { timelineNotifications } from "../utils/timelineNotifications"; interface UseTimelineZoomActionsParams { timeline: { diff --git a/src/components/video-editor/timeline/useAudioPeaks.ts b/src/components/video-editor/timeline/hooks/useTimelineAudioPeaks.ts similarity index 92% rename from src/components/video-editor/timeline/useAudioPeaks.ts rename to src/components/video-editor/timeline/hooks/useTimelineAudioPeaks.ts index 9f6dfc29..ed377663 100644 --- a/src/components/video-editor/timeline/useAudioPeaks.ts +++ b/src/components/video-editor/timeline/hooks/useTimelineAudioPeaks.ts @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from "react"; -import type { AudioPeaksData } from "./core/timelineTypes"; +import type { AudioPeaksData } from "../core/timelineTypes"; /** Number of peak bins to produce — enough for smooth display at any zoom. */ const TARGET_PEAK_COUNT = 2048; @@ -10,7 +10,7 @@ const TARGET_PEAK_COUNT = 2048; * * Returns `null` while loading or if the file has no decodeable audio. */ -export function useAudioPeaks(fileUrl: string | null | undefined): AudioPeaksData | null { +export function useTimelineAudioPeaks(fileUrl: string | null | undefined): AudioPeaksData | null { const [data, setData] = useState(null); const urlRef = useRef(fileUrl); diff --git a/src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.ts b/src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.ts index 17cdb166..9eb5968f 100644 --- a/src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.ts +++ b/src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.ts @@ -3,12 +3,12 @@ import { useCallback, useImperativeHandle } from "react"; import type { ForwardedRef, RefObject } from "react"; import type { TimelineShortcutBindings } from "../core/timelineTypes"; import { useTimelineDndBindings } from "./useTimelineDndBindings"; -import { useTimelineAnnotationsActions } from "./useTimelineAnnotationsActions"; -import { useTimelineAudioActions } from "./useTimelineAudioActions"; +import { useTimelineAnnotationsActions } from "./actions/useTimelineAnnotationsActions"; +import { useTimelineAudioActions } from "./actions/useTimelineAudioActions"; import { useTimelineKeyboardShortcuts } from "./useTimelineKeyboardShortcuts"; import { useTimelineNormalization } from "./useTimelineNormalization"; import { useTimelineSelection } from "./useTimelineSelection"; -import { useTimelineZoomActions } from "./useTimelineZoomActions"; +import { useTimelineZoomActions } from "./actions/useTimelineZoomActions"; import type { AnnotationRegion, AudioRegion, diff --git a/src/components/video-editor/timeline/hooks/timelineAudioPlacement.test.ts b/src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.test.ts similarity index 100% rename from src/components/video-editor/timeline/hooks/timelineAudioPlacement.test.ts rename to src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.test.ts diff --git a/src/components/video-editor/timeline/hooks/timelineAudioPlacement.ts b/src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.ts similarity index 95% rename from src/components/video-editor/timeline/hooks/timelineAudioPlacement.ts rename to src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.ts index 3a06d4da..4be4e382 100644 --- a/src/components/video-editor/timeline/hooks/timelineAudioPlacement.ts +++ b/src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.ts @@ -1,5 +1,5 @@ -import { spansOverlap } from "../core/spans"; -import type { TimelineAudioRegion } from "../core/timelineTypes"; +import { spansOverlap } from "../../core/spans"; +import type { TimelineAudioRegion } from "../../core/timelineTypes"; interface ResolveAudioPlacementParams { audioRegions: TimelineAudioRegion[]; diff --git a/src/components/video-editor/timeline/hooks/timelineNotifications.ts b/src/components/video-editor/timeline/hooks/utils/timelineNotifications.ts similarity index 100% rename from src/components/video-editor/timeline/hooks/timelineNotifications.ts rename to src/components/video-editor/timeline/hooks/utils/timelineNotifications.ts diff --git a/src/components/video-editor/timeline/hooks/timelineSelectionUtils.test.ts b/src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.test.ts similarity index 100% rename from src/components/video-editor/timeline/hooks/timelineSelectionUtils.test.ts rename to src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.test.ts diff --git a/src/components/video-editor/timeline/hooks/timelineSelectionUtils.ts b/src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.ts similarity index 100% rename from src/components/video-editor/timeline/hooks/timelineSelectionUtils.ts rename to src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.ts