react-native-unit-components 1.6.1 → 1.7.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 (294) hide show
  1. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +6 -6
  2. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  3. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +6 -6
  4. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  5. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +14 -9
  6. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  7. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +3 -3
  8. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  9. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +12 -6
  10. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  11. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +2 -2
  12. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  13. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +6 -6
  14. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  15. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
  16. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  17. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +28 -8
  18. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  19. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +49 -37
  20. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
  21. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +22 -53
  22. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
  23. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +4 -53
  24. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  25. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +6 -6
  26. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  27. package/lib/commonjs/flows/UNFlows.js +19 -0
  28. package/lib/commonjs/flows/UNFlows.js.map +1 -0
  29. package/lib/commonjs/flows/card/UNCardFlows.js +33 -0
  30. package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -0
  31. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +70 -0
  32. package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
  33. package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js +22 -0
  34. package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
  35. package/lib/commonjs/index.js +4 -4
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js +17 -0
  38. package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
  39. package/lib/commonjs/messages/nativeMessages/cardMessage.js +2 -8
  40. package/lib/commonjs/messages/nativeMessages/cardMessage.js.map +1 -1
  41. package/lib/commonjs/messages/nativeMessages/index.js.map +1 -1
  42. package/lib/commonjs/messages/webMessages/accountMessage.js.map +1 -1
  43. package/lib/commonjs/messages/webMessages/achCreditMessage.js.map +1 -1
  44. package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -1
  45. package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
  46. package/lib/commonjs/messages/webMessages/checkMessage.js.map +1 -1
  47. package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
  48. package/lib/commonjs/messages/webMessages/unitMessages.js +1 -0
  49. package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
  50. package/lib/commonjs/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
  51. package/lib/commonjs/networking/common/UNNetworkConstants.js.map +1 -0
  52. package/lib/commonjs/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +3 -1
  53. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -0
  54. package/lib/commonjs/scripts/html/bodyHtml.js +4 -10
  55. package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -1
  56. package/lib/commonjs/types/internal/bottomSheet.types.js +14 -0
  57. package/lib/commonjs/types/internal/bottomSheet.types.js.map +1 -0
  58. package/lib/commonjs/types/internal/webComponent.types.js +27 -0
  59. package/lib/commonjs/types/internal/webComponent.types.js.map +1 -0
  60. package/lib/commonjs/types/shared/achCredit.types.js.map +1 -0
  61. package/lib/commonjs/types/shared/activity.types.js.map +1 -0
  62. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +20 -2
  63. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
  64. package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js +21 -0
  65. package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
  66. package/lib/commonjs/webComponent/WebComponent.js +6 -18
  67. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  68. package/lib/commonjs/webComponent/html.js +3 -1
  69. package/lib/commonjs/webComponent/html.js.map +1 -1
  70. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +2 -2
  71. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  72. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +2 -2
  73. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  74. package/lib/module/components/UNAccountComponent/UNAccountComponent.js +13 -8
  75. package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  76. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
  77. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  78. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +10 -4
  79. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  80. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +1 -1
  81. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  82. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -2
  83. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  84. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
  85. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  86. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +23 -6
  87. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  88. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +51 -39
  89. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
  90. package/lib/module/components/UNCardComponent/UNCardComponent.js +23 -55
  91. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
  92. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +1 -48
  93. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  94. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +2 -2
  95. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  96. package/lib/module/flows/UNFlows.js +12 -0
  97. package/lib/module/flows/UNFlows.js.map +1 -0
  98. package/lib/module/flows/card/UNCardFlows.js +25 -0
  99. package/lib/module/flows/card/UNCardFlows.js.map +1 -0
  100. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +63 -0
  101. package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
  102. package/lib/module/helpers/pushProvisioningService/startProvisioning.js +15 -0
  103. package/lib/module/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
  104. package/lib/module/index.js +1 -1
  105. package/lib/module/index.js.map +1 -1
  106. package/lib/module/messages/nativeMessages/bottomSheetMessage.js +9 -0
  107. package/lib/module/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
  108. package/lib/module/messages/nativeMessages/cardMessage.js +1 -6
  109. package/lib/module/messages/nativeMessages/cardMessage.js.map +1 -1
  110. package/lib/module/messages/nativeMessages/index.js.map +1 -1
  111. package/lib/module/messages/webMessages/accountMessage.js.map +1 -1
  112. package/lib/module/messages/webMessages/achCreditMessage.js.map +1 -1
  113. package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -1
  114. package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
  115. package/lib/module/messages/webMessages/checkMessage.js.map +1 -1
  116. package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
  117. package/lib/module/messages/webMessages/unitMessages.js +1 -0
  118. package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
  119. package/lib/module/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
  120. package/lib/module/networking/common/UNNetworkConstants.js.map +1 -0
  121. package/lib/module/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +4 -1
  122. package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -0
  123. package/lib/module/scripts/html/bodyHtml.js +1 -6
  124. package/lib/module/scripts/html/bodyHtml.js.map +1 -1
  125. package/lib/module/types/internal/bottomSheet.types.js +7 -0
  126. package/lib/module/types/internal/bottomSheet.types.js.map +1 -0
  127. package/lib/module/types/internal/webComponent.types.js +19 -0
  128. package/lib/module/types/internal/webComponent.types.js.map +1 -0
  129. package/lib/module/types/shared/achCredit.types.js.map +1 -0
  130. package/lib/module/types/shared/activity.types.js.map +1 -0
  131. package/lib/module/unitSdkManager/UnitSdkManager.js +20 -2
  132. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
  133. package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js +14 -0
  134. package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
  135. package/lib/module/webComponent/WebComponent.js +5 -16
  136. package/lib/module/webComponent/WebComponent.js.map +1 -1
  137. package/lib/module/webComponent/html.js +3 -1
  138. package/lib/module/webComponent/html.js.map +1 -1
  139. package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +1 -1
  140. package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +1 -1
  141. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +3 -3
  142. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +1 -1
  143. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +2 -2
  144. package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +1 -1
  145. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +0 -7
  146. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -1
  147. package/lib/typescript/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.d.ts +6 -2
  148. package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +1 -1
  149. package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +1 -9
  150. package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -2
  151. package/lib/typescript/flows/UNFlows.d.ts +4 -0
  152. package/lib/typescript/flows/card/UNCardFlows.d.ts +3 -0
  153. package/lib/typescript/helpers/pushProvisioningService/hooks/useCardWallet.d.ts +7 -0
  154. package/lib/typescript/helpers/pushProvisioningService/startProvisioning.d.ts +2 -0
  155. package/lib/typescript/index.d.ts +1 -1
  156. package/lib/typescript/messages/nativeMessages/bottomSheetMessage.d.ts +9 -0
  157. package/lib/typescript/messages/nativeMessages/cardMessage.d.ts +0 -16
  158. package/lib/typescript/messages/nativeMessages/index.d.ts +3 -3
  159. package/lib/typescript/messages/webMessages/accountMessage.d.ts +1 -1
  160. package/lib/typescript/messages/webMessages/achCreditMessage.d.ts +1 -1
  161. package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +1 -1
  162. package/lib/typescript/messages/webMessages/cardMessage.d.ts +1 -1
  163. package/lib/typescript/messages/webMessages/checkMessage.d.ts +1 -1
  164. package/lib/typescript/messages/webMessages/onLoadMessage.d.ts +3 -3
  165. package/lib/typescript/messages/webMessages/unitMessages.d.ts +2 -1
  166. package/lib/typescript/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.d.ts +1 -1
  167. package/lib/typescript/scripts/html/bodyHtml.d.ts +1 -5
  168. package/lib/typescript/types/internal/bottomSheet.types.d.ts +35 -0
  169. package/lib/typescript/types/internal/webComponent.types.d.ts +16 -0
  170. package/lib/typescript/{sharedTypes → types/shared}/achCredit.types.d.ts +1 -1
  171. package/lib/typescript/{sharedTypes → types/shared}/activity.types.d.ts +1 -1
  172. package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +9 -0
  173. package/lib/typescript/unitSdkManager/unitUiManager/unitUiManager.d.ts +6 -0
  174. package/lib/typescript/webComponent/WebComponent.d.ts +2 -12
  175. package/lib/typescript/webComponent/html.d.ts +1 -0
  176. package/package.json +1 -1
  177. package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +3 -3
  178. package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +3 -3
  179. package/src/components/UNAccountComponent/UNAccountComponent.tsx +17 -12
  180. package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
  181. package/src/components/UNActivityComponent/UNActivityComponent.tsx +14 -7
  182. package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +1 -1
  183. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +3 -3
  184. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +151 -76
  185. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +24 -6
  186. package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.tsx +72 -41
  187. package/src/components/UNCardComponent/UNCardComponent.tsx +25 -57
  188. package/src/components/UNCardComponent/UNCardComponent.utils.ts +2 -49
  189. package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -4
  190. package/src/flows/UNFlows.ts +13 -0
  191. package/src/flows/card/UNCardFlows.ts +25 -0
  192. package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +67 -0
  193. package/src/helpers/pushProvisioningService/startProvisioning.ts +20 -0
  194. package/src/index.tsx +1 -1
  195. package/src/messages/nativeMessages/bottomSheetMessage.ts +15 -0
  196. package/src/messages/nativeMessages/cardMessage.ts +1 -24
  197. package/src/messages/nativeMessages/index.ts +3 -3
  198. package/src/messages/webMessages/accountMessage.ts +1 -1
  199. package/src/messages/webMessages/achCreditMessage.ts +1 -1
  200. package/src/messages/webMessages/bookPaymentMessage.ts +1 -1
  201. package/src/messages/webMessages/cardMessage.ts +1 -1
  202. package/src/messages/webMessages/checkMessage.ts +1 -1
  203. package/src/messages/webMessages/onLoadMessage.ts +3 -3
  204. package/src/messages/webMessages/unitMessages.ts +3 -2
  205. package/src/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.ts +1 -1
  206. package/src/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.ts +3 -1
  207. package/src/scripts/html/bodyHtml.ts +2 -14
  208. package/src/types/internal/bottomSheet.types.ts +43 -0
  209. package/src/types/internal/webComponent.types.ts +26 -0
  210. package/src/{sharedTypes → types/shared}/achCredit.types.ts +1 -1
  211. package/src/{sharedTypes → types/shared}/activity.types.ts +1 -1
  212. package/src/unitSdkManager/UnitSdkManager.ts +28 -2
  213. package/src/unitSdkManager/unitUiManager/unitUiManager.ts +13 -0
  214. package/src/webComponent/WebComponent.tsx +7 -17
  215. package/src/webComponent/html.ts +3 -1
  216. package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
  217. package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
  218. package/lib/commonjs/sharedTypes/achCredit.types.js.map +0 -1
  219. package/lib/commonjs/sharedTypes/activity.types.js.map +0 -1
  220. package/lib/module/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
  221. package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
  222. package/lib/module/sharedTypes/achCredit.types.js.map +0 -1
  223. package/lib/module/sharedTypes/activity.types.js.map +0 -1
  224. /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js +0 -0
  225. /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js.map +0 -0
  226. /package/lib/commonjs/{sharedTypes → types/shared}/achCredit.types.js +0 -0
  227. /package/lib/commonjs/{sharedTypes → types/shared}/activity.types.js +0 -0
  228. /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js +0 -0
  229. /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
  230. /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
  231. /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
  232. /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js +0 -0
  233. /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js.map +0 -0
  234. /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
  235. /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
  236. /package/lib/commonjs/{sharedTypes → types/shared}/index.js +0 -0
  237. /package/lib/commonjs/{sharedTypes → types/shared}/index.js.map +0 -0
  238. /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
  239. /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
  240. /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js +0 -0
  241. /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js.map +0 -0
  242. /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js +0 -0
  243. /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
  244. /package/lib/commonjs/{sharedTypes → types/shared}/types.js +0 -0
  245. /package/lib/commonjs/{sharedTypes → types/shared}/types.js.map +0 -0
  246. /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js +0 -0
  247. /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
  248. /package/lib/module/{sharedTypes → types/shared}/account.types.js +0 -0
  249. /package/lib/module/{sharedTypes → types/shared}/account.types.js.map +0 -0
  250. /package/lib/module/{sharedTypes → types/shared}/achCredit.types.js +0 -0
  251. /package/lib/module/{sharedTypes → types/shared}/activity.types.js +0 -0
  252. /package/lib/module/{sharedTypes → types/shared}/authorization.types.js +0 -0
  253. /package/lib/module/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
  254. /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
  255. /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
  256. /package/lib/module/{sharedTypes → types/shared}/card.types.js +0 -0
  257. /package/lib/module/{sharedTypes → types/shared}/card.types.js.map +0 -0
  258. /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
  259. /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
  260. /package/lib/module/{sharedTypes → types/shared}/index.js +0 -0
  261. /package/lib/module/{sharedTypes → types/shared}/index.js.map +0 -0
  262. /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
  263. /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
  264. /package/lib/module/{sharedTypes → types/shared}/payments.types.js +0 -0
  265. /package/lib/module/{sharedTypes → types/shared}/payments.types.js.map +0 -0
  266. /package/lib/module/{sharedTypes → types/shared}/transactions.types.js +0 -0
  267. /package/lib/module/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
  268. /package/lib/module/{sharedTypes → types/shared}/types.js +0 -0
  269. /package/lib/module/{sharedTypes → types/shared}/types.js.map +0 -0
  270. /package/lib/module/{sharedTypes → types/shared}/wallet.types.js +0 -0
  271. /package/lib/module/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
  272. /package/lib/typescript/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.d.ts +0 -0
  273. /package/lib/typescript/{sharedTypes → types/shared}/account.types.d.ts +0 -0
  274. /package/lib/typescript/{sharedTypes → types/shared}/authorization.types.d.ts +0 -0
  275. /package/lib/typescript/{sharedTypes → types/shared}/bookPayment.types.d.ts +0 -0
  276. /package/lib/typescript/{sharedTypes → types/shared}/card.types.d.ts +0 -0
  277. /package/lib/typescript/{sharedTypes → types/shared}/checkDeposit.types.d.ts +0 -0
  278. /package/lib/typescript/{sharedTypes → types/shared}/index.d.ts +0 -0
  279. /package/lib/typescript/{sharedTypes → types/shared}/onLoadResponse.types.d.ts +0 -0
  280. /package/lib/typescript/{sharedTypes → types/shared}/payments.types.d.ts +0 -0
  281. /package/lib/typescript/{sharedTypes → types/shared}/transactions.types.d.ts +0 -0
  282. /package/lib/typescript/{sharedTypes → types/shared}/types.d.ts +0 -0
  283. /package/lib/typescript/{sharedTypes → types/shared}/wallet.types.d.ts +0 -0
  284. /package/src/{sharedTypes → types/shared}/account.types.ts +0 -0
  285. /package/src/{sharedTypes → types/shared}/authorization.types.ts +0 -0
  286. /package/src/{sharedTypes → types/shared}/bookPayment.types.ts +0 -0
  287. /package/src/{sharedTypes → types/shared}/card.types.ts +0 -0
  288. /package/src/{sharedTypes → types/shared}/checkDeposit.types.ts +0 -0
  289. /package/src/{sharedTypes → types/shared}/index.ts +0 -0
  290. /package/src/{sharedTypes → types/shared}/onLoadResponse.types.ts +0 -0
  291. /package/src/{sharedTypes → types/shared}/payments.types.ts +0 -0
  292. /package/src/{sharedTypes → types/shared}/transactions.types.ts +0 -0
  293. /package/src/{sharedTypes → types/shared}/types.ts +0 -0
  294. /package/src/{sharedTypes → types/shared}/wallet.types.ts +0 -0
@@ -1,22 +1,21 @@
1
- import React, { useImperativeHandle, useRef, useState } from 'react';
2
- import { Dimensions, NativeModule, View } from 'react-native';
1
+ import React, { useImperativeHandle, useRef, useState, useEffect } from 'react';
2
+ import { View } from 'react-native';
3
3
  import type WebView from 'react-native-webview';
4
4
  import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
5
5
  import { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';
6
6
  import EventBus from '../../helpers/EventBus';
7
- import { WebComponent, WebComponentType } from '../../webComponent/WebComponent';
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, launchStartCardProvisioning, injectOpenActionsMenuScript, injectRequestCardActionScript } from './UNCardComponent.utils';
11
- import { PresentationMode } from '../../scripts/html/bodyHtml';
12
- import type { UNOnLoadResponse, UNCardData, UNError, UNCardMenuAction } from '../../sharedTypes';
10
+ import { getCardParams, getCardScript, injectRefreshEventIfNeeded, injectOpenActionsMenuScript, injectRequestCardActionScript } from './UNCardComponent.utils';
11
+ import type { UNOnLoadResponse, UNCardData, UNError, UNCardMenuAction } from '../../types/shared';
13
12
  import { CardMessage } from '../../messages/webMessages/cardMessage';
14
- import { launchGetWallets } from './UNCardComponent.utils';
15
13
  import type { NativeModules } from 'react-native';
16
- import type { UNWallet } from 'src/sharedTypes/wallet.types';
17
- import { CardAddToWalletErrors, UNCardAddToWalletStatusEvent, CardGetAddToWalletStatusEvent, CardNativeMessage, CardStartPushProvisioningEvent } from '../../messages/nativeMessages/cardMessage';
18
- import type { BottomSheetSlotData } from '../UNBottomSheetComponent/UNBottomSheetComponent';
19
14
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
15
+ import { BottomSheetRenderingType, SlotRendering, type BottomSheetSlotData } from '../../types/internal/bottomSheet.types';
16
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
17
+ import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
18
+ import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
20
19
  export interface UNCardComponentProps {
21
20
  // inputs
22
21
  cardId: string;
@@ -43,11 +42,6 @@ export interface CardRef {
43
42
 
44
43
  export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(function UNCardComponent(props, cardRef) {
45
44
  const [height, setHeight] = useState(0);
46
- const windowWidth = Dimensions.get('window').width;
47
-
48
- const walletRef = useRef<UNWallet | null>(null);
49
- // walletRef can be changed to a state. (After the change of the listener hook)
50
- // TODO: walletState and checks it works. =)
51
45
 
52
46
  const webRef = useRef<WebView>(null);
53
47
 
@@ -76,16 +70,6 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
76
70
  injectRefreshEventIfNeeded(webRef.current, data, props.cardId);
77
71
  };
78
72
 
79
- const startPushProvisioning = async (data: CardStartPushProvisioningEvent) => {
80
- if (data.cardId !== props.cardId) return;
81
- onAddToWalletClicked();
82
- };
83
-
84
- const getAddToWalletStatus = (data: CardGetAddToWalletStatusEvent) => {
85
- if (data.cardId !== props.cardId) return;
86
- getWallets();
87
- };
88
-
89
73
  const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
90
74
  if (!props.onLoad) {
91
75
  return;
@@ -109,20 +93,24 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
109
93
  useListenerToBus({ busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });
110
94
  useListenerToBus({ busEventKey: CardMessage.CARD_STATUS_CHANGED, action: cardStatusChanged });
111
95
  useListenerToBus({ busEventKey: CardMessage.CARD_ACTIVATED, action: cardActivated });
112
- useListenerToBus({ busEventKey: CardNativeMessage.CARD_START_PUSH_PROVISIONING, action: startPushProvisioning });
113
- useListenerToBus({ busEventKey: CardNativeMessage.CARD_GET_ADD_TO_WALLET_STATUS, action: getAddToWalletStatus });
114
96
 
115
97
  const handleMessage = (message: WebViewMessage) => {
116
98
  if (!message || !message.details) return;
117
99
 
118
100
  switch (message.type) {
119
101
  case UnitMessage.UNIT_REQUEST_RENDERING: {
120
- const event: BottomSheetSlotData = {
102
+ const slotData: BottomSheetSlotData = {
121
103
  componentName: WebComponentType.card,
122
104
  componentResourceId: props.cardId,
123
105
  requestRenderingEvent: message.details as RequestRenderingEvent
124
106
  };
125
- EventBus.Instance.event(UnitMessage.UNIT_REQUEST_RENDERING, event);
107
+
108
+ const event = {
109
+ type: BottomSheetRenderingType.Slot,
110
+ data: slotData
111
+ } as SlotRendering;
112
+
113
+ EventBus.Instance.event(BottomSheetNativeMessage.START_FLOW, event);
126
114
  break;
127
115
  }
128
116
  case PageMessage.PAGE_HEIGHT:
@@ -134,37 +122,18 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
134
122
  }
135
123
  };
136
124
 
137
- const getWallets = async () => {
138
-
139
- try {
125
+ useEffect(() => {
126
+ UnitSDK.setCustomerToken(props.customerToken);
127
+ }, [props.customerToken]);
140
128
 
141
- const walletResponse = await launchGetWallets(props.customerToken, props.cardId, props.pushProvisioningModule as NativeModule);
142
-
143
- if (!walletResponse) return;
144
-
145
- walletRef.current = walletResponse;
146
-
147
- const walletStatus: UNCardAddToWalletStatusEvent = { status: walletResponse.status };
148
- EventBus.Instance.event(CardNativeMessage.CARD_UPDATE_ADD_TO_WALLET_STATUS, walletStatus);
149
- } catch (error) {
150
- console.error(error);
151
- }
152
- };
153
-
154
- const onAddToWalletClicked = async () => {
155
- try {
156
- await launchStartCardProvisioning(props.pushProvisioningModule as NativeModule, walletRef.current);
157
- } catch (error) {
158
- if (error instanceof Error) {
159
- const parsedError = JSON.parse(error.message);
160
- if (parsedError.code === CardAddToWalletErrors.closedNativeWalletScreen) return;
161
- }
162
- console.log(error);
129
+ useEffect(() => {
130
+ if (props.pushProvisioningModule) {
131
+ UnitSDK.setPushProvisioningModule(props.pushProvisioningModule);
163
132
  }
164
- };
133
+ }, [props.pushProvisioningModule]);
165
134
 
166
135
  return (
167
- <View style={{ height }}>
136
+ <View style={{ height, width: '100%' }}>
168
137
  <WebComponent
169
138
  ref={webRef}
170
139
  type={WebComponentType.card}
@@ -174,7 +143,6 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
174
143
  language={props.language}
175
144
  script={getCardScript()}
176
145
  onMessage={message => handleMessage(message)}
177
- width={windowWidth}
178
146
  isScrollable={false}
179
147
  />
180
148
  </View>
@@ -1,13 +1,9 @@
1
1
  import { DISPATCH_REQUEST_REFRESH } from './../../scripts/html/bodyScript';
2
2
  import type WebView from 'react-native-webview';
3
3
  import type { UNCardComponentProps } from './UNCardComponent';
4
- import { WebComponentType } from '../../webComponent/WebComponent';
5
- import type { NativeModules } from 'react-native';
6
- import { getMobileWalletPayload } from './networking/requests/UNWalletPayloadRequest';
7
- import { UNWallet, UNWalletCode, UNWalletName } from '../../../src/sharedTypes/wallet.types';
8
4
  import type { RequestRefreshEvent } from '../../messages/webMessages/unitMessages';
9
- import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
10
- import type { UNCardMenuAction } from '../../sharedTypes';
5
+ import type { UNCardMenuAction } from '../../types/shared';
6
+ import { WebComponentType } from '../../types/internal/webComponent.types';
11
7
 
12
8
  export const getCardParams = (props: UNCardComponentProps) => {
13
9
  return `
@@ -38,46 +34,3 @@ export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRe
38
34
  currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
39
35
  }
40
36
  };
41
-
42
- export const launchGetWallets = async (customerToken: string, cardId: string, pushProvisioningModule: typeof NativeModules) => {
43
- try {
44
- const env = UnitSDK.getEnv();
45
- if (!env) return null;
46
-
47
- const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env);
48
- if (!encryptedPayload) return null;
49
-
50
- const walletsResponse = await pushProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));
51
- const parsedWalletsResponse = JSON.parse(walletsResponse);
52
- const wallets = parsedWalletsResponse.wallets;
53
-
54
- if (!wallets) return null;
55
- if (wallets[0].code === UNWalletCode.Apple) {
56
- return ({ name: UNWalletName.Apple, code: UNWalletCode.Apple, status: wallets[0].status });
57
- } else {
58
- const googleWallet = wallets.filter((wallet: { name: UNWalletName }) => {
59
- return wallet.name === UNWalletName.Google;
60
- });
61
- if (!googleWallet) return;
62
- return ({ name: UNWalletName.Google, code: UNWalletCode.Google, status: googleWallet[0].status });
63
- }
64
- } catch (error) {
65
- return Promise.reject(error);
66
- }
67
-
68
- };
69
-
70
- export const launchStartCardProvisioning = async (pushProvisioningModule: typeof NativeModules, wallet: UNWallet | null) => {
71
- try {
72
- const response = await pushProvisioningModule.launchStartCardProvisioning(
73
- JSON.stringify({
74
- walletCode: wallet?.code,
75
- walletName: wallet?.name
76
- }));
77
- return response;
78
- }
79
-
80
- catch (error) {
81
- return Promise.reject(error);
82
- }
83
- };
@@ -1,15 +1,15 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { View, NativeModules, Platform } from 'react-native';
3
- import { WebComponent, WebComponentType } from '../../webComponent/WebComponent';
4
- import { PresentationMode } from '../../scripts/html/bodyHtml';
3
+ import { WebComponent } from '../../webComponent/WebComponent';
5
4
  import type { WebViewMessage } from '../../messages/webMessages';
6
5
  import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
7
6
  import { UnitMessage } from '../../messages/webMessages/unitMessages';
8
7
  import { getCheckDepositParams, getCheckDepositScript } from './UNCheckDepositComponent.utils';
9
8
  import { CheckMessage } from '../../messages/webMessages/checkMessage';
10
- import type { UNCheckDepositData } from '../../sharedTypes/checkDeposit.types';
11
- import type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../sharedTypes';
9
+ import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
10
+ import type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';
12
11
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
12
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
13
13
 
14
14
  const { Camera } = NativeModules;
15
15
 
@@ -0,0 +1,13 @@
1
+ import { UNCardFlows } from './card/UNCardFlows';
2
+ import { UnitSDK } from '../unitSdkManager/UnitSdkManager';
3
+
4
+ export class UNFlows {
5
+ constructor() {
6
+ console.log('new Flows instance created');
7
+ }
8
+
9
+ public async startPushProvisioning(cardId: string, customerToken: string) {
10
+ UnitSDK.setCustomerToken(customerToken);
11
+ UNCardFlows.startPushProvisioning(cardId, customerToken);
12
+ }
13
+ }
@@ -0,0 +1,25 @@
1
+ import EventBus from '../../helpers/EventBus';
2
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
3
+ import { BottomSheetRenderingType, type WebComponentData, type WebComponentRendering } from '../../types/internal/bottomSheet.types';
4
+ import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
5
+
6
+ export class UNCardFlows {
7
+ public static startPushProvisioning = async (cardId: string, customerToken: string) => {
8
+ try {
9
+ const addToWalletComponentData: WebComponentData = {
10
+ type: WebComponentType.cardAction,
11
+ presentationMode: PresentationMode.CoverInjectedHeight,
12
+ params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`,
13
+ };
14
+
15
+ const event: WebComponentRendering = {
16
+ type: BottomSheetRenderingType.WebComponent,
17
+ data: addToWalletComponentData,
18
+ };
19
+
20
+ EventBus.Instance.event(BottomSheetNativeMessage.START_FLOW, event);
21
+ } catch (error) {
22
+ console.error(error);
23
+ }
24
+ };
25
+ }
@@ -0,0 +1,67 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { UNWalletCode, type UNWallet, UNWalletName } from '../../../types/shared/wallet.types';
3
+ import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
4
+ import { getMobileWalletPayload } from '../../../networking/requests/UNWalletPayloadRequest';
5
+
6
+ export type CardToEncryptedPayload = {
7
+ [cardId: string]: string;
8
+ };
9
+
10
+ export const useCardWallet = (cardId: string) => {
11
+ const [currentUNWallet, setCurrentUNWallet] = useState<UNWallet>();
12
+
13
+ useEffect(() => {
14
+ const getEncryptedPayload = async () => {
15
+ const env = UnitSDK.getEnv();
16
+ const customerToken = UnitSDK.getCustomerToken();
17
+ if (!env || !customerToken) return;
18
+
19
+ const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env);
20
+ return encryptedPayload;
21
+ };
22
+
23
+ const getCardWalletData = async () => {
24
+ const currentProvisioningModule = UnitSDK.getPushProvisionModule();
25
+ if (!currentProvisioningModule) return;
26
+ try {
27
+ const encryptedPayload = await getEncryptedPayload();
28
+ const walletsResponse = await currentProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));
29
+
30
+ const unWallet: UNWallet | null = parseWalletsResponse(walletsResponse);
31
+ if (!unWallet) return;
32
+ setCurrentUNWallet(unWallet);
33
+ return;
34
+ } catch (error) {
35
+ return Promise.reject(error);
36
+ }
37
+ };
38
+
39
+ getCardWalletData();
40
+
41
+ }, [cardId]);
42
+
43
+ return {
44
+ currentUNWallet
45
+ };
46
+
47
+ };
48
+
49
+ const parseWalletsResponse = (walletsResponse: string): UNWallet | null => {
50
+ try {
51
+ const parsedWalletsResponse = JSON.parse(walletsResponse);
52
+ const wallets = parsedWalletsResponse.wallets;
53
+
54
+ if (!wallets) return null;
55
+ if (wallets[0].code === UNWalletCode.Apple) {
56
+ return ({ name: UNWalletName.Apple, code: UNWalletCode.Apple, status: wallets[0].status });
57
+ } else {
58
+ const googleWallet = wallets.filter((wallet: { name: UNWalletName }) => {
59
+ return wallet.name === UNWalletName.Google;
60
+ });
61
+ if (!googleWallet) return null;
62
+ return ({ name: UNWalletName.Google, code: UNWalletCode.Google, status: googleWallet[0].status });
63
+ }
64
+ } catch (error) {
65
+ throw new Error('Error parsing wallet response');
66
+ }
67
+ };
@@ -0,0 +1,20 @@
1
+ import type { UNWallet } from '../../types/shared/wallet.types';
2
+ import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
3
+
4
+ export const launchStartCardProvisioning = async (wallet: UNWallet | null) => {
5
+ const pushProvisioningModule = UnitSDK.getPushProvisionModule();
6
+ if (!pushProvisioningModule) return;
7
+
8
+ try {
9
+ const response = await pushProvisioningModule.launchStartCardProvisioning(
10
+ JSON.stringify({
11
+ walletCode: wallet?.code,
12
+ walletName: wallet?.name
13
+ }));
14
+ return response;
15
+ }
16
+
17
+ catch (error) {
18
+ return Promise.reject(error);
19
+ }
20
+ };
package/src/index.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './components';
2
2
 
3
- export * from './sharedTypes';
3
+ export * from './types/shared';
4
4
 
5
5
  export { UnitSDK, UNEnvironment } from './unitSdkManager/UnitSdkManager';
@@ -0,0 +1,15 @@
1
+ import type {NativeComponentRendering, WebComponentRendering, SlotRendering } from '../../types/internal/bottomSheet.types';
2
+
3
+ export enum BottomSheetNativeMessage {
4
+ START_FLOW = 'startBottomSheetFlow',
5
+ }
6
+
7
+ export enum CardAddToWalletErrors {
8
+ closedNativeWalletScreen = 'VP_ERROR_302'
9
+ }
10
+
11
+ export type StartBottomSheetFlowMessage = SlotRendering | WebComponentRendering | NativeComponentRendering
12
+
13
+ export type BottomSheetNativeEvent = |
14
+ StartBottomSheetFlowMessage
15
+ // BottomSheetChangeFlowMessage - probably, we want to add this message event in the future to alternate between flows
@@ -1,27 +1,4 @@
1
- import type { UNCardAddToWalletStatus } from '../../sharedTypes/wallet.types';
2
-
3
- export enum CardNativeMessage {
4
- CARD_GET_ADD_TO_WALLET_STATUS = 'cardGetAddToWalletStatus',
5
- CARD_UPDATE_ADD_TO_WALLET_STATUS = 'cardUpdateAddToWalletStatus',
6
- CARD_START_PUSH_PROVISIONING = 'cardStartPushProvisioning'
7
- }
8
-
1
+ // Should we remove it ?
9
2
  export enum CardAddToWalletErrors {
10
3
  closedNativeWalletScreen = 'VP_ERROR_302'
11
4
  }
12
- export interface UNCardAddToWalletStatusEvent {
13
- status: UNCardAddToWalletStatus
14
- }
15
-
16
- export interface CardGetAddToWalletStatusEvent {
17
- cardId: string
18
- }
19
-
20
- export interface CardStartPushProvisioningEvent {
21
- cardId: string
22
- }
23
-
24
- export type CardNativeEvent =
25
- | UNCardAddToWalletStatusEvent
26
- | CardGetAddToWalletStatusEvent
27
- | CardStartPushProvisioningEvent
@@ -1,13 +1,13 @@
1
- import type { CardNativeEvent, CardNativeMessage } from './cardMessage';
1
+ import type { BottomSheetNativeEvent, BottomSheetNativeMessage } from './bottomSheetMessage';
2
2
  import type { SDKEvent, SDKMessage } from './sdkMessage';
3
3
 
4
4
  export type NativeMessageType =
5
5
  | SDKMessage
6
- | CardNativeMessage
6
+ | BottomSheetNativeMessage
7
7
 
8
8
  export type NativeEvent =
9
- | CardNativeEvent
10
9
  | SDKEvent
10
+ | BottomSheetNativeEvent
11
11
 
12
12
  export interface NativeMessage {
13
13
  type: NativeMessageType,
@@ -1,4 +1,4 @@
1
- import type { UNAccountData } from '../../sharedTypes';
1
+ import type { UNAccountData } from '../../types/shared';
2
2
 
3
3
  export enum AccountMessage {
4
4
  UNIT_ACCOUNT_CHANGED = 'unitAccountChanged'
@@ -1,4 +1,4 @@
1
- import type { UNACHData } from '../../sharedTypes';
1
+ import type { UNACHData } from '../../types/shared';
2
2
 
3
3
  export interface PaymentCreatedEvent {
4
4
  data: UNACHData
@@ -1,4 +1,4 @@
1
- import type { UNBookPaymentData } from '../../sharedTypes';
1
+ import type { UNBookPaymentData } from '../../types/shared';
2
2
 
3
3
  export interface PaymentCreatedEvent {
4
4
  data: UNBookPaymentData
@@ -1,4 +1,4 @@
1
- import type { UNCardData } from '../../sharedTypes';
1
+ import type { UNCardData } from '../../types/shared';
2
2
 
3
3
  export enum CardMessage {
4
4
  CARD_ACTIVATED = 'unitCardActivated',
@@ -1,4 +1,4 @@
1
- import type { UNCheckDepositData } from '../../sharedTypes/checkDeposit.types';
1
+ import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
2
2
 
3
3
  export enum CheckMessage {
4
4
  // check deposit
@@ -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
 
5
5
  export enum RESPONSE_KEYS {
6
6
  errors = 'errors',
@@ -9,9 +9,10 @@ export enum UnitMessage {
9
9
  UNIT_REQUEST_DOWNLOAD = 'unitRequestDownload',
10
10
  UNIT_PLAID_TOKEN_CREATED = 'unitPlaidLinkTokenCreated',
11
11
  UNIT_REQUEST_EXTERNAL_SDK = 'unitRequestExternalSdk',
12
- UNIT_PLAID_RESPONSE = 'unitPlaidResponse'
13
-
12
+ UNIT_PLAID_RESPONSE = 'unitPlaidResponse',
13
+ PAGE_HEIGHT = 'PAGE_HEIGHT'
14
14
  }
15
+
15
16
  export interface RequestRenderingEvent {
16
17
  data: RequestRenderingEventData
17
18
  }
@@ -1,4 +1,4 @@
1
- import { UNEnvironment } from '../../../../unitSdkManager/UnitSdkManager';
1
+ import { UNEnvironment } from '../../unitSdkManager/UnitSdkManager';
2
2
 
3
3
  export const APIHeaders = {
4
4
  AUTHORIZATION: 'Authorization',
@@ -1,6 +1,8 @@
1
1
  import axios from 'axios';
2
2
  import { APIHeaders, UNIT_SECURE_URL } from '../common/UNNetworkConstants';
3
- import { UnitSDK, UNEnvironment } from '../../../../unitSdkManager/UnitSdkManager';
3
+ import { UnitSDK, UNEnvironment } from '../../unitSdkManager/UnitSdkManager';
4
+
5
+ // TODO: use apiClient class for handling requests.
4
6
 
5
7
  export const getMobileWalletPayload = async (customerToken: string, cardId: string, env: UNEnvironment) => {
6
8
  const headers = {
@@ -1,18 +1,6 @@
1
- export const webViewId = 'webViewContainer';
2
-
3
- export enum PresentationMode {
4
- /*
5
- CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.
6
-
7
- Inherit - inherit the parent size by style of 100 view height
1
+ import { PresentationMode } from '../../types/internal/webComponent.types';
8
2
 
9
- Default - return the unit component script
10
- */
11
-
12
- CoverInjectedHeight = 'coverInjectedHeight',
13
- Inherit = 'inherit',
14
- Default = 'deafult'
15
- }
3
+ export const webViewId = 'webViewContainer';
16
4
 
17
5
  export const getHtmlBody = (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => {
18
6
  const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;
@@ -0,0 +1,43 @@
1
+ import type { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
2
+ import type { PresentationMode, WebComponentType } from './webComponent.types';
3
+
4
+ export enum BottomSheetRenderingType {
5
+ Slot,
6
+ WebComponent,
7
+ NativeComponent
8
+ }
9
+
10
+ export type BottomSheetSlotData = {
11
+ // The data that rendered by the web view
12
+ componentName?: WebComponentType,
13
+ componentResourceId?: string,
14
+ requestRenderingEvent: RequestRenderingEvent
15
+ }
16
+
17
+ export type WebComponentData = {
18
+ type: WebComponentType;
19
+ presentationMode?: PresentationMode,
20
+ params?: string;
21
+ theme?: string;
22
+ language?: string;
23
+ windowParams?: string;
24
+ }
25
+
26
+ export type NativeComponentData = {
27
+ component: React.ReactNode,
28
+ }
29
+
30
+ export interface SlotRendering {
31
+ type: BottomSheetRenderingType.Slot,
32
+ data: BottomSheetSlotData
33
+ }
34
+
35
+ export interface WebComponentRendering {
36
+ type: BottomSheetRenderingType.WebComponent,
37
+ data: WebComponentData
38
+ }
39
+
40
+ export interface NativeComponentRendering {
41
+ type: BottomSheetRenderingType.NativeComponent,
42
+ data: NativeComponentData
43
+ }
@@ -0,0 +1,26 @@
1
+ export 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
+
11
+ cardAction = 'unit-elements-card-action',
12
+ }
13
+
14
+ export enum PresentationMode {
15
+ /*
16
+ CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.
17
+
18
+ Inherit - inherit the parent size by style of 100 view height
19
+
20
+ Default - return the unit component script
21
+ */
22
+
23
+ CoverInjectedHeight = 'coverInjectedHeight',
24
+ Inherit = 'inherit',
25
+ Default = 'deafult'
26
+ }
@@ -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