@onairos/react-native 3.1.11 → 3.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/api/index.js +75 -1
- package/lib/commonjs/api/index.js.map +1 -1
- 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/farcaster.png +0 -0
- package/lib/commonjs/assets/icons/instagram.png +0 -0
- package/lib/commonjs/assets/icons/pinterest.png +0 -0
- package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
- package/lib/commonjs/assets/icons/twitter.jpg +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/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -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 +27 -0
- package/lib/commonjs/components/BodyText.js.map +1 -0
- package/lib/commonjs/components/BrandMark.js +44 -0
- package/lib/commonjs/components/BrandMark.js.map +1 -0
- package/lib/commonjs/components/CodeInput.js +30 -0
- package/lib/commonjs/components/CodeInput.js.map +1 -0
- package/lib/commonjs/components/EmailInput.js +30 -0
- package/lib/commonjs/components/EmailInput.js.map +1 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +474 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/commonjs/components/GoogleButton.js +55 -0
- package/lib/commonjs/components/GoogleButton.js.map +1 -0
- package/lib/commonjs/components/HeadingGroup.js +43 -0
- package/lib/commonjs/components/HeadingGroup.js.map +1 -0
- package/lib/commonjs/components/ModalHeader.js +99 -0
- package/lib/commonjs/components/ModalHeader.js.map +1 -0
- package/lib/commonjs/components/ModalSheet.js +41 -0
- package/lib/commonjs/components/ModalSheet.js.map +1 -0
- package/lib/commonjs/components/Onairos.js +1 -3
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +171 -190
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/OnairosSignInButton.js +169 -0
- package/lib/commonjs/components/OnairosSignInButton.js.map +1 -0
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PersonaImage.js +60 -0
- package/lib/commonjs/components/PersonaImage.js.map +1 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +156 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +316 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/commonjs/components/PinCreationScreen.js +393 -0
- package/lib/commonjs/components/PinCreationScreen.js.map +1 -0
- package/lib/commonjs/components/PinInput.js +282 -120
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +828 -0
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/commonjs/components/PlatformToggle.js +180 -0
- package/lib/commonjs/components/PlatformToggle.js.map +1 -0
- package/lib/commonjs/components/PrimaryButton.js +180 -0
- package/lib/commonjs/components/PrimaryButton.js.map +1 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -0
- package/lib/commonjs/components/SignInMatchAnimation.js.map +1 -0
- package/lib/commonjs/components/SignInStep.js +179 -0
- package/lib/commonjs/components/SignInStep.js.map +1 -0
- package/lib/commonjs/components/TrainingModal.js +808 -563
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +2304 -1283
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/VerificationStep.js +154 -0
- package/lib/commonjs/components/VerificationStep.js.map +1 -0
- package/lib/commonjs/components/WelcomeScreen.js +385 -0
- package/lib/commonjs/components/WelcomeScreen.js.map +1 -0
- package/lib/commonjs/components/icons/Basicproficon.js +37 -0
- package/lib/commonjs/components/icons/Basicproficon.js.map +1 -0
- package/lib/commonjs/components/icons/Basicprofile.js +21 -0
- package/lib/commonjs/components/icons/Basicprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Checkbox.js +21 -0
- package/lib/commonjs/components/icons/Checkbox.js.map +1 -0
- package/lib/commonjs/components/icons/Checkmark.js +27 -0
- package/lib/commonjs/components/icons/Checkmark.js.map +1 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -0
- package/lib/commonjs/components/icons/Contentanalysis.js.map +1 -0
- package/lib/commonjs/components/icons/Contenticon.js +39 -0
- package/lib/commonjs/components/icons/Contenticon.js.map +1 -0
- package/lib/commonjs/components/icons/EnochE.js +41 -0
- package/lib/commonjs/components/icons/EnochE.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityicon.js +30 -0
- package/lib/commonjs/components/icons/Personalityicon.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -0
- package/lib/commonjs/components/icons/Personalityprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -0
- package/lib/commonjs/components/icons/Personalitytraits.js.map +1 -0
- package/lib/commonjs/components/icons/Userpreferences.js +21 -0
- package/lib/commonjs/components/icons/Userpreferences.js.map +1 -0
- package/lib/commonjs/components/icons/index.js +84 -0
- package/lib/commonjs/components/icons/index.js.map +1 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +134 -743
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/config/api.js +34 -0
- package/lib/commonjs/config/api.js.map +1 -0
- package/lib/commonjs/context/AuthContext.js +345 -0
- package/lib/commonjs/context/AuthContext.js.map +1 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/commonjs/hooks/useConnections.js +120 -125
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useUserConnections.js +148 -0
- package/lib/commonjs/hooks/useUserConnections.js.map +1 -0
- package/lib/commonjs/index.js +149 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiClient.js +302 -0
- package/lib/commonjs/services/apiClient.js.map +1 -0
- package/lib/commonjs/services/authService.js +935 -0
- package/lib/commonjs/services/authService.js.map +1 -0
- package/lib/commonjs/services/biometricPinService.js +184 -0
- package/lib/commonjs/services/biometricPinService.js.map +1 -0
- package/lib/commonjs/services/connectedAccountsService.js +268 -0
- package/lib/commonjs/services/connectedAccountsService.js.map +1 -0
- package/lib/commonjs/services/googleAuthService.js +268 -0
- package/lib/commonjs/services/googleAuthService.js.map +1 -0
- package/lib/commonjs/services/imageCompressionService.js +260 -0
- package/lib/commonjs/services/imageCompressionService.js.map +1 -0
- package/lib/commonjs/services/jwtStorageService.js +256 -0
- package/lib/commonjs/services/jwtStorageService.js.map +1 -0
- package/lib/commonjs/services/mobileTrainingService.js +185 -0
- package/lib/commonjs/services/mobileTrainingService.js.map +1 -0
- package/lib/commonjs/services/pinEncryptionService.js +84 -0
- package/lib/commonjs/services/pinEncryptionService.js.map +1 -0
- package/lib/commonjs/services/pinStorageUtils.js +105 -0
- package/lib/commonjs/services/pinStorageUtils.js.map +1 -0
- package/lib/commonjs/services/platformAuthService.js +956 -722
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/services/storageService.js +404 -0
- package/lib/commonjs/services/storageService.js.map +1 -0
- package/lib/commonjs/services/trainingApiHelpers.js +73 -0
- package/lib/commonjs/services/trainingApiHelpers.js.map +1 -0
- package/lib/commonjs/services/userConnectionsService.js +486 -0
- package/lib/commonjs/services/userConnectionsService.js.map +1 -0
- package/lib/commonjs/services/youtubeMigrationService.js +415 -0
- package/lib/commonjs/services/youtubeMigrationService.js.map +1 -0
- package/lib/commonjs/theme/index.js +249 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/utils/eventUtils.js +288 -0
- package/lib/commonjs/utils/eventUtils.js.map +1 -0
- package/lib/commonjs/utils/haptics.js +66 -0
- package/lib/commonjs/utils/haptics.js.map +1 -0
- package/lib/commonjs/utils/imagePreloader.js +6 -0
- package/lib/commonjs/utils/imagePreloader.js.map +1 -0
- package/lib/module/api/index.js +72 -0
- package/lib/module/api/index.js.map +1 -1
- 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/farcaster.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/checkmark.svg +4 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -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 +20 -0
- package/lib/module/components/BodyText.js.map +1 -0
- package/lib/module/components/BrandMark.js +37 -0
- package/lib/module/components/BrandMark.js.map +1 -0
- package/lib/module/components/CodeInput.js +23 -0
- package/lib/module/components/CodeInput.js.map +1 -0
- package/lib/module/components/EmailInput.js +23 -0
- package/lib/module/components/EmailInput.js.map +1 -0
- package/lib/module/components/ExistingUserDataConfirmation.js +465 -0
- package/lib/module/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/module/components/GoogleButton.js +48 -0
- package/lib/module/components/GoogleButton.js.map +1 -0
- package/lib/module/components/HeadingGroup.js +36 -0
- package/lib/module/components/HeadingGroup.js.map +1 -0
- package/lib/module/components/ModalHeader.js +92 -0
- package/lib/module/components/ModalHeader.js.map +1 -0
- package/lib/module/components/ModalSheet.js +34 -0
- package/lib/module/components/ModalSheet.js.map +1 -0
- package/lib/module/components/Onairos.js +1 -3
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +172 -192
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/OnairosSignInButton.js +160 -0
- package/lib/module/components/OnairosSignInButton.js.map +1 -0
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PersonaImage.js +53 -0
- package/lib/module/components/PersonaImage.js.map +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +148 -0
- package/lib/module/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +309 -0
- package/lib/module/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/module/components/PinCreationScreen.js +386 -0
- package/lib/module/components/PinCreationScreen.js.map +1 -0
- package/lib/module/components/PinInput.js +283 -120
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformConnectorsStep.js +820 -0
- package/lib/module/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/module/components/PlatformToggle.js +173 -0
- package/lib/module/components/PlatformToggle.js.map +1 -0
- package/lib/module/components/PrimaryButton.js +172 -0
- package/lib/module/components/PrimaryButton.js.map +1 -0
- package/lib/module/components/SignInMatchAnimation.js +189 -0
- package/lib/module/components/SignInMatchAnimation.js.map +1 -0
- package/lib/module/components/SignInStep.js +171 -0
- package/lib/module/components/SignInStep.js.map +1 -0
- package/lib/module/components/TrainingModal.js +809 -565
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +2307 -1284
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/VerificationStep.js +146 -0
- package/lib/module/components/VerificationStep.js.map +1 -0
- package/lib/module/components/WelcomeScreen.js +378 -0
- package/lib/module/components/WelcomeScreen.js.map +1 -0
- package/lib/module/components/icons/Basicproficon.js +30 -0
- package/lib/module/components/icons/Basicproficon.js.map +1 -0
- package/lib/module/components/icons/Basicprofile.js +14 -0
- package/lib/module/components/icons/Basicprofile.js.map +1 -0
- package/lib/module/components/icons/Checkbox.js +14 -0
- package/lib/module/components/icons/Checkbox.js.map +1 -0
- package/lib/module/components/icons/Checkmark.js +20 -0
- package/lib/module/components/icons/Checkmark.js.map +1 -0
- package/lib/module/components/icons/Contentanalysis.js +14 -0
- package/lib/module/components/icons/Contentanalysis.js.map +1 -0
- package/lib/module/components/icons/Contenticon.js +32 -0
- package/lib/module/components/icons/Contenticon.js.map +1 -0
- package/lib/module/components/icons/EnochE.js +34 -0
- package/lib/module/components/icons/EnochE.js.map +1 -0
- package/lib/module/components/icons/Personalityicon.js +23 -0
- package/lib/module/components/icons/Personalityicon.js.map +1 -0
- package/lib/module/components/icons/Personalityprofile.js +14 -0
- package/lib/module/components/icons/Personalityprofile.js.map +1 -0
- package/lib/module/components/icons/Personalitytraits.js +14 -0
- package/lib/module/components/icons/Personalitytraits.js.map +1 -0
- package/lib/module/components/icons/Userpreferences.js +14 -0
- package/lib/module/components/icons/Userpreferences.js.map +1 -0
- package/lib/module/components/icons/index.js +13 -0
- package/lib/module/components/icons/index.js.map +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +136 -744
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/config/api.js +26 -0
- package/lib/module/config/api.js.map +1 -0
- package/lib/module/context/AuthContext.js +335 -0
- package/lib/module/context/AuthContext.js.map +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +106 -0
- package/lib/module/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/module/hooks/useConnections.js +119 -125
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useUserConnections.js +140 -0
- package/lib/module/hooks/useUserConnections.js.map +1 -0
- package/lib/module/index.js +51 -15
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiClient.js +298 -0
- package/lib/module/services/apiClient.js.map +1 -0
- package/lib/module/services/authService.js +905 -0
- package/lib/module/services/authService.js.map +1 -0
- package/lib/module/services/biometricPinService.js +173 -0
- package/lib/module/services/biometricPinService.js.map +1 -0
- package/lib/module/services/connectedAccountsService.js +255 -0
- package/lib/module/services/connectedAccountsService.js.map +1 -0
- package/lib/module/services/googleAuthService.js +258 -0
- package/lib/module/services/googleAuthService.js.map +1 -0
- package/lib/module/services/imageCompressionService.js +250 -0
- package/lib/module/services/imageCompressionService.js.map +1 -0
- package/lib/module/services/jwtStorageService.js +239 -0
- package/lib/module/services/jwtStorageService.js.map +1 -0
- package/lib/module/services/mobileTrainingService.js +172 -0
- package/lib/module/services/mobileTrainingService.js.map +1 -0
- package/lib/module/services/pinEncryptionService.js +75 -0
- package/lib/module/services/pinEncryptionService.js.map +1 -0
- package/lib/module/services/pinStorageUtils.js +93 -0
- package/lib/module/services/pinStorageUtils.js.map +1 -0
- package/lib/module/services/platformAuthService.js +943 -704
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/services/storageService.js +383 -0
- package/lib/module/services/storageService.js.map +1 -0
- package/lib/module/services/trainingApiHelpers.js +67 -0
- package/lib/module/services/trainingApiHelpers.js.map +1 -0
- package/lib/module/services/userConnectionsService.js +476 -0
- package/lib/module/services/userConnectionsService.js.map +1 -0
- package/lib/module/services/youtubeMigrationService.js +404 -0
- package/lib/module/services/youtubeMigrationService.js.map +1 -0
- package/lib/module/theme/index.js +244 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/utils/eventUtils.js +270 -0
- package/lib/module/utils/eventUtils.js.map +1 -0
- package/lib/module/utils/haptics.js +59 -0
- package/lib/module/utils/haptics.js.map +1 -0
- package/lib/module/utils/imagePreloader.js +3 -0
- package/lib/module/utils/imagePreloader.js.map +1 -0
- package/lib/typescript/api/index.d.ts +8 -0
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/BodyText.d.ts +10 -0
- package/lib/typescript/components/BodyText.d.ts.map +1 -0
- package/lib/typescript/components/BrandMark.d.ts +11 -0
- package/lib/typescript/components/BrandMark.d.ts.map +1 -0
- package/lib/typescript/components/CodeInput.d.ts +10 -0
- package/lib/typescript/components/CodeInput.d.ts.map +1 -0
- package/lib/typescript/components/EmailInput.d.ts +8 -0
- package/lib/typescript/components/EmailInput.d.ts.map +1 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +12 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +1 -0
- package/lib/typescript/components/GoogleButton.d.ts +11 -0
- package/lib/typescript/components/GoogleButton.d.ts.map +1 -0
- package/lib/typescript/components/HeadingGroup.d.ts +11 -0
- package/lib/typescript/components/HeadingGroup.d.ts.map +1 -0
- package/lib/typescript/components/ModalHeader.d.ts +11 -0
- package/lib/typescript/components/ModalHeader.d.ts.map +1 -0
- package/lib/typescript/components/ModalSheet.d.ts +13 -0
- package/lib/typescript/components/ModalSheet.d.ts.map +1 -0
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +29 -4
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +14 -0
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -0
- package/lib/typescript/components/PersonaImage.d.ts +8 -0
- package/lib/typescript/components/PersonaImage.d.ts.map +1 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +10 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +1 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +10 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinCreationScreen.d.ts +10 -0
- package/lib/typescript/components/PinCreationScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinInput.d.ts +11 -1
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +11 -0
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +1 -0
- package/lib/typescript/components/PlatformToggle.d.ts +20 -0
- package/lib/typescript/components/PlatformToggle.d.ts.map +1 -0
- package/lib/typescript/components/PrimaryButton.d.ts +22 -0
- package/lib/typescript/components/PrimaryButton.d.ts.map +1 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts +9 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +1 -0
- package/lib/typescript/components/SignInStep.d.ts +12 -0
- package/lib/typescript/components/SignInStep.d.ts.map +1 -0
- package/lib/typescript/components/TrainingModal.d.ts +12 -1
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +14 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/VerificationStep.d.ts +13 -0
- package/lib/typescript/components/VerificationStep.d.ts.map +1 -0
- package/lib/typescript/components/WelcomeScreen.d.ts +9 -0
- package/lib/typescript/components/WelcomeScreen.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts +5 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkbox.d.ts +5 -0
- package/lib/typescript/components/icons/Checkbox.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkmark.d.ts +5 -0
- package/lib/typescript/components/icons/Checkmark.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts +5 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contenticon.d.ts +5 -0
- package/lib/typescript/components/icons/Contenticon.d.ts.map +1 -0
- package/lib/typescript/components/icons/EnochE.d.ts +5 -0
- package/lib/typescript/components/icons/EnochE.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts +5 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +1 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts +5 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +1 -0
- package/lib/typescript/components/icons/index.d.ts +12 -0
- package/lib/typescript/components/icons/index.d.ts.map +1 -0
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/config/api.d.ts +24 -0
- package/lib/typescript/config/api.d.ts.map +1 -0
- package/lib/typescript/context/AuthContext.d.ts +34 -0
- package/lib/typescript/context/AuthContext.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +11 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnections.d.ts +10 -5
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +12 -0
- package/lib/typescript/hooks/useUserConnections.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +24 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiClient.d.ts +91 -0
- package/lib/typescript/services/apiClient.d.ts.map +1 -0
- package/lib/typescript/services/authService.d.ts +216 -0
- package/lib/typescript/services/authService.d.ts.map +1 -0
- package/lib/typescript/services/biometricPinService.d.ts +29 -0
- package/lib/typescript/services/biometricPinService.d.ts.map +1 -0
- package/lib/typescript/services/connectedAccountsService.d.ts +56 -0
- package/lib/typescript/services/connectedAccountsService.d.ts.map +1 -0
- package/lib/typescript/services/googleAuthService.d.ts +63 -0
- package/lib/typescript/services/googleAuthService.d.ts.map +1 -0
- package/lib/typescript/services/imageCompressionService.d.ts +37 -0
- package/lib/typescript/services/imageCompressionService.d.ts.map +1 -0
- package/lib/typescript/services/jwtStorageService.d.ts +86 -0
- package/lib/typescript/services/jwtStorageService.d.ts.map +1 -0
- package/lib/typescript/services/mobileTrainingService.d.ts +45 -0
- package/lib/typescript/services/mobileTrainingService.d.ts.map +1 -0
- package/lib/typescript/services/pinEncryptionService.d.ts +17 -0
- package/lib/typescript/services/pinEncryptionService.d.ts.map +1 -0
- package/lib/typescript/services/pinStorageUtils.d.ts +25 -0
- package/lib/typescript/services/pinStorageUtils.d.ts.map +1 -0
- package/lib/typescript/services/platformAuthService.d.ts +34 -109
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/services/storageService.d.ts +128 -0
- package/lib/typescript/services/storageService.d.ts.map +1 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts +38 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +1 -0
- package/lib/typescript/services/userConnectionsService.d.ts +90 -0
- package/lib/typescript/services/userConnectionsService.d.ts.map +1 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts +12 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +416 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +39 -0
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/utils/eventUtils.d.ts +108 -0
- package/lib/typescript/utils/eventUtils.d.ts.map +1 -0
- package/lib/typescript/utils/haptics.d.ts +11 -0
- package/lib/typescript/utils/haptics.d.ts.map +1 -0
- package/lib/typescript/utils/imagePreloader.d.ts +2 -0
- package/lib/typescript/utils/imagePreloader.d.ts.map +1 -0
- package/package.json +158 -145
- package/src/api/index.ts +41 -0
- package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/icons/Facebookicon.png +0 -0
- package/src/assets/icons/Gmail.png +0 -0
- package/src/assets/icons/Linkedinicon.png +0 -0
- package/src/assets/icons/Redditicon.png +0 -0
- package/src/assets/icons/YouTubeicon2.png +0 -0
- package/src/assets/icons/YouTubeicon3.png +0 -0
- package/src/assets/icons/farcaster.png +0 -0
- package/src/assets/icons/instagram.png +0 -0
- package/src/assets/icons/pinterest.png +0 -0
- package/src/assets/icons/swerv_logo.png +0 -0
- package/src/assets/icons/twitter.jpg +0 -0
- package/src/assets/images/Checkbox.svg +3 -0
- package/src/assets/images/EnochE.svg +19 -0
- package/src/assets/images/Enochicon1.png +0 -0
- package/src/assets/images/Face_ID_logo.png +0 -0
- package/src/assets/images/Facebookicon.png +0 -0
- package/src/assets/images/Gmail.png +0 -0
- package/src/assets/images/Googlelogo.png +0 -0
- package/src/assets/images/Linkedinicon.png +0 -0
- package/src/assets/images/Onairoslogo.png +0 -0
- package/src/assets/images/Personalityprofile.svg +3 -0
- package/src/assets/images/Personalitytraits.svg +3 -0
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +3 -0
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +20 -0
- package/src/assets/images/basicproficon.svg +43 -0
- package/src/assets/images/basicprofile.svg +3 -0
- package/src/assets/images/checkmark.svg +4 -0
- package/src/assets/images/contentanalysis.svg +3 -0
- package/src/assets/images/contenticon.svg +23 -0
- package/src/assets/images/persona1.png +0 -0
- package/src/assets/images/persona2.png +0 -0
- package/src/assets/images/persona3.png +0 -0
- package/src/assets/images/persona4.png +0 -0
- package/src/assets/images/persona5.png +0 -0
- package/src/assets/images/personalityicon.svg +18 -0
- package/src/assets/images/x-close.svg +3 -0
- package/src/components/BodyText.tsx +33 -0
- package/src/components/BrandMark.tsx +62 -0
- package/src/components/CodeInput.tsx +32 -0
- package/src/components/EmailInput.tsx +31 -0
- package/src/components/ExistingUserDataConfirmation.tsx +507 -0
- package/src/components/GoogleButton.tsx +55 -0
- package/src/components/HeadingGroup.tsx +49 -0
- package/src/components/ModalHeader.tsx +125 -0
- package/src/components/ModalSheet.tsx +57 -0
- package/src/components/Onairos.tsx +422 -424
- package/src/components/OnairosButton.tsx +339 -359
- package/src/components/OnairosSignInButton.tsx +166 -0
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PersonaImage.tsx +79 -0
- package/src/components/PersonaLoadingScreen.tsx +201 -0
- package/src/components/PersonalizationConsentScreen.tsx +410 -0
- package/src/components/PinCreationScreen.tsx +492 -0
- package/src/components/PinInput.tsx +555 -343
- package/src/components/PlatformConnectorsStep.tsx +892 -0
- package/src/components/PlatformToggle.tsx +226 -0
- package/src/components/PrimaryButton.tsx +214 -0
- package/src/components/SignInMatchAnimation.tsx +225 -0
- package/src/components/SignInStep.tsx +217 -0
- package/src/components/TrainingModal.tsx +1047 -737
- package/src/components/UniversalOnboarding.tsx +2888 -1820
- package/src/components/VerificationStep.tsx +198 -0
- package/src/components/WelcomeScreen.tsx +473 -0
- package/src/components/icons/Basicproficon.tsx +30 -0
- package/src/components/icons/Basicprofile.tsx +17 -0
- package/src/components/icons/Checkbox.tsx +17 -0
- package/src/components/icons/Checkmark.tsx +24 -0
- package/src/components/icons/Contentanalysis.tsx +17 -0
- package/src/components/icons/Contenticon.tsx +30 -0
- package/src/components/icons/EnochE.tsx +39 -0
- package/src/components/icons/Personalityicon.tsx +22 -0
- package/src/components/icons/Personalityprofile.tsx +17 -0
- package/src/components/icons/Personalitytraits.tsx +17 -0
- package/src/components/icons/Userpreferences.tsx +17 -0
- package/src/components/icons/index.ts +12 -0
- package/src/components/onboarding/OAuthWebView.tsx +232 -838
- package/src/config/api.ts +25 -0
- package/src/context/AuthContext.tsx +393 -0
- package/src/hooks/useConnectedAccounts.ts +139 -0
- package/src/hooks/useConnections.ts +129 -131
- package/src/hooks/useUserConnections.ts +166 -0
- package/src/index.ts +94 -49
- package/src/services/apiClient.ts +337 -0
- package/src/services/authService.ts +1008 -0
- package/src/services/biometricPinService.ts +193 -0
- package/src/services/connectedAccountsService.ts +290 -0
- package/src/services/googleAuthService.ts +279 -0
- package/src/services/imageCompressionService.ts +303 -0
- package/src/services/jwtStorageService.ts +257 -0
- package/src/services/mobileTrainingService.ts +204 -0
- package/src/services/pinEncryptionService.ts +76 -0
- package/src/services/pinStorageUtils.ts +97 -0
- package/src/services/platformAuthService.ts +1346 -1113
- package/src/services/storageService.ts +452 -0
- package/src/services/trainingApiHelpers.ts +67 -0
- package/src/services/userConnectionsService.ts +557 -0
- package/src/services/youtubeMigrationService.ts +454 -0
- package/src/theme/index.ts +239 -0
- package/src/types/index.ts +265 -238
- package/src/utils/eventUtils.ts +303 -0
- package/src/utils/haptics.ts +59 -0
- package/src/utils/imagePreloader.ts +2 -0
- package/README.md +0 -375
- 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/UniversalOnboarding.tsx.new +0 -455
- 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/UniversalOnboarding.tsx.new +0 -455
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/UniversalOnboarding.tsx.new +0 -455
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event utility functions for event management
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generate a random alphanumeric event code
|
|
7
|
+
* @param length - Length of the code (default: 6)
|
|
8
|
+
* @returns Random event code
|
|
9
|
+
*/
|
|
10
|
+
export const generateEventCode = (length: number = 6): string => {
|
|
11
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
12
|
+
let result = '';
|
|
13
|
+
|
|
14
|
+
for (let i = 0; i < length; i++) {
|
|
15
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Generate a smart event code based on the event title
|
|
23
|
+
* @param title - Event title
|
|
24
|
+
* @returns Smart event code
|
|
25
|
+
*/
|
|
26
|
+
export const generateSmartEventCode = (title: string): string => {
|
|
27
|
+
if (!title.trim()) {
|
|
28
|
+
return generateEventCode();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Clean the title and split into words
|
|
32
|
+
const words = title
|
|
33
|
+
.trim()
|
|
34
|
+
.toUpperCase()
|
|
35
|
+
.replace(/[^A-Z0-9\s]/g, '') // Remove special characters
|
|
36
|
+
.split(/\s+/)
|
|
37
|
+
.filter(word => word.length > 0);
|
|
38
|
+
|
|
39
|
+
if (words.length === 0) {
|
|
40
|
+
return generateEventCode();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let code = '';
|
|
44
|
+
|
|
45
|
+
// Strategy 1: Take first 2 letters of each word (up to 3 words)
|
|
46
|
+
if (words.length >= 2) {
|
|
47
|
+
const significantWords = words.slice(0, 3);
|
|
48
|
+
code = significantWords
|
|
49
|
+
.map(word => word.substring(0, 2))
|
|
50
|
+
.join('');
|
|
51
|
+
} else {
|
|
52
|
+
// Strategy 2: Single word - take first 4 letters
|
|
53
|
+
code = words[0].substring(0, 4);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Add current year's last 2 digits
|
|
57
|
+
const currentYear = new Date().getFullYear().toString().slice(-2);
|
|
58
|
+
code += currentYear;
|
|
59
|
+
|
|
60
|
+
// Ensure minimum length of 4 and maximum of 8
|
|
61
|
+
if (code.length < 4) {
|
|
62
|
+
code += generateEventCode(4 - code.length);
|
|
63
|
+
} else if (code.length > 8) {
|
|
64
|
+
code = code.substring(0, 8);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return code;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Validate event code format
|
|
72
|
+
* @param code - Event code to validate
|
|
73
|
+
* @returns Object with validation result and error message
|
|
74
|
+
*/
|
|
75
|
+
export const validateEventCode = (code: string): { isValid: boolean; error?: string } => {
|
|
76
|
+
if (!code || !code.trim()) {
|
|
77
|
+
return { isValid: false, error: 'Event code is required' };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const trimmedCode = code.trim().toUpperCase();
|
|
81
|
+
|
|
82
|
+
if (trimmedCode.length < 3) {
|
|
83
|
+
return { isValid: false, error: 'Event code must be at least 3 characters' };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (trimmedCode.length > 10) {
|
|
87
|
+
return { isValid: false, error: 'Event code must be 10 characters or less' };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (!/^[A-Z0-9]+$/.test(trimmedCode)) {
|
|
91
|
+
return { isValid: false, error: 'Event code must contain only letters and numbers' };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return { isValid: true };
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Format event date for display
|
|
99
|
+
* @param dateString - Date string in YYYY-MM-DD format
|
|
100
|
+
* @returns Formatted date string
|
|
101
|
+
*/
|
|
102
|
+
export const formatEventDate = (dateString: string): string => {
|
|
103
|
+
try {
|
|
104
|
+
const date = new Date(dateString);
|
|
105
|
+
return date.toLocaleDateString('en-US', {
|
|
106
|
+
weekday: 'long',
|
|
107
|
+
year: 'numeric',
|
|
108
|
+
month: 'long',
|
|
109
|
+
day: 'numeric',
|
|
110
|
+
});
|
|
111
|
+
} catch (error) {
|
|
112
|
+
return dateString;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Check if an event is happening today
|
|
118
|
+
* @param eventDate - Event date string
|
|
119
|
+
* @returns True if event is today
|
|
120
|
+
*/
|
|
121
|
+
export const isEventToday = (eventDate: string): boolean => {
|
|
122
|
+
try {
|
|
123
|
+
const today = new Date();
|
|
124
|
+
const event = new Date(eventDate);
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
today.getFullYear() === event.getFullYear() &&
|
|
128
|
+
today.getMonth() === event.getMonth() &&
|
|
129
|
+
today.getDate() === event.getDate()
|
|
130
|
+
);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Check if an event is in the past
|
|
138
|
+
* @param eventDate - Event date string
|
|
139
|
+
* @returns True if event is in the past
|
|
140
|
+
*/
|
|
141
|
+
export const isEventPast = (eventDate: string): boolean => {
|
|
142
|
+
try {
|
|
143
|
+
const today = new Date();
|
|
144
|
+
const event = new Date(eventDate);
|
|
145
|
+
|
|
146
|
+
// Set time to start of day for accurate comparison
|
|
147
|
+
today.setHours(0, 0, 0, 0);
|
|
148
|
+
event.setHours(0, 0, 0, 0);
|
|
149
|
+
|
|
150
|
+
return event < today;
|
|
151
|
+
} catch (error) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get event status based on date and active status
|
|
158
|
+
* @param eventDate - Event date string
|
|
159
|
+
* @param isActive - Whether event is active
|
|
160
|
+
* @returns Event status string
|
|
161
|
+
*/
|
|
162
|
+
export const getEventStatus = (eventDate: string, isActive: boolean): string => {
|
|
163
|
+
if (!isActive) {
|
|
164
|
+
return 'Inactive';
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (isEventPast(eventDate)) {
|
|
168
|
+
return 'Past';
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (isEventToday(eventDate)) {
|
|
172
|
+
return 'Today';
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return 'Upcoming';
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Calculate days until event
|
|
180
|
+
* @param eventDate - Event date string
|
|
181
|
+
* @returns Number of days until event (negative if past)
|
|
182
|
+
*/
|
|
183
|
+
export const getDaysUntilEvent = (eventDate: string): number => {
|
|
184
|
+
try {
|
|
185
|
+
const today = new Date();
|
|
186
|
+
const event = new Date(eventDate);
|
|
187
|
+
|
|
188
|
+
// Set time to start of day for accurate comparison
|
|
189
|
+
today.setHours(0, 0, 0, 0);
|
|
190
|
+
event.setHours(0, 0, 0, 0);
|
|
191
|
+
|
|
192
|
+
const diffTime = event.getTime() - today.getTime();
|
|
193
|
+
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
194
|
+
|
|
195
|
+
return diffDays;
|
|
196
|
+
} catch (error) {
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Sort events by date (upcoming first, then past events)
|
|
203
|
+
* @param events - Array of events
|
|
204
|
+
* @returns Sorted array of events
|
|
205
|
+
*/
|
|
206
|
+
export const sortEventsByDate = <T extends { eventDate: string; isActive: boolean }>(events: T[]): T[] => {
|
|
207
|
+
return events.sort((a, b) => {
|
|
208
|
+
// Active events first
|
|
209
|
+
if (a.isActive && !b.isActive) return -1;
|
|
210
|
+
if (!a.isActive && b.isActive) return 1;
|
|
211
|
+
|
|
212
|
+
// Then sort by date
|
|
213
|
+
const dateA = new Date(a.eventDate);
|
|
214
|
+
const dateB = new Date(b.eventDate);
|
|
215
|
+
|
|
216
|
+
// Upcoming events first (ascending), then past events (descending)
|
|
217
|
+
const today = new Date();
|
|
218
|
+
const aIsPast = dateA < today;
|
|
219
|
+
const bIsPast = dateB < today;
|
|
220
|
+
|
|
221
|
+
if (aIsPast && !bIsPast) return 1;
|
|
222
|
+
if (!aIsPast && bIsPast) return -1;
|
|
223
|
+
|
|
224
|
+
if (aIsPast && bIsPast) {
|
|
225
|
+
return dateB.getTime() - dateA.getTime(); // Past events: most recent first
|
|
226
|
+
} else {
|
|
227
|
+
return dateA.getTime() - dateB.getTime(); // Upcoming events: soonest first
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Filter events by search query
|
|
234
|
+
* @param events - Array of events
|
|
235
|
+
* @param query - Search query
|
|
236
|
+
* @returns Filtered array of events
|
|
237
|
+
*/
|
|
238
|
+
export const filterEventsBySearch = <T extends {
|
|
239
|
+
title: string;
|
|
240
|
+
description: string;
|
|
241
|
+
code: string;
|
|
242
|
+
location?: string;
|
|
243
|
+
organizer?: string;
|
|
244
|
+
tags?: string[];
|
|
245
|
+
}>(events: T[], query: string): T[] => {
|
|
246
|
+
if (!query.trim()) {
|
|
247
|
+
return events;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const searchTerm = query.toLowerCase().trim();
|
|
251
|
+
|
|
252
|
+
return events.filter(event =>
|
|
253
|
+
event.title.toLowerCase().includes(searchTerm) ||
|
|
254
|
+
event.description.toLowerCase().includes(searchTerm) ||
|
|
255
|
+
event.code.toLowerCase().includes(searchTerm) ||
|
|
256
|
+
event.location?.toLowerCase().includes(searchTerm) ||
|
|
257
|
+
event.organizer?.toLowerCase().includes(searchTerm) ||
|
|
258
|
+
event.tags?.some(tag => tag.toLowerCase().includes(searchTerm))
|
|
259
|
+
);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Get unique tags from events
|
|
264
|
+
* @param events - Array of events
|
|
265
|
+
* @returns Array of unique tags
|
|
266
|
+
*/
|
|
267
|
+
export const getUniqueEventTags = <T extends { tags?: string[] }>(events: T[]): string[] => {
|
|
268
|
+
const allTags = events.flatMap(event => event.tags || []);
|
|
269
|
+
return Array.from(new Set(allTags)).sort();
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Calculate event statistics
|
|
274
|
+
* @param events - Array of events
|
|
275
|
+
* @returns Event statistics object
|
|
276
|
+
*/
|
|
277
|
+
export const calculateEventStats = <T extends {
|
|
278
|
+
isActive: boolean;
|
|
279
|
+
attendeeCount: number;
|
|
280
|
+
maxAttendees: number;
|
|
281
|
+
eventDate: string;
|
|
282
|
+
}>(events: T[]) => {
|
|
283
|
+
const total = events.length;
|
|
284
|
+
const active = events.filter(e => e.isActive).length;
|
|
285
|
+
const inactive = total - active;
|
|
286
|
+
const totalAttendees = events.reduce((sum, e) => sum + e.attendeeCount, 0);
|
|
287
|
+
const totalCapacity = events.reduce((sum, e) => sum + e.maxAttendees, 0);
|
|
288
|
+
const upcoming = events.filter(e => e.isActive && !isEventPast(e.eventDate)).length;
|
|
289
|
+
const past = events.filter(e => isEventPast(e.eventDate)).length;
|
|
290
|
+
const today = events.filter(e => e.isActive && isEventToday(e.eventDate)).length;
|
|
291
|
+
|
|
292
|
+
return {
|
|
293
|
+
total,
|
|
294
|
+
active,
|
|
295
|
+
inactive,
|
|
296
|
+
upcoming,
|
|
297
|
+
past,
|
|
298
|
+
today,
|
|
299
|
+
totalAttendees,
|
|
300
|
+
totalCapacity,
|
|
301
|
+
averageAttendance: totalCapacity > 0 ? Math.round((totalAttendees / totalCapacity) * 100) : 0,
|
|
302
|
+
};
|
|
303
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export enum HapticType {
|
|
4
|
+
LIGHT = 'light',
|
|
5
|
+
MEDIUM = 'medium',
|
|
6
|
+
HEAVY = 'heavy',
|
|
7
|
+
SUCCESS = 'success',
|
|
8
|
+
WARNING = 'warning',
|
|
9
|
+
ERROR = 'error',
|
|
10
|
+
BUTTON_PRESS = 'light', // Alias for button presses
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const triggerHaptic = (type: HapticType = HapticType.LIGHT) => {
|
|
14
|
+
if (Platform.OS === 'ios') {
|
|
15
|
+
try {
|
|
16
|
+
// Try to use react-native-haptic-feedback if available
|
|
17
|
+
const ReactNativeHapticFeedback = require('react-native-haptic-feedback');
|
|
18
|
+
|
|
19
|
+
const options = {
|
|
20
|
+
enableVibrateFallback: true,
|
|
21
|
+
ignoreAndroidSystemSettings: false,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
switch (type) {
|
|
25
|
+
case HapticType.LIGHT:
|
|
26
|
+
ReactNativeHapticFeedback.trigger('impactLight', options);
|
|
27
|
+
break;
|
|
28
|
+
case HapticType.MEDIUM:
|
|
29
|
+
ReactNativeHapticFeedback.trigger('impactMedium', options);
|
|
30
|
+
break;
|
|
31
|
+
case HapticType.HEAVY:
|
|
32
|
+
ReactNativeHapticFeedback.trigger('impactHeavy', options);
|
|
33
|
+
break;
|
|
34
|
+
case HapticType.SUCCESS:
|
|
35
|
+
ReactNativeHapticFeedback.trigger('notificationSuccess', options);
|
|
36
|
+
break;
|
|
37
|
+
case HapticType.WARNING:
|
|
38
|
+
ReactNativeHapticFeedback.trigger('notificationWarning', options);
|
|
39
|
+
break;
|
|
40
|
+
case HapticType.ERROR:
|
|
41
|
+
ReactNativeHapticFeedback.trigger('notificationError', options);
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
ReactNativeHapticFeedback.trigger('impactLight', options);
|
|
45
|
+
}
|
|
46
|
+
} catch (error) {
|
|
47
|
+
// Fallback to basic vibration if haptic feedback is not available
|
|
48
|
+
console.warn('Haptic feedback not available:', error);
|
|
49
|
+
}
|
|
50
|
+
} else if (Platform.OS === 'android') {
|
|
51
|
+
// Android fallback - basic vibration
|
|
52
|
+
try {
|
|
53
|
+
const { Vibration } = require('react-native');
|
|
54
|
+
Vibration.vibrate(50);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.warn('Vibration not available:', error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|