π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
feat(upload):wiring-ui-functionalities
Aswin Asok29fb1d2e47f9
diff --git a/docs/docs/photos/faq/migration.md b/docs/docs/photos/faq/migration.mdindex a478cc80de..d8cd7411d9 100644--- a/docs/docs/photos/faq/migration.md+++ b/docs/docs/photos/faq/migration.md@@ -233,32 +233,34 @@ This only applies to partner-shared photos that Google included in your Takeout.### Why is it recommended to migrate Apple Photos from mobile? {#why-migrate-apple-photos-from-mobile}-It is highly recommended to import from Apple Photos via mobile rather than desktop, as mobile upload preserves metadata, while desktop upload may lose metadata (reason stated [below](#can-i-import-apple-photos-via-desktop)), requires manual export and sequential naming for live photos.+It is highly recommended to import from Apple Photos via mobile rather than desktop, as desktop import requires a manual export with XMP sidecars and sequential naming for Live Photos.### Can I import Apple Photos via desktop? {#can-i-import-apple-photos-via-desktop}-It is highly recommended to import from Apple Photos via mobile rather than desktop.+Importing via the mobile app remains the easiest option.-Some photos may not have EXIF metadata embedded directly within the image file. In these cases, Apple Photos exports metadata into separate `.XMP` sidecar files instead of writing it into the photo itself.+Some photos lack EXIF metadata embedded directly within the image file. Apple Photos can export this metadata, including corrections made in the app, into separate `.xmp` sidecar files instead of rewriting the original file.-Currently, the desktop app does not read metadata from separate XMP sidecar files - it can only recognize metadata that is embedded within the file.+The desktop and web apps read these sidecars during manual folder imports, and the desktop app also reads them during ZIP imports, preserving capture dates with timezone offsets, locations, and captions.-We recommend to upload the photos using the iPhone app as iOS exports typically include embedded metadata, which ensures dates and other details are preserved correctly.--However, for any reason, if desktop is the only way to import, you can follow the steps below:+If you need to import manually, follow the steps below:#### 1. Export your data from the Apple Photos app.Select the files you want to export (`Command + A` to select them all), and click on `File` > `Export` > `Export Unmodified Originals`.-In the dialog that pops up, select File Name as `Sequential` and provide any prefix you'd like. This is to make sure that we combine the photo and video portions of your Live Photos correctly.+In the dialog that pops up, select File Name as `Sequential`, provide any prefix you'd like, and select **Export IPTC as XMP**. Sequential names ensure that we combine the photo and video portions of your Live Photos correctly. The XMP option writes one `.xmp` file next to each photo, which Ente uses for the date, location, and caption.Finally, choose an export directory and confirm by clicking `Export Originals`. You will receive a notification from the app once your export is complete.#### 2. Import into Ente+Alternatively, open the uploader, click **Apple Photos** under **Import from**, and select the exported folder; the screen repeats these export steps.+Now simply drag and drop the downloaded folders into [our desktop app](https://ente.com/download/desktop) and grab a cup of coffee (or a good night's sleep, depending on the size of your library) while we handle the rest.+Keep the `.xmp` files alongside the photos in the same folder when you drag it in; they are read and are not uploaded as separate files.+> Note: In case your uploads get interrupted, just drag and drop the folders into the same albums again, and we will ignore already backed up files and upload just the rest.## Importing from other cloud servicesdiff --git a/web/apps/photos/src/components/TakeoutOptions.tsx b/web/apps/photos/src/components/TakeoutOptions.tsxindex 89b872898e..114aad68ee 100644--- a/web/apps/photos/src/components/TakeoutOptions.tsx+++ b/web/apps/photos/src/components/TakeoutOptions.tsx@@ -28,7 +28,15 @@ const optionsTitleSx = {[uploadSheetMediaQuery]: { fontFamily: '"Inter Variable", sans-serif' },};+const stepSx = {+ color: "text.muted",+ fontSize: "14px",+ fontWeight: 500,+ lineHeight: "20px",+};+interface TakeoutOptionsProps {+ provider: "google" | "apple";isFolderSelectionPending?: boolean;onBack: () => void;onClose: () => void;@@ -37,6 +45,7 @@ interface TakeoutOptionsProps {}export function TakeoutOptions({+ provider,isFolderSelectionPending,onBack,onClose,@@ -76,9 +85,13 @@ export function TakeoutOptions({</IconButton><Typography sx={optionsTitleSx}>{t(- isSheet- ? "google_takeout"- : "import_from_google_photos",+ provider == "apple"+ ? isSheet+ ? "apple_photos"+ : "import_from_apple_photos"+ : isSheet+ ? "google_takeout"+ : "import_from_google_photos",)}</Typography></Stack>@@ -100,11 +113,32 @@ export function TakeoutOptions({</Stack><Stack sx={{ gap: "20px" }}>+ {provider == "apple" && (+ <Stack sx={{ gap: "4px" }}>+ <Typography sx={stepSx}>+ {t("apple_export_step_1")}+ </Typography>+ <Typography sx={stepSx}>+ {t("apple_export_step_2")}+ </Typography>+ <Typography sx={stepSx}>+ {t("apple_export_step_3")}+ </Typography>+ </Stack>+ )}<Stack sx={{ gap: 1 }}><TakeoutOptionButtonicon={<HugeiconsIcon icon={Folder01Icon} size={18} />}- label={t("unzipped_folder")}- description={t("unzipped_folder_hint")}+ label={t(+ provider == "apple"+ ? "exported_folder"+ : "unzipped_folder",+ )}+ description={t(+ provider == "apple"+ ? "apple_export_folder_hint"+ : "unzipped_folder_hint",+ )}pending={isFolderSelectionPending}onClick={onSelectFolder}/>@@ -131,7 +165,11 @@ export function TakeoutOptions({{t("takeout_help_prompt")}{" "}</span><Link- href="https://ente.com/help/photos/migration/from-google-photos/"+ href={+ provider == "apple"+ ? "https://ente.com/help/photos/faq/migration/#can-i-import-apple-photos-via-desktop"+ : "https://ente.com/help/photos/migration/from-google-photos/"+ }target="_blank"rel="noopener"sx={{diff --git a/web/apps/photos/src/components/Upload.tsx b/web/apps/photos/src/components/Upload.tsxindex 3db3aa764b..95e3023728 100644--- a/web/apps/photos/src/components/Upload.tsx+++ b/web/apps/photos/src/components/Upload.tsx@@ -6,6 +6,7 @@ import { TakeoutOptions } from "@/components/TakeoutOptions";import { UploadConfirmationDialog } from "@/components/UploadConfirmationDialog";import { downloadAppDialogAttributes } from "@/components/utils/download";import type {+ ImportSource,InProgressUpload,SegregatedFinishedUploads,UploadBatchResult,@@ -154,17 +155,25 @@ interface UploadConfirmation {pendingUpload: PendingUpload;fileCount: number;albumCount: number;- isTakeout: boolean;+ importSource: ImportSource;importFavorites: boolean;includePartnerSharedFiles: boolean;}type UploadConfirmationState =- | { phase: "counting"; isTakeout: boolean }+ | { phase: "counting"; importSource: ImportSource }| ({ phase: "ready" } & UploadConfirmation);-const containsJSONFiles = (uploadItemAndPaths: UploadItemAndPath[]) =>- uploadItemAndPaths.some(([, path]) => lowercaseExtension(path) == "json");+const importSourceHint = (+ uploadItemAndPaths: UploadItemAndPath[],+): ImportSource =>+ uploadItemAndPaths.some(([, path]) => lowercaseExtension(path) == "json")+ ? "google-takeout"+ : uploadItemAndPaths.some(+ ([, path]) => lowercaseExtension(path) == "xmp",+ )+ ? "apple-photos"+ : "generic";export const Upload: React.FC<UploadProps> = ({user,@@ -669,19 +678,15 @@ export const Upload: React.FC<UploadProps> = ({) => {if (uploadItemsAndPaths.current !== uploadItemAndPaths) return;- const isTakeoutHint = containsJSONFiles(uploadItemAndPaths);- if (uploadItemAndPaths.length > 1 || isTakeoutHint)- setUploadConfirmation({- phase: "counting",- isTakeout: isTakeoutHint,- });+ const hint = importSourceHint(uploadItemAndPaths);+ if (uploadItemAndPaths.length > 1 || hint != "generic")+ setUploadConfirmation({ phase: "counting", importSource: hint });try {- const { count: fileCount, isTakeout } = await uploadableMediaCount([- uploadItemAndPaths,- ]);+ const { count: fileCount, importSource } =+ await uploadableMediaCount([uploadItemAndPaths]);if (uploadItemsAndPaths.current !== uploadItemAndPaths) return;- if (fileCount == 1 && !isTakeout) {+ if (fileCount == 1 && importSource == "generic") {setUploadConfirmation(undefined);void commitUploadToExistingCollection(collection,@@ -699,7 +704,7 @@ export const Upload: React.FC<UploadProps> = ({},fileCount,albumCount: 1,- isTakeout,+ importSource,importFavorites: true,includePartnerSharedFiles: true,});@@ -772,15 +777,12 @@ export const Upload: React.FC<UploadProps> = ({}: NewCollectionsOptions = {},) => {const uploadItemAndPaths = uploadItemsAndPaths.current;- const isTakeoutHint = containsJSONFiles(uploadItemAndPaths);+ const hint = importSourceHint(uploadItemAndPaths);if (!skipConfirmation &&- (uploadItemAndPaths.length > 1 || isTakeoutHint)+ (uploadItemAndPaths.length > 1 || hint != "generic"))- setUploadConfirmation({- phase: "counting",- isTakeout: isTakeoutHint,- });+ setUploadConfirmation({ phase: "counting", importSource: hint });let collectionNameToUploadItems = new Map<string,@@ -822,11 +824,12 @@ export const Upload: React.FC<UploadProps> = ({}try {- const { count: fileCount, isTakeout } = await uploadableMediaCount([- ...collectionNameToUploadItems.values(),- ]);+ const { count: fileCount, importSource } =+ await uploadableMediaCount([+ ...collectionNameToUploadItems.values(),+ ]);if (uploadItemsAndPaths.current !== uploadItemAndPaths) return;- if (fileCount == 1 && !isTakeout) {+ if (fileCount == 1 && importSource == "generic") {setUploadConfirmation(undefined);void commitUploadToNewCollections(uploadItemAndPaths,@@ -848,7 +851,7 @@ export const Upload: React.FC<UploadProps> = ({},fileCount,albumCount: collectionNameToUploadItems.size,- isTakeout,+ importSource,importFavorites: importTakeoutFavorites ?? true,includePartnerSharedFiles: includePartnerSharedFiles ?? true,});@@ -1235,7 +1238,7 @@ export const Upload: React.FC<UploadProps> = ({<UploadConfirmationDialogopen={!!uploadConfirmation}loading={uploadConfirmation?.phase == "counting"}- isTakeout={uploadConfirmation?.isTakeout ?? false}+ importSource={uploadConfirmation?.importSource ?? "generic"}fileCount={readyConfirmation?.fileCount ?? 0}albumCount={readyConfirmation?.albumCount ?? 0}importFavorites={readyConfirmation?.importFavorites ?? true}@@ -1566,38 +1569,15 @@ const UploadOptions: React.FC<UploadOptionsProps> = ({onClose,}) => {// Keep dialog state in this child so it resets when the dialog closes.- const [showTakeoutOptions, setShowTakeoutOptions] = useState(false);-- const handleTakeoutClose = () => setShowTakeoutOptions(false);-- const handleSelect = (option: UploadType) => {- switch (option) {- case "files":- onSelect("files");- break;- case "folders":- onSelect("folders");- break;- case "zips":- if (!showTakeoutOptions) {- setShowTakeoutOptions(true);- } else {- onSelect("zips");- }- break;- }- };-- const handleSelectFiles = () => handleSelect("files");- const handleSelectGooglePhotos = () => handleSelect("zips");- const handleSelectFolder = () => handleSelect("folders");+ const [provider, setProvider] = useState<"google" | "apple">();- return showTakeoutOptions ? (+ return provider ? (<TakeoutOptions+ provider={provider}isFolderSelectionPending={pendingUploadType == "folders"}- onBack={handleTakeoutClose}- onSelectFolder={handleSelectFolder}- onSelectZips={handleSelectGooglePhotos}+ onBack={() => setProvider(undefined)}+ onSelectFolder={() => onSelect("folders")}+ onSelectZips={() => onSelect("zips")}{...{ onClose }}/>) : (@@ -1605,9 +1585,10 @@ const UploadOptions: React.FC<UploadOptionsProps> = ({intent={intent}isFileSelectionPending={pendingUploadType == "files"}isFolderSelectionPending={pendingUploadType == "folders"}- onSelectFiles={handleSelectFiles}- onSelectGooglePhotos={handleSelectGooglePhotos}- onSelectFolder={handleSelectFolder}+ onSelectFiles={() => onSelect("files")}+ onSelectFolder={() => onSelect("folders")}+ onSelectGooglePhotos={() => setProvider("google")}+ onSelectApplePhotos={() => setProvider("apple")}{...{ onClose }}/>);diff --git a/web/apps/photos/src/components/UploadConfirmationDialog.tsx b/web/apps/photos/src/components/UploadConfirmationDialog.tsxindex 0a45bccfbd..e49ff7f9de 100644--- a/web/apps/photos/src/components/UploadConfirmationDialog.tsx+++ b/web/apps/photos/src/components/UploadConfirmationDialog.tsx@@ -1,3 +1,4 @@+import type { ImportSource } from "@/services/upload-manager";import {Cancel01Icon,Loading03Icon,@@ -28,7 +29,7 @@ import type { ChangeEvent, ReactElement } from "react";interface UploadConfirmationDialogProps {open: boolean;loading: boolean;- isTakeout: boolean;+ importSource: ImportSource;fileCount: number;albumCount: number;importFavorites: boolean;@@ -48,7 +49,7 @@ interface UploadConfirmationDialogProps {export function UploadConfirmationDialog({open,loading,- isTakeout,+ importSource,fileCount,albumCount,importFavorites,@@ -59,6 +60,7 @@ export function UploadConfirmationDialog({onCancel,}: UploadConfirmationDialogProps): ReactElement {const isSheet = useIsUploadSheet();+ const isImport = importSource != "generic";return (<Dialog@@ -73,13 +75,19 @@ export function UploadConfirmationDialog({<Stack sx={contentSx}><Stack direction="row" sx={headerSx}><Typography sx={displayTitleSx}>- {isTakeout+ {importSource == "google-takeout"? t(isSheet? "google_takeout": "import_from_google_photos",)- : t("upload_to_ente")}+ : importSource == "apple-photos"+ ? t(+ isSheet+ ? "apple_photos"+ : "import_from_apple_photos",+ )+ : t("upload_to_ente")}</Typography><Stack direction="row" sx={headerActionsSx}><IconButton@@ -123,7 +131,7 @@ export function UploadConfirmationDialog({{loading? t("calculating_title"): t(- isTakeout+ isImport? "ready_to_import": "ready_to_upload",)}@@ -131,7 +139,7 @@ export function UploadConfirmationDialog({{loading && (<Typography sx={calculatingDescriptionSx}>{t(- isTakeout+ isImport? "calculating_takeout_description": "calculating_upload_description",)}@@ -160,7 +168,7 @@ export function UploadConfirmationDialog({</Stack></Stack>- {isTakeout && (+ {importSource == "google-takeout" && (<Stacksx={{gap: "20px",@@ -240,7 +248,7 @@ export function UploadConfirmationDialog({{t("calculating_title")}</>) : (- t(isTakeout ? "start_import" : "start_upload")+ t(isImport ? "start_import" : "start_upload"))}</FocusVisibleButton></Stack>diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.tsindex f2d679dd05..8606ec1342 100644--- a/web/apps/photos/src/services/upload-manager.ts+++ b/web/apps/photos/src/services/upload-manager.ts@@ -797,9 +797,11 @@ const clusterLivePhotos = async (return result;};+export type ImportSource = "generic" | "google-takeout" | "apple-photos";+export const uploadableMediaCount = async (itemGroups: UploadItemAndPath[][],-): Promise<{ count: number; isTakeout: boolean }> => {+): Promise<{ count: number; importSource: ImportSource }> => {let localID = 0;const namedItems = itemGroups.flatMap((items, collectionID) =>items.map(([uploadItem, path]) =>@@ -814,6 +816,7 @@ export const uploadableMediaCount = async (const [metadataItems, mediaItems] = splitMetadataAndMediaItems(namedItems);const parsedMetadataJSONMap = new Map<string, ParsedMetadataJSON>();let parsedJSONCount = 0;+ let parsedXMPCount = 0;for (const item of metadataItems) {const parsedMetadata = await tryParseMetadataItem(item);@@ -822,13 +825,19 @@ export const uploadableMediaCount = async (if (isJSON || !parsedMetadataJSONMap.has(key))parsedMetadataJSONMap.set(key, metadata);if (isJSON) parsedJSONCount++;+ else parsedXMPCount++;}}return {count: (await clusterLivePhotos(mediaItems, parsedMetadataJSONMap)).length,- isTakeout: parsedJSONCount > 0,+ importSource:+ parsedJSONCount > 0+ ? "google-takeout"+ : parsedXMPCount > 0+ ? "apple-photos"+ : "generic",};};diff --git a/web/apps/photos/tests/upload.test.ts b/web/apps/photos/tests/upload.test.tsindex 81e1f2d3bf..5856a10096 100644--- a/web/apps/photos/tests/upload.test.ts+++ b/web/apps/photos/tests/upload.test.ts@@ -1,3 +1,4 @@+import type { RawExifTags } from "ente-gallery/services/exif";import {parseDateFromDigitGroups,tryParseEpochMicrosecondsFromFileName,@@ -5,6 +6,8 @@ import {import {matchJSONMetadata,metadataJSONMapKeyForJSON,+ metadataJSONMapKeyForXMP,+ parseXMPSidecarTags,} from "ente-gallery/services/upload/metadata-json";import { describe, expect, test } from "vitest";@@ -89,6 +92,18 @@ const formatLocalDateTime = (date: Date | undefined) => {const formatTwoDigits = (value: number) => value.toString().padStart(2, "0");+const xmpTag = (value: string) => ({+ value,+ description: value,+ attributes: {},+});++const xmpDescriptionTag = (description: string) => ({+ value: [xmpTag(description)],+ description,+ attributes: {},+});+describe("upload filename metadata", () => {test.each(dateCases)("parses %s", (fileName, expected) => {expect(formatLocalDateTime(parseDateFromDigitGroups(fileName))).toBe(@@ -123,3 +138,112 @@ describe("upload filename metadata", () => {expect(matchJSONMetadata(undefined, 0, fileName, map)).toBe(metadata);});});++describe("Apple Photos XMP sidecars", () => {+ test("parses DateCreated with an offset", () => {+ const metadata = parseXMPSidecarTags({+ xmp: { DateCreated: xmpTag("2023-04-27T14:51:16+05:30") },+ });++ expect(metadata?.creationDate).toMatchObject({+ dateTime: "2023-04-27T14:51:16.000",+ offset: "+05:30",+ });+ expect(metadata?.creationTime).toBe(metadata?.creationDate?.timestamp);+ });++ test("parses a Z offset date", () => {+ expect(+ parseXMPSidecarTags({+ xmp: { DateCreated: xmpTag("2023-04-27T09:21:16Z") },+ })?.creationDate,+ ).toMatchObject({ dateTime: "2023-04-27T09:21:16.000", offset: "Z" });+ });++ test("prefers DateTimeOriginal over DateCreated", () => {+ expect(+ parseXMPSidecarTags({+ xmp: {+ DateTimeOriginal: xmpTag("2022-01-02T03:04:05Z"),+ DateCreated: xmpTag("2023-04-27T09:21:16Z"),+ },+ })?.creationDate?.dateTime,+ ).toBe("2022-01-02T03:04:05.000");+ });++ test.each([+ ["12.97236N", "77.59457E", 12.97236, 77.59457],+ ["33.8688S", "151.2093W", -33.8688, -151.2093],+ ])("parses GPS coordinates %s, %s", (lat, long, latitude, longitude) => {+ expect(+ parseXMPSidecarTags({+ xmp: { GPSLatitude: xmpTag(lat), GPSLongitude: xmpTag(long) },+ })?.location,+ ).toEqual({ latitude, longitude });+ });++ test("omits a location with only one GPS axis", () => {+ expect(+ parseXMPSidecarTags({ xmp: { GPSLatitude: xmpTag("12.97236N") } }),+ ).toBeUndefined();+ });++ test("parses the caption", () => {+ expect(+ parseXMPSidecarTags({+ xmp: { description: xmpDescriptionTag("Sunset at the lake") },+ })?.description,+ ).toBe("Sunset at the lake");+ });++ test.each([{ xmp: {} }, {}] satisfies RawExifTags[])(+ "ignores empty tags",+ (tags) => {+ expect(parseXMPSidecarTags(tags)).toBeUndefined();+ },+ );++ test("keys and matches sidecars by original stem and upload scope", () => {+ const metadata = { description: "original" };+ const duplicateMetadata = { description: "duplicate" };+ const uppercaseMetadata = { description: "uppercase" };+ const jsonMetadata = { description: "json" };+ const map = new Map([+ [metadataJSONMapKeyForXMP(undefined, 0, "IMG_1234.xmp"), metadata],+ [+ metadataJSONMapKeyForXMP(undefined, 0, "IMG_1234 (1).xmp"),+ duplicateMetadata,+ ],+ [+ metadataJSONMapKeyForXMP(undefined, 0, "IMG_9.XMP"),+ uppercaseMetadata,+ ],+ [+ metadataJSONMapKeyForJSON(undefined, 0, "photo.json"),+ jsonMetadata,+ ],+ ]);++ expect(matchJSONMetadata(undefined, 0, "IMG_1234.HEIC", map)).toBe(+ metadata,+ );+ expect(matchJSONMetadata(undefined, 0, "IMG_1234.MOV", map)).toBe(+ metadata,+ );+ expect(matchJSONMetadata(undefined, 0, "IMG_1234 (1).HEIC", map)).toBe(+ duplicateMetadata,+ );+ expect(matchJSONMetadata("other", 0, "IMG_1234.HEIC", map)).toBe(+ undefined,+ );+ expect(matchJSONMetadata(undefined, 1, "IMG_1234.HEIC", map)).toBe(+ undefined,+ );+ expect(matchJSONMetadata(undefined, 0, "photo.jpg", map)).toBe(+ undefined,+ );+ expect(matchJSONMetadata(undefined, 0, "IMG_9.HEIC", map)).toBe(+ uppercaseMetadata,+ );+ });+});diff --git a/web/packages/base/locales/en-US/translation.json b/web/packages/base/locales/en-US/translation.jsonindex c013618489..967700711d 100644--- a/web/packages/base/locales/en-US/translation.json+++ b/web/packages/base/locales/en-US/translation.json@@ -87,6 +87,13 @@"desktop_only": "Desktop only","takeout_help_prompt": "Still have questions?","takeout_help_action": "We're here to help",+ "apple_photos": "Apple Photos",+ "import_from_apple_photos": "Import from Apple Photos",+ "exported_folder": "Exported folder",+ "apple_export_folder_hint": "Select the folder exported from Photos",+ "apple_export_step_1": "In Photos, select your photos and choose File > Export > Export Unmodified Originals",+ "apple_export_step_2": "Set File Name to Sequential so Live Photos pair correctly",+ "apple_export_step_3": "Select Export IPTC as XMP so dates, locations, and captions come along","upload_to_ente": "Upload to Ente","calculating_title": "Calculating Files","calculating_takeout_description": "We're scanning your files to count what can be imported. This usually takes under a minute.",diff --git a/web/packages/gallery/components/upload/DefaultOptions.tsx b/web/packages/gallery/components/upload/DefaultOptions.tsxindex 400c233463..836f137120 100644--- a/web/packages/gallery/components/upload/DefaultOptions.tsx+++ b/web/packages/gallery/components/upload/DefaultOptions.tsx@@ -1,5 +1,6 @@import { Album02Icon, Folder01Icon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";+import AppleIcon from "@mui/icons-material/Apple";import ChevronRightIcon from "@mui/icons-material/ChevronRight";import CloseIcon from "@mui/icons-material/Close";import GoogleIcon from "@mui/icons-material/Google";@@ -29,8 +30,16 @@ interface DefaultOptionsBaseProps {type DefaultOptionsProps = DefaultOptionsBaseProps &(- | { intent: UploadTypeSelectorIntent; onSelectGooglePhotos: () => void }- | { intent: "collect"; onSelectGooglePhotos?: never }+ | {+ intent: UploadTypeSelectorIntent;+ onSelectApplePhotos: () => void;+ onSelectGooglePhotos: () => void;+ }+ | {+ intent: "collect";+ onSelectApplePhotos?: never;+ onSelectGooglePhotos?: never;+ });export function DefaultOptions({@@ -38,6 +47,7 @@ export function DefaultOptions({isFileSelectionPending,isFolderSelectionPending,onClose,+ onSelectApplePhotos,onSelectFiles,onSelectGooglePhotos,onSelectFolder,@@ -89,6 +99,7 @@ export function DefaultOptions({<ImportOptions{...{isFolderSelectionPending,+ onSelectApplePhotos,onSelectGooglePhotos,onSelectFolder,}}@@ -107,6 +118,7 @@ export function DefaultOptions({{...{isFileSelectionPending,isFolderSelectionPending,+ onSelectApplePhotos,onSelectFiles,onSelectGooglePhotos,onSelectFolder,@@ -120,16 +132,23 @@ export function DefaultOptions({type ImportOptionsProps = Pick<DefaultOptionsBaseProps,"isFolderSelectionPending" | "onSelectFolder"-> & { onSelectGooglePhotos: () => void };+> & { onSelectApplePhotos: () => void; onSelectGooglePhotos: () => void };function ImportOptions({isFolderSelectionPending,+ onSelectApplePhotos,onSelectGooglePhotos,onSelectFolder,}: ImportOptionsProps): React.JSX.Element {return (<Stack sx={{ gap: "20px" }}>- <Stack direction="row" sx={{ gap: "10px" }}>+ <Stack+ direction="row"+ sx={{+ gap: "10px",+ [uploadSheetMediaQuery]: { flexWrap: "wrap" },+ }}+ ><ImportProviderButtonicon={<HugeiconsIcon@@ -141,6 +160,13 @@ function ImportOptions({label={t("google_photos")}onClick={onSelectGooglePhotos}/>+ <ImportProviderButton+ icon={+ <AppleIcon sx={{ color: "text.muted", fontSize: 22 }} />+ }+ label={t("apple_photos")}+ onClick={onSelectApplePhotos}+ /><ImportProviderButtonicon={<HugeiconsIcon@@ -166,11 +192,12 @@ type UploadOptionsProps = Pick<| "isFolderSelectionPending"| "onSelectFiles"| "onSelectFolder"-> & { onSelectGooglePhotos: () => void };+> & { onSelectApplePhotos: () => void; onSelectGooglePhotos: () => void };function UploadOptions({isFileSelectionPending,isFolderSelectionPending,+ onSelectApplePhotos,onSelectFiles,onSelectGooglePhotos,onSelectFolder,@@ -208,15 +235,26 @@ function UploadOptions({</ImportSection><ImportSection title={t("import_from")} gap="20px">- <OptionRowButton- icon={- <GoogleIcon- sx={{ color: "text.muted", fontSize: "20px" }}- />- }- label={t("google_takeout")}- onClick={onSelectGooglePhotos}- />+ <Stack sx={{ gap: 1 }}>+ <OptionRowButton+ icon={+ <GoogleIcon+ sx={{ color: "text.muted", fontSize: "20px" }}+ />+ }+ label={t("google_takeout")}+ onClick={onSelectGooglePhotos}+ />+ <OptionRowButton+ icon={+ <AppleIcon+ sx={{ color: "text.muted", fontSize: "20px" }}+ />+ }+ label={t("apple_photos")}+ onClick={onSelectApplePhotos}+ />+ </Stack></ImportSection></Stack>);@@ -313,6 +351,7 @@ function ImportProviderButton({onClick={onClick}sx={(theme) => ({flex: 1,+ [uploadSheetMediaQuery]: { flexBasis: "calc(50% - 5px)" },minWidth: 0,height: "74px",p: "12px",