@oxyhq/services 22.9.0 → 22.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +24 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/AvatarCameraBadge.js +42 -0
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -0
- package/lib/commonjs/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +55 -133
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/commonjs/ui/components/OxyAuthChooser.js +657 -88
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +15 -1
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileSummaryCard.js +3 -23
- package/lib/commonjs/ui/components/ProfileSummaryCard.js.map +1 -1
- package/lib/commonjs/ui/components/RequireOxyAuth.js +1 -1
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js +63 -0
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -0
- package/lib/commonjs/ui/components/SurfaceScreen.js +91 -8
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +46 -29
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +47 -23
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js +81 -19
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +83 -23
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +83 -0
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +79 -29
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +18 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useFileQueries.js +129 -0
- package/lib/commonjs/ui/hooks/queries/useFileQueries.js.map +1 -0
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +38 -55
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useReduceMotion.js +57 -0
- package/lib/commonjs/ui/hooks/useReduceMotion.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +46 -0
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +36 -2
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +5 -6
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +4 -3
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceBackBridge.js +68 -0
- package/lib/commonjs/ui/navigation/surfaceBackBridge.js.map +1 -0
- package/lib/commonjs/ui/navigation/surfaceNavStack.js +62 -15
- package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceRegistry.js +84 -19
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaces.js +139 -25
- package/lib/commonjs/ui/navigation/surfaces.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +214 -283
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +88 -118
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +22 -36
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +219 -226
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +287 -289
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +301 -0
- package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +24 -39
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +136 -158
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +29 -36
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +101 -109
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +10 -15
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +8 -16
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +403 -627
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +62 -69
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +63 -79
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +69 -98
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +8 -14
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +77 -94
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +99 -134
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/NotificationsScreen.js +69 -76
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -8
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +67 -74
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +55 -91
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +291 -304
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +100 -114
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +38 -45
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +44 -57
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +24 -31
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +14 -24
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +16 -48
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +63 -0
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +54 -41
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +44 -81
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +66 -75
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +111 -139
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +13 -20
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +14 -27
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +68 -85
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +28 -36
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js +8 -3
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +11 -2
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +0 -79
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/index.js +12 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js +40 -0
- package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -0
- package/lib/module/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +57 -135
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/module/ui/components/OxyAuthChooser.js +659 -91
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +1 -1
- package/lib/module/ui/components/ProfileButton.js +16 -2
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/ProfileSummaryCard.js +2 -23
- package/lib/module/ui/components/ProfileSummaryCard.js.map +1 -1
- package/lib/module/ui/components/RequireOxyAuth.js +1 -1
- package/lib/module/ui/components/SurfaceHeaderAction.js +58 -0
- package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -0
- package/lib/module/ui/components/SurfaceScreen.js +93 -10
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +46 -29
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +46 -23
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js +81 -19
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +83 -25
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js +78 -0
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +80 -30
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +16 -0
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useFileQueries.js +120 -0
- package/lib/module/ui/hooks/queries/useFileQueries.js.map +1 -0
- package/lib/module/ui/hooks/useAvatarPicker.js +38 -55
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useReduceMotion.js +53 -0
- package/lib/module/ui/hooks/useReduceMotion.js.map +1 -0
- package/lib/module/ui/hooks/useSurfaceHeader.js +42 -0
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -0
- package/lib/module/ui/hooks/useSwitchableAccounts.js +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +34 -2
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +6 -7
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +4 -3
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/surfaceBackBridge.js +63 -0
- package/lib/module/ui/navigation/surfaceBackBridge.js.map +1 -0
- package/lib/module/ui/navigation/surfaceNavStack.js +62 -15
- package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -1
- package/lib/module/ui/navigation/surfaceRegistry.js +84 -19
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/module/ui/navigation/surfaces.js +138 -26
- package/lib/module/ui/navigation/surfaces.js.map +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js +218 -286
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +92 -121
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +25 -38
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +220 -227
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +289 -291
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ChangeAvatarScreen.js +298 -0
- package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -0
- package/lib/module/ui/screens/ConnectedAppsScreen.js +26 -40
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +139 -160
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +32 -38
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +102 -110
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +11 -15
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +10 -17
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +408 -631
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +64 -70
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +65 -81
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +71 -99
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +10 -15
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +78 -94
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +102 -137
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js +71 -77
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +4 -9
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +69 -75
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +58 -93
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +293 -305
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +102 -116
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +40 -46
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +46 -58
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +26 -32
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +14 -24
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +17 -49
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js +59 -0
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +54 -42
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +45 -81
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustAboutScreen.js +67 -75
- package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +112 -139
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustFAQScreen.js +15 -21
- package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +14 -26
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +69 -85
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +30 -37
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/resetSessionScopedStores.js +8 -3
- package/lib/module/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +11 -2
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +0 -78
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts +4 -0
- package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -0
- package/lib/typescript/{module/ui/components/OxyAccountDialog.d.ts → commonjs/ui/components/OxyAccountDialogScreen.d.ts} +5 -4
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +3 -3
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileSummaryCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +3 -4
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +17 -2
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts +75 -13
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +9 -0
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts +50 -0
- package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +17 -16
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts +14 -0
- package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +31 -0
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +27 -2
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +4 -5
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +21 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +101 -23
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +42 -11
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +18 -9
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts +34 -0
- package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts +8 -1
- package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +10 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +0 -48
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts +4 -0
- package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -0
- package/lib/typescript/{commonjs/ui/components/OxyAccountDialog.d.ts → module/ui/components/OxyAccountDialogScreen.d.ts} +5 -4
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +3 -3
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +2 -2
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileSummaryCard.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +1 -1
- package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts +16 -0
- package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +3 -4
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +17 -2
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts +75 -13
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
- package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +9 -0
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts +50 -0
- package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +17 -16
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts +14 -0
- package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +31 -0
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +27 -2
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +4 -5
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +21 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +101 -23
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaces.d.ts +42 -11
- package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +18 -9
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts +34 -0
- package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
- package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts +8 -1
- package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +10 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +0 -48
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/package.json +9 -5
- package/src/index.ts +12 -5
- package/src/ui/components/AvatarCameraBadge.tsx +35 -0
- package/src/ui/components/{OxyAccountDialog.tsx → OxyAccountDialogScreen.tsx} +50 -116
- package/src/ui/components/OxyAuthChooser.tsx +743 -86
- package/src/ui/components/OxyConsentScreen.tsx +1 -1
- package/src/ui/components/ProfileButton.tsx +18 -3
- package/src/ui/components/ProfileSummaryCard.tsx +2 -25
- package/src/ui/components/RequireOxyAuth.tsx +1 -1
- package/src/ui/components/SurfaceHeaderAction.tsx +60 -0
- package/src/ui/components/SurfaceScreen.tsx +108 -14
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +50 -36
- package/src/ui/components/modals/DeleteAccountModal.tsx +47 -26
- package/src/ui/components/oxyAuthChooserStyles.ts +78 -16
- package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +158 -84
- package/src/ui/components/photogrid/__tests__/chunkPhotos.test.ts +51 -0
- package/src/ui/components/surfaces/ActionSheetSurface.tsx +98 -0
- package/src/ui/context/OxyContext.tsx +79 -25
- package/src/ui/hooks/queries/queryKeys.ts +15 -0
- package/src/ui/hooks/queries/useFileQueries.ts +162 -0
- package/src/ui/hooks/useAvatarPicker.ts +46 -74
- package/src/ui/hooks/useReduceMotion.ts +58 -0
- package/src/ui/hooks/useSurfaceHeader.ts +57 -0
- package/src/ui/hooks/useSwitchableAccounts.ts +1 -1
- package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +55 -7
- package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +149 -0
- package/src/ui/navigation/accountDialogManager.ts +42 -2
- package/src/ui/navigation/bottomSheetManager.ts +6 -7
- package/src/ui/navigation/routes.ts +6 -4
- package/src/ui/navigation/surfaceBackBridge.ts +69 -0
- package/src/ui/navigation/surfaceNavStack.ts +72 -9
- package/src/ui/navigation/surfaceRegistry.ts +164 -24
- package/src/ui/navigation/surfaces.ts +137 -30
- package/src/ui/screens/AccountMembersScreen.tsx +39 -100
- package/src/ui/screens/AccountSettingsScreen.tsx +32 -54
- package/src/ui/screens/AccountVerificationScreen.tsx +23 -51
- package/src/ui/screens/AppInfoScreen.tsx +6 -13
- package/src/ui/screens/AvatarCropScreen.tsx +340 -311
- package/src/ui/screens/ChangeAvatarScreen.tsx +359 -0
- package/src/ui/screens/ConnectedAppsScreen.tsx +39 -60
- package/src/ui/screens/CreateAccountScreen.tsx +13 -39
- package/src/ui/screens/EditProfileFieldScreen.tsx +30 -48
- package/src/ui/screens/EditProfileScreen.tsx +7 -16
- package/src/ui/screens/FAQScreen.tsx +9 -13
- package/src/ui/screens/FeedbackScreen.tsx +8 -22
- package/src/ui/screens/FileManagementScreen.tsx +370 -610
- package/src/ui/screens/HelpSupportScreen.tsx +7 -13
- package/src/ui/screens/HistoryViewScreen.tsx +26 -31
- package/src/ui/screens/LanguageSelectorScreen.tsx +12 -46
- package/src/ui/screens/LearnMoreUsernamesScreen.tsx +8 -16
- package/src/ui/screens/LegalDocumentsScreen.tsx +7 -22
- package/src/ui/screens/ManageAccountScreen.tsx +96 -165
- package/src/ui/screens/NotificationsScreen.tsx +7 -13
- package/src/ui/screens/PaymentGatewayScreen.tsx +3 -10
- package/src/ui/screens/PreferencesScreen.tsx +7 -13
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +52 -90
- package/src/ui/screens/PrivacySettingsScreen.tsx +9 -21
- package/src/ui/screens/ProfileScreen.tsx +9 -11
- package/src/ui/screens/SavesCollectionsScreen.tsx +7 -13
- package/src/ui/screens/SearchSettingsScreen.tsx +9 -21
- package/src/ui/screens/UserLinksScreen.tsx +7 -14
- package/src/ui/screens/UserListScreen.tsx +2 -5
- package/src/ui/screens/WelcomeNewUserScreen.tsx +18 -48
- package/src/ui/screens/fileManagement/FileLibraryError.tsx +56 -0
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +56 -46
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +55 -71
- package/src/ui/screens/trust/TrustAboutScreen.tsx +10 -17
- package/src/ui/screens/trust/TrustCenterScreen.tsx +9 -28
- package/src/ui/screens/trust/TrustFAQScreen.tsx +15 -18
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +3 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +11 -26
- package/src/ui/screens/trust/TrustRulesScreen.tsx +10 -13
- package/src/ui/stores/resetSessionScopedStores.ts +8 -3
- package/src/ui/types/navigation.ts +10 -0
- package/src/ui/utils/avatarUtils.ts +11 -2
- package/src/ui/utils/fileManagement.ts +1 -101
- package/lib/commonjs/ui/components/Header.js +0 -305
- package/lib/commonjs/ui/components/Header.js.map +0 -1
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/commonjs/ui/stores/fileStore.js +0 -153
- package/lib/commonjs/ui/stores/fileStore.js.map +0 -1
- package/lib/module/ui/components/Header.js +0 -299
- package/lib/module/ui/components/Header.js.map +0 -1
- package/lib/module/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/module/ui/stores/fileStore.js +0 -145
- package/lib/module/ui/stores/fileStore.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/Header.d.ts +0 -33
- package/lib/typescript/commonjs/ui/components/Header.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/stores/fileStore.d.ts +0 -31
- package/lib/typescript/commonjs/ui/stores/fileStore.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/Header.d.ts +0 -33
- package/lib/typescript/module/ui/components/Header.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/lib/typescript/module/ui/stores/fileStore.d.ts +0 -31
- package/lib/typescript/module/ui/stores/fileStore.d.ts.map +0 -1
- package/src/ui/components/Header.tsx +0 -224
- package/src/ui/stores/fileStore.ts +0 -118
|
@@ -45,7 +45,12 @@ import { useDeviceManagement } from '../hooks/useDeviceManagement';
|
|
|
45
45
|
import { getStorageKeys, createPlatformStorage, type StorageInterface } from '../utils/storageHelpers';
|
|
46
46
|
import type { RouteName } from '../navigation/routes';
|
|
47
47
|
import { showBottomSheet as globalShowBottomSheet } from '../navigation/bottomSheetManager';
|
|
48
|
-
import {
|
|
48
|
+
import {
|
|
49
|
+
presentDetached,
|
|
50
|
+
topRouteSurface,
|
|
51
|
+
type SurfaceInstance,
|
|
52
|
+
type TrackedSurface,
|
|
53
|
+
} from '../navigation/surfaces';
|
|
49
54
|
import { useQueryClient, onlineManager } from '@tanstack/react-query';
|
|
50
55
|
import { clearQueryCache } from '../hooks/queryClient';
|
|
51
56
|
import { useAvatarPicker } from '../hooks/useAvatarPicker';
|
|
@@ -644,11 +649,36 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
644
649
|
const commitSwitchedSessionRef = useRef(commitSwitchedSession);
|
|
645
650
|
commitSwitchedSessionRef.current = commitSwitchedSession;
|
|
646
651
|
|
|
647
|
-
// The live AccountDialog surface (a stacked Bloom surface), while open
|
|
652
|
+
// The live AccountDialog surface (a stacked Bloom surface), while open — the
|
|
653
|
+
// SINGLE source of truth for "is the account dialog open". Held so
|
|
648
654
|
// `openAccountDialog` can no-op when already open and `closeAccountDialog` /
|
|
649
|
-
// `onSignedIn` can dismiss it.
|
|
655
|
+
// `onSignedIn` can dismiss it. Its present→settle lifecycle is what drives the
|
|
656
|
+
// reactive `accountDialogOpen` mirror below: presenting flips it true, the
|
|
657
|
+
// surface settling (`result.finally`) flips it false — no other write site.
|
|
650
658
|
const accountDialogSurfaceRef = useRef<SurfaceInstance<'AccountDialog'> | null>(null);
|
|
651
659
|
|
|
660
|
+
// When the account dialog is shown by MORPHING an already-open route surface
|
|
661
|
+
// (e.g. ManageAccount → the account switcher) it is pushed as a frame ONTO that
|
|
662
|
+
// surface rather than presented as its own. This holds that host surface so the
|
|
663
|
+
// close path can pop the AccountDialog frame back to it. `null` when the dialog
|
|
664
|
+
// is its OWN detached surface (opened cold, with no surface underneath).
|
|
665
|
+
const accountDialogHostRef = useRef<TrackedSurface | null>(null);
|
|
666
|
+
|
|
667
|
+
// The single teardown for the account dialog wherever it lives: pop the morphed
|
|
668
|
+
// frame back to its host surface (reshaping Manage ← switcher), or dismiss the
|
|
669
|
+
// detached surface (whose settle then flips `accountDialogOpen`). Reads only
|
|
670
|
+
// stable refs + `setAccountDialogOpen`, so its identity never changes.
|
|
671
|
+
const dismissAccountDialogSurface = useCallback((): void => {
|
|
672
|
+
const host = accountDialogHostRef.current;
|
|
673
|
+
if (host) {
|
|
674
|
+
accountDialogHostRef.current = null;
|
|
675
|
+
setAccountDialogOpen(false);
|
|
676
|
+
host.goBack();
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
accountDialogSurfaceRef.current?.dismiss();
|
|
680
|
+
}, []);
|
|
681
|
+
|
|
652
682
|
const accountDialogControllerRef = useRef<AccountDialogController | null>(null);
|
|
653
683
|
if (!accountDialogControllerRef.current) {
|
|
654
684
|
accountDialogControllerRef.current = createAccountDialogController({
|
|
@@ -662,8 +692,9 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
662
692
|
commitSession: (session) => handleWebSessionRef.current(session),
|
|
663
693
|
commitSwitchedSession: (session) => commitSwitchedSessionRef.current(session),
|
|
664
694
|
onSignedIn: () => {
|
|
665
|
-
|
|
666
|
-
|
|
695
|
+
// Close the dialog: pop the morphed frame back to its host surface, or
|
|
696
|
+
// dismiss the detached surface (whose settle flips `accountDialogOpen`).
|
|
697
|
+
dismissAccountDialogSurface();
|
|
667
698
|
},
|
|
668
699
|
openUrl: (url) => {
|
|
669
700
|
if (isWebBrowser()) {
|
|
@@ -688,31 +719,55 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
688
719
|
const accountDialogController = accountDialogControllerRef.current;
|
|
689
720
|
|
|
690
721
|
const openAccountDialog = useCallback((view?: AccountDialogView): void => {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
//
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
722
|
+
const nextView = view ?? 'accounts';
|
|
723
|
+
accountDialogControllerRef.current?.setView(nextView);
|
|
724
|
+
|
|
725
|
+
// Its own detached surface is already open → just re-point the view above.
|
|
726
|
+
if (accountDialogSurfaceRef.current) {
|
|
727
|
+
setAccountDialogOpen(true);
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// When a route surface (e.g. ManageAccount) is already open, MORPH it in
|
|
732
|
+
// place: push the AccountDialog as a frame ONTO that surface, so the panel
|
|
733
|
+
// reshapes from that surface to the switcher and a back returns to it. With no
|
|
734
|
+
// surface open (opened cold from a sign-in button), present the dialog as its
|
|
735
|
+
// OWN detached surface — kept OUT of the `showBottomSheet` route-surface
|
|
736
|
+
// lineage so closing the bottom-sheet session never touches it and vice-versa.
|
|
737
|
+
// `navigate` is idempotent for the top frame (it replaces rather than
|
|
738
|
+
// duplicates), so calling this while already morphed in just re-points the
|
|
739
|
+
// view, and calling it after a back re-pushes the frame — no stale guard.
|
|
740
|
+
const host = topRouteSurface();
|
|
741
|
+
if (host) {
|
|
742
|
+
accountDialogHostRef.current = host;
|
|
743
|
+
host.navigate('AccountDialog', { initialView: nextView });
|
|
744
|
+
setAccountDialogOpen(true);
|
|
745
|
+
return;
|
|
707
746
|
}
|
|
747
|
+
|
|
748
|
+
const instance = presentDetached(
|
|
749
|
+
'AccountDialog',
|
|
750
|
+
{ initialView: nextView },
|
|
751
|
+
{ placement: { base: 'bottom', md: 'center' }, dismissOnBackdrop: false, maxWidth: 420 },
|
|
752
|
+
);
|
|
753
|
+
accountDialogSurfaceRef.current = instance;
|
|
754
|
+
// The surface settling is the ONE place `accountDialogOpen` flips false for
|
|
755
|
+
// the detached path — covering every dismiss (close button, `onSignedIn`,
|
|
756
|
+
// programmatic `closeAccountDialog`, host unmount). The morphed path clears
|
|
757
|
+
// its own state in `dismissAccountDialogSurface`.
|
|
758
|
+
instance.result.finally(() => {
|
|
759
|
+
if (accountDialogSurfaceRef.current === instance) {
|
|
760
|
+
accountDialogSurfaceRef.current = null;
|
|
761
|
+
setAccountDialogOpen(false);
|
|
762
|
+
}
|
|
763
|
+
});
|
|
708
764
|
setAccountDialogOpen(true);
|
|
709
765
|
}, []);
|
|
710
766
|
|
|
711
767
|
const closeAccountDialog = useCallback((): void => {
|
|
712
768
|
accountDialogControllerRef.current?.cancelSignIn();
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
}, []);
|
|
769
|
+
dismissAccountDialogSurface();
|
|
770
|
+
}, [dismissAccountDialogSurface]);
|
|
716
771
|
|
|
717
772
|
// Start driving the dialog on mount; tear it down on unmount.
|
|
718
773
|
useEffect(() => {
|
|
@@ -960,7 +1015,6 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
960
1015
|
currentLanguage,
|
|
961
1016
|
activeSessionId,
|
|
962
1017
|
queryClient,
|
|
963
|
-
showBottomSheet: showBottomSheetForContext,
|
|
964
1018
|
});
|
|
965
1019
|
|
|
966
1020
|
const { accounts, refreshAccounts, switchToAccount, createAccount: createAccountFn } = useOxyAccountGraph({
|
|
@@ -100,6 +100,13 @@ export const queryKeys = {
|
|
|
100
100
|
usage: (accountScope?: string) => [...queryKeys.storage.all, 'usage', accountScope] as const,
|
|
101
101
|
},
|
|
102
102
|
|
|
103
|
+
// User file library (infinite-paginated; owner-scoped so switching the active
|
|
104
|
+
// account shows that account's files without a manual reset)
|
|
105
|
+
files: {
|
|
106
|
+
all: ['files'] as const,
|
|
107
|
+
list: (ownerId?: string) => [...queryKeys.files.all, 'list', ownerId || 'anonymous'] as const,
|
|
108
|
+
},
|
|
109
|
+
|
|
103
110
|
// Connected apps (OAuth grants the user has authorized)
|
|
104
111
|
connectedApps: {
|
|
105
112
|
all: ['connectedApps'] as const,
|
|
@@ -204,3 +211,11 @@ export const invalidateConnectedAppsQueries = (queryClient: QueryClient): void =
|
|
|
204
211
|
queryClient.invalidateQueries({ queryKey: queryKeys.connectedApps.all });
|
|
205
212
|
};
|
|
206
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Helper to invalidate the user's file library (all owners). Pass an ownerId via
|
|
216
|
+
* `queryKeys.files.list(ownerId)` for a scoped invalidation instead.
|
|
217
|
+
*/
|
|
218
|
+
export const invalidateFileQueries = (queryClient: QueryClient): void => {
|
|
219
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.files.all });
|
|
220
|
+
};
|
|
221
|
+
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User file-library queries + cache helpers.
|
|
3
|
+
*
|
|
4
|
+
* The file list is owned by React Query (`useInfiniteQuery`), NOT a zustand
|
|
5
|
+
* store: server pages live in the query cache, and every optimistic mutation
|
|
6
|
+
* (upload / delete / visibility) edits that cache via the pure `*InCache`
|
|
7
|
+
* helpers below. The `queryFn` is side-effect-free — it only fetches and maps a
|
|
8
|
+
* page. This is what lets the file manager stay effect-free while preserving
|
|
9
|
+
* infinite scroll, pull-to-refresh, and optimistic upload reconciliation.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
useInfiniteQuery,
|
|
14
|
+
type InfiniteData,
|
|
15
|
+
type QueryClient,
|
|
16
|
+
} from '@tanstack/react-query';
|
|
17
|
+
import type { FileMetadata } from '@oxyhq/core';
|
|
18
|
+
import { useOxy } from '../../context/OxyContext';
|
|
19
|
+
import { queryKeys } from './queryKeys';
|
|
20
|
+
|
|
21
|
+
/** Files fetched per page. */
|
|
22
|
+
export const FILES_PAGE_SIZE = 40;
|
|
23
|
+
|
|
24
|
+
/** Raw file record as returned by `oxyServices.listUserFiles` / `assetUpload`. */
|
|
25
|
+
export interface RawUserFile {
|
|
26
|
+
id: string;
|
|
27
|
+
originalName?: string;
|
|
28
|
+
sha256?: string;
|
|
29
|
+
mime?: string;
|
|
30
|
+
size?: number;
|
|
31
|
+
createdAt?: string;
|
|
32
|
+
metadata?: Record<string, unknown>;
|
|
33
|
+
variants?: unknown[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** One page of the infinite file list. */
|
|
37
|
+
export interface UserFilesPage {
|
|
38
|
+
files: FileMetadata[];
|
|
39
|
+
total: number;
|
|
40
|
+
hasMore: boolean;
|
|
41
|
+
nextOffset: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type UserFilesInfinite = InfiniteData<UserFilesPage>;
|
|
45
|
+
|
|
46
|
+
/** Normalize a raw API file record into the client `FileMetadata` shape. */
|
|
47
|
+
export function mapRawFileToMetadata(raw: RawUserFile): FileMetadata {
|
|
48
|
+
return {
|
|
49
|
+
id: raw.id,
|
|
50
|
+
filename: raw.originalName ?? raw.sha256 ?? '',
|
|
51
|
+
contentType: raw.mime ?? '',
|
|
52
|
+
length: raw.size ?? 0,
|
|
53
|
+
chunkSize: 0,
|
|
54
|
+
uploadDate: raw.createdAt ?? '',
|
|
55
|
+
metadata: raw.metadata ?? {},
|
|
56
|
+
variants: (raw.variants ?? []) as FileMetadata['variants'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Infinite-paginated list of the owner's files. Fires on mount and whenever
|
|
62
|
+
* `ownerId` changes (a new key); `staleTime: 0` reloads on every open. The
|
|
63
|
+
* rendered list is `data.pages.flatMap(p => p.files)`.
|
|
64
|
+
*/
|
|
65
|
+
export const useUserFilesInfinite = (ownerId?: string) => {
|
|
66
|
+
const { oxyServices } = useOxy();
|
|
67
|
+
return useInfiniteQuery<UserFilesPage, Error>({
|
|
68
|
+
queryKey: queryKeys.files.list(ownerId),
|
|
69
|
+
queryFn: async ({ pageParam }) => {
|
|
70
|
+
const offset = typeof pageParam === 'number' ? pageParam : 0;
|
|
71
|
+
const response = await oxyServices.listUserFiles(FILES_PAGE_SIZE, offset);
|
|
72
|
+
const raw = (response.files ?? []) as RawUserFile[];
|
|
73
|
+
const files = raw.map(mapRawFileToMetadata);
|
|
74
|
+
return {
|
|
75
|
+
files,
|
|
76
|
+
total: response.total ?? offset + files.length,
|
|
77
|
+
hasMore: Boolean(response.hasMore),
|
|
78
|
+
nextOffset: offset + FILES_PAGE_SIZE,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
initialPageParam: 0,
|
|
82
|
+
getNextPageParam: (lastPage) => (lastPage.hasMore ? lastPage.nextOffset : undefined),
|
|
83
|
+
enabled: Boolean(ownerId),
|
|
84
|
+
staleTime: 0,
|
|
85
|
+
refetchOnWindowFocus: false,
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// --- Pure cache transforms (optimistic updates) -----------------------------
|
|
90
|
+
// Each edits the cached `InfiniteData` for one owner. All no-op when nothing is
|
|
91
|
+
// cached yet (e.g. an upload before the first page loads) — the subsequent
|
|
92
|
+
// `invalidateQueries` reconcile then brings the authoritative record.
|
|
93
|
+
|
|
94
|
+
const fileListKey = (ownerId?: string) => queryKeys.files.list(ownerId);
|
|
95
|
+
|
|
96
|
+
const mapPages = (
|
|
97
|
+
data: UserFilesInfinite,
|
|
98
|
+
fn: (files: FileMetadata[]) => FileMetadata[],
|
|
99
|
+
): UserFilesInfinite => ({
|
|
100
|
+
...data,
|
|
101
|
+
pages: data.pages.map((page) => ({ ...page, files: fn(page.files) })),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
/** Prepend an (optimistic) file to the first page. */
|
|
105
|
+
export function prependFileToCache(
|
|
106
|
+
queryClient: QueryClient,
|
|
107
|
+
ownerId: string | undefined,
|
|
108
|
+
file: FileMetadata,
|
|
109
|
+
): void {
|
|
110
|
+
queryClient.setQueryData<UserFilesInfinite>(fileListKey(ownerId), (data) => {
|
|
111
|
+
if (!data || data.pages.length === 0) return data;
|
|
112
|
+
return {
|
|
113
|
+
...data,
|
|
114
|
+
pages: data.pages.map((page, index) =>
|
|
115
|
+
index === 0 ? { ...page, files: [file, ...page.files] } : page,
|
|
116
|
+
),
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Remove a file (by id) from every page. */
|
|
122
|
+
export function removeFileFromCache(
|
|
123
|
+
queryClient: QueryClient,
|
|
124
|
+
ownerId: string | undefined,
|
|
125
|
+
fileId: string,
|
|
126
|
+
): void {
|
|
127
|
+
queryClient.setQueryData<UserFilesInfinite>(fileListKey(ownerId), (data) =>
|
|
128
|
+
data ? mapPages(data, (files) => files.filter((f) => f.id !== fileId)) : data,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Swap an optimistic file (by id) for its persisted counterpart. */
|
|
133
|
+
export function replaceFileInCache(
|
|
134
|
+
queryClient: QueryClient,
|
|
135
|
+
ownerId: string | undefined,
|
|
136
|
+
oldId: string,
|
|
137
|
+
newFile: FileMetadata,
|
|
138
|
+
): void {
|
|
139
|
+
queryClient.setQueryData<UserFilesInfinite>(fileListKey(ownerId), (data) =>
|
|
140
|
+
data ? mapPages(data, (files) => files.map((f) => (f.id === oldId ? newFile : f))) : data,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Shallow-merge a metadata patch into a cached file (e.g. visibility change). */
|
|
145
|
+
export function patchFileMetadataInCache(
|
|
146
|
+
queryClient: QueryClient,
|
|
147
|
+
ownerId: string | undefined,
|
|
148
|
+
fileId: string,
|
|
149
|
+
metadataPatch: Record<string, unknown>,
|
|
150
|
+
): void {
|
|
151
|
+
queryClient.setQueryData<UserFilesInfinite>(fileListKey(ownerId), (data) =>
|
|
152
|
+
data
|
|
153
|
+
? mapPages(data, (files) =>
|
|
154
|
+
files.map((f) =>
|
|
155
|
+
f.id === fileId
|
|
156
|
+
? { ...f, metadata: { ...f.metadata, ...metadataPatch } as FileMetadata['metadata'] }
|
|
157
|
+
: f,
|
|
158
|
+
),
|
|
159
|
+
)
|
|
160
|
+
: data,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Avatar Picker Hook
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* The ONE write path for a user's profile picture. It owns no UI: the whole
|
|
5
|
+
* choose-and-crop experience is a single surface.
|
|
5
6
|
*
|
|
6
|
-
* Flow:
|
|
7
|
-
* 1.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Flow (typed promise over the shared surface stack — no callback props):
|
|
8
|
+
* 1. `openWithinOrPresent('ChangeAvatar')` opens the source list (device gallery,
|
|
9
|
+
* camera, existing Oxy files, remove) — MORPHING into the caller's surface
|
|
10
|
+
* when one is open, else presenting cold. Whichever source the user picks, it
|
|
11
|
+
* navigates WITHIN to the crop editor — so there is exactly one cropper and
|
|
12
|
+
* one entry into it.
|
|
13
|
+
* 2. The surface resolves with the cropped JPEG, with `{ removed: true }` when
|
|
14
|
+
* the user removed their photo, or `undefined` when they cancelled.
|
|
15
|
+
* 3. A crop is uploaded as a NEW file via `oxyServices.assetUpload` and set as
|
|
16
|
+
* the avatar; a removal clears the avatar field.
|
|
12
17
|
*
|
|
13
|
-
* `expo-image-manipulator` is required for the crop step
|
|
14
|
-
*
|
|
18
|
+
* `expo-image-manipulator` is required for the crop step and `expo-image-picker`
|
|
19
|
+
* for the device/camera sources (both declared as optional peers in the
|
|
20
|
+
* consuming app) — see AvatarCropScreen / ChangeAvatarScreen.
|
|
15
21
|
*/
|
|
16
22
|
|
|
17
23
|
import { useCallback } from 'react';
|
|
18
|
-
import type {
|
|
24
|
+
import type { OxyServices } from '@oxyhq/core';
|
|
19
25
|
import { translate, updateAvatarVisibility } from '@oxyhq/core';
|
|
20
26
|
import type { QueryClient } from '@tanstack/react-query';
|
|
21
27
|
import { toast } from '@oxyhq/bloom';
|
|
22
|
-
import type { RouteName } from '../navigation/routes';
|
|
23
28
|
import { updateProfileWithAvatar } from '../utils/avatarUtils';
|
|
29
|
+
import { openWithinOrPresent } from '../navigation/surfaces';
|
|
24
30
|
import type { AvatarCropResult } from '../screens/AvatarCropScreen';
|
|
25
31
|
|
|
26
32
|
interface UseAvatarPickerOptions {
|
|
@@ -28,7 +34,6 @@ interface UseAvatarPickerOptions {
|
|
|
28
34
|
currentLanguage: string | null | undefined;
|
|
29
35
|
activeSessionId: string | null;
|
|
30
36
|
queryClient: QueryClient;
|
|
31
|
-
showBottomSheet: (config: { screen: RouteName; props?: Record<string, unknown> }) => void;
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
/** Upload result shape returned by oxyServices.assetUpload (single-file path). */
|
|
@@ -52,7 +57,6 @@ export function useAvatarPicker({
|
|
|
52
57
|
currentLanguage,
|
|
53
58
|
activeSessionId,
|
|
54
59
|
queryClient,
|
|
55
|
-
showBottomSheet,
|
|
56
60
|
}: UseAvatarPickerOptions) {
|
|
57
61
|
/**
|
|
58
62
|
* Final step: take the cropped JPEG, upload it as a new public file, then
|
|
@@ -99,68 +103,36 @@ export function useAvatarPicker({
|
|
|
99
103
|
[activeSessionId, currentLanguage, oxyServices, queryClient],
|
|
100
104
|
);
|
|
101
105
|
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
toast.error(
|
|
118
|
-
translate(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') ||
|
|
119
|
-
'Please select an image file',
|
|
120
|
-
);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
let sourceUri: string;
|
|
125
|
-
try {
|
|
126
|
-
const resolved = await oxyServices.assetGetUrl(file.id);
|
|
127
|
-
if (!resolved?.url) {
|
|
128
|
-
throw new Error('No download URL returned for the selected image');
|
|
129
|
-
}
|
|
130
|
-
sourceUri = resolved.url;
|
|
131
|
-
} catch (e: unknown) {
|
|
132
|
-
const message = e instanceof Error ? e.message : undefined;
|
|
133
|
-
toast.error(
|
|
134
|
-
message ||
|
|
135
|
-
translate(currentLanguage ?? undefined, 'editProfile.toasts.cropMeasureFailed') ||
|
|
136
|
-
'Could not load the selected image',
|
|
137
|
-
);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
showBottomSheet({
|
|
142
|
-
screen: 'AvatarCrop',
|
|
143
|
-
props: {
|
|
144
|
-
imageUri: sourceUri,
|
|
145
|
-
onConfirm: finalizeCroppedAvatar,
|
|
146
|
-
},
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
[currentLanguage, finalizeCroppedAvatar, oxyServices, showBottomSheet],
|
|
150
|
-
);
|
|
106
|
+
/** Clear the avatar so the profile falls back to the user's initials. */
|
|
107
|
+
const removeAvatar = useCallback(async () => {
|
|
108
|
+
try {
|
|
109
|
+
await updateProfileWithAvatar({ avatar: '' }, oxyServices, activeSessionId, queryClient);
|
|
110
|
+
toast.success(
|
|
111
|
+
translate(currentLanguage ?? undefined, 'editProfile.toasts.avatarRemoved'),
|
|
112
|
+
);
|
|
113
|
+
} catch (e: unknown) {
|
|
114
|
+
const message = e instanceof Error ? e.message : undefined;
|
|
115
|
+
toast.error(
|
|
116
|
+
message ||
|
|
117
|
+
translate(currentLanguage ?? undefined, 'editProfile.toasts.updateAvatarFailed'),
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}, [activeSessionId, currentLanguage, oxyServices, queryClient]);
|
|
151
121
|
|
|
152
|
-
const openAvatarPicker = useCallback(() => {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
122
|
+
const openAvatarPicker = useCallback(async () => {
|
|
123
|
+
// The source list + crop editor are ONE flow. When triggered from a screen
|
|
124
|
+
// already inside a surface (EditProfile, ManageAccount, WelcomeNewUser — every
|
|
125
|
+
// current entry point), it MORPHS into that surface and pops back on finish;
|
|
126
|
+
// triggered with no surface open it presents cold. Either way it resolves with
|
|
127
|
+
// the cropped JPEG, a removal, or `undefined` when the user backs out.
|
|
128
|
+
const result = await openWithinOrPresent('ChangeAvatar');
|
|
129
|
+
if (!result) return;
|
|
130
|
+
if ('removed' in result) {
|
|
131
|
+
await removeAvatar();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
await finalizeCroppedAvatar(result);
|
|
135
|
+
}, [finalizeCroppedAvatar, removeAvatar]);
|
|
164
136
|
|
|
165
137
|
return { openAvatarPicker };
|
|
166
138
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useReduceMotion
|
|
3
|
+
*
|
|
4
|
+
* Reactive boolean reflecting the OS "reduce motion" accessibility preference.
|
|
5
|
+
* Wraps `AccessibilityInfo` as an external store via `useSyncExternalStore` — the
|
|
6
|
+
* effect-free, React-Compiler-safe way to read an external mutable source. The
|
|
7
|
+
* initial value is read asynchronously once (the platform API is a Promise) and
|
|
8
|
+
* cached module-side; subsequent changes arrive via the `reduceMotionChanged`
|
|
9
|
+
* event. Mirrors the `useOnlineStatus` pattern.
|
|
10
|
+
*
|
|
11
|
+
* Consumers use it to pin entrance/stagger animations off under reduce-motion.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { useSyncExternalStore } from 'react';
|
|
15
|
+
import { AccessibilityInfo } from 'react-native';
|
|
16
|
+
|
|
17
|
+
let cachedReduceMotion = false;
|
|
18
|
+
let initialized = false;
|
|
19
|
+
const listeners = new Set<() => void>();
|
|
20
|
+
|
|
21
|
+
const notifyAll = (): void => {
|
|
22
|
+
for (const listener of listeners) listener();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const setCached = (value: boolean): void => {
|
|
26
|
+
if (cachedReduceMotion === value) return;
|
|
27
|
+
cachedReduceMotion = value;
|
|
28
|
+
notifyAll();
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const subscribeReduceMotion = (notify: () => void): (() => void) => {
|
|
32
|
+
// Populate the cache the first time anyone subscribes (the platform read is
|
|
33
|
+
// async, so it cannot be a synchronous `getSnapshot`).
|
|
34
|
+
if (!initialized) {
|
|
35
|
+
initialized = true;
|
|
36
|
+
AccessibilityInfo.isReduceMotionEnabled()
|
|
37
|
+
.then(setCached)
|
|
38
|
+
.catch(() => {
|
|
39
|
+
// No preference available — the `false` default stands.
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
listeners.add(notify);
|
|
43
|
+
const sub = AccessibilityInfo.addEventListener('reduceMotionChanged', setCached);
|
|
44
|
+
return () => {
|
|
45
|
+
listeners.delete(notify);
|
|
46
|
+
sub.remove();
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const getSnapshot = (): boolean => cachedReduceMotion;
|
|
51
|
+
|
|
52
|
+
// SSR/web-first paint: assume motion is allowed (no reduce) until the async read
|
|
53
|
+
// resolves — matches the prior default.
|
|
54
|
+
const getServerSnapshot = (): boolean => false;
|
|
55
|
+
|
|
56
|
+
export function useReduceMotion(): boolean {
|
|
57
|
+
return useSyncExternalStore(subscribeReduceMotion, getSnapshot, getServerSnapshot);
|
|
58
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createContext, useContext, useLayoutEffect } from 'react';
|
|
2
|
+
import type { DialogHeaderConfig } from '@oxyhq/bloom/dialog';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The header content a mounted surface screen contributes at runtime: its
|
|
6
|
+
* (translated) title/subtitle and optional slot nodes. Back/close affordances
|
|
7
|
+
* are owned by the surface host (`SurfaceScreen`) — a screen never wires them.
|
|
8
|
+
*
|
|
9
|
+
* A `right` slot is the canonical place for a screen-state action (e.g. a Save
|
|
10
|
+
* button whose disabled/loading state reflects the form). Slot nodes MUST be
|
|
11
|
+
* referentially stable (memoize them with `useMemo`) so the header does not
|
|
12
|
+
* thrash.
|
|
13
|
+
*/
|
|
14
|
+
export type SurfaceHeaderContent = Pick<
|
|
15
|
+
DialogHeaderConfig,
|
|
16
|
+
'title' | 'titleContent' | 'subtitle' | 'largeTitle' | 'left' | 'right' | 'onBack'
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
interface SurfaceHeaderContextValue {
|
|
20
|
+
setContent: (content: SurfaceHeaderContent | null) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Provided by {@link ../components/SurfaceScreen}. Bridges a screen's runtime
|
|
25
|
+
* header contribution up to the host, which merges it with the back/close
|
|
26
|
+
* wiring and drives the Dialog's own nav header. `null` outside a surface (or in
|
|
27
|
+
* a headerless surface), so {@link useSurfaceHeader} is a safe no-op there.
|
|
28
|
+
*/
|
|
29
|
+
export const SurfaceHeaderContext = createContext<SurfaceHeaderContextValue | null>(null);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Declare the Dialog nav header's content from within a surface screen — its
|
|
33
|
+
* title/subtitle and any action slot. Merges over nothing (the host owns
|
|
34
|
+
* back/close), replaces on change, and clears on unmount. Call it unconditionally;
|
|
35
|
+
* it is a no-op outside a header-mode surface.
|
|
36
|
+
*/
|
|
37
|
+
export function useSurfaceHeader(content: SurfaceHeaderContent | null | undefined): void {
|
|
38
|
+
const ctx = useContext(SurfaceHeaderContext);
|
|
39
|
+
const set = ctx?.setContent;
|
|
40
|
+
// Set synchronously in the commit's layout phase so the bar/title fill in
|
|
41
|
+
// BEFORE the browser paints — no first-frame flash of an empty bar.
|
|
42
|
+
useLayoutEffect(() => {
|
|
43
|
+
if (!set) return;
|
|
44
|
+
set(content ?? null);
|
|
45
|
+
return () => set(null);
|
|
46
|
+
// Slot nodes (`left`/`right`) are compared by identity; callers memoize them.
|
|
47
|
+
}, [
|
|
48
|
+
set,
|
|
49
|
+
content?.title,
|
|
50
|
+
content?.titleContent,
|
|
51
|
+
content?.subtitle,
|
|
52
|
+
content?.largeTitle,
|
|
53
|
+
content?.left,
|
|
54
|
+
content?.right,
|
|
55
|
+
content?.onBack,
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
@@ -32,7 +32,7 @@ const EMPTY_SNAPSHOT: AccountDialogSnapshot = {
|
|
|
32
32
|
* real per-account name / email / avatar / color.
|
|
33
33
|
*
|
|
34
34
|
* This is a thin binding over the shared `AccountDialogController` in
|
|
35
|
-
* `@oxyhq/core` (the SAME headless source the {@link
|
|
35
|
+
* `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialogScreen} renders),
|
|
36
36
|
* so there is ONE projection (`projectSwitchableAccounts`) and one switch path
|
|
37
37
|
* (`controller.switchTo`) across the whole SDK — the local duplicate projection
|
|
38
38
|
* this hook used to own has been removed. Every switch routes through
|