@oxyhq/services 5.24.0 → 5.26.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 (444) hide show
  1. package/README.md +60 -8
  2. package/lib/commonjs/core/AuthManager.js +405 -0
  3. package/lib/commonjs/core/AuthManager.js.map +1 -0
  4. package/lib/commonjs/core/HttpService.js +39 -1
  5. package/lib/commonjs/core/HttpService.js.map +1 -1
  6. package/lib/commonjs/core/index.js +16 -0
  7. package/lib/commonjs/core/index.js.map +1 -1
  8. package/lib/commonjs/core/mixins/OxyServices.fedcm.js +38 -44
  9. package/lib/commonjs/core/mixins/OxyServices.fedcm.js.map +1 -1
  10. package/lib/commonjs/core/mixins/OxyServices.popup.js +9 -7
  11. package/lib/commonjs/core/mixins/OxyServices.popup.js.map +1 -1
  12. package/lib/commonjs/index.js +321 -18
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/shared/index.js +227 -0
  15. package/lib/commonjs/shared/index.js.map +1 -0
  16. package/lib/commonjs/shared/utils/colorUtils.js +161 -0
  17. package/lib/commonjs/shared/utils/colorUtils.js.map +1 -0
  18. package/lib/commonjs/shared/utils/debugUtils.js +84 -0
  19. package/lib/commonjs/shared/utils/debugUtils.js.map +1 -0
  20. package/lib/commonjs/shared/utils/errorUtils.js +190 -0
  21. package/lib/commonjs/shared/utils/errorUtils.js.map +1 -0
  22. package/lib/commonjs/shared/utils/index.js +196 -0
  23. package/lib/commonjs/shared/utils/index.js.map +1 -0
  24. package/lib/commonjs/shared/utils/networkUtils.js +213 -0
  25. package/lib/commonjs/shared/utils/networkUtils.js.map +1 -0
  26. package/lib/commonjs/shared/utils/themeUtils.js +118 -0
  27. package/lib/commonjs/shared/utils/themeUtils.js.map +1 -0
  28. package/lib/commonjs/ui/components/BottomSheetRouter.js +1 -1
  29. package/lib/commonjs/ui/components/FontLoader.js +1 -1
  30. package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
  31. package/lib/commonjs/ui/components/GroupedItem.js +1 -1
  32. package/lib/commonjs/ui/components/Header.js +1 -1
  33. package/lib/commonjs/ui/components/OxyProvider.js +9 -1
  34. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  35. package/lib/commonjs/ui/components/OxySignInButton.js +19 -20
  36. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  37. package/lib/commonjs/ui/components/ProfileCard.js +1 -1
  38. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
  39. package/lib/commonjs/ui/components/QuickActions.js +1 -1
  40. package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
  41. package/lib/commonjs/ui/components/Section.js +1 -1
  42. package/lib/commonjs/ui/components/SectionTitle.js +1 -1
  43. package/lib/commonjs/ui/components/SignInModal.js +546 -0
  44. package/lib/commonjs/ui/components/SignInModal.js.map +1 -0
  45. package/lib/commonjs/ui/context/OxyContext.js +2 -1
  46. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  47. package/lib/commonjs/ui/hooks/{use-color-scheme.js → useColorScheme.js} +1 -1
  48. package/lib/commonjs/ui/hooks/useColorScheme.js.map +1 -0
  49. package/lib/commonjs/ui/hooks/useSessionSocket.js +6 -12
  50. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  51. package/lib/commonjs/ui/hooks/useThemeColors.js +1 -1
  52. package/lib/commonjs/ui/hooks/useThemeStyles.js +1 -1
  53. package/lib/commonjs/ui/navigation/bottomSheetManager.js +5 -2
  54. package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
  55. package/lib/commonjs/ui/navigation/routes.js +7 -8
  56. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  57. package/lib/commonjs/ui/screens/AccountCenterScreen.js +7 -7
  58. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +6 -6
  60. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -2
  62. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +4 -4
  63. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  64. package/lib/commonjs/ui/screens/AppInfoScreen.js +1 -1
  65. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +1 -1
  66. package/lib/commonjs/ui/screens/FileManagementScreen.js +1 -1
  67. package/lib/commonjs/ui/screens/FollowersListScreen.js +18 -0
  68. package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -0
  69. package/lib/commonjs/ui/screens/FollowingListScreen.js +18 -0
  70. package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -0
  71. package/lib/commonjs/ui/screens/HelpSupportScreen.js +1 -1
  72. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/HistoryViewScreen.js +1 -1
  74. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +1 -1
  75. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +229 -0
  76. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -0
  77. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +1 -1
  78. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/OxyAuthScreen.js +9 -21
  80. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -1
  82. package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
  83. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  84. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +1 -1
  85. package/lib/commonjs/ui/screens/UserListScreen.js +411 -0
  86. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -0
  87. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +1 -1
  88. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
  89. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +1 -1
  90. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  91. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +1 -1
  92. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
  93. package/lib/commonjs/ui/stores/authStore.js +4 -6
  94. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  95. package/lib/commonjs/ui/utils/colorUtils.js +43 -46
  96. package/lib/commonjs/ui/utils/colorUtils.js.map +1 -1
  97. package/lib/commonjs/ui/utils/themeUtils.js +29 -39
  98. package/lib/commonjs/ui/utils/themeUtils.js.map +1 -1
  99. package/lib/commonjs/ui/utils/{user-utils.js → userUtils.js} +1 -1
  100. package/lib/commonjs/ui/utils/userUtils.js.map +1 -0
  101. package/lib/commonjs/utils/errorUtils.js +0 -13
  102. package/lib/commonjs/utils/errorUtils.js.map +1 -1
  103. package/lib/commonjs/utils/hookUtils.js +8 -8
  104. package/lib/commonjs/utils/hookUtils.js.map +1 -1
  105. package/lib/commonjs/web/WebOxyContext.js +277 -72
  106. package/lib/commonjs/web/WebOxyContext.js.map +1 -1
  107. package/lib/commonjs/web/index.js +177 -4
  108. package/lib/commonjs/web/index.js.map +1 -1
  109. package/lib/commonjs/web.js +12 -12
  110. package/lib/commonjs/web.js.map +1 -1
  111. package/lib/module/core/AuthManager.js +399 -0
  112. package/lib/module/core/AuthManager.js.map +1 -0
  113. package/lib/module/core/HttpService.js +39 -1
  114. package/lib/module/core/HttpService.js.map +1 -1
  115. package/lib/module/core/index.js +2 -0
  116. package/lib/module/core/index.js.map +1 -1
  117. package/lib/module/core/mixins/OxyServices.fedcm.js +38 -44
  118. package/lib/module/core/mixins/OxyServices.fedcm.js.map +1 -1
  119. package/lib/module/core/mixins/OxyServices.popup.js +9 -7
  120. package/lib/module/core/mixins/OxyServices.popup.js.map +1 -1
  121. package/lib/module/index.js +27 -2
  122. package/lib/module/index.js.map +1 -1
  123. package/lib/module/shared/index.js +37 -0
  124. package/lib/module/shared/index.js.map +1 -0
  125. package/lib/module/shared/utils/colorUtils.js +150 -0
  126. package/lib/module/shared/utils/colorUtils.js.map +1 -0
  127. package/lib/module/shared/utils/debugUtils.js +75 -0
  128. package/lib/module/shared/utils/debugUtils.js.map +1 -0
  129. package/lib/module/shared/utils/errorUtils.js +176 -0
  130. package/lib/module/shared/utils/errorUtils.js.map +1 -0
  131. package/lib/module/shared/utils/index.js +21 -0
  132. package/lib/module/shared/utils/index.js.map +1 -0
  133. package/lib/module/shared/utils/networkUtils.js +202 -0
  134. package/lib/module/shared/utils/networkUtils.js.map +1 -0
  135. package/lib/module/shared/utils/themeUtils.js +109 -0
  136. package/lib/module/shared/utils/themeUtils.js.map +1 -0
  137. package/lib/module/ui/components/BottomSheetRouter.js +1 -1
  138. package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
  139. package/lib/module/ui/components/FontLoader.js +1 -1
  140. package/lib/module/ui/components/FontLoader.js.map +1 -1
  141. package/lib/module/ui/components/GroupedItem.js +1 -1
  142. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  143. package/lib/module/ui/components/Header.js +1 -1
  144. package/lib/module/ui/components/Header.js.map +1 -1
  145. package/lib/module/ui/components/OxyProvider.js +9 -1
  146. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  147. package/lib/module/ui/components/OxySignInButton.js +20 -21
  148. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  149. package/lib/module/ui/components/ProfileCard.js +1 -1
  150. package/lib/module/ui/components/ProfileCard.js.map +1 -1
  151. package/lib/module/ui/components/QuickActions.js +1 -1
  152. package/lib/module/ui/components/QuickActions.js.map +1 -1
  153. package/lib/module/ui/components/Section.js +1 -1
  154. package/lib/module/ui/components/Section.js.map +1 -1
  155. package/lib/module/ui/components/SectionTitle.js +1 -1
  156. package/lib/module/ui/components/SectionTitle.js.map +1 -1
  157. package/lib/module/ui/components/SignInModal.js +536 -0
  158. package/lib/module/ui/components/SignInModal.js.map +1 -0
  159. package/lib/module/ui/context/OxyContext.js +1 -1
  160. package/lib/module/ui/context/OxyContext.js.map +1 -1
  161. package/lib/module/ui/hooks/{use-color-scheme.js → useColorScheme.js} +1 -1
  162. package/lib/module/ui/hooks/useColorScheme.js.map +1 -0
  163. package/lib/module/ui/hooks/useSessionSocket.js +6 -12
  164. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  165. package/lib/module/ui/hooks/useThemeColors.js +1 -1
  166. package/lib/module/ui/hooks/useThemeColors.js.map +1 -1
  167. package/lib/module/ui/hooks/useThemeStyles.js +1 -1
  168. package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
  169. package/lib/module/ui/navigation/bottomSheetManager.js +5 -2
  170. package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
  171. package/lib/module/ui/navigation/routes.js +7 -8
  172. package/lib/module/ui/navigation/routes.js.map +1 -1
  173. package/lib/module/ui/screens/AccountCenterScreen.js +7 -7
  174. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  175. package/lib/module/ui/screens/AccountOverviewScreen.js +6 -6
  176. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  177. package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
  178. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  179. package/lib/module/ui/screens/AccountSwitcherScreen.js +4 -4
  180. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  181. package/lib/module/ui/screens/AppInfoScreen.js +1 -1
  182. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  183. package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
  184. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  185. package/lib/module/ui/screens/FileManagementScreen.js +1 -1
  186. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  187. package/lib/module/ui/screens/FollowersListScreen.js +13 -0
  188. package/lib/module/ui/screens/FollowersListScreen.js.map +1 -0
  189. package/lib/module/ui/screens/FollowingListScreen.js +13 -0
  190. package/lib/module/ui/screens/FollowingListScreen.js.map +1 -0
  191. package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
  192. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  193. package/lib/module/ui/screens/HistoryViewScreen.js +1 -1
  194. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  195. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  196. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  197. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +224 -0
  198. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -0
  199. package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
  200. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  201. package/lib/module/ui/screens/OxyAuthScreen.js +9 -21
  202. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  203. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -1
  204. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  205. package/lib/module/ui/screens/ProfileScreen.js +1 -1
  206. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  207. package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
  208. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  209. package/lib/module/ui/screens/UserListScreen.js +405 -0
  210. package/lib/module/ui/screens/UserListScreen.js.map +1 -0
  211. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +1 -1
  212. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  213. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
  214. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  215. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
  216. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  217. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  218. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  219. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +1 -1
  220. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  221. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
  222. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  223. package/lib/module/ui/stores/authStore.js +4 -6
  224. package/lib/module/ui/stores/authStore.js.map +1 -1
  225. package/lib/module/ui/utils/colorUtils.js +7 -40
  226. package/lib/module/ui/utils/colorUtils.js.map +1 -1
  227. package/lib/module/ui/utils/themeUtils.js +7 -35
  228. package/lib/module/ui/utils/themeUtils.js.map +1 -1
  229. package/lib/module/ui/utils/{user-utils.js → userUtils.js} +1 -1
  230. package/lib/module/ui/utils/userUtils.js.map +1 -0
  231. package/lib/module/utils/errorUtils.js +0 -7
  232. package/lib/module/utils/errorUtils.js.map +1 -1
  233. package/lib/module/utils/hookUtils.js +8 -8
  234. package/lib/module/utils/hookUtils.js.map +1 -1
  235. package/lib/module/web/WebOxyContext.js +276 -72
  236. package/lib/module/web/WebOxyContext.js.map +1 -1
  237. package/lib/module/web/index.js +26 -5
  238. package/lib/module/web/index.js.map +1 -1
  239. package/lib/module/web.js +2 -1
  240. package/lib/module/web.js.map +1 -1
  241. package/lib/typescript/commonjs/core/AuthManager.d.ts +144 -0
  242. package/lib/typescript/commonjs/core/AuthManager.d.ts.map +1 -0
  243. package/lib/typescript/commonjs/core/HttpService.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/core/index.d.ts +2 -0
  245. package/lib/typescript/commonjs/core/index.d.ts.map +1 -1
  246. package/lib/typescript/commonjs/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/core/mixins/OxyServices.popup.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/index.d.ts +16 -2
  249. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/models/session.d.ts +4 -0
  251. package/lib/typescript/commonjs/models/session.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/shared/index.d.ts +29 -0
  253. package/lib/typescript/commonjs/shared/index.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/shared/utils/colorUtils.d.ts +105 -0
  255. package/lib/typescript/commonjs/shared/utils/colorUtils.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/shared/utils/debugUtils.d.ts +49 -0
  257. package/lib/typescript/commonjs/shared/utils/debugUtils.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/shared/utils/errorUtils.d.ts +98 -0
  259. package/lib/typescript/commonjs/shared/utils/errorUtils.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/shared/utils/index.d.ts +14 -0
  261. package/lib/typescript/commonjs/shared/utils/index.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/shared/utils/networkUtils.d.ts +140 -0
  263. package/lib/typescript/commonjs/shared/utils/networkUtils.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/shared/utils/themeUtils.d.ts +91 -0
  265. package/lib/typescript/commonjs/shared/utils/themeUtils.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +1 -1
  267. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +18 -0
  271. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -0
  272. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +1 -2
  273. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/ui/hooks/{use-color-scheme.d.ts → useColorScheme.d.ts} +1 -1
  275. package/lib/typescript/commonjs/ui/hooks/useColorScheme.d.ts.map +1 -0
  276. package/lib/typescript/commonjs/ui/hooks/useSessionSocket.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +2 -0
  278. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  280. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +9 -0
  282. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -0
  283. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +9 -0
  284. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts +5 -0
  286. package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -0
  287. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +11 -0
  289. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/ui/stores/authStore.d.ts.map +1 -1
  291. package/lib/typescript/commonjs/ui/utils/colorUtils.d.ts +7 -11
  292. package/lib/typescript/commonjs/ui/utils/colorUtils.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts +6 -19
  294. package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts.map +1 -1
  295. package/lib/typescript/commonjs/ui/utils/{user-utils.d.ts → userUtils.d.ts} +1 -1
  296. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -0
  297. package/lib/typescript/commonjs/utils/errorUtils.d.ts +0 -6
  298. package/lib/typescript/commonjs/utils/errorUtils.d.ts.map +1 -1
  299. package/lib/typescript/commonjs/web/WebOxyContext.d.ts +113 -4
  300. package/lib/typescript/commonjs/web/WebOxyContext.d.ts.map +1 -1
  301. package/lib/typescript/commonjs/web/index.d.ts +20 -9
  302. package/lib/typescript/commonjs/web/index.d.ts.map +1 -1
  303. package/lib/typescript/commonjs/web.d.ts +2 -1
  304. package/lib/typescript/commonjs/web.d.ts.map +1 -1
  305. package/lib/typescript/module/core/AuthManager.d.ts +144 -0
  306. package/lib/typescript/module/core/AuthManager.d.ts.map +1 -0
  307. package/lib/typescript/module/core/HttpService.d.ts.map +1 -1
  308. package/lib/typescript/module/core/index.d.ts +2 -0
  309. package/lib/typescript/module/core/index.d.ts.map +1 -1
  310. package/lib/typescript/module/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
  311. package/lib/typescript/module/core/mixins/OxyServices.popup.d.ts.map +1 -1
  312. package/lib/typescript/module/index.d.ts +16 -2
  313. package/lib/typescript/module/index.d.ts.map +1 -1
  314. package/lib/typescript/module/models/session.d.ts +4 -0
  315. package/lib/typescript/module/models/session.d.ts.map +1 -1
  316. package/lib/typescript/module/shared/index.d.ts +29 -0
  317. package/lib/typescript/module/shared/index.d.ts.map +1 -0
  318. package/lib/typescript/module/shared/utils/colorUtils.d.ts +105 -0
  319. package/lib/typescript/module/shared/utils/colorUtils.d.ts.map +1 -0
  320. package/lib/typescript/module/shared/utils/debugUtils.d.ts +49 -0
  321. package/lib/typescript/module/shared/utils/debugUtils.d.ts.map +1 -0
  322. package/lib/typescript/module/shared/utils/errorUtils.d.ts +98 -0
  323. package/lib/typescript/module/shared/utils/errorUtils.d.ts.map +1 -0
  324. package/lib/typescript/module/shared/utils/index.d.ts +14 -0
  325. package/lib/typescript/module/shared/utils/index.d.ts.map +1 -0
  326. package/lib/typescript/module/shared/utils/networkUtils.d.ts +140 -0
  327. package/lib/typescript/module/shared/utils/networkUtils.d.ts.map +1 -0
  328. package/lib/typescript/module/shared/utils/themeUtils.d.ts +91 -0
  329. package/lib/typescript/module/shared/utils/themeUtils.d.ts.map +1 -0
  330. package/lib/typescript/module/ui/components/FontLoader.d.ts +1 -1
  331. package/lib/typescript/module/ui/components/FontLoader.d.ts.map +1 -1
  332. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  333. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  334. package/lib/typescript/module/ui/components/SignInModal.d.ts +18 -0
  335. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -0
  336. package/lib/typescript/module/ui/context/OxyContext.d.ts +1 -2
  337. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  338. package/lib/typescript/module/ui/hooks/{use-color-scheme.d.ts → useColorScheme.d.ts} +1 -1
  339. package/lib/typescript/module/ui/hooks/useColorScheme.d.ts.map +1 -0
  340. package/lib/typescript/module/ui/hooks/useSessionSocket.d.ts.map +1 -1
  341. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +2 -0
  342. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  343. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  344. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  345. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +9 -0
  346. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -0
  347. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +9 -0
  348. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -0
  349. package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts +5 -0
  350. package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -0
  351. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  352. package/lib/typescript/module/ui/screens/UserListScreen.d.ts +11 -0
  353. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -0
  354. package/lib/typescript/module/ui/stores/authStore.d.ts.map +1 -1
  355. package/lib/typescript/module/ui/utils/colorUtils.d.ts +7 -11
  356. package/lib/typescript/module/ui/utils/colorUtils.d.ts.map +1 -1
  357. package/lib/typescript/module/ui/utils/themeUtils.d.ts +6 -19
  358. package/lib/typescript/module/ui/utils/themeUtils.d.ts.map +1 -1
  359. package/lib/typescript/module/ui/utils/{user-utils.d.ts → userUtils.d.ts} +1 -1
  360. package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -0
  361. package/lib/typescript/module/utils/errorUtils.d.ts +0 -6
  362. package/lib/typescript/module/utils/errorUtils.d.ts.map +1 -1
  363. package/lib/typescript/module/web/WebOxyContext.d.ts +113 -4
  364. package/lib/typescript/module/web/WebOxyContext.d.ts.map +1 -1
  365. package/lib/typescript/module/web/index.d.ts +20 -9
  366. package/lib/typescript/module/web/index.d.ts.map +1 -1
  367. package/lib/typescript/module/web.d.ts +2 -1
  368. package/lib/typescript/module/web.d.ts.map +1 -1
  369. package/package.json +8 -2
  370. package/src/core/AuthManager.ts +436 -0
  371. package/src/core/HttpService.ts +43 -1
  372. package/src/core/index.ts +4 -0
  373. package/src/core/mixins/OxyServices.fedcm.ts +37 -42
  374. package/src/core/mixins/OxyServices.popup.ts +10 -7
  375. package/src/index.ts +76 -11
  376. package/src/models/session.ts +4 -0
  377. package/src/shared/index.ts +82 -0
  378. package/src/shared/utils/colorUtils.ts +155 -0
  379. package/src/shared/utils/debugUtils.ts +73 -0
  380. package/src/shared/utils/errorUtils.ts +181 -0
  381. package/src/shared/utils/index.ts +59 -0
  382. package/src/shared/utils/networkUtils.ts +248 -0
  383. package/src/shared/utils/themeUtils.ts +115 -0
  384. package/src/ui/components/BottomSheetRouter.tsx +1 -1
  385. package/src/ui/components/FontLoader.tsx +1 -2
  386. package/src/ui/components/GroupedItem.tsx +1 -1
  387. package/src/ui/components/Header.tsx +1 -1
  388. package/src/ui/components/OxyProvider.tsx +10 -0
  389. package/src/ui/components/OxySignInButton.tsx +20 -22
  390. package/src/ui/components/ProfileCard.tsx +1 -1
  391. package/src/ui/components/QuickActions.tsx +1 -1
  392. package/src/ui/components/Section.tsx +1 -1
  393. package/src/ui/components/SectionTitle.tsx +1 -1
  394. package/src/ui/components/SignInModal.tsx +534 -0
  395. package/src/ui/context/OxyContext.tsx +1 -2
  396. package/src/ui/hooks/queries/queryKeys.ts +2 -2
  397. package/src/ui/hooks/useSessionSocket.ts +12 -17
  398. package/src/ui/hooks/useThemeColors.ts +1 -1
  399. package/src/ui/hooks/useThemeStyles.ts +1 -1
  400. package/src/ui/navigation/bottomSheetManager.ts +5 -1
  401. package/src/ui/navigation/routes.ts +8 -9
  402. package/src/ui/screens/AccountCenterScreen.tsx +7 -7
  403. package/src/ui/screens/AccountOverviewScreen.tsx +6 -6
  404. package/src/ui/screens/AccountSettingsScreen.tsx +2 -2
  405. package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
  406. package/src/ui/screens/AppInfoScreen.tsx +1 -1
  407. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
  408. package/src/ui/screens/FileManagementScreen.tsx +1 -1
  409. package/src/ui/screens/FollowersListScreen.tsx +14 -0
  410. package/src/ui/screens/FollowingListScreen.tsx +14 -0
  411. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  412. package/src/ui/screens/HistoryViewScreen.tsx +1 -1
  413. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  414. package/src/ui/screens/LearnMoreUsernamesScreen.tsx +231 -0
  415. package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
  416. package/src/ui/screens/OxyAuthScreen.tsx +10 -21
  417. package/src/ui/screens/PremiumSubscriptionScreen.tsx +1 -1
  418. package/src/ui/screens/ProfileScreen.tsx +1 -1
  419. package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
  420. package/src/ui/screens/UserListScreen.tsx +416 -0
  421. package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
  422. package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -1
  423. package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
  424. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
  425. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
  426. package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
  427. package/src/ui/stores/authStore.ts +5 -6
  428. package/src/ui/utils/colorUtils.ts +15 -43
  429. package/src/ui/utils/themeUtils.ts +14 -39
  430. package/src/utils/errorUtils.ts +1 -6
  431. package/src/utils/hookUtils.ts +8 -8
  432. package/src/web/WebOxyContext.tsx +330 -72
  433. package/src/web/index.ts +77 -7
  434. package/src/web.ts +1 -1
  435. package/lib/commonjs/ui/hooks/use-color-scheme.js.map +0 -1
  436. package/lib/commonjs/ui/utils/user-utils.js.map +0 -1
  437. package/lib/module/ui/hooks/use-color-scheme.js.map +0 -1
  438. package/lib/module/ui/utils/user-utils.js.map +0 -1
  439. package/lib/typescript/commonjs/ui/hooks/use-color-scheme.d.ts.map +0 -1
  440. package/lib/typescript/commonjs/ui/utils/user-utils.d.ts.map +0 -1
  441. package/lib/typescript/module/ui/hooks/use-color-scheme.d.ts.map +0 -1
  442. package/lib/typescript/module/ui/utils/user-utils.d.ts.map +0 -1
  443. /package/src/ui/hooks/{use-color-scheme.ts → useColorScheme.ts} +0 -0
  444. /package/src/ui/utils/{user-utils.ts → userUtils.ts} +0 -0
@@ -0,0 +1,534 @@
1
+ /**
2
+ * SignInModal - Full screen sign-in modal with QR code
3
+ *
4
+ * A semi-transparent full-screen modal that displays:
5
+ * - QR code for scanning with Oxy Accounts app
6
+ * - Button to open Oxy Auth popup
7
+ *
8
+ * Animates with fade-in effect.
9
+ */
10
+
11
+ import React, { useState, useEffect, useCallback, useRef } from 'react';
12
+ import {
13
+ View,
14
+ Text,
15
+ TouchableOpacity,
16
+ StyleSheet,
17
+ Modal,
18
+ Dimensions,
19
+ ActivityIndicator,
20
+ Platform,
21
+ } from 'react-native';
22
+ import Animated, {
23
+ useSharedValue,
24
+ useAnimatedStyle,
25
+ withTiming,
26
+ runOnJS,
27
+ } from 'react-native-reanimated';
28
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
29
+ import io, { type Socket } from 'socket.io-client';
30
+ import QRCode from 'react-native-qrcode-svg';
31
+ import { useThemeColors } from '../hooks/useThemeColors';
32
+ import { useOxy } from '../context/OxyContext';
33
+ import OxyLogo from './OxyLogo';
34
+ import { createDebugLogger } from '../../shared/utils/debugUtils';
35
+
36
+ const debug = createDebugLogger('SignInModal');
37
+
38
+ const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window');
39
+
40
+ // Auth session expiration (5 minutes)
41
+ const AUTH_SESSION_EXPIRY_MS = 5 * 60 * 1000;
42
+
43
+ // Polling interval (fallback if socket fails)
44
+ const POLLING_INTERVAL_MS = 3000;
45
+
46
+ interface AuthSession {
47
+ sessionToken: string;
48
+ expiresAt: number;
49
+ }
50
+
51
+ interface AuthUpdatePayload {
52
+ status: 'authorized' | 'cancelled' | 'expired';
53
+ sessionId?: string;
54
+ publicKey?: string;
55
+ userId?: string;
56
+ username?: string;
57
+ }
58
+
59
+ // Store for modal visibility with subscription support
60
+ let modalVisible = false;
61
+ let setModalVisibleCallback: ((visible: boolean) => void) | null = null;
62
+ const visibilityListeners = new Set<(visible: boolean) => void>();
63
+
64
+ export const showSignInModal = () => {
65
+ modalVisible = true;
66
+ setModalVisibleCallback?.(true);
67
+ visibilityListeners.forEach(listener => listener(true));
68
+ };
69
+
70
+ export const hideSignInModal = () => {
71
+ modalVisible = false;
72
+ setModalVisibleCallback?.(false);
73
+ visibilityListeners.forEach(listener => listener(false));
74
+ };
75
+
76
+ export const isSignInModalVisible = () => modalVisible;
77
+
78
+ /** Subscribe to modal visibility changes */
79
+ export const subscribeToSignInModal = (listener: (visible: boolean) => void): (() => void) => {
80
+ visibilityListeners.add(listener);
81
+ return () => visibilityListeners.delete(listener);
82
+ };
83
+
84
+ const SignInModal: React.FC = () => {
85
+ const [visible, setVisible] = useState(false);
86
+ const [authSession, setAuthSession] = useState<AuthSession | null>(null);
87
+ const [isLoading, setIsLoading] = useState(false);
88
+ const [error, setError] = useState<string | null>(null);
89
+ const [isWaiting, setIsWaiting] = useState(false);
90
+
91
+ const insets = useSafeAreaInsets();
92
+ const colors = useThemeColors();
93
+ const { oxyServices, switchSession } = useOxy();
94
+
95
+ const socketRef = useRef<Socket | null>(null);
96
+ const pollingIntervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
97
+ const isProcessingRef = useRef(false);
98
+
99
+ // Animation values
100
+ const opacity = useSharedValue(0);
101
+ const scale = useSharedValue(0.9);
102
+
103
+ // Register callback
104
+ useEffect(() => {
105
+ setModalVisibleCallback = setVisible;
106
+ return () => {
107
+ setModalVisibleCallback = null;
108
+ };
109
+ }, []);
110
+
111
+ // Animate in/out
112
+ useEffect(() => {
113
+ if (visible) {
114
+ opacity.value = withTiming(1, { duration: 250 });
115
+ scale.value = withTiming(1, { duration: 250 });
116
+ generateAuthSession();
117
+ } else {
118
+ opacity.value = withTiming(0, { duration: 200 });
119
+ scale.value = withTiming(0.9, { duration: 200 });
120
+ }
121
+ }, [visible]);
122
+
123
+ const backdropStyle = useAnimatedStyle(() => ({
124
+ opacity: opacity.value,
125
+ }));
126
+
127
+ const contentStyle = useAnimatedStyle(() => ({
128
+ opacity: opacity.value,
129
+ transform: [{ scale: scale.value }],
130
+ }));
131
+
132
+ // Handle successful authorization
133
+ const handleAuthSuccess = useCallback(async (sessionId: string) => {
134
+ if (isProcessingRef.current) return;
135
+ isProcessingRef.current = true;
136
+
137
+ try {
138
+ if (switchSession) {
139
+ await switchSession(sessionId);
140
+ } else {
141
+ await oxyServices.getTokenBySession(sessionId);
142
+ }
143
+ hideSignInModal();
144
+ } catch (err) {
145
+ debug.error('Error completing auth:', err);
146
+ setError('Authorization successful but failed to complete sign in. Please try again.');
147
+ isProcessingRef.current = false;
148
+ }
149
+ }, [oxyServices, switchSession]);
150
+
151
+ // Cleanup socket and polling
152
+ const cleanup = useCallback(() => {
153
+ setIsWaiting(false);
154
+
155
+ if (socketRef.current) {
156
+ socketRef.current.disconnect();
157
+ socketRef.current = null;
158
+ }
159
+
160
+ if (pollingIntervalRef.current) {
161
+ clearInterval(pollingIntervalRef.current);
162
+ pollingIntervalRef.current = null;
163
+ }
164
+ }, []);
165
+
166
+ // Connect to socket for real-time updates
167
+ const connectSocket = useCallback((sessionToken: string) => {
168
+ const baseURL = oxyServices.getBaseURL();
169
+
170
+ const socket = io(`${baseURL}/auth-session`, {
171
+ transports: ['websocket', 'polling'],
172
+ reconnection: true,
173
+ reconnectionAttempts: 3,
174
+ reconnectionDelay: 1000,
175
+ });
176
+
177
+ socketRef.current = socket;
178
+
179
+ socket.on('connect', () => {
180
+ debug.log('Auth socket connected');
181
+ socket.emit('join', sessionToken);
182
+ });
183
+
184
+ socket.on('auth_update', (payload: AuthUpdatePayload) => {
185
+ debug.log('Auth update received:', payload);
186
+
187
+ if (payload.status === 'authorized' && payload.sessionId) {
188
+ cleanup();
189
+ handleAuthSuccess(payload.sessionId);
190
+ } else if (payload.status === 'cancelled') {
191
+ cleanup();
192
+ setError('Authorization was denied.');
193
+ } else if (payload.status === 'expired') {
194
+ cleanup();
195
+ setError('Session expired. Please try again.');
196
+ }
197
+ });
198
+
199
+ socket.on('connect_error', (err) => {
200
+ debug.log('Socket connection error, falling back to polling:', err.message);
201
+ socket.disconnect();
202
+ startPolling(sessionToken);
203
+ });
204
+ }, [oxyServices, handleAuthSuccess, cleanup]);
205
+
206
+ // Start polling for authorization (fallback)
207
+ const startPolling = useCallback((sessionToken: string) => {
208
+ pollingIntervalRef.current = setInterval(async () => {
209
+ if (isProcessingRef.current) return;
210
+
211
+ try {
212
+ const response: {
213
+ authorized: boolean;
214
+ sessionId?: string;
215
+ status?: string;
216
+ } = await oxyServices.makeRequest('GET', `/api/auth/session/status/${sessionToken}`, undefined, { cache: false });
217
+
218
+ if (response.authorized && response.sessionId) {
219
+ cleanup();
220
+ handleAuthSuccess(response.sessionId);
221
+ } else if (response.status === 'cancelled') {
222
+ cleanup();
223
+ setError('Authorization was denied.');
224
+ } else if (response.status === 'expired') {
225
+ cleanup();
226
+ setError('Session expired. Please try again.');
227
+ }
228
+ } catch (err) {
229
+ debug.log('Auth polling error:', err);
230
+ }
231
+ }, POLLING_INTERVAL_MS);
232
+ }, [oxyServices, handleAuthSuccess, cleanup]);
233
+
234
+ // Generate a new auth session
235
+ const generateAuthSession = useCallback(async () => {
236
+ setIsLoading(true);
237
+ setError(null);
238
+ isProcessingRef.current = false;
239
+
240
+ try {
241
+ const sessionToken = generateSessionToken();
242
+ const expiresAt = Date.now() + AUTH_SESSION_EXPIRY_MS;
243
+
244
+ await oxyServices.makeRequest('POST', '/api/auth/session/create', {
245
+ sessionToken,
246
+ expiresAt,
247
+ appId: Platform.OS,
248
+ }, { cache: false });
249
+
250
+ setAuthSession({ sessionToken, expiresAt });
251
+ setIsWaiting(true);
252
+ connectSocket(sessionToken);
253
+ } catch (err: any) {
254
+ setError(err.message || 'Failed to create auth session');
255
+ } finally {
256
+ setIsLoading(false);
257
+ }
258
+ }, [oxyServices, connectSocket]);
259
+
260
+ // Generate a random session token
261
+ const generateSessionToken = (): string => {
262
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
263
+ let result = '';
264
+ for (let i = 0; i < 32; i++) {
265
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
266
+ }
267
+ return result;
268
+ };
269
+
270
+ // Build the QR code data
271
+ const getQRData = (): string => {
272
+ if (!authSession) return '';
273
+ return `oxyauth://${authSession.sessionToken}`;
274
+ };
275
+
276
+ // Open Oxy Auth popup
277
+ const handleOpenAuthPopup = useCallback(async () => {
278
+ if (!authSession) return;
279
+
280
+ const baseURL = oxyServices.getBaseURL();
281
+ // Resolve auth web URL
282
+ let authWebUrl = oxyServices.config?.authWebUrl;
283
+ if (!authWebUrl) {
284
+ try {
285
+ const url = new URL(baseURL);
286
+ if (url.port === '3001') {
287
+ url.port = '3000';
288
+ authWebUrl = url.origin;
289
+ } else if (url.hostname.startsWith('api.')) {
290
+ url.hostname = `auth.${url.hostname.slice(4)}`;
291
+ authWebUrl = url.origin;
292
+ }
293
+ } catch {
294
+ authWebUrl = 'https://auth.oxy.so';
295
+ }
296
+ }
297
+ authWebUrl = authWebUrl || 'https://auth.oxy.so';
298
+
299
+ const webUrl = new URL('/authorize', authWebUrl);
300
+ webUrl.searchParams.set('token', authSession.sessionToken);
301
+
302
+ // Open popup window
303
+ const width = 500;
304
+ const height = 650;
305
+ const left = (window.screen.width - width) / 2;
306
+ const top = (window.screen.height - height) / 2;
307
+
308
+ window.open(
309
+ webUrl.toString(),
310
+ 'oxy-auth-popup',
311
+ `width=${width},height=${height},left=${left},top=${top},popup=1`
312
+ );
313
+ }, [authSession, oxyServices]);
314
+
315
+ // Refresh session
316
+ const handleRefresh = useCallback(() => {
317
+ cleanup();
318
+ generateAuthSession();
319
+ }, [generateAuthSession, cleanup]);
320
+
321
+ // Handle close
322
+ const handleClose = useCallback(() => {
323
+ cleanup();
324
+ hideSignInModal();
325
+ }, [cleanup]);
326
+
327
+ // Clean up on unmount
328
+ useEffect(() => {
329
+ return () => {
330
+ cleanup();
331
+ };
332
+ }, [cleanup]);
333
+
334
+ if (!visible) return null;
335
+
336
+ return (
337
+ <Modal visible={visible} transparent animationType="none" statusBarTranslucent onRequestClose={handleClose}>
338
+ <Animated.View style={[styles.backdrop, backdropStyle]}>
339
+ <TouchableOpacity style={StyleSheet.absoluteFill} onPress={handleClose} activeOpacity={1} />
340
+
341
+ <Animated.View style={[styles.content, contentStyle, { paddingTop: insets.top + 20, paddingBottom: insets.bottom + 20 }]}>
342
+ {/* Close button */}
343
+ <TouchableOpacity style={styles.closeButton} onPress={handleClose}>
344
+ <Text style={styles.closeButtonText}>×</Text>
345
+ </TouchableOpacity>
346
+
347
+ {/* Header */}
348
+ <View style={styles.header}>
349
+ <OxyLogo width={56} height={56} />
350
+ <Text style={[styles.title, { color: colors.text }]}>Sign in with Oxy</Text>
351
+ <Text style={[styles.subtitle, { color: colors.secondaryText }]}>
352
+ Scan with Oxy Accounts app or use the button below
353
+ </Text>
354
+ </View>
355
+
356
+ {isLoading ? (
357
+ <View style={styles.loadingContainer}>
358
+ <ActivityIndicator size="large" color={colors.tint} />
359
+ <Text style={[styles.loadingText, { color: colors.secondaryText }]}>
360
+ Preparing sign in...
361
+ </Text>
362
+ </View>
363
+ ) : error ? (
364
+ <View style={styles.errorContainer}>
365
+ <Text style={[styles.errorText, { color: '#EA4335' }]}>{error}</Text>
366
+ <TouchableOpacity
367
+ style={[styles.button, { backgroundColor: colors.tint }]}
368
+ onPress={handleRefresh}
369
+ >
370
+ <Text style={styles.buttonText}>Try Again</Text>
371
+ </TouchableOpacity>
372
+ </View>
373
+ ) : (
374
+ <>
375
+ {/* QR Code */}
376
+ <View style={[styles.qrContainer, { backgroundColor: 'white' }]}>
377
+ {authSession ? (
378
+ <QRCode
379
+ value={getQRData()}
380
+ size={200}
381
+ backgroundColor="white"
382
+ color="black"
383
+ />
384
+ ) : (
385
+ <ActivityIndicator size="large" color="#d169e5" />
386
+ )}
387
+ </View>
388
+
389
+ {/* Divider */}
390
+ <View style={styles.dividerContainer}>
391
+ <View style={[styles.divider, { backgroundColor: 'rgba(255,255,255,0.3)' }]} />
392
+ <Text style={[styles.dividerText, { color: 'rgba(255,255,255,0.7)' }]}>or</Text>
393
+ <View style={[styles.divider, { backgroundColor: 'rgba(255,255,255,0.3)' }]} />
394
+ </View>
395
+
396
+ {/* Open Auth Popup Button */}
397
+ <TouchableOpacity
398
+ style={[styles.button, { backgroundColor: '#d169e5' }]}
399
+ onPress={handleOpenAuthPopup}
400
+ >
401
+ <OxyLogo width={20} height={20} fillColor="white" style={styles.buttonIcon} />
402
+ <Text style={styles.buttonText}>Open Oxy Auth</Text>
403
+ </TouchableOpacity>
404
+
405
+ {/* Status */}
406
+ {isWaiting && (
407
+ <View style={styles.statusContainer}>
408
+ <ActivityIndicator size="small" color="white" />
409
+ <Text style={styles.statusText}>
410
+ Waiting for authorization...
411
+ </Text>
412
+ </View>
413
+ )}
414
+ </>
415
+ )}
416
+ </Animated.View>
417
+ </Animated.View>
418
+ </Modal>
419
+ );
420
+ };
421
+
422
+ const styles = StyleSheet.create({
423
+ backdrop: {
424
+ flex: 1,
425
+ backgroundColor: 'rgba(0, 0, 0, 0.85)',
426
+ justifyContent: 'center',
427
+ alignItems: 'center',
428
+ },
429
+ content: {
430
+ width: '100%',
431
+ maxWidth: 400,
432
+ alignItems: 'center',
433
+ paddingHorizontal: 24,
434
+ },
435
+ closeButton: {
436
+ position: 'absolute',
437
+ top: 16,
438
+ right: 16,
439
+ width: 40,
440
+ height: 40,
441
+ borderRadius: 20,
442
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
443
+ justifyContent: 'center',
444
+ alignItems: 'center',
445
+ zIndex: 10,
446
+ },
447
+ closeButtonText: {
448
+ color: 'white',
449
+ fontSize: 28,
450
+ fontWeight: '300',
451
+ lineHeight: 32,
452
+ },
453
+ header: {
454
+ alignItems: 'center',
455
+ marginBottom: 32,
456
+ },
457
+ title: {
458
+ fontSize: 28,
459
+ fontWeight: 'bold',
460
+ marginTop: 16,
461
+ color: 'white',
462
+ },
463
+ subtitle: {
464
+ fontSize: 15,
465
+ marginTop: 8,
466
+ textAlign: 'center',
467
+ color: 'rgba(255, 255, 255, 0.7)',
468
+ },
469
+ qrContainer: {
470
+ padding: 20,
471
+ borderRadius: 16,
472
+ },
473
+ dividerContainer: {
474
+ flexDirection: 'row',
475
+ alignItems: 'center',
476
+ marginVertical: 24,
477
+ width: '100%',
478
+ },
479
+ divider: {
480
+ flex: 1,
481
+ height: 1,
482
+ },
483
+ dividerText: {
484
+ marginHorizontal: 16,
485
+ fontSize: 14,
486
+ },
487
+ button: {
488
+ flexDirection: 'row',
489
+ alignItems: 'center',
490
+ justifyContent: 'center',
491
+ paddingVertical: 16,
492
+ paddingHorizontal: 24,
493
+ borderRadius: 12,
494
+ width: '100%',
495
+ },
496
+ buttonIcon: {
497
+ marginRight: 10,
498
+ },
499
+ buttonText: {
500
+ color: 'white',
501
+ fontSize: 16,
502
+ fontWeight: '600',
503
+ },
504
+ statusContainer: {
505
+ flexDirection: 'row',
506
+ alignItems: 'center',
507
+ marginTop: 24,
508
+ },
509
+ statusText: {
510
+ marginLeft: 8,
511
+ fontSize: 14,
512
+ color: 'rgba(255, 255, 255, 0.7)',
513
+ },
514
+ loadingContainer: {
515
+ alignItems: 'center',
516
+ paddingVertical: 40,
517
+ },
518
+ loadingText: {
519
+ marginTop: 16,
520
+ fontSize: 14,
521
+ },
522
+ errorContainer: {
523
+ alignItems: 'center',
524
+ paddingVertical: 20,
525
+ width: '100%',
526
+ },
527
+ errorText: {
528
+ fontSize: 14,
529
+ textAlign: 'center',
530
+ marginBottom: 16,
531
+ },
532
+ });
533
+
534
+ export default SignInModal;
@@ -1,5 +1,4 @@
1
- import type React from 'react';
2
- import {
1
+ import React, {
3
2
  createContext,
4
3
  useCallback,
5
4
  useContext,
@@ -58,9 +58,9 @@ export const queryKeys = {
58
58
  // Security activity queries
59
59
  security: {
60
60
  all: ['security'] as const,
61
- activity: (limit?: number, offset?: number, eventType?: string) =>
61
+ activity: (limit?: number, offset?: number, eventType?: string) =>
62
62
  [...queryKeys.security.all, 'activity', limit, offset, eventType] as const,
63
- recent: (limit: number) =>
63
+ recent: (limit: number) =>
64
64
  [...queryKeys.security.all, 'recent', limit] as const,
65
65
  },
66
66
  } as const;
@@ -2,6 +2,9 @@ import { useEffect, useRef } from 'react';
2
2
  import io from 'socket.io-client';
3
3
  import { toast } from '../../lib/sonner';
4
4
  import { logger } from '../../utils/loggerUtils';
5
+ import { createDebugLogger } from '../../shared/utils/debugUtils';
6
+
7
+ const debug = createDebugLogger('SessionSocket');
5
8
 
6
9
  interface UseSessionSocketProps {
7
10
  userId: string | null | undefined;
@@ -69,27 +72,21 @@ export function useSessionSocket({ userId, activeSessionId, currentDeviceId, ref
69
72
  socket.emit('join', { userId: roomId });
70
73
  joinedRoomRef.current = roomId;
71
74
 
72
- if (__DEV__) {
73
- console.log('Emitting join for room:', roomId);
74
- }
75
+ debug.log('Emitting join for room:', roomId);
75
76
  }
76
77
 
77
78
  // Set up event handlers (only once per socket instance)
78
79
  const handleConnect = () => {
79
- if (__DEV__) {
80
- console.log('Socket connected:', socket.id);
81
- }
80
+ debug.log('Socket connected:', socket.id);
82
81
  };
83
82
 
84
- const handleSessionUpdate = async (data: {
85
- type: string;
86
- sessionId?: string;
87
- deviceId?: string;
88
- sessionIds?: string[]
83
+ const handleSessionUpdate = async (data: {
84
+ type: string;
85
+ sessionId?: string;
86
+ deviceId?: string;
87
+ sessionIds?: string[]
89
88
  }) => {
90
- if (__DEV__) {
91
- console.log('Received session_update:', data);
92
- }
89
+ debug.log('Received session_update:', data);
93
90
 
94
91
  const currentActiveSessionId = activeSessionIdRef.current;
95
92
  const currentDeviceId = currentDeviceIdRef.current;
@@ -213,9 +210,7 @@ export function useSessionSocket({ userId, activeSessionId, currentDeviceId, ref
213
210
  try {
214
211
  await clearSessionStateRef.current();
215
212
  } catch (error) {
216
- if (__DEV__) {
217
- console.error('Failed to clear session state after session_update:', error);
218
- }
213
+ debug.error('Failed to clear session state after session_update:', error);
219
214
  }
220
215
  }
221
216
  }
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import { useColorScheme } from './use-color-scheme';
2
+ import { useColorScheme } from './useColorScheme';
3
3
  import { Colors } from '../constants/theme';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import { useColorScheme } from './use-color-scheme';
2
+ import { useColorScheme } from './useColorScheme';
3
3
  import { Colors } from '../constants/theme';
4
4
  import { normalizeColorScheme } from '../utils/themeUtils';
5
5
 
@@ -12,6 +12,7 @@ export interface BottomSheetState {
12
12
  currentStep?: number;
13
13
  history: Array<{ screen: RouteName; props: Record<string, unknown>; step?: number }>;
14
14
  isOpen: boolean;
15
+ fullScreen: boolean;
15
16
  }
16
17
 
17
18
  const initialState: BottomSheetState = {
@@ -20,6 +21,7 @@ const initialState: BottomSheetState = {
20
21
  currentStep: undefined,
21
22
  history: [],
22
23
  isOpen: false,
24
+ fullScreen: false,
23
25
  };
24
26
 
25
27
  export const bottomSheetStore = createStore<BottomSheetState>(() => initialState);
@@ -27,10 +29,11 @@ export const bottomSheetStore = createStore<BottomSheetState>(() => initialState
27
29
  export const getState = () => bottomSheetStore.getState();
28
30
 
29
31
  export const showBottomSheet = (
30
- screenOrConfig: RouteName | { screen: RouteName; props?: Record<string, unknown> },
32
+ screenOrConfig: RouteName | { screen: RouteName; props?: Record<string, unknown>; fullScreen?: boolean },
31
33
  ): void => {
32
34
  const screen = typeof screenOrConfig === 'string' ? screenOrConfig : screenOrConfig.screen;
33
35
  const props = typeof screenOrConfig === 'string' ? {} : (screenOrConfig.props || {});
36
+ const fullScreen = typeof screenOrConfig === 'string' ? false : (screenOrConfig.fullScreen ?? false);
34
37
 
35
38
  if (!isValidRoute(screen)) {
36
39
  if (__DEV__) console.warn(`[BottomSheet] Invalid route: ${screen}`);
@@ -55,6 +58,7 @@ export const showBottomSheet = (
55
58
  screenProps: props,
56
59
  currentStep: typeof props.initialStep === 'number' ? props.initialStep : undefined,
57
60
  isOpen: true,
61
+ fullScreen,
58
62
  });
59
63
  };
60
64