@oxyhq/services 22.12.4 → 22.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -46
- package/lib/commonjs/index.js +18 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -13
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +27 -4
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +72 -1123
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +50 -12
- package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +4 -4
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +74 -40
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +527 -0
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +90 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +144 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js +188 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +63 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js +169 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +149 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js +54 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/commonjs/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/types.js +59 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +50 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +205 -30
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +46 -0
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +0 -13
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +170 -0
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js +78 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js +53 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js +276 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js +141 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/commonjs/ui/oauth/types.js +2 -0
- package/lib/commonjs/ui/oauth/types.js.map +1 -0
- package/lib/commonjs/ui/server.js +2 -5
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/commonjs/ui/session/authStore.js +6 -75
- package/lib/commonjs/ui/session/authStore.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +11 -3
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/commonjs/ui/session/identityBinding.js +95 -0
- package/lib/commonjs/ui/session/identityBinding.js.map +1 -0
- package/lib/commonjs/ui/session/index.js +13 -0
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/session/nativeSecureStorage.js +90 -0
- package/lib/commonjs/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/commonjs/ui/session/tokenTransport.js +11 -1
- package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +5 -4
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/commonjs/ui/utils/deliveryPlatform.js +58 -0
- package/lib/commonjs/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +72 -46
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/index.js +9 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/client.js +0 -1
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +27 -4
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +76 -1128
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +50 -12
- package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +4 -4
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +76 -42
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +523 -0
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js +85 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js +139 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignUpView.js +184 -0
- package/lib/module/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js +59 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/module/ui/components/authChooser/primitives.js +163 -0
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js +139 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/module/ui/components/authChooser/signInProgress.js +50 -0
- package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/module/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/module/ui/components/authChooser/styles.js.map +1 -0
- package/lib/module/ui/components/authChooser/types.js +55 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js +46 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +208 -33
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +45 -0
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +0 -1
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +167 -0
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/module/ui/oauth/completeOAuthCode.js +75 -0
- package/lib/module/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/module/ui/oauth/oauthHandshake.js +50 -0
- package/lib/module/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopup.js +268 -0
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js +135 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/module/ui/oauth/types.js +2 -0
- package/lib/module/ui/oauth/types.js.map +1 -0
- package/lib/module/ui/server.js +0 -2
- package/lib/module/ui/server.js.map +1 -1
- package/lib/module/ui/session/authStore.js +5 -75
- package/lib/module/ui/session/authStore.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +11 -3
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/ui/session/identityBinding.js +89 -0
- package/lib/module/ui/session/identityBinding.js.map +1 -0
- package/lib/module/ui/session/index.js +5 -2
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/session/nativeSecureStorage.js +88 -0
- package/lib/module/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/module/ui/session/tokenTransport.js +11 -1
- package/lib/module/ui/session/tokenTransport.js.map +1 -1
- package/lib/module/ui/utils/crossOriginRestore.js +6 -5
- package/lib/module/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/module/ui/utils/deliveryPlatform.js +55 -0
- package/lib/module/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +73 -47
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -1
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +21 -29
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +17 -12
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +43 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +54 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{module/ui/components/oxyAuthChooserStyles.d.ts → commonjs/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +85 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +40 -0
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +0 -1
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +83 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/server.d.ts +0 -2
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts +6 -2
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +30 -16
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -1
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +21 -29
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +17 -12
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +43 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +54 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{commonjs/ui/components/oxyAuthChooserStyles.d.ts → module/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +85 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +40 -0
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +0 -1
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +83 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/module/ui/oauth/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/server.d.ts +0 -2
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/module/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/index.d.ts +6 -2
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +30 -16
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/package.json +6 -8
- package/src/index.ts +19 -5
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
- package/src/ui/boot/runProviderColdBoot.ts +83 -13
- package/src/ui/client.ts +0 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +33 -4
- package/src/ui/components/OxyAuthChooser.tsx +100 -1230
- package/src/ui/components/OxyConsentScreen.tsx +56 -13
- package/src/ui/components/OxyProvider.tsx +4 -4
- package/src/ui/components/OxySignInButton.tsx +119 -78
- package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +27 -0
- package/src/ui/components/authChooser/AccountsMenuView.tsx +569 -0
- package/src/ui/components/authChooser/SignInEntryView.tsx +115 -0
- package/src/ui/components/authChooser/SignInRequestView.tsx +163 -0
- package/src/ui/components/authChooser/SignUpView.tsx +174 -0
- package/src/ui/components/authChooser/TroubleDisclosure.tsx +81 -0
- package/src/ui/components/authChooser/primitives.tsx +144 -0
- package/src/ui/components/authChooser/requestSurfaces.tsx +116 -0
- package/src/ui/components/authChooser/signInProgress.ts +54 -0
- package/src/ui/components/{oxyAuthChooserStyles.ts → authChooser/styles.ts} +18 -0
- package/src/ui/components/authChooser/types.ts +101 -0
- package/src/ui/components/authChooser/useUsernameAvailability.ts +60 -0
- package/src/ui/context/OxyContext.tsx +226 -24
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +102 -0
- package/src/ui/context/commitSessionFlow.ts +64 -0
- package/src/ui/context/hooks/useAuthOperations.ts +26 -1
- package/src/ui/context/oxyContextTypes.ts +45 -1
- package/src/ui/context/useOxyAccountGraph.ts +19 -5
- package/src/ui/hooks/useSwitchableAccounts.ts +12 -1
- package/src/ui/index.ts +0 -1
- package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +335 -0
- package/src/ui/oauth/__tests__/completeOAuthCode.test.ts +142 -0
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +352 -0
- package/src/ui/oauth/__tests__/oauthPopupMessages.test.ts +189 -0
- package/src/ui/oauth/__tests__/sharedCompletionPath.test.ts +174 -0
- package/src/ui/oauth/browserAuthTransport.ts +193 -0
- package/src/ui/oauth/completeOAuthCode.ts +93 -0
- package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
- package/src/ui/oauth/oauthHandshake.ts +74 -0
- package/src/ui/oauth/oauthPopup.ts +277 -0
- package/src/ui/oauth/oauthPopupMessages.ts +136 -0
- package/src/ui/oauth/types.ts +150 -0
- package/src/ui/server.ts +0 -2
- package/src/ui/session/__tests__/createSessionClient.test.ts +26 -0
- package/src/ui/session/__tests__/tokenTransport.test.ts +34 -0
- package/src/ui/session/authStore.ts +5 -89
- package/src/ui/session/createSessionClient.ts +15 -2
- package/src/ui/session/identityBinding.ts +116 -0
- package/src/ui/session/index.ts +6 -2
- package/src/ui/session/nativeSecureStorage.ts +98 -0
- package/src/ui/session/tokenTransport.ts +14 -1
- package/src/ui/types/navigation.ts +44 -1
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +17 -0
- package/src/ui/utils/crossOriginRestore.ts +9 -13
- package/src/ui/utils/deliveryPlatform.ts +65 -0
- package/src/ui/utils/oauthReturn.ts +79 -65
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/ui/components/FontLoader.js +0 -35
- package/lib/commonjs/ui/components/FontLoader.js.map +0 -1
- package/lib/commonjs/ui/components/FontLoader.native.js +0 -88
- package/lib/commonjs/ui/components/FontLoader.native.js.map +0 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/ui/components/FontLoader.js +0 -29
- package/lib/module/ui/components/FontLoader.js.map +0 -1
- package/lib/module/ui/components/FontLoader.native.js +0 -83
- package/lib/module/ui/components/FontLoader.native.js.map +0 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/src/ui/components/FontLoader.native.tsx +0 -88
- package/src/ui/components/FontLoader.tsx +0 -27
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The sign-in ENTRY (`signin` / `add` views) — ONE primary action.
|
|
5
|
+
*
|
|
6
|
+
* Issue #691, Phase 5: the normal experience presents no menu of authentication
|
|
7
|
+
* methods. The user sees "Continue with Oxy"; Oxy — not the user — then picks
|
|
8
|
+
* how the request reaches their Commons identity, and the request surface shows
|
|
9
|
+
* honest progress. Everything else (a QR from another device, a passkey on this
|
|
10
|
+
* device, getting Commons, creating an account) lives behind "Having trouble?".
|
|
11
|
+
*
|
|
12
|
+
* Existing accounts still render ABOVE the CTA: "continue as one of these" is a
|
|
13
|
+
* choice of WHO, not of HOW, so it is not one of the competing method buttons
|
|
14
|
+
* the issue removes.
|
|
15
|
+
*
|
|
16
|
+
* On web this view is transient — the container auto-starts the flow the instant
|
|
17
|
+
* the view is reached, because the request surface (QR, or "Check Commons on
|
|
18
|
+
* your phone") IS the primary route there, never something behind a tap.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { View } from 'react-native';
|
|
22
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
23
|
+
import TroubleDisclosure from "./TroubleDisclosure.js";
|
|
24
|
+
import { AccountRow, Dividerish, SubtleLink } from "./primitives.js";
|
|
25
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
26
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
|
+
const SignInEntryView = ({
|
|
28
|
+
snapshot,
|
|
29
|
+
theme,
|
|
30
|
+
t,
|
|
31
|
+
handlers,
|
|
32
|
+
onContinueWithOxy,
|
|
33
|
+
alternatives
|
|
34
|
+
}) => {
|
|
35
|
+
// The entry has no chosen route yet, so nothing here can have failed: the
|
|
36
|
+
// alternatives stay behind the disclosure unconditionally.
|
|
37
|
+
const troubleActions = [{
|
|
38
|
+
key: 'scan-qr-link',
|
|
39
|
+
label: t('accountSwitcher.scanQr'),
|
|
40
|
+
onPress: alternatives.onShowQr
|
|
41
|
+
}, ...(alternatives.passkeyAvailable ? [{
|
|
42
|
+
key: 'passkey-signin-link',
|
|
43
|
+
label: alternatives.passkeyPending ? t('accountSwitcher.passkeySigningIn') : t('accountSwitcher.useIdentityOnDevice'),
|
|
44
|
+
onPress: alternatives.onSignInWithPasskey,
|
|
45
|
+
disabled: alternatives.passkeyPending
|
|
46
|
+
}] : []), {
|
|
47
|
+
key: 'get-commons-link',
|
|
48
|
+
label: t('accountSwitcher.getCommons'),
|
|
49
|
+
onPress: alternatives.onGetCommons
|
|
50
|
+
}];
|
|
51
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
52
|
+
style: styles.signInBlock,
|
|
53
|
+
children: [snapshot.accounts.length > 0 ? /*#__PURE__*/_jsxs(View, {
|
|
54
|
+
style: styles.rows,
|
|
55
|
+
children: [snapshot.accounts.map(account => /*#__PURE__*/_jsx(AccountRow, {
|
|
56
|
+
account: account,
|
|
57
|
+
theme: theme,
|
|
58
|
+
switching: snapshot.switchingAccountId === account.accountId,
|
|
59
|
+
disabled: snapshot.switchingAccountId !== null,
|
|
60
|
+
onPress: () => handlers.onSwitch(account.accountId)
|
|
61
|
+
}, account.accountId)), /*#__PURE__*/_jsx(Dividerish, {
|
|
62
|
+
theme: theme,
|
|
63
|
+
label: t('signin.or')
|
|
64
|
+
})]
|
|
65
|
+
}) : null, /*#__PURE__*/_jsx(Button, {
|
|
66
|
+
variant: "primary",
|
|
67
|
+
onPress: onContinueWithOxy,
|
|
68
|
+
style: styles.primaryButton,
|
|
69
|
+
testID: "continue-with-oxy",
|
|
70
|
+
children: t('accountSwitcher.continueWithOxy')
|
|
71
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
72
|
+
label: t('signin.createAccountLink'),
|
|
73
|
+
theme: theme,
|
|
74
|
+
onPress: alternatives.onCreateAccount,
|
|
75
|
+
testID: "create-account-link"
|
|
76
|
+
}), /*#__PURE__*/_jsx(TroubleDisclosure, {
|
|
77
|
+
actions: troubleActions,
|
|
78
|
+
revealed: false,
|
|
79
|
+
theme: theme,
|
|
80
|
+
t: t
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
export default SignInEntryView;
|
|
85
|
+
//# sourceMappingURL=SignInEntryView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Button","TroubleDisclosure","AccountRow","Dividerish","SubtleLink","authChooserStyles","styles","jsx","_jsx","jsxs","_jsxs","SignInEntryView","snapshot","theme","t","handlers","onContinueWithOxy","alternatives","troubleActions","key","label","onPress","onShowQr","passkeyAvailable","passkeyPending","onSignInWithPasskey","disabled","onGetCommons","style","signInBlock","children","accounts","length","rows","map","account","switching","switchingAccountId","accountId","onSwitch","variant","primaryButton","testID","onCreateAccount","actions","revealed"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/SignInEntryView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,QAAQ,qBAAqB;AAE5C,OAAOC,iBAAiB,MAA8B,wBAAqB;AAC3E,SAASC,UAAU,EAAEC,UAAU,EAAEC,UAAU,QAAQ,iBAAc;AACjE,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAavD,MAAMC,eAA+C,GAAGA,CAAC;EACvDC,QAAQ;EACRC,KAAK;EACLC,CAAC;EACDC,QAAQ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,CAAC,eACF9B,IAAA,CAACL,UAAU;QAACU,KAAK,EAAEA,KAAM;QAACO,KAAK,EAAEN,CAAC,CAAC,WAAW;MAAE,CAAE,CAAC;IAAA,CAC/C,CAAC,GACL,IAAI,eAERN,IAAA,CAACR,MAAM;MACLwC,OAAO,EAAC,SAAS;MACjBnB,OAAO,EAAEL,iBAAkB;MAC3BY,KAAK,EAAEtB,MAAM,CAACmC,aAAc;MAC5BC,MAAM,EAAC,mBAAmB;MAAAZ,QAAA,EAEzBhB,CAAC,CAAC,iCAAiC;IAAC,CAC/B,CAAC,eAKTN,IAAA,CAACJ,UAAU;MACTgB,KAAK,EAAEN,CAAC,CAAC,0BAA0B,CAAE;MACrCD,KAAK,EAAEA,KAAM;MACbQ,OAAO,EAAEJ,YAAY,CAAC0B,eAAgB;MACtCD,MAAM,EAAC;IAAqB,CAC7B,CAAC,eAEFlC,IAAA,CAACP,iBAAiB;MAAC2C,OAAO,EAAE1B,cAAe;MAAC2B,QAAQ,EAAE,KAAM;MAAChC,KAAK,EAAEA,KAAM;MAACC,CAAC,EAAEA;IAAE,CAAE,CAAC;EAAA,CAC/E,CAAC;AAEX,CAAC;AAED,eAAeH,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The ACTIVE REQUEST surface (`qr` view) — the route Oxy chose, plus honest
|
|
5
|
+
* progress (issue #691, Phase 5).
|
|
6
|
+
*
|
|
7
|
+
* The user already performed their one action. From here the surface only
|
|
8
|
+
* REPORTS: the route-appropriate primary visual (`RequestPrimarySurface`), the
|
|
9
|
+
* status line derived from the controller's real signals
|
|
10
|
+
* (`signInProgressLabel`), and nothing else at the same weight. Alternatives
|
|
11
|
+
* stay behind "Having trouble?" until `signIn.routeFailed` says the chosen route
|
|
12
|
+
* could not be carried out — the controller never silently cascades, so
|
|
13
|
+
* revealing them is this view's decision and this view's alone.
|
|
14
|
+
*
|
|
15
|
+
* Two surfaces take over when there is no working primary route to report on:
|
|
16
|
+
* - a FAILED request, whose reason is toasted by the container (never inline),
|
|
17
|
+
* leaves "Try again" as the primary action with the alternatives revealed;
|
|
18
|
+
* - a native device with NO Commons installed, where a same-device QR would be
|
|
19
|
+
* a dead end. There, "Get Commons" is the genuine primary route — not a
|
|
20
|
+
* fallback — so it renders as the one primary action and the QR handoff moves
|
|
21
|
+
* behind the disclosure ("I have Commons on another device").
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { useState } from 'react';
|
|
25
|
+
import { View } from 'react-native';
|
|
26
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
27
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
28
|
+
import TroubleDisclosure from "./TroubleDisclosure.js";
|
|
29
|
+
import { SubtleLink } from "./primitives.js";
|
|
30
|
+
import { GetCommonsPrompt, RequestPrimarySurface } from "./requestSurfaces.js";
|
|
31
|
+
import { signInProgressLabel } from "./signInProgress.js";
|
|
32
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
33
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
|
+
const SignInRequestView = ({
|
|
35
|
+
snapshot,
|
|
36
|
+
theme,
|
|
37
|
+
t,
|
|
38
|
+
onRetry,
|
|
39
|
+
alternatives
|
|
40
|
+
}) => {
|
|
41
|
+
const {
|
|
42
|
+
signIn,
|
|
43
|
+
commonsAvailability
|
|
44
|
+
} = snapshot;
|
|
45
|
+
// Set only from the disclosure's own "I have Commons on another device" —
|
|
46
|
+
// an explicit user choice to leave the acquisition surface, never inferred.
|
|
47
|
+
const [qrRequested, setQrRequested] = useState(false);
|
|
48
|
+
|
|
49
|
+
// A ceremony is pointless once the request is already being confirmed, and a
|
|
50
|
+
// ceremony FAILURE is toasted by the container — this link never renders an
|
|
51
|
+
// error of its own (owner mandate).
|
|
52
|
+
const passkeyAction = alternatives.passkeyAvailable && signIn.phase !== 'authorized' && signIn.phase !== 'completed' ? [{
|
|
53
|
+
key: 'passkey-signin-link',
|
|
54
|
+
label: alternatives.passkeyPending ? t('accountSwitcher.passkeySigningIn') : t('accountSwitcher.useIdentityOnDevice'),
|
|
55
|
+
onPress: alternatives.onSignInWithPasskey,
|
|
56
|
+
disabled: alternatives.passkeyPending
|
|
57
|
+
}] : [];
|
|
58
|
+
const signUpLink =
|
|
59
|
+
/*#__PURE__*/
|
|
60
|
+
// Account CREATION is not an authentication method, and on web this surface
|
|
61
|
+
// is the FIRST one a signed-out user sees (the entry auto-starts straight
|
|
62
|
+
// through it) — so the way in for someone with no Oxy ID stays visible as a
|
|
63
|
+
// subordinate link rather than hiding behind a troubleshooting affordance.
|
|
64
|
+
_jsx(SubtleLink, {
|
|
65
|
+
label: t('signin.createAccountLink'),
|
|
66
|
+
theme: theme,
|
|
67
|
+
onPress: alternatives.onCreateAccount,
|
|
68
|
+
testID: "create-account-link"
|
|
69
|
+
});
|
|
70
|
+
if (signIn.phase === 'error') {
|
|
71
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
72
|
+
style: styles.centeredBlock,
|
|
73
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
74
|
+
variant: "primary",
|
|
75
|
+
onPress: onRetry,
|
|
76
|
+
style: styles.primaryButton,
|
|
77
|
+
children: t('common.actions.tryAgain')
|
|
78
|
+
}), signUpLink, /*#__PURE__*/_jsx(TroubleDisclosure, {
|
|
79
|
+
actions: passkeyAction,
|
|
80
|
+
revealed: true,
|
|
81
|
+
theme: theme,
|
|
82
|
+
t: t
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (commonsAvailability === 'unavailable' && !qrRequested) {
|
|
87
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
88
|
+
style: styles.centeredBlock,
|
|
89
|
+
children: [/*#__PURE__*/_jsx(GetCommonsPrompt, {
|
|
90
|
+
theme: theme,
|
|
91
|
+
t: t,
|
|
92
|
+
onGetCommons: alternatives.onGetCommons
|
|
93
|
+
}), signUpLink, /*#__PURE__*/_jsx(TroubleDisclosure, {
|
|
94
|
+
actions: [{
|
|
95
|
+
key: 'show-qr-anyway-link',
|
|
96
|
+
label: t('accountSwitcher.showQrAnyway'),
|
|
97
|
+
onPress: () => setQrRequested(true)
|
|
98
|
+
}, ...passkeyAction],
|
|
99
|
+
revealed: false,
|
|
100
|
+
theme: theme,
|
|
101
|
+
t: t
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const status = signInProgressLabel(signIn.progress, signIn.route, t);
|
|
106
|
+
const troubleActions = [
|
|
107
|
+
// Redundant while the QR already IS the primary surface.
|
|
108
|
+
...(signIn.route === 'qr' ? [] : [{
|
|
109
|
+
key: 'scan-qr-link',
|
|
110
|
+
label: t('accountSwitcher.scanQr'),
|
|
111
|
+
onPress: alternatives.onShowQr
|
|
112
|
+
}]), ...passkeyAction, {
|
|
113
|
+
key: 'get-commons-link',
|
|
114
|
+
label: t('accountSwitcher.getCommons'),
|
|
115
|
+
onPress: alternatives.onGetCommons
|
|
116
|
+
}];
|
|
117
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
118
|
+
style: styles.centeredBlock,
|
|
119
|
+
children: [/*#__PURE__*/_jsx(RequestPrimarySurface, {
|
|
120
|
+
signIn: signIn,
|
|
121
|
+
theme: theme,
|
|
122
|
+
t: t
|
|
123
|
+
}), status ? /*#__PURE__*/_jsx(Text, {
|
|
124
|
+
style: [styles.mutedText, {
|
|
125
|
+
color: theme.colors.textSecondary
|
|
126
|
+
}],
|
|
127
|
+
accessibilityLiveRegion: "polite",
|
|
128
|
+
testID: "signin-progress",
|
|
129
|
+
children: status
|
|
130
|
+
}) : null, signUpLink, /*#__PURE__*/_jsx(TroubleDisclosure, {
|
|
131
|
+
actions: troubleActions,
|
|
132
|
+
revealed: signIn.routeFailed,
|
|
133
|
+
theme: theme,
|
|
134
|
+
t: t
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
export default SignInRequestView;
|
|
139
|
+
//# sourceMappingURL=SignInRequestView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","View","Button","Text","TroubleDisclosure","SubtleLink","GetCommonsPrompt","RequestPrimarySurface","signInProgressLabel","authChooserStyles","styles","jsx","_jsx","jsxs","_jsxs","SignInRequestView","snapshot","theme","t","onRetry","alternatives","signIn","commonsAvailability","qrRequested","setQrRequested","passkeyAction","passkeyAvailable","phase","key","label","passkeyPending","onPress","onSignInWithPasskey","disabled","signUpLink","onCreateAccount","testID","style","centeredBlock","children","variant","primaryButton","actions","revealed","onGetCommons","status","progress","route","troubleActions","onShowQr","mutedText","color","colors","textSecondary","accessibilityLiveRegion","routeFailed"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/SignInRequestView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,IAAI,QAAQ,yBAAyB;AAE9C,OAAOC,iBAAiB,MAA8B,wBAAqB;AAC3E,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ,sBAAmB;AAC3E,SAASC,mBAAmB,QAAQ,qBAAkB;AACtD,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAYvD,MAAMC,iBAAmD,GAAGA,CAAC;EAC3DC,QAAQ;EACRC,KAAK;EACLC,CAAC;EACDC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC,MAAM;IAAEC;EAAoB,CAAC,GAAGN,QAAQ;EAChD;EACA;EACA,MAAM,CAACO,WAAW,EAA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,EAC5D2B,MAAM,gBACLjC,IAAA,CAACT,IAAI;MACHkC,KAAK,EAAE,CAAC3B,MAAM,CAACwC,SAAS,EAAE;QAAEC,KAAK,EAAElC,KAAK,CAACmC,MAAM,CAACC;MAAc,CAAC,CAAE;MACjEC,uBAAuB,EAAC,QAAQ;MAChClB,MAAM,EAAC,iBAAiB;MAAAG,QAAA,EAEvBM;IAAM,CACH,CAAC,GACL,IAAI,EACPX,UAAU,eACXtB,IAAA,CAACR,iBAAiB;MAChBsC,OAAO,EAAEM,cAAe;MACxBL,QAAQ,EAAEtB,MAAM,CAACkC,WAAY;MAC7BtC,KAAK,EAAEA,KAAM;MACbC,CAAC,EAAEA;IAAE,CACN,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAED,eAAeH,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Account creation (`signup` view).
|
|
5
|
+
*
|
|
6
|
+
* Commons is ALWAYS the priority path (owner mandate) and leads everywhere it
|
|
7
|
+
* appears: native shows only "Create your identity in Commons" (or "Get Commons"
|
|
8
|
+
* first, when it is not installed); web on a first-party Oxy origin leads with
|
|
9
|
+
* the SAME "Get Commons" CTA, with inline passkey creation offered UNDERNEATH as
|
|
10
|
+
* the de-emphasized "don't want to install anything" alternative — never
|
|
11
|
+
* co-equal, never a competing button. Anywhere else (a non-Oxy web origin,
|
|
12
|
+
* before the b2 hub-relay ships) shows an honest "not available here yet"
|
|
13
|
+
* handoff instead of a broken button.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useState } from 'react';
|
|
17
|
+
import { TextInput, View } from 'react-native';
|
|
18
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
19
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
20
|
+
import { isWebBrowser } from "../../utils/isWebBrowser.js";
|
|
21
|
+
import { Dividerish, SubtleLink } from "./primitives.js";
|
|
22
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
23
|
+
import { useUsernameAvailability } from "./useUsernameAvailability.js";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
const SignUpView = ({
|
|
26
|
+
snapshot,
|
|
27
|
+
theme,
|
|
28
|
+
t,
|
|
29
|
+
oxyServices,
|
|
30
|
+
passkeyMode,
|
|
31
|
+
onCreateWithPasskey,
|
|
32
|
+
createPending,
|
|
33
|
+
onOpenHub,
|
|
34
|
+
onCreateIdentityInCommons,
|
|
35
|
+
onGetCommons,
|
|
36
|
+
onBackToSignIn
|
|
37
|
+
}) => {
|
|
38
|
+
const [username, setUsername] = useState('');
|
|
39
|
+
const {
|
|
40
|
+
status: usernameStatus,
|
|
41
|
+
check: checkUsername
|
|
42
|
+
} = useUsernameAvailability(oxyServices, t);
|
|
43
|
+
const canSubmit = username.trim().length >= 3 && usernameStatus === 'available' && !createPending;
|
|
44
|
+
|
|
45
|
+
// Native — Commons owns identity creation. Deep-link straight in when it is
|
|
46
|
+
// installed, else lead with the same "Get Commons" acquisition CTA.
|
|
47
|
+
if (!isWebBrowser()) {
|
|
48
|
+
const commonsInstalled = snapshot.commonsAvailability === 'available';
|
|
49
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
50
|
+
style: styles.centeredBlock,
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
52
|
+
variant: "primary",
|
|
53
|
+
onPress: commonsInstalled ? onCreateIdentityInCommons : onGetCommons,
|
|
54
|
+
style: styles.primaryButton,
|
|
55
|
+
children: commonsInstalled ? t('signup.createInCommons') : t('accountSwitcher.getCommons')
|
|
56
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
57
|
+
label: t('signup.backToSignInLink'),
|
|
58
|
+
theme: theme,
|
|
59
|
+
onPress: onBackToSignIn
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Web, first-party Oxy origin. Commons leads with a "Get Commons" CTA; passkey
|
|
65
|
+
// creation is the de-emphasized alternative underneath for someone who doesn't
|
|
66
|
+
// want to install anything — a secondary button introduced by its own "No
|
|
67
|
+
// Commons?" framing, the same subordination the sign-in surfaces use.
|
|
68
|
+
if (passkeyMode === 'direct') {
|
|
69
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
70
|
+
style: styles.signInBlock,
|
|
71
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
72
|
+
style: [styles.qrHeadline, {
|
|
73
|
+
color: theme.colors.text
|
|
74
|
+
}],
|
|
75
|
+
children: t('signup.commonsHeadline')
|
|
76
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
77
|
+
style: [styles.mutedText, {
|
|
78
|
+
color: theme.colors.textSecondary
|
|
79
|
+
}],
|
|
80
|
+
children: t('signup.commonsExplainer')
|
|
81
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
82
|
+
variant: "primary",
|
|
83
|
+
onPress: onGetCommons,
|
|
84
|
+
style: styles.primaryButton,
|
|
85
|
+
children: t('accountSwitcher.getCommons')
|
|
86
|
+
}), /*#__PURE__*/_jsx(Dividerish, {
|
|
87
|
+
theme: theme,
|
|
88
|
+
label: t('signin.or')
|
|
89
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
90
|
+
style: [styles.mutedText, {
|
|
91
|
+
color: theme.colors.textSecondary
|
|
92
|
+
}],
|
|
93
|
+
children: t('signup.passkeyAlternative')
|
|
94
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
95
|
+
style: [styles.usernameInput, {
|
|
96
|
+
borderColor: theme.colors.border,
|
|
97
|
+
color: theme.colors.text
|
|
98
|
+
}],
|
|
99
|
+
placeholder: t('signup.usernamePlaceholder'),
|
|
100
|
+
placeholderTextColor: theme.colors.textSecondary,
|
|
101
|
+
value: username,
|
|
102
|
+
autoCapitalize: "none",
|
|
103
|
+
autoCorrect: false,
|
|
104
|
+
autoComplete: "username",
|
|
105
|
+
onChangeText: value => {
|
|
106
|
+
setUsername(value);
|
|
107
|
+
checkUsername(value.trim());
|
|
108
|
+
},
|
|
109
|
+
testID: "signup-username-input"
|
|
110
|
+
}), /*#__PURE__*/_jsx(UsernameStatusText, {
|
|
111
|
+
status: usernameStatus,
|
|
112
|
+
theme: theme,
|
|
113
|
+
t: t
|
|
114
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
115
|
+
variant: "secondary",
|
|
116
|
+
onPress: () => onCreateWithPasskey(username.trim()),
|
|
117
|
+
disabled: !canSubmit,
|
|
118
|
+
style: styles.secondaryButton,
|
|
119
|
+
testID: "signup-create-button",
|
|
120
|
+
children: createPending ? t('signup.creating') : t('signup.createAccount')
|
|
121
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
122
|
+
label: t('signup.backToSignInLink'),
|
|
123
|
+
theme: theme,
|
|
124
|
+
onPress: onBackToSignIn
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Web, non-Oxy origin (b2): a passkey ceremony cannot run locally here — the
|
|
130
|
+
// same WebAuthn RP-ID boundary the sign-in surfaces hit — so this opens the
|
|
131
|
+
// auth.oxy.so hub popup. Completing EITHER a sign-in OR a fresh sign-up there
|
|
132
|
+
// relays the resulting session back through the SAME poll/socket engine.
|
|
133
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
134
|
+
style: styles.centeredBlock,
|
|
135
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
136
|
+
style: [styles.mutedText, {
|
|
137
|
+
color: theme.colors.textSecondary
|
|
138
|
+
}],
|
|
139
|
+
children: t('signup.hubExplainer')
|
|
140
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
141
|
+
variant: "primary",
|
|
142
|
+
onPress: onOpenHub,
|
|
143
|
+
style: styles.primaryButton,
|
|
144
|
+
children: t('signup.continueInWindow')
|
|
145
|
+
}), /*#__PURE__*/_jsx(SubtleLink, {
|
|
146
|
+
label: t('signup.backToSignInLink'),
|
|
147
|
+
theme: theme,
|
|
148
|
+
onPress: onBackToSignIn
|
|
149
|
+
})]
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** The inline availability verdict. Network FAILURES are toasted, never shown here. */
|
|
154
|
+
const UsernameStatusText = ({
|
|
155
|
+
status,
|
|
156
|
+
theme,
|
|
157
|
+
t
|
|
158
|
+
}) => {
|
|
159
|
+
if (status === 'idle') return null;
|
|
160
|
+
if (status === 'checking') {
|
|
161
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
162
|
+
style: [styles.mutedText, {
|
|
163
|
+
color: theme.colors.textSecondary
|
|
164
|
+
}],
|
|
165
|
+
children: t('signup.usernameChecking')
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (status === 'available') {
|
|
169
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
170
|
+
style: [styles.mutedText, {
|
|
171
|
+
color: theme.colors.success
|
|
172
|
+
}],
|
|
173
|
+
children: t('signup.usernameAvailable')
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
177
|
+
style: [styles.mutedText, {
|
|
178
|
+
color: theme.colors.error
|
|
179
|
+
}],
|
|
180
|
+
children: t('signup.usernameTaken')
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export default SignUpView;
|
|
184
|
+
//# sourceMappingURL=SignUpView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","TextInput","View","Button","Text","isWebBrowser","Dividerish","SubtleLink","authChooserStyles","styles","useUsernameAvailability","jsx","_jsx","jsxs","_jsxs","SignUpView","snapshot","theme","t","oxyServices","passkeyMode","onCreateWithPasskey","createPending","onOpenHub","onCreateIdentityInCommons","onGetCommons","onBackToSignIn","username","setUsername","status","usernameStatus","check","checkUsername","canSubmit","trim","length","commonsInstalled","commonsAvailability","style","centeredBlock","children","variant","onPress","primaryButton","label","signInBlock","qrHeadline","color","colors","text","mutedText","textSecondary","usernameInput","borderColor","border","placeholder","placeholderTextColor","value","autoCapitalize","autoCorrect","autoComplete","onChangeText","testID","UsernameStatusText","disabled","secondaryButton","success","error"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/SignUpView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,IAAI,QAAQ,yBAAyB;AAE9C,SAASC,YAAY,QAAQ,6BAA0B;AACvD,SAASC,UAAU,EAAEC,UAAU,QAAQ,iBAAc;AACrD,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;AAEtD,SAASC,uBAAuB,QAA6B,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmBzF,MAAMC,UAAqC,GAAGA,CAAC;EAC7CC,QAAQ;EACRC,KAAK;EACLC,CAAC;EACDC,WAAW;EACXC,WAAW;EACXC,mBAAmB;EACnBC,aAAa;EACbC,SAAS;EACTC,yBAAyB;EACzBC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG5B,QAAQ,CAAC,EAAE,CAAC;EAC5C,MAAM;IAAE6B,MAAM,EAAEC,cAAc;IAAEC,KAAK,EAAEC;EAAc,CAAC,GAAGtB,uBAAuB,CAACS,WAAW,EAAED,CAAC,CAAC;EAChG,MAAMe,SAAS,GAAGN,QAAQ,CAACO,IAAI,CAAC,CAAC,CAACC,MAAM,IAAI,CAAC,IAAIL,cAAc,KAAK,WAAW,IAAI,CAACR,aAAa;;EAEjG;EACA;EACA,IAAI,CAACjB,YAAY,CAAC,CAAC,EAAE;IACnB,MAAM+B,gBAAgB,GAAGpB,QAAQ,CAACqB,mB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,EAAE,CAAC7B,MAAM,CAACyC,SAAS,EAAE;QAAEH,KAAK,EAAE9B,KAAK,CAAC+B,MAAM,CAACG;MAAc,CAAC,CAAE;MAAAX,QAAA,EACpEtB,CAAC,CAAC,yBAAyB;IAAC,CACzB,CAAC;EAEX;EACA,IAAIW,MAAM,KAAK,WAAW,EAAE;IAC1B,oBACEjB,IAAA,CAACR,IAAI;MAACkC,KAAK,EAAE,CAAC7B,MAAM,CAACyC,SAAS,EAAE;QAAEH,KAAK,EAAE9B,KAAK,CAAC+B,MAAM,CAACkB;MAAQ,CAAC,CAAE;MAAA1B,QAAA,EAC9DtB,CAAC,CAAC,0BAA0B;IAAC,CAC1B,CAAC;EAEX;EACA,oBACEN,IAAA,CAACR,IAAI;IAACkC,KAAK,EAAE,CAAC7B,MAAM,CAACyC,SAAS,EAAE;MAAEH,KAAK,EAAE9B,KAAK,CAAC+B,MAAM,CAACmB;IAAM,CAAC,CAAE;IAAA3B,QAAA,EAC5DtB,CAAC,CAAC,sBAAsB;EAAC,CACtB,CAAC;AAEX,CAAC;AAED,eAAeH,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The "Having trouble?" progressive disclosure (issue #691, Phase 5).
|
|
5
|
+
*
|
|
6
|
+
* The normal sign-in surface presents ONE primary action. Every alternative —
|
|
7
|
+
* scanning a QR from another device, a passkey on this device, getting Commons,
|
|
8
|
+
* creating an account — lives here, hidden until the user asks for it or the
|
|
9
|
+
* chosen primary route fails.
|
|
10
|
+
*
|
|
11
|
+
* Two renderings, deliberately not one controlled component:
|
|
12
|
+
* - `revealed` (the primary route failed, or there IS no primary route): the
|
|
13
|
+
* alternatives ARE the surface's content now, so they render plainly. There
|
|
14
|
+
* is nothing left to hide them behind.
|
|
15
|
+
* - otherwise: Bloom's own `Collapsible`, whose trigger is the small
|
|
16
|
+
* "Having trouble?" affordance.
|
|
17
|
+
*
|
|
18
|
+
* Splitting on `revealed` is what keeps the open state where it belongs — inside
|
|
19
|
+
* Bloom's uncontrolled disclosure — instead of forcing a hand-rolled controlled
|
|
20
|
+
* copy of it here.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { View } from 'react-native';
|
|
24
|
+
import { Collapsible } from '@oxyhq/bloom/collapsible';
|
|
25
|
+
import { SubtleLink } from "./primitives.js";
|
|
26
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
27
|
+
|
|
28
|
+
/** One alternative route out of the current surface. Always a subordinate link. */
|
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
|
+
const TroubleDisclosure = ({
|
|
31
|
+
actions,
|
|
32
|
+
revealed,
|
|
33
|
+
theme,
|
|
34
|
+
t
|
|
35
|
+
}) => {
|
|
36
|
+
if (actions.length === 0) return null;
|
|
37
|
+
const links = /*#__PURE__*/_jsx(View, {
|
|
38
|
+
style: styles.troubleActions,
|
|
39
|
+
children: actions.map(action => /*#__PURE__*/_jsx(SubtleLink, {
|
|
40
|
+
label: action.label,
|
|
41
|
+
theme: theme,
|
|
42
|
+
onPress: action.onPress,
|
|
43
|
+
disabled: action.disabled,
|
|
44
|
+
testID: action.key
|
|
45
|
+
}, action.key))
|
|
46
|
+
});
|
|
47
|
+
if (revealed) return links;
|
|
48
|
+
return /*#__PURE__*/_jsx(Collapsible, {
|
|
49
|
+
title: t('accountSwitcher.havingTrouble'),
|
|
50
|
+
style: styles.troubleTrigger,
|
|
51
|
+
titleStyle: [styles.linkText, {
|
|
52
|
+
color: theme.colors.textSecondary
|
|
53
|
+
}],
|
|
54
|
+
testID: "trouble-disclosure",
|
|
55
|
+
children: links
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
export default TroubleDisclosure;
|
|
59
|
+
//# sourceMappingURL=TroubleDisclosure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Collapsible","SubtleLink","authChooserStyles","styles","jsx","_jsx","TroubleDisclosure","actions","revealed","theme","t","length","links","style","troubleActions","children","map","action","label","onPress","disabled","testID","key","title","troubleTrigger","titleStyle","linkText","color","colors","textSecondary"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/TroubleDisclosure.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;;AAGtD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAqBA,MAAMC,iBAAmD,GAAGA,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,KAAK;EAAEC;AAAE,CAAC,KAAK;EAC/F,IAAIH,OAAO,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAErC,MAAMC,KAAK,gBACTP,IAAA,CAACN,IAAI;IAACc,KAAK,EAAEV,MAAM,CAACW,cAAe;IAAAC,QAAA,EAChCR,OAAO,CAACS,GAAG,CAAEC,MAAM,iBAClBZ,IAAA,CAACJ,UAAU;MAETiB,KAAK,EAAED,MAAM,CAACC,KAAM;MACpBT,KAAK,EAAEA,KAAM;MACbU,OAAO,EAAEF,MAAM,CAACE,OAAQ;MACxBC,QAAQ,EAAEH,MAAM,CAACG,QAAS;MAC1BC,MAAM,EAAEJ,MAAM,CAACK;IAAI,GALdL,MAAM,CAACK,GAMb,CACF;EAAC,CACE,CACP;EAED,IAAId,QAAQ,EAAE,OAAOI,KAAK;EAE1B,oBACEP,IAAA,CAACL,WAAW;IACVuB,KAAK,EAAEb,CAAC,CAAC,+BAA+B,CAAE;IAC1CG,KAAK,EAAEV,MAAM,CAACqB,cAAe;IAC7BC,UAAU,EAAE,CAACtB,MAAM,CAACuB,QAAQ,EAAE;MAAEC,KAAK,EAAElB,KAAK,CAACmB,MAAM,CAACC;IAAc,CAAC,CAAE;IACrER,MAAM,EAAC,oBAAoB;IAAAN,QAAA,EAE1BH;EAAK,CACK,CAAC;AAElB,CAAC;AAED,eAAeN,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The small presentational building blocks shared across the auth chooser's
|
|
5
|
+
* views. One responsibility each, no controller access, no side effects — they
|
|
6
|
+
* take props and render.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useState } from 'react';
|
|
10
|
+
import { Pressable, View } from 'react-native';
|
|
11
|
+
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
12
|
+
import { Avatar } from '@oxyhq/bloom/avatar';
|
|
13
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
14
|
+
import { BloomColorScope } from '@oxyhq/bloom/theme';
|
|
15
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
16
|
+
import { resolveAccentHex, toPreset } from "./types.js";
|
|
17
|
+
|
|
18
|
+
/** Diameter of a row avatar (the sign-in view's account rows). */
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
const ROW_AVATAR_SIZE = 40;
|
|
21
|
+
/**
|
|
22
|
+
* A `Pressable` that appends a hover-tint NativeWind token while pointer-hovered.
|
|
23
|
+
* The Metro web pipeline here does NOT emit NativeWind `hover:` variants, so hover
|
|
24
|
+
* is driven by RN's cross-platform `onHoverIn`/`onHoverOut` (they fire only on web
|
|
25
|
+
* via react-native-web; a no-op on native) toggling a plain background token —
|
|
26
|
+
* the tint stays a NativeWind class, only the trigger is JS.
|
|
27
|
+
*/
|
|
28
|
+
export const HoverPressable = ({
|
|
29
|
+
baseClassName,
|
|
30
|
+
hoverClassName,
|
|
31
|
+
...rest
|
|
32
|
+
}) => {
|
|
33
|
+
const [hovered, setHovered] = useState(false);
|
|
34
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
35
|
+
...rest,
|
|
36
|
+
className: hovered ? `${baseClassName} ${hoverClassName}` : baseClassName,
|
|
37
|
+
onHoverIn: () => setHovered(true),
|
|
38
|
+
onHoverOut: () => setHovered(false)
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A SUBORDINATE action: a small centred text link, never a button.
|
|
44
|
+
*
|
|
45
|
+
* This is the single visual grammar for everything that is not the surface's one
|
|
46
|
+
* primary action (issue #691) — the sign-up entry, and every alternative revealed
|
|
47
|
+
* behind "Having trouble?". Keeping them all on one component is what stops an
|
|
48
|
+
* alternative from quietly growing into a co-equal button again.
|
|
49
|
+
*/
|
|
50
|
+
export const SubtleLink = ({
|
|
51
|
+
label,
|
|
52
|
+
theme,
|
|
53
|
+
onPress,
|
|
54
|
+
disabled,
|
|
55
|
+
testID
|
|
56
|
+
}) => /*#__PURE__*/_jsx(Pressable, {
|
|
57
|
+
onPress: onPress,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
accessibilityRole: "button",
|
|
60
|
+
accessibilityLabel: label,
|
|
61
|
+
style: styles.footerLink,
|
|
62
|
+
testID: testID,
|
|
63
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
64
|
+
style: [styles.linkText, {
|
|
65
|
+
color: theme.colors.textSecondary
|
|
66
|
+
}],
|
|
67
|
+
children: label
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
/** A labelled hairline separating two blocks ("or"). */
|
|
72
|
+
export const Dividerish = ({
|
|
73
|
+
theme,
|
|
74
|
+
label
|
|
75
|
+
}) => /*#__PURE__*/_jsxs(View, {
|
|
76
|
+
style: styles.dividerRow,
|
|
77
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: [styles.dividerLine, {
|
|
79
|
+
backgroundColor: theme.colors.border
|
|
80
|
+
}]
|
|
81
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
82
|
+
style: [styles.dividerText, {
|
|
83
|
+
color: theme.colors.textSecondary
|
|
84
|
+
}],
|
|
85
|
+
children: label
|
|
86
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
87
|
+
style: [styles.dividerLine, {
|
|
88
|
+
backgroundColor: theme.colors.border
|
|
89
|
+
}]
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* An account row on the sign-in entry — "continue as one of these" rather than a
|
|
95
|
+
* choice of authentication METHOD, which is why it stays above the primary CTA
|
|
96
|
+
* instead of behind the trouble disclosure.
|
|
97
|
+
*/
|
|
98
|
+
export const AccountRow = ({
|
|
99
|
+
account,
|
|
100
|
+
theme,
|
|
101
|
+
switching,
|
|
102
|
+
disabled,
|
|
103
|
+
onPress
|
|
104
|
+
}) => {
|
|
105
|
+
const accent = resolveAccentHex(account.color, theme.colors.primary);
|
|
106
|
+
return /*#__PURE__*/_jsx(BloomColorScope, {
|
|
107
|
+
colorPreset: toPreset(account.color),
|
|
108
|
+
asChild: true,
|
|
109
|
+
children: /*#__PURE__*/_jsxs(Pressable, {
|
|
110
|
+
style: [styles.accountRow, {
|
|
111
|
+
borderColor: account.isCurrent ? accent : theme.colors.border,
|
|
112
|
+
backgroundColor: theme.colors.card
|
|
113
|
+
}, disabled && !switching ? styles.rowDisabled : null],
|
|
114
|
+
onPress: onPress,
|
|
115
|
+
disabled: disabled,
|
|
116
|
+
accessibilityRole: "button",
|
|
117
|
+
accessibilityState: {
|
|
118
|
+
selected: account.isCurrent,
|
|
119
|
+
disabled
|
|
120
|
+
},
|
|
121
|
+
accessibilityLabel: account.displayName,
|
|
122
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
123
|
+
style: [styles.avatarRing, {
|
|
124
|
+
borderColor: account.isCurrent ? accent : 'transparent'
|
|
125
|
+
}],
|
|
126
|
+
children: /*#__PURE__*/_jsx(Avatar, {
|
|
127
|
+
source: account.avatarUrl ?? undefined,
|
|
128
|
+
variant: "thumb",
|
|
129
|
+
name: account.displayName,
|
|
130
|
+
size: ROW_AVATAR_SIZE
|
|
131
|
+
})
|
|
132
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
133
|
+
style: styles.rowMeta,
|
|
134
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
135
|
+
style: [styles.rowName, {
|
|
136
|
+
color: theme.colors.text
|
|
137
|
+
}],
|
|
138
|
+
numberOfLines: 1,
|
|
139
|
+
children: account.displayName
|
|
140
|
+
}), account.email ? /*#__PURE__*/_jsx(Text, {
|
|
141
|
+
style: [styles.rowHandle, {
|
|
142
|
+
color: theme.colors.textSecondary
|
|
143
|
+
}],
|
|
144
|
+
numberOfLines: 1,
|
|
145
|
+
children: account.email
|
|
146
|
+
}) : null]
|
|
147
|
+
}), switching ? /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
148
|
+
name: "loading",
|
|
149
|
+
size: 20,
|
|
150
|
+
color: accent
|
|
151
|
+
}) : account.isCurrent ? /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
152
|
+
name: "check-circle",
|
|
153
|
+
size: 20,
|
|
154
|
+
color: accent
|
|
155
|
+
}) : /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
156
|
+
name: "chevron-right",
|
|
157
|
+
size: 20,
|
|
158
|
+
color: theme.colors.textSecondary
|
|
159
|
+
})]
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=primitives.js.map
|