@oxyhq/services 22.9.0 → 22.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +24 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/AvatarCameraBadge.js +42 -0
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -0
- package/lib/commonjs/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +55 -133
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/commonjs/ui/components/OxyAuthChooser.js +657 -88
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +15 -1
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileSummaryCard.js +3 -23
- package/lib/commonjs/ui/components/ProfileSummaryCard.js.map +1 -1
- package/lib/commonjs/ui/components/RequireOxyAuth.js +1 -1
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js +63 -0
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -0
- package/lib/commonjs/ui/components/SurfaceScreen.js +91 -8
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +46 -29
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +47 -23
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js +81 -19
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +83 -23
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +83 -0
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +79 -29
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +18 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useFileQueries.js +129 -0
- package/lib/commonjs/ui/hooks/queries/useFileQueries.js.map +1 -0
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +38 -55
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useReduceMotion.js +57 -0
- package/lib/commonjs/ui/hooks/useReduceMotion.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +46 -0
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +36 -2
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +5 -6
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +4 -3
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceBackBridge.js +68 -0
- package/lib/commonjs/ui/navigation/surfaceBackBridge.js.map +1 -0
- package/lib/commonjs/ui/navigation/surfaceNavStack.js +62 -15
- package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceRegistry.js +84 -19
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaces.js +139 -25
- package/lib/commonjs/ui/navigation/surfaces.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +214 -283
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +88 -118
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +22 -36
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +219 -226
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +287 -289
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +301 -0
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +24 -39
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +136 -158
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +29 -36
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +101 -109
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +10 -15
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +8 -16
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +403 -627
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +62 -69
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +63 -79
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +69 -98
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +8 -14
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +77 -94
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +99 -134
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/NotificationsScreen.js +69 -76
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -8
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +67 -74
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +55 -91
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +291 -304
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +100 -114
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +38 -45
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +44 -57
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +24 -31
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +14 -24
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +16 -48
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +63 -0
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +54 -41
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +44 -81
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +66 -75
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +111 -139
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +13 -20
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +14 -27
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +68 -85
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +28 -36
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js +8 -3
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +11 -2
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +0 -79
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/index.js +12 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js +40 -0
- package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -0
- package/lib/module/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +57 -135
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/module/ui/components/OxyAuthChooser.js +659 -91
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +1 -1
- package/lib/module/ui/components/ProfileButton.js +16 -2
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/ProfileSummaryCard.js +2 -23
- package/lib/module/ui/components/ProfileSummaryCard.js.map +1 -1
- package/lib/module/ui/components/RequireOxyAuth.js +1 -1
- package/lib/module/ui/components/SurfaceHeaderAction.js +58 -0
- package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -0
- package/lib/module/ui/components/SurfaceScreen.js +93 -10
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +46 -29
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +46 -23
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js +81 -19
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +83 -25
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js +78 -0
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +80 -30
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +16 -0
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useFileQueries.js +120 -0
- package/lib/module/ui/hooks/queries/useFileQueries.js.map +1 -0
- package/lib/module/ui/hooks/useAvatarPicker.js +38 -55
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useReduceMotion.js +53 -0
- package/lib/module/ui/hooks/useReduceMotion.js.map +1 -0
- package/lib/module/ui/hooks/useSurfaceHeader.js +42 -0
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -0
- package/lib/module/ui/hooks/useSwitchableAccounts.js +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +34 -2
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +6 -7
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +4 -3
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/surfaceBackBridge.js +63 -0
- package/lib/module/ui/navigation/surfaceBackBridge.js.map +1 -0
- package/lib/module/ui/navigation/surfaceNavStack.js +62 -15
- package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -1
- package/lib/module/ui/navigation/surfaceRegistry.js +84 -19
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/module/ui/navigation/surfaces.js +138 -26
- package/lib/module/ui/navigation/surfaces.js.map +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js +218 -286
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +92 -121
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +25 -38
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +220 -227
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +289 -291
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ChangeAvatarScreen.js +298 -0
- package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -0
- package/lib/module/ui/screens/ConnectedAppsScreen.js +26 -40
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +139 -160
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +32 -38
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +102 -110
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +11 -15
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +10 -17
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +408 -631
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +64 -70
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +65 -81
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +71 -99
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +10 -15
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +78 -94
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +102 -137
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js +71 -77
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +4 -9
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +69 -75
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +58 -93
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +293 -305
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +102 -116
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +40 -46
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +46 -58
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +26 -32
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +14 -24
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +17 -49
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js +59 -0
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +54 -42
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +45 -81
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustAboutScreen.js +67 -75
- package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +112 -139
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustFAQScreen.js +15 -21
- package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +14 -26
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +69 -85
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +30 -37
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/resetSessionScopedStores.js +8 -3
- package/lib/module/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +11 -2
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +0 -78
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts +4 -0
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -0
- package/lib/typescript/{module/ui/components/OxyAccountDialog.d.ts → commonjs/ui/components/OxyAccountDialogScreen.d.ts} +5 -4
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +3 -3
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileSummaryCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +3 -4
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +17 -2
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts +75 -13
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +9 -0
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts +50 -0
- package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +17 -16
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts +14 -0
- package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +31 -0
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +27 -2
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +4 -5
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +21 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +101 -23
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +42 -11
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +18 -9
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts +34 -0
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts +8 -1
- package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +10 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +0 -48
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts +4 -0
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -0
- package/lib/typescript/{commonjs/ui/components/OxyAccountDialog.d.ts → module/ui/components/OxyAccountDialogScreen.d.ts} +5 -4
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +3 -3
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +2 -2
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileSummaryCard.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +1 -1
- package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts +16 -0
- package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +3 -4
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +17 -2
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts +75 -13
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
- package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +9 -0
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts +50 -0
- package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +17 -16
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts +14 -0
- package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +31 -0
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +27 -2
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +4 -5
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +21 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +101 -23
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaces.d.ts +42 -11
- package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +18 -9
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts +34 -0
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
- package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts +8 -1
- package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +10 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +0 -48
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/package.json +9 -5
- package/src/index.ts +12 -5
- package/src/ui/components/AvatarCameraBadge.tsx +35 -0
- package/src/ui/components/{OxyAccountDialog.tsx → OxyAccountDialogScreen.tsx} +50 -116
- package/src/ui/components/OxyAuthChooser.tsx +743 -86
- package/src/ui/components/OxyConsentScreen.tsx +1 -1
- package/src/ui/components/ProfileButton.tsx +18 -3
- package/src/ui/components/ProfileSummaryCard.tsx +2 -25
- package/src/ui/components/RequireOxyAuth.tsx +1 -1
- package/src/ui/components/SurfaceHeaderAction.tsx +60 -0
- package/src/ui/components/SurfaceScreen.tsx +108 -14
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +50 -36
- package/src/ui/components/modals/DeleteAccountModal.tsx +47 -26
- package/src/ui/components/oxyAuthChooserStyles.ts +78 -16
- package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +158 -84
- package/src/ui/components/photogrid/__tests__/chunkPhotos.test.ts +51 -0
- package/src/ui/components/surfaces/ActionSheetSurface.tsx +98 -0
- package/src/ui/context/OxyContext.tsx +79 -25
- package/src/ui/hooks/queries/queryKeys.ts +15 -0
- package/src/ui/hooks/queries/useFileQueries.ts +162 -0
- package/src/ui/hooks/useAvatarPicker.ts +46 -74
- package/src/ui/hooks/useReduceMotion.ts +58 -0
- package/src/ui/hooks/useSurfaceHeader.ts +57 -0
- package/src/ui/hooks/useSwitchableAccounts.ts +1 -1
- package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +55 -7
- package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +149 -0
- package/src/ui/navigation/accountDialogManager.ts +42 -2
- package/src/ui/navigation/bottomSheetManager.ts +6 -7
- package/src/ui/navigation/routes.ts +6 -4
- package/src/ui/navigation/surfaceBackBridge.ts +69 -0
- package/src/ui/navigation/surfaceNavStack.ts +72 -9
- package/src/ui/navigation/surfaceRegistry.ts +164 -24
- package/src/ui/navigation/surfaces.ts +137 -30
- package/src/ui/screens/AccountMembersScreen.tsx +39 -100
- package/src/ui/screens/AccountSettingsScreen.tsx +32 -54
- package/src/ui/screens/AccountVerificationScreen.tsx +23 -51
- package/src/ui/screens/AppInfoScreen.tsx +6 -13
- package/src/ui/screens/AvatarCropScreen.tsx +340 -311
- package/src/ui/screens/ChangeAvatarScreen.tsx +359 -0
- package/src/ui/screens/ConnectedAppsScreen.tsx +39 -60
- package/src/ui/screens/CreateAccountScreen.tsx +13 -39
- package/src/ui/screens/EditProfileFieldScreen.tsx +30 -48
- package/src/ui/screens/EditProfileScreen.tsx +7 -16
- package/src/ui/screens/FAQScreen.tsx +9 -13
- package/src/ui/screens/FeedbackScreen.tsx +8 -22
- package/src/ui/screens/FileManagementScreen.tsx +370 -610
- package/src/ui/screens/HelpSupportScreen.tsx +7 -13
- package/src/ui/screens/HistoryViewScreen.tsx +26 -31
- package/src/ui/screens/LanguageSelectorScreen.tsx +12 -46
- package/src/ui/screens/LearnMoreUsernamesScreen.tsx +8 -16
- package/src/ui/screens/LegalDocumentsScreen.tsx +7 -22
- package/src/ui/screens/ManageAccountScreen.tsx +96 -165
- package/src/ui/screens/NotificationsScreen.tsx +7 -13
- package/src/ui/screens/PaymentGatewayScreen.tsx +3 -10
- package/src/ui/screens/PreferencesScreen.tsx +7 -13
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +52 -90
- package/src/ui/screens/PrivacySettingsScreen.tsx +9 -21
- package/src/ui/screens/ProfileScreen.tsx +9 -11
- package/src/ui/screens/SavesCollectionsScreen.tsx +7 -13
- package/src/ui/screens/SearchSettingsScreen.tsx +9 -21
- package/src/ui/screens/UserLinksScreen.tsx +7 -14
- package/src/ui/screens/UserListScreen.tsx +2 -5
- package/src/ui/screens/WelcomeNewUserScreen.tsx +18 -48
- package/src/ui/screens/fileManagement/FileLibraryError.tsx +56 -0
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +56 -46
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +55 -71
- package/src/ui/screens/trust/TrustAboutScreen.tsx +10 -17
- package/src/ui/screens/trust/TrustCenterScreen.tsx +9 -28
- package/src/ui/screens/trust/TrustFAQScreen.tsx +15 -18
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +3 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +11 -26
- package/src/ui/screens/trust/TrustRulesScreen.tsx +10 -13
- package/src/ui/stores/resetSessionScopedStores.ts +8 -3
- package/src/ui/types/navigation.ts +10 -0
- package/src/ui/utils/avatarUtils.ts +11 -2
- package/src/ui/utils/fileManagement.ts +1 -101
- package/lib/commonjs/ui/components/Header.js +0 -305
- package/lib/commonjs/ui/components/Header.js.map +0 -1
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/commonjs/ui/stores/fileStore.js +0 -153
- package/lib/commonjs/ui/stores/fileStore.js.map +0 -1
- package/lib/module/ui/components/Header.js +0 -299
- package/lib/module/ui/components/Header.js.map +0 -1
- package/lib/module/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/module/ui/stores/fileStore.js +0 -145
- package/lib/module/ui/stores/fileStore.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/Header.d.ts +0 -33
- package/lib/typescript/commonjs/ui/components/Header.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/stores/fileStore.d.ts +0 -31
- package/lib/typescript/commonjs/ui/stores/fileStore.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/Header.d.ts +0 -33
- package/lib/typescript/module/ui/components/Header.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/lib/typescript/module/ui/stores/fileStore.d.ts +0 -31
- package/lib/typescript/module/ui/stores/fileStore.d.ts.map +0 -1
- package/src/ui/components/Header.tsx +0 -224
- package/src/ui/stores/fileStore.ts +0 -118
|
@@ -6,26 +6,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
9
10
|
var _expoImage = require("expo-image");
|
|
10
11
|
var _bloom = require("@oxyhq/bloom");
|
|
12
|
+
var _surfaces = require("@oxyhq/bloom/surfaces");
|
|
11
13
|
var Skeleton = _interopRequireWildcard(require("@oxyhq/bloom/skeleton"));
|
|
12
14
|
var _vectorIcons = require("@expo/vector-icons");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
+
var _queryKeys = require("../hooks/queries/queryKeys.js");
|
|
16
|
+
var _useFileQueries = require("../hooks/queries/useFileQueries.js");
|
|
17
|
+
var _useSurfaceHeader = require("../hooks/useSurfaceHeader.js");
|
|
18
|
+
var _SurfaceHeaderAction = require("../components/SurfaceHeaderAction.js");
|
|
15
19
|
var _JustifiedPhotoGrid = _interopRequireDefault(require("../components/photogrid/JustifiedPhotoGrid.js"));
|
|
16
20
|
var _theme = require("@oxyhq/bloom/theme");
|
|
17
21
|
var _OxyContext = require("../context/OxyContext.js");
|
|
18
22
|
var _useI18n = require("../hooks/useI18n.js");
|
|
23
|
+
var _useReduceMotion = require("../hooks/useReduceMotion.js");
|
|
19
24
|
var _useAccountMutations = require("../hooks/mutations/useAccountMutations.js");
|
|
20
25
|
var _fileManagement = require("../utils/fileManagement.js");
|
|
21
26
|
var _useResolvedFileUrls = require("../hooks/useResolvedFileUrls.js");
|
|
22
27
|
var _FileViewer = require("../components/fileManagement/FileViewer.js");
|
|
23
28
|
var _FileDetailsModal = require("../components/fileManagement/FileDetailsModal.js");
|
|
24
29
|
var _UploadPreview = require("../components/fileManagement/UploadPreview.js");
|
|
30
|
+
var _ActionSheetSurface = require("../components/surfaces/ActionSheetSurface.js");
|
|
25
31
|
var _shared = require("./fileManagement/shared.js");
|
|
26
32
|
var _useFileUploadState = require("./fileManagement/hooks/useFileUploadState.js");
|
|
27
33
|
var _PhotoPickerSection = _interopRequireDefault(require("./fileManagement/PhotoPickerSection.js"));
|
|
28
34
|
var _FileListSection = _interopRequireDefault(require("./fileManagement/FileListSection.js"));
|
|
35
|
+
var _FileLibraryError = _interopRequireDefault(require("./fileManagement/FileLibraryError.js"));
|
|
29
36
|
var _UploadBar = _interopRequireDefault(require("./fileManagement/UploadBar.js"));
|
|
30
37
|
var _AnimatedButton = require("../components/fileManagement/AnimatedButton.js");
|
|
31
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -34,6 +41,20 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
34
41
|
// Genuinely-inline-only styles: `viewModeButton` is spread into an Animated.View
|
|
35
42
|
// style array (interpolated backgroundColor), and the photo tiles are
|
|
36
43
|
// `expo-image` (no className remap). Everything else uses NativeWind classNames.
|
|
44
|
+
// Nav-header slot layout for this screen's action row + review-mode back button.
|
|
45
|
+
const fmHeaderStyles = _reactNative.StyleSheet.create({
|
|
46
|
+
actionsRow: {
|
|
47
|
+
flexDirection: 'row',
|
|
48
|
+
gap: 8
|
|
49
|
+
},
|
|
50
|
+
backButton: {
|
|
51
|
+
width: 36,
|
|
52
|
+
height: 36,
|
|
53
|
+
borderRadius: 18,
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
37
58
|
const screenStyles = _reactNative.StyleSheet.create({
|
|
38
59
|
viewModeButton: {
|
|
39
60
|
paddingHorizontal: 10,
|
|
@@ -44,11 +65,6 @@ const screenStyles = _reactNative.StyleSheet.create({
|
|
|
44
65
|
justifyContent: 'center',
|
|
45
66
|
marginHorizontal: 1
|
|
46
67
|
},
|
|
47
|
-
photoImage: {
|
|
48
|
-
width: '100%',
|
|
49
|
-
height: '100%',
|
|
50
|
-
borderRadius: 8
|
|
51
|
-
},
|
|
52
68
|
justifiedPhotoImage: {
|
|
53
69
|
width: '100%',
|
|
54
70
|
height: '100%',
|
|
@@ -57,9 +73,9 @@ const screenStyles = _reactNative.StyleSheet.create({
|
|
|
57
73
|
});
|
|
58
74
|
const FileManagementScreen = ({
|
|
59
75
|
onClose,
|
|
60
|
-
theme,
|
|
61
76
|
goBack,
|
|
62
77
|
navigate,
|
|
78
|
+
dismiss,
|
|
63
79
|
userId,
|
|
64
80
|
containerWidth,
|
|
65
81
|
selectMode = false,
|
|
@@ -85,57 +101,49 @@ const FileManagementScreen = ({
|
|
|
85
101
|
const {
|
|
86
102
|
t
|
|
87
103
|
} = (0, _useI18n.useI18n)();
|
|
104
|
+
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
88
105
|
const uploadFileMutation = (0, _useAccountMutations.useUploadFile)();
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
106
|
+
|
|
107
|
+
// Files are owned by the ACTIVE account. `targetUserId` scopes the query key,
|
|
108
|
+
// so switching accounts (or an explicit `userId` prop) shows that account's
|
|
109
|
+
// library with no manual reset.
|
|
110
|
+
const targetUserId = userId || user?.id;
|
|
111
|
+
|
|
112
|
+
// The file list is React Query's, NOT a store: infinite-paginated, fetched on
|
|
113
|
+
// mount + on owner change, edited optimistically via cache helpers. The
|
|
114
|
+
// rendered list is the flattened pages.
|
|
115
|
+
const filesQuery = (0, _useFileQueries.useUserFilesInfinite)(targetUserId);
|
|
116
|
+
const files = (0, _react.useMemo)(() => filesQuery.data?.pages.flatMap(page => page.files) ?? [], [filesQuery.data]);
|
|
117
|
+
// No owner resolved yet reads as "loading" (matches the old skeleton-until-
|
|
118
|
+
// first-load behaviour); `isLoading` is the first-page fetch only.
|
|
119
|
+
const isLoadingFiles = !targetUserId || filesQuery.isLoading;
|
|
120
|
+
const isRefreshingFiles = filesQuery.isRefetching;
|
|
121
|
+
const isFetchingMore = filesQuery.isFetchingNextPage;
|
|
122
|
+
const hasMoreFiles = filesQuery.hasNextPage ?? false;
|
|
123
|
+
// Terminal load failure with nothing cached — render a DISTINCT error state
|
|
124
|
+
// (not the empty state) so a failed load never looks like an empty library.
|
|
125
|
+
const hasLoadError = filesQuery.isError && files.length === 0;
|
|
126
|
+
const invalidateFiles = (0, _react.useCallback)(() => {
|
|
127
|
+
queryClient.invalidateQueries({
|
|
128
|
+
queryKey: _queryKeys.queryKeys.files.list(targetUserId)
|
|
129
|
+
});
|
|
130
|
+
}, [queryClient, targetUserId]);
|
|
95
131
|
const {
|
|
96
132
|
width: windowWidth
|
|
97
133
|
} = (0, _reactNative.useWindowDimensions)();
|
|
98
134
|
// Prefer an explicit sheet width from the router; fall back to the window
|
|
99
135
|
// so photo grids never size against a hardcoded 400px default.
|
|
100
136
|
const safeContainerWidth = typeof containerWidth === 'number' && containerWidth > 0 ? containerWidth : windowWidth;
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
const deleting = (0, _fileStore.useDeleting)();
|
|
104
|
-
const [loading, setLoading] = (0, _react.useState)(true);
|
|
105
|
-
const [refreshing, setRefreshing] = (0, _react.useState)(false);
|
|
106
|
-
const [paging, setPaging] = (0, _react.useState)({
|
|
107
|
-
offset: 0,
|
|
108
|
-
limit: 40,
|
|
109
|
-
total: 0,
|
|
110
|
-
hasMore: true,
|
|
111
|
-
loadingMore: false
|
|
112
|
-
});
|
|
113
|
-
const [selectedFile, setSelectedFile] = (0, _react.useState)(null);
|
|
114
|
-
const fileDetailsControl = (0, _bloom.useDialogControl)();
|
|
137
|
+
// In-flight delete target (local UI state — was in the file store).
|
|
138
|
+
const [deletingId, setDeletingId] = (0, _react.useState)(null);
|
|
115
139
|
// In selectMode we never open the detailed viewer
|
|
116
140
|
const [openedFile, setOpenedFile] = (0, _react.useState)(null);
|
|
117
141
|
const [fileContent, setFileContent] = (0, _react.useState)(null);
|
|
118
142
|
const [loadingFileContent, setLoadingFileContent] = (0, _react.useState)(false);
|
|
119
143
|
const [showFileDetailsInViewer, setShowFileDetailsInViewer] = (0, _react.useState)(false);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
// Used by `PhotoPickerView` to skip cell stagger animations.
|
|
124
|
-
(0, _react.useEffect)(() => {
|
|
125
|
-
let cancelled = false;
|
|
126
|
-
_reactNative.AccessibilityInfo.isReduceMotionEnabled().then(enabled => {
|
|
127
|
-
if (!cancelled) setReduceMotion(enabled);
|
|
128
|
-
}).catch(() => {
|
|
129
|
-
// Defaults to false; no action needed.
|
|
130
|
-
});
|
|
131
|
-
const sub = _reactNative.AccessibilityInfo.addEventListener('reduceMotionChanged', enabled => {
|
|
132
|
-
setReduceMotion(enabled);
|
|
133
|
-
});
|
|
134
|
-
return () => {
|
|
135
|
-
cancelled = true;
|
|
136
|
-
sub.remove();
|
|
137
|
-
};
|
|
138
|
-
}, []);
|
|
144
|
+
// Reduce-motion preference, read as an external store (no effect). Passed to
|
|
145
|
+
// `PhotoPickerView` to skip cell stagger animations.
|
|
146
|
+
const reduceMotion = (0, _useReduceMotion.useReduceMotion)();
|
|
139
147
|
|
|
140
148
|
// Image-only picker mode: when the consumer restricts to image MIME types
|
|
141
149
|
// (e.g. avatar picker), photos grid is the more useful default view.
|
|
@@ -187,24 +195,59 @@ const FileManagementScreen = ({
|
|
|
187
195
|
});
|
|
188
196
|
return sorted;
|
|
189
197
|
}, [files, searchQuery, viewMode, sortBy, sortOrder]);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const [
|
|
194
|
-
// Selection state
|
|
195
|
-
const [selectedIds, setSelectedIds] = (0, _react.useState)(new Set(initialSelectedIds));
|
|
196
|
-
const [lastSelectedFileId, setLastSelectedFileId] = (0, _react.useState)(null);
|
|
198
|
+
// Selection state. `initialSelectedIds` is the INITIAL selection only (lazy
|
|
199
|
+
// init) — there is no prop→state sync effect, since no caller mutates it
|
|
200
|
+
// after mount.
|
|
201
|
+
const [selectedIds, setSelectedIds] = (0, _react.useState)(() => new Set(initialSelectedIds));
|
|
197
202
|
const scrollViewRef = (0, _react.useRef)(null);
|
|
198
203
|
const photoScrollViewRef = (0, _react.useRef)(null);
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
|
|
205
|
+
// Scroll the browse list/grid to a just-selected file. Driven directly from
|
|
206
|
+
// the selection event handler (double-rAF so the selection re-render has
|
|
207
|
+
// committed first) — not an effect. No-ops in the image-only picker, whose
|
|
208
|
+
// own FlatList is not either ScrollView ref.
|
|
209
|
+
const scrollToSelectedFile = (0, _react.useCallback)(fileId => {
|
|
210
|
+
if (viewMode === 'all' && scrollViewRef.current) {
|
|
211
|
+
const itemIndex = filteredFiles.findIndex(file => file.id === fileId);
|
|
212
|
+
if (itemIndex < 0) return;
|
|
213
|
+
// GroupedItem dense rows are ~65px, +30px when a description wraps.
|
|
214
|
+
const baseItemHeight = 65;
|
|
215
|
+
const descriptionHeight = 30;
|
|
216
|
+
let scrollPosition = 0;
|
|
217
|
+
for (let i = 0; i <= itemIndex && i < filteredFiles.length; i++) {
|
|
218
|
+
scrollPosition += baseItemHeight;
|
|
219
|
+
if (filteredFiles[i].metadata?.description) scrollPosition += descriptionHeight;
|
|
220
|
+
}
|
|
221
|
+
// Offset for the header/controls/search/stats chrome (~250px) so the
|
|
222
|
+
// item lands near the top, not under the chrome.
|
|
223
|
+
const finalScrollPosition = 250 + scrollPosition - 150;
|
|
224
|
+
requestAnimationFrame(() => {
|
|
225
|
+
requestAnimationFrame(() => {
|
|
226
|
+
scrollViewRef.current?.scrollTo({
|
|
227
|
+
y: Math.max(0, finalScrollPosition),
|
|
228
|
+
animated: true
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
} else if (viewMode === 'photos' && photoScrollViewRef.current) {
|
|
233
|
+
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
234
|
+
const photoIndex = photos.findIndex(p => p.id === fileId);
|
|
235
|
+
if (photoIndex < 0) return;
|
|
236
|
+
// Rough estimate for the justified grid (3 photos/row, variable heights).
|
|
237
|
+
const row = Math.floor(photoIndex / 3);
|
|
238
|
+
const finalScrollPosition = row * (150 + 4) - 100;
|
|
239
|
+
requestAnimationFrame(() => {
|
|
240
|
+
requestAnimationFrame(() => {
|
|
241
|
+
photoScrollViewRef.current?.scrollTo({
|
|
242
|
+
y: Math.max(0, finalScrollPosition),
|
|
243
|
+
animated: true
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
});
|
|
203
247
|
}
|
|
204
|
-
}, [
|
|
248
|
+
}, [viewMode, filteredFiles]);
|
|
205
249
|
const toggleSelect = (0, _react.useCallback)(async file => {
|
|
206
|
-
//
|
|
207
|
-
// if (!selectMode) return;
|
|
250
|
+
// Selection is allowed in regular mode too (for bulk operations).
|
|
208
251
|
if (disabledMimeTypes.length) {
|
|
209
252
|
const blocked = disabledMimeTypes.some(mt => file.contentType === mt || file.contentType.startsWith(mt.endsWith('/') ? mt : `${mt}/`));
|
|
210
253
|
if (blocked) {
|
|
@@ -223,9 +266,6 @@ const FileManagementScreen = ({
|
|
|
223
266
|
}
|
|
224
267
|
}
|
|
225
268
|
|
|
226
|
-
// Track the selected file for scrolling
|
|
227
|
-
setLastSelectedFileId(file.id);
|
|
228
|
-
|
|
229
269
|
// Link file to entity if linkContext is provided
|
|
230
270
|
if (linkContext) {
|
|
231
271
|
try {
|
|
@@ -235,11 +275,19 @@ const FileManagementScreen = ({
|
|
|
235
275
|
}
|
|
236
276
|
}
|
|
237
277
|
if (!multiSelect) {
|
|
238
|
-
onSelect
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
278
|
+
if (onSelect) {
|
|
279
|
+
// Legacy callback caller (inbox, WelcomeNewUser): keep the
|
|
280
|
+
// callback + afterSelect behaviour unchanged.
|
|
281
|
+
onSelect(file);
|
|
282
|
+
if (afterSelect === 'back') {
|
|
283
|
+
goBack?.();
|
|
284
|
+
} else if (afterSelect === 'close') {
|
|
285
|
+
onClose?.();
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
// Promise-based picker (avatar picker): resolve the surface's
|
|
289
|
+
// present() promise with the picked file.
|
|
290
|
+
dismiss?.(file);
|
|
243
291
|
}
|
|
244
292
|
return;
|
|
245
293
|
}
|
|
@@ -259,13 +307,14 @@ const FileManagementScreen = ({
|
|
|
259
307
|
}
|
|
260
308
|
return next;
|
|
261
309
|
});
|
|
262
|
-
|
|
310
|
+
scrollToSelectedFile(file.id);
|
|
311
|
+
}, [multiSelect, onSelect, onClose, goBack, dismiss, disabledMimeTypes, maxSelection, afterSelect, defaultVisibility, oxyServices, linkContext, t, scrollToSelectedFile]);
|
|
263
312
|
const confirmMultiSelection = (0, _react.useCallback)(async () => {
|
|
264
313
|
if (!selectMode || !multiSelect) return;
|
|
265
314
|
const map = {};
|
|
266
|
-
|
|
315
|
+
for (const f of files) {
|
|
267
316
|
map[f.id] = f;
|
|
268
|
-
}
|
|
317
|
+
}
|
|
269
318
|
const chosen = Array.from(selectedIds).map(id => map[id]).filter(Boolean);
|
|
270
319
|
|
|
271
320
|
// Update visibility and link files if needed
|
|
@@ -292,9 +341,15 @@ const FileManagementScreen = ({
|
|
|
292
341
|
|
|
293
342
|
// Wait for all updates (but don't block on failures)
|
|
294
343
|
await Promise.allSettled(updatePromises);
|
|
295
|
-
onConfirmSelection
|
|
296
|
-
|
|
297
|
-
|
|
344
|
+
if (onConfirmSelection) {
|
|
345
|
+
// Legacy callback caller (inbox): keep the callback + close.
|
|
346
|
+
onConfirmSelection(chosen);
|
|
347
|
+
onClose?.();
|
|
348
|
+
} else {
|
|
349
|
+
// Promise-based picker: resolve the surface with the chosen files.
|
|
350
|
+
dismiss?.(chosen);
|
|
351
|
+
}
|
|
352
|
+
}, [selectMode, multiSelect, selectedIds, files, onConfirmSelection, onClose, dismiss, defaultVisibility, oxyServices, linkContext]);
|
|
298
353
|
|
|
299
354
|
// Private-safe thumbnail URLs for the currently-shown files, resolved in
|
|
300
355
|
// ONE batch per page (not N per-tile) and cached by React Query. Uploads
|
|
@@ -313,81 +368,16 @@ const FileManagementScreen = ({
|
|
|
313
368
|
// FileManagementScreen uses a slightly elevated page background.
|
|
314
369
|
const backgroundColor = colors.backgroundSecondary;
|
|
315
370
|
const borderColor = colors.border;
|
|
316
|
-
const targetUserId = userId || user?.id;
|
|
317
|
-
const storeSetDeleting = (0, _fileStore.useFileStore)(s => s.setDeleting);
|
|
318
|
-
const loadFiles = (0, _react.useCallback)(async (mode = 'initial') => {
|
|
319
|
-
if (!targetUserId) return;
|
|
320
|
-
try {
|
|
321
|
-
if (mode === 'refresh') {
|
|
322
|
-
setRefreshing(true);
|
|
323
|
-
} else if (mode === 'initial') {
|
|
324
|
-
setLoading(true);
|
|
325
|
-
setPaging(p => ({
|
|
326
|
-
...p,
|
|
327
|
-
offset: 0,
|
|
328
|
-
hasMore: true
|
|
329
|
-
}));
|
|
330
|
-
} else if (mode === 'more') {
|
|
331
|
-
// Prevent duplicate fetches
|
|
332
|
-
setPaging(p => ({
|
|
333
|
-
...p,
|
|
334
|
-
loadingMore: true
|
|
335
|
-
}));
|
|
336
|
-
}
|
|
337
|
-
const currentPaging = mode === 'more' ? prevPagingRef.current ?? paging : paging;
|
|
338
|
-
const effectiveOffset = mode === 'more' ? currentPaging.offset + currentPaging.limit : 0;
|
|
339
|
-
const response = await oxyServices.listUserFiles(currentPaging.limit, effectiveOffset);
|
|
340
|
-
const assets = (response.files || []).map(f => ({
|
|
341
|
-
id: f.id,
|
|
342
|
-
filename: f.originalName ?? f.sha256 ?? '',
|
|
343
|
-
contentType: f.mime ?? '',
|
|
344
|
-
length: f.size ?? 0,
|
|
345
|
-
chunkSize: 0,
|
|
346
|
-
uploadDate: f.createdAt ?? '',
|
|
347
|
-
metadata: f.metadata ?? {},
|
|
348
|
-
variants: f.variants ?? []
|
|
349
|
-
}));
|
|
350
|
-
if (mode === 'more') {
|
|
351
|
-
// append
|
|
352
|
-
_fileStore.useFileStore.getState().setFiles(assets, {
|
|
353
|
-
merge: true
|
|
354
|
-
});
|
|
355
|
-
setPaging(p => ({
|
|
356
|
-
...p,
|
|
357
|
-
offset: effectiveOffset,
|
|
358
|
-
total: response.total || effectiveOffset + assets.length,
|
|
359
|
-
hasMore: response.hasMore,
|
|
360
|
-
loadingMore: false
|
|
361
|
-
}));
|
|
362
|
-
} else {
|
|
363
|
-
_fileStore.useFileStore.getState().setFiles(assets, {
|
|
364
|
-
merge: false
|
|
365
|
-
});
|
|
366
|
-
setPaging(p => ({
|
|
367
|
-
...p,
|
|
368
|
-
offset: 0,
|
|
369
|
-
total: response.total || assets.length,
|
|
370
|
-
hasMore: response.hasMore,
|
|
371
|
-
loadingMore: false
|
|
372
|
-
}));
|
|
373
|
-
}
|
|
374
|
-
} catch (error) {
|
|
375
|
-
_bloom.toast.error((0, _shared.getErrorMessage)(error) || t('fileManagement.toasts.loadFailed'));
|
|
376
|
-
} finally {
|
|
377
|
-
setLoading(false);
|
|
378
|
-
setRefreshing(false);
|
|
379
|
-
setPaging(p => ({
|
|
380
|
-
...p,
|
|
381
|
-
loadingMore: false
|
|
382
|
-
}));
|
|
383
|
-
}
|
|
384
|
-
}, [targetUserId, oxyServices, paging]);
|
|
385
371
|
|
|
386
372
|
// Self-contained document-picking + upload-preview state and handlers.
|
|
373
|
+
// Optimistic uploads edit the file query cache directly (see
|
|
374
|
+
// useFileQueries), so no loader is threaded in.
|
|
387
375
|
const {
|
|
388
376
|
isPickingDocument,
|
|
389
377
|
pendingFiles,
|
|
390
378
|
showUploadPreview,
|
|
379
|
+
uploading,
|
|
380
|
+
uploadProgress,
|
|
391
381
|
handleFileUpload,
|
|
392
382
|
handleConfirmUpload,
|
|
393
383
|
handleCancelUpload,
|
|
@@ -404,154 +394,59 @@ const FileManagementScreen = ({
|
|
|
404
394
|
onClose,
|
|
405
395
|
selectedIds,
|
|
406
396
|
setSelectedIds,
|
|
407
|
-
loadFiles,
|
|
408
397
|
t
|
|
409
398
|
});
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
// Load photo dimensions for justified grid - unified approach using Image.getSize
|
|
420
|
-
const loadPhotoDimensions = (0, _react.useCallback)(async photos => {
|
|
421
|
-
if (photos.length === 0) return;
|
|
422
|
-
setLoadingDimensions(true);
|
|
423
|
-
|
|
424
|
-
// Snapshot ids missing from the cache at kick-off; concurrent runs may
|
|
425
|
-
// overlap but each merge is applied via a functional updater.
|
|
426
|
-
const photosToLoad = photos.filter(photo => !photoDimensionsRef.current[photo.id]);
|
|
427
|
-
if (photosToLoad.length === 0) {
|
|
428
|
-
setLoadingDimensions(false);
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
try {
|
|
432
|
-
const measured = {};
|
|
433
|
-
await Promise.all(photosToLoad.map(async photo => {
|
|
434
|
-
try {
|
|
435
|
-
const downloadUrl = thumbSourceFor(photo);
|
|
436
|
-
// URL not resolved yet — skip (do NOT record fallback
|
|
437
|
-
// dims) so this photo is re-measured once its private-safe
|
|
438
|
-
// URL resolves. Measuring the broken public URL is exactly
|
|
439
|
-
// the bug we are fixing.
|
|
440
|
-
if (!downloadUrl) {
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
// Unified approach using Image.getSize (works on all platforms)
|
|
445
|
-
await new Promise(resolve => {
|
|
446
|
-
_reactNative.Image.getSize(downloadUrl, (width, height) => {
|
|
447
|
-
measured[photo.id] = {
|
|
448
|
-
width,
|
|
449
|
-
height
|
|
450
|
-
};
|
|
451
|
-
resolve();
|
|
452
|
-
}, () => {
|
|
453
|
-
// Fallback dimensions
|
|
454
|
-
measured[photo.id] = {
|
|
455
|
-
width: 1,
|
|
456
|
-
height: 1
|
|
457
|
-
};
|
|
458
|
-
resolve();
|
|
459
|
-
});
|
|
460
|
-
});
|
|
461
|
-
} catch (error) {
|
|
462
|
-
// Fallback dimensions for any errors
|
|
463
|
-
measured[photo.id] = {
|
|
464
|
-
width: 1,
|
|
465
|
-
height: 1
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
}));
|
|
469
|
-
if (Object.keys(measured).length > 0) {
|
|
470
|
-
setPhotoDimensions(prev => ({
|
|
471
|
-
...prev,
|
|
472
|
-
...measured
|
|
473
|
-
}));
|
|
474
|
-
}
|
|
475
|
-
} catch (error) {
|
|
476
|
-
// Photo dimensions loading failed, continue without dimensions
|
|
477
|
-
} finally {
|
|
478
|
-
setLoadingDimensions(false);
|
|
479
|
-
}
|
|
480
|
-
}, [thumbSourceFor]);
|
|
481
|
-
|
|
482
|
-
// Re-measure photo dimensions when their private-safe URLs resolve. The
|
|
483
|
-
// justified grid's own trigger fires on the photo SET, not on URL
|
|
484
|
-
// availability, so newly-resolved private tiles would otherwise keep their
|
|
485
|
-
// skipped (unmeasured) state and render with fallback geometry.
|
|
486
|
-
(0, _react.useEffect)(() => {
|
|
487
|
-
if (viewMode !== 'photos') return;
|
|
488
|
-
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
489
|
-
if (photos.length > 0) {
|
|
490
|
-
loadPhotoDimensions(photos);
|
|
491
|
-
}
|
|
492
|
-
}, [resolvedThumbUrls, viewMode, filteredFiles, loadPhotoDimensions]);
|
|
493
|
-
|
|
494
|
-
// Create justified rows from photos with responsive algorithm
|
|
495
|
-
const createJustifiedRows = (0, _react.useCallback)((photos, containerWidth) => {
|
|
496
|
-
if (photos.length === 0) return [];
|
|
497
|
-
const rows = [];
|
|
498
|
-
const photosPerRow = 3; // Fixed 3 photos per row for consistency
|
|
499
|
-
|
|
500
|
-
for (let i = 0; i < photos.length; i += photosPerRow) {
|
|
501
|
-
const rowPhotos = photos.slice(i, i + photosPerRow);
|
|
502
|
-
rows.push(rowPhotos);
|
|
503
|
-
}
|
|
504
|
-
return rows;
|
|
505
|
-
}, []);
|
|
506
|
-
const confirmFileDelete = (0, _react.useCallback)((fileId, filename) => {
|
|
507
|
-
setPendingDeleteFile({
|
|
508
|
-
id: fileId,
|
|
509
|
-
name: filename
|
|
399
|
+
const confirmFileDelete = (0, _react.useCallback)(async (fileId, filename) => {
|
|
400
|
+
const confirmed = await _surfaces.surfaces.confirm({
|
|
401
|
+
title: t('fileManagement.deleteFile') || 'Delete File',
|
|
402
|
+
message: t('fileManagement.confirms.deleteFile', {
|
|
403
|
+
filename
|
|
404
|
+
}),
|
|
405
|
+
confirmLabel: t('fileManagement.confirm') || 'Delete',
|
|
406
|
+
cancelLabel: t('common.cancel') || 'Cancel',
|
|
407
|
+
destructive: true
|
|
510
408
|
});
|
|
511
|
-
|
|
512
|
-
}, [fileDeleteDialog]);
|
|
513
|
-
const handleFileDelete = (0, _react.useCallback)(async () => {
|
|
514
|
-
if (!pendingDeleteFile) return;
|
|
515
|
-
const {
|
|
516
|
-
id: fileId
|
|
517
|
-
} = pendingDeleteFile;
|
|
409
|
+
if (!confirmed) return;
|
|
518
410
|
try {
|
|
519
|
-
|
|
411
|
+
setDeletingId(fileId);
|
|
520
412
|
await oxyServices.deleteFile(fileId);
|
|
521
413
|
_bloom.toast.success(t('fileManagement.toasts.deleteSuccess'));
|
|
522
414
|
|
|
523
|
-
//
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
// Silent background reconcile
|
|
527
|
-
setTimeout(() => loadFiles('silent'), 800);
|
|
415
|
+
// Remove from the query cache, then reconcile against the server.
|
|
416
|
+
(0, _useFileQueries.removeFileFromCache)(queryClient, targetUserId, fileId);
|
|
417
|
+
invalidateFiles();
|
|
528
418
|
} catch (error) {
|
|
529
419
|
// Provide specific error messages
|
|
530
420
|
if ((0, _shared.getErrorMessage)(error)?.includes('File not found') || (0, _shared.getErrorMessage)(error)?.includes('404')) {
|
|
531
421
|
_bloom.toast.error(t('fileManagement.toasts.fileNotFound'));
|
|
532
|
-
//
|
|
533
|
-
|
|
422
|
+
// It's already gone server-side — reconcile the list.
|
|
423
|
+
invalidateFiles();
|
|
534
424
|
} else if ((0, _shared.getErrorMessage)(error)?.includes('permission') || (0, _shared.getErrorMessage)(error)?.includes('403')) {
|
|
535
425
|
_bloom.toast.error(t('fileManagement.toasts.noPermission'));
|
|
536
426
|
} else {
|
|
537
427
|
_bloom.toast.error((0, _shared.getErrorMessage)(error) || t('fileManagement.toasts.deleteFailed'));
|
|
538
428
|
}
|
|
539
429
|
} finally {
|
|
540
|
-
|
|
541
|
-
setPendingDeleteFile(null);
|
|
430
|
+
setDeletingId(null);
|
|
542
431
|
}
|
|
543
|
-
}, [
|
|
544
|
-
const confirmBulkDelete = (0, _react.useCallback)(() => {
|
|
545
|
-
if (selectedIds.size === 0) return;
|
|
546
|
-
bulkDeleteDialog.open();
|
|
547
|
-
}, [selectedIds.size, bulkDeleteDialog]);
|
|
548
|
-
const handleBulkDelete = (0, _react.useCallback)(async () => {
|
|
432
|
+
}, [oxyServices, queryClient, targetUserId, invalidateFiles, t]);
|
|
433
|
+
const confirmBulkDelete = (0, _react.useCallback)(async () => {
|
|
549
434
|
if (selectedIds.size === 0) return;
|
|
435
|
+
const confirmed = await _surfaces.surfaces.confirm({
|
|
436
|
+
title: t('fileManagement.deleteFiles') || 'Delete Files',
|
|
437
|
+
message: t('fileManagement.confirms.deleteFiles', {
|
|
438
|
+
count: selectedIds.size
|
|
439
|
+
}),
|
|
440
|
+
confirmLabel: t('fileManagement.confirm') || 'Delete',
|
|
441
|
+
cancelLabel: t('common.cancel') || 'Cancel',
|
|
442
|
+
destructive: true
|
|
443
|
+
});
|
|
444
|
+
if (!confirmed) return;
|
|
550
445
|
try {
|
|
551
446
|
const deletePromises = Array.from(selectedIds).map(async fileId => {
|
|
552
447
|
try {
|
|
553
448
|
await oxyServices.deleteFile(fileId);
|
|
554
|
-
|
|
449
|
+
(0, _useFileQueries.removeFileFromCache)(queryClient, targetUserId, fileId);
|
|
555
450
|
return {
|
|
556
451
|
success: true,
|
|
557
452
|
fileId
|
|
@@ -578,11 +473,11 @@ const FileManagementScreen = ({
|
|
|
578
473
|
}));
|
|
579
474
|
}
|
|
580
475
|
setSelectedIds(new Set());
|
|
581
|
-
|
|
476
|
+
invalidateFiles();
|
|
582
477
|
} catch (error) {
|
|
583
478
|
_bloom.toast.error((0, _shared.getErrorMessage)(error) || t('fileManagement.toasts.bulkDeleteError'));
|
|
584
479
|
}
|
|
585
|
-
}, [selectedIds,
|
|
480
|
+
}, [selectedIds, oxyServices, queryClient, targetUserId, invalidateFiles, t]);
|
|
586
481
|
const handleBulkVisibilityChange = (0, _react.useCallback)(async visibility => {
|
|
587
482
|
if (selectedIds.size === 0) return;
|
|
588
483
|
try {
|
|
@@ -609,29 +504,47 @@ const FileManagementScreen = ({
|
|
|
609
504
|
count: successful,
|
|
610
505
|
visibility
|
|
611
506
|
}));
|
|
612
|
-
//
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
...files.find(f => f.id === fileId)?.metadata,
|
|
617
|
-
visibility
|
|
618
|
-
}
|
|
507
|
+
// Reflect the new visibility in the cached files.
|
|
508
|
+
for (const fileId of selectedIds) {
|
|
509
|
+
(0, _useFileQueries.patchFileMetadataInCache)(queryClient, targetUserId, fileId, {
|
|
510
|
+
visibility
|
|
619
511
|
});
|
|
620
|
-
}
|
|
512
|
+
}
|
|
621
513
|
}
|
|
622
514
|
if (failed > 0) {
|
|
623
515
|
_bloom.toast.error(t('fileManagement.toasts.visibilityFailed', {
|
|
624
516
|
count: failed
|
|
625
517
|
}));
|
|
626
518
|
}
|
|
627
|
-
|
|
519
|
+
invalidateFiles();
|
|
628
520
|
} catch (error) {
|
|
629
521
|
_bloom.toast.error((0, _shared.getErrorMessage)(error) || t('fileManagement.toasts.visibilityError'));
|
|
630
522
|
}
|
|
631
|
-
}, [selectedIds, oxyServices,
|
|
523
|
+
}, [selectedIds, oxyServices, queryClient, targetUserId, invalidateFiles, t]);
|
|
524
|
+
const handleVisibilityChange = (0, _react.useCallback)(async () => {
|
|
525
|
+
if (selectedIds.size === 0) return;
|
|
526
|
+
const visibility = await (0, _ActionSheetSurface.presentActionSheet)({
|
|
527
|
+
title: t('fileManagement.changeVisibility') || 'Change Visibility',
|
|
528
|
+
message: t('fileManagement.changeVisibilityConfirm', {
|
|
529
|
+
count: selectedIds.size
|
|
530
|
+
}),
|
|
531
|
+
options: [{
|
|
532
|
+
label: t('fileManagement.private') || 'Private',
|
|
533
|
+
value: 'private'
|
|
534
|
+
}, {
|
|
535
|
+
label: t('fileManagement.public') || 'Public',
|
|
536
|
+
value: 'public'
|
|
537
|
+
}, {
|
|
538
|
+
label: t('fileManagement.unlisted') || 'Unlisted',
|
|
539
|
+
value: 'unlisted'
|
|
540
|
+
}],
|
|
541
|
+
cancelLabel: t('common.cancel') || 'Cancel'
|
|
542
|
+
});
|
|
543
|
+
if (visibility) await handleBulkVisibilityChange(visibility);
|
|
544
|
+
}, [selectedIds.size, handleBulkVisibilityChange, t]);
|
|
632
545
|
|
|
633
546
|
// Unified download function - works on all platforms
|
|
634
|
-
const handleFileDownload = async (fileId, filename) => {
|
|
547
|
+
const handleFileDownload = (0, _react.useCallback)(async (fileId, filename) => {
|
|
635
548
|
try {
|
|
636
549
|
// Resolve an authenticated, private-safe URL. The synchronous
|
|
637
550
|
// `getFileDownloadUrl` yields the public CDN origin, which 404s for
|
|
@@ -674,8 +587,8 @@ const FileManagementScreen = ({
|
|
|
674
587
|
} catch (error) {
|
|
675
588
|
_bloom.toast.error((0, _shared.getErrorMessage)(error) || t('fileManagement.toasts.downloadFailed'));
|
|
676
589
|
}
|
|
677
|
-
};
|
|
678
|
-
const handleFileOpen = async file => {
|
|
590
|
+
}, [oxyServices, t]);
|
|
591
|
+
const handleFileOpen = (0, _react.useCallback)(async file => {
|
|
679
592
|
if (selectMode) {
|
|
680
593
|
toggleSelect(file);
|
|
681
594
|
return;
|
|
@@ -715,17 +628,21 @@ const FileManagementScreen = ({
|
|
|
715
628
|
} finally {
|
|
716
629
|
setLoadingFileContent(false);
|
|
717
630
|
}
|
|
718
|
-
};
|
|
719
|
-
const handleCloseFile = () => {
|
|
631
|
+
}, [selectMode, toggleSelect, oxyServices, t]);
|
|
632
|
+
const handleCloseFile = (0, _react.useCallback)(() => {
|
|
720
633
|
setOpenedFile(null);
|
|
721
634
|
setFileContent(null);
|
|
722
635
|
setShowFileDetailsInViewer(false);
|
|
723
636
|
// Don't reset view mode when closing a file
|
|
724
|
-
};
|
|
725
|
-
const showFileDetailsModal = file => {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
637
|
+
}, []);
|
|
638
|
+
const showFileDetailsModal = (0, _react.useCallback)(file => {
|
|
639
|
+
(0, _FileDetailsModal.presentFileDetails)({
|
|
640
|
+
file,
|
|
641
|
+
onDownload: handleFileDownload,
|
|
642
|
+
onDelete: confirmFileDelete,
|
|
643
|
+
isOwner: user?.id === targetUserId
|
|
644
|
+
});
|
|
645
|
+
}, [handleFileDownload, confirmFileDelete, user?.id, targetUserId]);
|
|
729
646
|
const renderJustifiedPhotoItem = (0, _react.useCallback)((photo, width, height, isLast) => {
|
|
730
647
|
const downloadUrl = thumbSourceFor(photo);
|
|
731
648
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
@@ -770,18 +687,7 @@ const FileManagementScreen = ({
|
|
|
770
687
|
})]
|
|
771
688
|
})
|
|
772
689
|
}, photo.id);
|
|
773
|
-
}, [thumbSourceFor, selectMode, selectedIds, multiSelect, colors.primary, colors.text]);
|
|
774
|
-
|
|
775
|
-
// Run initial load once per targetUserId change to avoid accidental loops
|
|
776
|
-
const lastLoadedFor = (0, _react.useRef)(undefined);
|
|
777
|
-
(0, _react.useEffect)(() => {
|
|
778
|
-
const key = targetUserId || 'anonymous';
|
|
779
|
-
if (lastLoadedFor.current !== key) {
|
|
780
|
-
lastLoadedFor.current = key;
|
|
781
|
-
loadFiles('initial');
|
|
782
|
-
}
|
|
783
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
784
|
-
}, [targetUserId]);
|
|
690
|
+
}, [thumbSourceFor, selectMode, selectedIds, multiSelect, colors.primary, colors.text, handleFileOpen]);
|
|
785
691
|
|
|
786
692
|
// SettingsListItem-based file items (for 'all' view)
|
|
787
693
|
const groupedFileItems = (0, _react.useMemo)(() => {
|
|
@@ -932,8 +838,8 @@ const FileManagementScreen = ({
|
|
|
932
838
|
backgroundColor: colors.negativeSubtle
|
|
933
839
|
},
|
|
934
840
|
onPress: () => confirmFileDelete(file.id, file.filename),
|
|
935
|
-
disabled:
|
|
936
|
-
children:
|
|
841
|
+
disabled: deletingId === file.id,
|
|
842
|
+
children: deletingId === file.id ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
937
843
|
size: "small",
|
|
938
844
|
color: colors.error
|
|
939
845
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
@@ -945,85 +851,27 @@ const FileManagementScreen = ({
|
|
|
945
851
|
}) : undefined
|
|
946
852
|
};
|
|
947
853
|
});
|
|
948
|
-
}, [filteredFiles,
|
|
949
|
-
|
|
950
|
-
// Scroll to selected file after selection
|
|
951
|
-
(0, _react.useEffect)(() => {
|
|
952
|
-
if (lastSelectedFileId && selectMode) {
|
|
953
|
-
if (viewMode === 'all' && scrollViewRef.current) {
|
|
954
|
-
// Find the index of the selected file (filteredFiles is already sorted)
|
|
955
|
-
const itemIndex = filteredFiles.findIndex(file => file.id === lastSelectedFileId);
|
|
956
|
-
if (itemIndex >= 0) {
|
|
957
|
-
// Estimate item height (GroupedItem with dense mode is approximately 60-70px)
|
|
958
|
-
// Account for description rows which add extra height
|
|
959
|
-
const baseItemHeight = 65;
|
|
960
|
-
const descriptionHeight = 30; // Approximate height for description
|
|
961
|
-
// Use filteredFiles which is already sorted according to user's selection
|
|
962
|
-
const sortedFiles = filteredFiles;
|
|
963
|
-
|
|
964
|
-
// Calculate total height up to this item
|
|
965
|
-
let scrollPosition = 0;
|
|
966
|
-
for (let i = 0; i <= itemIndex && i < sortedFiles.length; i++) {
|
|
967
|
-
const file = sortedFiles[i];
|
|
968
|
-
scrollPosition += baseItemHeight;
|
|
969
|
-
if (file.metadata?.description) {
|
|
970
|
-
scrollPosition += descriptionHeight;
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
// Add header, controls, search, and stats height (approximately 250px)
|
|
975
|
-
const headerHeight = 250;
|
|
976
|
-
const finalScrollPosition = headerHeight + scrollPosition - 150; // Offset to show item near top
|
|
977
|
-
|
|
978
|
-
// Use requestAnimationFrame to ensure DOM is updated before scrolling
|
|
979
|
-
requestAnimationFrame(() => {
|
|
980
|
-
requestAnimationFrame(() => {
|
|
981
|
-
scrollViewRef.current?.scrollTo({
|
|
982
|
-
y: Math.max(0, finalScrollPosition),
|
|
983
|
-
animated: true
|
|
984
|
-
});
|
|
985
|
-
});
|
|
986
|
-
});
|
|
987
|
-
}
|
|
988
|
-
} else if (viewMode === 'photos' && photoScrollViewRef.current) {
|
|
989
|
-
// For photo grid, find the photo index
|
|
990
|
-
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
991
|
-
const photoIndex = photos.findIndex(p => p.id === lastSelectedFileId);
|
|
992
|
-
if (photoIndex >= 0) {
|
|
993
|
-
// Rough scroll estimate for the justified grid (3 photos/row; variable row heights).
|
|
994
|
-
const itemsPerRow = 3;
|
|
995
|
-
const estimatedRowHeight = 150;
|
|
996
|
-
const rowGap = 4;
|
|
997
|
-
const row = Math.floor(photoIndex / itemsPerRow);
|
|
998
|
-
const finalScrollPosition = row * (estimatedRowHeight + rowGap) - 100;
|
|
854
|
+
}, [filteredFiles, colors, deletingId, toggleSelect, handleFileDownload, confirmFileDelete, handleFileOpen, thumbSourceFor, selectMode, selectedIds]);
|
|
999
855
|
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
}
|
|
1012
|
-
}, [lastSelectedFileId, selectMode, viewMode, filteredFiles, safeContainerWidth]);
|
|
1013
|
-
|
|
1014
|
-
// Clear selected file ID after scroll animation completes
|
|
1015
|
-
(0, _react.useEffect)(() => {
|
|
1016
|
-
if (lastSelectedFileId && scrollViewRef.current) {
|
|
1017
|
-
const timeoutId = setTimeout(() => {
|
|
1018
|
-
setLastSelectedFileId(null);
|
|
1019
|
-
}, 600); // Allow time for scroll animation to complete
|
|
856
|
+
// Browse-themed terminal load-failure state — DISTINCT from the empty state.
|
|
857
|
+
const renderLoadError = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileLibraryError.default, {
|
|
858
|
+
title: t('fileManagement.loadError.title'),
|
|
859
|
+
description: t('fileManagement.loadError.description'),
|
|
860
|
+
retryLabel: t('fileManagement.retry'),
|
|
861
|
+
onRetry: () => filesQuery.refetch(),
|
|
862
|
+
iconColor: colors.error,
|
|
863
|
+
titleColor: colors.text,
|
|
864
|
+
descriptionColor: colors.textSecondary,
|
|
865
|
+
buttonColor: colors.primary
|
|
866
|
+
});
|
|
1020
867
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
const renderPhotoGrid = (
|
|
868
|
+
// Browse "photos" view. The justified grid owns its own dimension
|
|
869
|
+
// measurement + reflow (see JustifiedPhotoGrid); this only supplies the
|
|
870
|
+
// photo set, the private-safe URL resolver, and the tile renderer.
|
|
871
|
+
const renderPhotoGrid = () => {
|
|
1025
872
|
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
1026
873
|
if (photos.length === 0) {
|
|
874
|
+
if (hasLoadError) return renderLoadError();
|
|
1027
875
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1028
876
|
className: "items-center py-[40px] px-[24px]",
|
|
1029
877
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
@@ -1049,10 +897,7 @@ const FileManagementScreen = ({
|
|
|
1049
897
|
},
|
|
1050
898
|
onPress: handleFileUpload,
|
|
1051
899
|
disabled: uploading || isPickingDocument,
|
|
1052
|
-
children: uploading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
1053
|
-
size: "small",
|
|
1054
|
-
color: "#FFFFFF"
|
|
1055
|
-
}) : isPickingDocument ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
900
|
+
children: uploading || isPickingDocument ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
1056
901
|
size: "small",
|
|
1057
902
|
color: "#FFFFFF"
|
|
1058
903
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -1068,13 +913,13 @@ const FileManagementScreen = ({
|
|
|
1068
913
|
})]
|
|
1069
914
|
});
|
|
1070
915
|
}
|
|
1071
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
916
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
1072
917
|
ref: photoScrollViewRef,
|
|
1073
918
|
className: "flex-1",
|
|
1074
919
|
contentContainerClassName: "p-[10px]",
|
|
1075
920
|
refreshControl: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.RefreshControl, {
|
|
1076
|
-
refreshing:
|
|
1077
|
-
onRefresh: () =>
|
|
921
|
+
refreshing: isRefreshingFiles,
|
|
922
|
+
onRefresh: () => filesQuery.refetch(),
|
|
1078
923
|
tintColor: colors.primary
|
|
1079
924
|
}),
|
|
1080
925
|
showsVerticalScrollIndicator: false,
|
|
@@ -1087,38 +932,21 @@ const FileManagementScreen = ({
|
|
|
1087
932
|
contentSize
|
|
1088
933
|
} = nativeEvent;
|
|
1089
934
|
const distanceFromBottom = contentSize.height - (contentOffset.y + layoutMeasurement.height);
|
|
1090
|
-
if (distanceFromBottom < 200 && !
|
|
1091
|
-
|
|
935
|
+
if (distanceFromBottom < 200 && !isFetchingMore && hasMoreFiles) {
|
|
936
|
+
filesQuery.fetchNextPage();
|
|
1092
937
|
}
|
|
1093
938
|
},
|
|
1094
939
|
scrollEventThrottle: 250,
|
|
1095
|
-
children:
|
|
1096
|
-
className: "flex-row items-center justify-center py-[16px] gap-[8px]",
|
|
1097
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
1098
|
-
size: "small",
|
|
1099
|
-
color: colors.primary
|
|
1100
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1101
|
-
className: "text-[14px] italic",
|
|
1102
|
-
style: {
|
|
1103
|
-
color: colors.textSecondary
|
|
1104
|
-
},
|
|
1105
|
-
children: t('fileManagement.loadingPhotoLayout')
|
|
1106
|
-
})]
|
|
1107
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_JustifiedPhotoGrid.default, {
|
|
940
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_JustifiedPhotoGrid.default, {
|
|
1108
941
|
photos: photos,
|
|
1109
|
-
|
|
1110
|
-
loadPhotoDimensions: loadPhotoDimensions,
|
|
1111
|
-
createJustifiedRows: createJustifiedRows,
|
|
942
|
+
getThumbUrl: thumbSourceFor,
|
|
1112
943
|
renderJustifiedPhotoItem: renderJustifiedPhotoItem,
|
|
1113
944
|
textColor: colors.text,
|
|
1114
945
|
containerWidth: typeof containerWidth === 'number' && containerWidth > 0 ? containerWidth : undefined
|
|
1115
|
-
})
|
|
946
|
+
})
|
|
1116
947
|
});
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
// Inline justified grid removed (moved to components/photogrid/JustifiedPhotoGrid.tsx)
|
|
1120
|
-
|
|
1121
|
-
const renderEmptyState = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
948
|
+
};
|
|
949
|
+
const renderEmptyState = () => hasLoadError ? renderLoadError() : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1122
950
|
className: "items-center py-[40px] px-[24px]",
|
|
1123
951
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
1124
952
|
name: "folder-open-outline",
|
|
@@ -1143,10 +971,7 @@ const FileManagementScreen = ({
|
|
|
1143
971
|
},
|
|
1144
972
|
onPress: handleFileUpload,
|
|
1145
973
|
disabled: uploading || isPickingDocument,
|
|
1146
|
-
children: uploading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
1147
|
-
size: "small",
|
|
1148
|
-
color: "#FFFFFF"
|
|
1149
|
-
}) : isPickingDocument ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
974
|
+
children: uploading || isPickingDocument ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
1150
975
|
size: "small",
|
|
1151
976
|
color: "#FFFFFF"
|
|
1152
977
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -1172,7 +997,85 @@ const FileManagementScreen = ({
|
|
|
1172
997
|
// picker's placement-aware container width / columns / tile size and the
|
|
1173
998
|
// Dialog-vs-bottom-sheet sizing. Skipping the browse chrome here is what keeps
|
|
1174
999
|
// the picker from flashing the wrong (file-manager) skeleton inside the Dialog.
|
|
1175
|
-
|
|
1000
|
+
// The Dialog owns the nav header; this screen contributes its state-dependent
|
|
1001
|
+
// title/subtitle + action slots. The image-only picker mode is headerless
|
|
1002
|
+
// (PhotoPickerView owns its own bar), so this config is simply ignored there.
|
|
1003
|
+
const fmHeaderRight = (0, _react.useMemo)(() => {
|
|
1004
|
+
const actions = selectMode && multiSelect ? [{
|
|
1005
|
+
key: 'clear',
|
|
1006
|
+
label: t('fileManagement.clear'),
|
|
1007
|
+
onPress: () => setSelectedIds(new Set()),
|
|
1008
|
+
disabled: selectedIds.size === 0
|
|
1009
|
+
}, {
|
|
1010
|
+
key: 'confirm',
|
|
1011
|
+
label: t('fileManagement.confirm'),
|
|
1012
|
+
onPress: confirmMultiSelection,
|
|
1013
|
+
disabled: selectedIds.size === 0
|
|
1014
|
+
}] : !selectMode && selectedIds.size > 0 ? [{
|
|
1015
|
+
key: 'clear',
|
|
1016
|
+
label: t('fileManagement.clear'),
|
|
1017
|
+
onPress: () => setSelectedIds(new Set()),
|
|
1018
|
+
disabled: false
|
|
1019
|
+
}, {
|
|
1020
|
+
key: 'delete',
|
|
1021
|
+
label: t('fileManagement.delete', {
|
|
1022
|
+
count: selectedIds.size
|
|
1023
|
+
}),
|
|
1024
|
+
onPress: confirmBulkDelete,
|
|
1025
|
+
disabled: false
|
|
1026
|
+
}, {
|
|
1027
|
+
key: 'visibility',
|
|
1028
|
+
label: t('fileManagement.visibility'),
|
|
1029
|
+
onPress: handleVisibilityChange,
|
|
1030
|
+
disabled: false
|
|
1031
|
+
}] : [];
|
|
1032
|
+
if (actions.length === 0) return undefined;
|
|
1033
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1034
|
+
style: fmHeaderStyles.actionsRow,
|
|
1035
|
+
children: actions.map(a => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SurfaceHeaderAction.SurfaceHeaderAction, {
|
|
1036
|
+
label: a.label,
|
|
1037
|
+
onPress: a.onPress,
|
|
1038
|
+
disabled: a.disabled
|
|
1039
|
+
}, a.key))
|
|
1040
|
+
});
|
|
1041
|
+
}, [selectMode, multiSelect, selectedIds, t, confirmMultiSelection, confirmBulkDelete, handleVisibilityChange]);
|
|
1042
|
+
const fmHeaderBack = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
1043
|
+
onPress: handleCancelUpload,
|
|
1044
|
+
accessibilityRole: "button",
|
|
1045
|
+
accessibilityLabel: t('common.back') || 'Back',
|
|
1046
|
+
hitSlop: 8,
|
|
1047
|
+
style: fmHeaderStyles.backButton,
|
|
1048
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
1049
|
+
name: "chevron-back",
|
|
1050
|
+
size: 20,
|
|
1051
|
+
color: colors.text
|
|
1052
|
+
})
|
|
1053
|
+
}), [handleCancelUpload, colors.text, t]);
|
|
1054
|
+
(0, _useSurfaceHeader.useSurfaceHeader)(showUploadPreview ? {
|
|
1055
|
+
title: t('fileManagement.reviewFiles'),
|
|
1056
|
+
subtitle: t('fileManagement.readyToUpload', {
|
|
1057
|
+
count: pendingFiles.length
|
|
1058
|
+
}),
|
|
1059
|
+
left: fmHeaderBack,
|
|
1060
|
+
largeTitle: false
|
|
1061
|
+
} : {
|
|
1062
|
+
title: selectMode ? multiSelect ? maxSelection ? t('fileManagement.selectedWithMax', {
|
|
1063
|
+
count: selectedIds.size,
|
|
1064
|
+
max: maxSelection
|
|
1065
|
+
}) : t('fileManagement.selected', {
|
|
1066
|
+
count: selectedIds.size
|
|
1067
|
+
}) : t('fileManagement.selectFile') : viewMode === 'photos' ? t('fileManagement.photos') : t('fileManagement.title'),
|
|
1068
|
+
subtitle: selectMode ? multiSelect ? t('fileManagement.available', {
|
|
1069
|
+
count: filteredFiles.length
|
|
1070
|
+
}) : t('fileManagement.tapToSelect') : filteredFiles.length === 1 ? t('fileManagement.itemCount', {
|
|
1071
|
+
count: filteredFiles.length
|
|
1072
|
+
}) : t('fileManagement.itemCount_plural', {
|
|
1073
|
+
count: filteredFiles.length
|
|
1074
|
+
}),
|
|
1075
|
+
right: fmHeaderRight,
|
|
1076
|
+
largeTitle: false
|
|
1077
|
+
});
|
|
1078
|
+
if (isLoadingFiles && !isImageOnlyPicker) {
|
|
1176
1079
|
const GRID_PADDING = 10;
|
|
1177
1080
|
const TILE_GAP = 4;
|
|
1178
1081
|
const GRID_COLUMNS = 3;
|
|
@@ -1265,141 +1168,77 @@ const FileManagementScreen = ({
|
|
|
1265
1168
|
const photosOnly = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
1266
1169
|
const isOwner = user?.id === targetUserId;
|
|
1267
1170
|
const allowUpload = isOwner && allowUploadInSelectMode;
|
|
1268
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1171
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PhotoPickerSection.default, {
|
|
1172
|
+
photos: photosOnly,
|
|
1173
|
+
selectedIds: selectedIds,
|
|
1174
|
+
multiSelect: multiSelect,
|
|
1175
|
+
maxSelection: maxSelection,
|
|
1176
|
+
allowUpload: allowUpload,
|
|
1177
|
+
refreshing: isRefreshingFiles,
|
|
1178
|
+
uploading: uploading,
|
|
1179
|
+
isPickingDocument: isPickingDocument,
|
|
1180
|
+
uploadProgress: uploadProgress,
|
|
1181
|
+
hasMore: hasMoreFiles,
|
|
1182
|
+
loadingMore: isFetchingMore,
|
|
1183
|
+
loading: isLoadingFiles,
|
|
1184
|
+
loadError: hasLoadError,
|
|
1185
|
+
onRetry: () => filesQuery.refetch(),
|
|
1186
|
+
reduceMotion: reduceMotion,
|
|
1187
|
+
getThumbUrl: thumbSourceFor,
|
|
1188
|
+
primaryColor: colors.primary,
|
|
1189
|
+
isOwner: isOwner,
|
|
1190
|
+
onTogglePhoto: toggleSelect
|
|
1191
|
+
// Long-press preview surfaces the file-detail panel on the stack.
|
|
1192
|
+
,
|
|
1193
|
+
onPreviewPhoto: file => showFileDetailsModal(file),
|
|
1194
|
+
onUpload: handleFileUpload,
|
|
1195
|
+
onRefresh: () => filesQuery.refetch(),
|
|
1196
|
+
onLoadMore: () => filesQuery.fetchNextPage(),
|
|
1197
|
+
onCancel: () => {
|
|
1198
|
+
if (onSelect || onConfirmSelection) {
|
|
1199
|
+
// Legacy callback caller: preserve close/back behaviour.
|
|
1292
1200
|
if (onClose) onClose();else goBack?.();
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
onDelete: confirmFileDelete,
|
|
1301
|
-
isOwner: isOwner
|
|
1302
|
-
})]
|
|
1201
|
+
} else {
|
|
1202
|
+
// Promise picker (avatar): dismiss just this surface.
|
|
1203
|
+
dismiss?.();
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
onConfirm: confirmMultiSelection,
|
|
1207
|
+
t: t
|
|
1303
1208
|
});
|
|
1304
1209
|
}
|
|
1305
1210
|
|
|
1306
1211
|
// If a file is opened, show the file viewer
|
|
1307
1212
|
if (!selectMode && openedFile) {
|
|
1308
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
isOwner: user?.id === targetUserId
|
|
1319
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileDetailsModal.FileDetailsModal, {
|
|
1320
|
-
control: fileDetailsControl,
|
|
1321
|
-
file: selectedFile,
|
|
1322
|
-
onDownload: handleFileDownload,
|
|
1323
|
-
onDelete: confirmFileDelete,
|
|
1324
|
-
isOwner: user?.id === targetUserId
|
|
1325
|
-
})]
|
|
1213
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileViewer.FileViewer, {
|
|
1214
|
+
file: openedFile,
|
|
1215
|
+
fileContent: fileContent,
|
|
1216
|
+
loadingFileContent: loadingFileContent,
|
|
1217
|
+
showFileDetailsInViewer: showFileDetailsInViewer,
|
|
1218
|
+
onToggleDetails: () => setShowFileDetailsInViewer(!showFileDetailsInViewer),
|
|
1219
|
+
onClose: handleCloseFile,
|
|
1220
|
+
onDownload: handleFileDownload,
|
|
1221
|
+
onDelete: confirmFileDelete,
|
|
1222
|
+
isOwner: user?.id === targetUserId
|
|
1326
1223
|
});
|
|
1327
1224
|
}
|
|
1328
1225
|
|
|
1329
1226
|
// If upload preview is showing, render it inline instead of the file list
|
|
1330
1227
|
if (showUploadPreview) {
|
|
1331
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
1228
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1332
1229
|
className: "flex-1",
|
|
1333
|
-
children:
|
|
1334
|
-
title: t('fileManagement.reviewFiles'),
|
|
1335
|
-
subtitle: t('fileManagement.readyToUpload', {
|
|
1336
|
-
count: pendingFiles.length
|
|
1337
|
-
}),
|
|
1338
|
-
onBack: handleCancelUpload,
|
|
1339
|
-
showBackButton: true,
|
|
1340
|
-
variant: "minimal",
|
|
1341
|
-
elevation: "none",
|
|
1342
|
-
titleAlignment: "left"
|
|
1343
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UploadPreview.UploadPreview, {
|
|
1230
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_UploadPreview.UploadPreview, {
|
|
1344
1231
|
pendingFiles: pendingFiles,
|
|
1345
1232
|
onConfirm: handleConfirmUpload,
|
|
1346
1233
|
onCancel: handleCancelUpload,
|
|
1347
1234
|
onRemoveFile: removePendingFile,
|
|
1348
1235
|
inline: true
|
|
1349
|
-
})
|
|
1236
|
+
})
|
|
1350
1237
|
});
|
|
1351
1238
|
}
|
|
1352
1239
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1353
1240
|
className: "flex-1",
|
|
1354
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
1355
|
-
title: selectMode ? multiSelect ? maxSelection ? t('fileManagement.selectedWithMax', {
|
|
1356
|
-
count: selectedIds.size,
|
|
1357
|
-
max: maxSelection
|
|
1358
|
-
}) : t('fileManagement.selected', {
|
|
1359
|
-
count: selectedIds.size
|
|
1360
|
-
}) : t('fileManagement.selectFile') : viewMode === 'photos' ? t('fileManagement.photos') : t('fileManagement.title'),
|
|
1361
|
-
subtitle: selectMode ? multiSelect ? t('fileManagement.available', {
|
|
1362
|
-
count: filteredFiles.length
|
|
1363
|
-
}) : t('fileManagement.tapToSelect') : filteredFiles.length === 1 ? t('fileManagement.itemCount', {
|
|
1364
|
-
count: filteredFiles.length
|
|
1365
|
-
}) : t('fileManagement.itemCount_plural', {
|
|
1366
|
-
count: filteredFiles.length
|
|
1367
|
-
}),
|
|
1368
|
-
actions: selectMode && multiSelect ? [{
|
|
1369
|
-
key: 'clear',
|
|
1370
|
-
text: t('fileManagement.clear'),
|
|
1371
|
-
onPress: () => setSelectedIds(new Set()),
|
|
1372
|
-
disabled: selectedIds.size === 0
|
|
1373
|
-
}, {
|
|
1374
|
-
key: 'confirm',
|
|
1375
|
-
text: t('fileManagement.confirm'),
|
|
1376
|
-
onPress: confirmMultiSelection,
|
|
1377
|
-
disabled: selectedIds.size === 0
|
|
1378
|
-
}] : !selectMode && selectedIds.size > 0 ? [{
|
|
1379
|
-
key: 'clear',
|
|
1380
|
-
text: t('fileManagement.clear'),
|
|
1381
|
-
onPress: () => setSelectedIds(new Set())
|
|
1382
|
-
}, {
|
|
1383
|
-
key: 'delete',
|
|
1384
|
-
text: t('fileManagement.delete', {
|
|
1385
|
-
count: selectedIds.size
|
|
1386
|
-
}),
|
|
1387
|
-
onPress: confirmBulkDelete,
|
|
1388
|
-
icon: 'delete'
|
|
1389
|
-
}, {
|
|
1390
|
-
key: 'visibility',
|
|
1391
|
-
text: t('fileManagement.visibility'),
|
|
1392
|
-
onPress: () => {
|
|
1393
|
-
visibilityChangeDialog.open();
|
|
1394
|
-
},
|
|
1395
|
-
icon: 'eye'
|
|
1396
|
-
}] : undefined,
|
|
1397
|
-
onBack: onClose || goBack,
|
|
1398
|
-
showBackButton: true,
|
|
1399
|
-
variant: "minimal",
|
|
1400
|
-
elevation: "none",
|
|
1401
|
-
titleAlignment: "left"
|
|
1402
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1241
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1403
1242
|
className: "flex-row items-center justify-between px-[12px] py-[12px] gap-[12px]",
|
|
1404
1243
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
1405
1244
|
horizontal: true,
|
|
@@ -1429,32 +1268,30 @@ const FileManagementScreen = ({
|
|
|
1429
1268
|
textColor: colors.text,
|
|
1430
1269
|
style: screenStyles.viewModeButton,
|
|
1431
1270
|
accessibilityLabel: t('fileManagement.a11y.viewPhotos') || 'Show photos only'
|
|
1432
|
-
}),
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
accessibilityLabel: t('fileManagement.a11y.viewAudio') || 'Show audio only'
|
|
1457
|
-
})]
|
|
1271
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnimatedButton.AnimatedButton, {
|
|
1272
|
+
isSelected: viewMode === 'videos',
|
|
1273
|
+
onPress: () => setViewMode('videos'),
|
|
1274
|
+
icon: viewMode === 'videos' ? 'video' : 'video-outline',
|
|
1275
|
+
primaryColor: colors.primary,
|
|
1276
|
+
textColor: colors.text,
|
|
1277
|
+
style: screenStyles.viewModeButton,
|
|
1278
|
+
accessibilityLabel: t('fileManagement.a11y.viewVideos') || 'Show videos only'
|
|
1279
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnimatedButton.AnimatedButton, {
|
|
1280
|
+
isSelected: viewMode === 'documents',
|
|
1281
|
+
onPress: () => setViewMode('documents'),
|
|
1282
|
+
icon: viewMode === 'documents' ? 'file-document' : 'file-document-outline',
|
|
1283
|
+
primaryColor: colors.primary,
|
|
1284
|
+
textColor: colors.text,
|
|
1285
|
+
style: screenStyles.viewModeButton,
|
|
1286
|
+
accessibilityLabel: t('fileManagement.a11y.viewDocuments') || 'Show documents only'
|
|
1287
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnimatedButton.AnimatedButton, {
|
|
1288
|
+
isSelected: viewMode === 'audio',
|
|
1289
|
+
onPress: () => setViewMode('audio'),
|
|
1290
|
+
icon: viewMode === 'audio' ? 'music-note' : 'music-note-outline',
|
|
1291
|
+
primaryColor: colors.primary,
|
|
1292
|
+
textColor: colors.text,
|
|
1293
|
+
style: screenStyles.viewModeButton,
|
|
1294
|
+
accessibilityLabel: t('fileManagement.a11y.viewAudio') || 'Show audio only'
|
|
1458
1295
|
})]
|
|
1459
1296
|
})
|
|
1460
1297
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
@@ -1487,15 +1324,15 @@ const FileManagementScreen = ({
|
|
|
1487
1324
|
size: 14,
|
|
1488
1325
|
color: colors.textSecondary
|
|
1489
1326
|
})]
|
|
1490
|
-
}), user?.id === targetUserId && (!selectMode ||
|
|
1491
|
-
className:
|
|
1327
|
+
}), user?.id === targetUserId && (!selectMode || allowUploadInSelectMode) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
1328
|
+
className: "h-[44px] w-[44px] rounded-[22px] items-center justify-center",
|
|
1492
1329
|
style: {
|
|
1493
1330
|
backgroundColor: colors.primary
|
|
1494
1331
|
},
|
|
1495
1332
|
onPress: handleFileUpload,
|
|
1496
1333
|
disabled: uploading || isPickingDocument,
|
|
1497
1334
|
accessibilityRole: "button",
|
|
1498
|
-
accessibilityLabel:
|
|
1335
|
+
accessibilityLabel: t('fileManagement.a11y.uploadFile') || 'Upload file',
|
|
1499
1336
|
accessibilityState: {
|
|
1500
1337
|
busy: uploading || isPickingDocument
|
|
1501
1338
|
},
|
|
@@ -1511,17 +1348,6 @@ const FileManagementScreen = ({
|
|
|
1511
1348
|
}) : isPickingDocument ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
1512
1349
|
size: "small",
|
|
1513
1350
|
color: "#FFFFFF"
|
|
1514
|
-
}) : isImageOnlyPicker ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1515
|
-
className: "flex-row items-center gap-[6px]",
|
|
1516
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
1517
|
-
name: "cloud-upload",
|
|
1518
|
-
size: 18,
|
|
1519
|
-
color: "#FFFFFF"
|
|
1520
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1521
|
-
className: "text-white text-[14px] font-semibold",
|
|
1522
|
-
numberOfLines: 1,
|
|
1523
|
-
children: t('fileManagement.upload') || 'Upload'
|
|
1524
|
-
})]
|
|
1525
1351
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
1526
1352
|
name: "add",
|
|
1527
1353
|
size: 22,
|
|
@@ -1617,72 +1443,22 @@ const FileManagementScreen = ({
|
|
|
1617
1443
|
filteredFiles: filteredFiles,
|
|
1618
1444
|
searchQuery: searchQuery,
|
|
1619
1445
|
items: groupedFileItems,
|
|
1620
|
-
paging:
|
|
1621
|
-
|
|
1446
|
+
paging: {
|
|
1447
|
+
loadingMore: isFetchingMore,
|
|
1448
|
+
hasMore: hasMoreFiles
|
|
1449
|
+
},
|
|
1450
|
+
refreshing: isRefreshingFiles,
|
|
1622
1451
|
colors: colors,
|
|
1623
1452
|
t: t,
|
|
1624
|
-
onRefresh: () =>
|
|
1625
|
-
onLoadMore: () =>
|
|
1453
|
+
onRefresh: () => filesQuery.refetch(),
|
|
1454
|
+
onLoadMore: () => filesQuery.fetchNextPage(),
|
|
1626
1455
|
onClearSearch: () => setSearchQuery(''),
|
|
1627
1456
|
renderEmptyState: renderEmptyState
|
|
1628
|
-
}), !selectMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileDetailsModal.FileDetailsModal, {
|
|
1629
|
-
control: fileDetailsControl,
|
|
1630
|
-
file: selectedFile,
|
|
1631
|
-
onDownload: handleFileDownload,
|
|
1632
|
-
onDelete: confirmFileDelete,
|
|
1633
|
-
isOwner: user?.id === targetUserId
|
|
1634
1457
|
}), !selectMode && uploading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_UploadBar.default, {
|
|
1635
1458
|
uploadProgress: uploadProgress,
|
|
1636
1459
|
isDark: bloomTheme.isDark,
|
|
1637
1460
|
colors: colors,
|
|
1638
1461
|
t: t
|
|
1639
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bloom.Dialog, {
|
|
1640
|
-
control: fileDeleteDialog,
|
|
1641
|
-
title: t('fileManagement.deleteFile') || 'Delete File',
|
|
1642
|
-
description: pendingDeleteFile ? t('fileManagement.confirms.deleteFile', {
|
|
1643
|
-
filename: pendingDeleteFile.name
|
|
1644
|
-
}) : '',
|
|
1645
|
-
actions: [{
|
|
1646
|
-
label: t('fileManagement.confirm') || 'Delete',
|
|
1647
|
-
color: 'destructive',
|
|
1648
|
-
onPress: handleFileDelete
|
|
1649
|
-
}, {
|
|
1650
|
-
label: t('common.cancel') || 'Cancel',
|
|
1651
|
-
color: 'cancel'
|
|
1652
|
-
}]
|
|
1653
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bloom.Dialog, {
|
|
1654
|
-
control: bulkDeleteDialog,
|
|
1655
|
-
title: t('fileManagement.deleteFiles') || 'Delete Files',
|
|
1656
|
-
description: t('fileManagement.confirms.deleteFiles', {
|
|
1657
|
-
count: selectedIds.size
|
|
1658
|
-
}),
|
|
1659
|
-
actions: [{
|
|
1660
|
-
label: t('fileManagement.confirm') || 'Delete',
|
|
1661
|
-
color: 'destructive',
|
|
1662
|
-
onPress: handleBulkDelete
|
|
1663
|
-
}, {
|
|
1664
|
-
label: t('common.cancel') || 'Cancel',
|
|
1665
|
-
color: 'cancel'
|
|
1666
|
-
}]
|
|
1667
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bloom.Dialog, {
|
|
1668
|
-
control: visibilityChangeDialog,
|
|
1669
|
-
title: t('fileManagement.changeVisibility') || 'Change Visibility',
|
|
1670
|
-
description: t('fileManagement.changeVisibilityConfirm', {
|
|
1671
|
-
count: selectedIds.size
|
|
1672
|
-
}),
|
|
1673
|
-
actions: [{
|
|
1674
|
-
label: t('fileManagement.private') || 'Private',
|
|
1675
|
-
onPress: () => handleBulkVisibilityChange('private')
|
|
1676
|
-
}, {
|
|
1677
|
-
label: t('fileManagement.public') || 'Public',
|
|
1678
|
-
onPress: () => handleBulkVisibilityChange('public')
|
|
1679
|
-
}, {
|
|
1680
|
-
label: t('fileManagement.unlisted') || 'Unlisted',
|
|
1681
|
-
onPress: () => handleBulkVisibilityChange('unlisted')
|
|
1682
|
-
}, {
|
|
1683
|
-
label: t('common.cancel') || 'Cancel',
|
|
1684
|
-
color: 'cancel'
|
|
1685
|
-
}]
|
|
1686
1462
|
})]
|
|
1687
1463
|
});
|
|
1688
1464
|
};
|