Send files directly between devices over the internet - no cloud storage, no size limits.
TypeScript cross-platformdata-transferdecentralizedfile-sharingfile-transferhole-punchingopen-sourcep2ppeer-to-peerprivacyprivacy-tools
Add auto save location option in mobile (#63)
Denis Lupookov714facf96168
diff --git a/apps/desktop/src/renderer/components/Settings/sections/GeneralSection.tsx b/apps/desktop/src/renderer/components/Settings/sections/GeneralSection.tsxindex 3f38966..9d8eae4 100644--- a/apps/desktop/src/renderer/components/Settings/sections/GeneralSection.tsx+++ b/apps/desktop/src/renderer/components/Settings/sections/GeneralSection.tsx@@ -1,4 +1,4 @@-import { useEffect, useState, type ReactNode } from 'react'+import { useEffect, useState } from 'react'import { Button, LinkRow, ToggleSwitch, useTheme } from '@altersend/components'import { FolderIcon } from '@altersend/components/icons'import { useTranslation } from '@altersend/locales'@@ -21,15 +21,6 @@ function truncatePath(folder: string): string {return `…${cut > 0 ? tail.slice(cut) : tail}`}-function Group({ title, children }: { title: string; children: ReactNode }) {- return (- <div>- <p className='m-0 mb-2 text-[13px] font-medium text-text-muted'>{title}</p>- <div className='flex flex-col gap-2.5'>{children}</div>- </div>- )-}-export function GeneralSection() {const { t } = useTranslation(['settings', 'errors'])const { theme } = useTheme()@@ -79,12 +70,12 @@ export function GeneralSection() {return (<SectionShell title={t('settings:sections.general')}>- <div className='flex flex-col gap-6'>- <Group title={t('settings:downloads.title')}>+ <div className='flex flex-col gap-2.5'>+ <div className='overflow-hidden rounded-[10px] border border-border-primary bg-background-subtle'><LinkRow- standalonecompactsubtitleWrap+ isLast={askEveryTime}label={t('settings:downloads.autoSaveLabel')}subtitle={t('settings:downloads.autoSaveDescription')}trailing={@@ -97,14 +88,14 @@ export function GeneralSection() {/>{askEveryTime ? null : (<LinkRow- standalonecompact+ isLasticon={<FolderIcon size={16} color={c.colorTextMuted} />}label={folder ? truncatePath(folder) : t('settings:downloads.chooseFolder')}trailing={<Buttonsize='sm'- variant='secondary'+ variant='outline'onClick={() => handleChangeFolder().catch(console.error)}>{t('settings:downloads.change')}@@ -112,24 +103,22 @@ export function GeneralSection() {}/>)}- </Group>+ </div>- <Group title={t('settings:sections.security')}>- <LinkRow- standalone- compact- subtitleWrap- label={t('settings:crashReports.label')}- subtitle={t('settings:crashReports.description')}- trailing={- <ToggleSwitch- checked={crashReporting}- onChange={handleCrashToggle}- aria-label={t('settings:crashReports.label')}- />- }- />- </Group>+ <LinkRow+ standalone+ compact+ subtitleWrap+ label={t('settings:crashReports.label')}+ subtitle={t('settings:crashReports.description')}+ trailing={+ <ToggleSwitch+ checked={crashReporting}+ onChange={handleCrashToggle}+ aria-label={t('settings:crashReports.label')}+ />+ }+ /></div></SectionShell>)diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsxindex 5bd907b..53c187a 100644--- a/apps/mobile/app/_layout.tsx+++ b/apps/mobile/app/_layout.tsx@@ -96,8 +96,8 @@ function ThemedStack() {<Stack.Screen name='onboarding' options={{ headerShown: false, gestureEnabled: false }} /><Stack.Screen name='settings' options={flowScreenOptions} /><Stack.Screen name='language' options={flowScreenOptions} />+ <Stack.Screen name='general' options={flowScreenOptions} /><Stack.Screen name='connection' options={flowScreenOptions} />- <Stack.Screen name='security' options={flowScreenOptions} /><Stack.Screen name='devices' options={flowScreenOptions} /><Stack.Screen name='about' options={flowScreenOptions} /><Stack.Screen name='report' options={flowScreenOptions} />diff --git a/apps/mobile/app/general.tsx b/apps/mobile/app/general.tsxnew file mode 100644index 0000000..16d2482--- /dev/null+++ b/apps/mobile/app/general.tsx@@ -0,0 +1,84 @@+import { StyleSheet, View } from 'react-native'+import { useCallback, useState } from 'react'+import { useFocusEffect } from 'expo-router'+import { ToggleSwitch, useTheme } from '@altersend/components'+import { useTranslation } from '@altersend/locales'+import { Layout } from '@/src/components'+import {+ isCrashReportingEnabled,+ setCrashReportingEnabled+} from '@/src/lifecycle/crashReportingStorage'+import {+ MEDIA_DESTINATION_KEYS,+ isSaveMediaToPhotos,+ setSaveMediaToPhotos+} from '@/src/lifecycle/downloadPreferenceStorage'+import { closeSentry, initSentry } from '@/src/sentry'++export default function GeneralScreen() {+ const { t } = useTranslation(['settings'])+ const { theme } = useTheme()+ const c = theme.colors+ const [mediaToPhotos, setMediaToPhotos] = useState(isSaveMediaToPhotos)+ const [crashReporting, setCrashReporting] = useState(isCrashReportingEnabled)++ useFocusEffect(+ useCallback(() => {+ setMediaToPhotos(isSaveMediaToPhotos())+ setCrashReporting(isCrashReportingEnabled())+ }, [])+ )++ const handleMediaToggle = (value: boolean) => {+ setMediaToPhotos(value)+ if (!setSaveMediaToPhotos(value)) setMediaToPhotos(!value)+ }++ const handleCrashReportingToggle = (value: boolean) => {+ setCrashReporting(value)+ setCrashReportingEnabled(value)+ if (value) initSentry()+ else closeSentry()+ }++ const cardStyle = {+ backgroundColor: c.colorBackgroundSubtle,+ borderColor: c.colorBorderPrimary+ }++ return (+ <Layout title={t('settings:sections.general')} description='' hasNativeHeader>+ <View style={styles.container}>+ <View style={[styles.card, cardStyle]}>+ <ToggleSwitch+ checked={mediaToPhotos}+ onChange={handleMediaToggle}+ label={t(MEDIA_DESTINATION_KEYS.label)}+ description={t(MEDIA_DESTINATION_KEYS.description)}+ />+ </View>+ <View style={[styles.card, cardStyle]}>+ <ToggleSwitch+ checked={crashReporting}+ onChange={handleCrashReportingToggle}+ label={t('settings:crashReports.label')}+ description={t('settings:crashReports.description')}+ />+ </View>+ </View>+ </Layout>+ )+}++const styles = StyleSheet.create({+ container: {+ gap: 10+ },+ card: {+ borderRadius: 16,+ borderWidth: 1,+ overflow: 'hidden',+ paddingHorizontal: 16,+ paddingVertical: 13+ }+})diff --git a/apps/mobile/app/security.tsx b/apps/mobile/app/security.tsxdeleted file mode 100644index c9ea176..0000000--- a/apps/mobile/app/security.tsx+++ /dev/null@@ -1,53 +0,0 @@-import { StyleSheet, View } from 'react-native'-import { useState } from 'react'-import { ToggleSwitch, useTheme } from '@altersend/components'-import { useTranslation } from '@altersend/locales'-import { Layout } from '@/src/components'-import {- isCrashReportingEnabled,- setCrashReportingEnabled-} from '@/src/lifecycle/crashReportingStorage'-import { closeSentry, initSentry } from '@/src/sentry'--export default function SecurityScreen() {- const { t } = useTranslation(['settings'])- const { theme } = useTheme()- const [crashReporting, setCrashReporting] = useState(isCrashReportingEnabled)-- const handleCrashReportingToggle = (value: boolean) => {- setCrashReporting(value)- setCrashReportingEnabled(value)- if (value) initSentry()- else closeSentry()- }-- const cardStyle = {- backgroundColor: theme.colors.colorBackgroundSubtle,- borderColor: theme.colors.colorBorderPrimary- }-- return (- <Layout title={t('settings:rows.security')} description='' hasNativeHeader>- <View style={[styles.card, styles.cardPad, cardStyle]}>- <ToggleSwitch- checked={crashReporting}- onChange={handleCrashReportingToggle}- label={t('settings:crashReports.label')}- description={t('settings:crashReports.description')}- />- </View>- </Layout>- )-}--const styles = StyleSheet.create({- card: {- borderRadius: 16,- borderWidth: 1,- overflow: 'hidden'- },- cardPad: {- paddingHorizontal: 16,- paddingVertical: 13- }-})diff --git a/apps/mobile/app/settings.tsx b/apps/mobile/app/settings.tsxindex a36dee3..c40a5c3 100644--- a/apps/mobile/app/settings.tsx+++ b/apps/mobile/app/settings.tsx@@ -9,7 +9,7 @@ import {AlertCircleIcon,GlobeIcon,InfoIcon,- ShieldIcon,+ SlidersHorizontalIcon,SmartphoneIcon,WaypointsIcon} from '@altersend/components/icons'@@ -20,6 +20,10 @@ import {getSavedLocalePreference,subscribeLocalePreference} from '@/src/lifecycle/localePreferenceStorage'+import {+ MEDIA_DESTINATION_KEYS,+ isSaveMediaToPhotos+} from '@/src/lifecycle/downloadPreferenceStorage'export default function SettingsScreen() {const { t } = useTranslation(['settings', 'common'])@@ -31,11 +35,18 @@ export default function SettingsScreen() {getLocalePreferenceSnapshot)const peers = useTransferStore((s) => s.peers)+ const [mediaToPhotos, setMediaToPhotos] = useState(isSaveMediaToPhotos)useEffect(() => {void loadPeers()}, [])+ useFocusEffect(+ useCallback(() => {+ setMediaToPhotos(isSaveMediaToPhotos())+ }, [])+ )+useEffect(() => subscribeLocalePreference(setLocalePreference), [])useFocusEffect(@@ -77,6 +88,15 @@ export default function SettingsScreen() {icon={<SmartphoneIcon size={16} color={c.colorTextSecondary} />}onPress={() => router.push('/devices')}/>+ <LinkRow+ standalone+ label={t('settings:sections.general')}+ subtitle={t(+ mediaToPhotos ? MEDIA_DESTINATION_KEYS.whenOn : MEDIA_DESTINATION_KEYS.whenOff+ )}+ icon={<SlidersHorizontalIcon size={16} color={c.colorTextSecondary} />}+ onPress={() => router.push('/general')}+ /><LinkRowstandalonelabel={t('common:labels.language')}@@ -91,13 +111,6 @@ export default function SettingsScreen() {icon={<WaypointsIcon size={16} color={c.colorTextSecondary} />}onPress={() => router.push('/connection')}/>- <LinkRow- standalone- label={t('settings:rows.security')}- subtitle={t('settings:crashReports.label')}- icon={<ShieldIcon size={16} color={c.colorTextSecondary} />}- onPress={() => router.push('/security')}- /></View></View>diff --git a/apps/mobile/modules/media-store/android/src/main/java/expo/modules/mediastore/MediaStoreModule.kt b/apps/mobile/modules/media-store/android/src/main/java/expo/modules/mediastore/MediaStoreModule.ktindex 6be87a5..cc00467 100644--- a/apps/mobile/modules/media-store/android/src/main/java/expo/modules/mediastore/MediaStoreModule.kt+++ b/apps/mobile/modules/media-store/android/src/main/java/expo/modules/mediastore/MediaStoreModule.kt@@ -1,5 +1,6 @@package expo.modules.mediastore+import android.content.ActivityNotFoundExceptionimport android.content.ContentValuesimport android.content.Intentimport android.net.Uri@@ -69,9 +70,19 @@ class MediaStoreModule : Module() {addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)}- context.startActivity(Intent.createChooser(intent, null).apply {- addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)- })+ try {+ context.startActivity(intent)+ } catch (err: ActivityNotFoundException) {+ try {+ context.startActivity(+ Intent(android.app.DownloadManager.ACTION_VIEW_DOWNLOADS).apply {+ addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)+ }+ )+ } catch (fallbackErr: ActivityNotFoundException) {+ throw err+ }+ }}// Opens the system Downloads UI.diff --git a/apps/mobile/scripts/link-android-addons.cjs b/apps/mobile/scripts/link-android-addons.cjsindex f0b94cd..2c8b417 100644--- a/apps/mobile/scripts/link-android-addons.cjs+++ b/apps/mobile/scripts/link-android-addons.cjs@@ -1,17 +1,15 @@-const { spawnSync } = require("node:child_process");-const path = require("node:path");+const { spawnSync } = require('node:child_process')+const path = require('node:path')-const appRoot = path.join(__dirname, "..");-const bareKitDir = path.dirname(- require.resolve("react-native-bare-kit/package.json")-);-const addonsOut = path.join(bareKitDir, "android", "src", "main", "addons");+const appRoot = path.join(__dirname, '..')+const bareKitDir = path.dirname(require.resolve('react-native-bare-kit/package.json'))+const addonsOut = path.join(bareKitDir, 'android', 'src', 'main', 'addons')const result = spawnSync(process.execPath,[- "--input-type=module",- "-e",+ '--input-type=module',+ '-e',`import link from 'bare-link';@@ -21,15 +19,15 @@ for await (const resource of link(${JSON.stringify(appRoot)}, {})) {console.log('Wrote', resource);}-`,+`],- { stdio: "inherit" }-);+ { stdio: 'inherit' }+)if (result.error) {- throw result.error;+ throw result.error}-if (typeof result.status === "number" && result.status !== 0) {- process.exit(result.status);+if (typeof result.status === 'number' && result.status !== 0) {+ process.exit(result.status)}diff --git a/apps/mobile/scripts/link-ios-addons.cjs b/apps/mobile/scripts/link-ios-addons.cjsindex 34f331a..14aa77c 100644--- a/apps/mobile/scripts/link-ios-addons.cjs+++ b/apps/mobile/scripts/link-ios-addons.cjs@@ -1,17 +1,15 @@-const { spawnSync } = require("node:child_process");-const path = require("node:path");+const { spawnSync } = require('node:child_process')+const path = require('node:path')-const appRoot = path.join(__dirname, "..");-const bareKitDir = path.dirname(- require.resolve("react-native-bare-kit/package.json")-);-const addonsOut = path.join(bareKitDir, "ios", "addons");+const appRoot = path.join(__dirname, '..')+const bareKitDir = path.dirname(require.resolve('react-native-bare-kit/package.json'))+const addonsOut = path.join(bareKitDir, 'ios', 'addons')const result = spawnSync(process.execPath,[- "--input-type=module",- "-e",+ '--input-type=module',+ '-e',`import link from 'bare-link';@@ -21,15 +19,15 @@ for await (const resource of link(${JSON.stringify(appRoot)}, {})) {console.log('Wrote', resource);}-`,+`],- { stdio: "inherit" }-);+ { stdio: 'inherit' }+)if (result.error) {- throw result.error;+ throw result.error}-if (typeof result.status === "number" && result.status !== 0) {- process.exit(result.status);+if (typeof result.status === 'number' && result.status !== 0) {+ process.exit(result.status)}diff --git a/apps/mobile/src/lifecycle/downloadPreferenceStorage.ts b/apps/mobile/src/lifecycle/downloadPreferenceStorage.tsnew file mode 100644index 0000000..f0a72e7--- /dev/null+++ b/apps/mobile/src/lifecycle/downloadPreferenceStorage.ts@@ -0,0 +1,53 @@+import { Platform } from 'react-native'+import { Directory, File, Paths } from 'expo-file-system'++const DIRNAME = 'altersend'+const FILENAME = 'media-to-photos.disabled'++export const MEDIA_DESTINATION_KEYS =+ Platform.OS === 'android'+ ? ({+ label: 'settings:downloads.mediaToGalleryLabel',+ description: 'settings:downloads.mediaToGalleryDescription',+ whenOn: 'settings:downloads.destinationGallery',+ whenOff: 'settings:downloads.destinationDownloads'+ } as const)+ : ({+ label: 'settings:downloads.mediaToPhotosLabel',+ description: 'settings:downloads.mediaToPhotosDescription',+ whenOn: 'settings:downloads.destinationPhotos',+ whenOff: 'settings:downloads.destinationFiles'+ } as const)++function getMarkerFile(): File | null {+ const documentDirectory = Paths.document+ if (!documentDirectory?.uri) return null+ return new File(new Directory(documentDirectory, DIRNAME), FILENAME)+}++export function isSaveMediaToPhotos(): boolean {+ try {+ return !(getMarkerFile()?.exists ?? false)+ } catch {+ return true+ }+}++export function setSaveMediaToPhotos(value: boolean): boolean {+ try {+ const documentDirectory = Paths.document+ if (!documentDirectory?.uri) return false+ const dir = new Directory(documentDirectory, DIRNAME)+ const file = new File(dir, FILENAME)+ if (value) {+ if (file.exists) file.delete()+ } else {+ if (!dir.exists) dir.create({ idempotent: true, intermediates: true })+ if (!file.exists) file.create()+ }+ return true+ } catch (err) {+ console.warn('downloadPreferenceStorage: setSaveMediaToPhotos failed', err)+ return false+ }+}diff --git a/apps/mobile/src/transfer/receive/utils/downloadHandlers.ts b/apps/mobile/src/transfer/receive/utils/downloadHandlers.tsindex b93bf9e..453c360 100644--- a/apps/mobile/src/transfer/receive/utils/downloadHandlers.ts+++ b/apps/mobile/src/transfer/receive/utils/downloadHandlers.ts@@ -1,7 +1,9 @@import { Platform } from 'react-native'+import { File } from 'expo-file-system'import * as MediaLibrary from 'expo-media-library'import type { SaveDestination } from '@altersend/domain'import { isMediaStoreAvailable, saveToDownloads } from '@/modules/media-store'+import { isSaveMediaToPhotos } from '@/src/lifecycle/downloadPreferenceStorage'const IMAGE_EXTENSIONS = new Set(['jpg',@@ -29,6 +31,23 @@ function isMediaFile(fileName: string): boolean {}const MIME_BY_EXT: Record<string, string> = {+ jpg: 'image/jpeg',+ jpeg: 'image/jpeg',+ png: 'image/png',+ gif: 'image/gif',+ heic: 'image/heic',+ heif: 'image/heif',+ webp: 'image/webp',+ bmp: 'image/bmp',+ tiff: 'image/tiff',+ tif: 'image/tiff',+ mov: 'video/quicktime',+ mp4: 'video/mp4',+ m4v: 'video/x-m4v',+ '3gp': 'video/3gpp',+ avi: 'video/x-msvideo',+ mkv: 'video/x-matroska',+ webm: 'video/webm',pdf: 'application/pdf',zip: 'application/zip',rar: 'application/vnd.rar',@@ -64,29 +83,47 @@ export interface HandleDownloadedFileResult {localPath: string}-export async function handleDownloadedFile(+async function saveToFiles(localPath: string,fileName: string): Promise<HandleDownloadedFileResult> {- if (!isMediaFile(fileName)) {- // Android: stream into the public Downloads collection so it's browsable in Files.- // iOS exposes the app's Documents dir via the Files app already, so no export is needed.- if (Platform.OS === 'android' && isMediaStoreAvailable()) {- try {- const contentUri = await saveToDownloads(localPath, fileName, guessMimeType(fileName))- return { intended: 'downloads', destination: 'downloads', localPath: contentUri }- } catch (err) {- console.warn('handleDownloadedFile: saveToDownloads failed, keeping private copy', err)- return { intended: 'downloads', destination: 'filesystem', localPath }- }+ if (Platform.OS === 'android' && isMediaStoreAvailable()) {+ try {+ const contentUri = await saveToDownloads(localPath, fileName, guessMimeType(fileName))+ return { intended: 'downloads', destination: 'downloads', localPath: contentUri }+ } catch (err) {+ console.warn('saveToFiles: saveToDownloads failed, keeping private copy', err)+ return { intended: 'downloads', destination: 'filesystem', localPath }}- return { intended: 'filesystem', destination: 'filesystem', localPath }+ }+ return { intended: 'filesystem', destination: 'filesystem', localPath }+}++export async function handleDownloadedFile(+ localPath: string,+ fileName: string+): Promise<HandleDownloadedFileResult> {+ if (!isMediaFile(fileName) || !isSaveMediaToPhotos()) {+ return saveToFiles(localPath, fileName)}const permission = await MediaLibrary.requestPermissionsAsync(true)if (!permission.granted) {return { intended: 'photos', destination: 'filesystem', localPath }}- await MediaLibrary.saveToLibraryAsync(toFilePath(localPath))+ try {+ await MediaLibrary.saveToLibraryAsync(toFilePath(localPath))+ } catch {+ const fallback = await saveToFiles(localPath, fileName)+ return { ...fallback, intended: 'photos' }+ }++ try {+ const original = new File(localPath)+ if (original.exists) original.delete()+ } catch (err) {+ console.warn('handleDownloadedFile: could not remove the private copy', err)+ }+return { intended: 'photos', destination: 'photos', localPath }}diff --git a/apps/mobile/src/transfer/receive/utils/openCompletedFile.ts b/apps/mobile/src/transfer/receive/utils/openCompletedFile.tsindex 416252b..80cc08c 100644--- a/apps/mobile/src/transfer/receive/utils/openCompletedFile.ts+++ b/apps/mobile/src/transfer/receive/utils/openCompletedFile.ts@@ -9,6 +9,26 @@ function openPhotos(): void {void Linking.openURL(url).catch(() => {})}+function toFileUri(savedTo: string): string {+ const path = savedTo.replace(/^file:\/\//, '')+ let decoded = path+ try {+ decoded = decodeURI(path)+ } catch {}+ return `file://${encodeURI(decoded)}`+}++function shareFile(savedTo: string): void {+ void Sharing.isAvailableAsync()+ .then((available) => (available ? Sharing.shareAsync(toFileUri(savedTo)) : undefined))+ .catch((err) => console.error('openCompletedFile: shareAsync failed', err))+}++function openInFiles(savedTo: string): void {+ const url = toFileUri(savedTo).replace(/^file:\/\//, 'shareddocuments://')+ void Linking.openURL(url).catch(() => shareFile(savedTo))+}+export function openCompletedFile(offerKey: string): void {const state = transferStore.getState()const item = state.receiveDownloadStates[offerKey]@@ -28,11 +48,10 @@ export function openCompletedFile(offerKey: string): void {return}- const uri = item.savedTo.startsWith('file://') ? item.savedTo : `file://${item.savedTo}`- void Sharing.isAvailableAsync()- .then((available) => {- if (!available) return- return Sharing.shareAsync(uri)- })- .catch((err) => console.error('openCompletedFile: shareAsync failed', err))+ if (Platform.OS === 'ios') {+ openInFiles(item.savedTo)+ return+ }++ shareFile(item.savedTo)}diff --git a/packages/components/src/components/Button/Button.tsx b/packages/components/src/components/Button/Button.tsxindex 2962050..25b44c4 100644--- a/packages/components/src/components/Button/Button.tsx+++ b/packages/components/src/components/Button/Button.tsx@@ -8,7 +8,14 @@ import { styles } from './styles'type ButtonElementProps = Parameters<typeof html.button>[0]-export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'light' | 'danger' | 'success'+export type ButtonVariant =+ | 'primary'+ | 'secondary'+ | 'outline'+ | 'ghost'+ | 'light'+ | 'danger'+ | 'success'export type ButtonSize = 'sm' | 'md' | 'lg'export interface ButtonProps extends Omit<ButtonElementProps, 'children' | 'style'> {@@ -27,6 +34,7 @@ export interface ButtonProps extends Omit<ButtonElementProps, 'children' | 'stylconst pressedStyle = {primary: styles.primaryPressed,secondary: styles.secondaryPressed,+ outline: styles.outlinePressed,ghost: styles.ghostPressed,light: styles.lightPressed,danger: styles.dangerPressed,@@ -42,6 +50,7 @@ const textSize = {const textVariant = {primary: styles.textPrimary,secondary: styles.textSecondary,+ outline: styles.textOutline,ghost: styles.textGhost,light: styles.textLight,danger: styles.textDanger,@@ -57,6 +66,7 @@ const normalIconColor: Record<ButtonVariant, keyof ReturnType<typeof useTheme>['{primary: 'colorBackground',secondary: 'colorTextPrimary',+ outline: 'colorTextPrimary',ghost: 'colorTextSecondary',light: 'colorOnAccent',danger: 'colorDanger',diff --git a/packages/components/src/components/Button/styles.ts b/packages/components/src/components/Button/styles.tsindex 6bb19dc..9b48597 100644--- a/packages/components/src/components/Button/styles.ts+++ b/packages/components/src/components/Button/styles.ts@@ -93,6 +93,23 @@ export const styles = css.create({borderColor: tokens.colorBorderPrimary},secondary: {+ backgroundColor: tokens.colorBackgroundSubtle,+ borderColor: tokens.colorBorderPrimary,+ color: tokens.colorTextPrimary,+ boxShadow: 'none',+ ':hover': {+ backgroundColor: tokens.colorSurfacePrimary,+ borderColor: tokens.colorBorderStrong+ },+ ':focus-visible': {+ outline: 'none',+ boxShadow: `0 0 0 2px ${tokens.colorFocusRing}`+ }+ },+ secondaryPressed: {+ backgroundColor: tokens.colorSurfaceSecondary+ },+ outline: {backgroundColor: tokens.colorBackgroundSubtle,borderColor: tokens.colorBorderStrong,color: tokens.colorTextPrimary,@@ -106,7 +123,7 @@ export const styles = css.create({boxShadow: `0 0 0 2px ${tokens.colorFocusRing}`}},- secondaryPressed: {+ outlinePressed: {backgroundColor: tokens.colorSurfaceSecondary},ghost: {@@ -214,6 +231,7 @@ export const styles = css.create({textLg: { fontSize: tokens.fontSizeLg },textPrimary: { color: tokens.colorBackground },textSecondary: { color: tokens.colorTextPrimary },+ textOutline: { color: tokens.colorTextPrimary },textGhost: { color: tokens.colorTextSecondary },textLight: { color: tokens.colorOnAccent },textDanger: { color: tokens.colorDanger },diff --git a/packages/components/src/components/PeerListCard/PeerListCard.tsx b/packages/components/src/components/PeerListCard/PeerListCard.tsxindex 2b791bc..76376db 100644--- a/packages/components/src/components/PeerListCard/PeerListCard.tsx+++ b/packages/components/src/components/PeerListCard/PeerListCard.tsx@@ -72,7 +72,7 @@ function PairControl({ entry, onPair }: PeerRowProps) {switch (entry.pairState) {case 'pairable':return (- <Button size='sm' variant='secondary' onClick={() => onPair?.(entry.peerKey)}>+ <Button size='sm' variant='outline' onClick={() => onPair?.(entry.peerKey)}>Pair</Button>)diff --git a/packages/locales/src/locales/de-DE/settings.json b/packages/locales/src/locales/de-DE/settings.jsonindex 2a96277..9a3e606 100644--- a/packages/locales/src/locales/de-DE/settings.json+++ b/packages/locales/src/locales/de-DE/settings.json@@ -5,8 +5,7 @@"sections": {"general": "Allgemein","support": "Unterstützung",- "about": "Info",- "security": "Sicherheit"+ "about": "Info"},"crashReports": {"label": "Absturzberichte",@@ -89,6 +88,14 @@"autoSaveDescription": "Wenn deaktiviert, wirst du bei jeder Übertragung nach dem Speicherort gefragt.","change": "Ändern…","chooseFolder": "Ordner auswählen…",- "changeFailed": "Download-Ordner konnte nicht gespeichert werden"+ "changeFailed": "Download-Ordner konnte nicht gespeichert werden",+ "mediaToPhotosLabel": "Fotos & Videos in Fotos speichern",+ "mediaToGalleryLabel": "Fotos & Videos in der Galerie speichern",+ "destinationPhotos": "Fotos & Videos in Fotos",+ "destinationFiles": "Fotos & Videos in Dateien",+ "mediaToPhotosDescription": "Wenn deaktiviert, werden sie im AlterSend-Ordner in Dateien gespeichert.",+ "mediaToGalleryDescription": "Wenn deaktiviert, werden sie im Download-Ordner gespeichert.",+ "destinationGallery": "Fotos & Videos in die Galerie",+ "destinationDownloads": "Fotos & Videos in Downloads"}}diff --git a/packages/locales/src/locales/en-GB/settings.json b/packages/locales/src/locales/en-GB/settings.jsonindex 8ecb0dd..0199cc2 100644--- a/packages/locales/src/locales/en-GB/settings.json+++ b/packages/locales/src/locales/en-GB/settings.json@@ -5,8 +5,7 @@"sections": {"general": "General","support": "Support",- "about": "About",- "security": "Security"+ "about": "About"},"crashReports": {"label": "Crash reports",@@ -89,6 +88,14 @@"autoSaveDescription": "When off, you'll be asked where to save each transfer.","change": "Change…","chooseFolder": "Choose a folder…",- "changeFailed": "Couldn't save the download folder"+ "changeFailed": "Couldn't save the download folder",+ "mediaToPhotosLabel": "Save photos & videos to Photos",+ "mediaToGalleryLabel": "Save photos & videos to Gallery",+ "destinationPhotos": "Photos & videos to Photos",+ "destinationFiles": "Photos & videos to Files",+ "mediaToPhotosDescription": "When off, they're saved to the AlterSend folder in Files.",+ "mediaToGalleryDescription": "When off, they're saved to your Downloads folder.",+ "destinationGallery": "Photos & videos to Gallery",+ "destinationDownloads": "Photos & videos to Downloads"}}diff --git a/packages/locales/src/locales/en-US/settings.json b/packages/locales/src/locales/en-US/settings.jsonindex f08a802..313f3d9 100644--- a/packages/locales/src/locales/en-US/settings.json+++ b/packages/locales/src/locales/en-US/settings.json@@ -5,8 +5,7 @@"sections": {"general": "General","support": "Support",- "about": "About",- "security": "Security"+ "about": "About"},"crashReports": {"label": "Crash reports",@@ -24,7 +23,15 @@"autoSaveDescription": "When off, you'll be asked where to save each transfer.","change": "Change…","chooseFolder": "Choose a folder…",- "changeFailed": "Couldn't save the download folder"+ "changeFailed": "Couldn't save the download folder",+ "mediaToPhotosLabel": "Save photos & videos to Photos",+ "mediaToGalleryLabel": "Save photos & videos to Gallery",+ "destinationPhotos": "Photos & videos to Photos",+ "destinationFiles": "Photos & videos to Files",+ "mediaToPhotosDescription": "When off, they're saved to the AlterSend folder in Files.",+ "mediaToGalleryDescription": "When off, they're saved to your Downloads folder.",+ "destinationGallery": "Photos & videos to Gallery",+ "destinationDownloads": "Photos & videos to Downloads"},"rows": {"feedback": "Feedback",diff --git a/packages/locales/src/locales/es-419/settings.json b/packages/locales/src/locales/es-419/settings.jsonindex 385a14f..a9bed77 100644--- a/packages/locales/src/locales/es-419/settings.json+++ b/packages/locales/src/locales/es-419/settings.json@@ -5,8 +5,7 @@"sections": {"general": "General","support": "Soporte",- "about": "Acerca de",- "security": "Seguridad"+ "about": "Acerca de"},"crashReports": {"label": "Informes de fallos",@@ -89,6 +88,14 @@"autoSaveDescription": "Si está desactivado, se te preguntará dónde guardar cada transferencia.","change": "Cambiar…","chooseFolder": "Elegir una carpeta…",- "changeFailed": "No se pudo guardar la carpeta de descargas"+ "changeFailed": "No se pudo guardar la carpeta de descargas",+ "mediaToPhotosLabel": "Guardar fotos y videos en Fotos",+ "mediaToGalleryLabel": "Guardar fotos y videos en la Galería",+ "destinationPhotos": "Fotos y videos en Fotos",+ "destinationFiles": "Fotos y videos en Archivos",+ "mediaToPhotosDescription": "Si está desactivado, se guardan en la carpeta AlterSend de Archivos.",+ "mediaToGalleryDescription": "Si está desactivado, se guardan en tu carpeta de Descargas.",+ "destinationGallery": "Fotos y videos en la Galería",+ "destinationDownloads": "Fotos y videos en Descargas"}}diff --git a/packages/locales/src/locales/es-ES/settings.json b/packages/locales/src/locales/es-ES/settings.jsonindex 691f2ff..e1c5ab9 100644--- a/packages/locales/src/locales/es-ES/settings.json+++ b/packages/locales/src/locales/es-ES/settings.json@@ -5,8 +5,7 @@"sections": {"general": "General","support": "Soporte",- "about": "Acerca de",- "security": "Seguridad"+ "about": "Acerca de"},"crashReports": {"label": "Informes de fallos",@@ -89,6 +88,14 @@"autoSaveDescription": "Si está desactivado, se te preguntará dónde guardar cada transferencia.","change": "Cambiar…","chooseFolder": "Elegir una carpeta…",- "changeFailed": "No se pudo guardar la carpeta de descargas"+ "changeFailed": "No se pudo guardar la carpeta de descargas",+ "mediaToPhotosLabel": "Guardar fotos y vídeos en Fotos",+ "mediaToGalleryLabel": "Guardar fotos y vídeos en la Galería",+ "destinationPhotos": "Fotos y vídeos en Fotos",+ "destinationFiles": "Fotos y vídeos en Archivos",+ "mediaToPhotosDescription": "Si está desactivado, se guardan en la carpeta AlterSend de Archivos.",+ "mediaToGalleryDescription": "Si está desactivado, se guardan en tu carpeta de Descargas.",+ "destinationGallery": "Fotos y vídeos en la Galería",+ "destinationDownloads": "Fotos y vídeos en Descargas"}}diff --git a/packages/locales/src/locales/fr-FR/settings.json b/packages/locales/src/locales/fr-FR/settings.jsonindex 530b88a..ce23813 100644--- a/packages/locales/src/locales/fr-FR/settings.json+++ b/packages/locales/src/locales/fr-FR/settings.json@@ -5,8 +5,7 @@"sections": {"general": "Général","support": "Assistance",- "about": "À propos",- "security": "Sécurité"+ "about": "À propos"},"crashReports": {"label": "Rapports d'erreur",@@ -89,6 +88,14 @@"autoSaveDescription": "Si désactivé, un emplacement vous sera demandé à chaque transfert.","change": "Modifier…","chooseFolder": "Choisir un dossier…",- "changeFailed": "Impossible d'enregistrer le dossier de téléchargement"+ "changeFailed": "Impossible d'enregistrer le dossier de téléchargement",+ "mediaToPhotosLabel": "Enregistrer photos et vidéos dans Photos",+ "mediaToGalleryLabel": "Enregistrer photos et vidéos dans la Galerie",+ "destinationPhotos": "Photos et vidéos vers Photos",+ "destinationFiles": "Photos et vidéos vers Fichiers",+ "mediaToPhotosDescription": "Si désactivé, elles sont enregistrées dans le dossier AlterSend de Fichiers.",+ "mediaToGalleryDescription": "Si désactivé, elles sont enregistrées dans votre dossier Téléchargements.",+ "destinationGallery": "Photos et vidéos vers la Galerie",+ "destinationDownloads": "Photos et vidéos vers Téléchargements"}}diff --git a/packages/locales/src/locales/it-IT/settings.json b/packages/locales/src/locales/it-IT/settings.jsonindex 9ba45e0..e4f68d5 100644--- a/packages/locales/src/locales/it-IT/settings.json+++ b/packages/locales/src/locales/it-IT/settings.json@@ -5,8 +5,7 @@"sections": {"general": "Generale","support": "Supporto",- "about": "Informazioni",- "security": "Sicurezza"+ "about": "Informazioni"},"crashReports": {"label": "Rapporti sugli incidenti",@@ -89,6 +88,14 @@"autoSaveDescription": "Se disattivato, ti verrà chiesto dove salvare ogni trasferimento.","change": "Cambia…","chooseFolder": "Scegli una cartella…",- "changeFailed": "Impossibile salvare la cartella dei download"+ "changeFailed": "Impossibile salvare la cartella dei download",+ "mediaToPhotosLabel": "Salva foto e video in Foto",+ "mediaToGalleryLabel": "Salva foto e video nella Galleria",+ "destinationPhotos": "Foto e video in Foto",+ "destinationFiles": "Foto e video in File",+ "mediaToPhotosDescription": "Se disattivato, vengono salvati nella cartella AlterSend in File.",+ "mediaToGalleryDescription": "Se disattivato, vengono salvati nella cartella Download.",+ "destinationGallery": "Foto e video nella Galleria",+ "destinationDownloads": "Foto e video in Download"}}diff --git a/packages/locales/src/locales/ja-JP/settings.json b/packages/locales/src/locales/ja-JP/settings.jsonindex 0af08f2..c02e924 100644--- a/packages/locales/src/locales/ja-JP/settings.json+++ b/packages/locales/src/locales/ja-JP/settings.json@@ -5,8 +5,7 @@"sections": {"general": "一般","support": "サポート",- "about": "情報",- "security": "セキュリティ"+ "about": "情報"},"crashReports": {"label": "クラッシュレポート",@@ -89,6 +88,14 @@"autoSaveDescription": "オフの場合、転送ごとに保存先を確認します。","change": "変更…","chooseFolder": "フォルダを選択…",- "changeFailed": "ダウンロードフォルダを保存できませんでした"+ "changeFailed": "ダウンロードフォルダを保存できませんでした",+ "mediaToPhotosLabel": "写真とビデオを「写真」に保存",+ "mediaToGalleryLabel": "写真と動画をギャラリーに保存",+ "destinationPhotos": "写真とビデオを「写真」へ",+ "destinationFiles": "写真とビデオを「ファイル」へ",+ "mediaToPhotosDescription": "オフの場合、「ファイル」の AlterSend フォルダに保存されます。",+ "mediaToGalleryDescription": "オフの場合、ダウンロードフォルダに保存されます。",+ "destinationGallery": "写真と動画をギャラリーへ",+ "destinationDownloads": "写真と動画をダウンロードへ"}}diff --git a/packages/locales/src/locales/ko-KR/settings.json b/packages/locales/src/locales/ko-KR/settings.jsonindex e2e03f0..ebba495 100644--- a/packages/locales/src/locales/ko-KR/settings.json+++ b/packages/locales/src/locales/ko-KR/settings.json@@ -5,8 +5,7 @@"sections": {"general": "일반","support": "지원",- "about": "정보",- "security": "보안"+ "about": "정보"},"crashReports": {"label": "충돌 보고서",@@ -89,6 +88,14 @@"autoSaveDescription": "끄면 전송할 때마다 저장 위치를 묻습니다.","change": "변경…","chooseFolder": "폴더 선택…",- "changeFailed": "다운로드 폴더를 저장하지 못했습니다"+ "changeFailed": "다운로드 폴더를 저장하지 못했습니다",+ "mediaToPhotosLabel": "사진 및 동영상을 사진 앱에 저장",+ "mediaToGalleryLabel": "사진 및 동영상을 갤러리에 저장",+ "destinationPhotos": "사진 및 동영상을 사진 앱으로",+ "destinationFiles": "사진 및 동영상을 파일 앱으로",+ "mediaToPhotosDescription": "끄면 파일 앱의 AlterSend 폴더에 저장됩니다.",+ "mediaToGalleryDescription": "끄면 다운로드 폴더에 저장됩니다.",+ "destinationGallery": "사진 및 동영상을 갤러리로",+ "destinationDownloads": "사진 및 동영상을 다운로드로"}}diff --git a/packages/locales/src/locales/pt-BR/settings.json b/packages/locales/src/locales/pt-BR/settings.jsonindex 9c3f06d..9e11a10 100644--- a/packages/locales/src/locales/pt-BR/settings.json+++ b/packages/locales/src/locales/pt-BR/settings.json@@ -5,8 +5,7 @@"sections": {"general": "Geral","support": "Suporte",- "about": "Sobre",- "security": "Segurança"+ "about": "Sobre"},"crashReports": {"label": "Relatórios de falhas",@@ -89,6 +88,14 @@"autoSaveDescription": "Se desativado, você será perguntado onde salvar cada transferência.","change": "Alterar…","chooseFolder": "Escolher uma pasta…",- "changeFailed": "Não foi possível salvar a pasta de downloads"+ "changeFailed": "Não foi possível salvar a pasta de downloads",+ "mediaToPhotosLabel": "Salvar fotos e vídeos em Fotos",+ "mediaToGalleryLabel": "Salvar fotos e vídeos na Galeria",+ "destinationPhotos": "Fotos e vídeos em Fotos",+ "destinationFiles": "Fotos e vídeos em Arquivos",+ "mediaToPhotosDescription": "Se desativado, são salvos na pasta AlterSend em Arquivos.",+ "mediaToGalleryDescription": "Se desativado, são salvos na sua pasta Downloads.",+ "destinationGallery": "Fotos e vídeos na Galeria",+ "destinationDownloads": "Fotos e vídeos em Downloads"}}diff --git a/packages/locales/src/locales/ru-RU/settings.json b/packages/locales/src/locales/ru-RU/settings.jsonindex de8491e..1d4c4f6 100644--- a/packages/locales/src/locales/ru-RU/settings.json+++ b/packages/locales/src/locales/ru-RU/settings.json@@ -5,8 +5,7 @@"sections": {"general": "Основные","support": "Поддержка",- "about": "О приложении",- "security": "Безопасность"+ "about": "О приложении"},"crashReports": {"label": "Отчёты об ошибках",@@ -24,7 +23,15 @@"autoSaveDescription": "Если выключено, при каждом получении будет запрашиваться место сохранения.","change": "Изменить…","chooseFolder": "Выберите папку…",- "changeFailed": "Не удалось сохранить папку загрузок"+ "changeFailed": "Не удалось сохранить папку загрузок",+ "mediaToPhotosLabel": "Сохранять фото и видео в «Фото»",+ "mediaToGalleryLabel": "Сохранять фото и видео в Галерею",+ "destinationPhotos": "Фото и видео в «Фото»",+ "destinationFiles": "Фото и видео в «Файлы»",+ "mediaToPhotosDescription": "Если выключено, они сохраняются в папку AlterSend в «Файлах».",+ "mediaToGalleryDescription": "Если выключено, они сохраняются в папку «Загрузки».",+ "destinationGallery": "Фото и видео в Галерею",+ "destinationDownloads": "Фото и видео в «Загрузки»"},"rows": {"feedback": "Обратная связь",diff --git a/packages/locales/src/locales/zh-CN/settings.json b/packages/locales/src/locales/zh-CN/settings.jsonindex 369e1e6..85251e0 100644--- a/packages/locales/src/locales/zh-CN/settings.json+++ b/packages/locales/src/locales/zh-CN/settings.json@@ -5,8 +5,7 @@"sections": {"general": "通用","support": "支持",- "about": "关于",- "security": "安全"+ "about": "关于"},"crashReports": {"label": "崩溃报告",@@ -89,6 +88,14 @@"autoSaveDescription": "关闭后,每次传输都会询问保存位置。","change": "更改…","chooseFolder": "选择文件夹…",- "changeFailed": "无法保存下载文件夹"+ "changeFailed": "无法保存下载文件夹",+ "mediaToPhotosLabel": "将照片和视频保存到“照片”",+ "mediaToGalleryLabel": "将照片和视频保存到相册",+ "destinationPhotos": "照片和视频保存到“照片”",+ "destinationFiles": "照片和视频保存到“文件”",+ "mediaToPhotosDescription": "关闭后,将保存到“文件”中的 AlterSend 文件夹。",+ "mediaToGalleryDescription": "关闭后,将保存到下载文件夹。",+ "destinationGallery": "照片和视频保存到相册",+ "destinationDownloads": "照片和视频保存到下载"}}diff --git a/packages/locales/src/locales/zh-TW/settings.json b/packages/locales/src/locales/zh-TW/settings.jsonindex 0b43b96..42d415e 100644--- a/packages/locales/src/locales/zh-TW/settings.json+++ b/packages/locales/src/locales/zh-TW/settings.json@@ -5,8 +5,7 @@"sections": {"general": "一般","support": "支援",- "about": "關於",- "security": "安全"+ "about": "關於"},"crashReports": {"label": "崩潰報告",@@ -89,6 +88,14 @@"autoSaveDescription": "關閉後,每次傳輸都會詢問儲存位置。","change": "變更…","chooseFolder": "選擇資料夾…",- "changeFailed": "無法儲存下載資料夾"+ "changeFailed": "無法儲存下載資料夾",+ "mediaToPhotosLabel": "將照片和影片儲存到「照片」",+ "mediaToGalleryLabel": "將照片和影片儲存到相簿",+ "destinationPhotos": "照片和影片儲存到「照片」",+ "destinationFiles": "照片和影片儲存到「檔案」",+ "mediaToPhotosDescription": "關閉後,將儲存到「檔案」中的 AlterSend 資料夾。",+ "mediaToGalleryDescription": "關閉後,將儲存到下載資料夾。",+ "destinationGallery": "照片和影片儲存到相簿",+ "destinationDownloads": "照片和影片儲存到下載"}}