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