Create polished demo videos without editing skills. Mac/Windows/Linux
fix: import issues and changed some files around
Alan Trebugeais508311b32991
diff --git a/src/components/video-editor/timeline/TimelineEditor.tsx b/src/components/video-editor/timeline/TimelineEditor.tsxindex 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<TimelineEditorHandle, TimelineEditorProps>(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.tsxsimilarity index 100%rename from src/components/video-editor/timeline/KeyframeMarkers.tsxrename to src/components/video-editor/timeline/components/markers/KeyframeMarkers.tsxdiff --git a/src/components/video-editor/timeline/components/viewport/TimelineCanvasRows.tsx b/src/components/video-editor/timeline/components/viewport/TimelineCanvasRows.tsxindex 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.tsxsimilarity index 97%rename from src/components/video-editor/timeline/AudioWaveform.tsxrename to src/components/video-editor/timeline/components/waveform/AudioWaveform.tsxindex 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.tsxsimilarity index 98%rename from src/components/video-editor/timeline/TimelineWrapper.tsxrename to src/components/video-editor/timeline/components/wrapper/TimelineWrapper.tsxindex 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.tssimilarity index 100%rename from src/components/video-editor/timeline/hooks/useTimelineAnnotationsActions.tsrename to src/components/video-editor/timeline/hooks/actions/useTimelineAnnotationsActions.tsdiff --git a/src/components/video-editor/timeline/hooks/useTimelineAudioActions.ts b/src/components/video-editor/timeline/hooks/actions/useTimelineAudioActions.tssimilarity index 94%rename from src/components/video-editor/timeline/hooks/useTimelineAudioActions.tsrename to src/components/video-editor/timeline/hooks/actions/useTimelineAudioActions.tsindex 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.tssimilarity index 97%rename from src/components/video-editor/timeline/hooks/useTimelineZoomActions.tsrename to src/components/video-editor/timeline/hooks/actions/useTimelineZoomActions.tsindex 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.tssimilarity index 92%rename from src/components/video-editor/timeline/useAudioPeaks.tsrename to src/components/video-editor/timeline/hooks/useTimelineAudioPeaks.tsindex 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<AudioPeaksData | null>(null);const urlRef = useRef(fileUrl);diff --git a/src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.ts b/src/components/video-editor/timeline/hooks/useTimelineEditorRuntime.tsindex 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.tssimilarity index 100%rename from src/components/video-editor/timeline/hooks/timelineAudioPlacement.test.tsrename to src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.test.tsdiff --git a/src/components/video-editor/timeline/hooks/timelineAudioPlacement.ts b/src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.tssimilarity index 95%rename from src/components/video-editor/timeline/hooks/timelineAudioPlacement.tsrename to src/components/video-editor/timeline/hooks/utils/timelineAudioPlacement.tsindex 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.tssimilarity index 100%rename from src/components/video-editor/timeline/hooks/timelineNotifications.tsrename to src/components/video-editor/timeline/hooks/utils/timelineNotifications.tsdiff --git a/src/components/video-editor/timeline/hooks/timelineSelectionUtils.test.ts b/src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.test.tssimilarity index 100%rename from src/components/video-editor/timeline/hooks/timelineSelectionUtils.test.tsrename to src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.test.tsdiff --git a/src/components/video-editor/timeline/hooks/timelineSelectionUtils.ts b/src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.tssimilarity index 100%rename from src/components/video-editor/timeline/hooks/timelineSelectionUtils.tsrename to src/components/video-editor/timeline/hooks/utils/timelineSelectionUtils.ts