@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
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createSurfaceNavStack = createSurfaceNavStack;
|
|
7
|
+
var _vanilla = require("zustand/vanilla");
|
|
8
|
+
/**
|
|
9
|
+
* Per-surface route history — the NAV-WITHIN axis.
|
|
10
|
+
*
|
|
11
|
+
* Bloom's surface stack owns DEPTH (a surface presented on top of another). This
|
|
12
|
+
* store owns the ORTHOGONAL axis: the route history INSIDE one SDK surface. Each
|
|
13
|
+
* SDK surface holds its own {@link SurfaceNavStack}; `navigate`/`replace`/`goBack`
|
|
14
|
+
* mutate it and the SAME Bloom surface re-renders its content from the new top
|
|
15
|
+
* frame. It is the per-surface reincarnation of the old global
|
|
16
|
+
* `bottomSheetStore`'s `history` + `currentStep`.
|
|
17
|
+
*
|
|
18
|
+
* `closing`/`closeResult` model a pending dismissal: the surface's `SurfaceScreen`
|
|
19
|
+
* watches them and calls the Bloom surface's `dismiss(result)` from an effect —
|
|
20
|
+
* so a dismiss requested BEFORE the surface has mounted still resolves once it
|
|
21
|
+
* does, with no controls-capture race and no render-phase side effect.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** One frame in a surface's route history. */
|
|
25
|
+
|
|
26
|
+
function makeFrame(route, props) {
|
|
27
|
+
const resolved = props ?? {};
|
|
28
|
+
const step = typeof resolved.initialStep === 'number' ? resolved.initialStep : 0;
|
|
29
|
+
return {
|
|
30
|
+
route,
|
|
31
|
+
props: resolved,
|
|
32
|
+
step
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function createSurfaceNavStack(route, props) {
|
|
36
|
+
const store = (0, _vanilla.createStore)(() => ({
|
|
37
|
+
frames: [makeFrame(route, props)],
|
|
38
|
+
closing: false,
|
|
39
|
+
closeResult: undefined
|
|
40
|
+
}));
|
|
41
|
+
const getTop = () => {
|
|
42
|
+
const {
|
|
43
|
+
frames
|
|
44
|
+
} = store.getState();
|
|
45
|
+
return frames[frames.length - 1];
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
store,
|
|
49
|
+
getTop,
|
|
50
|
+
navigate(nextRoute, nextProps) {
|
|
51
|
+
store.setState(state => ({
|
|
52
|
+
frames: [...state.frames, makeFrame(nextRoute, nextProps)]
|
|
53
|
+
}));
|
|
54
|
+
},
|
|
55
|
+
replace(nextRoute, nextProps) {
|
|
56
|
+
store.setState(state => ({
|
|
57
|
+
frames: [...state.frames.slice(0, -1), makeFrame(nextRoute, nextProps)]
|
|
58
|
+
}));
|
|
59
|
+
},
|
|
60
|
+
goBack() {
|
|
61
|
+
const {
|
|
62
|
+
frames
|
|
63
|
+
} = store.getState();
|
|
64
|
+
if (frames.length <= 1) return false;
|
|
65
|
+
store.setState({
|
|
66
|
+
frames: frames.slice(0, -1)
|
|
67
|
+
});
|
|
68
|
+
return true;
|
|
69
|
+
},
|
|
70
|
+
canGoBack() {
|
|
71
|
+
const {
|
|
72
|
+
frames
|
|
73
|
+
} = store.getState();
|
|
74
|
+
return frames.length > 1 || (frames[frames.length - 1]?.step ?? 0) > 0;
|
|
75
|
+
},
|
|
76
|
+
setStep(step) {
|
|
77
|
+
store.setState(state => {
|
|
78
|
+
const frames = state.frames.slice();
|
|
79
|
+
const index = frames.length - 1;
|
|
80
|
+
frames[index] = {
|
|
81
|
+
...frames[index],
|
|
82
|
+
step
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
frames
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
requestDismiss(result) {
|
|
90
|
+
if (store.getState().closing) return;
|
|
91
|
+
store.setState({
|
|
92
|
+
closing: true,
|
|
93
|
+
closeResult: result
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=surfaceNavStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_vanilla","require","makeFrame","route","props","resolved","step","initialStep","createSurfaceNavStack","store","createStore","frames","closing","closeResult","undefined","getTop","getState","length","navigate","nextRoute","nextProps","setState","state","replace","slice","goBack","canGoBack","setStep","index","requestDismiss","result"],"sourceRoot":"../../../../src","sources":["ui/navigation/surfaceNavStack.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAmCA,SAASC,SAASA,CAACC,KAAgB,EAAEC,KAA+B,EAAY;EAC9E,MAAMC,QAAQ,GAAGD,KAAK,IAAI,CAAC,CAAC;EAC5B,MAAME,IAAI,GAAG,OAAOD,QAAQ,CAACE,WAAW,KAAK,QAAQ,GAAGF,QAAQ,CAACE,WAAW,GAAG,CAAC;EAChF,OAAO;IAAEJ,KAAK;IAAEC,KAAK,EAAEC,QAAQ;IAAEC;EAAK,CAAC;AACzC;AAEO,SA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C/C,OAAO,IAAI;IACb,CAAC;IACDE,SAASA,CAAA,EAAG;MACV,MAAM;QAAEf;MAAO,CAAC,GAAGF,KAAK,CAACO,QAAQ,CAAC,CAAC;MACnC,OAAOL,MAAM,CAACM,MAAM,GAAG,CAAC,IAAI,CAACN,MAAM,CAACA,MAAM,CAACM,MAAM,GAAG,CAAC,CAAC,EAAEX,IAAI,IAAI,CAAC,IAAI,CAAC;IACxE,CAAC;IACDqB,OAAOA,CAACrB,IAAI,EAAE;MACZG,KAAK,CAACY,QAAQ,CAAEC,KAAK,IAAK;QACxB,MAAMX,MAAM,GAAGW,KAAK,CAACX,MAAM,CAACa,KAAK,CAAC,CAAC;QACnC,MAAMI,KAAK,GAAGjB,MAAM,CAACM,MAAM,GAAG,CAAC;QAC/BN,MAAM,CAACiB,KAAK,CAAC,GAAG;UAAE,GAAGjB,MAAM,CAACiB,KAAK,CAAC;UAAEtB;QAAK,CAAC;QAC1C,OAAO;UAAEK;QAAO,CAAC;MACnB,CAAC,CAAC;IACJ,CAAC;IACDkB,cAAcA,CAACC,MAAM,EAAE;MACrB,IAAIrB,KAAK,CAACO,QAAQ,CAAC,CAAC,CAACJ,OAAO,EAAE;MAC9BH,KAAK,CAACY,QAAQ,CAAC;QAAET,OAAO,EAAE,IAAI;QAAEC,WAAW,EAAEiB;MAAO,CAAC,CAAC;IACxD;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSurfacePresentation = exports.getSurfaceConfig = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* The SDK's typed surface registry — the contract layer the SDK stacks on top of
|
|
9
|
+
* Bloom's content-agnostic surface stack (`@oxyhq/bloom/surfaces`). One entry per
|
|
10
|
+
* route describing its `props` (what the presenter must pass) and its `result`
|
|
11
|
+
* (what awaiting `present()` resolves with). Hand-maintained, contract-first:
|
|
12
|
+
* adding a route here is the single edit that types it end to end.
|
|
13
|
+
*
|
|
14
|
+
* For P1 most routes keep permissive `Record<string, unknown>` props + a `void`
|
|
15
|
+
* result — the historical grab-bag `showBottomSheet`/`navigate` props are
|
|
16
|
+
* unchanged. Later phases tighten individual routes without changing this shape.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** One registry entry: the props a route is presented with + its dismissal result. */
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Compile-time guard: the registry keys must be EXACTLY the route names. If a new
|
|
23
|
+
* `RouteName` is added without a registry entry (or vice-versa) this alias
|
|
24
|
+
* resolves to `never` and the `satisfies` assertion below fails to type-check.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const _registryCoversRoutes = true;
|
|
28
|
+
void _registryCoversRoutes;
|
|
29
|
+
|
|
30
|
+
/** Typed props a route is presented with. */
|
|
31
|
+
|
|
32
|
+
/** What awaiting a route's `present()` resolves with when it is dismissed. */
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* How a surface renders — the SDK's presentation taxonomy. Each value maps to a
|
|
36
|
+
* concrete Bloom `Dialog` placement/chrome in `surfaces.ts`:
|
|
37
|
+
*
|
|
38
|
+
* - `'sheet'` → responsive `{ base: 'bottom', md: 'center' }` (the default:
|
|
39
|
+
* a bottom sheet on narrow viewports, a centered card on wide).
|
|
40
|
+
* - `'center'` → a plain centered modal at every width.
|
|
41
|
+
* - `'drawer'` → responsive `{ base: 'bottom', md: 'left' }` side drawer.
|
|
42
|
+
* - `'fullScreen'` → approximated with the shared `Dialog`: a full-height sheet /
|
|
43
|
+
* large centered card, flush (`contentPadding: 0`) content, a
|
|
44
|
+
* black canvas and programmatic-only dismiss (the flagship
|
|
45
|
+
* image picker). A real Bloom `'fullScreen'` placement is a
|
|
46
|
+
* follow-up if the approximation reads wrong on device.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Per-route surface configuration. Merges the historical `SheetRouteConfig`
|
|
51
|
+
* knobs with the new {@link SurfacePresentation}.
|
|
52
|
+
*
|
|
53
|
+
* NOTE: `scrollable` is LIVE — it is threaded through `bloomOptionsFor` onto the
|
|
54
|
+
* Bloom `Dialog` surface (`scrollable` prop), so a route that owns its own scroll
|
|
55
|
+
* container opts OUT of the Dialog's internal ScrollView. `manualActivation` /
|
|
56
|
+
* `dynamicBackdrop` / `handleComponent` remain informational — reserved for a
|
|
57
|
+
* future Bloom bottom-placement passthrough; the shared `DialogBottomSheet`
|
|
58
|
+
* currently owns pan coordination itself.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/** Defaults shared across all routes — the canonical responsive "sheet". */
|
|
62
|
+
const DEFAULT_SURFACE_CONFIG = {
|
|
63
|
+
presentation: 'sheet',
|
|
64
|
+
scrollable: true,
|
|
65
|
+
header: true,
|
|
66
|
+
manualActivation: true,
|
|
67
|
+
dynamicBackdrop: true
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Routes that render NO Dialog nav header — they own their chrome:
|
|
72
|
+
* - `AvatarCrop` — its own translucent Cancel / title / Done top bar.
|
|
73
|
+
* - `PaymentGateway` — the payment surface owns its controls.
|
|
74
|
+
* - `WelcomeNewUser` — a full-bleed onboarding wizard with its own step chrome.
|
|
75
|
+
* - `Profile` — a full profile view, no nav-header chrome.
|
|
76
|
+
* (The flagship full-bleed image picker is handled separately below.)
|
|
77
|
+
*
|
|
78
|
+
* `AccountDialog` used to be here — it now uses the SHARED Dialog nav header like
|
|
79
|
+
* every other screen (its per-view title/subtitle + view-back go through
|
|
80
|
+
* `useSurfaceHeader`), so the account/sign-in surface no longer feels bespoke.
|
|
81
|
+
*/
|
|
82
|
+
const HEADERLESS_ROUTES = new Set(['AvatarCrop', 'PaymentGateway', 'WelcomeNewUser', 'Profile']);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Predicate matching `FileManagementScreen`'s internal `isImageOnlyPicker`
|
|
86
|
+
* derivation. When the consumer restricts to image MIME types (no videos, no
|
|
87
|
+
* audio, no documents), FileManagement renders the flagship `PhotoPickerView`,
|
|
88
|
+
* which owns its own FlatList and reads best as a full-bleed picker. Kept in sync
|
|
89
|
+
* with `FileManagementScreen` — both check the same disabled MIME type families.
|
|
90
|
+
*/
|
|
91
|
+
const isFileManagementImageOnlyPicker = props => {
|
|
92
|
+
if (!props.selectMode) return false;
|
|
93
|
+
const disabled = props.disabledMimeTypes;
|
|
94
|
+
if (!Array.isArray(disabled) || disabled.length === 0) return false;
|
|
95
|
+
const has = predicate => disabled.some(mt => typeof mt === 'string' && predicate(mt));
|
|
96
|
+
const blocksVideos = has(mt => mt === 'video/' || mt.startsWith('video/'));
|
|
97
|
+
const blocksAudio = has(mt => mt === 'audio/' || mt.startsWith('audio/'));
|
|
98
|
+
const blocksDocs = has(mt => mt === 'application/pdf' || mt === 'application/' || mt.startsWith('application/'));
|
|
99
|
+
return blocksVideos && blocksAudio && blocksDocs;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Routes whose screen owns its OWN scroll container — a FlatList /
|
|
104
|
+
* VirtualizedList (`ConnectedApps`, `TrustLeaderboard`, `FollowersList` /
|
|
105
|
+
* `FollowingList` via `UserListScreen`) or its own vertical `ScrollView`
|
|
106
|
+
* (`FileManagement`). These MUST opt out of the Dialog's internal ScrollView
|
|
107
|
+
* (`scrollable: false`) so there is exactly ONE scroll container — otherwise a
|
|
108
|
+
* VirtualizedList nests inside a plain ScrollView (RN warning) or a nested
|
|
109
|
+
* vertical scroll-in-scroll breaks windowing. Screens with only a HORIZONTAL
|
|
110
|
+
* ScrollView (FAQ's category row, Premium's plan carousel) are NOT listed — a
|
|
111
|
+
* horizontal scroller does not conflict with the Dialog's vertical scroll.
|
|
112
|
+
*/
|
|
113
|
+
const OWN_SCROLL_CONTAINER_ROUTES = new Set(['FileManagement', 'ConnectedApps', 'TrustLeaderboard', 'FollowersList', 'FollowingList']);
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Resolve the surface configuration for a route + props. Defaults to the
|
|
117
|
+
* responsive sheet; the image-only FileManagement picker upgrades to a full-bleed
|
|
118
|
+
* `'fullScreen'` surface, and every route that owns its own scroll container is
|
|
119
|
+
* marked `scrollable: false`.
|
|
120
|
+
*/
|
|
121
|
+
const getSurfaceConfig = (route, props) => {
|
|
122
|
+
if (route === 'FileManagement' && isFileManagementImageOnlyPicker(props)) {
|
|
123
|
+
// The full-bleed image picker owns its own translucent top bar — no nav header.
|
|
124
|
+
return {
|
|
125
|
+
...DEFAULT_SURFACE_CONFIG,
|
|
126
|
+
presentation: 'fullScreen',
|
|
127
|
+
scrollable: false,
|
|
128
|
+
header: false
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (HEADERLESS_ROUTES.has(route)) {
|
|
132
|
+
return {
|
|
133
|
+
...DEFAULT_SURFACE_CONFIG,
|
|
134
|
+
header: false
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (OWN_SCROLL_CONTAINER_ROUTES.has(route)) {
|
|
138
|
+
// Own-scroller list screens keep the nav header (static, non-collapsing —
|
|
139
|
+
// there is no Dialog scroll offset to drive the large-title collapse).
|
|
140
|
+
return {
|
|
141
|
+
...DEFAULT_SURFACE_CONFIG,
|
|
142
|
+
scrollable: false
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return DEFAULT_SURFACE_CONFIG;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/** Convenience: just the presentation taxonomy for a route + props. */
|
|
149
|
+
exports.getSurfaceConfig = getSurfaceConfig;
|
|
150
|
+
const getSurfacePresentation = (route, props) => getSurfaceConfig(route, props).presentation;
|
|
151
|
+
exports.getSurfacePresentation = getSurfacePresentation;
|
|
152
|
+
//# sourceMappingURL=surfaceRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_registryCoversRoutes","DEFAULT_SURFACE_CONFIG","presentation","scrollable","header","manualActivation","dynamicBackdrop","HEADERLESS_ROUTES","Set","isFileManagementImageOnlyPicker","props","selectMode","disabled","disabledMimeTypes","Array","isArray","length","has","predicate","some","mt","blocksVideos","startsWith","blocksAudio","blocksDocs","OWN_SCROLL_CONTAINER_ROUTES","getSurfaceConfig","route","exports","getSurfacePresentation"],"sourceRoot":"../../../../src","sources":["ui/navigation/surfaceRegistry.ts"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAsDA;AACA;AACA;AACA;AACA;;AAMA,MAAMA,qBAA2C,GAAG,IAAI;AACxD,KAAKA,qBAAqB;;AAE1B;;AAEA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2BA;AACA,MAAMC,sBAA0C,GAAG;EACjDC,YAAY,EAAE,OAAO;EACrBC,UAAU,EAAE,IAAI;EAChBC,MAAM,EAAE,IAAI;EACZC,gBAAgB,EAAE,IAAI;EACtBC,eAAe,EAAE;AACnB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAyC,GAAG,IAAIC,GAAG,CAAY,CACnE,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,CACV,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,+BAA+B,GAAIC,KAA8B,IAAc;EACnF,IAAI,CAACA,KAAK,CAACC,UAAU,EAAE,OAAO,KAAK;EACnC,MAAMC,QAAQ,GAAGF,KAAK,CAACG,iBAAiB;EACxC,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,IAAIA,QAAQ,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,KAAK;EACnE,MAAMC,GAAG,GAAIC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E;IAC1C;IACA;IACA,OAAO;MAAE,GAAG1B,sBAAsB;MAAEE,UAAU,EAAE;IAAM,CAAC;EACzD;EACA,OAAOF,sBAAsB;AAC/B,CAAC;;AAED;AAAA2B,OAAA,CAAAF,gBAAA,GAAAA,gBAAA;AACO,MAAMG,sBAAsB,GAAGA,CACpCF,KAAgB,EAChBjB,KAA8B,KACNgB,gBAAgB,CAACC,KAAK,EAAEjB,KAAK,CAAC,CAACR,YAAY;AAAC0B,OAAA,CAAAC,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.closeAllRouteSurfaces = closeAllRouteSurfaces;
|
|
7
|
+
exports.navigateWithinOrPresent = navigateWithinOrPresent;
|
|
8
|
+
exports.present = present;
|
|
9
|
+
exports.presentDetached = presentDetached;
|
|
10
|
+
exports.presentRoute = presentRoute;
|
|
11
|
+
exports.replaceWithinOrPresent = replaceWithinOrPresent;
|
|
12
|
+
exports.surfaces = void 0;
|
|
13
|
+
exports.topRouteSurface = topRouteSurface;
|
|
14
|
+
exports.useSurfaces = useSurfaces;
|
|
15
|
+
var _react = require("react");
|
|
16
|
+
var _surfaces = require("@oxyhq/bloom/surfaces");
|
|
17
|
+
var _SurfaceScreen = _interopRequireDefault(require("../components/SurfaceScreen.js"));
|
|
18
|
+
var _surfaceRegistry = require("./surfaceRegistry.js");
|
|
19
|
+
var _surfaceNavStack = require("./surfaceNavStack.js");
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
/**
|
|
22
|
+
* The SDK's typed surface API — a route registry layered on top of Bloom's
|
|
23
|
+
* content-agnostic surface stack (`@oxyhq/bloom/surfaces`).
|
|
24
|
+
*
|
|
25
|
+
* `present(route)` opens a NEW Bloom surface (the DEPTH axis) whose content is a
|
|
26
|
+
* {@link SurfaceScreen} driven by the route's own {@link SurfaceNavStack} (the
|
|
27
|
+
* NAV-WITHIN axis). Navigating within that surface mutates its nav stack and
|
|
28
|
+
* re-renders the SAME Bloom surface; presenting stacks another surface on top.
|
|
29
|
+
*
|
|
30
|
+
* Bloom coordinates z-order / backdrop / dismiss across every surface (SDK's and
|
|
31
|
+
* apps'), so nothing clashes.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** Responsive "sheet": bottom sheet on narrow, centered card on wide. */
|
|
35
|
+
const SHEET_PLACEMENT = {
|
|
36
|
+
base: 'bottom',
|
|
37
|
+
md: 'center'
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Full-bleed black canvas for the `'fullScreen'` approximation (image picker). */
|
|
41
|
+
const FULLSCREEN_SURFACE_STYLE = {
|
|
42
|
+
backgroundColor: '#000000',
|
|
43
|
+
overflow: 'hidden'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Every SDK screen owns its own background + content padding + scroll region
|
|
48
|
+
* (they were authored for the bare `BottomSheet`). So the shared `Dialog` must
|
|
49
|
+
* NOT add its own `contentPadding` on top (that double-pads) — it owns only the
|
|
50
|
+
* structural chrome: the surface card, the size cap (`maxHeightRatio`) and the
|
|
51
|
+
* scroll boundary. `contentPadding: 0` makes the screen's own padding the single
|
|
52
|
+
* source, matching the image-picker (`fullScreen`) surface.
|
|
53
|
+
*/
|
|
54
|
+
const SDK_SURFACE_CHROME = {
|
|
55
|
+
contentPadding: 0,
|
|
56
|
+
maxHeightRatio: 0.9
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** Map a route's presentation taxonomy onto concrete Bloom `Dialog` options. */
|
|
60
|
+
function bloomOptionsFor(config) {
|
|
61
|
+
// Threaded onto every placement so a route that owns its own scroll container
|
|
62
|
+
// (`scrollable: false`) opts out of the Dialog's internal ScrollView.
|
|
63
|
+
const scrollable = config.scrollable;
|
|
64
|
+
// Nav-header mode marker: turns on the Dialog's OWN sticky gradient nav bar +
|
|
65
|
+
// large collapsing title over its scroll content. The title/subtitle/action
|
|
66
|
+
// slots are contributed at runtime by the mounted screen via `useSurfaceHeader`
|
|
67
|
+
// (resolved in `SurfaceScreen`), so the seed here just enables the scaffold.
|
|
68
|
+
const header = config.header ? {
|
|
69
|
+
largeTitle: true
|
|
70
|
+
} : undefined;
|
|
71
|
+
switch (config.presentation) {
|
|
72
|
+
case 'center':
|
|
73
|
+
return {
|
|
74
|
+
placement: 'center',
|
|
75
|
+
scrollable,
|
|
76
|
+
header,
|
|
77
|
+
...SDK_SURFACE_CHROME
|
|
78
|
+
};
|
|
79
|
+
case 'drawer':
|
|
80
|
+
return {
|
|
81
|
+
placement: {
|
|
82
|
+
base: 'bottom',
|
|
83
|
+
md: 'left'
|
|
84
|
+
},
|
|
85
|
+
scrollable,
|
|
86
|
+
header,
|
|
87
|
+
...SDK_SURFACE_CHROME
|
|
88
|
+
};
|
|
89
|
+
case 'fullScreen':
|
|
90
|
+
// Approximate a full-screen surface with the shared `Dialog`: a tall
|
|
91
|
+
// sheet / large centered card, flush content, a black canvas and
|
|
92
|
+
// programmatic-only dismiss — matching the shipped image-picker Dialog.
|
|
93
|
+
return {
|
|
94
|
+
placement: SHEET_PLACEMENT,
|
|
95
|
+
contentPadding: 0,
|
|
96
|
+
maxWidth: 640,
|
|
97
|
+
maxHeightRatio: 0.9,
|
|
98
|
+
dismissOnBackdrop: false,
|
|
99
|
+
scrollable,
|
|
100
|
+
style: FULLSCREEN_SURFACE_STYLE,
|
|
101
|
+
panelStyle: FULLSCREEN_SURFACE_STYLE
|
|
102
|
+
};
|
|
103
|
+
default:
|
|
104
|
+
return {
|
|
105
|
+
placement: SHEET_PLACEMENT,
|
|
106
|
+
scrollable,
|
|
107
|
+
header,
|
|
108
|
+
...SDK_SURFACE_CHROME
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A live handle to a presented SDK surface. Exposes DEPTH controls (`dismiss`,
|
|
115
|
+
* `result`) and NAV-WITHIN controls (`navigate`/`replace`/`goBack`/`setStep`) that
|
|
116
|
+
* drive this surface's own nav stack. Held by the `showBottomSheet` adapter (base
|
|
117
|
+
* surface) and by `OxyContext` (the AccountDialog surface).
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The type-erased handle the `showBottomSheet` adapter needs from a tracked
|
|
122
|
+
* surface: what it hosts, and how to drive/dismiss it. Kept result-type-free so
|
|
123
|
+
* the (generic) `SurfaceInstance<K>` never has to be widened into a shared array.
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Active SDK "route" surfaces (the `showBottomSheet` lineage), bottom → top.
|
|
128
|
+
* `present`/`presentRoute` register here; `presentDetached` (AccountDialog) does
|
|
129
|
+
* NOT, so the base-sheet navigation logic never treats the account modal as a
|
|
130
|
+
* navigable base. Entries self-remove when their surface is dismissed.
|
|
131
|
+
*/
|
|
132
|
+
const activeRouteSurfaces = [];
|
|
133
|
+
function presentInternal(route, props, opts, track) {
|
|
134
|
+
const navStack = (0, _surfaceNavStack.createSurfaceNavStack)(route, props);
|
|
135
|
+
const config = (0, _surfaceRegistry.getSurfaceConfig)(route, props);
|
|
136
|
+
const bloomOpts = {
|
|
137
|
+
label: route,
|
|
138
|
+
...bloomOptionsFor(config),
|
|
139
|
+
...opts
|
|
140
|
+
};
|
|
141
|
+
const result = _surfaces.surfaces.present(surface => /*#__PURE__*/(0, _react.createElement)(_SurfaceScreen.default, {
|
|
142
|
+
navStack,
|
|
143
|
+
surface,
|
|
144
|
+
presentation: config.presentation,
|
|
145
|
+
dismissOnBackdrop: bloomOpts.dismissOnBackdrop ?? true
|
|
146
|
+
}), bloomOpts);
|
|
147
|
+
const instance = {
|
|
148
|
+
route,
|
|
149
|
+
presentation: config.presentation,
|
|
150
|
+
navigate: (nextRoute, nextProps) => {
|
|
151
|
+
const top = navStack.getTop();
|
|
152
|
+
if (top.route === nextRoute) navStack.replace(nextRoute, nextProps);else navStack.navigate(nextRoute, nextProps);
|
|
153
|
+
},
|
|
154
|
+
replace: (nextRoute, nextProps) => navStack.replace(nextRoute, nextProps),
|
|
155
|
+
goBack: () => navStack.goBack(),
|
|
156
|
+
canGoBack: () => navStack.canGoBack(),
|
|
157
|
+
setStep: step => navStack.setStep(step),
|
|
158
|
+
dismiss: dismissResult => navStack.requestDismiss(dismissResult),
|
|
159
|
+
result
|
|
160
|
+
};
|
|
161
|
+
if (track) {
|
|
162
|
+
const tracked = {
|
|
163
|
+
route: instance.route,
|
|
164
|
+
presentation: instance.presentation,
|
|
165
|
+
navigate: instance.navigate,
|
|
166
|
+
goBack: instance.goBack,
|
|
167
|
+
dismiss: () => instance.dismiss()
|
|
168
|
+
};
|
|
169
|
+
activeRouteSurfaces.push(tracked);
|
|
170
|
+
result.finally(() => {
|
|
171
|
+
const index = activeRouteSurfaces.indexOf(tracked);
|
|
172
|
+
if (index >= 0) activeRouteSurfaces.splice(index, 1);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return instance;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Present a NEW route surface on top of the stack (the DEPTH axis). Resolves with
|
|
180
|
+
* the value the surface is dismissed with. Registered in the route-surface stack.
|
|
181
|
+
*/
|
|
182
|
+
function present(route, props, opts) {
|
|
183
|
+
return presentInternal(route, props ?? {}, opts, true);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Present a surface that is NOT part of the `showBottomSheet` base-navigation
|
|
188
|
+
* lineage (the AccountDialog modal). Otherwise identical to {@link present}.
|
|
189
|
+
*/
|
|
190
|
+
function presentDetached(route, props, opts) {
|
|
191
|
+
return presentInternal(route, props ?? {}, opts, false);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Untyped present for the adapter, the nav helpers, and the `SurfaceScreen`
|
|
196
|
+
* binding (where the route is a runtime value and its props are already erased).
|
|
197
|
+
*/
|
|
198
|
+
function presentRoute(route, props) {
|
|
199
|
+
return presentInternal(route, props ?? {}, undefined, true);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** The top-most active route surface, or `undefined` when none are open. */
|
|
203
|
+
function topRouteSurface() {
|
|
204
|
+
return activeRouteSurfaces[activeRouteSurfaces.length - 1];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Dismiss every active route surface (the whole `showBottomSheet` session). The
|
|
209
|
+
* AccountDialog is untracked, so it is untouched. Iterates a snapshot because
|
|
210
|
+
* `dismiss` mutates `activeRouteSurfaces` asynchronously as surfaces settle.
|
|
211
|
+
*/
|
|
212
|
+
function closeAllRouteSurfaces() {
|
|
213
|
+
for (const instance of [...activeRouteSurfaces].reverse()) instance.dismiss();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Drill in from a screen: navigate WITHIN the current surface when the target's
|
|
218
|
+
* presentation matches, else present the target as a NEW surface on top (so a
|
|
219
|
+
* sheet screen opening the full-bleed picker gets the right chrome).
|
|
220
|
+
*/
|
|
221
|
+
function navigateWithinOrPresent(currentPresentation, navStack, route, props) {
|
|
222
|
+
const nextProps = props ?? {};
|
|
223
|
+
if ((0, _surfaceRegistry.getSurfacePresentation)(route, nextProps) === currentPresentation) {
|
|
224
|
+
navStack.navigate(route, nextProps);
|
|
225
|
+
} else {
|
|
226
|
+
presentRoute(route, nextProps);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Replace variant of {@link navigateWithinOrPresent}. */
|
|
231
|
+
function replaceWithinOrPresent(currentPresentation, navStack, route, props) {
|
|
232
|
+
const nextProps = props ?? {};
|
|
233
|
+
if ((0, _surfaceRegistry.getSurfacePresentation)(route, nextProps) === currentPresentation) {
|
|
234
|
+
navStack.replace(route, nextProps);
|
|
235
|
+
} else {
|
|
236
|
+
presentRoute(route, nextProps);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* The SDK's imperative surface API (a module singleton). `present` is the typed
|
|
242
|
+
* route presenter; `dismissAll` unwinds the whole session. Not yet exported from
|
|
243
|
+
* the package root — the public `surfaces`/`useSurfaces` API lands in a later
|
|
244
|
+
* phase; for P1 the internal adapters (`showBottomSheet`, `openAccountDialog`)
|
|
245
|
+
* are the only public entry points.
|
|
246
|
+
*/
|
|
247
|
+
const surfaces = exports.surfaces = {
|
|
248
|
+
present: (route, props, opts) => present(route, props, opts).result,
|
|
249
|
+
dismissAll: closeAllRouteSurfaces
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
/** Hook form of {@link surfaces} (stable singleton). */
|
|
253
|
+
function useSurfaces() {
|
|
254
|
+
return surfaces;
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=surfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_surfaces","_SurfaceScreen","_interopRequireDefault","_surfaceRegistry","_surfaceNavStack","e","__esModule","default","SHEET_PLACEMENT","base","md","FULLSCREEN_SURFACE_STYLE","backgroundColor","overflow","SDK_SURFACE_CHROME","contentPadding","maxHeightRatio","bloomOptionsFor","config","scrollable","header","largeTitle","undefined","presentation","placement","maxWidth","dismissOnBackdrop","style","panelStyle","activeRouteSurfaces","presentInternal","route","props","opts","track","navStack","createSurfaceNavStack","getSurfaceConfig","bloomOpts","label","result","bloomSurfaces","present","surface","createElement","SurfaceScreen","instance","navigate","nextRoute","nextProps","top","getTop","replace","goBack","canGoBack","setStep","step","dismiss","dismissResult","requestDismiss","tracked","push","finally","index","indexOf","splice","presentDetached","presentRoute","topRouteSurface","length","closeAllRouteSurfaces","reverse","navigateWithinOrPresent","currentPresentation","getSurfacePresentation","replaceWithinOrPresent","surfaces","exports","dismissAll","useSurfaces"],"sourceRoot":"../../../../src","sources":["ui/navig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