@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
@@ -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","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"],"mappings":";;AAGA;AACA;AACA;;AAEA;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oreList":[]}
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,CAAA,KAAMP,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO;EACxEO,cAAc,EAAEA,CAAA,KAAMR,OAAO,CAAC,iCAAiC,CAAC,CAACC,OAAO;EACxEQ,WAAW,EAAEA,CAAA,KAAMT,OAAO,CAAC,8BAA8B,CAAC,CAACC,OAAO;EAClES,GAAG,EAAEA,CAAA,KAAMV,OAAO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AC1BN,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":[]}
@@ -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,CAA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face route history — the NAV-WITHIN axis.
7
+ *
8
+ * Bloom's surface stack owns DEPTH (a surface presented on top of another). This
9
+ * store owns the ORTHOGONAL axis: the route history INSIDE one SDK surface. Each
10
+ * SDK surface holds its own {@link SurfaceNavStack}; `navigate`/`replace`/`goBack`
11
+ * mutate it and the SAME Bloom surface re-renders its content from the new top
12
+ * frame. It is the per-surface reincarnation of the old global
13
+ * `bottomSheetStore`'s `history` + `currentStep`.
14
+ *
15
+ * `closing`/`closeResult` model a pending dismissal: the surface's `SurfaceScreen`
16
+ * watches them and calls the Bloom surface's `dismiss(result)` from an effect —
17
+ * so a dismiss requested BEFORE the surface has mounted still resolves once it
18
+ * does, with no controls-capture race and no render-phase side effect.
19
+ */
20
+
21
+ /** One frame in a surface's route history. */
22
+
23
+ function makeFrame(route, props) {
24
+ const resolved = props ?? {};
25
+ const step = typeof resolved.initialStep === 'number' ? resolved.initialStep : 0;
26
+ return {
27
+ route,
28
+ props: resolved,
29
+ step
30
+ };
31
+ }
32
+ export function createSurfaceNavStack(route, props) {
33
+ const store = createStore(() => ({
34
+ frames: [makeFrame(route, props)],
35
+ closing: false,
36
+ closeResult: undefined
37
+ }));
38
+ const getTop = () => {
39
+ const {
40
+ frames
41
+ } = store.getState();
42
+ return frames[frames.length - 1];
43
+ };
44
+ return {
45
+ store,
46
+ getTop,
47
+ navigate(nextRoute, nextProps) {
48
+ store.setState(state => ({
49
+ frames: [...state.frames, makeFrame(nextRoute, nextProps)]
50
+ }));
51
+ },
52
+ replace(nextRoute, nextProps) {
53
+ store.setState(state => ({
54
+ frames: [...state.frames.slice(0, -1), makeFrame(nextRoute, nextProps)]
55
+ }));
56
+ },
57
+ goBack() {
58
+ const {
59
+ frames
60
+ } = store.getState();
61
+ if (frames.length <= 1) return false;
62
+ store.setState({
63
+ frames: frames.slice(0, -1)
64
+ });
65
+ return true;
66
+ },
67
+ canGoBack() {
68
+ const {
69
+ frames
70
+ } = store.getState();
71
+ return frames.length > 1 || (frames[frames.length - 1]?.step ?? 0) > 0;
72
+ },
73
+ setStep(step) {
74
+ store.setState(state => {
75
+ const frames = state.frames.slice();
76
+ const index = frames.length - 1;
77
+ frames[index] = {
78
+ ...frames[index],
79
+ step
80
+ };
81
+ return {
82
+ frames
83
+ };
84
+ });
85
+ },
86
+ requestDismiss(result) {
87
+ if (store.getState().closing) return;
88
+ store.setState({
89
+ closing: true,
90
+ closeResult: result
91
+ });
92
+ }
93
+ };
94
+ }
95
+ //# sourceMappingURL=surfaceNavStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createStore","makeFrame","route","props","resolved","step","initialStep","createSurfaceNavStack","store","frames","closing","closeResult","undefined","getTop","getState","length","navigate","nextRoute","nextProps","setState","state","replace","slice","goBack","canGoBack","setStep","index","requestDismiss","result"],"sourceRoot":"../../../../src","sources":["ui/navigation/surfaceNavStack.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAuB,iBAAiB;;AAG5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAmCA,SAASC,SAASA,CAACC,KAAgB,EAAEC,KAA+B,EAAY;EAC9E,MAAMC,QAAQ,GAAGD,KAAK,IAAI,CAAC,CAAC;EAC5B,MAAME,IAAI,GAAG,OAAOD,QAAQ,CAACE,WAAW,KAAK,QAAQ,GAAGF,QAAQ,CAACE,WAAW,GAAG,CAAC;EAChF,OAAO;IAAEJ,KAAK;IAAEC,KAAK,EAAEC,QAAQ;IAAEC;EAAK,CAAC;AACzC;AAEA,OAAO,SAASE,qBAAqBA,CACnCL,KAAgB,EAChBC,KAA+B,EACd;EACjB,MAAMK,KAAK,GAAGR,WAAW,CAAgB,OAAO;IAC9CS,MAAM,EAAE,CAACR,SAAS,CAACC,KAAK,EAAEC,KAAK,CAAC,CAAC;IACjCO,OAAO,EAAE,KAAK;IACdC,WAAW,EAAEC;EACf,CAAC,CAAC,CAAC;EAEH,MAAMC,MAAM,GAAGA,CAAA,KAAgB;IA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AAOA,CAACpB,IAAI,EAAE;MACZG,KAAK,CAACW,QAAQ,CAAEC,KAAK,IAAK;QACxB,MAAMX,MAAM,GAAGW,KAAK,CAACX,MAAM,CAACa,KAAK,CAAC,CAAC;QACnC,MAAMI,KAAK,GAAGjB,MAAM,CAACM,MAAM,GAAG,CAAC;QAC/BN,MAAM,CAACiB,KAAK,CAAC,GAAG;UAAE,GAAGjB,MAAM,CAACiB,KAAK,CAAC;UAAErB;QAAK,CAAC;QAC1C,OAAO;UAAEI;QAAO,CAAC;MACnB,CAAC,CAAC;IACJ,CAAC;IACDkB,cAAcA,CAACC,MAAM,EAAE;MACrB,IAAIpB,KAAK,CAACM,QAAQ,CAAC,CAAC,CAACJ,OAAO,EAAE;MAC9BF,KAAK,CAACW,QAAQ,CAAC;QAAET,OAAO,EAAE,IAAI;QAAEC,WAAW,EAAEiB;MAAO,CAAC,CAAC;IACxD;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The SDK's typed surface registry — the contract layer the SDK stacks on top of
5
+ * Bloom's content-agnostic surface stack (`@oxyhq/bloom/surfaces`). One entry per
6
+ * route describing its `props` (what the presenter must pass) and its `result`
7
+ * (what awaiting `present()` resolves with). Hand-maintained, contract-first:
8
+ * adding a route here is the single edit that types it end to end.
9
+ *
10
+ * For P1 most routes keep permissive `Record<string, unknown>` props + a `void`
11
+ * result — the historical grab-bag `showBottomSheet`/`navigate` props are
12
+ * unchanged. Later phases tighten individual routes without changing this shape.
13
+ */
14
+
15
+ /** One registry entry: the props a route is presented with + its dismissal result. */
16
+
17
+ /**
18
+ * Compile-time guard: the registry keys must be EXACTLY the route names. If a new
19
+ * `RouteName` is added without a registry entry (or vice-versa) this alias
20
+ * resolves to `never` and the `satisfies` assertion below fails to type-check.
21
+ */
22
+
23
+ const _registryCoversRoutes = true;
24
+ void _registryCoversRoutes;
25
+
26
+ /** Typed props a route is presented with. */
27
+
28
+ /** What awaiting a route's `present()` resolves with when it is dismissed. */
29
+
30
+ /**
31
+ * How a surface renders — the SDK's presentation taxonomy. Each value maps to a
32
+ * concrete Bloom `Dialog` placement/chrome in `surfaces.ts`:
33
+ *
34
+ * - `'sheet'` → responsive `{ base: 'bottom', md: 'center' }` (the default:
35
+ * a bottom sheet on narrow viewports, a centered card on wide).
36
+ * - `'center'` → a plain centered modal at every width.
37
+ * - `'drawer'` → responsive `{ base: 'bottom', md: 'left' }` side drawer.
38
+ * - `'fullScreen'` → approximated with the shared `Dialog`: a full-height sheet /
39
+ * large centered card, flush (`contentPadding: 0`) content, a
40
+ * black canvas and programmatic-only dismiss (the flagship
41
+ * image picker). A real Bloom `'fullScreen'` placement is a
42
+ * follow-up if the approximation reads wrong on device.
43
+ */
44
+
45
+ /**
46
+ * Per-route surface configuration. Merges the historical `SheetRouteConfig`
47
+ * knobs with the new {@link SurfacePresentation}.
48
+ *
49
+ * NOTE: `scrollable` is LIVE — it is threaded through `bloomOptionsFor` onto the
50
+ * Bloom `Dialog` surface (`scrollable` prop), so a route that owns its own scroll
51
+ * container opts OUT of the Dialog's internal ScrollView. `manualActivation` /
52
+ * `dynamicBackdrop` / `handleComponent` remain informational — reserved for a
53
+ * future Bloom bottom-placement passthrough; the shared `DialogBottomSheet`
54
+ * currently owns pan coordination itself.
55
+ */
56
+
57
+ /** Defaults shared across all routes — the canonical responsive "sheet". */
58
+ const DEFAULT_SURFACE_CONFIG = {
59
+ presentation: 'sheet',
60
+ scrollable: true,
61
+ header: true,
62
+ manualActivation: true,
63
+ dynamicBackdrop: true
64
+ };
65
+
66
+ /**
67
+ * Routes that render NO Dialog nav header — they own their chrome:
68
+ * - `AvatarCrop` — its own translucent Cancel / title / Done top bar.
69
+ * - `PaymentGateway` — the payment surface owns its controls.
70
+ * - `WelcomeNewUser` — a full-bleed onboarding wizard with its own step chrome.
71
+ * - `Profile` — a full profile view, no nav-header chrome.
72
+ * (The flagship full-bleed image picker is handled separately below.)
73
+ *
74
+ * `AccountDialog` used to be here — it now uses the SHARED Dialog nav header like
75
+ * every other screen (its per-view title/subtitle + view-back go through
76
+ * `useSurfaceHeader`), so the account/sign-in surface no longer feels bespoke.
77
+ */
78
+ const HEADERLESS_ROUTES = new Set(['AvatarCrop', 'PaymentGateway', 'WelcomeNewUser', 'Profile']);
79
+
80
+ /**
81
+ * Predicate matching `FileManagementScreen`'s internal `isImageOnlyPicker`
82
+ * derivation. When the consumer restricts to image MIME types (no videos, no
83
+ * audio, no documents), FileManagement renders the flagship `PhotoPickerView`,
84
+ * which owns its own FlatList and reads best as a full-bleed picker. Kept in sync
85
+ * with `FileManagementScreen` — both check the same disabled MIME type families.
86
+ */
87
+ const isFileManagementImageOnlyPicker = props => {
88
+ if (!props.selectMode) return false;
89
+ const disabled = props.disabledMimeTypes;
90
+ if (!Array.isArray(disabled) || disabled.length === 0) return false;
91
+ const has = predicate => disabled.some(mt => typeof mt === 'string' && predicate(mt));
92
+ const blocksVideos = has(mt => mt === 'video/' || mt.startsWith('video/'));
93
+ const blocksAudio = has(mt => mt === 'audio/' || mt.startsWith('audio/'));
94
+ const blocksDocs = has(mt => mt === 'application/pdf' || mt === 'application/' || mt.startsWith('application/'));
95
+ return blocksVideos && blocksAudio && blocksDocs;
96
+ };
97
+
98
+ /**
99
+ * Routes whose screen owns its OWN scroll container — a FlatList /
100
+ * VirtualizedList (`ConnectedApps`, `TrustLeaderboard`, `FollowersList` /
101
+ * `FollowingList` via `UserListScreen`) or its own vertical `ScrollView`
102
+ * (`FileManagement`). These MUST opt out of the Dialog's internal ScrollView
103
+ * (`scrollable: false`) so there is exactly ONE scroll container — otherwise a
104
+ * VirtualizedList nests inside a plain ScrollView (RN warning) or a nested
105
+ * vertical scroll-in-scroll breaks windowing. Screens with only a HORIZONTAL
106
+ * ScrollView (FAQ's category row, Premium's plan carousel) are NOT listed — a
107
+ * horizontal scroller does not conflict with the Dialog's vertical scroll.
108
+ */
109
+ const OWN_SCROLL_CONTAINER_ROUTES = new Set(['FileManagement', 'ConnectedApps', 'TrustLeaderboard', 'FollowersList', 'FollowingList']);
110
+
111
+ /**
112
+ * Resolve the surface configuration for a route + props. Defaults to the
113
+ * responsive sheet; the image-only FileManagement picker upgrades to a full-bleed
114
+ * `'fullScreen'` surface, and every route that owns its own scroll container is
115
+ * marked `scrollable: false`.
116
+ */
117
+ export const getSurfaceConfig = (route, props) => {
118
+ if (route === 'FileManagement' && isFileManagementImageOnlyPicker(props)) {
119
+ // The full-bleed image picker owns its own translucent top bar — no nav header.
120
+ return {
121
+ ...DEFAULT_SURFACE_CONFIG,
122
+ presentation: 'fullScreen',
123
+ scrollable: false,
124
+ header: false
125
+ };
126
+ }
127
+ if (HEADERLESS_ROUTES.has(route)) {
128
+ return {
129
+ ...DEFAULT_SURFACE_CONFIG,
130
+ header: false
131
+ };
132
+ }
133
+ if (OWN_SCROLL_CONTAINER_ROUTES.has(route)) {
134
+ // Own-scroller list screens keep the nav header (static, non-collapsing —
135
+ // there is no Dialog scroll offset to drive the large-title collapse).
136
+ return {
137
+ ...DEFAULT_SURFACE_CONFIG,
138
+ scrollable: false
139
+ };
140
+ }
141
+ return DEFAULT_SURFACE_CONFIG;
142
+ };
143
+
144
+ /** Convenience: just the presentation taxonomy for a route + props. */
145
+ export const getSurfacePresentation = (route, props) => getSurfaceConfig(route, props).presentation;
146
+ //# sourceMappingURL=surfaceRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_registryCoversRoutes","DEFAULT_SURFACE_CONFIG","presentation","scrollable","header","manualActivation","dynamicBackdrop","HEADERLESS_ROUTES","Set","isFileManagementImageOnlyPicker","props","selectMode","disabled","disabledMimeTypes","Array","isArray","length","has","predicate","some","mt","blocksVideos","startsWith","blocksAudio","blocksDocs","OWN_SCROLL_CONTAINER_ROUTES","getSurfaceConfig","route","getSurfacePresentation"],"sourceRoot":"../../../../src","sources":["ui/navigation/surfaceRegistry.ts"],"mappings":";;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AAU,CAAC,QAAQ,CAAC,CAAC;EAC3E,MAAME,UAAU,GAAGP,GAAG,CACnBG,EAAE,IAAKA,EAAE,KAAK,iBAAiB,IAAIA,EAAE,KAAK,cAAc,IAAIA,EAAE,CAACE,UAAU,CAAC,cAAc,CAC3F,CAAC;EACD,OAAOD,YAAY,IAAIE,WAAW,IAAIC,UAAU;AAClD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAAmD,GAAG,IAAIjB,GAAG,CAAY,CAC7E,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,CAChB,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMkB,gBAAgB,GAAGA,CAC9BC,KAAgB,EAChBjB,KAA8B,KACP;EACvB,IAAIiB,KAAK,KAAK,gBAAgB,IAAIlB,+BAA+B,CAACC,KAAK,CAAC,EAAE;IACxE;IACA,OAAO;MAAE,GAAGT,sBAAsB;MAAEC,YAAY,EAAE,YAAY;MAAEC,UAAU,EAAE,KAAK;MAAEC,MAAM,EAAE;IAAM,CAAC;EACpG;EACA,IAAIG,iBAAiB,CAACU,GAAG,CAACU,KAAK,CAAC,EAAE;IAChC,OAAO;MAAE,GAAG1B,sBAAsB;MAAEG,MAAM,EAAE;IAAM,CAAC;EACrD;EACA,IAAIqB,2BAA2B,CAACR,GAAG,CAACU,KAAK,CAAC,EAAE;IAC1C;IACA;IACA,OAAO;MAAE,GAAG1B,sBAAsB;MAAEE,UAAU,EAAE;IAAM,CAAC;EACzD;EACA,OAAOF,sBAAsB;AAC/B,CAAC;;AAED;AACA,OAAO,MAAM2B,sBAAsB,GAAGA,CACpCD,KAAgB,EAChBjB,KAA8B,KACNgB,gBAAgB,CAACC,KAAK,EAAEjB,KAAK,CAAC,CAACR,YAAY","ignoreList":[]}
@@ -0,0 +1,244 @@
1
+ "use strict";
2
+
3
+ import { createElement } from 'react';
4
+ import { surfaces as bloomSurfaces } from '@oxyhq/bloom/surfaces';
5
+ import SurfaceScreen from "../components/SurfaceScreen.js";
6
+ import { getSurfaceConfig, getSurfacePresentation } from "./surfaceRegistry.js";
7
+ import { createSurfaceNavStack } from "./surfaceNavStack.js";
8
+
9
+ /**
10
+ * The SDK's typed surface API — a route registry layered on top of Bloom's
11
+ * content-agnostic surface stack (`@oxyhq/bloom/surfaces`).
12
+ *
13
+ * `present(route)` opens a NEW Bloom surface (the DEPTH axis) whose content is a
14
+ * {@link SurfaceScreen} driven by the route's own {@link SurfaceNavStack} (the
15
+ * NAV-WITHIN axis). Navigating within that surface mutates its nav stack and
16
+ * re-renders the SAME Bloom surface; presenting stacks another surface on top.
17
+ *
18
+ * Bloom coordinates z-order / backdrop / dismiss across every surface (SDK's and
19
+ * apps'), so nothing clashes.
20
+ */
21
+
22
+ /** Responsive "sheet": bottom sheet on narrow, centered card on wide. */
23
+ const SHEET_PLACEMENT = {
24
+ base: 'bottom',
25
+ md: 'center'
26
+ };
27
+
28
+ /** Full-bleed black canvas for the `'fullScreen'` approximation (image picker). */
29
+ const FULLSCREEN_SURFACE_STYLE = {
30
+ backgroundColor: '#000000',
31
+ overflow: 'hidden'
32
+ };
33
+
34
+ /**
35
+ * Every SDK screen owns its own background + content padding + scroll region
36
+ * (they were authored for the bare `BottomSheet`). So the shared `Dialog` must
37
+ * NOT add its own `contentPadding` on top (that double-pads) — it owns only the
38
+ * structural chrome: the surface card, the size cap (`maxHeightRatio`) and the
39
+ * scroll boundary. `contentPadding: 0` makes the screen's own padding the single
40
+ * source, matching the image-picker (`fullScreen`) surface.
41
+ */
42
+ const SDK_SURFACE_CHROME = {
43
+ contentPadding: 0,
44
+ maxHeightRatio: 0.9
45
+ };
46
+
47
+ /** Map a route's presentation taxonomy onto concrete Bloom `Dialog` options. */
48
+ function bloomOptionsFor(config) {
49
+ // Threaded onto every placement so a route that owns its own scroll container
50
+ // (`scrollable: false`) opts out of the Dialog's internal ScrollView.
51
+ const scrollable = config.scrollable;
52
+ // Nav-header mode marker: turns on the Dialog's OWN sticky gradient nav bar +
53
+ // large collapsing title over its scroll content. The title/subtitle/action
54
+ // slots are contributed at runtime by the mounted screen via `useSurfaceHeader`
55
+ // (resolved in `SurfaceScreen`), so the seed here just enables the scaffold.
56
+ const header = config.header ? {
57
+ largeTitle: true
58
+ } : undefined;
59
+ switch (config.presentation) {
60
+ case 'center':
61
+ return {
62
+ placement: 'center',
63
+ scrollable,
64
+ header,
65
+ ...SDK_SURFACE_CHROME
66
+ };
67
+ case 'drawer':
68
+ return {
69
+ placement: {
70
+ base: 'bottom',
71
+ md: 'left'
72
+ },
73
+ scrollable,
74
+ header,
75
+ ...SDK_SURFACE_CHROME
76
+ };
77
+ case 'fullScreen':
78
+ // Approximate a full-screen surface with the shared `Dialog`: a tall
79
+ // sheet / large centered card, flush content, a black canvas and
80
+ // programmatic-only dismiss — matching the shipped image-picker Dialog.
81
+ return {
82
+ placement: SHEET_PLACEMENT,
83
+ contentPadding: 0,
84
+ maxWidth: 640,
85
+ maxHeightRatio: 0.9,
86
+ dismissOnBackdrop: false,
87
+ scrollable,
88
+ style: FULLSCREEN_SURFACE_STYLE,
89
+ panelStyle: FULLSCREEN_SURFACE_STYLE
90
+ };
91
+ default:
92
+ return {
93
+ placement: SHEET_PLACEMENT,
94
+ scrollable,
95
+ header,
96
+ ...SDK_SURFACE_CHROME
97
+ };
98
+ }
99
+ }
100
+
101
+ /**
102
+ * A live handle to a presented SDK surface. Exposes DEPTH controls (`dismiss`,
103
+ * `result`) and NAV-WITHIN controls (`navigate`/`replace`/`goBack`/`setStep`) that
104
+ * drive this surface's own nav stack. Held by the `showBottomSheet` adapter (base
105
+ * surface) and by `OxyContext` (the AccountDialog surface).
106
+ */
107
+
108
+ /**
109
+ * The type-erased handle the `showBottomSheet` adapter needs from a tracked
110
+ * surface: what it hosts, and how to drive/dismiss it. Kept result-type-free so
111
+ * the (generic) `SurfaceInstance<K>` never has to be widened into a shared array.
112
+ */
113
+
114
+ /**
115
+ * Active SDK "route" surfaces (the `showBottomSheet` lineage), bottom → top.
116
+ * `present`/`presentRoute` register here; `presentDetached` (AccountDialog) does
117
+ * NOT, so the base-sheet navigation logic never treats the account modal as a
118
+ * navigable base. Entries self-remove when their surface is dismissed.
119
+ */
120
+ const activeRouteSurfaces = [];
121
+ function presentInternal(route, props, opts, track) {
122
+ const navStack = createSurfaceNavStack(route, props);
123
+ const config = getSurfaceConfig(route, props);
124
+ const bloomOpts = {
125
+ label: route,
126
+ ...bloomOptionsFor(config),
127
+ ...opts
128
+ };
129
+ const result = bloomSurfaces.present(surface => /*#__PURE__*/createElement(SurfaceScreen, {
130
+ navStack,
131
+ surface,
132
+ presentation: config.presentation,
133
+ dismissOnBackdrop: bloomOpts.dismissOnBackdrop ?? true
134
+ }), bloomOpts);
135
+ const instance = {
136
+ route,
137
+ presentation: config.presentation,
138
+ navigate: (nextRoute, nextProps) => {
139
+ const top = navStack.getTop();
140
+ if (top.route === nextRoute) navStack.replace(nextRoute, nextProps);else navStack.navigate(nextRoute, nextProps);
141
+ },
142
+ replace: (nextRoute, nextProps) => navStack.replace(nextRoute, nextProps),
143
+ goBack: () => navStack.goBack(),
144
+ canGoBack: () => navStack.canGoBack(),
145
+ setStep: step => navStack.setStep(step),
146
+ dismiss: dismissResult => navStack.requestDismiss(dismissResult),
147
+ result
148
+ };
149
+ if (track) {
150
+ const tracked = {
151
+ route: instance.route,
152
+ presentation: instance.presentation,
153
+ navigate: instance.navigate,
154
+ goBack: instance.goBack,
155
+ dismiss: () => instance.dismiss()
156
+ };
157
+ activeRouteSurfaces.push(tracked);
158
+ result.finally(() => {
159
+ const index = activeRouteSurfaces.indexOf(tracked);
160
+ if (index >= 0) activeRouteSurfaces.splice(index, 1);
161
+ });
162
+ }
163
+ return instance;
164
+ }
165
+
166
+ /**
167
+ * Present a NEW route surface on top of the stack (the DEPTH axis). Resolves with
168
+ * the value the surface is dismissed with. Registered in the route-surface stack.
169
+ */
170
+ export function present(route, props, opts) {
171
+ return presentInternal(route, props ?? {}, opts, true);
172
+ }
173
+
174
+ /**
175
+ * Present a surface that is NOT part of the `showBottomSheet` base-navigation
176
+ * lineage (the AccountDialog modal). Otherwise identical to {@link present}.
177
+ */
178
+ export function presentDetached(route, props, opts) {
179
+ return presentInternal(route, props ?? {}, opts, false);
180
+ }
181
+
182
+ /**
183
+ * Untyped present for the adapter, the nav helpers, and the `SurfaceScreen`
184
+ * binding (where the route is a runtime value and its props are already erased).
185
+ */
186
+ export function presentRoute(route, props) {
187
+ return presentInternal(route, props ?? {}, undefined, true);
188
+ }
189
+
190
+ /** The top-most active route surface, or `undefined` when none are open. */
191
+ export function topRouteSurface() {
192
+ return activeRouteSurfaces[activeRouteSurfaces.length - 1];
193
+ }
194
+
195
+ /**
196
+ * Dismiss every active route surface (the whole `showBottomSheet` session). The
197
+ * AccountDialog is untracked, so it is untouched. Iterates a snapshot because
198
+ * `dismiss` mutates `activeRouteSurfaces` asynchronously as surfaces settle.
199
+ */
200
+ export function closeAllRouteSurfaces() {
201
+ for (const instance of [...activeRouteSurfaces].reverse()) instance.dismiss();
202
+ }
203
+
204
+ /**
205
+ * Drill in from a screen: navigate WITHIN the current surface when the target's
206
+ * presentation matches, else present the target as a NEW surface on top (so a
207
+ * sheet screen opening the full-bleed picker gets the right chrome).
208
+ */
209
+ export function navigateWithinOrPresent(currentPresentation, navStack, route, props) {
210
+ const nextProps = props ?? {};
211
+ if (getSurfacePresentation(route, nextProps) === currentPresentation) {
212
+ navStack.navigate(route, nextProps);
213
+ } else {
214
+ presentRoute(route, nextProps);
215
+ }
216
+ }
217
+
218
+ /** Replace variant of {@link navigateWithinOrPresent}. */
219
+ export function replaceWithinOrPresent(currentPresentation, navStack, route, props) {
220
+ const nextProps = props ?? {};
221
+ if (getSurfacePresentation(route, nextProps) === currentPresentation) {
222
+ navStack.replace(route, nextProps);
223
+ } else {
224
+ presentRoute(route, nextProps);
225
+ }
226
+ }
227
+
228
+ /**
229
+ * The SDK's imperative surface API (a module singleton). `present` is the typed
230
+ * route presenter; `dismissAll` unwinds the whole session. Not yet exported from
231
+ * the package root — the public `surfaces`/`useSurfaces` API lands in a later
232
+ * phase; for P1 the internal adapters (`showBottomSheet`, `openAccountDialog`)
233
+ * are the only public entry points.
234
+ */
235
+ export const surfaces = {
236
+ present: (route, props, opts) => present(route, props, opts).result,
237
+ dismissAll: closeAllRouteSurfaces
238
+ };
239
+
240
+ /** Hook form of {@link surfaces} (stable singleton). */
241
+ export function useSurfaces() {
242
+ return surfaces;
243
+ }
244
+ //# sourceMappingURL=surfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createElement","surfaces","bloomSurfaces","SurfaceScreen","getSurfaceConfig","getSurfacePresentation","createSurfaceNavStack","SHEET_PLACEMENT","base","md","FULLSCREEN_SURFACE_STYLE","backgroundColor","overflow","SDK_SURFACE_CHROME","contentPadding","maxHeightRatio","bloomOptionsFor","config","scrollable","header","largeTitle","undefined","presentation","placement","maxWidth","dismissOnBackdrop","style","panelStyle","activeRouteSurfaces","presentInternal","route","props","opts","track","navStack","bloomOpts","label","result","present","surface","instance","navigate","nextRoute","nextProps","top","getTop","replace","goBack","canGoBack","setStep","step","dismiss","dismissResult","requestDismiss","tracked","push","finally","index","indexOf","splice","presentDetached","presentRoute","topRouteSurface","length","closeAllRouteSurfaces","reverse","navigateWithinOrPresent","currentPresentation","replaceWithinOrPresent","dismissAll","useSurfaces"],"sourceRoot":"../../../../src","sources":["ui/navigation/surfaces.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,OAAO;AAErC,SACEC,QAAQ,IAAIC,aAAa,QAGpB,uBAAuB;AAC9B,OAAOC,aAAa,MAAM,gCAA6B;AAEvD,SACEC,gBAAgB,EAChBC,sBAAsB,QAKjB,sBAAmB;AAC1B,SAASC,qBAAqB,QAA8B,sBAAmB;;AAE/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,eA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