🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots 📖
TypeScript browser-extensionchrome-extensiondocumentationfirefox-extensionguide-generatorlocal-firstmanifest-v3privacy-firstproductivityreactscreenshotstep-by-step-guidetutorialtypescriptworkflowwxt
feat(editor): offer edited and original downloads and label the target menu by state
Luis Ortiz78709b9f95b6
diff --git a/src/locales/en.yml b/src/locales/en.ymlindex 6f2c6b6..a72bf09 100644--- a/src/locales/en.yml+++ b/src/locales/en.yml@@ -163,6 +163,9 @@ screenshotView:saved: SavededitMenu: Edit screenshotclickTarget: Click target+ editClickTarget: "Edit click target"+ downloadEdited: "Edited image"+ downloadOriginal: "Original image"annotate: Annotateredact: Redactcrop: Cropdiff --git a/src/locales/es.yml b/src/locales/es.ymlindex 161a8b9..3eefc94 100644--- a/src/locales/es.yml+++ b/src/locales/es.yml@@ -163,6 +163,9 @@ screenshotView:saved: GuardadoeditMenu: Editar capturaclickTarget: Objetivo de clic+ editClickTarget: "Editar objetivo de clic"+ downloadEdited: "Imagen editada"+ downloadOriginal: "Imagen original"annotate: Anotarredact: Ocultarcrop: Recortardiff --git a/src/locales/fr.yml b/src/locales/fr.ymlindex 55f232e..cf5e228 100644--- a/src/locales/fr.yml+++ b/src/locales/fr.yml@@ -163,6 +163,9 @@ screenshotView:saved: "Enregistré"editMenu: "Modifier la capture"clickTarget: "Cible de clic"+ editClickTarget: "Modifier la cible de clic"+ downloadEdited: "Image modifiée"+ downloadOriginal: "Image originale"annotate: "Annoter"redact: "Masquer"crop: "Recadrer"diff --git a/src/locales/pt-BR.yml b/src/locales/pt-BR.ymlindex 192f073..0035d3b 100644--- a/src/locales/pt-BR.yml+++ b/src/locales/pt-BR.yml@@ -163,6 +163,9 @@ screenshotView:saved: SalvoeditMenu: Editar capturaclickTarget: Alvo de clique+ editClickTarget: "Editar alvo de clique"+ downloadEdited: "Imagem editada"+ downloadOriginal: "Imagem original"annotate: Anotarredact: Ocultarcrop: Recortardiff --git a/src/ui/components/ui/dropdown-menu.tsx b/src/ui/components/ui/dropdown-menu.tsxindex aba44d3..141e2fb 100644--- a/src/ui/components/ui/dropdown-menu.tsx+++ b/src/ui/components/ui/dropdown-menu.tsx@@ -1,3 +1,4 @@+import { ChevronRight } from 'lucide-react';import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';import type * as React from 'react';@@ -65,11 +66,54 @@ function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typ);}+function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;+}++function DropdownMenuSubTrigger({+ className,+ children,+ ...props+}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger>) {+ return (+ <DropdownMenuPrimitive.SubTrigger+ data-slot="dropdown-menu-sub-trigger"+ className={cn(+ "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-secondary data-[state=open]:bg-secondary [&_svg:not([class*='size-'])]:size-4",+ className,+ )}+ {...props}+ >+ {children}+ <ChevronRight className="ml-auto size-4" />+ </DropdownMenuPrimitive.SubTrigger>+ );+}++function DropdownMenuSubContent({+ className,+ ...props+}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {+ return (+ <DropdownMenuPrimitive.SubContent+ data-slot="dropdown-menu-sub-content"+ className={cn(+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 text-foreground shadow-md',+ className,+ )}+ {...props}+ />+ );+}+export {DropdownMenu,DropdownMenuContent,DropdownMenuItem,DropdownMenuPortal,DropdownMenuSeparator,+ DropdownMenuSub,+ DropdownMenuSubContent,+ DropdownMenuSubTrigger,DropdownMenuTrigger,};diff --git a/src/ui/shared/ScreenshotView.tsx b/src/ui/shared/ScreenshotView.tsxindex 7d777ab..cb3ab89 100644--- a/src/ui/shared/ScreenshotView.tsx+++ b/src/ui/shared/ScreenshotView.tsx@@ -12,6 +12,9 @@ import {DropdownMenuContent,DropdownMenuItem,DropdownMenuSeparator,+ DropdownMenuSub,+ DropdownMenuSubContent,+ DropdownMenuSubTrigger,DropdownMenuTrigger,} from '@/ui/components/ui/dropdown-menu';import { Popover, PopoverContent, PopoverTrigger } from '@/ui/components/ui/popover';@@ -272,12 +275,13 @@ export default function ScreenshotView({await updateScreenshotEdits(screenshot.id, nextEdits);};- const handleDownload = async () => {- const blob = await renderScreenshot(effectiveScreenshot);+ const handleDownload = async (which: 'edited' | 'original') => {+ const blob = which === 'original' ? baseScreenshot.blob : await renderScreenshot(effectiveScreenshot);+ const ext = which === 'original' ? (baseScreenshot.mimeType.split('/')[1] ?? 'png') : 'webp';const url = URL.createObjectURL(blob);const a = document.createElement('a');a.href = url;- a.download = `mimik-screenshot-${screenshot.id}.webp`;+ a.download = `mimik-screenshot-${screenshot.id}-${which}.${ext}`;a.click();URL.revokeObjectURL(url);};@@ -398,7 +402,7 @@ export default function ScreenshotView({<DropdownMenuContent align="end" onClick={(e) => e.stopPropagation()}><DropdownMenuItem onSelect={handleClickTarget}><Target size={14} />- {i18n.t('screenshotView.clickTarget')}+ {i18n.t(effectiveEdits?.target ? 'screenshotView.editClickTarget' : 'screenshotView.clickTarget')}</DropdownMenuItem><DropdownMenuItem onSelect={() => onOpenEditor?.('annotate')}><Highlighter size={14} />@@ -417,10 +421,20 @@ export default function ScreenshotView({<ImageUp size={14} />{i18n.t('screenshotView.replaceImage')}</DropdownMenuItem>- <DropdownMenuItem onSelect={handleDownload}>- <Download size={14} />- {i18n.t('screenshotView.download')}- </DropdownMenuItem>+ <DropdownMenuSub>+ <DropdownMenuSubTrigger>+ <Download size={14} />+ {i18n.t('screenshotView.download')}+ </DropdownMenuSubTrigger>+ <DropdownMenuSubContent>+ <DropdownMenuItem onSelect={() => handleDownload('edited')}>+ {i18n.t('screenshotView.downloadEdited')}+ </DropdownMenuItem>+ <DropdownMenuItem onSelect={() => handleDownload('original')}>+ {i18n.t('screenshotView.downloadOriginal')}+ </DropdownMenuItem>+ </DropdownMenuSubContent>+ </DropdownMenuSub><DropdownMenuSeparator /><DropdownMenuItem variant="destructive" onSelect={() => setConfirmDelete(true)}><Trash2 size={14} />