@oxyhq/services 16.0.0 → 18.0.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 +77 -98
- package/lib/commonjs/index.js +40 -51
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -14
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialog.js +742 -0
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/commonjs/ui/components/OxyConsentScreen.js +461 -0
- package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +13 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +180 -22
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +25 -112
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
- package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/commonjs/ui/components/oauthNavigation.js +73 -0
- package/lib/commonjs/ui/components/oauthNavigation.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +122 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +19 -30
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +5 -40
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +0 -2
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +10 -2
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/index.js +19 -16
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +1 -2
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialog.js +739 -0
- package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/module/ui/components/OxyConsentScreen.js +454 -0
- package/lib/module/ui/components/OxyConsentScreen.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +13 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +181 -22
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +26 -112
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/RequireOxyAuth.js +294 -0
- package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/module/ui/components/oauthNavigation.js +70 -0
- package/lib/module/ui/components/oauthNavigation.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +123 -5
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/useAuth.js +19 -30
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +1 -5
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +81 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +0 -2
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +10 -2
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +8 -12
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -4
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +51 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts +45 -0
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +56 -0
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts +36 -0
- package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +27 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +2 -5
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +8 -12
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -4
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +51 -0
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts +45 -0
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +56 -0
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/oauthNavigation.d.ts +36 -0
- package/lib/typescript/module/ui/components/oauthNavigation.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts +27 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +2 -5
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +27 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +33 -27
- package/src/ui/client.ts +0 -4
- package/src/ui/components/OxyAccountDialog.tsx +735 -0
- package/src/ui/components/OxyConsentScreen.tsx +456 -0
- package/src/ui/components/OxyProvider.tsx +14 -6
- package/src/ui/components/OxySignInButton.tsx +227 -22
- package/src/ui/components/ProfileButton.tsx +23 -126
- package/src/ui/components/RequireOxyAuth.tsx +266 -0
- package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +130 -0
- package/src/ui/components/oauthNavigation.ts +89 -0
- package/src/ui/context/OxyContext.tsx +176 -9
- package/src/ui/context/__tests__/OxyContext.coldBoot.test.tsx +165 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
- package/src/ui/hooks/useAuth.ts +19 -31
- package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
- package/src/ui/index.ts +2 -5
- package/src/ui/navigation/accountDialogManager.ts +84 -0
- package/src/ui/navigation/routes.ts +0 -4
- package/src/ui/screens/ManageAccountScreen.tsx +3 -2
- package/src/ui/session/createSessionClient.ts +9 -1
- package/src/ui/types/navigation.ts +27 -0
- package/lib/commonjs/ui/components/AccountMenu.js +0 -598
- package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
- package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
- package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
- package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
- package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
- package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
- package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/commonjs/ui/components/SignInModal.js +0 -600
- package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
- package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/module/ui/components/AccountMenu.js +0 -593
- package/lib/module/ui/components/AccountMenu.js.map +0 -1
- package/lib/module/ui/components/AccountMenuButton.js +0 -130
- package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/module/ui/components/AccountSwitcher.js +0 -774
- package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
- package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/module/ui/components/ProfileMenu.js +0 -514
- package/lib/module/ui/components/ProfileMenu.js.map +0 -1
- package/lib/module/ui/components/SignInAccountChooser.js +0 -183
- package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/module/ui/components/SignInModal.js +0 -591
- package/lib/module/ui/components/SignInModal.js.map +0 -1
- package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
- package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
- package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
- package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/module/utils/deviceFlowSignIn.js +0 -106
- package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/src/ui/components/AccountMenu.tsx +0 -645
- package/src/ui/components/AccountMenuButton.tsx +0 -126
- package/src/ui/components/AccountSwitcher.tsx +0 -751
- package/src/ui/components/AnotherDeviceQR.tsx +0 -119
- package/src/ui/components/ProfileMenu.tsx +0 -564
- package/src/ui/components/SignInAccountChooser.tsx +0 -162
- package/src/ui/components/SignInModal.tsx +0 -530
- package/src/ui/hooks/useOxyAuthSession.ts +0 -635
- package/src/ui/hooks/usePasswordSignIn.ts +0 -207
- package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
- package/src/ui/screens/OxyAuthScreen.tsx +0 -324
- package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
- package/src/utils/deviceFlowSignIn.ts +0 -152
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Imperative bridge for the unified {@link OxyAccountDialog}.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `bottomSheetManager` — a tiny module-level indirection so any caller
|
|
5
|
+
* (even outside React, e.g. an app's imperative "sign in" handler) can open the
|
|
6
|
+
* single account dialog without a ref. `OxyContext` registers the live open/close
|
|
7
|
+
* controls on mount via {@link registerAccountDialogControls} and reports the
|
|
8
|
+
* dialog's visibility here via {@link notifyAccountDialogVisibility}; the exported
|
|
9
|
+
* `openAccountDialog` / `closeAccountDialog` drive those controls.
|
|
10
|
+
*
|
|
11
|
+
* `showSignInModal` / `hideSignInModal` / `subscribeToSignInModal` are the stable
|
|
12
|
+
* public surface the previous `SignInModal` module owned — kept so existing
|
|
13
|
+
* consumers (inbox, accounts) keep working while the sign-in surface is now the
|
|
14
|
+
* unified dialog opened on its `signin` view.
|
|
15
|
+
*/
|
|
16
|
+
import type { AccountDialogView } from '@oxyhq/core';
|
|
17
|
+
/** Live open/close handles registered by the mounted provider. */
|
|
18
|
+
export interface AccountDialogControls {
|
|
19
|
+
open: (view?: AccountDialogView) => void;
|
|
20
|
+
close: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Register the provider's live open/close controls. Returns an unregister
|
|
24
|
+
* function that only clears the slot if it still owns it (guards against a late
|
|
25
|
+
* unmount clobbering a newer provider).
|
|
26
|
+
*/
|
|
27
|
+
export declare function registerAccountDialogControls(next: AccountDialogControls): () => void;
|
|
28
|
+
/** Open the account dialog on `view` (default `accounts`). No-op before mount. */
|
|
29
|
+
export declare function openAccountDialog(view?: AccountDialogView): void;
|
|
30
|
+
/** Close the account dialog. No-op before mount. */
|
|
31
|
+
export declare function closeAccountDialog(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Report the dialog's current visibility so subscribers (e.g. `OxySignInButton`)
|
|
34
|
+
* can reflect an in-flight "Signing in…" state. Called by the provider whenever
|
|
35
|
+
* the open flag changes, so listeners stay accurate regardless of what triggered
|
|
36
|
+
* the change (imperative open, backdrop dismiss, completed sign-in).
|
|
37
|
+
*/
|
|
38
|
+
export declare function notifyAccountDialogVisibility(visible: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Subscribe to dialog visibility changes. Returns an unsubscribe function.
|
|
41
|
+
* Retains the name the old `SignInModal` exposed so `OxySignInButton` keeps its
|
|
42
|
+
* "Signing in…" affordance.
|
|
43
|
+
*/
|
|
44
|
+
export declare function subscribeToSignInModal(listener: (visible: boolean) => void): () => void;
|
|
45
|
+
/** Open the unified dialog on its sign-in view. Public back-compat entry point. */
|
|
46
|
+
export declare function showSignInModal(): void;
|
|
47
|
+
/** Close the unified dialog. Public back-compat entry point. */
|
|
48
|
+
export declare function hideSignInModal(): void;
|
|
49
|
+
//# sourceMappingURL=accountDialogManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accountDialogManager.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/accountDialogManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACzC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAKD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,IAAI,CAOrF;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAEhE;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAIpE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAKvF;AAED,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,gEAAgE;AAChE,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import type { BaseScreenProps } from '../types/navigation';
|
|
3
|
-
export type RouteName = '
|
|
3
|
+
export type RouteName = 'ManageAccount' | 'AccountVerification' | 'PaymentGateway' | 'Profile' | 'LanguageSelector' | 'PrivacySettings' | 'SearchSettings' | 'FileManagement' | 'HelpSupport' | 'FAQ' | 'Feedback' | 'LegalDocuments' | 'AppInfo' | 'PremiumSubscription' | 'WelcomeNewUser' | 'UserLinks' | 'HistoryView' | 'SavesCollections' | 'EditProfile' | 'EditProfileField' | 'LearnMoreUsernames' | 'TrustCenter' | 'TrustLeaderboard' | 'TrustRewards' | 'TrustRules' | 'AboutTrust' | 'TrustFAQ' | 'FollowersList' | 'FollowingList' | 'CreateAccount' | 'AccountMembers' | 'AccountSettings' | 'AvatarCrop' | 'Notifications' | 'ConnectedApps' | 'Preferences';
|
|
4
4
|
export declare const getScreenComponent: (routeName: RouteName) => ComponentType<BaseScreenProps> | undefined;
|
|
5
5
|
export declare const isValidRoute: (routeName: string) => routeName is RouteName;
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAO3D,MAAM,MAAM,SAAS,GACf,
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAO3D,MAAM,MAAM,SAAS,GACf,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,KAAK,GACL,UAAU,GACV,gBAAgB,GAChB,SAAS,GACT,qBAAqB,GACrB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,kBAAkB,GAClB,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,aAAa,CAAC;AAkDpB,eAAO,MAAM,kBAAkB,GAAI,WAAW,SAAS,KAAG,aAAa,CAAC,eAAe,CAAC,GAAG,SAsB1F,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,KAAG,SAAS,IAAI,SAE7D,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;OAUG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,SAAS,CAAC;CACrC;AA+BD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACvB,WAAW,SAAS,GAAG,IAAI,EAC3B,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACrC,gBASF,CAAC"}
|
|
@@ -6,7 +6,7 @@ import type { BaseScreenProps } from '../types/navigation';
|
|
|
6
6
|
* Replaces AccountOverview + AccountSettings + the per-account half of
|
|
7
7
|
* SessionManagement. Lists ONLY the active user's profile, sessions on this
|
|
8
8
|
* device, and security/destructive actions for THIS account. Multi-account
|
|
9
|
-
* surface lives in
|
|
9
|
+
* surface lives in the unified `OxyAccountDialog` — keep these concerns separate.
|
|
10
10
|
*/
|
|
11
11
|
declare const ManageAccountScreen: React.FC<BaseScreenProps>;
|
|
12
12
|
export default ManageAccountScreen;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ManageAccountScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAoD3D;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"ManageAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ManageAccountScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAoD3D;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA45BlD,CAAC;AA+BF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SessionClient, createSessionClientHost, type AuthStateStore, type OxyServices } from '@oxyhq/core';
|
|
1
|
+
import { SessionClient, createSessionClientHost, type AuthStateStore, type OxyServices, type SessionClientOptions } from '@oxyhq/core';
|
|
2
2
|
/**
|
|
3
3
|
* Wire a `SessionClient` for `@oxyhq/services`.
|
|
4
4
|
*
|
|
@@ -19,7 +19,14 @@ import { SessionClient, createSessionClientHost, type AuthStateStore, type OxySe
|
|
|
19
19
|
* alongside the client so the caller can call `host.setCurrentAccountId(...)`
|
|
20
20
|
* as the active account changes.
|
|
21
21
|
*/
|
|
22
|
-
export declare function createSessionClient(oxyServices: OxyServices, store: AuthStateStore, onUnauthenticated?: () => void
|
|
22
|
+
export declare function createSessionClient(oxyServices: OxyServices, store: AuthStateStore, onUnauthenticated?: () => void,
|
|
23
|
+
/**
|
|
24
|
+
* Optional signed-out realtime wiring: `signedOutSocketAuth` (open the socket
|
|
25
|
+
* while signed out — web returns `true` to ride the `oxy_device` cookie,
|
|
26
|
+
* native returns the shared device token) and `onSessionAppeared` (self-acquire
|
|
27
|
+
* when a sibling signs in on this device).
|
|
28
|
+
*/
|
|
29
|
+
extra?: Pick<SessionClientOptions, 'signedOutSocketAuth' | 'onSessionAppeared'>): {
|
|
23
30
|
client: SessionClient;
|
|
24
31
|
host: ReturnType<typeof createSessionClientHost>;
|
|
25
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSessionClient.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/createSessionClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"createSessionClient.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/createSessionClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,cAAc,EACrB,iBAAiB,CAAC,EAAE,MAAM,IAAI;AAC9B;;;;;GAKG;AACH,KAAK,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,qBAAqB,GAAG,mBAAmB,CAAC,GAC9E;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;CAClD,CAKA"}
|
|
@@ -42,5 +42,32 @@ export interface OxyProviderProps {
|
|
|
42
42
|
authWebUrl?: string;
|
|
43
43
|
authRedirectUri?: string;
|
|
44
44
|
queryClient?: QueryClient;
|
|
45
|
+
/**
|
|
46
|
+
* Convenience: wrap the whole app subtree in `<RequireOxyAuth prompt=...>`.
|
|
47
|
+
* `off` (default) renders children unconditionally; `soft` adds a dismissible
|
|
48
|
+
* sign-in banner while signed out; `hard` blocks the app behind the signed-out
|
|
49
|
+
* wall until the user signs in. For finer control, mount `RequireOxyAuth`
|
|
50
|
+
* yourself around a specific subtree instead.
|
|
51
|
+
* @default 'off'
|
|
52
|
+
*/
|
|
53
|
+
requireAuth?: 'off' | 'soft' | 'hard';
|
|
54
|
+
/**
|
|
55
|
+
* Whether this provider acts as the ecosystem's device-first **session
|
|
56
|
+
* authority**. `true` (default) runs the full device-first cold boot on
|
|
57
|
+
* mount (bootstrap-return → stored tokens → shared key / bootstrap hop) and
|
|
58
|
+
* opens the signed-out device-state socket so an idle tab self-acquires when
|
|
59
|
+
* a sibling signs in — the correct behavior for every Relying Party app.
|
|
60
|
+
*
|
|
61
|
+
* Set `false` for the **IdP host** (`auth.oxy.so`): the IdP is NOT a session
|
|
62
|
+
* authority (see the handoff "IdP vs RP" section). With `coldBoot={false}`
|
|
63
|
+
* the provider skips `runSessionColdBoot` entirely and never opens the
|
|
64
|
+
* signed-out device socket — auth resolves immediately as signed out (no
|
|
65
|
+
* boot spinner). Interactive sign-in is unaffected: a user who signs in
|
|
66
|
+
* through this provider (password, 2FA, or the "Sign in with Oxy" QR device
|
|
67
|
+
* flow) still commits a normal session scoped to this origin, which is all
|
|
68
|
+
* the IdP needs to drive its OAuth authorize/consent flow.
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
coldBoot?: boolean;
|
|
45
72
|
}
|
|
46
73
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAE5B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACxE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAG9C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAGlC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAGjE,aAAa,CAAC,EAAE,SAAS,CAAC;IAG1B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAA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AAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -51,35 +51,31 @@ export { useFileFiltering } from './ui/hooks/useFileFiltering.js';
|
|
|
51
51
|
export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering.js';
|
|
52
52
|
export { default as Avatar } from './ui/components/Avatar.js';
|
|
53
53
|
export type { AvatarProps } from './ui/components/Avatar.js';
|
|
54
|
-
export { OxySignInButton } from './ui/components/OxySignInButton.js';
|
|
54
|
+
export { OxySignInButton, OXY_OAUTH_STATE_STORAGE_KEY, OXY_OAUTH_CODE_VERIFIER_STORAGE_KEY, } from './ui/components/OxySignInButton.js';
|
|
55
|
+
export type { OxySignInButtonProps, OxyOAuthResult } from './ui/components/OxySignInButton.js';
|
|
55
56
|
export { OxyAuthPrompt } from './ui/components/OxyAuthPrompt.js';
|
|
56
57
|
export type { OxyAuthPromptProps } from './ui/components/OxyAuthPrompt.js';
|
|
57
58
|
export { default as OxyLogo } from './ui/components/OxyLogo.js';
|
|
59
|
+
export { OxyConsentScreen } from './ui/components/OxyConsentScreen.js';
|
|
60
|
+
export type { OxyConsentScreenProps, OxyConsentApplication, OxyConsentUser, } from './ui/components/OxyConsentScreen.js';
|
|
61
|
+
export { RequireOxyAuth } from './ui/components/RequireOxyAuth.js';
|
|
62
|
+
export type { RequireOxyAuthProps, RequireOxyAuthPrompt } from './ui/components/RequireOxyAuth.js';
|
|
58
63
|
export { default as FollowButton } from './ui/components/FollowButton.js';
|
|
59
64
|
export type { FollowButtonProps, SingleFollowButtonProps, MultiFollowButtonProps } from './ui/components/FollowButton.js';
|
|
60
65
|
export { LogoIcon } from './ui/components/logo/LogoIcon.js';
|
|
61
66
|
export { LogoText } from './ui/components/logo/LogoText.js';
|
|
62
|
-
export { default as AccountMenu } from './ui/components/AccountMenu.js';
|
|
63
|
-
export type { AccountMenuProps, AccountMenuAnchor } from './ui/components/AccountMenu.js';
|
|
64
|
-
export { default as AccountMenuButton } from './ui/components/AccountMenuButton.js';
|
|
65
|
-
export type { AccountMenuButtonProps } from './ui/components/AccountMenuButton.js';
|
|
66
67
|
export { default as ProfileButton } from './ui/components/ProfileButton.js';
|
|
67
68
|
export type { ProfileButtonProps } from './ui/components/ProfileButton.js';
|
|
68
|
-
export { default as ProfileMenu } from './ui/components/ProfileMenu.js';
|
|
69
|
-
export type { ProfileMenuProps, ProfileMenuAnchor } from './ui/components/ProfileMenu.js';
|
|
70
|
-
export { default as AccountSwitcher, AccountSwitcherView } from './ui/components/AccountSwitcher.js';
|
|
71
|
-
export type { AccountSwitcherProps, AccountSwitcherActions } from './ui/components/AccountSwitcher.js';
|
|
72
69
|
export { useSwitchableAccounts } from './ui/hooks/useSwitchableAccounts.js';
|
|
73
|
-
export type {
|
|
70
|
+
export type { UseSwitchableAccountsResult } from './ui/hooks/useSwitchableAccounts.js';
|
|
74
71
|
export { default as ManageAccountScreen } from './ui/screens/ManageAccountScreen.js';
|
|
75
72
|
export { default as NotificationsScreen } from './ui/screens/NotificationsScreen.js';
|
|
76
73
|
export { default as PreferencesScreen } from './ui/screens/PreferencesScreen.js';
|
|
77
74
|
export { default as ConnectedAppsScreen } from './ui/screens/ConnectedAppsScreen.js';
|
|
78
|
-
export { default as AccountSwitcherScreen } from './ui/screens/AccountSwitcherScreen.js';
|
|
79
75
|
export { default as CreateAccountScreen } from './ui/screens/CreateAccountScreen.js';
|
|
80
76
|
export { default as AccountMembersScreen } from './ui/screens/AccountMembersScreen.js';
|
|
81
77
|
export { default as AccountSettingsScreen } from './ui/screens/AccountSettingsScreen.js';
|
|
82
78
|
export { showBottomSheet, closeBottomSheet } from './ui/navigation/bottomSheetManager.js';
|
|
83
79
|
export type { RouteName } from './ui/navigation/routes.js';
|
|
84
|
-
export { showSignInModal, hideSignInModal } from './ui/
|
|
80
|
+
export { showSignInModal, hideSignInModal } from './ui/navigation/accountDialogManager.js';
|
|
85
81
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAYH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gCAA6B,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAAyB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,4BAAyB,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAoB,CAAC;AAC7C,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAoB,CAAC;AAKhF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA4B,CAAC;AAKxD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAAuB,CAAC;AACrD,OAAO,EACH,aAAa,EACb,SAAS,IAAI,cAAc,EAC3B,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACnB,MAAM,2BAAwB,CAAC;AAKhC,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,yBAAsB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAA+B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yBAAsB,CAAC;AAKpE,OAAO,EACH,cAAc,EACd,eAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACnB,MAAM,yCAAsC,CAAC;AAC9C,OAAO,EACH,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,sBAAsB,GACzB,MAAM,0CAAuC,CAAC;AAC/C,OAAO,EACH,mBAAmB,EACnB,yBA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OAAO,EAAE,QAAQ,EAAE,MAAM,kCAA+B,CAAC;AAKzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kCAA+B,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kCAA+B,CAAC;AAQxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAkC,CAAC;AACzE,YAAY,EAAE,2BAA2B,EAAE,MAAM,qCAAkC,CAAC;AAGpF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qCAAkC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qCAAkC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qCAAkC,CAAC;AAGlF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,qCAAkC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,sCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,uCAAoC,CAAC;AAKtF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uCAAoC,CAAC;AACvF,YAAY,EAAE,SAAS,EAAE,MAAM,2BAAwB,CAAC;AAQxD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yCAAsC,CAAC"}
|
|
@@ -17,10 +17,6 @@ export { default as FollowButton } from './components/FollowButton.js';
|
|
|
17
17
|
export { default as OxyPayButton } from './components/OxyPayButton.js';
|
|
18
18
|
export { FontLoader, setupFonts } from './components/FontLoader.js';
|
|
19
19
|
export { default as OxyIcon } from './components/icon/OxyIcon.js';
|
|
20
|
-
export { default as AccountMenu } from './components/AccountMenu.js';
|
|
21
|
-
export type { AccountMenuProps } from './components/AccountMenu.js';
|
|
22
|
-
export { default as AccountMenuButton } from './components/AccountMenuButton.js';
|
|
23
|
-
export type { AccountMenuButtonProps } from './components/AccountMenuButton.js';
|
|
24
20
|
export { useOxy } from './context/OxyContext.js';
|
|
25
21
|
export { useAuth } from './hooks/useAuth.js';
|
|
26
22
|
export type { AuthState, AuthActions, UseAuthReturn } from './hooks/useAuth.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/ui/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,6BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iCAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA4B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA4B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,8BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,8BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAAyB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,8BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/ui/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,6BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iCAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA4B,CAAC;AACtE,YAAY,EAAE,kBAA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|
|
3
|
+
*
|
|
4
|
+
* A thin React Native binding over the headless `AccountDialogController` in
|
|
5
|
+
* `@oxyhq/core` (bound via `useSyncExternalStore`), presented as a bottom-sheet
|
|
6
|
+
* modal. It REPLACES the five drifting device/account surfaces the SDK shipped
|
|
7
|
+
* before (`ProfileMenu`, `AccountMenu`, `AccountSwitcher`, `SignInAccountChooser`,
|
|
8
|
+
* and `SignInModal`) with a single implementation whose data + state machine live
|
|
9
|
+
* in core, so the RN and web (auth-sdk) bindings render the SAME list from the
|
|
10
|
+
* SAME logic and cannot diverge.
|
|
11
|
+
*
|
|
12
|
+
* Views (from `snapshot.view`):
|
|
13
|
+
* - `accounts` — the unified `SwitchableAccount[]` list (device sign-ins ∪ graph
|
|
14
|
+
* accounts). Tapping a row switches through `controller.switchTo(accountId)`
|
|
15
|
+
* (the uniform switch), the active row is flagged, and a "+ Add account" row
|
|
16
|
+
* opens the sign-in entry. This is what `ProfileButton` opens.
|
|
17
|
+
* - `add` / `signin` — the sign-in entry: primary "Sign in with Oxy" (device
|
|
18
|
+
* flow), "Scan a QR", and a secondary "Use a password" hand-off that opens
|
|
19
|
+
* auth.oxy.so (password + 2FA are NOT in the SDK).
|
|
20
|
+
* - `qr` — the cross-device QR handoff + its waiting state.
|
|
21
|
+
*
|
|
22
|
+
* Per-account color re-theming uses Bloom's `APP_COLOR_PRESETS` + `BloomColorScope`
|
|
23
|
+
* (same visual language auth.oxy.so uses). Base theming is `useTheme()` + a
|
|
24
|
+
* `StyleSheet`, so the dialog renders correctly in EVERY consumer — including apps
|
|
25
|
+
* that do not use NativeWind (e.g. the accounts app).
|
|
26
|
+
*
|
|
27
|
+
* The surface is Bloom's `<Dialog>` (`@oxyhq/bloom/dialog`) with a responsive
|
|
28
|
+
* `placement` — a bottom sheet on narrow viewports, a centered card on wide ones.
|
|
29
|
+
* It REPLACES the hand-rolled RN `<Modal>` + `<GestureHandlerRootView>` + manual
|
|
30
|
+
* backdrop/card wrapper this component used before. That RN `<Modal>` is invisible
|
|
31
|
+
* under React StrictMode on web: react-native-web's `ModalPortal` appends its host
|
|
32
|
+
* node during render but removes it in an effect cleanup and never re-attaches, so
|
|
33
|
+
* the dialog never paints in a dev Vite build. Bloom's `<Dialog>` renders through
|
|
34
|
+
* its own Portal and has no such lifecycle hazard.
|
|
35
|
+
*
|
|
36
|
+
* Open/close is CONTROLLED by `isAccountDialogOpen` (the `open` prop); the Dialog
|
|
37
|
+
* stays mounted whenever the controller exists so it can animate its own close.
|
|
38
|
+
* Backdrop / swipe-to-dismiss is disabled (`dismissOnBackdrop={false}`) on purpose:
|
|
39
|
+
* Bloom's controlled `bottom` placement does not fire `onClose` on a gesture or
|
|
40
|
+
* backdrop dismissal, so allowing it would desync `isAccountDialogOpen` from the
|
|
41
|
+
* sheet and block reopening. The header close button (and a successful switch)
|
|
42
|
+
* drive `closeAccountDialog`, which flips `open` and runs the exit animation.
|
|
43
|
+
*/
|
|
44
|
+
import type React from 'react';
|
|
45
|
+
/**
|
|
46
|
+
* The unified account dialog. Mounted once by `OxyProvider`; opened imperatively
|
|
47
|
+
* via `useOxy().openAccountDialog(view?)` (or the back-compat `showSignInModal`).
|
|
48
|
+
*/
|
|
49
|
+
declare const OxyAccountDialog: React.FC;
|
|
50
|
+
export default OxyAccountDialog;
|
|
51
|
+
//# sourceMappingURL=OxyAccountDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OxyAccountDialog.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyAccountDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiE/B;;;GAGG;AACH,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EA+H7B,CAAC;AA8eF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** The requesting application, resolved by the caller (never user-supplied raw). */
|
|
2
|
+
export interface OxyConsentApplication {
|
|
3
|
+
/** Display name of the requesting application. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Application icon — a URL or bare file id passed straight to `<Avatar source>`. */
|
|
6
|
+
iconUrl?: string;
|
|
7
|
+
/** Public website of the application, shown as a link when present. */
|
|
8
|
+
websiteUrl?: string;
|
|
9
|
+
/** Privacy policy URL, shown as a link when present. */
|
|
10
|
+
privacyPolicyUrl?: string;
|
|
11
|
+
/** Terms of service URL, shown as a link when present. */
|
|
12
|
+
termsUrl?: string;
|
|
13
|
+
/** Human-readable publisher, used for the "Published by …" provenance line. */
|
|
14
|
+
developerName?: string;
|
|
15
|
+
/** True for first-party / official Oxy applications. */
|
|
16
|
+
isOfficial?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** The account that will authorize the request (the currently signed-in user). */
|
|
19
|
+
export interface OxyConsentUser {
|
|
20
|
+
/** Real display name, when the profile has one. */
|
|
21
|
+
displayName?: string;
|
|
22
|
+
/** Normalized handle — the sanctioned fallback when `displayName` is absent. */
|
|
23
|
+
handle?: string;
|
|
24
|
+
/** Avatar — a URL or bare file id passed straight to `<Avatar source>`. */
|
|
25
|
+
avatarUri?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface OxyConsentScreenProps {
|
|
28
|
+
/** The resolved requesting application. */
|
|
29
|
+
application: OxyConsentApplication;
|
|
30
|
+
/** OAuth scopes requested by the client (mapped to friendly labels). */
|
|
31
|
+
scopes: string[];
|
|
32
|
+
/** The account that will authorize the request, when known. */
|
|
33
|
+
user?: OxyConsentUser;
|
|
34
|
+
/** Approve handler — the caller mints the code / completes the flow. */
|
|
35
|
+
onAllow: () => void | Promise<void>;
|
|
36
|
+
/** Deny handler — the caller cancels the flow. */
|
|
37
|
+
onDeny: () => void;
|
|
38
|
+
/** True while a decision is in flight; disables both actions and spins Allow. */
|
|
39
|
+
busy?: boolean;
|
|
40
|
+
/** A blocking error message for the request, when present. */
|
|
41
|
+
error?: string | null;
|
|
42
|
+
}
|
|
43
|
+
export declare function OxyConsentScreen({ application, scopes, user, onAllow, onDeny, busy, error, }: OxyConsentScreenProps): import("react").JSX.Element;
|
|
44
|
+
export default OxyConsentScreen;
|
|
45
|
+
//# sourceMappingURL=OxyConsentScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OxyConsentScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyConsentScreen.tsx"],"names":[],"mappings":"AA8BA,oFAAoF;AACpF,MAAM,WAAW,qBAAqB;IACpC,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,WAAW,EAAE,qBAAqB,CAAC;IACnC,wEAAwE;IACxE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,wEAAwE;IACxE,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,kDAAkD;IAClD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAmED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,MAAM,EACN,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAY,EACZ,KAAY,GACb,EAAE,qBAAqB,+BA+KvB;AAoID,eAAe,gBAAgB,CAAC"}
|
|
@@ -5,8 +5,8 @@ import type { OxyProviderProps } from '../types/navigation.js';
|
|
|
5
5
|
*
|
|
6
6
|
* Provides authentication, session management, query client, and UI overlays.
|
|
7
7
|
* Wraps its own overlay stack in SafeAreaProvider and GestureHandlerRootView so
|
|
8
|
-
* BottomSheetRouter and
|
|
9
|
-
* has not mounted those providers yet.
|
|
8
|
+
* BottomSheetRouter and OxyAccountDialog can safely render even when a consuming
|
|
9
|
+
* app has not mounted those providers yet.
|
|
10
10
|
*
|
|
11
11
|
* Usage:
|
|
12
12
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAIjH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"OxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAIjH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAqB,CAAC;AAqE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAyOrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type ViewStyle, type TextStyle, type StyleProp } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* `sessionStorage` keys under which a third-party "Sign in with Oxy" OAuth flow
|
|
5
|
+
* persists its CSRF `state` and PKCE `code_verifier` across the authorize
|
|
6
|
+
* redirect. The Relying Party's redirect-URI callback reads them back to
|
|
7
|
+
* validate the returned `state` and replay the verifier on the token exchange.
|
|
8
|
+
*
|
|
9
|
+
* Web only: a browser RP navigates away to `auth.oxy.so` and back, so the
|
|
10
|
+
* handshake must survive a full-page redirect. Native completes the flow inside
|
|
11
|
+
* a single `WebBrowser` auth session and surfaces the handshake via
|
|
12
|
+
* {@link OxySignInButtonProps.onOAuthResult} instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare const OXY_OAUTH_STATE_STORAGE_KEY = "oxy_oauth_state";
|
|
15
|
+
export declare const OXY_OAUTH_CODE_VERIFIER_STORAGE_KEY = "oxy_oauth_code_verifier";
|
|
16
|
+
/**
|
|
17
|
+
* The OAuth handshake surfaced to a NATIVE third-party RP via
|
|
18
|
+
* {@link OxySignInButtonProps.onOAuthResult} so it can finish the code exchange
|
|
19
|
+
* (`POST /auth/oauth/token`). Web RPs read the same `state` / `code_verifier`
|
|
20
|
+
* back from `sessionStorage` across the redirect and do not need this callback.
|
|
21
|
+
*/
|
|
22
|
+
export interface OxyOAuthResult {
|
|
23
|
+
/** Deep-link URL the native auth session returned to (`?code=…&state=…`), or `null` if unobserved. */
|
|
24
|
+
redirectUrl: string | null;
|
|
25
|
+
/** The CSRF `state` sent on the authorize request; the RP must match it on return. */
|
|
26
|
+
state: string;
|
|
27
|
+
/** The PKCE `code_verifier` to replay on the token exchange. */
|
|
28
|
+
codeVerifier: string;
|
|
29
|
+
}
|
|
3
30
|
export interface OxySignInButtonProps {
|
|
4
31
|
/**
|
|
5
32
|
* Controls the appearance of the button
|
|
@@ -34,6 +61,35 @@ export interface OxySignInButtonProps {
|
|
|
34
61
|
* @default false
|
|
35
62
|
*/
|
|
36
63
|
showWhenAuthenticated?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Exact registered redirect URI the OAuth authorization code is returned to.
|
|
66
|
+
* REQUIRED only for third-party (`type: 'third_party'`) applications, which
|
|
67
|
+
* sign in via an OAuth + PKCE redirect to `auth.oxy.so`. First-party /
|
|
68
|
+
* official apps open the in-app dialog and ignore this prop. If a third-party
|
|
69
|
+
* app resolves without it, the button logs an error and does nothing (it will
|
|
70
|
+
* not invent a redirect URI).
|
|
71
|
+
*/
|
|
72
|
+
oauthRedirectUri?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Native only: receives the OAuth handshake after a third-party auth session
|
|
75
|
+
* so the RP can finish the token exchange. On web the handshake is read back
|
|
76
|
+
* from `sessionStorage` across the full-page redirect, so this is not used
|
|
77
|
+
* there. A native third-party sign-in with NO `onOAuthResult` handler cannot
|
|
78
|
+
* complete (the `state` + `code_verifier` are lost) and logs a warning.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* <OxySignInButton
|
|
83
|
+
* oauthRedirectUri="myapp://oauth/callback"
|
|
84
|
+
* onOAuthResult={({ redirectUrl, state, codeVerifier }) => {
|
|
85
|
+
* if (!redirectUrl) return;
|
|
86
|
+
* const code = new URL(redirectUrl).searchParams.get('code');
|
|
87
|
+
* // → POST /auth/oauth/token { code, code_verifier: codeVerifier, state }
|
|
88
|
+
* }}
|
|
89
|
+
* />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
onOAuthResult?: (result: OxyOAuthResult) => void;
|
|
37
93
|
}
|
|
38
94
|
/**
|
|
39
95
|
* A pre-styled button component for signing in with Oxy identity
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxySignInButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxySignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO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CAAC;CACpD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0Q1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -11,23 +11,15 @@ export interface ProfileButtonProps {
|
|
|
11
11
|
*/
|
|
12
12
|
avatarSize?: number;
|
|
13
13
|
/** Navigate to the "Manage account" surface (settings). */
|
|
14
|
-
onNavigateManage
|
|
14
|
+
onNavigateManage?: () => void;
|
|
15
15
|
/** Start the add-account / sign-in flow for an additional account. */
|
|
16
|
-
onAddAccount
|
|
16
|
+
onAddAccount?: () => void;
|
|
17
17
|
/** Optional: navigate to the signed-in user's own profile. */
|
|
18
18
|
onNavigateProfile?: () => void;
|
|
19
|
-
/** Called before the active identity changes so apps can clear scoped state. */
|
|
20
|
-
onBeforeSessionChange?: () => void | Promise<void>;
|
|
21
19
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* behavior.
|
|
26
|
-
* - `'down'`: the menu opens DOWNWARD, for a trigger placed at the TOP of a
|
|
27
|
-
* sidebar (the accounts app pattern).
|
|
28
|
-
* - `'auto'`: opens downward when there is more room below the trigger than
|
|
29
|
-
* above, otherwise upward.
|
|
30
|
-
* Native (bottom-sheet) is unaffected — this only influences the web popover.
|
|
20
|
+
* Retained for source compatibility. The trigger now opens the unified
|
|
21
|
+
* `OxyAccountDialog` (a centered / bottom-sheet modal) rather than an
|
|
22
|
+
* anchored popover, so popover placement no longer applies.
|
|
31
23
|
*/
|
|
32
24
|
placement?: 'up' | 'down' | 'auto';
|
|
33
25
|
/**
|
|
@@ -41,27 +33,23 @@ export interface ProfileButtonProps {
|
|
|
41
33
|
}
|
|
42
34
|
/**
|
|
43
35
|
* Self-contained sidebar account trigger, modeled on Bluesky's ProfileCard and
|
|
44
|
-
* the Oxy inbox's `MailboxDrawer` footer.
|
|
45
|
-
*
|
|
36
|
+
* the Oxy inbox's `MailboxDrawer` footer. Pressing it opens the unified
|
|
37
|
+
* {@link OxyAccountDialog} — the single account switcher + sign-in surface — via
|
|
38
|
+
* `useOxy().openAccountDialog`.
|
|
46
39
|
*
|
|
47
40
|
* Three auth states from {@link useAuth}:
|
|
48
41
|
* - **Undetermined** (`!isAuthResolved || isPrivateApiPending`): a neutral
|
|
49
42
|
* avatar-sized skeleton circle, no press.
|
|
50
43
|
* - **Signed in**: a pressable row — Bloom `Avatar` + display name + `@handle`
|
|
51
|
-
* +
|
|
52
|
-
*
|
|
53
|
-
*
|
|
44
|
+
* + a chevron. Press opens the dialog on its `accounts` view.
|
|
45
|
+
* - **Signed out**: a "Sign in" row that calls `useAuth().signIn()` (which opens
|
|
46
|
+
* the dialog on its `signin` view).
|
|
54
47
|
*
|
|
55
48
|
* Styling uses react-native `StyleSheet` + the Bloom theme (via `useTheme`) so
|
|
56
49
|
* the layout renders identically in EVERY consumer — including apps that do not
|
|
57
50
|
* use NativeWind (e.g. the accounts app). Only the web hover animation keeps
|
|
58
51
|
* dynamic inline `style` (the CSS transition/transform values), which is what
|
|
59
52
|
* the `react-native-web-style.d.ts` augmentation exists for.
|
|
60
|
-
*
|
|
61
|
-
* All display strings resolve through `@oxyhq/core`'s
|
|
62
|
-
* `getAccountDisplayName` / `getAccountFallbackHandle` — no hand-rolled name
|
|
63
|
-
* fallbacks. Avatars pass the bare file id as `source` + `variant="thumb"`, so
|
|
64
|
-
* the app's registered `ImageResolver` builds the thumbnail URL.
|
|
65
53
|
*/
|
|
66
54
|
declare const ProfileButton: React.FC<ProfileButtonProps>;
|
|
67
55
|
export default ProfileButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAKH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAKH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAuCtB,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoP/C,CAAC;AAqDF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequireOxyAuth — the optional signed-out gate primitive (React Native).
|
|
3
|
+
*
|
|
4
|
+
* ONE shared way for any Oxy app to opt into a signed-out gate. It is entirely
|
|
5
|
+
* OPTIONAL: a public app renders its children untouched (`prompt="off"`); an
|
|
6
|
+
* auth-required app blocks them behind a signed-out state (`prompt="hard"`); an
|
|
7
|
+
* app that mostly works signed-out but wants a nudge shows a dismissible banner
|
|
8
|
+
* (`prompt="soft"`). Every mode reuses the ONE account dialog the provider
|
|
9
|
+
* already mounts — opening the sign-in surface is always
|
|
10
|
+
* `useOxy().openAccountDialog('signin')`; there is NO second dialog.
|
|
11
|
+
*
|
|
12
|
+
* Readiness gating (CRITICAL): the gate keys on the SDK's own readiness state
|
|
13
|
+
* (`useOxy().canUsePrivateApi` / `isPrivateApiPending`), NEVER on app-local
|
|
14
|
+
* hooks. While auth is still resolving (`isPrivateApiPending`) it renders a
|
|
15
|
+
* neutral loading state so the signed-out wall never flashes before the
|
|
16
|
+
* device-first cold boot concludes (the documented cold-boot race).
|
|
17
|
+
*
|
|
18
|
+
* Styling follows the sibling `OxyAccountDialog`/`OxySignInButton` pattern —
|
|
19
|
+
* `useTheme()` + `StyleSheet` (NOT NativeWind), so the gate renders correctly in
|
|
20
|
+
* EVERY consumer, including apps that do not run NativeWind (e.g. the accounts
|
|
21
|
+
* app).
|
|
22
|
+
*/
|
|
23
|
+
import type React from 'react';
|
|
24
|
+
import { type ReactNode } from 'react';
|
|
25
|
+
/**
|
|
26
|
+
* How `RequireOxyAuth` treats a signed-out (or still-resolving) session.
|
|
27
|
+
* - `off` — always render children (public app; a no-op provided for symmetry).
|
|
28
|
+
* - `soft` — render children, plus a dismissible sign-in banner when signed out.
|
|
29
|
+
* - `hard` — block children behind a centered signed-out state until signed in.
|
|
30
|
+
*/
|
|
31
|
+
export type RequireOxyAuthPrompt = 'off' | 'soft' | 'hard';
|
|
32
|
+
export interface RequireOxyAuthProps {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
/** Gate behavior. @default 'hard' */
|
|
35
|
+
prompt?: RequireOxyAuthPrompt;
|
|
36
|
+
/** Replaces the neutral loading UI shown while auth is still resolving. */
|
|
37
|
+
loadingFallback?: ReactNode;
|
|
38
|
+
/** Replaces the entire default signed-out wall (`prompt="hard"`). */
|
|
39
|
+
signedOutFallback?: ReactNode;
|
|
40
|
+
/** Title for the default `prompt="hard"` wall. */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** Subtitle for the default `prompt="hard"` wall. */
|
|
43
|
+
subtitle?: string;
|
|
44
|
+
/** Message for the `prompt="soft"` banner. */
|
|
45
|
+
bannerMessage?: string;
|
|
46
|
+
/** CTA label for the `prompt="soft"` banner. */
|
|
47
|
+
bannerActionLabel?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Optional signed-out gate. Wrap any subtree (or the whole app via the
|
|
51
|
+
* provider's `requireAuth` prop) to opt into a shared, readiness-safe wall.
|
|
52
|
+
*/
|
|
53
|
+
export declare const RequireOxyAuth: React.FC<RequireOxyAuthProps>;
|
|
54
|
+
export default RequireOxyAuth;
|
|
55
|
+
//# sourceMappingURL=RequireOxyAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequireOxyAuth.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/RequireOxyAuth.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQjD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAOD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4CxD,CAAC;AA0JF,eAAe,cAAc,CAAC"}
|