@oxyhq/services 27.1.3 → 29.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/LICENSE +202 -661
- package/NOTICE +16 -0
- package/README.md +67 -2
- package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionModule.kt +178 -0
- package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionProvider.kt +99 -0
- package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionStore.kt +115 -0
- package/expo-module.config.json +1 -0
- package/lib/commonjs/index.js +78 -16
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +7 -0
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/client.js +12 -7
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +10 -27
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +132 -44
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +4 -2
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/SurfaceScreen.js +31 -3
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +209 -84
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +25 -7
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js +35 -22
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/signInProgress.js +5 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js +11 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +257 -306
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +27 -37
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/oxyContextHelpers.js +0 -29
- package/lib/commonjs/ui/context/oxyContextHelpers.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +6 -17
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/accountDialogSnapshot.js +42 -0
- package/lib/commonjs/ui/hooks/accountDialogSnapshot.js.map +1 -0
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +0 -19
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/useDeviceSwitcher.js +57 -0
- package/lib/commonjs/ui/hooks/useDeviceSwitcher.js.map +1 -0
- package/lib/commonjs/ui/hooks/useI18n.js +22 -3
- package/lib/commonjs/ui/hooks/useI18n.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +46 -153
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/index.js +12 -7
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +85 -73
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaces.js +8 -7
- package/lib/commonjs/ui/navigation/surfaces.js.map +1 -1
- package/lib/commonjs/ui/runtime/createOxyRuntime.js +433 -0
- package/lib/commonjs/ui/runtime/createOxyRuntime.js.map +1 -0
- package/lib/commonjs/ui/runtime/index.js +63 -0
- package/lib/commonjs/ui/runtime/index.js.map +1 -0
- package/lib/commonjs/ui/runtime/runtimeContext.js +83 -0
- package/lib/commonjs/ui/runtime/runtimeContext.js.map +1 -0
- package/lib/commonjs/ui/runtime/types.js +6 -0
- package/lib/commonjs/ui/runtime/types.js.map +1 -0
- package/lib/commonjs/ui/runtime/useRuntimeSnapshot.js +57 -0
- package/lib/commonjs/ui/runtime/useRuntimeSnapshot.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +3 -4
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +3 -12
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +6 -5
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +4 -4
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +4 -2
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/server.js +1 -2
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/commonjs/ui/session/authStore.js +45 -9
- package/lib/commonjs/ui/session/authStore.js.map +1 -1
- package/lib/commonjs/ui/session/sharedDeviceCredentialStore.js +306 -0
- package/lib/commonjs/ui/session/sharedDeviceCredentialStore.js.map +1 -0
- package/lib/commonjs/ui/stores/authStore.js +154 -55
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/stores/followTargetStore.js +27 -0
- package/lib/commonjs/ui/stores/followTargetStore.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +2 -36
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/index.js +20 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/boot/runProviderColdBoot.js +7 -0
- package/lib/module/ui/boot/runProviderColdBoot.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/OxyAccountDialogScreen.js +10 -27
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +134 -44
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +5 -3
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/SurfaceScreen.js +33 -5
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +210 -85
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/SignInEntryView.js +25 -7
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/module/ui/components/authChooser/primitives.js +35 -22
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/module/ui/components/authChooser/signInProgress.js +5 -0
- package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js +11 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +251 -303
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +27 -37
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/oxyContextHelpers.js +0 -28
- package/lib/module/ui/context/oxyContextHelpers.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +6 -17
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/accountDialogSnapshot.js +38 -0
- package/lib/module/ui/hooks/accountDialogSnapshot.js.map +1 -0
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +0 -19
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/useDeviceSwitcher.js +53 -0
- package/lib/module/ui/hooks/useDeviceSwitcher.js.map +1 -0
- package/lib/module/ui/hooks/useI18n.js +24 -4
- package/lib/module/ui/hooks/useI18n.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +47 -155
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/index.js +1 -2
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +84 -72
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/surfaces.js +6 -6
- package/lib/module/ui/navigation/surfaces.js.map +1 -1
- package/lib/module/ui/runtime/createOxyRuntime.js +430 -0
- package/lib/module/ui/runtime/createOxyRuntime.js.map +1 -0
- package/lib/module/ui/runtime/index.js +15 -0
- package/lib/module/ui/runtime/index.js.map +1 -0
- package/lib/module/ui/runtime/runtimeContext.js +75 -0
- package/lib/module/ui/runtime/runtimeContext.js.map +1 -0
- package/lib/module/ui/runtime/types.js +4 -0
- package/lib/module/ui/runtime/types.js.map +1 -0
- package/lib/module/ui/runtime/useRuntimeSnapshot.js +52 -0
- package/lib/module/ui/runtime/useRuntimeSnapshot.js.map +1 -0
- package/lib/module/ui/screens/AccountMembersScreen.js +4 -5
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +4 -13
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +6 -5
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +5 -5
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +4 -2
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/server.js +0 -1
- package/lib/module/ui/server.js.map +1 -1
- package/lib/module/ui/session/authStore.js +46 -11
- package/lib/module/ui/session/authStore.js.map +1 -1
- package/lib/module/ui/session/sharedDeviceCredentialStore.js +302 -0
- package/lib/module/ui/session/sharedDeviceCredentialStore.js.map +1 -0
- package/lib/module/ui/stores/authStore.js +154 -55
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/stores/followTargetStore.js +25 -0
- package/lib/module/ui/stores/followTargetStore.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +2 -35
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +6 -4
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +1 -2
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts +11 -4
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +3 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +18 -6
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +33 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +35 -4
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +8 -12
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextHelpers.d.ts +0 -2
- package/lib/typescript/commonjs/ui/context/oxyContextHelpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +9 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +1 -3
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/accountDialogSnapshot.d.ts +15 -0
- package/lib/typescript/commonjs/ui/hooks/accountDialogSnapshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useDeviceSwitcher.d.ts +49 -0
- package/lib/typescript/commonjs/ui/hooks/useDeviceSwitcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useI18n.d.ts +13 -0
- package/lib/typescript/commonjs/ui/hooks/useI18n.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts +23 -18
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +1 -2
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +15 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/runtime/createOxyRuntime.d.ts +144 -0
- package/lib/typescript/commonjs/ui/runtime/createOxyRuntime.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/runtime/index.d.ts +16 -0
- package/lib/typescript/commonjs/ui/runtime/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/runtime/runtimeContext.d.ts +43 -0
- package/lib/typescript/commonjs/ui/runtime/runtimeContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/runtime/types.d.ts +89 -0
- package/lib/typescript/commonjs/ui/runtime/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/runtime/useRuntimeSnapshot.d.ts +23 -0
- package/lib/typescript/commonjs/ui/runtime/useRuntimeSnapshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/server.d.ts +0 -1
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/authStore.d.ts +60 -9
- package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/sharedDeviceCredentialStore.d.ts +32 -0
- package/lib/typescript/commonjs/ui/session/sharedDeviceCredentialStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/stores/authStore.d.ts +49 -5
- package/lib/typescript/commonjs/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts +8 -1
- package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +26 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts +2 -10
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +6 -4
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +1 -2
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts +11 -4
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +3 -1
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +18 -6
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +33 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts +35 -4
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +8 -12
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextHelpers.d.ts +0 -2
- package/lib/typescript/module/ui/context/oxyContextHelpers.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +9 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +1 -3
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/accountDialogSnapshot.d.ts +15 -0
- package/lib/typescript/module/ui/hooks/accountDialogSnapshot.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useDeviceSwitcher.d.ts +49 -0
- package/lib/typescript/module/ui/hooks/useDeviceSwitcher.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useI18n.d.ts +13 -0
- package/lib/typescript/module/ui/hooks/useI18n.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts +23 -18
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +1 -2
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +15 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -1
- package/lib/typescript/module/ui/runtime/createOxyRuntime.d.ts +144 -0
- package/lib/typescript/module/ui/runtime/createOxyRuntime.d.ts.map +1 -0
- package/lib/typescript/module/ui/runtime/index.d.ts +16 -0
- package/lib/typescript/module/ui/runtime/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/runtime/runtimeContext.d.ts +43 -0
- package/lib/typescript/module/ui/runtime/runtimeContext.d.ts.map +1 -0
- package/lib/typescript/module/ui/runtime/types.d.ts +89 -0
- package/lib/typescript/module/ui/runtime/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/runtime/useRuntimeSnapshot.d.ts +23 -0
- package/lib/typescript/module/ui/runtime/useRuntimeSnapshot.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/server.d.ts +0 -1
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/authStore.d.ts +60 -9
- package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/sharedDeviceCredentialStore.d.ts +32 -0
- package/lib/typescript/module/ui/session/sharedDeviceCredentialStore.d.ts.map +1 -0
- package/lib/typescript/module/ui/stores/authStore.d.ts +49 -5
- package/lib/typescript/module/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/followTargetStore.d.ts +8 -1
- package/lib/typescript/module/ui/stores/followTargetStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +26 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts +2 -10
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- package/package.json +8 -8
- package/plugins/withSharedDeviceSessionProvider.js +102 -0
- package/plugins/withSharedDeviceSessionReader.js +57 -0
- package/src/__tests__/esmSourcePurity.test.ts +61 -0
- package/src/index.ts +36 -9
- package/src/ui/boot/runProviderColdBoot.ts +7 -0
- package/src/ui/client.ts +1 -2
- package/src/ui/components/OxyAccountDialogScreen.tsx +10 -29
- package/src/ui/components/OxyAuthChooser.tsx +149 -50
- package/src/ui/components/OxyProvider.tsx +7 -5
- package/src/ui/components/SurfaceScreen.tsx +28 -4
- package/src/ui/components/__tests__/followTargetButton.test.ts +39 -0
- package/src/ui/components/authChooser/AccountsMenuView.tsx +246 -96
- package/src/ui/components/authChooser/SignInEntryView.tsx +31 -8
- package/src/ui/components/authChooser/primitives.tsx +37 -23
- package/src/ui/components/authChooser/signInProgress.ts +4 -0
- package/src/ui/components/authChooser/types.ts +34 -1
- package/src/ui/context/OxyContext.tsx +269 -324
- package/src/ui/context/hooks/useAuthOperations.ts +32 -35
- package/src/ui/context/oxyContextHelpers.ts +0 -30
- package/src/ui/context/oxyContextTypes.ts +9 -1
- package/src/ui/context/useOxyAccountGraph.ts +5 -19
- package/src/ui/hooks/accountDialogSnapshot.ts +37 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +0 -19
- package/src/ui/hooks/queries/__tests__/userCache.test.ts +12 -1
- package/src/ui/hooks/useDeviceSwitcher.ts +110 -0
- package/src/ui/hooks/useI18n.ts +23 -3
- package/src/ui/hooks/useSessionManagement.ts +62 -211
- package/src/ui/index.ts +1 -2
- package/src/ui/navigation/routes.ts +85 -75
- package/src/ui/navigation/surfaces.ts +6 -9
- package/src/ui/runtime/createOxyRuntime.ts +623 -0
- package/src/ui/runtime/index.ts +34 -0
- package/src/ui/runtime/runtimeContext.tsx +111 -0
- package/src/ui/runtime/types.ts +110 -0
- package/src/ui/runtime/useRuntimeSnapshot.ts +52 -0
- package/src/ui/screens/AccountMembersScreen.tsx +6 -5
- package/src/ui/screens/CreateAccountScreen.tsx +3 -16
- package/src/ui/screens/trust/TrustCenterScreen.tsx +7 -7
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +4 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustRulesScreen.tsx +3 -2
- package/src/ui/server.ts +0 -1
- package/src/ui/session/__tests__/authStore.test.ts +90 -0
- package/src/ui/session/__tests__/sharedDeviceCredentialStore.test.ts +289 -0
- package/src/ui/session/authStore.ts +78 -9
- package/src/ui/session/sharedDeviceCredentialStore.ts +318 -0
- package/src/ui/stores/authStore.ts +171 -43
- package/src/ui/stores/followTargetStore.ts +24 -1
- package/src/ui/types/navigation.ts +26 -0
- package/src/ui/utils/avatarUtils.ts +2 -37
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +0 -64
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +0 -1
- package/lib/commonjs/ui/screens/trust/trustTier.js +0 -23
- package/lib/commonjs/ui/screens/trust/trustTier.js.map +0 -1
- package/lib/commonjs/ui/stores/accountStore.js +0 -221
- package/lib/commonjs/ui/stores/accountStore.js.map +0 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +0 -60
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +0 -1
- package/lib/module/ui/screens/trust/trustTier.js +0 -19
- package/lib/module/ui/screens/trust/trustTier.js.map +0 -1
- package/lib/module/ui/stores/accountStore.js +0 -213
- package/lib/module/ui/stores/accountStore.js.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +0 -23
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +0 -9
- package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/stores/accountStore.d.ts +0 -27
- package/lib/typescript/commonjs/ui/stores/accountStore.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +0 -23
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +0 -9
- package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +0 -1
- package/lib/typescript/module/ui/stores/accountStore.d.ts +0 -27
- package/lib/typescript/module/ui/stores/accountStore.d.ts.map +0 -1
- package/src/ui/hooks/useSwitchableAccounts.ts +0 -75
- package/src/ui/screens/trust/trustTier.ts +0 -20
- package/src/ui/stores/accountStore.ts +0 -264
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UNKNOWN_FOLLOW_STATUS = void 0;
|
|
7
|
+
exports.followRecordToStatus = followRecordToStatus;
|
|
8
|
+
exports.followRecordsToStatusMap = followRecordsToStatusMap;
|
|
7
9
|
exports.isCompleteFollowStatus = isCompleteFollowStatus;
|
|
8
10
|
exports.isFollowedGlobally = isFollowedGlobally;
|
|
9
11
|
exports.useFollowTargetStore = void 0;
|
|
@@ -108,6 +110,31 @@ function isCompleteFollowStatus(status) {
|
|
|
108
110
|
return true;
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
/** Convert one list row into the status shape the follow-target store expects. */
|
|
114
|
+
function followRecordToStatus(record) {
|
|
115
|
+
return {
|
|
116
|
+
relationshipId: record.relationshipId,
|
|
117
|
+
globalState: record.globalState,
|
|
118
|
+
applicationMode: record.applicationMode,
|
|
119
|
+
effectiveState: record.effectiveState,
|
|
120
|
+
...(record.expiresAt ? {
|
|
121
|
+
expiresAt: record.expiresAt
|
|
122
|
+
} : {})
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Bulk-convert a follow list page into a status map keyed by target id — the
|
|
128
|
+
* input shape for `useFollowTargetStore.getState().seed(...)`.
|
|
129
|
+
*/
|
|
130
|
+
function followRecordsToStatusMap(records) {
|
|
131
|
+
const entries = {};
|
|
132
|
+
for (const record of records) {
|
|
133
|
+
entries[record.target.id] = followRecordToStatus(record);
|
|
134
|
+
}
|
|
135
|
+
return entries;
|
|
136
|
+
}
|
|
137
|
+
|
|
111
138
|
/**
|
|
112
139
|
* Apply a mode change to a cached status without a round trip.
|
|
113
140
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_zustand","require","UNKNOWN_FOLLOW_STATUS","exports","globalState","applicationMode","effectiveState","useFollowTargetStore","create","set","statuses","pending","errors","setStatus","targetId","status","s","seed","entries","setPending","setError","error","reset","isFollowedGlobally","isCompleteFollowStatus","Boolean","relationshipId","withApplicationMode","mode"],"sourceRoot":"../../../../src","sources":["ui/stores/followTargetStore.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_zustand","require","UNKNOWN_FOLLOW_STATUS","exports","globalState","applicationMode","effectiveState","useFollowTargetStore","create","set","statuses","pending","errors","setStatus","targetId","status","s","seed","entries","setPending","setError","error","reset","isFollowedGlobally","isCompleteFollowStatus","Boolean","relationshipId","followRecordToStatus","record","expiresAt","followRecordsToStatusMap","records","target","id","withApplicationMode","mode"],"sourceRoot":"../../../../src","sources":["ui/stores/followTargetStore.ts"],"mappings":";;;;;;;;;;;;AAwBA,IAAAA,QAAA,GAAAC,OAAA;AAxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,qBAAmC,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACjDE,WAAW,EAAE,MAAM;EACnBC,eAAe,EAAE,SAAS;EAC1BC,cAAc,EAAE;AAClB,CAAC;AAEM,MAAMC,oBAAoB,GAAAJ,OAAA,CAAAI,oBAAA,GAAG,IAAAC,eAAM,EAAqBC,GAAG,KAAM;EACtEC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC,CAAC;EAEVC,SAAS,EAAEA,CAACC,QAAQ,EAAEC,MAAM,KAC1BN,GAAG,CAAEO,CAAC,KAAM;IAAEN,QAAQ,EAAE;MAAE,GAAGM,CAAC,CAACN,QAAQ;MAAE,CAACI,QAAQ,GAAGC;IAAO;EAAE,CAAC,CAAC,CAAC;EAEnEE,IAAI,EAAGC,OAAO,IAAKT,GAAG,CAAEO,CAAC,KAAM;IAAEN,QAAQ,EAAE;MAAE,GAAGM,CAAC,CAACN,QAAQ;MAAE,GAAGQ;IAAQ;EAAE,CAAC,CAAC,CAAC;EAE5EC,UAAU,EAAEA,CAACL,QAAQ,EAAEH,OAAO,KAC5BF,GAAG,CAAEO,CAAC,KAAM;IAAEL,OAAO,EAAE;MAAE,GAAGK,CAAC,CAACL,OAAO;MAAE,CAACG,QAAQ,GAAGH;IAAQ;EAAE,CAAC,CAAC,CAAC;EAElES,QAAQ,EAAEA,CAACN,QAAQ,EAAEO,KAAK,KAAKZ,GAAG,CAAEO,CAAC,KAAM;IAAEJ,MA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EACA,OAAOV,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASgB,mBAAmBA,CACjCnB,MAAoB,EACpBoB,IAA2B,EACb;EACd,OAAO;IACL,GAAGpB,MAAM;IACTV,eAAe,EAAE8B,IAAI;IACrB7B,cAAc,EACZ6B,IAAI,KAAK,UAAU,GACf,eAAe,GACfpB,MAAM,CAACX,WAAW,KAAK,QAAQ,GAC7B,WAAW,GACXW,MAAM,CAACX,WAAW,KAAK,WAAW,GAChC,WAAW,GACX;EACZ,CAAC;AACH","ignoreList":[]}
|
|
@@ -3,34 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.refreshAvatarInStore = refreshAvatarInStore;
|
|
7
6
|
exports.updateProfileWithAvatar = updateProfileWithAvatar;
|
|
8
7
|
var _core = require("@oxyhq/core");
|
|
9
|
-
var _accountStore = require("../stores/accountStore.js");
|
|
10
8
|
var _authStore = require("../stores/authStore.js");
|
|
11
9
|
var _queryKeys = require("../hooks/queries/queryKeys.js");
|
|
12
10
|
var _userCache = require("../hooks/queries/userCache.js");
|
|
13
11
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param sessionId - The session ID for the account to update
|
|
17
|
-
* @param avatarFileId - The new avatar file ID
|
|
18
|
-
* @param oxyServices - OxyServices instance to generate download URL
|
|
19
|
-
*/
|
|
20
|
-
function refreshAvatarInStore(sessionId, avatarFileId, oxyServices) {
|
|
21
|
-
const {
|
|
22
|
-
updateAccount
|
|
23
|
-
} = _accountStore.useAccountStore.getState();
|
|
24
|
-
const cacheBustedUrl = `${oxyServices.getFileDownloadUrl(avatarFileId, 'thumb')}?t=${Date.now()}`;
|
|
25
|
-
updateAccount(sessionId, {
|
|
26
|
-
avatar: avatarFileId,
|
|
27
|
-
avatarUrl: cacheBustedUrl
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Updates user profile with avatar and handles all side effects (query invalidation, accountStore update).
|
|
33
|
-
* This function can be used from within OxyContext provider without requiring useOxy hook.
|
|
12
|
+
* Updates user profile with avatar and handles all side effects (cache writes,
|
|
13
|
+
* query invalidation). Usable from inside the provider without `useOxy`.
|
|
34
14
|
*
|
|
35
15
|
* @param updates - Profile updates including avatar
|
|
36
16
|
* @param oxyServices - OxyServices instance
|
|
@@ -55,20 +35,6 @@ async function updateProfileWithAvatar(updates, oxyServices, activeSessionId, qu
|
|
|
55
35
|
cleared: cleared.length > 0 ? cleared : undefined
|
|
56
36
|
});
|
|
57
37
|
|
|
58
|
-
// If avatar was updated, refresh accountStore with a cache-busted URL. An
|
|
59
|
-
// EMPTY avatar is a removal: clear both fields so the switcher falls back to
|
|
60
|
-
// initials instead of pointing at a download URL for the empty file id.
|
|
61
|
-
if (typeof updates.avatar === 'string' && activeSessionId) {
|
|
62
|
-
if (updates.avatar) {
|
|
63
|
-
refreshAvatarInStore(activeSessionId, updates.avatar, oxyServices);
|
|
64
|
-
} else {
|
|
65
|
-
_accountStore.useAccountStore.getState().updateAccount(activeSessionId, {
|
|
66
|
-
avatar: undefined,
|
|
67
|
-
avatarUrl: undefined
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
38
|
// Invalidate all related queries to refresh everywhere
|
|
73
39
|
(0, _queryKeys.invalidateUserQueries)(queryClient);
|
|
74
40
|
(0, _queryKeys.invalidateAccountQueries)(queryClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","
|
|
1
|
+
{"version":3,"names":["_core","require","_authStore","_queryKeys","_userCache","updateProfileWithAvatar","updates","oxyServices","activeSessionId","queryClient","syncSession","data","authenticatedApiCall","updateProfile","setQueryData","queryKeys","accounts","current","users","profile","useAuthStore","getState","setUser","cleared","clearedFieldsFromProfileUpdate","upsertCachedUser","id","length","undefined","invalidateUserQueries","invalidateAccountQueries"],"sourceRoot":"../../../../src","sources":["ui/utils/avatarUtils.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeI,uBAAuBA,CAC3CC,OAA0B,EAC1BC,WAAwB,EACxBC,eAA8B,EAC9BC,WAAwB,EACxBC,WAAiC,EAClB;EACf,MAAMC,IAAI,GAAG,MAAM,IAAAC,0BAAoB,EACrCL,WAAW,EACXC,eAAe,EACf,MAAMD,WAAW,CAACM,aAAa,CAACP,OAAO,CAAC,EACxCI,WACF,CAAC;;EAED;EACAD,WAAW,CAACK,YAAY,CAACC,oBAAS,CAACC,QAAQ,CAACC,OAAO,CAACT,eAAe,CAAC,EAAEG,IAAI,CAAC;EAC3E,IAAIH,eAAe,EAAE;IACnBC,WAAW,CAACK,YAAY,CAACC,oBAAS,CAACG,KAAK,CAACC,OAAO,CAACX,eAAe,CAAC,EAAEG,IAAI,CAAC;EAC1E;;EAEA;EACAS,uBAAY,CAACC,QAAQ,CAAC,CAAC,CAACC,OAAO,CAACX,IAAI,CAAC;EAErC,MAAMY,OAAO,GAAG,IAAAC,yCAA8B,EAAClB,OAAO,CAAC;EACvD,IAAAmB,2BAAgB,EAAChB,WAAW,EAAEE,IAAI,EAAEA,IAAI,CAACe,EAAE,EAAE;IAC3CH,OAAO,EAAEA,OAAO,CAACI,MAAM,GAAG,CAAC,GAAGJ,OAAO,GAAGK;EAC1C,CAAC,CAAC;;EAEF;EACA,IAAAC,gCAAqB,EAACpB,WAAW,CAAC;EAClC,IAAAqB,mCAAwB,EAACrB,WAAW,CAAC;EAErC,OAAOE,IAAI;AACb","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -35,6 +35,15 @@ setPlatformOS(Platform.OS);
|
|
|
35
35
|
// ---------------------------------------------------------------------------
|
|
36
36
|
export { default as OxyProvider } from "./ui/components/OxyProvider.js";
|
|
37
37
|
export { useOxy } from "./ui/context/OxyContext.js";
|
|
38
|
+
// `useOxy()` THROWS when no provider is mounted. `useOptionalOxy()` returns
|
|
39
|
+
// `null` instead, for the rare component that renders on both sides of the
|
|
40
|
+
// provider boundary; there is no fabricated forever-loading runtime.
|
|
41
|
+
export { useOptionalOxy, OxyProviderMissingError } from "./ui/context/OxyContext.js";
|
|
42
|
+
|
|
43
|
+
// The runtime surface (ADR 0004). These subscribe to the ONE runtime with a
|
|
44
|
+
// selector, so — unlike `useOxy()`, whose value is rebuilt by any of its fifty
|
|
45
|
+
// members moving — a locale change or a dialog opening does not re-render them.
|
|
46
|
+
export { useOxyRuntime, useOxySnapshot, useActiveAccount, useDeviceDirectory, OxyRuntimeMissingError } from "./ui/runtime/index.js";
|
|
38
47
|
export { useAuth } from "./ui/hooks/useAuth.js";
|
|
39
48
|
// Thrown by `switchToAccount` / `switchSession` while `OxyProvider` runs with
|
|
40
49
|
// `sessionMode="identity"` — an identity-bound app authenticates as the owner of
|
|
@@ -45,7 +54,6 @@ export { IdentityBoundSessionError } from "./ui/session/identityBinding.js";
|
|
|
45
54
|
// Zustand stores
|
|
46
55
|
// ---------------------------------------------------------------------------
|
|
47
56
|
export { useAuthStore } from "./ui/stores/authStore.js";
|
|
48
|
-
export { useAccountStore } from "./ui/stores/accountStore.js";
|
|
49
57
|
export { useAssetStore, useAssets as useAssetsStore, useAsset, useUploadProgress, useAssetLoading, useAssetErrors, useAssetsByApp, useAssetsByEntity, useAssetUsageCount, useIsAssetLinked } from "./ui/stores/assetStore.js";
|
|
50
58
|
|
|
51
59
|
// ---------------------------------------------------------------------------
|
|
@@ -158,7 +166,10 @@ export { useFollowTargetStore, UNKNOWN_FOLLOW_STATUS,
|
|
|
158
166
|
// The answer to "does the user follow this at all". Documented in
|
|
159
167
|
// docs/FOLLOWS.md and, until now, not exported — so the one line of that
|
|
160
168
|
// guide most likely to be reached for did not resolve.
|
|
161
|
-
isFollowedGlobally, withApplicationMode
|
|
169
|
+
isFollowedGlobally, withApplicationMode,
|
|
170
|
+
// Whether a cached status is safe to act on without a round trip — list rows
|
|
171
|
+
// often carry globalState without relationshipId.
|
|
172
|
+
isCompleteFollowStatus, followRecordToStatus, followRecordsToStatusMap } from "./ui/stores/followTargetStore.js";
|
|
162
173
|
export { default as OxyPayButton } from "./ui/components/OxyPayButton.js";
|
|
163
174
|
export { LogoIcon } from "./ui/components/logo/LogoIcon.js";
|
|
164
175
|
export { LogoText } from "./ui/components/logo/LogoText.js";
|
|
@@ -182,13 +193,13 @@ export { default as OxyAuthChooser } from "./ui/components/OxyAuthChooser.js";
|
|
|
182
193
|
// no controller: `route` + `progress` + `qrPayload` + the failure flags are the
|
|
183
194
|
// whole contract, and none of them is a secret credential.
|
|
184
195
|
export { OxySignInRequestSurface } from "./ui/components/OxySignInRequestSurface.js";
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
//
|
|
188
|
-
//
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
export {
|
|
196
|
+
// The device switcher — the server's own directory (ADR 0002) of who is signed
|
|
197
|
+
// in here and what each of them may act as, grouped by PERSON, with the two
|
|
198
|
+
// removals an account id cannot name. Backed by the shared
|
|
199
|
+
// `AccountDialogController` in `@oxyhq/core`; selecting a row activates a
|
|
200
|
+
// `contextId`. `DevicePrincipalGroup` and `DeviceContext` live in `@oxyhq/core`
|
|
201
|
+
// — import them from there.
|
|
202
|
+
export { useDeviceSwitcher } from "./ui/hooks/useDeviceSwitcher.js";
|
|
192
203
|
// Unified "Manage your Oxy Account" screen (the caller's own personal account)
|
|
193
204
|
export { default as ProfileScreen } from "./ui/screens/ProfileScreen.js";
|
|
194
205
|
export { default as ManageAccountScreen } from "./ui/screens/ManageAccountScreen.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["setPlatformOS","Platform","OS","default","OxyProvider","useOxy","useAuth","IdentityBoundSessionError","useAuthStore","
|
|
1
|
+
{"version":3,"names":["setPlatformOS","Platform","OS","default","OxyProvider","useOxy","useOptionalOxy","OxyProviderMissingError","useOxyRuntime","useOxySnapshot","useActiveAccount","useDeviceDirectory","OxyRuntimeMissingError","useAuth","IdentityBoundSessionError","useAuthStore","useAssetStore","useAssets","useAssetsStore","useAsset","useUploadProgress","useAssetLoading","useAssetErrors","useAssetsByApp","useAssetsByEntity","useAssetUsageCount","useIsAssetLinked","setOxyAssetInstance","useFileDownloadUrl","useFollow","useFollowerCounts","useSeedFollowStatuses","useStorage","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useUsersBySessions","usePrivacySettings","useConnectedApps","useSessions","useSession","useDeviceSessions","useUserDevices","useSecurityInfo","useAccountStorageUsage","useSecurityActivity","useRecentSecurityActivity","useInfiniteSecurityActivity","useAuthMethods","useUserSubscription","useUserPayments","useUserWallet","useUserWalletTransactions","useUpdateProfile","useUploadAvatar","useUpdateAccountSettings","useUpdatePrivacySettings","useUpdateNotificationPreferences","useUpdateUserPreferences","useRevokeConnectedApp","useUploadFile","useSwitchSession","useLogoutSession","useLogoutAll","useUpdateDeviceName","useRemoveDevice","createProfileMutation","createGenericMutation","mutationKeys","queryKeys","invalidateAccountQueries","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries","invalidateAuthMethodsQueries","upsertCachedUser","upsertCachedUsers","CLEARABLE_USER_FIELDS","clearedFieldsFromProfileUpdate","clearedFieldsFromAccountUpdate","useMutationStatus","useOnlineStatus","useOxyEvent","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage","useFileFiltering","OXY_OAUTH_STATE_STORAGE_KEY","OXY_OAUTH_CODE_VERIFIER_STORAGE_KEY","OxySignInButton","openOAuthPopup","OxyAuthPrompt","OxyOAuthCallback","OxyConsentScreen","RequireOxyAuth","FollowButton","FollowTargetButton","buildFollowMenuItems","resolveFollowPrimaryAction","FOLLOW_ACTION_LEAVES_ACTIVE","useFollowTarget","useFollowTargetStore","UNKNOWN_FOLLOW_STATUS","isFollowedGlobally","withApplicationMode","isCompleteFollowStatus","followRecordToStatus","followRecordsToStatusMap","OxyPayButton","LogoIcon","LogoText","ProfileButton","OxyAuthChooser","OxySignInRequestSurface","useDeviceSwitcher","ProfileScreen","ManageAccountScreen","NotificationsScreen","PreferencesScreen","ConnectedAppsScreen","CreateAccountScreen","AccountMembersScreen","AccountSettingsScreen","showBottomSheet","closeBottomSheet","useSurfaceHeader","SurfaceHeaderAction","openAccountDialog","closeAccountDialog","subscribeToAccountDialog"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,SAASA,aAAa,QAAyB,aAAa;AAC5D,SAASC,QAAQ,QAAQ,cAAc;AACvCD,aAAa,CAACC,QAAQ,CAACC,EAAgB,CAAC;;AAExC;AACA;AACA;AACA,SAASC,OAAO,IAAIC,WAAW,QAAQ,gCAA6B;AACpE,SAASC,MAAM,QAAQ,4BAAyB;AAChD;AACA;AACA;AACA,SAASC,cAAc,EAAEC,uBAAuB,QAAQ,4BAAyB;;AAEjF;AACA;AACA;AACA,SACEC,aAAa,EACbC,cAAc,EACdC,gBAAgB,EAChBC,kBAAkB,EAClBC,sBAAsB,QACjB,uBAAc;AAUrB,SAASC,OAAO,QAAQ,uBAAoB;AAE5C;AACA;AACA;AACA,SAASC,yBAAyB,QAAQ,iCAA8B;;AAExE;AACA;AACA;AACA,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SACIC,aAAa,EACbC,SAAS,IAAIC,cAAc,EAC3BC,QAAQ,EACRC,iBAAiB,EACjBC,eAAe,EACf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AAO,IAAIiH,YAAY,QAAQ,iCAA8B;AACtE,SAASC,QAAQ,QAAQ,kCAA+B;AACxD,SAASC,QAAQ,QAAQ,kCAA+B;;AAExD;AACA;AACA;AACA,SAASnH,OAAO,IAAIoH,aAAa,QAAQ,kCAA+B;AAIxE;AACA;AACA;AACA;AACA;AACA,SAASpH,OAAO,IAAIqH,cAAc,QAAQ,mCAAgC;AAG1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,4CAAyC;AAIjF;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,iCAA8B;AAGhE;AACA,SAASvH,OAAO,IAAIwH,aAAa,QAAQ,+BAA4B;AACrE,SAASxH,OAAO,IAAIyH,mBAAmB,QAAQ,qCAAkC;AACjF,SAASzH,OAAO,IAAI0H,mBAAmB,QAAQ,qCAAkC;AACjF,SAAS1H,OAAO,IAAI2H,iBAAiB,QAAQ,mCAAgC;AAC7E,SAAS3H,OAAO,IAAI4H,mBAAmB,QAAQ,qCAAkC;;AAEjF;AACA,SAAS5H,OAAO,IAAI6H,mBAAmB,QAAQ,qCAAkC;AACjF,SAAS7H,OAAO,IAAI8H,oBAAoB,QAAQ,sCAAmC;AACnF,SAAS9H,OAAO,IAAI+H,qBAAqB,QAAQ,uCAAoC;;AAErF;AACA;AACA;AACA,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,uCAAoC;AAGtF;AACA;AACA;AACA,SAASC,gBAAgB,QAAmC,gCAA6B;AACzF,SAASC,mBAAmB,QAAuC,wCAAqC;;AAExG;AACA;AACA;AACA;AACA,SACEC,iBAAiB,EACjBC,kBAAkB,EAClBC,wBAAwB,QACnB,yCAAsC","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { logger as loggerUtil, runSessionColdBoot } from '@oxyhq/core';
|
|
4
4
|
import { loadPersistedDeviceCredential } from "../utils/deviceCredential.js";
|
|
5
|
+
import { createPlatformSharedDeviceCredentialStore } from "../session/sharedDeviceCredentialStore.js";
|
|
5
6
|
import { tryCompleteOAuthReturn } from "../utils/oauthReturn.js";
|
|
6
7
|
import { isWebBrowser } from "../utils/isWebBrowser.js";
|
|
7
8
|
import { isNetConnectivityExplicitlyOffline } from "../utils/netConnectivity.js";
|
|
@@ -126,6 +127,12 @@ export async function runProviderColdBoot(opts) {
|
|
|
126
127
|
},
|
|
127
128
|
sessionMode,
|
|
128
129
|
identity,
|
|
130
|
+
// The device-wide shared credential slot, enabling the `shared-device-adopt`
|
|
131
|
+
// lane: a newly installed official app joins this device's existing session
|
|
132
|
+
// instead of falling back to signing a challenge with the Commons identity
|
|
133
|
+
// key. `null` on web, where each origin is its own device by design; the
|
|
134
|
+
// core lane is also skipped outright in `sessionMode: 'identity'`.
|
|
135
|
+
sharedDeviceCredential: createPlatformSharedDeviceCredentialStore() ?? undefined,
|
|
129
136
|
overallDeadlineMs: COLD_BOOT_OVERALL_DEADLINE_MS,
|
|
130
137
|
isOffline: () => offline,
|
|
131
138
|
onStepDeadline: stepId => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["logger","loggerUtil","runSessionColdBoot","loadPersistedDeviceCredential","tryCompleteOAuthReturn","isWebBrowser","isNetConnectivityExplicitlyOffline","SESSION_HANDOFF_DEADLINE_MS","COLD_BOOT_OVERALL_DEADLINE_MS","OFFLINE_PROBE_TIMEOUT_MS","detectOfflineHint","online","globalThis","navigator","onLine","NetInfo","state","Promise","race","default","fetch","resolve","setTimeout","runProviderColdBoot","opts","oxyServices","authStore","clientId","authRedirectUri","sessionMode","identity","sessionClient","syncDeviceCredentialToHost","commitSession","markAuthResolved","setTokenReady","identityBound","oauthCompleted","input","activate","offline","oxy","store","platform","isWeb","isNative","overallDeadlineMs","isOffline","onStepDeadline","stepId","warn","component","method","onSession","session","handoff","sessionId","accessToken","userId","handoffDeadlineId","finally","
|
|
1
|
+
{"version":3,"names":["logger","loggerUtil","runSessionColdBoot","loadPersistedDeviceCredential","createPlatformSharedDeviceCredentialStore","tryCompleteOAuthReturn","isWebBrowser","isNetConnectivityExplicitlyOffline","SESSION_HANDOFF_DEADLINE_MS","COLD_BOOT_OVERALL_DEADLINE_MS","OFFLINE_PROBE_TIMEOUT_MS","detectOfflineHint","online","globalThis","navigator","onLine","NetInfo","state","Promise","race","default","fetch","resolve","setTimeout","runProviderColdBoot","opts","oxyServices","authStore","clientId","authRedirectUri","sessionMode","identity","sessionClient","syncDeviceCredentialToHost","commitSession","markAuthResolved","setTokenReady","identityBound","oauthCompleted","input","activate","offline","oxy","store","platform","isWeb","isNative","sharedDeviceCredential","undefined","overallDeadlineMs","isOffline","onStepDeadline","stepId","warn","component","method","onSession","session","handoff","sessionId","accessToken","userId","handoffDeadlineId","finally","clearTimeout","onSignedOut","cred","start","socketError","__DEV__","debug","onStepError","id","error","Error","String"],"sourceRoot":"../../../../src","sources":["ui/boot/runProviderColdBoot.ts"],"mappings":";;AAAA,SACEA,MAAM,IAAIC,UAAU,EACpBC,kBAAkB,QAKb,aAAa;AAEpB,SAASC,6BAA6B,QAAQ,8BAA2B;AACzE,SAASC,yCAAyC,QAAQ,2CAAwC;AAClG,SAASC,sBAAsB,QAAQ,yBAAsB;AAC7D,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,kCAAkC,QAAQ,6BAA0B;AAG7E;AACA,OAAO,MAAMC,2BAA2B,GAAG,IAAI;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAG,MAAM;;AAEnD;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,GAAG;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,iBAAiBA,CAAA,EAAqB;EACnD,IAAI;IACF,IAAIL,YAAY,CAAC,CAAC,EAAE;MAClB,MAAMM,MAAM,GAAIC,UAAU,CAA0CC,SAAS,EAAEC,MAAM;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C;QACF,CAAC,CAAC;QACF3B,gBAAgB,CAAC,CAAC;MACpB,CAAC;MACD8B,WAAW,EAAE,MAAAA,CAAA,KAAY;QACvB,MAAMhC,0BAA0B,CAAC,CAAC;QAClC,MAAMiC,IAAI,GAAG,MAAM/D,6BAA6B,CAACwB,SAAS,CAAC;QAC3D,IAAIuC,IAAI,EAAE;UACR,IAAI;YACF,MAAMlC,aAAa,CAACmC,KAAK,CAAC,CAAC;UAC7B,CAAC,CAAC,OAAOC,WAAW,EAAE;YACpB,IAAIC,OAAO,EAAE;cACXpE,UAAU,CAACqE,KAAK,CACd,wCAAwC,EACxC;gBAAEhB,SAAS,EAAE;cAAsB,CAAC,EACpCc,WACF,CAAC;YACH;UACF;QACF;QACAjC,gBAAgB,CAAC,CAAC;MACpB,CAAC;MACDoC,WAAW,EAAEA,CAACC,EAAE,EAAEC,KAAK,KAAK;QAC1B,IAAIJ,OAAO,EAAE;UACXpE,UAAU,CAACqE,KAAK,CACd,mBAAmBE,EAAE,wCAAwC,EAC7D;YAAElB,SAAS,EAAE;UAAsB,CAAC,EACpCmB,KACF,CAAC;QACH;MACF;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOA,KAAK,EAAE;IACd,IAAIJ,OAAO,EAAE;MACXpE,UAAU,CAACwE,KAAK,CACd,iBAAiB,EACjBA,KAAK,YAAYC,KAAK,GAAGD,KAAK,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACF,KAAK,CAAC,CAAC,EACzD;QAAEnB,SAAS,EAAE;MAAsB,CACrC,CAAC;IACH;EACF,CAAC,SAAS;IACRnB,gBAAgB,CAAC,CAAC;EACpB;AACF","ignoreList":[]}
|
package/lib/module/ui/client.js
CHANGED
|
@@ -20,7 +20,7 @@ export { default as FollowButton } from "./components/FollowButton.js";
|
|
|
20
20
|
export { default as OxyPayButton } from "./components/OxyPayButton.js";
|
|
21
21
|
|
|
22
22
|
// Context
|
|
23
|
-
export { useOxy } from "./context/OxyContext.js";
|
|
23
|
+
export { useOxy, useOptionalOxy, OxyProviderMissingError } from "./context/OxyContext.js";
|
|
24
24
|
|
|
25
25
|
// Hooks
|
|
26
26
|
export { useAuth } from "./hooks/useAuth.js";
|
|
@@ -32,7 +32,6 @@ export { default as ManageAccountScreen } from "./screens/ManageAccountScreen.js
|
|
|
32
32
|
|
|
33
33
|
// Stores
|
|
34
34
|
export { useAuthStore } from "./stores/authStore.js";
|
|
35
|
-
export { useAccountStore } from "./stores/accountStore.js";
|
|
36
35
|
|
|
37
36
|
// Error handler utilities
|
|
38
37
|
export { handleAuthError, isInvalidSessionError, isTimeoutOrNetworkError, extractErrorMessage } from "./utils/errorHandlers.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","OxyProvider","OxySignInButton","OxyAuthPrompt","LogoIcon","LogoText","FollowButton","OxyPayButton","useOxy","useAuth","useFollow","useStorage","ProfileScreen","ManageAccountScreen","useAuthStore","
|
|
1
|
+
{"version":3,"names":["default","OxyProvider","OxySignInButton","OxyAuthPrompt","LogoIcon","LogoText","FollowButton","OxyPayButton","useOxy","useOptionalOxy","OxyProviderMissingError","useAuth","useFollow","useStorage","ProfileScreen","ManageAccountScreen","useAuthStore","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage"],"sourceRoot":"../../../src","sources":["ui/client.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,6BAA0B;AACjE,SAASD,OAAO,IAAIE,eAAe,QAAQ,iCAA8B;AACzE,SAASF,OAAO,IAAIG,aAAa,QAAQ,+BAA4B;AAErE,SAASC,QAAQ,QAAQ,+BAA4B;AACrD,SAASC,QAAQ,QAAQ,+BAA4B;AACrD,SAASL,OAAO,IAAIM,YAAY,QAAQ,8BAA2B;AACnE,SAASN,OAAO,IAAIO,YAAY,QAAQ,8BAA2B;;AAEnE;AACA,SAASC,MAAM,EAAEC,cAAc,EAAEC,uBAAuB,QAAQ,yBAAsB;;AAEtF;AACA,SAASC,OAAO,QAAQ,oBAAiB;AAEzC,SAASC,SAAS,QAAQ,sBAAmB;AAC7C,SAASC,UAAU,QAAQ,uBAAoB;AAG/C;AACA,SAASb,OAAO,IAAIc,aAAa,QAAQ,4BAAyB;AAClE,SAASd,OAAO,IAAIe,mBAAmB,QAAQ,kCAA+B;;AAE9E;AACA,SAASC,YAAY,QAAQ,uBAAoB;;AAEjD;AACA,SACIC,eAAe,EACfC,qBAAqB,EACrBC,uBAAuB,EACvBC,mBAAmB,QAChB,0BAAuB","ignoreList":[]}
|
|
@@ -30,6 +30,7 @@ import { useI18n } from "../hooks/useI18n.js";
|
|
|
30
30
|
import { useSurfaceHeader } from "../hooks/useSurfaceHeader.js";
|
|
31
31
|
import LogoText from "./logo/LogoText.js";
|
|
32
32
|
import OxyAuthChooser from "./OxyAuthChooser.js";
|
|
33
|
+
import { EMPTY_ACCOUNT_DIALOG_SNAPSHOT } from "../hooks/accountDialogSnapshot.js";
|
|
33
34
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
35
|
/**
|
|
35
36
|
* The account MENU's nav bar carries the Oxy wordmark instead of a title — the
|
|
@@ -67,14 +68,17 @@ const OxyAccountDialogScreen = ({
|
|
|
67
68
|
|
|
68
69
|
// A lightweight, header-only binding to the same controller `OxyAuthChooser`
|
|
69
70
|
// binds independently — cheap, and the established pattern here (
|
|
70
|
-
// `
|
|
71
|
+
// `useDeviceSwitcher` also binds to this controller on its own).
|
|
71
72
|
const subscribe = useCallback(listener => controller ? controller.subscribe(listener) : () => undefined, [controller]);
|
|
72
|
-
const getSnapshot = useCallback(() => controller ? controller.getSnapshot() :
|
|
73
|
+
const getSnapshot = useCallback(() => controller ? controller.getSnapshot() : EMPTY_ACCOUNT_DIALOG_SNAPSHOT, [controller]);
|
|
73
74
|
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
74
75
|
const {
|
|
75
76
|
view
|
|
76
77
|
} = snapshot;
|
|
77
|
-
|
|
78
|
+
// "Add another account" only makes sense as a back destination when there IS
|
|
79
|
+
// another — i.e. somebody is already signed in on this device.
|
|
80
|
+
const hasSignedInAccounts = (snapshot.directory?.principals.length ?? 0) > 0;
|
|
81
|
+
const showBack = view === 'qr' || view === 'signup' || view === 'add' && hasSignedInAccounts;
|
|
78
82
|
const goToAccounts = useCallback(() => {
|
|
79
83
|
if (!controller) return;
|
|
80
84
|
const {
|
|
@@ -100,7 +104,7 @@ const OxyAccountDialogScreen = ({
|
|
|
100
104
|
// by the bar. Every OTHER view keeps the SHARED Dialog nav header the rest of
|
|
101
105
|
// the SDK uses — a large in-content title/subtitle that collapses into the bar
|
|
102
106
|
// on scroll — because their copy is informative.
|
|
103
|
-
const copy = view === 'accounts' ? null : headerCopy(view,
|
|
107
|
+
const copy = view === 'accounts' ? null : headerCopy(view, hasSignedInAccounts, t);
|
|
104
108
|
useSurfaceHeader({
|
|
105
109
|
titleContent: copy ? undefined : NAV_LOGO,
|
|
106
110
|
title: copy?.title,
|
|
@@ -122,7 +126,7 @@ const OxyAccountDialogScreen = ({
|
|
|
122
126
|
// Copy + helpers
|
|
123
127
|
// ---------------------------------------------------------------------------
|
|
124
128
|
|
|
125
|
-
function headerCopy(view,
|
|
129
|
+
function headerCopy(view, hasSignedInAccounts, t) {
|
|
126
130
|
switch (view) {
|
|
127
131
|
// The ACTIVE REQUEST. Its header is deliberately route-AGNOSTIC: Oxy picks
|
|
128
132
|
// the delivery route (QR here, a push to the user's phone, or opening
|
|
@@ -141,7 +145,7 @@ function headerCopy(view, accountCount, t) {
|
|
|
141
145
|
subtitle: t('signup.subtitle') || 'One identity for the whole ecosystem.'
|
|
142
146
|
};
|
|
143
147
|
default:
|
|
144
|
-
return
|
|
148
|
+
return hasSignedInAccounts ? {
|
|
145
149
|
title: t('signin.addAccountTitle') || 'Add another account',
|
|
146
150
|
subtitle: t('signin.addAccountSubtitle') || 'Sign in with another account.'
|
|
147
151
|
} : {
|
|
@@ -150,27 +154,6 @@ function headerCopy(view, accountCount, t) {
|
|
|
150
154
|
};
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
|
-
const EMPTY_SNAPSHOT = {
|
|
154
|
-
view: 'accounts',
|
|
155
|
-
accounts: [],
|
|
156
|
-
activeAccountId: null,
|
|
157
|
-
loading: false,
|
|
158
|
-
error: null,
|
|
159
|
-
switchingAccountId: null,
|
|
160
|
-
signIn: {
|
|
161
|
-
phase: 'idle',
|
|
162
|
-
authorizeCode: null,
|
|
163
|
-
qrPayload: null,
|
|
164
|
-
expiresAt: null,
|
|
165
|
-
error: null,
|
|
166
|
-
route: null,
|
|
167
|
-
routeFailed: false,
|
|
168
|
-
pushSentAt: null,
|
|
169
|
-
openedAt: null,
|
|
170
|
-
progress: 'idle'
|
|
171
|
-
},
|
|
172
|
-
commonsAvailability: 'unknown'
|
|
173
|
-
};
|
|
174
157
|
|
|
175
158
|
/**
|
|
176
159
|
* The screen gutter. In the Dialog's nav-header mode the surface adds NO content
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useSyncExternalStore","StyleSheet","View","useOxy","useI18n","useSurfaceHeader","LogoText","OxyAuthChooser","jsx","_jsx","NAV_LOGO","height","OxyAccountDialogScreen","canGoBack","accountDialogController","controller","closeAccountDialog","t","subscribe","listener","undefined","getSnapshot","
|
|
1
|
+
{"version":3,"names":["useCallback","useSyncExternalStore","StyleSheet","View","useOxy","useI18n","useSurfaceHeader","LogoText","OxyAuthChooser","EMPTY_ACCOUNT_DIALOG_SNAPSHOT","jsx","_jsx","NAV_LOGO","height","OxyAccountDialogScreen","canGoBack","accountDialogController","controller","closeAccountDialog","t","subscribe","listener","undefined","getSnapshot","snapshot","view","hasSignedInAccounts","directory","principals","length","showBack","goToAccounts","currentView","signIn","phase","cancelSignIn","setView","backsToHost","copy","headerCopy","titleContent","title","subtitle","onBack","style","styles","bodyContent","children","onComplete","SCREEN_MARGIN","create","paddingTop","paddingBottom","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["ui/components/OxyAccountDialogScreen.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,WAAW,EAAEC,oBAAoB,QAAQ,OAAO;AACzD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,MAAM,QAAQ,0BAAuB;AAC9C,SAASC,OAAO,QAAQ,qBAAkB;AAC1C,SAASC,gBAAgB,QAAQ,8BAA2B;AAE5D,OAAOC,QAAQ,MAAM,oBAAiB;AACtC,OAAOC,cAAc,MAAM,qBAAkB;AAC7C,SAASC,6BAA6B,QAAQ,mCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI/E;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,gBAAGD,IAAA,CAACJ,QAAQ;EAACM,MAAM,EAAE;AAAG,CAAE,CAAC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAiD,GAAGA,CAAC;EAAEC;AAAU,CAAC,KAAK;EAC3E,MAAM;IAAEC,uBAAuB,EAAEC,UAAU;IAAEC;EAAmB,CAAC,GAAGd,MAAM,CAAC,CAAC;EAC5E,MAAM;IAAEe;EAAE,CAAC,GAAGd,OAAO,CAAC,CAAC;;EAEvB;EACA;EACA;EACA,MAAMe,SAAS,GAAGpB,WAAW,CAC1BqB,QAAoB,IAAMJ,UAAU,GAAGA,UAAU,CAACG,SAAS,CAACC,QAAQ,CAAC,GAAG,MAAMC,SAAU,EACzF,CAACL,UAAU,CACb,CAAC;EACD,MAAMM,WAAW,GAAGvB,WAAW,CAC7B,MAAOiB,UAAU,GAAGA,UAAU,CAACM,WAAW,CAAC,CAAC,GAAGd,6BAA8B,EAC7E,CAACQ,UAAU,CACb,CAAC;EACD,MAAMO,QAA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