@oxyhq/services 5.5.8 → 5.6.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 (388) hide show
  1. package/README.md +16 -2
  2. package/lib/commonjs/core/index.js +69 -82
  3. package/lib/commonjs/core/index.js.map +1 -1
  4. package/lib/commonjs/index.js +24 -183
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/node/index.js +0 -2
  7. package/lib/commonjs/node/index.js.map +1 -1
  8. package/lib/commonjs/ui/components/FollowButton.js +100 -229
  9. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  10. package/lib/commonjs/ui/components/OxyPayButton.js +131 -0
  11. package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -0
  12. package/lib/commonjs/ui/components/OxyProvider.js +41 -198
  13. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  14. package/lib/commonjs/ui/components/OxySignInButton.js +15 -2
  15. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  16. package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +66 -0
  17. package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -0
  18. package/lib/commonjs/ui/components/icon/index.js +7 -0
  19. package/lib/commonjs/ui/components/icon/index.js.map +1 -1
  20. package/lib/commonjs/ui/components/index.js +7 -0
  21. package/lib/commonjs/ui/components/index.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -7
  23. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/PinInput.js +108 -0
  25. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -0
  26. package/lib/commonjs/ui/components/internal/TextField.js +20 -0
  27. package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
  28. package/lib/commonjs/ui/context/OxyContext.js +26 -23
  29. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  30. package/lib/commonjs/ui/hooks/index.js +2 -15
  31. package/lib/commonjs/ui/hooks/index.js.map +1 -1
  32. package/lib/commonjs/ui/hooks/useFollow.js +52 -136
  33. package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
  34. package/lib/commonjs/ui/hooks/useSessionSocket.js +52 -0
  35. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -0
  36. package/lib/commonjs/ui/index.js +8 -191
  37. package/lib/commonjs/ui/index.js.map +1 -1
  38. package/lib/commonjs/ui/navigation/OxyRouter.js +52 -60
  39. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  40. package/lib/commonjs/ui/screens/AccountCenterScreen.js +18 -30
  41. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  42. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +4 -22
  43. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  44. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +6 -14
  45. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  46. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +37 -66
  47. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  48. package/lib/commonjs/ui/screens/AppInfoScreen.js +21 -44
  49. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  50. package/lib/commonjs/ui/screens/FeedbackScreen.js +44 -23
  51. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  52. package/lib/commonjs/ui/screens/FileManagementScreen.js +59 -78
  53. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  54. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1588 -0
  55. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -0
  56. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +22 -36
  57. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  58. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +269 -0
  59. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -0
  60. package/lib/commonjs/ui/screens/SessionManagementScreen.js +47 -69
  61. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  62. package/lib/commonjs/ui/screens/SignInScreen.js +99 -333
  63. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  64. package/lib/commonjs/ui/screens/SignUpScreen.js +136 -340
  65. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  66. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +192 -0
  67. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -0
  68. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +135 -0
  69. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -0
  70. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +108 -0
  71. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
  72. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +126 -0
  73. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
  74. package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +84 -0
  75. package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
  76. package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +59 -0
  77. package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
  78. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +15 -2
  79. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  80. package/lib/commonjs/ui/stores/authStore.js +31 -0
  81. package/lib/commonjs/ui/stores/authStore.js.map +1 -0
  82. package/lib/commonjs/ui/stores/followStore.js +124 -0
  83. package/lib/commonjs/ui/stores/followStore.js.map +1 -0
  84. package/lib/commonjs/ui/styles/index.js +0 -11
  85. package/lib/commonjs/ui/styles/index.js.map +1 -1
  86. package/lib/commonjs/ui/utils/confirmAction.js +28 -0
  87. package/lib/commonjs/ui/utils/confirmAction.js.map +1 -0
  88. package/lib/module/core/index.js +69 -81
  89. package/lib/module/core/index.js.map +1 -1
  90. package/lib/module/index.js +14 -17
  91. package/lib/module/index.js.map +1 -1
  92. package/lib/module/node/index.js +0 -3
  93. package/lib/module/node/index.js.map +1 -1
  94. package/lib/module/ui/components/FollowButton.js +100 -229
  95. package/lib/module/ui/components/FollowButton.js.map +1 -1
  96. package/lib/module/ui/components/OxyPayButton.js +125 -0
  97. package/lib/module/ui/components/OxyPayButton.js.map +1 -0
  98. package/lib/module/ui/components/OxyProvider.js +42 -199
  99. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  100. package/lib/module/ui/components/OxySignInButton.js +15 -2
  101. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  102. package/lib/module/ui/components/icon/FAIRWalletIcon.js +60 -0
  103. package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -0
  104. package/lib/module/ui/components/icon/index.js +1 -0
  105. package/lib/module/ui/components/icon/index.js.map +1 -1
  106. package/lib/module/ui/components/index.js +1 -0
  107. package/lib/module/ui/components/index.js.map +1 -1
  108. package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -8
  109. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  110. package/lib/module/ui/components/internal/PinInput.js +103 -0
  111. package/lib/module/ui/components/internal/PinInput.js.map +1 -0
  112. package/lib/module/ui/components/internal/TextField.js +20 -0
  113. package/lib/module/ui/components/internal/TextField.js.map +1 -1
  114. package/lib/module/ui/context/OxyContext.js +26 -23
  115. package/lib/module/ui/context/OxyContext.js.map +1 -1
  116. package/lib/module/ui/hooks/index.js +1 -2
  117. package/lib/module/ui/hooks/index.js.map +1 -1
  118. package/lib/module/ui/hooks/useFollow.js +52 -137
  119. package/lib/module/ui/hooks/useFollow.js.map +1 -1
  120. package/lib/module/ui/hooks/useSessionSocket.js +47 -0
  121. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -0
  122. package/lib/module/ui/index.js +2 -13
  123. package/lib/module/ui/index.js.map +1 -1
  124. package/lib/module/ui/navigation/OxyRouter.js +53 -61
  125. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  126. package/lib/module/ui/screens/AccountCenterScreen.js +6 -18
  127. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  128. package/lib/module/ui/screens/AccountOverviewScreen.js +5 -23
  129. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  130. package/lib/module/ui/screens/AccountSettingsScreen.js +7 -15
  131. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  132. package/lib/module/ui/screens/AccountSwitcherScreen.js +38 -67
  133. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  134. package/lib/module/ui/screens/AppInfoScreen.js +22 -45
  135. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  136. package/lib/module/ui/screens/FeedbackScreen.js +44 -23
  137. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  138. package/lib/module/ui/screens/FileManagementScreen.js +59 -78
  139. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  140. package/lib/module/ui/screens/PaymentGatewayScreen.js +1583 -0
  141. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -0
  142. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +23 -37
  143. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  144. package/lib/module/ui/screens/RecoverAccountScreen.js +263 -0
  145. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -0
  146. package/lib/module/ui/screens/SessionManagementScreen.js +47 -69
  147. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  148. package/lib/module/ui/screens/SignInScreen.js +100 -334
  149. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  150. package/lib/module/ui/screens/SignUpScreen.js +137 -341
  151. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  152. package/lib/module/ui/screens/internal/SignInPasswordStep.js +186 -0
  153. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -0
  154. package/lib/module/ui/screens/internal/SignInUsernameStep.js +129 -0
  155. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -0
  156. package/lib/module/ui/screens/internal/SignUpIdentityStep.js +102 -0
  157. package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
  158. package/lib/module/ui/screens/internal/SignUpSecurityStep.js +120 -0
  159. package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
  160. package/lib/module/ui/screens/internal/SignUpSummaryStep.js +79 -0
  161. package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
  162. package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +54 -0
  163. package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
  164. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +16 -3
  165. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  166. package/lib/module/ui/stores/authStore.js +27 -0
  167. package/lib/module/ui/stores/authStore.js.map +1 -0
  168. package/lib/module/ui/stores/followStore.js +120 -0
  169. package/lib/module/ui/stores/followStore.js.map +1 -0
  170. package/lib/module/ui/styles/index.js +0 -1
  171. package/lib/module/ui/styles/index.js.map +1 -1
  172. package/lib/module/ui/utils/confirmAction.js +25 -0
  173. package/lib/module/ui/utils/confirmAction.js.map +1 -0
  174. package/lib/typescript/core/index.d.ts +28 -10
  175. package/lib/typescript/core/index.d.ts.map +1 -1
  176. package/lib/typescript/index.d.ts +5 -4
  177. package/lib/typescript/index.d.ts.map +1 -1
  178. package/lib/typescript/models/secureSession.d.ts +0 -1
  179. package/lib/typescript/models/secureSession.d.ts.map +1 -1
  180. package/lib/typescript/node/index.d.ts +0 -1
  181. package/lib/typescript/node/index.d.ts.map +1 -1
  182. package/lib/typescript/ui/components/FollowButton.d.ts +1 -77
  183. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  184. package/lib/typescript/ui/components/OxyPayButton.d.ts +29 -0
  185. package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -0
  186. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  187. package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
  188. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
  189. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -0
  190. package/lib/typescript/ui/components/icon/index.d.ts +1 -0
  191. package/lib/typescript/ui/components/icon/index.d.ts.map +1 -1
  192. package/lib/typescript/ui/components/index.d.ts +1 -0
  193. package/lib/typescript/ui/components/index.d.ts.map +1 -1
  194. package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  195. package/lib/typescript/ui/components/internal/PinInput.d.ts +12 -0
  196. package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -0
  197. package/lib/typescript/ui/components/internal/TextField.d.ts +1 -0
  198. package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
  199. package/lib/typescript/ui/context/OxyContext.d.ts +0 -1
  200. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  201. package/lib/typescript/ui/hooks/index.d.ts +1 -2
  202. package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
  203. package/lib/typescript/ui/hooks/useFollow.d.ts +14 -15
  204. package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
  205. package/lib/typescript/ui/hooks/useSessionSocket.d.ts +11 -0
  206. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -0
  207. package/lib/typescript/ui/index.d.ts +2 -5
  208. package/lib/typescript/ui/index.d.ts.map +1 -1
  209. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  210. package/lib/typescript/ui/navigation/types.d.ts +5 -23
  211. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  212. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  213. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  214. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  215. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  216. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  217. package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
  218. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  219. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +27 -0
  220. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -0
  221. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  222. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +8 -0
  223. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -0
  224. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  225. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  226. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
  227. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +27 -0
  228. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -0
  229. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +26 -0
  230. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -0
  231. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +20 -0
  232. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -0
  233. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +24 -0
  234. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -0
  235. package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +15 -0
  236. package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -0
  237. package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +13 -0
  238. package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -0
  239. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
  240. package/lib/typescript/ui/stores/authStore.d.ts +14 -0
  241. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -0
  242. package/lib/typescript/ui/stores/followStore.d.ts +15 -0
  243. package/lib/typescript/ui/stores/followStore.d.ts.map +1 -0
  244. package/lib/typescript/ui/styles/index.d.ts +0 -1
  245. package/lib/typescript/ui/styles/index.d.ts.map +1 -1
  246. package/lib/typescript/ui/utils/confirmAction.d.ts +7 -0
  247. package/lib/typescript/ui/utils/confirmAction.d.ts.map +1 -0
  248. package/package.json +12 -7
  249. package/src/core/index.ts +78 -88
  250. package/src/index.ts +8 -45
  251. package/src/models/secureSession.ts +1 -2
  252. package/src/node/index.ts +0 -3
  253. package/src/ui/components/FollowButton.tsx +100 -322
  254. package/src/ui/components/OxyPayButton.tsx +133 -0
  255. package/src/ui/components/OxyProvider.tsx +39 -201
  256. package/src/ui/components/OxySignInButton.tsx +13 -2
  257. package/src/ui/components/icon/FAIRWalletIcon.tsx +49 -0
  258. package/src/ui/components/icon/index.ts +1 -0
  259. package/src/ui/components/index.ts +1 -0
  260. package/src/ui/components/internal/GroupedPillButtons.tsx +12 -8
  261. package/src/ui/components/internal/PinInput.tsx +102 -0
  262. package/src/ui/components/internal/TextField.tsx +9 -0
  263. package/src/ui/context/OxyContext.tsx +26 -26
  264. package/src/ui/hooks/index.ts +1 -2
  265. package/src/ui/hooks/useFollow.ts +58 -129
  266. package/src/ui/hooks/useSessionSocket.ts +50 -0
  267. package/src/ui/index.ts +2 -37
  268. package/src/ui/navigation/OxyRouter.tsx +47 -63
  269. package/src/ui/navigation/types.ts +5 -26
  270. package/src/ui/screens/AccountCenterScreen.tsx +12 -21
  271. package/src/ui/screens/AccountOverviewScreen.tsx +6 -30
  272. package/src/ui/screens/AccountSettingsScreen.tsx +7 -22
  273. package/src/ui/screens/AccountSwitcherScreen.tsx +46 -88
  274. package/src/ui/screens/AppInfoScreen.tsx +27 -47
  275. package/src/ui/screens/FeedbackScreen.tsx +34 -19
  276. package/src/ui/screens/FileManagementScreen.tsx +293 -321
  277. package/src/ui/screens/PaymentGatewayScreen.tsx +1315 -0
  278. package/src/ui/screens/PremiumSubscriptionScreen.tsx +109 -124
  279. package/src/ui/screens/RecoverAccountScreen.tsx +260 -0
  280. package/src/ui/screens/SessionManagementScreen.tsx +65 -137
  281. package/src/ui/screens/SignInScreen.tsx +89 -283
  282. package/src/ui/screens/SignUpScreen.tsx +138 -291
  283. package/src/ui/screens/internal/SignInPasswordStep.tsx +179 -0
  284. package/src/ui/screens/internal/SignInUsernameStep.tsx +139 -0
  285. package/src/ui/screens/internal/SignUpIdentityStep.tsx +114 -0
  286. package/src/ui/screens/internal/SignUpSecurityStep.tsx +132 -0
  287. package/src/ui/screens/internal/SignUpSummaryStep.tsx +66 -0
  288. package/src/ui/screens/internal/SignUpWelcomeStep.tsx +52 -0
  289. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +13 -3
  290. package/src/ui/stores/authStore.ts +24 -0
  291. package/src/ui/stores/followStore.ts +80 -0
  292. package/src/ui/styles/index.ts +0 -1
  293. package/src/ui/utils/confirmAction.ts +23 -0
  294. package/lib/commonjs/ui/components/bottomSheet/index.js +0 -37
  295. package/lib/commonjs/ui/components/bottomSheet/index.js.map +0 -1
  296. package/lib/commonjs/ui/hooks/useAuthFetch.js +0 -216
  297. package/lib/commonjs/ui/hooks/useAuthFetch.js.map +0 -1
  298. package/lib/commonjs/ui/hooks/useOxyFollow.js +0 -190
  299. package/lib/commonjs/ui/hooks/useOxyFollow.js.map +0 -1
  300. package/lib/commonjs/ui/screens/BillingManagementScreen.js +0 -636
  301. package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +0 -1
  302. package/lib/commonjs/ui/store/index.js +0 -67
  303. package/lib/commonjs/ui/store/index.js.map +0 -1
  304. package/lib/commonjs/ui/store/setupOxyStore.js +0 -63
  305. package/lib/commonjs/ui/store/setupOxyStore.js.map +0 -1
  306. package/lib/commonjs/ui/store/slices/authSlice.js +0 -56
  307. package/lib/commonjs/ui/store/slices/authSlice.js.map +0 -1
  308. package/lib/commonjs/ui/store/slices/followSlice.js +0 -238
  309. package/lib/commonjs/ui/store/slices/followSlice.js.map +0 -1
  310. package/lib/commonjs/ui/store/slices/index.js +0 -129
  311. package/lib/commonjs/ui/store/slices/index.js.map +0 -1
  312. package/lib/commonjs/ui/store/slices/types.js +0 -19
  313. package/lib/commonjs/ui/store/slices/types.js.map +0 -1
  314. package/lib/commonjs/ui/styles/shadows.js +0 -123
  315. package/lib/commonjs/ui/styles/shadows.js.map +0 -1
  316. package/lib/commonjs/utils/polyfills.js +0 -42
  317. package/lib/commonjs/utils/polyfills.js.map +0 -1
  318. package/lib/module/ui/components/bottomSheet/index.js +0 -5
  319. package/lib/module/ui/components/bottomSheet/index.js.map +0 -1
  320. package/lib/module/ui/hooks/useAuthFetch.js +0 -211
  321. package/lib/module/ui/hooks/useAuthFetch.js.map +0 -1
  322. package/lib/module/ui/hooks/useOxyFollow.js +0 -186
  323. package/lib/module/ui/hooks/useOxyFollow.js.map +0 -1
  324. package/lib/module/ui/screens/BillingManagementScreen.js +0 -631
  325. package/lib/module/ui/screens/BillingManagementScreen.js.map +0 -1
  326. package/lib/module/ui/store/index.js +0 -33
  327. package/lib/module/ui/store/index.js.map +0 -1
  328. package/lib/module/ui/store/setupOxyStore.js +0 -59
  329. package/lib/module/ui/store/setupOxyStore.js.map +0 -1
  330. package/lib/module/ui/store/slices/authSlice.js +0 -48
  331. package/lib/module/ui/store/slices/authSlice.js.map +0 -1
  332. package/lib/module/ui/store/slices/followSlice.js +0 -232
  333. package/lib/module/ui/store/slices/followSlice.js.map +0 -1
  334. package/lib/module/ui/store/slices/index.js +0 -11
  335. package/lib/module/ui/store/slices/index.js.map +0 -1
  336. package/lib/module/ui/store/slices/types.js +0 -15
  337. package/lib/module/ui/store/slices/types.js.map +0 -1
  338. package/lib/module/ui/styles/shadows.js +0 -119
  339. package/lib/module/ui/styles/shadows.js.map +0 -1
  340. package/lib/module/utils/polyfills.js +0 -36
  341. package/lib/module/utils/polyfills.js.map +0 -1
  342. package/lib/typescript/types/react-redux.d.ts +0 -5
  343. package/lib/typescript/ui/components/bottomSheet/index.d.ts +0 -4
  344. package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +0 -1
  345. package/lib/typescript/ui/hooks/useAuthFetch.d.ts +0 -34
  346. package/lib/typescript/ui/hooks/useAuthFetch.d.ts.map +0 -1
  347. package/lib/typescript/ui/hooks/useOxyFollow.d.ts +0 -81
  348. package/lib/typescript/ui/hooks/useOxyFollow.d.ts.map +0 -1
  349. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +0 -5
  350. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +0 -1
  351. package/lib/typescript/ui/store/index.d.ts +0 -27
  352. package/lib/typescript/ui/store/index.d.ts.map +0 -1
  353. package/lib/typescript/ui/store/setupOxyStore.d.ts +0 -29
  354. package/lib/typescript/ui/store/setupOxyStore.d.ts.map +0 -1
  355. package/lib/typescript/ui/store/slices/authSlice.d.ts +0 -32
  356. package/lib/typescript/ui/store/slices/authSlice.d.ts.map +0 -1
  357. package/lib/typescript/ui/store/slices/followSlice.d.ts +0 -120
  358. package/lib/typescript/ui/store/slices/followSlice.d.ts.map +0 -1
  359. package/lib/typescript/ui/store/slices/index.d.ts +0 -9
  360. package/lib/typescript/ui/store/slices/index.d.ts.map +0 -1
  361. package/lib/typescript/ui/store/slices/types.d.ts +0 -16
  362. package/lib/typescript/ui/store/slices/types.d.ts.map +0 -1
  363. package/lib/typescript/ui/styles/shadows.d.ts +0 -233
  364. package/lib/typescript/ui/styles/shadows.d.ts.map +0 -1
  365. package/lib/typescript/utils/polyfills.d.ts +0 -6
  366. package/lib/typescript/utils/polyfills.d.ts.map +0 -1
  367. package/src/__tests__/backend-middleware.test.ts +0 -209
  368. package/src/__tests__/polyfills.test.ts +0 -30
  369. package/src/__tests__/setup.ts +0 -43
  370. package/src/__tests__/ui/hooks/useAuthFetch.test.ts +0 -70
  371. package/src/__tests__/ui/hooks/useOxyFollow.test.tsx +0 -92
  372. package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +0 -112
  373. package/src/__tests__/ui/store/setupOxyStore.test.ts +0 -50
  374. package/src/__tests__/validate-structure.js +0 -91
  375. package/src/__tests__/validation.js +0 -42
  376. package/src/types/react-redux.d.ts +0 -5
  377. package/src/ui/components/bottomSheet/index.tsx +0 -14
  378. package/src/ui/hooks/useAuthFetch.ts +0 -238
  379. package/src/ui/hooks/useOxyFollow.ts +0 -188
  380. package/src/ui/screens/BillingManagementScreen.tsx +0 -589
  381. package/src/ui/store/index.ts +0 -36
  382. package/src/ui/store/setupOxyStore.ts +0 -58
  383. package/src/ui/store/slices/authSlice.ts +0 -43
  384. package/src/ui/store/slices/followSlice.ts +0 -207
  385. package/src/ui/store/slices/index.ts +0 -31
  386. package/src/ui/store/slices/types.ts +0 -33
  387. package/src/ui/styles/shadows.ts +0 -112
  388. package/src/utils/polyfills.ts +0 -34
@@ -1,162 +1,78 @@
1
1
  "use strict";
2
2
 
3
- import { useDispatch, useSelector } from 'react-redux';
4
3
  import { useCallback, useMemo } from 'react';
5
- import { toggleFollowUser, setFollowingStatus, clearFollowError, fetchFollowStatus } from '../store';
4
+ import { useFollowStore } from '../stores/followStore';
6
5
  import { useOxy } from '../context/OxyContext';
7
-
8
- // Memoized selector to prevent unnecessary re-renders
9
- const createFollowSelector = userId => state => ({
10
- isFollowing: state.follow.followingUsers[userId] ?? false,
11
- isLoading: state.follow.loadingUsers[userId] ?? false,
12
- error: state.follow.errors[userId] ?? null
13
- });
14
-
15
- // Memoized selector for multiple users
16
- const createMultipleFollowSelector = userIds => state => {
17
- const followData = {};
18
- const followState = state.follow;
19
- for (const userId of userIds) {
20
- followData[userId] = {
21
- isFollowing: followState.followingUsers[userId] ?? false,
22
- isLoading: followState.loadingUsers[userId] ?? false,
23
- error: followState.errors[userId] ?? null
24
- };
25
- }
26
- return {
27
- followData,
28
- isAnyLoading: userIds.some(uid => followState.loadingUsers[uid]),
29
- hasAnyError: userIds.some(uid => followState.errors[uid]),
30
- allFollowing: userIds.every(uid => followState.followingUsers[uid]),
31
- allNotFollowing: userIds.every(uid => !followState.followingUsers[uid])
32
- };
33
- };
34
-
35
- /**
36
- * Custom hook for managing follow/unfollow functionality
37
- * Optimized to prevent unnecessary re-renders
38
- * Can handle both single user and multiple users
39
- */
40
6
  export const useFollow = userId => {
41
- const dispatch = useDispatch();
42
7
  const {
43
8
  oxyServices
44
9
  } = useOxy();
45
-
46
- // Memoize user IDs to prevent recreation on every render
47
- const userIds = useMemo(() => {
48
- return Array.isArray(userId) ? userId : userId ? [userId] : [];
49
- }, [userId]);
10
+ const userIds = useMemo(() => Array.isArray(userId) ? userId : userId ? [userId] : [], [userId]);
50
11
  const isSingleUser = typeof userId === 'string';
51
12
 
52
- // Memoize selectors to prevent recreation
53
- const singleUserSelector = useMemo(() => {
54
- return isSingleUser && userId ? createFollowSelector(userId) : null;
55
- }, [isSingleUser, userId]);
56
- const multipleUserSelector = useMemo(() => {
57
- return !isSingleUser ? createMultipleFollowSelector(userIds) : null;
58
- }, [isSingleUser, userIds]);
59
-
60
- // Use appropriate selector based on mode
61
- const singleUserData = useSelector(singleUserSelector || (() => ({
62
- isFollowing: false,
63
- isLoading: false,
64
- error: null
65
- })));
66
- const multipleUserData = useSelector(multipleUserSelector || (() => ({
67
- followData: {},
68
- isAnyLoading: false,
69
- hasAnyError: false,
70
- allFollowing: false,
71
- allNotFollowing: true
72
- })));
13
+ // Zustand selectors
14
+ const followState = useFollowStore();
73
15
 
74
- // Memoized callbacks to prevent recreation on every render
16
+ // Single user helpers
17
+ const isFollowing = isSingleUser && userId ? followState.followingUsers[userId] ?? false : false;
18
+ const isLoading = isSingleUser && userId ? followState.loadingUsers[userId] ?? false : false;
19
+ const error = isSingleUser && userId ? followState.errors[userId] ?? null : null;
75
20
  const toggleFollow = useCallback(async () => {
76
21
  if (!isSingleUser || !userId) throw new Error('toggleFollow is only available for single user mode');
77
- try {
78
- const result = await dispatch(toggleFollowUser({
79
- userId,
80
- oxyServices,
81
- isCurrentlyFollowing: singleUserData.isFollowing
82
- })).unwrap();
83
- return result;
84
- } catch (error) {
85
- throw error;
86
- }
87
- }, [dispatch, userId, oxyServices, singleUserData.isFollowing, isSingleUser]);
22
+ await followState.toggleFollowUser(userId, oxyServices, isFollowing);
23
+ }, [isSingleUser, userId, followState, oxyServices, isFollowing]);
88
24
  const setFollowStatus = useCallback(following => {
89
25
  if (!isSingleUser || !userId) throw new Error('setFollowStatus is only available for single user mode');
90
- dispatch(setFollowingStatus({
91
- userId,
92
- isFollowing: following
93
- }));
94
- }, [dispatch, userId, isSingleUser]);
26
+ followState.setFollowingStatus(userId, following);
27
+ }, [isSingleUser, userId, followState]);
95
28
  const fetchStatus = useCallback(async () => {
96
29
  if (!isSingleUser || !userId) throw new Error('fetchStatus is only available for single user mode');
97
- try {
98
- await dispatch(fetchFollowStatus({
99
- userId,
100
- oxyServices
101
- })).unwrap();
102
- } catch (error) {
103
- console.warn(`Failed to fetch follow status for user ${userId}:`, error);
104
- }
105
- }, [dispatch, userId, oxyServices, isSingleUser]);
30
+ await followState.fetchFollowStatus(userId, oxyServices);
31
+ }, [isSingleUser, userId, followState, oxyServices]);
106
32
  const clearError = useCallback(() => {
107
33
  if (!isSingleUser || !userId) throw new Error('clearError is only available for single user mode');
108
- dispatch(clearFollowError(userId));
109
- }, [dispatch, userId, isSingleUser]);
34
+ followState.clearFollowError(userId);
35
+ }, [isSingleUser, userId, followState]);
110
36
 
111
- // Multiple user callbacks
37
+ // Multiple user helpers
38
+ const followData = useMemo(() => {
39
+ const data = {};
40
+ userIds.forEach(uid => {
41
+ data[uid] = {
42
+ isFollowing: followState.followingUsers[uid] ?? false,
43
+ isLoading: followState.loadingUsers[uid] ?? false,
44
+ error: followState.errors[uid] ?? null
45
+ };
46
+ });
47
+ return data;
48
+ }, [userIds, followState.followingUsers, followState.loadingUsers, followState.errors]);
112
49
  const toggleFollowForUser = useCallback(async targetUserId => {
113
- const currentState = multipleUserData.followData[targetUserId]?.isFollowing ?? false;
114
- try {
115
- const result = await dispatch(toggleFollowUser({
116
- userId: targetUserId,
117
- oxyServices,
118
- isCurrentlyFollowing: currentState
119
- })).unwrap();
120
- return result;
121
- } catch (error) {
122
- throw error;
123
- }
124
- }, [dispatch, oxyServices, multipleUserData.followData]);
50
+ const currentState = followState.followingUsers[targetUserId] ?? false;
51
+ await followState.toggleFollowUser(targetUserId, oxyServices, currentState);
52
+ }, [followState, oxyServices]);
125
53
  const setFollowStatusForUser = useCallback((targetUserId, following) => {
126
- dispatch(setFollowingStatus({
127
- userId: targetUserId,
128
- isFollowing: following
129
- }));
130
- }, [dispatch]);
54
+ followState.setFollowingStatus(targetUserId, following);
55
+ }, [followState]);
131
56
  const fetchStatusForUser = useCallback(async targetUserId => {
132
- try {
133
- await dispatch(fetchFollowStatus({
134
- userId: targetUserId,
135
- oxyServices
136
- })).unwrap();
137
- } catch (error) {
138
- console.warn(`Failed to fetch follow status for user ${targetUserId}:`, error);
139
- }
140
- }, [dispatch, oxyServices]);
57
+ await followState.fetchFollowStatus(targetUserId, oxyServices);
58
+ }, [followState, oxyServices]);
141
59
  const fetchAllStatuses = useCallback(async () => {
142
- const promises = userIds.map(uid => dispatch(fetchFollowStatus({
143
- userId: uid,
144
- oxyServices
145
- })).unwrap().catch(error => {
146
- console.warn(`Failed to fetch follow status for user ${uid}:`, error);
147
- }));
148
- await Promise.all(promises);
149
- }, [dispatch, userIds, oxyServices]);
60
+ await Promise.all(userIds.map(uid => followState.fetchFollowStatus(uid, oxyServices)));
61
+ }, [userIds, followState, oxyServices]);
150
62
  const clearErrorForUser = useCallback(targetUserId => {
151
- dispatch(clearFollowError(targetUserId));
152
- }, [dispatch]);
63
+ followState.clearFollowError(targetUserId);
64
+ }, [followState]);
153
65
 
154
- // Return appropriate interface based on mode
66
+ // Aggregate helpers for multiple users
67
+ const isAnyLoading = userIds.some(uid => followState.loadingUsers[uid]);
68
+ const hasAnyError = userIds.some(uid => !!followState.errors[uid]);
69
+ const allFollowing = userIds.every(uid => followState.followingUsers[uid]);
70
+ const allNotFollowing = userIds.every(uid => !followState.followingUsers[uid]);
155
71
  if (isSingleUser && userId) {
156
72
  return {
157
- isFollowing: singleUserData.isFollowing,
158
- isLoading: singleUserData.isLoading,
159
- error: singleUserData.error,
73
+ isFollowing,
74
+ isLoading,
75
+ error,
160
76
  toggleFollow,
161
77
  setFollowStatus,
162
78
  fetchStatus,
@@ -164,17 +80,16 @@ export const useFollow = userId => {
164
80
  };
165
81
  }
166
82
  return {
167
- followData: multipleUserData.followData,
83
+ followData,
168
84
  toggleFollowForUser,
169
85
  setFollowStatusForUser,
170
86
  fetchStatusForUser,
171
87
  fetchAllStatuses,
172
88
  clearErrorForUser,
173
- // Helper methods
174
- isAnyLoading: multipleUserData.isAnyLoading,
175
- hasAnyError: multipleUserData.hasAnyError,
176
- allFollowing: multipleUserData.allFollowing,
177
- allNotFollowing: multipleUserData.allNotFollowing
89
+ isAnyLoading,
90
+ hasAnyError,
91
+ allFollowing,
92
+ allNotFollowing
178
93
  };
179
94
  };
180
95
  //# sourceMappingURL=useFollow.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useSelector","useCallback","useMemo","toggleFollowUser","setFollowingStatus","clearFollowError","fetchFollowStatus","useOxy","createFollowSelector","userId","state","isFollowing","follow","followingUsers","isLoading","loadingUsers","error","errors","createMultipleFollowSelector","userIds","followData","followState","isAnyLoading","some","uid","hasAnyError","allFollowing","every","allNotFollowing","useFollow","dispatch","oxyServices","Array","isArray","isSingleUser","singleUserSelector","multipleUserSelector","singleUserData","multipleUserData","toggleFollow","Error","result","isCurrentlyFollowing","unwrap","setFollowStatus","following","fetchStatus","console","warn","clearError","toggleFollowForUser","targetUserId","currentState","setFollowStatusForUser","fetchStatusForUser","fetchAllStatuses","promises","map","catch","Promise","all","clearErrorForUser"],"sourceRoot":"../../../../src","sources":["ui/hooks/useFollow.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC5C,SAASC,gBAAgB,EAAEC,kBAAkB,EAAEC,gBAAgB,EAAEC,iBAAiB,QAAQ,UAAU;AAEpG,SAASC,MAAM,QAAQ,uBAAuB;;AAE9C;AACA,MAAMC,oBAAoB,GAAIC,MAAc,IAAMC,KAAgB,KAAM;EACtEC,WAAW,EAAED,KAAK,CAACE,MAAM,CAACC,cAAc,CAACJ,MAAM,CAAC,IAAI,KAAK;EACzDK,SAAS,EAAEJ,KAAK,CAACE,MAAM,CAACG,YAAY,CAACN,MAAM,CAAC,IAAI,KAAK;EACrDO,KAAK,EAAEN,KAAK,CAACE,MAAM,CAACK,MAAM,CAACR,MAAM,CAAC,IAAI;AACxC,CAAC,CAAC;;AAEF;AACA,MAAMS,4BAA4B,GAAIC,OAAiB,IAAMT,KAAgB,IAAK;EAChF,MAAMU,UAA8F,GAAG,CAAC,CAAC;EACzG,MAAMC,WAAW,GAAGX,KAAK,CAACE,MAAM;EAEhC,KAAK,MAAMH,MAAM,IAAIU,OAAO,EAAE;IAC5BC,UAAU,CAACX,MAAM,CAAC,GAAG;MACnBE,WAAW,EAAEU,WAAW,CAACR,cAAc,CAACJ,MAAM,CAAC,IAAI,KAAK;MACxDK,SAAS,EAAEO,WAAW,CAACN,YAAY,CAACN,MAAM,CAAC,IAAI,KAAK;MACpDO,KAAK,EAAEK,WAAW,CAACJ,MAAM,CAACR,MAAM,CAAC,IAAI;IACvC,CAAC;EACH;EAEA,OAAO;IACLW,UAAU;IACVE,YAAY,EAAEH,OAAO,CAACI,IAAI,CAACC,GAAG,IAAIH,WAAW,CAACN,YAAY,CAACS,GAAG,CAAC,CAAC;IAChEC,WAAW,EAAEN,OAAO,CA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B,cAAc,CAAC1B,WAAW;MACvCG,SAAS,EAAEuB,cAAc,CAACvB,SAAS;MACnCE,KAAK,EAAEqB,cAAc,CAACrB,KAAK;MAC3BuB,YAAY;MACZK,eAAe;MACfE,WAAW;MACXG;IACF,CAAC;EACH;EAEA,OAAO;IACL7B,UAAU,EAAEkB,gBAAgB,CAAClB,UAAU;IACvC8B,mBAAmB;IACnBG,sBAAsB;IACtBC,kBAAkB;IAClBC,gBAAgB;IAChBM,iBAAiB;IACjB;IACAvC,YAAY,EAAEgB,gBAAgB,CAAChB,YAAY;IAC3CG,WAAW,EAAEa,gBAAgB,CAACb,WAAW;IACzCC,YAAY,EAAEY,gBAAgB,CAACZ,YAAY;IAC3CE,eAAe,EAAEU,gBAAgB,CAACV;EACpC,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useMemo","useFollowStore","useOxy","useFollow","userId","oxyServices","userIds","Array","isArray","isSingleUser","followState","isFollowing","followingUsers","isLoading","loadingUsers","error","errors","toggleFollow","Error","toggleFollowUser","setFollowStatus","following","setFollowingStatus","fetchStatus","fetchFollowStatus","clearError","clearFollowError","followData","data","forEach","uid","toggleFollowForUser","targetUserId","currentState","setFollowStatusForUser","fetchStatusForUser","fetchAllStatuses","Promise","all","map","clearErrorForUser","isAnyLoading","some","hasAnyError","allFollowing","every","allNotFollowing"],"sourceRoot":"../../../../src","sources":["ui/hooks/useFollow.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC5C,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,MAAM,QAAQ,uBAAuB;AAE9C,OAAO,MAAMC,SAAS,GAAIC,MAA0B,IAAK;EACvD,MAAM;IAAEC;EAAY,CAAC,GAAGH,MAAM,CAAC,CAAC;EAChC,MAAMI,OAAO,GAAGN,OAAO,CAAC,MAAOO,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,GAAGA,MAAM,GAAGA,MAAM,GAAG,CAACA,M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ACkB,GAAG,CAAC,CAAC;EAE9E,IAAIrB,YAAY,IAAIL,MAAM,EAAE;IAC1B,OAAO;MACLO,WAAW;MACXE,SAAS;MACTE,KAAK;MACLE,YAAY;MACZG,eAAe;MACfG,WAAW;MACXE;IACF,CAAC;EACH;EAEA,OAAO;IACLE,UAAU;IACVI,mBAAmB;IACnBG,sBAAsB;IACtBC,kBAAkB;IAClBC,gBAAgB;IAChBI,iBAAiB;IACjBC,YAAY;IACZE,WAAW;IACXC,YAAY;IACZE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useRef } from 'react';
4
+ import io from 'socket.io-client';
5
+ import { toast } from '../../lib/sonner';
6
+ export function useSessionSocket({
7
+ userId,
8
+ activeSessionId,
9
+ refreshSessions,
10
+ logout,
11
+ baseURL,
12
+ onRemoteSignOut
13
+ }) {
14
+ const socketRef = useRef(null);
15
+ useEffect(() => {
16
+ if (!userId || !baseURL) return;
17
+ if (!socketRef.current) {
18
+ socketRef.current = io(baseURL, {
19
+ transports: ['websocket']
20
+ });
21
+ }
22
+ const socket = socketRef.current;
23
+ socket.on('connect', () => {
24
+ console.log('Socket connected:', socket.id);
25
+ });
26
+ socket.emit('join', {
27
+ userId: `user:${userId}`
28
+ });
29
+ console.log('Emitting join for room:', `user:${userId}`);
30
+ socket.on('session_update', data => {
31
+ console.log('Received session_update:', data);
32
+ if (data.sessionId === activeSessionId) {
33
+ if (onRemoteSignOut) onRemoteSignOut();else toast.info('You have been signed out remotely.');
34
+ logout();
35
+ } else {
36
+ refreshSessions();
37
+ }
38
+ });
39
+ return () => {
40
+ socket.emit('leave', {
41
+ userId: `user:${userId}`
42
+ });
43
+ socket.off('session_update');
44
+ };
45
+ }, [userId, baseURL, activeSessionId, refreshSessions, logout, onRemoteSignOut]);
46
+ }
47
+ //# sourceMappingURL=useSessionSocket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useRef","io","toast","useSessionSocket","userId","activeSessionId","refreshSessions","logout","baseURL","onRemoteSignOut","socketRef","current","transports","socket","on","console","log","id","emit","data","sessionId","info","off"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSessionSocket.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,OAAOC,EAAE,MAAM,kBAAkB;AACjC,SAASC,KAAK,QAAQ,kBAAkB;AAWxC,OAAO,SAASC,gBAAgBA,CAAC;EAAEC,MAAM;EAAEC,eAAe;EAAEC,eAAe;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAuC,CAAC,EAAE;EACtI,MAAMC,SAAS,GAAGV,MAAM,CAAM,IAAI,CAAC;EAEnCD,SAAS,CAAC,MAAM;IACd,IAAI,CAACK,MAAM,IAAI,CAACI,OAAO,EAAE;IAEzB,IAAI,CAACE,SAAS,CAACC,OAAO,EAAE;MACtBD,SAAS,CAACC,OAAO,GAAGV,EAAE,CAACO,OAAO,EAAE;QAC9BI,UAAU,EAAE,CAAC,WAAW;MAC1B,CAAC,CAAC;IACJ;IACA,MAAMC,MAAM,GAAGH,SAAS,CAACC,OAAO;IAEhCE,MAAM,CAACC,EAAE,CAAC,SAAS,EAAE,MAAM;MACzBC,OAAO,CAACC,GAAG,CAAC,mBAAmB,EAAEH,MAAM,CAACI,EAAE,CAAC;IAC7C,CAAC,CAAC;IAEFJ,MAAM,CAACK,IAAI,CAAC,MAAM,EAAE;MAAEd,MAAM,EAAE,QAAQA,MAAM;IAAG,CAAC,CAAC;IACjDW,OAAO,CAACC,GAAG,CAAC,yBAAyB,EAAE,QAAQZ,MAAM,EAAE,CAAC;IAExDS,MAAM,CAACC,EAAE,CAAC,gBAAgB,EAAGK,IAAyC,IAAK;MACzEJ,OAAO,CAACC,GAAG,CAAC,0BAA0B,EAAEG,IAAI,CAAC;MAC7C,IAAIA,IAAI,CAACC,SAAS,KAAKf,eAAe,EAAE;QACtC,IAAII,eAAe,EAAEA,eAAe,CAAC,CAAC,CAAC,KAClCP,KAAK,CAACmB,IAAI,CAAC,oCAAoC,CAAC;QACrDd,MAAM,CAAC,CAAC;MACV,CAAC,MAAM;QACLD,eAAe,CAAC,CAAC;MACnB;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXO,MAAM,CAACK,IAAI,CAAC,OAAO,EAAE;QAAEd,MAAM,EAAE,QAAQA,MAAM;MAAG,CAAC,CAAC;MAClDS,MAAM,CAACS,GAAG,CAAC,gBAAgB,CAAC;IAC9B,CAAC;EACH,CAAC,EAAE,CAAClB,MAAM,EAAEI,OAAO,EAAEH,eAAe,EAAEC,eAAe,EAAEC,MAAM,EAAEE,eAAe,CAAC,CAAC;AAClF","ignoreList":[]}
@@ -10,23 +10,13 @@ export { default as OxySignInButton } from './components/OxySignInButton';
10
10
  export { default as OxyLogo } from './components/OxyLogo';
11
11
  export { default as Avatar } from './components/Avatar';
12
12
  export { default as FollowButton } from './components/FollowButton';
13
+ export { default as OxyPayButton } from './components/OxyPayButton';
13
14
  export { FontLoader, setupFonts } from './components/FontLoader';
14
15
 
15
16
  // Export icon components
16
17
  export { OxyIcon } from './components/icon';
17
18
  export { OxyContextProvider, useOxy, OxyContextState, OxyContextProviderProps } from './context/OxyContext';
18
19
 
19
- // Redux store exports - NEW ARCHITECTURE
20
- export { setupOxyStore, oxyReducers,
21
- // Individual slices
22
- authSlice, authActions, authSelectors, authReducer, followSlice, followActions, followSelectors, followThunks, followReducer,
23
- // Action creators
24
- loginStart, loginSuccess, loginFailure, logout, setFollowingStatus, clearFollowError, resetFollowState, fetchFollowStatus, toggleFollowUser,
25
- // Types
26
- AuthState, FollowState, initialAuthState, initialFollowState } from './store';
27
-
28
- // Legacy store exports (deprecated)
29
- export { store } from './store';
30
20
  // Export styles
31
21
  export { fontFamilies, fontStyles } from './styles/fonts';
32
22
 
@@ -34,8 +24,7 @@ export { fontFamilies, fontStyles } from './styles/fonts';
34
24
  export * from './navigation/types';
35
25
 
36
26
  // Hooks
37
- export { useOxyFollow, useFollow } from './hooks';
38
- export { default as useAuthFetch } from './hooks/useAuthFetch';
27
+ export { useFollow } from './hooks';
39
28
 
40
29
  // Screens
41
30
  export { default as ProfileScreen } from './screens/ProfileScreen';
@@ -1 +1 @@
1
- {"version":3,"names":["default","OxyProvider","OxySignInButton","OxyLogo","Avatar","FollowButton","FontLoader","setupFonts","OxyIcon","OxyContextProvider","useOxy","OxyContextState","OxyContextProviderProps","setupOxyStore","oxyReducers","authSlice","authActions","authSelectors","authReducer","followSlice","followActions","followSelectors","followThunks","followReducer","loginStart","loginSuccess","loginFailure","logout","setFollowingStatus","clearFollowError","resetFollowState","fetchFollowStatus","toggleFollowUser","AuthState","FollowState","initialAuthState","initialFollowState","store","fontFamilies","fontStyles","useOxyFollow","useFollow","useAuthFetch","ProfileScreen","OxyRouter"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,0BAA0B;AACjE,SAASD,OAAO,IAAIE,eAAe,QAAQ,8BAA8B;AACzE,SAASF,OAAO,IAAIG,OAAO,QAAQ,sBAAsB;AACzD,SAASH,OAAO,IAAII,MAAM,QAAQ,qBAAqB;AACvD,SAASJ,OAAO,IAAIK,YAAY,QAAQ,2BAA2B;AACnE,SAASC,UAAU,EAAEC,UAAU,QAAQ,yBAAyB;;AAEhE;AACA,SAASC,OAAO,QAAQ,mBAAmB;AAG3C,SACEC,kBAAkB,EAClBC,MAAM,EACNC,eAAe,EACfC,uBAAuB,QAClB,sBAAsB;;AAE7B;AACA,SACEC,aAAa,EACbC,WAAW;AACX;AACAC,SAAS,EACTC,WAAW,EACXC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,eAAe,EACfC,YAAY,EACZC,aAAa;AACb;AACAC,UAAU,EACVC,YAAY,EACZC,YAAY,EACZC,MAAM,EACNC,kBAAkB,EAClBC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,EACjBC,gBAAgB;AAChB;AACAC,SAAS,EACTC,WAAW,EACXC,gBAAgB,EAChBC,kBAAkB,QACb,SAAS;;AAEhB;AACA,SAASC,KAAK,QAAQ,SAAS;AAG/B;AACA,SAASC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;;AAEzD;AACA,cAAc,oBAAoB;;AAElC;AACA,SAASC,YAAY,EAAEC,SAAS,QAAQ,SAAS;AACjD,SAASzC,OAAO,IAAI0C,YAAY,QAAQ,sBAAsB;;AAE9D;AACA,SAAS1C,OAAO,IAAI2C,aAAa,QAAQ,yBAAyB;;AAElE;AACA,SAAS3C,OAAO,IAAI4C,SAAS,QAAQ,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["default","OxyProvider","OxySignInButton","OxyLogo","Avatar","FollowButton","OxyPayButton","FontLoader","setupFonts","OxyIcon","OxyContextProvider","useOxy","OxyContextState","OxyContextProviderProps","fontFamilies","fontStyles","useFollow","ProfileScreen","OxyRouter"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,0BAA0B;AACjE,SAASD,OAAO,IAAIE,eAAe,QAAQ,8BAA8B;AACzE,SAASF,OAAO,IAAIG,OAAO,QAAQ,sBAAsB;AACzD,SAASH,OAAO,IAAII,MAAM,QAAQ,qBAAqB;AACvD,SAASJ,OAAO,IAAIK,YAAY,QAAQ,2BAA2B;AACnE,SAASL,OAAO,IAAIM,YAAY,QAAQ,2BAA2B;AACnE,SAASC,UAAU,EAAEC,UAAU,QAAQ,yBAAyB;;AAEhE;AACA,SAASC,OAAO,QAAQ,mBAAmB;AAG3C,SACEC,kBAAkB,EAClBC,MAAM,EACNC,eAAe,EACfC,uBAAuB,QAClB,sBAAsB;;AAE7B;AACA,SAASC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;;AAEzD;AACA,cAAc,oBAAoB;;AAElC;AACA,SAASC,SAAS,QAAQ,SAAS;;AAEnC;AACA,SAAShB,OAAO,IAAIiB,aAAa,QAAQ,yBAAyB;;AAElE;AACA,SAASjB,OAAO,IAAIkB,SAAS,QAAQ,wBAAwB","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import React, { useState, useEffect } from 'react';
3
+ import React, { useState, useEffect, useCallback } from 'react';
4
4
  import { View, StyleSheet } from 'react-native';
5
5
  // Import screens
6
6
  import SignInScreen from '../screens/SignInScreen';
@@ -11,7 +11,6 @@ import SessionManagementScreen from '../screens/SessionManagementScreen';
11
11
  import AccountOverviewScreen from '../screens/AccountOverviewScreen';
12
12
  import AccountSettingsScreen from '../screens/AccountSettingsScreen';
13
13
  import PremiumSubscriptionScreen from '../screens/PremiumSubscriptionScreen';
14
- import BillingManagementScreen from '../screens/BillingManagementScreen';
15
14
  import AppInfoScreen from '../screens/AppInfoScreen';
16
15
  import FeedbackScreen from '../screens/FeedbackScreen';
17
16
  import KarmaCenterScreen from '../screens/karma/KarmaCenterScreen';
@@ -22,6 +21,8 @@ import KarmaRewardsScreen from '../screens/karma/KarmaRewardsScreen';
22
21
  import KarmaFAQScreen from '../screens/karma/KarmaFAQScreen';
23
22
  import ProfileScreen from '../screens/ProfileScreen';
24
23
  import FileManagementScreen from '../screens/FileManagementScreen';
24
+ import RecoverAccountScreen from '../screens/RecoverAccountScreen';
25
+ import PaymentGatewayScreen from '../screens/PaymentGatewayScreen';
25
26
 
26
27
  // Import types
27
28
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -35,6 +36,10 @@ const routes = {
35
36
  component: SignUpScreen,
36
37
  snapPoints: ['10%', '90%']
37
38
  },
39
+ RecoverAccount: {
40
+ component: RecoverAccountScreen,
41
+ snapPoints: ['10%', '80%']
42
+ },
38
43
  AccountCenter: {
39
44
  component: AccountCenterScreen,
40
45
  snapPoints: ['60%', '100%']
@@ -59,10 +64,6 @@ const routes = {
59
64
  component: PremiumSubscriptionScreen,
60
65
  snapPoints: ['70%', '100%']
61
66
  },
62
- BillingManagement: {
63
- component: BillingManagementScreen,
64
- snapPoints: ['70%', '100%']
65
- },
66
67
  AppInfo: {
67
68
  component: AppInfoScreen,
68
69
  snapPoints: ['60%', '90%']
@@ -102,6 +103,10 @@ const routes = {
102
103
  FileManagement: {
103
104
  component: FileManagementScreen,
104
105
  snapPoints: ['70%', '100%']
106
+ },
107
+ PaymentGateway: {
108
+ component: PaymentGatewayScreen,
109
+ snapPoints: ['60%', '90%']
105
110
  }
106
111
  };
107
112
  const OxyRouter = ({
@@ -116,25 +121,47 @@ const OxyRouter = ({
116
121
  }) => {
117
122
  const [currentScreen, setCurrentScreen] = useState(initialScreen);
118
123
  const [screenHistory, setScreenHistory] = useState([initialScreen]);
119
- const [screenProps, setScreenProps] = useState({});
124
+ // Store props per screen for correct restoration on back
125
+ const [screenPropsMap, setScreenPropsMap] = useState({
126
+ [initialScreen]: {}
127
+ });
120
128
 
121
129
  // Update snap points when the screen changes
122
130
  useEffect(() => {
123
- if (routes[currentScreen]) {
131
+ if (routes[currentScreen] && typeof adjustSnapPoints === 'function') {
124
132
  adjustSnapPoints(routes[currentScreen].snapPoints);
125
133
  }
126
134
  }, [currentScreen, adjustSnapPoints]);
127
135
 
128
- // Navigation methods
129
- const navigate = (screen, props = {}) => {
136
+ // Memoized navigation methods
137
+ const navigate = useCallback((screen, props = {}) => {
130
138
  if (routes[screen]) {
131
139
  setCurrentScreen(screen);
132
140
  setScreenHistory(prev => [...prev, screen]);
133
- setScreenProps(props);
141
+ setScreenPropsMap(prev => ({
142
+ ...prev,
143
+ [screen]: props
144
+ }));
134
145
  } else {
135
- console.error(`Screen "${screen}" not found`);
146
+ if (process.env.NODE_ENV !== 'production') {
147
+ console.error(`Screen "${screen}" not found`);
148
+ }
136
149
  }
137
- };
150
+ }, []);
151
+ const goBack = useCallback(() => {
152
+ setScreenHistory(prev => {
153
+ if (prev.length > 1) {
154
+ const newHistory = [...prev];
155
+ newHistory.pop();
156
+ const previousScreen = newHistory[newHistory.length - 1];
157
+ setCurrentScreen(previousScreen);
158
+ return newHistory;
159
+ } else {
160
+ if (onClose) onClose();
161
+ return prev;
162
+ }
163
+ });
164
+ }, [onClose]);
138
165
 
139
166
  // Expose the navigate function to the parent component
140
167
  useEffect(() => {
@@ -150,83 +177,52 @@ const OxyRouter = ({
150
177
 
151
178
  // Expose the navigate method to the parent component (OxyProvider)
152
179
  useEffect(() => {
153
- // Set up event listener for navigation events
154
180
  const handleNavigationEvent = event => {
155
181
  if (event && event.detail) {
156
- // Support both string and object detail
157
182
  if (typeof event.detail === 'string') {
158
- const screenName = event.detail;
159
- console.log(`Navigation event received for screen: ${screenName}`);
160
- navigate(screenName);
183
+ navigate(event.detail);
161
184
  } else if (typeof event.detail === 'object' && event.detail.screen) {
162
185
  const {
163
186
  screen,
164
187
  props
165
188
  } = event.detail;
166
- console.log(`Navigation event received for screen: ${screen} with props`, props);
167
189
  navigate(screen, props || {});
168
190
  }
169
191
  }
170
192
  };
171
-
172
- // For React Native - check for global navigation events
173
193
  let intervalId = null;
174
- if (typeof document !== 'undefined') {
175
- // Web - use custom event listener
194
+ if (typeof document !== 'undefined' && document.addEventListener) {
176
195
  document.addEventListener('oxy:navigate', handleNavigationEvent);
177
196
  } else {
178
- // React Native - poll for global navigation events
179
197
  intervalId = setInterval(() => {
180
198
  const globalNav = globalThis.oxyNavigateEvent;
181
- if (globalNav) {
182
- console.log(`RN Navigation event received:`, globalNav);
183
- if (globalNav.screen) {
184
- navigate(globalNav.screen, globalNav.props || {});
185
- }
186
- // Clear the event after processing
199
+ if (globalNav && globalNav.screen) {
200
+ navigate(globalNav.screen, globalNav.props || {});
187
201
  globalThis.oxyNavigateEvent = null;
188
202
  }
189
- }, 100); // Check every 100ms
203
+ }, 100);
190
204
  }
191
-
192
- // Cleanup
193
205
  return () => {
194
- if (typeof document !== 'undefined') {
206
+ if (typeof document !== 'undefined' && document.removeEventListener) {
195
207
  document.removeEventListener('oxy:navigate', handleNavigationEvent);
196
208
  }
197
209
  if (intervalId) {
198
210
  clearInterval(intervalId);
199
211
  }
200
212
  };
201
- }, []);
202
- const goBack = () => {
203
- if (screenHistory.length > 1) {
204
- const newHistory = [...screenHistory];
205
- newHistory.pop();
206
- const previousScreen = newHistory[newHistory.length - 1];
207
- setCurrentScreen(previousScreen);
208
- setScreenHistory(newHistory);
209
- } else {
210
- // If no history, close the UI
211
- if (onClose) {
212
- onClose();
213
- }
214
- }
215
- };
213
+ }, [navigate]);
216
214
 
217
215
  // Render the current screen component
218
216
  const renderScreen = () => {
219
217
  const CurrentScreen = routes[currentScreen]?.component;
220
- console.log('[OxyRouter] Rendering screen:', currentScreen);
221
- console.log('[OxyRouter] Available routes:', Object.keys(routes));
222
- console.log('[OxyRouter] Current screen component found:', !!CurrentScreen);
223
218
  if (!CurrentScreen) {
224
- console.error(`Screen "${currentScreen}" not found`);
219
+ if (process.env.NODE_ENV !== 'production') {
220
+ console.error(`Screen "${currentScreen}" not found`);
221
+ }
225
222
  return /*#__PURE__*/_jsx(View, {
226
223
  style: styles.errorContainer
227
224
  });
228
225
  }
229
- console.log('[OxyRouter] Rendering screen component for:', currentScreen);
230
226
  return /*#__PURE__*/_jsx(CurrentScreen, {
231
227
  oxyServices: oxyServices,
232
228
  navigate: navigate,
@@ -235,7 +231,7 @@ const OxyRouter = ({
235
231
  onAuthenticated: onAuthenticated,
236
232
  theme: theme,
237
233
  containerWidth: containerWidth,
238
- ...screenProps
234
+ ...(screenPropsMap[currentScreen] || {})
239
235
  });
240
236
  };
241
237
  return /*#__PURE__*/_jsx(View, {
@@ -245,17 +241,13 @@ const OxyRouter = ({
245
241
  };
246
242
  const styles = StyleSheet.create({
247
243
  container: {
248
- flex: 1,
249
- minHeight: 200,
250
- // Ensure minimum height
251
- backgroundColor: 'transparent' // Make sure it's visible
244
+ flex: 1
252
245
  },
253
246
  errorContainer: {
254
247
  flex: 1,
255
248
  justifyContent: 'center',
256
249
  alignItems: 'center',
257
- minHeight: 100,
258
- backgroundColor: 'red' // Make errors visible
250
+ minHeight: 100
259
251
  }
260
252
  });
261
253
  export default OxyRouter;