@oxyhq/services 6.10.7 → 7.0.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 +211 -49
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +25 -4
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenu.js +485 -0
- package/lib/commonjs/ui/components/AccountMenu.js.map +1 -0
- package/lib/commonjs/ui/components/AccountMenuButton.js +120 -0
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +1 -0
- package/lib/commonjs/ui/components/ActingAsBanner.js +2 -2
- package/lib/commonjs/ui/components/ActingAsBanner.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +2 -2
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +2 -2
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/accountMenuRows.js +45 -0
- package/lib/commonjs/ui/components/accountMenuRows.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +5 -5
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +3 -2
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/theming.js +2 -2
- package/lib/commonjs/ui/components/theming.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +211 -21
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +36 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +6 -0
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +138 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +67 -2
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +27 -2
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +13 -2
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +30 -0
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/index.js +132 -85
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +6 -7
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +3 -2
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +202 -0
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +3 -2
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +3 -2
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +7 -4
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +21 -16
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +3 -2
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +7 -4
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -2
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +6 -4
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +780 -0
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/NotificationsScreen.js +175 -0
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +18 -12
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +220 -0
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +14 -10
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +3 -3
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +8 -5
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +6 -4
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +3 -2
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +2 -2
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +3 -2
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +3 -2
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +4 -3
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +3 -2
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/activeAuthuser.js +85 -0
- package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -0
- package/lib/module/index.js +58 -16
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +5 -3
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/AccountMenu.js +480 -0
- package/lib/module/ui/components/AccountMenu.js.map +1 -0
- package/lib/module/ui/components/AccountMenuButton.js +115 -0
- package/lib/module/ui/components/AccountMenuButton.js.map +1 -0
- package/lib/module/ui/components/ActingAsBanner.js +2 -2
- package/lib/module/ui/components/ActingAsBanner.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +1 -1
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +1 -1
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/accountMenuRows.js +41 -0
- package/lib/module/ui/components/accountMenuRows.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/theming.js +1 -1
- package/lib/module/ui/components/theming.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +211 -21
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +36 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationKeys.js +6 -0
- package/lib/module/ui/hooks/mutations/mutationKeys.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +135 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +60 -1
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +24 -0
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +13 -2
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +30 -0
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/index.js +34 -78
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +6 -7
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +198 -0
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -0
- package/lib/module/ui/screens/CreateManagedAccountScreen.js +1 -1
- package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +3 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +6 -2
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +3 -1
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +2 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +775 -0
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -0
- package/lib/module/ui/screens/NotificationsScreen.js +169 -0
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js +9 -3
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +214 -0
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js +4 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +2 -2
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +3 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +2 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +1 -1
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/utils/activeAuthuser.js +79 -0
- package/lib/module/ui/utils/activeAuthuser.js.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +23 -6
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +7 -2
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +23 -0
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +19 -0
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts +27 -0
- package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts +5 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +32 -3
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +10 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +8 -2
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +32 -18
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/{module/ui/screens/AccountOverviewScreen.d.ts → commonjs/ui/screens/ConnectedAppsScreen.d.ts} +1 -1
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
- 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/HistoryViewScreen.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 +13 -0
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/{AccountOverviewScreen.d.ts → NotificationsScreen.d.ts} +1 -1
- package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/{AccountSettingsScreen.d.ts → PreferencesScreen.d.ts} +2 -5
- package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.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/utils/activeAuthuser.d.ts +42 -0
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +23 -6
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +7 -2
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +23 -0
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +19 -0
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts +27 -0
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts +5 -0
- package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +32 -3
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +10 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +8 -2
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +32 -18
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/{AccountSettingsScreen.d.ts → ConnectedAppsScreen.d.ts} +2 -5
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
- 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/HistoryViewScreen.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 +13 -0
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.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/utils/activeAuthuser.d.ts +42 -0
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -0
- package/package.json +20 -9
- package/src/index.ts +141 -47
- package/src/ui/client.ts +7 -2
- package/src/ui/components/AccountMenu.tsx +534 -0
- package/src/ui/components/AccountMenuButton.tsx +113 -0
- package/src/ui/components/ActingAsBanner.tsx +2 -2
- package/src/ui/components/ProfileCard.tsx +1 -1
- package/src/ui/components/StepBasedScreen.tsx +1 -1
- package/src/ui/components/accountMenuRows.ts +60 -0
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
- package/src/ui/components/theming.tsx +1 -1
- package/src/ui/context/OxyContext.tsx +204 -18
- package/src/ui/context/hooks/useAuthOperations.ts +36 -2
- package/src/ui/hooks/mutations/mutationKeys.ts +11 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +154 -2
- package/src/ui/hooks/queries/queryKeys.ts +54 -4
- package/src/ui/hooks/queries/useAccountQueries.ts +25 -1
- package/src/ui/hooks/useAuth.ts +23 -4
- package/src/ui/hooks/useSessionManagement.ts +29 -0
- package/src/ui/index.ts +37 -98
- package/src/ui/navigation/routes.ts +9 -11
- package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
- package/src/ui/screens/ConnectedAppsScreen.tsx +225 -0
- package/src/ui/screens/CreateManagedAccountScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/FAQScreen.tsx +3 -1
- package/src/ui/screens/FeedbackScreen.tsx +6 -10
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +3 -1
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +2 -1
- package/src/ui/screens/ManageAccountScreen.tsx +1102 -0
- package/src/ui/screens/NotificationsScreen.tsx +189 -0
- package/src/ui/screens/PaymentGatewayScreen.tsx +10 -12
- package/src/ui/screens/PreferencesScreen.tsx +263 -0
- package/src/ui/screens/PrivacySettingsScreen.tsx +4 -1
- package/src/ui/screens/ProfileScreen.tsx +2 -2
- package/src/ui/screens/SavesCollectionsScreen.tsx +3 -1
- package/src/ui/screens/SearchSettingsScreen.tsx +2 -1
- package/src/ui/screens/UserLinksScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
- package/src/ui/utils/activeAuthuser.ts +78 -0
- package/lib/commonjs/ui/components/feedback/index.js +0 -54
- package/lib/commonjs/ui/components/feedback/index.js.map +0 -1
- package/lib/commonjs/ui/components/icon/index.js +0 -21
- package/lib/commonjs/ui/components/icon/index.js.map +0 -1
- package/lib/commonjs/ui/components/index.js +0 -104
- package/lib/commonjs/ui/components/index.js.map +0 -1
- package/lib/commonjs/ui/components/modals/index.js +0 -14
- package/lib/commonjs/ui/components/modals/index.js.map +0 -1
- package/lib/commonjs/ui/components/payment/index.js +0 -80
- package/lib/commonjs/ui/components/payment/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/index.js +0 -92
- package/lib/commonjs/ui/hooks/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/mutations/index.js +0 -68
- package/lib/commonjs/ui/hooks/mutations/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/queries/index.js +0 -155
- package/lib/commonjs/ui/hooks/queries/index.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -344
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -724
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +0 -643
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -1029
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +0 -512
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +0 -1
- package/lib/commonjs/ui/styles/index.js +0 -39
- package/lib/commonjs/ui/styles/index.js.map +0 -1
- package/lib/module/ui/components/feedback/index.js +0 -8
- package/lib/module/ui/components/feedback/index.js.map +0 -1
- package/lib/module/ui/components/icon/index.js +0 -5
- package/lib/module/ui/components/icon/index.js.map +0 -1
- package/lib/module/ui/components/index.js +0 -18
- package/lib/module/ui/components/index.js.map +0 -1
- package/lib/module/ui/components/modals/index.js +0 -4
- package/lib/module/ui/components/modals/index.js.map +0 -1
- package/lib/module/ui/components/payment/index.js +0 -10
- package/lib/module/ui/components/payment/index.js.map +0 -1
- package/lib/module/ui/hooks/index.js +0 -11
- package/lib/module/ui/hooks/index.js.map +0 -1
- package/lib/module/ui/hooks/mutations/index.js +0 -15
- package/lib/module/ui/hooks/mutations/index.js.map +0 -1
- package/lib/module/ui/hooks/queries/index.js +0 -26
- package/lib/module/ui/hooks/queries/index.js.map +0 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +0 -339
- package/lib/module/ui/screens/AccountCenterScreen.js.map +0 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +0 -719
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +0 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +0 -638
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +0 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -1024
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +0 -508
- package/lib/module/ui/screens/SessionManagementScreen.js.map +0 -1
- package/lib/module/ui/styles/index.js +0 -6
- package/lib/module/ui/styles/index.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/feedback/index.d.ts +0 -7
- package/lib/typescript/commonjs/ui/components/feedback/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/icon/index.d.ts +0 -4
- package/lib/typescript/commonjs/ui/components/icon/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/index.d.ts +0 -13
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/modals/index.d.ts +0 -2
- package/lib/typescript/commonjs/ui/components/modals/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/payment/index.d.ts +0 -9
- package/lib/typescript/commonjs/ui/components/payment/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/index.d.ts +0 -9
- package/lib/typescript/commonjs/ui/hooks/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts +0 -9
- package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts +0 -13
- package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/styles/index.d.ts +0 -4
- package/lib/typescript/commonjs/ui/styles/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/feedback/index.d.ts +0 -7
- package/lib/typescript/module/ui/components/feedback/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/icon/index.d.ts +0 -4
- package/lib/typescript/module/ui/components/icon/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/index.d.ts +0 -13
- package/lib/typescript/module/ui/components/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/modals/index.d.ts +0 -2
- package/lib/typescript/module/ui/components/modals/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/payment/index.d.ts +0 -9
- package/lib/typescript/module/ui/components/payment/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/index.d.ts +0 -9
- package/lib/typescript/module/ui/hooks/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/mutations/index.d.ts +0 -9
- package/lib/typescript/module/ui/hooks/mutations/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/queries/index.d.ts +0 -13
- package/lib/typescript/module/ui/hooks/queries/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/styles/index.d.ts +0 -4
- package/lib/typescript/module/ui/styles/index.d.ts.map +0 -1
- package/src/ui/components/feedback/index.ts +0 -6
- package/src/ui/components/icon/index.ts +0 -3
- package/src/ui/components/index.ts +0 -15
- package/src/ui/components/modals/index.ts +0 -1
- package/src/ui/components/payment/index.ts +0 -9
- package/src/ui/hooks/index.ts +0 -13
- package/src/ui/hooks/mutations/index.ts +0 -25
- package/src/ui/hooks/queries/index.ts +0 -61
- package/src/ui/screens/AccountCenterScreen.tsx +0 -182
- package/src/ui/screens/AccountOverviewScreen.tsx +0 -696
- package/src/ui/screens/AccountSettingsScreen.tsx +0 -620
- package/src/ui/screens/AccountSwitcherScreen.tsx +0 -1003
- package/src/ui/screens/SessionManagementScreen.tsx +0 -477
- package/src/ui/styles/index.ts +0 -3
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _vectorIcons = require("@expo/vector-icons");
|
|
10
|
+
var _bloom = require("@oxyhq/bloom");
|
|
11
|
+
var _theme = require("@oxyhq/bloom/theme");
|
|
12
|
+
var _Avatar = _interopRequireDefault(require("./Avatar.js"));
|
|
13
|
+
var _OxyContext = require("../context/OxyContext.js");
|
|
14
|
+
var _useI18n = require("../hooks/useI18n.js");
|
|
15
|
+
var _core = require("@oxyhq/core");
|
|
16
|
+
var _accountMenuRows = require("./accountMenuRows.js");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
const isWeb = _reactNative.Platform.OS === 'web';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Reusable account menu modeled after the Google account chooser. Opens from
|
|
23
|
+
* the avatar entry point (`AccountMenuButton`) or any other trigger.
|
|
24
|
+
*
|
|
25
|
+
* Reads everything it needs from `useOxy()` — never receive a session via
|
|
26
|
+
* props. Renders as a popover anchored to the trigger on web, and as a
|
|
27
|
+
* full-width bottom-sheet style modal on native.
|
|
28
|
+
*/
|
|
29
|
+
const AccountMenu = ({
|
|
30
|
+
open,
|
|
31
|
+
onClose,
|
|
32
|
+
onNavigateManage,
|
|
33
|
+
onAddAccount,
|
|
34
|
+
anchor
|
|
35
|
+
}) => {
|
|
36
|
+
const {
|
|
37
|
+
user,
|
|
38
|
+
sessions,
|
|
39
|
+
activeSessionId,
|
|
40
|
+
switchSession,
|
|
41
|
+
logout,
|
|
42
|
+
logoutAll,
|
|
43
|
+
oxyServices
|
|
44
|
+
} = (0, _OxyContext.useOxy)();
|
|
45
|
+
const {
|
|
46
|
+
t,
|
|
47
|
+
locale
|
|
48
|
+
} = (0, _useI18n.useI18n)();
|
|
49
|
+
const bloomTheme = (0, _theme.useTheme)();
|
|
50
|
+
const [busySessionId, setBusySessionId] = (0, _react.useState)(null);
|
|
51
|
+
const [signingOut, setSigningOut] = (0, _react.useState)(false);
|
|
52
|
+
const [signingOutAll, setSigningOutAll] = (0, _react.useState)(false);
|
|
53
|
+
const signOutDialog = (0, _bloom.useDialogControl)();
|
|
54
|
+
const signOutAllDialog = (0, _bloom.useDialogControl)();
|
|
55
|
+
const containerRef = (0, _react.useRef)(null);
|
|
56
|
+
const firstActionRef = (0, _react.useRef)(null);
|
|
57
|
+
const rows = (0, _react.useMemo)(() => (0, _accountMenuRows.buildAccountRows)({
|
|
58
|
+
sessions,
|
|
59
|
+
activeSessionId,
|
|
60
|
+
user,
|
|
61
|
+
locale,
|
|
62
|
+
getAvatarUrl: avatarId => oxyServices.getFileDownloadUrl(avatarId, 'thumb')
|
|
63
|
+
}), [sessions, activeSessionId, user, locale, oxyServices]);
|
|
64
|
+
const activeRow = (0, _react.useMemo)(() => {
|
|
65
|
+
return rows.find(r => r.isActive) ?? null;
|
|
66
|
+
}, [rows]);
|
|
67
|
+
const inactiveRows = (0, _react.useMemo)(() => {
|
|
68
|
+
return rows.filter(r => !r.isActive);
|
|
69
|
+
}, [rows]);
|
|
70
|
+
const handleSwitch = (0, _react.useCallback)(async sessionId => {
|
|
71
|
+
if (sessionId === activeSessionId || busySessionId) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
setBusySessionId(sessionId);
|
|
75
|
+
try {
|
|
76
|
+
await switchSession(sessionId);
|
|
77
|
+
_bloom.toast.success(t('accountSwitcher.toasts.switchSuccess') || 'Switched account');
|
|
78
|
+
onClose();
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (!__DEV__) {
|
|
81
|
+
_core.logger.warn('Switch account failed', {
|
|
82
|
+
component: 'AccountMenu'
|
|
83
|
+
}, error);
|
|
84
|
+
}
|
|
85
|
+
_bloom.toast.error(t('accountSwitcher.toasts.switchFailed') || 'Failed to switch account');
|
|
86
|
+
} finally {
|
|
87
|
+
setBusySessionId(null);
|
|
88
|
+
}
|
|
89
|
+
}, [activeSessionId, busySessionId, switchSession, t, onClose]);
|
|
90
|
+
const performSignOut = (0, _react.useCallback)(async () => {
|
|
91
|
+
if (signingOut) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
setSigningOut(true);
|
|
95
|
+
try {
|
|
96
|
+
await logout();
|
|
97
|
+
_bloom.toast.success(t('common.actions.signedOut') || 'Signed out');
|
|
98
|
+
onClose();
|
|
99
|
+
} catch (error) {
|
|
100
|
+
_core.logger.warn('Sign out failed', {
|
|
101
|
+
component: 'AccountMenu'
|
|
102
|
+
}, error);
|
|
103
|
+
_bloom.toast.error(t('common.errors.signOutFailed') || 'Failed to sign out');
|
|
104
|
+
} finally {
|
|
105
|
+
setSigningOut(false);
|
|
106
|
+
}
|
|
107
|
+
}, [signingOut, logout, t, onClose]);
|
|
108
|
+
const performSignOutAll = (0, _react.useCallback)(async () => {
|
|
109
|
+
if (signingOutAll) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
setSigningOutAll(true);
|
|
113
|
+
try {
|
|
114
|
+
await logoutAll();
|
|
115
|
+
_bloom.toast.success(t('accountSwitcher.toasts.signOutAllSuccess') || 'Signed out of all accounts');
|
|
116
|
+
onClose();
|
|
117
|
+
} catch (error) {
|
|
118
|
+
_core.logger.warn('Sign out all failed', {
|
|
119
|
+
component: 'AccountMenu'
|
|
120
|
+
}, error);
|
|
121
|
+
_bloom.toast.error(t('common.errors.signOutAllFailed') || 'Failed to sign out of all accounts');
|
|
122
|
+
} finally {
|
|
123
|
+
setSigningOutAll(false);
|
|
124
|
+
}
|
|
125
|
+
}, [signingOutAll, logoutAll, t, onClose]);
|
|
126
|
+
|
|
127
|
+
// Escape-to-close + focus management (web only).
|
|
128
|
+
(0, _react.useEffect)(() => {
|
|
129
|
+
if (!open || !isWeb || typeof document === 'undefined') {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const onKey = event => {
|
|
133
|
+
if (event.key === 'Escape') {
|
|
134
|
+
event.stopPropagation();
|
|
135
|
+
onClose();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
document.addEventListener('keydown', onKey, true);
|
|
139
|
+
return () => document.removeEventListener('keydown', onKey, true);
|
|
140
|
+
}, [open, onClose]);
|
|
141
|
+
if (!open) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
const overlayStyles = isWeb ? styles.webOverlay : styles.nativeOverlay;
|
|
145
|
+
const panelStyles = isWeb ? [styles.panelBase, styles.panelWeb, anchor ? {
|
|
146
|
+
top: anchor.top,
|
|
147
|
+
right: anchor.right
|
|
148
|
+
} : {
|
|
149
|
+
top: 64,
|
|
150
|
+
right: 16
|
|
151
|
+
}, {
|
|
152
|
+
backgroundColor: bloomTheme.colors.background,
|
|
153
|
+
borderColor: bloomTheme.colors.border
|
|
154
|
+
}] : [styles.panelBase, styles.panelNative, {
|
|
155
|
+
backgroundColor: bloomTheme.colors.background
|
|
156
|
+
}];
|
|
157
|
+
const content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
158
|
+
ref: containerRef,
|
|
159
|
+
style: panelStyles,
|
|
160
|
+
accessibilityRole: "menu",
|
|
161
|
+
accessibilityLabel: t('accountMenu.label') || 'Account menu',
|
|
162
|
+
children: [activeRow ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
163
|
+
style: styles.header,
|
|
164
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
165
|
+
uri: activeRow.avatarUri,
|
|
166
|
+
name: activeRow.displayName,
|
|
167
|
+
size: 64
|
|
168
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
169
|
+
style: [styles.headerName, {
|
|
170
|
+
color: bloomTheme.colors.text
|
|
171
|
+
}],
|
|
172
|
+
numberOfLines: 1,
|
|
173
|
+
children: activeRow.displayName
|
|
174
|
+
}), activeRow.secondary ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
175
|
+
style: [styles.headerSecondary, {
|
|
176
|
+
color: bloomTheme.colors.textSecondary
|
|
177
|
+
}],
|
|
178
|
+
numberOfLines: 1,
|
|
179
|
+
children: activeRow.secondary
|
|
180
|
+
}) : null]
|
|
181
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
182
|
+
style: styles.header,
|
|
183
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
184
|
+
style: [styles.headerName, {
|
|
185
|
+
color: bloomTheme.colors.text
|
|
186
|
+
}],
|
|
187
|
+
children: t('common.status.notSignedIn') || 'Not signed in'
|
|
188
|
+
})
|
|
189
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
190
|
+
ref: firstActionRef,
|
|
191
|
+
accessibilityRole: "menuitem",
|
|
192
|
+
accessibilityLabel: t('accountMenu.manage') || 'Manage your Oxy Account',
|
|
193
|
+
style: [styles.primaryButton, {
|
|
194
|
+
borderColor: bloomTheme.colors.border
|
|
195
|
+
}],
|
|
196
|
+
onPress: () => {
|
|
197
|
+
onClose();
|
|
198
|
+
onNavigateManage();
|
|
199
|
+
},
|
|
200
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
201
|
+
style: [styles.primaryButtonText, {
|
|
202
|
+
color: bloomTheme.colors.primary
|
|
203
|
+
}],
|
|
204
|
+
children: t('accountMenu.manage') || 'Manage your Oxy Account'
|
|
205
|
+
})
|
|
206
|
+
}), rows.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
207
|
+
style: styles.list,
|
|
208
|
+
contentContainerStyle: styles.listContent,
|
|
209
|
+
showsVerticalScrollIndicator: false,
|
|
210
|
+
children: rows.map(row => {
|
|
211
|
+
const isBusy = busySessionId === row.sessionId;
|
|
212
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
213
|
+
accessibilityRole: "menuitem",
|
|
214
|
+
accessibilityLabel: row.displayName,
|
|
215
|
+
accessibilityState: {
|
|
216
|
+
selected: row.isActive
|
|
217
|
+
},
|
|
218
|
+
onPress: () => handleSwitch(row.sessionId),
|
|
219
|
+
disabled: row.isActive || isBusy,
|
|
220
|
+
style: [styles.row, row.isActive && {
|
|
221
|
+
backgroundColor: bloomTheme.colors.primarySubtle
|
|
222
|
+
}],
|
|
223
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
224
|
+
uri: row.avatarUri,
|
|
225
|
+
name: row.displayName,
|
|
226
|
+
size: 36
|
|
227
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
228
|
+
style: styles.rowInfo,
|
|
229
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
230
|
+
style: [styles.rowName, {
|
|
231
|
+
color: bloomTheme.colors.text
|
|
232
|
+
}],
|
|
233
|
+
numberOfLines: 1,
|
|
234
|
+
children: row.displayName
|
|
235
|
+
}), row.secondary ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
236
|
+
style: [styles.rowSecondary, {
|
|
237
|
+
color: bloomTheme.colors.textSecondary
|
|
238
|
+
}],
|
|
239
|
+
numberOfLines: 1,
|
|
240
|
+
children: row.secondary
|
|
241
|
+
}) : null]
|
|
242
|
+
}), isBusy ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
243
|
+
color: bloomTheme.colors.primary,
|
|
244
|
+
size: "small"
|
|
245
|
+
}) : row.isActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
246
|
+
name: "checkmark-circle",
|
|
247
|
+
size: 20,
|
|
248
|
+
color: bloomTheme.colors.primary
|
|
249
|
+
}) : null]
|
|
250
|
+
}, `account-${row.sessionId}`);
|
|
251
|
+
})
|
|
252
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
253
|
+
accessibilityRole: "menuitem",
|
|
254
|
+
accessibilityLabel: t('accountMenu.addAnother') || 'Add another account',
|
|
255
|
+
onPress: () => {
|
|
256
|
+
onClose();
|
|
257
|
+
onAddAccount();
|
|
258
|
+
},
|
|
259
|
+
style: [styles.row, styles.actionRow],
|
|
260
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
261
|
+
style: [styles.actionIcon, {
|
|
262
|
+
backgroundColor: bloomTheme.colors.primarySubtle
|
|
263
|
+
}],
|
|
264
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
265
|
+
name: "person-add-outline",
|
|
266
|
+
size: 18,
|
|
267
|
+
color: bloomTheme.colors.primary
|
|
268
|
+
})
|
|
269
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
270
|
+
style: styles.rowInfo,
|
|
271
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
272
|
+
style: [styles.rowName, {
|
|
273
|
+
color: bloomTheme.colors.text
|
|
274
|
+
}],
|
|
275
|
+
children: t('accountMenu.addAnother') || 'Add another account'
|
|
276
|
+
})
|
|
277
|
+
})]
|
|
278
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
279
|
+
style: [styles.footer, {
|
|
280
|
+
borderTopColor: bloomTheme.colors.border
|
|
281
|
+
}],
|
|
282
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
283
|
+
accessibilityRole: "menuitem",
|
|
284
|
+
accessibilityLabel: t('common.actions.signOut') || 'Sign out',
|
|
285
|
+
onPress: () => signOutDialog.open(),
|
|
286
|
+
disabled: signingOut || signingOutAll,
|
|
287
|
+
style: styles.footerButton,
|
|
288
|
+
children: signingOut ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
289
|
+
color: bloomTheme.colors.error,
|
|
290
|
+
size: "small"
|
|
291
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
292
|
+
style: [styles.footerButtonText, {
|
|
293
|
+
color: bloomTheme.colors.error
|
|
294
|
+
}],
|
|
295
|
+
children: t('common.actions.signOut') || 'Sign out'
|
|
296
|
+
})
|
|
297
|
+
}), rows.length > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
298
|
+
accessibilityRole: "menuitem",
|
|
299
|
+
accessibilityLabel: t('accountMenu.signOutAll') || 'Sign out of all accounts',
|
|
300
|
+
onPress: () => signOutAllDialog.open(),
|
|
301
|
+
disabled: signingOut || signingOutAll,
|
|
302
|
+
style: styles.footerButton,
|
|
303
|
+
children: signingOutAll ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
304
|
+
color: bloomTheme.colors.error,
|
|
305
|
+
size: "small"
|
|
306
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
307
|
+
style: [styles.footerButtonText, {
|
|
308
|
+
color: bloomTheme.colors.error
|
|
309
|
+
}],
|
|
310
|
+
children: t('accountMenu.signOutAll') || 'Sign out of all accounts'
|
|
311
|
+
})
|
|
312
|
+
}) : null]
|
|
313
|
+
})]
|
|
314
|
+
});
|
|
315
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Modal, {
|
|
316
|
+
visible: open,
|
|
317
|
+
transparent: true,
|
|
318
|
+
animationType: isWeb ? 'fade' : 'slide',
|
|
319
|
+
onRequestClose: onClose,
|
|
320
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
321
|
+
accessibilityRole: "button",
|
|
322
|
+
accessibilityLabel: t('common.actions.close') || 'Close',
|
|
323
|
+
onPress: onClose,
|
|
324
|
+
style: overlayStyles,
|
|
325
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
326
|
+
onPress: () => undefined,
|
|
327
|
+
style: styles.panelTouchable,
|
|
328
|
+
children: content
|
|
329
|
+
})
|
|
330
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bloom.Dialog, {
|
|
331
|
+
control: signOutDialog,
|
|
332
|
+
title: t('common.actions.signOut') || 'Sign out',
|
|
333
|
+
description: t('common.confirms.signOut') || 'Are you sure you want to sign out?',
|
|
334
|
+
actions: [{
|
|
335
|
+
label: t('common.actions.signOut') || 'Sign out',
|
|
336
|
+
color: 'destructive',
|
|
337
|
+
onPress: performSignOut
|
|
338
|
+
}, {
|
|
339
|
+
label: t('common.cancel') || 'Cancel',
|
|
340
|
+
color: 'cancel'
|
|
341
|
+
}]
|
|
342
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bloom.Dialog, {
|
|
343
|
+
control: signOutAllDialog,
|
|
344
|
+
title: t('accountMenu.signOutAll') || 'Sign out of all accounts',
|
|
345
|
+
description: t('common.confirms.signOutAll') || 'Are you sure you want to sign out of all accounts?',
|
|
346
|
+
actions: [{
|
|
347
|
+
label: t('accountMenu.signOutAll') || 'Sign out of all accounts',
|
|
348
|
+
color: 'destructive',
|
|
349
|
+
onPress: performSignOutAll
|
|
350
|
+
}, {
|
|
351
|
+
label: t('common.cancel') || 'Cancel',
|
|
352
|
+
color: 'cancel'
|
|
353
|
+
}]
|
|
354
|
+
})]
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
const styles = _reactNative.StyleSheet.create({
|
|
358
|
+
webOverlay: {
|
|
359
|
+
flex: 1,
|
|
360
|
+
backgroundColor: 'transparent'
|
|
361
|
+
},
|
|
362
|
+
nativeOverlay: {
|
|
363
|
+
flex: 1,
|
|
364
|
+
backgroundColor: 'rgba(0,0,0,0.32)',
|
|
365
|
+
justifyContent: 'flex-end'
|
|
366
|
+
},
|
|
367
|
+
panelTouchable: {
|
|
368
|
+
// Pressable wrapper that owns no styling — just absorbs taps.
|
|
369
|
+
},
|
|
370
|
+
panelBase: {
|
|
371
|
+
borderRadius: 24,
|
|
372
|
+
paddingVertical: 12,
|
|
373
|
+
shadowColor: '#000',
|
|
374
|
+
shadowOpacity: 0.18,
|
|
375
|
+
shadowRadius: 24,
|
|
376
|
+
shadowOffset: {
|
|
377
|
+
width: 0,
|
|
378
|
+
height: 8
|
|
379
|
+
},
|
|
380
|
+
elevation: 12,
|
|
381
|
+
overflow: 'hidden'
|
|
382
|
+
},
|
|
383
|
+
panelWeb: {
|
|
384
|
+
position: 'absolute',
|
|
385
|
+
width: 360,
|
|
386
|
+
maxHeight: '85%',
|
|
387
|
+
borderWidth: 1
|
|
388
|
+
},
|
|
389
|
+
panelNative: {
|
|
390
|
+
marginHorizontal: 0,
|
|
391
|
+
borderTopLeftRadius: 28,
|
|
392
|
+
borderTopRightRadius: 28,
|
|
393
|
+
borderBottomLeftRadius: 0,
|
|
394
|
+
borderBottomRightRadius: 0,
|
|
395
|
+
paddingTop: 20,
|
|
396
|
+
paddingBottom: 24,
|
|
397
|
+
maxHeight: '85%'
|
|
398
|
+
},
|
|
399
|
+
header: {
|
|
400
|
+
alignItems: 'center',
|
|
401
|
+
paddingHorizontal: 20,
|
|
402
|
+
paddingVertical: 16
|
|
403
|
+
},
|
|
404
|
+
headerName: {
|
|
405
|
+
fontSize: 18,
|
|
406
|
+
fontWeight: '600',
|
|
407
|
+
marginTop: 12,
|
|
408
|
+
textAlign: 'center'
|
|
409
|
+
},
|
|
410
|
+
headerSecondary: {
|
|
411
|
+
fontSize: 14,
|
|
412
|
+
marginTop: 4,
|
|
413
|
+
textAlign: 'center'
|
|
414
|
+
},
|
|
415
|
+
primaryButton: {
|
|
416
|
+
marginHorizontal: 20,
|
|
417
|
+
marginBottom: 12,
|
|
418
|
+
paddingVertical: 12,
|
|
419
|
+
paddingHorizontal: 16,
|
|
420
|
+
borderRadius: 999,
|
|
421
|
+
borderWidth: 1,
|
|
422
|
+
alignItems: 'center'
|
|
423
|
+
},
|
|
424
|
+
primaryButtonText: {
|
|
425
|
+
fontSize: 14,
|
|
426
|
+
fontWeight: '600'
|
|
427
|
+
},
|
|
428
|
+
list: {
|
|
429
|
+
maxHeight: 280
|
|
430
|
+
},
|
|
431
|
+
listContent: {
|
|
432
|
+
paddingHorizontal: 12,
|
|
433
|
+
paddingBottom: 4
|
|
434
|
+
},
|
|
435
|
+
row: {
|
|
436
|
+
flexDirection: 'row',
|
|
437
|
+
alignItems: 'center',
|
|
438
|
+
paddingVertical: 10,
|
|
439
|
+
paddingHorizontal: 12,
|
|
440
|
+
borderRadius: 16,
|
|
441
|
+
marginVertical: 2
|
|
442
|
+
},
|
|
443
|
+
actionRow: {
|
|
444
|
+
marginHorizontal: 12,
|
|
445
|
+
marginTop: 4
|
|
446
|
+
},
|
|
447
|
+
actionIcon: {
|
|
448
|
+
width: 36,
|
|
449
|
+
height: 36,
|
|
450
|
+
borderRadius: 18,
|
|
451
|
+
alignItems: 'center',
|
|
452
|
+
justifyContent: 'center'
|
|
453
|
+
},
|
|
454
|
+
rowInfo: {
|
|
455
|
+
flex: 1,
|
|
456
|
+
marginLeft: 12
|
|
457
|
+
},
|
|
458
|
+
rowName: {
|
|
459
|
+
fontSize: 15,
|
|
460
|
+
fontWeight: '500'
|
|
461
|
+
},
|
|
462
|
+
rowSecondary: {
|
|
463
|
+
fontSize: 13,
|
|
464
|
+
marginTop: 2
|
|
465
|
+
},
|
|
466
|
+
footer: {
|
|
467
|
+
marginTop: 12,
|
|
468
|
+
paddingTop: 8,
|
|
469
|
+
paddingHorizontal: 12,
|
|
470
|
+
borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
471
|
+
flexDirection: 'row',
|
|
472
|
+
flexWrap: 'wrap',
|
|
473
|
+
justifyContent: 'space-around'
|
|
474
|
+
},
|
|
475
|
+
footerButton: {
|
|
476
|
+
paddingVertical: 10,
|
|
477
|
+
paddingHorizontal: 12
|
|
478
|
+
},
|
|
479
|
+
footerButtonText: {
|
|
480
|
+
fontSize: 14,
|
|
481
|
+
fontWeight: '600'
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
var _default = exports.default = AccountMenu;
|
|
485
|
+
//# sourceMappingURL=AccountMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_vectorIcons","_bloom","_theme","_Avatar","_interopRequireDefault","_OxyContext","_useI18n","_core","_accountMenuRows","_jsxRuntime","e","__esModule","default","isWeb","Platform","OS","AccountMenu","open","onClose","onNavigateManage","onAddAccount","anchor","user","sessions","activeSessionId","switchSession","logout","logoutAll","oxyServices","useOxy","t","locale","useI18n","bloomTheme","useTheme","busySessionId","setBusySessionId","useState","signingOut","setSigningOut","signingOutAll","setSigningOutAll","signOutDialog","useDialogControl","signOutAllDialog","containerRef","useRef","firstActionRef","rows","useMemo","buildAccountRows","getAvatarUrl","avatarId","getFileDownloadUrl","activeRow","find","r","isActive","inactiveRows","filter","handleSwitch","useCallback","sessionId","toast","success","error","__DEV__","loggerUtil","warn","component","performSignOut","performSignOutAll","useEffect","document","undefined","onKey","event","key","stopPropagation","addEventListener","removeEventListener","overlayStyles","styles","webOverlay","nativeOverlay","panelStyles","panelBase","panelWeb","top","right","backgroundColor","colors","background","borderColor","border","panelNative","content","jsxs","View","ref","style","accessibilityRole","accessibilityLabel","children","header","jsx","uri","avatarUri","name","displayName","size","Text","headerName","color","text","numberOfLines","secondary","headerSecondary","textSecondary","TouchableOpacity","primaryButton","onPress","primaryButtonText","primary","length","ScrollView","list","contentContainerStyle","listContent","showsVerticalScrollIndicator","map","row","isBusy","accessibilityState","selected","disabled","primarySubtle","rowInfo","rowName","rowSecondary","ActivityIndicator","Ionicons","actionRow","actionIcon","footer","borderTopColor","footerButton","footerButtonText","Modal","visible","transparent","animationType","onRequestClose","Pressable","panelTouchable","Dialog","control","title","description","actions","label","StyleSheet","create","flex","justifyContent","borderRadius","paddingVertical","shadowColor","shadowOpacity","shadowRadius","shadowOffset","width","height","elevation","overflow","position","maxHeight","borderWidth","marginHorizontal","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","paddingTop","paddingBottom","alignItems","paddingHorizontal","fontSize","fontWeight","marginTop","textAlign","marginBottom","flexDirection","marginVertical","marginLeft","borderTopWidth","hairlineWidth","flexWrap","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/components/AccountMenu.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,gBAAA,GAAAV,OAAA;AAAsE,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAM,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWtE,MAAMG,KAAK,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAuC,GAAGA,CAAC;EAC7CC,IAAI;EACJC,OAAO;EACPC,gBAAgB;EAChBC,YAAY;EACZC;AACJ,CA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iB,EAAE,EAAE;IACrBS,cAAc,EAAElC,uBAAU,CAACmC,aAAa;IACxCJ,aAAa,EAAE,KAAK;IACpBK,QAAQ,EAAE,MAAM;IAChBjC,cAAc,EAAE;EACpB,CAAC;EACDlB,YAAY,EAAE;IACVoB,eAAe,EAAE,EAAE;IACnBoB,iBAAiB,EAAE;EACvB,CAAC;EACDvC,gBAAgB,EAAE;IACdwC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EAChB;AACJ,CAAC,CAAC;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAA3L,OAAA,GAEYI,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _core = require("@oxyhq/core");
|
|
10
|
+
var _Avatar = _interopRequireDefault(require("./Avatar.js"));
|
|
11
|
+
var _AccountMenu = _interopRequireDefault(require("./AccountMenu.js"));
|
|
12
|
+
var _OxyContext = require("../context/OxyContext.js");
|
|
13
|
+
var _useI18n = require("../hooks/useI18n.js");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const isWeb = _reactNative.Platform.OS === 'web';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Avatar entry-point that opens the unified {@link AccountMenu}. Reads the
|
|
20
|
+
* active account from `useOxy()` — never receive user data via props.
|
|
21
|
+
*
|
|
22
|
+
* Renders a small avatar chip (top-right friendly). Click → opens AccountMenu.
|
|
23
|
+
* Pure component: owns only the open-state and the trigger's measured anchor.
|
|
24
|
+
*/
|
|
25
|
+
const AccountMenuButton = ({
|
|
26
|
+
size = 36,
|
|
27
|
+
onNavigateManage,
|
|
28
|
+
onAddAccount
|
|
29
|
+
}) => {
|
|
30
|
+
const {
|
|
31
|
+
user,
|
|
32
|
+
oxyServices,
|
|
33
|
+
isAuthenticated
|
|
34
|
+
} = (0, _OxyContext.useOxy)();
|
|
35
|
+
const {
|
|
36
|
+
t,
|
|
37
|
+
locale
|
|
38
|
+
} = (0, _useI18n.useI18n)();
|
|
39
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
40
|
+
const [anchor, setAnchor] = (0, _react.useState)(null);
|
|
41
|
+
const triggerRef = (0, _react.useRef)(null);
|
|
42
|
+
const measureAnchor = (0, _react.useCallback)(() => {
|
|
43
|
+
if (!isWeb || !triggerRef.current) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
// RN-Web exposes measure() on host views; use the native API.
|
|
47
|
+
triggerRef.current.measure?.((_x, _y, _w, h, pageX, pageY) => {
|
|
48
|
+
if (typeof window === 'undefined' || typeof pageX !== 'number') {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const right = Math.max(8, window.innerWidth - pageX - (_w ?? 0));
|
|
52
|
+
const top = pageY + h + 8;
|
|
53
|
+
setAnchor({
|
|
54
|
+
top,
|
|
55
|
+
right
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}, []);
|
|
59
|
+
const handleOpen = (0, _react.useCallback)(() => {
|
|
60
|
+
measureAnchor();
|
|
61
|
+
setOpen(true);
|
|
62
|
+
}, [measureAnchor]);
|
|
63
|
+
const handleClose = (0, _react.useCallback)(() => setOpen(false), []);
|
|
64
|
+
const handleLayout = (0, _react.useCallback)(_event => {
|
|
65
|
+
// Re-measure on layout changes so the popover doesn't drift after
|
|
66
|
+
// window resize / sticky-header relayout.
|
|
67
|
+
if (open) {
|
|
68
|
+
measureAnchor();
|
|
69
|
+
}
|
|
70
|
+
}, [measureAnchor, open]);
|
|
71
|
+
const displayName = (0, _core.getAccountDisplayName)(user, locale);
|
|
72
|
+
const avatarUri = user?.avatar ? oxyServices.getFileDownloadUrl(user.avatar, 'thumb') : undefined;
|
|
73
|
+
const accessibilityLabel = isAuthenticated ? t('accountMenu.openWithUser', {
|
|
74
|
+
name: displayName
|
|
75
|
+
}) || `Account menu for ${displayName}` : t('accountMenu.open') || 'Account menu';
|
|
76
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
78
|
+
ref: triggerRef,
|
|
79
|
+
onPress: handleOpen,
|
|
80
|
+
onLayout: handleLayout,
|
|
81
|
+
accessibilityRole: "button",
|
|
82
|
+
accessibilityLabel: accessibilityLabel,
|
|
83
|
+
accessibilityHint: t('accountMenu.openHint') || 'Opens the account menu',
|
|
84
|
+
accessibilityState: {
|
|
85
|
+
expanded: open
|
|
86
|
+
},
|
|
87
|
+
style: [styles.trigger, {
|
|
88
|
+
width: size,
|
|
89
|
+
height: size,
|
|
90
|
+
borderRadius: size / 2
|
|
91
|
+
}],
|
|
92
|
+
hitSlop: {
|
|
93
|
+
top: 8,
|
|
94
|
+
bottom: 8,
|
|
95
|
+
left: 8,
|
|
96
|
+
right: 8
|
|
97
|
+
},
|
|
98
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
99
|
+
uri: avatarUri,
|
|
100
|
+
name: displayName,
|
|
101
|
+
size: size
|
|
102
|
+
})
|
|
103
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AccountMenu.default, {
|
|
104
|
+
open: open,
|
|
105
|
+
onClose: handleClose,
|
|
106
|
+
onNavigateManage: onNavigateManage,
|
|
107
|
+
onAddAccount: onAddAccount,
|
|
108
|
+
anchor: anchor
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
const styles = _reactNative.StyleSheet.create({
|
|
113
|
+
trigger: {
|
|
114
|
+
overflow: 'hidden',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
justifyContent: 'center'
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
var _default = exports.default = AccountMenuButton;
|
|
120
|
+
//# sourceMappingURL=AccountMenuButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_core","_Avatar","_interopRequireDefault","_AccountMenu","_OxyContext","_useI18n","_jsxRuntime","e","__esModule","default","isWeb","Platform","OS","AccountMenuButton","size","onNavigateManage","onAddAccount","user","oxyServices","isAuthenticated","useOxy","t","locale","useI18n","open","setOpen","useState","anchor","setAnchor","triggerRef","useRef","measureAnchor","useCallback","current","measure","_x","_y","_w","h","pageX","pageY","window","right","Math","max","innerWidth","top","handleOpen","handleClose","handleLayout","_event","displayName","getAccountDisplayName","avatarUri","avatar","getFileDownloadUrl","undefined","accessibilityLabel","name","jsxs","Fragment","children","jsx","TouchableOpacity","ref","onPress","onLayout","accessibilityRole","accessibilityHint","accessibilityState","expanded","style","styles","trigger","width","height","borderRadius","hitSlop","bottom","left","uri","onClose","StyleSheet","create","overflow","alignItems","justifyContent","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/components/AccountMenuButton.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAI,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAW3C,MAAMG,KAAK,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;;AAEnC;AACA;AACA;AACA;AACA;A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E5D,IAAI;QAAE6D,MAAM,EAAE7D,IAAI;QAAE8D,YAAY,EAAE9D,IAAI,GAAG;MAAE,CAAC,CAAE;MAC/E+D,OAAO,EAAE;QAAE/B,GAAG,EAAE,CAAC;QAAEgC,MAAM,EAAE,CAAC;QAAEC,IAAI,EAAE,CAAC;QAAErC,KAAK,EAAE;MAAE,CAAE;MAAAmB,QAAA,eAElD,IAAAvD,WAAA,CAAAwD,GAAA,EAAC7D,OAAA,CAAAQ,OAAM;QAACuE,GAAG,EAAE3B,SAAU;QAACK,IAAI,EAAEP,WAAY;QAACrC,IAAI,EAAEA;MAAK,CAAE;IAAC,CAC3C,CAAC,eACnB,IAAAR,WAAA,CAAAwD,GAAA,EAAC3D,YAAA,CAAAM,OAAW;MACRe,IAAI,EAAEA,IAAK;MACXyD,OAAO,EAAEjC,WAAY;MACrBjC,gBAAgB,EAAEA,gBAAiB;MACnCC,YAAY,EAAEA,YAAa;MAC3BW,MAAM,EAAEA;IAAO,CAClB,CAAC;EAAA,CACJ,CAAC;AAEX,CAAC;AAED,MAAM6C,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC7BV,OAAO,EAAE;IACLW,QAAQ,EAAE,QAAQ;IAClBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EACpB;AACJ,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA/E,OAAA,GAEYI,iBAAiB","ignoreList":[]}
|
|
@@ -13,7 +13,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
13
13
|
/**
|
|
14
14
|
* ActingAsBanner - Shows a subtle banner when the user is acting as a managed account.
|
|
15
15
|
*
|
|
16
|
-
* - Tap to open the
|
|
16
|
+
* - Tap to open the ManageAccount screen (account switcher lives in AccountMenu).
|
|
17
17
|
* - Long-press to switch back to the primary account immediately.
|
|
18
18
|
*
|
|
19
19
|
* Place this component in your app's layout where you want the banner to appear
|
|
@@ -37,7 +37,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
37
37
|
}
|
|
38
38
|
const displayName = typeof activeAccount.name === 'object' ? activeAccount.name.full || activeAccount.name.first || activeAccount.username : activeAccount.name || activeAccount.username;
|
|
39
39
|
const handlePress = () => {
|
|
40
|
-
showBottomSheet?.('
|
|
40
|
+
showBottomSheet?.('ManageAccount');
|
|
41
41
|
};
|
|
42
42
|
const handleLongPress = () => {
|
|
43
43
|
setActingAs(null);
|