@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,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentType
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
2
|
import type { BaseScreenProps } from '../types/navigation';
|
|
3
3
|
|
|
4
4
|
// Lazy loading: Screens are loaded on-demand to break require cycles
|
|
@@ -42,7 +42,8 @@ export type RouteName =
|
|
|
42
42
|
| 'AvatarCrop' // Square-crop editor presented before avatar upload
|
|
43
43
|
| 'Notifications' // Per-channel notification preferences
|
|
44
44
|
| 'ConnectedApps' // OAuth-authorized third-party apps the user can revoke
|
|
45
|
-
| 'Preferences'
|
|
45
|
+
| 'Preferences' // General user preferences (theme, reduce-motion, etc.)
|
|
46
|
+
| 'AccountDialog'; // Unified account switcher + sign-in surface (OxyAccountDialogScreen body)
|
|
46
47
|
|
|
47
48
|
// Lazy screen loaders - functions that return screen components on-demand
|
|
48
49
|
// This breaks the require cycle by deferring imports until screens are actually needed
|
|
@@ -86,6 +87,10 @@ const screenLoaders: Record<RouteName, () => ComponentType<BaseScreenProps>> = {
|
|
|
86
87
|
Notifications: () => require('../screens/NotificationsScreen').default,
|
|
87
88
|
ConnectedApps: () => require('../screens/ConnectedAppsScreen').default,
|
|
88
89
|
Preferences: () => require('../screens/PreferencesScreen').default,
|
|
90
|
+
// Unified account switcher + sign-in surface. Its body lives in the
|
|
91
|
+
// `OxyAccountDialogScreen` component (folded from the standalone dialog); the
|
|
92
|
+
// surface stack provides the Dialog chrome around it.
|
|
93
|
+
AccountDialog: () => require('../components/OxyAccountDialogScreen').default,
|
|
89
94
|
};
|
|
90
95
|
|
|
91
96
|
// Cache loaded components to avoid re-requiring
|
|
@@ -121,107 +126,3 @@ export const getScreenComponent = (routeName: RouteName): ComponentType<BaseScre
|
|
|
121
126
|
export const isValidRoute = (routeName: string): routeName is RouteName => {
|
|
122
127
|
return routeName in screenLoaders;
|
|
123
128
|
};
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Configuration that BottomSheetRouter applies to the underlying BottomSheet
|
|
127
|
-
* for a given route. Adding new options here is additive — never rename or
|
|
128
|
-
* remove fields without bumping the consumer surface as a breaking change.
|
|
129
|
-
*/
|
|
130
|
-
export interface SheetRouteConfig {
|
|
131
|
-
/**
|
|
132
|
-
* Which surface hosts the route. `'sheet'` (default) renders the screen in
|
|
133
|
-
* the in-tree `BottomSheet`. `'dialog'` renders it in a responsive Bloom
|
|
134
|
-
* `<Dialog>` (bottom-sheet on narrow, centered card on `md+`) — used for the
|
|
135
|
-
* flagship image picker, which reads better as a centered panel on wide
|
|
136
|
-
* viewports than a full-width sheet. `BottomSheetRouter` keeps BOTH surfaces
|
|
137
|
-
* mounted and routes the active screen into exactly one based on this value.
|
|
138
|
-
*/
|
|
139
|
-
presentation: 'sheet' | 'dialog';
|
|
140
|
-
/**
|
|
141
|
-
* When `false`, BottomSheet skips its internal ScrollView and lets the
|
|
142
|
-
* screen own scrolling. Required for screens that render a FlatList,
|
|
143
|
-
* SectionList, or any other VirtualizedList — nesting one inside a
|
|
144
|
-
* plain ScrollView breaks windowing and triggers a RN warning.
|
|
145
|
-
*
|
|
146
|
-
* Ignored for `presentation: 'dialog'` routes — those don't render in the
|
|
147
|
-
* in-tree `BottomSheet` at all.
|
|
148
|
-
*/
|
|
149
|
-
scrollable: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Controls the body-pan activation strategy on the underlying bloom
|
|
152
|
-
* `BottomSheet`. `true` uses RNGH's `manualActivation` with scroll-handoff
|
|
153
|
-
* (recommended for scrollable content — the only RNGH 2.x pattern that
|
|
154
|
-
* doesn't steal vertical events from the inner scroller on Android).
|
|
155
|
-
* `false` uses an always-active body pan that gates on scroll offset.
|
|
156
|
-
*
|
|
157
|
-
* Defaults to `true` for all routes — matches the historical in-tree
|
|
158
|
-
* BottomSheet behavior. Per-route opt-out is possible if a screen needs
|
|
159
|
-
* the always-active pan instead.
|
|
160
|
-
*/
|
|
161
|
-
manualActivation: boolean;
|
|
162
|
-
/**
|
|
163
|
-
* When `true`, the backdrop dims proportionally with drag distance (iOS
|
|
164
|
-
* Photos style). Defaults to `true` for all routes — matches the
|
|
165
|
-
* historical in-tree BottomSheet behavior.
|
|
166
|
-
*/
|
|
167
|
-
dynamicBackdrop: boolean;
|
|
168
|
-
/**
|
|
169
|
-
* Optional custom handle slot. When provided, replaces the default
|
|
170
|
-
* 36×5 pill drag handle. The handle remains unconditionally draggable
|
|
171
|
-
* via the dedicated handle gesture (when `manualActivation` is `true`).
|
|
172
|
-
* Use sparingly — screens should default to the standard handle for
|
|
173
|
-
* platform consistency.
|
|
174
|
-
*/
|
|
175
|
-
handleComponent?: () => ReactNode;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Predicate matching FileManagementScreen's internal `isImageOnlyPicker`
|
|
180
|
-
* derivation. When the consumer restricts to image MIME types (no videos,
|
|
181
|
-
* no audio, no documents), FileManagement renders the flagship PhotoPickerView
|
|
182
|
-
* which owns its own FlatList. The sheet must therefore stop scrolling
|
|
183
|
-
* children. Kept in sync with `FileManagementScreen` — both check the same
|
|
184
|
-
* disabled MIME type families.
|
|
185
|
-
*/
|
|
186
|
-
const isFileManagementImageOnlyPicker = (props: Record<string, unknown>): boolean => {
|
|
187
|
-
if (!props.selectMode) return false;
|
|
188
|
-
const disabled = props.disabledMimeTypes;
|
|
189
|
-
if (!Array.isArray(disabled) || disabled.length === 0) return false;
|
|
190
|
-
const has = (predicate: (mt: string) => boolean): boolean =>
|
|
191
|
-
disabled.some((mt) => typeof mt === 'string' && predicate(mt));
|
|
192
|
-
const blocksVideos = has((mt) => mt === 'video/' || mt.startsWith('video/'));
|
|
193
|
-
const blocksAudio = has((mt) => mt === 'audio/' || mt.startsWith('audio/'));
|
|
194
|
-
const blocksDocs = has(
|
|
195
|
-
(mt) => mt === 'application/pdf' || mt === 'application/' || mt.startsWith('application/'),
|
|
196
|
-
);
|
|
197
|
-
return blocksVideos && blocksAudio && blocksDocs;
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
/** Defaults shared across all routes — preserves the historical in-tree BS UX. */
|
|
201
|
-
const DEFAULT_SHEET_CONFIG: SheetRouteConfig = {
|
|
202
|
-
presentation: 'sheet',
|
|
203
|
-
scrollable: true,
|
|
204
|
-
manualActivation: true,
|
|
205
|
-
dynamicBackdrop: true,
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Returns the bottom-sheet configuration for a route. Defaults match the
|
|
210
|
-
* pre-refactor in-tree `BottomSheet` (scrollable, manualActivation,
|
|
211
|
-
* dynamicBackdrop). Routes opt out per-field as needed.
|
|
212
|
-
*/
|
|
213
|
-
export const getSheetConfig = (
|
|
214
|
-
routeName: RouteName | null,
|
|
215
|
-
screenProps: Record<string, unknown>,
|
|
216
|
-
): SheetRouteConfig => {
|
|
217
|
-
if (!routeName) return DEFAULT_SHEET_CONFIG;
|
|
218
|
-
if (routeName === 'FileManagement' && isFileManagementImageOnlyPicker(screenProps)) {
|
|
219
|
-
// The flagship photo picker renders in a responsive Bloom `<Dialog>`
|
|
220
|
-
// (bottom-sheet on narrow, centered card on `md+`) rather than the
|
|
221
|
-
// in-tree BottomSheet — it owns its own FlatList and reads better as a
|
|
222
|
-
// centered panel on wide viewports. The Dialog surface, not this
|
|
223
|
-
// config's `scrollable`, governs its scrolling.
|
|
224
|
-
return { ...DEFAULT_SHEET_CONFIG, presentation: 'dialog' };
|
|
225
|
-
}
|
|
226
|
-
return DEFAULT_SHEET_CONFIG;
|
|
227
|
-
};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { createStore, type StoreApi } from 'zustand/vanilla';
|
|
2
|
+
import type { RouteName } from './routes';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Per-surface route history — the NAV-WITHIN axis.
|
|
6
|
+
*
|
|
7
|
+
* Bloom's surface stack owns DEPTH (a surface presented on top of another). This
|
|
8
|
+
* store owns the ORTHOGONAL axis: the route history INSIDE one SDK surface. Each
|
|
9
|
+
* SDK surface holds its own {@link SurfaceNavStack}; `navigate`/`replace`/`goBack`
|
|
10
|
+
* mutate it and the SAME Bloom surface re-renders its content from the new top
|
|
11
|
+
* frame. It is the per-surface reincarnation of the old global
|
|
12
|
+
* `bottomSheetStore`'s `history` + `currentStep`.
|
|
13
|
+
*
|
|
14
|
+
* `closing`/`closeResult` model a pending dismissal: the surface's `SurfaceScreen`
|
|
15
|
+
* watches them and calls the Bloom surface's `dismiss(result)` from an effect —
|
|
16
|
+
* so a dismiss requested BEFORE the surface has mounted still resolves once it
|
|
17
|
+
* does, with no controls-capture race and no render-phase side effect.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** One frame in a surface's route history. */
|
|
21
|
+
export interface NavFrame {
|
|
22
|
+
route: RouteName;
|
|
23
|
+
props: Record<string, unknown>;
|
|
24
|
+
/** Current wizard step for step-based screens (seeded from `props.initialStep`). */
|
|
25
|
+
step: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface NavStackState {
|
|
29
|
+
/** Bottom → top; the last frame is the visible screen. */
|
|
30
|
+
frames: NavFrame[];
|
|
31
|
+
/** Flipped once a dismiss is requested; the host resolves the Bloom surface. */
|
|
32
|
+
closing: boolean;
|
|
33
|
+
/** The value the surface's `present()` promise resolves with on dismissal. */
|
|
34
|
+
closeResult: unknown;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface SurfaceNavStack {
|
|
38
|
+
store: StoreApi<NavStackState>;
|
|
39
|
+
/** Drill in: push a new frame. */
|
|
40
|
+
navigate(route: RouteName, props?: Record<string, unknown>): void;
|
|
41
|
+
/** Swap the top frame in place (no history entry). */
|
|
42
|
+
replace(route: RouteName, props?: Record<string, unknown>): void;
|
|
43
|
+
/** Pop one frame. Returns `false` when already at the root frame. */
|
|
44
|
+
goBack(): boolean;
|
|
45
|
+
/** Whether a back is possible (a deeper frame OR a prior wizard step). */
|
|
46
|
+
canGoBack(): boolean;
|
|
47
|
+
/** Set the current frame's wizard step. */
|
|
48
|
+
setStep(step: number): void;
|
|
49
|
+
/** Request dismissal of the whole surface, resolving its promise with `result`. */
|
|
50
|
+
requestDismiss(result?: unknown): void;
|
|
51
|
+
/** The current (top) frame. */
|
|
52
|
+
getTop(): NavFrame;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function makeFrame(route: RouteName, props?: Record<string, unknown>): NavFrame {
|
|
56
|
+
const resolved = props ?? {};
|
|
57
|
+
const step = typeof resolved.initialStep === 'number' ? resolved.initialStep : 0;
|
|
58
|
+
return { route, props: resolved, step };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function createSurfaceNavStack(
|
|
62
|
+
route: RouteName,
|
|
63
|
+
props?: Record<string, unknown>,
|
|
64
|
+
): SurfaceNavStack {
|
|
65
|
+
const store = createStore<NavStackState>(() => ({
|
|
66
|
+
frames: [makeFrame(route, props)],
|
|
67
|
+
closing: false,
|
|
68
|
+
closeResult: undefined,
|
|
69
|
+
}));
|
|
70
|
+
|
|
71
|
+
const getTop = (): NavFrame => {
|
|
72
|
+
const { frames } = store.getState();
|
|
73
|
+
return frames[frames.length - 1];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
store,
|
|
78
|
+
getTop,
|
|
79
|
+
navigate(nextRoute, nextProps) {
|
|
80
|
+
store.setState((state) => ({ frames: [...state.frames, makeFrame(nextRoute, nextProps)] }));
|
|
81
|
+
},
|
|
82
|
+
replace(nextRoute, nextProps) {
|
|
83
|
+
store.setState((state) => ({
|
|
84
|
+
frames: [...state.frames.slice(0, -1), makeFrame(nextRoute, nextProps)],
|
|
85
|
+
}));
|
|
86
|
+
},
|
|
87
|
+
goBack() {
|
|
88
|
+
const { frames } = store.getState();
|
|
89
|
+
if (frames.length <= 1) return false;
|
|
90
|
+
store.setState({ frames: frames.slice(0, -1) });
|
|
91
|
+
return true;
|
|
92
|
+
},
|
|
93
|
+
canGoBack() {
|
|
94
|
+
const { frames } = store.getState();
|
|
95
|
+
return frames.length > 1 || (frames[frames.length - 1]?.step ?? 0) > 0;
|
|
96
|
+
},
|
|
97
|
+
setStep(step) {
|
|
98
|
+
store.setState((state) => {
|
|
99
|
+
const frames = state.frames.slice();
|
|
100
|
+
const index = frames.length - 1;
|
|
101
|
+
frames[index] = { ...frames[index], step };
|
|
102
|
+
return { frames };
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
requestDismiss(result) {
|
|
106
|
+
if (store.getState().closing) return;
|
|
107
|
+
store.setState({ closing: true, closeResult: result });
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AccountDialogView, FileMetadata } from '@oxyhq/core';
|
|
3
|
+
import type { RouteName } from './routes';
|
|
4
|
+
import type { AvatarCropResult } from '../screens/AvatarCropScreen';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The SDK's typed surface registry — the contract layer the SDK stacks on top of
|
|
8
|
+
* Bloom's content-agnostic surface stack (`@oxyhq/bloom/surfaces`). One entry per
|
|
9
|
+
* route describing its `props` (what the presenter must pass) and its `result`
|
|
10
|
+
* (what awaiting `present()` resolves with). Hand-maintained, contract-first:
|
|
11
|
+
* adding a route here is the single edit that types it end to end.
|
|
12
|
+
*
|
|
13
|
+
* For P1 most routes keep permissive `Record<string, unknown>` props + a `void`
|
|
14
|
+
* result — the historical grab-bag `showBottomSheet`/`navigate` props are
|
|
15
|
+
* unchanged. Later phases tighten individual routes without changing this shape.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** One registry entry: the props a route is presented with + its dismissal result. */
|
|
19
|
+
type SurfaceRoute<Props = Record<string, unknown>, Result = void> = {
|
|
20
|
+
props: Props;
|
|
21
|
+
result: Result;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export interface SurfaceRegistry {
|
|
25
|
+
ManageAccount: SurfaceRoute;
|
|
26
|
+
AccountVerification: SurfaceRoute;
|
|
27
|
+
PaymentGateway: SurfaceRoute;
|
|
28
|
+
Profile: SurfaceRoute;
|
|
29
|
+
LanguageSelector: SurfaceRoute;
|
|
30
|
+
PrivacySettings: SurfaceRoute;
|
|
31
|
+
SearchSettings: SurfaceRoute;
|
|
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>;
|
|
39
|
+
HelpSupport: SurfaceRoute;
|
|
40
|
+
FAQ: SurfaceRoute;
|
|
41
|
+
Feedback: SurfaceRoute;
|
|
42
|
+
LegalDocuments: SurfaceRoute;
|
|
43
|
+
AppInfo: SurfaceRoute;
|
|
44
|
+
PremiumSubscription: SurfaceRoute;
|
|
45
|
+
WelcomeNewUser: SurfaceRoute;
|
|
46
|
+
UserLinks: SurfaceRoute;
|
|
47
|
+
HistoryView: SurfaceRoute;
|
|
48
|
+
SavesCollections: SurfaceRoute;
|
|
49
|
+
EditProfile: SurfaceRoute;
|
|
50
|
+
EditProfileField: SurfaceRoute;
|
|
51
|
+
LearnMoreUsernames: SurfaceRoute;
|
|
52
|
+
TrustCenter: SurfaceRoute;
|
|
53
|
+
TrustLeaderboard: SurfaceRoute;
|
|
54
|
+
TrustRewards: SurfaceRoute;
|
|
55
|
+
TrustRules: SurfaceRoute;
|
|
56
|
+
AboutTrust: SurfaceRoute;
|
|
57
|
+
TrustFAQ: SurfaceRoute;
|
|
58
|
+
FollowersList: SurfaceRoute;
|
|
59
|
+
FollowingList: SurfaceRoute;
|
|
60
|
+
CreateAccount: SurfaceRoute;
|
|
61
|
+
AccountMembers: SurfaceRoute;
|
|
62
|
+
AccountSettings: SurfaceRoute;
|
|
63
|
+
/** Square-crop editor. Dismissed with the cropped {@link AvatarCropResult}. */
|
|
64
|
+
AvatarCrop: SurfaceRoute<Record<string, unknown>, AvatarCropResult>;
|
|
65
|
+
Notifications: SurfaceRoute;
|
|
66
|
+
ConnectedApps: SurfaceRoute;
|
|
67
|
+
Preferences: SurfaceRoute;
|
|
68
|
+
/** Unified account switcher + sign-in surface (folded `OxyAccountDialogScreen` body). */
|
|
69
|
+
AccountDialog: SurfaceRoute<{ initialView?: AccountDialogView }>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Compile-time guard: the registry keys must be EXACTLY the route names. If a new
|
|
74
|
+
* `RouteName` is added without a registry entry (or vice-versa) this alias
|
|
75
|
+
* resolves to `never` and the `satisfies` assertion below fails to type-check.
|
|
76
|
+
*/
|
|
77
|
+
type RegistryCoversRoutes = [RouteName] extends [keyof SurfaceRegistry]
|
|
78
|
+
? [keyof SurfaceRegistry] extends [RouteName]
|
|
79
|
+
? true
|
|
80
|
+
: never
|
|
81
|
+
: never;
|
|
82
|
+
const _registryCoversRoutes: RegistryCoversRoutes = true;
|
|
83
|
+
void _registryCoversRoutes;
|
|
84
|
+
|
|
85
|
+
/** Typed props a route is presented with. */
|
|
86
|
+
export type SurfaceProps<K extends RouteName> = SurfaceRegistry[K]['props'];
|
|
87
|
+
/** What awaiting a route's `present()` resolves with when it is dismissed. */
|
|
88
|
+
export type SurfaceResult<K extends RouteName> = SurfaceRegistry[K]['result'];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* How a surface renders — the SDK's presentation taxonomy. Each value maps to a
|
|
92
|
+
* concrete Bloom `Dialog` placement/chrome in `surfaces.ts`:
|
|
93
|
+
*
|
|
94
|
+
* - `'sheet'` → responsive `{ base: 'bottom', md: 'center' }` (the default:
|
|
95
|
+
* a bottom sheet on narrow viewports, a centered card on wide).
|
|
96
|
+
* - `'center'` → a plain centered modal at every width.
|
|
97
|
+
* - `'drawer'` → responsive `{ base: 'bottom', md: 'left' }` side drawer.
|
|
98
|
+
* - `'fullScreen'` → approximated with the shared `Dialog`: a full-height sheet /
|
|
99
|
+
* large centered card, flush (`contentPadding: 0`) content, a
|
|
100
|
+
* black canvas and programmatic-only dismiss (the flagship
|
|
101
|
+
* image picker). A real Bloom `'fullScreen'` placement is a
|
|
102
|
+
* follow-up if the approximation reads wrong on device.
|
|
103
|
+
*/
|
|
104
|
+
export type SurfacePresentation = 'sheet' | 'center' | 'drawer' | 'fullScreen';
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Per-route surface configuration. Merges the historical `SheetRouteConfig`
|
|
108
|
+
* knobs with the new {@link SurfacePresentation}.
|
|
109
|
+
*
|
|
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.
|
|
116
|
+
*/
|
|
117
|
+
export interface SurfaceRouteConfig {
|
|
118
|
+
/** Which surface hosts the route. */
|
|
119
|
+
presentation: SurfacePresentation;
|
|
120
|
+
/**
|
|
121
|
+
* When `false`, the route owns its own scroll container (a FlatList /
|
|
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`.
|
|
124
|
+
*/
|
|
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;
|
|
135
|
+
/** Body-pan activation strategy — reserved (owned by Bloom's Dialog surface). */
|
|
136
|
+
manualActivation: boolean;
|
|
137
|
+
/** Drag-proportional backdrop dim — reserved (owned by Bloom's Dialog surface). */
|
|
138
|
+
dynamicBackdrop: boolean;
|
|
139
|
+
/** Optional custom drag-handle slot — reserved (owned by Bloom's Dialog surface). */
|
|
140
|
+
handleComponent?: () => ReactNode;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Defaults shared across all routes — the canonical responsive "sheet". */
|
|
144
|
+
const DEFAULT_SURFACE_CONFIG: SurfaceRouteConfig = {
|
|
145
|
+
presentation: 'sheet',
|
|
146
|
+
scrollable: true,
|
|
147
|
+
header: true,
|
|
148
|
+
manualActivation: true,
|
|
149
|
+
dynamicBackdrop: true,
|
|
150
|
+
};
|
|
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
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Predicate matching `FileManagementScreen`'s internal `isImageOnlyPicker`
|
|
173
|
+
* derivation. When the consumer restricts to image MIME types (no videos, no
|
|
174
|
+
* audio, no documents), FileManagement renders the flagship `PhotoPickerView`,
|
|
175
|
+
* which owns its own FlatList and reads best as a full-bleed picker. Kept in sync
|
|
176
|
+
* with `FileManagementScreen` — both check the same disabled MIME type families.
|
|
177
|
+
*/
|
|
178
|
+
const isFileManagementImageOnlyPicker = (props: Record<string, unknown>): boolean => {
|
|
179
|
+
if (!props.selectMode) return false;
|
|
180
|
+
const disabled = props.disabledMimeTypes;
|
|
181
|
+
if (!Array.isArray(disabled) || disabled.length === 0) return false;
|
|
182
|
+
const has = (predicate: (mt: string) => boolean): boolean =>
|
|
183
|
+
disabled.some((mt) => typeof mt === 'string' && predicate(mt));
|
|
184
|
+
const blocksVideos = has((mt) => mt === 'video/' || mt.startsWith('video/'));
|
|
185
|
+
const blocksAudio = has((mt) => mt === 'audio/' || mt.startsWith('audio/'));
|
|
186
|
+
const blocksDocs = has(
|
|
187
|
+
(mt) => mt === 'application/pdf' || mt === 'application/' || mt.startsWith('application/'),
|
|
188
|
+
);
|
|
189
|
+
return blocksVideos && blocksAudio && blocksDocs;
|
|
190
|
+
};
|
|
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
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Resolve the surface configuration for a route + props. Defaults to the
|
|
213
|
+
* responsive sheet; the image-only FileManagement picker upgrades to a full-bleed
|
|
214
|
+
* `'fullScreen'` surface, and every route that owns its own scroll container is
|
|
215
|
+
* marked `scrollable: false`.
|
|
216
|
+
*/
|
|
217
|
+
export const getSurfaceConfig = (
|
|
218
|
+
route: RouteName,
|
|
219
|
+
props: Record<string, unknown>,
|
|
220
|
+
): SurfaceRouteConfig => {
|
|
221
|
+
if (route === 'FileManagement' && isFileManagementImageOnlyPicker(props)) {
|
|
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 };
|
|
232
|
+
}
|
|
233
|
+
return DEFAULT_SURFACE_CONFIG;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/** Convenience: just the presentation taxonomy for a route + props. */
|
|
237
|
+
export const getSurfacePresentation = (
|
|
238
|
+
route: RouteName,
|
|
239
|
+
props: Record<string, unknown>,
|
|
240
|
+
): SurfacePresentation => getSurfaceConfig(route, props).presentation;
|