@oxyhq/services 22.8.7 → 22.10.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/OxyAccountDialogScreen.js +150 -0
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/commonjs/ui/components/OxyAuthChooser.js +137 -40
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +9 -29
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +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 +193 -0
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -0
- 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 +22 -12
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.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 +49 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +34 -39
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- 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 +14 -2
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +38 -56
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +7 -57
- 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 +98 -0
- package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -0
- package/lib/commonjs/ui/navigation/surfaceRegistry.js +152 -0
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -0
- package/lib/commonjs/ui/navigation/surfaces.js +256 -0
- package/lib/commonjs/ui/navigation/surfaces.js.map +1 -0
- 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 +10 -14
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- 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 +219 -206
- 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/fileManagement/PhotoPickerSection.js +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +9 -7
- 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/types/surfaceScreen.js +6 -0
- package/lib/commonjs/ui/types/surfaceScreen.js.map +1 -0
- package/lib/module/index.js +12 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +145 -0
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/module/ui/components/OxyAuthChooser.js +137 -40
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +1 -1
- package/lib/module/ui/components/OxyProvider.js +10 -30
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +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 +188 -0
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -0
- 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 +22 -12
- package/lib/module/ui/components/oxyAuthChooserStyles.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 +49 -4
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +34 -39
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- 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 +14 -2
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +37 -53
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +6 -56
- 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 +95 -0
- package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -0
- package/lib/module/ui/navigation/surfaceRegistry.js +146 -0
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -0
- package/lib/module/ui/navigation/surfaces.js +244 -0
- package/lib/module/ui/navigation/surfaces.js.map +1 -0
- 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 +10 -14
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- 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 +222 -208
- 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/fileManagement/PhotoPickerSection.js +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +8 -7
- 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/types/surfaceScreen.js +4 -0
- package/lib/module/ui/types/surfaceScreen.js.map +1 -0
- 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/OxyAccountDialogScreen.d.ts +39 -0
- 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/OxyProvider.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +2 -2
- 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 +26 -0
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -0
- 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 +19 -9
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.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/useAvatarPicker.d.ts +7 -11
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- 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 +14 -2
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +24 -16
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +2 -60
- 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 +51 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +135 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +79 -0
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -0
- 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 +0 -4
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- 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/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/types/navigation.d.ts +8 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts +38 -0
- package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts.map +1 -0
- 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/OxyAccountDialogScreen.d.ts +39 -0
- 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/OxyProvider.d.ts +3 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +2 -2
- 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 +26 -0
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -0
- 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 +19 -9
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.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/useAvatarPicker.d.ts +7 -11
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- 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 +14 -2
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +24 -16
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +2 -60
- 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 +51 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +135 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaces.d.ts +79 -0
- package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -0
- 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 +0 -4
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- 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/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/types/navigation.d.ts +8 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/surfaceScreen.d.ts +38 -0
- package/lib/typescript/module/ui/types/surfaceScreen.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +12 -5
- package/src/ui/components/OxyAccountDialogScreen.tsx +148 -0
- package/src/ui/components/OxyAuthChooser.tsx +153 -33
- package/src/ui/components/OxyConsentScreen.tsx +1 -1
- package/src/ui/components/OxyProvider.tsx +12 -34
- package/src/ui/components/ProfileButton.tsx +2 -2
- package/src/ui/components/RequireOxyAuth.tsx +1 -1
- package/src/ui/components/SurfaceHeaderAction.tsx +60 -0
- package/src/ui/components/SurfaceScreen.tsx +226 -0
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +50 -36
- package/src/ui/components/modals/DeleteAccountModal.tsx +47 -26
- package/src/ui/components/oxyAuthChooserStyles.ts +22 -12
- package/src/ui/components/surfaces/ActionSheetSurface.tsx +98 -0
- package/src/ui/context/OxyContext.tsx +43 -3
- package/src/ui/hooks/useAvatarPicker.ts +53 -66
- package/src/ui/hooks/useSurfaceHeader.ts +56 -0
- package/src/ui/hooks/useSwitchableAccounts.ts +1 -1
- package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +39 -0
- package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +68 -0
- package/src/ui/navigation/accountDialogManager.ts +14 -2
- package/src/ui/navigation/bottomSheetManager.ts +46 -73
- package/src/ui/navigation/routes.ts +7 -106
- package/src/ui/navigation/surfaceBackBridge.ts +69 -0
- package/src/ui/navigation/surfaceNavStack.ts +110 -0
- package/src/ui/navigation/surfaceRegistry.ts +240 -0
- package/src/ui/navigation/surfaces.ts +272 -0
- 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 +8 -17
- 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 +191 -188
- 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/fileManagement/PhotoPickerSection.tsx +1 -1
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +9 -7
- 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/types/navigation.ts +8 -0
- package/src/ui/types/surfaceScreen.ts +38 -0
- package/lib/commonjs/ui/components/BottomSheet.js +0 -49
- package/lib/commonjs/ui/components/BottomSheet.js.map +0 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +0 -298
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +0 -1
- 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 +0 -259
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/module/ui/components/BottomSheet.js +0 -45
- package/lib/module/ui/components/BottomSheet.js.map +0 -1
- package/lib/module/ui/components/BottomSheetRouter.js +0 -292
- package/lib/module/ui/components/BottomSheetRouter.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 +0 -254
- package/lib/module/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts +0 -29
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts +0 -9
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.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 +0 -37
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/BottomSheet.d.ts +0 -29
- package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +0 -9
- package/lib/typescript/module/ui/components/BottomSheetRouter.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 +0 -37
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/src/ui/components/BottomSheet.tsx +0 -48
- package/src/ui/components/BottomSheetRouter.tsx +0 -310
- package/src/ui/components/Header.tsx +0 -224
- package/src/ui/components/OxyAccountDialog.tsx +0 -243
- package/src/ui/navigation/__tests__/getSheetConfig.test.ts +0 -36
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
View,
|
|
5
|
-
TouchableOpacity,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
Platform,
|
|
8
|
-
ActivityIndicator,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import AnimatedReanimated, { useAnimatedStyle, interpolate, Extrapolation, type SharedValue } from 'react-native-reanimated';
|
|
11
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
12
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
13
|
-
import { useTheme } from '@oxyhq/bloom/theme';
|
|
14
|
-
import { PressableScale } from '@oxyhq/bloom/pressable-scale';
|
|
15
|
-
import { H4, Text } from '@oxyhq/bloom/typography';
|
|
16
|
-
|
|
17
|
-
type ThemeColors = ReturnType<typeof useTheme>['colors'];
|
|
18
|
-
|
|
19
|
-
export interface HeaderAction {
|
|
20
|
-
/** Ionicons name — rendered as a circular icon button when no `text` is set. */
|
|
21
|
-
icon?: string;
|
|
22
|
-
/** Label — rendered as a filled pill button (takes precedence over `icon`). */
|
|
23
|
-
text?: string;
|
|
24
|
-
onPress: () => void;
|
|
25
|
-
loading?: boolean;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/** Stable identity for lists; falls back to the array index. */
|
|
28
|
-
key?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface HeaderProps {
|
|
32
|
-
title: string;
|
|
33
|
-
subtitle?: string;
|
|
34
|
-
onBack?: () => void;
|
|
35
|
-
onClose?: () => void;
|
|
36
|
-
/** Trailing action buttons, rendered left-to-right before the close button. */
|
|
37
|
-
actions?: HeaderAction[];
|
|
38
|
-
showBackButton?: boolean;
|
|
39
|
-
showCloseButton?: boolean;
|
|
40
|
-
variant?: 'default' | 'minimal';
|
|
41
|
-
elevation?: 'none' | 'subtle' | 'prominent';
|
|
42
|
-
subtitleVariant?: 'default' | 'small' | 'large' | 'muted';
|
|
43
|
-
titleAlignment?: 'left' | 'center' | 'right';
|
|
44
|
-
/** Shared scroll offset — enables sticky translate-up behavior on native. */
|
|
45
|
-
scrollY?: SharedValue<number>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const getHeaderHeight = (variant: HeaderProps['variant'] = 'default', safeAreaTop = 0): number => {
|
|
49
|
-
const paddingTop = Platform.OS === 'ios' ? Math.max(safeAreaTop, 50) : 16;
|
|
50
|
-
const paddingBottom = 12;
|
|
51
|
-
const contentHeight = variant === 'minimal' ? 36 : 40;
|
|
52
|
-
return paddingTop + contentHeight + paddingBottom;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const HeaderActionButton: React.FC<{ action: HeaderAction; colors: ThemeColors }> = ({ action, colors }) => {
|
|
56
|
-
const isText = !!action.text;
|
|
57
|
-
return (
|
|
58
|
-
<PressableScale
|
|
59
|
-
onPress={action.onPress}
|
|
60
|
-
disabled={action.disabled || action.loading}
|
|
61
|
-
style={[
|
|
62
|
-
styles.actionButton,
|
|
63
|
-
isText ? styles.textActionButton : styles.iconActionButton,
|
|
64
|
-
{ backgroundColor: isText ? colors.tint : colors.card, opacity: action.disabled ? 0.5 : 1 },
|
|
65
|
-
]}
|
|
66
|
-
>
|
|
67
|
-
{action.loading ? (
|
|
68
|
-
<ActivityIndicator size="small" color={isText ? colors.card : colors.tint} />
|
|
69
|
-
) : isText ? (
|
|
70
|
-
<Text style={[styles.actionText, { color: colors.card }]}>{action.text}</Text>
|
|
71
|
-
) : (
|
|
72
|
-
<Ionicons name={action.icon as React.ComponentProps<typeof Ionicons>['name']} size={18} color={colors.tint} />
|
|
73
|
-
)}
|
|
74
|
-
</PressableScale>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const Header: React.FC<HeaderProps> = ({
|
|
79
|
-
title,
|
|
80
|
-
subtitle,
|
|
81
|
-
onBack,
|
|
82
|
-
onClose,
|
|
83
|
-
actions,
|
|
84
|
-
showBackButton = true,
|
|
85
|
-
showCloseButton = false,
|
|
86
|
-
variant = 'default',
|
|
87
|
-
elevation = 'subtle',
|
|
88
|
-
subtitleVariant = 'default',
|
|
89
|
-
titleAlignment = 'left',
|
|
90
|
-
scrollY,
|
|
91
|
-
}) => {
|
|
92
|
-
const { colors, mode } = useTheme();
|
|
93
|
-
const insets = useSafeAreaInsets();
|
|
94
|
-
const headerHeight = getHeaderHeight(variant, insets.top);
|
|
95
|
-
const isDark = mode === 'dark';
|
|
96
|
-
|
|
97
|
-
// Sticky behavior on native: header translates up as content scrolls, clamped
|
|
98
|
-
// so it never leaves the viewport. No-op on web (uses CSS `position: sticky`).
|
|
99
|
-
const animatedHeaderStyle = useAnimatedStyle(() => {
|
|
100
|
-
if (Platform.OS === 'web' || !scrollY) return {};
|
|
101
|
-
const translateY = interpolate(scrollY.value, [0, headerHeight], [0, -headerHeight], Extrapolation.CLAMP);
|
|
102
|
-
return { transform: [{ translateY }] };
|
|
103
|
-
}, [scrollY, headerHeight]);
|
|
104
|
-
|
|
105
|
-
const elevationStyle = useMemo(() => {
|
|
106
|
-
switch (elevation) {
|
|
107
|
-
case 'subtle':
|
|
108
|
-
return Platform.select({
|
|
109
|
-
web: { boxShadow: isDark ? '0 1px 3px rgba(0,0,0,0.3)' : '0 1px 3px rgba(0,0,0,0.1)' },
|
|
110
|
-
default: { shadowColor: '#000000', shadowOffset: { width: 0, height: 1 }, shadowOpacity: isDark ? 0.3 : 0.1, shadowRadius: 3, elevation: 2 },
|
|
111
|
-
});
|
|
112
|
-
case 'prominent':
|
|
113
|
-
return Platform.select({
|
|
114
|
-
web: { boxShadow: isDark ? '0 4px 12px rgba(0,0,0,0.4)' : '0 4px 12px rgba(0,0,0,0.15)' },
|
|
115
|
-
default: { shadowColor: '#000000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: isDark ? 0.4 : 0.15, shadowRadius: 12, elevation: 8 },
|
|
116
|
-
});
|
|
117
|
-
default:
|
|
118
|
-
return {};
|
|
119
|
-
}
|
|
120
|
-
}, [elevation, isDark]);
|
|
121
|
-
|
|
122
|
-
const containerStyle = useMemo(() => [
|
|
123
|
-
styles.container,
|
|
124
|
-
{ paddingTop: Platform.OS === 'ios' ? Math.max(insets.top, 50) : 16 },
|
|
125
|
-
// Header inside a ScrollView (scrollY provided) must not be absolutely positioned.
|
|
126
|
-
!scrollY && Platform.OS !== 'web' ? styles.absolute : null,
|
|
127
|
-
{ borderBottomWidth: elevation === 'none' ? 0 : 1 },
|
|
128
|
-
elevationStyle,
|
|
129
|
-
], [insets.top, elevation, elevationStyle, scrollY]);
|
|
130
|
-
|
|
131
|
-
const titleAlign = titleAlignment === 'center' ? styles.alignCenter
|
|
132
|
-
: titleAlignment === 'right' ? styles.alignRight
|
|
133
|
-
: styles.alignLeft;
|
|
134
|
-
|
|
135
|
-
const HeaderContainer = Platform.OS === 'web' || !scrollY ? View : AnimatedReanimated.View;
|
|
136
|
-
const headerStyle = Platform.OS !== 'web' && scrollY !== undefined ? [containerStyle, animatedHeaderStyle] : containerStyle;
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<HeaderContainer className="bg-bg border-border" style={headerStyle}>
|
|
140
|
-
<View style={[styles.content, variant === 'minimal' && styles.contentMinimal]}>
|
|
141
|
-
{showBackButton && onBack ? (
|
|
142
|
-
<TouchableOpacity className="bg-card" style={styles.circleButton} onPress={onBack} activeOpacity={0.7}>
|
|
143
|
-
<Ionicons name="chevron-back" size={18} color={colors.tint} />
|
|
144
|
-
</TouchableOpacity>
|
|
145
|
-
) : null}
|
|
146
|
-
|
|
147
|
-
<View style={[styles.titleContainer, titleAlign, variant === 'minimal' && styles.titleContainerMinimal]}>
|
|
148
|
-
<H4 className="text-text" style={variant === 'minimal' ? styles.titleMinimal : styles.titleDefault} numberOfLines={1}>
|
|
149
|
-
{title}
|
|
150
|
-
</H4>
|
|
151
|
-
{subtitle ? (
|
|
152
|
-
<Text className="text-text-secondary" style={subtitleStyles[subtitleVariant]} numberOfLines={1}>
|
|
153
|
-
{subtitle}
|
|
154
|
-
</Text>
|
|
155
|
-
) : null}
|
|
156
|
-
</View>
|
|
157
|
-
|
|
158
|
-
{actions?.length ? (
|
|
159
|
-
<View style={styles.actionsRow}>
|
|
160
|
-
{actions.map((action, idx) => (
|
|
161
|
-
<HeaderActionButton key={action.key ?? idx} action={action} colors={colors} />
|
|
162
|
-
))}
|
|
163
|
-
</View>
|
|
164
|
-
) : null}
|
|
165
|
-
|
|
166
|
-
{showCloseButton && onClose ? (
|
|
167
|
-
<TouchableOpacity className="bg-card" style={[styles.circleButton, styles.closeButton]} onPress={onClose} activeOpacity={0.7}>
|
|
168
|
-
<Ionicons name="close" size={18} color={colors.text} />
|
|
169
|
-
</TouchableOpacity>
|
|
170
|
-
) : null}
|
|
171
|
-
</View>
|
|
172
|
-
</HeaderContainer>
|
|
173
|
-
);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const styles = StyleSheet.create({
|
|
177
|
-
container: {
|
|
178
|
-
paddingBottom: 12,
|
|
179
|
-
zIndex: 1000,
|
|
180
|
-
...Platform.select({
|
|
181
|
-
web: { position: 'sticky' as 'relative', top: 0, left: 0, right: 0 },
|
|
182
|
-
default: {},
|
|
183
|
-
}),
|
|
184
|
-
},
|
|
185
|
-
absolute: { position: 'absolute', top: 0, left: 0, right: 0 },
|
|
186
|
-
content: {
|
|
187
|
-
flexDirection: 'row',
|
|
188
|
-
alignItems: 'center',
|
|
189
|
-
paddingHorizontal: 16,
|
|
190
|
-
position: 'relative',
|
|
191
|
-
minHeight: 40,
|
|
192
|
-
},
|
|
193
|
-
contentMinimal: { paddingHorizontal: 12, minHeight: 36 },
|
|
194
|
-
circleButton: {
|
|
195
|
-
width: 32,
|
|
196
|
-
height: 32,
|
|
197
|
-
borderRadius: 16,
|
|
198
|
-
alignItems: 'center',
|
|
199
|
-
justifyContent: 'center',
|
|
200
|
-
marginRight: 10,
|
|
201
|
-
},
|
|
202
|
-
closeButton: { marginRight: 0, marginLeft: 10 },
|
|
203
|
-
titleContainer: { flex: 1, justifyContent: 'center' },
|
|
204
|
-
alignLeft: { alignItems: 'flex-start' },
|
|
205
|
-
alignCenter: { alignItems: 'center' },
|
|
206
|
-
alignRight: { alignItems: 'flex-end' },
|
|
207
|
-
titleContainerMinimal: { alignItems: 'center', marginHorizontal: 16 },
|
|
208
|
-
titleDefault: { fontSize: 18, fontWeight: '700', letterSpacing: -0.5, lineHeight: 22 },
|
|
209
|
-
titleMinimal: { fontSize: 16, fontWeight: '600', letterSpacing: -0.3, lineHeight: 20 },
|
|
210
|
-
actionsRow: { flexDirection: 'row', alignItems: 'center' },
|
|
211
|
-
actionButton: { alignItems: 'center', justifyContent: 'center', marginLeft: 10 },
|
|
212
|
-
iconActionButton: { width: 32, height: 32, borderRadius: 16 },
|
|
213
|
-
textActionButton: { paddingHorizontal: 14, paddingVertical: 6, borderRadius: 18, minWidth: 56 },
|
|
214
|
-
actionText: { fontSize: 14, fontWeight: '600', letterSpacing: -0.2 },
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
const subtitleStyles = StyleSheet.create({
|
|
218
|
-
default: { fontSize: 14, fontWeight: '400', lineHeight: 17, marginTop: 1 },
|
|
219
|
-
small: { fontSize: 12, fontWeight: '400', lineHeight: 14 },
|
|
220
|
-
large: { fontSize: 16, fontWeight: '400', lineHeight: 19, marginTop: 3 },
|
|
221
|
-
muted: { fontSize: 14, fontWeight: '400', lineHeight: 17, marginTop: 1, opacity: 0.7 },
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
export default Header;
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OxyAccountDialog — the ONE unified account dialog for `@oxyhq/services`.
|
|
3
|
-
*
|
|
4
|
-
* Bloom `<Dialog>` chrome (header, back button, placement, scroll body) around
|
|
5
|
-
* the headless chooser logic, which lives in `OxyAuthChooser` — the account
|
|
6
|
-
* switcher, sign-in, sign-up, and QR views are ALL there, extracted so the
|
|
7
|
-
* same chooser can be mounted bare by a future host with no Dialog chrome
|
|
8
|
-
* (e.g. an auth.oxy.so hub page driving the cross-origin passkey popup, b2).
|
|
9
|
-
* This file owns ONLY the chrome: the title/subtitle per view, the back
|
|
10
|
-
* button, and the Bloom `<Dialog>` surface itself.
|
|
11
|
-
*
|
|
12
|
-
* The surface is Bloom's `<Dialog>` (`@oxyhq/bloom/dialog`) with a responsive
|
|
13
|
-
* `placement` — a bottom sheet on narrow viewports, a centered card on wide ones.
|
|
14
|
-
* It REPLACES the hand-rolled RN `<Modal>` + `<GestureHandlerRootView>` + manual
|
|
15
|
-
* backdrop/card wrapper this component used before. That RN `<Modal>` is invisible
|
|
16
|
-
* under React StrictMode on web: react-native-web's `ModalPortal` appends its host
|
|
17
|
-
* node during render but removes it in an effect cleanup and never re-attaches, so
|
|
18
|
-
* the dialog never paints in a dev Vite build. Bloom's `<Dialog>` renders through
|
|
19
|
-
* its own Portal and has no such lifecycle hazard.
|
|
20
|
-
*
|
|
21
|
-
* Open/close is CONTROLLED by `isAccountDialogOpen` (the `open` prop); the Dialog
|
|
22
|
-
* stays mounted whenever the controller exists so it can animate its own close.
|
|
23
|
-
* Backdrop / swipe-to-dismiss is disabled (`dismissOnBackdrop={false}`) on purpose:
|
|
24
|
-
* Bloom's controlled `bottom` placement does not fire `onClose` on a gesture or
|
|
25
|
-
* backdrop dismissal, so allowing it would desync `isAccountDialogOpen` from the
|
|
26
|
-
* sheet and block reopening. The header close button (and `OxyAuthChooser`'s
|
|
27
|
-
* `onComplete`) drive `closeAccountDialog`, which flips `open` and runs the exit
|
|
28
|
-
* animation.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
import type React from 'react';
|
|
32
|
-
import { useCallback, useSyncExternalStore } from 'react';
|
|
33
|
-
import { Pressable, ScrollView, StyleSheet, View } from 'react-native';
|
|
34
|
-
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
35
|
-
import { Dialog } from '@oxyhq/bloom/dialog';
|
|
36
|
-
import { Text } from '@oxyhq/bloom/typography';
|
|
37
|
-
import { useTheme } from '@oxyhq/bloom/theme';
|
|
38
|
-
import type { AccountDialogSnapshot } from '@oxyhq/core';
|
|
39
|
-
import { useOxy } from '../context/OxyContext';
|
|
40
|
-
import { useI18n } from '../hooks/useI18n';
|
|
41
|
-
import OxyAuthChooser from './OxyAuthChooser';
|
|
42
|
-
import { LogoIcon } from './logo/LogoIcon';
|
|
43
|
-
|
|
44
|
-
type Theme = ReturnType<typeof useTheme>;
|
|
45
|
-
type Translate = ReturnType<typeof useI18n>['t'];
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The unified account dialog. Mounted once by `OxyProvider`; opened imperatively
|
|
49
|
-
* via `useOxy().openAccountDialog(view?)` or imperative `openAccountDialog('signin')`.
|
|
50
|
-
*/
|
|
51
|
-
const OxyAccountDialog: React.FC = () => {
|
|
52
|
-
const { accountDialogController: controller, isAccountDialogOpen, closeAccountDialog } = useOxy();
|
|
53
|
-
const theme = useTheme();
|
|
54
|
-
const { t } = useI18n();
|
|
55
|
-
|
|
56
|
-
// A lightweight, header-only binding to the same controller `OxyAuthChooser`
|
|
57
|
-
// binds independently — cheap, and the established pattern here (
|
|
58
|
-
// `useSwitchableAccounts` also binds to this controller on its own).
|
|
59
|
-
const subscribe = useCallback(
|
|
60
|
-
(listener: () => void) => (controller ? controller.subscribe(listener) : () => undefined),
|
|
61
|
-
[controller],
|
|
62
|
-
);
|
|
63
|
-
const getSnapshot = useCallback(
|
|
64
|
-
() => (controller ? controller.getSnapshot() : EMPTY_SNAPSHOT),
|
|
65
|
-
[controller],
|
|
66
|
-
);
|
|
67
|
-
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
68
|
-
|
|
69
|
-
if (!controller) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const { view } = snapshot;
|
|
74
|
-
const showBack =
|
|
75
|
-
view === 'qr' || view === 'signup' || (view === 'add' && snapshot.accounts.length > 0);
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<Dialog
|
|
79
|
-
open={isAccountDialogOpen}
|
|
80
|
-
onClose={closeAccountDialog}
|
|
81
|
-
placement={{ base: 'bottom', md: 'center' }}
|
|
82
|
-
dismissOnBackdrop={false}
|
|
83
|
-
maxWidth={420}
|
|
84
|
-
label={headerCopy(view, snapshot.accounts.length, t).title}
|
|
85
|
-
>
|
|
86
|
-
<DialogHeader
|
|
87
|
-
snapshot={snapshot}
|
|
88
|
-
theme={theme}
|
|
89
|
-
t={t}
|
|
90
|
-
showBack={showBack}
|
|
91
|
-
onBack={() => controller.setView('accounts')}
|
|
92
|
-
onClose={closeAccountDialog}
|
|
93
|
-
/>
|
|
94
|
-
<ScrollView style={styles.body} contentContainerStyle={styles.bodyContent} showsVerticalScrollIndicator={false}>
|
|
95
|
-
<OxyAuthChooser onComplete={closeAccountDialog} />
|
|
96
|
-
</ScrollView>
|
|
97
|
-
</Dialog>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// ---------------------------------------------------------------------------
|
|
102
|
-
// Header
|
|
103
|
-
// ---------------------------------------------------------------------------
|
|
104
|
-
|
|
105
|
-
interface HeaderProps {
|
|
106
|
-
snapshot: AccountDialogSnapshot;
|
|
107
|
-
theme: Theme;
|
|
108
|
-
t: Translate;
|
|
109
|
-
showBack: boolean;
|
|
110
|
-
onBack: () => void;
|
|
111
|
-
onClose: () => void;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const DialogHeader: React.FC<HeaderProps> = ({ snapshot, theme, t, showBack, onBack, onClose }) => {
|
|
115
|
-
const { title, subtitle } = headerCopy(snapshot.view, snapshot.accounts.length, t);
|
|
116
|
-
return (
|
|
117
|
-
<View style={styles.header}>
|
|
118
|
-
<View style={styles.headerBar}>
|
|
119
|
-
{showBack ? (
|
|
120
|
-
<Pressable
|
|
121
|
-
onPress={onBack}
|
|
122
|
-
style={[styles.iconButton, { backgroundColor: theme.colors.backgroundSecondary }]}
|
|
123
|
-
accessibilityRole="button"
|
|
124
|
-
accessibilityLabel={t('common.actions.back') || 'Back'}
|
|
125
|
-
>
|
|
126
|
-
<MaterialCommunityIcons name="chevron-left" size={22} color={theme.colors.textSecondary} />
|
|
127
|
-
</Pressable>
|
|
128
|
-
) : (
|
|
129
|
-
<View style={styles.iconButton} />
|
|
130
|
-
)}
|
|
131
|
-
<LogoIcon height={34} color={theme.colors.primary} />
|
|
132
|
-
<Pressable
|
|
133
|
-
onPress={onClose}
|
|
134
|
-
style={[styles.iconButton, { backgroundColor: theme.colors.backgroundSecondary }]}
|
|
135
|
-
accessibilityRole="button"
|
|
136
|
-
accessibilityLabel={t('common.actions.close') || 'Close'}
|
|
137
|
-
>
|
|
138
|
-
<MaterialCommunityIcons name="close" size={20} color={theme.colors.textSecondary} />
|
|
139
|
-
</Pressable>
|
|
140
|
-
</View>
|
|
141
|
-
<Text style={[styles.title, { color: theme.colors.text }]} numberOfLines={1}>
|
|
142
|
-
{title}
|
|
143
|
-
</Text>
|
|
144
|
-
{subtitle ? (
|
|
145
|
-
<Text style={[styles.subtitle, { color: theme.colors.textSecondary }]} numberOfLines={2}>
|
|
146
|
-
{subtitle}
|
|
147
|
-
</Text>
|
|
148
|
-
) : null}
|
|
149
|
-
</View>
|
|
150
|
-
);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// ---------------------------------------------------------------------------
|
|
154
|
-
// Copy + helpers
|
|
155
|
-
// ---------------------------------------------------------------------------
|
|
156
|
-
|
|
157
|
-
function headerCopy(
|
|
158
|
-
view: AccountDialogSnapshot['view'],
|
|
159
|
-
accountCount: number,
|
|
160
|
-
t: Translate,
|
|
161
|
-
): { title: string; subtitle: string | null } {
|
|
162
|
-
switch (view) {
|
|
163
|
-
case 'accounts':
|
|
164
|
-
return {
|
|
165
|
-
title: t('accountSwitcher.sections.yourAccounts') || 'Your accounts',
|
|
166
|
-
subtitle: t('signin.chooser.subtitle') || 'Choose which account to continue with.',
|
|
167
|
-
};
|
|
168
|
-
case 'qr':
|
|
169
|
-
return {
|
|
170
|
-
title: t('accountSwitcher.scanTitle') || 'Sign in with Oxy',
|
|
171
|
-
subtitle: t('accountSwitcher.scanSubtitle') || 'Scan with Commons on your phone.',
|
|
172
|
-
};
|
|
173
|
-
case 'signup':
|
|
174
|
-
return {
|
|
175
|
-
title: t('signup.title') || 'Create your account',
|
|
176
|
-
subtitle: t('signup.subtitle') || 'One identity for the whole ecosystem.',
|
|
177
|
-
};
|
|
178
|
-
default:
|
|
179
|
-
return accountCount > 0
|
|
180
|
-
? {
|
|
181
|
-
title: t('signin.addAccountTitle') || 'Add another account',
|
|
182
|
-
subtitle: t('signin.addAccountSubtitle') || 'Sign in with another account.',
|
|
183
|
-
}
|
|
184
|
-
: {
|
|
185
|
-
title: t('signin.title') || 'Sign in',
|
|
186
|
-
subtitle: t('signin.subtitle') || 'One identity for the whole ecosystem.',
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const EMPTY_SNAPSHOT: AccountDialogSnapshot = {
|
|
192
|
-
view: 'accounts',
|
|
193
|
-
accounts: [],
|
|
194
|
-
activeAccountId: null,
|
|
195
|
-
loading: false,
|
|
196
|
-
error: null,
|
|
197
|
-
switchingAccountId: null,
|
|
198
|
-
signIn: { phase: 'idle', authorizeCode: null, qrPayload: null, expiresAt: null, error: null },
|
|
199
|
-
commonsAvailability: 'unknown',
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
const styles = StyleSheet.create({
|
|
203
|
-
header: {
|
|
204
|
-
alignItems: 'center',
|
|
205
|
-
marginBottom: 12,
|
|
206
|
-
},
|
|
207
|
-
headerBar: {
|
|
208
|
-
width: '100%',
|
|
209
|
-
flexDirection: 'row',
|
|
210
|
-
alignItems: 'center',
|
|
211
|
-
justifyContent: 'space-between',
|
|
212
|
-
marginBottom: 8,
|
|
213
|
-
},
|
|
214
|
-
iconButton: {
|
|
215
|
-
width: 32,
|
|
216
|
-
height: 32,
|
|
217
|
-
borderRadius: 16,
|
|
218
|
-
alignItems: 'center',
|
|
219
|
-
justifyContent: 'center',
|
|
220
|
-
},
|
|
221
|
-
title: {
|
|
222
|
-
fontSize: 22,
|
|
223
|
-
fontWeight: '800',
|
|
224
|
-
letterSpacing: -0.4,
|
|
225
|
-
textAlign: 'center',
|
|
226
|
-
marginTop: 6,
|
|
227
|
-
},
|
|
228
|
-
subtitle: {
|
|
229
|
-
fontSize: 14,
|
|
230
|
-
lineHeight: 19,
|
|
231
|
-
textAlign: 'center',
|
|
232
|
-
marginTop: 4,
|
|
233
|
-
},
|
|
234
|
-
body: {
|
|
235
|
-
width: '100%',
|
|
236
|
-
},
|
|
237
|
-
bodyContent: {
|
|
238
|
-
paddingTop: 4,
|
|
239
|
-
paddingBottom: 4,
|
|
240
|
-
},
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
export default OxyAccountDialog;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { getSheetConfig } from '../routes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* `getSheetConfig` drives which surface `BottomSheetRouter` mounts a route in.
|
|
5
|
-
* The flagship image picker (FileManagement in image-only select mode) resolves
|
|
6
|
-
* to `presentation: 'dialog'`; every other route stays `'sheet'`. These guard
|
|
7
|
-
* the routing contract so the ~28 sheet screens keep the in-tree BottomSheet.
|
|
8
|
-
*/
|
|
9
|
-
describe('getSheetConfig presentation', () => {
|
|
10
|
-
const imageOnlyPickerProps = {
|
|
11
|
-
selectMode: true,
|
|
12
|
-
disabledMimeTypes: ['video/', 'audio/', 'application/pdf'],
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
it('defaults every route to the in-tree sheet', () => {
|
|
16
|
-
expect(getSheetConfig('ManageAccount', {}).presentation).toBe('sheet');
|
|
17
|
-
expect(getSheetConfig('AvatarCrop', {}).presentation).toBe('sheet');
|
|
18
|
-
expect(getSheetConfig(null, {}).presentation).toBe('sheet');
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('routes the FileManagement image-only picker to the Dialog', () => {
|
|
22
|
-
expect(getSheetConfig('FileManagement', imageOnlyPickerProps).presentation).toBe('dialog');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('keeps FileManagement on the sheet when it is not an image-only picker', () => {
|
|
26
|
-
// Browse mode (no selectMode) — the standard file manager.
|
|
27
|
-
expect(getSheetConfig('FileManagement', {}).presentation).toBe('sheet');
|
|
28
|
-
// Select mode that still allows non-image types is not the flagship picker.
|
|
29
|
-
expect(
|
|
30
|
-
getSheetConfig('FileManagement', {
|
|
31
|
-
selectMode: true,
|
|
32
|
-
disabledMimeTypes: ['video/'],
|
|
33
|
-
}).presentation,
|
|
34
|
-
).toBe('sheet');
|
|
35
|
-
});
|
|
36
|
-
});
|