Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
custom cursors
Siddharthb088a098a9d0
diff --git a/electron-builder.json5 b/electron-builder.json5index 8ad4a80eb..c23d3e2fd 100644--- a/electron-builder.json5+++ b/electron-builder.json5@@ -24,12 +24,16 @@"!CONTRIBUTING.md","!LICENSE"],- // Asset layout contract: "wallpapers/" under resourcesPath must align with- // assetBaseDir in electron/preload.ts (packaged branch).+ // Asset layout contract: "wallpapers/" and "cursors/" under resourcesPath must+ // align with assetBaseDir in electron/preload.ts (packaged branch)."extraResources": [{"from": "public/wallpapers","to": "wallpapers"+ },+ {+ "from": "public/cursors",+ "to": "cursors"}],diff --git a/public/cursors/among-us-sus-knife-and-red-animated/arrow.png b/public/cursors/among-us-sus-knife-and-red-animated/arrow.pngnew file mode 100644index 000000000..84e9a3b34Binary files /dev/null and b/public/cursors/among-us-sus-knife-and-red-animated/arrow.png differdiff --git a/public/cursors/among-us-sus-knife-and-red-animated/pointer.png b/public/cursors/among-us-sus-knife-and-red-animated/pointer.pngnew file mode 100644index 000000000..b4212f732Binary files /dev/null and b/public/cursors/among-us-sus-knife-and-red-animated/pointer.png differdiff --git a/public/cursors/black-and-rainbow-stroke-gradient-animated/arrow.png b/public/cursors/black-and-rainbow-stroke-gradient-animated/arrow.pngnew file mode 100644index 000000000..adfcec8dcBinary files /dev/null and b/public/cursors/black-and-rainbow-stroke-gradient-animated/arrow.png differdiff --git a/public/cursors/black-and-rainbow-stroke-gradient-animated/pointer.png b/public/cursors/black-and-rainbow-stroke-gradient-animated/pointer.pngnew file mode 100644index 000000000..2a0ebf08fBinary files /dev/null and b/public/cursors/black-and-rainbow-stroke-gradient-animated/pointer.png differdiff --git a/public/cursors/black-pixel/arrow.png b/public/cursors/black-pixel/arrow.pngnew file mode 100644index 000000000..ec2d6a315Binary files /dev/null and b/public/cursors/black-pixel/arrow.png differdiff --git a/public/cursors/black-pixel/pointer.png b/public/cursors/black-pixel/pointer.pngnew file mode 100644index 000000000..ffd561641Binary files /dev/null and b/public/cursors/black-pixel/pointer.png differdiff --git a/public/cursors/christmas-miles-morales/arrow.png b/public/cursors/christmas-miles-morales/arrow.pngnew file mode 100644index 000000000..6931394ecBinary files /dev/null and b/public/cursors/christmas-miles-morales/arrow.png differdiff --git a/public/cursors/christmas-miles-morales/pointer.png b/public/cursors/christmas-miles-morales/pointer.pngnew file mode 100644index 000000000..049a68e2eBinary files /dev/null and b/public/cursors/christmas-miles-morales/pointer.png differdiff --git a/public/cursors/hello-kitty-watermelon/arrow.png b/public/cursors/hello-kitty-watermelon/arrow.pngnew file mode 100644index 000000000..9e6a20319Binary files /dev/null and b/public/cursors/hello-kitty-watermelon/arrow.png differdiff --git a/public/cursors/hello-kitty-watermelon/pointer.png b/public/cursors/hello-kitty-watermelon/pointer.pngnew file mode 100644index 000000000..f45fdfd06Binary files /dev/null and b/public/cursors/hello-kitty-watermelon/pointer.png differdiff --git a/public/cursors/hollow-knight-and-game-arrow/arrow.png b/public/cursors/hollow-knight-and-game-arrow/arrow.pngnew file mode 100644index 000000000..efb4b7708Binary files /dev/null and b/public/cursors/hollow-knight-and-game-arrow/arrow.png differdiff --git a/public/cursors/hollow-knight-and-game-arrow/pointer.png b/public/cursors/hollow-knight-and-game-arrow/pointer.pngnew file mode 100644index 000000000..dcea8e91dBinary files /dev/null and b/public/cursors/hollow-knight-and-game-arrow/pointer.png differdiff --git a/public/cursors/hollow-knight-nail-sword-and-mask/arrow.png b/public/cursors/hollow-knight-nail-sword-and-mask/arrow.pngnew file mode 100644index 000000000..dbd4f52a2Binary files /dev/null and b/public/cursors/hollow-knight-nail-sword-and-mask/arrow.png differdiff --git a/public/cursors/hollow-knight-nail-sword-and-mask/pointer.png b/public/cursors/hollow-knight-nail-sword-and-mask/pointer.pngnew file mode 100644index 000000000..ac77b710cBinary files /dev/null and b/public/cursors/hollow-knight-nail-sword-and-mask/pointer.png differdiff --git a/public/cursors/mickey-mouse-black-hand-inflated-glove/arrow.png b/public/cursors/mickey-mouse-black-hand-inflated-glove/arrow.pngnew file mode 100644index 000000000..143076372Binary files /dev/null and b/public/cursors/mickey-mouse-black-hand-inflated-glove/arrow.png differdiff --git a/public/cursors/mickey-mouse-black-hand-inflated-glove/pointer.png b/public/cursors/mickey-mouse-black-hand-inflated-glove/pointer.pngnew file mode 100644index 000000000..f52a4e650Binary files /dev/null and b/public/cursors/mickey-mouse-black-hand-inflated-glove/pointer.png differdiff --git a/public/cursors/naruto-akatsuki-cloud-arrow/arrow.png b/public/cursors/naruto-akatsuki-cloud-arrow/arrow.pngnew file mode 100644index 000000000..d6361dff2Binary files /dev/null and b/public/cursors/naruto-akatsuki-cloud-arrow/arrow.png differdiff --git a/public/cursors/naruto-akatsuki-cloud-arrow/pointer.png b/public/cursors/naruto-akatsuki-cloud-arrow/pointer.pngnew file mode 100644index 000000000..fa10e9d2dBinary files /dev/null and b/public/cursors/naruto-akatsuki-cloud-arrow/pointer.png differdiff --git a/public/cursors/old-roblox/arrow.png b/public/cursors/old-roblox/arrow.pngnew file mode 100644index 000000000..a55875df9Binary files /dev/null and b/public/cursors/old-roblox/arrow.png differdiff --git a/public/cursors/old-roblox/pointer.png b/public/cursors/old-roblox/pointer.pngnew file mode 100644index 000000000..d490a65fdBinary files /dev/null and b/public/cursors/old-roblox/pointer.png differdiff --git a/public/cursors/pink-glossy-arrow-and-hand-3d/arrow.png b/public/cursors/pink-glossy-arrow-and-hand-3d/arrow.pngnew file mode 100644index 000000000..69ecd5b19Binary files /dev/null and b/public/cursors/pink-glossy-arrow-and-hand-3d/arrow.png differdiff --git a/public/cursors/pink-glossy-arrow-and-hand-3d/pointer.png b/public/cursors/pink-glossy-arrow-and-hand-3d/pointer.pngnew file mode 100644index 000000000..f8d5938a7Binary files /dev/null and b/public/cursors/pink-glossy-arrow-and-hand-3d/pointer.png differdiff --git a/public/cursors/pinky-pixel/arrow.png b/public/cursors/pinky-pixel/arrow.pngnew file mode 100644index 000000000..4bcd3dcaaBinary files /dev/null and b/public/cursors/pinky-pixel/arrow.png differdiff --git a/public/cursors/pinky-pixel/pointer.png b/public/cursors/pinky-pixel/pointer.pngnew file mode 100644index 000000000..7eb897a74Binary files /dev/null and b/public/cursors/pinky-pixel/pointer.png differdiff --git a/public/cursors/pokemon-neon-gengar/arrow.png b/public/cursors/pokemon-neon-gengar/arrow.pngnew file mode 100644index 000000000..4dcccb360Binary files /dev/null and b/public/cursors/pokemon-neon-gengar/arrow.png differdiff --git a/public/cursors/pokemon-neon-gengar/pointer.png b/public/cursors/pokemon-neon-gengar/pointer.pngnew file mode 100644index 000000000..e7b4437f0Binary files /dev/null and b/public/cursors/pokemon-neon-gengar/pointer.png differdiff --git a/public/cursors/sanrio-gudetama-and-arrow-kawaii/arrow.png b/public/cursors/sanrio-gudetama-and-arrow-kawaii/arrow.pngnew file mode 100644index 000000000..123117b05Binary files /dev/null and b/public/cursors/sanrio-gudetama-and-arrow-kawaii/arrow.png differdiff --git a/public/cursors/sanrio-gudetama-and-arrow-kawaii/pointer.png b/public/cursors/sanrio-gudetama-and-arrow-kawaii/pointer.pngnew file mode 100644index 000000000..37afa7bd1Binary files /dev/null and b/public/cursors/sanrio-gudetama-and-arrow-kawaii/pointer.png differdiff --git a/public/cursors/sanrio-kuromi-skull-arrow/arrow.png b/public/cursors/sanrio-kuromi-skull-arrow/arrow.pngnew file mode 100644index 000000000..6fe7e89d6Binary files /dev/null and b/public/cursors/sanrio-kuromi-skull-arrow/arrow.png differdiff --git a/public/cursors/sanrio-kuromi-skull-arrow/pointer.png b/public/cursors/sanrio-kuromi-skull-arrow/pointer.pngnew file mode 100644index 000000000..2971a7f16Binary files /dev/null and b/public/cursors/sanrio-kuromi-skull-arrow/pointer.png differdiff --git a/public/cursors/solo-leveling-sung-jinwoo-dark-flames/arrow.png b/public/cursors/solo-leveling-sung-jinwoo-dark-flames/arrow.pngnew file mode 100644index 000000000..2155e0fd9Binary files /dev/null and b/public/cursors/solo-leveling-sung-jinwoo-dark-flames/arrow.png differdiff --git a/public/cursors/solo-leveling-sung-jinwoo-dark-flames/pointer.png b/public/cursors/solo-leveling-sung-jinwoo-dark-flames/pointer.pngnew file mode 100644index 000000000..0e0b1a0b7Binary files /dev/null and b/public/cursors/solo-leveling-sung-jinwoo-dark-flames/pointer.png differdiff --git a/public/cursors/spring-gradient/arrow.png b/public/cursors/spring-gradient/arrow.pngnew file mode 100644index 000000000..51889625dBinary files /dev/null and b/public/cursors/spring-gradient/arrow.png differdiff --git a/public/cursors/spring-gradient/pointer.png b/public/cursors/spring-gradient/pointer.pngnew file mode 100644index 000000000..9ccdc2fb6Binary files /dev/null and b/public/cursors/spring-gradient/pointer.png differdiff --git a/public/wallpapers/wallpaper1.jpg b/public/wallpapers/wallpaper1.jpgindex 98c93cb14..dbd8afb8b 100644Binary files a/public/wallpapers/wallpaper1.jpg and b/public/wallpapers/wallpaper1.jpg differdiff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsxindex e584d0abd..8cb143a54 100644--- a/src/components/video-editor/SettingsPanel.tsx+++ b/src/components/video-editor/SettingsPanel.tsx@@ -22,6 +22,7 @@ import {} from "lucide-react";import { type ComponentType, useCallback, useMemo, useRef, useState } from "react";import { toast } from "sonner";+import defaultCursorPreviewUrl from "@/assets/cursors/Cursor=Default.svg";import {Accordion,AccordionContent,@@ -41,7 +42,9 @@ import { Switch } from "@/components/ui/switch";import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";import { Tooltip } from "@/components/ui/tooltip";import { useScopedT } from "@/contexts/I18nContext";+import { getAssetPath } from "@/lib/assetPath";import { WEBCAM_LAYOUT_PRESETS } from "@/lib/compositeLayout";+import { CURSOR_THEMES, DEFAULT_CURSOR_THEME_ID } from "@/lib/cursor/cursorThemes";import type { ExportFormat, ExportQuality, GifFrameRate, GifSizePreset } from "@/lib/exporter";import {calculateEffectiveSourceDimensions,@@ -340,6 +343,8 @@ interface SettingsPanelProps {onCursorClickBounceChange?: (bounce: number) => void;cursorClipToBounds?: boolean;onCursorClipToBoundsChange?: (clip: boolean) => void;+ cursorTheme?: string;+ onCursorThemeChange?: (theme: string) => void;hasCursorData?: boolean;showCursorSettings?: boolean;}@@ -472,6 +477,8 @@ export function SettingsPanel({onCursorClickBounceChange,cursorClipToBounds = DEFAULT_CURSOR_SETTINGS.clipToBounds,onCursorClipToBoundsChange,+ cursorTheme = DEFAULT_CURSOR_SETTINGS.theme,+ onCursorThemeChange,hasCursorData = false,showCursorSettings = true,}: SettingsPanelProps) {@@ -482,6 +489,26 @@ export function SettingsPanel({// `/wallpapers/wallpaperN.jpg` form in WALLPAPER_PATHS is what gets persisted// on click — never the machine-specific file:// URL.const wallpaperPreviewUrls = useMemo(() => WALLPAPER_PATHS.map(resolveImageWallpaperUrl), []);+ // "Default" (built-in art) plus each bundled cursor theme. Preview thumbnails use+ // the theme's arrow asset; the persisted/selected value is the theme id.+ const cursorThemeOptions = useMemo(+ () => [+ {+ id: DEFAULT_CURSOR_THEME_ID,+ name: t("cursor.themeDefault"),+ previewUrl: defaultCursorPreviewUrl,+ },+ ...CURSOR_THEMES.map((theme) => {+ const previewPath = (theme.assets.arrow ?? theme.assets.pointer)?.assetPath;+ return {+ id: theme.id,+ name: theme.name,+ previewUrl: previewPath ? getAssetPath(previewPath) : defaultCursorPreviewUrl,+ };+ }),+ ],+ [t],+ );const [customImages, setCustomImages] = useState<string[]>([]);const fileInputRef = useRef<HTMLInputElement>(null);const colorPalette = [@@ -1525,6 +1552,41 @@ export function SettingsPanel({aria-label={t("cursor.clipToBounds")}/></div>+ {cursorThemeOptions.length > 1 && (+ <div className="space-y-1.5">+ <div className="text-[10px] font-medium text-slate-300">+ {t("cursor.theme")}+ </div>+ <div className="flex flex-wrap gap-1.5">+ {cursorThemeOptions.map((option) => {+ const isSelected = cursorTheme === option.id;+ return (+ <button+ type="button"+ key={option.id}+ title={option.name}+ aria-label={option.name}+ aria-pressed={isSelected}+ onClick={() => onCursorThemeChange?.(option.id)}+ className={cn(+ "flex items-center justify-center w-8 h-8 rounded-lg border overflow-hidden transition-all duration-150 shadow-sm bg-white/5",+ isSelected+ ? "border-[#34B27B] ring-1 ring-[#34B27B]/30"+ : "border-white/10 hover:border-[#34B27B]/40 opacity-80 hover:opacity-100",+ )}+ >+ <img+ src={option.previewUrl}+ alt=""+ className="w-5 h-5 object-contain"+ draggable={false}+ />+ </button>+ );+ })}+ </div>+ </div>+ )}<div className="grid grid-cols-2 gap-2"><div className="p-2 rounded-lg bg-white/5 border border-white/5"><div className="flex items-center justify-between mb-1">diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsxindex e36b07692..2b8664bd6 100644--- a/src/components/video-editor/VideoEditor.tsx+++ b/src/components/video-editor/VideoEditor.tsx@@ -288,6 +288,7 @@ export default function VideoEditor() {const [cursorClipToBounds, setCursorClipToBounds] = useState(DEFAULT_CURSOR_SETTINGS.clipToBounds,);+ const [cursorTheme, setCursorTheme] = useState(DEFAULT_CURSOR_SETTINGS.theme);const [nativePlatform, setNativePlatform] = useState<NativePlatform | null>(null);const [recordingCursorCaptureMode, setRecordingCursorCaptureMode] =useState<CursorCaptureMode | null>(null);@@ -423,6 +424,7 @@ export default function VideoEditor() {setGifFrameRate(normalizedEditor.gifFrameRate);setGifLoop(normalizedEditor.gifLoop);setGifSizePreset(normalizedEditor.gifSizePreset);+ setCursorTheme(normalizedEditor.cursorTheme);setSelectedZoomId(null);setSelectedTrimId(null);@@ -497,9 +499,11 @@ export default function VideoEditor() {gifFrameRate,gifLoop,gifSizePreset,+ cursorTheme,});}, [currentProjectMedia,+ cursorTheme,wallpaper,shadowIntensity,showBlur,@@ -653,6 +657,7 @@ export default function VideoEditor() {gifFrameRate,gifLoop,gifSizePreset,+ cursorTheme,};const projectData = createProjectData(currentProjectMedia, editorState);@@ -716,6 +721,7 @@ export default function VideoEditor() {gifFrameRate,gifLoop,gifSizePreset,+ cursorTheme,videoPath,t,],@@ -849,6 +855,7 @@ export default function VideoEditor() {setCursorMotionBlur(DEFAULT_CURSOR_SETTINGS.motionBlur);setCursorClickBounce(DEFAULT_CURSOR_SETTINGS.clickBounce);setCursorClipToBounds(DEFAULT_CURSOR_SETTINGS.clipToBounds);+ setCursorTheme(DEFAULT_CURSOR_SETTINGS.theme);// Reset region ID counters.nextZoomIdRef.current = 1;nextTrimIdRef.current = 1;@@ -1899,6 +1906,7 @@ export default function VideoEditor() {cursorMotionBlur,cursorClickBounce,cursorClipToBounds,+ cursorTheme,annotationRegions,webcamLayoutPreset,webcamMaskShape,@@ -1991,6 +1999,7 @@ export default function VideoEditor() {cursorMotionBlur,cursorClickBounce,cursorClipToBounds,+ cursorTheme,annotationRegions,webcamLayoutPreset,webcamMaskShape,@@ -2109,6 +2118,7 @@ export default function VideoEditor() {cursorMotionBlur,cursorClickBounce,cursorClipToBounds,+ cursorTheme,t,],);@@ -2628,6 +2638,7 @@ export default function VideoEditor() {cursorMotionBlur={cursorMotionBlur}cursorClickBounce={cursorClickBounce}cursorClipToBounds={cursorClipToBounds}+ cursorTheme={cursorTheme}isPreviewingZoom={isPreviewingZoom}/></div>@@ -2811,6 +2822,8 @@ export default function VideoEditor() {onCursorClickBounceChange={setCursorClickBounce}cursorClipToBounds={cursorClipToBounds}onCursorClipToBoundsChange={setCursorClipToBounds}+ cursorTheme={cursorTheme}+ onCursorThemeChange={setCursorTheme}hasCursorData={cursorTelemetry.length > 0 ||hasNativeCursorRecordingData(cursorRecordingData)diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsxindex d5172e62e..0a3aa651f 100644--- a/src/components/video-editor/VideoPlayback.tsx+++ b/src/components/video-editor/VideoPlayback.tsx@@ -151,6 +151,7 @@ interface VideoPlaybackProps {cursorMotionBlur?: number;cursorClickBounce?: number;cursorClipToBounds?: boolean;+ cursorTheme?: string;// When true, render the selected zoom at the playhead even while paused —// lets the editor preview the zoom effect without leaving the focus-edit view.isPreviewingZoom?: boolean;@@ -276,6 +277,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(cursorMotionBlur = DEFAULT_CURSOR_SETTINGS.motionBlur,cursorClickBounce = DEFAULT_CURSOR_SETTINGS.clickBounce,cursorClipToBounds = DEFAULT_CURSOR_SETTINGS.clipToBounds,+ cursorTheme = DEFAULT_CURSOR_SETTINGS.theme,isPreviewingZoom = false,},ref,@@ -348,6 +350,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(const cursorMotionBlurRef = useRef(cursorMotionBlur);const cursorClickBounceRef = useRef(cursorClickBounce);const cursorClipToBoundsRef = useRef(cursorClipToBounds);+ const cursorThemeRef = useRef(cursorTheme);const isPreviewingZoomRef = useRef(isPreviewingZoom);const motionBlurStateRef = useRef<MotionBlurState>(createMotionBlurState());const onTimeUpdateRef = useRef(onTimeUpdate);@@ -851,6 +854,10 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(cursorClipToBoundsRef.current = cursorClipToBounds;}, [cursorClipToBounds]);+ useEffect(() => {+ cursorThemeRef.current = cursorTheme;+ }, [cursorTheme]);+useEffect(() => {isPreviewingZoomRef.current = isPreviewingZoom;}, [isPreviewingZoom]);@@ -1560,7 +1567,12 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(if (projectedLocalPoint && projectedStagePoint) {// Pass deviceScaleFactor=1 — asset.scaleFactor already encodes DPR.// Size is normalized below so preview matches export proportionally.- const renderAsset = resolveNativeCursorRenderAsset(frame.asset, 1, displaySample);+ const renderAsset = resolveNativeCursorRenderAsset(+ frame.asset,+ 1,+ displaySample,+ cursorThemeRef.current,+ );const bounceProgress = getNativeCursorClickBounceProgress(cursorRecordingDataRef.current,timeMs,diff --git a/src/components/video-editor/editorDefaults.ts b/src/components/video-editor/editorDefaults.tsindex 2e1e95100..eaff15c14 100644--- a/src/components/video-editor/editorDefaults.ts+++ b/src/components/video-editor/editorDefaults.ts@@ -1,3 +1,4 @@+import { DEFAULT_CURSOR_THEME_ID } from "@/lib/cursor/cursorThemes";import type { ExportFormat, ExportQuality, GifFrameRate, GifSizePreset } from "@/lib/exporter";import { DEFAULT_WALLPAPER } from "@/lib/wallpaper";import type { AspectRatio } from "@/utils/aspectRatioUtils";@@ -67,13 +68,14 @@ export const DEFAULT_WEBCAM_SETTINGS = {position: WebcamPosition | null;};-export const DEFAULT_CURSOR_SETTINGS: CursorVisualSettings & { show: boolean } = {+export const DEFAULT_CURSOR_SETTINGS: CursorVisualSettings & { show: boolean; theme: string } = {show: true,size: DEFAULT_CURSOR_SIZE,smoothing: DEFAULT_CURSOR_SMOOTHING,motionBlur: DEFAULT_CURSOR_MOTION_BLUR,clickBounce: DEFAULT_CURSOR_CLICK_BOUNCE,clipToBounds: DEFAULT_CURSOR_CLIP_TO_BOUNDS,+ theme: DEFAULT_CURSOR_THEME_ID,};export const DEFAULT_EXPORT_SETTINGS: {diff --git a/src/components/video-editor/projectPersistence.ts b/src/components/video-editor/projectPersistence.tsindex de03adf2b..27bc05b64 100644--- a/src/components/video-editor/projectPersistence.ts+++ b/src/components/video-editor/projectPersistence.ts@@ -1,5 +1,6 @@import { normalizeTextAnimation } from "@/lib/annotationTextAnimation";import { normalizeBlurColor, normalizeBlurType } from "@/lib/blurEffects";+import { normalizeCursorThemeId } from "@/lib/cursor/cursorThemes";import type { ExportFormat, ExportQuality, GifFrameRate, GifSizePreset } from "@/lib/exporter";import type { ProjectMedia } from "@/lib/recordingSession";import { normalizeProjectMedia } from "@/lib/recordingSession";@@ -89,6 +90,7 @@ export interface ProjectEditorState {gifFrameRate: GifFrameRate;gifLoop: boolean;gifSizePreset: GifSizePreset;+ cursorTheme: string;}export interface EditorProjectData {@@ -443,6 +445,7 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): Proconst cropHeight = clamp(rawCropHeight, 0.01, 1 - cropY);return {+ cursorTheme: normalizeCursorThemeId(editor.cursorTheme),wallpaper:typeof editor.wallpaper === "string"? normalizeWallpaperValue(editor.wallpaper)diff --git a/src/i18n/locales/ar/settings.json b/src/i18n/locales/ar/settings.jsonindex db62bb00e..a5c3183cc 100644--- a/src/i18n/locales/ar/settings.json+++ b/src/i18n/locales/ar/settings.json@@ -198,6 +198,8 @@"errorLoadFailed": "تعذر تحميل الخط. يرجى التحقق من صحة رابط خطوط Google."},"cursor": {+ "theme": "نمط المؤشر",+ "themeDefault": "افتراضي","show": "إظهار المؤشر","size": "الحجم","smoothing": "التنعيم",diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.jsonindex d4d6665a0..d6c7f4a04 100644--- a/src/i18n/locales/en/settings.json+++ b/src/i18n/locales/en/settings.json@@ -208,6 +208,8 @@"errorLoadFailed": "The font could not be loaded. Please verify the Google Fonts URL is correct."},"cursor": {+ "theme": "Cursor Style",+ "themeDefault": "Default","show": "Show Cursor","size": "Size","smoothing": "Smoothing",diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.jsonindex 7ec9fb548..5876908fc 100644--- a/src/i18n/locales/es/settings.json+++ b/src/i18n/locales/es/settings.json@@ -207,6 +207,8 @@"errorLoadFailed": "No se pudo cargar la fuente. Por favor verifica que la URL de Google Fonts sea correcta."},"cursor": {+ "theme": "Estilo del cursor",+ "themeDefault": "Predeterminado","show": "Mostrar cursor","size": "Tamaño","smoothing": "Suavizado",diff --git a/src/i18n/locales/fr/settings.json b/src/i18n/locales/fr/settings.jsonindex bf700f704..429eb1c21 100644--- a/src/i18n/locales/fr/settings.json+++ b/src/i18n/locales/fr/settings.json@@ -207,6 +207,8 @@"errorLoadFailed": "La police n'a pas pu être chargée. Vérifiez que l'URL Google Fonts est correcte."},"cursor": {+ "theme": "Style du curseur",+ "themeDefault": "Par défaut","show": "Afficher le curseur","size": "Taille","smoothing": "Lissage",diff --git a/src/i18n/locales/it/settings.json b/src/i18n/locales/it/settings.jsonindex fb1734718..5f986e0eb 100644--- a/src/i18n/locales/it/settings.json+++ b/src/i18n/locales/it/settings.json@@ -206,6 +206,8 @@"errorLoadFailed": "Impossibile caricare il font. Verifica che l'URL di Google Fonts sia corretto."},"cursor": {+ "theme": "Stile del cursore",+ "themeDefault": "Predefinito","show": "Mostra cursore","size": "Dimensione","smoothing": "Smussatura",diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.jsonindex 360e0d85b..3b7bb972a 100644--- a/src/i18n/locales/ja-JP/settings.json+++ b/src/i18n/locales/ja-JP/settings.json@@ -207,6 +207,8 @@"errorLoadFailed": "フォントを読み込めませんでした。GoogleフォントのURLが正しいことを確認してください。"},"cursor": {+ "theme": "カーソルのスタイル",+ "themeDefault": "デフォルト","show": "カーソルを表示","size": "サイズ","smoothing": "スムージング",diff --git a/src/i18n/locales/ko-KR/settings.json b/src/i18n/locales/ko-KR/settings.jsonindex 094eda566..7d4c62b7e 100644--- a/src/i18n/locales/ko-KR/settings.json+++ b/src/i18n/locales/ko-KR/settings.json@@ -207,6 +207,8 @@"errorLoadFailed": "폰트를 불러올 수 없습니다. Google Fonts URL이 올바른지 확인해 주세요."},"cursor": {+ "theme": "커서 스타일",+ "themeDefault": "기본","show": "커서 표시","size": "크기","smoothing": "부드러움",diff --git a/src/i18n/locales/pt-BR/settings.json b/src/i18n/locales/pt-BR/settings.jsonindex 6788bdb2e..5b25420fb 100644--- a/src/i18n/locales/pt-BR/settings.json+++ b/src/i18n/locales/pt-BR/settings.json@@ -191,6 +191,17 @@"errorTimeout": "A fonte demorou muito para carregar. Por favor, verifique a URL e tente novamente.","errorLoadFailed": "A fonte não pôde ser carregada. Por favor, verifique se a URL do Google Fonts está correta."},+ "cursor": {+ "theme": "Estilo do cursor",+ "themeDefault": "Padrão",+ "show": "Mostrar cursor",+ "size": "Tamanho",+ "smoothing": "Suavização",+ "motionBlur": "Desfoque de movimento",+ "clickBounce": "Rebote ao clicar",+ "clipToBounds": "Recortar à tela",+ "clipToBoundsDescription": "Mantém o cursor dentro do quadro do vídeo. Desative para permitir que o cursor ultrapasse as bordas — útil ao aplicar zoom ou ao deslocar."+ },"language": {"title": "Idioma"}diff --git a/src/i18n/locales/ru/settings.json b/src/i18n/locales/ru/settings.jsonindex 70e11168b..585b28e0a 100644--- a/src/i18n/locales/ru/settings.json+++ b/src/i18n/locales/ru/settings.json@@ -207,6 +207,8 @@"errorLoadFailed": "Не удалось загрузить шрифт. Пожалуйста, проверьте правильность URL Google Fonts."},"cursor": {+ "theme": "Стиль курсора",+ "themeDefault": "По умолчанию","show": "Показывать курсор","size": "Размер","smoothing": "Сглаживание",diff --git a/src/i18n/locales/tr/settings.json b/src/i18n/locales/tr/settings.jsonindex 6929480bf..555829967 100644--- a/src/i18n/locales/tr/settings.json+++ b/src/i18n/locales/tr/settings.json@@ -198,6 +198,8 @@"errorLoadFailed": "Yazı tipi yüklenemedi. Lütfen Google Fonts URL'sinin doğruluğunu kontrol edin."},"cursor": {+ "theme": "İmleç Stili",+ "themeDefault": "Varsayılan","show": "İmleci Göster","size": "Boyut","smoothing": "Yumuşatma",diff --git a/src/i18n/locales/vi/settings.json b/src/i18n/locales/vi/settings.jsonindex cfa7e774e..281d38cfd 100644--- a/src/i18n/locales/vi/settings.json+++ b/src/i18n/locales/vi/settings.json@@ -198,6 +198,8 @@"errorLoadFailed": "Không thể tải phông chữ. Vui lòng xác minh URL Google Fonts là chính xác."},"cursor": {+ "theme": "Kiểu con trỏ",+ "themeDefault": "Mặc định","show": "Hiện con trỏ","size": "Kích thước","smoothing": "Làm mượt",diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.jsonindex 2ee57cfdb..0f1601903 100644--- a/src/i18n/locales/zh-CN/settings.json+++ b/src/i18n/locales/zh-CN/settings.json@@ -198,6 +198,8 @@"errorLoadFailed": "无法加载该字体。请确认 Google Fonts URL 是否正确。"},"cursor": {+ "theme": "光标样式",+ "themeDefault": "默认","show": "显示光标","size": "大小","smoothing": "平滑",diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.jsonindex 35b804028..618f11742 100644--- a/src/i18n/locales/zh-TW/settings.json+++ b/src/i18n/locales/zh-TW/settings.json@@ -199,6 +199,8 @@"errorLoadFailed": "無法載入該字體。請確認 Google Fonts URL 是否正確。"},"cursor": {+ "theme": "游標樣式",+ "themeDefault": "預設","show": "顯示游標","size": "大小","smoothing": "平滑",diff --git a/src/lib/cursor/cursorThemes.ts b/src/lib/cursor/cursorThemes.tsnew file mode 100644index 000000000..8dbd2081a--- /dev/null+++ b/src/lib/cursor/cursorThemes.ts@@ -0,0 +1,422 @@+import type { NativeCursorType } from "@/native/contracts";++/**+ * A single themed cursor image override for one {@link NativeCursorType}.+ *+ * `width`/`height`/`hotspot*` are expressed in the same ~32-logical-pixel reference+ * used by the built-in `PRETTY_NATIVE_CURSOR_ASSETS` in `nativeCursor.ts`, so a theme+ * asset renders at the same on-screen size as the default cursor regardless of the+ * source PNG resolution. The PNG itself can be higher-res (e.g. 128×128) and is+ * downscaled at draw time for crisper retina output.+ */+export interface CursorThemeAsset {+ /** Path relative to the public asset root, e.g. "cursors/hello-kitty-watermelon/arrow.png". */+ assetPath: string;+ width: number;+ height: number;+ hotspotX: number;+ hotspotY: number;+}++export interface CursorTheme {+ id: string;+ /** Display label. Theme names are proper nouns, so they are not run through i18n. */+ name: string;+ /** Attribution / origin for the artwork. */+ source?: string;+ /**+ * Per-cursor-type overrides. Any type not present here falls back to the built-in+ * default cursor art. Sweezy packs only ship "arrow" and "pointer" art.+ */+ assets: Partial<Record<NativeCursorType, CursorThemeAsset>>;+}++/** Sentinel id for the built-in cursor art (no theme override). */+export const DEFAULT_CURSOR_THEME_ID = "default";++/**+ * Bundled cursor themes. To add a pack: drop `arrow.png`/`pointer.png` into+ * `public/cursors/<id>/` and add an entry here with hotspots normalized to the+ * 32-logical reference (divide a 128px-pack hotspot by 4). No renderer changes needed.+ */+export const CURSOR_THEMES: readonly CursorTheme[] = [+ {+ id: "hello-kitty-watermelon",+ name: "Hello Kitty & Watermelon",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/hello-kitty-watermelon/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/hello-kitty-watermelon/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 4,+ hotspotY: 2,+ },+ },+ },+ {+ id: "among-us-sus-knife-and-red-animated",+ name: "Among Us Sus Knife & Red Animated",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/among-us-sus-knife-and-red-animated/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1.6,+ hotspotY: 0.96,+ },+ pointer: {+ assetPath: "cursors/among-us-sus-knife-and-red-animated/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 12,+ hotspotY: 2,+ },+ },+ },+ {+ id: "black-and-rainbow-stroke-gradient-animated",+ name: "Black & Rainbow Stroke Gradient Animated",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/black-and-rainbow-stroke-gradient-animated/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1.6,+ hotspotY: 0.96,+ },+ pointer: {+ assetPath: "cursors/black-and-rainbow-stroke-gradient-animated/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 8,+ hotspotY: 1.5,+ },+ },+ },+ {+ id: "black-pixel",+ name: "Black Pixel",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/black-pixel/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 2,+ hotspotY: 3.5,+ },+ pointer: {+ assetPath: "cursors/black-pixel/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 8,+ hotspotY: 1.5,+ },+ },+ },+ {+ id: "christmas-miles-morales",+ name: "Christmas Miles Morales",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/christmas-miles-morales/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/christmas-miles-morales/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 5.5,+ hotspotY: 3,+ },+ },+ },+ {+ id: "hollow-knight-and-game-arrow",+ name: "Hollow Knight & Game Arrow",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/hollow-knight-and-game-arrow/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 0.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/hollow-knight-and-game-arrow/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 5,+ hotspotY: 0.5,+ },+ },+ },+ {+ id: "hollow-knight-nail-sword-and-mask",+ name: "Hollow Knight Nail Sword & Mask",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/hollow-knight-nail-sword-and-mask/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 0.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/hollow-knight-nail-sword-and-mask/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 3.5,+ hotspotY: 2,+ },+ },+ },+ {+ id: "naruto-akatsuki-cloud-arrow",+ name: "Naruto Akatsuki Cloud Arrow",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/naruto-akatsuki-cloud-arrow/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 0.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/naruto-akatsuki-cloud-arrow/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 1,+ hotspotY: 1,+ },+ },+ },+ {+ id: "old-roblox",+ name: "Old Roblox",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/old-roblox/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 2.5,+ hotspotY: 1.5,+ },+ pointer: {+ assetPath: "cursors/old-roblox/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 3.5,+ hotspotY: 1.5,+ },+ },+ },+ {+ id: "pink-glossy-arrow-and-hand-3d",+ name: "Pink Glossy Arrow & Hand 3D",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/pink-glossy-arrow-and-hand-3d/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1.5,+ hotspotY: 1.5,+ },+ pointer: {+ assetPath: "cursors/pink-glossy-arrow-and-hand-3d/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 3,+ hotspotY: 1,+ },+ },+ },+ {+ id: "pinky-pixel",+ name: "Pinky Pixel",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/pinky-pixel/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 0.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/pinky-pixel/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 7,+ hotspotY: 1,+ },+ },+ },+ {+ id: "pokemon-neon-gengar",+ name: "Pokemon Neon Gengar",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/pokemon-neon-gengar/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/pokemon-neon-gengar/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 2,+ hotspotY: 2.5,+ },+ },+ },+ {+ id: "sanrio-gudetama-and-arrow-kawaii",+ name: "Sanrio Gudetama & Arrow Kawaii",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/sanrio-gudetama-and-arrow-kawaii/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 0.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/sanrio-gudetama-and-arrow-kawaii/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 8,+ hotspotY: 4,+ },+ },+ },+ {+ id: "spring-gradient",+ name: "Spring Gradient",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/spring-gradient/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/spring-gradient/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 8,+ hotspotY: 0.5,+ },+ },+ },+ {+ id: "mickey-mouse-black-hand-inflated-glove",+ name: "Mickey Mouse Black Hand Inflated Glove",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/mickey-mouse-black-hand-inflated-glove/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 2.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/mickey-mouse-black-hand-inflated-glove/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 10,+ hotspotY: 0.5,+ },+ },+ },+ {+ id: "sanrio-kuromi-skull-arrow",+ name: "Sanrio Kuromi Skull Arrow",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/sanrio-kuromi-skull-arrow/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 1.5,+ hotspotY: 0.5,+ },+ pointer: {+ assetPath: "cursors/sanrio-kuromi-skull-arrow/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 9.5,+ hotspotY: 1,+ },+ },+ },+ {+ id: "solo-leveling-sung-jinwoo-dark-flames",+ name: "Solo Leveling Sung Jinwoo Dark Flames",+ source: "sweezy-cursors.com",+ assets: {+ arrow: {+ assetPath: "cursors/solo-leveling-sung-jinwoo-dark-flames/arrow.png",+ width: 32,+ height: 32,+ hotspotX: 2,+ hotspotY: 1,+ },+ pointer: {+ assetPath: "cursors/solo-leveling-sung-jinwoo-dark-flames/pointer.png",+ width: 32,+ height: 32,+ hotspotX: 7,+ hotspotY: 4.5,+ },+ },+ },+];++/** All selectable theme ids, including the built-in default. */+export const CURSOR_THEME_IDS: ReadonlySet<string> = new Set([+ DEFAULT_CURSOR_THEME_ID,+ ...CURSOR_THEMES.map((theme) => theme.id),+]);++/** Returns the theme for `id`, or null for the default / unknown ids. */+export function getCursorTheme(id: string | null | undefined): CursorTheme | null {+ if (!id || id === DEFAULT_CURSOR_THEME_ID) {+ return null;+ }+ return CURSOR_THEMES.find((theme) => theme.id === id) ?? null;+}++/**+ * Normalizes a persisted/incoming theme id to a known value, falling back to the+ * default for anything unrecognized.+ */+export function normalizeCursorThemeId(id: unknown): string {+ return typeof id === "string" && CURSOR_THEME_IDS.has(id) ? id : DEFAULT_CURSOR_THEME_ID;+}diff --git a/src/lib/cursor/nativeCursor.test.ts b/src/lib/cursor/nativeCursor.test.tsindex 3e7a6760f..eb1ef5305 100644--- a/src/lib/cursor/nativeCursor.test.ts+++ b/src/lib/cursor/nativeCursor.test.ts@@ -101,3 +101,119 @@ describe("native cursor click bounce", () => {expect(getNativeCursorClickBounceProgress(recordingData, 133)).toBeGreaterThan(0);});});++describe("custom cursor themes", () => {+ const arrowAsset: NativeCursorAsset = {+ id: "telemetry-arrow",+ platform: "darwin",+ imageDataUrl: "default-arrow",+ width: 32,+ height: 32,+ hotspotX: 16,+ hotspotY: 15,+ cursorType: "arrow",+ };++ it("substitutes the themed art for an overridden cursor type", () => {+ const rendered = resolveNativeCursorRenderAsset(+ arrowAsset,+ 1,+ { timeMs: 0, cx: 0.5, cy: 0.5, cursorType: "arrow" },+ "hello-kitty-watermelon",+ );++ expect(rendered.id).toBe("theme:hello-kitty-watermelon:arrow");+ expect(rendered.imageDataUrl).toContain("cursors/hello-kitty-watermelon/arrow.png");+ expect(rendered.width).toBe(32);+ expect(rendered.hotspotX).toBeCloseTo(1.5);+ });++ it("classifies an untyped macOS arrow bitmap (top-left hotspot) as the themed arrow", () => {+ const macArrow: NativeCursorAsset = {+ id: "sha-arrow",+ platform: "darwin",+ imageDataUrl: "captured-bitmap",+ width: 34,+ height: 46,+ hotspotX: 8,+ hotspotY: 8,+ scaleFactor: 2,+ };+ const rendered = resolveNativeCursorRenderAsset(+ macArrow,+ 1,+ { timeMs: 0, cx: 0.5, cy: 0.5 },+ "hello-kitty-watermelon",+ );++ expect(rendered.id).toBe("theme:hello-kitty-watermelon:arrow");+ expect(rendered.imageDataUrl).toContain("cursors/hello-kitty-watermelon/arrow.png");+ });++ it("classifies an untyped macOS hand bitmap (upper-center hotspot) as the themed pointer", () => {+ const macHand: NativeCursorAsset = {+ id: "sha-hand",+ platform: "darwin",+ imageDataUrl: "captured-bitmap",+ width: 64,+ height: 64,+ hotspotX: 26,+ hotspotY: 16,+ scaleFactor: 2,+ };+ const rendered = resolveNativeCursorRenderAsset(+ macHand,+ 1,+ { timeMs: 0, cx: 0.5, cy: 0.5 },+ "hello-kitty-watermelon",+ );++ expect(rendered.id).toBe("theme:hello-kitty-watermelon:pointer");+ expect(rendered.imageDataUrl).toContain("cursors/hello-kitty-watermelon/pointer.png");+ });++ it("leaves an untyped text/crosshair bitmap (centered hotspot) as the real captured cursor", () => {+ const macText: NativeCursorAsset = {+ id: "sha-text",+ platform: "darwin",+ imageDataUrl: "captured-ibeam",+ width: 18,+ height: 36,+ hotspotX: 8,+ hotspotY: 18,+ scaleFactor: 2,+ };+ const rendered = resolveNativeCursorRenderAsset(+ macText,+ 1,+ { timeMs: 0, cx: 0.5, cy: 0.5 },+ "hello-kitty-watermelon",+ );++ expect(rendered.id).toBe("sha-text");+ expect(rendered.imageDataUrl).toBe("captured-ibeam");+ });++ it("keeps the default art for the default theme id", () => {+ const rendered = resolveNativeCursorRenderAsset(+ arrowAsset,+ 1,+ { timeMs: 0, cx: 0.5, cy: 0.5, cursorType: "arrow" },+ "default",+ );++ expect(rendered.id).toBe("pretty:arrow");+ expect(rendered.imageDataUrl).not.toContain("hello-kitty-watermelon");+ });++ it("falls back to default art for a cursor type the theme does not override", () => {+ const rendered = resolveNativeCursorRenderAsset(+ { ...arrowAsset, cursorType: "text" },+ 1,+ { timeMs: 0, cx: 0.5, cy: 0.5, cursorType: "text" },+ "hello-kitty-watermelon",+ );++ expect(rendered.id).toBe("pretty:text");+ });+});diff --git a/src/lib/cursor/nativeCursor.ts b/src/lib/cursor/nativeCursor.tsindex f20fd4259..c2afacd1f 100644--- a/src/lib/cursor/nativeCursor.ts+++ b/src/lib/cursor/nativeCursor.ts@@ -16,6 +16,8 @@ import textUrl from "@/assets/cursors/Cursor=Text-Cursor.svg";import upArrowUrl from "@/assets/cursors/Cursor=Up-Arrow.svg";import waitUrl from "@/assets/cursors/Cursor=Wait.svg";import type { CropRegion } from "@/components/video-editor/types";+import { getAssetPath } from "@/lib/assetPath";+import { DEFAULT_CURSOR_THEME_ID, getCursorTheme } from "@/lib/cursor/cursorThemes";import type {CursorRecordingData,CursorRecordingSample,@@ -592,11 +594,83 @@ export function resolvePrettyNativeCursorAsset(: resolveUntypedPrettyNativeCursorAsset(asset);}+/**+ * Infers "arrow" vs "pointer" from a captured cursor bitmap's hotspot, for platforms+ * (notably macOS) that don't tag samples with a `cursorType`. The arrow's hotspot sits+ * in the top-left tip; the pointing hand's fingertip hotspot sits in the upper-center+ * band. Anything else (text I-beam, crosshair, resize) is left unclassified so it keeps+ * its real captured cursor instead of being forced into a themed arrow/pointer.+ */+function classifyCapturedCursorType(asset: NativeCursorAsset): NativeCursorType | null {+ if (asset.width <= 0 || asset.height <= 0) {+ return null;+ }+ const hotspotXNorm = asset.hotspotX / asset.width;+ const hotspotYNorm = asset.hotspotY / asset.height;+ if (hotspotXNorm < 0.33 && hotspotYNorm < 0.33) {+ return "arrow";+ }+ if (hotspotYNorm < 0.4 && hotspotXNorm >= 0.33 && hotspotXNorm <= 0.6) {+ return "pointer";+ }+ return null;+}++/**+ * Resolves the cursor-theme override for a given type, or null when the default+ * theme is active or the theme has no art for that type. The bundled asset URL is+ * resolved lazily (only when a theme is active) so this is safe to call from tests+ * and non-renderer contexts. A resolution failure degrades to the default art.+ */+function resolveThemedCursorAsset(+ themeId: string | null | undefined,+ cursorType: NativeCursorType,+): PrettyNativeCursorAsset | null {+ if (!themeId || themeId === DEFAULT_CURSOR_THEME_ID) {+ return null;+ }+ const themeAsset = getCursorTheme(themeId)?.assets[cursorType];+ if (!themeAsset) {+ return null;+ }+ try {+ return {+ imageDataUrl: getAssetPath(themeAsset.assetPath),+ width: themeAsset.width,+ height: themeAsset.height,+ hotspotX: themeAsset.hotspotX,+ hotspotY: themeAsset.hotspotY,+ };+ } catch {+ return null;+ }+}+export function resolveNativeCursorRenderAsset(asset: NativeCursorAsset,deviceScaleFactor: number,sample?: CursorRecordingSample,+ themeId?: string | null,) {+ const cursorType = sample?.cursorType ?? asset.cursorType ?? null;+ if (themeId && themeId !== DEFAULT_CURSOR_THEME_ID) {+ // A known type uses its override when the theme provides one. Untyped samples —+ // common on macOS, where the cursor type isn't tagged — are classified from the+ // captured bitmap's hotspot so arrow→themed-arrow and hand→themed-pointer.+ const themedType = cursorType ?? classifyCapturedCursorType(asset);+ const themedAsset = themedType ? resolveThemedCursorAsset(themeId, themedType) : null;+ if (themedAsset && themedType) {+ return {+ id: `theme:${themeId}:${themedType}`,+ imageDataUrl: themedAsset.imageDataUrl,+ width: themedAsset.width,+ height: themedAsset.height,+ hotspotX: themedAsset.hotspotX,+ hotspotY: themedAsset.hotspotY,+ };+ }+ }+const prettyAsset = resolvePrettyNativeCursorAsset(asset, sample);if (prettyAsset) {return {diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.tsindex 36f8c0bfc..95943fde4 100644--- a/src/lib/exporter/frameRenderer.ts+++ b/src/lib/exporter/frameRenderer.ts@@ -94,6 +94,7 @@ interface FrameRenderConfig {cursorMotionBlur?: number;cursorClickBounce?: number;cursorClipToBounds?: boolean;+ cursorTheme?: string;videoWidth: number;videoHeight: number;webcamSize?: Size | null;@@ -584,7 +585,12 @@ export class FrameRenderer {return;}- const renderAsset = resolveNativeCursorRenderAsset(activeNativeCursor.asset, 1, displaySample);+ const renderAsset = resolveNativeCursorRenderAsset(+ activeNativeCursor.asset,+ 1,+ displaySample,+ this.config.cursorTheme,+ );let image: HTMLImageElement;try {image = await this.getCursorImage(renderAsset);diff --git a/src/lib/exporter/gifExporter.ts b/src/lib/exporter/gifExporter.tsindex 42cf1da8d..649511b66 100644--- a/src/lib/exporter/gifExporter.ts+++ b/src/lib/exporter/gifExporter.ts@@ -55,6 +55,7 @@ interface GifExporterConfig {cursorMotionBlur?: number;cursorClickBounce?: number;cursorClipToBounds?: boolean;+ cursorTheme?: string;annotationRegions?: AnnotationRegion[];previewWidth?: number;previewHeight?: number;@@ -164,6 +165,7 @@ export class GifExporter {cursorMotionBlur: this.config.cursorMotionBlur,cursorClickBounce: this.config.cursorClickBounce,cursorClipToBounds: this.config.cursorClipToBounds,+ cursorTheme: this.config.cursorTheme,videoWidth: videoInfo.width,videoHeight: videoInfo.height,webcamSize: webcamInfo ? { width: webcamInfo.width, height: webcamInfo.height } : null,diff --git a/src/lib/exporter/videoExporter.ts b/src/lib/exporter/videoExporter.tsindex f5ac02d19..ac12273ee 100644--- a/src/lib/exporter/videoExporter.ts+++ b/src/lib/exporter/videoExporter.ts@@ -46,6 +46,7 @@ export interface VideoExporterConfig extends ExportConfig {cursorMotionBlur?: number;cursorClickBounce?: number;cursorClipToBounds?: boolean;+ cursorTheme?: string;annotationRegions?: AnnotationRegion[];previewWidth?: number;previewHeight?: number;@@ -244,6 +245,7 @@ export class VideoExporter {cursorMotionBlur: this.config.cursorMotionBlur,cursorClickBounce: this.config.cursorClickBounce,cursorClipToBounds: this.config.cursorClipToBounds,+ cursorTheme: this.config.cursorTheme,videoWidth: videoInfo.width,videoHeight: videoInfo.height,webcamSize: webcamInfo ? { width: webcamInfo.width, height: webcamInfo.height } : null,