@@ -2,7 +2,6 @@ import type { Span } from "dnd-timeline";
22import { useCallback , useEffect , useMemo , useRef , useState } from "react" ;
33import { Panel , PanelGroup , PanelResizeHandle } from "react-resizable-panels" ;
44import { toast } from "sonner" ;
5- import { Toaster } from "@/components/ui/sonner" ;
65import { useShortcuts } from "@/contexts/ShortcutsContext" ;
76import { INITIAL_EDITOR_STATE , useEditorHistory } from "@/hooks/useEditorHistory" ;
87import {
@@ -76,6 +75,7 @@ export default function VideoEditor() {
7675 borderRadius,
7776 padding,
7877 aspectRatio,
78+ webcamLayoutPreset,
7979 } = editorState ;
8080
8181 // ── Non-undoable state
@@ -173,6 +173,7 @@ export default function VideoEditor() {
173173 speedRegions : normalizedEditor . speedRegions ,
174174 annotationRegions : normalizedEditor . annotationRegions ,
175175 aspectRatio : normalizedEditor . aspectRatio ,
176+ webcamLayoutPreset : normalizedEditor . webcamLayoutPreset ,
176177 } ) ;
177178 setExportQuality ( normalizedEditor . exportQuality ) ;
178179 setExportFormat ( normalizedEditor . exportFormat ) ;
@@ -240,6 +241,7 @@ export default function VideoEditor() {
240241 speedRegions,
241242 annotationRegions,
242243 aspectRatio,
244+ webcamLayoutPreset,
243245 exportQuality,
244246 exportFormat,
245247 gifFrameRate,
@@ -261,6 +263,7 @@ export default function VideoEditor() {
261263 speedRegions ,
262264 annotationRegions ,
263265 aspectRatio ,
266+ webcamLayoutPreset ,
264267 exportQuality ,
265268 exportFormat ,
266269 gifFrameRate ,
@@ -352,6 +355,7 @@ export default function VideoEditor() {
352355 speedRegions,
353356 annotationRegions,
354357 aspectRatio,
358+ webcamLayoutPreset,
355359 exportQuality,
356360 exportFormat,
357361 gifFrameRate,
@@ -404,6 +408,7 @@ export default function VideoEditor() {
404408 speedRegions ,
405409 annotationRegions ,
406410 aspectRatio ,
411+ webcamLayoutPreset ,
407412 exportQuality ,
408413 exportFormat ,
409414 gifFrameRate ,
@@ -1021,6 +1026,7 @@ export default function VideoEditor() {
10211026 videoPadding : padding ,
10221027 cropRegion,
10231028 annotationRegions,
1029+ webcamLayoutPreset,
10241030 previewWidth,
10251031 previewHeight,
10261032 onProgress : ( progress : ExportProgress ) => {
@@ -1148,6 +1154,7 @@ export default function VideoEditor() {
11481154 padding,
11491155 cropRegion,
11501156 annotationRegions,
1157+ webcamLayoutPreset,
11511158 previewWidth,
11521159 previewHeight,
11531160 onProgress : ( progress : ExportProgress ) => {
@@ -1212,6 +1219,7 @@ export default function VideoEditor() {
12121219 annotationRegions ,
12131220 isPlaying ,
12141221 aspectRatio ,
1222+ webcamLayoutPreset ,
12151223 exportQuality ,
12161224 handleExportSaved ,
12171225 ] ,
@@ -1351,6 +1359,7 @@ export default function VideoEditor() {
13511359 ref = { videoPlaybackRef }
13521360 videoPath = { videoPath || "" }
13531361 webcamVideoPath = { webcamVideoPath || undefined }
1362+ webcamLayoutPreset = { webcamLayoutPreset }
13541363 onDurationChange = { setDuration }
13551364 onTimeUpdate = { setCurrentTime }
13561365 currentTime = { currentTime }
@@ -1474,6 +1483,9 @@ export default function VideoEditor() {
14741483 cropRegion = { cropRegion }
14751484 onCropChange = { ( r ) => pushState ( { cropRegion : r } ) }
14761485 aspectRatio = { aspectRatio }
1486+ hasWebcam = { Boolean ( webcamVideoPath ) }
1487+ webcamLayoutPreset = { webcamLayoutPreset }
1488+ onWebcamLayoutPresetChange = { ( preset ) => pushState ( { webcamLayoutPreset : preset } ) }
14771489 videoElement = { videoPlaybackRef . current ?. video || null }
14781490 exportQuality = { exportQuality }
14791491 onExportQualityChange = { setExportQuality }
@@ -1521,8 +1533,6 @@ export default function VideoEditor() {
15211533 </ PanelGroup >
15221534 </ div >
15231535
1524- < Toaster theme = "dark" className = "pointer-events-auto" />
1525-
15261536 < ExportDialog
15271537 isOpen = { showExportDialog }
15281538 onClose = { ( ) => setShowExportDialog ( false ) }
0 commit comments