@oxyhq/services 22.9.0 → 22.10.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 (428) hide show
  1. package/lib/commonjs/index.js +24 -5
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +25 -125
  4. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -0
  5. package/lib/commonjs/ui/components/OxyAuthChooser.js +137 -40
  6. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  7. package/lib/commonjs/ui/components/OxyConsentScreen.js +1 -1
  8. package/lib/commonjs/ui/components/ProfileButton.js +1 -1
  9. package/lib/commonjs/ui/components/RequireOxyAuth.js +1 -1
  10. package/lib/commonjs/ui/components/SurfaceHeaderAction.js +63 -0
  11. package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -0
  12. package/lib/commonjs/ui/components/SurfaceScreen.js +52 -5
  13. package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
  14. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +46 -29
  15. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  16. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +47 -23
  17. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  18. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js +22 -12
  19. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +1 -1
  20. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +83 -0
  21. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
  22. package/lib/commonjs/ui/context/OxyContext.js +23 -9
  23. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  24. package/lib/commonjs/ui/hooks/useAvatarPicker.js +34 -39
  25. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  26. package/lib/commonjs/ui/hooks/useSurfaceHeader.js +46 -0
  27. package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -0
  28. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +1 -1
  29. package/lib/commonjs/ui/navigation/accountDialogManager.js +14 -2
  30. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
  31. package/lib/commonjs/ui/navigation/routes.js +3 -3
  32. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  33. package/lib/commonjs/ui/navigation/surfaceBackBridge.js +68 -0
  34. package/lib/commonjs/ui/navigation/surfaceBackBridge.js.map +1 -0
  35. package/lib/commonjs/ui/navigation/surfaceRegistry.js +52 -8
  36. package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
  37. package/lib/commonjs/ui/navigation/surfaces.js +42 -5
  38. package/lib/commonjs/ui/navigation/surfaces.js.map +1 -1
  39. package/lib/commonjs/ui/screens/AccountMembersScreen.js +214 -283
  40. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  41. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +88 -118
  42. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  43. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +22 -36
  44. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/AppInfoScreen.js +219 -226
  46. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/AvatarCropScreen.js +10 -14
  48. package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +24 -39
  50. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/CreateAccountScreen.js +136 -158
  52. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +29 -36
  54. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/EditProfileScreen.js +101 -109
  56. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/FAQScreen.js +10 -15
  58. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/FeedbackScreen.js +8 -16
  60. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/FileManagementScreen.js +219 -206
  62. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  63. package/lib/commonjs/ui/screens/HelpSupportScreen.js +62 -69
  64. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  65. package/lib/commonjs/ui/screens/HistoryViewScreen.js +63 -79
  66. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  67. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +69 -98
  68. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  69. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +8 -14
  70. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
  71. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +77 -94
  72. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/ManageAccountScreen.js +99 -134
  74. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  75. package/lib/commonjs/ui/screens/NotificationsScreen.js +69 -76
  76. package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
  77. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -8
  78. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/PreferencesScreen.js +67 -74
  80. package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +55 -91
  82. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  83. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +291 -304
  84. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  85. package/lib/commonjs/ui/screens/ProfileScreen.js +100 -114
  86. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  87. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +38 -45
  88. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  89. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +44 -57
  90. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
  91. package/lib/commonjs/ui/screens/UserLinksScreen.js +24 -31
  92. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
  93. package/lib/commonjs/ui/screens/UserListScreen.js +14 -24
  94. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  95. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -1
  96. package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +66 -75
  97. package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
  98. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +111 -139
  99. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  100. package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +13 -20
  101. package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
  102. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +14 -27
  103. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  104. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +68 -85
  105. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  106. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +28 -36
  107. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  108. package/lib/module/index.js +12 -5
  109. package/lib/module/index.js.map +1 -1
  110. package/lib/module/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +27 -127
  111. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -0
  112. package/lib/module/ui/components/OxyAuthChooser.js +137 -40
  113. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  114. package/lib/module/ui/components/OxyConsentScreen.js +1 -1
  115. package/lib/module/ui/components/ProfileButton.js +1 -1
  116. package/lib/module/ui/components/RequireOxyAuth.js +1 -1
  117. package/lib/module/ui/components/SurfaceHeaderAction.js +58 -0
  118. package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -0
  119. package/lib/module/ui/components/SurfaceScreen.js +53 -6
  120. package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
  121. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +46 -29
  122. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  123. package/lib/module/ui/components/modals/DeleteAccountModal.js +46 -23
  124. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  125. package/lib/module/ui/components/oxyAuthChooserStyles.js +22 -12
  126. package/lib/module/ui/components/oxyAuthChooserStyles.js.map +1 -1
  127. package/lib/module/ui/components/surfaces/ActionSheetSurface.js +78 -0
  128. package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
  129. package/lib/module/ui/context/OxyContext.js +23 -9
  130. package/lib/module/ui/context/OxyContext.js.map +1 -1
  131. package/lib/module/ui/hooks/useAvatarPicker.js +34 -39
  132. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  133. package/lib/module/ui/hooks/useSurfaceHeader.js +42 -0
  134. package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -0
  135. package/lib/module/ui/hooks/useSwitchableAccounts.js +1 -1
  136. package/lib/module/ui/navigation/accountDialogManager.js +14 -2
  137. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
  138. package/lib/module/ui/navigation/routes.js +3 -3
  139. package/lib/module/ui/navigation/routes.js.map +1 -1
  140. package/lib/module/ui/navigation/surfaceBackBridge.js +63 -0
  141. package/lib/module/ui/navigation/surfaceBackBridge.js.map +1 -0
  142. package/lib/module/ui/navigation/surfaceRegistry.js +52 -8
  143. package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
  144. package/lib/module/ui/navigation/surfaces.js +42 -5
  145. package/lib/module/ui/navigation/surfaces.js.map +1 -1
  146. package/lib/module/ui/screens/AccountMembersScreen.js +218 -286
  147. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  148. package/lib/module/ui/screens/AccountSettingsScreen.js +92 -121
  149. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  150. package/lib/module/ui/screens/AccountVerificationScreen.js +25 -38
  151. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  152. package/lib/module/ui/screens/AppInfoScreen.js +220 -227
  153. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  154. package/lib/module/ui/screens/AvatarCropScreen.js +10 -14
  155. package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
  156. package/lib/module/ui/screens/ConnectedAppsScreen.js +26 -40
  157. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  158. package/lib/module/ui/screens/CreateAccountScreen.js +139 -160
  159. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  160. package/lib/module/ui/screens/EditProfileFieldScreen.js +32 -38
  161. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  162. package/lib/module/ui/screens/EditProfileScreen.js +102 -110
  163. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
  164. package/lib/module/ui/screens/FAQScreen.js +11 -15
  165. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  166. package/lib/module/ui/screens/FeedbackScreen.js +10 -17
  167. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  168. package/lib/module/ui/screens/FileManagementScreen.js +222 -208
  169. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  170. package/lib/module/ui/screens/HelpSupportScreen.js +64 -70
  171. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  172. package/lib/module/ui/screens/HistoryViewScreen.js +65 -81
  173. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  174. package/lib/module/ui/screens/LanguageSelectorScreen.js +71 -99
  175. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  176. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +10 -15
  177. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
  178. package/lib/module/ui/screens/LegalDocumentsScreen.js +78 -94
  179. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  180. package/lib/module/ui/screens/ManageAccountScreen.js +102 -137
  181. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  182. package/lib/module/ui/screens/NotificationsScreen.js +71 -77
  183. package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
  184. package/lib/module/ui/screens/PaymentGatewayScreen.js +4 -9
  185. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  186. package/lib/module/ui/screens/PreferencesScreen.js +69 -75
  187. package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
  188. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +58 -93
  189. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  190. package/lib/module/ui/screens/PrivacySettingsScreen.js +293 -305
  191. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  192. package/lib/module/ui/screens/ProfileScreen.js +102 -116
  193. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  194. package/lib/module/ui/screens/SavesCollectionsScreen.js +40 -46
  195. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  196. package/lib/module/ui/screens/SearchSettingsScreen.js +46 -58
  197. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
  198. package/lib/module/ui/screens/UserLinksScreen.js +26 -32
  199. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
  200. package/lib/module/ui/screens/UserListScreen.js +14 -24
  201. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  202. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +1 -1
  203. package/lib/module/ui/screens/trust/TrustAboutScreen.js +67 -75
  204. package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
  205. package/lib/module/ui/screens/trust/TrustCenterScreen.js +112 -139
  206. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  207. package/lib/module/ui/screens/trust/TrustFAQScreen.js +15 -21
  208. package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
  209. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +14 -26
  210. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  211. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +69 -85
  212. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  213. package/lib/module/ui/screens/trust/TrustRulesScreen.js +30 -37
  214. package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  215. package/lib/typescript/commonjs/index.d.ts +2 -0
  216. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  217. package/lib/typescript/commonjs/ui/components/{OxyAccountDialog.d.ts → OxyAccountDialogScreen.d.ts} +4 -4
  218. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +3 -3
  220. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +2 -2
  222. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +1 -1
  223. package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts +16 -0
  224. package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
  225. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +4 -2
  226. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -1
  227. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
  228. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  229. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +17 -2
  230. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts +19 -9
  232. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
  234. package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  236. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +7 -11
  237. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  238. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +31 -0
  239. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +1 -1
  241. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +14 -2
  242. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts +16 -0
  244. package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
  245. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +31 -13
  246. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +0 -4
  253. package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
  254. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  263. package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  267. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  272. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  275. package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  276. package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
  278. package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
  280. package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  282. package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
  283. package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/ui/types/navigation.d.ts +8 -0
  285. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  286. package/lib/typescript/module/index.d.ts +2 -0
  287. package/lib/typescript/module/index.d.ts.map +1 -1
  288. package/lib/typescript/module/ui/components/{OxyAccountDialog.d.ts → OxyAccountDialogScreen.d.ts} +4 -4
  289. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
  290. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +3 -3
  291. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  292. package/lib/typescript/module/ui/components/ProfileButton.d.ts +2 -2
  293. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +1 -1
  294. package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts +16 -0
  295. package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
  296. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +4 -2
  297. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -1
  298. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
  299. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  300. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +17 -2
  301. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  302. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts +19 -9
  303. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
  304. package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
  305. package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
  306. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  307. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +7 -11
  308. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  309. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +31 -0
  310. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
  311. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +1 -1
  312. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +14 -2
  313. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
  314. package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts +16 -0
  315. package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
  316. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +31 -13
  317. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
  318. package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -1
  319. package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  320. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  321. package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  322. package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
  323. package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +0 -4
  324. package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
  325. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  326. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  327. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  328. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
  329. package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
  330. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  331. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  332. package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
  333. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  334. package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  335. package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
  336. package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  337. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  338. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  339. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
  340. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  341. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
  342. package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  343. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  344. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  345. package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  346. package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  347. package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
  348. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
  349. package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
  350. package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
  351. package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
  352. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  353. package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
  354. package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  355. package/lib/typescript/module/ui/types/navigation.d.ts +8 -0
  356. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  357. package/package.json +2 -2
  358. package/src/index.ts +12 -5
  359. package/src/ui/components/{OxyAccountDialog.tsx → OxyAccountDialogScreen.tsx} +21 -110
  360. package/src/ui/components/OxyAuthChooser.tsx +153 -33
  361. package/src/ui/components/OxyConsentScreen.tsx +1 -1
  362. package/src/ui/components/ProfileButton.tsx +2 -2
  363. package/src/ui/components/RequireOxyAuth.tsx +1 -1
  364. package/src/ui/components/SurfaceHeaderAction.tsx +60 -0
  365. package/src/ui/components/SurfaceScreen.tsx +66 -6
  366. package/src/ui/components/fileManagement/FileDetailsModal.tsx +50 -36
  367. package/src/ui/components/modals/DeleteAccountModal.tsx +47 -26
  368. package/src/ui/components/oxyAuthChooserStyles.ts +22 -12
  369. package/src/ui/components/surfaces/ActionSheetSurface.tsx +98 -0
  370. package/src/ui/context/OxyContext.tsx +22 -8
  371. package/src/ui/hooks/useAvatarPicker.ts +53 -66
  372. package/src/ui/hooks/useSurfaceHeader.ts +56 -0
  373. package/src/ui/hooks/useSwitchableAccounts.ts +1 -1
  374. package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +68 -0
  375. package/src/ui/navigation/accountDialogManager.ts +14 -2
  376. package/src/ui/navigation/routes.ts +3 -3
  377. package/src/ui/navigation/surfaceBackBridge.ts +69 -0
  378. package/src/ui/navigation/surfaceRegistry.ts +80 -14
  379. package/src/ui/navigation/surfaces.ts +33 -5
  380. package/src/ui/screens/AccountMembersScreen.tsx +39 -100
  381. package/src/ui/screens/AccountSettingsScreen.tsx +32 -54
  382. package/src/ui/screens/AccountVerificationScreen.tsx +23 -51
  383. package/src/ui/screens/AppInfoScreen.tsx +6 -13
  384. package/src/ui/screens/AvatarCropScreen.tsx +8 -17
  385. package/src/ui/screens/ConnectedAppsScreen.tsx +39 -60
  386. package/src/ui/screens/CreateAccountScreen.tsx +13 -39
  387. package/src/ui/screens/EditProfileFieldScreen.tsx +30 -48
  388. package/src/ui/screens/EditProfileScreen.tsx +7 -16
  389. package/src/ui/screens/FAQScreen.tsx +9 -13
  390. package/src/ui/screens/FeedbackScreen.tsx +8 -22
  391. package/src/ui/screens/FileManagementScreen.tsx +191 -188
  392. package/src/ui/screens/HelpSupportScreen.tsx +7 -13
  393. package/src/ui/screens/HistoryViewScreen.tsx +26 -31
  394. package/src/ui/screens/LanguageSelectorScreen.tsx +12 -46
  395. package/src/ui/screens/LearnMoreUsernamesScreen.tsx +8 -16
  396. package/src/ui/screens/LegalDocumentsScreen.tsx +7 -22
  397. package/src/ui/screens/ManageAccountScreen.tsx +96 -165
  398. package/src/ui/screens/NotificationsScreen.tsx +7 -13
  399. package/src/ui/screens/PaymentGatewayScreen.tsx +3 -10
  400. package/src/ui/screens/PreferencesScreen.tsx +7 -13
  401. package/src/ui/screens/PremiumSubscriptionScreen.tsx +52 -90
  402. package/src/ui/screens/PrivacySettingsScreen.tsx +9 -21
  403. package/src/ui/screens/ProfileScreen.tsx +9 -11
  404. package/src/ui/screens/SavesCollectionsScreen.tsx +7 -13
  405. package/src/ui/screens/SearchSettingsScreen.tsx +9 -21
  406. package/src/ui/screens/UserLinksScreen.tsx +7 -14
  407. package/src/ui/screens/UserListScreen.tsx +2 -5
  408. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
  409. package/src/ui/screens/trust/TrustAboutScreen.tsx +10 -17
  410. package/src/ui/screens/trust/TrustCenterScreen.tsx +9 -28
  411. package/src/ui/screens/trust/TrustFAQScreen.tsx +15 -18
  412. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +3 -5
  413. package/src/ui/screens/trust/TrustRewardsScreen.tsx +11 -26
  414. package/src/ui/screens/trust/TrustRulesScreen.tsx +10 -13
  415. package/src/ui/types/navigation.ts +8 -0
  416. package/lib/commonjs/ui/components/Header.js +0 -305
  417. package/lib/commonjs/ui/components/Header.js.map +0 -1
  418. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +0 -1
  419. package/lib/module/ui/components/Header.js +0 -299
  420. package/lib/module/ui/components/Header.js.map +0 -1
  421. package/lib/module/ui/components/OxyAccountDialog.js.map +0 -1
  422. package/lib/typescript/commonjs/ui/components/Header.d.ts +0 -33
  423. package/lib/typescript/commonjs/ui/components/Header.d.ts.map +0 -1
  424. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +0 -1
  425. package/lib/typescript/module/ui/components/Header.d.ts +0 -33
  426. package/lib/typescript/module/ui/components/Header.d.ts.map +0 -1
  427. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +0 -1
  428. package/src/ui/components/Header.tsx +0 -224
@@ -1,62 +1,40 @@
1
1
  import type React from 'react';
2
2
  import { View, Text } from 'react-native';
3
3
  import { Ionicons } from '@expo/vector-icons';
4
- import { Dialog, type DialogControlProps } from '@oxyhq/bloom';
4
+ import { Button } from '@oxyhq/bloom/button';
5
5
  import { useTheme } from '@oxyhq/bloom/theme';
6
+ import { surfaces, type SurfaceControls } from '@oxyhq/bloom/surfaces';
6
7
  import type { FileMetadata } from '@oxyhq/core';
7
8
  import { useI18n } from '../../hooks/useI18n';
8
9
  import { formatFileSize, getFileIcon } from '../../utils/fileManagement';
9
10
 
10
11
  interface FileDetailsModalProps {
11
- control: DialogControlProps;
12
- file: FileMetadata | null;
12
+ /** The presenting surface's controls (from `surfaces.present`). */
13
+ surface: SurfaceControls;
14
+ file: FileMetadata;
13
15
  onDownload: (fileId: string, filename: string) => void;
14
16
  onDelete: (fileId: string, filename: string) => void;
15
17
  isOwner: boolean;
16
- onClose?: () => void;
17
18
  }
18
19
 
20
+ /**
21
+ * File-detail panel — a rich presented surface (NOT a yes/no confirm): a file's
22
+ * icon + metadata plus download / delete / cancel actions. Each action first
23
+ * dismisses this surface, then runs its handler, so a follow-up delete confirm
24
+ * stacks cleanly above whatever remains. Presented via {@link presentFileDetails}.
25
+ */
19
26
  export const FileDetailsModal: React.FC<FileDetailsModalProps> = ({
20
- control,
27
+ surface,
21
28
  file,
22
29
  onDownload,
23
30
  onDelete,
24
31
  isOwner,
25
- onClose,
26
32
  }) => {
27
33
  const { t } = useI18n();
28
34
  const { colors } = useTheme();
29
35
 
30
- if (!file) return null;
31
-
32
- const actions = isOwner
33
- ? [
34
- {
35
- label: t('fileManagement.details.download'),
36
- onPress: () => onDownload(file.id, file.filename),
37
- },
38
- {
39
- label: t('common.actions.delete'),
40
- color: 'destructive' as const,
41
- onPress: () => onDelete(file.id, file.filename),
42
- },
43
- { label: t('common.cancel'), color: 'cancel' as const },
44
- ]
45
- : [
46
- {
47
- label: t('fileManagement.details.download'),
48
- onPress: () => onDownload(file.id, file.filename),
49
- },
50
- { label: t('common.cancel'), color: 'cancel' as const },
51
- ];
52
-
53
36
  return (
54
- <Dialog
55
- control={control}
56
- onClose={onClose}
57
- label={t('fileManagement.details.title')}
58
- actions={actions}
59
- >
37
+ <View>
60
38
  <View className="bg-secondary border-border p-[18px] rounded-[14px] border items-center">
61
39
  <View className="mb-space-16">
62
40
  <Ionicons
@@ -110,6 +88,42 @@ export const FileDetailsModal: React.FC<FileDetailsModalProps> = ({
110
88
  )}
111
89
  </View>
112
90
  </View>
113
- </Dialog>
91
+
92
+ <View style={{ gap: 8 }}>
93
+ <Button
94
+ variant="primary"
95
+ onPress={() => {
96
+ surface.dismiss();
97
+ onDownload(file.id, file.filename);
98
+ }}
99
+ >
100
+ {t('fileManagement.details.download')}
101
+ </Button>
102
+ {isOwner ? (
103
+ <Button
104
+ variant="destructive"
105
+ onPress={() => {
106
+ surface.dismiss();
107
+ onDelete(file.id, file.filename);
108
+ }}
109
+ >
110
+ {t('common.actions.delete')}
111
+ </Button>
112
+ ) : null}
113
+ <Button variant="secondary" onPress={() => surface.dismiss()}>
114
+ {t('common.cancel')}
115
+ </Button>
116
+ </View>
117
+ </View>
114
118
  );
115
119
  };
120
+
121
+ /** Options accepted by {@link presentFileDetails} (everything but `surface`). */
122
+ type PresentFileDetailsOptions = Omit<FileDetailsModalProps, 'surface'>;
123
+
124
+ /** Present the file-detail panel on the shared surface stack. */
125
+ export function presentFileDetails(options: PresentFileDetailsOptions): void {
126
+ void surfaces.present((surface) => (
127
+ <FileDetailsModal surface={surface} {...options} />
128
+ ));
129
+ }
@@ -2,18 +2,27 @@ import type React from 'react';
2
2
  import { useState, useCallback } from 'react';
3
3
  import { View, Text, TextInput } from 'react-native';
4
4
  import { Ionicons } from '@expo/vector-icons';
5
- import { Dialog, type DialogControlProps } from '@oxyhq/bloom';
5
+ import { Button } from '@oxyhq/bloom/button';
6
6
  import { useTheme } from '@oxyhq/bloom/theme';
7
+ import { surfaces, type SurfaceControls } from '@oxyhq/bloom/surfaces';
7
8
 
8
9
  interface DeleteAccountModalProps {
9
- control: DialogControlProps;
10
+ /** The presenting surface's controls (from `surfaces.present`). */
11
+ surface: SurfaceControls;
10
12
  username: string;
11
13
  onDelete: (confirmText: string) => Promise<void>;
12
14
  t: (key: string, params?: Record<string, string>) => string | undefined;
13
15
  }
14
16
 
17
+ /**
18
+ * Delete-account confirmation — a rich presented surface (NOT a yes/no confirm):
19
+ * the user must retype their username, then the destructive action runs
20
+ * `onDelete`. On success the surface is dismissed with `true` (the presenter
21
+ * then signs out + closes); cancel dismisses with `false`. Presented via
22
+ * {@link presentDeleteAccount}.
23
+ */
15
24
  const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
16
- control,
25
+ surface,
17
26
  username,
18
27
  onDelete,
19
28
  t,
@@ -33,36 +42,21 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
33
42
 
34
43
  try {
35
44
  await onDelete(confirmUsername);
36
- // Dialog will be closed by parent on success
45
+ surface.dismiss(true);
37
46
  } catch (err: unknown) {
38
47
  setError((err instanceof Error ? err.message : null) || t('deleteAccount.error') || 'Failed to delete account');
39
48
  } finally {
40
49
  setIsDeleting(false);
41
50
  }
42
- }, [isValid, confirmUsername, onDelete, t]);
51
+ }, [isValid, confirmUsername, onDelete, surface, t]);
43
52
 
44
- const handleCleanup = useCallback(() => {
53
+ const handleCancel = useCallback(() => {
45
54
  if (isDeleting) return;
46
- setConfirmUsername('');
47
- setError(null);
48
- }, [isDeleting]);
55
+ surface.dismiss(false);
56
+ }, [isDeleting, surface]);
49
57
 
50
58
  return (
51
- <Dialog
52
- control={control}
53
- onClose={handleCleanup}
54
- label="Delete Account"
55
- actions={[
56
- {
57
- label: t('deleteAccount.confirm') || 'Delete Forever',
58
- color: 'destructive',
59
- onPress: handleDelete,
60
- disabled: !isValid || isDeleting,
61
- shouldCloseOnPress: false,
62
- },
63
- { label: t('common.cancel') || 'Cancel', color: 'cancel' },
64
- ]}
65
- >
59
+ <View>
66
60
  <View className="flex-row items-center mb-4 gap-3">
67
61
  <Ionicons name="alert-circle" size={32} color={theme.colors.error} />
68
62
  <Text className="text-text text-xl font-bold" style={{ color: theme.colors.error }}>
@@ -92,7 +86,7 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
92
86
  <TextInput
93
87
  className="text-text bg-bg text-base py-3 px-4 border rounded-lg"
94
88
  style={{
95
- borderColor: confirmUsername === username ? theme.colors.success : theme.colors.border,
89
+ borderColor: isValid ? theme.colors.success : theme.colors.border,
96
90
  }}
97
91
  value={confirmUsername}
98
92
  onChangeText={setConfirmUsername}
@@ -103,8 +97,35 @@ const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({
103
97
  editable={!isDeleting}
104
98
  />
105
99
  </View>
106
- </Dialog>
100
+
101
+ <View style={{ gap: 8 }}>
102
+ <Button
103
+ variant="destructive"
104
+ onPress={handleDelete}
105
+ disabled={!isValid || isDeleting}
106
+ loading={isDeleting}
107
+ >
108
+ {t('deleteAccount.confirm') || 'Delete Forever'}
109
+ </Button>
110
+ <Button variant="secondary" onPress={handleCancel} disabled={isDeleting}>
111
+ {t('common.cancel') || 'Cancel'}
112
+ </Button>
113
+ </View>
114
+ </View>
107
115
  );
108
116
  };
109
117
 
118
+ /** Options accepted by {@link presentDeleteAccount} (everything but `surface`). */
119
+ type PresentDeleteAccountOptions = Omit<DeleteAccountModalProps, 'surface'>;
120
+
121
+ /**
122
+ * Present the delete-account confirmation on the shared surface stack. Resolves
123
+ * `true` once the account is deleted, `false` if cancelled/dismissed.
124
+ */
125
+ export function presentDeleteAccount(options: PresentDeleteAccountOptions): Promise<boolean> {
126
+ return surfaces
127
+ .present<boolean>((surface) => <DeleteAccountModal surface={surface} {...options} />)
128
+ .then((result) => result === true);
129
+ }
130
+
110
131
  export default DeleteAccountModal;
@@ -4,7 +4,7 @@ import { StyleSheet } from 'react-native';
4
4
  const QR_PLATE_BG = '#FFFFFF';
5
5
 
6
6
  /**
7
- * Shared styles for `OxyAuthChooser`'s views. Extracted from `OxyAccountDialog`
7
+ * Shared styles for `OxyAuthChooser`'s views. Extracted from `OxyAccountDialogScreen`
8
8
  * so both the Dialog-wrapped host and any bare host (e.g. a future
9
9
  * auth.oxy.so hub page) render identically without duplicating a StyleSheet.
10
10
  */
@@ -42,16 +42,30 @@ export const authChooserStyles = StyleSheet.create({
42
42
  fontSize: 12.5,
43
43
  marginTop: 1,
44
44
  },
45
- addRow: {
45
+ /** Prominent current-account header (Google-style collapsed row). */
46
+ currentAccountRow: {
46
47
  flexDirection: 'row',
47
48
  alignItems: 'center',
48
49
  gap: 12,
49
- borderWidth: StyleSheet.hairlineWidth,
50
- borderStyle: 'dashed',
51
- borderRadius: 16,
52
- paddingVertical: 10,
53
- paddingHorizontal: 12,
54
- marginTop: 8,
50
+ paddingVertical: 8,
51
+ paddingHorizontal: 4,
52
+ },
53
+ currentAccountMeta: {
54
+ flex: 1,
55
+ minWidth: 0,
56
+ },
57
+ currentAccountName: {
58
+ fontSize: 16,
59
+ fontWeight: '700',
60
+ },
61
+ currentAccountEmail: {
62
+ fontSize: 13,
63
+ marginTop: 2,
64
+ },
65
+ manageButton: {
66
+ width: '100%',
67
+ borderRadius: 14,
68
+ marginTop: 4,
55
69
  },
56
70
  addBadge: {
57
71
  width: 40,
@@ -61,10 +75,6 @@ export const authChooserStyles = StyleSheet.create({
61
75
  alignItems: 'center',
62
76
  justifyContent: 'center',
63
77
  },
64
- footerLinks: {
65
- alignItems: 'center',
66
- marginTop: 16,
67
- },
68
78
  footerLink: {
69
79
  alignSelf: 'center',
70
80
  paddingVertical: 10,
@@ -0,0 +1,98 @@
1
+ import type React from 'react';
2
+ import { Text, View } from 'react-native';
3
+ import { Button } from '@oxyhq/bloom/button';
4
+ import { useTheme } from '@oxyhq/bloom/theme';
5
+ import { surfaces, type SurfaceControls } from '@oxyhq/bloom/surfaces';
6
+
7
+ /**
8
+ * A single choice in an {@link ActionSheetSurface} — a labelled button that
9
+ * resolves the surface with `value` when pressed.
10
+ */
11
+ export interface ActionSheetOption<T extends string> {
12
+ label: string;
13
+ value: T;
14
+ /** Render as a destructive (negative) button. */
15
+ destructive?: boolean;
16
+ }
17
+
18
+ export interface ActionSheetSurfaceProps<T extends string> {
19
+ /** The presenting surface's controls (from `surfaces.present`). */
20
+ surface: SurfaceControls;
21
+ /** Headline. */
22
+ title: string;
23
+ /** Optional supporting copy. */
24
+ message?: string;
25
+ /** The choices; each dismisses the surface with its `value`. */
26
+ options: ActionSheetOption<T>[];
27
+ /** Cancel button label — dismisses with `undefined`. */
28
+ cancelLabel: string;
29
+ }
30
+
31
+ const TITLE_STYLE = { fontSize: 22, fontWeight: '600' as const, lineHeight: 30 };
32
+ const MESSAGE_STYLE = { fontSize: 16, lineHeight: 22 };
33
+
34
+ /**
35
+ * A multi-choice action sheet rendered as a shared-stack surface — the
36
+ * many-option counterpart to Bloom's two-way `surfaces.confirm`. Each option
37
+ * button resolves the surface's `present()` promise with that option's `value`;
38
+ * cancel / backdrop / Escape resolve `undefined`. Presented via
39
+ * {@link presentActionSheet}.
40
+ */
41
+ export function ActionSheetSurface<T extends string>({
42
+ surface,
43
+ title,
44
+ message,
45
+ options,
46
+ cancelLabel,
47
+ }: ActionSheetSurfaceProps<T>): React.ReactElement {
48
+ const theme = useTheme();
49
+
50
+ return (
51
+ <View>
52
+ <Text
53
+ style={[
54
+ TITLE_STYLE,
55
+ { color: theme.colors.text, paddingBottom: message ? 4 : 16 },
56
+ ]}
57
+ >
58
+ {title}
59
+ </Text>
60
+ {message ? (
61
+ <Text
62
+ style={[
63
+ MESSAGE_STYLE,
64
+ { color: theme.colors.textSecondary, paddingBottom: 16 },
65
+ ]}
66
+ >
67
+ {message}
68
+ </Text>
69
+ ) : null}
70
+ <View style={{ gap: 8 }}>
71
+ {options.map((option) => (
72
+ <Button
73
+ key={option.value}
74
+ variant={option.destructive ? 'destructive' : 'primary'}
75
+ onPress={() => surface.dismiss(option.value)}
76
+ >
77
+ {option.label}
78
+ </Button>
79
+ ))}
80
+ <Button variant="secondary" onPress={() => surface.dismiss(undefined)}>
81
+ {cancelLabel}
82
+ </Button>
83
+ </View>
84
+ </View>
85
+ );
86
+ }
87
+
88
+ /**
89
+ * Present an {@link ActionSheetSurface} on the shared stack and resolve with the
90
+ * chosen option `value`, or `undefined` if cancelled/dismissed.
91
+ */
92
+ export function presentActionSheet<T extends string>(
93
+ options: Omit<ActionSheetSurfaceProps<T>, 'surface'>,
94
+ ): Promise<T | undefined> {
95
+ return surfaces.present<T | undefined>((surface) => (
96
+ <ActionSheetSurface surface={surface} {...options} />
97
+ ));
98
+ }
@@ -644,9 +644,12 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
644
644
  const commitSwitchedSessionRef = useRef(commitSwitchedSession);
645
645
  commitSwitchedSessionRef.current = commitSwitchedSession;
646
646
 
647
- // The live AccountDialog surface (a stacked Bloom surface), while open. Held so
647
+ // The live AccountDialog surface (a stacked Bloom surface), while open the
648
+ // SINGLE source of truth for "is the account dialog open". Held so
648
649
  // `openAccountDialog` can no-op when already open and `closeAccountDialog` /
649
- // `onSignedIn` can dismiss it. Cleared when the surface settles.
650
+ // `onSignedIn` can dismiss it. Its present→settle lifecycle is what drives the
651
+ // reactive `accountDialogOpen` mirror below: presenting flips it true, the
652
+ // surface settling (`result.finally`) flips it false — no other write site.
650
653
  const accountDialogSurfaceRef = useRef<SurfaceInstance<'AccountDialog'> | null>(null);
651
654
 
652
655
  const accountDialogControllerRef = useRef<AccountDialogController | null>(null);
@@ -662,8 +665,11 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
662
665
  commitSession: (session) => handleWebSessionRef.current(session),
663
666
  commitSwitchedSession: (session) => commitSwitchedSessionRef.current(session),
664
667
  onSignedIn: () => {
668
+ // Dismiss the surface; its settle (`result.finally` below) is what flips
669
+ // `accountDialogOpen` false. The surface's present→settle lifecycle is the
670
+ // SINGLE source of truth for "is the account dialog open" — never a manual
671
+ // flip here.
665
672
  accountDialogSurfaceRef.current?.dismiss();
666
- setAccountDialogOpen(false);
667
673
  },
668
674
  openUrl: (url) => {
669
675
  if (isWebBrowser()) {
@@ -692,7 +698,9 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
692
698
  // Present the AccountDialog surface on the shared Bloom stack the FIRST time
693
699
  // (subsequent opens just re-point the controller's view above). `presentDetached`
694
700
  // keeps it OUT of the `showBottomSheet` route-surface lineage, so closing the
695
- // bottom-sheet session never touches the account dialog and vice-versa.
701
+ // bottom-sheet session never touches the account dialog and vice-versa. When a
702
+ // route surface (e.g. ManageAccount) is already open, this stacks the dialog
703
+ // ABOVE it; dismissing the dialog unwinds back to that surface.
696
704
  if (!accountDialogSurfaceRef.current) {
697
705
  const instance = presentDetached(
698
706
  'AccountDialog',
@@ -700,9 +708,14 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
700
708
  { placement: { base: 'bottom', md: 'center' }, dismissOnBackdrop: false, maxWidth: 420 },
701
709
  );
702
710
  accountDialogSurfaceRef.current = instance;
711
+ // The surface settling is the ONE place `accountDialogOpen` flips false —
712
+ // covering every dismiss path (close button, `onSignedIn`, programmatic
713
+ // `closeAccountDialog`, host unmount). So the stack owns the open state.
703
714
  instance.result.finally(() => {
704
- if (accountDialogSurfaceRef.current === instance) accountDialogSurfaceRef.current = null;
705
- setAccountDialogOpen(false);
715
+ if (accountDialogSurfaceRef.current === instance) {
716
+ accountDialogSurfaceRef.current = null;
717
+ setAccountDialogOpen(false);
718
+ }
706
719
  });
707
720
  }
708
721
  setAccountDialogOpen(true);
@@ -710,8 +723,10 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
710
723
 
711
724
  const closeAccountDialog = useCallback((): void => {
712
725
  accountDialogControllerRef.current?.cancelSignIn();
726
+ // Dismiss the surface; its settle (`result.finally` above) flips
727
+ // `accountDialogOpen` false. Do NOT flip it here — the surface lifecycle is
728
+ // the single source of truth, so a manual write would be a second authority.
713
729
  accountDialogSurfaceRef.current?.dismiss();
714
- setAccountDialogOpen(false);
715
730
  }, []);
716
731
 
717
732
  // Start driving the dialog on mount; tear it down on unmount.
@@ -960,7 +975,6 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
960
975
  currentLanguage,
961
976
  activeSessionId,
962
977
  queryClient,
963
- showBottomSheet: showBottomSheetForContext,
964
978
  });
965
979
 
966
980
  const { accounts, refreshAccounts, switchToAccount, createAccount: createAccountFn } = useOxyAccountGraph({
@@ -3,10 +3,11 @@
3
3
  *
4
4
  * Extracts avatar selection logic from OxyContext for better modularity.
5
5
  *
6
- * Flow:
7
- * 1. Open the FileManagement bottom sheet in select mode for image files.
8
- * 2. After the user picks an image, route to the AvatarCrop screen so they
9
- * can square-crop + zoom before the avatar is set.
6
+ * Flow (typed promises over the shared surface stack — no callback props):
7
+ * 1. `surfaces.present('FileManagement', …)` opens the image-only picker and
8
+ * resolves with the picked file (or `undefined` if the user cancels).
9
+ * 2. Resolve a private-safe source URL, then `surfaces.present('AvatarCrop', …)`
10
+ * opens the square-crop editor and resolves with the cropped JPEG.
10
11
  * 3. The cropped JPEG is uploaded as a NEW file via `oxyServices.assetUpload`
11
12
  * and that file becomes the user's avatar.
12
13
  *
@@ -15,12 +16,12 @@
15
16
  */
16
17
 
17
18
  import { useCallback } from 'react';
18
- import type { FileMetadata, OxyServices } from '@oxyhq/core';
19
+ import type { OxyServices } from '@oxyhq/core';
19
20
  import { translate, updateAvatarVisibility } from '@oxyhq/core';
20
21
  import type { QueryClient } from '@tanstack/react-query';
21
22
  import { toast } from '@oxyhq/bloom';
22
- import type { RouteName } from '../navigation/routes';
23
23
  import { updateProfileWithAvatar } from '../utils/avatarUtils';
24
+ import { surfaces } from '../navigation/surfaces';
24
25
  import type { AvatarCropResult } from '../screens/AvatarCropScreen';
25
26
 
26
27
  interface UseAvatarPickerOptions {
@@ -28,7 +29,6 @@ interface UseAvatarPickerOptions {
28
29
  currentLanguage: string | null | undefined;
29
30
  activeSessionId: string | null;
30
31
  queryClient: QueryClient;
31
- showBottomSheet: (config: { screen: RouteName; props?: Record<string, unknown> }) => void;
32
32
  }
33
33
 
34
34
  /** Upload result shape returned by oxyServices.assetUpload (single-file path). */
@@ -52,7 +52,6 @@ export function useAvatarPicker({
52
52
  currentLanguage,
53
53
  activeSessionId,
54
54
  queryClient,
55
- showBottomSheet,
56
55
  }: UseAvatarPickerOptions) {
57
56
  /**
58
57
  * Final step: take the cropped JPEG, upload it as a new public file, then
@@ -99,68 +98,56 @@ export function useAvatarPicker({
99
98
  [activeSessionId, currentLanguage, oxyServices, queryClient],
100
99
  );
101
100
 
102
- /**
103
- * After the user picks a file in the FileManagement sheet, resolve a working
104
- * source URL and route to the crop screen.
105
- *
106
- * The picked file is usually PRIVATE, so the synchronous
107
- * `getFileDownloadUrl` (public CDN origin) would 404 and the crop screen's
108
- * `Image.getSize` would fail silently. We resolve the authenticated URL via
109
- * `assetGetUrl` (which throws on failure — unlike `getFileDownloadUrlAsync`,
110
- * which swallows errors and falls back to the broken public URL) so a
111
- * failure surfaces a real user-facing error instead of a blank crop canvas.
112
- * No variant is requested — cropping needs the original.
113
- */
114
- const handleFilePicked = useCallback(
115
- async (file: FileMetadata) => {
116
- if (!file.contentType?.startsWith('image/')) {
117
- toast.error(
118
- translate(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') ||
119
- 'Please select an image file',
120
- );
121
- return;
122
- }
101
+ const openAvatarPicker = useCallback(async () => {
102
+ // 1. Present the image-only picker; it dismisses with the picked file when
103
+ // the user taps one, or `undefined` if they cancel.
104
+ const file = await surfaces.present('FileManagement', {
105
+ selectMode: true,
106
+ multiSelect: false,
107
+ disabledMimeTypes: ['video/', 'audio/', 'application/pdf'],
108
+ });
109
+ if (!file) return;
123
110
 
124
- let sourceUri: string;
125
- try {
126
- const resolved = await oxyServices.assetGetUrl(file.id);
127
- if (!resolved?.url) {
128
- throw new Error('No download URL returned for the selected image');
129
- }
130
- sourceUri = resolved.url;
131
- } catch (e: unknown) {
132
- const message = e instanceof Error ? e.message : undefined;
133
- toast.error(
134
- message ||
135
- translate(currentLanguage ?? undefined, 'editProfile.toasts.cropMeasureFailed') ||
136
- 'Could not load the selected image',
137
- );
138
- return;
111
+ if (!file.contentType?.startsWith('image/')) {
112
+ toast.error(
113
+ translate(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') ||
114
+ 'Please select an image file',
115
+ );
116
+ return;
117
+ }
118
+
119
+ // 2. Resolve a working source URL. The picked file is usually PRIVATE, so
120
+ // the synchronous `getFileDownloadUrl` (public CDN origin) would 404 and
121
+ // the crop screen's `Image.getSize` would fail silently. `assetGetUrl`
122
+ // throws on failure (unlike `getFileDownloadUrlAsync`, which swallows
123
+ // errors and falls back to the broken public URL), so a failure surfaces
124
+ // a real user-facing error instead of a blank crop canvas. No variant is
125
+ // requested — cropping needs the original.
126
+ let sourceUri: string;
127
+ try {
128
+ const resolved = await oxyServices.assetGetUrl(file.id);
129
+ if (!resolved?.url) {
130
+ throw new Error('No download URL returned for the selected image');
139
131
  }
132
+ sourceUri = resolved.url;
133
+ } catch (e: unknown) {
134
+ const message = e instanceof Error ? e.message : undefined;
135
+ toast.error(
136
+ message ||
137
+ translate(currentLanguage ?? undefined, 'editProfile.toasts.cropMeasureFailed') ||
138
+ 'Could not load the selected image',
139
+ );
140
+ return;
141
+ }
140
142
 
141
- showBottomSheet({
142
- screen: 'AvatarCrop',
143
- props: {
144
- imageUri: sourceUri,
145
- onConfirm: finalizeCroppedAvatar,
146
- },
147
- });
148
- },
149
- [currentLanguage, finalizeCroppedAvatar, oxyServices, showBottomSheet],
150
- );
143
+ // 3. Present the square-crop editor in place of the picker; it dismisses
144
+ // with the cropped JPEG on confirm, or `undefined` if cancelled.
145
+ const cropped = await surfaces.present('AvatarCrop', { imageUri: sourceUri });
146
+ if (!cropped) return;
151
147
 
152
- const openAvatarPicker = useCallback(() => {
153
- showBottomSheet({
154
- screen: 'FileManagement',
155
- props: {
156
- selectMode: true,
157
- multiSelect: false,
158
- disabledMimeTypes: ['video/', 'audio/', 'application/pdf'],
159
- afterSelect: 'none',
160
- onSelect: handleFilePicked,
161
- },
162
- });
163
- }, [handleFilePicked, showBottomSheet]);
148
+ // 4. Upload + set as the user's avatar.
149
+ await finalizeCroppedAvatar(cropped);
150
+ }, [currentLanguage, finalizeCroppedAvatar, oxyServices]);
164
151
 
165
152
  return { openAvatarPicker };
166
153
  }