@onairos/react-native 3.4.0 → 3.5.4
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 +62 -13
- package/lib/commonjs/api/index.js +9 -145
- package/lib/commonjs/assets/animations/loaderani.json +1 -0
- package/lib/commonjs/assets/animations/persona-animation.json +1 -0
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/chatgpt.png +0 -0
- package/lib/commonjs/assets/icons/claude.png +0 -0
- package/lib/commonjs/assets/icons/gemini.png +0 -0
- package/lib/commonjs/assets/icons/grok.png +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -0
- package/lib/commonjs/assets/images/EnochE.svg +19 -0
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +20 -0
- package/lib/commonjs/assets/images/basicproficon.svg +43 -0
- package/lib/commonjs/assets/images/basicprofile.svg +3 -0
- package/lib/commonjs/assets/images/chatgpt.png +0 -0
- package/lib/commonjs/assets/images/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/claude.png +0 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -0
- package/lib/commonjs/assets/images/gemini.png +0 -0
- package/lib/commonjs/assets/images/grok.png +0 -0
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +18 -0
- package/lib/commonjs/assets/images/x-close.svg +3 -0
- package/lib/commonjs/components/BodyText.js +9 -0
- package/lib/commonjs/components/BrandMark.js +10 -0
- package/lib/commonjs/components/CodeInput.js +9 -0
- package/lib/commonjs/components/EmailInput.js +8 -0
- package/lib/commonjs/components/GoogleButton.js +9 -0
- package/lib/commonjs/components/HeadingGroup.js +9 -0
- package/lib/commonjs/components/LLMDataInputModal.js +14 -0
- package/lib/commonjs/components/ModalHeader.js +9 -0
- package/lib/commonjs/components/ModalSheet.js +9 -0
- package/lib/commonjs/components/Onairos.js +14 -374
- package/lib/commonjs/components/OnairosButton.js +13 -309
- package/lib/commonjs/components/OnairosSignInButton.js +12 -0
- package/lib/commonjs/components/Overlay.js +13 -483
- package/lib/commonjs/components/PersonaImage.js +10 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
- package/lib/commonjs/components/PinCreationScreen.js +12 -0
- package/lib/commonjs/components/PinInput.js +9 -302
- package/lib/commonjs/components/PlatformConnectorsStep.js +22 -0
- package/lib/commonjs/components/PlatformList.js +10 -137
- package/lib/commonjs/components/PlatformToggle.js +9 -0
- package/lib/commonjs/components/PrimaryButton.js +10 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
- package/lib/commonjs/components/SignInStep.js +12 -0
- package/lib/commonjs/components/UniversalOnboarding.js +29 -1702
- package/lib/commonjs/components/VerificationStep.js +11 -0
- package/lib/commonjs/components/WelcomeScreen.js +21 -0
- package/lib/commonjs/components/icons/Basicproficon.js +8 -0
- package/lib/commonjs/components/icons/Basicprofile.js +8 -0
- package/lib/commonjs/components/icons/Checkbox.js +8 -0
- package/lib/commonjs/components/icons/Checkmark.js +8 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
- package/lib/commonjs/components/icons/Contenticon.js +8 -0
- package/lib/commonjs/components/icons/EnochE.js +8 -0
- package/lib/commonjs/components/icons/Personalityicon.js +8 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
- package/lib/commonjs/components/icons/Userpreferences.js +8 -0
- package/lib/commonjs/components/icons/index.js +17 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +14 -827
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
- package/lib/commonjs/components/onboarding/PinInput.js +10 -283
- package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
- package/lib/commonjs/config/api.js +7 -0
- package/lib/commonjs/constants/index.js +7 -83
- package/lib/commonjs/context/AuthContext.js +10 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
- package/lib/commonjs/hooks/useConnections.js +8 -159
- package/lib/commonjs/hooks/useCredentials.js +10 -177
- package/lib/commonjs/hooks/useUserConnections.js +10 -0
- package/lib/commonjs/index.js +35 -106
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +31 -38
- package/lib/commonjs/services/apiClient.js +8 -0
- package/lib/commonjs/services/apiKeyService.js +9 -946
- package/lib/commonjs/services/authService.js +10 -0
- package/lib/commonjs/services/biometricPinService.js +8 -0
- package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
- package/lib/commonjs/services/chatGPTConversationService.js +9 -0
- package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
- package/lib/commonjs/services/claudeConversationService.js +9 -0
- package/lib/commonjs/services/connectedAccountsService.js +10 -0
- package/lib/commonjs/services/googleAuthService.js +11 -0
- package/lib/commonjs/services/imageCompressionService.js +7 -0
- package/lib/commonjs/services/jwtStorageService.js +7 -0
- package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
- package/lib/commonjs/services/linkedinProfileService.js +9 -0
- package/lib/commonjs/services/linkedinScrapingService.js +8 -0
- package/lib/commonjs/services/llmDataStorage.js +8 -0
- package/lib/commonjs/services/mobileTrainingService.js +8 -0
- package/lib/commonjs/services/oauthService.js +11 -390
- package/lib/commonjs/services/pinEncryptionService.js +8 -0
- package/lib/commonjs/services/pinStorageUtils.js +7 -0
- package/lib/commonjs/services/platformAuthService.js +12 -1067
- package/lib/commonjs/services/storageService.js +8 -0
- package/lib/commonjs/services/trainingApiHelpers.js +7 -0
- package/lib/commonjs/services/userConnectionsService.js +10 -0
- package/lib/commonjs/services/youtubeMigrationService.js +10 -0
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/types/ambient.d.js +1 -2
- package/lib/commonjs/types/declarations.d.js +1 -2
- package/lib/commonjs/types/index.js +1 -6
- package/lib/commonjs/types/node-fix.d.js +1 -2
- package/lib/commonjs/types/node-override.d.js +1 -2
- package/lib/commonjs/types/opacity.d.js +1 -2
- package/lib/commonjs/types.js +1 -14
- package/lib/commonjs/utils/Portal.js +8 -98
- package/lib/commonjs/utils/api.js +9 -129
- package/lib/commonjs/utils/assetRegistry.js +33 -0
- package/lib/commonjs/utils/auth.js +9 -111
- package/lib/commonjs/utils/crypto.js +8 -62
- package/lib/commonjs/utils/debugHelper.js +1 -64
- package/lib/commonjs/utils/encryption.js +7 -76
- package/lib/commonjs/utils/eventUtils.js +1 -0
- package/lib/commonjs/utils/haptics.js +9 -0
- package/lib/commonjs/utils/imagePreloader.js +1 -0
- package/lib/commonjs/utils/networkDiagnostics.js +8 -0
- package/lib/commonjs/utils/onairosApi.js +9 -350
- package/lib/commonjs/utils/programmaticFlow.js +9 -117
- package/lib/commonjs/utils/retryHelper.js +1 -220
- package/lib/commonjs/utils/secureStorage.js +10 -349
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
- package/lib/commonjs/utils/webviewScripts/index.js +9 -0
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
- package/lib/module/api/index.js +1 -139
- package/lib/module/assets/animations/loaderani.json +1 -0
- package/lib/module/assets/animations/persona-animation.json +1 -0
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/chatgpt.png +0 -0
- package/lib/module/assets/icons/claude.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/gemini.png +0 -0
- package/lib/module/assets/icons/grok.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +3 -0
- package/lib/module/assets/images/EnochE.svg +19 -0
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +3 -0
- package/lib/module/assets/images/Personalitytraits.svg +3 -0
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +3 -0
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +20 -0
- package/lib/module/assets/images/basicproficon.svg +43 -0
- package/lib/module/assets/images/basicprofile.svg +3 -0
- package/lib/module/assets/images/chatgpt.png +0 -0
- package/lib/module/assets/images/checkmark.svg +4 -0
- package/lib/module/assets/images/claude.png +0 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -0
- package/lib/module/assets/images/gemini.png +0 -0
- package/lib/module/assets/images/grok.png +0 -0
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +18 -0
- package/lib/module/assets/images/x-close.svg +3 -0
- package/lib/module/components/BodyText.js +1 -0
- package/lib/module/components/BrandMark.js +1 -0
- package/lib/module/components/CodeInput.js +1 -0
- package/lib/module/components/EmailInput.js +1 -0
- package/lib/module/components/GoogleButton.js +1 -0
- package/lib/module/components/HeadingGroup.js +1 -0
- package/lib/module/components/LLMDataInputModal.js +8 -0
- package/lib/module/components/ModalHeader.js +1 -0
- package/lib/module/components/ModalSheet.js +1 -0
- package/lib/module/components/Onairos.js +1 -367
- package/lib/module/components/OnairosButton.js +1 -302
- package/lib/module/components/OnairosSignInButton.js +1 -0
- package/lib/module/components/Overlay.js +1 -474
- package/lib/module/components/PersonaImage.js +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +1 -0
- package/lib/module/components/PinCreationScreen.js +1 -0
- package/lib/module/components/PinInput.js +1 -293
- package/lib/module/components/PlatformConnectorsStep.js +1 -0
- package/lib/module/components/PlatformList.js +1 -129
- package/lib/module/components/PlatformToggle.js +1 -0
- package/lib/module/components/PrimaryButton.js +1 -0
- package/lib/module/components/SignInMatchAnimation.js +1 -0
- package/lib/module/components/SignInStep.js +1 -0
- package/lib/module/components/UniversalOnboarding.js +1 -1693
- package/lib/module/components/VerificationStep.js +1 -0
- package/lib/module/components/WelcomeScreen.js +1 -0
- package/lib/module/components/icons/Basicproficon.js +1 -0
- package/lib/module/components/icons/Basicprofile.js +1 -0
- package/lib/module/components/icons/Checkbox.js +1 -0
- package/lib/module/components/icons/Checkmark.js +1 -0
- package/lib/module/components/icons/Contentanalysis.js +1 -0
- package/lib/module/components/icons/Contenticon.js +1 -0
- package/lib/module/components/icons/EnochE.js +1 -0
- package/lib/module/components/icons/Personalityicon.js +1 -0
- package/lib/module/components/icons/Personalityprofile.js +1 -0
- package/lib/module/components/icons/Personalitytraits.js +1 -0
- package/lib/module/components/icons/Userpreferences.js +1 -0
- package/lib/module/components/icons/index.js +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +1 -818
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
- package/lib/module/components/onboarding/PinInput.js +1 -274
- package/lib/module/components/onboarding/PlatformConnector.js +1 -240
- package/lib/module/config/api.js +1 -0
- package/lib/module/constants/index.js +1 -77
- package/lib/module/context/AuthContext.js +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +1 -0
- package/lib/module/hooks/useConnections.js +1 -152
- package/lib/module/hooks/useCredentials.js +6 -169
- package/lib/module/hooks/useUserConnections.js +1 -0
- package/lib/module/index.js +1 -32
- package/lib/module/services/SDK_API_KEY_VALIDATION.md +31 -38
- package/lib/module/services/apiClient.js +1 -0
- package/lib/module/services/apiKeyService.js +1 -919
- package/lib/module/services/authService.js +1 -0
- package/lib/module/services/biometricPinService.js +1 -0
- package/lib/module/services/chatGPTConversationExtractor.js +1 -0
- package/lib/module/services/chatGPTConversationService.js +1 -0
- package/lib/module/services/claudeConversationExtractor.js +1 -0
- package/lib/module/services/claudeConversationService.js +1 -0
- package/lib/module/services/connectedAccountsService.js +1 -0
- package/lib/module/services/googleAuthService.js +1 -0
- package/lib/module/services/imageCompressionService.js +1 -0
- package/lib/module/services/jwtStorageService.js +1 -0
- package/lib/module/services/linkedinDOMExtractor.js +1 -0
- package/lib/module/services/linkedinProfileService.js +1 -0
- package/lib/module/services/linkedinScrapingService.js +1 -0
- package/lib/module/services/llmDataStorage.js +1 -0
- package/lib/module/services/mobileTrainingService.js +1 -0
- package/lib/module/services/oauthService.js +1 -380
- package/lib/module/services/pinEncryptionService.js +7 -0
- package/lib/module/services/pinStorageUtils.js +1 -0
- package/lib/module/services/platformAuthService.js +1 -1041
- package/lib/module/services/storageService.js +1 -0
- package/lib/module/services/trainingApiHelpers.js +1 -0
- package/lib/module/services/userConnectionsService.js +1 -0
- package/lib/module/services/youtubeMigrationService.js +1 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/module/types.js +1 -10
- package/lib/module/utils/Portal.js +1 -90
- package/lib/module/utils/api.js +1 -117
- package/lib/module/utils/assetRegistry.js +33 -0
- package/lib/module/utils/auth.js +1 -99
- package/lib/module/utils/crypto.js +1 -54
- package/lib/module/utils/debugHelper.js +1 -54
- package/lib/module/utils/encryption.js +1 -67
- package/lib/module/utils/eventUtils.js +1 -0
- package/lib/module/utils/haptics.js +8 -0
- package/lib/module/utils/imagePreloader.js +1 -0
- package/lib/module/utils/networkDiagnostics.js +1 -0
- package/lib/module/utils/onairosApi.js +1 -333
- package/lib/module/utils/programmaticFlow.js +1 -111
- package/lib/module/utils/retryHelper.js +1 -211
- package/lib/module/utils/secureStorage.js +6 -330
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/module/utils/webviewScripts/claude.js +1 -0
- package/lib/module/utils/webviewScripts/index.js +1 -0
- package/lib/module/utils/webviewScripts/linkedin.js +1 -0
- package/package.json +62 -39
- package/lib/commonjs/api/index.js.map +0 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js +0 -228
- package/lib/commonjs/components/DataRequestModal.js.map +0 -1
- package/lib/commonjs/components/DataRequestScreen.js +0 -329
- package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
- package/lib/commonjs/components/EmailVerificationModal.js +0 -320
- package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
- package/lib/commonjs/components/Onairos.js.map +0 -1
- package/lib/commonjs/components/OnairosButton.js.map +0 -1
- package/lib/commonjs/components/Overlay.js.map +0 -1
- package/lib/commonjs/components/PinInput.js.map +0 -1
- package/lib/commonjs/components/PlatformList.js.map +0 -1
- package/lib/commonjs/components/TrainingModal.js +0 -717
- package/lib/commonjs/components/TrainingModal.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
- package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/constants/index.js.map +0 -1
- package/lib/commonjs/hooks/useConnections.js.map +0 -1
- package/lib/commonjs/hooks/useCredentials.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/services/apiKeyService.js.map +0 -1
- package/lib/commonjs/services/oauthService.js.map +0 -1
- package/lib/commonjs/services/platformAuthService.js.map +0 -1
- package/lib/commonjs/types/ambient.d.js.map +0 -1
- package/lib/commonjs/types/declarations.d.js.map +0 -1
- package/lib/commonjs/types/index.d.js.map +0 -1
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/types/node-fix.d.js.map +0 -1
- package/lib/commonjs/types/node-override.d.js.map +0 -1
- package/lib/commonjs/types/opacity.d.js.map +0 -1
- package/lib/commonjs/types/types.d.js.map +0 -1
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils/Portal.js.map +0 -1
- package/lib/commonjs/utils/api.js.map +0 -1
- package/lib/commonjs/utils/auth.js.map +0 -1
- package/lib/commonjs/utils/crypto.js.map +0 -1
- package/lib/commonjs/utils/debugHelper.js.map +0 -1
- package/lib/commonjs/utils/encryption.js.map +0 -1
- package/lib/commonjs/utils/onairosApi.js.map +0 -1
- package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
- package/lib/commonjs/utils/retryHelper.js.map +0 -1
- package/lib/commonjs/utils/secureStorage.js.map +0 -1
- package/lib/module/api/index.js.map +0 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js +0 -220
- package/lib/module/components/DataRequestModal.js.map +0 -1
- package/lib/module/components/DataRequestScreen.js +0 -321
- package/lib/module/components/DataRequestScreen.js.map +0 -1
- package/lib/module/components/EmailVerificationModal.js +0 -311
- package/lib/module/components/EmailVerificationModal.js.map +0 -1
- package/lib/module/components/Onairos.js.map +0 -1
- package/lib/module/components/OnairosButton.js.map +0 -1
- package/lib/module/components/Overlay.js.map +0 -1
- package/lib/module/components/PinInput.js.map +0 -1
- package/lib/module/components/PlatformList.js.map +0 -1
- package/lib/module/components/TrainingModal.js +0 -708
- package/lib/module/components/TrainingModal.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/module/components/onboarding/PinInput.js.map +0 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/module/components/screens/ConnectorScreen.js +0 -138
- package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/module/components/screens/LoadingScreen.js +0 -83
- package/lib/module/components/screens/LoadingScreen.js.map +0 -1
- package/lib/module/components/screens/PinCreationScreen.js +0 -53
- package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/module/constants/index.js.map +0 -1
- package/lib/module/hooks/useConnections.js.map +0 -1
- package/lib/module/hooks/useCredentials.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/services/apiKeyService.js.map +0 -1
- package/lib/module/services/oauthService.js.map +0 -1
- package/lib/module/services/platformAuthService.js.map +0 -1
- package/lib/module/types/ambient.d.js.map +0 -1
- package/lib/module/types/declarations.d.js.map +0 -1
- package/lib/module/types/index.d.js.map +0 -1
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/types/node-fix.d.js.map +0 -1
- package/lib/module/types/node-override.d.js.map +0 -1
- package/lib/module/types/opacity.d.js.map +0 -1
- package/lib/module/types/types.d.js.map +0 -1
- package/lib/module/types.js.map +0 -1
- package/lib/module/utils/Portal.js.map +0 -1
- package/lib/module/utils/api.js.map +0 -1
- package/lib/module/utils/auth.js.map +0 -1
- package/lib/module/utils/crypto.js.map +0 -1
- package/lib/module/utils/debugHelper.js.map +0 -1
- package/lib/module/utils/encryption.js.map +0 -1
- package/lib/module/utils/onairosApi.js.map +0 -1
- package/lib/module/utils/programmaticFlow.js.map +0 -1
- package/lib/module/utils/retryHelper.js.map +0 -1
- package/lib/module/utils/secureStorage.js.map +0 -1
- package/lib/typescript/api/index.d.ts +0 -8
- package/lib/typescript/api/index.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestModal.d.ts +0 -11
- package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
- package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
- package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
- package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
- package/lib/typescript/components/Onairos.d.ts +0 -4
- package/lib/typescript/components/Onairos.d.ts.map +0 -1
- package/lib/typescript/components/OnairosButton.d.ts +0 -12
- package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
- package/lib/typescript/components/Overlay.d.ts +0 -4
- package/lib/typescript/components/Overlay.d.ts.map +0 -1
- package/lib/typescript/components/PinInput.d.ts +0 -4
- package/lib/typescript/components/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/PlatformList.d.ts +0 -4
- package/lib/typescript/components/PlatformList.d.ts.map +0 -1
- package/lib/typescript/components/TrainingModal.d.ts +0 -4
- package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
- package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
- package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
- package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/constants/index.d.ts +0 -53
- package/lib/typescript/constants/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnections.d.ts +0 -9
- package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
- package/lib/typescript/hooks/useCredentials.d.ts +0 -9
- package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -18
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/services/apiKeyService.d.ts +0 -132
- package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
- package/lib/typescript/services/oauthService.d.ts +0 -50
- package/lib/typescript/services/oauthService.d.ts.map +0 -1
- package/lib/typescript/services/platformAuthService.d.ts +0 -144
- package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts +0 -231
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/types.d.ts +0 -270
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/utils/Portal.d.ts +0 -14
- package/lib/typescript/utils/Portal.d.ts.map +0 -1
- package/lib/typescript/utils/api.d.ts +0 -6
- package/lib/typescript/utils/api.d.ts.map +0 -1
- package/lib/typescript/utils/auth.d.ts +0 -6
- package/lib/typescript/utils/auth.d.ts.map +0 -1
- package/lib/typescript/utils/crypto.d.ts +0 -4
- package/lib/typescript/utils/crypto.d.ts.map +0 -1
- package/lib/typescript/utils/debugHelper.d.ts +0 -29
- package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
- package/lib/typescript/utils/encryption.d.ts +0 -19
- package/lib/typescript/utils/encryption.d.ts.map +0 -1
- package/lib/typescript/utils/onairosApi.d.ts +0 -87
- package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
- package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
- package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
- package/lib/typescript/utils/retryHelper.d.ts +0 -69
- package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
- package/lib/typescript/utils/secureStorage.d.ts +0 -94
- package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
- package/src/api/index.ts +0 -111
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/onairos_logo.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestModal.tsx +0 -227
- package/src/components/DataRequestScreen.tsx +0 -356
- package/src/components/EmailVerificationModal.tsx +0 -364
- package/src/components/Onairos.tsx +0 -425
- package/src/components/OnairosButton.tsx +0 -359
- package/src/components/Overlay.tsx +0 -506
- package/src/components/PinInput.tsx +0 -343
- package/src/components/PlatformList.tsx +0 -145
- package/src/components/TrainingModal.tsx +0 -737
- package/src/components/UniversalOnboarding.tsx +0 -1839
- package/src/components/UniversalOnboarding.tsx.new +0 -455
- package/src/components/onboarding/OAuthWebView.tsx +0 -838
- package/src/components/onboarding/OnboardingHeader.tsx +0 -70
- package/src/components/onboarding/PinInput.tsx +0 -356
- package/src/components/onboarding/PlatformConnector.tsx +0 -302
- package/src/components/screens/ConnectorScreen.tsx +0 -153
- package/src/components/screens/LoadingScreen.tsx +0 -100
- package/src/components/screens/PinCreationScreen.tsx +0 -67
- package/src/constants/index.ts +0 -83
- package/src/hooks/useConnections.ts +0 -163
- package/src/hooks/useCredentials.ts +0 -175
- package/src/index.js +0 -14
- package/src/index.ts +0 -50
- package/src/services/SDK_API_KEY_VALIDATION.md +0 -428
- package/src/services/apiKeyService.ts +0 -979
- package/src/services/oauthService.ts +0 -412
- package/src/services/platformAuthService.ts +0 -1113
- package/src/types/ambient.d.ts +0 -29
- package/src/types/declarations.d.ts +0 -26
- package/src/types/index.d.ts +0 -274
- package/src/types/index.ts +0 -244
- package/src/types/node-fix.d.ts +0 -19
- package/src/types/node-override.d.ts +0 -24
- package/src/types/opacity.d.ts +0 -16
- package/src/types/types.d.ts +0 -18
- package/src/types.ts +0 -298
- package/src/utils/Portal.tsx +0 -83
- package/src/utils/api.js +0 -112
- package/src/utils/auth.js +0 -104
- package/src/utils/crypto.js +0 -60
- package/src/utils/debugHelper.ts +0 -53
- package/src/utils/encryption.ts +0 -69
- package/src/utils/onairosApi.ts +0 -391
- package/src/utils/programmaticFlow.ts +0 -113
- package/src/utils/retryHelper.ts +0 -275
- package/src/utils/secureStorage.ts +0 -361
- package/types/index.d.ts +0 -218
- package/types/node-env.d.ts +0 -15
- /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useImperativeHandle, useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
View,
|
|
5
|
-
TouchableOpacity,
|
|
6
|
-
Text,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
TextStyle,
|
|
9
|
-
Platform,
|
|
10
|
-
Image,
|
|
11
|
-
Alert,
|
|
12
|
-
} from 'react-native';
|
|
13
|
-
import { UniversalOnboarding } from './UniversalOnboarding';
|
|
14
|
-
import { Overlay } from './Overlay';
|
|
15
|
-
import { COLORS } from '../constants';
|
|
16
|
-
import { hasCredentials, getCredentials, deleteCredentials } from '../utils/secureStorage';
|
|
17
|
-
import { onairosApi } from '../api';
|
|
18
|
-
import { Portal } from '../utils/Portal';
|
|
19
|
-
import { DataTier, OnairosConfig, OnairosProps } from '../types';
|
|
20
|
-
import { initializeApiKey, isApiKeyInitialized, getApiConfig } from '../services/apiKeyService';
|
|
21
|
-
|
|
22
|
-
export const Onairos = forwardRef<any, OnairosProps>((props, ref) => {
|
|
23
|
-
const {
|
|
24
|
-
returnLink,
|
|
25
|
-
prefillUrl,
|
|
26
|
-
AppName,
|
|
27
|
-
buttonType = 'normal',
|
|
28
|
-
requestData,
|
|
29
|
-
buttonWidth = 200,
|
|
30
|
-
buttonHeight = 48,
|
|
31
|
-
hasStroke = false,
|
|
32
|
-
enabled = true,
|
|
33
|
-
buttonForm = 'default',
|
|
34
|
-
onRejection,
|
|
35
|
-
onResolved,
|
|
36
|
-
preCheck,
|
|
37
|
-
color = COLORS.primary,
|
|
38
|
-
debug = false,
|
|
39
|
-
darkMode = false,
|
|
40
|
-
preferredPlatform,
|
|
41
|
-
testMode = false,
|
|
42
|
-
// API Key props
|
|
43
|
-
apiKey,
|
|
44
|
-
environment = 'production',
|
|
45
|
-
enableLogging = true,
|
|
46
|
-
timeout = 30000,
|
|
47
|
-
retryAttempts = 3,
|
|
48
|
-
} = props;
|
|
49
|
-
|
|
50
|
-
const [showOverlay, setShowOverlay] = useState(false);
|
|
51
|
-
const [isInitialized, setIsInitialized] = useState(false);
|
|
52
|
-
const [initializationError, setInitializationError] = useState<string | null>(null);
|
|
53
|
-
const [isInitializing, setIsInitializing] = useState(false);
|
|
54
|
-
|
|
55
|
-
// Initialize API key when component mounts or API key changes
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
let isMounted = true;
|
|
58
|
-
|
|
59
|
-
const initializeApi = async () => {
|
|
60
|
-
// Skip if already initializing
|
|
61
|
-
if (isInitializing) return;
|
|
62
|
-
|
|
63
|
-
setIsInitializing(true);
|
|
64
|
-
setInitializationError(null);
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
console.log('🚀 Onairos SDK: Starting API key initialization...');
|
|
68
|
-
|
|
69
|
-
if (!apiKey) {
|
|
70
|
-
throw new Error('API key is required. Please provide a valid API key from your Onairos dashboard.');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const config: OnairosConfig = {
|
|
74
|
-
apiKey,
|
|
75
|
-
environment,
|
|
76
|
-
enableLogging,
|
|
77
|
-
timeout,
|
|
78
|
-
retryAttempts,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// Initialize the API key service
|
|
82
|
-
await initializeApiKey(config);
|
|
83
|
-
|
|
84
|
-
if (isMounted) {
|
|
85
|
-
setIsInitialized(true);
|
|
86
|
-
setInitializationError(null);
|
|
87
|
-
|
|
88
|
-
if (enableLogging) {
|
|
89
|
-
console.log('✅ Onairos SDK: API key initialization completed successfully');
|
|
90
|
-
console.log('📊 Configuration:', {
|
|
91
|
-
environment,
|
|
92
|
-
enableLogging,
|
|
93
|
-
timeout,
|
|
94
|
-
retryAttempts,
|
|
95
|
-
apiKeyLength: apiKey.length,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
} catch (error) {
|
|
100
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown initialization error';
|
|
101
|
-
|
|
102
|
-
console.error('❌ Onairos SDK: API key initialization failed:', errorMessage);
|
|
103
|
-
|
|
104
|
-
if (isMounted) {
|
|
105
|
-
setIsInitialized(false);
|
|
106
|
-
setInitializationError(errorMessage);
|
|
107
|
-
|
|
108
|
-
// Show developer-friendly error
|
|
109
|
-
if (enableLogging) {
|
|
110
|
-
console.group('🔧 API Key Troubleshooting Guide');
|
|
111
|
-
console.log('1. Check that your API key is correct and not expired');
|
|
112
|
-
console.log('2. Verify you have the right permissions for your use case');
|
|
113
|
-
console.log('3. Ensure your environment setting matches your API key');
|
|
114
|
-
console.log('4. Check your internet connection');
|
|
115
|
-
console.log('5. Visit https://dashboard.onairos.uk to manage your API keys');
|
|
116
|
-
console.groupEnd();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Call rejection callback if provided
|
|
120
|
-
if (onRejection) {
|
|
121
|
-
onRejection(`SDK initialization failed: ${errorMessage}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
} finally {
|
|
125
|
-
if (isMounted) {
|
|
126
|
-
setIsInitializing(false);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// Only initialize if we have an API key and aren't already initialized correctly
|
|
132
|
-
if (apiKey && (!isApiKeyInitialized() || getApiConfig()?.apiKey !== apiKey)) {
|
|
133
|
-
initializeApi();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return () => {
|
|
137
|
-
isMounted = false;
|
|
138
|
-
};
|
|
139
|
-
}, [apiKey, environment, enableLogging, timeout, retryAttempts, onRejection]);
|
|
140
|
-
|
|
141
|
-
// Imperative methods
|
|
142
|
-
useImperativeHandle(ref, () => ({
|
|
143
|
-
openOverlay: handleShowOverlay,
|
|
144
|
-
closeOverlay: handleCloseOverlay,
|
|
145
|
-
isInitialized: () => isInitialized,
|
|
146
|
-
getApiConfig: () => getApiConfig(),
|
|
147
|
-
}));
|
|
148
|
-
|
|
149
|
-
const handleShowOverlay = useCallback(async () => {
|
|
150
|
-
try {
|
|
151
|
-
// Check if SDK is initialized
|
|
152
|
-
if (!isInitialized) {
|
|
153
|
-
const errorMessage = initializationError || 'SDK not initialized. Please check your API key.';
|
|
154
|
-
console.error('❌ Cannot open overlay: SDK not initialized');
|
|
155
|
-
|
|
156
|
-
if (onRejection) {
|
|
157
|
-
onRejection(errorMessage);
|
|
158
|
-
} else {
|
|
159
|
-
Alert.alert(
|
|
160
|
-
'SDK Error',
|
|
161
|
-
errorMessage,
|
|
162
|
-
[{ text: 'OK' }]
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Run pre-check if provided
|
|
169
|
-
if (preCheck) {
|
|
170
|
-
if (enableLogging) {
|
|
171
|
-
console.log('🔍 Running pre-check validation...');
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
try {
|
|
175
|
-
const preCheckPassed = await preCheck();
|
|
176
|
-
if (!preCheckPassed) {
|
|
177
|
-
if (enableLogging) {
|
|
178
|
-
console.log('⛔ Pre-check failed, aborting overlay');
|
|
179
|
-
}
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (enableLogging) {
|
|
184
|
-
console.log('✅ Pre-check passed');
|
|
185
|
-
}
|
|
186
|
-
} catch (preCheckError) {
|
|
187
|
-
console.error('❌ Pre-check error:', preCheckError);
|
|
188
|
-
if (onRejection) {
|
|
189
|
-
onRejection(`Pre-check failed: ${preCheckError.message}`);
|
|
190
|
-
}
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Check for existing credentials
|
|
196
|
-
if (enableLogging) {
|
|
197
|
-
console.log('🔍 Checking for existing credentials...');
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const hasExistingCredentials = await hasCredentials();
|
|
201
|
-
|
|
202
|
-
if (hasExistingCredentials) {
|
|
203
|
-
if (enableLogging) {
|
|
204
|
-
console.log('🔑 Existing credentials found, attempting automatic resolution...');
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
try {
|
|
208
|
-
const credentials = await getCredentials();
|
|
209
|
-
|
|
210
|
-
if (credentials && onResolved) {
|
|
211
|
-
// For existing users, we can resolve immediately with cached data
|
|
212
|
-
const mockApiUrl = 'https://api2.onairos.uk/user/data';
|
|
213
|
-
const mockToken = 'existing_user_token';
|
|
214
|
-
|
|
215
|
-
if (enableLogging) {
|
|
216
|
-
console.log('✅ Resolving with existing credentials');
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
onResolved(mockApiUrl, mockToken, credentials);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
} catch (credentialsError) {
|
|
223
|
-
console.warn('⚠️ Failed to retrieve existing credentials:', credentialsError);
|
|
224
|
-
// Continue with normal flow
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
if (enableLogging) {
|
|
229
|
-
console.log('🎨 Opening Onairos overlay...');
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
setShowOverlay(true);
|
|
233
|
-
} catch (error) {
|
|
234
|
-
console.error('❌ Error opening overlay:', error);
|
|
235
|
-
if (onRejection) {
|
|
236
|
-
onRejection(`Failed to open overlay: ${error.message}`);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}, [isInitialized, initializationError, preCheck, enableLogging, onRejection, onResolved]);
|
|
240
|
-
|
|
241
|
-
const handleCloseOverlay = useCallback((result?: any) => {
|
|
242
|
-
if (enableLogging) {
|
|
243
|
-
console.log('🔽 Closing Onairos overlay');
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
setShowOverlay(false);
|
|
247
|
-
|
|
248
|
-
if (result && onResolved) {
|
|
249
|
-
onResolved(result.apiUrl, result.token, result.userData);
|
|
250
|
-
}
|
|
251
|
-
}, [enableLogging, onResolved]);
|
|
252
|
-
|
|
253
|
-
const handleOverlayRejection = useCallback((error?: string) => {
|
|
254
|
-
if (enableLogging) {
|
|
255
|
-
console.log('❌ Overlay rejected:', error);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
setShowOverlay(false);
|
|
259
|
-
|
|
260
|
-
if (onRejection) {
|
|
261
|
-
onRejection(error);
|
|
262
|
-
}
|
|
263
|
-
}, [enableLogging, onRejection]);
|
|
264
|
-
|
|
265
|
-
// Show error state if initialization failed
|
|
266
|
-
if (initializationError && !isInitializing) {
|
|
267
|
-
return (
|
|
268
|
-
<View style={styles.errorContainer}>
|
|
269
|
-
<TouchableOpacity
|
|
270
|
-
style={[styles.errorButton, { backgroundColor: '#FF6B6B' }]}
|
|
271
|
-
onPress={() => {
|
|
272
|
-
Alert.alert(
|
|
273
|
-
'SDK Error',
|
|
274
|
-
`Onairos SDK initialization failed:\n\n${initializationError}\n\nPlease check your API key and try again.`,
|
|
275
|
-
[{ text: 'OK' }]
|
|
276
|
-
);
|
|
277
|
-
}}
|
|
278
|
-
>
|
|
279
|
-
<Text style={styles.errorButtonText}>⚠️ SDK Error</Text>
|
|
280
|
-
</TouchableOpacity>
|
|
281
|
-
</View>
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// Show loading state while initializing
|
|
286
|
-
if (isInitializing || !isInitialized) {
|
|
287
|
-
return (
|
|
288
|
-
<View style={styles.loadingContainer}>
|
|
289
|
-
<TouchableOpacity
|
|
290
|
-
style={[styles.loadingButton, { backgroundColor: '#999' }]}
|
|
291
|
-
disabled={true}
|
|
292
|
-
>
|
|
293
|
-
<Text style={styles.loadingButtonText}>🔄 Initializing...</Text>
|
|
294
|
-
</TouchableOpacity>
|
|
295
|
-
</View>
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Get button style based on type
|
|
300
|
-
const getButtonStyle = (): ViewStyle => {
|
|
301
|
-
const baseStyle: ViewStyle = {
|
|
302
|
-
width: buttonWidth,
|
|
303
|
-
height: buttonHeight,
|
|
304
|
-
backgroundColor: color,
|
|
305
|
-
borderRadius: buttonType === 'pill' ? buttonHeight / 2 : 8,
|
|
306
|
-
alignItems: 'center',
|
|
307
|
-
justifyContent: 'center',
|
|
308
|
-
flexDirection: 'row',
|
|
309
|
-
opacity: enabled ? 1 : 0.6,
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
if (hasStroke) {
|
|
313
|
-
baseStyle.borderWidth = 2;
|
|
314
|
-
baseStyle.borderColor = darkMode ? '#fff' : '#000';
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return baseStyle;
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
const getButtonText = (): string => {
|
|
321
|
-
switch (buttonForm) {
|
|
322
|
-
case 'connect':
|
|
323
|
-
return 'Connect with Onairos';
|
|
324
|
-
default:
|
|
325
|
-
return 'Continue with Onairos';
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
return (
|
|
330
|
-
<>
|
|
331
|
-
<TouchableOpacity
|
|
332
|
-
style={getButtonStyle()}
|
|
333
|
-
onPress={handleShowOverlay}
|
|
334
|
-
disabled={!enabled || isInitializing || !isInitialized}
|
|
335
|
-
activeOpacity={0.8}
|
|
336
|
-
>
|
|
337
|
-
<Image
|
|
338
|
-
source={require('../assets/images/onairos_logo.png')}
|
|
339
|
-
style={styles.logo}
|
|
340
|
-
resizeMode="contain"
|
|
341
|
-
/>
|
|
342
|
-
<Text style={[styles.buttonText, { color: darkMode ? '#000' : '#fff' }]}>
|
|
343
|
-
{getButtonText()}
|
|
344
|
-
</Text>
|
|
345
|
-
</TouchableOpacity>
|
|
346
|
-
|
|
347
|
-
{showOverlay && (
|
|
348
|
-
<Portal>
|
|
349
|
-
<UniversalOnboarding
|
|
350
|
-
visible={showOverlay}
|
|
351
|
-
onClose={handleCloseOverlay}
|
|
352
|
-
AppName={AppName}
|
|
353
|
-
requestData={requestData || {}}
|
|
354
|
-
returnLink={returnLink}
|
|
355
|
-
prefillUrl={prefillUrl}
|
|
356
|
-
onComplete={handleCloseOverlay}
|
|
357
|
-
embedd={false}
|
|
358
|
-
debug={debug}
|
|
359
|
-
testMode={testMode}
|
|
360
|
-
preferredPlatform={preferredPlatform}
|
|
361
|
-
config={getApiConfig() || undefined}
|
|
362
|
-
/>
|
|
363
|
-
</Portal>
|
|
364
|
-
)}
|
|
365
|
-
</>
|
|
366
|
-
);
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
const styles = StyleSheet.create({
|
|
370
|
-
button: {
|
|
371
|
-
flexDirection: 'row',
|
|
372
|
-
alignItems: 'center',
|
|
373
|
-
justifyContent: 'center',
|
|
374
|
-
paddingVertical: 12,
|
|
375
|
-
paddingHorizontal: 16,
|
|
376
|
-
shadowColor: '#000',
|
|
377
|
-
shadowOffset: { width: 0, height: 2 },
|
|
378
|
-
shadowOpacity: 0.1,
|
|
379
|
-
shadowRadius: 4,
|
|
380
|
-
elevation: 2,
|
|
381
|
-
},
|
|
382
|
-
buttonContent: {
|
|
383
|
-
flexDirection: 'row',
|
|
384
|
-
alignItems: 'center',
|
|
385
|
-
justifyContent: 'center',
|
|
386
|
-
},
|
|
387
|
-
logo: {
|
|
388
|
-
width: 24,
|
|
389
|
-
height: 24,
|
|
390
|
-
marginRight: 8,
|
|
391
|
-
},
|
|
392
|
-
buttonText: {
|
|
393
|
-
fontSize: 16,
|
|
394
|
-
fontWeight: '600',
|
|
395
|
-
textAlign: 'center',
|
|
396
|
-
},
|
|
397
|
-
errorContainer: {
|
|
398
|
-
flex: 1,
|
|
399
|
-
justifyContent: 'center',
|
|
400
|
-
alignItems: 'center',
|
|
401
|
-
},
|
|
402
|
-
errorButton: {
|
|
403
|
-
padding: 16,
|
|
404
|
-
borderRadius: 8,
|
|
405
|
-
},
|
|
406
|
-
errorButtonText: {
|
|
407
|
-
fontSize: 16,
|
|
408
|
-
fontWeight: '600',
|
|
409
|
-
color: '#fff',
|
|
410
|
-
},
|
|
411
|
-
loadingContainer: {
|
|
412
|
-
flex: 1,
|
|
413
|
-
justifyContent: 'center',
|
|
414
|
-
alignItems: 'center',
|
|
415
|
-
},
|
|
416
|
-
loadingButton: {
|
|
417
|
-
padding: 16,
|
|
418
|
-
borderRadius: 8,
|
|
419
|
-
},
|
|
420
|
-
loadingButtonText: {
|
|
421
|
-
fontSize: 16,
|
|
422
|
-
fontWeight: '600',
|
|
423
|
-
color: '#fff',
|
|
424
|
-
},
|
|
425
|
-
});
|