Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fmt

Richie McIlroy634a8f0250c4
diff --git a/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx b/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
index 142c9a33d..e75405765 100644
--- a/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
@@ -208,59 +208,59 @@ const createDisplaySignature = (
type TargetMenuPanelProps =
| {
- variant: "display";
- targets?: CaptureDisplayWithThumbnail[];
- onSelect: (target: CaptureDisplayWithThumbnail) => void;
- }
+ variant: "display";
+ targets?: CaptureDisplayWithThumbnail[];
+ onSelect: (target: CaptureDisplayWithThumbnail) => void;
+ }
| {
- variant: "window";
- targets?: CaptureWindowWithThumbnail[];
- onSelect: (target: CaptureWindowWithThumbnail) => void;
- }
+ variant: "window";
+ targets?: CaptureWindowWithThumbnail[];
+ onSelect: (target: CaptureWindowWithThumbnail) => void;
+ }
| {
- variant: "recording";
- targets?: RecordingWithPath[];
- onSelect: (target: RecordingWithPath) => void;
- onViewAll: () => void;
- uploadProgress?: Record<string, number>;
- reuploadingPaths?: Set<string>;
- onReupload?: (path: string) => void;
- onRefetch?: () => void;
- }
+ variant: "recording";
+ targets?: RecordingWithPath[];
+ onSelect: (target: RecordingWithPath) => void;
+ onViewAll: () => void;
+ uploadProgress?: Record<string, number>;
+ reuploadingPaths?: Set<string>;
+ onReupload?: (path: string) => void;
+ onRefetch?: () => void;
+ }
| {
- variant: "screenshot";
- targets?: ScreenshotWithPath[];
- onSelect: (target: ScreenshotWithPath) => void;
- onViewAll: () => void;
- }
+ variant: "screenshot";
+ targets?: ScreenshotWithPath[];
+ onSelect: (target: ScreenshotWithPath) => void;
+ onViewAll: () => void;
+ }
| {
- variant: "camera";
- targets?: CameraWithDetails[];
- selectedTarget: CameraWithDetails | null;
- onSelect: (target: CameraWithDetails | null) => void;
- permissions?: OSPermissionsCheck;
- deviceSettings?: RecordingDeviceSettingsStore;
- onCameraSettingsChange: (
- camera: CameraWithDetails,
- settings: CameraDeviceSettings,
- ) => void;
- compatibilityStudioMode: boolean;
- initialSettingsTarget?: CameraWithDetails | null;
- }
+ variant: "camera";
+ targets?: CameraWithDetails[];
+ selectedTarget: CameraWithDetails | null;
+ onSelect: (target: CameraWithDetails | null) => void;
+ permissions?: OSPermissionsCheck;
+ deviceSettings?: RecordingDeviceSettingsStore;
+ onCameraSettingsChange: (
+ camera: CameraWithDetails,
+ settings: CameraDeviceSettings,
+ ) => void;
+ compatibilityStudioMode: boolean;
+ initialSettingsTarget?: CameraWithDetails | null;
+ }
| {
- variant: "microphone";
- targets?: MicrophoneWithDetails[];
- selectedTarget: MicrophoneWithDetails | null;
- onSelect: (target: MicrophoneWithDetails | null) => void;
- permissions?: OSPermissionsCheck;
- deviceSettings?: RecordingDeviceSettingsStore;
- onMicrophoneSettingsChange: (
- key: string,
- settings: MicrophoneDeviceSettings,
- ) => void;
- compatibilityStudioMode: boolean;
- initialSettingsTarget?: MicrophoneWithDetails | null;
- };
+ variant: "microphone";
+ targets?: MicrophoneWithDetails[];
+ selectedTarget: MicrophoneWithDetails | null;
+ onSelect: (target: MicrophoneWithDetails | null) => void;
+ permissions?: OSPermissionsCheck;
+ deviceSettings?: RecordingDeviceSettingsStore;
+ onMicrophoneSettingsChange: (
+ key: string,
+ settings: MicrophoneDeviceSettings,
+ ) => void;
+ compatibilityStudioMode: boolean;
+ initialSettingsTarget?: MicrophoneWithDetails | null;
+ };
type SharedTargetMenuProps = {
isLoading: boolean;
@@ -271,41 +271,41 @@ type SharedTargetMenuProps = {
type DeviceListPanelProps =
| {
- variant: "camera";
- targets: CameraWithDetails[];
- selectedTarget: CameraWithDetails | null;
- onSelect: (target: CameraWithDetails | null) => void;
- isLoading?: boolean;
- errorMessage?: string;
- disabled?: boolean;
- emptyMessage?: string;
- permissions?: OSPermissionsCheck;
- deviceSettings?: RecordingDeviceSettingsStore;
- onCameraSettingsChange: (
- camera: CameraWithDetails,
- settings: CameraDeviceSettings,
- ) => void;
- compatibilityStudioMode: boolean;
- initialSettingsTarget?: CameraWithDetails | null;
- }
+ variant: "camera";
+ targets: CameraWithDetails[];
+ selectedTarget: CameraWithDetails | null;
+ onSelect: (target: CameraWithDetails | null) => void;
+ isLoading?: boolean;
+ errorMessage?: string;
+ disabled?: boolean;
+ emptyMessage?: string;
+ permissions?: OSPermissionsCheck;
+ deviceSettings?: RecordingDeviceSettingsStore;
+ onCameraSettingsChange: (
+ camera: CameraWithDetails,
+ settings: CameraDeviceSettings,
+ ) => void;
+ compatibilityStudioMode: boolean;
+ initialSettingsTarget?: CameraWithDetails | null;
+ }
| {
- variant: "microphone";
- targets: MicrophoneWithDetails[];
- selectedTarget: MicrophoneWithDetails | null;
- onSelect: (target: MicrophoneWithDetails | null) => void;
- isLoading?: boolean;
- errorMessage?: string;
- disabled?: boolean;
- emptyMessage?: string;
- permissions?: OSPermissionsCheck;
- deviceSettings?: RecordingDeviceSettingsStore;
- onMicrophoneSettingsChange: (
- key: string,
- settings: MicrophoneDeviceSettings,
- ) => void;
- compatibilityStudioMode: boolean;
- initialSettingsTarget?: MicrophoneWithDetails | null;
- };
+ variant: "microphone";
+ targets: MicrophoneWithDetails[];
+ selectedTarget: MicrophoneWithDetails | null;
+ onSelect: (target: MicrophoneWithDetails | null) => void;
+ isLoading?: boolean;
+ errorMessage?: string;
+ disabled?: boolean;
+ emptyMessage?: string;
+ permissions?: OSPermissionsCheck;
+ deviceSettings?: RecordingDeviceSettingsStore;
+ onMicrophoneSettingsChange: (
+ key: string,
+ settings: MicrophoneDeviceSettings,
+ ) => void;
+ compatibilityStudioMode: boolean;
+ initialSettingsTarget?: MicrophoneWithDetails | null;
+ };
function CameraListItem(props: {
camera: CameraWithDetails;
@@ -533,7 +533,7 @@ function CameraSettingsPanel(props: {
props.value?.width === format.width &&
props.value?.height === format.height &&
Math.round(props.value?.frameRate ?? 0) ===
- Math.round(format.frameRate ?? 0);
+ Math.round(format.frameRate ?? 0);
return (
<div class="flex flex-col gap-3">
@@ -1694,7 +1694,7 @@ function Page() {
await commands.uploadExportedVideo(
path,
"Reupload",
- new Channel<UploadProgress>(() => { }),
+ new Channel<UploadProgress>(() => {}),
null,
);
} finally {
@@ -2174,7 +2174,8 @@ function Page() {
await commands.stopRecording();
} catch (error) {
await dialog.message(
- `Failed to stop recording: ${error instanceof Error ? error.message : String(error)
+ `Failed to stop recording: ${
+ error instanceof Error ? error.message : String(error)
}`,
{ title: "Stop Recording", kind: "error" },
);
@@ -2282,7 +2283,7 @@ function Page() {
class={cx(
"flex flex-1 overflow-hidden rounded-lg border border-gray-5 bg-gray-3 ring-1 ring-transparent ring-offset-2 ring-offset-gray-1 transition focus-within:ring-blue-9 focus-within:ring-offset-2 focus-within:ring-offset-gray-1",
(rawOptions.targetMode === "display" || displayMenuOpen()) &&
- "ring-blue-9",
+ "ring-blue-9",
)}
>
<TargetTypeButton
@@ -2324,7 +2325,7 @@ function Page() {
class={cx(
"flex flex-1 overflow-hidden rounded-lg border border-gray-5 bg-gray-3 ring-1 ring-transparent ring-offset-2 ring-offset-gray-1 transition focus-within:ring-blue-9 focus-within:ring-offset-2 focus-within:ring-offset-gray-1",
(rawOptions.targetMode === "window" || windowMenuOpen()) &&
- "ring-blue-9",
+ "ring-blue-9",
)}
>
<TargetTypeButton
@@ -2400,7 +2401,7 @@ function Page() {
}
}
- await signIn.mutateAsync(abort).catch(() => { });
+ await signIn.mutateAsync(abort).catch(() => {});
for (const win of await getAllWebviewWindows()) {
if (win.label.startsWith("target-select-overlay")) {
diff --git a/apps/desktop/src/routes/editor/ConfigSidebar.tsx b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
index 175f6a634..3bfb1fd7d 100644
--- a/apps/desktop/src/routes/editor/ConfigSidebar.tsx
+++ b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
@@ -311,11 +311,11 @@ const findCursorPreset = (
(option) =>
option.preset &&
Math.abs(option.preset.tension - values.tension) <=
- CURSOR_PRESET_TOLERANCE.tension &&
+ CURSOR_PRESET_TOLERANCE.tension &&
Math.abs(option.preset.mass - values.mass) <=
- CURSOR_PRESET_TOLERANCE.mass &&
+ CURSOR_PRESET_TOLERANCE.mass &&
Math.abs(option.preset.friction - values.friction) <=
- CURSOR_PRESET_TOLERANCE.friction,
+ CURSOR_PRESET_TOLERANCE.friction,
);
return preset?.value ?? null;
@@ -462,7 +462,7 @@ export function ConfigSidebar() {
class={cx(
"flex justify-center relative border-transparent border z-10 items-center rounded-md size-9 transition will-change-transform",
state.selectedTab !== item.id &&
- "group-hover:border-gray-300 group-disabled:border-none",
+ "group-hover:border-gray-300 group-disabled:border-none",
)}
>
<Dynamic component={item.icon} />
@@ -1786,13 +1786,17 @@ function BackgroundConfig(props: {
ref={setBackgroundRef}
class="flex overflow-x-auto overscroll-contain relative z-10 flex-row gap-2 items-center mb-3 text-xs hide-scroll"
style={{
- "-webkit-mask-image": `linear-gradient(to right, transparent, black ${scrollX() > 0 ? "24px" : "0"
- }, black calc(100% - ${reachedEndOfScroll() ? "0px" : "24px"
- }), transparent)`,
-
- "mask-image": `linear-gradient(to right, transparent, black ${scrollX() > 0 ? "24px" : "0"
- }, black calc(100% - ${reachedEndOfScroll() ? "0px" : "24px"
- }), transparent);`,
+ "-webkit-mask-image": `linear-gradient(to right, transparent, black ${
+ scrollX() > 0 ? "24px" : "0"
+ }, black calc(100% - ${
+ reachedEndOfScroll() ? "0px" : "24px"
+ }), transparent)`,
+
+ "mask-image": `linear-gradient(to right, transparent, black ${
+ scrollX() > 0 ? "24px" : "0"
+ }, black calc(100% - ${
+ reachedEndOfScroll() ? "0px" : "24px"
+ }), transparent);`,
}}
>
<For each={Object.entries(BACKGROUND_THEMES)}>
@@ -1819,10 +1823,10 @@ function BackgroundConfig(props: {
value={
project.background.source.type === "wallpaper"
? (wallpapers()?.find((w) =>
- (
- project.background.source as { path?: string }
- ).path?.includes(w.id),
- )?.url ?? undefined)
+ (
+ project.background.source as { path?: string }
+ ).path?.includes(w.id),
+ )?.url ?? undefined)
: undefined
}
onChange={(photoUrl) => {
@@ -3356,7 +3360,8 @@ function ZoomSegmentPreview(props: {
createEffect(() => {
// TODO: make this not hardcoded
const path = convertFileSrc(
- `${editorInstance.path}/content/segments/segment-${clipSegment()?.recordingSegment ?? 0
+ `${editorInstance.path}/content/segments/segment-${
+ clipSegment()?.recordingSegment ?? 0
}/display.mp4`,
);
video.src = path;
@@ -3559,7 +3564,8 @@ function ZoomSegmentConfig(props: {
createEffect(() => {
const path = convertFileSrc(
// TODO: this shouldn't be so hardcoded
- `${editorInstance.path
+ `${
+ editorInstance.path
}/content/segments/segment-${segmentIndex()}/display.mp4`,
);
video.src = path;
@@ -3689,7 +3695,7 @@ function ZoomSegmentConfig(props: {
x: Math.max(
Math.min(
(moveEvent.clientX - bounds.left) /
- bounds.width,
+ bounds.width,
1,
),
0,
@@ -3697,7 +3703,7 @@ function ZoomSegmentConfig(props: {
y: Math.max(
Math.min(
(moveEvent.clientY - bounds.top) /
- bounds.height,
+ bounds.height,
1,
),
0,
diff --git a/apps/desktop/src/routes/screenshot-editor/Editor.tsx b/apps/desktop/src/routes/screenshot-editor/Editor.tsx
index ae0ea1800..ad0402d74 100644
--- a/apps/desktop/src/routes/screenshot-editor/Editor.tsx
+++ b/apps/desktop/src/routes/screenshot-editor/Editor.tsx
@@ -259,17 +259,17 @@ function Dialogs() {
const existingCrop = cropDialog().currentCrop;
const initialBounds = existingCrop
? {
- x: existingCrop.position.x,
- y: existingCrop.position.y,
- width: existingCrop.size.x,
- height: existingCrop.size.y,
- }
+ x: existingCrop.position.x,
+ y: existingCrop.position.y,
+ width: existingCrop.size.x,
+ height: existingCrop.size.y,
+ }
: {
- x: 0,
- y: 0,
- width: originalSize.x,
- height: originalSize.y,
- };
+ x: 0,
+ y: 0,
+ width: originalSize.x,
+ height: originalSize.y,
+ };
const previewSize = () => {
const srcW = originalSize.x;
diff --git a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/CameraPreviewWindow.tsx b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/CameraPreviewWindow.tsx
index 44a432bc2..16a4264a7 100644
--- a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/CameraPreviewWindow.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/CameraPreviewWindow.tsx
@@ -438,9 +438,9 @@ export const CameraPreviewWindow = ({
const totalHeight = metrics.height + BAR_HEIGHT;
const videoStyle = videoDimensions
? {
- transform: mirrored ? "scaleX(-1)" : "scaleX(1)",
- opacity: isInPictureInPicture ? 0 : 1,
- }
+ transform: mirrored ? "scaleX(-1)" : "scaleX(1)",
+ opacity: isInPictureInPicture ? 0 : 1,
+ }
: { opacity: 0 };
// Keep the video node rendered even in PiP mode so the track keeps producing frames.
diff --git a/apps/web/app/s/[videoId]/_components/video/media-player.tsx b/apps/web/app/s/[videoId]/_components/video/media-player.tsx
index b3ba470ce..97287c5da 100644
--- a/apps/web/app/s/[videoId]/_components/video/media-player.tsx
+++ b/apps/web/app/s/[videoId]/_components/video/media-player.tsx
@@ -138,7 +138,7 @@ function useMediaSelector<T>(selector: (state: Partial<MediaState>) => T): T {
const subscribe = React.useCallback(
(cb: () => void) => {
- if (!store?.subscribe) return () => { };
+ if (!store?.subscribe) return () => {};
return store.subscribe(cb);
},
[store],
@@ -1347,7 +1347,7 @@ function MediaPlayerControlsOverlay(props: MediaPlayerControlsOverlayProps) {
);
}
-interface MediaPlayerPlayProps extends React.ComponentProps<typeof Button> { }
+interface MediaPlayerPlayProps extends React.ComponentProps<typeof Button> {}
function MediaPlayerPlay(props: MediaPlayerPlayProps) {
const { asChild, children, className, disabled, ...playButtonProps } = props;
@@ -1540,8 +1540,8 @@ interface MediaPlayerSeekProps
tooltipSideOffset?: number;
tooltipCollisionBoundary?: Element | Element[];
tooltipCollisionPadding?:
- | number
- | Partial<Record<"top" | "right" | "bottom" | "left", number>>;
+ | number
+ | Partial<Record<"top" | "right" | "bottom" | "left", number>>;
}
function MediaPlayerSeek(props: MediaPlayerSeekProps) {
@@ -1669,11 +1669,11 @@ function MediaPlayerSeek(props: MediaPlayerSeekProps) {
const padding =
typeof tooltipCollisionPadding === "number"
? {
- top: tooltipCollisionPadding,
- right: tooltipCollisionPadding,
- bottom: tooltipCollisionPadding,
- left: tooltipCollisionPadding,
- }
+ top: tooltipCollisionPadding,
+ right: tooltipCollisionPadding,
+ bottom: tooltipCollisionPadding,
+ left: tooltipCollisionPadding,
+ }
: { top: 0, right: 0, bottom: 0, left: 0, ...tooltipCollisionPadding };
const boundaries = tooltipCollisionBoundary
@@ -2599,9 +2599,9 @@ function MediaPlayerTime(props: MediaPlayerTimeProps) {
interface MediaPlayerPlaybackSpeedProps
extends React.ComponentProps<typeof DropdownMenuTrigger>,
- React.ComponentProps<typeof Button>,
- Omit<React.ComponentProps<typeof DropdownMenu>, "dir">,
- Pick<React.ComponentProps<typeof DropdownMenuContent>, "sideOffset"> {
+ React.ComponentProps<typeof Button>,
+ Omit<React.ComponentProps<typeof DropdownMenu>, "dir">,
+ Pick<React.ComponentProps<typeof DropdownMenuContent>, "sideOffset"> {
speeds?: number[];
}
@@ -2689,7 +2689,7 @@ function MediaPlayerPlaybackSpeed(props: MediaPlayerPlaybackSpeedProps) {
);
}
-interface MediaPlayerLoopProps extends React.ComponentProps<typeof Button> { }
+interface MediaPlayerLoopProps extends React.ComponentProps<typeof Button> {}
function MediaPlayerLoop(props: MediaPlayerLoopProps) {
const { children, className, disabled, ...loopProps } = props;
@@ -2765,7 +2765,7 @@ function MediaPlayerLoop(props: MediaPlayerLoopProps) {
}
interface MediaPlayerFullscreenProps
- extends React.ComponentProps<typeof Button> { }
+ extends React.ComponentProps<typeof Button> {}
function MediaPlayerFullscreen(props: MediaPlayerFullscreenProps) {
const { children, className, disabled, ...fullscreenProps } = props;
@@ -3046,7 +3046,7 @@ function EnhancedAudioSync({
audio.pause();
return;
}
- audio.play().catch(() => { });
+ audio.play().catch(() => {});
};
const handlePause = () => {
@@ -3097,7 +3097,7 @@ function EnhancedAudioSync({
if (enhancedAudioMuted) {
audio.pause();
} else {
- audio.play().catch(() => { });
+ audio.play().catch(() => {});
}
}
@@ -3124,7 +3124,7 @@ function EnhancedAudioSync({
}
interface MediaPlayerDownloadProps
- extends React.ComponentProps<typeof Button> { }
+ extends React.ComponentProps<typeof Button> {}
function MediaPlayerDownload(props: MediaPlayerDownloadProps) {
const { children, className, disabled, ...downloadProps } = props;
@@ -3422,8 +3422,8 @@ function MediaPlayerSettings(props: MediaPlayerSettingsProps) {
: captionLanguage === "original"
? "Original"
: (availableCaptions.find(
- (c) => c.code === captionLanguage,
- )?.name ?? captionLanguage)}
+ (c) => c.code === captionLanguage,
+ )?.name ?? captionLanguage)}
</Badge>
</DropdownMenuSubTrigger>
<DropdownMenuSubContent className="max-h-64 overflow-y-auto">
@@ -3477,7 +3477,7 @@ function MediaPlayerPortal(props: MediaPlayerPortalProps) {
interface MediaPlayerTooltipProps
extends React.ComponentProps<typeof Tooltip>,
- Pick<React.ComponentProps<typeof TooltipContent>, "sideOffset"> {
+ Pick<React.ComponentProps<typeof TooltipContent>, "sideOffset"> {
tooltip?: string;
shortcut?: string | string[];
}