@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 @@
|
|
|
1
|
+
{"version":3,"names":["useState","Pressable","View","MaterialCommunityIcons","Avatar","Text","BloomColorScope","authChooserStyles","styles","resolveAccentHex","toPreset","jsx","_jsx","jsxs","_jsxs","ROW_AVATAR_SIZE","HoverPressable","baseClassName","hoverClassName","rest","hovered","setHovered","className","onHoverIn","onHoverOut","SubtleLink","label","theme","onPress","disabled","testID","accessibilityRole","accessibilityLabel","style","footerLink","children","linkText","color","colors","textSecondary","Dividerish","dividerRow","dividerLine","backgroundColor","border","dividerText","AccountRow","account","switching","accent","primary","colorPreset","asChild","accountRow","borderColor","isCurrent","card","rowDisabled","accessibilityState","selected","displayName","avatarRing","source","avatarUrl","undefined","variant","name","size","rowMeta","rowName","text","numberOfLines","email","rowHandle"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/primitives.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,OAAO;AAChC,SAASC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,eAAe,QAAQ,oBAAoB;AAEpD,SAASC,iBAAiB,IAAIC,MAAM,QAAQ,aAAU;AACtD,SAASC,gBAAgB,EAAEC,QAAQ,QAAoB,YAAS;;AAEhE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,eAAe,GAAG,EAAE;AAO1B;AACA;AACA;AACA;AACA;AACA;AAC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Q,SAAS,gBACnB3C,IAAA,CAACT,sBAAsB;QAAC+D,IAAI,EAAC,cAAc;QAACC,IAAI,EAAE,EAAG;QAAC9B,KAAK,EAAEY;MAAO,CAAE,CAAC,gBAEvErC,IAAA,CAACT,sBAAsB;QAAC+D,IAAI,EAAC,eAAe;QAACC,IAAI,EAAE,EAAG;QAAC9B,KAAK,EAAEV,KAAK,CAACW,MAAM,CAACC;MAAc,CAAE,CAC5F;IAAA,CACQ;EAAC,CACG,CAAC;AAEtB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The PRIMARY visual of an active "Sign in with Oxy" request — one surface per
|
|
5
|
+
* route, chosen by {@link RequestPrimarySurface} from the controller's own facts.
|
|
6
|
+
*
|
|
7
|
+
* Each is a leading visual and nothing else: the status sentence underneath is
|
|
8
|
+
* owned by `signInProgressLabel`, and the alternatives by `TroubleDisclosure`.
|
|
9
|
+
* That separation is what keeps exactly one primary action on screen (issue
|
|
10
|
+
* #691) — a surface here can never grow a competing button.
|
|
11
|
+
*
|
|
12
|
+
* Anti-phishing: the QR plate encodes `signIn.qrPayload` and renders NOTHING
|
|
13
|
+
* derived from it. Application identity, origin, and scopes are resolved
|
|
14
|
+
* server-side by the approver (Commons), never read out of the payload here.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { View } from 'react-native';
|
|
18
|
+
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
19
|
+
import QRCode from 'react-native-qrcode-svg';
|
|
20
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
21
|
+
import { Loading } from '@oxyhq/bloom/loading';
|
|
22
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
23
|
+
import { authChooserStyles as styles } from "./styles.js";
|
|
24
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
/** High-contrast QR colors — intentionally fixed (NOT themed) for scan reliability. */
|
|
26
|
+
const QR_PLATE_BG = '#FFFFFF';
|
|
27
|
+
const QR_FOREGROUND = '#000000';
|
|
28
|
+
const QR_SIZE = 196;
|
|
29
|
+
/** The leading route glyph, sized to sit where the QR plate otherwise would. */
|
|
30
|
+
const ROUTE_GLYPH_SIZE = 44;
|
|
31
|
+
|
|
32
|
+
/** The indeterminate leading visual: the request exists but has nothing to show yet. */
|
|
33
|
+
export const PreparingSurface = () => /*#__PURE__*/_jsx(Loading, {
|
|
34
|
+
variant: "spinner",
|
|
35
|
+
size: "large"
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/** The leading glyph for a route whose surface is elsewhere (the phone, Commons). */
|
|
39
|
+
export const RouteGlyph = ({
|
|
40
|
+
name,
|
|
41
|
+
color
|
|
42
|
+
}) => /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
43
|
+
name: name,
|
|
44
|
+
size: ROUTE_GLYPH_SIZE,
|
|
45
|
+
color: color
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/** The cross-device handoff: a headline over the fixed-contrast QR plate. */
|
|
49
|
+
export const QrPlate = ({
|
|
50
|
+
payload,
|
|
51
|
+
theme,
|
|
52
|
+
t
|
|
53
|
+
}) => /*#__PURE__*/_jsxs(_Fragment, {
|
|
54
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
55
|
+
style: [styles.qrHeadline, {
|
|
56
|
+
color: theme.colors.text
|
|
57
|
+
}],
|
|
58
|
+
children: t('accountSwitcher.qrHeadline')
|
|
59
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
60
|
+
style: styles.qrPlate,
|
|
61
|
+
children: /*#__PURE__*/_jsx(QRCode, {
|
|
62
|
+
value: payload,
|
|
63
|
+
size: QR_SIZE,
|
|
64
|
+
backgroundColor: QR_PLATE_BG,
|
|
65
|
+
color: QR_FOREGROUND
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The acquisition surface. For someone with no Commons at all this is the
|
|
72
|
+
* GENUINE primary route, not a fallback — a same-device QR they would have to
|
|
73
|
+
* scan with the very screen showing it is a dead end — so it renders as the
|
|
74
|
+
* surface's one primary action.
|
|
75
|
+
*/
|
|
76
|
+
export const GetCommonsPrompt = ({
|
|
77
|
+
theme,
|
|
78
|
+
t,
|
|
79
|
+
onGetCommons
|
|
80
|
+
}) => /*#__PURE__*/_jsxs(_Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
82
|
+
style: [styles.mutedText, {
|
|
83
|
+
color: theme.colors.textSecondary
|
|
84
|
+
}],
|
|
85
|
+
children: t('accountSwitcher.commonsNotInstalled')
|
|
86
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
87
|
+
variant: "primary",
|
|
88
|
+
onPress: onGetCommons,
|
|
89
|
+
style: styles.primaryButton,
|
|
90
|
+
testID: "get-commons-button",
|
|
91
|
+
children: t('accountSwitcher.getCommons')
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The one primary visual for the request's current state.
|
|
97
|
+
*
|
|
98
|
+
* Ordered most-terminal-first, so a late-arriving route can never pull the
|
|
99
|
+
* surface back from "confirming" to a QR the user has already scanned. Every
|
|
100
|
+
* branch reads only controller facts — there is no local timeline.
|
|
101
|
+
*/
|
|
102
|
+
export const RequestPrimarySurface = ({
|
|
103
|
+
signIn,
|
|
104
|
+
theme,
|
|
105
|
+
t
|
|
106
|
+
}) => {
|
|
107
|
+
if (signIn.progress === 'identity-confirmed') {
|
|
108
|
+
return /*#__PURE__*/_jsx(RouteGlyph, {
|
|
109
|
+
name: "check-circle",
|
|
110
|
+
color: theme.colors.success
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (signIn.progress === 'confirming-identity') {
|
|
114
|
+
return /*#__PURE__*/_jsx(PreparingSurface, {});
|
|
115
|
+
}
|
|
116
|
+
if (signIn.route === 'qr' && signIn.qrPayload) {
|
|
117
|
+
return /*#__PURE__*/_jsx(QrPlate, {
|
|
118
|
+
payload: signIn.qrPayload,
|
|
119
|
+
theme: theme,
|
|
120
|
+
t: t
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (signIn.route === 'await-push') {
|
|
124
|
+
return /*#__PURE__*/_jsx(RouteGlyph, {
|
|
125
|
+
name: "cellphone-message",
|
|
126
|
+
color: theme.colors.primary
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (signIn.route === 'open-commons') {
|
|
130
|
+
return /*#__PURE__*/_jsx(RouteGlyph, {
|
|
131
|
+
name: "open-in-app",
|
|
132
|
+
color: theme.colors.primary
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// No route resolved yet (or a route with no payload to render): the request is
|
|
136
|
+
// being prepared. Honest, and the only state that is not route-specific.
|
|
137
|
+
return /*#__PURE__*/_jsx(PreparingSurface, {});
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=requestSurfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","MaterialCommunityIcons","QRCode","Button","Loading","Text","authChooserStyles","styles","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","QR_PLATE_BG","QR_FOREGROUND","QR_SIZE","ROUTE_GLYPH_SIZE","PreparingSurface","variant","size","RouteGlyph","name","color","QrPlate","payload","theme","t","children","style","qrHeadline","colors","text","qrPlate","value","backgroundColor","GetCommonsPrompt","onGetCommons","mutedText","textSecondary","onPress","primaryButton","testID","RequestPrimarySurface","signIn","progress","success","route","qrPayload","primary"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/requestSurfaces.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,OAAOC,MAAM,MAAM,yBAAy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AAK,EAAEA,KAAM;MAACC,CAAC,EAAEA;IAAE,CAAE,CAAC;EACnE;EACA,IAAIiB,MAAM,CAACG,KAAK,KAAK,YAAY,EAAE;IACjC,oBAAOtC,IAAA,CAACY,UAAU;MAACC,IAAI,EAAC,mBAAmB;MAACC,KAAK,EAAEG,KAAK,CAACK,MAAM,CAACkB;IAAQ,CAAE,CAAC;EAC7E;EACA,IAAIL,MAAM,CAACG,KAAK,KAAK,cAAc,EAAE;IACnC,oBAAOtC,IAAA,CAACY,UAAU;MAACC,IAAI,EAAC,aAAa;MAACC,KAAK,EAAEG,KAAK,CAACK,MAAM,CAACkB;IAAQ,CAAE,CAAC;EACvE;EACA;EACA;EACA,oBAAOxC,IAAA,CAACS,gBAAgB,IAAE,CAAC;AAC7B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The sign-in status line's copy (issue #691, Phase 5).
|
|
5
|
+
*
|
|
6
|
+
* One responsibility: map the controller's DERIVED `signIn.progress` — plus the
|
|
7
|
+
* chosen route, which only disambiguates the generic waiting step — onto a
|
|
8
|
+
* sentence. Pure and total, with no clock and no state of its own: the line can
|
|
9
|
+
* therefore only advance when the controller observed a real signal, never on a
|
|
10
|
+
* timer and never optimistically.
|
|
11
|
+
*
|
|
12
|
+
* The ladder the user sees:
|
|
13
|
+
*
|
|
14
|
+
* Preparing request
|
|
15
|
+
* Check Commons on your phone
|
|
16
|
+
* Opened in Commons
|
|
17
|
+
* Confirming identity
|
|
18
|
+
* Identity confirmed
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The status sentence for the active request, or `null` when there is nothing
|
|
23
|
+
* honest to say (no live request, or a terminal error — which is toasted, never
|
|
24
|
+
* rendered inline).
|
|
25
|
+
*/
|
|
26
|
+
export function signInProgressLabel(progress, route, t) {
|
|
27
|
+
switch (progress) {
|
|
28
|
+
case 'idle':
|
|
29
|
+
return null;
|
|
30
|
+
case 'preparing':
|
|
31
|
+
return t('accountSwitcher.progress.preparing');
|
|
32
|
+
case 'awaiting-approval':
|
|
33
|
+
// The only step whose copy depends on the route: waiting means something
|
|
34
|
+
// different when the user is holding a QR than when Commons was opened
|
|
35
|
+
// for them. `await-push` never reaches here — a chosen push route is
|
|
36
|
+
// itself a confirmed dispatch, so it derives to `delivered-to-commons`.
|
|
37
|
+
if (route === 'qr') return t('accountSwitcher.progress.scanWithCommons');
|
|
38
|
+
if (route === 'open-commons') return t('accountSwitcher.progress.continueInCommons');
|
|
39
|
+
return t('accountSwitcher.progress.awaitingApproval');
|
|
40
|
+
case 'delivered-to-commons':
|
|
41
|
+
return t('accountSwitcher.progress.checkCommons');
|
|
42
|
+
case 'opened-in-commons':
|
|
43
|
+
return t('accountSwitcher.progress.openedInCommons');
|
|
44
|
+
case 'confirming-identity':
|
|
45
|
+
return t('accountSwitcher.progress.confirming');
|
|
46
|
+
case 'identity-confirmed':
|
|
47
|
+
return t('accountSwitcher.progress.confirmed');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=signInProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["signInProgressLabel","progress","route","t"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/signInProgress.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CACjCC,QAAwB,EACxBC,KAAkC,EAClCC,CAAY,EACG;EACf,QAAQF,QAAQ;IACd,KAAK,MAAM;MACT,OAAO,IAAI;IACb,KAAK,WAAW;MACd,OAAOE,CAAC,CAAC,oCAAoC,CAAC;IAChD,KAAK,mBAAmB;MACtB;MACA;MACA;MACA;MACA,IAAID,KAAK,KAAK,IAAI,EAAE,OAAOC,CAAC,CAAC,0CAA0C,CAAC;MACxE,IAAID,KAAK,KAAK,cAAc,EAAE,OAAOC,CAAC,CAAC,4CAA4C,CAAC;MACpF,OAAOA,CAAC,CAAC,2CAA2C,CAAC;IACvD,KAAK,sBAAsB;MACzB,OAAOA,CAAC,CAAC,uCAAuC,CAAC;IACnD,KAAK,mBAAmB;MACtB,OAAOA,CAAC,CAAC,0CAA0C,CAAC;IACtD,KAAK,qBAAqB;MACxB,OAAOA,CAAC,CAAC,qCAAqC,CAAC;IACjD,KAAK,oBAAoB;MACvB,OAAOA,CAAC,CAAC,oCAAoC,CAAC;EAClD;AACF","ignoreList":[]}
|
|
@@ -9,6 +9,10 @@ const QR_PLATE_BG = '#FFFFFF';
|
|
|
9
9
|
* Shared styles for `OxyAuthChooser`'s views. Extracted from `OxyAccountDialogScreen`
|
|
10
10
|
* so both the Dialog-wrapped host and any bare host (e.g. a future
|
|
11
11
|
* auth.oxy.so hub page) render identically without duplicating a StyleSheet.
|
|
12
|
+
*
|
|
13
|
+
* Only what NativeWind cannot express lives here: the animated collapse, the
|
|
14
|
+
* fixed-contrast QR plate, per-account accent rings, and the small subordinate
|
|
15
|
+
* text-link rhythm every view's fallback affordances share.
|
|
12
16
|
*/
|
|
13
17
|
export const authChooserStyles = StyleSheet.create({
|
|
14
18
|
rows: {
|
|
@@ -193,6 +197,20 @@ export const authChooserStyles = StyleSheet.create({
|
|
|
193
197
|
padding: 16,
|
|
194
198
|
borderRadius: 16,
|
|
195
199
|
backgroundColor: QR_PLATE_BG
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* The revealed "Having trouble?" alternatives — a tight stack of subordinate
|
|
203
|
+
* text links. They share `footerLink`'s rhythm, so the stack itself only has
|
|
204
|
+
* to stop them drifting apart.
|
|
205
|
+
*/
|
|
206
|
+
troubleActions: {
|
|
207
|
+
width: '100%',
|
|
208
|
+
alignItems: 'center'
|
|
209
|
+
},
|
|
210
|
+
/** The disclosure trigger, aligned with the subordinate links it reveals. */
|
|
211
|
+
troubleTrigger: {
|
|
212
|
+
alignSelf: 'center',
|
|
213
|
+
marginTop: 12
|
|
196
214
|
}
|
|
197
215
|
});
|
|
198
|
-
//# sourceMappingURL=
|
|
216
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","QR_PLATE_BG","authChooserStyles","create","rows","width","gap","accountRow","flexDirection","alignItems","borderWidth","hairlineWidth","borderRadius","paddingVertical","paddingHorizontal","rowDisabled","opacity","avatarRing","padding","rowMeta","flex","minWidth","rowName","fontSize","fontWeight","rowHandle","marginTop","collapse","overflow","collapseMeasure","hero","paddingTop","paddingBottom","currentAvatarRing","position","top","left","right","bottom","heroAvatarPressable","heroAvatarRing","heroNameBlock","heroGreeting","textAlign","heroAddress","chevronCircle","height","justifyContent","footerLink","alignSelf","linkText","signInBlock","primaryButton","secondaryButton","usernameInput","dividerRow","marginVertical","dividerLine","dividerText","marginHorizontal","centeredBlock","mutedText","qrHeadline","qrPlate","backgroundColor","troubleActions","troubleTrigger"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;;AAEzC;AACA,MAAMC,WAAW,GAAG,SAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGF,UAAU,CAACG,MAAM,CAAC;EACjDC,IAAI,EAAE;IACJC,KAAK,EAAE,MAAM;IACbC,GAAG,EAAE;EACP,CAAC;EACDC,UAAU,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBH,GAAG,EAAE,EAAE;IACPI,WAAW,EAAEV,UAAU,CAACW,aAAa;IACrCC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDC,WAAW,EAAE;IACXC,OAAO,EAAE;EACX,CAAC;EACDC,UAAU,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XC,gBAAgB,EAAE,EAAE;IACpBpC,QAAQ,EAAE;EACZ,CAAC;EACDqC,aAAa,EAAE;IACbnD,UAAU,EAAE,QAAQ;IACpBsC,cAAc,EAAE,QAAQ;IACxBzC,GAAG,EAAE,EAAE;IACPO,eAAe,EAAE;EACnB,CAAC;EACDgD,SAAS,EAAE;IACTtC,QAAQ,EAAE,EAAE;IACZoB,SAAS,EAAE;EACb,CAAC;EACDmB,UAAU,EAAE;IACVvC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBmB,SAAS,EAAE;EACb,CAAC;EACDoB,OAAO,EAAE;IACP7C,OAAO,EAAE,EAAE;IACXN,YAAY,EAAE,EAAE;IAChBoD,eAAe,EAAE/D;EACnB,CAAC;EACD;AACF;AACA;AACA;AACA;EACEgE,cAAc,EAAE;IACd5D,KAAK,EAAE,MAAM;IACbI,UAAU,EAAE;EACd,CAAC;EACD;EACAyD,cAAc,EAAE;IACdjB,SAAS,EAAE,QAAQ;IACnBvB,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared types + per-account color resolution for the auth chooser's views.
|
|
5
|
+
*
|
|
6
|
+
* One responsibility: the vocabulary every view module in this folder speaks
|
|
7
|
+
* (theme/translate aliases, the container-supplied action bundles, and the
|
|
8
|
+
* account accent). No JSX, no state, no I/O — so a view can import it without
|
|
9
|
+
* dragging any other view in.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { APP_COLOR_NAMES, APP_COLOR_PRESETS } from '@oxyhq/bloom/theme';
|
|
13
|
+
|
|
14
|
+
/** The account-row actions the container wires for the switcher + menu views. */
|
|
15
|
+
|
|
16
|
+
/** Used/total storage bytes for the "Oxy storage" block, or `null` when unknown. */
|
|
17
|
+
|
|
18
|
+
/** The account-menu row actions the container wires (deep-links / sheets / sign-out). */
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Where a WebAuthn ceremony can run from the current origin.
|
|
22
|
+
*
|
|
23
|
+
* A credential minted for `oxy.so` can only be ASSERTED there (or a loopback
|
|
24
|
+
* dev host) — a hard, browser-enforced RP-ID boundary, not feature detection.
|
|
25
|
+
* `'direct'` = a first-party Oxy web origin, the ceremony runs here.
|
|
26
|
+
* `'hub'` = any other web origin; it runs in the auth.oxy.so popup instead.
|
|
27
|
+
* `'none'` = native, where Commons owns identity.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Everything that is NOT the sign-in surface's one primary action.
|
|
32
|
+
*
|
|
33
|
+
* The container wires these once; each view decides which of them are genuine
|
|
34
|
+
* alternatives to ITS primary surface and hands those to `TroubleDisclosure`
|
|
35
|
+
* (issue #691: fallbacks stay hidden until the user asks or the primary route
|
|
36
|
+
* fails). A view never renders one of these as a button.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Resolve an account's stored color (a named Bloom preset, e.g. `'purple'`) to
|
|
41
|
+
* a concrete brand hex for the row accent. Falls back to the theme primary when
|
|
42
|
+
* the account has no color or the value is not a recognized preset, so the accent
|
|
43
|
+
* renders in EVERY consumer regardless of NativeWind availability.
|
|
44
|
+
*/
|
|
45
|
+
export function resolveAccentHex(color, fallback) {
|
|
46
|
+
const preset = toPreset(color);
|
|
47
|
+
return preset ? APP_COLOR_PRESETS[preset].hex : fallback;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Narrow a stored color string to a known `AppColorName`, or `undefined`. */
|
|
51
|
+
export function toPreset(color) {
|
|
52
|
+
if (!color) return undefined;
|
|
53
|
+
return APP_COLOR_NAMES.includes(color) ? color : undefined;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["APP_COLOR_NAMES","APP_COLOR_PRESETS","resolveAccentHex","color","fallback","preset","toPreset","hex","undefined","includes"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/types.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,EAAEC,iBAAiB,QAA0C,oBAAoB;;AAMzG;;AAcA;;AAMA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,KAAoB,EAAEC,QAAgB,EAAU;EAC/E,MAAMC,MAAM,GAAGC,QAAQ,CAACH,KAAK,CAAC;EAC9B,OAAOE,MAAM,GAAGJ,iBAAiB,CAACI,MAAM,CAAC,CAACE,GAAG,GAAGH,QAAQ;AAC1D;;AAEA;AACA,OAAO,SAASE,QAAQA,CAACH,KAAoB,EAA4B;EACvE,IAAI,CAACA,KAAK,EAAE,OAAOK,SAAS;EAC5B,OAAQR,eAAe,CAAuBS,QAAQ,CAACN,KAAK,CAAC,GACxDA,KAAK,GACNK,SAAS;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Debounced username-availability check over the existing SDK method.
|
|
5
|
+
*
|
|
6
|
+
* One responsibility: turn keystrokes into an `idle | checking | available |
|
|
7
|
+
* taken` verdict without racing. A sequence guard drops superseded responses,
|
|
8
|
+
* and a NETWORK failure resets the (now stale) verdict and toasts — it never
|
|
9
|
+
* paints an inline error inside the dialog (owner mandate).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useCallback, useRef, useState } from 'react';
|
|
13
|
+
import { toast } from '@oxyhq/bloom';
|
|
14
|
+
/** Keystrokes settle for this long before a check is issued. */
|
|
15
|
+
const DEBOUNCE_MS = 400;
|
|
16
|
+
/** Shorter than this and there is nothing worth asking the server about. */
|
|
17
|
+
const MIN_USERNAME_LENGTH = 3;
|
|
18
|
+
export function useUsernameAvailability(oxyServices, t) {
|
|
19
|
+
const [status, setStatus] = useState('idle');
|
|
20
|
+
const timerRef = useRef(null);
|
|
21
|
+
const requestSeqRef = useRef(0);
|
|
22
|
+
const check = useCallback(value => {
|
|
23
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
24
|
+
const seq = ++requestSeqRef.current;
|
|
25
|
+
if (!value || value.length < MIN_USERNAME_LENGTH) {
|
|
26
|
+
setStatus('idle');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
setStatus('checking');
|
|
30
|
+
timerRef.current = setTimeout(() => {
|
|
31
|
+
void oxyServices.checkUsernameAvailability(value).then(result => {
|
|
32
|
+
if (seq !== requestSeqRef.current) return; // superseded by a newer check
|
|
33
|
+
setStatus(result.available ? 'available' : 'taken');
|
|
34
|
+
}).catch(() => {
|
|
35
|
+
if (seq !== requestSeqRef.current) return;
|
|
36
|
+
setStatus('idle');
|
|
37
|
+
toast.error(t('accounts.create.username.checkFailed'));
|
|
38
|
+
});
|
|
39
|
+
}, DEBOUNCE_MS);
|
|
40
|
+
}, [oxyServices, t]);
|
|
41
|
+
return {
|
|
42
|
+
status,
|
|
43
|
+
check
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=useUsernameAvailability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useRef","useState","toast","DEBOUNCE_MS","MIN_USERNAME_LENGTH","useUsernameAvailability","oxyServices","t","status","setStatus","timerRef","requestSeqRef","check","value","current","clearTimeout","seq","length","setTimeout","checkUsernameAvailability","then","result","available","catch","error"],"sourceRoot":"../../../../../src","sources":["ui/components/authChooser/useUsernameAvailability.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrD,SAASC,KAAK,QAAQ,cAAc;AAMpC;A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