@oxyhq/services 16.0.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/README.md +77 -98
  2. package/lib/commonjs/index.js +40 -51
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/ui/client.js +0 -14
  5. package/lib/commonjs/ui/client.js.map +1 -1
  6. package/lib/commonjs/ui/components/OxyAccountDialog.js +742 -0
  7. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
  8. package/lib/commonjs/ui/components/OxyConsentScreen.js +461 -0
  9. package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -0
  10. package/lib/commonjs/ui/components/OxyProvider.js +13 -6
  11. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  12. package/lib/commonjs/ui/components/OxySignInButton.js +180 -22
  13. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  14. package/lib/commonjs/ui/components/ProfileButton.js +25 -112
  15. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  16. package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
  17. package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
  18. package/lib/commonjs/ui/components/oauthNavigation.js +73 -0
  19. package/lib/commonjs/ui/components/oauthNavigation.js.map +1 -0
  20. package/lib/commonjs/ui/context/OxyContext.js +122 -4
  21. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  22. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
  23. package/lib/commonjs/ui/hooks/useAuth.js +19 -30
  24. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
  26. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
  27. package/lib/commonjs/ui/index.js +5 -40
  28. package/lib/commonjs/ui/index.js.map +1 -1
  29. package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
  30. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
  31. package/lib/commonjs/ui/navigation/routes.js +0 -2
  32. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  33. package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
  34. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  35. package/lib/commonjs/ui/session/createSessionClient.js +10 -2
  36. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  37. package/lib/module/index.js +19 -16
  38. package/lib/module/index.js.map +1 -1
  39. package/lib/module/ui/client.js +1 -2
  40. package/lib/module/ui/client.js.map +1 -1
  41. package/lib/module/ui/components/OxyAccountDialog.js +739 -0
  42. package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
  43. package/lib/module/ui/components/OxyConsentScreen.js +454 -0
  44. package/lib/module/ui/components/OxyConsentScreen.js.map +1 -0
  45. package/lib/module/ui/components/OxyProvider.js +13 -6
  46. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  47. package/lib/module/ui/components/OxySignInButton.js +181 -22
  48. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  49. package/lib/module/ui/components/ProfileButton.js +26 -112
  50. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  51. package/lib/module/ui/components/RequireOxyAuth.js +294 -0
  52. package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
  53. package/lib/module/ui/components/oauthNavigation.js +70 -0
  54. package/lib/module/ui/components/oauthNavigation.js.map +1 -0
  55. package/lib/module/ui/context/OxyContext.js +123 -5
  56. package/lib/module/ui/context/OxyContext.js.map +1 -1
  57. package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
  58. package/lib/module/ui/hooks/useAuth.js +19 -30
  59. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  60. package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
  61. package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
  62. package/lib/module/ui/index.js +1 -5
  63. package/lib/module/ui/index.js.map +1 -1
  64. package/lib/module/ui/navigation/accountDialogManager.js +81 -0
  65. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
  66. package/lib/module/ui/navigation/routes.js +0 -2
  67. package/lib/module/ui/navigation/routes.js.map +1 -1
  68. package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
  69. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  70. package/lib/module/ui/session/createSessionClient.js +10 -2
  71. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  72. package/lib/typescript/commonjs/index.d.ts +8 -12
  73. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/client.d.ts +0 -4
  75. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +51 -0
  77. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts +45 -0
  79. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
  81. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +56 -0
  83. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
  85. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
  87. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts +36 -0
  89. package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +27 -1
  91. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +1 -1
  94. package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  97. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/ui/index.d.ts +2 -5
  99. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
  101. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  103. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  105. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
  107. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -0
  109. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  110. package/lib/typescript/module/index.d.ts +8 -12
  111. package/lib/typescript/module/index.d.ts.map +1 -1
  112. package/lib/typescript/module/ui/client.d.ts +0 -4
  113. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  114. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +51 -0
  115. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
  116. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts +45 -0
  117. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -0
  118. package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
  119. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  120. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +56 -0
  121. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  122. package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
  123. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  124. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
  125. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
  126. package/lib/typescript/module/ui/components/oauthNavigation.d.ts +36 -0
  127. package/lib/typescript/module/ui/components/oauthNavigation.d.ts.map +1 -0
  128. package/lib/typescript/module/ui/context/OxyContext.d.ts +27 -1
  129. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  130. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  131. package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +1 -1
  132. package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  133. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  134. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  135. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  136. package/lib/typescript/module/ui/index.d.ts +2 -5
  137. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  138. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
  139. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
  140. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  141. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  142. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  143. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  144. package/lib/typescript/module/ui/session/createSessionClient.d.ts +9 -2
  145. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  146. package/lib/typescript/module/ui/types/navigation.d.ts +27 -0
  147. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  148. package/package.json +4 -4
  149. package/src/index.ts +33 -27
  150. package/src/ui/client.ts +0 -4
  151. package/src/ui/components/OxyAccountDialog.tsx +735 -0
  152. package/src/ui/components/OxyConsentScreen.tsx +456 -0
  153. package/src/ui/components/OxyProvider.tsx +14 -6
  154. package/src/ui/components/OxySignInButton.tsx +227 -22
  155. package/src/ui/components/ProfileButton.tsx +23 -126
  156. package/src/ui/components/RequireOxyAuth.tsx +266 -0
  157. package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +130 -0
  158. package/src/ui/components/oauthNavigation.ts +89 -0
  159. package/src/ui/context/OxyContext.tsx +176 -9
  160. package/src/ui/context/__tests__/OxyContext.coldBoot.test.tsx +165 -0
  161. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  162. package/src/ui/hooks/useAuth.ts +19 -31
  163. package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
  164. package/src/ui/index.ts +2 -5
  165. package/src/ui/navigation/accountDialogManager.ts +84 -0
  166. package/src/ui/navigation/routes.ts +0 -4
  167. package/src/ui/screens/ManageAccountScreen.tsx +3 -2
  168. package/src/ui/session/createSessionClient.ts +9 -1
  169. package/src/ui/types/navigation.ts +27 -0
  170. package/lib/commonjs/ui/components/AccountMenu.js +0 -598
  171. package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
  172. package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
  173. package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
  174. package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
  175. package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
  176. package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
  177. package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
  178. package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
  179. package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
  180. package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
  181. package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
  182. package/lib/commonjs/ui/components/SignInModal.js +0 -600
  183. package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
  184. package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
  185. package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
  186. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
  187. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
  188. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
  189. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  190. package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
  191. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
  192. package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
  193. package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
  194. package/lib/module/ui/components/AccountMenu.js +0 -593
  195. package/lib/module/ui/components/AccountMenu.js.map +0 -1
  196. package/lib/module/ui/components/AccountMenuButton.js +0 -130
  197. package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
  198. package/lib/module/ui/components/AccountSwitcher.js +0 -774
  199. package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
  200. package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
  201. package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
  202. package/lib/module/ui/components/ProfileMenu.js +0 -514
  203. package/lib/module/ui/components/ProfileMenu.js.map +0 -1
  204. package/lib/module/ui/components/SignInAccountChooser.js +0 -183
  205. package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
  206. package/lib/module/ui/components/SignInModal.js +0 -591
  207. package/lib/module/ui/components/SignInModal.js.map +0 -1
  208. package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
  209. package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
  210. package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
  211. package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
  212. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
  213. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  214. package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
  215. package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
  216. package/lib/module/utils/deviceFlowSignIn.js +0 -106
  217. package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
  218. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
  219. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
  220. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
  221. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
  222. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
  223. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
  224. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
  225. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  226. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
  227. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
  228. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
  229. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
  230. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
  231. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
  233. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
  235. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  236. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  237. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  238. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
  239. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  240. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
  241. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
  242. package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
  243. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
  244. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
  245. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
  246. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
  247. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
  248. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
  249. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  250. package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
  251. package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
  252. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
  253. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
  254. package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
  255. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
  256. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
  257. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  258. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
  259. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  260. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  261. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  262. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
  263. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  264. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
  265. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
  266. package/src/ui/components/AccountMenu.tsx +0 -645
  267. package/src/ui/components/AccountMenuButton.tsx +0 -126
  268. package/src/ui/components/AccountSwitcher.tsx +0 -751
  269. package/src/ui/components/AnotherDeviceQR.tsx +0 -119
  270. package/src/ui/components/ProfileMenu.tsx +0 -564
  271. package/src/ui/components/SignInAccountChooser.tsx +0 -162
  272. package/src/ui/components/SignInModal.tsx +0 -530
  273. package/src/ui/hooks/useOxyAuthSession.ts +0 -635
  274. package/src/ui/hooks/usePasswordSignIn.ts +0 -207
  275. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
  276. package/src/ui/screens/OxyAuthScreen.tsx +0 -324
  277. package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
  278. package/src/utils/deviceFlowSignIn.ts +0 -152
@@ -0,0 +1,299 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.RequireOxyAuth = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _theme = require("@oxyhq/bloom/theme");
10
+ var _typography = require("@oxyhq/bloom/typography");
11
+ var _OxyContext = require("../context/OxyContext.js");
12
+ var _OxySignInButton = require("./OxySignInButton.js");
13
+ var _OxyLogo = _interopRequireDefault(require("./OxyLogo.js"));
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ /**
17
+ * RequireOxyAuth — the optional signed-out gate primitive (React Native).
18
+ *
19
+ * ONE shared way for any Oxy app to opt into a signed-out gate. It is entirely
20
+ * OPTIONAL: a public app renders its children untouched (`prompt="off"`); an
21
+ * auth-required app blocks them behind a signed-out state (`prompt="hard"`); an
22
+ * app that mostly works signed-out but wants a nudge shows a dismissible banner
23
+ * (`prompt="soft"`). Every mode reuses the ONE account dialog the provider
24
+ * already mounts — opening the sign-in surface is always
25
+ * `useOxy().openAccountDialog('signin')`; there is NO second dialog.
26
+ *
27
+ * Readiness gating (CRITICAL): the gate keys on the SDK's own readiness state
28
+ * (`useOxy().canUsePrivateApi` / `isPrivateApiPending`), NEVER on app-local
29
+ * hooks. While auth is still resolving (`isPrivateApiPending`) it renders a
30
+ * neutral loading state so the signed-out wall never flashes before the
31
+ * device-first cold boot concludes (the documented cold-boot race).
32
+ *
33
+ * Styling follows the sibling `OxyAccountDialog`/`OxySignInButton` pattern —
34
+ * `useTheme()` + `StyleSheet` (NOT NativeWind), so the gate renders correctly in
35
+ * EVERY consumer, including apps that do not run NativeWind (e.g. the accounts
36
+ * app).
37
+ */
38
+
39
+ /**
40
+ * How `RequireOxyAuth` treats a signed-out (or still-resolving) session.
41
+ * - `off` — always render children (public app; a no-op provided for symmetry).
42
+ * - `soft` — render children, plus a dismissible sign-in banner when signed out.
43
+ * - `hard` — block children behind a centered signed-out state until signed in.
44
+ */
45
+
46
+ const DEFAULT_TITLE = 'Sign in to continue';
47
+ const DEFAULT_SUBTITLE = 'Sign in with your Oxy account to continue.';
48
+ const DEFAULT_BANNER_MESSAGE = "You're browsing signed out.";
49
+ const DEFAULT_BANNER_ACTION = 'Sign in';
50
+
51
+ /**
52
+ * Optional signed-out gate. Wrap any subtree (or the whole app via the
53
+ * provider's `requireAuth` prop) to opt into a shared, readiness-safe wall.
54
+ */
55
+ const RequireOxyAuth = ({
56
+ children,
57
+ prompt = 'hard',
58
+ loadingFallback,
59
+ signedOutFallback,
60
+ title,
61
+ subtitle,
62
+ bannerMessage,
63
+ bannerActionLabel
64
+ }) => {
65
+ const {
66
+ canUsePrivateApi,
67
+ isPrivateApiPending,
68
+ openAccountDialog
69
+ } = (0, _OxyContext.useOxy)();
70
+
71
+ // Public app: render straight through. Cheap enough to short-circuit before
72
+ // touching any gate UI.
73
+ if (prompt === 'off') {
74
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
75
+ children: children
76
+ });
77
+ }
78
+
79
+ // Signed in (and token ready): render the protected subtree in every mode.
80
+ if (canUsePrivateApi) {
81
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
82
+ children: children
83
+ });
84
+ }
85
+ if (prompt === 'soft') {
86
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(SoftGate, {
87
+ pending: isPrivateApiPending,
88
+ message: bannerMessage ?? DEFAULT_BANNER_MESSAGE,
89
+ actionLabel: bannerActionLabel ?? DEFAULT_BANNER_ACTION,
90
+ onSignIn: () => openAccountDialog('signin'),
91
+ children: children
92
+ });
93
+ }
94
+
95
+ // prompt === 'hard'
96
+ if (isPrivateApiPending) {
97
+ return loadingFallback ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
98
+ children: loadingFallback
99
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NeutralLoading, {});
100
+ }
101
+ if (signedOutFallback) {
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
103
+ children: signedOutFallback
104
+ });
105
+ }
106
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(HardWall, {
107
+ title: title ?? DEFAULT_TITLE,
108
+ subtitle: subtitle ?? DEFAULT_SUBTITLE
109
+ });
110
+ };
111
+
112
+ // ---------------------------------------------------------------------------
113
+ // Soft gate — children + a dismissible sign-in banner while signed out.
114
+ // ---------------------------------------------------------------------------
115
+ exports.RequireOxyAuth = RequireOxyAuth;
116
+ const SoftGate = ({
117
+ children,
118
+ pending,
119
+ message,
120
+ actionLabel,
121
+ onSignIn
122
+ }) => {
123
+ const theme = (0, _theme.useTheme)();
124
+ const [dismissed, setDismissed] = (0, _react.useState)(false);
125
+
126
+ // Never surface the nudge while auth is still resolving — only once the boot
127
+ // has concluded signed out and the user has not dismissed it.
128
+ const showBanner = !pending && !dismissed;
129
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
130
+ style: styles.softRoot,
131
+ children: [showBanner ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
132
+ style: [styles.banner, {
133
+ backgroundColor: theme.colors.card,
134
+ borderColor: theme.colors.border
135
+ }],
136
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
137
+ variant: "icon",
138
+ size: 20,
139
+ fillColor: theme.colors.primary
140
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
141
+ style: [styles.bannerText, {
142
+ color: theme.colors.text
143
+ }],
144
+ numberOfLines: 2,
145
+ children: message
146
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
147
+ onPress: onSignIn,
148
+ style: [styles.bannerCta, {
149
+ backgroundColor: theme.colors.primary
150
+ }],
151
+ accessibilityRole: "button",
152
+ accessibilityLabel: actionLabel,
153
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
154
+ style: styles.bannerCtaText,
155
+ children: actionLabel
156
+ })
157
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
158
+ onPress: () => setDismissed(true),
159
+ style: styles.bannerDismiss,
160
+ accessibilityRole: "button",
161
+ accessibilityLabel: "Dismiss",
162
+ hitSlop: 8,
163
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
164
+ style: [styles.bannerDismissText, {
165
+ color: theme.colors.textSecondary
166
+ }],
167
+ children: "\u2715"
168
+ })
169
+ })]
170
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
171
+ style: styles.softBody,
172
+ children: children
173
+ })]
174
+ });
175
+ };
176
+
177
+ // ---------------------------------------------------------------------------
178
+ // Hard wall — centered signed-out state with the "Sign in with Oxy" CTA.
179
+ // ---------------------------------------------------------------------------
180
+
181
+ const HardWall = ({
182
+ title,
183
+ subtitle
184
+ }) => {
185
+ const theme = (0, _theme.useTheme)();
186
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
187
+ style: [styles.wallRoot, {
188
+ backgroundColor: theme.colors.background
189
+ }],
190
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
191
+ style: [styles.logoBadge, {
192
+ backgroundColor: theme.colors.primarySubtle
193
+ }],
194
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
195
+ variant: "icon",
196
+ size: 44,
197
+ fillColor: theme.colors.primary
198
+ })
199
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
200
+ style: [styles.wallTitle, {
201
+ color: theme.colors.text
202
+ }],
203
+ children: title
204
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
205
+ style: [styles.wallSubtitle, {
206
+ color: theme.colors.textSecondary
207
+ }],
208
+ children: subtitle
209
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxySignInButton.OxySignInButton, {
210
+ variant: "contained",
211
+ style: styles.wallCta
212
+ })]
213
+ });
214
+ };
215
+ const NeutralLoading = () => {
216
+ const theme = (0, _theme.useTheme)();
217
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
218
+ style: [styles.wallRoot, {
219
+ backgroundColor: theme.colors.background
220
+ }],
221
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
222
+ color: theme.colors.primary
223
+ })
224
+ });
225
+ };
226
+ const styles = _reactNative.StyleSheet.create({
227
+ softRoot: {
228
+ flex: 1
229
+ },
230
+ softBody: {
231
+ flex: 1
232
+ },
233
+ banner: {
234
+ flexDirection: 'row',
235
+ alignItems: 'center',
236
+ gap: 10,
237
+ paddingVertical: 8,
238
+ paddingHorizontal: 12,
239
+ borderBottomWidth: _reactNative.StyleSheet.hairlineWidth
240
+ },
241
+ bannerText: {
242
+ flex: 1,
243
+ fontSize: 13.5
244
+ },
245
+ bannerCta: {
246
+ paddingVertical: 6,
247
+ paddingHorizontal: 14,
248
+ borderRadius: 999
249
+ },
250
+ bannerCtaText: {
251
+ color: '#FFFFFF',
252
+ fontSize: 13,
253
+ fontWeight: '700'
254
+ },
255
+ bannerDismiss: {
256
+ width: 28,
257
+ height: 28,
258
+ alignItems: 'center',
259
+ justifyContent: 'center'
260
+ },
261
+ bannerDismissText: {
262
+ fontSize: 15,
263
+ fontWeight: '600'
264
+ },
265
+ wallRoot: {
266
+ flex: 1,
267
+ alignItems: 'center',
268
+ justifyContent: 'center',
269
+ padding: 24,
270
+ gap: 16
271
+ },
272
+ logoBadge: {
273
+ width: 88,
274
+ height: 88,
275
+ borderRadius: 44,
276
+ alignItems: 'center',
277
+ justifyContent: 'center',
278
+ marginBottom: 4
279
+ },
280
+ wallTitle: {
281
+ fontSize: 24,
282
+ fontWeight: '800',
283
+ letterSpacing: -0.4,
284
+ textAlign: 'center'
285
+ },
286
+ wallSubtitle: {
287
+ fontSize: 15,
288
+ lineHeight: 21,
289
+ textAlign: 'center',
290
+ maxWidth: 340
291
+ },
292
+ wallCta: {
293
+ marginTop: 8,
294
+ width: '100%',
295
+ maxWidth: 320
296
+ }
297
+ });
298
+ var _default = exports.default = RequireOxyAuth;
299
+ //# sourceMappingURL=RequireOxyAuth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_theme","_typography","_OxyContext","_OxySignInButton","_OxyLogo","_interopRequireDefault","_jsxRuntime","e","__esModule","default","DEFAULT_TITLE","DEFAULT_SUBTITLE","DEFAULT_BANNER_MESSAGE","DEFAULT_BANNER_ACTION","RequireOxyAuth","children","prompt","loadingFallback","signedOutFallback","title","subtitle","bannerMessage","bannerActionLabel","canUsePrivateApi","isPrivateApiPending","openAccountDialog","useOxy","jsx","Fragment","SoftGate","pending","message","actionLabel","onSignIn","NeutralLoading","HardWall","exports","theme","useTheme","dismissed","setDismissed","useState","showBanner","jsxs","View","style","styles","softRoot","banner","backgroundColor","colors","card","borderColor","border","variant","size","fillColor","primary","Text","bannerText","color","text","numberOfLines","Pressable","onPress","bannerCta","accessibilityRole","accessibilityLabel","bannerCtaText","bannerDismiss","hitSlop","bannerDismissText","textSecondary","softBody","wallRoot","background","logoBadge","primarySubtle","wallTitle","wallSubtitle","OxySignInButton","wallCta","ActivityIndicator","StyleSheet","create","flex","flexDirection","alignItems","gap","paddingVertical","paddingHorizontal","borderBottomWidth","hairlineWidth","fontSize","borderRadius","fontWeight","width","height","justifyContent","padding","marginBottom","letterSpacing","textAlign","lineHeight","maxWidth","marginTop","_default"],"sourceRoot":"../../../../src","sources":["ui/components/RequireOxyAuth.tsx"],"mappings":";;;;;;AAwBA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAC,sBAAA,CAAAP,OAAA;AAAgC,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAO,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA9BhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;;AAqBA,MAAMG,aAAa,GAAG,qBAAqB;AAC3C,MAAMC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AE;IACbR,KAAK,EAAE,SAAS;IAChBiC,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE;EACd,CAAC;EACD1B,aAAa,EAAE;IACb2B,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVV,UAAU,EAAE,QAAQ;IACpBW,cAAc,EAAE;EAClB,CAAC;EACD3B,iBAAiB,EAAE;IACjBsB,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE;EACd,CAAC;EACDrB,QAAQ,EAAE;IACRW,IAAI,EAAE,CAAC;IACPE,UAAU,EAAE,QAAQ;IACpBW,cAAc,EAAE,QAAQ;IACxBC,OAAO,EAAE,EAAE;IACXX,GAAG,EAAE;EACP,CAAC;EACDZ,SAAS,EAAE;IACToB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVH,YAAY,EAAE,EAAE;IAChBP,UAAU,EAAE,QAAQ;IACpBW,cAAc,EAAE,QAAQ;IACxBE,YAAY,EAAE;EAChB,CAAC;EACDtB,SAAS,EAAE;IACTe,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAE,KAAK;IACjBM,aAAa,EAAE,CAAC,GAAG;IACnBC,SAAS,EAAE;EACb,CAAC;EACDvB,YAAY,EAAE;IACZc,QAAQ,EAAE,EAAE;IACZU,UAAU,EAAE,EAAE;IACdD,SAAS,EAAE,QAAQ;IACnBE,QAAQ,EAAE;EACZ,CAAC;EACDvB,OAAO,EAAE;IACPwB,SAAS,EAAE,CAAC;IACZT,KAAK,EAAE,MAAM;IACbQ,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAAC,IAAAE,QAAA,GAAAtE,OAAA,CAAA3B,OAAA,GAEYK,cAAc","ignoreList":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.openAuthorizeUrlNative = openAuthorizeUrlNative;
7
+ exports.redirectToAuthorize = redirectToAuthorize;
8
+ var _reactNative = require("react-native");
9
+ var _core = require("@oxyhq/core");
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } /**
11
+ * Platform navigation for the third-party "Sign in with Oxy" OAuth flow.
12
+ *
13
+ * Kept out of `OxySignInButton` so the button's routing logic can be unit-tested
14
+ * without driving a real browser navigation (jsdom's `location.assign` is
15
+ * non-configurable and cannot be spied). Both entry points hand a fully-built
16
+ * `auth.oxy.so/authorize` URL to the platform — never FedCM, an SSO bounce, or
17
+ * an Oxy session cookie.
18
+ */
19
+ /** Minimal shape of the optional `expo-web-browser` auth-session result. */
20
+
21
+ /** Minimal shape of the optional `expo-web-browser` native module we depend on. */
22
+
23
+ /** Outcome of opening the authorize URL on native. */
24
+
25
+ /**
26
+ * Web: hand the TOP-LEVEL document to the OAuth authorize URL (a full-page
27
+ * redirect, not a popup) so the RP returns to its registered `redirect_uri`.
28
+ * No-op where `location` is unavailable (SSR / non-browser hosts).
29
+ */
30
+ function redirectToAuthorize(url) {
31
+ globalThis.location?.assign(url);
32
+ }
33
+
34
+ /**
35
+ * Native: open the authorize URL in an in-app auth session via the optional
36
+ * `expo-web-browser` module (`openAuthSessionAsync` returns to `redirectUri`),
37
+ * degrading to `Linking.openURL` when the module is not installed — the same
38
+ * dynamic-import-with-fallback pattern services uses for haptics/netinfo.
39
+ *
40
+ * Returns the deep-link URL the session came back to when it can be observed, so
41
+ * the caller can hand `?code=…&state=…` back to the RP for the token exchange.
42
+ */
43
+ async function openAuthorizeUrlNative(url, redirectUri) {
44
+ try {
45
+ const mod = await Promise.resolve().then(() => _interopRequireWildcard(require('expo-web-browser')));
46
+ if (mod && typeof mod.openAuthSessionAsync === 'function') {
47
+ const result = await mod.openAuthSessionAsync(url, redirectUri);
48
+ const redirectUrl = result && result.type === 'success' && typeof result.url === 'string' ? result.url : null;
49
+ return {
50
+ redirectUrl
51
+ };
52
+ }
53
+ } catch (error) {
54
+ _core.logger.warn('OxySignInButton: expo-web-browser auth session failed; falling back to Linking.openURL', {
55
+ component: 'oauthNavigation'
56
+ }, error);
57
+ }
58
+
59
+ // Fallback: Linking cannot observe the return URL, so the RP completes the
60
+ // exchange from its own deep-link handler. A rejected openURL (e.g. an
61
+ // unregistered scheme) must not throw out of the sign-in flow.
62
+ try {
63
+ await _reactNative.Linking.openURL(url);
64
+ } catch (error) {
65
+ _core.logger.warn('OxySignInButton: Linking.openURL rejected the authorize URL', {
66
+ component: 'oauthNavigation'
67
+ }, error);
68
+ }
69
+ return {
70
+ redirectUrl: null
71
+ };
72
+ }
73
+ //# sourceMappingURL=oauthNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","redirectToAuthorize","url","globalThis","location","assign","openAuthorizeUrlNative","redirectUri","mod","Promise","resolve","then","openAuthSessionAsync","result","redirectUrl","type","error","logger","warn","component","Linking","openURL"],"sourceRoot":"../../../../src","sources":["ui/components/oauthNavigation.ts"],"mappings":";;;;;;;AAUA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CA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BAAoB,KAAK,UAAU,EAAE;MACvD,MAAMC,MAAM,GAAG,MAAML,GAAG,CAACI,oBAAoB,CAACV,GAAG,EAAEK,WAAW,CAAC;MAC/D,MAAMO,WAAW,GACbD,MAAM,IAAIA,MAAM,CAACE,IAAI,KAAK,SAAS,IAAI,OAAOF,MAAM,CAACX,GAAG,KAAK,QAAQ,GAC/DW,MAAM,CAACX,GAAG,GACV,IAAI;MACd,OAAO;QAAEY;MAAY,CAAC;IAC1B;EACJ,CAAC,CAAC,OAAOE,KAAK,EAAE;IACZC,YAAM,CAACC,IAAI,CACP,wFAAwF,EACxF;MAAEC,SAAS,EAAE;IAAkB,CAAC,EAChCH,KACJ,CAAC;EACL;;EAEA;EACA;EACA;EACA,IAAI;IACA,MAAMI,oBAAO,CAACC,OAAO,CAACnB,GAAG,CAAC;EAC9B,CAAC,CAAC,OAAOc,KAAK,EAAE;IACZC,YAAM,CAACC,IAAI,CACP,6DAA6D,EAC7D;MAAEC,SAAS,EAAE;IAAkB,CAAC,EAChCH,KACJ,CAAC;EACL;EACA,OAAO;IAAEF,WAAW,EAAE;EAAK,CAAC;AAChC","ignoreList":[]}
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useOxy = exports.OxyProvider = exports.OxyContextProvider = void 0;
7
7
  var _react = require("react");
8
+ var _reactNative = require("react-native");
8
9
  var _core = require("@oxyhq/core");
10
+ var _accountDialogManager = require("../navigation/accountDialogManager.js");
9
11
  var _authStore = require("../stores/authStore.js");
10
12
  var _shallow = require("zustand/react/shallow");
11
13
  var _useLanguageManagement = require("../hooks/useLanguageManagement.js");
@@ -116,6 +118,7 @@ const OxyProvider = ({
116
118
  authRedirectUri,
117
119
  storageKeyPrefix = 'oxy_session',
118
120
  clientId: clientIdProp,
121
+ coldBoot = true,
119
122
  onAuthStateChange,
120
123
  onError
121
124
  }) => {
@@ -171,6 +174,7 @@ const OxyProvider = ({
171
174
  userRef.current = user;
172
175
  isAuthenticatedRef.current = isAuthenticated;
173
176
  const [initialized, setInitialized] = (0, _react.useState)(false);
177
+ const [accountDialogOpen, setAccountDialogOpen] = (0, _react.useState)(false);
174
178
  const setAuthState = _authStore.useAuthStore.setState;
175
179
 
176
180
  // Keep the shared `oxyClient` singleton's token store in lockstep with the
@@ -311,10 +315,19 @@ const OxyProvider = ({
311
315
  const markAuthResolvedRef = (0, _react.useRef)(markAuthResolved);
312
316
  markAuthResolvedRef.current = markAuthResolved;
313
317
 
318
+ // Re-boot indirection: the SessionClient is built in the ref initializer below
319
+ // (before `runColdBoot` is defined), but its `onSessionAppeared` must re-run the
320
+ // cold boot to self-acquire when a sibling signs in on this device. A ref bridges
321
+ // the ordering; it is assigned right after `runColdBoot` is declared.
322
+ const runColdBootRef = (0, _react.useRef)(null);
323
+
314
324
  // Server-authoritative device session client. Built ONCE per `oxyServices`
315
325
  // instance. `onUnauthenticated` (a device signout-all pushed over the socket,
316
326
  // or bootstrapped as zero-account) clears the persisted store + local state so
317
327
  // a reload does not try to restore a session the device no longer has.
328
+ // `signedOutSocketAuth` + `onSessionAppeared` power the signed-out sync channel:
329
+ // an idle tab joins its `device:<id>` room (web via the `oxy_device` cookie,
330
+ // native via the shared device token) and self-acquires on a sibling sign-in.
318
331
  const sessionClientPairRef = (0, _react.useRef)(null);
319
332
  if (!sessionClientPairRef.current) {
320
333
  sessionClientPairRef.current = (0, _index.createSessionClient)(oxyServices, authStore, () => {
@@ -322,6 +335,21 @@ const OxyProvider = ({
322
335
  void clearSessionStateRef.current().catch(clearError => {
323
336
  logger('Failed to clear local state on remote sign-out', clearError);
324
337
  });
338
+ }, {
339
+ signedOutSocketAuth: async () => {
340
+ // Web (`*.oxy.so`): the first-party `oxy_device` cookie rides the
341
+ // same-site handshake automatically — just connect.
342
+ if ((0, _isWebBrowser.isWebBrowser)()) return true;
343
+ // Native (no cookie jar): present the shared device token if we have one.
344
+ try {
345
+ return (await authStore.loadDeviceToken()) ?? false;
346
+ } catch {
347
+ return false;
348
+ }
349
+ },
350
+ onSessionAppeared: () => {
351
+ void runColdBootRef.current?.();
352
+ }
325
353
  });
326
354
  }
327
355
  const {
@@ -601,6 +629,58 @@ const OxyProvider = ({
601
629
  });
602
630
  }, [commitSession]);
603
631
 
632
+ // ── Unified account dialog ─────────────────────────────────────────────────
633
+ // The single account-chooser + sign-in surface. Built ONCE per provider mount
634
+ // and bound to the live `oxyServices` + `sessionClient` + this provider's
635
+ // `handleWebSession` commit funnel. `handleWebSession` is threaded through a ref
636
+ // so the controller keeps a STABLE `commitSession` (rebuilding the controller
637
+ // on every commit-identity change would drop its subscription + state).
638
+ const handleWebSessionRef = (0, _react.useRef)(handleWebSession);
639
+ handleWebSessionRef.current = handleWebSession;
640
+ const accountDialogControllerRef = (0, _react.useRef)(null);
641
+ if (!accountDialogControllerRef.current) {
642
+ accountDialogControllerRef.current = (0, _core.createAccountDialogController)({
643
+ oxyServices,
644
+ sessionClient,
645
+ clientId,
646
+ locale: currentLanguage,
647
+ commitSession: session => handleWebSessionRef.current(session),
648
+ onSignedIn: () => setAccountDialogOpen(false),
649
+ openUrl: url => {
650
+ void _reactNative.Linking.openURL(url);
651
+ }
652
+ });
653
+ }
654
+ const accountDialogController = accountDialogControllerRef.current;
655
+ const openAccountDialog = (0, _react.useCallback)(view => {
656
+ accountDialogControllerRef.current?.setView(view ?? 'accounts');
657
+ setAccountDialogOpen(true);
658
+ }, []);
659
+ const closeAccountDialog = (0, _react.useCallback)(() => {
660
+ accountDialogControllerRef.current?.cancelSignIn();
661
+ setAccountDialogOpen(false);
662
+ }, []);
663
+
664
+ // Start driving the dialog on mount; tear it down on unmount.
665
+ (0, _react.useEffect)(() => {
666
+ const controller = accountDialogControllerRef.current;
667
+ controller?.start();
668
+ return () => controller?.destroy();
669
+ }, []);
670
+
671
+ // Expose the live open/close controls to the imperative manager so
672
+ // `showSignInModal()` (and any app-level imperative "sign in" handler) works.
673
+ (0, _react.useEffect)(() => (0, _accountDialogManager.registerAccountDialogControls)({
674
+ open: openAccountDialog,
675
+ close: closeAccountDialog
676
+ }), [openAccountDialog, closeAccountDialog]);
677
+
678
+ // Broadcast visibility so `OxySignInButton`'s "Signing in…" affordance stays
679
+ // accurate regardless of what opened or dismissed the dialog.
680
+ (0, _react.useEffect)(() => {
681
+ (0, _accountDialogManager.notifyAccountDialogVisibility)(accountDialogOpen);
682
+ }, [accountDialogOpen]);
683
+
604
684
  // Keyless password sign-in: username/email + password.
605
685
  const signInWithPassword = (0, _react.useCallback)(async (identifier, password, opts) => {
606
686
  const deviceToken = (await authStore.loadDeviceToken()) ?? undefined;
@@ -695,6 +775,17 @@ const OxyProvider = ({
695
775
  },
696
776
  onSignedOut: () => {
697
777
  markAuthResolvedRef.current();
778
+ // Open the signed-out realtime channel so this idle tab joins its
779
+ // `device:<id>` room (web `oxy_device` cookie / native device token)
780
+ // and self-acquires when a sibling signs in. Idempotent, best-effort.
781
+ void sessionClient.start().catch(startError => {
782
+ if (__DEV__) {
783
+ _core.logger.debug('signed-out socket start failed (non-fatal)', {
784
+ component: 'OxyContext',
785
+ method: 'runColdBoot'
786
+ }, startError);
787
+ }
788
+ });
698
789
  },
699
790
  onStepError: (id, error) => {
700
791
  if (__DEV__) {
@@ -716,9 +807,25 @@ const OxyProvider = ({
716
807
  // Backstop: resolve on every exit path so the gate can never hang.
717
808
  markAuthResolvedRef.current();
718
809
  }
719
- }, [oxyServices, authStore]);
810
+ }, [oxyServices, authStore, sessionClient]);
811
+ // Bridge for `onSessionAppeared` (SessionClient) → re-run the cold boot to
812
+ // self-acquire when a sibling signs in on this device while this tab is idle.
813
+ runColdBootRef.current = runColdBoot;
720
814
  (0, _react.useEffect)(() => {
721
- if (!storage || initialized) {
815
+ if (initialized) {
816
+ return;
817
+ }
818
+ // IdP mode (`coldBoot={false}`): this provider is NOT the ecosystem session
819
+ // authority, so it never runs the device-first restore and never opens the
820
+ // signed-out device-state socket (`runColdBoot` → `onSignedOut` is the sole
821
+ // place that socket starts). Resolve auth immediately as signed out so there
822
+ // is no boot spinner; a deliberate sign-in still commits a normal session.
823
+ if (!coldBoot) {
824
+ setInitialized(true);
825
+ markAuthResolved();
826
+ return;
827
+ }
828
+ if (!storage) {
722
829
  return;
723
830
  }
724
831
  setInitialized(true);
@@ -727,7 +834,7 @@ const OxyProvider = ({
727
834
  logger('Cold boot failed', error);
728
835
  }
729
836
  });
730
- }, [runColdBoot, storage, initialized, logger]);
837
+ }, [coldBoot, runColdBoot, storage, initialized, logger, markAuthResolved]);
731
838
 
732
839
  // Exposed `refreshSessions`: re-bootstrap the server-authoritative device
733
840
  // state and reproject — the manual counterpart to the realtime socket.
@@ -793,6 +900,9 @@ const OxyProvider = ({
793
900
  (0, _react.useEffect)(() => {
794
901
  if (isAuthenticated && initialized && tokenReady) {
795
902
  refreshAccounts();
903
+ // Reload the dialog's own account graph too, so a session restored OUTSIDE
904
+ // the dialog (cold boot / password sign-in) surfaces its graph accounts.
905
+ void accountDialogControllerRef.current?.refresh();
796
906
  }
797
907
  }, [isAuthenticated, initialized, tokenReady, refreshAccounts]);
798
908
  const runPostAccountSwitchSideEffects = (0, _react.useCallback)(async () => {
@@ -877,11 +987,15 @@ const OxyProvider = ({
877
987
  useFollow: useFollowHook,
878
988
  showBottomSheet: showBottomSheetForContext,
879
989
  openAvatarPicker,
990
+ accountDialogController,
991
+ isAccountDialogOpen: accountDialogOpen,
992
+ openAccountDialog,
993
+ closeAccountDialog,
880
994
  accounts,
881
995
  switchToAccount,
882
996
  refreshAccounts,
883
997
  createAccount: createAccountFn
884
- }), [user, sessions, activeSessionId, isAuthenticated, isLoading, tokenReady, hasAccessToken, canUsePrivateApi, isPrivateApiPending, authResolved, storage, error, currentLanguage, currentLanguageMetadata, currentLanguageName, currentNativeLanguageName, hasIdentity, getPublicKey, signIn, signInWithPassword, completeTwoFactorSignIn, handleWebSession, logout, logoutAll, switchSessionForContext, refreshSessionsForContext, setLanguage, getDeviceSessions, logoutAllDeviceSessions, updateDeviceName, clearSessionState, clearAllAccountData, storageKeyPrefix, clientId, oxyServices, useFollowHook, showBottomSheetForContext, openAvatarPicker, accounts, switchToAccount, refreshAccounts, createAccountFn]);
998
+ }), [user, sessions, activeSessionId, isAuthenticated, isLoading, tokenReady, hasAccessToken, canUsePrivateApi, isPrivateApiPending, authResolved, storage, error, currentLanguage, currentLanguageMetadata, currentLanguageName, currentNativeLanguageName, hasIdentity, getPublicKey, signIn, signInWithPassword, completeTwoFactorSignIn, handleWebSession, logout, logoutAll, switchSessionForContext, refreshSessionsForContext, setLanguage, getDeviceSessions, logoutAllDeviceSessions, updateDeviceName, clearSessionState, clearAllAccountData, storageKeyPrefix, clientId, oxyServices, useFollowHook, showBottomSheetForContext, openAvatarPicker, accountDialogController, accountDialogOpen, openAccountDialog, closeAccountDialog, accounts, switchToAccount, refreshAccounts, createAccountFn]);
885
999
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(OxyContext.Provider, {
886
1000
  value: contextValue,
887
1001
  children: children
@@ -937,6 +1051,10 @@ const LOADING_STATE = {
937
1051
  clientId: null,
938
1052
  oxyServices: LOADING_STATE_OXY_SERVICES,
939
1053
  openAvatarPicker: () => {},
1054
+ accountDialogController: null,
1055
+ isAccountDialogOpen: false,
1056
+ openAccountDialog: () => {},
1057
+ closeAccountDialog: () => {},
940
1058
  accounts: [],
941
1059
  switchToAccount: () => rejectMissingProvider(),
942
1060
  refreshAccounts: () => rejectMissingProvider(),