Create professional demos and 3D mockups in seconds, directly in your browser
feat(types): enhance ControlPanelProps and TimelineProps for multi-video support and additional video management functionalities
CristianOlivera16136a678b57c
diff --git a/lib/thumbnail-cache.ts b/lib/thumbnail-cache.tsindex 8c57312..62af305 100644--- a/lib/thumbnail-cache.ts+++ b/lib/thumbnail-cache.ts@@ -12,9 +12,6 @@ export interface CachedThumbnailSet {let dbInstance: IDBDatabase | null = null;-/**- * Open IndexedDB connection- */async function openDB(): Promise<IDBDatabase> {if (dbInstance) return dbInstance;@@ -38,9 +35,6 @@ async function openDB(): Promise<IDBDatabase> {});}-/**- * Get cached thumbnails for a video by videoId- */export async function getCachedThumbnails(videoId: string,quality: string,@@ -64,7 +58,6 @@ export async function getCachedThumbnails(if (Date.now() - result.createdAt < maxAge) {resolve(result);} else {- // Cache expired, delete itdeleteCachedThumbnails(videoId, quality, interval);resolve(null);}@@ -79,9 +72,6 @@ export async function getCachedThumbnails(}}-/**- * Save thumbnails to cache- */export async function saveThumbnailsToCache(videoId: string,quality: string,@@ -114,9 +104,6 @@ export async function saveThumbnailsToCache(}}-/**- * Delete cached thumbnails- */export async function deleteCachedThumbnails(videoId: string,quality: string,@@ -139,9 +126,6 @@ export async function deleteCachedThumbnails(}}-/**- * Clear all cached thumbnails (for cleanup)- */export async function clearAllThumbnailCache(): Promise<void> {try {const db = await openDB();@@ -158,9 +142,6 @@ export async function clearAllThumbnailCache(): Promise<void> {}}-/**- * Get cache size info- */export async function getThumbnailCacheInfo(): Promise<{ count: number; estimatedSize: string }> {try {const db = await openDB();@@ -173,7 +154,7 @@ export async function getThumbnailCacheInfo(): Promise<{ count: number; estimaterequest.onsuccess = () => {resolve({count: request.result,- estimatedSize: "Unknown", // Would need to iterate to calculate+ estimatedSize: "Unknown",});};});diff --git a/types/control-panel.types.ts b/types/control-panel.types.tsindex 88384f9..e7a598f 100644--- a/types/control-panel.types.ts+++ b/types/control-panel.types.ts@@ -60,10 +60,18 @@ export interface ControlPanelProps {onToggleMuteOriginalAudio?: () => void;onMasterVolumeChange?: (volume: number) => void;videoDuration?: number;- videoHasAudioTrack?: boolean;// Cursor propscursorConfig?: CursorConfig;cursorData?: CursorRecordingData;isRecordedVideo?: boolean;onCursorConfigChange?: (config: Partial<CursorConfig>) => void;+ // 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;}diff --git a/types/timeline.types.ts b/types/timeline.types.tsindex fa1fdef..00d86e8 100644--- a/types/timeline.types.ts+++ b/types/timeline.types.ts@@ -1,5 +1,6 @@import { ZoomFragment } from "./zoom.types";import type { AudioTrack, UploadedAudio } from "./audio.types";+import type { VideoTrackClip } from "./video-track.types";export interface TrimRange {start: number;@@ -17,6 +18,12 @@ export interface TimelineProps {onDragEnd?: () => void;trimRange: TrimRange;onTrimChange: (range: TrimRange) => void;+ // Video clips props (multi-video support)+ videoClips?: VideoTrackClip[];+ selectedVideoClipId?: string | null;+ onSelectVideoClip?: (clipId: string | null) => void;+ onUpdateVideoClip?: (clipId: string, updates: Partial<VideoTrackClip>) => void;+ onDeleteVideoClip?: (clipId: string) => void;// Zoom propszoomFragments?: ZoomFragment[];selectedZoomFragmentId?: string | null;