Create polished demo videos without editing skills. Mac/Windows/Linux
Overhaul editor shell and cursor behavior
webadderall23218983acc0
diff --git a/src/components/video-editor/ExportDialog.tsx b/src/components/video-editor/ExportDialog.tsxindex 2b39c2f8..0b92ca19 100644--- a/src/components/video-editor/ExportDialog.tsx+++ b/src/components/video-editor/ExportDialog.tsx@@ -29,8 +29,6 @@ interface ExportDialogProps {gifSizePreset?: GifSizePreset;onGifSizePresetChange?: (preset: GifSizePreset) => void;gifOutputDimensions?: { width: number; height: number };- onLoadProject?: () => void;- onSaveProject?: () => void;onStartExport?: () => void;}@@ -48,15 +46,13 @@ export function ExportDialog({exportQuality = 'good',onExportQualityChange,onExportFormatChange,- gifFrameRate = '10',+ gifFrameRate = 15,onGifFrameRateChange,gifLoop = true,onGifLoopChange,gifSizePreset = 'medium',onGifSizePresetChange,gifOutputDimensions = { width: 1280, height: 720 },- onLoadProject,- onSaveProject,onStartExport,}: ExportDialogProps) {const t = useScopedT('dialogs');@@ -175,8 +171,6 @@ export function ExportDialog({gifSizePreset={gifSizePreset}onGifSizePresetChange={onGifSizePresetChange}gifOutputDimensions={gifOutputDimensions}- onLoadProject={onLoadProject}- onSaveProject={onSaveProject}onExport={onStartExport}className="border-white/8 bg-[#121216] p-0 shadow-none"/>diff --git a/src/components/video-editor/ExportSettingsMenu.tsx b/src/components/video-editor/ExportSettingsMenu.tsxindex 93cdfc56..94de4331 100644--- a/src/components/video-editor/ExportSettingsMenu.tsx+++ b/src/components/video-editor/ExportSettingsMenu.tsx@@ -1,4 +1,4 @@-import { Download, Film, FolderOpen, Image, Save } from "lucide-react";+import { Download, Film, Image } from "lucide-react";import { LayoutGroup, motion } from "motion/react";import { Button } from "@/components/ui/button";import { Switch } from "@/components/ui/switch";@@ -24,8 +24,6 @@ interface ExportSettingsMenuProps {gifSizePreset: GifSizePreset;onGifSizePresetChange?: (preset: GifSizePreset) => void;gifOutputDimensions: { width: number; height: number };- onLoadProject?: () => void;- onSaveProject?: () => void;onExport?: () => void;className?: string;}@@ -42,8 +40,6 @@ export function ExportSettingsMenu({gifSizePreset,onGifSizePresetChange,gifOutputDimensions,- onLoadProject,- onSaveProject,onExport,className,}: ExportSettingsMenuProps) {@@ -53,7 +49,7 @@ export function ExportSettingsMenu({<div className={cn("w-full rounded-2xl border border-white/10 bg-[#17171a] p-3 text-slate-200", className)}><div className="mb-2 flex items-center justify-between"><span className="text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-400">- Export+ {tSettings("export.title", "Export")}</span></div>@@ -166,7 +162,11 @@ export function ExportSettingsMenu({<motion.span layoutId="header-gif-size-pill" className="absolute inset-0 rounded-lg bg-white" transition={{ type: "spring", stiffness: 420, damping: 34 }} />) : null}<span className={cn("relative z-10", isActive ? "text-black" : "text-slate-400 hover:text-slate-200")}>- {key === "original" ? "Orig" : key.charAt(0).toUpperCase() + key.slice(1, 3)}+ {key === "original"+ ? tSettings("export.sizePresetOriginalShort", "Orig")+ : key === "medium"+ ? tSettings("export.sizePresetMediumShort", "Med")+ : tSettings("export.sizePresetLargeShort", "Lar")}</span></button>);@@ -186,17 +186,6 @@ export function ExportSettingsMenu({</div>)}- <div className="mb-2 grid grid-cols-2 gap-2">- <Button type="button" variant="outline" onClick={onLoadProject} className="h-8 gap-1.5 border-white/10 bg-white/5 text-[10px] font-medium text-slate-300 hover:bg-white/10">- <FolderOpen className="h-3.5 w-3.5" />- {tSettings("export.loadProject")}- </Button>- <Button type="button" variant="outline" onClick={onSaveProject} className="h-8 gap-1.5 border-white/10 bg-white/5 text-[10px] font-medium text-slate-300 hover:bg-white/10">- <Save className="h-3.5 w-3.5" />- {tSettings("export.saveProject")}- </Button>- </div>-<Button type="button" size="lg" onClick={onExport} className="h-11 w-full gap-2 rounded-lg bg-[#2563EB] text-sm font-semibold text-white transition-colors duration-200 hover:bg-[#2563EB]/90"><Download className="h-4 w-4" />{tSettings("export.exportVideo", undefined, {diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsxindex c07d90de..8b404ad9 100644--- a/src/components/video-editor/SettingsPanel.tsx+++ b/src/components/video-editor/SettingsPanel.tsx@@ -1,6 +1,5 @@import { LayoutGroup } from "motion/react";import {- Crop,Palette,Trash2,Upload,@@ -17,9 +16,7 @@ import { BUILT_IN_WALLPAPERS, WALLPAPER_PATHS, WALLPAPER_RELATIVE_PATHS } from "import { type AspectRatio } from "@/utils/aspectRatioUtils";import { useI18n, useScopedT } from "../../contexts/I18nContext";import { AnnotationSettingsPanel } from "./AnnotationSettingsPanel";-import { CropControl } from "./CropControl";import { loadEditorPreferences, saveEditorPreferences } from "./editorPreferences";-import { KeyboardShortcutsHelp } from "./KeyboardShortcutsHelp";import { SliderControl } from "./SliderControl";import type {AnnotationRegion,@@ -35,7 +32,9 @@ import {DEFAULT_WEBCAM_REACT_TO_ZOOM,DEFAULT_WEBCAM_SHADOW,DEFAULT_WEBCAM_SIZE,+ DEFAULT_CROP_REGION,DEFAULT_CURSOR_CLICK_BOUNCE,+ DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,DEFAULT_CURSOR_MOTION_BLUR,DEFAULT_CURSOR_SIZE,DEFAULT_CURSOR_SMOOTHING,@@ -130,6 +129,8 @@ interface SettingsPanelProps {onCursorMotionBlurChange?: (amount: number) => void;cursorClickBounce?: number;onCursorClickBounceChange?: (amount: number) => void;+ cursorClickBounceDuration?: number;+ onCursorClickBounceDurationChange?: (duration: number) => void;cursorSway?: number;onCursorSwayChange?: (amount: number) => void;borderRadius?: number;@@ -144,7 +145,6 @@ interface SettingsPanelProps {onCropChange?: (region: CropRegion) => void;aspectRatio: AspectRatio;onAspectRatioChange?: (ratio: AspectRatio) => void;- videoElement?: HTMLVideoElement | null;selectedAnnotationId?: string | null;annotationRegions?: AnnotationRegion[];onAnnotationContentChange?: (id: string, content: string) => void;@@ -200,6 +200,8 @@ export function SettingsPanel({onCursorMotionBlurChange,cursorClickBounce = 1,onCursorClickBounceChange,+ cursorClickBounceDuration = DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,+ onCursorClickBounceDurationChange,cursorSway = DEFAULT_CURSOR_SWAY,onCursorSwayChange,borderRadius = 12.5,@@ -214,7 +216,6 @@ export function SettingsPanel({onCropChange,aspectRatio,onAspectRatioChange,- videoElement,selectedAnnotationId,annotationRegions = [],onAnnotationContentChange,@@ -288,8 +289,6 @@ export function SettingsPanel({const [backgroundTab, setBackgroundTab] = useState<BackgroundTab>(() =>getBackgroundTabForWallpaper(selected),);- const [showCropModal, setShowCropModal] = useState(false);- const cropSnapshotRef = useRef<CropRegion | null>(null);const customColorInputRef = useRef<HTMLInputElement | null>(null);const defaultWebcam = initialEditorPreferences.webcam;const [internalActiveEffectSection] = useState<EditorEffectSection>("scene");@@ -353,12 +352,47 @@ export function SettingsPanel({const wallpaperTileClass = (isSelected: boolean) =>cn(- "group relative aspect-square w-full overflow-hidden rounded-[10px] border transition-colors duration-150",+ "group relative aspect-square w-full overflow-hidden rounded-[10px] border bg-[#101115] transition-colors duration-150",isSelected? "border-[#2563EB] bg-white/8": "border-white/10 bg-white/[0.045] hover:border-white/20 hover:bg-white/[0.07]",);+ const renderWallpaperImageTile = (+ imageUrl: string,+ isSelected: boolean,+ props?: {+ key?: string;+ ariaLabel?: string;+ title?: string;+ onClick?: () => void;+ children?: React.ReactNode;+ },+ ) => (+ <div+ key={props?.key}+ className={wallpaperTileClass(isSelected)}+ aria-label={props?.ariaLabel}+ title={props?.title}+ onClick={props?.onClick}+ role="button"+ >+ <div className="absolute inset-[1px] overflow-hidden rounded-[8px] bg-[#0d0e11]">+ <img+ src={imageUrl}+ alt={+ props?.title ??+ props?.ariaLabel ??+ tSettings("background.wallpaperPreview", "Wallpaper preview")+ }+ className="h-full w-full select-none object-cover [transform:translateZ(0)]"+ draggable={false}+ />+ </div>+ {props?.children}+ </div>+ );+const zoomEnabled = Boolean(selectedZoomDepth);const trimEnabled = Boolean(selectedTrimId);@@ -374,20 +408,6 @@ export function SettingsPanel({}};- const handleCropToggle = () => {- if (!showCropModal && cropRegion) {- cropSnapshotRef.current = { ...cropRegion };- }- setShowCropModal(!showCropModal);- };-- const handleCropCancel = () => {- if (cropSnapshotRef.current && onCropChange) {- onCropChange(cropSnapshotRef.current);- }- setShowCropModal(false);- };-const crop = cropRegion ?? {x: 0,y: 0,@@ -445,6 +465,7 @@ export function SettingsPanel({onCursorSmoothingChange?.(initialEditorPreferences.cursorSmoothing);onCursorMotionBlurChange?.(initialEditorPreferences.cursorMotionBlur);onCursorClickBounceChange?.(initialEditorPreferences.cursorClickBounce);+ onCursorClickBounceDurationChange?.(DEFAULT_CURSOR_CLICK_BOUNCE_DURATION);onCursorSwayChange?.(initialEditorPreferences.cursorSway);};@@ -462,7 +483,7 @@ export function SettingsPanel({};const resetCropSection = () => {- onCropChange?.(initialEditorPreferences.cropRegion);+ onCropChange?.(DEFAULT_CROP_REGION);};const updateWebcam = (patch: Partial<WebcamOverlaySettings>) => {@@ -532,11 +553,11 @@ export function SettingsPanel({onClick={resetBackgroundSection}className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">- Reset+ {t("common.actions.reset", "Reset")}</button></div><SliderControl- label="Blur"+ label={tSettings("effects.backgroundBlur")}value={backgroundBlur}defaultValue={initialEditorPreferences.backgroundBlur}min={0}@@ -608,26 +629,18 @@ export function SettingsPanel({<div className="grid grid-cols-8 gap-1.5">{customImages.map((imageUrl, idx) => {const isSelected = getWallpaperTileState(imageUrl);- return (- <div- key={`custom-${idx}`}- className={wallpaperTileClass(isSelected)}- style={{- backgroundImage: `url(${imageUrl})`,- backgroundSize: "cover",- backgroundPosition: "center",- }}- onClick={() => onWallpaperChange(imageUrl)}- role="button"- >+ return renderWallpaperImageTile(imageUrl, isSelected, {+ key: `custom-${idx}`,+ onClick: () => onWallpaperChange(imageUrl),+ children: (<buttononClick={(e) => handleRemoveCustomImage(imageUrl, e)}className="absolute top-0.5 right-0.5 w-3 h-3 bg-red-500/90 hover:bg-red-500 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity z-10"><X className="w-2 h-2 text-white" /></button>- </div>- );+ ),+ });})}{(wallpaperPreviewPaths.length > 0@@ -637,21 +650,12 @@ export function SettingsPanel({const wallpaper = BUILT_IN_WALLPAPERS[index];const wallpaperValue = WALLPAPER_PATHS[index] ?? previewPath;const isSelected = getWallpaperTileState(wallpaperValue, previewPath);- return (- <div- key={wallpaperValue}- className={wallpaperTileClass(isSelected)}- aria-label={wallpaper?.label ?? `Wallpaper ${index + 1}`}- title={wallpaper?.label ?? `Wallpaper ${index + 1}`}- style={{- backgroundImage: `url(${previewPath})`,- backgroundSize: "cover",- backgroundPosition: "center",- }}- onClick={() => onWallpaperChange(wallpaperValue)}- role="button"- />- );+ return renderWallpaperImageTile(previewPath, isSelected, {+ key: wallpaperValue,+ ariaLabel: wallpaper?.label ?? `Wallpaper ${index + 1}`,+ title: wallpaper?.label ?? `Wallpaper ${index + 1}`,+ onClick: () => onWallpaperChange(wallpaperValue),+ });})}</div></div>@@ -774,11 +778,11 @@ export function SettingsPanel({onClick={resetZoomSection}className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">- Reset+ {t("common.actions.reset", "Reset")}</button></div><div className="flex items-center gap-2 text-[10px] text-slate-400">- <span>Connect</span>+ <span>{tSettings("effects.connectZooms")}</span><Switchchecked={connectZooms}onCheckedChange={onConnectZoomsChange}@@ -787,7 +791,7 @@ export function SettingsPanel({</div></div><SliderControl- label="Motion Blur"+ label={tSettings("effects.zoomMotionBlur")}value={zoomMotionBlur}defaultValue={DEFAULT_ZOOM_MOTION_BLUR}min={0}@@ -803,15 +807,15 @@ export function SettingsPanel({const frameSectionContent = (<section className="flex flex-col gap-2"><div className="flex items-center justify-between gap-3">- <SectionLabel>Frame</SectionLabel>- <button type="button" onClick={resetFrameSection} className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">Reset</button>+ <SectionLabel>{tSettings("sections.frame", "Frame")}</SectionLabel>+ <button type="button" onClick={resetFrameSection} className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">{t("common.actions.reset", "Reset")}</button></div><div className="flex flex-col gap-1.5">- <SliderControl label="Shadow" value={shadowIntensity} defaultValue={initialEditorPreferences.shadowIntensity} min={0} max={1} step={0.01} onChange={(v) => onShadowChange?.(v)} formatValue={(v) => `${Math.round(v * 100)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, "")) / 100} />- <SliderControl label="Radius" value={borderRadius} defaultValue={initialEditorPreferences.borderRadius} min={0} max={50} step={0.5} onChange={(v) => onBorderRadiusChange?.(v)} formatValue={(v) => `${v}px`} parseInput={(text) => parseFloat(text.replace(/px$/, ""))} />- <SliderControl label="Padding" value={padding} defaultValue={initialEditorPreferences.padding} min={0} max={100} step={1} onChange={(v) => onPaddingChange?.(v)} formatValue={(v) => `${v}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />+ <SliderControl label={tSettings("effects.shadow")} value={shadowIntensity} defaultValue={initialEditorPreferences.shadowIntensity} min={0} max={1} step={0.01} onChange={(v) => onShadowChange?.(v)} formatValue={(v) => `${Math.round(v * 100)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, "")) / 100} />+ <SliderControl label={tSettings("effects.radius", "Radius")} value={borderRadius} defaultValue={initialEditorPreferences.borderRadius} min={0} max={50} step={0.5} onChange={(v) => onBorderRadiusChange?.(v)} formatValue={(v) => `${v}px`} parseInput={(text) => parseFloat(text.replace(/px$/, ""))} />+ <SliderControl label={tSettings("effects.padding")} value={padding} defaultValue={initialEditorPreferences.padding} min={0} max={100} step={1} onChange={(v) => onPaddingChange?.(v)} formatValue={(v) => `${v}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} /><div className="flex items-center justify-between rounded-lg bg-white/[0.03] px-2.5 py-1.5">- <span className="text-[10px] text-slate-400">Remove Background</span>+ <span className="text-[10px] text-slate-400">{tSettings("effects.removeBackground")}</span><Switch checked={removeBackgroundEnabled} onCheckedChange={handleRemoveBackgroundToggle} className="data-[state=checked]:bg-[#2563EB] scale-75" /></div></div>@@ -821,16 +825,15 @@ export function SettingsPanel({const cropSectionContent = (<section className="flex flex-col gap-2"><div className="flex items-center justify-between gap-3">- <SectionLabel>Crop</SectionLabel>- {isCropped ? <button type="button" onClick={resetCropSection} className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">Reset</button> : null}+ <SectionLabel>{tSettings("sections.crop", "Crop")}</SectionLabel>+ {isCropped ? <button type="button" onClick={resetCropSection} className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">{t("common.actions.reset", "Reset")}</button> : null}</div><div className="flex flex-col gap-1.5">- <SliderControl label="Top" value={cropTop} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("top", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />- <SliderControl label="Bottom" value={cropBottom} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("bottom", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />- <SliderControl label="Left" value={cropLeft} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("left", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />- <SliderControl label="Right" value={cropRight} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("right", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />+ <SliderControl label={tSettings("crop.top", "Top")} value={cropTop} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("top", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />+ <SliderControl label={tSettings("crop.bottom", "Bottom")} value={cropBottom} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("bottom", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />+ <SliderControl label={tSettings("crop.left", "Left")} value={cropLeft} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("left", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />+ <SliderControl label={tSettings("crop.right", "Right")} value={cropRight} defaultValue={0} min={0} max={50} step={1} onChange={(v) => setCropInset("right", v)} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} /></div>- <Button onClick={handleCropToggle} variant="outline" className="w-full gap-1.5 bg-white/5 text-slate-200 border-white/10 hover:bg-white/10 hover:border-white/20 hover:text-white text-[10px] h-8 transition-all"><Crop className="w-3 h-3" />Open Crop Editor</Button></section>);@@ -853,18 +856,18 @@ export function SettingsPanel({<section className="flex flex-col gap-2"><div className="flex items-center justify-between gap-3"><div className="flex items-center gap-3">- <SectionLabel>Cursor</SectionLabel>+ <SectionLabel>{tSettings("sections.cursor", "Cursor")}</SectionLabel><buttontype="button"onClick={resetCursorSection}className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">- Reset+ {t("common.actions.reset", "Reset")}</button></div><div className="flex items-center gap-3"><label className="flex items-center gap-1.5 text-[10px] text-slate-400">- <span>Show</span>+ <span>{tSettings("effects.showCursor")}</span><Switchchecked={showCursor}onCheckedChange={onShowCursorChange}@@ -872,7 +875,7 @@ export function SettingsPanel({/></label><label className="flex items-center gap-1.5 text-[10px] text-slate-400">- <span>Loop</span>+ <span>{tSettings("effects.loopCursor")}</span><Switchchecked={loopCursor}onCheckedChange={onLoopCursorChange}@@ -882,19 +885,20 @@ export function SettingsPanel({</div></div><div className="flex flex-col gap-1.5">- <SliderControl label="Size" value={cursorSize} defaultValue={DEFAULT_CURSOR_SIZE} min={0.5} max={10} step={0.05} onChange={(v) => onCursorSizeChange?.(v)} formatValue={(v) => `${v.toFixed(2)}×`} parseInput={(text) => parseFloat(text.replace(/×$/, ""))} />- <SliderControl label="Smooth" value={cursorSmoothing} defaultValue={DEFAULT_CURSOR_SMOOTHING} min={0} max={2} step={0.01} onChange={(v) => onCursorSmoothingChange?.(v)} formatValue={(v) => (v <= 0 ? "Off" : v.toFixed(2))} parseInput={(text) => parseFloat(text)} />- <SliderControl label="Motion Blur" value={cursorMotionBlur} defaultValue={DEFAULT_CURSOR_MOTION_BLUR} min={0} max={2} step={0.05} onChange={(v) => onCursorMotionBlurChange?.(v)} formatValue={(v) => `${v.toFixed(2)}×`} parseInput={(text) => parseFloat(text.replace(/×$/, ""))} />- <SliderControl label="Bounce" value={cursorClickBounce} defaultValue={DEFAULT_CURSOR_CLICK_BOUNCE} min={0} max={5} step={0.05} onChange={(v) => onCursorClickBounceChange?.(v)} formatValue={(v) => `${v.toFixed(2)}×`} parseInput={(text) => parseFloat(text.replace(/×$/, ""))} />+ <SliderControl label={tSettings("effects.cursorSize")} value={cursorSize} defaultValue={DEFAULT_CURSOR_SIZE} min={0.5} max={10} step={0.05} onChange={(v) => onCursorSizeChange?.(v)} formatValue={(v) => `${v.toFixed(2)}×`} parseInput={(text) => parseFloat(text.replace(/×$/, ""))} />+ <SliderControl label={tSettings("effects.cursorSmoothing")} value={cursorSmoothing} defaultValue={DEFAULT_CURSOR_SMOOTHING} min={0} max={2} step={0.01} onChange={(v) => onCursorSmoothingChange?.(v)} formatValue={(v) => (v <= 0 ? tSettings("effects.off") : v.toFixed(2))} parseInput={(text) => parseFloat(text)} />+ <SliderControl label={tSettings("effects.cursorMotionBlur")} value={cursorMotionBlur} defaultValue={DEFAULT_CURSOR_MOTION_BLUR} min={0} max={2} step={0.05} onChange={(v) => onCursorMotionBlurChange?.(v)} formatValue={(v) => `${v.toFixed(2)}×`} parseInput={(text) => parseFloat(text.replace(/×$/, ""))} />+ <SliderControl label={tSettings("effects.cursorClickBounce")} value={cursorClickBounce} defaultValue={DEFAULT_CURSOR_CLICK_BOUNCE} min={0} max={5} step={0.05} onChange={(v) => onCursorClickBounceChange?.(v)} formatValue={(v) => `${v.toFixed(2)}×`} parseInput={(text) => parseFloat(text.replace(/×$/, ""))} />+ <SliderControl label={tSettings("effects.cursorClickBounceDuration", "Bounce Speed")} value={cursorClickBounceDuration} defaultValue={DEFAULT_CURSOR_CLICK_BOUNCE_DURATION} min={60} max={500} step={5} onChange={(v) => onCursorClickBounceDurationChange?.(v)} formatValue={(v) => `${Math.round(v)} ms`} parseInput={(text) => parseFloat(text.replace(/ms$/i, "").trim())} /><SliderControl- label="Sway"+ label={tSettings("effects.cursorSway")}value={toCursorSwaySliderValue(cursorSway)}defaultValue={toCursorSwaySliderValue(DEFAULT_CURSOR_SWAY)}min={0}max={toCursorSwaySliderValue(2)}step={toCursorSwaySliderValue(0.05)}onChange={(v) => onCursorSwayChange?.(fromCursorSwaySliderValue(v))}- formatValue={(v) => (v <= 0 ? "Off" : `${v.toFixed(2)}×`)}+ formatValue={(v) => (v <= 0 ? tSettings("effects.off") : `${v.toFixed(2)}×`)}parseInput={(text) => {const normalized = text.trim().toLowerCase();if (normalized === "off") return 0;@@ -908,24 +912,24 @@ export function SettingsPanel({return (<section className="flex flex-col gap-2"><div className="flex items-center justify-between gap-3">- <SectionLabel>Webcam</SectionLabel>- <button type="button" onClick={resetWebcamSection} className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">Reset</button>+ <SectionLabel>{tSettings("sections.webcam", "Webcam")}</SectionLabel>+ <button type="button" onClick={resetWebcamSection} className="text-[10px] text-[#2563EB] transition-opacity hover:opacity-80">{t("common.actions.reset", "Reset")}</button></div><div className="flex flex-col gap-1.5">- <div className="flex items-center justify-between rounded-lg bg-white/[0.03] px-2.5 py-1.5"><span className="text-[10px] text-slate-400">Show</span><Switch checked={webcam?.enabled ?? false} onCheckedChange={(enabled) => updateWebcam({ enabled })} className="data-[state=checked]:bg-[#2563EB] scale-75" /></div>- <div className="flex items-center justify-between rounded-lg bg-white/[0.03] px-2.5 py-1.5"><span className="text-[10px] text-slate-400">React To Zoom</span><Switch checked={webcam?.reactToZoom ?? DEFAULT_WEBCAM_REACT_TO_ZOOM} onCheckedChange={(reactToZoom) => updateWebcam({ reactToZoom })} className="data-[state=checked]:bg-[#2563EB] scale-75" /></div>- <SliderControl label="Size" value={webcam?.size ?? DEFAULT_WEBCAM_SIZE} defaultValue={DEFAULT_WEBCAM_SIZE} min={10} max={100} step={1} onChange={(v) => updateWebcam({ size: v })} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />- <SliderControl label="Roundness" value={webcam?.cornerRadius ?? DEFAULT_WEBCAM_CORNER_RADIUS} defaultValue={DEFAULT_WEBCAM_CORNER_RADIUS} min={0} max={80} step={1} onChange={(v) => updateWebcam({ cornerRadius: v })} formatValue={(v) => `${Math.round(v)}px`} parseInput={(text) => parseFloat(text.replace(/px$/, ""))} />- <SliderControl label="Shadow" value={webcam?.shadow ?? DEFAULT_WEBCAM_SHADOW} defaultValue={DEFAULT_WEBCAM_SHADOW} min={0} max={1} step={0.01} onChange={(v) => updateWebcam({ shadow: v })} formatValue={(v) => `${Math.round(v * 100)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, "")) / 100} />+ <div className="flex items-center justify-between rounded-lg bg-white/[0.03] px-2.5 py-1.5"><span className="text-[10px] text-slate-400">{tSettings("effects.show", "Show")}</span><Switch checked={webcam?.enabled ?? false} onCheckedChange={(enabled) => updateWebcam({ enabled })} className="data-[state=checked]:bg-[#2563EB] scale-75" /></div>+ <div className="flex items-center justify-between rounded-lg bg-white/[0.03] px-2.5 py-1.5"><span className="text-[10px] text-slate-400">{tSettings("effects.webcamReactToZoom")}</span><Switch checked={webcam?.reactToZoom ?? DEFAULT_WEBCAM_REACT_TO_ZOOM} onCheckedChange={(reactToZoom) => updateWebcam({ reactToZoom })} className="data-[state=checked]:bg-[#2563EB] scale-75" /></div>+ <SliderControl label={tSettings("effects.webcamSize")} value={webcam?.size ?? DEFAULT_WEBCAM_SIZE} defaultValue={DEFAULT_WEBCAM_SIZE} min={10} max={100} step={1} onChange={(v) => updateWebcam({ size: v })} formatValue={(v) => `${Math.round(v)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, ""))} />+ <SliderControl label={tSettings("effects.webcamRoundness")} value={webcam?.cornerRadius ?? DEFAULT_WEBCAM_CORNER_RADIUS} defaultValue={DEFAULT_WEBCAM_CORNER_RADIUS} min={0} max={80} step={1} onChange={(v) => updateWebcam({ cornerRadius: v })} formatValue={(v) => `${Math.round(v)}px`} parseInput={(text) => parseFloat(text.replace(/px$/, ""))} />+ <SliderControl label={tSettings("effects.webcamShadow")} value={webcam?.shadow ?? DEFAULT_WEBCAM_SHADOW} defaultValue={DEFAULT_WEBCAM_SHADOW} min={0} max={1} step={0.01} onChange={(v) => updateWebcam({ shadow: v })} formatValue={(v) => `${Math.round(v * 100)}%`} parseInput={(text) => parseFloat(text.replace(/%$/, "")) / 100} /><div className="rounded-lg bg-white/[0.03] px-2.5 py-2"><div className="flex items-center justify-between gap-2"><div>- <div className="text-[10px] text-slate-300">Footage</div>+ <div className="text-[10px] text-slate-300">{tSettings("effects.webcamFootage")}</div><div className="mt-0.5 text-[10px] text-slate-500">{webcamFileName ?? tSettings("effects.webcamFootageDescription")}</div></div><div className="flex items-center gap-1.5">- <Button type="button" variant="outline" onClick={onUploadWebcam} className="h-7 gap-1.5 border-white/10 bg-white/5 px-2 text-[10px] text-slate-200 hover:bg-white/10 hover:text-white"><Upload className="h-3 w-3" />{webcam?.sourcePath ? "Replace" : "Upload"}</Button>- {webcam?.sourcePath ? <Button type="button" variant="outline" onClick={onClearWebcam} className="h-7 gap-1.5 border-white/10 bg-white/5 px-2 text-[10px] text-slate-200 hover:bg-white/10 hover:text-white"><Trash2 className="h-3 w-3" />Remove</Button> : null}+ <Button type="button" variant="outline" onClick={onUploadWebcam} className="h-7 gap-1.5 border-white/10 bg-white/5 px-2 text-[10px] text-slate-200 hover:bg-white/10 hover:text-white"><Upload className="h-3 w-3" />{webcam?.sourcePath ? tSettings("effects.replaceWebcamFootage") : tSettings("effects.uploadWebcamFootage")}</Button>+ {webcam?.sourcePath ? <Button type="button" variant="outline" onClick={onClearWebcam} className="h-7 gap-1.5 border-white/10 bg-white/5 px-2 text-[10px] text-slate-200 hover:bg-white/10 hover:text-white"><Trash2 className="h-3 w-3" />{tSettings("effects.removeWebcamFootage")}</Button> : null}</div></div></div>@@ -951,46 +955,6 @@ export function SettingsPanel({</AnimatePresence></div>- {showCropModal && cropRegion && onCropChange && (- <>- <div- className="fixed inset-0 bg-black/80 backdrop-blur-sm z-50 animate-in fade-in duration-200"- onClick={handleCropCancel}- />- <div className="fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-[60] bg-[#09090b] rounded-2xl shadow-2xl border border-white/10 p-8 w-[90vw] max-w-5xl max-h-[90vh] overflow-auto animate-in zoom-in-95 duration-200">- <div className="flex items-center justify-between mb-6">- <div>- <span className="text-xl font-bold text-slate-200">{tSettings("crop.title")}</span>- <p className="text-sm text-slate-400 mt-2">{tSettings("crop.instruction")}</p>- </div>- <Button- variant="ghost"- size="icon"- onClick={handleCropCancel}- className="hover:bg-white/10 text-slate-400 hover:text-white"- >- <X className="w-5 h-5" />- </Button>- </div>- <CropControl- videoElement={videoElement || null}- cropRegion={cropRegion!}- onCropChange={onCropChange!}- aspectRatio={aspectRatio}- />- <div className="mt-6 flex justify-end">- <Button- onClick={() => setShowCropModal(false)}- size="lg"- className="bg-[#2563EB] hover:bg-[#2563EB]/90 text-white"- >- {t("common.actions.done")}- </Button>- </div>- </div>- </>- )}-<div className="flex-shrink-0 border-t border-white/10 bg-[#151518] p-4 pt-3"><div className="mb-4"><div className="mb-3 flex items-center justify-between">@@ -1001,7 +965,6 @@ export function SettingsPanel({{ZOOM_DEPTH_OPTIONS.find((o) => o.depth === selectedZoomDepth)?.label}</span>)}- <KeyboardShortcutsHelp /></div></div><div className="grid grid-cols-6 gap-1.5">diff --git a/src/components/video-editor/TutorialHelp.tsx b/src/components/video-editor/TutorialHelp.tsxindex 0b8cf343..94ad1b3c 100644--- a/src/components/video-editor/TutorialHelp.tsx+++ b/src/components/video-editor/TutorialHelp.tsx@@ -1,4 +1,5 @@-import { ArrowRight, HelpCircle, Scissors } from "lucide-react";+import { ArrowRight, ExternalLink, HelpCircle, Keyboard, MessageSquareMore, Scissors, Settings2, Twitter } from "lucide-react";+import { useEffect, useState } from "react";import { Button } from "@/components/ui/button";import {Dialog,@@ -9,16 +10,198 @@ import {DialogTrigger,} from "@/components/ui/dialog";import { useScopedT } from "@/contexts/I18nContext";+import { useShortcuts } from "@/contexts/ShortcutsContext";+import { formatBinding, SHORTCUT_ACTIONS, SHORTCUT_LABELS } from "@/lib/shortcuts";+import { formatShortcut } from "@/utils/platformUtils";+import { toast } from "sonner";++const RECORDLY_ISSUES_URL = "https://github.com/webadderall/Recordly/issues";+const RECORDLY_X_URL = "https://x.com/webadderall";+const CONTACT_EMAIL = "[email protected]";+export const APP_HEADER_ACTION_BUTTON_CLASS = "h-7 px-2 text-xs text-slate-400 hover:bg-white/10 hover:text-slate-200 transition-all gap-1.5";++async function openExternalLink(url: string, errorMessage: string) {+ try {+ const result = await window.electronAPI.openExternalUrl(url);+ if (!result.success) {+ toast.error(result.error || errorMessage);+ }+ } catch (error) {+ toast.error(`${errorMessage} ${String(error)}`);+ }+}++export function FeedbackDialog() {+ const t = useScopedT("editor");++ return (+ <Dialog>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className={APP_HEADER_ACTION_BUTTON_CLASS}+ >+ <MessageSquareMore className="h-3.5 w-3.5" />+ <span className="font-medium">{t("feedback.trigger", "Feedback")}</span>+ </Button>+ </DialogTrigger>+ <DialogContent className="max-w-lg bg-[#09090b] border-white/10 [&>button]:text-slate-400 [&>button:hover]:text-white">+ <DialogHeader>+ <DialogTitle className="text-xl font-semibold text-slate-200 flex items-center gap-2">+ <MessageSquareMore className="h-5 w-5 text-[#2563EB]" /> {t("feedback.title", "Feedback & contact")}+ </DialogTitle>+ <DialogDescription className="text-slate-400">+ {t("feedback.description", "Reach out directly or open an issue if something is broken or missing.")}+ </DialogDescription>+ </DialogHeader>+ <div className="mt-4 space-y-4">+ <div className="rounded-xl border border-white/10 bg-white/[0.03] p-4 space-y-3">+ <div className="flex items-center justify-between gap-3 rounded-lg border border-white/5 bg-white/5 px-3 py-3">+ <div>+ <p className="text-[11px] uppercase tracking-[0.18em] text-slate-500">+ {t("feedback.emailLabel", "Email")}+ </p>+ <p className="mt-1 text-sm font-medium text-slate-100">{CONTACT_EMAIL}</p>+ </div>+ <Button+ type="button"+ variant="outline"+ onClick={() => void openExternalLink(`mailto:${CONTACT_EMAIL}`, t("feedback.openFailed", "Failed to open link."))}+ className="border-white/10 bg-white/5 text-slate-200 hover:bg-white/10 hover:text-white"+ >+ <ExternalLink className="h-3.5 w-3.5" />+ </Button>+ </div>+ <div className="flex items-center justify-between gap-3 rounded-lg border border-white/5 bg-white/5 px-3 py-3">+ <div>+ <p className="text-[11px] uppercase tracking-[0.18em] text-slate-500">+ {t("feedback.xLabel", "X")}+ </p>+ <p className="mt-1 text-sm font-medium text-slate-100">@webadderall</p>+ </div>+ <Button+ type="button"+ variant="outline"+ onClick={() => void openExternalLink(RECORDLY_X_URL, t("feedback.openFailed", "Failed to open link."))}+ className="border-white/10 bg-white/5 text-slate-200 hover:bg-white/10 hover:text-white"+ >+ <Twitter className="h-3.5 w-3.5" />+ </Button>+ </div>+ </div>+ <Button+ type="button"+ variant="outline"+ onClick={() => void openExternalLink(RECORDLY_ISSUES_URL, t("feedback.openFailed", "Failed to open link."))}+ className="h-10 w-full justify-between border-white/10 bg-white/5 px-4 text-slate-200 hover:bg-white/10 hover:text-white"+ >+ <span className="flex items-center gap-2 text-sm font-medium">+ <MessageSquareMore className="h-4 w-4" />+ {t("feedback.reportIssue", "Report issue / send feedback")}+ </span>+ <ExternalLink className="h-3.5 w-3.5 text-slate-500" />+ </Button>+ </div>+ </DialogContent>+ </Dialog>+ );+}++export function KeyboardShortcutsDialog() {+ const { shortcuts, isMac, openConfig } = useShortcuts();+ const t = useScopedT("editor");+ const [scrollLabels, setScrollLabels] = useState({+ pan: "Shift + Ctrl + Scroll",+ zoom: "Ctrl + Scroll",+ });++ useEffect(() => {+ Promise.all([+ formatShortcut(["shift", "mod", "Scroll"]),+ formatShortcut(["mod", "Scroll"]),+ ]).then(([pan, zoom]) => setScrollLabels({ pan, zoom }));+ }, []);++ return (+ <Dialog>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className={APP_HEADER_ACTION_BUTTON_CLASS}+ >+ <Keyboard className="h-3.5 w-3.5" />+ <span className="font-medium">{t("keyboardShortcuts.trigger", "Shortcuts")}</span>+ </Button>+ </DialogTrigger>+ <DialogContent className="max-w-lg bg-[#09090b] border-white/10 [&>button]:text-slate-400 [&>button:hover]:text-white">+ <DialogHeader>+ <DialogTitle className="text-xl font-semibold text-slate-200 flex items-center gap-2">+ <Keyboard className="h-5 w-5 text-[#2563EB]" /> {t("keyboardShortcuts.title")}+ </DialogTitle>+ <DialogDescription className="text-slate-400">+ {t("keyboardShortcuts.description", "Quick reference for the timeline and editor controls.")}+ </DialogDescription>+ </DialogHeader>+ <div className="mt-4 space-y-4">+ <div className="rounded-xl border border-white/10 bg-white/[0.03] p-4 space-y-2 text-xs">+ {SHORTCUT_ACTIONS.map((action) => (+ <div key={action} className="flex items-center justify-between gap-3 rounded-lg border border-white/5 bg-white/5 px-3 py-2.5">+ <span className="text-slate-300">{SHORTCUT_LABELS[action]}</span>+ <kbd className="rounded border border-white/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">+ {formatBinding(shortcuts[action], isMac)}+ </kbd>+ </div>+ ))}+ <div className="grid grid-cols-1 gap-2 pt-2 sm:grid-cols-3">+ <div className="rounded-lg border border-white/5 bg-white/5 px-3 py-2.5">+ <p className="text-[11px] uppercase tracking-[0.18em] text-slate-500">{t("keyboardShortcuts.panTimeline")}</p>+ <kbd className="mt-2 inline-flex rounded border border-white/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">+ {scrollLabels.pan}+ </kbd>+ </div>+ <div className="rounded-lg border border-white/5 bg-white/5 px-3 py-2.5">+ <p className="text-[11px] uppercase tracking-[0.18em] text-slate-500">{t("keyboardShortcuts.zoomTimeline")}</p>+ <kbd className="mt-2 inline-flex rounded border border-white/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">+ {scrollLabels.zoom}+ </kbd>+ </div>+ <div className="rounded-lg border border-white/5 bg-white/5 px-3 py-2.5">+ <p className="text-[11px] uppercase tracking-[0.18em] text-slate-500">{t("keyboardShortcuts.cycleAnnotations")}</p>+ <kbd className="mt-2 inline-flex rounded border border-white/10 bg-black/20 px-2 py-1 font-mono text-[#2563EB]">+ {t("keyboardShortcuts.tab")}+ </kbd>+ </div>+ </div>+ </div>+ <div className="flex justify-end">+ <Button+ type="button"+ variant="outline"+ onClick={openConfig}+ className="border-white/10 bg-white/5 text-slate-200 hover:bg-white/10 hover:text-white"+ >+ <Settings2 className="h-4 w-4" />+ {t("keyboardShortcuts.customize")}+ </Button>+ </div>+ </div>+ </DialogContent>+ </Dialog>+ );+}export function TutorialHelp() {const t = useScopedT("editor");+return (<Dialog><DialogTrigger asChild><Buttonvariant="ghost"size="sm"- className="h-7 px-2 text-xs text-slate-400 hover:text-slate-200 hover:bg-white/10 transition-all gap-1.5"+ className={APP_HEADER_ACTION_BUTTON_CLASS}><HelpCircle className="w-3.5 h-3.5" /><span className="font-medium">{t("tutorial.howTrimmingWorks")}</span>diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsxindex 55095024..b98950c3 100644--- a/src/components/video-editor/VideoEditor.tsx+++ b/src/components/video-editor/VideoEditor.tsx@@ -1,10 +1,15 @@import type { Span } from "dnd-timeline";-import { Camera, Download, FolderOpen, Languages, MousePointer2, Save, Sparkles } from "lucide-react";+import { Camera, Download, FolderOpen, Languages, MousePointer2, Redo2, Save, Sparkles, Undo2, X } from "lucide-react";import { AnimatePresence, LayoutGroup, motion } from "motion/react";import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";import { toast } from "sonner";import { Button } from "@/components/ui/button";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";import { Toaster } from "@/components/ui/sonner";import { useI18n } from "@/contexts/I18nContext";import { useShortcuts } from "@/contexts/ShortcutsContext";@@ -26,9 +31,10 @@ import {import { matchesShortcut } from "@/lib/shortcuts";import { DEFAULT_WALLPAPER_RELATIVE_PATH } from "@/lib/wallpapers";import { type AspectRatio, getAspectRatioValue } from "@/utils/aspectRatioUtils";-import { ExportDialog } from "./ExportDialog";+import { ExportSettingsMenu } from "./ExportSettingsMenu";import { loadEditorPreferences, saveEditorPreferences } from "./editorPreferences";import PlaybackControls from "./PlaybackControls";+import { CropControl } from "./CropControl";import {createProjectData,deriveNextId,@@ -38,6 +44,7 @@ import {validateProjectData,} from "./projectPersistence";import { type EditorEffectSection, SettingsPanel } from "./SettingsPanel";+import { APP_HEADER_ACTION_BUTTON_CLASS, FeedbackDialog, KeyboardShortcutsDialog } from "./TutorialHelp";import TimelineEditor from "./timeline/TimelineEditor";import {detectInteractionCandidates,@@ -54,6 +61,7 @@ import {DEFAULT_ANNOTATION_STYLE,DEFAULT_FIGURE_DATA,DEFAULT_PLAYBACK_SPEED,+ DEFAULT_CROP_REGION,DEFAULT_WEBCAM_OVERLAY,DEFAULT_ZOOM_DEPTH,type FigureData,@@ -74,16 +82,6 @@ import { findDominantRegion } from "./videoPlayback/zoomRegionUtils";const LOOP_CURSOR_END_WINDOW_MS = 670;-const EDITOR_SECTION_BUTTONS: Array<{- id: EditorEffectSection;- label: string;- icon: React.ComponentType<{ className?: string }>;-}> = [- { id: "scene", label: "Scene", icon: Sparkles },- { id: "cursor", label: "Cursor", icon: MousePointer2 },- { id: "webcam", label: "Webcam", icon: Camera },-];-type EditorHistorySnapshot = {zoomRegions: ZoomRegion[];trimRegions: TrimRegion[];@@ -112,16 +110,18 @@ function LanguageSwitcher() {"zh-CN": "中文",};return (- <button+ <Buttontype="button"+ variant="ghost"+ size="sm"onClick={() => setLocale(next)}- className="inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-white/90 transition hover:bg-white/8 hover:text-white cursor-pointer"+ className={APP_HEADER_ACTION_BUTTON_CLASS}title={t("common.app.language", "Language")}aria-label={t("common.app.language", "Language")}><Languages className="h-4 w-4" />- <span className="text-xs font-normal">{labels[locale] ?? locale.toUpperCase()}</span>- </button>+ <span className="font-medium">{labels[locale] ?? locale.toUpperCase()}</span>+ </Button>);}@@ -151,10 +151,13 @@ export default function VideoEditor() {const [cursorClickBounce, setCursorClickBounce] = useState(initialEditorPreferences.cursorClickBounce,);+ const [cursorClickBounceDuration, setCursorClickBounceDuration] = useState(+ initialEditorPreferences.cursorClickBounceDuration,+ );const [cursorSway, setCursorSway] = useState(initialEditorPreferences.cursorSway);const [borderRadius, setBorderRadius] = useState(initialEditorPreferences.borderRadius);const [padding, setPadding] = useState(initialEditorPreferences.padding);- const [cropRegion, setCropRegion] = useState<CropRegion>(initialEditorPreferences.cropRegion);+ const [cropRegion, setCropRegion] = useState<CropRegion>(DEFAULT_CROP_REGION);const [webcam, setWebcam] = useState<WebcamOverlaySettings>(initialEditorPreferences.webcam ?? DEFAULT_WEBCAM_OVERLAY,);@@ -172,7 +175,7 @@ export default function VideoEditor() {const [isExporting, setIsExporting] = useState(false);const [exportProgress, setExportProgress] = useState<ExportProgress | null>(null);const [exportError, setExportError] = useState<string | null>(null);- const [showExportDialog, setShowExportDialog] = useState(false);+ const [showExportDropdown, setShowExportDropdown] = useState(false);const [previewVolume, setPreviewVolume] = useState(1);const [aspectRatio, setAspectRatio] = useState<AspectRatio>(initialEditorPreferences.aspectRatio);const [activeEffectSection, setActiveEffectSection] = useState<EditorEffectSection>("scene");@@ -192,6 +195,7 @@ export default function VideoEditor() {const [exportedFilePath, setExportedFilePath] = useState<string | undefined>(undefined);const [hasPendingExportSave, setHasPendingExportSave] = useState(false);const [lastSavedSnapshot, setLastSavedSnapshot] = useState<string | null>(null);+ const [showCropModal, setShowCropModal] = useState(false);const videoPlaybackRef = useRef<VideoPlaybackRef>(null);const nextZoomIdRef = useRef(1);@@ -209,6 +213,17 @@ export default function VideoEditor() {const historyCurrentRef = useRef<EditorHistorySnapshot | null>(null);const applyingHistoryRef = useRef(false);const pendingExportSaveRef = useRef<PendingExportSave | null>(null);+ const cropSnapshotRef = useRef<CropRegion | null>(null);+ const [historyVersion, setHistoryVersion] = useState(0);++ const syncHistoryButtons = useCallback(() => {+ setHistoryVersion((version) => version + 1);+ }, []);++ const canUndo = historyPastRef.current.length > 0;+ const canRedo = historyFutureRef.current.length > 0;++ void historyVersion;const cloneSnapshot = useCallback((snapshot: EditorHistorySnapshot): EditorHistorySnapshot => {return {@@ -239,8 +254,56 @@ export default function VideoEditor() {const projectDisplayName = useMemo(() => {const fileName = currentProjectPath?.split(/[\\/]/).pop() ?? "";const withoutExtension = fileName.replace(/\.recordly$/i, "").replace(/\.[^.]+$/, "");- return withoutExtension || "Untitled";- }, [currentProjectPath]);+ return withoutExtension || t("editor.project.untitled", "Untitled");+ }, [currentProjectPath, t]);++ const editorSectionButtons = useMemo(+ () => [+ { id: "scene" as const, label: t("settings.sections.scene", "Scene"), icon: Sparkles },+ { id: "cursor" as const, label: t("settings.sections.cursor", "Cursor"), icon: MousePointer2 },+ { id: "webcam" as const, label: t("settings.sections.webcam", "Webcam"), icon: Camera },+ ],+ [t],+ );++ const buildPersistedEditorState = useCallback(+ (+ editor: Partial<{+ wallpaper: string;+ shadowIntensity: number;+ backgroundBlur: number;+ zoomMotionBlur: number;+ connectZooms: boolean;+ showCursor: boolean;+ loopCursor: boolean;+ cursorSize: number;+ cursorSmoothing: number;+ cursorMotionBlur: number;+ cursorClickBounce: number;+ cursorClickBounceDuration: number;+ cursorSway: number;+ borderRadius: number;+ padding: number;+ cropRegion: CropRegion;+ webcam: WebcamOverlaySettings;+ zoomRegions: ZoomRegion[];+ trimRegions: TrimRegion[];+ speedRegions: SpeedRegion[];+ annotationRegions: AnnotationRegion[];+ audioRegions: AudioRegion[];+ aspectRatio: AspectRatio;+ exportQuality: ExportQuality;+ exportFormat: ExportFormat;+ gifFrameRate: GifFrameRate;+ gifLoop: boolean;+ gifSizePreset: GifSizePreset;+ }>,+ ) => {+ const { cropRegion: _cropRegion, ...persistedEditor } = editor;+ return persistedEditor;+ },+ [],+ );const buildHistorySnapshot = useCallback((): EditorHistorySnapshot => {return {@@ -319,7 +382,8 @@ export default function VideoEditor() {historyFutureRef.current.push(cloneSnapshot(current));historyCurrentRef.current = cloneSnapshot(previous);applyHistorySnapshot(previous);- }, [applyHistorySnapshot, buildHistorySnapshot, cloneSnapshot]);+ syncHistoryButtons();+ }, [applyHistorySnapshot, buildHistorySnapshot, cloneSnapshot, syncHistoryButtons]);const handleRedo = useCallback(() => {if (historyFutureRef.current.length === 0) return;@@ -331,7 +395,8 @@ export default function VideoEditor() {historyPastRef.current.push(cloneSnapshot(current));historyCurrentRef.current = cloneSnapshot(next);applyHistorySnapshot(next);- }, [applyHistorySnapshot, buildHistorySnapshot, cloneSnapshot]);+ syncHistoryButtons();+ }, [applyHistorySnapshot, buildHistorySnapshot, cloneSnapshot, syncHistoryButtons]);const applyLoadedProject = useCallback(async (candidate: unknown, path?: string | null) => {if (!validateProjectData(candidate)) {@@ -367,10 +432,11 @@ export default function VideoEditor() {setCursorSmoothing(normalizedEditor.cursorSmoothing);setCursorMotionBlur(normalizedEditor.cursorMotionBlur);setCursorClickBounce(normalizedEditor.cursorClickBounce);+ setCursorClickBounceDuration(normalizedEditor.cursorClickBounceDuration);setCursorSway(normalizedEditor.cursorSway);setBorderRadius(normalizedEditor.borderRadius);setPadding(normalizedEditor.padding);- setCropRegion(normalizedEditor.cropRegion);+ setCropRegion(DEFAULT_CROP_REGION);setWebcam(normalizedEditor.webcam);setZoomRegions(normalizedEditor.zoomRegions);setTrimRegions(normalizedEditor.trimRegions);@@ -414,9 +480,17 @@ export default function VideoEditor() {normalizedEditor.annotationRegions.reduce((max, region) => Math.max(max, region.zIndex), 0) +1;- setLastSavedSnapshot(JSON.stringify(createProjectData(sourcePath, normalizedEditor)));+ historyPastRef.current = [];+ historyFutureRef.current = [];+ historyCurrentRef.current = null;+ applyingHistoryRef.current = false;+ syncHistoryButtons();++ setLastSavedSnapshot(+ JSON.stringify(createProjectData(sourcePath, buildPersistedEditorState(normalizedEditor))),+ );return true;- }, []);+ }, [buildPersistedEditorState, syncHistoryButtons]);const currentProjectSnapshot = useMemo(() => {const sourcePath = videoSourcePath ?? (videoPath ? fromFileUrl(videoPath) : null);@@ -424,39 +498,44 @@ export default function VideoEditor() {return null;}return JSON.stringify(- createProjectData(sourcePath, {- wallpaper,- shadowIntensity,- backgroundBlur,- zoomMotionBlur,- connectZooms,- showCursor,- loopCursor,- cursorSize,- cursorSmoothing,- cursorMotionBlur,- cursorClickBounce,- cursorSway,- borderRadius,- padding,- cropRegion,- webcam,- zoomRegions,- trimRegions,- speedRegions,- annotationRegions,- audioRegions,- aspectRatio,- exportQuality,- exportFormat,- gifFrameRate,- gifLoop,- gifSizePreset,- }),+ createProjectData(+ sourcePath,+ buildPersistedEditorState({+ wallpaper,+ shadowIntensity,+ backgroundBlur,+ zoomMotionBlur,+ connectZooms,+ showCursor,+ loopCursor,+ cursorSize,+ cursorSmoothing,+ cursorMotionBlur,+ cursorClickBounce,+ cursorClickBounceDuration,+ cursorSway,+ borderRadius,+ padding,+ cropRegion,+ webcam,+ zoomRegions,+ trimRegions,+ speedRegions,+ annotationRegions,+ audioRegions,+ aspectRatio,+ exportQuality,+ exportFormat,+ gifFrameRate,+ gifLoop,+ gifSizePreset,+ }),+ ),);}, [videoPath,videoSourcePath,+ buildPersistedEditorState,wallpaper,shadowIntensity,backgroundBlur,@@ -468,6 +547,7 @@ export default function VideoEditor() {cursorSmoothing,cursorMotionBlur,cursorClickBounce,+ cursorClickBounceDuration,cursorSway,borderRadius,padding,@@ -484,6 +564,7 @@ export default function VideoEditor() {gifFrameRate,gifLoop,gifSizePreset,+ buildPersistedEditorState,]);const syncRecordingSessionWebcam = useCallback(@@ -533,12 +614,14 @@ export default function VideoEditor() {if (!historyCurrentRef.current) {historyCurrentRef.current = snapshot;+ syncHistoryButtons();return;}if (applyingHistoryRef.current) {historyCurrentRef.current = snapshot;applyingHistoryRef.current = false;+ syncHistoryButtons();return;}@@ -554,7 +637,8 @@ export default function VideoEditor() {}historyCurrentRef.current = snapshot;historyFutureRef.current = [];- }, [buildHistorySnapshot, cloneSnapshot]);+ syncHistoryButtons();+ }, [buildHistorySnapshot, cloneSnapshot, syncHistoryButtons]);const hasUnsavedChanges = Boolean(currentProjectPath &&@@ -630,10 +714,10 @@ export default function VideoEditor() {cursorSmoothing,cursorMotionBlur,cursorClickBounce,+ cursorClickBounceDuration,cursorSway,borderRadius,padding,- cropRegion,webcam,aspectRatio,exportQuality,@@ -654,10 +738,10 @@ export default function VideoEditor() {cursorSmoothing,cursorMotionBlur,cursorClickBounce,+ cursorClickBounceDuration,cursorSway,borderRadius,padding,- cropRegion,webcam,aspectRatio,exportQuality,@@ -680,35 +764,39 @@ export default function VideoEditor() {return;}- const projectData = createProjectData(sourcePath, {- wallpaper,- shadowIntensity,- backgroundBlur,- zoomMotionBlur,- connectZooms,- showCursor,- loopCursor,- cursorSize,- cursorSmoothing,- cursorMotionBlur,- cursorClickBounce,- cursorSway,- borderRadius,- padding,- cropRegion,- webcam,- zoomRegions,- trimRegions,- speedRegions,- annotationRegions,- audioRegions,- aspectRatio,- exportQuality,- exportFormat,- gifFrameRate,- gifLoop,- gifSizePreset,- });+ const projectData = createProjectData(+ sourcePath,+ buildPersistedEditorState({+ wallpaper,+ shadowIntensity,+ backgroundBlur,+ zoomMotionBlur,+ connectZooms,+ showCursor,+ loopCursor,+ cursorSize,+ cursorSmoothing,+ cursorMotionBlur,+ cursorClickBounce,+ cursorClickBounceDuration,+ cursorSway,+ borderRadius,+ padding,+ cropRegion,+ webcam,+ zoomRegions,+ trimRegions,+ speedRegions,+ annotationRegions,+ audioRegions,+ aspectRatio,+ exportQuality,+ exportFormat,+ gifFrameRate,+ gifLoop,+ gifSizePreset,+ }),+ );const fileNameBase =sourcePath@@ -754,6 +842,7 @@ export default function VideoEditor() {cursorSmoothing,cursorMotionBlur,cursorClickBounce,+ cursorClickBounceDuration,cursorSway,borderRadius,padding,@@ -770,6 +859,7 @@ export default function VideoEditor() {gifFrameRate,gifLoop,gifSizePreset,+ buildPersistedEditorState,],);@@ -1687,6 +1777,7 @@ export default function VideoEditor() {cursorSmoothing,cursorMotionBlur,cursorClickBounce,+ cursorClickBounceDuration,cursorSway,previewWidth,previewHeight,@@ -1833,6 +1924,7 @@ export default function VideoEditor() {cursorSmoothing,cursorMotionBlur,cursorClickBounce,+ cursorClickBounceDuration,cursorSway,audioRegions,previewWidth,@@ -1890,7 +1982,7 @@ export default function VideoEditor() {}setIsExporting(false);exporterRef.current = null;- setShowExportDialog(keepExportDialogOpen);+ setShowExportDropdown(keepExportDialogOpen);setExportProgress(null);}},@@ -1924,18 +2016,18 @@ export default function VideoEditor() {],);- const handleOpenExportDialog = useCallback(() => {+ const handleOpenExportDropdown = useCallback(() => {if (!videoPath) {toast.error("No video loaded");return;}if (hasPendingExportSave) {- setShowExportDialog(true);+ setShowExportDropdown(true);setExportError("Save dialog canceled. Click Save Again to save without re-rendering.");return;}- setShowExportDialog(true);+ setShowExportDropdown(true);setExportProgress(null);setExportError(null);}, [@@ -1943,7 +2035,7 @@ export default function VideoEditor() {hasPendingExportSave,]);- const handleStartExportFromDialog = useCallback(() => {+ const handleStartExportFromDropdown = useCallback(() => {const video = videoPlaybackRef.current?.video;if (!videoPath) {toast.error("No video loaded");@@ -1979,6 +2071,8 @@ export default function VideoEditor() {};setExportError(null);+ setExportedFilePath(undefined);+ setShowExportDropdown(true);handleExport(settings);}, [videoPath, exportFormat, exportQuality, gifFrameRate, gifLoop, gifSizePreset, handleExport]);@@ -1986,7 +2080,7 @@ export default function VideoEditor() {if (exporterRef.current) {exporterRef.current.cancel();toast.info("Export canceled");- setShowExportDialog(false);+ setShowExportDropdown(false);setIsExporting(false);setExportProgress(null);setExportError(null);@@ -1994,8 +2088,8 @@ export default function VideoEditor() {}}, []);- const handleExportDialogClose = useCallback(() => {- setShowExportDialog(false);+ const handleExportDropdownClose = useCallback(() => {+ setShowExportDropdown(false);setExportProgress(null);setExportError(null);setExportedFilePath(undefined);@@ -2024,7 +2118,7 @@ export default function VideoEditor() {setExportError(null);setExportedFilePath(saveResult.path);showExportSuccessToast(saveResult.path);- setShowExportDialog(false);+ setShowExportDropdown(true);return;}@@ -2033,6 +2127,30 @@ export default function VideoEditor() {toast.error(errorMessage);}, [showExportSuccessToast]);+ const handleOpenCropEditor = useCallback(() => {+ cropSnapshotRef.current = { ...cropRegion };+ setShowCropModal(true);+ }, [cropRegion]);++ const handleCloseCropEditor = useCallback(() => {+ setShowCropModal(false);+ }, []);++ const handleCancelCropEditor = useCallback(() => {+ if (cropSnapshotRef.current) {+ setCropRegion(cropSnapshotRef.current);+ }+ setShowCropModal(false);+ }, []);++ const isCropped = useMemo(() => {+ const top = Math.round(cropRegion.y * 100);+ const left = Math.round(cropRegion.x * 100);+ const bottom = Math.round((1 - cropRegion.y - cropRegion.height) * 100);+ const right = Math.round((1 - cropRegion.x - cropRegion.width) * 100);+ return top > 0 || left > 0 || bottom > 0 || right > 0;+ }, [cropRegion]);+const openRecordingsFolder = useCallback(async () => {try {const result = await window.electronAPI.openRecordingsFolder();@@ -2044,6 +2162,19 @@ export default function VideoEditor() {}}, []);+ const revealExportedFile = useCallback(async () => {+ if (!exportedFilePath) return;++ try {+ const result = await window.electronAPI.revealInFolder(exportedFilePath);+ if (!result.success) {+ toast.error(result.error || result.message || "Failed to reveal item in folder.");+ }+ } catch (error) {+ toast.error(`Failed to reveal item in folder: ${String(error)}`);+ }+ }, [exportedFilePath]);+if (loading) {return (<div className="flex items-center justify-center h-screen bg-background">@@ -2074,7 +2205,7 @@ export default function VideoEditor() {className="relative h-11 flex-shrink-0 bg-[#151518]/88 backdrop-blur-md border-b border-white/10 flex items-center justify-center px-8 z-50"style={{ WebkitAppRegion: "drag" } as React.CSSProperties}>- <div className="flex items-baseline gap-1.5">+ <div className="flex items-baseline gap-0"><span className="text-sm font-semibold tracking-tight text-white/90">{projectDisplayName}</span><span className="text-xs font-medium tracking-tight text-slate-500">.recordly</span></div>@@ -2082,45 +2213,141 @@ export default function VideoEditor() {className="absolute left-[88px] flex items-center gap-2"style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}>+ <LanguageSwitcher /><Buttontype="button"- onClick={handleLoadProject}- className="inline-flex h-8 min-w-[96px] items-center justify-center gap-1.5 rounded-lg bg-white px-4 text-black transition-colors hover:bg-white/92"+ variant="ghost"+ size="sm"+ onClick={() => void openRecordingsFolder()}+ className={`${APP_HEADER_ACTION_BUTTON_CLASS} px-2.5`}+ title={t("common.app.manageRecordings", "Open recordings folder")}+ aria-label={t("common.app.manageRecordings", "Open recordings folder")}><FolderOpen className="h-4 w-4" />- <span className="text-sm font-semibold tracking-tight">Load</span>- </Button>- <Button- type="button"- onClick={handleSaveProject}- className="inline-flex h-8 min-w-[96px] items-center justify-center gap-1.5 rounded-lg bg-white px-4 text-black transition-colors hover:bg-white/92"- >- <Save className="h-4 w-4" />- <span className="text-sm font-semibold tracking-tight">Save</span></Button>+ <KeyboardShortcutsDialog />+ <FeedbackDialog />+ <div className="ml-1 h-5 w-px bg-white/10" /></div><divclassName="absolute right-5 flex items-center gap-2 pr-3"style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}>- <LanguageSwitcher />- <button+ <Buttontype="button"- onClick={() => void openRecordingsFolder()}- className="inline-flex h-7 items-center justify-center rounded-md px-2 text-white/90 transition hover:bg-white/8 hover:text-white cursor-pointer"- title={t("common.app.manageRecordings", "Open recordings folder")}- aria-label={t("common.app.manageRecordings", "Open recordings folder")}+ variant="ghost"+ onClick={handleUndo}+ disabled={!canUndo}+ className="inline-flex h-8 w-8 items-center justify-center rounded-[5px] border border-white/10 bg-white/5 p-0 text-slate-200 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-40"+ title={t("common.actions.undo", "Undo")}+ aria-label={t("common.actions.undo", "Undo")}+ >+ <Undo2 className="h-4 w-4" />+ </Button>+ <Button+ type="button"+ variant="ghost"+ onClick={handleRedo}+ disabled={!canRedo}+ className="inline-flex h-8 w-8 items-center justify-center rounded-[5px] border border-white/10 bg-white/5 p-0 text-slate-200 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-40"+ title={t("common.actions.redo", "Redo")}+ aria-label={t("common.actions.redo", "Redo")}+ >+ <Redo2 className="h-4 w-4" />+ </Button>+ <div className="mx-1 h-5 w-px bg-white/10" />+ <Button+ type="button"+ onClick={handleLoadProject}+ className="inline-flex h-8 min-w-[96px] items-center justify-center gap-1.5 rounded-[5px] bg-white px-4 text-black transition-colors hover:bg-white/92"><FolderOpen className="h-4 w-4" />- </button>+ <span className="text-sm font-semibold tracking-tight">{t("common.actions.load", "Load")}</span>+ </Button><Buttontype="button"- onClick={handleOpenExportDialog}- className="inline-flex h-8 min-w-[112px] items-center justify-center gap-2 rounded-lg bg-[#2563EB] px-4.5 text-white transition-colors hover:bg-[#2563EB]/92"+ onClick={handleSaveProject}+ className="inline-flex h-8 min-w-[96px] items-center justify-center gap-1.5 rounded-[5px] bg-white px-4 text-black transition-colors hover:bg-white/92">- <Download className="h-4 w-4" />- <span className="text-sm font-semibold tracking-tight">Export</span>+ <Save className="h-4 w-4" />+ <span className="text-sm font-semibold tracking-tight">{t("common.actions.save")}</span></Button>+ <div className="mx-1 h-5 w-px bg-white/10" />+ <DropdownMenu open={showExportDropdown} onOpenChange={setShowExportDropdown} modal={false}>+ <DropdownMenuTrigger asChild>+ <Button+ type="button"+ onClick={handleOpenExportDropdown}+ className="inline-flex h-8 min-w-[112px] items-center justify-center gap-2 rounded-[5px] bg-[#2563EB] px-4.5 text-white transition-colors hover:bg-[#2563EB]/92"+ >+ <Download className="h-4 w-4" />+ <span className="text-sm font-semibold tracking-tight">{t("common.actions.export", "Export")}</span>+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent+ align="end"+ sideOffset={10}+ className="w-[360px] border-none bg-transparent p-0 shadow-none"+ >+ {isExporting ? (+ <div className="rounded-2xl border border-white/10 bg-[#17171a] p-4 text-slate-200 shadow-2xl">+ <div className="mb-3 flex items-center justify-between gap-3">+ <div>+ <p className="text-sm font-semibold text-white">{t("editor.exportStatus.exporting", "Exporting")}</p>+ <p className="text-xs text-slate-400">{t("editor.exportStatus.renderingFile", "Rendering your file.")}</p>+ </div>+ <Button type="button" variant="outline" onClick={handleCancelExport} className="h-8 border-red-500/20 bg-red-500/10 px-3 text-xs text-red-400 hover:bg-red-500/20">{t("common.actions.cancel")}</Button>+ </div>+ <div className="h-2 overflow-hidden rounded-full border border-white/5 bg-white/5">+ <div+ className="h-full bg-[#2563EB] transition-all duration-300 ease-out"+ style={{ width: `${Math.min(exportProgress?.percentage ?? 8, 100)}%` }}+ />+ </div>+ <p className="mt-2 text-xs text-slate-400">+ {exportProgress ? t("editor.exportStatus.completePercent", "{{percent}}% complete", { percent: Math.round(exportProgress.percentage) }) : t("editor.exportStatus.preparing", "Preparing export...")}+ </p>+ </div>+ ) : exportError ? (+ <div className="rounded-2xl border border-white/10 bg-[#17171a] p-4 text-slate-200 shadow-2xl">+ <p className="text-sm font-semibold text-white">{t("editor.exportStatus.issue", "Export issue")}</p>+ <p className="mt-1 text-xs leading-relaxed text-slate-400">{exportError}</p>+ <div className="mt-4 flex gap-2">+ {hasPendingExportSave ? (+ <Button type="button" onClick={handleRetrySaveExport} className="h-8 flex-1 rounded-[5px] bg-[#2563EB] text-xs font-semibold text-white hover:bg-[#2563EB]/92">{t("editor.actions.saveAgain", "Save Again")}</Button>+ ) : null}+ <Button type="button" variant="outline" onClick={handleExportDropdownClose} className="h-8 flex-1 border-white/10 bg-white/5 text-xs text-slate-300 hover:bg-white/10">{t("common.actions.close", "Close")}</Button>+ </div>+ </div>+ ) : exportedFilePath ? (+ <div className="rounded-2xl border border-white/10 bg-[#17171a] p-4 text-slate-200 shadow-2xl">+ <p className="text-sm font-semibold text-white">{t("editor.exportStatus.complete", "Export complete")}</p>+ <p className="mt-1 text-xs text-slate-400">{t("editor.exportStatus.savedSuccessfully", "Your file was saved successfully.")}</p>+ <p className="mt-3 truncate text-xs text-slate-500">{exportedFilePath.split("/").pop()}</p>+ <div className="mt-4 flex gap-2">+ <Button type="button" onClick={revealExportedFile} className="h-8 flex-1 rounded-[5px] bg-[#2563EB] text-xs font-semibold text-white hover:bg-[#2563EB]/92">{t("editor.actions.showInFolder", "Show In Folder")}</Button>+ <Button type="button" variant="outline" onClick={handleExportDropdownClose} className="h-8 flex-1 border-white/10 bg-white/5 text-xs text-slate-300 hover:bg-white/10">Done</Button>+ </div>+ </div>+ ) : (+ <ExportSettingsMenu+ exportFormat={exportFormat}+ onExportFormatChange={setExportFormat}+ exportQuality={exportQuality}+ onExportQualityChange={setExportQuality}+ gifFrameRate={gifFrameRate}+ onGifFrameRateChange={setGifFrameRate}+ gifLoop={gifLoop}+ onGifLoopChange={setGifLoop}+ gifSizePreset={gifSizePreset}+ onGifSizePresetChange={setGifSizePreset}+ gifOutputDimensions={gifOutputDimensions}+ onExport={handleStartExportFromDropdown}+ className="shadow-2xl"+ />+ )}+ </DropdownMenuContent>+ </DropdownMenu></div></div>@@ -2139,7 +2366,7 @@ export default function VideoEditor() {<div className="flex w-11 flex-shrink-0 items-center justify-center pl-1"><LayoutGroup id="preview-icon-rail"><div className="flex flex-col items-center gap-3">- {EDITOR_SECTION_BUTTONS.map((section) => {+ {editorSectionButtons.map((section) => {const Icon = section.icon;const isActive = activeEffectSection === section.id;return (@@ -2233,6 +2460,7 @@ export default function VideoEditor() {cursorSmoothing={cursorSmoothing}cursorMotionBlur={cursorMotionBlur}cursorClickBounce={cursorClickBounce}+ cursorClickBounceDuration={cursorClickBounceDuration}cursorSway={cursorSway}volume={previewVolume}/>@@ -2309,6 +2537,8 @@ export default function VideoEditor() {onSelectAnnotation={handleSelectAnnotation}aspectRatio={aspectRatio}onAspectRatioChange={setAspectRatio}+ onOpenCropEditor={handleOpenCropEditor}+ isCropped={isCropped}/></div></Panel>@@ -2350,6 +2580,8 @@ export default function VideoEditor() {onCursorMotionBlurChange={setCursorMotionBlur}cursorClickBounce={cursorClickBounce}onCursorClickBounceChange={setCursorClickBounce}+ cursorClickBounceDuration={cursorClickBounceDuration}+ onCursorClickBounceDurationChange={setCursorClickBounceDuration}cursorSway={cursorSway}onCursorSwayChange={setCursorSway}borderRadius={borderRadius}@@ -2364,7 +2596,6 @@ export default function VideoEditor() {onCropChange={setCropRegion}aspectRatio={aspectRatio}onAspectRatioChange={setAspectRatio}- videoElement={videoPlaybackRef.current?.video || null}selectedAnnotationId={selectedAnnotationId}annotationRegions={annotationRegions}onAnnotationContentChange={handleAnnotationContentChange}@@ -2384,33 +2615,48 @@ export default function VideoEditor() {</div></div>+ {showCropModal ? (+ <>+ <div+ className="fixed inset-0 z-50 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200"+ onClick={handleCancelCropEditor}+ />+ <div className="fixed left-1/2 top-1/2 z-[60] max-h-[90vh] w-[90vw] max-w-5xl -translate-x-1/2 -translate-y-1/2 overflow-auto rounded-2xl border border-white/10 bg-[#09090b] p-8 shadow-2xl animate-in zoom-in-95 duration-200">+ <div className="mb-6 flex items-center justify-between">+ <div>+ <span className="text-xl font-bold text-slate-200">{t("settings.crop.title")}</span>+ <p className="mt-2 text-sm text-slate-400">{t("settings.crop.instruction")}</p>+ </div>+ <Button+ variant="ghost"+ size="icon"+ onClick={handleCancelCropEditor}+ className="text-slate-400 hover:bg-white/10 hover:text-white"+ >+ <X className="h-5 w-5" />+ </Button>+ </div>+ <CropControl+ videoElement={videoPlaybackRef.current?.video || null}+ cropRegion={cropRegion}+ onCropChange={setCropRegion}+ aspectRatio={aspectRatio}+ />+ <div className="mt-6 flex justify-end">+ <Button+ onClick={handleCloseCropEditor}+ size="lg"+ className="bg-[#2563EB] text-white hover:bg-[#2563EB]/90"+ >+ {t("common.actions.done")}+ </Button>+ </div>+ </div>+ </>+ ) : null}+<Toaster theme="dark" className="pointer-events-auto" />- <ExportDialog- isOpen={showExportDialog}- onClose={handleExportDialogClose}- progress={exportProgress}- isExporting={isExporting}- error={exportError}- onCancel={handleCancelExport}- onRetrySave={handleRetrySaveExport}- canRetrySave={hasPendingExportSave}- exportFormat={exportFormat}- exportedFilePath={exportedFilePath}- exportQuality={exportQuality}- onExportQualityChange={setExportQuality}- onExportFormatChange={setExportFormat}- gifFrameRate={gifFrameRate}- onGifFrameRateChange={setGifFrameRate}- gifLoop={gifLoop}- onGifLoopChange={setGifLoop}- gifSizePreset={gifSizePreset}- onGifSizePresetChange={setGifSizePreset}- gifOutputDimensions={gifOutputDimensions}- onLoadProject={handleLoadProject}- onSaveProject={handleSaveProject}- onStartExport={handleStartExportFromDialog}- /></div>);}diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsxindex 5ac210a0..ca4cf639 100644--- a/src/components/video-editor/VideoPlayback.tsx+++ b/src/components/video-editor/VideoPlayback.tsx@@ -64,6 +64,7 @@ import {import { AnnotationOverlay } from "./AnnotationOverlay";import {DEFAULT_CURSOR_CLICK_BOUNCE,+ DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,DEFAULT_CURSOR_MOTION_BLUR,DEFAULT_CURSOR_SIZE,DEFAULT_CURSOR_SMOOTHING,@@ -136,6 +137,7 @@ interface VideoPlaybackProps {cursorSmoothing?: number;cursorMotionBlur?: number;cursorClickBounce?: number;+ cursorClickBounceDuration?: number;cursorSway?: number;volume?: number;}@@ -190,6 +192,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(cursorSmoothing = DEFAULT_CURSOR_SMOOTHING,cursorMotionBlur = DEFAULT_CURSOR_MOTION_BLUR,cursorClickBounce = DEFAULT_CURSOR_CLICK_BOUNCE,+ cursorClickBounceDuration = DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,cursorSway = DEFAULT_CURSOR_SWAY,volume = 1,},@@ -245,6 +248,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(const cursorSmoothingRef = useRef(cursorSmoothing);const cursorMotionBlurRef = useRef(cursorMotionBlur);const cursorClickBounceRef = useRef(cursorClickBounce);+ const cursorClickBounceDurationRef = useRef(cursorClickBounceDuration);const cursorSwayRef = useRef(cursorSway);const motionBlurStateRef = useRef<MotionBlurState>(createMotionBlurState());@@ -604,6 +608,10 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(cursorClickBounceRef.current = cursorClickBounce;}, [cursorClickBounce]);+ useEffect(() => {+ cursorClickBounceDurationRef.current = cursorClickBounceDuration;+ }, [cursorClickBounceDuration]);+useEffect(() => {cursorSwayRef.current = cursorSway;}, [cursorSway]);@@ -814,6 +822,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(smoothingFactor: cursorSmoothingRef.current,motionBlur: cursorMotionBlurRef.current,clickBounce: cursorClickBounceRef.current,+ clickBounceDuration: cursorClickBounceDurationRef.current,sway: cursorSwayRef.current,});cursorOverlayRef.current = cursorOverlay;@@ -1164,6 +1173,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(overlay.setSmoothingFactor(cursorSmoothing);overlay.setMotionBlur(cursorMotionBlur);overlay.setClickBounce(cursorClickBounce);+ overlay.setClickBounceDuration(cursorClickBounceDuration);overlay.setSway(cursorSway);overlay.reset();}, [@@ -1171,6 +1181,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(cursorSmoothing,cursorMotionBlur,cursorClickBounce,+ cursorClickBounceDuration,cursorSway,]);diff --git a/src/components/video-editor/editorPreferences.test.ts b/src/components/video-editor/editorPreferences.test.tsindex 23fa07eb..fce25280 100644--- a/src/components/video-editor/editorPreferences.test.ts+++ b/src/components/video-editor/editorPreferences.test.ts@@ -84,10 +84,10 @@ describe("editorPreferences", () => {cursorSmoothing: DEFAULT_EDITOR_PREFERENCES.cursorSmoothing,cursorMotionBlur: DEFAULT_EDITOR_PREFERENCES.cursorMotionBlur,cursorClickBounce: DEFAULT_EDITOR_PREFERENCES.cursorClickBounce,+ cursorClickBounceDuration: DEFAULT_EDITOR_PREFERENCES.cursorClickBounceDuration,cursorSway: DEFAULT_EDITOR_PREFERENCES.cursorSway,borderRadius: DEFAULT_EDITOR_PREFERENCES.borderRadius,padding: DEFAULT_EDITOR_PREFERENCES.padding,- cropRegion: { x: 0.1, y: 0.2, width: 0.7, height: 0.6 },aspectRatio: "native",exportQuality: DEFAULT_EDITOR_PREFERENCES.exportQuality,exportFormat: "gif",@@ -126,10 +126,10 @@ describe("editorPreferences", () => {cursorSmoothing: DEFAULT_EDITOR_PREFERENCES.cursorSmoothing,cursorMotionBlur: DEFAULT_EDITOR_PREFERENCES.cursorMotionBlur,cursorClickBounce: DEFAULT_EDITOR_PREFERENCES.cursorClickBounce,+ cursorClickBounceDuration: DEFAULT_EDITOR_PREFERENCES.cursorClickBounceDuration,cursorSway: DEFAULT_EDITOR_PREFERENCES.cursorSway,borderRadius: DEFAULT_EDITOR_PREFERENCES.borderRadius,padding: DEFAULT_EDITOR_PREFERENCES.padding,- cropRegion: DEFAULT_EDITOR_PREFERENCES.cropRegion,exportQuality: DEFAULT_EDITOR_PREFERENCES.exportQuality,exportFormat: DEFAULT_EDITOR_PREFERENCES.exportFormat,gifFrameRate: DEFAULT_EDITOR_PREFERENCES.gifFrameRate,@@ -158,10 +158,10 @@ describe("editorPreferences", () => {cursorSmoothing: 1.25,cursorMotionBlur: 0.5,cursorClickBounce: 2.25,+ cursorClickBounceDuration: 350,cursorSway: 1.5,borderRadius: 18,padding: 30,- cropRegion: { x: 0.12, y: 0.08, width: 0.7, height: 0.65 },aspectRatio: "4:5",exportQuality: "source",exportFormat: "gif",@@ -185,10 +185,10 @@ describe("editorPreferences", () => {cursorSmoothing: 1.25,cursorMotionBlur: 0.5,cursorClickBounce: 2.25,+ cursorClickBounceDuration: 350,cursorSway: 1.5,borderRadius: 18,padding: 30,- cropRegion: { x: 0.12, y: 0.08, width: 0.7, height: 0.65 },aspectRatio: "4:5",exportQuality: "source",exportFormat: "gif",diff --git a/src/components/video-editor/editorPreferences.ts b/src/components/video-editor/editorPreferences.tsindex 8d2e89e8..12d6d058 100644--- a/src/components/video-editor/editorPreferences.ts+++ b/src/components/video-editor/editorPreferences.ts@@ -13,10 +13,10 @@ type PersistedEditorControls = Pick<| "cursorSmoothing"| "cursorMotionBlur"| "cursorClickBounce"+ | "cursorClickBounceDuration"| "cursorSway"| "borderRadius"| "padding"- | "cropRegion"| "webcam"| "aspectRatio"| "exportQuality"@@ -50,10 +50,10 @@ export const DEFAULT_EDITOR_PREFERENCES: EditorPreferences = {cursorSmoothing: DEFAULT_EDITOR_CONTROLS.cursorSmoothing,cursorMotionBlur: DEFAULT_EDITOR_CONTROLS.cursorMotionBlur,cursorClickBounce: DEFAULT_EDITOR_CONTROLS.cursorClickBounce,+ cursorClickBounceDuration: DEFAULT_EDITOR_CONTROLS.cursorClickBounceDuration,cursorSway: DEFAULT_EDITOR_CONTROLS.cursorSway,borderRadius: DEFAULT_EDITOR_CONTROLS.borderRadius,padding: DEFAULT_EDITOR_CONTROLS.padding,- cropRegion: DEFAULT_EDITOR_CONTROLS.cropRegion,webcam: DEFAULT_EDITOR_CONTROLS.webcam,aspectRatio: DEFAULT_EDITOR_CONTROLS.aspectRatio,exportQuality: DEFAULT_EDITOR_CONTROLS.exportQuality,@@ -79,41 +79,6 @@ function normalizePositiveIntegerString(value: unknown, fallback: string): strinreturn String(parsed);}-function isFiniteNumber(value: unknown): value is number {- return typeof value === "number" && Number.isFinite(value);-}--function clamp(value: number, min: number, max: number): number {- return Math.min(max, Math.max(min, value));-}--function normalizeCropRegion(- value: unknown,- fallback: EditorPreferences["cropRegion"],-): EditorPreferences["cropRegion"] {- if (!value || typeof value !== "object") {- return fallback;- }-- const raw = value as Partial<EditorPreferences["cropRegion"]>;- const x = isFiniteNumber(raw.x) && raw.x >= 0 && raw.x < 1 ? raw.x : fallback.x;- const y = isFiniteNumber(raw.y) && raw.y >= 0 && raw.y < 1 ? raw.y : fallback.y;- const maxWidth = 1 - x;- const maxHeight = 1 - y;- const fallbackWidth = clamp(fallback.width, 0.01, maxWidth);- const fallbackHeight = clamp(fallback.height, 0.01, maxHeight);- const width =- isFiniteNumber(raw.width) && raw.width >= 0.01 && raw.width <= maxWidth- ? raw.width- : fallbackWidth;- const height =- isFiniteNumber(raw.height) && raw.height >= 0.01 && raw.height <= maxHeight- ? raw.height- : fallbackHeight;-- return { x, y, width, height };-}-function normalizeCustomWallpapers(value: unknown, fallback: string[]): string[] {if (!Array.isArray(value)) {return fallback;@@ -140,10 +105,11 @@ function normalizeEditorControls(cursorSmoothing: raw.cursorSmoothing ?? fallback.cursorSmoothing,cursorMotionBlur: raw.cursorMotionBlur ?? fallback.cursorMotionBlur,cursorClickBounce: raw.cursorClickBounce ?? fallback.cursorClickBounce,+ cursorClickBounceDuration:+ raw.cursorClickBounceDuration ?? fallback.cursorClickBounceDuration,cursorSway: raw.cursorSway ?? fallback.cursorSway,borderRadius: raw.borderRadius ?? fallback.borderRadius,padding: raw.padding ?? fallback.padding,- cropRegion: normalizeCropRegion(raw.cropRegion, fallback.cropRegion),webcam: raw.webcam ?? fallback.webcam,aspectRatio: raw.aspectRatio ?? fallback.aspectRatio,exportQuality: raw.exportQuality ?? fallback.exportQuality,@@ -167,10 +133,10 @@ function normalizeEditorControls(cursorSmoothing: normalized.cursorSmoothing,cursorMotionBlur: normalized.cursorMotionBlur,cursorClickBounce: normalized.cursorClickBounce,+ cursorClickBounceDuration: normalized.cursorClickBounceDuration,cursorSway: normalized.cursorSway,borderRadius: normalized.borderRadius,padding: normalized.padding,- cropRegion: normalized.cropRegion,webcam: normalized.webcam,aspectRatio: normalized.aspectRatio,exportQuality: normalized.exportQuality,diff --git a/src/components/video-editor/projectPersistence.ts b/src/components/video-editor/projectPersistence.tsindex 182943fc..67723411 100644--- a/src/components/video-editor/projectPersistence.ts+++ b/src/components/video-editor/projectPersistence.ts@@ -10,6 +10,7 @@ import {DEFAULT_ANNOTATION_STYLE,DEFAULT_CROP_REGION,DEFAULT_CURSOR_CLICK_BOUNCE,+ DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,DEFAULT_CURSOR_MOTION_BLUR,DEFAULT_CURSOR_SIZE,DEFAULT_CURSOR_SMOOTHING,@@ -44,6 +45,7 @@ export interface ProjectEditorState {cursorSmoothing: number;cursorMotionBlur: number;cursorClickBounce: number;+ cursorClickBounceDuration: number;cursorSway: number;borderRadius: number;padding: number;@@ -65,7 +67,7 @@ export interface ProjectEditorState {export interface EditorProjectData {version: number;videoPath: string;- editor: ProjectEditorState;+ editor: Partial<ProjectEditorState>;}function isFiniteNumber(value: unknown): value is number {@@ -383,6 +385,9 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): ProcursorClickBounce: isFiniteNumber((editor as Partial<ProjectEditorState>).cursorClickBounce)? clamp((editor as Partial<ProjectEditorState>).cursorClickBounce as number, 0, 5): DEFAULT_CURSOR_CLICK_BOUNCE,+ cursorClickBounceDuration: isFiniteNumber((editor as Partial<ProjectEditorState>).cursorClickBounceDuration)+ ? clamp((editor as Partial<ProjectEditorState>).cursorClickBounceDuration as number, 60, 500)+ : DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,cursorSway: isFiniteNumber((editor as Partial<ProjectEditorState>).cursorSway)? clamp((editor as Partial<ProjectEditorState>).cursorSway as number, 0, 2): DEFAULT_CURSOR_SWAY,@@ -457,7 +462,7 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): Proexport function createProjectData(videoPath: string,- editor: ProjectEditorState,+ editor: Partial<ProjectEditorState>,): EditorProjectData {return {version: PROJECT_VERSION,diff --git a/src/components/video-editor/timeline/TimelineEditor.tsx b/src/components/video-editor/timeline/TimelineEditor.tsxindex c49e75ae..773ce257 100644--- a/src/components/video-editor/timeline/TimelineEditor.tsx+++ b/src/components/video-editor/timeline/TimelineEditor.tsx@@ -7,10 +7,11 @@ import {DropdownMenuItem,DropdownMenuTrigger,} from "@/components/ui/dropdown-menu";-import { Plus, Scissors, ZoomIn, MessageSquare, ChevronDown, Check, Gauge, WandSparkles, Music } from "lucide-react";+import { Plus, Scissors, ZoomIn, MessageSquare, ChevronDown, Check, Gauge, WandSparkles, Music, Crop } from "lucide-react";import { toast } from "sonner";import { cn } from "@/lib/utils";import { v4 as uuidv4 } from 'uuid';+import { useScopedT } from "@/contexts/I18nContext";import { useShortcuts } from "@/contexts/ShortcutsContext";import { matchesShortcut } from "@/lib/shortcuts";import { ASPECT_RATIOS, type AspectRatio, getAspectRatioLabel, isCustomAspectRatio } from "@/utils/aspectRatioUtils";@@ -73,6 +74,8 @@ interface TimelineEditorProps {onSelectAudio?: (id: string | null) => void;aspectRatio: AspectRatio;onAspectRatioChange: (aspectRatio: AspectRatio) => void;+ onOpenCropEditor?: () => void;+ isCropped?: boolean;}interface TimelineScaleConfig {@@ -655,7 +658,10 @@ export default function TimelineEditor({onSelectAudio,aspectRatio,onAspectRatioChange,+ onOpenCropEditor,+ isCropped = false,}: TimelineEditorProps) {+ const t = useScopedT("settings");const initialEditorPreferences = useMemo(() => loadEditorPreferences(), []);const totalMs = useMemo(() => Math.max(0, Math.round(videoDuration * 1000)), [videoDuration]);const currentTimeMs = useMemo(() => Math.round(currentTime * 1000), [currentTime]);@@ -1475,6 +1481,16 @@ export default function TimelineEditor({</DropdownMenuContent></DropdownMenu><div className="w-[1px] h-4 bg-white/10" />+ <Button+ variant="ghost"+ size="sm"+ onClick={() => onOpenCropEditor?.()}+ className="h-7 px-2 text-xs text-slate-400 hover:text-slate-200 hover:bg-white/10 transition-all gap-1.5"+ >+ <Crop className="w-3.5 h-3.5" />+ <span className="font-medium">{t("sections.crop", "Crop")}</span>+ {isCropped ? <span className="h-1.5 w-1.5 rounded-full bg-[#2563EB]" /> : null}+ </Button><TutorialHelp /></div><div className="flex-1" />diff --git a/src/components/video-editor/types.ts b/src/components/video-editor/types.tsindex 6a071f7b..7aeada4a 100644--- a/src/components/video-editor/types.ts+++ b/src/components/video-editor/types.ts@@ -41,6 +41,7 @@ export interface CursorVisualSettings {smoothing: number;motionBlur: number;clickBounce: number;+ clickBounceDuration: number;sway: number;}@@ -62,6 +63,7 @@ export const DEFAULT_CURSOR_SIZE = 3.0;export const DEFAULT_CURSOR_SMOOTHING = 0.67;export const DEFAULT_CURSOR_MOTION_BLUR = 0.35;export const DEFAULT_CURSOR_CLICK_BOUNCE = 2.5;+export const DEFAULT_CURSOR_CLICK_BOUNCE_DURATION = 350;export const DEFAULT_CURSOR_SWAY = 0.25;export const DEFAULT_ZOOM_MOTION_BLUR = 0.35;export const DEFAULT_WEBCAM_SIZE = 35;diff --git a/src/components/video-editor/videoPlayback/cursorRenderer.ts b/src/components/video-editor/videoPlayback/cursorRenderer.tsindex 3cdaf4ba..3fe53279 100644--- a/src/components/video-editor/videoPlayback/cursorRenderer.ts+++ b/src/components/video-editor/videoPlayback/cursorRenderer.ts@@ -7,7 +7,7 @@ import {Texture,} from "pixi.js";import { MotionBlurFilter } from "pixi-filters/motion-blur";-import type { CursorTelemetryPoint } from "../types";+import { DEFAULT_CURSOR_CLICK_BOUNCE_DURATION, type CursorTelemetryPoint } from "../types";import {createSpringState,getCursorSpringConfig,@@ -55,6 +55,8 @@ export interface CursorRenderConfig {motionBlur: number;/** Click bounce multiplier. */clickBounce: number;+ /** Click bounce duration in milliseconds. */+ clickBounceDuration: number;/** Cursor sway multiplier. */sway: number;}@@ -67,12 +69,12 @@ export const DEFAULT_CURSOR_CONFIG: CursorRenderConfig = {smoothingFactor: 0.18,motionBlur: 0,clickBounce: 1,+ clickBounceDuration: DEFAULT_CURSOR_CLICK_BOUNCE_DURATION,sway: 0,};const REFERENCE_WIDTH = 1920;const MIN_CURSOR_VIEWPORT_SCALE = 0.55;-const CLICK_ANIMATION_MS = 140;const CLICK_RING_FADE_MS = 240;const CURSOR_MOTION_BLUR_BASE_MULTIPLIER = 0.08;const CURSOR_TIME_DISCONTINUITY_MS = 100;@@ -446,7 +448,11 @@ function getCursorSwaySpringConfig(smoothingFactor: number) {};}-function getCursorVisualState(samples: CursorTelemetryPoint[], timeMs: number) {+function getCursorVisualState(+ samples: CursorTelemetryPoint[],+ timeMs: number,+ clickBounceDuration: number,+) {const latestClick = findLatestInteractionSample(samples, timeMs);const interactionType = latestClick?.interactionType;const ageMs = latestClick@@ -458,8 +464,8 @@ function getCursorVisualState(samples: CursorTelemetryPoint[], timeMs: number) {interactionType === "right-click" ||interactionType === "middle-click";const clickBounceProgress =- latestClick && isClickEvent && ageMs <= CLICK_ANIMATION_MS- ? 1 - ageMs / CLICK_ANIMATION_MS+ latestClick && isClickEvent && ageMs <= clickBounceDuration+ ? 1 - ageMs / clickBounceDuration: 0;return {@@ -655,6 +661,10 @@ export class PixiCursorOverlay {this.config.clickBounce = Math.max(0, clickBounce);}+ setClickBounceDuration(clickBounceDuration: number) {+ this.config.clickBounceDuration = clamp(clickBounceDuration, 60, 500);+ }+setSway(sway: number) {this.config.sway = clamp(sway, 0, 2);}@@ -708,7 +718,7 @@ export class PixiCursorOverlay {const py = viewport.y + this.state.y * viewport.height;const h = this.config.dotRadius * getCursorViewportScale(viewport);const { cursorType, clickBounceProgress, clickProgress } =- getCursorVisualState(samples, timeMs);+ getCursorVisualState(samples, timeMs, this.config.clickBounceDuration);const spriteKey = (cursorType in this.cursorSprites ? cursorType : "arrow") as CursorAssetKey;@@ -893,6 +903,7 @@ export function drawCursorOnCanvas(const { cursorType, clickBounceProgress } = getCursorVisualState(samples,timeMs,+ config.clickBounceDuration,);const spriteKey = (cursorType && loadedCursorAssets[cursorType] ? cursorType : "arrow"diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.tsindex d4005c45..27437c21 100644--- a/src/lib/exporter/frameRenderer.ts+++ b/src/lib/exporter/frameRenderer.ts@@ -66,6 +66,7 @@ interface FrameRenderConfig {cursorSmoothing?: number;cursorMotionBlur?: number;cursorClickBounce?: number;+ cursorClickBounceDuration?: number;cursorSway?: number;}@@ -187,6 +188,8 @@ export class FrameRenderer {motionBlur: this.config.cursorMotionBlur ?? 0,clickBounce:this.config.cursorClickBounce ?? DEFAULT_CURSOR_CONFIG.clickBounce,+ clickBounceDuration:+ this.config.cursorClickBounceDuration ?? DEFAULT_CURSOR_CONFIG.clickBounceDuration,sway: this.config.cursorSway ?? DEFAULT_CURSOR_CONFIG.sway,});}diff --git a/src/lib/exporter/gifExporter.ts b/src/lib/exporter/gifExporter.tsindex bd69c330..8b0db134 100644--- a/src/lib/exporter/gifExporter.ts+++ b/src/lib/exporter/gifExporter.ts@@ -52,6 +52,7 @@ interface GifExporterConfig {cursorSmoothing?: number;cursorMotionBlur?: number;cursorClickBounce?: number;+ cursorClickBounceDuration?: number;cursorSway?: number;previewWidth?: number;previewHeight?: number;@@ -142,6 +143,7 @@ export class GifExporter {cursorSmoothing: this.config.cursorSmoothing,cursorMotionBlur: this.config.cursorMotionBlur,cursorClickBounce: this.config.cursorClickBounce,+ cursorClickBounceDuration: this.config.cursorClickBounceDuration,cursorSway: this.config.cursorSway,});await this.renderer.initialize();diff --git a/src/lib/exporter/videoExporter.ts b/src/lib/exporter/videoExporter.tsindex 0c592a5e..12096587 100644--- a/src/lib/exporter/videoExporter.ts+++ b/src/lib/exporter/videoExporter.ts@@ -38,6 +38,7 @@ interface VideoExporterConfig extends ExportConfig {cursorSmoothing?: number;cursorMotionBlur?: number;cursorClickBounce?: number;+ cursorClickBounceDuration?: number;cursorSway?: number;audioRegions?: AudioRegion[];previewWidth?: number;@@ -103,6 +104,7 @@ export class VideoExporter {cursorSmoothing: this.config.cursorSmoothing,cursorMotionBlur: this.config.cursorMotionBlur,cursorClickBounce: this.config.cursorClickBounce,+ cursorClickBounceDuration: this.config.cursorClickBounceDuration,cursorSway: this.config.cursorSway,});await this.renderer.initialize();