@oxyhq/services 22.9.0 → 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/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +25 -125
- 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/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 +52 -5
- 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 +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 +23 -9
- 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/routes.js +3 -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/surfaceRegistry.js +52 -8
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaces.js +42 -5
- 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 +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/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/module/index.js +12 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +27 -127
- 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/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 +53 -6
- 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 +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 +23 -9
- 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/routes.js +3 -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/surfaceRegistry.js +52 -8
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/module/ui/navigation/surfaces.js +42 -5
- 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 +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/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/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/{OxyAccountDialog.d.ts → OxyAccountDialogScreen.d.ts} +4 -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/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 +4 -2
- 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 +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/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +31 -13
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- 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 +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/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/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/{OxyAccountDialog.d.ts → OxyAccountDialogScreen.d.ts} +4 -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/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 +4 -2
- 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 +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/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +31 -13
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- 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 +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/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/package.json +2 -2
- package/src/index.ts +12 -5
- package/src/ui/components/{OxyAccountDialog.tsx → OxyAccountDialogScreen.tsx} +21 -110
- package/src/ui/components/OxyAuthChooser.tsx +153 -33
- package/src/ui/components/OxyConsentScreen.tsx +1 -1
- 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 +66 -6
- 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 +22 -8
- 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__/surfaceNavStack.test.ts +68 -0
- package/src/ui/navigation/accountDialogManager.ts +14 -2
- package/src/ui/navigation/routes.ts +3 -3
- package/src/ui/navigation/surfaceBackBridge.ts +69 -0
- package/src/ui/navigation/surfaceRegistry.ts +80 -14
- package/src/ui/navigation/surfaces.ts +33 -5
- 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/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/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/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/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/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/src/ui/components/Header.tsx +0 -224
|
@@ -0,0 +1,56 @@
|
|
|
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' | '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?.subtitle,
|
|
51
|
+
content?.largeTitle,
|
|
52
|
+
content?.left,
|
|
53
|
+
content?.right,
|
|
54
|
+
content?.onBack,
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
@@ -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
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createSurfaceNavStack } from '../surfaceNavStack';
|
|
2
|
+
import { __resetSurfaceBackBridgeForTests, pushSurfaceBackHandler, __invokeTopSurfaceBackForTests } from '../surfaceBackBridge';
|
|
3
|
+
|
|
4
|
+
describe('createSurfaceNavStack', () => {
|
|
5
|
+
it('starts with a single root frame', () => {
|
|
6
|
+
const stack = createSurfaceNavStack('ManageAccount', { foo: 1 });
|
|
7
|
+
expect(stack.getTop().route).toBe('ManageAccount');
|
|
8
|
+
expect(stack.getTop().props).toEqual({ foo: 1 });
|
|
9
|
+
expect(stack.canGoBack()).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('navigate pushes frames and goBack pops them', () => {
|
|
13
|
+
const stack = createSurfaceNavStack('ManageAccount');
|
|
14
|
+
stack.navigate('EditProfile', { userId: 'u1' });
|
|
15
|
+
expect(stack.getTop().route).toBe('EditProfile');
|
|
16
|
+
expect(stack.canGoBack()).toBe(true);
|
|
17
|
+
expect(stack.goBack()).toBe(true);
|
|
18
|
+
expect(stack.getTop().route).toBe('ManageAccount');
|
|
19
|
+
expect(stack.goBack()).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('replace swaps the top frame without growing history', () => {
|
|
23
|
+
const stack = createSurfaceNavStack('ManageAccount');
|
|
24
|
+
stack.navigate('EditProfile');
|
|
25
|
+
stack.replace('PrivacySettings');
|
|
26
|
+
expect(stack.getTop().route).toBe('PrivacySettings');
|
|
27
|
+
expect(stack.goBack()).toBe(true);
|
|
28
|
+
expect(stack.getTop().route).toBe('ManageAccount');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('tracks wizard steps on the current frame', () => {
|
|
32
|
+
const stack = createSurfaceNavStack('EditProfile', { initialStep: 2 });
|
|
33
|
+
expect(stack.getTop().step).toBe(2);
|
|
34
|
+
expect(stack.canGoBack()).toBe(true);
|
|
35
|
+
stack.setStep(1);
|
|
36
|
+
expect(stack.getTop().step).toBe(1);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('requestDismiss flips closing once', () => {
|
|
40
|
+
const stack = createSurfaceNavStack('ManageAccount');
|
|
41
|
+
stack.requestDismiss('done');
|
|
42
|
+
expect(stack.store.getState().closing).toBe(true);
|
|
43
|
+
expect(stack.store.getState().closeResult).toBe('done');
|
|
44
|
+
stack.requestDismiss('again');
|
|
45
|
+
expect(stack.store.getState().closeResult).toBe('done');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('pushSurfaceBackHandler', () => {
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
__resetSurfaceBackBridgeForTests();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('delegates to the topmost handler', () => {
|
|
55
|
+
const calls: string[] = [];
|
|
56
|
+
pushSurfaceBackHandler(() => {
|
|
57
|
+
calls.push('bottom');
|
|
58
|
+
return true;
|
|
59
|
+
});
|
|
60
|
+
pushSurfaceBackHandler(() => {
|
|
61
|
+
calls.push('top');
|
|
62
|
+
return true;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
expect(__invokeTopSurfaceBackForTests()).toBe(true);
|
|
66
|
+
expect(calls).toEqual(['top']);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Imperative
|
|
2
|
+
* Imperative, outside-React entry points for the unified `OxyAccountDialogScreen`.
|
|
3
|
+
*
|
|
4
|
+
* These delegate to the live handles the mounted `OxyProvider` registers via
|
|
5
|
+
* {@link registerAccountDialogControls}. Under the hood `open`/`close` present
|
|
6
|
+
* and dismiss the `AccountDialog` surface on the shared Bloom surface stack
|
|
7
|
+
* (`OxyContext.openAccountDialog` → `presentDetached('AccountDialog', …)`), so
|
|
8
|
+
* whether the dialog is open is owned by that stack — this module is only the
|
|
9
|
+
* thin bridge that reaches the provider's controller (which sets the dialog
|
|
10
|
+
* view) from a non-React call site.
|
|
3
11
|
*/
|
|
4
12
|
|
|
5
13
|
import type { AccountDialogView } from '@oxyhq/core';
|
|
6
14
|
|
|
7
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Live open/close handles registered by the mounted provider. `open` presents
|
|
17
|
+
* the `AccountDialog` surface (and points its view); `close` dismisses it. Both
|
|
18
|
+
* are stack operations — this interface never carries visibility state.
|
|
19
|
+
*/
|
|
8
20
|
export interface AccountDialogControls {
|
|
9
21
|
open: (view?: AccountDialogView) => void;
|
|
10
22
|
close: () => void;
|
|
@@ -43,7 +43,7 @@ export type RouteName =
|
|
|
43
43
|
| 'Notifications' // Per-channel notification preferences
|
|
44
44
|
| 'ConnectedApps' // OAuth-authorized third-party apps the user can revoke
|
|
45
45
|
| 'Preferences' // General user preferences (theme, reduce-motion, etc.)
|
|
46
|
-
| 'AccountDialog'; // Unified account switcher + sign-in surface (
|
|
46
|
+
| 'AccountDialog'; // Unified account switcher + sign-in surface (OxyAccountDialogScreen body)
|
|
47
47
|
|
|
48
48
|
// Lazy screen loaders - functions that return screen components on-demand
|
|
49
49
|
// This breaks the require cycle by deferring imports until screens are actually needed
|
|
@@ -88,9 +88,9 @@ const screenLoaders: Record<RouteName, () => ComponentType<BaseScreenProps>> = {
|
|
|
88
88
|
ConnectedApps: () => require('../screens/ConnectedAppsScreen').default,
|
|
89
89
|
Preferences: () => require('../screens/PreferencesScreen').default,
|
|
90
90
|
// Unified account switcher + sign-in surface. Its body lives in the
|
|
91
|
-
// `
|
|
91
|
+
// `OxyAccountDialogScreen` component (folded from the standalone dialog); the
|
|
92
92
|
// surface stack provides the Dialog chrome around it.
|
|
93
|
-
AccountDialog: () => require('../components/
|
|
93
|
+
AccountDialog: () => require('../components/OxyAccountDialogScreen').default,
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
// Cache loaded components to avoid re-requiring
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BackHandler, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Per-surface system-back handlers (Android hardware back + web Escape).
|
|
5
|
+
*
|
|
6
|
+
* Bloom's `SurfaceHost` dismisses the whole top surface on back/Escape. The SDK
|
|
7
|
+
* needs the old `BottomSheetRouter` semantics first: pop nav history, step a
|
|
8
|
+
* wizard back, then dismiss. A single global listener delegates to the topmost
|
|
9
|
+
* registered handler so stacked surfaces route correctly.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export type SurfaceBackHandler = () => boolean;
|
|
13
|
+
|
|
14
|
+
const handlerStack: SurfaceBackHandler[] = [];
|
|
15
|
+
let androidInstalled = false;
|
|
16
|
+
let escapeInstalled = false;
|
|
17
|
+
|
|
18
|
+
function invokeTopHandler(): boolean {
|
|
19
|
+
const handler = handlerStack[handlerStack.length - 1];
|
|
20
|
+
return handler ? handler() : false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function installAndroidHandler(): void {
|
|
24
|
+
if (androidInstalled || Platform.OS !== 'android') return;
|
|
25
|
+
androidInstalled = true;
|
|
26
|
+
BackHandler.addEventListener('hardwareBackPress', () => {
|
|
27
|
+
if (handlerStack.length === 0) return false;
|
|
28
|
+
return invokeTopHandler();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function installEscapeHandler(): void {
|
|
33
|
+
if (escapeInstalled || Platform.OS !== 'web') return;
|
|
34
|
+
if (typeof window === 'undefined') return;
|
|
35
|
+
escapeInstalled = true;
|
|
36
|
+
window.addEventListener(
|
|
37
|
+
'keydown',
|
|
38
|
+
(event) => {
|
|
39
|
+
if (event.key !== 'Escape' || handlerStack.length === 0) return;
|
|
40
|
+
invokeTopHandler();
|
|
41
|
+
event.stopImmediatePropagation();
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
},
|
|
44
|
+
true,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Register before Bloom's `SurfaceHost` mounts so Escape capture runs first. */
|
|
49
|
+
installEscapeHandler();
|
|
50
|
+
|
|
51
|
+
/** Push a handler for one live surface; returns unregister. */
|
|
52
|
+
export function pushSurfaceBackHandler(handler: SurfaceBackHandler): () => void {
|
|
53
|
+
handlerStack.push(handler);
|
|
54
|
+
installAndroidHandler();
|
|
55
|
+
return () => {
|
|
56
|
+
const index = handlerStack.lastIndexOf(handler);
|
|
57
|
+
if (index >= 0) handlerStack.splice(index, 1);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Test-only: invoke the top handler. */
|
|
62
|
+
export function __invokeTopSurfaceBackForTests(): boolean {
|
|
63
|
+
return invokeTopHandler();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Test-only reset. */
|
|
67
|
+
export function __resetSurfaceBackBridgeForTests(): void {
|
|
68
|
+
handlerStack.length = 0;
|
|
69
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { AccountDialogView } from '@oxyhq/core';
|
|
2
|
+
import type { AccountDialogView, FileMetadata } from '@oxyhq/core';
|
|
3
3
|
import type { RouteName } from './routes';
|
|
4
|
+
import type { AvatarCropResult } from '../screens/AvatarCropScreen';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The SDK's typed surface registry — the contract layer the SDK stacks on top of
|
|
@@ -28,7 +29,13 @@ export interface SurfaceRegistry {
|
|
|
28
29
|
LanguageSelector: SurfaceRoute;
|
|
29
30
|
PrivacySettings: SurfaceRoute;
|
|
30
31
|
SearchSettings: SurfaceRoute;
|
|
31
|
-
|
|
32
|
+
/**
|
|
33
|
+
* File picker / manager. In single-select picker mode the surface is
|
|
34
|
+
* dismissed with the picked {@link FileMetadata} (the avatar-picker promise
|
|
35
|
+
* flow); legacy callers that pass an `onSelect`/`onConfirmSelection` callback
|
|
36
|
+
* keep their callback behaviour and this result goes unread.
|
|
37
|
+
*/
|
|
38
|
+
FileManagement: SurfaceRoute<Record<string, unknown>, FileMetadata>;
|
|
32
39
|
HelpSupport: SurfaceRoute;
|
|
33
40
|
FAQ: SurfaceRoute;
|
|
34
41
|
Feedback: SurfaceRoute;
|
|
@@ -53,11 +60,12 @@ export interface SurfaceRegistry {
|
|
|
53
60
|
CreateAccount: SurfaceRoute;
|
|
54
61
|
AccountMembers: SurfaceRoute;
|
|
55
62
|
AccountSettings: SurfaceRoute;
|
|
56
|
-
|
|
63
|
+
/** Square-crop editor. Dismissed with the cropped {@link AvatarCropResult}. */
|
|
64
|
+
AvatarCrop: SurfaceRoute<Record<string, unknown>, AvatarCropResult>;
|
|
57
65
|
Notifications: SurfaceRoute;
|
|
58
66
|
ConnectedApps: SurfaceRoute;
|
|
59
67
|
Preferences: SurfaceRoute;
|
|
60
|
-
/** Unified account switcher + sign-in surface (folded `
|
|
68
|
+
/** Unified account switcher + sign-in surface (folded `OxyAccountDialogScreen` body). */
|
|
61
69
|
AccountDialog: SurfaceRoute<{ initialView?: AccountDialogView }>;
|
|
62
70
|
}
|
|
63
71
|
|
|
@@ -99,22 +107,31 @@ export type SurfacePresentation = 'sheet' | 'center' | 'drawer' | 'fullScreen';
|
|
|
99
107
|
* Per-route surface configuration. Merges the historical `SheetRouteConfig`
|
|
100
108
|
* knobs with the new {@link SurfacePresentation}.
|
|
101
109
|
*
|
|
102
|
-
* NOTE: `scrollable`
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* flush layout) is what actually drives the surface today.
|
|
110
|
+
* NOTE: `scrollable` is LIVE — it is threaded through `bloomOptionsFor` onto the
|
|
111
|
+
* Bloom `Dialog` surface (`scrollable` prop), so a route that owns its own scroll
|
|
112
|
+
* container opts OUT of the Dialog's internal ScrollView. `manualActivation` /
|
|
113
|
+
* `dynamicBackdrop` / `handleComponent` remain informational — reserved for a
|
|
114
|
+
* future Bloom bottom-placement passthrough; the shared `DialogBottomSheet`
|
|
115
|
+
* currently owns pan coordination itself.
|
|
109
116
|
*/
|
|
110
117
|
export interface SurfaceRouteConfig {
|
|
111
118
|
/** Which surface hosts the route. */
|
|
112
119
|
presentation: SurfacePresentation;
|
|
113
120
|
/**
|
|
114
121
|
* When `false`, the route owns its own scroll container (a FlatList /
|
|
115
|
-
* SectionList / VirtualizedList) and the host must not
|
|
122
|
+
* SectionList / VirtualizedList, or its own ScrollView) and the host must not
|
|
123
|
+
* wrap it in a ScrollView. Threaded onto Bloom's `Dialog` via `bloomOptionsFor`.
|
|
116
124
|
*/
|
|
117
125
|
scrollable: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether the surface renders the Dialog's OWN navigation header (sticky
|
|
128
|
+
* gradient nav bar + large collapsing title over the surface's scroll content).
|
|
129
|
+
* `true` for every route screen — screens render NO header of their own and
|
|
130
|
+
* declare their title/subtitle (+ any action slot) via `useSurfaceHeader`.
|
|
131
|
+
* `false` for surfaces with their own chrome (the account dialog, the flagship
|
|
132
|
+
* full-bleed image picker).
|
|
133
|
+
*/
|
|
134
|
+
header: boolean;
|
|
118
135
|
/** Body-pan activation strategy — reserved (owned by Bloom's Dialog surface). */
|
|
119
136
|
manualActivation: boolean;
|
|
120
137
|
/** Drag-proportional backdrop dim — reserved (owned by Bloom's Dialog surface). */
|
|
@@ -127,10 +144,30 @@ export interface SurfaceRouteConfig {
|
|
|
127
144
|
const DEFAULT_SURFACE_CONFIG: SurfaceRouteConfig = {
|
|
128
145
|
presentation: 'sheet',
|
|
129
146
|
scrollable: true,
|
|
147
|
+
header: true,
|
|
130
148
|
manualActivation: true,
|
|
131
149
|
dynamicBackdrop: true,
|
|
132
150
|
};
|
|
133
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Routes that render NO Dialog nav header — they own their chrome:
|
|
154
|
+
* - `AvatarCrop` — its own translucent Cancel / title / Done top bar.
|
|
155
|
+
* - `PaymentGateway` — the payment surface owns its controls.
|
|
156
|
+
* - `WelcomeNewUser` — a full-bleed onboarding wizard with its own step chrome.
|
|
157
|
+
* - `Profile` — a full profile view, no nav-header chrome.
|
|
158
|
+
* (The flagship full-bleed image picker is handled separately below.)
|
|
159
|
+
*
|
|
160
|
+
* `AccountDialog` used to be here — it now uses the SHARED Dialog nav header like
|
|
161
|
+
* every other screen (its per-view title/subtitle + view-back go through
|
|
162
|
+
* `useSurfaceHeader`), so the account/sign-in surface no longer feels bespoke.
|
|
163
|
+
*/
|
|
164
|
+
const HEADERLESS_ROUTES: ReadonlySet<RouteName> = new Set<RouteName>([
|
|
165
|
+
'AvatarCrop',
|
|
166
|
+
'PaymentGateway',
|
|
167
|
+
'WelcomeNewUser',
|
|
168
|
+
'Profile',
|
|
169
|
+
]);
|
|
170
|
+
|
|
134
171
|
/**
|
|
135
172
|
* Predicate matching `FileManagementScreen`'s internal `isImageOnlyPicker`
|
|
136
173
|
* derivation. When the consumer restricts to image MIME types (no videos, no
|
|
@@ -152,17 +189,46 @@ const isFileManagementImageOnlyPicker = (props: Record<string, unknown>): boolea
|
|
|
152
189
|
return blocksVideos && blocksAudio && blocksDocs;
|
|
153
190
|
};
|
|
154
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Routes whose screen owns its OWN scroll container — a FlatList /
|
|
194
|
+
* VirtualizedList (`ConnectedApps`, `TrustLeaderboard`, `FollowersList` /
|
|
195
|
+
* `FollowingList` via `UserListScreen`) or its own vertical `ScrollView`
|
|
196
|
+
* (`FileManagement`). These MUST opt out of the Dialog's internal ScrollView
|
|
197
|
+
* (`scrollable: false`) so there is exactly ONE scroll container — otherwise a
|
|
198
|
+
* VirtualizedList nests inside a plain ScrollView (RN warning) or a nested
|
|
199
|
+
* vertical scroll-in-scroll breaks windowing. Screens with only a HORIZONTAL
|
|
200
|
+
* ScrollView (FAQ's category row, Premium's plan carousel) are NOT listed — a
|
|
201
|
+
* horizontal scroller does not conflict with the Dialog's vertical scroll.
|
|
202
|
+
*/
|
|
203
|
+
const OWN_SCROLL_CONTAINER_ROUTES: ReadonlySet<RouteName> = new Set<RouteName>([
|
|
204
|
+
'FileManagement',
|
|
205
|
+
'ConnectedApps',
|
|
206
|
+
'TrustLeaderboard',
|
|
207
|
+
'FollowersList',
|
|
208
|
+
'FollowingList',
|
|
209
|
+
]);
|
|
210
|
+
|
|
155
211
|
/**
|
|
156
212
|
* Resolve the surface configuration for a route + props. Defaults to the
|
|
157
213
|
* responsive sheet; the image-only FileManagement picker upgrades to a full-bleed
|
|
158
|
-
* `'fullScreen'` surface that owns its own
|
|
214
|
+
* `'fullScreen'` surface, and every route that owns its own scroll container is
|
|
215
|
+
* marked `scrollable: false`.
|
|
159
216
|
*/
|
|
160
217
|
export const getSurfaceConfig = (
|
|
161
218
|
route: RouteName,
|
|
162
219
|
props: Record<string, unknown>,
|
|
163
220
|
): SurfaceRouteConfig => {
|
|
164
221
|
if (route === 'FileManagement' && isFileManagementImageOnlyPicker(props)) {
|
|
165
|
-
|
|
222
|
+
// The full-bleed image picker owns its own translucent top bar — no nav header.
|
|
223
|
+
return { ...DEFAULT_SURFACE_CONFIG, presentation: 'fullScreen', scrollable: false, header: false };
|
|
224
|
+
}
|
|
225
|
+
if (HEADERLESS_ROUTES.has(route)) {
|
|
226
|
+
return { ...DEFAULT_SURFACE_CONFIG, header: false };
|
|
227
|
+
}
|
|
228
|
+
if (OWN_SCROLL_CONTAINER_ROUTES.has(route)) {
|
|
229
|
+
// Own-scroller list screens keep the nav header (static, non-collapsing —
|
|
230
|
+
// there is no Dialog scroll offset to drive the large-title collapse).
|
|
231
|
+
return { ...DEFAULT_SURFACE_CONFIG, scrollable: false };
|
|
166
232
|
}
|
|
167
233
|
return DEFAULT_SURFACE_CONFIG;
|
|
168
234
|
};
|
|
@@ -36,13 +36,31 @@ const SHEET_PLACEMENT = { base: 'bottom', md: 'center' } as const;
|
|
|
36
36
|
/** Full-bleed black canvas for the `'fullScreen'` approximation (image picker). */
|
|
37
37
|
const FULLSCREEN_SURFACE_STYLE: ViewStyle = { backgroundColor: '#000000', overflow: 'hidden' };
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Every SDK screen owns its own background + content padding + scroll region
|
|
41
|
+
* (they were authored for the bare `BottomSheet`). So the shared `Dialog` must
|
|
42
|
+
* NOT add its own `contentPadding` on top (that double-pads) — it owns only the
|
|
43
|
+
* structural chrome: the surface card, the size cap (`maxHeightRatio`) and the
|
|
44
|
+
* scroll boundary. `contentPadding: 0` makes the screen's own padding the single
|
|
45
|
+
* source, matching the image-picker (`fullScreen`) surface.
|
|
46
|
+
*/
|
|
47
|
+
const SDK_SURFACE_CHROME = { contentPadding: 0, maxHeightRatio: 0.9 } as const;
|
|
48
|
+
|
|
39
49
|
/** Map a route's presentation taxonomy onto concrete Bloom `Dialog` options. */
|
|
40
50
|
function bloomOptionsFor(config: SurfaceRouteConfig): PresentOptions {
|
|
51
|
+
// Threaded onto every placement so a route that owns its own scroll container
|
|
52
|
+
// (`scrollable: false`) opts out of the Dialog's internal ScrollView.
|
|
53
|
+
const scrollable = config.scrollable;
|
|
54
|
+
// Nav-header mode marker: turns on the Dialog's OWN sticky gradient nav bar +
|
|
55
|
+
// large collapsing title over its scroll content. The title/subtitle/action
|
|
56
|
+
// slots are contributed at runtime by the mounted screen via `useSurfaceHeader`
|
|
57
|
+
// (resolved in `SurfaceScreen`), so the seed here just enables the scaffold.
|
|
58
|
+
const header = config.header ? { largeTitle: true } : undefined;
|
|
41
59
|
switch (config.presentation) {
|
|
42
60
|
case 'center':
|
|
43
|
-
return { placement: 'center' };
|
|
61
|
+
return { placement: 'center', scrollable, header, ...SDK_SURFACE_CHROME };
|
|
44
62
|
case 'drawer':
|
|
45
|
-
return { placement: { base: 'bottom', md: 'left' } };
|
|
63
|
+
return { placement: { base: 'bottom', md: 'left' }, scrollable, header, ...SDK_SURFACE_CHROME };
|
|
46
64
|
case 'fullScreen':
|
|
47
65
|
// Approximate a full-screen surface with the shared `Dialog`: a tall
|
|
48
66
|
// sheet / large centered card, flush content, a black canvas and
|
|
@@ -53,11 +71,12 @@ function bloomOptionsFor(config: SurfaceRouteConfig): PresentOptions {
|
|
|
53
71
|
maxWidth: 640,
|
|
54
72
|
maxHeightRatio: 0.9,
|
|
55
73
|
dismissOnBackdrop: false,
|
|
74
|
+
scrollable,
|
|
56
75
|
style: FULLSCREEN_SURFACE_STYLE,
|
|
57
76
|
panelStyle: FULLSCREEN_SURFACE_STYLE,
|
|
58
77
|
};
|
|
59
78
|
default:
|
|
60
|
-
return { placement: SHEET_PLACEMENT };
|
|
79
|
+
return { placement: SHEET_PLACEMENT, scrollable, header, ...SDK_SURFACE_CHROME };
|
|
61
80
|
}
|
|
62
81
|
}
|
|
63
82
|
|
|
@@ -111,14 +130,23 @@ function presentInternal<K extends RouteName>(
|
|
|
111
130
|
const bloomOpts: PresentOptions = { label: route, ...bloomOptionsFor(config), ...opts };
|
|
112
131
|
|
|
113
132
|
const result = bloomSurfaces.present<SurfaceResult<K>>((surface: SurfaceControls) =>
|
|
114
|
-
createElement(SurfaceScreen, {
|
|
133
|
+
createElement(SurfaceScreen, {
|
|
134
|
+
navStack,
|
|
135
|
+
surface,
|
|
136
|
+
presentation: config.presentation,
|
|
137
|
+
dismissOnBackdrop: bloomOpts.dismissOnBackdrop ?? true,
|
|
138
|
+
}),
|
|
115
139
|
bloomOpts,
|
|
116
140
|
);
|
|
117
141
|
|
|
118
142
|
const instance: SurfaceInstance<K> = {
|
|
119
143
|
route,
|
|
120
144
|
presentation: config.presentation,
|
|
121
|
-
navigate: (nextRoute, nextProps) =>
|
|
145
|
+
navigate: (nextRoute, nextProps) => {
|
|
146
|
+
const top = navStack.getTop();
|
|
147
|
+
if (top.route === nextRoute) navStack.replace(nextRoute, nextProps);
|
|
148
|
+
else navStack.navigate(nextRoute, nextProps);
|
|
149
|
+
},
|
|
122
150
|
replace: (nextRoute, nextProps) => navStack.replace(nextRoute, nextProps),
|
|
123
151
|
goBack: () => navStack.goBack(),
|
|
124
152
|
canGoBack: () => navStack.canGoBack(),
|