@oxyhq/services 22.9.0 → 22.11.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 (584) 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/AvatarCameraBadge.js +42 -0
  4. package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -0
  5. package/lib/commonjs/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +55 -133
  6. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -0
  7. package/lib/commonjs/ui/components/OxyAuthChooser.js +657 -88
  8. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  9. package/lib/commonjs/ui/components/OxyConsentScreen.js +1 -1
  10. package/lib/commonjs/ui/components/ProfileButton.js +15 -1
  11. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  12. package/lib/commonjs/ui/components/ProfileSummaryCard.js +3 -23
  13. package/lib/commonjs/ui/components/ProfileSummaryCard.js.map +1 -1
  14. package/lib/commonjs/ui/components/RequireOxyAuth.js +1 -1
  15. package/lib/commonjs/ui/components/SurfaceHeaderAction.js +63 -0
  16. package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -0
  17. package/lib/commonjs/ui/components/SurfaceScreen.js +91 -8
  18. package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
  19. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +46 -29
  20. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  21. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +47 -23
  22. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  23. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js +81 -19
  24. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +1 -1
  25. package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +83 -23
  26. package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
  27. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +83 -0
  28. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
  29. package/lib/commonjs/ui/context/OxyContext.js +79 -29
  30. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  31. package/lib/commonjs/ui/hooks/queries/queryKeys.js +18 -1
  32. package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
  33. package/lib/commonjs/ui/hooks/queries/useFileQueries.js +129 -0
  34. package/lib/commonjs/ui/hooks/queries/useFileQueries.js.map +1 -0
  35. package/lib/commonjs/ui/hooks/useAvatarPicker.js +38 -55
  36. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  37. package/lib/commonjs/ui/hooks/useReduceMotion.js +57 -0
  38. package/lib/commonjs/ui/hooks/useReduceMotion.js.map +1 -0
  39. package/lib/commonjs/ui/hooks/useSurfaceHeader.js +46 -0
  40. package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -0
  41. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +1 -1
  42. package/lib/commonjs/ui/navigation/accountDialogManager.js +36 -2
  43. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
  44. package/lib/commonjs/ui/navigation/bottomSheetManager.js +5 -6
  45. package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
  46. package/lib/commonjs/ui/navigation/routes.js +4 -3
  47. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  48. package/lib/commonjs/ui/navigation/surfaceBackBridge.js +68 -0
  49. package/lib/commonjs/ui/navigation/surfaceBackBridge.js.map +1 -0
  50. package/lib/commonjs/ui/navigation/surfaceNavStack.js +62 -15
  51. package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -1
  52. package/lib/commonjs/ui/navigation/surfaceRegistry.js +84 -19
  53. package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
  54. package/lib/commonjs/ui/navigation/surfaces.js +139 -25
  55. package/lib/commonjs/ui/navigation/surfaces.js.map +1 -1
  56. package/lib/commonjs/ui/screens/AccountMembersScreen.js +214 -283
  57. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  58. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +88 -118
  59. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  60. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +22 -36
  61. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  62. package/lib/commonjs/ui/screens/AppInfoScreen.js +219 -226
  63. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  64. package/lib/commonjs/ui/screens/AvatarCropScreen.js +287 -289
  65. package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
  66. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +301 -0
  67. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -0
  68. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +24 -39
  69. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  70. package/lib/commonjs/ui/screens/CreateAccountScreen.js +136 -158
  71. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  72. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +29 -36
  73. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  74. package/lib/commonjs/ui/screens/EditProfileScreen.js +101 -109
  75. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
  76. package/lib/commonjs/ui/screens/FAQScreen.js +10 -15
  77. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  78. package/lib/commonjs/ui/screens/FeedbackScreen.js +8 -16
  79. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  80. package/lib/commonjs/ui/screens/FileManagementScreen.js +403 -627
  81. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  82. package/lib/commonjs/ui/screens/HelpSupportScreen.js +62 -69
  83. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  84. package/lib/commonjs/ui/screens/HistoryViewScreen.js +63 -79
  85. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  86. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +69 -98
  87. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  88. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +8 -14
  89. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
  90. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +77 -94
  91. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  92. package/lib/commonjs/ui/screens/ManageAccountScreen.js +99 -134
  93. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  94. package/lib/commonjs/ui/screens/NotificationsScreen.js +69 -76
  95. package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
  96. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -8
  97. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  98. package/lib/commonjs/ui/screens/PreferencesScreen.js +67 -74
  99. package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
  100. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +55 -91
  101. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  102. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +291 -304
  103. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  104. package/lib/commonjs/ui/screens/ProfileScreen.js +100 -114
  105. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  106. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +38 -45
  107. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  108. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +44 -57
  109. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
  110. package/lib/commonjs/ui/screens/UserLinksScreen.js +24 -31
  111. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
  112. package/lib/commonjs/ui/screens/UserListScreen.js +14 -24
  113. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  114. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +16 -48
  115. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  116. package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +63 -0
  117. package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
  118. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +54 -41
  119. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  120. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +44 -81
  121. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  122. package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +66 -75
  123. package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
  124. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +111 -139
  125. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  126. package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +13 -20
  127. package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
  128. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +14 -27
  129. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  130. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +68 -85
  131. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  132. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +28 -36
  133. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  134. package/lib/commonjs/ui/stores/resetSessionScopedStores.js +8 -3
  135. package/lib/commonjs/ui/stores/resetSessionScopedStores.js.map +1 -1
  136. package/lib/commonjs/ui/utils/avatarUtils.js +11 -2
  137. package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
  138. package/lib/commonjs/ui/utils/fileManagement.js +0 -79
  139. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  140. package/lib/module/index.js +12 -5
  141. package/lib/module/index.js.map +1 -1
  142. package/lib/module/ui/components/AvatarCameraBadge.js +40 -0
  143. package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -0
  144. package/lib/module/ui/components/{OxyAccountDialog.js → OxyAccountDialogScreen.js} +57 -135
  145. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -0
  146. package/lib/module/ui/components/OxyAuthChooser.js +659 -91
  147. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  148. package/lib/module/ui/components/OxyConsentScreen.js +1 -1
  149. package/lib/module/ui/components/ProfileButton.js +16 -2
  150. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  151. package/lib/module/ui/components/ProfileSummaryCard.js +2 -23
  152. package/lib/module/ui/components/ProfileSummaryCard.js.map +1 -1
  153. package/lib/module/ui/components/RequireOxyAuth.js +1 -1
  154. package/lib/module/ui/components/SurfaceHeaderAction.js +58 -0
  155. package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -0
  156. package/lib/module/ui/components/SurfaceScreen.js +93 -10
  157. package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
  158. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +46 -29
  159. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  160. package/lib/module/ui/components/modals/DeleteAccountModal.js +46 -23
  161. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  162. package/lib/module/ui/components/oxyAuthChooserStyles.js +81 -19
  163. package/lib/module/ui/components/oxyAuthChooserStyles.js.map +1 -1
  164. package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +83 -25
  165. package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
  166. package/lib/module/ui/components/surfaces/ActionSheetSurface.js +78 -0
  167. package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
  168. package/lib/module/ui/context/OxyContext.js +80 -30
  169. package/lib/module/ui/context/OxyContext.js.map +1 -1
  170. package/lib/module/ui/hooks/queries/queryKeys.js +16 -0
  171. package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
  172. package/lib/module/ui/hooks/queries/useFileQueries.js +120 -0
  173. package/lib/module/ui/hooks/queries/useFileQueries.js.map +1 -0
  174. package/lib/module/ui/hooks/useAvatarPicker.js +38 -55
  175. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  176. package/lib/module/ui/hooks/useReduceMotion.js +53 -0
  177. package/lib/module/ui/hooks/useReduceMotion.js.map +1 -0
  178. package/lib/module/ui/hooks/useSurfaceHeader.js +42 -0
  179. package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -0
  180. package/lib/module/ui/hooks/useSwitchableAccounts.js +1 -1
  181. package/lib/module/ui/navigation/accountDialogManager.js +34 -2
  182. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
  183. package/lib/module/ui/navigation/bottomSheetManager.js +6 -7
  184. package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
  185. package/lib/module/ui/navigation/routes.js +4 -3
  186. package/lib/module/ui/navigation/routes.js.map +1 -1
  187. package/lib/module/ui/navigation/surfaceBackBridge.js +63 -0
  188. package/lib/module/ui/navigation/surfaceBackBridge.js.map +1 -0
  189. package/lib/module/ui/navigation/surfaceNavStack.js +62 -15
  190. package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -1
  191. package/lib/module/ui/navigation/surfaceRegistry.js +84 -19
  192. package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
  193. package/lib/module/ui/navigation/surfaces.js +138 -26
  194. package/lib/module/ui/navigation/surfaces.js.map +1 -1
  195. package/lib/module/ui/screens/AccountMembersScreen.js +218 -286
  196. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  197. package/lib/module/ui/screens/AccountSettingsScreen.js +92 -121
  198. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  199. package/lib/module/ui/screens/AccountVerificationScreen.js +25 -38
  200. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  201. package/lib/module/ui/screens/AppInfoScreen.js +220 -227
  202. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  203. package/lib/module/ui/screens/AvatarCropScreen.js +289 -291
  204. package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
  205. package/lib/module/ui/screens/ChangeAvatarScreen.js +298 -0
  206. package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -0
  207. package/lib/module/ui/screens/ConnectedAppsScreen.js +26 -40
  208. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  209. package/lib/module/ui/screens/CreateAccountScreen.js +139 -160
  210. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  211. package/lib/module/ui/screens/EditProfileFieldScreen.js +32 -38
  212. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  213. package/lib/module/ui/screens/EditProfileScreen.js +102 -110
  214. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
  215. package/lib/module/ui/screens/FAQScreen.js +11 -15
  216. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  217. package/lib/module/ui/screens/FeedbackScreen.js +10 -17
  218. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  219. package/lib/module/ui/screens/FileManagementScreen.js +408 -631
  220. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  221. package/lib/module/ui/screens/HelpSupportScreen.js +64 -70
  222. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  223. package/lib/module/ui/screens/HistoryViewScreen.js +65 -81
  224. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  225. package/lib/module/ui/screens/LanguageSelectorScreen.js +71 -99
  226. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  227. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +10 -15
  228. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
  229. package/lib/module/ui/screens/LegalDocumentsScreen.js +78 -94
  230. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  231. package/lib/module/ui/screens/ManageAccountScreen.js +102 -137
  232. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  233. package/lib/module/ui/screens/NotificationsScreen.js +71 -77
  234. package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
  235. package/lib/module/ui/screens/PaymentGatewayScreen.js +4 -9
  236. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  237. package/lib/module/ui/screens/PreferencesScreen.js +69 -75
  238. package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
  239. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +58 -93
  240. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  241. package/lib/module/ui/screens/PrivacySettingsScreen.js +293 -305
  242. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  243. package/lib/module/ui/screens/ProfileScreen.js +102 -116
  244. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  245. package/lib/module/ui/screens/SavesCollectionsScreen.js +40 -46
  246. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  247. package/lib/module/ui/screens/SearchSettingsScreen.js +46 -58
  248. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
  249. package/lib/module/ui/screens/UserLinksScreen.js +26 -32
  250. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
  251. package/lib/module/ui/screens/UserListScreen.js +14 -24
  252. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  253. package/lib/module/ui/screens/WelcomeNewUserScreen.js +17 -49
  254. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  255. package/lib/module/ui/screens/fileManagement/FileLibraryError.js +59 -0
  256. package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -0
  257. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +54 -42
  258. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  259. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +45 -81
  260. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  261. package/lib/module/ui/screens/trust/TrustAboutScreen.js +67 -75
  262. package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
  263. package/lib/module/ui/screens/trust/TrustCenterScreen.js +112 -139
  264. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  265. package/lib/module/ui/screens/trust/TrustFAQScreen.js +15 -21
  266. package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
  267. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +14 -26
  268. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  269. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +69 -85
  270. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  271. package/lib/module/ui/screens/trust/TrustRulesScreen.js +30 -37
  272. package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  273. package/lib/module/ui/stores/resetSessionScopedStores.js +8 -3
  274. package/lib/module/ui/stores/resetSessionScopedStores.js.map +1 -1
  275. package/lib/module/ui/utils/avatarUtils.js +11 -2
  276. package/lib/module/ui/utils/avatarUtils.js.map +1 -1
  277. package/lib/module/ui/utils/fileManagement.js +0 -78
  278. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  279. package/lib/typescript/commonjs/index.d.ts +2 -0
  280. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts +4 -0
  282. package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -0
  283. package/lib/typescript/{module/ui/components/OxyAccountDialog.d.ts → commonjs/ui/components/OxyAccountDialogScreen.d.ts} +5 -4
  284. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +3 -3
  286. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +2 -2
  288. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  289. package/lib/typescript/commonjs/ui/components/ProfileSummaryCard.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +1 -1
  291. package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts +16 -0
  292. package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
  293. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +3 -4
  294. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -1
  295. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
  296. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  297. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +17 -2
  298. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  299. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts +75 -13
  300. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
  301. package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
  302. package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
  303. package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
  304. package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
  305. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  306. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +9 -0
  307. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts +50 -0
  309. package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +17 -16
  311. package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts +14 -0
  313. package/lib/typescript/commonjs/ui/hooks/useReduceMotion.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +31 -0
  315. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +1 -1
  317. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +27 -2
  318. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
  319. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +4 -5
  320. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  322. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  323. package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts +16 -0
  324. package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
  325. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +21 -0
  326. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +101 -23
  328. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
  329. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +42 -11
  330. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -1
  331. package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  333. package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  334. package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
  335. package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +18 -9
  336. package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
  337. package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts +34 -0
  338. package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
  339. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  340. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  342. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  346. package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
  347. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  348. package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
  350. package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  352. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  358. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  360. package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  361. package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
  363. package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
  365. package/lib/typescript/commonjs/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
  366. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
  367. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
  369. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  370. package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
  371. package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
  373. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  374. package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  376. package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts +8 -1
  377. package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
  378. package/lib/typescript/commonjs/ui/types/navigation.d.ts +10 -0
  379. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  380. package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
  381. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +0 -48
  382. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  383. package/lib/typescript/module/index.d.ts +2 -0
  384. package/lib/typescript/module/index.d.ts.map +1 -1
  385. package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts +4 -0
  386. package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -0
  387. package/lib/typescript/{commonjs/ui/components/OxyAccountDialog.d.ts → module/ui/components/OxyAccountDialogScreen.d.ts} +5 -4
  388. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
  389. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +3 -3
  390. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  391. package/lib/typescript/module/ui/components/ProfileButton.d.ts +2 -2
  392. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  393. package/lib/typescript/module/ui/components/ProfileSummaryCard.d.ts.map +1 -1
  394. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +1 -1
  395. package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts +16 -0
  396. package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
  397. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +3 -4
  398. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -1
  399. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
  400. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  401. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +17 -2
  402. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  403. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts +75 -13
  404. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
  405. package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts +10 -8
  406. package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
  407. package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
  408. package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
  409. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  410. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +9 -0
  411. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  412. package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts +50 -0
  413. package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts.map +1 -0
  414. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +17 -16
  415. package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
  416. package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts +14 -0
  417. package/lib/typescript/module/ui/hooks/useReduceMotion.d.ts.map +1 -0
  418. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +31 -0
  419. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
  420. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +1 -1
  421. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +27 -2
  422. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
  423. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +4 -5
  424. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  425. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  426. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  427. package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts +16 -0
  428. package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
  429. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +21 -0
  430. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -1
  431. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +101 -23
  432. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
  433. package/lib/typescript/module/ui/navigation/surfaces.d.ts +42 -11
  434. package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -1
  435. package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  436. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  437. package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  438. package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
  439. package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +18 -9
  440. package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
  441. package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts +34 -0
  442. package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -0
  443. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  444. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  445. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  446. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
  447. package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
  448. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  449. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  450. package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
  451. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  452. package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  453. package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
  454. package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  455. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  456. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  457. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
  458. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  459. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
  460. package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  461. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  462. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  463. package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  464. package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  465. package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
  466. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
  467. package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  468. package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts +23 -0
  469. package/lib/typescript/module/ui/screens/fileManagement/FileLibraryError.d.ts.map +1 -0
  470. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts +4 -0
  471. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  472. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +10 -2
  473. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  474. package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
  475. package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
  476. package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
  477. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  478. package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
  479. package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  480. package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts +8 -1
  481. package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
  482. package/lib/typescript/module/ui/types/navigation.d.ts +10 -0
  483. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  484. package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
  485. package/lib/typescript/module/ui/utils/fileManagement.d.ts +0 -48
  486. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  487. package/package.json +9 -5
  488. package/src/index.ts +12 -5
  489. package/src/ui/components/AvatarCameraBadge.tsx +35 -0
  490. package/src/ui/components/{OxyAccountDialog.tsx → OxyAccountDialogScreen.tsx} +50 -116
  491. package/src/ui/components/OxyAuthChooser.tsx +743 -86
  492. package/src/ui/components/OxyConsentScreen.tsx +1 -1
  493. package/src/ui/components/ProfileButton.tsx +18 -3
  494. package/src/ui/components/ProfileSummaryCard.tsx +2 -25
  495. package/src/ui/components/RequireOxyAuth.tsx +1 -1
  496. package/src/ui/components/SurfaceHeaderAction.tsx +60 -0
  497. package/src/ui/components/SurfaceScreen.tsx +108 -14
  498. package/src/ui/components/fileManagement/FileDetailsModal.tsx +50 -36
  499. package/src/ui/components/modals/DeleteAccountModal.tsx +47 -26
  500. package/src/ui/components/oxyAuthChooserStyles.ts +78 -16
  501. package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +158 -84
  502. package/src/ui/components/photogrid/__tests__/chunkPhotos.test.ts +51 -0
  503. package/src/ui/components/surfaces/ActionSheetSurface.tsx +98 -0
  504. package/src/ui/context/OxyContext.tsx +79 -25
  505. package/src/ui/hooks/queries/queryKeys.ts +15 -0
  506. package/src/ui/hooks/queries/useFileQueries.ts +162 -0
  507. package/src/ui/hooks/useAvatarPicker.ts +46 -74
  508. package/src/ui/hooks/useReduceMotion.ts +58 -0
  509. package/src/ui/hooks/useSurfaceHeader.ts +57 -0
  510. package/src/ui/hooks/useSwitchableAccounts.ts +1 -1
  511. package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +55 -7
  512. package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +149 -0
  513. package/src/ui/navigation/accountDialogManager.ts +42 -2
  514. package/src/ui/navigation/bottomSheetManager.ts +6 -7
  515. package/src/ui/navigation/routes.ts +6 -4
  516. package/src/ui/navigation/surfaceBackBridge.ts +69 -0
  517. package/src/ui/navigation/surfaceNavStack.ts +72 -9
  518. package/src/ui/navigation/surfaceRegistry.ts +164 -24
  519. package/src/ui/navigation/surfaces.ts +137 -30
  520. package/src/ui/screens/AccountMembersScreen.tsx +39 -100
  521. package/src/ui/screens/AccountSettingsScreen.tsx +32 -54
  522. package/src/ui/screens/AccountVerificationScreen.tsx +23 -51
  523. package/src/ui/screens/AppInfoScreen.tsx +6 -13
  524. package/src/ui/screens/AvatarCropScreen.tsx +340 -311
  525. package/src/ui/screens/ChangeAvatarScreen.tsx +359 -0
  526. package/src/ui/screens/ConnectedAppsScreen.tsx +39 -60
  527. package/src/ui/screens/CreateAccountScreen.tsx +13 -39
  528. package/src/ui/screens/EditProfileFieldScreen.tsx +30 -48
  529. package/src/ui/screens/EditProfileScreen.tsx +7 -16
  530. package/src/ui/screens/FAQScreen.tsx +9 -13
  531. package/src/ui/screens/FeedbackScreen.tsx +8 -22
  532. package/src/ui/screens/FileManagementScreen.tsx +370 -610
  533. package/src/ui/screens/HelpSupportScreen.tsx +7 -13
  534. package/src/ui/screens/HistoryViewScreen.tsx +26 -31
  535. package/src/ui/screens/LanguageSelectorScreen.tsx +12 -46
  536. package/src/ui/screens/LearnMoreUsernamesScreen.tsx +8 -16
  537. package/src/ui/screens/LegalDocumentsScreen.tsx +7 -22
  538. package/src/ui/screens/ManageAccountScreen.tsx +96 -165
  539. package/src/ui/screens/NotificationsScreen.tsx +7 -13
  540. package/src/ui/screens/PaymentGatewayScreen.tsx +3 -10
  541. package/src/ui/screens/PreferencesScreen.tsx +7 -13
  542. package/src/ui/screens/PremiumSubscriptionScreen.tsx +52 -90
  543. package/src/ui/screens/PrivacySettingsScreen.tsx +9 -21
  544. package/src/ui/screens/ProfileScreen.tsx +9 -11
  545. package/src/ui/screens/SavesCollectionsScreen.tsx +7 -13
  546. package/src/ui/screens/SearchSettingsScreen.tsx +9 -21
  547. package/src/ui/screens/UserLinksScreen.tsx +7 -14
  548. package/src/ui/screens/UserListScreen.tsx +2 -5
  549. package/src/ui/screens/WelcomeNewUserScreen.tsx +18 -48
  550. package/src/ui/screens/fileManagement/FileLibraryError.tsx +56 -0
  551. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +56 -46
  552. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +55 -71
  553. package/src/ui/screens/trust/TrustAboutScreen.tsx +10 -17
  554. package/src/ui/screens/trust/TrustCenterScreen.tsx +9 -28
  555. package/src/ui/screens/trust/TrustFAQScreen.tsx +15 -18
  556. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +3 -5
  557. package/src/ui/screens/trust/TrustRewardsScreen.tsx +11 -26
  558. package/src/ui/screens/trust/TrustRulesScreen.tsx +10 -13
  559. package/src/ui/stores/resetSessionScopedStores.ts +8 -3
  560. package/src/ui/types/navigation.ts +10 -0
  561. package/src/ui/utils/avatarUtils.ts +11 -2
  562. package/src/ui/utils/fileManagement.ts +1 -101
  563. package/lib/commonjs/ui/components/Header.js +0 -305
  564. package/lib/commonjs/ui/components/Header.js.map +0 -1
  565. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +0 -1
  566. package/lib/commonjs/ui/stores/fileStore.js +0 -153
  567. package/lib/commonjs/ui/stores/fileStore.js.map +0 -1
  568. package/lib/module/ui/components/Header.js +0 -299
  569. package/lib/module/ui/components/Header.js.map +0 -1
  570. package/lib/module/ui/components/OxyAccountDialog.js.map +0 -1
  571. package/lib/module/ui/stores/fileStore.js +0 -145
  572. package/lib/module/ui/stores/fileStore.js.map +0 -1
  573. package/lib/typescript/commonjs/ui/components/Header.d.ts +0 -33
  574. package/lib/typescript/commonjs/ui/components/Header.d.ts.map +0 -1
  575. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +0 -1
  576. package/lib/typescript/commonjs/ui/stores/fileStore.d.ts +0 -31
  577. package/lib/typescript/commonjs/ui/stores/fileStore.d.ts.map +0 -1
  578. package/lib/typescript/module/ui/components/Header.d.ts +0 -33
  579. package/lib/typescript/module/ui/components/Header.d.ts.map +0 -1
  580. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +0 -1
  581. package/lib/typescript/module/ui/stores/fileStore.d.ts +0 -31
  582. package/lib/typescript/module/ui/stores/fileStore.d.ts.map +0 -1
  583. package/src/ui/components/Header.tsx +0 -224
  584. package/src/ui/stores/fileStore.ts +0 -118
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * User file-library queries + cache helpers.
5
+ *
6
+ * The file list is owned by React Query (`useInfiniteQuery`), NOT a zustand
7
+ * store: server pages live in the query cache, and every optimistic mutation
8
+ * (upload / delete / visibility) edits that cache via the pure `*InCache`
9
+ * helpers below. The `queryFn` is side-effect-free — it only fetches and maps a
10
+ * page. This is what lets the file manager stay effect-free while preserving
11
+ * infinite scroll, pull-to-refresh, and optimistic upload reconciliation.
12
+ */
13
+
14
+ import { useInfiniteQuery } from '@tanstack/react-query';
15
+ import { useOxy } from "../../context/OxyContext.js";
16
+ import { queryKeys } from "./queryKeys.js";
17
+
18
+ /** Files fetched per page. */
19
+ export const FILES_PAGE_SIZE = 40;
20
+
21
+ /** Raw file record as returned by `oxyServices.listUserFiles` / `assetUpload`. */
22
+
23
+ /** One page of the infinite file list. */
24
+
25
+ /** Normalize a raw API file record into the client `FileMetadata` shape. */
26
+ export function mapRawFileToMetadata(raw) {
27
+ return {
28
+ id: raw.id,
29
+ filename: raw.originalName ?? raw.sha256 ?? '',
30
+ contentType: raw.mime ?? '',
31
+ length: raw.size ?? 0,
32
+ chunkSize: 0,
33
+ uploadDate: raw.createdAt ?? '',
34
+ metadata: raw.metadata ?? {},
35
+ variants: raw.variants ?? []
36
+ };
37
+ }
38
+
39
+ /**
40
+ * Infinite-paginated list of the owner's files. Fires on mount and whenever
41
+ * `ownerId` changes (a new key); `staleTime: 0` reloads on every open. The
42
+ * rendered list is `data.pages.flatMap(p => p.files)`.
43
+ */
44
+ export const useUserFilesInfinite = ownerId => {
45
+ const {
46
+ oxyServices
47
+ } = useOxy();
48
+ return useInfiniteQuery({
49
+ queryKey: queryKeys.files.list(ownerId),
50
+ queryFn: async ({
51
+ pageParam
52
+ }) => {
53
+ const offset = typeof pageParam === 'number' ? pageParam : 0;
54
+ const response = await oxyServices.listUserFiles(FILES_PAGE_SIZE, offset);
55
+ const raw = response.files ?? [];
56
+ const files = raw.map(mapRawFileToMetadata);
57
+ return {
58
+ files,
59
+ total: response.total ?? offset + files.length,
60
+ hasMore: Boolean(response.hasMore),
61
+ nextOffset: offset + FILES_PAGE_SIZE
62
+ };
63
+ },
64
+ initialPageParam: 0,
65
+ getNextPageParam: lastPage => lastPage.hasMore ? lastPage.nextOffset : undefined,
66
+ enabled: Boolean(ownerId),
67
+ staleTime: 0,
68
+ refetchOnWindowFocus: false
69
+ });
70
+ };
71
+
72
+ // --- Pure cache transforms (optimistic updates) -----------------------------
73
+ // Each edits the cached `InfiniteData` for one owner. All no-op when nothing is
74
+ // cached yet (e.g. an upload before the first page loads) — the subsequent
75
+ // `invalidateQueries` reconcile then brings the authoritative record.
76
+
77
+ const fileListKey = ownerId => queryKeys.files.list(ownerId);
78
+ const mapPages = (data, fn) => ({
79
+ ...data,
80
+ pages: data.pages.map(page => ({
81
+ ...page,
82
+ files: fn(page.files)
83
+ }))
84
+ });
85
+
86
+ /** Prepend an (optimistic) file to the first page. */
87
+ export function prependFileToCache(queryClient, ownerId, file) {
88
+ queryClient.setQueryData(fileListKey(ownerId), data => {
89
+ if (!data || data.pages.length === 0) return data;
90
+ return {
91
+ ...data,
92
+ pages: data.pages.map((page, index) => index === 0 ? {
93
+ ...page,
94
+ files: [file, ...page.files]
95
+ } : page)
96
+ };
97
+ });
98
+ }
99
+
100
+ /** Remove a file (by id) from every page. */
101
+ export function removeFileFromCache(queryClient, ownerId, fileId) {
102
+ queryClient.setQueryData(fileListKey(ownerId), data => data ? mapPages(data, files => files.filter(f => f.id !== fileId)) : data);
103
+ }
104
+
105
+ /** Swap an optimistic file (by id) for its persisted counterpart. */
106
+ export function replaceFileInCache(queryClient, ownerId, oldId, newFile) {
107
+ queryClient.setQueryData(fileListKey(ownerId), data => data ? mapPages(data, files => files.map(f => f.id === oldId ? newFile : f)) : data);
108
+ }
109
+
110
+ /** Shallow-merge a metadata patch into a cached file (e.g. visibility change). */
111
+ export function patchFileMetadataInCache(queryClient, ownerId, fileId, metadataPatch) {
112
+ queryClient.setQueryData(fileListKey(ownerId), data => data ? mapPages(data, files => files.map(f => f.id === fileId ? {
113
+ ...f,
114
+ metadata: {
115
+ ...f.metadata,
116
+ ...metadataPatch
117
+ }
118
+ } : f)) : data);
119
+ }
120
+ //# sourceMappingURL=useFileQueries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useInfiniteQuery","useOxy","queryKeys","FILES_PAGE_SIZE","mapRawFileToMetadata","raw","id","filename","originalName","sha256","contentType","mime","length","size","chunkSize","uploadDate","createdAt","metadata","variants","useUserFilesInfinite","ownerId","oxyServices","queryKey","files","list","queryFn","pageParam","offset","response","listUserFiles","map","total","hasMore","Boolean","nextOffset","initialPageParam","getNextPageParam","lastPage","undefined","enabled","staleTime","refetchOnWindowFocus","fileListKey","mapPages","data","fn","pages","page","prependFileToCache","queryClient","file","setQueryData","index","removeFileFromCache","fileId","filter","f","replaceFileInCache","oldId","newFile","patchFileMetadataInCache","metadataPatch"],"sourceRoot":"../../../../../src","sources":["ui/hooks/queries/useFileQueries.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACIA,gBAAgB,QAGb,uBAAuB;AAE9B,SAASC,MAAM,QAAQ,6BAA0B;AACjD,SAASC,SAAS,QAAQ,gBAAa;;AAEvC;AACA,OAAO,MAAMC,eAAe,GAAG,EAAE;;AAEjC;;AAYA;;AAUA;AACA,OAAO,SAASC,oBAAoBA,CAACC,GAAgB,EAAgB;EACjE,OAAO;IACHC,EAAE,EAAED,GAAG,CAACC,EAAE;IACVC,QAAQ,EAAEF,GAAG,CAACG,YAAY,IAAIH,GAAG,CAACI,MAAM,IAAI,EAAE;IAC9CC,WAAW,EAAEL,GAAG,CAACM,IAAI,IAAI,EAAE;IAC3BC,MAAM,EAAEP,GAAG,CAACQ,IAAI,IAAI,CAAC;IACrBC,SAAS,EAAE,CAAC;IACZC,UAAU,EAAEV,GAAG,CAACW,SAAS,IAAI,EAAE;IAC/BC,QAAQ,EAAEZ,GAAG,CAACY,QAAQ,IAAI,CAAC,CAAC;IAC5BC,QAAQ,EAAGb,GAAG,CAACa,QAAQ,IAAI;EAC/B,CAAC;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAIC,OAAgB,IAAK;EACtD,MAAM;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AAKA,KAAK,CAACO,GAAG,CAAE0B,CAAC,IAAMA,CAAC,CAAClD,EAAE,KAAKoD,KAAK,GAAGC,OAAO,GAAGH,CAAE,CAAC,CAAC,GAAGZ,IACzF,CAAC;AACL;;AAEA;AACA,OAAO,SAASgB,wBAAwBA,CACpCX,WAAwB,EACxB7B,OAA2B,EAC3BkC,MAAc,EACdO,aAAsC,EAClC;EACJZ,WAAW,CAACE,YAAY,CAAoBT,WAAW,CAACtB,OAAO,CAAC,EAAGwB,IAAI,IACnEA,IAAI,GACED,QAAQ,CAACC,IAAI,EAAGrB,KAAK,IACnBA,KAAK,CAACO,GAAG,CAAE0B,CAAC,IACRA,CAAC,CAAClD,EAAE,KAAKgD,MAAM,GACT;IAAE,GAAGE,CAAC;IAAEvC,QAAQ,EAAE;MAAE,GAAGuC,CAAC,CAACvC,QAAQ;MAAE,GAAG4C;IAAc;EAA8B,CAAC,GACnFL,CACV,CACJ,CAAC,GACCZ,IACV,CAAC;AACL","ignoreList":[]}
@@ -3,23 +3,30 @@
3
3
  /**
4
4
  * Avatar Picker Hook
5
5
  *
6
- * Extracts avatar selection logic from OxyContext for better modularity.
6
+ * The ONE write path for a user's profile picture. It owns no UI: the whole
7
+ * choose-and-crop experience is a single surface.
7
8
  *
8
- * Flow:
9
- * 1. Open the FileManagement bottom sheet in select mode for image files.
10
- * 2. After the user picks an image, route to the AvatarCrop screen so they
11
- * can square-crop + zoom before the avatar is set.
12
- * 3. The cropped JPEG is uploaded as a NEW file via `oxyServices.assetUpload`
13
- * and that file becomes the user's avatar.
9
+ * Flow (typed promise over the shared surface stack — no callback props):
10
+ * 1. `openWithinOrPresent('ChangeAvatar')` opens the source list (device gallery,
11
+ * camera, existing Oxy files, remove) MORPHING into the caller's surface
12
+ * when one is open, else presenting cold. Whichever source the user picks, it
13
+ * navigates WITHIN to the crop editor so there is exactly one cropper and
14
+ * one entry into it.
15
+ * 2. The surface resolves with the cropped JPEG, with `{ removed: true }` when
16
+ * the user removed their photo, or `undefined` when they cancelled.
17
+ * 3. A crop is uploaded as a NEW file via `oxyServices.assetUpload` and set as
18
+ * the avatar; a removal clears the avatar field.
14
19
  *
15
- * `expo-image-manipulator` is required for the crop step (declared as an
16
- * optional peer in the consuming app) see AvatarCropScreen.
20
+ * `expo-image-manipulator` is required for the crop step and `expo-image-picker`
21
+ * for the device/camera sources (both declared as optional peers in the
22
+ * consuming app) — see AvatarCropScreen / ChangeAvatarScreen.
17
23
  */
18
24
 
19
25
  import { useCallback } from 'react';
20
26
  import { translate, updateAvatarVisibility } from '@oxyhq/core';
21
27
  import { toast } from '@oxyhq/bloom';
22
28
  import { updateProfileWithAvatar } from "../utils/avatarUtils.js";
29
+ import { openWithinOrPresent } from "../navigation/surfaces.js";
23
30
 
24
31
  /** Upload result shape returned by oxyServices.assetUpload (single-file path). */
25
32
 
@@ -35,8 +42,7 @@ export function useAvatarPicker({
35
42
  oxyServices,
36
43
  currentLanguage,
37
44
  activeSessionId,
38
- queryClient,
39
- showBottomSheet
45
+ queryClient
40
46
  }) {
41
47
  /**
42
48
  * Final step: take the cropped JPEG, upload it as a new public file, then
@@ -64,55 +70,32 @@ export function useAvatarPicker({
64
70
  }
65
71
  }, [activeSessionId, currentLanguage, oxyServices, queryClient]);
66
72
 
67
- /**
68
- * After the user picks a file in the FileManagement sheet, resolve a working
69
- * source URL and route to the crop screen.
70
- *
71
- * The picked file is usually PRIVATE, so the synchronous
72
- * `getFileDownloadUrl` (public CDN origin) would 404 and the crop screen's
73
- * `Image.getSize` would fail silently. We resolve the authenticated URL via
74
- * `assetGetUrl` (which throws on failure — unlike `getFileDownloadUrlAsync`,
75
- * which swallows errors and falls back to the broken public URL) so a
76
- * failure surfaces a real user-facing error instead of a blank crop canvas.
77
- * No variant is requested — cropping needs the original.
78
- */
79
- const handleFilePicked = useCallback(async file => {
80
- if (!file.contentType?.startsWith('image/')) {
81
- toast.error(translate(currentLanguage ?? undefined, 'editProfile.toasts.selectImage') || 'Please select an image file');
82
- return;
83
- }
84
- let sourceUri;
73
+ /** Clear the avatar so the profile falls back to the user's initials. */
74
+ const removeAvatar = useCallback(async () => {
85
75
  try {
86
- const resolved = await oxyServices.assetGetUrl(file.id);
87
- if (!resolved?.url) {
88
- throw new Error('No download URL returned for the selected image');
89
- }
90
- sourceUri = resolved.url;
76
+ await updateProfileWithAvatar({
77
+ avatar: ''
78
+ }, oxyServices, activeSessionId, queryClient);
79
+ toast.success(translate(currentLanguage ?? undefined, 'editProfile.toasts.avatarRemoved'));
91
80
  } catch (e) {
92
81
  const message = e instanceof Error ? e.message : undefined;
93
- toast.error(message || translate(currentLanguage ?? undefined, 'editProfile.toasts.cropMeasureFailed') || 'Could not load the selected image');
82
+ toast.error(message || translate(currentLanguage ?? undefined, 'editProfile.toasts.updateAvatarFailed'));
83
+ }
84
+ }, [activeSessionId, currentLanguage, oxyServices, queryClient]);
85
+ const openAvatarPicker = useCallback(async () => {
86
+ // The source list + crop editor are ONE flow. When triggered from a screen
87
+ // already inside a surface (EditProfile, ManageAccount, WelcomeNewUser — every
88
+ // current entry point), it MORPHS into that surface and pops back on finish;
89
+ // triggered with no surface open it presents cold. Either way it resolves with
90
+ // the cropped JPEG, a removal, or `undefined` when the user backs out.
91
+ const result = await openWithinOrPresent('ChangeAvatar');
92
+ if (!result) return;
93
+ if ('removed' in result) {
94
+ await removeAvatar();
94
95
  return;
95
96
  }
96
- showBottomSheet({
97
- screen: 'AvatarCrop',
98
- props: {
99
- imageUri: sourceUri,
100
- onConfirm: finalizeCroppedAvatar
101
- }
102
- });
103
- }, [currentLanguage, finalizeCroppedAvatar, oxyServices, showBottomSheet]);
104
- const openAvatarPicker = useCallback(() => {
105
- showBottomSheet({
106
- screen: 'FileManagement',
107
- props: {
108
- selectMode: true,
109
- multiSelect: false,
110
- disabledMimeTypes: ['video/', 'audio/', 'application/pdf'],
111
- afterSelect: 'none',
112
- onSelect: handleFilePicked
113
- }
114
- });
115
- }, [handleFilePicked, showBottomSheet]);
97
+ await finalizeCroppedAvatar(result);
98
+ }, [finalizeCroppedAvatar, removeAvatar]);
116
99
  return {
117
100
  openAvatarPicker
118
101
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","translate","updateAvatarVisibility","toast","updateProfileWithAvatar","extractUploadedFileId","result","undefined","id","file","first","files","useAvatarPicker","oxyServices","currentLanguage","activeSessionId","queryClient","showBottomSheet","finalizeCroppedAvatar","cropped","uploadResult","assetUpload","uri","type","mime","name","Date","now","newFileId","Error","avatar","success","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":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,SAAS,EAAEC,sBAAsB,QAAQ,aAAa;AAE/D,SAASC,KAAK,QAAQ,cAAc;AAEpC,SAASC,uBAAuB,QAAQ,yBAAsB;;AAW9D;;AAOA,SAASC,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;AAEA,OAAO,SAASK,eAAeA,CAAC;EAC9BC,WAAW;EACXC,eAAe;EACfC,eAAe;EACfC,WAAW;EACXC;AACsB,CAAC,EAAE;EACzB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AAC;EAEvC,OAAO;IAAE6B;EAAiB,CAAC;AAC7B","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","translate","updateAvatarVisibility","toast","updateProfileWithAvatar","openWithinOrPresent","extractUploadedFileId","result","undefined","id","file","first","files","useAvatarPicker","oxyServices","currentLanguage","activeSessionId","queryClient","finalizeCroppedAvatar","cropped","uploadResult","assetUpload","uri","type","mime","name","Date","now","newFileId","Error","avatar","success","e","message","error","removeAvatar","openAvatarPicker"],"sourceRoot":"../../../../src","sources":["ui/hooks/useAvatarPicker.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,SAAS,EAAEC,sBAAsB,QAAQ,aAAa;AAE/D,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,uBAAuB,QAAQ,yBAAsB;AAC9D,SAASC,mBAAmB,QAAQ,2BAAwB;;AAU5D;;AAOA,SAASC,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;AAEA,OAAO,SAASK,eAAeA,CAAC;EAC9BC,WAAW;EACXC,eAAe;EACfC,eAAe;EACfC;AACsB,CAAC,EAAE;EACzB;AACF;AACA;AACA;EACE,MAAMC,qBAAqB,GAAGlB,WAAW,CACvC,MAAOmB,OAAyB,IA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AC5E,CAAC;IACH,CAAC,CAAC,OAAOwB,CAAU,EAAE;MACnB,MAAMC,OAAO,GAAGD,CAAC,YAAYH,KAAK,GAAGG,CAAC,CAACC,OAAO,GAAGzB,SAAS;MAC1DL,KAAK,CAAC+B,KAAK,CACTD,OAAO,IACLhC,SAAS,CAACc,eAAe,IAAIP,SAAS,EAAE,uCAAuC,CACnF,CAAC;IACH;EACF,CAAC,EAAE,CAACQ,eAAe,EAAED,eAAe,EAAED,WAAW,EAAEG,WAAW,CAAC,CAAC;EAEhE,MAAMmB,gBAAgB,GAAGpC,WAAW,CAAC,YAAY;IAC/C;IACA;IACA;IACA;IACA;IACA,MAAMO,MAAM,GAAG,MAAMF,mBAAmB,CAAC,cAAc,CAAC;IACxD,IAAI,CAACE,MAAM,EAAE;IACb,IAAI,SAAS,IAAIA,MAAM,EAAE;MACvB,MAAM4B,YAAY,CAAC,CAAC;MACpB;IACF;IACA,MAAMjB,qBAAqB,CAACX,MAAM,CAAC;EACrC,CAAC,EAAE,CAACW,qBAAqB,EAAEiB,YAAY,CAAC,CAAC;EAEzC,OAAO;IAAEC;EAAiB,CAAC;AAC7B","ignoreList":[]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * useReduceMotion
5
+ *
6
+ * Reactive boolean reflecting the OS "reduce motion" accessibility preference.
7
+ * Wraps `AccessibilityInfo` as an external store via `useSyncExternalStore` — the
8
+ * effect-free, React-Compiler-safe way to read an external mutable source. The
9
+ * initial value is read asynchronously once (the platform API is a Promise) and
10
+ * cached module-side; subsequent changes arrive via the `reduceMotionChanged`
11
+ * event. Mirrors the `useOnlineStatus` pattern.
12
+ *
13
+ * Consumers use it to pin entrance/stagger animations off under reduce-motion.
14
+ */
15
+
16
+ import { useSyncExternalStore } from 'react';
17
+ import { AccessibilityInfo } from 'react-native';
18
+ let cachedReduceMotion = false;
19
+ let initialized = false;
20
+ const listeners = new Set();
21
+ const notifyAll = () => {
22
+ for (const listener of listeners) listener();
23
+ };
24
+ const setCached = value => {
25
+ if (cachedReduceMotion === value) return;
26
+ cachedReduceMotion = value;
27
+ notifyAll();
28
+ };
29
+ const subscribeReduceMotion = notify => {
30
+ // Populate the cache the first time anyone subscribes (the platform read is
31
+ // async, so it cannot be a synchronous `getSnapshot`).
32
+ if (!initialized) {
33
+ initialized = true;
34
+ AccessibilityInfo.isReduceMotionEnabled().then(setCached).catch(() => {
35
+ // No preference available — the `false` default stands.
36
+ });
37
+ }
38
+ listeners.add(notify);
39
+ const sub = AccessibilityInfo.addEventListener('reduceMotionChanged', setCached);
40
+ return () => {
41
+ listeners.delete(notify);
42
+ sub.remove();
43
+ };
44
+ };
45
+ const getSnapshot = () => cachedReduceMotion;
46
+
47
+ // SSR/web-first paint: assume motion is allowed (no reduce) until the async read
48
+ // resolves — matches the prior default.
49
+ const getServerSnapshot = () => false;
50
+ export function useReduceMotion() {
51
+ return useSyncExternalStore(subscribeReduceMotion, getSnapshot, getServerSnapshot);
52
+ }
53
+ //# sourceMappingURL=useReduceMotion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSyncExternalStore","AccessibilityInfo","cachedReduceMotion","initialized","listeners","Set","notifyAll","listener","setCached","value","subscribeReduceMotion","notify","isReduceMotionEnabled","then","catch","add","sub","addEventListener","delete","remove","getSnapshot","getServerSnapshot","useReduceMotion"],"sourceRoot":"../../../../src","sources":["ui/hooks/useReduceMotion.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,OAAO;AAC5C,SAASC,iBAAiB,QAAQ,cAAc;AAEhD,IAAIC,kBAAkB,GAAG,KAAK;AAC9B,IAAIC,WAAW,GAAG,KAAK;AACvB,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AAEvC,MAAMC,SAAS,GAAGA,CAAA,KAAY;EAC1B,KAAK,MAAMC,QAAQ,IAAIH,SAAS,EAAEG,QAAQ,CAAC,CAAC;AAChD,CAAC;AAED,MAAMC,SAAS,GAAIC,KAAc,IAAW;EACxC,IAAIP,kBAAkB,KAAKO,KAAK,EAAE;EAClCP,kBAAkB,GAAGO,KAAK;EAC1BH,SAAS,CAAC,CAAC;AACf,CAAC;AAED,MAAMI,qBAAqB,GAAIC,MAAkB,IAAmB;EAChE;EACA;EACA,IAAI,CAACR,WAAW,EAAE;IACdA,WAAW,GAAG,IAAI;IAClBF,iBAAiB,CAACW,qBAAqB,CAAC,CAAC,CACpCC,IAAI,CAACL,SAAS,CAAC,CACfM,KAAK,CAAC,MAAM;MACT;IAAA,CACH,CAAC;EACV;EACAV,SAAS,CAACW,GAAG,CAACJ,MAAM,CAAC;EACrB,MAAMK,GAAG,GAAGf,iBAAiB,CAACgB,gBAAgB,CAAC,qBAAqB,EAAET,SAAS,CAAC;EAChF,OAAO,MAAM;IACTJ,SAAS,CAACc,MAAM,CAACP,MAAM,CAAC;IACxBK,GAAG,CAACG,MAAM,CAAC,CAAC;EAChB,CAAC;AACL,CAAC;AAED,MAAMC,WAAW,GAAGA,CAAA,KAAelB,kBAAkB;;AAErD;AACA;AACA,MAAMmB,iBAAiB,GAAGA,CAAA,KAAe,KAAK;AAE9C,OAAO,SAASC,eAAeA,CAAA,EAAY;EACvC,OAAOtB,oBAAoB,CAACU,qBAAqB,EAAEU,WAAW,EAAEC,iBAAiB,CAAC;AACtF","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ import { createContext, useContext, useLayoutEffect } from 'react';
4
+
5
+ /**
6
+ * The header content a mounted surface screen contributes at runtime: its
7
+ * (translated) title/subtitle and optional slot nodes. Back/close affordances
8
+ * are owned by the surface host (`SurfaceScreen`) — a screen never wires them.
9
+ *
10
+ * A `right` slot is the canonical place for a screen-state action (e.g. a Save
11
+ * button whose disabled/loading state reflects the form). Slot nodes MUST be
12
+ * referentially stable (memoize them with `useMemo`) so the header does not
13
+ * thrash.
14
+ */
15
+
16
+ /**
17
+ * Provided by {@link ../components/SurfaceScreen}. Bridges a screen's runtime
18
+ * header contribution up to the host, which merges it with the back/close
19
+ * wiring and drives the Dialog's own nav header. `null` outside a surface (or in
20
+ * a headerless surface), so {@link useSurfaceHeader} is a safe no-op there.
21
+ */
22
+ export const SurfaceHeaderContext = /*#__PURE__*/createContext(null);
23
+
24
+ /**
25
+ * Declare the Dialog nav header's content from within a surface screen — its
26
+ * title/subtitle and any action slot. Merges over nothing (the host owns
27
+ * back/close), replaces on change, and clears on unmount. Call it unconditionally;
28
+ * it is a no-op outside a header-mode surface.
29
+ */
30
+ export function useSurfaceHeader(content) {
31
+ const ctx = useContext(SurfaceHeaderContext);
32
+ const set = ctx?.setContent;
33
+ // Set synchronously in the commit's layout phase so the bar/title fill in
34
+ // BEFORE the browser paints — no first-frame flash of an empty bar.
35
+ useLayoutEffect(() => {
36
+ if (!set) return;
37
+ set(content ?? null);
38
+ return () => set(null);
39
+ // Slot nodes (`left`/`right`) are compared by identity; callers memoize them.
40
+ }, [set, content?.title, content?.titleContent, content?.subtitle, content?.largeTitle, content?.left, content?.right, content?.onBack]);
41
+ }
42
+ //# sourceMappingURL=useSurfaceHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","useContext","useLayoutEffect","SurfaceHeaderContext","useSurfaceHeader","content","ctx","set","setContent","title","titleContent","subtitle","largeTitle","left","right","onBack"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSurfaceHeader.ts"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,EAAEC,eAAe,QAAQ,OAAO;;AAGlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,gBAAGH,aAAa,CAAmC,IAAI,CAAC;;AAEzF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAACC,OAAgD,EAAQ;EACvF,MAAMC,GAAG,GAAGL,UAAU,CAACE,oBAAoB,CAAC;EAC5C,MAAMI,GAAG,GAAGD,GAAG,EAAEE,UAAU;EAC3B;EACA;EACAN,eAAe,CAAC,MAAM;IACpB,IAAI,CAACK,GAAG,EAAE;IACVA,GAAG,CAACF,OAAO,IAAI,IAAI,CAAC;IACpB,OAAO,MAAME,GAAG,CAAC,IAAI,CAAC;IACtB;EACF,CAAC,EAAE,CACDA,GAAG,EACHF,OAAO,EAAEI,KAAK,EACdJ,OAAO,EAAEK,YAAY,EACrBL,OAAO,EAAEM,QAAQ,EACjBN,OAAO,EAAEO,UAAU,EACnBP,OAAO,EAAEQ,IAAI,EACbR,OAAO,EAAES,KAAK,EACdT,OAAO,EAAEU,MAAM,CAChB,CAAC;AACJ","ignoreList":[]}
@@ -29,7 +29,7 @@ const EMPTY_SNAPSHOT = {
29
29
  * real per-account name / email / avatar / color.
30
30
  *
31
31
  * This is a thin binding over the shared `AccountDialogController` in
32
- * `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialog} renders),
32
+ * `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialogScreen} renders),
33
33
  * so there is ONE projection (`projectSwitchableAccounts`) and one switch path
34
34
  * (`controller.switchTo`) across the whole SDK — the local duplicate projection
35
35
  * this hook used to own has been removed. Every switch routes through
@@ -1,12 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  /**
4
- * Imperative controls for the unified {@link OxyAccountDialog}.
4
+ * Imperative, outside-React entry points for the unified `OxyAccountDialogScreen`.
5
+ *
6
+ * These delegate to the live handles the mounted `OxyProvider` registers via
7
+ * {@link registerAccountDialogControls}. Under the hood `open`/`close` present
8
+ * and dismiss the `AccountDialog` surface on the shared Bloom surface stack
9
+ * (`OxyContext.openAccountDialog` → `presentDetached('AccountDialog', …)`), so
10
+ * whether the dialog is open is owned by that stack — this module is only the
11
+ * thin bridge that reaches the provider's controller (which sets the dialog
12
+ * view) from a non-React call site.
5
13
  */
6
14
 
7
- /** Live open/close handles registered by the mounted provider. */
15
+ /**
16
+ * Live open/close handles registered by the mounted provider. `open` presents
17
+ * the `AccountDialog` surface (and points its view); `close` dismisses it. Both
18
+ * are stack operations — this interface never carries visibility state.
19
+ */
20
+
21
+ /**
22
+ * Optional consumer overrides for account-dialog actions. `ProfileButton` (and
23
+ * similar hosts) register these while mounted so inbox/accounts can route
24
+ * "Manage" / "Add account" to app-local navigation instead of the SDK default.
25
+ */
8
26
 
9
27
  let controls = null;
28
+ let consumerHooks = null;
10
29
  const visibilityListeners = new Set();
11
30
  export function registerAccountDialogControls(next) {
12
31
  controls = next;
@@ -17,6 +36,19 @@ export function registerAccountDialogControls(next) {
17
36
  };
18
37
  }
19
38
 
39
+ /** Register app-local manage/add/profile handlers for the account dialog. */
40
+ export function registerAccountDialogConsumerHooks(next) {
41
+ consumerHooks = next;
42
+ return () => {
43
+ if (consumerHooks === next) {
44
+ consumerHooks = null;
45
+ }
46
+ };
47
+ }
48
+ export function getAccountDialogConsumerHooks() {
49
+ return consumerHooks;
50
+ }
51
+
20
52
  /** Open the account dialog on `view` (default `accounts`). No-op before mount. */
21
53
  export function openAccountDialog(view) {
22
54
  controls?.open(view);
@@ -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;AAEjE,OAAO,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;AACA,OAAO,SAASK,iBAAiBA,CAACC,IAAwB,EAAQ;EAChEN,QAAQ,EAAEO,IAAI,CAACD,IAAI,CAAC;AACtB;;AAEA;AACA,OAAO,SAASE,kBAAkBA,CAAA,EAAS;EACzCR,QAAQ,EAAES,KAAK,CAAC,CAAC;AACnB;;AAEA;AACA,OAAO,SAASC,6BAA6BA,CAACC,OAAgB,EAAQ;EACpE,KAAK,MAAMC,QAAQ,IAAIX,mBAAmB,EAAE;IAC1CW,QAAQ,CAACD,OAAO,CAAC;EACnB;AACF;;AAEA;AACA,OAAO,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","consumerHooks","visibilityListeners","Set","registerAccountDialogControls","next","registerAccountDialogConsumerHooks","getAccountDialogConsumerHooks","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;AACA;AACA;AACA;AACA;;AAOA,IAAIA,QAAsC,GAAG,IAAI;AACjD,IAAIC,aAAgD,GAAG,IAAI;AAC3D,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAEjE,OAAO,SAASC,6BAA6BA,CAACC,IAA2B,EAAc;EACrFL,QAAQ,GAAGK,IAAI;EACf,OAAO,MAAM;IACX,IAAIL,QAAQ,KAAKK,IAAI,EAAE;MACrBL,QAAQ,GAAG,IAAI;IACjB;EACF,CAAC;AACH;;AAEA;AACA,OAAO,SAASM,kCAAkCA,CAChDD,IAAuC,EAC3B;EACZJ,aAAa,GAAGI,IAAI;EACpB,OAAO,MAAM;IACX,IAAIJ,aAAa,KAAKI,IAAI,EAAE;MAC1BJ,aAAa,GAAG,IAAI;IACtB;EACF,CAAC;AACH;AAEA,OAAO,SAASM,6BAA6BA,CAAA,EAAsC;EACjF,OAAON,aAAa;AACtB;;AAEA;AACA,OAAO,SAASO,iBAAiBA,CAACC,IAAwB,EAAQ;EAChET,QAAQ,EAAEU,IAAI,CAACD,IAAI,CAAC;AACtB;;AAEA;AACA,OAAO,SAASE,kBAAkBA,CAAA,EAAS;EACzCX,QAAQ,EAAEY,KAAK,CAAC,CAAC;AACnB;;AAEA;AACA,OAAO,SAASC,6BAA6BA,CAACC,OAAgB,EAAQ;EACpE,KAAK,MAAMC,QAAQ,IAAIb,mBAAmB,EAAE;IAC1Ca,QAAQ,CAACD,OAAO,CAAC;EACnB;AACF;;AAEA;AACA,OAAO,SAASE,wBAAwBA,CAACD,QAAoC,EAAc;EACzFb,mBAAmB,CAACe,GAAG,CAACF,QAAQ,CAAC;EACjC,OAAO,MAAM;IACXb,mBAAmB,CAACgB,MAAM,CAACH,QAAQ,CAAC;EACtC,CAAC;AACH","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { isValidRoute } from "./routes.js";
4
- import { getSurfacePresentation } from "./surfaceRegistry.js";
4
+ import { getSurfaceConfig } from "./surfaceRegistry.js";
5
5
  import { closeAllRouteSurfaces, presentRoute, topRouteSurface } from "./surfaces.js";
6
6
 
7
7
  /**
@@ -17,11 +17,10 @@ import { closeAllRouteSurfaces, presentRoute, topRouteSurface } from "./surfaces
17
17
  */
18
18
 
19
19
  /**
20
- * Open a bottom-sheet route. If the top-most active surface hosts the SAME
21
- * presentation (the common all-sheets case) the route is drilled into it; a route
22
- * with a different presentation (the image picker's full-bleed surface) is
23
- * presented as a NEW surface on top. Opening with no active surface presents the
24
- * first one.
20
+ * Open a bottom-sheet route. By DEFAULT it drills into the top-most active
21
+ * surface morphing it in place (every screen morphs). A NEW surface is stacked
22
+ * on top only when the target route declares `stacks` (reserved for genuine
23
+ * overlays none today). Opening with no active surface presents the first one.
25
24
  *
26
25
  * `fullScreen` is accepted for signature compatibility and ignored — a route's
27
26
  * surface is now derived from its registry config, not a per-call flag.
@@ -34,7 +33,7 @@ export const showBottomSheet = screenOrConfig => {
34
33
  return;
35
34
  }
36
35
  const top = topRouteSurface();
37
- if (top && top.presentation === getSurfacePresentation(screen, props)) {
36
+ if (top && !getSurfaceConfig(screen, props).stacks) {
38
37
  top.navigate(screen, props);
39
38
  } else {
40
39
  presentRoute(screen, props);
@@ -1 +1 @@
1
- {"version":3,"names":["isValidRoute","getSurfacePresentation","closeAllRouteSurfaces","presentRoute","topRouteSurface","showBottomSheet","screenOrConfig","screen","props","__DEV__","console","warn","top","presentation","navigate","closeBottomSheet","goBack"],"sourceRoot":"../../../../src","sources":["ui/navigation/bottomSheetManager.ts"],"mappings":";;AACA,SAASA,YAAY,QAAQ,aAAU;AACvC,SAASC,sBAAsB,QAAQ,sBAAmB;AAC1D,SAASC,qBAAqB,EAAEC,YAAY,EAAEC,eAAe,QAAQ,eAAY;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,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,CAACR,YAAY,CAACO,MAAM,CAAC,EAAE;IACzB,IAAIE,OAAO,EAAEC,OAAO,CAACC,IAAI,CAAC,gCAAgCJ,MAAM,EAAE,CAAC;IACnE;EACF;EAEA,MAAMK,GAAG,GAAGR,eAAe,CAAC,CAAC;EAC7B,IAAIQ,GAAG,IAAIA,GAAG,CAACC,YAAY,KAAKZ,sBAAsB,CAACM,MAAM,EAAEC,KAAK,CAAC,EAAE;IACrEI,GAAG,CAACE,QAAQ,CAACP,MAAM,EAAEC,KAAK,CAAC;EAC7B,CAAC,MAAM;IACLL,YAAY,CAACI,MAAM,EAAEC,KAAK,CAAC;EAC7B;AACF,CAAC;;AAED;AACA,OAAO,MAAMO,gBAAgB,GAAGA,CAAA,KAAY;EAC1Cb,qBAAqB,CAAC,CAAC;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMc,MAAM,GAAGA,CAAA,KAAe;EACnC,MAAMJ,GAAG,GAAGR,eAAe,CAAC,CAAC;EAC7B,OAAOQ,GAAG,GAAGA,GAAG,CAACI,MAAM,CAAC,CAAC,GAAG,KAAK;AACnC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["isValidRoute","getSurfaceConfig","closeAllRouteSurfaces","presentRoute","topRouteSurface","showBottomSheet","screenOrConfig","screen","props","__DEV__","console","warn","top","stacks","navigate","closeBottomSheet","goBack"],"sourceRoot":"../../../../src","sources":["ui/navigation/bottomSheetManager.ts"],"mappings":";;AACA,SAASA,YAAY,QAAQ,aAAU;AACvC,SAASC,gBAAgB,QAAQ,sBAAmB;AACpD,SAASC,qBAAqB,EAAEC,YAAY,EAAEC,eAAe,QAAQ,eAAY;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,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,CAACR,YAAY,CAACO,MAAM,CAAC,EAAE;IACzB,IAAIE,OAAO,EAAEC,OAAO,CAACC,IAAI,CAAC,gCAAgCJ,MAAM,EAAE,CAAC;IACnE;EACF;EAEA,MAAMK,GAAG,GAAGR,eAAe,CAAC,CAAC;EAC7B,IAAIQ,GAAG,IAAI,CAACX,gBAAgB,CAACM,MAAM,EAAEC,KAAK,CAAC,CAACK,MAAM,EAAE;IAClDD,GAAG,CAACE,QAAQ,CAACP,MAAM,EAAEC,KAAK,CAAC;EAC7B,CAAC,MAAM;IACLL,YAAY,CAACI,MAAM,EAAEC,KAAK,CAAC;EAC7B;AACF,CAAC;;AAED;AACA,OAAO,MAAMO,gBAAgB,GAAGA,CAAA,KAAY;EAC1Cb,qBAAqB,CAAC,CAAC;AACzB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMc,MAAM,GAAGA,CAAA,KAAe;EACnC,MAAMJ,GAAG,GAAGR,eAAe,CAAC,CAAC;EAC7B,OAAOQ,GAAG,GAAGA,GAAG,CAACI,MAAM,CAAC,CAAC,GAAG,KAAK;AACnC,CAAC","ignoreList":[]}
@@ -6,7 +6,7 @@
6
6
 
7
7
  // Define all available route names
8
8
 
9
- // Unified account switcher + sign-in surface (folded OxyAccountDialog body)
9
+ // Unified account switcher + sign-in surface (OxyAccountDialogScreen body)
10
10
 
11
11
  // Lazy screen loaders - functions that return screen components on-demand
12
12
  // This breaks the require cycle by deferring imports until screens are actually needed
@@ -46,14 +46,15 @@ const screenLoaders = {
46
46
  CreateAccount: () => require('../screens/CreateAccountScreen').default,
47
47
  AccountMembers: () => require('../screens/AccountMembersScreen').default,
48
48
  AccountSettings: () => require('../screens/AccountSettingsScreen').default,
49
+ ChangeAvatar: () => require('../screens/ChangeAvatarScreen').default,
49
50
  AvatarCrop: () => require('../screens/AvatarCropScreen').default,
50
51
  Notifications: () => require('../screens/NotificationsScreen').default,
51
52
  ConnectedApps: () => require('../screens/ConnectedAppsScreen').default,
52
53
  Preferences: () => require('../screens/PreferencesScreen').default,
53
54
  // Unified account switcher + sign-in surface. Its body lives in the
54
- // `OxyAccountDialog` component (folded from the standalone dialog); the
55
+ // `OxyAccountDialogScreen` component (folded from the standalone dialog); the
55
56
  // surface stack provides the Dialog chrome around it.
56
- AccountDialog: () => require('../components/OxyAccountDialog').default
57
+ AccountDialog: () => require('../components/OxyAccountDialogScreen').default
57
58
  };
58
59
 
59
60
  // Cache loaded components to avoid re-requiring
@@ -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","AccountDialog","screenCache","Map","getScreenComponent","routeName","has","get","loader","component","set","error","__DEV__","console","undefined","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,C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CAACI,GAAG,CAACD,SAAS,CAAC,EAAE;IAC5B,OAAOH,WAAW,CAACK,GAAG,CAACF,SAAS,CAAC;EACrC;;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;AACA,OAAO,MAAMC,YAAY,GAAIV,SAAiB,IAA6B;EACvE,OAAOA,SAAS,IAAI3C,aAAa;AACrC,CAAC","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","ChangeAvatar","AvatarCrop","Notifications","ConnectedApps","Preferences","AccountDialog","screenCache","Map","getScreenComponent","routeName","has","get","loader","component","set","error","__DEV__","console","undefined","isValidRoute"],"sourceRoot":"../../../../src","sources":["ui/navigation/routes.ts"],"mappings":";;AAGA;AACA;AACA;;AAEA;;AAuCuB;;AAEvB;AACA;AACA,MAAMA,aAAsE,GAAG;EAC3EC,aAAa,EAAEA,CAAA,KAAMC,OAAO,CAAC,gCAAgC,CAAC,CAACC,OAA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CAACC,OAAO;EAChEkC,aAAa,EAAEA,CAAA,KAAMnC,OAAO,CAAC,gCAAgC,CAAC,CAACC,OAAO;EACtEmC,aAAa,EAAEA,CAAA,KAAMpC,OAAO,CAAC,gCAAgC,CAAC,CAACC,OAAO;EACtEoC,WAAW,EAAEA,CAAA,KAAMrC,OAAO,CAAC,8BAA8B,CAAC,CAACC,OAAO;EAClE;EACA;EACA;EACAqC,aAAa,EAAEA,CAAA,KAAMtC,OAAO,CAAC,sCAAsC,CAAC,CAACC;AACzE,CAAC;;AAED;AACA,MAAMsC,WAAW,GAAG,IAAIC,GAAG,CAA4C,CAAC;;AAExE;AACA,OAAO,MAAMC,kBAAkB,GAAIC,SAAoB,IAAiD;EACpG;EACA,IAAIH,WAAW,CAACI,GAAG,CAACD,SAAS,CAAC,EAAE;IAC5B,OAAOH,WAAW,CAACK,GAAG,CAACF,SAAS,CAAC;EACrC;;EAEA;EACA,MAAMG,MAAM,GAAG/C,aAAa,CAAC4C,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;AACA,OAAO,MAAMC,YAAY,GAAIV,SAAiB,IAA6B;EACvE,OAAOA,SAAS,IAAI5C,aAAa;AACrC,CAAC","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ import { BackHandler, Platform } from 'react-native';
4
+
5
+ /**
6
+ * Per-surface system-back handlers (Android hardware back + web Escape).
7
+ *
8
+ * Bloom's `SurfaceHost` dismisses the whole top surface on back/Escape. The SDK
9
+ * needs the old `BottomSheetRouter` semantics first: pop nav history, step a
10
+ * wizard back, then dismiss. A single global listener delegates to the topmost
11
+ * registered handler so stacked surfaces route correctly.
12
+ */
13
+
14
+ const handlerStack = [];
15
+ let androidInstalled = false;
16
+ let escapeInstalled = false;
17
+ function invokeTopHandler() {
18
+ const handler = handlerStack[handlerStack.length - 1];
19
+ return handler ? handler() : false;
20
+ }
21
+ function installAndroidHandler() {
22
+ if (androidInstalled || Platform.OS !== 'android') return;
23
+ androidInstalled = true;
24
+ BackHandler.addEventListener('hardwareBackPress', () => {
25
+ if (handlerStack.length === 0) return false;
26
+ return invokeTopHandler();
27
+ });
28
+ }
29
+ function installEscapeHandler() {
30
+ if (escapeInstalled || Platform.OS !== 'web') return;
31
+ if (typeof window === 'undefined') return;
32
+ escapeInstalled = true;
33
+ window.addEventListener('keydown', event => {
34
+ if (event.key !== 'Escape' || handlerStack.length === 0) return;
35
+ invokeTopHandler();
36
+ event.stopImmediatePropagation();
37
+ event.preventDefault();
38
+ }, true);
39
+ }
40
+
41
+ /** Register before Bloom's `SurfaceHost` mounts so Escape capture runs first. */
42
+ installEscapeHandler();
43
+
44
+ /** Push a handler for one live surface; returns unregister. */
45
+ export function pushSurfaceBackHandler(handler) {
46
+ handlerStack.push(handler);
47
+ installAndroidHandler();
48
+ return () => {
49
+ const index = handlerStack.lastIndexOf(handler);
50
+ if (index >= 0) handlerStack.splice(index, 1);
51
+ };
52
+ }
53
+
54
+ /** Test-only: invoke the top handler. */
55
+ export function __invokeTopSurfaceBackForTests() {
56
+ return invokeTopHandler();
57
+ }
58
+
59
+ /** Test-only reset. */
60
+ export function __resetSurfaceBackBridgeForTests() {
61
+ handlerStack.length = 0;
62
+ }
63
+ //# sourceMappingURL=surfaceBackBridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BackHandler","Platform","handlerStack","androidInstalled","escapeInstalled","invokeTopHandler","handler","length","installAndroidHandler","OS","addEventListener","installEscapeHandler","window","event","key","stopImmediatePropagation","preventDefault","pushSurfaceBackHandler","push","index","lastIndexOf","splice","__invokeTopSurfaceBackForTests","__resetSurfaceBackBridgeForTests"],"sourceRoot":"../../../../src","sources":["ui/navigation/surfaceBackBridge.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,cAAc;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMC,YAAkC,GAAG,EAAE;AAC7C,IAAIC,gBAAgB,GAAG,KAAK;AAC5B,IAAIC,eAAe,GAAG,KAAK;AAE3B,SAASC,gBAAgBA,CAAA,EAAY;EACnC,MAAMC,OAAO,GAAGJ,YAAY,CAACA,YAAY,CAACK,MAAM,GAAG,CAAC,CAAC;EACrD,OAAOD,OAAO,GAAGA,OAAO,CAAC,CAAC,GAAG,KAAK;AACpC;AAEA,SAASE,qBAAqBA,CAAA,EAAS;EACrC,IAAIL,gBAAgB,IAAIF,QAAQ,CAACQ,EAAE,KAAK,SAAS,EAAE;EACnDN,gBAAgB,GAAG,IAAI;EACvBH,WAAW,CAACU,gBAAgB,CAAC,mBAAmB,EAAE,MAAM;IACtD,IAAIR,YAAY,CAACK,MAAM,KAAK,CAAC,EAAE,OAAO,KAAK;IAC3C,OAAOF,gBAAgB,CAAC,CAAC;EAC3B,CAAC,CAAC;AACJ;AAEA,SAASM,oBAAoBA,CAAA,EAAS;EACpC,IAAIP,eAAe,IAAIH,QAAQ,CAACQ,EAAE,KAAK,KAAK,EAAE;EAC9C,IAAI,OAAOG,MAAM,KAAK,WAAW,EAAE;EACnCR,eAAe,GAAG,IAAI;EACtBQ,MAAM,CAACF,gBAAgB,CACrB,SAAS,EACRG,KAAK,IAAK;IACT,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,IAAIZ,YAAY,CAACK,MAAM,KAAK,CAAC,EAAE;IACzDF,gBAAgB,CAAC,CAAC;IAClBQ,KAAK,CAACE,wBAAwB,CAAC,CAAC;IA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