@oxyhq/services 22.8.7 → 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 (502) 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/OxyAccountDialogScreen.js +150 -0
  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/OxyProvider.js +9 -29
  9. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  10. package/lib/commonjs/ui/components/ProfileButton.js +1 -1
  11. package/lib/commonjs/ui/components/RequireOxyAuth.js +1 -1
  12. package/lib/commonjs/ui/components/SurfaceHeaderAction.js +63 -0
  13. package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -0
  14. package/lib/commonjs/ui/components/SurfaceScreen.js +193 -0
  15. package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -0
  16. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +46 -29
  17. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  18. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +47 -23
  19. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  20. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js +22 -12
  21. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +1 -1
  22. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +83 -0
  23. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
  24. package/lib/commonjs/ui/context/OxyContext.js +49 -4
  25. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  26. package/lib/commonjs/ui/hooks/useAvatarPicker.js +34 -39
  27. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  28. package/lib/commonjs/ui/hooks/useSurfaceHeader.js +46 -0
  29. package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -0
  30. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +1 -1
  31. package/lib/commonjs/ui/navigation/accountDialogManager.js +14 -2
  32. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
  33. package/lib/commonjs/ui/navigation/bottomSheetManager.js +38 -56
  34. package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
  35. package/lib/commonjs/ui/navigation/routes.js +7 -57
  36. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  37. package/lib/commonjs/ui/navigation/surfaceBackBridge.js +68 -0
  38. package/lib/commonjs/ui/navigation/surfaceBackBridge.js.map +1 -0
  39. package/lib/commonjs/ui/navigation/surfaceNavStack.js +98 -0
  40. package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -0
  41. package/lib/commonjs/ui/navigation/surfaceRegistry.js +152 -0
  42. package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -0
  43. package/lib/commonjs/ui/navigation/surfaces.js +256 -0
  44. package/lib/commonjs/ui/navigation/surfaces.js.map +1 -0
  45. package/lib/commonjs/ui/screens/AccountMembersScreen.js +214 -283
  46. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +88 -118
  48. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +22 -36
  50. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/AppInfoScreen.js +219 -226
  52. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/AvatarCropScreen.js +10 -14
  54. package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +24 -39
  56. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/CreateAccountScreen.js +136 -158
  58. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +29 -36
  60. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/EditProfileScreen.js +101 -109
  62. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
  63. package/lib/commonjs/ui/screens/FAQScreen.js +10 -15
  64. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  65. package/lib/commonjs/ui/screens/FeedbackScreen.js +8 -16
  66. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  67. package/lib/commonjs/ui/screens/FileManagementScreen.js +219 -206
  68. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  69. package/lib/commonjs/ui/screens/HelpSupportScreen.js +62 -69
  70. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  71. package/lib/commonjs/ui/screens/HistoryViewScreen.js +63 -79
  72. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +69 -98
  74. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  75. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +8 -14
  76. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
  77. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +77 -94
  78. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/ManageAccountScreen.js +99 -134
  80. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/NotificationsScreen.js +69 -76
  82. package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
  83. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -8
  84. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  85. package/lib/commonjs/ui/screens/PreferencesScreen.js +67 -74
  86. package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
  87. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +55 -91
  88. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  89. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +291 -304
  90. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  91. package/lib/commonjs/ui/screens/ProfileScreen.js +100 -114
  92. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  93. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +38 -45
  94. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  95. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +44 -57
  96. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
  97. package/lib/commonjs/ui/screens/UserLinksScreen.js +24 -31
  98. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
  99. package/lib/commonjs/ui/screens/UserListScreen.js +14 -24
  100. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  101. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -1
  102. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +9 -7
  103. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  104. package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +66 -75
  105. package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
  106. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +111 -139
  107. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  108. package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +13 -20
  109. package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
  110. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +14 -27
  111. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  112. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +68 -85
  113. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  114. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +28 -36
  115. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  116. package/lib/commonjs/ui/types/surfaceScreen.js +6 -0
  117. package/lib/commonjs/ui/types/surfaceScreen.js.map +1 -0
  118. package/lib/module/index.js +12 -5
  119. package/lib/module/index.js.map +1 -1
  120. package/lib/module/ui/components/OxyAccountDialogScreen.js +145 -0
  121. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -0
  122. package/lib/module/ui/components/OxyAuthChooser.js +137 -40
  123. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  124. package/lib/module/ui/components/OxyConsentScreen.js +1 -1
  125. package/lib/module/ui/components/OxyProvider.js +10 -30
  126. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  127. package/lib/module/ui/components/ProfileButton.js +1 -1
  128. package/lib/module/ui/components/RequireOxyAuth.js +1 -1
  129. package/lib/module/ui/components/SurfaceHeaderAction.js +58 -0
  130. package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -0
  131. package/lib/module/ui/components/SurfaceScreen.js +188 -0
  132. package/lib/module/ui/components/SurfaceScreen.js.map +1 -0
  133. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +46 -29
  134. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  135. package/lib/module/ui/components/modals/DeleteAccountModal.js +46 -23
  136. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  137. package/lib/module/ui/components/oxyAuthChooserStyles.js +22 -12
  138. package/lib/module/ui/components/oxyAuthChooserStyles.js.map +1 -1
  139. package/lib/module/ui/components/surfaces/ActionSheetSurface.js +78 -0
  140. package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
  141. package/lib/module/ui/context/OxyContext.js +49 -4
  142. package/lib/module/ui/context/OxyContext.js.map +1 -1
  143. package/lib/module/ui/hooks/useAvatarPicker.js +34 -39
  144. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  145. package/lib/module/ui/hooks/useSurfaceHeader.js +42 -0
  146. package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -0
  147. package/lib/module/ui/hooks/useSwitchableAccounts.js +1 -1
  148. package/lib/module/ui/navigation/accountDialogManager.js +14 -2
  149. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
  150. package/lib/module/ui/navigation/bottomSheetManager.js +37 -53
  151. package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
  152. package/lib/module/ui/navigation/routes.js +6 -56
  153. package/lib/module/ui/navigation/routes.js.map +1 -1
  154. package/lib/module/ui/navigation/surfaceBackBridge.js +63 -0
  155. package/lib/module/ui/navigation/surfaceBackBridge.js.map +1 -0
  156. package/lib/module/ui/navigation/surfaceNavStack.js +95 -0
  157. package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -0
  158. package/lib/module/ui/navigation/surfaceRegistry.js +146 -0
  159. package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -0
  160. package/lib/module/ui/navigation/surfaces.js +244 -0
  161. package/lib/module/ui/navigation/surfaces.js.map +1 -0
  162. package/lib/module/ui/screens/AccountMembersScreen.js +218 -286
  163. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  164. package/lib/module/ui/screens/AccountSettingsScreen.js +92 -121
  165. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  166. package/lib/module/ui/screens/AccountVerificationScreen.js +25 -38
  167. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  168. package/lib/module/ui/screens/AppInfoScreen.js +220 -227
  169. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  170. package/lib/module/ui/screens/AvatarCropScreen.js +10 -14
  171. package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
  172. package/lib/module/ui/screens/ConnectedAppsScreen.js +26 -40
  173. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  174. package/lib/module/ui/screens/CreateAccountScreen.js +139 -160
  175. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  176. package/lib/module/ui/screens/EditProfileFieldScreen.js +32 -38
  177. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  178. package/lib/module/ui/screens/EditProfileScreen.js +102 -110
  179. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
  180. package/lib/module/ui/screens/FAQScreen.js +11 -15
  181. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  182. package/lib/module/ui/screens/FeedbackScreen.js +10 -17
  183. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  184. package/lib/module/ui/screens/FileManagementScreen.js +222 -208
  185. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  186. package/lib/module/ui/screens/HelpSupportScreen.js +64 -70
  187. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  188. package/lib/module/ui/screens/HistoryViewScreen.js +65 -81
  189. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  190. package/lib/module/ui/screens/LanguageSelectorScreen.js +71 -99
  191. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  192. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +10 -15
  193. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
  194. package/lib/module/ui/screens/LegalDocumentsScreen.js +78 -94
  195. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  196. package/lib/module/ui/screens/ManageAccountScreen.js +102 -137
  197. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  198. package/lib/module/ui/screens/NotificationsScreen.js +71 -77
  199. package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
  200. package/lib/module/ui/screens/PaymentGatewayScreen.js +4 -9
  201. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  202. package/lib/module/ui/screens/PreferencesScreen.js +69 -75
  203. package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
  204. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +58 -93
  205. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  206. package/lib/module/ui/screens/PrivacySettingsScreen.js +293 -305
  207. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  208. package/lib/module/ui/screens/ProfileScreen.js +102 -116
  209. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  210. package/lib/module/ui/screens/SavesCollectionsScreen.js +40 -46
  211. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  212. package/lib/module/ui/screens/SearchSettingsScreen.js +46 -58
  213. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
  214. package/lib/module/ui/screens/UserLinksScreen.js +26 -32
  215. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
  216. package/lib/module/ui/screens/UserListScreen.js +14 -24
  217. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  218. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +1 -1
  219. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +8 -7
  220. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  221. package/lib/module/ui/screens/trust/TrustAboutScreen.js +67 -75
  222. package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
  223. package/lib/module/ui/screens/trust/TrustCenterScreen.js +112 -139
  224. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  225. package/lib/module/ui/screens/trust/TrustFAQScreen.js +15 -21
  226. package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
  227. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +14 -26
  228. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  229. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +69 -85
  230. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  231. package/lib/module/ui/screens/trust/TrustRulesScreen.js +30 -37
  232. package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  233. package/lib/module/ui/types/surfaceScreen.js +4 -0
  234. package/lib/module/ui/types/surfaceScreen.js.map +1 -0
  235. package/lib/typescript/commonjs/index.d.ts +2 -0
  236. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  237. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts +39 -0
  238. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +3 -3
  240. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  241. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +3 -2
  242. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  243. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +2 -2
  244. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +1 -1
  245. package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts +16 -0
  246. package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
  247. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +26 -0
  248. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -0
  249. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
  250. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  251. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +17 -2
  252. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts +19 -9
  254. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
  256. package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
  257. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +7 -11
  259. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +31 -0
  261. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +1 -1
  263. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +14 -2
  264. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +24 -16
  266. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +2 -60
  268. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts +16 -0
  270. package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
  271. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +51 -0
  272. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +135 -0
  274. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +79 -0
  276. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  278. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  280. package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +0 -4
  282. package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
  283. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  285. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  286. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  289. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
  291. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
  294. package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  295. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  296. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  297. package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
  298. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  299. package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -1
  300. package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  301. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  302. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  303. package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  304. package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  305. package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
  306. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
  307. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
  309. package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
  311. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
  313. package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/ui/types/navigation.d.ts +8 -0
  315. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts +38 -0
  317. package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts.map +1 -0
  318. package/lib/typescript/module/index.d.ts +2 -0
  319. package/lib/typescript/module/index.d.ts.map +1 -1
  320. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts +39 -0
  321. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
  322. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +3 -3
  323. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  324. package/lib/typescript/module/ui/components/OxyProvider.d.ts +3 -2
  325. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  326. package/lib/typescript/module/ui/components/ProfileButton.d.ts +2 -2
  327. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +1 -1
  328. package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts +16 -0
  329. package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
  330. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +26 -0
  331. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -0
  332. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
  333. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  334. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +17 -2
  335. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  336. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts +19 -9
  337. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
  338. package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
  339. package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
  340. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  341. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +7 -11
  342. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  343. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +31 -0
  344. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
  345. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +1 -1
  346. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +14 -2
  347. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
  348. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +24 -16
  349. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  350. package/lib/typescript/module/ui/navigation/routes.d.ts +2 -60
  351. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  352. package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts +16 -0
  353. package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
  354. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +51 -0
  355. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -0
  356. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +135 -0
  357. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -0
  358. package/lib/typescript/module/ui/navigation/surfaces.d.ts +79 -0
  359. package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -0
  360. package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  361. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  362. package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  363. package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
  364. package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +0 -4
  365. package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
  366. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  367. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  368. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  369. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
  370. package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
  371. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  372. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  373. package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
  374. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  375. package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  376. package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
  377. package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  378. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  379. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  380. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
  381. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  382. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
  383. package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  384. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  385. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  386. package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  387. package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  388. package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
  389. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
  390. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  391. package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
  392. package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
  393. package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
  394. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  395. package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
  396. package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  397. package/lib/typescript/module/ui/types/navigation.d.ts +8 -0
  398. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  399. package/lib/typescript/module/ui/types/surfaceScreen.d.ts +38 -0
  400. package/lib/typescript/module/ui/types/surfaceScreen.d.ts.map +1 -0
  401. package/package.json +2 -2
  402. package/src/index.ts +12 -5
  403. package/src/ui/components/OxyAccountDialogScreen.tsx +148 -0
  404. package/src/ui/components/OxyAuthChooser.tsx +153 -33
  405. package/src/ui/components/OxyConsentScreen.tsx +1 -1
  406. package/src/ui/components/OxyProvider.tsx +12 -34
  407. package/src/ui/components/ProfileButton.tsx +2 -2
  408. package/src/ui/components/RequireOxyAuth.tsx +1 -1
  409. package/src/ui/components/SurfaceHeaderAction.tsx +60 -0
  410. package/src/ui/components/SurfaceScreen.tsx +226 -0
  411. package/src/ui/components/fileManagement/FileDetailsModal.tsx +50 -36
  412. package/src/ui/components/modals/DeleteAccountModal.tsx +47 -26
  413. package/src/ui/components/oxyAuthChooserStyles.ts +22 -12
  414. package/src/ui/components/surfaces/ActionSheetSurface.tsx +98 -0
  415. package/src/ui/context/OxyContext.tsx +43 -3
  416. package/src/ui/hooks/useAvatarPicker.ts +53 -66
  417. package/src/ui/hooks/useSurfaceHeader.ts +56 -0
  418. package/src/ui/hooks/useSwitchableAccounts.ts +1 -1
  419. package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +39 -0
  420. package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +68 -0
  421. package/src/ui/navigation/accountDialogManager.ts +14 -2
  422. package/src/ui/navigation/bottomSheetManager.ts +46 -73
  423. package/src/ui/navigation/routes.ts +7 -106
  424. package/src/ui/navigation/surfaceBackBridge.ts +69 -0
  425. package/src/ui/navigation/surfaceNavStack.ts +110 -0
  426. package/src/ui/navigation/surfaceRegistry.ts +240 -0
  427. package/src/ui/navigation/surfaces.ts +272 -0
  428. package/src/ui/screens/AccountMembersScreen.tsx +39 -100
  429. package/src/ui/screens/AccountSettingsScreen.tsx +32 -54
  430. package/src/ui/screens/AccountVerificationScreen.tsx +23 -51
  431. package/src/ui/screens/AppInfoScreen.tsx +6 -13
  432. package/src/ui/screens/AvatarCropScreen.tsx +8 -17
  433. package/src/ui/screens/ConnectedAppsScreen.tsx +39 -60
  434. package/src/ui/screens/CreateAccountScreen.tsx +13 -39
  435. package/src/ui/screens/EditProfileFieldScreen.tsx +30 -48
  436. package/src/ui/screens/EditProfileScreen.tsx +7 -16
  437. package/src/ui/screens/FAQScreen.tsx +9 -13
  438. package/src/ui/screens/FeedbackScreen.tsx +8 -22
  439. package/src/ui/screens/FileManagementScreen.tsx +191 -188
  440. package/src/ui/screens/HelpSupportScreen.tsx +7 -13
  441. package/src/ui/screens/HistoryViewScreen.tsx +26 -31
  442. package/src/ui/screens/LanguageSelectorScreen.tsx +12 -46
  443. package/src/ui/screens/LearnMoreUsernamesScreen.tsx +8 -16
  444. package/src/ui/screens/LegalDocumentsScreen.tsx +7 -22
  445. package/src/ui/screens/ManageAccountScreen.tsx +96 -165
  446. package/src/ui/screens/NotificationsScreen.tsx +7 -13
  447. package/src/ui/screens/PaymentGatewayScreen.tsx +3 -10
  448. package/src/ui/screens/PreferencesScreen.tsx +7 -13
  449. package/src/ui/screens/PremiumSubscriptionScreen.tsx +52 -90
  450. package/src/ui/screens/PrivacySettingsScreen.tsx +9 -21
  451. package/src/ui/screens/ProfileScreen.tsx +9 -11
  452. package/src/ui/screens/SavesCollectionsScreen.tsx +7 -13
  453. package/src/ui/screens/SearchSettingsScreen.tsx +9 -21
  454. package/src/ui/screens/UserLinksScreen.tsx +7 -14
  455. package/src/ui/screens/UserListScreen.tsx +2 -5
  456. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
  457. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +9 -7
  458. package/src/ui/screens/trust/TrustAboutScreen.tsx +10 -17
  459. package/src/ui/screens/trust/TrustCenterScreen.tsx +9 -28
  460. package/src/ui/screens/trust/TrustFAQScreen.tsx +15 -18
  461. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +3 -5
  462. package/src/ui/screens/trust/TrustRewardsScreen.tsx +11 -26
  463. package/src/ui/screens/trust/TrustRulesScreen.tsx +10 -13
  464. package/src/ui/types/navigation.ts +8 -0
  465. package/src/ui/types/surfaceScreen.ts +38 -0
  466. package/lib/commonjs/ui/components/BottomSheet.js +0 -49
  467. package/lib/commonjs/ui/components/BottomSheet.js.map +0 -1
  468. package/lib/commonjs/ui/components/BottomSheetRouter.js +0 -298
  469. package/lib/commonjs/ui/components/BottomSheetRouter.js.map +0 -1
  470. package/lib/commonjs/ui/components/Header.js +0 -305
  471. package/lib/commonjs/ui/components/Header.js.map +0 -1
  472. package/lib/commonjs/ui/components/OxyAccountDialog.js +0 -259
  473. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +0 -1
  474. package/lib/module/ui/components/BottomSheet.js +0 -45
  475. package/lib/module/ui/components/BottomSheet.js.map +0 -1
  476. package/lib/module/ui/components/BottomSheetRouter.js +0 -292
  477. package/lib/module/ui/components/BottomSheetRouter.js.map +0 -1
  478. package/lib/module/ui/components/Header.js +0 -299
  479. package/lib/module/ui/components/Header.js.map +0 -1
  480. package/lib/module/ui/components/OxyAccountDialog.js +0 -254
  481. package/lib/module/ui/components/OxyAccountDialog.js.map +0 -1
  482. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts +0 -29
  483. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +0 -1
  484. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts +0 -9
  485. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +0 -1
  486. package/lib/typescript/commonjs/ui/components/Header.d.ts +0 -33
  487. package/lib/typescript/commonjs/ui/components/Header.d.ts.map +0 -1
  488. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +0 -37
  489. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +0 -1
  490. package/lib/typescript/module/ui/components/BottomSheet.d.ts +0 -29
  491. package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +0 -1
  492. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +0 -9
  493. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +0 -1
  494. package/lib/typescript/module/ui/components/Header.d.ts +0 -33
  495. package/lib/typescript/module/ui/components/Header.d.ts.map +0 -1
  496. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +0 -37
  497. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +0 -1
  498. package/src/ui/components/BottomSheet.tsx +0 -48
  499. package/src/ui/components/BottomSheetRouter.tsx +0 -310
  500. package/src/ui/components/Header.tsx +0 -224
  501. package/src/ui/components/OxyAccountDialog.tsx +0 -243
  502. package/src/ui/navigation/__tests__/getSheetConfig.test.ts +0 -36
@@ -0,0 +1,60 @@
1
+ import type React from 'react';
2
+ import { ActivityIndicator, StyleSheet } from 'react-native';
3
+ import { useTheme } from '@oxyhq/bloom/theme';
4
+ import { PressableScale } from '@oxyhq/bloom/pressable-scale';
5
+ import { Text } from '@oxyhq/bloom/typography';
6
+
7
+ export interface SurfaceHeaderActionProps {
8
+ /** Button label (e.g. a translated "Save"). */
9
+ label: string;
10
+ onPress: () => void;
11
+ /** Show a spinner instead of the label (also disables the button). */
12
+ loading?: boolean;
13
+ disabled?: boolean;
14
+ }
15
+
16
+ /**
17
+ * A filled pill action for a surface's nav-header right slot — the canonical
18
+ * "Save" affordance. Pass a memoized instance to `useSurfaceHeader({ right })`
19
+ * so the header does not thrash between renders.
20
+ */
21
+ export const SurfaceHeaderAction: React.FC<SurfaceHeaderActionProps> = ({
22
+ label,
23
+ onPress,
24
+ loading,
25
+ disabled,
26
+ }) => {
27
+ const { colors } = useTheme();
28
+ const isDisabled = disabled || loading;
29
+ return (
30
+ <PressableScale
31
+ onPress={onPress}
32
+ disabled={isDisabled}
33
+ accessibilityRole="button"
34
+ accessibilityLabel={label}
35
+ style={[styles.button, { backgroundColor: colors.primary, opacity: isDisabled ? 0.5 : 1 }]}
36
+ >
37
+ {loading ? (
38
+ <ActivityIndicator size="small" color={colors.primaryForeground} />
39
+ ) : (
40
+ <Text style={[styles.label, { color: colors.primaryForeground }]}>{label}</Text>
41
+ )}
42
+ </PressableScale>
43
+ );
44
+ };
45
+
46
+ const styles = StyleSheet.create({
47
+ button: {
48
+ height: 36,
49
+ minWidth: 64,
50
+ paddingHorizontal: 14,
51
+ borderRadius: 18,
52
+ alignItems: 'center',
53
+ justifyContent: 'center',
54
+ },
55
+ label: {
56
+ fontSize: 14,
57
+ fontWeight: '600',
58
+ letterSpacing: -0.2,
59
+ },
60
+ });
@@ -0,0 +1,226 @@
1
+ import React, { useCallback, useEffect, useMemo, useState, type ErrorInfo } from 'react';
2
+ import { StyleSheet, Text, View } from 'react-native';
3
+ import { useStore } from 'zustand';
4
+ import { useTheme } from '@oxyhq/bloom/theme';
5
+ import { useDialogHeader, type DialogHeaderConfig } from '@oxyhq/bloom/dialog';
6
+ import type { SurfaceControls } from '@oxyhq/bloom/surfaces';
7
+ import type { RouteName } from '../navigation/routes';
8
+ import { getScreenComponent } from '../navigation/routes';
9
+ import { pushSurfaceBackHandler } from '../navigation/surfaceBackBridge';
10
+ import type { SurfaceNavStack } from '../navigation/surfaceNavStack';
11
+ import { getSurfaceConfig, type SurfacePresentation } from '../navigation/surfaceRegistry';
12
+ import {
13
+ closeAllRouteSurfaces,
14
+ navigateWithinOrPresent,
15
+ presentRoute,
16
+ replaceWithinOrPresent,
17
+ } from '../navigation/surfaces';
18
+ import {
19
+ SurfaceHeaderContext,
20
+ type SurfaceHeaderContent,
21
+ } from '../hooks/useSurfaceHeader';
22
+ import type { BaseScreenProps } from '../types/navigation';
23
+
24
+ /** Error boundary catching screen render failures (e.g. a lazy `require()` throw). */
25
+ interface ScreenErrorBoundaryState {
26
+ error: Error | null;
27
+ }
28
+
29
+ class ScreenErrorBoundary extends React.Component<
30
+ { screenName: string; children: React.ReactNode },
31
+ ScreenErrorBoundaryState
32
+ > {
33
+ state: ScreenErrorBoundaryState = { error: null };
34
+
35
+ static getDerivedStateFromError(error: Error): ScreenErrorBoundaryState {
36
+ return { error };
37
+ }
38
+
39
+ componentDidCatch(error: Error, info: ErrorInfo): void {
40
+ if (__DEV__) {
41
+ console.error(
42
+ `[SurfaceScreen] Screen "${this.props.screenName}" crashed:`,
43
+ error,
44
+ info.componentStack,
45
+ );
46
+ }
47
+ }
48
+
49
+ componentDidUpdate(prevProps: { screenName: string }): void {
50
+ if (prevProps.screenName !== this.props.screenName && this.state.error) {
51
+ this.setState({ error: null });
52
+ }
53
+ }
54
+
55
+ render(): React.ReactNode {
56
+ if (this.state.error) {
57
+ return (
58
+ <View style={errorStyles.container}>
59
+ <Text style={errorStyles.title}>Something went wrong</Text>
60
+ {__DEV__ && <Text style={errorStyles.message}>{this.state.error.message}</Text>}
61
+ </View>
62
+ );
63
+ }
64
+ return this.props.children;
65
+ }
66
+ }
67
+
68
+ const errorStyles = StyleSheet.create({
69
+ container: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 24 },
70
+ title: { fontSize: 16, fontWeight: '600', marginBottom: 8 },
71
+ message: { fontSize: 13, textAlign: 'center' },
72
+ });
73
+
74
+ export interface SurfaceScreenProps {
75
+ /** This surface's route history (the NAV-WITHIN axis). */
76
+ navStack: SurfaceNavStack;
77
+ /** Bloom's per-surface controls (dismiss / present a child) — the DEPTH axis. */
78
+ surface: SurfaceControls;
79
+ /** This surface's presentation, so `navigate` knows when to drill in vs. stack. */
80
+ presentation: SurfacePresentation;
81
+ /** Whether backdrop / Escape / back may dismiss at the root frame. Defaults to true. */
82
+ dismissOnBackdrop?: boolean;
83
+ }
84
+
85
+ /**
86
+ * Binds one SDK surface to its content: resolves the lazy screen for the current
87
+ * nav-stack frame and renders it inside the error boundary with the per-surface
88
+ * navigation props. Mounted by `surfaces.present` as the Bloom surface's content.
89
+ *
90
+ * Dismissal is driven through the nav stack's `closing` flag (watched in an
91
+ * effect) rather than a captured-controls call, so a dismiss requested before
92
+ * this surface mounted still resolves the Bloom surface exactly once.
93
+ */
94
+ function SurfaceScreen({
95
+ navStack,
96
+ surface,
97
+ presentation,
98
+ dismissOnBackdrop = true,
99
+ }: SurfaceScreenProps) {
100
+ const theme = useTheme();
101
+ const state = useStore(navStack.store);
102
+ const top = state.frames[state.frames.length - 1];
103
+
104
+ useEffect(() => {
105
+ if (state.closing) surface.dismiss(state.closeResult);
106
+ }, [state.closing, state.closeResult, surface]);
107
+
108
+ const ScreenComponent = useMemo(() => getScreenComponent(top.route) ?? null, [top.route]);
109
+
110
+ const navigate = useCallback(
111
+ (route: RouteName, props?: Record<string, unknown>) =>
112
+ navigateWithinOrPresent(presentation, navStack, route, props),
113
+ [navStack, presentation],
114
+ );
115
+
116
+ const replace = useCallback(
117
+ (route: RouteName, props?: Record<string, unknown>) =>
118
+ replaceWithinOrPresent(presentation, navStack, route, props),
119
+ [navStack, presentation],
120
+ );
121
+
122
+ const dismiss = useCallback((result?: unknown) => navStack.requestDismiss(result), [navStack]);
123
+
124
+ const canGoBack = useCallback(() => navStack.canGoBack(), [navStack]);
125
+
126
+ const setStep = useCallback((step: number) => navStack.setStep(step), [navStack]);
127
+
128
+ // Screen-facing back: pop a frame, else step a wizard back, else dismiss the
129
+ // surface — the exact behaviour the single `BottomSheetRouter` had per session.
130
+ const goBack = useCallback((): void => {
131
+ if (navStack.goBack()) return;
132
+ const current = navStack.getTop();
133
+ if (current.step > 0) {
134
+ navStack.setStep(current.step - 1);
135
+ return;
136
+ }
137
+ navStack.requestDismiss();
138
+ }, [navStack]);
139
+
140
+ const handleSystemBack = useCallback((): boolean => {
141
+ if (navStack.goBack()) return true;
142
+ const current = navStack.getTop();
143
+ if (current.step > 0) {
144
+ navStack.setStep(current.step - 1);
145
+ return true;
146
+ }
147
+ if (dismissOnBackdrop) navStack.requestDismiss();
148
+ return true;
149
+ }, [navStack, dismissOnBackdrop]);
150
+
151
+ useEffect(() => pushSurfaceBackHandler(handleSystemBack), [handleSystemBack]);
152
+
153
+ const present = useCallback(
154
+ (route: RouteName, props?: Record<string, unknown>) => presentRoute(route, props).result,
155
+ [],
156
+ );
157
+
158
+ // --- Dialog nav-header wiring ------------------------------------------
159
+ // Screens render NO header of their own: the Dialog owns a sticky gradient nav
160
+ // bar + a large collapsing title. Here the surface HOST supplies the back/close
161
+ // wiring and bridges the mounted screen's runtime contribution (its translated
162
+ // title/subtitle + any action slot, via `useSurfaceHeader`) into the Dialog's
163
+ // header. One writer to Bloom's header store — this merge — so back/close and
164
+ // the screen's content never race.
165
+ const [headerContent, setHeaderContent] = useState<SurfaceHeaderContent | null>(null);
166
+ const headerContext = useMemo(() => ({ setContent: setHeaderContent }), []);
167
+
168
+ const headerMode = useMemo(
169
+ () => getSurfaceConfig(top.route, top.props).header,
170
+ [top.route, top.props],
171
+ );
172
+ // Show a back affordance whenever the surface can navigate back — either an
173
+ // earlier frame in this surface's stack, or an earlier wizard step.
174
+ const canGoBackNow = state.frames.length > 1 || top.step > 0;
175
+
176
+ const dialogHeader = useMemo<DialogHeaderConfig | null>(() => {
177
+ if (!headerMode) return null;
178
+ return {
179
+ largeTitle: true,
180
+ ...headerContent,
181
+ // A screen may own its back (e.g. the account dialog's per-view back via
182
+ // `useSurfaceHeader({ onBack })`); otherwise the surface's nav-stack back
183
+ // drives it (a drilled-in frame / wizard step).
184
+ onBack: headerContent?.onBack ?? (canGoBackNow ? goBack : undefined),
185
+ };
186
+ }, [headerMode, headerContent, canGoBackNow, goBack]);
187
+
188
+ useDialogHeader(dialogHeader);
189
+
190
+ const screenProps = useMemo<BaseScreenProps>(() => {
191
+ const { initialStep: _omitInitialStep, ...rest } = top.props;
192
+ return {
193
+ // NAV-WITHIN
194
+ navigate,
195
+ goBack,
196
+ replace,
197
+ canGoBack,
198
+ initialStep: top.step,
199
+ step: top.step,
200
+ onStepChange: setStep,
201
+ setStep,
202
+ currentScreen: top.route,
203
+ // DEPTH — `onClose`/`onAuthenticated` unwind the whole session (matching the
204
+ // old `closeBottomSheet`); `dismiss`/`present` are the per-surface controls.
205
+ onClose: closeAllRouteSurfaces,
206
+ onAuthenticated: closeAllRouteSurfaces,
207
+ dismiss,
208
+ present,
209
+ // Theme + the route's own props.
210
+ theme: theme.mode,
211
+ ...rest,
212
+ };
213
+ }, [navigate, goBack, replace, canGoBack, setStep, present, dismiss, theme.mode, top.route, top.step, top.props]);
214
+
215
+ if (!ScreenComponent) return null;
216
+
217
+ return (
218
+ <SurfaceHeaderContext.Provider value={headerContext}>
219
+ <ScreenErrorBoundary screenName={top.route}>
220
+ <ScreenComponent {...screenProps} />
221
+ </ScreenErrorBoundary>
222
+ </SurfaceHeaderContext.Provider>
223
+ );
224
+ }
225
+
226
+ export default SurfaceScreen;
@@ -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
+ }