react-native-unit-components 1.5.0 → 1.7.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 (324) hide show
  1. package/ios/UNAppInfo/UNAppInfo.swift +5 -1
  2. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +50 -8
  3. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  4. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +18 -11
  5. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
  6. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +9 -11
  7. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  8. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +2 -23
  9. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
  10. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +12 -6
  11. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  12. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +5 -4
  13. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  14. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +12 -6
  15. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  16. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +4 -3
  17. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  18. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +6 -6
  19. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  20. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +1 -0
  21. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
  22. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
  23. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  24. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +28 -8
  25. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  26. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +49 -37
  27. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
  28. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +20 -50
  29. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
  30. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +5 -53
  31. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  32. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +6 -6
  33. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  34. package/lib/commonjs/components/utils/nativeModulesInfo.js +20 -0
  35. package/lib/commonjs/components/utils/nativeModulesInfo.js.map +1 -0
  36. package/lib/commonjs/flows/UNFlows.js +19 -0
  37. package/lib/commonjs/flows/UNFlows.js.map +1 -0
  38. package/lib/commonjs/flows/card/UNCardFlows.js +33 -0
  39. package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -0
  40. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +70 -0
  41. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
  42. package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js +22 -0
  43. package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
  44. package/lib/commonjs/index.js +4 -4
  45. package/lib/commonjs/index.js.map +1 -1
  46. package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js +17 -0
  47. package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
  48. package/lib/commonjs/messages/nativeMessages/cardMessage.js +2 -8
  49. package/lib/commonjs/messages/nativeMessages/cardMessage.js.map +1 -1
  50. package/lib/commonjs/messages/nativeMessages/index.js.map +1 -1
  51. package/lib/commonjs/messages/webMessages/accountMessage.js.map +1 -1
  52. package/lib/commonjs/messages/webMessages/achCreditMessage.js.map +1 -1
  53. package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -1
  54. package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
  55. package/lib/commonjs/messages/webMessages/checkMessage.js.map +1 -1
  56. package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
  57. package/lib/commonjs/messages/webMessages/unitMessages.js +1 -0
  58. package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
  59. package/lib/commonjs/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
  60. package/lib/commonjs/networking/common/UNNetworkConstants.js.map +1 -0
  61. package/lib/commonjs/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +3 -1
  62. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -0
  63. package/lib/commonjs/scripts/html/bodyHtml.js +4 -10
  64. package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -1
  65. package/lib/commonjs/scripts/html/bodyScript.js +13 -2
  66. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
  67. package/lib/commonjs/types/internal/bottomSheet.types.js +14 -0
  68. package/lib/commonjs/types/internal/bottomSheet.types.js.map +1 -0
  69. package/lib/commonjs/types/internal/webComponent.types.js +27 -0
  70. package/lib/commonjs/types/internal/webComponent.types.js.map +1 -0
  71. package/lib/commonjs/types/shared/achCredit.types.js.map +1 -0
  72. package/lib/commonjs/types/shared/activity.types.js.map +1 -0
  73. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +20 -2
  74. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
  75. package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js +21 -0
  76. package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
  77. package/lib/commonjs/webComponent/WebComponent.js +6 -16
  78. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  79. package/lib/commonjs/webComponent/html.js +3 -1
  80. package/lib/commonjs/webComponent/html.js.map +1 -1
  81. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +49 -7
  82. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  83. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +16 -10
  84. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
  85. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +5 -7
  86. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  87. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -21
  88. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
  89. package/lib/module/components/UNAccountComponent/UNAccountComponent.js +10 -4
  90. package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  91. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +3 -2
  92. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  93. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +10 -4
  94. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  95. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +3 -2
  96. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  97. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -2
  98. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  99. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +1 -0
  100. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
  101. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
  102. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  103. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +23 -6
  104. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  105. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +51 -39
  106. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
  107. package/lib/module/components/UNCardComponent/UNCardComponent.js +20 -51
  108. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
  109. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +2 -48
  110. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  111. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +2 -2
  112. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  113. package/lib/module/components/utils/nativeModulesInfo.js +13 -0
  114. package/lib/module/components/utils/nativeModulesInfo.js.map +1 -0
  115. package/lib/module/flows/UNFlows.js +12 -0
  116. package/lib/module/flows/UNFlows.js.map +1 -0
  117. package/lib/module/flows/card/UNCardFlows.js +25 -0
  118. package/lib/module/flows/card/UNCardFlows.js.map +1 -0
  119. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +63 -0
  120. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
  121. package/lib/module/helpers/pushProvisioningService/startProvisioning.js +15 -0
  122. package/lib/module/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
  123. package/lib/module/index.js +1 -1
  124. package/lib/module/index.js.map +1 -1
  125. package/lib/module/messages/nativeMessages/bottomSheetMessage.js +9 -0
  126. package/lib/module/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
  127. package/lib/module/messages/nativeMessages/cardMessage.js +1 -6
  128. package/lib/module/messages/nativeMessages/cardMessage.js.map +1 -1
  129. package/lib/module/messages/nativeMessages/index.js.map +1 -1
  130. package/lib/module/messages/webMessages/accountMessage.js.map +1 -1
  131. package/lib/module/messages/webMessages/achCreditMessage.js.map +1 -1
  132. package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -1
  133. package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
  134. package/lib/module/messages/webMessages/checkMessage.js.map +1 -1
  135. package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
  136. package/lib/module/messages/webMessages/unitMessages.js +1 -0
  137. package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
  138. package/lib/module/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
  139. package/lib/module/networking/common/UNNetworkConstants.js.map +1 -0
  140. package/lib/module/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +4 -1
  141. package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -0
  142. package/lib/module/scripts/html/bodyHtml.js +1 -6
  143. package/lib/module/scripts/html/bodyHtml.js.map +1 -1
  144. package/lib/module/scripts/html/bodyScript.js +13 -2
  145. package/lib/module/scripts/html/bodyScript.js.map +1 -1
  146. package/lib/module/types/internal/bottomSheet.types.js +7 -0
  147. package/lib/module/types/internal/bottomSheet.types.js.map +1 -0
  148. package/lib/module/types/internal/webComponent.types.js +19 -0
  149. package/lib/module/types/internal/webComponent.types.js.map +1 -0
  150. package/lib/module/types/shared/achCredit.types.js.map +1 -0
  151. package/lib/module/types/shared/activity.types.js.map +1 -0
  152. package/lib/module/unitSdkManager/UnitSdkManager.js +20 -2
  153. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
  154. package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js +14 -0
  155. package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
  156. package/lib/module/webComponent/WebComponent.js +5 -14
  157. package/lib/module/webComponent/WebComponent.js.map +1 -1
  158. package/lib/module/webComponent/html.js +3 -1
  159. package/lib/module/webComponent/html.js.map +1 -1
  160. package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +2 -1
  161. package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +4 -1
  162. package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +1 -1
  163. package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +0 -1
  164. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +3 -3
  165. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +1 -1
  166. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +3 -3
  167. package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
  168. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +0 -7
  169. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -1
  170. package/lib/typescript/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.d.ts +6 -2
  171. package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +2 -1
  172. package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +1 -9
  173. package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -2
  174. package/lib/typescript/components/utils/nativeModulesInfo.d.ts +1 -0
  175. package/lib/typescript/flows/UNFlows.d.ts +4 -0
  176. package/lib/typescript/flows/card/UNCardFlows.d.ts +3 -0
  177. package/lib/typescript/helpers/pushProvisioningService/hooks/useCardWallet.d.ts +7 -0
  178. package/lib/typescript/helpers/pushProvisioningService/startProvisioning.d.ts +2 -0
  179. package/lib/typescript/index.d.ts +1 -1
  180. package/lib/typescript/messages/nativeMessages/bottomSheetMessage.d.ts +9 -0
  181. package/lib/typescript/messages/nativeMessages/cardMessage.d.ts +0 -16
  182. package/lib/typescript/messages/nativeMessages/index.d.ts +3 -3
  183. package/lib/typescript/messages/webMessages/accountMessage.d.ts +1 -1
  184. package/lib/typescript/messages/webMessages/achCreditMessage.d.ts +1 -1
  185. package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +1 -1
  186. package/lib/typescript/messages/webMessages/cardMessage.d.ts +1 -1
  187. package/lib/typescript/messages/webMessages/checkMessage.d.ts +1 -1
  188. package/lib/typescript/messages/webMessages/onLoadMessage.d.ts +3 -3
  189. package/lib/typescript/messages/webMessages/unitMessages.d.ts +2 -1
  190. package/lib/typescript/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.d.ts +1 -1
  191. package/lib/typescript/scripts/html/bodyHtml.d.ts +1 -5
  192. package/lib/typescript/scripts/html/bodyScript.d.ts +1 -0
  193. package/lib/typescript/types/internal/bottomSheet.types.d.ts +35 -0
  194. package/lib/typescript/types/internal/webComponent.types.d.ts +16 -0
  195. package/lib/typescript/{sharedTypes → types/shared}/achCredit.types.d.ts +1 -1
  196. package/lib/typescript/{sharedTypes → types/shared}/activity.types.d.ts +1 -1
  197. package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +9 -0
  198. package/lib/typescript/unitSdkManager/unitUiManager/unitUiManager.d.ts +6 -0
  199. package/lib/typescript/webComponent/WebComponent.d.ts +2 -11
  200. package/lib/typescript/webComponent/html.d.ts +1 -0
  201. package/package.json +1 -1
  202. package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +47 -8
  203. package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +14 -11
  204. package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +7 -11
  205. package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -20
  206. package/src/components/UNAccountComponent/UNAccountComponent.tsx +15 -8
  207. package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +4 -3
  208. package/src/components/UNActivityComponent/UNActivityComponent.tsx +15 -8
  209. package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +4 -2
  210. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +9 -3
  211. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +1 -0
  212. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +151 -76
  213. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +24 -6
  214. package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.tsx +72 -41
  215. package/src/components/UNCardComponent/UNCardComponent.tsx +25 -54
  216. package/src/components/UNCardComponent/UNCardComponent.utils.ts +3 -49
  217. package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -4
  218. package/src/components/utils/nativeModulesInfo.ts +11 -0
  219. package/src/flows/UNFlows.ts +13 -0
  220. package/src/flows/card/UNCardFlows.ts +25 -0
  221. package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +67 -0
  222. package/src/helpers/pushProvisioningService/startProvisioning.ts +20 -0
  223. package/src/index.tsx +1 -1
  224. package/src/messages/nativeMessages/bottomSheetMessage.ts +15 -0
  225. package/src/messages/nativeMessages/cardMessage.ts +1 -24
  226. package/src/messages/nativeMessages/index.ts +3 -3
  227. package/src/messages/webMessages/accountMessage.ts +1 -1
  228. package/src/messages/webMessages/achCreditMessage.ts +1 -1
  229. package/src/messages/webMessages/bookPaymentMessage.ts +1 -1
  230. package/src/messages/webMessages/cardMessage.ts +1 -1
  231. package/src/messages/webMessages/checkMessage.ts +1 -1
  232. package/src/messages/webMessages/onLoadMessage.ts +3 -3
  233. package/src/messages/webMessages/unitMessages.ts +3 -2
  234. package/src/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.ts +1 -1
  235. package/src/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.ts +3 -1
  236. package/src/scripts/html/bodyHtml.ts +2 -14
  237. package/src/scripts/html/bodyScript.ts +13 -3
  238. package/src/types/internal/bottomSheet.types.ts +43 -0
  239. package/src/types/internal/webComponent.types.ts +26 -0
  240. package/src/{sharedTypes → types/shared}/achCredit.types.ts +1 -1
  241. package/src/{sharedTypes → types/shared}/activity.types.ts +1 -1
  242. package/src/unitSdkManager/UnitSdkManager.ts +28 -2
  243. package/src/unitSdkManager/unitUiManager/unitUiManager.ts +13 -0
  244. package/src/webComponent/WebComponent.tsx +7 -15
  245. package/src/webComponent/html.ts +3 -1
  246. package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
  247. package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
  248. package/lib/commonjs/sharedTypes/achCredit.types.js.map +0 -1
  249. package/lib/commonjs/sharedTypes/activity.types.js.map +0 -1
  250. package/lib/module/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
  251. package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
  252. package/lib/module/sharedTypes/achCredit.types.js.map +0 -1
  253. package/lib/module/sharedTypes/activity.types.js.map +0 -1
  254. /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js +0 -0
  255. /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js.map +0 -0
  256. /package/lib/commonjs/{sharedTypes → types/shared}/achCredit.types.js +0 -0
  257. /package/lib/commonjs/{sharedTypes → types/shared}/activity.types.js +0 -0
  258. /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js +0 -0
  259. /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
  260. /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
  261. /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
  262. /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js +0 -0
  263. /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js.map +0 -0
  264. /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
  265. /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
  266. /package/lib/commonjs/{sharedTypes → types/shared}/index.js +0 -0
  267. /package/lib/commonjs/{sharedTypes → types/shared}/index.js.map +0 -0
  268. /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
  269. /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
  270. /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js +0 -0
  271. /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js.map +0 -0
  272. /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js +0 -0
  273. /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
  274. /package/lib/commonjs/{sharedTypes → types/shared}/types.js +0 -0
  275. /package/lib/commonjs/{sharedTypes → types/shared}/types.js.map +0 -0
  276. /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js +0 -0
  277. /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
  278. /package/lib/module/{sharedTypes → types/shared}/account.types.js +0 -0
  279. /package/lib/module/{sharedTypes → types/shared}/account.types.js.map +0 -0
  280. /package/lib/module/{sharedTypes → types/shared}/achCredit.types.js +0 -0
  281. /package/lib/module/{sharedTypes → types/shared}/activity.types.js +0 -0
  282. /package/lib/module/{sharedTypes → types/shared}/authorization.types.js +0 -0
  283. /package/lib/module/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
  284. /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
  285. /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
  286. /package/lib/module/{sharedTypes → types/shared}/card.types.js +0 -0
  287. /package/lib/module/{sharedTypes → types/shared}/card.types.js.map +0 -0
  288. /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
  289. /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
  290. /package/lib/module/{sharedTypes → types/shared}/index.js +0 -0
  291. /package/lib/module/{sharedTypes → types/shared}/index.js.map +0 -0
  292. /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
  293. /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
  294. /package/lib/module/{sharedTypes → types/shared}/payments.types.js +0 -0
  295. /package/lib/module/{sharedTypes → types/shared}/payments.types.js.map +0 -0
  296. /package/lib/module/{sharedTypes → types/shared}/transactions.types.js +0 -0
  297. /package/lib/module/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
  298. /package/lib/module/{sharedTypes → types/shared}/types.js +0 -0
  299. /package/lib/module/{sharedTypes → types/shared}/types.js.map +0 -0
  300. /package/lib/module/{sharedTypes → types/shared}/wallet.types.js +0 -0
  301. /package/lib/module/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
  302. /package/lib/typescript/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.d.ts +0 -0
  303. /package/lib/typescript/{sharedTypes → types/shared}/account.types.d.ts +0 -0
  304. /package/lib/typescript/{sharedTypes → types/shared}/authorization.types.d.ts +0 -0
  305. /package/lib/typescript/{sharedTypes → types/shared}/bookPayment.types.d.ts +0 -0
  306. /package/lib/typescript/{sharedTypes → types/shared}/card.types.d.ts +0 -0
  307. /package/lib/typescript/{sharedTypes → types/shared}/checkDeposit.types.d.ts +0 -0
  308. /package/lib/typescript/{sharedTypes → types/shared}/index.d.ts +0 -0
  309. /package/lib/typescript/{sharedTypes → types/shared}/onLoadResponse.types.d.ts +0 -0
  310. /package/lib/typescript/{sharedTypes → types/shared}/payments.types.d.ts +0 -0
  311. /package/lib/typescript/{sharedTypes → types/shared}/transactions.types.d.ts +0 -0
  312. /package/lib/typescript/{sharedTypes → types/shared}/types.d.ts +0 -0
  313. /package/lib/typescript/{sharedTypes → types/shared}/wallet.types.d.ts +0 -0
  314. /package/src/{sharedTypes → types/shared}/account.types.ts +0 -0
  315. /package/src/{sharedTypes → types/shared}/authorization.types.ts +0 -0
  316. /package/src/{sharedTypes → types/shared}/bookPayment.types.ts +0 -0
  317. /package/src/{sharedTypes → types/shared}/card.types.ts +0 -0
  318. /package/src/{sharedTypes → types/shared}/checkDeposit.types.ts +0 -0
  319. /package/src/{sharedTypes → types/shared}/index.ts +0 -0
  320. /package/src/{sharedTypes → types/shared}/onLoadResponse.types.ts +0 -0
  321. /package/src/{sharedTypes → types/shared}/payments.types.ts +0 -0
  322. /package/src/{sharedTypes → types/shared}/transactions.types.ts +0 -0
  323. /package/src/{sharedTypes → types/shared}/types.ts +0 -0
  324. /package/src/{sharedTypes → types/shared}/wallet.types.ts +0 -0
@@ -1,4 +1,4 @@
1
- import type { UNOnLoadResponse, UNBookPaymentData, UNAccountData } from '../../sharedTypes';
1
+ import type { UNOnLoadResponse, UNBookPaymentData, UNAccountData } from '../../types/shared';
2
2
  export interface UNBookPaymentComponentProps {
3
3
  accountId: string;
4
4
  customerToken: string;
@@ -7,6 +7,7 @@ export interface UNBookPaymentComponentProps {
7
7
  counterPartyName: string;
8
8
  theme?: string;
9
9
  language?: string;
10
+ isAutoFocus?: boolean;
10
11
  onPaymentCreated?: (data: UNBookPaymentData) => void;
11
12
  onLoad?: (response: UNOnLoadResponse<UNAccountData>) => void;
12
13
  }
@@ -1,14 +1,7 @@
1
- import { WebComponentType } from '../../webComponent/WebComponent';
2
- import { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
3
1
  export declare enum ScrollState {
4
2
  onTop = "onTop",
5
3
  unScrollable = "unScrollable",
6
4
  onlyWebView = "webViewScroll",
7
5
  onlyBottomSheet = "onlyBottomSheet"
8
6
  }
9
- export type BottomSheetSlotData = {
10
- componentName?: WebComponentType;
11
- componentResourceId?: string;
12
- requestRenderingEvent: RequestRenderingEvent;
13
- };
14
7
  export declare const UNBottomSheetComponent: () => JSX.Element;
@@ -1,6 +1,10 @@
1
1
  import type WebView from 'react-native-webview';
2
2
  import type { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
3
+ import type { BottomSheetSlotData, WebComponentData } from '../../types/internal/bottomSheet.types';
3
4
  export declare const getBottomSheetScript: () => string;
4
5
  export declare const renderingBottomSheetRequest: (currentWebView: WebView, renderingRequest: RequestRenderingEvent) => void;
5
6
  export declare const resetHtml: (currentWebView: WebView) => void;
6
- export declare const handleHtmlFullHeight: (currentWebView: WebView | null, windowHeight: number) => number;
7
+ export declare const injectHtmlFullScreenHeight: (currentWebView: WebView | null, bottomSheetHeight: number) => void;
8
+ export declare const isAddToWalletFromRequestRendering: (data: BottomSheetSlotData) => boolean;
9
+ export declare const isAddToWalletByComponentParams: (data: WebComponentData) => boolean;
10
+ export declare const extractCardIdFromComponentParams: (data: WebComponentData) => string | null;
@@ -1,6 +1,10 @@
1
- import type { RequestRenderingEvent } from '../../../messages/webMessages/unitMessages';
1
+ import { type RequestRenderingEvent } from '../../../messages/webMessages/unitMessages';
2
+ import { BottomSheetRenderingType, WebComponentData } from '../../../types/internal/bottomSheet.types';
2
3
  export interface UNAddToWalletBottomSheetItemProps {
4
+ renderingType: BottomSheetRenderingType;
3
5
  renderingRequest?: RequestRenderingEvent;
4
- cardId?: string;
6
+ webComponentData?: WebComponentData;
7
+ cardId: string;
8
+ fullScreenHeight: number;
5
9
  }
6
10
  export declare const UNAddToWalletBottomSheetItem: (props: UNAddToWalletBottomSheetItemProps) => JSX.Element;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import type { UNOnLoadResponse, UNCardData, UNCardMenuAction } from '../../sharedTypes';
2
+ import type { UNOnLoadResponse, UNCardData, UNCardMenuAction } from '../../types/shared';
3
3
  import type { NativeModules } from 'react-native';
4
4
  export interface UNCardComponentProps {
5
5
  cardId: string;
6
6
  customerToken: string;
7
+ learnMoreUrl?: string;
7
8
  theme?: string;
8
9
  language?: string;
9
10
  hideActionsMenuButton?: boolean;
@@ -1,17 +1,9 @@
1
1
  import type WebView from 'react-native-webview';
2
2
  import type { UNCardComponentProps } from './UNCardComponent';
3
- import type { NativeModules } from 'react-native';
4
- import { UNWallet, UNWalletCode, UNWalletName } from '../../../src/sharedTypes/wallet.types';
5
3
  import type { RequestRefreshEvent } from '../../messages/webMessages/unitMessages';
6
- import type { UNCardMenuAction } from '../../sharedTypes';
4
+ import type { UNCardMenuAction } from '../../types/shared';
7
5
  export declare const getCardParams: (props: UNCardComponentProps) => string;
8
6
  export declare const getCardScript: () => string;
9
7
  export declare const injectOpenActionsMenuScript: (currentWeb: WebView | null) => void;
10
8
  export declare const injectRequestCardActionScript: (currentWeb: WebView | null, action: UNCardMenuAction) => void;
11
9
  export declare const injectRefreshEventIfNeeded: (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => void;
12
- export declare const launchGetWallets: (customerToken: string, cardId: string, pushProvisioningModule: typeof NativeModules) => Promise<{
13
- name: UNWalletName;
14
- code: UNWalletCode;
15
- status: any;
16
- } | null | undefined>;
17
- export declare const launchStartCardProvisioning: (pushProvisioningModule: typeof NativeModules, wallet: UNWallet | null) => Promise<any>;
@@ -1,5 +1,5 @@
1
- import type { UNCheckDepositData } from '../../sharedTypes/checkDeposit.types';
2
- import type { UNAccountData, UNOnLoadResponse } from '../../sharedTypes';
1
+ import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
2
+ import type { UNAccountData, UNOnLoadResponse } from '../../types/shared';
3
3
  export interface UNCheckDepositComponentProps {
4
4
  accountId: string;
5
5
  fee: number;
@@ -0,0 +1 @@
1
+ export declare const getAndroidPackageName: () => Promise<any>;
@@ -0,0 +1,4 @@
1
+ export declare class UNFlows {
2
+ constructor();
3
+ startPushProvisioning(cardId: string, customerToken: string): Promise<void>;
4
+ }
@@ -0,0 +1,3 @@
1
+ export declare class UNCardFlows {
2
+ static startPushProvisioning: (cardId: string, customerToken: string) => Promise<void>;
3
+ }
@@ -0,0 +1,7 @@
1
+ import { type UNWallet } from '../../../types/shared/wallet.types';
2
+ export type CardToEncryptedPayload = {
3
+ [cardId: string]: string;
4
+ };
5
+ export declare const useCardWallet: (cardId: string) => {
6
+ currentUNWallet: UNWallet | undefined;
7
+ };
@@ -0,0 +1,2 @@
1
+ import type { UNWallet } from '../../types/shared/wallet.types';
2
+ export declare const launchStartCardProvisioning: (wallet: UNWallet | null) => Promise<any>;
@@ -1,3 +1,3 @@
1
1
  export * from './components';
2
- export * from './sharedTypes';
2
+ export * from './types/shared';
3
3
  export { UnitSDK, UNEnvironment } from './unitSdkManager/UnitSdkManager';
@@ -0,0 +1,9 @@
1
+ import type { NativeComponentRendering, WebComponentRendering, SlotRendering } from '../../types/internal/bottomSheet.types';
2
+ export declare enum BottomSheetNativeMessage {
3
+ START_FLOW = "startBottomSheetFlow"
4
+ }
5
+ export declare enum CardAddToWalletErrors {
6
+ closedNativeWalletScreen = "VP_ERROR_302"
7
+ }
8
+ export type StartBottomSheetFlowMessage = SlotRendering | WebComponentRendering | NativeComponentRendering;
9
+ export type BottomSheetNativeEvent = StartBottomSheetFlowMessage;
@@ -1,19 +1,3 @@
1
- import type { UNCardAddToWalletStatus } from '../../sharedTypes/wallet.types';
2
- export declare enum CardNativeMessage {
3
- CARD_GET_ADD_TO_WALLET_STATUS = "cardGetAddToWalletStatus",
4
- CARD_UPDATE_ADD_TO_WALLET_STATUS = "cardUpdateAddToWalletStatus",
5
- CARD_START_PUSH_PROVISIONING = "cardStartPushProvisioning"
6
- }
7
1
  export declare enum CardAddToWalletErrors {
8
2
  closedNativeWalletScreen = "VP_ERROR_302"
9
3
  }
10
- export interface UNCardAddToWalletStatusEvent {
11
- status: UNCardAddToWalletStatus;
12
- }
13
- export interface CardGetAddToWalletStatusEvent {
14
- cardId: string;
15
- }
16
- export interface CardStartPushProvisioningEvent {
17
- cardId: string;
18
- }
19
- export type CardNativeEvent = UNCardAddToWalletStatusEvent | CardGetAddToWalletStatusEvent | CardStartPushProvisioningEvent;
@@ -1,7 +1,7 @@
1
- import type { CardNativeEvent, CardNativeMessage } from './cardMessage';
1
+ import type { BottomSheetNativeEvent, BottomSheetNativeMessage } from './bottomSheetMessage';
2
2
  import type { SDKEvent, SDKMessage } from './sdkMessage';
3
- export type NativeMessageType = SDKMessage | CardNativeMessage;
4
- export type NativeEvent = CardNativeEvent | SDKEvent;
3
+ export type NativeMessageType = SDKMessage | BottomSheetNativeMessage;
4
+ export type NativeEvent = SDKEvent | BottomSheetNativeEvent;
5
5
  export interface NativeMessage {
6
6
  type: NativeMessageType;
7
7
  details?: NativeEvent;
@@ -1,4 +1,4 @@
1
- import type { UNAccountData } from '../../sharedTypes';
1
+ import type { UNAccountData } from '../../types/shared';
2
2
  export declare enum AccountMessage {
3
3
  UNIT_ACCOUNT_CHANGED = "unitAccountChanged"
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { UNACHData } from '../../sharedTypes';
1
+ import type { UNACHData } from '../../types/shared';
2
2
  export interface PaymentCreatedEvent {
3
3
  data: UNACHData;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { UNBookPaymentData } from '../../sharedTypes';
1
+ import type { UNBookPaymentData } from '../../types/shared';
2
2
  export interface PaymentCreatedEvent {
3
3
  data: UNBookPaymentData;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { UNCardData } from '../../sharedTypes';
1
+ import type { UNCardData } from '../../types/shared';
2
2
  export declare enum CardMessage {
3
3
  CARD_ACTIVATED = "unitCardActivated",
4
4
  CARD_STATUS_CHANGED = "unitCardStatusChanged"
@@ -1,4 +1,4 @@
1
- import type { UNCheckDepositData } from '../../sharedTypes/checkDeposit.types';
1
+ import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
2
2
  export declare enum CheckMessage {
3
3
  CHECK_DEPOSIT_CREATED = "unitCheckDepositCreated",
4
4
  CHECK_DEPOSIT_RESTART_REQUEST = "unitCheckDepositRestartRequest"
@@ -1,6 +1,6 @@
1
- import type { UNAccountData, UNCounterpartyAccountData, UNCardData, UNError, UNOnLoadResponseData } from '../../sharedTypes';
2
- import type { UNAuthorizationData } from '../../sharedTypes/authorization.types';
3
- import type { UNTransactionData } from '../../sharedTypes/transactions.types';
1
+ import type { UNAccountData, UNCounterpartyAccountData, UNCardData, UNError, UNOnLoadResponseData } from '../../types/shared';
2
+ import type { UNAuthorizationData } from '../../types/shared/authorization.types';
3
+ import type { UNTransactionData } from '../../types/shared/transactions.types';
4
4
  export declare enum RESPONSE_KEYS {
5
5
  errors = "errors",
6
6
  card = "cardResult",
@@ -8,7 +8,8 @@ export declare enum UnitMessage {
8
8
  UNIT_REQUEST_DOWNLOAD = "unitRequestDownload",
9
9
  UNIT_PLAID_TOKEN_CREATED = "unitPlaidLinkTokenCreated",
10
10
  UNIT_REQUEST_EXTERNAL_SDK = "unitRequestExternalSdk",
11
- UNIT_PLAID_RESPONSE = "unitPlaidResponse"
11
+ UNIT_PLAID_RESPONSE = "unitPlaidResponse",
12
+ PAGE_HEIGHT = "PAGE_HEIGHT"
12
13
  }
13
14
  export interface RequestRenderingEvent {
14
15
  data: RequestRenderingEventData;
@@ -1,2 +1,2 @@
1
- import { UNEnvironment } from '../../../../unitSdkManager/UnitSdkManager';
1
+ import { UNEnvironment } from '../../unitSdkManager/UnitSdkManager';
2
2
  export declare const getMobileWalletPayload: (customerToken: string, cardId: string, env: UNEnvironment) => Promise<any>;
@@ -1,7 +1,3 @@
1
+ import { PresentationMode } from '../../types/internal/webComponent.types';
1
2
  export declare const webViewId = "webViewContainer";
2
- export declare enum PresentationMode {
3
- CoverInjectedHeight = "coverInjectedHeight",
4
- Inherit = "inherit",
5
- Default = "deafult"
6
- }
7
3
  export declare const getHtmlBody: (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => string;
@@ -12,6 +12,7 @@ export declare const LISTENERS: {
12
12
  cardStatusChange: string;
13
13
  unitRequestExternalSdk: string;
14
14
  unitPaymentCreated: string;
15
+ unitPlaidTokenCreated: string;
15
16
  unitAccountChanged: string;
16
17
  unitActivityFiltersChanged: string;
17
18
  };
@@ -0,0 +1,35 @@
1
+ import type { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
2
+ import type { PresentationMode, WebComponentType } from './webComponent.types';
3
+ export declare enum BottomSheetRenderingType {
4
+ Slot = 0,
5
+ WebComponent = 1,
6
+ NativeComponent = 2
7
+ }
8
+ export type BottomSheetSlotData = {
9
+ componentName?: WebComponentType;
10
+ componentResourceId?: string;
11
+ requestRenderingEvent: RequestRenderingEvent;
12
+ };
13
+ export type WebComponentData = {
14
+ type: WebComponentType;
15
+ presentationMode?: PresentationMode;
16
+ params?: string;
17
+ theme?: string;
18
+ language?: string;
19
+ windowParams?: string;
20
+ };
21
+ export type NativeComponentData = {
22
+ component: React.ReactNode;
23
+ };
24
+ export interface SlotRendering {
25
+ type: BottomSheetRenderingType.Slot;
26
+ data: BottomSheetSlotData;
27
+ }
28
+ export interface WebComponentRendering {
29
+ type: BottomSheetRenderingType.WebComponent;
30
+ data: WebComponentData;
31
+ }
32
+ export interface NativeComponentRendering {
33
+ type: BottomSheetRenderingType.NativeComponent;
34
+ data: NativeComponentData;
35
+ }
@@ -0,0 +1,16 @@
1
+ export declare enum WebComponentType {
2
+ card = "unit-elements-card",
3
+ bookPayment = "unit-elements-book-payment",
4
+ activity = "unit-elements-activity",
5
+ slot = "unit-elements-sdk-slot",
6
+ account = "unit-elements-account",
7
+ checkDeposit = "unit-elements-check-deposit",
8
+ achDebitPayment = "unit-elements-ach-debit-payment",
9
+ achCreditPayment = "unit-elements-ach-credit-payment",
10
+ cardAction = "unit-elements-card-action"
11
+ }
12
+ export declare enum PresentationMode {
13
+ CoverInjectedHeight = "coverInjectedHeight",
14
+ Inherit = "inherit",
15
+ Default = "deafult"
16
+ }
@@ -1,4 +1,4 @@
1
- import type { RESPONSE_KEYS } from '../messages/webMessages/onLoadMessage';
1
+ import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
2
2
  import type { UNAccountData, UNCounterpartyAccountData } from './account.types';
3
3
  import type { UNAchCounterparty, UNCounterpartyVerificationMethod, UNPaymentStatus } from './payments.types';
4
4
  import type { UNTags, UNRelationship } from './types';
@@ -1,4 +1,4 @@
1
- import type { RESPONSE_KEYS } from '../messages/webMessages/onLoadMessage';
1
+ import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
2
2
  import type { UNAuthorizationData } from './authorization.types';
3
3
  import type { UNTransactionData } from './transactions.types';
4
4
  export type UNActivityOnLoadData = {
@@ -1,3 +1,5 @@
1
+ import type { NativeModules } from 'react-native';
2
+ import { UnitUiManager } from './unitUiManager/unitUiManager';
1
3
  export declare enum UNEnvironment {
2
4
  sandbox = "sandbox",
3
5
  production = "production"
@@ -8,13 +10,20 @@ export declare const UNIT_SCRIPT_URL: {
8
10
  };
9
11
  export declare class UnitSDK {
10
12
  protected static env?: UNEnvironment;
13
+ protected static customerToken?: string;
11
14
  protected static theme?: string;
12
15
  protected static language?: string;
13
16
  protected static signedNonce?: string;
17
+ protected static pushProvisionModule?: typeof NativeModules;
18
+ static ui: UnitUiManager;
14
19
  static init: (env: UNEnvironment, theme?: string, language?: string) => Promise<void>;
20
+ static setPushProvisioningModule: (pushProvisionModule: typeof NativeModules) => void;
21
+ static getPushProvisionModule: () => import("react-native").NativeModulesStatic | undefined;
15
22
  static setSignedNonce: (signedNonce: string) => void;
16
23
  static getEnv: () => UNEnvironment | undefined;
17
24
  static getTheme: () => string | undefined;
18
25
  static getLanguage: () => string | undefined;
19
26
  static getSignedNonce: () => string | undefined;
27
+ static setCustomerToken: (customerToken: string) => void;
28
+ static getCustomerToken: () => string | undefined;
20
29
  }
@@ -0,0 +1,6 @@
1
+ import { UNFlows } from '../../flows/UNFlows';
2
+ export declare class UnitUiManager {
3
+ flows: UNFlows;
4
+ constructor();
5
+ private init;
6
+ }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { WebView } from 'react-native-webview';
3
- import { PresentationMode } from '../scripts/html/bodyHtml';
4
3
  import type { WebViewMessage } from '../messages/webMessages';
4
+ import type { PresentationMode, WebComponentType } from '../types/internal/webComponent.types';
5
5
  export interface WebComponentProps {
6
6
  type: WebComponentType;
7
7
  presentationMode?: PresentationMode;
@@ -14,15 +14,6 @@ export interface WebComponentProps {
14
14
  nestedScrollEnabled?: boolean;
15
15
  handleScroll?: (event: any) => void;
16
16
  width?: number;
17
- }
18
- export declare enum WebComponentType {
19
- card = "unit-elements-card",
20
- bookPayment = "unit-elements-book-payment",
21
- activity = "unit-elements-activity",
22
- slot = "unit-elements-sdk-slot",
23
- account = "unit-elements-account",
24
- checkDeposit = "unit-elements-check-deposit",
25
- achDebitPayment = "unit-elements-ach-debit-payment",
26
- achCreditPayment = "unit-elements-ach-credit-payment"
17
+ windowParams?: string;
27
18
  }
28
19
  export declare const WebComponent: React.ForwardRefExoticComponent<WebComponentProps & React.RefAttributes<WebView<{}>>>;
@@ -2,6 +2,7 @@ export declare const HTML_PLACEHOLDER: {
2
2
  SCRIPT_UNIT: string;
3
3
  BODY: string;
4
4
  SCRIPT_FROM_NATIVE: string;
5
+ WINDOW_PARAMS: string;
5
6
  };
6
7
  declare const htmlText: string;
7
8
  export default htmlText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unit-components",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Unit React Native components",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,15 +1,18 @@
1
- import React, { useState } from 'react';
2
- import { WebComponent, WebComponentType } from '../../webComponent/WebComponent';
3
- import { PresentationMode } from '../../scripts/html/bodyHtml';
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import { WebComponent } from '../../webComponent/WebComponent';
4
3
  import type { WebViewMessage } from '../../messages/webMessages';
5
- import type { UNOnLoadResponse, UNACHData, UNACHOnLoadData, UNError, UNOnLoadResponseData } from '../../sharedTypes';
4
+ import type { UNOnLoadResponse, UNACHData, UNACHOnLoadData, UNError, UNOnLoadResponseData } from '../../types/shared';
6
5
  import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
7
- import { View } from 'react-native';
8
- import { UnitMessage } from '../../messages/webMessages/unitMessages';
9
- import { getACHCreditParams, getACHCreditScript } from './UNACHCreditComponent.utils';
6
+ import { Platform, View } from 'react-native';
7
+ import { getACHCreditParams, getACHCreditScript, injectUnitPlaidResponse } from './UNACHCreditComponent.utils';
10
8
  import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
11
9
  import type { ACHEvent } from '../../messages/webMessages/achCreditMessage';
12
10
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
11
+ import { PlaidLinkTokenData, PlaidTokenCreatedEvent, RequestExternalSdkEvent, UnitMessage } from '../../messages/webMessages/unitMessages';
12
+ import { LinkSuccess, openLink } from 'react-native-plaid-link-sdk';
13
+ import type WebView from 'react-native-webview';
14
+ import { getAndroidPackageName } from '../utils/nativeModulesInfo';
15
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
13
16
 
14
17
  export interface UNACHCreditComponentProps {
15
18
  accountId: string;
@@ -18,6 +21,7 @@ export interface UNACHCreditComponentProps {
18
21
  language?: string;
19
22
  isAutoFocus?: boolean;
20
23
  fee?: number;
24
+ withPlaid?: boolean;
21
25
  onPaymentCreated?: (data: UNACHData) => void;
22
26
  onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
23
27
  }
@@ -25,6 +29,19 @@ export interface UNACHCreditComponentProps {
25
29
  export const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
26
30
  const [height, setHeight] = useState<number>(0);
27
31
  const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
32
+ const [linkToken, setLinkToken] = useState<string>();
33
+ const [appPackageName, setAppPackageName] = useState<string>();
34
+ const webRef = useRef<WebView>(null);
35
+
36
+ useEffect(() => {
37
+ const setPackageNameForAndroid = async () => {
38
+ if (Platform.OS === 'android') {
39
+ const packageName = await getAndroidPackageName();
40
+ setAppPackageName(packageName);
41
+ }
42
+ };
43
+ setPackageNameForAndroid();
44
+ }, []);
28
45
 
29
46
  const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
30
47
  if (!props.onLoad) {
@@ -72,16 +89,38 @@ export const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
72
89
  }
73
90
  break;
74
91
  }
92
+ case UnitMessage.UNIT_PLAID_TOKEN_CREATED: {
93
+ const linkTokenEvent = message.details as PlaidTokenCreatedEvent;
94
+ const linkTokenData = linkTokenEvent.linkToken as PlaidLinkTokenData;
95
+ setLinkToken(linkTokenData.attributes.linkToken);
96
+ break;
97
+ }
98
+
99
+ case UnitMessage.UNIT_REQUEST_EXTERNAL_SDK: {
100
+ const externalSdkType = (message.details as RequestExternalSdkEvent).type;
101
+ if (externalSdkType !== 'plaid') return;
102
+ linkToken && openLink({
103
+ tokenConfig: { noLoadingState: false, token: linkToken },
104
+ onSuccess: (success: LinkSuccess) => {
105
+ injectUnitPlaidResponse(webRef.current, success);
106
+ },
107
+ onExit: exit => { console.log(exit); }
108
+ }).catch(e => {
109
+ console.error(e);
110
+ });
111
+ break;
112
+ }
75
113
  }
76
114
  };
77
115
 
78
116
  const renderACHCreditWebView = () => {
79
117
  return (
80
118
  <WebComponent
119
+ ref={webRef}
81
120
  type={WebComponentType.achCreditPayment}
82
121
  presentationMode={presentationMode}
83
122
  params={getACHCreditParams(props)}
84
- script={getACHCreditScript()}
123
+ script={getACHCreditScript(appPackageName)}
85
124
  onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
86
125
  isScrollable={false}
87
126
  theme={props.theme}
@@ -1,26 +1,29 @@
1
1
  import type { UNACHCreditComponentProps } from './UNACHCreditComponent';
2
-
3
- import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
2
+ import type WebView from 'react-native-webview';
3
+ import type { LinkSuccess } from 'react-native-plaid-link-sdk';
4
+ import { DISPATCH_PLAID_RESPONSE, LISTENERS } from '../../scripts/html/bodyScript';
4
5
 
5
6
  export const getACHCreditParams = (props: UNACHCreditComponentProps) => {
6
7
  return `
7
8
  account-id="${props.accountId}"
8
9
  customer-token="${props.customerToken}"
10
+ with-plaid="${props.withPlaid ?? false}"
9
11
  is-auto-focus="${props.isAutoFocus ?? false}"
10
12
  ${props.fee ? `fee="${props.fee}"` : ''}
11
13
  style="height: 100%"
12
14
  `;
13
15
  };
14
16
 
15
- export const getACHCreditScript = () => {
17
+ export const getACHCreditScript = (appPackageName?: string) => {
16
18
  return `
17
- window.addEventListener("${PaymentMessage.PAYMENT_CREATED}", (e) => {
18
- const response = e.detail
19
- response.then((data) => {
20
- postMessageToSDK({ type: "${PaymentMessage.PAYMENT_CREATED}", details: { data: JSON.stringify(data.data) }})
21
- }).catch((e) => {
22
- console.log(e)
23
- })
24
- });
19
+ ${LISTENERS.unitPlaidTokenCreated}
20
+ ${appPackageName && `window.UnitMobileSDKConfig.androidPackageName='${appPackageName}'`}
21
+ ${LISTENERS.unitPaymentCreated}
22
+ ${DISPATCH_PLAID_RESPONSE}
25
23
  `;
26
24
  };
25
+
26
+ export const injectUnitPlaidResponse = (currentWeb: WebView | null, success: LinkSuccess) => {
27
+ const successObj = {data: { publicToken: success.publicToken, metadata: success.metadata}};
28
+ currentWeb?.injectJavaScript(`dispatchPlaidEvent(${JSON.stringify(successObj)})`);
29
+ };
@@ -1,19 +1,19 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { WebComponent, WebComponentType } from '../../webComponent/WebComponent';
3
- import { PresentationMode } from '../../scripts/html/bodyHtml';
2
+ import { WebComponent } from '../../webComponent/WebComponent';
4
3
  import type { WebViewMessage } from '../../messages/webMessages';
5
- import type { UNOnLoadResponse, UNACHData, UNError, UNOnLoadResponseData, UNACHOnLoadData } from '../../sharedTypes';
4
+ import type { UNOnLoadResponse, UNACHData, UNError, UNOnLoadResponseData, UNACHOnLoadData } from '../../types/shared';
6
5
  import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
7
6
  import { Platform, View } from 'react-native';
8
7
  import { PlaidLinkTokenData, PlaidTokenCreatedEvent, RequestExternalSdkEvent, UnitMessage } from '../../messages/webMessages/unitMessages';
9
- import { getACHDebitParams, getACHDebitScript, getAndroidPackageName, injectUnitPlaidResponse } from './UNACHDebitComponent.utils';
10
-
8
+ import { getACHDebitParams, getACHDebitScript, injectUnitPlaidResponse } from './UNACHDebitComponent.utils';
11
9
  import { LinkSuccess, openLink } from 'react-native-plaid-link-sdk';
12
10
  import type WebView from 'react-native-webview';
13
11
 
14
12
  import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
15
13
  import type { ACHEvent } from '../../messages/webMessages/achCreditMessage';
16
14
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
15
+ import { getAndroidPackageName } from '../utils/nativeModulesInfo';
16
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
17
17
 
18
18
  export interface UNACHDebitComponentProps {
19
19
  accountId: string;
@@ -43,10 +43,6 @@ export const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
43
43
  setPackageNameForAndroid();
44
44
  }, []);
45
45
 
46
- const dispatchUnitPlaidResponse = (success: LinkSuccess) => {
47
- injectUnitPlaidResponse(webRef.current, success);
48
- };
49
-
50
46
  const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
51
47
  if (!props.onLoad) {
52
48
  return;
@@ -105,8 +101,8 @@ export const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
105
101
  if (externalSdkType !== 'plaid') return;
106
102
  linkToken && openLink({
107
103
  tokenConfig: { noLoadingState: false, token: linkToken },
108
- onSuccess: (success) => {
109
- dispatchUnitPlaidResponse(success);
104
+ onSuccess: (success: LinkSuccess) => {
105
+ injectUnitPlaidResponse(webRef.current, success);
110
106
  },
111
107
  onExit: exit => { console.log(exit); }
112
108
  }).catch(e => {
@@ -3,9 +3,6 @@ import type { UNACHDebitComponentProps } from './UNACHDebitComponent';
3
3
 
4
4
  import type WebView from 'react-native-webview';
5
5
  import type { LinkSuccess } from 'react-native-plaid-link-sdk';
6
- import { NativeModules } from 'react-native';
7
- const { RNAppInfoModule } = NativeModules;
8
- import { UnitMessage } from '../../messages/webMessages/unitMessages';
9
6
 
10
7
  export const getACHDebitParams = (props: UNACHDebitComponentProps) => {
11
8
  return `
@@ -17,25 +14,9 @@ export const getACHDebitParams = (props: UNACHDebitComponentProps) => {
17
14
  `;
18
15
  };
19
16
 
20
- export const getAndroidPackageName = async () => {
21
- try {
22
- const response = await RNAppInfoModule.getAppPackageName();
23
- return response;
24
- } catch (error) {
25
- console.error(error);
26
- }
27
- };
28
-
29
17
  export const getACHDebitScript = (androidPackageName?: string) => {
30
18
  return `
31
- window.addEventListener("${UnitMessage.UNIT_PLAID_TOKEN_CREATED}", (e) => {
32
- const response = e.detail
33
- response.then((data) => {
34
- postMessageToSDK({ type: "${UnitMessage.UNIT_PLAID_TOKEN_CREATED}", details: { linkToken: data.data }})
35
- }).catch((e) => {
36
- console.log(e)
37
- })
38
- });
19
+ ${LISTENERS.unitPlaidTokenCreated}
39
20
  ${androidPackageName && `window.UnitMobileSDKConfig.androidPackageName='${androidPackageName}'`}
40
21
  ${LISTENERS.unitPaymentCreated}
41
22
  ${DISPATCH_PLAID_RESPONSE}