@oxyhq/services 6.9.13 → 6.9.15
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/assets/assets/icons/OxyServices.d.ts +28 -0
- package/lib/commonjs/assets/assets/icons/OxyServices.js +53 -0
- package/lib/commonjs/assets/assets/illustrations/HighFive.d.ts +7 -0
- package/lib/commonjs/assets/assets/illustrations/HighFive.js +41 -0
- package/lib/commonjs/assets/icons/OxyServices.js +52 -13
- package/lib/commonjs/assets/icons/OxyServices.js.map +1 -1
- package/lib/commonjs/assets/illustrations/HighFive.js +57 -18
- package/lib/commonjs/assets/illustrations/HighFive.js.map +1 -1
- package/lib/commonjs/index.js +190 -200
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/sonner-safe.js.map +1 -0
- package/lib/commonjs/lib/sonner.js +16 -5
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/lib/sonner.native.js +45 -8
- package/lib/commonjs/lib/sonner.native.js.map +1 -1
- package/lib/commonjs/lib/sonner.web.js +45 -8
- package/lib/commonjs/lib/sonner.web.js.map +1 -1
- package/lib/commonjs/ui/client.js +88 -66
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/ActivityIndicator.js +26 -0
- package/lib/commonjs/ui/components/ActivityIndicator.js.map +1 -0
- package/lib/commonjs/ui/components/Avatar.js +27 -39
- package/lib/commonjs/ui/components/Avatar.js.map +1 -0
- package/lib/commonjs/ui/components/BottomSheet.js +20 -0
- package/lib/commonjs/ui/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js +103 -65
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -0
- package/lib/commonjs/ui/components/CrossFadeIcon.js +30 -0
- package/lib/commonjs/ui/components/CrossFadeIcon.js.map +1 -0
- package/lib/commonjs/ui/components/EmptyState.js +13 -10
- package/lib/commonjs/ui/components/EmptyState.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +81 -52
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +52 -17
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +29 -27
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +11 -10
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +34 -0
- package/lib/commonjs/ui/components/Header.js.map +1 -0
- package/lib/commonjs/ui/components/HelperText.js +26 -0
- package/lib/commonjs/ui/components/HelperText.js.map +1 -0
- package/lib/commonjs/ui/components/Icon.js +12 -12
- package/lib/commonjs/ui/components/Icon.js.map +1 -1
- package/lib/commonjs/ui/components/IconButton/IconButton.js.map +1 -0
- package/lib/commonjs/ui/components/IconButton/utils.js +8 -4
- package/lib/commonjs/ui/components/IconButton/utils.js.map +1 -1
- package/lib/commonjs/ui/components/LoadingState.js +14 -11
- package/lib/commonjs/ui/components/LoadingState.js.map +1 -1
- package/lib/commonjs/ui/components/OxyLogo.js +53 -14
- package/lib/commonjs/ui/components/OxyLogo.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +19 -17
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -0
- package/lib/commonjs/ui/components/OxySignInButton.js +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +35 -31
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -0
- package/lib/commonjs/ui/components/QuickActions.js +16 -16
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +15 -12
- package/lib/commonjs/ui/components/Section.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +13 -14
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/SettingRow.js.map +1 -0
- package/lib/commonjs/ui/components/SignInModal.js +132 -115
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +85 -71
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/Surface.js +79 -37
- package/lib/commonjs/ui/components/Surface.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Addons/Underline.js +6 -8
- package/lib/commonjs/ui/components/TextField/Addons/Underline.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js +74 -29
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAffix.js +27 -23
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAffix.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldIcon.js +31 -27
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldIcon.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/enums.js +11 -11
- package/lib/commonjs/ui/components/TextField/Adornment/enums.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/types.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Label/InputLabel.js +23 -21
- package/lib/commonjs/ui/components/TextField/Label/InputLabel.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Label/LabelBackground.js +37 -10
- package/lib/commonjs/ui/components/TextField/Label/LabelBackground.js.map +2 -1
- package/lib/commonjs/ui/components/TextField/TextFieldFlat.js +106 -65
- package/lib/commonjs/ui/components/TextField/TextFieldFlat.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/TextFieldOutlined.js +33 -0
- package/lib/commonjs/ui/components/TextField/TextFieldOutlined.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/constants.js +35 -25
- package/lib/commonjs/ui/components/TextField/constants.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/helpers.js +44 -43
- package/lib/commonjs/ui/components/TextField/helpers.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/types.js.map +1 -0
- package/lib/commonjs/ui/components/TextField.js +76 -35
- package/lib/commonjs/ui/components/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/Pressable.js.map +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js +64 -30
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js +68 -26
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/utils.js +10 -6
- package/lib/commonjs/ui/components/TouchableRipple/utils.js.map +1 -1
- package/lib/commonjs/ui/components/Typography/AnimatedText.js.map +1 -0
- package/lib/commonjs/ui/components/Typography/types.js +3 -3
- package/lib/commonjs/ui/components/Typography/types.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/FormInput.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/constants.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +1 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/index.js +10 -0
- package/lib/commonjs/ui/components/feedback/index.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/types.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/useFeedbackForm.js +5 -5
- package/lib/commonjs/ui/components/feedback/useFeedbackForm.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +13 -14
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +77 -66
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +127 -118
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -0
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +20 -0
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -0
- package/lib/commonjs/ui/components/icon/index.js +12 -7
- package/lib/commonjs/ui/components/icon/index.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +62 -54
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +22 -21
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -0
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +52 -41
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/modals/index.js +8 -3
- package/lib/commonjs/ui/components/modals/index.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +89 -70
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/constants.js.map +1 -0
- package/lib/commonjs/ui/components/payment/index.js +15 -0
- package/lib/commonjs/ui/components/payment/index.js.map +1 -1
- package/lib/commonjs/ui/components/payment/paymentStyles.js +10 -10
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/commonjs/ui/components/payment/types.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +59 -27
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/commonjs/ui/components/styles/overlay.js +4 -6
- package/lib/commonjs/ui/components/styles/overlay.js.map +1 -1
- package/lib/commonjs/ui/components/styles/shadow.js +7 -7
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
- package/lib/commonjs/ui/components/theming.js +4 -6
- package/lib/commonjs/ui/components/theming.js.map +1 -1
- package/lib/commonjs/ui/components/types.js.map +1 -1
- package/lib/commonjs/ui/components/utils/forwardRef.js +43 -3
- package/lib/commonjs/ui/components/utils/forwardRef.js.map +1 -1
- package/lib/commonjs/ui/components/utils/hasTouchHandler.js.map +1 -1
- package/lib/commonjs/ui/components/utils/roundLayoutSize.js.map +1 -0
- package/lib/commonjs/ui/components/utils/splitStyles.js +1 -7
- package/lib/commonjs/ui/components/utils/splitStyles.js.map +1 -1
- package/lib/commonjs/ui/constants/iconColors.js +12 -16
- package/lib/commonjs/ui/constants/iconColors.js.map +1 -0
- package/lib/commonjs/ui/constants/spacing.js.map +1 -1
- package/lib/commonjs/ui/constants/theme.js +8 -9
- package/lib/commonjs/ui/constants/theme.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +1 -0
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -0
- package/lib/commonjs/ui/context/ThemeContext.js +27 -4
- package/lib/commonjs/ui/context/ThemeContext.js.map +2 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +27 -0
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -0
- package/lib/commonjs/ui/hooks/index.js +27 -26
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/index.js +31 -22
- package/lib/commonjs/ui/hooks/mutations/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +83 -106
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +45 -53
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/index.js +50 -39
- package/lib/commonjs/ui/hooks/queries/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +6 -0
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +33 -39
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -0
- package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js +11 -12
- package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js.map +1 -0
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +28 -32
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queryClient.js +10 -17
- package/lib/commonjs/ui/hooks/queryClient.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js +13 -26
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -0
- package/lib/commonjs/ui/hooks/useAuth.js +23 -28
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +3 -0
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useColorScheme.js +6 -8
- package/lib/commonjs/ui/hooks/useColorScheme.js.map +1 -1
- package/lib/commonjs/ui/hooks/useDeviceManagement.js +10 -10
- package/lib/commonjs/ui/hooks/useDeviceManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFileDownloadUrl.js +7 -7
- package/lib/commonjs/ui/hooks/useFileDownloadUrl.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFileFiltering.js +7 -9
- package/lib/commonjs/ui/hooks/useFileFiltering.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.js +67 -75
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.types.js +5 -0
- package/lib/commonjs/ui/hooks/useFollow.types.js.map +1 -0
- package/lib/commonjs/ui/hooks/useI18n.js +1 -1
- package/lib/commonjs/ui/hooks/useI18n.js.map +1 -1
- package/lib/commonjs/ui/hooks/useLanguageManagement.js +16 -17
- package/lib/commonjs/ui/hooks/useLanguageManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useProfileEditing.js +1 -1
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/commonjs/ui/hooks/useQueryClient.js +2 -2
- package/lib/commonjs/ui/hooks/useQueryClient.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +40 -44
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +34 -39
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +16 -22
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/commonjs/ui/hooks/useStorage.js +6 -6
- package/lib/commonjs/ui/hooks/useStorage.js.map +1 -1
- package/lib/commonjs/ui/hooks/useThemeColors.js +1 -1
- package/lib/commonjs/ui/hooks/useThemeColors.js.map +1 -1
- package/lib/commonjs/ui/hooks/useThemeStyles.js +12 -13
- package/lib/commonjs/ui/hooks/useThemeStyles.js.map +1 -1
- package/lib/commonjs/ui/hooks/useWebSSO.js +11 -19
- package/lib/commonjs/ui/hooks/useWebSSO.js.map +1 -1
- package/lib/commonjs/ui/index.js +61 -51
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/isFrontend.js +2 -2
- package/lib/commonjs/ui/isFrontend.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +6 -12
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +75 -66
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +164 -133
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +150 -133
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +83 -44
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +19 -0
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +61 -54
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FeedbackScreen.js +155 -137
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FollowersListScreen.js +9 -6
- package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowingListScreen.js +9 -6
- package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +75 -36
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +79 -43
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +82 -50
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +35 -31
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +23 -0
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +120 -107
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +63 -69
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +241 -205
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +114 -81
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +128 -102
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +31 -0
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +69 -32
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +120 -85
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +91 -72
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +80 -45
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +29 -29
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/server.js +47 -58
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/commonjs/ui/stores/accountStore.js +1 -1
- package/lib/commonjs/ui/stores/accountStore.js.map +1 -0
- package/lib/commonjs/ui/stores/assetStore.js +13 -16
- package/lib/commonjs/ui/stores/assetStore.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +5 -6
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/stores/fileStore.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +3 -10
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +12 -12
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/fonts.js +18 -19
- package/lib/commonjs/ui/styles/fonts.js.map +1 -1
- package/lib/commonjs/ui/styles/index.js.map +1 -0
- package/lib/commonjs/ui/styles/spacing.js +11 -0
- package/lib/commonjs/ui/styles/spacing.js.map +1 -0
- package/lib/commonjs/ui/styles/theme.js +11 -12
- package/lib/commonjs/ui/styles/theme.js.map +1 -1
- package/lib/commonjs/ui/types/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/types/navigation.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +11 -16
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/colorUtils.js +17 -0
- package/lib/commonjs/ui/utils/colorUtils.js.map +1 -0
- package/lib/commonjs/ui/utils/confirmAction.js +1 -1
- package/lib/commonjs/ui/utils/confirmAction.js.map +1 -1
- package/lib/commonjs/ui/utils/errorHandlers.js +1 -0
- package/lib/commonjs/ui/utils/errorHandlers.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +22 -38
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/iconNames.js.map +1 -0
- package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/commonjs/ui/utils/storageHelpers.js +7 -12
- package/lib/commonjs/ui/utils/storageHelpers.js.map +1 -1
- package/lib/commonjs/ui/utils/themeUtils.js +15 -0
- package/lib/commonjs/ui/utils/themeUtils.js.map +1 -0
- package/lib/commonjs/ui/utils/userUtils.js +6 -9
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
- package/lib/commonjs/utils/hookUtils.js +60 -79
- package/lib/commonjs/utils/hookUtils.js.map +1 -1
- package/lib/module/assets/assets/icons/OxyServices.d.ts +28 -0
- package/lib/module/assets/assets/icons/OxyServices.js +53 -0
- package/lib/module/assets/assets/illustrations/HighFive.d.ts +7 -0
- package/lib/module/assets/assets/illustrations/HighFive.js +41 -0
- package/lib/module/assets/icons/OxyServices.js +12 -0
- package/lib/module/assets/icons/OxyServices.js.map +1 -0
- package/lib/module/assets/illustrations/HighFive.js +15 -0
- package/lib/module/assets/illustrations/HighFive.js.map +1 -0
- package/lib/module/index.js +406 -34
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/sonner-safe.js +7 -8
- package/lib/module/lib/sonner-safe.js.map +1 -1
- package/lib/module/lib/sonner.js +17 -1
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/lib/sonner.native.js +45 -0
- package/lib/module/lib/sonner.native.js.map +1 -1
- package/lib/module/lib/sonner.web.js +48 -6
- package/lib/module/lib/sonner.web.js.map +1 -1
- package/lib/module/ui/client.js +165 -25
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/ActivityIndicator.js +69 -27
- package/lib/module/ui/components/ActivityIndicator.js.map +1 -1
- package/lib/module/ui/components/AutoHeightScrollView.js +13 -9
- package/lib/module/ui/components/AutoHeightScrollView.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +8 -0
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/BottomSheet.js +99 -0
- package/lib/module/ui/components/BottomSheet.js.map +1 -0
- package/lib/module/ui/components/BottomSheetRouter.js +105 -61
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/CrossFadeIcon.js +60 -16
- package/lib/module/ui/components/CrossFadeIcon.js.map +1 -1
- package/lib/module/ui/components/EmptyState.js +15 -7
- package/lib/module/ui/components/EmptyState.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +84 -50
- package/lib/module/ui/components/FollowButton.js.map +1 -0
- package/lib/module/ui/components/FontLoader.js +57 -17
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +31 -27
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +13 -9
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +102 -57
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/HelperText.js +55 -13
- package/lib/module/ui/components/HelperText.js.map +1 -1
- package/lib/module/ui/components/Icon.js +19 -13
- package/lib/module/ui/components/Icon.js.map +1 -0
- package/lib/module/ui/components/IconButton/IconButton.js +31 -24
- package/lib/module/ui/components/IconButton/IconButton.js.map +1 -0
- package/lib/module/ui/components/IconButton/utils.js +14 -4
- package/lib/module/ui/components/IconButton/utils.js.map +1 -1
- package/lib/module/ui/components/LoadingState.js +12 -0
- package/lib/module/ui/components/LoadingState.js.map +1 -0
- package/lib/module/ui/components/OxyLogo.js +13 -0
- package/lib/module/ui/components/OxyLogo.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +14 -0
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +39 -48
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +42 -37
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +37 -29
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/QuickActions.js +18 -15
- package/lib/module/ui/components/QuickActions.js.map +1 -1
- package/lib/module/ui/components/Section.js +16 -0
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +15 -12
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/SettingRow.js +17 -0
- package/lib/module/ui/components/SettingRow.js.map +1 -1
- package/lib/module/ui/components/SignInModal.js +142 -115
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +43 -0
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -0
- package/lib/module/ui/components/Surface.js +82 -34
- package/lib/module/ui/components/Surface.js.map +1 -1
- package/lib/module/ui/components/TextField/Addons/Outline.js +8 -0
- package/lib/module/ui/components/TextField/Addons/Outline.js.map +1 -0
- package/lib/module/ui/components/TextField/Addons/Underline.js +12 -8
- package/lib/module/ui/components/TextField/Addons/Underline.js.map +1 -1
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js +62 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAffix.js +15 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAffix.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldIcon.js +33 -28
- package/lib/module/ui/components/TextField/Adornment/TextFieldIcon.js.map +1 -1
- package/lib/module/ui/components/TextField/Adornment/enums.js +13 -9
- package/lib/module/ui/components/TextField/Adornment/enums.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/types.js +3 -0
- package/lib/module/ui/components/TextField/Adornment/types.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/utils.js +7 -2
- package/lib/module/ui/components/TextField/Adornment/utils.js.map +1 -1
- package/lib/module/ui/components/TextField/Label/InputLabel.js +25 -18
- package/lib/module/ui/components/TextField/Label/InputLabel.js.map +1 -0
- package/lib/module/ui/components/TextField/TextFieldFlat.js +109 -63
- package/lib/module/ui/components/TextField/TextFieldFlat.js.map +1 -1
- package/lib/module/ui/components/TextField/TextFieldOutlined.js +109 -61
- package/lib/module/ui/components/TextField/TextFieldOutlined.js.map +1 -1
- package/lib/module/ui/components/TextField/constants.js +23 -0
- package/lib/module/ui/components/TextField/constants.js.map +1 -0
- package/lib/module/ui/components/TextField/helpers.js +69 -50
- package/lib/module/ui/components/TextField/helpers.js.map +1 -1
- package/lib/module/ui/components/TextField/types.js +3 -1
- package/lib/module/ui/components/TextField/types.js.map +1 -1
- package/lib/module/ui/components/TextField.js +64 -0
- package/lib/module/ui/components/TextField.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/Pressable.js +7 -6
- package/lib/module/ui/components/TouchableRipple/Pressable.js.map +1 -1
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js +67 -28
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js +47 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -1
- package/lib/module/ui/components/TouchableRipple/utils.js +16 -6
- package/lib/module/ui/components/TouchableRipple/utils.js.map +1 -1
- package/lib/module/ui/components/Typography/AnimatedText.js +8 -0
- package/lib/module/ui/components/Typography/AnimatedText.js.map +1 -0
- package/lib/module/ui/components/Typography/types.js +7 -3
- package/lib/module/ui/components/Typography/types.js.map +1 -1
- package/lib/module/ui/components/feedback/FormInput.js +20 -12
- package/lib/module/ui/components/feedback/FormInput.js.map +1 -1
- package/lib/module/ui/components/feedback/ProgressIndicator.js +10 -0
- package/lib/module/ui/components/feedback/ProgressIndicator.js.map +1 -0
- package/lib/module/ui/components/feedback/constants.js +7 -3
- package/lib/module/ui/components/feedback/constants.js.map +1 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js +15 -10
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/module/ui/components/feedback/index.js +56 -5
- package/lib/module/ui/components/feedback/index.js.map +1 -1
- package/lib/module/ui/components/feedback/types.js +3 -0
- package/lib/module/ui/components/feedback/types.js.map +1 -0
- package/lib/module/ui/components/feedback/useFeedbackForm.js +11 -6
- package/lib/module/ui/components/feedback/useFeedbackForm.js.map +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js +10 -0
- package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -0
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +72 -67
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +38 -0
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -0
- package/lib/module/ui/components/fileManagement/UploadPreview.js +27 -0
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/fileManagement/styles.js +24 -20
- package/lib/module/ui/components/fileManagement/styles.js.map +1 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js +58 -14
- package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/module/ui/components/icon/OxyIcon.js +5 -0
- package/lib/module/ui/components/icon/OxyIcon.js.map +1 -0
- package/lib/module/ui/components/icon/index.js +23 -2
- package/lib/module/ui/components/icon/index.js.map +1 -1
- package/lib/module/ui/components/index.js +111 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +11 -0
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +15 -12
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +48 -40
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/module/ui/components/modals/index.js +16 -1
- package/lib/module/ui/components/modals/index.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +77 -69
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js +25 -17
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +13 -0
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +18 -0
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +29 -0
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -0
- package/lib/module/ui/components/payment/constants.js +7 -0
- package/lib/module/ui/components/payment/constants.js.map +1 -0
- package/lib/module/ui/components/payment/index.js +73 -0
- package/lib/module/ui/components/payment/index.js.map +1 -1
- package/lib/module/ui/components/payment/paymentStyles.js +9 -0
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -0
- package/lib/module/ui/components/payment/types.js +3 -1
- package/lib/module/ui/components/payment/types.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +62 -25
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/module/ui/components/styles/overlay.js +13 -0
- package/lib/module/ui/components/styles/overlay.js.map +1 -1
- package/lib/module/ui/components/styles/shadow.js +12 -8
- package/lib/module/ui/components/styles/shadow.js.map +1 -1
- package/lib/module/ui/components/theming.js +9 -6
- package/lib/module/ui/components/theming.js.map +1 -1
- package/lib/module/ui/components/types.js +3 -1
- package/lib/module/ui/components/types.js.map +1 -1
- package/lib/module/ui/components/utils/forwardRef.js +40 -0
- package/lib/module/ui/components/utils/forwardRef.js.map +1 -0
- package/lib/module/ui/components/utils/hasTouchHandler.js +5 -1
- package/lib/module/ui/components/utils/hasTouchHandler.js.map +1 -1
- package/lib/module/ui/components/utils/roundLayoutSize.js +6 -1
- package/lib/module/ui/components/utils/roundLayoutSize.js.map +1 -1
- package/lib/module/ui/components/utils/splitStyles.js +5 -7
- package/lib/module/ui/components/utils/splitStyles.js.map +1 -1
- package/lib/module/ui/constants/iconColors.js +16 -14
- package/lib/module/ui/constants/iconColors.js.map +1 -1
- package/lib/module/ui/constants/spacing.js +24 -25
- package/lib/module/ui/constants/spacing.js.map +1 -1
- package/lib/module/ui/constants/theme.js +7 -4
- package/lib/module/ui/constants/theme.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +17 -0
- package/lib/module/ui/context/OxyContext.js.map +1 -0
- package/lib/module/ui/context/ThemeContext.js +13 -7
- package/lib/module/ui/context/ThemeContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +68 -39
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/index.js +64 -0
- package/lib/module/ui/hooks/index.js.map +1 -0
- package/lib/module/ui/hooks/mutations/index.js +67 -5
- package/lib/module/ui/hooks/mutations/index.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +7 -0
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -0
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +92 -109
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +54 -54
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/index.js +114 -0
- package/lib/module/ui/hooks/queries/index.js.map +1 -0
- package/lib/module/ui/hooks/queries/queryKeys.js +39 -36
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +44 -40
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useSecurityQueries.js +17 -12
- package/lib/module/ui/hooks/queries/useSecurityQueries.js.map +1 -0
- package/lib/module/ui/hooks/queries/useServicesQueries.js +37 -33
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/hooks/queryClient.js +17 -17
- package/lib/module/ui/hooks/queryClient.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js +19 -26
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +20 -16
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +24 -20
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +16 -13
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useColorScheme.js +3 -0
- package/lib/module/ui/hooks/useColorScheme.js.map +1 -1
- package/lib/module/ui/hooks/useDeviceManagement.js +16 -11
- package/lib/module/ui/hooks/useDeviceManagement.js.map +1 -1
- package/lib/module/ui/hooks/useFileDownloadUrl.js +15 -9
- package/lib/module/ui/hooks/useFileDownloadUrl.js.map +1 -0
- package/lib/module/ui/hooks/useFileFiltering.js +9 -0
- package/lib/module/ui/hooks/useFileFiltering.js.map +1 -0
- package/lib/module/ui/hooks/useFollow.js +75 -77
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.types.js +6 -0
- package/lib/module/ui/hooks/useFollow.types.js.map +1 -1
- package/lib/module/ui/hooks/useI18n.js +7 -0
- package/lib/module/ui/hooks/useI18n.js.map +1 -0
- package/lib/module/ui/hooks/useLanguageManagement.js +22 -18
- package/lib/module/ui/hooks/useLanguageManagement.js.map +1 -0
- package/lib/module/ui/hooks/useProfileEditing.js +9 -0
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -0
- package/lib/module/ui/hooks/useQueryClient.js +5 -0
- package/lib/module/ui/hooks/useQueryClient.js.map +1 -0
- package/lib/module/ui/hooks/useSessionManagement.js +46 -45
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +15 -0
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +14 -0
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -0
- package/lib/module/ui/hooks/useStorage.js +12 -7
- package/lib/module/ui/hooks/useStorage.js.map +1 -0
- package/lib/module/ui/hooks/useThemeColors.js +14 -10
- package/lib/module/ui/hooks/useThemeColors.js.map +1 -0
- package/lib/module/ui/hooks/useThemeStyles.js +18 -14
- package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
- package/lib/module/ui/hooks/useWebSSO.js +12 -16
- package/lib/module/ui/hooks/useWebSSO.js.map +1 -1
- package/lib/module/ui/index.js +74 -46
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/isFrontend.js +4 -1
- package/lib/module/ui/isFrontend.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +17 -0
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +8 -14
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +71 -65
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +167 -131
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +88 -0
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -0
- package/lib/module/ui/screens/AccountSwitcherScreen.js +88 -0
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -0
- package/lib/module/ui/screens/AccountVerificationScreen.js +86 -42
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +79 -76
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +114 -89
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +38 -0
- package/lib/module/ui/screens/FAQScreen.js.map +1 -0
- package/lib/module/ui/screens/FeedbackScreen.js +58 -0
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +149 -0
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -0
- package/lib/module/ui/screens/FollowersListScreen.js +8 -0
- package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowingListScreen.js +12 -4
- package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +45 -0
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +81 -41
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +71 -0
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -0
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +33 -31
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +72 -35
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +50 -0
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js +28 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +186 -205
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +56 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -0
- package/lib/module/ui/screens/ProfileScreen.js +102 -101
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +55 -0
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -0
- package/lib/module/ui/screens/SearchSettingsScreen.js +39 -0
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -0
- package/lib/module/ui/screens/SessionManagementScreen.js +81 -89
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +21 -18
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +69 -0
- package/lib/module/ui/screens/UserListScreen.js.map +1 -0
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +123 -82
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +29 -26
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +74 -72
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +83 -43
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +30 -0
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +81 -80
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/server.js +50 -29
- package/lib/module/ui/server.js.map +1 -1
- package/lib/module/ui/stores/accountStore.js +7 -0
- package/lib/module/ui/stores/accountStore.js.map +1 -0
- package/lib/module/ui/stores/assetStore.js +24 -14
- package/lib/module/ui/stores/assetStore.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +8 -5
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/stores/fileStore.js +6 -0
- package/lib/module/ui/stores/fileStore.js.map +1 -0
- package/lib/module/ui/stores/followStore.js +6 -9
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +17 -12
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/fonts.js +8 -0
- package/lib/module/ui/styles/fonts.js.map +1 -0
- package/lib/module/ui/styles/index.js +26 -4
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +54 -0
- package/lib/module/ui/styles/spacing.js.map +1 -1
- package/lib/module/ui/styles/theme.js +19 -13
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/ui/types/fileManagement.js +3 -1
- package/lib/module/ui/types/fileManagement.js.map +1 -0
- package/lib/module/ui/types/navigation.js +3 -1
- package/lib/module/ui/types/navigation.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +5 -0
- package/lib/module/ui/utils/avatarUtils.js.map +1 -0
- package/lib/module/ui/utils/colorUtils.js +44 -0
- package/lib/module/ui/utils/colorUtils.js.map +1 -0
- package/lib/module/ui/utils/confirmAction.js +7 -0
- package/lib/module/ui/utils/confirmAction.js.map +1 -1
- package/lib/module/ui/utils/errorHandlers.js +16 -18
- package/lib/module/ui/utils/errorHandlers.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +6 -0
- package/lib/module/ui/utils/fileManagement.js.map +1 -0
- package/lib/module/ui/utils/iconNames.js +24 -20
- package/lib/module/ui/utils/iconNames.js.map +1 -1
- package/lib/module/ui/utils/sessionHelpers.js +17 -15
- package/lib/module/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/module/ui/utils/storageHelpers.js +12 -10
- package/lib/module/ui/utils/storageHelpers.js.map +1 -1
- package/lib/module/ui/utils/themeUtils.js +35 -2
- package/lib/module/ui/utils/themeUtils.js.map +1 -0
- package/lib/module/ui/utils/userUtils.js +10 -6
- package/lib/module/ui/utils/userUtils.js.map +1 -1
- package/lib/module/utils/hookUtils.js +82 -83
- package/lib/module/utils/hookUtils.js.map +1 -1
- package/lib/typescript/assets/icons/OxyServices.d.ts +28 -0
- package/lib/typescript/assets/illustrations/HighFive.d.ts +7 -0
- package/lib/typescript/index.d.ts +46 -0
- package/lib/typescript/lib/sonner-safe.d.ts +8 -0
- package/lib/typescript/lib/sonner.d.ts +11 -0
- package/lib/typescript/lib/sonner.native.d.ts +14 -0
- package/lib/typescript/lib/sonner.web.d.ts +14 -0
- package/lib/typescript/ui/client.d.ts +30 -0
- package/lib/typescript/ui/components/ActivityIndicator.d.ts +44 -0
- package/lib/typescript/ui/components/AutoHeightScrollView.d.ts +22 -0
- package/lib/typescript/ui/components/Avatar.d.ts +60 -0
- package/lib/typescript/ui/components/BottomSheet.d.ts +28 -0
- package/lib/typescript/ui/components/BottomSheetRouter.d.ts +8 -0
- package/lib/typescript/ui/components/CrossFadeIcon.d.ts +26 -0
- package/lib/typescript/ui/components/EmptyState.d.ts +7 -0
- package/lib/typescript/ui/components/FollowButton.d.ts +28 -0
- package/lib/typescript/ui/components/FontLoader.d.ts +14 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts +23 -0
- package/lib/typescript/ui/components/GroupedSection.d.ts +29 -0
- package/lib/typescript/ui/components/Header.d.ts +37 -0
- package/lib/typescript/ui/components/HelperText.d.ts +46 -0
- package/lib/typescript/ui/components/Icon.d.ts +59 -0
- package/lib/typescript/ui/components/IconButton/IconButton.d.ts +98 -0
- package/lib/typescript/ui/components/IconButton/utils.d.ts +18 -0
- package/lib/typescript/ui/components/LoadingState.d.ts +8 -0
- package/lib/typescript/ui/components/OxyLogo.d.ts +28 -0
- package/lib/typescript/ui/components/OxyPayButton.d.ts +28 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts +37 -0
- package/lib/typescript/ui/components/OxySignInButton.d.ts +64 -0
- package/lib/typescript/ui/components/ProfileCard.d.ts +17 -0
- package/lib/typescript/ui/components/QuickActions.d.ts +14 -0
- package/lib/typescript/ui/components/Section.d.ts +11 -0
- package/lib/typescript/ui/components/SectionTitle.d.ts +9 -0
- package/lib/typescript/ui/components/SettingRow.d.ts +19 -0
- package/lib/typescript/ui/components/SignInModal.d.ts +17 -0
- package/lib/typescript/ui/components/StepBasedScreen.d.ts +25 -0
- package/lib/typescript/ui/components/Surface.d.ts +75 -0
- package/lib/typescript/ui/components/TextField/Addons/Outline.d.ts +15 -0
- package/lib/typescript/ui/components/TextField/Addons/Underline.d.ts +18 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +44 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAffix.d.ts +72 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldIcon.d.ts +77 -0
- package/lib/typescript/ui/components/TextField/Adornment/enums.d.ts +12 -0
- package/lib/typescript/ui/components/TextField/Adornment/types.d.ts +11 -0
- package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts +11 -0
- package/lib/typescript/ui/components/TextField/Label/InputLabel.d.ts +4 -0
- package/lib/typescript/ui/components/TextField/Label/LabelBackground.d.ts +3 -0
- package/lib/typescript/ui/components/TextField/TextFieldFlat.d.ts +3 -0
- package/lib/typescript/ui/components/TextField/TextFieldOutlined.d.ts +3 -0
- package/lib/typescript/ui/components/TextField/constants.d.ts +31 -0
- package/lib/typescript/ui/components/TextField/helpers.d.ts +96 -0
- package/lib/typescript/ui/components/TextField/types.d.ts +155 -0
- package/lib/typescript/ui/components/TextField.d.ts +191 -0
- package/lib/typescript/ui/components/TouchableRipple/Pressable.d.ts +12 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.d.ts +61 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.native.d.ts +24 -0
- package/lib/typescript/ui/components/TouchableRipple/utils.d.ts +10 -0
- package/lib/typescript/ui/components/Typography/AnimatedText.d.ts +34 -0
- package/lib/typescript/ui/components/Typography/types.d.ts +18 -0
- package/lib/typescript/ui/components/feedback/FormInput.d.ts +19 -0
- package/lib/typescript/ui/components/feedback/ProgressIndicator.d.ts +10 -0
- package/lib/typescript/ui/components/feedback/constants.d.ts +4 -0
- package/lib/typescript/ui/components/feedback/feedbackStyles.d.ts +279 -0
- package/lib/typescript/ui/components/feedback/index.d.ts +6 -0
- package/lib/typescript/ui/components/feedback/types.d.ts +45 -0
- package/lib/typescript/ui/components/feedback/useFeedbackForm.d.ts +8 -0
- package/lib/typescript/ui/components/fileManagement/AnimatedButton.d.ts +15 -0
- package/lib/typescript/ui/components/fileManagement/FileDetailsModal.d.ts +14 -0
- package/lib/typescript/ui/components/fileManagement/FileViewer.d.ts +17 -0
- package/lib/typescript/ui/components/fileManagement/UploadPreview.d.ts +20 -0
- package/lib/typescript/ui/components/fileManagement/styles.d.ts +859 -0
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
- package/lib/typescript/ui/components/icon/OxyIcon.d.ts +9 -0
- package/lib/typescript/ui/components/icon/index.d.ts +3 -0
- package/lib/typescript/ui/components/index.d.ts +16 -0
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts +23 -0
- package/lib/typescript/ui/components/internal/PinInput.d.ts +22 -0
- package/lib/typescript/ui/components/modals/DeleteAccountModal.d.ts +18 -0
- package/lib/typescript/ui/components/modals/index.d.ts +1 -0
- package/lib/typescript/ui/components/payment/PaymentDetailsStep.d.ts +20 -0
- package/lib/typescript/ui/components/payment/PaymentMethodStep.d.ts +13 -0
- package/lib/typescript/ui/components/payment/PaymentReviewStep.d.ts +15 -0
- package/lib/typescript/ui/components/payment/PaymentSuccessStep.d.ts +9 -0
- package/lib/typescript/ui/components/payment/PaymentSummaryStep.d.ts +14 -0
- package/lib/typescript/ui/components/payment/constants.d.ts +6 -0
- package/lib/typescript/ui/components/payment/index.d.ts +8 -0
- package/lib/typescript/ui/components/payment/paymentStyles.d.ts +395 -0
- package/lib/typescript/ui/components/payment/types.d.ts +39 -0
- package/lib/typescript/ui/components/photogrid/JustifiedPhotoGrid.d.ts +26 -0
- package/lib/typescript/ui/components/styles/overlay.d.ts +3 -0
- package/lib/typescript/ui/components/styles/shadow.d.ts +2 -0
- package/lib/typescript/ui/components/theming.d.ts +7 -0
- package/lib/typescript/ui/components/types.d.ts +80 -0
- package/lib/typescript/ui/components/utils/forwardRef.d.ts +11 -0
- package/lib/typescript/ui/components/utils/hasTouchHandler.d.ts +5 -0
- package/lib/typescript/ui/components/utils/roundLayoutSize.d.ts +1 -0
- package/lib/typescript/ui/components/utils/splitStyles.d.ts +19 -0
- package/lib/typescript/ui/constants/iconColors.d.ts +129 -0
- package/lib/typescript/ui/constants/spacing.d.ts +32 -0
- package/lib/typescript/ui/constants/theme.d.ts +96 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +75 -0
- package/lib/typescript/ui/context/ThemeContext.d.ts +18 -0
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +39 -0
- package/lib/typescript/ui/hooks/index.d.ts +6 -0
- package/lib/typescript/ui/hooks/mutations/index.d.ts +8 -0
- package/lib/typescript/ui/hooks/mutations/mutationFactory.d.ts +75 -0
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts +42 -0
- package/lib/typescript/ui/hooks/mutations/useServicesMutations.d.ts +22 -0
- package/lib/typescript/ui/hooks/queries/index.d.ts +10 -0
- package/lib/typescript/ui/hooks/queries/queryKeys.d.ts +64 -0
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts +42 -0
- package/lib/typescript/ui/hooks/queries/useSecurityQueries.d.ts +14 -0
- package/lib/typescript/ui/hooks/queries/useServicesQueries.d.ts +30 -0
- package/lib/typescript/ui/hooks/queryClient.d.ts +18 -0
- package/lib/typescript/ui/hooks/useAssets.d.ts +34 -0
- package/lib/typescript/ui/hooks/useAsyncAction.d.ts +50 -0
- package/lib/typescript/ui/hooks/useAuth.d.ts +77 -0
- package/lib/typescript/ui/hooks/useAvatarPicker.d.ts +24 -0
- package/lib/typescript/ui/hooks/useColorScheme.d.ts +7 -0
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts +26 -0
- package/lib/typescript/ui/hooks/useFileDownloadUrl.d.ts +21 -0
- package/lib/typescript/ui/hooks/useFileFiltering.d.ts +28 -0
- package/lib/typescript/ui/hooks/useFollow.d.ts +92 -0
- package/lib/typescript/ui/hooks/useFollow.types.d.ts +32 -0
- package/lib/typescript/ui/hooks/useI18n.d.ts +4 -0
- package/lib/typescript/ui/hooks/useLanguageManagement.d.ts +24 -0
- package/lib/typescript/ui/hooks/useProfileEditing.d.ts +35 -0
- package/lib/typescript/ui/hooks/useQueryClient.d.ts +6 -0
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts +40 -0
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts +14 -0
- package/lib/typescript/ui/hooks/useSettingToggle.d.ts +56 -0
- package/lib/typescript/ui/hooks/useStorage.d.ts +15 -0
- package/lib/typescript/ui/hooks/useThemeColors.d.ts +93 -0
- package/lib/typescript/ui/hooks/useThemeStyles.d.ts +44 -0
- package/lib/typescript/ui/hooks/useWebSSO.d.ts +57 -0
- package/lib/typescript/ui/index.d.ts +23 -0
- package/lib/typescript/ui/isFrontend.d.ts +2 -0
- package/lib/typescript/ui/navigation/bottomSheetManager.d.ts +26 -0
- package/lib/typescript/ui/navigation/routes.d.ts +5 -0
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +7 -0
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/EditProfileFieldScreen.d.ts +12 -0
- package/lib/typescript/ui/screens/FAQScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/FollowersListScreen.d.ts +8 -0
- package/lib/typescript/ui/screens/FollowingListScreen.d.ts +8 -0
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts +6 -0
- package/lib/typescript/ui/screens/LearnMoreUsernamesScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts +16 -0
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +14 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/ProfileScreen.d.ts +8 -0
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts +14 -0
- package/lib/typescript/ui/screens/UserListScreen.d.ts +10 -0
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts +12 -0
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts +4 -0
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts +4 -0
- package/lib/typescript/ui/server.d.ts +40 -0
- package/lib/typescript/ui/stores/accountStore.d.ts +26 -0
- package/lib/typescript/ui/stores/assetStore.d.ts +53 -0
- package/lib/typescript/ui/stores/authStore.d.ts +16 -0
- package/lib/typescript/ui/stores/fileStore.d.ts +30 -0
- package/lib/typescript/ui/stores/followStore.d.ts +24 -0
- package/lib/typescript/ui/styles/authStyles.d.ts +331 -0
- package/lib/typescript/ui/styles/fonts.d.ts +20 -0
- package/lib/typescript/ui/styles/index.d.ts +4 -0
- package/lib/typescript/ui/styles/spacing.d.ts +48 -0
- package/lib/typescript/ui/styles/theme.d.ts +67 -0
- package/lib/typescript/ui/types/fileManagement.d.ts +40 -0
- package/lib/typescript/ui/types/navigation.d.ts +36 -0
- package/lib/typescript/ui/utils/avatarUtils.d.ts +22 -0
- package/lib/typescript/ui/utils/colorUtils.d.ts +9 -0
- package/lib/typescript/ui/utils/confirmAction.d.ts +6 -0
- package/lib/typescript/ui/utils/errorHandlers.d.ts +34 -0
- package/lib/typescript/ui/utils/fileManagement.d.ts +86 -0
- package/lib/typescript/ui/utils/iconNames.d.ts +111 -0
- package/lib/typescript/ui/utils/sessionHelpers.d.ts +64 -0
- package/lib/typescript/ui/utils/storageHelpers.d.ts +27 -0
- package/lib/typescript/ui/utils/themeUtils.d.ts +10 -0
- package/lib/typescript/ui/utils/userUtils.d.ts +28 -0
- package/lib/typescript/utils/hookUtils.d.ts +101 -0
- package/package.json +3 -3
- package/src/assets/icons/OxyServices.d.ts +28 -0
- package/src/assets/icons/OxyServices.js +53 -0
- package/src/assets/illustrations/HighFive.d.ts +7 -0
- package/src/assets/illustrations/HighFive.js +41 -0
- package/src/index.d.ts +46 -0
- package/src/index.js +127 -0
- package/src/lib/sonner-safe.d.ts +8 -0
- package/src/lib/sonner-safe.js +28 -0
- package/src/lib/sonner.d.ts +11 -0
- package/src/lib/sonner.js +16 -0
- package/src/lib/sonner.native.d.ts +14 -0
- package/src/lib/sonner.native.js +46 -0
- package/src/lib/sonner.web.d.ts +14 -0
- package/src/lib/sonner.web.js +46 -0
- package/src/ui/client.d.ts +30 -0
- package/src/ui/client.js +64 -0
- package/src/ui/components/ActivityIndicator.d.ts +44 -0
- package/src/ui/components/ActivityIndicator.js +184 -0
- package/src/ui/components/AutoHeightScrollView.d.ts +22 -0
- package/src/ui/components/AutoHeightScrollView.js +33 -0
- package/src/ui/components/Avatar.d.ts +60 -0
- package/src/ui/components/Avatar.js +146 -0
- package/src/ui/components/BottomSheet.d.ts +28 -0
- package/src/ui/components/BottomSheet.js +374 -0
- package/src/ui/components/BottomSheetRouter.d.ts +8 -0
- package/src/ui/components/BottomSheetRouter.js +211 -0
- package/src/ui/components/CrossFadeIcon.d.ts +26 -0
- package/src/ui/components/CrossFadeIcon.js +111 -0
- package/src/ui/components/EmptyState.d.ts +7 -0
- package/src/ui/components/EmptyState.js +27 -0
- package/src/ui/components/FollowButton.d.ts +28 -0
- package/src/ui/components/FollowButton.js +197 -0
- package/src/ui/components/FontLoader.d.ts +14 -0
- package/src/ui/components/FontLoader.js +185 -0
- package/src/ui/components/GroupedItem.d.ts +23 -0
- package/src/ui/components/GroupedItem.js +84 -0
- package/src/ui/components/GroupedSection.d.ts +29 -0
- package/src/ui/components/GroupedSection.js +13 -0
- package/src/ui/components/Header.d.ts +37 -0
- package/src/ui/components/Header.js +400 -0
- package/src/ui/components/HelperText.d.ts +46 -0
- package/src/ui/components/HelperText.js +119 -0
- package/src/ui/components/Icon.d.ts +59 -0
- package/src/ui/components/Icon.js +108 -0
- package/src/ui/components/IconButton/IconButton.d.ts +98 -0
- package/src/ui/components/IconButton/IconButton.js +90 -0
- package/src/ui/components/IconButton/utils.d.ts +18 -0
- package/src/ui/components/IconButton/utils.js +119 -0
- package/src/ui/components/LoadingState.d.ts +8 -0
- package/src/ui/components/LoadingState.js +29 -0
- package/src/ui/components/OxyLogo.d.ts +28 -0
- package/src/ui/components/OxyLogo.js +53 -0
- package/src/ui/components/OxyPayButton.d.ts +28 -0
- package/src/ui/components/OxyPayButton.js +76 -0
- package/src/ui/components/OxyProvider.d.ts +37 -0
- package/src/ui/components/OxyProvider.js +197 -0
- package/src/ui/components/OxySignInButton.d.ts +64 -0
- package/src/ui/components/OxySignInButton.js +145 -0
- package/src/ui/components/ProfileCard.d.ts +17 -0
- package/src/ui/components/ProfileCard.js +82 -0
- package/src/ui/components/QuickActions.d.ts +14 -0
- package/src/ui/components/QuickActions.js +62 -0
- package/src/ui/components/Section.d.ts +11 -0
- package/src/ui/components/Section.js +24 -0
- package/src/ui/components/SectionTitle.d.ts +9 -0
- package/src/ui/components/SectionTitle.js +21 -0
- package/src/ui/components/SettingRow.d.ts +19 -0
- package/src/ui/components/SettingRow.js +38 -0
- package/src/ui/components/SignInModal.d.ts +17 -0
- package/src/ui/components/SignInModal.js +428 -0
- package/src/ui/components/StepBasedScreen.d.ts +25 -0
- package/src/ui/components/StepBasedScreen.js +372 -0
- package/src/ui/components/Surface.d.ts +75 -0
- package/src/ui/components/Surface.js +239 -0
- package/src/ui/components/TextField/Addons/Outline.d.ts +15 -0
- package/src/ui/components/TextField/Addons/Outline.js +30 -0
- package/src/ui/components/TextField/Addons/Underline.d.ts +18 -0
- package/src/ui/components/TextField/Addons/Underline.js +45 -0
- package/src/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +44 -0
- package/src/ui/components/TextField/Adornment/TextFieldAdornment.js +132 -0
- package/src/ui/components/TextField/Adornment/TextFieldAffix.d.ts +72 -0
- package/src/ui/components/TextField/Adornment/TextFieldAffix.js +88 -0
- package/src/ui/components/TextField/Adornment/TextFieldIcon.d.ts +77 -0
- package/src/ui/components/TextField/Adornment/TextFieldIcon.js +91 -0
- package/src/ui/components/TextField/Adornment/enums.d.ts +12 -0
- package/src/ui/components/TextField/Adornment/enums.js +18 -0
- package/src/ui/components/TextField/Adornment/types.d.ts +11 -0
- package/src/ui/components/TextField/Adornment/types.js +2 -0
- package/src/ui/components/TextField/Adornment/utils.d.ts +11 -0
- package/src/ui/components/TextField/Adornment/utils.js +50 -0
- package/src/ui/components/TextField/Label/InputLabel.d.ts +4 -0
- package/src/ui/components/TextField/Label/InputLabel.js +125 -0
- package/src/ui/components/TextField/Label/LabelBackground.d.ts +3 -0
- package/src/ui/components/TextField/Label/LabelBackground.js +71 -0
- package/src/ui/components/TextField/TextFieldFlat.d.ts +3 -0
- package/src/ui/components/TextField/TextFieldFlat.js +347 -0
- package/src/ui/components/TextField/TextFieldOutlined.d.ts +3 -0
- package/src/ui/components/TextField/TextFieldOutlined.js +313 -0
- package/src/ui/components/TextField/constants.d.ts +31 -0
- package/src/ui/components/TextField/constants.js +40 -0
- package/src/ui/components/TextField/helpers.d.ts +96 -0
- package/src/ui/components/TextField/helpers.js +388 -0
- package/src/ui/components/TextField/types.d.ts +155 -0
- package/src/ui/components/TextField/types.js +2 -0
- package/src/ui/components/TextField.d.ts +191 -0
- package/src/ui/components/TextField.js +291 -0
- package/src/ui/components/TouchableRipple/Pressable.d.ts +12 -0
- package/src/ui/components/TouchableRipple/Pressable.js +5 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.d.ts +61 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.js +246 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.native.d.ts +24 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.native.js +99 -0
- package/src/ui/components/TouchableRipple/utils.d.ts +10 -0
- package/src/ui/components/TouchableRipple/utils.js +40 -0
- package/src/ui/components/Typography/AnimatedText.d.ts +34 -0
- package/src/ui/components/Typography/AnimatedText.js +49 -0
- package/src/ui/components/Typography/types.d.ts +18 -0
- package/src/ui/components/Typography/types.js +22 -0
- package/src/ui/components/feedback/FormInput.d.ts +19 -0
- package/src/ui/components/feedback/FormInput.js +26 -0
- package/src/ui/components/feedback/ProgressIndicator.d.ts +10 -0
- package/src/ui/components/feedback/ProgressIndicator.js +16 -0
- package/src/ui/components/feedback/constants.d.ts +4 -0
- package/src/ui/components/feedback/constants.js +21 -0
- package/src/ui/components/feedback/feedbackStyles.d.ts +279 -0
- package/src/ui/components/feedback/feedbackStyles.js +250 -0
- package/src/ui/components/feedback/index.d.ts +6 -0
- package/src/ui/components/feedback/index.js +18 -0
- package/src/ui/components/feedback/types.d.ts +45 -0
- package/src/ui/components/feedback/types.js +2 -0
- package/src/ui/components/feedback/useFeedbackForm.d.ts +8 -0
- package/src/ui/components/feedback/useFeedbackForm.js +42 -0
- package/src/ui/components/fileManagement/AnimatedButton.d.ts +15 -0
- package/src/ui/components/fileManagement/AnimatedButton.js +29 -0
- package/src/ui/components/fileManagement/FileDetailsModal.d.ts +14 -0
- package/src/ui/components/fileManagement/FileDetailsModal.js +22 -0
- package/src/ui/components/fileManagement/FileViewer.d.ts +17 -0
- package/src/ui/components/fileManagement/FileViewer.js +138 -0
- package/src/ui/components/fileManagement/UploadPreview.d.ts +20 -0
- package/src/ui/components/fileManagement/UploadPreview.js +35 -0
- package/src/ui/components/fileManagement/styles.d.ts +859 -0
- package/src/ui/components/fileManagement/styles.js +861 -0
- package/src/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
- package/src/ui/components/icon/FAIRWalletIcon.js +54 -0
- package/src/ui/components/icon/OxyIcon.d.ts +9 -0
- package/src/ui/components/icon/OxyIcon.js +9 -0
- package/src/ui/components/icon/index.d.ts +3 -0
- package/src/ui/components/icon/index.js +10 -0
- package/src/ui/components/index.d.ts +16 -0
- package/src/ui/components/index.js +42 -0
- package/src/ui/components/internal/GroupedPillButtons.d.ts +23 -0
- package/src/ui/components/internal/GroupedPillButtons.js +149 -0
- package/src/ui/components/internal/PinInput.d.ts +22 -0
- package/src/ui/components/internal/PinInput.js +76 -0
- package/src/ui/components/modals/DeleteAccountModal.d.ts +18 -0
- package/src/ui/components/modals/DeleteAccountModal.js +154 -0
- package/src/ui/components/modals/index.d.ts +1 -0
- package/src/ui/components/modals/index.js +8 -0
- package/src/ui/components/payment/PaymentDetailsStep.d.ts +20 -0
- package/src/ui/components/payment/PaymentDetailsStep.js +65 -0
- package/src/ui/components/payment/PaymentMethodStep.d.ts +13 -0
- package/src/ui/components/payment/PaymentMethodStep.js +54 -0
- package/src/ui/components/payment/PaymentReviewStep.d.ts +15 -0
- package/src/ui/components/payment/PaymentReviewStep.js +88 -0
- package/src/ui/components/payment/PaymentSuccessStep.d.ts +9 -0
- package/src/ui/components/payment/PaymentSuccessStep.js +35 -0
- package/src/ui/components/payment/PaymentSummaryStep.d.ts +14 -0
- package/src/ui/components/payment/PaymentSummaryStep.js +60 -0
- package/src/ui/components/payment/constants.d.ts +6 -0
- package/src/ui/components/payment/constants.js +38 -0
- package/src/ui/components/payment/index.d.ts +8 -0
- package/src/ui/components/payment/index.js +24 -0
- package/src/ui/components/payment/paymentStyles.d.ts +395 -0
- package/src/ui/components/payment/paymentStyles.js +399 -0
- package/src/ui/components/payment/types.d.ts +39 -0
- package/src/ui/components/payment/types.js +2 -0
- package/src/ui/components/photogrid/JustifiedPhotoGrid.d.ts +26 -0
- package/src/ui/components/photogrid/JustifiedPhotoGrid.js +122 -0
- package/src/ui/components/styles/overlay.d.ts +3 -0
- package/src/ui/components/styles/overlay.js +81 -0
- package/src/ui/components/styles/shadow.d.ts +2 -0
- package/src/ui/components/styles/shadow.js +123 -0
- package/src/ui/components/theming.d.ts +7 -0
- package/src/ui/components/theming.js +111 -0
- package/src/ui/components/types.d.ts +80 -0
- package/src/ui/components/types.js +2 -0
- package/src/ui/components/utils/forwardRef.d.ts +11 -0
- package/src/ui/components/utils/forwardRef.js +46 -0
- package/src/ui/components/utils/hasTouchHandler.d.ts +5 -0
- package/src/ui/components/utils/hasTouchHandler.js +14 -0
- package/src/ui/components/utils/roundLayoutSize.d.ts +1 -0
- package/src/ui/components/utils/roundLayoutSize.js +5 -0
- package/src/ui/components/utils/splitStyles.d.ts +19 -0
- package/src/ui/components/utils/splitStyles.js +40 -0
- package/src/ui/constants/iconColors.d.ts +129 -0
- package/src/ui/constants/iconColors.js +76 -0
- package/src/ui/constants/spacing.d.ts +32 -0
- package/src/ui/constants/spacing.js +40 -0
- package/src/ui/constants/theme.d.ts +96 -0
- package/src/ui/constants/theme.js +118 -0
- package/src/ui/context/OxyContext.d.ts +75 -0
- package/src/ui/context/OxyContext.js +522 -0
- package/src/ui/context/ThemeContext.d.ts +18 -0
- package/src/ui/context/ThemeContext.js +25 -0
- package/src/ui/context/hooks/useAuthOperations.d.ts +39 -0
- package/src/ui/context/hooks/useAuthOperations.js +318 -0
- package/src/ui/hooks/index.d.ts +6 -0
- package/src/ui/hooks/index.js +19 -0
- package/src/ui/hooks/mutations/index.d.ts +8 -0
- package/src/ui/hooks/mutations/index.js +23 -0
- package/src/ui/hooks/mutations/mutationFactory.d.ts +75 -0
- package/src/ui/hooks/mutations/mutationFactory.js +126 -0
- package/src/ui/hooks/mutations/useAccountMutations.d.ts +42 -0
- package/src/ui/hooks/mutations/useAccountMutations.js +274 -0
- package/src/ui/hooks/mutations/useServicesMutations.d.ts +22 -0
- package/src/ui/hooks/mutations/useServicesMutations.js +149 -0
- package/src/ui/hooks/queries/index.d.ts +10 -0
- package/src/ui/hooks/queries/index.js +35 -0
- package/src/ui/hooks/queries/queryKeys.d.ts +64 -0
- package/src/ui/hooks/queries/queryKeys.js +82 -0
- package/src/ui/hooks/queries/useAccountQueries.d.ts +42 -0
- package/src/ui/hooks/queries/useAccountQueries.js +141 -0
- package/src/ui/hooks/queries/useSecurityQueries.d.ts +14 -0
- package/src/ui/hooks/queries/useSecurityQueries.js +45 -0
- package/src/ui/hooks/queries/useServicesQueries.d.ts +30 -0
- package/src/ui/hooks/queries/useServicesQueries.js +113 -0
- package/src/ui/hooks/queryClient.d.ts +18 -0
- package/src/ui/hooks/queryClient.js +111 -0
- package/src/ui/hooks/useAssets.d.ts +34 -0
- package/src/ui/hooks/useAssets.js +204 -0
- package/src/ui/hooks/useAsyncAction.d.ts +50 -0
- package/src/ui/hooks/useAsyncAction.js +77 -0
- package/src/ui/hooks/useAuth.d.ts +77 -0
- package/src/ui/hooks/useAuth.js +135 -0
- package/src/ui/hooks/useAvatarPicker.d.ts +24 -0
- package/src/ui/hooks/useAvatarPicker.js +44 -0
- package/src/ui/hooks/useColorScheme.d.ts +7 -0
- package/src/ui/hooks/useColorScheme.js +23 -0
- package/src/ui/hooks/useDeviceManagement.d.ts +26 -0
- package/src/ui/hooks/useDeviceManagement.js +69 -0
- package/src/ui/hooks/useFileDownloadUrl.d.ts +21 -0
- package/src/ui/hooks/useFileDownloadUrl.js +104 -0
- package/src/ui/hooks/useFileFiltering.d.ts +28 -0
- package/src/ui/hooks/useFileFiltering.js +80 -0
- package/src/ui/hooks/useFollow.d.ts +92 -0
- package/src/ui/hooks/useFollow.js +216 -0
- package/src/ui/hooks/useFollow.types.d.ts +32 -0
- package/src/ui/hooks/useFollow.types.js +4 -0
- package/src/ui/hooks/useI18n.d.ts +4 -0
- package/src/ui/hooks/useI18n.js +13 -0
- package/src/ui/hooks/useLanguageManagement.d.ts +24 -0
- package/src/ui/hooks/useLanguageManagement.js +108 -0
- package/src/ui/hooks/useProfileEditing.d.ts +35 -0
- package/src/ui/hooks/useProfileEditing.js +101 -0
- package/src/ui/hooks/useQueryClient.d.ts +6 -0
- package/src/ui/hooks/useQueryClient.js +16 -0
- package/src/ui/hooks/useSessionManagement.d.ts +40 -0
- package/src/ui/hooks/useSessionManagement.js +312 -0
- package/src/ui/hooks/useSessionSocket.d.ts +14 -0
- package/src/ui/hooks/useSessionSocket.js +209 -0
- package/src/ui/hooks/useSettingToggle.d.ts +56 -0
- package/src/ui/hooks/useSettingToggle.js +97 -0
- package/src/ui/hooks/useStorage.d.ts +15 -0
- package/src/ui/hooks/useStorage.js +40 -0
- package/src/ui/hooks/useThemeColors.d.ts +93 -0
- package/src/ui/hooks/useThemeColors.js +27 -0
- package/src/ui/hooks/useThemeStyles.d.ts +44 -0
- package/src/ui/hooks/useThemeStyles.js +63 -0
- package/src/ui/hooks/useWebSSO.d.ts +57 -0
- package/src/ui/hooks/useWebSSO.js +146 -0
- package/src/ui/index.d.ts +23 -0
- package/src/ui/index.js +97 -0
- package/src/ui/isFrontend.d.ts +2 -0
- package/src/ui/isFrontend.js +6 -0
- package/src/ui/navigation/bottomSheetManager.d.ts +26 -0
- package/src/ui/navigation/bottomSheetManager.js +68 -0
- package/src/ui/navigation/routes.d.ts +5 -0
- package/src/ui/navigation/routes.js +75 -0
- package/src/ui/screens/AccountCenterScreen.d.ts +4 -0
- package/src/ui/screens/AccountCenterScreen.js +202 -0
- package/src/ui/screens/AccountOverviewScreen.d.ts +4 -0
- package/src/ui/screens/AccountOverviewScreen.js +648 -0
- package/src/ui/screens/AccountSettingsScreen.d.ts +7 -0
- package/src/ui/screens/AccountSettingsScreen.js +480 -0
- package/src/ui/screens/AccountSwitcherScreen.d.ts +4 -0
- package/src/ui/screens/AccountSwitcherScreen.js +482 -0
- package/src/ui/screens/AccountVerificationScreen.d.ts +4 -0
- package/src/ui/screens/AccountVerificationScreen.js +164 -0
- package/src/ui/screens/AppInfoScreen.d.ts +4 -0
- package/src/ui/screens/AppInfoScreen.js +373 -0
- package/src/ui/screens/EditProfileFieldScreen.d.ts +12 -0
- package/src/ui/screens/EditProfileFieldScreen.js +549 -0
- package/src/ui/screens/FAQScreen.d.ts +4 -0
- package/src/ui/screens/FAQScreen.js +182 -0
- package/src/ui/screens/FeedbackScreen.d.ts +4 -0
- package/src/ui/screens/FeedbackScreen.js +160 -0
- package/src/ui/screens/FileManagementScreen.d.ts +4 -0
- package/src/ui/screens/FileManagementScreen.js +1473 -0
- package/src/ui/screens/FollowersListScreen.d.ts +8 -0
- package/src/ui/screens/FollowersListScreen.js +11 -0
- package/src/ui/screens/FollowingListScreen.d.ts +8 -0
- package/src/ui/screens/FollowingListScreen.js +11 -0
- package/src/ui/screens/HelpSupportScreen.d.ts +4 -0
- package/src/ui/screens/HelpSupportScreen.js +140 -0
- package/src/ui/screens/HistoryViewScreen.d.ts +4 -0
- package/src/ui/screens/HistoryViewScreen.js +225 -0
- package/src/ui/screens/LanguageSelectorScreen.d.ts +6 -0
- package/src/ui/screens/LanguageSelectorScreen.js +178 -0
- package/src/ui/screens/LearnMoreUsernamesScreen.d.ts +4 -0
- package/src/ui/screens/LearnMoreUsernamesScreen.js +150 -0
- package/src/ui/screens/LegalDocumentsScreen.d.ts +4 -0
- package/src/ui/screens/LegalDocumentsScreen.js +185 -0
- package/src/ui/screens/OxyAuthScreen.d.ts +16 -0
- package/src/ui/screens/OxyAuthScreen.js +431 -0
- package/src/ui/screens/PaymentGatewayScreen.d.ts +14 -0
- package/src/ui/screens/PaymentGatewayScreen.js +171 -0
- package/src/ui/screens/PremiumSubscriptionScreen.d.ts +4 -0
- package/src/ui/screens/PremiumSubscriptionScreen.js +1080 -0
- package/src/ui/screens/PrivacySettingsScreen.d.ts +4 -0
- package/src/ui/screens/PrivacySettingsScreen.js +252 -0
- package/src/ui/screens/ProfileScreen.d.ts +8 -0
- package/src/ui/screens/ProfileScreen.js +254 -0
- package/src/ui/screens/SavesCollectionsScreen.d.ts +4 -0
- package/src/ui/screens/SavesCollectionsScreen.js +150 -0
- package/src/ui/screens/SearchSettingsScreen.d.ts +4 -0
- package/src/ui/screens/SearchSettingsScreen.js +109 -0
- package/src/ui/screens/SessionManagementScreen.d.ts +4 -0
- package/src/ui/screens/SessionManagementScreen.js +320 -0
- package/src/ui/screens/UserLinksScreen.d.ts +14 -0
- package/src/ui/screens/UserLinksScreen.js +57 -0
- package/src/ui/screens/UserListScreen.d.ts +10 -0
- package/src/ui/screens/UserListScreen.js +249 -0
- package/src/ui/screens/WelcomeNewUserScreen.d.ts +12 -0
- package/src/ui/screens/WelcomeNewUserScreen.js +304 -0
- package/src/ui/screens/karma/KarmaAboutScreen.d.ts +4 -0
- package/src/ui/screens/karma/KarmaAboutScreen.js +39 -0
- package/src/ui/screens/karma/KarmaCenterScreen.d.ts +4 -0
- package/src/ui/screens/karma/KarmaCenterScreen.js +159 -0
- package/src/ui/screens/karma/KarmaFAQScreen.d.ts +4 -0
- package/src/ui/screens/karma/KarmaFAQScreen.js +143 -0
- package/src/ui/screens/karma/KarmaLeaderboardScreen.d.ts +4 -0
- package/src/ui/screens/karma/KarmaLeaderboardScreen.js +56 -0
- package/src/ui/screens/karma/KarmaRewardsScreen.d.ts +4 -0
- package/src/ui/screens/karma/KarmaRewardsScreen.js +460 -0
- package/src/ui/screens/karma/KarmaRulesScreen.d.ts +4 -0
- package/src/ui/screens/karma/KarmaRulesScreen.js +47 -0
- package/src/ui/server.d.ts +40 -0
- package/src/ui/server.js +57 -0
- package/src/ui/stores/accountStore.d.ts +26 -0
- package/src/ui/stores/accountStore.js +196 -0
- package/src/ui/stores/assetStore.d.ts +53 -0
- package/src/ui/stores/assetStore.js +192 -0
- package/src/ui/stores/authStore.d.ts +16 -0
- package/src/ui/stores/authStore.js +47 -0
- package/src/ui/stores/fileStore.d.ts +30 -0
- package/src/ui/stores/fileStore.js +113 -0
- package/src/ui/stores/followStore.d.ts +24 -0
- package/src/ui/stores/followStore.js +154 -0
- package/src/ui/styles/authStyles.d.ts +331 -0
- package/src/ui/styles/authStyles.js +332 -0
- package/src/ui/styles/fonts.d.ts +20 -0
- package/src/ui/styles/fonts.js +72 -0
- package/src/ui/styles/index.d.ts +4 -0
- package/src/ui/styles/index.js +20 -0
- package/src/ui/styles/spacing.d.ts +48 -0
- package/src/ui/styles/spacing.js +63 -0
- package/src/ui/styles/theme.d.ts +67 -0
- package/src/ui/styles/theme.js +114 -0
- package/src/ui/types/fileManagement.d.ts +40 -0
- package/src/ui/types/fileManagement.js +2 -0
- package/src/ui/types/navigation.d.ts +36 -0
- package/src/ui/types/navigation.js +2 -0
- package/src/ui/utils/avatarUtils.d.ts +22 -0
- package/src/ui/utils/avatarUtils.js +52 -0
- package/src/ui/utils/colorUtils.d.ts +9 -0
- package/src/ui/utils/colorUtils.js +19 -0
- package/src/ui/utils/confirmAction.d.ts +6 -0
- package/src/ui/utils/confirmAction.js +22 -0
- package/src/ui/utils/errorHandlers.d.ts +34 -0
- package/src/ui/utils/errorHandlers.js +128 -0
- package/src/ui/utils/fileManagement.d.ts +86 -0
- package/src/ui/utils/fileManagement.js +238 -0
- package/src/ui/utils/iconNames.d.ts +111 -0
- package/src/ui/utils/iconNames.js +124 -0
- package/src/ui/utils/sessionHelpers.d.ts +64 -0
- package/src/ui/utils/sessionHelpers.js +90 -0
- package/src/ui/utils/storageHelpers.d.ts +27 -0
- package/src/ui/utils/storageHelpers.js +114 -0
- package/src/ui/utils/themeUtils.d.ts +10 -0
- package/src/ui/utils/themeUtils.js +17 -0
- package/src/ui/utils/userUtils.d.ts +28 -0
- package/src/ui/utils/userUtils.js +54 -0
- package/src/utils/hookUtils.d.ts +101 -0
- package/src/utils/hookUtils.js +373 -0
|
@@ -0,0 +1,1473 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const react_native_1 = require("react-native");
|
|
42
|
+
const expo_image_1 = require("expo-image");
|
|
43
|
+
// Lazy load expo-document-picker (optional dependency)
|
|
44
|
+
// This allows the screen to work even if expo-document-picker is not installed
|
|
45
|
+
let DocumentPicker = null;
|
|
46
|
+
const loadDocumentPicker = async () => {
|
|
47
|
+
if (DocumentPicker)
|
|
48
|
+
return DocumentPicker;
|
|
49
|
+
try {
|
|
50
|
+
DocumentPicker = await import('expo-document-picker');
|
|
51
|
+
return DocumentPicker;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
throw new Error('expo-document-picker is not installed. Please install it: npx expo install expo-document-picker');
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const sonner_1 = require("../../lib/sonner");
|
|
58
|
+
const vector_icons_1 = require("@expo/vector-icons");
|
|
59
|
+
// @ts-ignore - MaterialCommunityIcons is available at runtime
|
|
60
|
+
const vector_icons_2 = require("@expo/vector-icons");
|
|
61
|
+
const fileStore_1 = require("../stores/fileStore");
|
|
62
|
+
const Header_1 = __importDefault(require("../components/Header"));
|
|
63
|
+
const JustifiedPhotoGrid_1 = __importDefault(require("../components/photogrid/JustifiedPhotoGrid"));
|
|
64
|
+
const components_1 = require("../components");
|
|
65
|
+
const useThemeStyles_1 = require("../hooks/useThemeStyles");
|
|
66
|
+
const useColorScheme_1 = require("../hooks/useColorScheme");
|
|
67
|
+
const themeUtils_1 = require("../utils/themeUtils");
|
|
68
|
+
const OxyContext_1 = require("../context/OxyContext");
|
|
69
|
+
const useI18n_1 = require("../hooks/useI18n");
|
|
70
|
+
const useAccountMutations_1 = require("../hooks/mutations/useAccountMutations");
|
|
71
|
+
const fileManagement_1 = require("../utils/fileManagement");
|
|
72
|
+
const FileViewer_1 = require("../components/fileManagement/FileViewer");
|
|
73
|
+
const FileDetailsModal_1 = require("../components/fileManagement/FileDetailsModal");
|
|
74
|
+
const UploadPreview_1 = require("../components/fileManagement/UploadPreview");
|
|
75
|
+
const styles_1 = require("../components/fileManagement/styles");
|
|
76
|
+
/** Extract error message from unknown error type */
|
|
77
|
+
const getErrorMessage = (error) => error instanceof Error ? getErrorMessage(error) : typeof error === 'string' ? error : undefined;
|
|
78
|
+
// Animated button component for smooth transitions
|
|
79
|
+
const AnimatedButton = ({ isSelected, onPress, icon, primaryColor, textColor, style }) => {
|
|
80
|
+
const animatedValue = (0, react_1.useRef)(new react_native_1.Animated.Value(isSelected ? 1 : 0)).current;
|
|
81
|
+
(0, react_1.useEffect)(() => {
|
|
82
|
+
react_native_1.Animated.timing(animatedValue, {
|
|
83
|
+
toValue: isSelected ? 1 : 0,
|
|
84
|
+
duration: 200,
|
|
85
|
+
easing: react_native_1.Easing.out(react_native_1.Easing.ease),
|
|
86
|
+
useNativeDriver: false,
|
|
87
|
+
}).start();
|
|
88
|
+
}, [isSelected, animatedValue]);
|
|
89
|
+
const backgroundColor = animatedValue.interpolate({
|
|
90
|
+
inputRange: [0, 1],
|
|
91
|
+
outputRange: ['transparent', primaryColor],
|
|
92
|
+
});
|
|
93
|
+
const iconColor = animatedValue.interpolate({
|
|
94
|
+
inputRange: [0, 1],
|
|
95
|
+
outputRange: [textColor, '#FFFFFF'],
|
|
96
|
+
});
|
|
97
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: onPress, activeOpacity: 0.7, children: (0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: [
|
|
98
|
+
style,
|
|
99
|
+
{
|
|
100
|
+
backgroundColor,
|
|
101
|
+
},
|
|
102
|
+
], children: (0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { children: (0, jsx_runtime_1.jsx)(vector_icons_2.MaterialCommunityIcons, { name: icon, size: 16, color: isSelected ? '#FFFFFF' : textColor }) }) }) }));
|
|
103
|
+
};
|
|
104
|
+
const FileManagementScreen = ({ onClose, theme, goBack, navigate, userId, containerWidth = 400, // Fallback for when not provided by the router
|
|
105
|
+
selectMode = false, multiSelect = false, onSelect, onConfirmSelection, initialSelectedIds = [], maxSelection, disabledMimeTypes = [], afterSelect = 'close', allowUploadInSelectMode = true, defaultVisibility = 'private', linkContext, }) => {
|
|
106
|
+
// Use useOxy() hook for OxyContext values
|
|
107
|
+
const { user, oxyServices } = (0, OxyContext_1.useOxy)();
|
|
108
|
+
const { t } = (0, useI18n_1.useI18n)();
|
|
109
|
+
const uploadFileMutation = (0, useAccountMutations_1.useUploadFile)();
|
|
110
|
+
const files = (0, fileStore_1.useFiles)();
|
|
111
|
+
// Ensure containerWidth is a number (TypeScript guard)
|
|
112
|
+
const safeContainerWidth = typeof containerWidth === 'number' ? containerWidth : 400;
|
|
113
|
+
const uploading = (0, fileStore_1.useUploading)();
|
|
114
|
+
const uploadProgress = (0, fileStore_1.useUploadAggregateProgress)();
|
|
115
|
+
const deleting = (0, fileStore_1.useDeleting)();
|
|
116
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
117
|
+
const [refreshing, setRefreshing] = (0, react_1.useState)(false);
|
|
118
|
+
const [paging, setPaging] = (0, react_1.useState)({ offset: 0, limit: 40, total: 0, hasMore: true, loadingMore: false });
|
|
119
|
+
const [selectedFile, setSelectedFile] = (0, react_1.useState)(null);
|
|
120
|
+
const [showFileDetails, setShowFileDetails] = (0, react_1.useState)(false);
|
|
121
|
+
// In selectMode we never open the detailed viewer
|
|
122
|
+
const [openedFile, setOpenedFile] = (0, react_1.useState)(null);
|
|
123
|
+
const [fileContent, setFileContent] = (0, react_1.useState)(null);
|
|
124
|
+
const [loadingFileContent, setLoadingFileContent] = (0, react_1.useState)(false);
|
|
125
|
+
const [showFileDetailsInViewer, setShowFileDetailsInViewer] = (0, react_1.useState)(false);
|
|
126
|
+
const [isPickingDocument, setIsPickingDocument] = (0, react_1.useState)(false);
|
|
127
|
+
const [viewMode, setViewMode] = (0, react_1.useState)('all');
|
|
128
|
+
const [searchQuery, setSearchQuery] = (0, react_1.useState)('');
|
|
129
|
+
const [sortBy, setSortBy] = (0, react_1.useState)('date');
|
|
130
|
+
const [sortOrder, setSortOrder] = (0, react_1.useState)('desc');
|
|
131
|
+
const [pendingFiles, setPendingFiles] = (0, react_1.useState)([]);
|
|
132
|
+
const [showUploadPreview, setShowUploadPreview] = (0, react_1.useState)(false);
|
|
133
|
+
// Derived filtered and sorted files (avoid setState loops)
|
|
134
|
+
const filteredFiles = (0, react_1.useMemo)(() => {
|
|
135
|
+
let filteredByMode = files;
|
|
136
|
+
if (viewMode === 'photos') {
|
|
137
|
+
filteredByMode = files.filter(file => file.contentType.startsWith('image/'));
|
|
138
|
+
}
|
|
139
|
+
else if (viewMode === 'videos') {
|
|
140
|
+
filteredByMode = files.filter(file => file.contentType.startsWith('video/'));
|
|
141
|
+
}
|
|
142
|
+
else if (viewMode === 'documents') {
|
|
143
|
+
filteredByMode = files.filter(file => file.contentType.includes('pdf') ||
|
|
144
|
+
file.contentType.includes('document') ||
|
|
145
|
+
file.contentType.includes('text') ||
|
|
146
|
+
file.contentType.includes('msword') ||
|
|
147
|
+
file.contentType.includes('excel') ||
|
|
148
|
+
file.contentType.includes('spreadsheet') ||
|
|
149
|
+
file.contentType.includes('presentation') ||
|
|
150
|
+
file.contentType.includes('powerpoint'));
|
|
151
|
+
}
|
|
152
|
+
else if (viewMode === 'audio') {
|
|
153
|
+
filteredByMode = files.filter(file => file.contentType.startsWith('audio/'));
|
|
154
|
+
}
|
|
155
|
+
let filtered = filteredByMode;
|
|
156
|
+
if (searchQuery.trim()) {
|
|
157
|
+
const query = searchQuery.toLowerCase();
|
|
158
|
+
filtered = filteredByMode.filter(file => file.filename.toLowerCase().includes(query) ||
|
|
159
|
+
file.contentType.toLowerCase().includes(query) ||
|
|
160
|
+
(file.metadata?.description?.toLowerCase().includes(query)));
|
|
161
|
+
}
|
|
162
|
+
// Sort files
|
|
163
|
+
const sorted = [...filtered].sort((a, b) => {
|
|
164
|
+
let comparison = 0;
|
|
165
|
+
if (sortBy === 'date') {
|
|
166
|
+
const dateA = new Date(a.uploadDate || 0).getTime();
|
|
167
|
+
const dateB = new Date(b.uploadDate || 0).getTime();
|
|
168
|
+
comparison = dateA - dateB;
|
|
169
|
+
}
|
|
170
|
+
else if (sortBy === 'size') {
|
|
171
|
+
comparison = (a.length || 0) - (b.length || 0);
|
|
172
|
+
}
|
|
173
|
+
else if (sortBy === 'name') {
|
|
174
|
+
comparison = (a.filename || '').localeCompare(b.filename || '');
|
|
175
|
+
}
|
|
176
|
+
else if (sortBy === 'type') {
|
|
177
|
+
comparison = (a.contentType || '').localeCompare(b.contentType || '');
|
|
178
|
+
}
|
|
179
|
+
return sortOrder === 'asc' ? comparison : -comparison;
|
|
180
|
+
});
|
|
181
|
+
return sorted;
|
|
182
|
+
}, [files, searchQuery, viewMode, sortBy, sortOrder]);
|
|
183
|
+
const [photoDimensions, setPhotoDimensions] = (0, react_1.useState)({});
|
|
184
|
+
const [loadingDimensions, setLoadingDimensions] = (0, react_1.useState)(false);
|
|
185
|
+
const uploadStartRef = (0, react_1.useRef)(null);
|
|
186
|
+
const MIN_BANNER_MS = 600;
|
|
187
|
+
// Selection state
|
|
188
|
+
const [selectedIds, setSelectedIds] = (0, react_1.useState)(new Set(initialSelectedIds));
|
|
189
|
+
const [lastSelectedFileId, setLastSelectedFileId] = (0, react_1.useState)(null);
|
|
190
|
+
const scrollViewRef = (0, react_1.useRef)(null);
|
|
191
|
+
const photoScrollViewRef = (0, react_1.useRef)(null);
|
|
192
|
+
const itemRefs = (0, react_1.useRef)(new Map()); // Track item positions
|
|
193
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
194
|
+
(0, react_1.useEffect)(() => {
|
|
195
|
+
if (initialSelectedIds?.length) {
|
|
196
|
+
setSelectedIds(new Set(initialSelectedIds));
|
|
197
|
+
}
|
|
198
|
+
}, [initialSelectedIds]);
|
|
199
|
+
const toggleSelect = (0, react_1.useCallback)(async (file) => {
|
|
200
|
+
// Allow selection in regular mode for bulk operations
|
|
201
|
+
// if (!selectMode) return;
|
|
202
|
+
if (disabledMimeTypes.length) {
|
|
203
|
+
const blocked = disabledMimeTypes.some(mt => file.contentType === mt || file.contentType.startsWith(mt.endsWith('/') ? mt : `${mt}/`));
|
|
204
|
+
if (blocked) {
|
|
205
|
+
sonner_1.toast.error(t('fileManagement.toasts.fileTypeBlocked'));
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Update file visibility if it differs from defaultVisibility
|
|
210
|
+
const fileVisibility = file.metadata?.visibility || 'private';
|
|
211
|
+
if (fileVisibility !== defaultVisibility) {
|
|
212
|
+
try {
|
|
213
|
+
await oxyServices.assetUpdateVisibility(file.id, defaultVisibility);
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
// Continue anyway - selection shouldn't fail if visibility update fails
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Track the selected file for scrolling
|
|
220
|
+
setLastSelectedFileId(file.id);
|
|
221
|
+
// Link file to entity if linkContext is provided
|
|
222
|
+
if (linkContext) {
|
|
223
|
+
try {
|
|
224
|
+
await oxyServices.assetLink(file.id, linkContext.app, linkContext.entityType, linkContext.entityId, defaultVisibility, linkContext.webhookUrl);
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
// Continue anyway - selection shouldn't fail if linking fails
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (!multiSelect) {
|
|
231
|
+
onSelect?.(file);
|
|
232
|
+
if (afterSelect === 'back') {
|
|
233
|
+
goBack?.();
|
|
234
|
+
}
|
|
235
|
+
else if (afterSelect === 'close') {
|
|
236
|
+
onClose?.();
|
|
237
|
+
}
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
setSelectedIds(prev => {
|
|
241
|
+
const next = new Set(prev);
|
|
242
|
+
const already = next.has(file.id);
|
|
243
|
+
if (!already) {
|
|
244
|
+
if (maxSelection && next.size >= maxSelection) {
|
|
245
|
+
sonner_1.toast.error(t('fileManagement.toasts.maxSelection', { max: maxSelection }));
|
|
246
|
+
return prev;
|
|
247
|
+
}
|
|
248
|
+
next.add(file.id);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
next.delete(file.id);
|
|
252
|
+
}
|
|
253
|
+
return next;
|
|
254
|
+
});
|
|
255
|
+
}, [selectMode, multiSelect, onSelect, onClose, goBack, disabledMimeTypes, maxSelection, afterSelect, defaultVisibility, oxyServices, linkContext]);
|
|
256
|
+
const confirmMultiSelection = (0, react_1.useCallback)(async () => {
|
|
257
|
+
if (!selectMode || !multiSelect)
|
|
258
|
+
return;
|
|
259
|
+
const map = {};
|
|
260
|
+
files.forEach(f => { map[f.id] = f; });
|
|
261
|
+
const chosen = Array.from(selectedIds).map(id => map[id]).filter(Boolean);
|
|
262
|
+
// Update visibility and link files if needed
|
|
263
|
+
const updatePromises = chosen.map(async (file) => {
|
|
264
|
+
// Update visibility if needed
|
|
265
|
+
const fileVisibility = file.metadata?.visibility || 'private';
|
|
266
|
+
if (fileVisibility !== defaultVisibility) {
|
|
267
|
+
try {
|
|
268
|
+
await oxyServices.assetUpdateVisibility(file.id, defaultVisibility);
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
// Visibility update failed, continue with selection
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
// Link file to entity if linkContext provided
|
|
275
|
+
if (linkContext) {
|
|
276
|
+
try {
|
|
277
|
+
await oxyServices.assetLink(file.id, linkContext.app, linkContext.entityType, linkContext.entityId, defaultVisibility, linkContext.webhookUrl);
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
// File linking failed, continue with selection
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
// Wait for all updates (but don't block on failures)
|
|
285
|
+
await Promise.allSettled(updatePromises);
|
|
286
|
+
onConfirmSelection?.(chosen);
|
|
287
|
+
onClose?.();
|
|
288
|
+
}, [selectMode, multiSelect, selectedIds, files, onConfirmSelection, onClose, defaultVisibility, oxyServices, linkContext]);
|
|
289
|
+
const endUpload = (0, react_1.useCallback)(() => {
|
|
290
|
+
const started = uploadStartRef.current;
|
|
291
|
+
const elapsed = started ? Date.now() - started : MIN_BANNER_MS;
|
|
292
|
+
const remaining = elapsed < MIN_BANNER_MS ? MIN_BANNER_MS - elapsed : 0;
|
|
293
|
+
setTimeout(() => {
|
|
294
|
+
fileStore_1.useFileStore.getState().setUploading(false);
|
|
295
|
+
uploadStartRef.current = null;
|
|
296
|
+
}, remaining);
|
|
297
|
+
}, []);
|
|
298
|
+
// Helper to safely request a thumbnail variant only for image mime types.
|
|
299
|
+
const getSafeDownloadUrlCallback = (0, react_1.useCallback)((file, variant = 'thumb') => {
|
|
300
|
+
return (0, fileManagement_1.getSafeDownloadUrl)(file, variant, (fileId, variant) => oxyServices.getFileDownloadUrl(fileId, variant));
|
|
301
|
+
}, [oxyServices]);
|
|
302
|
+
// Use centralized theme styles hook for consistency
|
|
303
|
+
const colorScheme = (0, useColorScheme_1.useColorScheme)();
|
|
304
|
+
const normalizedTheme = (0, themeUtils_1.normalizeTheme)(theme);
|
|
305
|
+
const baseThemeStyles = (0, useThemeStyles_1.useThemeStyles)(normalizedTheme, colorScheme);
|
|
306
|
+
// FileManagementScreen uses a slightly different light background
|
|
307
|
+
const themeStyles = (0, react_1.useMemo)(() => ({
|
|
308
|
+
...baseThemeStyles,
|
|
309
|
+
backgroundColor: baseThemeStyles.isDarkTheme ? baseThemeStyles.backgroundColor : '#f2f2f2',
|
|
310
|
+
}), [baseThemeStyles]);
|
|
311
|
+
// Extract commonly used theme variables
|
|
312
|
+
const backgroundColor = themeStyles.backgroundColor;
|
|
313
|
+
const borderColor = themeStyles.borderColor;
|
|
314
|
+
const targetUserId = userId || user?.id;
|
|
315
|
+
const storeSetUploading = (0, fileStore_1.useFileStore)(s => s.setUploading);
|
|
316
|
+
const storeSetUploadProgress = (0, fileStore_1.useFileStore)(s => s.setUploadProgress);
|
|
317
|
+
const storeSetDeleting = (0, fileStore_1.useFileStore)(s => s.setDeleting);
|
|
318
|
+
const loadFiles = (0, react_1.useCallback)(async (mode = 'initial') => {
|
|
319
|
+
if (!targetUserId)
|
|
320
|
+
return;
|
|
321
|
+
try {
|
|
322
|
+
if (mode === 'refresh') {
|
|
323
|
+
setRefreshing(true);
|
|
324
|
+
}
|
|
325
|
+
else if (mode === 'initial') {
|
|
326
|
+
setLoading(true);
|
|
327
|
+
setPaging(p => ({ ...p, offset: 0, hasMore: true }));
|
|
328
|
+
}
|
|
329
|
+
else if (mode === 'more') {
|
|
330
|
+
// Prevent duplicate fetches
|
|
331
|
+
setPaging(p => ({ ...p, loadingMore: true }));
|
|
332
|
+
}
|
|
333
|
+
const currentPaging = mode === 'more' ? (prevPagingRef.current ?? paging) : paging;
|
|
334
|
+
const effectiveOffset = mode === 'more' ? currentPaging.offset + currentPaging.limit : 0;
|
|
335
|
+
const response = await oxyServices.listUserFiles(currentPaging.limit, effectiveOffset);
|
|
336
|
+
const assets = (response.files || []).map((f) => ({
|
|
337
|
+
id: f.id,
|
|
338
|
+
filename: f.originalName || f.sha256,
|
|
339
|
+
contentType: f.mime,
|
|
340
|
+
length: f.size,
|
|
341
|
+
chunkSize: 0,
|
|
342
|
+
uploadDate: f.createdAt,
|
|
343
|
+
metadata: f.metadata || {},
|
|
344
|
+
variants: f.variants || [],
|
|
345
|
+
}));
|
|
346
|
+
if (mode === 'more') {
|
|
347
|
+
// append
|
|
348
|
+
fileStore_1.useFileStore.getState().setFiles(assets, { merge: true });
|
|
349
|
+
setPaging(p => ({
|
|
350
|
+
...p,
|
|
351
|
+
offset: effectiveOffset,
|
|
352
|
+
total: response.total || (effectiveOffset + assets.length),
|
|
353
|
+
hasMore: response.hasMore,
|
|
354
|
+
loadingMore: false,
|
|
355
|
+
}));
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
fileStore_1.useFileStore.getState().setFiles(assets, { merge: false });
|
|
359
|
+
setPaging(p => ({
|
|
360
|
+
...p,
|
|
361
|
+
offset: 0,
|
|
362
|
+
total: response.total || assets.length,
|
|
363
|
+
hasMore: response.hasMore,
|
|
364
|
+
loadingMore: false,
|
|
365
|
+
}));
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.loadFailed'));
|
|
370
|
+
}
|
|
371
|
+
finally {
|
|
372
|
+
setLoading(false);
|
|
373
|
+
setRefreshing(false);
|
|
374
|
+
setPaging(p => ({ ...p, loadingMore: false }));
|
|
375
|
+
}
|
|
376
|
+
}, [targetUserId, oxyServices, paging]);
|
|
377
|
+
// Keep a ref to avoid stale closure when calculating next offset
|
|
378
|
+
const prevPagingRef = (0, react_1.useRef)(paging);
|
|
379
|
+
(0, react_1.useEffect)(() => { prevPagingRef.current = paging; }, [paging]);
|
|
380
|
+
// (removed effect; filteredFiles is memoized)
|
|
381
|
+
// Load photo dimensions for justified grid - unified approach using Image.getSize
|
|
382
|
+
const loadPhotoDimensions = (0, react_1.useCallback)(async (photos) => {
|
|
383
|
+
if (photos.length === 0)
|
|
384
|
+
return;
|
|
385
|
+
setLoadingDimensions(true);
|
|
386
|
+
const newDimensions = { ...photoDimensions };
|
|
387
|
+
let hasNewDimensions = false;
|
|
388
|
+
// Only load dimensions for photos we don't have yet
|
|
389
|
+
const photosToLoad = photos.filter(photo => !newDimensions[photo.id]);
|
|
390
|
+
if (photosToLoad.length === 0) {
|
|
391
|
+
setLoadingDimensions(false);
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
try {
|
|
395
|
+
await Promise.all(photosToLoad.map(async (photo) => {
|
|
396
|
+
try {
|
|
397
|
+
const downloadUrl = getSafeDownloadUrlCallback(photo, 'thumb');
|
|
398
|
+
// Unified approach using Image.getSize (works on all platforms)
|
|
399
|
+
await new Promise((resolve) => {
|
|
400
|
+
react_native_1.Image.getSize(downloadUrl, (width, height) => {
|
|
401
|
+
newDimensions[photo.id] = { width, height };
|
|
402
|
+
hasNewDimensions = true;
|
|
403
|
+
resolve();
|
|
404
|
+
}, () => {
|
|
405
|
+
// Fallback dimensions
|
|
406
|
+
newDimensions[photo.id] = { width: 1, height: 1 };
|
|
407
|
+
hasNewDimensions = true;
|
|
408
|
+
resolve();
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
catch (error) {
|
|
413
|
+
// Fallback dimensions for any errors
|
|
414
|
+
newDimensions[photo.id] = { width: 1, height: 1 };
|
|
415
|
+
hasNewDimensions = true;
|
|
416
|
+
}
|
|
417
|
+
}));
|
|
418
|
+
if (hasNewDimensions) {
|
|
419
|
+
setPhotoDimensions(newDimensions);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
catch (error) {
|
|
423
|
+
// Photo dimensions loading failed, continue without dimensions
|
|
424
|
+
}
|
|
425
|
+
finally {
|
|
426
|
+
setLoadingDimensions(false);
|
|
427
|
+
}
|
|
428
|
+
}, [getSafeDownloadUrlCallback, photoDimensions]);
|
|
429
|
+
// Create justified rows from photos with responsive algorithm
|
|
430
|
+
const createJustifiedRows = (0, react_1.useCallback)((photos, containerWidth) => {
|
|
431
|
+
if (photos.length === 0)
|
|
432
|
+
return [];
|
|
433
|
+
const rows = [];
|
|
434
|
+
const photosPerRow = 3; // Fixed 3 photos per row for consistency
|
|
435
|
+
for (let i = 0; i < photos.length; i += photosPerRow) {
|
|
436
|
+
const rowPhotos = photos.slice(i, i + photosPerRow);
|
|
437
|
+
rows.push(rowPhotos);
|
|
438
|
+
}
|
|
439
|
+
return rows;
|
|
440
|
+
}, []);
|
|
441
|
+
const processFileUploads = async (selectedFiles) => {
|
|
442
|
+
if (selectedFiles.length === 0)
|
|
443
|
+
return [];
|
|
444
|
+
if (!targetUserId)
|
|
445
|
+
return []; // Guard clause to ensure userId is defined
|
|
446
|
+
const uploadedFiles = [];
|
|
447
|
+
try {
|
|
448
|
+
storeSetUploadProgress({ current: 0, total: selectedFiles.length });
|
|
449
|
+
const maxSize = 50 * 1024 * 1024; // 50MB
|
|
450
|
+
const oversizedFiles = selectedFiles.filter(file => file.size > maxSize);
|
|
451
|
+
if (oversizedFiles.length > 0) {
|
|
452
|
+
const fileList = oversizedFiles.map(f => f.name).join(', ');
|
|
453
|
+
sonner_1.toast.error(t('fileManagement.toasts.filesTooLarge', { files: fileList }));
|
|
454
|
+
return [];
|
|
455
|
+
}
|
|
456
|
+
let successCount = 0;
|
|
457
|
+
let failureCount = 0;
|
|
458
|
+
const errors = [];
|
|
459
|
+
for (let i = 0; i < selectedFiles.length; i++) {
|
|
460
|
+
storeSetUploadProgress({ current: i + 1, total: selectedFiles.length });
|
|
461
|
+
const raw = selectedFiles[i];
|
|
462
|
+
const fileName = raw.name || `file-${i + 1}`;
|
|
463
|
+
const optimisticId = `temp-${Date.now()}-${i}-${Math.random().toString(36).substr(2, 9)}`; // Unique ID per file
|
|
464
|
+
try {
|
|
465
|
+
// Validate file before upload
|
|
466
|
+
if (!raw || !raw.name || raw.size === undefined || raw.size <= 0) {
|
|
467
|
+
const errorMsg = `Invalid file: ${fileName}`;
|
|
468
|
+
if (__DEV__) {
|
|
469
|
+
console.error('Upload validation failed:', { file: raw, error: errorMsg });
|
|
470
|
+
}
|
|
471
|
+
failureCount++;
|
|
472
|
+
errors.push(`${fileName}: Invalid file (missing name or size)`);
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
const optimisticFile = {
|
|
476
|
+
id: optimisticId,
|
|
477
|
+
filename: raw.name,
|
|
478
|
+
contentType: raw.type || 'application/octet-stream',
|
|
479
|
+
length: raw.size,
|
|
480
|
+
chunkSize: 0,
|
|
481
|
+
uploadDate: new Date().toISOString(),
|
|
482
|
+
metadata: { uploading: true },
|
|
483
|
+
variants: [],
|
|
484
|
+
};
|
|
485
|
+
fileStore_1.useFileStore.getState().addFile(optimisticFile, { prepend: true });
|
|
486
|
+
// Use the mutation hook with authentication handling
|
|
487
|
+
const result = await uploadFileMutation.mutateAsync({
|
|
488
|
+
file: raw,
|
|
489
|
+
visibility: defaultVisibility,
|
|
490
|
+
});
|
|
491
|
+
// Attempt to refresh file list incrementally – fetch single file metadata if API allows
|
|
492
|
+
const f = result?.file ?? result?.files?.[0];
|
|
493
|
+
if (f) {
|
|
494
|
+
const merged = {
|
|
495
|
+
id: f.id,
|
|
496
|
+
filename: f.originalName || f.sha256 || raw.name,
|
|
497
|
+
contentType: f.mime || raw.type || 'application/octet-stream',
|
|
498
|
+
length: f.size || raw.size,
|
|
499
|
+
chunkSize: 0,
|
|
500
|
+
uploadDate: f.createdAt || new Date().toISOString(),
|
|
501
|
+
metadata: f.metadata || {},
|
|
502
|
+
variants: f.variants || [],
|
|
503
|
+
};
|
|
504
|
+
// Remove optimistic then add real
|
|
505
|
+
fileStore_1.useFileStore.getState().removeFile(optimisticId);
|
|
506
|
+
fileStore_1.useFileStore.getState().addFile(merged, { prepend: true });
|
|
507
|
+
uploadedFiles.push(merged);
|
|
508
|
+
successCount++;
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
// Fallback: will reconcile on later list refresh
|
|
512
|
+
fileStore_1.useFileStore.getState().updateFile(optimisticId, { metadata: { uploading: false } });
|
|
513
|
+
if (__DEV__) {
|
|
514
|
+
console.warn('Upload completed but no file data returned:', { fileName, result });
|
|
515
|
+
}
|
|
516
|
+
// Still count as success if upload didn't throw
|
|
517
|
+
successCount++;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
catch (error) {
|
|
521
|
+
failureCount++;
|
|
522
|
+
const errorMessage = getErrorMessage(error) || String(error) || 'Upload failed';
|
|
523
|
+
const fullError = `${fileName}: ${errorMessage}`;
|
|
524
|
+
errors.push(fullError);
|
|
525
|
+
if (__DEV__) {
|
|
526
|
+
console.error('File upload failed:', {
|
|
527
|
+
fileName,
|
|
528
|
+
fileSize: raw.size,
|
|
529
|
+
fileType: raw.type,
|
|
530
|
+
error: errorMessage,
|
|
531
|
+
stack: (error instanceof Error) ? error.stack : undefined
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
// Remove optimistic file on error (use the same optimisticId from above)
|
|
535
|
+
fileStore_1.useFileStore.getState().removeFile(optimisticId);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
// Show success/error messages
|
|
539
|
+
if (successCount > 0) {
|
|
540
|
+
sonner_1.toast.success(t('fileManagement.toasts.uploadSuccess', { count: successCount }));
|
|
541
|
+
}
|
|
542
|
+
if (failureCount > 0) {
|
|
543
|
+
// Show detailed error message with first few errors
|
|
544
|
+
const errorDetails = errors.length > 0
|
|
545
|
+
? `\n${errors.slice(0, 3).join('\n')}${errors.length > 3 ? `\n...and ${errors.length - 3} more` : ''}`
|
|
546
|
+
: '';
|
|
547
|
+
sonner_1.toast.error(`${t('fileManagement.toasts.uploadFailed', { count: failureCount })}${errorDetails}`);
|
|
548
|
+
}
|
|
549
|
+
// Silent background refresh to ensure metadata/variants updated
|
|
550
|
+
setTimeout(() => { loadFiles('silent'); }, 1200);
|
|
551
|
+
}
|
|
552
|
+
catch (error) {
|
|
553
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.uploadError'));
|
|
554
|
+
}
|
|
555
|
+
finally {
|
|
556
|
+
storeSetUploadProgress(null);
|
|
557
|
+
}
|
|
558
|
+
return uploadedFiles;
|
|
559
|
+
};
|
|
560
|
+
// biome-ignore lint/suspicious/noExplicitAny: Files from document picker may have extra properties like uri
|
|
561
|
+
const handleFileSelection = (0, react_1.useCallback)(async (selectedFiles) => {
|
|
562
|
+
const MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
|
|
563
|
+
const processedFiles = [];
|
|
564
|
+
for (const file of selectedFiles) {
|
|
565
|
+
// Validate file has required properties
|
|
566
|
+
if (!file) {
|
|
567
|
+
if (__DEV__) {
|
|
568
|
+
console.error('Invalid file: file is null or undefined');
|
|
569
|
+
}
|
|
570
|
+
sonner_1.toast.error(t('fileManagement.toasts.invalidFileMissing'));
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
573
|
+
if (!file.name || typeof file.name !== 'string') {
|
|
574
|
+
if (__DEV__) {
|
|
575
|
+
console.error('Invalid file: missing or invalid name property', file);
|
|
576
|
+
}
|
|
577
|
+
sonner_1.toast.error(t('fileManagement.toasts.invalidFileName'));
|
|
578
|
+
continue;
|
|
579
|
+
}
|
|
580
|
+
if (file.size === undefined || file.size === null || Number.isNaN(file.size)) {
|
|
581
|
+
if (__DEV__) {
|
|
582
|
+
console.error('Invalid file: missing or invalid size property', file);
|
|
583
|
+
}
|
|
584
|
+
sonner_1.toast.error(t('fileManagement.toasts.invalidFileSize', { name: file.name || 'unknown' }));
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
if (file.size <= 0) {
|
|
588
|
+
if (__DEV__) {
|
|
589
|
+
console.error('Invalid file: file size is zero or negative', file);
|
|
590
|
+
}
|
|
591
|
+
sonner_1.toast.error(t('fileManagement.toasts.fileEmpty', { name: file.name }));
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
// Validate file size
|
|
595
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
596
|
+
sonner_1.toast.error(t('fileManagement.toasts.fileTooLarge', { name: file.name, maxSize: (0, fileManagement_1.formatFileSize)(MAX_FILE_SIZE) }));
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
// Ensure file has a type property
|
|
600
|
+
const fileType = file.type || 'application/octet-stream';
|
|
601
|
+
// Generate preview for images - unified approach
|
|
602
|
+
let preview;
|
|
603
|
+
if (fileType.startsWith('image/')) {
|
|
604
|
+
// Try to use file URI from expo-document-picker if available (works on all platforms)
|
|
605
|
+
const fileUri = file.uri;
|
|
606
|
+
if (fileUri && typeof fileUri === 'string' &&
|
|
607
|
+
(fileUri.startsWith('file://') || fileUri.startsWith('content://') ||
|
|
608
|
+
fileUri.startsWith('http://') || fileUri.startsWith('https://') ||
|
|
609
|
+
fileUri.startsWith('blob:'))) {
|
|
610
|
+
preview = fileUri;
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
// Fallback: create blob URL if possible (works on web)
|
|
614
|
+
try {
|
|
615
|
+
if (file instanceof File || file instanceof Blob) {
|
|
616
|
+
preview = URL.createObjectURL(file);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
catch (error) {
|
|
620
|
+
if (__DEV__) {
|
|
621
|
+
console.warn('Failed to create preview URL:', error);
|
|
622
|
+
}
|
|
623
|
+
// Preview is optional, continue without it
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
processedFiles.push({
|
|
628
|
+
file,
|
|
629
|
+
preview,
|
|
630
|
+
size: file.size,
|
|
631
|
+
name: file.name,
|
|
632
|
+
type: fileType
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
if (processedFiles.length === 0) {
|
|
636
|
+
sonner_1.toast.error(t('fileManagement.toasts.noValidFiles'));
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
// Show preview modal for user to review files before upload
|
|
640
|
+
setPendingFiles(processedFiles);
|
|
641
|
+
setShowUploadPreview(true);
|
|
642
|
+
}, []);
|
|
643
|
+
const handleConfirmUpload = async () => {
|
|
644
|
+
if (pendingFiles.length === 0)
|
|
645
|
+
return;
|
|
646
|
+
setShowUploadPreview(false);
|
|
647
|
+
uploadStartRef.current = Date.now();
|
|
648
|
+
storeSetUploading(true);
|
|
649
|
+
storeSetUploadProgress(null);
|
|
650
|
+
try {
|
|
651
|
+
const filesToUpload = pendingFiles.map(pf => pf.file);
|
|
652
|
+
storeSetUploadProgress({ current: 0, total: filesToUpload.length });
|
|
653
|
+
const uploadedFiles = await processFileUploads(filesToUpload);
|
|
654
|
+
// Cleanup preview URLs
|
|
655
|
+
pendingFiles.forEach(pf => {
|
|
656
|
+
if (pf.preview) {
|
|
657
|
+
URL.revokeObjectURL(pf.preview);
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
setPendingFiles([]);
|
|
661
|
+
// If in selectMode, automatically select the uploaded file(s)
|
|
662
|
+
if (selectMode && uploadedFiles.length > 0) {
|
|
663
|
+
// Wait a bit for the file store to update and ensure file is available
|
|
664
|
+
setTimeout(() => {
|
|
665
|
+
const fileToSelect = uploadedFiles[0];
|
|
666
|
+
if (!multiSelect && fileToSelect) {
|
|
667
|
+
// Single select mode - directly call onSelect callback
|
|
668
|
+
onSelect?.(fileToSelect);
|
|
669
|
+
if (afterSelect === 'back') {
|
|
670
|
+
goBack?.();
|
|
671
|
+
}
|
|
672
|
+
else if (afterSelect === 'close') {
|
|
673
|
+
onClose?.();
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
else if (multiSelect) {
|
|
677
|
+
// Multi-select mode - add all uploaded files to selection
|
|
678
|
+
uploadedFiles.forEach(file => {
|
|
679
|
+
if (!selectedIds.has(file.id)) {
|
|
680
|
+
setSelectedIds(prev => new Set(prev).add(file.id));
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
}, 500);
|
|
685
|
+
}
|
|
686
|
+
endUpload();
|
|
687
|
+
}
|
|
688
|
+
catch (error) {
|
|
689
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.uploadError'));
|
|
690
|
+
endUpload();
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
const handleCancelUpload = () => {
|
|
694
|
+
// Cleanup preview URLs
|
|
695
|
+
pendingFiles.forEach(pf => {
|
|
696
|
+
if (pf.preview) {
|
|
697
|
+
URL.revokeObjectURL(pf.preview);
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
setPendingFiles([]);
|
|
701
|
+
setShowUploadPreview(false);
|
|
702
|
+
};
|
|
703
|
+
const removePendingFile = (index) => {
|
|
704
|
+
const file = pendingFiles[index];
|
|
705
|
+
if (file.preview) {
|
|
706
|
+
URL.revokeObjectURL(file.preview);
|
|
707
|
+
}
|
|
708
|
+
const updated = pendingFiles.filter((_, i) => i !== index);
|
|
709
|
+
setPendingFiles(updated);
|
|
710
|
+
if (updated.length === 0) {
|
|
711
|
+
setShowUploadPreview(false);
|
|
712
|
+
}
|
|
713
|
+
};
|
|
714
|
+
/**
|
|
715
|
+
* Handle file upload - opens document picker and processes selected files
|
|
716
|
+
* Expo 54 compatible - works on web, iOS, and Android
|
|
717
|
+
*/
|
|
718
|
+
const handleFileUpload = async () => {
|
|
719
|
+
// Prevent concurrent document picker calls
|
|
720
|
+
if (isPickingDocument) {
|
|
721
|
+
sonner_1.toast.error(t('fileManagement.toasts.waitForSelection'));
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
try {
|
|
725
|
+
setIsPickingDocument(true);
|
|
726
|
+
// Lazy load expo-document-picker
|
|
727
|
+
const picker = await loadDocumentPicker();
|
|
728
|
+
// Use expo-document-picker (works on all platforms including web)
|
|
729
|
+
// On web, it uses the native file input and provides File objects directly
|
|
730
|
+
const result = await picker.getDocumentAsync({
|
|
731
|
+
type: '*/*',
|
|
732
|
+
multiple: true,
|
|
733
|
+
copyToCacheDirectory: true,
|
|
734
|
+
});
|
|
735
|
+
if (result.canceled) {
|
|
736
|
+
setIsPickingDocument(false);
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
if (!result.assets || result.assets.length === 0) {
|
|
740
|
+
setIsPickingDocument(false);
|
|
741
|
+
sonner_1.toast.error(t('fileManagement.toasts.noFilesSelected'));
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
// Convert expo document picker results to File-like objects
|
|
745
|
+
// According to Expo 54 docs, expo-document-picker returns assets with:
|
|
746
|
+
// - uri: file URI (file://, content://, or blob URL)
|
|
747
|
+
// - name: file name
|
|
748
|
+
// - size: file size in bytes
|
|
749
|
+
// - mimeType: MIME type of the file
|
|
750
|
+
// - file: (optional) native File object (usually only on web)
|
|
751
|
+
const files = [];
|
|
752
|
+
const errors = [];
|
|
753
|
+
// Process files in parallel for better performance
|
|
754
|
+
// This allows multiple files to be converted simultaneously
|
|
755
|
+
const conversionPromises = result.assets.map((doc, index) => (0, fileManagement_1.convertDocumentPickerAssetToFile)(doc, index)
|
|
756
|
+
.then((file) => {
|
|
757
|
+
if (file) {
|
|
758
|
+
// Validate file has required properties before adding
|
|
759
|
+
if (!file.name || file.size === undefined) {
|
|
760
|
+
errors.push(`File "${doc.name || 'file'}" is invalid: missing required properties`);
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
763
|
+
return file;
|
|
764
|
+
}
|
|
765
|
+
return null;
|
|
766
|
+
})
|
|
767
|
+
.catch((error) => {
|
|
768
|
+
errors.push(`File "${doc.name || 'file'}": ${getErrorMessage(error) || 'Failed to process'}`);
|
|
769
|
+
return null;
|
|
770
|
+
}));
|
|
771
|
+
const convertedFiles = await Promise.all(conversionPromises);
|
|
772
|
+
// Filter out null values
|
|
773
|
+
for (const file of convertedFiles) {
|
|
774
|
+
if (file) {
|
|
775
|
+
files.push(file);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
// Show errors if any
|
|
779
|
+
if (errors.length > 0) {
|
|
780
|
+
const errorMessage = errors.slice(0, 3).join('\n') + (errors.length > 3 ? `\n...and ${errors.length - 3} more` : '');
|
|
781
|
+
sonner_1.toast.error(t('fileManagement.toasts.loadSomeFailed', { errors: errorMessage }));
|
|
782
|
+
}
|
|
783
|
+
// Process successfully converted files
|
|
784
|
+
if (files.length > 0) {
|
|
785
|
+
await handleFileSelection(files);
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
// Files were selected but none could be converted
|
|
789
|
+
sonner_1.toast.error(t('fileManagement.toasts.noFilesProcessed'));
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
catch (error) {
|
|
793
|
+
if (__DEV__) {
|
|
794
|
+
console.error('File upload error:', error);
|
|
795
|
+
}
|
|
796
|
+
if (getErrorMessage(error)?.includes('expo-document-picker') || getErrorMessage(error)?.includes('Different document picking in progress')) {
|
|
797
|
+
if (getErrorMessage(error)?.includes('Different document picking in progress')) {
|
|
798
|
+
sonner_1.toast.error(t('fileManagement.toasts.waitForSelection'));
|
|
799
|
+
}
|
|
800
|
+
else {
|
|
801
|
+
sonner_1.toast.error(t('fileManagement.toasts.filePickerNotAvailable'));
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.selectFilesFailed'));
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
finally {
|
|
809
|
+
// Always reset the picking state, even if there was an error
|
|
810
|
+
setIsPickingDocument(false);
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
const handleFileDelete = async (fileId, filename) => {
|
|
814
|
+
// Use platform-aware confirmation dialog
|
|
815
|
+
const confirmed = await (0, fileManagement_1.confirmAction)(t('fileManagement.confirms.deleteFile', { filename }), t('fileManagement.deleteFile'), t('fileManagement.confirm'), t('common.cancel'));
|
|
816
|
+
if (!confirmed) {
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
try {
|
|
820
|
+
storeSetDeleting(fileId);
|
|
821
|
+
await oxyServices.deleteFile(fileId);
|
|
822
|
+
sonner_1.toast.success(t('fileManagement.toasts.deleteSuccess'));
|
|
823
|
+
// Reload files after successful deletion
|
|
824
|
+
// Optimistic remove
|
|
825
|
+
fileStore_1.useFileStore.getState().removeFile(fileId);
|
|
826
|
+
// Silent background reconcile
|
|
827
|
+
setTimeout(() => loadFiles('silent'), 800);
|
|
828
|
+
}
|
|
829
|
+
catch (error) {
|
|
830
|
+
// Provide specific error messages
|
|
831
|
+
if (getErrorMessage(error)?.includes('File not found') || getErrorMessage(error)?.includes('404')) {
|
|
832
|
+
sonner_1.toast.error(t('fileManagement.toasts.fileNotFound'));
|
|
833
|
+
// Still reload files to refresh the list
|
|
834
|
+
setTimeout(() => loadFiles('silent'), 800);
|
|
835
|
+
}
|
|
836
|
+
else if (getErrorMessage(error)?.includes('permission') || getErrorMessage(error)?.includes('403')) {
|
|
837
|
+
sonner_1.toast.error(t('fileManagement.toasts.noPermission'));
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.deleteFailed'));
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
finally {
|
|
844
|
+
storeSetDeleting(null);
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
const handleBulkDelete = (0, react_1.useCallback)(async () => {
|
|
848
|
+
if (selectedIds.size === 0)
|
|
849
|
+
return;
|
|
850
|
+
const fileMap = {};
|
|
851
|
+
files.forEach(f => { fileMap[f.id] = f; });
|
|
852
|
+
const selectedFiles = Array.from(selectedIds).map(id => fileMap[id]).filter(Boolean);
|
|
853
|
+
const confirmed = await (0, fileManagement_1.confirmAction)(t('fileManagement.confirms.deleteFiles', { count: selectedFiles.length }), t('fileManagement.deleteFiles'), t('fileManagement.confirm'), t('common.cancel'));
|
|
854
|
+
if (!confirmed)
|
|
855
|
+
return;
|
|
856
|
+
try {
|
|
857
|
+
const deletePromises = Array.from(selectedIds).map(async (fileId) => {
|
|
858
|
+
try {
|
|
859
|
+
await oxyServices.deleteFile(fileId);
|
|
860
|
+
fileStore_1.useFileStore.getState().removeFile(fileId);
|
|
861
|
+
return { success: true, fileId };
|
|
862
|
+
}
|
|
863
|
+
catch (error) {
|
|
864
|
+
return { success: false, fileId, error };
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
const results = await Promise.allSettled(deletePromises);
|
|
868
|
+
const successful = results.filter(r => r.status === 'fulfilled' && r.value.success).length;
|
|
869
|
+
const failed = results.length - successful;
|
|
870
|
+
if (successful > 0) {
|
|
871
|
+
sonner_1.toast.success(t('fileManagement.toasts.bulkDeleteSuccess', { count: successful }));
|
|
872
|
+
}
|
|
873
|
+
if (failed > 0) {
|
|
874
|
+
sonner_1.toast.error(t('fileManagement.toasts.bulkDeleteFailed', { count: failed }));
|
|
875
|
+
}
|
|
876
|
+
setSelectedIds(new Set());
|
|
877
|
+
setTimeout(() => loadFiles('silent'), 800);
|
|
878
|
+
}
|
|
879
|
+
catch (error) {
|
|
880
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.bulkDeleteError'));
|
|
881
|
+
}
|
|
882
|
+
}, [selectedIds, files, oxyServices, loadFiles]);
|
|
883
|
+
const handleBulkVisibilityChange = (0, react_1.useCallback)(async (visibility) => {
|
|
884
|
+
if (selectedIds.size === 0)
|
|
885
|
+
return;
|
|
886
|
+
try {
|
|
887
|
+
const updatePromises = Array.from(selectedIds).map(async (fileId) => {
|
|
888
|
+
try {
|
|
889
|
+
await oxyServices.assetUpdateVisibility(fileId, visibility);
|
|
890
|
+
return { success: true, fileId };
|
|
891
|
+
}
|
|
892
|
+
catch (error) {
|
|
893
|
+
return { success: false, fileId, error };
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
const results = await Promise.allSettled(updatePromises);
|
|
897
|
+
const successful = results.filter(r => r.status === 'fulfilled' && r.value.success).length;
|
|
898
|
+
const failed = results.length - successful;
|
|
899
|
+
if (successful > 0) {
|
|
900
|
+
sonner_1.toast.success(t('fileManagement.toasts.visibilitySuccess', { count: successful, visibility }));
|
|
901
|
+
// Update file metadata in store
|
|
902
|
+
Array.from(selectedIds).forEach(fileId => {
|
|
903
|
+
fileStore_1.useFileStore.getState().updateFile(fileId, {
|
|
904
|
+
metadata: { ...files.find(f => f.id === fileId)?.metadata, visibility }
|
|
905
|
+
});
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
if (failed > 0) {
|
|
909
|
+
sonner_1.toast.error(t('fileManagement.toasts.visibilityFailed', { count: failed }));
|
|
910
|
+
}
|
|
911
|
+
setTimeout(() => loadFiles('silent'), 800);
|
|
912
|
+
}
|
|
913
|
+
catch (error) {
|
|
914
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.visibilityError'));
|
|
915
|
+
}
|
|
916
|
+
}, [selectedIds, oxyServices, files, loadFiles]);
|
|
917
|
+
// Unified download function - works on all platforms
|
|
918
|
+
const handleFileDownload = async (fileId, filename) => {
|
|
919
|
+
try {
|
|
920
|
+
// Try to use the download URL with a simple approach
|
|
921
|
+
// On web, this creates a download link. On mobile, it opens the URL.
|
|
922
|
+
const downloadUrl = oxyServices.getFileDownloadUrl(fileId);
|
|
923
|
+
// For web platforms, use link download
|
|
924
|
+
if (typeof window !== 'undefined' && window.document) {
|
|
925
|
+
try {
|
|
926
|
+
// Try simple link download first
|
|
927
|
+
const link = document.createElement('a');
|
|
928
|
+
link.href = downloadUrl;
|
|
929
|
+
link.download = filename;
|
|
930
|
+
link.target = '_blank';
|
|
931
|
+
document.body.appendChild(link);
|
|
932
|
+
link.click();
|
|
933
|
+
document.body.removeChild(link);
|
|
934
|
+
sonner_1.toast.success(t('fileManagement.toasts.downloadStarted'));
|
|
935
|
+
}
|
|
936
|
+
catch (linkError) {
|
|
937
|
+
// Fallback to authenticated download
|
|
938
|
+
const blob = await oxyServices.getFileContentAsBlob(fileId);
|
|
939
|
+
const url = URL.createObjectURL(blob);
|
|
940
|
+
const link = document.createElement('a');
|
|
941
|
+
link.href = url;
|
|
942
|
+
link.download = filename;
|
|
943
|
+
document.body.appendChild(link);
|
|
944
|
+
link.click();
|
|
945
|
+
document.body.removeChild(link);
|
|
946
|
+
// Clean up the blob URL
|
|
947
|
+
URL.revokeObjectURL(url);
|
|
948
|
+
sonner_1.toast.success(t('fileManagement.toasts.downloadSuccess'));
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
else {
|
|
952
|
+
// For mobile, open the URL (user can save from browser)
|
|
953
|
+
// Note: This is a simplified approach - for full mobile support,
|
|
954
|
+
// consider using expo-file-system or react-native-fs
|
|
955
|
+
sonner_1.toast.info(t('fileManagement.toasts.downloadMobile'));
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
catch (error) {
|
|
959
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.downloadFailed'));
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
const handleFileOpen = async (file) => {
|
|
963
|
+
if (selectMode) {
|
|
964
|
+
toggleSelect(file);
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
try {
|
|
968
|
+
setLoadingFileContent(true);
|
|
969
|
+
setOpenedFile(file);
|
|
970
|
+
// For text files, images, and other viewable content, try to load the content
|
|
971
|
+
if (file.contentType.startsWith('text/') ||
|
|
972
|
+
file.contentType.includes('json') ||
|
|
973
|
+
file.contentType.includes('xml') ||
|
|
974
|
+
file.contentType.includes('javascript') ||
|
|
975
|
+
file.contentType.includes('typescript') ||
|
|
976
|
+
file.contentType.startsWith('image/') ||
|
|
977
|
+
file.contentType.includes('pdf') ||
|
|
978
|
+
file.contentType.startsWith('video/') ||
|
|
979
|
+
file.contentType.startsWith('audio/')) {
|
|
980
|
+
try {
|
|
981
|
+
if (file.contentType.startsWith('image/') ||
|
|
982
|
+
file.contentType.includes('pdf') ||
|
|
983
|
+
file.contentType.startsWith('video/') ||
|
|
984
|
+
file.contentType.startsWith('audio/')) {
|
|
985
|
+
// For images, PDFs, videos, and audio, we'll use the URL directly
|
|
986
|
+
const downloadUrl = oxyServices.getFileDownloadUrl(file.id);
|
|
987
|
+
setFileContent(downloadUrl);
|
|
988
|
+
}
|
|
989
|
+
else {
|
|
990
|
+
// For text files, get the content using authenticated request
|
|
991
|
+
const content = await oxyServices.getFileContentAsText(file.id);
|
|
992
|
+
setFileContent(content);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
catch (error) {
|
|
996
|
+
if (getErrorMessage(error)?.includes('404') || getErrorMessage(error)?.includes('not found')) {
|
|
997
|
+
sonner_1.toast.error(t('fileManagement.toasts.fileNotFoundContent'));
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
sonner_1.toast.error(t('fileManagement.toasts.loadContentFailed'));
|
|
1001
|
+
}
|
|
1002
|
+
setFileContent(null);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
else {
|
|
1006
|
+
// For non-viewable files, don't load content
|
|
1007
|
+
setFileContent(null);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
catch (error) {
|
|
1011
|
+
sonner_1.toast.error(getErrorMessage(error) || t('fileManagement.toasts.openFailed'));
|
|
1012
|
+
}
|
|
1013
|
+
finally {
|
|
1014
|
+
setLoadingFileContent(false);
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
const handleCloseFile = () => {
|
|
1018
|
+
setOpenedFile(null);
|
|
1019
|
+
setFileContent(null);
|
|
1020
|
+
setShowFileDetailsInViewer(false);
|
|
1021
|
+
// Don't reset view mode when closing a file
|
|
1022
|
+
};
|
|
1023
|
+
const showFileDetailsModal = (file) => {
|
|
1024
|
+
setSelectedFile(file);
|
|
1025
|
+
setShowFileDetails(true);
|
|
1026
|
+
};
|
|
1027
|
+
const renderSimplePhotoItem = (0, react_1.useCallback)((photo, index) => {
|
|
1028
|
+
const downloadUrl = getSafeDownloadUrlCallback(photo, 'thumb');
|
|
1029
|
+
// Calculate photo item width based on actual container size from bottom sheet
|
|
1030
|
+
let itemsPerRow = 3; // Default for mobile
|
|
1031
|
+
if (safeContainerWidth > 768)
|
|
1032
|
+
itemsPerRow = 4; // Desktop/tablet
|
|
1033
|
+
else if (safeContainerWidth > 480)
|
|
1034
|
+
itemsPerRow = 3; // Large mobile
|
|
1035
|
+
// Account for the photoScrollContainer padding (16px on each side = 32px total)
|
|
1036
|
+
const scrollContainerPadding = 32; // Total horizontal padding from photoScrollContainer
|
|
1037
|
+
const gaps = (itemsPerRow - 1) * 4; // Gap between items (4px)
|
|
1038
|
+
const availableWidth = safeContainerWidth - scrollContainerPadding;
|
|
1039
|
+
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
1040
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [
|
|
1041
|
+
styles_1.fileManagementStyles.simplePhotoItem,
|
|
1042
|
+
{
|
|
1043
|
+
width: itemWidth,
|
|
1044
|
+
height: itemWidth,
|
|
1045
|
+
marginRight: (index + 1) % itemsPerRow === 0 ? 0 : 4,
|
|
1046
|
+
...(selectMode && selectedIds.has(photo.id) ? { borderWidth: 2, borderColor: themeStyles.primaryColor } : {})
|
|
1047
|
+
}
|
|
1048
|
+
], onPress: () => handleFileOpen(photo), activeOpacity: 0.8, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.simplePhotoContainer, children: [(0, jsx_runtime_1.jsx)(expo_image_1.Image, { source: { uri: downloadUrl }, style: styles_1.fileManagementStyles.simplePhotoImage, contentFit: "cover", transition: 120, cachePolicy: "memory-disk", onError: () => {
|
|
1049
|
+
// Photo failed to load, will show placeholder
|
|
1050
|
+
}, accessibilityLabel: photo.filename }), selectMode && ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles_1.fileManagementStyles.selectionBadge, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: selectedIds.has(photo.id) ? 'checkmark-circle' : 'ellipse-outline', size: 20, color: selectedIds.has(photo.id) ? themeStyles.primaryColor : themeStyles.textColor }) }))] }) }, photo.id));
|
|
1051
|
+
}, [oxyServices, safeContainerWidth, selectMode, selectedIds, themeStyles.primaryColor, themeStyles.textColor]);
|
|
1052
|
+
const renderJustifiedPhotoItem = (0, react_1.useCallback)((photo, width, height, isLast) => {
|
|
1053
|
+
const downloadUrl = getSafeDownloadUrlCallback(photo, 'thumb');
|
|
1054
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [
|
|
1055
|
+
styles_1.fileManagementStyles.justifiedPhotoItem,
|
|
1056
|
+
{
|
|
1057
|
+
width,
|
|
1058
|
+
height,
|
|
1059
|
+
...(selectMode && selectedIds.has(photo.id) ? { borderWidth: 2, borderColor: themeStyles.primaryColor } : {}),
|
|
1060
|
+
...(selectMode && multiSelect && selectedIds.size > 0 && !selectedIds.has(photo.id) ? { opacity: 0.4 } : {}),
|
|
1061
|
+
},
|
|
1062
|
+
], onPress: () => handleFileOpen(photo), activeOpacity: 0.8, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.justifiedPhotoContainer, children: [(0, jsx_runtime_1.jsx)(expo_image_1.Image, { source: { uri: downloadUrl }, style: styles_1.fileManagementStyles.justifiedPhotoImage, contentFit: "cover", transition: 120, cachePolicy: "memory-disk", onError: () => {
|
|
1063
|
+
// Photo failed to load, will show placeholder
|
|
1064
|
+
}, accessibilityLabel: photo.filename }), selectMode && ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles_1.fileManagementStyles.selectionBadge, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: selectedIds.has(photo.id) ? 'checkmark-circle' : 'ellipse-outline', size: 20, color: selectedIds.has(photo.id) ? themeStyles.primaryColor : themeStyles.textColor }) }))] }) }, photo.id));
|
|
1065
|
+
}, [oxyServices, selectMode, selectedIds, multiSelect, themeStyles.primaryColor, themeStyles.textColor]);
|
|
1066
|
+
// Run initial load once per targetUserId change to avoid accidental loops
|
|
1067
|
+
const lastLoadedFor = (0, react_1.useRef)(undefined);
|
|
1068
|
+
(0, react_1.useEffect)(() => {
|
|
1069
|
+
const key = targetUserId || 'anonymous';
|
|
1070
|
+
if (lastLoadedFor.current !== key) {
|
|
1071
|
+
lastLoadedFor.current = key;
|
|
1072
|
+
loadFiles('initial');
|
|
1073
|
+
}
|
|
1074
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1075
|
+
}, [targetUserId]);
|
|
1076
|
+
const renderFileItem = (file) => {
|
|
1077
|
+
const isImage = file.contentType.startsWith('image/');
|
|
1078
|
+
const isPDF = file.contentType.includes('pdf');
|
|
1079
|
+
const isVideo = file.contentType.startsWith('video/');
|
|
1080
|
+
const isAudio = file.contentType.startsWith('audio/');
|
|
1081
|
+
const hasPreview = isImage || isPDF || isVideo;
|
|
1082
|
+
const borderColor = themeStyles.borderColor;
|
|
1083
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles_1.fileManagementStyles.fileItem, { backgroundColor: themeStyles.secondaryBackgroundColor, borderColor }, selectMode && selectedIds.has(file.id) && { borderColor: themeStyles.primaryColor, borderWidth: 2 }], children: [(0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: styles_1.fileManagementStyles.fileContent, onPress: () => handleFileOpen(file), children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles_1.fileManagementStyles.filePreviewContainer, children: hasPreview ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.filePreview, children: [isImage && ((0, jsx_runtime_1.jsx)(expo_image_1.Image, { source: { uri: getSafeDownloadUrlCallback(file, 'thumb') }, style: styles_1.fileManagementStyles.previewImage, contentFit: "cover", transition: 120, cachePolicy: "memory-disk", onError: () => {
|
|
1084
|
+
// Image preview failed to load
|
|
1085
|
+
}, accessibilityLabel: file.filename })), isPDF && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.pdfPreview, children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "document", size: 32, color: themeStyles.primaryColor }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.pdfLabel, { color: themeStyles.primaryColor }], children: "PDF" })] })), isVideo && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.videoPreviewWrapper, children: [(0, jsx_runtime_1.jsx)(expo_image_1.Image, { source: { uri: getSafeDownloadUrlCallback(file, 'thumb') }, style: styles_1.fileManagementStyles.videoPosterImage, contentFit: "cover", transition: 120, cachePolicy: "memory-disk", onError: (_) => {
|
|
1086
|
+
// If thumbnail not available, we still show icon overlay
|
|
1087
|
+
}, accessibilityLabel: `${file.filename} video thumbnail` }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles_1.fileManagementStyles.videoOverlay, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "play", size: 24, color: "#FFFFFF" }) })] })), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles_1.fileManagementStyles.fallbackIcon, { display: isImage ? 'none' : 'flex' }], children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: (0, fileManagement_1.getFileIcon)(file.contentType), size: 32, color: themeStyles.primaryColor }) }), selectMode && ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles_1.fileManagementStyles.selectionBadge, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: selectedIds.has(file.id) ? 'checkmark-circle' : 'ellipse-outline', size: 22, color: selectedIds.has(file.id) ? themeStyles.primaryColor : themeStyles.textColor }) }))] })) : ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles_1.fileManagementStyles.fileIconContainer, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: (0, fileManagement_1.getFileIcon)(file.contentType), size: 32, color: themeStyles.primaryColor }) })) }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.fileInfo, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.fileName, { color: themeStyles.textColor }], numberOfLines: 1, children: file.filename }), (0, jsx_runtime_1.jsxs)(react_native_1.Text, { style: [styles_1.fileManagementStyles.fileDetails, { color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666' }], children: [(0, fileManagement_1.formatFileSize)(file.length), " \u2022 ", new Date(file.uploadDate).toLocaleDateString()] }), file.metadata?.description && ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.fileDescription, { color: themeStyles.isDarkTheme ? '#AAAAAA' : '#888888' }], numberOfLines: 2, children: file.metadata.description }))] })] }), !selectMode && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.fileActions, children: [hasPreview && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.actionButton, { backgroundColor: themeStyles.isDarkTheme ? '#333333' : '#F0F0F0' }], onPress: () => handleFileOpen(file), children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "eye", size: 20, color: themeStyles.primaryColor }) })), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.actionButton, { backgroundColor: themeStyles.isDarkTheme ? '#333333' : '#F0F0F0' }], onPress: () => handleFileDownload(file.id, file.filename), children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "download", size: 20, color: themeStyles.primaryColor }) }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.actionButton, { backgroundColor: themeStyles.isDarkTheme ? '#400000' : '#FFEBEE' }], onPress: () => {
|
|
1088
|
+
handleFileDelete(file.id, file.filename);
|
|
1089
|
+
}, disabled: deleting === file.id, children: deleting === file.id ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: themeStyles.dangerColor })) : ((0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "trash", size: 20, color: themeStyles.dangerColor })) })] }))] }, file.id));
|
|
1090
|
+
};
|
|
1091
|
+
// GroupedSection-based file items (for 'all' view) replacing legacy flat list look
|
|
1092
|
+
// biome-ignore lint/suspicious/noExplicitAny: GroupedSection items have dynamic props
|
|
1093
|
+
const groupedFileItems = (0, react_1.useMemo)(() => {
|
|
1094
|
+
// filteredFiles is already sorted, so just use it directly
|
|
1095
|
+
const sortedFiles = filteredFiles;
|
|
1096
|
+
// Store file positions for scrolling
|
|
1097
|
+
sortedFiles.forEach((file, index) => {
|
|
1098
|
+
itemRefs.current.set(file.id, index);
|
|
1099
|
+
});
|
|
1100
|
+
return sortedFiles.map((file) => {
|
|
1101
|
+
const isImage = file.contentType.startsWith('image/');
|
|
1102
|
+
const isPDF = file.contentType.includes('pdf');
|
|
1103
|
+
const isVideo = file.contentType.startsWith('video/');
|
|
1104
|
+
const hasPreview = isImage || isPDF || isVideo;
|
|
1105
|
+
const isSelected = selectedIds.has(file.id);
|
|
1106
|
+
// Create customIcon for preview thumbnails (36x36 to match GroupedItem iconContainer)
|
|
1107
|
+
let customIcon;
|
|
1108
|
+
if (hasPreview) {
|
|
1109
|
+
if (isImage) {
|
|
1110
|
+
customIcon = ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { width: 36, height: 36, borderRadius: 18, overflow: 'hidden' }, children: (0, jsx_runtime_1.jsx)(expo_image_1.Image, { source: { uri: getSafeDownloadUrlCallback(file, 'thumb') }, style: { width: 36, height: 36 }, contentFit: "cover", transition: 120, cachePolicy: "memory-disk", onError: () => {
|
|
1111
|
+
// Image preview failed to load - will fallback to icon
|
|
1112
|
+
}, accessibilityLabel: file.filename }) }));
|
|
1113
|
+
}
|
|
1114
|
+
else if (isVideo) {
|
|
1115
|
+
customIcon = ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { width: 36, height: 36, borderRadius: 18, overflow: 'hidden', backgroundColor: '#000000', position: 'relative' }, children: [(0, jsx_runtime_1.jsx)(expo_image_1.Image, { source: { uri: getSafeDownloadUrlCallback(file, 'thumb') }, style: { width: 36, height: 36 }, contentFit: "cover", transition: 120, cachePolicy: "memory-disk", onError: (_) => {
|
|
1116
|
+
// If thumbnail not available, we still show icon overlay
|
|
1117
|
+
}, accessibilityLabel: `${file.filename} video thumbnail` }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, alignItems: 'center', justifyContent: 'center', backgroundColor: 'rgba(0,0,0,0.25)' }, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "play", size: 16, color: "#FFFFFF" }) })] }));
|
|
1118
|
+
}
|
|
1119
|
+
else if (isPDF) {
|
|
1120
|
+
customIcon = ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { width: 36, height: 36, borderRadius: 18, alignItems: 'center', justifyContent: 'center', backgroundColor: '#FF6B6B20' }, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "document", size: 20, color: themeStyles.primaryColor }) }));
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
return {
|
|
1124
|
+
id: file.id,
|
|
1125
|
+
customIcon: customIcon,
|
|
1126
|
+
icon: !hasPreview ? (0, fileManagement_1.getFileIcon)(file.contentType) : undefined,
|
|
1127
|
+
iconColor: themeStyles.primaryColor,
|
|
1128
|
+
title: file.filename,
|
|
1129
|
+
subtitle: `${(0, fileManagement_1.formatFileSize)(file.length)} • ${new Date(file.uploadDate).toLocaleDateString()}`,
|
|
1130
|
+
theme: theme,
|
|
1131
|
+
onPress: () => {
|
|
1132
|
+
// Support selection in regular mode with long press or if already selecting
|
|
1133
|
+
if (!selectMode && selectedIds.size > 0) {
|
|
1134
|
+
// If already in selection mode (some files selected), toggle selection
|
|
1135
|
+
toggleSelect(file);
|
|
1136
|
+
}
|
|
1137
|
+
else {
|
|
1138
|
+
handleFileOpen(file);
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
onLongPress: !selectMode ? () => {
|
|
1142
|
+
// Enable selection mode on long press
|
|
1143
|
+
if (selectedIds.size === 0) {
|
|
1144
|
+
setSelectedIds(new Set([file.id]));
|
|
1145
|
+
}
|
|
1146
|
+
else {
|
|
1147
|
+
toggleSelect(file);
|
|
1148
|
+
}
|
|
1149
|
+
} : undefined,
|
|
1150
|
+
showChevron: false,
|
|
1151
|
+
dense: true,
|
|
1152
|
+
multiRow: !!file.metadata?.description,
|
|
1153
|
+
selected: (selectMode || selectedIds.size > 0) && isSelected,
|
|
1154
|
+
// Hide action buttons when selecting (in selectMode or bulk operations mode)
|
|
1155
|
+
customContent: (!selectMode && selectedIds.size === 0) ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.groupedActions, children: [(isImage || isVideo || file.contentType.includes('pdf')) && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.groupedActionBtn, { backgroundColor: themeStyles.isDarkTheme ? '#333333' : '#F0F0F0' }], onPress: () => handleFileOpen(file), children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "eye", size: 18, color: themeStyles.primaryColor }) })), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.groupedActionBtn, { backgroundColor: themeStyles.isDarkTheme ? '#333333' : '#F0F0F0' }], onPress: () => handleFileDownload(file.id, file.filename), children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "download", size: 18, color: themeStyles.primaryColor }) }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.groupedActionBtn, { backgroundColor: themeStyles.isDarkTheme ? '#400000' : '#FFEBEE' }], onPress: () => handleFileDelete(file.id, file.filename), disabled: deleting === file.id, children: deleting === file.id ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: themeStyles.dangerColor })) : ((0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "trash", size: 18, color: themeStyles.dangerColor })) })] })) : undefined,
|
|
1156
|
+
customContentBelow: file.metadata?.description ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.groupedDescription, { color: themeStyles.isDarkTheme ? '#AAAAAA' : '#666666' }], numberOfLines: 2, children: file.metadata.description })) : undefined,
|
|
1157
|
+
};
|
|
1158
|
+
});
|
|
1159
|
+
}, [filteredFiles, theme, themeStyles, deleting, handleFileDownload, handleFileDelete, handleFileOpen, getSafeDownloadUrlCallback, selectMode, selectedIds]);
|
|
1160
|
+
// Scroll to selected file after selection
|
|
1161
|
+
(0, react_1.useEffect)(() => {
|
|
1162
|
+
if (lastSelectedFileId && selectMode) {
|
|
1163
|
+
if (viewMode === 'all' && scrollViewRef.current) {
|
|
1164
|
+
// Find the index of the selected file
|
|
1165
|
+
const itemIndex = itemRefs.current.get(lastSelectedFileId);
|
|
1166
|
+
if (itemIndex !== undefined && itemIndex >= 0) {
|
|
1167
|
+
// Estimate item height (GroupedItem with dense mode is approximately 60-70px)
|
|
1168
|
+
// Account for description rows which add extra height
|
|
1169
|
+
const baseItemHeight = 65;
|
|
1170
|
+
const descriptionHeight = 30; // Approximate height for description
|
|
1171
|
+
// Use filteredFiles which is already sorted according to user's selection
|
|
1172
|
+
const sortedFiles = filteredFiles;
|
|
1173
|
+
// Calculate total height up to this item
|
|
1174
|
+
let scrollPosition = 0;
|
|
1175
|
+
for (let i = 0; i <= itemIndex && i < sortedFiles.length; i++) {
|
|
1176
|
+
const file = sortedFiles[i];
|
|
1177
|
+
scrollPosition += baseItemHeight;
|
|
1178
|
+
if (file.metadata?.description) {
|
|
1179
|
+
scrollPosition += descriptionHeight;
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
// Add header, controls, search, and stats height (approximately 250px)
|
|
1183
|
+
const headerHeight = 250;
|
|
1184
|
+
const finalScrollPosition = headerHeight + scrollPosition - 150; // Offset to show item near top
|
|
1185
|
+
// Use requestAnimationFrame to ensure DOM is updated before scrolling
|
|
1186
|
+
requestAnimationFrame(() => {
|
|
1187
|
+
requestAnimationFrame(() => {
|
|
1188
|
+
scrollViewRef.current?.scrollTo({
|
|
1189
|
+
y: Math.max(0, finalScrollPosition),
|
|
1190
|
+
animated: true,
|
|
1191
|
+
});
|
|
1192
|
+
});
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
else if (viewMode === 'photos' && photoScrollViewRef.current) {
|
|
1197
|
+
// For photo grid, find the photo index
|
|
1198
|
+
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
1199
|
+
const photoIndex = photos.findIndex(p => p.id === lastSelectedFileId);
|
|
1200
|
+
if (photoIndex >= 0) {
|
|
1201
|
+
// Estimate photo item height based on grid layout
|
|
1202
|
+
// Calculate items per row
|
|
1203
|
+
let itemsPerRow = 3;
|
|
1204
|
+
if (safeContainerWidth > 768)
|
|
1205
|
+
itemsPerRow = 6;
|
|
1206
|
+
else if (safeContainerWidth > 480)
|
|
1207
|
+
itemsPerRow = 4;
|
|
1208
|
+
const scrollContainerPadding = 32;
|
|
1209
|
+
const gaps = (itemsPerRow - 1) * 4;
|
|
1210
|
+
const availableWidth = safeContainerWidth - scrollContainerPadding;
|
|
1211
|
+
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
1212
|
+
// Calculate row and approximate scroll position
|
|
1213
|
+
const row = Math.floor(photoIndex / itemsPerRow);
|
|
1214
|
+
const headerHeight = 250;
|
|
1215
|
+
const finalScrollPosition = headerHeight + (row * (itemWidth + 4)) - 150;
|
|
1216
|
+
// Use requestAnimationFrame to ensure DOM is updated before scrolling
|
|
1217
|
+
requestAnimationFrame(() => {
|
|
1218
|
+
requestAnimationFrame(() => {
|
|
1219
|
+
photoScrollViewRef.current?.scrollTo({
|
|
1220
|
+
y: Math.max(0, finalScrollPosition),
|
|
1221
|
+
animated: true,
|
|
1222
|
+
});
|
|
1223
|
+
});
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
}, [lastSelectedFileId, selectMode, viewMode, filteredFiles, safeContainerWidth]);
|
|
1229
|
+
// Clear selected file ID after scroll animation completes
|
|
1230
|
+
(0, react_1.useEffect)(() => {
|
|
1231
|
+
if (lastSelectedFileId && scrollViewRef.current) {
|
|
1232
|
+
const timeoutId = setTimeout(() => {
|
|
1233
|
+
setLastSelectedFileId(null);
|
|
1234
|
+
}, 600); // Allow time for scroll animation to complete
|
|
1235
|
+
return () => clearTimeout(timeoutId);
|
|
1236
|
+
}
|
|
1237
|
+
}, [lastSelectedFileId]);
|
|
1238
|
+
const renderPhotoItem = (photo, index) => {
|
|
1239
|
+
const downloadUrl = getSafeDownloadUrlCallback(photo, 'thumb');
|
|
1240
|
+
// Calculate photo item width based on actual container size from bottom sheet
|
|
1241
|
+
let itemsPerRow = 3; // Default for mobile
|
|
1242
|
+
if (safeContainerWidth > 768)
|
|
1243
|
+
itemsPerRow = 6; // Tablet/Desktop
|
|
1244
|
+
else if (safeContainerWidth > 480)
|
|
1245
|
+
itemsPerRow = 4; // Large mobile
|
|
1246
|
+
// Account for the photoScrollContainer padding (16px on each side = 32px total)
|
|
1247
|
+
const scrollContainerPadding = 32; // Total horizontal padding from photoScrollContainer
|
|
1248
|
+
const gaps = (itemsPerRow - 1) * 4; // Gap between items
|
|
1249
|
+
const availableWidth = safeContainerWidth - scrollContainerPadding;
|
|
1250
|
+
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
1251
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [
|
|
1252
|
+
styles_1.fileManagementStyles.photoItem,
|
|
1253
|
+
{
|
|
1254
|
+
width: itemWidth,
|
|
1255
|
+
height: itemWidth,
|
|
1256
|
+
}
|
|
1257
|
+
], onPress: () => handleFileOpen(photo), activeOpacity: 0.8, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles_1.fileManagementStyles.photoContainer, children: (0, jsx_runtime_1.jsx)(expo_image_1.Image, { source: { uri: downloadUrl }, style: styles_1.fileManagementStyles.photoImage, contentFit: "cover", transition: 120, cachePolicy: "memory-disk", onError: () => {
|
|
1258
|
+
// Image preview failed to load
|
|
1259
|
+
}, accessibilityLabel: photo.filename }) }) }, photo.id));
|
|
1260
|
+
};
|
|
1261
|
+
const renderPhotoGrid = (0, react_1.useCallback)(() => {
|
|
1262
|
+
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
1263
|
+
if (photos.length === 0) {
|
|
1264
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.emptyState, children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "images-outline", size: 64, color: themeStyles.isDarkTheme ? '#666666' : '#CCCCCC' }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.emptyStateTitle, { color: themeStyles.textColor }], children: t('fileManagement.emptyPhotos.title') }), (0, jsx_runtime_1.jsxs)(react_native_1.Text, { style: [styles_1.fileManagementStyles.emptyStateDescription, { color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666' }], children: [" ", user?.id === targetUserId
|
|
1265
|
+
? t('fileManagement.emptyPhotos.ownDescription')
|
|
1266
|
+
: t('fileManagement.emptyPhotos.otherDescription'), " "] }), user?.id === targetUserId && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.emptyStateButton, { backgroundColor: themeStyles.primaryColor }], onPress: handleFileUpload, disabled: uploading || isPickingDocument, children: uploading ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: "#FFFFFF" })) : isPickingDocument ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: "#FFFFFF" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "cloud-upload", size: 20, color: "#FFFFFF" }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles_1.fileManagementStyles.emptyStateButtonText, children: t('fileManagement.uploadPhotos') })] })) }))] }));
|
|
1267
|
+
}
|
|
1268
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.ScrollView, { ref: photoScrollViewRef, style: styles_1.fileManagementStyles.scrollView, contentContainerStyle: styles_1.fileManagementStyles.photoScrollContainer, refreshControl: (0, jsx_runtime_1.jsx)(react_native_1.RefreshControl, { refreshing: refreshing, onRefresh: () => loadFiles('refresh'), tintColor: themeStyles.primaryColor }), showsVerticalScrollIndicator: false, onScroll: ({ nativeEvent }) => {
|
|
1269
|
+
const { layoutMeasurement, contentOffset, contentSize } = nativeEvent;
|
|
1270
|
+
const distanceFromBottom = contentSize.height - (contentOffset.y + layoutMeasurement.height);
|
|
1271
|
+
if (distanceFromBottom < 200 && !paging.loadingMore && paging.hasMore) {
|
|
1272
|
+
loadFiles('more');
|
|
1273
|
+
}
|
|
1274
|
+
}, scrollEventThrottle: 250, children: [loadingDimensions && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.dimensionsLoadingIndicator, children: [(0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: themeStyles.primaryColor }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.dimensionsLoadingText, { color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666' }], children: t('fileManagement.loadingPhotoLayout') })] })), (0, jsx_runtime_1.jsx)(JustifiedPhotoGrid_1.default, { photos: photos, photoDimensions: photoDimensions, loadPhotoDimensions: loadPhotoDimensions, createJustifiedRows: createJustifiedRows, renderJustifiedPhotoItem: renderJustifiedPhotoItem, renderSimplePhotoItem: renderPhotoItem, textColor: themeStyles.textColor, containerWidth: safeContainerWidth })] }));
|
|
1275
|
+
}, [
|
|
1276
|
+
filteredFiles,
|
|
1277
|
+
themeStyles,
|
|
1278
|
+
user?.id,
|
|
1279
|
+
targetUserId,
|
|
1280
|
+
uploading,
|
|
1281
|
+
handleFileUpload,
|
|
1282
|
+
refreshing,
|
|
1283
|
+
loadFiles,
|
|
1284
|
+
loadingDimensions,
|
|
1285
|
+
photoDimensions,
|
|
1286
|
+
loadPhotoDimensions,
|
|
1287
|
+
createJustifiedRows,
|
|
1288
|
+
renderJustifiedPhotoItem,
|
|
1289
|
+
renderPhotoItem,
|
|
1290
|
+
safeContainerWidth
|
|
1291
|
+
]);
|
|
1292
|
+
// Inline justified grid removed (moved to components/photogrid/JustifiedPhotoGrid.tsx)
|
|
1293
|
+
const renderEmptyState = () => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.emptyState, children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "folder-open-outline", size: 64, color: themeStyles.isDarkTheme ? '#666666' : '#CCCCCC' }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.emptyStateTitle, { color: themeStyles.textColor }], children: t('fileManagement.emptyFiles.title') }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.emptyStateDescription, { color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666' }], children: user?.id === targetUserId
|
|
1294
|
+
? t('fileManagement.emptyFiles.ownDescription')
|
|
1295
|
+
: t('fileManagement.emptyFiles.otherDescription') }), user?.id === targetUserId && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.emptyStateButton, { backgroundColor: themeStyles.primaryColor }], onPress: handleFileUpload, disabled: uploading || isPickingDocument, children: uploading ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: "#FFFFFF" })) : isPickingDocument ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: "#FFFFFF" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "cloud-upload", size: 20, color: "#FFFFFF" }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles_1.fileManagementStyles.emptyStateButtonText, children: t('fileManagement.uploadFiles') })] })) }))] }));
|
|
1296
|
+
// Professional Skeleton Loading Component with Advanced Shimmer Effect
|
|
1297
|
+
const SkeletonLoader = react_1.default.memo(() => {
|
|
1298
|
+
const shimmerAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
1299
|
+
const skeletonContainerWidth = safeContainerWidth;
|
|
1300
|
+
(0, react_1.useEffect)(() => {
|
|
1301
|
+
const shimmer = react_native_1.Animated.loop(react_native_1.Animated.timing(shimmerAnim, {
|
|
1302
|
+
toValue: 1,
|
|
1303
|
+
duration: 2000,
|
|
1304
|
+
easing: react_native_1.Easing.linear,
|
|
1305
|
+
useNativeDriver: true,
|
|
1306
|
+
}));
|
|
1307
|
+
shimmer.start();
|
|
1308
|
+
return () => shimmer.stop();
|
|
1309
|
+
}, [shimmerAnim]);
|
|
1310
|
+
// Create a sweeping shimmer effect
|
|
1311
|
+
const shimmerTranslateX = shimmerAnim.interpolate({
|
|
1312
|
+
inputRange: [0, 1],
|
|
1313
|
+
outputRange: [-skeletonContainerWidth * 2, skeletonContainerWidth * 2],
|
|
1314
|
+
});
|
|
1315
|
+
const SkeletonBox = ({ width, height, borderRadius = 8, style, delay = 0 }) => {
|
|
1316
|
+
const delayedTranslateX = shimmerAnim.interpolate({
|
|
1317
|
+
inputRange: [0, 1],
|
|
1318
|
+
outputRange: [-skeletonContainerWidth * 2 + delay, skeletonContainerWidth * 2 + delay],
|
|
1319
|
+
});
|
|
1320
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
1321
|
+
{
|
|
1322
|
+
width,
|
|
1323
|
+
height,
|
|
1324
|
+
borderRadius,
|
|
1325
|
+
backgroundColor: themeStyles.isDarkTheme ? '#1E1E1E' : '#F5F5F5',
|
|
1326
|
+
overflow: 'hidden',
|
|
1327
|
+
position: 'relative',
|
|
1328
|
+
},
|
|
1329
|
+
style,
|
|
1330
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
1331
|
+
position: 'absolute',
|
|
1332
|
+
top: 0,
|
|
1333
|
+
left: 0,
|
|
1334
|
+
right: 0,
|
|
1335
|
+
bottom: 0,
|
|
1336
|
+
backgroundColor: themeStyles.isDarkTheme ? '#1E1E1E' : '#F5F5F5',
|
|
1337
|
+
} }), (0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: {
|
|
1338
|
+
position: 'absolute',
|
|
1339
|
+
top: 0,
|
|
1340
|
+
left: 0,
|
|
1341
|
+
width: '100%',
|
|
1342
|
+
height: '100%',
|
|
1343
|
+
transform: [{ translateX: delayedTranslateX }],
|
|
1344
|
+
}, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
1345
|
+
width: skeletonContainerWidth,
|
|
1346
|
+
height: '100%',
|
|
1347
|
+
backgroundColor: themeStyles.isDarkTheme
|
|
1348
|
+
? 'rgba(255, 255, 255, 0.08)'
|
|
1349
|
+
: 'rgba(255, 255, 255, 0.8)',
|
|
1350
|
+
shadowColor: themeStyles.isDarkTheme ? '#000' : '#FFF',
|
|
1351
|
+
shadowOffset: { width: 0, height: 0 },
|
|
1352
|
+
shadowOpacity: 0.3,
|
|
1353
|
+
shadowRadius: 10,
|
|
1354
|
+
} }) })] }));
|
|
1355
|
+
};
|
|
1356
|
+
// Skeleton file item matching GroupedSection structure
|
|
1357
|
+
const SkeletonFileItem = ({ index }) => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
1358
|
+
{
|
|
1359
|
+
flexDirection: 'row',
|
|
1360
|
+
alignItems: 'center',
|
|
1361
|
+
paddingHorizontal: 16,
|
|
1362
|
+
paddingVertical: 12,
|
|
1363
|
+
backgroundColor: themeStyles.isDarkTheme ? '#121212' : '#FFFFFF',
|
|
1364
|
+
borderBottomWidth: react_native_1.StyleSheet.hairlineWidth,
|
|
1365
|
+
borderBottomColor: themeStyles.borderColor,
|
|
1366
|
+
},
|
|
1367
|
+
], children: [(0, jsx_runtime_1.jsx)(SkeletonBox, { width: 44, height: 44, borderRadius: 8, delay: index * 50 }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { flex: 1, marginLeft: 12, justifyContent: 'center' }, children: [(0, jsx_runtime_1.jsx)(SkeletonBox, { width: index % 3 === 0 ? '85%' : index % 3 === 1 ? '70%' : '90%', height: 16, style: { marginBottom: 8 }, delay: index * 50 + 20 }), (0, jsx_runtime_1.jsx)(SkeletonBox, { width: index % 2 === 0 ? '50%' : '60%', height: 12, delay: index * 50 + 40 })] })] }));
|
|
1368
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles_1.fileManagementStyles.container, { backgroundColor }], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles_1.fileManagementStyles.header, { borderBottomColor: themeStyles.borderColor, borderBottomWidth: react_native_1.StyleSheet.hairlineWidth }], children: [(0, jsx_runtime_1.jsx)(SkeletonBox, { width: 44, height: 44, borderRadius: 12 }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles_1.fileManagementStyles.headerTitleContainer, { flex: 1 }], children: [(0, jsx_runtime_1.jsx)(SkeletonBox, { width: 140, height: 20, style: { marginBottom: 6 } }), (0, jsx_runtime_1.jsx)(SkeletonBox, { width: 100, height: 14 })] }), (0, jsx_runtime_1.jsx)(SkeletonBox, { width: 44, height: 44, borderRadius: 12 })] }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.controlsBar, children: [(0, jsx_runtime_1.jsx)(SkeletonBox, { width: 100, height: 36, borderRadius: 18 }), (0, jsx_runtime_1.jsx)(SkeletonBox, { width: 44, height: 44, borderRadius: 22 })] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles_1.fileManagementStyles.searchContainer, {
|
|
1369
|
+
backgroundColor: themeStyles.colors.card,
|
|
1370
|
+
}], children: (0, jsx_runtime_1.jsx)(SkeletonBox, { width: "100%", height: 44, borderRadius: 12 }) }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles_1.fileManagementStyles.statsContainer, {
|
|
1371
|
+
backgroundColor: themeStyles.colors.card,
|
|
1372
|
+
}], children: [1, 2, 3].map((i) => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.statItem, children: [(0, jsx_runtime_1.jsx)(SkeletonBox, { width: 50, height: 20, style: { marginBottom: 4 }, delay: i * 30 }), (0, jsx_runtime_1.jsx)(SkeletonBox, { width: 40, height: 14, delay: i * 30 + 15 })] }, i))) }), (0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { style: styles_1.fileManagementStyles.scrollView, contentContainerStyle: styles_1.fileManagementStyles.scrollContainer, showsVerticalScrollIndicator: false, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
1373
|
+
backgroundColor: themeStyles.colors.card,
|
|
1374
|
+
borderRadius: 18,
|
|
1375
|
+
overflow: 'hidden',
|
|
1376
|
+
marginTop: 8,
|
|
1377
|
+
}, children: [1, 2, 3, 4, 5, 6, 7, 8].map((i) => ((0, jsx_runtime_1.jsx)(SkeletonFileItem, { index: i }, i))) }) })] }));
|
|
1378
|
+
});
|
|
1379
|
+
if (loading) {
|
|
1380
|
+
return (0, jsx_runtime_1.jsx)(SkeletonLoader, {});
|
|
1381
|
+
}
|
|
1382
|
+
// If a file is opened, show the file viewer
|
|
1383
|
+
if (!selectMode && openedFile) {
|
|
1384
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FileViewer_1.FileViewer, { file: openedFile, fileContent: fileContent, loadingFileContent: loadingFileContent, showFileDetailsInViewer: showFileDetailsInViewer, onToggleDetails: () => setShowFileDetailsInViewer(!showFileDetailsInViewer), onClose: handleCloseFile, onDownload: handleFileDownload, onDelete: handleFileDelete, themeStyles: themeStyles, isOwner: user?.id === targetUserId }), (0, jsx_runtime_1.jsx)(FileDetailsModal_1.FileDetailsModal, { visible: showFileDetails, file: selectedFile, onClose: () => setShowFileDetails(false), onDownload: handleFileDownload, onDelete: handleFileDelete, themeStyles: themeStyles, isOwner: user?.id === targetUserId })] }));
|
|
1385
|
+
}
|
|
1386
|
+
// If upload preview is showing, render it inline instead of the file list
|
|
1387
|
+
if (showUploadPreview) {
|
|
1388
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.container, children: [(0, jsx_runtime_1.jsx)(Header_1.default, { title: t('fileManagement.reviewFiles'), subtitle: t('fileManagement.readyToUpload', { count: pendingFiles.length }), onBack: handleCancelUpload, showBackButton: true, variant: "minimal", elevation: "none", titleAlignment: "left" }), (0, jsx_runtime_1.jsx)(UploadPreview_1.UploadPreview, { visible: true, pendingFiles: pendingFiles, onConfirm: handleConfirmUpload, onCancel: handleCancelUpload, onRemoveFile: removePendingFile, themeStyles: themeStyles, inline: true })] }));
|
|
1389
|
+
}
|
|
1390
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.container, children: [(0, jsx_runtime_1.jsx)(Header_1.default, { title: selectMode ? (multiSelect ? (maxSelection ? t('fileManagement.selectedWithMax', { count: selectedIds.size, max: maxSelection }) : t('fileManagement.selected', { count: selectedIds.size })) : t('fileManagement.selectFile')) : (viewMode === 'photos' ? t('fileManagement.photos') : t('fileManagement.title')), subtitle: selectMode ? (multiSelect ? t('fileManagement.available', { count: filteredFiles.length }) : t('fileManagement.tapToSelect')) : (filteredFiles.length === 1 ? t('fileManagement.itemCount', { count: filteredFiles.length }) : t('fileManagement.itemCount_plural', { count: filteredFiles.length })), rightActions: selectMode && multiSelect ? [
|
|
1391
|
+
{
|
|
1392
|
+
key: 'clear',
|
|
1393
|
+
text: t('fileManagement.clear'),
|
|
1394
|
+
onPress: () => setSelectedIds(new Set()),
|
|
1395
|
+
disabled: selectedIds.size === 0,
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
key: 'confirm',
|
|
1399
|
+
text: t('fileManagement.confirm'),
|
|
1400
|
+
onPress: confirmMultiSelection,
|
|
1401
|
+
disabled: selectedIds.size === 0,
|
|
1402
|
+
}
|
|
1403
|
+
] : !selectMode && selectedIds.size > 0 ? [
|
|
1404
|
+
{
|
|
1405
|
+
key: 'clear',
|
|
1406
|
+
text: t('fileManagement.clear'),
|
|
1407
|
+
onPress: () => setSelectedIds(new Set()),
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
key: 'delete',
|
|
1411
|
+
text: t('fileManagement.delete', { count: selectedIds.size }),
|
|
1412
|
+
onPress: handleBulkDelete,
|
|
1413
|
+
icon: 'delete',
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
key: 'visibility',
|
|
1417
|
+
text: t('fileManagement.visibility'),
|
|
1418
|
+
onPress: () => {
|
|
1419
|
+
// Show visibility options menu
|
|
1420
|
+
react_native_1.Alert.alert(t('fileManagement.changeVisibility'), t('fileManagement.changeVisibilityConfirm', { count: selectedIds.size }), [
|
|
1421
|
+
{ text: t('common.cancel'), style: 'cancel' },
|
|
1422
|
+
{ text: t('fileManagement.private'), onPress: () => handleBulkVisibilityChange('private') },
|
|
1423
|
+
{ text: t('fileManagement.public'), onPress: () => handleBulkVisibilityChange('public') },
|
|
1424
|
+
{ text: t('fileManagement.unlisted'), onPress: () => handleBulkVisibilityChange('unlisted') },
|
|
1425
|
+
]);
|
|
1426
|
+
},
|
|
1427
|
+
icon: 'eye',
|
|
1428
|
+
}
|
|
1429
|
+
] : undefined, onBack: onClose || goBack, showBackButton: true, variant: "minimal", elevation: "none", titleAlignment: "left" }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.controlsBar, children: [(0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles_1.fileManagementStyles.viewModeScroll, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
1430
|
+
styles_1.fileManagementStyles.viewModeToggle,
|
|
1431
|
+
{
|
|
1432
|
+
backgroundColor: themeStyles.colors.card,
|
|
1433
|
+
}
|
|
1434
|
+
], children: [(0, jsx_runtime_1.jsx)(AnimatedButton, { isSelected: viewMode === 'all', onPress: () => setViewMode('all'), icon: viewMode === 'all' ? 'folder' : 'folder-outline', primaryColor: themeStyles.primaryColor, textColor: themeStyles.textColor, style: styles_1.fileManagementStyles.viewModeButton }), (0, jsx_runtime_1.jsx)(AnimatedButton, { isSelected: viewMode === 'photos', onPress: () => setViewMode('photos'), icon: viewMode === 'photos' ? 'image-multiple' : 'image-multiple-outline', primaryColor: themeStyles.primaryColor, textColor: themeStyles.textColor, style: styles_1.fileManagementStyles.viewModeButton }), (0, jsx_runtime_1.jsx)(AnimatedButton, { isSelected: viewMode === 'videos', onPress: () => setViewMode('videos'), icon: viewMode === 'videos' ? 'video' : 'video-outline', primaryColor: themeStyles.primaryColor, textColor: themeStyles.textColor, style: styles_1.fileManagementStyles.viewModeButton }), (0, jsx_runtime_1.jsx)(AnimatedButton, { isSelected: viewMode === 'documents', onPress: () => setViewMode('documents'), icon: viewMode === 'documents' ? 'file-document' : 'file-document-outline', primaryColor: themeStyles.primaryColor, textColor: themeStyles.textColor, style: styles_1.fileManagementStyles.viewModeButton }), (0, jsx_runtime_1.jsx)(AnimatedButton, { isSelected: viewMode === 'audio', onPress: () => setViewMode('audio'), icon: viewMode === 'audio' ? 'music-note' : 'music-note-outline', primaryColor: themeStyles.primaryColor, textColor: themeStyles.textColor, style: styles_1.fileManagementStyles.viewModeButton })] }) }), (0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.sortButton, {
|
|
1435
|
+
backgroundColor: themeStyles.colors.card,
|
|
1436
|
+
}], onPress: () => {
|
|
1437
|
+
// Cycle through sort options: date -> size -> name -> type -> date
|
|
1438
|
+
const sortOrder = ['date', 'size', 'name', 'type'];
|
|
1439
|
+
const currentIndex = sortOrder.indexOf(sortBy);
|
|
1440
|
+
const nextIndex = (currentIndex + 1) % sortOrder.length;
|
|
1441
|
+
setSortBy(sortOrder[nextIndex]);
|
|
1442
|
+
// Toggle order when cycling back to date
|
|
1443
|
+
if (nextIndex === 0) {
|
|
1444
|
+
setSortOrder(prev => prev === 'asc' ? 'desc' : 'asc');
|
|
1445
|
+
}
|
|
1446
|
+
}, children: [(0, jsx_runtime_1.jsx)(vector_icons_2.MaterialCommunityIcons, { name: sortBy === 'date' ? 'calendar' :
|
|
1447
|
+
sortBy === 'size' ? 'sort-numeric-variant' :
|
|
1448
|
+
sortBy === 'name' ? 'sort-alphabetical-variant' : 'file-document-outline', size: 16, color: themeStyles.textColor }), (0, jsx_runtime_1.jsx)(vector_icons_2.MaterialCommunityIcons, { name: sortOrder === 'asc' ? 'arrow-up' : 'arrow-down', size: 14, color: themeStyles.colors.secondaryText })] }), user?.id === targetUserId && (!selectMode || (selectMode && allowUploadInSelectMode)) && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.uploadButton, { backgroundColor: themeStyles.primaryColor }], onPress: handleFileUpload, disabled: uploading || isPickingDocument, children: uploading ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.uploadProgress, children: [(0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: "#FFFFFF" }), uploadProgress && ((0, jsx_runtime_1.jsxs)(react_native_1.Text, { style: styles_1.fileManagementStyles.uploadProgressText, children: [uploadProgress.current, "/", uploadProgress.total] }))] })) : isPickingDocument ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: "#FFFFFF" })) : ((0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "add", size: 22, color: "#FFFFFF" })) }))] }), files.length > 0 && (viewMode === 'all' || files.some(f => f.contentType.startsWith('image/'))) && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
1449
|
+
styles_1.fileManagementStyles.searchContainer,
|
|
1450
|
+
{
|
|
1451
|
+
backgroundColor: themeStyles.colors.card,
|
|
1452
|
+
}
|
|
1453
|
+
], children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "search", size: 22, color: themeStyles.colors.icon }), (0, jsx_runtime_1.jsx)(react_native_1.TextInput, { style: [styles_1.fileManagementStyles.searchInput, { color: themeStyles.textColor }], placeholder: viewMode === 'photos' ? t('fileManagement.searchPhotos') : t('fileManagement.searchFiles'), placeholderTextColor: themeStyles.colors.secondaryText, value: searchQuery, onChangeText: setSearchQuery }), searchQuery.length > 0 && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: () => setSearchQuery(''), style: styles_1.fileManagementStyles.searchClearButton, children: (0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "close-circle", size: 22, color: themeStyles.colors.icon }) }))] })), files.length > 0 && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
1454
|
+
styles_1.fileManagementStyles.statsContainer,
|
|
1455
|
+
{
|
|
1456
|
+
backgroundColor: themeStyles.colors.card,
|
|
1457
|
+
}
|
|
1458
|
+
], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.statItem, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.statValue, { color: themeStyles.textColor }], children: filteredFiles.length }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.statLabel, { color: themeStyles.colors.secondaryText }], children: searchQuery.length > 0 ? t('fileManagement.found') : (filteredFiles.length === 1 ? (viewMode === 'photos' ? t('fileManagement.photo') : t('fileManagement.file')) : (viewMode === 'photos' ? t('fileManagement.photos_stat') : t('fileManagement.files'))) })] }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.statItem, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.statValue, { color: themeStyles.textColor }], children: (0, fileManagement_1.formatFileSize)(filteredFiles.reduce((total, file) => total + file.length, 0)) }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.statLabel, { color: themeStyles.colors.secondaryText }], children: searchQuery.length > 0 ? t('fileManagement.size') : t('fileManagement.totalSize') })] }), searchQuery.length > 0 && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.statItem, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.statValue, { color: themeStyles.textColor }], children: files.length }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.statLabel, { color: themeStyles.colors.secondaryText }], children: t('fileManagement.total') })] }))] })), viewMode === 'photos' ? (renderPhotoGrid()) : ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: scrollViewRef, style: styles_1.fileManagementStyles.scrollView, contentContainerStyle: styles_1.fileManagementStyles.scrollContainer, refreshControl: (0, jsx_runtime_1.jsx)(react_native_1.RefreshControl, { refreshing: refreshing, onRefresh: () => loadFiles('refresh'), tintColor: themeStyles.primaryColor }), onScroll: ({ nativeEvent }) => {
|
|
1459
|
+
const { layoutMeasurement, contentOffset, contentSize } = nativeEvent;
|
|
1460
|
+
const distanceFromBottom = contentSize.height - (contentOffset.y + layoutMeasurement.height);
|
|
1461
|
+
if (distanceFromBottom < 200 && !paging.loadingMore && paging.hasMore) {
|
|
1462
|
+
loadFiles('more');
|
|
1463
|
+
}
|
|
1464
|
+
}, scrollEventThrottle: 250, children: filteredFiles.length === 0 && searchQuery.length > 0 ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.emptyState, children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "search", size: 64, color: themeStyles.isDarkTheme ? '#666666' : '#CCCCCC' }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.emptyStateTitle, { color: themeStyles.textColor }], children: t('fileManagement.noResults.title') }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.emptyStateDescription, { color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666' }], children: t('fileManagement.noResults.description', { query: searchQuery }) }), (0, jsx_runtime_1.jsxs)(react_native_1.TouchableOpacity, { style: [styles_1.fileManagementStyles.emptyStateButton, { backgroundColor: themeStyles.primaryColor }], onPress: () => setSearchQuery(''), children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "refresh", size: 20, color: "#FFFFFF" }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles_1.fileManagementStyles.emptyStateButtonText, children: t('fileManagement.clearSearch') })] })] })) : filteredFiles.length === 0 ? renderEmptyState() : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.GroupedSection, { items: groupedFileItems }), paging.loadingMore && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.loadingMoreBar, children: [(0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: themeStyles.primaryColor }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles_1.fileManagementStyles.loadingMoreText, { color: themeStyles.textColor }], children: t('fileManagement.loadingMore') })] }))] })) })), !selectMode && ((0, jsx_runtime_1.jsx)(FileDetailsModal_1.FileDetailsModal, { visible: showFileDetails, file: selectedFile, onClose: () => setShowFileDetails(false), onDownload: handleFileDownload, onDelete: handleFileDelete, themeStyles: themeStyles, isOwner: user?.id === targetUserId })), !selectMode && uploading && ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles_1.fileManagementStyles.uploadBannerContainer, { pointerEvents: 'none' }], children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles_1.fileManagementStyles.uploadBanner, { backgroundColor: themeStyles.isDarkTheme ? '#222831EE' : '#FFFFFFEE', borderColor: themeStyles.borderColor }], children: [(0, jsx_runtime_1.jsx)(vector_icons_1.Ionicons, { name: "cloud-upload", size: 18, color: themeStyles.primaryColor }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles_1.fileManagementStyles.uploadBannerContent, children: [(0, jsx_runtime_1.jsxs)(react_native_1.Text, { style: [styles_1.fileManagementStyles.uploadBannerText, { color: themeStyles.textColor }], children: [t('fileManagement.uploading'), uploadProgress ? ` ${uploadProgress.current}/${uploadProgress.total}` : '...'] }), uploadProgress && uploadProgress.total > 0 && ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles_1.fileManagementStyles.uploadProgressBarContainer, { backgroundColor: themeStyles.isDarkTheme ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.1)' }], children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
|
|
1465
|
+
styles_1.fileManagementStyles.uploadProgressBar,
|
|
1466
|
+
{
|
|
1467
|
+
width: `${(uploadProgress.current / uploadProgress.total) * 100}%`,
|
|
1468
|
+
backgroundColor: themeStyles.primaryColor
|
|
1469
|
+
}
|
|
1470
|
+
] }) }))] }), (0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: themeStyles.primaryColor })] }) }))] }));
|
|
1471
|
+
};
|
|
1472
|
+
// Styles have been moved to components/fileManagement/styles.ts
|
|
1473
|
+
exports.default = FileManagementScreen;
|