@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,719 +0,0 @@
1
- "use strict";
2
-
3
- import React, { useState, useMemo, useCallback, useRef, useEffect } from 'react';
4
- import { View, Text, TouchableOpacity, StyleSheet, ActivityIndicator, ScrollView, Platform, Image } from 'react-native';
5
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
- import Avatar from "../components/Avatar.js";
7
- import { Dialog, toast, useDialogControl } from '@oxyhq/bloom';
8
- import { SettingsIcon } from "../components/SettingsIcon.js";
9
- import { useI18n } from "../hooks/useI18n.js";
10
- import { useTheme } from '@oxyhq/bloom/theme';
11
- import { getDisplayName, getShortDisplayName } from "../utils/userUtils.js";
12
- import { getAccountDisplayName, getAccountFallbackHandle } from '@oxyhq/core';
13
- import { useColorScheme } from "../hooks/useColorScheme.js";
14
- import { Colors } from "../constants/theme.js";
15
- import { normalizeColorScheme, normalizeTheme } from "../utils/themeUtils.js";
16
- import { useOxy } from "../context/OxyContext.js";
17
- import { useUsersBySessions } from "../hooks/queries/useAccountQueries.js";
18
- import { SECTION_GAP, HEADER_PADDING_TOP_OVERVIEW, createScreenContentStyle } from "../constants/spacing.js";
19
- import { DeleteAccountModal } from "../components/modals/index.js";
20
- import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
21
-
22
- // Optional Lottie import - gracefully handle if not available
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- let LottieView = null;
25
- try {
26
- // eslint-disable-next-line @typescript-eslint/no-require-imports
27
- LottieView = require('lottie-react-native').default;
28
- } catch {
29
- // Lottie not available, will use fallback
30
- }
31
-
32
- // Import Lottie animation - will be undefined if file doesn't exist
33
- let lottieAnimation = undefined;
34
- try {
35
- // eslint-disable-next-line @typescript-eslint/no-require-imports
36
- lottieAnimation = require('../assets/lottie/welcomeheader_background_op1.json');
37
- } catch {
38
- // Animation file not available
39
- }
40
-
41
- /**
42
- * AccountOverviewScreen - Optimized for performance
43
- *
44
- * Performance optimizations implemented:
45
- * - useMemo for theme calculations (only recalculates when theme changes)
46
- * - useMemo for additional accounts filtering (only recalculates when dependencies change)
47
- * - useCallback for event handlers to prevent unnecessary re-renders
48
- * - React.memo wrapper to prevent re-renders when props haven't changed
49
- * - SettingsListGroup/SettingsListItem from bloom for consistent grouped list rendering
50
- */
51
- const AccountOverviewScreen = ({
52
- onClose,
53
- theme,
54
- navigate
55
- }) => {
56
- // Use useOxy() hook for OxyContext values
57
- const {
58
- user,
59
- logout,
60
- isLoading,
61
- sessions,
62
- activeSessionId,
63
- oxyServices,
64
- isAuthenticated,
65
- openAvatarPicker
66
- } = useOxy();
67
- const {
68
- t,
69
- locale
70
- } = useI18n();
71
- const [showMoreAccounts, setShowMoreAccounts] = useState(false);
72
- const [additionalAccountsData, setAdditionalAccountsData] = useState([]);
73
- const [loadingAdditionalAccounts, setLoadingAdditionalAccounts] = useState(false);
74
- const deleteAccountControl = useDialogControl();
75
- const logoutDialog = useDialogControl();
76
- const signOutAllDialog = useDialogControl();
77
- const downloadDataDialog = useDialogControl();
78
- const lottieRef = useRef(null);
79
- const hasPlayedRef = useRef(false);
80
- const insets = useSafeAreaInsets();
81
-
82
- // Use bloom theme for ActivityIndicator and other non-style color props
83
- const bloomTheme = useTheme();
84
- const colorScheme = useColorScheme();
85
- const normalizedTheme = normalizeTheme(theme);
86
- // AccountOverviewScreen uses a custom primary color (purple) instead of the default blue
87
- const themeColors = {
88
- primaryColor: '#d169e5'
89
- };
90
- // Icon colors from the Colors constant
91
- const baseThemeColors = Colors[normalizeColorScheme(colorScheme, normalizedTheme)];
92
-
93
- // Compute user data for display
94
- const displayName = useMemo(() => getDisplayName(user), [user]);
95
- const shortDisplayName = useMemo(() => getShortDisplayName(user), [user]);
96
- const avatarUrl = useMemo(() => {
97
- if (user?.avatar && oxyServices) {
98
- return oxyServices.getFileDownloadUrl(user.avatar, 'thumb');
99
- }
100
- return undefined;
101
- }, [user?.avatar, oxyServices]);
102
-
103
- // Handle avatar press - use openAvatarPicker from context
104
- const handleAvatarPress = useCallback(() => {
105
- openAvatarPicker();
106
- }, [openAvatarPicker]);
107
-
108
- // Play Lottie animation once when component mounts
109
- useEffect(() => {
110
- if (hasPlayedRef.current || !LottieView || !lottieRef.current || !lottieAnimation) return;
111
- const timer = setTimeout(() => {
112
- if (lottieRef.current && !hasPlayedRef.current) {
113
- lottieRef.current.play();
114
- hasPlayedRef.current = true;
115
- }
116
- }, 100);
117
- return () => clearTimeout(timer);
118
- }, []);
119
-
120
- // Memoize additional accounts filtering to prevent recalculation on every render
121
- const additionalAccounts = useMemo(() => (sessions || []).filter(session => session.sessionId !== activeSessionId && session.userId !== user?.id), [sessions, activeSessionId, user?.id]);
122
-
123
- // Load user profiles for additional accounts using TanStack Query
124
- const sessionIds = additionalAccounts.map(s => s.sessionId);
125
- const {
126
- data: usersData,
127
- isLoading: isLoadingUsers
128
- } = useUsersBySessions(sessionIds, {
129
- enabled: additionalAccounts.length > 0
130
- });
131
- React.useEffect(() => {
132
- if (usersData && usersData.length > 0) {
133
- const accountsData = usersData.map(({
134
- sessionId,
135
- user: userProfile
136
- }) => ({
137
- id: sessionId,
138
- sessionId,
139
- userProfile: userProfile ?? null,
140
- avatar: userProfile?.avatar ?? null,
141
- email: userProfile?.email
142
- }));
143
- setAdditionalAccountsData(accountsData);
144
- setLoadingAdditionalAccounts(false);
145
- } else if (additionalAccounts.length === 0) {
146
- setAdditionalAccountsData([]);
147
- setLoadingAdditionalAccounts(false);
148
- } else if (!isLoadingUsers) {
149
- setLoadingAdditionalAccounts(false);
150
- }
151
- }, [usersData, additionalAccounts.length, isLoadingUsers]);
152
-
153
- // Feature settings (with mock values)
154
- const features = {
155
- safeSearch: false,
156
- language: 'English'
157
- };
158
-
159
- // Memoize event handlers to prevent recreation on every render
160
- const handleLogout = useCallback(async () => {
161
- try {
162
- await logout();
163
- if (onClose) {
164
- onClose();
165
- }
166
- } catch (error) {
167
- if (__DEV__) {
168
- console.error('Logout failed:', error);
169
- }
170
- toast.error(t('common.errors.signOutFailed'));
171
- }
172
- }, [logout, onClose]);
173
- const handleAddAccount = useCallback(() => {
174
- toast.info(t('accountOverview.addAccountComing'));
175
- }, [t]);
176
- const performDownload = useCallback(async format => {
177
- if (!oxyServices || !user) {
178
- toast.error(t('accountOverview.items.downloadData.error') || 'Service not available');
179
- return;
180
- }
181
- try {
182
- toast.info(t('accountOverview.items.downloadData.downloading') || 'Preparing download...');
183
- const blob = await oxyServices.downloadAccountData(format);
184
- if (Platform.OS === 'web') {
185
- const url = URL.createObjectURL(blob);
186
- const link = document.createElement('a');
187
- link.href = url;
188
- link.download = `account-data-${Date.now()}.${format}`;
189
- document.body.appendChild(link);
190
- link.click();
191
- document.body.removeChild(link);
192
- URL.revokeObjectURL(url);
193
- }
194
- toast.success(t('accountOverview.items.downloadData.success') || 'Data downloaded successfully');
195
- } catch (error) {
196
- if (__DEV__) {
197
- console.error('Failed to download data:', error);
198
- }
199
- toast.error((error instanceof Error ? error.message : null) || t('accountOverview.items.downloadData.error') || 'Failed to download data');
200
- }
201
- }, [oxyServices, user, t]);
202
- const handleDownloadData = useCallback(() => {
203
- if (!oxyServices || !user) {
204
- toast.error(t('accountOverview.items.downloadData.error') || 'Service not available');
205
- return;
206
- }
207
- downloadDataDialog.open();
208
- }, [oxyServices, user, t, downloadDataDialog]);
209
- const handleDeleteAccount = useCallback(() => {
210
- if (!user) {
211
- toast.error(t('accountOverview.items.deleteAccount.error') || 'User not available');
212
- return;
213
- }
214
- deleteAccountControl.open();
215
- }, [user, t, deleteAccountControl]);
216
- const handleConfirmDelete = useCallback(async confirmText => {
217
- if (!oxyServices || !user) {
218
- throw new Error(t('accountOverview.items.deleteAccount.error') || 'Service not available');
219
- }
220
- await oxyServices.deleteAccount(confirmText);
221
- toast.success(t('accountOverview.items.deleteAccount.success') || 'Account deleted successfully');
222
- deleteAccountControl.close();
223
- await logout();
224
- if (onClose) {
225
- onClose();
226
- }
227
- }, [oxyServices, user, logout, onClose, t]);
228
- if (!isAuthenticated) {
229
- return /*#__PURE__*/_jsx(View, {
230
- style: [styles.container, {
231
- backgroundColor: bloomTheme.colors.background
232
- }],
233
- children: /*#__PURE__*/_jsx(Text, {
234
- style: styles.message,
235
- className: "text-foreground",
236
- children: t('common.status.notSignedIn')
237
- })
238
- });
239
- }
240
- if (isLoading) {
241
- return /*#__PURE__*/_jsx(View, {
242
- style: [styles.container, {
243
- justifyContent: 'center',
244
- backgroundColor: bloomTheme.colors.background
245
- }],
246
- children: /*#__PURE__*/_jsx(ActivityIndicator, {
247
- size: "large",
248
- color: themeColors.primaryColor
249
- })
250
- });
251
- }
252
- return /*#__PURE__*/_jsxs(View, {
253
- style: [styles.container, {
254
- backgroundColor: bloomTheme.colors.background
255
- }],
256
- children: [/*#__PURE__*/_jsxs(ScrollView, {
257
- style: styles.content,
258
- contentContainerStyle: styles.scrollContent,
259
- showsVerticalScrollIndicator: false,
260
- children: [user && /*#__PURE__*/_jsx(View, {
261
- style: styles.headerSection,
262
- children: /*#__PURE__*/_jsxs(View, {
263
- style: styles.avatarSectionWrapper,
264
- children: [/*#__PURE__*/_jsxs(View, {
265
- style: styles.avatarContainer,
266
- children: [LottieView && lottieAnimation && /*#__PURE__*/_jsx(LottieView, {
267
- ref: lottieRef,
268
- source: lottieAnimation,
269
- style: styles.lottieBackground,
270
- loop: false,
271
- autoPlay: false
272
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
273
- style: styles.avatarWrapper,
274
- onPress: handleAvatarPress,
275
- activeOpacity: 0.8,
276
- children: /*#__PURE__*/_jsx(Avatar, {
277
- uri: avatarUrl,
278
- name: displayName,
279
- size: 100,
280
- theme: normalizedTheme
281
- })
282
- })]
283
- }), /*#__PURE__*/_jsxs(View, {
284
- style: styles.nameWrapper,
285
- children: [/*#__PURE__*/_jsx(Text, {
286
- style: styles.welcomeText,
287
- className: "text-foreground",
288
- children: displayName
289
- }), /*#__PURE__*/_jsx(Text, {
290
- style: styles.welcomeSubtext,
291
- className: "text-muted-foreground",
292
- children: "Manage your Oxy account."
293
- })]
294
- })]
295
- })
296
- }), /*#__PURE__*/_jsx(SettingsListGroup, {
297
- title: t('accountOverview.sections.profile'),
298
- children: /*#__PURE__*/_jsx(SettingsListItem, {
299
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
300
- name: "account",
301
- color: baseThemeColors.iconSecurity
302
- }),
303
- title: displayName,
304
- description: (() => {
305
- if (!user) return t('common.status.loading') || 'Loading...';
306
- if (user.email) return user.email;
307
- const handle = getAccountFallbackHandle(user);
308
- if (!handle) return '';
309
- return user.username ? `@${handle}` : handle;
310
- })(),
311
- onPress: () => navigate?.('AccountSettings', {
312
- activeTab: 'profile'
313
- })
314
- })
315
- }), /*#__PURE__*/_jsxs(SettingsListGroup, {
316
- title: t('accountOverview.sections.accountSettings'),
317
- children: [/*#__PURE__*/_jsx(SettingsListItem, {
318
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
319
- name: "account-circle",
320
- color: baseThemeColors.iconPersonalInfo
321
- }),
322
- title: t('accountOverview.items.editProfile.title'),
323
- description: t('accountOverview.items.editProfile.subtitle'),
324
- onPress: () => navigate?.('AccountSettings', {
325
- activeTab: 'profile'
326
- })
327
- }), /*#__PURE__*/_jsx(SettingsListItem, {
328
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
329
- name: "shield-check",
330
- color: baseThemeColors.iconSecurity
331
- }),
332
- title: t('accountOverview.items.security.title'),
333
- description: t('accountOverview.items.security.subtitle'),
334
- onPress: () => navigate?.('AccountSettings', {
335
- activeTab: 'password'
336
- })
337
- }), /*#__PURE__*/_jsx(SettingsListItem, {
338
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
339
- name: "bell",
340
- color: baseThemeColors.iconStorage
341
- }),
342
- title: t('accountOverview.items.notifications.title'),
343
- description: t('accountOverview.items.notifications.subtitle'),
344
- onPress: () => navigate?.('AccountSettings', {
345
- activeTab: 'notifications'
346
- })
347
- }), /*#__PURE__*/_jsx(SettingsListItem, {
348
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
349
- name: "star",
350
- color: baseThemeColors.iconPayments
351
- }),
352
- title: t('accountOverview.items.premium.title'),
353
- description: user?.isPremium ? t('accountOverview.items.premium.manage') : t('accountOverview.items.premium.upgrade'),
354
- onPress: () => navigate?.('PremiumSubscription')
355
- }), user?.isPremium ? /*#__PURE__*/_jsx(SettingsListItem, {
356
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
357
- name: "credit-card",
358
- color: baseThemeColors.iconPersonalInfo
359
- }),
360
- title: t('accountOverview.items.billing.title'),
361
- description: t('accountOverview.items.billing.subtitle'),
362
- onPress: () => toast.info(t('accountOverview.items.billing.coming'))
363
- }) : null]
364
- }), showMoreAccounts && /*#__PURE__*/_jsx(SettingsListGroup, {
365
- title: `${t('accountOverview.sections.additionalAccounts') || 'Additional Accounts'}${additionalAccountsData.length > 0 ? ` (${additionalAccountsData.length})` : ''}`,
366
- children: loadingAdditionalAccounts ? /*#__PURE__*/_jsx(SettingsListItem, {
367
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
368
- name: "sync",
369
- color: baseThemeColors.iconSecurity
370
- }),
371
- title: t('accountOverview.loadingAdditional.title') || 'Loading accounts...',
372
- description: t('accountOverview.loadingAdditional.subtitle') || 'Please wait while we load your additional accounts',
373
- rightElement: /*#__PURE__*/_jsx(View, {
374
- style: styles.loadingContainer,
375
- children: /*#__PURE__*/_jsx(ActivityIndicator, {
376
- size: "small",
377
- color: baseThemeColors.iconSecurity
378
- })
379
- }),
380
- showChevron: false
381
- }) : additionalAccountsData.length > 0 ? additionalAccountsData.map(account => {
382
- const accountDisplayName = getAccountDisplayName(account.userProfile, locale);
383
- const accountHandle = getAccountFallbackHandle(account.userProfile);
384
- const description = account.email ?? (accountHandle && account.userProfile?.username ? `@${accountHandle}` : accountHandle) ?? '';
385
- return /*#__PURE__*/_jsx(SettingsListItem, {
386
- icon: /*#__PURE__*/_jsx(View, {
387
- style: styles.userIcon,
388
- children: account.avatar ? /*#__PURE__*/_jsx(Image, {
389
- source: {
390
- uri: oxyServices.getFileDownloadUrl(account.avatar, 'thumb')
391
- },
392
- style: styles.accountAvatarImage
393
- }) : /*#__PURE__*/_jsx(View, {
394
- style: styles.accountAvatarFallback,
395
- children: /*#__PURE__*/_jsx(Text, {
396
- style: styles.accountAvatarText,
397
- children: accountDisplayName.charAt(0).toUpperCase()
398
- })
399
- })
400
- }),
401
- title: accountDisplayName,
402
- description: description,
403
- onPress: () => {
404
- toast.info(t('accountOverview.items.accountSwitcher.switchPrompt', {
405
- username: accountDisplayName
406
- }) || `Switch to ${accountDisplayName}?`);
407
- }
408
- }, `account-${account.id}`);
409
- }) : /*#__PURE__*/_jsx(SettingsListItem, {
410
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
411
- name: "account-outline",
412
- color: bloomTheme.colors.textTertiary
413
- }),
414
- title: t('accountOverview.additional.noAccounts.title') || 'No other accounts',
415
- description: t('accountOverview.additional.noAccounts.subtitle') || 'Add another account to switch between them',
416
- showChevron: false
417
- })
418
- }), showMoreAccounts && /*#__PURE__*/_jsxs(SettingsListGroup, {
419
- title: t('accountOverview.sections.accountManagement') || 'Account Management',
420
- children: [/*#__PURE__*/_jsx(SettingsListItem, {
421
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
422
- name: "plus",
423
- color: baseThemeColors.iconSecurity
424
- }),
425
- title: t('accountOverview.items.addAccount.title') || 'Add Another Account',
426
- description: t('accountOverview.items.addAccount.subtitle') || 'Sign in with a different account',
427
- onPress: handleAddAccount
428
- }), /*#__PURE__*/_jsx(SettingsListItem, {
429
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
430
- name: "logout",
431
- color: baseThemeColors.iconSharing
432
- }),
433
- title: t('accountOverview.items.signOutAll.title') || 'Sign out of all accounts',
434
- description: t('accountOverview.items.signOutAll.subtitle') || 'Remove all accounts from this device',
435
- onPress: () => signOutAllDialog.open()
436
- })]
437
- }), /*#__PURE__*/_jsxs(SettingsListGroup, {
438
- title: t('accountOverview.sections.quickActions'),
439
- children: [/*#__PURE__*/_jsx(SettingsListItem, {
440
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
441
- name: "account-group",
442
- color: baseThemeColors.iconData
443
- }),
444
- title: showMoreAccounts ? t('accountOverview.items.accountSwitcher.titleHide') : t('accountOverview.items.accountSwitcher.titleShow'),
445
- description: showMoreAccounts ? t('accountOverview.items.accountSwitcher.subtitleHide') : additionalAccountsData.length > 0 ? t('accountOverview.items.accountSwitcher.subtitleSwitchBetween', {
446
- count: String(additionalAccountsData.length + 1)
447
- }) : loadingAdditionalAccounts ? t('accountOverview.items.accountSwitcher.subtitleLoading') : t('accountOverview.items.accountSwitcher.subtitleManageMultiple'),
448
- onPress: () => setShowMoreAccounts(!showMoreAccounts)
449
- }), /*#__PURE__*/_jsx(SettingsListItem, {
450
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
451
- name: "clock",
452
- color: baseThemeColors.iconSecurity
453
- }),
454
- title: t('accountOverview.items.history.title') || 'History',
455
- description: t('accountOverview.items.history.subtitle') || 'View and manage your search history',
456
- onPress: () => navigate?.('HistoryView')
457
- }), /*#__PURE__*/_jsx(SettingsListItem, {
458
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
459
- name: "bookmark",
460
- color: baseThemeColors.iconStorage
461
- }),
462
- title: t('accountOverview.items.saves.title') || 'Saves & Collections',
463
- description: t('accountOverview.items.saves.subtitle') || 'View your saved items and collections',
464
- onPress: () => navigate?.('SavesCollections')
465
- }), /*#__PURE__*/_jsx(SettingsListItem, {
466
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
467
- name: "download",
468
- color: baseThemeColors.iconPersonalInfo
469
- }),
470
- title: t('accountOverview.items.downloadData.title'),
471
- description: t('accountOverview.items.downloadData.subtitle'),
472
- onPress: handleDownloadData
473
- }), /*#__PURE__*/_jsx(SettingsListItem, {
474
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
475
- name: "delete",
476
- color: baseThemeColors.iconSharing
477
- }),
478
- title: t('accountOverview.items.deleteAccount.title'),
479
- description: t('accountOverview.items.deleteAccount.subtitle'),
480
- onPress: handleDeleteAccount
481
- })]
482
- }), /*#__PURE__*/_jsxs(SettingsListGroup, {
483
- title: t('accountOverview.sections.support'),
484
- children: [/*#__PURE__*/_jsx(SettingsListItem, {
485
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
486
- name: "magnify",
487
- color: baseThemeColors.iconSecurity
488
- }),
489
- title: t('accountOverview.items.searchSettings.title') || 'Search Settings',
490
- description: t('accountOverview.items.searchSettings.subtitle') || 'SafeSearch and personalization',
491
- onPress: () => navigate?.('SearchSettings')
492
- }), /*#__PURE__*/_jsx(SettingsListItem, {
493
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
494
- name: "translate",
495
- color: baseThemeColors.iconPersonalInfo
496
- }),
497
- title: t('accountOverview.items.language.title') || 'Language',
498
- description: t('accountOverview.items.language.subtitle') || 'Choose your preferred language',
499
- onPress: () => navigate?.('LanguageSelector')
500
- }), /*#__PURE__*/_jsx(SettingsListItem, {
501
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
502
- name: "cog",
503
- color: bloomTheme.colors.textTertiary
504
- }),
505
- title: t('accountOverview.items.preferences.title'),
506
- description: t('accountOverview.items.preferences.subtitle'),
507
- onPress: () => toast.info(t('accountOverview.items.preferences.coming'))
508
- }), /*#__PURE__*/_jsx(SettingsListItem, {
509
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
510
- name: "help-circle",
511
- color: baseThemeColors.iconSecurity
512
- }),
513
- title: t('accountOverview.items.help.title'),
514
- description: t('accountOverview.items.help.subtitle'),
515
- onPress: () => navigate?.('HelpSupport')
516
- }), /*#__PURE__*/_jsx(SettingsListItem, {
517
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
518
- name: "shield-check",
519
- color: baseThemeColors.iconPersonalInfo
520
- }),
521
- title: t('accountOverview.items.privacyPolicy.title') || 'Privacy Policy',
522
- description: t('accountOverview.items.privacyPolicy.subtitle') || 'How we handle your data',
523
- onPress: () => navigate?.('LegalDocuments', {
524
- initialStep: 1
525
- })
526
- }), /*#__PURE__*/_jsx(SettingsListItem, {
527
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
528
- name: "file-document",
529
- color: baseThemeColors.iconSecurity
530
- }),
531
- title: t('accountOverview.items.termsOfService.title') || 'Terms of Service',
532
- description: t('accountOverview.items.termsOfService.subtitle') || 'Terms and conditions of use',
533
- onPress: () => navigate?.('LegalDocuments', {
534
- initialStep: 2
535
- })
536
- }), /*#__PURE__*/_jsx(SettingsListItem, {
537
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
538
- name: "link",
539
- color: baseThemeColors.iconPersonalInfo
540
- }),
541
- title: t('accountOverview.items.connectedApps.title'),
542
- description: t('accountOverview.items.connectedApps.subtitle'),
543
- onPress: () => toast.info(t('accountOverview.items.connectedApps.coming'))
544
- }), /*#__PURE__*/_jsx(SettingsListItem, {
545
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
546
- name: "information",
547
- color: bloomTheme.colors.textTertiary
548
- }),
549
- title: t('accountOverview.items.about.title'),
550
- description: t('accountOverview.items.about.subtitle'),
551
- onPress: () => navigate?.('AppInfo')
552
- })]
553
- }), /*#__PURE__*/_jsx(SettingsListGroup, {
554
- title: t('accountOverview.sections.actions'),
555
- children: /*#__PURE__*/_jsx(SettingsListItem, {
556
- icon: /*#__PURE__*/_jsx(SettingsIcon, {
557
- name: "logout",
558
- color: bloomTheme.colors.error
559
- }),
560
- title: t('accountOverview.items.signOut.title'),
561
- description: t('accountOverview.items.signOut.subtitle'),
562
- onPress: () => logoutDialog.open(),
563
- destructive: true,
564
- showChevron: false
565
- })
566
- })]
567
- }), user && /*#__PURE__*/_jsx(DeleteAccountModal, {
568
- control: deleteAccountControl,
569
- username: user.username || '',
570
- onDelete: handleConfirmDelete,
571
- t: t
572
- }), /*#__PURE__*/_jsx(Dialog, {
573
- control: logoutDialog,
574
- title: t('accountOverview.items.signOut.title') || 'Sign Out',
575
- description: t('common.confirms.signOut') || 'Are you sure you want to sign out?',
576
- actions: [{
577
- label: t('accountOverview.items.signOut.title') || 'Sign Out',
578
- color: 'destructive',
579
- onPress: handleLogout
580
- }, {
581
- label: t('common.cancel') || 'Cancel',
582
- color: 'cancel'
583
- }]
584
- }), /*#__PURE__*/_jsx(Dialog, {
585
- control: signOutAllDialog,
586
- title: t('accountOverview.items.signOutAll.title') || 'Sign Out All',
587
- description: t('common.confirms.signOutAll') || 'Are you sure you want to sign out of all accounts?',
588
- actions: [{
589
- label: t('accountOverview.items.signOutAll.title') || 'Sign Out All',
590
- color: 'destructive',
591
- onPress: handleLogout
592
- }, {
593
- label: t('common.cancel') || 'Cancel',
594
- color: 'cancel'
595
- }]
596
- }), /*#__PURE__*/_jsx(Dialog, {
597
- control: downloadDataDialog,
598
- title: t('accountOverview.items.downloadData.confirmTitle') || 'Download Account Data',
599
- description: t('accountOverview.items.downloadData.confirmMessage') || 'Choose the format for your account data export:',
600
- actions: [{
601
- label: 'JSON',
602
- onPress: () => performDownload('json')
603
- }, {
604
- label: 'CSV',
605
- onPress: () => performDownload('csv')
606
- }, {
607
- label: t('common.cancel') || 'Cancel',
608
- color: 'cancel'
609
- }]
610
- })]
611
- });
612
- };
613
- const styles = StyleSheet.create({
614
- container: {
615
- flex: 1
616
- },
617
- content: {
618
- flex: 1
619
- },
620
- scrollContent: createScreenContentStyle(HEADER_PADDING_TOP_OVERVIEW),
621
- headerSection: {
622
- alignItems: 'center',
623
- marginBottom: SECTION_GAP,
624
- paddingTop: HEADER_PADDING_TOP_OVERVIEW
625
- },
626
- avatarSectionWrapper: {
627
- alignItems: 'center',
628
- justifyContent: 'center',
629
- width: '100%'
630
- },
631
- avatarContainer: {
632
- position: 'relative',
633
- alignItems: 'center',
634
- justifyContent: 'center',
635
- width: '100%',
636
- maxWidth: 600,
637
- minHeight: 100,
638
- overflow: 'hidden',
639
- alignSelf: 'center',
640
- aspectRatio: 6
641
- },
642
- lottieBackground: {
643
- position: 'absolute',
644
- width: '100%',
645
- maxWidth: 600,
646
- minHeight: 100,
647
- top: 0,
648
- left: 0,
649
- right: 0,
650
- bottom: 0,
651
- zIndex: 0,
652
- aspectRatio: 6
653
- },
654
- avatarWrapper: {
655
- zIndex: 1,
656
- position: 'absolute',
657
- alignItems: 'center',
658
- justifyContent: 'center',
659
- width: 100,
660
- height: 100,
661
- left: '50%',
662
- marginLeft: -50,
663
- top: 0
664
- },
665
- nameWrapper: {
666
- marginTop: 12,
667
- alignItems: 'center',
668
- justifyContent: 'center'
669
- },
670
- welcomeText: {
671
- fontSize: 28,
672
- fontWeight: '600',
673
- marginBottom: 8,
674
- maxWidth: '90%'
675
- },
676
- welcomeSubtext: {
677
- fontSize: 16,
678
- fontWeight: '400',
679
- opacity: 0.6
680
- },
681
- userIcon: {
682
- marginRight: 12
683
- },
684
- accountAvatarImage: {
685
- width: 40,
686
- height: 40,
687
- borderRadius: 20
688
- },
689
- accountAvatarFallback: {
690
- width: 40,
691
- height: 40,
692
- borderRadius: 20,
693
- backgroundColor: '#d169e5',
694
- alignItems: 'center',
695
- justifyContent: 'center'
696
- },
697
- accountAvatarText: {
698
- color: 'white',
699
- fontSize: 18,
700
- fontWeight: 'bold'
701
- },
702
- message: {
703
- fontSize: 16,
704
- textAlign: 'center',
705
- marginTop: 24
706
- },
707
- loadingContainer: {
708
- flexDirection: 'row',
709
- alignItems: 'center',
710
- justifyContent: 'center',
711
- paddingVertical: 20,
712
- gap: 12
713
- },
714
- loadingText: {
715
- fontSize: 16
716
- }
717
- });
718
- export default /*#__PURE__*/React.memo(AccountOverviewScreen);
719
- //# sourceMappingURL=AccountOverviewScreen.js.map