@oxyhq/services 16.0.0 → 17.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/lib/commonjs/index.js +21 -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 +764 -0
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +11 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +10 -21
- 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/context/OxyContext.js +106 -2
- 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 +18 -15
- 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 +761 -0
- package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +11 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +10 -21
- 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/context/OxyContext.js +107 -3
- 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 +4 -11
- 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 +35 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.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.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/context/OxyContext.d.ts +13 -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/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 +9 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -11
- 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 +35 -0
- package/lib/typescript/module/ui/components/OxyAccountDialog.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.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/context/OxyContext.d.ts +13 -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/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 +9 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +21 -26
- package/src/ui/client.ts +0 -4
- package/src/ui/components/OxyAccountDialog.tsx +760 -0
- package/src/ui/components/OxyProvider.tsx +12 -6
- package/src/ui/components/OxySignInButton.tsx +10 -21
- package/src/ui/components/ProfileButton.tsx +23 -126
- package/src/ui/components/RequireOxyAuth.tsx +266 -0
- package/src/ui/context/OxyContext.tsx +146 -7
- 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 +9 -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
|
@@ -99,7 +99,7 @@ export const useUpdateProfile = () => {
|
|
|
99
99
|
refreshAvatarInStore(activeSessionId, updates.avatar, oxyServices);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
// Invalidate all related queries so every consumer (
|
|
102
|
+
// Invalidate all related queries so every consumer (the account dialog,
|
|
103
103
|
// session lists, managed accounts, etc.) refetches the fresh profile.
|
|
104
104
|
// This is critical right after `username` is set the first time, when
|
|
105
105
|
// every cached "session profile" still reports the user as unnamed.
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
import { useCallback } from 'react';
|
|
29
29
|
import { useOxy } from "../context/OxyContext.js";
|
|
30
30
|
import { isWebBrowser } from "../utils/isWebBrowser.js";
|
|
31
|
-
import { showSignInModal } from "../components/SignInModal.js";
|
|
32
31
|
/**
|
|
33
32
|
* Unified auth hook for all Oxy apps
|
|
34
33
|
*
|
|
@@ -57,43 +56,33 @@ export function useAuth() {
|
|
|
57
56
|
hasIdentity,
|
|
58
57
|
getPublicKey,
|
|
59
58
|
showBottomSheet,
|
|
60
|
-
openAvatarPicker
|
|
59
|
+
openAvatarPicker,
|
|
60
|
+
openAccountDialog
|
|
61
61
|
} = useOxy();
|
|
62
62
|
const signIn = useCallback(async publicKey => {
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
// already restored a session if one existed; an explicit click presents the
|
|
66
|
-
// SDK sign-in surface (password / QR device flow / add account).
|
|
67
|
-
if (isWebBrowser() && !publicKey) {
|
|
68
|
-
showSignInModal();
|
|
69
|
-
// Resolves when the modal commits a session; the caller typically reacts
|
|
70
|
-
// to `isAuthenticated` rather than this promise.
|
|
71
|
-
return new Promise(() => undefined);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Native: use the cryptographic identity directly when a public key is given.
|
|
63
|
+
// Native: sign in directly with the cryptographic identity when a public key
|
|
64
|
+
// is provided, or an existing keychain identity is found.
|
|
75
65
|
if (publicKey) {
|
|
76
66
|
return oxySignIn(publicKey);
|
|
77
67
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
68
|
+
if (!isWebBrowser()) {
|
|
69
|
+
const hasExisting = await hasIdentity();
|
|
70
|
+
if (hasExisting) {
|
|
71
|
+
const existingKey = await getPublicKey();
|
|
72
|
+
if (existingKey) {
|
|
73
|
+
return oxySignIn(existingKey);
|
|
74
|
+
}
|
|
85
75
|
}
|
|
86
76
|
}
|
|
87
77
|
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}, [oxySignIn, hasIdentity, getPublicKey, showBottomSheet]);
|
|
78
|
+
// Web, or native without a keychain identity: open the unified account dialog
|
|
79
|
+
// on its sign-in view (device flow / QR / password hand-off). There is NO
|
|
80
|
+
// automatic navigation to a login page — the device-first cold boot already
|
|
81
|
+
// restored a session if one existed. The caller reacts to `isAuthenticated`,
|
|
82
|
+
// so this promise intentionally never resolves.
|
|
83
|
+
openAccountDialog('signin');
|
|
84
|
+
return new Promise(() => undefined);
|
|
85
|
+
}, [oxySignIn, hasIdentity, getPublicKey, openAccountDialog]);
|
|
97
86
|
const signOut = useCallback(async () => {
|
|
98
87
|
await logout();
|
|
99
88
|
}, [logout]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useOxy","isWebBrowser","
|
|
1
|
+
{"version":3,"names":["useCallback","useOxy","isWebBrowser","useAuth","user","isAuthenticated","isLoading","isTokenReady","hasAccessToken","canUsePrivateApi","isPrivateApiPending","isAuthResolved","error","signIn","oxySignIn","logout","logoutAll","refreshSessions","oxyServices","hasIdentity","getPublicKey","showBottomSheet","openAvatarPicker","openAccountDialog","publicKey","hasExisting","existingKey","Promise","undefined","signOut","signOutAll","refresh","isReady"],"sourceRoot":"../../../../src","sources":["ui/hooks/useAuth.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,MAAM,QAAQ,0BAAuB;AAE9C,SAASC,YAAY,QAAQ,0BAAuB;AAkFpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAAA,EAAkB;EACvC,MAAM;IACJC,IAAI;IACJC,eAAe;IACfC,SAAS;IACTC,YAAY;IACZC,cAAc;IACdC,gBAAgB;IAChBC,mBAAmB;IACnBC,cAAc;IACdC,KAAK;IACLC,MAAM,EAAEC,SAAS;IACjBC,MAAM;IACNC,SAAS;IACTC,eAAe;IACfC,WAAW;IACXC,WAAW;IACXC,YAAY;IACZC,eAAe;IACfC,gBAAgB;IAChBC;EACF,CAAC,GAAGtB,MAAM,CAAC,CAAC;EAEZ,MAAMY,MAAM,GAAGb,WAAW,CAAC,MAAOwB,SAAkB,IAAoB;IACtE;IACA;IACA,IAAIA,SAAS,EAAE;MACb,OAAOV,SAAS,CAACU,SAAS,CAAC;IAC7B;IACA,IAAI,CAACtB,YAAY,CAAC,CAAC,EAAE;MACnB,MAAMuB,WAAW,GAAG,MAAMN,WAAW,CAAC,CAAC;MACvC,IAAIM,WAAW,EAAE;QACf,MAAMC,WAAW,GAAG,MAAMN,YAAY,CAAC,CAAC;QACxC,IAAIM,WAAW,EAAE;UACf,OAAOZ,SAAS,CAACY,WAAW,CAAC;QAC/B;MACF;IACF;;IAEA;IACA;IACA;IACA;IACA;IACAH,iBAAiB,CAAC,QAAQ,CAAC;IAC3B,OAAO,IAAII,OAAO,CAAO,MAAMC,SAAS,CAAC;EAC3C,CAAC,EAAE,CAACd,SAAS,EAAEK,WAAW,EAAEC,YAAY,EAAEG,iBAAiB,CAAC,CAAC;EAE7D,MAAMM,OAAO,GAAG7B,WAAW,CAAC,YAA2B;IACrD,MAAMe,MAAM,CAAC,CAAC;EAChB,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAMe,UAAU,GAAG9B,WAAW,CAAC,YAA2B;IACxD,MAAMgB,SAAS,CAAC,CAAC;EACnB,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;EAEf,MAAMe,OAAO,GAAG/B,WAAW,CAAC,YAA2B;IACrD,MAAMiB,eAAe,CAAC,CAAC;EACzB,CAAC,EAAE,CAACA,eAAe,CAAC,CAAC;EAErB,OAAO;IACL;IACAb,IAAI;IACJC,eAAe;IACfC,SAAS,EAAEA,SAAS,IAAI,CAACK,cAAc;IACvCqB,OAAO,EAAEzB,YAAY;IACrBC,cAAc;IACdC,gBAAgB;IAChBC,mBAAmB;IACnBC,cAAc;IACdC,KAAK;IAEL;IACAC,MAAM;IACNgB,OAAO;IACPC,UAAU;IACVC,OAAO;IAEP;IACAb,WAAW;IACXG,eAAe;IACfC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,283 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { getAccountDisplayName, getAccountFallbackHandle } from '@oxyhq/core';
|
|
3
|
+
import { useCallback, useMemo, useSyncExternalStore } from 'react';
|
|
6
4
|
import { useOxy } from "../context/OxyContext.js";
|
|
7
|
-
import { useI18n } from "./useI18n.js";
|
|
8
|
-
import { queryKeys } from "./queries/queryKeys.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The per-account user shape carried by a {@link SwitchableAccount}. The SDK's
|
|
12
|
-
* canonical {@link User} document — either the freshest `useOxy().user` (the
|
|
13
|
-
* active row), a profile resolved via `oxyServices.getUsersByIds()` (every other
|
|
14
|
-
* device row), or the `account` document embedded in an account-graph node.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* One account the signed-in user can switch INTO, in the uniform switch model.
|
|
19
|
-
*
|
|
20
|
-
* A switchable account is either a device sign-in, an account-graph node (owned
|
|
21
|
-
* org / shared-with-you), or BOTH (an account that has been switched into
|
|
22
|
-
* becomes a device session while still being a graph node — the two are deduped
|
|
23
|
-
* into a single row). Every row carries a canonical `accountId` (the uniform
|
|
24
|
-
* switch key passed to `switchToAccount`); `sessionId` is present IFF the
|
|
25
|
-
* account is currently signed in on THIS device.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/** The minimal device-session shape {@link buildSwitchableAccounts} reads. */
|
|
29
|
-
|
|
30
5
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* Primary signal: `entry.sessionId === activeSessionId` — both are projected
|
|
34
|
-
* from the same `SessionClient` state, so this normally matches exactly.
|
|
35
|
-
* Fallbacks exist only to bridge the brief window between the two sequential
|
|
36
|
-
* `updateSessions` / `setActiveSessionId` calls in `OxyContext.syncFromClient`,
|
|
37
|
-
* applied only when the `sessionId` match found nothing AND the user is
|
|
38
|
-
* authenticated:
|
|
39
|
-
* 1. Match the live `user.id` against each entry's per-account user id.
|
|
40
|
-
* 2. If still nothing and there is exactly one account, mark that one current.
|
|
41
|
-
*
|
|
42
|
-
* At most ONE entry is ever marked current. Runs over DEVICE rows only (graph
|
|
43
|
-
* rows are never active — the active account is always a device session), so the
|
|
44
|
-
* single-account fallback counts device rows.
|
|
45
|
-
*
|
|
46
|
-
* Pure & side-effect free so it is unit-testable without rendering React.
|
|
6
|
+
* Stable empty snapshot for the no-provider loading state, so `useSyncExternalStore`
|
|
7
|
+
* always has a getSnapshot that returns a constant reference before mount.
|
|
47
8
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const byUser = bySession.map(account => {
|
|
62
|
-
if (!matched && account.user.id === liveUserId) {
|
|
63
|
-
matched = true;
|
|
64
|
-
return {
|
|
65
|
-
...account,
|
|
66
|
-
isCurrent: true
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
return account;
|
|
70
|
-
});
|
|
71
|
-
if (matched) {
|
|
72
|
-
return byUser;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Authenticated, nothing matched, but there is exactly one account → it must
|
|
77
|
-
// be the current one.
|
|
78
|
-
if (bySession.length === 1) {
|
|
79
|
-
return [{
|
|
80
|
-
...bySession[0],
|
|
81
|
-
isCurrent: true
|
|
82
|
-
}];
|
|
9
|
+
const EMPTY_SNAPSHOT = {
|
|
10
|
+
view: 'accounts',
|
|
11
|
+
accounts: [],
|
|
12
|
+
activeAccountId: null,
|
|
13
|
+
loading: false,
|
|
14
|
+
error: null,
|
|
15
|
+
switchingAccountId: null,
|
|
16
|
+
signIn: {
|
|
17
|
+
phase: 'idle',
|
|
18
|
+
authorizeCode: null,
|
|
19
|
+
qrPayload: null,
|
|
20
|
+
expiresAt: null,
|
|
21
|
+
error: null
|
|
83
22
|
}
|
|
84
|
-
|
|
85
|
-
}
|
|
23
|
+
};
|
|
86
24
|
|
|
87
25
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const {
|
|
99
|
-
sessions,
|
|
100
|
-
activeSessionId,
|
|
101
|
-
liveUser,
|
|
102
|
-
isAuthenticated,
|
|
103
|
-
graph,
|
|
104
|
-
profilesById,
|
|
105
|
-
locale,
|
|
106
|
-
resolveAvatarUrl
|
|
107
|
-
} = input;
|
|
108
|
-
|
|
109
|
-
// Nothing is switchable when signed out — never surface a lingering device
|
|
110
|
-
// session or graph node once the user is unauthenticated.
|
|
111
|
-
if (!isAuthenticated) {
|
|
112
|
-
return [];
|
|
113
|
-
}
|
|
114
|
-
const toRow = (accountUser, opts) => {
|
|
115
|
-
const displayName = getAccountDisplayName(accountUser, locale);
|
|
116
|
-
const handle = getAccountFallbackHandle(accountUser);
|
|
117
|
-
const secondaryHandle = handle ? `@${handle}` : null;
|
|
118
|
-
return {
|
|
119
|
-
accountId: accountUser.id?.toString() ?? '',
|
|
120
|
-
sessionId: opts.sessionId,
|
|
121
|
-
authuser: opts.authuser,
|
|
122
|
-
isCurrent: Boolean(opts.sessionId) && opts.sessionId === activeSessionId,
|
|
123
|
-
onDevice: Boolean(opts.sessionId),
|
|
124
|
-
relationship: opts.relationship,
|
|
125
|
-
kind: opts.kind,
|
|
126
|
-
parentAccountId: opts.parentAccountId,
|
|
127
|
-
callerMembership: opts.callerMembership,
|
|
128
|
-
displayName,
|
|
129
|
-
// Real email, or the `@handle` fallback (NEVER synthesized).
|
|
130
|
-
email: accountUser.email ?? secondaryHandle,
|
|
131
|
-
avatarUrl: resolveAvatarUrl(accountUser.avatar),
|
|
132
|
-
color: accountUser.color ?? null,
|
|
133
|
-
user: accountUser
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// --- Device rows ---
|
|
138
|
-
const built = sessions.flatMap(session => {
|
|
139
|
-
const isCurrent = session.sessionId === activeSessionId;
|
|
140
|
-
// The active row always uses the live `user` — freshest available —
|
|
141
|
-
// regardless of whether the batch profile fetch has resolved yet.
|
|
142
|
-
const accountUser = isCurrent && liveUser ? liveUser : session.userId ? profilesById.get(session.userId) : undefined;
|
|
143
|
-
if (!accountUser) {
|
|
144
|
-
return [];
|
|
145
|
-
}
|
|
146
|
-
return [toRow(accountUser, {
|
|
147
|
-
sessionId: session.sessionId,
|
|
148
|
-
authuser: session.authuser
|
|
149
|
-
})];
|
|
150
|
-
});
|
|
151
|
-
const flagged = markCurrentAccount(built, activeSessionId, liveUser?.id ?? null, isAuthenticated);
|
|
152
|
-
|
|
153
|
-
// The signed-in user must ALWAYS be represented, even before the device
|
|
154
|
-
// session set has synced (e.g. immediately after cold boot). Synthesize a
|
|
155
|
-
// single current row from the live `useOxy().user` in that case.
|
|
156
|
-
const deviceRows = flagged.length === 0 && isAuthenticated && liveUser && activeSessionId ? [toRow(liveUser, {
|
|
157
|
-
sessionId: activeSessionId
|
|
158
|
-
})] : flagged;
|
|
159
|
-
|
|
160
|
-
// --- Merge graph nodes, deduping by account id ---
|
|
161
|
-
const byAccountId = new Map();
|
|
162
|
-
const order = [];
|
|
163
|
-
const remember = row => {
|
|
164
|
-
if (!row.accountId || byAccountId.has(row.accountId)) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
byAccountId.set(row.accountId, row);
|
|
168
|
-
order.push(row.accountId);
|
|
169
|
-
};
|
|
170
|
-
for (const row of deviceRows) {
|
|
171
|
-
remember(row);
|
|
172
|
-
}
|
|
173
|
-
for (const node of graph) {
|
|
174
|
-
const existing = byAccountId.get(node.accountId);
|
|
175
|
-
if (existing) {
|
|
176
|
-
// On-device account that is ALSO in the graph: enrich the device row
|
|
177
|
-
// with graph metadata; keep its (freshest) profile + sessionId.
|
|
178
|
-
byAccountId.set(node.accountId, {
|
|
179
|
-
...existing,
|
|
180
|
-
relationship: node.relationship,
|
|
181
|
-
kind: node.kind,
|
|
182
|
-
parentAccountId: node.parentAccountId,
|
|
183
|
-
callerMembership: node.callerMembership
|
|
184
|
-
});
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
// Graph-only account (owned org / shared, not yet a device session).
|
|
188
|
-
remember(toRow(node.account, {
|
|
189
|
-
relationship: node.relationship,
|
|
190
|
-
kind: node.kind,
|
|
191
|
-
parentAccountId: node.parentAccountId,
|
|
192
|
-
callerMembership: node.callerMembership
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
return order.flatMap(id => {
|
|
196
|
-
const row = byAccountId.get(id);
|
|
197
|
-
return row ? [row] : [];
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Resolve every account the signed-in user can switch into — device sign-ins
|
|
203
|
-
* AND linked graph accounts (owned orgs + shared-with-you) — as one flat list
|
|
204
|
-
* with real per-account name / email / avatar / color, deduped by account id.
|
|
205
|
-
*
|
|
206
|
-
* ## Data sources
|
|
207
|
-
*
|
|
208
|
-
* - Device sign-ins: `useOxy().sessions` — a `ClientSession[]` projected by
|
|
209
|
-
* `OxyContext.syncFromClient` from the server-authoritative `SessionClient`.
|
|
210
|
-
* Each session carries only `sessionId` + `userId`, so this hook additionally
|
|
211
|
-
* fetches every device account's profile via `oxyServices.getUsersByIds()`.
|
|
212
|
-
* The ACTIVE row always uses `useOxy().user` directly (the freshest copy).
|
|
213
|
-
* - Linked accounts: `useOxy().accounts` — the `AccountNode[]` graph the context
|
|
214
|
-
* loads from `GET /accounts`. Each node already embeds its `account` `User`
|
|
215
|
-
* document, so graph-only rows need no extra fetch.
|
|
216
|
-
*
|
|
217
|
-
* An account present as BOTH a device session and a graph node is deduped into
|
|
218
|
-
* ONE row (see {@link buildSwitchableAccounts}). EVERY row switches the same
|
|
219
|
-
* way — through `useOxy().switchToAccount(row.accountId)`.
|
|
220
|
-
*
|
|
221
|
-
* ## Error handling
|
|
222
|
-
*
|
|
223
|
-
* `getUsersByIds()` resolves to `[]` on a failed chunk (logged internally)
|
|
224
|
-
* rather than throwing. Device accounts whose profile could not be resolved are
|
|
225
|
-
* omitted until a subsequent fetch succeeds (except the active one, which never
|
|
226
|
-
* depends on this fetch); graph accounts are unaffected.
|
|
26
|
+
* Every account the signed-in user can switch into — device sign-ins AND linked
|
|
27
|
+
* graph accounts (owned orgs + shared-with-you) — as one flat, deduped list with
|
|
28
|
+
* real per-account name / email / avatar / color.
|
|
29
|
+
*
|
|
30
|
+
* This is a thin binding over the shared `AccountDialogController` in
|
|
31
|
+
* `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialog} renders),
|
|
32
|
+
* so there is ONE projection (`projectSwitchableAccounts`) and one switch path
|
|
33
|
+
* (`controller.switchTo`) across the whole SDK — the local duplicate projection
|
|
34
|
+
* this hook used to own has been removed. Every switch routes through
|
|
35
|
+
* `useOxy().switchToAccount(accountId)` (or the dialog's row press).
|
|
227
36
|
*/
|
|
228
37
|
export function useSwitchableAccounts() {
|
|
229
38
|
const {
|
|
230
|
-
|
|
231
|
-
sessions,
|
|
232
|
-
activeSessionId,
|
|
233
|
-
user,
|
|
234
|
-
isAuthenticated,
|
|
235
|
-
accounts: graph
|
|
39
|
+
accountDialogController: controller
|
|
236
40
|
} = useOxy();
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const ids = new Set();
|
|
245
|
-
for (const session of sessions ?? []) {
|
|
246
|
-
if (session.userId) {
|
|
247
|
-
ids.add(session.userId);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return Array.from(ids).sort();
|
|
251
|
-
}, [sessions]);
|
|
252
|
-
const profilesQuery = useQuery({
|
|
253
|
-
queryKey: queryKeys.users.list(accountIds),
|
|
254
|
-
queryFn: () => oxyServices.getUsersByIds(accountIds),
|
|
255
|
-
enabled: isAuthenticated && accountIds.length > 0,
|
|
256
|
-
staleTime: 5 * 60 * 1000,
|
|
257
|
-
// 5 minutes — matches useUserProfile's convention
|
|
258
|
-
gcTime: 30 * 60 * 1000 // 30 minutes
|
|
259
|
-
});
|
|
260
|
-
const profilesById = useMemo(() => {
|
|
261
|
-
const map = new Map();
|
|
262
|
-
for (const profile of profilesQuery.data ?? []) {
|
|
263
|
-
map.set(profile.id, profile);
|
|
264
|
-
}
|
|
265
|
-
return map;
|
|
266
|
-
}, [profilesQuery.data]);
|
|
267
|
-
const accounts = useMemo(() => buildSwitchableAccounts({
|
|
268
|
-
sessions: sessions ?? [],
|
|
269
|
-
activeSessionId: activeSessionId ?? null,
|
|
270
|
-
liveUser: user ?? null,
|
|
271
|
-
isAuthenticated,
|
|
272
|
-
graph: graph ?? [],
|
|
273
|
-
profilesById,
|
|
274
|
-
locale,
|
|
275
|
-
resolveAvatarUrl: avatar => avatar ? oxyServices.getFileDownloadUrl(avatar, 'thumb') : undefined
|
|
276
|
-
}), [sessions, activeSessionId, user, isAuthenticated, graph, profilesById, locale, oxyServices]);
|
|
41
|
+
const subscribe = useCallback(listener => controller ? controller.subscribe(listener) : () => undefined, [controller]);
|
|
42
|
+
const getSnapshot = useCallback(() => controller ? controller.getSnapshot() : EMPTY_SNAPSHOT, [controller]);
|
|
43
|
+
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
44
|
+
const currentSessionId = useMemo(() => {
|
|
45
|
+
const active = snapshot.accounts.find(account => account.accountId === snapshot.activeAccountId);
|
|
46
|
+
return active?.sessionId ?? null;
|
|
47
|
+
}, [snapshot]);
|
|
277
48
|
return {
|
|
278
|
-
accounts,
|
|
279
|
-
isLoading:
|
|
280
|
-
currentSessionId
|
|
49
|
+
accounts: snapshot.accounts,
|
|
50
|
+
isLoading: snapshot.loading,
|
|
51
|
+
currentSessionId
|
|
281
52
|
};
|
|
282
53
|
}
|
|
283
54
|
//# sourceMappingURL=useSwitchableAccounts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useSyncExternalStore","useOxy","EMPTY_SNAPSHOT","view","accounts","activeAccountId","loading","error","switchingAccountId","signIn","phase","authorizeCode","qrPayload","expiresAt","useSwitchableAccounts","accountDialogController","controller","subscribe","listener","undefined","getSnapshot","snapshot","currentSessionId","active","find","account","accountId","sessionId","isLoading"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSwitchableAccounts.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,EAAEC,oBAAoB,QAAQ,OAAO;AAElE,SAASC,MAAM,QAAQ,0BAAuB;AAW9C;AACA;AACA;AACA;AACA,MAAMC,cAAqC,GAAG;EAC1CC,IAAI,EAAE,UAAU;EAChBC,QAAQ,EAAE,EAAE;EACZC,eAAe,EAAE,IAAI;EACrBC,OAAO,EAAE,KAAK;EACdC,KAAK,EAAE,IAAI;EACXC,kBAAkB,EAAE,IAAI;EACxBC,MAAM,EAAE;IAAEC,KAAK,EAAE,MAAM;IAAEC,aAAa,EAAE,IAAI;IAAEC,SAAS,EAAE,IAAI;IAAEC,SAAS,EAAE,IAAI;IAAEN,KAAK,EAAE;EAAK;AAChG,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,qBAAqBA,CAAA,EAAgC;EACjE,MAAM;IAAEC,uBAAuB,EAAEC;EAAW,CAAC,GAAGf,MAAM,CAAC,CAAC;EAExD,MAAMgB,SAAS,GAAGnB,WAAW,CACxBoB,QAAoB,IAAMF,UAAU,GAAGA,UAAU,CAACC,SAAS,CAACC,QAAQ,CAAC,GAAG,MAAMC,SAAU,EACzF,CAACH,UAAU,CACf,CAAC;EACD,MAAMI,WAAW,GAAGtB,WAAW,CAC3B,MAAOkB,UAAU,GAAGA,UAAU,CAACI,WAAW,CAAC,CAAC,GAAGlB,cAAe,EAC9D,CAACc,UAAU,CACf,CAAC;EACD,MAAMK,QAAQ,GAAGrB,oBAAoB,CAACiB,SAAS,EAAEG,WAAW,EAAEA,WAAW,CAAC;EAE1E,MAAME,gBAAgB,GAAGvB,OAAO,CAAgB,MAAM;IAClD,MAAMwB,MAAM,GAAGF,QAAQ,CAACjB,QAAQ,CAACoB,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACC,SAAS,KAAKL,QAAQ,CAAChB,eAAe,CAAC;IAClG,OAAOkB,MAAM,EAAEI,SAAS,IAAI,IAAI;EACpC,CAAC,EAAE,CAACN,QAAQ,CAAC,CAAC;EAEd,OAAO;IACHjB,QAAQ,EAAEiB,QAAQ,CAACjB,QAAQ;IAC3BwB,SAAS,EAAEP,QAAQ,CAACf,OAAO;IAC3BgB;EACJ,CAAC;AACL","ignoreList":[]}
|
package/lib/module/ui/index.js
CHANGED
|
@@ -22,16 +22,13 @@ export { default as OxyProvider } from "./components/OxyProvider.js";
|
|
|
22
22
|
export { default as OxySignInButton } from "./components/OxySignInButton.js";
|
|
23
23
|
export { default as OxyAuthPrompt } from "./components/OxyAuthPrompt.js";
|
|
24
24
|
export { default as OxyLogo } from "./components/OxyLogo.js";
|
|
25
|
+
export { RequireOxyAuth } from "./components/RequireOxyAuth.js";
|
|
25
26
|
export { default as Avatar } from "./components/Avatar.js";
|
|
26
27
|
export { default as FollowButton } from "./components/FollowButton.js";
|
|
27
28
|
export { default as OxyPayButton } from "./components/OxyPayButton.js";
|
|
28
29
|
export { FontLoader, setupFonts } from "./components/FontLoader.js";
|
|
29
30
|
export { default as OxyIcon } from "./components/icon/OxyIcon.js";
|
|
30
|
-
export { default as AccountMenu } from "./components/AccountMenu.js";
|
|
31
|
-
export { default as AccountMenuButton } from "./components/AccountMenuButton.js";
|
|
32
31
|
export { default as ProfileButton } from "./components/ProfileButton.js";
|
|
33
|
-
export { default as ProfileMenu } from "./components/ProfileMenu.js";
|
|
34
|
-
export { default as AccountSwitcher, AccountSwitcherView } from "./components/AccountSwitcher.js";
|
|
35
32
|
|
|
36
33
|
// Context + hooks
|
|
37
34
|
export { useOxy } from "./context/OxyContext.js";
|
|
@@ -41,7 +38,6 @@ export { useStorage } from "./hooks/useStorage.js";
|
|
|
41
38
|
// Screens
|
|
42
39
|
export { default as ProfileScreen } from "./screens/ProfileScreen.js";
|
|
43
40
|
export { default as ManageAccountScreen } from "./screens/ManageAccountScreen.js";
|
|
44
|
-
export { default as AccountSwitcherScreen } from "./screens/AccountSwitcherScreen.js";
|
|
45
41
|
export { default as CreateAccountScreen } from "./screens/CreateAccountScreen.js";
|
|
46
42
|
export { default as AccountMembersScreen } from "./screens/AccountMembersScreen.js";
|
|
47
43
|
export { default as AccountSettingsScreen } from "./screens/AccountSettingsScreen.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","OxyProvider","OxySignInButton","OxyAuthPrompt","OxyLogo","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","OxyIcon","
|
|
1
|
+
{"version":3,"names":["default","OxyProvider","OxySignInButton","OxyAuthPrompt","OxyLogo","RequireOxyAuth","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","OxyIcon","ProfileButton","useOxy","useAuth","useFollow","useStorage","ProfileScreen","ManageAccountScreen","CreateAccountScreen","AccountMembersScreen","AccountSettingsScreen","useAuthStore","useAccountStore","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,6BAA0B;AACjE,SAASD,OAAO,IAAIE,eAAe,QAAQ,iCAA8B;AACzE,SAASF,OAAO,IAAIG,aAAa,QAAQ,+BAA4B;AAErE,SAASH,OAAO,IAAII,OAAO,QAAQ,yBAAsB;AACzD,SAASC,cAAc,QAAQ,gCAA6B;AAE5D,SAASL,OAAO,IAAIM,MAAM,QAAQ,wBAAqB;AACvD,SAASN,OAAO,IAAIO,YAAY,QAAQ,8BAA2B;AACnE,SAASP,OAAO,IAAIQ,YAAY,QAAQ,8BAA2B;AACnE,SAASC,UAAU,EAAEC,UAAU,QAAQ,4BAAyB;AAChE,SAASV,OAAO,IAAIW,OAAO,QAAQ,8BAA2B;AAC9D,SAASX,OAAO,IAAIY,aAAa,QAAQ,+BAA4B;;AAErE;AACA,SAASC,MAAM,QAAQ,yBAAsB;AAC7C,SAASC,OAAO,QAAQ,oBAAiB;AACzC,SAASC,SAAS,QAAQ,sBAAmB;AAC7C,SAASC,UAAU,QAAQ,uBAAoB;AAG/C;AACA,SAAShB,OAAO,IAAIiB,aAAa,QAAQ,4BAAyB;AAClE,SAASjB,OAAO,IAAIkB,mBAAmB,QAAQ,kCAA+B;AAC9E,SAASlB,OAAO,IAAImB,mBAAmB,QAAQ,kCAA+B;AAC9E,SAASnB,OAAO,IAAIoB,oBAAoB,QAAQ,mCAAgC;AAChF,SAASpB,OAAO,IAAIqB,qBAAqB,QAAQ,oCAAiC;;AAElF;AACA,SAASC,YAAY,QAAQ,uBAAoB;AACjD,SAASC,eAAe,QAAQ,0BAAuB;;AAEvD;AACA,SACIC,eAAe,EACfC,qBAAqB,EACrBC,uBAAuB,EACvBC,mBAAmB,QAChB,0BAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Imperative bridge for the unified {@link OxyAccountDialog}.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors `bottomSheetManager` — a tiny module-level indirection so any caller
|
|
7
|
+
* (even outside React, e.g. an app's imperative "sign in" handler) can open the
|
|
8
|
+
* single account dialog without a ref. `OxyContext` registers the live open/close
|
|
9
|
+
* controls on mount via {@link registerAccountDialogControls} and reports the
|
|
10
|
+
* dialog's visibility here via {@link notifyAccountDialogVisibility}; the exported
|
|
11
|
+
* `openAccountDialog` / `closeAccountDialog` drive those controls.
|
|
12
|
+
*
|
|
13
|
+
* `showSignInModal` / `hideSignInModal` / `subscribeToSignInModal` are the stable
|
|
14
|
+
* public surface the previous `SignInModal` module owned — kept so existing
|
|
15
|
+
* consumers (inbox, accounts) keep working while the sign-in surface is now the
|
|
16
|
+
* unified dialog opened on its `signin` view.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Live open/close handles registered by the mounted provider. */
|
|
20
|
+
|
|
21
|
+
let controls = null;
|
|
22
|
+
const visibilityListeners = new Set();
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Register the provider's live open/close controls. Returns an unregister
|
|
26
|
+
* function that only clears the slot if it still owns it (guards against a late
|
|
27
|
+
* unmount clobbering a newer provider).
|
|
28
|
+
*/
|
|
29
|
+
export function registerAccountDialogControls(next) {
|
|
30
|
+
controls = next;
|
|
31
|
+
return () => {
|
|
32
|
+
if (controls === next) {
|
|
33
|
+
controls = null;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Open the account dialog on `view` (default `accounts`). No-op before mount. */
|
|
39
|
+
export function openAccountDialog(view) {
|
|
40
|
+
controls?.open(view);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Close the account dialog. No-op before mount. */
|
|
44
|
+
export function closeAccountDialog() {
|
|
45
|
+
controls?.close();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Report the dialog's current visibility so subscribers (e.g. `OxySignInButton`)
|
|
50
|
+
* can reflect an in-flight "Signing in…" state. Called by the provider whenever
|
|
51
|
+
* the open flag changes, so listeners stay accurate regardless of what triggered
|
|
52
|
+
* the change (imperative open, backdrop dismiss, completed sign-in).
|
|
53
|
+
*/
|
|
54
|
+
export function notifyAccountDialogVisibility(visible) {
|
|
55
|
+
for (const listener of visibilityListeners) {
|
|
56
|
+
listener(visible);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Subscribe to dialog visibility changes. Returns an unsubscribe function.
|
|
62
|
+
* Retains the name the old `SignInModal` exposed so `OxySignInButton` keeps its
|
|
63
|
+
* "Signing in…" affordance.
|
|
64
|
+
*/
|
|
65
|
+
export function subscribeToSignInModal(listener) {
|
|
66
|
+
visibilityListeners.add(listener);
|
|
67
|
+
return () => {
|
|
68
|
+
visibilityListeners.delete(listener);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Open the unified dialog on its sign-in view. Public back-compat entry point. */
|
|
73
|
+
export function showSignInModal() {
|
|
74
|
+
openAccountDialog('signin');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Close the unified dialog. Public back-compat entry point. */
|
|
78
|
+
export function hideSignInModal() {
|
|
79
|
+
closeAccountDialog();
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=accountDialogManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["controls","visibilityListeners","Set","registerAccountDialogControls","next","openAccountDialog","view","open","closeAccountDialog","close","notifyAccountDialogVisibility","visible","listener","subscribeToSignInModal","add","delete","showSignInModal","hideSignInModal"],"sourceRoot":"../../../../src","sources":["ui/navigation/accountDialogManager.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAMA,IAAIA,QAAsC,GAAG,IAAI;AACjD,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAA6B,CAAC;;AAEjE;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,6BAA6BA,CAACC,IAA2B,EAAc;EACrFJ,QAAQ,GAAGI,IAAI;EACf,OAAO,MAAM;IACX,IAAIJ,QAAQ,KAAKI,IAAI,EAAE;MACrBJ,QAAQ,GAAG,IAAI;IACjB;EACF,CAAC;AACH;;AAEA;AACA,OAAO,SAASK,iBAAiBA,CAACC,IAAwB,EAAQ;EAChEN,QAAQ,EAAEO,IAAI,CAACD,IAAI,CAAC;AACtB;;AAEA;AACA,OAAO,SAASE,kBAAkBA,CAAA,EAAS;EACzCR,QAAQ,EAAES,KAAK,CAAC,CAAC;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,6BAA6BA,CAACC,OAAgB,EAAQ;EACpE,KAAK,MAAMC,QAAQ,IAAIX,mBAAmB,EAAE;IAC1CW,QAAQ,CAACD,OAAO,CAAC;EACnB;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,sBAAsBA,CAACD,QAAoC,EAAc;EACvFX,mBAAmB,CAACa,GAAG,CAACF,QAAQ,CAAC;EACjC,OAAO,MAAM;IACXX,mBAAmB,CAACc,MAAM,CAACH,QAAQ,CAAC;EACtC,CAAC;AACH;;AAEA;AACA,OAAO,SAASI,eAAeA,CAAA,EAAS;EACtCX,iBAAiB,CAAC,QAAQ,CAAC;AAC7B;;AAEA;AACA,OAAO,SAASY,eAAeA,CAAA,EAAS;EACtCT,kBAAkB,CAAC,CAAC;AACtB","ignoreList":[]}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
// Lazy screen loaders - functions that return screen components on-demand
|
|
12
12
|
// This breaks the require cycle by deferring imports until screens are actually needed
|
|
13
13
|
const screenLoaders = {
|
|
14
|
-
OxyAuth: () => require('../screens/OxyAuthScreen').default,
|
|
15
14
|
ManageAccount: () => require('../screens/ManageAccountScreen').default,
|
|
16
15
|
AccountVerification: () => require('../screens/AccountVerificationScreen').default,
|
|
17
16
|
PaymentGateway: () => require('../screens/PaymentGatewayScreen').default,
|
|
@@ -44,7 +43,6 @@ const screenLoaders = {
|
|
|
44
43
|
// User list screens (followers/following)
|
|
45
44
|
FollowersList: () => require('../screens/FollowersListScreen').default,
|
|
46
45
|
FollowingList: () => require('../screens/FollowingListScreen').default,
|
|
47
|
-
AccountSwitcher: () => require('../screens/AccountSwitcherScreen').default,
|
|
48
46
|
CreateAccount: () => require('../screens/CreateAccountScreen').default,
|
|
49
47
|
AccountMembers: () => require('../screens/AccountMembersScreen').default,
|
|
50
48
|
AccountSettings: () => require('../screens/AccountSettingsScreen').default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["screenLoaders","
|
|
1
|
+
{"version":3,"names":["screenLoaders","ManageAccount","require","default","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","screenCache","Map","getScreenComponent","routeName","has","get","loader","component","set","error","__DEV__","console","undefined","isValidRoute","isFileManagementImageOnlyPicker","props","selectMode","disabled","disabledMimeTypes","Array","isArray","length","predicate","some","mt","blocksVideos","startsWith","blocksAudio","blocksDocs","DEFAULT_SHEET_CONFIG","scrollable","manualActivation","dynamicBackdrop","getSheetConfig","screenProps"],"sourceRoot":"../../../../src","sources":["ui/navigation/routes.ts"],"mappings":";;AAGA;AACA;AACA;;AAEA;;AAqCqB;;AAErB;AACA;AACA,MAAMA,aAAsE,GAAG;EAC3EC,aAAa,EAAEA,CAAA,KAAMC,OAAO,CAAC,gCAAgC,CAAC,CAACC,OAAO;EACtEC,mBAAmB,EAAEA,CAAA,KAAMF,OAAO,CAAC,sCAAsC,CAAC,CAACC,OAAO;EAClFE,cAAc,EAAEA,CAAA,KAAMH,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO;EACxEG,OAAO,EAAEA,CAAA,KAAMJ,OAAO,CAAC,0BAA0B,CAAC,CAACC,OAAO;EAC1DI,gBAAgB,EAAEA,CAAA,KAAML,OAAO,CAAC,mCAAmC,CAAC,CAACC,OAAO;EAC5EK,eAAe,EAAEA,CAAA,KAAMN,OAAO,CAAC,kCAAkC,CAAC,CAACC,OAAO;EAC1EM,cAAc,EAAEA,CAAA,KAAMP,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO;EACxEO,cAAc,EAAEA,CAAA,KAAMR,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO;EACxEQ,WAAW,EAAEA,CAAA,K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