@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
@@ -8,15 +8,17 @@ var _react = require("react");
8
8
  var _core = require("@oxyhq/core");
9
9
  var _bloom = require("@oxyhq/bloom");
10
10
  var _avatarUtils = require("../utils/avatarUtils.js");
11
+ var _surfaces = require("../navigation/surfaces.js");
11
12
  /**
12
13
  * Avatar Picker Hook
13
14
  *
14
15
  * Extracts avatar selection logic from OxyContext for better modularity.
15
16
  *
16
- * Flow:
17
- * 1. Open the FileManagement bottom sheet in select mode for image files.
18
- * 2. After the user picks an image, route to the AvatarCrop screen so they
19
- * can square-crop + zoom before the avatar is set.
17
+ * Flow (typed promises over the shared surface stack — no callback props):
18
+ * 1. `surfaces.present('FileManagement', …)` opens the image-only picker and
19
+ * resolves with the picked file (or `undefined` if the user cancels).
20
+ * 2. Resolve a private-safe source URL, then `surfaces.present('AvatarCrop', …)`
21
+ * opens the square-crop editor and resolves with the cropped JPEG.
20
22
  * 3. The cropped JPEG is uploaded as a NEW file via `oxyServices.assetUpload`
21
23
  * and that file becomes the user's avatar.
22
24
  *
@@ -38,8 +40,7 @@ function useAvatarPicker({
38
40
  oxyServices,
39
41
  currentLanguage,
40
42
  activeSessionId,
41
- queryClient,
42
- showBottomSheet
43
+ queryClient
43
44
  }) {
44
45
  /**
45
46
  * Final step: take the cropped JPEG, upload it as a new public file, then
@@ -66,24 +67,27 @@ function useAvatarPicker({
66
67
  _bloom.toast.error(message || (0, _core.translate)(currentLanguage ?? undefined, 'editProfile.toasts.updateAvatarFailed') || 'Failed to update avatar');
67
68
  }
68
69
  }, [activeSessionId, currentLanguage, oxyServices, queryClient]);
69
-
70
- /**
71
- * After the user picks a file in the FileManagement sheet, resolve a working
72
- * source URL and route to the crop screen.
73
- *
74
- * The picked file is usually PRIVATE, so the synchronous
75
- * `getFileDownloadUrl` (public CDN origin) would 404 and the crop screen's
76
- * `Image.getSize` would fail silently. We resolve the authenticated URL via
77
- * `assetGetUrl` (which throws on failure — unlike `getFileDownloadUrlAsync`,
78
- * which swallows errors and falls back to the broken public URL) so a
79
- * failure surfaces a real user-facing error instead of a blank crop canvas.
80
- * No variant is requested — cropping needs the original.
81
- */
82
- const handleFilePicked = (0, _react.useCallback)(async file => {
70
+ const openAvatarPicker = (0, _react.useCallback)(async () => {
71
+ // 1. Present the image-only picker; it dismisses with the picked file when
72
+ // the user taps one, or `undefined` if they cancel.
73
+ const file = await _surfaces.surfaces.present('FileManagement', {
74
+ selectMode: true,
75
+ multiSelect: false,
76
+ disabledMimeTypes: ['video/', 'audio/', 'application/pdf']
77
+ });
78
+ if (!file) return;
83
79
  if (!file.contentType?.startsWith('image/')) {
84
80
  _bloom.toast.error((0, _core.translate)(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') || 'Please select an image file');
85
81
  return;
86
82
  }
83
+
84
+ // 2. Resolve a working source URL. The picked file is usually PRIVATE, so
85
+ // the synchronous `getFileDownloadUrl` (public CDN origin) would 404 and
86
+ // the crop screen's `Image.getSize` would fail silently. `assetGetUrl`
87
+ // throws on failure (unlike `getFileDownloadUrlAsync`, which swallows
88
+ // errors and falls back to the broken public URL), so a failure surfaces
89
+ // a real user-facing error instead of a blank crop canvas. No variant is
90
+ // requested — cropping needs the original.
87
91
  let sourceUri;
88
92
  try {
89
93
  const resolved = await oxyServices.assetGetUrl(file.id);
@@ -96,26 +100,17 @@ function useAvatarPicker({
96
100
  _bloom.toast.error(message || (0, _core.translate)(currentLanguage ?? undefined, 'editProfile.toasts.cropMeasureFailed') || 'Could not load the selected image');
97
101
  return;
98
102
  }
99
- showBottomSheet({
100
- screen: 'AvatarCrop',
101
- props: {
102
- imageUri: sourceUri,
103
- onConfirm: finalizeCroppedAvatar
104
- }
105
- });
106
- }, [currentLanguage, finalizeCroppedAvatar, oxyServices, showBottomSheet]);
107
- const openAvatarPicker = (0, _react.useCallback)(() => {
108
- showBottomSheet({
109
- screen: 'FileManagement',
110
- props: {
111
- selectMode: true,
112
- multiSelect: false,
113
- disabledMimeTypes: ['video/', 'audio/', 'application/pdf'],
114
- afterSelect: 'none',
115
- onSelect: handleFilePicked
116
- }
103
+
104
+ // 3. Present the square-crop editor in place of the picker; it dismisses
105
+ // with the cropped JPEG on confirm, or `undefined` if cancelled.
106
+ const cropped = await _surfaces.surfaces.present('AvatarCrop', {
107
+ imageUri: sourceUri
117
108
  });
118
- }, [handleFilePicked, showBottomSheet]);
109
+ if (!cropped) return;
110
+
111
+ // 4. Upload + set as the user's avatar.
112
+ await finalizeCroppedAvatar(cropped);
113
+ }, [currentLanguage, finalizeCroppedAvatar, oxyServices]);
119
114
  return {
120
115
  openAvatarPicker
121
116
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_core","_bloom","_avatarUtils","extractUploadedFileId","result","undefined","id","file","first","files","useAvatarPicker","oxyServices","currentLanguage","activeSessionId","queryClient","showBottomSheet","finalizeCroppedAvatar","useCallback","cropped","uploadResult","assetUpload","uri","type","mime","name","Date","now","newFileId","Error","updateAvatarVisibility","updateProfileWithAvatar","avatar","toast","success","translate","e","message","error","handleFilePicked","contentType","startsWith","sourceUri","resolved","assetGetUrl","url","screen","props","imageUri","onConfirm","openAvatarPicker","selectMode","multiSelect","disabledMimeTypes","afterSelect","onSelect"],"sourceRoot":"../../../../src","sources":["ui/hooks/useAvatarPicker.ts"],"mappings":";;;;;;AAgBA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;;AAOA,SAASI,qBAAqBA,CAACC,MAAqC,EAAsB;EACxF,IAAI,CAACA,MAAM,EAAE,OAAOC,SAAS;EAC7B,IAAI,OAAOD,MAAM,CAACE,EAAE,KAAK,QAAQ,EAAE,OAAOF,MAAM,CAACE,EAAE;EACnD,IAAIF,MAAM,CAACG,IAAI,EAAED,EAAE,EAAE,OAAOF,MAAM,CAACG,IAAI,CAACD,EAAE;EAC1C,MAAME,KAAK,GAAGJ,MAAM,CAACK,KAAK,GAAG,CAAC,CAAC;EAC/B,IAAID,KAAK,EAAEF,EAAE,EAAE,OAAOE,KAAK,CAACF,EAAE;EAC9B,OAAOD,SAAS;AAClB;AAEO,SAASK,eAAeA,CAAC;EAC9BC,WAAW;EACXC,eAAe;EACfC,eAAe;EACfC,WAAW;EACXC;AACsB,CAAC,EAAE;EACzB;AACF;AACA;AACA;EACE,MAAMC,qBAAqB,GAAG,IAAAC,kBAAW,EACvC,MAAOC,OAAyB,IAAK;IACnC,IAAI;MACF,MAAMC,YAAY,GAAI,MAAMR,WAAW,CAACS,WAAW,CACjD;QACEC,GAAG,EAAEH,OAAO,CAACG,GAAG;QAChBC,IAAI,EAAEJ,OAAO,CAACK,IAAI;QAClBC,IAAI,EAAE,UAAUC,IAAI,CAACC,GAAG,CAAC,CAAC;MAC5B,CAAC,EACD,QACF,CAAuB;MAEvB,MAAMC,SAAS,GAAGxB,qBAAqB,CAACgB,YAAY,CAAC;MAC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AAiD,CAAC;MACpE;MACAa,SAAS,GAAGC,QAAQ,CAACE,GAAG;IAC1B,CAAC,CAAC,OAAOT,CAAU,EAAE;MACnB,MAAMC,OAAO,GAAGD,CAAC,YAAYP,KAAK,GAAGO,CAAC,CAACC,OAAO,GAAG/B,SAAS;MAC1D2B,YAAK,CAACK,KAAK,CACTD,OAAO,IACL,IAAAF,eAAS,EAACtB,eAAe,IAAIP,SAAS,EAAE,sCAAsC,CAAC,IAC/E,mCACJ,CAAC;MACD;IACF;IAEAU,eAAe,CAAC;MACd8B,MAAM,EAAE,YAAY;MACpBC,KAAK,EAAE;QACLC,QAAQ,EAAEN,SAAS;QACnBO,SAAS,EAAEhC;MACb;IACF,CAAC,CAAC;EACJ,CAAC,EACD,CAACJ,eAAe,EAAEI,qBAAqB,EAAEL,WAAW,EAAEI,eAAe,CACvE,CAAC;EAED,MAAMkC,gBAAgB,GAAG,IAAAhC,kBAAW,EAAC,MAAM;IACzCF,eAAe,CAAC;MACd8B,MAAM,EAAE,gBAAgB;MACxBC,KAAK,EAAE;QACLI,UAAU,EAAE,IAAI;QAChBC,WAAW,EAAE,KAAK;QAClBC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC;QAC1DC,WAAW,EAAE,MAAM;QACnBC,QAAQ,EAAEhB;MACZ;IACF,CAAC,CAAC;EACJ,CAAC,EAAE,CAACA,gBAAgB,EAAEvB,eAAe,CAAC,CAAC;EAEvC,OAAO;IAAEkC;EAAiB,CAAC;AAC7B","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_core","_bloom","_avatarUtils","_surfaces","extractUploadedFileId","result","undefined","id","file","first","files","useAvatarPicker","oxyServices","currentLanguage","activeSessionId","queryClient","finalizeCroppedAvatar","useCallback","cropped","uploadResult","assetUpload","uri","type","mime","name","Date","now","newFileId","Error","updateAvatarVisibility","updateProfileWithAvatar","avatar","toast","success","translate","e","message","error","openAvatarPicker","surfaces","present","selectMode","multiSelect","disabledMimeTypes","contentType","startsWith","sourceUri","resolved","assetGetUrl","url","imageUri"],"sourceRoot":"../../../../src","sources":["ui/hooks/useAvatarPicker.ts"],"mappings":";;;;;;AAiBA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA;;AAOA,SAASK,qBAAqBA,CAACC,MAAqC,EAAsB;EACxF,IAAI,CAACA,MAAM,EAAE,OAAOC,SAAS;EAC7B,IAAI,OAAOD,MAAM,CAACE,EAAE,KAAK,QAAQ,EAAE,OAAOF,MAAM,CAACE,EAAE;EACnD,IAAIF,MAAM,CAACG,IAAI,EAAED,EAAE,EAAE,OAAOF,MAAM,CAACG,IAAI,CAACD,EAAE;EAC1C,MAAME,KAAK,GAAGJ,MAAM,CAACK,KAAK,GAAG,CAAC,CAAC;EAC/B,IAAID,KAAK,EAAEF,EAAE,EAAE,OAAOE,KAAK,CAACF,EAAE;EAC9B,OAAOD,SAAS;AAClB;AAEO,SAASK,eAAeA,CAAC;EAC9BC,WAAW;EACXC,eAAe;EACfC,eAAe;EACfC;AACsB,CAAC,EAAE;EACzB;AACF;AACA;AACA;EACE,MAAMC,qBAAqB,GAAG,IAAAC,kBAAW,EACvC,MAAOC,OAAyB,IAAK;IACnC,IAAI;MACF,MAAMC,YAAY,GAAI,MAAMP,WAAW,CAACQ,WAAW,CACjD;QACEC,GAAG,EAAEH,OAAO,CAACG,GAAG;QAChBC,IAAI,EAAEJ,OAAO,CAACK,IAAI;QAClBC,IAAI,EAAE,UAAUC,IAAI,CAACC,GAAG,CAAC,CAAC;MAC5B,CAAC,EACD,QACF,CAAuB;MAEvB,MAAMC,SAAS,GAAGvB,qBAAqB,CAACe,YAAY,CAAC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ACA;IACA;IACA;IACA,IAAIwC,SAAiB;IACrB,IAAI;MACF,MAAMC,QAAQ,GAAG,MAAMnC,WAAW,CAACoC,WAAW,CAACxC,IAAI,CAACD,EAAE,CAAC;MACvD,IAAI,CAACwC,QAAQ,EAAEE,GAAG,EAAE;QAClB,MAAM,IAAIrB,KAAK,CAAC,iDAAiD,CAAC;MACpE;MACAkB,SAAS,GAAGC,QAAQ,CAACE,GAAG;IAC1B,CAAC,CAAC,OAAOd,CAAU,EAAE;MACnB,MAAMC,OAAO,GAAGD,CAAC,YAAYP,KAAK,GAAGO,CAAC,CAACC,OAAO,GAAG9B,SAAS;MAC1D0B,YAAK,CAACK,KAAK,CACTD,OAAO,IACL,IAAAF,eAAS,EAACrB,eAAe,IAAIP,SAAS,EAAE,sCAAsC,CAAC,IAC/E,mCACJ,CAAC;MACD;IACF;;IAEA;IACA;IACA,MAAMY,OAAO,GAAG,MAAMqB,kBAAQ,CAACC,OAAO,CAAC,YAAY,EAAE;MAAEU,QAAQ,EAAEJ;IAAU,CAAC,CAAC;IAC7E,IAAI,CAAC5B,OAAO,EAAE;;IAEd;IACA,MAAMF,qBAAqB,CAACE,OAAO,CAAC;EACtC,CAAC,EAAE,CAACL,eAAe,EAAEG,qBAAqB,EAAEJ,WAAW,CAAC,CAAC;EAEzD,OAAO;IAAE0B;EAAiB,CAAC;AAC7B","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SurfaceHeaderContext = void 0;
7
+ exports.useSurfaceHeader = useSurfaceHeader;
8
+ var _react = require("react");
9
+ /**
10
+ * The header content a mounted surface screen contributes at runtime: its
11
+ * (translated) title/subtitle and optional slot nodes. Back/close affordances
12
+ * are owned by the surface host (`SurfaceScreen`) — a screen never wires them.
13
+ *
14
+ * A `right` slot is the canonical place for a screen-state action (e.g. a Save
15
+ * button whose disabled/loading state reflects the form). Slot nodes MUST be
16
+ * referentially stable (memoize them with `useMemo`) so the header does not
17
+ * thrash.
18
+ */
19
+
20
+ /**
21
+ * Provided by {@link ../components/SurfaceScreen}. Bridges a screen's runtime
22
+ * header contribution up to the host, which merges it with the back/close
23
+ * wiring and drives the Dialog's own nav header. `null` outside a surface (or in
24
+ * a headerless surface), so {@link useSurfaceHeader} is a safe no-op there.
25
+ */
26
+ const SurfaceHeaderContext = exports.SurfaceHeaderContext = /*#__PURE__*/(0, _react.createContext)(null);
27
+
28
+ /**
29
+ * Declare the Dialog nav header's content from within a surface screen — its
30
+ * title/subtitle and any action slot. Merges over nothing (the host owns
31
+ * back/close), replaces on change, and clears on unmount. Call it unconditionally;
32
+ * it is a no-op outside a header-mode surface.
33
+ */
34
+ function useSurfaceHeader(content) {
35
+ const ctx = (0, _react.useContext)(SurfaceHeaderContext);
36
+ const set = ctx?.setContent;
37
+ // Set synchronously in the commit's layout phase so the bar/title fill in
38
+ // BEFORE the browser paints — no first-frame flash of an empty bar.
39
+ (0, _react.useLayoutEffect)(() => {
40
+ if (!set) return;
41
+ set(content ?? null);
42
+ return () => set(null);
43
+ // Slot nodes (`left`/`right`) are compared by identity; callers memoize them.
44
+ }, [set, content?.title, content?.subtitle, content?.largeTitle, content?.left, content?.right, content?.onBack]);
45
+ }
46
+ //# sourceMappingURL=useSurfaceHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","SurfaceHeaderContext","exports","createContext","useSurfaceHeader","content","ctx","useContext","set","setContent","useLayoutEffect","title","subtitle","largeTitle","left","right","onBack"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSurfaceHeader.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,gBAAG,IAAAE,oBAAa,EAAmC,IAAI,CAAC;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAACC,OAAgD,EAAQ;EACvF,MAAMC,GAAG,GAAG,IAAAC,iBAAU,EAACN,oBAAoB,CAAC;EAC5C,MAAMO,GAAG,GAAGF,GAAG,EAAEG,UAAU;EAC3B;EACA;EACA,IAAAC,sBAAe,EAAC,MAAM;IACpB,IAAI,CAACF,GAAG,EAAE;IACVA,GAAG,CAACH,OAAO,IAAI,IAAI,CAAC;IACpB,OAAO,MAAMG,GAAG,CAAC,IAAI,CAAC;IACtB;EACF,CAAC,EAAE,CACDA,GAAG,EACHH,OAAO,EAAEM,KAAK,EACdN,OAAO,EAAEO,QAAQ,EACjBP,OAAO,EAAEQ,UAAU,EACnBR,OAAO,EAAES,IAAI,EACbT,OAAO,EAAEU,KAAK,EACdV,OAAO,EAAEW,MAAM,CAChB,CAAC;AACJ","ignoreList":[]}
@@ -33,7 +33,7 @@ const EMPTY_SNAPSHOT = {
33
33
  * real per-account name / email / avatar / color.
34
34
  *
35
35
  * This is a thin binding over the shared `AccountDialogController` in
36
- * `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialog} renders),
36
+ * `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialogScreen} renders),
37
37
  * so there is ONE projection (`projectSwitchableAccounts`) and one switch path
38
38
  * (`controller.switchTo`) across the whole SDK — the local duplicate projection
39
39
  * this hook used to own has been removed. Every switch routes through
@@ -9,10 +9,22 @@ exports.openAccountDialog = openAccountDialog;
9
9
  exports.registerAccountDialogControls = registerAccountDialogControls;
10
10
  exports.subscribeToAccountDialog = subscribeToAccountDialog;
11
11
  /**
12
- * Imperative controls for the unified {@link OxyAccountDialog}.
12
+ * Imperative, outside-React entry points for the unified `OxyAccountDialogScreen`.
13
+ *
14
+ * These delegate to the live handles the mounted `OxyProvider` registers via
15
+ * {@link registerAccountDialogControls}. Under the hood `open`/`close` present
16
+ * and dismiss the `AccountDialog` surface on the shared Bloom surface stack
17
+ * (`OxyContext.openAccountDialog` → `presentDetached('AccountDialog', …)`), so
18
+ * whether the dialog is open is owned by that stack — this module is only the
19
+ * thin bridge that reaches the provider's controller (which sets the dialog
20
+ * view) from a non-React call site.
13
21
  */
14
22
 
15
- /** Live open/close handles registered by the mounted provider. */
23
+ /**
24
+ * Live open/close handles registered by the mounted provider. `open` presents
25
+ * the `AccountDialog` surface (and points its view); `close` dismisses it. Both
26
+ * are stack operations — this interface never carries visibility state.
27
+ */
16
28
 
17
29
  let controls = null;
18
30
  const visibilityListeners = new Set();
@@ -1 +1 @@
1
- {"version":3,"names":["controls","visibilityListeners","Set","registerAccountDialogControls","next","openAccountDialog","view","open","closeAccountDialog","close","notifyAccountDialogVisibility","visible","listener","subscribeToAccountDialog","add","delete"],"sourceRoot":"../../../../src","sources":["ui/navigation/accountDialogManager.ts"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;;AAIA;;AAMA,IAAIA,QAAsC,GAAG,IAAI;AACjD,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAE1D,SAASC,6BAA6BA,CAACC,IAA2B,EAAc;EACrFJ,QAAQ,GAAGI,IAAI;EACf,OAAO,MAAM;IACX,IAAIJ,QAAQ,KAAKI,IAAI,EAAE;MACrBJ,QAAQ,GAAG,IAAI;IACjB;EACF,CAAC;AACH;;AAEA;AACO,SAASK,iBAAiBA,CAACC,IAAwB,EAAQ;EAChEN,QAAQ,EAAEO,IAAI,CAACD,IAAI,CAAC;AACtB;;AAEA;AACO,SAASE,kBAAkBA,CAAA,EAAS;EACzCR,QAAQ,EAAES,KAAK,CAAC,CAAC;AACnB;;AAEA;AACO,SAASC,6BAA6BA,CAACC,OAAgB,EAAQ;EACpE,KAAK,MAAMC,QAAQ,IAAIX,mBAAmB,EAAE;IAC1CW,QAAQ,CAACD,OAAO,CAAC;EACnB;AACF;;AAEA;AACO,SAASE,wBAAwBA,CAACD,QAAoC,EAAc;EACzFX,mBAAmB,CAACa,GAAG,CAACF,QAAQ,CAAC;EACjC,OAAO,MAAM;IACXX,mBAAmB,CAACc,MAAM,CAACH,QAAQ,CAAC;EACtC,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["controls","visibilityListeners","Set","registerAccountDialogControls","next","openAccountDialog","view","open","closeAccountDialog","close","notifyAccountDialogVisibility","visible","listener","subscribeToAccountDialog","add","delete"],"sourceRoot":"../../../../src","sources":["ui/navigation/accountDialogManager.ts"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;;AAMA,IAAIA,QAAsC,GAAG,IAAI;AACjD,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAE1D,SAASC,6BAA6BA,CAACC,IAA2B,EAAc;EACrFJ,QAAQ,GAAGI,IAAI;EACf,OAAO,MAAM;IACX,IAAIJ,QAAQ,KAAKI,IAAI,EAAE;MACrBJ,QAAQ,GAAG,IAAI;IACjB;EACF,CAAC;AACH;;AAEA;AACO,SAASK,iBAAiBA,CAACC,IAAwB,EAAQ;EAChEN,QAAQ,EAAEO,IAAI,CAACD,IAAI,CAAC;AACtB;;AAEA;AACO,SAASE,kBAAkBA,CAAA,EAAS;EACzCR,QAAQ,EAAES,KAAK,CAAC,CAAC;AACnB;;AAEA;AACO,SAASC,6BAA6BA,CAACC,OAAgB,EAAQ;EACpE,KAAK,MAAMC,QAAQ,IAAIX,mBAAmB,EAAE;IAC1CW,QAAQ,CAACD,OAAO,CAAC;EACnB;AACF;;AAEA;AACO,SAASE,wBAAwBA,CAACD,QAAoC,EAAc;EACzFX,mBAAmB,CAACa,GAAG,CAACF,QAAQ,CAAC;EACjC,OAAO,MAAM;IACXX,mBAAmB,CAACc,MAAM,CAACH,QAAQ,CAAC;EACtC,CAAC;AACH","ignoreList":[]}
@@ -3,79 +3,61 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.updateState = exports.showBottomSheet = exports.goBack = exports.getState = exports.closeBottomSheet = exports.bottomSheetStore = void 0;
6
+ exports.showBottomSheet = exports.goBack = exports.closeBottomSheet = void 0;
7
7
  var _routes = require("./routes.js");
8
- var _vanilla = require("zustand/vanilla");
8
+ var _surfaceRegistry = require("./surfaceRegistry.js");
9
+ var _surfaces = require("./surfaces.js");
9
10
  /**
10
- * Bottom Sheet State Manager
11
+ * Bottom-sheet manager the INTERNAL adapter that keeps the historical
12
+ * `showBottomSheet` / `closeBottomSheet` API working on top of the new Bloom
13
+ * surface stack (`navigation/surfaces.ts`). The public signatures are unchanged;
14
+ * this file just re-expresses them as thin calls into the typed surface layer.
15
+ *
16
+ * The old single-surface store is gone: `showBottomSheet` now open-or-navigates
17
+ * the "base" (top-most) route surface, and cross-presentation targets (the
18
+ * full-bleed image picker) stack a NEW surface on top — Bloom coordinates the
19
+ * z-order / backdrop / dismiss so nothing clashes.
11
20
  */
12
21
 
13
- const initialState = {
14
- currentScreen: null,
15
- screenProps: {},
16
- currentStep: undefined,
17
- history: [],
18
- isOpen: false,
19
- fullScreen: false
20
- };
21
- const bottomSheetStore = exports.bottomSheetStore = (0, _vanilla.createStore)(() => initialState);
22
- const getState = () => bottomSheetStore.getState();
23
- exports.getState = getState;
22
+ /**
23
+ * Open a bottom-sheet route. If the top-most active surface hosts the SAME
24
+ * presentation (the common all-sheets case) the route is drilled into it; a route
25
+ * with a different presentation (the image picker's full-bleed surface) is
26
+ * presented as a NEW surface on top. Opening with no active surface presents the
27
+ * first one.
28
+ *
29
+ * `fullScreen` is accepted for signature compatibility and ignored — a route's
30
+ * surface is now derived from its registry config, not a per-call flag.
31
+ */
24
32
  const showBottomSheet = screenOrConfig => {
25
33
  const screen = typeof screenOrConfig === 'string' ? screenOrConfig : screenOrConfig.screen;
26
- const props = typeof screenOrConfig === 'string' ? {} : screenOrConfig.props || {};
27
- const fullScreen = typeof screenOrConfig === 'string' ? false : screenOrConfig.fullScreen ?? false;
34
+ const props = typeof screenOrConfig === 'string' ? {} : screenOrConfig.props ?? {};
28
35
  if (!(0, _routes.isValidRoute)(screen)) {
29
36
  if (__DEV__) console.warn(`[BottomSheet] Invalid route: ${screen}`);
30
37
  return;
31
38
  }
32
- const state = bottomSheetStore.getState();
33
-
34
- // Push current screen to history if navigating to different screen
35
- if (state.currentScreen && state.currentScreen !== screen) {
36
- bottomSheetStore.setState({
37
- history: [...state.history, {
38
- screen: state.currentScreen,
39
- props: state.screenProps,
40
- step: state.currentStep
41
- }]
42
- });
39
+ const top = (0, _surfaces.topRouteSurface)();
40
+ if (top && top.presentation === (0, _surfaceRegistry.getSurfacePresentation)(screen, props)) {
41
+ top.navigate(screen, props);
42
+ } else {
43
+ (0, _surfaces.presentRoute)(screen, props);
43
44
  }
44
- bottomSheetStore.setState({
45
- currentScreen: screen,
46
- screenProps: props,
47
- currentStep: typeof props.initialStep === 'number' ? props.initialStep : undefined,
48
- isOpen: true,
49
- fullScreen
50
- });
51
45
  };
46
+
47
+ /** Dismiss the whole bottom-sheet session (every active route surface). */
52
48
  exports.showBottomSheet = showBottomSheet;
53
49
  const closeBottomSheet = () => {
54
- bottomSheetStore.setState(initialState);
50
+ (0, _surfaces.closeAllRouteSurfaces)();
55
51
  };
52
+
53
+ /**
54
+ * Step back within the top-most surface's route history. Returns `true` when a
55
+ * frame was popped, `false` when the surface is already at its root frame.
56
+ */
56
57
  exports.closeBottomSheet = closeBottomSheet;
57
58
  const goBack = () => {
58
- const {
59
- history
60
- } = bottomSheetStore.getState();
61
- if (history.length > 0) {
62
- const prev = history[history.length - 1];
63
- bottomSheetStore.setState({
64
- currentScreen: prev.screen,
65
- screenProps: prev.props,
66
- currentStep: prev.step,
67
- history: history.slice(0, -1)
68
- });
69
- return true;
70
- }
71
- return false;
59
+ const top = (0, _surfaces.topRouteSurface)();
60
+ return top ? top.goBack() : false;
72
61
  };
73
62
  exports.goBack = goBack;
74
- const updateState = updates => {
75
- bottomSheetStore.setState(state => ({
76
- ...state,
77
- ...updates
78
- }));
79
- };
80
- exports.updateState = updateState;
81
63
  //# sourceMappingURL=bottomSheetManager.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_routes","require","_vanilla","initialState","currentScreen","screenProps","currentStep","undefined","history","isOpen","fullScreen","bottomSheetStore","exports","createStore","getState","showBottomSheet","screenOrConfig","screen","props","isValidRoute","__DEV__","console","warn","state","setState","step","initialStep","closeBottomSheet","goBack","length","prev","slice","updateState","updates"],"sourceRoot":"../../../../src","sources":["ui/navigation/bottomSheetManager.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA;AACA;AACA;;AAWA,MAAME,YAA8B,GAAG;EACnCC,aAAa,EAAE,IAAI;EACnBC,WAAW,EAAE,CAAC,CAAC;EACfC,WAAW,EAAEC,SAAS;EACtBC,OAAO,EAAE,EAAE;EACXC,MAAM,EAAE,KAAK;EACbC,UAAU,EAAE;AAChB,CAAC;AAEM,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,oBAAW,EAAmB,MAAMV,YAAY,CAAC;AAE1E,MAAMW,QAAQ,GAAGA,CAAA,KAAMH,gBAAgB,CAACG,QAAQ,CAAC,CAAC;AAACF,OAAA,CAAAE,QAAA,GAAAA,QAAA;AAEnD,MAAMC,eAAe,GACxBC,cAAwG,IACjG;EACP,MAAMC,MAAM,GAAG,OAAOD,cAAc,KAAK,QAAQ,GAAGA,cAAc,GAAGA,cAAc,CAACC,MAAM;EAC1F,MAAMC,KAAK,GAAG,OAAOF,cAAc,KAAK,QAAQ,GAAG,CAAC,CAAC,GAAIA,cAAc,CAACE,KAAK,IAAI,CAAC,CAAE;EACpF,MAAMR,UAAU,GAAG,OAAOM,cAAc,KAAK,QAAQ,GAAG,KAAK,GAAIA,cAAc,CAACN,UAAU,IAAI,KAAM;EAEpG,IAAI,CAAC,IAAAS,oBAAY,EAACF,MAAM,CAAC,EAAE;IACvB,IAAIG,OAAO,EAAEC,OAAO,CAACC,IA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;MACvBZ,WAAW,EAAEwB,IAAI,CAACL,IAAI;MACtBjB,OAAO,EAAEA,OAAO,CAACuB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC;IACF,OAAO,IAAI;EACf;EAEA,OAAO,KAAK;AAChB,CAAC;AAACnB,OAAA,CAAAgB,MAAA,GAAAA,MAAA;AAEK,MAAMI,WAAW,GAAIC,OAAkC,IAAK;EAC/DtB,gBAAgB,CAACa,QAAQ,CAAED,KAAK,KAAM;IAAE,GAAGA,KAAK;IAAE,GAAGU;EAAQ,CAAC,CAAC,CAAC;AACpE,CAAC;AAACrB,OAAA,CAAAoB,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["_routes","require","_surfaceRegistry","_surfaces","showBottomSheet","screenOrConfig","screen","props","isValidRoute","__DEV__","console","warn","top","topRouteSurface","presentation","getSurfacePresentation","navigate","presentRoute","exports","closeBottomSheet","closeAllRouteSurfaces","goBack"],"sourceRoot":"../../../../src","sources":["ui/navigation/bottomSheetManager.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,eAAe,GAC1BC,cAEgF,IACvE;EACT,MAAMC,MAAM,GAAG,OAAOD,cAAc,KAAK,QAAQ,GAAGA,cAAc,GAAGA,cAAc,CAACC,MAAM;EAC1F,MAAMC,KAAK,GAAG,OAAOF,cAAc,KAAK,QAAQ,GAAG,CAAC,CAAC,GAAGA,cAAc,CAACE,KAAK,IAAI,CAAC,CAAC;EAElF,IAAI,CAAC,IAAAC,oBAAY,EAACF,MAAM,CAAC,EAAE;IACzB,IAAIG,OAAO,EAAEC,OAAO,CAACC,IAAI,CAAC,gCAAgCL,MAAM,EAAE,CAAC;IACnE;EACF;EAEA,MAAMM,GAAG,GAAG,IAAAC,yBAAe,EAAC,CAAC;EAC7B,IAAID,GAAG,IAAIA,GAAG,CAACE,YAAY,KAAK,IAAAC,uCAAsB,EAACT,MAAM,EAAEC,KAAK,CAAC,EAAE;IACrEK,GAAG,CAACI,QAAQ,CAACV,MAAM,EAAEC,KAAK,CAAC;EAC7B,CAAC,MAAM;IACL,IAAAU,sBAAY,EAACX,MAAM,EAAEC,KAAK,CAAC;EAC7B;AACF,CAAC;;AAED;AAAAW,OAAA,CAAAd,eAAA,GAAAA,eAAA;AACO,MAAMe,gBAAgB,GAAGA,CAAA,KAAY;EAC1C,IAAAC,+BAAqB,EAAC,CAAC;AACzB,CAAC;;AAED;AACA;AACA;AACA;AAHAF,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAIO,MAAME,MAAM,GAAGA,CAAA,KAAe;EACnC,MAAMT,GAAG,GAAG,IAAAC,yBAAe,EAAC,CAAC;EAC7B,OAAOD,GAAG,GAAGA,GAAG,CAACS,MAAM,CAAC,CAAC,GAAG,KAAK;AACnC,CAAC;AAACH,OAAA,CAAAG,MAAA,GAAAA,MAAA","ignoreList":[]}
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isValidRoute = exports.getSheetConfig = exports.getScreenComponent = void 0;
6
+ exports.isValidRoute = exports.getScreenComponent = void 0;
7
7
  // Lazy loading: Screens are loaded on-demand to break require cycles
8
8
  // This prevents screens (which import OxyContext) from being loaded
9
9
  // before OxyContext is fully initialized
10
10
 
11
11
  // Define all available route names
12
12
 
13
- // General user preferences (theme, reduce-motion, etc.)
13
+ // Unified account switcher + sign-in surface (OxyAccountDialogScreen body)
14
14
 
15
15
  // Lazy screen loaders - functions that return screen components on-demand
16
16
  // This breaks the require cycle by deferring imports until screens are actually needed
@@ -53,7 +53,11 @@ const screenLoaders = {
53
53
  AvatarCrop: () => require('../screens/AvatarCropScreen').default,
54
54
  Notifications: () => require('../screens/NotificationsScreen').default,
55
55
  ConnectedApps: () => require('../screens/ConnectedAppsScreen').default,
56
- Preferences: () => require('../screens/PreferencesScreen').default
56
+ Preferences: () => require('../screens/PreferencesScreen').default,
57
+ // Unified account switcher + sign-in surface. Its body lives in the
58
+ // `OxyAccountDialogScreen` component (folded from the standalone dialog); the
59
+ // surface stack provides the Dialog chrome around it.
60
+ AccountDialog: () => require('../components/OxyAccountDialogScreen').default
57
61
  };
58
62
 
59
63
  // Cache loaded components to avoid re-requiring
@@ -89,59 +93,5 @@ exports.getScreenComponent = getScreenComponent;
89
93
  const isValidRoute = routeName => {
90
94
  return routeName in screenLoaders;
91
95
  };
92
-
93
- /**
94
- * Configuration that BottomSheetRouter applies to the underlying BottomSheet
95
- * for a given route. Adding new options here is additive — never rename or
96
- * remove fields without bumping the consumer surface as a breaking change.
97
- */
98
96
  exports.isValidRoute = isValidRoute;
99
- /**
100
- * Predicate matching FileManagementScreen's internal `isImageOnlyPicker`
101
- * derivation. When the consumer restricts to image MIME types (no videos,
102
- * no audio, no documents), FileManagement renders the flagship PhotoPickerView
103
- * which owns its own FlatList. The sheet must therefore stop scrolling
104
- * children. Kept in sync with `FileManagementScreen` — both check the same
105
- * disabled MIME type families.
106
- */
107
- const isFileManagementImageOnlyPicker = props => {
108
- if (!props.selectMode) return false;
109
- const disabled = props.disabledMimeTypes;
110
- if (!Array.isArray(disabled) || disabled.length === 0) return false;
111
- const has = predicate => disabled.some(mt => typeof mt === 'string' && predicate(mt));
112
- const blocksVideos = has(mt => mt === 'video/' || mt.startsWith('video/'));
113
- const blocksAudio = has(mt => mt === 'audio/' || mt.startsWith('audio/'));
114
- const blocksDocs = has(mt => mt === 'application/pdf' || mt === 'application/' || mt.startsWith('application/'));
115
- return blocksVideos && blocksAudio && blocksDocs;
116
- };
117
-
118
- /** Defaults shared across all routes — preserves the historical in-tree BS UX. */
119
- const DEFAULT_SHEET_CONFIG = {
120
- presentation: 'sheet',
121
- scrollable: true,
122
- manualActivation: true,
123
- dynamicBackdrop: true
124
- };
125
-
126
- /**
127
- * Returns the bottom-sheet configuration for a route. Defaults match the
128
- * pre-refactor in-tree `BottomSheet` (scrollable, manualActivation,
129
- * dynamicBackdrop). Routes opt out per-field as needed.
130
- */
131
- const getSheetConfig = (routeName, screenProps) => {
132
- if (!routeName) return DEFAULT_SHEET_CONFIG;
133
- if (routeName === 'FileManagement' && isFileManagementImageOnlyPicker(screenProps)) {
134
- // The flagship photo picker renders in a responsive Bloom `<Dialog>`
135
- // (bottom-sheet on narrow, centered card on `md+`) rather than the
136
- // in-tree BottomSheet — it owns its own FlatList and reads better as a
137
- // centered panel on wide viewports. The Dialog surface, not this
138
- // config's `scrollable`, governs its scrolling.
139
- return {
140
- ...DEFAULT_SHEET_CONFIG,
141
- presentation: 'dialog'
142
- };
143
- }
144
- return DEFAULT_SHEET_CONFIG;
145
- };
146
- exports.getSheetConfig = getSheetConfig;
147
97
  //# sourceMappingURL=routes.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["screenLoaders","ManageAccount","require","default","AccountVerification","PaymentGateway","Profile","LanguageSelector","PrivacySettings","SearchSettings","FileManagement","HelpSupport","FAQ","Feedback","LegalDocuments","AppInfo","PremiumSubscription","WelcomeNewUser","UserLinks","HistoryView","SavesCollections","EditProfile","EditProfileField","LearnMoreUsernames","TrustCenter","TrustLeaderboard","TrustRewards","TrustRules","AboutTrust","TrustFAQ","FollowersList","FollowingList","CreateAccount","AccountMembers","AccountSettings","AvatarCrop","Notifications","ConnectedApps","Preferences","screenCache","Map","getScreenComponent","routeName","has","get","loader","component","set","error","__DEV__","console","undefined","exports","isValidRoute","isFileManagementImageOnlyPicker","props","selectMode","disabled","disabledMimeTypes","Array","isArray","length","predicate","some","mt","blocksVideos","startsWith","blocksAudio","blocksDocs","DEFAULT_SHEET_CONFIG","presentation","scrollable","manualActivation","dynamicBackdrop","getSheetConfig","screenProps"],"sourceRoot":"../../../../src","sources":["ui/navigation/routes.ts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AO;MAAE,GAAGN,oBAAoB;MAAEC,YAAY,EAAE;IAAS,CAAC;EAC9D;EACA,OAAOD,oBAAoB;AAC/B,CAAC;AAACjB,OAAA,CAAAsB,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["screenLoaders","ManageAccount","require","default","AccountVerification","PaymentGateway","Profile","LanguageSelector","PrivacySettings","SearchSettings","FileManagement","HelpSupport","FAQ","Feedback","LegalDocuments","AppInfo","PremiumSubscription","WelcomeNewUser","UserLinks","HistoryView","SavesCollections","EditProfile","EditProfileField","LearnMoreUsernames","TrustCenter","TrustLeaderboard","TrustRewards","TrustRules","AboutTrust","TrustFAQ","FollowersList","FollowingList","CreateAccount","AccountMembers","AccountSettings","AvatarCrop","Notifications","ConnectedApps","Preferences","AccountDialog","screenCache","Map","getScreenComponent","routeName","has","get","loader","component","set","error","__DEV__","console","undefined","exports","isValidRoute"],"sourceRoot":"../../../../src","sources":["ui/navigation/routes.ts"],"mappings":";;;;;;AAGA;AACA;AACA;;AAEA;;AAsCuB;;AAEvB;AACA;AACA,MAAMA,aAAsE,GAAG;EAC3EC,aAAa,EAAEA,CAAA,KAAMC,OAAO,CAAC,gCAAgC,CAAC,CAACC,OAAO;EACtEC,mBAAmB,EAAEA,CAAA,KAAMF,OAAO,CAAC,sCAAsC,CAAC,CAACC,OAAO;EAClFE,cAAc,EAAEA,CAAA,KAAMH,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO;EACxEG,OAAO,EAAEA,CAAA,KAAMJ,OAAO,CAAC,0BAA0B,CAAC,CAACC,OAAO;EAC1DI,gBAAgB,EAAEA,CAAA,KAAML,OAAO,CAAC,mCAAmC,CAAC,CAACC,OAAO;EAC5EK,eAAe,EAAEA,CAAA,KAAMN,OAAO,CAAC,kCAAkC,CAAC,CAACC,OAAO;EAC1EM,cAAc,EAAEA,CAAA,KAAMP,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO;EACxEO,cAAc,EAAEA,CAAA,KAAMR,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C;;EAEA;EACA,MAAMG,MAAM,GAAG9C,aAAa,CAAC2C,SAAS,CAAC;EACvC,IAAIG,MAAM,EAAE;IACR,IAAI;MACA,MAAMC,SAAS,GAAGD,MAAM,CAAC,CAAC;MAC1BN,WAAW,CAACQ,GAAG,CAACL,SAAS,EAAEI,SAAS,CAAC;MACrC,OAAOA,SAAS;IACpB,CAAC,CAAC,OAAOE,KAAK,EAAE;MACZ,IAAIC,OAAO,EAAE;QACTC,OAAO,CAACF,KAAK,CAAC,mCAAmCN,SAAS,EAAE,EAAEM,KAAK,CAAC;MACxE;MACA,OAAOG,SAAS;IACpB;EACJ;EAEA,OAAOA,SAAS;AACpB,CAAC;;AAED;AACA;AAAAC,OAAA,CAAAX,kBAAA,GAAAA,kBAAA;AACO,MAAMY,YAAY,GAAIX,SAAiB,IAA6B;EACvE,OAAOA,SAAS,IAAI3C,aAAa;AACrC,CAAC;AAACqD,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.__invokeTopSurfaceBackForTests = __invokeTopSurfaceBackForTests;
7
+ exports.__resetSurfaceBackBridgeForTests = __resetSurfaceBackBridgeForTests;
8
+ exports.pushSurfaceBackHandler = pushSurfaceBackHandler;
9
+ var _reactNative = require("react-native");
10
+ /**
11
+ * Per-surface system-back handlers (Android hardware back + web Escape).
12
+ *
13
+ * Bloom's `SurfaceHost` dismisses the whole top surface on back/Escape. The SDK
14
+ * needs the old `BottomSheetRouter` semantics first: pop nav history, step a
15
+ * wizard back, then dismiss. A single global listener delegates to the topmost
16
+ * registered handler so stacked surfaces route correctly.
17
+ */
18
+
19
+ const handlerStack = [];
20
+ let androidInstalled = false;
21
+ let escapeInstalled = false;
22
+ function invokeTopHandler() {
23
+ const handler = handlerStack[handlerStack.length - 1];
24
+ return handler ? handler() : false;
25
+ }
26
+ function installAndroidHandler() {
27
+ if (androidInstalled || _reactNative.Platform.OS !== 'android') return;
28
+ androidInstalled = true;
29
+ _reactNative.BackHandler.addEventListener('hardwareBackPress', () => {
30
+ if (handlerStack.length === 0) return false;
31
+ return invokeTopHandler();
32
+ });
33
+ }
34
+ function installEscapeHandler() {
35
+ if (escapeInstalled || _reactNative.Platform.OS !== 'web') return;
36
+ if (typeof window === 'undefined') return;
37
+ escapeInstalled = true;
38
+ window.addEventListener('keydown', event => {
39
+ if (event.key !== 'Escape' || handlerStack.length === 0) return;
40
+ invokeTopHandler();
41
+ event.stopImmediatePropagation();
42
+ event.preventDefault();
43
+ }, true);
44
+ }
45
+
46
+ /** Register before Bloom's `SurfaceHost` mounts so Escape capture runs first. */
47
+ installEscapeHandler();
48
+
49
+ /** Push a handler for one live surface; returns unregister. */
50
+ function pushSurfaceBackHandler(handler) {
51
+ handlerStack.push(handler);
52
+ installAndroidHandler();
53
+ return () => {
54
+ const index = handlerStack.lastIndexOf(handler);
55
+ if (index >= 0) handlerStack.splice(index, 1);
56
+ };
57
+ }
58
+
59
+ /** Test-only: invoke the top handler. */
60
+ function __invokeTopSurfaceBackForTests() {
61
+ return invokeTopHandler();
62
+ }
63
+
64
+ /** Test-only reset. */
65
+ function __resetSurfaceBackBridgeForTests() {
66
+ handlerStack.length = 0;
67
+ }
68
+ //# sourceMappingURL=surfaceBackBridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","handlerStack","androidInstalled","escapeInstalled","invokeTopHandler","handler","length","installAndroidHandler","Platform","OS","BackHandler","addEventListener","installEscapeHandler","window","event","key","stopImmediatePropagation","preventDefault","pushSurfaceBackHandler","push","index","lastIndexOf","splice","__invokeTopSurfaceBackForTests","__resetSurfaceBackBridgeForTests"],"sourceRoot":"../../../../src","sources":["ui/navigation/surfaceBackBridge.ts"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMC,YAA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