Skip to content

Create professional demos and 3D mockups in seconds, directly in your browser

6.0 KB
Raw Blame
import { BackgroundTab, Tool, VideoThumbnail } from "./editor.types";
import { BackgroundColorConfig } from "./background.types";
import { ZoomFragment, ZoomMovement } from "./zoom.types";
import { MockupConfig, MenuPage } from "./mockup.types";
import type { CanvasElement } from "./canvas-elements.types";
import type { UploadedAudio, AudioTrack } from "./audio.types";
import type { CameraConfig } from "./camera.types";
import type { ImageProjectPreview } from "./image-project.types";
import { MockupMotionFragment, MockupMotionPresetId } from "@/lib/mockup-motion";
import type {
    MockupCameraKeyframe,
    MockupCameraPreset,
} from "@/lib/viewer-controls3d";
import type { CameraOverlayKeyframe } from "@/lib/camera-overlay-animation";

export interface ControlPanelProps {
    activeTool: Tool;
    backgroundTab: BackgroundTab;
    selectedWallpaper: number;
    backgroundBlur: number;
    padding: number;
    roundedCorners: number;
    shadows: number;
    selectedImageUrl: string;
    unsplashBgUrl?: string;
    backgroundColorConfig: BackgroundColorConfig | null;
    backgroundColorCss?: string;
    onBackgroundTabChange: (tab: BackgroundTab) => void;
    onWallpaperSelect: (index: number) => void;
    onBackgroundBlurChange: (value: number) => void;
    onPaddingChange: (value: number) => void;
    onRoundedCornersChange: (value: number) => void;
    onShadowsChange: (value: number) => void;
    onImageSelect: (url: string) => void;
    onBackgroundColorChange: (config: BackgroundColorConfig) => void;
    zoomFragments?: ZoomFragment[];
    selectedZoomFragment?: ZoomFragment | null;
    onSelectZoomFragment?: (fragmentId: string | null) => void;
    onAddZoomFragment?: () => void;
    onUpdateZoomFragment?: (fragmentId: string, updates: Partial<ZoomFragment>) => void;
    onDeleteZoomFragment?: (fragmentId: string) => void;
    zoomMovements?: ZoomMovement[];
    selectedZoomMovementId?: string | null;
    onSelectZoomMovement?: (id: string | null) => void;
    onToggleZoomMovement?: (fragmentId: string, enabled: boolean) => void;
    onAddZoomMovement?: (fragmentId: string) => void;
    onDeleteZoomMovement?: (id: string) => void;
    onUpdateZoomMovementPoint?: (id: string, x: number, y: number) => void;
    videoUrl?: string | null;
    videoThumbnail?: string | null;
    getThumbnailForTime?: (time: number) => VideoThumbnail | null;
    videoDimensions?: { width: number; height: number } | null;
    mockupId?: string;
    mockupConfig?: MockupConfig;
    onMockupChange?: (mockupId: string) => void;
    onMockupConfigChange?: (config: Partial<MockupConfig>) => void;
    initialMockupMenuPage?: MenuPage;
    mockupMenuNavigationToken?: number;
    onAddCanvasElement?: (element: CanvasElement) => void;
    selectedCanvasElement?: CanvasElement | null;
    onUpdateCanvasElement?: (id: string, updates: Partial<CanvasElement>) => void;
    onDeleteCanvasElement?: (id: string) => void;
    onBringToFront?: (id: string) => void;
    onSendToBack?: (id: string) => void;
    uploadedAudios?: UploadedAudio[];
    audioTracks?: AudioTrack[];
    muteOriginalAudio?: boolean;
    masterVolume?: number;
    onAudioUpload?: (file: File) => void;
    onAudioDelete?: (audioId: string) => void;
    onAddAudioTrack?: (audioId: string) => void;
    onUpdateAudioTrack?: (trackId: string, updates: Partial<AudioTrack>) => void;
    onDeleteAudioTrack?: (trackId: string) => void;
    onToggleMuteOriginalAudio?: () => void;
    onMasterVolumeChange?: (volume: number) => void;
    videoDuration?: number;
    // Cursor props
    isRecordedVideo?: boolean;
    // Videos library props
    onAddVideoToTrack?: (videoId: string, blob: Blob, duration: number) => void;
    onRemoveVideoFromTrack?: (videoId: string) => void;
    onVideoUploadToLibrary?: (file: File) => void;
    onVideoDeleteFromTrack?: (videoId: string) => void;
    videosInTrackIds?: string[];
    videosLibraryRefresh?: number;
    isVideoUploading?: boolean;
    onVideoAudioToggle?: (videoId: string, hasAudio: boolean) => void;
    // Camera overlay props
    cameraUrl?: string | null;
    cameraConfig?: CameraConfig | null;
    onCameraConfigChange?: (partial: Partial<CameraConfig>) => void;
    cameraOverlayKeyframes?: CameraOverlayKeyframe[];
    selectedCameraOverlayKeyframeId?: string | null;
    onAddCameraOverlayKeyframe?: () => void;
    onDeleteCameraOverlayKeyframe?: (id: string) => void;
    // History/Image projects props
    imageProjects?: ImageProjectPreview[];
    currentImageProjectId?: string | null;
    isLoadingProjects?: boolean;
    onSelectImageProject?: (projectId: string) => void;
    onAddImageToCanvas?: (projectId: string) => void;
    onDeleteImageProject?: (projectId: string) => void;
    onUploadImageToHistory?: (file: File) => void;
    /** Which editor mode — determines which motion menu to show */
    mediaType?: "video" | "image";
    wallpaperShowAll?: boolean;
    onWallpaperShowAllChange?: (value: boolean) => void;
    globalSpeed?: number;
    onGlobalSpeedChange?: (speed: number) => void;
    mockupMotionFragments?: MockupMotionFragment[];
    selectedMockupMotionFragment?: MockupMotionFragment | null;
    selectedMockupMotionFragmentId?: string | null;
    onAddOrReplaceMotionPreset?: (presetId: MockupMotionPresetId) => void;
    onUpdateMockupMotionFragment?: (id: string, updates: Partial<MockupMotionFragment>) => void;
    onSelectMockupMotionFragment?: (id: string | null) => void;
    onDeleteMockupMotionFragment?: (id: string) => void;
    isPlaying?: boolean;
    currentTime?: number;
    mockupCameraKeyframes?: MockupCameraKeyframe[];
    selectedMockupCameraKeyframeId?: string | null;
    onApplyMockupCameraPreset?: (preset: MockupCameraPreset) => void;
    onApplyAutomaticMockupCamera?: () => void;
    onPreviewMockupCameraSegment?: () => void;
    onUpdateMockupCameraKeyframe?: (updates: Partial<MockupCameraKeyframe>) => void;
    onAddMockupCameraKeyframe?: () => void;
    onDeleteMockupCameraKeyframe?: (id: string) => void;
    selectedAudioTrackId?: string | null;
    setSelectedAudioTrackId?: (trackId: string | null) => void;
}