Update
This commit is contained in:
@@ -119,6 +119,10 @@ const VideoPreview = ({
|
||||
elementRefs,
|
||||
);
|
||||
|
||||
const handleResetClick = () => {
|
||||
emitter.emit('video-reset');
|
||||
};
|
||||
|
||||
// Enhanced stage click handler that also clears guide lines
|
||||
const handleStageClick = (e) => {
|
||||
baseHandleStageClick(e);
|
||||
@@ -281,6 +285,7 @@ const VideoPreview = ({
|
||||
id="open-text-editor"
|
||||
className="h-16 w-16 rounded-full shadow-xl"
|
||||
onClick={() => {
|
||||
handleResetClick();
|
||||
handleElementSelect(element.id);
|
||||
onOpenTextSidebar();
|
||||
}}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useMitt } from '@/plugins/MittContext';
|
||||
import useVideoEditorStore from '@/stores/VideoEditorStore';
|
||||
import useMediaStore from '@/stores/MediaStore';
|
||||
import { Download, Play, Square, SquarePen, RefreshCw } from 'lucide-react';
|
||||
import useVideoEditorStore from '@/stores/VideoEditorStore';
|
||||
import { Download, Play, RefreshCw, Square, SquarePen } from 'lucide-react';
|
||||
|
||||
const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive = false }) => {
|
||||
const { videoIsPlaying } = useVideoEditorStore();
|
||||
@@ -16,15 +16,22 @@ const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive =
|
||||
emitter.emit('video-play');
|
||||
};
|
||||
|
||||
const handleOnEditClick = () => {
|
||||
handleReset();
|
||||
onEditClick();
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
emitter.emit('video-reset');
|
||||
};
|
||||
|
||||
const handleDownloadButton = () => {
|
||||
handleReset();
|
||||
emitter.emit('video-open-download-modal');
|
||||
};
|
||||
|
||||
const handleAIButton = () => {
|
||||
handleReset();
|
||||
emitter.emit('open-ai-editor-sheet');
|
||||
};
|
||||
|
||||
@@ -60,7 +67,7 @@ const EditorControls = ({ className = '', onEditClick = () => {}, isEditActive =
|
||||
variant={isEditActive ? 'outline' : 'outline'}
|
||||
size="icon"
|
||||
className="h-12 w-12 rounded-full border shadow-sm"
|
||||
onClick={onEditClick}
|
||||
onClick={handleOnEditClick}
|
||||
>
|
||||
<SquarePen className={`h-8 w-8 ${isEditActive ? 'text-white' : ''}`} />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user