@oxyhq/services 6.10.7 → 7.0.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 (454) hide show
  1. package/lib/commonjs/index.js +211 -49
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/client.js +25 -4
  4. package/lib/commonjs/ui/client.js.map +1 -1
  5. package/lib/commonjs/ui/components/AccountMenu.js +485 -0
  6. package/lib/commonjs/ui/components/AccountMenu.js.map +1 -0
  7. package/lib/commonjs/ui/components/AccountMenuButton.js +120 -0
  8. package/lib/commonjs/ui/components/AccountMenuButton.js.map +1 -0
  9. package/lib/commonjs/ui/components/ActingAsBanner.js +2 -2
  10. package/lib/commonjs/ui/components/ActingAsBanner.js.map +1 -1
  11. package/lib/commonjs/ui/components/ProfileCard.js +2 -2
  12. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
  13. package/lib/commonjs/ui/components/StepBasedScreen.js +2 -2
  14. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
  15. package/lib/commonjs/ui/components/accountMenuRows.js +45 -0
  16. package/lib/commonjs/ui/components/accountMenuRows.js.map +1 -0
  17. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +5 -5
  18. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  19. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +3 -2
  20. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
  21. package/lib/commonjs/ui/components/theming.js +2 -2
  22. package/lib/commonjs/ui/components/theming.js.map +1 -1
  23. package/lib/commonjs/ui/context/OxyContext.js +211 -21
  24. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  25. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +36 -2
  26. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  27. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +6 -0
  28. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js.map +1 -1
  29. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +138 -1
  30. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  31. package/lib/commonjs/ui/hooks/queries/queryKeys.js +67 -2
  32. package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
  33. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +27 -2
  34. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  35. package/lib/commonjs/ui/hooks/useAuth.js +13 -2
  36. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  37. package/lib/commonjs/ui/hooks/useSessionManagement.js +30 -0
  38. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  39. package/lib/commonjs/ui/index.js +132 -85
  40. package/lib/commonjs/ui/index.js.map +1 -1
  41. package/lib/commonjs/ui/navigation/routes.js +6 -7
  42. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  43. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +3 -2
  44. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +202 -0
  46. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -0
  47. package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +3 -2
  48. package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +3 -2
  50. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/FAQScreen.js +7 -4
  52. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/FeedbackScreen.js +21 -16
  54. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/HelpSupportScreen.js +3 -2
  56. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/HistoryViewScreen.js +7 -4
  58. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -2
  60. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +6 -4
  62. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  63. package/lib/commonjs/ui/screens/ManageAccountScreen.js +780 -0
  64. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -0
  65. package/lib/commonjs/ui/screens/NotificationsScreen.js +175 -0
  66. package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -0
  67. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +18 -12
  68. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  69. package/lib/commonjs/ui/screens/PreferencesScreen.js +220 -0
  70. package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -0
  71. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +14 -10
  72. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/ProfileScreen.js +3 -3
  74. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  75. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +8 -5
  76. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  77. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +6 -4
  78. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/UserLinksScreen.js +3 -2
  80. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/UserListScreen.js +2 -2
  82. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  83. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +3 -2
  84. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  85. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +3 -2
  86. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  87. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
  88. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  89. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +4 -3
  90. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  91. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +3 -2
  92. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  93. package/lib/commonjs/ui/utils/activeAuthuser.js +85 -0
  94. package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -0
  95. package/lib/module/index.js +58 -16
  96. package/lib/module/index.js.map +1 -1
  97. package/lib/module/ui/client.js +5 -3
  98. package/lib/module/ui/client.js.map +1 -1
  99. package/lib/module/ui/components/AccountMenu.js +480 -0
  100. package/lib/module/ui/components/AccountMenu.js.map +1 -0
  101. package/lib/module/ui/components/AccountMenuButton.js +115 -0
  102. package/lib/module/ui/components/AccountMenuButton.js.map +1 -0
  103. package/lib/module/ui/components/ActingAsBanner.js +2 -2
  104. package/lib/module/ui/components/ActingAsBanner.js.map +1 -1
  105. package/lib/module/ui/components/ProfileCard.js +1 -1
  106. package/lib/module/ui/components/ProfileCard.js.map +1 -1
  107. package/lib/module/ui/components/StepBasedScreen.js +1 -1
  108. package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
  109. package/lib/module/ui/components/accountMenuRows.js +41 -0
  110. package/lib/module/ui/components/accountMenuRows.js.map +1 -0
  111. package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
  112. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  113. package/lib/module/ui/components/payment/PaymentMethodStep.js +1 -1
  114. package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
  115. package/lib/module/ui/components/theming.js +1 -1
  116. package/lib/module/ui/components/theming.js.map +1 -1
  117. package/lib/module/ui/context/OxyContext.js +211 -21
  118. package/lib/module/ui/context/OxyContext.js.map +1 -1
  119. package/lib/module/ui/context/hooks/useAuthOperations.js +36 -2
  120. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  121. package/lib/module/ui/hooks/mutations/mutationKeys.js +6 -0
  122. package/lib/module/ui/hooks/mutations/mutationKeys.js.map +1 -1
  123. package/lib/module/ui/hooks/mutations/useAccountMutations.js +135 -1
  124. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  125. package/lib/module/ui/hooks/queries/queryKeys.js +60 -1
  126. package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
  127. package/lib/module/ui/hooks/queries/useAccountQueries.js +24 -0
  128. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  129. package/lib/module/ui/hooks/useAuth.js +13 -2
  130. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  131. package/lib/module/ui/hooks/useSessionManagement.js +30 -0
  132. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  133. package/lib/module/ui/index.js +34 -78
  134. package/lib/module/ui/index.js.map +1 -1
  135. package/lib/module/ui/navigation/routes.js +6 -7
  136. package/lib/module/ui/navigation/routes.js.map +1 -1
  137. package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
  138. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  139. package/lib/module/ui/screens/ConnectedAppsScreen.js +198 -0
  140. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -0
  141. package/lib/module/ui/screens/CreateManagedAccountScreen.js +1 -1
  142. package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -1
  143. package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
  144. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  145. package/lib/module/ui/screens/FAQScreen.js +3 -1
  146. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  147. package/lib/module/ui/screens/FeedbackScreen.js +6 -2
  148. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  149. package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
  150. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  151. package/lib/module/ui/screens/HistoryViewScreen.js +3 -1
  152. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  153. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  154. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  155. package/lib/module/ui/screens/LegalDocumentsScreen.js +2 -1
  156. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  157. package/lib/module/ui/screens/ManageAccountScreen.js +775 -0
  158. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -0
  159. package/lib/module/ui/screens/NotificationsScreen.js +169 -0
  160. package/lib/module/ui/screens/NotificationsScreen.js.map +1 -0
  161. package/lib/module/ui/screens/PaymentGatewayScreen.js +9 -3
  162. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  163. package/lib/module/ui/screens/PreferencesScreen.js +214 -0
  164. package/lib/module/ui/screens/PreferencesScreen.js.map +1 -0
  165. package/lib/module/ui/screens/PrivacySettingsScreen.js +4 -1
  166. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  167. package/lib/module/ui/screens/ProfileScreen.js +2 -2
  168. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  169. package/lib/module/ui/screens/SavesCollectionsScreen.js +3 -1
  170. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  171. package/lib/module/ui/screens/SearchSettingsScreen.js +2 -1
  172. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
  173. package/lib/module/ui/screens/UserLinksScreen.js +1 -1
  174. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
  175. package/lib/module/ui/screens/UserListScreen.js +1 -1
  176. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  177. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +1 -1
  178. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  179. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
  180. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  181. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  182. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  183. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +1 -1
  184. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  185. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
  186. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  187. package/lib/module/ui/utils/activeAuthuser.js +79 -0
  188. package/lib/module/ui/utils/activeAuthuser.js.map +1 -0
  189. package/lib/typescript/commonjs/index.d.ts +23 -6
  190. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  191. package/lib/typescript/commonjs/ui/client.d.ts +7 -2
  192. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  193. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +23 -0
  194. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +19 -0
  196. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts +27 -0
  198. package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  200. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  201. package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts +5 -0
  202. package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
  203. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
  204. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  205. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +32 -3
  206. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  207. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +10 -1
  208. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  209. package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts +1 -1
  210. package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
  211. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +8 -2
  212. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  213. package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
  214. package/lib/typescript/commonjs/ui/index.d.ts +32 -18
  215. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  216. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  217. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  218. package/lib/typescript/{module/ui/screens/AccountOverviewScreen.d.ts → commonjs/ui/screens/ConnectedAppsScreen.d.ts} +1 -1
  219. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  222. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  223. package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +13 -0
  225. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/ui/screens/{AccountOverviewScreen.d.ts → NotificationsScreen.d.ts} +1 -1
  227. package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts +1 -1
  229. package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  230. package/lib/typescript/commonjs/ui/screens/{AccountSettingsScreen.d.ts → PreferencesScreen.d.ts} +2 -5
  231. package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  234. package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +42 -0
  236. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -0
  237. package/lib/typescript/module/index.d.ts +23 -6
  238. package/lib/typescript/module/index.d.ts.map +1 -1
  239. package/lib/typescript/module/ui/client.d.ts +7 -2
  240. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  241. package/lib/typescript/module/ui/components/AccountMenu.d.ts +23 -0
  242. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -0
  243. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +19 -0
  244. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +1 -0
  245. package/lib/typescript/module/ui/components/accountMenuRows.d.ts +27 -0
  246. package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -0
  247. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  248. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  249. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts +5 -0
  250. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
  251. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
  252. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  253. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +32 -3
  254. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  255. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +10 -1
  256. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  257. package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts +1 -1
  258. package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
  259. package/lib/typescript/module/ui/hooks/useAuth.d.ts +8 -2
  260. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  261. package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
  262. package/lib/typescript/module/ui/index.d.ts +32 -18
  263. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  264. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  265. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  266. package/lib/typescript/module/ui/screens/{AccountSettingsScreen.d.ts → ConnectedAppsScreen.d.ts} +2 -5
  267. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
  268. package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
  269. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  270. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  271. package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  272. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +13 -0
  273. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -0
  274. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts +5 -0
  275. package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -0
  276. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +1 -1
  277. package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  278. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts +5 -0
  279. package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -0
  280. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  281. package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  282. package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  283. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +42 -0
  284. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -0
  285. package/package.json +20 -9
  286. package/src/index.ts +141 -47
  287. package/src/ui/client.ts +7 -2
  288. package/src/ui/components/AccountMenu.tsx +534 -0
  289. package/src/ui/components/AccountMenuButton.tsx +113 -0
  290. package/src/ui/components/ActingAsBanner.tsx +2 -2
  291. package/src/ui/components/ProfileCard.tsx +1 -1
  292. package/src/ui/components/StepBasedScreen.tsx +1 -1
  293. package/src/ui/components/accountMenuRows.ts +60 -0
  294. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  295. package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
  296. package/src/ui/components/theming.tsx +1 -1
  297. package/src/ui/context/OxyContext.tsx +204 -18
  298. package/src/ui/context/hooks/useAuthOperations.ts +36 -2
  299. package/src/ui/hooks/mutations/mutationKeys.ts +11 -0
  300. package/src/ui/hooks/mutations/useAccountMutations.ts +154 -2
  301. package/src/ui/hooks/queries/queryKeys.ts +54 -4
  302. package/src/ui/hooks/queries/useAccountQueries.ts +25 -1
  303. package/src/ui/hooks/useAuth.ts +23 -4
  304. package/src/ui/hooks/useSessionManagement.ts +29 -0
  305. package/src/ui/index.ts +37 -98
  306. package/src/ui/navigation/routes.ts +9 -11
  307. package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
  308. package/src/ui/screens/ConnectedAppsScreen.tsx +225 -0
  309. package/src/ui/screens/CreateManagedAccountScreen.tsx +1 -1
  310. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
  311. package/src/ui/screens/FAQScreen.tsx +3 -1
  312. package/src/ui/screens/FeedbackScreen.tsx +6 -10
  313. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  314. package/src/ui/screens/HistoryViewScreen.tsx +3 -1
  315. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  316. package/src/ui/screens/LegalDocumentsScreen.tsx +2 -1
  317. package/src/ui/screens/ManageAccountScreen.tsx +1102 -0
  318. package/src/ui/screens/NotificationsScreen.tsx +189 -0
  319. package/src/ui/screens/PaymentGatewayScreen.tsx +10 -12
  320. package/src/ui/screens/PreferencesScreen.tsx +263 -0
  321. package/src/ui/screens/PrivacySettingsScreen.tsx +4 -1
  322. package/src/ui/screens/ProfileScreen.tsx +2 -2
  323. package/src/ui/screens/SavesCollectionsScreen.tsx +3 -1
  324. package/src/ui/screens/SearchSettingsScreen.tsx +2 -1
  325. package/src/ui/screens/UserLinksScreen.tsx +1 -1
  326. package/src/ui/screens/UserListScreen.tsx +1 -1
  327. package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
  328. package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
  329. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
  330. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
  331. package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
  332. package/src/ui/utils/activeAuthuser.ts +78 -0
  333. package/lib/commonjs/ui/components/feedback/index.js +0 -54
  334. package/lib/commonjs/ui/components/feedback/index.js.map +0 -1
  335. package/lib/commonjs/ui/components/icon/index.js +0 -21
  336. package/lib/commonjs/ui/components/icon/index.js.map +0 -1
  337. package/lib/commonjs/ui/components/index.js +0 -104
  338. package/lib/commonjs/ui/components/index.js.map +0 -1
  339. package/lib/commonjs/ui/components/modals/index.js +0 -14
  340. package/lib/commonjs/ui/components/modals/index.js.map +0 -1
  341. package/lib/commonjs/ui/components/payment/index.js +0 -80
  342. package/lib/commonjs/ui/components/payment/index.js.map +0 -1
  343. package/lib/commonjs/ui/hooks/index.js +0 -92
  344. package/lib/commonjs/ui/hooks/index.js.map +0 -1
  345. package/lib/commonjs/ui/hooks/mutations/index.js +0 -68
  346. package/lib/commonjs/ui/hooks/mutations/index.js.map +0 -1
  347. package/lib/commonjs/ui/hooks/queries/index.js +0 -155
  348. package/lib/commonjs/ui/hooks/queries/index.js.map +0 -1
  349. package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -344
  350. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +0 -1
  351. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -724
  352. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +0 -1
  353. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +0 -643
  354. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +0 -1
  355. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -1029
  356. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  357. package/lib/commonjs/ui/screens/SessionManagementScreen.js +0 -512
  358. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +0 -1
  359. package/lib/commonjs/ui/styles/index.js +0 -39
  360. package/lib/commonjs/ui/styles/index.js.map +0 -1
  361. package/lib/module/ui/components/feedback/index.js +0 -8
  362. package/lib/module/ui/components/feedback/index.js.map +0 -1
  363. package/lib/module/ui/components/icon/index.js +0 -5
  364. package/lib/module/ui/components/icon/index.js.map +0 -1
  365. package/lib/module/ui/components/index.js +0 -18
  366. package/lib/module/ui/components/index.js.map +0 -1
  367. package/lib/module/ui/components/modals/index.js +0 -4
  368. package/lib/module/ui/components/modals/index.js.map +0 -1
  369. package/lib/module/ui/components/payment/index.js +0 -10
  370. package/lib/module/ui/components/payment/index.js.map +0 -1
  371. package/lib/module/ui/hooks/index.js +0 -11
  372. package/lib/module/ui/hooks/index.js.map +0 -1
  373. package/lib/module/ui/hooks/mutations/index.js +0 -15
  374. package/lib/module/ui/hooks/mutations/index.js.map +0 -1
  375. package/lib/module/ui/hooks/queries/index.js +0 -26
  376. package/lib/module/ui/hooks/queries/index.js.map +0 -1
  377. package/lib/module/ui/screens/AccountCenterScreen.js +0 -339
  378. package/lib/module/ui/screens/AccountCenterScreen.js.map +0 -1
  379. package/lib/module/ui/screens/AccountOverviewScreen.js +0 -719
  380. package/lib/module/ui/screens/AccountOverviewScreen.js.map +0 -1
  381. package/lib/module/ui/screens/AccountSettingsScreen.js +0 -638
  382. package/lib/module/ui/screens/AccountSettingsScreen.js.map +0 -1
  383. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -1024
  384. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  385. package/lib/module/ui/screens/SessionManagementScreen.js +0 -508
  386. package/lib/module/ui/screens/SessionManagementScreen.js.map +0 -1
  387. package/lib/module/ui/styles/index.js +0 -6
  388. package/lib/module/ui/styles/index.js.map +0 -1
  389. package/lib/typescript/commonjs/ui/components/feedback/index.d.ts +0 -7
  390. package/lib/typescript/commonjs/ui/components/feedback/index.d.ts.map +0 -1
  391. package/lib/typescript/commonjs/ui/components/icon/index.d.ts +0 -4
  392. package/lib/typescript/commonjs/ui/components/icon/index.d.ts.map +0 -1
  393. package/lib/typescript/commonjs/ui/components/index.d.ts +0 -13
  394. package/lib/typescript/commonjs/ui/components/index.d.ts.map +0 -1
  395. package/lib/typescript/commonjs/ui/components/modals/index.d.ts +0 -2
  396. package/lib/typescript/commonjs/ui/components/modals/index.d.ts.map +0 -1
  397. package/lib/typescript/commonjs/ui/components/payment/index.d.ts +0 -9
  398. package/lib/typescript/commonjs/ui/components/payment/index.d.ts.map +0 -1
  399. package/lib/typescript/commonjs/ui/hooks/index.d.ts +0 -9
  400. package/lib/typescript/commonjs/ui/hooks/index.d.ts.map +0 -1
  401. package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts +0 -9
  402. package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts.map +0 -1
  403. package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts +0 -13
  404. package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts.map +0 -1
  405. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts +0 -5
  406. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +0 -1
  407. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
  408. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
  409. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -5
  410. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  411. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts +0 -5
  412. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +0 -1
  413. package/lib/typescript/commonjs/ui/styles/index.d.ts +0 -4
  414. package/lib/typescript/commonjs/ui/styles/index.d.ts.map +0 -1
  415. package/lib/typescript/module/ui/components/feedback/index.d.ts +0 -7
  416. package/lib/typescript/module/ui/components/feedback/index.d.ts.map +0 -1
  417. package/lib/typescript/module/ui/components/icon/index.d.ts +0 -4
  418. package/lib/typescript/module/ui/components/icon/index.d.ts.map +0 -1
  419. package/lib/typescript/module/ui/components/index.d.ts +0 -13
  420. package/lib/typescript/module/ui/components/index.d.ts.map +0 -1
  421. package/lib/typescript/module/ui/components/modals/index.d.ts +0 -2
  422. package/lib/typescript/module/ui/components/modals/index.d.ts.map +0 -1
  423. package/lib/typescript/module/ui/components/payment/index.d.ts +0 -9
  424. package/lib/typescript/module/ui/components/payment/index.d.ts.map +0 -1
  425. package/lib/typescript/module/ui/hooks/index.d.ts +0 -9
  426. package/lib/typescript/module/ui/hooks/index.d.ts.map +0 -1
  427. package/lib/typescript/module/ui/hooks/mutations/index.d.ts +0 -9
  428. package/lib/typescript/module/ui/hooks/mutations/index.d.ts.map +0 -1
  429. package/lib/typescript/module/ui/hooks/queries/index.d.ts +0 -13
  430. package/lib/typescript/module/ui/hooks/queries/index.d.ts.map +0 -1
  431. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts +0 -5
  432. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +0 -1
  433. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
  434. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
  435. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -5
  436. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  437. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts +0 -5
  438. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +0 -1
  439. package/lib/typescript/module/ui/styles/index.d.ts +0 -4
  440. package/lib/typescript/module/ui/styles/index.d.ts.map +0 -1
  441. package/src/ui/components/feedback/index.ts +0 -6
  442. package/src/ui/components/icon/index.ts +0 -3
  443. package/src/ui/components/index.ts +0 -15
  444. package/src/ui/components/modals/index.ts +0 -1
  445. package/src/ui/components/payment/index.ts +0 -9
  446. package/src/ui/hooks/index.ts +0 -13
  447. package/src/ui/hooks/mutations/index.ts +0 -25
  448. package/src/ui/hooks/queries/index.ts +0 -61
  449. package/src/ui/screens/AccountCenterScreen.tsx +0 -182
  450. package/src/ui/screens/AccountOverviewScreen.tsx +0 -696
  451. package/src/ui/screens/AccountSettingsScreen.tsx +0 -620
  452. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -1003
  453. package/src/ui/screens/SessionManagementScreen.tsx +0 -477
  454. package/src/ui/styles/index.ts +0 -3
@@ -1,643 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _vectorIcons = require("@expo/vector-icons");
10
- var _bloom = require("@oxyhq/bloom");
11
- var _authStore = require("../stores/authStore.js");
12
- var _settingsList = require("@oxyhq/bloom/settings-list");
13
- var _useI18n = require("../hooks/useI18n.js");
14
- var _theme = require("@oxyhq/bloom/theme");
15
- var _useColorScheme = require("../hooks/useColorScheme.js");
16
- var _theme2 = require("../constants/theme.js");
17
- var _themeUtils = require("../utils/themeUtils.js");
18
- var _userUtils = require("../utils/userUtils.js");
19
- var _OxyContext = require("../context/OxyContext.js");
20
- var _useAccountQueries = require("../hooks/queries/useAccountQueries.js");
21
- var _useAccountMutations = require("../hooks/mutations/useAccountMutations.js");
22
- var _spacing = require("../constants/spacing.js");
23
- var _jsxRuntime = require("react/jsx-runtime");
24
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
25
- const AccountSettingsScreen = ({
26
- onClose,
27
- theme,
28
- goBack,
29
- navigate,
30
- initialField,
31
- initialSection,
32
- scrollTo
33
- }) => {
34
- // Use useOxy() hook for OxyContext values
35
- const {
36
- oxyServices,
37
- isAuthenticated
38
- } = (0, _OxyContext.useOxy)();
39
- const {
40
- t
41
- } = (0, _useI18n.useI18n)();
42
-
43
- // Use TanStack Query for user data
44
- const {
45
- data: user,
46
- isLoading: userLoading
47
- } = (0, _useAccountQueries.useCurrentUser)({
48
- enabled: isAuthenticated
49
- });
50
- const uploadAvatarMutation = (0, _useAccountMutations.useUploadAvatar)();
51
-
52
- // Dialog controls
53
- const removeAvatarDialog = (0, _bloom.useDialogControl)();
54
-
55
- // Fall back to the auth store while the query is loading so the screen
56
- // can render immediately with cached profile data on subsequent visits.
57
- const userFromStore = (0, _authStore.useAuthStore)(state => state.user);
58
- const finalUser = user || userFromStore;
59
- const isUpdatingAvatar = uploadAvatarMutation.isPending;
60
- const [optimisticAvatarId, setOptimisticAvatarId] = (0, _react.useState)(null);
61
- const scrollViewRef = (0, _react.useRef)(null);
62
- const avatarSectionRef = (0, _react.useRef)(null);
63
-
64
- // Section refs for navigation
65
- const profilePictureSectionRef = (0, _react.useRef)(null);
66
- const basicInfoSectionRef = (0, _react.useRef)(null);
67
- const aboutSectionRef = (0, _react.useRef)(null);
68
- const quickActionsSectionRef = (0, _react.useRef)(null);
69
- const securitySectionRef = (0, _react.useRef)(null);
70
-
71
- // Section Y positions for scrolling
72
- const [profilePictureSectionY, setProfilePictureSectionY] = (0, _react.useState)(null);
73
- const [basicInfoSectionY, setBasicInfoSectionY] = (0, _react.useState)(null);
74
- const [aboutSectionY, setAboutSectionY] = (0, _react.useState)(null);
75
- const [quickActionsSectionY, setQuickActionsSectionY] = (0, _react.useState)(null);
76
- const [securitySectionY, setSecuritySectionY] = (0, _react.useState)(null);
77
-
78
- // Form state
79
- const [displayName, setDisplayName] = (0, _react.useState)('');
80
- const [lastName, setLastName] = (0, _react.useState)('');
81
- const [username, setUsername] = (0, _react.useState)('');
82
- const [email, setEmail] = (0, _react.useState)('');
83
- const [bio, setBio] = (0, _react.useState)('');
84
- const [location, setLocation] = (0, _react.useState)('');
85
- const [links, setLinks] = (0, _react.useState)([]);
86
- const [avatarFileId, setAvatarFileId] = (0, _react.useState)('');
87
-
88
- // Navigation helper for editing fields
89
- const navigateToEditField = (0, _react.useCallback)(fieldType => {
90
- navigate?.('EditProfileField', {
91
- fieldType
92
- });
93
- }, [navigate]);
94
-
95
- // Location and links state (for display only - modals handle editing)
96
- const [locations, setLocations] = (0, _react.useState)([]);
97
- const [linksMetadata, setLinksMetadata] = (0, _react.useState)([]);
98
-
99
- // Get theme colors
100
- const bloomTheme = (0, _theme.useTheme)();
101
- const colorScheme = (0, _useColorScheme.useColorScheme)();
102
-
103
- // Extract colors for convenience
104
- const colors = _theme2.Colors[(0, _themeUtils.normalizeColorScheme)(colorScheme, theme || 'light')];
105
-
106
- // Track initialization to prevent unnecessary resets
107
- const isInitializedRef = (0, _react.useRef)(false);
108
- const previousUserIdRef = (0, _react.useRef)(null);
109
- const previousAvatarRef = (0, _react.useRef)(null);
110
-
111
- // Load user data - only reset fields when user actually changes (not just avatar)
112
- (0, _react.useEffect)(() => {
113
- if (finalUser) {
114
- const currentUserId = finalUser.id;
115
- const currentAvatar = finalUser.avatar ?? '';
116
- const isNewUser = previousUserIdRef.current !== currentUserId;
117
- const isAvatarOnlyUpdate = !isNewUser && previousUserIdRef.current === currentUserId && previousAvatarRef.current !== currentAvatar && previousAvatarRef.current !== null;
118
- const shouldInitialize = !isInitializedRef.current || isNewUser;
119
-
120
- // Only reset all fields if it's a new user or first load
121
- // Skip reset if it's just an avatar update
122
- if (shouldInitialize && !isAvatarOnlyUpdate) {
123
- const userDisplayName = typeof finalUser.name === 'string' ? finalUser.name : finalUser.name?.first || finalUser.name?.full || '';
124
- const userLastName = typeof finalUser.name === 'object' ? finalUser.name?.last || '' : '';
125
- setDisplayName(userDisplayName);
126
- setLastName(userLastName);
127
- setUsername(finalUser.username || '');
128
- setEmail(finalUser.email || '');
129
- setBio(finalUser.bio || '');
130
- setLocation(finalUser.location || '');
131
-
132
- // Handle locations - convert single location to array format
133
- if (finalUser.locations && Array.isArray(finalUser.locations)) {
134
- setLocations(finalUser.locations.map((loc, index) => ({
135
- id: loc.id || `existing-${index}`,
136
- name: loc.name,
137
- label: loc.label,
138
- coordinates: loc.coordinates
139
- })));
140
- } else if (finalUser.location) {
141
- // Convert single location string to array format
142
- setLocations([{
143
- id: 'existing-0',
144
- name: finalUser.location,
145
- label: 'Location'
146
- }]);
147
- } else {
148
- setLocations([]);
149
- }
150
-
151
- // Handle links - simple and direct like other fields
152
- if (finalUser.linksMetadata && Array.isArray(finalUser.linksMetadata)) {
153
- const urls = finalUser.linksMetadata.map(l => l.url);
154
- setLinks(urls);
155
- const metadataWithIds = finalUser.linksMetadata.map((link, index) => ({
156
- ...link,
157
- id: link.id || `existing-${index}`
158
- }));
159
- setLinksMetadata(metadataWithIds);
160
- } else if (Array.isArray(finalUser.links)) {
161
- const simpleLinks = finalUser.links.map(l => typeof l === 'string' ? l : l.link).filter(Boolean);
162
- setLinks(simpleLinks);
163
- const linksWithMetadata = simpleLinks.map((url, index) => ({
164
- url,
165
- title: url.replace(/^https?:\/\//, '').replace(/\/$/, ''),
166
- description: `Link to ${url}`,
167
- image: undefined,
168
- id: `existing-${index}`
169
- }));
170
- setLinksMetadata(linksWithMetadata);
171
- } else if (finalUser.website) {
172
- setLinks([finalUser.website]);
173
- setLinksMetadata([{
174
- url: finalUser.website,
175
- title: finalUser.website.replace(/^https?:\/\//, '').replace(/\/$/, ''),
176
- description: `Link to ${finalUser.website}`,
177
- image: undefined,
178
- id: 'existing-0'
179
- }]);
180
- } else {
181
- setLinks([]);
182
- setLinksMetadata([]);
183
- }
184
- isInitializedRef.current = true;
185
- }
186
-
187
- // Update avatar only if it changed and we're not in optimistic/updating state
188
- // This allows the server response to update the avatar without resetting other fields
189
- // But don't override if we have a pending optimistic update
190
- if (currentAvatar !== avatarFileId && !isUpdatingAvatar && !optimisticAvatarId) {
191
- setAvatarFileId(currentAvatar);
192
- }
193
-
194
- // If we just finished updating and the server avatar matches our optimistic one, clear optimistic state
195
- // Also clear if the server avatar matches our current avatarFileId (update completed)
196
- if (isUpdatingAvatar === false && optimisticAvatarId) {
197
- if (currentAvatar === optimisticAvatarId || currentAvatar === avatarFileId) {
198
- setOptimisticAvatarId(null);
199
- }
200
- }
201
- previousUserIdRef.current = currentUserId;
202
- previousAvatarRef.current = currentAvatar;
203
- }
204
- }, [finalUser, avatarFileId, isUpdatingAvatar, optimisticAvatarId]);
205
-
206
- // Set initial editing field if provided via props (e.g., from navigation)
207
- // Handle initialSection prop to scroll to specific section
208
- const hasScrolledToSectionRef = (0, _react.useRef)(false);
209
- const previousInitialSectionRef = (0, _react.useRef)(undefined);
210
- const SCROLL_OFFSET = 100; // Offset to show section near top of viewport
211
-
212
- // Map section names to their Y positions
213
- const sectionYPositions = (0, _react.useMemo)(() => ({
214
- profilePicture: profilePictureSectionY,
215
- basicInfo: basicInfoSectionY,
216
- about: aboutSectionY,
217
- quickActions: quickActionsSectionY,
218
- security: securitySectionY
219
- }), [profilePictureSectionY, basicInfoSectionY, aboutSectionY, quickActionsSectionY, securitySectionY]);
220
- (0, _react.useEffect)(() => {
221
- // If initialSection changed, reset the flag
222
- if (previousInitialSectionRef.current !== initialSection) {
223
- hasScrolledToSectionRef.current = false;
224
- previousInitialSectionRef.current = initialSection;
225
- }
226
-
227
- // Scroll to the specified section if initialSection is provided and we haven't scrolled yet
228
- if (initialSection && !hasScrolledToSectionRef.current) {
229
- const sectionY = sectionYPositions[initialSection];
230
- if (sectionY !== null && sectionY !== undefined && scrollTo) {
231
- requestAnimationFrame(() => {
232
- requestAnimationFrame(() => {
233
- scrollTo(Math.max(0, sectionY - SCROLL_OFFSET), true);
234
- hasScrolledToSectionRef.current = true;
235
- });
236
- });
237
- }
238
- }
239
- }, [initialSection, sectionYPositions]);
240
- const handleAvatarRemoveConfirmed = (0, _react.useCallback)(() => {
241
- setAvatarFileId('');
242
- _bloom.toast.success(t('editProfile.toasts.avatarRemoved') || 'Avatar removed');
243
- }, [t]);
244
- const handleAvatarRemove = (0, _react.useCallback)(() => {
245
- removeAvatarDialog.open();
246
- }, [removeAvatarDialog]);
247
- const {
248
- openAvatarPicker
249
- } = (0, _OxyContext.useOxy)();
250
-
251
- // Handlers to navigate to edit screens
252
- const handleOpenDisplayNameModal = (0, _react.useCallback)(() => navigateToEditField('displayName'), [navigateToEditField]);
253
- const handleOpenUsernameModal = (0, _react.useCallback)(() => navigateToEditField('username'), [navigateToEditField]);
254
- const handleOpenEmailModal = (0, _react.useCallback)(() => navigateToEditField('email'), [navigateToEditField]);
255
- const handleOpenBioModal = (0, _react.useCallback)(() => navigateToEditField('bio'), [navigateToEditField]);
256
- const handleOpenLocationModal = (0, _react.useCallback)(() => navigateToEditField('locations'), [navigateToEditField]);
257
- const handleOpenLinksModal = (0, _react.useCallback)(() => navigateToEditField('links'), [navigateToEditField]);
258
-
259
- // Handle initialField prop - navigate to appropriate edit screen
260
- (0, _react.useEffect)(() => {
261
- if (initialField) {
262
- // Special handling for avatar - open avatar picker directly
263
- if (initialField === 'avatar') {
264
- setTimeout(() => {
265
- openAvatarPicker();
266
- }, 300);
267
- } else {
268
- // Navigate to edit screen
269
- setTimeout(() => {
270
- const fieldTypeMap = {
271
- displayName: 'displayName',
272
- username: 'username',
273
- email: 'email',
274
- bio: 'bio',
275
- location: 'locations',
276
- locations: 'locations',
277
- links: 'links'
278
- };
279
- const fieldType = fieldTypeMap[initialField];
280
- if (fieldType) {
281
- navigateToEditField(fieldType);
282
- }
283
- }, 300);
284
- }
285
- }
286
- }, [initialField, openAvatarPicker, navigateToEditField]);
287
-
288
- // Memoize display name for avatar
289
- const displayNameForAvatar = (0, _react.useMemo)(() => (0, _userUtils.getDisplayName)(finalUser), [finalUser]);
290
- if (userLoading || !isAuthenticated) {
291
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
292
- style: [styles.container, {
293
- justifyContent: 'center',
294
- backgroundColor: bloomTheme.colors.background
295
- }],
296
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
297
- size: "large",
298
- color: bloomTheme.colors.primary
299
- })
300
- });
301
- }
302
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
303
- style: [styles.container, {
304
- backgroundColor: bloomTheme.colors.background
305
- }],
306
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
307
- ref: scrollViewRef,
308
- style: styles.content,
309
- contentContainerStyle: styles.scrollContent,
310
- showsVerticalScrollIndicator: false,
311
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
312
- style: [styles.headerContainer, styles.headerSection],
313
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
314
- style: [styles.modernTitle, {
315
- marginBottom: 0,
316
- marginTop: 0
317
- }],
318
- className: "text-foreground",
319
- children: t('accountOverview.items.editProfile.title') || t('editProfile.title') || 'Edit Profile'
320
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
321
- style: [styles.modernSubtitle, {
322
- marginBottom: 0,
323
- marginTop: 0
324
- }],
325
- className: "text-muted-foreground",
326
- children: t('accountOverview.items.editProfile.subtitle') || t('editProfile.subtitle') || 'Manage your profile and preferences'
327
- })]
328
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
329
- ref: ref => {
330
- avatarSectionRef.current = ref;
331
- profilePictureSectionRef.current = ref;
332
- },
333
- style: styles.section,
334
- onLayout: event => {
335
- const {
336
- y
337
- } = event.nativeEvent.layout;
338
- setProfilePictureSectionY(y);
339
- },
340
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
341
- style: styles.sectionTitle,
342
- className: "text-muted-foreground",
343
- children: t('editProfile.sections.profilePicture') || 'PROFILE PICTURE'
344
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
345
- style: styles.groupedSectionWrapper,
346
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_settingsList.SettingsListGroup, {
347
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
348
- icon: optimisticAvatarId || avatarFileId ? isUpdatingAvatar ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
349
- style: {
350
- position: 'relative',
351
- width: 36,
352
- height: 36
353
- },
354
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.Image, {
355
- source: {
356
- uri: oxyServices.getFileDownloadUrl(optimisticAvatarId || avatarFileId, 'thumb')
357
- },
358
- style: {
359
- width: 36,
360
- height: 36,
361
- borderRadius: 18,
362
- opacity: 0.6
363
- }
364
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
365
- style: {
366
- position: 'absolute',
367
- top: 0,
368
- left: 0,
369
- right: 0,
370
- bottom: 0,
371
- justifyContent: 'center',
372
- alignItems: 'center',
373
- backgroundColor: bloomTheme.colors.overlay,
374
- borderRadius: 18
375
- },
376
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
377
- size: "small",
378
- color: colors.tint
379
- })
380
- })]
381
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
382
- source: {
383
- uri: oxyServices.getFileDownloadUrl(optimisticAvatarId || avatarFileId, 'thumb')
384
- },
385
- style: {
386
- width: 36,
387
- height: 36,
388
- borderRadius: 18
389
- }
390
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
391
- name: "account-outline",
392
- size: 20,
393
- color: colors.sidebarIconPersonalInfo
394
- }),
395
- title: "Profile Photo",
396
- description: isUpdatingAvatar ? 'Updating profile picture...' : avatarFileId ? 'Tap to change your profile picture' : 'Tap to add a profile picture',
397
- onPress: isUpdatingAvatar ? undefined : openAvatarPicker,
398
- disabled: isUpdatingAvatar
399
- }), avatarFileId && !isUpdatingAvatar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
400
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
401
- name: "delete-outline",
402
- size: 20,
403
- color: colors.sidebarIconSharing
404
- }),
405
- title: "Remove Photo",
406
- description: "Delete current profile picture",
407
- onPress: handleAvatarRemove
408
- }) : null]
409
- })
410
- })]
411
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
412
- ref: basicInfoSectionRef,
413
- style: styles.section,
414
- onLayout: event => {
415
- const {
416
- y
417
- } = event.nativeEvent.layout;
418
- setBasicInfoSectionY(y);
419
- },
420
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
421
- style: styles.sectionTitle,
422
- className: "text-muted-foreground",
423
- children: t('editProfile.sections.basicInfo') || 'BASIC INFORMATION'
424
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
425
- style: styles.groupedSectionWrapper,
426
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_settingsList.SettingsListGroup, {
427
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
428
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
429
- name: "account-outline",
430
- size: 20,
431
- color: colors.sidebarIconPersonalInfo
432
- }),
433
- title: t('editProfile.items.displayName.title') || 'Display Name',
434
- description: [displayName, lastName].filter(Boolean).join(' ') || t('editProfile.items.displayName.add') || 'Add your display name',
435
- onPress: handleOpenDisplayNameModal
436
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
437
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
438
- name: "at",
439
- size: 20,
440
- color: colors.sidebarIconData
441
- }),
442
- title: t('editProfile.items.username.title') || 'Username',
443
- description: username || t('editProfile.items.username.choose') || 'Choose a username',
444
- onPress: handleOpenUsernameModal
445
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
446
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
447
- name: "email-outline",
448
- size: 20,
449
- color: colors.sidebarIconSecurity
450
- }),
451
- title: t('editProfile.items.email.title') || 'Email',
452
- description: email || t('editProfile.items.email.add') || 'Add your email address',
453
- onPress: handleOpenEmailModal
454
- })]
455
- })
456
- })]
457
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
458
- ref: aboutSectionRef,
459
- style: styles.section,
460
- onLayout: event => {
461
- const {
462
- y
463
- } = event.nativeEvent.layout;
464
- setAboutSectionY(y);
465
- },
466
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
467
- style: styles.sectionTitle,
468
- className: "text-muted-foreground",
469
- children: t('editProfile.sections.about') || 'ABOUT YOU'
470
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
471
- style: styles.groupedSectionWrapper,
472
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_settingsList.SettingsListGroup, {
473
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
474
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
475
- name: "text-box-outline",
476
- size: 20,
477
- color: colors.sidebarIconPersonalInfo
478
- }),
479
- title: t('editProfile.items.bio.title') || 'Bio',
480
- description: bio || t('editProfile.items.bio.placeholder') || 'Tell people about yourself',
481
- onPress: handleOpenBioModal
482
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
483
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
484
- name: "map-marker-outline",
485
- size: 20,
486
- color: colors.sidebarIconSharing
487
- }),
488
- title: t('editProfile.items.locations.title') || 'Locations',
489
- description: locations.length > 0 ? locations.length === 1 ? t('editProfile.items.locations.count', {
490
- count: locations.length
491
- }) || `${locations.length} location added` : t('editProfile.items.locations.count_plural', {
492
- count: locations.length
493
- }) || `${locations.length} locations added` : t('editProfile.items.locations.add') || 'Add your locations',
494
- onPress: handleOpenLocationModal
495
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
496
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
497
- name: "link-variant",
498
- size: 20,
499
- color: colors.sidebarIconSharing
500
- }),
501
- title: t('editProfile.items.links.title') || 'Links',
502
- description: linksMetadata.length > 0 ? linksMetadata.length === 1 ? t('editProfile.items.links.count', {
503
- count: linksMetadata.length
504
- }) || `${linksMetadata.length} link added` : t('editProfile.items.links.count_plural', {
505
- count: linksMetadata.length
506
- }) || `${linksMetadata.length} links added` : t('editProfile.items.links.add') || 'Add your links',
507
- onPress: handleOpenLinksModal
508
- })]
509
- })
510
- })]
511
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
512
- ref: quickActionsSectionRef,
513
- style: styles.section,
514
- onLayout: event => {
515
- const {
516
- y
517
- } = event.nativeEvent.layout;
518
- setQuickActionsSectionY(y);
519
- },
520
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
521
- style: styles.sectionTitle,
522
- className: "text-muted-foreground",
523
- children: t('editProfile.sections.quickActions') || 'QUICK ACTIONS'
524
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
525
- style: styles.groupedSectionWrapper,
526
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_settingsList.SettingsListGroup, {
527
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
528
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
529
- name: "eye",
530
- size: 20,
531
- color: colors.sidebarIconHome
532
- }),
533
- title: t('editProfile.items.previewProfile.title') || 'Preview Profile',
534
- description: t('editProfile.items.previewProfile.subtitle') || 'See how your profile looks to others',
535
- onPress: () => navigate?.('Profile', {
536
- userId: finalUser?.id
537
- })
538
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
539
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
540
- name: "shield-check",
541
- size: 20,
542
- color: colors.sidebarIconSecurity
543
- }),
544
- title: t('editProfile.items.privacySettings.title') || 'Privacy Settings',
545
- description: t('editProfile.items.privacySettings.subtitle') || 'Control who can see your profile',
546
- onPress: () => navigate?.('PrivacySettings')
547
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_settingsList.SettingsListItem, {
548
- icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
549
- name: "check-circle",
550
- size: 20,
551
- color: colors.sidebarIconPersonalInfo
552
- }),
553
- title: t('editProfile.items.verifyAccount.title') || 'Verify Account',
554
- description: t('editProfile.items.verifyAccount.subtitle') || 'Get a verified badge',
555
- onPress: () => navigate?.('AccountVerification')
556
- })]
557
- })
558
- })]
559
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
560
- ref: securitySectionRef,
561
- style: styles.section,
562
- onLayout: event => {
563
- const {
564
- y
565
- } = event.nativeEvent.layout;
566
- setSecuritySectionY(y);
567
- },
568
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
569
- style: styles.sectionTitle,
570
- className: "text-muted-foreground",
571
- children: t('editProfile.sections.security') || 'SECURITY'
572
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
573
- style: styles.groupedSectionWrapper
574
- })]
575
- })]
576
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bloom.Dialog, {
577
- control: removeAvatarDialog,
578
- title: t('editProfile.confirms.removeAvatarTitle') || 'Remove Avatar',
579
- description: t('editProfile.confirms.removeAvatar') || 'Remove your profile picture?',
580
- actions: [{
581
- label: t('common.remove') || 'Remove',
582
- color: 'destructive',
583
- onPress: handleAvatarRemoveConfirmed
584
- }, {
585
- label: t('common.cancel') || 'Cancel',
586
- color: 'cancel'
587
- }]
588
- })]
589
- });
590
- };
591
- const styles = _reactNative.StyleSheet.create({
592
- container: {
593
- flexShrink: 1,
594
- width: '100%'
595
- },
596
- content: {
597
- flexShrink: 1
598
- },
599
- scrollContent: (0, _spacing.createScreenContentStyle)(_spacing.HEADER_PADDING_TOP_SETTINGS),
600
- headerContainer: {
601
- width: '100%',
602
- maxWidth: 420,
603
- alignSelf: 'center',
604
- marginBottom: _spacing.SECTION_GAP_LARGE
605
- },
606
- headerSection: {
607
- alignItems: 'flex-start',
608
- width: '100%',
609
- gap: _spacing.COMPONENT_GAP
610
- },
611
- modernTitle: {
612
- fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
613
- fontSize: 42,
614
- lineHeight: 50.4,
615
- // 42 * 1.2
616
- textAlign: 'left',
617
- letterSpacing: -0.5
618
- },
619
- modernSubtitle: {
620
- fontSize: 18,
621
- lineHeight: 24,
622
- textAlign: 'left',
623
- maxWidth: 320,
624
- alignSelf: 'flex-start',
625
- opacity: 0.8
626
- },
627
- section: {
628
- marginBottom: _spacing.SECTION_GAP_LARGE
629
- },
630
- sectionTitle: {
631
- fontSize: 13,
632
- fontWeight: '600',
633
- marginBottom: 8,
634
- marginTop: 4,
635
- textTransform: 'uppercase',
636
- letterSpacing: 0.5
637
- },
638
- groupedSectionWrapper: {
639
- backgroundColor: 'transparent'
640
- }
641
- });
642
- var _default = exports.default = /*#__PURE__*/_react.default.memo(AccountSettingsScreen);
643
- //# sourceMappingURL=AccountSettingsScreen.js.map