react-native-unit-components 1.8.0 → 1.9.1

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 (260) hide show
  1. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +4 -2
  2. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  3. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
  4. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
  5. package/lib/commonjs/components/UNACHCreditComponent/index.js +21 -0
  6. package/lib/commonjs/components/UNACHCreditComponent/index.js.map +1 -0
  7. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +4 -2
  8. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  9. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
  10. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
  11. package/lib/commonjs/components/UNACHDebitComponent/index.js +21 -0
  12. package/lib/commonjs/components/UNACHDebitComponent/index.js.map +1 -0
  13. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +10 -8
  14. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  15. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
  16. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  17. package/lib/commonjs/components/UNAccountComponent/index.js +27 -0
  18. package/lib/commonjs/components/UNAccountComponent/index.js.map +1 -0
  19. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +4 -2
  20. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  21. package/lib/commonjs/components/UNActivityComponent/index.js +21 -0
  22. package/lib/commonjs/components/UNActivityComponent/index.js.map +1 -0
  23. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +4 -2
  24. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  25. package/lib/commonjs/components/UNBookPaymentComponent/index.js +21 -0
  26. package/lib/commonjs/components/UNBookPaymentComponent/index.js.map +1 -0
  27. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +9 -6
  28. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  29. package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +10 -10
  30. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
  31. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +17 -0
  32. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
  33. package/lib/commonjs/components/UNBottomSheetComponent/components/index.js +17 -0
  34. package/lib/commonjs/components/UNBottomSheetComponent/components/index.js.map +1 -0
  35. package/lib/commonjs/components/UNBottomSheetComponent/index.js +14 -0
  36. package/lib/commonjs/components/UNBottomSheetComponent/index.js.map +1 -0
  37. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +25 -3
  38. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
  39. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +9 -1
  40. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  41. package/lib/commonjs/components/UNCardComponent/index.js +27 -0
  42. package/lib/commonjs/components/UNCardComponent/index.js.map +1 -0
  43. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +4 -2
  44. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  45. package/lib/commonjs/components/UNCheckDepositComponent/index.js +21 -0
  46. package/lib/commonjs/components/UNCheckDepositComponent/index.js.map +1 -0
  47. package/lib/commonjs/components/index.js +8 -8
  48. package/lib/commonjs/components/index.js.map +1 -1
  49. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +18 -2
  50. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
  51. package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +33 -0
  52. package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
  53. package/lib/commonjs/helpers/store/helpers.js +29 -0
  54. package/lib/commonjs/helpers/store/helpers.js.map +1 -0
  55. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js +3 -3
  56. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  57. package/lib/commonjs/scripts/html/bodyScript.js +13 -1
  58. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
  59. package/lib/commonjs/slices/pushProvisioningSlice.js +28 -0
  60. package/lib/commonjs/slices/pushProvisioningSlice.js.map +1 -0
  61. package/lib/commonjs/store/index.js +17 -0
  62. package/lib/commonjs/store/index.js.map +1 -0
  63. package/lib/commonjs/store/store.js +16 -0
  64. package/lib/commonjs/store/store.js.map +1 -0
  65. package/lib/commonjs/types/shared/index.js +11 -0
  66. package/lib/commonjs/types/shared/index.js.map +1 -1
  67. package/lib/commonjs/types/shared/versioning.types.js +14 -0
  68. package/lib/commonjs/types/shared/versioning.types.js.map +1 -0
  69. package/lib/commonjs/unitSdkManager/UnitSdk.api.js +3 -1
  70. package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
  71. package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +17 -0
  72. package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -0
  73. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +18 -9
  74. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
  75. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +19 -0
  76. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
  77. package/lib/commonjs/utils/webVersioningStrategy.utils.js +58 -0
  78. package/lib/commonjs/utils/webVersioningStrategy.utils.js.map +1 -0
  79. package/lib/commonjs/webComponent/html.js +4 -0
  80. package/lib/commonjs/webComponent/html.js.map +1 -1
  81. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +3 -1
  82. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  83. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
  84. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
  85. package/lib/module/components/UNACHCreditComponent/index.js +2 -0
  86. package/lib/module/components/UNACHCreditComponent/index.js.map +1 -0
  87. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +3 -1
  88. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  89. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
  90. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
  91. package/lib/module/components/UNACHDebitComponent/index.js +2 -0
  92. package/lib/module/components/UNACHDebitComponent/index.js.map +1 -0
  93. package/lib/module/components/UNAccountComponent/UNAccountComponent.js +8 -6
  94. package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  95. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +2 -2
  96. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  97. package/lib/module/components/UNAccountComponent/index.js +2 -0
  98. package/lib/module/components/UNAccountComponent/index.js.map +1 -0
  99. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +3 -1
  100. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  101. package/lib/module/components/UNActivityComponent/index.js +2 -0
  102. package/lib/module/components/UNActivityComponent/index.js.map +1 -0
  103. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +3 -1
  104. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  105. package/lib/module/components/UNBookPaymentComponent/index.js +2 -0
  106. package/lib/module/components/UNBookPaymentComponent/index.js.map +1 -0
  107. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +9 -6
  108. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  109. package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +10 -10
  110. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
  111. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +2 -0
  112. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
  113. package/lib/module/components/UNBottomSheetComponent/components/index.js +2 -0
  114. package/lib/module/components/UNBottomSheetComponent/components/index.js.map +1 -0
  115. package/lib/module/components/UNBottomSheetComponent/index.js +2 -0
  116. package/lib/module/components/UNBottomSheetComponent/index.js.map +1 -0
  117. package/lib/module/components/UNCardComponent/UNCardComponent.js +25 -3
  118. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
  119. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +6 -0
  120. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  121. package/lib/module/components/UNCardComponent/index.js +2 -0
  122. package/lib/module/components/UNCardComponent/index.js.map +1 -0
  123. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +3 -1
  124. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  125. package/lib/module/components/UNCheckDepositComponent/index.js +2 -0
  126. package/lib/module/components/UNCheckDepositComponent/index.js.map +1 -0
  127. package/lib/module/components/index.js +8 -8
  128. package/lib/module/components/index.js.map +1 -1
  129. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +18 -2
  130. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
  131. package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +26 -0
  132. package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
  133. package/lib/module/helpers/store/helpers.js +20 -0
  134. package/lib/module/helpers/store/helpers.js.map +1 -0
  135. package/lib/module/networking/requests/UNWalletPayloadRequest.js +3 -4
  136. package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  137. package/lib/module/scripts/html/bodyScript.js +10 -0
  138. package/lib/module/scripts/html/bodyScript.js.map +1 -1
  139. package/lib/module/slices/pushProvisioningSlice.js +19 -0
  140. package/lib/module/slices/pushProvisioningSlice.js.map +1 -0
  141. package/lib/module/store/index.js +2 -0
  142. package/lib/module/store/index.js.map +1 -0
  143. package/lib/module/store/store.js +8 -0
  144. package/lib/module/store/store.js.map +1 -0
  145. package/lib/module/types/shared/index.js +1 -0
  146. package/lib/module/types/shared/index.js.map +1 -1
  147. package/lib/module/types/shared/versioning.types.js +7 -0
  148. package/lib/module/types/shared/versioning.types.js.map +1 -0
  149. package/lib/module/unitSdkManager/UnitSdk.api.js +4 -2
  150. package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
  151. package/lib/module/unitSdkManager/UnitSdk.constants.js +10 -0
  152. package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -0
  153. package/lib/module/unitSdkManager/UnitSdkManager.js +17 -7
  154. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
  155. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +12 -0
  156. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
  157. package/lib/module/utils/webVersioningStrategy.utils.js +48 -0
  158. package/lib/module/utils/webVersioningStrategy.utils.js.map +1 -0
  159. package/lib/module/webComponent/html.js +5 -1
  160. package/lib/module/webComponent/html.js.map +1 -1
  161. package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +3 -1
  162. package/lib/typescript/components/UNACHCreditComponent/index.d.ts +1 -0
  163. package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +3 -1
  164. package/lib/typescript/components/UNACHDebitComponent/index.d.ts +1 -0
  165. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +3 -2
  166. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +2 -2
  167. package/lib/typescript/components/UNAccountComponent/index.d.ts +1 -0
  168. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +2 -1
  169. package/lib/typescript/components/UNActivityComponent/index.d.ts +1 -0
  170. package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
  171. package/lib/typescript/components/UNBookPaymentComponent/index.d.ts +1 -0
  172. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +2 -1
  173. package/lib/typescript/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.d.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.d.ts} +2 -2
  174. package/lib/typescript/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.d.ts +1 -0
  175. package/lib/typescript/components/UNBottomSheetComponent/components/index.d.ts +1 -0
  176. package/lib/typescript/components/UNBottomSheetComponent/index.d.ts +1 -0
  177. package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +4 -1
  178. package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +2 -0
  179. package/lib/typescript/components/UNCardComponent/index.d.ts +1 -0
  180. package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -1
  181. package/lib/typescript/components/UNCheckDepositComponent/index.d.ts +1 -0
  182. package/lib/typescript/components/index.d.ts +8 -8
  183. package/lib/typescript/helpers/pushProvisioningService/hooks/useLaunchInitialize.d.ts +3 -0
  184. package/lib/typescript/helpers/store/helpers.d.ts +3 -0
  185. package/lib/typescript/networking/requests/UNWalletPayloadRequest.d.ts +2 -2
  186. package/lib/typescript/scripts/html/bodyScript.d.ts +2 -0
  187. package/lib/typescript/slices/pushProvisioningSlice.d.ts +8 -0
  188. package/lib/typescript/store/index.d.ts +1 -0
  189. package/lib/typescript/store/store.d.ts +6 -0
  190. package/lib/typescript/types/shared/index.d.ts +1 -0
  191. package/lib/typescript/types/shared/versioning.types.d.ts +22 -0
  192. package/lib/typescript/unitSdkManager/UnitSdk.constants.d.ts +8 -0
  193. package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +11 -6
  194. package/lib/typescript/unitSdkManager/UnitSdkManager.utils.internal.d.ts +3 -0
  195. package/lib/typescript/utils/webVersioningStrategy.utils.d.ts +5 -0
  196. package/package.json +7 -24
  197. package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +5 -1
  198. package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -0
  199. package/src/components/UNACHCreditComponent/index.ts +1 -0
  200. package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +5 -1
  201. package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -0
  202. package/src/components/UNACHDebitComponent/index.ts +1 -0
  203. package/src/components/UNAccountComponent/UNAccountComponent.tsx +5 -2
  204. package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
  205. package/src/components/UNAccountComponent/index.ts +1 -0
  206. package/src/components/UNActivityComponent/UNActivityComponent.tsx +4 -1
  207. package/src/components/UNActivityComponent/index.ts +1 -0
  208. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +4 -1
  209. package/src/components/UNBookPaymentComponent/index.ts +1 -0
  210. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +25 -23
  211. package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.tsx → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.tsx} +12 -12
  212. package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.ts +1 -0
  213. package/src/components/UNBottomSheetComponent/components/index.ts +1 -0
  214. package/src/components/UNBottomSheetComponent/index.ts +1 -0
  215. package/src/components/UNCardComponent/UNCardComponent.tsx +45 -9
  216. package/src/components/UNCardComponent/UNCardComponent.utils.ts +7 -0
  217. package/src/components/UNCardComponent/index.ts +1 -0
  218. package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -1
  219. package/src/components/UNCheckDepositComponent/index.ts +1 -0
  220. package/src/components/index.ts +8 -8
  221. package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +13 -3
  222. package/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.ts +29 -0
  223. package/src/helpers/store/helpers.tsx +22 -0
  224. package/src/networking/requests/UNWalletPayloadRequest.ts +5 -3
  225. package/src/scripts/html/bodyScript.ts +13 -1
  226. package/src/slices/pushProvisioningSlice.ts +24 -0
  227. package/src/store/index.ts +1 -0
  228. package/src/store/store.ts +10 -0
  229. package/src/types/shared/index.ts +1 -0
  230. package/src/types/shared/versioning.types.ts +28 -0
  231. package/src/unitSdkManager/UnitSdk.api.ts +5 -2
  232. package/src/unitSdkManager/UnitSdk.constants.ts +11 -0
  233. package/src/unitSdkManager/UnitSdkManager.ts +19 -10
  234. package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +13 -0
  235. package/src/utils/webVersioningStrategy.utils.ts +52 -0
  236. package/src/webComponent/html.ts +16 -2
  237. package/android/src/main/res/drawable/ic_launcher_background.xml +0 -170
  238. package/android/src/main/res/drawable/un_ic_launcher_foreground.xml +0 -30
  239. package/android/src/main/res/drawable-v24/ic_launcher_background.xml +0 -170
  240. package/android/src/main/res/drawable-v24/un_ic_launcher_foreground.xml +0 -30
  241. package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
  242. package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
  243. package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
  244. package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
  245. package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
  246. package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
  247. package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
  248. package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
  249. package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
  250. package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
  251. package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
  252. package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
  253. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
  254. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
  255. /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
  256. /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
  257. /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
  258. /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
  259. /package/lib/typescript/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.d.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.d.ts} +0 -0
  260. /package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unit-components",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "description": "Unit React Native components",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -26,7 +26,6 @@
26
26
  "typescript": "tsc --noEmit",
27
27
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
28
28
  "prepare": "bob build",
29
- "release": "release-it",
30
29
  "example": "yarn --cwd example",
31
30
  "bootstrap": "yarn example && yarn && yarn example pods"
32
31
  },
@@ -48,8 +47,8 @@
48
47
  "@react-native-community/eslint-config": "^3.0.2",
49
48
  "@release-it/conventional-changelog": "^5.0.0",
50
49
  "@types/jest": "^28.1.2",
51
- "@types/react": "~17.0.21",
52
- "@types/react-native": "0.68.0",
50
+ "@types/react": "~18.0.0",
51
+ "@types/react-native": "0.72.2",
53
52
  "@typescript-eslint/eslint-plugin": "^5.45.0",
54
53
  "@typescript-eslint/parser": "^5.45.0",
55
54
  "commitlint": "^17.0.2",
@@ -65,11 +64,10 @@
65
64
  "react-native": "0.68.2",
66
65
  "react-native-builder-bob": "^0.18.3",
67
66
  "react-native-webview": "11.23.1",
68
- "release-it": "^15.0.0",
69
67
  "typescript": "^4.5.2"
70
68
  },
71
69
  "resolutions": {
72
- "@types/react": "17.0.21"
70
+ "@types/react": "18.0.0"
73
71
  },
74
72
  "peerDependencies": {
75
73
  "react": "*",
@@ -78,9 +76,11 @@
78
76
  "react-native-webview": "*"
79
77
  },
80
78
  "dependencies": {
79
+ "@reduxjs/toolkit": "^1.9.5",
81
80
  "axios": "^1.3.3",
82
81
  "react-native-plaid-link-sdk": "^9.0.1",
83
- "react-native-webview": "11.23.1"
82
+ "react-native-webview": "11.23.1",
83
+ "react-redux": "^8.1.2"
84
84
  },
85
85
  "jest": {
86
86
  "preset": "react-native",
@@ -94,23 +94,6 @@
94
94
  "@commitlint/config-conventional"
95
95
  ]
96
96
  },
97
- "release-it": {
98
- "git": {
99
- "commitMessage": "chore: release ${version}",
100
- "tagName": "v${version}"
101
- },
102
- "npm": {
103
- "publish": true
104
- },
105
- "github": {
106
- "release": true
107
- },
108
- "plugins": {
109
- "@release-it/conventional-changelog": {
110
- "preset": "angular"
111
- }
112
- }
113
- },
114
97
  "eslintConfig": {
115
98
  "root": true,
116
99
  "parser": "@babel/eslint-parser",
@@ -13,6 +13,7 @@ import { LinkSuccess, openLink } from 'react-native-plaid-link-sdk';
13
13
  import type WebView from 'react-native-webview';
14
14
  import { getAndroidPackageName } from '../utils/nativeModulesInfo';
15
15
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
16
+ import { withReduxStore } from '../../helpers/store/helpers';
16
17
 
17
18
  export interface UNACHCreditComponentProps {
18
19
  accountId: string;
@@ -24,9 +25,10 @@ export interface UNACHCreditComponentProps {
24
25
  withPlaid?: boolean;
25
26
  onPaymentCreated?: (data: UNACHData) => void;
26
27
  onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
28
+ sameDay?: boolean;
27
29
  }
28
30
 
29
- export const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
31
+ const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
30
32
  const [height, setHeight] = useState<number>(0);
31
33
  const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
32
34
  const [linkToken, setLinkToken] = useState<string>();
@@ -139,3 +141,5 @@ export const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
139
141
  </View>
140
142
  );
141
143
  };
144
+
145
+ export default withReduxStore<UNACHCreditComponentProps>(UNACHCreditComponent);
@@ -11,6 +11,7 @@ export const getACHCreditParams = (props: UNACHCreditComponentProps) => {
11
11
  is-auto-focus="${props.isAutoFocus ?? false}"
12
12
  ${props.fee ? `fee="${props.fee}"` : ''}
13
13
  style="height: 100%"
14
+ same-day="${props.sameDay ?? false}"
14
15
  `;
15
16
  };
16
17
 
@@ -0,0 +1 @@
1
+ export { default as UNACHCreditComponent, UNACHCreditComponentProps } from './UNACHCreditComponent';
@@ -14,6 +14,7 @@ import type { ACHEvent } from '../../messages/webMessages/achCreditMessage';
14
14
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
15
15
  import { getAndroidPackageName } from '../utils/nativeModulesInfo';
16
16
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
17
+ import { withReduxStore } from '../../helpers/store/helpers';
17
18
 
18
19
  export interface UNACHDebitComponentProps {
19
20
  accountId: string;
@@ -24,9 +25,10 @@ export interface UNACHDebitComponentProps {
24
25
  fee?: number;
25
26
  onPaymentCreated?: (data: UNACHData) => void;
26
27
  onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
28
+ sameDay?: boolean;
27
29
  }
28
30
 
29
- export const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
31
+ const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
30
32
  const [height, setHeight] = useState<number>(0);
31
33
  const [appPackageName, setAppPackageName] = useState<string>('');
32
34
  const [linkToken, setLinkToken] = useState<string>('');
@@ -140,3 +142,5 @@ export const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
140
142
 
141
143
  );
142
144
  };
145
+
146
+ export default withReduxStore<UNACHDebitComponentProps>(UNACHDebitComponent);
@@ -11,6 +11,7 @@ export const getACHDebitParams = (props: UNACHDebitComponentProps) => {
11
11
  is-auto-focus="${props.isAutoFocus ?? false}"
12
12
  ${props.fee ? `fee="${props.fee}"` : ''}
13
13
  style="height: 100%"
14
+ same-day="${props.sameDay ?? false}"
14
15
  `;
15
16
  };
16
17
 
@@ -0,0 +1 @@
1
+ export { default as UNACHDebitComponent, UNACHDebitComponentProps } from './UNACHDebitComponent';
@@ -16,6 +16,7 @@ import type { UNAccountMenuAction } from '../../types/shared';
16
16
  import { BottomSheetRenderingType, SlotRendering, type BottomSheetSlotData } from '../../types/internal/bottomSheet.types';
17
17
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
18
18
  import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
19
+ import { withReduxStoreAndRefForwarding } from '../../helpers/store/helpers';
19
20
 
20
21
  export interface UNAccountComponentProps {
21
22
  // inputs
@@ -38,12 +39,12 @@ export interface UNAccountRef {
38
39
  openAction: (action: UNAccountMenuAction) => void;
39
40
  }
40
41
 
41
- export enum AccountAction {
42
+ export enum UNAccountAction {
42
43
  List = 'account-list',
43
44
  Menu = 'account-menu'
44
45
  }
45
46
 
46
- export const UNAccountComponent = React.forwardRef<UNAccountRef, UNAccountComponentProps>(function UNAccountComponent(props, accountRef) {
47
+ const UNAccountComponent = React.forwardRef<UNAccountRef, UNAccountComponentProps>(function UNAccountComponent(props, accountRef) {
47
48
  const [height, setHeight] = useState(0);
48
49
 
49
50
  const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null);
@@ -136,3 +137,5 @@ export const UNAccountComponent = React.forwardRef<UNAccountRef, UNAccountCompon
136
137
  </View>
137
138
  );
138
139
  });
140
+
141
+ export default withReduxStoreAndRefForwarding<UNAccountComponentProps, UNAccountRef>(UNAccountComponent);
@@ -1,4 +1,4 @@
1
- import { AccountAction, UNAccountComponentProps } from './UNAccountComponent';
1
+ import { UNAccountAction, UNAccountComponentProps } from './UNAccountComponent';
2
2
  import { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';
3
3
  import type WebView from 'react-native-webview';
4
4
  import type { UNAccountMenuAction } from 'src/types/shared';
@@ -38,5 +38,5 @@ export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRe
38
38
  };
39
39
 
40
40
  export const getAccountActionType = (requestRendering: RequestRenderingEvent) => {
41
- return requestRendering.data.nativeComponent.includes(AccountAction.List) ? AccountAction.List : AccountAction.Menu;
41
+ return requestRendering.data.nativeComponent.includes(UNAccountAction.List) ? UNAccountAction.List : UNAccountAction.Menu;
42
42
  };
@@ -0,0 +1 @@
1
+ export { default as UNAccountComponent, UNAccountComponentProps, UNAccountRef } from './UNAccountComponent';
@@ -15,6 +15,7 @@ import { ActivityMessage } from '../../messages/webMessages/activityMessage';
15
15
  import { BottomSheetRenderingType, type BottomSheetSlotData, type SlotRendering } from '../../types/internal/bottomSheet.types';
16
16
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
17
17
  import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
18
+ import { withReduxStore } from '../../helpers/store/helpers';
18
19
 
19
20
  const DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;
20
21
  export interface UNActivityComponentProps {
@@ -32,7 +33,7 @@ export interface UNActivityComponentProps {
32
33
  onLoad?: (response: UNOnLoadResponse<UNActivityOnLoadData>) => void;
33
34
  }
34
35
 
35
- export const UNActivityComponent = (props: UNActivityComponentProps) => {
36
+ const UNActivityComponent = (props: UNActivityComponentProps) => {
36
37
  const webRef = useRef<WebView>(null);
37
38
  const [defaultHeight, setDefaultHeight] = useState<number>();
38
39
 
@@ -127,3 +128,5 @@ export const UNActivityComponent = (props: UNActivityComponentProps) => {
127
128
  </View>
128
129
  );
129
130
  };
131
+
132
+ export default withReduxStore<UNActivityComponentProps>(UNActivityComponent);
@@ -0,0 +1 @@
1
+ export { default as UNActivityComponent, UNActivityComponentProps } from './UNActivityComponent';
@@ -10,6 +10,7 @@ import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
10
10
  import type { BookPaymentEvent } from '../../messages/webMessages/bookPaymentMessage';
11
11
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
12
12
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
13
+ import { withReduxStore } from '../../helpers/store/helpers';
13
14
 
14
15
  export interface UNBookPaymentComponentProps {
15
16
  //inputs
@@ -29,7 +30,7 @@ export interface UNBookPaymentComponentProps {
29
30
  onLoad?: (response: UNOnLoadResponse<UNAccountData>) => void;
30
31
  }
31
32
 
32
- export const UNBookPaymentComponent = (props: UNBookPaymentComponentProps) => {
33
+ const UNBookPaymentComponent = (props: UNBookPaymentComponentProps) => {
33
34
  const [height, setHeight] = useState<number>(0);
34
35
  const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
35
36
 
@@ -99,3 +100,5 @@ export const UNBookPaymentComponent = (props: UNBookPaymentComponentProps) => {
99
100
  </View>
100
101
  );
101
102
  };
103
+
104
+ export default withReduxStore<UNBookPaymentComponentProps>(UNBookPaymentComponent);
@@ -0,0 +1 @@
1
+ export { default as UNBookPaymentComponent, UNBookPaymentComponentProps } from './UNBookPaymentComponent';
@@ -23,7 +23,7 @@ import { getStylesObject } from './UNBottomSheetComponent.styles';
23
23
  import { useAppStateListener } from '../../hooks/useAppStateListener';
24
24
  import { UNAddToWalletBottomSheetItem } from './components/UNAddToWalletBottomSheetItem';
25
25
  import { getAccountActionType } from '../UNAccountComponent/UNAccountComponent.utils';
26
- import { AccountAction } from '../UNAccountComponent/UNAccountComponent';
26
+ import { UNAccountAction } from '../UNAccountComponent/UNAccountComponent';
27
27
  import type { AccountChangedEvent } from '../../messages/webMessages/accountMessage';
28
28
  import { AccountMessage } from '../../messages/webMessages/accountMessage';
29
29
  import { ActivityFiltersChangedEvent, ActivityMessage } from '../../messages/webMessages/activityMessage';
@@ -31,6 +31,7 @@ import { BOTTOM_SHEET_MAX_PERCENTAGE_SIZE } from './UNBottomSheetComponent.const
31
31
  import { BottomSheetRenderingType, BottomSheetSlotData, NativeComponentData, WebComponentData } from '../../types/internal/bottomSheet.types';
32
32
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
33
33
  import { BottomSheetNativeMessage, type StartBottomSheetFlowMessage } from '../../messages/nativeMessages/bottomSheetMessage';
34
+ import { withReduxStore } from '../../helpers/store/helpers';
34
35
 
35
36
  export enum ScrollState {
36
37
  /*
@@ -55,7 +56,7 @@ export enum ScrollState {
55
56
  onlyBottomSheet = 'onlyBottomSheet',
56
57
  }
57
58
 
58
- export const UNBottomSheetComponent = () => {
59
+ const UNBottomSheetComponent = () => {
59
60
  const [isBottomSheetActive, setIsBottomSheetActive] = useState(false);
60
61
  const [height, setHeight] = useState(0);
61
62
 
@@ -142,7 +143,7 @@ export const UNBottomSheetComponent = () => {
142
143
  }
143
144
  }, [shouldShowComponent, newHeightMessage, isAddToWallet]);
144
145
 
145
- useListenerToBus({ busEventKey: BottomSheetNativeMessage.START_FLOW, action: startFlow });
146
+ useListenerToBus({ busEventKey: BottomSheetNativeMessage.START_FLOW, action: startFlow });
146
147
  useListenerToBus({ busEventKey: UnitMessage.UNIT_REQUEST_CLOSE_FLOW, action: handleCloseFlow });
147
148
 
148
149
  const defineScrollState = () => {
@@ -152,7 +153,7 @@ export const UNBottomSheetComponent = () => {
152
153
  case WebComponentType.account: {
153
154
  const accountActionType = getAccountActionType(bottomSheetSlotData.requestRenderingEvent);
154
155
  setScrollState(
155
- accountActionType === AccountAction.List ? ScrollState.onTop : ScrollState.unScrollable
156
+ accountActionType === UNAccountAction.List ? ScrollState.onTop : ScrollState.unScrollable
156
157
  );
157
158
  break;
158
159
  }
@@ -205,7 +206,8 @@ export const UNBottomSheetComponent = () => {
205
206
  injectHtmlFullScreenHeight(webRef.current, fullScreenHeight);
206
207
  setHeight(fullScreenHeight);
207
208
  } else {
208
- setHeight((message.details as HeightEvent).height);
209
+ const height = (message.details as HeightEvent).height;
210
+ setHeight(height < fullScreenHeight ? height : fullScreenHeight);
209
211
  }
210
212
  }
211
213
  };
@@ -285,7 +287,7 @@ export const UNBottomSheetComponent = () => {
285
287
  switch (renderingType) {
286
288
  case BottomSheetRenderingType.Slot:
287
289
  if (bottomSheetSlotData?.requestRenderingEvent.data.nativeComponent?.includes('action=AddToWallet') && bottomSheetSlotData?.componentResourceId) {
288
- return <UNAddToWalletBottomSheetItem renderingType={renderingType} renderingRequest={bottomSheetSlotData.requestRenderingEvent} cardId={bottomSheetSlotData?.componentResourceId} fullScreenHeight={fullScreenHeight}/>;
290
+ return <UNAddToWalletBottomSheetItem renderingType={renderingType} renderingRequest={bottomSheetSlotData.requestRenderingEvent} cardId={bottomSheetSlotData?.componentResourceId} fullScreenHeight={fullScreenHeight} />;
289
291
  }
290
292
 
291
293
  return (
@@ -303,7 +305,7 @@ export const UNBottomSheetComponent = () => {
303
305
  if (webComponentData?.params?.includes('action=AddToWallet')) {
304
306
  const cardId = extractCardIdFromComponentParams(webComponentData);
305
307
  if (!cardId) return null;
306
- return <UNAddToWalletBottomSheetItem renderingType={renderingType} webComponentData={webComponentData} cardId={cardId} fullScreenHeight={fullScreenHeight}/>;
308
+ return <UNAddToWalletBottomSheetItem renderingType={renderingType} webComponentData={webComponentData} cardId={cardId} fullScreenHeight={fullScreenHeight} />;
307
309
  }
308
310
  return null;
309
311
  case BottomSheetRenderingType.NativeComponent:
@@ -312,22 +314,22 @@ export const UNBottomSheetComponent = () => {
312
314
  };
313
315
 
314
316
  return (
315
- <>
316
- <View
317
- pointerEvents={isBottomSheetActive ? undefined : 'none'}
318
- style={styles.container}
317
+ <View
318
+ pointerEvents={isBottomSheetActive ? undefined : 'none'}
319
+ style={styles.container}
320
+ >
321
+ <BottomSheet
322
+ isOpen={isBottomSheetActive}
323
+ height={height}
324
+ onClose={() => setIsBottomSheetActive(false)}
325
+ onOpen={() => setIsBottomSheetActive(true)}
326
+ handleWebViewScroll={() => handleWebViewScroll()}
327
+ shouldEnableBottomSheetScroll={scrollState !== ScrollState.onlyWebView}
319
328
  >
320
- <BottomSheet
321
- isOpen={isBottomSheetActive}
322
- height={height}
323
- onClose={() => setIsBottomSheetActive(false)}
324
- onOpen={() => setIsBottomSheetActive(true)}
325
- handleWebViewScroll={() => handleWebViewScroll()}
326
- shouldEnableBottomSheetScroll={scrollState !== ScrollState.onlyWebView}
327
- >
328
- {isAppActive && renderBottomSheetItem()}
329
- </BottomSheet >
330
- </View >
331
- </>
329
+ {isAppActive && renderBottomSheetItem()}
330
+ </BottomSheet >
331
+ </View >
332
332
  );
333
333
  };
334
+
335
+ export default withReduxStore(UNBottomSheetComponent);
@@ -1,18 +1,18 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import type WebView from 'react-native-webview';
3
- import { WebComponent } from '../../../webComponent/WebComponent';
4
- import { injectHtmlFullScreenHeight, renderingBottomSheetRequest } from '../UNBottomSheetComponent.utils';
3
+ import { WebComponent } from '../../../../webComponent/WebComponent';
4
+ import { injectHtmlFullScreenHeight, renderingBottomSheetRequest } from '../../UNBottomSheetComponent.utils';
5
5
  import { getStylesObject } from './UNAddToWalletBottomSheetItem.styles';
6
6
  import { ActivityIndicator } from 'react-native';
7
- import { UnitMessage, type RequestRenderingEvent } from '../../../messages/webMessages/unitMessages';
8
- import UnitAddToWalletButtonView from '../../../nativeComponent/UnitAddToWalletButton';
9
- import { UNCardAddToWalletStatus } from '../../../types/shared/wallet.types';
10
- import { BottomSheetRenderingType, WebComponentData } from '../../../types/internal/bottomSheet.types';
11
- import { PresentationMode, WebComponentType } from '../../../types/internal/webComponent.types';
12
- import { useCardWallet } from '../../../helpers/pushProvisioningService/hooks/useCardWallet';
13
- import { launchStartCardProvisioning } from '../../../helpers/pushProvisioningService/startProvisioning';
14
- import type { WebViewMessage } from '../../../messages/webMessages';
15
- import EventBus from '../../../helpers/EventBus';
7
+ import { UnitMessage, type RequestRenderingEvent } from '../../../../messages/webMessages/unitMessages';
8
+ import UnitAddToWalletButtonView from '../../../../nativeComponent/UnitAddToWalletButton';
9
+ import { UNCardAddToWalletStatus } from '../../../../types/shared/wallet.types';
10
+ import { BottomSheetRenderingType, WebComponentData } from '../../../../types/internal/bottomSheet.types';
11
+ import { PresentationMode, WebComponentType } from '../../../../types/internal/webComponent.types';
12
+ import { useCardWallet } from '../../../../helpers/pushProvisioningService/hooks/useCardWallet';
13
+ import { launchStartCardProvisioning } from '../../../../helpers/pushProvisioningService/startProvisioning';
14
+ import type { WebViewMessage } from '../../../../messages/webMessages';
15
+ import EventBus from '../../../../helpers/EventBus';
16
16
 
17
17
  export interface UNAddToWalletBottomSheetItemProps {
18
18
  renderingType: BottomSheetRenderingType
@@ -48,7 +48,7 @@ export const UNAddToWalletBottomSheetItem = (props: UNAddToWalletBottomSheetItem
48
48
  launchStartCardProvisioning(currentUNWallet);
49
49
  };
50
50
 
51
- const handleWebComponentMessage = (message: WebViewMessage) => {
51
+ const handleWebComponentMessage = (message: WebViewMessage) => {
52
52
  if (!message || !message.type) return;
53
53
  switch (message.type) {
54
54
  case UnitMessage.UNIT_ON_LOAD:
@@ -0,0 +1 @@
1
+ export * from './UNAddToWalletBottomSheetItem';
@@ -0,0 +1 @@
1
+ export * from './UNAddToWalletBottomSheetItem';
@@ -0,0 +1 @@
1
+ export { default as UNBottomSheetComponent } from './UNBottomSheetComponent';
@@ -7,15 +7,32 @@ import EventBus from '../../helpers/EventBus';
7
7
  import { WebComponent } from '../../webComponent/WebComponent';
8
8
  import { useListenerToBus } from '../../hooks/listenerToBus';
9
9
  import type { WebViewMessage } from '../../messages/webMessages';
10
- import { getCardParams, getCardScript, injectRefreshEventIfNeeded, injectOpenActionsMenuScript, injectRequestCardActionScript } from './UNCardComponent.utils';
10
+ import {
11
+ getCardParams,
12
+ getCardScript,
13
+ injectRefreshEventIfNeeded,
14
+ injectOpenActionsMenuScript,
15
+ injectRequestCardActionScript,
16
+ injectRequestShowSensitiveDataScript, injectRequestHideSensitiveDataScript,
17
+ } from './UNCardComponent.utils';
11
18
  import type { UNOnLoadResponse, UNCardData, UNError, UNCardMenuAction } from '../../types/shared';
12
19
  import { CardMessage } from '../../messages/webMessages/cardMessage';
13
20
  import type { NativeModules } from 'react-native';
14
21
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
15
- import { BottomSheetRenderingType, SlotRendering, type BottomSheetSlotData } from '../../types/internal/bottomSheet.types';
22
+ import {
23
+ BottomSheetRenderingType,
24
+ SlotRendering,
25
+ type BottomSheetSlotData,
26
+ } from '../../types/internal/bottomSheet.types';
16
27
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
17
28
  import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
18
29
  import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
30
+ import { useLaunchInitialize } from '../../helpers/pushProvisioningService/hooks/useLaunchInitialize';
31
+ import { selectWallet } from '../../slices/pushProvisioningSlice';
32
+ import { useSelector } from 'react-redux';
33
+ import { withReduxStoreAndRefForwarding } from '../../helpers/store/helpers';
34
+
35
+
19
36
  export interface UNCardComponentProps {
20
37
  // inputs
21
38
  cardId: string;
@@ -30,20 +47,25 @@ export interface UNCardComponentProps {
30
47
  hideSensitiveDataButton?: boolean;
31
48
 
32
49
  // events
33
- onLoad?: (response: UNOnLoadResponse<UNCardData>) => void
50
+ onLoad?: (response: UNOnLoadResponse<UNCardData>) => void;
34
51
  onStatusChanged?: (card: UNCardData) => void;
35
52
  onCardActivated?: (card: UNCardData) => void;
36
53
  pushProvisioningModule?: typeof NativeModules;
37
54
  }
55
+
38
56
  export interface CardRef {
39
57
  openActionsMenu: () => void;
40
58
  openAction: (action: UNCardMenuAction) => void;
59
+ showSensitiveData: () => void;
60
+ hideSensitiveData: () => void;
41
61
  }
42
62
 
43
- export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(function UNCardComponent(props, cardRef) {
63
+ const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(function UNCardComponent(props, cardRef) {
44
64
  const [height, setHeight] = useState(0);
45
65
 
46
66
  const webRef = useRef<WebView>(null);
67
+ const { initializePushProvisioning } = useLaunchInitialize();
68
+ const { signedNonce } = useSelector(selectWallet);
47
69
 
48
70
  useImperativeHandle(cardRef, () => ({
49
71
  openActionsMenu() {
@@ -51,7 +73,13 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
51
73
  },
52
74
  openAction(action: UNCardMenuAction) {
53
75
  injectRequestCardActionScript(webRef.current, action);
54
- }
76
+ },
77
+ showSensitiveData() {
78
+ injectRequestShowSensitiveDataScript(webRef.current);
79
+ },
80
+ hideSensitiveData() {
81
+ injectRequestHideSensitiveDataScript(webRef.current);
82
+ },
55
83
  }));
56
84
 
57
85
  const cardStatusChanged = (card: UNCardData) => {
@@ -102,12 +130,12 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
102
130
  const slotData: BottomSheetSlotData = {
103
131
  componentName: WebComponentType.card,
104
132
  componentResourceId: props.cardId,
105
- requestRenderingEvent: message.details as RequestRenderingEvent
133
+ requestRenderingEvent: message.details as RequestRenderingEvent,
106
134
  };
107
135
 
108
136
  const event = {
109
137
  type: BottomSheetRenderingType.Slot,
110
- data: slotData
138
+ data: slotData,
111
139
  } as SlotRendering;
112
140
 
113
141
  EventBus.Instance.event(BottomSheetNativeMessage.START_FLOW, event);
@@ -132,8 +160,13 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
132
160
  }
133
161
  }, [props.pushProvisioningModule]);
134
162
 
163
+ useEffect(() => {
164
+ if (signedNonce || !UnitSDK.getPushProvisionModule()) return;
165
+ initializePushProvisioning();
166
+ }, []);
167
+
135
168
  return (
136
- <View style={{ height, width: '100%' }}>
169
+ <View style={{ height, width: '100%', minWidth: 235 }}>
137
170
  <WebComponent
138
171
  ref={webRef}
139
172
  type={WebComponentType.card}
@@ -145,6 +178,9 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
145
178
  onMessage={message => handleMessage(message)}
146
179
  isScrollable={false}
147
180
  />
148
- </View>
181
+ </View >
149
182
  );
183
+
150
184
  });
185
+
186
+ export default withReduxStoreAndRefForwarding<UNCardComponentProps, CardRef>(UNCardComponent);
@@ -29,6 +29,13 @@ export const injectRequestCardActionScript = (currentWeb: WebView | null, action
29
29
  currentWeb?.injectJavaScript(`dispatchRequestCardAction('${action}')`);
30
30
  };
31
31
 
32
+ export const injectRequestHideSensitiveDataScript = (currentWeb: WebView | null) => {
33
+ currentWeb?.injectJavaScript(`dispatchRequestHideSensitiveData('${WebComponentType.card}')`);
34
+ };
35
+
36
+ export const injectRequestShowSensitiveDataScript = (currentWeb: WebView | null) => {
37
+ currentWeb?.injectJavaScript(`dispatchRequestShowSensitiveData('${WebComponentType.card}')`);
38
+ };
32
39
  export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {
33
40
  if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {
34
41
  currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
@@ -0,0 +1 @@
1
+ export { default as UNCardComponent, UNCardComponentProps, CardRef } from './UNCardComponent';
@@ -10,6 +10,7 @@ import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
10
10
  import type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';
11
11
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
12
12
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
13
+ import { withReduxStore } from '../../helpers/store/helpers';
13
14
 
14
15
  const { Camera } = NativeModules;
15
16
 
@@ -24,7 +25,7 @@ export interface UNCheckDepositComponentProps {
24
25
  onRestartRequest?: (checkData: UNCheckDepositData) => void
25
26
  }
26
27
 
27
- export const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {
28
+ const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {
28
29
  const [height, setHeight] = useState<number>(0);
29
30
  const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
30
31
 
@@ -112,3 +113,5 @@ export const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) =>
112
113
  </View>
113
114
  );
114
115
  };
116
+
117
+ export default withReduxStore<UNCheckDepositComponentProps>(UNCheckDepositComponent);
@@ -0,0 +1 @@
1
+ export { default as UNCheckDepositComponent, UNCheckDepositComponentProps } from './UNCheckDepositComponent';
@@ -1,8 +1,8 @@
1
- export * from './UNCardComponent/UNCardComponent';
2
- export * from './UNBottomSheetComponent/UNBottomSheetComponent';
3
- export * from './UNBookPaymentComponent/UNBookPaymentComponent';
4
- export * from './UNActivityComponent/UNActivityComponent';
5
- export * from './UNAccountComponent/UNAccountComponent';
6
- export * from './UNCheckDepositComponent/UNCheckDepositComponent';
7
- export * from './UNACHDebitComponent/UNACHDebitComponent';
8
- export * from './UNACHCreditComponent/UNACHCreditComponent';
1
+ export * from './UNCardComponent';
2
+ export * from './UNBottomSheetComponent';
3
+ export * from './UNBookPaymentComponent';
4
+ export * from './UNActivityComponent';
5
+ export * from './UNAccountComponent';
6
+ export * from './UNCheckDepositComponent';
7
+ export * from './UNACHDebitComponent';
8
+ export * from './UNACHCreditComponent';
@@ -2,6 +2,9 @@ import { useEffect, useState } from 'react';
2
2
  import { UNWalletCode, type UNWallet, UNWalletName } from '../../../types/shared/wallet.types';
3
3
  import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
4
4
  import { getMobileWalletPayload } from '../../../networking/requests/UNWalletPayloadRequest';
5
+ import { useSelector } from 'react-redux';
6
+ import { selectWallet } from '../../../slices/pushProvisioningSlice';
7
+ import { useLaunchInitialize } from './useLaunchInitialize';
5
8
 
6
9
  export type CardToEncryptedPayload = {
7
10
  [cardId: string]: string;
@@ -9,6 +12,8 @@ export type CardToEncryptedPayload = {
9
12
 
10
13
  export const useCardWallet = (cardId: string) => {
11
14
  const [currentUNWallet, setCurrentUNWallet] = useState<UNWallet>();
15
+ const { signedNonce } = useSelector(selectWallet);
16
+ const { initializePushProvisioning } = useLaunchInitialize();
12
17
 
13
18
  useEffect(() => {
14
19
  const getEncryptedPayload = async () => {
@@ -16,7 +21,12 @@ export const useCardWallet = (cardId: string) => {
16
21
  const customerToken = UnitSDK.getCustomerToken();
17
22
  if (!env || !customerToken) return;
18
23
 
19
- const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env);
24
+ // In case we use flow
25
+ if (!signedNonce) {
26
+ await initializePushProvisioning();
27
+ return;
28
+ }
29
+ const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env, signedNonce);
20
30
  return encryptedPayload;
21
31
  };
22
32
 
@@ -25,6 +35,7 @@ export const useCardWallet = (cardId: string) => {
25
35
  if (!currentProvisioningModule) return;
26
36
  try {
27
37
  const encryptedPayload = await getEncryptedPayload();
38
+ if (!encryptedPayload) return;
28
39
  const walletsResponse = await currentProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));
29
40
 
30
41
  const unWallet: UNWallet | null = parseWalletsResponse(walletsResponse);
@@ -37,8 +48,7 @@ export const useCardWallet = (cardId: string) => {
37
48
  };
38
49
 
39
50
  getCardWalletData();
40
-
41
- }, [cardId]);
51
+ }, [signedNonce, cardId]);
42
52
 
43
53
  return {
44
54
  currentUNWallet