@oxyhq/services 5.21.6 → 5.22.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 (478) hide show
  1. package/README.md +201 -2
  2. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  3. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  4. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  5. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  6. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  7. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  8. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  9. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  10. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  11. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  12. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  13. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  14. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  15. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  16. package/lib/commonjs/core/HttpService.js +87 -2
  17. package/lib/commonjs/core/HttpService.js.map +1 -1
  18. package/lib/commonjs/core/mixins/OxyServices.assets.js +3 -1
  19. package/lib/commonjs/core/mixins/OxyServices.assets.js.map +1 -1
  20. package/lib/commonjs/crypto/keyManager.js +67 -22
  21. package/lib/commonjs/crypto/keyManager.js.map +1 -1
  22. package/lib/commonjs/i18n/locales/en-US.json +3 -3
  23. package/lib/commonjs/i18n/locales/es-ES.json +240 -19
  24. package/lib/commonjs/index.js +66 -0
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/ui/components/Avatar.js +1 -1
  27. package/lib/commonjs/ui/components/Avatar.js.map +1 -1
  28. package/lib/commonjs/ui/components/FollowButton.js +1 -1
  29. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  30. package/lib/commonjs/ui/components/FontLoader.js +34 -34
  31. package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
  32. package/lib/commonjs/ui/components/Header.js +4 -4
  33. package/lib/commonjs/ui/components/Header.js.map +1 -1
  34. package/lib/commonjs/ui/components/OxyPayButton.js +1 -1
  35. package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
  36. package/lib/commonjs/ui/components/OxySignInButton.js +2 -1
  37. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  38. package/lib/commonjs/ui/components/ProfileCard.js +1 -1
  39. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
  40. package/lib/commonjs/ui/components/SectionTitle.js +1 -1
  41. package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
  42. package/lib/commonjs/ui/components/StepBasedScreen.js +2 -1
  43. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
  44. package/lib/commonjs/ui/components/feedback/feedbackStyles.js +2 -1
  45. package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -1
  46. package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +57 -0
  47. package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -0
  48. package/lib/commonjs/ui/components/fileManagement/styles.js +17 -17
  49. package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -1
  50. package/lib/commonjs/ui/components/payment/paymentStyles.js +7 -7
  51. package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
  52. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +177 -0
  53. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -0
  54. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +10 -123
  55. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  56. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +2 -32
  57. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  58. package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +2 -31
  59. package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
  60. package/lib/commonjs/ui/hooks/useFileFiltering.js +76 -0
  61. package/lib/commonjs/ui/hooks/useFileFiltering.js.map +1 -0
  62. package/lib/commonjs/ui/navigation/routes.js +2 -0
  63. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  64. package/lib/commonjs/ui/screens/AccountCenterScreen.js +4 -2
  65. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  66. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +13 -5
  67. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  68. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +273 -1820
  69. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  70. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +1 -1
  71. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  72. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +3 -1
  73. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  74. package/lib/commonjs/ui/screens/AppInfoScreen.js +2 -2
  75. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  76. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +640 -0
  77. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -0
  78. package/lib/commonjs/ui/screens/FileManagementScreen.js +41 -23
  79. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  80. package/lib/commonjs/ui/screens/HistoryViewScreen.js +9 -3
  81. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  82. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -2
  83. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  84. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -1
  85. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  86. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +11 -12
  87. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  88. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +12 -4
  89. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  90. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +3 -1
  91. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
  92. package/lib/commonjs/ui/screens/SessionManagementScreen.js +15 -5
  93. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  94. package/lib/commonjs/ui/screens/UserLinksScreen.js +3 -1
  95. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
  96. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +2 -1
  97. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  98. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +2 -4
  99. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  100. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -3
  101. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  102. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +3 -3
  103. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  104. package/lib/commonjs/ui/styles/authStyles.js +5 -4
  105. package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
  106. package/lib/commonjs/ui/styles/fonts.js +27 -27
  107. package/lib/commonjs/ui/styles/fonts.js.map +1 -1
  108. package/lib/commonjs/ui/styles/theme.js +3 -3
  109. package/lib/commonjs/ui/styles/theme.js.map +1 -1
  110. package/lib/commonjs/ui/utils/authHelpers.js +164 -0
  111. package/lib/commonjs/ui/utils/authHelpers.js.map +1 -0
  112. package/lib/commonjs/ui/utils/avatarUtils.js +18 -61
  113. package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
  114. package/lib/commonjs/web.js +682 -0
  115. package/lib/commonjs/web.js.map +1 -0
  116. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  117. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  118. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  119. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  120. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  121. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  122. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  123. package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  124. package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  125. package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  126. package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  127. package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  128. package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  129. package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  130. package/lib/module/core/HttpService.js +87 -2
  131. package/lib/module/core/HttpService.js.map +1 -1
  132. package/lib/module/core/mixins/OxyServices.assets.js +3 -1
  133. package/lib/module/core/mixins/OxyServices.assets.js.map +1 -1
  134. package/lib/module/crypto/keyManager.js +67 -22
  135. package/lib/module/crypto/keyManager.js.map +1 -1
  136. package/lib/module/i18n/locales/en-US.json +3 -3
  137. package/lib/module/i18n/locales/es-ES.json +240 -19
  138. package/lib/module/index.js +6 -0
  139. package/lib/module/index.js.map +1 -1
  140. package/lib/module/ui/components/Avatar.js +1 -1
  141. package/lib/module/ui/components/Avatar.js.map +1 -1
  142. package/lib/module/ui/components/FollowButton.js +1 -1
  143. package/lib/module/ui/components/FollowButton.js.map +1 -1
  144. package/lib/module/ui/components/FontLoader.js +34 -34
  145. package/lib/module/ui/components/FontLoader.js.map +1 -1
  146. package/lib/module/ui/components/Header.js +4 -4
  147. package/lib/module/ui/components/Header.js.map +1 -1
  148. package/lib/module/ui/components/OxyPayButton.js +1 -1
  149. package/lib/module/ui/components/OxyPayButton.js.map +1 -1
  150. package/lib/module/ui/components/OxySignInButton.js +2 -1
  151. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  152. package/lib/module/ui/components/ProfileCard.js +1 -1
  153. package/lib/module/ui/components/ProfileCard.js.map +1 -1
  154. package/lib/module/ui/components/SectionTitle.js +1 -1
  155. package/lib/module/ui/components/SectionTitle.js.map +1 -1
  156. package/lib/module/ui/components/StepBasedScreen.js +2 -1
  157. package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
  158. package/lib/module/ui/components/feedback/feedbackStyles.js +2 -1
  159. package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
  160. package/lib/module/ui/components/fileManagement/AnimatedButton.js +50 -0
  161. package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -0
  162. package/lib/module/ui/components/fileManagement/styles.js +17 -17
  163. package/lib/module/ui/components/fileManagement/styles.js.map +1 -1
  164. package/lib/module/ui/components/payment/paymentStyles.js +7 -7
  165. package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
  166. package/lib/module/ui/hooks/mutations/mutationFactory.js +173 -0
  167. package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -0
  168. package/lib/module/ui/hooks/mutations/useAccountMutations.js +10 -122
  169. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  170. package/lib/module/ui/hooks/queries/useAccountQueries.js +2 -32
  171. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  172. package/lib/module/ui/hooks/queries/useServicesQueries.js +2 -31
  173. package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
  174. package/lib/module/ui/hooks/useFileFiltering.js +72 -0
  175. package/lib/module/ui/hooks/useFileFiltering.js.map +1 -0
  176. package/lib/module/ui/navigation/routes.js +2 -0
  177. package/lib/module/ui/navigation/routes.js.map +1 -1
  178. package/lib/module/ui/screens/AccountCenterScreen.js +4 -2
  179. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  180. package/lib/module/ui/screens/AccountOverviewScreen.js +13 -5
  181. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  182. package/lib/module/ui/screens/AccountSettingsScreen.js +277 -1824
  183. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  184. package/lib/module/ui/screens/AccountSwitcherScreen.js +1 -1
  185. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  186. package/lib/module/ui/screens/AccountVerificationScreen.js +3 -1
  187. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  188. package/lib/module/ui/screens/AppInfoScreen.js +2 -2
  189. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  190. package/lib/module/ui/screens/EditProfileFieldScreen.js +635 -0
  191. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -0
  192. package/lib/module/ui/screens/FileManagementScreen.js +41 -23
  193. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  194. package/lib/module/ui/screens/HistoryViewScreen.js +9 -3
  195. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  196. package/lib/module/ui/screens/LanguageSelectorScreen.js +4 -2
  197. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  198. package/lib/module/ui/screens/LegalDocumentsScreen.js +3 -1
  199. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  200. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +11 -12
  201. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  202. package/lib/module/ui/screens/PrivacySettingsScreen.js +12 -4
  203. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  204. package/lib/module/ui/screens/SearchSettingsScreen.js +3 -1
  205. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
  206. package/lib/module/ui/screens/SessionManagementScreen.js +15 -5
  207. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  208. package/lib/module/ui/screens/UserLinksScreen.js +3 -1
  209. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
  210. package/lib/module/ui/screens/WelcomeNewUserScreen.js +2 -1
  211. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  212. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +2 -4
  213. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  214. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -3
  215. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  216. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +3 -3
  217. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  218. package/lib/module/ui/styles/authStyles.js +5 -4
  219. package/lib/module/ui/styles/authStyles.js.map +1 -1
  220. package/lib/module/ui/styles/fonts.js +27 -27
  221. package/lib/module/ui/styles/fonts.js.map +1 -1
  222. package/lib/module/ui/styles/theme.js +3 -3
  223. package/lib/module/ui/styles/theme.js.map +1 -1
  224. package/lib/module/ui/utils/authHelpers.js +154 -0
  225. package/lib/module/ui/utils/authHelpers.js.map +1 -0
  226. package/lib/module/ui/utils/avatarUtils.js +18 -61
  227. package/lib/module/ui/utils/avatarUtils.js.map +1 -1
  228. package/lib/module/web.js +75 -0
  229. package/lib/module/web.js.map +1 -0
  230. package/lib/typescript/commonjs/core/HttpService.d.ts +5 -0
  231. package/lib/typescript/commonjs/core/HttpService.d.ts.map +1 -1
  232. package/lib/typescript/commonjs/crypto/keyManager.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/index.d.ts +6 -0
  234. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  236. package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
  237. package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
  238. package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts +16 -0
  239. package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts +76 -0
  241. package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +29 -4
  243. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +1 -1
  245. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  246. package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +1 -1
  247. package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/ui/hooks/useFileFiltering.d.ts +29 -0
  249. package/lib/typescript/commonjs/ui/hooks/useFileFiltering.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  251. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  254. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  255. package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts +13 -0
  257. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  261. package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  263. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/ui/styles/fonts.d.ts +7 -7
  270. package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/ui/utils/authHelpers.d.ts +99 -0
  272. package/lib/typescript/commonjs/ui/utils/authHelpers.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/web.d.ts +54 -0
  275. package/lib/typescript/commonjs/web.d.ts.map +1 -0
  276. package/lib/typescript/module/core/HttpService.d.ts +5 -0
  277. package/lib/typescript/module/core/HttpService.d.ts.map +1 -1
  278. package/lib/typescript/module/crypto/keyManager.d.ts.map +1 -1
  279. package/lib/typescript/module/index.d.ts +6 -0
  280. package/lib/typescript/module/index.d.ts.map +1 -1
  281. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  282. package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
  283. package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
  284. package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts +16 -0
  285. package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -0
  286. package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts +76 -0
  287. package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts.map +1 -0
  288. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +29 -4
  289. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  290. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +1 -1
  291. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  292. package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +1 -1
  293. package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  294. package/lib/typescript/module/ui/hooks/useFileFiltering.d.ts +29 -0
  295. package/lib/typescript/module/ui/hooks/useFileFiltering.d.ts.map +1 -0
  296. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  297. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  298. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  299. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  300. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  301. package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  302. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +13 -0
  303. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -0
  304. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  305. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  306. package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  307. package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
  308. package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  309. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  310. package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
  311. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  312. package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
  313. package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  314. package/lib/typescript/module/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
  315. package/lib/typescript/module/ui/styles/fonts.d.ts +7 -7
  316. package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -1
  317. package/lib/typescript/module/ui/utils/authHelpers.d.ts +99 -0
  318. package/lib/typescript/module/ui/utils/authHelpers.d.ts.map +1 -0
  319. package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
  320. package/lib/typescript/module/web.d.ts +54 -0
  321. package/lib/typescript/module/web.d.ts.map +1 -0
  322. package/package.json +27 -41
  323. package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  324. package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  325. package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  326. package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  327. package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  328. package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  329. package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  330. package/src/core/HttpService.ts +91 -0
  331. package/src/core/mixins/OxyServices.assets.ts +1 -1
  332. package/src/crypto/keyManager.ts +23 -22
  333. package/src/i18n/locales/en-US.json +3 -3
  334. package/src/i18n/locales/es-ES.json +240 -19
  335. package/src/index.ts +25 -0
  336. package/src/ui/components/Avatar.tsx +1 -1
  337. package/src/ui/components/FollowButton.tsx +1 -1
  338. package/src/ui/components/FontLoader.tsx +34 -34
  339. package/src/ui/components/Header.tsx +4 -4
  340. package/src/ui/components/OxyPayButton.tsx +1 -1
  341. package/src/ui/components/OxySignInButton.tsx +2 -1
  342. package/src/ui/components/ProfileCard.tsx +1 -1
  343. package/src/ui/components/SectionTitle.tsx +1 -1
  344. package/src/ui/components/StepBasedScreen.tsx +2 -1
  345. package/src/ui/components/feedback/feedbackStyles.ts +2 -1
  346. package/src/ui/components/fileManagement/AnimatedButton.tsx +56 -0
  347. package/src/ui/components/fileManagement/styles.ts +17 -17
  348. package/src/ui/components/payment/paymentStyles.ts +7 -7
  349. package/src/ui/hooks/mutations/mutationFactory.ts +215 -0
  350. package/src/ui/hooks/mutations/useAccountMutations.ts +48 -136
  351. package/src/ui/hooks/queries/useAccountQueries.ts +6 -33
  352. package/src/ui/hooks/queries/useServicesQueries.ts +6 -32
  353. package/src/ui/hooks/useFileFiltering.ts +115 -0
  354. package/src/ui/navigation/routes.ts +3 -0
  355. package/src/ui/screens/AccountCenterScreen.tsx +4 -2
  356. package/src/ui/screens/AccountOverviewScreen.tsx +13 -5
  357. package/src/ui/screens/AccountSettingsScreen.tsx +35 -1511
  358. package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
  359. package/src/ui/screens/AccountVerificationScreen.tsx +3 -1
  360. package/src/ui/screens/AppInfoScreen.tsx +2 -2
  361. package/src/ui/screens/EditProfileFieldScreen.tsx +685 -0
  362. package/src/ui/screens/FileManagementScreen.tsx +35 -17
  363. package/src/ui/screens/HistoryViewScreen.tsx +9 -3
  364. package/src/ui/screens/LanguageSelectorScreen.tsx +4 -2
  365. package/src/ui/screens/LegalDocumentsScreen.tsx +3 -1
  366. package/src/ui/screens/PremiumSubscriptionScreen.tsx +11 -13
  367. package/src/ui/screens/PrivacySettingsScreen.tsx +12 -4
  368. package/src/ui/screens/SearchSettingsScreen.tsx +3 -1
  369. package/src/ui/screens/SessionManagementScreen.tsx +15 -5
  370. package/src/ui/screens/UserLinksScreen.tsx +3 -1
  371. package/src/ui/screens/WelcomeNewUserScreen.tsx +2 -1
  372. package/src/ui/screens/karma/KarmaAboutScreen.tsx +6 -8
  373. package/src/ui/screens/karma/KarmaCenterScreen.tsx +3 -3
  374. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +3 -3
  375. package/src/ui/styles/authStyles.ts +4 -4
  376. package/src/ui/styles/fonts.ts +26 -26
  377. package/src/ui/styles/theme.ts +3 -5
  378. package/src/ui/utils/authHelpers.ts +183 -0
  379. package/src/ui/utils/avatarUtils.ts +25 -65
  380. package/src/web.ts +230 -0
  381. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  382. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  383. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  384. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  385. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  386. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  387. package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  388. package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  389. package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  390. package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  391. package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  392. package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  393. package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  394. package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  395. package/lib/commonjs/ui/components/profile/EditBioModal.js +0 -181
  396. package/lib/commonjs/ui/components/profile/EditBioModal.js.map +0 -1
  397. package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js +0 -204
  398. package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js.map +0 -1
  399. package/lib/commonjs/ui/components/profile/EditEmailModal.js +0 -184
  400. package/lib/commonjs/ui/components/profile/EditEmailModal.js.map +0 -1
  401. package/lib/commonjs/ui/components/profile/EditFieldModal.js +0 -412
  402. package/lib/commonjs/ui/components/profile/EditFieldModal.js.map +0 -1
  403. package/lib/commonjs/ui/components/profile/EditLinksModal.js +0 -315
  404. package/lib/commonjs/ui/components/profile/EditLinksModal.js.map +0 -1
  405. package/lib/commonjs/ui/components/profile/EditLocationModal.js +0 -273
  406. package/lib/commonjs/ui/components/profile/EditLocationModal.js.map +0 -1
  407. package/lib/commonjs/ui/components/profile/EditUsernameModal.js +0 -180
  408. package/lib/commonjs/ui/components/profile/EditUsernameModal.js.map +0 -1
  409. package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  410. package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  411. package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  412. package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  413. package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  414. package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  415. package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  416. package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  417. package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  418. package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  419. package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  420. package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  421. package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  422. package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  423. package/lib/module/ui/components/profile/EditBioModal.js +0 -175
  424. package/lib/module/ui/components/profile/EditBioModal.js.map +0 -1
  425. package/lib/module/ui/components/profile/EditDisplayNameModal.js +0 -198
  426. package/lib/module/ui/components/profile/EditDisplayNameModal.js.map +0 -1
  427. package/lib/module/ui/components/profile/EditEmailModal.js +0 -178
  428. package/lib/module/ui/components/profile/EditEmailModal.js.map +0 -1
  429. package/lib/module/ui/components/profile/EditFieldModal.js +0 -406
  430. package/lib/module/ui/components/profile/EditFieldModal.js.map +0 -1
  431. package/lib/module/ui/components/profile/EditLinksModal.js +0 -309
  432. package/lib/module/ui/components/profile/EditLinksModal.js.map +0 -1
  433. package/lib/module/ui/components/profile/EditLocationModal.js +0 -267
  434. package/lib/module/ui/components/profile/EditLocationModal.js.map +0 -1
  435. package/lib/module/ui/components/profile/EditUsernameModal.js +0 -174
  436. package/lib/module/ui/components/profile/EditUsernameModal.js.map +0 -1
  437. package/lib/typescript/commonjs/ui/components/profile/EditBioModal.d.ts +0 -11
  438. package/lib/typescript/commonjs/ui/components/profile/EditBioModal.d.ts.map +0 -1
  439. package/lib/typescript/commonjs/ui/components/profile/EditDisplayNameModal.d.ts +0 -12
  440. package/lib/typescript/commonjs/ui/components/profile/EditDisplayNameModal.d.ts.map +0 -1
  441. package/lib/typescript/commonjs/ui/components/profile/EditEmailModal.d.ts +0 -11
  442. package/lib/typescript/commonjs/ui/components/profile/EditEmailModal.d.ts.map +0 -1
  443. package/lib/typescript/commonjs/ui/components/profile/EditFieldModal.d.ts +0 -110
  444. package/lib/typescript/commonjs/ui/components/profile/EditFieldModal.d.ts.map +0 -1
  445. package/lib/typescript/commonjs/ui/components/profile/EditLinksModal.d.ts +0 -18
  446. package/lib/typescript/commonjs/ui/components/profile/EditLinksModal.d.ts.map +0 -1
  447. package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts +0 -20
  448. package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts.map +0 -1
  449. package/lib/typescript/commonjs/ui/components/profile/EditUsernameModal.d.ts +0 -11
  450. package/lib/typescript/commonjs/ui/components/profile/EditUsernameModal.d.ts.map +0 -1
  451. package/lib/typescript/module/ui/components/profile/EditBioModal.d.ts +0 -11
  452. package/lib/typescript/module/ui/components/profile/EditBioModal.d.ts.map +0 -1
  453. package/lib/typescript/module/ui/components/profile/EditDisplayNameModal.d.ts +0 -12
  454. package/lib/typescript/module/ui/components/profile/EditDisplayNameModal.d.ts.map +0 -1
  455. package/lib/typescript/module/ui/components/profile/EditEmailModal.d.ts +0 -11
  456. package/lib/typescript/module/ui/components/profile/EditEmailModal.d.ts.map +0 -1
  457. package/lib/typescript/module/ui/components/profile/EditFieldModal.d.ts +0 -110
  458. package/lib/typescript/module/ui/components/profile/EditFieldModal.d.ts.map +0 -1
  459. package/lib/typescript/module/ui/components/profile/EditLinksModal.d.ts +0 -18
  460. package/lib/typescript/module/ui/components/profile/EditLinksModal.d.ts.map +0 -1
  461. package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts +0 -20
  462. package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts.map +0 -1
  463. package/lib/typescript/module/ui/components/profile/EditUsernameModal.d.ts +0 -11
  464. package/lib/typescript/module/ui/components/profile/EditUsernameModal.d.ts.map +0 -1
  465. package/src/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
  466. package/src/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
  467. package/src/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
  468. package/src/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
  469. package/src/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
  470. package/src/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
  471. package/src/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
  472. package/src/ui/components/profile/EditBioModal.tsx +0 -184
  473. package/src/ui/components/profile/EditDisplayNameModal.tsx +0 -203
  474. package/src/ui/components/profile/EditEmailModal.tsx +0 -188
  475. package/src/ui/components/profile/EditFieldModal.tsx +0 -465
  476. package/src/ui/components/profile/EditLinksModal.tsx +0 -316
  477. package/src/ui/components/profile/EditLocationModal.tsx +0 -278
  478. package/src/ui/components/profile/EditUsernameModal.tsx +0 -183
@@ -1,465 +0,0 @@
1
- import React, { useState, useEffect, useCallback } from 'react';
2
- import {
3
- View,
4
- Text,
5
- TextInput,
6
- TouchableOpacity,
7
- StyleSheet,
8
- Modal,
9
- Platform,
10
- ScrollView,
11
- TextInputProps,
12
- } from 'react-native';
13
- import { Ionicons } from '@expo/vector-icons';
14
- import { useThemeStyles } from '../../hooks/useThemeStyles';
15
- import { useColorScheme } from '../../hooks/use-color-scheme';
16
- import { useI18n } from '../../hooks/useI18n';
17
- import { fontFamilies } from '../../styles/fonts';
18
- import { useProfileEditing } from '../../hooks/useProfileEditing';
19
-
20
- /**
21
- * Field configuration for single/multi field variants
22
- */
23
- export interface FieldConfig {
24
- /** Unique key for the field */
25
- key: string;
26
- /** Label displayed above the input */
27
- label: string;
28
- /** Initial value for the field */
29
- initialValue: string;
30
- /** Placeholder text */
31
- placeholder?: string;
32
- /** Validation function - returns error message or undefined */
33
- validation?: (value: string) => string | undefined;
34
- /** Additional TextInput props (multiline, keyboardType, etc.) */
35
- inputProps?: Partial<TextInputProps>;
36
- }
37
-
38
- /**
39
- * List item for list variant
40
- */
41
- export interface ListItem {
42
- id: string;
43
- [key: string]: unknown;
44
- }
45
-
46
- /**
47
- * Configuration for list variant
48
- */
49
- export interface ListConfig<T extends ListItem> {
50
- /** Initial items */
51
- items: T[];
52
- /** Render function for each item */
53
- renderItem: (item: T, onRemove: () => void, colors: Record<string, string>) => React.ReactNode;
54
- /** Placeholder for add input */
55
- addItemPlaceholder: string;
56
- /** Label for add input section */
57
- addItemLabel?: string;
58
- /** Function to create a new item from input value */
59
- createItem: (value: string) => T;
60
- /** List title shown above items */
61
- listTitle?: string;
62
- }
63
-
64
- /**
65
- * Props for EditFieldModal
66
- */
67
- export interface EditFieldModalProps<T extends ListItem = ListItem> {
68
- /** Whether the modal is visible */
69
- visible: boolean;
70
- /** Close handler */
71
- onClose: () => void;
72
- /** Modal title */
73
- title: string;
74
- /** Theme override */
75
- theme?: 'light' | 'dark';
76
- /** Called after successful save */
77
- onSave?: () => void;
78
-
79
- /** Modal variant: single input, multiple inputs, or list management */
80
- variant: 'single' | 'multi' | 'list';
81
-
82
- /** Field configuration for single/multi variants */
83
- fields?: FieldConfig[];
84
-
85
- /** List configuration for list variant */
86
- listConfig?: ListConfig<T>;
87
-
88
- /** Custom submit handler - receives field values or list items */
89
- onSubmit: (data: Record<string, unknown>) => Promise<boolean>;
90
-
91
- /** Whether save button should be disabled */
92
- saveDisabled?: boolean;
93
- }
94
-
95
- /**
96
- * Generic modal component for editing profile fields.
97
- *
98
- * Supports three variants:
99
- * - single: Single text input (username, email, bio)
100
- * - multi: Multiple text inputs (display name with first/last)
101
- * - list: Add/remove list items (links, locations)
102
- *
103
- * @example
104
- * // Single field (bio)
105
- * <EditFieldModal
106
- * visible={showBioModal}
107
- * onClose={() => setShowBioModal(false)}
108
- * title="Bio"
109
- * variant="single"
110
- * fields={[{
111
- * key: 'bio',
112
- * label: 'Bio',
113
- * initialValue: user.bio,
114
- * placeholder: 'Tell people about yourself...',
115
- * inputProps: { multiline: true, numberOfLines: 6 }
116
- * }]}
117
- * onSubmit={async (data) => updateField('bio', data.bio)}
118
- * />
119
- *
120
- * @example
121
- * // Multi field (display name)
122
- * <EditFieldModal
123
- * visible={showNameModal}
124
- * onClose={() => setShowNameModal(false)}
125
- * title="Display Name"
126
- * variant="multi"
127
- * fields={[
128
- * { key: 'firstName', label: 'First Name', initialValue: user.name?.first },
129
- * { key: 'lastName', label: 'Last Name', initialValue: user.name?.last }
130
- * ]}
131
- * onSubmit={async (data) => saveProfile({ displayName: data.firstName, lastName: data.lastName })}
132
- * />
133
- */
134
- export function EditFieldModal<T extends ListItem = ListItem>({
135
- visible,
136
- onClose,
137
- title,
138
- theme = 'light',
139
- onSave,
140
- variant,
141
- fields = [],
142
- listConfig,
143
- onSubmit,
144
- saveDisabled = false,
145
- }: EditFieldModalProps<T>): React.ReactElement {
146
- const { t } = useI18n();
147
- const colorScheme = useColorScheme();
148
- const themeStyles = useThemeStyles(theme || 'light', colorScheme);
149
- const colors = themeStyles.colors;
150
- const { isSaving } = useProfileEditing();
151
-
152
- // State for field values (single/multi variants)
153
- const [fieldValues, setFieldValues] = useState<Record<string, string>>({});
154
- const [fieldErrors, setFieldErrors] = useState<Record<string, string | undefined>>({});
155
-
156
- // State for list items (list variant)
157
- const [listItems, setListItems] = useState<T[]>([]);
158
- const [newItemValue, setNewItemValue] = useState('');
159
-
160
- // Initialize field values when modal opens
161
- useEffect(() => {
162
- if (visible) {
163
- if (variant === 'list' && listConfig) {
164
- setListItems(listConfig.items);
165
- setNewItemValue('');
166
- } else if (fields.length > 0) {
167
- const initialValues: Record<string, string> = {};
168
- fields.forEach(field => {
169
- initialValues[field.key] = field.initialValue || '';
170
- });
171
- setFieldValues(initialValues);
172
- setFieldErrors({});
173
- }
174
- }
175
- }, [visible, variant, fields, listConfig]);
176
-
177
- // Field change handler with validation
178
- const handleFieldChange = useCallback((key: string, value: string) => {
179
- setFieldValues(prev => ({ ...prev, [key]: value }));
180
-
181
- // Clear error on change
182
- if (fieldErrors[key]) {
183
- setFieldErrors(prev => ({ ...prev, [key]: undefined }));
184
- }
185
- }, [fieldErrors]);
186
-
187
- // Validate all fields
188
- const validateFields = useCallback((): boolean => {
189
- const errors: Record<string, string | undefined> = {};
190
- let isValid = true;
191
-
192
- fields.forEach(field => {
193
- if (field.validation) {
194
- const error = field.validation(fieldValues[field.key] || '');
195
- if (error) {
196
- errors[field.key] = error;
197
- isValid = false;
198
- }
199
- }
200
- });
201
-
202
- setFieldErrors(errors);
203
- return isValid;
204
- }, [fields, fieldValues]);
205
-
206
- // Add item to list
207
- const handleAddItem = useCallback(() => {
208
- if (!newItemValue.trim() || !listConfig) return;
209
-
210
- const newItem = listConfig.createItem(newItemValue.trim());
211
- setListItems(prev => [...prev, newItem]);
212
- setNewItemValue('');
213
- }, [newItemValue, listConfig]);
214
-
215
- // Remove item from list
216
- const handleRemoveItem = useCallback((id: string) => {
217
- setListItems(prev => prev.filter(item => item.id !== id));
218
- }, []);
219
-
220
- // Save handler
221
- const handleSave = async () => {
222
- if (variant === 'list') {
223
- const success = await onSubmit({ items: listItems });
224
- if (success) {
225
- onSave?.();
226
- onClose();
227
- }
228
- } else {
229
- if (!validateFields()) return;
230
-
231
- const success = await onSubmit(fieldValues);
232
- if (success) {
233
- onSave?.();
234
- onClose();
235
- }
236
- }
237
- };
238
-
239
- // Render field inputs for single/multi variants
240
- const renderFields = () => (
241
- <View style={styles.modalBody}>
242
- {fields.map((field, index) => (
243
- <View key={field.key} style={styles.inputGroup}>
244
- <Text style={[styles.label, { color: colors.text }]}>
245
- {field.label}
246
- </Text>
247
- <TextInput
248
- style={[
249
- field.inputProps?.multiline ? styles.textArea : styles.input,
250
- {
251
- backgroundColor: colors.card,
252
- color: colors.text,
253
- borderColor: fieldErrors[field.key] ? '#FF3B30' : colors.border,
254
- },
255
- ]}
256
- value={fieldValues[field.key] || ''}
257
- onChangeText={(value) => handleFieldChange(field.key, value)}
258
- placeholder={field.placeholder}
259
- placeholderTextColor={colors.secondaryText}
260
- autoFocus={index === 0}
261
- selectionColor={colors.tint}
262
- textAlignVertical={field.inputProps?.multiline ? 'top' : 'center'}
263
- {...field.inputProps}
264
- />
265
- {fieldErrors[field.key] && (
266
- <Text style={styles.errorText}>{fieldErrors[field.key]}</Text>
267
- )}
268
- </View>
269
- ))}
270
- </View>
271
- );
272
-
273
- // Render list for list variant
274
- const renderList = () => {
275
- if (!listConfig) return null;
276
-
277
- return (
278
- <ScrollView style={styles.modalBody}>
279
- <View style={styles.inputGroup}>
280
- <Text style={[styles.label, { color: colors.text }]}>
281
- {listConfig.addItemLabel || t('common.add') || 'Add'}
282
- </Text>
283
- <View style={styles.addItemRow}>
284
- <TextInput
285
- style={[
286
- styles.input,
287
- {
288
- backgroundColor: colors.card,
289
- color: colors.text,
290
- borderColor: colors.border,
291
- flex: 1,
292
- },
293
- ]}
294
- value={newItemValue}
295
- onChangeText={setNewItemValue}
296
- placeholder={listConfig.addItemPlaceholder}
297
- placeholderTextColor={colors.secondaryText}
298
- selectionColor={colors.tint}
299
- autoCapitalize="none"
300
- autoCorrect={false}
301
- />
302
- <TouchableOpacity
303
- style={[styles.addButton, { backgroundColor: colors.tint }]}
304
- onPress={handleAddItem}
305
- disabled={!newItemValue.trim()}
306
- >
307
- <Ionicons name="add" size={20} color="#fff" />
308
- </TouchableOpacity>
309
- </View>
310
- </View>
311
-
312
- {listItems.length > 0 && (
313
- <View style={styles.listSection}>
314
- {listConfig.listTitle && (
315
- <Text style={[styles.listTitle, { color: colors.text }]}>
316
- {listConfig.listTitle} ({listItems.length})
317
- </Text>
318
- )}
319
- {listItems.map((item) => (
320
- <View key={item.id}>
321
- {listConfig.renderItem(
322
- item,
323
- () => handleRemoveItem(item.id),
324
- colors
325
- )}
326
- </View>
327
- ))}
328
- </View>
329
- )}
330
- </ScrollView>
331
- );
332
- };
333
-
334
- return (
335
- <Modal
336
- visible={visible}
337
- animationType="slide"
338
- transparent={true}
339
- onRequestClose={onClose}
340
- >
341
- <View style={styles.modalOverlay}>
342
- <View style={[styles.modalContent, { backgroundColor: colors.background }]}>
343
- <View style={styles.modalHeader}>
344
- <TouchableOpacity onPress={onClose} style={styles.closeButton}>
345
- <Ionicons name="close" size={24} color={colors.text} />
346
- </TouchableOpacity>
347
- <Text style={[styles.modalTitle, { color: colors.text }]}>
348
- {title}
349
- </Text>
350
- <TouchableOpacity
351
- onPress={handleSave}
352
- disabled={isSaving || saveDisabled}
353
- style={[styles.saveButton, { opacity: (isSaving || saveDisabled) ? 0.5 : 1 }]}
354
- >
355
- <Text style={[styles.saveButtonText, { color: colors.tint }]}>
356
- {isSaving ? (t('common.saving') || 'Saving...') : (t('common.save') || 'Save')}
357
- </Text>
358
- </TouchableOpacity>
359
- </View>
360
-
361
- {variant === 'list' ? renderList() : renderFields()}
362
- </View>
363
- </View>
364
- </Modal>
365
- );
366
- }
367
-
368
- const styles = StyleSheet.create({
369
- modalOverlay: {
370
- flex: 1,
371
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
372
- justifyContent: 'flex-end',
373
- },
374
- modalContent: {
375
- borderTopLeftRadius: 20,
376
- borderTopRightRadius: 20,
377
- paddingTop: Platform.OS === 'ios' ? 20 : 16,
378
- maxHeight: '80%',
379
- },
380
- modalHeader: {
381
- flexDirection: 'row',
382
- alignItems: 'center',
383
- justifyContent: 'space-between',
384
- paddingHorizontal: 16,
385
- paddingBottom: 16,
386
- borderBottomWidth: StyleSheet.hairlineWidth,
387
- borderBottomColor: '#E5E5EA',
388
- },
389
- closeButton: {
390
- width: 40,
391
- height: 40,
392
- alignItems: 'center',
393
- justifyContent: 'center',
394
- },
395
- modalTitle: {
396
- fontSize: 18,
397
- fontWeight: '600',
398
- fontFamily: fontFamilies.phuduSemiBold,
399
- flex: 1,
400
- textAlign: 'center',
401
- },
402
- saveButton: {
403
- paddingHorizontal: 16,
404
- paddingVertical: 8,
405
- },
406
- saveButtonText: {
407
- fontSize: 16,
408
- fontWeight: '600',
409
- fontFamily: fontFamilies.phuduSemiBold,
410
- },
411
- modalBody: {
412
- padding: 16,
413
- gap: 16,
414
- },
415
- inputGroup: {
416
- gap: 8,
417
- },
418
- label: {
419
- fontSize: 14,
420
- fontWeight: '600',
421
- fontFamily: fontFamilies.phuduSemiBold,
422
- },
423
- input: {
424
- borderWidth: StyleSheet.hairlineWidth,
425
- borderRadius: 12,
426
- padding: 16,
427
- fontSize: 16,
428
- minHeight: 52,
429
- },
430
- textArea: {
431
- borderWidth: StyleSheet.hairlineWidth,
432
- borderRadius: 12,
433
- padding: 16,
434
- fontSize: 16,
435
- minHeight: 120,
436
- },
437
- errorText: {
438
- fontSize: 12,
439
- color: '#FF3B30',
440
- },
441
- addItemRow: {
442
- flexDirection: 'row',
443
- gap: 8,
444
- alignItems: 'center',
445
- },
446
- addButton: {
447
- width: 52,
448
- height: 52,
449
- borderRadius: 12,
450
- alignItems: 'center',
451
- justifyContent: 'center',
452
- },
453
- listSection: {
454
- gap: 8,
455
- marginTop: 16,
456
- },
457
- listTitle: {
458
- fontSize: 16,
459
- fontWeight: '600',
460
- fontFamily: fontFamilies.phuduSemiBold,
461
- marginBottom: 8,
462
- },
463
- });
464
-
465
- export default EditFieldModal;