@oxyhq/services 5.14.0 → 5.15.1
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/README.md +130 -54
- package/lib/commonjs/assets/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/commonjs/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/commonjs/core/HttpService.js +94 -4
- package/lib/commonjs/core/HttpService.js.map +1 -1
- package/lib/commonjs/core/OxyServices.base.js +3 -1
- package/lib/commonjs/core/OxyServices.base.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.assets.js +213 -22
- package/lib/commonjs/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.auth.js +70 -99
- package/lib/commonjs/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/commonjs/crypto/index.js +33 -0
- package/lib/commonjs/crypto/index.js.map +1 -0
- package/lib/commonjs/crypto/keyManager.js +208 -0
- package/lib/commonjs/crypto/keyManager.js.map +1 -0
- package/lib/commonjs/crypto/recoveryPhrase.js +137 -0
- package/lib/commonjs/crypto/recoveryPhrase.js.map +1 -0
- package/lib/commonjs/crypto/signatureService.js +251 -0
- package/lib/commonjs/crypto/signatureService.js.map +1 -0
- package/lib/commonjs/i18n/locales/en-US.json +4 -0
- package/lib/commonjs/index.js +22 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/ActivityIndicator.js +203 -0
- package/lib/commonjs/ui/components/ActivityIndicator.js.map +1 -0
- package/lib/commonjs/ui/components/AutoHeightScrollView.js +46 -0
- package/lib/commonjs/ui/components/AutoHeightScrollView.js.map +1 -0
- package/lib/commonjs/ui/components/BottomSheet.js +407 -0
- package/lib/commonjs/ui/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js +366 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -0
- package/lib/commonjs/ui/components/CrossFadeIcon.js +106 -0
- package/lib/commonjs/ui/components/CrossFadeIcon.js.map +1 -0
- package/lib/commonjs/ui/components/EmptyState.js +41 -0
- package/lib/commonjs/ui/components/EmptyState.js.map +1 -0
- package/lib/commonjs/ui/components/GroupedItem.js +87 -82
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +25 -25
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +111 -47
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/HelperText.js +103 -0
- package/lib/commonjs/ui/components/HelperText.js.map +1 -0
- package/lib/commonjs/ui/components/Icon.js +109 -0
- package/lib/commonjs/ui/components/Icon.js.map +1 -0
- package/lib/commonjs/ui/components/IconButton/IconButton.js +159 -0
- package/lib/commonjs/ui/components/IconButton/IconButton.js.map +1 -0
- package/lib/commonjs/ui/components/IconButton/utils.js +155 -0
- package/lib/commonjs/ui/components/IconButton/utils.js.map +1 -0
- package/lib/commonjs/ui/components/LoadingState.js +47 -0
- package/lib/commonjs/ui/components/LoadingState.js.map +1 -0
- package/lib/commonjs/ui/components/OxyPayButton.js +1 -14
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +41 -391
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +9 -13
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +7 -4
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/QuickActions.js +7 -4
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +4 -1
- package/lib/commonjs/ui/components/Section.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +6 -3
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/SettingRow.js +77 -0
- package/lib/commonjs/ui/components/SettingRow.js.map +1 -0
- package/lib/commonjs/ui/components/StepBasedScreen.js +188 -172
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/Surface.js +258 -0
- package/lib/commonjs/ui/components/Surface.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Addons/Outline.js +46 -0
- package/lib/commonjs/ui/components/TextField/Addons/Outline.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Addons/Underline.js +53 -0
- package/lib/commonjs/ui/components/TextField/Addons/Underline.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js +155 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAffix.js +144 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAffix.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldIcon.js +137 -0
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldIcon.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/enums.js +22 -0
- package/lib/commonjs/ui/components/TextField/Adornment/enums.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/types.js +6 -0
- package/lib/commonjs/ui/components/TextField/Adornment/types.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js +62 -0
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Label/InputLabel.js +176 -0
- package/lib/commonjs/ui/components/TextField/Label/InputLabel.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/Label/LabelBackground.js +84 -0
- package/lib/commonjs/ui/components/TextField/Label/LabelBackground.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/TextFieldFlat.js +377 -0
- package/lib/commonjs/ui/components/TextField/TextFieldFlat.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/TextFieldOutlined.js +361 -0
- package/lib/commonjs/ui/components/TextField/TextFieldOutlined.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/constants.js +50 -0
- package/lib/commonjs/ui/components/TextField/constants.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/helpers.js +490 -0
- package/lib/commonjs/ui/components/TextField/helpers.js.map +1 -0
- package/lib/commonjs/ui/components/TextField/types.js +6 -0
- package/lib/commonjs/ui/components/TextField/types.js.map +1 -0
- package/lib/commonjs/ui/components/TextField.js +339 -0
- package/lib/commonjs/ui/components/TextField.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/Pressable.js +12 -0
- package/lib/commonjs/ui/components/TouchableRipple/Pressable.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js +258 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js +107 -0
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -0
- package/lib/commonjs/ui/components/TouchableRipple/utils.js +56 -0
- package/lib/commonjs/ui/components/TouchableRipple/utils.js.map +1 -0
- package/lib/commonjs/ui/components/Typography/AnimatedText.js +62 -0
- package/lib/commonjs/ui/components/Typography/AnimatedText.js.map +1 -0
- package/lib/commonjs/ui/components/Typography/types.js +26 -0
- package/lib/commonjs/ui/components/Typography/types.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +171 -0
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +409 -0
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +181 -0
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/styles.js +868 -0
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -0
- package/lib/commonjs/ui/components/index.js +29 -1
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/profile/EditBioModal.js +181 -0
- package/lib/commonjs/ui/components/profile/EditBioModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js +207 -0
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditEmailModal.js +184 -0
- package/lib/commonjs/ui/components/profile/EditEmailModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditLinksModal.js +315 -0
- package/lib/commonjs/ui/components/profile/EditLinksModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditLocationModal.js +273 -0
- package/lib/commonjs/ui/components/profile/EditLocationModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js +180 -0
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js.map +1 -0
- package/lib/commonjs/ui/components/profile/TwoFactorSetupModal.js +467 -0
- package/lib/commonjs/ui/components/profile/TwoFactorSetupModal.js.map +1 -0
- package/lib/commonjs/ui/components/styles/overlay.js +85 -0
- package/lib/commonjs/ui/components/styles/overlay.js.map +1 -0
- package/lib/commonjs/ui/components/styles/shadow.js +132 -0
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -0
- package/lib/commonjs/ui/components/theming.js +116 -0
- package/lib/commonjs/ui/components/theming.js.map +1 -0
- package/lib/commonjs/ui/components/types.js +2 -0
- package/lib/commonjs/ui/components/types.js.map +1 -0
- package/lib/commonjs/ui/components/utils/forwardRef.js +18 -0
- package/lib/commonjs/ui/components/utils/forwardRef.js.map +1 -0
- package/lib/commonjs/ui/components/utils/hasTouchHandler.js +13 -0
- package/lib/commonjs/ui/components/utils/hasTouchHandler.js.map +1 -0
- package/lib/commonjs/ui/components/utils/roundLayoutSize.js +9 -0
- package/lib/commonjs/ui/components/utils/roundLayoutSize.js.map +1 -0
- package/lib/commonjs/ui/components/utils/splitStyles.js +50 -0
- package/lib/commonjs/ui/components/utils/splitStyles.js.map +1 -0
- package/lib/commonjs/ui/constants/iconColors.js +84 -0
- package/lib/commonjs/ui/constants/iconColors.js.map +1 -0
- package/lib/commonjs/ui/constants/spacing.js +50 -0
- package/lib/commonjs/ui/constants/spacing.js.map +1 -0
- package/lib/commonjs/ui/constants/theme.js +123 -0
- package/lib/commonjs/ui/constants/theme.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +198 -853
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/ThemeContext.js +36 -0
- package/lib/commonjs/ui/context/ThemeContext.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +349 -0
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js +73 -0
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js +112 -0
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js +261 -0
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js.map +1 -0
- package/lib/commonjs/ui/context/hooks/useStorage.js +79 -0
- package/lib/commonjs/ui/context/hooks/useStorage.js.map +1 -0
- package/lib/commonjs/ui/context/utils/errorHandlers.js +90 -0
- package/lib/commonjs/ui/context/utils/errorHandlers.js.map +1 -0
- package/lib/commonjs/ui/context/utils/sessionHelpers.js +103 -0
- package/lib/commonjs/ui/context/utils/sessionHelpers.js.map +1 -0
- package/lib/commonjs/ui/context/utils/storageHelpers.js +119 -0
- package/lib/commonjs/ui/context/utils/storageHelpers.js.map +1 -0
- package/lib/commonjs/ui/hooks/index.js +14 -0
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/use-color-scheme.js +29 -0
- package/lib/commonjs/ui/hooks/use-color-scheme.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-haptic-press.js +21 -0
- package/lib/commonjs/ui/hooks/use-haptic-press.js.map +1 -0
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useDeviceManagement.js +73 -0
- package/lib/commonjs/ui/hooks/useDeviceManagement.js.map +1 -0
- package/lib/commonjs/ui/hooks/useLanguageManagement.js +112 -0
- package/lib/commonjs/ui/hooks/useLanguageManagement.js.map +1 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js +123 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSessionManagement.js +261 -0
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -0
- package/lib/commonjs/ui/hooks/useStorage.js +79 -0
- package/lib/commonjs/ui/hooks/useStorage.js.map +1 -0
- package/lib/commonjs/ui/hooks/useThemeColors.js +31 -0
- package/lib/commonjs/ui/hooks/useThemeColors.js.map +1 -0
- package/lib/commonjs/ui/hooks/useThemeStyles.js +69 -0
- package/lib/commonjs/ui/hooks/useThemeStyles.js.map +1 -0
- package/lib/commonjs/ui/index.js +1 -4
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +180 -0
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +80 -154
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +67 -67
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +217 -98
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +514 -429
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +44 -59
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +12 -19
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +36 -43
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +14 -14
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +674 -1968
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +26 -23
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +19 -59
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +79 -170
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +13 -40
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +436 -0
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +18 -24
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +21 -9
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +180 -252
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +7 -5
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +32 -70
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +26 -99
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +24 -16
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +8 -10
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +64 -67
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +11 -8
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +124 -122
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +99 -112
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +12 -9
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +552 -79
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +12 -8
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +5 -11
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/spacing.js +60 -2
- package/lib/commonjs/ui/styles/spacing.js.map +1 -1
- package/lib/commonjs/ui/styles/theme.js +1 -1
- package/lib/commonjs/ui/types/fileManagement.js +6 -0
- package/lib/commonjs/ui/types/fileManagement.js.map +1 -0
- package/lib/commonjs/ui/types/navigation.js +6 -0
- package/lib/commonjs/ui/types/navigation.js.map +1 -0
- package/lib/commonjs/ui/utils/colorUtils.js +52 -0
- package/lib/commonjs/ui/utils/colorUtils.js.map +1 -0
- package/lib/commonjs/ui/utils/errorHandlers.js +90 -0
- package/lib/commonjs/ui/utils/errorHandlers.js.map +1 -0
- package/lib/commonjs/ui/utils/fileManagement.js +181 -0
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -0
- package/lib/commonjs/ui/utils/sessionHelpers.js +103 -0
- package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -0
- package/lib/commonjs/ui/utils/storageHelpers.js +119 -0
- package/lib/commonjs/ui/utils/storageHelpers.js.map +1 -0
- package/lib/commonjs/ui/utils/themeUtils.js +47 -0
- package/lib/commonjs/ui/utils/themeUtils.js.map +1 -0
- package/lib/commonjs/ui/utils/user-utils.js +53 -0
- package/lib/commonjs/ui/utils/user-utils.js.map +1 -0
- package/lib/commonjs/utils/errorUtils.js +14 -4
- package/lib/commonjs/utils/errorUtils.js.map +1 -1
- package/lib/module/assets/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/module/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/lib/module/core/HttpService.js +94 -4
- package/lib/module/core/HttpService.js.map +1 -1
- package/lib/module/core/OxyServices.base.js +3 -1
- package/lib/module/core/OxyServices.base.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.assets.js +212 -20
- package/lib/module/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.auth.js +70 -99
- package/lib/module/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/module/crypto/index.js +16 -0
- package/lib/module/crypto/index.js.map +1 -0
- package/lib/module/crypto/keyManager.js +204 -0
- package/lib/module/crypto/keyManager.js.map +1 -0
- package/lib/module/crypto/recoveryPhrase.js +131 -0
- package/lib/module/crypto/recoveryPhrase.js.map +1 -0
- package/lib/module/crypto/signatureService.js +248 -0
- package/lib/module/crypto/signatureService.js.map +1 -0
- package/lib/module/i18n/locales/en-US.json +4 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/ActivityIndicator.js +198 -0
- package/lib/module/ui/components/ActivityIndicator.js.map +1 -0
- package/lib/module/ui/components/AutoHeightScrollView.js +41 -0
- package/lib/module/ui/components/AutoHeightScrollView.js.map +1 -0
- package/lib/module/ui/components/BottomSheet.js +402 -0
- package/lib/module/ui/components/BottomSheet.js.map +1 -0
- package/lib/module/ui/components/BottomSheetRouter.js +356 -0
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -0
- package/lib/module/ui/components/CrossFadeIcon.js +101 -0
- package/lib/module/ui/components/CrossFadeIcon.js.map +1 -0
- package/lib/module/ui/components/EmptyState.js +36 -0
- package/lib/module/ui/components/EmptyState.js.map +1 -0
- package/lib/module/ui/components/GroupedItem.js +88 -82
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +23 -23
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +109 -46
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/HelperText.js +99 -0
- package/lib/module/ui/components/HelperText.js.map +1 -0
- package/lib/module/ui/components/Icon.js +102 -0
- package/lib/module/ui/components/Icon.js.map +1 -0
- package/lib/module/ui/components/IconButton/IconButton.js +153 -0
- package/lib/module/ui/components/IconButton/IconButton.js.map +1 -0
- package/lib/module/ui/components/IconButton/utils.js +149 -0
- package/lib/module/ui/components/IconButton/utils.js.map +1 -0
- package/lib/module/ui/components/LoadingState.js +42 -0
- package/lib/module/ui/components/LoadingState.js.map +1 -0
- package/lib/module/ui/components/OxyPayButton.js +1 -14
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +45 -396
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +9 -13
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +7 -4
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/QuickActions.js +7 -4
- package/lib/module/ui/components/QuickActions.js.map +1 -1
- package/lib/module/ui/components/Section.js +4 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +6 -3
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/SettingRow.js +72 -0
- package/lib/module/ui/components/SettingRow.js.map +1 -0
- package/lib/module/ui/components/StepBasedScreen.js +190 -174
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/Surface.js +252 -0
- package/lib/module/ui/components/Surface.js.map +1 -0
- package/lib/module/ui/components/TextField/Addons/Outline.js +40 -0
- package/lib/module/ui/components/TextField/Addons/Outline.js.map +1 -0
- package/lib/module/ui/components/TextField/Addons/Underline.js +47 -0
- package/lib/module/ui/components/TextField/Addons/Underline.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js +148 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAffix.js +141 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldAffix.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldIcon.js +135 -0
- package/lib/module/ui/components/TextField/Adornment/TextFieldIcon.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/enums.js +18 -0
- package/lib/module/ui/components/TextField/Adornment/enums.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/types.js +4 -0
- package/lib/module/ui/components/TextField/Adornment/types.js.map +1 -0
- package/lib/module/ui/components/TextField/Adornment/utils.js +57 -0
- package/lib/module/ui/components/TextField/Adornment/utils.js.map +1 -0
- package/lib/module/ui/components/TextField/Label/InputLabel.js +171 -0
- package/lib/module/ui/components/TextField/Label/InputLabel.js.map +1 -0
- package/lib/module/ui/components/TextField/Label/LabelBackground.js +78 -0
- package/lib/module/ui/components/TextField/Label/LabelBackground.js.map +1 -0
- package/lib/module/ui/components/TextField/TextFieldFlat.js +372 -0
- package/lib/module/ui/components/TextField/TextFieldFlat.js.map +1 -0
- package/lib/module/ui/components/TextField/TextFieldOutlined.js +355 -0
- package/lib/module/ui/components/TextField/TextFieldOutlined.js.map +1 -0
- package/lib/module/ui/components/TextField/constants.js +46 -0
- package/lib/module/ui/components/TextField/constants.js.map +1 -0
- package/lib/module/ui/components/TextField/helpers.js +472 -0
- package/lib/module/ui/components/TextField/helpers.js.map +1 -0
- package/lib/module/ui/components/TextField/types.js +4 -0
- package/lib/module/ui/components/TextField/types.js.map +1 -0
- package/lib/module/ui/components/TextField.js +333 -0
- package/lib/module/ui/components/TextField.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/Pressable.js +9 -0
- package/lib/module/ui/components/TouchableRipple/Pressable.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js +253 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js +101 -0
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.native.js.map +1 -0
- package/lib/module/ui/components/TouchableRipple/utils.js +50 -0
- package/lib/module/ui/components/TouchableRipple/utils.js.map +1 -0
- package/lib/module/ui/components/Typography/AnimatedText.js +56 -0
- package/lib/module/ui/components/Typography/AnimatedText.js.map +1 -0
- package/lib/module/ui/components/Typography/types.js +22 -0
- package/lib/module/ui/components/Typography/types.js.map +1 -0
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +165 -0
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -0
- package/lib/module/ui/components/fileManagement/FileViewer.js +402 -0
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -0
- package/lib/module/ui/components/fileManagement/UploadPreview.js +175 -0
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -0
- package/lib/module/ui/components/fileManagement/styles.js +864 -0
- package/lib/module/ui/components/fileManagement/styles.js.map +1 -0
- package/lib/module/ui/components/index.js +4 -1
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/profile/EditBioModal.js +175 -0
- package/lib/module/ui/components/profile/EditBioModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditDisplayNameModal.js +201 -0
- package/lib/module/ui/components/profile/EditDisplayNameModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditEmailModal.js +178 -0
- package/lib/module/ui/components/profile/EditEmailModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditLinksModal.js +309 -0
- package/lib/module/ui/components/profile/EditLinksModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditLocationModal.js +267 -0
- package/lib/module/ui/components/profile/EditLocationModal.js.map +1 -0
- package/lib/module/ui/components/profile/EditUsernameModal.js +174 -0
- package/lib/module/ui/components/profile/EditUsernameModal.js.map +1 -0
- package/lib/module/ui/components/profile/TwoFactorSetupModal.js +460 -0
- package/lib/module/ui/components/profile/TwoFactorSetupModal.js.map +1 -0
- package/lib/module/ui/components/styles/overlay.js +80 -0
- package/lib/module/ui/components/styles/overlay.js.map +1 -0
- package/lib/module/ui/components/styles/shadow.js +128 -0
- package/lib/module/ui/components/styles/shadow.js.map +1 -0
- package/lib/module/ui/components/theming.js +111 -0
- package/lib/module/ui/components/theming.js.map +1 -0
- package/lib/module/ui/components/types.js +2 -0
- package/lib/module/ui/components/types.js.map +1 -0
- package/lib/module/ui/components/utils/forwardRef.js +13 -0
- package/lib/module/ui/components/utils/forwardRef.js.map +1 -0
- package/lib/module/ui/components/utils/hasTouchHandler.js +9 -0
- package/lib/module/ui/components/utils/hasTouchHandler.js.map +1 -0
- package/lib/module/ui/components/utils/roundLayoutSize.js +4 -0
- package/lib/module/ui/components/utils/roundLayoutSize.js.map +1 -0
- package/lib/module/ui/components/utils/splitStyles.js +46 -0
- package/lib/module/ui/components/utils/splitStyles.js.map +1 -0
- package/lib/module/ui/constants/iconColors.js +78 -0
- package/lib/module/ui/constants/iconColors.js.map +1 -0
- package/lib/module/ui/constants/spacing.js +45 -0
- package/lib/module/ui/constants/spacing.js.map +1 -0
- package/lib/module/ui/constants/theme.js +119 -0
- package/lib/module/ui/constants/theme.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +199 -855
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/ThemeContext.js +29 -0
- package/lib/module/ui/context/ThemeContext.js.map +1 -0
- package/lib/module/ui/context/hooks/useAuthOperations.js +344 -0
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -0
- package/lib/module/ui/context/hooks/useDeviceManagement.js +68 -0
- package/lib/module/ui/context/hooks/useDeviceManagement.js.map +1 -0
- package/lib/module/ui/context/hooks/useLanguageManagement.js +107 -0
- package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -0
- package/lib/module/ui/context/hooks/useSessionManagement.js +256 -0
- package/lib/module/ui/context/hooks/useSessionManagement.js.map +1 -0
- package/lib/module/ui/context/hooks/useStorage.js +74 -0
- package/lib/module/ui/context/hooks/useStorage.js.map +1 -0
- package/lib/module/ui/context/utils/errorHandlers.js +83 -0
- package/lib/module/ui/context/utils/errorHandlers.js.map +1 -0
- package/lib/module/ui/context/utils/sessionHelpers.js +96 -0
- package/lib/module/ui/context/utils/sessionHelpers.js.map +1 -0
- package/lib/module/ui/context/utils/storageHelpers.js +111 -0
- package/lib/module/ui/context/utils/storageHelpers.js.map +1 -0
- package/lib/module/ui/hooks/index.js +2 -0
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/use-color-scheme.js +26 -0
- package/lib/module/ui/hooks/use-color-scheme.js.map +1 -0
- package/lib/module/ui/hooks/use-haptic-press.js +17 -0
- package/lib/module/ui/hooks/use-haptic-press.js.map +1 -0
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useDeviceManagement.js +68 -0
- package/lib/module/ui/hooks/useDeviceManagement.js.map +1 -0
- package/lib/module/ui/hooks/useLanguageManagement.js +107 -0
- package/lib/module/ui/hooks/useLanguageManagement.js.map +1 -0
- package/lib/module/ui/hooks/useProfileEditing.js +118 -0
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -0
- package/lib/module/ui/hooks/useSessionManagement.js +256 -0
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -0
- package/lib/module/ui/hooks/useStorage.js +74 -0
- package/lib/module/ui/hooks/useStorage.js.map +1 -0
- package/lib/module/ui/hooks/useThemeColors.js +27 -0
- package/lib/module/ui/hooks/useThemeColors.js.map +1 -0
- package/lib/module/ui/hooks/useThemeStyles.js +64 -0
- package/lib/module/ui/hooks/useThemeStyles.js.map +1 -0
- package/lib/module/ui/index.js +2 -4
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +168 -0
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +77 -152
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +67 -67
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +218 -100
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +515 -430
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +45 -60
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +12 -19
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +36 -43
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +14 -14
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +670 -1965
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +26 -23
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +22 -62
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +80 -171
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +16 -43
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +432 -0
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js +18 -24
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +21 -9
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +167 -239
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +7 -5
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +35 -73
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +29 -102
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +24 -16
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +8 -10
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +65 -68
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +11 -8
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +124 -121
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +101 -114
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +12 -9
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +554 -81
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +12 -8
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +5 -11
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +12 -2
- package/lib/module/ui/styles/spacing.js.map +1 -1
- package/lib/module/ui/styles/theme.js +1 -1
- package/lib/module/ui/types/fileManagement.js +4 -0
- package/lib/module/ui/types/fileManagement.js.map +1 -0
- package/lib/module/ui/types/navigation.js +4 -0
- package/lib/module/ui/types/navigation.js.map +1 -0
- package/lib/module/ui/utils/colorUtils.js +46 -0
- package/lib/module/ui/utils/colorUtils.js.map +1 -0
- package/lib/module/ui/utils/errorHandlers.js +83 -0
- package/lib/module/ui/utils/errorHandlers.js.map +1 -0
- package/lib/module/ui/utils/fileManagement.js +172 -0
- package/lib/module/ui/utils/fileManagement.js.map +1 -0
- package/lib/module/ui/utils/sessionHelpers.js +96 -0
- package/lib/module/ui/utils/sessionHelpers.js.map +1 -0
- package/lib/module/ui/utils/storageHelpers.js +111 -0
- package/lib/module/ui/utils/storageHelpers.js.map +1 -0
- package/lib/module/ui/utils/themeUtils.js +41 -0
- package/lib/module/ui/utils/themeUtils.js.map +1 -0
- package/lib/module/ui/utils/user-utils.js +46 -0
- package/lib/module/ui/utils/user-utils.js.map +1 -0
- package/lib/module/utils/errorUtils.js +14 -4
- package/lib/module/utils/errorUtils.js.map +1 -1
- package/lib/typescript/core/HttpService.d.ts +48 -0
- package/lib/typescript/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.assets.d.ts +23 -1
- package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts +70 -42
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.totp.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +26 -34
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/crypto/index.d.ts +11 -0
- package/lib/typescript/crypto/index.d.ts.map +1 -0
- package/lib/typescript/crypto/keyManager.d.ts +73 -0
- package/lib/typescript/crypto/keyManager.d.ts.map +1 -0
- package/lib/typescript/crypto/recoveryPhrase.d.ts +57 -0
- package/lib/typescript/crypto/recoveryPhrase.d.ts.map +1 -0
- package/lib/typescript/crypto/signatureService.d.ts +81 -0
- package/lib/typescript/crypto/signatureService.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +1 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/types/bip39.d.ts +29 -0
- package/lib/typescript/types/color.d.ts +19 -0
- package/lib/typescript/types/elliptic.d.ts +61 -0
- package/lib/typescript/types/expo-crypto.d.ts +29 -0
- package/lib/typescript/types/expo-random.d.ts +9 -0
- package/lib/typescript/types/expo-secure-store.d.ts +21 -0
- package/lib/typescript/types/expo-vector-icons.d.ts +9 -0
- package/lib/typescript/ui/components/ActivityIndicator.d.ts +45 -0
- package/lib/typescript/ui/components/ActivityIndicator.d.ts.map +1 -0
- package/lib/typescript/ui/components/AutoHeightScrollView.d.ts +23 -0
- package/lib/typescript/ui/components/AutoHeightScrollView.d.ts.map +1 -0
- package/lib/typescript/ui/components/BottomSheet.d.ts +29 -0
- package/lib/typescript/ui/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/ui/components/BottomSheetRouter.d.ts +14 -0
- package/lib/typescript/ui/components/BottomSheetRouter.d.ts.map +1 -0
- package/lib/typescript/ui/components/CrossFadeIcon.d.ts +27 -0
- package/lib/typescript/ui/components/CrossFadeIcon.d.ts.map +1 -0
- package/lib/typescript/ui/components/EmptyState.d.ts +8 -0
- package/lib/typescript/ui/components/EmptyState.d.ts.map +1 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts +5 -9
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +6 -7
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +6 -1
- package/lib/typescript/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/ui/components/HelperText.d.ts +47 -0
- package/lib/typescript/ui/components/HelperText.d.ts.map +1 -0
- package/lib/typescript/ui/components/Icon.d.ts +60 -0
- package/lib/typescript/ui/components/Icon.d.ts.map +1 -0
- package/lib/typescript/ui/components/IconButton/IconButton.d.ts +99 -0
- package/lib/typescript/ui/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/typescript/ui/components/IconButton/utils.d.ts +19 -0
- package/lib/typescript/ui/components/IconButton/utils.d.ts.map +1 -0
- package/lib/typescript/ui/components/LoadingState.d.ts +9 -0
- package/lib/typescript/ui/components/LoadingState.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +4 -5
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts +3 -8
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/ui/components/QuickActions.d.ts.map +1 -1
- package/lib/typescript/ui/components/Section.d.ts +1 -1
- package/lib/typescript/ui/components/Section.d.ts.map +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
- package/lib/typescript/ui/components/SettingRow.d.ts +14 -0
- package/lib/typescript/ui/components/SettingRow.d.ts.map +1 -0
- package/lib/typescript/ui/components/StepBasedScreen.d.ts +3 -2
- package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/ui/components/Surface.d.ts +76 -0
- package/lib/typescript/ui/components/Surface.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Addons/Outline.d.ts +16 -0
- package/lib/typescript/ui/components/TextField/Addons/Outline.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Addons/Underline.d.ts +19 -0
- package/lib/typescript/ui/components/TextField/Addons/Underline.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +45 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAdornment.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAffix.d.ts +73 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldAffix.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldIcon.d.ts +78 -0
- package/lib/typescript/ui/components/TextField/Adornment/TextFieldIcon.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/enums.d.ts +13 -0
- package/lib/typescript/ui/components/TextField/Adornment/enums.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/types.d.ts +12 -0
- package/lib/typescript/ui/components/TextField/Adornment/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts +12 -0
- package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Label/InputLabel.d.ts +5 -0
- package/lib/typescript/ui/components/TextField/Label/InputLabel.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/Label/LabelBackground.d.ts +4 -0
- package/lib/typescript/ui/components/TextField/Label/LabelBackground.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/TextFieldFlat.d.ts +4 -0
- package/lib/typescript/ui/components/TextField/TextFieldFlat.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/TextFieldOutlined.d.ts +4 -0
- package/lib/typescript/ui/components/TextField/TextFieldOutlined.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/constants.d.ts +32 -0
- package/lib/typescript/ui/components/TextField/constants.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/helpers.d.ts +97 -0
- package/lib/typescript/ui/components/TextField/helpers.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField/types.d.ts +156 -0
- package/lib/typescript/ui/components/TextField/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/TextField.d.ts +192 -0
- package/lib/typescript/ui/components/TextField.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/Pressable.d.ts +13 -0
- package/lib/typescript/ui/components/TouchableRipple/Pressable.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.d.ts +62 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.native.d.ts +25 -0
- package/lib/typescript/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -0
- package/lib/typescript/ui/components/TouchableRipple/utils.d.ts +11 -0
- package/lib/typescript/ui/components/TouchableRipple/utils.d.ts.map +1 -0
- package/lib/typescript/ui/components/Typography/AnimatedText.d.ts +35 -0
- package/lib/typescript/ui/components/Typography/AnimatedText.d.ts.map +1 -0
- package/lib/typescript/ui/components/Typography/types.d.ts +19 -0
- package/lib/typescript/ui/components/Typography/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/FileDetailsModal.d.ts +15 -0
- package/lib/typescript/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/FileViewer.d.ts +18 -0
- package/lib/typescript/ui/components/fileManagement/FileViewer.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/UploadPreview.d.ts +21 -0
- package/lib/typescript/ui/components/fileManagement/UploadPreview.d.ts.map +1 -0
- package/lib/typescript/ui/components/fileManagement/styles.d.ts +860 -0
- package/lib/typescript/ui/components/fileManagement/styles.d.ts.map +1 -0
- package/lib/typescript/ui/components/index.d.ts +4 -1
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/profile/EditBioModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/EditBioModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditDisplayNameModal.d.ts +12 -0
- package/lib/typescript/ui/components/profile/EditDisplayNameModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditEmailModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/EditEmailModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditLinksModal.d.ts +18 -0
- package/lib/typescript/ui/components/profile/EditLinksModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditLocationModal.d.ts +20 -0
- package/lib/typescript/ui/components/profile/EditLocationModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/EditUsernameModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/EditUsernameModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/profile/TwoFactorSetupModal.d.ts +11 -0
- package/lib/typescript/ui/components/profile/TwoFactorSetupModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/styles/overlay.d.ts +4 -0
- package/lib/typescript/ui/components/styles/overlay.d.ts.map +1 -0
- package/lib/typescript/ui/components/styles/shadow.d.ts +3 -0
- package/lib/typescript/ui/components/styles/shadow.d.ts.map +1 -0
- package/lib/typescript/ui/components/theming.d.ts +8 -0
- package/lib/typescript/ui/components/theming.d.ts.map +1 -0
- package/lib/typescript/ui/components/types.d.ts +80 -0
- package/lib/typescript/ui/components/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/forwardRef.d.ts +12 -0
- package/lib/typescript/ui/components/utils/forwardRef.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/hasTouchHandler.d.ts +6 -0
- package/lib/typescript/ui/components/utils/hasTouchHandler.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/roundLayoutSize.d.ts +2 -0
- package/lib/typescript/ui/components/utils/roundLayoutSize.d.ts.map +1 -0
- package/lib/typescript/ui/components/utils/splitStyles.d.ts +20 -0
- package/lib/typescript/ui/components/utils/splitStyles.d.ts.map +1 -0
- package/lib/typescript/ui/constants/iconColors.d.ts +130 -0
- package/lib/typescript/ui/constants/iconColors.d.ts.map +1 -0
- package/lib/typescript/ui/constants/spacing.d.ts +33 -0
- package/lib/typescript/ui/constants/spacing.d.ts.map +1 -0
- package/lib/typescript/ui/constants/theme.d.ts +97 -0
- package/lib/typescript/ui/constants/theme.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +23 -17
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/context/ThemeContext.d.ts +19 -0
- package/lib/typescript/ui/context/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +51 -0
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts +27 -0
- package/lib/typescript/ui/context/hooks/useDeviceManagement.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +25 -0
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts +39 -0
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts.map +1 -0
- package/lib/typescript/ui/context/hooks/useStorage.d.ts +22 -0
- package/lib/typescript/ui/context/hooks/useStorage.d.ts.map +1 -0
- package/lib/typescript/ui/context/utils/errorHandlers.d.ts +30 -0
- package/lib/typescript/ui/context/utils/errorHandlers.d.ts.map +1 -0
- package/lib/typescript/ui/context/utils/sessionHelpers.d.ts +59 -0
- package/lib/typescript/ui/context/utils/sessionHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/context/utils/storageHelpers.d.ts +31 -0
- package/lib/typescript/ui/context/utils/storageHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/index.d.ts +2 -0
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/use-color-scheme.d.ts +8 -0
- package/lib/typescript/ui/hooks/use-color-scheme.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/use-haptic-press.d.ts +8 -0
- package/lib/typescript/ui/hooks/use-haptic-press.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts +27 -0
- package/lib/typescript/ui/hooks/useDeviceManagement.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useLanguageManagement.d.ts +25 -0
- package/lib/typescript/ui/hooks/useLanguageManagement.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useProfileEditing.d.ts +36 -0
- package/lib/typescript/ui/hooks/useProfileEditing.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts +39 -0
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useStorage.d.ts +22 -0
- package/lib/typescript/ui/hooks/useStorage.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useThemeColors.d.ts +94 -0
- package/lib/typescript/ui/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useThemeStyles.d.ts +45 -0
- package/lib/typescript/ui/hooks/useThemeStyles.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +2 -2
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/bottomSheetManager.d.ts +74 -0
- package/lib/typescript/ui/navigation/bottomSheetManager.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/routes.d.ts +4 -7
- package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +1 -36
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts +16 -0
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +1 -2
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +0 -10
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/ui/styles/spacing.d.ts +7 -1
- package/lib/typescript/ui/styles/spacing.d.ts.map +1 -1
- package/lib/typescript/ui/types/fileManagement.d.ts +41 -0
- package/lib/typescript/ui/types/fileManagement.d.ts.map +1 -0
- package/lib/typescript/ui/types/navigation.d.ts +36 -0
- package/lib/typescript/ui/types/navigation.d.ts.map +1 -0
- package/lib/typescript/ui/utils/colorUtils.d.ts +14 -0
- package/lib/typescript/ui/utils/colorUtils.d.ts.map +1 -0
- package/lib/typescript/ui/utils/errorHandlers.d.ts +30 -0
- package/lib/typescript/ui/utils/errorHandlers.d.ts.map +1 -0
- package/lib/typescript/ui/utils/fileManagement.d.ts +39 -0
- package/lib/typescript/ui/utils/fileManagement.d.ts.map +1 -0
- package/lib/typescript/ui/utils/sessionHelpers.d.ts +59 -0
- package/lib/typescript/ui/utils/sessionHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/utils/storageHelpers.d.ts +31 -0
- package/lib/typescript/ui/utils/storageHelpers.d.ts.map +1 -0
- package/lib/typescript/ui/utils/themeUtils.d.ts +24 -0
- package/lib/typescript/ui/utils/themeUtils.d.ts.map +1 -0
- package/lib/typescript/ui/utils/user-utils.d.ts +29 -0
- package/lib/typescript/ui/utils/user-utils.d.ts.map +1 -0
- package/lib/typescript/utils/errorUtils.d.ts.map +1 -1
- package/package.json +26 -15
- package/src/assets/lottie/welcomeheader_background_op1.json +1 -0
- package/src/core/HttpService.ts +97 -4
- package/src/core/OxyServices.base.ts +3 -1
- package/src/core/mixins/OxyServices.assets.ts +225 -27
- package/src/core/mixins/OxyServices.auth.ts +144 -80
- package/src/crypto/index.ts +21 -0
- package/src/crypto/keyManager.ts +214 -0
- package/src/crypto/recoveryPhrase.ts +147 -0
- package/src/crypto/signatureService.ts +280 -0
- package/src/i18n/locales/en-US.json +4 -0
- package/src/index.ts +13 -0
- package/src/models/interfaces.ts +1 -0
- package/src/types/bip39.d.ts +29 -0
- package/src/types/color.d.ts +19 -0
- package/src/types/elliptic.d.ts +61 -0
- package/src/types/expo-crypto.d.ts +29 -0
- package/src/types/expo-random.d.ts +9 -0
- package/src/types/expo-secure-store.d.ts +21 -0
- package/src/types/expo-vector-icons.d.ts +9 -0
- package/src/ui/components/ActivityIndicator.tsx +254 -0
- package/src/ui/components/AutoHeightScrollView.tsx +50 -0
- package/src/ui/components/BottomSheet.tsx +443 -0
- package/src/ui/components/BottomSheetRouter.tsx +407 -0
- package/src/ui/components/CrossFadeIcon.tsx +140 -0
- package/src/ui/components/EmptyState.tsx +39 -0
- package/src/ui/components/GroupedItem.tsx +98 -96
- package/src/ui/components/GroupedSection.tsx +24 -29
- package/src/ui/components/Header.tsx +129 -49
- package/src/ui/components/HelperText.tsx +160 -0
- package/src/ui/components/Icon.tsx +181 -0
- package/src/ui/components/IconButton/IconButton.tsx +235 -0
- package/src/ui/components/IconButton/utils.ts +190 -0
- package/src/ui/components/LoadingState.tsx +46 -0
- package/src/ui/components/OxyPayButton.tsx +1 -12
- package/src/ui/components/OxyProvider.tsx +49 -409
- package/src/ui/components/OxySignInButton.tsx +11 -18
- package/src/ui/components/ProfileCard.tsx +7 -4
- package/src/ui/components/QuickActions.tsx +7 -4
- package/src/ui/components/Section.tsx +6 -2
- package/src/ui/components/SectionTitle.tsx +7 -4
- package/src/ui/components/SettingRow.tsx +76 -0
- package/src/ui/components/StepBasedScreen.tsx +205 -187
- package/src/ui/components/Surface.tsx +384 -0
- package/src/ui/components/TextField/Addons/Outline.tsx +64 -0
- package/src/ui/components/TextField/Addons/Underline.tsx +78 -0
- package/src/ui/components/TextField/Adornment/TextFieldAdornment.tsx +208 -0
- package/src/ui/components/TextField/Adornment/TextFieldAffix.tsx +212 -0
- package/src/ui/components/TextField/Adornment/TextFieldIcon.tsx +195 -0
- package/src/ui/components/TextField/Adornment/enums.tsx +12 -0
- package/src/ui/components/TextField/Adornment/types.tsx +11 -0
- package/src/ui/components/TextField/Adornment/utils.ts +66 -0
- package/src/ui/components/TextField/Label/InputLabel.tsx +219 -0
- package/src/ui/components/TextField/Label/LabelBackground.tsx +100 -0
- package/src/ui/components/TextField/TextFieldFlat.tsx +488 -0
- package/src/ui/components/TextField/TextFieldOutlined.tsx +464 -0
- package/src/ui/components/TextField/constants.tsx +48 -0
- package/src/ui/components/TextField/helpers.tsx +612 -0
- package/src/ui/components/TextField/types.tsx +156 -0
- package/src/ui/components/TextField.tsx +578 -0
- package/src/ui/components/TouchableRipple/Pressable.tsx +41 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.native.tsx +146 -0
- package/src/ui/components/TouchableRipple/TouchableRipple.tsx +347 -0
- package/src/ui/components/TouchableRipple/utils.ts +66 -0
- package/src/ui/components/Typography/AnimatedText.tsx +107 -0
- package/src/ui/components/Typography/types.tsx +22 -0
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +137 -0
- package/src/ui/components/fileManagement/FileViewer.tsx +380 -0
- package/src/ui/components/fileManagement/UploadPreview.tsx +175 -0
- package/src/ui/components/fileManagement/styles.ts +860 -0
- package/src/ui/components/index.ts +4 -1
- package/src/ui/components/profile/EditBioModal.tsx +184 -0
- package/src/ui/components/profile/EditDisplayNameModal.tsx +205 -0
- package/src/ui/components/profile/EditEmailModal.tsx +188 -0
- package/src/ui/components/profile/EditLinksModal.tsx +316 -0
- package/src/ui/components/profile/EditLocationModal.tsx +278 -0
- package/src/ui/components/profile/EditUsernameModal.tsx +183 -0
- package/src/ui/components/profile/TwoFactorSetupModal.tsx +442 -0
- package/src/ui/components/styles/overlay.tsx +88 -0
- package/src/ui/components/styles/shadow.tsx +136 -0
- package/src/ui/components/theming.tsx +114 -0
- package/src/ui/components/types.tsx +90 -0
- package/src/ui/components/utils/forwardRef.tsx +23 -0
- package/src/ui/components/utils/hasTouchHandler.tsx +23 -0
- package/src/ui/components/utils/roundLayoutSize.ts +2 -0
- package/src/ui/components/utils/splitStyles.ts +60 -0
- package/src/ui/constants/iconColors.ts +88 -0
- package/src/ui/constants/spacing.ts +45 -0
- package/src/ui/constants/theme.ts +120 -0
- package/src/ui/context/OxyContext.tsx +276 -894
- package/src/ui/context/ThemeContext.tsx +41 -0
- package/src/ui/context/hooks/useAuthOperations.ts +400 -0
- package/src/ui/context/hooks/useDeviceManagement.ts +108 -0
- package/src/ui/context/hooks/useLanguageManagement.ts +152 -0
- package/src/ui/context/hooks/useSessionManagement.ts +378 -0
- package/src/ui/context/hooks/useStorage.ts +104 -0
- package/src/ui/context/utils/errorHandlers.ts +136 -0
- package/src/ui/context/utils/sessionHelpers.ts +146 -0
- package/src/ui/context/utils/storageHelpers.ts +134 -0
- package/src/ui/hooks/index.ts +3 -1
- package/src/ui/hooks/use-color-scheme.ts +24 -0
- package/src/ui/hooks/use-haptic-press.ts +15 -0
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useDeviceManagement.ts +108 -0
- package/src/ui/hooks/useLanguageManagement.ts +152 -0
- package/src/ui/hooks/useProfileEditing.ts +151 -0
- package/src/ui/hooks/useSessionManagement.ts +378 -0
- package/src/ui/hooks/useStorage.ts +104 -0
- package/src/ui/hooks/useThemeColors.ts +26 -0
- package/src/ui/hooks/useThemeStyles.ts +85 -0
- package/src/ui/index.ts +1 -4
- package/src/ui/navigation/bottomSheetManager.ts +191 -0
- package/src/ui/navigation/routes.ts +107 -189
- package/src/ui/screens/AccountCenterScreen.tsx +67 -63
- package/src/ui/screens/AccountOverviewScreen.tsx +237 -95
- package/src/ui/screens/AccountSettingsScreen.tsx +546 -474
- package/src/ui/screens/AccountSwitcherScreen.tsx +113 -116
- package/src/ui/screens/AccountVerificationScreen.tsx +18 -20
- package/src/ui/screens/AppInfoScreen.tsx +37 -38
- package/src/ui/screens/FeedbackScreen.tsx +15 -12
- package/src/ui/screens/FileManagementScreen.tsx +764 -2026
- package/src/ui/screens/HelpSupportScreen.tsx +30 -23
- package/src/ui/screens/HistoryViewScreen.tsx +25 -56
- package/src/ui/screens/LanguageSelectorScreen.tsx +84 -170
- package/src/ui/screens/LegalDocumentsScreen.tsx +18 -41
- package/src/ui/screens/OxyAuthScreen.tsx +403 -0
- package/src/ui/screens/PaymentGatewayScreen.tsx +20 -22
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +13 -10
- package/src/ui/screens/PrivacySettingsScreen.tsx +150 -198
- package/src/ui/screens/ProfileScreen.tsx +7 -6
- package/src/ui/screens/SavesCollectionsScreen.tsx +39 -62
- package/src/ui/screens/SearchSettingsScreen.tsx +36 -86
- package/src/ui/screens/SessionManagementScreen.tsx +25 -17
- package/src/ui/screens/UserLinksScreen.tsx +10 -11
- package/src/ui/screens/WelcomeNewUserScreen.tsx +41 -41
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +13 -9
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +70 -70
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +96 -96
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +15 -10
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +605 -60
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +14 -9
- package/src/ui/stores/authStore.ts +1 -1
- package/src/ui/styles/authStyles.ts +5 -11
- package/src/ui/styles/spacing.ts +21 -2
- package/src/ui/styles/theme.ts +1 -1
- package/src/ui/types/fileManagement.ts +51 -0
- package/src/ui/types/navigation.ts +61 -0
- package/src/ui/utils/colorUtils.ts +46 -0
- package/src/ui/utils/errorHandlers.ts +136 -0
- package/src/ui/utils/fileManagement.ts +190 -0
- package/src/ui/utils/sessionHelpers.ts +146 -0
- package/src/ui/utils/storageHelpers.ts +134 -0
- package/src/ui/utils/themeUtils.ts +43 -0
- package/src/ui/utils/user-utils.ts +58 -0
- package/src/utils/errorUtils.ts +14 -4
- package/lib/commonjs/ui/components/internal/TextField.js +0 -665
- package/lib/commonjs/ui/components/internal/TextField.js.map +0 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +0 -213
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +0 -1
- package/lib/commonjs/ui/navigation/types.js +0 -13
- package/lib/commonjs/ui/navigation/types.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +0 -298
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +0 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +0 -137
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +0 -270
- package/lib/commonjs/ui/screens/SignInScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +0 -229
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +0 -135
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +0 -165
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +0 -159
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +0 -144
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +0 -358
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +0 -188
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +0 -509
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +0 -200
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +0 -185
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +0 -138
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +0 -1
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +0 -150
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/ui/components/internal/TextField.js +0 -660
- package/lib/module/ui/components/internal/TextField.js.map +0 -1
- package/lib/module/ui/navigation/OxyRouter.js +0 -209
- package/lib/module/ui/navigation/OxyRouter.js.map +0 -1
- package/lib/module/ui/navigation/types.js +0 -22
- package/lib/module/ui/navigation/types.js.map +0 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +0 -295
- package/lib/module/ui/screens/AccountManagementDemo.js.map +0 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +0 -133
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +0 -1
- package/lib/module/ui/screens/SignInScreen.js +0 -265
- package/lib/module/ui/screens/SignInScreen.js.map +0 -1
- package/lib/module/ui/screens/SignUpScreen.js +0 -224
- package/lib/module/ui/screens/SignUpScreen.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverRequestStep.js +0 -130
- package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +0 -160
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js +0 -154
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +0 -1
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js +0 -139
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignInPasswordStep.js +0 -353
- package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignInTotpStep.js +0 -183
- package/lib/module/ui/screens/steps/SignInTotpStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignInUsernameStep.js +0 -504
- package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js +0 -195
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js +0 -180
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js +0 -133
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +0 -1
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +0 -145
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +0 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts +0 -41
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +0 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts +0 -7
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +0 -1
- package/lib/typescript/ui/navigation/types.d.ts +0 -141
- package/lib/typescript/ui/navigation/types.d.ts.map +0 -1
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts +0 -8
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts.map +0 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +0 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +0 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts +0 -24
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts +0 -24
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts +0 -19
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts +0 -26
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +0 -30
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts +0 -19
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts +0 -28
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts +0 -26
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts +0 -27
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts +0 -17
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +0 -1
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts +0 -14
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +0 -1
- package/src/ui/components/internal/TextField.tsx +0 -808
- package/src/ui/navigation/OxyRouter.tsx +0 -216
- package/src/ui/navigation/types.ts +0 -164
- package/src/ui/screens/AccountManagementDemo.tsx +0 -297
- package/src/ui/screens/RecoverAccountScreen.tsx +0 -141
- package/src/ui/screens/SignInScreen.tsx +0 -297
- package/src/ui/screens/SignUpScreen.tsx +0 -239
- package/src/ui/screens/steps/RecoverRequestStep.tsx +0 -143
- package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +0 -162
- package/src/ui/screens/steps/RecoverSuccessStep.tsx +0 -148
- package/src/ui/screens/steps/RecoverVerifyStep.tsx +0 -154
- package/src/ui/screens/steps/SignInPasswordStep.tsx +0 -343
- package/src/ui/screens/steps/SignInTotpStep.tsx +0 -163
- package/src/ui/screens/steps/SignInUsernameStep.tsx +0 -560
- package/src/ui/screens/steps/SignUpIdentityStep.tsx +0 -217
- package/src/ui/screens/steps/SignUpSecurityStep.tsx +0 -207
- package/src/ui/screens/steps/SignUpSummaryStep.tsx +0 -155
- package/src/ui/screens/steps/SignUpWelcomeStep.tsx +0 -127
|
@@ -6,70 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useOxy = exports.default = exports.OxyProvider = exports.OxyContextProvider = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _core = require("../../core");
|
|
9
|
-
var _sessionUtils = require("../../utils/sessionUtils");
|
|
10
|
-
var _deviceManager = require("../../utils/deviceManager");
|
|
11
|
-
var _useSessionSocket = require("../hooks/useSessionSocket");
|
|
12
9
|
var _sonner = require("../../lib/sonner");
|
|
13
10
|
var _authStore = require("../stores/authStore");
|
|
14
|
-
var
|
|
11
|
+
var _shallow = require("zustand/react/shallow");
|
|
12
|
+
var _useSessionSocket = require("../hooks/useSessionSocket");
|
|
13
|
+
var _useStorage = require("../hooks/useStorage");
|
|
14
|
+
var _useLanguageManagement = require("../hooks/useLanguageManagement");
|
|
15
|
+
var _useSessionManagement = require("../hooks/useSessionManagement");
|
|
16
|
+
var _useAuthOperations = require("./hooks/useAuthOperations");
|
|
17
|
+
var _useDeviceManagement = require("../hooks/useDeviceManagement");
|
|
18
|
+
var _storageHelpers = require("../utils/storageHelpers");
|
|
19
|
+
var _errorHandlers = require("../utils/errorHandlers");
|
|
20
|
+
var _bottomSheetManager = require("../navigation/bottomSheetManager");
|
|
15
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } // Define the context shape
|
|
17
|
-
// Create the context with default values
|
|
18
22
|
const OxyContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
19
|
-
|
|
20
|
-
// Props for the OxyContextProvider
|
|
21
|
-
|
|
22
|
-
// Platform storage implementation
|
|
23
|
-
|
|
24
|
-
// Web localStorage implementation
|
|
25
|
-
class WebStorage {
|
|
26
|
-
async getItem(key) {
|
|
27
|
-
return localStorage.getItem(key);
|
|
28
|
-
}
|
|
29
|
-
async setItem(key, value) {
|
|
30
|
-
localStorage.setItem(key, value);
|
|
31
|
-
}
|
|
32
|
-
async removeItem(key) {
|
|
33
|
-
localStorage.removeItem(key);
|
|
34
|
-
}
|
|
35
|
-
async clear() {
|
|
36
|
-
localStorage.clear();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// React Native AsyncStorage implementation
|
|
41
|
-
let AsyncStorage;
|
|
42
|
-
|
|
43
|
-
// Determine the platform and set up storage
|
|
44
|
-
const isReactNative = () => {
|
|
45
|
-
return typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Get appropriate storage for the platform
|
|
49
|
-
const getStorage = async () => {
|
|
50
|
-
if (isReactNative()) {
|
|
51
|
-
if (!AsyncStorage) {
|
|
52
|
-
try {
|
|
53
|
-
const asyncStorageModule = await Promise.resolve().then(() => _interopRequireWildcard(require('@react-native-async-storage/async-storage')));
|
|
54
|
-
AsyncStorage = asyncStorageModule.default;
|
|
55
|
-
} catch (error) {
|
|
56
|
-
console.error('Failed to import AsyncStorage:', error);
|
|
57
|
-
throw new Error('AsyncStorage is required in React Native environment');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return AsyncStorage;
|
|
61
|
-
}
|
|
62
|
-
return new WebStorage();
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// Storage keys for sessions
|
|
66
|
-
const getStorageKeys = (prefix = 'oxy_session') => ({
|
|
67
|
-
activeSessionId: `${prefix}_active_session_id`,
|
|
68
|
-
// Only store the active session ID
|
|
69
|
-
sessionIds: `${prefix}_session_ids`,
|
|
70
|
-
// Store all session IDs for quick account loading
|
|
71
|
-
language: `${prefix}_language` // Store the selected language
|
|
72
|
-
});
|
|
73
23
|
let cachedUseFollowHook = null;
|
|
74
24
|
const loadUseFollowHook = () => {
|
|
75
25
|
if (cachedUseFollowHook) {
|
|
@@ -99,10 +49,8 @@ const OxyProvider = ({
|
|
|
99
49
|
baseURL,
|
|
100
50
|
storageKeyPrefix = 'oxy_session',
|
|
101
51
|
onAuthStateChange,
|
|
102
|
-
onError
|
|
103
|
-
bottomSheetRef
|
|
52
|
+
onError
|
|
104
53
|
}) => {
|
|
105
|
-
// Create oxyServices automatically if not provided
|
|
106
54
|
const oxyServicesRef = (0, _react.useRef)(null);
|
|
107
55
|
if (!oxyServicesRef.current) {
|
|
108
56
|
if (providedOxyServices) {
|
|
@@ -116,807 +64,214 @@ const OxyProvider = ({
|
|
|
116
64
|
}
|
|
117
65
|
}
|
|
118
66
|
const oxyServices = oxyServicesRef.current;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// Storage keys (memoized to prevent infinite loops) - declared early for use in helpers
|
|
144
|
-
const keys = (0, _react.useMemo)(() => getStorageKeys(storageKeyPrefix), [storageKeyPrefix]);
|
|
145
|
-
|
|
146
|
-
// Helper to apply language preference from user/server
|
|
147
|
-
const applyLanguagePreference = (0, _react.useCallback)(async user => {
|
|
148
|
-
const userLanguage = user?.language;
|
|
149
|
-
if (!userLanguage || !storage) return;
|
|
150
|
-
try {
|
|
151
|
-
const serverLang = (0, _languageUtils.normalizeLanguageCode)(userLanguage);
|
|
152
|
-
await storage.setItem(keys.language, serverLang);
|
|
153
|
-
setCurrentLanguage(serverLang);
|
|
154
|
-
} catch (e) {
|
|
155
|
-
if (__DEV__) {
|
|
156
|
-
console.warn('Failed to apply server language preference', e);
|
|
157
|
-
}
|
|
67
|
+
const {
|
|
68
|
+
user,
|
|
69
|
+
isAuthenticated,
|
|
70
|
+
isLoading,
|
|
71
|
+
error,
|
|
72
|
+
loginSuccess,
|
|
73
|
+
loginFailure,
|
|
74
|
+
logoutStore
|
|
75
|
+
} = (0, _authStore.useAuthStore)((0, _shallow.useShallow)(state => ({
|
|
76
|
+
user: state.user,
|
|
77
|
+
isAuthenticated: state.isAuthenticated,
|
|
78
|
+
isLoading: state.isLoading,
|
|
79
|
+
error: state.error,
|
|
80
|
+
loginSuccess: state.loginSuccess,
|
|
81
|
+
loginFailure: state.loginFailure,
|
|
82
|
+
logoutStore: state.logout
|
|
83
|
+
})));
|
|
84
|
+
const [tokenReady, setTokenReady] = (0, _react.useState)(true);
|
|
85
|
+
const initializedRef = (0, _react.useRef)(false);
|
|
86
|
+
const setAuthState = _authStore.useAuthStore.setState;
|
|
87
|
+
const logger = (0, _react.useCallback)((message, err) => {
|
|
88
|
+
if (__DEV__) {
|
|
89
|
+
console.warn(`[OxyContext] ${message}`, err);
|
|
158
90
|
}
|
|
159
|
-
}, [storage, keys.language]);
|
|
160
|
-
const mapSessionsToClient = (0, _react.useCallback)((sessions, fallbackDeviceId, fallbackUserId) => {
|
|
161
|
-
return sessions.map(s => ({
|
|
162
|
-
sessionId: s.sessionId,
|
|
163
|
-
deviceId: s.deviceId || fallbackDeviceId || '',
|
|
164
|
-
expiresAt: s.expiresAt || new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),
|
|
165
|
-
lastActive: s.lastActive || new Date().toISOString(),
|
|
166
|
-
userId: s.user?.id || s.userId || s.user?._id?.toString() || fallbackUserId || '',
|
|
167
|
-
isCurrent: Boolean(s.isCurrent)
|
|
168
|
-
}));
|
|
169
91
|
}, []);
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
92
|
+
const storageKeys = (0, _react.useMemo)(() => (0, _storageHelpers.getStorageKeys)(storageKeyPrefix), [storageKeyPrefix]);
|
|
93
|
+
const {
|
|
94
|
+
storage
|
|
95
|
+
} = (0, _useStorage.useStorage)({
|
|
96
|
+
onError,
|
|
97
|
+
logger
|
|
98
|
+
});
|
|
99
|
+
const {
|
|
100
|
+
currentLanguage,
|
|
101
|
+
metadata: currentLanguageMetadata,
|
|
102
|
+
languageName: currentLanguageName,
|
|
103
|
+
nativeLanguageName: currentNativeLanguageName,
|
|
104
|
+
setLanguage,
|
|
105
|
+
applyLanguagePreference
|
|
106
|
+
} = (0, _useLanguageManagement.useLanguageManagement)({
|
|
107
|
+
storage,
|
|
108
|
+
languageKey: storageKeys.language,
|
|
109
|
+
onError,
|
|
110
|
+
logger
|
|
111
|
+
});
|
|
112
|
+
const {
|
|
113
|
+
sessions,
|
|
114
|
+
activeSessionId,
|
|
115
|
+
setActiveSessionId,
|
|
116
|
+
updateSessions,
|
|
117
|
+
switchSession,
|
|
118
|
+
refreshSessions,
|
|
119
|
+
clearSessionState,
|
|
120
|
+
saveActiveSessionId,
|
|
121
|
+
trackRemovedSession
|
|
122
|
+
} = (0, _useSessionManagement.useSessionManagement)({
|
|
123
|
+
oxyServices,
|
|
124
|
+
storage,
|
|
125
|
+
storageKeyPrefix,
|
|
126
|
+
loginSuccess,
|
|
127
|
+
logoutStore,
|
|
128
|
+
applyLanguagePreference,
|
|
129
|
+
onAuthStateChange,
|
|
130
|
+
onError,
|
|
131
|
+
setAuthError: message => setAuthState({
|
|
132
|
+
error: message
|
|
133
|
+
}),
|
|
134
|
+
logger,
|
|
135
|
+
setTokenReady
|
|
136
|
+
});
|
|
137
|
+
const {
|
|
138
|
+
createIdentity,
|
|
139
|
+
importIdentity,
|
|
140
|
+
signIn,
|
|
141
|
+
logout,
|
|
142
|
+
logoutAll,
|
|
143
|
+
hasIdentity,
|
|
144
|
+
getPublicKey
|
|
145
|
+
} = (0, _useAuthOperations.useAuthOperations)({
|
|
146
|
+
oxyServices,
|
|
147
|
+
storage,
|
|
148
|
+
sessions,
|
|
149
|
+
activeSessionId,
|
|
150
|
+
setActiveSessionId,
|
|
151
|
+
updateSessions,
|
|
152
|
+
saveActiveSessionId,
|
|
153
|
+
clearSessionState,
|
|
154
|
+
switchSession,
|
|
155
|
+
applyLanguagePreference,
|
|
156
|
+
onAuthStateChange,
|
|
157
|
+
onError,
|
|
158
|
+
loginSuccess,
|
|
159
|
+
loginFailure,
|
|
160
|
+
logoutStore,
|
|
161
|
+
setAuthState,
|
|
162
|
+
logger
|
|
163
|
+
});
|
|
164
|
+
const {
|
|
165
|
+
getDeviceSessions,
|
|
166
|
+
logoutAllDeviceSessions,
|
|
167
|
+
updateDeviceName
|
|
168
|
+
} = (0, _useDeviceManagement.useDeviceManagement)({
|
|
169
|
+
oxyServices,
|
|
170
|
+
activeSessionId,
|
|
171
|
+
onError,
|
|
172
|
+
clearSessionState,
|
|
173
|
+
logger
|
|
174
|
+
});
|
|
175
|
+
const useFollowHook = loadUseFollowHook();
|
|
176
|
+
const restoreSessionsFromStorage = (0, _react.useCallback)(async () => {
|
|
177
|
+
if (!storage) {
|
|
178
|
+
return;
|
|
181
179
|
}
|
|
182
|
-
|
|
183
|
-
const updateSessions = (0, _react.useCallback)((newSessions, mergeWithExisting = false) => {
|
|
184
|
-
setSessions(prevSessions => {
|
|
185
|
-
const sessionsToProcess = mergeWithExisting ? (0, _sessionUtils.mergeSessions)(prevSessions, newSessions, activeSessionId, false) : (0, _sessionUtils.normalizeAndSortSessions)(newSessions, activeSessionId, false);
|
|
186
|
-
|
|
187
|
-
// Save all session IDs to storage
|
|
188
|
-
if (storage) {
|
|
189
|
-
const allSessionIds = sessionsToProcess.map(s => s.sessionId);
|
|
190
|
-
saveSessionIds(allSessionIds).catch(() => {
|
|
191
|
-
// Ignore errors - non-critical
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
return (0, _sessionUtils.sessionsArraysEqual)(prevSessions, sessionsToProcess) ? prevSessions : sessionsToProcess;
|
|
195
|
-
});
|
|
196
|
-
}, [activeSessionId, storage, saveSessionIds]);
|
|
197
|
-
|
|
198
|
-
// Token ready state - start optimistically so children render immediately
|
|
199
|
-
const [tokenReady, setTokenReady] = (0, _react.useState)(true);
|
|
200
|
-
|
|
201
|
-
// Clear all storage
|
|
202
|
-
const clearAllStorage = (0, _react.useCallback)(async () => {
|
|
203
|
-
if (!storage) return;
|
|
180
|
+
setTokenReady(false);
|
|
204
181
|
try {
|
|
205
|
-
await storage.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
onError?.({
|
|
212
|
-
message: 'Failed to clear storage',
|
|
213
|
-
code: 'STORAGE_ERROR',
|
|
214
|
-
status: 500
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
}, [storage, keys, onError]);
|
|
218
|
-
|
|
219
|
-
// Initialize storage
|
|
220
|
-
(0, _react.useEffect)(() => {
|
|
221
|
-
const initStorage = async () => {
|
|
222
|
-
try {
|
|
223
|
-
const platformStorage = await getStorage();
|
|
224
|
-
setStorage(platformStorage);
|
|
225
|
-
} catch (error) {
|
|
226
|
-
const errorMessage = error instanceof Error ? error.message : 'Failed to initialize storage';
|
|
227
|
-
_authStore.useAuthStore.setState({
|
|
228
|
-
error: errorMessage
|
|
229
|
-
});
|
|
230
|
-
onError?.({
|
|
231
|
-
message: errorMessage,
|
|
232
|
-
code: 'STORAGE_INIT_ERROR',
|
|
233
|
-
status: 500
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
initStorage();
|
|
238
|
-
}, [onError]);
|
|
239
|
-
|
|
240
|
-
// Initialize authentication state
|
|
241
|
-
// Note: We don't set isLoading during initialization to avoid showing spinners
|
|
242
|
-
// Children render immediately and can check isTokenReady/isAuthenticated themselves
|
|
243
|
-
(0, _react.useEffect)(() => {
|
|
244
|
-
const initAuth = async () => {
|
|
245
|
-
if (!storage) return;
|
|
246
|
-
// Don't set isLoading during initialization - let it happen in background
|
|
247
|
-
try {
|
|
248
|
-
// Load saved language preference
|
|
249
|
-
const savedLanguageRaw = await storage.getItem(keys.language);
|
|
250
|
-
const savedLanguage = (0, _languageUtils.normalizeLanguageCode)(savedLanguageRaw) || savedLanguageRaw;
|
|
251
|
-
if (savedLanguage) {
|
|
252
|
-
setCurrentLanguage(savedLanguage);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Load all stored session IDs and validate them
|
|
256
|
-
const storedSessionIdsJson = await storage.getItem(keys.sessionIds);
|
|
257
|
-
const storedSessionIds = storedSessionIdsJson ? JSON.parse(storedSessionIdsJson) : [];
|
|
258
|
-
|
|
259
|
-
// Try to restore active session from storage
|
|
260
|
-
const storedActiveSessionId = await storage.getItem(keys.activeSessionId);
|
|
261
|
-
const validSessions = [];
|
|
262
|
-
|
|
263
|
-
// If we have stored session IDs, validate them (even without active session)
|
|
264
|
-
if (storedSessionIds.length > 0) {
|
|
265
|
-
if (__DEV__) {
|
|
266
|
-
console.log('Loading stored sessions on init:', storedSessionIds.length);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// Validate each stored session ID and build session list
|
|
270
|
-
for (const sessionId of storedSessionIds) {
|
|
271
|
-
try {
|
|
272
|
-
const validation = await oxyServices.validateSession(sessionId, {
|
|
273
|
-
useHeaderValidation: true
|
|
274
|
-
});
|
|
275
|
-
if (validation.valid && validation.user) {
|
|
276
|
-
validSessions.push({
|
|
277
|
-
sessionId,
|
|
278
|
-
userId: validation.user.id?.toString() || '',
|
|
279
|
-
deviceId: '',
|
|
280
|
-
expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),
|
|
281
|
-
lastActive: new Date().toISOString(),
|
|
282
|
-
isCurrent: sessionId === storedActiveSessionId
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
} catch (e) {
|
|
286
|
-
// Session invalid, skip it
|
|
287
|
-
if (__DEV__) {
|
|
288
|
-
console.warn('Session validation failed for:', sessionId, e);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// Update sessions list with validated sessions (even if no active session)
|
|
294
|
-
if (validSessions.length > 0) {
|
|
295
|
-
updateSessions(validSessions, false);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// If we have an active session, authenticate with it
|
|
300
|
-
if (storedActiveSessionId) {
|
|
182
|
+
const storedSessionIdsJson = await storage.getItem(storageKeys.sessionIds);
|
|
183
|
+
const storedSessionIds = storedSessionIdsJson ? JSON.parse(storedSessionIdsJson) : [];
|
|
184
|
+
const storedActiveSessionId = await storage.getItem(storageKeys.activeSessionId);
|
|
185
|
+
const validSessions = [];
|
|
186
|
+
if (storedSessionIds.length > 0) {
|
|
187
|
+
for (const sessionId of storedSessionIds) {
|
|
301
188
|
try {
|
|
302
|
-
const validation = await oxyServices.validateSession(
|
|
189
|
+
const validation = await oxyServices.validateSession(sessionId, {
|
|
303
190
|
useHeaderValidation: true
|
|
304
191
|
});
|
|
305
|
-
if (validation.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
192
|
+
if (validation?.valid && validation.user) {
|
|
193
|
+
const now = new Date();
|
|
194
|
+
validSessions.push({
|
|
195
|
+
sessionId,
|
|
196
|
+
deviceId: '',
|
|
197
|
+
expiresAt: new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000).toISOString(),
|
|
198
|
+
lastActive: now.toISOString(),
|
|
199
|
+
userId: validation.user.id?.toString() ?? '',
|
|
200
|
+
isCurrent: sessionId === storedActiveSessionId
|
|
314
201
|
});
|
|
315
|
-
await applyLanguagePreference(fullUser);
|
|
316
|
-
try {
|
|
317
|
-
const deviceSessions = await oxyServices.getDeviceSessions(storedActiveSessionId);
|
|
318
|
-
const allDeviceSessions = mapSessionsToClient(deviceSessions, undefined, fullUser.id);
|
|
319
|
-
updateSessions(allDeviceSessions, true);
|
|
320
|
-
} catch (e) {
|
|
321
|
-
if (__DEV__) {
|
|
322
|
-
console.warn('Failed to get device sessions on init, falling back to user sessions:', e);
|
|
323
|
-
}
|
|
324
|
-
const serverSessions = await oxyServices.getSessionsBySessionId(storedActiveSessionId);
|
|
325
|
-
updateSessions(mapSessionsToClient(serverSessions, undefined, fullUser.id), false);
|
|
326
|
-
}
|
|
327
|
-
onAuthStateChange?.(fullUser);
|
|
328
|
-
} else {
|
|
329
|
-
// Active session invalid, remove it but keep other sessions
|
|
330
|
-
await storage.removeItem(keys.activeSessionId);
|
|
331
|
-
// Update session list to remove invalid active session
|
|
332
|
-
updateSessions(validSessions.filter(s => s.sessionId !== storedActiveSessionId), false);
|
|
333
|
-
}
|
|
334
|
-
} catch (e) {
|
|
335
|
-
if (__DEV__) {
|
|
336
|
-
console.error('Active session validation error', e);
|
|
337
202
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
updateSessions(validSessions.filter(s => s.sessionId !== storedActiveSessionId), false);
|
|
203
|
+
} catch (validationError) {
|
|
204
|
+
logger('Session validation failed during init', validationError);
|
|
341
205
|
}
|
|
342
206
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
207
|
+
if (validSessions.length > 0) {
|
|
208
|
+
updateSessions(validSessions, {
|
|
209
|
+
merge: false
|
|
210
|
+
});
|
|
347
211
|
}
|
|
348
|
-
await clearAllStorage();
|
|
349
|
-
setTokenReady(true);
|
|
350
212
|
}
|
|
351
|
-
|
|
352
|
-
initAuth();
|
|
353
|
-
}, [storage, oxyServices, keys, onAuthStateChange, loginSuccess, clearAllStorage, applyLanguagePreference, mapSessionsToClient, updateSessions]);
|
|
354
|
-
|
|
355
|
-
// Save active session ID to storage (only session ID, no user data)
|
|
356
|
-
const saveActiveSessionId = (0, _react.useCallback)(async sessionId => {
|
|
357
|
-
if (!storage) return;
|
|
358
|
-
await storage.setItem(keys.activeSessionId, sessionId);
|
|
359
|
-
}, [storage, keys.activeSessionId]);
|
|
360
|
-
const switchToSession = (0, _react.useCallback)(async sessionId => {
|
|
361
|
-
try {
|
|
362
|
-
const validation = await oxyServices.validateSession(sessionId, {
|
|
363
|
-
useHeaderValidation: true
|
|
364
|
-
});
|
|
365
|
-
if (!validation.valid) {
|
|
366
|
-
updateSessions(sessions.filter(s => s.sessionId !== sessionId), false);
|
|
367
|
-
throw new Error('Session is invalid or expired');
|
|
368
|
-
}
|
|
369
|
-
if (!validation.user) {
|
|
370
|
-
throw new Error('User data not available from session validation');
|
|
371
|
-
}
|
|
372
|
-
const fullUser = validation.user;
|
|
373
|
-
await oxyServices.getTokenBySession(sessionId);
|
|
374
|
-
setTokenReady(true);
|
|
375
|
-
setActiveSessionId(sessionId);
|
|
376
|
-
loginSuccess(fullUser);
|
|
377
|
-
setMinimalUser({
|
|
378
|
-
id: fullUser.id,
|
|
379
|
-
username: fullUser.username,
|
|
380
|
-
avatar: fullUser.avatar
|
|
381
|
-
});
|
|
382
|
-
await saveActiveSessionId(sessionId);
|
|
383
|
-
await applyLanguagePreference(fullUser);
|
|
384
|
-
oxyServices.getDeviceSessions(sessionId).then(deviceSessions => {
|
|
385
|
-
const allDeviceSessions = mapSessionsToClient(deviceSessions, undefined, fullUser.id);
|
|
386
|
-
updateSessions(allDeviceSessions, true);
|
|
387
|
-
}).catch(error => {
|
|
388
|
-
if (__DEV__) console.warn('Failed to get device sessions after switch:', error);
|
|
389
|
-
});
|
|
390
|
-
onAuthStateChange?.(fullUser);
|
|
391
|
-
} catch (error) {
|
|
392
|
-
const isInvalidSession = error?.response?.status === 401 || error?.message?.includes('Invalid or expired session') || error?.message?.includes('Session is invalid');
|
|
393
|
-
if (isInvalidSession) {
|
|
394
|
-
updateSessions(sessions.filter(s => s.sessionId !== sessionId), false);
|
|
395
|
-
if (sessionId === activeSessionId && sessions.length > 1) {
|
|
396
|
-
const otherSessions = sessions.filter(s => s.sessionId !== sessionId);
|
|
397
|
-
for (const otherSession of otherSessions) {
|
|
398
|
-
try {
|
|
399
|
-
const otherValidation = await oxyServices.validateSession(otherSession.sessionId, {
|
|
400
|
-
useHeaderValidation: true
|
|
401
|
-
});
|
|
402
|
-
if (otherValidation.valid) {
|
|
403
|
-
await switchToSession(otherSession.sessionId);
|
|
404
|
-
return;
|
|
405
|
-
}
|
|
406
|
-
} catch {
|
|
407
|
-
// Continue to next session
|
|
408
|
-
continue;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
const errorMessage = error instanceof Error ? error.message : 'Failed to switch session';
|
|
414
|
-
if (__DEV__) {
|
|
415
|
-
console.error('Switch session error:', error);
|
|
416
|
-
}
|
|
417
|
-
_authStore.useAuthStore.setState({
|
|
418
|
-
error: errorMessage
|
|
419
|
-
});
|
|
420
|
-
onError?.({
|
|
421
|
-
message: errorMessage,
|
|
422
|
-
code: isInvalidSession ? 'INVALID_SESSION' : 'SESSION_SWITCH_ERROR',
|
|
423
|
-
status: isInvalidSession ? 401 : 500
|
|
424
|
-
});
|
|
425
|
-
setTokenReady(false);
|
|
426
|
-
throw error; // Re-throw so calling code can handle it
|
|
427
|
-
}
|
|
428
|
-
}, [oxyServices, onAuthStateChange, loginSuccess, saveActiveSessionId, applyLanguagePreference, mapSessionsToClient, onError, activeSessionId, sessions]);
|
|
429
|
-
const login = (0, _react.useCallback)(async (username, password, deviceName) => {
|
|
430
|
-
if (!storage) throw new Error('Storage not initialized');
|
|
431
|
-
_authStore.useAuthStore.setState({
|
|
432
|
-
isLoading: true,
|
|
433
|
-
error: null
|
|
434
|
-
});
|
|
435
|
-
try {
|
|
436
|
-
const deviceFingerprint = _deviceManager.DeviceManager.getDeviceFingerprint();
|
|
437
|
-
const deviceInfo = await _deviceManager.DeviceManager.getDeviceInfo();
|
|
438
|
-
const response = await oxyServices.signIn(username, password, deviceName || deviceInfo.deviceName || _deviceManager.DeviceManager.getDefaultDeviceName(), deviceFingerprint);
|
|
439
|
-
|
|
440
|
-
// Handle MFA requirement
|
|
441
|
-
if (response && 'mfaRequired' in response && response.mfaRequired) {
|
|
442
|
-
const mfaError = new Error('Multi-factor authentication required');
|
|
443
|
-
mfaError.code = 'MFA_REQUIRED';
|
|
444
|
-
mfaError.mfaToken = response.mfaToken;
|
|
445
|
-
mfaError.expiresAt = response.expiresAt;
|
|
446
|
-
throw mfaError;
|
|
447
|
-
}
|
|
448
|
-
const sessionResponse = response;
|
|
449
|
-
await oxyServices.getTokenBySession(sessionResponse.sessionId);
|
|
450
|
-
const fullUser = await oxyServices.getUserBySession(sessionResponse.sessionId);
|
|
451
|
-
let allDeviceSessions = [];
|
|
452
|
-
try {
|
|
453
|
-
const deviceSessions = await oxyServices.getDeviceSessions(sessionResponse.sessionId);
|
|
454
|
-
allDeviceSessions = mapSessionsToClient(deviceSessions, sessionResponse.deviceId, fullUser.id);
|
|
455
|
-
} catch (error) {
|
|
456
|
-
if (__DEV__) {
|
|
457
|
-
console.warn('Failed to get device sessions, falling back to user sessions:', error);
|
|
458
|
-
}
|
|
459
|
-
const serverSessions = await oxyServices.getSessionsBySessionId(sessionResponse.sessionId);
|
|
460
|
-
allDeviceSessions = mapSessionsToClient(serverSessions, undefined, fullUser.id);
|
|
461
|
-
}
|
|
462
|
-
const userUserId = fullUser.id?.toString();
|
|
463
|
-
const existingSession = allDeviceSessions.find(s => s.userId?.toString() === userUserId && s.sessionId !== sessionResponse.sessionId);
|
|
464
|
-
if (existingSession) {
|
|
213
|
+
if (storedActiveSessionId) {
|
|
465
214
|
try {
|
|
466
|
-
await
|
|
467
|
-
} catch (
|
|
468
|
-
if (
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
updateSessions(allDeviceSessions.filter(s => s.sessionId !== sessionResponse.sessionId), false);
|
|
476
|
-
onAuthStateChange?.(fullUser);
|
|
477
|
-
return fullUser;
|
|
478
|
-
}
|
|
479
|
-
setActiveSessionId(sessionResponse.sessionId);
|
|
480
|
-
await saveActiveSessionId(sessionResponse.sessionId);
|
|
481
|
-
loginSuccess(fullUser);
|
|
482
|
-
setMinimalUser(sessionResponse.user);
|
|
483
|
-
updateSessions(allDeviceSessions, true);
|
|
484
|
-
onAuthStateChange?.(fullUser);
|
|
485
|
-
return fullUser;
|
|
486
|
-
} catch (error) {
|
|
487
|
-
const errorMessage = error instanceof Error ? error.message : 'Login failed';
|
|
488
|
-
loginFailure(errorMessage);
|
|
489
|
-
onError?.({
|
|
490
|
-
message: errorMessage,
|
|
491
|
-
code: 'LOGIN_ERROR',
|
|
492
|
-
status: 401
|
|
493
|
-
});
|
|
494
|
-
throw error;
|
|
495
|
-
} finally {
|
|
496
|
-
_authStore.useAuthStore.setState({
|
|
497
|
-
isLoading: false
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
}, [storage, oxyServices, saveActiveSessionId, loginSuccess, onAuthStateChange, loginFailure, mapSessionsToClient, onError, sessions, switchToSession]);
|
|
501
|
-
|
|
502
|
-
// Clear session state without calling API (for remote removals)
|
|
503
|
-
const clearSessionState = (0, _react.useCallback)(async () => {
|
|
504
|
-
updateSessions([], false);
|
|
505
|
-
setActiveSessionId(null);
|
|
506
|
-
logoutStore();
|
|
507
|
-
setMinimalUser(null);
|
|
508
|
-
await clearAllStorage();
|
|
509
|
-
onAuthStateChange?.(null);
|
|
510
|
-
}, [updateSessions, logoutStore, clearAllStorage, onAuthStateChange]);
|
|
511
|
-
|
|
512
|
-
// Logout method
|
|
513
|
-
const logout = (0, _react.useCallback)(async targetSessionId => {
|
|
514
|
-
if (!activeSessionId) return;
|
|
515
|
-
try {
|
|
516
|
-
const sessionToLogout = targetSessionId || activeSessionId;
|
|
517
|
-
await oxyServices.logoutSession(activeSessionId, sessionToLogout);
|
|
518
|
-
const filteredSessions = sessions.filter(s => s.sessionId !== sessionToLogout);
|
|
519
|
-
updateSessions(filteredSessions, false);
|
|
520
|
-
if (sessionToLogout === activeSessionId) {
|
|
521
|
-
if (filteredSessions.length > 0) {
|
|
522
|
-
await switchToSession(filteredSessions[0].sessionId);
|
|
523
|
-
} else {
|
|
524
|
-
setActiveSessionId(null);
|
|
525
|
-
logoutStore();
|
|
526
|
-
setMinimalUser(null);
|
|
527
|
-
await storage?.removeItem(keys.activeSessionId);
|
|
528
|
-
if (onAuthStateChange) {
|
|
529
|
-
onAuthStateChange(null);
|
|
215
|
+
await switchSession(storedActiveSessionId);
|
|
216
|
+
} catch (switchError) {
|
|
217
|
+
if ((0, _errorHandlers.isInvalidSessionError)(switchError)) {
|
|
218
|
+
await storage.removeItem(storageKeys.activeSessionId);
|
|
219
|
+
updateSessions(validSessions.filter(session => session.sessionId !== storedActiveSessionId), {
|
|
220
|
+
merge: false
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
logger('Active session validation error', switchError);
|
|
530
224
|
}
|
|
531
225
|
}
|
|
532
226
|
}
|
|
533
227
|
} catch (error) {
|
|
534
|
-
// Check if error is 401 (session already removed remotely)
|
|
535
|
-
const is401Error = error?.response?.status === 401 || error?.message?.includes('Invalid or expired session') || error?.message?.includes('Session is invalid');
|
|
536
|
-
if (is401Error && targetSessionId === activeSessionId) {
|
|
537
|
-
// Session was already removed remotely, clear state without API call
|
|
538
|
-
await clearSessionState();
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
const errorMessage = error instanceof Error ? error.message : 'Logout failed';
|
|
542
228
|
if (__DEV__) {
|
|
543
|
-
console.error('
|
|
544
|
-
}
|
|
545
|
-
_authStore.useAuthStore.setState({
|
|
546
|
-
error: errorMessage
|
|
547
|
-
});
|
|
548
|
-
onError?.({
|
|
549
|
-
message: errorMessage,
|
|
550
|
-
code: 'LOGOUT_ERROR',
|
|
551
|
-
status: 500
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
}, [activeSessionId, oxyServices, sessions, switchToSession, logoutStore, storage, keys.activeSessionId, onAuthStateChange, onError, clearSessionState]);
|
|
555
|
-
const logoutAll = (0, _react.useCallback)(async () => {
|
|
556
|
-
if (!activeSessionId) {
|
|
557
|
-
const error = new Error('No active session found');
|
|
558
|
-
_authStore.useAuthStore.setState({
|
|
559
|
-
error: error.message
|
|
560
|
-
});
|
|
561
|
-
onError?.({
|
|
562
|
-
message: error.message,
|
|
563
|
-
code: 'NO_SESSION_ERROR',
|
|
564
|
-
status: 404
|
|
565
|
-
});
|
|
566
|
-
throw error;
|
|
567
|
-
}
|
|
568
|
-
try {
|
|
569
|
-
await oxyServices.logoutAllSessions(activeSessionId);
|
|
570
|
-
updateSessions([], false);
|
|
571
|
-
setActiveSessionId(null);
|
|
572
|
-
logoutStore();
|
|
573
|
-
setMinimalUser(null);
|
|
574
|
-
await clearAllStorage();
|
|
575
|
-
onAuthStateChange?.(null);
|
|
576
|
-
} catch (error) {
|
|
577
|
-
const errorMessage = error instanceof Error ? error.message : 'Logout all failed';
|
|
578
|
-
_authStore.useAuthStore.setState({
|
|
579
|
-
error: errorMessage
|
|
580
|
-
});
|
|
581
|
-
onError?.({
|
|
582
|
-
message: errorMessage,
|
|
583
|
-
code: 'LOGOUT_ALL_ERROR',
|
|
584
|
-
status: 500
|
|
585
|
-
});
|
|
586
|
-
throw error;
|
|
587
|
-
}
|
|
588
|
-
}, [activeSessionId, oxyServices, logoutStore, clearAllStorage, onAuthStateChange, onError]);
|
|
589
|
-
|
|
590
|
-
// Token restoration is handled in initAuth and switchToSession
|
|
591
|
-
// No separate effect needed - children render immediately with isTokenReady available
|
|
592
|
-
|
|
593
|
-
// Sign up method
|
|
594
|
-
const signUp = (0, _react.useCallback)(async (username, email, password) => {
|
|
595
|
-
if (!storage) throw new Error('Storage not initialized');
|
|
596
|
-
_authStore.useAuthStore.setState({
|
|
597
|
-
isLoading: true,
|
|
598
|
-
error: null
|
|
599
|
-
});
|
|
600
|
-
try {
|
|
601
|
-
await oxyServices.signUp(username, email, password);
|
|
602
|
-
const user = await login(username, password);
|
|
603
|
-
return user;
|
|
604
|
-
} catch (error) {
|
|
605
|
-
const errorMessage = error instanceof Error ? error.message : 'Sign up failed';
|
|
606
|
-
loginFailure(errorMessage);
|
|
607
|
-
onError?.({
|
|
608
|
-
message: errorMessage,
|
|
609
|
-
code: 'SIGNUP_ERROR',
|
|
610
|
-
status: 400
|
|
611
|
-
});
|
|
612
|
-
throw error;
|
|
613
|
-
} finally {
|
|
614
|
-
_authStore.useAuthStore.setState({
|
|
615
|
-
isLoading: false
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
}, [storage, oxyServices, login, loginFailure, onError]);
|
|
619
|
-
|
|
620
|
-
// Complete MFA login by verifying TOTP
|
|
621
|
-
const completeMfaLogin = (0, _react.useCallback)(async (mfaToken, code) => {
|
|
622
|
-
if (!storage) throw new Error('Storage not initialized');
|
|
623
|
-
_authStore.useAuthStore.setState({
|
|
624
|
-
isLoading: true,
|
|
625
|
-
error: null
|
|
626
|
-
});
|
|
627
|
-
try {
|
|
628
|
-
const response = await oxyServices.verifyTotpLogin(mfaToken, code);
|
|
629
|
-
|
|
630
|
-
// Set as active session
|
|
631
|
-
setActiveSessionId(response.sessionId);
|
|
632
|
-
await saveActiveSessionId(response.sessionId);
|
|
633
|
-
|
|
634
|
-
// Fetch access token and user data
|
|
635
|
-
await oxyServices.getTokenBySession(response.sessionId);
|
|
636
|
-
const fullUser = await oxyServices.getUserBySession(response.sessionId);
|
|
637
|
-
loginSuccess(fullUser);
|
|
638
|
-
setMinimalUser({
|
|
639
|
-
id: fullUser.id,
|
|
640
|
-
username: fullUser.username,
|
|
641
|
-
avatar: fullUser.avatar
|
|
642
|
-
});
|
|
643
|
-
await applyLanguagePreference(fullUser);
|
|
644
|
-
|
|
645
|
-
// Get all device sessions to support multiple accounts
|
|
646
|
-
try {
|
|
647
|
-
const deviceSessions = await oxyServices.getDeviceSessions(response.sessionId);
|
|
648
|
-
const allDeviceSessions = mapSessionsToClient(deviceSessions, undefined, fullUser.id);
|
|
649
|
-
updateSessions(allDeviceSessions, true);
|
|
650
|
-
} catch (error) {
|
|
651
|
-
// Fallback to user sessions if device sessions fail
|
|
652
|
-
if (__DEV__) {
|
|
653
|
-
console.warn('Failed to get device sessions for MFA, falling back to user sessions:', error);
|
|
654
|
-
}
|
|
655
|
-
const serverSessions = await oxyServices.getSessionsBySessionId(response.sessionId);
|
|
656
|
-
const userSessions = mapSessionsToClient(serverSessions, undefined, fullUser.id);
|
|
657
|
-
updateSessions(userSessions, true);
|
|
229
|
+
console.error('Auth init error', error);
|
|
658
230
|
}
|
|
659
|
-
|
|
660
|
-
return fullUser;
|
|
661
|
-
} catch (error) {
|
|
662
|
-
const errorMessage = error instanceof Error ? error.message : 'MFA verification failed';
|
|
663
|
-
loginFailure(errorMessage);
|
|
664
|
-
onError?.({
|
|
665
|
-
message: errorMessage,
|
|
666
|
-
code: 'MFA_ERROR',
|
|
667
|
-
status: 401
|
|
668
|
-
});
|
|
669
|
-
throw error;
|
|
231
|
+
await clearSessionState();
|
|
670
232
|
} finally {
|
|
671
|
-
|
|
672
|
-
isLoading: false
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
}, [storage, oxyServices, loginSuccess, loginFailure, saveActiveSessionId, onAuthStateChange, applyLanguagePreference, onError]);
|
|
676
|
-
const switchSession = (0, _react.useCallback)(async sessionId => {
|
|
677
|
-
await switchToSession(sessionId);
|
|
678
|
-
}, [switchToSession]);
|
|
679
|
-
const removeSession = (0, _react.useCallback)(async sessionId => {
|
|
680
|
-
await logout(sessionId);
|
|
681
|
-
}, [logout]);
|
|
682
|
-
const refreshSessions = (0, _react.useCallback)(async () => {
|
|
683
|
-
if (!activeSessionId) return;
|
|
684
|
-
|
|
685
|
-
// If a refresh is already in progress, return the existing promise
|
|
686
|
-
if (refreshInFlightRef.current) {
|
|
687
|
-
return refreshInFlightRef.current;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
// Create the refresh promise
|
|
691
|
-
const refreshPromise = (async () => {
|
|
692
|
-
try {
|
|
693
|
-
const deviceSessions = await oxyServices.getDeviceSessions(activeSessionId);
|
|
694
|
-
const allDeviceSessions = mapSessionsToClient(deviceSessions, undefined, user?.id);
|
|
695
|
-
updateSessions(allDeviceSessions, true);
|
|
696
|
-
} catch (error) {
|
|
697
|
-
if (__DEV__) {
|
|
698
|
-
console.warn('Failed to refresh device sessions, falling back to user sessions:', error);
|
|
699
|
-
}
|
|
700
|
-
try {
|
|
701
|
-
const serverSessions = await oxyServices.getSessionsBySessionId(activeSessionId);
|
|
702
|
-
const userSessions = mapSessionsToClient(serverSessions, undefined, user?.id);
|
|
703
|
-
updateSessions(userSessions, true);
|
|
704
|
-
} catch (fallbackError) {
|
|
705
|
-
if (__DEV__) {
|
|
706
|
-
console.error('Refresh sessions error:', fallbackError);
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
// Check if the error is a 401 (session removed/invalid)
|
|
710
|
-
const is401Error = fallbackError?.response?.status === 401 || fallbackError?.message?.includes('Invalid or expired session') || fallbackError?.message?.includes('Session is invalid');
|
|
711
|
-
|
|
712
|
-
// If 401 error, don't try to validate other sessions - they may have been removed too
|
|
713
|
-
// Instead, check if current session is in removed sessions list
|
|
714
|
-
if (is401Error && removedSessionsRef.current.has(activeSessionId || '')) {
|
|
715
|
-
// Current session was removed, clear all and logout
|
|
716
|
-
updateSessions([], false);
|
|
717
|
-
setActiveSessionId(null);
|
|
718
|
-
logoutStore();
|
|
719
|
-
setMinimalUser(null);
|
|
720
|
-
await clearAllStorage();
|
|
721
|
-
onAuthStateChange?.(null);
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
// If the current session is invalid, try to find another valid session
|
|
726
|
-
// But skip sessions that were recently removed
|
|
727
|
-
if (sessions.length > 1) {
|
|
728
|
-
const otherSessions = sessions.filter(s => s.sessionId !== activeSessionId && !removedSessionsRef.current.has(s.sessionId));
|
|
729
|
-
for (const session of otherSessions) {
|
|
730
|
-
try {
|
|
731
|
-
const validation = await oxyServices.validateSession(session.sessionId, {
|
|
732
|
-
useHeaderValidation: true
|
|
733
|
-
});
|
|
734
|
-
if (validation.valid) {
|
|
735
|
-
await switchToSession(session.sessionId);
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
} catch (validationError) {
|
|
739
|
-
// If validation returns 401, mark this session as removed
|
|
740
|
-
const isValidation401 = validationError?.response?.status === 401 || validationError?.message?.includes('Invalid or expired session');
|
|
741
|
-
if (isValidation401) {
|
|
742
|
-
removedSessionsRef.current.add(session.sessionId);
|
|
743
|
-
// Clear from tracking after 5 seconds
|
|
744
|
-
setTimeout(() => {
|
|
745
|
-
removedSessionsRef.current.delete(session.sessionId);
|
|
746
|
-
}, 5000);
|
|
747
|
-
}
|
|
748
|
-
continue;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
// No valid sessions found, clear all
|
|
754
|
-
updateSessions([], false);
|
|
755
|
-
setActiveSessionId(null);
|
|
756
|
-
logoutStore();
|
|
757
|
-
setMinimalUser(null);
|
|
758
|
-
await clearAllStorage();
|
|
759
|
-
onAuthStateChange?.(null);
|
|
760
|
-
}
|
|
761
|
-
} finally {
|
|
762
|
-
// Clear the in-flight ref when done
|
|
763
|
-
refreshInFlightRef.current = null;
|
|
764
|
-
}
|
|
765
|
-
})();
|
|
766
|
-
refreshInFlightRef.current = refreshPromise;
|
|
767
|
-
return refreshPromise;
|
|
768
|
-
}, [activeSessionId, oxyServices, user?.id, updateSessions, sessions, switchToSession, logoutStore, clearAllStorage, onAuthStateChange, mapSessionsToClient]);
|
|
769
|
-
|
|
770
|
-
// Device management methods
|
|
771
|
-
const getDeviceSessions = (0, _react.useCallback)(async () => {
|
|
772
|
-
if (!activeSessionId) throw new Error('No active session');
|
|
773
|
-
try {
|
|
774
|
-
return await oxyServices.getDeviceSessions(activeSessionId);
|
|
775
|
-
} catch (error) {
|
|
776
|
-
const errorMessage = error instanceof Error ? error.message : 'Failed to get device sessions';
|
|
777
|
-
onError?.({
|
|
778
|
-
message: errorMessage,
|
|
779
|
-
code: 'GET_DEVICE_SESSIONS_ERROR',
|
|
780
|
-
status: 500
|
|
781
|
-
});
|
|
782
|
-
throw error;
|
|
783
|
-
}
|
|
784
|
-
}, [activeSessionId, oxyServices, onError]);
|
|
785
|
-
const logoutAllDeviceSessions = (0, _react.useCallback)(async () => {
|
|
786
|
-
if (!activeSessionId) throw new Error('No active session');
|
|
787
|
-
try {
|
|
788
|
-
await oxyServices.logoutAllDeviceSessions(activeSessionId);
|
|
789
|
-
updateSessions([], false);
|
|
790
|
-
setActiveSessionId(null);
|
|
791
|
-
logoutStore();
|
|
792
|
-
setMinimalUser(null);
|
|
793
|
-
await clearAllStorage();
|
|
794
|
-
onAuthStateChange?.(null);
|
|
795
|
-
} catch (error) {
|
|
796
|
-
const errorMessage = error instanceof Error ? error.message : 'Failed to logout all device sessions';
|
|
797
|
-
onError?.({
|
|
798
|
-
message: errorMessage,
|
|
799
|
-
code: 'LOGOUT_ALL_DEVICES_ERROR',
|
|
800
|
-
status: 500
|
|
801
|
-
});
|
|
802
|
-
throw error;
|
|
803
|
-
}
|
|
804
|
-
}, [activeSessionId, oxyServices, logoutStore, clearAllStorage, onAuthStateChange, onError]);
|
|
805
|
-
const updateDeviceName = (0, _react.useCallback)(async deviceName => {
|
|
806
|
-
if (!activeSessionId) throw new Error('No active session');
|
|
807
|
-
try {
|
|
808
|
-
await oxyServices.updateDeviceName(activeSessionId, deviceName);
|
|
809
|
-
await _deviceManager.DeviceManager.updateDeviceName(deviceName);
|
|
810
|
-
} catch (error) {
|
|
811
|
-
const errorMessage = error instanceof Error ? error.message : 'Failed to update device name';
|
|
812
|
-
onError?.({
|
|
813
|
-
message: errorMessage,
|
|
814
|
-
code: 'UPDATE_DEVICE_NAME_ERROR',
|
|
815
|
-
status: 500
|
|
816
|
-
});
|
|
817
|
-
throw error;
|
|
818
|
-
}
|
|
819
|
-
}, [activeSessionId, oxyServices, onError]);
|
|
820
|
-
|
|
821
|
-
// Language management method
|
|
822
|
-
const setLanguage = (0, _react.useCallback)(async languageId => {
|
|
823
|
-
if (!storage) throw new Error('Storage not initialized');
|
|
824
|
-
try {
|
|
825
|
-
await storage.setItem(keys.language, languageId);
|
|
826
|
-
setCurrentLanguage(languageId);
|
|
827
|
-
} catch (error) {
|
|
828
|
-
const errorMessage = error instanceof Error ? error.message : 'Failed to save language preference';
|
|
829
|
-
onError?.({
|
|
830
|
-
message: errorMessage,
|
|
831
|
-
code: 'LANGUAGE_SAVE_ERROR',
|
|
832
|
-
status: 500
|
|
833
|
-
});
|
|
834
|
-
throw error;
|
|
835
|
-
}
|
|
836
|
-
}, [storage, keys.language, onError]);
|
|
837
|
-
|
|
838
|
-
// Bottom sheet control methods
|
|
839
|
-
const showBottomSheet = (0, _react.useCallback)(screenOrConfig => {
|
|
840
|
-
if (__DEV__) console.log('showBottomSheet called with:', screenOrConfig);
|
|
841
|
-
if (bottomSheetRef?.current) {
|
|
842
|
-
if (__DEV__) console.log('bottomSheetRef is available');
|
|
843
|
-
|
|
844
|
-
// First, show the bottom sheet
|
|
845
|
-
if (bottomSheetRef.current.expand) {
|
|
846
|
-
if (__DEV__) console.log('Expanding bottom sheet');
|
|
847
|
-
bottomSheetRef.current.expand();
|
|
848
|
-
} else if (bottomSheetRef.current.present) {
|
|
849
|
-
if (__DEV__) console.log('Presenting bottom sheet');
|
|
850
|
-
bottomSheetRef.current.present();
|
|
851
|
-
} else if (__DEV__) {
|
|
852
|
-
console.warn('No expand or present method available on bottomSheetRef');
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
// Then navigate to the specified screen if provided
|
|
856
|
-
if (screenOrConfig) {
|
|
857
|
-
// Add a small delay to ensure the bottom sheet is opened first
|
|
858
|
-
setTimeout(() => {
|
|
859
|
-
if (typeof screenOrConfig === 'string') {
|
|
860
|
-
// Simple screen name
|
|
861
|
-
if (__DEV__) console.log('Navigating to screen:', screenOrConfig);
|
|
862
|
-
bottomSheetRef.current?.navigate?.(screenOrConfig);
|
|
863
|
-
} else {
|
|
864
|
-
// Screen with props
|
|
865
|
-
if (__DEV__) console.log('Navigating to screen with props:', screenOrConfig.screen, screenOrConfig.props);
|
|
866
|
-
bottomSheetRef.current?.navigate?.(screenOrConfig.screen, screenOrConfig.props);
|
|
867
|
-
}
|
|
868
|
-
}, 100);
|
|
869
|
-
}
|
|
870
|
-
} else if (__DEV__) {
|
|
871
|
-
console.warn('bottomSheetRef is not available. Pass a bottomSheetRef to OxyProvider.');
|
|
233
|
+
setTokenReady(true);
|
|
872
234
|
}
|
|
873
|
-
}, [
|
|
874
|
-
|
|
875
|
-
if (
|
|
876
|
-
|
|
235
|
+
}, [clearSessionState, logger, oxyServices, storage, storageKeys.activeSessionId, storageKeys.sessionIds, switchSession, updateSessions]);
|
|
236
|
+
(0, _react.useEffect)(() => {
|
|
237
|
+
if (!storage || initializedRef.current) {
|
|
238
|
+
return;
|
|
877
239
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}, [activeSessionId, sessions]);
|
|
886
|
-
|
|
887
|
-
// Callback to track removed sessions
|
|
240
|
+
initializedRef.current = true;
|
|
241
|
+
void restoreSessionsFromStorage();
|
|
242
|
+
}, [restoreSessionsFromStorage, storage]);
|
|
243
|
+
const activeSession = activeSessionId ? sessions.find(session => session.sessionId === activeSessionId) : undefined;
|
|
244
|
+
const currentDeviceId = activeSession?.deviceId ?? null;
|
|
245
|
+
const userId = user?.id;
|
|
246
|
+
const refreshSessionsWithUser = (0, _react.useCallback)(() => refreshSessions(userId), [refreshSessions, userId]);
|
|
888
247
|
const handleSessionRemoved = (0, _react.useCallback)(sessionId => {
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}, []);
|
|
896
|
-
|
|
897
|
-
// Integrate socket for real-time session updates
|
|
248
|
+
trackRemovedSession(sessionId);
|
|
249
|
+
}, [trackRemovedSession]);
|
|
250
|
+
const handleRemoteSignOut = (0, _react.useCallback)(() => {
|
|
251
|
+
_sonner.toast.info('You have been signed out remotely.');
|
|
252
|
+
logout().catch(remoteError => logger('Failed to process remote sign out', remoteError));
|
|
253
|
+
}, [logger, logout]);
|
|
898
254
|
(0, _useSessionSocket.useSessionSocket)({
|
|
899
|
-
userId
|
|
255
|
+
userId,
|
|
900
256
|
activeSessionId,
|
|
901
257
|
currentDeviceId,
|
|
902
|
-
refreshSessions,
|
|
258
|
+
refreshSessions: refreshSessionsWithUser,
|
|
903
259
|
logout,
|
|
904
260
|
clearSessionState,
|
|
905
261
|
baseURL: oxyServices.getBaseURL(),
|
|
906
|
-
onRemoteSignOut:
|
|
907
|
-
_sonner.toast.info('You have been signed out remotely.');
|
|
908
|
-
logout();
|
|
909
|
-
}, [logout]),
|
|
262
|
+
onRemoteSignOut: handleRemoteSignOut,
|
|
910
263
|
onSessionRemoved: handleSessionRemoved
|
|
911
264
|
});
|
|
265
|
+
const switchSessionForContext = (0, _react.useCallback)(async sessionId => {
|
|
266
|
+
await switchSession(sessionId);
|
|
267
|
+
}, [switchSession]);
|
|
912
268
|
|
|
913
|
-
//
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
|
|
269
|
+
// Create showBottomSheet function that uses the global function
|
|
270
|
+
const showBottomSheetForContext = (0, _react.useCallback)(screenOrConfig => {
|
|
271
|
+
(0, _bottomSheetManager.showBottomSheet)(screenOrConfig);
|
|
272
|
+
}, []);
|
|
917
273
|
const contextValue = (0, _react.useMemo)(() => ({
|
|
918
274
|
user,
|
|
919
|
-
minimalUser,
|
|
920
275
|
sessions,
|
|
921
276
|
activeSessionId,
|
|
922
277
|
isAuthenticated,
|
|
@@ -924,44 +279,34 @@ const OxyProvider = ({
|
|
|
924
279
|
isTokenReady: tokenReady,
|
|
925
280
|
error,
|
|
926
281
|
currentLanguage,
|
|
927
|
-
currentLanguageMetadata
|
|
928
|
-
currentLanguageName
|
|
929
|
-
currentNativeLanguageName
|
|
930
|
-
|
|
282
|
+
currentLanguageMetadata,
|
|
283
|
+
currentLanguageName,
|
|
284
|
+
currentNativeLanguageName,
|
|
285
|
+
createIdentity,
|
|
286
|
+
importIdentity,
|
|
287
|
+
signIn,
|
|
288
|
+
hasIdentity,
|
|
289
|
+
getPublicKey,
|
|
931
290
|
logout,
|
|
932
291
|
logoutAll,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
removeSession,
|
|
937
|
-
refreshSessions,
|
|
292
|
+
switchSession: switchSessionForContext,
|
|
293
|
+
removeSession: logout,
|
|
294
|
+
refreshSessions: refreshSessionsWithUser,
|
|
938
295
|
setLanguage,
|
|
939
296
|
getDeviceSessions,
|
|
940
297
|
logoutAllDeviceSessions,
|
|
941
298
|
updateDeviceName,
|
|
942
299
|
oxyServices,
|
|
943
|
-
|
|
944
|
-
showBottomSheet
|
|
945
|
-
|
|
946
|
-
useFollow: useFollowHook
|
|
947
|
-
}), [user?.id,
|
|
948
|
-
// Only depend on user ID, not the entire user object
|
|
949
|
-
minimalUser?.id, sessions.length,
|
|
950
|
-
// Only depend on sessions count, not the entire array
|
|
951
|
-
activeSessionId, isAuthenticated, isLoading, tokenReady, error, currentLanguage, languageMetadata, languageName, nativeLanguageName, login, logout, logoutAll, signUp, completeMfaLogin, switchSession, removeSession, refreshSessions, setLanguage, getDeviceSessions, logoutAllDeviceSessions, updateDeviceName, oxyServices, bottomSheetRef, showBottomSheet, hideBottomSheet, useFollowHook]);
|
|
952
|
-
|
|
953
|
-
// Always render children - let the consuming app decide how to handle token loading state
|
|
300
|
+
useFollow: useFollowHook,
|
|
301
|
+
showBottomSheet: showBottomSheetForContext
|
|
302
|
+
}), [activeSessionId, createIdentity, importIdentity, signIn, hasIdentity, getPublicKey, currentLanguage, currentLanguageMetadata, currentLanguageName, currentNativeLanguageName, error, getDeviceSessions, isAuthenticated, isLoading, logout, logoutAll, logoutAllDeviceSessions, oxyServices, refreshSessionsWithUser, sessions, setLanguage, switchSessionForContext, tokenReady, updateDeviceName, useFollowHook, user, showBottomSheetForContext]);
|
|
954
303
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(OxyContext.Provider, {
|
|
955
304
|
value: contextValue,
|
|
956
305
|
children: children
|
|
957
306
|
});
|
|
958
307
|
};
|
|
959
|
-
|
|
960
|
-
// Alias for backward compatibility
|
|
961
308
|
exports.OxyProvider = OxyProvider;
|
|
962
309
|
const OxyContextProvider = exports.OxyContextProvider = OxyProvider;
|
|
963
|
-
|
|
964
|
-
// Hook to use the context
|
|
965
310
|
const useOxy = () => {
|
|
966
311
|
const context = (0, _react.useContext)(OxyContext);
|
|
967
312
|
if (!context) {
|